@nanoporetech-digital/components 8.3.2 → 8.4.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.
- 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 +22 -21
- 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 +23 -22
- 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 +22 -21
- 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 +22 -21
- 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 +404 -99
- package/hydrate/index.mjs +404 -99
- 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 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/generate-vue-component.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/index.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/output-vue.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/plugin.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/types.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/utils.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/stencil.config.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/stencil.config.prod.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/testing/mocks/intersection-observer.d.ts +0 -0
- /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/wdio.conf.d.ts +0 -0
@@ -0,0 +1,131 @@
|
|
1
|
+
/*!
|
2
|
+
* Custom elements for Nanopore-Digital Web applications
|
3
|
+
*/
|
4
|
+
import { Build, h, Host, getElement } from '@stencil/core/internal/client';
|
5
|
+
|
6
|
+
// import type { VNode, HTMLStencilElement } from "@stencil/core";
|
7
|
+
const supportsConstructibleStylesheets = (() => {
|
8
|
+
try {
|
9
|
+
return !!new CSSStyleSheet();
|
10
|
+
}
|
11
|
+
catch (_e) {
|
12
|
+
return false;
|
13
|
+
}
|
14
|
+
})();
|
15
|
+
const cacheKeys = new WeakMap();
|
16
|
+
/**
|
17
|
+
* Dynamically create a constructible stylesheet which is applied to the component.
|
18
|
+
* The stylesheet is then cached for future instances of the component.
|
19
|
+
* @usage
|
20
|
+
As a string:
|
21
|
+
```
|
22
|
+
@ConstructableStyle() style = `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
|
23
|
+
```
|
24
|
+
As a function:
|
25
|
+
```
|
26
|
+
@ConstructableStyle() style = () => `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
|
27
|
+
```
|
28
|
+
* @param opts - optional `cacheKeyProperty` - in case an instance of a component could produce different styles based on variables.
|
29
|
+
* @returns `@ConstructableStyle` decorator
|
30
|
+
*/
|
31
|
+
function ConstructibleStyle(opts = {}) {
|
32
|
+
return (target, propertyKey) => {
|
33
|
+
if (!opts.cacheKeyProperty) {
|
34
|
+
opts.cacheKeyProperty = propertyKey;
|
35
|
+
}
|
36
|
+
const { componentWillLoad, render, componentWillRender } = target;
|
37
|
+
if (supportsConstructibleStylesheets && !Build.isServer) {
|
38
|
+
// adds a constructible stylesheet to the component
|
39
|
+
const addStylesheet = (instance) => {
|
40
|
+
if (!instance[opts.cacheKeyProperty] ||
|
41
|
+
(cacheKeys.get(instance) &&
|
42
|
+
cacheKeys.get(instance) === instance[opts.cacheKeyProperty]))
|
43
|
+
return;
|
44
|
+
cacheKeys.set(instance, instance[opts.cacheKeyProperty]);
|
45
|
+
const host = getElement(instance);
|
46
|
+
const cssText = typeof instance[propertyKey] === 'function'
|
47
|
+
? instance[propertyKey]()
|
48
|
+
: instance[propertyKey];
|
49
|
+
const root = (host.shadowRoot || document);
|
50
|
+
root.adoptedStyleSheets = [
|
51
|
+
...(root.adoptedStyleSheets || []),
|
52
|
+
getOrCreateStylesheet(instance, target, cssText, opts),
|
53
|
+
];
|
54
|
+
};
|
55
|
+
target.componentWillLoad = function () {
|
56
|
+
const willLoadResult = componentWillLoad && componentWillLoad.call(this);
|
57
|
+
addStylesheet(this);
|
58
|
+
return willLoadResult;
|
59
|
+
};
|
60
|
+
target.componentWillRender = function () {
|
61
|
+
const willRenderResult = componentWillRender && componentWillRender.call(this);
|
62
|
+
addStylesheet(this);
|
63
|
+
return willRenderResult;
|
64
|
+
};
|
65
|
+
}
|
66
|
+
else {
|
67
|
+
// adds a style element to the component
|
68
|
+
target.render = function () {
|
69
|
+
const cssText = typeof this[propertyKey] === 'function'
|
70
|
+
? this[propertyKey]()
|
71
|
+
: this[propertyKey];
|
72
|
+
let renderedNode = render.call(this);
|
73
|
+
if (isHost(renderedNode)) {
|
74
|
+
appendStyleToHost(renderedNode, target.constructor.name, cssText);
|
75
|
+
}
|
76
|
+
else {
|
77
|
+
renderedNode = h(Host, null, renderedNode);
|
78
|
+
if (!('attachShadow' in HTMLElement.prototype)) {
|
79
|
+
appendStyleToHost(renderedNode, target.constructor.name, cssText);
|
80
|
+
}
|
81
|
+
else {
|
82
|
+
if (!target.__constructableStyle) {
|
83
|
+
const style = document.createElement('style');
|
84
|
+
style.setAttribute('type', 'text/css');
|
85
|
+
style.setAttribute('constructible-style', target.constructor.name);
|
86
|
+
style.innerHTML = cssText;
|
87
|
+
target.__constructableStyle = style;
|
88
|
+
document.head.appendChild(style);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
return renderedNode;
|
93
|
+
};
|
94
|
+
}
|
95
|
+
};
|
96
|
+
}
|
97
|
+
function appendStyleToHost(node, targetName, cssText) {
|
98
|
+
(getHostChildren(node) || []).push(h("style", { type: "text/css", "constructible-style": targetName }, cssText));
|
99
|
+
}
|
100
|
+
function getOrCreateStylesheet(instance, target, cssText, opts) {
|
101
|
+
if (!target.__constructableStyle) {
|
102
|
+
target.__constructableStyle = {};
|
103
|
+
}
|
104
|
+
const key = instance[opts.cacheKeyProperty];
|
105
|
+
if (!target.__constructableStyle[key]) {
|
106
|
+
target.__constructableStyle[key] = new CSSStyleSheet();
|
107
|
+
target.__constructableStyle[key].replace(cssText);
|
108
|
+
}
|
109
|
+
return target.__constructableStyle[key];
|
110
|
+
}
|
111
|
+
function isHost(node) {
|
112
|
+
for (const prop in node) {
|
113
|
+
if (prop in node) {
|
114
|
+
if (node[prop] === Host) {
|
115
|
+
return true;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
return false;
|
120
|
+
}
|
121
|
+
function getHostChildren(node) {
|
122
|
+
for (const prop in node) {
|
123
|
+
if (prop in node) {
|
124
|
+
if (Array.isArray(node[prop])) {
|
125
|
+
return node[prop];
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
export { ConstructibleStyle as C };
|
@@ -131,7 +131,9 @@ const NanoDetails = /*@__PURE__*/ proxyCustomElement(class NanoDetails extends H
|
|
131
131
|
if (this.stateChanging)
|
132
132
|
return;
|
133
133
|
for (const change of changes) {
|
134
|
-
if (change.type === 'attributes' &&
|
134
|
+
if (change.type === 'attributes' &&
|
135
|
+
change.attributeName === 'open' &&
|
136
|
+
!this.disabled) {
|
135
137
|
this.open = this.detailsEl.open;
|
136
138
|
}
|
137
139
|
}
|
@@ -159,13 +161,13 @@ const NanoDetails = /*@__PURE__*/ proxyCustomElement(class NanoDetails extends H
|
|
159
161
|
}
|
160
162
|
}
|
161
163
|
render() {
|
162
|
-
return (h(Host, { key: '
|
164
|
+
return (h(Host, { key: '1cbedc078a3390a3ad82b99ac0f37e8ea0f8d480', class: "nano-details" }, h("details", { key: '22659218ba7d1ec936523ff33c7ed2a1efb2af74', part: "base", ref: (d) => (this.detailsEl = d), class: {
|
163
165
|
details: true,
|
164
166
|
disabled: this.disabled,
|
165
|
-
} }, h("summary", { key: '
|
167
|
+
} }, h("summary", { key: '3a7cd64e7d8e2b5235b7c0f7d58c434cb2a52469', part: "header", "aria-controls": "content", "aria-expanded": this.open ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', tabindex: this.disabled ? '-1' : '0', id: "header", role: "button", class: "header", ref: (s) => (this.headerEl = s), onKeyDown: this.onKeyDown, onClick: this.onMouseDown }, this.slotCtrl.has('icon-start') && (h("span", { key: '4a8de08dca34823e162019e2d4dddef2ed2c123d', part: "icon icon--start", class: "icon icon--start" }, h("slot", { key: 'cf6ea31f1685afa4bde64a6cbdef43cb0d0a053a', name: "icon-start" }))), h("div", { key: '0b11c544cfbb5852dfeae66b482154f1780a2569', part: "label", class: "label" }, this.label ? this.label : h("slot", { name: "label" })), h("span", { key: '5470af7891318c513870c473a8ad1f501174f51b', part: "icon icon--end", class: "icon icon--end" }, this.open ? (h("slot", { name: "icon-collapse" })) : (h("slot", { name: "icon-expand" })), h("slot", { key: '45960716eeec5d5ad08b63fd536608fcd33ab8f2', name: "icon-end" }, !this.slotCtrl.has('icon-start') &&
|
166
168
|
!this.slotCtrl.has('icon-end') &&
|
167
169
|
!this.slotCtrl.has('icon-expand') &&
|
168
|
-
!this.slotCtrl.has('icon-collapse') && (h("nano-icon", { key: '
|
170
|
+
!this.slotCtrl.has('icon-collapse') && (h("nano-icon", { key: '5357b61cb197dc4a1ceccf415a34defdfeb6b290', class: "default-icon", name: "light/chevron-down" }))))), h("div", { key: 'aa7f850c8415c2cd40fd7a965fba8eb98fca62b5', part: "body", class: "body", ref: (div) => (this.bodyEl = div), role: "region", "aria-labelledby": "header" }, h("div", { key: 'e98e6a68e4c15525b4377d4229fb4a1855650732', part: "content-wrapper", class: "content-wrapper" }, h("div", { key: '6710e302f7e2a5987ccd6703ea3c6cc0bf705d23', part: "content", class: "content", id: "content" }, h("slot", { key: '891525e66383979e621787f766bcfbcea78a9630' })))))));
|
169
171
|
}
|
170
172
|
static get watchers() { return {
|
171
173
|
"open": ["toggleClick"]
|
@@ -314,12 +314,12 @@ const GlobalSearchResults = /*@__PURE__*/ proxyCustomElement(class GlobalSearchR
|
|
314
314
|
this.ro.observe(this.el);
|
315
315
|
}
|
316
316
|
render() {
|
317
|
-
return (h(Host, { key: '
|
317
|
+
return (h(Host, { key: 'c88b1cd5b5fcf63cc3961cc3e190fe4432349b03', class: {
|
318
318
|
small: this.currentWidth < 780,
|
319
319
|
'nano-global-search-results': true,
|
320
|
-
}, dir: this.el.ownerDocument.dir === 'rtl' ? 'rtl' : undefined }, h("nano-algolia", { key: '
|
320
|
+
}, dir: this.el.ownerDocument.dir === 'rtl' ? 'rtl' : undefined }, h("nano-algolia", { key: 'e27f4efbd7405ca852f9e6ea96d3a53b4ded8041', storeId: this.queryId, storeMethod: "url-hash-push", class: "main-search__wrap sc-nano-global-search-results", ref: (ele) => requestAnimationFrame(() => (this.algoliaEle = ele)), id: "main-search",
|
321
321
|
// @ts-expect-error this bubbles from nano-algolia-filter
|
322
|
-
onNanoFilterChanged: () => this.handleNanoFilterChanged() }, h("template", { key: '
|
322
|
+
onNanoFilterChanged: () => this.handleNanoFilterChanged() }, h("template", { key: 'a614cc2ad29144b19555cf2106b8a38982817918', slot: "template" },
|
323
323
|
/* html */ `<div class="main-search sc-nano-global-search-results">
|
324
324
|
<nano-algolia-results id="main-search-results" class="main-search__results sc-nano-global-search-results" infinite-scroll>
|
325
325
|
<script type="text/template" slot="start-template">
|
@@ -697,7 +697,7 @@ const GlobalSearchResults = /*@__PURE__*/ proxyCustomElement(class GlobalSearchR
|
|
697
697
|
</div>
|
698
698
|
</div>
|
699
699
|
{{ /if }}
|
700
|
-
</div>`), h("div", { key: '
|
700
|
+
</div>`), h("div", { key: 'c759117717909ec2ca8973bd4de0175e06fd73fa', slot: "output" }), h("slot", { key: '45d84a723310889c1acb75b2563839e6bd164296' }))));
|
701
701
|
}
|
702
702
|
static get watchers() { return {
|
703
703
|
"algoliaEle": ["handleAlgoliaCredsChange", "handleAlgoliaIndexChange", "handleAlgoliaEleChange"],
|
package/dist/components/grid.js
CHANGED
@@ -1,133 +1,9 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
|
7
|
-
// import type { VNode, HTMLStencilElement } from "@stencil/core";
|
8
|
-
const supportsConstructibleStylesheets = (() => {
|
9
|
-
try {
|
10
|
-
return !!new CSSStyleSheet();
|
11
|
-
}
|
12
|
-
catch (_e) {
|
13
|
-
return false;
|
14
|
-
}
|
15
|
-
})();
|
16
|
-
const cacheKeys = new WeakMap();
|
17
|
-
/**
|
18
|
-
* Dynamically create a constructible stylesheet which is applied to the component.
|
19
|
-
* The stylesheet is then cached for future instances of the component.
|
20
|
-
* @usage
|
21
|
-
As a string:
|
22
|
-
```
|
23
|
-
@ConstructableStyle() style = `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
|
24
|
-
```
|
25
|
-
As a function:
|
26
|
-
```
|
27
|
-
@ConstructableStyle() style = () => `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
|
28
|
-
```
|
29
|
-
* @param opts - optional `cacheKeyProperty` - in case an instance of a component could produce different styles based on variables.
|
30
|
-
* @returns `@ConstructableStyle` decorator
|
31
|
-
*/
|
32
|
-
function ConstructibleStyle(opts = {}) {
|
33
|
-
return (target, propertyKey) => {
|
34
|
-
if (!opts.cacheKeyProperty) {
|
35
|
-
opts.cacheKeyProperty = propertyKey;
|
36
|
-
}
|
37
|
-
const { componentWillLoad, render, componentWillRender } = target;
|
38
|
-
if (!componentWillLoad)
|
39
|
-
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.`);
|
40
|
-
if (supportsConstructibleStylesheets && !Build.isServer) {
|
41
|
-
const addStylesheet = (instance) => {
|
42
|
-
if (!instance[opts.cacheKeyProperty] ||
|
43
|
-
(cacheKeys.get(instance) &&
|
44
|
-
cacheKeys.get(instance) === instance[opts.cacheKeyProperty]))
|
45
|
-
return;
|
46
|
-
cacheKeys.set(instance, instance[opts.cacheKeyProperty]);
|
47
|
-
const host = getElement(instance);
|
48
|
-
const cssText = typeof instance[propertyKey] === 'function'
|
49
|
-
? instance[propertyKey]()
|
50
|
-
: instance[propertyKey];
|
51
|
-
const root = (host.shadowRoot || document);
|
52
|
-
root.adoptedStyleSheets = [
|
53
|
-
...(root.adoptedStyleSheets || []),
|
54
|
-
getOrCreateStylesheet(instance, target, cssText, opts),
|
55
|
-
];
|
56
|
-
};
|
57
|
-
target.componentWillLoad = function () {
|
58
|
-
const willLoadResult = componentWillLoad && componentWillLoad.call(this);
|
59
|
-
addStylesheet(this);
|
60
|
-
return willLoadResult;
|
61
|
-
};
|
62
|
-
target.componentWillRender = function () {
|
63
|
-
const willRenderResult = componentWillRender && componentWillRender.call(this);
|
64
|
-
addStylesheet(this);
|
65
|
-
return willRenderResult;
|
66
|
-
};
|
67
|
-
}
|
68
|
-
else {
|
69
|
-
target.render = function () {
|
70
|
-
const cssText = typeof this[propertyKey] === 'function'
|
71
|
-
? this[propertyKey]()
|
72
|
-
: this[propertyKey];
|
73
|
-
let renderedNode = render.call(this);
|
74
|
-
if (isHost(renderedNode)) {
|
75
|
-
appendStyleToHost(renderedNode, target.constructor.name, cssText);
|
76
|
-
}
|
77
|
-
else {
|
78
|
-
renderedNode = h(Host, null, renderedNode);
|
79
|
-
if (!('attachShadow' in HTMLElement.prototype)) {
|
80
|
-
appendStyleToHost(renderedNode, target.constructor.name, cssText);
|
81
|
-
}
|
82
|
-
else {
|
83
|
-
if (!target.__constructableStyle) {
|
84
|
-
const style = document.createElement('style');
|
85
|
-
style.setAttribute('type', 'text/css');
|
86
|
-
style.setAttribute('constructible-style', target.constructor.name);
|
87
|
-
style.innerHTML = cssText;
|
88
|
-
target.__constructableStyle = style;
|
89
|
-
document.head.appendChild(style);
|
90
|
-
}
|
91
|
-
}
|
92
|
-
}
|
93
|
-
return renderedNode;
|
94
|
-
};
|
95
|
-
}
|
96
|
-
};
|
97
|
-
}
|
98
|
-
function appendStyleToHost(node, targetName, cssText) {
|
99
|
-
(getHostChildren(node) || []).push(h("style", { type: "text/css", "constructible-style": targetName }, cssText));
|
100
|
-
}
|
101
|
-
function getOrCreateStylesheet(instance, target, cssText, opts) {
|
102
|
-
if (!target.__constructableStyle) {
|
103
|
-
target.__constructableStyle = {};
|
104
|
-
}
|
105
|
-
const key = instance[opts.cacheKeyProperty];
|
106
|
-
if (!target.__constructableStyle[key]) {
|
107
|
-
target.__constructableStyle[key] = new CSSStyleSheet();
|
108
|
-
target.__constructableStyle[key].replace(cssText);
|
109
|
-
}
|
110
|
-
return target.__constructableStyle[key];
|
111
|
-
}
|
112
|
-
function isHost(node) {
|
113
|
-
for (const prop in node) {
|
114
|
-
if (prop in node) {
|
115
|
-
if (node[prop] === Host) {
|
116
|
-
return true;
|
117
|
-
}
|
118
|
-
}
|
119
|
-
}
|
120
|
-
return false;
|
121
|
-
}
|
122
|
-
function getHostChildren(node) {
|
123
|
-
for (const prop in node) {
|
124
|
-
if (prop in node) {
|
125
|
-
if (Array.isArray(node[prop])) {
|
126
|
-
return node[prop];
|
127
|
-
}
|
128
|
-
}
|
129
|
-
}
|
130
|
-
}
|
4
|
+
import { proxyCustomElement, HTMLElement, Host } from '@stencil/core/internal/client';
|
5
|
+
import { C as ConstructibleStyle } from './constructible-style.js';
|
6
|
+
import { h } from './renderer.js';
|
131
7
|
|
132
8
|
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%}";
|
133
9
|
|
@@ -145,7 +21,7 @@ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
145
21
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
146
22
|
return Reflect.metadata(k, v);
|
147
23
|
};
|
148
|
-
const Grid = /*@__PURE__*/ proxyCustomElement(class Grid extends HTMLElement
|
24
|
+
const Grid = /*@__PURE__*/ proxyCustomElement(class Grid extends HTMLElement {
|
149
25
|
constructor() {
|
150
26
|
super();
|
151
27
|
this.__registerHost();
|
@@ -295,7 +171,7 @@ const Grid = /*@__PURE__*/ proxyCustomElement(class Grid extends HTMLElement$1 {
|
|
295
171
|
this.constructSizeArray();
|
296
172
|
}
|
297
173
|
render() {
|
298
|
-
return (h
|
174
|
+
return (h(Host, { key: '56ae0bda8aedac96841dd8cf308117ef1aaa9824', class: "nano-grid" }, h("div", { key: '6fffc201e4261b8f6c458bd044b31fe12cd9045e', part: "grid", class: "grid", "cache-key": this.cacheKey }, h("slot", { key: 'a6d7473ba9a8ffd21c4df95c2028e67026ffd1a5' })), this.showHelper && (h("div", { key: '275145f83283b504171fdc973741a1398cca6317', class: "grid grid--helper", part: "helper", "cache-key": this.cacheKey }, [...Array(24)].map(() => (h("div", { class: "grid__helper-item" })))))));
|
299
175
|
}
|
300
176
|
static get watchers() { return {
|
301
177
|
"sTpl": ["constructSizeArray"],
|
package/dist/components/icon.js
CHANGED
@@ -67,7 +67,7 @@ const isStr = (val) => typeof val === 'string';
|
|
67
67
|
const toLower = (val) => val.toLowerCase();
|
68
68
|
|
69
69
|
const validateContent = (svgContent) => {
|
70
|
-
if (svgContent) {
|
70
|
+
if (svgContent && document) {
|
71
71
|
const div = document.createElement('div');
|
72
72
|
div.innerHTML = svgContent;
|
73
73
|
// setup this way to ensure it works on our buddy IE
|
@@ -307,7 +307,7 @@ const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends HTMLElement {
|
|
307
307
|
(this.name.indexOf('arrow') > -1 ||
|
308
308
|
this.name.indexOf('chevron') > -1) &&
|
309
309
|
this.isRtl());
|
310
|
-
return (h(Host, { key: '
|
310
|
+
return (h(Host, { key: '0bc1c17119f0e49b9798a1b61a4a768f6406129f', class: {
|
311
311
|
loading: this.isLoading,
|
312
312
|
'flip-rtl': !!flipRtl,
|
313
313
|
'nano-icon': true,
|
package/dist/components/img.js
CHANGED
@@ -142,16 +142,16 @@ const Img = /*@__PURE__*/ proxyCustomElement(class Img extends HTMLElement {
|
|
142
142
|
const bgStyle = this.loadSrc
|
143
143
|
? { 'background-image': `url(${this.loadSrc})` }
|
144
144
|
: {};
|
145
|
-
return (h(Host, { key: '
|
145
|
+
return (h(Host, { key: 'f8774fc9ad6e94727378337c2f405a068a7c88fb', class: "nano-img" }, h("div", { key: '15ae3c8ea944c8f0eab8616194f44fc1033e8fe2', class: "img" }, h("div", { key: 'ec3f433ded23dcb7fc57e53b0ecaba789ba492e0', class: "img__loader n-loader-skeleton" }, "Loading"), !!this.background && (h("div", { key: '8f4e8c9d595a31b477b0ae3f9e135f6b5c3f0e69', class: {
|
146
146
|
loaded: this.hasLoaded,
|
147
147
|
img__bg: true,
|
148
148
|
'no-height': this.autoHeight === 'image',
|
149
|
-
}, style: bgStyle }, h("slot", { key: '
|
149
|
+
}, style: bgStyle }, h("slot", { key: '29bab2a5c86b3dfe18db8936af77674c44d743d0' }))), h("img", { key: 'e6731b48ed137d97aa98e64dc55488d56724f672', class: {
|
150
150
|
img__image: true,
|
151
151
|
loaded: this.hasLoaded,
|
152
152
|
hide: this.background,
|
153
153
|
'no-height': this.autoHeight === 'content',
|
154
|
-
}, decoding: "async", src: Build.isServer ? this.src : this.loadSrc, loading: Build.isServer && this.lazy ? 'lazy' : undefined, alt: this.alt, onLoad: this.onLoad, onError: this.loadError }), h("nano-resize-observe", { key: '
|
154
|
+
}, decoding: "async", src: Build.isServer ? this.src : this.loadSrc, loading: Build.isServer && this.lazy ? 'lazy' : undefined, alt: this.alt, onLoad: this.onLoad, onError: this.loadError }), h("nano-resize-observe", { key: '0f1ce7d8b82adc19bfa459ff2adae708a4263c6e', class: "img__observer", onNanoResizeStateChange: this.onResize, states: this.imgStates }))));
|
155
155
|
}
|
156
156
|
static get watchers() { return {
|
157
157
|
"_src": ["_srcChanged"],
|
@@ -320,7 +320,7 @@ const MaskedOverflow = /*@__PURE__*/ proxyCustomElement(class MaskedOverflow ext
|
|
320
320
|
}
|
321
321
|
}
|
322
322
|
render() {
|
323
|
-
return (h(Host, { key: '
|
323
|
+
return (h(Host, { key: '49485c7d6a96e8dd122f862abd2bd2f95b2343e7', dir: this.isRtl ? 'rtl' : null, class: "nano-masked-overflow", "has-scroll-controls": this.hasScrollControls }, h("div", { key: 'acd0541992b9dda0c1ab6414e67cd8a71f429918', part: "base", class: {
|
324
324
|
onav: true,
|
325
325
|
[`onav--${this.orientation}`]: true,
|
326
326
|
'onav--has-scroll-controls': this.hasScrollControls,
|
@@ -329,12 +329,12 @@ const MaskedOverflow = /*@__PURE__*/ proxyCustomElement(class MaskedOverflow ext
|
|
329
329
|
'onav--no-transitions': this.instantReCalc,
|
330
330
|
'onnav--has-indicator': this.showIndicator,
|
331
331
|
'onnav--hide-scrollbars': this.hideScrollbars && this.hideScrollbars !== 'false',
|
332
|
-
}, onClick: this.handleClick, onKeyDown: this.handleKeyDown }, h("div", { key: '
|
332
|
+
}, onClick: this.handleClick, onKeyDown: this.handleKeyDown }, h("div", { key: 'ba25b3551a2b6be4906d538cbaabf0ba8cb859f6', class: "onav__nav" }, this.scrollControls && (h("nano-icon-button", { key: '72ca6ae1ef0300fc91a95d347702bac94fec97ac', part: "scroll-button scroll-button-prev", class: {
|
333
333
|
'onav__scroll-button': true,
|
334
334
|
'onav__scroll-button--start': true,
|
335
335
|
}, ref: (btn) => (this.startBtn = btn), onClick: () => this.handleBtnClick(false), label: "Click to scroll", iconName: this.orientation === 'horizontal'
|
336
336
|
? 'light/chevron-left'
|
337
|
-
: 'light/chevron-up' })), h("div", { key: '
|
337
|
+
: 'light/chevron-up' })), h("div", { key: '34893f5e055e8b44a78cb0706e974ee45261bdb8', part: "scroller", ref: (el) => (this.nav = el), class: "onav__scroller", onScroll: this.handleScroll, tabindex: this.hasScrollControls ? 0 : undefined, role: "region", "aria-label": this.label || undefined }, h("div", { key: '19ea27abc4878c5ab034e8ac0ee7085f19607a92', part: "items", ref: (el) => (this.itemContainer = el), class: "onav__items" }, this.showIndicator && (h("div", { key: '6cfdb83598367d649e6705fe709e89d8a8b505a6', part: "indicator", ref: (el) => (this.activeIndicator = el), class: "onav__active-indicator" })), h("slot", { key: '43f3164d6c962f951ac672f79d48943c44e0514e', onSlotchange: this.slotChangeHandler }))), this.scrollControls && (h("nano-icon-button", { key: 'eaa09e8faa9343fca660d1f2e0a4b5366b7c6668', part: "scroll-button scroll-button-next", class: {
|
338
338
|
'onav__scroll-button': true,
|
339
339
|
'onav__scroll-button--end': true,
|
340
340
|
}, ref: (btn) => (this.endBtn = btn), onClick: () => this.handleBtnClick(true), label: "Click to scroll", iconName: this.orientation === 'horizontal'
|
@@ -1,62 +1,7 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import {
|
5
|
-
import { t as transformTag, h } from './renderer.js';
|
6
|
-
import { g as getDirectChildren } from './dom.js';
|
7
|
-
|
8
|
-
const accordionCss = ":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{display:contents}";
|
9
|
-
|
10
|
-
const NanoAccordion$1 = /*@__PURE__*/ proxyCustomElement(class NanoAccordion extends HTMLElement {
|
11
|
-
constructor() {
|
12
|
-
super();
|
13
|
-
this.__registerHost();
|
14
|
-
this.__attachShadow();
|
15
|
-
this.nanoToggle = createEvent(this, "nanoToggle", 7);
|
16
|
-
}
|
17
|
-
itemOpened;
|
18
|
-
get el() { return this; }
|
19
|
-
/** Fires when accordion elements toggle */
|
20
|
-
nanoToggle;
|
21
|
-
onToggleHandler(event) {
|
22
|
-
if (event.target?.tagName !== 'NANO-DETAILS')
|
23
|
-
return;
|
24
|
-
event.stopPropagation();
|
25
|
-
const items = getDirectChildren(this.el, transformTag('nano-details')) ||
|
26
|
-
this.el.querySelectorAll(transformTag('nano-details'));
|
27
|
-
items.forEach((item, i) => {
|
28
|
-
if (item !== event.target)
|
29
|
-
item.open = false;
|
30
|
-
else
|
31
|
-
this.itemOpened = i;
|
32
|
-
});
|
33
|
-
this.nanoToggle.emit(event.target);
|
34
|
-
}
|
35
|
-
onClosedHandler(event) {
|
36
|
-
event.stopPropagation();
|
37
|
-
this.itemOpened = null;
|
38
|
-
this.nanoToggle.emit();
|
39
|
-
}
|
40
|
-
render() {
|
41
|
-
return h("slot", { key: 'ec9331ce0686c1234021e58af9a456aa267e9247' });
|
42
|
-
}
|
43
|
-
static get style() { return accordionCss; }
|
44
|
-
}, [257, "nano-accordion", {
|
45
|
-
"itemOpened": [32]
|
46
|
-
}, [[0, "nanoOpen", "onToggleHandler"], [0, "nanoClose", "onClosedHandler"]]]);
|
47
|
-
function defineCustomElement$1() {
|
48
|
-
if (typeof customElements === "undefined") {
|
49
|
-
return;
|
50
|
-
}
|
51
|
-
const components = ["nano-accordion"];
|
52
|
-
components.forEach(tagName => { switch (tagName) {
|
53
|
-
case "nano-accordion":
|
54
|
-
if (!customElements.get(tagName)) {
|
55
|
-
customElements.define(tagName, NanoAccordion$1);
|
56
|
-
}
|
57
|
-
break;
|
58
|
-
} });
|
59
|
-
}
|
4
|
+
import { N as NanoAccordion$1, d as defineCustomElement$1 } from './accordion.js';
|
60
5
|
|
61
6
|
const NanoAccordion = NanoAccordion$1;
|
62
7
|
const defineCustomElement = defineCustomElement$1;
|
@@ -15,6 +15,20 @@ import { d as defineCustomElement$4 } from './resize-observe.js';
|
|
15
15
|
import { d as defineCustomElement$3 } from './spinner.js';
|
16
16
|
import { d as defineCustomElement$2 } from './tooltip.js';
|
17
17
|
|
18
|
+
function perMark(name, end = false) {
|
19
|
+
if (!performance || false)
|
20
|
+
return;
|
21
|
+
if (end) {
|
22
|
+
performance?.mark('end' + name);
|
23
|
+
performance?.measure(name, 'start' + name, 'end' + name);
|
24
|
+
const entries = performance?.getEntriesByName(name);
|
25
|
+
console.info(entries[entries.length ? entries.length - 1 : 0]);
|
26
|
+
}
|
27
|
+
else {
|
28
|
+
performance?.mark('start' + name);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
18
32
|
const CSSNAMESPACE = 'nano-tbl';
|
19
33
|
|
20
34
|
const isInstanceOf = (value, className) => {
|
@@ -1386,6 +1400,7 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1386
1400
|
const sortEvent = this.nanoTblBeforeSort.emit({ column: column, order });
|
1387
1401
|
if (sortEvent.defaultPrevented)
|
1388
1402
|
return;
|
1403
|
+
perMark('sort');
|
1389
1404
|
this.currentSort = order + ':' + column;
|
1390
1405
|
// doesn't make sense to leave user in place for a sort
|
1391
1406
|
this.scrollToTop(element);
|
@@ -1435,17 +1450,20 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1435
1450
|
return { ...c, order: null };
|
1436
1451
|
});
|
1437
1452
|
this.nanoTblAfterSort.emit({ column: column, order });
|
1453
|
+
perMark('sort', true);
|
1438
1454
|
}
|
1439
1455
|
async searchStart() {
|
1440
1456
|
this._loading = true;
|
1441
1457
|
const sortEvent = this.nanoTblBeforeSearch.emit({ term: this.searchTerm });
|
1442
1458
|
if (sortEvent.defaultPrevented)
|
1443
1459
|
return;
|
1460
|
+
perMark('search');
|
1444
1461
|
// doesn't make sense to leave user in place for a search
|
1445
1462
|
this.scrollToTop();
|
1446
1463
|
try {
|
1447
1464
|
await storeSearch(this.host, this.searchTerm);
|
1448
1465
|
this.nanoTblAfterSearch.emit({ term: this.searchTerm });
|
1466
|
+
perMark('search', true);
|
1449
1467
|
}
|
1450
1468
|
catch (e) {
|
1451
1469
|
console.warn('search failed', e);
|
@@ -1472,6 +1490,7 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1472
1490
|
const sortEvent = this.nanoTblBeforeFilter.emit({ filters: this.filters });
|
1473
1491
|
if (sortEvent.defaultPrevented)
|
1474
1492
|
return;
|
1493
|
+
perMark('filter');
|
1475
1494
|
this.currentFilters = JSON.stringify(this.filters);
|
1476
1495
|
// doesn't make sense to leave user in place for a search
|
1477
1496
|
this.scrollToTop();
|
@@ -1526,6 +1545,7 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1526
1545
|
});
|
1527
1546
|
await storeFilter(this.host, this.filters);
|
1528
1547
|
this.nanoTblAfterFilter.emit({ filters: this.filters });
|
1548
|
+
perMark('filter', true);
|
1529
1549
|
}
|
1530
1550
|
/** Scrolls to the top immediately - used whilst sorting / filtering */
|
1531
1551
|
scrollToTop(element) {
|
@@ -1561,6 +1581,7 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1561
1581
|
setInitialBlockDimension() {
|
1562
1582
|
if (!this.blockElements?.length)
|
1563
1583
|
return;
|
1584
|
+
perMark('blockDims');
|
1564
1585
|
const testForDimensions = async () => {
|
1565
1586
|
await this.setMeasureElement();
|
1566
1587
|
if (this.unitHeight)
|
@@ -1586,6 +1607,8 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1586
1607
|
});
|
1587
1608
|
// we're all finished.
|
1588
1609
|
dimensionsReady.then(() => {
|
1610
|
+
perMark('blockDims', true);
|
1611
|
+
perMark('init', true);
|
1589
1612
|
requestAnimationFrame(() => (this.isReady = true));
|
1590
1613
|
});
|
1591
1614
|
}
|
@@ -1620,6 +1643,7 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1620
1643
|
this.blocks = [];
|
1621
1644
|
return;
|
1622
1645
|
}
|
1646
|
+
perMark('setBlocks');
|
1623
1647
|
// this.ignoreIO = true;
|
1624
1648
|
let i = 1;
|
1625
1649
|
const l = this.virtualTotalItems > dRows.length
|
@@ -1642,6 +1666,7 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1642
1666
|
blocks.push({ rows, __uuid: cyrb53(rows.map((b) => b.__uuid).join()) });
|
1643
1667
|
}
|
1644
1668
|
this.blocks = blocks;
|
1669
|
+
perMark('setBlocks', true);
|
1645
1670
|
}
|
1646
1671
|
/**
|
1647
1672
|
* Returns a block render height.
|
@@ -1691,6 +1716,7 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1691
1716
|
*/
|
1692
1717
|
scrollHandler = () => {
|
1693
1718
|
let scrollPos = 0;
|
1719
|
+
perMark('scrollHandler');
|
1694
1720
|
// don't listen if this table isn't in the viewport
|
1695
1721
|
if (!this.store?.general.state.isActive || !this.rows)
|
1696
1722
|
return;
|
@@ -1728,6 +1754,7 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1728
1754
|
}
|
1729
1755
|
blockIndex++;
|
1730
1756
|
}
|
1757
|
+
perMark('scrollHandler', true);
|
1731
1758
|
});
|
1732
1759
|
};
|
1733
1760
|
/** Process slotted content */
|
@@ -1756,6 +1783,7 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1756
1783
|
}
|
1757
1784
|
// Component lifecycle
|
1758
1785
|
async componentWillLoad() {
|
1786
|
+
perMark('init');
|
1759
1787
|
// setup stores
|
1760
1788
|
this.store = await generateStore(this.host, this.columns, this.scrollParent, this.isReady);
|
1761
1789
|
this.handleRowsChange();
|
@@ -1797,9 +1825,11 @@ const NanoDataTable$1 = /*@__PURE__*/ proxyCustomElement(class NanoDataTable ext
|
|
1797
1825
|
return false;
|
1798
1826
|
}
|
1799
1827
|
componentWillRender() {
|
1828
|
+
perMark('render');
|
1800
1829
|
}
|
1801
1830
|
componentDidRender() {
|
1802
1831
|
this.setMeasureElement().then(() => this.setBlockHeight());
|
1832
|
+
perMark('render', true);
|
1803
1833
|
}
|
1804
1834
|
disconnectedCallback() {
|
1805
1835
|
if (!this.activeWatcherIo)
|
@@ -508,7 +508,9 @@ const FieldValidator = /*@__PURE__*/ proxyCustomElement(class FieldValidator ext
|
|
508
508
|
this._valid = this.activeForm.checkValidity();
|
509
509
|
this.internalValidate = false;
|
510
510
|
}
|
511
|
-
|
511
|
+
setTimeout(() => {
|
512
|
+
this.nanoPayloadChange.emit(this._store.state);
|
513
|
+
}, 20);
|
512
514
|
};
|
513
515
|
/**
|
514
516
|
* Handles nano field value changes and passes to store
|
@@ -601,7 +603,7 @@ const FieldValidator = /*@__PURE__*/ proxyCustomElement(class FieldValidator ext
|
|
601
603
|
this.activeForm.removeEventListener('invalid', this.handleFormInvalid, true);
|
602
604
|
}
|
603
605
|
render() {
|
604
|
-
return (h(Host, { key: '
|
606
|
+
return (h(Host, { key: 'bb60437392e410d528560b9a8a63c58b13f25495', class: "nano-field-validator" }, this.userForm && h("slot", { key: '7e9ff598dce291e80b53638453a8544398382cdd' }), !this.userForm && (h("form", { key: '68241c190268172ff742839ff57a5ac1ff66ca8e', ref: (f) => (this.activeForm = f) }, h("slot", { key: 'e89427bf668eb47217accdb2844d14cb4c3abd36' })))));
|
605
607
|
}
|
606
608
|
static get watchers() { return {
|
607
609
|
"userForm": ["userFormChange"],
|