@ptcwebops/ptcw-design 6.3.60-beta → 6.3.61-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/ptc-card_2.cjs.entry.js +3 -2
- package/dist/cjs/ptc-img.cjs.entry.js +69 -36
- package/dist/cjs/ptc-jumbotron.cjs.entry.js +3 -0
- package/dist/cjs/ptcw-design.cjs.js +1 -1
- package/dist/collection/components/ptc-card/ptc-card.js +21 -2
- package/dist/collection/components/ptc-img/ptc-img.css +47 -0
- package/dist/collection/components/ptc-img/ptc-img.js +73 -36
- package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.js +3 -0
- package/dist/custom-elements/index.js +77 -40
- package/dist/esm/loader.js +1 -1
- package/dist/esm/ptc-card_2.entry.js +3 -2
- package/dist/esm/ptc-img.entry.js +69 -36
- package/dist/esm/ptc-jumbotron.entry.js +3 -0
- package/dist/esm/ptcw-design.js +1 -1
- package/dist/ptcw-design/p-0c4918f5.entry.js +1 -0
- package/dist/ptcw-design/p-e94353a4.entry.js +1 -0
- package/dist/ptcw-design/p-ff4d3794.entry.js +1 -0
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/ptc-card/ptc-card.d.ts +1 -0
- package/dist/types/components/ptc-img/ptc-img.d.ts +13 -4
- package/dist/types/components/ptc-jumbotron/ptc-jumbotron.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
- package/readme.md +1 -1
- package/dist/ptcw-design/p-a978cd5b.entry.js +0 -1
- package/dist/ptcw-design/p-e9c5e74e.entry.js +0 -1
- package/dist/ptcw-design/p-f74e87ec.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as e,g as s}from"./p-ac75c7ad.js";import{R as a}from"./p-711bcdad.js";const h=class{constructor(i){t(this,i),this.transformParameters=["t=ptcjumbdesklq","t=ptcjumbdeskmq","t=ptcjumbdeskhq"],this.transformIndex=0,this.sizeXs="510x340",this.sizeSm="1240x496",this.sizeMd="1366x500",this.sizeLg="1920x1080",this.imgUrl=void 0,this.imageType="smart-bg",this.borderRadius="",this.loadMode="lazy-bg",this.styles=void 0,this.enableLazyLoad=!1,this.delay=2e3,this.bgSrcLazy=void 0}WindowResize(){this.setResponsiveBg()}render(){const t=this.getCssClassMap();return i(e,null,this.styles&&i("style",null,this.styles),i("div",{class:t,"data-xs":`${this.bgSrcLazy?this.bgSrcLazy:this.imgUrl}`,"data-sm":`${this.bgSrcLazy?this.bgSrcLazy:this.imgUrl}`,"data-md":`${this.bgSrcLazy?this.bgSrcLazy:this.imgUrl}`,"data-lg":`${this.bgSrcLazy?this.bgSrcLazy:this.imgUrl}`},"smart-bg"==this.imageType?i("slot",null):null))}componentWillLoad(){this.enableLazyLoad&&(this.bgSrcLazy=this.imgUrl&&this.imgUrl.includes("?")?`${this.imgUrl}&t=ptcjumbdesklq`:`${this.imgUrl}?t=ptcjumbdesklq`),console.log(this.bgSrcLazy)}componentDidLoad(){if(this.addIntersectionObserver(),this.setResponsiveBg(),this.enableLazyLoad){const t=this;setTimeout((()=>{t.upgradeImageQuality()}),t.delay)}}componentWillUpdate(){this.addIntersectionObserver(),this.setResponsiveBg()}upgradeImageQuality(){const t=this;t.transformIndex++,t.transformIndex<t.transformParameters.length?(this.bgSrcLazy=this.imgUrl&&this.imgUrl.includes("?")?`${this.imgUrl}&${t.transformParameters[t.transformIndex]}`:`${this.imgUrl}?${t.transformParameters[t.transformIndex]}`,setTimeout((()=>{console.log(this.bgSrcLazy),t.upgradeImageQuality()}),t.delay)):t.bgSrcLazy=t.imgUrl}setResponsiveBg(){let t,i,e=(this.el||document).querySelectorAll(a.selector),s=this.getCurrentBreakPoints();for(var h=0,n=e.length;h<n;h++)t=e[h],i=t.getAttribute("data-"+s),null!==i?t.style.backgroundImage="url('"+i+"')":"object"==typeof console&&console.warn("Data attribute: data-"+s+" not found on element:\n\n"+t.outerHTML+"\n\n\n")}addIntersectionObserver(){if(this.imgUrl&&"IntersectionObserver"in window){let t=(this.el||document).querySelectorAll(".lazy-bg"),i=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){const e=t.target;e.classList.remove("lazy-bg"),i.unobserve(e)}}))}));t.forEach((t=>{i.observe(t)}))}}getCssClassMap(){return{[this.imageType]:!0,"ptc-img":!0,[this.borderRadius]:!0,[this.loadMode]:!0}}getCurrentBreakPoints(){let t,i=window.document,e=i.createElement("div");i.body.appendChild(e);for(let s=a.envs.length-1;s>=0;s--)if(t=a.envs[s],e.className="hidden-"+t,null===e.offsetParent)return i.body.removeChild(e),t;return i.body.removeChild(e),this.getFallbackBreakpoint()}getFallbackBreakpoint(){return window.matchMedia("(min-width: 992px)").matches?"lg":window.matchMedia("(min-width: 768px)").matches?"md":window.matchMedia("(min-width: 576px)").matches?"sm":"xs"}get el(){return s(this)}};h.style="h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}.smart-bg{width:100%;height:100%;background-size:cover;background-repeat:no-repeat;background-position:50% 50%}.smart-img{position:absolute;display:block;width:100%;height:100%;top:0;left:0;background-size:cover;background-repeat:no-repeat;background-position:50% 50%}.radius-standard{border-radius:var(--ptc-border-radius-standard)}.radius-standard-top{border-top-left-radius:var(--ptc-border-radius-standard);border-top-right-radius:var(--ptc-border-radius-standard)}.radius-large{border-radius:var(--ptc-border-radius-large)}.radius-large-top{border-top-left-radius:var(--ptc-border-radius-large);border-top-right-radius:var(--ptc-border-radius-large)}.lazy-bg{background-image:none !important;background-color:var(--color-gray-03)}@media only screen and (min-width: 768px){.hidden-xs{display:none !important}}@media (min-width: 768px) and (max-width: 991px){.hidden-sm{display:none !important}}@media (min-width: 992px) and (max-width: 1199px){.hidden-md{display:none !important}}@media only screen and (min-width: 768px){.hidden-lg{display:none !important}}";export{h as ptc_img}
|