@sankhyalabs/sankhyablocks 8.16.0-dev.39 → 8.16.0-dev.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/dist/cjs/index-f9e81701.js +8 -28
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  4. package/dist/cjs/{snk-form-config.cjs.entry.js → snk-config-options_3.cjs.entry.js} +363 -1
  5. package/dist/cjs/{snk-filter-bar.cjs.entry.js → snk-filter-bar_4.cjs.entry.js} +685 -0
  6. package/dist/cjs/snk-simple-crud.cjs.entry.js +3 -1
  7. package/dist/collection/collection-manifest.json +11 -31
  8. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +3 -1
  9. package/dist/collection/sw.js +46 -0
  10. package/dist/components/snk-simple-crud2.js +3 -1
  11. package/dist/esm/{SnkFormConfigManager-139f09fa.js → SnkFormConfigManager-f1a0fc92.js} +1 -1
  12. package/dist/esm/{constants-8457af36.js → constants-7302ee87.js} +1 -1
  13. package/dist/esm/index-a7d3d3f1.js +8 -28
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/sankhyablocks.js +1 -1
  16. package/dist/esm/snk-actions-button_4.entry.js +1 -1
  17. package/dist/esm/snk-attach.entry.js +1 -1
  18. package/dist/esm/{snk-form-config.entry.js → snk-config-options_3.entry.js} +364 -4
  19. package/dist/esm/snk-configurator.entry.js +1 -1
  20. package/dist/esm/snk-crud.entry.js +1 -1
  21. package/dist/esm/snk-data-exporter.entry.js +1 -1
  22. package/dist/esm/snk-detail-view.entry.js +3 -3
  23. package/dist/esm/snk-field-config.entry.js +1 -1
  24. package/dist/esm/{snk-filter-bar.entry.js → snk-filter-bar_4.entry.js} +684 -2
  25. package/dist/esm/{snk-guides-viewer-c1ef991c.js → snk-guides-viewer-2f4dcdc5.js} +2 -2
  26. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  27. package/dist/esm/snk-simple-crud.entry.js +5 -3
  28. package/dist/esm/snk-tab-config.entry.js +1 -1
  29. package/dist/sankhyablocks/p-052213ba.entry.js +1 -0
  30. package/dist/sankhyablocks/{p-11a0a7ac.entry.js → p-0b6cd238.entry.js} +1 -1
  31. package/dist/sankhyablocks/p-0e320bd2.entry.js +1 -0
  32. package/dist/sankhyablocks/{p-281bc322.entry.js → p-275de842.entry.js} +1 -1
  33. package/dist/sankhyablocks/{p-8eb67fa4.entry.js → p-2d3f9482.entry.js} +1 -1
  34. package/dist/sankhyablocks/{p-7663f597.entry.js → p-41793e17.entry.js} +1 -1
  35. package/dist/sankhyablocks/{p-1b6d51bf.entry.js → p-5e51e833.entry.js} +1 -1
  36. package/dist/sankhyablocks/{p-d3341910.entry.js → p-72c10005.entry.js} +1 -1
  37. package/dist/sankhyablocks/{p-11cc69fc.js → p-7bd9683d.js} +1 -1
  38. package/dist/sankhyablocks/{p-95df461f.entry.js → p-8b4fc28f.entry.js} +1 -1
  39. package/dist/sankhyablocks/{p-b0ef4383.js → p-95ce311a.js} +1 -1
  40. package/dist/sankhyablocks/{p-5ea74956.entry.js → p-ab1645fb.entry.js} +1 -1
  41. package/dist/sankhyablocks/{p-47f79aa0.entry.js → p-cefb0ee1.entry.js} +1 -1
  42. package/dist/sankhyablocks/p-fa6c5826.entry.js +1 -0
  43. package/dist/sankhyablocks/{p-afbb070d.js → p-fadc8339.js} +1 -1
  44. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  45. package/package.json +3 -2
  46. package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
  47. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
  48. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
  49. package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
  50. package/dist/cjs/snk-form.cjs.entry.js +0 -144
  51. package/dist/esm/snk-config-options.entry.js +0 -235
  52. package/dist/esm/snk-filter-item.entry.js +0 -308
  53. package/dist/esm/snk-filter-list.entry.js +0 -148
  54. package/dist/esm/snk-filter-modal.entry.js +0 -245
  55. package/dist/esm/snk-form.entry.js +0 -140
  56. package/dist/sankhyablocks/p-06898e5a.entry.js +0 -1
  57. package/dist/sankhyablocks/p-3b60db06.entry.js +0 -1
  58. package/dist/sankhyablocks/p-60b29483.entry.js +0 -1
  59. package/dist/sankhyablocks/p-70a4af56.entry.js +0 -1
  60. package/dist/sankhyablocks/p-b9679243.entry.js +0 -1
  61. package/dist/sankhyablocks/p-d3f53df2.entry.js +0 -1
  62. package/dist/sankhyablocks/p-e8763234.entry.js +0 -1
  63. package/dist/sankhyablocks/p-feba9d4b.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as o,H as n,g as s}from"./p-d2d301a6.js";import{UserInterface as e,ObjectUtils as l,StringUtils as a,ApplicationContext as r,ElementIDUtils as d,ArrayUtils as h}from"@sankhyalabs/core";import{DataType as c,getConvertedValue as f}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{CheckMode as u,ApplicationUtils as g,DialogType as m}from"@sankhyalabs/ezui/dist/collection/utils";import{c as v,D as b,d as p,C as z,a as _,b as k,A as C}from"./p-95ce311a.js";import{S as x}from"./p-fadc8339.js";import{R as y}from"./p-688dcb4c.js";import{S as F}from"./p-fa816fb2.js";import{U as w}from"./p-06421fdb.js";import{buildFormConfigFromDataUnit as D}from"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-4d9549cf.js";import"./p-ff1990ad.js";import"./p-f3434fc4.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const E=class{constructor(o){i(this,o),this.configOptionsChanged=t(this,"configOptionsChanged",7),this._defaultType=void 0,this.fieldConfig={},this.idConfig=void 0,this.dataUnit=void 0,this.messagesBuilder=void 0}onConfigDefault(i){null!=i&&(this._defaultType=i,this.fieldConfig.defaultValue={type:this._defaultType},this.configOptionsChanged.emit(this.fieldConfig))}buildOptions(){var i,t,o;let n=null===(o=null===(i=this.dataUnit)||void 0===i?void 0:i.getField(null===(t=this.fieldConfig)||void 0===t?void 0:t.name))||void 0===o?void 0:o.userInterface;return n===e.SEARCH&&(n=e.INTEGERNUMBER),v.UserInterface[n]}enabledValueDefault(){var i,t,o;const n=null===(i=this.dataUnit)||void 0===i?void 0:i.getField(null===(t=this.fieldConfig)||void 0===t?void 0:t.name),s=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o.allowDefault,l=v.UserInterface.hasOwnProperty(null==n?void 0:n.userInterface)||(null==n?void 0:n.userInterface)===e.SEARCH;return!(null!=s&&"true"!==s||!l)}isAllowDefault(){var i,t;const o=null===(t=null===(i=this._fieldProperties)||void 0===i?void 0:i.properties)||void 0===t?void 0:t.allowDefault;return null==o||"true"===o}loadDefaultValue(){var i;null==this.fieldConfig?(this._defaultType=b.fixed,this.fieldConfig={defaultValue:{type:this._defaultType}}):null==(null===(i=this.fieldConfig.defaultValue)||void 0===i?void 0:i.type)?(this._defaultType=b.fixed,this.fieldConfig.defaultValue={type:this._defaultType}):this._defaultType=this.fieldConfig.defaultValue.type}getFieldProperties(i){var t;if(null!=i)return null===(t=this.dataUnit)||void 0===t?void 0:t.getField(i)}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}getDefaultType(){var i;return null!==(i=this.fieldConfig.defaultValue.type)&&void 0!==i?i:b.fixed}getEnabledByProperty(i,t){const o=this._fieldProperties;if(null==o)return!0;const n=o.properties||{};return n.hasOwnProperty(t)?"S"!==n[t]:!0!==o[i]}getValueByProperty(i){const t=this._fieldProperties;return null!=t&&!0===t[i]||this.fieldConfig[i]}getValidatedValue(i){var t,o;if(null==i)return;const n=null===(t=this.dataUnit)||void 0===t?void 0:t.getField(null===(o=this.fieldConfig)||void 0===o?void 0:o.name),s=null==n?void 0:n.dataType;if(null==s)return;const e=null!=(null==i?void 0:i.waitmessage)?void 0:s!==c.OBJECT&&s!==c.DATE&&"object"==typeof i?i.value:i;return s===c.OBJECT?JSON.stringify(e):e}buildInputDefault({value:i,enabled:t,label:n,name:s,required:a,userInterface:r},d,h){let c,f=0,u=0;const g=null==r||null==p[r]?p.DEFAULT:p[r];if(r===e.OPTIONSELECTOR){const i=null==d?void 0:d.options;if("string"==typeof i){const t=l.stringToObject(i);c=Object.keys(t).map((i=>({value:i,label:t[i]})))}else c=i}else r===e.DECIMALNUMBER&&(f=Number((null==d?void 0:d.precision)||2),u=Number((null==d?void 0:d.prettyPrecision)||f));return o(g,Object.assign({value:i,enabled:t,label:n,"data-field-name":s,key:s,onEzChange:i=>this.onChange(null==i?void 0:i.detail)},this.getConditionalAttributes(r,a,c,f,u,h)))}getConditionalAttributes(i,t,o,n,s,l){switch(i){case e.SEARCH:return{suppressEmptyOption:t,optionLoader:i=>this.onSearch(i)};case e.OPTIONSELECTOR:return{suppressEmptyOption:t,options:o};case e.CHECKBOX:case e.SWITCH:return{mode:l};case e.INTEGERNUMBER:case e.DECIMALNUMBER:return{precision:n,prettyPrecision:s,onEzStartChange:i=>this.onChange(null==i?void 0:i.detail)};case e.DATE:case e.DATETIME:case e.TIME:return{onEzStartChange:i=>this.onChange(null==i?void 0:i.detail)};default:return{}}}onChange(i){this.fieldConfig.defaultValue.value=this.getValidatedValue(i),this.configOptionsChanged.emit(this.fieldConfig)}onSearch(i){if(null!=this._application&&null!=this.fieldConfig)return this._application.executeSearch(i,this.fieldConfig.name,this.dataUnit)}buildField(i,t){const{name:o,label:n,readOnly:s,required:l,defaultValue:r}=t,{userInterface:d,properties:h}=i;let c,g=a.getBooleanValue(null==h?void 0:h.allowDefault,!s);d===e.FILE&&(g=!1),g&&(c=null==r?void 0:r.value,null!=c&&(c=f(null==i?void 0:i.dataType,c)));const m={value:c,enabled:g,label:n,name:o,required:l,userInterface:d};switch(d){case e.SWITCH:return this.buildInputDefault(m,void 0,u.SWITCH);case e.CHECKBOX:return this.buildInputDefault(m,void 0,u.REGULAR);case e.OPTIONSELECTOR:case e.DECIMALNUMBER:return this.buildInputDefault(m,h);default:return this.buildInputDefault(m)}}componentWillLoad(){var i;this.loadDefaultValue(),this._application=r.getContextValue("__SNK__APPLICATION__"),this._fieldProperties=this.getFieldProperties(null===(i=this.fieldConfig)||void 0===i?void 0:i.name)}componentDidLoad(){d.addIDInfo(this._element,this.fieldConfig.name)}render(){var i,t;return o(n,null,o("div",{id:this.idConfig},o("div",{class:"ez-row ez-padding--medium"},o("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},o("ez-text-input",{label:this.getMessage("snkConfigOptions.label.nameField"),value:null===(i=this.fieldConfig)||void 0===i?void 0:i.label,onEzChange:i=>{this.fieldConfig.label=i.detail,this.configOptionsChanged.emit(this.fieldConfig)}})),o("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},o("ez-combo-box",{label:this.getMessage("snkConfigOptions.label.typeValueDefault"),suppressEmptyOption:!0,enabled:this.enabledValueDefault(),onEzChange:i=>{var t;return this.onConfigDefault(null===(t=i.detail)||void 0===t?void 0:t.value)},value:this.getDefaultType()},o("option",{value:b.fixed},this.getMessage("snkConfigOptions.options.valueFixed")),o("option",{value:b.variable},this.getMessage("snkConfigOptions.options.variable")))),o("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},this._defaultType===b.variable?o("ez-combo-box",{label:this.getMessage("snkConfigOptions.label.valueDefault"),enabled:this.isAllowDefault(),onEzChange:i=>{var t;this.fieldConfig.defaultValue.value=null===(t=i.detail)||void 0===t?void 0:t.value,this.configOptionsChanged.emit(this.fieldConfig)},value:this.fieldConfig.defaultValue.value,options:this.buildOptions()}):(null===(t=this._fieldProperties)||void 0===t?void 0:t.userInterface)&&this.buildField(this._fieldProperties,this.fieldConfig))),o("div",{class:"ez-row ez-padding--medium config-options__switch-row"},o("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},o("ez-check",{mode:u.SWITCH,label:this.getMessage("snkConfigOptions.label.clearDuplicate"),value:this.fieldConfig.cleanOnCopy,onEzChange:i=>{this.fieldConfig.cleanOnCopy=i.detail,this.configOptionsChanged.emit(this.fieldConfig)}})),o("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},o("ez-check",{mode:u.SWITCH,label:this.getMessage("snkConfigOptions.label.requiredField"),enabled:this.getEnabledByProperty("required","systemRequired"),value:this.getValueByProperty("required"),onEzChange:i=>{this.fieldConfig.required=i.detail,this.configOptionsChanged.emit(this.fieldConfig)}})),o("div",{class:"ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small"},o("ez-check",{mode:u.SWITCH,label:this.getMessage("snkConfigOptions.label.protectedField"),enabled:this.getEnabledByProperty("readOnly","systemReadOnly"),value:this.getValueByProperty("readOnly"),onEzChange:i=>{this.fieldConfig.readOnly=i.detail,this.configOptionsChanged.emit(this.fieldConfig)}})))))}get _element(){return s(this)}};E.style=".sc-snk-config-options-h{--snk-config-options--border:2px solid var(--color--secondary-200, #D2D3DA);width:100%;border-radius:15px;border:var(--snk-config-options--border)}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";const T=class{constructor(o){i(this,o),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this._dataUnit=void 0,this._dataState=void 0,this._showFormConfig=!1,this._configManager=void 0,this.configName=void 0,this.recordsValidator=void 0,this.messagesBuilder=void 0,this.formLegacyConfigName=void 0,this.resourceID=void 0}async showConfig(){this._showFormConfig=!0}async hideConfig(){this._showFormConfig=!1}async addCustomEditor(i,t){if(this._form)return void this._form.addCustomEditor(i,t);const o=new Map(this._customEditors);o.set(i,t),this._customEditors=o}async setFieldProp(i,t,o){await this._form.setFieldProp(i,t,o)}closeConfig(){this.hideConfig()}dataunitReady(){d.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}setCustomEditors(){if(this._form)for(const[i,t]of this._customEditors)this._form.addCustomEditor(i,t),this._customEditors.delete(i)}async componentDidRender(){this.setCustomEditors()}async componentWillLoad(){let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.dataunitReady():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}i=i.parentElement}null==this.resourceID&&(this.resourceID=await y.getResourceID()),this._configManager=new x(this.configName,this.resourceID,void 0,this._dataUnit),this.addFormLegacyConfig(),await this._configManager.loadConfig()}async handleDataStateChange(i){var t;this._dataState=i.detail;const o=await this._snkDataUnit.getFieldsWithRmPrecision();for(const i of o||[]){if(!i)continue;const o=null===(t=this._dataState.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",i);(o||0===o)&&(await this.setFieldProp(i,"precision",o),await this.setFieldProp(i,"prettyPrecision",o))}}addFormLegacyConfig(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}render(){if(this._dataUnit&&this._dataState)return o("section",null,o("div",{class:"ez-row"},o("div",{class:"ez-col ez-col--sd-12"},o("ez-form",{ref:i=>this._form=i,key:"ezForm"+this._snkDataUnit.entityName,"data-element-id":"embedded",dataUnit:this._dataUnit,config:this._configManager.getConfig(this._dataUnit),recordsValidator:this.recordsValidator,class:this._showFormConfig?"snk-form__form--hidden":""}),this._showFormConfig&&o("snk-form-config",{messagesBuilder:this.messagesBuilder,dataUnit:this._dataUnit,configManager:this._configManager,onConfigClose:()=>this.closeConfig()}))))}get _element(){return s(this)}};T.style=".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";const O="EZ-COLLAPSIBLE-BOX",S="fieldsWithoutGroupContainer",A="fieldsAvailableContainer",L="addNewGroupContainer",I=class{constructor(o){i(this,o),this.configChange=t(this,"configChange",7),this.configClose=t(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 t;this._formConfig=this.getConfig(),this.loadFields(i),this.controlFieldConfig(),null!=(null===(t=this._filterFieldsAvailable)||void 0===t?void 0:t.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=D(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,t)=>({label:i.tab,order:t,visible:i.visible})))}getFieldsToSave(){const i=[];return this._formContainer.querySelectorAll("snk-field-config").forEach((t=>{const o=t.fieldConfig;if(null==o)return;const n={cleanOnCopy:o.cleanOnCopy||!1,group:o.group,label:o.label,name:o.name,required:o.required,readOnly:o.readOnly,tab:o.tab};null!=o.defaultValue&&(n.defaultValue=null==o.defaultValue.type?{type:b.fixed,value:o.defaultValue}:o.defaultValue),i.push(n)})),i}isDefaultConfiguration(){var i;return(null===(i=this._optionFormConfigSelected)||void 0===i?void 0:i.origin)===w.DEFAULT&&!0===this._optionFormConfigChanged&&!1===this._formConfigChanged}buildConfigToSave(){let i={};const t=this.isDefaultConfiguration();if(i=t?this.getConfig():l.copy(this._formConfig),!1===t){const t=this.getTabsToSave();(null==t?void 0:t.length)>0&&(i.tabs=t);const o=this.getFieldsToSave();(null==o?void 0:o.length)>0&&(i.fields=o)}return i.defaultConfiguration=t,i}saveConfig(){var i;(null===(i=this._tempGroups)||void 0===i?void 0:i.length)>0?g.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 t;g.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"),{iconName:"check"});const o=null===(t=this._formConfigOptions)||void 0===t?void 0:t.find((i=>i.origin===w.USER));this.setFormConfig(o),this.configChange.emit(i)})))}applyOptionConfig(){if(!0===this._optionFormConfigChanged&&null!=this._optionFormConfigSelected){const i=this._optionFormConfigSelected.name||"configuração selecionada",t=this._optionFormConfigSelected.origin===w.DEFAULT?"pessoal":"padrão",o=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",i).replace("{1}",t);this.openConfirmDialog(o).then((i=>{i&&this.saveConfig()}))}else this.saveConfig()}controlFieldConfig(i){var t;this._fieldConfigSelected=null!=i?(null===(t=this._fieldConfigSelected)||void 0===t?void 0:t.name)===(null==i?void 0:i.name)?void 0:i:void 0}getFieldConfigStyle(i){var t;return this._formFieldsStyle+((null===(t=this._fieldConfigSelected)||void 0===t?void 0:t.name)===i.name?" form-config__field-config--selected":"")}getFieldsByGroup(i){var t;return(null===(t=i.fields)||void 0===t?void 0:t.length)?i.fields.map((i=>{var t,n;return o("div",{key:i.name,class:this.getFieldConfigStyle(i),"data-draggable-element":"field",onMouseDown:i=>this.controlMoveField(i)},o("snk-field-config",{messagesBuilder:this.messagesBuilder,onEzClickIcon:i=>{this.handleFieldConfigChange(i)},modeInsertion:!1,fieldConfig:i,dataUnit:this.dataUnit,isConfigActive:(null===(t=this._fieldConfigSelected)||void 0===t?void 0:t.name)===i.name,id:i.name,key:i.name}),(null===(n=this._fieldConfigSelected)||void 0===n?void 0:n.name)===i.name&&o("div",{class:"ez-flex form-config__config-options"},o("snk-config-options",{idConfig:i.name,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,fieldConfig:this._fieldConfigSelected,"data-element-id":this._element.getAttribute(d.DATA_ELEMENT_ID_ATTRIBUTE_NAME),onConfigOptionsChanged:i=>this.handleconfigOptionsChanged(i.detail)})))})):o("div",{class:"form-config__add-group-container"},o("div",{class:"form-config__add-group-content"},o("div",{class:"form-config__add-group-label"},o("label",{class:"ez-text ez-text--center ez-text--medium ez-text--primary ez-text--bold"},this.getMessage("snkFormConfig.form.labelDropField")))))}handleconfigOptionsChanged(i){var t;null===(t=this._formConfig.fields)||void 0===t||t.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="",t=this.getMessage("snkFormConfig.confirm.title")){return g.confirm(t,i)}controlMoveField(i){const t=null==i?void 0:i.target;null!=(null==t?void 0:t.closest('[data-draggable-element="field"]'))&&(this._mouseOnFieldConfig=!0,null!=(null==t?void 0:t.closest(".form-config__config-options"))||null!=(null==t?void 0:t.closest(".field-config__options"))?this._mouseOnConfigOptions=!0:!1===["minus","settings-inverted","chevron-up"].includes(null==t?void 0:t.iconName)&&this.controlFieldConfig())}controlStartDraggingField(i){var t,o,n;if(this._mouseOnConfigOptions)null==i||i.cancel(),this._mouseOnConfigOptions=!1;else{const s=null===(n=null===(o=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.dragEvent)||void 0===o?void 0:o.data)||void 0===n?void 0:n.sourceContainer;null!=s&&s.classList.add(this._fieldFloatingStyle)}}controlSortedDraggingField(i){var t,o,n,s,e,l,a,r;const d=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.oldContainer,h=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.newContainer,c=null===(e=null===(s=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.dragEvent)||void 0===s?void 0:s.data)||void 0===e?void 0:e.source,f=null===(r=null===(a=null===(l=null==i?void 0:i.data)||void 0===l?void 0:l.dragEvent)||void 0===a?void 0:a.data)||void 0===r?void 0:r.originalSource;null!=d&&null!=h&&null!=c&&null!=f&&(h.tagName!==O&&h.id!==S||d.id!==A?d.tagName!==O&&d.id!==S||h.id!==A||(c.className=this._fieldsAvailableStyle,c.querySelector("snk-field-config").modeInsertion=!0,f.className=this._fieldsAvailableStyle,f.querySelector("snk-field-config").modeInsertion=!0):(c.className=this._formFieldsStyle,c.querySelector("snk-field-config").modeInsertion=!1,f.className=this._formFieldsStyle,f.querySelector("snk-field-config").modeInsertion=!1))}isCancelDragAvailableField(i,t,o){var n,s;return null!=i&&null!=t&&null!=o&&(null===(n=o.data)||void 0===n?void 0:n.newIndex)!==(null===(s=o.data)||void 0===s?void 0:s.oldIndex)&&i.id===A&&t.id===i.id&&(o.cancel(),this._fieldsAvailable=[],setTimeout((()=>{this.buildAvailableFields()}),this._sortableTimer),!0)}isRemoveField(i,t,o){if(null==i||null==t||null==o)return!1;if((t.tagName===O||t.id===S)&&i.id===A){const i={detail:{field:o,type:C.remove}};return setTimeout((()=>{this.handleFieldConfigChange(i)}),this._renderTimer),!0}return!1}isAddOrMoveField(i,t,o,n){var s;return null!=i&&null!=t&&null!=o&&null!=n&&(n.newIndex!==n.oldIndex||t.dataset.groupName!==i.dataset.groupName||i.id===S&&t.id===A)&&(this.isFieldAvailable(i,t)&&(o.tab=null===(s=this._tabConfig)||void 0===s?void 0:s.selectedTab),o.group=i.dataset.groupName,setTimeout((()=>{i.id.includes(L)&&this.clearTempGroups(!0),this.updateFieldsToSave(t.dataset.groupName!==i.dataset.groupName||i.id===S&&t.id===A?this._sortableTimer:0)}),this._renderTimer),!0)}isFieldAvailable(i,t){return null!=i&&null!=t&&(i.tagName===O||i.id===S)&&t.id===A}controlStopDraggingField(i){var t,o,n,s,e,l;const a=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.oldContainer,r=null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.newContainer;if(this.isCancelDragAvailableField(r,a,i))return;const d=null===(e=null===(s=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.dragEvent)||void 0===s?void 0:s.data)||void 0===e?void 0:e.originalSource,h=null===(l=null==d?void 0:d.querySelector("snk-field-config"))||void 0===l?void 0:l.fieldConfig;this.isRemoveField(r,a,h)||this.isAddOrMoveField(r,a,h,null==i?void 0:i.data)}updateFieldsToSave(i=0){const t=this.getFieldsToSave();(null==t?void 0:t.length)>0&&(this._formConfig.fields=t),this.loadFields(i),this._formConfigChanged=!0}controlSortableField(){null!=this._sortableContainer&&(this._sortableField&&this._sortableField.destroy(),this._sortableField=new F(this._sortableContainer.querySelectorAll('[data-draggable-parent="field"]'),{draggable:'[data-draggable-element="field"]',mirror:{constrainDimensions:!0},distance:z.dragStartDistance}),this._sortableField.on(_.dragStart,(i=>this.controlStartDraggingField(i))),this._sortableField.on(_.dragSorted,(i=>this.controlSortedDraggingField(i))),this._sortableField.on(_.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 F(this._sortableContainer.querySelectorAll('[data-draggable-parent="group"]'),{draggable:'[data-draggable-element="group"]',mirror:{constrainDimensions:!0},distance:z.dragStartDistance}),this._sortableGroup.on(_.dragStart,(i=>this.controlStartDraggingGroup(i))),this._sortableGroup.on(_.dragStop,(i=>this.controlStopDraggingGroup(i))))}loadUserConfig(){null!=this.configManager&&this.configManager.fetchUserAvailableConfigs().then((i=>{if(this._formConfigOptions=i,null==this._formConfigOptions)return;let t=null==this._formConfig||this._formConfig.defaultConfiguration;const o=i.find((i=>i.origin===(t?w.DEFAULT:w.USER)));this.setFormConfig(o)}))}setFormConfig(i){this._optionFormConfigSelected=i}controlSelectFormConfig(i){const t=null==i?void 0:i.detail,o=this._formConfigOptions.find((i=>i.origin===(null==t?void 0:t.value)));this.setFormConfig(o),this._optionFormConfigChanged=!0,this.loadConfigByUser()}changeTabOrder(i){const t=[],o=this._tabConfig.querySelectorAll(".tab-config__tab");this._tabSelected=i,o.forEach(((i,o)=>{var n;if(o){const s=null===(n=i.querySelector(".tab-config__tab-label"))||void 0===n?void 0:n.getAttribute("title");t.push({label:s,order:o-1})}})),this._layoutFormConfig.map((i=>{t.forEach((t=>{t.label===i.tab&&(t.visible=i.visible)}))})),t.length>0&&(this._formConfig.tabs=t,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===w.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,t;const o=null===(i=this._tabConfig)||void 0===i?void 0:i.selectedTab;null==(null===(t=this._tempGroups)||void 0===t?void 0:t.find((i=>i.tab===o&&i.group.includes(this._labelNewGroup))))&&(this._tempGroups.push({tab:o,group:this.handleDuplicateGroups(this._labelNewGroup,this._tabConfig.selectedTab)}),this.loadFields(),this.controlFieldConfig(),this._formConfigChanged=!0)}clearTempGroups(i=!1){var t;(null===(t=this._tempGroups)||void 0===t?void 0:t.length)>0&&(this._tempGroups=i?this._tempGroups.filter((i=>i.tab!==this._tabConfig.selectedTab)):[])}removeGroup(i){null!=i?this._tempGroups=this._tempGroups.filter(((t,o)=>o!==i&&t.tab===this._tabConfig.selectedTab||t.tab!==this._tabConfig.selectedTab)):this.updateFieldsToSave(this._sortableTimer)}checkGroupExists(i,t,o=!1){var n,s,e;const l=null===(n=this._tabConfig)||void 0===n?void 0:n.selectedTab,a=null===(s=this._layoutFormConfig)||void 0===s?void 0:s.find((i=>i.tab===l)),r=null===(e=null==a?void 0:a.groups)||void 0===e?void 0:e.map((i=>{var t;return null===(t=i.group)||void 0===t?void 0:t.toLowerCase()}));if(null==r?void 0:r.includes(null==i?void 0:i.toLowerCase())){const n=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===k.main?this.getMessage("snkFormConfig.form.mainArea"):l}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `;return g.alert(n,s).then((()=>{var i,n;o?null===(i=this._newGroupBoxes[t])||void 0===i||i.applyFocusTextEdit():null===(n=this._currentGroupBoxes[l][t])||void 0===n||n.applyFocusTextEdit()})),!1}return!0}saveEditLabelTempGroup(i,t){const{newValue:o}=i.detail;null!=this._newGroupBoxes&&null!=this._newGroupBoxes[t]&&(this._newGroupBoxes[t].dataset.groupName=o)}saveEditLabelGroup(i){var t;const{value:o,newValue:n}=i.detail;null===(t=this._formConfig.fields)||void 0===t||t.forEach((i=>{i.group===o&&(i.group=n)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}renderTempGroupByTab(i){return this._tempGroups.map(((t,n)=>{if(t.tab===i)return o("ez-collapsible-box",{ref:i=>this._newGroupBoxes[n]=i,id:`${L}-${n}`,editable:!0,removable:!0,"header-size":"large",label:t.group,"icon-placement":"left","data-group-name":t.group,"data-draggable-parent":"field",class:"form-config__add-group",onEzRemove:()=>this.removeGroup(n),onEzSaveEditLabel:i=>this.saveEditLabelTempGroup(i,n),onEzEditLabelMode:i=>this._editingTitleGroup=i.detail,conditionalSave:i=>this.checkGroupExists(i,n,!0)},this.getFieldsByGroup(t))}))}handleDuplicateGroups(i,t){var o;const n=this._layoutFormConfig[this._tabConfig.selectedIndex].groups.map((i=>i.group));return null!=n&&(null===(o=this._layoutFormConfig)||void 0===o||o.map((o=>{o.tab===t&&o.groups.some((t=>t.group===i))&&(i+=`${this.captureHighestValueTitle(n)}`)}))),i}captureHighestValueTitle(i){let t=[];return null==i||i.map((i=>{null!=i&&t.push(i.replace(/[^0-9]/g,""))})),Math.max.apply(null,t)>0?` (${Math.max.apply(null,t)+1})`:" (1)"}getLayoutFormConfig(){var i,t;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let o=[],n=[];for(const i of this._formConfig.fields)if(null==n.find((t=>i.name===t.name&&i.tab===t.tab))){n.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 n=o.find((t=>t.tab===i.tab));if(null==n){let s=null;if(null!=this._formConfig.tabs){const t=this._formConfig.tabs.filter((t=>t.label===i.tab));t.length>0&&(s=t[0].visible)}const e=(null===(t=i.tab)||void 0===t?void 0:t.label)||i.tab;n=null!==s?{tab:e,groups:[],visible:s}:{tab:e,groups:[],visible:!0},o.push(n)}const e=n.groups.find((t=>t.group===i.group));if(e)e.fields.push(i);else{const t={group:i.group,fields:[i]};void 0===i.group?n.groups.unshift(t):n.groups.push(t)}}}return o}configureTabs(i){var t;return null==(null===(t=this._formConfig)||void 0===t?void 0:t.tabs)?i:(null==i&&(i=[]),this._formConfig.defaultConfiguration?i:this._formConfig.tabs.map((t=>i.find((i=>{var o,n;return(null===(o=t.label)||void 0===o?void 0:o.toLowerCase())===(null===(n=i.tab)||void 0===n?void 0:n.toLowerCase())}))||{tab:t.label,groups:[],visible:t.visible})))}configureTabMain(i){return null==i&&(i=[]),null==i.find((i=>i.tab===k.main))&&i.unshift({tab:k.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 t=this.getLayoutFormConfig();t=this.configureTabs(t),t=this.configureTabMain(t),this._layoutFormConfig=t,this.updateTabs()}buildAvailableFields(){var i,t;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;let o=[],n=this.dataUnit.metadata.fields;for(const i of this._formConfig.fields)o.push(i);const s=n.filter((({name:i,visible:t})=>!0===t&&!1===o.some((({name:t})=>t===i))));this._fieldsAvailable=s,this._listEnabledFields=s,null!=(null===(t=this._filterFieldsAvailable)||void 0===t?void 0:t.value)&&this.onFilterChange(this._filterFieldsAvailable.value)}changeTabSelected(i){this._tabSelected=i.index;const t=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")),t&&(t.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=h.applyStringFilter(i,this._listEnabledFields,!0,"label")}orderFieldsAvailable(i){return h.sortAlphabetically(i)}handleLabelCounter(i){const t=[this.getMessage("snkFormConfig.availableFields.labelNoFields"),this.getMessage("snkFormConfig.availableFields.labelOneField")];return i>1?`${i} ${this.getMessage("snkFormConfig.availableFields.labelAvailableFields")}`:t[i]}controlAddFieldConfig(i){var t;if(this._formConfigChanged=!1,null==i)return;null==this._formConfig.fields&&(this._formConfig.fields=[]);const o=this._formConfig.fields.filter((t=>t.name===i.name&&t.tab&&i.tab));o.length>0?o.forEach((t=>{t.name=i.name,t.label=i.label,t.required=i.required,t.readOnly=i.readOnly,t.group=i.group})):this._formConfig.fields.push({name:i.name,label:i.label,required:i.required,readOnly:i.readOnly,group:i.group,tab:null===(t=this._tabConfig)||void 0===t?void 0:t.selectedTab}),this.loadFields(),this.controlFieldConfig(),this._formConfigChanged=!0,this.resetSortables()}controlRemoveFieldConfig(i,t){var o;this._formConfigChanged=!1,null!=i&&(this._formConfig.fields=null===(o=this._formConfig.fields)||void 0===o?void 0:o.filter((t=>t.name!==i.name)),this.loadFields(t),this.controlFieldConfig(),this._formConfigChanged=!0,this.resetSortables())}resetSortables(){this.controlSortableField(),this.controlSortableGroup()}handleFieldConfigChange(i,t=0){const{field:o,type:n}=i.detail;n!==C.configuration?n!==C.remove?n!==C.add||this.controlAddFieldConfig(o):this.controlRemoveFieldConfig(o,t):this.controlFieldConfig(o)}changeTabLabel(i){var t,o;const{value:n,newValue:s}=i.detail.detail;null===(t=this._formConfig.fields)||void 0===t||t.forEach((i=>{i.tab===n&&(i.tab=s)})),null===(o=this._formConfig.tabs)||void 0===o||o.forEach((i=>{i.label===n&&(i.label=s)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}handleDeleteTab(i){let t={canClose:!1,labelCancel:this.getMessage("snkFormConfig.confirm.labelCancel"),labelConfirm:this.getMessage("snkFormConfig.confirm.labelDelete"),btnConfirmDanger:!1};const o=this.getMessage("snkFormConfig.confirm.title"),n=this.getMessage("snkFormConfig.confirm.deleteTab")+` <b>${i.detail.label}</b>?`;g.confirm(o,n,null,m.WARN,t).then((t=>{var o;t&&(this._formConfig.tabs=null===(o=this._formConfig.tabs)||void 0===o?void 0:o.filter((t=>t.label!==i.detail.label)),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0)}))}changeHideTab(i){var t;null===(t=this._formConfig.tabs)||void 0===t||t.forEach((t=>{t.label===i.detail.label&&(t.visible=!t.visible)})),this.loadFields(this._sortableTimer),this.controlFieldConfig(),this._formConfigChanged=!0}handleCanStartDragTab(){var i,t;const o=this._layoutFormConfig.map((i=>i.tab));for(const t of o)null===(i=this._currentGroupBoxes[t])||void 0===i||i.map((i=>null==i?void 0:i.cancelEdition()));null===(t=this._newGroupBoxes)||void 0===t||t.map((i=>null==i?void 0:i.cancelEdition()))}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}componentDidRender(){this.controlSortableField(),this.controlSortableGroup()}async componentWillRender(){if(null==this.messagesBuilder){const i=r.getContextValue("__SNK__APPLICATION__");this.messagesBuilder=i.messagesBuilder}}componentWillLoad(){this.loadConfig()}componentDidLoad(){d.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}render(){var i,t,s,e;return o(n,null,o("div",{class:"ez-row ez-padding--medium"},o("div",{class:"ez-col ez-col--sd-7 ez-col--tb-9 ez-align--middle"},o("ez-button",{mode:"icon",title:this.getMessage("snkFormConfig.goBackTitle"),iconName:"arrow_back",class:"ez-padding--small",size:"small",onClick:()=>this.closeFormConfig(),id:"formConfigToBack"}),o("h1",{class:"ez-title ez-title--primary ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),this._formConfigOptions&&o("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"})),o("div",{class:"ez-col ez-col--sd-5 ez-col--tb-3 ez-align--middle ez-align--right"},!0===this._formConfigChanged&&!1===this._optionFormConfigChanged&&o("div",{class:"ez-row ez-align--middle ez-align--right"},o("ez-button",{label:"Cancelar",class:"ez-padding-left--medium",size:"small",onClick:()=>this.cancelChangeConfig()}),o("ez-button",{label:"Salvar",class:"ez-button--primary ez-padding-left--medium",size:"small",onClick:()=>this.saveConfig()},o("ez-icon",{class:"ez-margin-right--small",slot:"leftIcon",iconName:"save"}))),!0===this._optionFormConfigChanged&&o("div",{class:"ez-row ez-align--middle ez-align--right"},o("ez-button",{label:"Cancelar",class:"ez-padding-left--medium",size:"small",onClick:()=>this.cancelChangeOptionConfig()}),o("ez-button",{label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",size:"small",onClick:()=>this.applyOptionConfig()})))),o("div",{class:"ez-row ez-padding--medium",ref:i=>this._sortableContainer=i},o("div",{class:"form-config__tab-container ez-col ez-col--sd-9 ez-col--tb-9 ez-padding-right--medium"},(null===(t=this._layoutFormConfig)||void 0===t?void 0:t.length)>0&&o("section",{class:"ez-box__container",ref:i=>this._formContainer=i},o("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,t)=>o("div",{id:"tab"+t,"data-draggable-parent":"group",class:this._tabSelected===t?"form-config__tab-content ez-flex ez-flex--column ez-size-width--full ez-padding--medium":"form-config__hide-content"},i.groups.map(((t,n)=>t.group?(null==this._currentGroupBoxes[i.tab]&&(this._currentGroupBoxes[i.tab]=[]),o("ez-collapsible-box",{ref:t=>this._currentGroupBoxes[i.tab][n]=t,editable:!0,removable:!0,"header-size":"large",label:t.group,"icon-placement":"left","data-group-name":t.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,n)},this.getFieldsByGroup(t))):o("div",{class:"ez-flex ez-flex--column ez-size-width--full"},o("label",{class:"ez-text ez-text--secondary ez-margin-vertical--small"},this.getMessage("snkFormConfig.form.subTitleInfo")),o("div",{id:S,class:"ez-row","data-draggable-parent":"field"},this.getFieldsByGroup(t)),o("hr",{class:"ez-divider-horizontal ez-margin-vertical--medium"})))),this.renderTempGroupByTab(i.tab)))),o("div",{class:"form-config__btn-add-group ez-row"},o("div",{class:"form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center"},o("ez-button",{label:this.getMessage("snkFormConfig.form.labelNewGroup"),class:"ez-padding-horizontal--small ez-button--primary",size:"small",onClick:()=>this.addNewGroup()},o("ez-icon",{class:"ez-margin-right--small",slot:"leftIcon",iconName:"plus"})))))),o("div",{class:"form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3"},o("section",{class:"ez-box__container ez-col ez-col--pn-12"},o("h1",{class:"ez-title ez-title--large ez-title--primary ez-padding-bottom--medium"},this.getMessage("snkFormConfig.availableFields.title")),o("ez-filter-input",{id:"searchFields",ref:i=>this._filterFieldsAvailable=i,label:this.getMessage("snkFormConfig.availableFields.labelSearchField"),onEzChange:i=>this.onFilterChange(i.detail)}),o("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&&o("div",{id:A,class:"ez-row","data-draggable-parent":"field"},this.orderFieldsAvailable(this._fieldsAvailable).map((i=>o("div",{key:i.name,class:this._fieldsAvailableStyle,"data-draggable-element":"field",onMouseDown:i=>this.controlMoveField(i)},o("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"]}}};I.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{E as snk_config_options,T as snk_form,I as snk_form_config}
@@ -1 +1 @@
1
- import{C as t}from"./p-4d9549cf.js";import{ObjectUtils as e,StringUtils as i}from"@sankhyalabs/core";import{F as s}from"./p-06421fdb.js";import{T as r}from"./p-b0ef4383.js";class n{constructor(t,e,i,s){this._resourceID=e,this._configName=t,this._onConfigChange=i,this._dataUnit=s}addFormLegacyConfig(e){this._configName&&t.addFormLegacyConfig(this._configName,e)}async loadConfig(){return new Promise((e=>{t.loadFormConfig(this._configName,this._resourceID).then((t=>{t=this.buildFormMetadataUITabs(t),this.setConfig(t),e(t)})).catch((t=>{console.warn(t)}))}))}getEmptyConfig(){return this.buildFormMetadataUITabs({fields:[],emptyConfig:!0},!0)}saveConfig(i){const s=e.copy(i);return new Promise((e=>{t.saveFormConfig(i,this._configName,this._resourceID).then((t=>{this.setConfig(Object.assign(Object.assign({},s),t)),e(Object.assign(Object.assign({},s),t))}))}))}saveCardState(e,i,s){return new Promise((r=>{var n;const l=(null===(n=this._config)||void 0===n?void 0:n.cardsState)||new Map,a=l.get(e);l.set(e,"fixed"===s?this.updateFixSequence(Object.assign(Object.assign({},a),{fixed:i.fixed}),l):Object.assign(Object.assign({},a),{[s]:i[s]})),t.saveCardState(l,this._configName,this._resourceID).then((t=>{this._config=Object.assign(Object.assign({},this._config),{cardsState:l}),r(t)}))}))}updateFixSequence(t,e){let i=-1;return Array.from(e.values()).forEach((e=>{e.fixed||delete t.fixSequence,null!=e.fixSequence&&(i=Math.max(i,e.fixSequence))})),t.fixed?t.fixSequence=i+1:delete t.fixSequence,t}hasConfig(t){var e;const i=null!=t?t:this._config;return!(!i||!(null===(e=i.fields)||void 0===e?void 0:e.length))}getFieldsList(t,e=!1){var i;const s=null===(i=this._config)||void 0===i?void 0:i.fields;return this.hasConfig()&&!e?s.map((({label:t,name:e,readOnly:i,visible:s,required:r,tab:n})=>{var l;if(null==t){const t=null===(l=this._dataUnit)||void 0===l?void 0:l.getField(e);return Object.assign(Object.assign({},t),{name:null!=e?e:t.name,readOnly:null!=i?i:t.readOnly,visible:null!=s?s:t.visible,required:null!=r?r:t.required,tab:n})}return{name:e,label:t,readOnly:i,visible:s,required:r,tab:n}})).filter((e=>this.isFieldVisible(e,t))):this._dataUnit?this._dataUnit.metadata.fields.filter((e=>this.isFieldVisible(e,t))).map((({label:t,name:e,readOnly:i,visible:s,required:r,properties:n})=>({label:t,name:e,readOnly:i,visible:s,required:r,tab:null==n?void 0:n.UITabName}))):[]}isFieldVisible(t,e){if(!1===t.visible)return!1;if(null==e)return!0;const s=i.replaceAccentuatedCharsLower((t.label||t.name).toLocaleLowerCase()),r=i.replaceAccentuatedCharsLower(e.toLocaleLowerCase());return s.includes(r)}getFormConfig(t,e,i=!1){let s=this.getFieldsList(void 0,i);return e&&(s=s.filter((e=>{if(t){const i=t.getField(e.name);if(i&&i.readOnly)return!1}return!e.readOnly}))),Object.assign(Object.assign({},this._config),{fields:s})}setConfig(t){this.isLoaded=!0;const{cardsState:e,summary:i,defaultVars:s}=this._config||{};this._config=Object.assign({},t),e&&(this._config.cardsState=e),i&&(this._config.summary=i),s&&(this._config.defaultVars=s),this._onConfigChange&&this._onConfigChange(Object.assign({},this._config))}getConfig(t,e){return this.getFormConfig(t,null==e||e)}getFormConfigFetcher(){return null==this._formConfigFetcher&&(this._formConfigFetcher=new s),this._formConfigFetcher}async fetchUserAvailableConfigs(){return null!=this._configName?Promise.resolve(void 0):this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,this._resourceID)}async fetchLegacyConfig(){return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,this._resourceID)}async fetchDefaultConfig(){return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,this._resourceID)}parseObjectList(t){return t?Array.isArray(t)?t:[t]:[]}buildFormMetadataUITabs(t,e=!1){var i;const s=this.hasConfig(t);if(!e&&(!this._dataUnit||s))return t;(t=this.getFormConfig(this._dataUnit,!1,!0)).tabs=this.parseObjectList(t.tabs),t.emptyConfig=!1,t.defaultConfiguration=!0;const n=this._dataUnit.metadata.fields;for(const e of n){const s=t.fields.find((t=>t.name===e.name)),n=null===(i=e.properties)||void 0===i?void 0:i.UITabName;n&&n!==r.main&&(t.tabs.some((t=>t.label===n))||t.tabs.push({label:n,name:n,order:0,visible:!0}),s&&(s.tab=n))}return t}}export{n as S}
1
+ import{C as t}from"./p-4d9549cf.js";import{ObjectUtils as e,StringUtils as i}from"@sankhyalabs/core";import{F as s}from"./p-06421fdb.js";import{b as r}from"./p-95ce311a.js";class n{constructor(t,e,i,s){this._resourceID=e,this._configName=t,this._onConfigChange=i,this._dataUnit=s}addFormLegacyConfig(e){this._configName&&t.addFormLegacyConfig(this._configName,e)}async loadConfig(){return new Promise((e=>{t.loadFormConfig(this._configName,this._resourceID).then((t=>{t=this.buildFormMetadataUITabs(t),this.setConfig(t),e(t)})).catch((t=>{console.warn(t)}))}))}getEmptyConfig(){return this.buildFormMetadataUITabs({fields:[],emptyConfig:!0},!0)}saveConfig(i){const s=e.copy(i);return new Promise((e=>{t.saveFormConfig(i,this._configName,this._resourceID).then((t=>{this.setConfig(Object.assign(Object.assign({},s),t)),e(Object.assign(Object.assign({},s),t))}))}))}saveCardState(e,i,s){return new Promise((r=>{var n;const l=(null===(n=this._config)||void 0===n?void 0:n.cardsState)||new Map,a=l.get(e);l.set(e,"fixed"===s?this.updateFixSequence(Object.assign(Object.assign({},a),{fixed:i.fixed}),l):Object.assign(Object.assign({},a),{[s]:i[s]})),t.saveCardState(l,this._configName,this._resourceID).then((t=>{this._config=Object.assign(Object.assign({},this._config),{cardsState:l}),r(t)}))}))}updateFixSequence(t,e){let i=-1;return Array.from(e.values()).forEach((e=>{e.fixed||delete t.fixSequence,null!=e.fixSequence&&(i=Math.max(i,e.fixSequence))})),t.fixed?t.fixSequence=i+1:delete t.fixSequence,t}hasConfig(t){var e;const i=null!=t?t:this._config;return!(!i||!(null===(e=i.fields)||void 0===e?void 0:e.length))}getFieldsList(t,e=!1){var i;const s=null===(i=this._config)||void 0===i?void 0:i.fields;return this.hasConfig()&&!e?s.map((({label:t,name:e,readOnly:i,visible:s,required:r,tab:n})=>{var l;if(null==t){const t=null===(l=this._dataUnit)||void 0===l?void 0:l.getField(e);return Object.assign(Object.assign({},t),{name:null!=e?e:t.name,readOnly:null!=i?i:t.readOnly,visible:null!=s?s:t.visible,required:null!=r?r:t.required,tab:n})}return{name:e,label:t,readOnly:i,visible:s,required:r,tab:n}})).filter((e=>this.isFieldVisible(e,t))):this._dataUnit?this._dataUnit.metadata.fields.filter((e=>this.isFieldVisible(e,t))).map((({label:t,name:e,readOnly:i,visible:s,required:r,properties:n})=>({label:t,name:e,readOnly:i,visible:s,required:r,tab:null==n?void 0:n.UITabName}))):[]}isFieldVisible(t,e){if(!1===t.visible)return!1;if(null==e)return!0;const s=i.replaceAccentuatedCharsLower((t.label||t.name).toLocaleLowerCase()),r=i.replaceAccentuatedCharsLower(e.toLocaleLowerCase());return s.includes(r)}getFormConfig(t,e,i=!1){let s=this.getFieldsList(void 0,i);return e&&(s=s.filter((e=>{if(t){const i=t.getField(e.name);if(i&&i.readOnly)return!1}return!e.readOnly}))),Object.assign(Object.assign({},this._config),{fields:s})}setConfig(t){this.isLoaded=!0;const{cardsState:e,summary:i,defaultVars:s}=this._config||{};this._config=Object.assign({},t),e&&(this._config.cardsState=e),i&&(this._config.summary=i),s&&(this._config.defaultVars=s),this._onConfigChange&&this._onConfigChange(Object.assign({},this._config))}getConfig(t,e){return this.getFormConfig(t,null==e||e)}getFormConfigFetcher(){return null==this._formConfigFetcher&&(this._formConfigFetcher=new s),this._formConfigFetcher}async fetchUserAvailableConfigs(){return null!=this._configName?Promise.resolve(void 0):this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,this._resourceID)}async fetchLegacyConfig(){return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,this._resourceID)}async fetchDefaultConfig(){return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,this._resourceID)}parseObjectList(t){return t?Array.isArray(t)?t:[t]:[]}buildFormMetadataUITabs(t,e=!1){var i;const s=this.hasConfig(t);if(!e&&(!this._dataUnit||s))return t;(t=this.getFormConfig(this._dataUnit,!1,!0)).tabs=this.parseObjectList(t.tabs),t.emptyConfig=!1,t.defaultConfiguration=!0;const n=this._dataUnit.metadata.fields;for(const e of n){const s=t.fields.find((t=>t.name===e.name)),n=null===(i=e.properties)||void 0===i?void 0:i.UITabName;n&&n!==r.main&&(t.tabs.some((t=>t.label===n))||t.tabs.push({label:n,name:n,order:0,visible:!0}),s&&(s.tab=n))}return t}}export{n as S}
@@ -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-06898e5a",[[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-11a0a7ac",[[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-656f0e51",[[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-583517ba",[[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-1b6d51bf",[[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-d3341910",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32]}]]],["p-5ea74956",[[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-dbe6174a",[[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-281bc322",[[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-47f79aa0",[[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-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-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-d1791da2",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["p-dbe6174a",[[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-212213d9",[[0,"snk-filter-modal-item",{"filterItem":[1040],"configName":[1025,"config-name"],"resourceID":[1,"resource-i-d"]}]]],["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-c2e468c9",[[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]],["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-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-41793e17",[[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-583517ba",[[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-54a5d52a",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"showHardFixed":[4,"show-hard-fixed"],"show":[64]}]]],["p-8b4fc28f",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["p-16a1dd18",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["p-72c10005",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32]}]]],["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-0e320bd2",[[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-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-052213ba",[[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"]]],[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"]]],[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"]]],[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-656f0e51",[[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-2d3f9482",[[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-fa6c5826",[[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]}],[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]}],[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["p-0b6cd238",[[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-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-275de842",[[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-cefb0ee1",[[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"]]]]],["p-ab1645fb",[[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-5e51e833",[[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]}]]]]'),e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/sankhyablocks",
3
- "version": "8.16.0-dev.39",
3
+ "version": "8.16.0-dev.40",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -60,7 +60,8 @@
60
60
  "jest-cli": "^27.4.5",
61
61
  "jest-sonar-reporter": "^2.0.0",
62
62
  "puppeteer": "^10.0.0",
63
- "redux": "^4.1.2"
63
+ "redux": "^4.1.2",
64
+ "workbox-build": "^4.3.1"
64
65
  },
65
66
  "jest": {
66
67
  "verbose": true,
@@ -1,239 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-f9e81701.js');
6
- const core = require('@sankhyalabs/core');
7
- const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
8
- const utils = require('@sankhyalabs/ezui/dist/collection/utils');
9
- const constants = require('./constants-35ddd366.js');
10
-
11
- const snkConfigOptionsCss = ".sc-snk-config-options-h{--snk-config-options--border:2px solid var(--color--secondary-200, #D2D3DA);width:100%;border-radius:15px;border:var(--snk-config-options--border)}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";
12
-
13
- const SnkConfigOptions = class {
14
- constructor(hostRef) {
15
- index.registerInstance(this, hostRef);
16
- this.configOptionsChanged = index.createEvent(this, "configOptionsChanged", 7);
17
- this._defaultType = undefined;
18
- this.fieldConfig = {};
19
- this.idConfig = undefined;
20
- this.dataUnit = undefined;
21
- this.messagesBuilder = undefined;
22
- }
23
- onConfigDefault(optionSelected) {
24
- if (optionSelected != undefined) {
25
- this._defaultType = optionSelected;
26
- this.fieldConfig.defaultValue = {
27
- type: this._defaultType
28
- };
29
- this.configOptionsChanged.emit(this.fieldConfig);
30
- }
31
- }
32
- buildOptions() {
33
- var _a, _b, _c;
34
- let interfaceField = (_c = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name)) === null || _c === void 0 ? void 0 : _c.userInterface;
35
- if (interfaceField === core.UserInterface.SEARCH) {
36
- interfaceField = core.UserInterface.INTEGERNUMBER;
37
- }
38
- return constants.VARS_BY_TYPE.UserInterface[interfaceField];
39
- }
40
- enabledValueDefault() {
41
- var _a, _b, _c;
42
- const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
43
- const allowDefault = (_c = field === null || field === void 0 ? void 0 : field.properties) === null || _c === void 0 ? void 0 : _c.allowDefault;
44
- const hasVariableVar = constants.VARS_BY_TYPE.UserInterface.hasOwnProperty(field === null || field === void 0 ? void 0 : field.userInterface)
45
- || (field === null || field === void 0 ? void 0 : field.userInterface) === core.UserInterface.SEARCH;
46
- if ((allowDefault == undefined || allowDefault === "true") && hasVariableVar) {
47
- return true;
48
- }
49
- return false;
50
- }
51
- isAllowDefault() {
52
- var _a, _b;
53
- const allowDefault = (_b = (_a = this._fieldProperties) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.allowDefault;
54
- if (allowDefault == undefined) {
55
- return true;
56
- }
57
- return allowDefault === "true";
58
- }
59
- loadDefaultValue() {
60
- var _a;
61
- if (this.fieldConfig == undefined) {
62
- this._defaultType = constants.DEFAULT_TYPE.fixed;
63
- this.fieldConfig = {
64
- defaultValue: {
65
- type: this._defaultType
66
- }
67
- };
68
- }
69
- else if (((_a = this.fieldConfig.defaultValue) === null || _a === void 0 ? void 0 : _a.type) == undefined) {
70
- this._defaultType = constants.DEFAULT_TYPE.fixed;
71
- this.fieldConfig.defaultValue = {
72
- type: this._defaultType
73
- };
74
- }
75
- else {
76
- this._defaultType = this.fieldConfig.defaultValue.type;
77
- }
78
- }
79
- getFieldProperties(field) {
80
- var _a;
81
- if (field != undefined) {
82
- return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field);
83
- }
84
- }
85
- getMessage(key, params) {
86
- return this.messagesBuilder.getMessage(key, params);
87
- }
88
- getDefaultType() {
89
- var _a;
90
- return (_a = this.fieldConfig.defaultValue.type) !== null && _a !== void 0 ? _a : constants.DEFAULT_TYPE.fixed;
91
- }
92
- getEnabledByProperty(attribName, propertyName) {
93
- const fieldDescriptor = this._fieldProperties;
94
- if (fieldDescriptor == undefined) {
95
- return true;
96
- }
97
- const fieldProperties = fieldDescriptor.properties || {};
98
- return fieldProperties.hasOwnProperty(propertyName) ? fieldProperties[propertyName] !== "S" : fieldDescriptor[attribName] !== true;
99
- }
100
- getValueByProperty(property) {
101
- const properties = this._fieldProperties;
102
- if (properties != undefined && properties[property] === true) {
103
- return true;
104
- }
105
- return this.fieldConfig[property];
106
- }
107
- getValidatedValue(fieldValue) {
108
- var _a, _b;
109
- if (fieldValue == undefined) {
110
- return;
111
- }
112
- const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
113
- const dataType = field === null || field === void 0 ? void 0 : field.dataType;
114
- if (dataType == undefined) {
115
- return;
116
- }
117
- const value = (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.waitmessage) != undefined ? undefined :
118
- dataType !== DataType.DataType.OBJECT && dataType !== DataType.DataType.DATE
119
- && typeof fieldValue === "object"
120
- ? fieldValue.value
121
- : fieldValue;
122
- return dataType === DataType.DataType.OBJECT ? JSON.stringify(value) : value;
123
- }
124
- buildInputDefault({ value, enabled, label, name, required, userInterface }, properties = undefined, mode = undefined) {
125
- let options;
126
- let precision = 0;
127
- let prettyPrecision = 0;
128
- const TagName = userInterface == undefined || constants.TAGS_BY_TYPE[userInterface] == undefined
129
- ? constants.TAGS_BY_TYPE.DEFAULT
130
- : constants.TAGS_BY_TYPE[userInterface];
131
- if (userInterface === core.UserInterface.OPTIONSELECTOR) {
132
- const prop = properties === null || properties === void 0 ? void 0 : properties.options;
133
- if (typeof prop === "string") {
134
- const parsed = core.ObjectUtils.stringToObject(prop);
135
- options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
136
- }
137
- else {
138
- options = prop;
139
- }
140
- }
141
- else if (userInterface === core.UserInterface.DECIMALNUMBER) {
142
- precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
143
- prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
144
- }
145
- return index.h(TagName, Object.assign({ value: value, enabled: enabled, label: label, "data-field-name": name, key: name, onEzChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail) }, (this.getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode))));
146
- }
147
- getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode) {
148
- switch (userInterface) {
149
- case core.UserInterface.SEARCH:
150
- return {
151
- suppressEmptyOption: required,
152
- optionLoader: (searchArgument) => this.onSearch(searchArgument)
153
- };
154
- case core.UserInterface.OPTIONSELECTOR:
155
- return {
156
- suppressEmptyOption: required,
157
- options
158
- };
159
- case core.UserInterface.CHECKBOX:
160
- case core.UserInterface.SWITCH:
161
- return {
162
- mode
163
- };
164
- case core.UserInterface.INTEGERNUMBER:
165
- case core.UserInterface.DECIMALNUMBER:
166
- return {
167
- precision,
168
- prettyPrecision,
169
- onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
170
- };
171
- case core.UserInterface.DATE:
172
- case core.UserInterface.DATETIME:
173
- case core.UserInterface.TIME:
174
- return {
175
- onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
176
- };
177
- default:
178
- return {};
179
- }
180
- }
181
- onChange(fieldValue) {
182
- this.fieldConfig.defaultValue.value = this.getValidatedValue(fieldValue);
183
- this.configOptionsChanged.emit(this.fieldConfig);
184
- }
185
- onSearch(searchArgument) {
186
- if (this._application != undefined && this.fieldConfig != undefined) {
187
- return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit);
188
- }
189
- }
190
- buildField(descriptor, config) {
191
- const { name, label, readOnly, required, defaultValue } = config;
192
- const { userInterface, properties } = descriptor;
193
- const allowDefault = properties === null || properties === void 0 ? void 0 : properties.allowDefault;
194
- let value;
195
- let enabled = core.StringUtils.getBooleanValue(allowDefault, !readOnly);
196
- if (userInterface === core.UserInterface.FILE) {
197
- enabled = false;
198
- }
199
- if (enabled) {
200
- value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value;
201
- if (value != undefined) {
202
- value = DataType.getConvertedValue(descriptor === null || descriptor === void 0 ? void 0 : descriptor.dataType, value);
203
- }
204
- }
205
- const configField = { value, enabled, label, name, required, userInterface };
206
- switch (userInterface) {
207
- case core.UserInterface.SWITCH:
208
- return this.buildInputDefault(configField, undefined, utils.CheckMode.SWITCH);
209
- case core.UserInterface.CHECKBOX:
210
- return this.buildInputDefault(configField, undefined, utils.CheckMode.REGULAR);
211
- case core.UserInterface.OPTIONSELECTOR:
212
- case core.UserInterface.DECIMALNUMBER:
213
- return this.buildInputDefault(configField, properties);
214
- default:
215
- return this.buildInputDefault(configField);
216
- }
217
- }
218
- componentWillLoad() {
219
- var _a;
220
- this.loadDefaultValue();
221
- this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
222
- this._fieldProperties = this.getFieldProperties((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.name);
223
- }
224
- componentDidLoad() {
225
- core.ElementIDUtils.addIDInfo(this._element, this.fieldConfig.name);
226
- }
227
- render() {
228
- var _a, _b;
229
- return (index.h(index.Host, null, index.h("div", { id: this.idConfig }, index.h("div", { class: "ez-row ez-padding--medium" }, index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-text-input", { label: this.getMessage("snkConfigOptions.label.nameField"), value: (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.label, onEzChange: (evt) => { this.fieldConfig.label = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.typeValueDefault"), suppressEmptyOption: true, enabled: this.enabledValueDefault(), onEzChange: (evt) => { var _a; return this.onConfigDefault((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); }, value: this.getDefaultType() }, index.h("option", { value: constants.DEFAULT_TYPE.fixed }, this.getMessage("snkConfigOptions.options.valueFixed")), index.h("option", { value: constants.DEFAULT_TYPE.variable }, this.getMessage("snkConfigOptions.options.variable")))), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, this._defaultType === constants.DEFAULT_TYPE.variable ?
230
- index.h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.valueDefault"), enabled: this.isAllowDefault(), onEzChange: (evt) => { var _a; this.fieldConfig.defaultValue.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value; this.configOptionsChanged.emit(this.fieldConfig); }, value: this.fieldConfig.defaultValue.value, options: this.buildOptions() })
231
- :
232
- ((_b = this._fieldProperties) === null || _b === void 0 ? void 0 : _b.userInterface) &&
233
- this.buildField(this._fieldProperties, this.fieldConfig))), index.h("div", { class: "ez-row ez-padding--medium config-options__switch-row" }, index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-check", { mode: utils.CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.clearDuplicate"), value: this.fieldConfig.cleanOnCopy, onEzChange: (evt) => { this.fieldConfig.cleanOnCopy = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-check", { mode: utils.CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.requiredField"), enabled: this.getEnabledByProperty("required", "systemRequired"), value: this.getValueByProperty("required"), onEzChange: (evt) => { this.fieldConfig.required = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-check", { mode: utils.CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.protectedField"), enabled: this.getEnabledByProperty("readOnly", "systemReadOnly"), value: this.getValueByProperty("readOnly"), onEzChange: (evt) => { this.fieldConfig.readOnly = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } }))))));
234
- }
235
- get _element() { return index.getElement(this); }
236
- };
237
- SnkConfigOptions.style = snkConfigOptionsCss;
238
-
239
- exports.snk_config_options = SnkConfigOptions;