kanto-ds 1.4.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/chunks/{defaults-BwgjMcww.js → defaults-CFrjqae2.js} +22 -21
- package/dist/chunks/{defaults-BwgjMcww.js.map → defaults-CFrjqae2.js.map} +1 -1
- package/dist/chunks/events-r51msXNf.js +22 -0
- package/dist/chunks/{events-Bjl5Zmmq.js.map → events-r51msXNf.js.map} +1 -1
- package/dist/chunks/floating-B7_Dahpn.js +54 -0
- package/dist/chunks/floating-B7_Dahpn.js.map +1 -0
- package/dist/chunks/{form-control-CxjBTt1c.js → form-control-B74_EHtG.js} +7 -7
- package/dist/chunks/form-control-B74_EHtG.js.map +1 -0
- package/dist/chunks/{index-DSSLJirw.js → index-STEEvEP7.js} +24 -12
- package/dist/chunks/index-STEEvEP7.js.map +1 -0
- package/dist/chunks/kt-calendar-B_hFdD9V.js +640 -0
- package/dist/chunks/kt-calendar-B_hFdD9V.js.map +1 -0
- package/dist/chunks/{kt-element-E-tfJpGQ.js → kt-element-Djx2JcGl.js} +2 -2
- package/dist/chunks/{kt-element-E-tfJpGQ.js.map → kt-element-Djx2JcGl.js.map} +1 -1
- package/dist/chunks/{listbox-Sm3nvsC6.js → listbox-llcUu_V-.js} +18 -14
- package/dist/chunks/{listbox-Sm3nvsC6.js.map → listbox-llcUu_V-.js.map} +1 -1
- package/dist/chunks/locale-C5xLkGx5.js +14 -0
- package/dist/chunks/locale-C5xLkGx5.js.map +1 -0
- package/dist/chunks/position-Cx_ZH5zh.js +39 -0
- package/dist/chunks/position-Cx_ZH5zh.js.map +1 -0
- package/dist/components/core/kt-avatar/kt-avatar.js +2 -2
- package/dist/components/core/kt-badge/kt-badge.js +3 -3
- package/dist/components/core/kt-button/kt-button.js +1 -1
- package/dist/components/core/kt-card/kt-card.js +2 -2
- package/dist/components/core/kt-code/kt-code.js +3 -3
- package/dist/components/core/kt-icon/kt-icon.js +2 -2
- package/dist/components/core/kt-kbd/kt-kbd.js +1 -1
- package/dist/components/core/kt-split-button/kt-split-button.js +4 -4
- package/dist/components/data/kt-chart/kt-chart.js +3 -3
- package/dist/components/data/kt-meter/kt-meter.js +1 -1
- package/dist/components/data/kt-pagination/kt-pagination.js +3 -3
- package/dist/components/data/kt-stat/kt-stat.js +1 -1
- package/dist/components/data/kt-table/kt-table.d.ts +53 -3
- package/dist/components/data/kt-table/kt-table.js +286 -131
- package/dist/components/data/kt-table/kt-table.js.map +1 -1
- package/dist/components/data/kt-table/window.d.ts +19 -0
- package/dist/components/data/kt-timeline/kt-timeline.js +1 -1
- package/dist/components/feedback/kt-alert/kt-alert.js +3 -3
- package/dist/components/feedback/kt-empty-state/kt-empty-state.js +1 -1
- package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js +10 -10
- package/dist/components/feedback/kt-progress-bar/kt-progress-bar.js.map +1 -1
- package/dist/components/feedback/kt-skeleton/kt-skeleton.js +1 -1
- package/dist/components/feedback/kt-toast/kt-toast.js +58 -42
- package/dist/components/feedback/kt-toast/kt-toast.js.map +1 -1
- package/dist/components/feedback/kt-toast-container/kt-toast-container.js +1 -1
- package/dist/components/feedback/kt-tooltip/kt-tooltip.d.ts +20 -0
- package/dist/components/feedback/kt-tooltip/kt-tooltip.js +95 -51
- package/dist/components/feedback/kt-tooltip/kt-tooltip.js.map +1 -1
- package/dist/components/forms/kt-calendar/kt-calendar.d.ts +96 -0
- package/dist/components/forms/kt-calendar/kt-calendar.js +13 -0
- package/dist/components/forms/kt-calendar/kt-calendar.js.map +1 -0
- package/dist/components/forms/kt-checkbox/kt-checkbox.d.ts +9 -0
- package/dist/components/forms/kt-checkbox/kt-checkbox.js +34 -20
- package/dist/components/forms/kt-checkbox/kt-checkbox.js.map +1 -1
- package/dist/components/forms/kt-date-picker/kt-date-picker.d.ts +105 -0
- package/dist/components/forms/kt-date-picker/kt-date-picker.js +382 -0
- package/dist/components/forms/kt-date-picker/kt-date-picker.js.map +1 -0
- package/dist/components/forms/kt-drag-drop/kt-drag-drop.d.ts +9 -0
- package/dist/components/forms/kt-drag-drop/kt-drag-drop.js +36 -22
- package/dist/components/forms/kt-drag-drop/kt-drag-drop.js.map +1 -1
- package/dist/components/forms/kt-form/kt-form.js +2 -2
- package/dist/components/forms/kt-input/kt-input.d.ts +37 -1
- package/dist/components/forms/kt-input/kt-input.js +380 -194
- package/dist/components/forms/kt-input/kt-input.js.map +1 -1
- package/dist/components/forms/kt-input-menu/kt-input-menu.d.ts +13 -0
- package/dist/components/forms/kt-input-menu/kt-input-menu.js +73 -42
- package/dist/components/forms/kt-input-menu/kt-input-menu.js.map +1 -1
- package/dist/components/forms/kt-label-input/kt-label-input.js +1 -1
- package/dist/components/forms/kt-radio-group/kt-radio-group.d.ts +9 -0
- package/dist/components/forms/kt-radio-group/kt-radio-group.js +67 -53
- package/dist/components/forms/kt-radio-group/kt-radio-group.js.map +1 -1
- package/dist/components/forms/kt-select/kt-select.d.ts +13 -0
- package/dist/components/forms/kt-select/kt-select.js +87 -56
- package/dist/components/forms/kt-select/kt-select.js.map +1 -1
- package/dist/components/forms/kt-textarea/kt-textarea.d.ts +9 -0
- package/dist/components/forms/kt-textarea/kt-textarea.js +28 -14
- package/dist/components/forms/kt-textarea/kt-textarea.js.map +1 -1
- package/dist/components/forms/kt-toggle/kt-toggle.d.ts +9 -0
- package/dist/components/forms/kt-toggle/kt-toggle.js +43 -29
- package/dist/components/forms/kt-toggle/kt-toggle.js.map +1 -1
- package/dist/components/navigation/kt-breadcrumb/kt-breadcrumb.js +3 -3
- package/dist/components/navigation/kt-header/kt-header.js +3 -3
- package/dist/components/navigation/kt-page-header/kt-page-header.js +1 -1
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.d.ts +9 -0
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js +40 -22
- package/dist/components/navigation/kt-segmented-control/kt-segmented-control.js.map +1 -1
- package/dist/components/navigation/kt-sub-menu-navigation/kt-sub-menu-navigation.js +3 -3
- package/dist/components/navigation/kt-tabs/kt-tabs.js +2 -2
- package/dist/components/navigation/kt-toggle-button/kt-toggle-button.js +2 -2
- package/dist/components/navigation/kt-toggle-button-group/kt-toggle-button-group.js +3 -3
- package/dist/components/overlays/kt-collapsible/kt-collapsible.js +2 -2
- package/dist/components/overlays/kt-confirm-dialog/kt-confirm-dialog.js +3 -3
- package/dist/components/overlays/kt-dropdown/kt-dropdown.d.ts +7 -5
- package/dist/components/overlays/kt-dropdown/kt-dropdown.js +67 -57
- package/dist/components/overlays/kt-dropdown/kt-dropdown.js.map +1 -1
- package/dist/components/overlays/kt-modal/kt-modal.js +3 -3
- package/dist/components/overlays/kt-side-panel/kt-side-panel.js +3 -3
- package/dist/custom-elements.json +2110 -124
- package/dist/icons/defaults.d.ts +1 -0
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +91 -87
- package/dist/index.js.map +1 -1
- package/dist/internal/countries.d.ts +24 -9
- package/dist/internal/date.d.ts +53 -0
- package/dist/internal/events.d.ts +5 -0
- package/dist/internal/floating.d.ts +48 -0
- package/dist/internal/form-control.d.ts +5 -1
- package/dist/internal/locale.d.ts +15 -0
- package/dist/internal/position.d.ts +27 -0
- package/dist/internal/strings.d.ts +15 -0
- package/dist/react/index.d.ts +12 -0
- package/dist/react/index.js +180 -166
- package/dist/react/index.js.map +1 -1
- package/dist/react/jsx.d.ts +11 -1
- package/dist/strings/index.js +1 -1
- package/dist/tokens/base.css +2 -0
- package/dist/tokens/responsive.css +1 -0
- package/dist/tokens/spacing.css +1 -0
- package/dist/vscode.css-custom-data.json +8 -0
- package/dist/vscode.html-custom-data.json +138 -11
- package/dist/vue/index.d.ts +4 -0
- package/dist/vue/index.js +9 -7
- package/dist/vue/index.js.map +1 -1
- package/dist/web-types.json +292 -14
- package/package.json +10 -1
- package/dist/chunks/events-Bjl5Zmmq.js +0 -18
- package/dist/chunks/form-control-CxjBTt1c.js.map +0 -1
- package/dist/chunks/index-DSSLJirw.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kt-input.js","sources":["../../../../src/internal/countries.ts","../../../../src/components/forms/kt-input/kt-input.ts"],"sourcesContent":["/**\n * Country data for the phone mode of `<kt-input>`.\n *\n * Deliberately a short list rather than all 195: an exhaustive picker is a\n * worse experience than a handful of entries and a search box. Applications\n * that need more pass their own list to the element.\n */\n\nexport interface KtCountry {\n /** ISO 3166-1 alpha-2, lowercase. */\n readonly id: string;\n readonly name: string;\n /** International dialling code, without the leading `+`. */\n readonly dialCode: string;\n /** Placeholder showing the local format. */\n readonly format: string;\n}\n\nexport const DEFAULT_COUNTRIES: readonly KtCountry[] = [\n { id: 'us', name: 'United States', dialCode: '1', format: '123-456-7890' },\n { id: 'gb', name: 'United Kingdom', dialCode: '44', format: '7123 456789' },\n { id: 'de', name: 'Germany', dialCode: '49', format: '1234 567890' },\n { id: 'fr', name: 'France', dialCode: '33', format: '1 23 45 67 89' },\n { id: 'be', name: 'Belgium', dialCode: '32', format: '1 23 45 67 89' },\n { id: 'ch', name: 'Switzerland', dialCode: '41', format: '12 345 67 89' },\n];\n\nconst REGIONAL_INDICATOR_A = 0x1f1e6;\nconst LETTER_A = 'A'.charCodeAt(0);\n\n/**\n * The flag emoji for a country code, built from regional indicator symbols.\n *\n * This is the one place emoji appear in a Kanto interface. They are here\n * because no flag icon set ships with the system, and a country picker without\n * flags is markedly slower to scan.\n */\nexport function flagEmoji(id: string): string {\n if (!/^[a-z]{2}$/i.test(id)) return '';\n return String.fromCodePoint(\n ...[...id.toUpperCase()].map(\n (letter) => REGIONAL_INDICATOR_A + letter.charCodeAt(0) - LETTER_A,\n ),\n );\n}\n\n/** Keeps only the digits — what gets stored and submitted. */\nexport function digitsOnly(value: string): string {\n return value.replace(/\\D/g, '');\n}\n\n/**\n * Groups digits for display, per country.\n *\n * North American numbers read as `123 456 7890`, French ones as\n * `6 12 34 56 78` — a single leading digit, then pairs. Everything else falls\n * back to groups of three.\n */\nexport function formatNationalNumber(digits: string, country: KtCountry | undefined): string {\n if (!digits) return '';\n\n const groups: string[] = [];\n let rest = digits;\n\n if (country?.id === 'fr') {\n groups.push(rest.slice(0, 1));\n rest = rest.slice(1);\n while (rest) {\n groups.push(rest.slice(0, 2));\n rest = rest.slice(2);\n }\n } else if (country?.id === 'us' || country?.id === 'ca') {\n for (const size of [3, 3, 4]) {\n if (!rest) break;\n groups.push(rest.slice(0, size));\n rest = rest.slice(size);\n }\n if (rest) groups.push(rest);\n } else {\n while (rest) {\n groups.push(rest.slice(0, 3));\n rest = rest.slice(3);\n }\n }\n\n return groups.filter(Boolean).join(' ');\n}\n\n/** Filters by name, dial code or country code — whatever the user types. */\nexport function searchCountries(\n countries: readonly KtCountry[],\n query: string,\n): readonly KtCountry[] {\n const needle = query.trim().toLowerCase();\n if (!needle) return countries;\n\n return countries.filter(\n (country) =>\n country.name.toLowerCase().includes(needle) ||\n country.dialCode.includes(needle.replace(/^\\+/, '')) ||\n country.id === needle,\n );\n}\n","import { css, html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { live } from 'lit/directives/live.js';\nimport { KtElement, defineElement } from '#internal/kt-element';\nimport { emit } from '#internal/events';\nimport {\n attachFormInternals,\n setFormValue,\n setValidity,\n type UsableInternals,\n} from '#internal/form-control';\nimport {\n DEFAULT_COUNTRIES,\n digitsOnly,\n flagEmoji,\n formatNationalNumber,\n searchCountries,\n type KtCountry,\n} from '#internal/countries';\nimport { strings } from '#internal/strings';\nimport '../../core/kt-icon/kt-icon.js';\n\nexport type KtInputSize = 'small' | 'medium' | 'large';\n\n/** Icon size inside a field, at every field size. */\nconst ICON_SIZE = 18;\n\n/**\n * A single-line text field.\n *\n * Borderless by design: the field is a fill on `--color-dark-12` that gains a\n * 2px *outline* — grey on hover, primary on focus, danger on error. An outline\n * sits outside the box, so nothing reflows when the state changes.\n *\n * The element is form-associated: it serialises into `FormData` under its\n * `name`, resets with the form, and reports validity like a native input.\n *\n * @element kt-input\n *\n * @csspart base - The field container.\n * @csspart control - The native `<input>`.\n * @csspart actions - The trailing icon row.\n *\n * @fires kt-input - On every keystroke. `detail: { value }`.\n * @fires kt-change - When the value is committed (blur or Enter). `detail: { value }`.\n * @fires kt-clear - The clear button was pressed.\n *\n * @example\n * ```html\n * <kt-input placeholder=\"Search everything...\" icon=\"search\"></kt-input>\n * <kt-input type=\"password\" name=\"password\"></kt-input>\n * <kt-input error=\"Invalid email address\" value=\"not-an-address\"></kt-input>\n * ```\n */\nexport class KtInput extends KtElement {\n static readonly formAssociated = true;\n\n static override styles = [\n KtElement.styles,\n css`\n :host {\n display: block;\n }\n\n .field {\n position: relative;\n display: inline-flex;\n align-items: center;\n width: 100%;\n height: var(--button-height);\n padding: 0 var(--button-padding-x);\n gap: var(--gap-button);\n background-color: var(--surface-field);\n border-radius: var(--radius-input);\n /* A resting hairline. A field is a fill on --surface-field, which is\n one ramp step from the page in dark and almost the same colour in\n light — so on a card or inside a modal it simply disappeared and\n read as a bare native control.\n\n A border rather than an outline, because the control inside fills\n the field exactly and a coincident outline is painted over by the\n native widget. A border insets the control by its own width, so it\n cannot be covered. box-sizing: border-box keeps the outer size.\n\n The hover and focus rings stay outlines on top of it, and the\n transparent resting outline is what they animate from: without it\n outline-color starts at the initial value, which resolves to the\n text colour, and hover flashed near-white before settling. */\n border: var(--border-width) solid var(--border-field);\n outline: var(--outline-width) solid transparent;\n transition: outline-color var(--duration-instant);\n }\n\n /* Outline, never border: it sits outside the box, so hover and focus\n change nothing about the layout. */\n .field:hover {\n outline: var(--outline-width) solid var(--color-text-700);\n }\n .field:focus-within {\n outline: var(--outline-width) solid var(--color-primary-base);\n }\n\n .small {\n height: var(--button-height-small);\n }\n .large {\n height: var(--button-height-large);\n }\n\n .error,\n .error:hover,\n .error:focus-within {\n outline: var(--outline-width) solid var(--color-danger-base);\n }\n .error input {\n color: var(--color-danger-text);\n }\n\n .disabled {\n background-color: var(--color-dark-14);\n pointer-events: none;\n }\n .disabled input {\n color: var(--text-disabled);\n }\n\n input {\n width: 100%;\n min-width: 0;\n padding: 0;\n color: var(--text-body);\n font: var(--font-input);\n background: transparent;\n border: none;\n outline: none;\n }\n\n input::placeholder {\n color: var(--text-muted);\n }\n\n /* The clear button is ours; the browser's is redundant. */\n input::-webkit-search-cancel-button {\n display: none;\n }\n\n .actions {\n display: flex;\n flex: none;\n align-items: center;\n gap: var(--gap-button);\n }\n\n .icon-button {\n display: inline-flex;\n align-items: center;\n padding: 0;\n color: var(--text-body);\n background: none;\n border: none;\n cursor: pointer;\n }\n\n .icon-button:focus-visible {\n outline: var(--outline-width) solid var(--color-primary-base);\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n .clear {\n transition: transform var(--duration-instant) ease-in-out;\n }\n .clear:hover {\n transform: rotate(90deg);\n }\n\n .adornment {\n display: flex;\n align-items: center;\n color: var(--text-muted);\n }\n\n .error-icon {\n color: var(--color-danger-text);\n }\n\n /* === PHONE MODE === */\n .country {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n gap: var(--gap-element);\n height: 100%;\n margin-right: var(--button-padding-x);\n padding: 0 var(--button-padding-x) 0 0;\n color: var(--text-body);\n background: none;\n border: none;\n border-right: var(--border-width) solid var(--color-dark-16);\n cursor: pointer;\n font: var(--font-normal-regular);\n user-select: none;\n }\n\n .country:focus-visible {\n outline: var(--outline-width) solid var(--color-primary-base);\n outline-offset: -2px;\n }\n\n .chevron {\n display: inline-flex;\n transform-origin: 50% 50%;\n transition: transform var(--duration-fast) ease-in-out;\n }\n .chevron.open {\n transform: scaleY(-1);\n }\n\n .dial {\n color: var(--text-muted);\n }\n\n .country-panel {\n position: absolute;\n top: calc(100% + 6px);\n left: 0;\n z-index: var(--z-dropdown);\n display: flex;\n flex-direction: column;\n gap: var(--gap-element);\n width: 280px;\n max-height: 225px;\n padding: var(--padding-expand);\n background: var(--color-dark-20);\n border-radius: var(--radius-input);\n }\n\n .country-search {\n width: 100%;\n height: var(--button-height-small);\n padding: 0 12px;\n color: var(--text-body);\n font: var(--font-normal-regular);\n background: var(--color-dark-12);\n border: none;\n border-radius: var(--radius-input);\n outline: none;\n }\n\n .country-list {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--gap-element);\n margin: 0;\n padding: 0;\n overflow-y: auto;\n list-style: none;\n scrollbar-width: thin;\n }\n\n .country-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border-radius: var(--radius-input);\n cursor: pointer;\n font: var(--font-normal-regular);\n }\n .country-item:hover,\n .country-item[aria-selected='true'] {\n background: var(--color-dark-23);\n }\n\n .country-name {\n flex: 1;\n }\n\n .country-empty {\n padding: 8px 12px;\n color: var(--text-muted);\n font: var(--font-normal-small);\n }\n `,\n ];\n\n @query('input')\n private input!: HTMLInputElement;\n\n private internals: UsableInternals | null = null;\n\n /** True while a `password` field is showing its contents. */\n @state()\n private passwordVisible = false;\n\n @state()\n private countryOpen = false;\n\n @state()\n private countryQuery = '';\n\n /** The field's value. The `value` attribute seeds it and acts as the reset value. */\n @property({ type: String })\n value = '';\n\n @property({ type: String })\n name = '';\n\n /** Any native input type. `password` adds the reveal toggle. */\n @property({ type: String })\n type = 'text';\n\n @property({ type: String })\n placeholder = '';\n\n /** Field height: 32 / 40 / 48px at the desktop scale. */\n @property({ type: String, reflect: true })\n size: KtInputSize = 'medium';\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /** Trailing Lucide icon, kebab-case. */\n @property({ type: String })\n icon = '';\n\n /** Error message. A non-empty value puts the field in its error state. */\n @property({ type: String, reflect: true })\n error = '';\n\n /** Shows the clear button once there is something to clear. */\n @property({ type: Boolean })\n clearable = true;\n\n /** Accessible name, when no `<kt-label-input>` wraps the field. */\n @property({ type: String })\n label = '';\n\n @property({ type: String })\n autocomplete = '';\n\n @property({ type: Number })\n maxlength?: number;\n\n /**\n * Countries offered in phone mode. Replace it to widen the list.\n */\n @property({ attribute: false })\n countries: readonly KtCountry[] = DEFAULT_COUNTRIES;\n\n /** Selected country in phone mode, as an ISO 3166-1 alpha-2 code. */\n @property({ type: String })\n country = 'us';\n\n /** The value the enclosing form resets to. */\n private defaultValue = '';\n\n override connectedCallback(): void {\n super.connectedCallback();\n document.addEventListener('pointerdown', this.closeCountryPanel);\n this.internals ??= attachFormInternals(this);\n this.defaultValue = this.value;\n setFormValue(this.internals, this.formValue);\n }\n\n override willUpdate(changed: PropertyValues<this>): void {\n if (\n changed.has('value') ||\n changed.has('required') ||\n changed.has('error') ||\n changed.has('country') ||\n this.stringsChanged(changed)\n ) {\n setFormValue(this.internals, this.value);\n this.refreshValidity();\n }\n }\n\n private refreshValidity(): void {\n const missing = this.required && this.value.length === 0;\n const message = this.error || (missing ? strings().required : '');\n setValidity(\n this.internals,\n { valueMissing: missing, customError: Boolean(this.error) },\n message,\n );\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n document.removeEventListener('pointerdown', this.closeCountryPanel);\n }\n\n /** Called by the platform when the enclosing form is reset. */\n formResetCallback(): void {\n this.value = this.defaultValue;\n this.passwordVisible = false;\n }\n\n /** Called by the platform when the browser restores a session. */\n formStateRestoreCallback(state: string): void {\n this.value = state;\n }\n\n override focus(options?: FocusOptions): void {\n this.input?.focus(options);\n }\n\n override blur(): void {\n this.input?.blur();\n }\n\n /** Selects the field's contents, as `HTMLInputElement.select()` does. */\n select(): void {\n this.input?.select();\n }\n\n /** Phone mode: the country picker, digit-only storage and grouped display. */\n private get isPhone(): boolean {\n return this.type === 'tel';\n }\n\n private get selectedCountry(): KtCountry | undefined {\n return this.countries.find((candidate) => candidate.id === this.country);\n }\n\n /**\n * What the form receives. In phone mode that is the full international\n * number — submitting national digits alone would throw away the country\n * the user picked.\n */\n private get formValue(): string {\n if (!this.isPhone || !this.value) return this.value;\n return `+${this.selectedCountry?.dialCode ?? ''}${this.value}`;\n }\n\n private get displayValue(): string {\n return this.isPhone ? formatNationalNumber(this.value, this.selectedCountry) : this.value;\n }\n\n private get showClear(): boolean {\n return this.clearable && this.value.length > 0 && !this.readonly && !this.disabled;\n }\n\n private get resolvedType(): string {\n // Phone mode renders grouped digits, which type=\"tel\" would not accept\n // back; the value is normalised to digits on input either way.\n if (this.isPhone) return 'text';\n if (this.type !== 'password') return this.type;\n return this.passwordVisible ? 'text' : 'password';\n }\n\n private onInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value;\n this.value = this.isPhone ? digitsOnly(raw) : raw;\n emit(this, 'kt-input', { value: this.value });\n }\n\n private toggleCountryPanel(): void {\n this.countryOpen = !this.countryOpen;\n this.countryQuery = '';\n }\n\n private selectCountry(country: KtCountry): void {\n this.country = country.id;\n this.countryOpen = false;\n this.countryQuery = '';\n emit(this, 'kt-country-change', { country: country.id, dialCode: country.dialCode });\n this.focus();\n }\n\n private closeCountryPanel = (event: Event): void => {\n if (event.composedPath().includes(this)) return;\n this.countryOpen = false;\n };\n\n private onCountryKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.countryOpen) {\n event.stopPropagation();\n this.countryOpen = false;\n this.shadowRoot?.querySelector<HTMLButtonElement>('.country')?.focus();\n }\n }\n\n private renderCountryPicker(): TemplateResult {\n const selected = this.selectedCountry;\n const matches = searchCountries(this.countries, this.countryQuery);\n\n return html`<button\n type=\"button\"\n class=\"country\"\n aria-haspopup=\"listbox\"\n aria-expanded=${this.countryOpen ? 'true' : 'false'}\n aria-label=${strings().countryCode(selected?.name)}\n ?disabled=${this.disabled || this.readonly}\n @click=${this.toggleCountryPanel}\n >\n <span aria-hidden=\"true\">${flagEmoji(this.country)}</span>\n <span class=\"dial\">+${selected?.dialCode ?? ''}</span>\n <span class=${classMap({ chevron: true, open: this.countryOpen })}>\n <kt-icon name=\"chevron-down\" size=\"14\"></kt-icon>\n </span>\n </button>\n ${\n this.countryOpen\n ? html`<div class=\"country-panel\" @pointerdown=${(e: Event) => e.stopPropagation()}>\n <input\n class=\"country-search\"\n placeholder=${strings().searchCountry}\n .value=${this.countryQuery}\n aria-label=${strings().searchCountry}\n @input=${(e: Event) => {\n this.countryQuery = (e.target as HTMLInputElement).value;\n }}\n />\n <ul class=\"country-list\" role=\"listbox\">\n ${\n matches.length === 0\n ? html`<li class=\"country-empty\">${strings().noCountry}</li>`\n : matches.map(\n (candidate) =>\n html`<li\n class=\"country-item\"\n role=\"option\"\n aria-selected=${candidate.id === this.country ? 'true' : 'false'}\n @click=${() => this.selectCountry(candidate)}\n >\n <span aria-hidden=\"true\">${flagEmoji(candidate.id)}</span>\n <span class=\"country-name\">${candidate.name}</span>\n <span class=\"dial\">+${candidate.dialCode}</span>\n </li>`,\n )\n }\n </ul>\n </div>`\n : nothing\n }`;\n }\n\n private onChange(event: Event): void {\n // The native change event does not cross the shadow boundary; re-emit it\n // under a name consumers can actually listen for.\n event.stopPropagation();\n emit(this, 'kt-change', { value: this.value });\n }\n\n private clear(): void {\n this.value = '';\n emit(this, 'kt-clear');\n emit(this, 'kt-input', { value: '' });\n emit(this, 'kt-change', { value: '' });\n this.focus();\n }\n\n private togglePassword(): void {\n this.passwordVisible = !this.passwordVisible;\n }\n\n /** Clicking the padding around the input should focus it, as on a native field. */\n private onFieldPointerDown(event: PointerEvent): void {\n if (event.target === this.input) return;\n if ((event.target as HTMLElement).closest('button')) return;\n event.preventDefault();\n this.focus();\n }\n\n override render(): TemplateResult {\n const hasActions =\n this.type === 'password' || Boolean(this.icon) || Boolean(this.error) || this.showClear;\n\n return html`<div\n part=\"base\"\n class=${classMap({\n field: true,\n [this.size]: true,\n error: Boolean(this.error),\n disabled: this.disabled,\n })}\n @pointerdown=${this.onFieldPointerDown}\n @keydown=${this.onCountryKeyDown}\n >\n ${\n // The icon only shows that something is wrong; this is what gets read\n // out. aria-describedby rather than aria-errormessage, which most\n // screen readers still ignore.\n this.error\n ? html`<span id=\"error-message\" class=\"visually-hidden\">${this.error}</span>`\n : nothing\n }\n ${this.isPhone ? this.renderCountryPicker() : nothing}\n\n <input\n part=\"control\"\n type=${this.resolvedType}\n name=${this.name || nothing}\n .value=${live(this.displayValue)}\n placeholder=${this.placeholder || this.selectedCountry?.format || nothing}\n autocomplete=${this.autocomplete || nothing}\n inputmode=${this.isPhone ? 'tel' : nothing}\n maxlength=${this.maxlength ?? nothing}\n aria-label=${this.label || nothing}\n aria-invalid=${this.error ? 'true' : nothing}\n aria-describedby=${this.error ? 'error-message' : nothing}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n @input=${this.onInput}\n @change=${this.onChange}\n />\n\n ${\n hasActions\n ? html`<div part=\"actions\" class=\"actions\">\n ${\n this.type === 'password'\n ? html`<button\n type=\"button\"\n class=\"icon-button\"\n tabindex=\"-1\"\n aria-label=${this.passwordVisible ? strings().hidePassword : strings().showPassword}\n @click=${this.togglePassword}\n >\n <kt-icon\n name=${this.passwordVisible ? 'eye-off' : 'eye'}\n size=${ICON_SIZE}\n ></kt-icon>\n </button>`\n : nothing\n }\n ${\n this.icon\n ? html`<span class=\"adornment\">\n <kt-icon name=${this.icon} size=${ICON_SIZE}></kt-icon>\n </span>`\n : nothing\n }\n ${\n this.error\n ? html`<span class=\"adornment error-icon\" title=${this.error}>\n <kt-icon name=\"circle-alert\" size=${ICON_SIZE} label=${this.error}></kt-icon>\n </span>`\n : nothing\n }\n ${\n this.showClear\n ? html`<button\n type=\"button\"\n class=\"icon-button clear\"\n tabindex=\"-1\"\n aria-label=${strings().clear}\n @click=${this.clear}\n >\n <kt-icon name=\"x\" size=${ICON_SIZE}></kt-icon>\n </button>`\n : nothing\n }\n </div>`\n : nothing\n }\n </div>`;\n }\n}\n\ndefineElement('kt-input', KtInput);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kt-input': KtInput;\n }\n}\n"],"names":["DEFAULT_COUNTRIES","REGIONAL_INDICATOR_A","LETTER_A","flagEmoji","id","letter","digitsOnly","value","formatNationalNumber","digits","country","groups","rest","size","searchCountries","countries","query","needle","ICON_SIZE","KtInput","KtElement","event","css","attachFormInternals","setFormValue","changed","missing","message","strings","setValidity","state","options","candidate","raw","emit","selected","matches","html","classMap","e","nothing","hasActions","live","__decorateClass","property","defineElement"],"mappings":";;;;;;;;;AAkBO,MAAMA,IAA0C;AAAA,EACrD,EAAE,IAAI,MAAM,MAAM,iBAAiB,UAAU,KAAK,QAAQ,eAAA;AAAA,EAC1D,EAAE,IAAI,MAAM,MAAM,kBAAkB,UAAU,MAAM,QAAQ,cAAA;AAAA,EAC5D,EAAE,IAAI,MAAM,MAAM,WAAW,UAAU,MAAM,QAAQ,cAAA;AAAA,EACrD,EAAE,IAAI,MAAM,MAAM,UAAU,UAAU,MAAM,QAAQ,gBAAA;AAAA,EACpD,EAAE,IAAI,MAAM,MAAM,WAAW,UAAU,MAAM,QAAQ,gBAAA;AAAA,EACrD,EAAE,IAAI,MAAM,MAAM,eAAe,UAAU,MAAM,QAAQ,eAAA;AAC3D,GAEMC,IAAuB,QACvBC,IAAW;AASV,SAASC,EAAUC,GAAoB;AAC5C,SAAK,cAAc,KAAKA,CAAE,IACnB,OAAO;AAAA,IACZ,GAAG,CAAC,GAAGA,EAAG,YAAA,CAAa,EAAE;AAAA,MACvB,CAACC,MAAWJ,IAAuBI,EAAO,WAAW,CAAC,IAAIH;AAAA,IAAA;AAAA,EAC5D,IAJkC;AAMtC;AAGO,SAASI,EAAWC,GAAuB;AAChD,SAAOA,EAAM,QAAQ,OAAO,EAAE;AAChC;AASO,SAASC,EAAqBC,GAAgBC,GAAwC;AAC3F,MAAI,CAACD,EAAQ,QAAO;AAEpB,QAAME,IAAmB,CAAA;AACzB,MAAIC,IAAOH;AAEX,MAAIC,GAAS,OAAO;AAGlB,SAFAC,EAAO,KAAKC,EAAK,MAAM,GAAG,CAAC,CAAC,GAC5BA,IAAOA,EAAK,MAAM,CAAC,GACZA;AACL,MAAAD,EAA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WAAA;AAIAwB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAjSfzB,EAkSX,WAAA,OAAA;AAGAwB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GApSfzB,EAqSX,WAAA,cAAA;AAGAwB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAvSfzB,EAwSX,WAAA,WAAA;AAMAwB,EAAA;AAAA,EADCC,EAAS,EAAE,WAAW,GAAA,CAAO;AAAA,GA7SnBzB,EA8SX,WAAA,WAAA;AAIAwB,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAjTfzB,EAkTX,WAAA,SAAA;AAuTF0B,EAAc,YAAY1B,CAAO;"}
|
|
1
|
+
{"version":3,"file":"kt-input.js","sources":["../../../../src/internal/countries.ts","../../../../src/components/forms/kt-input/kt-input.ts"],"sourcesContent":["/**\n * Country data for the phone mode of `<kt-input>`.\n *\n * Most of the planet by population rather than all 195 — the panel has a\n * search box, and the long tail of microstates mostly adds scrolling.\n * Applications that need a different set pass their own list to the element.\n */\n\nexport interface KtCountry {\n /** ISO 3166-1 alpha-2, lowercase. */\n readonly id: string;\n readonly name: string;\n /** International dialling code, without the leading `+`. */\n readonly dialCode: string;\n /**\n * A national number as it is written without the trunk prefix, used as the\n * placeholder. Its digit groups are also how a typed number is grouped.\n */\n readonly format: string;\n /**\n * What a number starts with when dialled from inside the country — the `0`\n * of `06 12 34 56 78` — and never after the dial code. Absent where no such\n * prefix exists, or where it can also begin a number: an Italian landline\n * keeps its 0 after +39.\n */\n readonly trunkPrefix?: string;\n}\n\nexport const DEFAULT_COUNTRIES: readonly KtCountry[] = [\n { id: 'al', name: 'Albania', dialCode: '355', format: '67 212 3456', trunkPrefix: '0' },\n { id: 'dz', name: 'Algeria', dialCode: '213', format: '551 23 45 67', trunkPrefix: '0' },\n { id: 'ao', name: 'Angola', dialCode: '244', format: '923 123 456' },\n { id: 'ar', name: 'Argentina', dialCode: '54', format: '11 2345 6789', trunkPrefix: '0' },\n { id: 'au', name: 'Australia', dialCode: '61', format: '412 345 678', trunkPrefix: '0' },\n { id: 'at', name: 'Austria', dialCode: '43', format: '664 1234567', trunkPrefix: '0' },\n { id: 'bd', name: 'Bangladesh', dialCode: '880', format: '1812 345678', trunkPrefix: '0' },\n { id: 'be', name: 'Belgium', dialCode: '32', format: '1 23 45 67 89', trunkPrefix: '0' },\n { id: 'bo', name: 'Bolivia', dialCode: '591', format: '7123 4567', trunkPrefix: '0' },\n { id: 'br', name: 'Brazil', dialCode: '55', format: '11 91234 5678', trunkPrefix: '0' },\n { id: 'bg', name: 'Bulgaria', dialCode: '359', format: '87 123 4567', trunkPrefix: '0' },\n { id: 'cm', name: 'Cameroon', dialCode: '237', format: '6 71 23 45 67' },\n { id: 'ca', name: 'Canada', dialCode: '1', format: '506-234-5678', trunkPrefix: '1' },\n { id: 'cl', name: 'Chile', dialCode: '56', format: '9 1234 5678' },\n { id: 'cn', name: 'China', dialCode: '86', format: '131 2345 6789', trunkPrefix: '0' },\n { id: 'co', name: 'Colombia', dialCode: '57', format: '321 123 4567', trunkPrefix: '0' },\n { id: 'cr', name: 'Costa Rica', dialCode: '506', format: '8312 3456' },\n { id: 'ci', name: \"Côte d'Ivoire\", dialCode: '225', format: '01 23 45 67 89' },\n { id: 'hr', name: 'Croatia', dialCode: '385', format: '91 234 5678', trunkPrefix: '0' },\n { id: 'cy', name: 'Cyprus', dialCode: '357', format: '96 123456' },\n { id: 'cz', name: 'Czechia', dialCode: '420', format: '601 123 456' },\n { id: 'dk', name: 'Denmark', dialCode: '45', format: '32 12 34 56' },\n { id: 'cd', name: 'DR Congo', dialCode: '243', format: '991 234 567', trunkPrefix: '0' },\n { id: 'ec', name: 'Ecuador', dialCode: '593', format: '99 123 4567', trunkPrefix: '0' },\n { id: 'eg', name: 'Egypt', dialCode: '20', format: '100 123 4567', trunkPrefix: '0' },\n { id: 'ee', name: 'Estonia', dialCode: '372', format: '5123 4567' },\n { id: 'et', name: 'Ethiopia', dialCode: '251', format: '91 123 4567', trunkPrefix: '0' },\n { id: 'fi', name: 'Finland', dialCode: '358', format: '41 234 5678', trunkPrefix: '0' },\n { id: 'fr', name: 'France', dialCode: '33', format: '1 23 45 67 89', trunkPrefix: '0' },\n { id: 'ge', name: 'Georgia', dialCode: '995', format: '555 123 456', trunkPrefix: '0' },\n { id: 'de', name: 'Germany', dialCode: '49', format: '1234 567890', trunkPrefix: '0' },\n { id: 'gh', name: 'Ghana', dialCode: '233', format: '23 123 4567', trunkPrefix: '0' },\n { id: 'gr', name: 'Greece', dialCode: '30', format: '691 234 5678' },\n { id: 'gt', name: 'Guatemala', dialCode: '502', format: '5123 4567' },\n { id: 'hk', name: 'Hong Kong', dialCode: '852', format: '5123 4567' },\n { id: 'hu', name: 'Hungary', dialCode: '36', format: '20 123 4567', trunkPrefix: '06' },\n { id: 'is', name: 'Iceland', dialCode: '354', format: '611 1234' },\n { id: 'in', name: 'India', dialCode: '91', format: '81234 56789', trunkPrefix: '0' },\n { id: 'id', name: 'Indonesia', dialCode: '62', format: '812 3456 7890', trunkPrefix: '0' },\n { id: 'ir', name: 'Iran', dialCode: '98', format: '912 345 6789', trunkPrefix: '0' },\n { id: 'iq', name: 'Iraq', dialCode: '964', format: '791 234 5678', trunkPrefix: '0' },\n { id: 'ie', name: 'Ireland', dialCode: '353', format: '85 123 4567', trunkPrefix: '0' },\n { id: 'il', name: 'Israel', dialCode: '972', format: '50 234 5678', trunkPrefix: '0' },\n { id: 'it', name: 'Italy', dialCode: '39', format: '312 345 6789' },\n { id: 'jp', name: 'Japan', dialCode: '81', format: '90 1234 5678', trunkPrefix: '0' },\n { id: 'jo', name: 'Jordan', dialCode: '962', format: '7 9012 3456', trunkPrefix: '0' },\n { id: 'kz', name: 'Kazakhstan', dialCode: '7', format: '771 000 9998' },\n { id: 'ke', name: 'Kenya', dialCode: '254', format: '712 123456', trunkPrefix: '0' },\n { id: 'lv', name: 'Latvia', dialCode: '371', format: '2123 4567' },\n { id: 'lb', name: 'Lebanon', dialCode: '961', format: '71 123 456', trunkPrefix: '0' },\n { id: 'lt', name: 'Lithuania', dialCode: '370', format: '612 34567', trunkPrefix: '0' },\n { id: 'lu', name: 'Luxembourg', dialCode: '352', format: '628 123 456' },\n { id: 'my', name: 'Malaysia', dialCode: '60', format: '12 345 6789', trunkPrefix: '0' },\n { id: 'mx', name: 'Mexico', dialCode: '52', format: '55 1234 5678' },\n { id: 'ma', name: 'Morocco', dialCode: '212', format: '650 123456', trunkPrefix: '0' },\n { id: 'np', name: 'Nepal', dialCode: '977', format: '984 1234567', trunkPrefix: '0' },\n { id: 'nl', name: 'Netherlands', dialCode: '31', format: '6 12345678', trunkPrefix: '0' },\n { id: 'nz', name: 'New Zealand', dialCode: '64', format: '21 123 4567', trunkPrefix: '0' },\n { id: 'ng', name: 'Nigeria', dialCode: '234', format: '802 123 4567', trunkPrefix: '0' },\n { id: 'mk', name: 'North Macedonia', dialCode: '389', format: '72 345 678', trunkPrefix: '0' },\n { id: 'no', name: 'Norway', dialCode: '47', format: '406 12 345' },\n { id: 'pk', name: 'Pakistan', dialCode: '92', format: '301 2345678', trunkPrefix: '0' },\n { id: 'pa', name: 'Panama', dialCode: '507', format: '6123 4567' },\n { id: 'pe', name: 'Peru', dialCode: '51', format: '912 345 678', trunkPrefix: '0' },\n { id: 'ph', name: 'Philippines', dialCode: '63', format: '905 123 4567', trunkPrefix: '0' },\n { id: 'pl', name: 'Poland', dialCode: '48', format: '512 345 678' },\n { id: 'pt', name: 'Portugal', dialCode: '351', format: '912 345 678' },\n { id: 'qa', name: 'Qatar', dialCode: '974', format: '3312 3456' },\n { id: 'ro', name: 'Romania', dialCode: '40', format: '712 034 567', trunkPrefix: '0' },\n { id: 'ru', name: 'Russia', dialCode: '7', format: '912 345 67 89' },\n { id: 'sa', name: 'Saudi Arabia', dialCode: '966', format: '51 234 5678', trunkPrefix: '0' },\n { id: 'sn', name: 'Senegal', dialCode: '221', format: '70 123 45 67' },\n { id: 'rs', name: 'Serbia', dialCode: '381', format: '60 123 4567', trunkPrefix: '0' },\n { id: 'sg', name: 'Singapore', dialCode: '65', format: '8123 4567' },\n { id: 'sk', name: 'Slovakia', dialCode: '421', format: '912 123 456', trunkPrefix: '0' },\n { id: 'si', name: 'Slovenia', dialCode: '386', format: '31 234 567', trunkPrefix: '0' },\n { id: 'za', name: 'South Africa', dialCode: '27', format: '71 123 4567', trunkPrefix: '0' },\n { id: 'kr', name: 'South Korea', dialCode: '82', format: '10 1234 5678', trunkPrefix: '0' },\n { id: 'es', name: 'Spain', dialCode: '34', format: '612 34 56 78' },\n { id: 'lk', name: 'Sri Lanka', dialCode: '94', format: '71 234 5678', trunkPrefix: '0' },\n { id: 'se', name: 'Sweden', dialCode: '46', format: '70 123 45 67', trunkPrefix: '0' },\n { id: 'ch', name: 'Switzerland', dialCode: '41', format: '12 345 67 89', trunkPrefix: '0' },\n { id: 'tw', name: 'Taiwan', dialCode: '886', format: '912 345 678', trunkPrefix: '0' },\n { id: 'tz', name: 'Tanzania', dialCode: '255', format: '621 234 567', trunkPrefix: '0' },\n { id: 'th', name: 'Thailand', dialCode: '66', format: '81 234 5678', trunkPrefix: '0' },\n { id: 'tn', name: 'Tunisia', dialCode: '216', format: '20 123 456' },\n { id: 'tr', name: 'Türkiye', dialCode: '90', format: '501 234 56 78', trunkPrefix: '0' },\n { id: 'ug', name: 'Uganda', dialCode: '256', format: '712 345678', trunkPrefix: '0' },\n { id: 'ua', name: 'Ukraine', dialCode: '380', format: '50 123 4567', trunkPrefix: '0' },\n {\n id: 'ae',\n name: 'United Arab Emirates',\n dialCode: '971',\n format: '50 123 4567',\n trunkPrefix: '0',\n },\n { id: 'gb', name: 'United Kingdom', dialCode: '44', format: '7123 456789', trunkPrefix: '0' },\n { id: 'us', name: 'United States', dialCode: '1', format: '201-555-0123', trunkPrefix: '1' },\n { id: 'uy', name: 'Uruguay', dialCode: '598', format: '94 231 234', trunkPrefix: '0' },\n { id: 've', name: 'Venezuela', dialCode: '58', format: '412 123 4567', trunkPrefix: '0' },\n { id: 'vn', name: 'Vietnam', dialCode: '84', format: '91 234 5678', trunkPrefix: '0' },\n];\n\nconst REGIONAL_INDICATOR_A = 0x1f1e6;\nconst LETTER_A = 'A'.charCodeAt(0);\n\n/**\n * The flag emoji for a country code, built from regional indicator symbols.\n *\n * This is the one place emoji appear in a Kanto interface. They are here\n * because no flag icon set ships with the system, and a country picker without\n * flags is markedly slower to scan.\n */\nexport function flagEmoji(id: string): string {\n if (!/^[a-z]{2}$/i.test(id)) return '';\n return String.fromCodePoint(\n ...[...id.toUpperCase()].map(\n (letter) => REGIONAL_INDICATOR_A + letter.charCodeAt(0) - LETTER_A,\n ),\n );\n}\n\n/** Keeps only the digits — what gets stored and submitted. */\nexport function digitsOnly(value: string): string {\n return value.replace(/\\D/g, '');\n}\n\n/**\n * Groups digits for display, the way the country's `format` groups them:\n * `1 23 45 67 89` makes `6 12 34 56 78`. Digits past the format go in one\n * last group rather than being dropped, and a country with no format falls\n * back to threes.\n */\nexport function formatNationalNumber(digits: string, country: KtCountry | undefined): string {\n if (!digits) return '';\n\n const sizes = country ? (country.format.match(/\\d+/g) ?? []).map((run) => run.length) : [];\n const groups: string[] = [];\n let rest = digits;\n\n for (const size of sizes) {\n if (!rest) break;\n groups.push(rest.slice(0, size));\n rest = rest.slice(size);\n }\n if (sizes.length > 0) {\n if (rest) groups.push(rest);\n } else {\n while (rest) {\n groups.push(rest.slice(0, 3));\n rest = rest.slice(3);\n }\n }\n\n return groups.join(' ');\n}\n\n/**\n * The trunk prefix a number was typed with, if any. Someone used to dialling\n * `06 12 34 56 78` types the 0 after +33 too, and the result is not a number\n * that exists.\n */\nexport function leadingTrunkPrefix(\n digits: string,\n country: KtCountry | undefined,\n): string | undefined {\n const prefix = country?.trunkPrefix;\n return prefix && digits.startsWith(prefix) ? prefix : undefined;\n}\n\n/** Lowercase, without accents: \"Côte\" is found by typing \"cote\". */\nfunction fold(text: string): string {\n return text\n .normalize('NFD')\n .replace(/\\p{Diacritic}/gu, '')\n .toLowerCase();\n}\n\n/** Filters by name, dial code or country code — whatever the user types. */\nexport function searchCountries(\n countries: readonly KtCountry[],\n query: string,\n): readonly KtCountry[] {\n const needle = fold(query.trim());\n if (!needle) return countries;\n\n // From the start: \"44\" is the UK, not also Angola's 244.\n const dial = needle.replace(/^\\+/, '');\n return countries.filter(\n (country) =>\n fold(country.name).includes(needle) ||\n (dial !== '' && country.dialCode.startsWith(dial)) ||\n country.id === needle,\n );\n}\n","import { css, html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { live } from 'lit/directives/live.js';\nimport { KtElement, defineElement } from '#internal/kt-element';\nimport { emit, toggleListener } from '#internal/events';\nimport {\n attachFormInternals,\n setFormValue,\n setValidity,\n type UsableInternals,\n} from '#internal/form-control';\nimport {\n DEFAULT_COUNTRIES,\n digitsOnly,\n flagEmoji,\n formatNationalNumber,\n leadingTrunkPrefix,\n searchCountries,\n type KtCountry,\n} from '#internal/countries';\nimport { FloatingController, floatingStyles } from '#internal/floating';\nimport { strings } from '#internal/strings';\nimport '../../core/kt-icon/kt-icon.js';\nimport '../../feedback/kt-tooltip/kt-tooltip.js';\n\nexport type KtInputSize = 'small' | 'medium' | 'large';\n\n/** Icon size inside a field, at every field size. */\nconst ICON_SIZE = 18;\n\n/** A phone-mode restore state, `fr:612345678`: see `formState`. */\nconst PHONE_STATE = /^([a-z]{2}):(\\d*)$/;\n\n/**\n * A single-line text field.\n *\n * Borderless by design: the field is a fill on `--color-dark-12` that gains a\n * 2px *outline* — grey on hover, primary on focus, danger on error. An outline\n * sits outside the box, so nothing reflows when the state changes.\n *\n * The element is form-associated: it serialises into `FormData` under its\n * `name`, resets with the form, and reports validity like a native input.\n *\n * @element kt-input\n *\n * @csspart base - The field container.\n * @csspart control - The native `<input>`.\n * @csspart actions - The trailing icon row.\n *\n * @fires kt-input - On every keystroke. `detail: { value }`.\n * @fires kt-change - When the value is committed (blur or Enter). `detail: { value }`.\n * @fires kt-clear - The clear button was pressed.\n *\n * @example\n * ```html\n * <kt-input placeholder=\"Search everything...\" icon=\"search\"></kt-input>\n * <kt-input type=\"password\" name=\"password\"></kt-input>\n * <kt-input error=\"Invalid email address\" value=\"not-an-address\"></kt-input>\n * ```\n */\nexport class KtInput extends KtElement {\n static readonly formAssociated = true;\n\n static override styles = [\n KtElement.styles,\n floatingStyles,\n css`\n :host {\n display: block;\n }\n\n .field {\n position: relative;\n display: inline-flex;\n align-items: center;\n width: 100%;\n height: var(--button-height);\n padding: 0 var(--button-padding-x);\n gap: var(--gap-button);\n background-color: var(--surface-field);\n border-radius: var(--radius-input);\n /* A resting hairline. A field is a fill on --surface-field, which is\n one ramp step from the page in dark and almost the same colour in\n light — so on a card or inside a modal it simply disappeared and\n read as a bare native control.\n\n A border rather than an outline, because the control inside fills\n the field exactly and a coincident outline is painted over by the\n native widget. A border insets the control by its own width, so it\n cannot be covered. box-sizing: border-box keeps the outer size.\n\n The hover and focus rings stay outlines on top of it, and the\n transparent resting outline is what they animate from: without it\n outline-color starts at the initial value, which resolves to the\n text colour, and hover flashed near-white before settling. */\n border: var(--border-width) solid var(--border-field);\n outline: var(--outline-width) solid transparent;\n transition: outline-color var(--duration-instant);\n }\n\n /* Outline, never border: it sits outside the box, so hover and focus\n change nothing about the layout. */\n .field:hover {\n outline: var(--outline-width) solid var(--color-text-700);\n }\n .field:focus-within {\n outline: var(--outline-width) solid var(--color-primary-base);\n }\n\n .small {\n height: var(--button-height-small);\n }\n .large {\n height: var(--button-height-large);\n }\n\n .error,\n .error:hover,\n .error:focus-within {\n outline: var(--outline-width) solid var(--color-danger-base);\n }\n .error input {\n color: var(--color-danger-text);\n }\n\n .disabled {\n background-color: var(--color-dark-14);\n pointer-events: none;\n }\n .disabled input {\n color: var(--text-disabled);\n }\n\n input {\n width: 100%;\n min-width: 0;\n padding: 0;\n color: var(--text-body);\n font: var(--font-input);\n background: transparent;\n border: none;\n outline: none;\n }\n\n input::placeholder {\n color: var(--text-muted);\n }\n\n /* The clear button is ours; the browser's is redundant. */\n input::-webkit-search-cancel-button {\n display: none;\n }\n\n .actions {\n display: flex;\n flex: none;\n align-items: center;\n gap: var(--gap-button);\n }\n\n .icon-button {\n display: inline-flex;\n align-items: center;\n padding: 0;\n color: var(--text-body);\n background: none;\n border: none;\n cursor: pointer;\n }\n\n .icon-button:focus-visible {\n outline: var(--outline-width) solid var(--color-primary-base);\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n .clear {\n transition: transform var(--duration-instant) ease-in-out;\n }\n .clear:hover {\n transform: rotate(90deg);\n }\n\n .adornment {\n display: flex;\n align-items: center;\n color: var(--text-muted);\n }\n\n .error-icon {\n color: var(--color-danger-text);\n }\n\n /* === PHONE MODE === */\n .country {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n gap: var(--gap-element);\n height: 100%;\n margin-right: var(--button-padding-x);\n padding: 0 var(--button-padding-x) 0 0;\n color: var(--text-body);\n background: none;\n border: none;\n border-right: var(--border-width) solid var(--color-dark-16);\n cursor: pointer;\n font: var(--font-normal-regular);\n user-select: none;\n }\n\n .country:focus-visible {\n outline: var(--outline-width) solid var(--color-primary-base);\n outline-offset: -2px;\n }\n\n .chevron {\n display: inline-flex;\n transform-origin: 50% 50%;\n transition: transform var(--duration-fast) ease-in-out;\n }\n .chevron.open {\n transform: scaleY(-1);\n }\n\n .dial {\n color: var(--text-muted);\n }\n\n /* Placed from the field by FloatingController. */\n .country-panel {\n display: flex;\n flex-direction: column;\n gap: var(--gap-element);\n width: 280px;\n max-height: 225px;\n padding: var(--padding-expand);\n background: var(--color-dark-20);\n border-radius: var(--radius-input);\n }\n\n .country-search {\n /* Never shrunk by the list below it, which would otherwise take the\n search box's height whenever there are more results than room. */\n flex: none;\n width: 100%;\n height: var(--button-height-small);\n padding: 0 12px;\n color: var(--text-body);\n font: var(--font-normal-regular);\n background: var(--color-dark-12);\n border: none;\n border-radius: var(--radius-input);\n outline: none;\n }\n\n .country-list {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--gap-element);\n margin: 0;\n padding: 0;\n overflow-y: auto;\n list-style: none;\n scrollbar-width: thin;\n }\n\n .country-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border-radius: var(--radius-input);\n cursor: pointer;\n font: var(--font-normal-regular);\n }\n .country-item:hover,\n .country-item[aria-selected='true'] {\n background: var(--color-dark-23);\n }\n\n .country-name {\n flex: 1;\n }\n\n .country-empty {\n padding: 8px 12px;\n color: var(--text-muted);\n font: var(--font-normal-small);\n }\n `,\n ];\n\n @query('input')\n private input!: HTMLInputElement;\n\n private internals: UsableInternals | null = null;\n\n /** True while a `password` field is showing its contents. */\n @state()\n private passwordVisible = false;\n\n @state()\n private countryOpen = false;\n\n @state()\n private countryQuery = '';\n\n /** The field has focus: the error tooltip shows for keyboard users too. */\n @state()\n private focused = false;\n\n /** Escape put the error tooltip away until the field is focused again. */\n @state()\n private errorDismissed = false;\n\n private floating = new FloatingController(this, {\n panel: () => this.shadowRoot?.querySelector<HTMLElement>('.country-panel'),\n anchor: () => this.shadowRoot?.querySelector('.field'),\n });\n\n /** The field's value. The `value` attribute seeds it and acts as the reset value. */\n @property({ type: String })\n value = '';\n\n @property({ type: String })\n name = '';\n\n /** Any native input type. `password` adds the reveal toggle. */\n @property({ type: String })\n type = 'text';\n\n @property({ type: String })\n placeholder = '';\n\n /** Field height: 32 / 40 / 48px at the desktop scale. */\n @property({ type: String, reflect: true })\n size: KtInputSize = 'medium';\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** Disabled by an enclosing `<fieldset>`, which leaves `disabled` alone. */\n @state()\n private formDisabled = false;\n\n /** Whether the control is off, by its own `disabled` or by its form. */\n private get inactive(): boolean {\n return this.disabled || this.formDisabled;\n }\n\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /** Trailing Lucide icon, kebab-case. */\n @property({ type: String })\n icon = '';\n\n /**\n * Error message. A non-empty value puts the field in its error state, and\n * wins over the field's own checks.\n */\n @property({ type: String, reflect: true })\n error = '';\n\n /** Shows the clear button once there is something to clear. */\n @property({ type: Boolean })\n clearable = true;\n\n /** Accessible name, when no `<kt-label-input>` wraps the field. */\n @property({ type: String })\n label = '';\n\n @property({ type: String })\n autocomplete = '';\n\n @property({ type: Number })\n maxlength?: number;\n\n /**\n * Countries offered in phone mode. Replace it to widen the list.\n */\n @property({ attribute: false })\n countries: readonly KtCountry[] = DEFAULT_COUNTRIES;\n\n /** Selected country in phone mode, as an ISO 3166-1 alpha-2 code. */\n @property({ type: String })\n country = 'us';\n\n /** The value the enclosing form resets to. */\n private defaultValue = '';\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Back on the document if it was reconnected while open.\n toggleListener(this.countryOpen, document, 'pointerdown', this.closeCountryPanel);\n this.internals ??= attachFormInternals(this);\n this.defaultValue = this.value;\n setFormValue(this.internals, this.formValue, this.formState);\n }\n\n // Untyped: `countryOpen` is private, so not among the keys PropertyValues<this> knows.\n override updated(changed: PropertyValues): void {\n // Only an open panel closes on an outside click, so only an open one listens.\n if (changed.has('countryOpen')) {\n toggleListener(this.countryOpen, document, 'pointerdown', this.closeCountryPanel);\n }\n this.floating.sync(this.countryOpen);\n }\n\n override willUpdate(changed: PropertyValues<this>): void {\n if (\n changed.has('value') ||\n changed.has('required') ||\n changed.has('error') ||\n changed.has('country') ||\n changed.has('countries') ||\n changed.has('type') ||\n this.stringsChanged(changed)\n ) {\n setFormValue(this.internals, this.formValue, this.formState);\n this.refreshValidity();\n }\n }\n\n private refreshValidity(): void {\n const missing = this.required && this.value.length === 0;\n const phoneError = this.phoneError;\n const message = this.error || phoneError || (missing ? strings().required : '');\n setValidity(\n this.internals,\n {\n valueMissing: missing,\n patternMismatch: Boolean(phoneError),\n customError: Boolean(this.error),\n },\n message,\n );\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n document.removeEventListener('pointerdown', this.closeCountryPanel);\n }\n\n /** Called by the platform when the enclosing form is reset. */\n formResetCallback(): void {\n this.value = this.defaultValue;\n this.passwordVisible = false;\n }\n\n /**\n * Called by the platform when the control's disabled state changes — its\n * own `disabled`, or an ancestor `<fieldset disabled>` it cannot see.\n */\n formDisabledCallback(disabled: boolean): void {\n this.formDisabled = disabled;\n }\n\n /** Called by the platform when the browser restores a session. */\n formStateRestoreCallback(state: string): void {\n const phone = PHONE_STATE.exec(state);\n if (this.isPhone && phone) {\n this.country = phone[1]!;\n this.value = phone[2]!;\n } else {\n this.value = state;\n }\n }\n\n override focus(options?: FocusOptions): void {\n this.input?.focus(options);\n }\n\n override blur(): void {\n this.input?.blur();\n }\n\n /** Selects the field's contents, as `HTMLInputElement.select()` does. */\n select(): void {\n this.input?.select();\n }\n\n /** Phone mode: the country picker, digit-only storage and grouped display. */\n private get isPhone(): boolean {\n return this.type === 'tel';\n }\n\n private get selectedCountry(): KtCountry | undefined {\n return this.countries.find((candidate) => candidate.id === this.country);\n }\n\n /**\n * What the form receives. In phone mode that is the full international\n * number — submitting national digits alone would throw away the country\n * the user picked.\n */\n private get formValue(): string {\n if (!this.isPhone || !this.value) return this.value;\n return `+${this.selectedCountry?.dialCode ?? ''}${this.value}`;\n }\n\n /**\n * What the browser saves for a restore. The international number cannot be\n * split back into country and digits — `+1` is both the US and Canada — so\n * phone mode saves the two apart.\n */\n private get formState(): string | undefined {\n return this.isPhone ? `${this.country}:${this.value}` : undefined;\n }\n\n /** Phone mode: a number typed with the prefix only dialled at home. */\n private get phoneError(): string {\n if (!this.isPhone) return '';\n const prefix = leadingTrunkPrefix(this.value, this.selectedCountry);\n return prefix ? strings().phoneTrunkPrefix(prefix) : '';\n }\n\n /** The message on show: the application's first, then the field's own. */\n private get shownError(): string {\n return this.error || this.phoneError;\n }\n\n private get displayValue(): string {\n return this.isPhone ? formatNationalNumber(this.value, this.selectedCountry) : this.value;\n }\n\n private get showClear(): boolean {\n return this.clearable && this.value.length > 0 && !this.readonly && !this.inactive;\n }\n\n private get resolvedType(): string {\n // Phone mode renders grouped digits, which type=\"tel\" would not accept\n // back; the value is normalised to digits on input either way.\n if (this.isPhone) return 'text';\n if (this.type !== 'password') return this.type;\n return this.passwordVisible ? 'text' : 'password';\n }\n\n private onInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value;\n this.value = this.isPhone ? digitsOnly(raw) : raw;\n emit(this, 'kt-input', { value: this.value });\n }\n\n private toggleCountryPanel(): void {\n this.countryOpen = !this.countryOpen;\n this.countryQuery = '';\n }\n\n private selectCountry(country: KtCountry): void {\n this.country = country.id;\n this.countryOpen = false;\n this.countryQuery = '';\n emit(this, 'kt-country-change', { country: country.id, dialCode: country.dialCode });\n this.focus();\n }\n\n private closeCountryPanel = (event: Event): void => {\n if (event.composedPath().includes(this)) return;\n this.countryOpen = false;\n };\n\n private onCountryKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Escape' && this.countryOpen) {\n event.stopPropagation();\n this.countryOpen = false;\n this.shadowRoot?.querySelector<HTMLButtonElement>('.country')?.focus();\n }\n }\n\n private renderCountryPicker(): TemplateResult {\n const selected = this.selectedCountry;\n const matches = searchCountries(this.countries, this.countryQuery);\n\n return html`<button\n type=\"button\"\n class=\"country\"\n aria-haspopup=\"listbox\"\n aria-expanded=${this.countryOpen ? 'true' : 'false'}\n aria-label=${strings().countryCode(selected?.name)}\n ?disabled=${this.inactive || this.readonly}\n @click=${this.toggleCountryPanel}\n >\n <span aria-hidden=\"true\">${flagEmoji(this.country)}</span>\n <span class=\"dial\">+${selected?.dialCode ?? ''}</span>\n <span class=${classMap({ chevron: true, open: this.countryOpen })}>\n <kt-icon name=\"chevron-down\" size=\"14\"></kt-icon>\n </span>\n </button>\n ${\n this.countryOpen\n ? html`<div\n class=\"country-panel floating\"\n popover=\"manual\"\n @pointerdown=${(e: Event) => e.stopPropagation()}\n >\n <input\n class=\"country-search\"\n placeholder=${strings().searchCountry}\n .value=${this.countryQuery}\n aria-label=${strings().searchCountry}\n @input=${(e: Event) => {\n this.countryQuery = (e.target as HTMLInputElement).value;\n }}\n />\n <ul class=\"country-list\" role=\"listbox\">\n ${\n matches.length === 0\n ? html`<li class=\"country-empty\">${strings().noCountry}</li>`\n : matches.map(\n (candidate) =>\n html`<li\n class=\"country-item\"\n role=\"option\"\n aria-selected=${candidate.id === this.country ? 'true' : 'false'}\n @click=${() => this.selectCountry(candidate)}\n >\n <span aria-hidden=\"true\">${flagEmoji(candidate.id)}</span>\n <span class=\"country-name\">${candidate.name}</span>\n <span class=\"dial\">+${candidate.dialCode}</span>\n </li>`,\n )\n }\n </ul>\n </div>`\n : nothing\n }`;\n }\n\n private onFocus(): void {\n this.focused = true;\n this.errorDismissed = false;\n }\n\n private onBlur(): void {\n this.focused = false;\n }\n\n /** WCAG 1.4.13: content shown on focus can be dismissed without moving it. */\n private onControlKeyDown(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !this.errorTooltipOpen) return;\n event.stopPropagation();\n this.errorDismissed = true;\n }\n\n private get errorTooltipOpen(): boolean {\n return this.focused && !this.errorDismissed && Boolean(this.shownError);\n }\n\n private onChange(event: Event): void {\n // The native change event does not cross the shadow boundary; re-emit it\n // under a name consumers can actually listen for.\n event.stopPropagation();\n emit(this, 'kt-change', { value: this.value });\n }\n\n private clear(): void {\n this.value = '';\n emit(this, 'kt-clear');\n emit(this, 'kt-input', { value: '' });\n emit(this, 'kt-change', { value: '' });\n this.focus();\n }\n\n private togglePassword(): void {\n this.passwordVisible = !this.passwordVisible;\n }\n\n /** Clicking the padding around the input should focus it, as on a native field. */\n private onFieldPointerDown(event: PointerEvent): void {\n if (event.target === this.input) return;\n if ((event.target as HTMLElement).closest('button')) return;\n event.preventDefault();\n this.focus();\n }\n\n /** Both buttons are out of the tab order, so their tooltips are for the pointer. */\n private renderPasswordToggle(): TemplateResult {\n const label = this.passwordVisible ? strings().hidePassword : strings().showPassword;\n return html`<kt-tooltip text=${label}>\n <button\n type=\"button\"\n class=\"icon-button\"\n tabindex=\"-1\"\n aria-label=${label}\n @click=${this.togglePassword}\n >\n <kt-icon name=${this.passwordVisible ? 'eye-off' : 'eye'} size=${ICON_SIZE}></kt-icon>\n </button>\n </kt-tooltip>`;\n }\n\n override render(): TemplateResult {\n const error = this.shownError;\n const hasActions =\n this.type === 'password' || Boolean(this.icon) || Boolean(error) || this.showClear;\n\n return html`<div\n part=\"base\"\n class=${classMap({\n field: true,\n [this.size]: true,\n error: Boolean(error),\n disabled: this.inactive,\n })}\n @pointerdown=${this.onFieldPointerDown}\n @keydown=${this.onCountryKeyDown}\n >\n ${\n // The icon only shows that something is wrong; this is what gets read\n // out. aria-describedby rather than aria-errormessage, which most\n // screen readers still ignore.\n error ? html`<span id=\"error-message\" class=\"visually-hidden\">${error}</span>` : nothing\n }\n ${this.isPhone ? this.renderCountryPicker() : nothing}\n\n <input\n part=\"control\"\n type=${this.resolvedType}\n name=${this.name || nothing}\n .value=${live(this.displayValue)}\n placeholder=${this.placeholder || (this.isPhone && this.selectedCountry?.format) || nothing}\n autocomplete=${this.autocomplete || nothing}\n inputmode=${this.isPhone ? 'tel' : nothing}\n maxlength=${this.maxlength ?? nothing}\n aria-label=${this.label || nothing}\n aria-invalid=${error ? 'true' : nothing}\n aria-describedby=${error ? 'error-message' : nothing}\n ?disabled=${this.inactive}\n ?readonly=${this.readonly}\n ?required=${this.required}\n @input=${this.onInput}\n @change=${this.onChange}\n @focus=${this.onFocus}\n @blur=${this.onBlur}\n @keydown=${this.onControlKeyDown}\n />\n\n ${\n hasActions\n ? html`<div part=\"actions\" class=\"actions\">\n ${this.type === 'password' ? this.renderPasswordToggle() : nothing}\n ${\n this.icon\n ? html`<span class=\"adornment\">\n <kt-icon name=${this.icon} size=${ICON_SIZE}></kt-icon>\n </span>`\n : nothing\n }\n ${\n // The message on hover, and while the field has focus for whoever\n // uses a keyboard; aria-describedby is what a screen reader reads.\n error\n ? html`<kt-tooltip\n class=\"adornment error-icon\"\n text=${error}\n ?open=${this.errorTooltipOpen}\n >\n <kt-icon name=\"circle-alert\" size=${ICON_SIZE}></kt-icon>\n </kt-tooltip>`\n : nothing\n }\n ${\n this.showClear\n ? html`<kt-tooltip text=${strings().clear}>\n <button\n type=\"button\"\n class=\"icon-button clear\"\n tabindex=\"-1\"\n aria-label=${strings().clear}\n @click=${this.clear}\n >\n <kt-icon name=\"x\" size=${ICON_SIZE}></kt-icon>\n </button>\n </kt-tooltip>`\n : nothing\n }\n </div>`\n : nothing\n }\n </div>`;\n }\n}\n\ndefineElement('kt-input', KtInput);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kt-input': KtInput;\n }\n}\n"],"names":["DEFAULT_COUNTRIES","REGIONAL_INDICATOR_A","LETTER_A","flagEmoji","id","letter","digitsOnly","value","formatNationalNumber","digits","country","sizes","run","groups","rest","size","leadingTrunkPrefix","prefix","fold","text","searchCountries","countries","query","needle","dial","ICON_SIZE","PHONE_STATE","KtInput","KtElement","FloatingController","event","floatingStyles","css","toggleListener","attachFormInternals","setFormValue","changed","missing","phoneError","message","strings","setValidity","disabled","state","phone","options","candidate","raw","emit","selected","matches","html","classMap","e","nothing","label","error","hasActions","live","__decorateClass","property","defineElement"],"mappings":";;;;;;;;;;;AA4BO,MAAMA,IAA0C;AAAA,EACrD,EAAE,IAAI,MAAM,MAAM,WAAW,UAAU,OAAO,QAAQ,eAAe,aAAa,IAAA;AAAA,EAClF,EAAE,IAAI,MAAM,MAAM,WAAW,UAAU,OAAO,QAAQ,gBAAgB,aAAa,IAAA;AAAA,EACnF,EAAE,IAAI,MAAM,MAAM,UAAU,UAAU,OAAO,QAAQ,cAAA;AAAA,EACrD,EAAE,IAAI,MAAM,MAAM,aAAa,UAAU,MAAM,QAAQ,gBAAgB,aAAa,IAAA;AAAA,EACpF,EAAE,IAAI,MAAM,MAAM,aAAa,UAAU,MAAM,Q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,EAAE,MAAM,OAAA,CAAQ;AAAA,GA9TfjC,EA+TX,WAAA,cAAA;AAGAgC,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAjUfjC,EAkUX,WAAA,WAAA;AAMAgC,EAAA;AAAA,EADCC,EAAS,EAAE,WAAW,GAAA,CAAO;AAAA,GAvUnBjC,EAwUX,WAAA,WAAA;AAIAgC,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3UfjC,EA4UX,WAAA,SAAA;AA8YFkC,EAAc,YAAYlC,CAAO;"}
|
|
@@ -26,6 +26,9 @@ export declare class KtInputMenu extends KtElement {
|
|
|
26
26
|
private defaultValue;
|
|
27
27
|
private readonly listId;
|
|
28
28
|
private open;
|
|
29
|
+
/** The side the list opened on, for the direction of its entrance. */
|
|
30
|
+
private placement;
|
|
31
|
+
private floating;
|
|
29
32
|
private query;
|
|
30
33
|
private activeIndex;
|
|
31
34
|
options: readonly KtOption[];
|
|
@@ -33,14 +36,24 @@ export declare class KtInputMenu extends KtElement {
|
|
|
33
36
|
placeholder: string;
|
|
34
37
|
name: string;
|
|
35
38
|
disabled: boolean;
|
|
39
|
+
/** Disabled by an enclosing `<fieldset>`, which leaves `disabled` alone. */
|
|
40
|
+
private formDisabled;
|
|
41
|
+
/** Whether the control is off, by its own `disabled` or by its form. */
|
|
42
|
+
private get inactive();
|
|
36
43
|
required: boolean;
|
|
37
44
|
error: string;
|
|
38
45
|
label: string;
|
|
39
46
|
emptyText: string | undefined;
|
|
40
47
|
connectedCallback(): void;
|
|
41
48
|
disconnectedCallback(): void;
|
|
49
|
+
updated(changed: PropertyValues): void;
|
|
42
50
|
willUpdate(changed: PropertyValues<this>): void;
|
|
43
51
|
formResetCallback(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Called by the platform when the control's disabled state changes — its
|
|
54
|
+
* own `disabled`, or an ancestor `<fieldset disabled>` it cannot see.
|
|
55
|
+
*/
|
|
56
|
+
formDisabledCallback(disabled: boolean): void;
|
|
44
57
|
formStateRestoreCallback(state: string): void;
|
|
45
58
|
focus(options?: FocusOptions): void;
|
|
46
59
|
get selectedOption(): KtOption | undefined;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { query as x, state as
|
|
3
|
-
import { classMap as
|
|
4
|
-
import { live as
|
|
5
|
-
import { K as m, d as
|
|
6
|
-
import { u as
|
|
7
|
-
import { a as
|
|
8
|
-
import { a as
|
|
9
|
-
import {
|
|
1
|
+
import { css as w, nothing as a, html as p } from "lit";
|
|
2
|
+
import { query as x, state as h, property as n } from "lit/decorators.js";
|
|
3
|
+
import { classMap as d } from "lit/directives/class-map.js";
|
|
4
|
+
import { live as k } from "lit/directives/live.js";
|
|
5
|
+
import { K as m, d as $ } from "../../../chunks/kt-element-Djx2JcGl.js";
|
|
6
|
+
import { u as I, t as y, e as f } from "../../../chunks/events-r51msXNf.js";
|
|
7
|
+
import { a as D, s as q, b as O } from "../../../chunks/form-control-B74_EHtG.js";
|
|
8
|
+
import { a as S, b as C, o as g, f as v, l as P, n as E } from "../../../chunks/listbox-llcUu_V-.js";
|
|
9
|
+
import { F as L, f as A } from "../../../chunks/floating-B7_Dahpn.js";
|
|
10
|
+
import { s as l } from "../../../chunks/index-STEEvEP7.js";
|
|
10
11
|
import "../../core/kt-icon/kt-icon.js";
|
|
11
|
-
var
|
|
12
|
-
for (var s = void 0,
|
|
13
|
-
(b =
|
|
14
|
-
return s &&
|
|
12
|
+
var V = Object.defineProperty, i = (u, t, o, r) => {
|
|
13
|
+
for (var s = void 0, c = u.length - 1, b; c >= 0; c--)
|
|
14
|
+
(b = u[c]) && (s = b(t, o, s) || s);
|
|
15
|
+
return s && V(t, o, s), s;
|
|
15
16
|
};
|
|
16
17
|
class e extends m {
|
|
17
18
|
constructor() {
|
|
18
|
-
super(...arguments), this.internals = null, this.defaultValue = null, this.listId =
|
|
19
|
+
super(...arguments), this.internals = null, this.defaultValue = null, this.listId = I("kt-input-menu-list"), this.open = !1, this.placement = "bottom", this.floating = new L(this, {
|
|
20
|
+
panel: () => this.shadowRoot?.querySelector(".popup"),
|
|
21
|
+
anchor: () => this.shadowRoot?.querySelector(".control"),
|
|
22
|
+
matchWidth: !0,
|
|
23
|
+
onPlace: (t) => {
|
|
24
|
+
this.placement = t;
|
|
25
|
+
}
|
|
26
|
+
}), this.query = "", this.activeIndex = -1, this.options = [], this.value = null, this.placeholder = "", this.name = "", this.disabled = !1, this.formDisabled = !1, this.required = !1, this.error = "", this.label = "", this.emptyText = void 0, this.onDocumentPointerDown = (t) => {
|
|
19
27
|
t.composedPath().includes(this) || this.close();
|
|
20
28
|
};
|
|
21
29
|
}
|
|
@@ -25,8 +33,9 @@ class e extends m {
|
|
|
25
33
|
static {
|
|
26
34
|
this.styles = [
|
|
27
35
|
m.styles,
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
A,
|
|
37
|
+
S,
|
|
38
|
+
w`
|
|
30
39
|
:host {
|
|
31
40
|
position: relative;
|
|
32
41
|
display: block;
|
|
@@ -82,7 +91,7 @@ class e extends m {
|
|
|
82
91
|
outline: var(--outline-width) solid var(--color-danger-base);
|
|
83
92
|
}
|
|
84
93
|
|
|
85
|
-
:host(
|
|
94
|
+
:host(:disabled) {
|
|
86
95
|
pointer-events: none;
|
|
87
96
|
opacity: 0.6;
|
|
88
97
|
}
|
|
@@ -128,17 +137,25 @@ class e extends m {
|
|
|
128
137
|
`
|
|
129
138
|
];
|
|
130
139
|
}
|
|
140
|
+
/** Whether the control is off, by its own `disabled` or by its form. */
|
|
141
|
+
get inactive() {
|
|
142
|
+
return this.disabled || this.formDisabled;
|
|
143
|
+
}
|
|
131
144
|
connectedCallback() {
|
|
132
|
-
super.connectedCallback(), this.internals ??=
|
|
145
|
+
super.connectedCallback(), this.internals ??= D(this), this.defaultValue = this.value, y(this.open, document, "pointerdown", this.onDocumentPointerDown);
|
|
133
146
|
}
|
|
134
147
|
disconnectedCallback() {
|
|
135
148
|
super.disconnectedCallback(), document.removeEventListener("pointerdown", this.onDocumentPointerDown);
|
|
136
149
|
}
|
|
150
|
+
// Untyped: `open` is private, so not among the keys PropertyValues<this> knows.
|
|
151
|
+
updated(t) {
|
|
152
|
+
t.has("open") && y(this.open, document, "pointerdown", this.onDocumentPointerDown), this.floating.sync(this.open);
|
|
153
|
+
}
|
|
137
154
|
willUpdate(t) {
|
|
138
155
|
if (t.has("value") || t.has("required") || t.has("error") || this.stringsChanged(t)) {
|
|
139
156
|
q(this.internals, this.value === null ? null : String(this.value));
|
|
140
157
|
const o = this.required && this.value === null;
|
|
141
|
-
|
|
158
|
+
O(
|
|
142
159
|
this.internals,
|
|
143
160
|
{ valueMissing: o, customError: !!this.error },
|
|
144
161
|
this.error || (o ? l().selectOption : "")
|
|
@@ -148,6 +165,13 @@ class e extends m {
|
|
|
148
165
|
formResetCallback() {
|
|
149
166
|
this.value = this.defaultValue, this.close();
|
|
150
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Called by the platform when the control's disabled state changes — its
|
|
170
|
+
* own `disabled`, or an ancestor `<fieldset disabled>` it cannot see.
|
|
171
|
+
*/
|
|
172
|
+
formDisabledCallback(t) {
|
|
173
|
+
this.formDisabled = t;
|
|
174
|
+
}
|
|
151
175
|
formStateRestoreCallback(t) {
|
|
152
176
|
this.value = t;
|
|
153
177
|
}
|
|
@@ -159,7 +183,7 @@ class e extends m {
|
|
|
159
183
|
}
|
|
160
184
|
/** Options after the current query, which is what the keyboard walks. */
|
|
161
185
|
get visibleOptions() {
|
|
162
|
-
return
|
|
186
|
+
return C(this.options, this.query);
|
|
163
187
|
}
|
|
164
188
|
/**
|
|
165
189
|
* While filtering, the field shows the query; otherwise it shows the chosen
|
|
@@ -169,22 +193,22 @@ class e extends m {
|
|
|
169
193
|
get displayValue() {
|
|
170
194
|
if (this.open && this.query) return this.query;
|
|
171
195
|
const t = this.selectedOption;
|
|
172
|
-
return t ?
|
|
196
|
+
return t ? g(t) : this.query;
|
|
173
197
|
}
|
|
174
198
|
openList() {
|
|
175
|
-
this.
|
|
199
|
+
this.inactive || this.open || (this.open = !0, this.activeIndex = v(this.visibleOptions));
|
|
176
200
|
}
|
|
177
201
|
close() {
|
|
178
202
|
this.open = !1, this.query = "", this.activeIndex = -1;
|
|
179
203
|
}
|
|
180
204
|
onInput(t) {
|
|
181
|
-
this.query = t.target.value, this.open = !0, this.activeIndex = v(this.visibleOptions),
|
|
205
|
+
this.query = t.target.value, this.open = !0, this.activeIndex = v(this.visibleOptions), f(this, "kt-filter", { query: this.query });
|
|
182
206
|
}
|
|
183
207
|
choose(t) {
|
|
184
|
-
t.disabled || (this.value = t.id, this.close(),
|
|
208
|
+
t.disabled || (this.value = t.id, this.close(), f(this, "kt-change", { value: t.id, option: t }));
|
|
185
209
|
}
|
|
186
210
|
clear(t) {
|
|
187
|
-
t.stopPropagation(), this.value = null, this.query = "",
|
|
211
|
+
t.stopPropagation(), this.value = null, this.query = "", f(this, "kt-change", { value: null, option: null }), this.input?.focus();
|
|
188
212
|
}
|
|
189
213
|
onKeyDown(t) {
|
|
190
214
|
const o = this.visibleOptions;
|
|
@@ -192,7 +216,7 @@ class e extends m {
|
|
|
192
216
|
case "ArrowDown":
|
|
193
217
|
case "ArrowUp":
|
|
194
218
|
if (t.preventDefault(), !this.open) return this.openList();
|
|
195
|
-
this.activeIndex =
|
|
219
|
+
this.activeIndex = E(
|
|
196
220
|
o,
|
|
197
221
|
this.activeIndex,
|
|
198
222
|
t.key === "ArrowDown" ? 1 : -1
|
|
@@ -204,7 +228,7 @@ class e extends m {
|
|
|
204
228
|
return;
|
|
205
229
|
case "End":
|
|
206
230
|
if (!this.open) return;
|
|
207
|
-
t.preventDefault(), this.activeIndex =
|
|
231
|
+
t.preventDefault(), this.activeIndex = P(o);
|
|
208
232
|
return;
|
|
209
233
|
case "Enter": {
|
|
210
234
|
if (!this.open) return;
|
|
@@ -225,9 +249,9 @@ class e extends m {
|
|
|
225
249
|
return `${this.listId}-option-${t}`;
|
|
226
250
|
}
|
|
227
251
|
render() {
|
|
228
|
-
const t = this.visibleOptions, o = this.selectedOption !== void 0 && !this.
|
|
229
|
-
return
|
|
230
|
-
class=${
|
|
252
|
+
const t = this.visibleOptions, o = this.selectedOption !== void 0 && !this.inactive;
|
|
253
|
+
return p`<div
|
|
254
|
+
class=${d({ open: this.open, error: !!this.error })}
|
|
231
255
|
@keydown=${this.onKeyDown}
|
|
232
256
|
>
|
|
233
257
|
<div part="control" class="control" @click=${this.openList}>
|
|
@@ -241,13 +265,13 @@ class e extends m {
|
|
|
241
265
|
aria-label=${this.label || a}
|
|
242
266
|
aria-invalid=${this.error ? "true" : a}
|
|
243
267
|
placeholder=${this.placeholder || a}
|
|
244
|
-
.value=${
|
|
245
|
-
?disabled=${this.
|
|
268
|
+
.value=${k(this.displayValue)}
|
|
269
|
+
?disabled=${this.inactive}
|
|
246
270
|
@focus=${this.openList}
|
|
247
271
|
@input=${this.onInput}
|
|
248
272
|
/>
|
|
249
273
|
|
|
250
|
-
${o ?
|
|
274
|
+
${o ? p`<button
|
|
251
275
|
type="button"
|
|
252
276
|
class="icon-button clear"
|
|
253
277
|
aria-label=${l().clear}
|
|
@@ -273,15 +297,16 @@ class e extends m {
|
|
|
273
297
|
<ul
|
|
274
298
|
part="popup"
|
|
275
299
|
id=${this.listId}
|
|
276
|
-
|
|
300
|
+
popover="manual"
|
|
301
|
+
class=${d({ popup: !0, floating: !0, open: this.open, top: this.placement === "top" })}
|
|
277
302
|
role="listbox"
|
|
278
303
|
aria-label=${this.label || this.placeholder}
|
|
279
304
|
>
|
|
280
|
-
${t.length === 0 ?
|
|
281
|
-
(r, s) =>
|
|
305
|
+
${t.length === 0 ? p`<li class="empty">${this.emptyText ?? l().noOptions}</li>` : t.map(
|
|
306
|
+
(r, s) => p`<li
|
|
282
307
|
part="option"
|
|
283
308
|
id=${this.optionId(s)}
|
|
284
|
-
class=${
|
|
309
|
+
class=${d({
|
|
285
310
|
option: !0,
|
|
286
311
|
selected: r.id === this.value,
|
|
287
312
|
active: s === this.activeIndex,
|
|
@@ -291,7 +316,7 @@ class e extends m {
|
|
|
291
316
|
aria-selected=${r.id === this.value ? "true" : "false"}
|
|
292
317
|
@click=${() => this.choose(r)}
|
|
293
318
|
>
|
|
294
|
-
${
|
|
319
|
+
${g(r)}
|
|
295
320
|
</li>`
|
|
296
321
|
)}
|
|
297
322
|
</ul>
|
|
@@ -302,13 +327,16 @@ i([
|
|
|
302
327
|
x("input")
|
|
303
328
|
], e.prototype, "input");
|
|
304
329
|
i([
|
|
305
|
-
|
|
330
|
+
h()
|
|
306
331
|
], e.prototype, "open");
|
|
307
332
|
i([
|
|
308
|
-
|
|
333
|
+
h()
|
|
334
|
+
], e.prototype, "placement");
|
|
335
|
+
i([
|
|
336
|
+
h()
|
|
309
337
|
], e.prototype, "query");
|
|
310
338
|
i([
|
|
311
|
-
|
|
339
|
+
h()
|
|
312
340
|
], e.prototype, "activeIndex");
|
|
313
341
|
i([
|
|
314
342
|
n({ attribute: !1 })
|
|
@@ -325,6 +353,9 @@ i([
|
|
|
325
353
|
i([
|
|
326
354
|
n({ type: Boolean, reflect: !0 })
|
|
327
355
|
], e.prototype, "disabled");
|
|
356
|
+
i([
|
|
357
|
+
h()
|
|
358
|
+
], e.prototype, "formDisabled");
|
|
328
359
|
i([
|
|
329
360
|
n({ type: Boolean, reflect: !0 })
|
|
330
361
|
], e.prototype, "required");
|
|
@@ -337,7 +368,7 @@ i([
|
|
|
337
368
|
i([
|
|
338
369
|
n({ type: String, attribute: "empty-text" })
|
|
339
370
|
], e.prototype, "emptyText");
|
|
340
|
-
|
|
371
|
+
$("kt-input-menu", e);
|
|
341
372
|
export {
|
|
342
373
|
e as KtInputMenu
|
|
343
374
|
};
|