@nanoporetech-digital/components 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/nano-details.cjs.entry.js +1 -1
  3. package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
  4. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +2 -2
  5. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  6. package/dist/cjs/nano-global-nav.cjs.entry.js +1 -1
  7. package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
  8. package/dist/cjs/nano-input.cjs.entry.js +1 -1
  9. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  10. package/dist/cjs/nano-menu-drawer.cjs.entry.js +1 -1
  11. package/dist/cjs/nano-menu-drawer.cjs.entry.js.map +1 -1
  12. package/dist/cjs/nano-tab.cjs.entry.js +1 -1
  13. package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
  14. package/dist/cjs/{nano-table-7e02106c.js → nano-table-844394ad.js} +2 -2
  15. package/dist/cjs/{nano-table-7e02106c.js.map → nano-table-844394ad.js.map} +1 -1
  16. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  17. package/dist/cjs/{table.worker-daf39ca9.js → table.worker-1bc19978.js} +2 -2
  18. package/dist/cjs/table.worker-1bc19978.js.map +1 -0
  19. package/dist/collection/components/details/details.css +1 -0
  20. package/dist/collection/components/global-nav/style/global-nav.css +7 -5
  21. package/dist/collection/components/input/input.css +2 -0
  22. package/dist/collection/components/menu-drawer/menu-drawer.css +1 -0
  23. package/dist/collection/components/nav-item/nav-item.css +2 -0
  24. package/dist/collection/components/select/select.css +4 -0
  25. package/dist/collection/components/tabs/tab.css +1 -0
  26. package/dist/components/input.js +1 -1
  27. package/dist/components/input.js.map +1 -1
  28. package/dist/components/nano-details.js +1 -1
  29. package/dist/components/nano-details.js.map +1 -1
  30. package/dist/components/nano-global-nav.js +1 -1
  31. package/dist/components/nano-global-nav.js.map +1 -1
  32. package/dist/components/nano-menu-drawer.js +1 -1
  33. package/dist/components/nano-menu-drawer.js.map +1 -1
  34. package/dist/components/nano-tab.js +1 -1
  35. package/dist/components/nano-tab.js.map +1 -1
  36. package/dist/components/nav-item.js +1 -1
  37. package/dist/components/nav-item.js.map +1 -1
  38. package/dist/components/select.js +1 -1
  39. package/dist/components/select.js.map +1 -1
  40. package/dist/custom-elements/index.js +7 -7
  41. package/dist/custom-elements/index.js.map +1 -1
  42. package/dist/esm/nano-details.entry.js +1 -1
  43. package/dist/esm/nano-details.entry.js.map +1 -1
  44. package/dist/esm/nano-global-nav-user-profile_3.entry.js +2 -2
  45. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  46. package/dist/esm/nano-global-nav.entry.js +1 -1
  47. package/dist/esm/nano-global-nav.entry.js.map +1 -1
  48. package/dist/esm/nano-input.entry.js +1 -1
  49. package/dist/esm/nano-input.entry.js.map +1 -1
  50. package/dist/esm/nano-menu-drawer.entry.js +1 -1
  51. package/dist/esm/nano-menu-drawer.entry.js.map +1 -1
  52. package/dist/esm/nano-tab.entry.js +1 -1
  53. package/dist/esm/nano-tab.entry.js.map +1 -1
  54. package/dist/esm/{nano-table-930d9245.js → nano-table-19d19d72.js} +2 -2
  55. package/dist/esm/{nano-table-930d9245.js.map → nano-table-19d19d72.js.map} +1 -1
  56. package/dist/esm/nano-table.entry.js +1 -1
  57. package/dist/esm/{table.worker-7666db6d.js → table.worker-c82cecdf.js} +2 -2
  58. package/dist/esm/table.worker-c82cecdf.js.map +1 -0
  59. package/dist/nano-components/nano-components.esm.js +1 -1
  60. package/dist/nano-components/p-02df1f62.entry.js +5 -0
  61. package/dist/nano-components/{p-b7c3aecb.entry.js.map → p-02df1f62.entry.js.map} +1 -1
  62. package/dist/nano-components/p-1ae8c03e.entry.js +5 -0
  63. package/dist/nano-components/p-1ae8c03e.entry.js.map +1 -0
  64. package/dist/nano-components/p-28b43ee9.entry.js +5 -0
  65. package/dist/nano-components/{p-49a831a3.entry.js.map → p-28b43ee9.entry.js.map} +1 -1
  66. package/dist/nano-components/{p-b717f6d7.js → p-7ade1695.js} +2 -2
  67. package/dist/nano-components/{p-40b47b05.entry.js.map → p-7ade1695.js.map} +0 -0
  68. package/dist/nano-components/p-8a52a411.entry.js +5 -0
  69. package/dist/nano-components/{p-68b18b99.entry.js.map → p-8a52a411.entry.js.map} +1 -1
  70. package/dist/nano-components/{p-40b47b05.entry.js → p-b4a045a2.entry.js} +2 -2
  71. package/dist/nano-components/{p-b717f6d7.js.map → p-b4a045a2.entry.js.map} +0 -0
  72. package/dist/nano-components/{p-49458cd9.js → p-b83a8320.js} +2 -2
  73. package/dist/nano-components/{p-49458cd9.js.map → p-b83a8320.js.map} +0 -0
  74. package/dist/nano-components/p-efa8c520.entry.js +5 -0
  75. package/dist/nano-components/{p-47bd0f5d.entry.js.map → p-efa8c520.entry.js.map} +1 -1
  76. package/dist/nano-components/p-fa2a6733.entry.js +5 -0
  77. package/dist/nano-components/p-fa2a6733.entry.js.map +1 -0
  78. package/dist/themes/london-calling.css.map +1 -1
  79. package/dist/themes/nanopore.css.map +1 -1
  80. package/docs-json.json +2 -1
  81. package/package.json +2 -2
  82. package/dist/cjs/table.worker-daf39ca9.js.map +0 -1
  83. package/dist/esm/table.worker-7666db6d.js.map +0 -1
  84. package/dist/nano-components/p-28344d24.entry.js +0 -5
  85. package/dist/nano-components/p-28344d24.entry.js.map +0 -1
  86. package/dist/nano-components/p-47bd0f5d.entry.js +0 -5
  87. package/dist/nano-components/p-49a831a3.entry.js +0 -5
  88. package/dist/nano-components/p-65f84bbd.entry.js +0 -5
  89. package/dist/nano-components/p-65f84bbd.entry.js.map +0 -1
  90. package/dist/nano-components/p-68b18b99.entry.js +0 -5
  91. package/dist/nano-components/p-b7c3aecb.entry.js +0 -5
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["src/utils/fetch.ts","src/components/global-nav/style/global-nav.scss?tag=nano-global-nav&encapsulation=shadow","src/components/global-nav/global-nav.tsx"],"names":["async","clientFetch","url","body","customConfig","headers","Accept","Access-Control-Allow-Origin","Content-Type","Cache","config","method","credentials","keepalive","mode","JSON","stringify","id","setTimeout","window","AbortController","controller","timeout","abort","signal","response","fetch","clearTimeout","ok","json","errorMessage","text","Error","globalNavCss","THRESHOLDBREAKS","search","about","main","login","icon","GlobalNav","this","currSize","thresholdsGoingUp","THRESHOLDLIMIT","Object","keys","length","autocompleteEles","currAIndex","isLoggedIn","myAccData","aboutNavItms","siteNavItms","loggedInNavItms","setResizingState","state","debounceSetResizingState","debounce","isResizing","onMenuBtnKeyDown","ev","key","modalOpen","menuClose","menuOpen","onMenuBtnClick","e","preventDefault","menuDiv","style","display","modalIsOpen","menuWrapDiv","addEventListener","focus","preventScroll","threshold","scrollHeight","innerHeight","document","overflow","menuFullScreen","overflowX","onMenuHidden","removeEventListener","activeElement","menuBtn","mainBarDiv","force","relatedTarget","closestElement","closest","secondaryMenuOpen","subMenuClose","target","open","onUserBtnClick","userMenuOpen","onUserBtnKeyDown","onUserMenuBlur","onSearchBtnClick","searchBarShown","searchbarShow","searchbarHide","onSearchBtnKeyDown","onSearchBarShown","searchBarEl","searchInput","setFocus","showAutocomplete","searchValInternal","onSearchBarHidden","height","onSearchInput","value","isSearchValSet","searchLoading","detail","type","onSearchChange","searchValue","autocompleteResults","nanoSearchReset","emit","currentIndex","currentSelectedIndex","processSearchResults","alogliaIndex","attributesToSnippet","hitsPerPage","filters","Math","floor","Date","now","console","error","scopeSearch","onSearchSubmit","showAutocompleteResults","algoliaSearchResults","queries","internalSearchIndeces","map","index","indexName","query","facets","algoliaClient","multipleQueries","nanoSearchError","results","result","i","name","selected","domain","domains","allGroup","nanoSearchResult","client","apiKey","searchApiKey","appId","searchAppId","onSearchIndexChange","indexStr","selectedIndex","find","searchIndex","switchIndexSubmit","onAutocompleteBlur","hits","onAutocompleteInteract","testIndex","el","shadowRoot","found","ele","setActiveElement","click","encodeURIComponent","location","href","protocol","host","[object Object]","env","userProfileUrl","getMyAccountData","remoteDataReady","ssoDataUrl","import","user","myAccountUser","processMyAccLinks","processMyAccData","foundIndex","algoliasearch","addAlgoliaIndeces","searchIndeces","forEach","initIndex","newThreshold","oldThreshold","intersectRatio","ratioChange","thresholdReady","siteContent","minHeight","barsDiv","clientHeight","menuItems","barItems","readTask","Array","from","querySelectorAll","push","writeTask","item","classList","add","remove","ready","attachIO","nanoIsReady","classes","innerWidth","secondaryMenu","stopPropagation","menuContentDiv","displayTransition","userLinkPanel","querySelector","hit","lookFor","_snippetResult","prop","matchLevel","title","substring","autocompleteEle","setAttribute","hasSiteSlot","hasLoggedinSlot","hasPromotionSlot","aboutSlotLen","iconSlotLen","mainSlotLen","overflowSlotLen","searchSlotLen","io","root","IntersectionObserver","data","slice","intersectionRatio","observe","debounceResize","onWindowResize","bind","initAlgoliaClient","ComponentStore","init","MutationObserver","mo","assessSlottedContent","childList","subtree","disconnect","undefined","getMyAccData","content","scrollingUp","currentScopeHits","scopeChangeSuggestions","scopeSuggestReducer","total","currentSuggestReducer","reduce","scopeSuggestions","h","class","role","ref","a","tabindex","innerHTML","autocompleteSnippet","button","onClick","onMouseDown","aria-expanded","hidden","onKeyDown","onSubmit","label","hideLabel","showInlineError","onNanoChange","mask","aria-label","clear-input","placeholder","input","onNanoInput","aria-autocomplete","aria-activedescendant","aria-controls","onNanoFocus","search-icon","search-icon--search","search-icon--show","slot","search-icon--loader","isRtl","ownerDocument","dir","searchWidget","autocompleteList","Host","thresholdClasses","join","search-bar-shown","search-auto-complete-shown","modal-open","resizing","global-nav","scrolling-down","gn-menu","has-promotion","menu-full-screen","secondary-open","div","activeMyAccountSections","includes","msgUrl","msgCount","cartUrl","cartCount","urls","ssoRedirect","link","address","small_avatar_url","forgot_password","logout","auto-resize","break-point-max","quietMode","w","btn","showLogo","logoUrl","src","getAssetPath","alt","showSearch","aria-owns","icon-btn","search-btn","search-btn--open","user-links-btn","search-bar","show","onTouchEnd","origin","dm","multiResults","singleResult","match","domainFor","indeces","api_key","app_id","cart","count","notifications","messages","links","area"],"mappings":";;;4RAMOA,eAAeC,EACpBC,GACAC,KAAEA,KAASC,GAAmC,IAE9C,MAAMC,EAAsC,CAC1CC,OAAQ,oCACRC,8BAA+B,IAC/BC,eAAgB,mBAChBC,MAAO,YAET,MAAMC,EAAsB,CAC1BC,OAAQR,EAAO,OAAS,MACxBS,YAAa,UACbC,UAAW,KACXC,KAAM,UACHV,EACHC,QAAS,IACJA,KACAD,EAAaC,UAGpB,GAAIF,EAAM,CACRO,EAAOP,KAAOY,KAAKC,UAAUb,GAG/B,IAAIc,EAAKC,YAAW,QAAU,GAC9B,GAAIC,OAAOC,gBAAiB,CAC1B,MAAMC,EAAa,IAAID,gBACvB,MAAME,QAAEA,EAAU,KAAQlB,EAC1Ba,EAAKC,YAAW,IAAMG,EAAWE,SAASD,GAC1CZ,EAAOc,OAASH,EAAWG,OAG7B,MAAMC,QAAiBC,MAAMxB,EAAKQ,GAClCiB,aAAaV,GAEb,GAAIQ,EAASG,GAAI,CACf,aAAaH,EAASI,WACjB,CACL,MAAMC,QAAqBL,EAASM,OACpC,OAAO,IAAIC,MAAMF,IC9CrB,MAAMG,EAAe,+7qBC0CrB,MAAMC,EAAkB,CACtBC,OAAQ,EACRC,MAAO,EACPC,KAAM,EACNC,MAAO,EACPC,KAAM,SA0BKC,EAAS,6NAKZC,KAAAC,SAAmB,EACnBD,KAAAE,kBAA6B,MAC7BF,KAAAG,eAAiBC,OAAOC,KAAKZ,GAAiBa,OAc9CN,KAAAO,iBAAiE,GACjEP,KAAAQ,YAAsB,EAStBR,KAAAS,WAAsB,MAEtBT,KAAAU,UAA2B,KAG3BV,KAAAW,aAAgC,GAChCX,KAAAY,YAA+B,GAC/BZ,KAAAa,gBAAmC,GA4bnCb,KAAAc,iBAAmB,CAACC,EAAiB,SAC3C,UAAWf,KAAKgB,2BAA6B,YAAa,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jV,KAAK4H,cAAgB5H,KAAK0H,aAAc,OAC7C1H,KAAKsG,sBAAwB,IACxBtG,KAAKU,UAAUhB,OAAOmV,WACtB7U,KAAKgK,eAGV,GAAIhK,KAAKU,UAAUmS,KAAKmC,OAAShV,KAAK2S,QACpC3S,KAAK2S,QAAU3S,KAAKU,UAAUmS,KAAKmC,KACrC,GAAIhV,KAAKU,UAAUmS,KAAKsC,WAAanV,KAAKyS,OACxCzS,KAAKyS,OAASzS,KAAKU,UAAUmS,KAAKsC,SAG9BjM,oBACN,IAAKlJ,KAAKU,UAAU0U,QAAUpV,KAAKU,UAAU0U,MAAM9U,OAAQ,OAE3DN,KAAKU,UAAU0U,MAAMnL,SAAS8I,IAC5B,OAAQA,EAAKsC,MACX,IAAK,sBACL,IAAK,uBACH,GACErV,KAAKuS,0BACJvS,KAAKuS,wBAAwBC,SAAS,SAEvC,MACF,GAAIxS,KAAKS,YAAcsS,EAAKsC,OAAS,sBACnCrV,KAAKY,YAAYsK,KAAK6H,QACnB,IAAK/S,KAAKS,YAAcsS,EAAKsC,OAAS,uBACzCrV,KAAKY,YAAYsK,KAAK6H,GACxB,MACF,IAAK,uBACL,IAAK,wBACH,GACE/S,KAAKuS,0BACJvS,KAAKuS,wBAAwBC,SAAS,SAEvC,MACF,GAAIxS,KAAKS,YAAcsS,EAAKsC,OAAS,uBACnCrV,KAAKW,aAAauK,KAAK6H,QACpB,IAAK/S,KAAKS,YAAcsS,EAAKsC,OAAS,wBACzCrV,KAAKW,aAAauK,KAAK6H,GACzB,MACF,IAAK,qBACH,GACE/S,KAAKuS,0BACJvS,KAAKuS,wBAAwBC,SAAS,YAEvC,MACFxS,KAAKa,gBAAgBqK,KAAK6H,GAC1B","sourcesContent":["interface FetchInputConfig {\n body?: { [prop: string]: string };\n headers?: { [prop: string]: string };\n [prop: string]: any;\n}\n\nexport async function clientFetch(\n url: string,\n { body, ...customConfig }: FetchInputConfig = {}\n) {\n const headers: { [prop: string]: string } = {\n Accept: 'application/json, text/plain, */*',\n 'Access-Control-Allow-Origin': '*',\n 'Content-Type': 'application/json',\n Cache: 'no-cache',\n };\n const config: RequestInit = {\n method: body ? 'POST' : 'GET',\n credentials: 'include',\n keepalive: true,\n mode: 'cors',\n ...customConfig,\n headers: {\n ...headers,\n ...customConfig.headers,\n },\n };\n if (body) {\n config.body = JSON.stringify(body);\n }\n\n let id = setTimeout(() => {}, 0);\n if (window.AbortController) {\n const controller = new AbortController();\n const { timeout = 500 } = customConfig;\n id = setTimeout(() => controller.abort(), timeout);\n config.signal = controller.signal;\n }\n\n const response = await fetch(url, config);\n clearTimeout(id);\n\n if (response.ok) {\n return await response.json();\n } else {\n const errorMessage = await response.text();\n return new Error(errorMessage);\n }\n}\n","@use 'sass:map';\n@use 'sass:list';\n\n// globals\n@import '../../../global/style/utilities/globals';\n@import '../../../global/style/nano-theme/base';\n@import '../../../global/style/nano-theme/colours';\n@import '../../../global/style/nano-theme/layers';\n\n// local\n@import 'setup';\n@import 'bar';\n@import 'burger';\n@import 'search';\n@import 'user';\n\n:host {\n /**\n * @prop --bar-vertical-padding. Defaults to 21px;\n * @prop --bar-item-spacing. Defaults to 16px;\n * @prop --bar-background. Defaults to white;\n * @prop --bar-text-color. Defaults to #196c82;\n * @prop --bar-color-shade. Defaults to rgb(19, 89, 111);\n * @prop --bar-color-tint. Defaults to rgb(19, 89, 111);\n * @prop --bar-color-focus. Defaults to #001a21;\n * @prop --bar-user-panel-bg. Defaults to #016d86;\n\n * @prop --menu-background. Defaults to #001a21;\n * @prop --menu-text-color. Defaults to white;\n * @prop --bar-dropdown-bg. Defaults to #196c82;\n * @prop --bar-dropdown-text. Defaults to white;\n * @prop --menu-user-profile-bg. Defaults to #001a21;\n * @prop --menu-user-panel-bg. Defaults to #193037;\n * @prop --menu-padding. Defaults to 12px;\n * @prop --menu-hint-color. Defaults to #33484d;\n * @prop --menu-title-text. Defaults to #{map.get($colors, lightblue)};\n * @prop --menu-icon-color. Defaults to white;\n\n * @prop --login-button-bg. Defaults to #17bb75;\n * @prop --login-button-text. Defaults to white;\n */\n\n --bar-vertical-padding: 21px;\n --bar-item-spacing: 13px;\n --bar-background: white;\n --bar-text-color: #196c82;\n --bar-color-shade: rgb(19, 89, 111);\n --bar-color-tint: rgb(19, 89, 111);\n --bar-color-focus: #001a21;\n --bar-user-panel-bg: #016d86;\n --bar-dropdown-bg: #196c82;\n --bar-dropdown-text: white;\n --menu-background: #001a21;\n --menu-text-color: white;\n --menu-user-profile-bg: #001a21;\n --menu-user-panel-bg: #193037;\n --menu-padding: 12px;\n --menu-hint-color: #33484d;\n --menu-title-text: #{map.get($colors, lightblue)};\n --menu-icon-color: white;\n --login-button-bg: #17bb75;\n --login-button-text: white;\n\n // not sure if this required any more\n --padding: 12px;\n --padding-top: var(--padding);\n --padding-end: var(--padding);\n --padding-bottom: var(--padding);\n --padding-start: var(--padding);\n\n display: block;\n position: relative;\n line-height: 1.5;\n height: 100%;\n font-size: 0.9375em;\n font-size: clamp(0.77rem, 1vw, 1rem);\n\n input,\n select,\n button {\n font-family: inherit;\n appearance: none;\n font-size: inherit;\n }\n}\n","import {\n Component,\n h,\n Host,\n Element,\n State,\n Watch,\n Event,\n EventEmitter,\n Prop,\n Listen,\n Build,\n getAssetPath,\n readTask,\n writeTask,\n Method,\n VNode,\n ComponentInterface,\n} from '@stencil/core';\nimport algoliasearch, { SearchClient as AlgoliaClient } from 'algoliasearch';\nimport { closestElement } from '../../utils/dom';\nimport { clientFetch } from '../../utils/fetch';\nimport { ComponentStore } from '../../utils/store/component-store';\nimport { debounce } from '../../utils/throttle';\nimport { displayTransition } from '../../utils/transitions';\nimport type {\n InputChangeEventDetail,\n SelectChangeEventDetail,\n AlgoliaResults,\n SearchIndex,\n MyAccountLink,\n AloliaSearchResultDetail,\n AlgoliaMultiResult,\n MyAccountUser,\n MyAccountData,\n NavItemEventDetail,\n AlgoliaResultHit,\n AlgoliaNetworkError,\n AlgoliaMultiResults,\n} from '../../interface';\n\n// the 'breakpoints' where different segments of content go into or out-of the burger / overflow menu\nconst THRESHOLDBREAKS = {\n search: 0,\n about: 1,\n main: 2,\n login: 3,\n icon: 4,\n};\n\n/**\n * Nanopore digital global navigation and search bar.\n * Incorporates MyAccount / SSO states (messages / cart / user name etc).\n * Incorporates Algolia search.\n * GlobalNav is designed to be at the root of the `<body>`.\n * There should only be one <nano-global-nav> in the DOM.\n * The following demo uses static data.\n * @slot main - main nav items. Should be used with nano-nav-item's\n * @slot icon - nano-nav-item's displayed alongside icon links that come from MyAccount\n * @slot loggedin - nano-nav-item's to display when users are signed in, alongside links from from MyAccount (within the overflow menu panel).\n * @slot about - nano-nav-item's to display with about links that come from MyAccount\n * @slot site - nano-nav-item's to display with site links that come from MyAccount\n * @slot overflow - items to always display in the overflow menu\n * @slot search - when not using myaccount search OR show-search=\"false\" you can utilise the search slot\n * @slot promotion - a free area for any promotional content, displayed within the overflow menu panel\n * @slot logo - when show-logo=\"false\" you can utilise the logo slot\n */\n@Component({\n tag: 'nano-global-nav',\n styleUrl: 'style/global-nav.scss',\n shadow: true,\n assetsDirs: ['assets'],\n})\nexport class GlobalNav implements ComponentInterface {\n // position and dimension state\n private io: IntersectionObserver;\n private debounceResize: () => {};\n private debounceSetResizingState: () => {};\n private currSize: number = 0;\n private thresholdsGoingUp: boolean = false;\n private THRESHOLDLIMIT = Object.keys(THRESHOLDBREAKS).length;\n\n // menu\n private menuDiv: HTMLElement;\n private menuBtn: HTMLButtonElement;\n private menuWrapDiv: HTMLDivElement;\n private menuContentDiv: HTMLDivElement;\n\n // search\n private searchBarEl: HTMLDivElement;\n private searchInput: HTMLNanoInputElement;\n private algoliaClient: AlgoliaClient;\n private currentIndex: SearchIndex;\n private autocompleteResults: AlgoliaResults | null;\n private autocompleteEles: Array<HTMLAnchorElement | HTMLButtonElement> = [];\n private currAIndex: number = -1;\n private algoliaSearchResults: AlgoliaMultiResults | null;\n private scopeSearch: AlgoliaMultiResults | null;\n\n // general\n private mainBarDiv: HTMLElement;\n private barsDiv: HTMLDivElement;\n private siteContent: HTMLDivElement;\n private userLinkPanel: HTMLDivElement;\n private isLoggedIn: boolean = false;\n\n private myAccData: MyAccountData = null;\n\n // myaccount links\n private aboutNavItms: MyAccountLink[] = [];\n private siteNavItms: MyAccountLink[] = [];\n private loggedInNavItms: MyAccountLink[] = [];\n\n // user profile link\n @State() userProfileUrl: string = '';\n\n // has slot tests\n private mo?: MutationObserver;\n @State() hasLoggedinSlot: boolean = false;\n @State() hasSiteSlot: boolean = false;\n @State() hasPromotionSlot: boolean = false;\n\n // slot item number tests\n @State() aboutSlotLen: number = 0;\n @State() iconSlotLen: number = 0;\n @State() mainSlotLen: number = 0;\n @State() overflowSlotLen: number = 0;\n @State() searchSlotLen: number = 0;\n\n @State() internalSearchIndeces: Array<SearchIndex> = [];\n @State() thresholdReady: boolean = false;\n @State() remoteDataReady: boolean = false;\n @State() ready: boolean = false;\n @State() isResizing: boolean = false;\n @State() intersectRatio: number;\n @State() threshold: number = this.THRESHOLDLIMIT;\n @State() modalOpen: boolean = false;\n @State() modalIsOpen: boolean = false;\n @State() searchBarShown: boolean = false;\n @State() scrollingUp: boolean = true;\n @State() searchLoading: boolean = false;\n @State() showAutocomplete: boolean = false;\n @State() secondaryMenuOpen: boolean = false;\n @State() userMenuOpen: boolean = false;\n @State() menuFullScreen: boolean = false;\n @State() searchValInternal: string = '';\n\n @Element() private el: HTMLNanoGlobalNavElement;\n\n /**\n * Connect to local, dev, test or prod MyAccount\n * environments to retrieve global nav / sso data.\n * Alternatively, you can use the `ssoDataUrl` prop.\n */\n @Prop() env?: 'local' | 'dev' | 'test' | 'prod' = 'prod';\n\n /**\n * A base url to retrieve global nav / sso data.\n * `nav_bar_data.json` will be appended to this url.\n * An alternative to the pre-defined `env` urls\n */\n @Prop() ssoDataUrl?: string;\n\n /**\n * Where to take user after SSO login\n */\n @Prop() ssoRedirect: string = encodeURIComponent(window.location.href);\n\n /**\n * Whether to attempt to get global nav / sso data from MyAccount\n */\n @Prop() getMyAccountData: boolean = true;\n\n /**\n * Active MyAccount link sections. By default all will show.\n */\n @Prop() activeMyAccountSections: (\n | 'about'\n | 'loggedin'\n | 'sites'\n | 'icons'\n )[] = null;\n\n /**\n * Whether to show search functionality\n */\n @Prop() showSearch: boolean = true;\n\n /**\n * Whether to show Nanopore logo\n */\n @Prop() showLogo: boolean = true;\n\n /**\n * The link to put on the logo\n */\n @Prop() logoUrl: string = location.protocol + '//' + location.host;\n\n /**\n * An array of Algolia search indexes (and optional display names). Will be automatically populated from MyAccount\n */\n @Prop() searchIndeces: Array<SearchIndex> = [];\n\n /**\n * Logged in user details automatically populated from MyAccount\n */\n @Prop({ mutable: true }) myAccountUser: MyAccountUser = null;\n\n /**\n * An Algolia App ID key. Will be automatically populated from MyAccount\n */\n @Prop({ mutable: true }) searchAppId: string;\n\n /**\n * An Algolia API Key. Will be automatically populated from MyAccount\n */\n @Prop({ mutable: true }) searchApiKey: string;\n\n /**\n * A search value to passed to Algolia to programatically get or to preload search results\n */\n @Prop({ mutable: true }) searchValue: string = '';\n\n /**\n * Algolia search index to programatically set or to set an initial index\n */\n @Prop({ mutable: true }) searchIndex: string = 'all_prod_en';\n\n /**\n * MyAccount store cart count.\n */\n @Prop({ mutable: true }) cartCount: number = 0;\n\n /**\n * MyAccount un-read message count.\n */\n @Prop({ mutable: true }) msgCount: number = 0;\n\n /**\n * Url to the Nanopore store cart. Will default to the url supplied by MyAccount\n */\n @Prop({ mutable: true }) cartUrl: string = null;\n\n /**\n * Url to the Nanopore message center. Will default to the url supplied by MyAccount\n */\n @Prop({ mutable: true }) msgUrl: string = null;\n\n /**\n * Emitted when the global nav is ready.\n */\n @Event() nanoIsReady!: EventEmitter<void>;\n\n /**\n * Emitted when search results are successfully returned from Algolia.\n */\n @Event() nanoSearchResult!: EventEmitter<AloliaSearchResultDetail>;\n\n /**\n * Emitted when algolia returns an error.\n */\n @Event() nanoSearchError!: EventEmitter<AlgoliaNetworkError>;\n\n /**\n * Emitted when search field is cleared.\n */\n @Event() nanoSearchReset!: EventEmitter<AloliaSearchResultDetail>;\n\n /**\n * Submit the search form (a search value must be present)\n */\n @Method()\n async submitSearch() {\n this.onSearchSubmit();\n this.showAutocomplete = false;\n return;\n }\n\n @Watch('env')\n @Watch('ssoDataUrl')\n async getMyAccData() {\n switch (this.env) {\n case 'prod':\n this.userProfileUrl = 'https://community.nanoporetech.com/profile/me';\n case 'local':\n case 'dev':\n case 'test':\n default:\n this.userProfileUrl =\n 'https://community-test.nanoporetech.com/profile/me';\n break;\n }\n\n if (!this.getMyAccountData || this.myAccData) {\n this.remoteDataReady = true;\n return;\n }\n\n let url = this.ssoDataUrl;\n\n if (!url) {\n switch (this.env) {\n case 'dev':\n url = 'https://myaccount-dev.nanoporetech.com/';\n break;\n case 'test':\n url = 'https://myaccount-test.nanoporetech.com/';\n break;\n default:\n url = 'https://myaccount.nanoporetech.com/';\n break;\n }\n }\n\n const config = { timeout: 5000 };\n\n try {\n if (this.env === 'local') {\n this.myAccData = (await import(\n `./assets/local-my-account.json`\n )) as unknown as MyAccountData;\n } else {\n this.myAccData = await clientFetch(url + 'nav_bar_data.json', config);\n }\n if (this.myAccData.user.id) {\n this.isLoggedIn = true;\n this.myAccountUser = this.myAccData.user;\n }\n this.processMyAccLinks();\n this.processMyAccData();\n setTimeout(() => (this.remoteDataReady = true), 300);\n } catch (e) {\n console.error(e);\n this.remoteDataReady = true;\n }\n }\n\n @Watch('searchIndex')\n currentSelectedIndex() {\n if (!this.internalSearchIndeces.length) {\n return;\n }\n\n const foundIndex = this.internalSearchIndeces.find(\n (index) => index.index === this.searchIndex\n );\n\n if (!foundIndex) {\n this.currentIndex = this.internalSearchIndeces[0];\n console.error('index not found');\n return;\n }\n\n this.currentIndex = foundIndex;\n return foundIndex;\n }\n\n @Watch('searchValInternal')\n changeInternalSearchVal() {\n if (this.searchValInternal !== this.searchValue)\n this.searchValue = this.searchValInternal;\n }\n\n @Watch('searchApiKey')\n @Watch('searchAppId')\n initAlgoliaClient() {\n if (!this.searchAppId || !this.searchApiKey) return;\n\n this.algoliaClient = algoliasearch(this.searchAppId, this.searchApiKey);\n this.addAlgoliaIndeces();\n }\n\n @Watch('searchIndeces')\n addIndeces() {\n this.internalSearchIndeces = [\n ...this.internalSearchIndeces,\n ...this.searchIndeces,\n ];\n }\n\n @Watch('internalSearchIndeces')\n addAlgoliaIndeces() {\n if (!this.algoliaClient || !this.internalSearchIndeces.length) return;\n\n this.internalSearchIndeces.forEach((searchIndex) => {\n searchIndex.alogliaIndex = this.algoliaClient.initIndex(\n searchIndex.index\n );\n });\n if (!this.searchIndex)\n this.searchIndex = this.internalSearchIndeces[0].index;\n }\n\n @Watch('threshold')\n thresholdChange(newThreshold, oldThreshold) {\n if (newThreshold > oldThreshold) {\n // we've resized to larger screen.\n this.thresholdsGoingUp = true;\n this.setResizingState(true);\n }\n }\n\n /**\n * Primary logic for resizing changes.\n * When content doesn't fit - we loop down through break points until it does\n */\n @Watch('intersectRatio')\n ratioChange() {\n if (this.intersectRatio < 1 && this.threshold > 0) {\n // content doesn't fit\n if (this.thresholdsGoingUp) this.setResizingState(true);\n this.threshold--;\n setTimeout(() => this.ratioChange(), 500);\n } else {\n this.thresholdReady = true;\n\n // content now fits so add / remove context classes\n // on nav-items depending on whether they're added to bar or burger.\n this.siteContent.style.minHeight = `calc(100% - ${\n this.barsDiv.clientHeight + 1\n }px)`;\n\n let menuItems: Array<Element>, barItems: Array<Element>;\n readTask(() => {\n menuItems = [\n ...Array.from(this.el.querySelectorAll('nano-nav-item[slot=\"site\"]')),\n ...Array.from(\n this.el.querySelectorAll('nano-nav-item[slot=\"overflow\"]')\n ),\n ];\n barItems = [];\n\n if (this.threshold < this.THRESHOLDLIMIT - THRESHOLDBREAKS.icon)\n menuItems.push(\n ...Array.from(\n this.el.querySelectorAll('nano-nav-item[slot=\"icon\"]')\n )\n );\n else\n barItems.push(\n ...Array.from(\n this.el.querySelectorAll('nano-nav-item[slot=\"icon\"]')\n )\n );\n\n if (this.threshold < this.THRESHOLDLIMIT - THRESHOLDBREAKS.login)\n menuItems.push(\n ...Array.from(\n this.el.querySelectorAll('nano-nav-item[slot=\"loggedin\"]')\n )\n );\n else\n barItems.push(\n ...Array.from(\n this.el.querySelectorAll('nano-nav-item[slot=\"loggedin\"]')\n )\n );\n\n if (this.threshold < this.THRESHOLDLIMIT - THRESHOLDBREAKS.main)\n menuItems.push(\n ...Array.from(\n this.el.querySelectorAll('nano-nav-item[slot=\"main\"]')\n )\n );\n else\n barItems.push(\n ...Array.from(\n this.el.querySelectorAll('nano-nav-item[slot=\"main\"]')\n )\n );\n\n if (this.threshold < this.THRESHOLDLIMIT - THRESHOLDBREAKS.about)\n menuItems.push(\n ...Array.from(\n this.el.querySelectorAll('nano-nav-item[slot=\"about\"]')\n )\n );\n else\n barItems.push(\n ...Array.from(\n this.el.querySelectorAll('nano-nav-item[slot=\"about\"]')\n )\n );\n });\n\n writeTask(() => {\n menuItems.forEach((item) => {\n item.classList.add('nano-global-nav-menu');\n item.classList.remove('nano-global-nav-bar');\n });\n barItems.forEach((item) => {\n item.classList.remove('nano-global-nav-menu');\n item.classList.add('nano-global-nav-bar');\n });\n });\n }\n }\n\n @Watch('thresholdReady')\n @Watch('remoteDataReady')\n assessReady() {\n if (this.thresholdReady && this.remoteDataReady) {\n this.ready = true;\n }\n }\n\n @Watch('remoteDataReady')\n remoteReady() {\n this.attachIO();\n }\n\n @Watch('ready')\n isReady() {\n this.nanoIsReady.emit();\n }\n\n /**\n * Add / remove events when autocomplete results show / hide.\n */\n @Watch('showAutocomplete')\n setupAutocompleteBlur() {\n this.searchInput.clientWidth; // force reflow\n if (this.showAutocomplete) {\n this.el.shadowRoot.addEventListener('click', this.onAutocompleteBlur);\n } else {\n this.el.shadowRoot.removeEventListener('click', this.onAutocompleteBlur);\n }\n }\n\n /**\n * As relevant slotted items change, reset resizing breakpoints\n */\n @Watch('aboutSlotLen')\n @Watch('iconSlotLen')\n @Watch('mainSlotLen')\n @Watch('overflowSlotLen')\n @Watch('searchSlotLen')\n slotChange() {\n this.threshold = this.THRESHOLDLIMIT;\n }\n\n // General classes for visuals\n\n private thresholdClasses() {\n const classes = [];\n let i = 0;\n for (i; i < this.threshold; i++) classes.push('threshold-' + (i + 1));\n return classes;\n }\n\n /**\n * provides 'isResizing' - we use this to fade content out on 'breakpoint' increase\n * (when the screen size increases). Otherwise the stepping through of\n * breakpoints to calculate if content currently fits shows on screen (looks ugly)\n */\n private setResizingState = (state: boolean = false) => {\n if (typeof this.debounceSetResizingState === 'undefined') {\n this.debounceSetResizingState = debounce(this.setResizingState, 600);\n }\n if (state) {\n this.isResizing = true;\n this.debounceSetResizingState();\n } else {\n this.isResizing = false;\n this.thresholdsGoingUp = false;\n }\n };\n\n // Global DOM Events\n\n private onWindowResize() {\n if (\n this.threshold < this.THRESHOLDLIMIT &&\n window.innerWidth > this.currSize\n ) {\n this.threshold = this.THRESHOLDLIMIT;\n }\n this.currSize = window.innerWidth;\n this.searchBarShown = false;\n }\n\n // Burger / Overflow Menu\n\n // listen to nav-item secondary open / close events primarily for resizing the menu\n @Listen('nanoOpen')\n secondaryOpen(ev: CustomEvent) {\n if (!(ev.detail as NavItemEventDetail).secondaryMenu) return;\n ev.stopPropagation();\n this.secondaryMenuOpen = true;\n this.menuContentDiv.style.minHeight =\n (ev.detail as NavItemEventDetail).secondaryMenu.scrollHeight + 'px';\n }\n\n @Listen('nanoClose')\n secondaryClose(ev: CustomEvent) {\n if (!(ev.detail as NavItemEventDetail).secondaryMenu) return;\n ev.stopPropagation();\n this.secondaryMenuOpen = false;\n this.menuContentDiv.style.minHeight = '';\n }\n\n private onMenuBtnKeyDown = (ev: KeyboardEvent) => {\n switch (ev.key) {\n case 'Enter':\n case ' ':\n this.modalOpen ? this.menuClose(ev, true) : this.menuOpen();\n break;\n }\n };\n\n private onMenuBtnClick = (ev: MouseEvent) => {\n this.menuClose(ev, true);\n };\n\n private menuOpen = (e?: MouseEvent) => {\n if (e) e.preventDefault();\n\n this.menuDiv.style.display = 'block';\n // need to open menu in stages\n // wait for re-flow after changing display\n // wait for repaint after animate, then focus\n\n this.menuDiv.clientWidth; // force reflow\n\n this.modalOpen = true;\n this.modalIsOpen = true;\n this.menuWrapDiv.addEventListener('focusout', this.menuClose);\n\n this.menuDiv.clientWidth; // force reflow\n\n this.menuWrapDiv.focus({ preventScroll: true });\n if (\n this.threshold < 2 ||\n this.menuWrapDiv.scrollHeight > window.innerHeight\n ) {\n document.body.style.overflow = 'hidden';\n this.menuFullScreen = true;\n } else document.body.style.overflowX = 'hidden';\n };\n\n private onMenuHidden = () => {\n this.menuDiv.removeEventListener('transitionend', this.onMenuHidden);\n this.menuWrapDiv.removeEventListener('focusout', this.menuClose);\n\n document.body.style.overflow = '';\n this.menuDiv.style.display = 'none';\n this.modalIsOpen = false;\n this.menuFullScreen = false;\n\n setTimeout(() => {\n if (document.activeElement === document.body && this.menuBtn)\n this.mainBarDiv.focus({ preventScroll: true });\n }, 50);\n };\n\n private menuClose = (\n ev?: FocusEvent | MouseEvent | KeyboardEvent | TouchEvent,\n force: boolean = false\n ) => {\n if (!force) {\n const e = ev as FocusEvent;\n if (\n e &&\n e.relatedTarget &&\n closestElement('#global-nav-menu', e.relatedTarget as HTMLElement)\n )\n return;\n if (\n e &&\n e.relatedTarget &&\n (e.relatedTarget as HTMLElement).closest('#global-nav-menu')\n )\n return;\n if (\n e &&\n e.relatedTarget &&\n (e.relatedTarget as HTMLElement).closest('[slot=\"promotion\"]')\n )\n return;\n if (this.secondaryMenuOpen) return;\n }\n\n this.modalOpen = false;\n this.menuDiv.addEventListener('transitionend', this.onMenuHidden);\n };\n\n private subMenuClose = (ev?: MouseEvent) => {\n ev.preventDefault();\n (ev.target as HTMLNanoNavItemElement).closest('nano-nav-item').open = false;\n };\n\n // User profile menu\n\n private onUserBtnClick = (ev: MouseEvent) => {\n ev.preventDefault();\n this.userMenuOpen = !this.userMenuOpen;\n };\n\n private onUserBtnKeyDown = (ev: KeyboardEvent) => {\n switch (ev.key) {\n case 'Enter':\n case ' ':\n this.userMenuOpen = !this.userMenuOpen;\n break;\n }\n };\n\n private onUserMenuBlur = (ev: FocusEvent) => {\n if (!ev.relatedTarget) {\n this.userMenuOpen = false;\n return;\n }\n if (!!(ev.relatedTarget as HTMLElement).closest('.user-links-panel'))\n return false;\n this.userMenuOpen = false;\n };\n\n @Watch('userMenuOpen')\n async handleUserMenu() {\n await displayTransition(this.userLinkPanel, 'show', this.userMenuOpen);\n if (this.userMenuOpen) {\n this.userLinkPanel.focus();\n this.userLinkPanel.addEventListener('focusout', this.onUserMenuBlur);\n } else {\n this.userLinkPanel.removeEventListener('focusout', this.onUserMenuBlur);\n this.el.focus();\n }\n }\n\n // Search bar (smaller screens / mobile)\n\n private onSearchBtnClick = (ev: MouseEvent) => {\n ev.preventDefault();\n if (!this.searchBarShown) this.searchbarShow();\n else this.searchbarHide();\n };\n\n private onSearchBtnKeyDown = (ev: KeyboardEvent) => {\n switch (ev.key) {\n case 'Enter':\n case ' ':\n this.searchBarShown ? this.searchbarHide() : this.searchbarShow();\n break;\n }\n };\n\n private searchbarShow() {\n this.searchBarShown = true;\n this.searchBarEl.addEventListener('transitionend', this.onSearchBarShown);\n this.searchBarEl.style.display = 'block';\n\n setTimeout(() => {\n this.searchBarEl.style.height =\n this.searchBarEl.querySelector('.search-widget').scrollHeight + 'px';\n }, 50);\n }\n\n private onSearchBarShown = () => {\n this.searchBarEl.removeEventListener(\n 'transitionend',\n this.onSearchBarShown\n );\n if (this.searchInput) this.searchInput.setFocus();\n this.searchBarEl.style.overflow = 'visible';\n };\n\n private searchbarHide = (ev?: FocusEvent) => {\n if (\n ev &&\n ev.relatedTarget &&\n (ev.relatedTarget as HTMLElement).closest('#global-nav-search-bar')\n )\n return;\n this.showAutocomplete = false;\n if (this.searchValInternal.length && ev) return;\n\n this.searchBarEl.addEventListener('transitionend', this.onSearchBarHidden);\n this.searchBarEl.style.overflow = 'hidden';\n this.searchBarEl.style.height = '0px';\n };\n\n private onSearchBarHidden = () => {\n this.searchBarEl.removeEventListener(\n 'transitionend',\n this.onSearchBarHidden\n );\n this.searchBarEl.style.display = 'none';\n this.searchBarShown = false;\n };\n\n // Algolia search\n\n private autocompleteSnippet(hit: AlgoliaResultHit) {\n const lookFor = ['title']; // , 'body'\n if (hit._snippetResult) {\n const found = lookFor.find(\n (prop) =>\n hit._snippetResult[prop] &&\n hit._snippetResult[prop].matchLevel !== 'none'\n );\n\n if (found) {\n if (found !== 'title')\n return (\n (hit.title.length > 15\n ? hit.title.substring(0, 15) + ' ...'\n : hit.title) +\n ' ' +\n hit._snippetResult[found].value\n );\n else return hit._snippetResult['title'].value;\n }\n }\n return hit.title;\n }\n\n private onSearchInput = (ev: CustomEvent<InputEvent>) => {\n this.searchValInternal = this.searchInput.value;\n\n if (!this.isSearchValSet()) {\n this.searchLoading = false;\n return;\n }\n\n if (ev.detail.type === 'input') {\n this.showAutocomplete = false;\n this.searchLoading = true;\n }\n };\n\n private onSearchChange = async (ev?: CustomEvent<InputChangeEventDetail>) => {\n this.searchValInternal = this.searchValue = ev\n ? ev.detail.value\n : this.searchValInternal;\n this.showAutocomplete = false;\n this.autocompleteResults = null;\n\n if (!this.isSearchValSet()) {\n if (!this.searchValInternal.length) {\n this.nanoSearchReset.emit();\n }\n this.searchLoading = false;\n return;\n }\n if (!this.currentIndex) this.currentSelectedIndex();\n\n try {\n this.autocompleteResults = this.processSearchResults(\n (await this.currentIndex.alogliaIndex.search(this.searchValInternal, {\n attributesToSnippet: ['body:5', 'title:8'],\n hitsPerPage: 5,\n filters: 'created > ' + Math.floor((Date.now() - 63115200000) / 1000), // only get last 2 years\n })) as any\n ) as AlgoliaResults;\n } catch (e) {\n console.error(e);\n }\n\n this.scopeSearch = null;\n this.scopeSearch = await this.onSearchSubmit(null, false);\n\n this.searchLoading = false;\n this.showAutocompleteResults();\n };\n\n private onSearchSubmit = async (ev?, emit: boolean = true) => {\n if (ev) ev.preventDefault();\n if (!this.isSearchValSet()) return;\n this.searchLoading = true;\n this.algoliaSearchResults = null;\n\n if (!this.currentIndex) this.currentSelectedIndex();\n\n const queries = this.internalSearchIndeces.map((index) => {\n return {\n indexName: index.index,\n query: this.searchValInternal,\n facets: index.filters,\n hitsPerPage: 10,\n filters: 'created > ' + Math.floor((Date.now() - 63115200000) / 1000), // only get last 2 years\n };\n });\n\n try {\n this.algoliaSearchResults = this.processSearchResults(\n (await this.algoliaClient.multipleQueries(queries)) as any\n ) as AlgoliaMultiResults;\n } catch (e) {\n this.nanoSearchError.emit(e as AlgoliaNetworkError);\n }\n this.searchLoading = false;\n if (!this.algoliaSearchResults) return;\n\n this.algoliaSearchResults.results.map((result, i) => {\n result.indexName = this.internalSearchIndeces[i].name;\n result.selected =\n this.currentIndex.name === this.internalSearchIndeces[i].name;\n result.domain = this.currentIndex.domain || null;\n result.domains = this.myAccData.domains || null;\n result.allGroup = !!this.internalSearchIndeces[i].allGroup;\n result.filters = this.internalSearchIndeces[i].filters;\n });\n\n if (emit) {\n this.nanoSearchResult.emit({\n results: this.algoliaSearchResults.results,\n client: { apiKey: this.searchApiKey, appId: this.searchAppId },\n });\n this.showAutocomplete = false;\n }\n return this.algoliaSearchResults;\n };\n\n private onSearchIndexChange = async (\n index: CustomEvent<SelectChangeEventDetail> | string\n ) => {\n const ev = index as CustomEvent<SelectChangeEventDetail>;\n let indexStr = index as string;\n\n if (!this.currentIndex) this.currentSelectedIndex();\n\n if (ev.detail && ev.detail.value.length)\n indexStr = ev.detail.value as string;\n if (!indexStr || !indexStr.length) return;\n if (this.currentIndex.index === indexStr) return;\n\n const selectedIndex = this.internalSearchIndeces.find(\n (index) => index.index === indexStr\n );\n if (!selectedIndex || !selectedIndex.alogliaIndex) return;\n\n this.searchIndex = selectedIndex.index;\n if (this.isSearchValSet()) await this.onSearchChange();\n };\n\n private isSearchValSet() {\n if (this.searchValInternal.length < 3) return false;\n return true;\n }\n\n private switchIndexSubmit = async (index: string) => {\n if (this.isSearchValSet()) {\n await this.onSearchIndexChange(index);\n this.onSearchSubmit();\n } else this.onSearchIndexChange(index);\n };\n\n // Autocomplete\n\n @Watch('showAutocomplete')\n resetHitFocus() {\n this.currAIndex = -1;\n }\n\n private onAutocompleteBlur = (ev: MouseEvent) => {\n if (!this.showAutocomplete || !this.autocompleteResults) return;\n if (ev && ev.target && (ev.target as HTMLElement).closest('.search-widget'))\n return;\n this.showAutocomplete = false;\n };\n\n private showAutocompleteResults = () => {\n if (!this.autocompleteResults || !this.autocompleteResults.hits) return;\n this.showAutocomplete = true;\n };\n\n private setActiveElement(\n autocompleteEle: HTMLAnchorElement | HTMLButtonElement\n ) {\n this.autocompleteEles.map((ele) =>\n ele.setAttribute('aria-selected', 'false')\n );\n autocompleteEle.focus({ preventScroll: true });\n autocompleteEle.setAttribute('aria-selected', 'true');\n }\n\n private onAutocompleteInteract = (ev: KeyboardEvent) => {\n // list open, navigate items with arrows\n if (!this.showAutocomplete || !this.autocompleteResults) return;\n let testIndex = this.currAIndex;\n\n switch (ev.key) {\n case 'Tab':\n setTimeout(() => {\n if (\n !this.el.shadowRoot.activeElement ||\n !this.el.shadowRoot.activeElement.closest('.search-widget')\n ) {\n this.showAutocomplete = false;\n return;\n } else {\n const found = this.autocompleteEles.find((ele, i) => {\n if (ele === this.el.shadowRoot.activeElement) {\n this.currAIndex = i;\n return true;\n }\n });\n if (found) this.setActiveElement(found);\n else this.currAIndex = -1;\n }\n });\n break;\n case 'ArrowDown':\n case 'ArrowUp':\n if (ev.key === 'ArrowDown') testIndex++;\n else if (ev.key === 'ArrowUp') testIndex--;\n\n const found = this.autocompleteEles[testIndex];\n if (\n found ||\n testIndex < 0 ||\n testIndex > this.autocompleteEles.length - 1\n )\n ev.preventDefault();\n this.searchInput.clientWidth; // force reflow\n\n if (found) {\n this.setActiveElement(found);\n this.currAIndex = testIndex;\n } else if (testIndex < 0) {\n this.searchInput.setFocus();\n this.currAIndex = -1;\n }\n break;\n case 'Enter':\n case ' ':\n if (this.autocompleteEles[this.currAIndex]) {\n this.autocompleteEles[this.currAIndex].click();\n }\n break;\n }\n };\n\n // Various.\n\n /**\n * Assesses what content is present in which slots\n */\n private assessSlottedContent() {\n readTask(() => {\n this.hasSiteSlot = !!this.el.querySelectorAll('[slot=\"site\"]').length;\n this.hasLoggedinSlot =\n !!this.el.querySelectorAll('[slot=\"loggedin\"]').length;\n this.hasPromotionSlot =\n !!this.el.querySelectorAll('[slot=\"promotion\"]').length;\n\n this.aboutSlotLen = this.el.querySelectorAll('[slot=\"about\"]').length;\n this.iconSlotLen = this.el.querySelectorAll('[slot=\"icon\"]').length;\n this.mainSlotLen = this.el.querySelectorAll('[slot=\"main\"]').length;\n this.overflowSlotLen =\n this.el.querySelectorAll('[slot=\"overflow\"]').length;\n this.searchSlotLen = this.el.querySelectorAll('[slot=\"search\"]').length;\n });\n }\n\n /**\n * Attach the IntersectionObserver - from which all threshold / breakpoint logic hinges\n */\n private attachIO() {\n if (this.io) return;\n const root = this.el.shadowRoot.querySelector('.global-nav .main-bar');\n if (\n Build.isBrowser &&\n typeof window !== 'undefined' &&\n (window as any).IntersectionObserver &&\n !!root\n ) {\n const io = (this.io = new (window as any).IntersectionObserver(\n (data: IntersectionObserverEntry[]) => {\n this.intersectRatio = data.slice(-1)[0].intersectionRatio;\n },\n { root, threshold: 1 }\n ));\n io.observe(root.querySelector('.measure-ele'));\n }\n }\n\n // Stencil Lifecycle / Rendering\n\n componentDidLoad() {\n if (Build.isBrowser) {\n this.debounceResize = debounce(this.onWindowResize.bind(this), 300);\n\n window.addEventListener('resize', this.debounceResize);\n this.currSize = window.innerWidth;\n }\n\n this.initAlgoliaClient();\n this.addAlgoliaIndeces();\n if (this.remoteDataReady) this.attachIO();\n }\n\n componentWillLoad() {\n ComponentStore.init(\n this,\n ['searchIndex', 'searchValue'],\n 'url-hash',\n 'gns'\n );\n\n if (\n Build.isBrowser &&\n typeof window !== 'undefined' &&\n (window as any).MutationObserver\n ) {\n const mo = (this.mo = new MutationObserver(() => {\n this.assessSlottedContent();\n }));\n mo.observe(this.el, { childList: true, subtree: false });\n }\n this.assessSlottedContent();\n }\n\n disconnectedCallback() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n if (this.mo) {\n this.mo.disconnect();\n this.mo = undefined;\n }\n if (Build.isBrowser)\n window.removeEventListener('resize', this.debounceResize);\n }\n\n async connectedCallback() {\n this.getMyAccData();\n }\n\n // Render output\n\n private autocompleteList(): VNode {\n let content;\n if (this.showAutocomplete && this.scrollingUp) {\n let currentScopeHits = 0;\n let scopeChangeSuggestions = 0;\n\n const scopeSuggestReducer = (\n total: number,\n result: AlgoliaMultiResult\n ) => {\n return result.index !== this.currentIndex.index\n ? total + result.hits.length\n : total;\n };\n const currentSuggestReducer = (\n total: number,\n result: AlgoliaMultiResult\n ) => {\n return result.index === this.currentIndex.index\n ? total + result.hits.length\n : total;\n };\n\n if (this.scopeSearch) {\n scopeChangeSuggestions = this.scopeSearch.results.reduce(\n scopeSuggestReducer,\n 0\n );\n currentScopeHits = this.scopeSearch.results.reduce(\n currentSuggestReducer,\n 0\n );\n }\n\n if (\n (this.autocompleteResults && this.autocompleteResults.hits.length) ||\n (scopeChangeSuggestions && !currentScopeHits)\n ) {\n let scopeSuggestions = 0;\n\n content = (\n <div>\n {!currentScopeHits && (\n <div class=\"search-autocomplete-hit search-autocomplete-hit--no-result\">\n No results matching '{this.searchValInternal}' were found in{' '}\n <strong>{this.currentIndex.name}</strong>. Try another phrase.\n </div>\n )}\n {this.autocompleteResults && [\n this.autocompleteResults.hits.map((hit, i) => {\n return (\n <a\n role=\"option\"\n ref={(a) => this.autocompleteEles.push(a)}\n tabindex=\"-1\"\n id={'autocomplete-hit-' + i}\n href={hit.url}\n class=\"search-autocomplete-hit\"\n innerHTML={this.autocompleteSnippet(hit)}\n ></a>\n );\n }),\n ]}\n {(!currentScopeHits || this.currentIndex.allGroup) &&\n this.scopeSearch &&\n this.scopeSearch.results && [\n this.scopeSearch.results.map((result, i) => {\n if (\n !result.hits.length ||\n result.index === this.currentIndex.index ||\n scopeSuggestions > 1\n )\n return;\n scopeSuggestions++;\n return (\n <button\n role=\"option\"\n ref={(button) => this.autocompleteEles.push(button)}\n tabindex=\"-1\"\n id={'autocomplete-scope-' + i}\n class=\"search-autocomplete-hit\"\n onClick={() => this.switchIndexSubmit(result.index)}\n onMouseDown={() => this.switchIndexSubmit(result.index)}\n >\n \"{this.searchValInternal}\"{' '}\n <div class=\"search-autocomplete-hit-scope\">\n in {result.indexName}\n </div>\n </button>\n );\n }),\n ]}\n {!!currentScopeHits && (\n <div class=\"search-autocomplete-foot\">\n <button\n role=\"option\"\n class=\"search-autocomplete-submit\"\n ref={(button) => this.autocompleteEles.push(button)}\n id={'autocomplete-foot'}\n onClick={this.onSearchSubmit}\n onMouseDown={this.onSearchSubmit}\n >\n View all results\n </button>\n </div>\n )}\n </div>\n );\n } else if (!currentScopeHits) {\n content = (\n <div class=\"search-autocomplete-hit search-autocomplete-hit--no-result\">\n No results matching '{this.searchValInternal}' were found. Try\n another phrase.\n </div>\n );\n }\n }\n\n return (\n <div\n class=\"search-autocomplete\"\n role=\"listbox\"\n id=\"autocomplete-results\"\n aria-expanded={this.showAutocomplete ? 'true' : 'false'}\n hidden={!this.showAutocomplete}\n onKeyDown={this.onAutocompleteInteract}\n >\n {content}\n </div>\n );\n }\n\n private searchWidget(): VNode[] {\n return [\n <form\n class=\"search-inputs\"\n onSubmit={this.onSearchSubmit}\n id=\"global-nav-search\"\n >\n <nano-select\n class=\"search-input\"\n label=\"Which area of content would you like to search?\"\n hideLabel={true}\n showInlineError={false}\n value={this.searchIndex}\n onNanoChange={this.onSearchIndexChange}\n mask={true}\n >\n {this.internalSearchIndeces.map((index) => {\n return (\n <nano-option\n selected={index.index === this.searchIndex}\n value={index.index}\n >\n {index.name || index.index}\n </nano-option>\n );\n })}\n </nano-select>\n <nano-input\n class=\"search-input\"\n label=\"What would you like to search for?\"\n aria-label=\"What would you like to search for?\"\n hideLabel={true}\n showInlineError={false}\n clear-input\n placeholder=\"Search Nanopore\"\n type=\"text\"\n ref={(input) => (this.searchInput = input)}\n onNanoChange={this.onSearchChange}\n onNanoInput={this.onSearchInput}\n onKeyDown={this.onAutocompleteInteract}\n debounce={500}\n aria-autocomplete=\"list\"\n aria-activedescendant={\n this.autocompleteEles[this.currAIndex]\n ? this.autocompleteEles[this.currAIndex].id\n : false\n }\n aria-controls=\"autocomplete-results\"\n onNanoFocus={this.showAutocompleteResults}\n value={this.searchValue}\n role=\"textbox\"\n >\n <button\n class={{\n 'search-icon': true,\n 'search-icon--search': true,\n 'search-icon--show': !this.searchValInternal.length,\n }}\n slot=\"end\"\n onMouseDown={(e) => {\n this.searchValInternal = this.searchInput.value;\n this.onSearchSubmit(e, true);\n }}\n >\n <nano-icon name=\"light/search\"></nano-icon>\n </button>\n <span\n class={{\n 'search-icon': true,\n 'search-icon--loader': true,\n 'search-icon--show': this.searchLoading,\n }}\n slot=\"end\"\n >\n <nano-icon name=\"light/spinner-third\"></nano-icon>\n </span>\n </nano-input>\n <input type=\"submit\" />\n </form>,\n ];\n }\n\n render() {\n this.autocompleteEles = [];\n const isRtl = (this.el.ownerDocument as Document).dir === 'rtl';\n\n const searchWidget = this.searchWidget();\n searchWidget.push(this.autocompleteList());\n\n return (\n <Host\n class={{\n [this.thresholdClasses().join(' ')]: true,\n ready: this.ready,\n 'search-bar-shown': this.searchBarShown && this.scrollingUp,\n 'search-auto-complete-shown':\n this.showAutocomplete && this.scrollingUp,\n 'modal-open': this.modalIsOpen,\n resizing: this.isResizing,\n }}\n dir={isRtl ? 'rtl' : null}\n >\n <div\n class={{\n 'global-nav': true,\n 'scrolling-down': !this.scrollingUp,\n }}\n >\n {/* START BURGER / OVERFLOW MENU */}\n <nav\n id=\"global-nav-menu\"\n class={{\n 'gn-menu': true,\n open: this.modalOpen,\n 'has-promotion': this.hasPromotionSlot,\n 'menu-full-screen': this.menuFullScreen,\n 'secondary-open': this.secondaryMenuOpen,\n }}\n aria-expanded={this.modalOpen ? 'true' : 'false'}\n ref={(div) => (this.menuDiv = div)}\n >\n <div\n class=\"gn-menu_wrap\"\n ref={(div) => (this.menuWrapDiv = div)}\n tabindex=\"-1\"\n >\n <div class=\"gn-menu_actions\">\n <button\n class=\"menu-btn icon-btn icon-btn\"\n onMouseDown={this.onMenuBtnClick}\n onKeyDown={this.onMenuBtnKeyDown}\n >\n {this.threshold < this.THRESHOLDLIMIT - 3 && (\n <nano-icon\n name=\"light/times\"\n aria-label=\"close menu\"\n ></nano-icon>\n )}\n {this.threshold >= this.THRESHOLDLIMIT - 3 && (\n <nano-icon\n name=\"light/bars\"\n aria-label=\"close menu\"\n ></nano-icon>\n )}\n </button>\n\n {this.threshold <\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.icon && [\n !!this.iconSlotLen && <slot name=\"icon\" />,\n this.myAccData &&\n (!this.activeMyAccountSections ||\n this.activeMyAccountSections.includes('icons')) && [\n this.msgUrl && (\n <a href={this.msgUrl} class=\"icon-btn\">\n <nano-icon name=\"light/bell\"></nano-icon>\n {this.msgCount > 0 && (\n <span class=\"gn-menu_actions-counter\">\n {this.msgCount}\n </span>\n )}\n </a>\n ),\n this.cartUrl && (\n <a href={this.cartUrl} class=\"icon-btn\">\n <nano-icon name=\"light/shopping-cart\"></nano-icon>\n {this.cartCount > 0 && (\n <span class=\"gn-menu_actions-counter\">\n {this.cartCount}\n </span>\n )}\n </a>\n ),\n ],\n ]}\n\n {this.myAccData && this.myAccData.urls.login && (\n <a\n href={this.myAccData.urls.login + this.ssoRedirect}\n class=\"login-btn\"\n >\n Login / Register{' '}\n <nano-icon name=\"solid/chevron-right\"></nano-icon>\n </a>\n )}\n </div>\n\n <div\n class=\"content-wrap\"\n ref={(div) => (this.menuContentDiv = div)}\n >\n <div class=\"content\">\n <nav class=\"nav-links nav-links--main\">\n <slot name=\"overflow\" />\n {this.threshold <\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.main &&\n !!this.mainSlotLen && <slot name=\"main\" />}\n </nav>\n\n {/* ABOUT AND SITE MENU IN BURGER */}\n {(((!!this.aboutSlotLen || !!this.aboutNavItms.length) &&\n this.hasSiteSlot) ||\n !!this.siteNavItms.length) && (\n <div>\n {(!!this.aboutSlotLen || !!this.aboutNavItms.length) && [\n // About Menu as an open list (before more items are added to burger)`\n (this.threshold >=\n this.THRESHOLDLIMIT - (THRESHOLDBREAKS.about + 1) ||\n this.mainSlotLen < 2) &&\n this.overflowSlotLen < 2 && (\n <div class=\"nav-links-wrap\">\n {!!this.aboutNavItms.length && (\n <h4 class=\"nav-links_title\">About</h4>\n )}\n <nav\n class=\"nav-links nav-links--sub\"\n aria-label=\"About the company links\"\n >\n <slot name=\"about\" />\n\n {this.aboutNavItms.map((link) => {\n return (\n <nano-nav-item class=\"nano-global-nav nano-global-nav-menu\">\n <a\n href={link.address}\n target={link.target}\n >\n {link.title}\n </a>\n </nano-nav-item>\n );\n })}\n </nav>\n </div>\n ),\n // About Menu as hidden list (when more items are added to burger)\n ((this.threshold <\n this.THRESHOLDLIMIT - (THRESHOLDBREAKS.about + 1) &&\n this.mainSlotLen >= 2) ||\n this.overflowSlotLen >= 2) && (\n <nav\n class=\"nav-links\"\n aria-label=\"About the company links\"\n >\n {!this.aboutNavItms.length && <slot name=\"about\" />}\n {!!this.aboutNavItms.length && (\n <nano-nav-item class=\"nano-global-nav nano-global-nav-menu\">\n Company\n <nano-icon\n slot=\"icon-end\"\n name=\"solid/chevron-right\"\n ></nano-icon>\n <div slot=\"secondary\">\n <div class=\"content\">\n <button\n class=\"back-btn\"\n onClick={this.subMenuClose}\n >\n <nano-icon\n slot=\"icon-end\"\n name=\"solid/chevron-left\"\n aria-label=\"go back\"\n ></nano-icon>\n Company\n </button>\n <slot name=\"about\" />\n <div class=\"content--sub\">\n {this.aboutNavItms.map((link) => {\n return (\n <nano-nav-item class=\"nano-global-nav nano-global-nav-menu\">\n <a\n href={link.address}\n target={link.target}\n >\n {link.title}\n </a>\n </nano-nav-item>\n );\n })}\n </div>\n </div>\n </div>\n </nano-nav-item>\n )}\n </nav>\n ),\n ]}\n\n {/* SITES MENU (Always in burger) */}\n {(this.hasSiteSlot || !!this.siteNavItms.length) && [\n (this.threshold >= this.THRESHOLDLIMIT - 2 ||\n this.mainSlotLen < 2) &&\n this.overflowSlotLen < 2 && (\n <div class=\"nav-links-wrap\">\n <h4 class=\"nav-links_title\">Sites</h4>\n <nav\n class=\"nav-links nav-links--sub\"\n aria-label=\"Different company site links\"\n >\n <slot name=\"site\" />\n {this.siteNavItms.map((link) => {\n return (\n <nano-nav-item class=\"nano-global-nav nano-global-nav-menu\">\n <a\n href={link.address}\n target={link.target}\n >\n {link.title}\n </a>\n </nano-nav-item>\n );\n })}\n </nav>\n </div>\n ),\n ((this.threshold < this.THRESHOLDLIMIT - 2 &&\n this.mainSlotLen >= 2) ||\n this.overflowSlotLen >= 2) && (\n <nav\n class=\"nav-links\"\n aria-label=\"Different company site links\"\n >\n <nano-nav-item class=\"nano-global-nav nano-global-nav-menu\">\n Sites\n <nano-icon\n slot=\"icon-end\"\n name=\"solid/chevron-right\"\n ></nano-icon>\n <div slot=\"secondary\">\n <div class=\"content\">\n <button\n class=\"back-btn\"\n onClick={this.subMenuClose}\n >\n <nano-icon\n slot=\"icon-end\"\n name=\"solid/chevron-left\"\n aria-label=\"go back\"\n ></nano-icon>\n Sites\n </button>\n <div class=\"content--sub\">\n <slot name=\"site\" />\n {this.siteNavItms.map((link) => {\n return (\n <nano-nav-item class=\"nano-global-nav nano-global-nav-menu\">\n <a\n href={link.address}\n target={link.target}\n >\n {link.title}\n </a>\n </nano-nav-item>\n );\n })}\n </div>\n </div>\n </div>\n </nano-nav-item>\n </nav>\n ),\n ]}\n </div>\n )}\n </div>\n\n {this.isLoggedIn &&\n this.threshold <\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.login &&\n (this.loggedInNavItms.length || this.hasLoggedinSlot) && (\n <nav class=\"nav-links\" aria-label=\"Your user account links\">\n <nano-nav-item class=\"nano-global-nav user-nav nano-global-nav-menu\">\n {this.myAccountUser.name}\n <nano-icon\n slot=\"icon-end\"\n name=\"solid/chevron-right\"\n ></nano-icon>\n <div slot=\"secondary\">\n <div class=\"content\">\n <button\n class=\"back-btn\"\n onClick={this.subMenuClose}\n >\n <nano-icon\n slot=\"icon-end\"\n name=\"solid/chevron-left\"\n aria-label=\"go back\"\n ></nano-icon>\n {this.myAccountUser.name}\n </button>\n {!!this.myAccountUser?.small_avatar_url && (\n <nano-global-nav-user-profile\n myAccountUser={this.myAccountUser}\n userProfileUrl={this.userProfileUrl}\n ></nano-global-nav-user-profile>\n )}\n <div class=\"content--sub\">\n <slot name=\"loggedin\" />\n {this.loggedInNavItms.map((link) => {\n return (\n <nano-nav-item class=\"nano-global-nav nano-global-nav-menu\">\n <a href={link.address} target={link.target}>\n {link.title}\n </a>\n </nano-nav-item>\n );\n })}\n <nano-nav-item class=\"nano-global-nav nano-global-nav-menu\">\n <a\n href={\n this.myAccData.urls.forgot_password +\n this.ssoRedirect\n }\n >\n Change Password\n </a>\n </nano-nav-item>\n </div>\n </div>\n </div>\n </nano-nav-item>\n </nav>\n )}\n\n <slot name=\"promotion\" />\n\n {this.myAccData && this.myAccData.urls.logout && (\n <div class=\"login-btn logout-btn\">\n <a href={this.myAccData.urls.logout + this.ssoRedirect}>\n Logout\n </a>\n </div>\n )}\n </div>\n </div>\n </nav>\n {/* END BURGER / OVERFLOW MENU */}\n\n {/* START MAIN NAV BAR */}\n <nano-sticker\n auto-resize=\"false\"\n break-point-max=\"800\"\n quietMode={{ h: 600, w: 800 }}\n >\n <div class=\"bars\" ref={(div) => (this.barsDiv = div)}>\n <nav\n class=\"main-bar\"\n aria-label=\"Main site navigation\"\n tabindex=\"-1\"\n ref={(div) => (this.mainBarDiv = div)}\n >\n {(this.hasPromotionSlot ||\n !!this.overflowSlotLen ||\n ((this.myAccData || !!this.iconSlotLen) &&\n this.threshold <\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.icon) ||\n (this.isLoggedIn &&\n (!!this.loggedInNavItms.length || this.hasLoggedinSlot) &&\n this.threshold <\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.login) ||\n (!!this.mainSlotLen &&\n this.threshold <\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.main) ||\n ((!!this.aboutSlotLen || !!this.aboutNavItms.length) &&\n this.threshold <\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.about) ||\n this.hasSiteSlot ||\n !!this.siteNavItms.length) && (\n <button\n class=\"menu-btn icon-btn\"\n onMouseDown={this.menuOpen}\n onKeyDown={this.onMenuBtnKeyDown}\n aria-expanded={this.modalOpen ? 'true' : 'false'}\n aria-controls=\"global-nav-menu\"\n ref={(btn) => (this.menuBtn = btn)}\n >\n <nano-icon\n name=\"light/bars\"\n aria-label=\"open menu\"\n ></nano-icon>\n </button>\n )}\n\n {this.showLogo && (\n <a href={this.logoUrl} class=\"logo-link\">\n <img\n src={getAssetPath(`./assets/ont-logo.svg`)}\n alt=\"Oxford Nanopore Technologies Logo\"\n class=\"logo\"\n />\n </a>\n )}\n {!this.showLogo && (\n <div class=\"logo-link\">\n <slot name=\"logo\" />\n </div>\n )}\n\n <div class=\"nav-links nav-links--main\">\n <slot name=\"main\" />\n </div>\n\n {this.threshold >=\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.search && [\n this.showSearch && !!this.internalSearchIndeces.length && (\n <div\n class=\"search-widget\"\n role=\"combobox\"\n aria-owns=\"autocomplete-results\"\n aria-expanded={\n this.showAutocomplete && this.autocompleteResults\n ? 'true'\n : 'false'\n }\n >\n {searchWidget}\n </div>\n ),\n (!this.showSearch || !this.myAccData) &&\n !!this.searchSlotLen && <slot name=\"search\" />,\n ]}\n\n {/* Bar Icon buttons */}\n\n {/* Bar search icon button (when not enough to show search in bar) */}\n {this.threshold <\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.search &&\n ((this.showSearch && !!this.internalSearchIndeces.length) ||\n !!this.searchSlotLen) && (\n <button\n class={{\n 'icon-btn': true,\n 'search-btn': true,\n 'search-btn--open': this.searchBarShown,\n }}\n aria-controls=\"global-nav-search-bar\"\n aria-expanded={this.searchBarShown ? 'true' : 'false'}\n onMouseDown={this.onSearchBtnClick}\n onKeyDown={this.onSearchBtnKeyDown}\n >\n <nano-icon name=\"light/search\"></nano-icon>\n </button>\n )}\n\n {/* Bar cart and notifications */}\n {this.threshold >=\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.icon && [\n !!this.iconSlotLen && <slot name=\"icon\" />,\n this.myAccData &&\n (!this.activeMyAccountSections ||\n this.activeMyAccountSections.includes('icons')) && [\n this.msgUrl && (\n <a href={this.msgUrl} class=\"icon-btn\">\n <nano-icon name=\"light/bell\"></nano-icon>\n {this.msgCount > 0 && (\n <span class=\"gn-menu_actions-counter\">\n {this.msgCount}\n </span>\n )}\n </a>\n ),\n this.cartUrl && !!this.cartCount && (\n <a href={this.cartUrl} class=\"icon-btn\">\n <nano-icon name=\"light/shopping-cart\"></nano-icon>\n {this.cartCount > 0 && (\n <span class=\"gn-menu_actions-counter\">\n {this.cartCount}\n </span>\n )}\n </a>\n ),\n ],\n ]}\n\n {/* Bar about links */}\n {(!!this.aboutSlotLen || !!this.aboutNavItms.length) &&\n this.threshold >=\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.about && (\n <nav\n class=\"nav-links nav-links--sub\"\n aria-label=\"About the company. Links\"\n >\n <slot name=\"about\" />\n <nano-nav-item class=\"nano-global-nav nano-global-nav-bar\">\n <a\n href={this.aboutNavItms[0].address}\n target={this.aboutNavItms[0].target}\n >\n {this.aboutNavItms[0].title}\n </a>\n </nano-nav-item>\n </nav>\n )}\n\n {/* Bar login button / User panel */}\n {this.myAccData &&\n (!this.activeMyAccountSections ||\n this.activeMyAccountSections.includes('loggedin')) &&\n this.threshold >=\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.login && [\n this.myAccData.urls.login && (\n <a\n href={this.myAccData.urls.login + this.ssoRedirect}\n class=\"login-btn\"\n >\n Login / Register\n </a>\n ),\n this.myAccountUser && (\n <div class=\"user-links\">\n <button\n class={{\n 'icon-btn': true,\n 'user-links-btn': true,\n open: this.userMenuOpen,\n }}\n onMouseDown={this.onUserBtnClick}\n onKeyDown={this.onUserBtnKeyDown}\n >\n {' '}\n {this.myAccountUser.name}\n <nano-icon name=\"solid/caret-down\"></nano-icon>\n </button>\n <div\n class=\"user-links-panel\"\n tabindex=\"-1\"\n ref={(div) => (this.userLinkPanel = div)}\n >\n {!!this.myAccountUser?.small_avatar_url && (\n <nano-global-nav-user-profile\n myAccountUser={this.myAccountUser}\n userProfileUrl={this.userProfileUrl}\n ></nano-global-nav-user-profile>\n )}\n <div class=\"user-links-panel-content\">\n {this.loggedInNavItms.map((link) => {\n return (\n <a href={link.address} target={link.target}>\n {link.title}\n </a>\n );\n })}\n </div>\n <div class=\"user-links-panel-foot\">\n <a\n href={\n this.myAccData.urls.forgot_password +\n this.ssoRedirect\n }\n >\n Change Password\n </a>\n <a\n href={\n this.myAccData.urls.logout + this.ssoRedirect\n }\n >\n Logout\n </a>\n </div>\n </div>\n </div>\n ),\n ]}\n <span class=\"measure-ele\"></span>\n </nav>\n\n {this.threshold <\n this.THRESHOLDLIMIT - THRESHOLDBREAKS.search && (\n <div\n id=\"global-nav-search-bar\"\n class={{\n 'search-bar': true,\n show: this.searchBarShown,\n }}\n aria-expanded={this.searchBarShown ? 'true' : 'false'}\n role=\"region\"\n tabindex=\"-1\"\n ref={(div) => (this.searchBarEl = div)}\n >\n <div class=\"search-widget\">\n {this.showSearch && !!this.internalSearchIndeces.length && (\n <div>{searchWidget}</div>\n )}\n {(!this.showSearch || !this.myAccData) &&\n !!this.searchSlotLen && <slot name=\"search\" />}\n </div>\n </div>\n )}\n </div>\n </nano-sticker>\n {/* END MAIN NAV BAR */}\n\n {(this.threshold < this.THRESHOLDLIMIT - 3 ||\n this.menuFullScreen) && (\n <div\n class={{\n mask: true,\n open: this.modalOpen,\n }}\n onClick={this.menuClose}\n onTouchEnd={this.menuClose}\n ></div>\n )}\n </div>\n <div class=\"site-content\" ref={(div) => (this.siteContent = div)}>\n <slot />\n </div>\n </Host>\n );\n }\n\n // Data processing\n\n private domainFor(origin: string): string {\n if (!this.myAccData) return '';\n const domain = this.myAccData.domains.find((dm) => dm.origin === origin);\n return domain ? domain.domain : '';\n }\n\n private processSearchResults(results: AlgoliaMultiResults | AlgoliaResults) {\n const multiResults = results as AlgoliaMultiResults;\n const singleResult = results as AlgoliaResults;\n\n if (multiResults.results) {\n multiResults.results.forEach((result, i) => {\n multiResults.results[i] = this.processSearchResults(\n result\n ) as AlgoliaResults;\n });\n return multiResults;\n } else {\n singleResult.hits.map((hit) => {\n if (hit.url && !hit.url.match(/^http/))\n hit.url =\n location.protocol + '//' + this.domainFor(hit.origin) + hit.url;\n });\n return singleResult;\n }\n }\n\n private processMyAccData() {\n if (!this.myAccData || !this.myAccData.search.indeces.length) return;\n\n if (this.myAccData.search.api_key)\n this.searchApiKey = this.myAccData.search.api_key;\n if (this.myAccData.search.app_id)\n this.searchAppId = this.myAccData.search.app_id;\n\n if (this.myAccData.cart.count) this.cartCount = this.myAccData.cart.count;\n if (this.myAccData.notifications.count)\n this.msgCount = this.myAccData.notifications.count;\n\n if (!this.searchAppId || !this.searchApiKey) return;\n this.internalSearchIndeces = [\n ...this.myAccData.search.indeces,\n ...this.searchIndeces,\n ];\n\n if (this.myAccData.urls.cart && !this.cartUrl)\n this.cartUrl = this.myAccData.urls.cart;\n if (this.myAccData.urls.messages && !this.msgUrl)\n this.msgUrl = this.myAccData.urls.messages;\n }\n\n private processMyAccLinks() {\n if (!this.myAccData.links || !this.myAccData.links.length) return;\n\n this.myAccData.links.forEach((link) => {\n switch (link.area) {\n case 'left-side-logged-in':\n case 'left-side-logged-out':\n if (\n this.activeMyAccountSections &&\n !this.activeMyAccountSections.includes('sites')\n )\n break;\n if (this.isLoggedIn && link.area === 'left-side-logged-in')\n this.siteNavItms.push(link);\n else if (!this.isLoggedIn && link.area === 'left-side-logged-out')\n this.siteNavItms.push(link);\n break;\n case 'right-side-logged-in':\n case 'right-side-logged-out':\n if (\n this.activeMyAccountSections &&\n !this.activeMyAccountSections.includes('about')\n )\n break;\n if (this.isLoggedIn && link.area === 'right-side-logged-in')\n this.aboutNavItms.push(link);\n else if (!this.isLoggedIn && link.area === 'right-side-logged-out')\n this.aboutNavItms.push(link);\n break;\n case 'profile-panel-list':\n if (\n this.activeMyAccountSections &&\n !this.activeMyAccountSections.includes('loggedin')\n )\n break;\n this.loggedInNavItms.push(link);\n break;\n }\n });\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Web Components for Nanopore digital Web Apps
3
+ */
4
+ import{r as t,c as n,h as i,a as e,g as a}from"./p-1fe12320.js";import{c as o}from"./p-845ae77e.js";import{c as r}from"./p-7b3638b7.js";import{d as s,a as l}from"./p-9746b0a5.js";import{F as c,a as p}from"./p-77cad8d1.js";const h='.sc-nano-input-h{box-sizing:border-box}*.sc-nano-input,*.sc-nano-input::before,*.sc-nano-input::after{box-sizing:border-box}[hidden].sc-nano-input{display:none !important}[disabled].sc-nano-input-h:not([disabled=false]){opacity:0.5}.form-ctrl.sc-nano-input{min-inline-size:100%;display:block}.form-ctrl.has-helper-end.sc-nano-input{display:-webkit-box;display:-ms-flexbox;display:flex;gap:1rem;opacity:0}.form-ctrl.has-helper-end.is-ready.sc-nano-input{opacity:1}.form-ctrl.has-helper-end.sc-nano-input .form-ctrl__wrapper.sc-nano-input{-webkit-box-flex:1;-ms-flex:1 1 100%;flex:1 1 100%}.form-ctrl.has-helper-end.sc-nano-input .form-ctrl__helper-end.sc-nano-input{display:none}.form-ctrl.has-helper-end.has-enough-width.sc-nano-input .form-ctrl__helper-end.sc-nano-input{display:block}.form-ctrl.has-helper-end.has-enough-width.sc-nano-input .form-ctrl__helper.sc-nano-input{display:none}.form-ctrl__wrapper.sc-nano-input{display:block}label.sc-nano-input,.form-ctrl__more.sc-nano-input,.form-ctrl__error.sc-nano-input,.form-ctrl__helper.sc-nano-input{display:block;inline-size:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}label.visually-hide.sc-nano-input,.form-ctrl__more.visually-hide.sc-nano-input,.form-ctrl__error.visually-hide.sc-nano-input,.form-ctrl__helper.visually-hide.sc-nano-input{clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);block-size:1px;inline-size:1px;margin:-1px;overflow:hidden;padding:0;position:absolute}.form-ctrl__float-label.sc-nano-input{padding-block:0;-webkit-padding-end:0;padding-inline-end:0;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);color:var(--label-color);position:absolute;font-size:1.15em;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transform-origin:top left;transform-origin:top left;inset-block-start:50%;-webkit-transition:all 0.125s ease-in;transition:all 0.125s ease-in;opacity:1}.has-focus.sc-nano-input-h .form-ctrl__float-label.sc-nano-input,.has-value.sc-nano-input-h .form-ctrl__float-label.sc-nano-input{-webkit-transform:translateY(-110%);transform:translateY(-110%);font-size:0.8em;opacity:0.7}.form-ctrl__float-label.sc-nano-input .form-ctrl__label-charcount.sc-nano-input{opacity:0;-webkit-transition:opacity 0.125s ease-in;transition:opacity 0.125s ease-in}.has-focus.sc-nano-input-h .form-ctrl__float-label.sc-nano-input .form-ctrl__label-charcount.sc-nano-input,.has-value.sc-nano-input-h .form-ctrl__float-label.sc-nano-input .form-ctrl__label-charcount.sc-nano-input{opacity:1}.form-ctrl__textarea.sc-nano-input .form-ctrl__float-label.sc-nano-input{inset-block-start:50%}.has-focus.sc-nano-input-h .form-ctrl__textarea.sc-nano-input .form-ctrl__float-label.sc-nano-input{inset-block-start:0;-webkit-transform:translateY(38%);transform:translateY(38%)}.has-value.sc-nano-input-h .form-ctrl__textarea.sc-nano-input .form-ctrl__float-label.sc-nano-input{inset-block-start:0;-webkit-transform:translateY(38%);transform:translateY(38%)}.form-ctrl__label.sc-nano-input{color:var(--label-color);font-size:var(--label-font-size);-webkit-padding-after:var(--padding-bottom);padding-block-end:var(--padding-bottom);line-height:1;display:-webkit-box;display:-ms-flexbox;display:flex}.form-ctrl__label.sc-nano-input .form-ctrl__label-wrap.sc-nano-input{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.form-ctrl__label.sc-nano-input .form-ctrl__label-placeholder.sc-nano-input{margin-block:unset;-webkit-margin-end:5px;margin-inline-end:5px;-webkit-margin-start:0;margin-inline-start:0;opacity:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-transition:0.3s ease opacity;transition:0.3s ease opacity;font-size:0.9em}.form-ctrl__label.sc-nano-input .form-ctrl__label-charcount.sc-nano-input{margin-block:unset;-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-start:auto;margin-inline-start:auto;font-size:0.9em;opacity:0.5}.has-value.sc-nano-input-h .form-ctrl__label.sc-nano-input .form-ctrl__label-placeholder.sc-nano-input{opacity:0.5}.has-focus.sc-nano-input-h .form-ctrl__label.sc-nano-input{color:var(--label-color--focus)}.is-invalid.sc-nano-input-h .form-ctrl__label.sc-nano-input{color:var(--label-color--invalid)}.has-float-label.sc-nano-input .select__multi-input.sc-nano-input,.has-float-label.sc-nano-input .select__native-input.sc-nano-input,.has-float-label.sc-nano-input .input__native-ctrl.sc-nano-input{opacity:0;-webkit-transition:opacity 0.125s ease-in;transition:opacity 0.125s ease-in}.has-focus.sc-nano-input-h .has-float-label.sc-nano-input .select__multi-input.sc-nano-input,.has-value.sc-nano-input-h .has-float-label.sc-nano-input .select__multi-input.sc-nano-input,.has-focus.sc-nano-input-h .has-float-label.sc-nano-input .select__native-input.sc-nano-input,.has-value.sc-nano-input-h .has-float-label.sc-nano-input .select__native-input.sc-nano-input,.has-focus.sc-nano-input-h .has-float-label.sc-nano-input .input__native-ctrl.sc-nano-input,.has-value.sc-nano-input-h .has-float-label.sc-nano-input .input__native-ctrl.sc-nano-input{opacity:1}.form-ctrl__more.sc-nano-input{block-size:1em;position:relative;margin-block:4px var(--padding-bottom);margin-inline:3px 0}.form-ctrl__helper.sc-nano-input,.form-ctrl__error.sc-nano-input{inset-block-start:0;inset-inline-start:0;position:absolute;font-size:var(--invalid-msg-font-size);line-height:1.2;-webkit-transition:0.3s ease-out opacity;transition:0.3s ease-out opacity}.form-ctrl__helper.sc-nano-input{font-style:italic;color:var(--help-msg-color)}[show-inline-error].sc-nano-input-h:not([show-inline-error=false]).is-invalid .form-ctrl__helper.sc-nano-input{opacity:0}.form-ctrl__helper-end.sc-nano-input{-webkit-box-flex:1;-ms-flex:1 1 30%;flex:1 1 30%;min-inline-size:150px;font-size:var(--invalid-msg-font-size);color:var(--help-msg-color);font-style:italic}.form-ctrl__error.sc-nano-input{opacity:0;color:var(--invalid-msg-color);font-stretch:condensed}.is-invalid.sc-nano-input-h .form-ctrl__error.sc-nano-input{opacity:1}.form-ctrl__input.sc-nano-input{font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--input-border-radius);inline-size:100%;padding:0 !important;position:relative;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;display:-webkit-box;display:-ms-flexbox;display:flex;background:var(--input-bg-color);border:var(--input-border-style);border-width:var(--input-border-width);font-size:var(--input-font-size);-webkit-padding-start:calc(var(--input-border-hint-width) - var(--input-border-width)) !important;padding-inline-start:calc(var(--input-border-hint-width) - var(--input-border-width)) !important}.has-focus.sc-nano-input-h .form-ctrl__input.sc-nano-input{background:var(--input-bg-color--focus);border:var(--input-border-style--focus);border-width:var(--input-border-width);-webkit-padding-start:calc(var(--input-border-hint-width) - var(--input-border-width)) !important;padding-inline-start:calc(var(--input-border-hint-width) - var(--input-border-width)) !important}.is-invalid.sc-nano-input-h .form-ctrl__input.sc-nano-input{background:var(--input-bg-color--invalid);border:var(--input-border-style--invalid);border-width:var(--input-border-width);-webkit-border-start:var(--input-border-style--invalid-focus) var(--input-border-hint-width);border-inline-start:var(--input-border-style--invalid-focus) var(--input-border-hint-width);-webkit-padding-start:0 !important;padding-inline-start:0 !important}.is-invalid.has-focus.sc-nano-input-h .form-ctrl__input.sc-nano-input{background:var(--input-bg-color--invalid);border:var(--input-border-style--invalid-focus);border-width:var(--input-border-width);-webkit-border-start:var(--input-border-style--invalid-focus) var(--input-border-hint-width);border-inline-start:var(--input-border-style--invalid-focus) var(--input-border-hint-width);-webkit-padding-start:0 !important;padding-inline-start:0 !important}.form-ctrl__input-wrap.sc-nano-input{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-flex:1;-ms-flex:1;flex:1;max-inline-size:100%}.form-ctrl__clear-btn.sc-nano-input,.form-ctrl__slot-end.sc-nano-input,.form-ctrl__slot-start.sc-nano-input,.form-ctrl__slot-value-end.sc-nano-input{--nano-icon-size:1.4em;margin-block:0;margin-inline:0;font-size:1em;border:0;outline:none;background-color:transparent;background-repeat:no-repeat;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;inline-size:auto}.has-float-label.sc-nano-input .form-ctrl__slot-start.sc-nano-input{display:none}.form-ctrl__slot-start.sc-nano-input-s>*,.form-ctrl__slot-start .sc-nano-input-s>*,.form-ctrl__slot-end.sc-nano-input-s>*,.form-ctrl__slot-end .sc-nano-input-s>*,.form-ctrl__slot-value-end.sc-nano-input-s>*,.form-ctrl__slot-value-end .sc-nano-input-s>*,.form-ctrl__slot-value-end.sc-nano-input *.sc-nano-input{--nano-icon-size:1.4em;padding-inline:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);font-size:1em;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;block-size:100%;z-index:1}.sc-nano-input-h[disabled]:not([disabled=false]) .form-ctrl__slot-start.sc-nano-input-s>*,.sc-nano-input-h[disabled]:not([disabled=false]) .form-ctrl__slot-start .sc-nano-input-s>*,.sc-nano-input-h[disabled]:not([disabled=false]) .form-ctrl__slot-end.sc-nano-input-s>*,.sc-nano-input-h[disabled]:not([disabled=false]) .form-ctrl__slot-end .sc-nano-input-s>*,.sc-nano-input-h[disabled]:not([disabled=false]) .form-ctrl__slot-value-end.sc-nano-input-s>*,.sc-nano-input-h[disabled]:not([disabled=false]) .form-ctrl__slot-value-end .sc-nano-input-s>*,[disabled].sc-nano-input-h:not([disabled=false]) .form-ctrl__slot-value-end.sc-nano-input *.sc-nano-input{pointer-events:none}.form-ctrl__slot-value-end.sc-nano-input-s>*,.form-ctrl__slot-value-end .sc-nano-input-s>*,.form-ctrl__slot-value-end.sc-nano-input *.sc-nano-input{pointer-events:none}.form-ctrl__clear-btn.sc-nano-input{color:var(--clear-btn-color);padding:0;opacity:0;inline-size:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:hidden}.is-invalid.sc-nano-input-h .form-ctrl__clear-btn.sc-nano-input{color:var(--clear-btn-color--invalid)}.has-value.sc-nano-input-h .form-ctrl__clear-btn.sc-nano-input{padding-block:0;padding-inline:var(--padding-start) var(--padding-end);opacity:1;inline-size:auto}.form-ctrl__clear-btn.sc-nano-input:hover{color:var(--clear-btn-color--hover)}.sc-nano-input-h{--placeholder-color:var(--nano-input-placeholder-color, initial);--placeholder-font-style:var(--nano-input-placeholder-style, initial);--placeholder-font-weight:var(--nano-input-placeholder-weight, initial);--placeholder-opacity:var(--nano-input-placeholder-opacity, 0.5);--padding-top:var(--nano-input-padding-top, var(--nano-input-padding, 8px));--padding-end:var(--nano-input-padding-end, var(--nano-input-padding, 8px));--padding-bottom:var(--nano-input-padding-bottom, var(--nano-input-padding, 6px));--padding-start:var(--nano-input-padding-start, var(--nano-input-padding, 8px));--color-invalid:var(--nano-color-danger-rgb, 239, 65, 53);--color--focus-rgb:var(\n --nano-color-base-rgb,\n var(--nano-color-primary-rgb, 0, 116, 149)\n );--input-font-size:var(--nano-input-font-size, 0.87em);--input-text-color:var(--nano-input-text-color, #4a4a4a);--input-border-width:var(--nano-input-border-width, 1px);--input-border-hint-width:3px;--input-border-color:var(--nano-input-border-color, #e4e6e8);--input-border-radius:var(--nano-input-border-radius, 0);--input-border-style:var(--nano-input-border-style, solid) var(--nano-input-border-color, #e4e6e8);--input-border-style--focus:var(--nano-input-border-style, solid) var(--nano-input-border-color--focus, #90c6e7);--input-border-style--invalid:var(--nano-input-border-style, solid) var(--nano-input-border-color--invalid, #e4e6e8);--input-border-style--invalid-focus:var(--nano-input-border-style, solid) var(--nano-input-border-color--invalid, #ef4135);--input-bg-color:var(--nano-input-background-color, #fff);--input-bg-color--focus:var(--input-bg-color);--input-bg-color--invalid:var(--nano-input-background-color, white);--invalid-msg-color:rgba(var(--color-invalid), 1);--invalid-msg-font-size:var(--nano-input-help-font-size, 0.75em);--help-msg-color:var(--nano-input-help-color, #616d6e);--clear-btn-color:var(--nano-clear-btn-color, rgba(0, 0, 0, 0.3));--clear-btn-color--hover:rgba(var(--color--focus-rgb), 1);--clear-btn-color--invalid:rgba(var(--color-invalid), 1);--label-color:var(--nano-input-label-color, "currentColor");--label-color--focus:var(--label-color);--label-color--invalid:var(--nano-input-label-color-invalid, "currentColor");--label-font-size:var(--nano-input-label-color, 1em);--multi-input-value-bg:var(--nano-input-tag-bg, 186, 220, 240);--multi-input-value-text-color:var(--nano-input-tag-color, #455556);--multi-input-value-border:var(--nano-input-tag-color, #badcf0);position:relative;inline-size:100%;padding:0 !important;color:currentColor;display:block}.nano-color.sc-nano-input-h{color:var(--nano-color-base);--input-border-style--focus:var(--nano-input-border-style, solid) var(--nano-color-tint, var(--nano-color-primary-tint, #2689a5))}.input__native-ctrl.sc-nano-input{font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-block:0;padding-inline:var(--padding-start) var(--padding-end);border-radius:var(--input-border-radius);text-overflow:ellipsis;color:var(--input-text-color);display:inline-block;-webkit-box-flex:1;-ms-flex:1;flex:1;inline-size:100%;max-inline-size:100%;max-block-size:100%;border:0;outline:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;resize:none;overflow:hidden;line-height:2.5em}.has-float-label.sc-nano-input .input__native-ctrl.sc-nano-input{line-height:2.1em;min-height:2.1em;-webkit-padding-before:1.4em;padding-block-start:1.4em}.input__native-ctrl.sc-nano-input::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity);line-height:inherit;min-height:initial}.input__native-ctrl.sc-nano-input::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity);line-height:inherit;min-height:initial}.input__native-ctrl.sc-nano-input:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity);line-height:inherit;min-height:initial}.input__native-ctrl.sc-nano-input::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity);line-height:inherit;min-height:initial}.input__native-ctrl.sc-nano-input::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity);line-height:inherit;min-height:initial}.input__native-ctrl.sc-nano-input::-moz-placeholder{line-height:2.8em;text-overflow:ellipsis}.input__native-ctrl.sc-nano-input:-webkit-autofill{background-color:transparent}.input__native-ctrl.sc-nano-input::-webkit-search-decoration,.input__native-ctrl.sc-nano-input::-webkit-search-cancel-button,.input__native-ctrl.sc-nano-input::-webkit-search-results-button,.input__native-ctrl.sc-nano-input::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}.input__native-ctrl.sc-nano-input:invalid{-webkit-box-shadow:none;box-shadow:none}.input__native-ctrl.sc-nano-input::-ms-clear,.input__native-ctrl.sc-nano-input::-ms-reveal{display:none}.input__native-ctrl.input__resizable.sc-nano-input{resize:vertical;overflow:auto}.form-ctrl__textarea.sc-nano-input .input__native-ctrl.sc-nano-input{line-height:1.5em;padding-block:var(--padding-top) 0.25em;white-space:pre-wrap}.form-ctrl__textarea.sc-nano-input .input__native-ctrl.sc-nano-input::-webkit-input-placeholder{line-height:1.5em}.form-ctrl__textarea.sc-nano-input .input__native-ctrl.sc-nano-input::-moz-placeholder{line-height:1.5em}.form-ctrl__textarea.sc-nano-input .input__native-ctrl.sc-nano-input:-ms-input-placeholder{line-height:1.5em}.form-ctrl__textarea.sc-nano-input .input__native-ctrl.sc-nano-input::-ms-input-placeholder{line-height:1.5em}.form-ctrl__textarea.sc-nano-input .input__native-ctrl.sc-nano-input::placeholder{line-height:1.5em}.has-float-label.sc-nano-input .form-ctrl__textarea.sc-nano-input .input__native-ctrl.sc-nano-input{-webkit-padding-before:1.75em;padding-block-start:1.75em}[readonly].sc-nano-input-h:not([readonly=false]) .input__native-ctrl.sc-nano-input{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}';let d=0;const u=class{constructor(i){t(this,i);this.nanoInput=n(this,"nanoInput",7);this.nanoChange=n(this,"nanoChange",7);this.nanoBlur=n(this,"nanoBlur",7);this.nanoFocus=n(this,"nanoFocus",7);this.nanoDidLoad=n(this,"nanoDidLoad",7);this.nanoDidUnload=n(this,"nanoDidUnload",7);this.nanoValidate=n(this,"nanoValidate",7);this.inputId=`nano-input-${d++}`;this.didBlurAfterEdit=false;this.rtl=false;this.charCount=0;this.hasRendered=false;this.validate=t=>{if(this.validateOn==="submitThenDirty")this.validateOn="dirty";if(!this.nativeInput.validity.valid){if(this.showInlineError){if(t)t.preventDefault();this.errorMessage=this.nativeInput.validationMessage}this._invalid=true}else this._invalid=false;this.nanoValidate.emit({isValid:!this._invalid,errorMessage:this.nativeInput.validationMessage,originalEvent:t})};this.onInput=t=>{const n=t.target;this.value=n?.value||"";this.nanoInput.emit(t)};this.onBlur=()=>{this.hasFocus=false;this.focusChanged();if(this.validateOn==="dirty")this.validate();this.nanoBlur.emit()};this.onFocus=()=>{this.hasFocus=true;this.focusChanged();this.nanoFocus.emit()};this.onKeydown=()=>{if(this.shouldClearOnEdit()){if(this.didBlurAfterEdit&&this.hasValue()){this.clearTextInput()}this.didBlurAfterEdit=false}};this.clearTextInput=t=>{if(this.clearInput&&!this.readonly&&!this.disabled&&t){t.preventDefault();t.stopPropagation()}this.value="";this.nativeInput.value="";const n=new window.Event("change");this.nativeInput.dispatchEvent(n)};this.hasFocus=false;this.hasLabelSlot=false;this.hasHelperSlot=false;this.hasHelperEndSlot=false;this.errorMessage="";this.datalist=null;this._invalid=false;this.color=undefined;this.accept=undefined;this.autocapitalise="none";this.autocomplete="off";this.autocorrect="off";this.autofocus=false;this.clearInput=false;this.clearOnEdit=undefined;this.debounce=0;this.disabled=false;this.inputmode=undefined;this.validateOn="submitThenDirty";this.showInlineError=true;this.label=undefined;this.hideLabel=false;this.floatLabel=false;this.max=undefined;this.maxlength=undefined;this.min=undefined;this.minlength=undefined;this.multiple=undefined;this.name=this.inputId;this.pattern=undefined;this.placeholder=undefined;this.readonly=false;this.required=false;this.spellcheck=false;this.step=undefined;this.size=undefined;this.type="text";this.form=undefined;this.value="";this.resize="auto";this.rows=2;this.showCharCount=false;this.validate=s(this.validate,50);this.handleBlur=this.handleBlur.bind(this)}get nativeInputWrap(){return this._nativeInputWrap}set nativeInputWrap(t){if(this._nativeInputWrap===t)return;this._nativeInputWrap=t;this.setDataListOpts()}setDataListOpts(){if(!this.datalist)return;const t=this.datalist.dropDownConfig||{};this.datalist.dropDownConfig={...t,skidding:-1,tetherTo:this.nativeInputWrap}}get invalid(){return this._invalid}get validityMessage(){if(!this.nativeInput)return"";return this.nativeInput.validationMessage}shouldValidate(){if(!this.hasRendered)return;requestAnimationFrame((()=>{if(this.validateOn==="dirty")this.validate()}))}valueChanged(){this.nanoChange.emit({value:this.value});this.charCount=this.value.length;if(this.type==="textarea"&&this.resize==="auto"){this.nativeInput.style.height="auto";if(this.value.length)this.nativeInput.style.height=this.nativeInput.scrollHeight+"px"}requestAnimationFrame((()=>{if(this.validateOn==="dirty")this.validate()}))}debounceChanged(){this.nanoChange=l(this.nanoChange,this.debounce)}async reportValidity(t){return new Promise((n=>{if(t)this.validate();setTimeout((()=>{n({isValid:!this._invalid,errorMessage:this.nativeInput.validationMessage})}),50)}))}async setFocus(){if(this.nativeInput){this.nativeInput.focus();this.nativeInput.click()}}async select(){if(this.nativeInput){this.nativeInput.select()}}getInputElement(){return Promise.resolve(this.nativeInput)}async showError(t){if(this.nativeInput){this.nativeInput.setCustomValidity(t);this.validate()}}onReset(t){const n=this.form?document.querySelector("#"+this.form):this.el.closest("form");if(!n||t.target!==this.el.closest("form"))return;this.value=""}handleBlur(t){if(!this.hasFocus)return;const n=t;let i;requestAnimationFrame((()=>{if(t instanceof KeyboardEvent&&n.key){if(n.key!=="Tab")return;i=document.activeElement}else if(t instanceof FocusEvent){i=document.activeElement}else i=t.target;if(o(this.el.tagName.toLowerCase(),i)!==this.el){this.onBlur()}}))}shouldClearOnEdit(){const{type:t,clearOnEdit:n}=this;return n===undefined?t==="password":n}getValue(){return this.value||""}focusChanged(){if(!this.hasFocus&&this.shouldClearOnEdit()&&this.hasValue()){this.didBlurAfterEdit=true}}hasValue(){return this.getValue().length>0}slotChangeObserver(){if(this.mo)this.mo.disconnect();const t=this.mo=new MutationObserver((()=>this.processSlottedContent()));t.observe(this.el,{childList:true,subtree:true})}processSlottedContent(){this.hasLabelSlot=!!this.el.querySelectorAll('[slot="label"]');this.hasHelperSlot=!!this.el.querySelector('[slot="helper"]');this.hasHelperEndSlot=!!this.el.querySelector('[slot="helper-end"]');this.datalist=this.el.querySelector("nano-datalist:not([slot])");if(!!this.el.querySelector('[slot="inline-button"]')){console.warn("The `inline-button` slot was renamed to `end` in v2 - please update your code",this.el)}}connectedCallback(){this.debounceChanged();{this.el.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.el}))}}disconnectedCallback(){{document.dispatchEvent(new CustomEvent("nanoDidUnload",{detail:this.el}))}if(this.mo)this.mo.disconnect()}componentDidLoad(){this.slotChangeObserver();this.hasRendered=true;if(this.autofocus)setTimeout((t=>this.setFocus()),300)}componentWillLoad(){this.processSlottedContent()}render(){const t=this.getValue();const n=this.inputId+"-lbl";const a=this.showInlineError||this.hasHelperSlot?this.inputId+"-more":"";const o=this.hasHelperEndSlot?this.inputId+"-helper":"";this.rtl=this.el.ownerDocument.dir==="rtl";const s=(({el:t,floatLabel:n,label:i,errorMessage:e,type:a,showInlineError:o,hasHelperSlot:r,hasLabelSlot:s,hideLabel:l,placeholder:c,maxlength:p,charCount:h,showCharCount:d,rtl:u,hasHelperEndSlot:f})=>({el:t,floatLabel:n,label:i,errorMessage:e,type:a,showInlineError:o,hasHelperSlot:r,hasLabelSlot:s,hideLabel:l,placeholder:c,maxlength:p,charCount:h,showCharCount:d,rtl:u,hasHelperEndSlot:f}))(this);const l={...s,labelId:n,moreId:a,helperEndId:o,hasValue:this.hasValue(),controlId:this.inputId};const h=(({clearInput:t,readonly:n,disabled:i})=>({clearInput:t,readonly:n,disabled:i,clearControl:this.clearInput}))(this);return i(e,{"aria-disabled":this.disabled?"true":null,dir:this.rtl?"rtl":null,class:{...r(this.color),"has-value":this.hasValue(),"has-focus":this.hasFocus,"is-invalid":this._invalid}},i(c,{...l},i(p,{...h,onClearText:this.clearTextInput,control:this.el,ref:t=>this.nativeInputWrap=t},this.type!=="textarea"&&i("input",{id:this.inputId,class:"input__native-ctrl",ref:t=>this.nativeInput=t,"aria-labelledby":n+" "+a+" "+o,disabled:this.disabled,accept:this.accept,autoCapitalize:this.autocapitalise,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,autoFocus:this.autofocus,inputMode:this.inputmode,form:this.form,min:this.min,max:this.max,minLength:this.minlength,maxLength:this.maxlength,multiple:this.multiple,name:this.name,pattern:this.pattern,placeholder:this.placeholder,readOnly:this.readonly,required:this.required,spellcheck:this.spellcheck,step:this.step,size:this.size,type:this.type,value:t,onInput:this.onInput,onChange:this.onInput,onFocus:this.onFocus,onBlur:this.handleBlur,onKeyDown:this.onKeydown,onInvalid:this.validate}),this.type==="textarea"&&i("textarea",{rows:this.floatLabel?1:this.rows,id:this.inputId,class:{"input__native-ctrl":true,input__resizable:this.resize==="true"},ref:t=>this.nativeInput=t,"aria-labelledby":n+" "+a+" "+o,disabled:this.disabled,autoCapitalize:this.autocapitalise,autoCorrect:this.autocorrect,autoFocus:this.autofocus,inputMode:this.inputmode,form:this.form,minLength:this.minlength,maxLength:this.maxlength,name:this.name,placeholder:this.placeholder,readOnly:this.readonly,required:this.required,spellcheck:this.spellcheck,value:t,onInput:this.onInput,onChange:this.onInput,onFocus:this.onFocus,onKeyDown:this.onKeydown,onInvalid:this.validate,onBlur:this.handleBlur})),i("slot",null)))}get el(){return a(this)}static get watchers(){return{datalist:["setDataListOpts"],minlength:["shouldValidate"],maxlength:["shouldValidate"],min:["shouldValidate"],max:["shouldValidate"],required:["shouldValidate"],disabled:["shouldValidate"],readonly:["shouldValidate"],pattern:["shouldValidate"],inputmode:["shouldValidate"],value:["valueChanged"],debounce:["debounceChanged"]}}};u.style=h;export{u as nano_input};
5
+ //# sourceMappingURL=p-28b43ee9.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/input/input.scss?tag=nano-input&encapsulation=scoped","src/components/input/input.tsx"],"names":["inputCss","inputIds","Input","[object Object]","hostRef","this","inputId","didBlurAfterEdit","rtl","charCount","hasRendered","validate","ev","validateOn","nativeInput","validity","valid","showInlineError","preventDefault","errorMessage","validationMessage","_invalid","nanoValidate","emit","isValid","originalEvent","onInput","input","target","value","nanoInput","onBlur","hasFocus","focusChanged","nanoBlur","onFocus","nanoFocus","onKeydown","shouldClearOnEdit","hasValue","clearTextInput","clearInput","readonly","disabled","stopPropagation","event","window","Event","dispatchEvent","debounce","handleBlur","bind","nativeInputWrap","_nativeInputWrap","ele","setDataListOpts","datalist","currDWConfig","dropDownConfig","skidding","tetherTo","invalid","validityMessage","requestAnimationFrame","nanoChange","length","type","resize","style","height","scrollHeight","debounceEvent","validateFirst","Promise","resolve","setTimeout","focus","click","select","message","setCustomValidity","e","form","document","querySelector","el","closest","kev","KeyboardEvent","key","activeElement","FocusEvent","closestElement","tagName","toLowerCase","clearOnEdit","undefined","getValue","mo","disconnect","MutationObserver","processSlottedContent","observe","childList","subtree","hasLabelSlot","querySelectorAll","hasHelperSlot","hasHelperEndSlot","console","warn","debounceChanged","CustomEvent","detail","slotChangeObserver","autofocus","_","setFocus","labelId","moreId","helperEndId","ownerDocument","dir","compWrapOptions","floatLabel","label","hideLabel","placeholder","maxlength","showCharCount","wrapOptions","controlId","controlOptions","clearControl","h","Host","aria-disabled","class","createColorClasses","color","has-value","has-focus","is-invalid","FormControlWrap","FormControl","onClearText","control","ref","id","aria-labelledby","accept","autoCapitalize","autocapitalise","autoComplete","autocomplete","autoCorrect","autocorrect","autoFocus","inputMode","inputmode","min","max","minLength","minlength","maxLength","multiple","name","pattern","readOnly","required","spellcheck","step","size","onChange","onKeyDown","onInvalid","rows","input__native-ctrl","input__resizable"],"mappings":";;;8NAAA,MAAMA,EAAW,8wiBC4BjB,IAAIC,EAAW,QAqBFC,EAAK,MAqBhBC,YAAAC,kSAnBQC,KAAAC,QAAU,cAAcL,MACxBI,KAAAE,iBAAmB,MACnBF,KAAAG,IAAe,MAEfH,KAAAI,UAAY,EACZJ,KAAAK,YAAc,MAyadL,KAAAM,SAAYC,IAClB,GAAIP,KAAKQ,aAAe,kBAAmBR,KAA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import '../../global/style/nano-theme/form';\n@import '../form-control/form-control';\n@import '../form-control/form-control-vars';\n\n:host {\n @include formControlVars;\n\n position: relative;\n inline-size: 100%;\n padding: 0 !important;\n color: currentColor;\n display: block;\n}\n\n:host(.nano-color) {\n color: current-color(base);\n\n --input-border-style--focus: #{$input-border-style} var(--nano-color-tint, #{nano-color(primary, tint)});\n}\n\n.input__native-ctrl {\n @include text-inherit();\n\n padding-block: 0;\n padding-inline: var(--padding-start) var(--padding-end);\n border-radius: var(--input-border-radius);\n text-overflow: ellipsis;\n color: var(--input-text-color);\n display: inline-block;\n flex: 1;\n inline-size: 100%;\n max-inline-size: 100%;\n max-block-size: 100%;\n border: 0;\n outline: none;\n background: transparent;\n appearance: none;\n margin: 0;\n box-sizing: border-box;\n resize: none;\n overflow: hidden;\n line-height: 2.5em;\n // min-height: 2.5em;\n\n .has-float-label & {\n line-height: 2.1em;\n min-height: 2.1em;\n padding-block-start: 1.4em;\n }\n\n &::placeholder {\n color: var(--placeholder-color);\n font-family: inherit;\n font-style: var(--placeholder-font-style);\n font-weight: var(--placeholder-font-weight);\n opacity: var(--placeholder-opacity);\n line-height: inherit;\n min-height: initial;\n }\n\n &::-moz-placeholder {\n line-height: 2.8em;\n text-overflow: ellipsis;\n }\n\n &:-webkit-autofill {\n background-color: transparent;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:invalid {\n box-shadow: none;\n }\n\n &::-ms-clear,\n &::-ms-reveal {\n display: none;\n }\n\n &.input__resizable {\n resize: vertical;\n overflow: auto;\n }\n\n .form-ctrl__textarea & {\n line-height: 1.5em;\n padding-block: var(--padding-top) 0.25em;\n white-space: pre-wrap;\n\n &::placeholder {\n line-height: 1.5em;\n }\n\n .has-float-label & {\n padding-block-start: 1.75em;\n }\n }\n\n :host([readonly]:not([readonly='false'])) & {\n user-select: none;\n }\n}\n","import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n Listen,\n} from '@stencil/core';\n\nimport { closestElement } from '../../utils/dom';\nimport { createColorClasses } from '../../utils/theme';\nimport { debounceEvent, debounce } from '../../utils/throttle';\nimport { FormControl, FormControlWrap } from '../form-control/form-control';\nimport type {\n Color,\n ControlValidity,\n ControlValidityEventDetail,\n InputChangeEventDetail,\n TextFieldTypes,\n} from '../../interface';\n\nlet inputIds = 0;\n\n/**\n * The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input), but works great on desktop devices and integrates with the keyboard on mobile devices.\n\nIt is meant for text type inputs only, such as \"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", and \"url\". It supports all standard text input events including keyup, keydown, keypress, and more.\nThe default styling reference comes from the [ONT styleguide](https://nanoporetech.zeroheight.com/styleguide/s/31282/p/230c74-text-input--textarea/b/942ee4)\n * @slot start - suitable for inline action buttons or icons that may add extra contextual information\n * @slot end - suitable for inline action buttons or icons that may add extra contextual information\n * @slot value-start - similar to 'start', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot value-end - similar to 'end', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot label - if you do not set a label attribute, you can use this slot for more complex markup\n * @slot helper - helper text to accompany the form field underneath.\n * @slot helper-end - helper text to accompany the form field on the side.\n * @slot - can be used with a `nano-datalist`. See the `nano-datalist` docs for more information\n */\n@Component({\n tag: 'nano-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement | HTMLTextAreaElement;\n private inputId = `nano-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private rtl: boolean = false;\n private mo?: MutationObserver;\n private charCount = 0;\n private hasRendered = false;\n\n // we don't want these rendered eles decorated with @State\n // because that will cause re-renders. User get/set to set datalist options\n private _nativeInputWrap: HTMLElement;\n private get nativeInputWrap() {\n return this._nativeInputWrap;\n }\n private set nativeInputWrap(ele: HTMLElement) {\n if (this._nativeInputWrap === ele) return;\n this._nativeInputWrap = ele;\n this.setDataListOpts();\n }\n\n constructor() {\n this.validate = debounce(this.validate, 50);\n this.handleBlur = this.handleBlur.bind(this);\n }\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasHelperSlot = false;\n @State() hasHelperEndSlot = false;\n @State() errorMessage: string = '';\n @State() datalist: HTMLNanoDatalistElement = null;\n\n @Watch('datalist')\n setDataListOpts() {\n if (!this.datalist) return;\n const currDWConfig = this.datalist.dropDownConfig || {};\n this.datalist.dropDownConfig = {\n ...currDWConfig,\n skidding: -1,\n tetherTo: this.nativeInputWrap,\n };\n }\n\n @Element() el!: HTMLNanoInputElement;\n\n /**\n * This will be true when the control is in an invalid state.\n * Validity is determined by the `required` prop. Or if custom validity message is set. @readonly\n */\n @Prop({ reflect: true })\n get invalid() {\n return this._invalid;\n }\n @State() _invalid = false;\n\n /**\n * Current validation message - if any. @readonly\n */\n @Prop()\n get validityMessage() {\n if (!this.nativeInput) return '';\n return this.nativeInput.validationMessage;\n }\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalise: 'none' | 'sentences' | 'words' | 'characters' =\n 'none';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: 'on' | 'off' = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n\n /**\n * When should the field perform validation\n */\n @Prop({ mutable: true }) validateOn: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submitThenDirty';\n\n /**\n * Whether to show validation errors underneath input\n */\n @Prop({ reflect: true }) showInlineError = true;\n\n /**\n * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label!: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop({ reflect: true }) type: TextFieldTypes = 'text';\n\n /**\n * The form element to associate the input with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = '';\n\n /**\n * relevant to type=\"textarea\". Vertical resizing - enable / disable or make automatic.\n */\n @Prop() resize: 'true' | 'false' | 'auto' = 'auto';\n\n /**\n * relevant to type=\"textarea\". Default number of rows to show\n */\n @Prop() rows = 2;\n\n /**\n * relevant to type=\"textarea\".\n */\n @Prop() showCharCount = false;\n\n @Watch('minlength')\n @Watch('maxlength')\n @Watch('min')\n @Watch('max')\n @Watch('required')\n @Watch('disabled')\n @Watch('readonly')\n @Watch('pattern')\n @Watch('inputmode')\n protected shouldValidate() {\n if (!this.hasRendered) return;\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.nanoChange.emit({ value: this.value });\n this.charCount = this.value.length;\n\n if (this.type === 'textarea' && this.resize === 'auto') {\n this.nativeInput.style.height = 'auto';\n if (this.value.length)\n this.nativeInput.style.height = this.nativeInput.scrollHeight + 'px';\n }\n\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.nanoChange = debounceEvent(this.nanoChange, this.debounce);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() nanoInput!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() nanoChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() nanoBlur!: EventEmitter<void>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() nanoFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been created.\n * @internal\n */\n @Event() nanoDidLoad!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been removed.\n * @internal\n */\n @Event() nanoDidUnload!: EventEmitter<void>;\n\n /**\n * Called when validation is performed (which depends on `validateOn`).\n * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`.\n */\n @Event() nanoValidate: EventEmitter<ControlValidityEventDetail>;\n\n /**\n * Get the current state of the control.\n * @param validateFirst - perform validation first before reporting\n * @returns `{ isValid: boolean, errorMessage: string }`\n */\n @Method()\n async reportValidity(validateFirst: boolean): Promise<ControlValidity> {\n return new Promise((resolve) => {\n if (validateFirst) this.validate();\n setTimeout(() => {\n resolve({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n });\n }, 50);\n });\n }\n\n /**\n * Sets focus on the specified `nano-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n this.nativeInput.click();\n }\n }\n\n /**\n * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global\n * `input.select()`.\n */\n @Method()\n async select() {\n if (this.nativeInput) {\n this.nativeInput.select();\n }\n }\n\n /**\n * @returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement | HTMLTextAreaElement> {\n return Promise.resolve(this.nativeInput);\n }\n\n /**\n * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string.\n */\n @Method()\n async showError(message: string) {\n if (this.nativeInput) {\n this.nativeInput.setCustomValidity(message);\n this.validate();\n }\n }\n\n @Listen('reset', { target: 'body' })\n onReset(e) {\n const form = this.form\n ? document.querySelector('#' + this.form)\n : this.el.closest('form');\n if (!form || e.target !== this.el.closest('form')) return;\n\n this.value = '';\n }\n\n @Listen('mousedown', { target: 'body' })\n @Listen('keydown')\n handleBlur(e: KeyboardEvent | MouseEvent | FocusEvent) {\n if (!this.hasFocus) return;\n\n const kev = e as KeyboardEvent;\n let target: Element;\n\n requestAnimationFrame(() => {\n if (e instanceof KeyboardEvent && kev.key) {\n if (kev.key !== 'Tab') return;\n target = document.activeElement;\n } else if (e instanceof FocusEvent) {\n target = document.activeElement;\n } else target = e.target as Element;\n\n if (closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {\n this.onBlur();\n }\n });\n }\n\n private shouldClearOnEdit() {\n const { type, clearOnEdit } = this;\n return clearOnEdit === undefined ? type === 'password' : clearOnEdit;\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private validate = (ev?: Event) => {\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n\n if (!this.nativeInput.validity.valid) {\n if (this.showInlineError) {\n if (ev) ev.preventDefault();\n this.errorMessage = this.nativeInput.validationMessage;\n }\n this._invalid = true;\n } else this._invalid = false;\n\n this.nanoValidate.emit({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n originalEvent: ev,\n });\n };\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n this.value = input?.value || '';\n this.nanoInput.emit(ev);\n };\n\n private onBlur = () => {\n this.hasFocus = false;\n this.focusChanged();\n if (this.validateOn === 'dirty') this.validate();\n this.nanoBlur.emit();\n };\n\n private onFocus = () => {\n this.hasFocus = true;\n this.focusChanged();\n this.nanoFocus.emit();\n };\n\n private onKeydown = () => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n if (this.didBlurAfterEdit && this.hasValue()) {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n };\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n this.value = '';\n this.nativeInput.value = '';\n const event = new window.Event('change');\n this.nativeInput.dispatchEvent(event);\n };\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private slotChangeObserver() {\n if (!Build.isBrowser) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.el, { childList: true, subtree: true });\n }\n\n private processSlottedContent() {\n // see if we have label / button content\n this.hasLabelSlot = !!this.el.querySelectorAll('[slot=\"label\"]');\n this.hasHelperSlot = !!this.el.querySelector('[slot=\"helper\"]');\n this.hasHelperEndSlot = !!this.el.querySelector('[slot=\"helper-end\"]');\n this.datalist = this.el.querySelector('nano-datalist:not([slot])');\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"inline-button\"]')) {\n console.warn(\n 'The `inline-button` slot was renamed to `end` in v2 - please update your code',\n this.el\n );\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n this.el.dispatchEvent(\n new CustomEvent('nanoDidLoad', {\n detail: this.el,\n })\n );\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(\n new CustomEvent('nanoDidUnload', {\n detail: this.el,\n })\n );\n }\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n this.hasRendered = true;\n if (this.autofocus) setTimeout((_) => this.setFocus(), 300);\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const moreId =\n this.showInlineError || this.hasHelperSlot ? this.inputId + '-more' : '';\n const helperEndId = this.hasHelperEndSlot ? this.inputId + '-helper' : '';\n this.rtl = (this.el.ownerDocument as Document).dir === 'rtl';\n\n const compWrapOptions = (({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }) => ({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }))(this);\n const wrapOptions = {\n ...compWrapOptions,\n labelId,\n moreId,\n helperEndId,\n hasValue: this.hasValue(),\n controlId: this.inputId,\n };\n\n const controlOptions = (({ clearInput, readonly, disabled }) => ({\n clearInput,\n readonly,\n disabled,\n clearControl: this.clearInput,\n }))(this);\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n dir={this.rtl ? 'rtl' : null}\n class={{\n ...createColorClasses(this.color),\n 'has-value': this.hasValue(),\n 'has-focus': this.hasFocus,\n 'is-invalid': this._invalid,\n }}\n >\n <FormControlWrap {...wrapOptions}>\n <FormControl\n {...controlOptions}\n onClearText={this.clearTextInput}\n control={this.el}\n ref={(el) => (this.nativeInputWrap = el)}\n >\n {this.type !== 'textarea' && (\n <input\n id={this.inputId}\n class=\"input__native-ctrl\"\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalise}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n />\n )}\n {this.type === 'textarea' && (\n <textarea\n rows={this.floatLabel ? 1 : this.rows}\n id={this.inputId}\n class={{\n 'input__native-ctrl': true,\n input__resizable: this.resize === 'true',\n }}\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalise}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n onBlur={this.handleBlur}\n ></textarea>\n )}\n </FormControl>\n <slot />\n </FormControlWrap>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["src/components/input/input.scss?tag=nano-input&encapsulation=scoped","src/components/input/input.tsx"],"names":["inputCss","inputIds","Input","[object Object]","hostRef","this","inputId","didBlurAfterEdit","rtl","charCount","hasRendered","validate","ev","validateOn","nativeInput","validity","valid","showInlineError","preventDefault","errorMessage","validationMessage","_invalid","nanoValidate","emit","isValid","originalEvent","onInput","input","target","value","nanoInput","onBlur","hasFocus","focusChanged","nanoBlur","onFocus","nanoFocus","onKeydown","shouldClearOnEdit","hasValue","clearTextInput","clearInput","readonly","disabled","stopPropagation","event","window","Event","dispatchEvent","debounce","handleBlur","bind","nativeInputWrap","_nativeInputWrap","ele","setDataListOpts","datalist","currDWConfig","dropDownConfig","skidding","tetherTo","invalid","validityMessage","requestAnimationFrame","nanoChange","length","type","resize","style","height","scrollHeight","debounceEvent","validateFirst","Promise","resolve","setTimeout","focus","click","select","message","setCustomValidity","e","form","document","querySelector","el","closest","kev","KeyboardEvent","key","activeElement","FocusEvent","closestElement","tagName","toLowerCase","clearOnEdit","undefined","getValue","mo","disconnect","MutationObserver","processSlottedContent","observe","childList","subtree","hasLabelSlot","querySelectorAll","hasHelperSlot","hasHelperEndSlot","console","warn","debounceChanged","CustomEvent","detail","slotChangeObserver","autofocus","_","setFocus","labelId","moreId","helperEndId","ownerDocument","dir","compWrapOptions","floatLabel","label","hideLabel","placeholder","maxlength","showCharCount","wrapOptions","controlId","controlOptions","clearControl","h","Host","aria-disabled","class","createColorClasses","color","has-value","has-focus","is-invalid","FormControlWrap","FormControl","onClearText","control","ref","id","aria-labelledby","accept","autoCapitalize","autocapitalise","autoComplete","autocomplete","autoCorrect","autocorrect","autoFocus","inputMode","inputmode","min","max","minLength","minlength","maxLength","multiple","name","pattern","readOnly","required","spellcheck","step","size","onChange","onKeyDown","onInvalid","rows","input__native-ctrl","input__resizable"],"mappings":";;;8NAAA,MAAMA,EAAW,wziBC4BjB,IAAIC,EAAW,QAqBFC,EAAK,MAqBhBC,YAAAC,kSAnBQC,KAAAC,QAAU,cAAcL,MACxBI,KAAAE,iBAAmB,MACnBF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AWzK,KAAKgC,UAChB0I,UAAW1K,KAAKM,SAChBoB,OAAQ1B,KAAK6C,cAInBoF,EAAA,OAAA","sourcesContent":["@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../form-control/form-control';\n@import '../form-control/form-control-vars';\n\n:host {\n @include formControlVars;\n\n position: relative;\n inline-size: 100%;\n padding: 0 !important;\n color: currentColor;\n display: block;\n}\n\n:host(.nano-color) {\n color: current-color(base);\n\n --input-border-style--focus: #{$input-border-style} var(--nano-color-tint, #{nano-color(primary, tint)});\n}\n\n.input__native-ctrl {\n @include text-inherit();\n\n padding-block: 0;\n padding-inline: var(--padding-start) var(--padding-end);\n border-radius: var(--input-border-radius);\n text-overflow: ellipsis;\n color: var(--input-text-color);\n display: inline-block;\n flex: 1;\n inline-size: 100%;\n max-inline-size: 100%;\n max-block-size: 100%;\n border: 0;\n outline: none;\n background: transparent;\n appearance: none;\n margin: 0;\n box-sizing: border-box;\n resize: none;\n overflow: hidden;\n line-height: 2.5em;\n // min-height: 2.5em;\n\n .has-float-label & {\n line-height: 2.1em;\n min-height: 2.1em;\n padding-block-start: 1.4em;\n }\n\n &::placeholder {\n color: var(--placeholder-color);\n font-family: inherit;\n font-style: var(--placeholder-font-style);\n font-weight: var(--placeholder-font-weight);\n opacity: var(--placeholder-opacity);\n line-height: inherit;\n min-height: initial;\n }\n\n &::-moz-placeholder {\n line-height: 2.8em;\n text-overflow: ellipsis;\n }\n\n &:-webkit-autofill {\n background-color: transparent;\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:invalid {\n box-shadow: none;\n }\n\n &::-ms-clear,\n &::-ms-reveal {\n display: none;\n }\n\n &.input__resizable {\n resize: vertical;\n overflow: auto;\n }\n\n .form-ctrl__textarea & {\n line-height: 1.5em;\n padding-block: var(--padding-top) 0.25em;\n white-space: pre-wrap;\n\n &::placeholder {\n line-height: 1.5em;\n }\n\n .has-float-label & {\n padding-block-start: 1.75em;\n }\n }\n\n :host([readonly]:not([readonly='false'])) & {\n user-select: none;\n }\n}\n","import {\n Build,\n Component,\n ComponentInterface,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n Listen,\n} from '@stencil/core';\n\nimport { closestElement } from '../../utils/dom';\nimport { createColorClasses } from '../../utils/theme';\nimport { debounceEvent, debounce } from '../../utils/throttle';\nimport { FormControl, FormControlWrap } from '../form-control/form-control';\nimport type {\n Color,\n ControlValidity,\n ControlValidityEventDetail,\n InputChangeEventDetail,\n TextFieldTypes,\n} from '../../interface';\n\nlet inputIds = 0;\n\n/**\n * The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML [input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input), but works great on desktop devices and integrates with the keyboard on mobile devices.\n\nIt is meant for text type inputs only, such as \"text\", \"password\", \"email\", \"number\", \"search\", \"tel\", and \"url\". It supports all standard text input events including keyup, keydown, keypress, and more.\nThe default styling reference comes from the [ONT styleguide](https://nanoporetech.zeroheight.com/styleguide/s/31282/p/230c74-text-input--textarea/b/942ee4)\n * @slot start - suitable for inline action buttons or icons that may add extra contextual information\n * @slot end - suitable for inline action buttons or icons that may add extra contextual information\n * @slot value-start - similar to 'start', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot value-end - similar to 'end', however clicking elements using this slot will activate the input control. This would be suitable to show a secodary 'value' for context or to show a dropdown arrow if using a datalist\n * @slot label - if you do not set a label attribute, you can use this slot for more complex markup\n * @slot helper - helper text to accompany the form field underneath.\n * @slot helper-end - helper text to accompany the form field on the side.\n * @slot - can be used with a `nano-datalist`. See the `nano-datalist` docs for more information\n */\n@Component({\n tag: 'nano-input',\n styleUrl: 'input.scss',\n scoped: true,\n})\nexport class Input implements ComponentInterface {\n private nativeInput?: HTMLInputElement | HTMLTextAreaElement;\n private inputId = `nano-input-${inputIds++}`;\n private didBlurAfterEdit = false;\n private rtl: boolean = false;\n private mo?: MutationObserver;\n private charCount = 0;\n private hasRendered = false;\n\n // we don't want these rendered eles decorated with @State\n // because that will cause re-renders. User get/set to set datalist options\n private _nativeInputWrap: HTMLElement;\n private get nativeInputWrap() {\n return this._nativeInputWrap;\n }\n private set nativeInputWrap(ele: HTMLElement) {\n if (this._nativeInputWrap === ele) return;\n this._nativeInputWrap = ele;\n this.setDataListOpts();\n }\n\n constructor() {\n this.validate = debounce(this.validate, 50);\n this.handleBlur = this.handleBlur.bind(this);\n }\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasHelperSlot = false;\n @State() hasHelperEndSlot = false;\n @State() errorMessage: string = '';\n @State() datalist: HTMLNanoDatalistElement = null;\n\n @Watch('datalist')\n setDataListOpts() {\n if (!this.datalist) return;\n const currDWConfig = this.datalist.dropDownConfig || {};\n this.datalist.dropDownConfig = {\n ...currDWConfig,\n skidding: -1,\n tetherTo: this.nativeInputWrap,\n };\n }\n\n @Element() el!: HTMLNanoInputElement;\n\n /**\n * This will be true when the control is in an invalid state.\n * Validity is determined by the `required` prop. Or if custom validity message is set. @readonly\n */\n @Prop({ reflect: true })\n get invalid() {\n return this._invalid;\n }\n @State() _invalid = false;\n\n /**\n * Current validation message - if any. @readonly\n */\n @Prop()\n get validityMessage() {\n if (!this.nativeInput) return '';\n return this.nativeInput.validationMessage;\n }\n\n /**\n * The color to use from the application's color palette.\n */\n @Prop() color?: Color;\n\n /**\n * If the value of the type attribute is `\"file\"`, then this attribute will indicate the types of files that the server accepts, otherwise it will be ignored. The value must be a comma-separated list of unique content type specifiers.\n */\n @Prop() accept?: string;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n */\n @Prop() autocapitalise: 'none' | 'sentences' | 'words' | 'characters' =\n 'none';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: 'on' | 'off' = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * This Boolean attribute lets you specify that a form control should have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * If `true`, a clear icon will appear in the input when there is a value. Clicking it clears the input.\n */\n @Prop() clearInput = false;\n\n /**\n * If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `\"password\"`, `false` for all other types.\n */\n @Prop() clearOnEdit?: boolean;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `nanoChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop({ reflect: true }) disabled = false;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode?:\n | 'none'\n | 'text'\n | 'tel'\n | 'url'\n | 'email'\n | 'numeric'\n | 'decimal'\n | 'search';\n\n /**\n * When should the field perform validation\n */\n @Prop({ mutable: true }) validateOn: 'dirty' | 'submit' | 'submitThenDirty' =\n 'submitThenDirty';\n\n /**\n * Whether to show validation errors underneath input\n */\n @Prop({ reflect: true }) showInlineError = true;\n\n /**\n * String to place within a label element. Alternatively you may use a label slot.\n */\n @Prop() label!: string;\n\n /**\n * Visually hide the label - but make it accessible.\n */\n @Prop() hideLabel?: boolean = false;\n\n /**\n * Enable floating label behaviour. Will disable placeholder if set.\n */\n @Prop() floatLabel: boolean = false;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"` or `\"file\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n */\n @Prop() placeholder?: string | null;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop({ reflect: true }) readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The initial size of the control. This value is in pixels unless the value of the type attribute is `\"text\"` or `\"password\"`, in which case it is an integer number of characters. This attribute applies only when the `type` attribute is set to `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, or `\"password\"`, otherwise it is ignored.\n */\n @Prop() size?: number;\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop({ reflect: true }) type: TextFieldTypes = 'text';\n\n /**\n * The form element to associate the input with (its form owner). Must be the id of a form.\n */\n @Prop() form?: string | null;\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value?: string | null = '';\n\n /**\n * relevant to type=\"textarea\". Vertical resizing - enable / disable or make automatic.\n */\n @Prop() resize: 'true' | 'false' | 'auto' = 'auto';\n\n /**\n * relevant to type=\"textarea\". Default number of rows to show\n */\n @Prop() rows = 2;\n\n /**\n * relevant to type=\"textarea\".\n */\n @Prop() showCharCount = false;\n\n @Watch('minlength')\n @Watch('maxlength')\n @Watch('min')\n @Watch('max')\n @Watch('required')\n @Watch('disabled')\n @Watch('readonly')\n @Watch('pattern')\n @Watch('inputmode')\n protected shouldValidate() {\n if (!this.hasRendered) return;\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.nanoChange.emit({ value: this.value });\n this.charCount = this.value.length;\n\n if (this.type === 'textarea' && this.resize === 'auto') {\n this.nativeInput.style.height = 'auto';\n if (this.value.length)\n this.nativeInput.style.height = this.nativeInput.scrollHeight + 'px';\n }\n\n requestAnimationFrame(() => {\n if (this.validateOn === 'dirty') this.validate();\n });\n }\n\n @Watch('debounce')\n protected debounceChanged() {\n this.nanoChange = debounceEvent(this.nanoChange, this.debounce);\n }\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() nanoInput!: EventEmitter<InputEvent>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() nanoChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() nanoBlur!: EventEmitter<void>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() nanoFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been created.\n * @internal\n */\n @Event() nanoDidLoad!: EventEmitter<void>;\n\n /**\n * Emitted when the input has been removed.\n * @internal\n */\n @Event() nanoDidUnload!: EventEmitter<void>;\n\n /**\n * Called when validation is performed (which depends on `validateOn`).\n * @returns event.detail: `{ isValid: boolean, errorMessage: string, originalEvent: Event }`.\n */\n @Event() nanoValidate: EventEmitter<ControlValidityEventDetail>;\n\n /**\n * Get the current state of the control.\n * @param validateFirst - perform validation first before reporting\n * @returns `{ isValid: boolean, errorMessage: string }`\n */\n @Method()\n async reportValidity(validateFirst: boolean): Promise<ControlValidity> {\n return new Promise((resolve) => {\n if (validateFirst) this.validate();\n setTimeout(() => {\n resolve({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n });\n }, 50);\n });\n }\n\n /**\n * Sets focus on the specified `nano-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if (this.nativeInput) {\n this.nativeInput.focus();\n this.nativeInput.click();\n }\n }\n\n /**\n * Sets focus and select the text on the specified `nano-input`. Use this method instead of the global\n * `input.select()`.\n */\n @Method()\n async select() {\n if (this.nativeInput) {\n this.nativeInput.select();\n }\n }\n\n /**\n * @returns the native `<input>` element used under the hood.\n */\n @Method()\n getInputElement(): Promise<HTMLInputElement | HTMLTextAreaElement> {\n return Promise.resolve(this.nativeInput);\n }\n\n /**\n * Invalidate the field and show a custom error message. To clear the error you will need to re-call this method with an empty string.\n */\n @Method()\n async showError(message: string) {\n if (this.nativeInput) {\n this.nativeInput.setCustomValidity(message);\n this.validate();\n }\n }\n\n @Listen('reset', { target: 'body' })\n onReset(e) {\n const form = this.form\n ? document.querySelector('#' + this.form)\n : this.el.closest('form');\n if (!form || e.target !== this.el.closest('form')) return;\n\n this.value = '';\n }\n\n @Listen('mousedown', { target: 'body' })\n @Listen('keydown')\n handleBlur(e: KeyboardEvent | MouseEvent | FocusEvent) {\n if (!this.hasFocus) return;\n\n const kev = e as KeyboardEvent;\n let target: Element;\n\n requestAnimationFrame(() => {\n if (e instanceof KeyboardEvent && kev.key) {\n if (kev.key !== 'Tab') return;\n target = document.activeElement;\n } else if (e instanceof FocusEvent) {\n target = document.activeElement;\n } else target = e.target as Element;\n\n if (closestElement(this.el.tagName.toLowerCase(), target) !== this.el) {\n this.onBlur();\n }\n });\n }\n\n private shouldClearOnEdit() {\n const { type, clearOnEdit } = this;\n return clearOnEdit === undefined ? type === 'password' : clearOnEdit;\n }\n\n private getValue(): string {\n return this.value || '';\n }\n\n private validate = (ev?: Event) => {\n if (this.validateOn === 'submitThenDirty') this.validateOn = 'dirty';\n\n if (!this.nativeInput.validity.valid) {\n if (this.showInlineError) {\n if (ev) ev.preventDefault();\n this.errorMessage = this.nativeInput.validationMessage;\n }\n this._invalid = true;\n } else this._invalid = false;\n\n this.nanoValidate.emit({\n isValid: !this._invalid,\n errorMessage: this.nativeInput.validationMessage,\n originalEvent: ev,\n });\n };\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n this.value = input?.value || '';\n this.nanoInput.emit(ev);\n };\n\n private onBlur = () => {\n this.hasFocus = false;\n this.focusChanged();\n if (this.validateOn === 'dirty') this.validate();\n this.nanoBlur.emit();\n };\n\n private onFocus = () => {\n this.hasFocus = true;\n this.focusChanged();\n this.nanoFocus.emit();\n };\n\n private onKeydown = () => {\n if (this.shouldClearOnEdit()) {\n // Did the input value change after it was blurred and edited?\n if (this.didBlurAfterEdit && this.hasValue()) {\n // Clear the input\n this.clearTextInput();\n }\n\n // Reset the flag\n this.didBlurAfterEdit = false;\n }\n };\n\n private clearTextInput = (ev?: Event) => {\n if (this.clearInput && !this.readonly && !this.disabled && ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n this.value = '';\n this.nativeInput.value = '';\n const event = new window.Event('change');\n this.nativeInput.dispatchEvent(event);\n };\n\n private focusChanged() {\n // If clearOnEdit is enabled and the input blurred but has a value, set a flag\n if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {\n this.didBlurAfterEdit = true;\n }\n }\n\n private hasValue(): boolean {\n return this.getValue().length > 0;\n }\n\n private slotChangeObserver() {\n if (!Build.isBrowser) return;\n\n if (this.mo) this.mo.disconnect();\n const mo = (this.mo = new MutationObserver(() =>\n this.processSlottedContent()\n ));\n mo.observe(this.el, { childList: true, subtree: true });\n }\n\n private processSlottedContent() {\n // see if we have label / button content\n this.hasLabelSlot = !!this.el.querySelectorAll('[slot=\"label\"]');\n this.hasHelperSlot = !!this.el.querySelector('[slot=\"helper\"]');\n this.hasHelperEndSlot = !!this.el.querySelector('[slot=\"helper-end\"]');\n this.datalist = this.el.querySelector('nano-datalist:not([slot])');\n\n // breaking change introduced in v2. Rm in v3\n if (!!this.el.querySelector('[slot=\"inline-button\"]')) {\n console.warn(\n 'The `inline-button` slot was renamed to `end` in v2 - please update your code',\n this.el\n );\n }\n }\n\n connectedCallback() {\n this.debounceChanged();\n if (Build.isBrowser) {\n this.el.dispatchEvent(\n new CustomEvent('nanoDidLoad', {\n detail: this.el,\n })\n );\n }\n }\n\n disconnectedCallback() {\n if (Build.isBrowser) {\n document.dispatchEvent(\n new CustomEvent('nanoDidUnload', {\n detail: this.el,\n })\n );\n }\n if (this.mo) this.mo.disconnect();\n }\n\n componentDidLoad() {\n this.slotChangeObserver();\n this.hasRendered = true;\n if (this.autofocus) setTimeout((_) => this.setFocus(), 300);\n }\n\n componentWillLoad() {\n this.processSlottedContent();\n }\n\n render() {\n const value = this.getValue();\n const labelId = this.inputId + '-lbl';\n const moreId =\n this.showInlineError || this.hasHelperSlot ? this.inputId + '-more' : '';\n const helperEndId = this.hasHelperEndSlot ? this.inputId + '-helper' : '';\n this.rtl = (this.el.ownerDocument as Document).dir === 'rtl';\n\n const compWrapOptions = (({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }) => ({\n el,\n floatLabel,\n label,\n errorMessage,\n type,\n showInlineError,\n hasHelperSlot,\n hasLabelSlot,\n hideLabel,\n placeholder,\n maxlength,\n charCount,\n showCharCount,\n rtl,\n hasHelperEndSlot,\n }))(this);\n const wrapOptions = {\n ...compWrapOptions,\n labelId,\n moreId,\n helperEndId,\n hasValue: this.hasValue(),\n controlId: this.inputId,\n };\n\n const controlOptions = (({ clearInput, readonly, disabled }) => ({\n clearInput,\n readonly,\n disabled,\n clearControl: this.clearInput,\n }))(this);\n\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n dir={this.rtl ? 'rtl' : null}\n class={{\n ...createColorClasses(this.color),\n 'has-value': this.hasValue(),\n 'has-focus': this.hasFocus,\n 'is-invalid': this._invalid,\n }}\n >\n <FormControlWrap {...wrapOptions}>\n <FormControl\n {...controlOptions}\n onClearText={this.clearTextInput}\n control={this.el}\n ref={(el) => (this.nativeInputWrap = el)}\n >\n {this.type !== 'textarea' && (\n <input\n id={this.inputId}\n class=\"input__native-ctrl\"\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n accept={this.accept}\n autoCapitalize={this.autocapitalise}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n step={this.step}\n size={this.size}\n type={this.type}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n />\n )}\n {this.type === 'textarea' && (\n <textarea\n rows={this.floatLabel ? 1 : this.rows}\n id={this.inputId}\n class={{\n 'input__native-ctrl': true,\n input__resizable: this.resize === 'true',\n }}\n ref={(input) => (this.nativeInput = input)}\n aria-labelledby={labelId + ' ' + moreId + ' ' + helperEndId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalise}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n inputMode={this.inputmode}\n form={this.form}\n minLength={this.minlength}\n maxLength={this.maxlength}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n value={value}\n onInput={this.onInput}\n onChange={this.onInput}\n onFocus={this.onFocus}\n onKeyDown={this.onKeydown}\n onInvalid={this.validate}\n onBlur={this.handleBlur}\n ></textarea>\n )}\n </FormControl>\n <slot />\n </FormControlWrap>\n </Host>\n );\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Web Components for Nanopore digital Web Apps
3
3
  */
