@ukho/admiralty-core 4.0.0-next.7 → 4.0.0-next.8

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 (90) hide show
  1. package/dist/admiralty/admiralty.esm.js +1 -1
  2. package/dist/admiralty/admiralty.esm.js.map +1 -1
  3. package/dist/admiralty/{p-0747bd00.entry.js → p-1e01bb1c.entry.js} +2 -2
  4. package/dist/admiralty/{p-0747bd00.entry.js.map → p-1e01bb1c.entry.js.map} +1 -1
  5. package/dist/admiralty/{p-e11fb21b.entry.js → p-6dde3d41.entry.js} +2 -2
  6. package/dist/admiralty/p-6dde3d41.entry.js.map +1 -0
  7. package/dist/admiralty/{p-f8e1cfce.entry.js → p-a0466b05.entry.js} +2 -2
  8. package/dist/admiralty/p-a0466b05.entry.js.map +1 -0
  9. package/dist/admiralty/p-f2f2c51d.entry.js +2 -0
  10. package/dist/admiralty/p-f2f2c51d.entry.js.map +1 -0
  11. package/dist/cjs/admiralty-autocomplete.cjs.entry.js +4 -3
  12. package/dist/cjs/admiralty-autocomplete.cjs.entry.js.map +1 -1
  13. package/dist/cjs/admiralty-input.cjs.entry.js +2 -2
  14. package/dist/cjs/admiralty-input.cjs.entry.js.map +1 -1
  15. package/dist/cjs/admiralty-progress-bar.cjs.entry.js +9 -3
  16. package/dist/cjs/admiralty-progress-bar.cjs.entry.js.map +1 -1
  17. package/dist/cjs/admiralty-tab-group.cjs.entry.js +17 -5
  18. package/dist/cjs/admiralty-tab-group.cjs.entry.js.map +1 -1
  19. package/dist/cjs/admiralty.cjs.js +1 -1
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/collection/collection-manifest.json +1 -3
  22. package/dist/collection/components/autocomplete/autocomplete.js +5 -4
  23. package/dist/collection/components/autocomplete/autocomplete.js.map +1 -1
  24. package/dist/collection/components/input/input.js +2 -2
  25. package/dist/collection/components/input/input.js.map +1 -1
  26. package/dist/collection/components/progress-bar/progress-bar.js +9 -3
  27. package/dist/collection/components/progress-bar/progress-bar.js.map +1 -1
  28. package/dist/components/admiralty-autocomplete.js +4 -3
  29. package/dist/components/admiralty-autocomplete.js.map +1 -1
  30. package/dist/components/admiralty-input.js +121 -1
  31. package/dist/components/admiralty-input.js.map +1 -1
  32. package/dist/components/admiralty-progress-bar.js +9 -3
  33. package/dist/components/admiralty-progress-bar.js.map +1 -1
  34. package/dist/components/admiralty-tab-group.js +13 -1
  35. package/dist/components/admiralty-tab-group.js.map +1 -1
  36. package/dist/esm/admiralty-autocomplete.entry.js +4 -3
  37. package/dist/esm/admiralty-autocomplete.entry.js.map +1 -1
  38. package/dist/esm/admiralty-input.entry.js +2 -2
  39. package/dist/esm/admiralty-input.entry.js.map +1 -1
  40. package/dist/esm/admiralty-progress-bar.entry.js +9 -3
  41. package/dist/esm/admiralty-progress-bar.entry.js.map +1 -1
  42. package/dist/esm/admiralty-tab-group.entry.js +13 -1
  43. package/dist/esm/admiralty-tab-group.entry.js.map +1 -1
  44. package/dist/esm/admiralty.js +1 -1
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/types/components/autocomplete/autocomplete.d.ts +1 -1
  47. package/dist/types/components/progress-bar/progress-bar.d.ts +3 -1
  48. package/dist/types/components.d.ts +2 -94
  49. package/docs/docs.json +3 -218
  50. package/package.json +2 -2
  51. package/dist/admiralty/p-26ffce79.entry.js +0 -2
  52. package/dist/admiralty/p-26ffce79.entry.js.map +0 -1
  53. package/dist/admiralty/p-a4bd6904.js +0 -2
  54. package/dist/admiralty/p-a4bd6904.js.map +0 -1
  55. package/dist/admiralty/p-b7153ca1.entry.js +0 -2
  56. package/dist/admiralty/p-b7153ca1.entry.js.map +0 -1
  57. package/dist/admiralty/p-d701641c.entry.js +0 -2
  58. package/dist/admiralty/p-d701641c.entry.js.map +0 -1
  59. package/dist/admiralty/p-e11fb21b.entry.js.map +0 -1
  60. package/dist/admiralty/p-f8e1cfce.entry.js.map +0 -1
  61. package/dist/cjs/Keys-019752ee.js +0 -16
  62. package/dist/cjs/Keys-019752ee.js.map +0 -1
  63. package/dist/cjs/admiralty-type-ahead-item.cjs.entry.js +0 -23
  64. package/dist/cjs/admiralty-type-ahead-item.cjs.entry.js.map +0 -1
  65. package/dist/cjs/admiralty-type-ahead.cjs.entry.js +0 -204
  66. package/dist/cjs/admiralty-type-ahead.cjs.entry.js.map +0 -1
  67. package/dist/collection/components/type-ahead/type-ahead.css +0 -106
  68. package/dist/collection/components/type-ahead/type-ahead.js +0 -329
  69. package/dist/collection/components/type-ahead/type-ahead.js.map +0 -1
  70. package/dist/collection/components/type-ahead-item/type-ahead-item.css +0 -3
  71. package/dist/collection/components/type-ahead-item/type-ahead-item.js +0 -43
  72. package/dist/collection/components/type-ahead-item/type-ahead-item.js.map +0 -1
  73. package/dist/components/admiralty-type-ahead-item.d.ts +0 -11
  74. package/dist/components/admiralty-type-ahead-item.js +0 -38
  75. package/dist/components/admiralty-type-ahead-item.js.map +0 -1
  76. package/dist/components/admiralty-type-ahead.d.ts +0 -11
  77. package/dist/components/admiralty-type-ahead.js +0 -254
  78. package/dist/components/admiralty-type-ahead.js.map +0 -1
  79. package/dist/components/p-1a2059bb.js +0 -125
  80. package/dist/components/p-1a2059bb.js.map +0 -1
  81. package/dist/components/p-a4bd6904.js +0 -16
  82. package/dist/components/p-a4bd6904.js.map +0 -1
  83. package/dist/esm/Keys-acfce4b9.js +0 -16
  84. package/dist/esm/Keys-acfce4b9.js.map +0 -1
  85. package/dist/esm/admiralty-type-ahead-item.entry.js +0 -19
  86. package/dist/esm/admiralty-type-ahead-item.entry.js.map +0 -1
  87. package/dist/esm/admiralty-type-ahead.entry.js +0 -200
  88. package/dist/esm/admiralty-type-ahead.entry.js.map +0 -1
  89. package/dist/types/components/type-ahead/type-ahead.d.ts +0 -72
  90. package/dist/types/components/type-ahead-item/type-ahead-item.d.ts +0 -4
