@sankhyalabs/sankhyablocks 8.16.0-dev.35 → 8.16.0-dev.37
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +2 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +4 -3
- package/dist/cjs/{snk-guides-viewer-63054752.js → snk-guides-viewer-4236cb9d.js} +2 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +19 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +19 -1
- package/dist/collection/components/snk-form-config/snk-form-config.js +21 -3
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -0
- package/dist/components/snk-crud.js +3 -1
- package/dist/components/snk-detail-view2.js +3 -1
- package/dist/components/snk-form-config2.js +5 -3
- package/dist/components/snk-taskbar2.js +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-crud.entry.js +2 -1
- package/dist/esm/snk-detail-view.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +4 -3
- package/dist/esm/{snk-guides-viewer-247b38c9.js → snk-guides-viewer-8934c537.js} +2 -1
- package/dist/esm/snk-guides-viewer.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +1 -0
- package/dist/sankhyablocks/{p-bdace6b3.entry.js → p-01086ff7.entry.js} +1 -1
- package/dist/sankhyablocks/p-16869f77.js +1 -0
- package/dist/sankhyablocks/p-2aae03a1.entry.js +1 -0
- package/dist/sankhyablocks/p-92eadb1c.entry.js +1 -0
- package/dist/sankhyablocks/{p-be2cd105.entry.js → p-be5d8fcb.entry.js} +1 -1
- package/dist/sankhyablocks/p-feba9d4b.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +4 -0
- package/dist/types/components/snk-form-config/snk-form-config.d.ts +4 -0
- package/dist/types/components.d.ts +24 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-18ed15f4.entry.js +0 -1
- package/dist/sankhyablocks/p-651b1fb8.js +0 -1
- package/dist/sankhyablocks/p-7e78ddef.entry.js +0 -1
- package/dist/sankhyablocks/p-d836f72b.entry.js +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
import{r as i,c as o,h as n,H as t,g as s}from"./p-d2d301a6.js";import{S as e}from"./p-fa816fb2.js";import{ObjectUtils as l,ElementIDUtils as r,ArrayUtils as a,ApplicationContext as d}from"@sankhyalabs/core";import{ApplicationUtils as c,DialogType as f}from"@sankhyalabs/ezui/dist/collection/utils";import{C as h,a as g,T as u,A as m,D as v}from"./p-b0ef4383.js";import{U as b}from"./p-06421fdb.js";import{buildFormConfigFromDataUnit as p}from"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-f3434fc4.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const _="EZ-COLLAPSIBLE-BOX",k="fieldsWithoutGroupContainer",z="fieldsAvailableContainer",C="addNewGroupContainer",x=class{constructor(n){i(this,n),this.configChange=o(this,"configChange",7),this.configClose=o(this,"configClose",7),this._listEnabledFields=[],this._renderTimer=500,this._tabSelected=1,this._labelNewGroup="Novo grupo",this._mouseOnFieldConfig=!1,this._mouseOnConfigOptions=!1,this._editingTitleGroup=!1,this._newGroupBoxes=[],this._currentGroupBoxes=[],this._formFieldsStyle="ez-col ez-col--sd-12 ez-col--tb-4 ez-padding-right--small ez-padding-bottom--medium sc-snk-form-config",this._fieldsAvailableStyle="ez-col ez-col--sd-12 ez-col--tb-12 ez-margin-bottom--medium ez-margin-right--medium sc-snk-form-config",this._fieldFloatingStyle="form-config__field-config--dragged",this._sortableTimer=100,this._formConfigOptions=[],this._fieldConfigSelected=void 0,this._layoutFormConfig=void 0,this._fieldsAvailable=void 0,this._formConfig={},this._formConfigChanged=!1,this._optionFormConfigSelected=void 0,this._optionFormConfigChanged=!1,this._tempGroups=[],this.dataUnit=void 0,this.configManager=void 0,this.messagesBuilder=void 0,this.ignoreReadOnlyFormFields=void 0}observeConfigManager(){this.loadConfig(this._sortableTimer)}loadFields(i=0){this._layoutFormConfig=[],i>0?setTimeout((()=>{this.buildFields()}),i):this.buildFields()}buildFields(){this.buildFormConfig(),this.buildAvailableFields()}loadFormConfig(i){var o;this._formConfig=this.getConfig(),this.loadFields(i),this.controlFieldConfig(),null!=(null===(o=this._filterFieldsAvailable)||void 0===o?void 0:o.value)&&(this._filterFieldsAvailable.value="")}getConfig(){let i=this.configManager.getConfig(this.dataUnit,this.ignoreReadOnlyFormFields);return i.fields&&0===i.fields.length&&(i=void 0),null==i&&(i=p(this.dataUnit)),l.copy(i)}cancelChangeConfig(){!0===this._formConfigChanged?this.openConfirmDialog(this.getMessage("snkFormConfig.confirm.cancel")).then((i=>{i&&(this._formConfigChanged=!1,this.resetChangeConfig())})):this.resetChangeConfig()}cancelChangeOptionConfig(){!0===this._optionFormConfigChanged?this.openConfirmDialog(this.getMessage("snkFormConfig.confirm.cancel")).then((i=>{i&&(this._optionFormConfigChanged=!1,this.resetChangeOptionConfig())})):this.resetChangeOptionConfig()}resetChangeConfig(){this.loadFormConfig(this._sortableTimer),this.clearTempGroups()}resetChangeOptionConfig(){this._formConfigChanged=!1,this.loadConfig(this._sortableTimer),this.clearTempGroups()}getTabsToSave(){return this._layoutFormConfig.map(((i,o)=>({label:i.tab,order:o,visible:i.visible})))}getFieldsToSave(){const i=[];return this._formContainer.querySelectorAll("snk-field-config").forEach((o=>{const n=o.fieldConfig;if(null==n)return;const t={cleanOnCopy:n.cleanOnCopy||!1,group:n.group,label:n.label,name:n.name,required:n.required,readOnly:n.readOnly,tab:n.tab};null!=n.defaultValue&&(t.defaultValue=null==n.defaultValue.type?{type:v.fixed,value:n.defaultValue}:n.defaultValue),i.push(t)})),i}isDefaultConfiguration(){var i;return(null===(i=this._optionFormConfigSelected)||void 0===i?void 0:i.origin)===b.DEFAULT&&!0===this._optionFormConfigChanged&&!1===this._formConfigChanged}buildConfigToSave(){let i={};const o=this.isDefaultConfiguration();if(i=o?this.getConfig():l.copy(this._formConfig),!1===o){const o=this.getTabsToSave();(null==o?void 0:o.length)>0&&(i.tabs=o);const n=this.getFieldsToSave();(null==n?void 0:n.length)>0&&(i.fields=n)}return i.defaultConfiguration=o,i}saveConfig(){var i;(null===(i=this._tempGroups)||void 0===i?void 0:i.length)>0?c.alert(this.getMessage("snkFormConfig.confirm.title"),this.getMessage("snkFormConfig.confirm.group")):(this._formConfigChanged=!1,this._optionFormConfigChanged=!1,this.configManager.saveConfig(this.buildConfigToSave()).then((i=>{var o;c.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"),{iconName:"check"});const n=null===(o=this._formConfigOptions)||void 0===o?void 0:o.find((i=>i.origin===b.USER));this.setFormConfig(n),this.configChange.emit(i)})))}applyOptionConfig(){if(!0===this._optionFormConfigChanged&&null!=this._optionFormConfigSelected){const i=this._optionFormConfigSelected.name||"configuração selecionada",o=this._optionFormConfigSelected.origin===b.DEFAULT?"pessoal":"padrão",n=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",i).replace("{1}",o);this.openConfirmDialog(n).then((i=>{i&&this.saveConfig()}))}else this.saveConfig()}controlFieldConfig(i){var o;this._fieldConfigSelected=null!=i?(null===(o=this._fieldConfigSelected)||void 0===o?void 0:o.name)===(null==i?void 0:i.name)?void 0:i:void 0}getFieldConfigStyle(i){var o;return this._formFieldsStyle+((null===(o=this._fieldConfigSelected)||void 0===o?void 0:o.name)===i.name?" form-config__field-config--selected":"")}getFieldsByGroup(i){var o;return(null===(o=i.fields)||void 0===o?void 0:o.length)?i.fields.map((i=>{var o,t;return n("div",{key:i.name,class:this.getFieldConfigStyle(i),"data-draggable-element":"field",onMouseDown:i=>this.controlMoveField(i)},n("snk-field-config",{messagesBuilder:this.messagesBuilder,onEzClickIcon:i=>{this.handleFieldConfigChange(i)},modeInsertion:!1,fieldConfig:i,dataUnit:this.dataUnit,isConfigActive:(null===(o=this._fieldConfigSelected)||void 0===o?void 0:o.name)===i.name,id:i.name,key:i.name}),(null===(t=this._fieldConfigSelected)||void 0===t?void 0:t.name)===i.name&&n("div",{class:"ez-flex form-config__config-options"},n("snk-config-options",{idConfig:i.name,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,fieldConfig:this._fieldConfigSelected,"data-element-id":this._element.getAttribute(r.DATA_ELEMENT_ID_ATTRIBUTE_NAME),onConfigOptionsChanged:i=>this.handleconfigOptionsChanged(i.detail)})))})):n("div",{class:"form-config__add-group-container"},n("div",{class:"form-config__add-group-content"},n("div",{class:"form-config__add-group-label"},n("label",{class:"ez-text ez-text--center ez-text--medium ez-text--primary ez-text--bold"},this.getMessage("snkFormConfig.form.labelDropField")))))}handleconfigOptionsChanged(i){var o;null===(o=this._formConfig.fields)||void 0===o||o.forEach((()=>{})),this._formConfigChanged=!0}closeFormConfig(){!0===this._formConfigChanged||!0===this._optionFormConfigChanged?this.openConfirmDialog(this.getMessage("snkFormConfig.confirm.exit")).then((i=>{i&&(this._formConfigChanged=!1,this.configClose.emit())})):this.configClose.emit()}openConfirmDialog(i="",o=this.getMessage("snkFormConfig.confirm.title")){return c.confirm(o,i)}controlMoveField(i){const o=null==i?void 0:i.target;null!=(null==o?void 0:o.closest('[data-draggable-element="field"]'))&&(this._mouseOnFieldConfig=!0,null!=(null==o?void 0:o.closest(".form-config__config-options"))||null!=(null==o?void 0:o.closest(".field-config__options"))?this._mouseOnConfigOptions=!0:!1===["minus","settings-inverted","chevron-up"].includes(null==o?void 0:o.iconName)&&this.controlFieldConfig())}controlStartDraggingField(i){var o,n,t;if(this._mouseOnConfigOptions)null==i||i.cancel(),this._mouseOnConfigOptions=!1;else{const s=null===(t=null===(n=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.dragEvent)||void 0===n?void 0:n.data)||void 0===t?void 0:t.sourceContainer;null!=s&&s.classList.add(this._fieldFloatingStyle)}}controlSortedDraggingField(i){var o,n,t,s,e,l,r,a;const d=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.oldContainer,c=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.newContainer,f=null===(e=null===(s=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.dragEvent)||void 0===s?void 0:s.data)||void 0===e?void 0:e.source,h=null===(a=null===(r=null===(l=null==i?void 0:i.data)||void 0===l?void 0:l.dragEvent)||void 0===r?void 0:r.data)||void 0===a?void 0:a.originalSource;null!=d&&null!=c&&null!=f&&null!=h&&(c.tagName!==_&&c.id!==k||d.id!==z?d.tagName!==_&&d.id!==k||c.id!==z||(f.className=this._fieldsAvailableStyle,f.querySelector("snk-field-config").modeInsertion=!0,h.className=this._fieldsAvailableStyle,h.querySelector("snk-field-config").modeInsertion=!0):(f.className=this._formFieldsStyle,f.querySelector("snk-field-config").modeInsertion=!1,h.className=this._formFieldsStyle,h.querySelector("snk-field-config").modeInsertion=!1))}isCancelDragAvailableField(i,o,n){var t,s;return null!=i&&null!=o&&null!=n&&(null===(t=n.data)||void 0===t?void 0:t.newIndex)!==(null===(s=n.data)||void 0===s?void 0:s.oldIndex)&&i.id===z&&o.id===i.id&&(n.cancel(),this._fieldsAvailable=[],setTimeout((()=>{this.buildAvailableFields()}),this._sortableTimer),!0)}isRemoveField(i,o,n){if(null==i||null==o||null==n)return!1;if((o.tagName===_||o.id===k)&&i.id===z){const i={detail:{field:n,type:m.remove}};return setTimeout((()=>{this.handleFieldConfigChange(i)}),this._renderTimer),!0}return!1}isAddOrMoveField(i,o,n,t){var s;return null!=i&&null!=o&&null!=n&&null!=t&&(t.newIndex!==t.oldIndex||o.dataset.groupName!==i.dataset.groupName||i.id===k&&o.id===z)&&(this.isFieldAvailable(i,o)&&(n.tab=null===(s=this._tabConfig)||void 0===s?void 0:s.selectedTab),n.group=i.dataset.groupName,setTimeout((()=>{i.id.includes(C)&&this.clearTempGroups(!0),this.updateFieldsToSave(o.dataset.groupName!==i.dataset.groupName||i.id===k&&o.id===z?this._sortableTimer:0)}),this._renderTimer),!0)}isFieldAvailable(i,o){return null!=i&&null!=o&&(i.tagName===_||i.id===k)&&o.id===z}controlStopDraggingField(i){var o,n,t,s,e,l;const r=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.oldContainer,a=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.newContainer;if(this.isCancelDragAvailableField(a,r,i))return;const d=null===(e=null===(s=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.dragEvent)||void 0===s?void 0:s.data)||void 0===e?void 0:e.originalSource,c=null===(l=null==d?void 0:d.querySelector("snk-field-config"))||void 0===l?void 0:l.fieldConfig;this.isRemoveField(a,r,c)||this.isAddOrMoveField(a,r,c,null==i?void 0:i.data)}updateFieldsToSave(i=0){const o=this.getFieldsToSave();(null==o?void 0:o.length)>0&&(this._formConfig.fields=o),this.loadFields(i),this._formConfigChanged=!0}controlSortableField(){null!=this._sortableContainer&&(this._sortableField&&this._sortableField.destroy(),this._sortableField=new e(this._sortableContainer.querySelectorAll('[data-draggable-parent="field"]'),{draggable:'[data-draggable-element="field"]',mirror:{constrainDimensions:!0},distance:h.dragStartDistance}),this._sortableField.on(g.dragStart,(i=>this.controlStartDraggingField(i))),this._sortableField.on(g.dragSorted,(i=>this.controlSortedDraggingField(i))),this._sortableField.on(g.dragStop,(i=>this.controlStopDraggingField(i))))}controlStartDraggingGroup(i){(this._mouseOnFieldConfig||this._editingTitleGroup)&&(null==i||i.cancel(),this._mouseOnFieldConfig=!1)}controlStopDraggingGroup(i){i.data.newIndex!==i.data.oldIndex&&setTimeout((()=>{this.updateFieldsToSave(this._sortableTimer)}),this._renderTimer)}controlSortableGroup(){null!=this._sortableContainer&&(this._sortableGroup&&this._sortableGroup.destroy(),this._sortableGroup=new e(this._sortableContainer.querySelectorAll('[data-draggable-parent="group"]'),{draggable:'[data-draggable-element="group"]',mirror:{constrainDimensions:!0},distance:h.dragStartDistance}),this._sortableGroup.on(g.dragStart,(i=>this.controlStartDraggingGroup(i))),this._sortableGroup.on(g.dragStop,(i=>this.controlStopDraggingGroup(i))))}loadUserConfig(){null!=this.configManager&&this.configManager.fetchUserAvailableConfigs().then((i=>{if(this._formConfigOptions=i,null==this._formConfigOptions)return;let o=null==this._formConfig||this._formConfig.defaultConfiguration;const n=i.find((i=>i.origin===(o?b.DEFAULT:b.USER)));this.setFormConfig(n)}))}setFormConfig(i){this._optionFormConfigSelected=i}controlSelectFormConfig(i){const o=null==i?void 0:i.detail,n=this._formConfigOptions.find((i=>i.origin===(null==o?void 0:o.value)));this.setFormConfig(n),this._optionFormConfigChanged=!0,this.loadConfigByUser()}changeTabOrder(i){const o=[],n=this._tabConfig.querySelectorAll(".tab-config__tab");this._tabSelected=i,n.forEach(((i,n)=>{var t;if(n){const s=null===(t=i.querySelector(".tab-config__tab-label"))||void 0===t?void 0:t.getAttribute("title");o.push({label:s,order:n-1})}})),this._layoutFormConfig.map((i=>{o.forEach((o=>{o.label===i.tab&&(o.visible=i.visible)}))})),o.length>0&&(this._formConfig.tabs=o,this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0)}async loadConfigByUser(){if(null==this.configManager)return;if(null==this._optionFormConfigSelected)return;let i;this._optionFormConfigSelected.origin===b.DEFAULT?(i=await this.configManager.fetchDefaultConfig(),i||(i=this.configManager.getEmptyConfig())):i=this.getConfig(),null!=i&&(this._formConfig=i,this._tabSelected=1,this.loadFields(this._sortableTimer),this.controlFieldConfig(),this.clearTempGroups())}loadConfig(i=0){this.loadFormConfig(i),this.loadUserConfig()}addNewGroup(){var i,o;const n=null===(i=this._tabConfig)||void 0===i?void 0:i.selectedTab;null==(null===(o=this._tempGroups)||void 0===o?void 0:o.find((i=>i.tab===n&&i.group.includes(this._labelNewGroup))))&&(this._tempGroups.push({tab:n,group:this.handleDuplicateGroups(this._labelNewGroup,this._tabConfig.selectedTab)}),this.loadFields(),this.controlFieldConfig(),this._formConfigChanged=!0)}clearTempGroups(i=!1){var o;(null===(o=this._tempGroups)||void 0===o?void 0:o.length)>0&&(this._tempGroups=i?this._tempGroups.filter((i=>i.tab!==this._tabConfig.selectedTab)):[])}removeGroup(i){null!=i?this._tempGroups=this._tempGroups.filter(((o,n)=>n!==i&&o.tab===this._tabConfig.selectedTab||o.tab!==this._tabConfig.selectedTab)):this.updateFieldsToSave(this._sortableTimer)}checkGroupExists(i,o,n=!1){var t,s,e;const l=null===(t=this._tabConfig)||void 0===t?void 0:t.selectedTab,r=null===(s=this._layoutFormConfig)||void 0===s?void 0:s.find((i=>i.tab===l)),a=null===(e=null==r?void 0:r.groups)||void 0===e?void 0:e.map((i=>{var o;return null===(o=i.group)||void 0===o?void 0:o.toLowerCase()}));if(null==a?void 0:a.includes(null==i?void 0:i.toLowerCase())){const t=this.getMessage("snkFormConfig.confirm.title"),s=`\n ${this.getMessage("snkFormConfig.alert.titleGroupExists")}\n <b>${i}</b>\n ${this.getMessage("snkFormConfig.alert.inTab")}\n <b>${l===u.main?this.getMessage("snkFormConfig.form.mainArea"):l}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `;return c.alert(t,s).then((()=>{var i,t;n?null===(i=this._newGroupBoxes[o])||void 0===i||i.applyFocusTextEdit():null===(t=this._currentGroupBoxes[l][o])||void 0===t||t.applyFocusTextEdit()})),!1}return!0}saveEditLabelTempGroup(i,o){const{newValue:n}=i.detail;null!=this._newGroupBoxes&&null!=this._newGroupBoxes[o]&&(this._newGroupBoxes[o].dataset.groupName=n)}saveEditLabelGroup(i){var o;const{value:n,newValue:t}=i.detail;null===(o=this._formConfig.fields)||void 0===o||o.forEach((i=>{i.group===n&&(i.group=t)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}renderTempGroupByTab(i){return this._tempGroups.map(((o,t)=>{if(o.tab===i)return n("ez-collapsible-box",{ref:i=>this._newGroupBoxes[t]=i,id:`${C}-${t}`,editable:!0,removable:!0,"header-size":"large",label:o.group,"icon-placement":"left","data-group-name":o.group,"data-draggable-parent":"field",class:"form-config__add-group",onEzRemove:()=>this.removeGroup(t),onEzSaveEditLabel:i=>this.saveEditLabelTempGroup(i,t),onEzEditLabelMode:i=>this._editingTitleGroup=i.detail,conditionalSave:i=>this.checkGroupExists(i,t,!0)},this.getFieldsByGroup(o))}))}handleDuplicateGroups(i,o){var n;const t=this._layoutFormConfig[this._tabConfig.selectedIndex].groups.map((i=>i.group));return null!=t&&(null===(n=this._layoutFormConfig)||void 0===n||n.map((n=>{n.tab===o&&n.groups.some((o=>o.group===i))&&(i+=`${this.captureHighestValueTitle(t)}`)}))),i}captureHighestValueTitle(i){let o=[];return null==i||i.map((i=>{null!=i&&o.push(i.replace(/[^0-9]/g,""))})),Math.max.apply(null,o)>0?` (${Math.max.apply(null,o)+1})`:" (1)"}getLayoutFormConfig(){var i,o;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let n=[],t=[];for(const i of this._formConfig.fields)if(null==t.find((o=>i.name===o.name&&i.tab===o.tab))){t.push(i);const s=this.dataUnit.getField(i.name);if(null==s?void 0:s.visible){null!=i.label&&""!==i.label||(i.label=s.label),null!=i.tab&&""!==i.tab||(i.tab=this.getMessage("snkFormConfig.form.tabGeneral"));let t=n.find((o=>o.tab===i.tab));if(null==t){let s=null;if(null!=this._formConfig.tabs){const o=this._formConfig.tabs.filter((o=>o.label===i.tab));o.length>0&&(s=o[0].visible)}const e=(null===(o=i.tab)||void 0===o?void 0:o.label)||i.tab;t=null!==s?{tab:e,groups:[],visible:s}:{tab:e,groups:[],visible:!0},n.push(t)}const e=t.groups.find((o=>o.group===i.group));if(e)e.fields.push(i);else{const o={group:i.group,fields:[i]};void 0===i.group?t.groups.unshift(o):t.groups.push(o)}}}return n}configureTabs(i){var o;return null==(null===(o=this._formConfig)||void 0===o?void 0:o.tabs)?i:(null==i&&(i=[]),this._formConfig.defaultConfiguration?i:this._formConfig.tabs.map((o=>i.find((i=>{var n,t;return(null===(n=o.label)||void 0===n?void 0:n.toLowerCase())===(null===(t=i.tab)||void 0===t?void 0:t.toLowerCase())}))||{tab:o.label,groups:[],visible:o.visible})))}configureTabMain(i){return null==i&&(i=[]),null==i.find((i=>i.tab===u.main))&&i.unshift({tab:u.main,groups:[],visible:!0}),i}updateTabs(){const i=this.getTabsToSave();(null==i?void 0:i.length)>0&&(this._formConfig.tabs=i,1===i.length&&(this._tabSelected=0))}buildFormConfig(){var i;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let o=this.getLayoutFormConfig();o=this.configureTabs(o),o=this.configureTabMain(o),this._layoutFormConfig=o,this.updateTabs()}buildAvailableFields(){var i,o;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let n=[],t=this.dataUnit.metadata.fields;for(const i of this._formConfig.fields)n.push(i);const s=t.filter((({name:i,visible:o})=>!0===o&&!1===n.some((({name:o})=>o===i))));this._fieldsAvailable=s,this._listEnabledFields=s,null!=(null===(o=this._filterFieldsAvailable)||void 0===o?void 0:o.value)&&this.onFilterChange(this._filterFieldsAvailable.value)}changeTabSelected(i){this._tabSelected=i.index;const o=this._formContainer.querySelector("div#tab"+i.index);this._formContainer.querySelectorAll(".form-config__tab-content").forEach((i=>i.className="form-config__hide-content sc-snk-form-config")),o&&(o.className="form-config__tab-content ez-flex ez-flex--column ez-size-width--full ez-padding--medium sc-snk-form-config")}onFilterChange(i){this._fieldsAvailable=a.applyStringFilter(i,this._listEnabledFields,!0,"label")}orderFieldsAvailable(i){return a.sortAlphabetically(i)}handleLabelCounter(i){const o=[this.getMessage("snkFormConfig.availableFields.labelNoFields"),this.getMessage("snkFormConfig.availableFields.labelOneField")];return i>1?`${i} ${this.getMessage("snkFormConfig.availableFields.labelAvailableFields")}`:o[i]}controlAddFieldConfig(i){var o;if(this._formConfigChanged=!1,null==i)return;null==this._formConfig.fields&&(this._formConfig.fields=[]);const n=this._formConfig.fields.filter((o=>o.name===i.name&&o.tab&&i.tab));n.length>0?n.forEach((o=>{o.name=i.name,o.label=i.label,o.required=i.required,o.readOnly=i.readOnly,o.group=i.group})):this._formConfig.fields.push({name:i.name,label:i.label,required:i.required,readOnly:i.readOnly,group:i.group,tab:null===(o=this._tabConfig)||void 0===o?void 0:o.selectedTab}),this.loadFields(),this.controlFieldConfig(),this._formConfigChanged=!0,this.resetSortables()}controlRemoveFieldConfig(i,o){var n;this._formConfigChanged=!1,null!=i&&(this._formConfig.fields=null===(n=this._formConfig.fields)||void 0===n?void 0:n.filter((o=>o.name!==i.name)),this.loadFields(o),this.controlFieldConfig(),this._formConfigChanged=!0,this.resetSortables())}resetSortables(){this.controlSortableField(),this.controlSortableGroup()}handleFieldConfigChange(i,o=0){const{field:n,type:t}=i.detail;t!==m.configuration?t!==m.remove?t!==m.add||this.controlAddFieldConfig(n):this.controlRemoveFieldConfig(n,o):this.controlFieldConfig(n)}changeTabLabel(i){var o,n;const{value:t,newValue:s}=i.detail.detail;null===(o=this._formConfig.fields)||void 0===o||o.forEach((i=>{i.tab===t&&(i.tab=s)})),null===(n=this._formConfig.tabs)||void 0===n||n.forEach((i=>{i.label===t&&(i.label=s)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}handleDeleteTab(i){let o={canClose:!1,labelCancel:this.getMessage("snkFormConfig.confirm.labelCancel"),labelConfirm:this.getMessage("snkFormConfig.confirm.labelDelete"),btnConfirmDanger:!1};const n=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage("snkFormConfig.confirm.deleteTab")+` <b>${i.detail.label}</b>?`;c.confirm(n,t,null,f.WARN,o).then((o=>{var n;o&&(this._formConfig.tabs=null===(n=this._formConfig.tabs)||void 0===n?void 0:n.filter((o=>o.label!==i.detail.label)),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0)}))}changeHideTab(i){var o;null===(o=this._formConfig.tabs)||void 0===o||o.forEach((o=>{o.label===i.detail.label&&(o.visible=!o.visible)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}handleCanStartDragTab(){var i,o;const n=this._layoutFormConfig.map((i=>i.tab));for(const o of n)null===(i=this._currentGroupBoxes[o])||void 0===i||i.map((i=>null==i?void 0:i.cancelEdition()));null===(o=this._newGroupBoxes)||void 0===o||o.map((i=>null==i?void 0:i.cancelEdition()))}getMessage(i,o){return this.messagesBuilder.getMessage(i,o)}componentDidRender(){this.controlSortableField(),this.controlSortableGroup()}async componentWillRender(){if(null==this.messagesBuilder){const i=d.getContextValue("__SNK__APPLICATION__");this.messagesBuilder=i.messagesBuilder}}componentWillLoad(){this.loadConfig()}componentDidLoad(){r.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}render(){var i,o,s,e;return n(t,null,n("div",{class:"ez-row ez-padding--medium"},n("div",{class:"ez-col ez-col--sd-7 ez-col--tb-9 ez-align--middle"},n("ez-button",{mode:"icon",title:this.getMessage("snkFormConfig.goBackTitle"),iconName:"arrow_back",class:"ez-padding--small",size:"small",onClick:()=>this.closeFormConfig(),id:"formConfigToBack"}),n("h1",{class:"ez-title ez-title--primary ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),this._formConfigOptions&&n("ez-actions-button",{class:"form-config__actions-button ez-margin-left--medium",value:null===(i=this._optionFormConfigSelected)||void 0===i?void 0:i.origin,showLabel:!0,displayIcon:"chevron-down",checkOption:!0,size:"small",actions:this._formConfigOptions.map((i=>({value:i.origin,label:i.name}))),onEzAction:i=>this.controlSelectFormConfig(i),id:"selectConfig"})),n("div",{class:"ez-col ez-col--sd-5 ez-col--tb-3 ez-align--middle ez-align--right"},!0===this._formConfigChanged&&!1===this._optionFormConfigChanged&&n("div",{class:"ez-row ez-align--middle ez-align--right"},n("ez-button",{label:"Cancelar",class:"ez-padding-left--medium",size:"small",onClick:()=>this.cancelChangeConfig()}),n("ez-button",{label:"Salvar",class:"ez-button--primary ez-padding-left--medium",size:"small",onClick:()=>this.saveConfig()},n("ez-icon",{class:"ez-margin-right--small",slot:"leftIcon",iconName:"save"}))),!0===this._optionFormConfigChanged&&n("div",{class:"ez-row ez-align--middle ez-align--right"},n("ez-button",{label:"Cancelar",class:"ez-padding-left--medium",size:"small",onClick:()=>this.cancelChangeOptionConfig()}),n("ez-button",{label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",size:"small",onClick:()=>this.applyOptionConfig()})))),n("div",{class:"ez-row ez-padding--medium",ref:i=>this._sortableContainer=i},n("div",{class:"form-config__tab-container ez-col ez-col--sd-9 ez-col--tb-9 ez-padding-right--medium"},(null===(o=this._layoutFormConfig)||void 0===o?void 0:o.length)>0&&n("section",{class:"ez-box__container",ref:i=>this._formContainer=i},n("snk-tab-config",{ref:i=>this._tabConfig=i,selectedIndex:this._tabSelected,messagesBuilder:this.messagesBuilder,onEzTabChange:i=>this.changeTabSelected(i.detail),onEzOrderChange:i=>this.changeTabOrder(i.detail),onEditionTitleTab:i=>this.changeTabLabel(i),onDeleteTab:i=>this.handleDeleteTab(i),onHideTab:i=>this.changeHideTab(i),onCanStartDrag:()=>this.handleCanStartDragTab(),tabItems:this._layoutFormConfig.map((i=>({tabKey:i.tab,label:i.tab,visible:i.visible})))}),this._layoutFormConfig.map(((i,o)=>n("div",{id:"tab"+o,"data-draggable-parent":"group",class:this._tabSelected===o?"form-config__tab-content ez-flex ez-flex--column ez-size-width--full ez-padding--medium":"form-config__hide-content"},i.groups.map(((o,t)=>o.group?(null==this._currentGroupBoxes[i.tab]&&(this._currentGroupBoxes[i.tab]=[]),n("ez-collapsible-box",{ref:o=>this._currentGroupBoxes[i.tab][t]=o,editable:!0,removable:!0,"header-size":"large",label:o.group,"icon-placement":"left","data-group-name":o.group,"data-draggable-parent":"field","data-draggable-element":"group",onEzRemove:()=>this.removeGroup(),onEzSaveEditLabel:i=>this.saveEditLabelGroup(i),onEzEditLabelMode:i=>this._editingTitleGroup=i.detail,conditionalSave:i=>this.checkGroupExists(i,t)},this.getFieldsByGroup(o))):n("div",{class:"ez-flex ez-flex--column ez-size-width--full"},n("label",{class:"ez-text ez-text--secondary ez-margin-vertical--small"},this.getMessage("snkFormConfig.form.subTitleInfo")),n("div",{id:k,class:"ez-row","data-draggable-parent":"field"},this.getFieldsByGroup(o)),n("hr",{class:"ez-divider-horizontal ez-margin-vertical--medium"})))),this.renderTempGroupByTab(i.tab)))),n("div",{class:"form-config__btn-add-group ez-row"},n("div",{class:"form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center"},n("ez-button",{label:this.getMessage("snkFormConfig.form.labelNewGroup"),class:"ez-padding-horizontal--small ez-button--primary",size:"small",onClick:()=>this.addNewGroup()},n("ez-icon",{class:"ez-margin-right--small",slot:"leftIcon",iconName:"plus"})))))),n("div",{class:"form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3"},n("section",{class:"ez-box__container ez-col ez-col--pn-12"},n("h1",{class:"ez-title ez-title--large ez-title--primary ez-padding-bottom--medium"},this.getMessage("snkFormConfig.availableFields.title")),n("ez-filter-input",{id:"searchFields",ref:i=>this._filterFieldsAvailable=i,label:this.getMessage("snkFormConfig.availableFields.labelSearchField"),onEzChange:i=>this.onFilterChange(i.detail)}),n("span",{class:"ez-box__label-counter ez-text ez-text--medium ez-text--primary ez-margin-bottom--medium"},this.handleLabelCounter(null===(s=this._fieldsAvailable)||void 0===s?void 0:s.length)),(null===(e=this._layoutFormConfig)||void 0===e?void 0:e.length)>0&&n("div",{id:z,class:"ez-row","data-draggable-parent":"field"},this.orderFieldsAvailable(this._fieldsAvailable).map((i=>n("div",{key:i.name,class:this._fieldsAvailableStyle,"data-draggable-element":"field",onMouseDown:i=>this.controlMoveField(i)},n("snk-field-config",{messagesBuilder:this.messagesBuilder,onEzClickIcon:i=>{this.handleFieldConfigChange(i)},dataUnit:this.dataUnit,fieldConfig:i,id:i.name})))))))))}get _element(){return s(this)}static get watchers(){return{configManager:["observeConfigManager"]}}};x.style=".sc-snk-form-config-h{--snk-form-config--z-index:var(--more-visible, 2);--snk-form-config--background-color:var(--background--xlight, #fff);--snk-form-config__icon--color:var(--text--disable, #AFB6C0);--snk-form-config__label-counter--font-weight:var(--text-weight--extra-small, 200);--snk-form-config__add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__add-group-container--background-color:var(--background--medium, #d2dce9);--snk-form-config__add-group-container--padding:var(--space--small, 6px);--snk-form-config__add-group-content--border:2px dashed var(--color-strokes, #DCE0E8);--snk-form-config__add-group-content--border-radius:var(--border--radius-small, 6px);--snk-form-config__add-group-label--padding:var(--space--large, 24px);--snk-form-config__btn-add-group--padding:var(--space--large, 24px) var(--space--medium, 12px) 0;--snk-form-config__btn-add-group-container--padding:var(--space--medium, 12px);--snk-form-config__btn-add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__btn-add-group-container--border:2px solid var(--color-strokes, #DCE0E8);--snk-form-config__btn-add-group-container--background-color:var(--background--body, #fafcff);display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;z-index:var(--snk-form-config--z-index);background-color:var(--snk-form-config--background-color)}div.sc-snk-form-config:focus-visible,div.sc-snk-form-config:focus{outline:none}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--snk-form-config__icon--color)}.ez-box__label-counter.sc-snk-form-config{margin-top:-7px;font-weight:var(--snk-form-config__label-counter--font-weight)}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:var(--snk-form-config--background-color)}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--snk-form-config--z-index)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:235px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--snk-form-config__add-group-container--border-radius);background-color:var(--snk-form-config__add-group-container--background-color);padding:var(--snk-form-config__add-group-container--padding)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:var(--snk-form-config__add-group-content--border);border-radius:var(--snk-form-config__add-group-content--border-radius)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--snk-form-config__add-group-label--padding)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--snk-form-config__btn-add-group--padding)}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--snk-form-config__btn-add-group-container--padding);border-radius:var(--snk-form-config__btn-add-group-container--border-radius);border:var(--snk-form-config__btn-add-group-container--border);background-color:var(--snk-form-config__btn-add-group-container--background-color)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:var(--snk-form-config--background-color)}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{left:calc(100% / 1 * -1)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{left:calc(100% / 1 * -2)}}";export{x as snk_form_config}
|
@@ -1 +1 @@
|
|
1
|
-
import{p as e,b as t}from"./p-d2d301a6.js";export{s as setNonce}from"./p-d2d301a6.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-118e769b",[[1,"teste-pesquisa"]]],["p-70a4af56",[[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filters":[1040],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16],"deletePersonalizedFilter":[16],"filtersToDelete":[16],"disablePersonalizedFilter":[4,"disable-personalized-filter"]},[[0,"deleteFilter","deletePersonalizedFilterListener"]]]]],["p-ac8d1cd6",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-9531fd46",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-21a81901",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-33718dfc",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["p-8c235d4c",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"resetValues":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-5f157b09",[[0,"snk-filter-checkbox-list",{"config":[1040],"optionsList":[32]}]]],["p-d3f53df2",[[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"]]]]],["p-bf2acf72",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-01ba23cd",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[2],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-7e2ded86",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-c8622597",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-96a89d58",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-5b51491f",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-434817f0",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-212213d9",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-d1791da2",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["p-49f1c9be",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"entityName":[1,"entity-name"],"mode":[2],"gridConfig":[1040],"formConfig":[1040],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"pageSize":[2,"page-size"],"resourceID":[1,"resource-i-d"],"enableGridInsert":[4,"enable-grid-insert"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"actionsList":[16],"configName":[1025,"config-name"],"showConfiguratorButtons":[4,"show-configurator-buttons"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"autoLoad":[4,"auto-load"],"_showPopUpGridConfig":[32],"_showFormConfig":[32],"_currentViewMode":[32],"_config":[32],"_fieldToGetFocus":[32],"_customContainerId":[32],"_formFields":[32],"_fieldsProps":[32],"_enableContinuousInsert":[32],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64],"openConfigurator":[64],"closeConfigurator":[64],"updateConfig":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-dcead955",[[2,"snk-attach",{"fetcherType":[1,"fetcher-type"],"fetcher":[16],"dataUnit":[16],"dataUnitBuilder":[16],"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"_currentFetcher":[32],"_currentDataUnit":[32],"crudConfig":[32]}]]],["p-26b0ce3e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-1db45d26",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"customEditors":[16],"fieldsProps":[16],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-8002dcd0",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-9d3a025a",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-fb34e0cf",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-e8763234",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"showChips":[4,"show-chips"],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-b9679243",[[2,"snk-filter-bar",{"customFilterBarConfig":[16],"dataUnit":[1040],"title":[1],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"mode":[1],"filterConfig":[1040],"messagesBuilder":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64],"removeFilterItem":[64],"showFilterModal":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-a75d242d",[[6,"snk-grid",{"columnFilterDataSource":[1040],"configName":[1,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"_enableContinuousInsert":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64],"findColumn":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFocus":[64]},[[2,"click","handleClick"]]]]],["p-7663f597",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-b9c67e45",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"domainMessagesBuilder":[1,"domain-messages-builder"],"fieldsToLink":[32],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64],"getFieldsWithRmp":[64],"getFieldsWithRmPrecision":[64],"getRowMetadata":[64]}]]],["p-18ed15f4",[[6,"snk-taskbar",{"alignRigth":[4,"align-rigth"],"customSlotId":[1,"custom-slot-id"],"customContainerId":[1,"custom-container-id"],"overflowStrategy":[1,"overflow-strategy"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_overFlowedElements":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32],"_hiddenActionsList":[32],"_lastWidth":[32],"_hasToUpdateOverFlow":[32],"_isWaitingForSave":[32]},[[8,"snkCustomSlotElementsLoaded","handleCustomSlotElementsLoaded"],[8,"taskbarSaveLocker","handleTaskbarSaveLocker"],[8,"taskbarSaveUnlocker","handleTaskbarSaveUnlocker"]]]]],["p-54a5d52a",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"showHardFixed":[4,"show-hard-fixed"],"show":[64]}]]],["p-3b60db06",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["p-95df461f",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["p-c2e468c9",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-8eb67fa4",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["p-d836f72b",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["p-16a1dd18",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-7e78ddef",[[6,"snk-crud",{"configName":[1025,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"domainMessagesBuilder":[1,"domain-messages-builder"],"setCustomFormTitle":[16],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64]}]]],["p-60b29483",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"formLegacyConfigName":[1,"form-legacy-config-name"],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-430e4d3c",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32]}]]],["p-bdace6b3",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"formLegacyConfigName":[1,"form-legacy-config-name"],"enableGridInsert":[4,"enable-grid-insert"],"getCustomTitle":[16],"_hasToCreateFieldSearch":[32],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"_fieldToGetFocus":[32],"_customEditors":[32],"_customRenders":[32],"_fieldsProps":[32],"showFormConfig":[64],"findField":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"setFieldProp":[64],"setFocus":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-a42e7a1e",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"loadByPK":[16],"getKeyboardManager":[64],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64],"whenApplicationReady":[64],"setSearchFilterContext":[64]}]]],["p-3ab6df3d",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-eb9f0407",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"]}],[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32],"_actions":[32],"_isOrderActions":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"taskbar-actions-button",{"title":[1],"enabled":[4],"actions":[16],"_showDropdown":[32],"showActions":[64],"hideActions":[64],"isOpened":[64]},[[8,"keydown","handleKeyDown"],[8,"ezOpenModal","handleClose"]]]]],["p-be2cd105",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"customEditors":[16],"customRenders":[16],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64],"addCustomEditor":[64],"addGridCustomRender":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]]]'),e)));
|
1
|
+
import{p as e,b as t}from"./p-d2d301a6.js";export{s as setNonce}from"./p-d2d301a6.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t(JSON.parse('[["p-118e769b",[[1,"teste-pesquisa"]]],["p-70a4af56",[[0,"snk-filter-modal",{"getMessage":[16],"configName":[1025,"config-name"],"filters":[1040],"applyFilters":[16],"closeModal":[16],"addPersonalizedFilter":[16],"editPersonalizedFilter":[16],"deletePersonalizedFilter":[16],"filtersToDelete":[16],"disablePersonalizedFilter":[4,"disable-personalized-filter"]},[[0,"deleteFilter","deletePersonalizedFilterListener"]]]]],["p-ac8d1cd6",[[2,"snk-actions-form",{"action":[16],"applyParameters":[16],"dataUnit":[32],"openPopup":[64]}]]],["p-9531fd46",[[2,"snk-client-confirm",{"titleMessage":[1,"title-message"],"message":[1],"accept":[16],"cancel":[16],"openPopup":[64]}]]],["p-21a81901",[[6,"snk-custom-slot-elements",{"slotName":[1,"slot-name"]}]]],["p-33718dfc",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["p-8c235d4c",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"],"resetValues":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-5f157b09",[[0,"snk-filter-checkbox-list",{"config":[1040],"optionsList":[32]}]]],["p-d3f53df2",[[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"]]]]],["p-bf2acf72",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-01ba23cd",[[0,"snk-filter-number",{"config":[16],"getMessage":[16],"value":[2],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-7e2ded86",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-c8622597",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-96a89d58",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-5b51491f",[[2,"snk-personalized-filter-editor",{"messagesBuilder":[1040],"presentationMode":[2,"presentation-mode"],"config":[16],"value":[1040],"items":[32],"show":[64]}]]],["p-434817f0",[[2,"snk-print-selector",{"_printServerActive":[32],"_selectedPrinter":[32],"_remotePrintersDataSource":[32],"_localPrintersDataSource":[32],"_printJobData":[32],"openPrintSelector":[64]}]]],["p-212213d9",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["p-d1791da2",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["p-49f1c9be",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"entityName":[1,"entity-name"],"mode":[2],"gridConfig":[1040],"formConfig":[1040],"multipleSelection":[4,"multiple-selection"],"useCancelConfirm":[4,"use-cancel-confirm"],"pageSize":[2,"page-size"],"resourceID":[1,"resource-i-d"],"enableGridInsert":[4,"enable-grid-insert"],"taskbarManager":[16],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"actionsList":[16],"configName":[1025,"config-name"],"showConfiguratorButtons":[4,"show-configurator-buttons"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"autoFocus":[4,"auto-focus"],"domainMessagesBuilder":[1,"domain-messages-builder"],"autoLoad":[4,"auto-load"],"_showPopUpGridConfig":[32],"_showFormConfig":[32],"_currentViewMode":[32],"_config":[32],"_fieldToGetFocus":[32],"_customContainerId":[32],"_formFields":[32],"_fieldsProps":[32],"_enableContinuousInsert":[32],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64],"openConfigurator":[64],"closeConfigurator":[64],"updateConfig":[64]},[[0,"actionClick","actionClickListener"]]]]],["p-dcead955",[[2,"snk-attach",{"fetcherType":[1,"fetcher-type"],"fetcher":[16],"dataUnit":[16],"dataUnitBuilder":[16],"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"_currentFetcher":[32],"_currentDataUnit":[32],"crudConfig":[32]}]]],["p-26b0ce3e",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["p-1db45d26",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"fieldToFocus":[1,"field-to-focus"],"customEditors":[16],"fieldsProps":[16],"showUp":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-8002dcd0",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"searchEmpty":[32],"groupEmpty":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["p-9d3a025a",[[2,"snk-expression-group",{"parentTop":[1026,"parent-top"],"group":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityURI":[1025,"entity-u-r-i"],"_conditionOperator":[32],"_group":[32],"_selfTop":[32],"canAddExpression":[32],"_showDashes":[32],"getExpressionGroup":[64]},[[8,"ezExpressionLayoutChanged","todoCompletedHandler"]]],[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"entityURI":[1025,"entity-u-r-i"],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["p-fb34e0cf",[[2,"snk-personalized-filter",{"messagesBuilder":[1040],"entityUri":[1025,"entity-uri"],"filterId":[1025,"filter-id"],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"],"_filterAssistentMode":[32],"_filterAssistent":[32],"createPersonalizedFilter":[64]}]]],["p-e8763234",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"showChips":[4,"show-chips"],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-b9679243",[[2,"snk-filter-bar",{"customFilterBarConfig":[16],"dataUnit":[1040],"title":[1],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"mode":[1],"filterConfig":[1040],"messagesBuilder":[1040],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"allowDefault":[32],"scrollerLocked":[32],"showPersonalizedFilter":[32],"personalizedFilterId":[32],"reload":[64],"getFilterItem":[64],"updateFilterItem":[64],"addFilterItem":[64],"removeFilterItem":[64],"showFilterModal":[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-a75d242d",[[6,"snk-grid",{"columnFilterDataSource":[1040],"configName":[1,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"resourceID":[1,"resource-i-d"],"selectionToastConfig":[16],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"recordsValidator":[16],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"gridHeaderCustomSlotId":[1,"grid-header-custom-slot-id"],"topTaskbarCustomSlotId":[1,"top-taskbar-custom-slot-id"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"_showSnkFilterBar":[32],"_enableContinuousInsert":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64],"getFilterBar":[64],"findColumn":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFocus":[64]},[[2,"click","handleClick"]]]]],["p-7663f597",[[2,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"viewMode":[2,"view-mode"],"customContainerId":[1,"custom-container-id"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["p-b9c67e45",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"ignoreSaveMessage":[4,"ignore-save-message"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"domainMessagesBuilder":[1,"domain-messages-builder"],"fieldsToLink":[32],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64],"getFieldsWithRmp":[64],"getFieldsWithRmPrecision":[64],"getRowMetadata":[64]}]]],["p-2aae03a1",[[6,"snk-taskbar",{"alignRigth":[4,"align-rigth"],"customSlotId":[1,"custom-slot-id"],"customContainerId":[1,"custom-container-id"],"overflowStrategy":[1,"overflow-strategy"],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32],"_overFlowedElements":[32],"_customElements":[32],"_customElementsId":[32],"_slotContainer":[32],"_hiddenActionsList":[32],"_lastWidth":[32],"_hasToUpdateOverFlow":[32],"_isWaitingForSave":[32]},[[8,"snkCustomSlotElementsLoaded","handleCustomSlotElementsLoaded"],[8,"taskbarSaveLocker","handleTaskbarSaveLocker"],[8,"taskbarSaveUnlocker","handleTaskbarSaveUnlocker"]]]]],["p-54a5d52a",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"showHardFixed":[4,"show-hard-fixed"],"show":[64]}]]],["p-3b60db06",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["p-95df461f",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["p-c2e468c9",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["p-8eb67fa4",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["p-feba9d4b",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["p-16a1dd18",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-92eadb1c",[[6,"snk-crud",{"configName":[1025,"config-name"],"filterBarTitle":[1,"filter-bar-title"],"selectionToastConfig":[16],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"useEnterLikeTab":[4,"use-enter-like-tab"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"filterBarLegacyConfigName":[1,"filter-bar-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"disablePersonalizedFilter":[4,"disable-personalized-filter"],"autoLoad":[4,"auto-load"],"autoFocus":[4,"auto-focus"],"enableGridInsert":[4,"enable-grid-insert"],"domainMessagesBuilder":[1,"domain-messages-builder"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"setCustomFormTitle":[16],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"_canEdit":[32],"_resourceID":[32],"customContainerId":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64],"getFilterBar":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"addCustomValueFormatter":[64],"removeCustomValueFormatter":[64],"setFieldProp":[64]}]]],["p-60b29483",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"formLegacyConfigName":[1,"form-legacy-config-name"],"resourceID":[1,"resource-i-d"],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64],"addCustomEditor":[64],"setFieldProp":[64]}]]],["p-430e4d3c",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32]}]]],["p-01086ff7",[[6,"snk-guides-viewer",{"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"canEdit":[4,"can-edit"],"presentationMode":[1,"presentation-mode"],"resourceID":[1,"resource-i-d"],"detailTaskbarCustomContainerId":[1,"detail-taskbar-custom-container-id"],"formLegacyConfigName":[1,"form-legacy-config-name"],"enableGridInsert":[4,"enable-grid-insert"],"ignoreReadOnlyFormFields":[4,"ignore-read-only-form-fields"],"getCustomTitle":[16],"_hasToCreateFieldSearch":[32],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"_fieldToGetFocus":[32],"_customEditors":[32],"_customRenders":[32],"_fieldsProps":[32],"showFormConfig":[64],"findField":[64],"addCustomEditor":[64],"addGridCustomRender":[64],"setFieldProp":[64],"setFocus":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-a42e7a1e",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"gridLegacyConfigName":[1,"grid-legacy-config-name"],"formLegacyConfigName":[1,"form-legacy-config-name"],"loadByPK":[16],"getKeyboardManager":[64],"isUserSup":[64],"addPendingAction":[64],"callServiceBroker":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"showAlerts":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadTotals":[64],"isLoadedByPk":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64],"importScript":[64],"getApplicationPath":[64],"executeSelectDistinct":[64],"getDataFetcher":[64],"whenApplicationReady":[64],"setSearchFilterContext":[64]}]]],["p-3ab6df3d",[[2,"snk-filter-assistent-mode",{"filterAssistent":[1040],"messagesBuilder":[1040],"filterId":[1025,"filter-id"],"entityUri":[1025,"entity-uri"],"application":[1040]}],[2,"snk-filter-advanced-mode",{"filterAssistent":[1040],"application":[1040]}]]],["p-eb9f0407",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"columns":[1040],"config":[1040],"configName":[1,"config-name"],"resourceID":[1,"resource-i-d"]}],[2,"snk-actions-button",{"_items":[32],"_showDropdown":[32],"_actions":[32],"_isOrderActions":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"taskbar-actions-button",{"title":[1],"enabled":[4],"actions":[16],"_showDropdown":[32],"showActions":[64],"hideActions":[64],"isOpened":[64]},[[8,"keydown","handleKeyDown"],[8,"ezOpenModal","handleClose"]]]]],["p-be5d8fcb",[[6,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"resourceID":[1,"resource-i-d"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[1040],"canEdit":[4,"can-edit"],"taskbarCustomContainerId":[1,"taskbar-custom-container-id"],"customEditors":[16],"customRenders":[16],"_disabledButtons":[32],"_currentView":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64],"addCustomEditor":[64],"addGridCustomRender":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]]]'),e)));
|
@@ -112,6 +112,10 @@ export declare class SnkCrud {
|
|
112
112
|
* Define a chave customizada para sobrescrever as mensagens (Não pegando pela entidade)
|
113
113
|
*/
|
114
114
|
domainMessagesBuilder: string;
|
115
|
+
/**
|
116
|
+
* Ignora os campos "somente leitura" no modo de inserção.
|
117
|
+
*/
|
118
|
+
ignoreReadOnlyFormFields?: boolean;
|
115
119
|
/**
|
116
120
|
* Define uma função para configurar um título cusotmizado no modo formulário.
|
117
121
|
*/
|
@@ -89,6 +89,10 @@ export declare class SnkGuidesViewer {
|
|
89
89
|
* Ativa inserção de registros no modo grade.
|
90
90
|
*/
|
91
91
|
enableGridInsert?: boolean;
|
92
|
+
/**
|
93
|
+
* Ignora os campos "somente leitura" no modo de inserção.
|
94
|
+
*/
|
95
|
+
ignoreReadOnlyFormFields?: boolean;
|
92
96
|
/**
|
93
97
|
* Fornece uma função para obter um título customizado do formulário.
|
94
98
|
*/
|
@@ -45,6 +45,10 @@ export declare class SnkFormConfig {
|
|
45
45
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
46
46
|
*/
|
47
47
|
messagesBuilder: SnkMessageBuilder;
|
48
|
+
/**
|
49
|
+
* Ignora os campos "somente leitura" no modo de inserção.
|
50
|
+
*/
|
51
|
+
ignoreReadOnlyFormFields?: boolean;
|
48
52
|
/**
|
49
53
|
* Emitido ao salvar as configurações.
|
50
54
|
*/
|
@@ -488,6 +488,10 @@ export namespace Components {
|
|
488
488
|
* Chave da configuração legado da grade.
|
489
489
|
*/
|
490
490
|
"gridLegacyConfigName": string;
|
491
|
+
/**
|
492
|
+
* Ignora os campos "somente leitura" no modo de inserção.
|
493
|
+
*/
|
494
|
+
"ignoreReadOnlyFormFields"?: boolean;
|
491
495
|
/**
|
492
496
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
493
497
|
*/
|
@@ -1215,6 +1219,10 @@ export namespace Components {
|
|
1215
1219
|
* Repositório de dados, controla a manipulação dos dados.
|
1216
1220
|
*/
|
1217
1221
|
"dataUnit": DataUnit;
|
1222
|
+
/**
|
1223
|
+
* Ignora os campos "somente leitura" no modo de inserção.
|
1224
|
+
*/
|
1225
|
+
"ignoreReadOnlyFormFields"?: boolean;
|
1218
1226
|
/**
|
1219
1227
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
1220
1228
|
*/
|
@@ -1516,6 +1524,10 @@ export namespace Components {
|
|
1516
1524
|
* Fornece uma função para obter um título customizado do formulário.
|
1517
1525
|
*/
|
1518
1526
|
"getCustomTitle": () => string;
|
1527
|
+
/**
|
1528
|
+
* Ignora os campos "somente leitura" no modo de inserção.
|
1529
|
+
*/
|
1530
|
+
"ignoreReadOnlyFormFields"?: boolean;
|
1519
1531
|
/**
|
1520
1532
|
* Configuração do formulário master.
|
1521
1533
|
*/
|
@@ -2594,6 +2606,10 @@ declare namespace LocalJSX {
|
|
2594
2606
|
* Chave da configuração legado da grade.
|
2595
2607
|
*/
|
2596
2608
|
"gridLegacyConfigName"?: string;
|
2609
|
+
/**
|
2610
|
+
* Ignora os campos "somente leitura" no modo de inserção.
|
2611
|
+
*/
|
2612
|
+
"ignoreReadOnlyFormFields"?: boolean;
|
2597
2613
|
/**
|
2598
2614
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
2599
2615
|
*/
|
@@ -3317,6 +3333,10 @@ declare namespace LocalJSX {
|
|
3317
3333
|
* Repositório de dados, controla a manipulação dos dados.
|
3318
3334
|
*/
|
3319
3335
|
"dataUnit"?: DataUnit;
|
3336
|
+
/**
|
3337
|
+
* Ignora os campos "somente leitura" no modo de inserção.
|
3338
|
+
*/
|
3339
|
+
"ignoreReadOnlyFormFields"?: boolean;
|
3320
3340
|
/**
|
3321
3341
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
3322
3342
|
*/
|
@@ -3589,6 +3609,10 @@ declare namespace LocalJSX {
|
|
3589
3609
|
* Fornece uma função para obter um título customizado do formulário.
|
3590
3610
|
*/
|
3591
3611
|
"getCustomTitle"?: () => string;
|
3612
|
+
/**
|
3613
|
+
* Ignora os campos "somente leitura" no modo de inserção.
|
3614
|
+
*/
|
3615
|
+
"ignoreReadOnlyFormFields"?: boolean;
|
3592
3616
|
/**
|
3593
3617
|
* Configuração do formulário master.
|
3594
3618
|
*/
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as a}from"./p-d2d301a6.js";import{Action as h,StringUtils as n,ApplicationContext as r,OVERFLOWED_CLASS_NAME as o,OverflowWatcher as l,OverflowDirection as d,ElementIDUtils as v}from"@sankhyalabs/core";import{A as u}from"./p-dc36cfbf.js";import{T as c,V as k,A as m,b,a as p}from"./p-7e7a7473.js";import{P as T}from"./p-30cf616e.js";import"./p-6dc031de.js";const f=class{constructor(i){t(this,i),this.actionClick=s(this,"actionClick",7),this.taskbarSaveLocker=s(this,"taskbarSaveLocker",7),this.taskbarSaveUnlocker=s(this,"taskbarSaveUnlocker",7),this.TASKBAR_ITEM_ID_PREFIX="TASKBAR_ITEM_",this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME="taskbar-custom-elements-container",this.ACTIONS_BUTTON_TAG="TASKBAR-ACTIONS-BUTTON",this.NOT_OVERFLOW_ELEMENTS=["moreOptions","dataExporter_snkDataExporter","actionsButton_snkActionsButton"],this._titleKeyByElement={[c.UPDATE]:"snkTaskbar.titleUpdate",[c.PREVIOUS]:"snkTaskbar.titlePrevious",[c.NEXT]:"snkTaskbar.titleNext",[c.REFRESH]:"snkTaskbar.titleRefresh",[c.CLONE]:"snkTaskbar.titleClone",[c.REMOVE]:"snkTaskbar.titleRemove",[c.MORE_OPTIONS]:"snkTaskbar.titleMoreOptions",[c.INSERT]:"snkTaskbar.titleInsert",[c.CANCEL]:"snkTaskbar.titleCancel",[c.SAVE]:"snkTaskbar.titleSave",[c.GRID_MODE]:"snkTaskbar.titleGridMode",[c.FORM_MODE]:"snkTaskbar.titleFormMode",[c.CONFIGURATOR]:"snkTaskbar.titleConfigurator",[c.ATTACH]:"snkTaskbar.titleAttach"},this.onSaveEvent=t=>{switch(t.type){case h.FIELD_INVALIDATED:case h.INVALIDATE_CLEAN:case h.DATA_SAVED:case h.SAVING_ERROR:this._isWaitingForSave=!1;break;case h.SAVING_DATA:this._isWaitingForSave=!0}},this._permissions=void 0,this._overFlowedElements=[],this._customElements=void 0,this._customElementsId=void 0,this._slotContainer=void 0,this._hiddenActionsList=[],this._lastWidth=void 0,this._hasToUpdateOverFlow=!1,this._isWaitingForSave=!1,this.alignRigth=!1,this.customSlotId="TASKBAR_CUSTOM_ELEMENTS",this.customContainerId=void 0,this.overflowStrategy="hiddenItems",this.configName=void 0,this.resourceID=void 0,this.buttons=void 0,this.customButtons=void 0,this.actionsList=void 0,this.primaryButton=void 0,this.disabledButtons=void 0,this.dataUnit=void 0,this.presentationMode=T.PRIMARY,this.messagesBuilder=void 0}handleCustomSlotElementsLoaded(t){this.hasToSearchCustomElements(t)&&this.getCustomElements(!0)}handleTaskbarSaveLocker(){!0!==this._isWaitingForSave&&(this._isWaitingForSave=!0)}handleTaskbarSaveUnlocker(){!0===this._isWaitingForSave&&(this._isWaitingForSave=!1)}hasToSearchCustomElements(t){return this.customSlotId===t.detail&&!this._slotContainer}observeButtons(){this._definitions=void 0,requestAnimationFrame((()=>{requestAnimationFrame((()=>{var t;return null===(t=this._overFlowWatcher)||void 0===t?void 0:t.forceUpdate()}))}))}observeDisabledButtons(){var t;null===(t=this._overFlowWatcher)||void 0===t||t.forceUpdate()}observeLastWidth(t,s){0===s&&0!==t&&(this._hasToUpdateOverFlow=!0)}observeIsWaitingForSave(t,s){1==t&&0==s&&this.taskbarSaveLocker.emit(),0==t&&1==s&&this.taskbarSaveUnlocker.emit()}elementsFromString(t){const s=[];return null==t||t.split(",").forEach((t=>{t=t.trim(),(k[t]||this.isAllowed(t))&&s.push(t.trim())})),s}isAllowed(t){return t===m.CONFIGURATOR?!!this._permissions&&(this._permissions.isSup||this._permissions[u.CONFIG_GRID]||this._permissions[u.CONFIG]):!m[t]||!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getTitle(t){var s;let i;return i=this.isAllowed(t)?this._titleKeyByElement[t]:"snkTaskbar.forbidden",i?null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(i,{}):""}elementClick(t){if(this.dataUnit)switch(t){case c.PREVIOUS:this.dataUnit.previousRecord();break;case c.NEXT:this.dataUnit.nextRecord();break;case c.REFRESH:this.dataUnit.loadData();break;case c.CLONE:this.dataUnit.copySelected();break;case c.REMOVE:this.dataUnit.removeSelectedRecords();break;case c.INSERT:this.dataUnit.addRecord();break;case c.CANCEL:this.dataUnit.cancelEdition();break;case c.SAVE:this._isWaitingForSave||(this._isWaitingForSave=!0,this.dataUnit.saveData().finally((()=>{this._isWaitingForSave=!1})))}this.isEnabled(t)&&this.actionClick.emit(t)}isEnabled(t){return!(!this.isAllowed(t)||this.disabledButtons&&this.disabledButtons.includes(t))}validatePresentationMode(){Object.values(T).includes(this.presentationMode)||(this.presentationMode=T.PRIMARY)}getElement(t,s){let i=s===this.primaryButton?"ez-button--primary ":"";t>1&&(i+="ez-padding-left--medium");const e=c[s.toString()],a=this._element.dataset.exporterStoreKey||this.configName;return e?b(s,i,this.getIdElemBtnNative(s),(t=>this.getTitle(t)),(t=>this.elementClick(t)),(t=>this.isEnabled(t)),this.buildDynamicActionsList(),a,this.presentationMode):p(s,i,this.getIdElemBtnCustom(s),(t=>this.elementClick(t)),(t=>this.isEnabled(t)))}buildDynamicActionsList(){var t;return this._hiddenActionsList.length?[...null!==(t=this.actionsList)&&void 0!==t?t:[],{type:"divider",label:"",value:""},...this._hiddenActionsList]:this.actionsList}getIdElemBtnNative(t){return n.toCamelCase(t)}getIdElemBtnCustom(t){return n.toCamelCase(t.name)}isDivider(t){var s;return void 0!==t&&(null===(s=t.t)||void 0===s?void 0:s["data-taskbar-divider"])}removeEmpty(t){let s;return t.filter((t=>!(null==t||this.isDivider(s)&&this.isDivider(t)||(s=t,0))))}appendCustomElementsInTaskbar(){this._customElementsId.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s),e=this._element.querySelector(`#${t}`);e?null==e||e.appendChild(i):this.unlinkCustomElementFromTaskbar(i)}))}addCustomElementContainer(t){var s;const e=`${this.TASKBAR_ITEM_ID_PREFIX}${t}`;return this._customElementsId.includes(e)||(this._customElementsId.push(e),null===(s=this._overFlowWatcher)||void 0===s||s.addNotOverFlowElement(e)),i("span",{class:"ez-padding-left--medium",key:e,id:e})}getCustomElements(t){var s,i;this._customElementsId=[],this._customElements=new Map,this._slotContainer=this.buildSlotContainer(t),Array.from(null!==(i=null===(s=this._slotContainer)||void 0===s?void 0:s.children)&&void 0!==i?i:[]).forEach((t=>this._customElements.set(t.id,t)))}buildSlotContainer(t){let s;if(this.customContainerId){const t=document.querySelector(`#${this.customContainerId}`);s=null==t?void 0:t.querySelector(`#${this.customSlotId}`)}else s=this._element.querySelector(`#${this.customSlotId}`);return t&&!s&&(s=document.querySelector(`#${this.customSlotId}`)),s}componentWillLoad(){this._application=r.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess(this.resourceID).then((t=>this._permissions=t)):this._permissions={},this.getCustomElements()}componentWillRender(){this.handleDefinitions(),this.validatePresentationMode(),this.updateOverFlowIfNeeded()}handleDefinitions(){null==this._definitions&&this._permissions&&(this._definitions=this.elementsFromString(this.buttons))}updateOverFlowIfNeeded(){this._hasToUpdateOverFlow&&(requestAnimationFrame((()=>{var t;return null===(t=this._overFlowWatcher)||void 0===t?void 0:t.forceUpdate()})),this._hasToUpdateOverFlow=!1)}handleOverFlow(t){const s=t.filter((t=>!this.hasToIgnoreOverFlow(t)));this.resetOverFlowedElements(),this.doOverFlowElements(s)}resetOverFlowedElements(){this._overFlowedElements.forEach((t=>{t.classList.remove(o)})),this._hiddenActionsList=[],this._overFlowedElements=[]}doOverFlowElements(t){t.forEach((t=>{t.classList.add(o),this._overFlowedElements.push(t),this.addItemToActionList(t)}))}addItemToActionList(t){const s=this.getTaskbarElementName(t);if(s&&this.isEnabled(s)&&this.isAllowed(s)){const i={value:s,label:this.getTaskbarElementLabel(t),iconName:this.getTaskbarElementIcon(t)};this._hiddenActionsList.push(i)}}getTaskbarElementName(t){var s;return null!==(s=t.getAttribute("data-taskbar-element"))&&void 0!==s?s:""}getTaskbarElementIcon(t){var s;return null!==(s=t.getAttribute("data-taskbar-icon"))&&void 0!==s?s:""}getTaskbarElementLabel(t){var s;return null!==(s=t.getAttribute("data-taskbar-label"))&&void 0!==s?s:""}hasToIgnoreOverFlow(t){return t.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME)}handleOverFlowStrategy(){"hiddenItems"===this.overflowStrategy&&(this._overFlowWatcher=new l(this.buildOverFlowWatcherParams()))}buildOverFlowWatcherParams(){return{element:this._element,callback:this.handleOverFlow.bind(this),overFlowDirection:d.HORIZONTAL,notOverFlow:this.NOT_OVERFLOW_ELEMENTS}}componentDidLoad(){v.addIDInfo(this._element,null,{dataUnit:this.dataUnit}),this.handleOverFlowStrategy(),this.dataUnit.subscribe(this.onSaveEvent)}componentDidRender(){this.appendCustomElementsInTaskbar(),this.updateLastWidth()}updateLastWidth(){this._lastWidth=this._element.getBoundingClientRect().width}disconnectedCallback(){var t;this.unlinkAllCustomElements(),null===(t=this._overFlowWatcher)||void 0===t||t.destroy()}unlinkAllCustomElements(){var t;null===(t=this._customElementsId)||void 0===t||t.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s);this.unlinkCustomElementFromTaskbar(i)}))}unlinkCustomElementFromTaskbar(t){this._slotContainer.appendChild(t)}render(){if(void 0===this._definitions)return;let t=0;return i(e,{class:this.getHostClasses()},this.removeEmpty(this._definitions.map((s=>{var e,a;return t++,c[s]?this.getElement(t,c[s]):(null===(e=this.customButtons)||void 0===e?void 0:e.has(s))?this.getElement(t,this.customButtons.get(s)):this._customElements.has(s)?this.addCustomElementContainer(s):(null===(a=this._overFlowWatcher)||void 0===a||a.addNotOverFlowElement(s),i("slot",{name:s}))}))),i("div",{class:this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME},i("slot",{name:this.customSlotId})))}getHostClasses(){return"hiddenItems"!==this.overflowStrategy?"no-wrap":"full-width "+(this.alignRigth?"align-right":"")}get _element(){return a(this)}static get watchers(){return{buttons:["observeButtons"],disabledButtons:["observeDisabledButtons"],_lastWidth:["observeLastWidth"],_isWaitingForSave:["observeIsWaitingForSave"]}}};f.style=".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";export{f as snk_taskbar}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as i,c as e,h as t,F as s}from"./p-d2d301a6.js";import{Action as r,ElementIDUtils as a}from"@sankhyalabs/core";import{S as n}from"./p-afbb070d.js";import{buildFormMetadata as d,FormMetadata as o}from"@sankhyalabs/ezui/dist/collection/utils/form";import{o as h,T as l,b as u}from"./p-23736d75.js";import{T as c}from"./p-7e7a7473.js";import{d as v}from"./p-b0ef4383.js";import"./p-f3434fc4.js";import"./p-1bf06cd3.js";import{P as g}from"./p-30cf616e.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-7ac7932c.js";import"./p-ff1990ad.js";import"./p-06421fdb.js";import{SelectionMode as m}from"@sankhyalabs/core/dist/dataunit/DataUnit";const k="__FORM:",f=class{constructor(t){i(this,t),this.exit=e(this,"exit",7),this.actionClick=e(this,"actionClick",7),this.formItemsReady=e(this,"formItemsReady",7),this._guideBuilders=new Map,this.dataUnit=void 0,this.dataState=void 0,this.configName=void 0,this.entityPath=void 0,this.actionsList=void 0,this.recordsValidator=void 0,this.masterFormConfig=void 0,this.selectedGuide=void 0,this.taskbarManager=void 0,this.messagesBuilder=void 0,this.canEdit=!0,this.presentationMode=void 0,this.resourceID=void 0,this.detailTaskbarCustomContainerId=void 0,this.formLegacyConfigName=void 0,this.enableGridInsert=!1,this.getCustomTitle=void 0,this._hasToCreateFieldSearch=!0,this._breadcrumbItems=[],this._guides=void 0,this._formEditorConfigManager=void 0,this._formEditorDataUnit=void 0,this._fieldToGetFocus=void 0,this._customEditors=void 0,this._customRenders=void 0,this._fieldsProps={}}observeDataUnit(){this.loadGuides(!0)}observeDataState(i,e){const t=null==i?void 0:i.selectedRecord,s=null==e?void 0:e.selectedRecord;(null==t?void 0:t.__record__id__)!==(null==s?void 0:s.__record__id__)&&this.loadGuides((null==e?void 0:e.insertionMode)!=(null==i?void 0:i.insertionMode))}observeMasterFormConfig(){this.loadGuides(this.noGuideSelected())}async showFormConfig(i=!1){const e=!i||null==this._currentDetail;this._formEditorConfigManager=e?this._configManager:this._currentDetail.formConfigManager,this._formEditorDataUnit=e?this.dataUnit:this._currentDetail.dataUnit}async findField(){await h(this._moreOptions,this._fieldSearch)}async addCustomEditor(i,e){this._customEditors=Object.assign(Object.assign({},this._customEditors),{[i]:e})}async addGridCustomRender(i,e){this._customRenders=Object.assign(Object.assign({},this._customRenders),{[i]:e})}async setFieldProp(i,e,t){const s={[i]:Object.assign(Object.assign({},this._fieldsProps[i]),{[e]:t})};this._fieldsProps=Object.assign(Object.assign({},this._fieldsProps),s)}async setFocus(){this._container.focus()}exitViewer(){!this.enableGridInsert&&this.dataUnit.isDirty()?this.dataUnit.cancelEdition({after:()=>this.exit.emit()}):this.exit.emit()}onActionClick(i){i.detail===c.CONFIGURATOR&&"master"!=i.target.dataset.taskbarOwner&&(this._snkConfigurator.open(),i.stopImmediatePropagation(),i.stopPropagation())}onContentCardChanged(i){f.updateContentCard(i.detail.formName,i.detail.cardConfig,i.detail.propertyChanged,this._configManager).then((()=>this.masterFormConfig=this._configManager.getConfig(this.dataUnit)))}getMessage(i){return this.messagesBuilder.getMessage(i,this.dataUnit.getSelectedRecord())}loadGuides(i){if(!this.dataUnit)return;if(!this._configManager.isLoaded)return;this._masterFormMetadata=d(this.masterFormConfig,this.dataUnit,!0);const e=this._masterFormMetadata.getAllSheets(),t=this.dataUnit.getSelectedRecord(),s=!t||this.dataUnit.isNewRecord(t.__record__id__),r=[];Array.from(e.values()).forEach((i=>{const e={id:i.name,label:i.label};this.isDetail(i.name)&&s&&(e.tooltip="Para alterar detalhes é necessário estar com um registro selecionado.",e.disabled=!0),r.push(e)})),this._guides=r,this._guideNavigator&&this._guideNavigator.updateItem(this._guides),i&&(this.selectedGuide=this._guides.length>0?this._guides[0]:void 0)}isDetail(i){return null!=o.getDetailName(i)}updateGuide(i){this._guideBuilders.set(i.id,i);const e=i.buildGuideItem(this._guideBuilders);this._guideNavigator&&(this._guideNavigator.updateItem(e).then((()=>{this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i}))})),this._guides=this._guides.map((i=>i.id===e.id?Object.assign(Object.assign(Object.assign({},i),e),void 0!==e.children?{}:{children:void 0}):i)))}getTaskBarId(){var i;return(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"snkGuideViewer.finish_edition":"snkGuideViewer.regular"}loadTaskbarProcessor(){var i;const e=this.getTaskBarId(),t=[];this.dataState&&this.dataState.hasPrevious||t.push("PREVIOUS"),this.dataState&&this.dataState.hasNext||t.push("NEXT"),(null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)&&(this.dataState.selectionInfo.length>1&&t.push("CLONE"),this.dataState.selectionInfo.isAllRecords()&&t.push("REMOVE"));const s=["PREVIOUS","NEXT","DIVIDER","ATTACH","CLONE","REMOVE","MORE_OPTIONS","ACTIONS_BUTTON","DIVIDER","GRID_MODE","CONFIGURATOR"];this.presentationMode==g.SECONDARY?s.unshift("INSERT"):s.push("INSERT");const r=this.getInvisibleButtons();this._taskbarProcessor=new l({"snkGuideViewer.regular":s,"snkGuideViewer.finish_edition":["CANCEL","SAVE",this.handleAddGridMode()]}),this._taskbarProcessor.process(e,this.taskbarManager,this.dataState,t,r)}handleAddGridMode(){return this.enableGridInsert?c.GRID_MODE:""}getInvisibleButtons(){const i=[];return this.dataState&&this.dataState.selectionInfo.mode===m.ALL_RECORDS&&i.push("ACTIONS_BUTTON"),i}static updateContentCard(i,e,t,s){return s.saveCardState(i,e,t)}static buildFixedForms(i){var e;const r=null===(e=i.formConfig)||void 0===e?void 0:e.cardsState;if(null!=r)return t(s,null,Array.from(r.entries()).filter((([e,t])=>(null==t?void 0:t.fixed)&&e!=i.selectedForm)).sort((([,i],[,e])=>((null==i?void 0:i.fixSequence)||0)-((null==e?void 0:e.fixSequence)||0))).map((([e,s])=>{var r,a;const n=i.formMetadata.getSheet(e);if(null!=n)return t("snk-form-view",{levelPath:i.levelPath,label:n.label,name:e,fields:n.fields,formMetadata:i.formMetadata,dataUnit:i.dataUnit,recordsValidator:i.recordsValidator,contracted:"CONTRACTED"===(null==s?void 0:s.presentation),fixed:null==s?void 0:s.fixed,summaryFields:null===(a=null===(r=i.formConfig)||void 0===r?void 0:r.summary)||void 0===a?void 0:a.get(e),fieldToFocus:i.fieldToFocus,key:e,onSnkRequestClearFieldToFocus:()=>{var e;return null===(e=i.onRequestClearFieldToFocus)||void 0===e?void 0:e.call(i)},customEditors:i.propsCustomEditor,fieldsProps:i.fieldsProps})})))}wrapDetail(i,e){if(0===i.length)return e;const s=i.pop(),r=o.getDetailName(s);return r?this.wrapDetail(i,t("snk-data-unit",{dataUnitName:`${this.getDataUnitName(i,r)}`,entityName:r},e)):void 0}getDataUnitName(i,e){if(i.length>0){const t=i.map((i=>o.getDetailName(i)));return`${this.entityPath}/${t.join("/")}/${e}`}return`${this.entityPath}/${e}`}getContent(){var i,e,s,r,a;if(!this.selectedGuide)return;const n=this.selectedGuide.id;let d;const h=n.split("::"),l=h.pop(),u=o.getDetailName(l);let c=n;if(u||h.length>0){let e,s;if(n.includes(k)){[c,e]=n.split(k);const t=(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)||0;s=t>1?this._breadcrumbItems[t-2]:this.selectedGuide}else s=this.selectedGuide;d=this.wrapDetail(h,t("snk-detail-view",{ref:i=>this._currentDetail=i,dataUnitName:this.getDataUnitName(h,u),onSnkDetailGuidesChange:i=>this.updateGuide(i.detail),entityName:u,selectedForm:e,branchGuide:s,guideItemPath:this._breadcrumbItems,key:`detail${c}`,canEdit:this.canEdit,onSnkSwitchGuide:i=>this._guideNavigator.selectGuide(i.detail),resourceID:this.resourceID,taskbarCustomContainerId:this.detailTaskbarCustomContainerId,customEditors:this._customEditors,customRenders:this._customRenders}))}else{const i=this.selectedGuide.id,o=this._masterFormMetadata.getSheet(i);if(o){const h=null===(s=null===(e=this.masterFormConfig)||void 0===e?void 0:e.cardsState)||void 0===s?void 0:s.get(i);d=t("snk-form-view",{ref:i=>this._mainForm=i,fixed:null==h?void 0:h.fixed,summaryFields:null===(a=null===(r=this.masterFormConfig)||void 0===r?void 0:r.summary)||void 0===a?void 0:a.get(i),name:i,label:o.label,fields:o.fields,dataUnit:this.dataUnit,formMetadata:this._masterFormMetadata,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,key:n,onSnkRequestClearFieldToFocus:()=>this.clearFieldToFocusHandler(),customEditors:this._customEditors,fieldsProps:this._fieldsProps},this.presentationMode==g.SECONDARY&&this.buildTaskBar())}}return d}onBreadcrumbClickHandler(i){null!=(null==i?void 0:i.id)&&this._guideNavigator.selectGuide(i.id)}updateSelectedGuideHandler(i){this._guideHasChanged=this.selectedGuide!=i,this.selectedGuide=i,this._guideNavigator.getCurrentPath().then((i=>{this._breadcrumbItems=i})),this.resetGuideBadge(i)}changeGuideHandler(i){var e;null===(e=this._guideNavigator)||void 0===e||e.selectGuide(i)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}resetGuideBadge(i){var e;this._guides=[...null===(e=this._guides)||void 0===e?void 0:e.map((e=>this.canClearGuideBadge(e,i.id)?Object.assign(Object.assign({},e),{badge:null}):e))]}canClearGuideBadge(i,e){return i.id===e||this.isIncludedInChildrenList(i,e)}isIncludedInChildrenList(i,e){return this.hasChildren(i)&&this.getChildrenIdList(i).includes(e)}hasChildren(i){return i.children&&Array.isArray(i.children)}getChildrenIdList(i){return i.children.map((i=>i.id))}getConfigViewMode(){return v.GRID}changeConfigViewMode(i){this._currentDetail&&this._currentDetail.changeViewMode(i)}openConfig(i){this._snkConfigurator.close(),this._currentDetail&&(i===v.FORM?this.showFormConfig(!0):this._currentDetail.configGrid())}noGuideSelected(){var i;return void 0===this.selectedGuide||"__main"===(null===(i=this.selectedGuide)||void 0===i?void 0:i.id)}addFormLegacyConfigName(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}setMasterFormConfig(i){this.masterFormConfig=i}componentWillLoad(){if(null==this.resourceID)throw new Error("Erro interno: resourceID não informado");this._configManager=new n(this.configName,this.resourceID,this.setMasterFormConfig.bind(this),this.dataUnit),this.addFormLegacyConfigName(),this._configManager.loadConfig()}componentDidRender(){this._guideHasChanged&&(this._currentDetail?this._currentDetail.showUp():this._mainForm&&this._mainForm.showUp(),this._guideHasChanged=!1)}getFieldsSearch(i,e){return(null==this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._moreOptions=i,i.addEventListener("taskbarActionsButtonDisconnected",(()=>this._hasToCreateFieldSearch=!0)),this._fieldSearch=u(e,(({argument:i})=>this.fieldsOptionLoader(i)),(e=>this.onSelectField(e,i)))),this._fieldSearch}fieldsOptionLoader(i){return Promise.resolve(this._configManager.getFieldsList(i).map((i=>({value:i.name,label:i.label}))))}onSelectField(i,e){if(null==i)return;this._fieldToGetFocus=i.value;const t=this.getGuideName(i.value);t!==this.selectedGuide.id&&this.changeGuideHandler(t),e.hideActions()}getActionsList(){return[{value:"",label:this.getMessage("snkCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,e)=>this.getFieldsSearch(i,e)}].concat(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions?this.taskbarManager.getMoreOptions(this.getTaskBarId(),this.configName,this.dataState,this.actionsList):this.actionsList)}buildTaskBar(){var i;return t("div",{class:"snk-guides-viewer__header-taskbar "+(this.presentationMode!=g.SECONDARY?"ez-align--right":"ez-padding-bottom--medium")},t("snk-taskbar",{key:"guideViewerTaskbar","data-element-id":"guideViewer",configName:this.configName,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,actionsList:this.getActionsList(),messagesBuilder:this.messagesBuilder,presentationMode:this.presentationMode,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"SAVE":"INSERT","data-taskbar-owner":"master",dataUnit:this.dataUnit,resourceID:this.resourceID,customSlotId:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS",alignRigth:!0},t("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"})))}async dataUnitActionHandler(i){var e;if(i.type===r.FIELD_INVALIDATED){const t=this.getGuideName(null===(e=i.payload)||void 0===e?void 0:e.fieldName);await this.addErrorBadgeToGuide(t),await this.openGuideNavigator(t)}}async addErrorBadgeToGuide(i){var e;this._guides=[...null===(e=this._guides)||void 0===e?void 0:e.map((e=>Object.assign(Object.assign({},e),{badge:this.getBadge(e,i)})))]}async openGuideNavigator(i){this.selectedGuide.id!==i&&await this._guideNavigator.openGuideNavidator()}getBadge(i,e){var t;return this.selectedGuide.id===e?null:e===i.id?"error":null!==(t=i.badge)&&void 0!==t?t:null}getGuideName(i){var e;for(const t of this._masterFormMetadata.getAllSheets()){const s=null===(e=t[1])||void 0===e?void 0:e.fields;for(const e of s)if(e.name===i)return t[0]}return""}getTitle(){var i,e;return null!==(e=null===(i=this.getCustomTitle)||void 0===i?void 0:i.call(this))&&void 0!==e?e:this.getMessage("snkCrud.title")}componentDidLoad(){this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this))}render(){var i,e;if(null!=this._formEditorConfigManager)return t("snk-form-config",{ref:i=>this._container=i,tabindex:-1,dataUnit:this._formEditorDataUnit,messagesBuilder:this.messagesBuilder,configManager:this._formEditorConfigManager,onConfigClose:()=>this._formEditorConfigManager=null});if(!this.dataUnit||!this._configManager.isLoaded)return;this.loadTaskbarProcessor();const s=this._guides&&this._guides.length>1;return t("section",{class:"snk-guides-viewer",ref:i=>this._container=i,tabindex:-1},t("div",{class:"ez-row snk-guides-viewer__header"},t("div",{class:"snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large",key:"header"},t("ez-button",{onClick:()=>this.exitViewer(),title:this.getMessage("snkCrud.goBackTitle"),mode:"icon",iconName:"arrow_back",class:"ez-padding-right--medium",size:"small"}),t("div",{class:"ez-flex ez-flex--column ez-flex-item--auto"},t("h1",{class:"ez-title ez-title--primary ez-title--xlarge"},this.getTitle()),(null===(i=this._breadcrumbItems)||void 0===i?void 0:i.length)>1&&t("div",{class:"ez-margin-top--extra-small"},t("ez-breadcrumb",Object.assign({items:this._breadcrumbItems,onSelectedItem:i=>this.onBreadcrumbClickHandler(null==i?void 0:i.detail)},{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${a.getInternalIDInfo("breadcrumb")}`}))))),this.presentationMode!=g.SECONDARY&&this.buildTaskBar()),t("div",{class:"snk-guides-viewer__container"},s?t("ez-guide-navigator",{ref:i=>this._guideNavigator=i,class:"snk-guides-viewer__guide-navigator",items:this._guides,selectedId:this.selectedGuide?this.selectedGuide.id:void 0,onEzSelectionChange:i=>this.updateSelectedGuideHandler(i.detail)}):t("div",null),t("div",{class:"snk-guides-viewer__detail-container"},f.buildFixedForms({formConfig:this.masterFormConfig,formMetadata:this._masterFormMetadata,selectedForm:null===(e=this.selectedGuide)||void 0===e?void 0:e.id,dataUnit:this.dataUnit,recordsValidator:this.recordsValidator,fieldToFocus:this._fieldToGetFocus,onRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),propsCustomEditor:this._customEditors,fieldsProps:this._fieldsProps}),this.getContent())),t("snk-configurator",{ref:i=>this._snkConfigurator=i,viewMode:this.getConfigViewMode(),onConfigSelected:i=>this.changeConfigViewMode(i.detail),messagesBuilder:this.messagesBuilder,onOpenConfig:i=>this.openConfig(i.detail),resourceID:this.resourceID}))}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observeDataState"],masterFormConfig:["observeMasterFormConfig"]}}};f.style=".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";export{f as S}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as a}from"./p-d2d301a6.js";import{StringUtils as o,ElementIDUtils as h,ApplicationContext as n,JSUtils as r,FloatingManager as d}from"@sankhyalabs/core";import{T as c}from"./p-7e7a7473.js";import"./p-f3434fc4.js";import"./p-1bf06cd3.js";import{P as l}from"./p-30cf616e.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-7ac7932c.js";import"./p-ff1990ad.js";import"./p-06421fdb.js";import{d as m}from"./p-b0ef4383.js";import{A as u}from"./p-ca5ec380.js";import"./p-6dc031de.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const p=class{constructor(s){t(this,s),this.actionClick=i(this,"actionClick",7),this.configuratorSave=i(this,"configuratorSave",7),this.configuratorCancel=i(this,"configuratorCancel",7),this.formItemsReady=i(this,"formItemsReady",7),this.viewModeChanged=i(this,"viewModeChanged",7),this._keyDownHandler=async t=>this.keyDownListener(t),this._viewHistory=[],this._customEditors=new Map,this._customRenders=new Map,this._dataUnit=void 0,this._dataState=void 0,this.attachmentRegisterKey=void 0,this._currentViewMode=m.GRID,this._canEdit=void 0,this._resourceID=void 0,this.configName=void 0,this.filterBarTitle=void 0,this.selectionToastConfig=void 0,this.showActionButtons=!1,this.actionsList=void 0,this.taskbarManager=void 0,this.recordsValidator=void 0,this.statusResolver=void 0,this.multipleSelection=!0,this.presentationMode=l.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.disablePersonalizedFilter=void 0,this.autoLoad=void 0,this.autoFocus=!0,this.enableGridInsert=!1,this.domainMessagesBuilder=void 0,this.setCustomFormTitle=void 0,this.customContainerId=`SNK-CRUD-CUSTOM-CONTAINER-${o.generateUUID()}`}async goToView(t){this.executeAction(t)}async openConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.open()}async closeConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.close()}async reloadFilterBar(){var t;null===(t=this._snkGrid)||void 0===t||t.reloadFilterBar()}async getFilterBar(){return await this._snkGrid.getFilterBar()}async addCustomEditor(t,i){if(this._guidesViewer&&this._snkGrid)return this._guidesViewer.addCustomEditor(t,i),void this._snkGrid.addCustomEditor(t,i);const s=new Map(this._customEditors);s.set(t,i),this._customEditors=s}async addGridCustomRender(t,i){if(this._snkGrid)return void this._snkGrid.addGridCustomRender(t,i);const s=new Map(this._customRenders);s.set(t,i),this._customRenders=s}async addCustomValueFormatter(t,i){this._snkGrid.addCustomValueFormatter(t,i)}async removeCustomValueFormatter(t){this._snkGrid.removeCustomValueFormatter(t)}async setFieldProp(t,i,s){await this._guidesViewer.setFieldProp(t,i,s)}currentViewModeWatcher(t){this._viewHistory=[...this._viewHistory.slice(-1),t]}async gridToForm(t=!1){this._backToGrid=!t&&await this._viewStack.getSelectedIndex()===m.GRID,this.setViewMode(m.FORM)}async executeAction(t){return t===c.GRID_MODE?this.setViewMode(m.GRID):t===c.FORM_MODE||t===c.UPDATE?this.gridToForm(t!==c.UPDATE):t===c.CONFIGURATOR?this._snkConfigurator.open():"ATTACH"===t?this.setViewMode(m.ATTACHMENT):void 0}backView(){const t=this._viewHistory.at(-2)||m.GRID;this.setViewMode(t)}setViewMode(t){this._viewStack.show(t),this._currentViewMode=t,t===m.GRID?this._snkGrid.setFocus():t===m.FORM&&this._guidesViewer.setFocus(),this.viewModeChanged.emit(t)}openConfig(t){this._snkConfigurator.close(),t===m.GRID?this._snkGrid.showConfig():t===m.FORM&&this._guidesViewer.showFormConfig()}addDataElementID(){h.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}insertionModeHandler(){this.enableGridInsert||this.gridToForm()}cancelHandler(){this._backToGrid&&this.setViewMode(m.GRID)}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}setCustomRenders(){if(this._snkGrid)for(const[t,i]of this._customRenders)this._snkGrid.addGridCustomRender(t,i),this._customRenders.delete(t)}setCustomEditors(){if(this._snkGrid&&this._guidesViewer)for(const[t,i]of this._customEditors)this._guidesViewer.addCustomEditor(t,i),this._snkGrid.addCustomEditor(t,i),this._customEditors.delete(t)}componentDidRender(){this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__");let t=this._element.parentElement;for(this._application.hasAccess(u.UPDATE,this._resourceID).then((t=>this._canEdit=t));t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._snkDataUnit.domainMessagesBuilder=this.domainMessagesBuilder,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.initDataUnit():this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail,this.initDataUnit()})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}t=t.parentElement}this.configName||(this.configName=this._application.configName)}componentDidLoad(){this.initKeyboardManager()}disconnectedCallback(){this.removeShortcuts(),window.removeEventListener("keydown",this._keyDownHandler)}async handleDataStateChange(t){var i;this._dataState=t.detail,void 0!==this._dataState.selectedRecord&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey());const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const t of s||[]){if(!t)continue;const s=null===(i=this._dataState.rowMetadata)||void 0===i?void 0:i.getProp("rm_precision",t);(s||0===s)&&(await this.setFieldProp(t,"precision",s),await this.setFieldProp(t,"prettyPrecision",s))}}async initKeyboardManager(){var t;const i=await(null===(t=this._application)||void 0===t?void 0:t.getKeyboardManager());if(i){const s=this._dataUnit||await this._snkDataUnit.getDataUnit();async function e(){const t=document.activeElement,i=t==document.body;i||t.blur(),await s.saveData(),i||null==t.setFocus?i||t.focus():t.setFocus()}i.bind("F6",this.toggleView.bind(this),{description:"Alterna entre modo formulário e grade.",element:this._element}).bind("F7",e.bind(this),{description:"Salva os dados.",element:this._element}).bind("ctrl + \\",e.bind(this),{description:"Salva os dados.",element:this._element}).bind("F8",s.addRecord.bind(s),{description:"Adiciona um novo registro.",element:this._element}).bind("F9",s.removeSelectedRecords.bind(s),{description:"Remove o registro selecionado.",element:this._element}).bind("ctrl + F9",s.removeSelectedRecords.bind(s),{description:"Remove o registro selecionado.",element:this._element}).bind("ctrl + .",(()=>0===s.getSelectionInfo().records.length?s.selectFirst():s.nextRecord()),{description:"Avança para o próximo registro.",element:this._element}).bind("ctrl + ,",s.previousRecord.bind(s),{description:"Retorna ao registro anterior.",element:this._element}).bind("F5",(async()=>{const t=await this._viewStack.getSelectedIndex();m.GRID===t&&s.loadData()}),{description:"Atualiza os dados.",element:this._element}).bind("Escape",(()=>{s.isDirty()&&s.cancelEdition()}),{debounceTime:1e3,description:"Cancela uma ação.",element:this._element})}}async removeShortcuts(){var t;const i=await(null===(t=this._application)||void 0===t?void 0:t.getKeyboardManager());i&&i.unbind("F6").unbind("F7").unbind("ctrl + \\").unbind("F8").unbind("F9").unbind("ctrl + F9").unbind("ctrl + .").unbind("ctrl + ,").unbind("F5").unbind("Escape")}async toggleView(){const t=await this._viewStack.getSelectedIndex();this.setViewMode(m.GRID===t?m.FORM:m.GRID)}async initDataUnit(){this.addDataElementID(),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),null==this._resourceID&&(this._resourceID=this._snkDataUnit.resourceID,null==this._resourceID&&(this._resourceID=await this._application.getResourceID()))}handleConfiguratorEvent(t,i){t.stopImmediatePropagation(),"SAVE"!==i?this.configuratorCancel.emit():this.configuratorSave.emit()}async keyDownListener(t){t.ctrlKey&&null!=t.key&&"F"===t.key.toUpperCase()&&null!=this._element&&(r.isHiddenElement(this._element)||(d.closeAll(),this._currentViewMode===m.GRID?await this._snkGrid.findColumn():await this._guidesViewer.findField(),t.preventDefault()))}connectedCallback(){window.addEventListener("keydown",this._keyDownHandler,{capture:!0})}render(){if(null!=this._resourceID)return this._snkDataUnit.ignoreSaveMessage=this._currentViewMode===m.GRID&&!this.enableGridInsert,s(e,null,s("ez-view-stack",{ref:t=>this._viewStack=t,"data-element-id":"crud"},s("stack-item",null,s("snk-grid",{ref:t=>this._snkGrid=t,filterBarTitle:this.filterBarTitle,"data-element-id":"crud_grid",configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail),messagesBuilder:this.messagesBuilder,actionsList:this.actionsList,statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,presentationMode:this.presentationMode,recordsValidator:this.recordsValidator,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,canEdit:this._canEdit,resourceID:this._resourceID,disablePersonalizedFilter:this.disablePersonalizedFilter,gridLegacyConfigName:this.gridLegacyConfigName,filterBarLegacyConfigName:this.filterBarLegacyConfigName,autoLoad:this.autoLoad,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert},s("slot",{name:"GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}))),s("stack-item",null,s("snk-guides-viewer",{ref:t=>this._guidesViewer=t,entityPath:this._snkDataUnit.entityName,messagesBuilder:this.messagesBuilder,onExit:()=>this.setViewMode(m.GRID),dataState:this._dataState,dataUnit:this._dataUnit,actionsList:this.actionsList,taskbarManager:this.taskbarManager,configName:this.configName,onActionClick:t=>this.executeAction(t.detail),presentationMode:this.presentationMode,"data-element-id":"crud_form",canEdit:this._canEdit,recordsValidator:this.recordsValidator,resourceID:this._resourceID,detailTaskbarCustomContainerId:this.customContainerId,formLegacyConfigName:this.formLegacyConfigName,enableGridInsert:this.enableGridInsert,getCustomTitle:this.setCustomFormTitle},s("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkFormTaskBar"}))),s("stack-item",null,s("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this._snkDataUnit.entityName,onBack:this.backView.bind(this)})),s("snk-configurator",{ref:t=>this._snkConfigurator=t,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:t=>this.setViewMode(t.detail),onOpenConfig:t=>this.openConfig(t.detail),showActionButtons:this.showActionButtons,onSave:t=>this.handleConfiguratorEvent(t,"SAVE"),onCancel:t=>this.handleConfiguratorEvent(t,"CANCEL"),resourceID:this._resourceID,customContainerId:this.customContainerId})),s("div",{id:`${this.customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}),s("slot",{name:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))}get _element(){return a(this)}static get watchers(){return{_currentViewMode:["currentViewModeWatcher"]}}};p.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";export{p as snk_crud}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as i,c as o,h as n,H as t,g as s}from"./p-d2d301a6.js";import{S as e}from"./p-fa816fb2.js";import{ObjectUtils as l,ElementIDUtils as r,ArrayUtils as a,ApplicationContext as d}from"@sankhyalabs/core";import{ApplicationUtils as c,DialogType as f}from"@sankhyalabs/ezui/dist/collection/utils";import{C as h,a as g,T as u,A as m,D as v}from"./p-b0ef4383.js";import{U as b}from"./p-06421fdb.js";import{buildFormConfigFromDataUnit as p}from"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-f3434fc4.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const _="EZ-COLLAPSIBLE-BOX",k="fieldsWithoutGroupContainer",z="fieldsAvailableContainer",C="addNewGroupContainer",x=class{constructor(n){i(this,n),this.configChange=o(this,"configChange",7),this.configClose=o(this,"configClose",7),this._listEnabledFields=[],this._renderTimer=500,this._tabSelected=1,this._labelNewGroup="Novo grupo",this._mouseOnFieldConfig=!1,this._mouseOnConfigOptions=!1,this._editingTitleGroup=!1,this._newGroupBoxes=[],this._currentGroupBoxes=[],this._formFieldsStyle="ez-col ez-col--sd-12 ez-col--tb-4 ez-padding-right--small ez-padding-bottom--medium sc-snk-form-config",this._fieldsAvailableStyle="ez-col ez-col--sd-12 ez-col--tb-12 ez-margin-bottom--medium ez-margin-right--medium sc-snk-form-config",this._fieldFloatingStyle="form-config__field-config--dragged",this._sortableTimer=100,this._formConfigOptions=[],this._fieldConfigSelected=void 0,this._layoutFormConfig=void 0,this._fieldsAvailable=void 0,this._formConfig={},this._formConfigChanged=!1,this._optionFormConfigSelected=void 0,this._optionFormConfigChanged=!1,this._tempGroups=[],this.dataUnit=void 0,this.configManager=void 0,this.messagesBuilder=void 0}observeConfigManager(){this.loadConfig(this._sortableTimer)}loadFields(i=0){this._layoutFormConfig=[],i>0?setTimeout((()=>{this.buildFields()}),i):this.buildFields()}buildFields(){this.buildFormConfig(),this.buildAvailableFields()}loadFormConfig(i){var o;this._formConfig=this.getConfig(),this.loadFields(i),this.controlFieldConfig(),null!=(null===(o=this._filterFieldsAvailable)||void 0===o?void 0:o.value)&&(this._filterFieldsAvailable.value="")}getConfig(){let i=this.configManager.getConfig(this.dataUnit);return i.fields&&0===i.fields.length&&(i=void 0),null==i&&(i=p(this.dataUnit)),l.copy(i)}cancelChangeConfig(){!0===this._formConfigChanged?this.openConfirmDialog(this.getMessage("snkFormConfig.confirm.cancel")).then((i=>{i&&(this._formConfigChanged=!1,this.resetChangeConfig())})):this.resetChangeConfig()}cancelChangeOptionConfig(){!0===this._optionFormConfigChanged?this.openConfirmDialog(this.getMessage("snkFormConfig.confirm.cancel")).then((i=>{i&&(this._optionFormConfigChanged=!1,this.resetChangeOptionConfig())})):this.resetChangeOptionConfig()}resetChangeConfig(){this.loadFormConfig(this._sortableTimer),this.clearTempGroups()}resetChangeOptionConfig(){this._formConfigChanged=!1,this.loadConfig(this._sortableTimer),this.clearTempGroups()}getTabsToSave(){return this._layoutFormConfig.map(((i,o)=>({label:i.tab,order:o,visible:i.visible})))}getFieldsToSave(){const i=[];return this._formContainer.querySelectorAll("snk-field-config").forEach((o=>{const n=o.fieldConfig;if(null==n)return;const t={cleanOnCopy:n.cleanOnCopy||!1,group:n.group,label:n.label,name:n.name,required:n.required,readOnly:n.readOnly,tab:n.tab};null!=n.defaultValue&&(t.defaultValue=null==n.defaultValue.type?{type:v.fixed,value:n.defaultValue}:n.defaultValue),i.push(t)})),i}isDefaultConfiguration(){var i;return(null===(i=this._optionFormConfigSelected)||void 0===i?void 0:i.origin)===b.DEFAULT&&!0===this._optionFormConfigChanged&&!1===this._formConfigChanged}buildConfigToSave(){let i={};const o=this.isDefaultConfiguration();if(i=o?this.getConfig():l.copy(this._formConfig),!1===o){const o=this.getTabsToSave();(null==o?void 0:o.length)>0&&(i.tabs=o);const n=this.getFieldsToSave();(null==n?void 0:n.length)>0&&(i.fields=n)}return i.defaultConfiguration=o,i}saveConfig(){var i;(null===(i=this._tempGroups)||void 0===i?void 0:i.length)>0?c.alert(this.getMessage("snkFormConfig.confirm.title"),this.getMessage("snkFormConfig.confirm.group")):(this._formConfigChanged=!1,this._optionFormConfigChanged=!1,this.configManager.saveConfig(this.buildConfigToSave()).then((i=>{c.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"),{iconName:"check"});const o=this._formConfigOptions.find((i=>i.origin===b.USER));this.setFormConfig(o),this.configChange.emit(i)})))}applyOptionConfig(){if(!0===this._optionFormConfigChanged&&null!=this._optionFormConfigSelected){const i=this._optionFormConfigSelected.name||"configuração selecionada",o=this._optionFormConfigSelected.origin===b.DEFAULT?"pessoal":"padrão",n=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",i).replace("{1}",o);this.openConfirmDialog(n).then((i=>{i&&this.saveConfig()}))}else this.saveConfig()}controlFieldConfig(i){var o;this._fieldConfigSelected=null!=i?(null===(o=this._fieldConfigSelected)||void 0===o?void 0:o.name)===(null==i?void 0:i.name)?void 0:i:void 0}getFieldConfigStyle(i){var o;return this._formFieldsStyle+((null===(o=this._fieldConfigSelected)||void 0===o?void 0:o.name)===i.name?" form-config__field-config--selected":"")}getFieldsByGroup(i){var o;return(null===(o=i.fields)||void 0===o?void 0:o.length)?i.fields.map((i=>{var o,t;return n("div",{key:i.name,class:this.getFieldConfigStyle(i),"data-draggable-element":"field",onMouseDown:i=>this.controlMoveField(i)},n("snk-field-config",{messagesBuilder:this.messagesBuilder,onEzClickIcon:i=>{this.handleFieldConfigChange(i)},modeInsertion:!1,fieldConfig:i,dataUnit:this.dataUnit,isConfigActive:(null===(o=this._fieldConfigSelected)||void 0===o?void 0:o.name)===i.name,id:i.name,key:i.name}),(null===(t=this._fieldConfigSelected)||void 0===t?void 0:t.name)===i.name&&n("div",{class:"ez-flex form-config__config-options"},n("snk-config-options",{idConfig:i.name,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,fieldConfig:this._fieldConfigSelected,"data-element-id":this._element.getAttribute(r.DATA_ELEMENT_ID_ATTRIBUTE_NAME),onConfigOptionsChanged:i=>this.handleconfigOptionsChanged(i.detail)})))})):n("div",{class:"form-config__add-group-container"},n("div",{class:"form-config__add-group-content"},n("div",{class:"form-config__add-group-label"},n("label",{class:"ez-text ez-text--center ez-text--medium ez-text--primary ez-text--bold"},this.getMessage("snkFormConfig.form.labelDropField")))))}handleconfigOptionsChanged(i){var o;null===(o=this._formConfig.fields)||void 0===o||o.forEach((()=>{})),this._formConfigChanged=!0}closeFormConfig(){!0===this._formConfigChanged||!0===this._optionFormConfigChanged?this.openConfirmDialog(this.getMessage("snkFormConfig.confirm.exit")).then((i=>{i&&(this._formConfigChanged=!1,this.configClose.emit())})):this.configClose.emit()}openConfirmDialog(i="",o=this.getMessage("snkFormConfig.confirm.title")){return c.confirm(o,i)}controlMoveField(i){const o=null==i?void 0:i.target;null!=(null==o?void 0:o.closest('[data-draggable-element="field"]'))&&(this._mouseOnFieldConfig=!0,null!=(null==o?void 0:o.closest(".form-config__config-options"))||null!=(null==o?void 0:o.closest(".field-config__options"))?this._mouseOnConfigOptions=!0:!1===["minus","settings-inverted","chevron-up"].includes(null==o?void 0:o.iconName)&&this.controlFieldConfig())}controlStartDraggingField(i){var o,n,t;if(this._mouseOnConfigOptions)null==i||i.cancel(),this._mouseOnConfigOptions=!1;else{const s=null===(t=null===(n=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.dragEvent)||void 0===n?void 0:n.data)||void 0===t?void 0:t.sourceContainer;null!=s&&s.classList.add(this._fieldFloatingStyle)}}controlSortedDraggingField(i){var o,n,t,s,e,l,r,a;const d=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.oldContainer,c=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.newContainer,f=null===(e=null===(s=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.dragEvent)||void 0===s?void 0:s.data)||void 0===e?void 0:e.source,h=null===(a=null===(r=null===(l=null==i?void 0:i.data)||void 0===l?void 0:l.dragEvent)||void 0===r?void 0:r.data)||void 0===a?void 0:a.originalSource;null!=d&&null!=c&&null!=f&&null!=h&&(c.tagName!==_&&c.id!==k||d.id!==z?d.tagName!==_&&d.id!==k||c.id!==z||(f.className=this._fieldsAvailableStyle,f.querySelector("snk-field-config").modeInsertion=!0,h.className=this._fieldsAvailableStyle,h.querySelector("snk-field-config").modeInsertion=!0):(f.className=this._formFieldsStyle,f.querySelector("snk-field-config").modeInsertion=!1,h.className=this._formFieldsStyle,h.querySelector("snk-field-config").modeInsertion=!1))}isCancelDragAvailableField(i,o,n){var t,s;return null!=i&&null!=o&&null!=n&&(null===(t=n.data)||void 0===t?void 0:t.newIndex)!==(null===(s=n.data)||void 0===s?void 0:s.oldIndex)&&i.id===z&&o.id===i.id&&(n.cancel(),this._fieldsAvailable=[],setTimeout((()=>{this.buildAvailableFields()}),this._sortableTimer),!0)}isRemoveField(i,o,n){if(null==i||null==o||null==n)return!1;if((o.tagName===_||o.id===k)&&i.id===z){const i={detail:{field:n,type:m.remove}};return setTimeout((()=>{this.handleFieldConfigChange(i)}),this._renderTimer),!0}return!1}isAddOrMoveField(i,o,n,t){var s;return null!=i&&null!=o&&null!=n&&null!=t&&(t.newIndex!==t.oldIndex||o.dataset.groupName!==i.dataset.groupName||i.id===k&&o.id===z)&&(this.isFieldAvailable(i,o)&&(n.tab=null===(s=this._tabConfig)||void 0===s?void 0:s.selectedTab),n.group=i.dataset.groupName,setTimeout((()=>{i.id.includes(C)&&this.clearTempGroups(!0),this.updateFieldsToSave(o.dataset.groupName!==i.dataset.groupName||i.id===k&&o.id===z?this._sortableTimer:0)}),this._renderTimer),!0)}isFieldAvailable(i,o){return null!=i&&null!=o&&(i.tagName===_||i.id===k)&&o.id===z}controlStopDraggingField(i){var o,n,t,s,e,l;const r=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.oldContainer,a=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.newContainer;if(this.isCancelDragAvailableField(a,r,i))return;const d=null===(e=null===(s=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.dragEvent)||void 0===s?void 0:s.data)||void 0===e?void 0:e.originalSource,c=null===(l=null==d?void 0:d.querySelector("snk-field-config"))||void 0===l?void 0:l.fieldConfig;this.isRemoveField(a,r,c)||this.isAddOrMoveField(a,r,c,null==i?void 0:i.data)}updateFieldsToSave(i=0){const o=this.getFieldsToSave();(null==o?void 0:o.length)>0&&(this._formConfig.fields=o),this.loadFields(i),this._formConfigChanged=!0}controlSortableField(){null!=this._sortableContainer&&(this._sortableField&&this._sortableField.destroy(),this._sortableField=new e(this._sortableContainer.querySelectorAll('[data-draggable-parent="field"]'),{draggable:'[data-draggable-element="field"]',mirror:{constrainDimensions:!0},distance:h.dragStartDistance}),this._sortableField.on(g.dragStart,(i=>this.controlStartDraggingField(i))),this._sortableField.on(g.dragSorted,(i=>this.controlSortedDraggingField(i))),this._sortableField.on(g.dragStop,(i=>this.controlStopDraggingField(i))))}controlStartDraggingGroup(i){(this._mouseOnFieldConfig||this._editingTitleGroup)&&(null==i||i.cancel(),this._mouseOnFieldConfig=!1)}controlStopDraggingGroup(i){i.data.newIndex!==i.data.oldIndex&&setTimeout((()=>{this.updateFieldsToSave(this._sortableTimer)}),this._renderTimer)}controlSortableGroup(){null!=this._sortableContainer&&(this._sortableGroup&&this._sortableGroup.destroy(),this._sortableGroup=new e(this._sortableContainer.querySelectorAll('[data-draggable-parent="group"]'),{draggable:'[data-draggable-element="group"]',mirror:{constrainDimensions:!0},distance:h.dragStartDistance}),this._sortableGroup.on(g.dragStart,(i=>this.controlStartDraggingGroup(i))),this._sortableGroup.on(g.dragStop,(i=>this.controlStopDraggingGroup(i))))}loadUserConfig(){null!=this.configManager&&this.configManager.fetchUserAvailableConfigs().then((i=>{if(this._formConfigOptions=i,null==this._formConfigOptions)return;let o=null==this._formConfig||this._formConfig.defaultConfiguration;const n=i.find((i=>i.origin===(o?b.DEFAULT:b.USER)));this.setFormConfig(n)}))}setFormConfig(i){this._optionFormConfigSelected=i}controlSelectFormConfig(i){const o=null==i?void 0:i.detail,n=this._formConfigOptions.find((i=>i.origin===(null==o?void 0:o.value)));this.setFormConfig(n),this._optionFormConfigChanged=!0,this.loadConfigByUser()}changeTabOrder(i){const o=[],n=this._tabConfig.querySelectorAll(".tab-config__tab");this._tabSelected=i,n.forEach(((i,n)=>{var t;if(n){const s=null===(t=i.querySelector(".tab-config__tab-label"))||void 0===t?void 0:t.getAttribute("title");o.push({label:s,order:n-1})}})),this._layoutFormConfig.map((i=>{o.forEach((o=>{o.label===i.tab&&(o.visible=i.visible)}))})),o.length>0&&(this._formConfig.tabs=o,this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0)}async loadConfigByUser(){if(null==this.configManager)return;if(null==this._optionFormConfigSelected)return;let i;this._optionFormConfigSelected.origin===b.DEFAULT?(i=await this.configManager.fetchDefaultConfig(),i||(i=this.configManager.getEmptyConfig())):i=this.getConfig(),null!=i&&(this._formConfig=i,this._tabSelected=1,this.loadFields(this._sortableTimer),this.controlFieldConfig(),this.clearTempGroups())}loadConfig(i=0){this.loadFormConfig(i),this.loadUserConfig()}addNewGroup(){var i,o;const n=null===(i=this._tabConfig)||void 0===i?void 0:i.selectedTab;null==(null===(o=this._tempGroups)||void 0===o?void 0:o.find((i=>i.tab===n&&i.group.includes(this._labelNewGroup))))&&(this._tempGroups.push({tab:n,group:this.handleDuplicateGroups(this._labelNewGroup,this._tabConfig.selectedTab)}),this.loadFields(),this.controlFieldConfig(),this._formConfigChanged=!0)}clearTempGroups(i=!1){var o;(null===(o=this._tempGroups)||void 0===o?void 0:o.length)>0&&(this._tempGroups=i?this._tempGroups.filter((i=>i.tab!==this._tabConfig.selectedTab)):[])}removeGroup(i){null!=i?this._tempGroups=this._tempGroups.filter(((o,n)=>n!==i&&o.tab===this._tabConfig.selectedTab||o.tab!==this._tabConfig.selectedTab)):this.updateFieldsToSave(this._sortableTimer)}checkGroupExists(i,o,n=!1){var t,s,e;const l=null===(t=this._tabConfig)||void 0===t?void 0:t.selectedTab,r=null===(s=this._layoutFormConfig)||void 0===s?void 0:s.find((i=>i.tab===l)),a=null===(e=null==r?void 0:r.groups)||void 0===e?void 0:e.map((i=>{var o;return null===(o=i.group)||void 0===o?void 0:o.toLowerCase()}));if(null==a?void 0:a.includes(null==i?void 0:i.toLowerCase())){const t=this.getMessage("snkFormConfig.confirm.title"),s=`\n ${this.getMessage("snkFormConfig.alert.titleGroupExists")}\n <b>${i}</b>\n ${this.getMessage("snkFormConfig.alert.inTab")}\n <b>${l===u.main?this.getMessage("snkFormConfig.form.mainArea"):l}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `;return c.alert(t,s).then((()=>{var i,t;n?null===(i=this._newGroupBoxes[o])||void 0===i||i.applyFocusTextEdit():null===(t=this._currentGroupBoxes[l][o])||void 0===t||t.applyFocusTextEdit()})),!1}return!0}saveEditLabelTempGroup(i,o){const{newValue:n}=i.detail;null!=this._newGroupBoxes&&null!=this._newGroupBoxes[o]&&(this._newGroupBoxes[o].dataset.groupName=n)}saveEditLabelGroup(i){var o;const{value:n,newValue:t}=i.detail;null===(o=this._formConfig.fields)||void 0===o||o.forEach((i=>{i.group===n&&(i.group=t)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}renderTempGroupByTab(i){return this._tempGroups.map(((o,t)=>{if(o.tab===i)return n("ez-collapsible-box",{ref:i=>this._newGroupBoxes[t]=i,id:`${C}-${t}`,editable:!0,removable:!0,"header-size":"large",label:o.group,"icon-placement":"left","data-group-name":o.group,"data-draggable-parent":"field",class:"form-config__add-group",onEzRemove:()=>this.removeGroup(t),onEzSaveEditLabel:i=>this.saveEditLabelTempGroup(i,t),onEzEditLabelMode:i=>this._editingTitleGroup=i.detail,conditionalSave:i=>this.checkGroupExists(i,t,!0)},this.getFieldsByGroup(o))}))}handleDuplicateGroups(i,o){var n;const t=this._layoutFormConfig[this._tabConfig.selectedIndex].groups.map((i=>i.group));return null!=t&&(null===(n=this._layoutFormConfig)||void 0===n||n.map((n=>{n.tab===o&&n.groups.some((o=>o.group===i))&&(i+=`${this.captureHighestValueTitle(t)}`)}))),i}captureHighestValueTitle(i){let o=[];return null==i||i.map((i=>{null!=i&&o.push(i.replace(/[^0-9]/g,""))})),Math.max.apply(null,o)>0?` (${Math.max.apply(null,o)+1})`:" (1)"}getLayoutFormConfig(){var i,o;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let n=[],t=[];for(const i of this._formConfig.fields)if(null==t.find((o=>i.name===o.name&&i.tab===o.tab))){t.push(i);const s=this.dataUnit.getField(i.name);if(null==s?void 0:s.visible){null!=i.label&&""!==i.label||(i.label=s.label),null!=i.tab&&""!==i.tab||(i.tab=this.getMessage("snkFormConfig.form.tabGeneral"));let t=n.find((o=>o.tab===i.tab));if(null==t){let s=null;if(null!=this._formConfig.tabs){const o=this._formConfig.tabs.filter((o=>o.label===i.tab));o.length>0&&(s=o[0].visible)}const e=(null===(o=i.tab)||void 0===o?void 0:o.label)||i.tab;t=null!==s?{tab:e,groups:[],visible:s}:{tab:e,groups:[],visible:!0},n.push(t)}const e=t.groups.find((o=>o.group===i.group));if(e)e.fields.push(i);else{const o={group:i.group,fields:[i]};void 0===i.group?t.groups.unshift(o):t.groups.push(o)}}}return n}configureTabs(i){var o;return null==(null===(o=this._formConfig)||void 0===o?void 0:o.tabs)?i:(null==i&&(i=[]),this._formConfig.defaultConfiguration?i:this._formConfig.tabs.map((o=>i.find((i=>{var n,t;return(null===(n=o.label)||void 0===n?void 0:n.toLowerCase())===(null===(t=i.tab)||void 0===t?void 0:t.toLowerCase())}))||{tab:o.label,groups:[],visible:o.visible})))}configureTabMain(i){return null==i&&(i=[]),null==i.find((i=>i.tab===u.main))&&i.unshift({tab:u.main,groups:[],visible:!0}),i}updateTabs(){const i=this.getTabsToSave();(null==i?void 0:i.length)>0&&(this._formConfig.tabs=i,1===i.length&&(this._tabSelected=0))}buildFormConfig(){var i;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let o=this.getLayoutFormConfig();o=this.configureTabs(o),o=this.configureTabMain(o),this._layoutFormConfig=o,this.updateTabs()}buildAvailableFields(){var i,o;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let n=[],t=this.dataUnit.metadata.fields;for(const i of this._formConfig.fields)n.push(i);const s=t.filter((({name:i,visible:o})=>!0===o&&!1===n.some((({name:o})=>o===i))));this._fieldsAvailable=s,this._listEnabledFields=s,null!=(null===(o=this._filterFieldsAvailable)||void 0===o?void 0:o.value)&&this.onFilterChange(this._filterFieldsAvailable.value)}changeTabSelected(i){this._tabSelected=i.index;const o=this._formContainer.querySelector("div#tab"+i.index);this._formContainer.querySelectorAll(".form-config__tab-content").forEach((i=>i.className="form-config__hide-content sc-snk-form-config")),o&&(o.className="form-config__tab-content ez-flex ez-flex--column ez-size-width--full ez-padding--medium sc-snk-form-config")}onFilterChange(i){this._fieldsAvailable=a.applyStringFilter(i,this._listEnabledFields,!0,"label")}orderFieldsAvailable(i){return a.sortAlphabetically(i)}handleLabelCounter(i){const o=[this.getMessage("snkFormConfig.availableFields.labelNoFields"),this.getMessage("snkFormConfig.availableFields.labelOneField")];return i>1?`${i} ${this.getMessage("snkFormConfig.availableFields.labelAvailableFields")}`:o[i]}controlAddFieldConfig(i){var o;if(this._formConfigChanged=!1,null==i)return;null==this._formConfig.fields&&(this._formConfig.fields=[]);const n=this._formConfig.fields.filter((o=>o.name===i.name&&o.tab&&i.tab));n.length>0?n.forEach((o=>{o.name=i.name,o.label=i.label,o.required=i.required,o.readOnly=i.readOnly,o.group=i.group})):this._formConfig.fields.push({name:i.name,label:i.label,required:i.required,readOnly:i.readOnly,group:i.group,tab:null===(o=this._tabConfig)||void 0===o?void 0:o.selectedTab}),this.loadFields(),this.controlFieldConfig(),this._formConfigChanged=!0,this.resetSortables()}controlRemoveFieldConfig(i,o){var n;this._formConfigChanged=!1,null!=i&&(this._formConfig.fields=null===(n=this._formConfig.fields)||void 0===n?void 0:n.filter((o=>o.name!==i.name)),this.loadFields(o),this.controlFieldConfig(),this._formConfigChanged=!0,this.resetSortables())}resetSortables(){this.controlSortableField(),this.controlSortableGroup()}handleFieldConfigChange(i,o=0){const{field:n,type:t}=i.detail;t!==m.configuration?t!==m.remove?t!==m.add||this.controlAddFieldConfig(n):this.controlRemoveFieldConfig(n,o):this.controlFieldConfig(n)}changeTabLabel(i){var o,n;const{value:t,newValue:s}=i.detail.detail;null===(o=this._formConfig.fields)||void 0===o||o.forEach((i=>{i.tab===t&&(i.tab=s)})),null===(n=this._formConfig.tabs)||void 0===n||n.forEach((i=>{i.label===t&&(i.label=s)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}handleDeleteTab(i){let o={canClose:!1,labelCancel:this.getMessage("snkFormConfig.confirm.labelCancel"),labelConfirm:this.getMessage("snkFormConfig.confirm.labelDelete"),btnConfirmDanger:!1};const n=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage("snkFormConfig.confirm.deleteTab")+` <b>${i.detail.label}</b>?`;c.confirm(n,t,null,f.WARN,o).then((o=>{var n;o&&(this._formConfig.tabs=null===(n=this._formConfig.tabs)||void 0===n?void 0:n.filter((o=>o.label!==i.detail.label)),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0)}))}changeHideTab(i){var o;null===(o=this._formConfig.tabs)||void 0===o||o.forEach((o=>{o.label===i.detail.label&&(o.visible=!o.visible)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}handleCanStartDragTab(){var i,o;const n=this._layoutFormConfig.map((i=>i.tab));for(const o of n)null===(i=this._currentGroupBoxes[o])||void 0===i||i.map((i=>null==i?void 0:i.cancelEdition()));null===(o=this._newGroupBoxes)||void 0===o||o.map((i=>null==i?void 0:i.cancelEdition()))}getMessage(i,o){return this.messagesBuilder.getMessage(i,o)}componentDidRender(){this.controlSortableField(),this.controlSortableGroup()}async componentWillRender(){if(null==this.messagesBuilder){const i=d.getContextValue("__SNK__APPLICATION__");this.messagesBuilder=i.messagesBuilder}}componentWillLoad(){this.loadConfig()}componentDidLoad(){r.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}render(){var i,o,s,e;return n(t,null,n("div",{class:"ez-row ez-padding--medium"},n("div",{class:"ez-col ez-col--sd-7 ez-col--tb-9 ez-align--middle"},n("ez-button",{mode:"icon",title:this.getMessage("snkFormConfig.goBackTitle"),iconName:"arrow_back",class:"ez-padding--small",size:"small",onClick:()=>this.closeFormConfig(),id:"formConfigToBack"}),n("h1",{class:"ez-title ez-title--primary ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),this._formConfigOptions&&n("ez-actions-button",{class:"form-config__actions-button ez-margin-left--medium",value:null===(i=this._optionFormConfigSelected)||void 0===i?void 0:i.origin,showLabel:!0,displayIcon:"chevron-down",checkOption:!0,size:"small",actions:this._formConfigOptions.map((i=>({value:i.origin,label:i.name}))),onEzAction:i=>this.controlSelectFormConfig(i),id:"selectConfig"})),n("div",{class:"ez-col ez-col--sd-5 ez-col--tb-3 ez-align--middle ez-align--right"},!0===this._formConfigChanged&&!1===this._optionFormConfigChanged&&n("div",{class:"ez-row ez-align--middle ez-align--right"},n("ez-button",{label:"Cancelar",class:"ez-padding-left--medium",size:"small",onClick:()=>this.cancelChangeConfig()}),n("ez-button",{label:"Salvar",class:"ez-button--primary ez-padding-left--medium",size:"small",onClick:()=>this.saveConfig()},n("ez-icon",{class:"ez-margin-right--small",slot:"leftIcon",iconName:"save"}))),!0===this._optionFormConfigChanged&&n("div",{class:"ez-row ez-align--middle ez-align--right"},n("ez-button",{label:"Cancelar",class:"ez-padding-left--medium",size:"small",onClick:()=>this.cancelChangeOptionConfig()}),n("ez-button",{label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",size:"small",onClick:()=>this.applyOptionConfig()})))),n("div",{class:"ez-row ez-padding--medium",ref:i=>this._sortableContainer=i},n("div",{class:"form-config__tab-container ez-col ez-col--sd-9 ez-col--tb-9 ez-padding-right--medium"},(null===(o=this._layoutFormConfig)||void 0===o?void 0:o.length)>0&&n("section",{class:"ez-box__container",ref:i=>this._formContainer=i},n("snk-tab-config",{ref:i=>this._tabConfig=i,selectedIndex:this._tabSelected,messagesBuilder:this.messagesBuilder,onEzTabChange:i=>this.changeTabSelected(i.detail),onEzOrderChange:i=>this.changeTabOrder(i.detail),onEditionTitleTab:i=>this.changeTabLabel(i),onDeleteTab:i=>this.handleDeleteTab(i),onHideTab:i=>this.changeHideTab(i),onCanStartDrag:()=>this.handleCanStartDragTab(),tabItems:this._layoutFormConfig.map((i=>({tabKey:i.tab,label:i.tab,visible:i.visible})))}),this._layoutFormConfig.map(((i,o)=>n("div",{id:"tab"+o,"data-draggable-parent":"group",class:this._tabSelected===o?"form-config__tab-content ez-flex ez-flex--column ez-size-width--full ez-padding--medium":"form-config__hide-content"},i.groups.map(((o,t)=>o.group?(null==this._currentGroupBoxes[i.tab]&&(this._currentGroupBoxes[i.tab]=[]),n("ez-collapsible-box",{ref:o=>this._currentGroupBoxes[i.tab][t]=o,editable:!0,removable:!0,"header-size":"large",label:o.group,"icon-placement":"left","data-group-name":o.group,"data-draggable-parent":"field","data-draggable-element":"group",onEzRemove:()=>this.removeGroup(),onEzSaveEditLabel:i=>this.saveEditLabelGroup(i),onEzEditLabelMode:i=>this._editingTitleGroup=i.detail,conditionalSave:i=>this.checkGroupExists(i,t)},this.getFieldsByGroup(o))):n("div",{class:"ez-flex ez-flex--column ez-size-width--full"},n("label",{class:"ez-text ez-text--secondary ez-margin-vertical--small"},this.getMessage("snkFormConfig.form.subTitleInfo")),n("div",{id:k,class:"ez-row","data-draggable-parent":"field"},this.getFieldsByGroup(o)),n("hr",{class:"ez-divider-horizontal ez-margin-vertical--medium"})))),this.renderTempGroupByTab(i.tab)))),n("div",{class:"form-config__btn-add-group ez-row"},n("div",{class:"form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center"},n("ez-button",{label:this.getMessage("snkFormConfig.form.labelNewGroup"),class:"ez-padding-horizontal--small ez-button--primary",size:"small",onClick:()=>this.addNewGroup()},n("ez-icon",{class:"ez-margin-right--small",slot:"leftIcon",iconName:"plus"})))))),n("div",{class:"form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3"},n("section",{class:"ez-box__container ez-col ez-col--pn-12"},n("h1",{class:"ez-title ez-title--large ez-title--primary ez-padding-bottom--medium"},this.getMessage("snkFormConfig.availableFields.title")),n("ez-filter-input",{id:"searchFields",ref:i=>this._filterFieldsAvailable=i,label:this.getMessage("snkFormConfig.availableFields.labelSearchField"),onEzChange:i=>this.onFilterChange(i.detail)}),n("span",{class:"ez-box__label-counter ez-text ez-text--medium ez-text--primary ez-margin-bottom--medium"},this.handleLabelCounter(null===(s=this._fieldsAvailable)||void 0===s?void 0:s.length)),(null===(e=this._layoutFormConfig)||void 0===e?void 0:e.length)>0&&n("div",{id:z,class:"ez-row","data-draggable-parent":"field"},this.orderFieldsAvailable(this._fieldsAvailable).map((i=>n("div",{key:i.name,class:this._fieldsAvailableStyle,"data-draggable-element":"field",onMouseDown:i=>this.controlMoveField(i)},n("snk-field-config",{messagesBuilder:this.messagesBuilder,onEzClickIcon:i=>{this.handleFieldConfigChange(i)},dataUnit:this.dataUnit,fieldConfig:i,id:i.name})))))))))}get _element(){return s(this)}static get watchers(){return{configManager:["observeConfigManager"]}}};x.style=".sc-snk-form-config-h{--snk-form-config--z-index:var(--more-visible, 2);--snk-form-config--background-color:var(--background--xlight, #fff);--snk-form-config__icon--color:var(--text--disable, #AFB6C0);--snk-form-config__label-counter--font-weight:var(--text-weight--extra-small, 200);--snk-form-config__add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__add-group-container--background-color:var(--background--medium, #d2dce9);--snk-form-config__add-group-container--padding:var(--space--small, 6px);--snk-form-config__add-group-content--border:2px dashed var(--color-strokes, #DCE0E8);--snk-form-config__add-group-content--border-radius:var(--border--radius-small, 6px);--snk-form-config__add-group-label--padding:var(--space--large, 24px);--snk-form-config__btn-add-group--padding:var(--space--large, 24px) var(--space--medium, 12px) 0;--snk-form-config__btn-add-group-container--padding:var(--space--medium, 12px);--snk-form-config__btn-add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__btn-add-group-container--border:2px solid var(--color-strokes, #DCE0E8);--snk-form-config__btn-add-group-container--background-color:var(--background--body, #fafcff);display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;z-index:var(--snk-form-config--z-index);background-color:var(--snk-form-config--background-color)}div.sc-snk-form-config:focus-visible,div.sc-snk-form-config:focus{outline:none}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--snk-form-config__icon--color)}.ez-box__label-counter.sc-snk-form-config{margin-top:-7px;font-weight:var(--snk-form-config__label-counter--font-weight)}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:var(--snk-form-config--background-color)}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--snk-form-config--z-index)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:235px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--snk-form-config__add-group-container--border-radius);background-color:var(--snk-form-config__add-group-container--background-color);padding:var(--snk-form-config__add-group-container--padding)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:var(--snk-form-config__add-group-content--border);border-radius:var(--snk-form-config__add-group-content--border-radius)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--snk-form-config__add-group-label--padding)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--snk-form-config__btn-add-group--padding)}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--snk-form-config__btn-add-group-container--padding);border-radius:var(--snk-form-config__btn-add-group-container--border-radius);border:var(--snk-form-config__btn-add-group-container--border);background-color:var(--snk-form-config__btn-add-group-container--background-color)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:var(--snk-form-config--background-color)}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{left:calc(100% / 1 * -1)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{left:calc(100% / 1 * -2)}}";export{x as snk_form_config}
|