@sankhyalabs/sankhyablocks 3.2.0 → 3.2.1
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/{index-2cd6f753.js → index-21bd01e1.js} +111 -2
- package/dist/cjs/{index-696b5c3b.js → index-fc7ca86c.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -2
- package/dist/cjs/sankhyablocks.cjs.js +6 -2
- package/dist/cjs/snk-application.cjs.entry.js +3 -1
- package/dist/cjs/snk-config-options.cjs.entry.js +4 -4
- package/dist/cjs/snk-configurator_3.cjs.entry.js +14 -14
- package/dist/cjs/snk-crud.cjs.entry.js +10 -9
- package/dist/cjs/snk-data-exporter_8.cjs.entry.js +41 -16
- package/dist/cjs/snk-data-unit.cjs.entry.js +8 -5
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +5 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +3 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +7 -4
- package/dist/cjs/snk-form.cjs.entry.js +7 -4
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +7 -1
- package/dist/cjs/{taskbar-elements-81ad590c.js → taskbar-elements-8d38f43a.js} +2 -2
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/snk-application/snk-application.js +2 -0
- package/dist/collection/components/snk-configurator/snk-configurator.js +2 -3
- package/dist/collection/components/snk-crud/snk-crud.js +7 -6
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +2 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +0 -3
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -4
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +4 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +4 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +4 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +4 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +6 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +4 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +4 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +4 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -0
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +9 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +12 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +4 -0
- package/dist/collection/components/snk-form/snk-form.js +6 -3
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +3 -3
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +2 -6
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +6 -3
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +6 -0
- package/dist/collection/components/snk-grid/snk-grid.js +8 -3
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +3 -3
- package/dist/collection/components/snk-grid/subcomponents/snk-select-box/snk-select-box.js +0 -3
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +4 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +9 -4
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.js +1 -1
- package/dist/components/snk-application2.js +2 -0
- package/dist/components/snk-config-options2.js +3 -3
- package/dist/components/snk-configurator2.js +2 -3
- package/dist/components/snk-crud.js +7 -6
- package/dist/components/snk-data-exporter2.js +0 -3
- package/dist/components/snk-data-unit.js +7 -4
- package/dist/components/snk-exporter-email-sender2.js +2 -0
- package/dist/components/snk-field-config2.js +2 -6
- package/dist/components/snk-filter-bar2.js +4 -0
- package/dist/components/snk-filter-binary-select.js +2 -0
- package/dist/components/snk-filter-detail2.js +2 -0
- package/dist/components/snk-filter-item2.js +3 -0
- package/dist/components/snk-filter-list2.js +9 -0
- package/dist/components/snk-filter-modal2.js +10 -0
- package/dist/components/snk-filter-multi-select.js +2 -0
- package/dist/components/snk-filter-number.js +2 -0
- package/dist/components/snk-filter-period.js +2 -0
- package/dist/components/snk-filter-personalized.js +4 -0
- package/dist/components/snk-filter-search.js +2 -0
- package/dist/components/snk-filter-text.js +2 -0
- package/dist/components/snk-form-config2.js +6 -3
- package/dist/components/snk-form2.js +6 -3
- package/dist/components/snk-grid-config2.js +3 -3
- package/dist/components/snk-grid2.js +8 -3
- package/dist/components/snk-pesquisa2.js +4 -0
- package/dist/components/snk-select-box2.js +0 -3
- package/dist/components/snk-tab-config2.js +6 -0
- package/dist/components/snk-taskbar2.js +9 -4
- package/dist/esm/{index-a77b6f35.js → index-cfd4bb13.js} +111 -3
- package/dist/esm/{index-d89e384f.js → index-e467ade5.js} +1 -1
- package/dist/esm/loader.js +3 -2
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/sankhyablocks.js +3 -2
- package/dist/esm/snk-application.entry.js +3 -1
- package/dist/esm/snk-config-options.entry.js +4 -4
- package/dist/esm/snk-configurator_3.entry.js +14 -14
- package/dist/esm/snk-crud.entry.js +10 -9
- package/dist/esm/snk-data-exporter_8.entry.js +41 -16
- package/dist/esm/snk-data-unit.entry.js +8 -5
- package/dist/esm/snk-exporter-email-sender.entry.js +3 -1
- package/dist/esm/snk-filter-binary-select.entry.js +3 -1
- package/dist/esm/snk-filter-detail.entry.js +3 -1
- package/dist/esm/snk-filter-multi-select.entry.js +3 -1
- package/dist/esm/snk-filter-number.entry.js +3 -1
- package/dist/esm/snk-filter-period.entry.js +3 -1
- package/dist/esm/snk-filter-personalized.entry.js +5 -1
- package/dist/esm/snk-filter-search.entry.js +3 -1
- package/dist/esm/snk-filter-text.entry.js +3 -1
- package/dist/esm/snk-form-config.entry.js +7 -4
- package/dist/esm/snk-form.entry.js +7 -4
- package/dist/esm/snk-pesquisa.entry.js +5 -1
- package/dist/esm/snk-tab-config.entry.js +7 -1
- package/dist/esm/{taskbar-elements-9b0a87f1.js → taskbar-elements-24655695.js} +2 -2
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-01fdcc77.entry.js +1 -0
- package/dist/sankhyablocks/p-0b86c7f0.entry.js +1 -0
- package/dist/sankhyablocks/p-123732eb.entry.js +1 -0
- package/dist/sankhyablocks/p-125c2d01.entry.js +1 -0
- package/dist/sankhyablocks/p-2cd74aa1.entry.js +1 -0
- package/dist/sankhyablocks/{p-4cec3835.entry.js → p-31e36df4.entry.js} +4 -4
- package/dist/sankhyablocks/p-4133f9e5.entry.js +1 -0
- package/dist/sankhyablocks/p-5360f8fa.entry.js +1 -0
- package/dist/sankhyablocks/p-5e62a17b.entry.js +1 -0
- package/dist/sankhyablocks/p-5fc55684.entry.js +1 -0
- package/dist/sankhyablocks/p-6b992e43.js +1 -0
- package/dist/sankhyablocks/p-86d29b6f.entry.js +1 -0
- package/dist/sankhyablocks/p-93c92b97.entry.js +1 -0
- package/dist/sankhyablocks/p-93d8ea09.js +2 -2
- package/dist/sankhyablocks/{p-112bb324.js → p-98f7f796.js} +1 -1
- package/dist/sankhyablocks/p-9fab987d.entry.js +1 -0
- package/dist/sankhyablocks/p-ad51bf1c.entry.js +1 -0
- package/dist/sankhyablocks/p-afba9bbe.entry.js +1 -0
- package/dist/sankhyablocks/p-b9667fbe.js +2 -0
- package/dist/sankhyablocks/p-c336170d.entry.js +1 -0
- package/dist/sankhyablocks/p-d5c9c1f8.entry.js +1 -0
- package/dist/sankhyablocks/{p-57895452.entry.js → p-e551b19a.entry.js} +1 -1
- package/dist/sankhyablocks/p-e701646c.entry.js +1 -0
- package/dist/sankhyablocks/p-ee82c157.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/stencil-public-runtime.d.ts +64 -3
- package/loader/index.d.ts +9 -0
- package/package.json +5 -5
- package/dist/sankhyablocks/p-048e126b.entry.js +0 -1
- package/dist/sankhyablocks/p-12ebe36a.entry.js +0 -1
- package/dist/sankhyablocks/p-187b0d06.entry.js +0 -1
- package/dist/sankhyablocks/p-1ccaea51.entry.js +0 -1
- package/dist/sankhyablocks/p-1dbe9dd8.entry.js +0 -1
- package/dist/sankhyablocks/p-3c7ec56e.entry.js +0 -1
- package/dist/sankhyablocks/p-3f6c05c7.entry.js +0 -1
- package/dist/sankhyablocks/p-5ebc029c.entry.js +0 -1
- package/dist/sankhyablocks/p-7dad1d5e.js +0 -1
- package/dist/sankhyablocks/p-91c23d20.entry.js +0 -1
- package/dist/sankhyablocks/p-a77dd79a.js +0 -2
- package/dist/sankhyablocks/p-ab4ff312.entry.js +0 -1
- package/dist/sankhyablocks/p-bcb2fb03.entry.js +0 -1
- package/dist/sankhyablocks/p-c15108d5.entry.js +0 -1
- package/dist/sankhyablocks/p-d3e402d3.entry.js +0 -1
- package/dist/sankhyablocks/p-d7ae56ce.entry.js +0 -1
- package/dist/sankhyablocks/p-df5d94c6.entry.js +0 -1
- package/dist/sankhyablocks/p-e075dba7.entry.js +0 -1
- package/dist/sankhyablocks/p-f6f71be7.entry.js +0 -1
- package/dist/sankhyablocks/p-f9829109.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,h as e,H as i,g as t}from"./p-b9667fbe.js";import{ObjectUtils as r,StringUtils as a,ElementIDUtils as o}from"@sankhyalabs/core";const n=class{constructor(e){s(this,e),this._mdByName={},this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._specialCharsRegex=/[[.\-\$\+\*,_\&\(\)%\/\\#@!:\|\=\'\"]/gim,this._charsWithAccentuation="ÁÉÍÓÚ_ÃÕ_ÂÊÎÔÛ_ÀÈÌÒÙ_Ü_Ç_áéíóú_ãõ_âêîôû_àèìòù_ü_ç",this._charsWithoutAccentuation="AEIOU_AO_AEIOU_AEIOU_U_C_aeiou_ao_aeiou_aeiou_u_c",this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=450,this._itemList=void 0,this._startLoading=!1,this.searchLoader=void 0,this.selectItem=void 0,this.argument=void 0}observeArgument(){this._textInput&&(this._textInput.value=this.argument)}clearSearch(){this.argument="",this._itemList=void 0}buildDetails(s,e){let i={};for(let t=0;t<s.length;t++){const r=s[t],a=e[r.fieldName];i[r.description]=this.highlightValue(e.__matchFields,r.options&&r.options[a]||a,s,!0)}return i}buildFirstFields(s,e,i=6){return s&&Array.isArray(s)&&s.forEach((s=>{let i=this.removeReference(e,this._mdByName[s]);i&&e.unshift(i)})),e=e.slice(0,i)}doSearch(s){this.searchLoader&&"function"==typeof this.searchLoader&&(this._startLoading=!0,this.searchLoader(s).then((s=>{if(this._startLoading=!1,s){let e=(s=r.stringToObject(s.json.$)).descriptionField,i=s.pkField;if(i){let t=[];s.data.forEach((r=>{var a;let o=this.filterFieldsMetadata(s,r),n=this.buildFirstFields(r.__matchFields,o),l={key:this.highlightValue(r.__matchFields,null===(a=r[i])||void 0===a?void 0:a.toString(),n,!0),title:e?this.highlightValue(r.__matchFields,r[e],n,!0):"",details:this.buildDetails(n,r)};t.push(l)})),this._itemList=t}}})).catch((s=>{this._startLoading=!1,this._itemList=[],console.warn(s)})))}filterFieldsMetadata(s,e){return s.fieldsMetadata.filter((i=>{let t=!a.isEmpty(e[i.fieldName])&&!1!==i.visible&&"B"!==i.type&&s.pkField!==i.fieldName&&s.descriptionField!==i.fieldName&&(i.isPrimaryKey||!i.isLinkField)&&!("S"===i.type&&"H"===i.presentationType);return t&&(this._mdByName[i.fieldName]=i),("string"!=typeof e[i.fieldName]||!(e[i.fieldName].indexOf("<img")>-1||e[i.fieldName].indexOf("<svg")>-1))&&t}))}removeAtIndex(s,e){if(e>=0&&e<s.length)return s.splice(e,1)[0]}removeReference(s,e){let i=this.indexOf(s,e);return this.removeAtIndex(s,i)}indexOf(s,e){let i=-1;return Array.isArray(s)&&this.find(s,((s,t)=>(i=t,this.equals(e,s)))),i}equals(s,e){return r.objectToString(s)===r.objectToString(e)}find(s,e){if(s)for(let i=0,t=s.length;i<t;i++)if(e(s[i],i,s))return s[i]}highlightValue(s,e,i,t){let r=this.replaceHtmlEntities(e);if(this.argument&&(t||this.isIn(s,i.fieldName))){const s=this.getArgumentNumber();let e=(isNaN(s)?this.argument:s.toString()).split(/%|,|\s+/),t=0,a=this.replaceAccentuatedChars(r);e.forEach((s=>{if(s){s=this.replaceAccentuatedChars(s);let e=this.getSpecialCharacters(s);null!=e&&e.length>0&&(s=this.removeSpecialCharacters(s)),(i.mask||"CGC_CPF"===i.uiType||"Phone"===i.uiType)&&(s=s.split("").join("\\.?\\-?\\/?\\(?\\)?"));let o=new RegExp(s,"ig");o.lastIndex=t;let n=o.exec(a);if(n&&n.length>0){t=n.index;let s=n[0].length,e=r.substring(t,t+s),i=(null==e?void 0:e.trim())?this._startHighlightTag+e+this._endHighlightTag:"",o=r.substring(0,t),l=r.substring(t+s);r=o+i+l,t+=i.length,a=this.replaceAccentuatedChars(r)}}}))}return r}replaceHtmlEntities(s){return null==s?s:String(s).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}replaceAccentuatedChars(s){return null==s?s:this.replaceToSpace(s,["&","<",">","""]).replace(/[^\w ]/g,(s=>{let e=this._charsWithAccentuation.indexOf(s);return e>-1&&(s=this._charsWithoutAccentuation.charAt(e)),s||""}))}replaceToSpace(s,e=[]){return null==s||e.forEach((e=>{const i=new RegExp(e,"g");let t="";for(let s=0;s<e.length;s++)t+=" ";s=String(s).replace(i,t)})),s}isIn(s,e){return this.indexOf(s,e)>-1}getSpecialCharacters(s){let e,i=[];for(;e=this._specialCharsRegex.exec(s);)i.push(s[e.index]);return i}removeSpecialCharacters(s){return this.getSpecialCharacters(s).forEach((e=>{s=this.replaceAll(s,e,"")})),s}replaceAll(s,e,i){let t=(null!=s?s:"").indexOf(e);for(;t>-1;)t=(s=s.replace(e,i)).indexOf(e);return s}getArgumentNumber(){return Number(this.argument||void 0)}createOption(s){let{key:e,title:i}=s;const t=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");i=a.decodeHtmlEntities(i);const o={value:null==e?void 0:e.replace(t,"").replace(r,""),label:null==i?void 0:i.replace(t,"").replace(r,"")};this.selectItem(o)}onChangeValue(s){if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=setTimeout((()=>{this.onChangeValue(s)}),this._deboucingTime));this.argument=(s.detail||"").trim();const e=this.getArgumentNumber();this.argument&&(!isNaN(e)||this.argument.length>=this._limitCharsToSearch)?this._changeDeboucingTimeout=setTimeout((()=>{this.doSearch(isNaN(e)?this.argument:e.toString())}),this._deboucingTime):this._itemList=void 0}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onClickSearch(){this.doSearch((this.argument||"").trim())}getMessageView(){return this._startLoading?"Aguarde, buscando registros...":this._itemList?this._itemList.length>=1?`${this._itemList.length} ${this._itemList.length>1?"registros encontrados":"registro encontrado"}`:"Nenhum registro encontrado":"Os resultados de sua pesquisa aparecerão aqui..."}componentDidLoad(){o.addIDInfo(this._element)}render(){var s;return e(i,null,e("div",{class:"snk-pesquisa"},e("div",{class:"snk-pesquisa__input"},e("ez-text-input",{label:"Buscar",class:"ez-margin-right--medium",canShowError:!1,ref:s=>this._textInput=s,onEzChange:s=>this.onChangeValue(s),value:this.argument,"data-element-id":"searchInput"},e("ez-icon",{slot:"leftIcon",iconName:"search"}),this.argument&&(null===(s=this._textInput)||void 0===s?void 0:s.value)?e("button",{slot:"rightIcon",class:"snk-pesquisa__btn",onClick:()=>this.clearSearch()},e("ez-icon",{iconName:"close"})):void 0),e("ez-button",{class:"ez-button--primary",label:"Pesquisar",onClick:()=>this.onClickSearch()})),e("label",{class:"snk-pesquisa__records"},this.getMessageView()),e("div",{class:"snk-pesquisa__content"},this._itemList&&this._itemList.map((s=>e("ez-card-item",{onEzClick:s=>this.createOption(s.detail),item:s}))))))}get _element(){return t(this)}static get watchers(){return{argument:["observeArgument"]}}};n.style=".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--medium, 12px);max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";export{n as snk_pesquisa}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as s,g as i}from"./p-b9667fbe.js";import{ElementIDUtils as e}from"@sankhyalabs/core";import{F as o}from"./p-9dd2b8cb.js";const r=class{constructor(s){t(this,s),this.value=void 0,this.config=void 0}ezChangeListener(t){this.value=t.detail.value}async show(){this._comboElement.setFocus()}componentDidLoad(){this._element&&e.addIDInfo(this._element,"filterContentEditor")}render(){if(this.config&&this.config.type===o.MULTI_SELECT)return s("ez-combo-box",{id:this.config.id,ref:t=>this._comboElement=t,label:this.config.label,value:this.config.value,options:this.config.props.options})}get _element(){return i(this)}};export{r as snk_filter_multi_select}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-
|
|
1
|
+
import{p as e,b as t}from"./p-b9667fbe.js";export{s as setNonce}from"./p-b9667fbe.js";(()=>{const t=import.meta.url,n={};return""!==t&&(n.resourcesUrl=new URL(".",t).href),e(n)})().then((e=>t([["p-e551b19a",[[1,"teste-pesquisa"]]],["p-01fdcc77",[[2,"snk-data-unit",{dataState:[1040],dataUnitName:[1,"data-unit-name"],entityName:[1,"entity-name"],pageSize:[2,"page-size"],dataUnit:[1040],beforeSave:[16],afterSave:[16],getDataUnit:[64],getSelectedRecordsIDsInfo:[64]}]]],["p-86d29b6f",[[0,"snk-filter-binary-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-ee82c157",[[0,"snk-filter-multi-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-ad51bf1c",[[0,"snk-filter-number",{config:[16],value:[2],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-5fc55684",[[0,"snk-filter-period",{config:[16],value:[8],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-d5c9c1f8",[[0,"snk-filter-personalized",{config:[16],value:[1040],fix:[16],unfix:[16],show:[64]}]]],["p-5e62a17b",[[0,"snk-filter-search",{config:[16],value:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-c336170d",[[0,"snk-filter-text",{config:[16],value:[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-e701646c",[[2,"snk-pesquisa",{searchLoader:[16],selectItem:[16],argument:[1025],_itemList:[32],_startLoading:[32]}]]],["p-93c92b97",[[2,"snk-config-options",{fieldConfig:[16],idConfig:[513,"id-config"],dataUnit:[16],_defaultType:[32]}]]],["p-5360f8fa",[[6,"snk-tab-config",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32],_activeEditText:[32],_activeEditTextIndex:[32],_actionsHide:[32],_actionsShow:[32]}]]],["p-afba9bbe",[[0,"snk-filter-detail",{config:[1040],getMessage:[16],show:[64]}]]],["p-9fab987d",[[6,"snk-grid",{configName:[1,"config-name"],actionsList:[16],taskbarManager:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],presentationMode:[1,"presentation-mode"],_dataUnit:[32],_dataState:[32],_gridConfig:[32],_popUpGridConfig:[32],showConfig:[64],hideConfig:[64],setConfig:[64]}],[2,"snk-configurator",{configName:[1,"config-name"],viewMode:[1,"view-mode"],_opened:[32],_permissions:[32],open:[64],close:[64]}],[2,"snk-field-config",{isConfigActive:[16],fieldConfig:[16],modeInsertion:[516,"mode-insertion"],dataUnit:[16]}]]],["p-125c2d01",[[2,"snk-form-config",{dataUnit:[16],formConfig:[16],configName:[513,"config-name"],_formConfigOptions:[32],_fieldConfigSelected:[32],_layoutFormConfig:[32],_fieldsAvailable:[32],_formConfig:[32],_formConfigChanged:[32],_optionFormConfigSelected:[32],_optionFormConfigChanged:[32],_tempGroups:[32]}]]],["p-0b86c7f0",[[0,"snk-exporter-email-sender",{getMessage:[16],_config:[32],_opened:[32],_currentStep:[32],open:[64],close:[64]}]]],["p-123732eb",[[2,"snk-filter-bar",{dataUnit:[1040],configName:[1,"config-name"],filterConfig:[1040],allowDefault:[32],scrollerLocked:[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{selectedIndex:[1026,"selected-index"],application:[16],columns:[1040],config:[1040],saveConfig:[64]}],[6,"snk-taskbar",{configName:[1,"config-name"],buttons:[1],customButtons:[16],actionsList:[16],primaryButton:[1,"primary-button"],disabledButtons:[16],dataUnit:[16],presentationMode:[1537,"presentation-mode"],_permissions:[32]}],[0,"snk-filter-item",{config:[1040],getMessage:[16],detailIsVisible:[32],showUp:[64],hideDetail:[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{label:[1],iconName:[1,"icon-name"],items:[16],getMessage:[16],emptyText:[1,"empty-text"],findFilterText:[1,"find-filter-text"],buttonClass:[1,"button-class"],_filterArgument:[32],_showAll:[32],hideDetail:[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{getMessage:[16],items:[1040],modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],infoText:[1,"info-text"],useSearch:[4,"use-search"],processModalAction:[16],_filterArgument:[32]}],[1,"snk-select-box",{selectedOption:[1,"selected-option"]}],[2,"snk-data-exporter",{provider:[16],_items:[32],_showDropdown:[32],_releasedToExport:[32]}]]],["p-4133f9e5",[[2,"snk-form",{configName:[1,"config-name"],recordsValidator:[16],actionsList:[16],taskbarManager:[16],presentationMode:[1,"presentation-mode"],_dataUnit:[32],_dataState:[32],_editionFormConfig:[32],_insertionFormConfig:[32],_showFormConfig:[32],showConfig:[64],hideConfig:[64]}]]],["p-2cd74aa1",[[6,"snk-crud",{configName:[1025,"config-name"],actionsList:[16],taskbarManager:[16],recordsValidator:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],presentationMode:[1,"presentation-mode"],_dataUnit:[32],_dataState:[32],_viewMode:[32],goToView:[64]}]]],["p-31e36df4",[[2,"snk-application",{messagesBuilder:[1040],configName:[1,"config-name"],isUserSup:[64],hasAccess:[64],getAllAccess:[64],getStringParam:[64],getIntParam:[64],getFloatParam:[64],getBooleanParam:[64],getDateParam:[64],showPopUp:[64],showModal:[64],closeModal:[64],closePopUp:[64],temOpcional:[64],getConfig:[64],saveConfig:[64],getAttributeFromHTMLWrapper:[64],openApp:[64],webConnection:[64],createDataunit:[64],getDataUnit:[64],getResourceID:[64],getUserID:[64],alert:[64],error:[64],success:[64],message:[64],confirm:[64],info:[64],loadFormConfig:[64],loadGridConfig:[64],fetchUserAvailableConfigs:[64],fetchLegacyConfig:[64],fetchDefaultConfig:[64],loadTotals:[64],saveGridConfig:[64],getFilterBarConfig:[64],saveFilterBarConfig:[64],saveFormConfig:[64],getDefaultValues:[64],getDefaultValue:[64],executeSearch:[64],executePreparedSearch:[64],isDebugMode:[64],getAppLabel:[64]}]]]],e)));
|
|
@@ -133,7 +133,7 @@ export interface ListenOptions {
|
|
|
133
133
|
*/
|
|
134
134
|
passive?: boolean;
|
|
135
135
|
}
|
|
136
|
-
export
|
|
136
|
+
export type ListenTargetOptions = 'body' | 'document' | 'window';
|
|
137
137
|
export interface StateDecorator {
|
|
138
138
|
(): PropertyDecorator;
|
|
139
139
|
}
|
|
@@ -214,8 +214,8 @@ export declare const State: StateDecorator;
|
|
|
214
214
|
* https://stenciljs.com/docs/reactive-data#watch-decorator
|
|
215
215
|
*/
|
|
216
216
|
export declare const Watch: WatchDecorator;
|
|
217
|
-
export
|
|
218
|
-
export
|
|
217
|
+
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
218
|
+
export type ErrorHandler = (err: any, element?: HTMLElement) => void;
|
|
219
219
|
/**
|
|
220
220
|
* `setMode()` is used for libraries which provide multiple "modes" for styles.
|
|
221
221
|
*/
|
|
@@ -223,6 +223,7 @@ export declare const setMode: (handler: ResolutionHandler) => void;
|
|
|
223
223
|
/**
|
|
224
224
|
* `getMode()` is used for libraries which provide multiple "modes" for styles.
|
|
225
225
|
* @param ref a reference to the node to get styles for
|
|
226
|
+
* @returns the current mode or undefined, if not found
|
|
226
227
|
*/
|
|
227
228
|
export declare function getMode<T = string | undefined>(ref: any): T;
|
|
228
229
|
export declare function setPlatformHelpers(helpers: {
|
|
@@ -237,6 +238,7 @@ export declare function setPlatformHelpers(helpers: {
|
|
|
237
238
|
* if the path needs to be customized.
|
|
238
239
|
* @param path the path to use in calculating the asset path. this value will be
|
|
239
240
|
* used in conjunction with the base asset path
|
|
241
|
+
* @returns the base path
|
|
240
242
|
*/
|
|
241
243
|
export declare function getAssetPath(path: string): string;
|
|
242
244
|
/**
|
|
@@ -252,11 +254,22 @@ export declare function getAssetPath(path: string): string;
|
|
|
252
254
|
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
253
255
|
* will have to ensure the static assets are copied to its build directory.
|
|
254
256
|
* @param path the asset path to set
|
|
257
|
+
* @returns the set path
|
|
255
258
|
*/
|
|
256
259
|
export declare function setAssetPath(path: string): string;
|
|
260
|
+
/**
|
|
261
|
+
* Used to specify a nonce value that corresponds with an application's
|
|
262
|
+
* [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
|
|
263
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
264
|
+
* Alternatively, the nonce value can be set on a `meta` tag in the DOM head
|
|
265
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) and will result in the same behavior.
|
|
266
|
+
* @param nonce The value to be used for the nonce attribute.
|
|
267
|
+
*/
|
|
268
|
+
export declare function setNonce(nonce: string): void;
|
|
257
269
|
/**
|
|
258
270
|
* Retrieve a Stencil element for a given reference
|
|
259
271
|
* @param ref the ref to get the Stencil element for
|
|
272
|
+
* @returns a reference to the element
|
|
260
273
|
*/
|
|
261
274
|
export declare function getElement(ref: any): HTMLStencilElement;
|
|
262
275
|
/**
|
|
@@ -269,6 +282,7 @@ export declare function getElement(ref: any): HTMLStencilElement;
|
|
|
269
282
|
export declare function forceUpdate(ref: any): void;
|
|
270
283
|
/**
|
|
271
284
|
* getRenderingRef
|
|
285
|
+
* @returns the rendering ref
|
|
272
286
|
*/
|
|
273
287
|
export declare function getRenderingRef(): any;
|
|
274
288
|
export interface HTMLStencilElement extends HTMLElement {
|
|
@@ -428,13 +442,57 @@ interface HostAttributes {
|
|
|
428
442
|
ref?: (el: HTMLElement | null) => void;
|
|
429
443
|
[prop: string]: any;
|
|
430
444
|
}
|
|
445
|
+
/**
|
|
446
|
+
* Utilities for working with functional Stencil components. An object
|
|
447
|
+
* conforming to this interface is passed by the Stencil runtime as the third
|
|
448
|
+
* argument to a functional component, allowing component authors to work with
|
|
449
|
+
* features like children.
|
|
450
|
+
*
|
|
451
|
+
* The children of a functional component will be passed as the second
|
|
452
|
+
* argument, so a functional component which uses these utils to transform its
|
|
453
|
+
* children might look like the following:
|
|
454
|
+
*
|
|
455
|
+
* ```ts
|
|
456
|
+
* export const AddClass: FunctionalComponent = (_, children, utils) => (
|
|
457
|
+
* utils.map(children, child => ({
|
|
458
|
+
* ...child,
|
|
459
|
+
* vattrs: {
|
|
460
|
+
* ...child.vattrs,
|
|
461
|
+
* class: `${child.vattrs.class} add-class`
|
|
462
|
+
* }
|
|
463
|
+
* }))
|
|
464
|
+
* );
|
|
465
|
+
* ```
|
|
466
|
+
*
|
|
467
|
+
* For more see the Stencil documentation, here:
|
|
468
|
+
* https://stenciljs.com/docs/functional-components
|
|
469
|
+
*/
|
|
431
470
|
export interface FunctionalUtilities {
|
|
471
|
+
/**
|
|
472
|
+
* Utility for reading the children of a functional component at runtime.
|
|
473
|
+
* Since the Stencil runtime uses a different interface for children it is
|
|
474
|
+
* not recommendeded to read the children directly, and is preferable to use
|
|
475
|
+
* this utility to, for instance, perform a side effect for each child.
|
|
476
|
+
*/
|
|
432
477
|
forEach: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => void) => void;
|
|
478
|
+
/**
|
|
479
|
+
* Utility for transforming the children of a functional component. Given an
|
|
480
|
+
* array of children and a callback this will return a list of the results of
|
|
481
|
+
* passing each child to the supplied callback.
|
|
482
|
+
*/
|
|
433
483
|
map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
|
|
434
484
|
}
|
|
435
485
|
export interface FunctionalComponent<T = {}> {
|
|
436
486
|
(props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[];
|
|
437
487
|
}
|
|
488
|
+
/**
|
|
489
|
+
* A Child VDOM node
|
|
490
|
+
*
|
|
491
|
+
* This has most of the same properties as {@link VNode} but friendlier names
|
|
492
|
+
* (i.e. `vtag` instead of `$tag$`, `vchildren` instead of `$children$`) in
|
|
493
|
+
* order to provide a friendlier public interface for users of the
|
|
494
|
+
* {@link FunctionalUtilities}).
|
|
495
|
+
*/
|
|
438
496
|
export interface ChildNode {
|
|
439
497
|
vtag?: string | number | Function;
|
|
440
498
|
vkey?: string | number;
|
|
@@ -481,6 +539,9 @@ export declare function h(sel: any, children: Array<VNode | undefined | null>):
|
|
|
481
539
|
export declare function h(sel: any, data: VNodeData | null, text: string): VNode;
|
|
482
540
|
export declare function h(sel: any, data: VNodeData | null, children: Array<VNode | undefined | null>): VNode;
|
|
483
541
|
export declare function h(sel: any, data: VNodeData | null, children: VNode): VNode;
|
|
542
|
+
/**
|
|
543
|
+
* A virtual DOM node
|
|
544
|
+
*/
|
|
484
545
|
export interface VNode {
|
|
485
546
|
$flags$: number;
|
|
486
547
|
$tag$: string | number | Function;
|
package/loader/index.d.ts
CHANGED
|
@@ -10,3 +10,12 @@ export interface CustomElementsDefineOptions {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
|
|
12
12
|
export declare function applyPolyfills(): Promise<void>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
16
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
17
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
18
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
19
|
+
* will result in the same behavior.
|
|
20
|
+
*/
|
|
21
|
+
export declare function setNonce(nonce: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sankhyalabs/sankhyablocks",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@babel/preset-env": "^7.18.2",
|
|
43
|
-
"@sankhyalabs/core": "^
|
|
44
|
-
"@sankhyalabs/ezui": "^
|
|
43
|
+
"@sankhyalabs/core": "^3.1.0",
|
|
44
|
+
"@sankhyalabs/ezui": "^3.0.1",
|
|
45
45
|
"@sankhyalabs/skippeerdeps": "^1.0.2",
|
|
46
46
|
"@semantic-release/exec": "^5.0.0",
|
|
47
47
|
"@semantic-release/git": "^9.0.0",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"verbose": true
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@sankhyalabs/core": "^
|
|
69
|
-
"@sankhyalabs/ezui": "^
|
|
68
|
+
"@sankhyalabs/core": "^3.1.0",
|
|
69
|
+
"@sankhyalabs/ezui": "^3.0.1"
|
|
70
70
|
},
|
|
71
71
|
"license": "MIT"
|
|
72
72
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,r as t,g as n}from"./p-a77dd79a.js";import{ElementIDUtils as s}from"@sankhyalabs/core";const i=({getMessage:t,changeInfo:n,data:i})=>{const{format:o,email:a}=i||{};return e("div",null,e("ez-text-input",Object.assign({label:`${t("snkExporter.emailSenderInfoStep_sendTo")} (obrigatório) *`,required:!0,value:null==a?void 0:a.to,onEzChange:e=>n("to",e.detail.trim())},{[s.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${s.getInternalIDInfo("sendTo")}`})),e("ez-text-input",Object.assign({label:`${t("snkExporter.emailSenderInfoStep_subject")} (obrigatório) *`,required:!0,value:null==a?void 0:a.subject,onEzChange:e=>n("subject",e.detail.trim())},{[s.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${s.getInternalIDInfo("subject")}`})),e("ez-text-area",Object.assign({label:t("snkExporter.emailSenderInfoStep_message"),value:null==a?void 0:a.message,onEzChange:e=>n("message",e.detail)},{[s.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${s.getInternalIDInfo("message")}`})),((null==a?void 0:a.attachments)||[]).map(((t,n)=>e("ez-file-item",Object.assign({class:"ez-padding-bottom--large",fileName:`${t.name}.${o}`,fileSize:t.size,canRemove:!1},{[s.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${s.getInternalIDInfo("fileItem_")+(n+1)}`})))))},o=({getMessage:t,changeInfo:n,data:i})=>{const o=(null==i?void 0:i.selectedRows)||0,a=[{label:t("snkExporter.emailSenderOptStep_formatPDF"),value:"pdf"},{label:t("snkExporter.emailSenderOptStep_formatXLSX"),value:"xlsx"}],l=[{label:t("snkExporter.emailSenderOptStep_allData"),value:"all"},{label:t("snkExporter.emailSenderOptStep_currentPage"),value:"page"}];if(o>0){const e=t(o>1?"snkExporter.emailSenderOptStep_someRecords":"snkExporter.emailSenderOptStep_oneRecord",{SELECTION_COUNT:o});l.push({label:e,value:"selection"})}return e("div",null,e("ez-radio-button",Object.assign({class:"ez-margin-bottom--large"},{[s.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${s.getInternalIDInfo("formato")}`},{label:t("snkExporter.emailSenderOptStep_lblFormat"),direction:"horizontal",value:null==i?void 0:i.format,onEzChange:e=>n("format",e.detail),options:a})),e("ez-radio-button",Object.assign({class:"ez-margin-bottom--large"},{[s.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${s.getInternalIDInfo("type")}`},{label:t("snkExporter.emailSenderOptStep_export"),value:(null==i?void 0:i.type)||"all",onEzChange:e=>n("type",e.detail),options:l})))},a=class{constructor(e){t(this,e),this._stepInfo=[{subTitle:"snkExporter.emailSenderOptStep_subtitle",firstButton:"snkExporter.emailSenderCancelButton",secondButton:"snkExporter.emailSenderNextButton",firstButtonAction:()=>this.close(),secondButtonAction:()=>this.changeStep(1)},{subTitle:"snkExporter.emailSenderInfoStep_subtitle",firstButton:"snkExporter.emailSenderBackButton",secondButton:"snkExporter.emailSenderSendButton",firstButtonAction:()=>this.changeStep(0),secondButtonAction:()=>this.send(),secondButtonEnabledTester:()=>this.isFilled(),secondButtonClass:"ez-button--primary"}],this._opened=!1,this._currentStep=0}open(e){var t;return this._config=Object.assign(Object.assign({},e),{format:null!==(t=null==e?void 0:e.format)&&void 0!==t?t:"pdf"}),this._opened=!0,this.changeStep(0),new Promise((e=>{this._promiseResolver=e}))}close(){return this._opened=!1,new Promise((e=>{this._promiseResolver=e}))}getStepMessage(e){return this.getMessage((this._stepInfo[this._currentStep]||{})[e])}executeButtonAction(e){(this._stepInfo[this._currentStep]||{})[e?"firstButtonAction":"secondButtonAction"]()}checkButtonEnabled(e){const t=(this._stepInfo[this._currentStep]||{})[e?"firstButtonEnabledTester":"secondButtonEnabledTester"];return!t||t()}changeStep(e){this._currentStep=e,this._viewStack&&this._viewStack.show(this._currentStep)}send(){const{format:e,type:t,email:n}=this._config;this._promiseResolver({format:e,type:t,email:n,report:void 0})}isFilled(){var e,t;return!(!(null===(e=this._config.email)||void 0===e?void 0:e.to)||!(null===(t=this._config.email)||void 0===t?void 0:t.subject))}updateEmailInfo(e,t){this._config=Object.assign(Object.assign({},this._config),{email:Object.assign(Object.assign({},this._config.email),{[e]:t})})}updateConfigInfo(e,t){this._config=Object.assign(Object.assign({},this._config),{[e]:t})}getSecondButtonClass(){return(this._stepInfo[this._currentStep]||{}).secondButtonClass||"ez-button--secondary"}render(){return s.addIDInfoIfNotExists(this._element,"snkExporterEmailSender"),e("ez-popup",{useHeader:!1,size:"x-small",heightMode:"auto",opened:this._opened},e("ez-modal-container",{onEzModalAction:e=>{"CLOSE"===e.detail&&this.close()},modalTitle:this.getMessage("snkExporter.emailSenderTitle"),modalSubTitle:this.getStepMessage("subTitle")},e("ez-view-stack",{ref:e=>this._viewStack=e},e("stack-item",null,e(o,{getMessage:this.getMessage,data:this._config,changeInfo:(e,t)=>this.updateConfigInfo(e,t)})),e("stack-item",null,e(i,{getMessage:this.getMessage,data:this._config,changeInfo:(e,t)=>this.updateEmailInfo(e,t)}))),e("div",{class:"ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small"},e("ez-button",Object.assign({class:"ez-button--tertiary ez-padding-right--medium",label:this.getStepMessage("firstButton"),onClick:()=>this.executeButtonAction(!0),enabled:this.checkButtonEnabled(!0)},{[s.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${s.getInternalIDInfo("firstButton")}`})),e("ez-button",Object.assign({class:this.getSecondButtonClass(),label:this.getStepMessage("secondButton"),onClick:()=>this.executeButtonAction(!1),enabled:this.checkButtonEnabled(!1)},{[s.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${s.getInternalIDInfo("secondButton")}`})))))}get _element(){return n(this)}};export{a as snk_exporter_email_sender}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,g as s}from"./p-a77dd79a.js";import{ElementIDUtils as i}from"@sankhyalabs/core";import{F as r}from"./p-9dd2b8cb.js";const a=class{constructor(e){t(this,e)}ezChangeListener(){const t=this._startDate.value,e=this._endDate.value;this.value=t||e?{start:t,end:e}:void 0}componentDidLoad(){this._element&&i.addIDInfo(this._element,"filterContentEditor")}getDate(t){const e=this.value?this.value[t]:null;if(e instanceof Date)return e;if("string"==typeof e){let t=new Date(e);return t.setMinutes(t.getMinutes()+t.getTimezoneOffset()),t}return null}async show(){this._startDate.setFocus()}render(){if(this.config&&this.config.type===r.PERIOD)return e("div",{class:"ez-col ez-col--nowrap"},e("ez-date-input",{id:`${this.config.id}_start`,label:this.config.label,ref:t=>this._startDate=t,value:this.getDate("start")}),e("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin--medium"},"até"),e("ez-date-input",{id:`${this.config.id}_end`,label:this.config.label,ref:t=>this._endDate=t,value:this.getDate("end")}))}get _element(){return s(this)}};export{a as snk_filter_period}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,h as e,H as i,g as t}from"./p-a77dd79a.js";import{ObjectUtils as r,StringUtils as a,ElementIDUtils as o}from"@sankhyalabs/core";const n=class{constructor(e){s(this,e),this._mdByName={},this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._specialCharsRegex=/[[.\-\$\+\*,_\&\(\)%\/\\#@!:\|\=\'\"]/gim,this._charsWithAccentuation="ÁÉÍÓÚ_ÃÕ_ÂÊÎÔÛ_ÀÈÌÒÙ_Ü_Ç_áéíóú_ãõ_âêîôû_àèìòù_ü_ç",this._charsWithoutAccentuation="AEIOU_AO_AEIOU_AEIOU_U_C_aeiou_ao_aeiou_aeiou_u_c",this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=450,this._startLoading=!1}observeArgument(){this._textInput&&(this._textInput.value=this.argument)}clearSearch(){this.argument="",this._itemList=void 0}buildDetails(s,e){let i={};for(let t=0;t<s.length;t++){const r=s[t],a=e[r.fieldName];i[r.description]=this.highlightValue(e.__matchFields,r.options&&r.options[a]||a,s,!0)}return i}buildFirstFields(s,e,i=6){return s&&Array.isArray(s)&&s.forEach((s=>{let i=this.removeReference(e,this._mdByName[s]);i&&e.unshift(i)})),e=e.slice(0,i)}doSearch(s){this.searchLoader&&"function"==typeof this.searchLoader&&(this._startLoading=!0,this.searchLoader(s).then((s=>{if(this._startLoading=!1,s){let e=(s=r.stringToObject(s.json.$)).descriptionField,i=s.pkField;if(i){let t=[];s.data.forEach((r=>{var a;let o=this.filterFieldsMetadata(s,r),n=this.buildFirstFields(r.__matchFields,o),l={key:this.highlightValue(r.__matchFields,null===(a=r[i])||void 0===a?void 0:a.toString(),n,!0),title:e?this.highlightValue(r.__matchFields,r[e],n,!0):"",details:this.buildDetails(n,r)};t.push(l)})),this._itemList=t}}})).catch((s=>{this._startLoading=!1,this._itemList=[],console.warn(s)})))}filterFieldsMetadata(s,e){return s.fieldsMetadata.filter((i=>{let t=!a.isEmpty(e[i.fieldName])&&!1!==i.visible&&"B"!==i.type&&s.pkField!==i.fieldName&&s.descriptionField!==i.fieldName&&(i.isPrimaryKey||!i.isLinkField)&&!("S"===i.type&&"H"===i.presentationType);return t&&(this._mdByName[i.fieldName]=i),("string"!=typeof e[i.fieldName]||!(e[i.fieldName].indexOf("<img")>-1||e[i.fieldName].indexOf("<svg")>-1))&&t}))}removeAtIndex(s,e){if(e>=0&&e<s.length)return s.splice(e,1)[0]}removeReference(s,e){let i=this.indexOf(s,e);return this.removeAtIndex(s,i)}indexOf(s,e){let i=-1;return Array.isArray(s)&&this.find(s,((s,t)=>(i=t,this.equals(e,s)))),i}equals(s,e){return r.objectToString(s)===r.objectToString(e)}find(s,e){if(s)for(let i=0,t=s.length;i<t;i++)if(e(s[i],i,s))return s[i]}highlightValue(s,e,i,t){let r=this.replaceHtmlEntities(e);if(this.argument&&(t||this.isIn(s,i.fieldName))){const s=this.getArgumentNumber();let e=(isNaN(s)?this.argument:s.toString()).split(/%|,|\s+/),t=0,a=this.replaceAccentuatedChars(r);e.forEach((s=>{if(s){s=this.replaceAccentuatedChars(s);let e=this.getSpecialCharacters(s);null!=e&&e.length>0&&(s=this.removeSpecialCharacters(s)),(i.mask||"CGC_CPF"===i.uiType||"Phone"===i.uiType)&&(s=s.split("").join("\\.?\\-?\\/?\\(?\\)?"));let o=new RegExp(s,"ig");o.lastIndex=t;let n=o.exec(a);if(n&&n.length>0){t=n.index;let s=n[0].length,e=r.substring(t,t+s),i=(null==e?void 0:e.trim())?this._startHighlightTag+e+this._endHighlightTag:"",o=r.substring(0,t),l=r.substring(t+s);r=o+i+l,t+=i.length,a=this.replaceAccentuatedChars(r)}}}))}return r}replaceHtmlEntities(s){return null==s?s:String(s).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}replaceAccentuatedChars(s){return null==s?s:this.replaceToSpace(s,["&","<",">","""]).replace(/[^\w ]/g,(s=>{let e=this._charsWithAccentuation.indexOf(s);return e>-1&&(s=this._charsWithoutAccentuation.charAt(e)),s||""}))}replaceToSpace(s,e=[]){return null==s||e.forEach((e=>{const i=new RegExp(e,"g");let t="";for(let s=0;s<e.length;s++)t+=" ";s=String(s).replace(i,t)})),s}isIn(s,e){return this.indexOf(s,e)>-1}getSpecialCharacters(s){let e,i=[];for(;e=this._specialCharsRegex.exec(s);)i.push(s[e.index]);return i}removeSpecialCharacters(s){return this.getSpecialCharacters(s).forEach((e=>{s=this.replaceAll(s,e,"")})),s}replaceAll(s,e,i){let t=(null!=s?s:"").indexOf(e);for(;t>-1;)t=(s=s.replace(e,i)).indexOf(e);return s}getArgumentNumber(){return Number(this.argument||void 0)}createOption(s){let{key:e,title:i}=s;const t=new RegExp(this._startHighlightTag,"g"),r=new RegExp(this._endHighlightTag,"g");i=a.decodeHtmlEntities(i);const o={value:null==e?void 0:e.replace(t,"").replace(r,""),label:null==i?void 0:i.replace(t,"").replace(r,"")};this.selectItem(o)}onChangeValue(s){if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=setTimeout((()=>{this.onChangeValue(s)}),this._deboucingTime));this.argument=(s.detail||"").trim();const e=this.getArgumentNumber();this.argument&&(!isNaN(e)||this.argument.length>=this._limitCharsToSearch)?this._changeDeboucingTimeout=setTimeout((()=>{this.doSearch(isNaN(e)?this.argument:e.toString())}),this._deboucingTime):this._itemList=void 0}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onClickSearch(){this.doSearch((this.argument||"").trim())}getMessageView(){return this._startLoading?"Aguarde, buscando registros...":this._itemList?this._itemList.length>=1?`${this._itemList.length} ${this._itemList.length>1?"registros encontrados":"registro encontrado"}`:"Nenhum registro encontrado":"Os resultados de sua pesquisa aparecerão aqui..."}componentDidLoad(){o.addIDInfo(this._element)}render(){var s;return e(i,null,e("div",{class:"snk-pesquisa"},e("div",{class:"snk-pesquisa__input"},e("ez-text-input",{label:"Buscar",class:"ez-margin-right--medium",canShowError:!1,ref:s=>this._textInput=s,onEzChange:s=>this.onChangeValue(s),value:this.argument,"data-element-id":"searchInput"},e("ez-icon",{slot:"leftIcon",iconName:"search"}),this.argument&&(null===(s=this._textInput)||void 0===s?void 0:s.value)?e("button",{slot:"rightIcon",class:"snk-pesquisa__btn",onClick:()=>this.clearSearch()},e("ez-icon",{iconName:"close"})):void 0),e("ez-button",{class:"ez-button--primary",label:"Pesquisar",onClick:()=>this.onClickSearch()})),e("label",{class:"snk-pesquisa__records"},this.getMessageView()),e("div",{class:"snk-pesquisa__content"},this._itemList&&this._itemList.map((s=>e("ez-card-item",{onEzClick:s=>this.createOption(s.detail),item:s}))))))}get _element(){return t(this)}static get watchers(){return{argument:["observeArgument"]}}};n.style=".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--medium, 12px);max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";export{n as snk_pesquisa}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as s,g as i}from"./p-a77dd79a.js";import{ElementIDUtils as r}from"@sankhyalabs/core";import{F as e}from"./p-9dd2b8cb.js";const n=class{constructor(s){t(this,s)}ezChangeListener(t){this.value=t.detail}async show(){this._numberElement.setFocus()}componentDidLoad(){this._element&&r.addIDInfo(this._element,"filterContentEditor")}render(){var t;if(this.config&&this.config.type===e.NUMBER)return s("ez-number-input",{id:this.config.id,ref:t=>this._numberElement=t,label:this.config.label,value:this.config.value,precision:null===(t=this.config.props)||void 0===t?void 0:t.precision})}get _element(){return i(this)}};export{n as snk_filter_number}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as e,g as s,c as r}from"./p-a77dd79a.js";import{ObjectUtils as n,ApplicationContext as l,ElementIDUtils as o,DataType as a,StringUtils as d,ErrorException as h,FloatingManager as c,ArrayUtils as u}from"@sankhyalabs/core";import{ApplicationUtils as f,DialogType as m,CheckMode as g}from"@sankhyalabs/ezui/dist/collection/utils";import{D as p,a as b,b as k,P as v}from"./p-5534e08c.js";import{d as _,W as x,R as z,O as w}from"./p-b4093344.js";import{D as y,C}from"./p-93d8ea09.js";import{F as E}from"./p-9dd2b8cb.js";import{ModalAction as F,ModalButtonStatus as D}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{toString as T}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{A as I}from"./p-dc36cfbf.js";import{T as L,V as O,A as S,b as A,a as N}from"./p-7dad1d5e.js";import"./p-112455b1.js";import"./p-112bb324.js";class P{constructor(t,i){this._selectedNumber=0,this._getMessage=t,this._selectedNumber=i}setExportOption(t,i){const e=this.getExportGroupName();t===p.EXPORT_TO_PDF&&i.push(this.getExportToPDF(e)),t===p.EXPORT_TO_XLS&&i.push(this.getExportToXLS(e)),this.setExportCurrentPage(t,i),this.setExportByEmail(t,i)}setExportCurrentPage(t,i){var e;const s=[p.EXPORT_PAGE_TO_PDF,p.EXPORT_PAGE_TO_XLS];if(t===p.EXPORT_CURRENT_PAGE&&i.push(this.getCurrentPage()),s.includes(t)){let s=i.find((t=>t.id===p.EXPORT_CURRENT_PAGE));null==s&&(i.push(this.getCurrentPage()),s=i.find((t=>t.id===p.EXPORT_CURRENT_PAGE))),(null===(e=null==s?void 0:s.children)||void 0===e?void 0:e.length)||(s.children=[]),t===p.EXPORT_PAGE_TO_PDF&&s.children.push(this.getExportPageToPDF()),t===p.EXPORT_PAGE_TO_XLS&&s.children.push(this.getExportPageToXLS())}}setExportByEmail(t,i){t===p.EXPORT_BY_EMAIL&&i.push(this.getExportByEmail())}getExportToPDF(t){return{id:p.EXPORT_TO_PDF,label:"PDF (.pdf)",group:t}}getExportToXLS(t){return{id:p.EXPORT_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`,group:t}}getCurrentPage(){return{id:p.EXPORT_CURRENT_PAGE,label:this._getMessage("snkDataExporter.label.currentPage"),group:this._getMessage("snkDataExporter.group.custom")}}getExportPageToPDF(){return{id:p.EXPORT_PAGE_TO_PDF,label:"PDF (.pdf)"}}getExportPageToXLS(){return{id:p.EXPORT_PAGE_TO_XLS,label:`${this._getMessage("snkDataExporter.label.spreadsheet")} (.xlsx)`}}getExportByEmail(){return{id:p.EXPORT_BY_EMAIL,label:`${this._getMessage("snkDataExporter.label.sendByEmail")}...`}}getExportGroupName(){return 1===this._selectedNumber?this._getMessage("snkDataExporter.group.export.selectedLine"):this._selectedNumber>1?this._getMessage("snkDataExporter.group.export.multiSelected").replace("{0}",this._selectedNumber.toString()):this._getMessage("snkDataExporter.group.export.default")}}function $(t){var{methodName:i}=t,e=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)i.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(e[s[r]]=t[s[r]])}return e}(t,["methodName"]);const s=`DataExporterSPBean.${i}`,r={serviceName:s,requestBody:e};return new Promise(((t,i)=>{y.get().callServiceBroker(s,n.objectToString(r)).then((i=>t(function(t){var i;const e=null===(i=null==t?void 0:t.json)||void 0===i?void 0:i.$;if(null!=e)return n.stringToObject(e)}(i)))).catch((t=>i(t)))}))}const R=class{constructor(i){t(this,i),this._selectedNumber=0,this._customPrefix="$custom$",this._items=[],this._showDropdown=!1,this._releasedToExport=[p.EXPORT_TO_PDF,p.EXPORT_TO_XLS,p.EXPORT_BY_EMAIL,p.EXPORT_PDF_TO_EMAIL,p.EXPORT_XLS_TO_EMAIL,p.EXPORT_PAGE_TO_PDF,p.EXPORT_PAGE_TO_XLS],this.provider=null}async exportByEmail(){const t=this._selectedNumber;this._snkEmailSender.open({type:t>0?"selection":"all",selectedRows:t,email:{attachments:[{name:this._appLabel}]}}).then((({format:t,email:{to:i,subject:e,message:s}})=>{var r;const n=null!==(r=b[null==t?void 0:t.toUpperCase()])&&void 0!==r?r:b.PDF;this.resolveExporter({methodName:n,to:i,subject:e,message:s,fileName:this._appLabel,titleGrid:this._appLabel},(()=>{this._snkEmailSender.close(),f.info(this.getMessage("snkDataExporter.message.emailSuccess"),{iconName:"check"})}))}))}getMessage(t,i){return this._application.messagesBuilder.getMessage(t,i)}positionDropdown(){var t;const i=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();null!=i&&null!=this._dropdownParent&&(this._dropdownParent.style.top=i.y+i.height+5+"px",this._dropdownParent.style.left=i.x+"px")}closeDropdown(t){const i=null==t?void 0:t.target;null!=i&&(i.closest(".snk-data-exporter")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}controlDropdown(){this._showDropdown=!this._showDropdown}resolveExporter(t,i){if(null==this.provider||null==t||null==i)return;const e=this.provider.getFilters(),s=this.provider.getColumnsMetadata(),r=this.provider.getOrders(),n=this.provider.getResourceURI(),l=this.provider.getSelectedIDs(),o=t.exportOption,a=[p.EXPORT_PAGE_TO_PDF,p.EXPORT_PAGE_TO_XLS];delete t.exportOption;let d=Object.assign({filters:e,columns:s,sort:r,resourceURI:n,selectedIDs:l.slice(0,5e3)},t);if(a.includes(o)){const t=this.provider.getOffset(),i=this.provider.getLimit();d=Object.assign(Object.assign({},d),{offset:t,limit:i})}$(d).then((t=>i(t))).catch((()=>f.error(this.getMessage("snkDataExporter.title.error"),this.getMessage("snkDataExporter.message.exportError"))))}getOptionKey(t){return Object.keys(p).find((i=>p[i]===t))}dispatchExporter(t){var i;const e=this.getOptionKey(t),s=null!==(i=k[e])&&void 0!==i?i:k.EXPORT_TO_PDF,r=k[e]===k.EXPORT_TO_XLS;this.resolveExporter({methodName:p[`EXPORT_TO_${s}`],fileName:this._appLabel,titleGrid:this._appLabel,exportOption:t,limit:5e3},(t=>{(function({fileSessionKey:t,canPrint:i,canExport:e,useAppPrint:s,isDownload:r}){s&&!r?function(t,i,e){const s=l.getContextValue("__SNK__APPLICATION__");null!=s&&s.webConnection(_,x.methods.PDF_VIEWER,{chaveArquivo:t,permiteImprimir:i?"S":"N",permiteExportar:e?"S":"N",contentType:"S"})}(t,i,e):window.open(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/mge/visualizadorArquivos.mge?chaveArquivo=${t}${r?"&download=S":""}`)})(Object.assign(Object.assign({},t),{fileType:s,isDownload:r})),f.info(this.getMessage("snkDataExporter.message.exportSuccess"),{iconName:"check"})}))}async processExporter(t){var i,e,s,r;const n=null==t?void 0:t.detail,l=[p.EXPORT_PAGE_TO_PDF,p.EXPORT_PAGE_TO_XLS],o=null===(i=null==n?void 0:n.id)||void 0===i?void 0:i.includes(this._customPrefix);if((null==n?void 0:n.id)===p.EXPORT_CURRENT_PAGE)return;const a=null===(e=this.provider)||void 0===e?void 0:e.getSelectedIDs(),d=null===(s=this.provider)||void 0===s?void 0:s.getTotalRecords(),h=null===(r=this.provider)||void 0===r?void 0:r.getLimit();let c=!1;if(l.includes(null==n?void 0:n.id)&&h<=5e3||o?c=!1:(null==a?void 0:a.length)?c=a.length>5e3:d>5e3&&(c=!0),c){const t=5e3.toLocaleString("pt-BR",{minimumFractionDigits:0}),i={title:this.getMessage("snkDataExporter.limitExceeded.title"),description:`\n ${this.getMessage("snkDataExporter.limitExceeded.description",{limit:t})}\n <br/><br/>\n <b>\n ${this.getMessage("snkDataExporter.limitExceeded.subdescription")}\n </b>\n `,cancel:this.getMessage("snkDataExporter.limitExceeded.cancel"),confirm:this.getMessage("snkDataExporter.limitExceeded.continue")};if(!await f.confirm(i.title,i.description,null,m.WARN,{labelCancel:i.cancel,labelConfirm:i.confirm}))return}if(o)return this.openPersonalizedReports(n.id),void(this._showDropdown=!1);this._releasedToExport.includes(null==n?void 0:n.id)&&(n.id===p.EXPORT_BY_EMAIL?this.exportByEmail():this.dispatchExporter(n.id),this._showDropdown=!1)}loadItems(){const t=[];this._releasedToExport.forEach((i=>{var e;null===(e=this._itemBuilder)||void 0===e||e.setExportOption(i,t)})),this.loadPersonalizedItems(t)}async loadPersonalizedItems(t){var i;const e=null===(i=this.provider)||void 0===i?void 0:i.getRecordID();if(null==e)return void(this._items=t);const s=await function(t){const i="DataExporterSPBean.getPersonalizedReports",e={serviceName:i,requestBody:t};return new Promise(((t,s)=>y.get().callServiceBroker(i,n.objectToString(e)).then((i=>t(function(t){var i;const e=null===(i=null==t?void 0:t.json)||void 0===i?void 0:i.$;if(null!=e)return n.stringToObject(e)}(i)))).catch((t=>s(t)))))}({recordID:e});null==s||s.forEach((i=>{t.push({id:`${this._customPrefix}_${i.ID}`,label:i.label,group:this.getMessage("snkDataExporter.group.custom")})})),this._items=t}openPersonalizedReports(t){var i;const e=[],s=(null==t?void 0:t.replace(this._customPrefix,""))||"";null===(i=this.provider)||void 0===i||i.getSelectedIDs().forEach((({name:t,type:i,value:s},r)=>{const n=[],l=[];l.fields=[],0===r&&(e[`PK_${t}`]={type:i,value:s},e.pks=[]),n.push({nome:t,tipo:i,valor:s}),l.fields.push(n),e.pks.push(l)})),this._application.openApp(`${z}${s}`,e)}loadDropdown(){var t,i;this._selectedNumber=(null===(i=null===(t=this.provider)||void 0===t?void 0:t.getSelectedIDs())||void 0===i?void 0:i.length)||0,this._itemBuilder=new P(this.getMessage.bind(this),this._selectedNumber),this.loadItems()}getElementID(t){return{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:o.getInternalIDInfo(t)}}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}componentWillLoad(){var t;this._application=l.getContextValue("__SNK__APPLICATION__"),null===(t=this._application)||void 0===t||t.getAppLabel().then((t=>this._appLabel=t)),this.setEvents()}componentDidLoad(){null!=this._element&&(o.addIDInfo(this._element),this.positionDropdown())}componentWillUpdate(){var t;this._showDropdown&&!(null===(t=this._items)||void 0===t?void 0:t.length)&&this.loadDropdown()}componentDidUpdate(){var t;this._showDropdown?this.positionDropdown():(null===(t=this._items)||void 0===t?void 0:t.length)>0&&(this._items=[])}render(){return i(e,null,i("div",{class:`snk-data-exporter\n ${this.canShowDropdown()?" snk-data-exporter--overlap":""}\n `},i("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"file-download",size:"small",mode:"icon",title:this.getMessage("snkDataExporter.group.export.title"),onClick:()=>this.controlDropdown()},this.getElementID("button"))),i("div",Object.assign({ref:t=>this._dropdownParent=t,class:`snk-data-exporter__dropdown\n ${this.canShowDropdown()?"snk-data-exporter__dropdown--show":""}\n `},this.getElementID("dropdown")),this.canShowDropdown()&&i("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.processExporter(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&i("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))),i("snk-exporter-email-sender",Object.assign({ref:t=>this._snkEmailSender=t,getMessage:(t,i)=>this.getMessage(t,i)},this.getElementID("snkExporterEmailSender"))))}get _element(){return s(this)}};R.style=".sc-snk-data-exporter-h{--snk-data-exporter--z-index:var(--most-visible, 3);display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter--overlap.sc-snk-data-exporter{z-index:var(--snk-data-exporter--z-index)}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";const B=class{constructor(i){t(this,i),this._updateSequence=[],this._loadingPending=!1,this._configUpdated=!1,this._pendingFilters=[],this._calculateSortIndex=t=>{let i=t.hardFixed?1e6:0;return t.hardFixed||(i+=t.fixed?1e5:0,i+=null==t.value?0:1e4,i+=this._updateSequence.lastIndexOf(t.id)+1),i},this._filtersComparator=(t,i)=>this._calculateSortIndex(i)-this._calculateSortIndex(t),this.scrollerLocked=!1}observeFilterConfig(t,i){if(null!=i&&null==t)this._loadingPending=!0,this._configUpdated=!0;else{const e=new Map(i?i.map((t=>[t.id,t])):void 0);t.forEach((t=>{const i=e.get(t.id);null!=i?(this._configUpdated=this._configUpdated||n.objectToString(i)!=n.objectToString(t),this._loadingPending=this._loadingPending||n.objectToString(i.value)!==n.objectToString(t.value)):(this._configUpdated=!0,this._loadingPending=this._loadingPending||null!=t.value)}))}this.processAfterUpdateConfig()}componentDidLoad(){this._element&&o.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}processPendingFilter(){this._pendingFilters.length>0&&null==this._currentPendingFilter&&(this._currentPendingFilter=this._element.querySelector("#filter-"+this._pendingFilters.pop()),this._currentPendingFilter&&this._currentPendingFilter.showUp(!0).then((()=>{this._currentPendingFilter=void 0,this.processPendingFilter()}))),null==this._currentPendingFilter&&this.processAfterUpdateConfig()}processAfterUpdateConfig(){this._pendingFilters.length>0||(this._loadingPending&&(this._loadingPending=!1,this.dataUnit.loadData()),this._configUpdated&&(this._configUpdated=!1,this._application.saveFilterBarConfig(this.filterConfig,this.configName)))}getMessage(t,i){return this._application.messagesBuilder.getMessage(t,i)}getFilter(t){var i;const e=[];return null===(i=this.filterConfig)||void 0===i||i.filter((t=>this.isActiveFilter(t))).forEach((t=>{const i=(t=>{switch(t.type){case E.DEFAULT_FILTER:return function(t){return{name:t.id,expression:t.props.expression,params:[]}}(t);case E.BINARY_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.options.find((t=>t.name===e)).expression,params:[]}}(t);case E.MULTI_SELECT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:e}]}}(t);case E.PERIOD:return function(t){const{id:i,value:e,props:s}=t;let{end:r,start:n}=e;"string"==typeof r&&(r=new Date(r)),"string"==typeof n&&(n=new Date(n));const l=[];let o;return r&&n?(o=s.expression.fullfill,l.push({name:`${i}.START`,dataType:a.DATE,value:T(a.DATE,n)},{name:`${i}.END`,dataType:a.DATE,value:T(a.DATE,r)})):n?(o=s.expression.onlystart,l.push({name:i,dataType:a.DATE,value:T(a.DATE,n)})):(o=s.expression.onlyend,l.push({name:i,dataType:a.DATE,value:T(a.DATE,r)})),{name:i,expression:o,params:l}}(t);case E.SEARCH:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:T(a.TEXT,e.value)}]}}(t);case E.TEXT:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.TEXT,value:T(a.TEXT,e)}]}}(t);case E.NUMBER:return function(t){const{id:i,value:e,props:s}=t;return{name:i,expression:s.expression,params:[{name:i,dataType:a.NUMBER,value:T(a.NUMBER,e)}]}}(t);case E.PERSONALIZED:return function(t){var i;const{id:e,value:s,props:r}=t;return{name:e,expression:r.expression,params:((null===(i=r.personalizedFilter)||void 0===i?void 0:i.parameters)||[]).map(((t,i)=>{const e=Array.from(s),r=t.dataType;let n=i>=0&&i<e.length?e[i]:null;return null!=n&&"object"==typeof n&&"value"in n&&(n=n.value),null==n&&r===a.BOOLEAN&&(n=!1),{name:t.name,dataType:r,value:"string"==typeof n?n:T(r,n)}}))}}(t);default:return}})(t);i&&e.push(i)})),e}isActiveFilter(t){return t.visible&&null!=t.value||t.type===E.DEFAULT_FILTER}registryFilterProvider(){this.dataUnit.addFilterProvider(this),this.filterConfig&&this.dataUnit.loadData()}itemFocused(t){this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach((i=>{i.id===t?"snk-filter-item"===i.tagName.toLowerCase()&&i.getClientRects()[0].x<0&&i.scrollIntoView({behavior:"auto",inline:"nearest"}):i.hideDetail()}))}getFilterItems(){const t=[],e=[];this.filterConfig.filter((t=>t.visible)).forEach(((s,r)=>{const n=`filter-${s.id}`,l=i("snk-filter-item",{onVisibleChanged:t=>this.scrollerLocked=t.detail,onFocusin:()=>this.itemFocused(n),id:n,config:s,class:r>0?"ez-padding-left--medium":"",getMessage:(t,i)=>this.getMessage(t,i),key:s.id});return s.fixed||s.hardFixed?t.push(l):e.push(l),l}));const s=[];return s.push(...t),t.length>0&&e.length>0&&s.push(i("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider"})),s.push(...e),s}calculateUpdateSequence(t){t&&(this._updateSequence=this._updateSequence.filter((i=>t.id!==i)),this._updateSequence.push(t.id))}normalizeItem(t){const i=Object.assign({},t);return["props","value","hardFixed","fixed"].forEach((t=>{null==i[t]&&delete i[t]})),""===t.value&&delete t.value,i}updateFilter(t){this.filterConfig=this.filterConfig.map((i=>(t=this.normalizeItem(t),i.id===t.id?(n.objectToString(i)!=n.objectToString(t)&&this.calculateUpdateSequence(t),t):i))).sort(((t,i)=>this._filtersComparator(t,i)))}getAddListItems(){const t=this.filterConfig.filter((t=>!t.visible&&this.isListable(t))),i=[{name:"PERSONALIZED_FILTER",label:this.getMessage("snkFilterBar.customFilter"),iconName:"tune",kind:"FOOTER"}];return this.allowDefault&&i.push({name:"DEFAULT_FILTER",label:this.getMessage("snkFilterBar.defaultFilter"),iconName:"configuration",kind:"FOOTER"}),t.map((t=>({name:t.id,label:t.label,kind:"FILTER",iconName:null}))).concat(i)}getActiveClass(){return this.filterConfig.filter((t=>null!=t.value)).length>0?"sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active":""}isListable(t,i=!1){return t.type!==E.DEFAULT_FILTER&&(i||t.type!==E.PERSONALIZED)}getAppliedListItems(){return this.filterConfig.filter((t=>this.isActiveFilter(t)&&this.isListable(t,!0))).map((t=>({name:t.id,label:t.label,kind:"FILTER",iconName:null}))).concat([{name:"CLEAR_ALL_FILTERS",label:this.getMessage("snkFilterBar.clearAllFilters"),iconName:"cleaning",kind:"FOOTER"}])}addPersonalizedFilters(t){const i={};t.forEach((t=>{t.active&&(i[t.id]=!0)})),this.filterConfig=this.filterConfig.map((t=>{var e,s;if(t.type===E.PERSONALIZED){const r=i[t.id];return!t.visible&&r&&(this.calculateUpdateSequence(t),null!=(null===(s=null===(e=t.props)||void 0===e?void 0:e.personalizedFilter)||void 0===s?void 0:s.parameters)&&this._pendingFilters.push(t.id)),this.normalizeItem(Object.assign(Object.assign({},t),r?{visible:r}:{visible:r,value:void 0,fixed:void 0}))}return t})).sort(((t,i)=>this._filtersComparator(t,i)))}openDefaultFilterModal(){const t=document.createElement("snk-filter-modal"),i=this.filterConfig.filter((t=>t.type===E.DEFAULT_FILTER));t.getMessage=(t,i)=>this.getMessage(t,i),t.modalTitle=this.getMessage("snkFilterBar.modalDefaultFilterTitle"),t.infoText=this.getMessage(0==i.length?"snkFilterBar.modalInfoTextCreateDefault":"snkFilterBar.modalInfoTextEditDefault"),t.items=i.map((t=>({id:t.id,active:!0,enabled:!1,label:t.label}))),t.processModalAction=()=>{this._application.closeModal()},this._application.showModal(t)}openPersonalizedModal(){const t=document.createElement("snk-filter-modal"),i=this.filterConfig.filter((t=>t.type===E.PERSONALIZED)).sort(((t,i)=>d.compare(t.label,i.label)));t.getMessage=(t,i)=>this.getMessage(t,i),t.modalTitle=this.getMessage("snkFilterBar.modalPersonalizedFilterTitle"),t.modalSubTitle=this.getMessage("snkFilterBar.modalPersonalizedFilterSubTitle"),t.okButtonLabel=this.getMessage("snkFilterBar.modalOkButtonLabel"),t.cancelButtonLabel=this.getMessage("snkFilterBar.modalCancelButtonLabel"),t.infoText=this.getMessage("snkFilterBar.modalInfoTextCreateEditPersonalized"),t.useSearch=!0,t.items=i.map((t=>({id:t.id,active:t.visible,enabled:!0,label:t.label}))),t.processModalAction=i=>{i===F.CANCEL?t.items=t.items.map((t=>Object.assign(Object.assign({},t),{active:!1}))):(i===F.OK&&this.addPersonalizedFilters(t.items),this._application.closeModal())},this._application.showModal(t)}clearFilters(){let t=!1;return this.filterConfig=this.filterConfig.map((i=>(null!=i.value&&(t=!0),Object.assign(Object.assign({},i),{value:void 0})))).sort(((t,i)=>this._filtersComparator(t,i))),t}loadPermitions(){this._application.isUserSup().then((t=>this.allowDefault=t))}loadConfigFromApplication(){this._application.getFilterBarConfig(this.configName).then((t=>{this.filterConfig=t.map((t=>this.normalizeItem(t))),this.dataUnit&&this.dataUnit.loadData()})).catch((t=>{throw new h(this.getMessage("snkFilterBar.failToLoadConfig"),t)}))}attachDataUnit(){if(null==this.dataUnit){let t=this._element.parentElement;for(;t;)if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){const i=t;this.dataUnit=i.dataUnit,this.dataUnit?this.registryFilterProvider():i.addEventListener("dataUnitReady",(t=>{this.dataUnit=t.detail,this.registryFilterProvider()}));break}t=t.parentElement}else this.registryFilterProvider()}filterChangeListener(t){this.updateFilter(t.detail)}addFilterHandler(t){const i=this.filterConfig.find((i=>i.id===t));"PERSONALIZED_FILTER"===t?this.openPersonalizedModal():"DEFAULT_FILTER"===t?this.openDefaultFilterModal():i&&(this._pendingFilters.push(t),this.updateFilter(Object.assign(Object.assign({},i),{visible:!0})))}appliedFilterHandler(t){if("CLEAR_ALL_FILTERS"===t)this.clearFilters()&&this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"),{iconName:"check"});else{const i=this._element.querySelector("#filter-"+t);i&&i.showUp(!0)}}componentWillLoad(){this._application=l.getContextValue("__SNK__APPLICATION__"),this._application&&(this.loadPermitions(),this.loadConfigFromApplication()),this.attachDataUnit()}componentDidRender(){this.processPendingFilter()}render(){if(this.dataUnit&&this.filterConfig&&0!==this.filterConfig.length)return i(e,null,i("ez-scroller",{direction:"horizontal",activeShadow:!0,locked:this.scrollerLocked},this.getFilterItems()),i("snk-filter-list",{id:"APPLIED_FILTERS",onFocusin:()=>this.itemFocused("APPLIED_FILTERS"),items:this.getAppliedListItems(),getMessage:(t,i)=>this.getMessage(t,i),emptyText:this.getMessage("snkFilterBar.emptyAppliedFiltersList"),findFilterText:this.getMessage("snkFilterBar.findFilter"),iconName:"filter",class:"ez-padding-left--medium",buttonClass:this.getActiveClass(),onSnkItemSelected:t=>this.appliedFilterHandler(t.detail),"data-element-id":"apppliedFilters"}),i("snk-filter-list",{id:"ADD_FILTER",onFocusin:()=>this.itemFocused("ADD_FILTER"),items:this.getAddListItems(),label:this.getMessage("snkFilterBar.addFilter"),getMessage:(t,i)=>this.getMessage(t,i),emptyText:this.getMessage("snkFilterBar.emptyFiltersList"),findFilterText:this.getMessage("snkFilterBar.findField"),class:"ez-padding-left--medium",onSnkItemSelected:t=>this.addFilterHandler(t.detail),"data-element-id":"addFilters"},i("ez-icon",{slot:"leftIcon",class:"ez-padding-right--small",iconName:"plus"})))}get _element(){return s(this)}static get watchers(){return{filterConfig:["observeFilterConfig"]}}};B.style='.sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--most-visible, 3);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:"";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}';const j=class{constructor(i){t(this,i),this.visibleChanged=r(this,"visibleChanged",7),this.filterChange=r(this,"filterChange",7),this.innerClickCheck=(t,i)=>i.id!=c.MODAL_ELEMENT_ID||(this.detailIsVisible=!1,!1)}observeDetailIsVisible(t){this.visibleChanged.emit(t)}async showUp(t=!1){return new Promise((i=>{this._filterItemElement.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"}),t&&(this._closeCallback=i,window.requestAnimationFrame((()=>{this._floatingID=c.float(this._popover,this._popoverContainer,this.getFloatOptions()),this._popover.show(),this.detailIsVisible=!0})))}))}updatePosition(){null!=this._floatingID&&c.updateFloatPosition(this._popover,this._popoverContainer,this.getFloatOptions())}getFloatOptions(){return{autoClose:!0,innerClickTest:this.innerClickCheck,backClickListener:()=>this.onDetailCloseCallback(),left:this.getScrollOffsetLeft(),top:this.getScrollOffsetTop(),useOverlay:!0,overlayClassName:"ez-scrim ez-scrim--light",isFixed:!0}}getScrollOffsetLeft(){const t=getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");return`calc(${this._filterItemElement.getBoundingClientRect().x}px + ${t})`}getScrollOffsetTop(){const t=this._filterItemElement.getBoundingClientRect();return t.y+t.height+"px"}controlScrollPage(){window.removeEventListener("scroll",this.updatePosition.bind(this)),window.addEventListener("scroll",this.updatePosition.bind(this))}async hideDetail(){this.detailIsVisible&&null!=this._floatingID&&c.close(this._floatingID)}onDetailCloseCallback(){this._floatingID=void 0,this.detailIsVisible=!1,this._closeCallback&&(this._closeCallback(),this._closeCallback=void 0)}clickListener(t){[this._chipElement,this._leftIconElement,this._rightIconElement].includes(t.target)&&(t.target===this._rightIconElement&&null!=this.config.value?this.filterChange.emit(Object.assign(Object.assign({},this.config),{value:void 0})):this.detailIsVisible?this.hideDetail():this.showUp(!0),t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation())}mouseDownListener(t){this.detailIsVisible&&[this._chipElement,this._leftIconElement,this._rightIconElement].includes(t.target)&&(t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation())}getLabel(){const{type:t,value:i,label:e,props:s}=this.config;if(i){if(t===E.BINARY_SELECT){const[t,e]=s.options;if(t.name===i)return t.label;if(e.name===i)return e.label}if(t===E.MULTI_SELECT)return`${e}: ${s.options.find((t=>t.value===i)).label}`;if(t===E.PERIOD){let{end:t,start:s}=i;"string"==typeof t&&(t=new Date(t),t.setMinutes(t.getMinutes()+t.getTimezoneOffset())),"string"==typeof s&&(s=new Date(s),s.setMinutes(s.getMinutes()+s.getTimezoneOffset()));const r=new Intl.DateTimeFormat("pt-BR");return t&&s?`${e}: ${r.format(s)} a ${r.format(t)}`:s?`${e}: A partir de ${r.format(s)}`:t?`${e}: Até ${r.format(t)}`:e}return t===E.SEARCH?`${e}: ${i.value} - ${i.label}`:t===E.PERSONALIZED?e:`${e}: ${i}`}return e}componentDidLoad(){this._filterItemElement&&(o.addIDInfo(this._filterItemElement),this._idSnkFilterDetail=`filterDetail_${this.config.id}`),this.controlScrollPage()}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}filterChangeListener(){this.hideDetail()}getRightIconName(){return null!=this.config.value?"close":this.detailIsVisible?"chevron-up":"chevron-down"}getLeftIconName(){switch(this.config.type){case E.PERIOD:return"calendar";case E.PERSONALIZED:return"tune"}}render(){const t=this.getLeftIconName();return i(e,null,i("ez-chip",{ref:t=>this._chipElement=t,label:this.getLabel(),value:null!=this.config.value,id:this.config.id},t?i("ez-icon",{ref:t=>this._leftIconElement=t,iconName:t,class:"ez-padding-right--small",slot:"leftIcon"}):void 0,i("ez-icon",{ref:t=>this._rightIconElement=t,iconName:this.getRightIconName(),class:"ez-padding-left--small",slot:"rightIcon",id:"removeFilter"})),i("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},i("snk-filter-detail",{config:this.config,getMessage:this.getMessage,class:"sc-snk-filter-bar snk-filter__popover ez-padding--small",ref:t=>this._popover=t,key:this.config.id,"data-element-id":this._idSnkFilterDetail})))}get _filterItemElement(){return s(this)}static get watchers(){return{detailIsVisible:["observeDetailIsVisible"]}}},G=class{constructor(i){t(this,i),this.snkItemSelected=r(this,"snkItemSelected",7),this._preselection=-1,this.innerClickCheck=(t,i)=>i.id!=c.MODAL_ELEMENT_ID||(this._detailIsVisible=!1,!1)}showDetail(){this._preselection=-1,this._floatingID=c.float(this._popover,this._popoverContainer,{autoClose:!0,innerClickTest:this.innerClickCheck,backClickListener:()=>this.onListCloseCallback(),useOverlay:!0}),this._detailIsVisible=!0,this._showAll=!1,this._filterArgument="",this._filterInput.setFocus()}async hideDetail(){null!=this._floatingID&&c.close(this._floatingID)}onListCloseCallback(){this._floatingID=void 0,this._detailIsVisible=!1}buttonClick(){this._detailIsVisible?this.hideDetail():this.showDetail()}componentDidLoad(){this._element&&o.addIDInfo(this._element)}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildIdElement(t,i){if(!t)return;const e={id:i};t.removeAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME),o.addIDInfoIfNotExists(t,"filterItemList",e)}buildItemElement(t){const e=++this._selectableItemsCount;return i("button",{ref:i=>i&&this.buildIdElement(i,t.label),id:`filter-item${e}`,onFocusin:()=>this._preselection=e,class:"ez-col ez-col--sd-12 ez-align--middle ez-padding--small sc-snk-filter-bar snk-filter-bar__filter-list-item",onClick:()=>this.itemSelected(t.name),name:t.label,key:e},t.iconName?i("ez-icon",{iconName:t.iconName,size:"small",class:`ez-padding-right--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__icon ${t.iconClass||""}`}):void 0,i("div",{class:`ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-item__label ${t.labelClass||""}`},t.label))}itemSelected(t){"__SHOWMORE__"===t?this._showAll=!0:(this.hideDetail(),this.snkItemSelected.emit(t))}getFilterItems(){const t=this.items?u.applyStringFilter(this._filterArgument,this.items.filter((t=>"FILTER"===t.kind))):[];return 0===t.length?i("div",{class:"ez-text ez-text--medium ez-text--primary ez-padding--extra-small sc-snk-filter-bar snk-filter-bar__filter-list-items-container--empty"},this.emptyText):(!this._filterArgument&&!this._showAll&&t.length>6&&(t.splice(5),t.push({kind:"INTERNAL",label:"Mostrar mais",iconName:"dots-horizontal",name:"__SHOWMORE__",iconClass:"snk-filter-bar__filter-list-item__icon--secondary",labelClass:"snk-filter-bar__filter-list-item__label--secondary"})),this._selectableItemsCount=0,i("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-list-items-container"},t.map((t=>this.buildItemElement(t)))))}getFooterItems(){return this.items.filter((t=>"FOOTER"===t.kind))}keyDownHandler(t){switch(t.key){case"ArrowDown":this.changePreselection(this._preselection+1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault();break;case"ArrowUp":this.changePreselection(this._preselection-1),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()}}changePreselection(t){if(t<0&&(t=this._selectableItemsCount),this._preselection=t>this._selectableItemsCount?0:t,0===this._preselection)this._filterInput.setFocus();else{const t=this._element.querySelector(`#filter-item${this._preselection}`);t&&t.focus()}}render(){return i(e,{class:"ez-flex ez-flex--column"},i("ez-button",{class:this.buttonClass,label:this.label,onClick:()=>this.buttonClick(),mode:this.iconName?"icon":void 0,iconName:this.iconName,size:"small"},i("slot",{name:"leftIcon"})),i("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},i("div",{class:"sc-snk-filter-bar snk-filter__popover ez-padding--small",ref:t=>this._popover=t},i("ez-filter-input",{ref:t=>this._filterInput=t,"data-element-id":"serachFilters",mode:"slim",label:this.findFilterText,value:this._filterArgument,onEzChange:t=>this._filterArgument=t.detail,onFocus:()=>this._preselection=0}),this.getFilterItems(),i("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),this.items?this.getFooterItems().map((t=>this.buildItemElement(t))):void 0)))}get _element(){return s(this)}},M=class{constructor(i){t(this,i)}updateValue(t,i){this.items=this.items.map((e=>e.id===t&&e.enabled?(null==i&&(i=!e.active),Object.assign(Object.assign({},e),{active:i})):e))}getActiveFiltersMsg(){const t=this.items.filter((t=>t.active)).length;return 0===t?this.getMessage("snkFilterBar.noActiveFilters"):this.getMessage(t>1?"snkFilterBar.activeFilters":"snkFilterBar.activeFilter",{ACTIVE_FILTERS:t})}buildItems(t){return t.map((t=>i("button",{onClick:()=>this.updateValue(t.id),class:"ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small"},i("ez-check",{id:`checkbox_${t.id}`,tabIndex:"-1",class:"sc-snk-filter-bar snk-filter-bar__filter-modal-item__check",onEzChange:i=>this.updateValue(t.id,i.detail),enabled:t.enabled,value:t.active,mode:g.SWITCH}),i("div",{class:"ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label"},t.label))))}itemKeyBoardSelect(t,i){"Enter"!==t.key&&" "!==t.key||this.updateValue(i.id)}modalActionListener(t){const i=t.detail;i===F.LOAD?this._filterInput&&this._filterInput.setFocus():this.processModalAction(i)}render(){const t=this.items.filter((t=>t.active)).length>0,e=this.items?u.applyStringFilter(this._filterArgument,this.items):[];return i("ez-modal-container",{class:"snk-filter__modal-container",modalTitle:this.modalTitle,modalSubTitle:this.modalSubTitle,cancelButtonLabel:this.cancelButtonLabel,okButtonLabel:this.okButtonLabel,onEzModalAction:t=>this.modalActionListener(t),cancelButtonStatus:t?D.ENABLED:D.DISABLED},i("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-modal-content"},i("div",null,this.useSearch?i("ez-filter-input",{ref:t=>this._filterInput=t,label:this.getMessage("snkFilterBar.modalFindFilter"),onEzChange:t=>this._filterArgument=t.detail}):void 0),e.length>0?i("div",{class:"ez-text ez-text--medium ez-text--primary ez-padding-bottom--small"},this.getActiveFiltersMsg()):void 0,i("div",null,this.buildItems(e)),i("div",{class:"ez-text ez-text--large ez-align--middle ez-text--secondary ez-text--center ez-padding-bottom--large"},this.infoText)))}};M.style=".snk-filter__modal-container{width:359px;max-width:359px}";const U=class{constructor(i){t(this,i),this.configChange=r(this,"configChange",7),this.configCancel=r(this,"configCancel",7),this._orderListItems=[],this._orderPriorityList=[],this._columListItems=[],this._selectedIndex=-1,this._dataChanged=!1,this._componenteInternalKey=Date.now(),this.selectedIndex=0}async saveConfig(t){var i;null!=t&&null!=(null===(i=this.application)||void 0===i?void 0:i.configName)&&C.saveGridConfig(t,this.application.configName).then((i=>{null!=(null==i?void 0:i.resource)&&(this.configChange.emit(t),this._orderList.clearHistory())}))}getMessage(t,i){return this.application.messagesBuilder.getMessage(t,i)}createOrderList(){let t=[];this.columns.filter((t=>{var i;return d.getBooleanValue(null===(i=null==t?void 0:t.props)||void 0===i?void 0:i.get("sortable"),!0)})).forEach((i=>{var e;let s=null===(e=this.config)||void 0===e?void 0:e.columns.find((t=>t.name===i.name)),r={name:i.name,label:i.label};s&&(r.orderIndex=s.orderIndex,r.ascending=s.ascending),i.hidden||t.push(r)})),t.sort(((t,i)=>0!=t.orderIndex||0!=i.orderIndex||null==t.ascending&&null==i.ascending?null!=t.ascending&&null!=i.ascending?t.orderIndex-i.orderIndex:null!=t.ascending||null!=i.ascending?null!=t.ascending?-1:null!=i.ascending?1:0:t.orderIndex-i.orderIndex:null!=t.ascending?-1:null!=i.ascending?1:0)),this._orderListItems=t}createColumnList(){let t={group:this.getMessage("snkGridConfig.group.visible"),items:[]},i={group:this.getMessage("snkGridConfig.group.hidden"),items:[],sort:w.asc.value};this.columns.forEach((e=>{let s={label:e.label};e.hidden?i.items.push(s):t.items.push(s)})),this._columListItems=[t,i]}buildColumnListSlot(t,e){const s=`configItem_${d.replaceAccentuatedChars(d.toCamelCase(t.label))}`;return i("div",null,i("ez-check",{mode:"switch",id:"switch"+((null==t?void 0:t.label)||"")+((null==e?void 0:e.group)||""),value:e.group===this.getMessage("snkGridConfig.group.visible"),"data-element-id":s,onEzChange:i=>{this.switchColumnGroup(i,t)}}))}buildOrderListSlot(t){const e=`${this._element.getAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_configItem_${d.toCamelCase(t.label)}`;let s=w.none.value;return null!=(null==t?void 0:t.ascending)&&(s=1==t.ascending?w.asc.value:w.desc.value),i("div",null,i("snk-select-box",{selectedOption:s,key:"snk-select-box-"+this._componenteInternalKey+"-"+t,"data-element-id":e,onEzChange:i=>{i.stopPropagation(),this.updateOrder(i.detail,t.label)}}))}updateOrder(t,i){var e;this._dataChanged=!0;let s,r=[...this.columns],n=r.find((t=>t.label===i));n&&(n.sort=t.value===w.none.value?void 0:t.value),(null===(e=this._orderPriorityList)||void 0===e?void 0:e.length)>0?(this._orderPriorityList.find((t=>t.label===n.label)).sort=t,this._orderPriorityList.filter((t=>t.sort)).map(((t,i)=>{t.label===n.label&&(n.sortIndex=i)}))):(s=r.filter((t=>t.sort&&!0!==t.hidden)).map(((t,i)=>({label:t.label,orderIndex:i}))),s.forEach((t=>{r.find((i=>i.label===t.label)).sortIndex=t.orderIndex}))),this.columns=r}switchColumnGroup(t,i){t.stopPropagation();let e=[...this._columListItems];if(this._dataChanged=!0,!0===t.detail){let t=e.find((t=>t.group===this.getMessage("snkGridConfig.group.hidden"))),s=t.items.findIndex((t=>t.label===i.label));s>=0&&t.items.splice(s,1),e.find((t=>t.group===this.getMessage("snkGridConfig.group.visible"))).items.push(i),this._columListItems=e,this.createOrderList()}else if(!1===t.detail){let t=e.find((t=>t.group===this.getMessage("snkGridConfig.group.visible"))),s=t.items.findIndex((t=>t.label===i.label));s>=0&&t.items.splice(s,1),e.find((t=>t.group===this.getMessage("snkGridConfig.group.hidden"))).items.push(i),this._columListItems=e,this.createOrderList()}}finish(){if(!this._dataChanged)return void this.closeConfig();let t=[];this._columListItems.forEach((i=>{i.items.forEach((e=>{const s=this.columns.find((t=>t.label===e.label));let r=Object.assign({},s);r.hidden=i.group===this.getMessage("snkGridConfig.group.hidden"),t.push(r)}))})),this.columns=t,this._dataChanged=!1,this.closeConfig(),this.save()}save(){var t;let i;i=this.config?this.config:this.createConfigFromState(this.columns);let e,s=[];if((null===(t=this._orderPriorityList)||void 0===t?void 0:t.length)>0){e=this.columns.filter((t=>t.sort&&!0!==t.hidden)).map((t=>({label:t.label,orderIndex:0})));let t=0,i=[];this._orderPriorityList.forEach((s=>{let r=e.find((t=>t.label===s.label));r&&(r.orderIndex=t,i.push(r),t++)})),i.length>0&&(e=i)}for(let t=0;t<this.columns.length;t++){const n=this.columns[t];let l=i.columns.find((t=>n.name===t.name));!0===n.hidden&&l||(l?l.width=n.width:!1===n.hidden&&(l={name:n.name,width:n.width,orderIndex:0}),l&&(n.sort?(l.ascending=n.sort.toUpperCase()===w.asc.value,e?r(n,l):l.orderIndex=n.sortIndex):(delete l.ascending,l.orderIndex=0),s.push(l)))}function r(t,i){if(e){let s=e.find((i=>i.label===t.label));s&&(i.orderIndex=s.orderIndex)}}i.columns=s,this.saveConfig(i).then((()=>{f.info(this.getMessage("snkGridConfig.info.successfullyConfigSaved"),{iconName:"check"})}))}createConfigFromState(t){let i={columns:[]};return t.forEach((t=>{if(!t.hidden){let e={name:t.name};t.width&&(e.width=t.width),t.sort?(e.ascending=t.sort.toUpperCase()===w.asc.value,e.orderIndex=t.sortIndex):e.orderIndex=0,e&&i.columns.push(e)}})),i}async locateColumn(t,i){var e;const s="Enter"===t.key;i||(i=null===(e=t.currentTarget)||void 0===e?void 0:e.value);let r=-1;if(1===this.selectedIndex)if(i){const t=[];let e,n;if(await this._orderList.getList().then((s=>{e=s,e.forEach(((e,s)=>{this.compareWords(e,i)&&t.push(s)}))})),t.length>0){if(s)for(let i=0;i<t.length;i++)if(t[i]>this._selectedIndex){r=t[i];break}-1===r&&(r=t[0])}this._selectedIndex=r,n=e[r],n?this._orderList.setSelection({label:n.label},!0):this._orderList.setSelection(void 0)}else this._orderList.setSelection(void 0);else if(i){const t=[];if(this.columns.forEach(((e,s)=>{this.compareWords(e,i)&&t.push(s)})),t.length>0){if(s)for(let i=0;i<t.length;i++)if(t[i]>this._selectedIndex){r=t[i];break}-1===r&&(r=t[0])}this._selectedIndex=r;let e=this.columns[r];e?this._columnList.setSelection({label:e.label},!0):this._columnList.setSelection(void 0)}else this._columnList.setSelection(void 0)}compareWords(t,i){return d.replaceAccentuatedChars(t.label).indexOf(d.replaceAccentuatedChars(i))>-1}getColumnNames(){const t=[];return t.push(this.getMessage("snkGridConfig.tab.columns")),t.push(this.getMessage("snkGridConfig.tab.lineOrdering")),t.join(",")}closeConfig(){if(this._orderList.scrollToTop(),this._columnList.scrollToTop(),this._searchElement.value="",this._dataChanged){let t={canClose:!1,labelCancel:this.getMessage("snkGridConfig.confirm.cancel"),labelConfirm:this.getMessage("snkGridConfig.confirm.save"),btnConfirmDanger:!1};f.confirm(this.getMessage("snkGridConfig.confirm.alert"),this.getMessage("snkGridConfig.confirm.msgCancel"),null,m.WARN,t).then((t=>{t?this.finish():(this._dataChanged=!1,this.configCancel.emit(),this._orderList.clearHistory(),this._componenteInternalKey=Date.now())}))}else this.configCancel.emit(),this._orderList.clearHistory()}handleTabChange(t){null!=(null==t?void 0:t.index)&&(this.selectedIndex!==t.index&&(0===t.index?this._orderList.scrollToTop():1===t.index&&this._columnList.scrollToTop(),this._searchElement.value=""),1===t.index&&this.createOrderList(),this.selectedIndex=t.index)}handleColumnListChange(t){var i;if(t.detail){let e=null===(i=t.detail.find((t=>t.group===this.getMessage("snkGridConfig.group.visible"))))||void 0===i?void 0:i.items;e&&(this._dataChanged=!0,this._orderListItems=e)}}handleOrderListChange(t){if(t.detail){let i=t.detail;i&&(this._dataChanged=!0,this._orderPriorityList=i)}}componentWillRender(){var t;(null===(t=this.columns)||void 0===t?void 0:t.length)>0&&this.createColumnList()}componentDidRender(){var t;(null===(t=this.columns)||void 0===t?void 0:t.length)>0&&this.locateColumn(new KeyboardEvent("arrow-right",{key:"ArrowRight"}),this._searchElement.value)}componentDidLoad(){o.addIDInfo(this._element)}render(){return i(e,null,i("div",{class:"grid-config__header"},i("div",{class:"title-container"},i("div",{class:""},i("label",{class:"title"},this.getMessage("snkGridConfig.gridConfiguration")),i("label",{class:"subtitle"},this.getMessage("snkGridConfig.columnVisibilityOrder"))),i("div",{class:"button-close"},i("ez-button",{mode:"icon",iconName:"close",size:"medium",onClick:()=>this.closeConfig()}))),i("div",{class:"tabselector-container"},i("ez-tabselector",{selectedIndex:this.selectedIndex,onEzChange:t=>{this.handleTabChange(t.detail)},tabs:this.getColumnNames()})),i("div",null,i("ez-text-input",{"data-element-id":"searchColums",ref:t=>this._searchElement=t,label:this.getMessage("snkGridConfig.findColumn"),onKeyUp:t=>this.locateColumn(t)},i("ez-icon",{slot:"leftIcon",size:"medium",iconName:"search"})))),i("div",{class:"grid-config__main"},i("ez-list",{ref:t=>this._columnList=t,class:0===this.selectedIndex?"":"hidden",dataSource:this._columListItems,onEzChange:t=>this.handleColumnListChange(t),ezDraggable:!0,ezSelectable:!0,itemSlotBuilder:(t,i)=>this.buildColumnListSlot(t,i),useGroups:!0,"data-element-id":"configCols"}),i("div",{class:1===this.selectedIndex?"group-name":"hidden"},this.getMessage("snkGridConfig.info.sortingSequence")),i("ez-list",{ref:t=>this._orderList=t,class:1===this.selectedIndex?"height-calc":"hidden",dataSource:this._orderListItems,ezSelectable:!0,onEzChange:t=>this.handleOrderListChange(t),ezDraggable:!0,itemSlotBuilder:t=>this.buildOrderListSlot(t),"data-element-id":"configDataOrder"})),i("div",{class:"grid-config__footer"},i("ez-button",{class:"padding-right--medium",label:this.getMessage("snkGridConfig.cancel"),onClick:()=>this.closeConfig()}),i("ez-button",{label:this.getMessage("snkGridConfig.complete"),class:"ez-button--primary",onClick:()=>this.finish()})))}static get assetsDirs(){return["../assets"]}get _element(){return s(this)}};U.style='.sc-snk-grid-config-h{--snk-grid-config__footer--padding-top:var(--space--medium, 12px);--snk-grid-config__main--padding-right:var(--space--medium, 12px);--snk-grid-config__tabselector-container--padding:var(--space--medium, 12px);--snk-grid-config__button-close--padding-left:var(--space--medium, 12px);--snk-grid-config__title--color:var(--title--primary, #2B3A54);--snk-grid-config__title--font-family:var(--font-pattern, "Roboto");--snk-grid-config__title--font-size:var(--title--large, 20px);--snk-grid-config__title--font-weight:var(--text-weight--extra-large, 700);--snk-grid-config__subtitle--font-family:var(--font-pattern, "Roboto");--snk-grid-config__subtitle--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-family:var(--font-pattern, "Roboto");--snk-grid-config__group--font-size:var(--text--medium, 14px);--snk-grid-config__group--font-weight:var(--text-weight--large, 600);--snk-grid-config__group--padding-bottom:var(--space-small, 6px);--snk-grid-config__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-grid-config__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-grid-config__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-grid-config__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-grid-config__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-grid-config__scrollbar--width:var(--space--medium, 12px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-snk-grid-config-h{width:359px;max-width:359px}}.padding-right--medium.sc-snk-grid-config{padding-right:var(--space--medium)}ez-list.sc-snk-grid-config{height:100%}.height-calc.sc-snk-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-snk-grid-config{display:flex;justify-content:flex-end;width:100%;padding-top:var(--snk-grid-config__footer--padding-top)}.hidden.sc-snk-grid-config{display:none}.tabselector-container.sc-snk-grid-config{padding:var(--snk-grid-config__tabselector-container--padding) 0}.button-close.sc-snk-grid-config{padding-left:var(--snk-grid-config__button-close--padding-left)}.title-container.sc-snk-grid-config{display:flex;justify-content:space-between;align-items:center;width:100%}.title.sc-snk-grid-config{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-grid-config__title--color);font-size:var(--snk-grid-config__title--font-size);font-family:var(--snk-grid-config__title--font-family);font-weight:var(--snk-grid-config__title--font-weight)}.subtitle.sc-snk-grid-config{color:var(--text--primary);font-size:var(--snk-grid-config__subtitle--font-size);font-family:var(--snk-grid-config__subtitle--font-family)}.grid-config__main.sc-snk-grid-config{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-grid-config__scrollbar--color-clicked) var(--snk-grid-config__scrollbar--color-background);padding-right:var(--snk-grid-config__main--padding-right)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar{width:var(--snk-grid-config__scrollbar--width);max-width:var(--snk-grid-config__scrollbar--width);min-width:var(--snk-grid-config__scrollbar--width);background-color:var(--snk-grid-config__scrollbar--color-background)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-track{background-color:var(--snk-grid-config__scrollbar--color-background);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb{background-color:var(--snk-grid-config__scrollbar--color-default);border-radius:var(--snk-grid-config__scrollbar--border-radius)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:hover,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-grid-config__scrollbar--color-hover)}.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:vertical:active,.grid-config__main.sc-snk-grid-config::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-grid-config__scrollbar--color-clicked)}.group-name.sc-snk-grid-config{font-family:var(--snk-grid-config__group--font-family);font-size:var(--snk-grid-config__group--font-size);font-weight:var(--snk-grid-config__group--font-weight);padding-bottom:var(--snk-grid-config__group--padding-bottom)}';const K=class{constructor(i){t(this,i),this.ezChange=r(this,"ezChange",7),this.selectedOption=w.none}render(){return i("ez-combo-box",{class:"grid-config-combo ez-input--inverted",label:"",suppressSearch:!0,value:this.selectedOption,enabled:!0,canShowError:!1,suppressEmptyOption:!0},Object.keys(w).map((t=>i("option",{value:w[t].value},w[t].label))))}static get assetsDirs(){return["../assets"]}};K.style="ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";const W=class{constructor(i){t(this,i),this.actionClick=r(this,"actionClick",7),this.presentationMode=v.PRIMARY,this._titleKeyByElement={[L.UPDATE]:"snkTaskbar.titleUpdate",[L.PREVIOUS]:"snkTaskbar.titlePrevious",[L.NEXT]:"snkTaskbar.titleNext",[L.REFRESH]:"snkTaskbar.titleRefresh",[L.CLONE]:"snkTaskbar.titleClone",[L.REMOVE]:"snkTaskbar.titleRemove",[L.MORE_OPTIONS]:"snkTaskbar.titleMoreOptions",[L.INSERT]:"snkTaskbar.titleInsert",[L.CANCEL]:"snkTaskbar.titleCancel",[L.SAVE]:"snkTaskbar.titleSave",[L.GRID_MODE]:"snkTaskbar.titleGridMode",[L.FORM_MODE]:"snkTaskbar.titleFormMode",[L.CONFIGURATOR]:"snkTaskbar.titleConfigurator"}}observeButtons(){this._definitions=void 0}elementsFromString(t){const i=[];return null==t||t.split(",").forEach((t=>{t=t.trim(),(O[t]||this.isAllowed(t))&&i.push(t.trim())})),i}isAllowed(t){return t===S.CONFIGURATOR?!!this._permissions&&(this._permissions.isSup||this._permissions[I.CONFIG_GRID]||this._permissions[I.CONFIG]):!S[t]||!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getTitle(t){let i;return i=this.isAllowed(t)?this._titleKeyByElement[t]:"snkTaskbar.forbidden",i?this._application.messagesBuilder.getMessage(i,{}):""}elementClick(t){if(this.dataUnit)switch(t){case L.PREVIOUS:this.dataUnit.previousRecord();break;case L.NEXT:this.dataUnit.nextRecord();break;case L.REFRESH:this.dataUnit.loadData();break;case L.CLONE:this.dataUnit.copySelected();break;case L.REMOVE:this.dataUnit.removeSelectedRecords();break;case L.INSERT:this.dataUnit.addRecord();break;case L.CANCEL:this.dataUnit.cancelEdition();break;case L.SAVE:this.dataUnit.saveData()}this.actionClick.emit(t)}isEnabled(t){return!(!this.isAllowed(t)||this.disabledButtons&&this.disabledButtons.includes(t))}validatePresentationMode(){Object.values(v).includes(this.presentationMode)||(this.presentationMode=v.PRIMARY)}getElement(t,i){let e=i===this.primaryButton?"ez-button--primary ":"";return t>1&&(e+="ez-padding-left--medium"),L[i.toString()]?A(i,e,this.getIdElemBtnNative(i),(t=>this.getTitle(t)),(t=>this.elementClick(t)),(t=>this.isEnabled(t)),this.actionsList,this.configName,this.presentationMode):N(i,e,this.getIdElemBtnCustom(i),(t=>this.elementClick(t)),(t=>this.isEnabled(t)))}getIdElemBtnNative(t){return d.toCamelCase(t)}getIdElemBtnCustom(t){return d.toCamelCase(t.name)}isDivider(t){var i;return void 0!==t&&(null===(i=t.t)||void 0===i?void 0:i["data-taskbar-divider"])}removeEmpty(t){let i;return t.filter((t=>!(null==t||this.isDivider(i)&&this.isDivider(t)||(i=t,0))))}componentWillLoad(){this._application=l.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess().then((t=>this._permissions=t)):this._permissions={}}componentWillRender(){null==this._definitions&&this._permissions&&(this._definitions=this.elementsFromString(this.buttons)),this.validatePresentationMode()}componentDidLoad(){o.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}render(){if(void 0===this._definitions)return;let t=0;return i(e,null,this.removeEmpty(this._definitions.map((e=>(e===L.DIVIDER?t=0:t++,L[e]?this.getElement(t,L[e]):this.customButtons.has(e)?this.getElement(t,this.customButtons.get(e)):i("slot",{name:e}))))))}get _element(){return s(this)}static get watchers(){return{buttons:["observeButtons"]}}};W.style=".sc-snk-taskbar-h{display:flex}";export{R as snk_data_exporter,B as snk_filter_bar,j as snk_filter_item,G as snk_filter_list,M as snk_filter_modal,U as snk_grid_config,K as snk_select_box,W as snk_taskbar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,F as a,H as n,g as s}from"./p-a77dd79a.js";import{d as c}from"./p-b6d6b172.js";import{ApplicationContext as e,ElementIDUtils as b}from"@sankhyalabs/core";import{C as r,K as l,b as g,T as f}from"./p-b4093344.js";import"./p-112455b1.js";const h=class{constructor(o){t(this,o),this.ezTabChange=i(this,"ezTabChange",7),this.editionTitleTab=i(this,"editionTitleTab",7),this.deleteTab=i(this,"deleteTab",7),this.hideTab=i(this,"hideTab",7),this.ezOrderChange=i(this,"ezOrderChange",7),this.canStartDrag=i(this,"canStartDrag",7),this._refTabActions=[],this._actionsHide=[],this._actionsShow=[]}getMessage(t,i){return this._application.messagesBuilder.getMessage(t,i)}controlSortableTab(){this._sortableTab&&this._sortableTab.destroy(),this._sortableTab=new c.Sortable(this._hostElem.querySelectorAll('[data-draggable-parent="tab"]'),{draggable:'[data-draggable-element="tab"]',mirror:{constrainDimensions:!0}}),this._sortableTab.on(r.dragStart,(t=>this.controlStartDraggingTab(t))),this._sortableTab.on(r.dragStop,(t=>this.controlStopDraggingTab(t)))}controlStartDraggingTab(t){var i,o;const a=null===(i=null==t?void 0:t.dragEvent)||void 0===i?void 0:i.originalEvent,n=null==a?void 0:a.target,s=null===(o=null==n?void 0:n.tagName)||void 0===o?void 0:o.toUpperCase();!0===this._activeEditText||"EZ-ACTIONS-BUTTON"===s?null==t||t.cancel():this.canStartDrag.emit()}controlStopDraggingTab(t){t.data.newIndex!==t.data.oldIndex&&setTimeout((()=>{this.ezOrderChange.emit((t.data.newIndex||0)+1)}),500)}handleTabClick(t){this.selectedIndex=t.index,this._focusedIndex=t.index,this.selectedTab=t.tabKey,this.ezTabChange.emit(t),this.setFocusedBtn(!1,t.index),this.setFocusedTab(t.index)}handleSlotChange(t){const i=t.target.assignedElements()[0];i&&i.classList.add("tab-config__slot")}scrollBackward(){const t=this._scrollContainer;t&&(t.scrollLeft-=t.clientWidth)}scrollFoward(){const t=this._scrollContainer;if(t){let i=null;t.querySelectorAll(".tab-config__tab").forEach((o=>{o.getBoundingClientRect().right<t.clientWidth&&(i=o)})),t.scrollLeft=i.offsetLeft+i.offsetWidth}}updateScroll(){const t=this._scrollContainer;if(t){const{scrollWidth:i,clientWidth:o,scrollLeft:a}=t,n=i-o-Math.ceil(a);this._startHidden=t.scrollLeft>0,this._endHidden=n>0,this._startHidden?this._backwardButton.classList.remove("tab-config__hidden"):this._backwardButton.classList.add("tab-config__hidden"),this._endHidden?this._forwardButton.classList.remove("tab-config__hidden"):this._forwardButton.classList.add("tab-config__hidden")}}domScrollHandler(){window.clearTimeout(this._scrollCallBackScroll),this._scrollCallBackScroll=window.setTimeout((()=>{this.updateScroll()}),200)}setFocusedTab(t){window.clearTimeout(this._scrollCallBackFocus),this._scrollCallBackFocus=window.setTimeout((()=>{this._scrollContainer.querySelector(`#tab${t}`).scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}),200)}controlKeyEventEnter(t){t.preventDefault();const i=this._processedTabs[this._focusedIndex];this.handleTabClick(i),this.setFocusedTab(i.index)}controlKeyEventArrow(t){let i;if(t.key===l.arrowLeft)i=!1;else{if(t.key!==l.arrowRight)return;i=!0}this._focusedIndex=void 0===this._focusedIndex?!1===i?void 0!==this.selectedIndex?this.selectedIndex-1:void 0:void 0!==this.selectedIndex?this.selectedIndex+1:void 0:!1===i?this._focusedIndex-1:this._focusedIndex+1,this._focusedIndex<0?this._focusedIndex=0:this._focusedIndex>this._processedTabs.length-1&&(this._focusedIndex=this._processedTabs.length-1),this.setFocusedBtn(!0,this._focusedIndex),this.setFocusedTab(this._focusedIndex)}controlKeyEventEscape(t){t.preventDefault();const i=this._processedTabs[this.selectedIndex];this._focusedIndex=void 0,this.handleTabClick(i),this.setFocusedTab(this.selectedIndex)}setFocusedParam(t){!0!==this._activeEditText&&null!=t&&(t.key!==l.enter?t.key!==l.arrowLeft&&t.key!==l.arrowRight?t.key!==l.tab&&t.key!==l.escape||this.controlKeyEventEscape(t):this.controlKeyEventArrow(t):this.controlKeyEventEnter(t))}setFocusedBtn(t,i){this._scrollContainer.querySelectorAll(".tab-config__tab").forEach((o=>{o.classList.remove("tab-config__tab--is-focused"),o.id==="tab"+i&&t&&o.classList.add("tab-config__tab--is-focused")}))}getStyledLabel(t){const i=this._hostElem.querySelector(`#${t}`);if(null!=i)return{fontSize:window.getComputedStyle(i).getPropertyValue("font-size"),fontWeight:window.getComputedStyle(i).getPropertyValue("font-weight"),fontFamily:window.getComputedStyle(i).getPropertyValue("font-family")}}cancelEditText(){var t;this._activeEditText=!1,null!=this._scrollContainer&&(null===(t=this._scrollContainer.querySelector(".tab-config__tab--is-active"))||void 0===t||t.focus())}handleActions(t,i){const{value:o}=t.detail;o===g.rename?(this._activeEditText=!0,this._activeEditTextIndex=i.index):o===g.hide||o===g.show?this.hideTab.emit(i):o===g.delete&&this.deleteTab.emit(i)}handleSaveEditionText(t){const{value:i,newValue:o}=t.detail;this._processedTabs.forEach((a=>{a.label===i&&(a.label=o,this.cancelEditText(),this.editionTitleTab.emit(t))}))}onHideActions(t){const i=this._refTabActions[t];i&&i.isOpened().then((t=>{t&&(null==i||i.hideActions())}))}componentWillLoad(){this._application=e.getContextValue("__SNK__APPLICATION__"),null!=this._application&&(this._actionsHide=[{value:g.rename,label:this.getMessage("snkTabConfig.labelRename")},{value:g.hide,label:this.getMessage("snkTabConfig.labelHide")},{value:g.delete,label:this.getMessage("snkTabConfig.labelDelete")}],this._actionsShow=[{value:g.rename,label:this.getMessage("snkTabConfig.labelRename")},{value:g.show,label:this.getMessage("snkTabConfig.labelShow")},{value:g.delete,label:this.getMessage("snkTabConfig.labelDelete")}])}componentWillRender(){null==this._processedTabs&&(this._processedTabs=[],this.tabs&&this.tabs.split(",").forEach((t=>{t=t.trim(),this._processedTabs.push({label:t,tabKey:t,index:this._processedTabs.length})})),this._hostElem.querySelectorAll("snk-tab").forEach((t=>{const i=t.getAttribute("tabKey"),o=t.getAttribute("label")!==f.main?t.getAttribute("label"):this.getMessage("snkFormConfig.form.mainArea"),a=t.hasAttribute("visible"),n={label:o,tabKey:i,index:this._processedTabs.length,visible:a},s=t.firstChild;s&&(s.setAttribute("slot","tab"+n.index),this._hostElem.appendChild(s)),this._processedTabs.push(n)})))}componentDidRender(){this.updateScroll(),this.controlSortableTab()}componentDidLoad(){b.addIDInfo(this._hostElem,"itemConfig"),this._processedTabs.forEach(((t,i)=>{const o={id:t.label};b.addIDInfo(this._hostElem.querySelector(`#tab${i}`),"itemConfig",o)}))}render(){return o(n,null,o("button",{class:"tab-config__backward-button",ref:t=>this._backwardButton=t,onClick:()=>this.scrollBackward()}),o("div",{class:"tab-config__lower-bar"}),o("div",{class:"tab-config__scroll",ref:t=>this._scrollContainer=t,onScroll:()=>this.domScrollHandler(),onKeyDown:t=>this.setFocusedParam(t),"data-draggable-parent":"tab"},this._processedTabs.map(((t,i)=>{const n="tab"+i,s=i===this.selectedIndex||this.selectedTab&&t.tabKey===this.selectedTab;return s&&(this.selectedTab=t.tabKey,this.selectedIndex=i),o("button",{id:n,class:"tab-config__tab"+(s?" tab-config__tab--is-active":""),onClick:()=>this.handleTabClick(t),onDblClick:()=>{this._activeEditText=!0,this._activeEditTextIndex=i},"data-draggable-element":i>0?"tab":"",onMouseLeave:()=>this.onHideActions(i)},!0===this._activeEditText&&this._activeEditTextIndex===i&&i>0||o(a,null,i>0&&o("ez-icon",{iconName:t.leftIcon||"drag-indicator",class:"tab-config__left-icon"}),!1===t.visible&&i>0&&o("ez-icon",{iconName:t.leftIcon||"eye-off",class:"tab-config__left-icon tab-config__left-icon--eye-off"}),o("span",{class:"tab-config__tab-label"+(!1===t.visible&&i>0?" tab-config__tab-label-disabled":""),title:t.label},t.label),i>0&&o("ez-actions-button",{class:"tab-config__actions-button",size:"small",ref:t=>this._refTabActions[i]=t,actions:!1===t.visible?this._actionsShow:this._actionsHide,isTransparent:!0,arrowActive:!0,onEzAction:i=>this.handleActions(i,t)}),o("slot",{name:n,onSlotchange:t=>{this.handleSlotChange(t)}})),!0===this._activeEditText&&i>0&&this._activeEditTextIndex===i&&o("ez-text-edit",{value:t.label,styled:this.getStyledLabel(n),class:"tab-config__edit-text",onSaveEdition:t=>this.handleSaveEditionText(t),onCancelEdition:()=>this.cancelEditText()}))}))),o("button",{class:"tab-config__forward-button",ref:t=>this._forwardButton=t,onClick:()=>this.scrollFoward()}))}get _hostElem(){return s(this)}};h.style='@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}.sc-snk-tab-config-h{--snk-tab-config--backward-icon:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z"/></svg>\');--snk-tab-config--forward-icon:url(\'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>\');--snk-tab-config__lower-bar--background-color:var(--color--disable-primary, #e5eaf0);--snk-tab-config__lower-bar--border:2px solid var(--color--disable-primary, #e5eaf0);--snk-tab-config__tab--color:var(--text--primary, #626e82);--snk-tab-config__tab--font-family:var(--font-pattern, "Roboto");--snk-tab-config__tab--font-size:var(--title--small, 14px);--snk-tab-config__tab--padding:var(--space--small, 6px) var(--space--medium, 12px);--snk-tab-config__tab-is-active--color:var(--color--primary, #008561);--snk-tab-config__tab-hover--color:var(--color--secondary, #383c45);--snk-tab-config__tab-is-focused--border:1px dashed var(--color--primary, #008561);--snk-tab-config__tab-label--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--snk-tab-config__tab-label--margin-bottom:var(--space--extra-small, 3px);--snk-tab-config__new-button-icon--color:var(--color--secondary-700, #1C1D22);--snk-tab-config__forward-button--background-color:var(--text--primary, #626e82);--snk-tab-config__forward-button-hover--background-color:var(--color--primary, #008561);--snk-tab-config__left-icon--padding-right:var(--space--small, 6px);--snk-tab-config__left-icon--color:var(--text--disable, #AFB6C0);--snk-tab-config__tab-label-disabled--color:var(--text--disable, #AFB6C0);--snk-tab-config__slot--margin-left:var(--space--small, 6px);display:flex;position:relative;width:100%;overflow:hidden}.tab-config__scroll.sc-snk-tab-config{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.tab-config__lower-bar.sc-snk-tab-config{position:absolute;left:0%;right:0%;top:91%;bottom:0%;border-radius:2px;background-color:var(--snk-tab-config__lower-bar--background-color);border:var(--snk-tab-config__lower-bar--border)}.tab-config__tab.sc-snk-tab-config{display:flex;border:none;background-color:unset;cursor:pointer;align-items:center;justify-content:center;min-width:fit-content;color:var(--snk-tab-config__tab--color);font-family:var(--snk-tab-config__tab--font-family);font-size:var(--snk-tab-config__tab--font-size);padding:var(--snk-tab-config__tab--padding)}.tab-config__tab.sc-snk-tab-config:focus,.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{outline:none}.tab-config__tab--is-active.sc-snk-tab-config{position:relative;color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover{color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-active.sc-snk-tab-config::after{content:"";position:absolute;width:100%;height:100%;clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out;background-color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab--is-focused.sc-snk-tab-config{border:var(--snk-tab-config__tab-is-focused--border)}.tab-config__tab-label.sc-snk-tab-config{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--snk-tab-config__tab-label--text-shadow);margin-bottom:var(--snk-tab-config__tab-label--margin-bottom)}.tab-config__forward-button.sc-snk-tab-config,.tab-config__backward-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.tab-config__new-button.sc-snk-tab-config ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__new-button-icon--color)}.tab-config__backward-button.sc-snk-tab-config{left:0px;box-shadow:10px 10px 5px 5px white;background:white}.tab-config__forward-button.sc-snk-tab-config{box-shadow:10px 10px 5px 20px white;background:white}.tab-config__forward-button.sc-snk-tab-config::after,.tab-config__backward-button.sc-snk-tab-config::after{content:\'\';display:flex;width:10px;height:16px;background-color:var(--snk-tab-config__forward-button--background-color)}.tab-config__forward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--forward-icon);mask-image:var(--snk-tab-config--forward-icon)}.tab-config__backward-button.sc-snk-tab-config::after{-webkit-mask-image:var(--snk-tab-config--backward-icon);mask-image:var(--snk-tab-config--backward-icon)}.tab-config__forward-button.sc-snk-tab-config:hover::after,.tab-config__backward-button.sc-snk-tab-config:hover::after{background-color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__new-button.sc-snk-tab-config:hover ez-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__forward-button-hover--background-color)}.tab-config__hidden.sc-snk-tab-config{display:none}.tab-config__scroll.sc-snk-tab-config::-webkit-scrollbar{display:none}.tab-config__left-icon.sc-snk-tab-config{padding-right:var(--snk-tab-config__left-icon--padding-right);--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__left-icon--eye-off.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__left-icon--color)}.tab-config__right-icon.sc-snk-tab-config{visibility:hidden;padding-left:var(--snk-tab-config__left-icon--padding-right)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{visibility:visible}.tab-config__tab--is-active.sc-snk-tab-config .tab-config__right-icon.sc-snk-tab-config{visibility:visible;--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-hover--color)}.tab-config__tab--is-active.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--snk-tab-config__tab-is-active--color)}.tab-config__actions-button.sc-snk-tab-config{--ez-actions-button__btn-action--min-width:100px;visibility:hidden;opacity:0;transition:visibility 1s linear, opacity 0.3s linear}.tab-config__tab.sc-snk-tab-config:hover .tab-config__actions-button.sc-snk-tab-config{visibility:visible;opacity:1;transition:visibility 0.2s linear, opacity 0.10s linear}[data-draggable-element].sc-snk-tab-config{cursor:grab}.tab-config__tab-label-disabled.sc-snk-tab-config{color:var(--snk-tab-config__tab-label-disabled--color)}.tab-config__slot.sc-snk-tab-config{margin-left:var(--snk-tab-config__slot--margin-left)}';export{h as snk_tab_config}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as e,h as t,H as l,g as s}from"./p-a77dd79a.js";import{UserInterface as n,ObjectUtils as o,StringUtils as a,ApplicationContext as d,ElementIDUtils as r}from"@sankhyalabs/core";import{DataType as u,getConvertedValue as h}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{CheckMode as c}from"@sankhyalabs/ezui/dist/collection/utils";import{V as v,D as p,a as b}from"./p-b4093344.js";const g=class{constructor(t){i(this,t),this.configOptionsChanged=e(this,"configOptionsChanged",7),this.fieldConfig={}}onConfigDefault(i){null!=i&&(this._defaultType=i,this.fieldConfig.defaultValue={type:this._defaultType},this.configOptionsChanged.emit(this.fieldConfig))}buildOptions(){var i,e,t;let l=null===(t=null===(i=this.dataUnit)||void 0===i?void 0:i.getField(null===(e=this.fieldConfig)||void 0===e?void 0:e.name))||void 0===t?void 0:t.userInterface;return l===n.SEARCH&&(l=n.INTEGERNUMBER),v.UserInterface[l]}enabledValueDefault(){var i,e,t;const l=null===(i=this.dataUnit)||void 0===i?void 0:i.getField(null===(e=this.fieldConfig)||void 0===e?void 0:e.name),s=null===(t=null==l?void 0:l.properties)||void 0===t?void 0:t.allowDefault,o=v.UserInterface.hasOwnProperty(null==l?void 0:l.userInterface)||(null==l?void 0:l.userInterface)===n.SEARCH;return!(null!=s&&"true"!==s||!o)}isAllowDefault(){var i,e;const t=null===(e=null===(i=this._fieldProperties)||void 0===i?void 0:i.properties)||void 0===e?void 0:e.allowDefault;return null==t||"true"===t}loadDefaultValue(){var i;null==this.fieldConfig?(this._defaultType=p.fixed,this.fieldConfig={defaultValue:{type:this._defaultType}}):null==(null===(i=this.fieldConfig.defaultValue)||void 0===i?void 0:i.type)?(this._defaultType=p.fixed,this.fieldConfig.defaultValue={type:this._defaultType}):this._defaultType=this.fieldConfig.defaultValue.type}getFieldProperties(i){var e;if(null!=i)return null===(e=this.dataUnit)||void 0===e?void 0:e.getField(i)}getMessage(i,e){return this._application.messagesBuilder.getMessage(i,e)}getDefaultType(){var i;return null!==(i=this.fieldConfig.defaultValue.type)&&void 0!==i?i:p.fixed}getEnabledByProperty(i){const e=this._fieldProperties;return null==e||!0!==e[i]}getValueByProperty(i){const e=this._fieldProperties;return null!=e&&!0===e[i]||this.fieldConfig[i]}getValidatedValue(i){var e,t;if(null==i)return;const l=null===(e=this.dataUnit)||void 0===e?void 0:e.getField(null===(t=this.fieldConfig)||void 0===t?void 0:t.name),s=null==l?void 0:l.dataType;if(null==s)return;const n=null!=(null==i?void 0:i.waitmessage)?void 0:s!==u.OBJECT&&s!==u.DATE&&"object"==typeof i?i.value:i;return s===u.OBJECT?JSON.stringify(n):n}buildInputDefault({value:i,enabled:e,label:l,name:s,required:a,userInterface:d},r,u){let h,c=0,v=0;const p=null==d||null==b[d]?b.DEFAULT:b[d];if(d===n.OPTIONSELECTOR){const i=null==r?void 0:r.options;if("string"==typeof i){const e=o.stringToObject(i);h=Object.keys(e).map((i=>({value:i,label:e[i]})))}else h=i}else d===n.DECIMALNUMBER&&(c=Number((null==r?void 0:r.precision)||2),v=Number((null==r?void 0:r.prettyPrecision)||c));return t(p,Object.assign({value:i,enabled:e,label:l,"data-field-name":s,key:s,onEzChange:i=>this.onChange(null==i?void 0:i.detail)},this.getConditionalAttributes(d,a,h,c,v,u)))}getConditionalAttributes(i,e,t,l,s,o){switch(i){case n.SEARCH:return{suppressEmptyOption:e,optionLoader:i=>this.onSearch(i)};case n.OPTIONSELECTOR:return{suppressEmptyOption:e,options:t};case n.CHECKBOX:case n.SWITCH:return{mode:o};case n.INTEGERNUMBER:case n.DECIMALNUMBER:return{precision:l,prettyPrecision:s,onEzStartChange:i=>this.onChange(null==i?void 0:i.detail)};case n.DATE:case n.DATETIME:case n.TIME:return{onEzStartChange:i=>this.onChange(null==i?void 0:i.detail)};default:return{}}}onChange(i){this.fieldConfig.defaultValue.value=this.getValidatedValue(i),this.configOptionsChanged.emit(this.fieldConfig)}onSearch(i){if(null!=this._application&&null!=this.fieldConfig)return this._application.executeSearch(i,this.fieldConfig.name,this.dataUnit)}buildField(i,e){const{name:t,label:l,readOnly:s,required:o,defaultValue:d}=e,{userInterface:r,properties:u}=i;let v,p=a.getBooleanValue(null==u?void 0:u.allowDefault,!s);r===n.FILE&&(p=!1),p&&(v=null==d?void 0:d.value,null!=v&&(v=h(null==i?void 0:i.dataType,v)));const b={value:v,enabled:p,label:l,name:t,required:o,userInterface:r};switch(r){case n.SWITCH:return this.buildInputDefault(b,void 0,c.SWITCH);case n.CHECKBOX:return this.buildInputDefault(b,void 0,c.REGULAR);case n.OPTIONSELECTOR:case n.DECIMALNUMBER:return this.buildInputDefault(b,u);default:return this.buildInputDefault(b)}}componentWillLoad(){var i;this.loadDefaultValue(),this._application=d.getContextValue("__SNK__APPLICATION__"),this._fieldProperties=this.getFieldProperties(null===(i=this.fieldConfig)||void 0===i?void 0:i.name)}componentDidLoad(){r.addIDInfo(this._element,this.fieldConfig.name)}render(){var i,e;return t(l,null,t("div",{id:this.idConfig},t("div",{class:"ez-row ez-padding--medium"},t("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},t("ez-text-input",{label:this.getMessage("snkConfigOptions.label.nameField"),value:null===(i=this.fieldConfig)||void 0===i?void 0:i.label,onEzChange:i=>{this.fieldConfig.label=i.detail,this.configOptionsChanged.emit(this.fieldConfig)}})),t("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},t("ez-combo-box",{label:this.getMessage("snkConfigOptions.label.typeValueDefault"),suppressEmptyOption:!0,enabled:this.enabledValueDefault(),onEzChange:i=>{var e;return this.onConfigDefault(null===(e=i.detail)||void 0===e?void 0:e.value)},value:this.getDefaultType()},t("option",{value:p.fixed},this.getMessage("snkConfigOptions.options.valueFixed")),t("option",{value:p.variable},this.getMessage("snkConfigOptions.options.variable")))),t("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},this._defaultType===p.variable?t("ez-combo-box",{label:this.getMessage("snkConfigOptions.label.valueDefault"),enabled:this.isAllowDefault(),onEzChange:i=>{var e;this.fieldConfig.defaultValue.value=null===(e=i.detail)||void 0===e?void 0:e.value,this.configOptionsChanged.emit(this.fieldConfig)},value:this.fieldConfig.defaultValue.value,options:this.buildOptions()}):(null===(e=this._fieldProperties)||void 0===e?void 0:e.userInterface)&&this.buildField(this._fieldProperties,this.fieldConfig))),t("div",{class:"ez-row ez-padding--medium config-options__switch-row"},t("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},t("ez-check",{mode:c.SWITCH,label:this.getMessage("snkConfigOptions.label.clearDuplicate"),value:this.fieldConfig.cleanOnCopy,onEzChange:i=>{this.fieldConfig.cleanOnCopy=i.detail,this.configOptionsChanged.emit(this.fieldConfig)}})),t("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},t("ez-check",{mode:c.SWITCH,label:this.getMessage("snkConfigOptions.label.requiredField"),enabled:this.getEnabledByProperty("required"),value:this.getValueByProperty("required"),onEzChange:i=>{this.fieldConfig.required=i.detail,this.configOptionsChanged.emit(this.fieldConfig)}})),t("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},t("ez-check",{mode:c.SWITCH,label:this.getMessage("snkConfigOptions.label.protectedField"),enabled:this.getEnabledByProperty("readOnly"),value:this.getValueByProperty("readOnly"),onEzChange:i=>{this.fieldConfig.readOnly=i.detail,this.configOptionsChanged.emit(this.fieldConfig)}})))))}get _element(){return s(this)}};g.style=".sc-snk-config-options-h{--snk-config-options--border:2px solid var(--color--secondary-200, #D2D3DA);width:100%;border-radius:15px;border:var(--snk-config-options--border)}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";export{g as snk_config_options}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e,H as n}from"./p-a77dd79a.js";import{Action as a,ApplicationContext as h}from"@sankhyalabs/core";import{ApplicationUtils as o,DialogType as r}from"@sankhyalabs/ezui/dist/collection/utils";import{O as c}from"./p-3187b31c.js";const l=class{constructor(s){t(this,s),this.dataStateChange=i(this,"dataStateChange",3),this.dataUnitReady=i(this,"dataUnitReady",3),this.insertionMode=i(this,"insertionMode",3),this.cancelEdition=i(this,"cancelEdition",3),this._onDataUnitResolve=[],this.pageSize=150,this._dataUnitObserver=t=>{const i={insertionMode:!1,hasNext:this.dataUnit.hasNext(),hasPrevious:this.dataUnit.hasPrevious(),copyMode:!1,isDirty:this.dataUnit.isDirty(),hasDirtyRecords:this.dataUnit.hasDirtyRecords(),selectedRecords:this.dataUnit.getSelectedRecords(),selectedRecord:this.dataUnit.getSelectedRecord()};if(this.dataUnit.records.forEach((t=>{t.__record__id__.startsWith("NEW_")&&(i.insertionMode=!0,i.copyMode||(i.copyMode=null!=t.__record__source__id__))})),this.dataState=i,t.type===a.DATA_SAVED){const i=this.getMessage("snkDataUnit.saveInfo",t.payload.records[0]);null!=i&&this.showSuccessMessage(i)}if(t.type!==a.RECORDS_ADDED&&t.type!==a.RECORDS_COPIED||this.insertionMode.emit(),t.type===a.EDITION_CANCELED&&this.cancelEdition.emit(),t.type===a.RECORDS_REMOVED){const i=this.getMessage("snkDataUnit.removeInfo",t.payload.cachedRecords[0]);null!=i&&this.showSuccessMessage(i)}this._application.messagesBuilder.currentOperation=this.getMessageOperation()}}observePageSize(){this.dataUnit&&(this.dataUnit.pageSize=this.pageSize)}observeDataUnitName(t,i){i!=t&&(this.dataUnit=void 0,this.dataUnitName=t,this.loadDataUnit())}observeEntityName(t,i){i!=t&&(this.dataUnit=void 0,this.entityName=t,this.loadDataUnit())}observeDataState(t,i){i!=t&&this.dataStateChange.emit(t)}observeDataUnit(){this.handlerLinkFields(),this.dataUnitReady.emit(this.dataUnit)}async getDataUnit(){return new Promise((t=>{this.dataUnit?t(this.dataUnit):this._onDataUnitResolve.push(t)}))}async getSelectedRecordsIDsInfo(){var t;const i=[],s=null===(t=this.dataUnit)||void 0===t?void 0:t.getSelectedRecords();return(null==s?void 0:s.length)>0&&s.forEach((({__record__id__:t})=>{if(!this.dataUnit.isNewRecord(t)){const s=JSON.parse(window.atob(t));Object.entries(s).forEach((([t,s])=>{var e;const n=null===(e=this.dataUnit)||void 0===e?void 0:e.getField(t);null!=n&&i.push(Object.assign({name:t,type:n.dataType},s))}))}})),i}async interceptAction(t){return new Promise((i=>{switch(t.type){case a.RECORDS_ADDED:this.isAllowed("INSERT")?i(t):o.info(this.getMessage("snkDataUnit.forbiddenInsert"));break;case a.RECORDS_COPIED:this.isAllowed("CLONE")?i(t):o.info(this.getMessage("snkDataUnit.forbiddenClone"));break;case a.DATA_CHANGED:case a.CHANGING_DATA:this.isAllowed("UPDATE")?i(t):(this.dataUnit.cancelEdition(),o.alert(this.getMessage("snkDataUnit.forbidden"),this.getMessage("snkDataUnit.forbiddenUpdate")));break;case a.SAVING_DATA:if(this.beforeSave){const s=this.beforeSave(this.dataUnit);s instanceof Promise?s.then((s=>i(s?t:void 0))):i(s?t:void 0)}else i(t);break;case a.DATA_SAVED:this.afterSave?this.afterSave(this.dataUnit):i(t);break;case a.EDITION_CANCELED:if(this.dataState.hasDirtyRecords){const s=this.getMessage("snkDataUnit.cancelConfirmation");if(null==s)this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo")),i(t);else{const e=this.getMessage("snkDataUnit.cancelConfirmationTitle");o.confirm(e,s).then((s=>{this.showSuccessMessage(this.getMessage("snkDataUnit.cancelInfo")),i(s?t:void 0)}))}}else i(t);break;case a.REMOVING_RECORDS:if(this.isAllowed("REMOVE")){const s=this.getMessage("snkDataUnit.removeConfirmation");if(null==s)i(t);else{const e={canClose:!1,labelCancel:this.getMessage("snkDataUnit.confirm.cancel"),labelConfirm:this.getMessage("snkDataUnit.confirm.delete"),btnConfirmDanger:!1},n=this.getMessage("snkDataUnit.removeConfirmationTitle");o.confirm(n,s,null,r.WARN,e).then((s=>i(s?t:void 0)))}}else o.info(this.getMessage("snkDataUnit.forbiddenRemove"));break;default:i(t)}}))}showSuccessMessage(t){o.info(t,{iconName:"check"})}isAllowed(t){return!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getMessage(t,i){return i||(i=this.getMessageParams()),this._application.messagesBuilder.getMessage(t,i)}getMessageParams(){return this.dataState.selectedRecords?this.dataState.selectedRecords[0]:void 0}getMessageOperation(){return this.dataState.copyMode?c.CLONE:this.dataState.insertionMode?c.INSERT:this.dataState.isDirty?c.UPDATE:c.CLEAN}async getDataUnitParentOrChild(){var t;const i=this.dataUnitName?this.dataUnitName:this.entityName;return this._parentSnkDataUnit?(this._parentDataUnit=await(null===(t=this._parentSnkDataUnit)||void 0===t?void 0:t.getDataUnit()),await this._application.getDataUnit(this.entityName,void 0,this._parentDataUnit)):await this._application.getDataUnit(this.entityName,i)}async loadDataUnit(){if(!this.dataUnit&&this._application&&this.entityName){let t;for(this.dataUnit=await this.getDataUnitParentOrChild(),this.dataUnit.pageSize=this.pageSize,this.dataUnit.unsubscribe(this._dataUnitObserver),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this._dataUnitObserver);t=this._onDataUnitResolve.pop();)t(this.dataUnit)}}getParentSnkDataUnit(){let t=this.element;for(;t.parentNode;){if("SNK-DATA-UNIT"===t.parentNode.nodeName)return t.parentNode;t=t.parentNode}}handlerLinkFields(){var t,i;const s=Object.assign({},this.dataUnit.metadata);if(!this._parentDataUnit)return;const e=this._parentDataUnit.getChildInfo(this.entityName);if(!e)return;const n=null===(t=null==e?void 0:e.links)||void 0===t?void 0:t.map((t=>t.target));null===(i=null==s?void 0:s.fields)||void 0===i||i.forEach((t=>{(null==n?void 0:n.includes(t.name))&&(t.visible=!1)})),this.dataUnit.metadata=s}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__"),this._application.getAllAccess().then((t=>this._permissions=t)),this._parentSnkDataUnit=this.getParentSnkDataUnit()}componentDidLoad(){this.loadDataUnit()}render(){return s(n,null)}get element(){return e(this)}static get watchers(){return{pageSize:["observePageSize"],dataUnitName:["observeDataUnitName"],entityName:["observeEntityName"],dataState:["observeDataState"],dataUnit:["observeDataUnit"]}}};l.style=".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";export{l as snk_data_unit}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e}from"./p-a77dd79a.js";import{P as t}from"./p-5534e08c.js";import{s as a}from"./p-112bb324.js";var n,r,s;!function(e){e.PREVIOUS="PREVIOUS",e.NEXT="NEXT",e.REFRESH="REFRESH",e.UPDATE="UPDATE",e.CLONE="CLONE",e.REMOVE="REMOVE",e.INSERT="INSERT",e.CANCEL="CANCEL",e.SAVE="SAVE",e.GRID_MODE="GRID_MODE",e.FORM_MODE="FORM_MODE",e.MORE_OPTIONS="MORE_OPTIONS",e.DIVIDER="DIVIDER",e.CONFIGURATOR="CONFIGURATOR",e.DATA_EXPORTER="DATA_EXPORTER"}(n||(n={})),function(e){e.UPDATE="UPDATE",e.CLONE="CLONE",e.REMOVE="REMOVE",e.INSERT="INSERT",e.CONFIGURATOR="CONFIGURATOR"}(r||(r={})),function(e){e.CONFIGURATOR="CONFIGURATOR"}(s||(s={}));const i=(e,t,a,n,r)=>{const{hint:s,text:i,iconName:c}=e;return c?i?d(c,e.name,t,a,s,i,n,r):l(c,e.name,t,a,s,n,r):o(e.name,t,a,i,s,n,r)},c=(r,s,i,c,u,m,E,R,O)=>{var v;const b=c(r);switch(r){case n.PREVIOUS:return l("chevron-left",r,s,i,b,u,m);case n.NEXT:return l("chevron-right",r,s,i,b,u,m);case n.REFRESH:return l("sync",r,s,i,b,u,m);case n.UPDATE:return l("edit",r,s,i,b,u,m);case n.CLONE:return l("copy",r,s,i,b,u,m);case n.REMOVE:return l("delete",r,s,i,b,u,m);case n.INSERT:return O===t.PRIMARY?d("plus",r,s,i,b,b,u,m):l("plus",r,s,i,b,u,m);case n.CANCEL:return o(r,s,i,b,b,u,m);case n.SAVE:return O===t.PRIMARY?d("save",r,s,i,b,b,u,m):l("save",r,s,i,b,u,m);case n.GRID_MODE:return l("table",r,s,i,b,u,m);case n.FORM_MODE:return l("list",r,s,i,b,u,m);case n.CONFIGURATOR:return l("settings-inverted",r,s,i,b,u,m);case n.MORE_OPTIONS:return function(t,a,n,r,s,i,c){return c&&c.length>0?e("ez-actions-button",{title:r,size:"small","data-element-id":n,arrowActive:!0,class:a,enabled:i(t),onEzAction:e=>s(e.detail.value),actions:c}):void 0}(r,s,i,b,u,m,E);case n.DIVIDER:return e("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium","data-taskbar-divider":!0});case n.DATA_EXPORTER:const c=null===(v=a.get("exporterProviders"))||void 0===v?void 0:v[R];return e("snk-data-exporter",{class:s,provider:c,"data-element-id":i})}};function o(t,a,n,r,s,i,c){return e("ez-button",{title:s,label:r,size:"small",class:a,"data-element-id":n,enabled:c(t),onClick:()=>i(t)})}function l(t,a,n,r,s,i,c){return e("ez-button",{name:t,title:s,mode:"icon",size:"small",class:n,"data-element-id":r,iconName:t,enabled:c(a),onClick:()=>i(a)})}function d(t,a,n,r,s,i,c,o){return e("ez-button",{name:t,title:i,label:s,size:"small",class:n,"data-element-id":r,enabled:o(a),onClick:()=>c(a)},e("ez-icon",{class:"ez-padding-right--small",slot:"leftIcon",iconName:t}))}export{r as A,n as T,s as V,i as a,c as b}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as s,g as i}from"./p-a77dd79a.js";import{ElementIDUtils as e}from"@sankhyalabs/core";import{F as o}from"./p-9dd2b8cb.js";const r=class{constructor(s){t(this,s)}ezChangeListener(t){this.value=t.detail.value}async show(){this._comboElement.setFocus()}componentDidLoad(){this._element&&e.addIDInfo(this._element,"filterContentEditor")}render(){if(this.config&&this.config.type===o.MULTI_SELECT)return s("ez-combo-box",{id:this.config.id,ref:t=>this._comboElement=t,label:this.config.label,value:this.config.value,options:this.config.props.options})}get _element(){return i(this)}};export{r as snk_filter_multi_select}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
let e,t,n,l=!1,o=!1,s=!1,i=null,c=!1;const r="http://www.w3.org/1999/xlink",f={},a=e=>"object"==(e=typeof e)||"function"===e,u=(e,t,...n)=>{let l=null,o=null,s=null,i=!1,c=!1;const r=[],f=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((i="function"!=typeof e&&!a(l))&&(l+=""),i&&c?r[r.length-1].t+=l:r.push(i?d(null,l):l),c=i)};if(f(n),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,r,p);const u=d(e,null);return u.l=t,r.length>0&&(u.o=r),u.i=o,u.u=s,u},d=(e,t)=>({$:0,p:e,t,h:null,o:null,l:null,i:null,u:null}),$={},p={forEach:(e,t)=>e.map(y).forEach(t),map:(e,t)=>e.map(y).map(t).map(h)},y=e=>({vattrs:e.l,vchildren:e.o,vkey:e.i,vname:e.u,vtag:e.p,vtext:e.t}),h=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),u(e.vtag,t,...e.vchildren||[])}const t=d(e.vtag,e.vtext);return t.l=e.vattrs,t.o=e.vchildren,t.i=e.vkey,t.u=e.vname,t},m=e=>se(e).m,b=(e,t,n)=>{const l=m(e);return{emit:e=>w(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},w=(e,t,n)=>{const l=ye.ce(t,n);return e.dispatchEvent(l),l},k=new WeakMap,v=e=>"sc-"+e.k,g=(e,t,n,l,o,s)=>{if(n!==l){let i=re(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=j(n),s=j(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const f=a(l);if((i||f&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}let u=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(t=c,u=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(u?e.removeAttributeNS(r,t):e.removeAttribute(t)):(!i||4&s||o)&&!f&&(l=!0===l?"":l,u?e.setAttributeNS(r,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):re($e,c)?c.slice(2):c[2]+t.slice(3),n&&ye.rel(e,t,n,!1),l&&ye.ael(e,t,l,!1)}},S=/\s/,j=e=>e?e.split(S):[],C=(e,t,n,l)=>{const o=11===t.h.nodeType&&t.h.host?t.h.host:t.h,s=e&&e.l||f,i=t.l||f;for(l in s)l in i||g(o,l,s[l],void 0,n,t.$);for(l in i)g(o,l,s[l],i[l],n,t.$)},M=(o,i,c,r)=>{const f=i.o[c];let a,u,d,$=0;if(l||(s=!0,"slot"===f.p&&(e&&r.classList.add(e+"-s"),f.$|=f.o?2:1)),null!==f.t)a=f.h=pe.createTextNode(f.t);else if(1&f.$)a=f.h=pe.createTextNode("");else if(a=f.h=pe.createElement(2&f.$?"slot-fb":f.p),C(null,f,!1),null!=e&&a["s-si"]!==e&&a.classList.add(a["s-si"]=e),f.o)for($=0;$<f.o.length;++$)u=M(o,f,$,a),u&&a.appendChild(u);return a["s-hn"]=n,3&f.$&&(a["s-sr"]=!0,a["s-cr"]=t,a["s-sn"]=f.u||"",d=o&&o.o&&o.o[c],d&&d.p===f.p&&o.h&&O(o.h,!1)),a},O=(e,t)=>{ye.$|=1;const l=e.childNodes;for(let e=l.length-1;e>=0;e--){const o=l[e];o["s-hn"]!==n&&o["s-ol"]&&(W(o).insertBefore(o,T(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&O(o,t)}ye.$&=-2},R=(e,t,l,o,s,i)=>{let c,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);s<=i;++s)o[s]&&(c=M(null,l,s,e),c&&(o[s].h=c,r.insertBefore(c,T(t))))},x=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.h,F(l),o=!0,s["s-ol"]?s["s-ol"].remove():O(s,!0),s.remove())},P=(e,t)=>e.p===t.p&&("slot"===e.p?e.u===t.u:e.i===t.i),T=e=>e&&e["s-ol"]||e,W=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,E=(e,t)=>{const n=t.h=e.h,l=e.o,o=t.o,s=t.t;let i;null===s?("slot"===t.p||C(e,t,!1),null!==l&&null!==o?((e,t,n,l)=>{let o,s,i=0,c=0,r=0,f=0,a=t.length-1,u=t[0],d=t[a],$=l.length-1,p=l[0],y=l[$];for(;i<=a&&c<=$;)if(null==u)u=t[++i];else if(null==d)d=t[--a];else if(null==p)p=l[++c];else if(null==y)y=l[--$];else if(P(u,p))E(u,p),u=t[++i],p=l[++c];else if(P(d,y))E(d,y),d=t[--a],y=l[--$];else if(P(u,y))"slot"!==u.p&&"slot"!==y.p||O(u.h.parentNode,!1),E(u,y),e.insertBefore(u.h,d.h.nextSibling),u=t[++i],y=l[--$];else if(P(d,p))"slot"!==u.p&&"slot"!==y.p||O(d.h.parentNode,!1),E(d,p),e.insertBefore(d.h,u.h),d=t[--a],p=l[++c];else{for(r=-1,f=i;f<=a;++f)if(t[f]&&null!==t[f].i&&t[f].i===p.i){r=f;break}r>=0?(s=t[r],s.p!==p.p?o=M(t&&t[c],n,r,e):(E(s,p),t[r]=void 0,o=s.h),p=l[++c]):(o=M(t&&t[c],n,c,e),p=l[++c]),o&&W(u.h).insertBefore(o,T(u.h))}i>a?R(e,null==l[$+1]?null:l[$+1].h,n,l,c,$):c>$&&x(t,i,a)})(n,l,t,o):null!==o?(null!==e.t&&(n.textContent=""),R(n,null,t,o,0,o.length-1)):null!==l&&x(l,0,l.length-1)):(i=n["s-cr"])?i.parentNode.textContent=s:e.t!==s&&(n.data=s)},L=e=>{const t=e.childNodes;let n,l,o,s,i,c;for(l=0,o=t.length;l<o;l++)if(n=t[l],1===n.nodeType){if(n["s-sr"])for(i=n["s-sn"],n.hidden=!1,s=0;s<o;s++)if(c=t[s].nodeType,t[s]["s-hn"]!==n["s-hn"]||""!==i){if(1===c&&i===t[s].getAttribute("slot")){n.hidden=!0;break}}else if(1===c||3===c&&""!==t[s].textContent.trim()){n.hidden=!0;break}L(n)}},N=[],U=e=>{let t,n,l,s,i,c,r=0;const f=e.childNodes,a=f.length;for(;r<a;r++){if(t=f[r],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=t["s-sn"],c=l.length-1;c>=0;c--)n=l[c],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(D(n,s)?(i=N.find((e=>e.v===n)),o=!0,n["s-sn"]=n["s-sn"]||s,i?i.g=t:N.push({g:t,v:n}),n["s-sr"]&&N.map((e=>{D(e.v,n["s-sn"])&&(i=N.find((e=>e.v===n)),i&&!e.g&&(e.g=i.g))}))):N.some((e=>e.v===n))||N.push({v:n}));1===t.nodeType&&U(t)}},D=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,F=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(F)},A=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},H=(e,t)=>{if(e.$|=16,!(4&e.$))return A(e,e.j),je((()=>q(e,t)));e.$|=512},q=(e,t)=>{const n=e.C;let l;return t?(e.$|=256,e.M&&(e.M.map((([e,t])=>J(n,e,t))),e.M=null),l=J(n,"componentWillLoad")):l=J(n,"componentWillUpdate"),l=K(l,(()=>J(n,"componentWillRender"))),K(l,(()=>V(e,n,t)))},V=async(e,t,n)=>{const l=e.m,o=l["s-rc"];n&&(e=>{const t=e.O,n=e.m,l=t.$,o=((e,t)=>{let n=v(t);const l=de.get(n);if(e=11===e.nodeType?e:pe,l)if("string"==typeof l){let t,o=k.get(e=e.head||e);o||k.set(e,o=new Set),o.has(n)||(t=pe.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"),2&l&&n.classList.add(o+"-s"))})(e);_(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>B(e);0===t.length?n():(Promise.all(t).then(n),e.$|=4,t.length=0)}},_=(c,r)=>{try{i=r,r=r.render(),c.$&=-17,c.$|=2,((i,c)=>{const r=i.m,f=i.O,a=i.R||d(null,null),p=(e=>e&&e.p===$)(c)?c:u(null,null,c);if(n=r.tagName,f.P&&(p.l=p.l||{},f.P.map((([e,t])=>p.l[t]=r[e]))),p.p=null,p.$|=4,i.R=p,p.h=a.h=r.shadowRoot||r,e=r["s-sc"],t=r["s-cr"],l=0!=(1&f.$),o=!1,E(a,p),ye.$|=1,s){let e,t,n,l,o,s;U(p.h);let i=0;for(;i<N.length;i++)e=N[i],t=e.v,t["s-ol"]||(n=pe.createTextNode(""),n["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=n,t));for(i=0;i<N.length;i++)if(e=N[i],t=e.v,e.g){for(l=e.g.parentNode,o=e.g.nextSibling,n=t["s-ol"];n=n.previousSibling;)if(s=n["s-nr"],s&&s["s-sn"]===t["s-sn"]&&l===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&l!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),l.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&L(p.h),ye.$&=-2,N.length=0})(c,r)}catch(e){fe(e,c.m)}return i=null,null},z=()=>i,B=e=>{const t=e.m,n=e.C,l=e.j;J(n,"componentDidRender"),64&e.$?J(n,"componentDidUpdate"):(e.$|=64,Q(t),J(n,"componentDidLoad"),e.T(t),l||I()),e.W(t),e.S&&(e.S(),e.S=void 0),512&e.$&&Se((()=>H(e,!1))),e.$&=-517},G=e=>{{const t=se(e),n=t.m.isConnected;return n&&2==(18&t.$)&&H(t,!1),n}},I=()=>{Q(pe.documentElement),Se((()=>w($e,"appload",{detail:{namespace:"sankhyablocks"}})))},J=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){fe(e)}},K=(e,t)=>e&&e.then?e.then(t):t(),Q=e=>e.classList.add("hydrated"),X=(e,t,n)=>{if(t.L){e.watchers&&(t.N=e.watchers);const l=Object.entries(t.L),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>se(this).U.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=se(e),s=o.m,i=o.U.get(t),c=o.$,r=o.C;if(n=((e,t)=>null==e||a(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.L[t][0]),(!(8&c)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(o.U.set(t,n),r)){if(l.N&&128&c){const e=l.N[t];e&&e.map((e=>{try{r[e](n,i,t)}catch(e){fe(e,s)}}))}2==(18&c)&&H(o,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=se(this);return n.D.then((()=>n.C[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){ye.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.P.push([e,o]),o}))}}return e},Y=e=>{J(e,"connectedCallback")},Z=(e,t={})=>{const n=[],l=t.exclude||[],o=$e.customElements,s=pe.head,i=s.querySelector("meta[charset]"),c=pe.createElement("style"),r=[];let f,a=!0;Object.assign(ye,t),ye.F=new URL(t.resourcesUrl||"./",pe.baseURI).href,e.map((e=>{e[1].map((t=>{const s={$:t[0],k:t[1],L:t[2],A:t[3]};s.L=t[2],s.A=t[3],s.P=[],s.N={};const i=s.k,c=class extends HTMLElement{constructor(e){super(e),ce(e=this,s),1&s.$&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),a?r.push(this):ye.jmp((()=>(e=>{if(0==(1&ye.$)){const t=se(e),n=t.O,l=()=>{};if(1&t.$)te(e,t,n.A),Y(t.C);else{t.$|=1,12&n.$&&(e=>{const t=e["s-cr"]=pe.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){A(t,t.j=n);break}}n.L&&Object.entries(n.L).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.$)){{if(t.$|=32,(o=ue(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(n.N=o.watchers,X(o,n,2),o.isProxied=!0);const e=()=>{};t.$|=8;try{new o(t)}catch(e){fe(e)}t.$&=-9,t.$|=128,e(),Y(t.C)}if(o.style){let e=o.style;const t=v(n);if(!de.has(t)){const l=()=>{};((e,t,n)=>{let l=de.get(e);me&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,de.set(e,l)})(t,e,!!(1&n.$)),l()}}}const s=t.j,i=()=>H(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){ye.jmp((()=>(()=>{if(0==(1&ye.$)){const e=se(this),t=e.C;e.H&&(e.H.map((e=>e())),e.H=void 0),J(t,"disconnectedCallback")}})()))}componentOnReady(){return se(this).q}};s.V=e[0],l.includes(i)||o.get(i)||(n.push(i),o.define(i,X(c,s,1)))}))})),c.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",c.setAttribute("data-styles",""),s.insertBefore(c,i?i.nextSibling:s.firstChild),a=!1,r.length?r.map((e=>e.connectedCallback())):ye.jmp((()=>f=setTimeout(I,30)))},ee=(e,t)=>t,te=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=e,i=ne(t,o),c=le(n);ye.ael(s,l,i,c),(t.H=t.H||[]).push((()=>ye.rel(s,l,i,c)))}))},ne=(e,t)=>n=>{try{256&e.$?e.C[t](n):(e.M=e.M||[]).push([t,n])}catch(e){fe(e)}},le=e=>0!=(2&e),oe=new WeakMap,se=e=>oe.get(e),ie=(e,t)=>oe.set(t.C=e,t),ce=(e,t)=>{const n={$:0,m:e,O:t,U:new Map};return n.D=new Promise((e=>n.W=e)),n.q=new Promise((e=>n.T=e)),e["s-p"]=[],e["s-rc"]=[],te(e,n,t.A),oe.set(e,n)},re=(e,t)=>t in e,fe=(e,t)=>(0,console.error)(e,t),ae=new Map,ue=e=>{const t=e.k.replace(/-/g,"_"),n=e.V,l=ae.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(ae.set(n,e),e[t])),fe)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},de=new Map,$e="undefined"!=typeof window?window:{},pe=$e.document||{head:{}},ye={$:0,F:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},he=e=>Promise.resolve(e),me=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),be=[],we=[],ke=(e,t)=>n=>{e.push(n),c||(c=!0,t&&4&ye.$?Se(ge):ye.raf(ge))},ve=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){fe(e)}e.length=0},ge=()=>{ve(be),ve(we),(c=be.length>0)&&ye.raf(ge)},Se=e=>he().then(e),je=ke(we,!0);export{ee as F,$ as H,z as a,Z as b,b as c,G as f,m as g,u as h,he as p,ie as r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,g as s}from"./p-a77dd79a.js";import{ElementIDUtils as a,UserInterface as n,ApplicationContext as r}from"@sankhyalabs/core";import{convertType as o}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{CheckMode as l}from"@sankhyalabs/ezui/dist/collection/utils";import{F as h}from"./p-9dd2b8cb.js";const u=class{constructor(e){t(this,e)}componentDidLoad(){this._element&&a.addIDInfo(this._element,"filterContentEditor")}getValue(t,e){if(this.value&&e>=0&&e<this.value.length){const i=this.value[e];return t.type===n.SEARCH?i:o(t.dataType,i)}}setValue(t,e){this.value=null==this.value?Array(t).fill(null):[...this.value],this.value[t]=e,0==this.value.filter((t=>null!=t)).length&&(this.value=null)}doSearch(t,e,i){const s=r.getContextValue("__SNK__APPLICATION__");return new Promise(((a,n)=>{s.executePreparedSearch(t,e,i.searchContext).then((t=>{a(t)})).catch((t=>{n(t)}))}))}getParamsInterface(){var t,i,s;return(null===(s=null===(i=null===(t=this.config)||void 0===t?void 0:t.props)||void 0===i?void 0:i.personalizedFilter)||void 0===s?void 0:s.parameters).map(((t,i)=>{var s;const a="param_"+i;switch(t.type){case n.SEARCH:return e("ez-search",{id:a,suppressEmptyOption:!0,value:this.getValue(t,i),onEzChange:t=>this.setValue(i,t.detail),label:t.label,optionLoader:({mode:e,argument:i})=>this.doSearch(e,i,t)});case n.SWITCH:case n.CHECKBOX:return e("ez-check",{id:a,class:"ez-padding-bottom--medium",mode:n.SWITCH===t.type?l.SWITCH:l.REGULAR,value:this.getValue(t,i),label:t.label,onEzChange:t=>this.setValue(i,t.detail)});case n.DECIMALNUMBER:case n.INTEGERNUMBER:return e("ez-number-input",{id:a,label:t.label,value:this.getValue(t,i),precision:null===(s=t.props)||void 0===s?void 0:s.precision,onEzChange:t=>this.setValue(i,t.detail)});case n.OPTIONSELECTOR:return e("ez-combo-box",{id:a,label:t.label,value:this.getValue(t,i),options:t.options,onEzChange:t=>{var e;return this.setValue(i,null===(e=t.detail)||void 0===e?void 0:e.value)}});case n.DATE:return e("ez-date-input",{id:a,label:t.label,value:this.getValue(t,i),onEzChange:t=>this.setValue(i,t.detail)});case n.DATETIME:return e("ez-date-time-input",{id:a,label:t.label,value:this.getValue(t,i),onEzChange:t=>this.setValue(i,t.detail)});default:return e("ez-text-input",{id:a,label:t.label,value:this.getValue(t,i),onEzChange:t=>this.setValue(i,t.detail)})}}))}async show(){const t=document.querySelector("#param_0");t&&t.setFocus()}render(){if(this.config&&this.config.type===h.PERSONALIZED)return e(i,null,this.getParamsInterface())}get _element(){return s(this)}};export{u as snk_filter_personalized}
|