@nanoporetech-digital/components 3.11.0 → 3.12.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 +11 -0
- package/dist/cjs/nano-grid_3.cjs.entry.js +1 -1
- package/dist/cjs/nano-grid_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-slide.cjs.entry.js +1 -1
- package/dist/cjs/nano-slide.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-slides.cjs.entry.js +1 -1
- package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-7eda4820.js → nano-table-7c53c380.js} +2 -2
- package/dist/cjs/{nano-table-7eda4820.js.map → nano-table-7c53c380.js.map} +1 -1
- package/dist/cjs/nano-table.cjs.entry.js +1 -1
- package/dist/cjs/{table.worker-3d722d17.js → table.worker-653666fe.js} +2 -2
- package/dist/cjs/table.worker-653666fe.js.map +1 -0
- package/dist/collection/components/img/img.css +26 -2
- package/dist/collection/components/slides/slide.css +1 -1
- package/dist/collection/components/slides/slides.css +6 -3
- package/dist/components/img.js +1 -1
- package/dist/components/img.js.map +1 -1
- package/dist/components/nano-slide.js +1 -1
- package/dist/components/nano-slide.js.map +1 -1
- package/dist/components/nano-slides.js +1 -1
- package/dist/components/nano-slides.js.map +1 -1
- package/dist/esm/nano-grid_3.entry.js +1 -1
- package/dist/esm/nano-grid_3.entry.js.map +1 -1
- package/dist/esm/nano-slide.entry.js +1 -1
- package/dist/esm/nano-slide.entry.js.map +1 -1
- package/dist/esm/nano-slides.entry.js +1 -1
- package/dist/esm/nano-slides.entry.js.map +1 -1
- package/dist/esm/{nano-table-5df6eeec.js → nano-table-0e141ceb.js} +2 -2
- package/dist/esm/{nano-table-5df6eeec.js.map → nano-table-0e141ceb.js.map} +1 -1
- package/dist/esm/nano-table.entry.js +1 -1
- package/dist/esm/{table.worker-0f97d194.js → table.worker-b93822af.js} +2 -2
- package/dist/esm/table.worker-b93822af.js.map +1 -0
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/p-29fbd756.js +5 -0
- package/dist/nano-components/{p-01c2d72d.js.map → p-29fbd756.js.map} +0 -0
- package/dist/nano-components/{p-34b11a4e.js → p-2fc0d478.js} +2 -2
- package/dist/nano-components/{p-34b11a4e.js.map → p-2fc0d478.js.map} +0 -0
- package/dist/nano-components/{p-dd20a736.entry.js → p-5d0de75a.entry.js} +2 -2
- package/dist/nano-components/{p-dd20a736.entry.js.map → p-5d0de75a.entry.js.map} +0 -0
- package/dist/nano-components/p-9520a248.entry.js +5 -0
- package/dist/nano-components/p-9520a248.entry.js.map +1 -0
- package/dist/nano-components/{p-7ea95109.entry.js → p-a6416490.entry.js} +3 -3
- package/dist/nano-components/{p-7ea95109.entry.js.map → p-a6416490.entry.js.map} +1 -1
- package/dist/nano-components/{p-41eeef4f.entry.js → p-d32dafd9.entry.js} +2 -2
- package/dist/nano-components/{p-41eeef4f.entry.js.map → p-d32dafd9.entry.js.map} +1 -1
- package/docs-json.json +1 -1
- package/hydrate/index.js +3 -3
- package/package.json +2 -2
- package/dist/cjs/table.worker-3d722d17.js.map +0 -1
- package/dist/esm/table.worker-0f97d194.js.map +0 -1
- package/dist/nano-components/p-01c2d72d.js +0 -5
- package/dist/nano-components/p-41be7990.entry.js +0 -5
- package/dist/nano-components/p-41be7990.entry.js.map +0 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{r as t,c as i,h as r,a as s,g as n}from"./p-6ef53fa1.js";import{d as o}from"./p-9746b0a5.js";const a=':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))}';const e=["col-span","col-start","row-span","row-start"];const d=class{constructor(r){t(this,r);this.nanoBpChange=i(this,"nanoBpChange",7);this.generalClasses=[""];this.gridClass=null;this.isSizes=[null];this.ready=false;this.isSmall=false;this.isMedium=false;this.isLarge=false;this.isXL=false;this.isXXL=false;this.sSize=300;this.mSize=550;this.lSize=800;this.xlSize=1e3;this.sCols=undefined;this.mCols=undefined;this.lCols=undefined;this.xlCols=undefined;this.xxlCols=undefined;this.showHelper=false;this.contentPanel=false;this.fullHeight=false;this.stateChange=o(this.stateChange.bind(this),100)}propChanged(){this.applySizeClasses()}applySizeClasses(){const t=this.currentWidth;this.isSmall=false;this.isMedium=false;this.isLarge=false;this.isXL=false;this.isXXL=false;this.generalClasses=[];this.gridClass=null;this.isSizes=[null];this.isSmall=true;this.generalClasses.push("is-small");if(this.sCols)this.gridClass=`nano-grid-${this.sCols}`;this.isSizes.push({size:"s",active:true});if(t>this.sSize){this.isMedium=true;this.generalClasses.push("is-medium");if(this.mCols)this.gridClass=`nano-grid-${this.mCols}`;this.isSizes.push({size:"m",active:true})}if(t>this.mSize){this.isLarge=true;this.generalClasses.push("is-large");if(this.lCols)this.gridClass=`nano-grid-${this.lCols}`;this.isSizes.push({size:"l",active:true})}if(t>this.lSize){this.isXL=true;this.generalClasses.push("is-xl");if(this.xlCols)this.gridClass=`nano-grid-${this.xlCols}`;this.isSizes.push({size:"xl",active:true})}if(t>this.xlSize){this.isXXL=true;this.generalClasses.push("is-xxl");if(this.xxlCols)this.gridClass=`nano-grid-${this.xxlCols}`;this.isSizes.push({size:"xxl",active:true})}this.el.style.setProperty("--current-grid-size",`'grid size: ${this.isSizes.slice().pop().size}'`);this.applyChildrenClasses();setTimeout((()=>this.ready=true),0)}stateChange(){this.nanoBpChange.emit(this.generalClasses)}applyChildrenClasses(){const t=this.el.querySelectorAll("nano-grid-item");if(t.length){t.forEach((t=>{t.changeBP(this.isSizes)}));return}let i=[""];let r="";let s;let n;const o=this.el;[].map.call(o.children,(t=>{if(!t.hasAttribute("grid-states"))return;n=t.className.split(" ").filter((t=>!t.startsWith("nano-grid-")));t.className=n.join(" ").trim();const o=t.getAttribute("grid-states").split(" ");e.forEach((a=>{s=false;this.isSizes.slice().reverse().forEach((function(e){if(s||!e)return;s=o.find((t=>t.indexOf(`${e.size}-${a}`)===0));if(s){n=t.className.split(" ").filter((t=>!t.includes("nano-grid-${stateOpt}")));t.className=n.join(" ").trim();i=s.split("-");i.shift();r=i.join("-");t.classList.add(`nano-grid-${r}`)}}))}))}))}componentWillLoad(){const t=this.el;[].map.call(t.children,(t=>t.classList.add("nano-griditem")))}componentDidLoad(){if(!window["ResizeObserver"])return;this.ro=new ResizeObserver((t=>{for(const i of t){if(!i.contentRect.width)return;this.currentWidth=i.contentRect.width;this.applySizeClasses()}}));this.ro.observe(this.el)}disconnectedCallback(){if(this.ro)this.ro.disconnect()}render(){return r(s,{class:{[this.generalClasses.join(" ")]:true,"has-grid":!!this.gridClass,ready:this.ready,[this.gridClass]:true}},r("div",{class:{grid:true}},r("slot",null)))}get el(){return n(this)}static get watchers(){return{sSize:["propChanged"],mSize:["propChanged"],lSize:["propChanged"],xlSize:["propChanged"],sCols:["propChanged"],mCols:["propChanged"],lCols:["propChanged"],xlCols:["propChanged"],xxlCols:["propChanged"],isSmall:["stateChange"],isMedium:["stateChange"],isLarge:["stateChange"],isXL:["stateChange"],isXXL:["stateChange"]}}};d.style=a;const h=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{display:inline-block}";const g=["col-span","col-start","row-span","row-start"];const l=class{constructor(i){t(this,i);this.currGridSizes=[null];this.gridStates=""}updateGridClasses(){this.applyChildrenClasses()}async changeBP(t){if(this.currGridSizes===t)return;this.currGridSizes=t;if(!this.gridStates.length)return;this.applyChildrenClasses()}applyChildrenClasses(){let t=[""];let i="";let r;let s;s=this.el.className.split(" ").filter((t=>!t.startsWith("nano-grid-")));this.el.className=s.join(" ").trim();const n=this.gridStates.split(" ");g.forEach((o=>{r=false;this.currGridSizes.slice().reverse().forEach((a=>{if(r||!a)return;r=n.find((t=>t.indexOf(`${a.size}-${o}`)===0));if(r){s=this.el.className.split(" ").filter((t=>!t.includes("nano-grid-${stateOpt}")));this.el.className=s.join(" ").trim();t=r.split("-");t.shift();i=t.join("-");this.el.classList.add(`nano-grid-${i}`)}}))}))}render(){return r("slot",null)}get el(){return n(this)}static get watchers(){return{gridStates:["updateGridClasses"]}}};l.style=h;const c=":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;min-block-size:inherit;display:block;object-fit:inherit;object-position:inherit;background-color:inherit;background-position:inherit;background-size:inherit;background-origin:inherit;background-attachment:inherit;background-repeat: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)}.img__image.loaded,.img__bg.loaded{opacity:1;filter:blur(0.1px)}@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%;block-size:auto}.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}";const p=class{constructor(r){t(this,r);this.nanoImgWillLoad=i(this,"nanoImgWillLoad",7);this.nanoImgDidLoad=i(this,"nanoImgDidLoad",7);this.nanoImgError=i(this,"nanoImgError",7);this._srcSet={};this.onLoad=()=>{this.nanoImgDidLoad.emit();setTimeout((()=>this.hasLoaded=true),50)};this.onError=()=>{this.nanoImgError.emit()};this.onResize=t=>{Object.entries(t.detail).forEach((([t,i])=>{this._srcSet[t].active=i}));const i=[];Object.keys(this._srcSet).sort().forEach((t=>{if(this._srcSet[t].active)i.push(this._srcSet[t].src)}));if(i.length)this._src=i.slice(-1)[0];else this._src=this.src};this.loadSrc=undefined;this.loadError=undefined;this.hasLoaded=false;this.imgStates=null;this._src=undefined;this.alt=undefined;this.src=undefined;this.srcSet=undefined;this.lazy=true;this.background=undefined;this.autoHeight="content"}_srcChanged(){this.hasLoaded=false;this.addIO()}srcChanged(){this._src=this.src}srcSetChanged(){if(!this.srcSet)return;delete this._srcSet;this._srcSet={};this.imgStates=this.srcSet.split(",").map((t=>{const[i,r]=t.split(" ").filter((t=>t.length));this._srcSet[i]={src:r,active:false};return i})).join(", ")}lazyChanged(){if(!this.lazy)this.load()}addIO(){if(!this._src||this.hasLoaded)return;if(!this.lazy){this.load();return}if(typeof window!=="undefined"&&"IntersectionObserver"in window){this.removeIO();this.io=new IntersectionObserver((t=>{if(t[0].isIntersecting){this.load();this.removeIO()}}));this.io.observe(this.host)}else setTimeout((()=>this.load()),200)}load(){this.loadError=this.onError;this.loadSrc=this._src;this.nanoImgWillLoad.emit()}removeIO(){if(this.io){this.io.disconnect();this.io=undefined}}connectedCallback(){this.srcChanged();this.srcSetChanged();this.lazyChanged()}componentDidLoad(){this.addIO()}disconnectedCallback(){this.removeIO()}render(){const t=!!this.loadSrc?{"background-image":`url(${this.loadSrc})`}:{};return r("div",{class:"img"},r("nano-skeleton",{class:"img__loader"}),!!this.background&&r("div",{class:{loaded:this.hasLoaded,img__bg:true,"no-height":this.autoHeight==="image"},style:t},r("slot",null)),r("img",{class:{img__image:true,loaded:this.hasLoaded,hide:this.background,"no-height":this.autoHeight==="content"},decoding:"async",src:this.loadSrc,loading:undefined,alt:this.alt,onLoad:this.onLoad,onError:this.loadError}),r("nano-resize-observe",{class:"img__observer",onNanoResizeStateChange:this.onResize,states:this.imgStates}))}get host(){return n(this)}static get watchers(){return{_src:["_srcChanged"],src:["srcChanged"],srcSet:["srcSetChanged"],lazy:["lazyChanged"]}}};p.style=c;export{d as nano_grid,l as nano_grid_item,p as nano_img};
|
5
|
-
//# sourceMappingURL=p-
|
4
|
+
import{r as i,c as t,h as r,a as s,g as n}from"./p-6ef53fa1.js";import{d as e}from"./p-9746b0a5.js";const o=':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))}';const a=["col-span","col-start","row-span","row-start"];const d=class{constructor(r){i(this,r);this.nanoBpChange=t(this,"nanoBpChange",7);this.generalClasses=[""];this.gridClass=null;this.isSizes=[null];this.ready=false;this.isSmall=false;this.isMedium=false;this.isLarge=false;this.isXL=false;this.isXXL=false;this.sSize=300;this.mSize=550;this.lSize=800;this.xlSize=1e3;this.sCols=undefined;this.mCols=undefined;this.lCols=undefined;this.xlCols=undefined;this.xxlCols=undefined;this.showHelper=false;this.contentPanel=false;this.fullHeight=false;this.stateChange=e(this.stateChange.bind(this),100)}propChanged(){this.applySizeClasses()}applySizeClasses(){const i=this.currentWidth;this.isSmall=false;this.isMedium=false;this.isLarge=false;this.isXL=false;this.isXXL=false;this.generalClasses=[];this.gridClass=null;this.isSizes=[null];this.isSmall=true;this.generalClasses.push("is-small");if(this.sCols)this.gridClass=`nano-grid-${this.sCols}`;this.isSizes.push({size:"s",active:true});if(i>this.sSize){this.isMedium=true;this.generalClasses.push("is-medium");if(this.mCols)this.gridClass=`nano-grid-${this.mCols}`;this.isSizes.push({size:"m",active:true})}if(i>this.mSize){this.isLarge=true;this.generalClasses.push("is-large");if(this.lCols)this.gridClass=`nano-grid-${this.lCols}`;this.isSizes.push({size:"l",active:true})}if(i>this.lSize){this.isXL=true;this.generalClasses.push("is-xl");if(this.xlCols)this.gridClass=`nano-grid-${this.xlCols}`;this.isSizes.push({size:"xl",active:true})}if(i>this.xlSize){this.isXXL=true;this.generalClasses.push("is-xxl");if(this.xxlCols)this.gridClass=`nano-grid-${this.xxlCols}`;this.isSizes.push({size:"xxl",active:true})}this.el.style.setProperty("--current-grid-size",`'grid size: ${this.isSizes.slice().pop().size}'`);this.applyChildrenClasses();setTimeout((()=>this.ready=true),0)}stateChange(){this.nanoBpChange.emit(this.generalClasses)}applyChildrenClasses(){const i=this.el.querySelectorAll("nano-grid-item");if(i.length){i.forEach((i=>{i.changeBP(this.isSizes)}));return}let t=[""];let r="";let s;let n;const e=this.el;[].map.call(e.children,(i=>{if(!i.hasAttribute("grid-states"))return;n=i.className.split(" ").filter((i=>!i.startsWith("nano-grid-")));i.className=n.join(" ").trim();const e=i.getAttribute("grid-states").split(" ");a.forEach((o=>{s=false;this.isSizes.slice().reverse().forEach((function(a){if(s||!a)return;s=e.find((i=>i.indexOf(`${a.size}-${o}`)===0));if(s){n=i.className.split(" ").filter((i=>!i.includes("nano-grid-${stateOpt}")));i.className=n.join(" ").trim();t=s.split("-");t.shift();r=t.join("-");i.classList.add(`nano-grid-${r}`)}}))}))}))}componentWillLoad(){const i=this.el;[].map.call(i.children,(i=>i.classList.add("nano-griditem")))}componentDidLoad(){if(!window["ResizeObserver"])return;this.ro=new ResizeObserver((i=>{for(const t of i){if(!t.contentRect.width)return;this.currentWidth=t.contentRect.width;this.applySizeClasses()}}));this.ro.observe(this.el)}disconnectedCallback(){if(this.ro)this.ro.disconnect()}render(){return r(s,{class:{[this.generalClasses.join(" ")]:true,"has-grid":!!this.gridClass,ready:this.ready,[this.gridClass]:true}},r("div",{class:{grid:true}},r("slot",null)))}get el(){return n(this)}static get watchers(){return{sSize:["propChanged"],mSize:["propChanged"],lSize:["propChanged"],xlSize:["propChanged"],sCols:["propChanged"],mCols:["propChanged"],lCols:["propChanged"],xlCols:["propChanged"],xxlCols:["propChanged"],isSmall:["stateChange"],isMedium:["stateChange"],isLarge:["stateChange"],isXL:["stateChange"],isXXL:["stateChange"]}}};d.style=o;const h=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{display:inline-block}";const g=["col-span","col-start","row-span","row-start"];const l=class{constructor(t){i(this,t);this.currGridSizes=[null];this.gridStates=""}updateGridClasses(){this.applyChildrenClasses()}async changeBP(i){if(this.currGridSizes===i)return;this.currGridSizes=i;if(!this.gridStates.length)return;this.applyChildrenClasses()}applyChildrenClasses(){let i=[""];let t="";let r;let s;s=this.el.className.split(" ").filter((i=>!i.startsWith("nano-grid-")));this.el.className=s.join(" ").trim();const n=this.gridStates.split(" ");g.forEach((e=>{r=false;this.currGridSizes.slice().reverse().forEach((o=>{if(r||!o)return;r=n.find((i=>i.indexOf(`${o.size}-${e}`)===0));if(r){s=this.el.className.split(" ").filter((i=>!i.includes("nano-grid-${stateOpt}")));this.el.className=s.join(" ").trim();i=r.split("-");i.shift();t=i.join("-");this.el.classList.add(`nano-grid-${t}`)}}))}))}render(){return r("slot",null)}get el(){return n(this)}static get watchers(){return{gridStates:["updateGridClasses"]}}};l.style=h;const c=":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.1px)}@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}";const p=class{constructor(r){i(this,r);this.nanoImgWillLoad=t(this,"nanoImgWillLoad",7);this.nanoImgDidLoad=t(this,"nanoImgDidLoad",7);this.nanoImgError=t(this,"nanoImgError",7);this._srcSet={};this.onLoad=()=>{this.nanoImgDidLoad.emit();setTimeout((()=>this.hasLoaded=true),50)};this.onError=()=>{this.nanoImgError.emit()};this.onResize=i=>{Object.entries(i.detail).forEach((([i,t])=>{this._srcSet[i].active=t}));const t=[];Object.keys(this._srcSet).sort().forEach((i=>{if(this._srcSet[i].active)t.push(this._srcSet[i].src)}));if(t.length)this._src=t.slice(-1)[0];else this._src=this.src};this.loadSrc=undefined;this.loadError=undefined;this.hasLoaded=false;this.imgStates=null;this._src=undefined;this.alt=undefined;this.src=undefined;this.srcSet=undefined;this.lazy=true;this.background=undefined;this.autoHeight="content"}_srcChanged(){this.hasLoaded=false;this.addIO()}srcChanged(){this._src=this.src}srcSetChanged(){if(!this.srcSet)return;delete this._srcSet;this._srcSet={};this.imgStates=this.srcSet.split(",").map((i=>{const[t,r]=i.split(" ").filter((i=>i.length));this._srcSet[t]={src:r,active:false};return t})).join(", ")}lazyChanged(){if(!this.lazy)this.load()}addIO(){if(!this._src||this.hasLoaded)return;if(!this.lazy){this.load();return}if(typeof window!=="undefined"&&"IntersectionObserver"in window){this.removeIO();this.io=new IntersectionObserver((i=>{if(i[0].isIntersecting){this.load();this.removeIO()}}));this.io.observe(this.host)}else setTimeout((()=>this.load()),200)}load(){this.loadError=this.onError;this.loadSrc=this._src;this.nanoImgWillLoad.emit()}removeIO(){if(this.io){this.io.disconnect();this.io=undefined}}connectedCallback(){this.srcChanged();this.srcSetChanged();this.lazyChanged()}componentDidLoad(){this.addIO()}disconnectedCallback(){this.removeIO()}render(){const i=!!this.loadSrc?{"background-image":`url(${this.loadSrc})`}:{};return r("div",{class:"img"},r("nano-skeleton",{class:"img__loader"}),!!this.background&&r("div",{class:{loaded:this.hasLoaded,img__bg:true,"no-height":this.autoHeight==="image"},style:i},r("slot",null)),r("img",{class:{img__image:true,loaded:this.hasLoaded,hide:this.background,"no-height":this.autoHeight==="content"},decoding:"async",src:this.loadSrc,loading:undefined,alt:this.alt,onLoad:this.onLoad,onError:this.loadError}),r("nano-resize-observe",{class:"img__observer",onNanoResizeStateChange:this.onResize,states:this.imgStates}))}get host(){return n(this)}static get watchers(){return{_src:["_srcChanged"],src:["srcChanged"],srcSet:["srcSetChanged"],lazy:["lazyChanged"]}}};p.style=c;export{d as nano_grid,l as nano_grid_item,p as nano_img};
|
5
|
+
//# sourceMappingURL=p-d32dafd9.entry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["gridCss","STATEOPTS","Grid","constructor","hostRef","this","generalClasses","gridClass","isSizes","stateChange","debounce","bind","propChanged","applySizeClasses","size","currentWidth","isSmall","isMedium","isLarge","isXL","isXXL","push","sCols","active","sSize","mCols","mSize","lCols","lSize","xlCols","xlSize","xxlCols","el","style","setProperty","slice","pop","applyChildrenClasses","setTimeout","ready","nanoBpChange","emit","gridItems","querySelectorAll","length","forEach","gridItem","changeBP","stateArr","itemState","found","classes","ctx","map","call","children","gItem","hasAttribute","className","split","filter","c","startsWith","join","trim","itemStates","getAttribute","stateOpt","reverse","find","state","indexOf","includes","shift","classList","add","componentWillLoad","ele","componentDidLoad","window","ro","ResizeObserver","entries","entry","contentRect","width","observe","disconnectedCallback","disconnect","render","h","Host","class","grid","gridItemCss","GridItem","currGridSizes","updateGridClasses","async","newGridSizes","gridStates","imgCss","Img","_srcSet","onLoad","nanoImgDidLoad","hasLoaded","onError","nanoImgError","onResize","e","Object","detail","bp","srcOpts","keys","sort","src","_src","_srcChanged","addIO","srcChanged","srcSetChanged","srcSet","imgStates","bpSrc","lazyChanged","lazy","load","removeIO","io","IntersectionObserver","data","isIntersecting","host","loadError","loadSrc","nanoImgWillLoad","undefined","connectedCallback","bgStyle","background","loaded","img__bg","autoHeight","img__image","hide","decoding","loading","alt","onNanoResizeStateChange","states"],"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 min-block-size: inherit;\n // block-size: 100%;\n display: block;\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}\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\n &.loaded {\n opacity: 1;\n filter: blur(0.1px);\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 block-size: auto;\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"],"mappings":";;;oGAAA,MAAMA,EAAU,qiOCchB,MAAMC,EAAY,CAAC,WAAY,YAAa,WAAY,a,MAW3CC,EAAI,MAQfC,YAAAC,G,qDALQC,KAAAC,eAAgC,CAAC,IACjCD,KAAAE,UAAoB,KACpBF,KAAAG,QAAuB,CAAC,M,WAON,M,aACP,M,cACC,M,aACD,M,UACH,M,WACC,M,WAKO,I,WAKA,I,WAKA,I,YAKC,I,4HA8BsB,M,kBAKE,M,gBAKF,MApE7CH,KAAKI,YAAcC,EAASL,KAAKI,YAAYE,KAAKN,MAAO,I,CAoF3DO,cACEP,KAAKQ,kB,CAGCA,mBACN,MAAMC,EAAOT,KAAKU,aAElBV,KAAKW,QAAU,MACfX,KAAKY,SAAW,MAChBZ,KAAKa,QAAU,MACfb,KAAKc,KAAO,MACZd,KAAKe,MAAQ,MAEbf,KAAKC,eAAiB,GACtBD,KAAKE,UAAY,KACjBF,KAAKG,QAAU,CAAC,MAEhBH,KAAKW,QAAU,KACfX,KAAKC,eAAee,KAAK,YACzB,GAAIhB,KAAKiB,MAAOjB,KAAKE,UAAY,aAAaF,KAAKiB,QACnDjB,KAAKG,QAAQa,KAAK,CAAEP,KAAM,IAAKS,OAAQ,OAEvC,GAAIT,EAAOT,KAAKmB,MAAO,CACrBnB,KAAKY,SAAW,KAChBZ,KAAKC,eAAee,KAAK,aACzB,GAAIhB,KAAKoB,MAAOpB,KAAKE,UAAY,aAAaF,KAAKoB,QACnDpB,KAAKG,QAAQa,KAAK,CAAEP,KAAM,IAAKS,OAAQ,M,CAGzC,GAAIT,EAAOT,KAAKqB,MAAO,CACrBrB,KAAKa,QAAU,KACfb,KAAKC,eAAee,KAAK,YACzB,GAAIhB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ACpBjH,KAAKoI,gBAAgBhG,M,CA8BfwF,WACN,GAAI5H,KAAK6H,GAAI,CACX7H,KAAK6H,GAAG1C,aACRnF,KAAK6H,GAAKQ,S,EAIdC,oBACEtI,KAAKoH,aACLpH,KAAKqH,gBACLrH,KAAKyH,a,CAGPhD,mBACEzE,KAAKmH,O,CAGPjC,uBACElF,KAAK4H,U,CAGPxC,SACE,MAAMmD,IAAYvI,KAAKmI,QACnB,CAAE,mBAAoB,OAAOnI,KAAKmI,YAClC,GAEJ,OACE9C,EAAA,OAAKE,MAAM,OACTF,EAAA,iBAAeE,MAAM,kBAClBvF,KAAKwI,YACNnD,EAAA,OACEE,MAAO,CACLkD,OAAQzI,KAAKqG,UACbqC,QAAS,KACT,YAAa1I,KAAK2I,aAAe,SAEnC/G,MAAO2G,GAEPlD,EAAA,cAGJA,EAAA,OACEE,MAAO,CACLqD,WAAY,KACZH,OAAQzI,KAAKqG,UACbwC,KAAM7I,KAAKwI,WACX,YAAaxI,KAAK2I,aAAe,WAEnCG,SAAS,QACT9B,IAAiChH,KAAKmI,QACtCY,QAAgDV,UAChDW,IAAKhJ,KAAKgJ,IACV7C,OAAQnG,KAAKmG,OACbG,QAAStG,KAAKkI,YAEhB7C,EAAA,uBACEE,MAAM,gBACN0D,wBAAyBjJ,KAAKwG,SAC9B0C,OAAQlJ,KAAKuH,Y"}
|
1
|
+
{"version":3,"names":["gridCss","STATEOPTS","Grid","constructor","hostRef","this","generalClasses","gridClass","isSizes","stateChange","debounce","bind","propChanged","applySizeClasses","size","currentWidth","isSmall","isMedium","isLarge","isXL","isXXL","push","sCols","active","sSize","mCols","mSize","lCols","lSize","xlCols","xlSize","xxlCols","el","style","setProperty","slice","pop","applyChildrenClasses","setTimeout","ready","nanoBpChange","emit","gridItems","querySelectorAll","length","forEach","gridItem","changeBP","stateArr","itemState","found","classes","ctx","map","call","children","gItem","hasAttribute","className","split","filter","c","startsWith","join","trim","itemStates","getAttribute","stateOpt","reverse","find","state","indexOf","includes","shift","classList","add","componentWillLoad","ele","componentDidLoad","window","ro","ResizeObserver","entries","entry","contentRect","width","observe","disconnectedCallback","disconnect","render","h","Host","class","grid","gridItemCss","GridItem","currGridSizes","updateGridClasses","async","newGridSizes","gridStates","imgCss","Img","_srcSet","onLoad","nanoImgDidLoad","hasLoaded","onError","nanoImgError","onResize","e","Object","detail","bp","srcOpts","keys","sort","src","_src","_srcChanged","addIO","srcChanged","srcSetChanged","srcSet","imgStates","bpSrc","lazyChanged","lazy","load","removeIO","io","IntersectionObserver","data","isIntersecting","host","loadError","loadSrc","nanoImgWillLoad","undefined","connectedCallback","bgStyle","background","loaded","img__bg","autoHeight","img__image","hide","decoding","loading","alt","onNanoResizeStateChange","states"],"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.1px);\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"],"mappings":";;;oGAAA,MAAMA,EAAU,qiOCchB,MAAMC,EAAY,CAAC,WAAY,YAAa,WAAY,a,MAW3CC,EAAI,MAQfC,YAAAC,G,qDALQC,KAAAC,eAAgC,CAAC,IACjCD,KAAAE,UAAoB,KACpBF,KAAAG,QAAuB,CAAC,M,WAON,M,aACP,M,cACC,M,aACD,M,UACH,M,WACC,M,WAKO,I,WAKA,I,WAKA,I,YAKC,I,4HA8BsB,M,kBAKE,M,gBAKF,MApE7CH,KAAKI,YAAcC,EAASL,KAAKI,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,cAGJA,EAAA,OACEE,MAAO,CACLqD,WAAY,KACZH,OAAQzI,KAAKqG,UACbwC,KAAM7I,KAAKwI,WACX,YAAaxI,KAAK2I,aAAe,WAEnCG,SAAS,QACT9B,IAAiChH,KAAKmI,QACtCY,QAAgDV,UAChDW,IAAKhJ,KAAKgJ,IACV7C,OAAQnG,KAAKmG,OACbG,QAAStG,KAAKkI,YAEhB7C,EAAA,uBACEE,MAAM,gBACN0D,wBAAyBjJ,KAAKwG,SAC9B0C,OAAQlJ,KAAKuH,Y"}
|
package/docs-json.json
CHANGED
package/hydrate/index.js
CHANGED
@@ -19641,7 +19641,7 @@ class IconButton {
|
|
19641
19641
|
}; }
|
19642
19642
|
}
|
19643
19643
|
|
19644
|
-
const imgCss = "/*!@:host*/.sc-nano-img-h{box-sizing:border-box}/*!@*,\n*::before,\n*::after*/*.sc-nano-img,*.sc-nano-img::before,*.sc-nano-img::after{box-sizing:border-box}/*!@[hidden]*/[hidden].sc-nano-img{display:none !important}/*!@:host*/.sc-nano-img-h{--padding:0;display:inline-block;object-fit:cover;object-position:center;background-size:cover;background-position:center}/*!@:host **/.sc-nano-img-h *.sc-nano-img{border-radius:inherit}/*!@:host([background]:not([background=false]))*/[background].sc-nano-img-h:not([background=false]){display:block}/*!@.img*/.img.sc-nano-img{position:relative;
|
19644
|
+
const imgCss = "/*!@:host*/.sc-nano-img-h{box-sizing:border-box}/*!@*,\n*::before,\n*::after*/*.sc-nano-img,*.sc-nano-img::before,*.sc-nano-img::after{box-sizing:border-box}/*!@[hidden]*/[hidden].sc-nano-img{display:none !important}/*!@:host*/.sc-nano-img-h{--padding:0;display:inline-block;object-fit:cover;object-position:center;background-size:cover;background-position:center}/*!@:host **/.sc-nano-img-h *.sc-nano-img{border-radius:inherit}/*!@:host([background]:not([background=false]))*/[background].sc-nano-img-h:not([background=false]){display:block}/*!@.img*/.img.sc-nano-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,\n.img__observer*/.img__loader.sc-nano-img,.img__observer.sc-nano-img{position:absolute;inset:0;block-size:100%;inline-size:100%;z-index:-1}/*!@.img__image,\n.img__bg*/.img__image.sc-nano-img,.img__bg.sc-nano-img{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,\n.img__bg.loaded*/.img__image.loaded.sc-nano-img,.img__bg.loaded.sc-nano-img{opacity:1;filter:blur(0.1px)}@media not all and (min-resolution: 0.001dpcm){/*!@@supports (-webkit-appearance: none)*/@supports .sc-nano-img (-webkit-appearance.sc-nano-img: none).sc-nano-img{.img__image.loaded,.img__bg.loaded{filter:blur(0)}}}/*!@.img__image*/.img__image.sc-nano-img{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*/.img__image.hide.sc-nano-img{visibility:hidden}/*!@.img__image.hide.no-height*/.img__image.hide.no-height.sc-nano-img{block-size:1px;position:absolute;z-index:-1}/*!@.img__bg*/.img__bg.sc-nano-img{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*/.img__bg.no-height.sc-nano-img{position:absolute;inset:0}";
|
19645
19645
|
|
19646
19646
|
/**
|
19647
19647
|
* Img with benefits. Lazy loading. Simple `srcSet` solution for both `<img>` and `background-image` varieties.
|
@@ -22631,7 +22631,7 @@ class Skeleton {
|
|
22631
22631
|
}; }
|
22632
22632
|
}
|
22633
22633
|
|
22634
|
-
const slideCss = "/*!@:host*/.sc-nano-slide-h{box-sizing:border-box}/*!@*,\n*::before,\n*::after*/*.sc-nano-slide,*.sc-nano-slide::before,*.sc-nano-slide::after{box-sizing:border-box}/*!@[hidden]*/[hidden].sc-nano-slide{display:none !important}/*!@:host*/.sc-nano-slide-h{display:flex;position:relative;
|
22634
|
+
const slideCss = "/*!@:host*/.sc-nano-slide-h{box-sizing:border-box}/*!@*,\n*::before,\n*::after*/*.sc-nano-slide,*.sc-nano-slide::before,*.sc-nano-slide::after{box-sizing:border-box}/*!@[hidden]*/[hidden].sc-nano-slide{display:none !important}/*!@:host*/.sc-nano-slide-h{display:flex;position:relative;align-items:center;justify-content:center;inline-size:100%;min-block-size:100%;font-size:18px;text-align:center;box-sizing:border-box;overflow:hidden;transition:opacity 0.2s;opacity:0;flex-direction:column}/*!@:host([ready])*/[ready].sc-nano-slide-h{opacity:1}";
|
22635
22635
|
|
22636
22636
|
class Slide$2 {
|
22637
22637
|
constructor(hostRef) {
|
@@ -26490,7 +26490,7 @@ proto.shiftWrapCells = function () {
|
|
26490
26490
|
|
26491
26491
|
const flickity = Flickity;
|
26492
26492
|
|
26493
|
-
const slidesCss = "/*!@:host*/.sc-nano-slides-h{box-sizing:border-box}/*!@*,\n*::before,\n*::after*/*.sc-nano-slides,*.sc-nano-slides::before,*.sc-nano-slides::after{box-sizing:border-box}/*!@[hidden]*/[hidden].sc-nano-slides{display:none !important}/*!@:host*/.sc-nano-slides-h{--dot-color:#ccc;--dot-color-active:var(--nano-color-primary, #007495);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:white;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:white;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:white;display:block;-webkit-user-select:none;user-select:none;overflow:hidden;transition:opacity 0.2s;opacity:0}/*!@:host([ready])*/[ready].sc-nano-slides-h{opacity:1}/*!@.slideshow*/.slideshow.sc-nano-slides{block-size:
|
26493
|
+
const slidesCss = "/*!@:host*/.sc-nano-slides-h{box-sizing:border-box}/*!@*,\n*::before,\n*::after*/*.sc-nano-slides,*.sc-nano-slides::before,*.sc-nano-slides::after{box-sizing:border-box}/*!@[hidden]*/[hidden].sc-nano-slides{display:none !important}/*!@:host*/.sc-nano-slides-h{--dot-color:#ccc;--dot-color-active:var(--nano-color-primary, #007495);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:white;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:white;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:white;display:block;-webkit-user-select:none;user-select:none;overflow:hidden;transition:opacity 0.2s;opacity:0}/*!@:host([ready])*/[ready].sc-nano-slides-h{opacity:1}/*!@.slideshow*/.slideshow.sc-nano-slides{min-height:inherit;min-block-size:inherit;position:relative}/*!@.flickity-container*/.flickity-container.sc-nano-slides{opacity:0;transition:opacity 0.2s}/*!@.flickity-container.slides-ready*/.flickity-container.slides-ready.sc-nano-slides{min-height:inherit;min-block-size:inherit}/*!@[hidden]*/[hidden].sc-nano-slides{display:none !important}/*!@.ui-extras*/.ui-extras.sc-nano-slides{pointer-events:none;position:absolute;block-size:100%;inline-size:100%;inset-block-start:0;inset-inline-start:0}/*!@.ui-extras **/.ui-extras.sc-nano-slides *.sc-nano-slides{pointer-events:all}/*!@.flickity-enabled*/.flickity-enabled.sc-nano-slides{position:relative;opacity:1}/*!@.flickity-enabled:focus*/.flickity-enabled.sc-nano-slides:focus{outline:none}/*!@.flickity-viewport*/.flickity-viewport.sc-nano-slides{overflow:hidden;position:relative;min-height:inherit;min-block-size:inherit}/*!@.flickity-slider*/.flickity-slider.sc-nano-slides{position:absolute;inline-size:100%;block-size:100%}/*!@.flickity-enabled.is-draggable*/.flickity-enabled.is-draggable.sc-nano-slides{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}/*!@.flickity-enabled.is-draggable .flickity-viewport*/.flickity-enabled.is-draggable.sc-nano-slides .flickity-viewport.sc-nano-slides{cursor:move;cursor:grab;cursor:grab}/*!@.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down*/.flickity-enabled.is-draggable.sc-nano-slides .flickity-viewport.is-pointer-down.sc-nano-slides{cursor:grabbing}/*!@.flickity-button*/.flickity-button.sc-nano-slides{position:absolute;background:var(--navbtns-bg-color);border:none;color:#333;opacity:0.75}/*!@.flickity-button:hover*/.flickity-button.sc-nano-slides:hover{opacity:1;cursor:pointer}/*!@.flickity-button:focus*/.flickity-button.sc-nano-slides:focus{outline:none;box-shadow:0 0 0 5px #19f}/*!@.flickity-button:active*/.flickity-button.sc-nano-slides:active{opacity:0.6}/*!@.flickity-button:disabled*/.flickity-button.sc-nano-slides:disabled{opacity:0.3;cursor:auto;pointer-events:none;background:var(--navbtns-bg-color-disabled)}/*!@.flickity-button-icon*/.flickity-button-icon.sc-nano-slides{fill:var(--navbtns-icon-color)}/*!@.flickity-button:disabled .flickity-button-icon*/.flickity-button.sc-nano-slides:disabled .flickity-button-icon.sc-nano-slides{fill:var(--navbtns-icon-color-disabled)}/*!@.flickity-prev-next-button*/.flickity-prev-next-button.sc-nano-slides{inset-block-start:50%;inline-size:44px;block-size:44px;border-radius:50%;transform:translateY(-50%)}/*!@.flickity-prev-next-button.previous*/.flickity-prev-next-button.previous.sc-nano-slides{inset-inline-start:10px}/*!@.flickity-prev-next-button.next*/.flickity-prev-next-button.next.sc-nano-slides{inset-inline-end:10px}/*!@.flickity-rtl .flickity-prev-next-button.previous*/.flickity-rtl.sc-nano-slides .flickity-prev-next-button.previous.sc-nano-slides{inset-inline:auto 10px}/*!@.flickity-rtl .flickity-prev-next-button.next*/.flickity-rtl.sc-nano-slides .flickity-prev-next-button.next.sc-nano-slides{inset-inline:10px auto}/*!@.flickity-prev-next-button .flickity-button-icon*/.flickity-prev-next-button.sc-nano-slides .flickity-button-icon.sc-nano-slides{position:absolute;inset-inline-start:20%;inset-block-start:20%;inline-size:60%;block-size:60%}/*!@.flickity-page-dots*/.flickity-page-dots.sc-nano-slides{position:absolute;inline-size:100%;inset-block-end:10px;padding:0;margin:0;list-style:none;text-align:center;line-height:1;z-index:4}/*!@.flickity-rtl .flickity-page-dots*/.flickity-rtl.sc-nano-slides .flickity-page-dots.sc-nano-slides{direction:rtl}/*!@.flickity-page-dots .dot*/.flickity-page-dots.sc-nano-slides .dot.sc-nano-slides{display:inline-block;inline-size:10px;block-size:10px;margin-block:0;margin-inline:8px;border-radius:50%;cursor:pointer;background:var(--dot-color)}/*!@.flickity-page-dots .dot.is-selected*/.flickity-page-dots.sc-nano-slides .dot.is-selected.sc-nano-slides{opacity:1;background:var(--dot-color-active)}/*!@.flickity-enabled.is-fullscreen*/.flickity-enabled.is-fullscreen.sc-nano-slides{position:fixed;inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;background:rgba(0, 0, 0, 0.9);-webkit-padding-after:35px;padding-block-end:35px;z-index:100}/*!@.flickity-enabled.is-fullscreen .flickity-page-dots*/.flickity-enabled.is-fullscreen.sc-nano-slides .flickity-page-dots.sc-nano-slides{inset-block-end:45px}/*!@html.is-flickity-fullscreen*/html.is-flickity-fullscreen.sc-nano-slides{overflow:hidden}/*!@.flickity-fullscreen-button*/.flickity-fullscreen-button.sc-nano-slides{display:block;inset-inline-end:10px;inset-block-start:10px;inline-size:24px;block-size:24px;border-radius:4px;background:var(--fsbtn-bg-color);fill:var(--fsbtn-icon-color)}/*!@.flickity-rtl .flickity-fullscreen-button*/.flickity-rtl.sc-nano-slides .flickity-fullscreen-button.sc-nano-slides{inset-inline:10px auto}/*!@.flickity-fullscreen-button-exit*/.flickity-fullscreen-button-exit.sc-nano-slides{display:none}/*!@.flickity-enabled.is-fullscreen .flickity-fullscreen-button-exit*/.flickity-enabled.is-fullscreen.sc-nano-slides .flickity-fullscreen-button-exit.sc-nano-slides{display:block}/*!@.flickity-enabled.is-fullscreen .flickity-fullscreen-button-view*/.flickity-enabled.is-fullscreen.sc-nano-slides .flickity-fullscreen-button-view.sc-nano-slides{display:none}/*!@.flickity-fullscreen-button .flickity-button-icon*/.flickity-fullscreen-button.sc-nano-slides .flickity-button-icon.sc-nano-slides{position:absolute;inline-size:16px;block-size:16px;inset-inline-start:4px;inset-block-start:4px}/*!@.flickity-enabled.is-fade .flickity-slider > **/.flickity-enabled.is-fade.sc-nano-slides .flickity-slider.sc-nano-slides>*.sc-nano-slides{pointer-events:none;z-index:0}/*!@.flickity-enabled.is-fade .flickity-slider ::slotted(.is-selected)*/.flickity-enabled.is-fade .flickity-slider .sc-nano-slides-s>.is-selected{pointer-events:auto;z-index:1}";
|
26494
26494
|
|
26495
26495
|
/**
|
26496
26496
|
* The Slides component is a multi-section container. Each section can be swiped or dragged between.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nanoporetech-digital/components",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.12.0",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://git.oxfordnanolabs.local/Digital/nano-components"
|
@@ -130,7 +130,7 @@
|
|
130
130
|
"nanopore",
|
131
131
|
"digital"
|
132
132
|
],
|
133
|
-
"gitHead": "
|
133
|
+
"gitHead": "6352f735819b34407eba309975cc1623691e8bec",
|
134
134
|
"volta": {
|
135
135
|
"node": "14.18.1",
|
136
136
|
"npm": "8.6.0"
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"table.worker-3d722d17.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"file":"table.worker-0f97d194.js","mappings":";;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
@@ -1,5 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Web Components for Nanopore digital Web Apps
|
3
|
-
*/
|
4
|
-
import{c as t}from"./p-34b11a4e.js";import"./p-6ef53fa1.js";import"./p-ee045579.js";import"./p-9746b0a5.js";import"./p-b65e0e63.js";const o="table.worker";const e="stencil.table.worker";const p=new URL("p-e2f9ccfa.js",import.meta.url).href;const s=new Blob(['importScripts("'+p+'")'],{type:"text/javascript"});const r=URL.createObjectURL(s);const c=t(r,o,e);URL.revokeObjectURL(r);export{c as worker,e as workerMsgId,o as workerName,p as workerPath};
|
5
|
-
//# sourceMappingURL=p-01c2d72d.js.map
|
@@ -1,5 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Web Components for Nanopore digital Web Apps
|
3
|
-
*/
|
4
|
-
import{r as e,c as t,h as i,a as n}from"./p-6ef53fa1.js";const o=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{display:flex;position:relative;flex-shrink:0;align-items:center;justify-content:center;inline-size:100%;min-block-size:100%;font-size:18px;text-align:center;box-sizing:border-box;overflow:hidden;transition:opacity 0.2s;opacity:0}:host([ready]){opacity:1}";const s=class{constructor(i){e(this,i);this.nanoSlideReady=t(this,"nanoSlideReady",7);this.ready=null}readyChange(e,t){if(typeof t!=="undefined"&&t===false&&e===true){this.nanoSlideReady.emit()}}componentDidLoad(){if(typeof this.ready==="boolean")return;setTimeout((()=>{this.nanoSlideReady.emit();this.ready=true}))}render(){return i(n,null,i("slot",null))}static get watchers(){return{ready:["readyChange"]}}};s.style=o;export{s as nano_slide};
|
5
|
-
//# sourceMappingURL=p-41be7990.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["slideCss","Slide","readyChange","newReady","oldReady","this","nanoSlideReady","emit","componentDidLoad","ready","setTimeout","render","h","Host"],"sources":["./src/components/slides/slide.scss?tag=nano-slide&encapsulation=shadow","./src/components/slides/slide.tsx"],"sourcesContent":["// Slide\n// --------------------------------------------------\n\n:host {\n // Center slide text vertically\n display: flex;\n position: relative;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n inline-size: 100%;\n min-block-size: 100%;\n font-size: 18px;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n transition: opacity 0.2s;\n opacity: 0;\n}\n\n:host([ready]) {\n opacity: 1;\n}\n","import {\n Component,\n ComponentInterface,\n Host,\n h,\n Event,\n EventEmitter,\n Prop,\n Watch,\n} from '@stencil/core';\n\n@Component({\n tag: 'nano-slide',\n styleUrl: 'slide.scss',\n shadow: true,\n})\nexport class Slide implements ComponentInterface {\n /**\n * Fired when the slide has loaded.\n */\n @Event() nanoSlideReady!: EventEmitter<void>;\n\n /**\n * Used to to inform the parent slides components of readiness.\n * This will automatically be set to true when the slide has loaded but can be set and updated manually.\n */\n @Prop({ mutable: true, reflect: true }) ready: boolean | null = null;\n\n @Watch('ready')\n readyChange(newReady: boolean | null, oldReady?: boolean | null) {\n if (\n typeof oldReady !== 'undefined' &&\n oldReady === false &&\n newReady === true\n ) {\n this.nanoSlideReady.emit();\n }\n }\n\n componentDidLoad() {\n // ready state is being loaded manually\n if (typeof this.ready === 'boolean') return;\n setTimeout(() => {\n this.nanoSlideReady.emit();\n this.ready = true;\n });\n }\n\n render() {\n return (\n <Host>\n <slot />\n </Host>\n );\n }\n}\n"],"mappings":";;;yDAAA,MAAMA,EAAW,+W,MCgBJC,EAAK,M,mFAUgD,I,CAGhEC,YAAYC,EAA0BC,GACpC,UACSA,IAAa,aACpBA,IAAa,OACbD,IAAa,KACb,CACAE,KAAKC,eAAeC,M,EAIxBC,mBAEE,UAAWH,KAAKI,QAAU,UAAW,OACrCC,YAAW,KACTL,KAAKC,eAAeC,OACpBF,KAAKI,MAAQ,IAAI,G,CAIrBE,SACE,OACEC,EAACC,EAAI,KACHD,EAAA,a"}
|