| import {css, html, LitElement} from 'lit'; |
| * Lite component inspired in the now removed material-web's Formfield. |
| * https://github.com/material-components/material-web/commit/753a03be963f7b5242e98b73d1309abbe9f5bf51 |
| export default class TwptFormField extends LitElement { |
| <label @click="${this._labelClick}"> |
| <slot name="label"></slot> |
| const input = this._input; |
| if (!input || !this.shadowRoot) return; |
| return this._slottedChildren?.[0] ?? null; |
| if (!this.shadowRoot) return null; |
| const slot = this.shadowRoot.querySelector('slot'); |
| return slot.assignedElements({flatten: true}); |
| window.customElements.define('twpt-form-field', TwptFormField); |