@gov-design-system-ce/components 4.0.8-rc06 → 4.0.8-rc07

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 (66) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +17 -8
  3. package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +35 -9
  7. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
  8. package/dist/components/gov-accordion-item.js +1 -1
  9. package/dist/components/gov-attachments-item.js +1 -1
  10. package/dist/components/gov-breadcrumbs.js +1 -1
  11. package/dist/components/gov-button.js +1 -1
  12. package/dist/components/gov-card.js +1 -1
  13. package/dist/components/gov-chip.js +1 -1
  14. package/dist/components/gov-form-autocomplete.js +1 -1
  15. package/dist/components/gov-form-checkbox.js +1 -1
  16. package/dist/components/gov-form-file.js +1 -1
  17. package/dist/components/gov-form-input.js +1 -1
  18. package/dist/components/gov-form-multi-select.js +1 -1
  19. package/dist/components/gov-form-select.js +1 -1
  20. package/dist/components/gov-icon.js +1 -1
  21. package/dist/components/gov-infobar.js +1 -1
  22. package/dist/components/gov-loading.js +1 -1
  23. package/dist/components/gov-modal.js +1 -1
  24. package/dist/components/gov-pagination.js +1 -1
  25. package/dist/components/gov-prompt.js +1 -1
  26. package/dist/components/gov-side-nav-item.js +1 -1
  27. package/dist/components/gov-tabs.js +1 -1
  28. package/dist/components/gov-tag.js +1 -1
  29. package/dist/components/gov-toast.js +1 -1
  30. package/dist/components/gov-tooltip-content.js +1 -1
  31. package/dist/components/gov-wizard-item.js +1 -1
  32. package/dist/components/p-3d7d9d2e.js +2 -0
  33. package/dist/components/p-3d7d9d2e.js.map +1 -0
  34. package/dist/components/{p-245d3ff5.js → p-3e9f24b6.js} +2 -2
  35. package/dist/components/{p-d3271ba4.js → p-754d36f5.js} +2 -2
  36. package/dist/components/{p-7677b93a.js → p-7e260ed7.js} +2 -2
  37. package/dist/components/{p-5a96fe7a.js → p-d65d3380.js} +2 -2
  38. package/dist/components/{p-98464833.js → p-eb4223bd.js} +2 -2
  39. package/dist/components/{p-281b05f0.js → p-fe8d183d.js} +2 -2
  40. package/dist/core/core.esm.js +1 -1
  41. package/dist/core/core.esm.js.map +1 -1
  42. package/dist/core/{p-2254b2ef.entry.js → p-467bf15a.entry.js} +2 -2
  43. package/dist/core/p-542ce647.entry.js +2 -0
  44. package/dist/core/p-542ce647.entry.js.map +1 -0
  45. package/dist/esm/core.js +1 -1
  46. package/dist/esm/gov-form-autocomplete.entry.js +17 -8
  47. package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
  48. package/dist/esm/gov-icon.entry.js +1 -1
  49. package/dist/esm/loader.js +1 -1
  50. package/dist/hydrate/index.js +18 -8
  51. package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +6 -1
  52. package/dist/types/components.d.ts +5 -1
  53. package/package.json +1 -1
  54. package/dist/components/p-86a37e8c.js +0 -2
  55. package/dist/components/p-86a37e8c.js.map +0 -1
  56. package/dist/core/p-cdd77b6c.entry.js +0 -2
  57. package/dist/core/p-cdd77b6c.entry.js.map +0 -1
  58. package/dist/globals.d.ts +0 -2
  59. package/dist/types/types/typings.d.ts +0 -6
  60. /package/dist/components/{p-245d3ff5.js.map → p-3e9f24b6.js.map} +0 -0
  61. /package/dist/components/{p-d3271ba4.js.map → p-754d36f5.js.map} +0 -0
  62. /package/dist/components/{p-7677b93a.js.map → p-7e260ed7.js.map} +0 -0
  63. /package/dist/components/{p-5a96fe7a.js.map → p-d65d3380.js.map} +0 -0
  64. /package/dist/components/{p-98464833.js.map → p-eb4223bd.js.map} +0 -0
  65. /package/dist/components/{p-281b05f0.js.map → p-fe8d183d.js.map} +0 -0
  66. /package/dist/core/{p-2254b2ef.entry.js.map → p-467bf15a.entry.js.map} +0 -0
@@ -3,7 +3,7 @@ export { s as setNonce } from './index-eb59f132.js';
3
3
 
