@nanoporetech-digital/components 8.3.2 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/constructible-style-BsHBb9au.js +133 -0
- package/dist/cjs/{fade-BzBFJiQK.js → fade-DBuNbJEw.js} +1 -1
- package/dist/cjs/{fullscreen-Cz3eYnOp.js → fullscreen-Bk4jXSN0.js} +1 -1
- package/dist/cjs/index-DGttnXif.js +28 -16
- package/dist/cjs/{lazyload-DIFYejbf.js → lazyload-gQqOMvpr.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-accordion.cjs.entry.js +28 -9
- package/dist/cjs/nano-avatar_5.cjs.entry.js +11 -11
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/{nano-data-table-DFEflpc4.js → nano-data-table-BHQIpW0N.js} +31 -1
- package/dist/cjs/nano-data-table.cjs.entry.js +1 -1
- package/dist/cjs/nano-details.cjs.entry.js +6 -4
- package/dist/cjs/nano-field-validator.cjs.entry.js +4 -2
- package/dist/cjs/nano-footer.cjs.entry.js +2 -2
- package/dist/cjs/nano-global-nav.cjs.entry.js +21 -20
- package/dist/cjs/nano-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/nano-grid_2.cjs.entry.js +6 -130
- package/dist/cjs/nano-hero.cjs.entry.js +4 -4
- package/dist/cjs/{nano-icon_3.cjs.entry.js → nano-icon-button_2.cjs.entry.js} +2 -320
- package/dist/cjs/nano-icon.cjs.entry.js +326 -0
- package/dist/cjs/nano-in-page-nav.cjs.entry.js +1 -1
- package/dist/cjs/nano-increment.cjs.entry.js +1 -1
- package/dist/cjs/nano-intersection-observe.cjs.entry.js +1 -1
- package/dist/cjs/nano-masked-overflow.cjs.entry.js +3 -3
- package/dist/cjs/nano-menu-drawer.cjs.entry.js +2 -2
- package/dist/cjs/nano-more-less.cjs.entry.js +2 -2
- package/dist/cjs/nano-rating.cjs.entry.js +4 -4
- package/dist/cjs/nano-resize-observe.cjs.entry.js +2 -2
- package/dist/cjs/nano-slide.cjs.entry.js +1 -1
- package/dist/cjs/{nano-slides-C576PTmo.js → nano-slides-C73bSG0h.js} +7 -7
- package/dist/cjs/nano-slides.cjs.entry.js +1 -1
- package/dist/cjs/nano-sortable.cjs.entry.js +1 -1
- package/dist/cjs/nano-step-accordion.cjs.entry.js +101 -0
- package/dist/cjs/nano-step-breadcrumb.cjs.entry.js +133 -0
- package/dist/cjs/nano-sticker.cjs.entry.js +2 -2
- package/dist/cjs/nano-tab-content.cjs.entry.js +2 -2
- package/dist/cjs/nano-tab.cjs.entry.js +2 -2
- package/dist/cjs/nano-table.cjs.entry.js +2 -2
- package/dist/cjs/{page-dots-Clb2QknR.js → page-dots-BLPta5z5.js} +1 -1
- package/dist/cjs/{table.worker-DxRLPmU9.js → table.worker-BeE8kdSf.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/accordion/accordion.js +51 -13
- package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/collection/components/data-table/table.js +1 -13
- package/dist/collection/components/details/details.js +9 -6
- package/dist/collection/components/field-validator/field-validator.js +4 -2
- package/dist/collection/components/footer/footer.css +7 -7
- package/dist/collection/components/footer/footer.js +2 -1
- package/dist/collection/components/global-nav/global-nav.js +22 -21
- package/dist/collection/components/global-search-results/global-search-results.js +4 -4
- package/dist/collection/components/grid/grid-item.js +1 -1
- package/dist/collection/components/grid/grid.js +1 -1
- package/dist/collection/components/hero/hero.js +4 -4
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/validate.js +1 -1
- package/dist/collection/components/img/img.js +3 -3
- package/dist/collection/components/in-page-nav/in-page-nav.js +1 -1
- package/dist/collection/components/increment/increment.js +1 -1
- package/dist/collection/components/intersection-observe/intersection-observe.js +1 -1
- package/dist/collection/components/masked-overflow/masked-overflow.js +3 -3
- package/dist/collection/components/menu-drawer/menu-drawer.js +2 -2
- package/dist/collection/components/more-less/more-less.js +2 -2
- package/dist/collection/components/rating/rating.js +4 -4
- package/dist/collection/components/resize-observe/resize-observe.js +2 -2
- package/dist/collection/components/select/select.js +7 -7
- package/dist/collection/components/slides/slide.js +1 -1
- package/dist/collection/components/slides/slides.js +3 -3
- package/dist/collection/components/sortable/sortable.js +1 -1
- package/dist/collection/components/step-accordion/step-accordion.css +138 -0
- package/dist/collection/components/step-accordion/step-accordion.js +190 -0
- package/dist/collection/components/step-breadcrumb/step-breadcrumb.css +231 -0
- package/dist/collection/components/step-breadcrumb/step-breadcrumb.js +222 -0
- package/dist/collection/components/sticker/sticker.js +2 -2
- package/dist/collection/components/table/table.js +2 -2
- package/dist/collection/components/tabs/tab-content.js +2 -2
- package/dist/collection/components/tabs/tab.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/utils/constructible-style.js +2 -2
- package/dist/collection/utils/performance.js +17 -0
- package/dist/components/accordion.js +80 -0
- package/dist/components/constructible-style.js +131 -0
- package/dist/components/details.js +6 -4
- package/dist/components/global-search-results.js +4 -4
- package/dist/components/grid.js +5 -129
- package/dist/components/icon.js +2 -2
- package/dist/components/img.js +3 -3
- package/dist/components/masked-overflow.js +3 -3
- package/dist/components/nano-accordion.js +1 -56
- package/dist/components/nano-data-table.js +30 -0
- package/dist/components/nano-field-validator.js +4 -2
- package/dist/components/nano-footer.js +2 -2
- package/dist/components/nano-global-nav.js +21 -20
- package/dist/components/nano-grid-item.js +1 -1
- package/dist/components/nano-hero.js +4 -4
- package/dist/components/nano-in-page-nav.js +1 -1
- package/dist/components/nano-increment.js +1 -1
- package/dist/components/nano-intersection-observe.js +1 -1
- package/dist/components/nano-menu-drawer.js +2 -2
- package/dist/components/nano-more-less.js +2 -2
- package/dist/components/nano-rating.js +4 -4
- package/dist/components/nano-slide.js +1 -1
- package/dist/components/nano-sortable.js +1 -1
- package/dist/components/nano-step-accordion.d.ts +11 -0
- package/dist/components/nano-step-accordion.js +141 -0
- package/dist/components/nano-step-breadcrumb.d.ts +11 -0
- package/dist/components/nano-step-breadcrumb.js +181 -0
- package/dist/components/nano-tab-content.js +2 -2
- package/dist/components/nano-tab.js +2 -2
- package/dist/components/nano-table.js +2 -2
- package/dist/components/resize-observe.js +2 -2
- package/dist/components/select.js +7 -7
- package/dist/components/slides.js +3 -3
- package/dist/components/sticker.js +2 -2
- package/dist/components/tooltip.js +2 -2
- package/dist/esm/constructible-style-B2_GfhhS.js +131 -0
- package/dist/esm/{fade-D4P3XGVa.js → fade-C0NluV0K.js} +1 -1
- package/dist/esm/{fullscreen-Cfl6LvH2.js → fullscreen-Ck_w6MCZ.js} +1 -1
- package/dist/esm/index-BM3Om9WE.js +28 -16
- package/dist/esm/{lazyload-CQYknGN2.js → lazyload-DddTyM-A.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-accordion.entry.js +28 -9
- package/dist/esm/nano-avatar_5.entry.js +11 -11
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/{nano-data-table-Bqk8ZUaL.js → nano-data-table-CWliPF7Y.js} +31 -1
- package/dist/esm/nano-data-table.entry.js +1 -1
- package/dist/esm/nano-details.entry.js +6 -4
- package/dist/esm/nano-field-validator.entry.js +4 -2
- package/dist/esm/nano-footer.entry.js +2 -2
- package/dist/esm/nano-global-nav.entry.js +21 -20
- package/dist/esm/nano-grid-item.entry.js +1 -1
- package/dist/esm/nano-grid_2.entry.js +7 -131
- package/dist/esm/nano-hero.entry.js +4 -4
- package/dist/esm/{nano-icon_3.entry.js → nano-icon-button_2.entry.js} +4 -321
- package/dist/esm/nano-icon.entry.js +324 -0
- package/dist/esm/nano-in-page-nav.entry.js +1 -1
- package/dist/esm/nano-increment.entry.js +1 -1
- package/dist/esm/nano-intersection-observe.entry.js +1 -1
- package/dist/esm/nano-masked-overflow.entry.js +3 -3
- package/dist/esm/nano-menu-drawer.entry.js +2 -2
- package/dist/esm/nano-more-less.entry.js +2 -2
- package/dist/esm/nano-rating.entry.js +4 -4
- package/dist/esm/nano-resize-observe.entry.js +2 -2
- package/dist/esm/nano-slide.entry.js +1 -1
- package/dist/esm/{nano-slides-DcJWApi6.js → nano-slides-BiPGpe5F.js} +7 -7
- package/dist/esm/nano-slides.entry.js +1 -1
- package/dist/esm/nano-sortable.entry.js +1 -1
- package/dist/esm/nano-step-accordion.entry.js +99 -0
- package/dist/esm/nano-step-breadcrumb.entry.js +131 -0
- package/dist/esm/nano-sticker.entry.js +2 -2
- package/dist/esm/nano-tab-content.entry.js +2 -2
- package/dist/esm/nano-tab.entry.js +2 -2
- package/dist/esm/nano-table.entry.js +2 -2
- package/dist/esm/{page-dots-kX7jiD3G.js → page-dots-WKehEjjM.js} +1 -1
- package/dist/esm/{table.worker-a52UkSRM.js → table.worker-DJks4i_l.js} +1 -1
- package/dist/nano-components/constructible-style-B2_GfhhS.js +4 -0
- package/dist/nano-components/{fade-D4P3XGVa.js → fade-C0NluV0K.js} +1 -1
- package/dist/nano-components/{fullscreen-Cfl6LvH2.js → fullscreen-Ck_w6MCZ.js} +1 -1
- package/dist/nano-components/{lazyload-CQYknGN2.js → lazyload-DddTyM-A.js} +1 -1
- package/dist/nano-components/nano-accordion.entry.js +1 -1
- package/dist/nano-components/nano-avatar_5.entry.js +1 -1
- package/dist/nano-components/nano-components.css +32 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-data-table-CWliPF7Y.js +4 -0
- package/dist/nano-components/nano-data-table.entry.js +1 -1
- package/dist/nano-components/nano-details.entry.js +1 -1
- package/dist/nano-components/nano-field-validator.entry.js +1 -1
- package/dist/nano-components/nano-footer.entry.js +1 -1
- package/dist/nano-components/nano-global-nav.entry.js +1 -1
- package/dist/nano-components/nano-grid-item.entry.js +1 -1
- package/dist/nano-components/nano-grid_2.entry.js +1 -1
- package/dist/nano-components/nano-hero.entry.js +1 -1
- package/dist/nano-components/nano-icon-button_2.entry.js +4 -0
- package/dist/nano-components/nano-icon.entry.js +4 -0
- package/dist/nano-components/nano-in-page-nav.entry.js +1 -1
- package/dist/nano-components/nano-increment.entry.js +1 -1
- package/dist/nano-components/nano-intersection-observe.entry.js +1 -1
- package/dist/nano-components/nano-masked-overflow.entry.js +1 -1
- package/dist/nano-components/nano-menu-drawer.entry.js +1 -1
- package/dist/nano-components/nano-more-less.entry.js +1 -1
- package/dist/nano-components/nano-rating.entry.js +1 -1
- package/dist/nano-components/nano-resize-observe.entry.js +1 -1
- package/dist/nano-components/nano-slide.entry.js +1 -1
- package/dist/nano-components/{nano-slides-DcJWApi6.js → nano-slides-BiPGpe5F.js} +3 -3
- package/dist/nano-components/nano-slides.entry.js +1 -1
- package/dist/nano-components/nano-sortable.entry.js +1 -1
- package/dist/nano-components/nano-step-accordion.entry.js +4 -0
- package/dist/nano-components/nano-step-breadcrumb.entry.js +4 -0
- package/dist/nano-components/nano-sticker.entry.js +1 -1
- package/dist/nano-components/nano-tab-content.entry.js +1 -1
- package/dist/nano-components/nano-tab.entry.js +1 -1
- package/dist/nano-components/nano-table.entry.js +1 -1
- package/dist/nano-components/{page-dots-kX7jiD3G.js → page-dots-WKehEjjM.js} +1 -1
- package/dist/nano-components/{table.worker-a52UkSRM.js → table.worker-DJks4i_l.js} +1 -1
- package/dist/stencil.config.js +1 -0
- package/dist/style/components.css +1 -1
- package/dist/style/components.css.map +1 -1
- package/dist/style/core.css +1 -1
- package/dist/style/core.css.map +1 -1
- package/dist/style/nano.css +1 -1
- package/dist/style/nano.css.map +1 -1
- package/dist/types/components/accordion/accordion.d.ts +10 -4
- package/dist/types/components/details/details.d.ts +3 -2
- package/dist/types/components/footer/footer.d.ts +1 -0
- package/dist/types/components/global-nav/global-nav.d.ts +1 -1
- package/dist/types/components/step-accordion/step-accordion.d.ts +38 -0
- package/dist/types/components/step-breadcrumb/step-breadcrumb.d.ts +37 -0
- package/dist/types/components.d.ts +174 -4
- package/dist/types/utils/performance.d.ts +1 -0
- package/docs-json.json +352 -18
- package/docs-vscode.json +41 -2
- package/hydrate/index.js +403 -98
- package/hydrate/index.mjs +403 -98
- package/package.json +2 -2
- package/dist/nano-components/nano-data-table-Bqk8ZUaL.js +0 -4
- package/dist/nano-components/nano-icon_3.entry.js +0 -4
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/generate-vue-component.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/index.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/output-vue.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/plugin.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/types.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/utils.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/stencil.config.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/stencil.config.prod.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/testing/mocks/intersection-observer.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → FKs_t1C_}/0/Digital/nano-components/packages/components/.stencil/wdio.conf.d.ts +0 -0
@@ -73,7 +73,7 @@ const GlobalNav = class {
|
|
73
73
|
});
|
74
74
|
}
|
75
75
|
/**
|
76
|
-
* MyAccount data automatically set via `myAccountUrl`.
|
76
|
+
* MyAccount data is automatically set via `myAccountUrl`.
|
77
77
|
* Alternatively you can directly provide a JSON object which is useful for SSR
|
78
78
|
* (ref https://myaccount.nanoporetech.com/nav_bar_data.json)
|
79
79
|
*/
|
@@ -484,33 +484,34 @@ const GlobalNav = class {
|
|
484
484
|
}
|
485
485
|
render() {
|
486
486
|
const bpps = this.bpPartials;
|
487
|
-
return (renderer.h(index.Host, { key: '
|
487
|
+
return (renderer.h(index.Host, { key: '52758e65d80b4738a7bce1b668ac43a1e573688b', class: {
|
488
488
|
'overflow-menu': this.breakpoint > bpps.mainMenu.breakpoint,
|
489
489
|
'bar-menu': this.breakpoint <= bpps.mainMenu.breakpoint,
|
490
490
|
'nano-global-nav': true,
|
491
|
-
} }, renderer.h("div", { key: '
|
491
|
+
} }, renderer.h("div", { key: 'b0f7b540dc867775e0ffc484fd00ea4bc76bade6', class: {
|
492
492
|
gn: true,
|
493
493
|
'gn__search-open': this.searchBarShown,
|
494
|
-
} }, renderer.h("nano-drawer", { key: '
|
494
|
+
} }, renderer.h("nano-drawer", { key: '8a5cd7bfe4411ced1d5152879f6f22e2414d66f4', ref: (el) => (this.overflowMenu = el), label: "Main menu", part: "drawer", class: "gn__drawer nano-theme-dark", placement: "start", open: this.overflowOpen, onNanoAfterHide: () => (this.overflowOpen = false), onNanoAfterShow: () => (this.overflowOpen = true) }, renderer.h("div", { key: '10b6ae8c625aded73f416bc07d1798c3089f2973', class: "gn__drawer-header", part: "overflow-header", slot: "label" }, "Main menu"), renderer.h("nav", { key: '9db43ebdd4c691a9cf011352f71de1351d62d84f', class: "gn__drawer-menu", part: "overflow-menu" }, this.breakpoint > bpps.mainMenu.breakpoint
|
495
495
|
? bpps.mainMenu.tpl()
|
496
|
-
: '', renderer.h("slot", { key: '
|
496
|
+
: '', renderer.h("slot", { key: '54adcdf273c023af6cb552d4655f422fe40bcc44', name: "overflow" }))), renderer.h("div", { key: '6dc61d4c46eaa60e8c10440c8d16321d44f64193', class: "gn__menu-bar-wrapper" }, renderer.h("div", { key: '46310206cead5a77fda999eca19b2eab45aef41e', class: "gn__menu-bar", part: "menu-bar", ref: (el) => (this.mainMenuBar = el) }, renderer.h("nav", { key: '066a2fc79c4c395f0938b4ac1eadc40bc6b7895a', class: `gn__main-menu ${this.shouldResize ? 'resizing' : ''}`, part: "main-menu", ref: (el) => (this.mainMenu = el) }, this.breakpoint > bpps.mainMenu.breakpoint && (renderer.h("nano-icon-button", { key: 'd5184e70f942f3aaa8d1bdfa9ac9068b3f5e1059', class: "gn__overflow-button", iconName: "light/bars", label: "Open Menu", onClick: () => this.overflowMenu.show() })), renderer.h("slot", { key: 'a8c584d2129fe400546c4795d124f855d091b771', name: "logo" }, renderer.h("a", { key: '2993131b2dbfa68bf0e7327e53d172eff99c5bb1', href: this.logoUrl, class: "gn__logo-link", part: "logo-link" }, this.breakpoint <= bpps.logo.breakpoint ? (renderer.h("img", { src: index.getAssetPath('../nano-assets/ont-logo.svg'), alt: `Oxford Nanopore Technologies logo. Features a stylised representation of a nanopore,
|
497
497
|
(a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.`, class: "gn__logo gn__logo--large", width: "152", height: "36", part: "logo logo--large" })) : (renderer.h("img", { src: index.getAssetPath('../nano-assets/ont-wheel.svg'), alt: `Oxford Nanopore Technologies logo. A stylised representation of a nanopore,
|
498
|
-
(a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.`, class: "gn__logo gn__logo--small", width: "36", height: "36", part: "logo logo--small" })))), this.breakpoint <= bpps.mainMenu.breakpoint && (renderer.h("div", { key: '
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
498
|
+
(a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.`, class: "gn__logo gn__logo--small", width: "36", height: "36", part: "logo logo--small" })))), this.breakpoint <= bpps.mainMenu.breakpoint && (renderer.h("div", { key: 'eb403b129ddba684ef45b547dcd86a5128c194fa', class: "gn__main-menu-links" }, bpps.mainMenu.tpl())), renderer.h("div", { key: '61296cf7760ca9b0bad1b39684cd26365a37c4e4', class: "gn__main-menu-actions" }, !this.myAccountData ||
|
499
|
+
(!!this.searchIndices.length && (renderer.h("nano-dropdown", { key: 'a2ffb43fb901e508ac465e875be785fb979fb285', dialogTitle: "Search Oxford Nanopore Technologies", placement: "bottom", class: "gn__search-dropdown", skidding: -30, distance: 25, open: this.searchBarShown, onNanoAfterShow: this.handleSearchOpenEvent, onNanoAfterHide: this.handleSearchCloseEvent, autoOpen: !!this.searchIndices.length }, renderer.h("nano-icon-button", { key: 'bdb7b2f8dfdb29644cfca77953043bbce65ba3c4', class: "gn__search-button", slot: "trigger", iconName: "light/magnifying-glass", label: "Search" }), renderer.h("form", { key: '60d01e9911bafbd7967c0c0194c05e3b55f39586', ref: (form) => (this.searchForm = form), class: "gn__search-form", part: "search-form", onSubmit: this.onSearchSubmit }, this.searchIndices.length > 1 && (renderer.h("nano-select", { key: '5633e3714947ecdb2e1f8bf7b9b829050358db4b', part: "search-select", label: "Which site do you wish to search in?", mask: true, hideLabel: true, value: this.activeIndex?.index, onNanoChange: this.handleSearchIndexChangeEvent }, this.searchIndices.map((index) => (renderer.h("nano-option", { selected: index.name === this.searchIndex, value: index.index }, index.name || index.index))))), renderer.h("nano-input", { key: 'e09a08fc9d014f55862ac909ea414db9d987de61', ref: (ele) => (this.searchInput = ele), part: "search-input", label: "Search Oxford Nanopore Technologies", placeholder: "Search Oxford Nanopore...", hideLabel: true, clearable: true, onNanoChange: (e) => {
|
500
|
+
this.handleSearchTermChangeEvent(e.detail.value);
|
501
|
+
}, onNanoInput: this.handleSearchTermInputEvent, debounce: 500, value: this._searchValue }, renderer.h("nano-icon", { key: '3d58fed7ebb3c74a2ed9df600c331119e2670425', slot: "end", name: "light/magnifying-glass" }), renderer.h("nano-datalist", { key: '78befd844999d78365d7b88ad7b03749166c1073', class: "gn__search-results", onNanoSelect: (e) => e.preventDefault(), dropDownConfig: { tetherTo: this.searchForm }, disableFilter: true }, this.searchLoading && (renderer.h("div", { key: '4fe00833301ab0553d8a42c7f8a89c2f7dcaa24d', slot: "no-result", class: "gn__search-loading" }, renderer.h("nano-spinner", { key: 'e5309556718d0db06c37a9f1286c8b7cc98a12f1' }, "Searching..."))), this.noResultPartial(), !!this.autocompleteResults?.hits.length && [
|
502
|
+
this.autocompleteResults.hits.map((hit, i) => (renderer.h("nano-option", { href: hit.url, class: "gn__search-result", onClick: () => {
|
503
|
+
searchInsights.searchInsight.sendClick({
|
504
|
+
index: this.activeIndex.index,
|
505
|
+
eventName: 'Global nav quick search - search result clicked',
|
506
|
+
queryID: this.autocompleteResults.queryID,
|
507
|
+
objectIDs: [hit.objectID],
|
508
|
+
positions: [i + 1],
|
509
|
+
});
|
510
|
+
} }, renderer.h("span", { innerHTML: this.autocompleteSnippet(hit) })))),
|
511
|
+
renderer.h("nano-option", { key: 'c134c900ffdd746b3d38bce27ed0d5e6dccbbcf3', class: "gn__search-viewall", onNanoSelect: this.onSearchSubmit }, "View all results"),
|
512
|
+
])))))), renderer.h("div", { key: '215282e792ec6f14e214ca1177d6a6b6de7ccc44', class: "gn__cart" }, renderer.h("nano-icon-button", { key: '9aa656cd4b12bc09ca8a5e1e727d30c63e60a302', iconName: "light/cart-shopping", label: "View your cart", href: this.cartUrl }), !!this.cartCount && (renderer.h("nano-badge", { key: '86bbe9468e5e9a7a7d9c3fb3b48c4ba4cdc46131', theme: "danger", strength: "2" }, this.cartCount > 9 ? '9+' : this.cartCount))), this.breakpoint <= bpps.contact.breakpoint
|
512
513
|
? bpps.contact.tpl()
|
513
|
-
: '', this.isLoggedIn ? (renderer.h("nano-dropdown", { dialogTitle: "User menu", class: "gn__user-dropdown", distance: 10, placement: "bottom-end" }, renderer.h("button", { slot: "trigger", class: "gn__user-dropdown-trigger" }, renderer.h("nano-icon", { name: "light/user" }), renderer.h("nano-icon", { name: "light/chevron-down", class: "gn__user-dropdown-chevron" }), !!this.msgCount && (renderer.h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount > 9 ? '9+' : this.msgCount))), this.loggedInPanel())) : (renderer.h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, renderer.h("a", { href: this.formatLoginLink(this.loginUrl) }, "Login"))))))), renderer.h("nano-global-search-results", { key: '
|
514
|
+
: '', this.isLoggedIn ? (renderer.h("nano-dropdown", { dialogTitle: "User menu", class: "gn__user-dropdown", distance: 10, placement: "bottom-end" }, renderer.h("button", { slot: "trigger", class: "gn__user-dropdown-trigger" }, renderer.h("nano-icon", { name: "light/user" }), renderer.h("nano-icon", { name: "light/chevron-down", class: "gn__user-dropdown-chevron" }), !!this.msgCount && (renderer.h("nano-badge", { theme: "danger", strength: "2" }, this.msgCount > 9 ? '9+' : this.msgCount))), this.loggedInPanel())) : (renderer.h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, renderer.h("a", { href: this.formatLoginLink(this.loginUrl) }, "Login"))))))), renderer.h("nano-global-search-results", { key: '1cacccf34009f330acebb1dc0fa492d1f3ed8dff', part: "site-search-results" }, renderer.h("div", { key: '7891bf3d5c5c3a8288583cbbc24a25f06949609e', class: "gn__site", part: "site-wrapper" }, renderer.h("slot", { key: '9998fe23791e35ca762f2f1bfb54617a1d0156de' }))))));
|
514
515
|
}
|
515
516
|
static get assetsDirs() { return ["assets"]; }
|
516
517
|
static get watchers() { return {
|
@@ -17,7 +17,7 @@ const GridItem = class {
|
|
17
17
|
* m-row-start-2
|
18
18
|
*/
|
19
19
|
render() {
|
20
|
-
return index.h("slot", { key: '
|
20
|
+
return index.h("slot", { key: '9a50a1034bd70b2d0c461f01acdb6b0484e492d3' });
|
21
21
|
}
|
22
22
|
};
|
23
23
|
GridItem.style = ":host { display: inline-block; }";
|
@@ -4,133 +4,9 @@
|
|
4
4
|
'use strict';
|
5
5
|
|
6
6
|
var index = require('./index-DGttnXif.js');
|
7
|
+
var constructibleStyle = require('./constructible-style-BsHBb9au.js');
|
7
8
|
var renderer = require('./renderer-B9M1kXq8.js');
|
8
9
|
|
9
|
-
// import type { VNode, HTMLStencilElement } from "@stencil/core";
|
10
|
-
const supportsConstructibleStylesheets = (() => {
|
11
|
-
try {
|
12
|
-
return !!new CSSStyleSheet();
|
13
|
-
}
|
14
|
-
catch (_e) {
|
15
|
-
return false;
|
16
|
-
}
|
17
|
-
})();
|
18
|
-
const cacheKeys = new WeakMap();
|
19
|
-
/**
|
20
|
-
* Dynamically create a constructible stylesheet which is applied to the component.
|
21
|
-
* The stylesheet is then cached for future instances of the component.
|
22
|
-
* @usage
|
23
|
-
As a string:
|
24
|
-
```
|
25
|
-
@ConstructableStyle() style = `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
|
26
|
-
```
|
27
|
-
As a function:
|
28
|
-
```
|
29
|
-
@ConstructableStyle() style = () => `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
|
30
|
-
```
|
31
|
-
* @param opts - optional `cacheKeyProperty` - in case an instance of a component could produce different styles based on variables.
|
32
|
-
* @returns `@ConstructableStyle` decorator
|
33
|
-
*/
|
34
|
-
function ConstructibleStyle(opts = {}) {
|
35
|
-
return (target, propertyKey) => {
|
36
|
-
if (!opts.cacheKeyProperty) {
|
37
|
-
opts.cacheKeyProperty = propertyKey;
|
38
|
-
}
|
39
|
-
const { componentWillLoad, render, componentWillRender } = target;
|
40
|
-
if (!componentWillLoad)
|
41
|
-
console.warn(`ConstructibleStyle requires you to have a \`componentWillLoad\` lifecycle method in \`${target.constructor.name}\`. Failure to add this function may cause ConstructibleStyle to fail due to StencilJS build optimizations.`);
|
42
|
-
if (supportsConstructibleStylesheets && true) {
|
43
|
-
const addStylesheet = (instance) => {
|
44
|
-
if (!instance[opts.cacheKeyProperty] ||
|
45
|
-
(cacheKeys.get(instance) &&
|
46
|
-
cacheKeys.get(instance) === instance[opts.cacheKeyProperty]))
|
47
|
-
return;
|
48
|
-
cacheKeys.set(instance, instance[opts.cacheKeyProperty]);
|
49
|
-
const host = index.getElement(instance);
|
50
|
-
const cssText = typeof instance[propertyKey] === 'function'
|
51
|
-
? instance[propertyKey]()
|
52
|
-
: instance[propertyKey];
|
53
|
-
const root = (host.shadowRoot || document);
|
54
|
-
root.adoptedStyleSheets = [
|
55
|
-
...(root.adoptedStyleSheets || []),
|
56
|
-
getOrCreateStylesheet(instance, target, cssText, opts),
|
57
|
-
];
|
58
|
-
};
|
59
|
-
target.componentWillLoad = function () {
|
60
|
-
const willLoadResult = componentWillLoad && componentWillLoad.call(this);
|
61
|
-
addStylesheet(this);
|
62
|
-
return willLoadResult;
|
63
|
-
};
|
64
|
-
target.componentWillRender = function () {
|
65
|
-
const willRenderResult = componentWillRender && componentWillRender.call(this);
|
66
|
-
addStylesheet(this);
|
67
|
-
return willRenderResult;
|
68
|
-
};
|
69
|
-
}
|
70
|
-
else {
|
71
|
-
target.render = function () {
|
72
|
-
const cssText = typeof this[propertyKey] === 'function'
|
73
|
-
? this[propertyKey]()
|
74
|
-
: this[propertyKey];
|
75
|
-
let renderedNode = render.call(this);
|
76
|
-
if (isHost(renderedNode)) {
|
77
|
-
appendStyleToHost(renderedNode, target.constructor.name, cssText);
|
78
|
-
}
|
79
|
-
else {
|
80
|
-
renderedNode = index.h(index.Host, null, renderedNode);
|
81
|
-
if (!('attachShadow' in HTMLElement.prototype)) {
|
82
|
-
appendStyleToHost(renderedNode, target.constructor.name, cssText);
|
83
|
-
}
|
84
|
-
else {
|
85
|
-
if (!target.__constructableStyle) {
|
86
|
-
const style = document.createElement('style');
|
87
|
-
style.setAttribute('type', 'text/css');
|
88
|
-
style.setAttribute('constructible-style', target.constructor.name);
|
89
|
-
style.innerHTML = cssText;
|
90
|
-
target.__constructableStyle = style;
|
91
|
-
document.head.appendChild(style);
|
92
|
-
}
|
93
|
-
}
|
94
|
-
}
|
95
|
-
return renderedNode;
|
96
|
-
};
|
97
|
-
}
|
98
|
-
};
|
99
|
-
}
|
100
|
-
function appendStyleToHost(node, targetName, cssText) {
|
101
|
-
(getHostChildren(node) || []).push(index.h("style", { type: "text/css", "constructible-style": targetName }, cssText));
|
102
|
-
}
|
103
|
-
function getOrCreateStylesheet(instance, target, cssText, opts) {
|
104
|
-
if (!target.__constructableStyle) {
|
105
|
-
target.__constructableStyle = {};
|
106
|
-
}
|
107
|
-
const key = instance[opts.cacheKeyProperty];
|
108
|
-
if (!target.__constructableStyle[key]) {
|
109
|
-
target.__constructableStyle[key] = new CSSStyleSheet();
|
110
|
-
target.__constructableStyle[key].replace(cssText);
|
111
|
-
}
|
112
|
-
return target.__constructableStyle[key];
|
113
|
-
}
|
114
|
-
function isHost(node) {
|
115
|
-
for (const prop in node) {
|
116
|
-
if (prop in node) {
|
117
|
-
if (node[prop] === index.Host) {
|
118
|
-
return true;
|
119
|
-
}
|
120
|
-
}
|
121
|
-
}
|
122
|
-
return false;
|
123
|
-
}
|
124
|
-
function getHostChildren(node) {
|
125
|
-
for (const prop in node) {
|
126
|
-
if (prop in node) {
|
127
|
-
if (Array.isArray(node[prop])) {
|
128
|
-
return node[prop];
|
129
|
-
}
|
130
|
-
}
|
131
|
-
}
|
132
|
-
}
|
133
|
-
|
134
10
|
const gridCss = ":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--grid-col-gap:var(--nano-spacing-md);--grid-row-gap:var(--nano-spacing-md);--grid-align-items:start;--grid-justify-items:normal;--current-grid-size:\"grid size: s\";container-type:inline-size;display:block}:host .grid{display:grid;gap:var(--grid-row-gap) var(--grid-col-gap);block-size:inherit;min-block-size:inherit;place-items:var(--grid-align-items) var(--grid-justify-items)}:host([show-helper]:not([show-helper=false])){position:relative}:host([show-helper]:not([show-helper=false])) .grid--helper{position:absolute;inset:0;pointer-events:none;display:grid !important;overflow:hidden}:host([show-helper]:not([show-helper=false])) .grid--helper::before{content:var(--current-grid-size);font-size:30px;position:absolute;inline-size:100%;inset-inline-start:0;text-align:center;inset-block-start:50%;transform:translateY(-50%);color:rgba(0, 0, 0, 0.2);text-transform:uppercase;z-index:99;pointer-events:none}:host([show-helper]:not([show-helper=false])) .grid__helper-item{background:hsla(204, 80%, 72%, 0.25);block-size:100vh;inline-size:100%}";
|
135
11
|
|
136
12
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
@@ -295,7 +171,7 @@ const Grid = class {
|
|
295
171
|
this.constructSizeArray();
|
296
172
|
}
|
297
173
|
render() {
|
298
|
-
return (renderer.h(index.Host, { key: '
|
174
|
+
return (renderer.h(index.Host, { key: '56ae0bda8aedac96841dd8cf308117ef1aaa9824', class: "nano-grid" }, renderer.h("div", { key: '6fffc201e4261b8f6c458bd044b31fe12cd9045e', part: "grid", class: "grid", "cache-key": this.cacheKey }, renderer.h("slot", { key: 'a6d7473ba9a8ffd21c4df95c2028e67026ffd1a5' })), this.showHelper && (renderer.h("div", { key: '275145f83283b504171fdc973741a1398cca6317', class: "grid grid--helper", part: "helper", "cache-key": this.cacheKey }, [...Array(24)].map(() => (renderer.h("div", { class: "grid__helper-item" })))))));
|
299
175
|
}
|
300
176
|
static get watchers() { return {
|
301
177
|
"sTpl": ["constructSizeArray"],
|
@@ -316,7 +192,7 @@ const Grid = class {
|
|
316
192
|
}; }
|
317
193
|
};
|
318
194
|
__decorate([
|
319
|
-
ConstructibleStyle({ cacheKeyProperty: 'cacheKey' }),
|
195
|
+
constructibleStyle.ConstructibleStyle({ cacheKeyProperty: 'cacheKey' }),
|
320
196
|
__metadata("design:type", Object)
|
321
197
|
], Grid.prototype, "styles", void 0);
|
322
198
|
Grid.style = gridCss;
|
@@ -456,16 +332,16 @@ const Img = class {
|
|
456
332
|
const bgStyle = this.loadSrc
|
457
333
|
? { 'background-image': `url(${this.loadSrc})` }
|
458
334
|
: {};
|
459
|
-
return (renderer.h(index.Host, { key: '
|
335
|
+
return (renderer.h(index.Host, { key: 'f8774fc9ad6e94727378337c2f405a068a7c88fb', class: "nano-img" }, renderer.h("div", { key: '15ae3c8ea944c8f0eab8616194f44fc1033e8fe2', class: "img" }, renderer.h("div", { key: 'ec3f433ded23dcb7fc57e53b0ecaba789ba492e0', class: "img__loader n-loader-skeleton" }, "Loading"), !!this.background && (renderer.h("div", { key: '8f4e8c9d595a31b477b0ae3f9e135f6b5c3f0e69', class: {
|
460
336
|
loaded: this.hasLoaded,
|
461
337
|
img__bg: true,
|
462
338
|
'no-height': this.autoHeight === 'image',
|
463
|
-
}, style: bgStyle }, renderer.h("slot", { key: '
|
339
|
+
}, style: bgStyle }, renderer.h("slot", { key: '29bab2a5c86b3dfe18db8936af77674c44d743d0' }))), renderer.h("img", { key: 'e6731b48ed137d97aa98e64dc55488d56724f672', class: {
|
464
340
|
img__image: true,
|
465
341
|
loaded: this.hasLoaded,
|
466
342
|
hide: this.background,
|
467
343
|
'no-height': this.autoHeight === 'content',
|
468
|
-
}, decoding: "async", src: this.loadSrc, loading: undefined, alt: this.alt, onLoad: this.onLoad, onError: this.loadError }), renderer.h("nano-resize-observe", { key: '
|
344
|
+
}, decoding: "async", src: this.loadSrc, loading: undefined, alt: this.alt, onLoad: this.onLoad, onError: this.loadError }), renderer.h("nano-resize-observe", { key: '0f1ce7d8b82adc19bfa459ff2adae708a4263c6e', class: "img__observer", onNanoResizeStateChange: this.onResize, states: this.imgStates }))));
|
469
345
|
}
|
470
346
|
static get watchers() { return {
|
471
347
|
"_src": ["_srcChanged"],
|
@@ -96,7 +96,7 @@ const Hero = class {
|
|
96
96
|
};
|
97
97
|
render() {
|
98
98
|
const rtl = this.host.dir === 'rtl' || this.host.ownerDocument.dir === 'rtl';
|
99
|
-
return (renderer.h(index.Host, { key: '
|
99
|
+
return (renderer.h(index.Host, { key: '8270c80717ac41cc4cd5bedb577b131fe01ac967', class: "nano-hero" }, renderer.h("div", { key: '8b04bda451af03b648beb5576cd0badd48364aab', class: {
|
100
100
|
hero: true,
|
101
101
|
'hero--light': this.theme === 'light',
|
102
102
|
'hero--secondary': this.hasSecondaryContent,
|
@@ -107,9 +107,9 @@ const Hero = class {
|
|
107
107
|
'hero--hasbg': this.hasBg,
|
108
108
|
'hero--backbtn': this.hasBackBtn,
|
109
109
|
'hero--sub': this.level === 'sub',
|
110
|
-
} }, renderer.h("div", { key: '
|
111
|
-
renderer.h("div", { key: '
|
112
|
-
renderer.h(this.HeroContent, { key: '
|
110
|
+
} }, renderer.h("div", { key: 'be91fa5b23ceddaf411b269eb6635b886c83174d', class: "hero__bg-wrap" }, !!this.imgSrc && (renderer.h("nano-img", { key: '961b0a21220f0305cc0f4a4af0c6cd5e99446c41', class: "hero__img", lazy: false, background: true, srcSet: this.imgSrcSet, src: this.imgSrc }, renderer.h(this.HeroContent, { key: 'b272423beee722ae9d4adc0313d2d9ca4e6e3cd4' }))), !this.imgSrc && [
|
111
|
+
renderer.h("div", { key: 'f10056208ed97f1d4a051572261c874e5dae6e96', class: "hero__bg-slot" }, renderer.h("slot", { key: '225c3a0b114b16e8edb063d6979683b343e85419', name: "background" })),
|
112
|
+
renderer.h(this.HeroContent, { key: '375442509ce1954ca651d56d49488b0da464e577' }),
|
113
113
|
]))));
|
114
114
|
}
|
115
115
|
static get watchers() { return {
|
@@ -7,323 +7,6 @@ var index = require('./index-DGttnXif.js');
|
|
7
7
|
var renderer = require('./renderer-B9M1kXq8.js');
|
8
8
|
var popover = require('./popover-BxNxwqMv.js');
|
9
9
|
|
10
|
-
let CACHED_MAP;
|
11
|
-
const getIconMap = () => {
|
12
|
-
if (!CACHED_MAP) {
|
13
|
-
const win = window;
|
14
|
-
win.Nanoicons = win.Nanoicons || {};
|
15
|
-
CACHED_MAP = win.Nanoicons.map = win.Nanoicons.map || new Map();
|
16
|
-
}
|
17
|
-
return CACHED_MAP;
|
18
|
-
};
|
19
|
-
const getUrl = (i) => {
|
20
|
-
let url = getSrc(i.src);
|
21
|
-
if (url)
|
22
|
-
return url;
|
23
|
-
url = getName(i.name, i.icon);
|
24
|
-
if (url)
|
25
|
-
return getNamedUrl(url);
|
26
|
-
if (i.icon) {
|
27
|
-
url = getSrc(i.icon);
|
28
|
-
if (url)
|
29
|
-
return url;
|
30
|
-
}
|
31
|
-
return null;
|
32
|
-
};
|
33
|
-
const getNamedUrl = (iconName) => {
|
34
|
-
const url = getIconMap().get(iconName);
|
35
|
-
if (url)
|
36
|
-
return url;
|
37
|
-
if (iconName.startsWith('device/') || iconName.startsWith('pictogram/')) {
|
38
|
-
return index.getAssetPath(`../nano-assets/icon/${iconName}.svg`);
|
39
|
-
}
|
40
|
-
return index.getAssetPath(`../nano-assets/fontawesome-pro/svgs/${iconName}.svg`);
|
41
|
-
};
|
42
|
-
const getName = (iconName, icon) => {
|
43
|
-
if (!iconName && icon && !isSrc(icon)) {
|
44
|
-
iconName = icon;
|
45
|
-
}
|
46
|
-
if (isStr(iconName)) {
|
47
|
-
iconName = toLower(iconName);
|
48
|
-
}
|
49
|
-
if (!isStr(iconName) || iconName.trim() === '') {
|
50
|
-
return null;
|
51
|
-
}
|
52
|
-
// only allow alpha characters and dash
|
53
|
-
const invalidChars = iconName.replace(/[a-z]|-|\/|\d/gi, '');
|
54
|
-
if (invalidChars !== '') {
|
55
|
-
console.warn('invalid characters in icon name ' + iconName);
|
56
|
-
return null;
|
57
|
-
}
|
58
|
-
return iconName;
|
59
|
-
};
|
60
|
-
const getSrc = (src) => {
|
61
|
-
if (isStr(src)) {
|
62
|
-
src = src.trim();
|
63
|
-
if (isSrc(src))
|
64
|
-
return src;
|
65
|
-
}
|
66
|
-
return null;
|
67
|
-
};
|
68
|
-
const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
|
69
|
-
const isStr = (val) => typeof val === 'string';
|
70
|
-
const toLower = (val) => val.toLowerCase();
|
71
|
-
|
72
|
-
const validateContent = (svgContent) => {
|
73
|
-
if (svgContent) {
|
74
|
-
const div = document.createElement('div');
|
75
|
-
div.innerHTML = svgContent;
|
76
|
-
// setup this way to ensure it works on our buddy IE
|
77
|
-
for (let i = div.childNodes.length - 1; i >= 0; i--) {
|
78
|
-
if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
|
79
|
-
div.removeChild(div.childNodes[i]);
|
80
|
-
}
|
81
|
-
}
|
82
|
-
// must only have 1 root element
|
83
|
-
const svgElm = div.firstElementChild;
|
84
|
-
if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
|
85
|
-
const svgClass = svgElm.getAttribute('class') || '';
|
86
|
-
svgElm.setAttribute('class', (svgClass + ' sc-nano-icon s-nano-icon svg').trim());
|
87
|
-
// root element must be an svg
|
88
|
-
// lets double check we've got valid elements
|
89
|
-
// do not allow scripts
|
90
|
-
if (isValid(svgElm)) {
|
91
|
-
return div.innerHTML;
|
92
|
-
}
|
93
|
-
}
|
94
|
-
}
|
95
|
-
return '';
|
96
|
-
};
|
97
|
-
const isValid = (elm) => {
|
98
|
-
if (elm.nodeType === 1) {
|
99
|
-
if (elm.nodeName.toLowerCase() === 'script') {
|
100
|
-
return false;
|
101
|
-
}
|
102
|
-
for (let i = 0; i < elm.attributes.length; i++) {
|
103
|
-
const val = elm.attributes[i].value;
|
104
|
-
if (isStr(val) && val.toLowerCase().indexOf('on') === 0) {
|
105
|
-
return false;
|
106
|
-
}
|
107
|
-
}
|
108
|
-
for (let i = 0; i < elm.childNodes.length; i++) {
|
109
|
-
if (!isValid(elm.childNodes[i])) {
|
110
|
-
return false;
|
111
|
-
}
|
112
|
-
}
|
113
|
-
}
|
114
|
-
return true;
|
115
|
-
};
|
116
|
-
|
117
|
-
const iconContent = new Map();
|
118
|
-
const requests = new Map();
|
119
|
-
const getSvgContent = (url) => {
|
120
|
-
// see if we already have a request for this url
|
121
|
-
let req = requests.get(url);
|
122
|
-
if (!req) {
|
123
|
-
// we don't already have a request
|
124
|
-
req = fetch(url).then((rsp) => {
|
125
|
-
if (rsp.ok) {
|
126
|
-
return rsp.text().then((svgContent) => {
|
127
|
-
iconContent.set(url, validateContent(svgContent));
|
128
|
-
});
|
129
|
-
}
|
130
|
-
iconContent.set(url, '');
|
131
|
-
});
|
132
|
-
// cache for the same requests
|
133
|
-
requests.set(url, req);
|
134
|
-
}
|
135
|
-
return req;
|
136
|
-
};
|
137
|
-
|
138
|
-
const iconCss = ":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--icon-size:1em;--primary-color:currentcolor\n --secondary-color: color-mix(in srgb, currentColor 50%, transparent);--primary-opacity:0.8;--secondary-opacity:1;display:inline-block;inline-size:var(--icon-size);block-size:var(--icon-size);min-inline-size:var(--icon-size);min-block-size:var(--icon-size);contain:strict;fill:currentcolor;box-sizing:content-box !important;transition:opacity 0.3s ease;color:currentcolor}:host .nanoicon{stroke:currentcolor}.nanoicon-fill-none{fill:none}.icon-inner,.nanoicon,svg,.svg{display:block;block-size:100%;inline-size:100%;overflow:visible}:host(.loading){opacity:0}.fa-primary{color:var(--primary-color);opacity:var(--primary-opacity, 1)}.fa-secondary{color:var(--secondary-color);opacity:var(--secondary-opacity) !important}:host(.flip-rtl) .icon-inner{transform:scaleX(-1)}:host([name^=pictogram]),:host([name^=device]){font-size:max(var(--nano-pictogram-size-medium), var(--icon-size))}:host([size=small][name^=pictogram]),:host([size=small][name^=device]){font-size:var(--nano-pictogram-size-small)}:host([size=regular]){font-size:var(--nano-icon-size-small)}:host([size=regular][name^=pictogram]),:host([size=regular][name^=device]){font-size:var(--nano-pictogram-size-medium)}:host([size=large]){font-size:var(--nano-icon-size-large)}:host([size=large][name^=pictogram]),:host([size=large][name^=device]){font-size:var(--nano-pictogram-size-large)}:host([size=xl][name^=pictogram]),:host([size=xl][name^=device]){font-size:var(--nano-pictogram-size-x-large)}:host([name^=pictogram]),:host([name^=device]),:host([color=primary]){color:var(--nano-color-primary-1100)}:host([color=neutral]){color:var(--nano-color-base-1000)}";
|
139
|
-
|
140
|
-
const Icon = class {
|
141
|
-
constructor(hostRef) {
|
142
|
-
index.registerInstance(this, hostRef);
|
143
|
-
this.nanoLoad = index.createEvent(this, "nanoLoad", 7);
|
144
|
-
this.nanoError = index.createEvent(this, "nanoError", 7);
|
145
|
-
}
|
146
|
-
io;
|
147
|
-
get el() { return index.getElement(this); }
|
148
|
-
svgContent;
|
149
|
-
isVisible = false;
|
150
|
-
isLoading = true;
|
151
|
-
/**
|
152
|
-
* Specifies the color of the icon. If not specified, the icon will inherit the color of the parent element.
|
153
|
-
*/
|
154
|
-
color;
|
155
|
-
/**
|
156
|
-
* Specifies the role to use for accessibility. Defaults to 'presentation' (invisible to screen-readers)
|
157
|
-
*/
|
158
|
-
role;
|
159
|
-
setAriaLabel() {
|
160
|
-
if (!this.ariaLabel && !this.el.ariaLabel) {
|
161
|
-
if (!this.role || this.role !== 'presentation') {
|
162
|
-
// if the role is not 'presentation' and the user did not explicitly set a role,
|
163
|
-
// let's try and derive one from the icon name
|
164
|
-
const label = getName(this.name, this.icon);
|
165
|
-
// user did not provide a label
|
166
|
-
// come up with the label based on the icon name
|
167
|
-
if (label) {
|
168
|
-
this.ariaLabel = label.split('/').slice(-1)[0].replace(/-/g, ' ');
|
169
|
-
}
|
170
|
-
}
|
171
|
-
}
|
172
|
-
else if (this.role === 'presentation') {
|
173
|
-
this.ariaLabel = undefined;
|
174
|
-
}
|
175
|
-
}
|
176
|
-
/**
|
177
|
-
* Specifies the label to use for accessibility. Defaults to the icon name.
|
178
|
-
*/
|
179
|
-
ariaLabel;
|
180
|
-
updateRole() {
|
181
|
-
// force the role to be 'img' if the aria-label is explicitly set
|
182
|
-
if (this.ariaLabel)
|
183
|
-
this.role = 'img';
|
184
|
-
else if (!this.ariaLabel)
|
185
|
-
this.role = 'presentation';
|
186
|
-
}
|
187
|
-
/**
|
188
|
-
* Specifies whether the icon should horizontally flip when `dir` is `"rtl"`.
|
189
|
-
* By default, when an 'arrow' or 'chevron' icon is used, it will flip automatically when detecting `dir="rtl"` on the document or closest ancestor.
|
190
|
-
*/
|
191
|
-
flipRtl;
|
192
|
-
/**
|
193
|
-
* Specifies which icon to use from the built-in set of icons.
|
194
|
-
*/
|
195
|
-
name;
|
196
|
-
/**
|
197
|
-
* Specifies the exact `src` of an SVG file to use.
|
198
|
-
*/
|
199
|
-
src;
|
200
|
-
/**
|
201
|
-
* A combination of both `name` and `src`. If a `src` url is detected
|
202
|
-
* it will set the `src` property. Otherwise it assumes it's a built-in named
|
203
|
-
* SVG and set the `name` property.
|
204
|
-
*/
|
205
|
-
icon;
|
206
|
-
/**
|
207
|
-
* The size of the icon. `auto` automatically sizes according to the font-size of the parent element.
|
208
|
-
* *Note*: size will be different on 'pictogram' and 'device' vs 'font awesome' icons.
|
209
|
-
*/
|
210
|
-
size = 'auto';
|
211
|
-
/**
|
212
|
-
* If enabled, nano-icon will be loaded lazily when it's visible in the viewport.
|
213
|
-
* Default, `true`.
|
214
|
-
*/
|
215
|
-
lazy = true;
|
216
|
-
loadIcon() {
|
217
|
-
if (this.isVisible) {
|
218
|
-
const url = getUrl(this);
|
219
|
-
if (url) {
|
220
|
-
if (iconContent.has(url)) {
|
221
|
-
// sync if it's already loaded
|
222
|
-
this.svgContent = iconContent.get(url);
|
223
|
-
requestAnimationFrame(() => {
|
224
|
-
this.isLoading = false;
|
225
|
-
this.nanoLoad.emit();
|
226
|
-
});
|
227
|
-
}
|
228
|
-
else {
|
229
|
-
// async if it hasn't been loaded
|
230
|
-
getSvgContent(url).then(() => {
|
231
|
-
this.svgContent = iconContent.get(url);
|
232
|
-
requestAnimationFrame(() => {
|
233
|
-
this.isLoading = false;
|
234
|
-
this.nanoLoad.emit();
|
235
|
-
});
|
236
|
-
this.setAriaLabel();
|
237
|
-
}, () => {
|
238
|
-
// error loading icon
|
239
|
-
this.nanoError.emit();
|
240
|
-
});
|
241
|
-
}
|
242
|
-
}
|
243
|
-
}
|
244
|
-
}
|
245
|
-
/** Emitted when the icon has finished loading. */
|
246
|
-
nanoLoad;
|
247
|
-
/** Emitted when the icon fails to load. */
|
248
|
-
nanoError;
|
249
|
-
waitUntilVisible(el, rootMargin, cb) {
|
250
|
-
if (this.lazy &&
|
251
|
-
typeof window !== 'undefined' &&
|
252
|
-
window.IntersectionObserver) {
|
253
|
-
const io = (this.io = new window.IntersectionObserver((data) => {
|
254
|
-
if (data[0].isIntersecting || (data[1] && data[1].isIntersecting)) {
|
255
|
-
io.disconnect();
|
256
|
-
this.io = undefined;
|
257
|
-
cb();
|
258
|
-
}
|
259
|
-
}, { rootMargin }));
|
260
|
-
io.observe(el);
|
261
|
-
}
|
262
|
-
else {
|
263
|
-
// not a browser env (e.g. node)
|
264
|
-
// or we're not loading lazily
|
265
|
-
// or env doesn't support IntersectionObserver (testing?)
|
266
|
-
// - immediately fetch icon
|
267
|
-
cb();
|
268
|
-
}
|
269
|
-
}
|
270
|
-
isRtl() {
|
271
|
-
// doc is in rtl
|
272
|
-
if (this.el.ownerDocument?.dir === 'rtl')
|
273
|
-
return true;
|
274
|
-
// html element is in rtl element
|
275
|
-
if (this.el.closest('[dir="rtl"]'))
|
276
|
-
return true;
|
277
|
-
// nested in a shadow dom - see if that host element is contained in an rtl element
|
278
|
-
const rootNode = this.el.getRootNode();
|
279
|
-
const ownerHost = rootNode.host;
|
280
|
-
if (ownerHost && ownerHost.closest('[dir="rtl"]'))
|
281
|
-
return true;
|
282
|
-
return false;
|
283
|
-
}
|
284
|
-
connectedCallback() {
|
285
|
-
// purposely do not return the promise here because loading
|
286
|
-
// the svg file should not hold up loading the app
|
287
|
-
// only load the svg if it's visible
|
288
|
-
this.waitUntilVisible(this.el, '50px', () => {
|
289
|
-
this.isVisible = true;
|
290
|
-
this.loadIcon();
|
291
|
-
});
|
292
|
-
}
|
293
|
-
disconnectedCallback() {
|
294
|
-
if (this.io) {
|
295
|
-
this.io.disconnect();
|
296
|
-
this.io = undefined;
|
297
|
-
}
|
298
|
-
}
|
299
|
-
componentWillLoad() {
|
300
|
-
this.updateRole();
|
301
|
-
this.setAriaLabel();
|
302
|
-
}
|
303
|
-
render() {
|
304
|
-
const flipRtl = this.flipRtl ||
|
305
|
-
(this.name &&
|
306
|
-
this.name.match(/right|left/) &&
|
307
|
-
(this.name.indexOf('arrow') > -1 ||
|
308
|
-
this.name.indexOf('chevron') > -1) &&
|
309
|
-
this.isRtl());
|
310
|
-
return (renderer.h(index.Host, { key: '754a53ed280fd9bcb1dcbec89eba4180f491d1b8', class: {
|
311
|
-
loading: this.isLoading,
|
312
|
-
'flip-rtl': !!flipRtl,
|
313
|
-
'nano-icon': true,
|
314
|
-
} }, this.svgContent ? (renderer.h("div", { class: "icon-inner", innerHTML: this.svgContent })) : (renderer.h("div", { class: "icon-inner" }))));
|
315
|
-
}
|
316
|
-
static get assetsDirs() { return ["device", "pictogram"]; }
|
317
|
-
static get watchers() { return {
|
318
|
-
"role": ["setAriaLabel"],
|
319
|
-
"ariaLabel": ["updateRole"],
|
320
|
-
"name": ["loadIcon"],
|
321
|
-
"src": ["loadIcon"],
|
322
|
-
"icon": ["loadIcon"]
|
323
|
-
}; }
|
324
|
-
};
|
325
|
-
Icon.style = iconCss;
|
326
|
-
|
327
10
|
const iconButtonCss = ":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{--border-radius:none;--active-color:var(--nano-color-neutral-800);--hover-color:var(--nano-color-primary-1100);--padding:var(--nano-spacing-xs);--box-shadow:none;--button-bg:transparent;color:currentcolor;border-radius:var(--border-radius);display:inline-block}.icon-button{flex:0 0 auto;display:flex;align-items:center;border:none;border-radius:inherit;background:inherit;font-size:inherit;color:inherit;padding:var(--padding);cursor:pointer;appearance:none;box-shadow:var(--box-shadow)}.icon-button:hover:not(.icon-button--disabled),.icon-button:focus:not(.icon-button--disabled){color:var(--hover-color)}.icon-button:active:not(.icon-button--disabled){color:var(--active-color)}.icon-button:focus-visible:not(.icon-button--disabled){outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset)}.icon-button__label{clip-path:inset(50%);block-size:1px;overflow:hidden;position:absolute;white-space:nowrap;inline-size:1px}:host([disabled]:not([disabled=false])){opacity:0.5;cursor:not-allowed}.icon-button--disabled{pointer-events:none}";
|
328
11
|
|
329
12
|
const IconButton = class {
|
@@ -638,10 +321,10 @@ const Tooltip = class {
|
|
638
321
|
this.popover.destroy();
|
639
322
|
}
|
640
323
|
render() {
|
641
|
-
return (renderer.h(index.Host, { key: '
|
324
|
+
return (renderer.h(index.Host, { key: '94758bb18228b14884cf2be79228e554de84013f', onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick, class: "nano-tooltip" }, renderer.h("slot", { key: '45589386e68d89c21abbb50513678152e8bce9d1', onSlotchange: this.handleSlotChange }), renderer.h("div", { key: '6a76c101c35d45458f0a680753a381cc95631b87', ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner", popover: "manual" }, renderer.h("div", { key: 'd3b2cc9c9018c9a0a5dc4cef256c8b9c568cd0b4', part: "base", ref: (el) => (this.tooltip = el), class: {
|
642
325
|
tooltip: true,
|
643
326
|
'tooltip--open': this.open,
|
644
|
-
}, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, renderer.h("slot", { key: '
|
327
|
+
}, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, renderer.h("slot", { key: '1c51cdc6a7ec88107e3290b0b9750198e7176c20', name: "content", onSlotchange: () => this.setLabel() }, this.content), renderer.h("div", { key: '00f090eee000e6bba713dc21a1d53c348eb94a76', class: "tooltip-arrow", "data-popper-arrow": true })))));
|
645
328
|
}
|
646
329
|
static get watchers() { return {
|
647
330
|
"content": ["setLabel"],
|
@@ -650,6 +333,5 @@ const Tooltip = class {
|
|
650
333
|
};
|
651
334
|
Tooltip.style = tooltipCss;
|
652
335
|
|
653
|
-
exports.nano_icon = Icon;
|
654
336
|
exports.nano_icon_button = IconButton;
|
655
337
|
exports.nano_tooltip = Tooltip;
|