@3t-transform/threeteeui 0.2.103 → 0.2.104

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.
@@ -109,7 +109,7 @@ const TttxMultiselectBox = class {
109
109
  if (this.searchEnabled)
110
110
  dropdownMenuMaxHeight += 52;
111
111
  if (bottomPosY + dropdownMenuMaxHeight > window.innerHeight) {
112
- this.bodyOffset = { top: `${window.innerHeight - (dropdownMenuMaxHeight + 16)}px`, position: 'fixed', width: `${dropdownSelector.offsetWidth}px` };
112
+ this.bodyOffset = { top: `${window.innerHeight - (dropdownMenuMaxHeight + 16)}px`, position: 'fixed', width: `${dropdownSelector.offsetWidth}px`, zIndex: '10' };
113
113
  }
114
114
  else {
115
115
  this.bodyOffset = { position: 'fixed', left: clientRectangle.left, top: clientRectangle.top, width: (clientRectangle.width - 2) + 'px', zIndex: '10' };
@@ -99,7 +99,7 @@ export class TttxMultiselectBox {
99
99
  if (this.searchEnabled)
100
100
  dropdownMenuMaxHeight += 52;
101
101
  if (bottomPosY + dropdownMenuMaxHeight > window.innerHeight) {
102
- this.bodyOffset = { top: `${window.innerHeight - (dropdownMenuMaxHeight + 16)}px`, position: 'fixed', width: `${dropdownSelector.offsetWidth}px` };
102
+ this.bodyOffset = { top: `${window.innerHeight - (dropdownMenuMaxHeight + 16)}px`, position: 'fixed', width: `${dropdownSelector.offsetWidth}px`, zIndex: '10' };
103
103
  }
104
104
  else {
105
105
  this.bodyOffset = { position: 'fixed', left: clientRectangle.left, top: clientRectangle.top, width: (clientRectangle.width - 2) + 'px', zIndex: '10' };
@@ -109,7 +109,7 @@ const TttxMultiselectBox$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
109
109
  if (this.searchEnabled)
110
110
  dropdownMenuMaxHeight += 52;
111
111
  if (bottomPosY + dropdownMenuMaxHeight > window.innerHeight) {
112
- this.bodyOffset = { top: `${window.innerHeight - (dropdownMenuMaxHeight + 16)}px`, position: 'fixed', width: `${dropdownSelector.offsetWidth}px` };
112
+ this.bodyOffset = { top: `${window.innerHeight - (dropdownMenuMaxHeight + 16)}px`, position: 'fixed', width: `${dropdownSelector.offsetWidth}px`, zIndex: '10' };
113
113
  }
114
114
  else {
115
115
  this.bodyOffset = { position: 'fixed', left: clientRectangle.left, top: clientRectangle.top, width: (clientRectangle.width - 2) + 'px', zIndex: '10' };
@@ -105,7 +105,7 @@ const TttxMultiselectBox = class {
105
105
  if (this.searchEnabled)
106
106
  dropdownMenuMaxHeight += 52;
107
107
  if (bottomPosY + dropdownMenuMaxHeight > window.innerHeight) {
108
- this.bodyOffset = { top: `${window.innerHeight - (dropdownMenuMaxHeight + 16)}px`, position: 'fixed', width: `${dropdownSelector.offsetWidth}px` };
108
+ this.bodyOffset = { top: `${window.innerHeight - (dropdownMenuMaxHeight + 16)}px`, position: 'fixed', width: `${dropdownSelector.offsetWidth}px`, zIndex: '10' };
109
109
  }
110
110
  else {
111
111
  this.bodyOffset = { position: 'fixed', left: clientRectangle.left, top: clientRectangle.top, width: (clientRectangle.width - 2) + 'px', zIndex: '10' };
@@ -0,0 +1 @@
1
+ import{r as t,c as o,h as i,H as e,g as s}from"./p-65bb4035.js";import{p as n,d}from"./p-88ee2406.js";import"./p-112455b1.js";const r=class{constructor(i){t(this,i),this.selectItemEvent=o(this,"selectItemEvent",7),this.toggleOpen=o(this,"toggleOpen",7),this.changesApplied=o(this,"changesApplied",7),this.bodyOffset={},this.optionsData=null,this.label=void 0,this.inline=void 0,this.placeholder="",this.searchEnabled=void 0,this.htmlVisibleValue=void 0,this.visibleValue=void 0,this.open=!1,this.unsavedSelectedItems=void 0,this.searchTerm=""}handleCloseSelectBox(){this.open=!1}handleBlur(){this.open=!1,this.toggleOpen.emit(!1)}handleOptionsDataChange(){this.unsavedSelectedItems="string"==typeof this.optionsData?JSON.parse(this.optionsData):this.optionsData}safelyCloneArray(t){return JSON.parse(JSON.stringify(t))}onDropdownClicked(){this.open=!this.open,this.searchTerm="",this.calculateDropdownMenuOffset(),this.toggleOpen.emit(this.open)}onCancel(){this.open=!1,this.unsavedSelectedItems=this.safelyCloneArray(this._optionsData),this.toggleOpen.emit(!1)}applyChanges(){this.open=!1,this.changesApplied.emit(this.safelyCloneArray(this.unsavedSelectedItems))}onItemSelected(t){const o=this.unsavedSelectedItems.findIndex((o=>o.value===t.value));this.unsavedSelectedItems[o]=Object.assign(Object.assign({},t),{selected:!t.selected}),this.unsavedSelectedItems=[...this.unsavedSelectedItems],this.selectItemEvent.emit(t)}dropdownSelectorContent(){if(!this._optionsData.find((t=>t.selected)))return i("div",{class:"placeholder"},this.placeholder);if(this.htmlVisibleValue){const t=n.sanitize(this.visibleValue,d);return i("div",{class:"dropdown-selector-html-content",innerHTML:t})}return i("div",null,this.visibleValue)}optionFoundInSearchTerm(t){return-1===t.label.toLowerCase().indexOf(this.searchTerm.toLowerCase())}dropdownOption(t){const o=this.searchEnabled&&this.optionFoundInSearchTerm(t),e=t.selected?"check_box":"check_box_outline_blank",s=t.selected?"blue":"grey";if(t.html){const r=n.sanitize(t.html,d);return i("div",{class:`dropdown-option ${o?"hidden":""} ${t.selected?"selected":""}`,onClick:this.onItemSelected.bind(this,t),key:t.label},i("tttx-icon",{icon:e,color:s,class:"checkbox-icon"}),i("div",{innerHTML:r}))}return i("div",{class:`dropdown-option ${o?"hidden":""} ${t.selected?"selected":""}`,onClick:this.onItemSelected.bind(this,t),key:t.label},i("tttx-icon",{icon:e,color:s,class:"checkbox-icon"}),i("div",{class:"plaintext-option"},t.label))}handleSearchInput(t){this.searchTerm=t.target.value}calculateDropdownMenuOffset(){const t=this.el.shadowRoot.querySelector(".dropdown-selector"),o=t.getBoundingClientRect().bottom,i=t.getBoundingClientRect();let e=Math.min(288,36*this._optionsData.length)+45+8;this.searchEnabled&&(e+=52),this.bodyOffset=o+e>window.innerHeight?{top:window.innerHeight-(e+16)+"px",position:"fixed",width:`${t.offsetWidth}px`,zIndex:"10"}:{position:"fixed",left:i.left,top:i.top,width:i.width-2+"px",zIndex:"10"}}render(){if(!this.optionsData)return;this._optionsData="string"==typeof this.optionsData?JSON.parse(this.optionsData):this.optionsData,this.unsavedSelectedItems||(this.unsavedSelectedItems=this.safelyCloneArray(this._optionsData));const t=this.open?"expand_less":"expand_more";return console.log(this.bodyOffset),i(e,{class:this.inline?"inline":"block"},this.label&&i("div",{class:"label"},this.label),i("div",{tabindex:"0",class:"dropdown-container"},i("div",{class:"dropdown-selector",onClick:this.onDropdownClicked.bind(this)},this.dropdownSelectorContent(),i("div",{class:"dropdown-selector-chevron"},i("tttx-icon",{icon:t,color:"black"}))),this.open&&i("div",{class:"dropdown-body-container"},i("div",{class:"dropdown-body",style:Object.assign({},this.bodyOffset)},this.searchEnabled&&i("div",{class:"searchbox"},i("tttx-standalone-input",{type:"text",placeholder:"Search",label:"",required:!0,showerrorbubble:!1,iconleft:"search",onInput:this.handleSearchInput.bind(this),inline:!0})),i("div",{class:"dropdown-options-list"},this.unsavedSelectedItems.map((t=>this.dropdownOption(t)))),i("div",{class:"footer"},i("tttx-button",{design:"primary",onClick:this.applyChanges.bind(this)},"Apply"),i("tttx-button",{onClick:this.onCancel.bind(this)},"Cancel"))))))}get el(){return s(this)}static get watchers(){return{optionsData:["handleOptionsDataChange"]}}};r.style='.material-symbols-rounded{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24}:host{display:flex;gap:4px}.label{font-size:16px;font-style:normal;font-weight:500;line-height:normal}:host(.inline) .label{padding-top:8px}:host(.block){flex-direction:column}.dropdown-container{position:relative;display:flex;flex-direction:column;width:100%}.dropdown-container:focus-visible{outline:none}.dropdown-container:focus .dropdown-selector{border:1px solid #1479c6}.dropdown-selector,.dropdown-body{display:flex;border-radius:4px;background-color:white}.dropdown-selector{align-items:center;gap:8px;padding:6px 8px 6px 16px;cursor:pointer;border:1px solid #d5d5d5}.dropdown-selector-chevron{margin-left:auto;height:24px;align-self:flex-start}.dropdown-selector-chevron>tttx-icon{cursor:pointer}.dropdown-selector-html-content{display:flex;gap:8px;flex-wrap:wrap}.dropdown-body-container{position:relative}.dropdown-body{position:absolute;display:flex;flex-direction:column;box-shadow:0px 1px 5px #1111114D;padding-bottom:8px;border:1px solid #d5d5d5;width:100%}.dropdown-options-list{display:flex;flex-direction:column;overflow-y:auto;scrollbar-gutter:stable;max-height:288px}.dropdown-option{padding:6px 8px 6px 16px;cursor:pointer;display:flex;gap:8px}.dropdown-option .checkbox-icon{height:24px}.dropdown-option .plaintext-option{line-height:24px}.dropdown-option:hover{background-color:#1111110d}.dropdown-option:active,.dropdown-option.selected{background-color:#ebfbfc}.placeholder{color:#9e9e9e}.searchbox{padding:8px 16px 8px 16px;height:52px;box-sizing:border-box}.searchbox tttx-standalone-input{margin-top:-4px}.hidden{display:none}.footer{display:flex;gap:8px;flex-direction:row-reverse;padding:8px 16px 0 16px;border-top:1px solid #d5d5d5}';export{r as tttx_multiselect_box}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-65bb4035.js";export{s as setNonce}from"./p-65bb4035.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-7f1452fb",[[1,"tttx-data-pattern",{data:[1],sorteroptions:[1],filteroptions:[1],filterheader:[1]}]]],["p-2576076f",[[1,"tttx-multiselect-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],htmlVisibleValue:[4,"html-visible-value"],visibleValue:[1,"visible-value"],open:[32],unsavedSelectedItems:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-ba7a789c",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],allowOverflow:[4,"allow-overflow"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-aa7f5822",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],selectedValue:[1,"selected-value"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-888fb9ee",[[1,"tttx-tree-view",{data:[1040],firstSelected:[1028,"first-selected"],treeData:[32],selectedId:[32]}]]],["p-61ef7773",[[0,"tttx-checkbox",{checkboxId:[1,"checkbox-id"],label:[1],inline:[4],indeterminate:[4],checked:[4]}]]],["p-bb560af6",[[1,"tttx-dialog",{header:[1],type:[1],size:[1],open:[4],allowOverflow:[4,"allow-overflow"],closeEnabled:[4,"close-enabled"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-87b6e5a9",[[1,"tttx-expander",{name:[1],open:[4],lefticon:[1],lefticoncolor:[1],isExpanded:[32]}]]],["p-a19ad838",[[2,"tttx-tabs",{tabsName:[1,"tabs-name"],navigation:[4],wide:[4],tabs:[1],_tabs:[32]},[[0,"keydown","handleKeyDown"]]]]],["p-67f24d17",[[1,"tttx-checkbox-group"]]],["p-a64c9910",[[4,"tttx-checkbox-group-caption"]]],["p-80e3bd36",[[4,"tttx-checkbox-group-heading"]]],["p-b2cfa283",[[1,"tttx-form",{formschema:[1025],data:[1032],submit:[64]}]]],["p-15b7a577",[[1,"tttx-keyvalue-block",{keyvalues:[1],horizontal:[4],spacedout:[4],_elements:[32]}]]],["p-fe6c321b",[[1,"tttx-loading-spinner",{loadingMessage:[1028,"loading-message"],size:[1025]}]]],["p-be16cf2d",[[2,"tttx-percentage-bar",{percentage:[8],thresholds:[1],color:[1],min:[1],labelid:[1],_percentage:[32],_ranges:[32],_min:[32]}]]],["p-69642b71",[[1,"tttx-qrcode",{link:[1025],size:[1026]}]]],["p-e7b7d2e2",[[1,"tttx-tag",{text:[1],color:[1],textColor:[1,"text-color"]}]]],["p-34f328f9",[[2,"tttx-textarea",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],rows:[2],textareaautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],disabled:[4],maxlength:[8],name:[1],placeholder:[1],readonly:[8],required:[4],value:[1032]}]]],["p-bcf3844e",[[1,"tttx-icon",{icon:[1],color:[1]}]]],["p-6e0fac85",[[2,"tttx-standalone-input",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],iconleft:[1],iconleftcolor:[1],iconright:[1],iconrightcolor:[1],inputicon:[1],inputiconcolor:[1],inline:[4],inputautocapitalize:[1],inputautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],autocomplete:[1],checked:[4],disabled:[4],max:[8],maxlength:[8],min:[8],minlength:[8],name:[1],pattern:[1],placeholder:[1],readonly:[8],required:[4],step:[8],type:[1],value:[1032]}]]],["p-f27adb48",[[1,"tttx-filter",{filterKey:[1,"filter-key"],filterOptions:[1,"filter-options"],showSelectAll:[4,"show-select-all"],showSearchField:[4,"show-search-field"],showOptionIcons:[4,"show-option-icons"],filterButtonStyle:[1,"filter-button-style"],filterHeader:[1,"filter-header"],defaultFilterOptions:[1,"default-filter-options"],popoverWidth:[1,"popover-width"],showPopover:[32],displayedFilterSettings:[32],selectedFilters:[32],filterSearchTerm:[32],allSelected:[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{data:[1025],name:[1],_data:[32]}],[1,"tttx-sorter",{sorterKey:[1,"sorter-key"],defaultSortDirection:[1,"default-sort-direction"],fieldOptionsData:[1,"field-options-data"],defaultOption:[1,"default-option"],selectedField:[32],sortDirection:[32],dropdownExpand:[32],dropdownOptions:[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{border:[4],viewSize:[32]},[[9,"resize","handleResize"]]]]],["p-61741832",[[1,"tttx-button",{notext:[4],icon:[1],iconposition:[1],iconcolor:[1025],design:[1]}]]]],e)));
1
+ import{p as e,b as t}from"./p-65bb4035.js";export{s as setNonce}from"./p-65bb4035.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-7f1452fb",[[1,"tttx-data-pattern",{data:[1],sorteroptions:[1],filteroptions:[1],filterheader:[1]}]]],["p-c9016320",[[1,"tttx-multiselect-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],htmlVisibleValue:[4,"html-visible-value"],visibleValue:[1,"visible-value"],open:[32],unsavedSelectedItems:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-ba7a789c",[[1,"tttx-dialog-box",{data:[1025],size:[1],open:[1028],allowOverflow:[4,"allow-overflow"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-aa7f5822",[[1,"tttx-select-box",{optionsData:[1,"options-data"],label:[1],inline:[4],placeholder:[1],searchEnabled:[4,"search-enabled"],selectedValue:[1,"selected-value"],open:[32],selectedItem:[32],searchTerm:[32]},[[0,"closeSelectBox","handleCloseSelectBox"],[0,"blur","handleBlur"]]]]],["p-888fb9ee",[[1,"tttx-tree-view",{data:[1040],firstSelected:[1028,"first-selected"],treeData:[32],selectedId:[32]}]]],["p-61ef7773",[[0,"tttx-checkbox",{checkboxId:[1,"checkbox-id"],label:[1],inline:[4],indeterminate:[4],checked:[4]}]]],["p-bb560af6",[[1,"tttx-dialog",{header:[1],type:[1],size:[1],open:[4],allowOverflow:[4,"allow-overflow"],closeEnabled:[4,"close-enabled"],elementSize:[32]},[[9,"resize","handleResize"]]]]],["p-87b6e5a9",[[1,"tttx-expander",{name:[1],open:[4],lefticon:[1],lefticoncolor:[1],isExpanded:[32]}]]],["p-a19ad838",[[2,"tttx-tabs",{tabsName:[1,"tabs-name"],navigation:[4],wide:[4],tabs:[1],_tabs:[32]},[[0,"keydown","handleKeyDown"]]]]],["p-67f24d17",[[1,"tttx-checkbox-group"]]],["p-a64c9910",[[4,"tttx-checkbox-group-caption"]]],["p-80e3bd36",[[4,"tttx-checkbox-group-heading"]]],["p-b2cfa283",[[1,"tttx-form",{formschema:[1025],data:[1032],submit:[64]}]]],["p-15b7a577",[[1,"tttx-keyvalue-block",{keyvalues:[1],horizontal:[4],spacedout:[4],_elements:[32]}]]],["p-fe6c321b",[[1,"tttx-loading-spinner",{loadingMessage:[1028,"loading-message"],size:[1025]}]]],["p-be16cf2d",[[2,"tttx-percentage-bar",{percentage:[8],thresholds:[1],color:[1],min:[1],labelid:[1],_percentage:[32],_ranges:[32],_min:[32]}]]],["p-69642b71",[[1,"tttx-qrcode",{link:[1025],size:[1026]}]]],["p-e7b7d2e2",[[1,"tttx-tag",{text:[1],color:[1],textColor:[1,"text-color"]}]]],["p-34f328f9",[[2,"tttx-textarea",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],rows:[2],textareaautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],disabled:[4],maxlength:[8],name:[1],placeholder:[1],readonly:[8],required:[4],value:[1032]}]]],["p-bcf3844e",[[1,"tttx-icon",{icon:[1],color:[1]}]]],["p-6e0fac85",[[2,"tttx-standalone-input",{label:[1],secondarylabel:[1],showerrormsg:[4],showerrorbubble:[4],errormsg:[1],iconleft:[1],iconleftcolor:[1],iconright:[1],iconrightcolor:[1],inputicon:[1],inputiconcolor:[1],inline:[4],inputautocapitalize:[1],inputautofocus:[4],inputkeyhint:[1],inputindex:[8],inputtitle:[1],autocomplete:[1],checked:[4],disabled:[4],max:[8],maxlength:[8],min:[8],minlength:[8],name:[1],pattern:[1],placeholder:[1],readonly:[8],required:[4],step:[8],type:[1],value:[1032]}]]],["p-f27adb48",[[1,"tttx-filter",{filterKey:[1,"filter-key"],filterOptions:[1,"filter-options"],showSelectAll:[4,"show-select-all"],showSearchField:[4,"show-search-field"],showOptionIcons:[4,"show-option-icons"],filterButtonStyle:[1,"filter-button-style"],filterHeader:[1,"filter-header"],defaultFilterOptions:[1,"default-filter-options"],popoverWidth:[1,"popover-width"],showPopover:[32],displayedFilterSettings:[32],selectedFilters:[32],filterSearchTerm:[32],allSelected:[32]},[[0,"closeFilter","handleCloseFilter"]]],[1,"tttx-list",{data:[1025],name:[1],_data:[32]}],[1,"tttx-sorter",{sorterKey:[1,"sorter-key"],defaultSortDirection:[1,"default-sort-direction"],fieldOptionsData:[1,"field-options-data"],defaultOption:[1,"default-option"],selectedField:[32],sortDirection:[32],dropdownExpand:[32],dropdownOptions:[32]},[[0,"closeSorter","handleCloseSorter"]]],[1,"tttx-toolbar",{border:[4],viewSize:[32]},[[9,"resize","handleResize"]]]]],["p-61741832",[[1,"tttx-button",{notext:[4],icon:[1],iconposition:[1],iconcolor:[1025],design:[1]}]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3t-transform/threeteeui",
3
- "version": "0.2.103",
3
+ "version": "0.2.104",
4
4
  "description": "3t Design System",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as t,c as o,h as i,H as e,g as s}from"./p-65bb4035.js";import{p as n,d}from"./p-88ee2406.js";import"./p-112455b1.js";const r=class{constructor(i){t(this,i),this.selectItemEvent=o(this,"selectItemEvent",7),this.toggleOpen=o(this,"toggleOpen",7),this.changesApplied=o(this,"changesApplied",7),this.bodyOffset={},this.optionsData=null,this.label=void 0,this.inline=void 0,this.placeholder="",this.searchEnabled=void 0,this.htmlVisibleValue=void 0,this.visibleValue=void 0,this.open=!1,this.unsavedSelectedItems=void 0,this.searchTerm=""}handleCloseSelectBox(){this.open=!1}handleBlur(){this.open=!1,this.toggleOpen.emit(!1)}handleOptionsDataChange(){this.unsavedSelectedItems="string"==typeof this.optionsData?JSON.parse(this.optionsData):this.optionsData}safelyCloneArray(t){return JSON.parse(JSON.stringify(t))}onDropdownClicked(){this.open=!this.open,this.searchTerm="",this.calculateDropdownMenuOffset(),this.toggleOpen.emit(this.open)}onCancel(){this.open=!1,this.unsavedSelectedItems=this.safelyCloneArray(this._optionsData),this.toggleOpen.emit(!1)}applyChanges(){this.open=!1,this.changesApplied.emit(this.safelyCloneArray(this.unsavedSelectedItems))}onItemSelected(t){const o=this.unsavedSelectedItems.findIndex((o=>o.value===t.value));this.unsavedSelectedItems[o]=Object.assign(Object.assign({},t),{selected:!t.selected}),this.unsavedSelectedItems=[...this.unsavedSelectedItems],this.selectItemEvent.emit(t)}dropdownSelectorContent(){if(!this._optionsData.find((t=>t.selected)))return i("div",{class:"placeholder"},this.placeholder);if(this.htmlVisibleValue){const t=n.sanitize(this.visibleValue,d);return i("div",{class:"dropdown-selector-html-content",innerHTML:t})}return i("div",null,this.visibleValue)}optionFoundInSearchTerm(t){return-1===t.label.toLowerCase().indexOf(this.searchTerm.toLowerCase())}dropdownOption(t){const o=this.searchEnabled&&this.optionFoundInSearchTerm(t),e=t.selected?"check_box":"check_box_outline_blank",s=t.selected?"blue":"grey";if(t.html){const r=n.sanitize(t.html,d);return i("div",{class:`dropdown-option ${o?"hidden":""} ${t.selected?"selected":""}`,onClick:this.onItemSelected.bind(this,t),key:t.label},i("tttx-icon",{icon:e,color:s,class:"checkbox-icon"}),i("div",{innerHTML:r}))}return i("div",{class:`dropdown-option ${o?"hidden":""} ${t.selected?"selected":""}`,onClick:this.onItemSelected.bind(this,t),key:t.label},i("tttx-icon",{icon:e,color:s,class:"checkbox-icon"}),i("div",{class:"plaintext-option"},t.label))}handleSearchInput(t){this.searchTerm=t.target.value}calculateDropdownMenuOffset(){const t=this.el.shadowRoot.querySelector(".dropdown-selector"),o=t.getBoundingClientRect().bottom,i=t.getBoundingClientRect();let e=Math.min(288,36*this._optionsData.length)+45+8;this.searchEnabled&&(e+=52),this.bodyOffset=o+e>window.innerHeight?{top:window.innerHeight-(e+16)+"px",position:"fixed",width:`${t.offsetWidth}px`}:{position:"fixed",left:i.left,top:i.top,width:i.width-2+"px",zIndex:"10"}}render(){if(!this.optionsData)return;this._optionsData="string"==typeof this.optionsData?JSON.parse(this.optionsData):this.optionsData,this.unsavedSelectedItems||(this.unsavedSelectedItems=this.safelyCloneArray(this._optionsData));const t=this.open?"expand_less":"expand_more";return console.log(this.bodyOffset),i(e,{class:this.inline?"inline":"block"},this.label&&i("div",{class:"label"},this.label),i("div",{tabindex:"0",class:"dropdown-container"},i("div",{class:"dropdown-selector",onClick:this.onDropdownClicked.bind(this)},this.dropdownSelectorContent(),i("div",{class:"dropdown-selector-chevron"},i("tttx-icon",{icon:t,color:"black"}))),this.open&&i("div",{class:"dropdown-body-container"},i("div",{class:"dropdown-body",style:Object.assign({},this.bodyOffset)},this.searchEnabled&&i("div",{class:"searchbox"},i("tttx-standalone-input",{type:"text",placeholder:"Search",label:"",required:!0,showerrorbubble:!1,iconleft:"search",onInput:this.handleSearchInput.bind(this),inline:!0})),i("div",{class:"dropdown-options-list"},this.unsavedSelectedItems.map((t=>this.dropdownOption(t)))),i("div",{class:"footer"},i("tttx-button",{design:"primary",onClick:this.applyChanges.bind(this)},"Apply"),i("tttx-button",{onClick:this.onCancel.bind(this)},"Cancel"))))))}get el(){return s(this)}static get watchers(){return{optionsData:["handleOptionsDataChange"]}}};r.style='.material-symbols-rounded{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24}:host{display:flex;gap:4px}.label{font-size:16px;font-style:normal;font-weight:500;line-height:normal}:host(.inline) .label{padding-top:8px}:host(.block){flex-direction:column}.dropdown-container{position:relative;display:flex;flex-direction:column;width:100%}.dropdown-container:focus-visible{outline:none}.dropdown-container:focus .dropdown-selector{border:1px solid #1479c6}.dropdown-selector,.dropdown-body{display:flex;border-radius:4px;background-color:white}.dropdown-selector{align-items:center;gap:8px;padding:6px 8px 6px 16px;cursor:pointer;border:1px solid #d5d5d5}.dropdown-selector-chevron{margin-left:auto;height:24px;align-self:flex-start}.dropdown-selector-chevron>tttx-icon{cursor:pointer}.dropdown-selector-html-content{display:flex;gap:8px;flex-wrap:wrap}.dropdown-body-container{position:relative}.dropdown-body{position:absolute;display:flex;flex-direction:column;box-shadow:0px 1px 5px #1111114D;padding-bottom:8px;border:1px solid #d5d5d5;width:100%}.dropdown-options-list{display:flex;flex-direction:column;overflow-y:auto;scrollbar-gutter:stable;max-height:288px}.dropdown-option{padding:6px 8px 6px 16px;cursor:pointer;display:flex;gap:8px}.dropdown-option .checkbox-icon{height:24px}.dropdown-option .plaintext-option{line-height:24px}.dropdown-option:hover{background-color:#1111110d}.dropdown-option:active,.dropdown-option.selected{background-color:#ebfbfc}.placeholder{color:#9e9e9e}.searchbox{padding:8px 16px 8px 16px;height:52px;box-sizing:border-box}.searchbox tttx-standalone-input{margin-top:-4px}.hidden{display:none}.footer{display:flex;gap:8px;flex-direction:row-reverse;padding:8px 16px 0 16px;border-top:1px solid #d5d5d5}';export{r as tttx_multiselect_box}