import { html, nothing } from 'lit'; import { property, query } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; import { BootstrapElement, defineElement, type Size } from '@bootstrap-wc/core'; export type InputType = | 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url' | 'date' | 'datetime-local' | 'time' | 'month' | 'week' | 'color'; /** * `` — Bootstrap text input. * * **Renders the native `` into LIGHT DOM**, not into a shadow root. * This is the same approach Ionic, Adobe Spectrum, Lion, and Carbon's * web components take for form controls and is the only way to make * browser autofill (Chrome / Safari / Firefox) and password managers * (1Password, Bitwarden, …) work reliably for shadow-DOM-based component * libraries: their predictors walk the light-DOM tree, and their UI * popovers anchor to the focused light-DOM input. A hidden mirror in a * sibling never receives focus, so the autofill chip never appears. * * Form participation is handled natively — the `` lives inside the * nearest `
` (typically a ``) and is included in * `FormData` automatically. No `ElementInternals` plumbing required. * * @fires bs-input - Mirrors native `input`. * @fires bs-change - Mirrors native `change`. */ export class BsInput extends BootstrapElement { /** * Mark as form-associated so the host is a labelable element. When the * user clicks `