@sankhyalabs/sankhyablocks 2.5.2 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/cjs/{SnkMessageBuilder-370e23ae.js → SnkMessageBuilder-09b25b0a.js} +20 -1
  2. package/dist/cjs/data-exporter-option-417da37a.js +19 -0
  3. package/dist/cjs/{index-20e8b68a.js → index-2cd6f753.js} +26 -0
  4. package/dist/cjs/index-696b5c3b.js +200 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/sankhyablocks.cjs.js +2 -2
  7. package/dist/cjs/snk-application.cjs.entry.js +11 -3
  8. package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
  9. package/dist/cjs/snk-configurator_3.cjs.entry.js +71 -13
  10. package/dist/cjs/snk-crud.cjs.entry.js +3 -2
  11. package/dist/cjs/{snk-exporter-email-sender_8.cjs.entry.js → snk-data-exporter_9.cjs.entry.js} +305 -8
  12. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  13. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  14. package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
  15. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  16. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  17. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-filter-personalized.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
  22. package/dist/cjs/snk-form.cjs.entry.js +1 -1
  23. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  24. package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
  25. package/dist/cjs/{taskbar-elements-3807c809.js → taskbar-elements-bbb89cdb.js} +8 -5
  26. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  27. package/dist/collection/collection-manifest.json +1 -0
  28. package/dist/collection/components/snk-data-exporter/enum/data-exporter-option.js +11 -0
  29. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +4 -4
  30. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -0
  31. package/dist/collection/components/snk-data-exporter/snk-data-exporter.css +19 -0
  32. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +181 -0
  33. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +140 -0
  34. package/dist/collection/components/snk-grid/snk-grid.js +69 -10
  35. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +7 -4
  36. package/dist/collection/components/snk-taskbar/snk-taskbar.js +2 -2
  37. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +9 -1
  38. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +33 -0
  39. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.js +1 -0
  40. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.js +1 -0
  41. package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.js +1 -0
  42. package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
  43. package/dist/collection/lib/message/resources/snk-data-exporter.msg.js +16 -0
  44. package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -0
  45. package/dist/collection/lib/store/index.js +5 -0
  46. package/dist/collection/lib/utils/fileViewer/index.js +3 -0
  47. package/dist/collection/lib/utils/fileViewer/interfaces/IFileViewerParams.js +1 -0
  48. package/dist/components/ConfigStorage.js +3 -6694
  49. package/dist/components/DataFetcher.js +6695 -0
  50. package/dist/components/SnkMessageBuilder.js +20 -1
  51. package/dist/components/index.d.ts +1 -0
  52. package/dist/components/index.js +1 -0
  53. package/dist/components/snk-application2.js +11 -2
  54. package/dist/components/snk-crud.js +10 -4
  55. package/dist/components/snk-data-exporter.d.ts +11 -0
  56. package/dist/components/snk-data-exporter.js +6 -0
  57. package/dist/components/snk-data-exporter2.js +330 -0
  58. package/dist/components/snk-form-config2.js +1 -1
  59. package/dist/components/snk-form2.js +8 -2
  60. package/dist/components/snk-grid2.js +74 -10
  61. package/dist/components/snk-taskbar2.js +212 -9
  62. package/dist/esm/{SnkMessageBuilder-7d583c9a.js → SnkMessageBuilder-47db5d75.js} +20 -1
  63. package/dist/esm/data-exporter-option-006307dd.js +19 -0
  64. package/dist/esm/{index-e4121713.js → index-a77b6f35.js} +25 -1
  65. package/dist/esm/index-d89e384f.js +198 -0
  66. package/dist/esm/loader.js +2 -2
  67. package/dist/esm/sankhyablocks.js +2 -2
  68. package/dist/esm/snk-application.entry.js +11 -3
  69. package/dist/esm/snk-config-options.entry.js +1 -1
  70. package/dist/esm/snk-configurator_3.entry.js +68 -10
  71. package/dist/esm/snk-crud.entry.js +3 -2
  72. package/dist/esm/{snk-exporter-email-sender_8.entry.js → snk-data-exporter_9.entry.js} +304 -8
  73. package/dist/esm/snk-data-unit.entry.js +2 -2
  74. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  75. package/dist/esm/snk-filter-detail.entry.js +1 -1
  76. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  77. package/dist/esm/snk-filter-number.entry.js +1 -1
  78. package/dist/esm/snk-filter-period.entry.js +1 -1
  79. package/dist/esm/snk-filter-personalized.entry.js +1 -1
  80. package/dist/esm/snk-filter-search.entry.js +1 -1
  81. package/dist/esm/snk-filter-text.entry.js +1 -1
  82. package/dist/esm/snk-form-config.entry.js +1 -1
  83. package/dist/esm/snk-form.entry.js +1 -1
  84. package/dist/esm/snk-pesquisa.entry.js +1 -1
  85. package/dist/esm/snk-tab-config.entry.js +1 -1
  86. package/dist/esm/{taskbar-elements-b2bbe275.js → taskbar-elements-beec3b27.js} +8 -5
  87. package/dist/esm/teste-pesquisa.entry.js +1 -1
  88. package/dist/sankhyablocks/p-04581d0c.entry.js +1 -0
  89. package/dist/sankhyablocks/p-112bb324.js +1 -0
  90. package/dist/sankhyablocks/{p-c17be74f.entry.js → p-12ebe36a.entry.js} +1 -1
  91. package/dist/sankhyablocks/p-13116d05.entry.js +1 -0
  92. package/dist/sankhyablocks/{p-14af45cc.entry.js → p-187b0d06.entry.js} +1 -1
  93. package/dist/sankhyablocks/{p-570cc474.entry.js → p-1a2533d0.entry.js} +1 -1
  94. package/dist/sankhyablocks/{p-fd3b562d.entry.js → p-1ccaea51.entry.js} +1 -1
  95. package/dist/sankhyablocks/p-1d7a0daf.js +1 -0
  96. package/dist/sankhyablocks/p-50c8bcb7.entry.js +1 -0
  97. package/dist/sankhyablocks/{p-44ce5b90.entry.js → p-57895452.entry.js} +1 -1
  98. package/dist/sankhyablocks/{p-48bbbd2c.entry.js → p-68fcc226.entry.js} +1 -1
  99. package/dist/sankhyablocks/p-719e570a.js +1 -0
  100. package/dist/sankhyablocks/{p-00b3c5d8.entry.js → p-772f1c44.entry.js} +1 -1
  101. package/dist/sankhyablocks/{p-c30d0966.entry.js → p-82e20fc0.entry.js} +1 -1
  102. package/dist/sankhyablocks/{p-eff899b0.entry.js → p-91c23d20.entry.js} +1 -1
  103. package/dist/sankhyablocks/p-a77dd79a.js +2 -0
  104. package/dist/sankhyablocks/{p-f50c6ef6.entry.js → p-ab4ff312.entry.js} +1 -1
  105. package/dist/sankhyablocks/p-c8327a5c.js +1 -0
  106. package/dist/sankhyablocks/{p-2664ae24.entry.js → p-d3e402d3.entry.js} +1 -1
  107. package/dist/sankhyablocks/{p-9593c937.entry.js → p-d7ae56ce.entry.js} +1 -1
  108. package/dist/sankhyablocks/{p-70e52fee.entry.js → p-d96bf6a7.entry.js} +1 -1
  109. package/dist/sankhyablocks/{p-b0a0222f.entry.js → p-df5d94c6.entry.js} +1 -1
  110. package/dist/sankhyablocks/{p-db111acd.entry.js → p-e075dba7.entry.js} +1 -1
  111. package/dist/sankhyablocks/{p-a3871147.entry.js → p-f8fdd16c.entry.js} +11 -4
  112. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  113. package/dist/types/components/snk-data-exporter/data/attachment.d.ts +1 -1
  114. package/dist/types/components/snk-data-exporter/data/email.d.ts +3 -3
  115. package/dist/types/components/snk-data-exporter/data/export-config.d.ts +5 -5
  116. package/dist/types/components/snk-data-exporter/data/export-result.d.ts +5 -5
  117. package/dist/types/components/snk-data-exporter/data/report.d.ts +1 -1
  118. package/dist/types/components/snk-data-exporter/enum/data-exporter-option.d.ts +10 -0
  119. package/dist/types/components/snk-data-exporter/exporter-email-sender/email-info-step.d.ts +4 -4
  120. package/dist/types/components/snk-data-exporter/exporter-email-sender/options-step.d.ts +4 -4
  121. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +9 -0
  122. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +40 -0
  123. package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +61 -0
  124. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -2
  125. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -1
  126. package/dist/types/components.d.ts +33 -3
  127. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/index.d.ts +3 -0
  128. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata.d.ts +9 -0
  129. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +14 -0
  130. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterResponse.d.ts +7 -0
  131. package/dist/types/lib/message/resources/snk-data-exporter.msg.d.ts +1 -0
  132. package/dist/types/lib/store/index.d.ts +4 -0
  133. package/dist/types/lib/utils/fileViewer/index.d.ts +2 -0
  134. package/dist/types/lib/utils/fileViewer/interfaces/IFileViewerParams.d.ts +4 -0
  135. package/package.json +2 -1
  136. package/react/components.d.ts +1 -0
  137. package/react/components.js +1 -0
  138. package/react/components.js.map +1 -1
  139. package/dist/cjs/AuthorizationConfig-79ffae4b.js +0 -7
  140. package/dist/esm/AuthorizationConfig-dcbd207a.js +0 -7
  141. package/dist/sankhyablocks/p-8a872a35.entry.js +0 -1
  142. package/dist/sankhyablocks/p-9ba3df4c.js +0 -2
  143. package/dist/sankhyablocks/p-9e67cf79.entry.js +0 -1
  144. package/dist/sankhyablocks/p-c118ef2a.entry.js +0 -1
  145. package/dist/sankhyablocks/p-dbaad88c.js +0 -1
  146. package/dist/sankhyablocks/p-dc36cfbf.js +0 -1
  147. package/dist/sankhyablocks/p-e7f772ed.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as e,h as i,H as s,g as r}from"./p-9ba3df4c.js";import{ApplicationUtils as l}from"@sankhyalabs/ezui/dist/collection/utils";import{F as n}from"./p-9dd2b8cb.js";import{ElementIDUtils as a,DataType as o}from"@sankhyalabs/core";const h=class{constructor(i){t(this,i),this.filterChange=e(this,"filterChange",7)}async show(){this._editor.show()}componentDidLoad(){if(this._element){a.addIDInfo(this._element);const t=this._element.getAttribute(a.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.config.id}`}}changeConfig(t){this.filterChange.emit(t)}getContentEditor(){switch(this.config.type){case n.BINARY_SELECT:return"snk-filter-binary-select";case n.MULTI_SELECT:return"snk-filter-multi-select";case n.PERIOD:return"snk-filter-period";case n.SEARCH:return"snk-filter-search";case n.NUMBER:return"snk-filter-number";case n.PERSONALIZED:return"snk-filter-personalized"}return"snk-filter-text"}removeItem(){this.changeConfig(Object.assign(Object.assign({},this.config),{visible:!1,fixed:!1,value:void 0}))}getPopUpHeaderButtons(){if(!this.config.hardFixed)return[this.buildIcon(this.getMessage("snkFilterBar.removeFilter"),"delete",(()=>this.removeItem())),this.buildIcon(this.getMessage(this.config.fixed?"snkFilterBar.unpinFilter":"snkFilterBar.pinFilter"),this.config.fixed?"un-pin":"push-pin",(()=>this.changeConfig(Object.assign(Object.assign({},this.config),{fixed:!this.config.fixed}))))]}buildIcon(t,e,s){return i("button",{onClick:()=>s(),class:"sc-snk-filter-bar snk-filter-item__editor-header-button",ref:e=>e&&this.buildIdButton(e,t)},i("ez-icon",Object.assign({title:t,iconName:e},{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${a.getInternalIDInfo(`_${t}`)}`})))}buildIdButton(t,e){if(!t)return;const i={id:e};t.removeAttribute(a.DATA_ELEMENT_ID_ATTRIBUTE_NAME),a.addIDInfoIfNotExists(t,"button",i)}getNormalizedValue(t,e){return t.reduce(((t,e,i)=>(e.dataType!==o.BOOLEAN||null!=t&&null!=t[i]||((t=t||[])[i]=!1),t)),e)}apply(){var t;let e=this._editor.value,i=!0;if(this.config.type===n.PERSONALIZED){const s=(null===(t=this.config.props.personalizedFilter)||void 0===t?void 0:t.parameters)||[];e=this.getNormalizedValue(s,e);const r=s.length;0===r?e=[]:i=this.validateAllFilled(r,e)}i&&this.changeConfig(Object.assign(Object.assign({},this.config),{value:e}))}validateAllFilled(t,e){let i=!0;return null!=e&&t>1&&(t>e.length?i=!1:e.forEach((t=>{null==t&&(i=!1)}))),i||l.alert("Filtro parcialmente preenchido","Favor completar todas as informações do filtro."),i}clear(){this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}onKeyDonwListener(t){"Enter"===t.key&&this._applyButton.setFocus().then((()=>this.apply()))}render(){const t=this.getContentEditor();return i(s,null,i("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},i("div",{class:"ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header"},this.config.detailTitle),this.getPopUpHeaderButtons()),i(t,{ref:t=>this._editor=t,value:this.config.value,config:this.config,onKeyDown:t=>this.onKeyDonwListener(t),"data-element-id":this._idContentEditor}),i("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),i("div",{class:"ez-col ez-col--sd-12 ez-align--right"},i("ez-button",{label:this.getMessage("snkFilterBar.cleanFilter"),onClick:()=>this.clear(),size:"small"}),i("ez-button",{ref:t=>this._applyButton=t,label:this.getMessage("snkFilterBar.applyFilter"),onClick:()=>this.apply(),size:"small",class:"ez-button--primary ez-padding-left--medium"})))}get _element(){return r(this)}};export{h as snk_filter_detail}
