@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
@@ -0,0 +1,101 @@
|
|
1
|
+
/*!
|
2
|
+
* Custom elements for Nanopore-Digital Web applications
|
3
|
+
*/
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
var index = require('./index-DGttnXif.js');
|
7
|
+
var renderer = require('./renderer-B9M1kXq8.js');
|
8
|
+
|
9
|
+
const stepAccordionCss = ":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:block}.nano-details{--padding:0;--btn-bg-color--hover:transparent;--btn-bg-color--active:transparent;border:none;margin-block-end:var(--nano-spacing-sm)}.nano-details::part(base){display:grid;grid-template-rows:auto auto;grid-template-columns:auto 1fr;gap:var(--nano-spacing-sm) 1.625rem}.nano-details.step--grid-working::part(base)::before{content:\"\";display:block;grid-column:1;grid-row:2;inline-size:1rem;min-block-size:1rem;border-inline-end:2px solid var(--nano-color-neutral-300)}.nano-details.step--grid-working::part(base)::after{content:\"\";grid-column:1;grid-row:2;inline-size:0.4rem;block-size:0.4rem;place-self:end end;translate:-50% 0;inset-inline-start:calc(50% - 2.5px);position:relative;border-inline-end:2px solid var(--nano-color-neutral-300);border-block-end:2px solid var(--nano-color-neutral-300);rotate:45deg}.nano-details:last-of-type::part(base)::before{min-block-size:0}.nano-details:last-of-type::part(base)::after{display:none}.nano-details::part(header){grid-column:1/-1;grid-row:1;display:inline-flex;gap:var(--nano-spacing-sm)}.nano-details::part(body){grid-column:2;grid-row:2}.nano-details::part(content-wrapper){padding:1px}.nano-details.step--grid-not-working::part(header){padding-block-end:var(--nano-spacing-sm)}.nano-details.step--grid-not-working::part(body){padding:0 0 0 2.5625rem}.step .step-header{display:inline-flex;gap:var(--nano-spacing-sm);align-items:center}.step .step-icon{display:inline-flex;align-items:center;justify-content:center;inline-size:2rem;block-size:2rem;border-radius:var(--nano-border-radius-circle);background-color:transparent;color:var(--nano-color-neutral-1400);border:1px solid var(--nano-color-neutral-300)}.step.step--complete .step-icon{background-color:var(--nano-color-success-1000);color:var(--nano-color-base-0);border:none}.step[open] .step-icon{background-color:var(--nano-color-primary-1000);color:var(--nano-color-base-0);border:none}.step .step-change{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);text-decoration:underline;color:var(--nano-color-primary-1200)}";
|
10
|
+
|
11
|
+
const NanoStepAccordion = class {
|
12
|
+
constructor(hostRef) {
|
13
|
+
index.registerInstance(this, hostRef);
|
14
|
+
this.nanoStepActive = index.createEvent(this, "nanoStepActive", 7);
|
15
|
+
}
|
16
|
+
get host() { return index.getElement(this); }
|
17
|
+
nanoDetails;
|
18
|
+
gridWorking = true;
|
19
|
+
/** The currently active step, zero-based index */
|
20
|
+
activeStep = 0;
|
21
|
+
handleActiveStepChange(newValue, oldValue) {
|
22
|
+
if (!this.steps[newValue]?.enabled)
|
23
|
+
this.activeStep = oldValue;
|
24
|
+
else {
|
25
|
+
const event = this.nanoStepActive.emit({
|
26
|
+
index: newValue,
|
27
|
+
step: this.steps[newValue],
|
28
|
+
});
|
29
|
+
if (event.defaultPrevented) {
|
30
|
+
this.activeStep = oldValue;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
_steps = [];
|
35
|
+
stepProxyHandler = {
|
36
|
+
set: (target, prop, value) => {
|
37
|
+
target[prop] = value;
|
38
|
+
index.forceUpdate(this.host);
|
39
|
+
return true;
|
40
|
+
},
|
41
|
+
};
|
42
|
+
/** An array of steps, each with a title, completion status, and enabled state */
|
43
|
+
get steps() {
|
44
|
+
return this._steps;
|
45
|
+
}
|
46
|
+
set steps(value) {
|
47
|
+
this._steps = [];
|
48
|
+
// improved devX - use a proxy to re-render when step properties change
|
49
|
+
value.forEach((step) => {
|
50
|
+
const proxyStep = new Proxy(step, this.stepProxyHandler);
|
51
|
+
this._steps.push(proxyStep);
|
52
|
+
});
|
53
|
+
}
|
54
|
+
/** Emitted when the active step changes. Prevent default to cancel the change */
|
55
|
+
nanoStepActive;
|
56
|
+
handleToggle(event) {
|
57
|
+
if (event.detail.index === this.activeStep)
|
58
|
+
return;
|
59
|
+
this.activeStep = event.detail.index;
|
60
|
+
}
|
61
|
+
// A dirty great hack for Firefox - it doesn't support grid layout in `<details>`
|
62
|
+
// so we use this to apply different styles based on whether grid is working or not
|
63
|
+
isDetailsGridWorking(detailsEl) {
|
64
|
+
// Create a test element with explicit grid placement
|
65
|
+
const testEl = document.createElement('div');
|
66
|
+
testEl.style.gridColumn = '2';
|
67
|
+
testEl.style.height = '1px';
|
68
|
+
testEl.style.width = '1px';
|
69
|
+
testEl.style.visibility = 'hidden';
|
70
|
+
detailsEl.appendChild(testEl);
|
71
|
+
const parentX = detailsEl.getBoundingClientRect().x;
|
72
|
+
const testX = testEl.getBoundingClientRect().x;
|
73
|
+
detailsEl.removeChild(testEl);
|
74
|
+
// If testEl moved horizontally, grid is in effect
|
75
|
+
return Math.abs(testX - parentX) > 1;
|
76
|
+
}
|
77
|
+
componentDidLoad() {
|
78
|
+
if (!this.nanoDetails)
|
79
|
+
return;
|
80
|
+
const detailsEl = this.nanoDetails.shadowRoot.querySelector('details');
|
81
|
+
if (detailsEl) {
|
82
|
+
this.gridWorking = this.isDetailsGridWorking(detailsEl);
|
83
|
+
}
|
84
|
+
}
|
85
|
+
render() {
|
86
|
+
return (renderer.h("nano-accordion", { key: 'd92d8997c0486e26c132793db92b12e04d46a384', alwaysOpen: true, onNanoToggle: (event) => this.handleToggle(event) }, this.steps.map((step, index$1) => (renderer.h("nano-details", { open: index$1 === this.activeStep, disabled: !step.enabled, class: {
|
87
|
+
step: true,
|
88
|
+
'step--active': index$1 === this.activeStep,
|
89
|
+
'step--complete': step.complete,
|
90
|
+
'step--grid-working': this.gridWorking,
|
91
|
+
'step--grid-not-working': !this.gridWorking,
|
92
|
+
'step--disabled': !step.enabled,
|
93
|
+
}, ref: (el) => (this.nanoDetails = el) }, renderer.h("span", { class: "step-icon", slot: "icon-start" }, index$1 + 1), renderer.h("div", { class: "step-header", slot: "label" }, renderer.h("span", { class: `step-title ${step.complete ? 'complete' : ''}` }, step.title), step.complete && (renderer.h(index.Fragment, null, renderer.h("span", null, " - "), renderer.h("span", { class: "step-change" }, "Change")))), renderer.h("span", { slot: "icon-end" }), renderer.h("div", { class: "step-content" }, renderer.h("slot", { name: `step-${index$1}` })))))));
|
94
|
+
}
|
95
|
+
static get watchers() { return {
|
96
|
+
"activeStep": ["handleActiveStepChange"]
|
97
|
+
}; }
|
98
|
+
};
|
99
|
+
NanoStepAccordion.style = stepAccordionCss;
|
100
|
+
|
101
|
+
exports.nano_step_accordion = NanoStepAccordion;
|
@@ -0,0 +1,133 @@
|
|
1
|
+
/*!
|
2
|
+
* Custom elements for Nanopore-Digital Web applications
|
3
|
+
*/
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
var index = require('./index-DGttnXif.js');
|
7
|
+
var renderer = require('./renderer-B9M1kXq8.js');
|
8
|
+
var constructibleStyle = require('./constructible-style-BsHBb9au.js');
|
9
|
+
var style = require('./style-Du-L-qMa.js');
|
10
|
+
|
11
|
+
const stepBreadcrumbCss = ":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:block;--background:var(--nano-color-base-0)}.step-wrapper{container-type:inline-size}.step-list.desktop{display:flex;flex-direction:row;align-items:center;justify-content:space-between;list-style:none;padding:0;margin:0;position:relative;z-index:1}.step-list.desktop::before{content:\"\";display:block;flex-grow:1;block-size:1px;background-color:var(--nano-color-neutral-300);position:absolute;inset-block-start:50%;z-index:-1;inset-inline-start:0;inline-size:100%}.step-item-wrapper{flex:0 1 auto;display:inline-flex;align-items:center;cursor:pointer}.step-item-wrapper:last-of-type{flex:0 1 auto}.step-item-wrapper:last-of-type .step-item{padding-inline-end:0}.step-item-wrapper:first-of-type::before{display:none}.step-item-wrapper:first-of-type .step-item{padding-inline-start:0}.step-item-wrapper::before{content:\"\";grid-column:2;grid-row:1;inline-size:0.4rem;block-size:0.4rem;place-self:center end;inset-block-start:0.5px;position:relative;border-inline-end:1px solid var(--nano-color-neutral-300);border-block-end:1px solid var(--nano-color-neutral-300);rotate:-45deg}:dir(rtl) .step-item-wrapper::after{rotate:45deg}.step-item{all:unset;display:inline-flex;align-items:center;gap:var(--nano-spacing-sm);background-color:var(--background);padding:0 var(--nano-spacing-sm);position:relative}.step-item:focus-visible{outline:var(--nano-focus-ring);outline-offset:var(--nano-focus-ring-offset);z-index:1}.step-item.step-item--disabled{cursor:not-allowed}.step-item.step-item--disabled>*{opacity:0.5}.step-item-icon{font-size:var(--nano-font-size-xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);display:inline-flex;align-items:center;justify-content:center;inline-size:1.5rem;block-size:1.5rem;border-radius:var(--nano-border-radius-circle);background-color:transparent;color:var(--nano-color-neutral-1400);border:1px solid var(--nano-color-neutral-300)}.step-item--complete .step-item-icon{background-color:var(--nano-color-success-1000);color:var(--nano-color-base-0);border:none}.step-item--active .step-item-icon{background-color:var(--nano-color-primary-1000);color:var(--nano-color-base-0);border:none}.step-dropdown{inline-size:100%;min-inline-size:300px}.step-trigger{all:unset;display:inline-flex;gap:var(--nano-spacing-md);align-items:center;inline-size:100%;cursor:pointer}.step-trigger-text{display:flex;flex-direction:column}.step-trigger-now{font-weight:var(--nano-font-weight-normal);font-size:var(--nano-font-size-xl);line-height:var(--nano-line-height-denser);text-wrap:balance;color:var(--nano-color-neutral-1400)}.step-trigger-next{font-size:var(--nano-font-size-2xs);line-height:var(--nano-line-height-normal);letter-spacing:var(--nano-letter-spacing-loose);color:var(--nano-color-neutral-1000)}.step-trigger-icon{margin-inline-start:auto;color:var(--nano-color-primary-1000);transition:var(--nano-transition-x-fast) rotate}[open] .step-trigger-icon{rotate:180deg}.step-progress-circle{--size:64px;--thickness:4px;inline-size:var(--size);min-inline-size:var(--size);aspect-ratio:1/1;border-radius:50%;display:grid;place-items:center;position:relative}.step-progress-circle::before{content:\"\";position:absolute;inset:0;border-radius:50%;background:conic-gradient(var(--nano-color-success-1000) calc(var(--value) / var(--max) * 360deg), var(--nano-color-neutral-100) 0);-webkit-mask:radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%);mask:radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%)}.step-progress-title{font-size:var(--nano-font-size-sm);line-height:var(--nano-line-height-normal);font-weight:var(--nano-font-weight-bold);white-space:nowrap;color:var(--nano-color-neutral-1000)}.step-progress-title strong{color:var(--nano-color-neutral-1400)}";
|
12
|
+
|
13
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
14
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
15
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
16
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
17
|
+
else
|
18
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
19
|
+
if (d = decorators[i])
|
20
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
22
|
+
};
|
23
|
+
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
25
|
+
return Reflect.metadata(k, v);
|
26
|
+
};
|
27
|
+
const NanoStepBreadcrumb = class {
|
28
|
+
constructor(hostRef) {
|
29
|
+
index.registerInstance(this, hostRef);
|
30
|
+
this.nanoStepActive = index.createEvent(this, "nanoStepActive", 7);
|
31
|
+
}
|
32
|
+
get host() { return index.getElement(this); }
|
33
|
+
calculatedWidth;
|
34
|
+
cacheKey;
|
35
|
+
/** The currently active step, zero-based index */
|
36
|
+
activeStep = 0;
|
37
|
+
handleActiveStepChange(newValue, oldValue) {
|
38
|
+
if (!this.steps[newValue]?.enabled)
|
39
|
+
this.activeStep = oldValue;
|
40
|
+
else {
|
41
|
+
const event = this.nanoStepActive.emit({
|
42
|
+
index: newValue,
|
43
|
+
step: this.steps[newValue],
|
44
|
+
});
|
45
|
+
if (event.defaultPrevented) {
|
46
|
+
this.activeStep = oldValue;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
/** Emitted when the active step changes. Prevent default to cancel the change */
|
51
|
+
nanoStepActive;
|
52
|
+
_steps = [];
|
53
|
+
stepProxyHandler = {
|
54
|
+
set: (target, prop, value) => {
|
55
|
+
target[prop] = value;
|
56
|
+
index.forceUpdate(this.host);
|
57
|
+
return true;
|
58
|
+
},
|
59
|
+
};
|
60
|
+
/** An array of steps, each with a title, completion status, and enabled state */
|
61
|
+
get steps() {
|
62
|
+
return this._steps;
|
63
|
+
}
|
64
|
+
set steps(value) {
|
65
|
+
this._steps = [];
|
66
|
+
// improved devX - use a proxy to re-render when step properties change
|
67
|
+
value.forEach((step) => {
|
68
|
+
const proxyStep = new Proxy(step, this.stepProxyHandler);
|
69
|
+
this._steps.push(proxyStep);
|
70
|
+
});
|
71
|
+
}
|
72
|
+
handleStepsChange() {
|
73
|
+
const numberOfSteps = this._steps.length;
|
74
|
+
const charLength = this._steps.reduce((acc, step) => acc + step.title.length, 0);
|
75
|
+
this.cacheKey = 'step-breadcrumb-' + numberOfSteps + charLength;
|
76
|
+
// text characters + icons (3 x 1.5rem) + arrows (2 x 1.875rem) + gaps (3 * 20px)
|
77
|
+
this.calculatedWidth = `calc(${charLength}ch + ${numberOfSteps * 1.5}rem + ${(numberOfSteps - 1) * 1.875}rem + ${numberOfSteps * 10}px)`;
|
78
|
+
}
|
79
|
+
styles = () => {
|
80
|
+
const css = /* css */ `@container (width > ${this.calculatedWidth}) {
|
81
|
+
.step-list.mobile.${this.cacheKey} { display: none; }
|
82
|
+
.step-list.desktop.${this.cacheKey} { display: flex; }
|
83
|
+
}
|
84
|
+
@container (width <= ${this.calculatedWidth}) {
|
85
|
+
.step-list.mobile.${this.cacheKey} { display: block; }
|
86
|
+
.step-list.desktop.${this.cacheKey} { display: none; }
|
87
|
+
}`;
|
88
|
+
return css;
|
89
|
+
};
|
90
|
+
componentWillLoad() {
|
91
|
+
this.handleStepsChange();
|
92
|
+
style.addGlobalStylesheetToShadow(this.host.shadowRoot);
|
93
|
+
}
|
94
|
+
ControlTag = ({ step, index, }) => {
|
95
|
+
const Tag = step.enabled ? (step.href ? 'A' : 'BUTTON') : 'SPAN';
|
96
|
+
return (renderer.h(Tag, { href: step.href || undefined, class: {
|
97
|
+
'step-item': true,
|
98
|
+
'step-item--active': index === this.activeStep,
|
99
|
+
'step-item--complete': step.complete,
|
100
|
+
'step-item--disabled': !step.enabled,
|
101
|
+
}, onClick: () => {
|
102
|
+
if (step.enabled) {
|
103
|
+
this.activeStep = index;
|
104
|
+
}
|
105
|
+
} }, renderer.h("span", { class: "step-item-icon", slot: "icon-start" }, index + 1), renderer.h("span", { class: "step-item-title" }, step.title)));
|
106
|
+
};
|
107
|
+
render() {
|
108
|
+
const Wrapper = this.steps.filter((step) => step.href).length > 0 ? 'nav' : 'div';
|
109
|
+
return (renderer.h(index.Host, { key: 'c4d0e767abe4ee65f8e70534844e7ff254455af0' }, renderer.h(Wrapper, { key: '6df94c5a9df7ae957b5ff243ecbe78e7c57233b3', class: "step-wrapper" }, renderer.h("ul", { key: 'ba1838191a0b888b630bfaba5125ae868f8aab38', class: `step-list desktop ${this.cacheKey}` }, this.steps.map((step, index) => (renderer.h("li", { class: "step-item-wrapper", key: index }, renderer.h(this.ControlTag, { step: step, index: index }))))), renderer.h("div", { key: '64ae2c870494d376f4bb6484e97a5217dc4be311', class: `step-list mobile ${this.cacheKey}` }, renderer.h("nano-dropdown", { key: '08d3dc468d594177b922ae91fb1ff02ed79d282c', dialogTitle: "Steps", class: "step-dropdown" }, renderer.h("button", { key: '88ef0602628d800a3517da3c06e2eea1dad5a7dd', slot: "trigger", class: "step-trigger" }, renderer.h("div", { key: '9d60be986e00fdd6814a910641cf94ef97fb2eed', class: "step-progress-circle", role: "progressbar", "aria-valuenow": "2", "aria-valuemin": "0", "aria-valuemax": "5", style: {
|
110
|
+
'--value': '' + (this.activeStep + 1),
|
111
|
+
'--max': '' + this.steps.length,
|
112
|
+
} }, renderer.h("span", { key: '9e6eb88c9fc12f4228f55fe04cb2e1ce9a92e1f2', class: "step-progress-text" }, renderer.h("strong", { key: '5e999ae958a2c43f5d8998e9083e91b11ea9041d' }, this.activeStep + 1), " of", ' ', this.steps.length)), renderer.h("div", { key: 'ccb66003ef35b256ae8d0d34c8cad7535680d05b', class: "step-trigger-text" }, renderer.h("div", { key: '87f8a73802c33c289860b0eb530edae379fa5ebf', class: "step-trigger-now" }, this.steps[this.activeStep | 0]?.title || 'Select a step'), renderer.h("div", { key: '9b00c5ae99376028ec077e782f430b0346580119', class: "step-trigger-next" }, this.steps[this.activeStep + 1]?.title || 'Next step')), renderer.h("nano-icon", { key: '5073cf36a3a15599df7fa3816a62e72af257ab99', class: "step-trigger-icon", name: "light/chevron-down" })), renderer.h("nano-menu", { key: '18f15bb2439661286c019a6f20272db72a6ad1b1' }, this.steps.map((step, index) => (renderer.h("nano-nav-item", { class: {
|
113
|
+
'step-item-mobile': true,
|
114
|
+
'step-item-mobile step-item--active': index === this.activeStep,
|
115
|
+
'step-item-mobile step-item--complete': step.complete,
|
116
|
+
}, disabled: !step.enabled, key: index, onClick: () => {
|
117
|
+
if (step.enabled) {
|
118
|
+
this.activeStep = index;
|
119
|
+
}
|
120
|
+
} }, renderer.h("span", { class: "step-item-icon", slot: "icon-start" }, index + 1), renderer.h("span", { class: "step-item-title" }, step.title))))))))));
|
121
|
+
}
|
122
|
+
static get watchers() { return {
|
123
|
+
"activeStep": ["handleActiveStepChange"],
|
124
|
+
"steps": ["handleStepsChange"]
|
125
|
+
}; }
|
126
|
+
};
|
127
|
+
__decorate([
|
128
|
+
constructibleStyle.ConstructibleStyle({ cacheKeyProperty: 'calculatedWidth' }),
|
129
|
+
__metadata("design:type", Object)
|
130
|
+
], NanoStepBreadcrumb.prototype, "styles", void 0);
|
131
|
+
NanoStepBreadcrumb.style = stepBreadcrumbCss;
|
132
|
+
|
133
|
+
exports.nano_step_breadcrumb = NanoStepBreadcrumb;
|
@@ -607,12 +607,12 @@ const Sticker = class {
|
|
607
607
|
this.hasBootstrapped = false;
|
608
608
|
}
|
609
609
|
render() {
|
610
|
-
return (renderer.h(index.Host, { key: '
|
610
|
+
return (renderer.h(index.Host, { key: 'd0e4e1b0cc7c63db0389ee67b999c30347f7e16b', sticky: !this.isRootSticker && !this.stickToEle && this.isSticky, hide: this.hide && this.isStuck, siblings: this.stuckCounter, index: this.stickerIndex, stuck: this.isStuck && this.isSticky, "placed-bottom": this.positions.includes('bottom'), "placed-top": this.positions.includes('top'), "placed-end": this.positions.includes('end'), "placed-start": this.positions.includes('start'), class: "nano-sticker" }, renderer.h("div", { key: '6f9852e2cfeb2e203e5dde6f71e7a042a996dd86', class: {
|
611
611
|
sticker: true,
|
612
612
|
sticky: this.isRootSticker && this.isSticky,
|
613
613
|
stuck: this.isStuck && this.isRootSticker && this.isSticky,
|
614
614
|
hide: this.isRootSticker && this.hide && this.isStuck,
|
615
|
-
}, ref: (div) => (this.sticker = div) }, renderer.h("div", { key: '
|
615
|
+
}, ref: (div) => (this.sticker = div) }, renderer.h("div", { key: '1e54d0ebe57b52c95a64acbb6d46f8c9d9778dd3', class: "sticker-content", ref: (div) => (this.content = div) }, renderer.h("slot", { key: 'e8359edd6c73c5006ff1c90a91ecafad07e5c915' })))));
|
616
616
|
}
|
617
617
|
static get watchers() { return {
|
618
618
|
"trigger": ["updateTriggerOffset"],
|
@@ -24,10 +24,10 @@ const NanoTabContent = class {
|
|
24
24
|
requestAnimationFrame(() => (this.ready = true));
|
25
25
|
}
|
26
26
|
render() {
|
27
|
-
return (renderer.h(index.Host, { key: '
|
27
|
+
return (renderer.h(index.Host, { key: '7afee777be86f5847c5ac4c8de6babae3199b01d', id: this.host.id || this.tabContentId, style: { display: this.active ? 'block' : 'none' }, role: "tabpanel", "aria-hidden": this.active ? 'false' : 'true', class: {
|
28
28
|
ready: this.ready,
|
29
29
|
'nano-tab-content': true,
|
30
|
-
} }, renderer.h("div", { key: '
|
30
|
+
} }, renderer.h("div", { key: 'c316e2c15458eeb9fb6162d81060b81a1132e795', part: "base", class: "nano-tab-content" }, renderer.h("slot", { key: '532eedd714e732749cfe9b303b1f4c633e89491c' }))));
|
31
31
|
}
|
32
32
|
};
|
33
33
|
NanoTabContent.style = tabContentCss;
|
@@ -46,12 +46,12 @@ const NanoTab = class {
|
|
46
46
|
}
|
47
47
|
};
|
48
48
|
render() {
|
49
|
-
return (renderer.h(index.Host, { key: '
|
49
|
+
return (renderer.h(index.Host, { key: '67fe232bda16bf41bf1268a1891cfeb6483ebd02', id: this.host.id || this.tabId, role: "tab", "aria-disabled": this.disabled ? 'true' : 'false', "aria-selected": this.active ? 'true' : 'false', class: "nano-tab" }, renderer.h("div", { key: '6f07d7d5a89071e094fe3deb19e88ec66a524f3d', part: `base${this.active ? ' base--active' : ''}${this.disabled ? ' base--disabled' : ''}${this.closable ? ' base--closable' : ''}`, class: {
|
50
50
|
tab: true,
|
51
51
|
'tab--active': this.active,
|
52
52
|
'tab--disabled': this.disabled,
|
53
53
|
'tab--closable': this.closable,
|
54
|
-
} }, renderer.h("slot", { key: '
|
54
|
+
} }, renderer.h("slot", { key: '4c8dce458c8ae3ed526d4aed7332650be891510c', name: "start" }), renderer.h("div", { key: 'e71cced02347ffaa432b5711af54666ac0a6cfd6', part: "label", ref: (el) => (this.tab = el), tabindex: this.disabled || !this.active ? '-1' : '0', class: "tab__label" }, renderer.h("slot", { key: '382f7f77b009e3a5cf3af3d3b94b02e639bf2934' })), renderer.h("slot", { key: '82a2c81ab573d3c78b7d913f4b7ab146e7c6d5b2', name: "end" }), this.closable && !this.disabled && (renderer.h("nano-icon-button", { key: '14e812f9acd5e081a1eba5014f6d4fe4b79371e2', label: "Close this tab", iconName: "light/xmark", class: "tab__close-button", onClick: this.handleCloseClick, onKeyDown: this.handleCloseKeydown, part: "close-button" })))));
|
55
55
|
}
|
56
56
|
};
|
57
57
|
NanoTab.style = tabCss;
|
@@ -224,10 +224,10 @@ const NanoTable = class {
|
|
224
224
|
this.cleanUpObservers();
|
225
225
|
}
|
226
226
|
render() {
|
227
|
-
return (renderer.h(index.Host, { key: '
|
227
|
+
return (renderer.h(index.Host, { key: '3c45a2880bd20a771bcc682355452312340db56d', class: {
|
228
228
|
'nano-table': true,
|
229
229
|
'nano-table--props-ready': this.propsReady,
|
230
|
-
} }, this.scrollable && (renderer.h("nano-masked-overflow", { key: '
|
230
|
+
} }, this.scrollable && (renderer.h("nano-masked-overflow", { key: '6b29ca4c8c64deae80def0d3958dc25c4d6cd1c0', hideScrollbars: false, scrollControls: false, label: this.caption?.textContent || undefined, class: "nano-table__overflow-container" }, renderer.h("div", { key: '83dce90d6e5425b0fd2a2443d0d90b7acfc9c141', class: "nano-table__overflow" }))), renderer.h("slot", { key: 'cff62841c17cf20c2ff5872944dbd38bbe438369' })));
|
231
231
|
}
|
232
232
|
static get watchers() { return {
|
233
233
|
"compact": ["handleCompactChange"],
|
@@ -59,6 +59,8 @@
|
|
59
59
|
"components/sortable/sortable.js",
|
60
60
|
"components/spinner/spinner.js",
|
61
61
|
"components/split-pane/split-pane.js",
|
62
|
+
"components/step-accordion/step-accordion.js",
|
63
|
+
"components/step-breadcrumb/step-breadcrumb.js",
|
62
64
|
"components/sticker/sticker.js",
|
63
65
|
"components/table/table.js",
|
64
66
|
"components/tabs/tab-content.js",
|
@@ -7,31 +7,50 @@ import { getDirectChildren } from "../../utils/dom";
|
|
7
7
|
* @status stable
|
8
8
|
*/
|
9
9
|
export class NanoAccordion {
|
10
|
-
|
10
|
+
indexOpened;
|
11
|
+
elementOpened;
|
11
12
|
el;
|
13
|
+
/** Force one details element to always be open */
|
14
|
+
alwaysOpen = false;
|
12
15
|
/** Fires when accordion elements toggle */
|
13
16
|
nanoToggle;
|
14
17
|
onToggleHandler(event) {
|
15
18
|
if (event.target?.tagName !== 'NANO-DETAILS')
|
16
19
|
return;
|
17
20
|
event.stopPropagation();
|
18
|
-
const items = getDirectChildren(this.el, transformTag('nano-details'))
|
19
|
-
this.el.querySelectorAll(transformTag('nano-details'));
|
21
|
+
const items = getDirectChildren(this.el, transformTag('nano-details'));
|
20
22
|
items.forEach((item, i) => {
|
21
23
|
if (item !== event.target)
|
22
24
|
item.open = false;
|
23
|
-
else
|
24
|
-
this.
|
25
|
+
else if (item === event.target) {
|
26
|
+
this.indexOpened = i;
|
27
|
+
}
|
25
28
|
});
|
26
|
-
this.nanoToggle.emit(event.target);
|
29
|
+
this.nanoToggle.emit({ element: event.target, index: this.indexOpened });
|
27
30
|
}
|
28
31
|
onClosedHandler(event) {
|
29
32
|
event.stopPropagation();
|
30
|
-
this.
|
31
|
-
|
33
|
+
if (this.alwaysOpen) {
|
34
|
+
let foundOpen;
|
35
|
+
const items = getDirectChildren(this.el, transformTag('nano-details'));
|
36
|
+
items.forEach((item) => {
|
37
|
+
if (item !== event.target && item.open) {
|
38
|
+
foundOpen = true;
|
39
|
+
}
|
40
|
+
});
|
41
|
+
if (!foundOpen) {
|
42
|
+
event.preventDefault();
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
if (this.elementOpened === event.target) {
|
47
|
+
this.elementOpened = null;
|
48
|
+
this.indexOpened = null;
|
49
|
+
this.nanoToggle.emit();
|
50
|
+
}
|
32
51
|
}
|
33
52
|
render() {
|
34
|
-
return h("slot", { key: '
|
53
|
+
return h("slot", { key: 'a16b340b9312672847ee022b2beb6767fc0dfb86' });
|
35
54
|
}
|
36
55
|
static get is() { return "nano-accordion"; }
|
37
56
|
static get encapsulation() { return "shadow"; }
|
@@ -45,9 +64,28 @@ export class NanoAccordion {
|
|
45
64
|
"$": ["accordion.css"]
|
46
65
|
};
|
47
66
|
}
|
48
|
-
static get
|
67
|
+
static get properties() {
|
49
68
|
return {
|
50
|
-
"
|
69
|
+
"alwaysOpen": {
|
70
|
+
"type": "boolean",
|
71
|
+
"attribute": "always-open",
|
72
|
+
"mutable": false,
|
73
|
+
"complexType": {
|
74
|
+
"original": "boolean",
|
75
|
+
"resolved": "boolean",
|
76
|
+
"references": {}
|
77
|
+
},
|
78
|
+
"required": false,
|
79
|
+
"optional": false,
|
80
|
+
"docs": {
|
81
|
+
"tags": [],
|
82
|
+
"text": "Force one details element to always be open"
|
83
|
+
},
|
84
|
+
"getter": false,
|
85
|
+
"setter": false,
|
86
|
+
"reflect": false,
|
87
|
+
"defaultValue": "false"
|
88
|
+
}
|
51
89
|
};
|
52
90
|
}
|
53
91
|
static get events() {
|
@@ -62,8 +100,8 @@ export class NanoAccordion {
|
|
62
100
|
"text": "Fires when accordion elements toggle"
|
63
101
|
},
|
64
102
|
"complexType": {
|
65
|
-
"original": "HTMLNanoDetailsElement",
|
66
|
-
"resolved": "HTMLNanoDetailsElement",
|
103
|
+
"original": "{\n element: HTMLNanoDetailsElement;\n index: number;\n }",
|
104
|
+
"resolved": "{ element: HTMLNanoDetailsElement; index: number; }",
|
67
105
|
"references": {
|
68
106
|
"HTMLNanoDetailsElement": {
|
69
107
|
"location": "global",
|
@@ -89,7 +89,7 @@ export class NanoBreadcrumb {
|
|
89
89
|
"references": {
|
90
90
|
"Breadcrumb": {
|
91
91
|
"location": "local",
|
92
|
-
"path": "/builds/
|
92
|
+
"path": "/builds/FKs_t1C_/0/Digital/nano-components/packages/components/src/components/breadcrumb/breadcrumb.tsx",
|
93
93
|
"id": "src/components/breadcrumb/breadcrumb.tsx::Breadcrumb"
|
94
94
|
}
|
95
95
|
}
|
@@ -6,6 +6,7 @@ import { h, transformTag } from "../../utils/renderer";
|
|
6
6
|
import { cyrb53 } from "../../utils/math";
|
7
7
|
import { debounce } from "../../utils/throttle";
|
8
8
|
import { findScrollParent, isInViewport } from "../../utils/scroll";
|
9
|
+
import { perMark } from "../../utils/performance";
|
9
10
|
import { TableColHead } from "./table.header";
|
10
11
|
import { TableRow, TableHeadFootRow } from "./table.row";
|
11
12
|
import { TableCell } from "./table.cell";
|
@@ -13,19 +14,6 @@ import { CSSNAMESPACE } from "./table.constants";
|
|
13
14
|
import { generateStore, storeSearch, storeSetConfig, storeSetData, storeSort, storeFilter, } from "./table.store";
|
14
15
|
import { TablePinService } from "./table.pin-service";
|
15
16
|
const measurePerf = false;
|
16
|
-
function perMark(name, end = false) {
|
17
|
-
if (!performance || !measurePerf)
|
18
|
-
return;
|
19
|
-
if (end) {
|
20
|
-
performance?.mark('end' + name);
|
21
|
-
performance?.measure(name, 'start' + name, 'end' + name);
|
22
|
-
const entries = performance?.getEntriesByName(name);
|
23
|
-
console.info(entries[entries.length ? entries.length - 1 : 0]);
|
24
|
-
}
|
25
|
-
else {
|
26
|
-
performance?.mark('start' + name);
|
27
|
-
}
|
28
|
-
}
|
29
17
|
let id = 0;
|
30
18
|
/**
|
31
19
|
* Enables the search, filter and sort of tabular data.
|
@@ -24,8 +24,9 @@ import { HasSlotController } from "../../utils/slot";
|
|
24
24
|
* @part icon - the wrapper around both start and end icons
|
25
25
|
* @part icon--start - the icon wrapper at the start of the ui control
|
26
26
|
* @part icon--end - the icon wrapper at the end of the ui control
|
27
|
-
* @part body - the
|
28
|
-
* @part content - the
|
27
|
+
* @part body - the main body block
|
28
|
+
* @part content-wrapper - the wrapper around the content
|
29
|
+
* @part content - the main content
|
29
30
|
*/
|
30
31
|
export class NanoDetails {
|
31
32
|
mo;
|
@@ -141,7 +142,9 @@ export class NanoDetails {
|
|
141
142
|
if (this.stateChanging)
|
142
143
|
return;
|
143
144
|
for (const change of changes) {
|
144
|
-
if (change.type === 'attributes' &&
|
145
|
+
if (change.type === 'attributes' &&
|
146
|
+
change.attributeName === 'open' &&
|
147
|
+
!this.disabled) {
|
145
148
|
this.open = this.detailsEl.open;
|
146
149
|
}
|
147
150
|
}
|
@@ -169,13 +172,13 @@ export class NanoDetails {
|
|
169
172
|
}
|
170
173
|
}
|
171
174
|
render() {
|
172
|
-
return (h(Host, { key: '
|
175
|
+
return (h(Host, { key: '1cbedc078a3390a3ad82b99ac0f37e8ea0f8d480', class: "nano-details" }, h("details", { key: '22659218ba7d1ec936523ff33c7ed2a1efb2af74', part: "base", ref: (d) => (this.detailsEl = d), class: {
|
173
176
|
details: true,
|
174
177
|
disabled: this.disabled,
|
175
|
-
} }, h("summary", { key: '
|
178
|
+
} }, 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') &&
|
176
179
|
!this.slotCtrl.has('icon-end') &&
|
177
180
|
!this.slotCtrl.has('icon-expand') &&
|
178
|
-
!this.slotCtrl.has('icon-collapse') && (h("nano-icon", { key: '
|
181
|
+
!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' })))))));
|
179
182
|
}
|
180
183
|
static get is() { return "nano-details"; }
|
181
184
|
static get encapsulation() { return "shadow"; }
|
@@ -507,7 +507,9 @@ export class FieldValidator {
|
|
507
507
|
this._valid = this.activeForm.checkValidity();
|
508
508
|
this.internalValidate = false;
|
509
509
|
}
|
510
|
-
|
510
|
+
setTimeout(() => {
|
511
|
+
this.nanoPayloadChange.emit(this._store.state);
|
512
|
+
}, 20);
|
511
513
|
};
|
512
514
|
/**
|
513
515
|
* Handles nano field value changes and passes to store
|
@@ -600,7 +602,7 @@ export class FieldValidator {
|
|
600
602
|
this.activeForm.removeEventListener('invalid', this.handleFormInvalid, true);
|
601
603
|
}
|
602
604
|
render() {
|
603
|
-
return (h(Host, { key: '
|
605
|
+
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' })))));
|
604
606
|
}
|
605
607
|
static get is() { return "nano-field-validator"; }
|
606
608
|
static get encapsulation() { return "scoped"; }
|
@@ -104,13 +104,13 @@
|
|
104
104
|
padding-inline: var(--horizontal-padding);
|
105
105
|
padding-block-end: var(--vertical-padding);
|
106
106
|
}
|
107
|
-
:host .middle-
|
107
|
+
:host .middle-centre a {
|
108
108
|
color: inherit;
|
109
109
|
}
|
110
|
-
:host .middle-
|
110
|
+
:host .middle-centre a:hover {
|
111
111
|
color: var(--nano-color-primary-1000);
|
112
112
|
}
|
113
|
-
:host .middle-
|
113
|
+
:host .middle-centre a:focus-visible {
|
114
114
|
outline: var(--nano-focus-ring);
|
115
115
|
outline-offset: var(--nano-focus-ring-offset);
|
116
116
|
}
|
@@ -120,7 +120,7 @@
|
|
120
120
|
flex-direction: column;
|
121
121
|
}
|
122
122
|
:host .middle-start,
|
123
|
-
:host .middle-
|
123
|
+
:host .middle-centre,
|
124
124
|
:host .middle-end {
|
125
125
|
align-items: center;
|
126
126
|
}
|
@@ -128,7 +128,7 @@
|
|
128
128
|
display: flex;
|
129
129
|
justify-content: flex-start;
|
130
130
|
}
|
131
|
-
:host .middle-
|
131
|
+
:host .middle-centre {
|
132
132
|
display: flex;
|
133
133
|
justify-content: center;
|
134
134
|
gap: var(--icon-gap-md);
|
@@ -179,7 +179,7 @@
|
|
179
179
|
display: flex;
|
180
180
|
flex-direction: column;
|
181
181
|
}
|
182
|
-
:host .middle-
|
182
|
+
:host .middle-centre {
|
183
183
|
flex-wrap: wrap;
|
184
184
|
}
|
185
185
|
:host .middle-end {
|
@@ -191,7 +191,7 @@
|
|
191
191
|
align-items: center;
|
192
192
|
}
|
193
193
|
:host .middle-start,
|
194
|
-
:host .middle-
|
194
|
+
:host .middle-centre,
|
195
195
|
:host .middle-end {
|
196
196
|
justify-content: center;
|
197
197
|
}
|