{"bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"2802b03b9a5608d84064776fa1a7e698c587f25d","tarball":"https://registry.npmjs.org/@material/form-field/-/form-field-0.35.0.tgz","fileCount":11,"integrity":"sha512-Jns+bLCZv6fjLXghGMQFCI3fAO/FBizx4ff9u3CrmfxAY3KkESYQgPIsqRSBUb+cYPOE2949yV2M53CuCoL58Q==","signatures":[{"sig":"MEQCIF6OqxU6+yE0rY08Nb625gOzhCadwsqauElagz86x3iNAiAmpf0kxSiCUqmz+cCFHZ6bk841inIhsZMFNSYpvw16UA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":121879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3mDTCRA9TVsSAnZWagAAa10P/jRFc4hsUvqe9onFtx7g\nut/jFkUfL5OQg7uG6QyKyTfpScvGU/ZIWCwtxM8wJHI/KIBIEn5XwYpFhqQK\nij6vU3v6wnCz0HkH5nBXQSfNpYOvoXkEBWB4M8ylkpCmy9tIFfhnY96Yq10t\ngHC7I/H23hN+9830NspMK678I9ZYq/NFUE8hArtPzUT7RfMmbuJg7YKIqGxu\nYcXlt+cQZ4sr5LrWItqnL0Rl56Qa+ucqnfNmYEktA7vfgcvtVRyaogs1OHUo\noJ/6x5KIooHKkLZsC5RWfFsJRmTU5sQaARbB9WgvTUKMl/7cfg9DI7lAaqP5\n+4bxvIIzaPytaOiUCbC4EY3Cyg/XWHPlj9jIusihy3+MnkgRPnSlSqE4Dn7d\nZJ2zcTLOg1hys7jjv8oOkkjmi8JLAZd/Iujegv+kJHlFmBNVFV2NQMWwOxKI\nt/CfZbj5i6lxjEWlZgLnIVw9/gnclVyx9dvieRb7Oq1ik9qGw4sr3EJ+RcYN\nnwRLT8peGV85Nu9gmaZ1Db3WL9441eo2Ro+tPbqLFiuGKxbVN+jm9WsF6m9k\n1NAEsSQ+9D/lDPkze6h8UcIVdM3+qzHcqBRL6QzL3PTyaA6i3aOq36XQWKQk\nBJna2yCe9DdpyPu6VUSaUk6a1inU9nH/BkrLfBDJr0hHOQWh8ND4RH5qZbFC\nz4YH\r\n=0MHJ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","name":"@material/form-field","readme":"<!--docs:\ntitle: \"Form Fields\"\nlayout: detail\nsection: components\npath: /catalog/input-controls/form-fields/\n-->\n\n# Form Fields\n\nMDC Form Field provides an `mdc-form-field` helper class for easily making theme-aware, RTL-aware\nform field + label combos. It also provides an `MDCFormField` class for easily making input ripples\nrespond to label events.\n\n## Installation\n\n```\nnpm install @material/form-field\n```\n\n## CSS Usage\n\nThe `mdc-form-field` class can be used as a parent element, with any combination of adjacent `input` and `label` as\nimmediate children:\n\n```html\n<div class=\"mdc-form-field\">\n  <input type=\"checkbox\" id=\"input\">\n  <label for=\"input\">Input Label</label>\n</div>\n```\n\nBy default, this will position the label after the input. You can change this behavior using the\n`align-end` modifier class.\n\n```html\n<div class=\"mdc-form-field mdc-form-field--align-end\">\n  <input type=\"checkbox\" id=\"input\">\n  <label for=\"input\">Input Label</label>\n</div>\n```\n\nNow the label will be positioned before the checkbox.\n\n### Usage with MDC Web Components\n\n`mdc-form-field` works not just with `input` elements, but with _any_ immediate child element as long as its\nsuccessive sibling is a `label` element. This means it will work for MDC Web form controls such as Checkbox and Radio:\n\n```html\n<div class=\"mdc-form-field\">\n  <div class=\"mdc-checkbox\">\n    <input type=\"checkbox\"\n           id=\"my-checkbox\"\n           class=\"mdc-checkbox__native-control\"/>\n    <div class=\"mdc-checkbox__background\">\n      <svg class=\"mdc-checkbox__checkmark\"\n           viewBox=\"0 0 24 24\">\n        <path class=\"mdc-checkbox__checkmark-path\"\n              fill=\"none\"\n              stroke=\"white\"\n              d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n      </svg>\n      <div class=\"mdc-checkbox__mixedmark\"></div>\n    </div>\n  </div>\n  <label for=\"my-checkbox\" id=\"my-checkbox-label\">This is my checkbox</label>\n</div>\n```\n\n> Note that MDC Form Field is **not** intended for cases where a label and input are already handled together by\n> another component's styles and logic. For example, JavaScript-enhanced instances of MDC Text Field already manage\n> a label and input together under their own root element.\n\n### RTL Support\n\n`mdc-form-field` is automatically RTL-aware, and will re-position elements within an RTL context.\n`mdc-form-field` will apply RTL styles whenever it, or its ancestors, has a `dir=\"rtl\"` attribute.\n\n\n## JS Usage\n\n### Including in code\n\n#### ES2015\n\n```javascript\nimport {MDCFormField, MDCFormFieldFoundation} from '@material/form-field';\n```\n\n#### CommonJS\n\n```javascript\nconst mdcFormField = require('mdc-form-field');\nconst MDCFormField = mdcFormField.MDCFormField;\nconst MDCFormFieldFoundation = mdcFormField.MDCFormFieldFoundation;\n```\n\n#### AMD\n\n```javascript\nrequire(['path/to/mdc-form-field'], mdcFormField => {\n  const MDCFormField = mdcFormField.MDCFormField;\n  const MDCFormFieldFoundation = mdcFormField.MDCFormFieldFoundation;\n});\n```\n\n#### Global\n\n```javascript\nconst MDCFormField = mdc.formField.MDCFormField;\nconst MDCFormFieldFoundation = mdc.formField.MDCFormFieldFoundation;\n```\n\n### Instantiation\n\n```javascript\nimport {MDCFormField} from '@material/form-field';\n\nconst formField = new MDCFormField(document.querySelector('.mdc-form-field'));\n```\n\n### MDCFormField API\n\nThe `MDCFormField` functionality is exposed through a single accessor method.\n\n#### MDCFormField.input\n\nRead-write property that works with an instance of an MDC Web input element.\n\nIn order for the label ripple integration to work correctly, this property needs to be set to a\nvalid instance of an MDC Web input element which exposes a `ripple` getter.\n\n```javascript\nconst formField = new MDCFormField(document.querySelector('.mdc-form-field'));\nconst radio = new MDCRadio(document.querySelector('.mdc-radio'));\n\nformField.input = radio;\n```\n\nNo action is taken if the `input` property is not set or the input instance doesn't expose a\n`ripple` getter.\n\n\n### Adapter\n\n| Method Signature | Description |\n| --- | --- |\n| `registerInteractionHandler(type: string, handler: EventListener) => void` | Adds an event listener `handler` for event type `type` to the label. |\n| `deregisterInteractionHandler(type: string, handler: EventListener) => void` | Removes an event listener `handler` for event type `type` to the label. |\n| `activateInputRipple() => void` | Activates the ripple on the input element. Should call `activate` on the input element's `ripple` property. |\n| `deactivateInputRipple() => void` | Deactivates the ripple on the input element. Should call `deactivate` on the input element's `ripple` property. |\n","license":"Apache-2.0","_npmUser":{"name":"bonniez","email":"bonniez@google.com"},"homepage":"https://github.com/material-components/material-components-web#readme","keywords":["material components","material design","form"],"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git"},"_npmVersion":"5.6.0","description":"Material Components for the web wrapper for laying out form fields and labels next to one another","directories":{},"maintainers":[{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"acdvorak","email":"acdvorak@gmail.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bonniez","email":"bonniez@google.com"},{"name":"bwobrien","email":"obrien.test@gmail.com"},{"name":"kfranqueiro","email":"kenneth.franqueiro@gmail.com"},{"name":"lynnjepsen","email":"lynnjepsen@google.com"},{"name":"material-admin","email":"lynnjepsen+npm@google.com"},{"name":"moog16","email":"mattgoo@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"williamernest","email":"williamernest@google.com"}],"_nodeVersion":"8.7.0","dependencies":{"@material/rtl":"^0.35.0","@material/base":"^0.35.0","@material/theme":"^0.35.0","@material/typography":"^0.35.0","@material/selection-control":"^0.35.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/form-field_0.35.0_1524523218692_0.01156863616549253","host":"s3://npm-registry-packages"},"_id":"@material/form-field@0.35.0","version":"0.35.0"}