1
+ import{r as t,c as e,h as i,H as s,g as r}from"./p-a77dd79a.js";import{ApplicationUtils as l}from"@sankhyalabs/ezui/dist/collection/utils";import{F as n}from"./p-9dd2b8cb.js";import{ElementIDUtils as a,DataType as o}from"@sankhyalabs/core";const h=class{constructor(i){t(this,i),this.filterChange=e(this,"filterChange",7)}async show(){this._editor.show()}componentDidLoad(){if(this._element){a.addIDInfo(this._element);const t=this._element.getAttribute(a.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.config.id}`}}changeConfig(t){this.filterChange.emit(t)}getContentEditor(){switch(this.config.type){case n.BINARY_SELECT:return"snk-filter-binary-select";case n.MULTI_SELECT:return"snk-filter-multi-select";case n.PERIOD:return"snk-filter-period";case n.SEARCH:return"snk-filter-search";case n.NUMBER:return"snk-filter-number";case n.PERSONALIZED:return"snk-filter-personalized"}return"snk-filter-text"}removeItem(){this.changeConfig(Object.assign(Object.assign({},this.config),{visible:!1,fixed:!1,value:void 0}))}getPopUpHeaderButtons(){if(!this.config.hardFixed)return[this.buildIcon(this.getMessage("snkFilterBar.removeFilter"),"delete",(()=>this.removeItem())),this.buildIcon(this.getMessage(this.config.fixed?"snkFilterBar.unpinFilter":"snkFilterBar.pinFilter"),this.config.fixed?"un-pin":"push-pin",(()=>this.changeConfig(Object.assign(Object.assign({},this.config),{fixed:!this.config.fixed}))))]}buildIcon(t,e,s){return i("button",{onClick:()=>s(),class:"sc-snk-filter-bar snk-filter-item__editor-header-button",ref:e=>e&&this.buildIdButton(e,t)},i("ez-icon",Object.assign({title:t,iconName:e},{[a.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${a.getInternalIDInfo(`_${t}`)}`})))}buildIdButton(t,e){if(!t)return;const i={id:e};t.removeAttribute(a.DATA_ELEMENT_ID_ATTRIBUTE_NAME),a.addIDInfoIfNotExists(t,"button",i)}getNormalizedValue(t,e){return t.reduce(((t,e,i)=>(e.dataType!==o.BOOLEAN||null!=t&&null!=t[i]||((t=t||[])[i]=!1),t)),e)}apply(){var t;let e=this._editor.value,i=!0;if(this.config.type===n.PERSONALIZED){const s=(null===(t=this.config.props.personalizedFilter)||void 0===t?void 0:t.parameters)||[];e=this.getNormalizedValue(s,e);const r=s.length;0===r?e=[]:i=this.validateAllFilled(r,e)}i&&this.changeConfig(Object.assign(Object.assign({},this.config),{value:e}))}validateAllFilled(t,e){let i=!0;return null!=e&&t>1&&(t>e.length?i=!1:e.forEach((t=>{null==t&&(i=!1)}))),i||l.alert("Filtro parcialmente preenchido","Favor completar todas as informações do filtro."),i}clear(){this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}onKeyDonwListener(t){"Enter"===t.key&&this._applyButton.setFocus().then((()=>this.apply()))}render(){const t=this.getContentEditor();return i(s,null,i("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},i("div",{class:"ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header"},this.config.detailTitle),this.getPopUpHeaderButtons()),i(t,{ref:t=>this._editor=t,value:this.config.value,config:this.config,onKeyDown:t=>this.onKeyDonwListener(t),"data-element-id":this._idContentEditor}),i("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),i("div",{class:"ez-col ez-col--sd-12 ez-align--right"},i("ez-button",{label:this.getMessage("snkFilterBar.cleanFilter"),onClick:()=>this.clear(),size:"small"}),i("ez-button",{ref:t=>this._applyButton=t,label:this.getMessage("snkFilterBar.applyFilter"),onClick:()=>this.apply(),size:"small",class:"ez-button--primary ez-padding-left--medium"})))}get _element(){return r(this)}};export{h as snk_filter_detail}
@@ -1 +1 @@
1
- import{r as t,h as s,H as e,g as i}from"./p-9ba3df4c.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{F as r}from"./p-9dd2b8cb.js";const n=class{constructor(s){t(this,s)}isSelected(t){return null==this.value||this.value===t}ezChangeListener(t){t.detail||this.assertCheckedOption(t.target),this.updateValue()}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}assertCheckedOption(t){t===this._checkOne?this._checkTwo.value=!0:this._checkOne.value=!0}updateValue(){if(this._checkOne.value&&this._checkTwo.value)this.value=void 0;else{const[t,s]=this.config.props.options;this.value=this._checkOne.value?t.name:s.name}}async show(){this._checkOne.setFocus()}render(){if(!this.config||this.config.type!==r.BINARY_SELECT)return;const[t,i]=this.config.props.options;return s(e,null,s("ez-check",{id:`${this.config.id}_${t.name||"option1"}`,label:t.label,class:"sc-snk-filter-bar editor__ez-check",ref:t=>this._checkOne=t,value:this.isSelected(t.name)}),s("ez-check",{id:`${this.config.id}_${i.name||"option2"}`,label:i.label,class:"sc-snk-filter-bar editor__ez-check",ref:t=>this._checkTwo=t,value:this.isSelected(i.name)}))}get _element(){return i(this)}};export{n as snk_filter_binary_select}
1
+ import{r as t,h as s,H as e,g as i}from"./p-a77dd79a.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{F as r}from"./p-9dd2b8cb.js";const n=class{constructor(s){t(this,s)}isSelected(t){return null==this.value||this.value===t}ezChangeListener(t){t.detail||this.assertCheckedOption(t.target),this.updateValue()}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}assertCheckedOption(t){t===this._checkOne?this._checkTwo.value=!0:this._checkOne.value=!0}updateValue(){if(this._checkOne.value&&this._checkTwo.value)this.value=void 0;else{const[t,s]=this.config.props.options;this.value=this._checkOne.value?t.name:s.name}}async show(){this._checkOne.setFocus()}render(){if(!this.config||this.config.type!==r.BINARY_SELECT)return;const[t,i]=this.config.props.options;return s(e,null,s("ez-check",{id:`${this.config.id}_${t.name||"option1"}`,label:t.label,class:"sc-snk-filter-bar editor__ez-check",ref:t=>this._checkOne=t,value:this.isSelected(t.name)}),s("ez-check",{id:`${this.config.id}_${i.name||"option2"}`,label:i.label,class:"sc-snk-filter-bar editor__ez-check",ref:t=>this._checkTwo=t,value:this.isSelected(i.name)}))}get _element(){return i(this)}};export{n as snk_filter_binary_select}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,g as e,H as a}from"./p-9ba3df4c.js";import{Action as n,ApplicationContext as h}from"@sankhyalabs/core";import{ApplicationUtils as o,DialogType as r}from"@sankhyalabs/ezui/dist/collection/utils";import{O as c}from"./p-e7f772ed.js";const l=class{constructor(i){t(this,i),this.dataStateChange=s(this,"dataStateChange",7),this.dataUnitReady=s(this,"dataUnitReady",7),this.insertionMode=s(this,"insertionMode",7),this.cancelEdition=s(this,"cancelEdition",7),this._onDataUnitResolve=[],this.pageSize=150,this._dataUnitObserver=t=>{const s={insertionMode:!1,hasNext:this.dataUnit.hasNext(),hasPrevious:this.dataUnit.hasPrevious(),copyMode:!1,isDirty:this.dataUnit.isDirty(),hasDirtyRecords:this.dataUnit.hasDirtyRecords(),selectedRecords:this.dataUnit.getSelectedRecords()};if(this.dataUnit.records.forEach((t=>{t.__record__id__.startsWith("NEW_")&&(s.insertionMode=!0,s.copyMode||(s.copyMode=null!=t.__record__source__id__))})),this.dataState=s,t.type===n.DATA_SAVED){const s=this.getMessage("snkDataUnit.saveInfo",t.payload.records[0]);null!=s&&this.showSuccessMessage(s)}if(t.type!==n.RECORDS_ADDED&&t.type!==n.RECORDS_COPIED||this.insertionMode.emit(),t.type===n.EDITION_CANCELED){this.cancelEdition.emit();const t=this.getMessage("snkDataUnit.cancelInfo");null!=t&&this.showSuccessMessage(t)}if(t.type===n.RECORDS_REMOVED){const s=this.getMessage("snkDataUnit.removeInfo",t.payload.cachedRecords[0]);null!=s&&this.showSuccessMessage(s)}this._application.messagesBuilder.currentOperation=this.getMessageOperation()}}observePageSize(){this.dataUnit&&(this.dataUnit.pageSize=this.pageSize)}observeDataUnitName(t,s){s!=t&&(this.dataUnit=void 0,this.dataUnitName=t,this.loadDataUnit())}observeEntityName(t,s){s!=t&&(this.dataUnit=void 0,this.entityName=t,this.loadDataUnit())}observeDataState(t,s){s!=t&&this.dataStateChange.emit(t)}observeDataUnit(){this.dataUnitReady.emit(this.dataUnit)}async getDataUnit(){return new Promise((t=>{this.dataUnit?t(this.dataUnit):this._onDataUnitResolve.push(t)}))}async interceptAction(t){return new Promise((s=>{switch(t.type){case n.RECORDS_ADDED:this.isAllowed("INSERT")?s(t):o.info(this.getMessage("snkDataUnit.forbiddenInsert"));break;case n.RECORDS_COPIED:this.isAllowed("CLONE")?s(t):o.info(this.getMessage("snkDataUnit.forbiddenClone"));break;case n.DATA_CHANGED:case n.CHANGING_DATA:this.isAllowed("UPDATE")?s(t):(this.dataUnit.cancelEdition(),o.alert(this.getMessage("snkDataUnit.forbidden"),this.getMessage("snkDataUnit.forbiddenUpdate")));break;case n.SAVING_DATA:if(this.beforeSave){const i=this.beforeSave(this.dataUnit);i instanceof Promise?i.then((i=>s(i?t:void 0))):s(i?t:void 0)}else s(t);break;case n.DATA_SAVED:this.afterSave?this.afterSave(this.dataUnit):s(t);break;case n.EDITION_CANCELED:if(this.dataState.hasDirtyRecords){const i=this.getMessage("snkDataUnit.cancelConfirmation");if(null==i)s(t);else{const e=this.getMessage("snkDataUnit.cancelConfirmationTitle");o.confirm(e,i).then((i=>s(i?t:void 0)))}}else s(t);break;case n.REMOVING_RECORDS:if(this.isAllowed("REMOVE")){const i=this.getMessage("snkDataUnit.removeConfirmation");if(null==i)s(t);else{const e={canClose:!1,labelCancel:this.getMessage("snkDataUnit.confirm.cancel"),labelConfirm:this.getMessage("snkDataUnit.confirm.delete"),btnConfirmDanger:!1},a=this.getMessage("snkDataUnit.removeConfirmationTitle");o.confirm(a,i,null,r.WARN,e).then((i=>s(i?t:void 0)))}}else o.info(this.getMessage("snkDataUnit.forbiddenRemove"));break;default:s(t)}}))}showSuccessMessage(t){o.info(t,{iconName:"check"})}isAllowed(t){return!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getMessage(t,s){return s||(s=this.getMessageParams()),this._application.messagesBuilder.getMessage(t,s)}getMessageParams(){return this.dataState.selectedRecords?this.dataState.selectedRecords[0]:void 0}getMessageOperation(){return this.dataState.copyMode?c.CLONE:this.dataState.insertionMode?c.INSERT:this.dataState.isDirty?c.UPDATE:c.CLEAN}async loadDataUnit(){if(!this.dataUnit&&this._application&&this.entityName){const t=this.dataUnitName?this.dataUnitName:this.entityName;let s;for(this.dataUnit=await this._application.getDataUnit(this.entityName,t),this.dataUnit.pageSize=this.pageSize,this.dataUnit.unsubscribe(this._dataUnitObserver),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this._dataUnitObserver);s=this._onDataUnitResolve.pop();)s(this.dataUnit)}}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__"),this._application.getAllAccess().then((t=>this._permissions=t))}componentDidLoad(){this.loadDataUnit()}render(){return i(a,null)}get element(){return e(this)}static get watchers(){return{pageSize:["observePageSize"],dataUnitName:["observeDataUnitName"],entityName:["observeEntityName"],dataState:["observeDataState"],dataUnit:["observeDataUnit"]}}};l.style=".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";export{l as snk_data_unit}
1
+ import{r as t,c as s,h as i,g as e,H as a}from"./p-a77dd79a.js";import{Action as n,ApplicationContext as h}from"@sankhyalabs/core";import{ApplicationUtils as o,DialogType as r}from"@sankhyalabs/ezui/dist/collection/utils";import{O as c}from"./p-1d7a0daf.js";const l=class{constructor(i){t(this,i),this.dataStateChange=s(this,"dataStateChange",7),this.dataUnitReady=s(this,"dataUnitReady",7),this.insertionMode=s(this,"insertionMode",7),this.cancelEdition=s(this,"cancelEdition",7),this._onDataUnitResolve=[],this.pageSize=150,this._dataUnitObserver=t=>{const s={insertionMode:!1,hasNext:this.dataUnit.hasNext(),hasPrevious:this.dataUnit.hasPrevious(),copyMode:!1,isDirty:this.dataUnit.isDirty(),hasDirtyRecords:this.dataUnit.hasDirtyRecords(),selectedRecords:this.dataUnit.getSelectedRecords()};if(this.dataUnit.records.forEach((t=>{t.__record__id__.startsWith("NEW_")&&(s.insertionMode=!0,s.copyMode||(s.copyMode=null!=t.__record__source__id__))})),this.dataState=s,t.type===n.DATA_SAVED){const s=this.getMessage("snkDataUnit.saveInfo",t.payload.records[0]);null!=s&&this.showSuccessMessage(s)}if(t.type!==n.RECORDS_ADDED&&t.type!==n.RECORDS_COPIED||this.insertionMode.emit(),t.type===n.EDITION_CANCELED){this.cancelEdition.emit();const t=this.getMessage("snkDataUnit.cancelInfo");null!=t&&this.showSuccessMessage(t)}if(t.type===n.RECORDS_REMOVED){const s=this.getMessage("snkDataUnit.removeInfo",t.payload.cachedRecords[0]);null!=s&&this.showSuccessMessage(s)}this._application.messagesBuilder.currentOperation=this.getMessageOperation()}}observePageSize(){this.dataUnit&&(this.dataUnit.pageSize=this.pageSize)}observeDataUnitName(t,s){s!=t&&(this.dataUnit=void 0,this.dataUnitName=t,this.loadDataUnit())}observeEntityName(t,s){s!=t&&(this.dataUnit=void 0,this.entityName=t,this.loadDataUnit())}observeDataState(t,s){s!=t&&this.dataStateChange.emit(t)}observeDataUnit(){this.dataUnitReady.emit(this.dataUnit)}async getDataUnit(){return new Promise((t=>{this.dataUnit?t(this.dataUnit):this._onDataUnitResolve.push(t)}))}async interceptAction(t){return new Promise((s=>{switch(t.type){case n.RECORDS_ADDED:this.isAllowed("INSERT")?s(t):o.info(this.getMessage("snkDataUnit.forbiddenInsert"));break;case n.RECORDS_COPIED:this.isAllowed("CLONE")?s(t):o.info(this.getMessage("snkDataUnit.forbiddenClone"));break;case n.DATA_CHANGED:case n.CHANGING_DATA:this.isAllowed("UPDATE")?s(t):(this.dataUnit.cancelEdition(),o.alert(this.getMessage("snkDataUnit.forbidden"),this.getMessage("snkDataUnit.forbiddenUpdate")));break;case n.SAVING_DATA:if(this.beforeSave){const i=this.beforeSave(this.dataUnit);i instanceof Promise?i.then((i=>s(i?t:void 0))):s(i?t:void 0)}else s(t);break;case n.DATA_SAVED:this.afterSave?this.afterSave(this.dataUnit):s(t);break;case n.EDITION_CANCELED:if(this.dataState.hasDirtyRecords){const i=this.getMessage("snkDataUnit.cancelConfirmation");if(null==i)s(t);else{const e=this.getMessage("snkDataUnit.cancelConfirmationTitle");o.confirm(e,i).then((i=>s(i?t:void 0)))}}else s(t);break;case n.REMOVING_RECORDS:if(this.isAllowed("REMOVE")){const i=this.getMessage("snkDataUnit.removeConfirmation");if(null==i)s(t);else{const e={canClose:!1,labelCancel:this.getMessage("snkDataUnit.confirm.cancel"),labelConfirm:this.getMessage("snkDataUnit.confirm.delete"),btnConfirmDanger:!1},a=this.getMessage("snkDataUnit.removeConfirmationTitle");o.confirm(a,i,null,r.WARN,e).then((i=>s(i?t:void 0)))}}else o.info(this.getMessage("snkDataUnit.forbiddenRemove"));break;default:s(t)}}))}showSuccessMessage(t){o.info(t,{iconName:"check"})}isAllowed(t){return!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getMessage(t,s){return s||(s=this.getMessageParams()),this._application.messagesBuilder.getMessage(t,s)}getMessageParams(){return this.dataState.selectedRecords?this.dataState.selectedRecords[0]:void 0}getMessageOperation(){return this.dataState.copyMode?c.CLONE:this.dataState.insertionMode?c.INSERT:this.dataState.isDirty?c.UPDATE:c.CLEAN}async loadDataUnit(){if(!this.dataUnit&&this._application&&this.entityName){const t=this.dataUnitName?this.dataUnitName:this.entityName;let s;for(this.dataUnit=await this._application.getDataUnit(this.entityName,t),this.dataUnit.pageSize=this.pageSize,this.dataUnit.unsubscribe(this._dataUnitObserver),this.dataUnit.addInterceptor(this),this.dataUnit.subscribe(this._dataUnitObserver);s=this._onDataUnitResolve.pop();)s(this.dataUnit)}}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__"),this._application.getAllAccess().then((t=>this._permissions=t))}componentDidLoad(){this.loadDataUnit()}render(){return i(a,null)}get element(){return e(this)}static get watchers(){return{pageSize:["observePageSize"],dataUnitName:["observeDataUnitName"],entityName:["observeEntityName"],dataState:["observeDataState"],dataUnit:["observeDataUnit"]}}};l.style=".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";export{l as snk_data_unit}
@@ -1 +1 @@
1
- import{r as t,h as e,g as s}from"./p-9ba3df4c.js";import{ElementIDUtils as i}from"@sankhyalabs/core";const r=class{constructor(e){t(this,e)}ezChangeListener(t){this.value=t.detail}componentDidLoad(){this._element&&i.addIDInfo(this._element,"filterContentEditor")}render(){if(this.config)return e("ez-text-input",{id:this.config.id,ref:t=>this._textInputElement=t,label:this.config.label,value:this.config.value})}get _element(){return s(this)}};export{r as snk_filter_text}
1
+ import{r as t,h as e,g as s}from"./p-a77dd79a.js";import{ElementIDUtils as i}from"@sankhyalabs/core";const r=class{constructor(e){t(this,e)}ezChangeListener(t){this.value=t.detail}componentDidLoad(){this._element&&i.addIDInfo(this._element,"filterContentEditor")}render(){if(this.config)return e("ez-text-input",{id:this.config.id,ref:t=>this._textInputElement=t,label:this.config.label,value:this.config.value})}get _element(){return s(this)}};export{r as snk_filter_text}
@@ -1 +1 @@
1
- import{r as t,h as s,g as e}from"./p-9ba3df4c.js";import{ElementIDUtils as r,ApplicationContext as i}from"@sankhyalabs/core";import{F as o}from"./p-9dd2b8cb.js";const h=class{constructor(s){t(this,s)}ezChangeListener(t){this.value=this._searchInput.value}componentDidLoad(){this._element&&r.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s){const e=i.getContextValue("__SNK__APPLICATION__");return new Promise(((r,i)=>{e.executePreparedSearch(t,s,this.config.props.searchContext).then((t=>{r(t)})).catch((t=>{i(t)}))}))}async show(){this._searchInput.setFocus()}render(){if(this.config&&this.config.type===o.SEARCH)return s("ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s)})}get _element(){return e(this)}};export{h as snk_filter_search}
1
+ import{r as t,h as s,g as e}from"./p-a77dd79a.js";import{ElementIDUtils as r,ApplicationContext as i}from"@sankhyalabs/core";import{F as o}from"./p-9dd2b8cb.js";const h=class{constructor(s){t(this,s)}ezChangeListener(t){this.value=this._searchInput.value}componentDidLoad(){this._element&&r.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s){const e=i.getContextValue("__SNK__APPLICATION__");return new Promise(((r,i)=>{e.executePreparedSearch(t,s,this.config.props.searchContext).then((t=>{r(t)})).catch((t=>{i(t)}))}))}async show(){this._searchInput.setFocus()}render(){if(this.config&&this.config.type===o.SEARCH)return s("ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s)})}get _element(){return e(this)}};export{h as snk_filter_search}
@@ -1,9 +1,9 @@
1
- import{r as t,c as e,h as s,g as i}from"./p-9ba3df4c.js";import{WaitingChangeException as r,WarningException as n,ErrorException as a,ObjectUtils as o,DataType as c,DataUnit as h,StringUtils as u,ChangeOperation as l,DateUtils as d,DependencyType as p,ElementIDUtils as m,ApplicationContext as f,ErrorTracking as y}from"@sankhyalabs/core";import{d as g,D as v,R as w,U as I,F as _,G as P,C as $}from"./p-395b45a7.js";import{ApplicationUtils as D}from"@sankhyalabs/ezui/dist/collection/utils";import{S}from"./p-e7f772ed.js";import"./p-112455b1.js";class C{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const e=t.reason;e instanceof r||(e?this.processException(e):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t.errorCode+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t.errorCode+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t)),t instanceof r||t instanceof n?this._app.alert(t.title,t.message):t instanceof a?this._app.error(t.title,t.message):this._app.isDebugMode().then((e=>{if(e)if(t instanceof Error)this._app.error(t.name,t.message);else{const e=(null==t?void 0:t.title)||"Erro detectado",s="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(e,s)}}))}}class A{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",g.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
1
+ import{r as t,c as e,h as s,g as i}from"./p-a77dd79a.js";import{WaitingChangeException as r,WarningException as n,ErrorException as a,ObjectUtils as o,DataType as c,DataUnit as h,StringUtils as u,ChangeOperation as l,DateUtils as d,DependencyType as p,ElementIDUtils as m,ApplicationContext as f,ErrorTracking as y}from"@sankhyalabs/core";import{d as g,D as v,R as w,U as I,F as _,G as P,C as $}from"./p-395b45a7.js";import{ApplicationUtils as D}from"@sankhyalabs/ezui/dist/collection/utils";import{S}from"./p-1d7a0daf.js";import"./p-112455b1.js";class C{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const e=t.reason;e instanceof r||(e?this.processException(e):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t.errorCode+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t.errorCode+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t)),t instanceof r||t instanceof n?this._app.alert(t.title,t.message):t instanceof a?this._app.error(t.title,t.message):this._app.isDebugMode().then((e=>{if(e)if(t instanceof Error)this._app.error(t.name,t.message);else{const e=(null==t?void 0:t.title)||"Erro detectado",s="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(e,s)}}))}}class A{constructor(){this._defaultPageSize=100,this._templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this._templateByQuery.set("search",g.gql`query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
2
2
  $queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
3
3
  value
4
4
  label
5
5
  }
6
- }`)}loadSearchOptions(t,e,s,i){const r=(null==e?void 0:e.trim())||void 0;return e=isNaN(Number(r))&&r?`%${r}`:r,new Promise(((r,n)=>{v.get().callGraphQL({values:{argument:e,entityName:t,criteria:s,options:i},query:this._templateByQuery.get("search")}).then((t=>{r(t)})).catch((t=>{n(t)}))}))}loadAdvancedSearch(t,e,s,i){const r={query:{$:null==s?void 0:s.expression}};(null==s?void 0:s.params.length)>0&&(r.params={param:s.params.map((t=>{let e=t.value,s=t.dataType;return s===c.OBJECT?(e=e.value,s="S"):s=function(t){switch(t){case c.NUMBER:return"I";case c.DATE:return"D";default:return"S"}}(t.dataType),{$:e,type:s}}))});const n={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:{entityName:t,compacted:!1,ignoreEntityCriteria:!1,limit:this._defaultPageSize,query:{$:e},orderByDesc:!1,externalCriteria:r,localEntityName:null==i?void 0:i.rootEntity},clientEventList:{clientEvent:[]}}};return new Promise(((t,e)=>{v.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}}function T(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(T=function(){return t})()}const N=E;function E(t,e){const s=T();return(E=function(t){return s[t-=392]})(t,e)}!function(){const t=E,e=T();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const b=N(396);class q{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchTotals",g.gql`query($filters: [InputFilter!] $name: String!) {
6
+ }`)}loadSearchOptions(t,e,s,i){const r=(null==e?void 0:e.trim())||void 0;return e=isNaN(Number(r))&&r?`%${r}`:r,new Promise(((r,n)=>{v.get().callGraphQL({values:{argument:e,entityName:t,criteria:s,options:i},query:this._templateByQuery.get("search")}).then((t=>{r(t)})).catch((t=>{n(t)}))}))}loadAdvancedSearch(t,e,s,i){const r={query:{$:null==s?void 0:s.expression}};(null==s?void 0:s.params.length)>0&&(r.params={param:s.params.map((t=>{let e=t.value,s=t.dataType;return s===c.OBJECT?(e=e.value,s="S"):s=function(t){switch(t){case c.NUMBER:return"I";case c.DATE:return"D";default:return"S"}}(t.dataType),{$:e,type:s}}))});const n={serviceName:"PesquisaSP.getSuggestion",requestBody:{criteria:{entityName:t,compacted:!1,ignoreEntityCriteria:!1,limit:this._defaultPageSize,query:{$:e},orderByDesc:!1,externalCriteria:r,localEntityName:null==i?void 0:i.rootEntity},clientEventList:{clientEvent:[]}}};return new Promise(((t,e)=>{v.get().callServiceBroker("PesquisaSP.getSuggestion",JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}}function T(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(T=function(){return t})()}const N=E;function E(t,e){const s=T();return(E=function(t){return s[t-=392]})(t,e)}!function(){const t=E,e=T();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const q=N(396);class b{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchTotals",g.gql`query($filters: [InputFilter!] $name: String!) {
7
7
  $queryAlias$: fetchTotals(name: $name, filters: $filters ){
8
8
  name
9
9
  value
@@ -32,6 +32,13 @@ import{r as t,c as e,h as s,g as i}from"./p-9ba3df4c.js";import{WaitingChangeExc
32
32
  expression
33
33
  }
34
34
  }
35
+ children{
36
+ name
37
+ links{
38
+ source
39
+ target
40
+ }
41
+ }
35
42
  }
36
43
  }`),this.templateByQuery.set("fetchData",g.gql`query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!]) {
37
44
  $queryAlias$: fetchDataUnit(name: $dataunit){
@@ -68,9 +75,9 @@ import{r as t,c as e,h as s,g as i}from"./p-9ba3df4c.js";import{WaitingChangeExc
68
75
  }
69
76
  }
70
77
  }
71
- }`)}getDataUnit(t,e){const s=new h(`dd://${t}/${e}`);return s.metadataLoader=t=>this.loadMetadata(t),s.dataLoader=(t,e)=>this.loadData(t,e),s.saveLoader=(t,e)=>this.saveData(t,e),s.removeLoader=(t,e)=>this.removeRecords(t,e),s.recordLoader=(t,e)=>this.loadRecord(t,e),s}loadMetadata(t){return new Promise(((e,s)=>{v.get().callGraphQL({values:{name:t.name},query:this.templateByQuery.get("fetchDataUnit")}).then((t=>{var s;const i={name:t.name,label:t.name,fields:[]};null===(s=t.fields)||void 0===s||s.forEach((t=>{let e;Array.isArray(t.properties)&&(e={},t.calculated&&(e.gridHeaderTooltip="Campos calculados não podem ser ordenados"),t.properties.forEach((t=>e[t.name]=t.value))),i.fields.push(Object.assign(Object.assign({},t),{properties:e}))})),e(i)})).catch((t=>{s(t)}))}))}loadData(t,e){const s=t.name;return this._loadDataTimeout[s]&&(clearTimeout(this._loadDataTimeout[s]),delete this._loadDataTimeout[s]),new Promise(((i,r)=>{this._loadDataTimeout[s]=setTimeout((()=>{delete this._loadDataTimeout[s],this.doLoadData(t,e).then((t=>i(t))).catch((t=>r(t)))}),200)}))}doLoadData(t,e){return new Promise(((s,i)=>{var r;const{sort:n,filters:a,limit:o,offset:h,quickFilter:l}=e,d={dataunit:t.name,sort:n,filters:a};if(d.limit=o,d.offset=h,!u.isEmpty(null==l?void 0:l.term)){void 0===d.filter&&(d.filter=[]);const t={name:"__QUICK_FILTER__",expression:"__QUICK_FILTER__",params:[{name:"term",dataType:c.TEXT,value:l.term}]};(null===(r=null==l?void 0:l.fields)||void 0===r?void 0:r.length)>0&&t.params.push({name:"fields",dataType:c.OBJECT,value:l.fields}),d.filter.push(t)}v.get().callGraphQL({values:d,query:this.templateByQuery.get("fetchData")}).then((e=>{const{limit:i,offset:r,total:n,hasMore:a,records:o}=e.data;let c;i&&(c={firstRecord:0==n?0:r+1,lastRecord:r+Math.min(o.length,i),total:n,currentPage:r/i,hasMore:a});const h=[];o.forEach((e=>{const s={__record__id__:e.id};e.fields.forEach((({name:e,value:i})=>{s[e]=t.valueFromString(e,i)})),h.push(s)})),s({paginationInfo:c,records:h})})).catch((t=>{i(t)}))}))}saveData(t,e){const s=e.map((e=>{const{dataUnit:s,record:i,updatingFields:r,operation:n}=e;let a;r&&(a=Object.entries(r).map((([e,s])=>{const i=t.getField(e);return{fieldName:e,dataType:i?i.dataType:c.TEXT,value:t.valueToString(e,s)}})));const o={dataUnit:s,fields:a,operation:n,recordId:i.__record__id__};return e.sourceId&&(o.sourceId=e.sourceId),o}));return new Promise(((e,i)=>{v.get().callGraphQL({values:{changes:s},query:this.templateByQuery.get("saveData")}).then((s=>{const i=[];null==s||s.forEach((e=>{const s={__record__id__:e.id};e.oldId&&(s.__old__id__=e.oldId),e.fields.forEach((({name:e,value:i})=>{s[e]=t.valueFromString(e,i)})),i.push(s)})),e(i)})).catch((t=>{i(t)}))}))}removeRecords(t,e){const s=e.map((e=>({dataUnit:t.name,operation:l.DELETE,recordId:e})));return new Promise(((t,i)=>{v.get().callGraphQL({values:{changes:s},query:this.templateByQuery.get("saveData")}).then((()=>{t(e)})).catch((t=>{i(t)}))}))}loadRecord(t,e){return new Promise(((s,i)=>{v.get().callGraphQL({values:{recordID:e,dataunit:t.name},query:this.templateByQuery.get("fetchDataRecord")}).then((e=>{const i=[];e.record.forEach((e=>{const s={__record__id__:e.id};e.fields.forEach((({name:e,value:i})=>{s[e]=t.valueFromString(e,i)})),i.push(s)})),s(i)})).catch((t=>{i(t)}))}))}}var O;class F{static openAppActivity(t,e){var s;null===(s=window.workspace)||void 0===s||s.openAppActivity(t,e)}}F.resourceID=null===(O=window.workspace)||void 0===O?void 0:O.resourceID;class R{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",g.gql`query($name: String!) {
78
+ }`)}getDataUnit(t,e){const s=new h(`dd://${t}/${e}`);return s.metadataLoader=t=>this.loadMetadata(t),s.dataLoader=(t,e)=>this.loadData(t,e),s.saveLoader=(t,e)=>this.saveData(t,e),s.removeLoader=(t,e)=>this.removeRecords(t,e),s.recordLoader=(t,e)=>this.loadRecord(t,e),s}loadMetadata(t){return new Promise(((e,s)=>{v.get().callGraphQL({values:{name:t.name},query:this.templateByQuery.get("fetchDataUnit")}).then((t=>{var s;const i={name:t.name,label:t.name,children:[...t.children],fields:[]};null===(s=t.fields)||void 0===s||s.forEach((t=>{let e;Array.isArray(t.properties)&&(e={},t.calculated&&(e.gridHeaderTooltip="Campos calculados não podem ser ordenados"),t.properties.forEach((t=>e[t.name]=t.value))),i.fields.push(Object.assign(Object.assign({},t),{properties:e}))})),e(i)})).catch((t=>{s(t)}))}))}loadData(t,e){const s=t.name;return this._loadDataTimeout[s]&&(clearTimeout(this._loadDataTimeout[s]),delete this._loadDataTimeout[s]),new Promise(((i,r)=>{this._loadDataTimeout[s]=setTimeout((()=>{delete this._loadDataTimeout[s],this.doLoadData(t,e).then((t=>i(t))).catch((t=>r(t)))}),200)}))}doLoadData(t,e){return new Promise(((s,i)=>{var r;const{sort:n,filters:a,limit:o,offset:h,quickFilter:l}=e,d={dataunit:t.name,sort:n,filters:a};if(d.limit=o,d.offset=h,!u.isEmpty(null==l?void 0:l.term)){void 0===d.filter&&(d.filter=[]);const t={name:"__QUICK_FILTER__",expression:"__QUICK_FILTER__",params:[{name:"term",dataType:c.TEXT,value:l.term}]};(null===(r=null==l?void 0:l.fields)||void 0===r?void 0:r.length)>0&&t.params.push({name:"fields",dataType:c.OBJECT,value:l.fields}),d.filter.push(t)}v.get().callGraphQL({values:d,query:this.templateByQuery.get("fetchData")}).then((e=>{const{limit:i,offset:r,total:n,hasMore:a,records:o}=e.data;let c;i&&(c={firstRecord:0==n?0:r+1,lastRecord:r+Math.min(o.length,i),total:n,currentPage:r/i,hasMore:a});const h=[];o.forEach((e=>{const s={__record__id__:e.id};e.fields.forEach((({name:e,value:i})=>{s[e]=t.valueFromString(e,i)})),h.push(s)})),s({paginationInfo:c,records:h})})).catch((t=>{i(t)}))}))}saveData(t,e){const s=e.map((e=>{const{dataUnit:s,record:i,updatingFields:r,operation:n}=e;let a;r&&(a=Object.entries(r).map((([e,s])=>{const i=t.getField(e);return{fieldName:e,dataType:i?i.dataType:c.TEXT,value:t.valueToString(e,s)}})));const o={dataUnit:s,fields:a,operation:n,recordId:i.__record__id__};return e.sourceId&&(o.sourceId=e.sourceId),o}));return new Promise(((e,i)=>{v.get().callGraphQL({values:{changes:s},query:this.templateByQuery.get("saveData")}).then((s=>{const i=[];null==s||s.forEach((e=>{const s={__record__id__:e.id};e.oldId&&(s.__old__id__=e.oldId),e.fields.forEach((({name:e,value:i})=>{s[e]=t.valueFromString(e,i)})),i.push(s)})),e(i)})).catch((t=>{i(t)}))}))}removeRecords(t,e){const s=e.map((e=>({dataUnit:t.name,operation:l.DELETE,recordId:e})));return new Promise(((t,i)=>{v.get().callGraphQL({values:{changes:s},query:this.templateByQuery.get("saveData")}).then((()=>{t(e)})).catch((t=>{i(t)}))}))}loadRecord(t,e){return new Promise(((s,i)=>{v.get().callGraphQL({values:{recordID:e,dataunit:t.name},query:this.templateByQuery.get("fetchDataRecord")}).then((e=>{const i=[];e.record.forEach((e=>{const s={__record__id__:e.id};e.fields.forEach((({name:e,value:i})=>{s[e]=t.valueFromString(e,i)})),i.push(s)})),s(i)})).catch((t=>{i(t)}))}))}}var O;class F{static openAppActivity(t,e){var s;null===(s=window.workspace)||void 0===s||s.openAppActivity(t,e)}}F.resourceID=null===(O=window.workspace)||void 0===O?void 0:O.resourceID;class R{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",g.gql`query($name: String!) {
72
79
  $queryAlias$: fetchResource(name: $name){
73
80
  name
74
81
  resource
75
82
  }
76
- }`)}async getParam(t){const e=`param://application?params=${t}`;return v.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchParam")})}async asString(t){const e=await this.getParam(t);return this.getValue(e)}async asInteger(t){const e=await this.getParam(t);return parseInt(this.getValue(e))}async asFloat(t){const e=await this.getParam(t);return parseFloat(this.getValue(e))}async asBoolean(t){const e=await this.getParam(t);return this.getValue(e).includes('"S"')}async asDate(t){const e=await this.getParam(t);return d.strToDate(this.getValue(e))}async getBatchParams(t){const e=await this.getParam(t.join(",")),s={};return e.forEach((t=>s[t.name]=t.resource)),s}getValue(t={}){return Array.isArray(t)&&t.length>0&&(t=t[0]),u.isEmpty(t.resource)?"":t.resource}}const L=j;function j(t,e){const s=k();return(j=function(t){return s[t-=378]})(t,e)}function k(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(k=function(){return t})()}!function(){const t=j,e=k();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class M{[L(397)](t){const e=L;if(typeof(t=utxt(t[e(390)]))==e(392)&&(t=JSON[e(400)](t)),null==t)throw Error(e(395));const s=new x("S"===t[e(402)]||!0===t[e(402)]);return Array[e(394)](t[e(391)])&&t[e(391)][e(385)]((t=>s.putAccess(t[e(382)],String(t.status)==e(398)))),s}}class x{constructor(t){const e=L;this.isSup=t,this[e(384)]={}}[L(378)](t,e){this[L(384)][t]=e}[L(393)](t){const e=L;if(this[e(402)])return!0;let s=!0;return this[e(384)][e(380)](t)&&(s=this.actions[t]),s}isUserSup(){return this.isSup}}class B extends w{getData(t){const e=`cfg://auth/${t}`;return new Promise(((t,s)=>{this.loadResource(e).then((e=>{let s=o.stringToObject(e);s&&"object"==typeof s&&t(s)})).catch((t=>{s(t)}))}))}}var z;function G(t){if(null==t)return t;if(t instanceof Date)return t.toISOString();if("object"==typeof t){if(t instanceof Array)return t.map((t=>G(t)));{const e=Object.assign({},t);return Object.keys(t).forEach((s=>{t[s]?e[s]=G(t[s]):delete e[s]})),e}}return t}!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(z||(z={}));class J extends w{saveConfig(t,e,s){const i=t.map((t=>{const{id:e,value:s,fixed:i,visible:r}=t,n={id:e};return s&&(n.value=G(s)),i&&(n.fixed=i),r&&(n.visible=!0),n}));return this.saveResource(i,`cfg://filter/FilterBarState:${e}/${s}`)}getConfig(t,e){return new Promise(((s,i)=>{this.loadResource(`cfg://filter/FilterBarState:${t}/${e}`).then((t=>{let e;t&&(e=JSON.parse(t).items),s(e||[])})).catch((t=>{i(t)}))}))}}class H extends w{getDefaultValues(t){return new Promise(((e,s)=>{this.loadResource(`cfg://defaultValues/${t}`).then((t=>{let s;t&&(s=JSON.parse(t)),e(s)})).catch((t=>{s(t)}))}))}}const V=class{constructor(s){t(this,s),this.applicationLoaded=e(this,"applicationLoaded",7),this.applicationLoading=e(this,"applicationLoading",7),this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new W}get parameters(){return this._parameters||(this._parameters=new R),this._parameters}get resourceID(){return this._resourceID||(this._resourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||F.resourceID||"unknown.resource.id"),this._resourceID}get auth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,e)=>{const s=this._authPromises.length>0;this._authPromises.push(new Z(t,e)),s||this.authFetcher.getData(this.resourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}async isUserSup(){return new Promise(((t,e)=>{this.auth.then((s=>{this.getAuthList(s).then((e=>{t(e.isSup)})).catch((t=>e(t)))}))}))}async hasAccess(t){return new Promise(((e,s)=>{this.auth.then((i=>{this.getAuthList(i).then((s=>{e(s.isSup||s.actions[t])})).catch((t=>s(t)))}))}))}async getAllAccess(){return new Promise(((t,e)=>{this.auth.then((s=>{this.getAuthList(s).then((e=>{const s={};s.isSup=e.isSup,Object.entries(z).forEach((t=>{s[t[0]]=e.actions[t[1]]||!1})),t(s)})).catch((t=>e(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,e="full",s=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=e,this._popUp.useHeader=s,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const e=t.split(",");return new Promise(((t,s)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(e.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((e=>{t(e.includes("1"))})).catch((t=>{s(t)}))})).catch((t=>{s(t)}))}))}async getConfig(t){let e={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,s)=>{v.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(e)).then((e=>{var s;return t(null===(s=e.config)||void 0===s?void 0:s.data)})).catch((t=>s(t)))}))}async saveConfig(t,e){let s={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:e}}};return new Promise(((t,e)=>{v.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(s)).then((e=>t(e))).catch((t=>e(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,e){F.openAppActivity(t,e)}getDuPromissesStack(t){let e;return t&&(e=this._duPromises.get(t),e||(e=[],this._duPromises.set(t,e))),e||[]}async createDataunit(t,e){return new Promise(((s,i)=>{const r=this.getDuPromissesStack(e),n=r.length>0;if(r.push(new Z(s,i)),!n){const s=this.dataUnitFetcher.getDataUnit(t,this.resourceID);s.loadMetadata().then((()=>{for(e&&this._duCache.set(e,s);r.length>0;)r.pop().resolve(s)})).catch((t=>{for(;r.length>0;)r.pop().reject(t)}))}}))}async getDataUnit(t,e){return new Promise(((s,i)=>{const r=this._duCache.get(e);r?s(r):this.createDataunit(t,e).then((t=>{s(t)})).catch((t=>i(t)))}))}async getResourceID(){return Promise.resolve(this.resourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,e,s,i){return D.alert(t,e,s,i)}async error(t,e,s,i){return D.error(t,e,s,i)}async success(t,e,s,i){return D.success(t,e,s,i)}async message(t,e,s,i){return D.message(t,e,s,i)}async confirm(t,e,s,i,r){return D.confirm(t,e,s,i,r)}async info(t,e){return D.info(t,e)}async loadFormConfig(t){return this.formConfigFetcher.loadFormConfig(t,this.resourceID)}async loadGridConfig(t){return this.gridConfigFetcher.getConfig(t,this.resourceID)}async fetchUserAvailableConfigs(t){return this.formConfigFetcher.fetchUserAvailableConfigs(t,this.resourceID)}async fetchLegacyConfig(t){return this.formConfigFetcher.fetchLegacyConfig(t,this.resourceID)}async fetchDefaultConfig(t){return this.formConfigFetcher.fetchDefaultConfig(t,this.resourceID)}async loadTotals(t,e,s){return this.totalsFetcher.fetchTotals(t,e,s)}async saveGridConfig(t){return this.gridConfigFetcher.saveConfig(t,this.resourceID)}async getFilterBarConfig(t){return new Promise(((e,s)=>{this.configName===t&&this._filterBarConfig?e(this._filterBarConfig):this.configName===t&&null!=this._filterConfigPromise?Promise.all([this._filterConfigPromise]).then((t=>e(t[0]))).catch((t=>s(t[0]))):this.filterBarConfigFetcher.getConfig(this.resourceID,t).then((t=>e(t))).catch((t=>s(t)))}))}async saveFilterBarConfig(t,e){return this.filterBarConfigFetcher.saveConfig(t,this.resourceID,e)}async saveFormConfig(t,e){return this.formConfigFetcher.saveConfig(t,e,this.resourceID)}async getDefaultValues(){return this.defaultValuesFetcher.getDefaultValues(this.resourceID)}async getDefaultValue(t){return this._defaultValues&&this._defaultValues[t]}async getAuthList(t){return await(new M).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=I.getQueryParams(location.search)),this._urlParams}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new U),this._dataUnitFetcher}get formConfigFetcher(){return this._formConfigFetcher||(this._formConfigFetcher=new _),this._formConfigFetcher}get gridConfigFetcher(){return this._gridConfigFetcher||(this._gridConfigFetcher=new P),this._gridConfigFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new q),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new A),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new B),this._authFetcher}get filterBarConfigFetcher(){return this._filterBarConfigFetcher||(this._filterBarConfigFetcher=new J),this._filterBarConfigFetcher}get defaultValuesFetcher(){return this._defaultValuesFetcher||(this._defaultValuesFetcher=new H),this._defaultValuesFetcher}async executeSearch(t,e,s){const i=null==s?void 0:s.getField(e);if(i){const{mode:e,argument:r}=t,{ENTITYNAME:n,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:h,DESCRIPTIONENTITY:u}=i.properties,l=i.dependencies;let d;const m={rootEntity:h,descriptionFieldName:o,codeFieldName:a,showInactives:!1};return null==l||l.filter((t=>{var e;return null===(e=t.masterFields)||void 0===e?void 0:e.every((t=>{var e;return null===(e=s.getField(t))||void 0===e?void 0:e.visible}))})).forEach((t=>{var e;t.type===p.SEARCHING&&(null===(e=t.masterFields)||void 0===e?void 0:e.length)>0&&(d={expression:t.expression,params:t.masterFields.map((t=>{const e=s.getField(t),i=(null==e?void 0:e.dataType)||c.TEXT,r=s.getFieldValue(t);if(null==r)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${e.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${e.label} para executar a pesquisa.`);return{name:t,value:r,dataType:i}}))})})),this.executePreparedSearch(e,r,{entity:n,entityDescription:u,criteria:d,searchOptions:m})}}async executePreparedSearch(t,e,s){const{entity:i,entityDescription:r,criteria:n,searchOptions:a}=s;return"ADVANCED"===t?new Promise((t=>{const s=document.createElement("snk-pesquisa");s[m.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${i}`,s.argument=e,s.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(i,t,n,a),s.selectItem=e=>{t(e),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(r),this.showPopUp(s)})):this.pesquisaFetcher.loadSearchOptions(i,e,n,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}clearContent(t){t&&Array.from(t.children).forEach((e=>{t.removeChild(e)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}componentWillLoad(){this._errorHandler=new C(this),this.messagesBuilder=new S,f.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${I.getUrlBase()}/mge/upload/file`),f.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,e,s)=>this.executeSearch(t,e,s))),f.setContextValue("__EZUI__GRID_LICENSE__",b),this.configName&&(this._filterConfigPromise=new Promise(((t,e)=>{this.filterBarConfigFetcher.getConfig(this.resourceID,this.configName).then((e=>{this._filterBarConfig=e,t(e)})).catch((t=>e(t)))}))),y.init(),$.get(),this.getDefaultValues().then((t=>{this._defaultValues=t}))}connectedCallback(){f.setContextValue("__SNK__APPLICATION__",this),v.addRequestListener(this._requestListener)}disconnectedCallback(){v.removeRequestListener(this._requestListener)}componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{this.applicationLoaded.emit(!0)})),m.addIDInfo(this._element,`resource_${this._resourceID}`)}render(){return s("div",null,s("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),s("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),s("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}};class W{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.loadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){var e;if(1==(null===(e=null==t?void 0:t.requestBody)||void 0===e?void 0:e.length)){const{name:e}=t.requestBody[0].variables;if(e){const t=e.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class Z{constructor(t,e){this.resolve=t,this.reject=e}}V.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{V as snk_application}
83
+ }`)}async getParam(t){const e=`param://application?params=${t}`;return v.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchParam")})}async asString(t){const e=await this.getParam(t);return this.getValue(e)}async asInteger(t){const e=await this.getParam(t);return parseInt(this.getValue(e))}async asFloat(t){const e=await this.getParam(t);return parseFloat(this.getValue(e))}async asBoolean(t){const e=await this.getParam(t);return this.getValue(e).includes('"S"')}async asDate(t){const e=await this.getParam(t);return d.strToDate(this.getValue(e))}async getBatchParams(t){const e=await this.getParam(t.join(",")),s={};return e.forEach((t=>s[t.name]=t.resource)),s}getValue(t={}){return Array.isArray(t)&&t.length>0&&(t=t[0]),u.isEmpty(t.resource)?"":t.resource}}const L=j;function j(t,e){const s=k();return(j=function(t){return s[t-=378]})(t,e)}function k(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(k=function(){return t})()}!function(){const t=j,e=k();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class M{[L(397)](t){const e=L;if(typeof(t=utxt(t[e(390)]))==e(392)&&(t=JSON[e(400)](t)),null==t)throw Error(e(395));const s=new x("S"===t[e(402)]||!0===t[e(402)]);return Array[e(394)](t[e(391)])&&t[e(391)][e(385)]((t=>s.putAccess(t[e(382)],String(t.status)==e(398)))),s}}class x{constructor(t){const e=L;this.isSup=t,this[e(384)]={}}[L(378)](t,e){this[L(384)][t]=e}[L(393)](t){const e=L;if(this[e(402)])return!0;let s=!0;return this[e(384)][e(380)](t)&&(s=this.actions[t]),s}isUserSup(){return this.isSup}}class B extends w{getData(t){const e=`cfg://auth/${t}`;return new Promise(((t,s)=>{this.loadResource(e).then((e=>{let s=o.stringToObject(e);s&&"object"==typeof s&&t(s)})).catch((t=>{s(t)}))}))}}var z;function G(t){if(null==t)return t;if(t instanceof Date)return t.toISOString();if("object"==typeof t){if(t instanceof Array)return t.map((t=>G(t)));{const e=Object.assign({},t);return Object.keys(t).forEach((s=>{t[s]?e[s]=G(t[s]):delete e[s]})),e}}return t}!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(z||(z={}));class J extends w{saveConfig(t,e,s){const i=t.map((t=>{const{id:e,value:s,fixed:i,visible:r}=t,n={id:e};return s&&(n.value=G(s)),i&&(n.fixed=i),r&&(n.visible=!0),n}));return this.saveResource(i,`cfg://filter/FilterBarState:${e}/${s}`)}getConfig(t,e){return new Promise(((s,i)=>{this.loadResource(`cfg://filter/FilterBarState:${t}/${e}`).then((t=>{let e;t&&(e=JSON.parse(t).items),s(e||[])})).catch((t=>{i(t)}))}))}}class H extends w{getDefaultValues(t){return new Promise(((e,s)=>{this.loadResource(`cfg://defaultValues/${t}`).then((t=>{let s;t&&(s=JSON.parse(t)),e(s)})).catch((t=>{s(t)}))}))}}const V=class{constructor(s){t(this,s),this.applicationLoaded=e(this,"applicationLoaded",7),this.applicationLoading=e(this,"applicationLoading",7),this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new W}get parameters(){return this._parameters||(this._parameters=new R),this._parameters}get resourceID(){return this._resourceID||(this._resourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||F.resourceID||"unknown.resource.id"),this._resourceID}get auth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,e)=>{const s=this._authPromises.length>0;this._authPromises.push(new Z(t,e)),s||this.authFetcher.getData(this.resourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}async isUserSup(){return new Promise(((t,e)=>{this.auth.then((s=>{this.getAuthList(s).then((e=>{t(e.isSup)})).catch((t=>e(t)))}))}))}async hasAccess(t){return new Promise(((e,s)=>{this.auth.then((i=>{this.getAuthList(i).then((s=>{e(s.isSup||s.actions[t])})).catch((t=>s(t)))}))}))}async getAllAccess(){return new Promise(((t,e)=>{this.auth.then((s=>{this.getAuthList(s).then((e=>{const s={};s.isSup=e.isSup,Object.entries(z).forEach((t=>{s[t[0]]=e.actions[t[1]]||!1})),t(s)})).catch((t=>e(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,e="full",s=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=e,this._popUp.useHeader=s,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const e=t.split(",");return new Promise(((t,s)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(e.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((e=>{t(e.includes("1"))})).catch((t=>{s(t)}))})).catch((t=>{s(t)}))}))}async getConfig(t){let e={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,s)=>{v.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(e)).then((e=>{var s;return t(null===(s=e.config)||void 0===s?void 0:s.data)})).catch((t=>s(t)))}))}async saveConfig(t,e){let s={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:e}}};return new Promise(((t,e)=>{v.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(s)).then((e=>t(e))).catch((t=>e(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,e){F.openAppActivity(t,e)}getDuPromissesStack(t){let e;return t&&(e=this._duPromises.get(t),e||(e=[],this._duPromises.set(t,e))),e||[]}async createDataunit(t,e){return new Promise(((s,i)=>{const r=this.getDuPromissesStack(e),n=r.length>0;if(r.push(new Z(s,i)),!n){const s=this.dataUnitFetcher.getDataUnit(t,this.resourceID);s.loadMetadata().then((()=>{for(e&&this._duCache.set(e,s);r.length>0;)r.pop().resolve(s)})).catch((t=>{for(;r.length>0;)r.pop().reject(t)}))}}))}async getDataUnit(t,e){return new Promise(((s,i)=>{const r=this._duCache.get(e);r?s(r):this.createDataunit(t,e).then((t=>{s(t)})).catch((t=>i(t)))}))}async getResourceID(){return Promise.resolve(this.resourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,e,s,i){return D.alert(t,e,s,i)}async error(t,e,s,i){return D.error(t,e,s,i)}async success(t,e,s,i){return D.success(t,e,s,i)}async message(t,e,s,i){return D.message(t,e,s,i)}async confirm(t,e,s,i,r){return D.confirm(t,e,s,i,r)}async info(t,e){return D.info(t,e)}async loadFormConfig(t){return this.formConfigFetcher.loadFormConfig(t,this.resourceID)}async loadGridConfig(t){return this.gridConfigFetcher.getConfig(t,this.resourceID)}async fetchUserAvailableConfigs(t){return this.formConfigFetcher.fetchUserAvailableConfigs(t,this.resourceID)}async fetchLegacyConfig(t){return this.formConfigFetcher.fetchLegacyConfig(t,this.resourceID)}async fetchDefaultConfig(t){return this.formConfigFetcher.fetchDefaultConfig(t,this.resourceID)}async loadTotals(t,e,s){return this.totalsFetcher.fetchTotals(t,e,s)}async saveGridConfig(t){return this.gridConfigFetcher.saveConfig(t,this.resourceID)}async getFilterBarConfig(t){return new Promise(((e,s)=>{this.configName===t&&this._filterBarConfig?e(this._filterBarConfig):this.configName===t&&null!=this._filterConfigPromise?Promise.all([this._filterConfigPromise]).then((t=>e(t[0]))).catch((t=>s(t[0]))):this.filterBarConfigFetcher.getConfig(this.resourceID,t).then((t=>e(t))).catch((t=>s(t)))}))}async saveFilterBarConfig(t,e){return this.filterBarConfigFetcher.saveConfig(t,this.resourceID,e)}async saveFormConfig(t,e){return this.formConfigFetcher.saveConfig(t,e,this.resourceID)}async getDefaultValues(){return this.defaultValuesFetcher.getDefaultValues(this.resourceID)}async getDefaultValue(t){return this._defaultValues&&this._defaultValues[t]}async getAuthList(t){return await(new M).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=I.getQueryParams(location.search)),this._urlParams}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new U),this._dataUnitFetcher}get formConfigFetcher(){return this._formConfigFetcher||(this._formConfigFetcher=new _),this._formConfigFetcher}get gridConfigFetcher(){return this._gridConfigFetcher||(this._gridConfigFetcher=new P),this._gridConfigFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new b),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new A),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new B),this._authFetcher}get filterBarConfigFetcher(){return this._filterBarConfigFetcher||(this._filterBarConfigFetcher=new J),this._filterBarConfigFetcher}get defaultValuesFetcher(){return this._defaultValuesFetcher||(this._defaultValuesFetcher=new H),this._defaultValuesFetcher}async executeSearch(t,e,s){const i=null==s?void 0:s.getField(e);if(i){const{mode:e,argument:r}=t,{ENTITYNAME:n,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:h,DESCRIPTIONENTITY:u}=i.properties,l=i.dependencies;let d;const m={rootEntity:h,descriptionFieldName:o,codeFieldName:a,showInactives:!1};return null==l||l.filter((t=>{var e;return null===(e=t.masterFields)||void 0===e?void 0:e.every((t=>{var e;return null===(e=s.getField(t))||void 0===e?void 0:e.visible}))})).forEach((t=>{var e;t.type===p.SEARCHING&&(null===(e=t.masterFields)||void 0===e?void 0:e.length)>0&&(d={expression:t.expression,params:t.masterFields.map((t=>{const e=s.getField(t),i=(null==e?void 0:e.dataType)||c.TEXT,r=s.getFieldValue(t);if(null==r)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${e.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${e.label} para executar a pesquisa.`);return{name:t,value:r,dataType:i}}))})})),this.executePreparedSearch(e,r,{entity:n,entityDescription:u,criteria:d,searchOptions:m})}}async executePreparedSearch(t,e,s){const{entity:i,entityDescription:r,criteria:n,searchOptions:a}=s;return"ADVANCED"===t?new Promise((t=>{const s=document.createElement("snk-pesquisa");s[m.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${i}`,s.argument=e,s.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(i,t,n,a),s.selectItem=e=>{t(e),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(r),this.showPopUp(s)})):this.pesquisaFetcher.loadSearchOptions(i,e,n,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}clearContent(t){t&&Array.from(t.children).forEach((e=>{t.removeChild(e)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}componentWillLoad(){this._errorHandler=new C(this),this.messagesBuilder=new S,f.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${I.getUrlBase()}/mge/upload/file`),f.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,e,s)=>this.executeSearch(t,e,s))),f.setContextValue("__EZUI__GRID_LICENSE__",q),this.configName&&(this._filterConfigPromise=new Promise(((t,e)=>{this.filterBarConfigFetcher.getConfig(this.resourceID,this.configName).then((e=>{this._filterBarConfig=e,t(e)})).catch((t=>e(t)))}))),y.init(),$.get(),this.getDefaultValues().then((t=>{this._defaultValues=t}))}connectedCallback(){f.setContextValue("__SNK__APPLICATION__",this),v.addRequestListener(this._requestListener)}disconnectedCallback(){v.removeRequestListener(this._requestListener)}componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{this.applicationLoaded.emit(!0)})),m.addIDInfo(this._element,`resource_${this._resourceID}`)}render(){return s("div",null,s("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),s("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),s("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}};class W{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.loadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){var e;if(1==(null===(e=null==t?void 0:t.requestBody)||void 0===e?void 0:e.length)){const{name:e}=t.requestBody[0].variables;if(e){const t=e.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class Z{constructor(t,e){this.resolve=t,this.reject=e}}V.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{V as snk_application}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-9ba3df4c.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-44ce5b90",[[1,"teste-pesquisa"]]],["p-70e52fee",[[2,"snk-data-unit",{dataState:[1040],dataUnitName:[1,"data-unit-name"],entityName:[1,"entity-name"],pageSize:[2,"page-size"],dataUnit:[1040],beforeSave:[16],afterSave:[16],getDataUnit:[64]}]]],["p-9593c937",[[0,"snk-filter-binary-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-eff899b0",[[0,"snk-filter-multi-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-fd3b562d",[[0,"snk-filter-number",{config:[16],value:[2],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-c17be74f",[[0,"snk-filter-period",{config:[16],value:[8],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-f50c6ef6",[[0,"snk-filter-personalized",{config:[16],value:[1040],fix:[16],unfix:[16],show:[64]}]]],["p-db111acd",[[0,"snk-filter-search",{config:[16],value:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-b0a0222f",[[0,"snk-filter-text",{config:[16],value:[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-14af45cc",[[2,"snk-pesquisa",{searchLoader:[16],selectItem:[16],argument:[1025],_itemList:[32],_startLoading:[32]}]]],["p-570cc474",[[2,"snk-config-options",{fieldConfig:[16],idConfig:[513,"id-config"],dataUnit:[16],_defaultType:[32]}]]],["p-c30d0966",[[6,"snk-tab-config",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32],_activeEditText:[32],_activeEditTextIndex:[32],_actionsHide:[32],_actionsShow:[32]}]]],["p-2664ae24",[[0,"snk-filter-detail",{config:[1040],getMessage:[16],show:[64]}]]],["p-9e67cf79",[[6,"snk-grid",{configName:[1,"config-name"],actionsList:[16],taskbarManager:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],enableDataExporter:[4,"enable-data-exporter"],_dataUnit:[32],_dataState:[32],_gridConfig:[32],_popUpGridConfig:[32],showConfig:[64],hideConfig:[64],setConfig:[64]},[[0,"actionClick","actionClickHandler"]]],[2,"snk-configurator",{configName:[1,"config-name"],viewMode:[1,"view-mode"],_opened:[32],_permissions:[32],open:[64],close:[64]}],[2,"snk-field-config",{isConfigActive:[16],fieldConfig:[16],modeInsertion:[516,"mode-insertion"],dataUnit:[16]}]]],["p-00b3c5d8",[[2,"snk-form-config",{dataUnit:[16],formConfig:[16],configName:[513,"config-name"],_formConfigOptions:[32],_fieldConfigSelected:[32],_layoutFormConfig:[32],_fieldsAvailable:[32],_formConfig:[32],_formConfigChanged:[32],_optionFormConfigSelected:[32],_optionFormConfigChanged:[32],_tempGroups:[32]}]]],["p-8a872a35",[[2,"snk-filter-bar",{dataUnit:[1040],configName:[1,"config-name"],filterConfig:[1040],allowDefault:[32],scrollerLocked:[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{selectedIndex:[1026,"selected-index"],application:[16],columns:[1040],config:[1040],saveConfig:[64]}],[0,"snk-exporter-email-sender",{getMessage:[16],_config:[32],_opened:[32],_currentStep:[32],open:[64]}],[0,"snk-filter-item",{config:[1040],getMessage:[16],detailIsVisible:[32],showUp:[64],hideDetail:[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{label:[1],iconName:[1,"icon-name"],items:[16],getMessage:[16],emptyText:[1,"empty-text"],findFilterText:[1,"find-filter-text"],buttonClass:[1,"button-class"],_filterArgument:[32],_showAll:[32],hideDetail:[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{getMessage:[16],items:[1040],modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],infoText:[1,"info-text"],useSearch:[4,"use-search"],processModalAction:[16],_filterArgument:[32]}],[1,"snk-select-box",{selectedOption:[1,"selected-option"]}],[6,"snk-taskbar",{configName:[1,"config-name"],buttons:[1],customButtons:[16],actionsList:[16],primaryButton:[1,"primary-button"],disabledButtons:[16],dataUnit:[16],_permissions:[32]}]]],["p-48bbbd2c",[[2,"snk-form",{configName:[1,"config-name"],recordsValidator:[16],actionsList:[16],taskbarManager:[16],_dataUnit:[32],_dataState:[32],_editionFormConfig:[32],_insertionFormConfig:[32],_showFormConfig:[32],showConfig:[64],hideConfig:[64]}]]],["p-c118ef2a",[[6,"snk-crud",{configName:[1025,"config-name"],actionsList:[16],taskbarManager:[16],recordsValidator:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],enableDataExporter:[4,"enable-data-exporter"],_dataUnit:[32],_dataState:[32],_viewMode:[32],goToView:[64]}]]],["p-a3871147",[[2,"snk-application",{messagesBuilder:[1040],configName:[1,"config-name"],isUserSup:[64],hasAccess:[64],getAllAccess:[64],getStringParam:[64],getIntParam:[64],getFloatParam:[64],getBooleanParam:[64],getDateParam:[64],showPopUp:[64],showModal:[64],closeModal:[64],closePopUp:[64],temOpcional:[64],getConfig:[64],saveConfig:[64],getAttributeFromHTMLWrapper:[64],openApp:[64],createDataunit:[64],getDataUnit:[64],getResourceID:[64],getUserID:[64],alert:[64],error:[64],success:[64],message:[64],confirm:[64],info:[64],loadFormConfig:[64],loadGridConfig:[64],fetchUserAvailableConfigs:[64],fetchLegacyConfig:[64],fetchDefaultConfig:[64],loadTotals:[64],saveGridConfig:[64],getFilterBarConfig:[64],saveFilterBarConfig:[64],saveFormConfig:[64],getDefaultValues:[64],getDefaultValue:[64],executeSearch:[64],executePreparedSearch:[64],isDebugMode:[64]}]]]],e)));
1
+ import{p as e,b as t}from"./p-a77dd79a.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-57895452",[[1,"teste-pesquisa"]]],["p-d96bf6a7",[[2,"snk-data-unit",{dataState:[1040],dataUnitName:[1,"data-unit-name"],entityName:[1,"entity-name"],pageSize:[2,"page-size"],dataUnit:[1040],beforeSave:[16],afterSave:[16],getDataUnit:[64]}]]],["p-d7ae56ce",[[0,"snk-filter-binary-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-91c23d20",[[0,"snk-filter-multi-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-1ccaea51",[[0,"snk-filter-number",{config:[16],value:[2],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-12ebe36a",[[0,"snk-filter-period",{config:[16],value:[8],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-ab4ff312",[[0,"snk-filter-personalized",{config:[16],value:[1040],fix:[16],unfix:[16],show:[64]}]]],["p-e075dba7",[[0,"snk-filter-search",{config:[16],value:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-df5d94c6",[[0,"snk-filter-text",{config:[16],value:[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-187b0d06",[[2,"snk-pesquisa",{searchLoader:[16],selectItem:[16],argument:[1025],_itemList:[32],_startLoading:[32]}]]],["p-1a2533d0",[[2,"snk-config-options",{fieldConfig:[16],idConfig:[513,"id-config"],dataUnit:[16],_defaultType:[32]}]]],["p-82e20fc0",[[6,"snk-tab-config",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],_processedTabs:[32],_activeEditText:[32],_activeEditTextIndex:[32],_actionsHide:[32],_actionsShow:[32]}]]],["p-d3e402d3",[[0,"snk-filter-detail",{config:[1040],getMessage:[16],show:[64]}]]],["p-04581d0c",[[6,"snk-grid",{configName:[1,"config-name"],actionsList:[16],taskbarManager:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],enableDataExporter:[4,"enable-data-exporter"],_dataUnit:[32],_dataState:[32],_gridConfig:[32],_popUpGridConfig:[32],showConfig:[64],hideConfig:[64],setConfig:[64]},[[0,"ezClickDataExporter","ezClickDataExporterHandler"]]],[2,"snk-configurator",{configName:[1,"config-name"],viewMode:[1,"view-mode"],_opened:[32],_permissions:[32],open:[64],close:[64]}],[2,"snk-field-config",{isConfigActive:[16],fieldConfig:[16],modeInsertion:[516,"mode-insertion"],dataUnit:[16]}]]],["p-772f1c44",[[2,"snk-form-config",{dataUnit:[16],formConfig:[16],configName:[513,"config-name"],_formConfigOptions:[32],_fieldConfigSelected:[32],_layoutFormConfig:[32],_fieldsAvailable:[32],_formConfig:[32],_formConfigChanged:[32],_optionFormConfigSelected:[32],_optionFormConfigChanged:[32],_tempGroups:[32]}]]],["p-50c8bcb7",[[2,"snk-filter-bar",{dataUnit:[1040],configName:[1,"config-name"],filterConfig:[1040],allowDefault:[32],scrollerLocked:[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{selectedIndex:[1026,"selected-index"],application:[16],columns:[1040],config:[1040],saveConfig:[64]}],[0,"snk-exporter-email-sender",{getMessage:[16],_config:[32],_opened:[32],_currentStep:[32],open:[64]}],[0,"snk-filter-item",{config:[1040],getMessage:[16],detailIsVisible:[32],showUp:[64],hideDetail:[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[6,"snk-taskbar",{configName:[1,"config-name"],buttons:[1],customButtons:[16],actionsList:[16],primaryButton:[1,"primary-button"],disabledButtons:[16],dataUnit:[16],_permissions:[32]}],[4,"snk-filter-list",{label:[1],iconName:[1,"icon-name"],items:[16],getMessage:[16],emptyText:[1,"empty-text"],findFilterText:[1,"find-filter-text"],buttonClass:[1,"button-class"],_filterArgument:[32],_showAll:[32],hideDetail:[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{getMessage:[16],items:[1040],modalTitle:[1,"modal-title"],modalSubTitle:[1,"modal-sub-title"],cancelButtonLabel:[1,"cancel-button-label"],okButtonLabel:[1,"ok-button-label"],infoText:[1,"info-text"],useSearch:[4,"use-search"],processModalAction:[16],_filterArgument:[32]}],[1,"snk-select-box",{selectedOption:[1,"selected-option"]}],[2,"snk-data-exporter",{provider:[16],_showDropdown:[32],_releasedToExport:[32]}]]],["p-68fcc226",[[2,"snk-form",{configName:[1,"config-name"],recordsValidator:[16],actionsList:[16],taskbarManager:[16],_dataUnit:[32],_dataState:[32],_editionFormConfig:[32],_insertionFormConfig:[32],_showFormConfig:[32],showConfig:[64],hideConfig:[64]}]]],["p-13116d05",[[6,"snk-crud",{configName:[1025,"config-name"],actionsList:[16],taskbarManager:[16],recordsValidator:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],enableDataExporter:[4,"enable-data-exporter"],_dataUnit:[32],_dataState:[32],_viewMode:[32],goToView:[64]}]]],["p-f8fdd16c",[[2,"snk-application",{messagesBuilder:[1040],configName:[1,"config-name"],isUserSup:[64],hasAccess:[64],getAllAccess:[64],getStringParam:[64],getIntParam:[64],getFloatParam:[64],getBooleanParam:[64],getDateParam:[64],showPopUp:[64],showModal:[64],closeModal:[64],closePopUp:[64],temOpcional:[64],getConfig:[64],saveConfig:[64],getAttributeFromHTMLWrapper:[64],openApp:[64],createDataunit:[64],getDataUnit:[64],getResourceID:[64],getUserID:[64],alert:[64],error:[64],success:[64],message:[64],confirm:[64],info:[64],loadFormConfig:[64],loadGridConfig:[64],fetchUserAvailableConfigs:[64],fetchLegacyConfig:[64],fetchDefaultConfig:[64],loadTotals:[64],saveGridConfig:[64],getFilterBarConfig:[64],saveFilterBarConfig:[64],saveFormConfig:[64],getDefaultValues:[64],getDefaultValue:[64],executeSearch:[64],executePreparedSearch:[64],isDebugMode:[64]}]]]],e)));
@@ -1,4 +1,4 @@
1
- export interface Attachment {
1
+ export interface IAttachment {
2
2
  name: string;
3
3
  size?: number;
4
4
  }
@@ -1,7 +1,7 @@
1
- import { Attachment } from "./attachment";
2
- export interface Email {
1
+ import { IAttachment } from "./attachment";
2
+ export interface IEmail {
3
3
  to?: string;
4
4
  subject?: string;
5
5
  message?: string;
6
- attachments?: Array<Attachment>;
6
+ attachments?: Array<IAttachment>;
7
7
  }
@@ -1,9 +1,9 @@
1
- import { Email } from "./email";
2
- import { Report } from "./report";
3
- export interface ExportConfig {
1
+ import { IEmail } from "./email";
2
+ import { IReport } from "./report";
3
+ export interface IExportConfig {
4
4
  format: 'pdf' | 'xlsx' | 'report';
5
5
  type: 'all' | 'page' | 'selection';
6
6
  selectedRows?: number;
7
- reports?: Array<Report>;
8
- email?: Email;
7
+ reports?: Array<IReport>;
8
+ email?: IEmail;
9
9
  }
@@ -1,8 +1,8 @@
1
- import { Email } from "./email";
2
- import { Report } from "./report";
3
- export interface ExportResult {
1
+ import { IEmail } from "./email";
2
+ import { IReport } from "./report";
3
+ export interface IExportResult {
4
4
  format: 'pdf' | 'xlsx' | 'report';
5
5
  type: 'all' | 'page' | 'selection';
6
- report: Report;
7
- email: Email;
6
+ report: IReport;
7
+ email: IEmail;
8
8
  }
@@ -1,4 +1,4 @@
1
- export interface Report {
1
+ export interface IReport {
2
2
  label: string;
3
3
  nuRfe: number;
4
4
  }
@@ -0,0 +1,10 @@
1
+ export declare enum DataExporterOption {
2
+ EXPORT_TO_PDF = "exportToPDF",
3
+ EXPORT_TO_XLS = "exportToXLS",
4
+ EXPORT_CURRENT_PAGE = "exportCurrentPage",
5
+ EXPORT_PAGE_TO_PDF = "exportPageToPDF",
6
+ EXPORT_PAGE_TO_XLS = "exportPageToXLS",
7
+ EXPORT_BY_EMAIL = "exportToEmail",
8
+ EXPORT_PDF_TO_EMAIL = "exportPDFToEmail",
9
+ EXPORT_XLS_TO_EMAIL = "exportXLSToEmail"
10
+ }
@@ -1,9 +1,9 @@
1
1
  import { FunctionalComponent } from "../../../stencil-public-runtime";
2
- import { Email } from "../data/email";
3
- interface EmailInfoStepProps {
2
+ import { IEmail } from "../data/email";
3
+ interface IEmailInfoStepProps {
4
4
  getMessage: (key: string, params?: any) => string;
5
5
  changeInfo: (key: string, value: any) => void;
6
- data?: Email;
6
+ data?: IEmail;
7
7
  }
8
- export declare const EmailInfoStep: FunctionalComponent<EmailInfoStepProps>;
8
+ export declare const EmailInfoStep: FunctionalComponent<IEmailInfoStepProps>;
9
9
  export {};
@@ -1,9 +1,9 @@
1
1
  import { FunctionalComponent } from "../../../stencil-public-runtime";
2
- import { ExportConfig } from "../data/export-config";
3
- interface OptionsStepProps {
2
+ import { IExportConfig } from "../data/export-config";
3
+ interface IOptionsStepProps {
4
4
  getMessage: (key: string, params?: any) => string;
5
5
  changeInfo: (key: string, value: any) => void;
6
- data?: ExportConfig;
6
+ data?: IExportConfig;
7
7
  }
8
- export declare const OptionsStep: FunctionalComponent<OptionsStepProps>;
8
+ export declare const OptionsStep: FunctionalComponent<IOptionsStepProps>;
9
9
  export {};
@@ -0,0 +1,9 @@
1
+ import { Filter, Sort } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
2
+ import IExporterColumnMetadata from "../../../lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IExporterColumnMetadata";
3
+ export interface IExporterProvider {
4
+ getFilters(): Array<Filter>;
5
+ getColumnsMetadata(): Array<IExporterColumnMetadata>;
6
+ getOrders(): Array<Sort>;
7
+ getResourceURI(): string;
8
+ getSelectedNumber(): number;
9
+ }
@@ -0,0 +1,40 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { IExporterProvider } from './interfaces/IExporterProvider';
3
+ export declare class SnkDataExporter {
4
+ private _items;
5
+ private _ezButton;
6
+ private _ezDropdown;
7
+ private _application;
8
+ private _selectedNumber;
9
+ private _itemBuilder;
10
+ private _element;
11
+ private _showDropdown;
12
+ private _releasedToExport;
13
+ /**
14
+ * Provedor das informações para exportação dos dados.
15
+ */
16
+ provider: IExporterProvider;
17
+ /**
18
+ * Evento emitido quando uma opção de exportação for clicada.
19
+ */
20
+ ezClickDataExporter: EventEmitter<any>;
21
+ /**
22
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
23
+ * através de um pequeno modulo na estrutura da aplicação:
24
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
25
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-exporter.msg.ts"
26
+ */
27
+ private getMessage;
28
+ private positionDropdown;
29
+ private closeDropdown;
30
+ private setEvents;
31
+ private controlDropdown;
32
+ private processExporter;
33
+ private getItems;
34
+ private loadDropdown;
35
+ componentWillLoad(): void;
36
+ componentDidLoad(): void;
37
+ componentWillUpdate(): void;
38
+ componentDidUpdate(): void;
39
+ render(): any;
40
+ }
@@ -0,0 +1,61 @@
1
+ import { DataExporterOption } from "../enum/data-exporter-option";
2
+ export declare class ItemBuilder {
3
+ private _getMessage;
4
+ private _selectedNumber;
5
+ constructor(getMessage: (key: string, params?: any) => string, selectedNumber: number);
6
+ /**
7
+ * Método responsável por inserir os items no array de opções.
8
+ * @param option - Nome da opção que será inserida no array.
9
+ * @param items - Array que será alimentado com as opções permitidas.
10
+ */
11
+ setExportOption(option: DataExporterOption, items: Array<any>): void;
12
+ /**
13
+ * Método responsável por inserir os itens de exportação personalizada.
14
+ * @param option - Nome da opção que será inserida no array.
15
+ * @param items - Array que será alimentado com as opções permitidas.
16
+ */
17
+ private setExportCurrentPage;
18
+ /**
19
+ * Método responsável por inserir os itens de exportação por e-mail.
20
+ * @param option - Nome da opção que será inserida no array.
21
+ * @param items - Array que será alimentado com as opções permitidas.
22
+ */
23
+ private setExportByEmail;
24
+ /**
25
+ * Método responsável por capturar o objeto com os dados de exportação em PDF.
26
+ * @param groupName - Nome do grupo da opção que será inserida na lista.
27
+ * @returns Retorna o objeto com os dados de exportação em PDF.
28
+ */
29
+ private getExportToPDF;
30
+ /**
31
+ * Método responsável por capturar o objeto com os dados de exportação em XLS.
32
+ * @param groupName - Nome do grupo da opção que será inserida na lista.
33
+ * @returns Retorna o objeto com os dados de exportação em XLS.
34
+ */
35
+ private getExportToXLS;
36
+ /**
37
+ * Método responsável por capturar o objeto com os dados de exportação personalizada.
38
+ * @returns Retorna o objeto com os dados de exportação personalizada.
39
+ */
40
+ private getCurrentPage;
41
+ /**
42
+ * Método responsável por capturar o objeto com os dados de exportação personalizada em PDF.
43
+ * @returns Retorna o objeto com os dados de exportação personalizada em PDF.
44
+ */
45
+ private getExportPageToPDF;
46
+ /**
47
+ * Método responsável por capturar o objeto com os dados de exportação personalizada em XLS.
48
+ * @returns Retorna o objeto com os dados de exportação personalizada em XLS.
49
+ */
50
+ private getExportPageToXLS;
51
+ /**
52
+ * Método responsável por capturar o objeto com os dados de exportação por e-mail.
53
+ * @returns Retorna o objeto com os dados de exportação por e-mail.
54
+ */
55
+ private getExportByEmail;
56
+ /**
57
+ * Método responsável por capturar o nome do grupo da opção que será inserida na lista.
58
+ * @returns Retorna o nome do grupo da opção que será inserida na lista.
59
+ */
60
+ private getExportGroupName;
61
+ }
@@ -14,7 +14,7 @@ export declare enum TaskbarElement {
14
14
  MORE_OPTIONS = "MORE_OPTIONS",
15
15
  DIVIDER = "DIVIDER",
16
16
  CONFIGURATOR = "CONFIGURATOR",
17
- EXPORT = "EXPORT"
17
+ DATA_EXPORTER = "DATA_EXPORTER"
18
18
  }
19
19
  export declare enum AuthorizationElements {
20
20
  UPDATE = "UPDATE",
@@ -27,4 +27,4 @@ export declare enum VisibleWhenForbidden {
27
27
  CONFIGURATOR = "CONFIGURATOR"
28
28
  }
29
29
  export declare const buildCustomButton: (def: CustomButton, className: string, dataElementId: string, action: (name: string) => void, isEnabled: (name: string) => boolean) => HTMLElement;
30
- export declare const buildElem: (element: TaskbarElement, className: string, dataElementId: string, getTitle: (name: string) => string, action: (name: string) => void, isEnabled: (name: string) => boolean, actions: Array<Action>) => HTMLElement;
30
+ export declare const buildElem: (element: TaskbarElement, className: string, dataElementId: string, getTitle: (name: string) => string, action: (name: string) => void, isEnabled: (name: string) => boolean, actions: Array<Action>, configName: string) => HTMLElement;
@@ -55,7 +55,7 @@ export declare class SnkTaskbar {
55
55
  GRID_MODE: string;
56
56
  FORM_MODE: string;
57
57
  CONFIGURATOR: string;
58
- EXPORT: string;
58
+ DATA_EXPORTER: string;
59
59
  };
60
60
  observeButtons(): void;
61
61
  elementsFromString(strButtons: string): Array<TaskbarElement>;
@@ -16,9 +16,10 @@ import { SnkFilterItemConfig } from "./components/snk-filter-bar/filter-item/snk
16
16
  import { IOption, ISearchArgument } from "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box";
17
17
  import { SearchCriteria } from "./lib/http/data-fetcher/fetchers/pesquisa-fetcher";
18
18
  import { Action, TaskbarManager } from "./components/snk-taskbar/snk-taskbar";
19
+ import { IExporterProvider } from "./components/snk-data-exporter/interfaces/IExporterProvider";
19
20
  import { DataState } from "./components/snk-data-unit/snk-data-unit";
20
- import { ExportResult } from "./components/snk-data-exporter/data/export-result";
21
- import { ExportConfig } from "./components/snk-data-exporter/data/export-config";
21
+ import { IExportResult } from "./components/snk-data-exporter/data/export-result";
22
+ import { IExportConfig } from "./components/snk-data-exporter/data/export-config";
22
23
  import { SnkFilterItemConfig as SnkFilterItemConfig1 } from "./components/snk-filter-bar/filter-item/snk-filter-item";
23
24
  import { ListItem } from "./components/snk-filter-bar/filter-list/snk-filter-list";
24
25
  import { ModalItem } from "./components/snk-filter-bar/filter-modal/snk-filter-modal";
@@ -271,6 +272,12 @@ export namespace Components {
271
272
  */
272
273
  "taskbarManager": TaskbarManager;
273
274
  }
275
+ interface SnkDataExporter {
276
+ /**
277
+ * Provedor das informações para exportação dos dados.
278
+ */
279
+ "provider": IExporterProvider;
280
+ }
274
281
  interface SnkDataUnit {
275
282
  /**
276
283
  * Executado após a ação de salvar.
@@ -307,7 +314,7 @@ export namespace Components {
307
314
  }
308
315
  interface SnkExporterEmailSender {
309
316
  "getMessage": (key: string, params?: any) => string;
310
- "open": (config: ExportConfig) => Promise<ExportResult>;
317
+ "open": (config: IExportConfig) => Promise<IExportResult>;
311
318
  }
312
319
  interface SnkFieldConfig {
313
320
  /**
@@ -724,6 +731,10 @@ export interface SnkCrudCustomEvent<T> extends CustomEvent<T> {
724
731
  detail: T;
725
732
  target: HTMLSnkCrudElement;
726
733
  }
734
+ export interface SnkDataExporterCustomEvent<T> extends CustomEvent<T> {
735
+ detail: T;
736
+ target: HTMLSnkDataExporterElement;
737
+ }
727
738
  export interface SnkDataUnitCustomEvent<T> extends CustomEvent<T> {
728
739
  detail: T;
729
740
  target: HTMLSnkDataUnitElement;
@@ -797,6 +808,12 @@ declare global {
797
808
  prototype: HTMLSnkCrudElement;
798
809
  new (): HTMLSnkCrudElement;
799
810
  };
811
+ interface HTMLSnkDataExporterElement extends Components.SnkDataExporter, HTMLStencilElement {
812
+ }
813
+ var HTMLSnkDataExporterElement: {
814
+ prototype: HTMLSnkDataExporterElement;
815
+ new (): HTMLSnkDataExporterElement;
816
+ };
800
817
  interface HTMLSnkDataUnitElement extends Components.SnkDataUnit, HTMLStencilElement {
801
818
  }
802
819
  var HTMLSnkDataUnitElement: {
@@ -946,6 +963,7 @@ declare global {
946
963
  "snk-config-options": HTMLSnkConfigOptionsElement;
947
964
  "snk-configurator": HTMLSnkConfiguratorElement;
948
965
  "snk-crud": HTMLSnkCrudElement;
966
+ "snk-data-exporter": HTMLSnkDataExporterElement;
949
967
  "snk-data-unit": HTMLSnkDataUnitElement;
950
968
  "snk-exporter-email-sender": HTMLSnkExporterEmailSenderElement;
951
969
  "snk-field-config": HTMLSnkFieldConfigElement;
@@ -1061,6 +1079,16 @@ declare namespace LocalJSX {
1061
1079
  */
1062
1080
  "taskbarManager"?: TaskbarManager;
1063
1081
  }
1082
+ interface SnkDataExporter {
1083
+ /**
1084
+ * Evento emitido quando uma opção de exportação for clicada.
1085
+ */
1086
+ "onEzClickDataExporter"?: (event: SnkDataExporterCustomEvent<any>) => void;
1087
+ /**
1088
+ * Provedor das informações para exportação dos dados.
1089
+ */
1090
+ "provider"?: IExporterProvider;
1091
+ }
1064
1092
  interface SnkDataUnit {
1065
1093
  /**
1066
1094
  * Executado após a ação de salvar.
@@ -1533,6 +1561,7 @@ declare namespace LocalJSX {
1533
1561
  "snk-config-options": SnkConfigOptions;
1534
1562
  "snk-configurator": SnkConfigurator;
1535
1563
  "snk-crud": SnkCrud;
1564
+ "snk-data-exporter": SnkDataExporter;
1536
1565
  "snk-data-unit": SnkDataUnit;
1537
1566
  "snk-exporter-email-sender": SnkExporterEmailSender;
1538
1567
  "snk-field-config": SnkFieldConfig;
@@ -1567,6 +1596,7 @@ declare module "@stencil/core" {
1567
1596
  "snk-config-options": LocalJSX.SnkConfigOptions & JSXBase.HTMLAttributes<HTMLSnkConfigOptionsElement>;
1568
1597
  "snk-configurator": LocalJSX.SnkConfigurator & JSXBase.HTMLAttributes<HTMLSnkConfiguratorElement>;
1569
1598
  "snk-crud": LocalJSX.SnkCrud & JSXBase.HTMLAttributes<HTMLSnkCrudElement>;
1599
+ "snk-data-exporter": LocalJSX.SnkDataExporter & JSXBase.HTMLAttributes<HTMLSnkDataExporterElement>;
1570
1600
  "snk-data-unit": LocalJSX.SnkDataUnit & JSXBase.HTMLAttributes<HTMLSnkDataUnitElement>;
1571
1601
  "snk-exporter-email-sender": LocalJSX.SnkExporterEmailSender & JSXBase.HTMLAttributes<HTMLSnkExporterEmailSenderElement>;
1572
1602
  "snk-field-config": LocalJSX.SnkFieldConfig & JSXBase.HTMLAttributes<HTMLSnkFieldConfigElement>;
@@ -0,0 +1,3 @@
1
+ import IFetchDataExporterParams from "./interfaces/IFetchDataExporterParams";
2
+ import IFetchDataExporterResponse from "./interfaces/IFetchDataExporterResponse";
3
+ export default function fetchDataExporter({ methodName, ...requestBody }: IFetchDataExporterParams): Promise<IFetchDataExporterResponse | Error>;
@@ -0,0 +1,9 @@
1
+ import { DataType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
2
+ import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
3
+ export default interface IExporterColumnMetadata {
4
+ label: string;
5
+ id: string;
6
+ width: number;
7
+ dataType: DataType;
8
+ userInterface: UserInterface;
9
+ }
@@ -0,0 +1,14 @@
1
+ import { Filter, Sort } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
2
+ import IExporterColumnMetadata from "./IExporterColumnMetadata";
3
+ export default interface IFetchDataExporterParams {
4
+ filters: Array<Filter>;
5
+ columns: Array<IExporterColumnMetadata>;
6
+ sort: Array<Sort>;
7
+ resourceURI: string;
8
+ methodName: string;
9
+ offset?: number;
10
+ limit?: number;
11
+ to?: string;
12
+ subject?: string;
13
+ message?: string;
14
+ }