4
4
  const defineCustomElements = (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
- return bootstrapLazy(JSON.parse("[[\"gov-form-file\",[[4,\"gov-form-file\",{\"expanded\":[4],\"required\":[4],\"disabled\":[4],\"resetAfterPick\":[4,\"reset-after-pick\"],\"ignoreFileDuplicationCheck\":[4,\"ignore-file-duplication-check\"],\"displayAttachments\":[4,\"display-attachments\"],\"name\":[1],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"identifier\":[1],\"invalid\":[4],\"errorSize\":[1,\"error-size\"],\"errorAccept\":[1,\"error-accept\"],\"attachmentsLabel\":[1,\"attachments-label\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagRemoveLabel\":[1,\"wcag-remove-label\"],\"wcagAttachmentsLabel\":[1,\"wcag-attachments-label\"],\"files\":[32],\"getRef\":[64],\"getAreaRef\":[64],\"reset\":[64],\"validateWcag\":[64]}]]],[\"gov-form-multi-select\",[[4,\"gov-form-multi-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"placeholder\":[1],\"variant\":[1],\"size\":[1],\"name\":[1],\"hideSelectedList\":[4,\"hide-selected-list\"],\"required\":[4],\"disabled\":[4],\"invalid\":[4],\"success\":[4],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"valueState\":[32],\"selectedOptionsState\":[32],\"optionsState\":[32],\"setFocus\":[64],\"setValue\":[64],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-modal\",[[4,\"gov-modal\",{\"open\":[1028],\"blockClose\":[4,\"block-close\"],\"label\":[1],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagCloseLabelledBy\":[1,\"wcag-close-labelled-by\"],\"show\":[64],\"hide\":[64],\"validateWcag\":[64]}]]],[\"gov-pagination\",[[0,\"gov-pagination\",{\"type\":[1],\"current\":[2],\"total\":[2],\"inverse\":[4],\"size\":[1],\"variant\":[1],\"pageSize\":[2,\"page-size\"],\"maxPages\":[2,\"max-pages\"],\"link\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagSelectLabel\":[1,\"wcag-select-label\"],\"wcagPageLabel\":[1,\"wcag-page-label\"],\"labelPrev\":[1,\"label-prev\"],\"labelStart\":[1,\"label-start\"],\"labelNext\":[1,\"label-next\"],\"labelEnd\":[1,\"label-end\"],\"pagination\":[32],\"validateWcag\":[64]}]]],[\"gov-prompt\",[[4,\"gov-prompt\",{\"open\":[1028],\"label\":[1],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagCloseLabelledBy\":[1,\"wcag-close-labelled-by\"],\"show\":[64],\"hide\":[64],\"validateWcag\":[64]}]]],[\"gov-tabs\",[[4,\"gov-tabs\",{\"type\":[1],\"variant\":[1],\"orientation\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagSelectLabel\":[1,\"wcag-select-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"controller\":[32],\"focusIndex\":[32],\"compactControls\":[32],\"refresh\":[64],\"currentTab\":[64],\"setActiveTab\":[64],\"validateWcag\":[64]}]]],[\"gov-breadcrumbs\",[[4,\"gov-breadcrumbs\",{\"collapsible\":[4],\"isExpanded\":[4,\"is-expanded\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labeled-by\"],\"wcagToggleLabel\":[1,\"wcag-toggle-label\"],\"collapsed\":[32],\"toggleOption\":[32],\"validateWcag\":[64]}]]],[\"gov-infobar\",[[4,\"gov-infobar\",{\"headline\":[1],\"variant\":[1],\"role\":[1],\"inverse\":[4],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagToggleLabel\":[1,\"wcag-toggle-label\"],\"closable\":[4],\"toggleContent\":[32],\"validateWcag\":[64]}]]],[\"gov-loading\",[[4,\"gov-loading\"]]],[\"gov-side-nav-item\",[[4,\"gov-side-nav-item\",{\"inverse\":[4],\"compact\":[4],\"identifier\":[1],\"count\":[4],\"label\":[1],\"disabled\":[4],\"href\":[1],\"isExpanded\":[4,\"is-expanded\"],\"isExpandedState\":[32],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]}]]],[\"gov-toast\",[[4,\"gov-toast\",{\"variant\":[1],\"gravity\":[1],\"position\":[1],\"type\":[1],\"time\":[2],\"closeLabel\":[1,\"close-label\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"destroy\":[64]}]]],[\"gov-tooltip-content\",[[4,\"gov-tooltip-content\",{\"variant\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"]}]]],[\"gov-accordion-item\",[[4,\"gov-accordion-item\",{\"variant\":[1],\"identifier\":[1],\"size\":[1],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"isExpandedState\":[32],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]}]]],[\"gov-card\",[[4,\"gov-card\",{\"promotion\":[4],\"label\":[1],\"collapsible\":[4],\"expanded\":[4],\"headlineTag\":[1,\"headline-tag\"],\"wcagTriggerLabel\":[1,\"wcag-trigger-label\"],\"wcagTriggerLabelledBy\":[1,\"wcag-trigger-labelled-by\"],\"isExpanded\":[32],\"open\":[64],\"close\":[64],\"validateWcag\":[64]}]]],[\"gov-form-checkbox\",[[4,\"gov-form-checkbox\",{\"value\":[1],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"noLabel\":[4,\"no-label\"],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-tag\",[[4,\"gov-tag\",{\"inverse\":[4],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"size\":[513],\"variant\":[513]}]]],[\"gov-wizard-item\",[[4,\"gov-wizard-item\",{\"variant\":[1],\"size\":[1],\"identifier\":[1],\"collapsible\":[4],\"annotation\":[1],\"label\":[1],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"labelTag\":[1,\"label-tag\"],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]}]]],[\"gov-accordion\",[[4,\"gov-accordion\",{\"size\":[1],\"variant\":[1],\"noBorder\":[4,\"no-border\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-container\",[[4,\"gov-container\",{\"slottedChildren\":[64]}]]],[\"gov-control-group\",[[4,\"gov-control-group\",{\"variant\":[1],\"noBorder\":[4,\"no-border\"]}]]],[\"gov-cookiebar\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown\",[[4,\"gov-dropdown\",{\"open\":[1028],\"position\":[1],\"getState\":[64],\"setOpen\":[64]}]]],[\"gov-empty\",[[4,\"gov-empty\"]]],[\"gov-error-code\",[[4,\"gov-error-code\"]]],[\"gov-form-checkbox-group\",[[4,\"gov-form-checkbox-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]}]]],[\"gov-form-control\",[[4,\"gov-form-control\",{\"gap\":[1],\"identifier\":[1],\"invalid\":[4],\"disabled\":[4],\"success\":[4],\"fieldset\":[4],\"size\":[1]}]]],[\"gov-form-group\",[[4,\"gov-form-group\",{\"gap\":[1],\"orientation\":[1]}]]],[\"gov-form-label\",[[4,\"gov-form-label\",{\"identifier\":[1],\"size\":[1],\"required\":[4],\"legend\":[4]}]]],[\"gov-form-password-power\",[[4,\"gov-form-password-power\",{\"power\":[514]}]]],[\"gov-form-radio\",[[4,\"gov-form-radio\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-form-radio-group\",[[4,\"gov-form-radio-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]}]]],[\"gov-form-search\",[[4,\"gov-form-search\",{\"variant\":[513]}]]],[\"gov-form-switch\",[[4,\"gov-form-switch\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-grid\",[[4,\"gov-grid\",{\"alignX\":[1,\"align-x\"],\"alignY\":[1,\"align-y\"]}]]],[\"gov-grid-item\",[[4,\"gov-grid-item\",{\"size\":[1],\"sizeSm\":[1,\"size-sm\"],\"sizeMd\":[1,\"size-md\"],\"sizeLg\":[1,\"size-lg\"],\"sizeXl\":[1,\"size-xl\"]}]]],[\"gov-layout\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column\",[[4,\"gov-layout-column\"]]],[\"gov-message\",[[4,\"gov-message\",{\"variant\":[1]}]]],[\"gov-nav\",[[4,\"gov-nav\",{\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-nav-item\",[[4,\"gov-nav-item\",{\"href\":[1],\"isExpandedState\":[32]}]]],[\"gov-side-nav\",[[4,\"gov-side-nav\",{\"inverse\":[4],\"compact\":[4],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-skeleton\",[[0,\"gov-skeleton\",{\"variant\":[1],\"count\":[2],\"shape\":[1],\"width\":[1],\"height\":[1],\"animation\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}]]],[\"gov-spacer\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]}]]],[\"gov-statsbar\",[[4,\"gov-statsbar\",{\"iconPosition\":[1,\"icon-position\"],\"variant\":[1]}]]],[\"gov-statsbar-item\",[[4,\"gov-statsbar-item\",{\"iconPosition\":[1,\"icon-position\"]}]]],[\"gov-stepper\",[[4,\"gov-stepper\",{\"size\":[1]}]]],[\"gov-stepper-item\",[[4,\"gov-stepper-item\",{\"variant\":[1],\"size\":[1],\"identifier\":[1],\"label\":[1],\"annotation\":[1],\"triggerTag\":[1,\"trigger-tag\"],\"isExpandedState\":[32],\"currentState\":[64]}]]],[\"gov-tabs-item\",[[4,\"gov-tabs-item\",{\"identifier\":[1],\"triggerIdentifier\":[1,\"trigger-identifier\"],\"label\":[513],\"default\":[4],\"isActive\":[32],\"getIdentifier\":[64],\"getTriggerIdentifier\":[64],\"setActiveStatus\":[64]}]]],[\"gov-tile\",[[4,\"gov-tile\",{\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-tiles\",[[4,\"gov-tiles\",{\"columns\":[2],\"noBorder\":[4,\"no-border\"]}]]],[\"gov-tooltip\",[[4,\"gov-tooltip\",{\"variant\":[1],\"size\":[1],\"position\":[1025],\"message\":[1],\"identifier\":[1],\"icon\":[516],\"persist\":[32],\"show\":[64],\"hide\":[64]}]]],[\"gov-wizard\",[[4,\"gov-wizard\",{\"size\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-icon\",[[0,\"gov-icon\",{\"name\":[1],\"type\":[1],\"iconData\":[32],\"visible\":[32],\"error\":[32]}]]],[\"gov-form-input\",[[4,\"gov-form-input\",{\"value\":[1537],\"identifier\":[1],\"variant\":[1],\"success\":[4],\"size\":[1],\"name\":[1],\"multiline\":[4],\"rows\":[2],\"cols\":[2],\"required\":[4],\"disabled\":[4],\"placeholder\":[1],\"readonly\":[4],\"minlength\":[2],\"maxlength\":[2],\"min\":[8],\"max\":[8],\"autocomplete\":[4],\"autocorrect\":[4],\"type\":[1],\"inputType\":[1,\"input-type\"],\"role\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"wcagAutocomplete\":[1,\"wcag-autocomplete\"],\"wcagExpanded\":[4,\"wcag-expanded\"],\"focused\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-form-autocomplete\",[[4,\"gov-form-autocomplete\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"variant\":[1],\"success\":[4],\"size\":[1],\"nameKey\":[1,\"name-key\"],\"name\":[1],\"required\":[4],\"disabled\":[4],\"placeholder\":[1],\"readonly\":[4],\"invalid\":[4],\"minlength\":[2],\"maxlength\":[2],\"throttleTime\":[2,\"throttle-time\"],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"processing\":[32],\"arrowCounter\":[32],\"list\":[32],\"setFocus\":[64],\"setOptions\":[64],\"clearValue\":[64],\"setProcessing\":[64],\"setSearchCallback\":[64],\"setTemplateResolver\":[64]}]]],[\"gov-chip\",[[4,\"gov-chip\",{\"inverse\":[4],\"disabled\":[4],\"href\":[1],\"target\":[1],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"size\":[1],\"tag\":[1],\"variant\":[1],\"focusable\":[4],\"identifier\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagSelected\":[4,\"wcag-selected\"],\"getTriggerRef\":[64],\"getTriggerIdentifier\":[64],\"setFocus\":[64]}]]],[\"gov-form-select\",[[4,\"gov-form-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"variant\":[1],\"size\":[1],\"name\":[1],\"required\":[4],\"success\":[4],\"disabled\":[4],\"invalid\":[4],\"wcagActiveDescendant\":[1,\"wcag-active-descendant\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"optionsState\":[32],\"setFocus\":[64],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-attachments_3\",[[4,\"gov-attachments-item\",{\"wcagRemoveLabel\":[1,\"wcag-remove-label\"],\"wcagRemoveLabelledBy\":[1,\"wcag-remove-labelled-by\"],\"validateWcag\":[64]}],[4,\"gov-attachments\",{\"label\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}],[4,\"gov-form-message\",{\"variant\":[1],\"identifier\":[64]}]]],[\"gov-backdrop\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-button\",[[4,\"gov-button\",{\"variant\":[513],\"size\":[513],\"type\":[513],\"expanded\":[516],\"inverse\":[516],\"name\":[1],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"disabled\":[516],\"nativeType\":[1,\"native-type\"],\"href\":[1],\"target\":[1],\"download\":[4],\"hreflang\":[1],\"referrerpolicy\":[1],\"rel\":[1],\"loading\":[1],\"focusable\":[4],\"identifier\":[1],\"wcagActiveDescendant\":[1,\"wcag-active-descendant\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagDescription\":[1,\"wcag-description\"],\"wcagDetails\":[1,\"wcag-details\"],\"wcagExpanded\":[4,\"wcag-expanded\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"wcagHasPopup\":[1,\"wcag-has-popup\"],\"wcagPressed\":[4,\"wcag-pressed\"],\"wcagCurrent\":[1,\"wcag-current\"],\"setFocus\":[64],\"getTriggerRef\":[64],\"validateWcag\":[64]}]]]]"), options);
6
+ return bootstrapLazy(JSON.parse("[[\"gov-form-file\",[[4,\"gov-form-file\",{\"expanded\":[4],\"required\":[4],\"disabled\":[4],\"resetAfterPick\":[4,\"reset-after-pick\"],\"ignoreFileDuplicationCheck\":[4,\"ignore-file-duplication-check\"],\"displayAttachments\":[4,\"display-attachments\"],\"name\":[1],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"identifier\":[1],\"invalid\":[4],\"errorSize\":[1,\"error-size\"],\"errorAccept\":[1,\"error-accept\"],\"attachmentsLabel\":[1,\"attachments-label\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagRemoveLabel\":[1,\"wcag-remove-label\"],\"wcagAttachmentsLabel\":[1,\"wcag-attachments-label\"],\"files\":[32],\"getRef\":[64],\"getAreaRef\":[64],\"reset\":[64],\"validateWcag\":[64]}]]],[\"gov-form-multi-select\",[[4,\"gov-form-multi-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"placeholder\":[1],\"variant\":[1],\"size\":[1],\"name\":[1],\"hideSelectedList\":[4,\"hide-selected-list\"],\"required\":[4],\"disabled\":[4],\"invalid\":[4],\"success\":[4],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"valueState\":[32],\"selectedOptionsState\":[32],\"optionsState\":[32],\"setFocus\":[64],\"setValue\":[64],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-modal\",[[4,\"gov-modal\",{\"open\":[1028],\"blockClose\":[4,\"block-close\"],\"label\":[1],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagCloseLabelledBy\":[1,\"wcag-close-labelled-by\"],\"show\":[64],\"hide\":[64],\"validateWcag\":[64]}]]],[\"gov-pagination\",[[0,\"gov-pagination\",{\"type\":[1],\"current\":[2],\"total\":[2],\"inverse\":[4],\"size\":[1],\"variant\":[1],\"pageSize\":[2,\"page-size\"],\"maxPages\":[2,\"max-pages\"],\"link\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagSelectLabel\":[1,\"wcag-select-label\"],\"wcagPageLabel\":[1,\"wcag-page-label\"],\"labelPrev\":[1,\"label-prev\"],\"labelStart\":[1,\"label-start\"],\"labelNext\":[1,\"label-next\"],\"labelEnd\":[1,\"label-end\"],\"pagination\":[32],\"validateWcag\":[64]}]]],[\"gov-prompt\",[[4,\"gov-prompt\",{\"open\":[1028],\"label\":[1],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagCloseLabelledBy\":[1,\"wcag-close-labelled-by\"],\"show\":[64],\"hide\":[64],\"validateWcag\":[64]}]]],[\"gov-tabs\",[[4,\"gov-tabs\",{\"type\":[1],\"variant\":[1],\"orientation\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagSelectLabel\":[1,\"wcag-select-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"controller\":[32],\"focusIndex\":[32],\"compactControls\":[32],\"refresh\":[64],\"currentTab\":[64],\"setActiveTab\":[64],\"validateWcag\":[64]}]]],[\"gov-breadcrumbs\",[[4,\"gov-breadcrumbs\",{\"collapsible\":[4],\"isExpanded\":[4,\"is-expanded\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labeled-by\"],\"wcagToggleLabel\":[1,\"wcag-toggle-label\"],\"collapsed\":[32],\"toggleOption\":[32],\"validateWcag\":[64]}]]],[\"gov-infobar\",[[4,\"gov-infobar\",{\"headline\":[1],\"variant\":[1],\"role\":[1],\"inverse\":[4],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"wcagToggleLabel\":[1,\"wcag-toggle-label\"],\"closable\":[4],\"toggleContent\":[32],\"validateWcag\":[64]}]]],[\"gov-loading\",[[4,\"gov-loading\"]]],[\"gov-side-nav-item\",[[4,\"gov-side-nav-item\",{\"inverse\":[4],\"compact\":[4],\"identifier\":[1],\"count\":[4],\"label\":[1],\"disabled\":[4],\"href\":[1],\"isExpanded\":[4,\"is-expanded\"],\"isExpandedState\":[32],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]}]]],[\"gov-toast\",[[4,\"gov-toast\",{\"variant\":[1],\"gravity\":[1],\"position\":[1],\"type\":[1],\"time\":[2],\"closeLabel\":[1,\"close-label\"],\"wcagCloseLabel\":[1,\"wcag-close-label\"],\"destroy\":[64]}]]],[\"gov-tooltip-content\",[[4,\"gov-tooltip-content\",{\"variant\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"]}]]],[\"gov-accordion-item\",[[4,\"gov-accordion-item\",{\"variant\":[1],\"identifier\":[1],\"size\":[1],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"isExpandedState\":[32],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]}]]],[\"gov-card\",[[4,\"gov-card\",{\"promotion\":[4],\"label\":[1],\"collapsible\":[4],\"expanded\":[4],\"headlineTag\":[1,\"headline-tag\"],\"wcagTriggerLabel\":[1,\"wcag-trigger-label\"],\"wcagTriggerLabelledBy\":[1,\"wcag-trigger-labelled-by\"],\"isExpanded\":[32],\"open\":[64],\"close\":[64],\"validateWcag\":[64]}]]],[\"gov-form-checkbox\",[[4,\"gov-form-checkbox\",{\"value\":[1],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"noLabel\":[4,\"no-label\"],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-tag\",[[4,\"gov-tag\",{\"inverse\":[4],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"size\":[513],\"variant\":[513]}]]],[\"gov-wizard-item\",[[4,\"gov-wizard-item\",{\"variant\":[1],\"size\":[1],\"identifier\":[1],\"collapsible\":[4],\"annotation\":[1],\"label\":[1],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"labelTag\":[1,\"label-tag\"],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]}]]],[\"gov-accordion\",[[4,\"gov-accordion\",{\"size\":[1],\"variant\":[1],\"noBorder\":[4,\"no-border\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-container\",[[4,\"gov-container\",{\"slottedChildren\":[64]}]]],[\"gov-control-group\",[[4,\"gov-control-group\",{\"variant\":[1],\"noBorder\":[4,\"no-border\"]}]]],[\"gov-cookiebar\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown\",[[4,\"gov-dropdown\",{\"open\":[1028],\"position\":[1],\"getState\":[64],\"setOpen\":[64]}]]],[\"gov-empty\",[[4,\"gov-empty\"]]],[\"gov-error-code\",[[4,\"gov-error-code\"]]],[\"gov-form-checkbox-group\",[[4,\"gov-form-checkbox-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]}]]],[\"gov-form-control\",[[4,\"gov-form-control\",{\"gap\":[1],\"identifier\":[1],\"invalid\":[4],\"disabled\":[4],\"success\":[4],\"fieldset\":[4],\"size\":[1]}]]],[\"gov-form-group\",[[4,\"gov-form-group\",{\"gap\":[1],\"orientation\":[1]}]]],[\"gov-form-label\",[[4,\"gov-form-label\",{\"identifier\":[1],\"size\":[1],\"required\":[4],\"legend\":[4]}]]],[\"gov-form-password-power\",[[4,\"gov-form-password-power\",{\"power\":[514]}]]],[\"gov-form-radio\",[[4,\"gov-form-radio\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-form-radio-group\",[[4,\"gov-form-radio-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]}]]],[\"gov-form-search\",[[4,\"gov-form-search\",{\"variant\":[513]}]]],[\"gov-form-switch\",[[4,\"gov-form-switch\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[4],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-grid\",[[4,\"gov-grid\",{\"alignX\":[1,\"align-x\"],\"alignY\":[1,\"align-y\"]}]]],[\"gov-grid-item\",[[4,\"gov-grid-item\",{\"size\":[1],\"sizeSm\":[1,\"size-sm\"],\"sizeMd\":[1,\"size-md\"],\"sizeLg\":[1,\"size-lg\"],\"sizeXl\":[1,\"size-xl\"]}]]],[\"gov-layout\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column\",[[4,\"gov-layout-column\"]]],[\"gov-message\",[[4,\"gov-message\",{\"variant\":[1]}]]],[\"gov-nav\",[[4,\"gov-nav\",{\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-nav-item\",[[4,\"gov-nav-item\",{\"href\":[1],\"isExpandedState\":[32]}]]],[\"gov-side-nav\",[[4,\"gov-side-nav\",{\"inverse\":[4],\"compact\":[4],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-skeleton\",[[0,\"gov-skeleton\",{\"variant\":[1],\"count\":[2],\"shape\":[1],\"width\":[1],\"height\":[1],\"animation\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}]]],[\"gov-spacer\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]}]]],[\"gov-statsbar\",[[4,\"gov-statsbar\",{\"iconPosition\":[1,\"icon-position\"],\"variant\":[1]}]]],[\"gov-statsbar-item\",[[4,\"gov-statsbar-item\",{\"iconPosition\":[1,\"icon-position\"]}]]],[\"gov-stepper\",[[4,\"gov-stepper\",{\"size\":[1]}]]],[\"gov-stepper-item\",[[4,\"gov-stepper-item\",{\"variant\":[1],\"size\":[1],\"identifier\":[1],\"label\":[1],\"annotation\":[1],\"triggerTag\":[1,\"trigger-tag\"],\"isExpandedState\":[32],\"currentState\":[64]}]]],[\"gov-tabs-item\",[[4,\"gov-tabs-item\",{\"identifier\":[1],\"triggerIdentifier\":[1,\"trigger-identifier\"],\"label\":[513],\"default\":[4],\"isActive\":[32],\"getIdentifier\":[64],\"getTriggerIdentifier\":[64],\"setActiveStatus\":[64]}]]],[\"gov-tile\",[[4,\"gov-tile\",{\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-tiles\",[[4,\"gov-tiles\",{\"columns\":[2],\"noBorder\":[4,\"no-border\"]}]]],[\"gov-tooltip\",[[4,\"gov-tooltip\",{\"variant\":[1],\"size\":[1],\"position\":[1025],\"message\":[1],\"identifier\":[1],\"icon\":[516],\"persist\":[32],\"show\":[64],\"hide\":[64]}]]],[\"gov-wizard\",[[4,\"gov-wizard\",{\"size\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-icon\",[[0,\"gov-icon\",{\"name\":[1],\"type\":[1],\"iconData\":[32],\"visible\":[32],\"error\":[32]}]]],[\"gov-form-input\",[[4,\"gov-form-input\",{\"value\":[1537],\"identifier\":[1],\"variant\":[1],\"success\":[4],\"size\":[1],\"name\":[1],\"multiline\":[4],\"rows\":[2],\"cols\":[2],\"required\":[4],\"disabled\":[4],\"placeholder\":[1],\"readonly\":[4],\"minlength\":[2],\"maxlength\":[2],\"min\":[8],\"max\":[8],\"autocomplete\":[4],\"autocorrect\":[4],\"type\":[1],\"inputType\":[1,\"input-type\"],\"role\":[1],\"invalid\":[4],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"wcagAutocomplete\":[1,\"wcag-autocomplete\"],\"wcagExpanded\":[4,\"wcag-expanded\"],\"focused\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-form-autocomplete\",[[4,\"gov-form-autocomplete\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"variant\":[1],\"success\":[4],\"size\":[1],\"nameKey\":[1,\"name-key\"],\"name\":[1],\"required\":[4],\"disabled\":[4],\"placeholder\":[1],\"readonly\":[4],\"invalid\":[4],\"minlength\":[2],\"maxlength\":[2],\"throttleTime\":[2,\"throttle-time\"],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"processing\":[32],\"arrowCounter\":[32],\"list\":[32],\"setFocus\":[64],\"setBlur\":[64],\"setOptions\":[64],\"clearValue\":[64],\"setProcessing\":[64],\"setSearchCallback\":[64],\"setTemplateResolver\":[64]}]]],[\"gov-chip\",[[4,\"gov-chip\",{\"inverse\":[4],\"disabled\":[4],\"href\":[1],\"target\":[1],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"size\":[1],\"tag\":[1],\"variant\":[1],\"focusable\":[4],\"identifier\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagSelected\":[4,\"wcag-selected\"],\"getTriggerRef\":[64],\"getTriggerIdentifier\":[64],\"setFocus\":[64]}]]],[\"gov-form-select\",[[4,\"gov-form-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"variant\":[1],\"size\":[1],\"name\":[1],\"required\":[4],\"success\":[4],\"disabled\":[4],\"invalid\":[4],\"wcagActiveDescendant\":[1,\"wcag-active-descendant\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"focused\":[32],\"optionsState\":[32],\"setFocus\":[64],\"getRef\":[64],\"validateWcag\":[64]}]]],[\"gov-attachments_3\",[[4,\"gov-attachments-item\",{\"wcagRemoveLabel\":[1,\"wcag-remove-label\"],\"wcagRemoveLabelledBy\":[1,\"wcag-remove-labelled-by\"],\"validateWcag\":[64]}],[4,\"gov-attachments\",{\"label\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}],[4,\"gov-form-message\",{\"variant\":[1],\"identifier\":[64]}]]],[\"gov-backdrop\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]}]]],[\"gov-button\",[[4,\"gov-button\",{\"variant\":[513],\"size\":[513],\"type\":[513],\"expanded\":[516],\"inverse\":[516],\"name\":[1],\"iconLeft\":[1,\"icon-left\"],\"iconRight\":[1,\"icon-right\"],\"disabled\":[516],\"nativeType\":[1,\"native-type\"],\"href\":[1],\"target\":[1],\"download\":[4],\"hreflang\":[1],\"referrerpolicy\":[1],\"rel\":[1],\"loading\":[1],\"focusable\":[4],\"identifier\":[1],\"wcagActiveDescendant\":[1,\"wcag-active-descendant\"],\"wcagControls\":[1,\"wcag-controls\"],\"wcagDescribedBy\":[1,\"wcag-described-by\"],\"wcagDescription\":[1,\"wcag-description\"],\"wcagDetails\":[1,\"wcag-details\"],\"wcagExpanded\":[4,\"wcag-expanded\"],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"wcagOwns\":[1,\"wcag-owns\"],\"wcagHasPopup\":[1,\"wcag-has-popup\"],\"wcagPressed\":[4,\"wcag-pressed\"],\"wcagCurrent\":[1,\"wcag-current\"],\"setFocus\":[64],\"getTriggerRef\":[64],\"validateWcag\":[64]}]]]]"), options);
7
7
  };
