@scania/tegel 1.17.0 → 1.18.0--popover-menu-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +1 -1
- package/dist/cjs/tds-popover-core.cjs.entry.js +7 -1
- package/dist/cjs/tds-table-footer.cjs.entry.js +1 -1
- package/dist/collection/components/dropdown/dropdown.css +20 -1
- package/dist/collection/components/popover-core/popover-core.js +7 -1
- package/dist/collection/components/table/table-footer/table-footer.css +29 -16
- package/dist/components/{p-a9609e88.js → p-38c8c25c.js} +1 -1
- package/dist/components/{p-dc461e7b.js → p-e7353a84.js} +7 -1
- package/dist/components/{p-9c87dbde.js → p-f5531179.js} +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-header-dropdown.js +2 -2
- package/dist/components/tds-header-launcher.js +2 -2
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-popover-core.js +1 -1
- package/dist/components/tds-popover-menu.js +1 -1
- package/dist/components/tds-table-footer.js +2 -2
- package/dist/components/tds-tooltip.js +1 -1
- package/dist/esm/tds-dropdown_2.entry.js +1 -1
- package/dist/esm/tds-popover-core.entry.js +7 -1
- package/dist/esm/tds-table-footer.entry.js +1 -1
- package/dist/tegel/{p-6e2435ef.entry.js → p-0f486a7c.entry.js} +1 -1
- package/dist/tegel/p-285d7485.entry.js +1 -0
- package/dist/tegel/{p-cd289e17.entry.js → p-441ff0fb.entry.js} +1 -1
- package/dist/tegel/tegel.css +1 -1
- package/dist/tegel/tegel.esm.js +1 -1
- package/package.json +1 -1
- package/dist/tegel/p-4655ef6d.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as s,H as a,g as o}from"./p-2049fab2.js";const i=["compactDesign","horizontalScrollWidth"];function l(t){t.target.classList.remove("tds-table__page-selector-input--shake")}const d=class{constructor(s){t(this,s),this.tdsPagination=e(this,"tdsPagination",7),this.emitTdsPagination=()=>{this.tdsPagination.emit(this.rowsperpage?{tableId:this.tableId,paginationValue:Number(this.paginationValue),rowsPerPage:this.rowsPerPageValue}:{tableId:this.tableId,paginationValue:Number(this.paginationValue)})},this.previousPage=()=>{this.paginationValue>=2&&this.paginationValue--,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.nextPage=()=>{this.paginationValue<=this.pages&&this.paginationValue++,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.lastPage=()=>{this.paginationValue=this.pages,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.firstPage=()=>{this.paginationValue=1,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.pagination=!1,this.paginationValue=1,this.rowsperpage=!0,this.rowsPerPageValues=[10,25,50],this.pages=null,this.cols=null,this.columnsNumber=0,this.compactDesign=!1,this.lastCorrectValue=void 0,this.tableId="",this.horizontalScrollWidth=null,this.rowsPerPageValue=this.rowsPerPageValues[0]}internalTdsPropChangeListener(t){this.tableId===t.detail.tableId&&t.detail.changed.filter((t=>i.includes(t))).forEach((e=>{if(void 0===this[e])throw new Error(`Table prop is not supported: ${e}`);this[e]=t.detail[e]}))}connectedCallback(){this.tableEl=this.host.closest("tds-table"),this.tableId=this.tableEl.tableId}componentWillLoad(){i.forEach((t=>{this[t]=this.tableEl[t]})),this.storeLastCorrectValue(this.paginationValue);const t=this.host.parentElement.querySelector("tds-table-header").childElementCount;this.columnsNumber=this.cols?this.cols:t}storeLastCorrectValue(t){this.lastCorrectValue=t}paginationInputChange(t){const e=Number(t.target.value);e>t.target.max||e<t.target.min?(t.target.classList.add("tds-table__page-selector-input--shake"),this.inputElement.value=String(this.lastCorrectValue),this.paginationValue=Number(this.inputElement.value)):this.paginationValue=e,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)}rowsPerPageChange(t){this.rowsPerPageValue=parseInt(t.detail.value),this.paginationValue>this.pages&&(this.paginationValue=this.pages),this.emitTdsPagination()}getStyles(){const t={};return this.horizontalScrollWidth&&(t.width=`${this.horizontalScrollWidth}px`),t}render(){var t;return s(a,{key:"ef2cd69929908fa46254c82d0799c1b1a4ee52b3",class:{"tds-table--compact":this.compactDesign,"footer__horizontal-scroll":!!this.horizontalScrollWidth},style:this.getStyles()},s("tr",{key:"f18eb0b2a49d1d8df9dacc998138dae4e5f8d256",class:"tds-table__footer-row"},s("td",{key:"abb1f6f2971c9fa9b68bfb856882817406d0d87f",class:"tds-table__footer-cell",colSpan:this.columnsNumber},this.pagination&&s("div",{key:"8226ac0aee40b97cad90035ff9aba54b8365b960",class:"tds-table__pagination"},s("div",{key:"9b604d5ccb7dbdac0cdb1bc96567d7b29d7fa250",class:"tds-table__row-selector"},this.rowsperpage&&(null===(t=this.rowsPerPageValues)||void 0===t?void 0:t.length)>0&&s("div",{key:"716b6830e891305611ceb6213bd696298dbcfe12",class:"rows-per-page"},s("p",{key:"d6b7bfff5262fcf0174f6b2d92dcfdedda97dfc2"},"Rows per page"),s("tds-dropdown",{key:"9da6799f30172a1628a4630aa5474456f6351089",modeVariant:"secondary",id:"rows-dropdown",class:"page-dropdown",size:"xs",defaultValue:`${this.rowsPerPageValues[0]}`,onTdsChange:t=>this.rowsPerPageChange(t)},this.rowsPerPageValues.map((t=>s("tds-dropdown-option",{value:`${t}`},t)))))),s("div",{key:"73c5849886a0144c22b79d31b92a607d8f794483",class:"tds-table__page-selector"},s("input",{key:"a297fd5b739df5d4353b045a25ba6e480dbad03e",ref:t=>this.inputElement=t,class:"tds-table__page-selector-input",type:"number",min:"1",max:this.pages,value:this.paginationValue,pattern:"[0-9]+",dir:"ltr",onChange:t=>this.paginationInputChange(t),onAnimationEnd:l}),s("p",{key:"f6d1257c745638b2152843d52c494db23d26b2ca",class:"tds-table__footer-text"},"of ",s("span",{key:"81b8c076cf322798709eafae1fad43b036127ada"},this.pages)," pages"),s("button",{key:"d9789d9d6ccd45f1d0c4e4d427c3ed1bb13e7440",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue<=1,onClick:()=>this.firstPage()},s("tds-icon",{key:"dac60e50f54fd71ae1d89e21e6140bbcbbda6680",name:"skip_backwards",size:"20px"})),s("button",{key:"39810bac01a38c71427192beea48257b7d2dd2b1",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue<=1,onClick:()=>this.previousPage()},s("tds-icon",{key:"2987abbbdc7be2c7485d7bfcabcafe94983f5f54",name:"chevron_left",size:"20px"})),s("button",{key:"2252c555a816a4014c130b05ae70d2e25893f460",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue>=this.pages,onClick:()=>this.nextPage()},s("tds-icon",{key:"a19c83f25082c82cdac308d3538c274bbce62826",name:"chevron_right",size:"20px"})),s("button",{key:"e06ec885711559b6e7893d90ada5057292f624e0",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue>=this.pages,onClick:()=>this.lastPage()},s("tds-icon",{key:"6a8f4218a45cc5bdbb0c8b0711e802ce5f2dfed1",name:"skip_forward",size:"20px"})))))))}get host(){return o(this)}};d.style=
|
|
1
|
+
import{r as t,c as e,h as s,H as a,g as o}from"./p-2049fab2.js";const i=["compactDesign","horizontalScrollWidth"];function l(t){t.target.classList.remove("tds-table__page-selector-input--shake")}const d=class{constructor(s){t(this,s),this.tdsPagination=e(this,"tdsPagination",7),this.emitTdsPagination=()=>{this.tdsPagination.emit(this.rowsperpage?{tableId:this.tableId,paginationValue:Number(this.paginationValue),rowsPerPage:this.rowsPerPageValue}:{tableId:this.tableId,paginationValue:Number(this.paginationValue)})},this.previousPage=()=>{this.paginationValue>=2&&this.paginationValue--,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.nextPage=()=>{this.paginationValue<=this.pages&&this.paginationValue++,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.lastPage=()=>{this.paginationValue=this.pages,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.firstPage=()=>{this.paginationValue=1,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)},this.pagination=!1,this.paginationValue=1,this.rowsperpage=!0,this.rowsPerPageValues=[10,25,50],this.pages=null,this.cols=null,this.columnsNumber=0,this.compactDesign=!1,this.lastCorrectValue=void 0,this.tableId="",this.horizontalScrollWidth=null,this.rowsPerPageValue=this.rowsPerPageValues[0]}internalTdsPropChangeListener(t){this.tableId===t.detail.tableId&&t.detail.changed.filter((t=>i.includes(t))).forEach((e=>{if(void 0===this[e])throw new Error(`Table prop is not supported: ${e}`);this[e]=t.detail[e]}))}connectedCallback(){this.tableEl=this.host.closest("tds-table"),this.tableId=this.tableEl.tableId}componentWillLoad(){i.forEach((t=>{this[t]=this.tableEl[t]})),this.storeLastCorrectValue(this.paginationValue);const t=this.host.parentElement.querySelector("tds-table-header").childElementCount;this.columnsNumber=this.cols?this.cols:t}storeLastCorrectValue(t){this.lastCorrectValue=t}paginationInputChange(t){const e=Number(t.target.value);e>t.target.max||e<t.target.min?(t.target.classList.add("tds-table__page-selector-input--shake"),this.inputElement.value=String(this.lastCorrectValue),this.paginationValue=Number(this.inputElement.value)):this.paginationValue=e,this.emitTdsPagination(),this.storeLastCorrectValue(this.paginationValue)}rowsPerPageChange(t){this.rowsPerPageValue=parseInt(t.detail.value),this.paginationValue>this.pages&&(this.paginationValue=this.pages),this.emitTdsPagination()}getStyles(){const t={};return this.horizontalScrollWidth&&(t.width=`${this.horizontalScrollWidth}px`),t}render(){var t;return s(a,{key:"ef2cd69929908fa46254c82d0799c1b1a4ee52b3",class:{"tds-table--compact":this.compactDesign,"footer__horizontal-scroll":!!this.horizontalScrollWidth},style:this.getStyles()},s("tr",{key:"f18eb0b2a49d1d8df9dacc998138dae4e5f8d256",class:"tds-table__footer-row"},s("td",{key:"abb1f6f2971c9fa9b68bfb856882817406d0d87f",class:"tds-table__footer-cell",colSpan:this.columnsNumber},this.pagination&&s("div",{key:"8226ac0aee40b97cad90035ff9aba54b8365b960",class:"tds-table__pagination"},s("div",{key:"9b604d5ccb7dbdac0cdb1bc96567d7b29d7fa250",class:"tds-table__row-selector"},this.rowsperpage&&(null===(t=this.rowsPerPageValues)||void 0===t?void 0:t.length)>0&&s("div",{key:"716b6830e891305611ceb6213bd696298dbcfe12",class:"rows-per-page"},s("p",{key:"d6b7bfff5262fcf0174f6b2d92dcfdedda97dfc2"},"Rows per page"),s("tds-dropdown",{key:"9da6799f30172a1628a4630aa5474456f6351089",modeVariant:"secondary",id:"rows-dropdown",class:"page-dropdown",size:"xs",defaultValue:`${this.rowsPerPageValues[0]}`,onTdsChange:t=>this.rowsPerPageChange(t)},this.rowsPerPageValues.map((t=>s("tds-dropdown-option",{value:`${t}`},t)))))),s("div",{key:"73c5849886a0144c22b79d31b92a607d8f794483",class:"tds-table__page-selector"},s("input",{key:"a297fd5b739df5d4353b045a25ba6e480dbad03e",ref:t=>this.inputElement=t,class:"tds-table__page-selector-input",type:"number",min:"1",max:this.pages,value:this.paginationValue,pattern:"[0-9]+",dir:"ltr",onChange:t=>this.paginationInputChange(t),onAnimationEnd:l}),s("p",{key:"f6d1257c745638b2152843d52c494db23d26b2ca",class:"tds-table__footer-text"},"of ",s("span",{key:"81b8c076cf322798709eafae1fad43b036127ada"},this.pages)," pages"),s("button",{key:"d9789d9d6ccd45f1d0c4e4d427c3ed1bb13e7440",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue<=1,onClick:()=>this.firstPage()},s("tds-icon",{key:"dac60e50f54fd71ae1d89e21e6140bbcbbda6680",name:"skip_backwards",size:"20px"})),s("button",{key:"39810bac01a38c71427192beea48257b7d2dd2b1",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue<=1,onClick:()=>this.previousPage()},s("tds-icon",{key:"2987abbbdc7be2c7485d7bfcabcafe94983f5f54",name:"chevron_left",size:"20px"})),s("button",{key:"2252c555a816a4014c130b05ae70d2e25893f460",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue>=this.pages,onClick:()=>this.nextPage()},s("tds-icon",{key:"a19c83f25082c82cdac308d3538c274bbce62826",name:"chevron_right",size:"20px"})),s("button",{key:"e06ec885711559b6e7893d90ada5057292f624e0",type:"button",class:"tds-table__footer-btn",disabled:this.paginationValue>=this.pages,onClick:()=>this.lastPage()},s("tds-icon",{key:"6a8f4218a45cc5bdbb0c8b0711e802ce5f2dfed1",name:"skip_forward",size:"20px"})))))))}get host(){return o(this)}};d.style=':host{box-sizing:border-box;display:table-footer-group;height:var(--tds-spacing-element-48)}:host *{box-sizing:border-box}:host .tds-table__footer-row{background-color:var(--tds-table-footer-background);color:var(--tds-table-color)}:host .tds-table__footer-cell{padding:0 var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-48);display:flex;align-items:center;justify-content:space-between}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector{display:flex;align-items:center}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page{display:flex;align-items:center;margin-right:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__row-selector .rows-per-page p,:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector .rows-per-page p{margin-right:var(--tds-spacing-element-8)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);background-color:var(--tds-table-footer-page-selector-input-background);color:var(--tds-table-color);width:54px;height:30px;border:none;border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;margin-right:var(--tds-spacing-element-4);padding-left:var(--tds-spacing-element-16)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:hover{background-color:var(--tds-table-footer-page-selector-input-background-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input:disabled{color:var(--tds-table-footer-page-selector-input-color-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input--shake{animation:tds-shake-animation 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;transform:translate3d(0, 0, 0);backface-visibility:hidden;perspective:1000px}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-text{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);padding:1px 8px 0 0}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{display:flex;justify-content:center;align-items:center;border:none;background-color:transparent;cursor:pointer;height:var(--tds-spacing-element-32);width:var(--tds-spacing-element-32);border-radius:var(--tds-spacing-element-4);transition:background-color 250ms ease;color:var(--tds-table-footer-page-selector-icon)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:hover{background-color:var(--tds-table-footer-btn-hover)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled{cursor:default;color:var(--tds-table-footer-page-selector-icon-disabled)}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn:disabled:hover{background-color:transparent}:host .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn-svg{height:var(--tds-spacing-element-20);width:var(--tds-spacing-element-20);fill:var(--tds-table-color)}:host(.tds-table--compact){height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination{height:var(--tds-spacing-element-32)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__page-selector-input{height:var(--tds-spacing-element-24)}:host(.tds-table--compact) .tds-table__footer-cell .tds-table__pagination .tds-table__footer-btn{height:28px;width:28px}:host(.footer__horizontal-scroll){display:inline-table;position:absolute;margin-top:10px}@keyframes tds-shake-animation{10%,90%{transform:translate3d(-1px, 0, 0)}20%,80%{transform:translate3d(2px, 0, 0)}30%,50%,70%{transform:translate3d(-4px, 0, 0)}40%,60%{transform:translate3d(4px, 0, 0)}}tds-dropdown:focus-within::after{content:"";position:absolute;bottom:0;left:0;height:100%;width:100%;background-color:transparent;border-radius:var(--tds-spacing-element-4);pointer-events:none;outline:2px solid var(--tds-blue-400);outline-offset:-2px}';export{d as tds_table_footer}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as o,h as s,H as e,g as i}from"./p-2049fab2.js";const d=class{constructor(s){t(this,s),this.tdsChange=o(this,"tdsChange",6),this.tdsFocus=o(this,"tdsFocus",6),this.tdsBlur=o(this,"tdsBlur",6),this.tdsInput=o(this,"tdsInput",6),this.setDefaultOption=()=>{if(this.defaultValue){const t=Array.from(this.host.children).filter((t=>"TDS-DROPDOWN-OPTION"===t.tagName));if(0===t.length)return void console.warn("TDS DROPDOWN: No options found. Disregard if loading data asynchronously.");const o=this.multiselect?new Set(this.defaultValue.split(",")):[this.defaultValue],s=new Map(t.map((t=>[t.value,t]))),e=Array.from(o).filter((t=>{const o=s.get(t);return!!o&&(o.setSelected(!0),!0)}));e.length>0?(this.value=[...new Set(this.value?[...this.value,...e]:e)],this.setValueAttribute()):console.warn(`TDS DROPDOWN: No matching option found for defaultValue "${this.defaultValue}"`)}},this.getChildren=()=>{const t=Array.from(this.host.children).filter((t=>"TDS-DROPDOWN-OPTION"===t.tagName));if(0!==t.length)return t;console.warn("TDS DROPDOWN: Data missing. Disregard if loading data asynchronously.")},this.getOpenDirection=()=>{var t,o,s,e,i;if("auto"===this.openDirection||!this.openDirection){const d=null!==(o=null===(t=this.dropdownList)||void 0===t?void 0:t.offsetHeight)&&void 0!==o?o:0;return(null!==(i=null===(e=(s=this.host).getBoundingClientRect)||void 0===e?void 0:e.call(s).top)&&void 0!==i?i:0)+d+57>window.innerHeight?"up":"down"}return this.openDirection},this.handleToggleOpen=()=>{this.disabled||(this.open=!this.open,this.open&&this.focusInputElement())},this.focusInputElement=()=>{this.inputElement&&this.inputElement.focus()},this.getSelectedChildren=()=>{var t;return null===(t=this.value)||void 0===t?void 0:t.map((t=>this.getChildren().find((o=>o.value===t)))).filter(Boolean)},this.getSelectedChildrenLabels=()=>{var t;return null===(t=this.getSelectedChildren())||void 0===t?void 0:t.map((t=>t.textContent.trim()))},this.getValue=()=>{const t=this.getSelectedChildrenLabels();return t?this.filter?null==t?void 0:t.join(", "):null==t?void 0:t.toString():""},this.setValueAttribute=()=>{var t;this.value&&""!==(null===(t=this.value)||void 0===t?void 0:t.toString())?this.host.setAttribute("value",this.value.map((t=>t)).toString()):this.host.removeAttribute("value")},this.handleFilter=t=>{this.tdsInput.emit(t);const o=t.target.value.toLowerCase(),s=this.getChildren();""===o?(s.forEach((t=>(t.removeAttribute("hidden"),t))),this.filterResult=null):this.filterResult=s.filter((t=>(this.normalizeString(t.textContent).toLowerCase().includes(this.normalizeString(o).toLowerCase())?t.removeAttribute("hidden"):t.setAttribute("hidden",""),!t.hasAttribute("hidden")))).length},this.handleFilterReset=()=>{this.reset(),this.inputElement.value="",this.handleFilter({target:{value:this.inputElement.value}}),this.inputElement.focus()},this.handleFocus=t=>{this.tdsFocus.emit(t)},this.handleBlur=t=>{this.tdsBlur.emit(t)},this.handleChange=()=>{var t,o;this.tdsChange.emit({name:this.name,value:null!==(o=null===(t=this.value)||void 0===t?void 0:t.map((t=>t)).toString())&&void 0!==o?o:null})},this.name=void 0,this.disabled=!1,this.helper=void 0,this.label=void 0,this.labelPosition=void 0,this.modeVariant=null,this.openDirection="auto",this.placeholder=void 0,this.size="lg",this.error=!1,this.multiselect=!1,this.filter=!1,this.normalizeText=!0,this.noResultText="No result",this.defaultValue=void 0,this.open=!1,this.value=void 0,this.filterResult=void 0,this.filterFocus=void 0}async reset(){this.dropdownList.scrollTop=0,this.internalReset(),this.handleChange()}async setValue(t,o){let s;s="string"==typeof t?[t]:t,!this.multiselect&&s.length>1&&(console.warn("Tried to select multiple items, but multiselect is not enabled."),s=[s[0]]),s=[...new Set(s)],this.internalReset();for(let t=0;t<s.length;t++)this.getChildren().some((o=>o.value===s[t]))||s.splice(t,1);this.value=s,this.setValueAttribute(),this.selectChildrenAsSelectedBasedOnSelectionProp(),this.handleChange();const e=this.getSelectedChildren().map((t=>({value:t.value,label:t.textContent.trim()})));return this.filter&&(this.inputElement.value=this.getValue()),e}async appendValue(t){this.setValue(this.multiselect&&this.value?[...this.value,t]:t)}async removeValue(t){var o,s;let e;return this.multiselect?null===(o=this.getChildren())||void 0===o||o.forEach((o=>{var s;return o.value===t&&(this.value=null===(s=this.value)||void 0===s?void 0:s.filter((t=>t!==o.value)),e=o.textContent.trim(),o.setSelected(!1)),o})):this.reset(),this.handleChange(),this.setValueAttribute(),null===(s=this.value)||void 0===s?void 0:s.map((t=>({value:t,label:e})))}async close(){this.open=!1}onAnyClick(t){this.open&&!t.composedPath().includes(this.host)&&(this.open=!1)}async onKeyDown(t){const{activeElement:o}=document;if(!o)return;const s=this.getChildren();if("ArrowDown"===t.key){const t=o.nextElementSibling?s.findIndex((t=>t===o.nextElementSibling)):0;s[((t,o)=>{if(void 0===t[o])return 0;for(let s=o;s<t.length;s++)if(!t[s].disabled)return s})(s,t)].focus()}else"ArrowUp"===t.key?s[((t,o)=>{if(void 0===t[o])return t.length-1;for(let s=o;s>=0;s--)if(!t[s].disabled)return s})(s,o.nextElementSibling?this.getChildren().findIndex((t=>t===o.previousElementSibling)):0)].focus():"Escape"===t.key&&(this.open=!1)}handleOpenState(){this.filter&&this.multiselect&&(this.open||(this.inputElement.value=this.getValue()))}componentWillLoad(){this.setDefaultOption()}handleSlotChange(){this.setDefaultOption()}normalizeString(t){return this.normalizeText?t.normalize("NFD").replace(/\p{Diacritic}/gu,""):t}internalReset(){this.getChildren().forEach((t=>(t.setSelected(!1),t))),this.value=null,this.setValueAttribute()}selectChildrenAsSelectedBasedOnSelectionProp(){this.getChildren().forEach((t=>{this.value.forEach((o=>{t.value!==o?this.multiselect||t.setSelected(!1):t.setSelected(!0)}))}))}render(){var t,o,i,d;return((t,o,s,e)=>{let i=t.querySelector("input");t.querySelector("input")||(i=t.ownerDocument.createElement("input"),i.type="hidden",t.appendChild(i)),i.disabled=e,i.name=o,i.value=s||""})(this.host,this.name,null===(t=this.value)||void 0===t?void 0:t.map((t=>t)).toString(),this.disabled),s(e,{key:"c756dc7221c39b901524bd0c28938bd166e412bc",role:"select",class:this.modeVariant?`tds-mode-variant-${this.modeVariant}`:""},this.label&&"outside"===this.labelPosition&&s("div",{key:"5184a8c84d24e0f13379c95fc7ceb7791f1e25ab",class:"label-outside "+(this.disabled?"disabled":"")},this.label),s("div",{key:"601bc322ce765ed1ee52e1ee6a0894fcb335485b",class:`dropdown-select ${this.size} ${this.disabled?"disabled":""}`},this.filter?s("div",{class:{filter:!0,focus:this.filterFocus,disabled:this.disabled,error:this.error}},s("div",{class:"value-wrapper"},this.label&&"inside"===this.labelPosition&&this.placeholder&&s("div",{class:`label-inside ${this.size}`},this.label),this.label&&"inside"===this.labelPosition&&!this.placeholder&&s("div",{class:`\n label-inside-as-placeholder\n ${this.size}\n ${(null===(o=this.value)||void 0===o?void 0:o.length)?"selected":""}\n `},this.label),s("input",{ref:t=>this.inputElement=t,class:"inside"===this.labelPosition?"placeholder":"",type:"text",placeholder:this.filterFocus?"":this.placeholder,value:this.multiselect&&this.filterFocus?"":this.getValue(),disabled:this.disabled,onInput:t=>this.handleFilter(t),onBlur:t=>{this.filterFocus=!1,this.multiselect&&(this.inputElement.value=this.getValue()),this.handleBlur(t)},onFocus:t=>{this.open=!0,this.filterFocus=!0,this.multiselect&&(this.inputElement.value=""),this.handleFocus(t),this.handleFilter({target:{value:""}})},onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)}})),s("tds-icon",{tabIndex:0,role:"button","aria-label":"Clear filter",svgTitle:"Clear filter",onClick:this.handleFilterReset,onKeyDown:t=>{"Enter"===t.key&&this.handleFilterReset()},class:"clear-icon "+(this.open&&""!==this.inputElement.value?"":"hide"),name:"cross",size:"16px"}),s("tds-icon",{tabIndex:0,role:"button","aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",onClick:this.handleToggleOpen,onKeyDown:t=>{"Enter"===t.key&&this.handleToggleOpen()},class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"})):s("button",{onClick:()=>this.handleToggleOpen(),onKeyDown:t=>{"Escape"===t.key&&(this.open=!1)},class:`\n ${this.value?"value":"placeholder"}\n ${this.open?"open":"closed"}\n ${this.error?"error":""}\n `,disabled:this.disabled},s("div",{class:`value-wrapper ${this.size}`},this.label&&"inside"===this.labelPosition&&this.placeholder&&s("div",{class:`label-inside ${this.size}`},this.label),this.label&&"inside"===this.labelPosition&&!this.placeholder&&s("div",{class:`\n label-inside-as-placeholder\n ${this.size}\n ${(null===(i=this.value)||void 0===i?void 0:i.length)?"selected":""}\n `},this.label),s("div",{class:`placeholder ${this.size}`},(null===(d=this.value)||void 0===d?void 0:d.length)?this.getValue():this.placeholder),s("tds-icon",{"aria-label":"Open/Close dropdown",svgTitle:"Open/Close dropdown",class:"menu-icon "+(this.open?"open":"closed"),name:"chevron_down",size:"16px"})))),s("div",{key:"71042ce1a28e3598ee37977b86ae887c68caad1d",ref:t=>this.dropdownList=t,class:`dropdown-list\n ${this.size}\n ${this.open?"open":"closed"}\n ${this.getOpenDirection()}\n ${this.label&&"outside"===this.labelPosition?"label-outside":""}`},s("slot",{key:"bf606ae5c67258fc04df20474cde59ff00ea90eb",onSlotchange:()=>this.handleSlotChange()}),0===this.filterResult&&""!==this.noResultText&&s("div",{key:"2a1b20c4ad0acf3f6c7de06ef3e6a84e7879f398",class:`no-result ${this.size}`},this.noResultText)),this.helper&&s("div",{key:"1c4cb2ca717f28fe16306729ae6cf555358a1a65",class:`helper ${this.error?"error":""} ${this.disabled?"disabled":""}`},this.error&&s("tds-icon",{key:"6b3a6054fa2e1f1b77c8520cdfab20ef5e7a4bf9",name:"error",size:"16px"}),this.helper))}get host(){return i(this)}static get watchers(){return{open:["handleOpenState"]}}};d.style='@charset "UTF-8";:host button{all:unset;height:100%;width:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);border-radius:var(--tds-dropdown-border-radius)}:host button:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host button .value-wrapper{padding:0 16px;display:flex;align-items:center;justify-content:space-between}:host button.placeholder{color:var(--tds-dropdown-placeholder-color);line-height:1.3}:host button.value{color:var(--tds-dropdown-value-color);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3}:host button:focus{border-bottom-color:var(--tds-dropdown-border-bottom-open)}:host button:focus::before{content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background:var(--tds-dropdown-border-bottom-open)}:host button.error{border-bottom:1px solid var(--tds-negative)}:host button.error:focus{border-bottom-color:transparent}:host button.error:focus::before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-negative)}:host button:disabled{color:var(--tds-dropdown-disabled-color);border-bottom:1px solid transparent}:host button .menu-icon{margin-right:0}:host .filter{display:flex;align-items:center;justify-content:space-between;height:100%;background-color:var(--tds-dropdown-bg);border-bottom:1px solid var(--tds-dropdown-border-bottom);padding-left:16px;border-radius:4px 4px 0 0}:host .filter:hover{border-bottom:1px solid var(--tds-dropdown-border-bottom-hover)}:host .filter.disabled{color:var(--tds-dropdown-disabled-color);border-bottom:1px solid transparent}:host .filter .value-wrapper{display:flex;width:100%;height:100%}:host .filter .label-inside-as-placeholder{position:absolute;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);line-height:1.3;color:var(--tds-dropdown-placeholder-color)}:host .filter .label-inside-as-placeholder.lg{top:20px}:host .filter .label-inside-as-placeholder.md{top:16px}:host .filter .label-inside-as-placeholder.sm{display:none}:host .filter .label-inside-as-placeholder.selected{font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .filter .label-inside-as-placeholder.selected.lg{top:12px}:host .filter .label-inside-as-placeholder.selected.md{top:8px}:host .filter .label-inside-as-placeholder.selected.sm{display:none}:host .filter .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .filter.focus{border-bottom-color:transparent}:host .filter.focus::before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-dropdown-border-bottom-open)}:host .filter.error{border-bottom:1px solid var(--tds-negative)}:host .filter.error.focus{border-bottom-color:transparent}:host .filter.error.focus::before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:var(--tds-negative)}:host .filter input{flex:1;all:unset;width:100%}:host .filter input::placeholder{color:var(--tds-dropdown-placeholder-color)}:host .filter input:disabled::placeholder{color:var(--tds-dropdown-disabled-color)}:host .filter tds-icon{cursor:pointer}:host .filter .menu-icon{margin-right:16px}:host .filter .clear-icon{margin:0 8px;color:var(--tds-dropdown-clear-icon-color);padding-right:8px;border-right:1px solid var(--tds-dropdown-clear-icon-color)}:host .filter .clear-icon:hover{color:var(--tds-dropdown-clear-icon-hover-color)}:host .filter .clear-icon.hide{display:none;visibility:hidden}:host{--tds-scrollbar-width-standard:thin;--tds-scrollbar-width:10px;--tds-scrollbar-height:10px;--tds-scrollbar-thumb-border-width:3px;--tds-scrollbar-thumb-border-hover-width:2px}body{scrollbar-width:thin}:host{display:block;position:relative;font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls)}:host .label-outside{font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);color:var(--tds-dropdown-label-color);margin-bottom:8px}:host .label-outside.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select{position:relative}:host .dropdown-select button:focus{border-bottom-color:var(--tds-dropdown-border-bottom)}:host .dropdown-select button{border-bottom-color:var(--tds-dropdown-border-bottom)}:host .dropdown-select button.error{border-bottom-color:var(--tds-negative)}:host .dropdown-select button.error:focus{border-bottom-color:transparent}:host .dropdown-select.disabled .label-inside,:host .dropdown-select.disabled .placeholder,:host .dropdown-select.disabled .label-inside-as-placeholder,:host .dropdown-select.disabled .value-wrapper{color:var(--tds-dropdown-disabled-color)}:host .dropdown-select.disabled button{border:none}:host .dropdown-select .label-inside{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);color:var(--tds-dropdown-label-inside-color)}:host .dropdown-select .label-inside.lg{top:12px;left:16px}:host .dropdown-select .label-inside.md{top:8px;left:16px}:host .dropdown-select .label-inside.sm{display:none}:host .dropdown-select .label-inside.xs{display:none}:host .dropdown-select .label-inside+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select .placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:var(--tds-placeholder-margin);}:host .dropdown-select .placeholder.xs{line-height:1}:host .dropdown-select .label-inside-as-placeholder{color:var(--tds-dropdown-placeholder-color)}:host .dropdown-select .label-inside-as-placeholder.selected{position:absolute;font:var(--tds-detail-07);letter-spacing:var(--tds-detail-07-ls);transition:all 0.2s ease-in-out}:host .dropdown-select .label-inside-as-placeholder.selected.lg{top:12px}:host .dropdown-select .label-inside-as-placeholder.selected.md{top:8px}:host .dropdown-select .label-inside-as-placeholder.selected.sm{display:none}:host .dropdown-select .label-inside-as-placeholder.selected+.placeholder:not(.sm){margin-top:8px}:host .dropdown-select.lg{height:55px}:host .dropdown-select.md{height:47px}:host .dropdown-select.sm{height:39px}:host .dropdown-select.xs{height:29px}:host .helper{margin-top:4px;color:var(--tds-dropdown-helper-color);font:var(--tds-detail-05);letter-spacing:var(--tds-detail-05-ls);display:flex;align-items:center;gap:8px}:host .helper.error{color:var(--tds-negative)}:host .helper.disabled{color:var(--tds-dropdown-disabled-color)}:host .dropdown-list{z-index:100;position:absolute;margin-top:1px;width:100%;transform-origin:top;transition:transform 0.2s ease-in-out;box-shadow:rgba(0, 0, 0, 0.1) 0 2px 3px 0;border-radius:0 0 4px 4px;overflow-y:auto}:host .dropdown-list:hover::-webkit-scrollbar-thumb{border:var(--tds-scrollbar-thumb-border-hover-width) solid transparent;background:var(--tds-scrollbar-hover-thumb-color);background-clip:padding-box}:host .dropdown-list::-webkit-scrollbar{width:var(--tds-scrollbar-width)}:host .dropdown-list::-webkit-scrollbar-track{background:var(--tds-scrollbar-track-color)}:host .dropdown-list::-webkit-scrollbar-thumb{border-radius:40px;background:var(--tds-scrollbar-thumb-color);border:var(--tds-scrollbar-thumb-border-width) solid transparent;background-clip:padding-box}:host .dropdown-list::-webkit-scrollbar-button{height:0;width:0}@supports not selector(::-webkit-scrollbar){:host .dropdown-list{scrollbar-color:var(--tds-scrollbar-thumb-color) var(--tds-scrollbar-track-color);scrollbar-width:var(--tds-scrollbar-width-standard)}}:host .dropdown-list.lg{max-height:312px}:host .dropdown-list.md{max-height:312px}:host .dropdown-list.sm{max-height:260px}:host .dropdown-list.xs{max-height:260px}:host .dropdown-list.up{bottom:100%;margin-top:0;margin-bottom:1px;transform-origin:bottom;display:flex;flex-direction:column-reverse;box-shadow:rgba(0, 0, 0, 0.1) 0 -1px 3px 0;border-radius:4px 4px 0 0}:host .dropdown-list.up.label-outside{bottom:calc(100% - 24px)}:host .dropdown-list.closed{transform:scaleY(0);visibility:hidden}:host .dropdown-list.open{transform:scaleY(1)}:host .dropdown-list .no-result{font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);display:flex;align-items:center;padding:0 16px;background-color:var(--tds-dropdown-bg)}:host .dropdown-list .no-result.lg{height:56px}:host .dropdown-list .no-result.md{height:48px}:host .dropdown-list .no-result.sm{height:40px}:host .dropdown-list .no-result.xs{height:40px}:host .menu-icon{color:var(--tds-dropdown-menu-icon-color)}:host tds-icon{transition:transform 0.2s ease-in-out}:host tds-icon.open{transform:rotateZ(180deg)}';const r=class{constructor(s){t(this,s),this.tdsSelect=o(this,"tdsSelect",6),this.tdsFocus=o(this,"tdsFocus",6),this.tdsBlur=o(this,"tdsBlur",6),this.componentWillRender=()=>{this.parentElement="TDS-DROPDOWN"===this.host.parentElement.tagName?this.host.parentElement:this.host.getRootNode().host,this.multiselect=this.parentElement.multiselect,this.size=this.parentElement.size,this.label=this.host.textContent.trim()},this.handleSingleSelect=()=>{this.disabled||(this.selected=!0,this.parentElement.appendValue(this.value),this.parentElement.close(),this.tdsSelect.emit({value:this.value,selected:this.selected}))},this.handleMultiselect=t=>{this.disabled||(t.detail.checked?(this.parentElement.appendValue(this.value),this.selected=!0,this.tdsSelect.emit({value:this.value,selected:this.selected})):(this.parentElement.removeValue(this.value),this.selected=!1,this.tdsSelect.emit({value:this.value,selected:this.selected})),t.stopPropagation())},this.handleFocus=t=>{this.tdsFocus.emit(t)},this.handleBlur=t=>{this.tdsBlur.emit(t)},this.value=void 0,this.disabled=!1,this.selected=!1,this.multiselect=void 0,this.size="lg"}async setSelected(t){this.selected=t}render(){return s(e,{key:"1cb00a19c5dbcc47e1b2bc97d1d5ccc8ac5a532a",role:"option","aria-disabled":this.disabled,"aria-selected":this.selected},s("div",{key:"5deaf44c7306f4b1856200bf0a5640e99fcb449d",class:`dropdown-option \n ${this.size}\n ${this.selected?"selected":""}\n ${this.disabled?"disabled":""}\n `},this.multiselect?s("div",{class:"multiselect",onKeyDown:t=>{"Escape"===t.key&&this.parentElement.close()}},s("tds-checkbox",{onTdsChange:t=>{this.handleMultiselect(t)},disabled:this.disabled,checked:this.selected,class:{[this.size]:!0}},s("div",{slot:"label"},s("slot",null)))):s("button",{onClick:()=>{this.handleSingleSelect()},onFocus:t=>this.handleFocus(t),onBlur:t=>this.handleBlur(t),disabled:this.disabled,class:this.size},s("div",{class:"single-select"},s("slot",null),this.selected&&s("tds-icon",{name:"tick",size:"16px"})))))}static get delegatesFocus(){return!0}get host(){return i(this)}};r.style=":host{box-sizing:border-box;display:block;background-color:var(--tds-dropdown-option-background)}:host *{box-sizing:border-box}:host .dropdown-option{color:var(--tds-dropdown-option-color);border-bottom:1px solid var(--tds-dropdown-option-border);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);overflow-wrap:anywhere}:host .dropdown-option.selected{background-color:var(--tds-dropdown-option-background-selected)}:host .dropdown-option.disabled{color:var(--tds-dropdown-option-color-disabled)}:host .dropdown-option button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .dropdown-option button{all:unset;width:100%}:host .dropdown-option button.lg{padding:19px 0 20px}:host .dropdown-option button.md{padding:15px 0 16px}:host .dropdown-option button.sm{padding:11px 0 12px}:host .dropdown-option button.xs{padding:7px 0 8px}:host .dropdown-option button .single-select{display:flex;align-items:center;justify-content:space-between;padding:0 16px}:host .dropdown-option .multiselect{width:100%;height:100%}:host .dropdown-option .multiselect tds-checkbox{display:flex;height:100%;width:100%}:host .dropdown-option .multiselect tds-checkbox.lg{padding:15px 16px 16px}:host .dropdown-option .multiselect tds-checkbox.md{padding:11px 16px 12px}:host .dropdown-option .multiselect tds-checkbox.sm{padding:7px 16px 8px}:host .dropdown-option .multiselect tds-checkbox.xs{padding:7px 16px 8px}:host .dropdown-option:hover{background-color:var(--tds-dropdown-option-background-hover);cursor:pointer}:host .dropdown-option:hover.disabled{background-color:var(--tds-dropdown-option-background);cursor:not-allowed}:host([hidden]){display:none}";export{d as tds_dropdown,r as tds_dropdown_option}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as n,h as e,H as i,g as r}from"./p-2049fab2.js";import{g as o}from"./p-11648030.js";var u="top",a="bottom",f="right",s="left",c="auto",l=[u,a,f,s],h="start",d="end",p="clippingParents",v="viewport",b="popper",m="reference",y=l.reduce((function(t,n){return t.concat([n+"-"+h,n+"-"+d])}),[]),g=[].concat(l,[c]).reduce((function(t,n){return t.concat([n,n+"-"+h,n+"-"+d])}),[]),x=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function w(t){return t?(t.nodeName||"").toLowerCase():null}function O(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function j(t){return t instanceof O(t).Element||t instanceof Element}function k(t){return t instanceof O(t).HTMLElement||t instanceof HTMLElement}function E(t){return"undefined"!=typeof ShadowRoot&&(t instanceof O(t).ShadowRoot||t instanceof ShadowRoot)}function C(t){return t.split("-")[0]}var M=Math.max,S=Math.min,T=Math.round;function A(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function R(){return!/^((?!chrome|android).)*safari/i.test(A())}function q(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var i=t.getBoundingClientRect(),r=1,o=1;n&&k(t)&&(r=t.offsetWidth>0&&T(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&T(i.height)/t.offsetHeight||1);var u=(j(t)?O(t):window).visualViewport,a=!R()&&e,f=(i.left+(a&&u?u.offsetLeft:0))/r,s=(i.top+(a&&u?u.offsetTop:0))/o,c=i.width/r,l=i.height/o;return{width:c,height:l,top:s,right:f+c,bottom:s+l,left:f,x:f,y:s}}function B(t){var n=q(t),e=t.offsetWidth,i=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-i)<=1&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:i}}function L(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&E(e)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function P(t){return O(t).getComputedStyle(t)}function W(t){return["table","td","th"].indexOf(w(t))>=0}function H(t){return((j(t)?t.ownerDocument:t.document)||window.document).documentElement}function z(t){return"html"===w(t)?t:t.assignedSlot||t.parentNode||(E(t)?t.host:null)||H(t)}function I(t){return k(t)&&"fixed"!==P(t).position?t.offsetParent:null}function D(t){for(var n=O(t),e=I(t);e&&W(e)&&"static"===P(e).position;)e=I(e);return e&&("html"===w(e)||"body"===w(e)&&"static"===P(e).position)?n:e||function(t){var n=/firefox/i.test(A());if(/Trident/i.test(A())&&k(t)&&"fixed"===P(t).position)return null;var e=z(t);for(E(e)&&(e=e.host);k(e)&&["html","body"].indexOf(w(e))<0;){var i=P(e);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return e;e=e.parentNode}return null}(t)||n}function _(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function U(t,n,e){return M(t,S(n,e))}function $(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function F(t,n){return n.reduce((function(n,e){return n[e]=t,n}),{})}function V(t){return t.split("-")[1]}var G={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(t){var n,e=t.popper,i=t.popperRect,r=t.placement,o=t.variation,c=t.offsets,l=t.position,h=t.gpuAcceleration,p=t.adaptive,v=t.roundOffsets,b=t.isFixed,m=c.x,y=void 0===m?0:m,g=c.y,x=void 0===g?0:g,w="function"==typeof v?v({x:y,y:x}):{x:y,y:x};y=w.x,x=w.y;var j=c.hasOwnProperty("x"),k=c.hasOwnProperty("y"),E=s,C=u,M=window;if(p){var S=D(e),A="clientHeight",R="clientWidth";S===O(e)&&"static"!==P(S=H(e)).position&&"absolute"===l&&(A="scrollHeight",R="scrollWidth"),(r===u||(r===s||r===f)&&o===d)&&(C=a,x-=(b&&S===M&&M.visualViewport?M.visualViewport.height:S[A])-i.height,x*=h?1:-1),r!==s&&(r!==u&&r!==a||o!==d)||(E=f,y-=(b&&S===M&&M.visualViewport?M.visualViewport.width:S[R])-i.width,y*=h?1:-1)}var q,B=Object.assign({position:l},p&&G),L=!0===v?function(t,n){var e=t.y,i=n.devicePixelRatio||1;return{x:T(t.x*i)/i||0,y:T(e*i)/i||0}}({x:y,y:x},O(e)):{x:y,y:x};return y=L.x,x=L.y,Object.assign({},B,h?((q={})[C]=k?"0":"",q[E]=j?"0":"",q.transform=(M.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",q):((n={})[C]=k?x+"px":"",n[E]=j?y+"px":"",n.transform="",n))}var K={passive:!0},N={left:"right",right:"left",bottom:"top",top:"bottom"};function Q(t){return t.replace(/left|right|bottom|top/g,(function(t){return N[t]}))}var X={start:"end",end:"start"};function Y(t){return t.replace(/start|end/g,(function(t){return X[t]}))}function Z(t){var n=O(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function tt(t){return q(H(t)).left+Z(t).scrollLeft}function nt(t){var n=P(t);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function et(t){return["html","body","#document"].indexOf(w(t))>=0?t.ownerDocument.body:k(t)&&nt(t)?t:et(z(t))}function it(t,n){var e;void 0===n&&(n=[]);var i=et(t),r=i===(null==(e=t.ownerDocument)?void 0:e.body),o=O(i),u=r?[o].concat(o.visualViewport||[],nt(i)?i:[]):i,a=n.concat(u);return r?a:a.concat(it(z(u)))}function rt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ot(t,n,e){return n===v?rt(function(t,n){var e=O(t),i=H(t),r=e.visualViewport,o=i.clientWidth,u=i.clientHeight,a=0,f=0;if(r){o=r.width,u=r.height;var s=R();(s||!s&&"fixed"===n)&&(a=r.offsetLeft,f=r.offsetTop)}return{width:o,height:u,x:a+tt(t),y:f}}(t,e)):j(n)?function(t,n){var e=q(t,!1,"fixed"===n);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(n,e):rt(function(t){var n,e=H(t),i=Z(t),r=null==(n=t.ownerDocument)?void 0:n.body,o=M(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),u=M(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+tt(t),f=-i.scrollTop;return"rtl"===P(r||e).direction&&(a+=M(e.clientWidth,r?r.clientWidth:0)-o),{width:o,height:u,x:a,y:f}}(H(t)))}function ut(t){var n,e=t.reference,i=t.element,r=t.placement,o=r?C(r):null,c=r?V(r):null,l=e.x+e.width/2-i.width/2,p=e.y+e.height/2-i.height/2;switch(o){case u:n={x:l,y:e.y-i.height};break;case a:n={x:l,y:e.y+e.height};break;case f:n={x:e.x+e.width,y:p};break;case s:n={x:e.x-i.width,y:p};break;default:n={x:e.x,y:e.y}}var v=o?_(o):null;if(null!=v){var b="y"===v?"height":"width";switch(c){case h:n[v]=n[v]-(e[b]/2-i[b]/2);break;case d:n[v]=n[v]+(e[b]/2-i[b]/2)}}return n}function at(t,n){void 0===n&&(n={});var e=n.placement,i=void 0===e?t.placement:e,r=n.strategy,o=void 0===r?t.strategy:r,s=n.boundary,c=void 0===s?p:s,h=n.rootBoundary,d=void 0===h?v:h,y=n.elementContext,g=void 0===y?b:y,x=n.altBoundary,O=void 0!==x&&x,E=n.padding,C=void 0===E?0:E,T=$("number"!=typeof C?C:F(C,l)),A=t.rects.popper,R=t.elements[O?g===b?m:b:g],B=function(t,n,e,i){var r="clippingParents"===n?function(t){var n=it(z(t)),e=["absolute","fixed"].indexOf(P(t).position)>=0&&k(t)?D(t):t;return j(e)?n.filter((function(t){return j(t)&&L(t,e)&&"body"!==w(t)})):[]}(t):[].concat(n),o=[].concat(r,[e]),u=o.reduce((function(n,e){var r=ot(t,e,i);return n.top=M(r.top,n.top),n.right=S(r.right,n.right),n.bottom=S(r.bottom,n.bottom),n.left=M(r.left,n.left),n}),ot(t,o[0],i));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}(j(R)?R:R.contextElement||H(t.elements.popper),c,d,o),W=q(t.elements.reference),I=ut({reference:W,element:A,strategy:"absolute",placement:i}),_=rt(Object.assign({},A,I)),U=g===b?_:W,V={top:B.top-U.top+T.top,bottom:U.bottom-B.bottom+T.bottom,left:B.left-U.left+T.left,right:U.right-B.right+T.right},G=t.modifiersData.offset;if(g===b&&G){var J=G[i];Object.keys(V).forEach((function(t){var n=[f,a].indexOf(t)>=0?1:-1,e=[u,a].indexOf(t)>=0?"y":"x";V[t]+=J[e]*n}))}return V}function ft(t,n){void 0===n&&(n={});var e=n.boundary,i=n.rootBoundary,r=n.padding,o=n.flipVariations,u=n.allowedAutoPlacements,a=void 0===u?g:u,f=V(n.placement),s=f?o?y:y.filter((function(t){return V(t)===f})):l,c=s.filter((function(t){return a.indexOf(t)>=0}));0===c.length&&(c=s);var h=c.reduce((function(n,o){return n[o]=at(t,{placement:o,boundary:e,rootBoundary:i,padding:r})[C(o)],n}),{});return Object.keys(h).sort((function(t,n){return h[t]-h[n]}))}const st={name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var r=e.mainAxis,o=void 0===r||r,l=e.altAxis,d=void 0===l||l,p=e.fallbackPlacements,v=e.padding,b=e.boundary,m=e.rootBoundary,y=e.altBoundary,g=e.flipVariations,x=void 0===g||g,w=e.allowedAutoPlacements,O=n.options.placement,j=C(O),k=p||(j!==O&&x?function(t){if(C(t)===c)return[];var n=Q(t);return[Y(t),n,Y(n)]}(O):[Q(O)]),E=[O].concat(k).reduce((function(t,e){return t.concat(C(e)===c?ft(n,{placement:e,boundary:b,rootBoundary:m,padding:v,flipVariations:x,allowedAutoPlacements:w}):e)}),[]),M=n.rects.reference,S=n.rects.popper,T=new Map,A=!0,R=E[0],q=0;q<E.length;q++){var B=E[q],L=C(B),P=V(B)===h,W=[u,a].indexOf(L)>=0,H=W?"width":"height",z=at(n,{placement:B,boundary:b,rootBoundary:m,altBoundary:y,padding:v}),I=W?P?f:s:P?a:u;M[H]>S[H]&&(I=Q(I));var D=Q(I),_=[];if(o&&_.push(z[L]<=0),d&&_.push(z[I]<=0,z[D]<=0),_.every((function(t){return t}))){R=B,A=!1;break}T.set(B,_)}if(A)for(var U=function(t){var n=E.find((function(n){var e=T.get(n);if(e)return e.slice(0,t).every((function(t){return t}))}));if(n)return R=n,"break"},$=x?3:1;$>0&&"break"!==U($);$--);n.placement!==R&&(n.modifiersData[i]._skip=!0,n.placement=R,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ct(t,n,e){return void 0===e&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function lt(t){return[u,f,a,s].some((function(n){return t[n]>=0}))}function ht(t,n,e){void 0===e&&(e=!1);var i,r,o=k(n),u=k(n)&&function(t){var n=t.getBoundingClientRect(),e=T(n.width)/t.offsetWidth||1,i=T(n.height)/t.offsetHeight||1;return 1!==e||1!==i}(n),a=H(n),f=q(t,u,e),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!e)&&(("body"!==w(n)||nt(a))&&(s=(i=n)!==O(i)&&k(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:Z(i)),k(n)?((c=q(n,!0)).x+=n.clientLeft,c.y+=n.clientTop):a&&(c.x=tt(a))),{x:f.left+s.scrollLeft-c.x,y:f.top+s.scrollTop-c.y,width:f.width,height:f.height}}function dt(t){var n=new Map,e=new Set,i=[];function r(t){e.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!e.has(t)){var i=n.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){e.has(t.name)||r(t)})),i}var pt={placement:"bottom",modifiers:[],strategy:"absolute"};function vt(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function bt(t){void 0===t&&(t={});var n=t.defaultModifiers,e=void 0===n?[]:n,i=t.defaultOptions,r=void 0===i?pt:i;return function(t,n,i){void 0===i&&(i=r);var o,u,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},pt,r),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},f=[],s=!1,c={state:a,setOptions:function(i){var o="function"==typeof i?i(a.options):i;l(),a.options=Object.assign({},r,a.options,o),a.scrollParents={reference:j(t)?it(t):t.contextElement?it(t.contextElement):[],popper:it(n)};var u,s,h=function(t){var n=dt(t);return x.reduce((function(t,e){return t.concat(n.filter((function(t){return t.phase===e})))}),[])}((u=[].concat(e,a.options.modifiers),s=u.reduce((function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t}),{}),Object.keys(s).map((function(t){return s[t]}))));return a.orderedModifiers=h.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var n=t.options,e=t.effect;if("function"==typeof e){var i=e({state:a,name:t.name,instance:c,options:void 0===n?{}:n});f.push(i||function(){})}})),c.update()},forceUpdate:function(){if(!s){var t=a.elements,n=t.reference,e=t.popper;if(vt(n,e)){a.rects={reference:ht(n,D(e),"fixed"===a.options.strategy),popper:B(e)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var r=a.orderedModifiers[i],o=r.fn,u=r.options;"function"==typeof o&&(a=o({state:a,options:void 0===u?{}:u,name:r.name,instance:c})||a)}else a.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(t){c.forceUpdate(),t(a)}))},function(){return u||(u=new Promise((function(t){Promise.resolve().then((function(){u=void 0,t(o())}))}))),u}),destroy:function(){l(),s=!0}};if(!vt(t,n))return c;function l(){f.forEach((function(t){return t()})),f=[]}return c.setOptions(i).then((function(t){!s&&i.onFirstUpdate&&i.onFirstUpdate(t)})),c}}var mt=bt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,e=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,u=i.resize,a=void 0===u||u,f=O(n.elements.popper),s=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&s.forEach((function(t){t.addEventListener("scroll",e.update,K)})),a&&f.addEventListener("resize",e.update,K),function(){o&&s.forEach((function(t){t.removeEventListener("scroll",e.update,K)})),a&&f.removeEventListener("resize",e.update,K)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state;n.modifiersData[t.name]=ut({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=t.options,i=e.gpuAcceleration,r=void 0===i||i,o=e.adaptive,u=void 0===o||o,a=e.roundOffsets,f=void 0===a||a,s={placement:C(n.placement),variation:V(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,J(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:u,roundOffsets:f})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,J(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach((function(t){var e=n.styles[t]||{},i=n.attributes[t]||{},r=n.elements[t];k(r)&&w(r)&&(Object.assign(r.style,e),Object.keys(i).forEach((function(t){var n=i[t];!1===n?r.removeAttribute(t):r.setAttribute(t,!0===n?"":n)})))}))},effect:function(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach((function(t){var i=n.elements[t],r=n.attributes[t]||{},o=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:e[t]).reduce((function(t,n){return t[n]="",t}),{});k(i)&&w(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,e=t.name,i=t.options.offset,r=void 0===i?[0,0]:i,o=g.reduce((function(t,e){return t[e]=function(t,n,e){var i=C(t),r=[s,u].indexOf(i)>=0?-1:1,o="function"==typeof e?e(Object.assign({},n,{placement:t})):e,a=o[0],c=o[1];return a=a||0,c=(c||0)*r,[s,f].indexOf(i)>=0?{x:c,y:a}:{x:a,y:c}}(e,n.rects,r),t}),{}),a=o[n.placement],c=a.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=a.x,n.modifiersData.popperOffsets.y+=c),n.modifiersData[e]=o}},st,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name,r=e.mainAxis,o=void 0===r||r,c=e.altAxis,l=void 0!==c&&c,d=e.tether,p=void 0===d||d,v=e.tetherOffset,b=void 0===v?0:v,m=at(n,{boundary:e.boundary,rootBoundary:e.rootBoundary,padding:e.padding,altBoundary:e.altBoundary}),y=C(n.placement),g=V(n.placement),x=!g,w=_(y),O="x"===w?"y":"x",j=n.modifiersData.popperOffsets,k=n.rects.reference,E=n.rects.popper,T="function"==typeof b?b(Object.assign({},n.rects,{placement:n.placement})):b,A="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),R=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,q={x:0,y:0};if(j){if(o){var L,P="y"===w?u:s,W="y"===w?a:f,H="y"===w?"height":"width",z=j[w],I=z+m[P],$=z-m[W],F=p?-E[H]/2:0,G=g===h?k[H]:E[H],J=g===h?-E[H]:-k[H],K=n.elements.arrow,N=p&&K?B(K):{width:0,height:0},Q=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},X=Q[P],Y=Q[W],Z=U(0,k[H],N[H]),tt=x?k[H]/2-F-Z-X-A.mainAxis:G-Z-X-A.mainAxis,nt=x?-k[H]/2+F+Z+Y+A.mainAxis:J+Z+Y+A.mainAxis,et=n.elements.arrow&&D(n.elements.arrow),it=null!=(L=null==R?void 0:R[w])?L:0,rt=z+nt-it,ot=U(p?S(I,z+tt-it-(et?"y"===w?et.clientTop||0:et.clientLeft||0:0)):I,z,p?M($,rt):$);j[w]=ot,q[w]=ot-z}if(l){var ut,ft=j[O],st="y"===O?"height":"width",ct=ft+m["x"===w?u:s],lt=ft-m["x"===w?a:f],ht=-1!==[u,s].indexOf(y),dt=null!=(ut=null==R?void 0:R[O])?ut:0,pt=ht?ct:ft-k[st]-E[st]-dt+A.altAxis,vt=ht?ft+k[st]+E[st]-dt-A.altAxis:lt,bt=p&&ht?function(t,n,e){var i=U(t,n,e);return i>e?e:i}(pt,ft,vt):U(p?pt:ct,ft,p?vt:lt);j[O]=bt,q[O]=bt-ft}n.modifiersData[i]=q}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e=t.state,i=t.name,r=t.options,o=e.elements.arrow,c=e.modifiersData.popperOffsets,h=C(e.placement),d=_(h),p=[s,f].indexOf(h)>=0?"height":"width";if(o&&c){var v=function(t,n){return $("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:F(t,l))}(r.padding,e),b=B(o),m="y"===d?u:s,y="y"===d?a:f,g=e.rects.reference[p]+e.rects.reference[d]-c[d]-e.rects.popper[p],x=c[d]-e.rects.reference[d],w=D(o),O=w?"y"===d?w.clientHeight||0:w.clientWidth||0:0,j=O/2-b[p]/2+(g/2-x/2),k=U(v[m],j,O-b[p]-v[y]);e.modifiersData[i]=((n={})[d]=k,n.centerOffset=k-j,n)}},effect:function(t){var n=t.state,e=t.options.element,i=void 0===e?"[data-popper-arrow]":e;null!=i&&("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&L(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,e=t.name,i=n.rects.reference,r=n.rects.popper,o=n.modifiersData.preventOverflow,u=at(n,{elementContext:"reference"}),a=at(n,{altBoundary:!0}),f=ct(u,i),s=ct(a,r,o),c=lt(f),l=lt(s);n.modifiersData[e]={referenceClippingOffsets:f,popperEscapeOffsets:s,isReferenceHidden:c,hasPopperEscaped:l},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":l})}}]});const yt=class{constructor(e){t(this,e),this.internalTdsShow=n(this,"internalTdsShow",4),this.internalTdsClose=n(this,"internalTdsClose",0),this.uuid=o(),this.setIsShown=function(t){this.isShown="function"==typeof t?t(this.isShown):t,this.isShown?this.internalTdsShow.emit():this.internalTdsClose.emit()}.bind(this),this.onClickTarget=function(t){t.stopPropagation(),this.setIsShown((t=>!t))}.bind(this),this.handleShow=function(t){t.stopPropagation(),this.setIsShown(!0)}.bind(this),this.handleHide=function(t){t.stopPropagation(),this.setIsShown(!1)}.bind(this),this.selector="",this.referenceEl=void 0,this.show=null,this.placement="auto",this.offsetSkidding=0,this.offsetDistance=8,this.modifiers=[],this.trigger="click",this.autoHide=!0,this.renderedShowValue=!1,this.popperInstance=void 0,this.target=void 0,this.isShown=!1}async close(){this.setIsShown(!1)}onAnyClick(t){"click"===this.trigger&&this.isShown&&null===this.show&&!t.composedPath().includes(this.host)&&this.setIsShown(!1)}onTdsShow(t){null===this.show&&t.target.id!==`tds-popover-core-${this.uuid}`&&this.setIsShown(!1)}componentWillLoad(){this.setIsShown(this.show)}onShowChange(t){this.setIsShown(t)}onReferenceElChanged(t,n){t!==n&&this.initialize({referenceEl:t,trigger:this.trigger})}onTriggerChanged(t){this.initialize({referenceEl:this.referenceEl,trigger:t})}initialize({referenceEl:t,trigger:n}){this.cleanUp(),this.target=void 0!==t?t:this.selector?document.querySelector(this.selector):null,this.popperInstance=this.target?mt(this.target,this.host,{strategy:"fixed",placement:this.placement,modifiers:[{name:"offset",options:{offset:[this.offsetSkidding,this.offsetDistance]}},...this.modifiers]}):null,this.popperInstance||console.error("Could not initialize: reference element not found."),"click"===n&&null===this.show&&this.target.addEventListener("click",this.onClickTarget),"hover"!==n&&"hover-popover"!==n||(this.target.addEventListener("focusin",this.handleShow),this.target.addEventListener("focusout",this.handleHide),this.target.addEventListener("mouseenter",this.handleShow),this.target.addEventListener("mouseleave",this.handleHide),"hover-popover"===n&&(this.host.addEventListener("mouseenter",this.handleShow),this.host.addEventListener("mouseleave",this.handleHide)))}cleanUp(){var t,n,e,i,r,o,u,a;null===(t=this.target)||void 0===t||t.removeEventListener("click",this.onClickTarget),null===(n=this.target)||void 0===n||n.removeEventListener("focusin",this.handleShow),null===(e=this.target)||void 0===e||e.removeEventListener("focusout",this.handleHide),null===(i=this.target)||void 0===i||i.removeEventListener("mouseenter",this.handleShow),null===(r=this.target)||void 0===r||r.removeEventListener("mouseleave",this.handleHide),null===(o=this.host)||void 0===o||o.removeEventListener("mouseenter",this.handleShow),null===(u=this.host)||void 0===u||u.removeEventListener("mouseleave",this.handleHide),null===(a=this.popperInstance)||void 0===a||a.destroy()}componentDidLoad(){this.initialize({referenceEl:this.referenceEl,trigger:this.trigger})}componentDidRender(){this.isShown&&!this.renderedShowValue&&this.popperInstance.update(),this.renderedShowValue=this.isShown}disconnectedCallback(){this.cleanUp()}render(){let t={};return this.autoHide&&(t={display:this.isShown?"block":"none"}),e(i,{key:"7829c25ef7722b84b829c59135df59cafd745338",style:t,id:`tds-popover-core-${this.uuid}`},e("slot",{key:"0cf6fceefad0557bce25ac728d36ff177794ef96"}))}get host(){return r(this)}static get watchers(){return{show:["onShowChange"],referenceEl:["onReferenceElChanged"],trigger:["onTriggerChanged"]}}};export{yt as tds_popover_core}
|
|
1
|
+
import{r as t,c as n,h as e,H as i,g as r}from"./p-2049fab2.js";import{g as o}from"./p-11648030.js";var u="top",a="bottom",f="right",s="left",c="auto",l=[u,a,f,s],d="start",h="end",p="clippingParents",v="viewport",b="popper",m="reference",y=l.reduce((function(t,n){return t.concat([n+"-"+d,n+"-"+h])}),[]),g=[].concat(l,[c]).reduce((function(t,n){return t.concat([n,n+"-"+d,n+"-"+h])}),[]),x=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function w(t){return t?(t.nodeName||"").toLowerCase():null}function O(t){if(null==t)return window;if("[object Window]"!==t.toString()){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function j(t){return t instanceof O(t).Element||t instanceof Element}function k(t){return t instanceof O(t).HTMLElement||t instanceof HTMLElement}function E(t){return"undefined"!=typeof ShadowRoot&&(t instanceof O(t).ShadowRoot||t instanceof ShadowRoot)}function C(t){return t.split("-")[0]}var M=Math.max,R=Math.min,S=Math.round;function T(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function A(){return!/^((?!chrome|android).)*safari/i.test(T())}function L(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var i=t.getBoundingClientRect(),r=1,o=1;n&&k(t)&&(r=t.offsetWidth>0&&S(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&S(i.height)/t.offsetHeight||1);var u=(j(t)?O(t):window).visualViewport,a=!A()&&e,f=(i.left+(a&&u?u.offsetLeft:0))/r,s=(i.top+(a&&u?u.offsetTop:0))/o,c=i.width/r,l=i.height/o;return{width:c,height:l,top:s,right:f+c,bottom:s+l,left:f,x:f,y:s}}function q(t){var n=L(t),e=t.offsetWidth,i=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-i)<=1&&(i=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:i}}function B(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&E(e)){var i=n;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function D(t){return O(t).getComputedStyle(t)}function P(t){return["table","td","th"].indexOf(w(t))>=0}function W(t){return((j(t)?t.ownerDocument:t.document)||window.document).documentElement}function H(t){return"html"===w(t)?t:t.assignedSlot||t.parentNode||(E(t)?t.host:null)||W(t)}function z(t){return k(t)&&"fixed"!==D(t).position?t.offsetParent:null}function I(t){for(var n=O(t),e=z(t);e&&P(e)&&"static"===D(e).position;)e=z(e);return e&&("html"===w(e)||"body"===w(e)&&"static"===D(e).position)?n:e||function(t){var n=/firefox/i.test(T());if(/Trident/i.test(T())&&k(t)&&"fixed"===D(t).position)return null;var e=H(t);for(E(e)&&(e=e.host);k(e)&&["html","body"].indexOf(w(e))<0;){var i=D(e);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||n&&"filter"===i.willChange||n&&i.filter&&"none"!==i.filter)return e;e=e.parentNode}return null}(t)||n}function _(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function U(t,n,e){return M(t,R(n,e))}function $(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function F(t,n){return n.reduce((function(n,e){return n[e]=t,n}),{})}function V(t){return t.split("-")[1]}var G={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(t){var n,e=t.popper,i=t.popperRect,r=t.placement,o=t.variation,c=t.offsets,l=t.position,d=t.gpuAcceleration,p=t.adaptive,v=t.roundOffsets,b=t.isFixed,m=c.x,y=void 0===m?0:m,g=c.y,x=void 0===g?0:g,w="function"==typeof v?v({x:y,y:x}):{x:y,y:x};y=w.x,x=w.y;var j=c.hasOwnProperty("x"),k=c.hasOwnProperty("y"),E=s,C=u,M=window;if(p){var R=I(e),T="clientHeight",A="clientWidth";R===O(e)&&"static"!==D(R=W(e)).position&&"absolute"===l&&(T="scrollHeight",A="scrollWidth"),(r===u||(r===s||r===f)&&o===h)&&(C=a,x-=(b&&R===M&&M.visualViewport?M.visualViewport.height:R[T])-i.height,x*=d?1:-1),r!==s&&(r!==u&&r!==a||o!==h)||(E=f,y-=(b&&R===M&&M.visualViewport?M.visualViewport.width:R[A])-i.width,y*=d?1:-1)}var L,q=Object.assign({position:l},p&&G),B=!0===v?function(t,n){var e=t.y,i=n.devicePixelRatio||1;return{x:S(t.x*i)/i||0,y:S(e*i)/i||0}}({x:y,y:x},O(e)):{x:y,y:x};return y=B.x,x=B.y,Object.assign({},q,d?((L={})[C]=k?"0":"",L[E]=j?"0":"",L.transform=(M.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",L):((n={})[C]=k?x+"px":"",n[E]=j?y+"px":"",n.transform="",n))}var K={passive:!0},N={left:"right",right:"left",bottom:"top",top:"bottom"};function Q(t){return t.replace(/left|right|bottom|top/g,(function(t){return N[t]}))}var X={start:"end",end:"start"};function Y(t){return t.replace(/start|end/g,(function(t){return X[t]}))}function Z(t){var n=O(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function tt(t){return L(W(t)).left+Z(t).scrollLeft}function nt(t){var n=D(t);return/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function et(t){return["html","body","#document"].indexOf(w(t))>=0?t.ownerDocument.body:k(t)&&nt(t)?t:et(H(t))}function it(t,n){var e;void 0===n&&(n=[]);var i=et(t),r=i===(null==(e=t.ownerDocument)?void 0:e.body),o=O(i),u=r?[o].concat(o.visualViewport||[],nt(i)?i:[]):i,a=n.concat(u);return r?a:a.concat(it(H(u)))}function rt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ot(t,n,e){return n===v?rt(function(t,n){var e=O(t),i=W(t),r=e.visualViewport,o=i.clientWidth,u=i.clientHeight,a=0,f=0;if(r){o=r.width,u=r.height;var s=A();(s||!s&&"fixed"===n)&&(a=r.offsetLeft,f=r.offsetTop)}return{width:o,height:u,x:a+tt(t),y:f}}(t,e)):j(n)?function(t,n){var e=L(t,!1,"fixed"===n);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(n,e):rt(function(t){var n,e=W(t),i=Z(t),r=null==(n=t.ownerDocument)?void 0:n.body,o=M(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),u=M(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+tt(t),f=-i.scrollTop;return"rtl"===D(r||e).direction&&(a+=M(e.clientWidth,r?r.clientWidth:0)-o),{width:o,height:u,x:a,y:f}}(W(t)))}function ut(t){var n,e=t.reference,i=t.element,r=t.placement,o=r?C(r):null,c=r?V(r):null,l=e.x+e.width/2-i.width/2,p=e.y+e.height/2-i.height/2;switch(o){case u:n={x:l,y:e.y-i.height};break;case a:n={x:l,y:e.y+e.height};break;case f:n={x:e.x+e.width,y:p};break;case s:n={x:e.x-i.width,y:p};break;default:n={x:e.x,y:e.y}}var v=o?_(o):null;if(null!=v){var b="y"===v?"height":"width";switch(c){case d:n[v]=n[v]-(e[b]/2-i[b]/2);break;case h:n[v]=n[v]+(e[b]/2-i[b]/2)}}return n}function at(t,n){void 0===n&&(n={});var e=n.placement,i=void 0===e?t.placement:e,r=n.strategy,o=void 0===r?t.strategy:r,s=n.boundary,c=void 0===s?p:s,d=n.rootBoundary,h=void 0===d?v:d,y=n.elementContext,g=void 0===y?b:y,x=n.altBoundary,O=void 0!==x&&x,E=n.padding,C=void 0===E?0:E,S=$("number"!=typeof C?C:F(C,l)),T=t.rects.popper,A=t.elements[O?g===b?m:b:g],q=function(t,n,e,i){var r="clippingParents"===n?function(t){var n=it(H(t)),e=["absolute","fixed"].indexOf(D(t).position)>=0&&k(t)?I(t):t;return j(e)?n.filter((function(t){return j(t)&&B(t,e)&&"body"!==w(t)})):[]}(t):[].concat(n),o=[].concat(r,[e]),u=o.reduce((function(n,e){var r=ot(t,e,i);return n.top=M(r.top,n.top),n.right=R(r.right,n.right),n.bottom=R(r.bottom,n.bottom),n.left=M(r.left,n.left),n}),ot(t,o[0],i));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}(j(A)?A:A.contextElement||W(t.elements.popper),c,h,o),P=L(t.elements.reference),z=ut({reference:P,element:T,strategy:"absolute",placement:i}),_=rt(Object.assign({},T,z)),U=g===b?_:P,V={top:q.top-U.top+S.top,bottom:U.bottom-q.bottom+S.bottom,left:q.left-U.left+S.left,right:U.right-q.right+S.right},G=t.modifiersData.offset;if(g===b&&G){var J=G[i];Object.keys(V).forEach((function(t){var n=[f,a].indexOf(t)>=0?1:-1,e=[u,a].indexOf(t)>=0?"y":"x";V[t]+=J[e]*n}))}return V}function ft(t,n){void 0===n&&(n={});var e=n.boundary,i=n.rootBoundary,r=n.padding,o=n.flipVariations,u=n.allowedAutoPlacements,a=void 0===u?g:u,f=V(n.placement),s=f?o?y:y.filter((function(t){return V(t)===f})):l,c=s.filter((function(t){return a.indexOf(t)>=0}));0===c.length&&(c=s);var d=c.reduce((function(n,o){return n[o]=at(t,{placement:o,boundary:e,rootBoundary:i,padding:r})[C(o)],n}),{});return Object.keys(d).sort((function(t,n){return d[t]-d[n]}))}const st={name:"flip",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name;if(!n.modifiersData[i]._skip){for(var r=e.mainAxis,o=void 0===r||r,l=e.altAxis,h=void 0===l||l,p=e.fallbackPlacements,v=e.padding,b=e.boundary,m=e.rootBoundary,y=e.altBoundary,g=e.flipVariations,x=void 0===g||g,w=e.allowedAutoPlacements,O=n.options.placement,j=C(O),k=p||(j!==O&&x?function(t){if(C(t)===c)return[];var n=Q(t);return[Y(t),n,Y(n)]}(O):[Q(O)]),E=[O].concat(k).reduce((function(t,e){return t.concat(C(e)===c?ft(n,{placement:e,boundary:b,rootBoundary:m,padding:v,flipVariations:x,allowedAutoPlacements:w}):e)}),[]),M=n.rects.reference,R=n.rects.popper,S=new Map,T=!0,A=E[0],L=0;L<E.length;L++){var q=E[L],B=C(q),D=V(q)===d,P=[u,a].indexOf(B)>=0,W=P?"width":"height",H=at(n,{placement:q,boundary:b,rootBoundary:m,altBoundary:y,padding:v}),z=P?D?f:s:D?a:u;M[W]>R[W]&&(z=Q(z));var I=Q(z),_=[];if(o&&_.push(H[B]<=0),h&&_.push(H[z]<=0,H[I]<=0),_.every((function(t){return t}))){A=q,T=!1;break}S.set(q,_)}if(T)for(var U=function(t){var n=E.find((function(n){var e=S.get(n);if(e)return e.slice(0,t).every((function(t){return t}))}));if(n)return A=n,"break"},$=x?3:1;$>0&&"break"!==U($);$--);n.placement!==A&&(n.modifiersData[i]._skip=!0,n.placement=A,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ct(t,n,e){return void 0===e&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function lt(t){return[u,f,a,s].some((function(n){return t[n]>=0}))}function dt(t,n,e){void 0===e&&(e=!1);var i,r,o=k(n),u=k(n)&&function(t){var n=t.getBoundingClientRect(),e=S(n.width)/t.offsetWidth||1,i=S(n.height)/t.offsetHeight||1;return 1!==e||1!==i}(n),a=W(n),f=L(t,u,e),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!e)&&(("body"!==w(n)||nt(a))&&(s=(i=n)!==O(i)&&k(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:Z(i)),k(n)?((c=L(n,!0)).x+=n.clientLeft,c.y+=n.clientTop):a&&(c.x=tt(a))),{x:f.left+s.scrollLeft-c.x,y:f.top+s.scrollTop-c.y,width:f.width,height:f.height}}function ht(t){var n=new Map,e=new Set,i=[];function r(t){e.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!e.has(t)){var i=n.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){n.set(t.name,t)})),t.forEach((function(t){e.has(t.name)||r(t)})),i}var pt={placement:"bottom",modifiers:[],strategy:"absolute"};function vt(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function bt(t){void 0===t&&(t={});var n=t.defaultModifiers,e=void 0===n?[]:n,i=t.defaultOptions,r=void 0===i?pt:i;return function(t,n,i){void 0===i&&(i=r);var o,u,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},pt,r),modifiersData:{},elements:{reference:t,popper:n},attributes:{},styles:{}},f=[],s=!1,c={state:a,setOptions:function(i){var o="function"==typeof i?i(a.options):i;l(),a.options=Object.assign({},r,a.options,o),a.scrollParents={reference:j(t)?it(t):t.contextElement?it(t.contextElement):[],popper:it(n)};var u,s,d=function(t){var n=ht(t);return x.reduce((function(t,e){return t.concat(n.filter((function(t){return t.phase===e})))}),[])}((u=[].concat(e,a.options.modifiers),s=u.reduce((function(t,n){var e=t[n.name];return t[n.name]=e?Object.assign({},e,n,{options:Object.assign({},e.options,n.options),data:Object.assign({},e.data,n.data)}):n,t}),{}),Object.keys(s).map((function(t){return s[t]}))));return a.orderedModifiers=d.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var n=t.options,e=t.effect;if("function"==typeof e){var i=e({state:a,name:t.name,instance:c,options:void 0===n?{}:n});f.push(i||function(){})}})),c.update()},forceUpdate:function(){if(!s){var t=a.elements,n=t.reference,e=t.popper;if(vt(n,e)){a.rects={reference:dt(n,I(e),"fixed"===a.options.strategy),popper:q(e)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var r=a.orderedModifiers[i],o=r.fn,u=r.options;"function"==typeof o&&(a=o({state:a,options:void 0===u?{}:u,name:r.name,instance:c})||a)}else a.reset=!1,i=-1}}},update:(o=function(){return new Promise((function(t){c.forceUpdate(),t(a)}))},function(){return u||(u=new Promise((function(t){Promise.resolve().then((function(){u=void 0,t(o())}))}))),u}),destroy:function(){l(),s=!0}};if(!vt(t,n))return c;function l(){f.forEach((function(t){return t()})),f=[]}return c.setOptions(i).then((function(t){!s&&i.onFirstUpdate&&i.onFirstUpdate(t)})),c}}var mt=bt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,e=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,u=i.resize,a=void 0===u||u,f=O(n.elements.popper),s=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&s.forEach((function(t){t.addEventListener("scroll",e.update,K)})),a&&f.addEventListener("resize",e.update,K),function(){o&&s.forEach((function(t){t.removeEventListener("scroll",e.update,K)})),a&&f.removeEventListener("resize",e.update,K)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var n=t.state;n.modifiersData[t.name]=ut({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,e=t.options,i=e.gpuAcceleration,r=void 0===i||i,o=e.adaptive,u=void 0===o||o,a=e.roundOffsets,f=void 0===a||a,s={placement:C(n.placement),variation:V(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:"fixed"===n.options.strategy};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,J(Object.assign({},s,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:u,roundOffsets:f})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,J(Object.assign({},s,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var n=t.state;Object.keys(n.elements).forEach((function(t){var e=n.styles[t]||{},i=n.attributes[t]||{},r=n.elements[t];k(r)&&w(r)&&(Object.assign(r.style,e),Object.keys(i).forEach((function(t){var n=i[t];!1===n?r.removeAttribute(t):r.setAttribute(t,!0===n?"":n)})))}))},effect:function(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach((function(t){var i=n.elements[t],r=n.attributes[t]||{},o=Object.keys(n.styles.hasOwnProperty(t)?n.styles[t]:e[t]).reduce((function(t,n){return t[n]="",t}),{});k(i)&&w(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var n=t.state,e=t.name,i=t.options.offset,r=void 0===i?[0,0]:i,o=g.reduce((function(t,e){return t[e]=function(t,n,e){var i=C(t),r=[s,u].indexOf(i)>=0?-1:1,o="function"==typeof e?e(Object.assign({},n,{placement:t})):e,a=o[0],c=o[1];return a=a||0,c=(c||0)*r,[s,f].indexOf(i)>=0?{x:c,y:a}:{x:a,y:c}}(e,n.rects,r),t}),{}),a=o[n.placement],c=a.y;null!=n.modifiersData.popperOffsets&&(n.modifiersData.popperOffsets.x+=a.x,n.modifiersData.popperOffsets.y+=c),n.modifiersData[e]=o}},st,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var n=t.state,e=t.options,i=t.name,r=e.mainAxis,o=void 0===r||r,c=e.altAxis,l=void 0!==c&&c,h=e.tether,p=void 0===h||h,v=e.tetherOffset,b=void 0===v?0:v,m=at(n,{boundary:e.boundary,rootBoundary:e.rootBoundary,padding:e.padding,altBoundary:e.altBoundary}),y=C(n.placement),g=V(n.placement),x=!g,w=_(y),O="x"===w?"y":"x",j=n.modifiersData.popperOffsets,k=n.rects.reference,E=n.rects.popper,S="function"==typeof b?b(Object.assign({},n.rects,{placement:n.placement})):b,T="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),A=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,L={x:0,y:0};if(j){if(o){var B,D="y"===w?u:s,P="y"===w?a:f,W="y"===w?"height":"width",H=j[w],z=H+m[D],$=H-m[P],F=p?-E[W]/2:0,G=g===d?k[W]:E[W],J=g===d?-E[W]:-k[W],K=n.elements.arrow,N=p&&K?q(K):{width:0,height:0},Q=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},X=Q[D],Y=Q[P],Z=U(0,k[W],N[W]),tt=x?k[W]/2-F-Z-X-T.mainAxis:G-Z-X-T.mainAxis,nt=x?-k[W]/2+F+Z+Y+T.mainAxis:J+Z+Y+T.mainAxis,et=n.elements.arrow&&I(n.elements.arrow),it=null!=(B=null==A?void 0:A[w])?B:0,rt=H+nt-it,ot=U(p?R(z,H+tt-it-(et?"y"===w?et.clientTop||0:et.clientLeft||0:0)):z,H,p?M($,rt):$);j[w]=ot,L[w]=ot-H}if(l){var ut,ft=j[O],st="y"===O?"height":"width",ct=ft+m["x"===w?u:s],lt=ft-m["x"===w?a:f],dt=-1!==[u,s].indexOf(y),ht=null!=(ut=null==A?void 0:A[O])?ut:0,pt=dt?ct:ft-k[st]-E[st]-ht+T.altAxis,vt=dt?ft+k[st]+E[st]-ht-T.altAxis:lt,bt=p&&dt?function(t,n,e){var i=U(t,n,e);return i>e?e:i}(pt,ft,vt):U(p?pt:ct,ft,p?vt:lt);j[O]=bt,L[O]=bt-ft}n.modifiersData[i]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var n,e=t.state,i=t.name,r=t.options,o=e.elements.arrow,c=e.modifiersData.popperOffsets,d=C(e.placement),h=_(d),p=[s,f].indexOf(d)>=0?"height":"width";if(o&&c){var v=function(t,n){return $("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:F(t,l))}(r.padding,e),b=q(o),m="y"===h?u:s,y="y"===h?a:f,g=e.rects.reference[p]+e.rects.reference[h]-c[h]-e.rects.popper[p],x=c[h]-e.rects.reference[h],w=I(o),O=w?"y"===h?w.clientHeight||0:w.clientWidth||0:0,j=O/2-b[p]/2+(g/2-x/2),k=U(v[m],j,O-b[p]-v[y]);e.modifiersData[i]=((n={})[h]=k,n.centerOffset=k-j,n)}},effect:function(t){var n=t.state,e=t.options.element,i=void 0===e?"[data-popper-arrow]":e;null!=i&&("string"!=typeof i||(i=n.elements.popper.querySelector(i)))&&B(n.elements.popper,i)&&(n.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var n=t.state,e=t.name,i=n.rects.reference,r=n.rects.popper,o=n.modifiersData.preventOverflow,u=at(n,{elementContext:"reference"}),a=at(n,{altBoundary:!0}),f=ct(u,i),s=ct(a,r,o),c=lt(f),l=lt(s);n.modifiersData[e]={referenceClippingOffsets:f,popperEscapeOffsets:s,isReferenceHidden:c,hasPopperEscaped:l},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":l})}}]});const yt=class{constructor(e){t(this,e),this.internalTdsShow=n(this,"internalTdsShow",4),this.internalTdsClose=n(this,"internalTdsClose",0),this.uuid=o(),this.setIsShown=function(t){this.isShown="function"==typeof t?t(this.isShown):t,this.isShown?this.internalTdsShow.emit():this.internalTdsClose.emit()}.bind(this),this.onClickTarget=function(t){t.stopPropagation(),this.setIsShown((t=>!t))}.bind(this),this.handleShow=function(t){t.stopPropagation(),this.setIsShown(!0)}.bind(this),this.handleHide=function(t){t.stopPropagation(),this.setIsShown(!1)}.bind(this),this.selector="",this.referenceEl=void 0,this.show=null,this.placement="auto",this.offsetSkidding=0,this.offsetDistance=8,this.modifiers=[],this.trigger="click",this.autoHide=!0,this.renderedShowValue=!1,this.popperInstance=void 0,this.target=void 0,this.isShown=!1}async close(){this.setIsShown(!1)}onAnyClick(t){"click"===this.trigger&&this.isShown&&null===this.show&&!t.composedPath().includes(this.host)&&this.setIsShown(!1)}onTdsShow(t){null===this.show&&t.target.id!==`tds-popover-core-${this.uuid}`&&this.setIsShown(!1)}componentWillLoad(){this.setIsShown(this.show)}onShowChange(t){this.setIsShown(t)}onReferenceElChanged(t,n){t!==n&&this.initialize({referenceEl:t,trigger:this.trigger})}onTriggerChanged(t){this.initialize({referenceEl:this.referenceEl,trigger:t})}initialize({referenceEl:t,trigger:n}){this.cleanUp(),this.target=void 0!==t?t:this.selector?document.querySelector(this.selector):null,this.popperInstance=this.target?mt(this.target,this.host,{strategy:"fixed",placement:this.placement,modifiers:[{name:"offset",options:{offset:[this.offsetSkidding,this.offsetDistance]}},...this.modifiers]}):null,this.popperInstance||console.error("Could not initialize: reference element not found."),"click"===n&&null===this.show&&this.target.addEventListener("click",this.onClickTarget),"hover"!==n&&"hover-popover"!==n||(this.target.addEventListener("focusin",this.handleShow),this.target.addEventListener("focusout",this.handleHide),this.target.addEventListener("mouseenter",this.handleShow),this.target.addEventListener("mouseleave",this.handleHide),"hover-popover"===n&&(this.host.addEventListener("mouseenter",this.handleShow),this.host.addEventListener("mouseleave",this.handleHide)))}cleanUp(){var t,n,e,i,r,o,u,a;null===(t=this.target)||void 0===t||t.removeEventListener("click",this.onClickTarget),null===(n=this.target)||void 0===n||n.removeEventListener("focusin",this.handleShow),null===(e=this.target)||void 0===e||e.removeEventListener("focusout",this.handleHide),null===(i=this.target)||void 0===i||i.removeEventListener("mouseenter",this.handleShow),null===(r=this.target)||void 0===r||r.removeEventListener("mouseleave",this.handleHide),null===(o=this.host)||void 0===o||o.removeEventListener("mouseenter",this.handleShow),null===(u=this.host)||void 0===u||u.removeEventListener("mouseleave",this.handleHide),null===(a=this.popperInstance)||void 0===a||a.destroy()}componentDidLoad(){console.log("componentDidLoad entry:",this.referenceEl,this.trigger),this.initialize({referenceEl:this.referenceEl,trigger:this.trigger}),console.log("componentDidLoad exit:",this.referenceEl,this.trigger)}componentDidRender(){console.log("componentDidRender entry:",this.popperInstance),this.isShown&&!this.renderedShowValue&&this.popperInstance.update(),this.renderedShowValue=this.isShown,console.log("componentDidRender exit:",this.popperInstance)}disconnectedCallback(){console.log("disconnectedCallback entry:"),this.cleanUp(),console.log("disconnectedCallback exit:")}render(){let t={};return this.autoHide&&(t={display:this.isShown?"block":"none"}),e(i,{key:"fef33c0bd6d71ee90f4a2463476f083af57fc2dc",style:t,id:`tds-popover-core-${this.uuid}`},e("slot",{key:"6e6543526773f82f00441ab70306939588b3c85e"}))}get host(){return r(this)}static get watchers(){return{show:["onShowChange"],referenceEl:["onReferenceElChanged"],trigger:["onTriggerChanged"]}}};export{yt as tds_popover_core}
|