@nanoporetech-digital/components 9.1.6 → 9.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/nano-datalist_3.cjs.entry.js +13 -5
- package/dist/cjs/nano-dropdown_2.cjs.entry.js +5 -4
- package/dist/cjs/nano-global-nav.cjs.entry.js +14 -13
- package/dist/collection/components/datalist/datalist.js +13 -5
- package/dist/collection/components/dropdown/dropdown.js +5 -4
- package/dist/collection/components/global-nav/global-nav.js +14 -13
- package/dist/components/datalist.js +13 -5
- package/dist/components/dropdown.js +5 -4
- package/dist/components/nano-global-nav.js +14 -13
- package/dist/esm/nano-datalist_3.entry.js +13 -5
- package/dist/esm/nano-dropdown_2.entry.js +5 -4
- package/dist/esm/nano-global-nav.entry.js +14 -13
- package/dist/nano-components/nano-datalist_3.entry.js +1 -1
- package/dist/nano-components/nano-dropdown_2.entry.js +1 -1
- package/dist/nano-components/nano-global-nav.entry.js +1 -1
- package/docs-json.json +1 -1
- package/hydrate/index.js +32 -22
- package/hydrate/index.mjs +32 -22
- package/package.json +2 -2
package/hydrate/index.mjs
CHANGED
|
@@ -9474,6 +9474,14 @@ class DataList {
|
|
|
9474
9474
|
this.listBox.setFocus();
|
|
9475
9475
|
return;
|
|
9476
9476
|
}
|
|
9477
|
+
// When select, mirror native select behaviour. Enter on an open list confirms the
|
|
9478
|
+
// (type-to-select) value - already applied - and closes
|
|
9479
|
+
if (this.type === 'select' && this.open && e.key === 'Enter') {
|
|
9480
|
+
e.preventDefault();
|
|
9481
|
+
this.shouldOpen = false;
|
|
9482
|
+
this.manageDropdownDisplay();
|
|
9483
|
+
return;
|
|
9484
|
+
}
|
|
9477
9485
|
this.shouldOpen = true;
|
|
9478
9486
|
// open dropdown if possible
|
|
9479
9487
|
this.manageDropdownDisplay();
|
|
@@ -9535,18 +9543,18 @@ class DataList {
|
|
|
9535
9543
|
}
|
|
9536
9544
|
}
|
|
9537
9545
|
render() {
|
|
9538
|
-
return (h(Host, { key: '
|
|
9546
|
+
return (h(Host, { key: '1fff00ce17443af0cc012034202f5b9534c3eb8e', class: "nano-datalist", role: this.actvOptEles.length ? 'listbox' : undefined, "aria-owns": this.optionIds.length ? this.optionIds.join(' ') : undefined, "aria-label": this.optionIds.length
|
|
9539
9547
|
? 'Select options from the list below'
|
|
9540
|
-
: undefined }, h("nano-dropdown", { key: '
|
|
9548
|
+
: undefined }, h("nano-dropdown", { key: 'aa52b8a9e448a27b572b533c8a66b582fc631b74', part: "dropdown", exportparts: "trigger:dropdown__trigger, panel:dropdown__panel", ...this.dropDownConfig, ref: (el) => (this.nanoDropdown = el), dialogTitle: "Select options from the list below", class: {
|
|
9541
9549
|
dlist__dropdown: true,
|
|
9542
9550
|
'dlist--isfiltered': this.isFiltered,
|
|
9543
|
-
}, onNanoAfterShow: this.handleShow, onNanoAfterHide: this.handleHide, role: "group" }, h("nano-menu", { key: '
|
|
9551
|
+
}, onNanoAfterShow: this.handleShow, onNanoAfterHide: this.handleHide, role: "group" }, h("nano-menu", { key: 'cefe1e472c018fcf612ea6d30e0a591f0dbfad70', part: "main-menu", ref: (el) => (this.listBox = el), hidden: !this.actvOptEles.length, type: "listbox", label: this.inputLabel ? this.inputLabel.textContent : undefined, class: {
|
|
9544
9552
|
dlist__menu: true,
|
|
9545
9553
|
'dlist__menu--open': this.dropwdownOpen,
|
|
9546
|
-
}, tabIndex: -1, onNanoSelect: this.optSelected, onKeyDown: this.optionKeyDown }, h("slot", { key: '
|
|
9554
|
+
}, tabIndex: -1, onNanoSelect: this.optSelected, onKeyDown: this.optionKeyDown }, h("slot", { key: '75b377c49d3b3e0f172135e0d705dfe92bcac5aa', name: "list-top" }), h("slot", { key: 'd89f6cf631fc6faeddf447be926339c85649ff93' }), h("slot", { key: '782d7373362170ba28647c1302746ee1ae606f87', name: "internal-opts" }), h("slot", { key: 'e3cf0d800b7219bdce24259eed1134f01349b40c', name: "list-bottom" })), h("nano-menu", { key: 'e9aafef02fe4d3157629840451da1ff0110a9b8d', part: "no-result-menu", type: "listbox", label: "No results found", hidden: !!this.actvOptEles.length, class: {
|
|
9547
9555
|
dlist__menu: true,
|
|
9548
9556
|
'dlist__menu--open': this.dropwdownOpen,
|
|
9549
|
-
} }, h("slot", { key: '
|
|
9557
|
+
} }, h("slot", { key: '34cf56ecb0c0a818f151cd8e1cc7e25e0bc04f1c', name: "no-result" })), !!this.actvOptEles && (h("div", { key: '89aaba1550af0b0a273179bf16a31904840552d4', class: "dlist__status" }, this.actvOptEles.length, " result", this.actvOptEles.length > 1 ? 's' : '', " available.")))));
|
|
9550
9558
|
}
|
|
9551
9559
|
static get watchers() { return {
|
|
9552
9560
|
"open": ["openWatcher"],
|
|
@@ -13004,7 +13012,8 @@ class Dropdown {
|
|
|
13004
13012
|
positioner;
|
|
13005
13013
|
accessibleTrigger;
|
|
13006
13014
|
didLoad = false;
|
|
13007
|
-
|
|
13015
|
+
// only set when opened via keyboard; consumed (and reset) once the open transition ends
|
|
13016
|
+
focusFirstEle = false;
|
|
13008
13017
|
get menu() {
|
|
13009
13018
|
return this.host.querySelector(transformTag('nano-menu'));
|
|
13010
13019
|
}
|
|
@@ -13338,12 +13347,12 @@ class Dropdown {
|
|
|
13338
13347
|
this.popover.destroy();
|
|
13339
13348
|
}
|
|
13340
13349
|
render() {
|
|
13341
|
-
return (h(Host, { key: '
|
|
13350
|
+
return (h(Host, { key: '00d9c9f79a99c0e2f926e4e8482cd1f06badfa73', class: "nano-dropdown" }, h("div", { key: 'b63f546d7d45cac07dded72bf666b4153df7e874', part: "base", id: this.dropdownId, class: {
|
|
13342
13351
|
dropdown: true,
|
|
13343
13352
|
'dropdown--open': this.open,
|
|
13344
|
-
} }, h("span", { key: '
|
|
13353
|
+
} }, h("span", { key: '7dc63a96ced0d342ee725ce6cfe84af479d75ebc', part: "trigger", class: "dropdown__trigger", ref: (el) => (this.trigger = el), onKeyDown: this.handleTriggerKeyDown, onClick: this.togglePanel }, h("slot", { key: 'aee47edcef94de976c86780a91ae49e5052e8fc0', name: "trigger", onSlotchange: this.handleTriggerSlotChange })), h("div", { key: '3bbcc7e43091542e909827c00cf84b36baef806c', ref: (el) => (this.positioner = el), class: "dropdown__positioner", popover: "manual", id: this.dropdownId + '-positioner' }, h("div", { key: 'a94cd6ea9bbaaa3a8b743035746252666253fa17', ref: (el) => (this.panel = el), part: "panel", class: `dropdown__panel ${this.placement.split('-').join(' ')}`, "aria-hidden": !this.open, role: this.host.getAttribute('role') === 'group' ? 'group' : 'dialog', "aria-modal": this.host.getAttribute('role') === 'group' ? undefined : 'true', "aria-labelledby": this.dialogTitle ? this.labelId : undefined, tabIndex: this.isOverflowing() ? 0 : undefined }, this.dialogTitle && (h("span", { key: '39622ee9886cd0094891032b4c939c6e420cd19d', id: this.labelId, class: "dropdown__accessible-title", "aria-live": this.host.getAttribute('role') === 'group'
|
|
13345
13354
|
? undefined
|
|
13346
|
-
: 'polite' }, this.dialogTitle)), h("slot", { key: '
|
|
13355
|
+
: 'polite' }, this.dialogTitle)), h("slot", { key: '39b7b9392d4649e6141dec80a95c56a9f176ac5d' }))))));
|
|
13347
13356
|
}
|
|
13348
13357
|
static get watchers() { return {
|
|
13349
13358
|
"open": ["handleOpenChange"],
|
|
@@ -14813,7 +14822,8 @@ class GlobalNav {
|
|
|
14813
14822
|
this.myAccountData = (await Promise.resolve().then(function () { return localLoggedOut$1; }));
|
|
14814
14823
|
return;
|
|
14815
14824
|
}
|
|
14816
|
-
|
|
14825
|
+
// MyAccount is cross-origin; send its session cookies or the user always appears logged out
|
|
14826
|
+
fetch(this.myAccountUrl + '/nav_bar_data.json', { credentials: 'include' })
|
|
14817
14827
|
.then((res) => res.json())
|
|
14818
14828
|
.then((data) => {
|
|
14819
14829
|
this.myAccountData = data;
|
|
@@ -15264,21 +15274,21 @@ class GlobalNav {
|
|
|
15264
15274
|
}
|
|
15265
15275
|
render() {
|
|
15266
15276
|
const bpps = this.bpPartials;
|
|
15267
|
-
return (h(Host, { key: '
|
|
15277
|
+
return (h(Host, { key: '08fd38cc2711a83d40053e7ca147ce3a9ef38ce3', class: {
|
|
15268
15278
|
'overflow-menu': this.breakpoint > bpps.mainMenu.breakpoint,
|
|
15269
15279
|
'bar-menu': this.breakpoint <= bpps.mainMenu.breakpoint,
|
|
15270
15280
|
'nano-global-nav': true,
|
|
15271
|
-
} }, h("div", { key: '
|
|
15281
|
+
} }, h("div", { key: '63b69c051b64880f07dc2c309064a3fd9e4490e3', class: {
|
|
15272
15282
|
gn: true,
|
|
15273
15283
|
'gn__search-open': this.searchBarShown,
|
|
15274
|
-
} }, h("nano-drawer", { key: '
|
|
15284
|
+
} }, h("nano-drawer", { key: 'a1db81578932ba08842ab49a3ff0a34f9d2afd73', 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) }, h("div", { key: '3ee1efdef44a84b0fbf3434392e2fcb617abbfab', class: "gn__drawer-header", part: "overflow-header", slot: "label" }, "Main menu"), h("nav", { key: 'bea757cb52809fc472dbd5055b00462801f2a2a9', class: "gn__drawer-menu", part: "overflow-menu" }, this.breakpoint > bpps.mainMenu.breakpoint
|
|
15275
15285
|
? bpps.mainMenu.tpl()
|
|
15276
|
-
: '', h("slot", { key: '
|
|
15286
|
+
: '', h("slot", { key: '571b994b306beacf7342536beb6bbde5c261a677', name: "overflow" }))), h("div", { key: '1bfbaa6397db0959e781a62a824b79929ac82468', class: "gn__menu-bar-wrapper" }, h("div", { key: '4dff6a82f085798b3ebd30bb01b960b9c2065b46', class: "gn__menu-bar", part: "menu-bar", ref: (el) => (this.mainMenuBar = el) }, h("nav", { key: '3e56113c9377dba138ec7b37f31f144d337fc707', "aria-label": "Global navigation", class: `gn__main-menu ${this.shouldResize ? 'resizing' : ''}`, part: "main-menu", ref: (el) => (this.mainMenu = el) }, this.breakpoint > bpps.mainMenu.breakpoint && (h("nano-icon-button", { key: '3667ae378b645ae6440126c591f6fe656a9b783e', class: "gn__overflow-button", iconName: "light/bars", label: "Open Menu", onClick: () => this.overflowMenu.show() })), h("slot", { key: '742068e692bdd49fd0999568db15df4d84d74084', name: "logo" }, h("a", { key: '4584b27ecd617f2d176074f84626b2759bcdd164', href: this.logoUrl, class: "gn__logo-link", part: "logo-link" }, this.breakpoint <= bpps.logo.breakpoint ? (h("img", { src: getAssetPath('../nano-assets/ont-logo.svg'), alt: `Oxford Nanopore Technologies logo. Features a stylised representation of a nanopore,
|
|
15277
15287
|
(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: "35", part: "logo logo--large" })) : (h("img", { src: getAssetPath('../nano-assets/ont-wheel.svg'), alt: `Oxford Nanopore Technologies logo. A stylised representation of a nanopore,
|
|
15278
|
-
(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: "35", height: "35", part: "logo logo--small" })))), this.breakpoint <= bpps.mainMenu.breakpoint && (h("div", { key: '
|
|
15279
|
-
(!!this.searchIndices.length && (h("nano-dropdown", { key: '
|
|
15288
|
+
(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: "35", height: "35", part: "logo logo--small" })))), this.breakpoint <= bpps.mainMenu.breakpoint && (h("div", { key: 'a03353f5db8f5fd8cbb02219c1f63d04e74c8ca8', class: "gn__main-menu-links" }, bpps.mainMenu.tpl())), h("div", { key: '5579bee39208817f0fffb5ae97b9cf6b192bbcd6', class: "gn__main-menu-actions" }, !this.myAccountData ||
|
|
15289
|
+
(!!this.searchIndices.length && (h("nano-dropdown", { key: '838047989bda4a5991bbe8a2bd4f8530524918d5', 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 }, h("nano-icon-button", { key: '05c65d9f0d6e6570e3bef62ca535da36655ce021', class: "gn__search-button", slot: "trigger", iconName: "light/magnifying-glass", label: "Search" }), h("form", { key: '2562ec900848f8f7b4f4f9f696a187a14a457f7d', ref: (form) => (this.searchForm = form), class: "gn__search-form", part: "search-form", onSubmit: this.onSearchSubmit }, this.searchIndices.length > 1 && (h("nano-select", { key: '181f2d8f7fa89439f57af21b489beccda196cf34', 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) => (h("nano-option", { selected: index.name === this.searchIndex, value: index.index }, index.name || index.index))))), h("nano-input", { key: '2163e7a28516ba6e9f0c3d7e2e6a64b6fea3a9f0', ref: (ele) => (this.searchInput = ele), part: "search-input", label: "Search Oxford Nanopore Technologies", placeholder: "Search Oxford Nanopore...", hideLabel: true, clearable: true, showInlineError: false, onNanoChange: (e) => {
|
|
15280
15290
|
this.handleSearchTermChangeEvent(e.detail.value);
|
|
15281
|
-
}, onNanoInput: this.handleSearchTermInputEvent, debounce: 500, value: this._searchValue }, h("nano-icon-button", { key: '
|
|
15291
|
+
}, onNanoInput: this.handleSearchTermInputEvent, debounce: 500, value: this._searchValue }, h("nano-icon-button", { key: '6d85d49f3da82a2e970a8d54b778e0c9ef6ce563', slot: "end", "icon-name": "light/magnifying-glass", label: "Search", onClick: this.onSearchSubmit }), h("nano-datalist", { key: '70928f0886130da02bb02c88f75b8d55650612f2', class: "gn__search-results", onNanoSelect: (e) => e.preventDefault(), dropDownConfig: { tetherTo: this.searchForm }, disableFilter: true }, this.searchLoading && (h("div", { key: '223c85ed29b119cddb61d7e6cb88a7a4e3e15e8f', slot: "no-result", class: "gn__search-loading" }, h("nano-spinner", { key: 'cf014da5a7f18f2d84251f825a1718c270a68162' }, "Searching..."))), this.noResultPartial(), !!this.autocompleteResults?.hits.length && [
|
|
15282
15292
|
this.autocompleteResults.hits.map((hit, i) => (h("nano-option", { href: hit.url, class: "gn__search-result", onClick: () => {
|
|
15283
15293
|
searchInsight.sendClick({
|
|
15284
15294
|
index: this.activeIndex.index,
|
|
@@ -15288,13 +15298,13 @@ class GlobalNav {
|
|
|
15288
15298
|
positions: [i + 1],
|
|
15289
15299
|
});
|
|
15290
15300
|
} }, h("span", { innerHTML: this.autocompleteSnippet(hit) })))),
|
|
15291
|
-
h("nano-option", { key: '
|
|
15292
|
-
])))))), h("div", { key: '
|
|
15293
|
-
h("nano-icon-button", { key: '
|
|
15294
|
-
!!this.cartCount && (h("nano-badge", { key: '
|
|
15301
|
+
h("nano-option", { key: 'ca2e52576b2faa6f35c2377591212c7a37c2355e', class: "gn__search-viewall", onNanoSelect: this.onSearchSubmit }, "View all results"),
|
|
15302
|
+
])))))), h("div", { key: '558eea256b3807c8066cfad3d303dfdd23cc7af2', class: "gn__cart" }, this.cartUrl && [
|
|
15303
|
+
h("nano-icon-button", { key: '64fa87c0f21a947bed221ac4cf4f1996cd39f00c', iconName: "light/cart-shopping", label: "View your cart", href: this.cartUrl }),
|
|
15304
|
+
!!this.cartCount && (h("nano-badge", { key: '26f65729803a1f345c83603a481321c86e770e33', theme: "danger" }, this.cartCount > 9 ? '9+' : this.cartCount)),
|
|
15295
15305
|
]), this.breakpoint <= bpps.contact.breakpoint
|
|
15296
15306
|
? bpps.contact.tpl()
|
|
15297
|
-
: '', this.isLoggedIn ? (h("nano-dropdown", { dialogTitle: "User menu", class: "gn__user-dropdown", distance: 10, placement: "bottom-end" }, h("button", { slot: "trigger", class: "gn__user-dropdown-trigger" }, h("nano-icon", { name: "light/user" }), h("nano-icon", { name: "light/chevron-down", class: "gn__user-dropdown-chevron" }), !!this.msgCount && (h("nano-badge", { theme: "danger" }, this.msgCount > 9 ? '9+' : this.msgCount))), this.loggedInPanel())) : (h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, typeof this.loginUrl === 'string' ? (h("a", { href: this.formatLoginLink(this.loginUrl) }, "Login")) : (h("button", { onClick: this.loginUrl }, "Login")))))))), h("nano-global-search-results", { key: '
|
|
15307
|
+
: '', this.isLoggedIn ? (h("nano-dropdown", { dialogTitle: "User menu", class: "gn__user-dropdown", distance: 10, placement: "bottom-end" }, h("button", { slot: "trigger", class: "gn__user-dropdown-trigger" }, h("nano-icon", { name: "light/user" }), h("nano-icon", { name: "light/chevron-down", class: "gn__user-dropdown-chevron" }), !!this.msgCount && (h("nano-badge", { theme: "danger" }, this.msgCount > 9 ? '9+' : this.msgCount))), this.loggedInPanel())) : (h("nano-cta", { secondary: true, size: "small", icon: "false", class: "gn__login-cta" }, typeof this.loginUrl === 'string' ? (h("a", { href: this.formatLoginLink(this.loginUrl) }, "Login")) : (h("button", { onClick: this.loginUrl }, "Login")))))))), h("nano-global-search-results", { key: '60e0568f58c6a277b6a09c3541bb561b0dab1026', part: "site-search-results" }, h("div", { key: '743e3f716d1af6337ee95a8e48b017e7f9875770', class: "gn__site", part: "site-wrapper" }, h("slot", { key: 'fc1621f5b67db233aa7332d7a7d0334563ee7cd9' }))))));
|
|
15298
15308
|
}
|
|
15299
15309
|
static get assetsDirs() { return ["assets"]; }
|
|
15300
15310
|
static get watchers() { return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanoporetech-digital/components",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.8",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "A collection of Oxford Nanopore corporate / digital webcomponents",
|
|
6
6
|
"type": "module",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"smart-array-filter": "^4.0.2",
|
|
57
57
|
"stencil-wormhole": "3.2.1",
|
|
58
58
|
"tyqs": "^0.1.3",
|
|
59
|
-
"@nanoporetech-digital/style": "9.1.
|
|
59
|
+
"@nanoporetech-digital/style": "9.1.8"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@algolia/client-search": "^4.22.1",
|