@nanoporetech-digital/components 4.9.4 → 5.0.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/CHANGELOG.md +51 -0
- package/dist/cjs/drag-777bd8dd.js +74 -0
- package/dist/cjs/drag-777bd8dd.js.map +1 -0
- package/dist/cjs/{form-control-2e900f54.js → form-control-443e90bf.js} +2 -3
- package/dist/cjs/form-control-443e90bf.js.map +1 -0
- package/dist/cjs/index-71f899a7.js +10 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +6 -6
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-grid-item.cjs.entry.js +29 -0
- package/dist/cjs/nano-grid-item.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-grid_2.cjs.entry.js +436 -0
- package/dist/cjs/nano-grid_2.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-hero.cjs.entry.js +4 -10
- package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-icon-button_2.cjs.entry.js +40 -3
- package/dist/cjs/nano-icon-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-input.cjs.entry.js +2 -2
- package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-range.cjs.entry.js +1 -1
- package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-sortable.cjs.entry.js +654 -0
- package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-split-pane.cjs.entry.js +30 -45
- package/dist/cjs/nano-split-pane.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js +39 -43
- package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-tab.cjs.entry.js +3 -3
- package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-54a4ba34.js → nano-table-11052a34.js} +52 -172
- package/dist/cjs/nano-table-11052a34.js.map +1 -0
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/{table.worker-20ed37a5.js → table.worker-83433a8b.js} +3 -3
- package/dist/cjs/table.worker-83433a8b.js.map +1 -0
- package/dist/cjs/{table.worker-f820b411.js → table.worker-bd51e29f.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/form-control/form-control.js +1 -2
- package/dist/collection/components/form-control/form-control.js.map +1 -1
- package/dist/collection/components/grid/grid-item.js +11 -136
- package/dist/collection/components/grid/grid-item.js.map +1 -1
- package/dist/collection/components/grid/grid.css +9 -242
- package/dist/collection/components/grid/grid.js +248 -240
- package/dist/collection/components/grid/grid.js.map +1 -1
- package/dist/collection/components/hero/hero.css +42 -89
- package/dist/collection/components/hero/hero.js +4 -11
- package/dist/collection/components/hero/hero.js.map +1 -1
- package/dist/collection/components/icon-button/icon-button.css +18 -4
- package/dist/collection/components/icon-button/icon-button.js +83 -4
- package/dist/collection/components/icon-button/icon-button.js.map +1 -1
- package/dist/collection/components/input/input.css +8 -9
- package/dist/collection/components/nav-item/nav-item.js +4 -4
- package/dist/collection/components/nav-item/nav-item.js.map +1 -1
- package/dist/collection/components/range/range.css +0 -3
- package/dist/collection/components/select/select.css +8 -9
- package/dist/collection/components/sortable/sortable.css +28 -0
- package/dist/collection/components/sortable/sortable.js +1181 -0
- package/dist/collection/components/sortable/sortable.js.map +1 -0
- package/dist/collection/components/split-pane/split-pane.js +29 -27
- package/dist/collection/components/split-pane/split-pane.js.map +1 -1
- package/dist/collection/components/table/table-interface.js.map +1 -1
- package/dist/collection/components/table/table.css +18 -38
- package/dist/collection/components/table/table.header.js +3 -86
- package/dist/collection/components/table/table.header.js.map +1 -1
- package/dist/collection/components/table/table.js +27 -108
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/components/table/table.row.js +7 -7
- package/dist/collection/components/table/table.row.js.map +1 -1
- package/dist/collection/components/table/table.store.js +1 -1
- package/dist/collection/components/table/table.store.js.map +1 -1
- package/dist/collection/components/table/table.worker.js +3 -3
- package/dist/collection/components/table/table.worker.js.map +1 -1
- package/dist/collection/components/tabs/tab-group.css +9 -13
- package/dist/collection/components/tabs/tab-group.js +39 -43
- package/dist/collection/components/tabs/tab-group.js.map +1 -1
- package/dist/collection/components/tabs/tab.css +53 -14
- package/dist/collection/components/tabs/tab.js +8 -2
- package/dist/collection/components/tabs/tab.js.map +1 -1
- package/dist/collection/utils/constructible-style.js +129 -0
- package/dist/collection/utils/constructible-style.js.map +1 -0
- package/dist/collection/utils/drag.js +52 -4
- package/dist/collection/utils/drag.js.map +1 -1
- package/dist/components/drag.js +72 -0
- package/dist/components/drag.js.map +1 -0
- package/dist/components/form-control.js +1 -2
- package/dist/components/form-control.js.map +1 -1
- package/dist/components/grid.js +268 -183
- package/dist/components/grid.js.map +1 -1
- package/dist/components/icon-button.js +45 -5
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/nano-grid-item.js +33 -1
- package/dist/components/nano-grid-item.js.map +1 -1
- package/dist/components/nano-hero.js +6 -19
- package/dist/components/nano-hero.js.map +1 -1
- package/dist/components/nano-range.js +1 -1
- package/dist/components/nano-range.js.map +1 -1
- package/dist/components/nano-sortable.d.ts +11 -0
- package/dist/components/nano-sortable.js +692 -0
- package/dist/components/nano-sortable.js.map +1 -0
- package/dist/components/nano-split-pane.js +30 -45
- package/dist/components/nano-split-pane.js.map +1 -1
- package/dist/components/nano-tab-group.js +40 -44
- package/dist/components/nano-tab-group.js.map +1 -1
- package/dist/components/nano-tab.js +3 -3
- package/dist/components/nano-tab.js.map +1 -1
- package/dist/components/nav-item.js +4 -4
- package/dist/components/nav-item.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/table.js +52 -173
- package/dist/components/table.js.map +1 -1
- package/dist/components/table.worker.js +1 -1
- package/dist/esm/drag-1723a4cc.js +72 -0
- package/dist/esm/drag-1723a4cc.js.map +1 -0
- package/dist/esm/{form-control-269ba84f.js → form-control-e8739b2e.js} +2 -3
- package/dist/esm/form-control-e8739b2e.js.map +1 -0
- package/dist/esm/index-dad5627b.js +10 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +6 -6
- package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
- package/dist/esm/nano-grid-item.entry.js +25 -0
- package/dist/esm/nano-grid-item.entry.js.map +1 -0
- package/dist/esm/nano-grid_2.entry.js +431 -0
- package/dist/esm/nano-grid_2.entry.js.map +1 -0
- package/dist/esm/nano-hero.entry.js +4 -10
- package/dist/esm/nano-hero.entry.js.map +1 -1
- package/dist/esm/nano-icon-button_2.entry.js +41 -4
- package/dist/esm/nano-icon-button_2.entry.js.map +1 -1
- package/dist/esm/nano-input.entry.js +2 -2
- package/dist/esm/nano-input.entry.js.map +1 -1
- package/dist/esm/nano-range.entry.js +1 -1
- package/dist/esm/nano-range.entry.js.map +1 -1
- package/dist/esm/nano-sortable.entry.js +650 -0
- package/dist/esm/nano-sortable.entry.js.map +1 -0
- package/dist/esm/nano-split-pane.entry.js +30 -45
- package/dist/esm/nano-split-pane.entry.js.map +1 -1
- package/dist/esm/nano-tab-group.entry.js +39 -43
- package/dist/esm/nano-tab-group.entry.js.map +1 -1
- package/dist/esm/nano-tab.entry.js +3 -3
- package/dist/esm/nano-tab.entry.js.map +1 -1
- package/dist/esm/{nano-table-929ac4d9.js → nano-table-ba637f26.js} +53 -173
- package/dist/esm/nano-table-ba637f26.js.map +1 -0
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/esm/{table.worker-2425382a.js → table.worker-1cae39c9.js} +3 -3
- package/dist/esm/table.worker-1cae39c9.js.map +1 -0
- package/dist/{nano-components/p-f820b411.js → esm/table.worker-bd51e29f.js} +1 -1
- package/dist/nano-components/nano-components.css +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js.map +1 -1
- package/dist/nano-components/p-00cf8021.entry.js +5 -0
- package/dist/nano-components/p-00cf8021.entry.js.map +1 -0
- package/dist/nano-components/{p-906de5a2.entry.js → p-158c73b0.entry.js} +2 -2
- package/dist/nano-components/p-365c997a.js +5 -0
- package/dist/nano-components/p-553acf24.entry.js +5 -0
- package/dist/nano-components/p-553acf24.entry.js.map +1 -0
- package/dist/nano-components/p-6975f110.entry.js +5 -0
- package/dist/nano-components/p-6975f110.entry.js.map +1 -0
- package/dist/nano-components/p-71057181.js +5 -0
- package/dist/nano-components/p-71057181.js.map +1 -0
- package/dist/nano-components/p-842cf127.js +5 -0
- package/dist/nano-components/p-842cf127.js.map +1 -0
- package/dist/nano-components/p-ad6209ec.entry.js +5 -0
- package/dist/nano-components/p-ad6209ec.entry.js.map +1 -0
- package/dist/nano-components/p-b8e76fdf.entry.js +5 -0
- package/dist/nano-components/p-b8e76fdf.entry.js.map +1 -0
- package/dist/{esm/table.worker-f820b411.js → nano-components/p-bd51e29f.js} +1 -1
- package/dist/nano-components/p-bdef618c.entry.js +5 -0
- package/dist/nano-components/p-bdef618c.entry.js.map +1 -0
- package/dist/nano-components/p-d79c6862.entry.js +5 -0
- package/dist/nano-components/p-d79c6862.entry.js.map +1 -0
- package/dist/nano-components/p-deb0799c.entry.js +5 -0
- package/dist/nano-components/{p-6a3a29c6.entry.js.map → p-deb0799c.entry.js.map} +1 -1
- package/dist/nano-components/p-ebb98a9e.entry.js +5 -0
- package/dist/nano-components/p-ebb98a9e.entry.js.map +1 -0
- package/dist/nano-components/p-f60fe933.entry.js +5 -0
- package/dist/nano-components/p-f60fe933.entry.js.map +1 -0
- package/dist/nano-components/p-f7535f45.entry.js +5 -0
- package/dist/nano-components/p-f7535f45.entry.js.map +1 -0
- package/dist/nano-components/p-fc585ea2.js +5 -0
- package/dist/nano-components/p-fc585ea2.js.map +1 -0
- package/dist/types/components/grid/grid-item.d.ts +3 -11
- package/dist/types/components/grid/grid.d.ts +44 -68
- package/dist/types/components/hero/hero.d.ts +1 -3
- package/dist/types/components/icon-button/icon-button.d.ts +14 -0
- package/dist/types/components/sortable/sortable.d.ts +204 -0
- package/dist/types/components/table/table-interface.d.ts +2 -4
- package/dist/types/components/table/table.d.ts +5 -30
- package/dist/types/components/table/table.header.d.ts +0 -3
- package/dist/types/components/tabs/tab-group.d.ts +0 -1
- package/dist/types/components/tabs/tab.d.ts +6 -0
- package/dist/types/components.d.ts +333 -89
- package/dist/types/utils/constructible-style.d.ts +31 -0
- package/dist/types/utils/drag.d.ts +21 -1
- package/docs-json.json +743 -168
- package/docs-vscode.json +102 -26
- package/hydrate/index.js +1210 -552
- package/package.json +2 -2
- package/dist/cjs/form-control-2e900f54.js.map +0 -1
- package/dist/cjs/nano-grid_3.cjs.entry.js +0 -431
- package/dist/cjs/nano-grid_3.cjs.entry.js.map +0 -1
- package/dist/cjs/nano-table-54a4ba34.js.map +0 -1
- package/dist/cjs/table.worker-20ed37a5.js.map +0 -1
- package/dist/collection/components/grid/grid-item.css +0 -15
- package/dist/components/grid-item.js +0 -107
- package/dist/components/grid-item.js.map +0 -1
- package/dist/esm/form-control-269ba84f.js.map +0 -1
- package/dist/esm/nano-grid_3.entry.js +0 -425
- package/dist/esm/nano-grid_3.entry.js.map +0 -1
- package/dist/esm/nano-table-929ac4d9.js.map +0 -1
- package/dist/esm/table.worker-2425382a.js.map +0 -1
- package/dist/nano-components/p-068bdd89.entry.js +0 -5
- package/dist/nano-components/p-068bdd89.entry.js.map +0 -1
- package/dist/nano-components/p-107d4549.entry.js +0 -5
- package/dist/nano-components/p-107d4549.entry.js.map +0 -1
- package/dist/nano-components/p-239d343a.entry.js +0 -5
- package/dist/nano-components/p-239d343a.entry.js.map +0 -1
- package/dist/nano-components/p-4f260028.js +0 -5
- package/dist/nano-components/p-4f260028.js.map +0 -1
- package/dist/nano-components/p-5381c118.js +0 -5
- package/dist/nano-components/p-58b53239.entry.js +0 -5
- package/dist/nano-components/p-58b53239.entry.js.map +0 -1
- package/dist/nano-components/p-5ac74848.js +0 -5
- package/dist/nano-components/p-5ac74848.js.map +0 -1
- package/dist/nano-components/p-64b56ee6.entry.js +0 -5
- package/dist/nano-components/p-64b56ee6.entry.js.map +0 -1
- package/dist/nano-components/p-6a3a29c6.entry.js +0 -5
- package/dist/nano-components/p-a5a560e7.entry.js +0 -5
- package/dist/nano-components/p-a5a560e7.entry.js.map +0 -1
- package/dist/nano-components/p-a761ac89.entry.js +0 -5
- package/dist/nano-components/p-a761ac89.entry.js.map +0 -1
- package/dist/nano-components/p-d792f692.entry.js +0 -5
- package/dist/nano-components/p-d792f692.entry.js.map +0 -1
- /package/dist/nano-components/{p-5381c118.js.map → p-158c73b0.entry.js.map} +0 -0
- /package/dist/nano-components/{p-906de5a2.entry.js.map → p-365c997a.js.map} +0 -0
@@ -1,425 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Web Components for Nanopore digital Web Apps
|
3
|
-
*/
|
4
|
-
import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-dad5627b.js';
|
5
|
-
import { d as debounce } from './throttle-7836544e.js';
|
6
|
-
|
7
|
-
const gridCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--grid-col-gap:var(--nano-spacing-medium, 16px);--grid-row-gap:var(--nano-spacing-medium, 16px);--current-grid-size:\"'grid size: sm'\";display:block;opacity:0;transition:0.2s ease opacity;max-width:100%}:host .grid{display:grid;grid-gap:var(--grid-row-gap) var(--grid-col-gap);block-size:inherit;min-block-size:inherit}:host(.ready){opacity:1}:host(.has-grid) .grid{display:grid}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-1){grid-column-start:1 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-1){grid-row-start:1 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-1){grid-column-end:span 1 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-1){grid-row-end:span 1 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-2){grid-column-start:2 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-2){grid-row-start:2 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-2){grid-column-end:span 2 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-2){grid-row-end:span 2 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-3){grid-column-start:3 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-3){grid-row-start:3 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-3){grid-column-end:span 3 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-3){grid-row-end:span 3 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-4){grid-column-start:4 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-4){grid-row-start:4 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-4){grid-column-end:span 4 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-4){grid-row-end:span 4 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-5){grid-column-start:5 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-5){grid-row-start:5 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-5){grid-column-end:span 5 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-5){grid-row-end:span 5 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-6){grid-column-start:6 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-6){grid-row-start:6 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-6){grid-column-end:span 6 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-6){grid-row-end:span 6 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-7){grid-column-start:7 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-7){grid-row-start:7 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-7){grid-column-end:span 7 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-7){grid-row-end:span 7 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-8){grid-column-start:8 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-8){grid-row-start:8 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-8){grid-column-end:span 8 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-8){grid-row-end:span 8 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-9){grid-column-start:9 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-9){grid-row-start:9 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-9){grid-column-end:span 9 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-9){grid-row-end:span 9 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-start-10){grid-column-start:10 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-start-10){grid-row-start:10 !important}:host(.has-grid) .grid ::slotted(.nano-grid-col-span-10){grid-column-end:span 10 !important}:host(.has-grid) .grid ::slotted(.nano-grid-row-span-10){grid-row-end:span 10 !important}:host([content-panel]:not([content-panel=false])) .grid{grid-template-rows:auto 1fr}:host([full-height]:not([full-height=false])){block-size:100%}:host([full-height]:not([full-height=false])) .grid{grid-template-rows:1fr}:host([show-helper]:not([show-helper=false])) .grid{position:relative}:host([show-helper]:not([show-helper=false])) .grid::after{content:\"\";position:absolute;inset:0;pointer-events:none;background-image:repeating-linear-gradient(to right, rgba(126, 195, 241, 0.25), rgba(126, 195, 241, 0.25) var(--col-width), transparent var(--col-width), transparent var(--repeat-width));background-size:calc(100% + var(--grid-col-gap)) 100%;z-index:100}:host([show-helper]:not([show-helper=false])) .grid::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(.nano-grid-1){--current-grid-size:\"grid size: 1\";--col-width:calc(100% - var(--grid-col-gap));--repeat-width:calc(100% / 1)}:host(.nano-grid-1) .grid{grid-template-columns:repeat(1, minmax(var(--col-width), 1fr))}:host(.nano-grid-2){--current-grid-size:\"grid size: 2\";--col-width:calc(50% - var(--grid-col-gap));--repeat-width:calc(100% / 2)}:host(.nano-grid-2) .grid{grid-template-columns:repeat(2, minmax(var(--col-width), 1fr))}:host(.nano-grid-3){--current-grid-size:\"grid size: 3\";--col-width:calc(33.3333333333% - var(--grid-col-gap));--repeat-width:calc(100% / 3)}:host(.nano-grid-3) .grid{grid-template-columns:repeat(3, minmax(var(--col-width), 1fr))}:host(.nano-grid-4){--current-grid-size:\"grid size: 4\";--col-width:calc(25% - var(--grid-col-gap));--repeat-width:calc(100% / 4)}:host(.nano-grid-4) .grid{grid-template-columns:repeat(4, minmax(var(--col-width), 1fr))}:host(.nano-grid-5){--current-grid-size:\"grid size: 5\";--col-width:calc(20% - var(--grid-col-gap));--repeat-width:calc(100% / 5)}:host(.nano-grid-5) .grid{grid-template-columns:repeat(5, minmax(var(--col-width), 1fr))}:host(.nano-grid-6){--current-grid-size:\"grid size: 6\";--col-width:calc(16.6666666667% - var(--grid-col-gap));--repeat-width:calc(100% / 6)}:host(.nano-grid-6) .grid{grid-template-columns:repeat(6, minmax(var(--col-width), 1fr))}:host(.nano-grid-7){--current-grid-size:\"grid size: 7\";--col-width:calc(14.2857142857% - var(--grid-col-gap));--repeat-width:calc(100% / 7)}:host(.nano-grid-7) .grid{grid-template-columns:repeat(7, minmax(var(--col-width), 1fr))}:host(.nano-grid-8){--current-grid-size:\"grid size: 8\";--col-width:calc(12.5% - var(--grid-col-gap));--repeat-width:calc(100% / 8)}:host(.nano-grid-8) .grid{grid-template-columns:repeat(8, minmax(var(--col-width), 1fr))}:host(.nano-grid-9){--current-grid-size:\"grid size: 9\";--col-width:calc(11.1111111111% - var(--grid-col-gap));--repeat-width:calc(100% / 9)}:host(.nano-grid-9) .grid{grid-template-columns:repeat(9, minmax(var(--col-width), 1fr))}:host(.nano-grid-10){--current-grid-size:\"grid size: 10\";--col-width:calc(10% - var(--grid-col-gap));--repeat-width:calc(100% / 10)}:host(.nano-grid-10) .grid{grid-template-columns:repeat(10, minmax(var(--col-width), 1fr))}";
|
8
|
-
|
9
|
-
const STATEOPTS$1 = ['col-span', 'col-start', 'row-span', 'row-start'];
|
10
|
-
const Grid = class {
|
11
|
-
constructor(hostRef) {
|
12
|
-
registerInstance(this, hostRef);
|
13
|
-
this.nanoBpChange = createEvent(this, "nanoBpChange", 7);
|
14
|
-
this.generalClasses = [''];
|
15
|
-
this.gridClass = null;
|
16
|
-
this.isSizes = [null];
|
17
|
-
this.ready = false;
|
18
|
-
this.isSmall = false;
|
19
|
-
this.isMedium = false;
|
20
|
-
this.isLarge = false;
|
21
|
-
this.isXL = false;
|
22
|
-
this.isXXL = false;
|
23
|
-
this.sSize = 300;
|
24
|
-
this.mSize = 550;
|
25
|
-
this.lSize = 800;
|
26
|
-
this.xlSize = 1000;
|
27
|
-
this.sCols = undefined;
|
28
|
-
this.mCols = undefined;
|
29
|
-
this.lCols = undefined;
|
30
|
-
this.xlCols = undefined;
|
31
|
-
this.xxlCols = undefined;
|
32
|
-
this.showHelper = false;
|
33
|
-
this.contentPanel = false;
|
34
|
-
this.fullHeight = false;
|
35
|
-
this.stateChange = debounce(this.stateChange.bind(this), 100);
|
36
|
-
}
|
37
|
-
propChanged() {
|
38
|
-
this.applySizeClasses();
|
39
|
-
}
|
40
|
-
applySizeClasses() {
|
41
|
-
const size = this.currentWidth;
|
42
|
-
this.isSmall = false;
|
43
|
-
this.isMedium = false;
|
44
|
-
this.isLarge = false;
|
45
|
-
this.isXL = false;
|
46
|
-
this.isXXL = false;
|
47
|
-
this.generalClasses = [];
|
48
|
-
this.gridClass = null;
|
49
|
-
this.isSizes = [null];
|
50
|
-
this.isSmall = true;
|
51
|
-
this.generalClasses.push('is-small');
|
52
|
-
if (this.sCols)
|
53
|
-
this.gridClass = `nano-grid-${this.sCols}`;
|
54
|
-
this.isSizes.push({ size: 's', active: true });
|
55
|
-
if (size > this.sSize) {
|
56
|
-
this.isMedium = true;
|
57
|
-
this.generalClasses.push('is-medium');
|
58
|
-
if (this.mCols)
|
59
|
-
this.gridClass = `nano-grid-${this.mCols}`;
|
60
|
-
this.isSizes.push({ size: 'm', active: true });
|
61
|
-
}
|
62
|
-
if (size > this.mSize) {
|
63
|
-
this.isLarge = true;
|
64
|
-
this.generalClasses.push('is-large');
|
65
|
-
if (this.lCols)
|
66
|
-
this.gridClass = `nano-grid-${this.lCols}`;
|
67
|
-
this.isSizes.push({ size: 'l', active: true });
|
68
|
-
}
|
69
|
-
if (size > this.lSize) {
|
70
|
-
this.isXL = true;
|
71
|
-
this.generalClasses.push('is-xl');
|
72
|
-
if (this.xlCols)
|
73
|
-
this.gridClass = `nano-grid-${this.xlCols}`;
|
74
|
-
this.isSizes.push({ size: 'xl', active: true });
|
75
|
-
}
|
76
|
-
if (size > this.xlSize) {
|
77
|
-
this.isXXL = true;
|
78
|
-
this.generalClasses.push('is-xxl');
|
79
|
-
if (this.xxlCols)
|
80
|
-
this.gridClass = `nano-grid-${this.xxlCols}`;
|
81
|
-
this.isSizes.push({ size: 'xxl', active: true });
|
82
|
-
}
|
83
|
-
this.el.style.setProperty('--current-grid-size', `'grid size: ${this.isSizes.slice().pop().size}'`);
|
84
|
-
this.applyChildrenClasses();
|
85
|
-
setTimeout(() => (this.ready = true), 0);
|
86
|
-
}
|
87
|
-
stateChange() {
|
88
|
-
this.nanoBpChange.emit(this.generalClasses);
|
89
|
-
}
|
90
|
-
applyChildrenClasses() {
|
91
|
-
const gridItems = this.el.querySelectorAll('nano-grid-item');
|
92
|
-
if (gridItems.length) {
|
93
|
-
gridItems.forEach((gridItem) => {
|
94
|
-
gridItem.changeBP(this.isSizes);
|
95
|
-
});
|
96
|
-
return;
|
97
|
-
}
|
98
|
-
// this logic has been put into grid-item. Keep here for legacy for now
|
99
|
-
let stateArr = [''];
|
100
|
-
let itemState = '';
|
101
|
-
let found;
|
102
|
-
let classes;
|
103
|
-
const ctx = this.el;
|
104
|
-
// item states come in 4 possible flavours at every breakpoint. E.g.
|
105
|
-
// xl-col-span-2
|
106
|
-
// xl-col-start-2
|
107
|
-
// xl-row-span-2
|
108
|
-
// xl-row-start-2
|
109
|
-
// loop through all grid items with states.
|
110
|
-
[].map.call(ctx.children, (gItem) => {
|
111
|
-
if (!gItem.hasAttribute('grid-states'))
|
112
|
-
return;
|
113
|
-
// gridItems.forEach(gItem => {
|
114
|
-
// clear all previous grid state classnames
|
115
|
-
classes = gItem.className
|
116
|
-
.split(' ')
|
117
|
-
.filter((c) => !c.startsWith('nano-grid-'));
|
118
|
-
gItem.className = classes.join(' ').trim();
|
119
|
-
// get all potential states this element can have
|
120
|
-
const itemStates = gItem.getAttribute('grid-states').split(' ');
|
121
|
-
// loop through all potential state options: col & row span & start
|
122
|
-
STATEOPTS$1.forEach((stateOpt) => {
|
123
|
-
// reset found flag
|
124
|
-
found = false;
|
125
|
-
// loop through all the current valid breakpoints / sizes backwards because
|
126
|
-
// we only care about the item's state at the largest current breakpoint.
|
127
|
-
this.isSizes
|
128
|
-
.slice()
|
129
|
-
.reverse()
|
130
|
-
.forEach(function (size) {
|
131
|
-
if (found || !size)
|
132
|
-
return;
|
133
|
-
found = itemStates.find((state) => state.indexOf(`${size.size}-${stateOpt}`) === 0);
|
134
|
-
// found a state at this current size. apply class.
|
135
|
-
if (found) {
|
136
|
-
// clear previous grid state classname
|
137
|
-
classes = gItem.className
|
138
|
-
.split(' ')
|
139
|
-
.filter((c) => !c.includes('nano-grid-${stateOpt}'));
|
140
|
-
gItem.className = classes.join(' ').trim();
|
141
|
-
stateArr = found.split('-');
|
142
|
-
// remove the size of the state
|
143
|
-
stateArr.shift();
|
144
|
-
itemState = stateArr.join('-');
|
145
|
-
// add new class
|
146
|
-
gItem.classList.add(`nano-grid-${itemState}`);
|
147
|
-
}
|
148
|
-
});
|
149
|
-
});
|
150
|
-
});
|
151
|
-
}
|
152
|
-
componentWillLoad() {
|
153
|
-
const ctx = this.el;
|
154
|
-
[].map.call(ctx.children, (ele) => ele.classList.add('nano-griditem'));
|
155
|
-
}
|
156
|
-
componentDidLoad() {
|
157
|
-
if (!window['ResizeObserver'])
|
158
|
-
return;
|
159
|
-
this.ro = new ResizeObserver((entries) => {
|
160
|
-
for (const entry of entries) {
|
161
|
-
if (!entry.contentRect.width)
|
162
|
-
return;
|
163
|
-
this.currentWidth = entry.contentRect.width;
|
164
|
-
this.applySizeClasses();
|
165
|
-
}
|
166
|
-
});
|
167
|
-
this.ro.observe(this.el);
|
168
|
-
}
|
169
|
-
disconnectedCallback() {
|
170
|
-
if (this.ro)
|
171
|
-
this.ro.disconnect();
|
172
|
-
}
|
173
|
-
render() {
|
174
|
-
return (h(Host, { class: {
|
175
|
-
[this.generalClasses.join(' ')]: true,
|
176
|
-
'has-grid': !!this.gridClass,
|
177
|
-
ready: this.ready,
|
178
|
-
[this.gridClass]: true,
|
179
|
-
} }, h("div", { class: {
|
180
|
-
grid: true,
|
181
|
-
} }, h("slot", null))));
|
182
|
-
}
|
183
|
-
get el() { return getElement(this); }
|
184
|
-
static get watchers() { return {
|
185
|
-
"sSize": ["propChanged"],
|
186
|
-
"mSize": ["propChanged"],
|
187
|
-
"lSize": ["propChanged"],
|
188
|
-
"xlSize": ["propChanged"],
|
189
|
-
"sCols": ["propChanged"],
|
190
|
-
"mCols": ["propChanged"],
|
191
|
-
"lCols": ["propChanged"],
|
192
|
-
"xlCols": ["propChanged"],
|
193
|
-
"xxlCols": ["propChanged"],
|
194
|
-
"isSmall": ["stateChange"],
|
195
|
-
"isMedium": ["stateChange"],
|
196
|
-
"isLarge": ["stateChange"],
|
197
|
-
"isXL": ["stateChange"],
|
198
|
-
"isXXL": ["stateChange"]
|
199
|
-
}; }
|
200
|
-
};
|
201
|
-
Grid.style = gridCss;
|
202
|
-
|
203
|
-
const gridItemCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{display:inline-block}";
|
204
|
-
|
205
|
-
const STATEOPTS = ['col-span', 'col-start', 'row-span', 'row-start'];
|
206
|
-
const GridItem = class {
|
207
|
-
constructor(hostRef) {
|
208
|
-
registerInstance(this, hostRef);
|
209
|
-
this.currGridSizes = [null];
|
210
|
-
this.gridStates = '';
|
211
|
-
}
|
212
|
-
updateGridClasses() {
|
213
|
-
this.applyChildrenClasses();
|
214
|
-
}
|
215
|
-
/**
|
216
|
-
* Called by parent grid to trigger new classes
|
217
|
-
* @internal
|
218
|
-
*/
|
219
|
-
async changeBP(newGridSizes) {
|
220
|
-
if (this.currGridSizes === newGridSizes)
|
221
|
-
return;
|
222
|
-
this.currGridSizes = newGridSizes;
|
223
|
-
if (!this.gridStates.length)
|
224
|
-
return;
|
225
|
-
this.applyChildrenClasses();
|
226
|
-
}
|
227
|
-
applyChildrenClasses() {
|
228
|
-
let stateArr = [''];
|
229
|
-
let itemState = '';
|
230
|
-
let found;
|
231
|
-
let classes;
|
232
|
-
// item states come in 4 possible flavours at every breakpoint. E.g.
|
233
|
-
// xl-col-span-2
|
234
|
-
// xl-col-start-2
|
235
|
-
// xl-row-span-2
|
236
|
-
// xl-row-start-2
|
237
|
-
// clear all previous grid state classnames
|
238
|
-
classes = this.el.className
|
239
|
-
.split(' ')
|
240
|
-
.filter((c) => !c.startsWith('nano-grid-'));
|
241
|
-
this.el.className = classes.join(' ').trim();
|
242
|
-
// get all potential states this element can have
|
243
|
-
const itemStates = this.gridStates.split(' ');
|
244
|
-
// loop through all potential state options: col & row span & start
|
245
|
-
STATEOPTS.forEach((stateOpt) => {
|
246
|
-
// reset found flag
|
247
|
-
found = false;
|
248
|
-
// loop through all the current valid breakpoints / sizes backwards because
|
249
|
-
// we only care about the item's state at the largest current breakpoint.
|
250
|
-
this.currGridSizes
|
251
|
-
.slice()
|
252
|
-
.reverse()
|
253
|
-
.forEach((size) => {
|
254
|
-
if (found || !size)
|
255
|
-
return;
|
256
|
-
found = itemStates.find((state) => state.indexOf(`${size.size}-${stateOpt}`) === 0);
|
257
|
-
// found a state at this current size. apply class.
|
258
|
-
if (found) {
|
259
|
-
// clear previous grid state classname
|
260
|
-
classes = this.el.className
|
261
|
-
.split(' ')
|
262
|
-
.filter((c) => !c.includes('nano-grid-${stateOpt}'));
|
263
|
-
this.el.className = classes.join(' ').trim();
|
264
|
-
stateArr = found.split('-');
|
265
|
-
// remove the size of the state
|
266
|
-
stateArr.shift();
|
267
|
-
itemState = stateArr.join('-');
|
268
|
-
// add new class
|
269
|
-
this.el.classList.add(`nano-grid-${itemState}`);
|
270
|
-
}
|
271
|
-
});
|
272
|
-
});
|
273
|
-
}
|
274
|
-
render() {
|
275
|
-
return h("slot", null);
|
276
|
-
}
|
277
|
-
get el() { return getElement(this); }
|
278
|
-
static get watchers() { return {
|
279
|
-
"gridStates": ["updateGridClasses"]
|
280
|
-
}; }
|
281
|
-
};
|
282
|
-
GridItem.style = gridItemCss;
|
283
|
-
|
284
|
-
const imgCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--padding:0;display:inline-block;object-fit:cover;object-position:center;background-size:cover;background-position:center}:host *{border-radius:inherit}:host([background]:not([background=false])){display:block}.img{position:relative;object-fit:inherit;object-position:inherit;background-color:inherit;background-position:inherit;background-size:inherit;background-origin:inherit;background-attachment:inherit;background-repeat:inherit;flex:1 1 100%;display:flex;flex-direction:column;min-block-size:inherit;max-block-size:inherit;max-inline-size:inherit;min-height:inherit;min-width:inherit;block-size:inherit;inline-size:inherit;height:inherit;width:inherit;max-height:inherit;max-width:inherit;aspect-ratio:inherit}.img__loader,.img__observer{position:absolute;inset:0;block-size:100%;inline-size:100%;z-index:-1}.img__image,.img__bg{border-radius:inherit;display:block;opacity:0;transition:0.5s ease opacity, 0.3s ease filter 0.4s;filter:blur(5px);flex:1}.img__image.loaded,.img__bg.loaded{opacity:1;filter:blur(0)}@media not all and (min-resolution: 0.001dpcm){@supports (-webkit-appearance: none){.img__image.loaded,.img__bg.loaded{filter:blur(0)}}}.img__image{object-fit:inherit;object-position:inherit;max-inline-size:100%;min-block-size:inherit;max-block-size:inherit;min-height:inherit;min-width:inherit;block-size:auto;inline-size:inherit;height:inherit;width:inherit;max-height:inherit;max-width:inherit;aspect-ratio:inherit}.img__image.hide{visibility:hidden}.img__image.hide.no-height{block-size:1px;position:absolute;z-index:-1}.img__bg{background-color:inherit;background-position:inherit;background-size:inherit;background-origin:inherit;background-attachment:inherit;background-repeat:inherit;overflow:auto;padding:var(--padding)}.img__bg.no-height{position:absolute;inset:0}";
|
285
|
-
|
286
|
-
const Img = class {
|
287
|
-
constructor(hostRef) {
|
288
|
-
registerInstance(this, hostRef);
|
289
|
-
this.nanoImgWillLoad = createEvent(this, "nanoImgWillLoad", 7);
|
290
|
-
this.nanoImgDidLoad = createEvent(this, "nanoImgDidLoad", 7);
|
291
|
-
this.nanoImgError = createEvent(this, "nanoImgError", 7);
|
292
|
-
this._srcSet = {};
|
293
|
-
this.onLoad = () => {
|
294
|
-
this.nanoImgDidLoad.emit();
|
295
|
-
setTimeout(() => (this.hasLoaded = true), 50);
|
296
|
-
};
|
297
|
-
this.onError = () => {
|
298
|
-
this.nanoImgError.emit();
|
299
|
-
};
|
300
|
-
this.onResize = (e) => {
|
301
|
-
Object.entries(e.detail).forEach(([bp, active]) => {
|
302
|
-
this._srcSet[bp].active = active;
|
303
|
-
});
|
304
|
-
// sort and find the highest sized matching image.
|
305
|
-
const srcOpts = [];
|
306
|
-
Object.keys(this._srcSet)
|
307
|
-
.sort()
|
308
|
-
.forEach((bp) => {
|
309
|
-
if (this._srcSet[bp].active)
|
310
|
-
srcOpts.push(this._srcSet[bp].src);
|
311
|
-
});
|
312
|
-
if (srcOpts.length)
|
313
|
-
this._src = srcOpts.slice(-1)[0];
|
314
|
-
// no matching image? Set back to default
|
315
|
-
else
|
316
|
-
this._src = this.src;
|
317
|
-
};
|
318
|
-
this.loadSrc = undefined;
|
319
|
-
this.loadError = undefined;
|
320
|
-
this.hasLoaded = false;
|
321
|
-
this.imgStates = null;
|
322
|
-
this._src = undefined;
|
323
|
-
this.alt = undefined;
|
324
|
-
this.src = undefined;
|
325
|
-
this.srcSet = undefined;
|
326
|
-
this.lazy = true;
|
327
|
-
this.background = undefined;
|
328
|
-
this.autoHeight = 'content';
|
329
|
-
}
|
330
|
-
_srcChanged() {
|
331
|
-
this.hasLoaded = false;
|
332
|
-
this.addIO();
|
333
|
-
}
|
334
|
-
srcChanged() {
|
335
|
-
this._src = this.src;
|
336
|
-
}
|
337
|
-
srcSetChanged() {
|
338
|
-
if (!this.srcSet)
|
339
|
-
return;
|
340
|
-
delete this._srcSet;
|
341
|
-
this._srcSet = {};
|
342
|
-
this.imgStates = this.srcSet
|
343
|
-
.split(',')
|
344
|
-
.map((bpSrc) => {
|
345
|
-
const [bp, src] = bpSrc.split(' ').filter((bp) => bp.length);
|
346
|
-
this._srcSet[bp] = { src: src, active: false };
|
347
|
-
return bp;
|
348
|
-
})
|
349
|
-
.join(', ');
|
350
|
-
}
|
351
|
-
lazyChanged() {
|
352
|
-
if (!this.lazy)
|
353
|
-
this.load();
|
354
|
-
}
|
355
|
-
addIO() {
|
356
|
-
if (!this._src || this.hasLoaded)
|
357
|
-
return;
|
358
|
-
if (!this.lazy) {
|
359
|
-
this.load();
|
360
|
-
return;
|
361
|
-
}
|
362
|
-
if (typeof window !== 'undefined' &&
|
363
|
-
'IntersectionObserver' in window) {
|
364
|
-
this.removeIO();
|
365
|
-
this.io = new IntersectionObserver((data) => {
|
366
|
-
if (data[0].isIntersecting) {
|
367
|
-
this.load();
|
368
|
-
this.removeIO();
|
369
|
-
}
|
370
|
-
});
|
371
|
-
this.io.observe(this.host);
|
372
|
-
}
|
373
|
-
else
|
374
|
-
setTimeout(() => this.load(), 200);
|
375
|
-
}
|
376
|
-
load() {
|
377
|
-
this.loadError = this.onError;
|
378
|
-
this.loadSrc = this._src;
|
379
|
-
this.nanoImgWillLoad.emit();
|
380
|
-
}
|
381
|
-
removeIO() {
|
382
|
-
if (this.io) {
|
383
|
-
this.io.disconnect();
|
384
|
-
this.io = undefined;
|
385
|
-
}
|
386
|
-
}
|
387
|
-
connectedCallback() {
|
388
|
-
this.srcChanged();
|
389
|
-
this.srcSetChanged();
|
390
|
-
this.lazyChanged();
|
391
|
-
}
|
392
|
-
componentDidLoad() {
|
393
|
-
this.addIO();
|
394
|
-
}
|
395
|
-
disconnectedCallback() {
|
396
|
-
this.removeIO();
|
397
|
-
}
|
398
|
-
render() {
|
399
|
-
const bgStyle = !!this.loadSrc
|
400
|
-
? { 'background-image': `url(${this.loadSrc})` }
|
401
|
-
: {};
|
402
|
-
return (h("div", { class: "img" }, h("nano-skeleton", { class: "img__loader" }), !!this.background && (h("div", { class: {
|
403
|
-
loaded: this.hasLoaded,
|
404
|
-
img__bg: true,
|
405
|
-
'no-height': this.autoHeight === 'image',
|
406
|
-
}, style: bgStyle }, h("slot", null))), h("img", { class: {
|
407
|
-
img__image: true,
|
408
|
-
loaded: this.hasLoaded,
|
409
|
-
hide: this.background,
|
410
|
-
'no-height': this.autoHeight === 'content',
|
411
|
-
}, decoding: "async", src: this.loadSrc, loading: undefined, alt: this.alt, onLoad: this.onLoad, onError: this.loadError }), h("nano-resize-observe", { class: "img__observer", onNanoResizeStateChange: this.onResize, states: this.imgStates })));
|
412
|
-
}
|
413
|
-
get host() { return getElement(this); }
|
414
|
-
static get watchers() { return {
|
415
|
-
"_src": ["_srcChanged"],
|
416
|
-
"src": ["srcChanged"],
|
417
|
-
"srcSet": ["srcSetChanged"],
|
418
|
-
"lazy": ["lazyChanged"]
|
419
|
-
}; }
|
420
|
-
};
|
421
|
-
Img.style = imgCss;
|
422
|
-
|
423
|
-
export { Grid as nano_grid, GridItem as nano_grid_item, Img as nano_img };
|
424
|
-
|
425
|
-
//# sourceMappingURL=nano-grid_3.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"nano-grid.nano-grid-item.nano-img.entry.js","mappings":";;;;;;AAAA,MAAM,OAAO,GAAG,0jOAA0jO;;ACc1kO,MAAMA,WAAS,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;MAWxD,IAAI;EAQf;;;IALQ,mBAAc,GAAkB,CAAC,EAAE,CAAC,CAAC;IACrC,cAAS,GAAW,IAAI,CAAC;IACzB,YAAO,GAAgB,CAAC,IAAI,CAAC,CAAC;iBAOZ,KAAK;mBACZ,KAAK;oBACJ,KAAK;mBACN,KAAK;gBACR,KAAK;iBACJ,KAAK;iBAKE,GAAG;iBAKH,GAAG;iBAKH,GAAG;kBAKF,IAAI;;;;;;sBA8BkB,KAAK;wBAKH,KAAK;sBAKP,KAAK;IApElD,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;GAC/D;EAmFD,WAAW;IACT,IAAI,CAAC,gBAAgB,EAAE,CAAC;GACzB;EAEO,gBAAgB;IACtB,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC;IAE/B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACrB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACrB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IAEnB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;IACzB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;IAEtB,IAAI,CAAC,OAAO,G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b,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,SAAS,GACvB,EACF,2BACE,KAAK,EAAC,eAAe,EACrB,uBAAuB,EAAE,IAAI,CAAC,QAAQ,EACtC,MAAM,EAAE,IAAI,CAAC,SAAS,GACtB,CACE,EACN;GACH;;;;;;;;;;;;;","names":["STATEOPTS"],"sources":["./src/components/grid/grid.scss?tag=nano-grid&encapsulation=shadow","./src/components/grid/grid.tsx","./src/components/grid/grid-item.scss?tag=nano-grid-item&encapsulation=shadow","./src/components/grid/grid-item.tsx","./src/components/img/img.scss?tag=nano-img&encapsulation=shadow","./src/components/img/img.tsx"],"sourcesContent":["@use 'sass:math';\n\n@import '../../global/style/nano-theme/base';\n\n// ie 11 fixes ... maximum numbers we can place on the grid ... upping this number decreases performance a lot.\n$max-grid-cols: 10;\n\n@mixin grid($size: 1) {\n @at-root :host(.nano-grid-#{$size}) {\n --current-grid-size: 'grid size: #{$size}';\n --col-width: calc(#{math.div(100, $size)}% - var(--grid-col-gap));\n --repeat-width: calc(100% / #{$size});\n\n .grid {\n grid-template-columns: repeat(#{$size}, minmax(var(--col-width), 1fr));\n\n $current-column: 1;\n $current-row: 1;\n\n @for $i from 1 through ($max-grid-cols * 2) {\n @if $current-column > $size {\n $current-column: 1;\n $current-row: $current-row + 1;\n }\n $current-column: $current-column + 1;\n }\n }\n }\n}\n\n@mixin grid-spans {\n @for $i from 1 through $max-grid-cols {\n ::slotted(.nano-grid-col-start-#{$i}) {\n grid-column-start: #{$i} !important;\n }\n\n ::slotted(.nano-grid-row-start-#{$i}) {\n grid-row-start: #{$i} !important;\n }\n\n ::slotted(.nano-grid-col-span-#{$i}) {\n grid-column-end: span #{$i} !important;\n }\n\n ::slotted(.nano-grid-row-span-#{$i}) {\n grid-row-end: span #{$i} !important;\n }\n }\n}\n\n:host {\n /**\n * @prop --grid-col-gap: gap between all columns. Defaults to theme's global padding\n * @prop --grid-row-gap: gap between all rows. Defaults to theme's global padding\n */\n\n --grid-col-gap: #{$spacing-medium};\n --grid-row-gap: #{$spacing-medium};\n --current-grid-size: \"'grid size: sm'\";\n\n display: block;\n opacity: 0;\n transition: 0.2s ease opacity;\n max-width: 100%;\n\n .grid {\n /* autoprefixer: ignore next */\n display: grid;\n\n /* autoprefixer: ignore next */\n grid-gap: var(--grid-row-gap) var(--grid-col-gap);\n block-size: inherit;\n min-block-size: inherit;\n }\n}\n\n:host(.ready) {\n opacity: 1;\n}\n\n:host(.has-grid) {\n .grid {\n display: grid;\n\n @include grid-spans;\n }\n}\n\n:host([content-panel]:not([content-panel='false'])) {\n .grid {\n grid-template-rows: auto 1fr;\n }\n}\n\n:host([full-height]:not([full-height='false'])) {\n block-size: 100%;\n\n .grid {\n grid-template-rows: 1fr;\n }\n}\n\n:host([show-helper]:not([show-helper='false'])) {\n .grid {\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n background-image:\n repeating-linear-gradient(\n to right,\n hsl(204deg 80% 72% / 25%),\n hsl(204deg 80% 72% / 25%) var(--col-width),\n transparent var(--col-width),\n transparent var(--repeat-width)\n );\n background-size: calc(100% + var(--grid-col-gap)) 100%;\n z-index: 100;\n }\n\n &::before {\n content: var(--current-grid-size);\n font-size: 30px;\n position: absolute;\n inline-size: 100%;\n inset-inline-start: 0;\n text-align: center;\n inset-block-start: 50%;\n transform: translateY(-50%);\n color: rgb(0 0 0 / 20%);\n text-transform: uppercase;\n z-index: 99;\n pointer-events: none;\n }\n }\n}\n\n@for $i from 1 through $max-grid-cols {\n @include grid($i);\n}\n","import {\n Component,\n h,\n Prop,\n Element,\n Host,\n State,\n Watch,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { debounce } from '../../utils/throttle';\nimport type { GridSizes } from '../../interface';\n\nconst STATEOPTS = ['col-span', 'col-start', 'row-span', 'row-start'];\n\n/**\n * A context-aware CSS grid implementation.\n * Uses it's own width to choose column number - not screen width.\n */\n@Component({\n tag: 'nano-grid',\n styleUrl: 'grid.scss',\n shadow: true,\n})\nexport class Grid {\n @Element() private el: HTMLNanoGridElement;\n private ro: ResizeObserver;\n private generalClasses: Array<string> = [''];\n private gridClass: string = null;\n private isSizes: GridSizes[] = [null];\n private currentWidth: number;\n\n constructor() {\n this.stateChange = debounce(this.stateChange.bind(this), 100);\n }\n\n @State() ready: boolean = false;\n @State() isSmall = false;\n @State() isMedium = false;\n @State() isLarge = false;\n @State() isXL = false;\n @State() isXXL = false;\n\n /**\n * the component's small breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() sSize: number = 300;\n\n /**\n * the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() mSize: number = 550;\n\n /**\n * the component's large breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() lSize: number = 800;\n\n /**\n * the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width.\n */\n @Prop() xlSize: number = 1000;\n\n /**\n * the number of columns the grid has at the small breakpoint.\n */\n @Prop() sCols: number;\n\n /**\n * the number of columns the grid has at the medium breakpoint.\n */\n @Prop() mCols: number;\n\n /**\n * the number of columns the grid has at the large breakpoint.\n */\n @Prop() lCols: number;\n\n /**\n * the number of columns the grid has at the xl breakpoint.\n */\n @Prop() xlCols: number;\n\n /**\n * the number of columns the grid has at the xxl breakpoint (anything greater than the xl breakpoint)\n */\n @Prop() xxlCols: number;\n\n /**\n * shows a grid helper to visualise where columns are\n */\n @Prop({ reflect: true }) showHelper: boolean = false;\n\n /**\n * shortcut for a traditional website like grid (requires more than one row). The second row will auto expand to fill the grid height. The first row and > 2nd row will be the size of their content. e.g. header, body and footer.\n */\n @Prop({ reflect: true }) contentPanel: boolean = false;\n\n /**\n * Helper to make grid items expand to full height in IE11\n */\n @Prop({ reflect: true }) fullHeight: boolean = false;\n\n /**\n * Emitted when the `nano-grid` changes breakpoint\n */\n @Event() nanoBpChange: EventEmitter<string[]>;\n\n @Watch('sSize')\n @Watch('mSize')\n @Watch('lSize')\n @Watch('xlSize')\n @Watch('sCols')\n @Watch('mCols')\n @Watch('lCols')\n @Watch('xlCols')\n @Watch('xxlCols')\n propChanged() {\n this.applySizeClasses();\n }\n\n private applySizeClasses() {\n const size = this.currentWidth;\n\n this.isSmall = false;\n this.isMedium = false;\n this.isLarge = false;\n this.isXL = false;\n this.isXXL = false;\n\n this.generalClasses = [];\n this.gridClass = null;\n this.isSizes = [null];\n\n this.isSmall = true;\n this.generalClasses.push('is-small');\n if (this.sCols) this.gridClass = `nano-grid-${this.sCols}`;\n this.isSizes.push({ size: 's', active: true });\n\n if (size > this.sSize) {\n this.isMedium = true;\n this.generalClasses.push('is-medium');\n if (this.mCols) this.gridClass = `nano-grid-${this.mCols}`;\n this.isSizes.push({ size: 'm', active: true });\n }\n\n if (size > this.mSize) {\n this.isLarge = true;\n this.generalClasses.push('is-large');\n if (this.lCols) this.gridClass = `nano-grid-${this.lCols}`;\n this.isSizes.push({ size: 'l', active: true });\n }\n\n if (size > this.lSize) {\n this.isXL = true;\n this.generalClasses.push('is-xl');\n if (this.xlCols) this.gridClass = `nano-grid-${this.xlCols}`;\n this.isSizes.push({ size: 'xl', active: true });\n }\n\n if (size > this.xlSize) {\n this.isXXL = true;\n this.generalClasses.push('is-xxl');\n if (this.xxlCols) this.gridClass = `nano-grid-${this.xxlCols}`;\n this.isSizes.push({ size: 'xxl', active: true });\n }\n\n this.el.style.setProperty(\n '--current-grid-size',\n `'grid size: ${this.isSizes.slice().pop().size}'`\n );\n this.applyChildrenClasses();\n setTimeout(() => (this.ready = true), 0);\n }\n\n @Watch('isSmall')\n @Watch('isMedium')\n @Watch('isLarge')\n @Watch('isXL')\n @Watch('isXXL')\n stateChange() {\n this.nanoBpChange.emit(this.generalClasses);\n }\n\n private applyChildrenClasses() {\n const gridItems = this.el.querySelectorAll('nano-grid-item');\n if (gridItems.length) {\n gridItems.forEach((gridItem: HTMLNanoGridItemElement) => {\n gridItem.changeBP(this.isSizes);\n });\n return;\n }\n\n // this logic has been put into grid-item. Keep here for legacy for now\n let stateArr: Array<string> = [''];\n let itemState: string = '';\n let found: any;\n let classes: Array<string>;\n\n const ctx = this.el;\n\n // item states come in 4 possible flavours at every breakpoint. E.g.\n // xl-col-span-2\n // xl-col-start-2\n // xl-row-span-2\n // xl-row-start-2\n\n // loop through all grid items with states.\n [].map.call(ctx.children, (gItem: HTMLElement) => {\n if (!gItem.hasAttribute('grid-states')) return;\n\n // gridItems.forEach(gItem => {\n\n // clear all previous grid state classnames\n classes = gItem.className\n .split(' ')\n .filter((c) => !c.startsWith('nano-grid-'));\n gItem.className = classes.join(' ').trim();\n\n // get all potential states this element can have\n const itemStates = gItem.getAttribute('grid-states').split(' ');\n\n // loop through all potential state options: col & row span & start\n STATEOPTS.forEach((stateOpt) => {\n // reset found flag\n found = false;\n\n // loop through all the current valid breakpoints / sizes backwards because\n // we only care about the item's state at the largest current breakpoint.\n this.isSizes\n .slice()\n .reverse()\n .forEach(function (size) {\n if (found || !size) return;\n found = itemStates.find(\n (state) => state.indexOf(`${size.size}-${stateOpt}`) === 0\n );\n\n // found a state at this current size. apply class.\n if (found) {\n // clear previous grid state classname\n classes = gItem.className\n .split(' ')\n .filter((c) => !c.includes('nano-grid-${stateOpt}'));\n gItem.className = classes.join(' ').trim();\n\n stateArr = found.split('-');\n\n // remove the size of the state\n stateArr.shift();\n itemState = stateArr.join('-');\n\n // add new class\n gItem.classList.add(`nano-grid-${itemState}`);\n }\n });\n });\n });\n }\n\n componentWillLoad() {\n const ctx = this.el;\n [].map.call(ctx.children, (ele: HTMLElement) =>\n ele.classList.add('nano-griditem')\n );\n }\n\n componentDidLoad() {\n if (!window['ResizeObserver']) return;\n\n this.ro = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (!entry.contentRect.width) return;\n this.currentWidth = entry.contentRect.width;\n this.applySizeClasses();\n }\n });\n this.ro.observe(this.el);\n }\n\n disconnectedCallback() {\n if (this.ro) this.ro.disconnect();\n }\n\n render() {\n return (\n <Host\n class={{\n [this.generalClasses.join(' ')]: true,\n 'has-grid': !!this.gridClass,\n ready: this.ready,\n [this.gridClass]: true,\n }}\n >\n <div\n class={{\n grid: true,\n }}\n >\n <slot />\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: inline-block;\n}\n","import { Component, h, Prop, Element, Method, Watch } from '@stencil/core';\nimport type { GridSizes } from '../../interface';\n\nconst STATEOPTS = ['col-span', 'col-start', 'row-span', 'row-start'];\n\n/**\n * Grid items to be used with [grid](/story/nano-components-grid) elements\n */\n@Component({\n tag: 'nano-grid-item',\n styleUrl: 'grid-item.scss',\n shadow: true,\n})\nexport class GridItem {\n private currGridSizes: GridSizes[] = [null];\n\n @Element() private el: HTMLNanoGridItemElement;\n /**\n * How to position this item within it's parent grid at different break points. Examples:\n * xl-col-span-2\n * l-col-start-2\n * xxl-row-span-2\n * m-row-start-2\n */\n @Prop() gridStates: string = '';\n\n @Watch('gridStates')\n updateGridClasses() {\n this.applyChildrenClasses();\n }\n\n /**\n * Called by parent grid to trigger new classes\n * @internal\n */\n @Method()\n async changeBP(newGridSizes: GridSizes[]) {\n if (this.currGridSizes === newGridSizes) return;\n this.currGridSizes = newGridSizes;\n\n if (!this.gridStates.length) return;\n this.applyChildrenClasses();\n }\n\n private applyChildrenClasses() {\n let stateArr: Array<string> = [''];\n let itemState: string = '';\n let found: any;\n let classes: Array<string>;\n\n // item states come in 4 possible flavours at every breakpoint. E.g.\n // xl-col-span-2\n // xl-col-start-2\n // xl-row-span-2\n // xl-row-start-2\n\n // clear all previous grid state classnames\n classes = this.el.className\n .split(' ')\n .filter((c) => !c.startsWith('nano-grid-'));\n this.el.className = classes.join(' ').trim();\n\n // get all potential states this element can have\n const itemStates = this.gridStates.split(' ');\n\n // loop through all potential state options: col & row span & start\n STATEOPTS.forEach((stateOpt) => {\n // reset found flag\n found = false;\n\n // loop through all the current valid breakpoints / sizes backwards because\n // we only care about the item's state at the largest current breakpoint.\n this.currGridSizes\n .slice()\n .reverse()\n .forEach((size) => {\n if (found || !size) return;\n found = itemStates.find(\n (state) => state.indexOf(`${size.size}-${stateOpt}`) === 0\n );\n\n // found a state at this current size. apply class.\n if (found) {\n // clear previous grid state classname\n classes = this.el.className\n .split(' ')\n .filter((c) => !c.includes('nano-grid-${stateOpt}'));\n this.el.className = classes.join(' ').trim();\n\n stateArr = found.split('-');\n\n // remove the size of the state\n stateArr.shift();\n itemState = stateArr.join('-');\n\n // add new class\n this.el.classList.add(`nano-grid-${itemState}`);\n }\n });\n });\n }\n\n render() {\n return <slot />;\n }\n}\n",":host {\n /**\n * @prop --padding: padding around any content. Only relevent on `<nano-img background>`\n */\n --padding: 0;\n\n display: inline-block;\n object-fit: cover;\n object-position: center;\n background-size: cover;\n background-position: center;\n\n * {\n border-radius: inherit;\n }\n}\n\n:host([background]:not([background='false'])) {\n display: block;\n}\n\n.img {\n position: relative;\n object-fit: inherit;\n object-position: inherit;\n background-color: inherit;\n background-position: inherit;\n background-size: inherit;\n background-origin: inherit;\n background-attachment: inherit;\n background-repeat: inherit;\n flex: 1 1 100%;\n display: flex;\n flex-direction: column;\n min-block-size: inherit;\n max-block-size: inherit;\n max-inline-size: inherit;\n min-height: inherit;\n min-width: inherit;\n block-size: inherit;\n inline-size: inherit;\n height: inherit;\n width: inherit;\n max-height: inherit;\n max-width: inherit;\n aspect-ratio: inherit;\n}\n\n.img__loader,\n.img__observer {\n position: absolute;\n inset: 0;\n block-size: 100%;\n inline-size: 100%;\n z-index: -1;\n}\n\n.img__image,\n.img__bg {\n border-radius: inherit;\n display: block;\n opacity: 0;\n transition: 0.5s ease opacity, 0.3s ease filter 0.4s;\n filter: blur(5px);\n flex: 1;\n\n &.loaded {\n opacity: 1;\n filter: blur(0);\n\n @media not all and (min-resolution: 0.001dpcm) {\n @supports (-webkit-appearance: none) {\n filter: blur(0);\n }\n }\n }\n}\n\n.img__image {\n object-fit: inherit;\n object-position: inherit;\n max-inline-size: 100%;\n min-block-size: inherit;\n max-block-size: inherit;\n min-height: inherit;\n min-width: inherit;\n block-size: auto;\n inline-size: inherit;\n height: inherit;\n width: inherit;\n max-height: inherit;\n max-width: inherit;\n aspect-ratio: inherit;\n\n &.hide {\n visibility: hidden;\n\n &.no-height {\n block-size: 1px;\n position: absolute;\n z-index: -1;\n }\n }\n}\n\n.img__bg {\n background-color: inherit;\n background-position: inherit;\n background-size: inherit;\n background-origin: inherit;\n background-attachment: inherit;\n background-repeat: inherit;\n overflow: auto;\n padding: var(--padding);\n\n &.no-height {\n position: absolute;\n inset: 0;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n State,\n Prop,\n Watch,\n h,\n ComponentInterface,\n Build,\n} from '@stencil/core';\nimport type { ResizeStateChangeEventDetail } from '../../interface';\n\n/**\n * Img with benefits. Lazy loading. Simple `srcSet` solution for both `<img>` and `background-image` varieties.\n * @slot - Main slot. Only relevant with `<nano-img background>`\n */\n@Component({\n tag: 'nano-img',\n styleUrl: 'img.scss',\n shadow: true,\n})\nexport class Img implements ComponentInterface {\n private io?: IntersectionObserver;\n private _srcSet: { [key: string]: { src: string; active: boolean } } = {};\n\n @Element() host!: HTMLNanoImgElement;\n\n @State() loadSrc?: string;\n @State() loadError?: () => void;\n @State() hasLoaded: boolean = false;\n @State() imgStates: string = null;\n @State() _src: string;\n @Watch('_src')\n _srcChanged() {\n this.hasLoaded = false;\n this.addIO();\n }\n\n /** This attribute defines the alternative text describing the image.\n * Users will see this text displayed if the image URL is wrong, or if the image is not yet downloaded. */\n @Prop() alt?: string;\n\n /** The image URL. This attribute is mandatory for the `<img>` element. */\n @Prop() src!: string;\n @Watch('src')\n srcChanged() {\n this._src = this.src;\n }\n\n /** Optional list string providing media sizes with corresponding image srcs.\n * i.e. show img-x at 300px wide. Format `srcSet=\"200w src/imgSmall.jpg, 500h src/imgMed.png\"` */\n @Prop() srcSet?: string;\n @Watch('srcSet')\n srcSetChanged() {\n if (!this.srcSet) return;\n\n delete this._srcSet;\n this._srcSet = {};\n\n this.imgStates = this.srcSet\n .split(',')\n .map((bpSrc) => {\n const [bp, src] = bpSrc.split(' ').filter((bp) => bp.length);\n this._srcSet[bp] = { src: src, active: false };\n return bp;\n })\n .join(', ');\n }\n\n /** Render image lazily, when it comes into the browser viewport **/\n @Prop() lazy: boolean = true;\n @Watch('lazy')\n lazyChanged() {\n if (!this.lazy) this.load();\n }\n\n /** Render the image as a background image **/\n @Prop() background?: boolean;\n\n /** When the image is rendered as a background, and there is no preset dimensions of the component,\n * you can set how the component height will be set. Via image size or via the content **/\n @Prop() autoHeight: 'content' | 'image' = 'content';\n\n /** Emitted when the img src has been set */\n @Event() nanoImgWillLoad!: EventEmitter<void>;\n\n /** Emitted when the image has finished loading */\n @Event() nanoImgDidLoad!: EventEmitter<void>;\n\n /** Emitted when the img fails to load */\n @Event() nanoImgError!: EventEmitter<void>;\n\n private addIO() {\n if (!this._src || this.hasLoaded) return;\n if (!this.lazy) {\n this.load();\n return;\n }\n if (\n typeof (window as any) !== 'undefined' &&\n 'IntersectionObserver' in window\n ) {\n this.removeIO();\n this.io = new IntersectionObserver((data) => {\n if (data[0].isIntersecting) {\n this.load();\n this.removeIO();\n }\n });\n\n this.io.observe(this.host);\n } else setTimeout(() => this.load(), 200);\n }\n\n private load() {\n this.loadError = this.onError;\n this.loadSrc = this._src;\n this.nanoImgWillLoad.emit();\n }\n\n private onLoad = () => {\n this.nanoImgDidLoad.emit();\n setTimeout(() => (this.hasLoaded = true), 50);\n };\n\n private onError = () => {\n this.nanoImgError.emit();\n };\n\n private onResize = (e: { detail: ResizeStateChangeEventDetail }) => {\n Object.entries(e.detail).forEach(([bp, active]) => {\n this._srcSet[bp].active = active;\n });\n\n // sort and find the highest sized matching image.\n const srcOpts = [];\n Object.keys(this._srcSet)\n .sort()\n .forEach((bp) => {\n if (this._srcSet[bp].active) srcOpts.push(this._srcSet[bp].src);\n });\n\n if (srcOpts.length) this._src = srcOpts.slice(-1)[0];\n // no matching image? Set back to default\n else this._src = this.src;\n };\n\n private removeIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n connectedCallback() {\n this.srcChanged();\n this.srcSetChanged();\n this.lazyChanged();\n }\n\n componentDidLoad() {\n this.addIO();\n }\n\n disconnectedCallback() {\n this.removeIO();\n }\n\n render() {\n const bgStyle = !!this.loadSrc\n ? { 'background-image': `url(${this.loadSrc})` }\n : {};\n\n return (\n <div class=\"img\">\n <nano-skeleton class=\"img__loader\"></nano-skeleton>\n {!!this.background && (\n <div\n class={{\n loaded: this.hasLoaded,\n img__bg: true,\n 'no-height': this.autoHeight === 'image',\n }}\n style={bgStyle}\n >\n <slot />\n </div>\n )}\n <img\n class={{\n img__image: true,\n loaded: this.hasLoaded,\n hide: this.background,\n 'no-height': this.autoHeight === 'content',\n }}\n decoding=\"async\"\n src={Build.isServer ? this.src : this.loadSrc}\n loading={Build.isServer && this.lazy ? 'lazy' : undefined}\n alt={this.alt}\n onLoad={this.onLoad}\n onError={this.loadError}\n />\n <nano-resize-observe\n class=\"img__observer\"\n onNanoResizeStateChange={this.onResize}\n states={this.imgStates}\n />\n </div>\n );\n }\n}\n"],"version":3}
|