@ptcwebops/ptcw-design 5.7.2 → 5.7.3

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.
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as i,g as a}from"./p-ac75c7ad.js";const o=class{constructor(e){t(this,e),this.moreText="read more",this.lessText=void 0,this.readMorePosition="right",this.display="inline",this.visibleLines="line2",this.visibleLinesCustom=void 0,this.zIndex="z-auto",this.checked=!1,this.size="small",this.isIcon=!1,this.color="blue"}async updateReadmoreStatus(){setTimeout((()=>{this.addBtnTruncated()}),100)}addBtnTruncated(){this.el.shadowRoot.querySelectorAll(".read-more-text").forEach((t=>{t.classList[t.scrollHeight>t.clientHeight?"add":"remove"]("truncated")}))}enableAddTruncatedClass(t){const e=document.querySelectorAll(t);for(const t of Array.from(e))t&&t.addEventListener("click",(()=>{setTimeout((()=>{this.addBtnTruncated()}),100)}))}componentDidLoad(){this.addBtnTruncated(),document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&this.addBtnTruncated()})),this.enableAddTruncatedClass("tab-header"),this.enableAddTruncatedClass("ptc-ellipsis-dropdown"),this.enableAddTruncatedClass("ptc-product-card")}handleClick(t){this.addBtnTruncated(),this.checked=t.target.checked;const e=this.el.shadowRoot.querySelector(".read-more-cta-label");e.innerHTML=this.checked?`<span> ${this.lessText?this.lessText:""} </span>`:`<span> ${this.moreText?this.moreText:""}</span>`,this.checked?e.classList.add("show-less-cta"):e.classList.remove("show-less-cta")}render(){const t=this.getCssClassMap();return e(i,{class:this.display},e("div",{class:t},e("input",{type:"checkbox",id:"expanded",onClick:t=>this.handleClick(t)}),this.visibleLines||this.visibleLinesCustom?e("p",{class:`read-more-text ${this.visibleLines}`,style:{WebkitLineClamp:`${this.visibleLinesCustom}`}},e("slot",null)):null,e("label",{htmlFor:"expanded",role:"button",class:this.zIndex+" "+this.readMorePosition+" read-more-cta-label"},e("span",null,this.moreText))))}getCssClassMap(){return{box:!0,[this.color]:!0,[this.size]:!0,"add-icon":this.isIcon}}get el(){return a(this)}};o.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}}:host{display:block}.box input{opacity:0;position:absolute;pointer-events:none}.box .read-more-text{display:-webkit-box;-webkit-box-orient:vertical;margin:0;overflow:hidden;word-wrap:break-word}.box .line1{-webkit-line-clamp:1}.box .line2{-webkit-line-clamp:2}.box .line3{-webkit-line-clamp:3}.box .line4{-webkit-line-clamp:4}.box .line5{-webkit-line-clamp:5}.box .line10{-webkit-line-clamp:10}.box input~label{display:block;position:relative;cursor:pointer;right:0;margin-top:var(--ptc-element-spacing-02);font-weight:var(--ptc-font-weight-bold);font-size:var(--ptc-font-size-x-small);line-height:var(--ptc-line-height-densest);text-decoration-line:underline;color:var(--color-hyperlink);text-align:right;margin-right:var(--ptc-element-spacing-07)}.box input~label.left{text-align:left}.box input~label.right{text-align:right}.box input~label.center{text-align:center;margin-right:0}.box .z-auto{z-index:auto}.box .z-1{z-index:1}.box .z-2{z-index:2}.box .z-3{z-index:3}.box .z-999{z-index:999}.box input:checked+.read-more-text{-webkit-line-clamp:unset !important}.box .read-more-text:not(.truncated)~label{display:none}.box .show-less-cta{display:block !important}:host .box.add-icon .read-more-cta-label span{display:inline-block;position:relative;padding-right:var(--ptc-element-spacing-03)}:host .box.add-icon .read-more-cta-label span::after{content:\"\";background-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 10 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2300890B' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E\");width:10px;height:7px;background-size:cover;position:absolute;right:-5px;bottom:7px}:host .box.add-icon .read-more-cta-label.show-less-cta span::after{transform:rotate(180deg)}:host .box.blue .read-more-cta-label{color:var(--color-hyperlink)}:host .box.gray .read-more-cta-label{color:var(--color-gray-10)}:host .box.green .read-more-cta-label{color:var(--color-green-07)}:host .box.initial .read-more-cta-label{color:initial}:host .box.small .read-more-cta-label{font-size:var(--ptc-font-size-x-small);line-height:var(--ptc-line-height-densest)}:host .box.medium .read-more-cta-label{font-size:var(--ptc-font-size-small);line-height:var(--ptc-line-height-p)}:host .box.large .read-more-cta-label{font-size:var(--ptc-font-size-large);line-height:var(--ptc-line-height-p)}:host .box.large.add-icon .read-more-cta-label span{padding-right:var(--ptc-element-spacing-04)}:host .box.large.add-icon .read-more-cta-label span::after{width:15px;height:10px}";export{o as ptc_readmore}