@@ -1 +1 @@
1
- {"file":"admiralty-autocomplete.entry.cjs.js","mappings":";;;;;;AAAO,MAAM,eAAe,GAAG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AAC,OAAO,CAAC,MAAM,GACjC,EACF;SACH,CAAC,EAED,kBAAkB,IAAIC,iEAAI,KAAK,EAAE,GAAG,eAAe,IAAI,eAAe,cAAc,uBAAuB,CACzG,EAELA,mEAAM,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAClD,IAAI,CAAC,aAAa,CACd,EACN,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,KAClCA,sFAAyB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,GAAG,SAAS,GAAG,QAAQ,EAAE,IACpH,IAAI,CAAC,cAAc,CACI,CAC3B,CACG,EACN;KACH;;;;;;;AAEH,IAAI,MAAM,GAAG,CAAC,CAAC;;;;;","names":["forceUpdate","index","h"],"sources":["src/components/autocomplete/optionsWatcher.ts","src/components/autocomplete/autocomplete.scss?tag=admiralty-autocomplete&encapsulation=scoped","src/components/autocomplete/autocomplete.tsx"],"sourcesContent":["export const watchForOptions = <T extends HTMLElement>(containerEl: HTMLElement, tagName: string, onChange: (el: T | undefined) => void) => {\n if (typeof MutationObserver === 'undefined') {\n return;\n }\n\n const mutation = new MutationObserver(mutationList => {\n onChange(getSelectedOption<T>(mutationList, tagName));\n });\n mutation.observe(containerEl, {\n childList: true,\n subtree: true,\n });\n return mutation;\n};\n\nconst getSelectedOption = <T extends HTMLElement>(mutationList: MutationRecord[], tagName: string): T | undefined => {\n let newOption: T | undefined;\n mutationList.forEach(mut => {\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < mut.addedNodes.length; i++) {\n newOption = findCheckedOption<T>(mut.addedNodes[i], tagName) || newOption;\n }\n });\n return newOption;\n};\n\n/**\n * The \"value\" key is only set on some components such as ion-select-option.\n * As a result, we create a default union type of HTMLElement and the \"value\" key.\n * However, implementers are required to provide the appropriate component type\n * such as HTMLIonSelectOptionElement.\n */\nexport const findCheckedOption = <T extends HTMLElement & { value?: any | null }>(node: Node, tagName: string) => {\n /**\n * https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\n * The above check ensures \"node\" is an Element (nodeType 1).\n */\n if (node.nodeType !== 1) {\n return undefined;\n }\n\n // HTMLElement inherits from Element, so we cast \"el\" as T.\n const el = node as T;\n\n const options: T[] = el.tagName === tagName.toUpperCase() ? [el] : Array.from(el.querySelectorAll(tagName));\n\n return options.find((o: T) => o.value === el.value);\n};\n","@import './autocomplete.vars';\n\n.autocomplete__wrapper {\n position: relative;\n}\n\n.autocomplete__hint,\n.autocomplete__input {\n appearance: none;\n border: 2px solid $autocomplete-input-border-colour;\n border-radius: 0; /* Safari 10 on iOS adds implicit border rounding. */\n box-sizing: border-box;\n color: $autocomplete-text-colour;\n margin-bottom: 0; /* BUG: Safari 10 on macOS seems to add an implicit margin. */\n line-height: 1.5;\n width: 100%;\n}\n\n.autocomplete__label {\n background-color: transparent;\n position: relative;\n font-size: $autocomplete-label-font-size;\n}\n\n.autocomplete__input {\n background-color: transparent;\n position: relative;\n}\n\n.autocomplete__hint {\n color: $autocomplete-text-colour;\n position: absolute;\n}\n\n.autocomplete__input-wrapper {\n position: relative;\n}\n\n.autocomplete__input--default {\n padding: 12px;\n}\n\n.autocomplete__input--focused {\n outline: 3px solid $autocomplete-focus-colour;\n outline-offset: 0;\n box-shadow: inset 0 0 0 2px $autocomplete-text-colour;\n}\n\n.autocomplete__input--show-all-values {\n padding: 12px 35px 12px 12px; /* Space for arrow. Other padding should match .autocomplete__input--default. */\n cursor: pointer;\n}\n\n.autocomplete__input--invalid {\n border-color: $autocomplete-error-border-colour;\n}\n\n.autocomplete__input--disabled {\n border-color: $autocomplete-disabled-border-colour;\n}\n\n.autocomplete__menu {\n background-color: $autocomplete-background-colour;\n border: 2px solid $autocomplete-input-border-colour;\n border-top: 0;\n color: $autocomplete-text-colour;\n margin: 0;\n max-height: 342px;\n overflow-x: hidden;\n padding: 0;\n width: 100%;\n width: calc(100% - 4px);\n}\n\n.autocomplete__menu--visible {\n display: block;\n}\n\n.autocomplete__menu--hidden {\n display: none;\n}\n\n.autocomplete__menu--overlay {\n box-shadow: rgba(0, 0, 0, 0.256863) 0px 2px 6px;\n left: 0;\n position: absolute;\n top: 100%;\n z-index: 100;\n}\n\n.autocomplete__menu--inline {\n position: relative;\n}\n\n.autocomplete__option {\n border-bottom: solid $autocomplete-option-border-colour;\n border-width: 1px 0;\n color: $autocomplete-text-colour;\n cursor: pointer;\n display: block;\n position: relative;\n margin-bottom: 0;\n}\n\n.autocomplete__option:before {\n content: none;\n}\n\n.autocomplete__option > * {\n pointer-events: none;\n}\n\n.autocomplete__option:first-of-type {\n border-top-width: 0;\n}\n\n.autocomplete__option:last-of-type {\n border-bottom-width: 0;\n}\n\n.autocomplete__option--focused,\n.autocomplete__option:hover {\n background-color: $autocomplete-option-hover-background-colour;\n border-color: $autocomplete-option-hover-background-colour;\n color: $autocomplete-option-hover-text-colour;\n outline: none;\n}\n\n.autocomplete__option--no-results {\n background-color: $autocomplete-option-no-results-background-colour;\n color: $autocomplete-option-no-results-text-colour;\n text-align: center;\n\n margin-top: 50px;\n margin-bottom: 50px;\n cursor: not-allowed;\n}\n.autocomplete__option--no-results:hover {\n background-color: $autocomplete-option-no-results-background-colour;\n border-color: $autocomplete-option-no-results-background-colour;\n color: $autocomplete-option-no-results-text-colour;\n text-align: center;\n\n margin-top: 50px;\n margin-bottom: 50px;\n cursor: not-allowed;\n}\n\n.autocomplete__hint,\n.autocomplete__input,\n.autocomplete__option {\n font-size: $autocomplete-option-font-size;\n font-weight: $autocomplete-option-font-weight;\n}\n\n.autocomplete__hint,\n.autocomplete__option {\n padding: 10px;\n}\n\n.autocomplete-down-icon {\n font-size: $autocomplete-icon-font-size;\n font-weight: $autocomplete-icon-font-weight;\n pointer-events: none;\n position: absolute;\n right: 12px;\n top: 14px;\n}\n\nadmiralty-icon.disabled {\n color: $autocomplete-dropdown-icon-colour;\n}\n\nadmiralty-input-invalid {\n margin-top: 6px;\n}\n","/**\n * This component takes heavy inspiration from the autocomplete component created by alphagov: https://github.com/alphagov/accessible-autocomplete\n */\n\nimport { Component, forceUpdate, Prop, State, h, Element, EventEmitter, Event, Watch } from '@stencil/core';\nimport { watchForOptions } from './optionsWatcher';\nimport { AutoCompleteChangeEventDetail } from './autocomplete.interface';\n\ninterface Option {\n text: string;\n value: any;\n}\n\nconst keyCodes = {\n 13: 'enter',\n 27: 'escape',\n 32: 'space',\n 38: 'up',\n 40: 'down',\n};\n\nfunction isIosDevice() {\n return typeof navigator !== 'undefined' && !!(navigator.userAgent.match(/(iPod|iPhone|iPad)/g) && navigator.userAgent.match(/AppleWebKit/g));\n}\n\nfunction isPrintableKeyCode(keyCode) {\n return (\n (keyCode > 47 && keyCode < 58) || // number keys\n keyCode === 32 ||\n keyCode === 8 || // spacebar or backspace\n (keyCode > 64 && keyCode < 91) || // letter keys\n (keyCode > 95 && keyCode < 112) || // numpad keys\n (keyCode > 185 && keyCode < 193) || // ;=,-./` (in order)\n (keyCode > 218 && keyCode < 223) // [\\]' (in order)\n );\n}\n\nfunction filterOptions(options: Option[], searchTerm: string) {\n return options.filter(({ text }) => text.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1);\n}\n\nfunction filterOptionsByValue(options: Option[], searchTerm: string) {\n return options.filter(({ value }) => value.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1);\n}\n\n@Component({\n tag: 'admiralty-autocomplete',\n styleUrl: 'autocomplete.scss',\n scoped: true,\n})\nexport class AutocompleteComponent {\n private internalId = ++nextId;\n\n @Element() el!: HTMLAdmiraltyAutocompleteElement;\n\n /**\n * Automatically select the first matching option.\n */\n @Prop() autoselect: boolean = false;\n /**\n * The default CSS namespace.\n */\n @Prop() cssNamespace: string = 'autocomplete';\n /**\n * When set to `overlay` this option will display the menu as an absolutely positioned overlay instead of inline.\n */\n @Prop() displayMenu: string = 'inline';\n /**\n * Prevent displaying options until the minimum string length is reached. Ignored when show all values is enabled.\n */\n @Prop() minLength: number = 0;\n /**\n * The name for the `<input>` element.\n */\n @Prop() name: string;\n /**\n * Populate the placeholder attribute on the `<input>` element.\n */\n @Prop() placeholder: string = '';\n /**\n * Toggle automatically confirming a selection when the field is blurred.\n */\n @Prop() confirmOnBlur: boolean = true;\n /**\n * Toggle whether to display the \"No results found\" message.\n */\n @Prop() showNoOptionsFound: boolean = true;\n /**\n * Toggle showing all values when the input is clicked, like a default dropdown.\n */\n @Prop() showAllValues: boolean = true;\n /**\n * Populates the required field on the `<input>` element.\n */\n @Prop() required: boolean = false;\n /**\n * The hint that is provided to assistive users.\n */\n @Prop() assistiveHint: string =\n 'When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.';\n\n /**\n * Sets HTML attributes and their values on the generated `ul` menu element. Useful for adding `aria-labelledby`\n * and setting to the value of the `id` attribute on your existing label, to provide context to an assistive\n * technology user. e.g.\n * ```\n * const menuAttributes = {\n * className: 'custom-className',\n * class: 'custom-class',\n * id: 'custom-id',\n * role: 'custom-role'\n * }\n * ```\n * */\n @Prop() menuAttributes: any;\n /**\n * Classes to add to the component's `<input>` element.\n */\n @Prop() inputClasses: string;\n /**\n * Classes to add to the menu displaying the options.\n */\n @Prop() menuClasses: string;\n /**\n * The text that will be used as a field label.\n */\n @Prop() label: string = null;\n /**\n * TThe text which will be used under the label to describe the input.\n */\n @Prop() hint: string = null;\n /**\n * Whether to show that the component is in an invalid state.\n */\n @Prop() invalid: boolean = false;\n /**\n * The message to show when the component is invalid.\n */\n @Prop() invalidMessage: string = null;\n /**\n * When `true`, the component cannot be interacted with.\n */\n @Prop() disabled: boolean = false;\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = null;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() admiraltyChange: EventEmitter<AutoCompleteChangeEventDetail>;\n\n elementReferences = {};\n $pollInput: NodeJS.Timeout;\n\n source: Option[] = [];\n\n @State() focused: number | null = null;\n @State() hovered: number | null = null;\n @State() menuOpen: boolean = false;\n @State() options: Option[] = [];\n @State() option: Option = null;\n @State() query: string = null;\n @State() validChoiceMade: boolean = false;\n @State() selected: number | null = null;\n @State() ariaHint: boolean = true;\n\n @Watch('value')\n onValueChange(newVal: string, _: string) {\n if (this.source.length === 0) {\n // If this is the initial render, the options won't have been set yet, so do nothing\n return;\n }\n if (newVal && newVal.length > 0) {\n const matches = filterOptionsByValue(this.source, newVal);\n const matchFound = matches.length > 0;\n this.options = matches;\n this.validChoiceMade = matchFound;\n this.option = matches[0];\n this.query = matchFound ? matches[0].text : '';\n this.menuOpen = false;\n this.ariaHint = false;\n } else {\n this.options = [];\n this.option = null;\n this.query = '';\n this.ariaHint = true;\n }\n\n this.admiraltyChange.emit({ value: this.option?.value ?? '' });\n }\n\n @Watch('focused')\n onFocusedChange(newVal: number | null, oldVal: number | null) {\n const componentLostFocus = this.focused === null;\n const focusedChanged = oldVal !== newVal;\n const focusDifferentElement = focusedChanged && !componentLostFocus;\n if (focusDifferentElement) {\n this.elementReferences[this.focused]?.focus();\n }\n const focusedInput = this.focused === -1;\n const componentGainedFocus = focusedChanged && oldVal === null;\n const selectAllText = focusedInput && componentGainedFocus;\n if (selectAllText) {\n const inputElement = this.elementReferences[this.focused];\n inputElement.setSelectionRange(0, inputElement.value.length);\n }\n }\n\n isQueryAnOption(query: string, options: Option[]) {\n return options.map(({ text }) => this.templateInputValue(text).toLowerCase()).indexOf(query.toLowerCase()) !== -1;\n }\n\n connectedCallback() {\n this.mutation = watchForOptions<HTMLAdmiraltyAutocompleteOptionElement>(this.el, 'admiralty-autocomplete-option', async () => {\n this.source = this.childOpts.map(({ textContent, value }) => ({\n text: textContent?.length > 0 ? textContent : value,\n value: value ?? textContent,\n }));\n if (this.query === null && this.value?.length > 0) {\n const matches = filterOptionsByValue(this.source, this.value);\n this.options = matches;\n this.option = matches[0];\n this.query = matches[0]?.text ?? '';\n }\n forceUpdate(this);\n });\n // this.pollInputElement();\n }\n\n disconnectedCallback() {\n clearTimeout(this.$pollInput);\n }\n\n // Applications like Dragon NaturallySpeaking will modify the\n // `input` field by directly changing its `.value`. These events\n // don't trigger our JavaScript event listeners, so we need to poll\n // to handle when and if they occur.\n pollInputElement() {\n this.getDirectInputChanges();\n this.$pollInput = setTimeout(() => {\n this.pollInputElement();\n }, 100);\n }\n\n getDirectInputChanges() {\n const inputReference = this.elementReferences[-1];\n const queryHasChanged = inputReference && inputReference.value !== this.query;\n\n if (queryHasChanged) {\n this.handleInputChange({ target: { value: inputReference.value } });\n }\n }\n\n mutation: MutationObserver;\n\n private get childOpts() {\n return Array.from(this.el.querySelectorAll('admiralty-autocomplete-option'));\n }\n\n hasAutoselect() {\n return isIosDevice() ? false : this.autoselect;\n }\n\n // This template is used when converting from a state.options object into a state.query.\n templateInputValue(value) {\n // const inputValueTemplate = this.templates && this.templates.inputValue;\n // return inputValueTemplate ? inputValueTemplate(value) : value;\n return value;\n }\n\n // This template is used when displaying results / suggestions.\n templateSuggestion(value) {\n // const suggestionTemplate = this.templates && this.templates.suggestion;\n // return suggestionTemplate ? suggestionTemplate(value) : value;\n return value;\n }\n\n handleComponentBlur(newState: { menuOpen: boolean; query: string }) {\n let newQuery: string;\n if (this.confirmOnBlur) {\n newQuery = newState.query || this.query;\n const matches = filterOptions(this.source, newQuery);\n const matchFound = newQuery?.length > 0 && matches.length > 0;\n const option = matchFound ? matches[0] : { value: null, text: '' };\n this.value = option.value;\n } else {\n newQuery = this.query;\n }\n this.focused = null;\n this.menuOpen = newState.menuOpen || false;\n this.selected = null;\n this.validChoiceMade = this.isQueryAnOption(newQuery, this.options);\n }\n\n handleListMouseLeave() {\n this.hovered = null;\n }\n\n handleOptionBlur(event, index) {\n const focusingOutsideComponent = event.relatedTarget === null;\n const focusingInput = event.relatedTarget === this.elementReferences[-1];\n const focusingAnotherOption = this.focused !== index && this.focused !== -1;\n const blurComponent = (!focusingAnotherOption && focusingOutsideComponent) || !(focusingAnotherOption || focusingInput);\n if (blurComponent) {\n const keepMenuOpen = this.menuOpen && isIosDevice();\n this.handleComponentBlur({\n menuOpen: keepMenuOpen,\n query: this.templateInputValue(this.options[this.selected]?.text ?? ''),\n });\n }\n }\n\n handleInputBlur(_) {\n const focusingAnOption = this.focused !== -1;\n if (!focusingAnOption) {\n const keepMenuOpen = this.menuOpen && isIosDevice();\n this.handleComponentBlur({\n menuOpen: keepMenuOpen,\n query: this.query,\n });\n }\n }\n\n handleInputChange(event) {\n const autoselect = this.hasAutoselect();\n const query = event.target.value;\n const queryEmpty = query.length === 0;\n const queryChanged = this.query !== query;\n const queryLongEnough = query.length >= this.minLength;\n\n this.query = query;\n this.ariaHint = queryEmpty;\n\n const searchForOptions = this.showAllValues || (!queryEmpty && queryChanged && queryLongEnough);\n if (searchForOptions) {\n const matches = filterOptions(this.source, this.query);\n const optionsAvailable = matches.length > 0;\n this.menuOpen = optionsAvailable;\n this.options = matches;\n this.selected = autoselect && optionsAvailable ? 0 : -1;\n this.validChoiceMade = false;\n } else if (queryEmpty || !queryLongEnough) {\n this.menuOpen = false;\n this.options = [];\n }\n }\n\n handleInputClick(event) {\n this.handleInputChange(event);\n }\n\n handleInputFocus(_) {\n const shouldReopenMenu = !this.validChoiceMade && this.query?.length >= this.minLength && this.options.length > 0;\n\n if (shouldReopenMenu) {\n this.focused = -1;\n this.menuOpen = shouldReopenMenu || this.menuOpen;\n this.selected = -1;\n } else {\n this.focused = -1;\n }\n }\n\n handleOptionFocus(index) {\n this.focused = index;\n this.hovered = null;\n this.selected = index;\n }\n\n handleOptionMouseEnter(index) {\n // iOS Safari prevents click event if mouseenter adds hover background colour\n // See: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW4\n if (!isIosDevice()) {\n this.hovered = index;\n }\n }\n\n handleOptionClick(_, index) {\n const selectedOption = this.options[index];\n this.value = selectedOption.value;\n this.focused = -1;\n this.hovered = null;\n this.menuOpen = false;\n this.selected = index;\n this.validChoiceMade = true;\n forceUpdate(this);\n }\n\n handleOptionMouseDown(event) {\n // Safari triggers focusOut before click, but if you\n // preventDefault on mouseDown, you can stop that from happening.\n // If this is removed, clicking on an option in Safari will trigger\n // `handleOptionBlur`, which closes the menu, and the click will\n // trigger on the element underneath instead.\n // See: http://stackoverflow.com/questions/7621711/how-to-prevent-blur-running-when-clicking-a-link-in-jquery\n event.preventDefault();\n }\n\n handleUpArrow(event) {\n event.preventDefault();\n const isNotAtTop = this.selected !== -1;\n const allowMoveUp = isNotAtTop && this.menuOpen;\n if (allowMoveUp) {\n this.handleOptionFocus(this.selected - 1);\n }\n }\n\n handleDownArrow(event) {\n event.preventDefault();\n // if not open, open\n if (this.showAllValues && this.menuOpen === false) {\n event.preventDefault();\n const matches = filterOptions(this.source, '');\n this.menuOpen = true;\n this.options = matches;\n this.selected = 0;\n this.focused = 0;\n this.hovered = null;\n } else if (this.menuOpen === true) {\n const isNotAtBottom = this.selected !== this.options.length - 1;\n const allowMoveDown = isNotAtBottom && this.menuOpen;\n if (allowMoveDown) {\n this.handleOptionFocus(this.selected + 1);\n }\n }\n }\n\n handleSpace(event) {\n // if not open, open\n if (this.showAllValues && this.menuOpen === false && this.query === '') {\n event.preventDefault();\n const matches = filterOptions(this.source, '');\n this.menuOpen = true;\n this.options = matches;\n }\n const focusIsOnOption = this.focused !== -1;\n if (focusIsOnOption) {\n event.preventDefault();\n this.handleOptionClick(event, this.focused);\n }\n }\n\n handleEnter(event) {\n if (this.menuOpen) {\n event.preventDefault();\n const hasSelectedOption = this.selected >= 0;\n if (hasSelectedOption) {\n this.handleOptionClick(event, this.selected);\n }\n }\n }\n\n handlePrintableKey(event) {\n const inputElement = this.elementReferences[-1];\n const eventIsOnInput = event.target === inputElement;\n if (!eventIsOnInput) {\n // FIXME: This would be better if it was in componentDidUpdate,\n // but using setState to trigger that seems to not work correctly\n // in preact@8.1.0.\n inputElement.focus();\n }\n }\n\n handleKeyDown(event) {\n switch (keyCodes[event.keyCode]) {\n case 'up':\n this.handleUpArrow(event);\n break;\n case 'down':\n this.handleDownArrow(event);\n break;\n case 'space':\n this.handleSpace(event);\n break;\n case 'enter':\n this.handleEnter(event);\n break;\n case 'escape':\n this.handleComponentBlur({\n query: this.query,\n menuOpen: this.menuOpen,\n });\n break;\n default:\n if (isPrintableKeyCode(event.keyCode)) {\n this.handlePrintableKey(event);\n }\n break;\n }\n }\n\n render() {\n const id = this.el.id != '' ? this.el.id : `admiralty-autocomplete-${this.internalId}`;\n const inputId = `${id}-input`;\n const hintId = `${id}-hint`;\n const errorId = `${id}-error`;\n\n const inputFocused = this.focused === -1;\n const noOptionsAvailable = this.options.length === 0;\n const queryNotEmpty = this.query?.length !== 0;\n const queryLongEnough = this.query?.length >= this.minLength;\n const showNoOptionsFound = this.showNoOptionsFound && inputFocused && noOptionsAvailable && queryNotEmpty && queryLongEnough;\n\n const wrapperClassName = `${this.cssNamespace}__wrapper`;\n const optionFocused = this.focused !== -1 && this.focused !== null;\n\n const optionClassName = `${this.cssNamespace}__option`;\n\n const assistiveHintID = id + '__assistiveHint';\n const ariaProps = {\n 'aria-describedby': `${this.hint ? hintId : ''} ${this.ariaHint ? assistiveHintID : ''} ${this.invalid ? errorId : ''}`,\n 'aria-expanded': this.menuOpen ? 'true' : 'false',\n 'aria-activedescendant': optionFocused ? `${id}__option--${this.focused}` : null,\n 'aria-owns': `${id}__listbox`,\n 'aria-autocomplete': this.hasAutoselect() ? 'both' : 'list',\n };\n\n const inputClassName = `${this.cssNamespace}__input`;\n const inputClassList = [inputClassName, this.showAllValues ? `${inputClassName}--show-all-values` : `${inputClassName}--default`];\n\n const componentIsFocused = this.focused !== null;\n if (componentIsFocused) {\n inputClassList.push(`${inputClassName}--focused`);\n }\n\n if (this.inputClasses) {\n inputClassList.push(this.inputClasses);\n }\n\n if (this.invalid && this.invalidMessage) {\n inputClassList.push(`${inputClassName}--invalid`);\n }\n\n if (this.disabled) {\n inputClassList.push(`${inputClassName}--disabled`);\n }\n\n const menuClassName = `${this.cssNamespace}__menu`;\n const menuModifierDisplayMenu = `${menuClassName}--${this.displayMenu}`;\n const menuIsVisible = this.menuOpen || showNoOptionsFound;\n const menuModifierVisibility = `${menuClassName}--${menuIsVisible ? 'visible' : 'hidden'}`;\n\n const menuClassList = [menuClassName, menuModifierDisplayMenu, menuModifierVisibility];\n\n if (this.menuClasses) {\n menuClassList.push(this.menuClasses);\n }\n\n if (this.menuAttributes?.class || this.menuAttributes?.className) {\n menuClassList.push(this.menuAttributes?.class || this.menuAttributes?.className);\n }\n\n const computedMenuAttributes = {\n // Copy the attributes passed as props\n ...this.menuAttributes,\n // And add the values computed for the autocomplete\n id: `${id}__listbox`,\n role: 'listbox',\n onMouseLeave: this.handleListMouseLeave,\n };\n\n // Preact would override our computed `className`\n // with the `class` from the `menuAttributes` so\n // we need to clean it up from the computed attributes\n delete computedMenuAttributes.class;\n\n return (\n <div class={wrapperClassName} onKeyDown={event => this.handleKeyDown(event)}>\n {this.label ? (\n <admiralty-label class=\"autocomplete__label\" disabled={this.disabled} for={inputId}>\n {this.label}\n </admiralty-label>\n ) : null}\n {this.hint ? (\n <admiralty-hint id={hintId} disabled={this.disabled}>\n {this.hint}\n </admiralty-hint>\n ) : null}\n <div class=\"autocomplete__input-wrapper\">\n <input\n {...ariaProps}\n disabled={this.disabled}\n aria-disabled={this.disabled}\n autoComplete=\"off\"\n class={inputClassList.join(' ')}\n id={inputId}\n onClick={event => this.handleInputClick(event)}\n onBlur={event => this.handleInputBlur(event)}\n onInput={event => this.handleInputChange(event)}\n onFocus={event => this.handleInputFocus(event)}\n name={this.name}\n placeholder={this.placeholder}\n ref={inputElement => {\n this.elementReferences[-1] = inputElement;\n }}\n type=\"text\"\n role=\"combobox\"\n required={this.required}\n value={this.query}\n />\n <admiralty-icon class={`autocomplete-down-icon ${this.disabled ? 'disabled' : ''}`} icon-name={this.menuOpen || showNoOptionsFound ? 'angle-up' : 'angle-down'} />\n </div>\n\n <ul {...computedMenuAttributes} class={menuClassList.join(' ')}>\n {this.options.map((option, index) => {\n const showFocused = this.focused === -1 ? this.selected === index : this.focused === index;\n const optionModifierFocused = showFocused && this.hovered === null ? ` ${optionClassName}--focused` : '';\n const iosPosinsetHtml = isIosDevice()\n ? `<span id=${id}__option-suffix--${index} style=\"border:0;clip:rect(0 0 0 0);height:1px;` +\n 'marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;' +\n 'whiteSpace:nowrap;width:1px\">' +\n ` ${index + 1} of ${this.options.length}</span>`\n : '';\n\n return (\n <li\n aria-selected={this.focused === index ? 'true' : 'false'}\n class={`${optionClassName}${optionModifierFocused}`}\n innerHTML={this.templateSuggestion(option.text) + iosPosinsetHtml}\n id={`${id}__option--${index}`}\n key={index}\n onBlur={event => this.handleOptionBlur(event, index)}\n onClick={event => this.handleOptionClick(event, index)}\n onMouseDown={event => this.handleOptionMouseDown(event)}\n onMouseEnter={() => this.handleOptionMouseEnter(index)}\n ref={optionEl => {\n this.elementReferences[index] = optionEl;\n }}\n role=\"option\"\n tabIndex={-1}\n aria-posinset={index + 1}\n aria-setsize={this.options.length}\n />\n );\n })}\n\n {showNoOptionsFound && <li class={`${optionClassName} ${optionClassName}--no-results`}>No results found</li>}\n </ul>\n\n <span id={assistiveHintID} style={{ display: 'none' }}>\n {this.assistiveHint}\n </span>\n {this.invalid && this.invalidMessage && (\n <admiralty-input-invalid id={errorId} style={{ visibility: this.invalid && this.invalidMessage ? 'visible' : 'hidden' }}>\n {this.invalidMessage}\n </admiralty-input-invalid>\n )}\n </div>\n );\n }\n}\nlet nextId = 0;\n"],"version":3}
1
+ {"file":"admiralty-autocomplete.entry.cjs.js","mappings":";;;;;;AAAO,MAAM,eAAe,GAAG,CAAwB,WAAwB,EAAE,OAAe,EAAE,QAAqC;IACrI,IAAI,OAAO,gBAAgB,KAAK,WAAW,EAAE;QAC3C,OAAO;KACR;IAED,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,Y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zG,EAELA,mEAAM,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAClD,IAAI,CAAC,aAAa,CACd,EACN,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,KAClCA,sFAAyB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,GAAG,SAAS,GAAG,QAAQ,EAAE,IACpH,IAAI,CAAC,cAAc,CACI,CAC3B,CACG,EACN;KACH;;;;;;;AAEH,IAAI,MAAM,GAAG,CAAC,CAAC;;;;;","names":["forceUpdate","index","h"],"sources":["src/components/autocomplete/optionsWatcher.ts","src/components/autocomplete/autocomplete.scss?tag=admiralty-autocomplete&encapsulation=scoped","src/components/autocomplete/autocomplete.tsx"],"sourcesContent":["export const watchForOptions = <T extends HTMLElement>(containerEl: HTMLElement, tagName: string, onChange: (el: T | undefined) => void) => {\n if (typeof MutationObserver === 'undefined') {\n return;\n }\n\n const mutation = new MutationObserver(mutationList => {\n onChange(getSelectedOption<T>(mutationList, tagName));\n });\n mutation.observe(containerEl, {\n childList: true,\n subtree: true,\n });\n return mutation;\n};\n\nconst getSelectedOption = <T extends HTMLElement>(mutationList: MutationRecord[], tagName: string): T | undefined => {\n let newOption: T | undefined;\n mutationList.forEach(mut => {\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < mut.addedNodes.length; i++) {\n newOption = findCheckedOption<T>(mut.addedNodes[i], tagName) || newOption;\n }\n });\n return newOption;\n};\n\n/**\n * The \"value\" key is only set on some components such as ion-select-option.\n * As a result, we create a default union type of HTMLElement and the \"value\" key.\n * However, implementers are required to provide the appropriate component type\n * such as HTMLIonSelectOptionElement.\n */\nexport const findCheckedOption = <T extends HTMLElement & { value?: any | null }>(node: Node, tagName: string) => {\n /**\n * https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\n * The above check ensures \"node\" is an Element (nodeType 1).\n */\n if (node.nodeType !== 1) {\n return undefined;\n }\n\n // HTMLElement inherits from Element, so we cast \"el\" as T.\n const el = node as T;\n\n const options: T[] = el.tagName === tagName.toUpperCase() ? [el] : Array.from(el.querySelectorAll(tagName));\n\n return options.find((o: T) => o.value === el.value);\n};\n","@import './autocomplete.vars';\n\n.autocomplete__wrapper {\n position: relative;\n}\n\n.autocomplete__hint,\n.autocomplete__input {\n appearance: none;\n border: 2px solid $autocomplete-input-border-colour;\n border-radius: 0; /* Safari 10 on iOS adds implicit border rounding. */\n box-sizing: border-box;\n color: $autocomplete-text-colour;\n margin-bottom: 0; /* BUG: Safari 10 on macOS seems to add an implicit margin. */\n line-height: 1.5;\n width: 100%;\n}\n\n.autocomplete__label {\n background-color: transparent;\n position: relative;\n font-size: $autocomplete-label-font-size;\n}\n\n.autocomplete__input {\n background-color: transparent;\n position: relative;\n}\n\n.autocomplete__hint {\n color: $autocomplete-text-colour;\n position: absolute;\n}\n\n.autocomplete__input-wrapper {\n position: relative;\n}\n\n.autocomplete__input--default {\n padding: 12px;\n}\n\n.autocomplete__input--focused {\n outline: 3px solid $autocomplete-focus-colour;\n outline-offset: 0;\n box-shadow: inset 0 0 0 2px $autocomplete-text-colour;\n}\n\n.autocomplete__input--show-all-values {\n padding: 12px 35px 12px 12px; /* Space for arrow. Other padding should match .autocomplete__input--default. */\n cursor: pointer;\n}\n\n.autocomplete__input--invalid {\n border-color: $autocomplete-error-border-colour;\n}\n\n.autocomplete__input--disabled {\n border-color: $autocomplete-disabled-border-colour;\n}\n\n.autocomplete__menu {\n background-color: $autocomplete-background-colour;\n border: 2px solid $autocomplete-input-border-colour;\n border-top: 0;\n color: $autocomplete-text-colour;\n margin: 0;\n max-height: 342px;\n overflow-x: hidden;\n padding: 0;\n width: 100%;\n width: calc(100% - 4px);\n}\n\n.autocomplete__menu--visible {\n display: block;\n}\n\n.autocomplete__menu--hidden {\n display: none;\n}\n\n.autocomplete__menu--overlay {\n box-shadow: rgba(0, 0, 0, 0.256863) 0px 2px 6px;\n left: 0;\n position: absolute;\n top: 100%;\n z-index: 100;\n}\n\n.autocomplete__menu--inline {\n position: relative;\n}\n\n.autocomplete__option {\n border-bottom: solid $autocomplete-option-border-colour;\n border-width: 1px 0;\n color: $autocomplete-text-colour;\n cursor: pointer;\n display: block;\n position: relative;\n margin-bottom: 0;\n}\n\n.autocomplete__option:before {\n content: none;\n}\n\n.autocomplete__option > * {\n pointer-events: none;\n}\n\n.autocomplete__option:first-of-type {\n border-top-width: 0;\n}\n\n.autocomplete__option:last-of-type {\n border-bottom-width: 0;\n}\n\n.autocomplete__option--focused,\n.autocomplete__option:hover {\n background-color: $autocomplete-option-hover-background-colour;\n border-color: $autocomplete-option-hover-background-colour;\n color: $autocomplete-option-hover-text-colour;\n outline: none;\n}\n\n.autocomplete__option--no-results {\n background-color: $autocomplete-option-no-results-background-colour;\n color: $autocomplete-option-no-results-text-colour;\n text-align: center;\n\n margin-top: 50px;\n margin-bottom: 50px;\n cursor: not-allowed;\n}\n.autocomplete__option--no-results:hover {\n background-color: $autocomplete-option-no-results-background-colour;\n border-color: $autocomplete-option-no-results-background-colour;\n color: $autocomplete-option-no-results-text-colour;\n text-align: center;\n\n margin-top: 50px;\n margin-bottom: 50px;\n cursor: not-allowed;\n}\n\n.autocomplete__hint,\n.autocomplete__input,\n.autocomplete__option {\n font-size: $autocomplete-option-font-size;\n font-weight: $autocomplete-option-font-weight;\n}\n\n.autocomplete__hint,\n.autocomplete__option {\n padding: 10px;\n}\n\n.autocomplete-down-icon {\n font-size: $autocomplete-icon-font-size;\n font-weight: $autocomplete-icon-font-weight;\n pointer-events: none;\n position: absolute;\n right: 12px;\n top: 14px;\n}\n\nadmiralty-icon.disabled {\n color: $autocomplete-dropdown-icon-colour;\n}\n\nadmiralty-input-invalid {\n margin-top: 6px;\n}\n","/**\n * This component takes heavy inspiration from the autocomplete component created by alphagov: https://github.com/alphagov/accessible-autocomplete\n */\n\nimport { Component, forceUpdate, Prop, State, h, Element, EventEmitter, Event, Watch } from '@stencil/core';\nimport { watchForOptions } from './optionsWatcher';\nimport { AutoCompleteChangeEventDetail } from './autocomplete.interface';\n\ninterface Option {\n text: string;\n value: any;\n}\n\nconst keyCodes = {\n 13: 'enter',\n 27: 'escape',\n 32: 'space',\n 38: 'up',\n 40: 'down',\n};\n\nfunction isIosDevice() {\n return typeof navigator !== 'undefined' && !!(navigator.userAgent.match(/(iPod|iPhone|iPad)/g) && navigator.userAgent.match(/AppleWebKit/g));\n}\n\nfunction isPrintableKeyCode(keyCode) {\n return (\n (keyCode > 47 && keyCode < 58) || // number keys\n keyCode === 32 ||\n keyCode === 8 || // spacebar or backspace\n (keyCode > 64 && keyCode < 91) || // letter keys\n (keyCode > 95 && keyCode < 112) || // numpad keys\n (keyCode > 185 && keyCode < 193) || // ;=,-./` (in order)\n (keyCode > 218 && keyCode < 223) // [\\]' (in order)\n );\n}\n\nfunction filterOptions(options: Option[], searchTerm: string) {\n return options.filter(({ text }) => text.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1);\n}\n\nfunction filterOptionsByValue(options: Option[], searchTerm: string) {\n return options.filter(({ value }) => value.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1);\n}\n\n@Component({\n tag: 'admiralty-autocomplete',\n styleUrl: 'autocomplete.scss',\n scoped: true,\n})\nexport class AutocompleteComponent {\n private internalId = ++nextId;\n\n @Element() el!: HTMLAdmiraltyAutocompleteElement;\n\n /**\n * Automatically select the first matching option.\n */\n @Prop() autoselect: boolean = false;\n /**\n * The default CSS namespace.\n */\n @Prop() cssNamespace: string = 'autocomplete';\n /**\n * When set to `overlay` this option will display the menu as an absolutely positioned overlay instead of inline.\n */\n @Prop() displayMenu: string = 'inline';\n /**\n * Prevent displaying options until the minimum string length is reached. Ignored when show all values is enabled.\n */\n @Prop() minLength: number = 0;\n /**\n * The name for the `<input>` element.\n */\n @Prop() name: string;\n /**\n * Populate the placeholder attribute on the `<input>` element.\n */\n @Prop() placeholder: string = '';\n /**\n * Toggle automatically confirming a selection when the field is blurred.\n */\n @Prop() confirmOnBlur: boolean = true;\n /**\n * Toggle whether to display the \"No results found\" message.\n */\n @Prop() showNoOptionsFound: boolean = true;\n /**\n * Toggle showing all values when the input is clicked, like a default dropdown. This will hide the chevron when set to false.\n */\n @Prop() showAllValues: boolean = true;\n /**\n * Populates the required field on the `<input>` element.\n */\n @Prop() required: boolean = false;\n /**\n * The hint that is provided to assistive users.\n */\n @Prop() assistiveHint: string =\n 'When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.';\n\n /**\n * Sets HTML attributes and their values on the generated `ul` menu element. Useful for adding `aria-labelledby`\n * and setting to the value of the `id` attribute on your existing label, to provide context to an assistive\n * technology user. e.g.\n * ```\n * const menuAttributes = {\n * className: 'custom-className',\n * class: 'custom-class',\n * id: 'custom-id',\n * role: 'custom-role'\n * }\n * ```\n * */\n @Prop() menuAttributes: any;\n /**\n * Classes to add to the component's `<input>` element.\n */\n @Prop() inputClasses: string;\n /**\n * Classes to add to the menu displaying the options.\n */\n @Prop() menuClasses: string;\n /**\n * The text that will be used as a field label.\n */\n @Prop() label: string = null;\n /**\n * TThe text which will be used under the label to describe the input.\n */\n @Prop() hint: string = null;\n /**\n * Whether to show that the component is in an invalid state.\n */\n @Prop() invalid: boolean = false;\n /**\n * The message to show when the component is invalid.\n */\n @Prop() invalidMessage: string = null;\n /**\n * When `true`, the component cannot be interacted with.\n */\n @Prop() disabled: boolean = false;\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = null;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() admiraltyChange: EventEmitter<AutoCompleteChangeEventDetail>;\n\n elementReferences = {};\n $pollInput: NodeJS.Timeout;\n\n source: Option[] = [];\n\n @State() focused: number | null = null;\n @State() hovered: number | null = null;\n @State() menuOpen: boolean = false;\n @State() options: Option[] = [];\n @State() option: Option = null;\n @State() query: string = null;\n @State() validChoiceMade: boolean = false;\n @State() selected: number | null = null;\n @State() ariaHint: boolean = true;\n\n @Watch('value')\n onValueChange(newVal: string, _: string) {\n if (this.source.length === 0) {\n // If this is the initial render, the options won't have been set yet, so do nothing\n return;\n }\n if (newVal && newVal.length > 0) {\n const matches = filterOptionsByValue(this.source, newVal);\n const matchFound = matches.length > 0;\n this.options = matches;\n this.validChoiceMade = matchFound;\n this.option = matches[0];\n this.query = matchFound ? matches[0].text : '';\n this.menuOpen = false;\n this.ariaHint = false;\n } else {\n this.options = [];\n this.option = null;\n this.query = '';\n this.ariaHint = true;\n }\n\n this.admiraltyChange.emit({ value: this.option?.value ?? '' });\n }\n\n @Watch('focused')\n onFocusedChange(newVal: number | null, oldVal: number | null) {\n const componentLostFocus = this.focused === null;\n const focusedChanged = oldVal !== newVal;\n const focusDifferentElement = focusedChanged && !componentLostFocus;\n if (focusDifferentElement) {\n this.elementReferences[this.focused]?.focus();\n }\n const focusedInput = this.focused === -1;\n const componentGainedFocus = focusedChanged && oldVal === null;\n const selectAllText = focusedInput && componentGainedFocus;\n if (selectAllText) {\n const inputElement = this.elementReferences[this.focused];\n inputElement.setSelectionRange(0, inputElement.value.length);\n }\n }\n\n isQueryAnOption(query: string, options: Option[]) {\n return options.map(({ text }) => this.templateInputValue(text).toLowerCase()).indexOf(query.toLowerCase()) !== -1;\n }\n\n connectedCallback() {\n this.mutation = watchForOptions<HTMLAdmiraltyAutocompleteOptionElement>(this.el, 'admiralty-autocomplete-option', async () => {\n this.source = this.childOpts.map(({ textContent, value }) => ({\n text: textContent?.length > 0 ? textContent : value,\n value: value ?? textContent,\n }));\n if (this.query === null && this.value?.length > 0) {\n const matches = filterOptionsByValue(this.source, this.value);\n this.options = matches;\n this.option = matches[0];\n this.query = matches[0]?.text ?? '';\n }\n forceUpdate(this);\n });\n // this.pollInputElement();\n }\n\n disconnectedCallback() {\n clearTimeout(this.$pollInput);\n }\n\n // Applications like Dragon NaturallySpeaking will modify the\n // `input` field by directly changing its `.value`. These events\n // don't trigger our JavaScript event listeners, so we need to poll\n // to handle when and if they occur.\n pollInputElement() {\n this.getDirectInputChanges();\n this.$pollInput = setTimeout(() => {\n this.pollInputElement();\n }, 100);\n }\n\n getDirectInputChanges() {\n const inputReference = this.elementReferences[-1];\n const queryHasChanged = inputReference && inputReference.value !== this.query;\n\n if (queryHasChanged) {\n this.handleInputChange({ target: { value: inputReference.value } });\n }\n }\n\n mutation: MutationObserver;\n\n private get childOpts() {\n return Array.from(this.el.querySelectorAll('admiralty-autocomplete-option'));\n }\n\n hasAutoselect() {\n return isIosDevice() ? false : this.autoselect;\n }\n\n // This template is used when converting from a state.options object into a state.query.\n templateInputValue(value) {\n // const inputValueTemplate = this.templates && this.templates.inputValue;\n // return inputValueTemplate ? inputValueTemplate(value) : value;\n return value;\n }\n\n // This template is used when displaying results / suggestions.\n templateSuggestion(value) {\n // const suggestionTemplate = this.templates && this.templates.suggestion;\n // return suggestionTemplate ? suggestionTemplate(value) : value;\n return value;\n }\n\n handleComponentBlur(newState: { menuOpen: boolean; query: string }) {\n let newQuery: string;\n if (this.confirmOnBlur) {\n newQuery = newState.query || this.query;\n const matches = filterOptions(this.source, newQuery);\n const matchFound = newQuery?.length > 0 && matches.length > 0;\n const option = matchFound ? matches[0] : { value: null, text: '' };\n this.value = option.value;\n } else {\n newQuery = this.query;\n }\n this.focused = null;\n this.menuOpen = newState.menuOpen || false;\n this.selected = null;\n this.validChoiceMade = this.isQueryAnOption(newQuery, this.options);\n }\n\n handleListMouseLeave() {\n this.hovered = null;\n }\n\n handleOptionBlur(event, index) {\n const focusingOutsideComponent = event.relatedTarget === null;\n const focusingInput = event.relatedTarget === this.elementReferences[-1];\n const focusingAnotherOption = this.focused !== index && this.focused !== -1;\n const blurComponent = (!focusingAnotherOption && focusingOutsideComponent) || !(focusingAnotherOption || focusingInput);\n if (blurComponent) {\n const keepMenuOpen = this.menuOpen && isIosDevice();\n this.handleComponentBlur({\n menuOpen: keepMenuOpen,\n query: this.templateInputValue(this.options[this.selected]?.text ?? ''),\n });\n }\n }\n\n handleInputBlur(_) {\n const focusingAnOption = this.focused !== -1;\n if (!focusingAnOption) {\n const keepMenuOpen = this.menuOpen && isIosDevice();\n this.handleComponentBlur({\n menuOpen: keepMenuOpen,\n query: this.query,\n });\n }\n }\n\n handleInputChange(event) {\n const autoselect = this.hasAutoselect();\n const query = event.target.value;\n const queryEmpty = query.length === 0;\n const queryChanged = this.query !== query;\n const queryLongEnough = query.length >= this.minLength;\n\n this.query = query;\n this.ariaHint = queryEmpty;\n\n const searchForOptions = this.showAllValues || (!queryEmpty && queryChanged && queryLongEnough);\n if (searchForOptions) {\n const matches = filterOptions(this.source, this.query);\n const optionsAvailable = matches.length > 0;\n this.menuOpen = optionsAvailable;\n this.options = matches;\n this.selected = autoselect && optionsAvailable ? 0 : -1;\n this.validChoiceMade = false;\n } else if (queryEmpty || !queryLongEnough) {\n this.menuOpen = false;\n this.options = [];\n }\n }\n\n handleInputClick(event) {\n this.handleInputChange(event);\n }\n\n handleInputFocus(_) {\n const shouldReopenMenu = !this.validChoiceMade && this.query?.length >= this.minLength && this.options.length > 0;\n\n if (shouldReopenMenu) {\n this.focused = -1;\n this.menuOpen = shouldReopenMenu || this.menuOpen;\n this.selected = -1;\n } else {\n this.focused = -1;\n }\n }\n\n handleOptionFocus(index) {\n this.focused = index;\n this.hovered = null;\n this.selected = index;\n }\n\n handleOptionMouseEnter(index) {\n // iOS Safari prevents click event if mouseenter adds hover background colour\n // See: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW4\n if (!isIosDevice()) {\n this.hovered = index;\n }\n }\n\n handleOptionClick(_, index) {\n const selectedOption = this.options[index];\n this.value = selectedOption.value;\n this.focused = -1;\n this.hovered = null;\n this.menuOpen = false;\n this.selected = index;\n this.validChoiceMade = true;\n forceUpdate(this);\n }\n\n handleOptionMouseDown(event) {\n // Safari triggers focusOut before click, but if you\n // preventDefault on mouseDown, you can stop that from happening.\n // If this is removed, clicking on an option in Safari will trigger\n // `handleOptionBlur`, which closes the menu, and the click will\n // trigger on the element underneath instead.\n // See: http://stackoverflow.com/questions/7621711/how-to-prevent-blur-running-when-clicking-a-link-in-jquery\n event.preventDefault();\n }\n\n handleUpArrow(event) {\n event.preventDefault();\n const isNotAtTop = this.selected !== -1;\n const allowMoveUp = isNotAtTop && this.menuOpen;\n if (allowMoveUp) {\n this.handleOptionFocus(this.selected - 1);\n }\n }\n\n handleDownArrow(event) {\n event.preventDefault();\n // if not open, open\n if (this.showAllValues && this.menuOpen === false) {\n event.preventDefault();\n const matches = filterOptions(this.source, '');\n this.menuOpen = true;\n this.options = matches;\n this.selected = 0;\n this.focused = 0;\n this.hovered = null;\n } else if (this.menuOpen === true) {\n const isNotAtBottom = this.selected !== this.options.length - 1;\n const allowMoveDown = isNotAtBottom && this.menuOpen;\n if (allowMoveDown) {\n this.handleOptionFocus(this.selected + 1);\n }\n }\n }\n\n handleSpace(event) {\n // if not open, open\n if (this.showAllValues && this.menuOpen === false && this.query === '') {\n event.preventDefault();\n const matches = filterOptions(this.source, '');\n this.menuOpen = true;\n this.options = matches;\n }\n const focusIsOnOption = this.focused !== -1;\n if (focusIsOnOption) {\n event.preventDefault();\n this.handleOptionClick(event, this.focused);\n }\n }\n\n handleEnter(event) {\n if (this.menuOpen) {\n event.preventDefault();\n const hasSelectedOption = this.selected >= 0;\n if (hasSelectedOption) {\n this.handleOptionClick(event, this.selected);\n }\n }\n }\n\n handlePrintableKey(event) {\n const inputElement = this.elementReferences[-1];\n const eventIsOnInput = event.target === inputElement;\n if (!eventIsOnInput) {\n // FIXME: This would be better if it was in componentDidUpdate,\n // but using setState to trigger that seems to not work correctly\n // in preact@8.1.0.\n inputElement.focus();\n }\n }\n\n handleKeyDown(event) {\n switch (keyCodes[event.keyCode]) {\n case 'up':\n this.handleUpArrow(event);\n break;\n case 'down':\n this.handleDownArrow(event);\n break;\n case 'space':\n this.handleSpace(event);\n break;\n case 'enter':\n this.handleEnter(event);\n break;\n case 'escape':\n this.handleComponentBlur({\n query: this.query,\n menuOpen: this.menuOpen,\n });\n break;\n default:\n if (isPrintableKeyCode(event.keyCode)) {\n this.handlePrintableKey(event);\n }\n break;\n }\n }\n\n render() {\n const id = this.el.id != '' ? this.el.id : `admiralty-autocomplete-${this.internalId}`;\n const inputId = `${id}-input`;\n const hintId = `${id}-hint`;\n const errorId = `${id}-error`;\n\n const inputFocused = this.focused === -1;\n const noOptionsAvailable = this.options.length === 0;\n const queryNotEmpty = this.query?.length !== 0;\n const queryLongEnough = this.query?.length >= this.minLength;\n const showNoOptionsFound = this.showNoOptionsFound && inputFocused && noOptionsAvailable && queryNotEmpty && queryLongEnough;\n\n const wrapperClassName = `${this.cssNamespace}__wrapper`;\n const optionFocused = this.focused !== -1 && this.focused !== null;\n\n const optionClassName = `${this.cssNamespace}__option`;\n\n const assistiveHintID = id + '__assistiveHint';\n const ariaProps = {\n 'aria-describedby': `${this.hint ? hintId : ''} ${this.ariaHint ? assistiveHintID : ''} ${this.invalid ? errorId : ''}`,\n 'aria-expanded': this.menuOpen ? 'true' : 'false',\n 'aria-activedescendant': optionFocused ? `${id}__option--${this.focused}` : null,\n 'aria-owns': `${id}__listbox`,\n 'aria-autocomplete': this.hasAutoselect() ? 'both' : 'list',\n };\n\n const inputClassName = `${this.cssNamespace}__input`;\n const inputClassList = [inputClassName, this.showAllValues ? `${inputClassName}--show-all-values` : `${inputClassName}--default`];\n\n const componentIsFocused = this.focused !== null;\n if (componentIsFocused) {\n inputClassList.push(`${inputClassName}--focused`);\n }\n\n if (this.inputClasses) {\n inputClassList.push(this.inputClasses);\n }\n\n if (this.invalid && this.invalidMessage) {\n inputClassList.push(`${inputClassName}--invalid`);\n }\n\n if (this.disabled) {\n inputClassList.push(`${inputClassName}--disabled`);\n }\n\n const menuClassName = `${this.cssNamespace}__menu`;\n const menuModifierDisplayMenu = `${menuClassName}--${this.displayMenu}`;\n const menuIsVisible = this.menuOpen || showNoOptionsFound;\n const menuModifierVisibility = `${menuClassName}--${menuIsVisible ? 'visible' : 'hidden'}`;\n\n const menuClassList = [menuClassName, menuModifierDisplayMenu, menuModifierVisibility];\n\n if (this.menuClasses) {\n menuClassList.push(this.menuClasses);\n }\n\n if (this.menuAttributes?.class || this.menuAttributes?.className) {\n menuClassList.push(this.menuAttributes?.class || this.menuAttributes?.className);\n }\n\n const computedMenuAttributes = {\n // Copy the attributes passed as props\n ...this.menuAttributes,\n // And add the values computed for the autocomplete\n id: `${id}__listbox`,\n role: 'listbox',\n onMouseLeave: this.handleListMouseLeave,\n };\n\n // Preact would override our computed `className`\n // with the `class` from the `menuAttributes` so\n // we need to clean it up from the computed attributes\n delete computedMenuAttributes.class;\n\n return (\n <div class={wrapperClassName} onKeyDown={event => this.handleKeyDown(event)}>\n {this.label ? (\n <admiralty-label class=\"autocomplete__label\" disabled={this.disabled} for={inputId}>\n {this.label}\n </admiralty-label>\n ) : null}\n {this.hint ? (\n <admiralty-hint id={hintId} disabled={this.disabled}>\n {this.hint}\n </admiralty-hint>\n ) : null}\n <div class=\"autocomplete__input-wrapper\">\n <input\n {...ariaProps}\n disabled={this.disabled}\n aria-disabled={this.disabled}\n autoComplete=\"off\"\n class={inputClassList.join(' ')}\n id={inputId}\n onClick={event => this.handleInputClick(event)}\n onBlur={event => this.handleInputBlur(event)}\n onInput={event => this.handleInputChange(event)}\n onFocus={event => this.handleInputFocus(event)}\n name={this.name}\n placeholder={this.placeholder}\n ref={inputElement => {\n this.elementReferences[-1] = inputElement;\n }}\n type=\"text\"\n role=\"combobox\"\n required={this.required}\n value={this.query}\n />\n {this.showAllValues &&\n <admiralty-icon class={`autocomplete-down-icon ${this.disabled ? \"disabled\" : \"\"}`} icon-name={this.menuOpen || showNoOptionsFound ? \"angle-up\" : \"angle-down\"} />\n }\n </div>\n\n <ul {...computedMenuAttributes} class={menuClassList.join(' ')}>\n {this.options.map((option, index) => {\n const showFocused = this.focused === -1 ? this.selected === index : this.focused === index;\n const optionModifierFocused = showFocused && this.hovered === null ? ` ${optionClassName}--focused` : '';\n const iosPosinsetHtml = isIosDevice()\n ? `<span id=${id}__option-suffix--${index} style=\"border:0;clip:rect(0 0 0 0);height:1px;` +\n 'marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;' +\n 'whiteSpace:nowrap;width:1px\">' +\n ` ${index + 1} of ${this.options.length}</span>`\n : '';\n\n return (\n <li\n aria-selected={this.focused === index ? 'true' : 'false'}\n class={`${optionClassName}${optionModifierFocused}`}\n innerHTML={this.templateSuggestion(option.text) + iosPosinsetHtml}\n id={`${id}__option--${index}`}\n key={index}\n onBlur={event => this.handleOptionBlur(event, index)}\n onClick={event => this.handleOptionClick(event, index)}\n onMouseDown={event => this.handleOptionMouseDown(event)}\n onMouseEnter={() => this.handleOptionMouseEnter(index)}\n ref={optionEl => {\n this.elementReferences[index] = optionEl;\n }}\n role=\"option\"\n tabIndex={-1}\n aria-posinset={index + 1}\n aria-setsize={this.options.length}\n />\n );\n })}\n\n {showNoOptionsFound && <li class={`${optionClassName} ${optionClassName}--no-results`}>No results found</li>}\n </ul>\n\n <span id={assistiveHintID} style={{ display: 'none' }}>\n {this.assistiveHint}\n </span>\n {this.invalid && this.invalidMessage && (\n <admiralty-input-invalid id={errorId} style={{ visibility: this.invalid && this.invalidMessage ? 'visible' : 'hidden' }}>\n {this.invalidMessage}\n </admiralty-input-invalid>\n )}\n </div>\n );\n }\n}\nlet nextId = 0;\n"],"version":3}
@@ -59,9 +59,9 @@ const InputComponent = class {
59
59
  const inputId = `${id}-input`;
60
60
  const hintId = `${id}-hint`;
61
61
  const errorId = `${id}-error`;
62
- return (index.h("div", { key: '8331b75bcdebf5e7881f3e89a6ff1afc07a2f247', class: "text-input-container" }, this.label ? (index.h("admiralty-label", { disabled: this.disabled, for: inputId }, this.label)) : null, this.hint ? (index.h("admiralty-hint", { id: hintId, disabled: this.disabled }, this.hint)) : null, index.h("input", { key: 'eef1a12e80d073e63c2452924ff1cf513943db13', ref: input => (this.nativeInput = input), class: { disabled: this.disabled, invalid: this.invalid }, disabled: this.disabled, id: inputId, name: this.name, type: this.type, value: value, onInput: this.onInput, onFocus: this.onFocus, onBlur: this.onBlur, placeholder: this.placeholder, autoComplete: this.autocomplete, required: this.required, style: {
62
+ return (index.h("div", { key: '8331b75bcdebf5e7881f3e89a6ff1afc07a2f247', class: "text-input-container" }, this.label ? (index.h("admiralty-label", { disabled: this.disabled, for: inputId }, this.label)) : null, this.hint ? (index.h("admiralty-hint", { id: hintId, disabled: this.disabled }, this.hint)) : null, index.h("input", Object.assign({ key: '8df3c8eb66e28ccc2ad478305fae9d0d02211ae0', ref: input => (this.nativeInput = input), class: { disabled: this.disabled, invalid: this.invalid }, disabled: this.disabled, id: inputId, name: this.name, type: this.type, value: value, onInput: this.onInput, onFocus: this.onFocus, onBlur: this.onBlur, placeholder: this.placeholder, autoComplete: this.autocomplete, required: this.required, style: {
63
63
  maxWidth: this.width ? `${this.width}px` : null,
64
- }, "aria-invalid": this.invalid ? 'true' : 'false', "aria-describedby": (this.hint ? hintId : '') + ' ' + (this.invalid ? errorId : '') }), index.h("admiralty-input-invalid", { key: 'f571590d72b3ac40bff045a523dd60e017385bb9', id: errorId, style: Object.assign({}, (!(this.invalid && this.invalidMessage) ? { display: 'none' } : {})) }, this.invalidMessage)));
64
+ }, "aria-invalid": this.invalid ? 'true' : 'false' }, (this.hint ? { 'aria-describedby': hintId + (this.invalid ? ' ' + errorId : '') } : this.invalid ? { 'aria-describedby': errorId } : null))), index.h("admiralty-input-invalid", { key: 'fb88c4e6e41eea9496b8cdc6b206c9b3e8dad07a', id: errorId, style: Object.assign({}, (!(this.invalid && this.invalidMessage) ? { display: 'none' } : {})) }, this.invalidMessage)));
65
65
  }
