@sankhyalabs/sankhyablocks 1.4.0-beta.8 → 1.4.0-beta.9
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/{constants-aebcc2f5.js → constants-9056ca9e.js} +15 -0
- package/dist/cjs/{index-188190ee.js → index-20e8b68a.js} +48 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-config-modal.cjs.entry.js +2 -2
- package/dist/cjs/snk-config-options.cjs.entry.js +139 -72
- package/dist/cjs/snk-configurator_6.cjs.entry.js +4 -4
- package/dist/cjs/snk-crud.cjs.entry.js +3 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-field-config_2.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +3 -2
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-4c2c6704.js → taskbar-elements-9a4b1e19.js} +1 -1
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +2 -1
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +139 -72
- package/dist/collection/lib/utils/constants.js +14 -0
- package/dist/components/constants.js +15 -1
- package/dist/components/snk-config-options2.js +139 -72
- package/dist/components/snk-filter-modal2.js +2 -1
- package/dist/components/snk-filter-personalized.js +2 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-tab-config2.js +1 -1
- package/dist/esm/{constants-c4e3341e.js → constants-c6039d3d.js} +15 -1
- package/dist/esm/{index-bafb2cef.js → index-e4121713.js} +48 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-config-modal.entry.js +2 -2
- package/dist/esm/snk-config-options.entry.js +140 -73
- package/dist/esm/snk-configurator_6.entry.js +5 -5
- package/dist/esm/snk-crud.entry.js +3 -3
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-field-config_2.entry.js +2 -2
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +1 -1
- package/dist/esm/snk-filter-personalized.entry.js +3 -2
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form.entry.js +1 -1
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +2 -2
- package/dist/esm/{taskbar-elements-2035b1c7.js → taskbar-elements-e2ed0536.js} +1 -1
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-8cd8977c.entry.js → p-029ae4e4.entry.js} +1 -1
- package/dist/sankhyablocks/p-12ad2a19.entry.js +1 -0
- package/dist/sankhyablocks/{p-ce789145.entry.js → p-1feabfc7.entry.js} +1 -1
- package/dist/sankhyablocks/p-2284c850.entry.js +1 -0
- package/dist/sankhyablocks/{p-1963b46f.entry.js → p-2b891c4a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d1ae76ec.entry.js → p-2dc76d79.entry.js} +1 -1
- package/dist/sankhyablocks/p-366aa0f5.entry.js +1 -0
- package/dist/sankhyablocks/{p-ae302037.entry.js → p-36d2d9cf.entry.js} +1 -1
- package/dist/sankhyablocks/{p-916068ff.entry.js → p-3a276f3d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ccdf59eb.entry.js → p-44ce5b90.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6c61416a.entry.js → p-6988f4a6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-af306302.entry.js → p-776ff4d1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-cf81e313.entry.js → p-7b4a4a50.entry.js} +1 -1
- package/dist/sankhyablocks/p-9ba3df4c.js +2 -0
- package/dist/sankhyablocks/{p-cc85ba53.entry.js → p-9dc4426d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ee906940.entry.js → p-a17a4fca.entry.js} +1 -1
- package/dist/sankhyablocks/p-a5b26df2.js +1 -0
- package/dist/sankhyablocks/{p-f9084ecb.entry.js → p-cc4bef9f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-31631fb6.entry.js → p-d1ac09c9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ad658f44.js → p-d9fbb26f.js} +1 -1
- package/dist/sankhyablocks/{p-857c4735.entry.js → p-deb1f523.entry.js} +1 -1
- package/dist/sankhyablocks/p-e871aa92.entry.js +1 -0
- package/dist/sankhyablocks/{p-04ad681a.entry.js → p-e9beab79.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +17 -7
- package/dist/types/lib/utils/constants.d.ts +14 -0
- package/package.json +2 -2
- package/dist/sankhyablocks/p-26c503a6.entry.js +0 -1
- package/dist/sankhyablocks/p-434e0dcf.entry.js +0 -1
- package/dist/sankhyablocks/p-9f2c5fac.entry.js +0 -1
- package/dist/sankhyablocks/p-af11b0e7.js +0 -1
- package/dist/sankhyablocks/p-ddb03141.js +0 -2
- package/dist/sankhyablocks/p-fa75fba5.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as a}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,g as a}from"./p-9ba3df4c.js";import{ApplicationContext as n}from"@sankhyalabs/core";import{c as o}from"./p-a5b26df2.js";import{T as r}from"./p-d9fbb26f.js";const e=o.grid,h=o.form,c=class{constructor(s){t(this,s),this.actionClick=i(this,"actionClick",7)}async goToView(t){this.executeAction(t)}async gridToForm(t=!1){this._backToGrid=!t&&await this._viewStack.getSelectedIndex()===e.index,this._viewStack.show(h.index)}async executeAction(t){t===r.GRID_MODE?this._viewStack.show(e.index):t!==r.FORM_MODE&&t!==r.UPDATE||this.gridToForm(t!==r.UPDATE)}insertionModeHandler(){this.gridToForm()}cancelHandler(){this._backToGrid&&this._viewStack.show(e.index)}componentWillLoad(){let t=this._element.parentElement;for(;t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit||this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail})),this._snkDataUnit.addEventListener("dataStateChange",(t=>{this._dataState=t.detail}));break}t=t.parentElement}if(!this.configName){const t=n.getContextValue("__SNK__APPLICATION__");this.configName=t.configName}}render(){return s("ez-view-stack",{ref:t=>this._viewStack=t,"data-configurator-parent":"snkConfigurator"},s("stack-item",null,s("snk-grid",{configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail),actionsList:this.actionsList,statusResolver:this.statusResolver},s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}))),s("stack-item",null,s("snk-form",{configName:this.configName,actionsList:this.actionsList,onExit:()=>this._viewStack.show(e.index),recordsValidator:this.recordsValidator,taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail)},s("slot",{name:"SnkFormTaskBar"}))))}get _element(){return a(this)}};c.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";export{c as snk_crud}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={grid:{index:0,name:"GRID_MODE"},form:{index:1,name:"FORM_MODE"}},a={add:"ADD",remove:"REMOVE",configuration:"CONFIGURATION"},o={UserInterface:{DATE:[{label:"Data atual",value:"${data}"}],DATETIME:[{label:"Data e hora atuais",value:"${datahora}"}],INTEGERNUMBER:[{label:"Código do usuário logado",value:"${usuario}"},{label:"Empresa do usuário logado",value:"${usuario.empresa}"},{label:"Vendedor para o usuário logado",value:"${usuario.vendedor}"},{label:"Cent. Resultado usuário logado",value:"${usuario.centroresultado}"}]}},r={fixed:"F",variable:"V"},t={closeModal:"ezCloseModal",cancelConfig:"cancelConfig",changeConfig:"changeConfig",configChanged:"configChanged",fieldChanged:"ezChange",dragStart:"sortable:start",dragSort:"sortable:sort",dragSorted:"sortable:sorted",dragStop:"sortable:stop"},l={enter:"Enter",arrowLeft:"ArrowLeft",arrowRight:"ArrowRight",tab:"Tab",escape:"Escape"},d={rename:"RENAME",hide:"HIDE",show:"SHOW",delete:"DELETE"},n={main:"__main"},s={LONGTEXT:"ez-text-area",FILE:"ez-upload",DATE:"ez-date-input",TIME:"ez-time",DATETIME:"ez-date-time-input",DEFAULT:"ez-text-input",SWITCH:"ez-check",CHECKBOX:"ez-check",OPTIONSELECTOR:"ez-combo-box",SEARCH:"ez-search",INTEGERNUMBER:"ez-number-input",DECIMALNUMBER:"ez-number-input"};export{a as A,t as C,r as D,l as K,n as T,o as V,s as a,d as b,e as c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,h as i}from"./p-
|
|
1
|
+
import{r as s,h as i}from"./p-9ba3df4c.js";import{F as r}from"./p-9dd2b8cb.js";const t=class{constructor(i){s(this,i)}ezChangeListener(s){this.value=s.detail}async show(){this._numberElement.setFocus()}render(){var s;if(this.config&&this.config.type===r.NUMBER)return i("ez-number-input",{ref:s=>this._numberElement=s,label:this.config.label,value:this.config.value,precision:null===(s=this.config.props)||void 0===s?void 0:s.precision})}};export{t as snk_filter_number}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,g as e,H as a}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i,g as e,H as a}from"./p-9ba3df4c.js";import{Action as n,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-21c8929b.js";const l=class{constructor(i){t(this,i),this.dataStateChange=s(this,"dataStateChange",7),this.dataUnitReady=s(this,"dataUnitReady",7),this.insertionMode=s(this,"insertionMode",7),this.cancelEdition=s(this,"cancelEdition",7),this._onDataUnitResolve=[],this.pageSize=150,this._dataUnitObserver=t=>{const s={insertionMode:!1,hasNext:this.dataUnit.hasNext(),hasPrevious:this.dataUnit.hasPrevious(),copyMode:!1,isDirty:this.dataUnit.isDirty(),hasDirtyRecords:this.dataUnit.hasDirtyRecords(),selectedRecords:this.dataUnit.getSelectedRecords()};if(this.dataUnit.records.forEach((t=>{t.__record__id__.startsWith("NEW_")&&(s.insertionMode=!0,s.copyMode||(s.copyMode=null!=t.__record__source__id__))})),this.dataState=s,t.type===n.DATA_SAVED){const s=this.getMessage("snkDataUnit.saveInfo",t.payload.records[0]);null!=s&&this.showSuccessMessage(s)}if(t.type!==n.RECORDS_ADDED&&t.type!==n.RECORDS_COPIED||this.insertionMode.emit(),t.type===n.EDITION_CANCELED){this.cancelEdition.emit();const t=this.getMessage("snkDataUnit.cancelInfo");null!=t&&this.showSuccessMessage(t)}if(t.type===n.RECORDS_REMOVED){const s=this.getMessage("snkDataUnit.removeInfo",t.payload.cachedRecords[0]);null!=s&&this.showSuccessMessage(s)}this._application.messagesBuilder.currentOperation=this.getMessageOperation()}}observePageSize(){this.dataUnit&&(this.dataUnit.pageSize=this.pageSize)}observeDataUnitName(t,s){s!=t&&(this.dataUnit=void 0,this.dataUnitName=t,this.loadDataUnit())}observeEntityName(t,s){s!=t&&(this.dataUnit=void 0,this.entityName=t,this.loadDataUnit())}observeDataState(t,s){s!=t&&this.dataStateChange.emit(t)}observeDataUnit(){this.dataUnitReady.emit(this.dataUnit)}async getDataUnit(){return new Promise((t=>{this.dataUnit?t(this.dataUnit):this._onDataUnitResolve.push(t)}))}async interceptAction(t){return new Promise((s=>{switch(t.type){case n.RECORDS_ADDED:this.isAllowed("INSERT")?s(t):o.info(this.getMessage("snkDataUnit.forbiddenInsert"));break;case n.RECORDS_COPIED:this.isAllowed("CLONE")?s(t):o.info(this.getMessage("snkDataUnit.forbiddenClone"));break;case n.DATA_CHANGED:case n.CHANGING_DATA:this.isAllowed("UPDATE")?s(t):(this.dataUnit.cancelEdition(),o.alert(this.getMessage("snkDataUnit.forbidden"),this.getMessage("snkDataUnit.forbiddenUpdate")));break;case n.SAVING_DATA:if(this.beforeSave){const i=this.beforeSave(this.dataUnit);i instanceof Promise?i.then((i=>s(i?t:void 0))):s(i?t:void 0)}else s(t);break;case n.DATA_SAVED:this.afterSave?this.afterSave(this.dataUnit):s(t);break;case n.EDITION_CANCELED:if(this.dataState.hasDirtyRecords){const i=this.getMessage("snkDataUnit.cancelConfirmation");if(null==i)s(t);else{const e=this.getMessage("snkDataUnit.cancelConfirmationTitle");o.confirm(e,i).then((i=>s(i?t:void 0)))}}else s(t);break;case n.REMOVING_RECORDS:if(this.isAllowed("REMOVE")){const i=this.getMessage("snkDataUnit.removeConfirmation");if(null==i)s(t);else{const e=this.getMessage("snkDataUnit.removeConfirmationTitle");o.confirm(e,i,"delete",r.CRITICAL,{btnConfirmDanger:!0}).then((i=>s(i?t:void 0)))}}else o.info(this.getMessage("snkDataUnit.forbiddenRemove"));break;default:s(t)}}))}showSuccessMessage(t){o.info(t,{iconName:"check"})}isAllowed(t){return!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getMessage(t,s){return s||(s=this.getMessageParams()),this._application.messagesBuilder.getMessage(t,s)}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 loadDataUnit(){if(!this.dataUnit&&this._application&&this.entityName){const t=this.dataUnitName?this.dataUnitName:this.entityName;let s;for(this.dataUnit=await this._application.getDataUnit(this.entityName,t),this.dataUnit.pageSize=this.pageSize,this.dataUnit.unsubscribe(this._dataUnitObserver),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this._dataUnitObserver);s=this._onDataUnitResolve.pop();)s(this.dataUnit)}}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__"),this._application.getAllAccess().then((t=>this._permissions=t))}componentDidLoad(){this.loadDataUnit()}render(){return i(a,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 +1 @@
|
|
|
1
|
-
import{h as e}from"./p-
|
|
1
|
+
import{h as e}from"./p-9ba3df4c.js";var n,t,a;!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"}(n||(n={})),function(e){e.UPDATE="UPDATE",e.CLONE="CLONE",e.REMOVE="REMOVE",e.INSERT="INSERT",e.CONFIGURATOR="CONFIGURATOR"}(t||(t={})),function(e){e.CONFIG_GRID="CONFIG_GRID",e.CONFIGURATOR="CONFIGURATOR"}(a||(a={}));const r=(e,n,t,a)=>{const{hint:r,text:s,iconName:l}=e;return l?s?o(l,e.name,n,r,s,t,a):i(l,e.name,n,r,t,a):c(e.name,n,s,r,t,a)},s=(t,a,r,s,l,u,E)=>{const d=r(t);switch(t){case n.PREVIOUS:return i("chevron-left",t,a,d,s,l);case n.NEXT:return i("chevron-right",t,a,d,s,l);case n.REFRESH:return i("sync",t,a,d,s,l);case n.UPDATE:return i("edit",t,a,d,s,l);case n.CLONE:return i("copy",t,a,d,s,l);case n.REMOVE:return i("delete",t,a,d,s,l);case n.INSERT:return o("plus",t,a,d,d,s,l);case n.CANCEL:return c(t,a,d,d,s,l);case n.SAVE:return o("save",t,a,d,d,s,l);case n.GRID_MODE:return i("table",t,a,d,s,l);case n.FORM_MODE:return i("list",t,a,d,s,l);case n.CONFIGURATOR:return function(n,t,a,r,s,c){return e("snk-configurator",{key:"configurator",configName:c,title:a(n),class:t,enabled:s(n),onChangeViewMode:e=>r(null==e?void 0:e.detail)})}(t,a,r,s,l,E);case n.MORE_OPTIONS:return u&&u.length>0?e("ez-actions-button",{title:d,size:"small",class:a,enabled:l(t),onEzAction:e=>s(e.detail.value),actions:u}):void 0;case n.DIVIDER:return e("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium"})}};function c(n,t,a,r,s,c){return e("ez-button",{title:r,label:a,size:"small",class:t,enabled:c(n),onClick:()=>s(n)})}function i(n,t,a,r,s,c){return e("ez-button",{name:n,title:r,mode:"icon",size:"small",class:a,iconName:n,enabled:c(t),onClick:()=>s(t)})}function o(n,t,a,r,s,c,i){return e("ez-button",{name:n,title:s,label:r,size:"small",class:a,enabled:i(t),onClick:()=>c(t)},e("ez-icon",{class:"ez-padding-right--small",slot:"leftIcon",iconName:n}))}export{t as A,n as T,a as V,r as a,s as b}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as s}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i,H as s}from"./p-9ba3df4c.js";import{ApplicationUtils as r}from"@sankhyalabs/ezui/dist/collection/utils";import{F as l}from"./p-9dd2b8cb.js";const n=class{constructor(i){t(this,i),this.filterChange=e(this,"filterChange",7)}async show(){this._editor.show()}changeConfig(t){this.filterChange.emit(t)}getContentEditor(){switch(this.config.type){case l.BINARY_SELECT:return"snk-filter-binary-select";case l.MULTI_SELECT:return"snk-filter-multi-select";case l.PERIOD:return"snk-filter-period";case l.SEARCH:return"snk-filter-search";case l.NUMBER:return"snk-filter-number";case l.PERSONALIZED:return"snk-filter-personalized"}return"snk-filter-text"}removeItem(){this.changeConfig(Object.assign(Object.assign({},this.config),{visible:!1,fixed:!1,value:void 0}))}getPopUpHeaderButtons(){if(!this.config.hardFixed)return[this.buildIcon(this.getMessage("snkFilterBar.removeFilter"),"delete",(()=>this.removeItem())),this.buildIcon(this.getMessage(this.config.fixed?"snkFilterBar.unpinFilter":"snkFilterBar.pinFilter"),this.config.fixed?"un-pin":"push-pin",(()=>this.changeConfig(Object.assign(Object.assign({},this.config),{fixed:!this.config.fixed}))))]}buildIcon(t,e,s){return i("button",{onClick:()=>s(),class:"sc-snk-filter-bar snk-filter-item__editor-header-button"},i("ez-icon",{title:t,iconName:e}))}apply(){var t;let e=this._editor.value,i=!0;if(this.config.type===l.PERSONALIZED){const s=((null===(t=this.config.props.personalizedFilter)||void 0===t?void 0:t.parameters)||[]).length;0===s?e=[]:i=this.validateAllFilled(s,e)}i&&this.changeConfig(Object.assign(Object.assign({},this.config),{value:e}))}validateAllFilled(t,e){let i=!0;return null!=e&&t>1&&(t>e.length?i=!1:e.forEach((t=>{null==t&&(i=!1)}))),i||r.alert("Filtro parcialmente preenchido","Favor completar todas as informações do filtro."),i}clear(){this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}onKeyDonwListener(t){"Enter"===t.key&&this._applyButton.setFocus().then((()=>this.apply()))}render(){const t=this.getContentEditor();return i(s,null,i("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},i("div",{class:"ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header"},this.config.detailTitle),this.getPopUpHeaderButtons()),i(t,{ref:t=>this._editor=t,value:this.config.value,config:this.config,onKeyDown:t=>this.onKeyDonwListener(t)}),i("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),i("div",{class:"ez-col ez-col--sd-12 ez-align--right"},i("ez-button",{label:this.getMessage("snkFilterBar.cleanFilter"),onClick:()=>this.clear(),size:"small"}),i("ez-button",{ref:t=>this._applyButton=t,label:this.getMessage("snkFilterBar.applyFilter"),onClick:()=>this.apply(),size:"small",class:"ez-button--primary ez-padding-left--medium"})))}};export{n as snk_filter_detail}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as e,h as t,H as l,g as s}from"./p-9ba3df4c.js";import{UserInterface as n,ObjectUtils as o,ApplicationContext as a}from"@sankhyalabs/core";import{DataType as r,getConvertedValue as d}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{CheckMode as u}from"@sankhyalabs/ezui/dist/collection/utils";import{V as h,D as c,a as v}from"./p-a5b26df2.js";const p=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;const 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 h.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,n=h.UserInterface.hasOwnProperty(null==l?void 0:l.userInterface);return!(null!=s&&"true"!==s||!n)}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=c.fixed,this.fieldConfig={defaultValue:{type:this._defaultType}}):null==(null===(i=this.fieldConfig.defaultValue)||void 0===i?void 0:i.type)?(this._defaultType=c.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:c.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!==r.OBJECT&&s!==r.DATE&&"object"==typeof i?i.value:i;return s===r.OBJECT?JSON.stringify(n):n}buildInputDefault({value:i,enabled:e,label:l,name:s,required:a,userInterface:r},d,u){let h,c=0,p=0;const b=null==r||null==v[r]?v.DEFAULT:v[r];if(r===n.OPTIONSELECTOR){const i=null==d?void 0:d.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 r===n.DECIMALNUMBER&&(c=Number((null==d?void 0:d.precision)||2),p=Number((null==d?void 0:d.prettyPrecision)||c));return t(b,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(r,a,h,c,p,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){const{config:e,descriptor:t}=i,{name:l,label:s,readOnly:o,required:a,defaultValue:r}=e,{userInterface:h,properties:c}=t,v=null!=(null==c?void 0:c.allowDefault)?"true"===c.allowDefault:!o;let p;v&&(p=null==r?void 0:r.value,null!=p&&(p=d(null==t?void 0:t.dataType,p)));const b={value:p,enabled:v,label:s,name:l,required:a,userInterface:h};switch(h){case n.SWITCH:return this.buildInputDefault(b,void 0,u.SWITCH);case n.CHECKBOX:return this.buildInputDefault(b,void 0,u.REGULAR);case n.OPTIONSELECTOR:case n.DECIMALNUMBER:return this.buildInputDefault(b,c);default:return this.buildInputDefault(b)}}componentWillLoad(){var i;this.loadDefaultValue(),this._application=a.getContextValue("__SNK__APPLICATION__"),this._fieldProperties=this.getFieldProperties(null===(i=this.fieldConfig)||void 0===i?void 0:i.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:c.fixed},this.getMessage("snkConfigOptions.options.valueFixed")),t("option",{value:c.variable},this.getMessage("snkConfigOptions.options.variable")))),t("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},this._defaultType===c.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({descriptor:this._fieldProperties,config: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:u.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:u.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:u.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)}};p.style=".sc-snk-config-options-h{width:100%;border:2px solid var(--color--secondary-200);border-radius:15px}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";export{p as snk_config_options}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e}from"./p-
|
|
1
|
+
import{r as t,h as e}from"./p-9ba3df4c.js";const s=class{constructor(e){t(this,e)}ezChangeListener(t){this.value=t.detail}render(){if(this.config)return e("ez-text-input",{ref:t=>this._textInputElement=t,label:this.config.label,value:this.config.value})}};export{s as snk_filter_text}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as
|
|
1
|
+
import{p as e,b as a}from"./p-9ba3df4c.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((e=>a([["p-44ce5b90",[[1,"teste-pesquisa"]]],["p-d1ac09c9",[[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]}]]],["p-9dc4426d",[[0,"snk-filter-binary-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-3a276f3d",[[0,"snk-filter-multi-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-cc4bef9f",[[0,"snk-filter-number",{config:[16],value:[2],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-029ae4e4",[[0,"snk-filter-period",{config:[16],value:[8],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-12ad2a19",[[0,"snk-filter-personalized",{config:[16],value:[1040],fix:[16],unfix:[16],show:[64]}]]],["p-2dc76d79",[[0,"snk-filter-search",{config:[16],value:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-e9beab79",[[0,"snk-filter-text",{config:[16],value:[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-6988f4a6",[[2,"snk-pesquisa",{searchLoader:[16],selectItem:[16],argument:[1025],_itemList:[32],_startLoading:[32]}]]],["p-e871aa92",[[2,"snk-config-options",{fieldConfig:[16],idConfig:[513,"id-config"],dataUnit:[16],_defaultType:[32]}]]],["p-2284c850",[[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-deb1f523",[[0,"snk-filter-detail",{config:[1040],getMessage:[16],show:[64]}]]],["p-776ff4d1",[[6,"snk-grid",{configName:[1,"config-name"],actionsList:[16],taskbarManager:[16],statusResolver:[16],_dataUnit:[32],_dataState:[32],_gridConfig:[32],setShowGridConfig:[64],setConfig:[64]}],[2,"snk-field-config",{isConfigActive:[16],fieldConfig:[16],modeInsertion:[516,"mode-insertion"]}]]],["p-1feabfc7",[[2,"snk-form-config",{dataUnit:[16],formConfig:[16],parentForm:[16],_formConfigOptions:[32],_fieldConfigSelected:[32],_layoutFormConfig:[32],_fieldsAvailable:[32],_formConfig:[32],_formConfigChanged:[32],_optionFormConfigSelected:[32],_optionFormConfigChanged:[32],_tempGroups:[32]}]]],["p-7b4a4a50",[[2,"snk-config-modal",{configName:[1,"config-name"],gridMode:[4,"grid-mode"]}]]],["p-366aa0f5",[[2,"snk-filter-bar",{dataUnit:[1040],configName:[1,"config-name"],filterConfig:[1040],allowDefault:[32]},[[0,"filterChange","filterChangeListener"]]],[6,"snk-taskbar",{configName:[1,"config-name"],buttons:[1],customButtons:[16],actionsList:[16],primaryButton:[1,"primary-button"],disabledButtons:[16],dataUnit:[16],_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]}],[2,"snk-configurator",{configName:[1,"config-name"],name:[1],enabled:[4]}]]],["p-2b891c4a",[[2,"snk-form",{configName:[1,"config-name"],recordsValidator:[16],actionsList:[16],taskbarManager:[16],_dataUnit:[32],_dataState:[32],_editionFormConfig:[32],_insertionFormConfig:[32],_showFormConfig:[32],setShowFormConfig:[64],setConfig:[64]}]]],["p-a17a4fca",[[6,"snk-crud",{configName:[1025,"config-name"],actionsList:[16],taskbarManager:[16],recordsValidator:[16],statusResolver:[16],_dataUnit:[32],_dataState:[32],goToView:[64]}]]],["p-36d2d9cf",[[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],createDataunit:[64],getDataUnit:[64],getResourceID:[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],executeSearch:[64],executePreparedSearch:[64],isDebugMode:[64]}]]]],e)));
|
package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IFieldConfig } from "@sankhyalabs/ezui/dist/types/components/ez-form/ez-form";
|
|
2
2
|
import { EventEmitter } from "../../../../stencil-public-runtime";
|
|
3
|
-
import { DataUnit } from '@sankhyalabs/core';
|
|
3
|
+
import { DataUnit, UserInterface } from '@sankhyalabs/core';
|
|
4
4
|
export declare class SnkConfigOptions {
|
|
5
5
|
private _application;
|
|
6
6
|
private _fieldProperties;
|
|
7
|
-
|
|
7
|
+
_element: HTMLSnkConfigOptionsElement;
|
|
8
8
|
private _defaultType;
|
|
9
9
|
/**
|
|
10
10
|
* Armazena as propriedades do campo
|
|
@@ -25,17 +25,27 @@ export declare class SnkConfigOptions {
|
|
|
25
25
|
private onConfigDefault;
|
|
26
26
|
private buildOptions;
|
|
27
27
|
private enabledValueDefault;
|
|
28
|
+
private isAllowDefault;
|
|
29
|
+
private loadDefaultValue;
|
|
28
30
|
private getFieldProperties;
|
|
29
31
|
private getMessage;
|
|
30
32
|
private getDefaultType;
|
|
33
|
+
private getEnabledByProperty;
|
|
34
|
+
private getValueByProperty;
|
|
31
35
|
private getValidatedValue;
|
|
36
|
+
private buildInputDefault;
|
|
37
|
+
private getConditionalAttributes;
|
|
32
38
|
private onChange;
|
|
33
39
|
private onSearch;
|
|
34
|
-
private
|
|
35
|
-
private loadDefaultValue;
|
|
36
|
-
private getEnabledByProperty;
|
|
37
|
-
private getValueByProperty;
|
|
40
|
+
private buildField;
|
|
38
41
|
componentWillLoad(): void;
|
|
39
|
-
componentDidRender(): void;
|
|
40
42
|
render(): any;
|
|
41
43
|
}
|
|
44
|
+
export interface IConfigFieldBuilder {
|
|
45
|
+
name: string;
|
|
46
|
+
label: string;
|
|
47
|
+
value: any;
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
userInterface: UserInterface;
|
|
50
|
+
required?: boolean;
|
|
51
|
+
}
|
|
@@ -60,3 +60,17 @@ export declare const TYPE_ACTIONS: {
|
|
|
60
60
|
export declare const TAB_NAMES: {
|
|
61
61
|
main: string;
|
|
62
62
|
};
|
|
63
|
+
export declare const TAGS_BY_TYPE: {
|
|
64
|
+
LONGTEXT: string;
|
|
65
|
+
FILE: string;
|
|
66
|
+
DATE: string;
|
|
67
|
+
TIME: string;
|
|
68
|
+
DATETIME: string;
|
|
69
|
+
DEFAULT: string;
|
|
70
|
+
SWITCH: string;
|
|
71
|
+
CHECKBOX: string;
|
|
72
|
+
OPTIONSELECTOR: string;
|
|
73
|
+
SEARCH: string;
|
|
74
|
+
INTEGERNUMBER: string;
|
|
75
|
+
DECIMALNUMBER: string;
|
|
76
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sankhyalabs/sankhyablocks",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.9",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@babel/preset-env": "^7.18.2",
|
|
40
40
|
"@sankhyalabs/core": "1.0.71-beta.13",
|
|
41
|
-
"@sankhyalabs/ezui": "1.2.0-beta.
|
|
41
|
+
"@sankhyalabs/ezui": "1.2.0-beta.22",
|
|
42
42
|
"@sankhyalabs/skippeerdeps": "^1.0.2",
|
|
43
43
|
"@semantic-release/git": "^9.0.0",
|
|
44
44
|
"@semantic-release/gitlab": "^6.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as t,h as s,H as l,g as e}from"./p-ddb03141.js";import{ApplicationContext as o}from"@sankhyalabs/core";import{formFieldBuilder as n}from"@sankhyalabs/ezui/dist/collection/utils";import{DataType as a,getConvertedValue as d}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{V as h,D as r,C as u}from"./p-af11b0e7.js";const v=class{constructor(s){i(this,s),this.configOptionsChanged=t(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,t,s;const l=null===(s=null===(i=this.dataUnit)||void 0===i?void 0:i.getField(null===(t=this.fieldConfig)||void 0===t?void 0:t.name))||void 0===s?void 0:s.userInterface;return h.UserInterface[l]}enabledValueDefault(){var i,t,s;const l=null===(i=this.dataUnit)||void 0===i?void 0:i.getField(null===(t=this.fieldConfig)||void 0===t?void 0:t.name);return!("true"!==(null===(s=null==l?void 0:l.properties)||void 0===s?void 0:s.allowDefault)||!h.UserInterface.hasOwnProperty(null==l?void 0:l.userInterface))}getFieldProperties(i){var t;if(null!=i)return null===(t=this.dataUnit)||void 0===t?void 0:t.getField(i)}getMessage(i,t){return this._application.messagesBuilder.getMessage(i,t)}getDefaultType(){var i;return null!==(i=this.fieldConfig.defaultValue.type)&&void 0!==i?i:r.fixed}getValidatedValue(i){var t,s;if(null==i)return;const l=null===(t=this.dataUnit)||void 0===t?void 0:t.getField(null===(s=this.fieldConfig)||void 0===s?void 0:s.name),e=null==l?void 0:l.dataType;if(null==e)return;const o=e!==a.OBJECT&&e!==a.DATE&&"object"==typeof i&&"value"in i?i.value:i;return e===a.OBJECT?JSON.stringify(o):o}onChange(i){this.fieldConfig.defaultValue.value=this.getValidatedValue(null==i?void 0:i.detail),this.configOptionsChanged.emit(this.fieldConfig)}onSearch(i){if(null!=this._application&&null!=this.fieldConfig)return this._application.executeSearch(i,this.fieldConfig.name,this.dataUnit)}loadDataField(){this._element.querySelectorAll("[data-field-name]").forEach((i=>{var t,s,l,e;if(i.enabled="true"===(null===(s=null===(t=this._fieldProperties)||void 0===t?void 0:t.properties)||void 0===s?void 0:s.allowDefault),i.enabled){const t=this.fieldConfig.defaultValue.value;if(null!=t){const s=i.dataset.fieldName,o=null===(e=null===(l=this.dataUnit)||void 0===l?void 0:l.getField(s))||void 0===e?void 0:e.dataType;i.value=d(o,t)}i.addEventListener(u.fieldChanged,(i=>this.onChange(i))),"EZ-SEARCH"===i.tagName&&(i.optionLoader=i=>this.onSearch(i))}}))}loadDefaultValue(){var i;null==this.fieldConfig?(this._defaultType=r.fixed,this.fieldConfig={defaultValue:{type:this._defaultType}}):null==(null===(i=this.fieldConfig.defaultValue)||void 0===i?void 0:i.type)?(this._defaultType=r.fixed,this.fieldConfig.defaultValue={type:this._defaultType}):this._defaultType=this.fieldConfig.defaultValue.type}getEnabledByProperty(i){const t=this._fieldProperties;return null==t||!0!==t[i]}getValueByProperty(i){const t=this._fieldProperties;return null!=t&&!0===t[i]||this.fieldConfig[i]}componentWillLoad(){var i;this._application=o.getContextValue("__SNK__APPLICATION__"),this.loadDefaultValue(),this._fieldProperties=this.getFieldProperties(null===(i=this.fieldConfig)||void 0===i?void 0:i.name)}componentDidRender(){this.loadDataField()}render(){var i,t,e,o;return s(l,null,s("div",{id:this.idConfig},s("div",{class:"ez-row ez-padding--medium"},s("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},s("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)}})),s("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},s("ez-combo-box",{label:this.getMessage("snkConfigOptions.label.typeValueDefault"),suppressEmptyOption:!0,enabled:"true"===(null===(e=null===(t=this._fieldProperties)||void 0===t?void 0:t.properties)||void 0===e?void 0:e.allowDefault),onEzChange:i=>{var t;return this.onConfigDefault(null===(t=i.detail)||void 0===t?void 0:t.value)},value:this.getDefaultType()},s("option",{value:r.fixed},this.getMessage("snkConfigOptions.options.valueFixed")),s("option",{value:r.variable},this.getMessage("snkConfigOptions.options.variable")))),s("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},this._defaultType===r.variable?s("ez-combo-box",{label:this.getMessage("snkConfigOptions.label.valueDefault"),enabled:this.enabledValueDefault(),onEzChange:i=>{var t;this.fieldConfig.defaultValue.value=null===(t=i.detail)||void 0===t?void 0:t.value,this.configOptionsChanged.emit(this.fieldConfig)},value:this.fieldConfig.defaultValue.value,options:this.buildOptions()}):(null===(o=this._fieldProperties)||void 0===o?void 0:o.userInterface)&&n({descriptor:this._fieldProperties,config:this.fieldConfig}).i)),s("div",{class:"ez-row ez-padding--medium config-options__switch-row"},s("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},s("ez-check",{mode:"switch",label:this.getMessage("snkConfigOptions.label.clearDuplicate"),value:this.fieldConfig.cleanOnCopy,onEzChange:i=>{this.fieldConfig.cleanOnCopy=i.detail,this.configOptionsChanged.emit(this.fieldConfig)}})),s("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},s("ez-check",{mode:"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)}})),s("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},s("ez-check",{mode:"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 e(this)}};v.style=".sc-snk-config-options-h{width:100%;border:2px solid var(--color--secondary-200);border-radius:15px}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";export{v as snk_config_options}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as a,F as o,H as n,g as s}from"./p-ddb03141.js";import{d as e}from"./p-b6d6b172.js";import{ApplicationContext as c}from"@sankhyalabs/core";import{C as r,K as l,a as b,T as h}from"./p-af11b0e7.js";import"./p-112455b1.js";const g=class{constructor(a){t(this,a),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 e.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,a;const o=null===(i=null==t?void 0:t.dragEvent)||void 0===i?void 0:i.originalEvent,n=null==o?void 0:o.target,s=null===(a=null==n?void 0:n.tagName)||void 0===a?void 0:a.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((a=>{a.getBoundingClientRect().right<t.clientWidth&&(i=a)})),t.scrollLeft=i.offsetLeft+i.offsetWidth}}updateScroll(){const t=this._scrollContainer;if(t){const{scrollWidth:i,clientWidth:a,scrollLeft:o}=t,n=i-a-Math.ceil(o);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((a=>{a.classList.remove("tab-config__tab--is-focused"),a.id==="tab"+i&&t&&a.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:a}=t.detail;a===b.rename?(this._activeEditText=!0,this._activeEditTextIndex=i.index):a===b.hide||a===b.show?this.hideTab.emit(i):a===b.delete&&this.deleteTab.emit(i)}handleSaveEditionText(t){const{value:i,newValue:a}=t.detail;this._processedTabs.forEach((o=>{o.label===i&&(o.label=a,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=c.getContextValue("__SNK__APPLICATION__"),null!=this._application&&(this._actionsHide=[{value:b.rename,label:this.getMessage("snkTabConfig.labelRename")},{value:b.hide,label:this.getMessage("snkTabConfig.labelHide")},{value:b.delete,label:this.getMessage("snkTabConfig.labelDelete")}],this._actionsShow=[{value:b.rename,label:this.getMessage("snkTabConfig.labelRename")},{value:b.show,label:this.getMessage("snkTabConfig.labelShow")},{value:b.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"),a=t.getAttribute("label")!==h.main?t.getAttribute("label"):this.getMessage("snkFormConfig.form.mainArea"),o=t.hasAttribute("visible"),n={label:a,tabKey:i,index:this._processedTabs.length,visible:o},s=t.firstChild;s&&(s.setAttribute("slot","tab"+n.index),this._hostElem.appendChild(s)),this._processedTabs.push(n)})))}componentDidRender(){this.updateScroll(),this.controlSortableTab()}render(){return a(n,null,a("button",{class:"tab-config__backward-button",ref:t=>this._backwardButton=t,onClick:()=>this.scrollBackward()}),a("div",{class:"tab-config__lower-bar"}),a("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),a("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||a(o,null,i>0&&a("ez-icon",{iconName:t.leftIcon||"drag-indicator",class:"tab-config__left-icon"}),!1===t.visible&&i>0&&a("ez-icon",{iconName:t.leftIcon||"eye-off",class:"tab-config__left-icon tab-config__left-icon--eye-off"}),a("span",{class:"tab-config__tab-label"+(!1===t.visible&&i>0?" tab-config__tab-label-disabled":""),title:t.label},t.label),i>0&&a("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)}),a("slot",{name:n,onSlotchange:t=>{this.handleSlotChange(t)}})),!0===this._activeEditText&&i>0&&this._activeEditTextIndex===i&&a("ez-text-edit",{value:t.label,styled:this.getStyledLabel(n),class:"tab-config__edit-text",onSaveEdition:t=>this.handleSaveEditionText(t),onCancelEdition:()=>this.cancelEditText()}))}))),a("button",{class:"tab-config__forward-button",ref:t=>this._forwardButton=t,onClick:()=>this.scrollFoward()}))}get _hostElem(){return s(this)}};g.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>\');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__scroll--start-hidden.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.tab-config__scroll--middle.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab-config__scroll--end-hidden.sc-snk-tab-config{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab-config__lower-bar.sc-snk-tab-config{position:absolute;left:0%;right:0%;top:91%;bottom:0%;border-radius:2px;background:var(--color--disable-primary);border:2px solid var(--color--disable-primary)}.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(--text--primary, #626e82);font-family:var(--font-pattern, "Sora, Algerian");font-size:var(--title--small, 14px);padding:var(--space--small, 6px) var(--space--medium, 12px)}.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(--color--primary, #008561)}.tab-config__tab.sc-snk-tab-config:hover{color:var(--color--secondary, #383c45)}.tab-config__tab--is-active.sc-snk-tab-config:hover{color:var(--color--primary, #008561)}.tab-config__tab--is-active.sc-snk-tab-config::after{content:"";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.tab-config__tab--is-focused.sc-snk-tab-config{border:1px dashed var(--color--primary, #000000c5)}.tab-config__tab-label.sc-snk-tab-config{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.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(--color--secondary-700, #1C1D22)}.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;background-color:var(--text--primary, #008561);width:10px;height:16px}.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(--color--primary, #4e4e4e)}.tab-config__new-button.sc-snk-tab-config:hover ez-icon.sc-snk-tab-config{--ez-icon--color:var(--color--primary, #4e4e4e)}.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(--space--small);--ez-icon--color:var(--text--disable)}.tab-config__left-icon--eye-off.sc-snk-tab-config{--ez-icon--color:var(--text--disable, #AFB6C0)}.tab-config__right-icon.sc-snk-tab-config{visibility:hidden;padding-left:var(--space--small)}.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(--color--primary)}.tab-config__tab.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--color--secondary, #383c45)}.tab-config__tab--is-active.sc-snk-tab-config:hover .tab-config__right-icon.sc-snk-tab-config{--ez-icon--color:var(--color--primary)}.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(--text--disable, #AFB6C0)}.tab-config__slot.sc-snk-tab-config{margin-left:var(--space--small, 6px)}';export{g as snk_tab_config}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,g as s,H as r}from"./p-ddb03141.js";import{ObjectUtils as l,ApplicationContext as n,DataType as a,StringUtils as o,ErrorException as h,FloatingManager as c,ArrayUtils as d}from"@sankhyalabs/core";import{ApplicationUtils as u}from"@sankhyalabs/ezui/dist/collection/utils";import{C as m,b as f}from"./p-af11b0e7.js";import{C as b}from"./p-d50651a3.js";import{F as k}from"./p-9dd2b8cb.js";import{ModalAction as p,ModalButtonStatus as _}from"@sankhyalabs/ezui/dist/collection/components/ez-modal-container";import{toString as v}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{T as g,V as F,A as z,b as x,a as y}from"./p-ad658f44.js";const T=f.grid,C=f.form,L=class{constructor(e){t(this,e),this.changeViewMode=i(this,"changeViewMode",7),this.name="snkConfigurator",this.enabled=!0}getMessage(t){return this._application.messagesBuilder.getMessage(t,{})}controlConfigModal(t){var i;null!=this._modal&&(this._modal.opened=t,null!=this._configModal&&(this._configModal.gridMode=null!=(null===(i=this._grid)||void 0===i?void 0:i.offsetParent)))}changeConfigModal(t){const i=null==t?void 0:t.detail;(null==i?void 0:i.openConfig)?(this.controlConfigModal(!1),this.callShowConfig(null==i?void 0:i.viewMode)):(null==i?void 0:i.viewMode)===T.index?this.changeViewMode.emit(T.name):(null==i?void 0:i.viewMode)===C.index&&this.changeViewMode.emit(C.name)}callShowConfig(t){t===T.index?(null==this._grid&&this.findGrid(),null!=this._grid&&this._grid.setShowGridConfig(!0)):t===C.index&&(null==this._form&&this.findForm(),null!=this._form&&this._form.setShowFormConfig(!0))}getConfigModal(){const t=document.createElement("ez-modal");t.modalSize="small",t.opened=!1,t.closeEsc=!1,t.closeOutsideClick=!1,t.dataset.configuratorModal=this.name,t.addEventListener(m.closeModal,(()=>{this.controlConfigModal(!1)}));const i=document.createElement("snk-config-modal");return i.addEventListener(m.cancelConfig,(()=>{this.controlConfigModal(!1)})),i.addEventListener(m.changeConfig,(t=>{this.changeConfigModal(t)})),i.configName=this.configName,t.append(i),t}findConfigModal(){let t=document.body.querySelector(`[data-configurator-modal="${this.name}"]`);null==t&&(t=this.getConfigModal(),document.body.appendChild(t)),this._modal=t,this._configModal=t.querySelector("snk-config-modal")}findGrid(){null==this._grid&&(this._grid=b.getGrid(this.configName),null!=this._grid&&null==this._grid.dataset.eventConfigChanged&&(this._grid.dataset.eventConfigChanged="true",this._grid.addEventListener(m.configChanged,(t=>{this.saveConfig(t)}))))}findForm(){null==this._form&&(this._form=b.getForm(this.configName),null!=this._form&&null==this._form.dataset.eventConfigChanged&&(this._form.dataset.eventConfigChanged="true",this._form.addEventListener(m.configChanged,(t=>{this.saveConfig(t)}))))}saveConfig(t){const i=null==t?void 0:t.detail;null!=this._application&&null!=i&&(null!=(null==i?void 0:i.fields)?this._application.saveFormConfig(i,this.configName).then((t=>{null!=(null==t?void 0:t.resource)&&this.loadFormConfig(!0)})):null!=(null==i?void 0:i.columns)&&this._application.saveGridConfig(i).then((t=>{null!=(null==t?void 0:t.resource)&&this.setGridConfig(t.resource)})))}setGridConfig(t){if(null!=this._grid){const i=l.stringToObject(t);this._grid.setConfig(i).then((()=>{u.info(this.getMessage("snkConfigurator.msgSaveSuccessfully"),{iconName:"check"})}))}}loadGridConfig(){null!=this._application&&null!=this.configName&&null!=this._grid&&this._application.loadGridConfig(this.configName).then((t=>{this._grid.setConfig(t)}))}loadFormConfig(t=!1){null!=this._application&&null!=this.configName&&null!=this._form&&this._application.loadFormConfig(this.configName).then((i=>{this._form.setConfig(i).then((()=>{t&&u.info(this.getMessage("snkConfigurator.msgSaveSuccessfully"),{iconName:"check"})}))}))}loadConfig(){this._application=n.getContextValue("__SNK__APPLICATION__"),this.loadGridConfig(),this.loadFormConfig()}componentDidLoad(){this.findConfigModal(),this.findGrid(),this.findForm(),this.loadConfig()}render(){return e("ez-button",{mode:"icon",iconName:"settings-inverted",size:"small",enabled:this.enabled,onClick:()=>this.controlConfigModal(!0)})}get _element(){return s(this)}},w=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)}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||l.objectToString(i)!=l.objectToString(t),this._loadingPending=this._loadingPending||l.objectToString(i.value)!==l.objectToString(t.value)):(this._configUpdated=!0,this._loadingPending=this._loadingPending||null!=t.value)}))}this.processAfterUpdateConfig()}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 k.DEFAULT_FILTER:return function(t){return{name:t.id,expression:t.props.expression,params:[]}}(t);case k.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 k.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 k.PERIOD:return function(t){const{id:i,value:e,props:s}=t;let{end:r,start:l}=e;"string"==typeof r&&(r=new Date(r)),"string"==typeof l&&(l=new Date(l));const n=[];let o;return r&&l?(o=s.expression.fullfill,n.push({name:`${i}.START`,dataType:a.DATE,value:v(a.DATE,l)},{name:`${i}.END`,dataType:a.DATE,value:v(a.DATE,r)})):l?(o=s.expression.onlystart,n.push({name:i,dataType:a.DATE,value:v(a.DATE,l)})):(o=s.expression.onlyend,n.push({name:i,dataType:a.DATE,value:v(a.DATE,r)})),{name:i,expression:o,params:n}}(t);case k.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:v(a.TEXT,e.value)}]}}(t);case k.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:v(a.TEXT,e)}]}}(t);case k.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:v(a.NUMBER,e)}]}}(t);case k.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 l=i>=0&&i<e.length?e[i]:null;return null!=l&&"object"==typeof l&&"value"in l&&(l=l.value),null==l&&r===a.BOOLEAN&&(l=!1),{name:t.name,dataType:r,value:"string"==typeof l?l:v(r,l)}}))}}(t);default:return}})(t);i&&e.push(i)})),e}isActiveFilter(t){return t.visible&&null!=t.value||t.type===k.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=[],i=[];this.filterConfig.filter((t=>t.visible)).forEach(((s,r)=>{const l=`filter-${s.id}`,n=e("snk-filter-item",{onFocusin:()=>this.itemFocused(l),id:l,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(n):i.push(n),n}));const s=[];return s.push(...t),t.length>0&&i.length>0&&s.push(e("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider"})),s.push(...i),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?(l.objectToString(i)!=l.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!==k.DEFAULT_FILTER&&(i||t.type!==k.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===k.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===k.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===k.PERSONALIZED)).sort(((t,i)=>o.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===p.CANCEL?t.items=t.items.map((t=>Object.assign(Object.assign({},t),{active:!1}))):(i===p.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=n.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 e(r,null,e("ez-scroller",{direction:"horizontal"},this.getFilterItems()),e("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)}),e("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)},e("ez-icon",{slot:"leftIcon",class:"ez-padding-right--small",iconName:"plus"})))}get _element(){return s(this)}static get watchers(){return{filterConfig:["observeFilterConfig"]}}};w.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(--more-visible, 2);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:100%;height:100%}';const I=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.innerClickCheck=(t,i)=>i.id!=c.MODAL_ELEMENT_ID||(this.detailIsVisible=!1,!1)}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,{autoClose:!0,innerClickTest:this.innerClickCheck,backClickListener:()=>this.onDetailCloseCallback(),left:this.getScrollOffset(),useOverlay:!0}),this._popover.show(),this.detailIsVisible=!0})))}))}getScrollOffset(){const t=getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");return`calc(${this._filterItemElement.getBoundingClientRect().left}px + ${t})`}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===k.BINARY_SELECT){const[t,e]=s.options;if(t.name===i)return t.label;if(e.name===i)return e.label}if(t===k.MULTI_SELECT)return`${e}: ${s.options.find((t=>t.value===i)).label}`;if(t===k.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===k.SEARCH?`${e}: ${i.value} - ${i.label}`:t===k.PERSONALIZED?e:`${e}: ${i}`}return e}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 k.PERIOD:return"calendar";case k.PERSONALIZED:return"tune"}}render(){const t=this.getLeftIconName();return e(r,null,e("ez-chip",{ref:t=>this._chipElement=t,label:this.getLabel(),value:null!=this.config.value},t?e("ez-icon",{ref:t=>this._leftIconElement=t,iconName:t,class:"ez-padding-right--small",slot:"leftIcon"}):void 0,e("ez-icon",{ref:t=>this._rightIconElement=t,iconName:this.getRightIconName(),class:"ez-padding-left--small",slot:"rightIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("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})))}get _filterItemElement(){return s(this)}},E=class{constructor(e){t(this,e),this.snkItemSelected=i(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()}componentDidRender(){null==this._floatingID&&this._popover&&this._popover.remove()}buildItemElement(t){const i=++this._selectableItemsCount;return e("button",{id:`filter-item${i}`,onFocusin:()=>this._preselection=i,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)},t.iconName?e("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,e("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?d.applyStringFilter(this._filterArgument,this.items.filter((t=>"FILTER"===t.kind))):[];return 0===t.length?e("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,e("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 e(r,{class:"ez-flex ez-flex--column"},e("ez-button",{class:this.buttonClass,label:this.label,onClick:()=>this.buttonClick(),mode:this.iconName?"icon":void 0,iconName:this.iconName,size:"small"},e("slot",{name:"leftIcon"})),e("section",{class:"ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container",ref:t=>this._popoverContainer=t},e("div",{class:"sc-snk-filter-bar snk-filter__popover ez-padding--small",ref:t=>this._popover=t},e("ez-filter-input",{ref:t=>this._filterInput=t,mode:"slim",label:this.findFilterText,value:this._filterArgument,onEzChange:t=>this._filterArgument=t.detail,onFocus:()=>this._preselection=0}),this.getFilterItems(),e("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)}},A=class{constructor(i){t(this,i)}updateValue(t,i){this.items=this.items.map((e=>e.id===t?(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=>e("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"},e("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:"switch"}),e("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===p.LOAD?this._filterInput&&this._filterInput.setFocus():this.processModalAction(i)}render(){const t=this.items.filter((t=>t.active)).length>0,i=this.items?d.applyStringFilter(this._filterArgument,this.items):[];return e("ez-modal-container",{modalTitle:this.modalTitle,modalSubTitle:this.modalSubTitle,cancelButtonLabel:this.cancelButtonLabel,okButtonLabel:this.okButtonLabel,onEzModalAction:t=>this.modalActionListener(t),cancelButtonStatus:t?_.ENABLED:_.DISABLED},e("div",{class:"sc-snk-filter-bar snk-filter-bar__filter-modal-content"},e("div",null,this.useSearch?e("ez-filter-input",{ref:t=>this._filterInput=t,label:this.getMessage("snkFilterBar.modalFindFilter"),onEzChange:t=>this._filterArgument=t.detail}):void 0),i.length>0?e("div",{class:"ez-text ez-text--medium ez-text--primary ez-padding-bottom--small"},this.getActiveFiltersMsg()):void 0,e("div",null,this.buildItems(i)),e("div",{class:"ez-text ez-text--large ez-align--middle ez-text--secondary ez-text--center ez-padding-bottom--large"},this.infoText)))}},O=class{constructor(e){t(this,e),this.actionClick=i(this,"actionClick",7),this.actionChange=i(this,"actionChange",7),this._titleKeyByElement={[g.UPDATE]:"snkTaskbar.titleUpdate",[g.PREVIOUS]:"snkTaskbar.titlePrevious",[g.NEXT]:"snkTaskbar.titleNext",[g.REFRESH]:"snkTaskbar.titleRefresh",[g.CLONE]:"snkTaskbar.titleClone",[g.REMOVE]:"snkTaskbar.titleRemove",[g.MORE_OPTIONS]:"snkTaskbar.titleMoreOptions",[g.INSERT]:"snkTaskbar.titleInsert",[g.CANCEL]:"snkTaskbar.titleCancel",[g.SAVE]:"snkTaskbar.titleSave",[g.GRID_MODE]:"snkTaskbar.titleGridMode",[g.FORM_MODE]:"snkTaskbar.titleFormMode",[g.CONFIGURATOR]:"snkTaskbar.titleConfigurator"}}observeButtons(){this._definitions=void 0}elementsFromString(t){const i=[];return t&&t.split(",").forEach((t=>{t=t.trim(),(F[t]||this.isAllowed(t))&&i.push(t.trim())})),i}isAllowed(t){return!z[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 g.PREVIOUS:this.dataUnit.previousRecord();break;case g.NEXT:this.dataUnit.nextRecord();break;case g.REFRESH:this.dataUnit.loadData();break;case g.CLONE:this.dataUnit.copySelected();break;case g.REMOVE:this.dataUnit.removeSelectedRecords();break;case g.INSERT:this.dataUnit.addRecord();break;case g.CANCEL:this.dataUnit.cancelEdition();break;case g.SAVE:this.dataUnit.saveData()}this.actionClick.emit(t)}isEnabled(t){return!(!this.isAllowed(t)||this.disabledButtons&&this.disabledButtons.includes(t))}getElement(t,i){let e=i===this.primaryButton?"ez-button--primary ":"";return t>1&&(e+="ez-padding-left--medium"),g[i.toString()]?x(i,e,(t=>this.getTitle(t)),(t=>this.elementClick(t)),(t=>this.isEnabled(t)),this.actionsList,this.configName):y(i,e,(t=>this.elementClick(t)),(t=>this.isEnabled(t)))}componentWillLoad(){this._application=n.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))}render(){if(void 0===this._definitions)return;let t=0;return e(r,null,this._definitions.map((i=>(i===g.DIVIDER?t=0:t++,g[i]?this.getElement(t,g[i]):this.customButtons.has(i)?this.getElement(t,this.customButtons.get(i)):e("slot",{name:i})))))}static get watchers(){return{buttons:["observeButtons"]}}};O.style=".sc-snk-taskbar-h{display:flex}";export{L as snk_configurator,w as snk_filter_bar,I as snk_filter_item,E as snk_filter_list,A as snk_filter_modal,O as snk_taskbar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a={grid:{index:0,name:"GRID_MODE"},form:{index:1,name:"FORM_MODE"}},e={add:"ADD",remove:"REMOVE",configuration:"CONFIGURATION"},o={UserInterface:{DATE:[{label:"Data atual",value:"${data}"}],DATETIME:[{label:"Data e hora atuais",value:"${datahora}"}],INTEGERNUMBER:[{label:"Código do usuário logado",value:"${usuario}"},{label:"Empresa do usuário logado",value:"${usuario.empresa}"},{label:"Vendedor para o usuário logado",value:"${usuario.vendedor}"},{label:"Cent. Resultado usuário logado",value:"${usuario.centroresultado}"}]}},r={fixed:"F",variable:"V"},l={closeModal:"ezCloseModal",cancelConfig:"cancelConfig",changeConfig:"changeConfig",configChanged:"configChanged",fieldChanged:"ezChange",dragStart:"sortable:start",dragSort:"sortable:sort",dragSorted:"sortable:sorted",dragStop:"sortable:stop"},s={enter:"Enter",arrowLeft:"ArrowLeft",arrowRight:"ArrowRight",tab:"Tab",escape:"Escape"},t={rename:"RENAME",hide:"HIDE",show:"SHOW",delete:"DELETE"},d={main:"__main"};export{e as A,l as C,r as D,s as K,d as T,o as V,t as a,a as b}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
let e,t,n,l=!1,o=!1,s=!1,i=!1;const c={},r=e=>"object"==(e=typeof e)||"function"===e,f=(e,t,...n)=>{let l=null,o=null,s=null,i=!1,c=!1;const f=[],u=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((i="function"!=typeof e&&!r(l))&&(l+=""),i&&c?f[f.length-1].t+=l:f.push(i?a(null,l):l),c=i)};if(u(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,f,d);const $=a(e,null);return $.l=t,f.length>0&&($.o=f),$.i=o,$.u=s,$},a=(e,t)=>({$:0,h:e,t,m:null,o:null,l:null,i:null,u:null}),u={},d={forEach:(e,t)=>e.map($).forEach(t),map:(e,t)=>e.map($).map(t).map(y)},$=e=>({vattrs:e.l,vchildren:e.o,vkey:e.i,vname:e.u,vtag:e.h,vtext:e.t}),y=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),f(e.vtag,t,...e.vchildren||[])}const t=a(e.vtag,e.vtext);return t.l=e.vattrs,t.o=e.vchildren,t.i=e.vkey,t.u=e.vname,t},h=e=>te(e).p,m=(e,t,n)=>{const l=h(e);return{emit:e=>p(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},p=(e,t,n)=>{const l=ue.ce(t,n);return e.dispatchEvent(l),l},b=new WeakMap,w=e=>"sc-"+e.k,k=(e,t,n,l,o,s)=>{if(n!==l){let i=oe(e,t),c=t.toLowerCase();if("class"===t){const t=e.classList,o=g(n),s=g(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("key"===t);else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const c=r(l);if((i||c&&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){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&s||o)&&!c&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):oe(fe,c)?c.slice(2):c[2]+t.slice(3),n&&ue.rel(e,t,n,!1),l&&ue.ael(e,t,l,!1)}},v=/\s/,g=e=>e?e.split(v):[],S=(e,t,n,l)=>{const o=11===t.m.nodeType&&t.m.host?t.m.host:t.m,s=e&&e.l||c,i=t.l||c;for(l in s)l in i||k(o,l,s[l],void 0,n,t.$);for(l in i)k(o,l,s[l],i[l],n,t.$)},j=(o,i,c,r)=>{const f=i.o[c];let a,u,d,$=0;if(l||(s=!0,"slot"===f.h&&(e&&r.classList.add(e+"-s"),f.$|=f.o?2:1)),null!==f.t)a=f.m=ae.createTextNode(f.t);else if(1&f.$)a=f.m=ae.createTextNode("");else if(a=f.m=ae.createElement(2&f.$?"slot-fb":f.h),S(null,f,!1),null!=e&&a["s-si"]!==e&&a.classList.add(a["s-si"]=e),f.o)for($=0;$<f.o.length;++$)u=j(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.h===f.h&&o.m&&C(o.m,!1)),a},C=(e,t)=>{ue.$|=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"]&&(T(o).insertBefore(o,P(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&C(o,t)}ue.$&=-2},M=(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=j(null,l,s,e),c&&(o[s].m=c,r.insertBefore(c,P(t))))},O=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,F(l),o=!0,s["s-ol"]?s["s-ol"].remove():C(s,!0),s.remove())},R=(e,t)=>e.h===t.h&&("slot"===e.h?e.u===t.u:e.i===t.i),P=e=>e&&e["s-ol"]||e,T=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,x=(e,t)=>{const n=t.m=e.m,l=e.o,o=t.o,s=t.t;let i;null===s?("slot"===t.h||S(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,y=l[0],h=l[$];for(;i<=a&&c<=$;)if(null==u)u=t[++i];else if(null==d)d=t[--a];else if(null==y)y=l[++c];else if(null==h)h=l[--$];else if(R(u,y))x(u,y),u=t[++i],y=l[++c];else if(R(d,h))x(d,h),d=t[--a],h=l[--$];else if(R(u,h))"slot"!==u.h&&"slot"!==h.h||C(u.m.parentNode,!1),x(u,h),e.insertBefore(u.m,d.m.nextSibling),u=t[++i],h=l[--$];else if(R(d,y))"slot"!==u.h&&"slot"!==h.h||C(d.m.parentNode,!1),x(d,y),e.insertBefore(d.m,u.m),d=t[--a],y=l[++c];else{for(r=-1,f=i;f<=a;++f)if(t[f]&&null!==t[f].i&&t[f].i===y.i){r=f;break}r>=0?(s=t[r],s.h!==y.h?o=j(t&&t[c],n,r,e):(x(s,y),t[r]=void 0,o=s.m),y=l[++c]):(o=j(t&&t[c],n,c,e),y=l[++c]),o&&T(u.m).insertBefore(o,P(u.m))}i>a?M(e,null==l[$+1]?null:l[$+1].m,n,l,c,$):c>$&&O(t,i,a)})(n,l,t,o):null!==o?(null!==e.t&&(n.textContent=""),M(n,null,t,o,0,o.length-1)):null!==l&&O(l,0,l.length-1)):(i=n["s-cr"])?i.parentNode.textContent=s:e.t!==s&&(n.data=s)},E=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}E(n)}},L=[],N=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"]||(W(n,s)?(i=L.find((e=>e.v===n)),o=!0,n["s-sn"]=n["s-sn"]||s,i?i.g=t:L.push({g:t,v:n}),n["s-sr"]&&L.map((e=>{W(e.v,n["s-sn"])&&(i=L.find((e=>e.v===n)),i&&!e.g&&(e.g=i.g))}))):L.some((e=>e.v===n))||L.push({v:n}));1===t.nodeType&&N(t)}},W=(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)))},D=(e,t)=>{if(e.$|=16,!(4&e.$))return A(e,e.j),ke((()=>H(e,t)));e.$|=512},H=(e,t)=>{const n=e.C;let l;return t&&(e.$|=256,e.M&&(e.M.map((([e,t])=>z(n,e,t))),e.M=null),l=z(n,"componentWillLoad")),l=B(l,(()=>z(n,"componentWillRender"))),B(l,(()=>U(e,n,t)))},U=async(e,t,n)=>{const l=e.p,o=l["s-rc"];n&&(e=>{const t=e.O,n=e.p,l=t.$,o=((e,t)=>{let n=w(t);const l=re.get(n);if(e=11===e.nodeType?e:ae,l)if("string"==typeof l){let t,o=b.get(e=e.head||e);o||b.set(e,o=new Set),o.has(n)||(t=ae.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);q(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>V(e);0===t.length?n():(Promise.all(t).then(n),e.$|=4,t.length=0)}},q=(i,c)=>{try{c=c.render(),i.$&=-17,i.$|=2,((i,c)=>{const r=i.p,d=i.O,$=i.R||a(null,null),y=(e=>e&&e.h===u)(c)?c:f(null,null,c);if(n=r.tagName,d.P&&(y.l=y.l||{},d.P.map((([e,t])=>y.l[t]=r[e]))),y.h=null,y.$|=4,i.R=y,y.m=$.m=r.shadowRoot||r,e=r["s-sc"],t=r["s-cr"],l=0!=(1&d.$),o=!1,x($,y),ue.$|=1,s){let e,t,n,l,o,s;N(y.m);let i=0;for(;i<L.length;i++)e=L[i],t=e.v,t["s-ol"]||(n=ae.createTextNode(""),n["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=n,t));for(i=0;i<L.length;i++)if(e=L[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&&E(y.m),ue.$&=-2,L.length=0})(i,c)}catch(e){se(e,i.p)}return null},V=e=>{const t=e.p,n=e.C,l=e.j;z(n,"componentDidRender"),64&e.$||(e.$|=64,G(t),z(n,"componentDidLoad"),e.T(t),l||_()),e.L(t),e.S&&(e.S(),e.S=void 0),512&e.$&&we((()=>D(e,!1))),e.$&=-517},_=()=>{G(ae.documentElement),we((()=>p(fe,"appload",{detail:{namespace:"sankhyablocks"}})))},z=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){se(e)}},B=(e,t)=>e&&e.then?e.then(t):t(),G=e=>e.classList.add("hydrated"),I=(e,t,n)=>{if(t.N){e.watchers&&(t.W=e.watchers);const l=Object.entries(t.N),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>te(this).F.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=te(e),s=o.p,i=o.F.get(t),c=o.$,f=o.C;if(n=((e,t)=>null==e||r(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.N[t][0]),(!(8&c)||void 0===i)&&n!==i&&(!Number.isNaN(i)||!Number.isNaN(n))&&(o.F.set(t,n),f)){if(l.W&&128&c){const e=l.W[t];e&&e.map((e=>{try{f[e](n,i,t)}catch(e){se(e,s)}}))}2==(18&c)&&D(o,!1)}})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=te(this);return n.A.then((()=>n.C[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){ue.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},J=e=>{z(e,"connectedCallback")},K=(e,t={})=>{const n=[],l=t.exclude||[],o=fe.customElements,s=ae.head,i=s.querySelector("meta[charset]"),c=ae.createElement("style"),r=[];let f,a=!0;Object.assign(ue,t),ue.D=new URL(t.resourcesUrl||"./",ae.baseURI).href,e.map((e=>{e[1].map((t=>{const s={$:t[0],k:t[1],N:t[2],H:t[3]};s.N=t[2],s.H=t[3],s.P=[],s.W={};const i=s.k,c=class extends HTMLElement{constructor(e){super(e),le(e=this,s),1&s.$&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),a?r.push(this):ue.jmp((()=>(e=>{if(0==(1&ue.$)){const t=te(e),n=t.O,l=()=>{};if(1&t.$)X(e,t,n.H),J(t.C);else{t.$|=1,12&n.$&&(e=>{const t=e["s-cr"]=ae.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.N&&Object.entries(n.N).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=ce(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(n.W=o.watchers,I(o,n,2),o.isProxied=!0);const e=()=>{};t.$|=8;try{new o(t)}catch(e){se(e)}t.$&=-9,t.$|=128,e(),J(t.C)}if(o.style){let e=o.style;const t=w(n);if(!re.has(t)){const l=()=>{};((e,t,n)=>{let l=re.get(e);$e&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,re.set(e,l)})(t,e,!!(1&n.$)),l()}}}const s=t.j,i=()=>D(t,!0);s&&s["s-rc"]?s["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){ue.jmp((()=>(()=>{if(0==(1&ue.$)){const e=te(this),t=e.C;e.U&&(e.U.map((e=>e())),e.U=void 0),z(t,"disconnectedCallback")}})()))}componentOnReady(){return te(this).q}};s.V=e[0],l.includes(i)||o.get(i)||(n.push(i),o.define(i,I(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())):ue.jmp((()=>f=setTimeout(_,30)))},Q=(e,t)=>t,X=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=e,i=Y(t,o),c=Z(n);ue.ael(s,l,i,c),(t.U=t.U||[]).push((()=>ue.rel(s,l,i,c)))}))},Y=(e,t)=>n=>{try{256&e.$?e.C[t](n):(e.M=e.M||[]).push([t,n])}catch(e){se(e)}},Z=e=>0!=(2&e),ee=new WeakMap,te=e=>ee.get(e),ne=(e,t)=>ee.set(t.C=e,t),le=(e,t)=>{const n={$:0,p:e,O:t,F:new Map};return n.A=new Promise((e=>n.L=e)),n.q=new Promise((e=>n.T=e)),e["s-p"]=[],e["s-rc"]=[],X(e,n,t.H),ee.set(e,n)},oe=(e,t)=>t in e,se=(e,t)=>(0,console.error)(e,t),ie=new Map,ce=e=>{const t=e.k.replace(/-/g,"_"),n=e.V,l=ie.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(ie.set(n,e),e[t])),se)
|
|
2
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},re=new Map,fe="undefined"!=typeof window?window:{},ae=fe.document||{head:{}},ue={$:0,D:"",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)},de=e=>Promise.resolve(e),$e=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ye=[],he=[],me=(e,t)=>n=>{e.push(n),i||(i=!0,t&&4&ue.$?we(be):ue.raf(be))},pe=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){se(e)}e.length=0},be=()=>{pe(ye),pe(he),(i=ye.length>0)&&ue.raf(be)},we=e=>de().then(e),ke=me(he,!0);export{Q as F,u as H,K as b,m as c,h as g,f as h,de as p,ne as r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,H as s}from"./p-ddb03141.js";import{UserInterface as a,ApplicationContext as i}from"@sankhyalabs/core";import{convertType as n}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{F as r}from"./p-9dd2b8cb.js";const o=class{constructor(t){e(this,t)}getValue(e,t){if(this.value&&t>=0&&t<this.value.length){const s=this.value[t];return e.type===a.SEARCH?s:n(e.dataType,s)}}setValue(e,t){this.value=null==this.value?Array(e).fill(null):[...this.value],this.value[e]=t,0==this.value.filter((e=>null!=e)).length&&(this.value=null)}doSearch(e,t,s){const a=i.getContextValue("__SNK__APPLICATION__");return new Promise(((i,n)=>{a.executePreparedSearch(e,t,s.searchContext).then((e=>{i(e)})).catch((e=>{n(e)}))}))}getParamsInterface(){var e,s,i;return(null===(i=null===(s=null===(e=this.config)||void 0===e?void 0:e.props)||void 0===s?void 0:s.personalizedFilter)||void 0===i?void 0:i.parameters).map(((e,s)=>{var i;const n="param_"+s;switch(e.type){case a.SEARCH:return t("ez-search",{id:n,suppressEmptyOption:!0,value:this.getValue(e,s),onEzChange:e=>this.setValue(s,e.detail),label:e.label,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s,e)});case a.SWITCH:case a.CHECKBOX:return t("ez-check",{id:n,class:"ez-padding-bottom--medium",mode:a.SWITCH===e.type?"switch":"regular",value:this.getValue(e,s),label:e.label,onEzChange:e=>this.setValue(s,e.detail)});case a.DECIMALNUMBER:case a.INTEGERNUMBER:return t("ez-number-input",{id:n,label:e.label,value:this.getValue(e,s),precision:null===(i=e.props)||void 0===i?void 0:i.precision,onEzChange:e=>this.setValue(s,e.detail)});case a.OPTIONSELECTOR:return t("ez-combo-box",{id:n,label:e.label,value:this.getValue(e,s),options:e.options,onEzChange:e=>{var t;return this.setValue(s,null===(t=e.detail)||void 0===t?void 0:t.value)}});case a.DATE:return t("ez-date-input",{id:n,label:e.label,value:this.getValue(e,s),onEzChange:e=>this.setValue(s,e.detail)});case a.DATETIME:return t("ez-date-time-input",{id:n,label:e.label,value:this.getValue(e,s),onEzChange:e=>this.setValue(s,e.detail)});default:return t("ez-text-input",{id:n,label:e.label,value:this.getValue(e,s),onEzChange:e=>this.setValue(s,e.detail)})}}))}async show(){const e=document.querySelector("#param_0");e&&e.setFocus()}render(){if(this.config&&this.config.type===r.PERSONALIZED)return t(s,null,this.getParamsInterface())}};export{o as snk_filter_personalized}
|