4
- import{c as t}from"./p-49458cd9.js";import"./p-1fe12320.js";import"./p-ee045579.js";import"./p-9746b0a5.js";import"./p-651b3264.js";const o="table.worker";const p="stencil.table.worker";const s=new URL("p-1fd13775.js",import.meta.url).href;const r=new Blob(['importScripts("'+s+'")'],{type:"text/javascript"});const e=URL.createObjectURL(r);const c=t(e,o,p);URL.revokeObjectURL(e);export{c as worker,p as workerMsgId,o as workerName,s as workerPath};
5
- //# sourceMappingURL=p-b717f6d7.js.map
4
+ import{c as t}from"./p-b83a8320.js";import"./p-1fe12320.js";import"./p-ee045579.js";import"./p-9746b0a5.js";import"./p-651b3264.js";const o="table.worker";const p="stencil.table.worker";const s=new URL("p-1fd13775.js",import.meta.url).href;const r=new Blob(['importScripts("'+s+'")'],{type:"text/javascript"});const e=URL.createObjectURL(r);const c=t(e,o,p);URL.revokeObjectURL(e);export{c as worker,p as workerMsgId,o as workerName,s as workerPath};
5
+ //# sourceMappingURL=p-7ade1695.js.map
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Web Components for Nanopore digital Web Apps
3
+ */
4
+ import{r as i,w as t,h as e,a as n,g as o}from"./p-1fe12320.js";import{c as s}from"./p-845ae77e.js";const a=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--padding-top:13px;--padding-end:12px;--padding-bottom:13px;--padding-start:12px;--icon-size:19px;--font-size:11px;--global-nav-height:61px;--bg-color:#001a21;--bg-color-hover:rgba(28, 62, 72, 0.8);--bg-color-selected:#274048;--bg-color-focus:rgba(28, 62, 72, 0.8);--focus-outline:none;--content-color:#fff;--secondary-bg-color:rgb(28, 62, 72);font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;z-index:1;background:var(--bg-color)}:host ::slotted(nano-nav-item){--secondary-padding-top:var(--global-nav-height);--nano-icon-size:var(--icon-size);color:var(--content-color);font-size:var(--font-size);text-decoration:none;-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host(.hide){display:none}:host(.has-global-nav) .content-wrap{-webkit-padding-before:var(--global-nav-height);padding-block-start:var(--global-nav-height);-webkit-margin-before:calc(var(--global-nav-height) * -1);margin-block-start:calc(var(--global-nav-height) * -1)}.container{inset-inline-end:auto;-webkit-box-flex:0;-ms-flex:0 0 calc(var(--padding-end, 1em) * 2 + var(--icon-size));flex:0 0 calc(var(--padding-end, 1em) * 2 + var(--icon-size));background:var(--bg-color);color:var(--content-color);z-index:1;inline-size:calc(var(--padding-end, 1em) * 2 + var(--icon-size));block-size:100%}:host(.open) .container{inline-size:auto}:host(:not(.loading)) .container{-webkit-transition:inline-size 0.3s ease;transition:inline-size 0.3s ease}.content-wrap{inset-inline-start:0;inset-block-start:0;inline-size:inherit;max-inline-size:inherit;background:var(--bg-color);color:#fff;position:sticky;font-size:var(--icon-size);line-height:1;display:-webkit-box;display:-ms-flexbox;display:flex;min-block-size:calc(100vh - 61px);min-block-size:calc(var(--vh, 1vh) * 100 - 61px);z-index:1}.content{inline-size:auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;overflow:hidden;background:var(--bg-color);-webkit-box-flex:1;-ms-flex:1;flex:1}.content::after{content:"";position:absolute;inset-block-start:0;inset-inline:0;background:var(--bg-color);z-index:-1;block-size:100vh}.collapse-btn{background:var(--bg-color-selected);border:none;color:inherit;font-size:var(--icon-size);-webkit-margin-before:var(--padding-top);margin-block-start:var(--padding-top);-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-after:var(--padding-bottom);margin-block-end:var(--padding-bottom);-webkit-margin-start:calc(var(--padding-start) / 2);margin-inline-start:calc(var(--padding-start) / 2);border-radius:4px;padding-block:6px;padding-inline:5px;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-line-pack:center;align-content:center;inline-size:30px;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.collapse-btn nano-icon{font-size:var(--icon-size);-webkit-transition:0.2s -webkit-transform ease-in-out;transition:0.2s -webkit-transform ease-in-out;transition:0.2s transform ease-in-out;transition:0.2s transform ease-in-out, 0.2s -webkit-transform ease-in-out;-webkit-transform:translateZ(0) rotate(0deg);transform:translateZ(0) rotate(0deg)}:host(.open) .collapse-btn nano-icon{-webkit-transform:translateZ(0) rotate(180deg);transform:translateZ(0) rotate(180deg)}.foot{-webkit-margin-before:auto;margin-block-start:auto}.measure-ele{block-size:1px}';const r=class{constructor(t){i(this,t);this.children=[];this.currHeight=window.innerHeight;this.onWindowResize=()=>{if(window.innerWidth>this.hideWidth)this.widthOk=true;else this.widthOk=false;const i=window.innerHeight*.01;this.el.style.setProperty("--vh",`${i}px`);if(window.innerHeight>this.currHeight&&this.widthOk&&!this.heightOk){this.moveItemsToDrawer()}this.currHeight=window.innerHeight};this.toggle=i=>{i.preventDefault();this.open=!this.open};this.onToggleKeyDown=i=>{switch(i.key){case"Enter":case" ":this.open=!this.open;break}};this.reset=false;this.widthOk=true;this.heightOk=true;this.isLoading=true;this.hide=false;this.open=true;this.saveState=true;this.hideWidth=576;this.hideHeight=true}cancelNavItemEvents(i){if(!i.detail.secondaryMenu)return;i.stopPropagation()}openChange(){if(this.saveState)localStorage.setItem("nanoMenuDrawerOpen",this.open.toString());if(this.containerDiv){if(this.open)t((()=>this.containerDiv.style.width=this.contentDiv.scrollWidth+"px"));else t((()=>this.containerDiv.style.width=null))}}widthChange(){if(this.widthOk)this.moveItemsToDrawer();else this.moveItemsToGlobalNav()}hideHeightChange(){if(this.hideHeight&&!this.io)this.attachIO();else if(!this.hideHeight&&this.io){this.io.disconnect();this.io=undefined}}moveItemsToGlobalNav(){const i=this.el.querySelectorAll("nano-nav-item");i.forEach((i=>{this.children.push({slot:i.getAttribute("slot"),element:i});i.setAttribute("slot","overflow");i.classList.add("nano-global-nav-menu");this.globalNav.appendChild(i)}));this.hide=true}moveItemsToDrawer(){if(!this.children||!this.children.length)return;this.children.forEach((i=>{i.element.removeAttribute("slot");i.element.classList.remove("nano-global-nav-menu");if(i.slot&&i.slot.length)i.element.setAttribute("slot",i.slot);this.el.appendChild(i.element)}));this.children=[];this.hide=false;if(!this.io)this.attachIO()}attachIO(){if(!this.hideHeight)return;const i=this.io=new window.IntersectionObserver((i=>{this.heightOk=i[0].intersectionRatio!==0;if(!this.heightOk){this.moveItemsToGlobalNav();this.io.disconnect();this.io=undefined}}),{threshold:1});i.observe(this.measureEle)}handleGlobalNavReady(i){if(i.target.tagName!=="NANO-GLOBAL-NAV")return;setTimeout((()=>{this.attachIO();this.openChange();this.onWindowResize();this.isLoading=false}),500)}componentWillLoad(){this.globalNav=s("nano-global-nav",this.el);this.widthOk=window.innerWidth>this.hideWidth;this.currHeight=window.innerHeight;if(this.saveState){const i=localStorage.getItem("nanoMenuDrawerOpen");this.open=i?i==="true":this.open}}componentDidLoad(){{window.addEventListener("resize",this.onWindowResize)}}disconnectedCallback(){window.removeEventListener("resize",this.debounceResize);if(this.io){this.io.disconnect();this.io=null}}render(){return e(n,{class:{open:this.open,hide:this.hide,loading:this.isLoading,"has-global-nav":!!this.globalNav},dir:this.el.ownerDocument.dir==="rtl"?"rtl":null},e("div",{ref:i=>this.containerDiv=i,class:"container"},e("div",{class:"content-wrap"},e("nav",{ref:i=>this.contentDiv=i,class:"content"},e("button",{onMouseDown:this.toggle,onKeyDown:this.onToggleKeyDown,class:"collapse-btn"},e("nano-icon",{name:"light/arrow-alt-to-right","aria-label":"collapse / expand"})),e("slot",null),e("div",{class:"foot"},e("div",{class:"measure-ele",ref:i=>this.measureEle=i}),e("slot",{name:"foot"}))))))}get el(){return o(this)}static get watchers(){return{open:["openChange"],widthOk:["widthChange"],hideHeight:["hideHeightChange"]}}};r.style=a;export{r as nano_menu_drawer};
5
+ //# sourceMappingURL=p-8a52a411.entry.js.map