66
66
  get el() { return index.getElement(this); }
67
67
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"admiralty-input.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,QAAQ,GAAG,wuEAAwuE,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G,IAAI,CAAC,KAAK,IAAI,GAAG,IAAI;aAChD,kBACa,IAAI,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO,sBAC3B,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,GAAG,EAAE,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC,GACjF,EACFA,sFAAyB,EAAE,EAAE,OAAO,EAAE,KAAK,qBAAQ,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MACjH,IAAI,CAAC,cAAc,CACI,CACtB,EACN;KACH;;;;;;AAGH,IAAI,MAAM,GAAG,CAAC,CAAC;;;;;","names":["h"],"sources":["src/components/input/input.scss?tag=admiralty-input&encapsulation=scoped","src/components/input/input.tsx"],"sourcesContent":["@import 'inputs.vars';\n\n.text-input-container {\n display: flex;\n flex-direction: column;\n\n input {\n background-color: $input-background-colour;\n border-color: $input-border-colour;\n border-width: 2px;\n border-style: solid;\n color: $input-text-colour;\n font-size: $input-text-size;\n line-height: 24px;\n font-weight: $input-text-weight;\n\n padding: 12px;\n\n &:focus {\n outline-offset: unset;\n outline: 3px solid $input-focus-colour;\n box-shadow: $input-border-colour inset 0 0 0 2px;\n }\n\n &.invalid {\n border-color: $input-error-border-colour;\n\n &:focus-visible {\n border-color: unset;\n outline: 3px solid $input-focus-colour;\n }\n }\n\n &.disabled {\n color: $input-disabled-text-colour;\n border-color: $input-disabled-border-colour;\n background: $input-background-colour;\n }\n }\n\n admiralty-input-invalid {\n margin-top: 6px;\n }\n}\n","import { Component, ComponentInterface, Element, Event, EventEmitter, h, Prop, Watch } from '@stencil/core';\nimport { InputChangeEventDetail } from './input.interface';\n\n/**\n * Once this component works, review whether a form field component should be created so\n * that shared properties such as `label`, `hint`, `disabled` etc. can be defined once.\n * Examples of similar components that can extend that base component are area, select\n * and checkbox.\n */\n\n@Component({\n tag: 'admiralty-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class InputComponent implements ComponentInterface {\n private internalId = ++nextId;\n private nativeInput?: HTMLInputElement;\n\n @Element() el!: HTMLElement;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string;\n\n /**\n * The label which will be used above the input to describe the input.\n */\n @Prop() label: string;\n\n /**\n * The hint which will be used under the label to describe the input.\n */\n @Prop() hint: string;\n\n /**\n * This dictates whether the form field is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The input type, options are: text; number; date; time; email; password; tel; url\n */\n @Prop() type: 'text' | 'number' | 'date' | 'time' | 'email' | 'password' | 'tel' | 'url' = 'text';\n\n /**\n * The placeholder text to show in the input\n */\n @Prop() placeholder: string;\n\n /**\n * The maximum width for the input field.\n */\n @Prop() width: number;\n\n /**\n * This dictates whether the input is required or not\n */\n @Prop() required: boolean = false;\n\n /**\n * Whether to show the input in an invalid state\n */\n @Prop() invalid: boolean = false;\n\n /**\n * The message to show when the input is invalid\n */\n @Prop() invalidMessage: string;\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: string = 'off';\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | number | null = '';\n\n /**\n * Emitted when the value has changed.\n */\n @Event() admiraltyInput: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input gains focus.\n */\n @Event() admiraltyFocus: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() admiraltyBlur: EventEmitter<FocusEvent>;\n\n /**\n * Update the native input element when the value changes\n */\n\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n this.admiraltyInput.emit({ value: this.value == null ? this.getValue() : this.value.toString() });\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n };\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.admiraltyBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.admiraltyFocus.emit(ev);\n };\n\n render() {\n const value = this.getValue();\n const id = this.el.id != '' ? this.el.id : `admiralty-input-${this.internalId}`;\n const inputId = `${id}-input`;\n const hintId = `${id}-hint`;\n const errorId = `${id}-error`;\n\n return (\n <div class=\"text-input-container\">\n {this.label ? (\n <admiralty-label disabled={this.disabled} for={inputId}>\n {this.label}\n </admiralty-label>\n ) : null}\n {this.hint ? (\n <admiralty-hint id={hintId} disabled={this.disabled}>\n {this.hint}\n </admiralty-hint>\n ) : null}\n <input\n ref={input => (this.nativeInput = input)}\n class={{ disabled: this.disabled, invalid: this.invalid }}\n disabled={this.disabled}\n id={inputId}\n name={this.name}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n placeholder={this.placeholder}\n autoComplete={this.autocomplete}\n required={this.required}\n style={{\n maxWidth: this.width ? `${this.width}px` : null,\n }}\n aria-invalid={this.invalid ? 'true' : 'false'}\n aria-describedby={(this.hint ? hintId : '') + ' ' + (this.invalid ? errorId : '')}\n />\n <admiralty-input-invalid id={errorId} style={{ ...(!(this.invalid && this.invalidMessage) ? { display: 'none' } : {}) }}>\n {this.invalidMessage}\n </admiralty-input-invalid>\n </div>\n );\n }\n}\n\nlet nextId = 0;\n"],"version":3}
1
+ {"file":"admiralty-input.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,QAAQ,GAAG,wuEAAwuE,CAAC;AAC1vE,6BAAe,QAAQ;;MCcV,cAAc;;;;;;QACjB,eAAU,GAAG,EAAE,MAAM,CAAC;QA8FtB,YAAO,GAAG,CAAC,EAAS;YAC1B,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YACnD,IAAI,KAAK,EAAE;gBACT,IAAI,CAAC,KAAK,GAAG,KAAK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,IAAI,CAAC,OAAO,GAAG,EAAC,kBAAkB,EAAC,OAAO,EAAC,GAAG,IAAI,GACtI,EACFA,sFAAyB,EAAE,EAAE,OAAO,EAAE,KAAK,qBAAQ,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MACjH,IAAI,CAAC,cAAc,CACI,CACtB,EACN;KACH;;;;;;AAGH,IAAI,MAAM,GAAG,CAAC,CAAC;;;;;","names":["h"],"sources":["src/components/input/input.scss?tag=admiralty-input&encapsulation=scoped","src/components/input/input.tsx"],"sourcesContent":["@import 'inputs.vars';\n\n.text-input-container {\n display: flex;\n flex-direction: column;\n\n input {\n background-color: $input-background-colour;\n border-color: $input-border-colour;\n border-width: 2px;\n border-style: solid;\n color: $input-text-colour;\n font-size: $input-text-size;\n line-height: 24px;\n font-weight: $input-text-weight;\n\n padding: 12px;\n\n &:focus {\n outline-offset: unset;\n outline: 3px solid $input-focus-colour;\n box-shadow: $input-border-colour inset 0 0 0 2px;\n }\n\n &.invalid {\n border-color: $input-error-border-colour;\n\n &:focus-visible {\n border-color: unset;\n outline: 3px solid $input-focus-colour;\n }\n }\n\n &.disabled {\n color: $input-disabled-text-colour;\n border-color: $input-disabled-border-colour;\n background: $input-background-colour;\n }\n }\n\n admiralty-input-invalid {\n margin-top: 6px;\n }\n}\n","import { Component, ComponentInterface, Element, Event, EventEmitter, h, Prop, Watch } from '@stencil/core';\nimport { InputChangeEventDetail } from './input.interface';\n\n/**\n * Once this component works, review whether a form field component should be created so\n * that shared properties such as `label`, `hint`, `disabled` etc. can be defined once.\n * Examples of similar components that can extend that base component are area, select\n * and checkbox.\n */\n\n@Component({\n tag: 'admiralty-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class InputComponent implements ComponentInterface {\n private internalId = ++nextId;\n private nativeInput?: HTMLInputElement;\n\n @Element() el!: HTMLElement;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string;\n\n /**\n * The label which will be used above the input to describe the input.\n */\n @Prop() label: string;\n\n /**\n * The hint which will be used under the label to describe the input.\n */\n @Prop() hint: string;\n\n /**\n * This dictates whether the form field is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The input type, options are: text; number; date; time; email; password; tel; url\n */\n @Prop() type: 'text' | 'number' | 'date' | 'time' | 'email' | 'password' | 'tel' | 'url' = 'text';\n\n /**\n * The placeholder text to show in the input\n */\n @Prop() placeholder: string;\n\n /**\n * The maximum width for the input field.\n */\n @Prop() width: number;\n\n /**\n * This dictates whether the input is required or not\n */\n @Prop() required: boolean = false;\n\n /**\n * Whether to show the input in an invalid state\n */\n @Prop() invalid: boolean = false;\n\n /**\n * The message to show when the input is invalid\n */\n @Prop() invalidMessage: string;\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: string = 'off';\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | number | null = '';\n\n /**\n * Emitted when the value has changed.\n */\n @Event() admiraltyInput: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input gains focus.\n */\n @Event() admiraltyFocus: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() admiraltyBlur: EventEmitter<FocusEvent>;\n\n /**\n * Update the native input element when the value changes\n */\n\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n if (nativeInput && nativeInput.value !== value) {\n nativeInput.value = value;\n }\n this.admiraltyInput.emit({ value: this.value == null ? this.getValue() : this.value.toString() });\n }\n\n private onInput = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n };\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.admiraltyBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.admiraltyFocus.emit(ev);\n };\n\n render() {\n const value = this.getValue();\n const id = this.el.id != '' ? this.el.id : `admiralty-input-${this.internalId}`;\n const inputId = `${id}-input`;\n const hintId = `${id}-hint`;\n const errorId = `${id}-error`;\n\n return (\n <div class=\"text-input-container\">\n {this.label ? (\n <admiralty-label disabled={this.disabled} for={inputId}>\n {this.label}\n </admiralty-label>\n ) : null}\n {this.hint ? (\n <admiralty-hint id={hintId} disabled={this.disabled}>\n {this.hint}\n </admiralty-hint>\n ) : null}\n <input\n ref={input => (this.nativeInput = input)}\n class={{ disabled: this.disabled, invalid: this.invalid }}\n disabled={this.disabled}\n id={inputId}\n name={this.name}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n placeholder={this.placeholder}\n autoComplete={this.autocomplete}\n required={this.required}\n style={{\n maxWidth: this.width ? `${this.width}px` : null,\n }}\n aria-invalid={this.invalid ? 'true' : 'false'}\n {...(this.hint ? {'aria-describedby':hintId + (this.invalid ? ' '+ errorId : '')} : this.invalid ? {'aria-describedby':errorId} : null)}\n />\n <admiralty-input-invalid id={errorId} style={{ ...(!(this.invalid && this.invalidMessage) ? { display: 'none' } : {}) }}>\n {this.invalidMessage}\n </admiralty-input-invalid>\n </div>\n );\n }\n}\n\nlet nextId = 0;\n"],"version":3}
@@ -10,7 +10,7 @@ const AdmiraltyProgressBarStyle0 = progressBarCss;
10
10
  const ProgressBarComponent = class {
11
11
  constructor(hostRef) {
12
12
  index.registerInstance(this, hostRef);
13
- this.id = `admiralty-progress-${++progressId}`;
13
+ this.inputId = `admiralty-progress-${++progressId}`;
14
14
  this.label = undefined;
15
15
  this.progression = 0;
16
16
  this.error = false;
@@ -22,13 +22,19 @@ const ProgressBarComponent = class {
22
22
  * then updates the progressionValue state if the progression value is valid
23
23
  */
24
24
  progressionChanged() {
25
+ this.updateProgression();
26
+ }
27
+ updateProgression() {
25
28
  if (this.progression && this.progression >= 0 && this.progression <= 100) {
26
29
  this.progressionValue = this.progression;
27
30
  }
28
31
  }
32
+ componentDidLoad() {
33
+ this.updateProgression();
34
+ }
29
35
  render() {
30
- const { id, label, error, progressionValue } = this;
31
- return (index.h("div", { key: '9d93541982c6a1bd37608143a2413a4a40828376', class: "admiralty-progress" }, label ? index.h("admiralty-label", { for: id }, label) : null, index.h("progress", { key: 'd5ec924b7420d912602f19885ce8ca64ddd6cd56', id: id, class: { error: error }, value: progressionValue, max: "100" })));
36
+ const { inputId, label, error, progressionValue } = this;
37
+ return (index.h("div", { key: '7eafecb0ac94fad83d6a219d766be02ec31ba81b', class: "admiralty-progress" }, label ? index.h("admiralty-label", { for: inputId }, label) : null, index.h("progress", { key: '11a7d830aea3d391dc0a533672f0241e540c3289', id: inputId, class: { error: error }, value: progressionValue, max: "100" })));
32
38
  }
33
39
  static get watchers() { return {
34
40
  "progression": ["progressionChanged"]
@@ -1 +1 @@
1
- {"file":"admiralty-progress-bar.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,8yDAA8yD,CAAC;AACt0D,mCAAe,cAAc;;MCMhB,oBAAoB;;;QACvB,OAAE,GAAG,sBAAsB,EAAE,UAAU,EAAE,CAAC;;2BASpB,CAAC;qBAKN,KAAK;gCAMM,IAAI,CAAC,WAAW;;;;;;;IAQ1C,kBAAkB;QAC1B,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,IAAI,GAAG,EAAE;YACxE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC;SAC1C;KACF;IAED,MAAM;QACJ,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;QAEpD,QACEA,kEAAK,KAAK,EAAC,oBAAoB,IAC5B,KAAK,GAAGA,6BAAiB,GAAG,EAAE,EAAE,IAAG,KAAK,CAAmB,GAAG,IAAI,EACnEA,uEAAU,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAC,KAAK,GAAG,CAC5E,EACN;KACH;;;;;AAGH,IAAI,UAAU,GAAG,CAAC,CAAC;;;;;","names":["h"],"sources":["src/components/progress-bar/progress-bar.scss?tag=admiralty-progress-bar&encapsulation=scoped","src/components/progress-bar/progress-bar.tsx"],"sourcesContent":["@import 'progress-bar.vars.scss';\n\nprogress {\n appearance: none;\n background: $progress-bar-background-colour;\n border: none;\n box-sizing: border-box;\n color: $progress-bar-text-colour;\n display: inline-block;\n font-size: $progress-bar-font-size;\n flex: 1;\n height: 1em;\n width: 100%;\n\n &[value].error::-webkit-progress-value {\n background-color: $progress-bar-error-colour;\n }\n\n &[value].error::-moz-progress-bar {\n background-color: $progress-bar-error-colour;\n }\n\n &[value]::-webkit-progress-value {\n background-color: $progress-bar-success-colour;\n }\n\n &[value]::-moz-progress-bar {\n background-color: $progress-bar-success-colour;\n }\n}\n","import { Component, h, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-progress-bar',\n styleUrl: 'progress-bar.scss',\n scoped: true,\n})\nexport class ProgressBarComponent {\n private id = `admiralty-progress-${++progressId}`;\n\n /**\n * If set, adds a label above the progress bar\n */\n @Prop() label?: string;\n\n /** * A value from 0 - 100 that visually represents the current progression\n */\n @Prop() progression: number = 0;\n\n /**\n * Set to true to indicate an error (turns the progress bar red)\n */\n @Prop() error: boolean = false;\n\n /**\n * Progress value, min:0, max: 100\n */\n\n @State() progressionValue: number = this.progression;\n\n /**\n * @internal\n * Watches the progression prop for changes\n * then updates the progressionValue state if the progression value is valid\n */\n @Watch('progression')\n protected progressionChanged() {\n if (this.progression && this.progression >= 0 && this.progression <= 100) {\n this.progressionValue = this.progression;\n }\n }\n\n render() {\n const { id, label, error, progressionValue } = this;\n\n return (\n <div class=\"admiralty-progress\">\n {label ? <admiralty-label for={id}>{label}</admiralty-label> : null}\n <progress id={id} class={{ error: error }} value={progressionValue} max=\"100\" />\n </div>\n );\n }\n}\n\nlet progressId = 0;\n"],"version":3}
1
+ {"file":"admiralty-progress-bar.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,cAAc,GAAG,8yDAA8yD,CAAC;AACt0D,mCAAe,cAAc;;MCMhB,oBAAoB;;;QACvB,YAAO,GAAG,sBAAsB,EAAE,UAAU,EAAE,CAAC;;2BASzB,CAAC;qBAKN,KAAK;gCAMM,IAAI,CAAC,WAAW;;;;;;;IAQ1C,kBAAkB;QAC1B,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;IAEO,iBAAiB;QACvB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,IAAI,GAAG,EAAE;YACxE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC;SAC1C;KACF;IAED,gBAAgB;QACd,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;IAED,MAAM;QACJ,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;QAEzD,QACEA,kEAAK,KAAK,EAAC,oBAAoB,IAC5B,KAAK,GAAGA,6BAAiB,GAAG,EAAE,OAAO,IAAG,KAAK,CAAmB,GAAG,IAAI,EACxEA,uEAAU,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAC,KAAK,GAAG,CACjF,EACN;KACH;;;;;AAGH,IAAI,UAAU,GAAG,CAAC,CAAC;;;;;","names":["h"],"sources":["src/components/progress-bar/progress-bar.scss?tag=admiralty-progress-bar&encapsulation=scoped","src/components/progress-bar/progress-bar.tsx"],"sourcesContent":["@import 'progress-bar.vars.scss';\n\nprogress {\n appearance: none;\n background: $progress-bar-background-colour;\n border: none;\n box-sizing: border-box;\n color: $progress-bar-text-colour;\n display: inline-block;\n font-size: $progress-bar-font-size;\n flex: 1;\n height: 1em;\n width: 100%;\n\n &[value].error::-webkit-progress-value {\n background-color: $progress-bar-error-colour;\n }\n\n &[value].error::-moz-progress-bar {\n background-color: $progress-bar-error-colour;\n }\n\n &[value]::-webkit-progress-value {\n background-color: $progress-bar-success-colour;\n }\n\n &[value]::-moz-progress-bar {\n background-color: $progress-bar-success-colour;\n }\n}\n","import { Component, h, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'admiralty-progress-bar',\n styleUrl: 'progress-bar.scss',\n scoped: true,\n})\nexport class ProgressBarComponent {\n private inputId = `admiralty-progress-${++progressId}`;\n\n /**\n * If set, adds a label above the progress bar\n */\n @Prop() label?: string;\n\n /** * A value from 0 - 100 that visually represents the current progression\n */\n @Prop() progression: number = 0;\n\n /**\n * Set to true to indicate an error (turns the progress bar red)\n */\n @Prop() error: boolean = false;\n\n /**\n * Progress value, min:0, max: 100\n */\n\n @State() progressionValue: number = this.progression;\n\n /**\n * @internal\n * Watches the progression prop for changes\n * then updates the progressionValue state if the progression value is valid\n */\n @Watch('progression')\n protected progressionChanged() {\n this.updateProgression();\n }\n\n private updateProgression() {\n if (this.progression && this.progression >= 0 && this.progression <= 100) {\n this.progressionValue = this.progression;\n }\n }\n\n componentDidLoad() {\n this.updateProgression();\n }\n\n render() {\n const { inputId ,label, error, progressionValue } = this;\n\n return (\n <div class=\"admiralty-progress\">\n {label ? <admiralty-label for={inputId}>{label}</admiralty-label> : null}\n <progress id={inputId} class={{ error: error }} value={progressionValue} max=\"100\" />\n </div>\n );\n }\n}\n\nlet progressId = 0;\n"],"version":3}
@@ -3,7 +3,19 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-2aa80b51.js');
6
- const Keys = require('./Keys-019752ee.js');
6
+
7
+ var Keys;
8
+ (function (Keys) {
9
+ Keys["UP_ARROW"] = "ArrowUp";
10
+ Keys["DOWN_ARROW"] = "ArrowDown";
11
+ Keys["LEFT_ARROW"] = "ArrowLeft";
12
+ Keys["RIGHT_ARROW"] = "ArrowRight";
13
+ Keys["ENTER"] = "Enter";
14
+ Keys["TAB"] = "Tab";
15
+ Keys["HOME"] = "Home";
16
+ Keys["END"] = "End";
17
+ Keys["SPACE"] = " ";
18
+ })(Keys || (Keys = {}));
7
19
 
8
20
  const tabGroupCss = ".visually-hidden.sc-admiralty-tab-group:not(:focus):not(:active){position:absolute !important;width:1px !important;height:1px !important;margin:0 !important;padding:0 !important;overflow:hidden !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;border:0 !important;white-space:nowrap !important}@media (max-width: 1023px){.desktop-only.sc-admiralty-tab-group{display:none}}@media (min-width: 1024px){.not-desktop.sc-admiralty-tab-group{display:none}}@media (min-width: 1024px){.tablet-only.sc-admiralty-tab-group{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-only.sc-admiralty-tab-group{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-or-desktop.sc-admiralty-tab-group{display:none}}@media (min-width: 1024px){.phone-or-tablet.sc-admiralty-tab-group{display:none}}@media (min-width: 1024px){.phone-only.sc-admiralty-tab-group{display:none}}@media (max-width: 1023px) and (min-width: 480px){.phone-only.sc-admiralty-tab-group{display:none}}.tab-group-headers.sc-admiralty-tab-group{width:100%}hr.sc-admiralty-tab-group{width:100%;height:2px;margin:6px 0;background-color:var(--admiralty-colour-light)}.headers.sc-admiralty-tab-group{display:flex;overflow-x:auto;white-space:nowrap}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group{cursor:pointer;padding:10px;height:42px;max-width:fit-content;box-sizing:border-box;user-select:none;text-align:center;text-decoration:none;color:var(--admiralty-colour-primary);background-color:unset;font-weight:var(--admiralty-tab-group-font-weight, var(--admiralty-font-weight-medium));font-size:var(--admiralty-tab-group-font-size, var(--admiralty-font-size-0));margin-left:4px}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group:first-child{margin-left:0}@media (max-width: 1023px){.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group{font-size:var(--admiralty-tab-group-not-desktop-font-size, var(--admiralty-font-size--1));line-height:18px;padding:8px;height:unset;width:unset}}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group:focus-visible{box-shadow:var(--admiralty-focus-colour) inset 0 0 0 2px}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group:focus,.headers.sc-admiralty-tab-group .heading.active.sc-admiralty-tab-group:focus{outline:3px solid transparent;color:var(--admiralty-text-colour);background-color:var(--admiralty-focus-colour);box-shadow:0 -2px var(--admiralty-focus-colour), 0 4px var(--admiralty-text-colour);text-decoration:none;box-shadow:0px -4px var(--admiralty-text-colour) inset}.headers.sc-admiralty-tab-group .heading.sc-admiralty-tab-group:hover{background-color:var(--admiralty-hover-background-colour);color:var(--admiralty-colour-primary);box-shadow:unset}.headers.sc-admiralty-tab-group .heading.active.sc-admiralty-tab-group{background-color:var(--admiralty-colour-primary);color:var(--admiralty-colour-primary-contrast)}";
9
21
  const AdmiraltyTabGroupStyle0 = tabGroupCss;
@@ -44,19 +56,19 @@ const TabGroupComponent = class {
44
56
  const tgt = event.target;
45
57
  let processed = false;
46
58
  switch (event.key) {
47
- case Keys.Keys.LEFT_ARROW:
59
+ case Keys.LEFT_ARROW:
48
60
  this.moveFocusToPreviousTab(tgt);
49
61
  processed = true;
50
62
  break;
51
- case Keys.Keys.RIGHT_ARROW:
63
+ case Keys.RIGHT_ARROW:
52
64
  this.moveFocusToNextTab(tgt);
53
65
  processed = true;
54
66
  break;
55
- case Keys.Keys.HOME:
67
+ case Keys.HOME:
56
68
  this.moveFocusToTabHeader(this._tabHeaders[0]);
57
69
  processed = true;
58
70
  break;
59
- case Keys.Keys.END:
71
+ case Keys.END:
60
72
  this.moveFocusToTabHeader(this._tabHeaders[this._tabHeaders.length - 1]);
61
73
  processed = true;
62
74
  break;
@@ -1 +1 @@
1
- {"file":"admiralty-tab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B,IAAI,CAAC,KAAK,CAAC,MAAM,mBAChB,GAAG,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,aAAa,EAAE,mBACrC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,EAC9C,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,EACjD,SAAS,EAAE,EAAE,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,IAEtC,GAAG,CAAC,KAAK,CACH,CACV,CAAC,CAAC;QAEL,QACEA,QAACC,UAAI,uDACHD,kEAAK,KAAK,EAAC,mBAAmB,EAAC,IAAI,EAAC,SAAS,IAC3CA,kEAAK,KAAK,EAAC,SAAS,IAAE,aAAa,EAAE,CAAO,CACxC,EACNA,kEAAM,EACNA,oEAAa,CACR,EACP;KACH;;;;;;;","names":["Keys","forceUpdate","h","Host"],"sources":["src/components/tab-group/tab-group.scss?tag=admiralty-tab-group&encapsulation=scoped","src/components/tab-group/tab-group.tsx"],"sourcesContent":["@import 'tab-group.vars';\n\n.tab-group-headers {\n width: 100%;\n}\n\nhr {\n width: 100%;\n height: 2px;\n margin: 6px 0;\n background-color: $tab-group-separator-colour;\n}\n\n.headers {\n display: flex;\n overflow-x: auto;\n\n white-space: nowrap;\n\n .heading {\n cursor: pointer;\n padding: 10px;\n height: 42px;\n max-width: fit-content;\n box-sizing: border-box;\n user-select: none;\n\n text-align: center;\n text-decoration: none;\n color: $tab-group-heading-text-colour;\n background-color: unset;\n font-weight: $tab-group-heading-text-weight;\n font-size: $tab-group-heading-text-font;\n margin-left: 4px;\n\n &:first-child {\n margin-left: 0;\n }\n\n @include not-desktop {\n font-size: $tab-group-heading-not-desktop-text-font;\n line-height: 18px;\n padding: 8px;\n height: unset;\n width: unset;\n }\n\n &:focus-visible {\n box-shadow: $tab-group-focus-colour inset 0 0 0 2px;\n }\n\n &:focus,\n &.active:focus {\n @include focus-highlight;\n box-shadow: 0px -4px $tab-group-focus-text-colour inset;\n }\n\n &:hover {\n background-color: $tab-group-heading-hover-background-colour;\n color: $tab-group-heading-text-colour;\n box-shadow: unset;\n }\n\n &.active {\n background-color: $tab-group-active-background-colour;\n color: $tab-group-active-text-colour;\n }\n }\n}\n","import { Component, Element, Prop, Event, h, EventEmitter, Host, forceUpdate } from '@stencil/core';\nimport { Keys } from '../Keys';\n\ninterface TabInfo {\n label: string;\n index: number;\n}\n\nlet nextId = 0;\n\n@Component({\n tag: 'admiralty-tab-group',\n styleUrl: 'tab-group.scss',\n scoped: true,\n})\nexport class TabGroupComponent {\n @Element() el: HTMLElement;\n\n @Prop({ mutable: true }) selectedIndex = 0;\n\n @Event() admiraltyTabSelected: EventEmitter<number>;\n\n private _groupId = nextId++;\n\n private _tabs: TabInfo[] = [];\n private _tabHeaders: HTMLElement[] = [];\n\n handleSelectedTab(idx: number) {\n const oldContent = this.el.querySelector(`.tab-content#${this.getTabContentId(this.selectedIndex)}`);\n oldContent.classList.remove('active');\n oldContent.setAttribute('tabindex', this.getTabIndex(idx).toString());\n\n this.selectedIndex = idx;\n this.setSelectedTabContent();\n\n this.admiraltyTabSelected.emit(idx);\n }\n\n private setSelectedTabContent() {\n const activeContent = this.el.querySelector(`.tab-content#${this.getTabContentId(this.selectedIndex)}`);\n activeContent.classList.add('active');\n activeContent.setAttribute('tabindex', this.getTabIndex(this.selectedIndex).toString());\n }\n\n private getTabIndex(index: number): number | null {\n return this.selectedIndex === index ? 0 : -1;\n }\n\n private getTabContentId(i: number): string {\n return `tab-panel-${this._groupId}-${i}`;\n }\n\n private getTabLabelId(i: number): string {\n return `tab-label-${this._groupId}-${i}`;\n }\n\n handleKeyDown(event: KeyboardEvent): void {\n const tgt = event.target as HTMLElement;\n let processed = false;\n\n switch (event.key) {\n case Keys.LEFT_ARROW:\n this.moveFocusToPreviousTab(tgt);\n processed = true;\n break;\n case Keys.RIGHT_ARROW:\n this.moveFocusToNextTab(tgt);\n processed = true;\n break;\n\n case Keys.HOME:\n this.moveFocusToTabHeader(this._tabHeaders[0]);\n processed = true;\n break;\n\n case Keys.END:\n this.moveFocusToTabHeader(this._tabHeaders[this._tabHeaders.length - 1]);\n processed = true;\n break;\n default:\n break;\n }\n\n if (processed) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n private moveFocusToTabHeader(header: HTMLElement) {\n header.focus();\n }\n\n private moveFocusToPreviousTab(currentHeader: HTMLElement) {\n const firstTab = this._tabHeaders[0];\n const lastTab = this._tabHeaders[this._tabHeaders.length - 1];\n\n if (currentHeader === firstTab) {\n this.moveFocusToTabHeader(lastTab);\n } else {\n const index = this._tabHeaders.indexOf(currentHeader);\n this.moveFocusToTabHeader(this._tabHeaders[index - 1]);\n }\n }\n\n private moveFocusToNextTab(currentHeader: HTMLElement) {\n const firstTab = this._tabHeaders[0];\n const lastTab = this._tabHeaders[this._tabHeaders.length - 1];\n\n if (currentHeader === lastTab) {\n this.moveFocusToTabHeader(firstTab);\n } else {\n const index = this._tabHeaders.indexOf(currentHeader);\n this.moveFocusToTabHeader(this._tabHeaders[index + 1]);\n }\n }\n\n componentWillLoad() {\n const tabItems = this.el.querySelectorAll('admiralty-tab');\n\n this._tabs = [];\n\n if (tabItems.length > 0) {\n let idx = 0;\n tabItems.forEach(t => {\n t.tabLabelId = this.getTabLabelId(idx);\n t.tabContentId = this.getTabContentId(idx);\n\n this._tabs.push({ label: t.label, index: idx });\n ++idx;\n });\n\n this.selectedIndex = Math.max(0, Math.min(this.selectedIndex, tabItems.length - 1));\n }\n }\n\n componentDidLoad() {\n this._tabHeaders = Array.from(this.el.querySelectorAll('[role=\"tab\"]'));\n\n const tabItems = this.el.querySelectorAll('admiralty-tab .tab-content');\n\n if (tabItems.length > 0) {\n const tabContent = this.el.querySelector('hr');\n tabContent.after(...Array.from(tabItems));\n\n this.setSelectedTabContent();\n forceUpdate(this);\n }\n }\n\n render() {\n const createHeaders = () =>\n Array.from(this._tabs).map(tab => (\n <button\n class={{ heading: true, active: tab.index === this.selectedIndex }}\n id={this.getTabLabelId(tab.index)}\n role=\"tab\"\n tabIndex={this.getTabIndex(tab.index)}\n aria-setsize={this._tabs.length}\n aria-selected={`${tab.index === this.selectedIndex}`}\n aria-controls={this.getTabContentId(tab.index)}\n onClick={_ev => this.handleSelectedTab(tab.index)}\n onKeyDown={ev => this.handleKeyDown(ev)}\n >\n {tab.label}\n </button>\n ));\n\n return (\n <Host>\n <div class=\"tab-group-headers\" role=\"tablist\">\n <div class=\"headers\">{createHeaders()}</div>\n </div>\n <hr />\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"admiralty-tab-group.entry.cjs.js","mappings":";;;;;;AAAA,IAAY,IAUX;AAVD,WAAY,IAAI;IACd,4BAAoB,CAAA;IACpB,gCAAwB,CAAA;IACxB,gCAAwB,CAAA;IACxB,kCAA0B,CAAA;IAC1B,uBAAe,CAAA;IACf,mBAAW,CAAA;IACX,qBAAa,CAAA;IACb,mBAAW,CAAA;IACX,mBAAW,CAAA;AACb,CAAC,EAVW,IAAI,KAAJ,IAAI;;ACAhB,MAAM,WAAW,GAAG,o5FAAo5F,CAAC;AACz6F,gCAAe,WAAW;;ACO1B,IAAI,MAAM,GAAG,CAAC,CAAC;MAOF,iBAAiB;;;;QAOpB,aAAQ,GAAG,MAAM,EAAE,CAAC;QAEpB,UAAK,GAAc,EAAE,CAAC;QACtB,gBAAW,GAAkB,EAAE,CAAC;6BAPC,CAAC;;IAS1C,iBAAiB,CAAC,GAAW;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,gBAAgB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACrG,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtC,UAAU,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;Q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admiralty-tab-group&encapsulation=scoped","src/components/tab-group/tab-group.tsx"],"sourcesContent":["export enum Keys {\n UP_ARROW = 'ArrowUp',\n DOWN_ARROW = 'ArrowDown',\n LEFT_ARROW = 'ArrowLeft',\n RIGHT_ARROW = 'ArrowRight',\n ENTER = 'Enter',\n TAB = 'Tab',\n HOME = 'Home',\n END = 'End',\n SPACE = ' '\n}\n","@import 'tab-group.vars';\n\n.tab-group-headers {\n width: 100%;\n}\n\nhr {\n width: 100%;\n height: 2px;\n margin: 6px 0;\n background-color: $tab-group-separator-colour;\n}\n\n.headers {\n display: flex;\n overflow-x: auto;\n\n white-space: nowrap;\n\n .heading {\n cursor: pointer;\n padding: 10px;\n height: 42px;\n max-width: fit-content;\n box-sizing: border-box;\n user-select: none;\n\n text-align: center;\n text-decoration: none;\n color: $tab-group-heading-text-colour;\n background-color: unset;\n font-weight: $tab-group-heading-text-weight;\n font-size: $tab-group-heading-text-font;\n margin-left: 4px;\n\n &:first-child {\n margin-left: 0;\n }\n\n @include not-desktop {\n font-size: $tab-group-heading-not-desktop-text-font;\n line-height: 18px;\n padding: 8px;\n height: unset;\n width: unset;\n }\n\n &:focus-visible {\n box-shadow: $tab-group-focus-colour inset 0 0 0 2px;\n }\n\n &:focus,\n &.active:focus {\n @include focus-highlight;\n box-shadow: 0px -4px $tab-group-focus-text-colour inset;\n }\n\n &:hover {\n background-color: $tab-group-heading-hover-background-colour;\n color: $tab-group-heading-text-colour;\n box-shadow: unset;\n }\n\n &.active {\n background-color: $tab-group-active-background-colour;\n color: $tab-group-active-text-colour;\n }\n }\n}\n","import { Component, Element, Prop, Event, h, EventEmitter, Host, forceUpdate } from '@stencil/core';\nimport { Keys } from '../Keys';\n\ninterface TabInfo {\n label: string;\n index: number;\n}\n\nlet nextId = 0;\n\n@Component({\n tag: 'admiralty-tab-group',\n styleUrl: 'tab-group.scss',\n scoped: true,\n})\nexport class TabGroupComponent {\n @Element() el: HTMLElement;\n\n @Prop({ mutable: true }) selectedIndex = 0;\n\n @Event() admiraltyTabSelected: EventEmitter<number>;\n\n private _groupId = nextId++;\n\n private _tabs: TabInfo[] = [];\n private _tabHeaders: HTMLElement[] = [];\n\n handleSelectedTab(idx: number) {\n const oldContent = this.el.querySelector(`.tab-content#${this.getTabContentId(this.selectedIndex)}`);\n oldContent.classList.remove('active');\n oldContent.setAttribute('tabindex', this.getTabIndex(idx).toString());\n\n this.selectedIndex = idx;\n this.setSelectedTabContent();\n\n this.admiraltyTabSelected.emit(idx);\n }\n\n private setSelectedTabContent() {\n const activeContent = this.el.querySelector(`.tab-content#${this.getTabContentId(this.selectedIndex)}`);\n activeContent.classList.add('active');\n activeContent.setAttribute('tabindex', this.getTabIndex(this.selectedIndex).toString());\n }\n\n private getTabIndex(index: number): number | null {\n return this.selectedIndex === index ? 0 : -1;\n }\n\n private getTabContentId(i: number): string {\n return `tab-panel-${this._groupId}-${i}`;\n }\n\n private getTabLabelId(i: number): string {\n return `tab-label-${this._groupId}-${i}`;\n }\n\n handleKeyDown(event: KeyboardEvent): void {\n const tgt = event.target as HTMLElement;\n let processed = false;\n\n switch (event.key) {\n case Keys.LEFT_ARROW:\n this.moveFocusToPreviousTab(tgt);\n processed = true;\n break;\n case Keys.RIGHT_ARROW:\n this.moveFocusToNextTab(tgt);\n processed = true;\n break;\n\n case Keys.HOME:\n this.moveFocusToTabHeader(this._tabHeaders[0]);\n processed = true;\n break;\n\n case Keys.END:\n this.moveFocusToTabHeader(this._tabHeaders[this._tabHeaders.length - 1]);\n processed = true;\n break;\n default:\n break;\n }\n\n if (processed) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n\n private moveFocusToTabHeader(header: HTMLElement) {\n header.focus();\n }\n\n private moveFocusToPreviousTab(currentHeader: HTMLElement) {\n const firstTab = this._tabHeaders[0];\n const lastTab = this._tabHeaders[this._tabHeaders.length - 1];\n\n if (currentHeader === firstTab) {\n this.moveFocusToTabHeader(lastTab);\n } else {\n const index = this._tabHeaders.indexOf(currentHeader);\n this.moveFocusToTabHeader(this._tabHeaders[index - 1]);\n }\n }\n\n private moveFocusToNextTab(currentHeader: HTMLElement) {\n const firstTab = this._tabHeaders[0];\n const lastTab = this._tabHeaders[this._tabHeaders.length - 1];\n\n if (currentHeader === lastTab) {\n this.moveFocusToTabHeader(firstTab);\n } else {\n const index = this._tabHeaders.indexOf(currentHeader);\n this.moveFocusToTabHeader(this._tabHeaders[index + 1]);\n }\n }\n\n componentWillLoad() {\n const tabItems = this.el.querySelectorAll('admiralty-tab');\n\n this._tabs = [];\n\n if (tabItems.length > 0) {\n let idx = 0;\n tabItems.forEach(t => {\n t.tabLabelId = this.getTabLabelId(idx);\n t.tabContentId = this.getTabContentId(idx);\n\n this._tabs.push({ label: t.label, index: idx });\n ++idx;\n });\n\n this.selectedIndex = Math.max(0, Math.min(this.selectedIndex, tabItems.length - 1));\n }\n }\n\n componentDidLoad() {\n this._tabHeaders = Array.from(this.el.querySelectorAll('[role=\"tab\"]'));\n\n const tabItems = this.el.querySelectorAll('admiralty-tab .tab-content');\n\n if (tabItems.length > 0) {\n const tabContent = this.el.querySelector('hr');\n tabContent.after(...Array.from(tabItems));\n\n this.setSelectedTabContent();\n forceUpdate(this);\n }\n }\n\n render() {\n const createHeaders = () =>\n Array.from(this._tabs).map(tab => (\n <button\n class={{ heading: true, active: tab.index === this.selectedIndex }}\n id={this.getTabLabelId(tab.index)}\n role=\"tab\"\n tabIndex={this.getTabIndex(tab.index)}\n aria-setsize={this._tabs.length}\n aria-selected={`${tab.index === this.selectedIndex}`}\n aria-controls={this.getTabContentId(tab.index)}\n onClick={_ev => this.handleSelectedTab(tab.index)}\n onKeyDown={ev => this.handleKeyDown(ev)}\n >\n {tab.label}\n </button>\n ));\n\n return (\n <Host>\n <div class=\"tab-group-headers\" role=\"tablist\">\n <div class=\"headers\">{createHeaders()}</div>\n </div>\n <hr />\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["admiralty-type-ahead.cjs",[[6,"admiralty-type-ahead",{"value":[1],"label":[1],"hint":[1],"placeholder":[1],"resultsOnInitFocus":[4,"results-on-init-focus"],"filterResult":[32]}]]],["admiralty-autocomplete.cjs",[[2,"admiralty-autocomplete",{"autoselect":[4],"cssNamespace":[1,"css-namespace"],"displayMenu":[1,"display-menu"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"confirmOnBlur":[4,"confirm-on-blur"],"showNoOptionsFound":[4,"show-no-options-found"],"showAllValues":[4,"show-all-values"],"required":[4],"assistiveHint":[1,"assistive-hint"],"menuAttributes":[8,"menu-attributes"],"inputClasses":[1,"input-classes"],"menuClasses":[1,"menu-classes"],"label":[1],"hint":[1],"invalid":[4],"invalidMessage":[1,"invalid-message"],"disabled":[4],"value":[1025],"focused":[32],"hovered":[32],"menuOpen":[32],"options":[32],"option":[32],"query":[32],"validChoiceMade":[32],"selected":[32],"ariaHint":[32]},null,{"value":["onValueChange"],"focused":["onFocusedChange"]}]]],["admiralty-select.cjs",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-textarea.cjs",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-radio-group.cjs",[[6,"admiralty-radio-group",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]},null,{"value":["valueChanged"],"invalid":["invalidChanged"]}]]],["admiralty-colour-block.cjs",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"href":[1],"linkText":[1,"link-text"],"suppressRedirect":[4,"suppress-redirect"],"enableCardEvent":[4,"enable-card-event"],"actionText":[1,"action-text"]}]]],["admiralty-error-summary.cjs",[[6,"admiralty-error-summary",{"heading":[1]}]]],["admiralty-file-input.cjs",[[2,"admiralty-file-input",{"label":[1],"multiple":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"files":[32]}]]],["admiralty-filter.cjs",[[6,"admiralty-filter",{"filterTitle":[1,"filter-title"]}]]],["admiralty-filter-group.cjs",[[6,"admiralty-filter-group",{"groupTitle":[1,"group-title"]}]]],["admiralty-paginator.cjs",[[2,"admiralty-paginator",{"pages":[2],"currentPage":[2,"current-page"],"label":[1]}]]],["admiralty-breadcrumb.cjs",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-header.cjs",[[6,"admiralty-header",{"headerTitle":[1,"header-title"],"headerTitleUrl":[1,"header-title-url"],"logoLinkUrl":[1,"logo-link-url"],"logoImgUrl":[1,"logo-img-url"],"logoAltText":[1,"logo-alt-text"],"mobileMenuOpen":[32],"displayHamburger":[32]}]]],["admiralty-pill.cjs",[[2,"admiralty-pill",{"text":[1],"number":[1],"label":[1],"colour":[1],"selected":[4]}]]],["admiralty-progress-bar.cjs",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]},null,{"progression":["progressionChanged"]}]]],["admiralty-read-more.cjs",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["admiralty-autocomplete-option.cjs",[[2,"admiralty-autocomplete-option",{"value":[8]}]]],["admiralty-breadcrumbs.cjs",[[6,"admiralty-breadcrumbs"]]],["admiralty-card.cjs",[[6,"admiralty-card",{"heading":[1]}]]],["admiralty-checkbox.cjs",[[2,"admiralty-checkbox",{"checkboxRight":[4,"checkbox-right"],"disabled":[4],"name":[1],"checked":[1540],"value":[8],"labelText":[1,"label-text"],"labelHidden":[4,"label-hidden"]},null,{"checked":["checkedChanged"]}]]],["admiralty-footer.cjs",[[6,"admiralty-footer",{"variant":[1],"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1],"hasSlotContent":[32]},[[2,"slotchange","handleSlotChange"]]]]],["admiralty-header-menu-item.cjs",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-menu-link.cjs",[[6,"admiralty-header-menu-link",{"menuTitle":[1,"menu-title"],"active":[4],"href":[1],"suppressRedirect":[4,"suppress-redirect"]}]]],["admiralty-header-profile.cjs",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"],"signInOnly":[4,"sign-in-only"]}]]],["admiralty-header-sub-menu-item.cjs",[[6,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"],"href":[1],"suppressRedirect":[4,"suppress-redirect"]}]]],["admiralty-hr.cjs",[[2,"admiralty-hr"]]],["admiralty-link.cjs",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["admiralty-modal-dialog.cjs",[[6,"admiralty-modal-dialog",{"heading":[1],"label":[1],"description":[1],"show":[4]}]]],["admiralty-paginator-wrapper.cjs",[[4,"admiralty-paginator-wrapper",null,[[0,"pageChange","pageChangedHandler"]]]]],["admiralty-phase-banner.cjs",[[2,"admiralty-phase-banner",{"phase":[1],"link":[1]}]]],["admiralty-radio.cjs",[[6,"admiralty-radio",{"name":[1],"value":[1025],"disabled":[4],"checked":[1028],"invalid":[4],"buttonTabindex":[32],"setButtonTabindex":[64]},null,{"value":["valueChanged"]}]]],["admiralty-side-nav.cjs",[[6,"admiralty-side-nav",{"label":[1]}]]],["admiralty-side-nav-item.cjs",[[2,"admiralty-side-nav-item",{"sideNavItemId":[1,"side-nav-item-id"],"headingTitle":[1,"heading-title"],"navActive":[4,"nav-active"]}]]],["admiralty-side-nav-wrapper.cjs",[[4,"admiralty-side-nav-wrapper",null,[[0,"sideNavItemSelected","onSideNavItemSelected"]]]]],["admiralty-skip-link.cjs",[[2,"admiralty-skip-link",{"href":[1]}]]],["admiralty-tab.cjs",[[6,"admiralty-tab",{"label":[1],"tabLabelId":[1,"tab-label-id"],"tabContentId":[1,"tab-content-id"]}]]],["admiralty-tab-group.cjs",[[6,"admiralty-tab-group",{"selectedIndex":[1026,"selected-index"]}]]],["admiralty-table.cjs",[[6,"admiralty-table",{"caption":[1]}]]],["admiralty-table-body.cjs",[[6,"admiralty-table-body"]]],["admiralty-table-cell.cjs",[[6,"admiralty-table-cell"]]],["admiralty-table-header.cjs",[[6,"admiralty-table-header"]]],["admiralty-table-header-cell.cjs",[[6,"admiralty-table-header-cell"]]],["admiralty-table-row.cjs",[[6,"admiralty-table-row"]]],["admiralty-type-ahead-item.cjs",[[2,"admiralty-type-ahead-item",{"value":[1]}]]],["admiralty-icon.cjs",[[1,"admiralty-icon",{"iconName":[1,"icon-name"],"iconPrefix":[1,"icon-prefix"]}]]],["admiralty-input.cjs",[[2,"admiralty-input",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"type":[1],"placeholder":[1],"width":[2],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-dialogue.cjs",[[6,"admiralty-dialogue",{"type":[1],"heading":[1],"sectionRole":[1,"section-role"]}]]],["admiralty-expansion.cjs",[[6,"admiralty-expansion",{"heading":[1],"expanded":[1540],"alignHeadingRight":[4,"align-heading-right"],"hideBorder":[4,"hide-border"]}]]],["admiralty-button.cjs",[[6,"admiralty-button",{"variant":[1],"icon":[1],"disabled":[516],"type":[1],"form":[1],"name":[1],"value":[1]}]]],["admiralty-hint_3.cjs",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
22
+ return index.bootstrapLazy([["admiralty-autocomplete.cjs",[[2,"admiralty-autocomplete",{"autoselect":[4],"cssNamespace":[1,"css-namespace"],"displayMenu":[1,"display-menu"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"confirmOnBlur":[4,"confirm-on-blur"],"showNoOptionsFound":[4,"show-no-options-found"],"showAllValues":[4,"show-all-values"],"required":[4],"assistiveHint":[1,"assistive-hint"],"menuAttributes":[8,"menu-attributes"],"inputClasses":[1,"input-classes"],"menuClasses":[1,"menu-classes"],"label":[1],"hint":[1],"invalid":[4],"invalidMessage":[1,"invalid-message"],"disabled":[4],"value":[1025],"focused":[32],"hovered":[32],"menuOpen":[32],"options":[32],"option":[32],"query":[32],"validChoiceMade":[32],"selected":[32],"ariaHint":[32]},null,{"value":["onValueChange"],"focused":["onFocusedChange"]}]]],["admiralty-input.cjs",[[2,"admiralty-input",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"type":[1],"placeholder":[1],"width":[2],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-select.cjs",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-textarea.cjs",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-radio-group.cjs",[[6,"admiralty-radio-group",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]},null,{"value":["valueChanged"],"invalid":["invalidChanged"]}]]],["admiralty-colour-block.cjs",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"href":[1],"linkText":[1,"link-text"],"suppressRedirect":[4,"suppress-redirect"],"enableCardEvent":[4,"enable-card-event"],"actionText":[1,"action-text"]}]]],["admiralty-error-summary.cjs",[[6,"admiralty-error-summary",{"heading":[1]}]]],["admiralty-file-input.cjs",[[2,"admiralty-file-input",{"label":[1],"multiple":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"files":[32]}]]],["admiralty-filter.cjs",[[6,"admiralty-filter",{"filterTitle":[1,"filter-title"]}]]],["admiralty-filter-group.cjs",[[6,"admiralty-filter-group",{"groupTitle":[1,"group-title"]}]]],["admiralty-paginator.cjs",[[2,"admiralty-paginator",{"pages":[2],"currentPage":[2,"current-page"],"label":[1]}]]],["admiralty-breadcrumb.cjs",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-header.cjs",[[6,"admiralty-header",{"headerTitle":[1,"header-title"],"headerTitleUrl":[1,"header-title-url"],"logoLinkUrl":[1,"logo-link-url"],"logoImgUrl":[1,"logo-img-url"],"logoAltText":[1,"logo-alt-text"],"mobileMenuOpen":[32],"displayHamburger":[32]}]]],["admiralty-pill.cjs",[[2,"admiralty-pill",{"text":[1],"number":[1],"label":[1],"colour":[1],"selected":[4]}]]],["admiralty-progress-bar.cjs",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]},null,{"progression":["progressionChanged"]}]]],["admiralty-read-more.cjs",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["admiralty-autocomplete-option.cjs",[[2,"admiralty-autocomplete-option",{"value":[8]}]]],["admiralty-breadcrumbs.cjs",[[6,"admiralty-breadcrumbs"]]],["admiralty-card.cjs",[[6,"admiralty-card",{"heading":[1]}]]],["admiralty-checkbox.cjs",[[2,"admiralty-checkbox",{"checkboxRight":[4,"checkbox-right"],"disabled":[4],"name":[1],"checked":[1540],"value":[8],"labelText":[1,"label-text"],"labelHidden":[4,"label-hidden"]},null,{"checked":["checkedChanged"]}]]],["admiralty-footer.cjs",[[6,"admiralty-footer",{"variant":[1],"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1],"hasSlotContent":[32]},[[2,"slotchange","handleSlotChange"]]]]],["admiralty-header-menu-item.cjs",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-menu-link.cjs",[[6,"admiralty-header-menu-link",{"menuTitle":[1,"menu-title"],"active":[4],"href":[1],"suppressRedirect":[4,"suppress-redirect"]}]]],["admiralty-header-profile.cjs",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"],"signInOnly":[4,"sign-in-only"]}]]],["admiralty-header-sub-menu-item.cjs",[[6,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"],"href":[1],"suppressRedirect":[4,"suppress-redirect"]}]]],["admiralty-hr.cjs",[[2,"admiralty-hr"]]],["admiralty-link.cjs",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["admiralty-modal-dialog.cjs",[[6,"admiralty-modal-dialog",{"heading":[1],"label":[1],"description":[1],"show":[4]}]]],["admiralty-paginator-wrapper.cjs",[[4,"admiralty-paginator-wrapper",null,[[0,"pageChange","pageChangedHandler"]]]]],["admiralty-phase-banner.cjs",[[2,"admiralty-phase-banner",{"phase":[1],"link":[1]}]]],["admiralty-radio.cjs",[[6,"admiralty-radio",{"name":[1],"value":[1025],"disabled":[4],"checked":[1028],"invalid":[4],"buttonTabindex":[32],"setButtonTabindex":[64]},null,{"value":["valueChanged"]}]]],["admiralty-side-nav.cjs",[[6,"admiralty-side-nav",{"label":[1]}]]],["admiralty-side-nav-item.cjs",[[2,"admiralty-side-nav-item",{"sideNavItemId":[1,"side-nav-item-id"],"headingTitle":[1,"heading-title"],"navActive":[4,"nav-active"]}]]],["admiralty-side-nav-wrapper.cjs",[[4,"admiralty-side-nav-wrapper",null,[[0,"sideNavItemSelected","onSideNavItemSelected"]]]]],["admiralty-skip-link.cjs",[[2,"admiralty-skip-link",{"href":[1]}]]],["admiralty-tab.cjs",[[6,"admiralty-tab",{"label":[1],"tabLabelId":[1,"tab-label-id"],"tabContentId":[1,"tab-content-id"]}]]],["admiralty-tab-group.cjs",[[6,"admiralty-tab-group",{"selectedIndex":[1026,"selected-index"]}]]],["admiralty-table.cjs",[[6,"admiralty-table",{"caption":[1]}]]],["admiralty-table-body.cjs",[[6,"admiralty-table-body"]]],["admiralty-table-cell.cjs",[[6,"admiralty-table-cell"]]],["admiralty-table-header.cjs",[[6,"admiralty-table-header"]]],["admiralty-table-header-cell.cjs",[[6,"admiralty-table-header-cell"]]],["admiralty-table-row.cjs",[[6,"admiralty-table-row"]]],["admiralty-icon.cjs",[[1,"admiralty-icon",{"iconName":[1,"icon-name"],"iconPrefix":[1,"icon-prefix"]}]]],["admiralty-dialogue.cjs",[[6,"admiralty-dialogue",{"type":[1],"heading":[1],"sectionRole":[1,"section-role"]}]]],["admiralty-expansion.cjs",[[6,"admiralty-expansion",{"heading":[1],"expanded":[1540],"alignHeadingRight":[4,"align-heading-right"],"hideBorder":[4,"hide-border"]}]]],["admiralty-button.cjs",[[6,"admiralty-button",{"variant":[1],"icon":[1],"disabled":[516],"type":[1],"form":[1],"name":[1],"value":[1]}]]],["admiralty-hint_3.cjs",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["admiralty-type-ahead.cjs",[[6,"admiralty-type-ahead",{"value":[1],"label":[1],"hint":[1],"placeholder":[1],"resultsOnInitFocus":[4,"results-on-init-focus"],"filterResult":[32]}]]],["admiralty-autocomplete.cjs",[[2,"admiralty-autocomplete",{"autoselect":[4],"cssNamespace":[1,"css-namespace"],"displayMenu":[1,"display-menu"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"confirmOnBlur":[4,"confirm-on-blur"],"showNoOptionsFound":[4,"show-no-options-found"],"showAllValues":[4,"show-all-values"],"required":[4],"assistiveHint":[1,"assistive-hint"],"menuAttributes":[8,"menu-attributes"],"inputClasses":[1,"input-classes"],"menuClasses":[1,"menu-classes"],"label":[1],"hint":[1],"invalid":[4],"invalidMessage":[1,"invalid-message"],"disabled":[4],"value":[1025],"focused":[32],"hovered":[32],"menuOpen":[32],"options":[32],"option":[32],"query":[32],"validChoiceMade":[32],"selected":[32],"ariaHint":[32]},null,{"value":["onValueChange"],"focused":["onFocusedChange"]}]]],["admiralty-select.cjs",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-textarea.cjs",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-radio-group.cjs",[[6,"admiralty-radio-group",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]},null,{"value":["valueChanged"],"invalid":["invalidChanged"]}]]],["admiralty-colour-block.cjs",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"href":[1],"linkText":[1,"link-text"],"suppressRedirect":[4,"suppress-redirect"],"enableCardEvent":[4,"enable-card-event"],"actionText":[1,"action-text"]}]]],["admiralty-error-summary.cjs",[[6,"admiralty-error-summary",{"heading":[1]}]]],["admiralty-file-input.cjs",[[2,"admiralty-file-input",{"label":[1],"multiple":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"files":[32]}]]],["admiralty-filter.cjs",[[6,"admiralty-filter",{"filterTitle":[1,"filter-title"]}]]],["admiralty-filter-group.cjs",[[6,"admiralty-filter-group",{"groupTitle":[1,"group-title"]}]]],["admiralty-paginator.cjs",[[2,"admiralty-paginator",{"pages":[2],"currentPage":[2,"current-page"],"label":[1]}]]],["admiralty-breadcrumb.cjs",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-header.cjs",[[6,"admiralty-header",{"headerTitle":[1,"header-title"],"headerTitleUrl":[1,"header-title-url"],"logoLinkUrl":[1,"logo-link-url"],"logoImgUrl":[1,"logo-img-url"],"logoAltText":[1,"logo-alt-text"],"mobileMenuOpen":[32],"displayHamburger":[32]}]]],["admiralty-pill.cjs",[[2,"admiralty-pill",{"text":[1],"number":[1],"label":[1],"colour":[1],"selected":[4]}]]],["admiralty-progress-bar.cjs",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]},null,{"progression":["progressionChanged"]}]]],["admiralty-read-more.cjs",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["admiralty-autocomplete-option.cjs",[[2,"admiralty-autocomplete-option",{"value":[8]}]]],["admiralty-breadcrumbs.cjs",[[6,"admiralty-breadcrumbs"]]],["admiralty-card.cjs",[[6,"admiralty-card",{"heading":[1]}]]],["admiralty-checkbox.cjs",[[2,"admiralty-checkbox",{"checkboxRight":[4,"checkbox-right"],"disabled":[4],"name":[1],"checked":[1540],"value":[8],"labelText":[1,"label-text"],"labelHidden":[4,"label-hidden"]},null,{"checked":["checkedChanged"]}]]],["admiralty-footer.cjs",[[6,"admiralty-footer",{"variant":[1],"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1],"hasSlotContent":[32]},[[2,"slotchange","handleSlotChange"]]]]],["admiralty-header-menu-item.cjs",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-menu-link.cjs",[[6,"admiralty-header-menu-link",{"menuTitle":[1,"menu-title"],"active":[4],"href":[1],"suppressRedirect":[4,"suppress-redirect"]}]]],["admiralty-header-profile.cjs",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"],"signInOnly":[4,"sign-in-only"]}]]],["admiralty-header-sub-menu-item.cjs",[[6,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"],"href":[1],"suppressRedirect":[4,"suppress-redirect"]}]]],["admiralty-hr.cjs",[[2,"admiralty-hr"]]],["admiralty-link.cjs",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["admiralty-modal-dialog.cjs",[[6,"admiralty-modal-dialog",{"heading":[1],"label":[1],"description":[1],"show":[4]}]]],["admiralty-paginator-wrapper.cjs",[[4,"admiralty-paginator-wrapper",null,[[0,"pageChange","pageChangedHandler"]]]]],["admiralty-phase-banner.cjs",[[2,"admiralty-phase-banner",{"phase":[1],"link":[1]}]]],["admiralty-radio.cjs",[[6,"admiralty-radio",{"name":[1],"value":[1025],"disabled":[4],"checked":[1028],"invalid":[4],"buttonTabindex":[32],"setButtonTabindex":[64]},null,{"value":["valueChanged"]}]]],["admiralty-side-nav.cjs",[[6,"admiralty-side-nav",{"label":[1]}]]],["admiralty-side-nav-item.cjs",[[2,"admiralty-side-nav-item",{"sideNavItemId":[1,"side-nav-item-id"],"headingTitle":[1,"heading-title"],"navActive":[4,"nav-active"]}]]],["admiralty-side-nav-wrapper.cjs",[[4,"admiralty-side-nav-wrapper",null,[[0,"sideNavItemSelected","onSideNavItemSelected"]]]]],["admiralty-skip-link.cjs",[[2,"admiralty-skip-link",{"href":[1]}]]],["admiralty-tab.cjs",[[6,"admiralty-tab",{"label":[1],"tabLabelId":[1,"tab-label-id"],"tabContentId":[1,"tab-content-id"]}]]],["admiralty-tab-group.cjs",[[6,"admiralty-tab-group",{"selectedIndex":[1026,"selected-index"]}]]],["admiralty-table.cjs",[[6,"admiralty-table",{"caption":[1]}]]],["admiralty-table-body.cjs",[[6,"admiralty-table-body"]]],["admiralty-table-cell.cjs",[[6,"admiralty-table-cell"]]],["admiralty-table-header.cjs",[[6,"admiralty-table-header"]]],["admiralty-table-header-cell.cjs",[[6,"admiralty-table-header-cell"]]],["admiralty-table-row.cjs",[[6,"admiralty-table-row"]]],["admiralty-type-ahead-item.cjs",[[2,"admiralty-type-ahead-item",{"value":[1]}]]],["admiralty-icon.cjs",[[1,"admiralty-icon",{"iconName":[1,"icon-name"],"iconPrefix":[1,"icon-prefix"]}]]],["admiralty-input.cjs",[[2,"admiralty-input",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"type":[1],"placeholder":[1],"width":[2],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-dialogue.cjs",[[6,"admiralty-dialogue",{"type":[1],"heading":[1],"sectionRole":[1,"section-role"]}]]],["admiralty-expansion.cjs",[[6,"admiralty-expansion",{"heading":[1],"expanded":[1540],"alignHeadingRight":[4,"align-heading-right"],"hideBorder":[4,"hide-border"]}]]],["admiralty-button.cjs",[[6,"admiralty-button",{"variant":[1],"icon":[1],"disabled":[516],"type":[1],"form":[1],"name":[1],"value":[1]}]]],["admiralty-hint_3.cjs",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
11
+ return index.bootstrapLazy([["admiralty-autocomplete.cjs",[[2,"admiralty-autocomplete",{"autoselect":[4],"cssNamespace":[1,"css-namespace"],"displayMenu":[1,"display-menu"],"minLength":[2,"min-length"],"name":[1],"placeholder":[1],"confirmOnBlur":[4,"confirm-on-blur"],"showNoOptionsFound":[4,"show-no-options-found"],"showAllValues":[4,"show-all-values"],"required":[4],"assistiveHint":[1,"assistive-hint"],"menuAttributes":[8,"menu-attributes"],"inputClasses":[1,"input-classes"],"menuClasses":[1,"menu-classes"],"label":[1],"hint":[1],"invalid":[4],"invalidMessage":[1,"invalid-message"],"disabled":[4],"value":[1025],"focused":[32],"hovered":[32],"menuOpen":[32],"options":[32],"option":[32],"query":[32],"validChoiceMade":[32],"selected":[32],"ariaHint":[32]},null,{"value":["onValueChange"],"focused":["onFocusedChange"]}]]],["admiralty-input.cjs",[[2,"admiralty-input",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"type":[1],"placeholder":[1],"width":[2],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-select.cjs",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-textarea.cjs",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]},null,{"value":["valueChanged"]}]]],["admiralty-radio-group.cjs",[[6,"admiralty-radio-group",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]},null,{"value":["valueChanged"],"invalid":["invalidChanged"]}]]],["admiralty-colour-block.cjs",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"href":[1],"linkText":[1,"link-text"],"suppressRedirect":[4,"suppress-redirect"],"enableCardEvent":[4,"enable-card-event"],"actionText":[1,"action-text"]}]]],["admiralty-error-summary.cjs",[[6,"admiralty-error-summary",{"heading":[1]}]]],["admiralty-file-input.cjs",[[2,"admiralty-file-input",{"label":[1],"multiple":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"files":[32]}]]],["admiralty-filter.cjs",[[6,"admiralty-filter",{"filterTitle":[1,"filter-title"]}]]],["admiralty-filter-group.cjs",[[6,"admiralty-filter-group",{"groupTitle":[1,"group-title"]}]]],["admiralty-paginator.cjs",[[2,"admiralty-paginator",{"pages":[2],"currentPage":[2,"current-page"],"label":[1]}]]],["admiralty-breadcrumb.cjs",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-header.cjs",[[6,"admiralty-header",{"headerTitle":[1,"header-title"],"headerTitleUrl":[1,"header-title-url"],"logoLinkUrl":[1,"logo-link-url"],"logoImgUrl":[1,"logo-img-url"],"logoAltText":[1,"logo-alt-text"],"mobileMenuOpen":[32],"displayHamburger":[32]}]]],["admiralty-pill.cjs",[[2,"admiralty-pill",{"text":[1],"number":[1],"label":[1],"colour":[1],"selected":[4]}]]],["admiralty-progress-bar.cjs",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]},null,{"progression":["progressionChanged"]}]]],["admiralty-read-more.cjs",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["admiralty-autocomplete-option.cjs",[[2,"admiralty-autocomplete-option",{"value":[8]}]]],["admiralty-breadcrumbs.cjs",[[6,"admiralty-breadcrumbs"]]],["admiralty-card.cjs",[[6,"admiralty-card",{"heading":[1]}]]],["admiralty-checkbox.cjs",[[2,"admiralty-checkbox",{"checkboxRight":[4,"checkbox-right"],"disabled":[4],"name":[1],"checked":[1540],"value":[8],"labelText":[1,"label-text"],"labelHidden":[4,"label-hidden"]},null,{"checked":["checkedChanged"]}]]],["admiralty-footer.cjs",[[6,"admiralty-footer",{"variant":[1],"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1],"hasSlotContent":[32]},[[2,"slotchange","handleSlotChange"]]]]],["admiralty-header-menu-item.cjs",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-menu-link.cjs",[[6,"admiralty-header-menu-link",{"menuTitle":[1,"menu-title"],"active":[4],"href":[1],"suppressRedirect":[4,"suppress-redirect"]}]]],["admiralty-header-profile.cjs",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"],"signInOnly":[4,"sign-in-only"]}]]],["admiralty-header-sub-menu-item.cjs",[[6,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"],"href":[1],"suppressRedirect":[4,"suppress-redirect"]}]]],["admiralty-hr.cjs",[[2,"admiralty-hr"]]],["admiralty-link.cjs",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["admiralty-modal-dialog.cjs",[[6,"admiralty-modal-dialog",{"heading":[1],"label":[1],"description":[1],"show":[4]}]]],["admiralty-paginator-wrapper.cjs",[[4,"admiralty-paginator-wrapper",null,[[0,"pageChange","pageChangedHandler"]]]]],["admiralty-phase-banner.cjs",[[2,"admiralty-phase-banner",{"phase":[1],"link":[1]}]]],["admiralty-radio.cjs",[[6,"admiralty-radio",{"name":[1],"value":[1025],"disabled":[4],"checked":[1028],"invalid":[4],"buttonTabindex":[32],"setButtonTabindex":[64]},null,{"value":["valueChanged"]}]]],["admiralty-side-nav.cjs",[[6,"admiralty-side-nav",{"label":[1]}]]],["admiralty-side-nav-item.cjs",[[2,"admiralty-side-nav-item",{"sideNavItemId":[1,"side-nav-item-id"],"headingTitle":[1,"heading-title"],"navActive":[4,"nav-active"]}]]],["admiralty-side-nav-wrapper.cjs",[[4,"admiralty-side-nav-wrapper",null,[[0,"sideNavItemSelected","onSideNavItemSelected"]]]]],["admiralty-skip-link.cjs",[[2,"admiralty-skip-link",{"href":[1]}]]],["admiralty-tab.cjs",[[6,"admiralty-tab",{"label":[1],"tabLabelId":[1,"tab-label-id"],"tabContentId":[1,"tab-content-id"]}]]],["admiralty-tab-group.cjs",[[6,"admiralty-tab-group",{"selectedIndex":[1026,"selected-index"]}]]],["admiralty-table.cjs",[[6,"admiralty-table",{"caption":[1]}]]],["admiralty-table-body.cjs",[[6,"admiralty-table-body"]]],["admiralty-table-cell.cjs",[[6,"admiralty-table-cell"]]],["admiralty-table-header.cjs",[[6,"admiralty-table-header"]]],["admiralty-table-header-cell.cjs",[[6,"admiralty-table-header-cell"]]],["admiralty-table-row.cjs",[[6,"admiralty-table-row"]]],["admiralty-icon.cjs",[[1,"admiralty-icon",{"iconName":[1,"icon-name"],"iconPrefix":[1,"icon-prefix"]}]]],["admiralty-dialogue.cjs",[[6,"admiralty-dialogue",{"type":[1],"heading":[1],"sectionRole":[1,"section-role"]}]]],["admiralty-expansion.cjs",[[6,"admiralty-expansion",{"heading":[1],"expanded":[1540],"alignHeadingRight":[4,"align-heading-right"],"hideBorder":[4,"hide-border"]}]]],["admiralty-button.cjs",[[6,"admiralty-button",{"variant":[1],"icon":[1],"disabled":[516],"type":[1],"form":[1],"name":[1],"value":[1]}]]],["admiralty-hint_3.cjs",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -49,9 +49,7 @@
49
49
  "components/table-header/table-header.js",
50
50
  "components/table-header-cell/table-header-cell.js",
51
51
  "components/table-row/table-row.js",
52
- "components/textarea/textarea.js",
53
- "components/type-ahead/type-ahead.js",
54
- "components/type-ahead-item/type-ahead-item.js"
52
+ "components/textarea/textarea.js"
55
53
  ],
56
54
  "compiler": {
57
55
  "name": "@stencil/core",