@italia/globals 0.1.0-alpha.1 → 1.0.0-alpha.10

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.
Files changed (58) hide show
  1. package/custom-elements.json +2122 -179
  2. package/dist/src/base-component/base-component.d.ts +28 -13
  3. package/dist/src/base-component/base-component.d.ts.map +1 -1
  4. package/dist/src/base-component/base-component.js +27 -17
  5. package/dist/src/base-component/base-component.js.map +1 -1
  6. package/dist/src/controllers/aria-keyboard-accordion-controller.d.ts +15 -0
  7. package/dist/src/controllers/aria-keyboard-accordion-controller.d.ts.map +1 -0
  8. package/dist/src/controllers/aria-keyboard-accordion-controller.js +52 -0
  9. package/dist/src/controllers/aria-keyboard-accordion-controller.js.map +1 -0
  10. package/dist/src/controllers/aria-keyboard-list-controller.d.ts +18 -0
  11. package/dist/src/controllers/aria-keyboard-list-controller.d.ts.map +1 -0
  12. package/dist/src/controllers/aria-keyboard-list-controller.js +58 -0
  13. package/dist/src/controllers/aria-keyboard-list-controller.js.map +1 -0
  14. package/dist/src/controllers/collapse-controller.d.ts +12 -0
  15. package/dist/src/controllers/collapse-controller.d.ts.map +1 -0
  16. package/dist/src/controllers/collapse-controller.js +95 -0
  17. package/dist/src/controllers/collapse-controller.js.map +1 -0
  18. package/dist/src/controllers/focus-trap-controller.d.ts +92 -0
  19. package/dist/src/controllers/focus-trap-controller.d.ts.map +1 -0
  20. package/dist/src/controllers/focus-trap-controller.js +497 -0
  21. package/dist/src/controllers/focus-trap-controller.js.map +1 -0
  22. package/dist/src/controllers/roving-tabindex-controller.d.ts +92 -0
  23. package/dist/src/controllers/roving-tabindex-controller.d.ts.map +1 -0
  24. package/dist/src/controllers/roving-tabindex-controller.js +206 -0
  25. package/dist/src/controllers/roving-tabindex-controller.js.map +1 -0
  26. package/dist/src/form/form-control.d.ts +61 -0
  27. package/dist/src/form/form-control.d.ts.map +1 -0
  28. package/dist/src/form/form-control.js +259 -0
  29. package/dist/src/form/form-control.js.map +1 -0
  30. package/dist/src/form/form-controller.d.ts +68 -0
  31. package/dist/src/form/form-controller.d.ts.map +1 -0
  32. package/dist/src/form/form-controller.js +408 -0
  33. package/dist/src/form/form-controller.js.map +1 -0
  34. package/dist/src/form/locales/it.d.ts +4 -0
  35. package/dist/src/form/locales/it.d.ts.map +1 -0
  36. package/dist/src/form/locales/it.js +12 -0
  37. package/dist/src/form/locales/it.js.map +1 -0
  38. package/dist/src/index.d.ts +20 -4
  39. package/dist/src/index.d.ts.map +1 -1
  40. package/dist/src/index.js +18 -4
  41. package/dist/src/index.js.map +1 -1
  42. package/dist/src/mixins/validity.d.ts +19 -19
  43. package/dist/src/mixins/validity.d.ts.map +1 -1
  44. package/dist/src/mixins/validity.js +6 -68
  45. package/dist/src/mixins/validity.js.map +1 -1
  46. package/dist/src/stories/formControlReusableStories.d.ts +19 -0
  47. package/dist/src/stories/formControlReusableStories.d.ts.map +1 -0
  48. package/dist/src/stories/formControlReusableStories.js +64 -0
  49. package/dist/src/stories/formControlReusableStories.js.map +1 -0
  50. package/dist/src/window-manager.d.ts +33 -0
  51. package/dist/src/window-manager.d.ts.map +1 -0
  52. package/dist/src/window-manager.js +78 -0
  53. package/dist/src/window-manager.js.map +1 -0
  54. package/package.json +10 -8
  55. package/dist/src/mixins/form.d.ts +0 -363
  56. package/dist/src/mixins/form.d.ts.map +0 -1
  57. package/dist/src/mixins/form.js +0 -36
  58. package/dist/src/mixins/form.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-trap-controller.js","sourceRoot":"","sources":["../../../src/controllers/focus-trap-controller.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,mBAAmB;IA0DtB,MAAM,CAAC,sBAAsB,CAAC,OAAoB;QACxD,IAAI,OAAO,GAAgB,OAAO,CAAC;QAEnC,OAAO,OAAO,EAAE,CAAC;YACf,MAAM,QAAQ,GAAuB,OAAO,YAAY,WAAW,CAA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BAA6B;CAC9B,CAAC,IAAI,CAAC,GAAG,CAAC,AAHwC,CAGvC","sourcesContent":["/* eslint-disable no-continue */\nimport { ReactiveController, ReactiveControllerHost } from 'lit';\n\nexport interface FocusTrapConfig {\n /** Funzione che ritorna l'elemento contenitore del trap */\n getContainer: () => HTMLElement | ShadowRoot | null;\n /** Funzione che ritorna l'elemento trigger che ha attivato il focus trap */\n getTrigger: () => HTMLElement | ShadowRoot | null;\n /** Opzionale: funzione che ritorna l'elemento da mettere a fuoco all'apertura (può essere tabindex -1) */\n initialFocus?: () => HTMLElement | null;\n /** Callback quando viene premuto Escape */\n onEscape?: () => void;\n /** Se true, non chiude con Escape */\n disableEscape?: boolean;\n}\n\n/**\n * Safari/VoiceOver iOS workarounds catalogue — why timers exist here:\n *\n * 1. `activate()` rAF + setTimeout(50): Safari does not reliably update the VoiceOver\n * accessibility tree synchronously. rAF ensures the element is painted before we\n * attempt to focus it. setTimeout(50) yields 50ms so VoiceOver can settle its\n * accessibility tree before announcing the newly focused element.\n * Empirically, VoiceOver iOS needs 100–300ms; the animated path in it-modal already\n * provides ~316ms naturally via animation.finished, so the 50ms here only truly\n * matters for the no-animation / prefers-reduced-motion path.\n *\n * 2. `_restoreFocus()` setTimeout(0): Same settle reason on close. The caller\n * (it-modal finishHide) adds a belt-and-suspenders 20ms setTimeout; _restoreFocus\n * is skipped via { skipFocusRestore: true } in that case to avoid double-focus.\n *\n * 3. `activate()` iOS body-focus fallback: On iOS Safari, tapping a button does not\n * reliably move document.activeElement away from body. We fall back to getTrigger()\n * so _previousActiveElement is always a real DOM element to restore focus to on close.\n *\n * There is no WebKit/Safari API to detect when VoiceOver has settled its accessibility\n * tree. setTimeout-based workarounds are the same pattern used by Bootstrap 5, the\n * focus-trap npm package, and a11y-dialog.\n */\nexport class FocusTrapController implements ReactiveController {\n private host: ReactiveControllerHost & HTMLElement;\n\n private config: FocusTrapConfig;\n\n private observer: MutationObserver | null = null;\n\n private _isActive = false;\n\n private _previousActiveElement: HTMLElement | null = null;\n\n private _focusableElements: HTMLElement[] = [];\n\n private _first?: HTMLElement;\n\n private _last?: HTMLElement;\n\n /** Last known index resolved from real focusin events inside the trap.\n * Used as a fallback when assistive tech retargeting makes activeElement\n * temporarily unmappable during Tab navigation. */\n private _lastKnownFocusIndex = -1;\n\n /** Timer ID for the focus call scheduled inside activate(). Cancelled by deactivate()\n * to prevent focus firing after the trap has been torn down (fast open/close, unmount). */\n private _pendingFocusTimer: ReturnType<typeof setTimeout> | null = null;\n\n private static readonly FOCUSABLE_SELECTORS = [\n 'a[href]',\n 'button:not([disabled])',\n 'textarea:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n '[tabindex]',\n 'it-button:not([disabled])',\n 'it-dropdown:not([disabled])',\n 'it-megamenu:not([disabled])',\n ].join(',');\n\n private static readonly NATIVE_FOCUSABLE_SELECTORS = [\n 'a[href]',\n 'button:not([disabled])',\n 'textarea:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n ].join(',');\n\n private static readonly MANAGED_HOST_SELECTORS = [\n 'it-button:not([disabled])',\n 'it-dropdown:not([disabled])',\n 'it-megamenu:not([disabled])',\n ].join(',');\n\n private static readonly MANAGED_MENU_HOST_SELECTORS = [\n 'it-dropdown:not([disabled])',\n 'it-megamenu:not([disabled])',\n ].join(',');\n\n private static getManagedHostAncestor(element: HTMLElement): HTMLElement | null {\n let current: Node | null = element;\n\n while (current) {\n const parentEl: HTMLElement | null = current instanceof HTMLElement ? current.parentElement : null;\n if (parentEl && parentEl.matches(FocusTrapController.MANAGED_HOST_SELECTORS)) return parentEl;\n\n if (parentEl) {\n current = parentEl;\n continue;\n }\n\n const rootNode: Node = current.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n const hostElement: Element = rootNode.host;\n if (hostElement instanceof HTMLElement) {\n if (hostElement.matches(FocusTrapController.MANAGED_HOST_SELECTORS)) return hostElement;\n current = hostElement;\n continue;\n }\n }\n\n break;\n }\n\n return null;\n }\n\n private static isInsideManagedHost(element: HTMLElement): boolean {\n return FocusTrapController.getManagedHostAncestor(element) !== null;\n }\n\n private static getManagedMenuHostAncestor(element: HTMLElement): HTMLElement | null {\n let current: Node | null = element;\n\n while (current) {\n const parentEl: HTMLElement | null = current instanceof HTMLElement ? current.parentElement : null;\n if (parentEl && parentEl.matches(FocusTrapController.MANAGED_MENU_HOST_SELECTORS)) return parentEl;\n\n if (parentEl) {\n current = parentEl;\n continue;\n }\n\n const rootNode: Node = current.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n const hostElement: Element = rootNode.host;\n if (hostElement instanceof HTMLElement) {\n if (hostElement.matches(FocusTrapController.MANAGED_MENU_HOST_SELECTORS)) return hostElement;\n current = hostElement;\n continue;\n }\n }\n\n break;\n }\n\n return null;\n }\n\n private static collectFocusableCandidates(\n root: ParentNode,\n candidates: HTMLElement[],\n trigger: HTMLElement | ShadowRoot | null,\n visited: Set<Node>,\n ): void {\n const rootAsNode = root as Node;\n if (visited.has(rootAsNode)) return;\n visited.add(rootAsNode);\n\n const elements = Array.from(root.querySelectorAll<HTMLElement>('*'));\n elements.forEach((el) => {\n if (el === trigger) return;\n\n // Keep custom host components as single tab stops: their internal light/shadow\n // descendants must not appear as separate trap candidates.\n if (FocusTrapController.isInsideManagedHost(el)) return;\n\n if (el.matches(FocusTrapController.FOCUSABLE_SELECTORS)) {\n candidates.push(el);\n // Stop here: focusCandidate() handles delegation to the inner focusable.\n // Prevent recursion into this element's shadow DOM so inner buttons/triggers\n // are not added as separate tab stops.\n if (el.shadowRoot) visited.add(el.shadowRoot);\n return;\n }\n\n if (el instanceof HTMLSlotElement) {\n el.assignedElements({ flatten: true }).forEach((assigned) => {\n if (!(assigned instanceof HTMLElement) || assigned === trigger) return;\n\n if (assigned.matches(FocusTrapController.FOCUSABLE_SELECTORS)) {\n candidates.push(assigned);\n // Same rule: don't recurse into a focusable element.\n if (assigned.shadowRoot) visited.add(assigned.shadowRoot);\n return;\n }\n\n FocusTrapController.collectFocusableCandidates(assigned, candidates, trigger, visited);\n\n if (assigned.shadowRoot) {\n FocusTrapController.collectFocusableCandidates(assigned.shadowRoot, candidates, trigger, visited);\n }\n });\n return;\n }\n\n if (el.shadowRoot) {\n FocusTrapController.collectFocusableCandidates(el.shadowRoot, candidates, trigger, visited);\n }\n });\n }\n\n private static getFirstFocusableInShadow(host: HTMLElement): HTMLElement | null {\n const visited = new Set<Node>();\n\n const walk = (root: ParentNode): HTMLElement | null => {\n const rootAsNode = root as Node;\n if (visited.has(rootAsNode)) return null;\n visited.add(rootAsNode);\n\n const direct = Array.from(root.querySelectorAll<HTMLElement>(FocusTrapController.NATIVE_FOCUSABLE_SELECTORS));\n const firstDirect = direct.find((el) => FocusTrapController.isFocusable(el));\n if (firstDirect) return firstDirect;\n\n const all = Array.from(root.querySelectorAll<HTMLElement>('*'));\n for (const el of all) {\n if (el instanceof HTMLSlotElement) {\n const assigned = el.assignedElements({ flatten: true });\n for (const assignedEl of assigned) {\n if (!(assignedEl instanceof HTMLElement)) continue;\n if (assignedEl.matches(FocusTrapController.NATIVE_FOCUSABLE_SELECTORS)) {\n if (FocusTrapController.isFocusable(assignedEl)) return assignedEl;\n }\n const nestedAssigned = walk(assignedEl);\n if (nestedAssigned) return nestedAssigned;\n if (assignedEl.shadowRoot) {\n const nestedAssignedShadow = walk(assignedEl.shadowRoot);\n if (nestedAssignedShadow) return nestedAssignedShadow;\n }\n }\n }\n\n if (el.shadowRoot) {\n const nested = walk(el.shadowRoot);\n if (nested) return nested;\n }\n }\n\n return null;\n };\n\n if (!host.shadowRoot) return null;\n return walk(host.shadowRoot);\n }\n\n private static focusCandidate(target: HTMLElement | undefined): void {\n if (!target) return;\n\n if (target.tagName.toLowerCase().startsWith('it-')) {\n const innerFocusable = FocusTrapController.getFirstFocusableInShadow(target);\n if (innerFocusable) {\n innerFocusable.focus({ preventScroll: true });\n return;\n }\n }\n\n target.focus({ preventScroll: true });\n }\n\n /**\n * Verifica se un elemento è effettivamente focusabile e tabbabile.\n * Elementi con tabindex=\"-1\" sono focusabili programmaticamente ma non tabbabili.\n */\n private static isFocusable(el: HTMLElement): boolean {\n if (typeof el.focus !== 'function') return false;\n if (el.hasAttribute('disabled') || el.hasAttribute('inert') || el.hasAttribute('it-inert')) return false;\n const tabindex = el.getAttribute('tabindex');\n if (tabindex && parseInt(tabindex, 10) < 0) return false;\n\n if (el.tagName.toLowerCase().startsWith('it-')) {\n if (tabindex && parseInt(tabindex, 10) < 0) return false;\n return true;\n }\n\n // Fix Race Condition Safari: durante l'apertura non fidarti di getClientRects o opacità\n try {\n const style = window.getComputedStyle(el);\n return style && style.display !== 'none' && style.visibility !== 'hidden';\n } catch {\n return false;\n }\n }\n\n constructor(host: ReactiveControllerHost & HTMLElement, config: FocusTrapConfig) {\n this.host = host;\n this.config = config;\n this.host.addController(this);\n }\n\n hostConnected() {\n const observerOptions = { childList: true, attributes: true, subtree: true };\n this.observer = new MutationObserver(this.updateFocusableElements.bind(this));\n this.observer.observe(this.host, observerOptions);\n }\n\n hostDisconnected() {\n this.deactivate();\n if (this.observer) {\n this.observer.disconnect();\n this.observer = null;\n }\n }\n\n get isActive(): boolean {\n return this._isActive;\n }\n\n activate(): void {\n if (this._isActive) return;\n this._isActive = true;\n\n // FIX iOS: Safari non dà focus al tap. Se activeElement è body, salviamo il trigger della config.\n const currentActive = FocusTrapController.getActiveElement();\n this._previousActiveElement =\n !currentActive || currentActive === document.body ? (this.config.getTrigger() as HTMLElement) : currentActive;\n\n // Usa document capture: cattura Tab/Escape prima di qualsiasi handler,\n // indipendentemente da shadow DOM, delegatesFocus e slot retargeting.\n document.addEventListener('keydown', this._handleKeyDown, true);\n document.addEventListener('focusin', this._handleFocusIn, true);\n this.updateFocusableElements();\n this._lastKnownFocusIndex = -1;\n // FIX Safari: trick engine\n // Diamo al browser un istante per processare il ricalcolo del layout\n requestAnimationFrame(() => {\n if (this.config.initialFocus) {\n const el = this.config.initialFocus();\n if (el) {\n // 50ms gives VoiceOver iOS time to settle its accessibility tree before\n // announcing the focused element. See class-level comment for details.\n this._pendingFocusTimer = setTimeout(() => {\n this._pendingFocusTimer = null;\n el.focus({ preventScroll: true });\n }, 50);\n }\n } else {\n console.warn(\"FocusTrap: missing 'initialFocus' callback, provide one\");\n }\n });\n }\n\n deactivate(options?: { skipFocusRestore?: boolean }): void {\n if (!this._isActive) return;\n // Cancel any in-flight focus timer so it cannot fire after the trap is torn down\n // (e.g. fast open/close cycle, component unmounted while opening).\n if (this._pendingFocusTimer !== null) {\n clearTimeout(this._pendingFocusTimer);\n this._pendingFocusTimer = null;\n }\n this._isActive = false;\n document.removeEventListener('keydown', this._handleKeyDown, true);\n document.removeEventListener('focusin', this._handleFocusIn, true);\n this._lastKnownFocusIndex = -1;\n if (!options?.skipFocusRestore) {\n this._restoreFocus();\n } else {\n this._previousActiveElement = null;\n }\n }\n\n /**\n * Aggiorna la lista degli elementi focusabili.\n * Chiamare dopo modifiche al DOM.\n */\n updateFocusableElements(): void {\n const container = this.config.getContainer();\n const trigger = this.config.getTrigger();\n if (!container) {\n this._focusableElements = [];\n this._first = undefined;\n this._last = undefined;\n return;\n }\n\n const candidates: HTMLElement[] = [];\n FocusTrapController.collectFocusableCandidates(container, candidates, trigger, new Set<Node>());\n\n // Include anche i figli light DOM dell'host (es. contenuti slottati della modale)\n Array.from(this.host.children).forEach((child) => {\n if (!(child instanceof HTMLElement) || child === trigger) return;\n\n if (child.matches(FocusTrapController.FOCUSABLE_SELECTORS)) {\n candidates.push(child);\n // Don't recurse: same stop-on-focusable rule.\n return;\n }\n\n const childVisited = new Set<Node>();\n FocusTrapController.collectFocusableCandidates(child, candidates, trigger, childVisited);\n\n if (child.shadowRoot) {\n FocusTrapController.collectFocusableCandidates(child.shadowRoot, candidates, trigger, childVisited);\n }\n });\n\n // Filtra solo elementi veramente focusabili e rimuovi duplicati\n this._focusableElements = Array.from(new Set(candidates)).filter((el) => {\n // Escludi esplicitamente il container/dialog stesso\n if (el === this.config.getContainer()) return false;\n return FocusTrapController.isFocusable(el);\n });\n\n // Aggiorna primo/ultimo\n this._first = this._focusableElements?.[0];\n this._last = this._focusableElements[this._focusableElements.length - 1];\n }\n\n /** Sposta il focus sul primo elemento focusabile */\n focusFirst(): void {\n if (this._first) this._first.focus();\n }\n\n /** Sposta il focus sull'ultimo elemento focusabile */\n focusLast(): void {\n if (this._last) {\n this._last.focus();\n }\n }\n\n /** Ritorna l'elemento attivo corrente, attraversando shadow DOM e slot */\n static getActiveElement(): HTMLElement | null {\n let active = document.activeElement;\n while (active && active.shadowRoot && active.shadowRoot.activeElement) {\n active = active.shadowRoot.activeElement;\n }\n return active as HTMLElement | null;\n }\n\n private _handleKeyDown = (event: KeyboardEvent): void => {\n if (!this._isActive) return;\n switch (event.key) {\n case 'Escape':\n if (!this.config.disableEscape && this.config.onEscape) {\n event.preventDefault();\n this.config.onEscape();\n }\n break;\n case 'Tab':\n this._handleTab(event);\n break;\n default:\n break;\n }\n };\n\n private _handleFocusIn = (event: FocusEvent): void => {\n if (!this._isActive) return;\n\n if (this._focusableElements.length === 0) {\n this.updateFocusableElements();\n if (this._focusableElements.length === 0) return;\n }\n\n const path = event.composedPath();\n let index = this._focusableElements.findIndex((candidate) => path.includes(candidate));\n\n if (index === -1) {\n const target = path[0];\n if (target instanceof HTMLElement) {\n index = this._focusableElements.indexOf(target);\n }\n }\n\n if (index === -1) {\n const active = FocusTrapController.getActiveElement();\n if (active) {\n index = this._focusableElements.findIndex((candidate) => candidate.contains(active));\n }\n }\n\n if (index !== -1) {\n this._lastKnownFocusIndex = index;\n }\n };\n\n private _handleTab(event: KeyboardEvent): void {\n const activeElement = FocusTrapController.getActiveElement();\n\n // Let native Tab behavior handle navigation inside open dropdown/megamenu.\n // This allows entering and traversing internal menu items correctly.\n if (activeElement) {\n const managedHost = FocusTrapController.getManagedMenuHostAncestor(activeElement);\n if (managedHost && managedHost.getAttribute('data-it-aria-expanded') === 'true') {\n return;\n }\n }\n\n // Ricalcola sempre al Tab: gli elementi slottati possono completare il render\n // del proprio shadow DOM dopo l'attivazione iniziale del trap.\n this.updateFocusableElements();\n if (this._focusableElements.length === 0) return; // Se è ancora vuoto, non bloccare il Tab\n\n event.preventDefault();\n let currentIndex = this._focusableElements.indexOf(activeElement as HTMLElement);\n\n if (currentIndex === -1 && activeElement) {\n // 1. Walk shadow host chain (covers delegatesFocus custom elements)\n let parent = (activeElement.getRootNode() as ShadowRoot)?.host;\n while (parent && currentIndex === -1) {\n currentIndex = this._focusableElements.indexOf(parent as HTMLElement);\n if (currentIndex === -1) parent = (parent.getRootNode() as ShadowRoot)?.host;\n }\n }\n\n if (currentIndex === -1) {\n // 2. Composed path fallback: handles focus inside nested shadow/slotted\n // content (e.g. anchors inside it-dropdown-item) by mapping the active\n // target to the first focusable host found in the event path.\n const composedPath = event.composedPath();\n currentIndex = this._focusableElements.findIndex((candidate) => composedPath.includes(candidate));\n }\n\n if (currentIndex === -1 && activeElement) {\n // 3. contains() fallback: handles focus inside an open dropdown/megamenu whose\n // items live in light DOM (not shadow DOM), so the parent-walk above doesn't\n // reach the host. Map to the host's index so Tab/Shift+Tab move to the\n // correct adjacent element.\n currentIndex = this._focusableElements.findIndex((candidate) => candidate.contains(activeElement));\n }\n\n if (currentIndex === -1) {\n // 4. AT fallback: with some screen readers, document.activeElement and/or\n // event target can be unreliable while navigating inside composite widgets.\n // If a dropdown/megamenu is currently open, use its host index as anchor\n // so forward/backward Tab continue from that position instead of wrapping.\n currentIndex = this._focusableElements.findIndex(\n (candidate) =>\n candidate.matches('it-dropdown, it-megamenu') && candidate.getAttribute('data-it-aria-expanded') === 'true',\n );\n }\n\n if (currentIndex === -1 && this._lastKnownFocusIndex >= 0) {\n // 5. Last-known fallback: if assistive tech retargeting hides the active\n // element for this key event, continue from the most recent resolved\n // focus index captured via focusin.\n currentIndex = Math.min(this._lastKnownFocusIndex, this._focusableElements.length - 1);\n }\n\n if (event.shiftKey) {\n if (currentIndex <= 0) FocusTrapController.focusCandidate(this._last);\n else FocusTrapController.focusCandidate(this._focusableElements[currentIndex - 1]);\n } else if (currentIndex === -1 || currentIndex >= this._focusableElements.length - 1)\n FocusTrapController.focusCandidate(this._first);\n else FocusTrapController.focusCandidate(this._focusableElements[currentIndex + 1]);\n }\n\n private _restoreFocus(): void {\n const target = this._previousActiveElement;\n this._previousActiveElement = null;\n if (target && typeof target.focus === 'function' && document.contains(target)) {\n // FIX Safari: blur the current element first so VoiceOver doesn't stay on the\n // modal element while the accessibility tree processes the focus change.\n FocusTrapController.getActiveElement()?.blur();\n // FIX Safari/VoiceOver iOS: defer to the next macrotask so the accessibility\n // tree has time to process the DOM mutation before announcing the restored element.\n setTimeout(() => {\n target.focus({ preventScroll: true });\n }, 0);\n }\n }\n}\n"]}
@@ -0,0 +1,92 @@
1
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ export interface RovingTabindexConfig<T extends HTMLElement> {
3
+ /**
4
+ * Selector or function to get the items to manage
5
+ */
6
+ getItems: () => T[];
7
+ /**
8
+ * Callback when an item is selected/activated
9
+ */
10
+ onSelect?: (item: T, event: KeyboardEvent | PointerEvent | MouseEvent) => void;
11
+ /**
12
+ * Whether items wrap around (last -> first and vice versa)
13
+ * @default true
14
+ */
15
+ wrap?: boolean;
16
+ /**
17
+ * Direction of navigation. Può essere una stringa statica o una funzione
18
+ * che restituisce la direzione dinamicamente (utile quando la direzione
19
+ * dipende dallo stato del componente, es. orientamento verticale/orizzontale).
20
+ * @default 'both'
21
+ */
22
+ direction?: 'horizontal' | 'vertical' | 'both' | (() => 'horizontal' | 'vertical' | 'both');
23
+ /**
24
+ * Whether to select items on focus (vs just focusing)
25
+ * @default false
26
+ */
27
+ selectOnFocus?: boolean;
28
+ /**
29
+ * Whether Home/End should *activate* (select) the item in addition to focusing it.
30
+ * Default false to avoid changing downstream components; opt-in when needed.
31
+ */
32
+ selectOnHomeEnd?: boolean;
33
+ /**
34
+ * Custom logic to determine if an item should be skipped
35
+ * @default (item) => item.hasAttribute('disabled')
36
+ */
37
+ skipItem?: (item: T) => boolean;
38
+ }
39
+ /**
40
+ * Roving Tabindex Controller
41
+ *
42
+ * Implements the ARIA roving tabindex pattern for keyboard navigation.
43
+ * See: https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex
44
+ *
45
+ * Usage:
46
+ * ```ts
47
+ * private rovingTabindex = new RovingTabindexController(this, {
48
+ * getItems: () => Array.from(this.querySelectorAll('my-item')),
49
+ * onSelect: (item) => this.selectItem(item),
50
+ * });
51
+ * ```
52
+ */
53
+ export declare class RovingTabindexController<T extends HTMLElement> implements ReactiveController {
54
+ private host;
55
+ private config;
56
+ constructor(host: ReactiveControllerHost, config: RovingTabindexConfig<T>);
57
+ hostConnected(): void;
58
+ hostDisconnected(): void;
59
+ /**
60
+ * Update tabindex values for all items
61
+ * @param activeIndex - Index of the item that should be tabbable (default: 0 or first non-disabled)
62
+ */
63
+ updateTabindices(activeIndex?: number): void;
64
+ /**
65
+ * Handle keyboard navigation
66
+ * @param currentItem - The currently focused item
67
+ * @param event - The keyboard event
68
+ * @returns true if the event was handled, false otherwise
69
+ */
70
+ handleKeydown(currentItem: T, event: KeyboardEvent): boolean;
71
+ /**
72
+ * Get the next index based on direction
73
+ */
74
+ private getNextIndex;
75
+ /**
76
+ * Find the next valid (non-disabled) index
77
+ */
78
+ private findNextValidIndex;
79
+ /**
80
+ * Set focus to a specific item
81
+ */
82
+ focusItem(item: T): void;
83
+ /**
84
+ * Set focus to the first non-disabled item
85
+ */
86
+ focusFirst(): void;
87
+ /**
88
+ * Set focus to the last non-disabled item
89
+ */
90
+ focusLast(): void;
91
+ }
92
+ //# sourceMappingURL=roving-tabindex-controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roving-tabindex-controller.d.ts","sourceRoot":"","sources":["../../../src/controllers/roving-tabindex-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EA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I;IAUxB;;OAEG;IACH,UAAU,IAAI,IAAI;IASlB;;OAEG;IACH,SAAS,IAAI,IAAI;CAQlB"}
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Roving Tabindex Controller
3
+ *
4
+ * Implements the ARIA roving tabindex pattern for keyboard navigation.
5
+ * See: https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex
6
+ *
7
+ * Usage:
8
+ * ```ts
9
+ * private rovingTabindex = new RovingTabindexController(this, {
10
+ * getItems: () => Array.from(this.querySelectorAll('my-item')),
11
+ * onSelect: (item) => this.selectItem(item),
12
+ * });
13
+ * ```
14
+ */
15
+ export class RovingTabindexController {
16
+ constructor(host, config) {
17
+ this.host = host;
18
+ this.config = {
19
+ wrap: true,
20
+ direction: 'both',
21
+ selectOnFocus: false,
22
+ selectOnHomeEnd: false,
23
+ skipItem: (item) => item.hasAttribute('disabled') || item.disabled === true,
24
+ ...config,
25
+ };
26
+ host.addController(this);
27
+ }
28
+ // eslint-disable-next-line class-methods-use-this
29
+ hostConnected() {
30
+ // Controller is ready when host connects
31
+ }
32
+ // eslint-disable-next-line class-methods-use-this
33
+ hostDisconnected() {
34
+ // Cleanup if needed
35
+ }
36
+ /**
37
+ * Update tabindex values for all items
38
+ * @param activeIndex - Index of the item that should be tabbable (default: 0 or first non-disabled)
39
+ */
40
+ updateTabindices(activeIndex) {
41
+ const items = this.config.getItems();
42
+ if (!items || items.length === 0) {
43
+ return;
44
+ }
45
+ // Find the active index
46
+ let targetIndex = activeIndex ?? 0;
47
+ // If no active index specified, use first non-disabled item
48
+ if (activeIndex === undefined) {
49
+ targetIndex = items.findIndex((item) => !this.config.skipItem(item));
50
+ if (targetIndex === -1) {
51
+ targetIndex = 0; // Fallback to first item if all disabled
52
+ }
53
+ }
54
+ // Set tabindex for all items
55
+ items.forEach((item, index) => {
56
+ const itemElement = item;
57
+ if (this.config.skipItem(itemElement)) {
58
+ // eslint-disable-next-line no-param-reassign
59
+ itemElement.tabIndex = -1;
60
+ }
61
+ else {
62
+ // eslint-disable-next-line no-param-reassign
63
+ itemElement.tabIndex = index === targetIndex ? 0 : -1;
64
+ }
65
+ });
66
+ }
67
+ /**
68
+ * Handle keyboard navigation
69
+ * @param currentItem - The currently focused item
70
+ * @param event - The keyboard event
71
+ * @returns true if the event was handled, false otherwise
72
+ */
73
+ handleKeydown(currentItem, event) {
74
+ const direction = typeof this.config.direction === 'function' ? this.config.direction() : this.config.direction;
75
+ const { key } = event;
76
+ // Determine if this key should be handled based on direction
77
+ const isVertical = key === 'ArrowUp' || key === 'ArrowDown';
78
+ const isHorizontal = key === 'ArrowLeft' || key === 'ArrowRight';
79
+ const isHome = key === 'Home';
80
+ const isEnd = key === 'End';
81
+ const shouldHandle = isHome ||
82
+ isEnd ||
83
+ (direction === 'both' && (isVertical || isHorizontal)) ||
84
+ (direction === 'vertical' && isVertical) ||
85
+ (direction === 'horizontal' && isHorizontal);
86
+ if (!shouldHandle) {
87
+ return false;
88
+ }
89
+ // Prevent default behavior (page scrolling)
90
+ event.preventDefault();
91
+ const items = this.config.getItems();
92
+ const currentIndex = items.indexOf(currentItem);
93
+ if (currentIndex === -1) {
94
+ return false;
95
+ }
96
+ let nextIndex = currentIndex;
97
+ // Handle Home/End keys
98
+ if (isHome) {
99
+ nextIndex = 0;
100
+ }
101
+ else if (isEnd) {
102
+ nextIndex = items.length - 1;
103
+ }
104
+ else {
105
+ // Handle arrow keys
106
+ const isNext = key === 'ArrowDown' || key === 'ArrowRight';
107
+ const isPrev = key === 'ArrowUp' || key === 'ArrowLeft';
108
+ if (isNext) {
109
+ nextIndex = this.getNextIndex(items, currentIndex, 1);
110
+ }
111
+ else if (isPrev) {
112
+ nextIndex = this.getNextIndex(items, currentIndex, -1);
113
+ }
114
+ }
115
+ // Skip disabled items — Home always searches forward, End always searches backward
116
+ // eslint-disable-next-line no-nested-ternary
117
+ const searchDirection = isHome ? 1 : isEnd ? -1 : nextIndex > currentIndex ? 1 : -1;
118
+ nextIndex = this.findNextValidIndex(items, nextIndex, searchDirection);
119
+ if (nextIndex !== -1 && nextIndex !== currentIndex) {
120
+ const nextItem = items[nextIndex];
121
+ // Update tabindices
122
+ this.updateTabindices(nextIndex);
123
+ // Focus the next item
124
+ nextItem.focus();
125
+ // Optionally select/activate the item.
126
+ // Select when `selectOnFocus` is enabled, or when Home/End keys
127
+ // were used and the consumer explicitly opted in via `selectOnHomeEnd`.
128
+ const shouldSelect = this.config.selectOnFocus === true || ((isHome || isEnd) && this.config.selectOnHomeEnd === true);
129
+ if (shouldSelect && this.config.onSelect) {
130
+ this.config.onSelect(nextItem, event);
131
+ }
132
+ return true;
133
+ }
134
+ return false;
135
+ }
136
+ /**
137
+ * Get the next index based on direction
138
+ */
139
+ getNextIndex(items, currentIndex, direction) {
140
+ const { wrap } = this.config;
141
+ let nextIndex = currentIndex + direction;
142
+ if (wrap) {
143
+ // Wrap around
144
+ if (nextIndex < 0) {
145
+ nextIndex = items.length - 1;
146
+ }
147
+ else if (nextIndex >= items.length) {
148
+ nextIndex = 0;
149
+ }
150
+ }
151
+ else {
152
+ // Clamp to bounds
153
+ nextIndex = Math.max(0, Math.min(items.length - 1, nextIndex));
154
+ }
155
+ return nextIndex;
156
+ }
157
+ /**
158
+ * Find the next valid (non-disabled) index
159
+ */
160
+ findNextValidIndex(items, startIndex, direction) {
161
+ const maxAttempts = items.length;
162
+ let attempts = 0;
163
+ let index = startIndex;
164
+ while (attempts < maxAttempts) {
165
+ if (!this.config.skipItem(items[index])) {
166
+ return index;
167
+ }
168
+ index = this.getNextIndex(items, index, direction);
169
+ attempts += 1;
170
+ }
171
+ // All items are disabled
172
+ return -1;
173
+ }
174
+ /**
175
+ * Set focus to a specific item
176
+ */
177
+ focusItem(item) {
178
+ const items = this.config.getItems();
179
+ const index = items.indexOf(item);
180
+ if (index !== -1) {
181
+ this.updateTabindices(index);
182
+ item.focus();
183
+ }
184
+ }
185
+ /**
186
+ * Set focus to the first non-disabled item
187
+ */
188
+ focusFirst() {
189
+ const items = this.config.getItems();
190
+ const firstValidIndex = this.findNextValidIndex(items, 0, 1);
191
+ if (firstValidIndex !== -1) {
192
+ this.focusItem(items[firstValidIndex]);
193
+ }
194
+ }
195
+ /**
196
+ * Set focus to the last non-disabled item
197
+ */
198
+ focusLast() {
199
+ const items = this.config.getItems();
200
+ const lastValidIndex = this.findNextValidIndex(items, items.length - 1, -1);
201
+ if (lastValidIndex !== -1) {
202
+ this.focusItem(items[lastValidIndex]);
203
+ }
204
+ }
205
+ }
206
+ //# sourceMappingURL=roving-tabindex-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roving-tabindex-controller.js","sourceRoot":"","sources":["../../../src/controllers/roving-tabindex-controller.ts"],"names":[],"mappings":"AA8CA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,wBAAwB;IAWnC,YAAY,IAA4B,EAAE,MAA+B;QACvE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG;YACZ,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,MAAM;YACjB,aAAa,EAAE,KAAK;YACpB,eAAe,EAAE,KAAK;YACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAK,IAAY,CAAC,QAAQ,KAAK,IAAI;YACpF,GAAG,MAAM;SACV,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,kDAAkD;IAClD,aAAa;QACX,yCAAyC;IAC3C,CAAC;IAED,kDAAkD;IAClD,gBAAgB;QACd,oBAAoB;IACtB,CAAC;IAED;;;OAGG;IACH,gBAAgB,CAAC,WAAoB;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO;QACT,C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AC,OAAO,CAAC,IAAI,CAAC,CAAC;QAElC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAC7B,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED;;OAEG;IACH,UAAU;QACR,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE7D,IAAI,eAAe,KAAK,CAAC,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED;;OAEG;IACH,SAAS;QACP,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAE5E,IAAI,cAAc,KAAK,CAAC,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;CACF","sourcesContent":["import { ReactiveController, ReactiveControllerHost } from 'lit';\n\nexport interface RovingTabindexConfig<T extends HTMLElement> {\n /**\n * Selector or function to get the items to manage\n */\n getItems: () => T[];\n\n /**\n * Callback when an item is selected/activated\n */\n onSelect?: (item: T, event: KeyboardEvent | PointerEvent | MouseEvent) => void;\n\n /**\n * Whether items wrap around (last -> first and vice versa)\n * @default true\n */\n wrap?: boolean;\n\n /**\n * Direction of navigation. Può essere una stringa statica o una funzione\n * che restituisce la direzione dinamicamente (utile quando la direzione\n * dipende dallo stato del componente, es. orientamento verticale/orizzontale).\n * @default 'both'\n */\n direction?: 'horizontal' | 'vertical' | 'both' | (() => 'horizontal' | 'vertical' | 'both');\n\n /**\n * Whether to select items on focus (vs just focusing)\n * @default false\n */\n selectOnFocus?: boolean;\n\n /**\n * Whether Home/End should *activate* (select) the item in addition to focusing it.\n * Default false to avoid changing downstream components; opt-in when needed.\n */\n selectOnHomeEnd?: boolean;\n\n /**\n * Custom logic to determine if an item should be skipped\n * @default (item) => item.hasAttribute('disabled')\n */\n skipItem?: (item: T) => boolean;\n}\n\n/**\n * Roving Tabindex Controller\n *\n * Implements the ARIA roving tabindex pattern for keyboard navigation.\n * See: https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex\n *\n * Usage:\n * ```ts\n * private rovingTabindex = new RovingTabindexController(this, {\n * getItems: () => Array.from(this.querySelectorAll('my-item')),\n * onSelect: (item) => this.selectItem(item),\n * });\n * ```\n */\nexport class RovingTabindexController<T extends HTMLElement> implements ReactiveController {\n private host: ReactiveControllerHost;\n\n private config: RovingTabindexConfig<T> & {\n wrap: boolean;\n direction: 'horizontal' | 'vertical' | 'both' | (() => 'horizontal' | 'vertical' | 'both');\n selectOnFocus: boolean;\n selectOnHomeEnd: boolean;\n skipItem: (item: T) => boolean;\n };\n\n constructor(host: ReactiveControllerHost, config: RovingTabindexConfig<T>) {\n this.host = host;\n this.config = {\n wrap: true,\n direction: 'both',\n selectOnFocus: false,\n selectOnHomeEnd: false,\n skipItem: (item) => item.hasAttribute('disabled') || (item as any).disabled === true,\n ...config,\n };\n host.addController(this);\n }\n\n // eslint-disable-next-line class-methods-use-this\n hostConnected(): void {\n // Controller is ready when host connects\n }\n\n // eslint-disable-next-line class-methods-use-this\n hostDisconnected(): void {\n // Cleanup if needed\n }\n\n /**\n * Update tabindex values for all items\n * @param activeIndex - Index of the item that should be tabbable (default: 0 or first non-disabled)\n */\n updateTabindices(activeIndex?: number): void {\n const items = this.config.getItems();\n if (!items || items.length === 0) {\n return;\n }\n\n // Find the active index\n let targetIndex = activeIndex ?? 0;\n\n // If no active index specified, use first non-disabled item\n if (activeIndex === undefined) {\n targetIndex = items.findIndex((item) => !this.config.skipItem(item));\n if (targetIndex === -1) {\n targetIndex = 0; // Fallback to first item if all disabled\n }\n }\n\n // Set tabindex for all items\n items.forEach((item, index) => {\n const itemElement = item;\n if (this.config.skipItem(itemElement)) {\n // eslint-disable-next-line no-param-reassign\n itemElement.tabIndex = -1;\n } else {\n // eslint-disable-next-line no-param-reassign\n itemElement.tabIndex = index === targetIndex ? 0 : -1;\n }\n });\n }\n\n /**\n * Handle keyboard navigation\n * @param currentItem - The currently focused item\n * @param event - The keyboard event\n * @returns true if the event was handled, false otherwise\n */\n handleKeydown(currentItem: T, event: KeyboardEvent): boolean {\n const direction = typeof this.config.direction === 'function' ? this.config.direction() : this.config.direction;\n const { key } = event;\n\n // Determine if this key should be handled based on direction\n const isVertical = key === 'ArrowUp' || key === 'ArrowDown';\n const isHorizontal = key === 'ArrowLeft' || key === 'ArrowRight';\n const isHome = key === 'Home';\n const isEnd = key === 'End';\n const shouldHandle =\n isHome ||\n isEnd ||\n (direction === 'both' && (isVertical || isHorizontal)) ||\n (direction === 'vertical' && isVertical) ||\n (direction === 'horizontal' && isHorizontal);\n\n if (!shouldHandle) {\n return false;\n }\n\n // Prevent default behavior (page scrolling)\n event.preventDefault();\n\n const items = this.config.getItems();\n const currentIndex = items.indexOf(currentItem);\n\n if (currentIndex === -1) {\n return false;\n }\n\n let nextIndex = currentIndex;\n\n // Handle Home/End keys\n if (isHome) {\n nextIndex = 0;\n } else if (isEnd) {\n nextIndex = items.length - 1;\n } else {\n // Handle arrow keys\n const isNext = key === 'ArrowDown' || key === 'ArrowRight';\n const isPrev = key === 'ArrowUp' || key === 'ArrowLeft';\n\n if (isNext) {\n nextIndex = this.getNextIndex(items, currentIndex, 1);\n } else if (isPrev) {\n nextIndex = this.getNextIndex(items, currentIndex, -1);\n }\n }\n\n // Skip disabled items — Home always searches forward, End always searches backward\n // eslint-disable-next-line no-nested-ternary\n const searchDirection: 1 | -1 = isHome ? 1 : isEnd ? -1 : nextIndex > currentIndex ? 1 : -1;\n nextIndex = this.findNextValidIndex(items, nextIndex, searchDirection);\n\n if (nextIndex !== -1 && nextIndex !== currentIndex) {\n const nextItem = items[nextIndex];\n\n // Update tabindices\n this.updateTabindices(nextIndex);\n\n // Focus the next item\n nextItem.focus();\n\n // Optionally select/activate the item.\n // Select when `selectOnFocus` is enabled, or when Home/End keys\n // were used and the consumer explicitly opted in via `selectOnHomeEnd`.\n const shouldSelect =\n this.config.selectOnFocus === true || ((isHome || isEnd) && this.config.selectOnHomeEnd === true);\n\n if (shouldSelect && this.config.onSelect) {\n this.config.onSelect(nextItem, event);\n }\n\n return true;\n }\n\n return false;\n }\n\n /**\n * Get the next index based on direction\n */\n private getNextIndex(items: T[], currentIndex: number, direction: 1 | -1): number {\n const { wrap } = this.config;\n let nextIndex = currentIndex + direction;\n\n if (wrap) {\n // Wrap around\n if (nextIndex < 0) {\n nextIndex = items.length - 1;\n } else if (nextIndex >= items.length) {\n nextIndex = 0;\n }\n } else {\n // Clamp to bounds\n nextIndex = Math.max(0, Math.min(items.length - 1, nextIndex));\n }\n\n return nextIndex;\n }\n\n /**\n * Find the next valid (non-disabled) index\n */\n private findNextValidIndex(items: T[], startIndex: number, direction: 1 | -1): number {\n const maxAttempts = items.length;\n let attempts = 0;\n let index = startIndex;\n\n while (attempts < maxAttempts) {\n if (!this.config.skipItem(items[index])) {\n return index;\n }\n\n index = this.getNextIndex(items, index, direction);\n attempts += 1;\n }\n\n // All items are disabled\n return -1;\n }\n\n /**\n * Set focus to a specific item\n */\n focusItem(item: T): void {\n const items = this.config.getItems();\n const index = items.indexOf(item);\n\n if (index !== -1) {\n this.updateTabindices(index);\n item.focus();\n }\n }\n\n /**\n * Set focus to the first non-disabled item\n */\n focusFirst(): void {\n const items = this.config.getItems();\n const firstValidIndex = this.findNextValidIndex(items, 0, 1);\n\n if (firstValidIndex !== -1) {\n this.focusItem(items[firstValidIndex]);\n }\n }\n\n /**\n * Set focus to the last non-disabled item\n */\n focusLast(): void {\n const items = this.config.getItems();\n const lastValidIndex = this.findNextValidIndex(items, items.length - 1, -1);\n\n if (lastValidIndex !== -1) {\n this.focusItem(items[lastValidIndex]);\n }\n }\n}\n"]}
@@ -0,0 +1,61 @@
1
+ import { BaseLocalizedComponent } from '../base-component/base-component.js';
2
+ import { FormControlController } from './form-controller.js';
3
+ export declare class FormControl extends BaseLocalizedComponent {
4
+ protected readonly formControlController: FormControlController;
5
+ _touched: boolean;
6
+ inputElement: HTMLInputElement;
7
+ /** The name of the input, submitted as a name/value pair with form data. */
8
+ name: string;
9
+ /** The current value of the input, submitted as a name/value pair with form data. */
10
+ value: string;
11
+ /** If the input is disabled. */
12
+ disabled: boolean;
13
+ /**
14
+ * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you
15
+ * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in
16
+ * the same document or shadow root for this to work.
17
+ */
18
+ form: string;
19
+ /** If you implement your custom validation and you won't to trigger default validation */
20
+ customValidation: boolean;
21
+ /** If your input is invalid from your custom validition, set this attribute with message validation */
22
+ validationText: string;
23
+ /** Pattern the `value` must match to be valid */
24
+ pattern?: string;
25
+ /** The input's minimum value. Only applies to date and number input types. */
26
+ min: number | string | Date | undefined;
27
+ /** The input's maximum value. Only applies to date and number input types. */
28
+ max: number | string | Date | undefined;
29
+ /**
30
+ * Specifies the granularity that the value must adhere to, or the special value `any` which means no stepping is
31
+ * implied, allowing any numeric value. Only applies to date and number input types.
32
+ */
33
+ step: number | 'any';
34
+ /** The input's minimum length. */
35
+ minlength: number;
36
+ /** The input's maximum length. */
37
+ maxlength: number;
38
+ /** If the input is required. */
39
+ required: boolean;
40
+ protected isInGroup: boolean;
41
+ /** Gets the validity state object */
42
+ get validity(): ValidityState;
43
+ validationMessage: string;
44
+ /** Gets the associated form, if one exists. */
45
+ getForm(): HTMLFormElement | null;
46
+ checkValidity(): boolean;
47
+ /** Checks for validity and shows the browser's validation message if the control is invalid. */
48
+ reportValidity(): boolean;
49
+ /** Sets a custom validation message. Pass an empty string to restore validity. */
50
+ setCustomValidity(message: string): void;
51
+ protected _handleReady(): void;
52
+ protected _handleInput(e: Event): void;
53
+ protected _handleBlur(e: Event): void;
54
+ protected _handleFocus(e: Event): void;
55
+ protected _handleClick(e: Event): void;
56
+ protected handleValidationMessages(): void;
57
+ protected _handleInvalid(event: Event): void;
58
+ protected _handleChange(e: Event): void;
59
+ updated(changedProperties: Map<string | number | symbol, unknown>): void;
60
+ }
61
+ //# sourceMappingURL=form-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-control.d.ts","sourceRoot":"","sources":["../../../src/form/form-control.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,qBAAa,WAAY,SAAQ,sBAAsB;IACrD,SAAS,CAAC,QAAQ,CAAC,qBAAqB,wBAErC;IASH,QAAQ,UAAS;IAGjB,YAAY,EAAG,gBAAgB,CAAC;IAEhC,4EAA4E;IAE5E,IAAI,SAAM;IAEV,qFAAqF;IAErF,KAAK,SAAM;IAEX,gCAAgC;IAEhC,QAAQ,UAAS;IAEjB;;;;OAIG;IACwC,IAAI,SAAM;IAErD,0FAA0F;IAE1F,gBAAgB,UAAS;IAEzB,uGAAuG;IAEvG,cAAc,EAAE,MAAM,CAAM;IAE5B,iDAAiD;IAEjD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8EAA8E;IAE9E,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAExC,8EAA8E;IAE9E,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAExC;;;OAGG;IAEH,IAAI,EAAE,MAAM,GAAG,KAAK,CAAS;IAE7B,kCAAkC;IA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