@ukho/admiralty-core 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admiralty/admiralty.esm.js +1 -1
- package/dist/admiralty/admiralty.esm.js.map +1 -1
- package/dist/admiralty/{p-a789337a.entry.js → p-42579379.entry.js} +2 -2
- package/dist/admiralty/p-42579379.entry.js.map +1 -0
- package/dist/cjs/admiralty-header-profile.cjs.entry.js +3 -2
- package/dist/cjs/admiralty-header-profile.cjs.entry.js.map +1 -1
- package/dist/cjs/admiralty.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/header-profile/header-profile.js +21 -2
- package/dist/collection/components/header-profile/header-profile.js.map +1 -1
- package/dist/components/admiralty-header-profile.js +5 -3
- package/dist/components/admiralty-header-profile.js.map +1 -1
- package/dist/esm/admiralty-header-profile.entry.js +3 -2
- package/dist/esm/admiralty-header-profile.entry.js.map +1 -1
- package/dist/esm/admiralty.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/header-profile/header-profile.d.ts +6 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +2 -2
- package/dist/admiralty/p-a789337a.entry.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-a2b7bb90.js";export{s as setNonce}from"./p-a2b7bb90.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a([["p-2d32c7eb",[[6,"admiralty-type-ahead",{value:[1],label:[1],hint:[1],placeholder:[1],resultsOnInitFocus:[4,"results-on-init-focus"],filterResult:[32]}]]],["p-b5beb563",[[6,"admiralty-select",{disabled:[4],invalid:[4],invalidMessage:[1,"invalid-message"],hint:[1],label:[1],width:[2],value:[1032]}]]],["p-3e91e95a",[[2,"admiralty-textarea",{label:[1],hint:[1],width:[2],maxLength:[2,"max-length"],disabled:[4],invalid:[4],invalidMessage:[1,"invalid-message"],value:[1032]}]]],["p-64161157",[[6,"admiralty-colour-block",{width:[2],height:[2],heading:[1],colour:[1],actionText:[1,"action-text"]}]]],["p-42fb6dcf",[[2,"admiralty-file-input",{label:[1],multiple:[4],invalid:[4],invalidMessage:[1,"invalid-message"],files:[32]}]]],["p-c4df365d",[[6,"admiralty-filter",{filterTitle:[1,"filter-title"]}]]],["p-cb194645",[[6,"admiralty-filter-group",{groupTitle:[1,"group-title"]}]]],["p-882e7a76",[[2,"admiralty-paginator",{pages:[2],currentPage:[2,"current-page"],label:[1]}]]],["p-620e0985",[[6,"admiralty-radio-group",{name:[1],value:[1032],displayVertical:[4,"display-vertical"],invalid:[4],invalidMessage:[1,"invalid-message"]}]]],["p-e933ddcb",[[6,"admiralty-breadcrumb",{active:[4],first:[4],href:[1]}]]],["p-77959dca",[[6,"admiralty-dialogue",{type:[1],heading:[1]}]]],["p-dabb5fd0",[[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]}]]],["p-642161f7",[[2,"admiralty-progress-bar",{label:[1],progression:[2],error:[4],progressionValue:[32]}]]],["p-0a89a32e",[[6,"admiralty-read-more",{heading:[1],expanded:[32]}]]],["p-85edda7b",[[6,"admiralty-breadcrumbs"]]],["p-91c5dc57",[[6,"admiralty-card",{heading:[1]}]]],["p-5e382d3b",[[2,"admiralty-checkbox",{checkboxRight:[4,"checkbox-right"],disabled:[4],name:[1],checked:[1028],value:[8],labelText:[1,"label-text"]}]]],["p-20e669e3",[[6,"admiralty-footer",{imageLink:[1,"image-link"],imageSrc:[1,"image-src"],imageAlt:[1,"image-alt"],text:[1]}]]],["p-e861546b",[[6,"admiralty-header-menu-item",{menuTitle:[1,"menu-title"],active:[4]}]]],["p-
|
|
1
|
+
import{p as e,b as a}from"./p-a2b7bb90.js";export{s as setNonce}from"./p-a2b7bb90.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a([["p-2d32c7eb",[[6,"admiralty-type-ahead",{value:[1],label:[1],hint:[1],placeholder:[1],resultsOnInitFocus:[4,"results-on-init-focus"],filterResult:[32]}]]],["p-b5beb563",[[6,"admiralty-select",{disabled:[4],invalid:[4],invalidMessage:[1,"invalid-message"],hint:[1],label:[1],width:[2],value:[1032]}]]],["p-3e91e95a",[[2,"admiralty-textarea",{label:[1],hint:[1],width:[2],maxLength:[2,"max-length"],disabled:[4],invalid:[4],invalidMessage:[1,"invalid-message"],value:[1032]}]]],["p-64161157",[[6,"admiralty-colour-block",{width:[2],height:[2],heading:[1],colour:[1],actionText:[1,"action-text"]}]]],["p-42fb6dcf",[[2,"admiralty-file-input",{label:[1],multiple:[4],invalid:[4],invalidMessage:[1,"invalid-message"],files:[32]}]]],["p-c4df365d",[[6,"admiralty-filter",{filterTitle:[1,"filter-title"]}]]],["p-cb194645",[[6,"admiralty-filter-group",{groupTitle:[1,"group-title"]}]]],["p-882e7a76",[[2,"admiralty-paginator",{pages:[2],currentPage:[2,"current-page"],label:[1]}]]],["p-620e0985",[[6,"admiralty-radio-group",{name:[1],value:[1032],displayVertical:[4,"display-vertical"],invalid:[4],invalidMessage:[1,"invalid-message"]}]]],["p-e933ddcb",[[6,"admiralty-breadcrumb",{active:[4],first:[4],href:[1]}]]],["p-77959dca",[[6,"admiralty-dialogue",{type:[1],heading:[1]}]]],["p-dabb5fd0",[[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]}]]],["p-642161f7",[[2,"admiralty-progress-bar",{label:[1],progression:[2],error:[4],progressionValue:[32]}]]],["p-0a89a32e",[[6,"admiralty-read-more",{heading:[1],expanded:[32]}]]],["p-85edda7b",[[6,"admiralty-breadcrumbs"]]],["p-91c5dc57",[[6,"admiralty-card",{heading:[1]}]]],["p-5e382d3b",[[2,"admiralty-checkbox",{checkboxRight:[4,"checkbox-right"],disabled:[4],name:[1],checked:[1028],value:[8],labelText:[1,"label-text"]}]]],["p-20e669e3",[[6,"admiralty-footer",{imageLink:[1,"image-link"],imageSrc:[1,"image-src"],imageAlt:[1,"image-alt"],text:[1]}]]],["p-e861546b",[[6,"admiralty-header-menu-item",{menuTitle:[1,"menu-title"],active:[4]}]]],["p-42579379",[[2,"admiralty-header-profile",{isSignedIn:[4,"is-signed-in"],signedInText:[1,"signed-in-text"],signInOnly:[4,"sign-in-only"]}]]],["p-eedd8c86",[[2,"admiralty-header-sub-menu-item",{menuTitle:[1,"menu-title"]}]]],["p-2f1aa2ab",[[2,"admiralty-hr"]]],["p-f7e348fc",[[6,"admiralty-link",{href:[1],newTab:[4,"new-tab"]}]]],["p-1a46f741",[[4,"admiralty-paginator-wrapper",null,[[0,"pageChange","pageChangedHandler"]]]]],["p-35f7c1ac",[[2,"admiralty-phase-banner",{phase:[1],link:[1]}]]],["p-b154f85e",[[6,"admiralty-radio",{name:[1],value:[1025],disabled:[4],checked:[1028],invalid:[4],buttonTabindex:[32],setButtonTabindex:[64]}]]],["p-1e5d6d5c",[[6,"admiralty-side-nav",{label:[1]}]]],["p-cc7da7d1",[[2,"admiralty-side-nav-item",{sideNavItemId:[1,"side-nav-item-id"],headingTitle:[1,"heading-title"],navActive:[4,"nav-active"]}]]],["p-42c8f788",[[4,"admiralty-side-nav-wrapper",null,[[0,"sideNavItemSelected","onSideNavItemSelected"]]]]],["p-ae604366",[[6,"admiralty-tab",{label:[1],tabLabelId:[1,"tab-label-id"],tabContentId:[1,"tab-content-id"]}]]],["p-eb68c30f",[[6,"admiralty-tab-group",{selectedIndex:[1026,"selected-index"]}]]],["p-1b4b629f",[[6,"admiralty-table",{caption:[1]}]]],["p-fe911ac8",[[6,"admiralty-table-body"]]],["p-478e51ae",[[6,"admiralty-table-cell"]]],["p-b0b751a0",[[6,"admiralty-table-header"]]],["p-72d0c7c2",[[6,"admiralty-table-header-cell"]]],["p-fd0c5de8",[[6,"admiralty-table-row"]]],["p-33ba3be8",[[2,"admiralty-type-ahead-item",{value:[1]}]]],["p-c64073fa",[[1,"admiralty-icon",{iconName:[1,"icon-name"],iconPrefix:[1,"icon-prefix"]}]]],["p-20c06ebe",[[2,"admiralty-input",{name:[1],label:[1],hint:[1],disabled:[4],type:[1],placeholder:[1],width:[2],maxLength:[2,"max-length"],required:[4],invalid:[4],invalidMessage:[1,"invalid-message"],autocomplete:[1],value:[1032]}]]],["p-0d619a62",[[6,"admiralty-expansion",{heading:[1],expanded:[1540],alignHeadingRight:[4,"align-heading-right"],hideBorder:[4,"hide-border"]}]]],["p-af9cebdd",[[6,"admiralty-button",{variant:[1],icon:[1],disabled:[516],type:[1]}]]],["p-efb90d98",[[6,"admiralty-hint",{disabled:[4]}],[6,"admiralty-label",{disabled:[4],for:[1]}],[6,"admiralty-input-invalid"]]]],e)));
|
|
2
2
|
//# sourceMappingURL=admiralty.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","value","label","hint","placeholder","resultsOnInitFocus","filterResult","disabled","invalid","invalidMessage","width","maxLength","height","heading","colour","actionText","multiple","files","filterTitle","groupTitle","pages","currentPage","name","displayVertical","active","first","type","headerTitle","headerTitleUrl","logoLinkUrl","logoImgUrl","logoAltText","mobileMenuOpen","displayHamburger","progression","error","progressionValue","expanded","checkboxRight","checked","labelText","imageLink","imageSrc","imageAlt","text","menuTitle","isSignedIn","signedInText","newTab","phase","link","buttonTabindex","setButtonTabindex","sideNavItemId","headingTitle","navActive","tabLabelId","tabContentId","selectedIndex","caption","iconName","iconPrefix","required","autocomplete","alignHeadingRight","hideBorder","variant","icon","for"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.4.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAmBA,MAAMA,EAAe,KAkCjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAiB3E,GAAuBF,IAAe,GAAI,CACtCE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IAGrD,CAcI,OAAOC,EAAeJ,EAAK,ECrF/BH,IAAeQ,MAAKC,GAEXC,EAAc,0CAAuC,CAAAC,MAAA,IAAAC,MAAA,IAAAC,KAAA,IAAAC,YAAA,IAAAC,mBAAA,4BAAAC,aAAA,+CAAAC,SAAA,IAAAC,QAAA,IAAAC,eAAA,sBAAAN,KAAA,IAAAD,MAAA,IAAAQ,MAAA,IAAAT,MAAA,mDAAAC,MAAA,IAAAC,KAAA,IAAAO,MAAA,IAAAC,UAAA,iBAAAJ,SAAA,IAAAC,QAAA,IAAAC,eAAA,sBAAAR,MAAA,uDAAAS,MAAA,IAAAE,OAAA,IAAAC,QAAA,IAAAC,OAAA,IAAAC,WAAA,gEAAAb,MAAA,IAAAc,SAAA,IAAAR,QAAA,IAAAC,eAAA,sBAAAQ,MAAA,+CAAAC,YAAA,mEAAAC,WAAA,+DAAAC,MAAA,IAAAC,YAAA,mBAAAnB,MAAA,mDAAAoB,KAAA,IAAArB,MAAA,OAAAsB,gBAAA,uBAAAf,QAAA,IAAAC,eAAA,oEAAAe,OAAA,IAAAC,MAAA,IAAA7B,KAAA,gDAAA8B,KAAA,IAAAb,QAAA,8CAAAc,YAAA,mBAAAC,eAAA,uBAAAC,YAAA,oBAAAC,WAAA,mBAAAC,YAAA,oBAAAC,eAAA,KAAAC,iBAAA,qDAAA/B,MAAA,IAAAgC,YAAA,IAAAC,MAAA,IAAAC,iBAAA,kDAAAvB,QAAA,IAAAwB,SAAA,0FAAAxB,QAAA,gDAAAyB,cAAA,qBAAA/B,SAAA,IAAAe,KAAA,IAAAiB,QAAA,OAAAtC,MAAA,IAAAuC,UAAA,2DAAAC,UAAA,iBAAAC,SAAA,gBAAAC,SAAA,gBAAAC,KAAA,wDAAAC,UAAA,iBAAArB,OAAA,sDAAAsB,WAAA,mBAAAC,aAAA,6EAAAF,UAAA,6FAAAjD,KAAA,IAAAoD,OAAA,8JAAAC,MAAA,IAAAC,KAAA,6CAAA5B,KAAA,IAAArB,MAAA,OAAAM,SAAA,IAAAgC,QAAA,OAAA/B,QAAA,IAAA2C,eAAA,KAAAC,kBAAA,iDAAAlD,MAAA,qDAAAmD,cAAA,uBAAAC,aAAA,oBAAAC,UAAA,mKAAArD,MAAA,IAAAsD,WAAA,mBAAAC,aAAA,kEAAAC,cAAA,iEAAAC,QAAA,2RAAA1D,MAAA,4CAAA2D,SAAA,gBAAAC,WAAA,2DAAAvC,KAAA,IAAApB,MAAA,IAAAC,KAAA,IAAAI,SAAA,IAAAmB,KAAA,IAAAtB,YAAA,IAAAM,MAAA,IAAAC,UAAA,iBAAAmD,SAAA,IAAAtD,QAAA,IAAAC,eAAA,sBAAAsD,aAAA,IAAA9D,MAAA,oDAAAY,QAAA,IAAAwB,SAAA,OAAA2B,kBAAA,0BAAAC,WAAA,4DAAAC,QAAA,IAAAC,KAAA,IAAA5D,SAAA,MAAAmB,KAAA,4CAAAnB,SAAA,4BAAAA,SAAA,IAAA6D,IAAA,uCAAArE"}
|
|
1
|
+
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","value","label","hint","placeholder","resultsOnInitFocus","filterResult","disabled","invalid","invalidMessage","width","maxLength","height","heading","colour","actionText","multiple","files","filterTitle","groupTitle","pages","currentPage","name","displayVertical","active","first","type","headerTitle","headerTitleUrl","logoLinkUrl","logoImgUrl","logoAltText","mobileMenuOpen","displayHamburger","progression","error","progressionValue","expanded","checkboxRight","checked","labelText","imageLink","imageSrc","imageAlt","text","menuTitle","isSignedIn","signedInText","signInOnly","newTab","phase","link","buttonTabindex","setButtonTabindex","sideNavItemId","headingTitle","navActive","tabLabelId","tabContentId","selectedIndex","caption","iconName","iconPrefix","required","autocomplete","alignHeadingRight","hideBorder","variant","icon","for"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.4.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAmBA,MAAMA,EAAe,KAkCjB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAiB3E,GAAuBF,IAAe,GAAI,CACtCE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IAGrD,CAcI,OAAOC,EAAeJ,EAAK,ECrF/BH,IAAeQ,MAAKC,GAEXC,EAAc,0CAAuC,CAAAC,MAAA,IAAAC,MAAA,IAAAC,KAAA,IAAAC,YAAA,IAAAC,mBAAA,4BAAAC,aAAA,+CAAAC,SAAA,IAAAC,QAAA,IAAAC,eAAA,sBAAAN,KAAA,IAAAD,MAAA,IAAAQ,MAAA,IAAAT,MAAA,mDAAAC,MAAA,IAAAC,KAAA,IAAAO,MAAA,IAAAC,UAAA,iBAAAJ,SAAA,IAAAC,QAAA,IAAAC,eAAA,sBAAAR,MAAA,uDAAAS,MAAA,IAAAE,OAAA,IAAAC,QAAA,IAAAC,OAAA,IAAAC,WAAA,gEAAAb,MAAA,IAAAc,SAAA,IAAAR,QAAA,IAAAC,eAAA,sBAAAQ,MAAA,+CAAAC,YAAA,mEAAAC,WAAA,+DAAAC,MAAA,IAAAC,YAAA,mBAAAnB,MAAA,mDAAAoB,KAAA,IAAArB,MAAA,OAAAsB,gBAAA,uBAAAf,QAAA,IA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 @@
|
|
|
1
|
-
import{r as e,c as i,h as a,H as d,g as r}from"./p-a2b7bb90.js";import{K as t}from"./p-fc357b58.js";const o="@media (max-width: 1023px){.desktop-only.sc-admiralty-header-profile{display:none}}@media (min-width: 1024px){.not-desktop.sc-admiralty-header-profile{display:none}}@media (min-width: 1024px){.tablet-only.sc-admiralty-header-profile{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-only.sc-admiralty-header-profile{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-or-desktop.sc-admiralty-header-profile{display:none}}@media (min-width: 1024px){.phone-or-tablet.sc-admiralty-header-profile{display:none}}@media (min-width: 1024px){.phone-only.sc-admiralty-header-profile{display:none}}@media (max-width: 1023px) and (min-width: 480px){.phone-only.sc-admiralty-header-profile{display:none}}.header-profile.sc-admiralty-header-profile{color:#09315b;cursor:pointer}@media (min-width: 1024px){.header-profile.sc-admiralty-header-profile{display:flex;flex:0;flex-direction:column;font-size:18px !important;height:100%;justify-content:center;line-height:1.33em;margin-bottom:0;min-width:4em;max-width:11.1em;padding:0 1.65em;position:relative;text-align:center}.header-profile.sc-admiralty-header-profile .not-desktop.sc-admiralty-header-profile{display:none}.header-profile.sc-admiralty-header-profile button.sc-admiralty-header-profile{all:unset;height:100%;width:100%;font-weight:normal}.header-profile.sc-admiralty-header-profile button.sc-admiralty-header-profile:focus{outline:none;box-shadow:#ffdd00 inset 0 0 0 3px}.header-profile.sc-admiralty-header-profile:hover{box-shadow:inset 0 -5px #09315b;background-color:#f0f0f0}.header-profile.sc-admiralty-header-profile:hover .desktop.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile{display:flex}.header-profile.active.sc-admiralty-header-profile{box-shadow:inset 0 -5px #09315b}.header-profile.active.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile{display:flex}.header-profile.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile{display:none;flex-direction:column;font-size:18px;position:absolute;top:100%;right:0;border:1px solid #d8d8d8;width:300px}.header-profile.sc-admiralty-header-profile .sub-menu.desktop-visible.sc-admiralty-header-profile{display:flex}.header-profile.sc-admiralty-header-profile .sub-menu.desktop-hide.sc-admiralty-header-profile{display:none}.header-profile.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile{box-sizing:content-box;margin:0;width:100%;all:unset;box-sizing:border-box;display:block;font-weight:300;height:100%;padding:10px;text-align:left;width:100%}.header-profile.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile:focus{outline:none;box-shadow:#ffdd00 inset 0 0 0 3px}.header-profile.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile:hover{background-color:#f0f0f0}}@media (max-width: 1023px){.header-profile.sc-admiralty-header-profile{border-top:1px solid #d8d8d8}.header-profile.sc-admiralty-header-profile .desktop.sc-admiralty-header-profile{display:none}.header-profile.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile{display:block;box-sizing:border-box;font-size:18px;font-weight:500;background-color:unset;text-align:unset;text-decoration:unset;padding:12px}.header-profile.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile:hover{background-color:#f0f0f0}.header-profile.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile:focus{outline:none;box-shadow:#ffdd00 inset 0 0 0 3px}}";const s=class{constructor(a){e(this,a);this.signInClicked=i(this,"signInClicked",7);this.yourAccountClicked=i(this,"yourAccountClicked",7);this.signOutClicked=i(this,"signOutClicked",7);this.handleSignIn=()=>{this.signInClicked.emit()};this.handleSignInKeyDown=e=>{if(e.key===t.ENTER||e.key===t.SPACE){this.signInClicked.emit()}};this.handleSignOut=()=>{this.signOutClicked.emit()};this.handleSignOutKeyDown=e=>{if(e.key===t.ENTER||e.key===t.SPACE){this.signOutClicked.emit()}};this.handleYourAccount=()=>{this.yourAccountClicked.emit()};this.handleYourAccountKeyDown=e=>{if(e.key===t.ENTER||e.key===t.SPACE){this.yourAccountClicked.emit()}};this.closeDropdown=()=>{const e=this.el.querySelector("div.sub-menu");e.classList.add("desktop-hide")};this.toggleDropdown=e=>{const i=this.el.querySelector("div.sub-menu");if(i.classList.contains("desktop-hide")){i.classList.add("desktop-visible");i.classList.remove("desktop-hide")}else{i.classList.add("desktop-hide");i.classList.remove("desktop-visible")}};this.handleClickSignedIn=e=>{e.stopPropagation();this.toggleDropdown(e)};this.isSignedIn=false;this.signedInText="replace"}render(){let{isSignedIn:e,signedInText:i}=this;return a(d,null,a("div",{class:"header-profile"},e?a("div",null,a("div",{class:"desktop",onMouseOver:this.toggleDropdown},a("button",{onClick:this.handleClickSignedIn,tabindex:"0"},i)
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as i,h as a,H as d,g as r}from"./p-a2b7bb90.js";import{K as t}from"./p-fc357b58.js";const o="@media (max-width: 1023px){.desktop-only.sc-admiralty-header-profile{display:none}}@media (min-width: 1024px){.not-desktop.sc-admiralty-header-profile{display:none}}@media (min-width: 1024px){.tablet-only.sc-admiralty-header-profile{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-only.sc-admiralty-header-profile{display:none}}@media (max-width: 479px) and (min-width: 0px){.tablet-or-desktop.sc-admiralty-header-profile{display:none}}@media (min-width: 1024px){.phone-or-tablet.sc-admiralty-header-profile{display:none}}@media (min-width: 1024px){.phone-only.sc-admiralty-header-profile{display:none}}@media (max-width: 1023px) and (min-width: 480px){.phone-only.sc-admiralty-header-profile{display:none}}.header-profile.sc-admiralty-header-profile{color:#09315b;cursor:pointer}@media (min-width: 1024px){.header-profile.sc-admiralty-header-profile{display:flex;flex:0;flex-direction:column;font-size:18px !important;height:100%;justify-content:center;line-height:1.33em;margin-bottom:0;min-width:4em;max-width:11.1em;padding:0 1.65em;position:relative;text-align:center}.header-profile.sc-admiralty-header-profile .not-desktop.sc-admiralty-header-profile{display:none}.header-profile.sc-admiralty-header-profile button.sc-admiralty-header-profile{all:unset;height:100%;width:100%;font-weight:normal}.header-profile.sc-admiralty-header-profile button.sc-admiralty-header-profile:focus{outline:none;box-shadow:#ffdd00 inset 0 0 0 3px}.header-profile.sc-admiralty-header-profile:hover{box-shadow:inset 0 -5px #09315b;background-color:#f0f0f0}.header-profile.sc-admiralty-header-profile:hover .desktop.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile{display:flex}.header-profile.active.sc-admiralty-header-profile{box-shadow:inset 0 -5px #09315b}.header-profile.active.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile{display:flex}.header-profile.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile{display:none;flex-direction:column;font-size:18px;position:absolute;top:100%;right:0;border:1px solid #d8d8d8;width:300px}.header-profile.sc-admiralty-header-profile .sub-menu.desktop-visible.sc-admiralty-header-profile{display:flex}.header-profile.sc-admiralty-header-profile .sub-menu.desktop-hide.sc-admiralty-header-profile{display:none}.header-profile.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile{box-sizing:content-box;margin:0;width:100%;all:unset;box-sizing:border-box;display:block;font-weight:300;height:100%;padding:10px;text-align:left;width:100%}.header-profile.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile:focus{outline:none;box-shadow:#ffdd00 inset 0 0 0 3px}.header-profile.sc-admiralty-header-profile .sub-menu.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile:hover{background-color:#f0f0f0}}@media (max-width: 1023px){.header-profile.sc-admiralty-header-profile{border-top:1px solid #d8d8d8}.header-profile.sc-admiralty-header-profile .desktop.sc-admiralty-header-profile{display:none}.header-profile.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile{display:block;box-sizing:border-box;font-size:18px;font-weight:500;background-color:unset;text-align:unset;text-decoration:unset;padding:12px}.header-profile.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile:hover{background-color:#f0f0f0}.header-profile.sc-admiralty-header-profile .sub-menu-item.sc-admiralty-header-profile:focus{outline:none;box-shadow:#ffdd00 inset 0 0 0 3px}}";const s=class{constructor(a){e(this,a);this.signInClicked=i(this,"signInClicked",7);this.yourAccountClicked=i(this,"yourAccountClicked",7);this.signOutClicked=i(this,"signOutClicked",7);this.handleSignIn=()=>{this.signInClicked.emit()};this.handleSignInKeyDown=e=>{if(e.key===t.ENTER||e.key===t.SPACE){this.signInClicked.emit()}};this.handleSignOut=()=>{this.signOutClicked.emit()};this.handleSignOutKeyDown=e=>{if(e.key===t.ENTER||e.key===t.SPACE){this.signOutClicked.emit()}};this.handleYourAccount=()=>{this.yourAccountClicked.emit()};this.handleYourAccountKeyDown=e=>{if(e.key===t.ENTER||e.key===t.SPACE){this.yourAccountClicked.emit()}};this.closeDropdown=()=>{const e=this.el.querySelector("div.sub-menu");e.classList.add("desktop-hide")};this.toggleDropdown=e=>{const i=this.el.querySelector("div.sub-menu");if(i.classList.contains("desktop-hide")){i.classList.add("desktop-visible");i.classList.remove("desktop-hide")}else{i.classList.add("desktop-hide");i.classList.remove("desktop-visible")}};this.handleClickSignedIn=e=>{e.stopPropagation();this.toggleDropdown(e)};this.isSignedIn=false;this.signedInText="replace";this.signInOnly=false}render(){let{isSignedIn:e,signedInText:i,signInOnly:r}=this;return a(d,null,a("div",{class:"header-profile"},e?a("div",null,a("div",{class:"desktop",onMouseOver:this.toggleDropdown},a("button",{onClick:this.handleClickSignedIn,tabindex:"0"},i),!r?a("div",{class:"sub-menu desktop-hide"},a("button",{class:"sub-menu-item",onClick:this.handleYourAccount,tabindex:"0"},"Your Account"),a("button",{class:"sub-menu-item",onClick:this.handleSignOut,tabindex:"0"},"Sign Out")):null),!r?a("div",{class:"not-desktop"},a("div",{class:"sub-menu-item",onClick:this.handleYourAccount,onKeyDown:this.handleYourAccountKeyDown,tabindex:"0"},"Your Account"),a("div",{class:"sub-menu-item",onClick:this.handleSignOut,onKeyDown:this.handleSignOutKeyDown,tabindex:"0"},"Sign Out")):null):a("button",{class:"sub-menu-item",onClick:this.handleSignIn,tabindex:"0"},"Sign In")))}get el(){return r(this)}};s.style=o;export{s as admiralty_header_profile};
|
|
2
|
+
//# sourceMappingURL=p-42579379.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["headerProfileCss","HeaderProfileComponent","this","handleSignIn","signInClicked","emit","handleSignInKeyDown","ev","key","Keys","ENTER","SPACE","handleSignOut","signOutClicked","handleSignOutKeyDown","handleYourAccount","yourAccountClicked","handleYourAccountKeyDown","closeDropdown","subMenu","el","querySelector","classList","add","toggleDropdown","_ev","contains","remove","handleClickSignedIn","stopPropagation","render","isSignedIn","signedInText","signInOnly","h","Host","class","onMouseOver","onClick","tabindex","onKeyDown"],"sources":["./src/components/header-profile/header-profile.scss?tag=admiralty-header-profile&encapsulation=scoped","./src/components/header-profile/header-profile.tsx"],"sourcesContent":["@use '../../scss/vars/colours' as colours;\n@use '../../scss/base/responsive';\n@use '../../scss/vars/typography';\n\n@mixin active {\n box-shadow: inset 0 -5px colours.$colour-admiralty-blue;\n}\n\n.header-profile {\n color: colours.$colour-admiralty-blue;\n cursor: pointer;\n\n @include responsive.desktop-only {\n .not-desktop {\n display: none;\n }\n\n display: flex;\n flex: 0;\n flex-direction: column;\n font-size: typography.$font-size-normal !important;\n height: 100%;\n justify-content: center;\n line-height: 1.33em;\n margin-bottom: 0;\n min-width: 4em;\n max-width: 11.1em;\n padding: 0 1.65em;\n position: relative;\n text-align: center;\n\n button {\n all: unset;\n height: 100%;\n width: 100%;\n font-weight: typography.$font-weight-medium;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n\n &:hover {\n @include active;\n background-color: colours.$colour-nav-bg-hover;\n\n .desktop .sub-menu {\n display: flex;\n }\n }\n\n &.active {\n @include active;\n\n .sub-menu {\n display: flex;\n }\n }\n\n .sub-menu {\n display: none;\n flex-direction: column;\n font-size: typography.$font-size-normal;\n position: absolute;\n top: 100%;\n right: 0;\n border: 1px solid colours.$colour-divider;\n width: 300px;\n\n &.desktop-visible {\n display: flex;\n }\n\n &.desktop-hide {\n display: none;\n }\n\n .sub-menu-item {\n box-sizing: content-box;\n margin: 0;\n width: 100%;\n\n all: unset;\n box-sizing: border-box;\n display: block;\n font-weight: typography.$font-weight-light;\n height: 100%;\n padding: 10px;\n text-align: left;\n width: 100%;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n }\n }\n }\n\n @include responsive.not-desktop {\n .desktop {\n display: none;\n }\n\n border-top: 1px solid colours.$colour-bg-header;\n\n .sub-menu-item {\n display: block;\n box-sizing: border-box;\n font-size: typography.$font-size-normal;\n font-weight: 500;\n background-color: unset;\n text-align: unset;\n text-decoration: unset;\n\n padding: 12px;\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n }\n}\n","import { Component, Event, Host, h, Prop, EventEmitter, Element } from '@stencil/core';\nimport { Keys } from '../Keys';\n\n@Component({\n tag: 'admiralty-header-profile',\n styleUrl: 'header-profile.scss',\n scoped: true,\n})\nexport class HeaderProfileComponent {\n @Element() el: HTMLElement;\n\n /**\n * A boolean to indicate if the user is signed in or not\n */\n @Prop() isSignedIn: boolean = false;\n\n /**\n * The text that is displayed after the user signs in\n */\n @Prop() signedInText: string = 'replace';\n\n /**\n * A boolean to indicate if the component should hide\n * the sign-out and account buttons, useful for internal\n * sites where the user must be always signed in.\n */\n @Prop() signInOnly: boolean = false;\n\n /**\n * The event that is fired when the user clicks on\n * the sign in button\n */\n @Event() signInClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'Your account' button\n */\n @Event() yourAccountClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'sign out' button\n */\n @Event() signOutClicked: EventEmitter<void>;\n\n handleSignIn = () => {\n this.signInClicked.emit();\n };\n\n handleSignInKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signInClicked.emit();\n }\n };\n\n handleSignOut = () => {\n this.signOutClicked.emit();\n };\n\n handleSignOutKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signOutClicked.emit();\n }\n };\n\n handleYourAccount = () => {\n this.yourAccountClicked.emit();\n };\n\n handleYourAccountKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.yourAccountClicked.emit();\n }\n };\n\n closeDropdown = () => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n subMenu.classList.add('desktop-hide');\n };\n\n toggleDropdown = (_ev: Event) => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n\n if (subMenu.classList.contains('desktop-hide')) {\n subMenu.classList.add('desktop-visible');\n subMenu.classList.remove('desktop-hide');\n } else {\n subMenu.classList.add('desktop-hide');\n subMenu.classList.remove('desktop-visible');\n }\n };\n\n handleClickSignedIn = (ev: MouseEvent) => {\n ev.stopPropagation();\n this.toggleDropdown(ev);\n };\n\n render() {\n let { isSignedIn, signedInText, signInOnly } = this;\n return (\n <Host>\n <div class=\"header-profile\">\n {isSignedIn ? (\n <div>\n <div class=\"desktop\" onMouseOver={this.toggleDropdown}>\n <button onClick={this.handleClickSignedIn} tabindex=\"0\">\n {signedInText}\n </button>\n {!signInOnly ? (\n <div class=\"sub-menu desktop-hide\">\n <button class=\"sub-menu-item\" onClick={this.handleYourAccount} tabindex=\"0\">\n Your Account\n </button>\n <button class=\"sub-menu-item\" onClick={this.handleSignOut} tabindex=\"0\">\n Sign Out\n </button>\n </div>\n ) : null}\n </div>\n {!signInOnly ? (\n <div class=\"not-desktop\">\n <div class=\"sub-menu-item\" onClick={this.handleYourAccount} onKeyDown={this.handleYourAccountKeyDown} tabindex=\"0\">\n Your Account\n </div>\n <div class=\"sub-menu-item\" onClick={this.handleSignOut} onKeyDown={this.handleSignOutKeyDown} tabindex=\"0\">\n Sign Out\n </div>\n </div>\n ) : null}\n </div>\n ) : (\n <button class=\"sub-menu-item\" onClick={this.handleSignIn} tabindex=\"0\">\n Sign In\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAmB,6hH,MCQZC,EAAsB,M,4KAsCjCC,KAAAC,aAAe,KACbD,KAAKE,cAAcC,MAAM,EAG3BH,KAAAI,oBAAuBC,IACrB,GAAIA,EAAGC,MAAQC,EAAKC,OAASH,EAAGC,MAAQC,EAAKE,MAAO,CAClDT,KAAKE,cAAcC,M,GAIvBH,KAAAU,cAAgB,KACdV,KAAKW,eAAeR,MAAM,EAG5BH,KAAAY,qBAAwBP,IACtB,GAAIA,EAAGC,MAAQC,EAAKC,OAASH,EAAGC,MAAQC,EAAKE,MAAO,CAClDT,KAAKW,eAAeR,M,GAIxBH,KAAAa,kBAAoB,KAClBb,KAAKc,mBAAmBX,MAAM,EAGhCH,KAAAe,yBAA4BV,IAC1B,GAAIA,EAAGC,MAAQC,EAAKC,OAASH,EAAGC,MAAQC,EAAKE,MAAO,CAClDT,KAAKc,mBAAmBX,M,GAI5BH,KAAAgB,cAAgB,KACd,MAAMC,EAA0BjB,KAAKkB,GAAGC,cAAc,gBACtDF,EAAQG,UAAUC,IAAI,eAAe,EAGvCrB,KAAAsB,eAAkBC,IAChB,MAAMN,EAA0BjB,KAAKkB,GAAGC,cAAc,gBAEtD,GAAIF,EAAQG,UAAUI,SAAS,gBAAiB,CAC9CP,EAAQG,UAAUC,IAAI,mBACtBJ,EAAQG,UAAUK,OAAO,e,KACpB,CACLR,EAAQG,UAAUC,IAAI,gBACtBJ,EAAQG,UAAUK,OAAO,kB,GAI7BzB,KAAA0B,oBAAuBrB,IACrBA,EAAGsB,kBACH3B,KAAKsB,eAAejB,EAAG,E,gBAjFK,M,kBAKC,U,gBAOD,K,CAwE9BuB,SACE,IAAIC,WAAEA,EAAUC,aAAEA,EAAYC,WAAEA,GAAe/B,KAC/C,OACEgC,EAACC,EAAI,KACHD,EAAA,OAAKE,MAAM,kBACRL,EACCG,EAAA,WACEA,EAAA,OAAKE,MAAM,UAAUC,YAAanC,KAAKsB,gBACrCU,EAAA,UAAQI,QAASpC,KAAK0B,oBAAqBW,SAAS,KACjDP,IAEDC,EACAC,EAAA,OAAKE,MAAM,yBACTF,EAAA,UAAQE,MAAM,gBAAgBE,QAASpC,KAAKa,kBAAmBwB,SAAS,KAAG,gBAG3EL,EAAA,UAAQE,MAAM,gBAAgBE,QAASpC,KAAKU,cAAe2B,SAAS,KAAG,aAIvE,OAEJN,EACAC,EAAA,OAAKE,MAAM,eACTF,EAAA,OAAKE,MAAM,gBAAgBE,QAASpC,KAAKa,kBAAmByB,UAAWtC,KAAKe,yBAA0BsB,SAAS,KAAG,gBAGlHL,EAAA,OAAKE,MAAM,gBAAgBE,QAASpC,KAAKU,cAAe4B,UAAWtC,KAAKY,qBAAsByB,SAAS,KAAG,aAI1G,MAGNL,EAAA,UAAQE,MAAM,gBAAgBE,QAASpC,KAAKC,aAAcoC,SAAS,KAAG,Y"}
|
|
@@ -58,10 +58,11 @@ const HeaderProfileComponent = class {
|
|
|
58
58
|
};
|
|
59
59
|
this.isSignedIn = false;
|
|
60
60
|
this.signedInText = 'replace';
|
|
61
|
+
this.signInOnly = false;
|
|
61
62
|
}
|
|
62
63
|
render() {
|
|
63
|
-
let { isSignedIn, signedInText } = this;
|
|
64
|
-
return (index.h(index.Host, null, index.h("div", { class: "header-profile" }, isSignedIn ? (index.h("div", null, index.h("div", { class: "desktop", onMouseOver: this.toggleDropdown }, index.h("button", { onClick: this.handleClickSignedIn, tabindex: "0" }, signedInText), index.h("div", { class: "sub-menu desktop-hide" }, index.h("button", { class: "sub-menu-item", onClick: this.handleYourAccount, tabindex: "0" }, "Your Account"), index.h("button", { class: "sub-menu-item", onClick: this.handleSignOut, tabindex: "0" }, "Sign Out"))), index.h("div", { class: "not-desktop" }, index.h("div", { class: "sub-menu-item", onClick: this.handleYourAccount, onKeyDown: this.handleYourAccountKeyDown, tabindex: "0" }, "Your Account"), index.h("div", { class: "sub-menu-item", onClick: this.handleSignOut, onKeyDown: this.handleSignOutKeyDown, tabindex: "0" }, "Sign Out")))) : (index.h("button", { class: "sub-menu-item", onClick: this.handleSignIn, tabindex: "0" }, "Sign In")))));
|
|
64
|
+
let { isSignedIn, signedInText, signInOnly } = this;
|
|
65
|
+
return (index.h(index.Host, null, index.h("div", { class: "header-profile" }, isSignedIn ? (index.h("div", null, index.h("div", { class: "desktop", onMouseOver: this.toggleDropdown }, index.h("button", { onClick: this.handleClickSignedIn, tabindex: "0" }, signedInText), !signInOnly ? (index.h("div", { class: "sub-menu desktop-hide" }, index.h("button", { class: "sub-menu-item", onClick: this.handleYourAccount, tabindex: "0" }, "Your Account"), index.h("button", { class: "sub-menu-item", onClick: this.handleSignOut, tabindex: "0" }, "Sign Out"))) : null), !signInOnly ? (index.h("div", { class: "not-desktop" }, index.h("div", { class: "sub-menu-item", onClick: this.handleYourAccount, onKeyDown: this.handleYourAccountKeyDown, tabindex: "0" }, "Your Account"), index.h("div", { class: "sub-menu-item", onClick: this.handleSignOut, onKeyDown: this.handleSignOutKeyDown, tabindex: "0" }, "Sign Out"))) : null)) : (index.h("button", { class: "sub-menu-item", onClick: this.handleSignIn, tabindex: "0" }, "Sign In")))));
|
|
65
66
|
}
|
|
66
67
|
get el() { return index.getElement(this); }
|
|
67
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"admiralty-header-profile.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,gBAAgB,GAAG,4hHAA4hH;;MCQxiH,sBAAsB;;;;;;
|
|
1
|
+
{"file":"admiralty-header-profile.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,gBAAgB,GAAG,4hHAA4hH;;MCQxiH,sBAAsB;;;;;;IAsC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,EACNA,iBAAK,KAAK,EAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,EAAC,GAAG,eAEpG,CACF,IACJ,IAAI,CACJ,KAENA,oBAAQ,KAAK,EAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAC,GAAG,cAE7D,CACV,CACG,CACD,EACP;GACH;;;;;;;","names":["Keys","h","Host"],"sources":["./src/components/header-profile/header-profile.scss?tag=admiralty-header-profile&encapsulation=scoped","./src/components/header-profile/header-profile.tsx"],"sourcesContent":["@use '../../scss/vars/colours' as colours;\n@use '../../scss/base/responsive';\n@use '../../scss/vars/typography';\n\n@mixin active {\n box-shadow: inset 0 -5px colours.$colour-admiralty-blue;\n}\n\n.header-profile {\n color: colours.$colour-admiralty-blue;\n cursor: pointer;\n\n @include responsive.desktop-only {\n .not-desktop {\n display: none;\n }\n\n display: flex;\n flex: 0;\n flex-direction: column;\n font-size: typography.$font-size-normal !important;\n height: 100%;\n justify-content: center;\n line-height: 1.33em;\n margin-bottom: 0;\n min-width: 4em;\n max-width: 11.1em;\n padding: 0 1.65em;\n position: relative;\n text-align: center;\n\n button {\n all: unset;\n height: 100%;\n width: 100%;\n font-weight: typography.$font-weight-medium;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n\n &:hover {\n @include active;\n background-color: colours.$colour-nav-bg-hover;\n\n .desktop .sub-menu {\n display: flex;\n }\n }\n\n &.active {\n @include active;\n\n .sub-menu {\n display: flex;\n }\n }\n\n .sub-menu {\n display: none;\n flex-direction: column;\n font-size: typography.$font-size-normal;\n position: absolute;\n top: 100%;\n right: 0;\n border: 1px solid colours.$colour-divider;\n width: 300px;\n\n &.desktop-visible {\n display: flex;\n }\n\n &.desktop-hide {\n display: none;\n }\n\n .sub-menu-item {\n box-sizing: content-box;\n margin: 0;\n width: 100%;\n\n all: unset;\n box-sizing: border-box;\n display: block;\n font-weight: typography.$font-weight-light;\n height: 100%;\n padding: 10px;\n text-align: left;\n width: 100%;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n }\n }\n }\n\n @include responsive.not-desktop {\n .desktop {\n display: none;\n }\n\n border-top: 1px solid colours.$colour-bg-header;\n\n .sub-menu-item {\n display: block;\n box-sizing: border-box;\n font-size: typography.$font-size-normal;\n font-weight: 500;\n background-color: unset;\n text-align: unset;\n text-decoration: unset;\n\n padding: 12px;\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n }\n}\n","import { Component, Event, Host, h, Prop, EventEmitter, Element } from '@stencil/core';\nimport { Keys } from '../Keys';\n\n@Component({\n tag: 'admiralty-header-profile',\n styleUrl: 'header-profile.scss',\n scoped: true,\n})\nexport class HeaderProfileComponent {\n @Element() el: HTMLElement;\n\n /**\n * A boolean to indicate if the user is signed in or not\n */\n @Prop() isSignedIn: boolean = false;\n\n /**\n * The text that is displayed after the user signs in\n */\n @Prop() signedInText: string = 'replace';\n\n /**\n * A boolean to indicate if the component should hide\n * the sign-out and account buttons, useful for internal\n * sites where the user must be always signed in.\n */\n @Prop() signInOnly: boolean = false;\n\n /**\n * The event that is fired when the user clicks on\n * the sign in button\n */\n @Event() signInClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'Your account' button\n */\n @Event() yourAccountClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'sign out' button\n */\n @Event() signOutClicked: EventEmitter<void>;\n\n handleSignIn = () => {\n this.signInClicked.emit();\n };\n\n handleSignInKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signInClicked.emit();\n }\n };\n\n handleSignOut = () => {\n this.signOutClicked.emit();\n };\n\n handleSignOutKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signOutClicked.emit();\n }\n };\n\n handleYourAccount = () => {\n this.yourAccountClicked.emit();\n };\n\n handleYourAccountKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.yourAccountClicked.emit();\n }\n };\n\n closeDropdown = () => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n subMenu.classList.add('desktop-hide');\n };\n\n toggleDropdown = (_ev: Event) => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n\n if (subMenu.classList.contains('desktop-hide')) {\n subMenu.classList.add('desktop-visible');\n subMenu.classList.remove('desktop-hide');\n } else {\n subMenu.classList.add('desktop-hide');\n subMenu.classList.remove('desktop-visible');\n }\n };\n\n handleClickSignedIn = (ev: MouseEvent) => {\n ev.stopPropagation();\n this.toggleDropdown(ev);\n };\n\n render() {\n let { isSignedIn, signedInText, signInOnly } = this;\n return (\n <Host>\n <div class=\"header-profile\">\n {isSignedIn ? (\n <div>\n <div class=\"desktop\" onMouseOver={this.toggleDropdown}>\n <button onClick={this.handleClickSignedIn} tabindex=\"0\">\n {signedInText}\n </button>\n {!signInOnly ? (\n <div class=\"sub-menu desktop-hide\">\n <button class=\"sub-menu-item\" onClick={this.handleYourAccount} tabindex=\"0\">\n Your Account\n </button>\n <button class=\"sub-menu-item\" onClick={this.handleSignOut} tabindex=\"0\">\n Sign Out\n </button>\n </div>\n ) : null}\n </div>\n {!signInOnly ? (\n <div class=\"not-desktop\">\n <div class=\"sub-menu-item\" onClick={this.handleYourAccount} onKeyDown={this.handleYourAccountKeyDown} tabindex=\"0\">\n Your Account\n </div>\n <div class=\"sub-menu-item\" onClick={this.handleSignOut} onKeyDown={this.handleSignOutKeyDown} tabindex=\"0\">\n Sign Out\n </div>\n </div>\n ) : null}\n </div>\n ) : (\n <button class=\"sub-menu-item\" onClick={this.handleSignIn} tabindex=\"0\">\n Sign In\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -20,7 +20,7 @@ const patchBrowser = () => {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
patchBrowser().then(options => {
|
|
23
|
-
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-select.cjs",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]}]]],["admiralty-textarea.cjs",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"maxLength":[2,"max-length"],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]}]]],["admiralty-colour-block.cjs",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"actionText":[1,"action-text"]}]]],["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-radio-group.cjs",[[6,"admiralty-radio-group",{"name":[1],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]}]]],["admiralty-breadcrumb.cjs",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-dialogue.cjs",[[6,"admiralty-dialogue",{"type":[1],"heading":[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-progress-bar.cjs",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]}]]],["admiralty-read-more.cjs",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["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":[1028],"value":[8],"labelText":[1,"label-text"]}]]],["admiralty-footer.cjs",[[6,"admiralty-footer",{"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1]}]]],["admiralty-header-menu-item.cjs",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-profile.cjs",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"]}]]],["admiralty-header-sub-menu-item.cjs",[[2,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"]}]]],["admiralty-hr.cjs",[[2,"admiralty-hr"]]],["admiralty-link.cjs",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["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]}]]],["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-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],"maxLength":[2,"max-length"],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]}]]],["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]}]]],["admiralty-hint_3.cjs",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
|
|
23
|
+
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-select.cjs",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]}]]],["admiralty-textarea.cjs",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"maxLength":[2,"max-length"],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]}]]],["admiralty-colour-block.cjs",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"actionText":[1,"action-text"]}]]],["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-radio-group.cjs",[[6,"admiralty-radio-group",{"name":[1],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]}]]],["admiralty-breadcrumb.cjs",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-dialogue.cjs",[[6,"admiralty-dialogue",{"type":[1],"heading":[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-progress-bar.cjs",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]}]]],["admiralty-read-more.cjs",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["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":[1028],"value":[8],"labelText":[1,"label-text"]}]]],["admiralty-footer.cjs",[[6,"admiralty-footer",{"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1]}]]],["admiralty-header-menu-item.cjs",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["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",[[2,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"]}]]],["admiralty-hr.cjs",[[2,"admiralty-hr"]]],["admiralty-link.cjs",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["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]}]]],["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-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],"maxLength":[2,"max-length"],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]}]]],["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]}]]],["admiralty-hint_3.cjs",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
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-select.cjs",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]}]]],["admiralty-textarea.cjs",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"maxLength":[2,"max-length"],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]}]]],["admiralty-colour-block.cjs",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"actionText":[1,"action-text"]}]]],["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-radio-group.cjs",[[6,"admiralty-radio-group",{"name":[1],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]}]]],["admiralty-breadcrumb.cjs",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-dialogue.cjs",[[6,"admiralty-dialogue",{"type":[1],"heading":[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-progress-bar.cjs",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]}]]],["admiralty-read-more.cjs",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["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":[1028],"value":[8],"labelText":[1,"label-text"]}]]],["admiralty-footer.cjs",[[6,"admiralty-footer",{"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1]}]]],["admiralty-header-menu-item.cjs",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-profile.cjs",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"]}]]],["admiralty-header-sub-menu-item.cjs",[[2,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"]}]]],["admiralty-hr.cjs",[[2,"admiralty-hr"]]],["admiralty-link.cjs",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["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]}]]],["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-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],"maxLength":[2,"max-length"],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]}]]],["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]}]]],["admiralty-hint_3.cjs",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
|
|
17
|
+
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-select.cjs",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]}]]],["admiralty-textarea.cjs",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"maxLength":[2,"max-length"],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]}]]],["admiralty-colour-block.cjs",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"actionText":[1,"action-text"]}]]],["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-radio-group.cjs",[[6,"admiralty-radio-group",{"name":[1],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]}]]],["admiralty-breadcrumb.cjs",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-dialogue.cjs",[[6,"admiralty-dialogue",{"type":[1],"heading":[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-progress-bar.cjs",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]}]]],["admiralty-read-more.cjs",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["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":[1028],"value":[8],"labelText":[1,"label-text"]}]]],["admiralty-footer.cjs",[[6,"admiralty-footer",{"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1]}]]],["admiralty-header-menu-item.cjs",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["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",[[2,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"]}]]],["admiralty-hr.cjs",[[2,"admiralty-hr"]]],["admiralty-link.cjs",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["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]}]]],["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-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],"maxLength":[2,"max-length"],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]}]]],["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]}]]],["admiralty-hint_3.cjs",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -47,10 +47,11 @@ export class HeaderProfileComponent {
|
|
|
47
47
|
};
|
|
48
48
|
this.isSignedIn = false;
|
|
49
49
|
this.signedInText = 'replace';
|
|
50
|
+
this.signInOnly = false;
|
|
50
51
|
}
|
|
51
52
|
render() {
|
|
52
|
-
let { isSignedIn, signedInText } = this;
|
|
53
|
-
return (h(Host, null, h("div", { class: "header-profile" }, isSignedIn ? (h("div", null, h("div", { class: "desktop", onMouseOver: this.toggleDropdown }, h("button", { onClick: this.handleClickSignedIn, tabindex: "0" }, signedInText), h("div", { class: "sub-menu desktop-hide" }, h("button", { class: "sub-menu-item", onClick: this.handleYourAccount, tabindex: "0" }, "Your Account"), h("button", { class: "sub-menu-item", onClick: this.handleSignOut, tabindex: "0" }, "Sign Out"))), h("div", { class: "not-desktop" }, h("div", { class: "sub-menu-item", onClick: this.handleYourAccount, onKeyDown: this.handleYourAccountKeyDown, tabindex: "0" }, "Your Account"), h("div", { class: "sub-menu-item", onClick: this.handleSignOut, onKeyDown: this.handleSignOutKeyDown, tabindex: "0" }, "Sign Out")))) : (h("button", { class: "sub-menu-item", onClick: this.handleSignIn, tabindex: "0" }, "Sign In")))));
|
|
53
|
+
let { isSignedIn, signedInText, signInOnly } = this;
|
|
54
|
+
return (h(Host, null, h("div", { class: "header-profile" }, isSignedIn ? (h("div", null, h("div", { class: "desktop", onMouseOver: this.toggleDropdown }, h("button", { onClick: this.handleClickSignedIn, tabindex: "0" }, signedInText), !signInOnly ? (h("div", { class: "sub-menu desktop-hide" }, h("button", { class: "sub-menu-item", onClick: this.handleYourAccount, tabindex: "0" }, "Your Account"), h("button", { class: "sub-menu-item", onClick: this.handleSignOut, tabindex: "0" }, "Sign Out"))) : null), !signInOnly ? (h("div", { class: "not-desktop" }, h("div", { class: "sub-menu-item", onClick: this.handleYourAccount, onKeyDown: this.handleYourAccountKeyDown, tabindex: "0" }, "Your Account"), h("div", { class: "sub-menu-item", onClick: this.handleSignOut, onKeyDown: this.handleSignOutKeyDown, tabindex: "0" }, "Sign Out"))) : null)) : (h("button", { class: "sub-menu-item", onClick: this.handleSignIn, tabindex: "0" }, "Sign In")))));
|
|
54
55
|
}
|
|
55
56
|
static get is() { return "admiralty-header-profile"; }
|
|
56
57
|
static get encapsulation() { return "scoped"; }
|
|
@@ -101,6 +102,24 @@ export class HeaderProfileComponent {
|
|
|
101
102
|
"attribute": "signed-in-text",
|
|
102
103
|
"reflect": false,
|
|
103
104
|
"defaultValue": "'replace'"
|
|
105
|
+
},
|
|
106
|
+
"signInOnly": {
|
|
107
|
+
"type": "boolean",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "boolean",
|
|
111
|
+
"resolved": "boolean",
|
|
112
|
+
"references": {}
|
|
113
|
+
},
|
|
114
|
+
"required": false,
|
|
115
|
+
"optional": false,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": "A boolean to indicate if the component should hide\nthe sign-out and account buttons, useful for internal\nsites where the user must be always signed in."
|
|
119
|
+
},
|
|
120
|
+
"attribute": "sign-in-only",
|
|
121
|
+
"reflect": false,
|
|
122
|
+
"defaultValue": "false"
|
|
104
123
|
}
|
|
105
124
|
};
|
|
106
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-profile.js","sourceRoot":"","sources":["../../../src/components/header-profile/header-profile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAgB,OAAO,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO/B,MAAM,OAAO,sBAAsB;;
|
|
1
|
+
{"version":3,"file":"header-profile.js","sourceRoot":"","sources":["../../../src/components/header-profile/header-profile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAgB,OAAO,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO/B,MAAM,OAAO,sBAAsB;;IAsCjC,iBAAY,GAAG,GAAG,EAAE;MAClB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC,CAAC;IAEF,wBAAmB,GAAG,CAAC,EAAiB,EAAE,EAAE;MAC1C,IAAI,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,EAAE;QAClD,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;OAC3B;IACH,CAAC,CAAC;IAEF,kBAAa,GAAG,GAAG,EAAE;MACnB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CACP,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC,CAAC,CAAC,CACF,cAAQ,KAAK,EAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAC,GAAG,cAE7D,CACV,CACG,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Host, h, Prop, EventEmitter, Element } from '@stencil/core';\nimport { Keys } from '../Keys';\n\n@Component({\n tag: 'admiralty-header-profile',\n styleUrl: 'header-profile.scss',\n scoped: true,\n})\nexport class HeaderProfileComponent {\n @Element() el: HTMLElement;\n\n /**\n * A boolean to indicate if the user is signed in or not\n */\n @Prop() isSignedIn: boolean = false;\n\n /**\n * The text that is displayed after the user signs in\n */\n @Prop() signedInText: string = 'replace';\n\n /**\n * A boolean to indicate if the component should hide\n * the sign-out and account buttons, useful for internal\n * sites where the user must be always signed in.\n */\n @Prop() signInOnly: boolean = false;\n\n /**\n * The event that is fired when the user clicks on\n * the sign in button\n */\n @Event() signInClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'Your account' button\n */\n @Event() yourAccountClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'sign out' button\n */\n @Event() signOutClicked: EventEmitter<void>;\n\n handleSignIn = () => {\n this.signInClicked.emit();\n };\n\n handleSignInKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signInClicked.emit();\n }\n };\n\n handleSignOut = () => {\n this.signOutClicked.emit();\n };\n\n handleSignOutKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signOutClicked.emit();\n }\n };\n\n handleYourAccount = () => {\n this.yourAccountClicked.emit();\n };\n\n handleYourAccountKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.yourAccountClicked.emit();\n }\n };\n\n closeDropdown = () => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n subMenu.classList.add('desktop-hide');\n };\n\n toggleDropdown = (_ev: Event) => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n\n if (subMenu.classList.contains('desktop-hide')) {\n subMenu.classList.add('desktop-visible');\n subMenu.classList.remove('desktop-hide');\n } else {\n subMenu.classList.add('desktop-hide');\n subMenu.classList.remove('desktop-visible');\n }\n };\n\n handleClickSignedIn = (ev: MouseEvent) => {\n ev.stopPropagation();\n this.toggleDropdown(ev);\n };\n\n render() {\n let { isSignedIn, signedInText, signInOnly } = this;\n return (\n <Host>\n <div class=\"header-profile\">\n {isSignedIn ? (\n <div>\n <div class=\"desktop\" onMouseOver={this.toggleDropdown}>\n <button onClick={this.handleClickSignedIn} tabindex=\"0\">\n {signedInText}\n </button>\n {!signInOnly ? (\n <div class=\"sub-menu desktop-hide\">\n <button class=\"sub-menu-item\" onClick={this.handleYourAccount} tabindex=\"0\">\n Your Account\n </button>\n <button class=\"sub-menu-item\" onClick={this.handleSignOut} tabindex=\"0\">\n Sign Out\n </button>\n </div>\n ) : null}\n </div>\n {!signInOnly ? (\n <div class=\"not-desktop\">\n <div class=\"sub-menu-item\" onClick={this.handleYourAccount} onKeyDown={this.handleYourAccountKeyDown} tabindex=\"0\">\n Your Account\n </div>\n <div class=\"sub-menu-item\" onClick={this.handleSignOut} onKeyDown={this.handleSignOutKeyDown} tabindex=\"0\">\n Sign Out\n </div>\n </div>\n ) : null}\n </div>\n ) : (\n <button class=\"sub-menu-item\" onClick={this.handleSignIn} tabindex=\"0\">\n Sign In\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -55,16 +55,18 @@ const HeaderProfileComponent = /*@__PURE__*/ proxyCustomElement(class HeaderProf
|
|
|
55
55
|
};
|
|
56
56
|
this.isSignedIn = false;
|
|
57
57
|
this.signedInText = 'replace';
|
|
58
|
+
this.signInOnly = false;
|
|
58
59
|
}
|
|
59
60
|
render() {
|
|
60
|
-
let { isSignedIn, signedInText } = this;
|
|
61
|
-
return (h(Host, null, h("div", { class: "header-profile" }, isSignedIn ? (h("div", null, h("div", { class: "desktop", onMouseOver: this.toggleDropdown }, h("button", { onClick: this.handleClickSignedIn, tabindex: "0" }, signedInText), h("div", { class: "sub-menu desktop-hide" }, h("button", { class: "sub-menu-item", onClick: this.handleYourAccount, tabindex: "0" }, "Your Account"), h("button", { class: "sub-menu-item", onClick: this.handleSignOut, tabindex: "0" }, "Sign Out"))), h("div", { class: "not-desktop" }, h("div", { class: "sub-menu-item", onClick: this.handleYourAccount, onKeyDown: this.handleYourAccountKeyDown, tabindex: "0" }, "Your Account"), h("div", { class: "sub-menu-item", onClick: this.handleSignOut, onKeyDown: this.handleSignOutKeyDown, tabindex: "0" }, "Sign Out")))) : (h("button", { class: "sub-menu-item", onClick: this.handleSignIn, tabindex: "0" }, "Sign In")))));
|
|
61
|
+
let { isSignedIn, signedInText, signInOnly } = this;
|
|
62
|
+
return (h(Host, null, h("div", { class: "header-profile" }, isSignedIn ? (h("div", null, h("div", { class: "desktop", onMouseOver: this.toggleDropdown }, h("button", { onClick: this.handleClickSignedIn, tabindex: "0" }, signedInText), !signInOnly ? (h("div", { class: "sub-menu desktop-hide" }, h("button", { class: "sub-menu-item", onClick: this.handleYourAccount, tabindex: "0" }, "Your Account"), h("button", { class: "sub-menu-item", onClick: this.handleSignOut, tabindex: "0" }, "Sign Out"))) : null), !signInOnly ? (h("div", { class: "not-desktop" }, h("div", { class: "sub-menu-item", onClick: this.handleYourAccount, onKeyDown: this.handleYourAccountKeyDown, tabindex: "0" }, "Your Account"), h("div", { class: "sub-menu-item", onClick: this.handleSignOut, onKeyDown: this.handleSignOutKeyDown, tabindex: "0" }, "Sign Out"))) : null)) : (h("button", { class: "sub-menu-item", onClick: this.handleSignIn, tabindex: "0" }, "Sign In")))));
|
|
62
63
|
}
|
|
63
64
|
get el() { return this; }
|
|
64
65
|
static get style() { return headerProfileCss; }
|
|
65
66
|
}, [2, "admiralty-header-profile", {
|
|
66
67
|
"isSignedIn": [4, "is-signed-in"],
|
|
67
|
-
"signedInText": [1, "signed-in-text"]
|
|
68
|
+
"signedInText": [1, "signed-in-text"],
|
|
69
|
+
"signInOnly": [4, "sign-in-only"]
|
|
68
70
|
}]);
|
|
69
71
|
function defineCustomElement$1() {
|
|
70
72
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"admiralty-header-profile.js","mappings":";;;AAAA,MAAM,gBAAgB,GAAG,4hHAA4hH;;MCQxiH,sBAAsB;;;;;;;
|
|
1
|
+
{"file":"admiralty-header-profile.js","mappings":";;;AAAA,MAAM,gBAAgB,GAAG,4hHAA4hH;;MCQxiH,sBAAsB;;;;;;;IAsCjC,iBAAY,GAAG;MACb,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;KAC3B,CAAC;IAEF,wBAAmB,GAAG,CAAC,EAAiB;MACtC,IAAI,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,EAAE;QAClD,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;OAC3B;KACF,CAAC;IAEF,kBAAa,GAAG;MACd,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;KAC5B,CAAC;IAEF,yBAAoB,GAAG,CAAC,EAAiB;MACvC,IAAI,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,EAAE;QAClD,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;OAC5B;KACF,CAAC;IAEF,sBAAiB,GAAG;MAClB,IAAI,CAAC,kBAAkB,C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EAAC,WAAW,EAAE,IAAI,CAAC,cAAc,IACnD,cAAQ,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,EAAC,GAAG,IACpD,YAAY,CACN,EACR,CAAC,UAAU,IACV,WAAK,KAAK,EAAC,uBAAuB,IAChC,cAAQ,KAAK,EAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,EAAC,GAAG,mBAElE,EACT,cAAQ,KAAK,EAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAC,GAAG,eAE9D,CACL,IACJ,IAAI,CACJ,EACL,CAAC,UAAU,IACV,WAAK,KAAK,EAAC,aAAa,IACtB,WAAK,KAAK,EAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,EAAC,GAAG,mBAE5G,EACN,WAAK,KAAK,EAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,EAAC,GAAG,eAEpG,CACF,IACJ,IAAI,CACJ,KAEN,cAAQ,KAAK,EAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAC,GAAG,cAE7D,CACV,CACG,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/header-profile/header-profile.scss?tag=admiralty-header-profile&encapsulation=scoped","./src/components/header-profile/header-profile.tsx"],"sourcesContent":["@use '../../scss/vars/colours' as colours;\n@use '../../scss/base/responsive';\n@use '../../scss/vars/typography';\n\n@mixin active {\n box-shadow: inset 0 -5px colours.$colour-admiralty-blue;\n}\n\n.header-profile {\n color: colours.$colour-admiralty-blue;\n cursor: pointer;\n\n @include responsive.desktop-only {\n .not-desktop {\n display: none;\n }\n\n display: flex;\n flex: 0;\n flex-direction: column;\n font-size: typography.$font-size-normal !important;\n height: 100%;\n justify-content: center;\n line-height: 1.33em;\n margin-bottom: 0;\n min-width: 4em;\n max-width: 11.1em;\n padding: 0 1.65em;\n position: relative;\n text-align: center;\n\n button {\n all: unset;\n height: 100%;\n width: 100%;\n font-weight: typography.$font-weight-medium;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n\n &:hover {\n @include active;\n background-color: colours.$colour-nav-bg-hover;\n\n .desktop .sub-menu {\n display: flex;\n }\n }\n\n &.active {\n @include active;\n\n .sub-menu {\n display: flex;\n }\n }\n\n .sub-menu {\n display: none;\n flex-direction: column;\n font-size: typography.$font-size-normal;\n position: absolute;\n top: 100%;\n right: 0;\n border: 1px solid colours.$colour-divider;\n width: 300px;\n\n &.desktop-visible {\n display: flex;\n }\n\n &.desktop-hide {\n display: none;\n }\n\n .sub-menu-item {\n box-sizing: content-box;\n margin: 0;\n width: 100%;\n\n all: unset;\n box-sizing: border-box;\n display: block;\n font-weight: typography.$font-weight-light;\n height: 100%;\n padding: 10px;\n text-align: left;\n width: 100%;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n }\n }\n }\n\n @include responsive.not-desktop {\n .desktop {\n display: none;\n }\n\n border-top: 1px solid colours.$colour-bg-header;\n\n .sub-menu-item {\n display: block;\n box-sizing: border-box;\n font-size: typography.$font-size-normal;\n font-weight: 500;\n background-color: unset;\n text-align: unset;\n text-decoration: unset;\n\n padding: 12px;\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n }\n}\n","import { Component, Event, Host, h, Prop, EventEmitter, Element } from '@stencil/core';\nimport { Keys } from '../Keys';\n\n@Component({\n tag: 'admiralty-header-profile',\n styleUrl: 'header-profile.scss',\n scoped: true,\n})\nexport class HeaderProfileComponent {\n @Element() el: HTMLElement;\n\n /**\n * A boolean to indicate if the user is signed in or not\n */\n @Prop() isSignedIn: boolean = false;\n\n /**\n * The text that is displayed after the user signs in\n */\n @Prop() signedInText: string = 'replace';\n\n /**\n * A boolean to indicate if the component should hide\n * the sign-out and account buttons, useful for internal\n * sites where the user must be always signed in.\n */\n @Prop() signInOnly: boolean = false;\n\n /**\n * The event that is fired when the user clicks on\n * the sign in button\n */\n @Event() signInClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'Your account' button\n */\n @Event() yourAccountClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'sign out' button\n */\n @Event() signOutClicked: EventEmitter<void>;\n\n handleSignIn = () => {\n this.signInClicked.emit();\n };\n\n handleSignInKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signInClicked.emit();\n }\n };\n\n handleSignOut = () => {\n this.signOutClicked.emit();\n };\n\n handleSignOutKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signOutClicked.emit();\n }\n };\n\n handleYourAccount = () => {\n this.yourAccountClicked.emit();\n };\n\n handleYourAccountKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.yourAccountClicked.emit();\n }\n };\n\n closeDropdown = () => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n subMenu.classList.add('desktop-hide');\n };\n\n toggleDropdown = (_ev: Event) => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n\n if (subMenu.classList.contains('desktop-hide')) {\n subMenu.classList.add('desktop-visible');\n subMenu.classList.remove('desktop-hide');\n } else {\n subMenu.classList.add('desktop-hide');\n subMenu.classList.remove('desktop-visible');\n }\n };\n\n handleClickSignedIn = (ev: MouseEvent) => {\n ev.stopPropagation();\n this.toggleDropdown(ev);\n };\n\n render() {\n let { isSignedIn, signedInText, signInOnly } = this;\n return (\n <Host>\n <div class=\"header-profile\">\n {isSignedIn ? (\n <div>\n <div class=\"desktop\" onMouseOver={this.toggleDropdown}>\n <button onClick={this.handleClickSignedIn} tabindex=\"0\">\n {signedInText}\n </button>\n {!signInOnly ? (\n <div class=\"sub-menu desktop-hide\">\n <button class=\"sub-menu-item\" onClick={this.handleYourAccount} tabindex=\"0\">\n Your Account\n </button>\n <button class=\"sub-menu-item\" onClick={this.handleSignOut} tabindex=\"0\">\n Sign Out\n </button>\n </div>\n ) : null}\n </div>\n {!signInOnly ? (\n <div class=\"not-desktop\">\n <div class=\"sub-menu-item\" onClick={this.handleYourAccount} onKeyDown={this.handleYourAccountKeyDown} tabindex=\"0\">\n Your Account\n </div>\n <div class=\"sub-menu-item\" onClick={this.handleSignOut} onKeyDown={this.handleSignOutKeyDown} tabindex=\"0\">\n Sign Out\n </div>\n </div>\n ) : null}\n </div>\n ) : (\n <button class=\"sub-menu-item\" onClick={this.handleSignIn} tabindex=\"0\">\n Sign In\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -54,10 +54,11 @@ const HeaderProfileComponent = class {
|
|
|
54
54
|
};
|
|
55
55
|
this.isSignedIn = false;
|
|
56
56
|
this.signedInText = 'replace';
|
|
57
|
+
this.signInOnly = false;
|
|
57
58
|
}
|
|
58
59
|
render() {
|
|
59
|
-
let { isSignedIn, signedInText } = this;
|
|
60
|
-
return (h(Host, null, h("div", { class: "header-profile" }, isSignedIn ? (h("div", null, h("div", { class: "desktop", onMouseOver: this.toggleDropdown }, h("button", { onClick: this.handleClickSignedIn, tabindex: "0" }, signedInText), h("div", { class: "sub-menu desktop-hide" }, h("button", { class: "sub-menu-item", onClick: this.handleYourAccount, tabindex: "0" }, "Your Account"), h("button", { class: "sub-menu-item", onClick: this.handleSignOut, tabindex: "0" }, "Sign Out"))), h("div", { class: "not-desktop" }, h("div", { class: "sub-menu-item", onClick: this.handleYourAccount, onKeyDown: this.handleYourAccountKeyDown, tabindex: "0" }, "Your Account"), h("div", { class: "sub-menu-item", onClick: this.handleSignOut, onKeyDown: this.handleSignOutKeyDown, tabindex: "0" }, "Sign Out")))) : (h("button", { class: "sub-menu-item", onClick: this.handleSignIn, tabindex: "0" }, "Sign In")))));
|
|
60
|
+
let { isSignedIn, signedInText, signInOnly } = this;
|
|
61
|
+
return (h(Host, null, h("div", { class: "header-profile" }, isSignedIn ? (h("div", null, h("div", { class: "desktop", onMouseOver: this.toggleDropdown }, h("button", { onClick: this.handleClickSignedIn, tabindex: "0" }, signedInText), !signInOnly ? (h("div", { class: "sub-menu desktop-hide" }, h("button", { class: "sub-menu-item", onClick: this.handleYourAccount, tabindex: "0" }, "Your Account"), h("button", { class: "sub-menu-item", onClick: this.handleSignOut, tabindex: "0" }, "Sign Out"))) : null), !signInOnly ? (h("div", { class: "not-desktop" }, h("div", { class: "sub-menu-item", onClick: this.handleYourAccount, onKeyDown: this.handleYourAccountKeyDown, tabindex: "0" }, "Your Account"), h("div", { class: "sub-menu-item", onClick: this.handleSignOut, onKeyDown: this.handleSignOutKeyDown, tabindex: "0" }, "Sign Out"))) : null)) : (h("button", { class: "sub-menu-item", onClick: this.handleSignIn, tabindex: "0" }, "Sign In")))));
|
|
61
62
|
}
|
|
62
63
|
get el() { return getElement(this); }
|
|
63
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"admiralty-header-profile.entry.js","mappings":";;;AAAA,MAAM,gBAAgB,GAAG,4hHAA4hH;;MCQxiH,sBAAsB;;;;;;
|
|
1
|
+
{"file":"admiralty-header-profile.entry.js","mappings":";;;AAAA,MAAM,gBAAgB,GAAG,4hHAA4hH;;MCQxiH,sBAAsB;;;;;;IAsCjC,iBAAY,GAAG;MACb,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;KAC3B,CAAC;IAEF,wBAAmB,GAAG,CAAC,EAAiB;MACtC,IAAI,EAAE,CAAC,GAAG,KAAK,IAAI,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C,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAC,GAAG,cAE7D,CACV,CACG,CACD,EACP;GACH;;;;;;;","names":[],"sources":["./src/components/header-profile/header-profile.scss?tag=admiralty-header-profile&encapsulation=scoped","./src/components/header-profile/header-profile.tsx"],"sourcesContent":["@use '../../scss/vars/colours' as colours;\n@use '../../scss/base/responsive';\n@use '../../scss/vars/typography';\n\n@mixin active {\n box-shadow: inset 0 -5px colours.$colour-admiralty-blue;\n}\n\n.header-profile {\n color: colours.$colour-admiralty-blue;\n cursor: pointer;\n\n @include responsive.desktop-only {\n .not-desktop {\n display: none;\n }\n\n display: flex;\n flex: 0;\n flex-direction: column;\n font-size: typography.$font-size-normal !important;\n height: 100%;\n justify-content: center;\n line-height: 1.33em;\n margin-bottom: 0;\n min-width: 4em;\n max-width: 11.1em;\n padding: 0 1.65em;\n position: relative;\n text-align: center;\n\n button {\n all: unset;\n height: 100%;\n width: 100%;\n font-weight: typography.$font-weight-medium;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n\n &:hover {\n @include active;\n background-color: colours.$colour-nav-bg-hover;\n\n .desktop .sub-menu {\n display: flex;\n }\n }\n\n &.active {\n @include active;\n\n .sub-menu {\n display: flex;\n }\n }\n\n .sub-menu {\n display: none;\n flex-direction: column;\n font-size: typography.$font-size-normal;\n position: absolute;\n top: 100%;\n right: 0;\n border: 1px solid colours.$colour-divider;\n width: 300px;\n\n &.desktop-visible {\n display: flex;\n }\n\n &.desktop-hide {\n display: none;\n }\n\n .sub-menu-item {\n box-sizing: content-box;\n margin: 0;\n width: 100%;\n\n all: unset;\n box-sizing: border-box;\n display: block;\n font-weight: typography.$font-weight-light;\n height: 100%;\n padding: 10px;\n text-align: left;\n width: 100%;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n }\n }\n }\n\n @include responsive.not-desktop {\n .desktop {\n display: none;\n }\n\n border-top: 1px solid colours.$colour-bg-header;\n\n .sub-menu-item {\n display: block;\n box-sizing: border-box;\n font-size: typography.$font-size-normal;\n font-weight: 500;\n background-color: unset;\n text-align: unset;\n text-decoration: unset;\n\n padding: 12px;\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n }\n}\n","import { Component, Event, Host, h, Prop, EventEmitter, Element } from '@stencil/core';\nimport { Keys } from '../Keys';\n\n@Component({\n tag: 'admiralty-header-profile',\n styleUrl: 'header-profile.scss',\n scoped: true,\n})\nexport class HeaderProfileComponent {\n @Element() el: HTMLElement;\n\n /**\n * A boolean to indicate if the user is signed in or not\n */\n @Prop() isSignedIn: boolean = false;\n\n /**\n * The text that is displayed after the user signs in\n */\n @Prop() signedInText: string = 'replace';\n\n /**\n * A boolean to indicate if the component should hide\n * the sign-out and account buttons, useful for internal\n * sites where the user must be always signed in.\n */\n @Prop() signInOnly: boolean = false;\n\n /**\n * The event that is fired when the user clicks on\n * the sign in button\n */\n @Event() signInClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'Your account' button\n */\n @Event() yourAccountClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'sign out' button\n */\n @Event() signOutClicked: EventEmitter<void>;\n\n handleSignIn = () => {\n this.signInClicked.emit();\n };\n\n handleSignInKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signInClicked.emit();\n }\n };\n\n handleSignOut = () => {\n this.signOutClicked.emit();\n };\n\n handleSignOutKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signOutClicked.emit();\n }\n };\n\n handleYourAccount = () => {\n this.yourAccountClicked.emit();\n };\n\n handleYourAccountKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.yourAccountClicked.emit();\n }\n };\n\n closeDropdown = () => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n subMenu.classList.add('desktop-hide');\n };\n\n toggleDropdown = (_ev: Event) => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n\n if (subMenu.classList.contains('desktop-hide')) {\n subMenu.classList.add('desktop-visible');\n subMenu.classList.remove('desktop-hide');\n } else {\n subMenu.classList.add('desktop-hide');\n subMenu.classList.remove('desktop-visible');\n }\n };\n\n handleClickSignedIn = (ev: MouseEvent) => {\n ev.stopPropagation();\n this.toggleDropdown(ev);\n };\n\n render() {\n let { isSignedIn, signedInText, signInOnly } = this;\n return (\n <Host>\n <div class=\"header-profile\">\n {isSignedIn ? (\n <div>\n <div class=\"desktop\" onMouseOver={this.toggleDropdown}>\n <button onClick={this.handleClickSignedIn} tabindex=\"0\">\n {signedInText}\n </button>\n {!signInOnly ? (\n <div class=\"sub-menu desktop-hide\">\n <button class=\"sub-menu-item\" onClick={this.handleYourAccount} tabindex=\"0\">\n Your Account\n </button>\n <button class=\"sub-menu-item\" onClick={this.handleSignOut} tabindex=\"0\">\n Sign Out\n </button>\n </div>\n ) : null}\n </div>\n {!signInOnly ? (\n <div class=\"not-desktop\">\n <div class=\"sub-menu-item\" onClick={this.handleYourAccount} onKeyDown={this.handleYourAccountKeyDown} tabindex=\"0\">\n Your Account\n </div>\n <div class=\"sub-menu-item\" onClick={this.handleSignOut} onKeyDown={this.handleSignOutKeyDown} tabindex=\"0\">\n Sign Out\n </div>\n </div>\n ) : null}\n </div>\n ) : (\n <button class=\"sub-menu-item\" onClick={this.handleSignIn} tabindex=\"0\">\n Sign In\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
package/dist/esm/admiralty.js
CHANGED
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return bootstrapLazy([["admiralty-type-ahead",[[6,"admiralty-type-ahead",{"value":[1],"label":[1],"hint":[1],"placeholder":[1],"resultsOnInitFocus":[4,"results-on-init-focus"],"filterResult":[32]}]]],["admiralty-select",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]}]]],["admiralty-textarea",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"maxLength":[2,"max-length"],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]}]]],["admiralty-colour-block",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"actionText":[1,"action-text"]}]]],["admiralty-file-input",[[2,"admiralty-file-input",{"label":[1],"multiple":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"files":[32]}]]],["admiralty-filter",[[6,"admiralty-filter",{"filterTitle":[1,"filter-title"]}]]],["admiralty-filter-group",[[6,"admiralty-filter-group",{"groupTitle":[1,"group-title"]}]]],["admiralty-paginator",[[2,"admiralty-paginator",{"pages":[2],"currentPage":[2,"current-page"],"label":[1]}]]],["admiralty-radio-group",[[6,"admiralty-radio-group",{"name":[1],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]}]]],["admiralty-breadcrumb",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-dialogue",[[6,"admiralty-dialogue",{"type":[1],"heading":[1]}]]],["admiralty-header",[[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-progress-bar",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]}]]],["admiralty-read-more",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["admiralty-breadcrumbs",[[6,"admiralty-breadcrumbs"]]],["admiralty-card",[[6,"admiralty-card",{"heading":[1]}]]],["admiralty-checkbox",[[2,"admiralty-checkbox",{"checkboxRight":[4,"checkbox-right"],"disabled":[4],"name":[1],"checked":[1028],"value":[8],"labelText":[1,"label-text"]}]]],["admiralty-footer",[[6,"admiralty-footer",{"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1]}]]],["admiralty-header-menu-item",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-profile",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"]}]]],["admiralty-header-sub-menu-item",[[2,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"]}]]],["admiralty-hr",[[2,"admiralty-hr"]]],["admiralty-link",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["admiralty-paginator-wrapper",[[4,"admiralty-paginator-wrapper",null,[[0,"pageChange","pageChangedHandler"]]]]],["admiralty-phase-banner",[[2,"admiralty-phase-banner",{"phase":[1],"link":[1]}]]],["admiralty-radio",[[6,"admiralty-radio",{"name":[1],"value":[1025],"disabled":[4],"checked":[1028],"invalid":[4],"buttonTabindex":[32],"setButtonTabindex":[64]}]]],["admiralty-side-nav",[[6,"admiralty-side-nav",{"label":[1]}]]],["admiralty-side-nav-item",[[2,"admiralty-side-nav-item",{"sideNavItemId":[1,"side-nav-item-id"],"headingTitle":[1,"heading-title"],"navActive":[4,"nav-active"]}]]],["admiralty-side-nav-wrapper",[[4,"admiralty-side-nav-wrapper",null,[[0,"sideNavItemSelected","onSideNavItemSelected"]]]]],["admiralty-tab",[[6,"admiralty-tab",{"label":[1],"tabLabelId":[1,"tab-label-id"],"tabContentId":[1,"tab-content-id"]}]]],["admiralty-tab-group",[[6,"admiralty-tab-group",{"selectedIndex":[1026,"selected-index"]}]]],["admiralty-table",[[6,"admiralty-table",{"caption":[1]}]]],["admiralty-table-body",[[6,"admiralty-table-body"]]],["admiralty-table-cell",[[6,"admiralty-table-cell"]]],["admiralty-table-header",[[6,"admiralty-table-header"]]],["admiralty-table-header-cell",[[6,"admiralty-table-header-cell"]]],["admiralty-table-row",[[6,"admiralty-table-row"]]],["admiralty-type-ahead-item",[[2,"admiralty-type-ahead-item",{"value":[1]}]]],["admiralty-icon",[[1,"admiralty-icon",{"iconName":[1,"icon-name"],"iconPrefix":[1,"icon-prefix"]}]]],["admiralty-input",[[2,"admiralty-input",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"type":[1],"placeholder":[1],"width":[2],"maxLength":[2,"max-length"],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]}]]],["admiralty-expansion",[[6,"admiralty-expansion",{"heading":[1],"expanded":[1540],"alignHeadingRight":[4,"align-heading-right"],"hideBorder":[4,"hide-border"]}]]],["admiralty-button",[[6,"admiralty-button",{"variant":[1],"icon":[1],"disabled":[516],"type":[1]}]]],["admiralty-hint_3",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
|
|
20
|
+
return bootstrapLazy([["admiralty-type-ahead",[[6,"admiralty-type-ahead",{"value":[1],"label":[1],"hint":[1],"placeholder":[1],"resultsOnInitFocus":[4,"results-on-init-focus"],"filterResult":[32]}]]],["admiralty-select",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]}]]],["admiralty-textarea",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"maxLength":[2,"max-length"],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]}]]],["admiralty-colour-block",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"actionText":[1,"action-text"]}]]],["admiralty-file-input",[[2,"admiralty-file-input",{"label":[1],"multiple":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"files":[32]}]]],["admiralty-filter",[[6,"admiralty-filter",{"filterTitle":[1,"filter-title"]}]]],["admiralty-filter-group",[[6,"admiralty-filter-group",{"groupTitle":[1,"group-title"]}]]],["admiralty-paginator",[[2,"admiralty-paginator",{"pages":[2],"currentPage":[2,"current-page"],"label":[1]}]]],["admiralty-radio-group",[[6,"admiralty-radio-group",{"name":[1],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]}]]],["admiralty-breadcrumb",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-dialogue",[[6,"admiralty-dialogue",{"type":[1],"heading":[1]}]]],["admiralty-header",[[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-progress-bar",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]}]]],["admiralty-read-more",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["admiralty-breadcrumbs",[[6,"admiralty-breadcrumbs"]]],["admiralty-card",[[6,"admiralty-card",{"heading":[1]}]]],["admiralty-checkbox",[[2,"admiralty-checkbox",{"checkboxRight":[4,"checkbox-right"],"disabled":[4],"name":[1],"checked":[1028],"value":[8],"labelText":[1,"label-text"]}]]],["admiralty-footer",[[6,"admiralty-footer",{"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1]}]]],["admiralty-header-menu-item",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-profile",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"],"signInOnly":[4,"sign-in-only"]}]]],["admiralty-header-sub-menu-item",[[2,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"]}]]],["admiralty-hr",[[2,"admiralty-hr"]]],["admiralty-link",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["admiralty-paginator-wrapper",[[4,"admiralty-paginator-wrapper",null,[[0,"pageChange","pageChangedHandler"]]]]],["admiralty-phase-banner",[[2,"admiralty-phase-banner",{"phase":[1],"link":[1]}]]],["admiralty-radio",[[6,"admiralty-radio",{"name":[1],"value":[1025],"disabled":[4],"checked":[1028],"invalid":[4],"buttonTabindex":[32],"setButtonTabindex":[64]}]]],["admiralty-side-nav",[[6,"admiralty-side-nav",{"label":[1]}]]],["admiralty-side-nav-item",[[2,"admiralty-side-nav-item",{"sideNavItemId":[1,"side-nav-item-id"],"headingTitle":[1,"heading-title"],"navActive":[4,"nav-active"]}]]],["admiralty-side-nav-wrapper",[[4,"admiralty-side-nav-wrapper",null,[[0,"sideNavItemSelected","onSideNavItemSelected"]]]]],["admiralty-tab",[[6,"admiralty-tab",{"label":[1],"tabLabelId":[1,"tab-label-id"],"tabContentId":[1,"tab-content-id"]}]]],["admiralty-tab-group",[[6,"admiralty-tab-group",{"selectedIndex":[1026,"selected-index"]}]]],["admiralty-table",[[6,"admiralty-table",{"caption":[1]}]]],["admiralty-table-body",[[6,"admiralty-table-body"]]],["admiralty-table-cell",[[6,"admiralty-table-cell"]]],["admiralty-table-header",[[6,"admiralty-table-header"]]],["admiralty-table-header-cell",[[6,"admiralty-table-header-cell"]]],["admiralty-table-row",[[6,"admiralty-table-row"]]],["admiralty-type-ahead-item",[[2,"admiralty-type-ahead-item",{"value":[1]}]]],["admiralty-icon",[[1,"admiralty-icon",{"iconName":[1,"icon-name"],"iconPrefix":[1,"icon-prefix"]}]]],["admiralty-input",[[2,"admiralty-input",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"type":[1],"placeholder":[1],"width":[2],"maxLength":[2,"max-length"],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]}]]],["admiralty-expansion",[[6,"admiralty-expansion",{"heading":[1],"expanded":[1540],"alignHeadingRight":[4,"align-heading-right"],"hideBorder":[4,"hide-border"]}]]],["admiralty-button",[[6,"admiralty-button",{"variant":[1],"icon":[1],"disabled":[516],"type":[1]}]]],["admiralty-hint_3",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
//# sourceMappingURL=admiralty.js.map
|
package/dist/esm/loader.js
CHANGED
|
@@ -11,7 +11,7 @@ const patchEsm = () => {
|
|
|
11
11
|
const defineCustomElements = (win, options) => {
|
|
12
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
13
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["admiralty-type-ahead",[[6,"admiralty-type-ahead",{"value":[1],"label":[1],"hint":[1],"placeholder":[1],"resultsOnInitFocus":[4,"results-on-init-focus"],"filterResult":[32]}]]],["admiralty-select",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]}]]],["admiralty-textarea",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"maxLength":[2,"max-length"],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]}]]],["admiralty-colour-block",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"actionText":[1,"action-text"]}]]],["admiralty-file-input",[[2,"admiralty-file-input",{"label":[1],"multiple":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"files":[32]}]]],["admiralty-filter",[[6,"admiralty-filter",{"filterTitle":[1,"filter-title"]}]]],["admiralty-filter-group",[[6,"admiralty-filter-group",{"groupTitle":[1,"group-title"]}]]],["admiralty-paginator",[[2,"admiralty-paginator",{"pages":[2],"currentPage":[2,"current-page"],"label":[1]}]]],["admiralty-radio-group",[[6,"admiralty-radio-group",{"name":[1],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]}]]],["admiralty-breadcrumb",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-dialogue",[[6,"admiralty-dialogue",{"type":[1],"heading":[1]}]]],["admiralty-header",[[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-progress-bar",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]}]]],["admiralty-read-more",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["admiralty-breadcrumbs",[[6,"admiralty-breadcrumbs"]]],["admiralty-card",[[6,"admiralty-card",{"heading":[1]}]]],["admiralty-checkbox",[[2,"admiralty-checkbox",{"checkboxRight":[4,"checkbox-right"],"disabled":[4],"name":[1],"checked":[1028],"value":[8],"labelText":[1,"label-text"]}]]],["admiralty-footer",[[6,"admiralty-footer",{"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1]}]]],["admiralty-header-menu-item",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-profile",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"]}]]],["admiralty-header-sub-menu-item",[[2,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"]}]]],["admiralty-hr",[[2,"admiralty-hr"]]],["admiralty-link",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["admiralty-paginator-wrapper",[[4,"admiralty-paginator-wrapper",null,[[0,"pageChange","pageChangedHandler"]]]]],["admiralty-phase-banner",[[2,"admiralty-phase-banner",{"phase":[1],"link":[1]}]]],["admiralty-radio",[[6,"admiralty-radio",{"name":[1],"value":[1025],"disabled":[4],"checked":[1028],"invalid":[4],"buttonTabindex":[32],"setButtonTabindex":[64]}]]],["admiralty-side-nav",[[6,"admiralty-side-nav",{"label":[1]}]]],["admiralty-side-nav-item",[[2,"admiralty-side-nav-item",{"sideNavItemId":[1,"side-nav-item-id"],"headingTitle":[1,"heading-title"],"navActive":[4,"nav-active"]}]]],["admiralty-side-nav-wrapper",[[4,"admiralty-side-nav-wrapper",null,[[0,"sideNavItemSelected","onSideNavItemSelected"]]]]],["admiralty-tab",[[6,"admiralty-tab",{"label":[1],"tabLabelId":[1,"tab-label-id"],"tabContentId":[1,"tab-content-id"]}]]],["admiralty-tab-group",[[6,"admiralty-tab-group",{"selectedIndex":[1026,"selected-index"]}]]],["admiralty-table",[[6,"admiralty-table",{"caption":[1]}]]],["admiralty-table-body",[[6,"admiralty-table-body"]]],["admiralty-table-cell",[[6,"admiralty-table-cell"]]],["admiralty-table-header",[[6,"admiralty-table-header"]]],["admiralty-table-header-cell",[[6,"admiralty-table-header-cell"]]],["admiralty-table-row",[[6,"admiralty-table-row"]]],["admiralty-type-ahead-item",[[2,"admiralty-type-ahead-item",{"value":[1]}]]],["admiralty-icon",[[1,"admiralty-icon",{"iconName":[1,"icon-name"],"iconPrefix":[1,"icon-prefix"]}]]],["admiralty-input",[[2,"admiralty-input",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"type":[1],"placeholder":[1],"width":[2],"maxLength":[2,"max-length"],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]}]]],["admiralty-expansion",[[6,"admiralty-expansion",{"heading":[1],"expanded":[1540],"alignHeadingRight":[4,"align-heading-right"],"hideBorder":[4,"hide-border"]}]]],["admiralty-button",[[6,"admiralty-button",{"variant":[1],"icon":[1],"disabled":[516],"type":[1]}]]],["admiralty-hint_3",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
|
|
14
|
+
return bootstrapLazy([["admiralty-type-ahead",[[6,"admiralty-type-ahead",{"value":[1],"label":[1],"hint":[1],"placeholder":[1],"resultsOnInitFocus":[4,"results-on-init-focus"],"filterResult":[32]}]]],["admiralty-select",[[6,"admiralty-select",{"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"hint":[1],"label":[1],"width":[2],"value":[1032]}]]],["admiralty-textarea",[[2,"admiralty-textarea",{"label":[1],"hint":[1],"width":[2],"maxLength":[2,"max-length"],"disabled":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"value":[1032]}]]],["admiralty-colour-block",[[6,"admiralty-colour-block",{"width":[2],"height":[2],"heading":[1],"colour":[1],"actionText":[1,"action-text"]}]]],["admiralty-file-input",[[2,"admiralty-file-input",{"label":[1],"multiple":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"files":[32]}]]],["admiralty-filter",[[6,"admiralty-filter",{"filterTitle":[1,"filter-title"]}]]],["admiralty-filter-group",[[6,"admiralty-filter-group",{"groupTitle":[1,"group-title"]}]]],["admiralty-paginator",[[2,"admiralty-paginator",{"pages":[2],"currentPage":[2,"current-page"],"label":[1]}]]],["admiralty-radio-group",[[6,"admiralty-radio-group",{"name":[1],"value":[1032],"displayVertical":[4,"display-vertical"],"invalid":[4],"invalidMessage":[1,"invalid-message"]}]]],["admiralty-breadcrumb",[[6,"admiralty-breadcrumb",{"active":[4],"first":[4],"href":[1]}]]],["admiralty-dialogue",[[6,"admiralty-dialogue",{"type":[1],"heading":[1]}]]],["admiralty-header",[[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-progress-bar",[[2,"admiralty-progress-bar",{"label":[1],"progression":[2],"error":[4],"progressionValue":[32]}]]],["admiralty-read-more",[[6,"admiralty-read-more",{"heading":[1],"expanded":[32]}]]],["admiralty-breadcrumbs",[[6,"admiralty-breadcrumbs"]]],["admiralty-card",[[6,"admiralty-card",{"heading":[1]}]]],["admiralty-checkbox",[[2,"admiralty-checkbox",{"checkboxRight":[4,"checkbox-right"],"disabled":[4],"name":[1],"checked":[1028],"value":[8],"labelText":[1,"label-text"]}]]],["admiralty-footer",[[6,"admiralty-footer",{"imageLink":[1,"image-link"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"text":[1]}]]],["admiralty-header-menu-item",[[6,"admiralty-header-menu-item",{"menuTitle":[1,"menu-title"],"active":[4]}]]],["admiralty-header-profile",[[2,"admiralty-header-profile",{"isSignedIn":[4,"is-signed-in"],"signedInText":[1,"signed-in-text"],"signInOnly":[4,"sign-in-only"]}]]],["admiralty-header-sub-menu-item",[[2,"admiralty-header-sub-menu-item",{"menuTitle":[1,"menu-title"]}]]],["admiralty-hr",[[2,"admiralty-hr"]]],["admiralty-link",[[6,"admiralty-link",{"href":[1],"newTab":[4,"new-tab"]}]]],["admiralty-paginator-wrapper",[[4,"admiralty-paginator-wrapper",null,[[0,"pageChange","pageChangedHandler"]]]]],["admiralty-phase-banner",[[2,"admiralty-phase-banner",{"phase":[1],"link":[1]}]]],["admiralty-radio",[[6,"admiralty-radio",{"name":[1],"value":[1025],"disabled":[4],"checked":[1028],"invalid":[4],"buttonTabindex":[32],"setButtonTabindex":[64]}]]],["admiralty-side-nav",[[6,"admiralty-side-nav",{"label":[1]}]]],["admiralty-side-nav-item",[[2,"admiralty-side-nav-item",{"sideNavItemId":[1,"side-nav-item-id"],"headingTitle":[1,"heading-title"],"navActive":[4,"nav-active"]}]]],["admiralty-side-nav-wrapper",[[4,"admiralty-side-nav-wrapper",null,[[0,"sideNavItemSelected","onSideNavItemSelected"]]]]],["admiralty-tab",[[6,"admiralty-tab",{"label":[1],"tabLabelId":[1,"tab-label-id"],"tabContentId":[1,"tab-content-id"]}]]],["admiralty-tab-group",[[6,"admiralty-tab-group",{"selectedIndex":[1026,"selected-index"]}]]],["admiralty-table",[[6,"admiralty-table",{"caption":[1]}]]],["admiralty-table-body",[[6,"admiralty-table-body"]]],["admiralty-table-cell",[[6,"admiralty-table-cell"]]],["admiralty-table-header",[[6,"admiralty-table-header"]]],["admiralty-table-header-cell",[[6,"admiralty-table-header-cell"]]],["admiralty-table-row",[[6,"admiralty-table-row"]]],["admiralty-type-ahead-item",[[2,"admiralty-type-ahead-item",{"value":[1]}]]],["admiralty-icon",[[1,"admiralty-icon",{"iconName":[1,"icon-name"],"iconPrefix":[1,"icon-prefix"]}]]],["admiralty-input",[[2,"admiralty-input",{"name":[1],"label":[1],"hint":[1],"disabled":[4],"type":[1],"placeholder":[1],"width":[2],"maxLength":[2,"max-length"],"required":[4],"invalid":[4],"invalidMessage":[1,"invalid-message"],"autocomplete":[1],"value":[1032]}]]],["admiralty-expansion",[[6,"admiralty-expansion",{"heading":[1],"expanded":[1540],"alignHeadingRight":[4,"align-heading-right"],"hideBorder":[4,"hide-border"]}]]],["admiralty-button",[[6,"admiralty-button",{"variant":[1],"icon":[1],"disabled":[516],"type":[1]}]]],["admiralty-hint_3",[[6,"admiralty-hint",{"disabled":[4]}],[6,"admiralty-label",{"disabled":[4],"for":[1]}],[6,"admiralty-input-invalid"]]]], options);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -9,6 +9,12 @@ export declare class HeaderProfileComponent {
|
|
|
9
9
|
* The text that is displayed after the user signs in
|
|
10
10
|
*/
|
|
11
11
|
signedInText: string;
|
|
12
|
+
/**
|
|
13
|
+
* A boolean to indicate if the component should hide
|
|
14
|
+
* the sign-out and account buttons, useful for internal
|
|
15
|
+
* sites where the user must be always signed in.
|
|
16
|
+
*/
|
|
17
|
+
signInOnly: boolean;
|
|
12
18
|
/**
|
|
13
19
|
* The event that is fired when the user clicks on
|
|
14
20
|
* the sign in button
|
|
@@ -222,6 +222,10 @@ export namespace Components {
|
|
|
222
222
|
* A boolean to indicate if the user is signed in or not
|
|
223
223
|
*/
|
|
224
224
|
"isSignedIn": boolean;
|
|
225
|
+
/**
|
|
226
|
+
* A boolean to indicate if the component should hide the sign-out and account buttons, useful for internal sites where the user must be always signed in.
|
|
227
|
+
*/
|
|
228
|
+
"signInOnly": boolean;
|
|
225
229
|
/**
|
|
226
230
|
* The text that is displayed after the user signs in
|
|
227
231
|
*/
|
|
@@ -1256,6 +1260,10 @@ declare namespace LocalJSX {
|
|
|
1256
1260
|
* The event that is fired when the user clicks on the 'Your account' button
|
|
1257
1261
|
*/
|
|
1258
1262
|
"onYourAccountClicked"?: (event: AdmiraltyHeaderProfileCustomEvent<void>) => void;
|
|
1263
|
+
/**
|
|
1264
|
+
* A boolean to indicate if the component should hide the sign-out and account buttons, useful for internal sites where the user must be always signed in.
|
|
1265
|
+
*/
|
|
1266
|
+
"signInOnly"?: boolean;
|
|
1259
1267
|
/**
|
|
1260
1268
|
* The text that is displayed after the user signs in
|
|
1261
1269
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukho/admiralty-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"license": "MIT",
|
|
71
71
|
"url": "https://github.com/UKHO/admiralty-design-system",
|
|
72
72
|
"repository": "git://github.com/UKHO/admiralty-design-system.git",
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "3193cac60a297f893fb3da8f6241cd80f5ec0954"
|
|
74
74
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["headerProfileCss","HeaderProfileComponent","this","handleSignIn","signInClicked","emit","handleSignInKeyDown","ev","key","Keys","ENTER","SPACE","handleSignOut","signOutClicked","handleSignOutKeyDown","handleYourAccount","yourAccountClicked","handleYourAccountKeyDown","closeDropdown","subMenu","el","querySelector","classList","add","toggleDropdown","_ev","contains","remove","handleClickSignedIn","stopPropagation","render","isSignedIn","signedInText","h","Host","class","onMouseOver","onClick","tabindex","onKeyDown"],"sources":["./src/components/header-profile/header-profile.scss?tag=admiralty-header-profile&encapsulation=scoped","./src/components/header-profile/header-profile.tsx"],"sourcesContent":["@use '../../scss/vars/colours' as colours;\n@use '../../scss/base/responsive';\n@use '../../scss/vars/typography';\n\n@mixin active {\n box-shadow: inset 0 -5px colours.$colour-admiralty-blue;\n}\n\n.header-profile {\n color: colours.$colour-admiralty-blue;\n cursor: pointer;\n\n @include responsive.desktop-only {\n .not-desktop {\n display: none;\n }\n\n display: flex;\n flex: 0;\n flex-direction: column;\n font-size: typography.$font-size-normal !important;\n height: 100%;\n justify-content: center;\n line-height: 1.33em;\n margin-bottom: 0;\n min-width: 4em;\n max-width: 11.1em;\n padding: 0 1.65em;\n position: relative;\n text-align: center;\n\n button {\n all: unset;\n height: 100%;\n width: 100%;\n font-weight: typography.$font-weight-medium;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n\n &:hover {\n @include active;\n background-color: colours.$colour-nav-bg-hover;\n\n .desktop .sub-menu {\n display: flex;\n }\n }\n\n &.active {\n @include active;\n\n .sub-menu {\n display: flex;\n }\n }\n\n .sub-menu {\n display: none;\n flex-direction: column;\n font-size: typography.$font-size-normal;\n position: absolute;\n top: 100%;\n right: 0;\n border: 1px solid colours.$colour-divider;\n width: 300px;\n\n &.desktop-visible {\n display: flex;\n }\n\n &.desktop-hide {\n display: none;\n }\n\n .sub-menu-item {\n box-sizing: content-box;\n margin: 0;\n width: 100%;\n\n all: unset;\n box-sizing: border-box;\n display: block;\n font-weight: typography.$font-weight-light;\n height: 100%;\n padding: 10px;\n text-align: left;\n width: 100%;\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n }\n }\n }\n\n @include responsive.not-desktop {\n .desktop {\n display: none;\n }\n\n border-top: 1px solid colours.$colour-bg-header;\n\n .sub-menu-item {\n display: block;\n box-sizing: border-box;\n font-size: typography.$font-size-normal;\n font-weight: 500;\n background-color: unset;\n text-align: unset;\n text-decoration: unset;\n\n padding: 12px;\n &:hover {\n background-color: colours.$colour-nav-bg-hover;\n }\n\n &:focus {\n outline: none;\n box-shadow: colours.$colour-utility-focus inset 0 0 0 3px;\n }\n }\n }\n}\n","import { Component, Event, Host, h, Prop, EventEmitter, Element } from '@stencil/core';\nimport { Keys } from '../Keys';\n\n@Component({\n tag: 'admiralty-header-profile',\n styleUrl: 'header-profile.scss',\n scoped: true,\n})\nexport class HeaderProfileComponent {\n @Element() el: HTMLElement;\n\n /**\n * A boolean to indicate if the user is signed in or not\n */\n @Prop() isSignedIn: boolean = false;\n\n /**\n * The text that is displayed after the user signs in\n */\n @Prop() signedInText: string = 'replace';\n\n /**\n * The event that is fired when the user clicks on\n * the sign in button\n */\n @Event() signInClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'Your account' button\n */\n @Event() yourAccountClicked: EventEmitter<void>;\n\n /**\n * The event that is fired when the user clicks on the\n * 'sign out' button\n */\n @Event() signOutClicked: EventEmitter<void>;\n\n handleSignIn = () => {\n this.signInClicked.emit();\n };\n\n handleSignInKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signInClicked.emit();\n }\n }\n\n handleSignOut = () => {\n this.signOutClicked.emit();\n };\n\n handleSignOutKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.signOutClicked.emit();\n }\n }\n\n handleYourAccount = () => {\n this.yourAccountClicked.emit();\n };\n\n handleYourAccountKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === Keys.ENTER || ev.key === Keys.SPACE) {\n this.yourAccountClicked.emit();\n }\n }\n\n closeDropdown = () => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n subMenu.classList.add('desktop-hide');\n };\n\n toggleDropdown = (_ev: Event) => {\n const subMenu: HTMLDivElement = this.el.querySelector('div.sub-menu');\n\n if (subMenu.classList.contains('desktop-hide')) {\n subMenu.classList.add('desktop-visible');\n subMenu.classList.remove('desktop-hide');\n } else {\n subMenu.classList.add('desktop-hide');\n subMenu.classList.remove('desktop-visible');\n }\n };\n\n handleClickSignedIn = (ev: MouseEvent) =>{\n ev.stopPropagation();\n this.toggleDropdown(ev);\n }\n\n render() {\n let { isSignedIn, signedInText } = this;\n return (\n <Host>\n <div class=\"header-profile\">\n {isSignedIn ? (\n <div>\n <div class=\"desktop\"\n onMouseOver={this.toggleDropdown}\n >\n <button\n onClick={this.handleClickSignedIn}\n tabindex=\"0\">\n {signedInText}\n </button>\n <div class=\"sub-menu desktop-hide\">\n <button class=\"sub-menu-item\" onClick={this.handleYourAccount} tabindex=\"0\">Your Account</button>\n <button class=\"sub-menu-item\" onClick={this.handleSignOut} tabindex=\"0\">Sign Out</button>\n </div>\n </div>\n <div class=\"not-desktop\">\n <div class=\"sub-menu-item\" onClick={this.handleYourAccount} onKeyDown={this.handleYourAccountKeyDown} tabindex=\"0\">Your Account</div>\n <div class=\"sub-menu-item\" onClick={this.handleSignOut} onKeyDown={this.handleSignOutKeyDown} tabindex=\"0\">Sign Out</div>\n </div>\n </div>\n ) : (\n <button class=\"sub-menu-item\" onClick={this.handleSignIn} tabindex=\"0\">Sign In</button>\n )}\n </div>\n </Host>\n );\n }\n\n}\n"],"mappings":"oGAAA,MAAMA,EAAmB,6hH,MCQZC,EAAsB,M,4KA+BjCC,KAAAC,aAAe,KACbD,KAAKE,cAA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