@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,138 @@
|
|
1
|
+
:host,
|
2
|
+
*,
|
3
|
+
*::before,
|
4
|
+
*::after {
|
5
|
+
box-sizing: border-box;
|
6
|
+
}
|
7
|
+
[hidden] {
|
8
|
+
display: none !important;
|
9
|
+
}
|
10
|
+
@media (prefers-reduced-motion: reduce) {
|
11
|
+
:host,
|
12
|
+
*,
|
13
|
+
*::before,
|
14
|
+
*::after {
|
15
|
+
animation-duration: 0.01ms !important;
|
16
|
+
animation-iteration-count: 1 !important;
|
17
|
+
transition-duration: 0.01ms !important;
|
18
|
+
scroll-behavior: auto !important;
|
19
|
+
}
|
20
|
+
}:host,
|
21
|
+
*,
|
22
|
+
*::before,
|
23
|
+
*::after {
|
24
|
+
box-sizing: border-box;
|
25
|
+
}
|
26
|
+
[hidden] {
|
27
|
+
display: none !important;
|
28
|
+
}
|
29
|
+
@media (prefers-reduced-motion: reduce) {
|
30
|
+
:host,
|
31
|
+
*,
|
32
|
+
*::before,
|
33
|
+
*::after {
|
34
|
+
animation-duration: 0.01ms !important;
|
35
|
+
animation-iteration-count: 1 !important;
|
36
|
+
transition-duration: 0.01ms !important;
|
37
|
+
scroll-behavior: auto !important;
|
38
|
+
}
|
39
|
+
}/** Typography */
|
40
|
+
:host {
|
41
|
+
display: block;
|
42
|
+
}
|
43
|
+
|
44
|
+
.nano-details {
|
45
|
+
--padding: 0;
|
46
|
+
--btn-bg-color--hover: transparent;
|
47
|
+
--btn-bg-color--active: transparent;
|
48
|
+
border: none;
|
49
|
+
margin-block-end: var(--nano-spacing-sm);
|
50
|
+
}
|
51
|
+
.nano-details::part(base) {
|
52
|
+
display: grid;
|
53
|
+
grid-template-rows: auto auto;
|
54
|
+
grid-template-columns: auto 1fr;
|
55
|
+
gap: var(--nano-spacing-sm) 1.625rem;
|
56
|
+
}
|
57
|
+
.nano-details.step--grid-working::part(base)::before {
|
58
|
+
content: "";
|
59
|
+
display: block;
|
60
|
+
grid-column: 1;
|
61
|
+
grid-row: 2;
|
62
|
+
inline-size: 1rem;
|
63
|
+
min-block-size: 1rem;
|
64
|
+
border-inline-end: 2px solid var(--nano-color-neutral-300);
|
65
|
+
}
|
66
|
+
.nano-details.step--grid-working::part(base)::after {
|
67
|
+
content: "";
|
68
|
+
grid-column: 1;
|
69
|
+
grid-row: 2;
|
70
|
+
inline-size: 0.4rem;
|
71
|
+
block-size: 0.4rem;
|
72
|
+
place-self: end end;
|
73
|
+
translate: -50% 0;
|
74
|
+
inset-inline-start: calc(50% - 2.5px);
|
75
|
+
position: relative;
|
76
|
+
border-inline-end: 2px solid var(--nano-color-neutral-300);
|
77
|
+
border-block-end: 2px solid var(--nano-color-neutral-300);
|
78
|
+
rotate: 45deg;
|
79
|
+
}
|
80
|
+
.nano-details:last-of-type::part(base)::before {
|
81
|
+
min-block-size: 0;
|
82
|
+
}
|
83
|
+
.nano-details:last-of-type::part(base)::after {
|
84
|
+
display: none;
|
85
|
+
}
|
86
|
+
.nano-details::part(header) {
|
87
|
+
grid-column: 1/-1;
|
88
|
+
grid-row: 1;
|
89
|
+
display: inline-flex;
|
90
|
+
gap: var(--nano-spacing-sm);
|
91
|
+
}
|
92
|
+
.nano-details::part(body) {
|
93
|
+
grid-column: 2;
|
94
|
+
grid-row: 2;
|
95
|
+
}
|
96
|
+
.nano-details::part(content-wrapper) {
|
97
|
+
padding: 1px;
|
98
|
+
}
|
99
|
+
.nano-details.step--grid-not-working::part(header) {
|
100
|
+
padding-block-end: var(--nano-spacing-sm);
|
101
|
+
}
|
102
|
+
.nano-details.step--grid-not-working::part(body) {
|
103
|
+
padding: 0 0 0 2.5625rem;
|
104
|
+
}
|
105
|
+
|
106
|
+
.step .step-header {
|
107
|
+
display: inline-flex;
|
108
|
+
gap: var(--nano-spacing-sm);
|
109
|
+
align-items: center;
|
110
|
+
}
|
111
|
+
.step .step-icon {
|
112
|
+
display: inline-flex;
|
113
|
+
align-items: center;
|
114
|
+
justify-content: center;
|
115
|
+
inline-size: 2rem;
|
116
|
+
block-size: 2rem;
|
117
|
+
border-radius: var(--nano-border-radius-circle);
|
118
|
+
background-color: transparent;
|
119
|
+
color: var(--nano-color-neutral-1400);
|
120
|
+
border: 1px solid var(--nano-color-neutral-300);
|
121
|
+
}
|
122
|
+
.step.step--complete .step-icon {
|
123
|
+
background-color: var(--nano-color-success-1000);
|
124
|
+
color: var(--nano-color-base-0);
|
125
|
+
border: none;
|
126
|
+
}
|
127
|
+
.step[open] .step-icon {
|
128
|
+
background-color: var(--nano-color-primary-1000);
|
129
|
+
color: var(--nano-color-base-0);
|
130
|
+
border: none;
|
131
|
+
}
|
132
|
+
.step .step-change {
|
133
|
+
font-size: var(--nano-font-size-xs);
|
134
|
+
line-height: var(--nano-line-height-normal);
|
135
|
+
letter-spacing: var(--nano-letter-spacing-loose);
|
136
|
+
text-decoration: underline;
|
137
|
+
color: var(--nano-color-primary-1200);
|
138
|
+
}
|
@@ -0,0 +1,190 @@
|
|
1
|
+
/*!
|
2
|
+
* Custom elements for Nanopore-Digital Web applications
|
3
|
+
*/
|
4
|
+
import { Fragment, forceUpdate, } from "@stencil/core";
|
5
|
+
import { h } from "../../utils/renderer";
|
6
|
+
/**
|
7
|
+
* Presents an accordion interface for a multi-step process,
|
8
|
+
* allowing users to see their progress and navigate back to completed steps.
|
9
|
+
*
|
10
|
+
* @version 8.4.0
|
11
|
+
* @status new
|
12
|
+
*
|
13
|
+
* @slot - Dynamic slots. Use `slot="step-0"`, `slot="step-1"`, etc. for each step.
|
14
|
+
*/
|
15
|
+
export class NanoStepAccordion {
|
16
|
+
host;
|
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
|
+
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 (h("nano-accordion", { key: 'd92d8997c0486e26c132793db92b12e04d46a384', alwaysOpen: true, onNanoToggle: (event) => this.handleToggle(event) }, this.steps.map((step, index) => (h("nano-details", { open: index === this.activeStep, disabled: !step.enabled, class: {
|
87
|
+
step: true,
|
88
|
+
'step--active': index === 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) }, h("span", { class: "step-icon", slot: "icon-start" }, index + 1), h("div", { class: "step-header", slot: "label" }, h("span", { class: `step-title ${step.complete ? 'complete' : ''}` }, step.title), step.complete && (h(Fragment, null, h("span", null, " - "), h("span", { class: "step-change" }, "Change")))), h("span", { slot: "icon-end" }), h("div", { class: "step-content" }, h("slot", { name: `step-${index}` })))))));
|
94
|
+
}
|
95
|
+
static get is() { return "nano-step-accordion"; }
|
96
|
+
static get encapsulation() { return "shadow"; }
|
97
|
+
static get originalStyleUrls() {
|
98
|
+
return {
|
99
|
+
"$": ["step-accordion.scss"]
|
100
|
+
};
|
101
|
+
}
|
102
|
+
static get styleUrls() {
|
103
|
+
return {
|
104
|
+
"$": ["step-accordion.css"]
|
105
|
+
};
|
106
|
+
}
|
107
|
+
static get properties() {
|
108
|
+
return {
|
109
|
+
"activeStep": {
|
110
|
+
"type": "number",
|
111
|
+
"attribute": "active-step",
|
112
|
+
"mutable": true,
|
113
|
+
"complexType": {
|
114
|
+
"original": "number",
|
115
|
+
"resolved": "number",
|
116
|
+
"references": {}
|
117
|
+
},
|
118
|
+
"required": false,
|
119
|
+
"optional": false,
|
120
|
+
"docs": {
|
121
|
+
"tags": [],
|
122
|
+
"text": "The currently active step, zero-based index"
|
123
|
+
},
|
124
|
+
"getter": false,
|
125
|
+
"setter": false,
|
126
|
+
"reflect": false,
|
127
|
+
"defaultValue": "0"
|
128
|
+
},
|
129
|
+
"steps": {
|
130
|
+
"type": "unknown",
|
131
|
+
"attribute": "steps",
|
132
|
+
"mutable": false,
|
133
|
+
"complexType": {
|
134
|
+
"original": "Step[]",
|
135
|
+
"resolved": "Step[]",
|
136
|
+
"references": {
|
137
|
+
"Step": {
|
138
|
+
"location": "global",
|
139
|
+
"id": "global::Step"
|
140
|
+
}
|
141
|
+
}
|
142
|
+
},
|
143
|
+
"required": false,
|
144
|
+
"optional": false,
|
145
|
+
"docs": {
|
146
|
+
"tags": [],
|
147
|
+
"text": "An array of steps, each with a title, completion status, and enabled state"
|
148
|
+
},
|
149
|
+
"getter": true,
|
150
|
+
"setter": true,
|
151
|
+
"defaultValue": "[]"
|
152
|
+
}
|
153
|
+
};
|
154
|
+
}
|
155
|
+
static get states() {
|
156
|
+
return {
|
157
|
+
"gridWorking": {}
|
158
|
+
};
|
159
|
+
}
|
160
|
+
static get events() {
|
161
|
+
return [{
|
162
|
+
"method": "nanoStepActive",
|
163
|
+
"name": "nanoStepActive",
|
164
|
+
"bubbles": true,
|
165
|
+
"cancelable": true,
|
166
|
+
"composed": true,
|
167
|
+
"docs": {
|
168
|
+
"tags": [],
|
169
|
+
"text": "Emitted when the active step changes. Prevent default to cancel the change"
|
170
|
+
},
|
171
|
+
"complexType": {
|
172
|
+
"original": "{ index: number; step: Step }",
|
173
|
+
"resolved": "{ index: number; step: Step; }",
|
174
|
+
"references": {
|
175
|
+
"Step": {
|
176
|
+
"location": "global",
|
177
|
+
"id": "global::Step"
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}
|
181
|
+
}];
|
182
|
+
}
|
183
|
+
static get elementRef() { return "host"; }
|
184
|
+
static get watchers() {
|
185
|
+
return [{
|
186
|
+
"propName": "activeStep",
|
187
|
+
"methodName": "handleActiveStepChange"
|
188
|
+
}];
|
189
|
+
}
|
190
|
+
}
|
@@ -0,0 +1,231 @@
|
|
1
|
+
:host,
|
2
|
+
*,
|
3
|
+
*::before,
|
4
|
+
*::after {
|
5
|
+
box-sizing: border-box;
|
6
|
+
}
|
7
|
+
[hidden] {
|
8
|
+
display: none !important;
|
9
|
+
}
|
10
|
+
@media (prefers-reduced-motion: reduce) {
|
11
|
+
:host,
|
12
|
+
*,
|
13
|
+
*::before,
|
14
|
+
*::after {
|
15
|
+
animation-duration: 0.01ms !important;
|
16
|
+
animation-iteration-count: 1 !important;
|
17
|
+
transition-duration: 0.01ms !important;
|
18
|
+
scroll-behavior: auto !important;
|
19
|
+
}
|
20
|
+
}:host,
|
21
|
+
*,
|
22
|
+
*::before,
|
23
|
+
*::after {
|
24
|
+
box-sizing: border-box;
|
25
|
+
}
|
26
|
+
[hidden] {
|
27
|
+
display: none !important;
|
28
|
+
}
|
29
|
+
@media (prefers-reduced-motion: reduce) {
|
30
|
+
:host,
|
31
|
+
*,
|
32
|
+
*::before,
|
33
|
+
*::after {
|
34
|
+
animation-duration: 0.01ms !important;
|
35
|
+
animation-iteration-count: 1 !important;
|
36
|
+
transition-duration: 0.01ms !important;
|
37
|
+
scroll-behavior: auto !important;
|
38
|
+
}
|
39
|
+
}/** Typography */
|
40
|
+
:host {
|
41
|
+
/**
|
42
|
+
* @prop --background: the background color of the step breadcrumb. Defaults to var(--nano-color-base-0).
|
43
|
+
*/
|
44
|
+
display: block;
|
45
|
+
--background: var(--nano-color-base-0);
|
46
|
+
}
|
47
|
+
|
48
|
+
.step-wrapper {
|
49
|
+
container-type: inline-size;
|
50
|
+
}
|
51
|
+
|
52
|
+
.step-list.desktop {
|
53
|
+
display: flex;
|
54
|
+
flex-direction: row;
|
55
|
+
align-items: center;
|
56
|
+
justify-content: space-between;
|
57
|
+
list-style: none;
|
58
|
+
padding: 0;
|
59
|
+
margin: 0;
|
60
|
+
position: relative;
|
61
|
+
z-index: 1;
|
62
|
+
}
|
63
|
+
.step-list.desktop::before {
|
64
|
+
content: "";
|
65
|
+
display: block;
|
66
|
+
flex-grow: 1;
|
67
|
+
block-size: 1px;
|
68
|
+
background-color: var(--nano-color-neutral-300);
|
69
|
+
position: absolute;
|
70
|
+
inset-block-start: 50%;
|
71
|
+
z-index: -1;
|
72
|
+
inset-inline-start: 0;
|
73
|
+
inline-size: 100%;
|
74
|
+
}
|
75
|
+
|
76
|
+
.step-item-wrapper {
|
77
|
+
flex: 0 1 auto;
|
78
|
+
display: inline-flex;
|
79
|
+
align-items: center;
|
80
|
+
cursor: pointer;
|
81
|
+
}
|
82
|
+
.step-item-wrapper:last-of-type {
|
83
|
+
flex: 0 1 auto;
|
84
|
+
}
|
85
|
+
.step-item-wrapper:last-of-type .step-item {
|
86
|
+
padding-inline-end: 0;
|
87
|
+
}
|
88
|
+
.step-item-wrapper:first-of-type::before {
|
89
|
+
display: none;
|
90
|
+
}
|
91
|
+
.step-item-wrapper:first-of-type .step-item {
|
92
|
+
padding-inline-start: 0;
|
93
|
+
}
|
94
|
+
.step-item-wrapper::before {
|
95
|
+
content: "";
|
96
|
+
grid-column: 2;
|
97
|
+
grid-row: 1;
|
98
|
+
inline-size: 0.4rem;
|
99
|
+
block-size: 0.4rem;
|
100
|
+
place-self: center end;
|
101
|
+
inset-block-start: 0.5px;
|
102
|
+
position: relative;
|
103
|
+
border-inline-end: 1px solid var(--nano-color-neutral-300);
|
104
|
+
border-block-end: 1px solid var(--nano-color-neutral-300);
|
105
|
+
rotate: -45deg;
|
106
|
+
}
|
107
|
+
|
108
|
+
:dir(rtl) .step-item-wrapper::after {
|
109
|
+
rotate: 45deg;
|
110
|
+
}
|
111
|
+
|
112
|
+
.step-item {
|
113
|
+
all: unset;
|
114
|
+
display: inline-flex;
|
115
|
+
align-items: center;
|
116
|
+
gap: var(--nano-spacing-sm);
|
117
|
+
background-color: var(--background);
|
118
|
+
padding: 0 var(--nano-spacing-sm);
|
119
|
+
position: relative;
|
120
|
+
}
|
121
|
+
.step-item:focus-visible {
|
122
|
+
outline: var(--nano-focus-ring);
|
123
|
+
outline-offset: var(--nano-focus-ring-offset);
|
124
|
+
z-index: 1;
|
125
|
+
}
|
126
|
+
.step-item.step-item--disabled {
|
127
|
+
cursor: not-allowed;
|
128
|
+
}
|
129
|
+
.step-item.step-item--disabled > * {
|
130
|
+
opacity: 0.5;
|
131
|
+
}
|
132
|
+
|
133
|
+
.step-item-icon {
|
134
|
+
font-size: var(--nano-font-size-xs);
|
135
|
+
line-height: var(--nano-line-height-normal);
|
136
|
+
letter-spacing: var(--nano-letter-spacing-loose);
|
137
|
+
display: inline-flex;
|
138
|
+
align-items: center;
|
139
|
+
justify-content: center;
|
140
|
+
inline-size: 1.5rem;
|
141
|
+
block-size: 1.5rem;
|
142
|
+
border-radius: var(--nano-border-radius-circle);
|
143
|
+
background-color: transparent;
|
144
|
+
color: var(--nano-color-neutral-1400);
|
145
|
+
border: 1px solid var(--nano-color-neutral-300);
|
146
|
+
}
|
147
|
+
.step-item--complete .step-item-icon {
|
148
|
+
background-color: var(--nano-color-success-1000);
|
149
|
+
color: var(--nano-color-base-0);
|
150
|
+
border: none;
|
151
|
+
}
|
152
|
+
.step-item--active .step-item-icon {
|
153
|
+
background-color: var(--nano-color-primary-1000);
|
154
|
+
color: var(--nano-color-base-0);
|
155
|
+
border: none;
|
156
|
+
}
|
157
|
+
|
158
|
+
.step-dropdown {
|
159
|
+
inline-size: 100%;
|
160
|
+
min-inline-size: 300px;
|
161
|
+
}
|
162
|
+
|
163
|
+
.step-trigger {
|
164
|
+
all: unset;
|
165
|
+
display: inline-flex;
|
166
|
+
gap: var(--nano-spacing-md);
|
167
|
+
align-items: center;
|
168
|
+
inline-size: 100%;
|
169
|
+
cursor: pointer;
|
170
|
+
}
|
171
|
+
|
172
|
+
.step-trigger-text {
|
173
|
+
display: flex;
|
174
|
+
flex-direction: column;
|
175
|
+
}
|
176
|
+
|
177
|
+
.step-trigger-now {
|
178
|
+
font-weight: var(--nano-font-weight-normal);
|
179
|
+
font-size: var(--nano-font-size-xl);
|
180
|
+
line-height: var(--nano-line-height-denser);
|
181
|
+
text-wrap: balance;
|
182
|
+
color: var(--nano-color-neutral-1400);
|
183
|
+
}
|
184
|
+
|
185
|
+
.step-trigger-next {
|
186
|
+
font-size: var(--nano-font-size-2xs);
|
187
|
+
line-height: var(--nano-line-height-normal);
|
188
|
+
letter-spacing: var(--nano-letter-spacing-loose);
|
189
|
+
color: var(--nano-color-neutral-1000);
|
190
|
+
}
|
191
|
+
|
192
|
+
.step-trigger-icon {
|
193
|
+
margin-inline-start: auto;
|
194
|
+
color: var(--nano-color-primary-1000);
|
195
|
+
transition: var(--nano-transition-x-fast) rotate;
|
196
|
+
}
|
197
|
+
[open] .step-trigger-icon {
|
198
|
+
rotate: 180deg;
|
199
|
+
}
|
200
|
+
|
201
|
+
.step-progress-circle {
|
202
|
+
--size: 64px;
|
203
|
+
--thickness: 4px;
|
204
|
+
inline-size: var(--size);
|
205
|
+
min-inline-size: var(--size);
|
206
|
+
aspect-ratio: 1/1;
|
207
|
+
border-radius: 50%;
|
208
|
+
display: grid;
|
209
|
+
place-items: center;
|
210
|
+
position: relative;
|
211
|
+
}
|
212
|
+
.step-progress-circle::before {
|
213
|
+
content: "";
|
214
|
+
position: absolute;
|
215
|
+
inset: 0;
|
216
|
+
border-radius: 50%;
|
217
|
+
background: conic-gradient(var(--nano-color-success-1000) calc(var(--value) / var(--max) * 360deg), var(--nano-color-neutral-100) 0);
|
218
|
+
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%);
|
219
|
+
mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%);
|
220
|
+
}
|
221
|
+
|
222
|
+
.step-progress-title {
|
223
|
+
font-size: var(--nano-font-size-sm);
|
224
|
+
line-height: var(--nano-line-height-normal);
|
225
|
+
font-weight: var(--nano-font-weight-bold);
|
226
|
+
white-space: nowrap;
|
227
|
+
color: var(--nano-color-neutral-1000);
|
228
|
+
}
|
229
|
+
.step-progress-title strong {
|
230
|
+
color: var(--nano-color-neutral-1400);
|
231
|
+
}
|