@nanoporetech-digital/components 9.1.5 → 9.1.7
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-dropdown_2.cjs.entry.js +5 -4
- package/dist/cjs/nano-file-upload.cjs.entry.js +10 -4
- package/dist/cjs/nano-global-nav.cjs.entry.js +14 -13
- package/dist/collection/components/dropdown/dropdown.js +5 -4
- package/dist/collection/components/file-upload/file-upload.js +10 -4
- package/dist/collection/components/global-nav/global-nav.js +14 -13
- package/dist/components/dropdown.js +5 -4
- package/dist/components/nano-file-upload.js +10 -4
- package/dist/components/nano-global-nav.js +14 -13
- package/dist/esm/nano-dropdown_2.entry.js +5 -4
- package/dist/esm/nano-file-upload.entry.js +10 -4
- package/dist/esm/nano-global-nav.entry.js +14 -13
- package/dist/nano-components/nano-dropdown_2.entry.js +1 -1
- package/dist/nano-components/nano-file-upload.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 +29 -21
- package/hydrate/index.mjs +29 -21
- package/package.json +2 -2
package/hydrate/index.mjs
CHANGED
|
@@ -13004,7 +13004,8 @@ class Dropdown {
|
|
|
13004
13004
|
positioner;
|
|
13005
13005
|
accessibleTrigger;
|
|
13006
13006
|
didLoad = false;
|
|
13007
|
-
|
|
13007
|
+
// only set when opened via keyboard; consumed (and reset) once the open transition ends
|
|
13008
|
+
focusFirstEle = false;
|
|
13008
13009
|
get menu() {
|
|
13009
13010
|
return this.host.querySelector(transformTag('nano-menu'));
|
|
13010
13011
|
}
|
|
@@ -13338,12 +13339,12 @@ class Dropdown {
|
|
|
13338
13339
|
this.popover.destroy();
|
|
13339
13340
|
}
|
|
13340
13341
|
render() {
|
|
13341
|
-
return (h(Host, { key: '
|
|
13342
|
+
return (h(Host, { key: '00d9c9f79a99c0e2f926e4e8482cd1f06badfa73', class: "nano-dropdown" }, h("div", { key: 'b63f546d7d45cac07dded72bf666b4153df7e874', part: "base", id: this.dropdownId, class: {
|
|
13342
13343
|
dropdown: true,
|
|
13343
13344
|
'dropdown--open': this.open,
|
|
13344
|
-
} }, h("span", { key: '
|
|
13345
|
+
} }, 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
13346
|
? undefined
|
|
13346
|
-
: 'polite' }, this.dialogTitle)), h("slot", { key: '
|
|
13347
|
+
: 'polite' }, this.dialogTitle)), h("slot", { key: '39b7b9392d4649e6141dec80a95c56a9f176ac5d' }))))));
|
|
13347
13348
|
}
|
|
13348
13349
|
static get watchers() { return {
|
|
13349
13350
|
"open": ["handleOpenChange"],
|
|
@@ -14445,10 +14446,16 @@ class FileUpload {
|
|
|
14445
14446
|
checkFileSize(size) {
|
|
14446
14447
|
return size / 1000000 <= this.maxFileSize;
|
|
14447
14448
|
}
|
|
14448
|
-
checkFileType(
|
|
14449
|
+
checkFileType(file) {
|
|
14449
14450
|
if (!this.accept)
|
|
14450
14451
|
return true;
|
|
14451
|
-
|
|
14452
|
+
const type = file.type;
|
|
14453
|
+
if (type) {
|
|
14454
|
+
return !!this.accept.match(type) && this.accept.match(type).length > 0;
|
|
14455
|
+
}
|
|
14456
|
+
return this.accept
|
|
14457
|
+
.split(',')
|
|
14458
|
+
.some((accepted) => file.name.endsWith(accepted.trim()));
|
|
14452
14459
|
}
|
|
14453
14460
|
validate = () => {
|
|
14454
14461
|
this.errorMessage = '';
|
|
@@ -14470,7 +14477,7 @@ class FileUpload {
|
|
|
14470
14477
|
this.maxFileSize +
|
|
14471
14478
|
'Mb';
|
|
14472
14479
|
}
|
|
14473
|
-
else if (!this.checkFileType(fileItem.file
|
|
14480
|
+
else if (!this.checkFileType(fileItem.file)) {
|
|
14474
14481
|
listeItemError = `File type is not allowed (${this.accept})`;
|
|
14475
14482
|
}
|
|
14476
14483
|
fileItem.validationMessage = listeItemError;
|
|
@@ -14634,7 +14641,7 @@ class FileUpload {
|
|
|
14634
14641
|
];
|
|
14635
14642
|
};
|
|
14636
14643
|
render() {
|
|
14637
|
-
return (h(Host, { key: '
|
|
14644
|
+
return (h(Host, { key: '72dede3cd11629374dc390f030af0a9412a6af70', class: "nano-file-upload" }, h("div", { key: '913c23888d43555a1cbfae0d973c848f01e733dc', class: {
|
|
14638
14645
|
'file-upload': true,
|
|
14639
14646
|
'file-upload--dragging': this.isDragging,
|
|
14640
14647
|
'file-upload--focus': this.hasFocus,
|
|
@@ -14807,7 +14814,8 @@ class GlobalNav {
|
|
|
14807
14814
|
this.myAccountData = (await Promise.resolve().then(function () { return localLoggedOut$1; }));
|
|
14808
14815
|
return;
|
|
14809
14816
|
}
|
|
14810
|
-
|
|
14817
|
+
// MyAccount is cross-origin; send its session cookies or the user always appears logged out
|
|
14818
|
+
fetch(this.myAccountUrl + '/nav_bar_data.json', { credentials: 'include' })
|
|
14811
14819
|
.then((res) => res.json())
|
|
14812
14820
|
.then((data) => {
|
|
14813
14821
|
this.myAccountData = data;
|
|
@@ -15258,21 +15266,21 @@ class GlobalNav {
|
|
|
15258
15266
|
}
|
|
15259
15267
|
render() {
|
|
15260
15268
|
const bpps = this.bpPartials;
|
|
15261
|
-
return (h(Host, { key: '
|
|
15269
|
+
return (h(Host, { key: '08fd38cc2711a83d40053e7ca147ce3a9ef38ce3', class: {
|
|
15262
15270
|
'overflow-menu': this.breakpoint > bpps.mainMenu.breakpoint,
|
|
15263
15271
|
'bar-menu': this.breakpoint <= bpps.mainMenu.breakpoint,
|
|
15264
15272
|
'nano-global-nav': true,
|
|
15265
|
-
} }, h("div", { key: '
|
|
15273
|
+
} }, h("div", { key: '63b69c051b64880f07dc2c309064a3fd9e4490e3', class: {
|
|
15266
15274
|
gn: true,
|
|
15267
15275
|
'gn__search-open': this.searchBarShown,
|
|
15268
|
-
} }, h("nano-drawer", { key: '
|
|
15276
|
+
} }, 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
|
|
15269
15277
|
? bpps.mainMenu.tpl()
|
|
15270
|
-
: '', h("slot", { key: '
|
|
15278
|
+
: '', 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,
|
|
15271
15279
|
(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,
|
|
15272
|
-
(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: '
|
|
15273
|
-
(!!this.searchIndices.length && (h("nano-dropdown", { key: '
|
|
15280
|
+
(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 ||
|
|
15281
|
+
(!!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) => {
|
|
15274
15282
|
this.handleSearchTermChangeEvent(e.detail.value);
|
|
15275
|
-
}, onNanoInput: this.handleSearchTermInputEvent, debounce: 500, value: this._searchValue }, h("nano-icon-button", { key: '
|
|
15283
|
+
}, 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 && [
|
|
15276
15284
|
this.autocompleteResults.hits.map((hit, i) => (h("nano-option", { href: hit.url, class: "gn__search-result", onClick: () => {
|
|
15277
15285
|
searchInsight.sendClick({
|
|
15278
15286
|
index: this.activeIndex.index,
|
|
@@ -15282,13 +15290,13 @@ class GlobalNav {
|
|
|
15282
15290
|
positions: [i + 1],
|
|
15283
15291
|
});
|
|
15284
15292
|
} }, h("span", { innerHTML: this.autocompleteSnippet(hit) })))),
|
|
15285
|
-
h("nano-option", { key: '
|
|
15286
|
-
])))))), h("div", { key: '
|
|
15287
|
-
h("nano-icon-button", { key: '
|
|
15288
|
-
!!this.cartCount && (h("nano-badge", { key: '
|
|
15293
|
+
h("nano-option", { key: 'ca2e52576b2faa6f35c2377591212c7a37c2355e', class: "gn__search-viewall", onNanoSelect: this.onSearchSubmit }, "View all results"),
|
|
15294
|
+
])))))), h("div", { key: '558eea256b3807c8066cfad3d303dfdd23cc7af2', class: "gn__cart" }, this.cartUrl && [
|
|
15295
|
+
h("nano-icon-button", { key: '64fa87c0f21a947bed221ac4cf4f1996cd39f00c', iconName: "light/cart-shopping", label: "View your cart", href: this.cartUrl }),
|
|
15296
|
+
!!this.cartCount && (h("nano-badge", { key: '26f65729803a1f345c83603a481321c86e770e33', theme: "danger" }, this.cartCount > 9 ? '9+' : this.cartCount)),
|
|
15289
15297
|
]), this.breakpoint <= bpps.contact.breakpoint
|
|
15290
15298
|
? bpps.contact.tpl()
|
|
15291
|
-
: '', 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: '
|
|
15299
|
+
: '', 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' }))))));
|
|
15292
15300
|
}
|
|
15293
15301
|
static get assetsDirs() { return ["assets"]; }
|
|
15294
15302
|
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.7",
|
|
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.7"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@algolia/client-search": "^4.22.1",
|