8
8
 
9
9
  export { defineCustomElements };
@@ -7375,6 +7375,12 @@ class GovFormAutocomplete {
7375
7375
  });
7376
7376
  }
7377
7377
  }
7378
+ clearList() {
7379
+ const areOptions = propsValueToArray(this.options);
7380
+ if (areOptions.length === 0) {
7381
+ this.list = [];
7382
+ }
7383
+ }
7378
7384
  get isValueAccepted() {
7379
7385
  if (typeof this.value === 'string') {
7380
7386
  return this.value.length >= this.minlength;
@@ -7388,10 +7394,10 @@ class GovFormAutocomplete {
7388
7394
  this.validateSize(this.size);
7389
7395
  }
7390
7396
  render() {
7391
- return (hAsync(Host, { class: FormAutocompleteClass.root, size: this.size, variant: this.variant }, hAsync("gov-form-input", { placeholder: this.placeholder, name: this.name, disabled: this.disabled, readonly: this.readonly, autocomplete: false, size: this.size, variant: this.variant, required: this.required, invalid: this.invalid, success: this.success, role: 'searchbox', value: this.value, minlength: this.minlength, maxlength: this.maxlength, "on-gov-input": throttle(this.onInputHandler.bind(this), this.throttleTime), "on-gov-keyup": this.onKeyUpHandler.bind(this), "on-gov-keydown": this.onKeyDownHandler.bind(this), "on-gov-focus": this.onFocusHandler.bind(this), "on-gov-blur": this.onBlurHandler.bind(this), wcagAutocomplete: 'list', wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: [this.listBoxId, this.wcagOwns].join(' '), wcagExpanded: this.list.length && this.focused, ref: el => (this.inputRef = el) }, hAsync("slot", { slot: "right-icon", name: "right-icon" })), hAsync("ul", { class: FormAutocompleteClass.list, role: 'listbox', id: this.listBoxId, ref: el => (this.listRef = el) }, this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (hAsync("li", { class: FormAutocompleteClass.empty }, this.messageEmpty)) : null, this.focused && this.processing === true && this.isValueAccepted ? (hAsync("li", { class: FormAutocompleteClass.loading }, hAsync("gov-icon", { name: "loader", class: "gov-spin-animation" }), "\u00A0", this.messageLoading)) : null, this.list.map((item, index) => {
7397
+ return (hAsync(Host, { class: FormAutocompleteClass.root, size: this.size, variant: this.variant }, hAsync("gov-form-input", { placeholder: this.placeholder, name: this.name, disabled: this.disabled, readonly: this.readonly, autocomplete: false, size: this.size, variant: this.variant, required: this.required, invalid: this.invalid, success: this.success, role: 'searchbox', value: this.value, minlength: this.minlength, maxlength: this.maxlength, "on-gov-input": throttle(this.onInputHandler.bind(this), this.throttleTime), "on-gov-keyup": this.onKeyUpHandler.bind(this), "on-gov-keydown": this.onKeyDownHandler.bind(this), "on-gov-focus": this.onFocusHandler.bind(this), "on-gov-blur": this.onBlurHandler.bind(this), wcagAutocomplete: 'list', wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: [this.listBoxId, this.wcagOwns].join(' '), wcagExpanded: this.list.length && this.focused, ref: el => (this.inputRef = el) }, hAsync("slot", { slot: "right-icon", name: "right-icon" })), hAsync("ul", { class: FormAutocompleteClass.list, role: 'listbox', "aria-hidden": toBoolAttr(!this.focused), hidden: !this.focused, id: this.listBoxId, ref: el => (this.listRef = el) }, this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (hAsync("li", { class: FormAutocompleteClass.empty }, this.messageEmpty)) : null, this.focused && this.processing === true && this.isValueAccepted ? (hAsync("li", { class: FormAutocompleteClass.loading }, hAsync("gov-icon", { name: "loader", class: "gov-spin-animation" }), "\u00A0", this.messageLoading)) : null, this.focused ? this.list.map((item, index) => {
7392
7398
  const isSelected = this.arrowCounter === index;
7393
7399
  return (hAsync("li", { class: FormAutocompleteClass.item, innerHTML: this.templateResolver(item, isSelected), role: 'option', "aria-posinset": index, tabindex: isSelected ? 0 : -1, "aria-setsize": this.list.length, onTouchStart: (e) => this.onSelectHandler(e, index), onMouseDown: (e) => this.onSelectHandler(e, index), "aria-selected": toBoolAttr(isSelected) }));
7394
- }))));
7400
+ }) : null)));
7395
7401
  }
7396
7402
  onFocusHandler(e) {
7397
7403
  this.focused = true;
@@ -7409,10 +7415,7 @@ class GovFormAutocomplete {
7409
7415
  }
7410
7416
  onBlurHandler(e) {
7411
7417
  this.focused = false;
7412
- const areOptions = propsValueToArray(this.options);
7413
- if (areOptions.length === 0) {
7414
- this.list = [];
7415
- }
7418
+ this.clearList();
7416
7419
  this.arrowCounter = -1;
7417
7420
  e.stopPropagation();
7418
7421
  this.govBlur.emit({
@@ -7448,7 +7451,7 @@ class GovFormAutocomplete {
7448
7451
  selected: selected,
7449
7452
  originalEvent: e,
7450
7453
  });
7451
- this.list = [];
7454
+ this.clearList();
7452
7455
  if (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {
7453
7456
  this.value = selected[this.nameKey];
7454
7457
  }
@@ -7478,11 +7481,17 @@ class GovFormAutocomplete {
7478
7481
  }
7479
7482
  }
7480
7483
  /**
7481
- * Returns the current state of the component
7484
+ * Focus main input element
7482
7485
  */
7483
7486
  async setFocus(options) {
7484
7487
  return this.inputRef.focus(options);
7485
7488
  }
7489
+ /**
7490
+ * Blur main input element
7491
+ */
7492
+ async setBlur() {
7493
+ return this.inputRef.blur();
7494
+ }
7486
7495
  /**
7487
7496
  * Set options for list
7488
7497
  */
@@ -7554,6 +7563,7 @@ class GovFormAutocomplete {
7554
7563
  "arrowCounter": [32],
7555
7564
  "list": [32],
7556
7565
  "setFocus": [64],
7566
+ "setBlur": [64],
7557
7567
  "setOptions": [64],
7558
7568
  "clearValue": [64],
7559
7569
  "setProcessing": [64],
@@ -123,6 +123,7 @@ export declare class GovFormAutocomplete {
123
123
  private onArrowDown;
124
124
  private moveToView;
125
125
  private doSearch;
126
+ private clearList;
126
127
  get isValueAccepted(): boolean;
127
128
  componentWillLoad(): void;
128
129
  render(): any;
@@ -133,9 +134,13 @@ export declare class GovFormAutocomplete {
133
134
  private onKeyUpHandler;
134
135
  private onKeyDownHandler;
135
136
  /**
136
- * Returns the current state of the component
137
+ * Focus main input element
137
138
  */
138
139
  setFocus(options?: FocusOptions): Promise<void>;
140
+ /**
141
+ * Blur main input element
142
+ */
143
+ setBlur(): Promise<void>;
139
144
  /**
140
145
  * Set options for list
141
146
  */
@@ -602,7 +602,11 @@ export namespace Components {
602
602
  */
603
603
  "required": boolean;
604
604
  /**
605
- * Returns the current state of the component
605
+ * Blur main input element
606
+ */
607
+ "setBlur": () => Promise<void>;
608
+ /**
609
+ * Focus main input element
606
610
  */
607
611
  "setFocus": (options?: FocusOptions) => Promise<void>;
608
612
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gov-design-system-ce/components",
3
3
  "description": "This package includes Gov Design System Web Components and related utilities.",
4
4
  "author": "Zdeněk Vítek",
5
- "version": "4.0.8-rc06",
5
+ "version": "4.0.8-rc07",
6
6
  "license": "EUPL v1.2 Licensed",
7
7
  "main": "./dist/index.cjs.js",
8
8
  "unpkg": "./dist/core/core.esm.js",
@@ -1,2 +0,0 @@
1
- import{p as t,H as e,c as i,h as s,d as o}from"./p-2dee9951.js";import{a}from"./p-c353678b.js";import{v as n}from"./p-dcb5fb35.js";import{c as r}from"./p-24636c53.js";import{d as h,t as l,h as c}from"./p-03990da5.js";import{F as m,a as d,b as p}from"./p-f04382c3.js";import{p as g}from"./p-ab5a13ea.js";import{d as u}from"./p-245d3ff5.js";import{d as f}from"./p-281b05f0.js";const v='.gov-form-autocomplete__list{margin:0;padding:0}.gov-form-autocomplete__list>.gov-form-autocomplete__item{margin:0;padding:0;background:none}.gov-form-autocomplete__list>.gov-form-autocomplete__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-autocomplete{position:relative;display:block;width:100%}.gov-form-autocomplete__list{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);position:absolute;top:100%;right:0;left:0;z-index:5;max-height:14.0625rem;margin-top:0.5rem;border:var(--gov-autocomplete-item-hover, 0.0625rem solid var(--gov-color-secondary-500));border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-autocomplete-bg, var(--gov-color-neutral-white));overflow-x:hidden;overflow-y:auto;overscroll-behavior:none}.gov-form-autocomplete__list>.gov-form-autocomplete__item{padding:0.75rem 0.5rem;cursor:pointer}.gov-form-autocomplete__item--empty,.gov-form-autocomplete__item--loading{padding:0.75rem 0.5rem;color:var(--gov-autocomplete-item-disable-color, var(--gov-color-secondary-600))}.gov-form-autocomplete__item--empty .gov-icon,.gov-form-autocomplete__item--empty .gov-spin-animation,.gov-form-autocomplete__item--loading .gov-icon,.gov-form-autocomplete__item--loading .gov-spin-animation{width:12px;height:12px}.gov-form-autocomplete__list:empty{display:none}.gov-form-autocomplete__item[aria-selected=""],.gov-form-autocomplete__item[aria-selected=true i],.gov-form-autocomplete__item[aria-selected="1"]{background:var(--gov-autocomplete-item-select, var(--gov-color-secondary-400))}@media not all and (pointer: coarse){.gov-form-autocomplete__item:hover{background:var(--gov-autocomplete-item-hover, var(--gov-color-primary-100))}}';const y=t(class t extends e{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.govSelect=i(this,"gov-select",7);this.templateResolver=t=>t[this.nameKey];this.value="";this.options=undefined;this.identifier=undefined;this.variant=undefined;this.success=undefined;this.size="m";this.nameKey="name";this.name=undefined;this.required=false;this.disabled=false;this.placeholder=undefined;this.readonly=undefined;this.invalid=undefined;this.minlength=3;this.maxlength=undefined;this.throttleTime=200;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.processing=false;this.arrowCounter=-1;this.list=[];this.listBoxId=r("GovListBox")}validateVariant(t){n(d,t,m.root)}validateSize(t){n(p,t,m.root)}watchOptions(t){this.setOptions(g(t)).catch()}onArrowUp(){if(this.arrowCounter>0){this.arrowCounter=this.arrowCounter-1;this.moveToView().finally()}}onArrowDown(){if(this.arrowCounter<this.list.length-1){this.arrowCounter=this.arrowCounter+1;this.moveToView().finally()}}async moveToView(){await h(200);const t=this.listRef.offsetHeight;const e=this.listRef.querySelector('li[aria-selected="true"]');if(e&&t){const t=e.offsetTop;this.listRef.scrollTo({top:t,behavior:"smooth"})}}doSearch(){if(Number.isInteger(this.minlength)&&this.isValueAccepted===false&&this.minlength){this.list=[];this.arrowCounter=-1;this.processing=false;return}if(this.searchCallback){this.processing=true;this.searchCallback(this.value).then((t=>this.list=t)).catch((()=>this.list=[])).finally((()=>{this.arrowCounter=-1;this.processing=false}))}}get isValueAccepted(){if(typeof this.value==="string"){return this.value.length>=this.minlength}else{return false}}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size)}render(){return s(o,{class:m.root,size:this.size,variant:this.variant},s("gov-form-input",{placeholder:this.placeholder,name:this.name,disabled:this.disabled,readonly:this.readonly,autocomplete:false,size:this.size,variant:this.variant,required:this.required,invalid:this.invalid,success:this.success,role:"searchbox",value:this.value,minlength:this.minlength,maxlength:this.maxlength,"on-gov-input":l(this.onInputHandler.bind(this),this.throttleTime),"on-gov-keyup":this.onKeyUpHandler.bind(this),"on-gov-keydown":this.onKeyDownHandler.bind(this),"on-gov-focus":this.onFocusHandler.bind(this),"on-gov-blur":this.onBlurHandler.bind(this),wcagAutocomplete:"list",wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:[this.listBoxId,this.wcagOwns].join(" "),wcagExpanded:this.list.length&&this.focused,ref:t=>this.inputRef=t},s("slot",{slot:"right-icon",name:"right-icon"})),s("ul",{class:m.list,role:"listbox",id:this.listBoxId,ref:t=>this.listRef=t},this.focused&&this.list.length===0&&this.processing===false&&this.isValueAccepted&&this.messageEmpty?s("li",{class:m.empty},this.messageEmpty):null,this.focused&&this.processing===true&&this.isValueAccepted?s("li",{class:m.loading},s("gov-icon",{name:"loader",class:"gov-spin-animation"})," ",this.messageLoading):null,this.list.map(((t,e)=>{const i=this.arrowCounter===e;return s("li",{class:m.item,innerHTML:this.templateResolver(t,i),role:"option","aria-posinset":e,tabindex:i?0:-1,"aria-setsize":this.list.length,onTouchStart:t=>this.onSelectHandler(t,e),onMouseDown:t=>this.onSelectHandler(t,e),"aria-selected":a(i)})}))))}onFocusHandler(t){this.focused=true;this.arrowCounter=-1;if(this.isValueAccepted&&this.searchCallback){this.doSearch()}t.stopPropagation();this.govFocus.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onBlurHandler(t){this.focused=false;const e=g(this.options);if(e.length===0){this.list=[]}this.arrowCounter=-1;t.stopPropagation();this.govBlur.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({originalEvent:t,component:m.root,value:this.value,selected:null});this.doSearch()}onSelectHandler(t,e=-1){let i=null;if(e>-1){i=this.list[e]}else if(c(this.arrowCounter,this.list)){i=this.list[this.arrowCounter]}if(i){this.govSelect.emit({component:m.root,value:this.value,selected:i,originalEvent:t});this.list=[];if(c(this.nameKey,i)&&typeof i[this.nameKey]==="string"){this.value=i[this.nameKey]}}}onKeyUpHandler(t){const e=t.detail.originalEvent;t.stopPropagation();e.stopPropagation();if(e.keyCode===38)this.onArrowUp();else if(e.keyCode===40)this.onArrowDown();else if(e.keyCode===13){t.preventDefault();e.preventDefault();this.onSelectHandler(t)}}onKeyDownHandler(t){const e=t.detail.originalEvent;t.stopPropagation();e.stopPropagation();if(e.keyCode===13){t.preventDefault();e.preventDefault()}}async setFocus(t){return this.inputRef.focus(t)}async setOptions(t){this.list=Array.isArray(t)?t:[];this.arrowCounter=-1}async clearValue(){this.value="";this.inputRef.value="";await this.inputRef.clearValue()}async setProcessing(t){this.processing=t}async setSearchCallback(t){this.searchCallback=t}async setTemplateResolver(t){this.templateResolver=t}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize"],options:["watchOptions"]}}static get style(){return v}},[4,"gov-form-autocomplete",{value:[1537],options:[1537],identifier:[1],variant:[1],success:[4],size:[1],nameKey:[1,"name-key"],name:[1],required:[4],disabled:[4],placeholder:[1],readonly:[4],invalid:[4],minlength:[2],maxlength:[2],throttleTime:[2,"throttle-time"],messageEmpty:[1,"message-empty"],messageLoading:[1,"message-loading"],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagOwns:[1,"wcag-owns"],focused:[32],processing:[32],arrowCounter:[32],list:[32],setFocus:[64],setOptions:[64],clearValue:[64],setProcessing:[64],setSearchCallback:[64],setTemplateResolver:[64]}]);function b(){if(typeof customElements==="undefined"){return}const t=["gov-form-autocomplete","gov-form-input","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-autocomplete":if(!customElements.get(t)){customElements.define(t,y)}break;case"gov-form-input":if(!customElements.get(t)){u()}break;case"gov-icon":if(!customElements.get(t)){f()}break}}))}b();export{y as G,b as d};
2
- //# sourceMappingURL=p-86a37e8c.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govFormAutocompleteCss","GovFormAutocomplete","proxyCustomElement","H","constructor","this","templateResolver","item","nameKey","listBoxId","createID","validateVariant","newValue","validateProp","FormAutocompleteVariants","FormAutocompleteClass","root","validateSize","FormAutocompleteSizes","watchOptions","setOptions","propsValueToArray","catch","onArrowUp","arrowCounter","moveToView","finally","onArrowDown","list","length","delay","heightOfList","listRef","offsetHeight","selected","querySelector","offsetTop","scrollTo","top","behavior","doSearch","Number","isInteger","minlength","isValueAccepted","processing","searchCallback","value","then","response","componentWillLoad","variant","size","render","h","Host","class","placeholder","name","disabled","readonly","autocomplete","required","invalid","success","role","maxlength","throttle","onInputHandler","bind","throttleTime","onKeyUpHandler","onKeyDownHandler","onFocusHandler","onBlurHandler","wcagAutocomplete","wcagDescribedBy","wcagLabelledBy","wcagOwns","join","wcagExpanded","focused","ref","el","inputRef","slot","id","messageEmpty","empty","loading","messageLoading","map","index","isSelected","innerHTML","tabindex","onTouchStart","e","onSelectHandler","onMouseDown","toBoolAttr","stopPropagation","govFocus","emit","originalEvent","component","areOptions","options","govBlur","target","govInput","has","govSelect","event","detail","keyCode","preventDefault","setFocus","focus","Array","isArray","clearValue","setProcessing","status","setSearchCallback","callback","setTemplateResolver"],"sources":["../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.scss?tag=gov-form-autocomplete","../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"sourcesContent":["$class: \".gov-form-autocomplete\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@include typography($font-size-s);\n\t\t@extend %reset-ul;\n\t\tposition: absolute;\n\t\ttop: 100%;\n\t\tright: 0;\n\t\tleft: 0;\n\t\tz-index: 5;\n\t\tmax-height: rem-calc(225);\n\t\tmargin-top: rem-calc(8);\n\t\tborder: $form-autocomplete-border;\n\t\tborder-radius: $border-radius;\n\t\tbackground: $form-autocomplete-bg;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\toverscroll-behavior: none;\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tpadding: rem-calc(12 8);\n\t\tcursor: pointer;\n\t}\n\t&__item {\n\t\t&--empty,\n\t\t&--loading {\n\t\t\tpadding: rem-calc(12 8);\n\t\t\tcolor: $form-autocomplete-item-disable-color;\n\t\t\t& .gov-icon,\n\t\t\t& .gov-spin-animation {\n\t\t\t\twidth: 12px;\n\t\t\t\theight: 12px;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&__list:empty {\n\t\tdisplay: none;\n\t}\n\n\t// HOVERS\n\t&__item {\n\t\t@include parameter(\"aria-selected\") {\n\t\t\tbackground: $form-autocomplete-item-select-bg;\n\t\t}\n\t\t@include hover() {\n\t\t\tbackground: $form-autocomplete-item-hover-bg;\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {toBoolAttr} from '../../../helpers/Dom/template'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID} from '../../../utils/string.utils'\nimport {delay, has, throttle} from '../../../utils/utils'\nimport {FormInputEvent} from '../input/gov-form-input.types'\nimport {\n\tFormAutocompleteClass,\n\tFormAutocompleteSizes,\n\tFormAutocompleteVariants,\n\tSizesType,\n\tVariantType\n} from './constants'\nimport {FormAutocompleteEvent, GovFormAutocompleteItem} from './gov-form-autocomplete.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\n\n@Component({\n\ttag: 'gov-form-autocomplete',\n\tstyleUrl: 'gov-form-autocomplete.scss',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({reflect: true, mutable: true}) value = ''\n\t/**\n\t * Options of autocomplete\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormAutocompleteItem[]\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: VariantType\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop() readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Input throttle in milliseconds\n\t */\n\t@Prop() readonly throttleTime: number = 200\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Custom message for when data is loaded\n\t */\n\t@Prop({attribute: 'message-loading'}) readonly messageLoading: string = 'Načítám...'\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-owns\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-input'}) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormAutocompleteEvent>\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteVariants, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormAutocompleteItem[]): void {\n\t\tthis.setOptions(propsValueToArray(newValue)).catch()\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({top: offsetTop, behavior: 'smooth'})\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\tthis.list = []\n\t\t\tthis.arrowCounter = -1\n\t\t\tthis.processing = false\n\t\t\treturn\n\t\t}\n\t\tif (this.searchCallback) {\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormAutocompleteClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={throttle(this.onInputHandler.bind(this), this.throttleTime)}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\twcagAutocomplete={'list'}\n\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\twcagOwns={[this.listBoxId, this.wcagOwns].join(' ')}\n\t\t\t\t\twcagExpanded={this.list.length && this.focused}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot slot=\"right-icon\" name=\"right-icon\"/>\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list} role={'listbox'} id={this.listBoxId}\n\t\t\t\t\t\tref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>\n\t\t\t\t\t\t\t&nbsp;{this.messageLoading}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonTouchStart={(e: TouchEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\tonMouseDown={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif (this.isValueAccepted && this.searchCallback) {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tconst areOptions = propsValueToArray<GovFormAutocompleteItem[]>(this.options)\n\t\tif (areOptions.length === 0) {\n\t\t\tthis.list = []\n\t\t}\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLGovFormInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent | TouchEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.list = []\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"],"mappings":"uXAAA,MAAMA,EAAyB,skE,MCqBlBC,EAAmBC,EAAA,MAAAD,U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OAAOtG,KAAK+E,SAASkC,MAAMX,E,CAO5B,gBAAMvF,CAAWuF,GAChBtG,KAAKuB,KAAO2F,MAAMC,QAAQb,GAAWA,EAAU,GAC/CtG,KAAKmB,cAAgB,C,CAOtB,gBAAMiG,GACLpH,KAAK0C,MAAQ,GACb1C,KAAK+E,SAASrC,MAAQ,SAEhB1C,KAAK+E,SAASqC,Y,CAOrB,mBAAMC,CAAcC,GACnBtH,KAAKwC,WAAa8E,C,CAOnB,uBAAMC,CAAkBC,GACvBxH,KAAKyC,eAAiB+E,C,CAQvB,yBAAMC,CAAoBD,GACzBxH,KAAKC,iBAAmBuH,C"}
@@ -1,2 +0,0 @@
1
- import{r as t,c as i,h as e,a as s,g as o}from"./p-5bc604a3.js";import{a}from"./p-5de606f8.js";import{v as n}from"./p-dcb5fb35.js";import{c as r}from"./p-24636c53.js";import{d as h,t as l,h as c}from"./p-03990da5.js";import{F as m,a as p,b as d}from"./p-9dab01be.js";import{p as g}from"./p-ab5a13ea.js";import"./p-7f2c9830.js";import"./p-003e6cca.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";const u='.gov-form-autocomplete__list{margin:0;padding:0}.gov-form-autocomplete__list>.gov-form-autocomplete__item{margin:0;padding:0;background:none}.gov-form-autocomplete__list>.gov-form-autocomplete__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-autocomplete{position:relative;display:block;width:100%}.gov-form-autocomplete__list{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);position:absolute;top:100%;right:0;left:0;z-index:5;max-height:14.0625rem;margin-top:0.5rem;border:var(--gov-autocomplete-item-hover, 0.0625rem solid var(--gov-color-secondary-500));border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-autocomplete-bg, var(--gov-color-neutral-white));overflow-x:hidden;overflow-y:auto;overscroll-behavior:none}.gov-form-autocomplete__list>.gov-form-autocomplete__item{padding:0.75rem 0.5rem;cursor:pointer}.gov-form-autocomplete__item--empty,.gov-form-autocomplete__item--loading{padding:0.75rem 0.5rem;color:var(--gov-autocomplete-item-disable-color, var(--gov-color-secondary-600))}.gov-form-autocomplete__item--empty .gov-icon,.gov-form-autocomplete__item--empty .gov-spin-animation,.gov-form-autocomplete__item--loading .gov-icon,.gov-form-autocomplete__item--loading .gov-spin-animation{width:12px;height:12px}.gov-form-autocomplete__list:empty{display:none}.gov-form-autocomplete__item[aria-selected=""],.gov-form-autocomplete__item[aria-selected=true i],.gov-form-autocomplete__item[aria-selected="1"]{background:var(--gov-autocomplete-item-select, var(--gov-color-secondary-400))}@media not all and (pointer: coarse){.gov-form-autocomplete__item:hover{background:var(--gov-autocomplete-item-hover, var(--gov-color-primary-100))}}';const v=class{constructor(e){t(this,e);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.govSelect=i(this,"gov-select",7);this.templateResolver=t=>t[this.nameKey];this.value="";this.options=undefined;this.identifier=undefined;this.variant=undefined;this.success=undefined;this.size="m";this.nameKey="name";this.name=undefined;this.required=false;this.disabled=false;this.placeholder=undefined;this.readonly=undefined;this.invalid=undefined;this.minlength=3;this.maxlength=undefined;this.throttleTime=200;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.processing=false;this.arrowCounter=-1;this.list=[];this.listBoxId=r("GovListBox")}validateVariant(t){n(p,t,m.root)}validateSize(t){n(d,t,m.root)}watchOptions(t){this.setOptions(g(t)).catch()}onArrowUp(){if(this.arrowCounter>0){this.arrowCounter=this.arrowCounter-1;this.moveToView().finally()}}onArrowDown(){if(this.arrowCounter<this.list.length-1){this.arrowCounter=this.arrowCounter+1;this.moveToView().finally()}}async moveToView(){await h(200);const t=this.listRef.offsetHeight;const i=this.listRef.querySelector('li[aria-selected="true"]');if(i&&t){const t=i.offsetTop;this.listRef.scrollTo({top:t,behavior:"smooth"})}}doSearch(){if(Number.isInteger(this.minlength)&&this.isValueAccepted===false&&this.minlength){this.list=[];this.arrowCounter=-1;this.processing=false;return}if(this.searchCallback){this.processing=true;this.searchCallback(this.value).then((t=>this.list=t)).catch((()=>this.list=[])).finally((()=>{this.arrowCounter=-1;this.processing=false}))}}get isValueAccepted(){if(typeof this.value==="string"){return this.value.length>=this.minlength}else{return false}}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size)}render(){return e(s,{class:m.root,size:this.size,variant:this.variant},e("gov-form-input",{placeholder:this.placeholder,name:this.name,disabled:this.disabled,readonly:this.readonly,autocomplete:false,size:this.size,variant:this.variant,required:this.required,invalid:this.invalid,success:this.success,role:"searchbox",value:this.value,minlength:this.minlength,maxlength:this.maxlength,"on-gov-input":l(this.onInputHandler.bind(this),this.throttleTime),"on-gov-keyup":this.onKeyUpHandler.bind(this),"on-gov-keydown":this.onKeyDownHandler.bind(this),"on-gov-focus":this.onFocusHandler.bind(this),"on-gov-blur":this.onBlurHandler.bind(this),wcagAutocomplete:"list",wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:[this.listBoxId,this.wcagOwns].join(" "),wcagExpanded:this.list.length&&this.focused,ref:t=>this.inputRef=t},e("slot",{slot:"right-icon",name:"right-icon"})),e("ul",{class:m.list,role:"listbox",id:this.listBoxId,ref:t=>this.listRef=t},this.focused&&this.list.length===0&&this.processing===false&&this.isValueAccepted&&this.messageEmpty?e("li",{class:m.empty},this.messageEmpty):null,this.focused&&this.processing===true&&this.isValueAccepted?e("li",{class:m.loading},e("gov-icon",{name:"loader",class:"gov-spin-animation"})," ",this.messageLoading):null,this.list.map(((t,i)=>{const s=this.arrowCounter===i;return e("li",{class:m.item,innerHTML:this.templateResolver(t,s),role:"option","aria-posinset":i,tabindex:s?0:-1,"aria-setsize":this.list.length,onTouchStart:t=>this.onSelectHandler(t,i),onMouseDown:t=>this.onSelectHandler(t,i),"aria-selected":a(s)})}))))}onFocusHandler(t){this.focused=true;this.arrowCounter=-1;if(this.isValueAccepted&&this.searchCallback){this.doSearch()}t.stopPropagation();this.govFocus.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onBlurHandler(t){this.focused=false;const i=g(this.options);if(i.length===0){this.list=[]}this.arrowCounter=-1;t.stopPropagation();this.govBlur.emit({originalEvent:t,component:m.root,value:this.value,selected:null})}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({originalEvent:t,component:m.root,value:this.value,selected:null});this.doSearch()}onSelectHandler(t,i=-1){let e=null;if(i>-1){e=this.list[i]}else if(c(this.arrowCounter,this.list)){e=this.list[this.arrowCounter]}if(e){this.govSelect.emit({component:m.root,value:this.value,selected:e,originalEvent:t});this.list=[];if(c(this.nameKey,e)&&typeof e[this.nameKey]==="string"){this.value=e[this.nameKey]}}}onKeyUpHandler(t){const i=t.detail.originalEvent;t.stopPropagation();i.stopPropagation();if(i.keyCode===38)this.onArrowUp();else if(i.keyCode===40)this.onArrowDown();else if(i.keyCode===13){t.preventDefault();i.preventDefault();this.onSelectHandler(t)}}onKeyDownHandler(t){const i=t.detail.originalEvent;t.stopPropagation();i.stopPropagation();if(i.keyCode===13){t.preventDefault();i.preventDefault()}}async setFocus(t){return this.inputRef.focus(t)}async setOptions(t){this.list=Array.isArray(t)?t:[];this.arrowCounter=-1}async clearValue(){this.value="";this.inputRef.value="";await this.inputRef.clearValue()}async setProcessing(t){this.processing=t}async setSearchCallback(t){this.searchCallback=t}async setTemplateResolver(t){this.templateResolver=t}get host(){return o(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize"],options:["watchOptions"]}}};v.style=u;export{v as gov_form_autocomplete};
2
- //# sourceMappingURL=p-cdd77b6c.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govFormAutocompleteCss","GovFormAutocomplete","constructor","hostRef","this","templateResolver","item","nameKey","listBoxId","createID","validateVariant","newValue","validateProp","FormAutocompleteVariants","FormAutocompleteClass","root","validateSize","FormAutocompleteSizes","watchOptions","setOptions","propsValueToArray","catch","onArrowUp","arrowCounter","moveToView","finally","onArrowDown","list","length","delay","heightOfList","listRef","offsetHeight","selected","querySelector","offsetTop","scrollTo","top","behavior","doSearch","Number","isInteger","minlength","isValueAccepted","processing","searchCallback","value","then","response","componentWillLoad","variant","size","render","h","Host","class","placeholder","name","disabled","readonly","autocomplete","required","invalid","success","role","maxlength","throttle","onInputHandler","bind","throttleTime","onKeyUpHandler","onKeyDownHandler","onFocusHandler","onBlurHandler","wcagAutocomplete","wcagDescribedBy","wcagLabelledBy","wcagOwns","join","wcagExpanded","focused","ref","el","inputRef","slot","id","messageEmpty","empty","loading","messageLoading","map","index","isSelected","innerHTML","tabindex","onTouchStart","e","onSelectHandler","onMouseDown","toBoolAttr","stopPropagation","govFocus","emit","originalEvent","component","areOptions","options","govBlur","target","govInput","has","govSelect","event","detail","keyCode","preventDefault","setFocus","focus","Array","isArray","clearValue","setProcessing","status","setSearchCallback","callback","setTemplateResolver"],"sources":["../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.scss?tag=gov-form-autocomplete","../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"sourcesContent":["$class: \".gov-form-autocomplete\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@include typography($font-size-s);\n\t\t@extend %reset-ul;\n\t\tposition: absolute;\n\t\ttop: 100%;\n\t\tright: 0;\n\t\tleft: 0;\n\t\tz-index: 5;\n\t\tmax-height: rem-calc(225);\n\t\tmargin-top: rem-calc(8);\n\t\tborder: $form-autocomplete-border;\n\t\tborder-radius: $border-radius;\n\t\tbackground: $form-autocomplete-bg;\n\t\toverflow-x: hidden;\n\t\toverflow-y: auto;\n\t\toverscroll-behavior: none;\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tpadding: rem-calc(12 8);\n\t\tcursor: pointer;\n\t}\n\t&__item {\n\t\t&--empty,\n\t\t&--loading {\n\t\t\tpadding: rem-calc(12 8);\n\t\t\tcolor: $form-autocomplete-item-disable-color;\n\t\t\t& .gov-icon,\n\t\t\t& .gov-spin-animation {\n\t\t\t\twidth: 12px;\n\t\t\t\theight: 12px;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&__list:empty {\n\t\tdisplay: none;\n\t}\n\n\t// HOVERS\n\t&__item {\n\t\t@include parameter(\"aria-selected\") {\n\t\t\tbackground: $form-autocomplete-item-select-bg;\n\t\t}\n\t\t@include hover() {\n\t\t\tbackground: $form-autocomplete-item-hover-bg;\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {toBoolAttr} from '../../../helpers/Dom/template'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID} from '../../../utils/string.utils'\nimport {delay, has, throttle} from '../../../utils/utils'\nimport {FormInputEvent} from '../input/gov-form-input.types'\nimport {\n\tFormAutocompleteClass,\n\tFormAutocompleteSizes,\n\tFormAutocompleteVariants,\n\tSizesType,\n\tVariantType\n} from './constants'\nimport {FormAutocompleteEvent, GovFormAutocompleteItem} from './gov-form-autocomplete.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\n\n@Component({\n\ttag: 'gov-form-autocomplete',\n\tstyleUrl: 'gov-form-autocomplete.scss',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({reflect: true, mutable: true}) value = ''\n\t/**\n\t * Options of autocomplete\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormAutocompleteItem[]\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: VariantType\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop() readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Input throttle in milliseconds\n\t */\n\t@Prop() readonly throttleTime: number = 200\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Custom message for when data is loaded\n\t */\n\t@Prop({attribute: 'message-loading'}) readonly messageLoading: string = 'Načítám...'\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-owns\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-input'}) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormAutocompleteEvent>\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteVariants, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormAutocompleteItem[]): void {\n\t\tthis.setOptions(propsValueToArray(newValue)).catch()\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({top: offsetTop, behavior: 'smooth'})\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\tthis.list = []\n\t\t\tthis.arrowCounter = -1\n\t\t\tthis.processing = false\n\t\t\treturn\n\t\t}\n\t\tif (this.searchCallback) {\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormAutocompleteClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={throttle(this.onInputHandler.bind(this), this.throttleTime)}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\twcagAutocomplete={'list'}\n\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\twcagOwns={[this.listBoxId, this.wcagOwns].join(' ')}\n\t\t\t\t\twcagExpanded={this.list.length && this.focused}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot slot=\"right-icon\" name=\"right-icon\"/>\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list} role={'listbox'} id={this.listBoxId}\n\t\t\t\t\t\tref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>\n\t\t\t\t\t\t\t&nbsp;{this.messageLoading}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonTouchStart={(e: TouchEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\tonMouseDown={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif (this.isValueAccepted && this.searchCallback) {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tconst areOptions = propsValueToArray<GovFormAutocompleteItem[]>(this.options)\n\t\tif (areOptions.length === 0) {\n\t\t\tthis.list = []\n\t\t}\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLGovFormInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent | TouchEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.list = []\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"],"mappings":"+YAAA,MAAMA,EAAyB,skE,MCqBlBC,EAAmB,MAO/B,WAAAC,CAAAC,G,0JAFQC,KAAAC,iBAAiFC,GAAQA,EAAKF,KAAKG,S,WAU7D,G,yGAoBV,I,aAID,O,kCASE,M,cAKA,M,yFAgBA,E,2CAQG,I,kBAI4B,iC,oBAII,a,4HA+BlD,M,mBACG,E,UACkB,GA9G1CH,KAAKI,UAAYC,EAAS,a,CAiH3B,eAAAC,CAAgBC,GACfC,EAAaC,EAA0BF,EAAUG,EAAsBC,K,CAIxE,YAAAC,CAAaL,GACZC,EAAaK,EAAuBN,EAAUG,EAAsBC,K,CAIrE,YAAAG,CAAaP,GACZP,KAAKe,WAAWC,EAAkBT,IAAWU,O,CAGtC,SAAAC,GACP,GAAIlB,KAAKmB,aAAe,EAAG,CAC1BnB,KAAKmB,aAAenB,KAAKmB,aAAe,EACxCnB,KAAKoB,aAAaC,S,EAIZ,WAAAC,GACP,GAAItB,KAAKmB,aAAenB,KAAKuB,KAAKC,OAAS,EAAG,CAC7CxB,KAAKmB,aAAenB,KAAKmB,aAAe,EACxCnB,KAAKoB,aAA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,KAAO,GACZ,GAAImF,EAAI1G,KAAKG,QAAS0B,WAAoBA,EAAS7B,KAAKG,WAAa,SAAU,CAC9EH,KAAK0C,MAAQb,EAAS7B,KAAKG,Q,GAKtB,cAAA+D,CAAe0B,GACtB,MAAMgB,EAAShB,EAAEiB,OAA0BV,cAC3CP,EAAEI,kBACFY,EAAMZ,kBACN,GAAIY,EAAME,UAAY,GAAI9G,KAAKkB,iBAC1B,GAAI0F,EAAME,UAAY,GAAI9G,KAAKsB,mBAC/B,GAAIsF,EAAME,UAAY,GAAI,CAC9BlB,EAAEmB,iBACFH,EAAMG,iBACN/G,KAAK6F,gBAAgBD,E,EAIf,gBAAAzB,CAAiByB,GACxB,MAAMgB,EAAShB,EAAEiB,OAA0BV,cAC3CP,EAAEI,kBACFY,EAAMZ,kBACN,GAAIY,EAAME,UAAY,GAAI,CACzBlB,EAAEmB,iBACFH,EAAMG,gB,EAQR,cAAMC,CAASV,GACd,OAAOtG,KAAK+E,SAASkC,MAAMX,E,CAO5B,gBAAMvF,CAAWuF,GAChBtG,KAAKuB,KAAO2F,MAAMC,QAAQb,GAAWA,EAAU,GAC/CtG,KAAKmB,cAAgB,C,CAOtB,gBAAMiG,GACLpH,KAAK0C,MAAQ,GACb1C,KAAK+E,SAASrC,MAAQ,SAEhB1C,KAAK+E,SAASqC,Y,CAOrB,mBAAMC,CAAcC,GACnBtH,KAAKwC,WAAa8E,C,CAOnB,uBAAMC,CAAkBC,GACvBxH,KAAKyC,eAAiB+E,C,CAQvB,yBAAMC,CAAoBD,GACzBxH,KAAKC,iBAAmBuH,C"}
package/dist/globals.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare module "*.md";
2
- declare module "*.json";
@@ -1,6 +0,0 @@
1
- declare module '*.jpg'
2
-
3
- declare module '*.md' {
4
- const value: string // markdown is just a string
5
- export default value
6
- }