@sankhyalabs/sankhyablocks 5.18.1 → 5.19.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 (40) hide show
  1. package/dist/cjs/{dataunit-fetcher-8f5ade55.js → dataunit-fetcher-01fabb36.js} +28 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  4. package/dist/cjs/snk-application.cjs.entry.js +10 -1
  5. package/dist/cjs/snk-attach.cjs.entry.js +2 -1
  6. package/dist/cjs/snk-configurator.cjs.entry.js +5 -4
  7. package/dist/cjs/snk-grid.cjs.entry.js +39 -5
  8. package/dist/collection/components/snk-application/snk-application.js +40 -0
  9. package/dist/collection/components/snk-configurator/snk-configurator.js +5 -4
  10. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +29 -0
  11. package/dist/collection/components/snk-grid/snk-grid.js +11 -5
  12. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +28 -0
  13. package/dist/components/dataunit-fetcher.js +28 -0
  14. package/dist/components/snk-application2.js +10 -1
  15. package/dist/components/snk-configurator2.js +5 -4
  16. package/dist/components/snk-grid2.js +42 -8
  17. package/dist/esm/{dataunit-fetcher-d32c6a47.js → dataunit-fetcher-784325e9.js} +28 -0
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/esm/sankhyablocks.js +1 -1
  20. package/dist/esm/snk-application.entry.js +10 -1
  21. package/dist/esm/snk-attach.entry.js +2 -1
  22. package/dist/esm/snk-configurator.entry.js +5 -4
  23. package/dist/esm/snk-grid.entry.js +42 -8
  24. package/dist/sankhyablocks/p-538c057a.entry.js +1 -0
  25. package/dist/sankhyablocks/p-553f5dcf.js +76 -0
  26. package/dist/sankhyablocks/p-82bc4666.entry.js +1 -0
  27. package/dist/sankhyablocks/{p-cbe93a18.entry.js → p-8652d177.entry.js} +3 -3
  28. package/dist/sankhyablocks/p-971abcc2.entry.js +1 -0
  29. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  30. package/dist/types/components/snk-application/snk-application.d.ts +6 -0
  31. package/dist/types/components/snk-configurator/snk-configurator.d.ts +6 -5
  32. package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +12 -0
  33. package/dist/types/components/snk-grid/snk-grid.d.ts +3 -0
  34. package/dist/types/components.d.ts +4 -0
  35. package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +1 -0
  36. package/package.json +1 -1
  37. package/dist/sankhyablocks/p-44cf545f.entry.js +0 -1
  38. package/dist/sankhyablocks/p-eb07d0eb.entry.js +0 -1
  39. package/dist/sankhyablocks/p-f821768b.js +0 -74
  40. package/dist/sankhyablocks/p-fa2d0376.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
2
- import { ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
3
- import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
2
+ import { UserInterface, DateUtils, ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
3
+ import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
4
4
  import { T as TaskbarElement } from './taskbar-elements-8ff33c26.js';
5
5
  import { C as ConfigStorage } from './ConfigStorage-e6c17998.js';
6
6
  import { P as PresentationMode } from './index-507e19ec.js';
@@ -13,6 +13,35 @@ import './resource-fetcher-02642924.js';
13
13
  import './filter-bar-config-fetcher-edc48f4b.js';
14
14
  import './filter-item-type.enum-5028ed3f.js';
15
15
 
16
+ class SnkMultiSelectionListDataSource {
17
+ setDataUnit(dataUnit) {
18
+ this._dataUnit = dataUnit;
19
+ }
20
+ setApplication(application) {
21
+ this._application = application;
22
+ }
23
+ formatLabel(fieldName, value) {
24
+ const { userInterface } = this._dataUnit.getField(fieldName);
25
+ if (userInterface === UserInterface.DATETIME) {
26
+ return DateUtils.formatDate(this._dataUnit.valueFromString(fieldName, value));
27
+ }
28
+ return String(this._dataUnit.getFormattedValue(fieldName, value));
29
+ }
30
+ fetchData(filterTerm, fieldName) {
31
+ return new Promise(resolve => {
32
+ this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
33
+ resolve(result.map(item => {
34
+ const field = this._dataUnit.getField(fieldName);
35
+ if (field.userInterface === UserInterface.SEARCH) {
36
+ return Object.assign(Object.assign({}, JSON.parse(item)), { check: true });
37
+ }
38
+ return { value: item, label: this.formatLabel(fieldName, item), check: true };
39
+ }));
40
+ });
41
+ });
42
+ }
43
+ }
44
+
16
45
  const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:300px}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
17
46
 
18
47
  const SnkGrid = class {
@@ -20,6 +49,7 @@ const SnkGrid = class {
20
49
  registerInstance(this, hostRef);
21
50
  this.actionClick = createEvent(this, "actionClick", 7);
22
51
  this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
52
+ this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
23
53
  this._topTaskbarProcessor = new TaskbarProcessor({
24
54
  "snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
25
55
  "snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
@@ -144,7 +174,7 @@ const SnkGrid = class {
144
174
  id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
145
175
  width: 200,
146
176
  type: DataType.TEXT,
147
- userInterface: UserInterface.LONGTEXT
177
+ userInterface: UserInterface$1.LONGTEXT
148
178
  };
149
179
  columnsMetadata.push(descriptionColumn);
150
180
  }
@@ -216,6 +246,12 @@ const SnkGrid = class {
216
246
  const dataInfo = { dataUnit: this._dataUnit };
217
247
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
218
248
  }
249
+ finshLoading() {
250
+ this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
251
+ this.addElementID();
252
+ this._multiSelectionListDataSource.setApplication(this._application);
253
+ this._multiSelectionListDataSource.setDataUnit(this._dataUnit);
254
+ }
219
255
  componentWillLoad() {
220
256
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
221
257
  let parent = this._element.parentElement;
@@ -226,13 +262,11 @@ const SnkGrid = class {
226
262
  if (!this._dataUnit) {
227
263
  this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
228
264
  this._dataUnit = evt.detail;
229
- this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
230
- this.addElementID();
265
+ this.finshLoading();
231
266
  });
232
267
  }
233
268
  else {
234
- this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
235
- this.addElementID();
269
+ this.finshLoading();
236
270
  }
237
271
  this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
238
272
  this._dataState = evt.detail;
@@ -292,7 +326,7 @@ const SnkGrid = class {
292
326
  return undefined;
293
327
  }
294
328
  return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
295
- h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton() })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady() }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
329
+ h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton() })), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
296
330
  }
297
331
  get _element() { return getElement(this); }
298
332
  };
@@ -0,0 +1 @@
1
+ import{r as t,c as e,h as i}from"./p-b9667fbe.js";import{ApplicationContext as s,DataType as n,Action as a}from"@sankhyalabs/core";import{D as r}from"./p-41d92871.js";import{c as o}from"./p-17375123.js";import{D as h}from"./p-553f5dcf.js";import{T as l}from"./p-19692f92.js";import"./p-112455b1.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-4c2015a9.js";import"./p-6a02e236.js";var d;!function(t){t.LINK_AND_FILE_AT_THE_SAME_TIME="LINK_AND_FILE_AT_THE_SAME_TIME",t.ANY_LINK_OR_FILE_FILLED="ANY_LINK_OR_FILE_FILLED",t.UNKNOWN="UNKNOWN"}(d||(d={}));class c{constructor(t,e,i){var s;this.entityName=t,this.registerKey=e,this.dataUnitName=i,this.validateFields=t=>{if(t.LINK&&t.NOMEARQUIVO)throw new Error(d.LINK_AND_FILE_AT_THE_SAME_TIME);if(!t.LINK&&!t.NOMEARQUIVO)throw new Error(d.ANY_LINK_OR_FILE_FILLED);if(!this.registerKey)throw new Error("Register key can not be null")},this.resourceID=window.resourceID||(null===(s=window.workspace)||void 0===s?void 0:s.resourceID)}async save(t){var e,i;const s="AnexoSistemaSP.salvar";let{updatingFields:n}=t;n=Object.assign(Object.assign({},n),{NOMEARQUIVO:null===(e=n.NOMEARQUIVO)||void 0===e?void 0:e[0]});try{this.validateFields(n);const t=n.LINK?null:n.NOMEARQUIVO,e={serviceName:s,requestBody:{params:{resourceID:this.resourceID,description:n.DESCRICAO,fileSelect:t?1:0,keySession:null===(i=null==t?void 0:t.properties)||void 0===i?void 0:i.fileNameTmp,nameAttach:null==t?void 0:t.name,link:n.LINK,nameEntity:this.entityName,pkEntity:this.registerKey,typeAcess:n.TIPOACESSO,typeApres:n.TIPOAPRES}}},a=await r.get().callServiceBroker(s,JSON.stringify(e));return Promise.resolve([Object.assign(Object.assign(Object.assign({},a),n),{ARQUIVOOULINK:n.LINK?n.LINK:null==t?void 0:t.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}async edit(t){var e,i,s;const n="AnexoSistemaSP.salvar";let{updatingFields:a,record:o}=t;const h=t=>void 0!==a[t]?a[t]:o[t],l=h("NOMEARQUIVO"),d=null===(i=null===(e=a.NOMEARQUIVO)||void 0===e?void 0:e[0])||void 0===i?void 0:i.downloadURL;a=Object.assign(Object.assign({},a),{DESCRICAO:h("DESCRICAO"),LINK:h("LINK"),TIPOACESSO:h("TIPOACESSO"),TIPOAPRES:h("TIPOAPRES"),CHAVEARQUIVO:o.CHAVEARQUIVO,NOMEARQUIVO:null==l?void 0:l[0]});const c=a.LINK?null:a.NOMEARQUIVO;try{this.validateFields(a);const t={serviceName:n,requestBody:{params:{resourceID:this.resourceID,nuAttach:null==o?void 0:o.NUATTACH,description:a.DESCRICAO,fileSelect:d?1:0,keySession:null===(s=null==c?void 0:c.properties)||void 0===s?void 0:s.fileNameTmp,keyAttach:a.CHAVEARQUIVO,nameAttach:null==c?void 0:c.name,link:a.LINK,nameEntity:this.entityName,pkEntity:this.registerKey,typeAcess:a.TIPOACESSO,typeApres:a.TIPOAPRES}}},e=await r.get().callServiceBroker(n,JSON.stringify(t));return Promise.resolve([Object.assign(Object.assign(Object.assign({},e),a),{ARQUIVOOULINK:a.LINK?a.LINK:null==c?void 0:c.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}delete(t){var e;const i="AnexoSistemaSP.excluir",s=(null===(e=t.NOMEARQUIVO)||void 0===e?void 0:e[0])||{},n={serviceName:i,requestBody:{paramsDelete:{keyAttach:t.CHAVEARQUIVO,nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO}}};return new Promise(((t,e)=>{r.get().callServiceBroker(i,JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}getDownloadKey(t){var e;const i="AnexoSistemaSP.baixar",s=(null===(e=t.NOMEARQUIVO)||void 0===e?void 0:e[0])||{},n={serviceName:i,requestBody:{paramsDown:{nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO,keyAttach:t.CHAVEARQUIVO}}};return new Promise(((t,e)=>{r.get().callServiceBroker(i,JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}}class m{constructor(t,e){this.entityName=t,this.getMessage=e,this._application=s.getContextValue("__SNK__APPLICATION__")}initLoaders(t,e,i){this.loader||(this.loader=t.dataLoader),t.dataLoader=(t,e)=>this.dataLoader(t,e),t.saveLoader=(t,s)=>this.saveLoader(s,e).then((t=>(t.length&&i(),t))),t.removeLoader=(t,s)=>this.removeLoader(t,s,e).then((t=>(t.length&&i(),t)))}dataLoader(t,e){return new Promise((i=>{this.loader(t,e).then((t=>{const e=((null==t?void 0:t.records)||[]).map((t=>{let e;return t.LINK||(e=[{name:t.NOMEARQUIVO}]),Object.assign(Object.assign({},t),{ARQUIVOOULINK:t.LINK?t.LINK:t.NOMEARQUIVO,NOMEARQUIVO:e})}));i(Object.assign(Object.assign({},t),{records:e}))}))}))}saveLoader(t,e){return new Promise((i=>{var s;const n=Array.isArray(t)?t[0]:{};((null===(s=null==n?void 0:n.record)||void 0===s?void 0:s.NUATTACH)>=0?e.edit.bind(e):e.save.bind(e))(n).then((t=>{i(t)})).catch((t=>t.message===d.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),i([])):t.message===d.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),i([])):t.message?(this._application.error(t.title||t.name,t.message),i([])):void i([])))}))}removeLoader(t,e,i){return new Promise((s=>{const{records:n}=t.getSelectionInfo();i.delete(n[0]).then((()=>s(e)))}))}getFilters(t){return[{name:"AttachmentsByPK",expression:"this.PKREGISTRO = :PKREGISTRO",params:[{name:"PKREGISTRO",dataType:n.TEXT,value:`${t}_${this.entityName}`}]}]}getInterceptions(t,e,i){return new Promise((s=>e.type===a.EDITION_CANCELED?t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(i.goToView(o.GRID),s(e)):s(void 0))):s(e):e.type===a.DATA_SAVED?(t.loadData(),s(e)):void s(e)))}}const u=s.getContextValue("__SNK__APPLICATION__"),v=t=>{var e,i;return null===(i=null===(e=null==u?void 0:u.messagesBuilder)||void 0===e?void 0:e.getMessage)||void 0===i?void 0:i.call(e,t,null)},A={DOWNLOAD:{hint:v("snkAttach.taskbar.titleDownload"),name:"DOWNLOAD",iconName:"file-download"},LINK:{hint:v("snkAttach.taskbar.titleLink"),name:"LINK",iconName:"launch"}},O=()=>{const t=[l.REMOVE,"DOWNLOAD","LINK"];return{getButtons:(t,e,i)=>{if((null==e?void 0:e.insertionMode)||(null==e?void 0:e.isDirty))return i.reverse();i.splice(i.indexOf(l.REFRESH),1);const{selectedRecord:s}=e||{},n=(null==s?void 0:s.LINK)?A.LINK:A.DOWNLOAD;i.splice(i.indexOf(l.DIVIDER)+1,0,l.REMOVE,n,l.DIVIDER);const a=Array.from(new Set(i.filter((t=>t!==l.CLONE))));return a.splice(a.indexOf(n)+1,0,l.DIVIDER),a},isEnabled:(e,i,s)=>{const n=void 0!==(null==i?void 0:i.selectedRecord);return!(t.includes(s)&&!n)}}},I={grid:{columns:[{name:"ARQUIVOOULINK",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"DHCAD",orderIndex:2,width:0},{name:"DHALTER",orderIndex:3,width:0},{name:"TIPOAPRES",orderIndex:4,width:0},{name:"TIPOACESSO",orderIndex:5,width:0},{name:"CODUSU",orderIndex:6,width:0},{name:"CODUSUALT",orderIndex:7,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",required:!0},{name:"TIPOAPRES",required:!0},{name:"TIPOACESSO",required:!0},{name:"LINK"},{name:"NOMEARQUIVO"}]}},_=class{constructor(i){t(this,i),this.back=e(this,"back",7),this.handleTaskbarClick=({detail:t})=>{if(["DOWNLOAD","LINK"].includes(t))return this.downloadAttachment(this.dataUnit.getSelectedRecord())},this.handleBack=()=>{this.dataUnit.cancelEdition().then((t=>{t&&this.back.emit()}))},this.handleFinish=()=>{if(!this.dataUnit.isDirty())return this.back.emit();this.dataUnit.saveData().then((()=>{this.showFinishedToast(),this.back.emit()}))},this.registerKey=void 0,this.entityName=void 0,this.messagesBuilder=void 0,this.dataUnit=void 0,this.crudConfig=void 0}registerKeyWatcher(t,e){var i;e!==t&&(this.returnToGridMode(),this._attachFetcher=new c(this.entityName,this.registerKey,null===(i=this.dataUnit)||void 0===i?void 0:i.name),this._dataUnitBuilder.initLoaders(this.dataUnit,this._attachFetcher,(()=>{this.returnToGridMode()})),this.dataUnit.loadData())}getMessage(t,e){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,e)}showFinishedToast(){this._application.info(this.getMessage("snkAttach.finishedMessage"),{iconName:"check"})}downloadAttachment(t){if(!t)throw new Error("Nenhum registro selecionado");t.LINK?window.open(`${t.LINK}`):this._attachFetcher.getDownloadKey(t).then((({chave:t})=>{window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${t.valor}&forcarDownload=S`)}))}returnToGridMode(){this.dataUnit.clearSelection(),this._crudElement&&this._crudElement.goToView(o.GRID)}loadAttachmentDataUnit(){var t;try{const e=this.dataUnit||(new h).getDataUnit("AnexoSistema","br.com.sankhya.core.v3.anexoSistema");return this._attachFetcher=new c(this.entityName,this.registerKey,null===(t=this.dataUnit)||void 0===t?void 0:t.name),e.metadata||e.loadMetadata().then((()=>{this.crudConfig=I})),this._dataUnitBuilder=new m(this.entityName,this.getMessage.bind(this)),e.addFilterProvider({getFilter:()=>this._dataUnitBuilder.getFilters(this.registerKey)}),e.addInterceptor({interceptAction:t=>this._dataUnitBuilder.getInterceptions(e,t,this._crudElement)}),this.dataUnit=e,this.dataUnit.loadData(),this.dataUnit}catch(t){throw new Error("There was an error while creating the data unit")}}componentWillLoad(){this._application=s.getContextValue("__SNK__APPLICATION__"),this.loadAttachmentDataUnit()}render(){var t,e;return this.dataUnit?i("main",null,i("header",{class:"snk-attach__header"},i("snk-simple-bar",{onExit:this.handleBack,messagesBuilder:this.messagesBuilder},i("div",{slot:"rightSlot"},i("ez-button",{class:"ez-button--primary",label:this.getMessage("snkAttach.finish"),onClick:this.handleFinish})))),i("div",{class:"snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column"},i("div",{class:"ez-box__container"},i("snk-simple-crud",{ref:t=>this._crudElement=t,dataUnit:this.dataUnit,taskbarManager:O(),gridConfig:null===(t=this.crudConfig)||void 0===t?void 0:t.grid,formConfig:null===(e=this.crudConfig)||void 0===e?void 0:e.form,useCancelConfirm:!1,onActionClick:this.handleTaskbarClick},i("div",{slot:"snkSimpleCrudHeader"},i("div",{class:"ez-flex ez-flex--column"},i("span",{class:"ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium"},this.getMessage("snkAttach.title")),i("span",{class:"ez-text ez-text--medium ez-text--secondary"},this.getMessage("snkAttach.description")))))))):null}static get watchers(){return{registerKey:["registerKeyWatcher"]}}};_.style=".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}";export{_ as snk_attach}
@@ -0,0 +1,76 @@
1
+ import{DataUnit as e,StringUtils as t,DataType as a,DataUnitStorage as r,ChangeOperation as i}from"@sankhyalabs/core";import{d as n,D as s}from"./p-41d92871.js";import{DISTINCT_FILTER_NAME_PREFIX as o}from"@sankhyalabs/ezui/dist/collection/utils/constants";class l{constructor(){this.templateByQuery=new Map,this._loadDataTimeout={},this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",n.gql`query($name: String!) {
2
+ $queryAlias$: fetchDataUnit(name: $name){
3
+ name
4
+ fields{
5
+ name
6
+ defaultValue
7
+ label
8
+ visible
9
+ readOnly
10
+ required
11
+ dataType
12
+ userInterface
13
+ calculated
14
+ group
15
+ order
16
+ properties{
17
+ name
18
+ value
19
+ }
20
+ dependencies{
21
+ masterFields
22
+ type
23
+ expression
24
+ }
25
+ }
26
+ children{
27
+ name
28
+ label
29
+ links{
30
+ source
31
+ target
32
+ }
33
+ }
34
+ }
35
+ }`),this.templateByQuery.set("fetchData",n.gql`query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!] $parentRecordId: String) {
36
+ $queryAlias$: fetchDataUnit(name: $dataunit){
37
+ data(limit: $limit offset: $offset filters: $filters sort: $sort parentRecordId: $parentRecordId){
38
+ limit
39
+ offset
40
+ total
41
+ hasMore
42
+ records{
43
+ id
44
+ label
45
+ fields {
46
+ name
47
+ value
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }`),this.templateByQuery.set("saveData",n.gql`mutation($changes: [InputBatchChange!]!) {
53
+ $queryAlias$: batchOperationDataUnit(changes: $changes){
54
+ oldId
55
+ id
56
+ label
57
+ ownerDataUnitName
58
+ fields {
59
+ name
60
+ value
61
+ }
62
+ }
63
+ }`),this.templateByQuery.set("fetchDataRecord",n.gql`query($dataunit: String! $recordID: [String!]) {
64
+ $queryAlias$: fetchDataUnit(name: $dataunit){
65
+ record(id: $recordID){
66
+ id
67
+ label
68
+ fields {
69
+ name
70
+ value
71
+ }
72
+ }
73
+ }
74
+ }`),this.templateByQuery.set("fetchDistinctColumn",n.gql`query($dataUnit: String!, $fieldName: String!, $argument: String, $filters: [InputFilter], $parentRecordId: String) {
75
+ $queryAlias$: selectDistinct(dataUnit: $dataUnit, fieldName: $fieldName, argument: $argument, filters: $filters, parentRecordId: $parentRecordId)
76
+ }`)}getDataUnit(t,a,r){const i=null!=r?r.getChildDataunit(`dd://${t}/${a}`):new e(`dd://${t}/${a}`);return i.metadataLoader=e=>this.loadMetadata(e),i.dataLoader=(e,t)=>this.loadData(e,t),i.saveLoader=(e,t)=>this.saveData(i,t),i.removeLoader=(e,t)=>this.removeRecords(e,t),i.recordLoader=(e,t)=>this.loadRecord(e,t),i}loadMetadata(e){return new Promise(((t,a)=>{s.get().callGraphQL({values:{name:e.name},query:this.templateByQuery.get("fetchDataUnit")}).then((e=>{var a;const r={name:e.name,label:e.name,children:[...e.children],fields:[]};null===(a=e.fields)||void 0===a||a.forEach((e=>{let t;Array.isArray(e.properties)&&(t={},e.calculated&&(t.gridHeaderTooltip="Campos calculados não podem ser ordenados"),e.properties.forEach((e=>t[e.name]=e.value))),r.fields.push(Object.assign(Object.assign({},e),{properties:t}))})),r.fields.sort(((e,t)=>e.order-t.order)),t(r)})).catch((e=>{a(e)}))}))}loadData(e,t){const a=e.name;return this._loadDataTimeout[a]&&(clearTimeout(this._loadDataTimeout[a]),delete this._loadDataTimeout[a]),new Promise(((r,i)=>{this._loadDataTimeout[a]=setTimeout((()=>{delete this._loadDataTimeout[a],this.doLoadData(e,t).then((e=>r(e))).catch((e=>i(e)))}),200)}))}loadSelectDistinct(e,t,a){const{parentRecordId:r,filters:i}=e.getLastLoadRequest()||{},n=i.filter((e=>e.name!==`${o}${t}`)),l={dataUnit:e.name,argument:a,fieldName:t,parentRecordId:r,filters:n};return new Promise(((e,t)=>{s.get().callGraphQL({values:l,query:this.templateByQuery.get("fetchDistinctColumn")}).then((t=>{e(t)})).catch((e=>{t(e)}))}))}doLoadData(e,r){return new Promise(((i,n)=>{var o;const{sort:l,filters:d,limit:c,offset:u,quickFilter:m}=r,f={dataunit:e.name,sort:l,filters:d};if(f.limit=c,f.offset=u,f.parentRecordId=r.parentRecordId,!t.isEmpty(null==m?void 0:m.term)){void 0===f.filter&&(f.filter=[]);const e={name:"__QUICK_FILTER__",expression:"__QUICK_FILTER__",params:[{name:"term",dataType:a.TEXT,value:m.term}]};(null===(o=null==m?void 0:m.fields)||void 0===o?void 0:o.length)>0&&e.params.push({name:"fields",dataType:a.OBJECT,value:m.fields}),f.filter.push(e)}s.get().callGraphQL({values:f,query:this.templateByQuery.get("fetchData")}).then((t=>{const{limit:a,offset:r,total:n,hasMore:s,records:o}=t.data;let l;a&&(l={firstRecord:0==n?0:r+1,lastRecord:r+Math.min(o.length,a),total:n,currentPage:r/a,hasMore:s});const d=[];o.forEach((t=>{const a={__record__id__:t.id,__record__label__:t.label};t.fields.forEach((({name:t,value:r})=>{a[t]=e.valueFromString(t,r)})),d.push(a)})),i({paginationInfo:l,records:d})})).catch((e=>{n(e)}))}))}saveData(e,t){const i=t.map((e=>{const{dataUnit:t,record:i,updatingFields:n,operation:s}=e,o=r.get(t);let l;n&&(l=Object.entries(n).map((([e,t])=>{const r=o.getField(e);return{fieldName:e,dataType:r?r.dataType:a.TEXT,value:o.valueToString(e,t)}})));const d={dataUnit:t,fields:l,operation:s,recordId:i.__record__id__};return e.sourceId&&(d.sourceId=e.sourceId),i.__parent__record__id__&&(d.parentRecordId=i.__parent__record__id__),d}));return new Promise(((t,a)=>{const n=i.map((e=>function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(a[r[i]]=e[r[i]])}return a}(e,[])));s.get().callGraphQL({values:{changes:n},query:this.templateByQuery.get("saveData")}).then((a=>{const i=[];null==a||a.forEach((t=>{const a={__record__id__:t.id,__record__label__:t.label,__owner__dataunit__name__:t.ownerDataUnitName},n=r.get(a.__owner__dataunit__name__)||e;t.oldId&&(a.__old__id__=t.oldId),t.fields.forEach((({name:e,value:t})=>{var r;a[e]=(null===(r=null==n?void 0:n.valueFromString)||void 0===r?void 0:r.call(n,e,t))||t})),i.push(a)})),t(i)})).catch((e=>{a(e)}))}))}removeRecords(e,t){const a=t.map((t=>({dataUnit:e.name,operation:i.DELETE,recordId:t})));return new Promise(((e,r)=>{s.get().callGraphQL({values:{changes:a},query:this.templateByQuery.get("saveData")}).then((()=>{e(t)})).catch((e=>{r(e)}))}))}loadRecord(e,t){return new Promise(((a,r)=>{s.get().callGraphQL({values:{recordID:t,dataunit:e.name},query:this.templateByQuery.get("fetchDataRecord")}).then((t=>{const r=[];t.record.forEach((t=>{const a={__record__id__:t.id,__record__label__:t.label};t.fields.forEach((({name:t,value:r})=>{a[t]=e.valueFromString(t,r)})),r.push(a)})),a(r)})).catch((e=>{r(e)}))}))}}export{l as D}
@@ -0,0 +1 @@
1
+ import{r as o,c as r,h as t}from"./p-b9667fbe.js";import{ApplicationContext as i}from"@sankhyalabs/core";import{c as a}from"./p-17375123.js";import{A as n}from"./p-dc36cfbf.js";const s=class{constructor(t){o(this,t),this.configSelected=r(this,"configSelected",7),this.openConfig=r(this,"openConfig",7),this.save=r(this,"save",7),this.cancel=r(this,"cancel",7),this._opened=!1,this._permissions=void 0,this.showActionButtons=!1,this.configName=void 0,this.viewMode=a.GRID,this.messagesBuilder=void 0}async open(){this._opened=!0,this.configSelected.emit(this.getViewModeValue()),this.modal.heightMode="full"}async close(){this.closeConfig()}closeConfig(){this._opened=!1}onViewModeChanged(o){this.viewMode=null==o?void 0:o.detail,this.configSelected.emit(this.viewMode)}onClickOpenConfig(){this.openConfig.emit(this.viewMode)}isAllowed(o){return!n[o]||!!this._permissions&&(this._permissions.isSup||this._permissions[o])}enableModeConfig(){return!(!this.isAllowed(n.CONFIG_GRID)||!this.isAllowed(n.CONFIG))}getViewModeValue(){return null!=this._permissions&&(this.isAllowed(n.CONFIG_GRID)?this.isAllowed(n.CONFIG)||(this.viewMode=a.GRID):this.viewMode=a.FORM),this.viewMode}getMessage(o){var r;return null===(r=this.messagesBuilder)||void 0===r?void 0:r.getMessage(o,{})}componentWillLoad(){this._application=i.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess().then((o=>this._permissions=o)):this._permissions={}}render(){return t("ez-modal",{ref:o=>this.modal=o,opened:this._opened,"close-esc":!1,"close-outside-click":!1,"modal-size":"small",scrim:"light"},t("div",{class:"snk-configurator"},t("div",{class:"snk-configurator__header"},t("label",{class:"snk-configurator__title"},this.getMessage("snkConfigurator.titleConfigurations")),t("div",{class:"snk-configurator__button-close"},t("ez-button",{mode:"icon",iconName:"close",size:"medium",onClick:()=>this.closeConfig()}))),t("div",{class:"snk-configurator__main"},t("ez-collapsible-box",{boxBordered:!0,label:"Modo de visualização ",headerSize:"medium",class:"snk-configurator__collapsable-box"},t("ez-radio-button",{value:this.getViewModeValue().toString(),onEzChange:o=>this.onViewModeChanged(o),enabled:this.enableModeConfig()},t("ez-radio-button-option",{label:this.getMessage("snkConfigurator.labelGrid"),value:a.GRID}),t("ez-radio-button-option",{label:this.getMessage("snkConfigurator.labelForm"),value:a.FORM})),t("div",{class:"snk-configurator__collsable-box-action"},t("ez-button",{label:this.getMessage(this.viewMode===a.GRID?"snkConfigurator.labelConfigGrid":"snkConfigurator.labelConfigForm"),class:"snk-configurator__button-config ez-button--secondary",onClick:()=>this.onClickOpenConfig(),id:"openConfigurator"}))),t("div",{class:"snk-configurator__outline"},t("slot",{name:"SnkConfigContainerSlot"}))),this.showActionButtons&&t("div",{class:"snk-configurator__action-buttons"},t("ez-button",{label:"Cancelar",onClick:()=>this.cancel.emit()}),t("ez-button",{label:"Salvar",onClick:()=>this.save.emit(),class:"ez-button--primary"}))))}};s.style='.sc-snk-configurator-h{--snk-configurator__button-close--padding-left:var(--space--medium, 12px);--snk-configurator__title--color:var(--title--primary, #2B3A54);--snk-configurator__title--font-family:var(--font-pattern, "Roboto");--snk-configurator__title--font-size:var(--title--large, 20px);--snk-configurator__title--font-weight:var(--text-weight--extra-large, 700);--snk-configurator__subtitle--color:var(--title--primary, #2B3A54);--snk-configurator__subtitle--font-family:var(--font-pattern, "Roboto");--snk-configurator__subtitle--font-size:var(--text--medium, 14px);--snk-configurator__subtitle--font-weight:var(--text-weight--large, 600);--snk-configurator__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-configurator__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-configurator__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-configurator__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-configurator__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-configurator__scrollbar--width:var(--space--medium, 12px)}.snk-configurator.sc-snk-configurator{display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.snk-configurator__collsable-box-action.sc-snk-configurator{width:100%}.snk-configurator__action-buttons.sc-snk-configurator{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium)}.snk-configurator__outline.sc-snk-configurator{display:flex;flex-direction:column;gap:var(--space--small);margin-top:var(--space--small);margin-bottom:var(--space--large)}@media screen and (min-width: 480px){.snk-configurator.sc-snk-configurator{width:359px;max-width:359px}}.snk-configurator__button-config.sc-snk-configurator{--ez-button--min-width:100%}.snk-configurator__header.sc-snk-configurator{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-configurator__title.sc-snk-configurator{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-configurator__title--color);font-size:var(--snk-configurator__title--font-size);font-family:var(--snk-configurator__title--font-family);font-weight:var(--snk-configurator__title--font-weight)}.snk-configurator__subtitle.sc-snk-configurator{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-configurator__subtitle--color);font-size:var(--snk-configurator__subtitle--font-size);font-family:var(--snk-configurator__subtitle--font-family);font-weight:var(--snk-configurator__subtitle--font-weight)}.snk-configurator__button-close.sc-snk-configurator{padding-left:var(--snk-configurator__button-close--padding-left)}.snk-configurator__main.sc-snk-configurator{overflow-y:auto;scrollbar-width:thin;margin:var(--space--medium) 0;scrollbar-color:var(--snk-configurator__scrollbar--color-clicked) var(--snk-configurator__scrollbar--color-background)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar{background-color:var(--snk-configurator__scrollbar--color-background);width:var(--snk-configurator__scrollbar--width);max-width:var(--snk-configurator__scrollbar--width);min-width:var(--snk-configurator__scrollbar--width)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-track{background-color:var(--snk-configurator__scrollbar--color-background);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb{background-color:var(--snk-configurator__scrollbar--color-default);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:hover,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-configurator__scrollbar--color-hover)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:active,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-configurator__scrollbar--color-clicked)}';export{s as snk_configurator}
@@ -1,11 +1,11 @@
1
- import{r as t,c as s,h as e,g as n}from"./p-b9667fbe.js";import{WaitingChangeException as i,WarningException as r,ErrorException as a,ObjectUtils as o,DateUtils as c,StringUtils as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,ApplicationContext as d,ErrorTracking as m,DataType as f}from"@sankhyalabs/core";import{d as w,D as y,U as g}from"./p-41d92871.js";import{ApplicationUtils as P}from"@sankhyalabs/ezui/dist/collection/utils";import{P as I}from"./p-11028eba.js";import{G as v,C as _}from"./p-b1c02726.js";import{D as A}from"./p-f821768b.js";import{R as E}from"./p-79f78e10.js";import{S as C}from"./p-b34d23fa.js";import"./p-112455b1.js";import"./p-2ea933b2.js";import"./p-6c2c71ca.js";import"./p-584d7212.js";class S{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof i||(s?this.processException(s):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+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof i||t instanceof r?this._app.alert(t.title,t.message):t instanceof a?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(s,e)}}))}}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 D=b;function b(t,s){const e=T();return(b=function(t){return e[t-=392]})(t,s)}!function(){const t=b,s=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;s.push(s.shift())}catch(t){s.push(s.shift())}}();const N=D(396);class j{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchTotals",w.gql`query($filters: [InputFilter!] $name: String!) {
1
+ import{r as t,c as s,h as e,g as i}from"./p-b9667fbe.js";import{WaitingChangeException as n,WarningException as r,ErrorException as a,ObjectUtils as o,DateUtils as c,StringUtils as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,ApplicationContext as d,ErrorTracking as m,DataType as f}from"@sankhyalabs/core";import{d as w,D as y,U as g}from"./p-41d92871.js";import{ApplicationUtils as P}from"@sankhyalabs/ezui/dist/collection/utils";import{P as I}from"./p-11028eba.js";import{G as v,C as _}from"./p-b1c02726.js";import{D as A}from"./p-553f5dcf.js";import{R as E}from"./p-79f78e10.js";import{S}from"./p-b34d23fa.js";import"./p-112455b1.js";import"./p-2ea933b2.js";import"./p-6c2c71ca.js";import"./p-584d7212.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";class C{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof n||(s?this.processException(s):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+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof n||t instanceof r?this._app.alert(t.title,t.message):t instanceof a?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(s,e)}}))}}function D(){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(D=function(){return t})()}const T=b;function b(t,s){const e=D();return(b=function(t){return e[t-=392]})(t,s)}!function(){const t=b,s=D();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;s.push(s.shift())}catch(t){s.push(s.shift())}}();const N=T(396);class j{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchTotals",w.gql`query($filters: [InputFilter!] $name: String!) {
2
2
  $queryAlias$: fetchTotals(name: $name, filters: $filters ){
3
3
  name
4
4
  value
5
5
  }
6
- }`)}async getTotals(t,s,e){let n={name:`totals://${t}/${s}`,filters:e};return y.get().callGraphQL({values:n,query:this.templateByQuery.get("fetchTotals")})}fetchTotals(t,s,e=[]){return new Promise(((n,i)=>{this.getTotals(t,s,e).then((t=>{if(t.length>0){const s=new Map;t.forEach((t=>{s.set(t.name,parseFloat(t.value))})),n(s)}else i("Não foi possível recuperar os totalizadores")})).catch((t=>{i(t)}))}))}}var O;class L{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}}L.resourceID=null===(O=window.workspace)||void 0===O?void 0:O.resourceID;class U{static webConnectionCaller(t,s,e){var n;null===(n=window.AppletCaller)||void 0===n||n.webConnectionCaller(t,s,e)}}class k{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",w.gql`query($name: String!) {
6
+ }`)}async getTotals(t,s,e){let i={name:`totals://${t}/${s}`,filters:e};return y.get().callGraphQL({values:i,query:this.templateByQuery.get("fetchTotals")})}fetchTotals(t,s,e=[]){return new Promise(((i,n)=>{this.getTotals(t,s,e).then((t=>{if(t.length>0){const s=new Map;t.forEach((t=>{s.set(t.name,parseFloat(t.value))})),i(s)}else n("Não foi possível recuperar os totalizadores")})).catch((t=>{n(t)}))}))}}var O;class L{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}}L.resourceID=null===(O=window.workspace)||void 0===O?void 0:O.resourceID;class k{static webConnectionCaller(t,s,e){var i;null===(i=window.AppletCaller)||void 0===i||i.webConnectionCaller(t,s,e)}}class U{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",w.gql`query($name: String!) {
7
7
  $queryAlias$: fetchResource(name: $name){
8
8
  name
9
9
  resource
10
10
  }
11
- }`)}async getParam(t){const s=`param://application?params=${t}`;return y.get().callGraphQL({values:{name:s},query:this.templateByQuery.get("fetchParam")})}async asString(t){const s=await this.getParam(t);return this.getValue(s)}async asInteger(t){const s=await this.getParam(t);return parseInt(this.getValue(s))}async asFloat(t){const s=await this.getParam(t);return parseFloat(this.getValue(s))}async asBoolean(t){const s=await this.getParam(t);return"S"===this.getValue(s)}async asDate(t){const s=await this.getParam(t);return c.strToDate(this.getValue(s))}async getBatchParams(t){const s=await this.getParam(t.join(",")),e={};return s.forEach((t=>e[t.name]=t.resource)),e}getValue(t={}){if(Array.isArray(t)&&t.length>0&&(t=t[0]),h.isEmpty(t.resource))return"";try{const s=o.stringToObject(t.resource),[e]=Object.keys(s);return s[e]}catch(t){console.warn("Erro ao converter string JSON.")}}}const R=$;function $(t,s){const e=F();return($=function(t){return e[t-=378]})(t,s)}function F(){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(F=function(){return t})()}!function(){const t=$,s=F();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;s.push(s.shift())}catch(t){s.push(s.shift())}}();class M{[R(397)](t){const s=R;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new q("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class q{constructor(t){const s=R;this.isSup=t,this[s(384)]={}}[R(378)](t,s){this[R(384)][t]=s}[R(393)](t){const s=R;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class x extends E{getData(t){const s=`cfg://auth/${t}`;return new Promise(((t,e)=>{this.loadResource(s).then((s=>{let e=o.stringToObject(s);e&&"object"==typeof e&&t(e)})).catch((t=>{e(t)}))}))}}var z;!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={}));const G=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new H,this.messagesBuilder=void 0,this.configName=void 0}get parameters(){return this._parameters||(this._parameters=new k),this._parameters}get resourceID(){return this._resourceID||(this._resourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||L.resourceID||"unknown.resource.id"),this._resourceID}get auth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new J(t,s)),e||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,s)=>{this.auth.then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}initOnboarding(t){return u.getInstance().init(t,window.envContext),Promise.resolve()}async hasAccess(t){return new Promise(((s,e)=>{this.auth.then((n=>{this.getAuthList(n).then((e=>{s(e.isSup||e.actions[t])})).catch((t=>e(t)))}))}))}async getAllAccess(){return new Promise(((t,s)=>{this.auth.then((e=>{this.getAuthList(e).then((s=>{const e={};e.isSup=s.isSup,Object.entries(z).forEach((t=>{e[t[0]]=s.actions[t[1]]||!1})),t(e)})).catch((t=>s(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,s="full",e=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"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 s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((n=>{"1"===n?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{y.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{y.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){L.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{U.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e){return new Promise(((n,i)=>{const r=this.getDuPromissesStack(s),a=r.length>0;if(r.push(new J(n,i)),!a){const n=this.dataUnitFetcher.getDataUnit(t,this.resourceID,e);n.loadMetadata().then((()=>{for(s&&this.updateDataunitCache(void 0,s,n);r.length>0;)r.pop().resolve(n)})).catch((t=>{for(;r.length>0;)r.pop().reject(t)}))}}))}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e){return new Promise(((n,i)=>{const r=this._duCache.get(s);r?n(r):this.createDataunit(t,s,e).then((t=>{n(t)})).catch((t=>i(t)))}))}async addClientEvent(t,s){return new Promise((e=>{y.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{y.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(y.hasClientEvent(t))}))}async getResourceID(){return Promise.resolve(this.resourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,n){return P.alert(t,s,e,n)}async error(t,s,e,n){return P.error(t,s,e,n)}async success(t,s,e,n){return P.success(t,s,e,n)}async message(t,s,e,n){return P.message(t,s,e,n)}async confirm(t,s,e,n,i){return P.confirm(t,s,e,n,i)}async info(t,s){return P.info(t,s)}async loadGridConfig(t){return this.gridConfigFetcher.getConfig(t,this.resourceID)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async getAuthList(t){return await(new M).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=g.getQueryParams(location.search)),this._urlParams}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new A),this._dataUnitFetcher}get gridConfigFetcher(){return this._gridConfigFetcher||(this._gridConfigFetcher=new v),this._gridConfigFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new j),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new I),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new x),this._authFetcher}async executeSearch(t,s,e){const n=null==e?void 0:e.getField(s);if(n){const{mode:s,argument:i}=t,{ENTITYNAME:r,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:c,DESCRIPTIONENTITY:h}=n.properties,u=n.dependencies;let p;const d={rootEntity:c,descriptionFieldName:o,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==u||u.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===l.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(p={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),n=(null==s?void 0:s.dataType)||f.TEXT,i=e.getFieldValue(t);if(null==i)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:i,dataType:n}}))})})),this.executePreparedSearch(s,i,{entity:r,entityDescription:h,criteria:p,searchOptions:d})}}async executePreparedSearch(t,s,e){const{entity:n,entityDescription:i,criteria:r,searchOptions:a}=e;return"ADVANCED"===t?new Promise((t=>{const e=document.createElement("snk-pesquisa");e[p.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${n}`,e.argument=s,e.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(n,t,r,a),e.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(i),this.showPopUp(e)})):this.pesquisaFetcher.loadSearchOptions(n,s,r,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return L.getAppLabel(this._resourceID)}addSearchListener(t,s,e){return new Promise((n=>{n(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}componentWillLoad(){this._errorHandler=new S(this),this.messagesBuilder=new C,d.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${g.getUrlBase()}/mge/upload/file`),d.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e)=>this.executeSearch(t,s,e))),d.setContextValue("__EZUI__GRID_LICENSE__",N),m.init(),_.get()}connectedCallback(){d.setContextValue("__SNK__APPLICATION__",this),y.addRequestListener(this._requestListener)}disconnectedCallback(){y.removeRequestListener(this._requestListener)}componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{this.applicationLoaded.emit(!0)})),p.addIDInfo(this._element,`resource_${this._resourceID}`)}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return n(this)}};class H{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 s;if(1==(null===(s=null==t?void 0:t.requestBody)||void 0===s?void 0:s.length)){const{name:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class J{constructor(t,s){this.resolve=t,this.reject=s}}G.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{G as snk_application}
11
+ }`)}async getParam(t){const s=`param://application?params=${t}`;return y.get().callGraphQL({values:{name:s},query:this.templateByQuery.get("fetchParam")})}async asString(t){const s=await this.getParam(t);return this.getValue(s)}async asInteger(t){const s=await this.getParam(t);return parseInt(this.getValue(s))}async asFloat(t){const s=await this.getParam(t);return parseFloat(this.getValue(s))}async asBoolean(t){const s=await this.getParam(t);return"S"===this.getValue(s)}async asDate(t){const s=await this.getParam(t);return c.strToDate(this.getValue(s))}async getBatchParams(t){const s=await this.getParam(t.join(",")),e={};return s.forEach((t=>e[t.name]=t.resource)),e}getValue(t={}){if(Array.isArray(t)&&t.length>0&&(t=t[0]),h.isEmpty(t.resource))return"";try{const s=o.stringToObject(t.resource),[e]=Object.keys(s);return s[e]}catch(t){console.warn("Erro ao converter string JSON.")}}}const R=$;function $(t,s){const e=F();return($=function(t){return e[t-=378]})(t,s)}function F(){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(F=function(){return t})()}!function(){const t=$,s=F();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;s.push(s.shift())}catch(t){s.push(s.shift())}}();class M{[R(397)](t){const s=R;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new q("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class q{constructor(t){const s=R;this.isSup=t,this[s(384)]={}}[R(378)](t,s){this[R(384)][t]=s}[R(393)](t){const s=R;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class x extends E{getData(t){const s=`cfg://auth/${t}`;return new Promise(((t,e)=>{this.loadResource(s).then((s=>{let e=o.stringToObject(s);e&&"object"==typeof e&&t(e)})).catch((t=>{e(t)}))}))}}var z;!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={}));const G=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new H,this.messagesBuilder=void 0,this.configName=void 0}get parameters(){return this._parameters||(this._parameters=new U),this._parameters}get resourceID(){return this._resourceID||(this._resourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||L.resourceID||"unknown.resource.id"),this._resourceID}get auth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new J(t,s)),e||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,s)=>{this.auth.then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}initOnboarding(t){return u.getInstance().init(t,window.envContext),Promise.resolve()}async hasAccess(t){return new Promise(((s,e)=>{this.auth.then((i=>{this.getAuthList(i).then((e=>{s(e.isSup||e.actions[t])})).catch((t=>e(t)))}))}))}async getAllAccess(){return new Promise(((t,s)=>{this.auth.then((e=>{this.getAuthList(e).then((s=>{const e={};e.isSup=s.isSup,Object.entries(z).forEach((t=>{e[t[0]]=s.actions[t[1]]||!1})),t(e)})).catch((t=>s(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,s="full",e=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"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 s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((i=>{"1"===i?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{y.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{y.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){L.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{k.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e){return new Promise(((i,n)=>{const r=this.getDuPromissesStack(s),a=r.length>0;if(r.push(new J(i,n)),!a){const i=this.dataUnitFetcher.getDataUnit(t,this.resourceID,e);i.loadMetadata().then((()=>{for(s&&this.updateDataunitCache(void 0,s,i);r.length>0;)r.pop().resolve(i)})).catch((t=>{for(;r.length>0;)r.pop().reject(t)}))}}))}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e){return new Promise(((i,n)=>{const r=this._duCache.get(s);r?i(r):this.createDataunit(t,s,e).then((t=>{i(t)})).catch((t=>n(t)))}))}async addClientEvent(t,s){return new Promise((e=>{y.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{y.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(y.hasClientEvent(t))}))}async getResourceID(){return Promise.resolve(this.resourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,i){return P.alert(t,s,e,i)}async error(t,s,e,i){return P.error(t,s,e,i)}async success(t,s,e,i){return P.success(t,s,e,i)}async message(t,s,e,i){return P.message(t,s,e,i)}async confirm(t,s,e,i,n){return P.confirm(t,s,e,i,n)}async info(t,s){return P.info(t,s)}async loadGridConfig(t){return this.gridConfigFetcher.getConfig(t,this.resourceID)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async getAuthList(t){return await(new M).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=g.getQueryParams(location.search)),this._urlParams}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new A),this._dataUnitFetcher}get gridConfigFetcher(){return this._gridConfigFetcher||(this._gridConfigFetcher=new v),this._gridConfigFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new j),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new I),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new x),this._authFetcher}async executeSearch(t,s,e){const i=null==e?void 0:e.getField(s);if(i){const{mode:s,argument:n}=t,{ENTITYNAME:r,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:c,DESCRIPTIONENTITY:h}=i.properties,u=i.dependencies;let p;const d={rootEntity:c,descriptionFieldName:o,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==u||u.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===l.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(p={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),i=(null==s?void 0:s.dataType)||f.TEXT,n=e.getFieldValue(t);if(null==n)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:n,dataType:i}}))})})),this.executePreparedSearch(s,n,{entity:r,entityDescription:h,criteria:p,searchOptions:d})}}async executePreparedSearch(t,s,e){const{entity:i,entityDescription:n,criteria:r,searchOptions:a}=e;return"ADVANCED"===t?new Promise((t=>{const e=document.createElement("snk-pesquisa");e[p.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${i}`,e.argument=s,e.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(i,t,r,a),e.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(n),this.showPopUp(e)})):this.pesquisaFetcher.loadSearchOptions(i,s,r,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return L.getAppLabel(this._resourceID)}addSearchListener(t,s,e){return new Promise((i=>{i(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}executeSelectDistinct(t,s,e){return this.dataUnitFetcher.loadSelectDistinct(t,s,e)}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}componentWillLoad(){this._errorHandler=new C(this),this.messagesBuilder=new S,d.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${g.getUrlBase()}/mge/upload/file`),d.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e)=>this.executeSearch(t,s,e))),d.setContextValue("__EZUI__GRID_LICENSE__",N),m.init(),_.get()}connectedCallback(){d.setContextValue("__SNK__APPLICATION__",this),y.addRequestListener(this._requestListener)}disconnectedCallback(){y.removeRequestListener(this._requestListener)}componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{this.applicationLoaded.emit(!0)})),p.addIDInfo(this._element,`resource_${this._resourceID}`)}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return i(this)}};class H{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 s;if(1==(null===(s=null==t?void 0:t.requestBody)||void 0===s?void 0:s.length)){const{name:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class J{constructor(t,s){this.resolve=t,this.reject=s}}G.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{G as snk_application}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s,g as e}from"./p-b9667fbe.js";import{UserInterface as r,DateUtils as a,ElementIDUtils as d,ApplicationContext as n,DataType as o}from"@sankhyalabs/core";import{UserInterface as l}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{T as h}from"./p-19692f92.js";import{C as c}from"./p-b1c02726.js";import{P as u}from"./p-4c2015a9.js";import{T as v}from"./p-384c4a6b.js";import{s as g}from"./p-6a02e236.js";import"./p-2ea933b2.js";import"./p-41d92871.js";import"./p-112455b1.js";import"./p-79f78e10.js";import"./p-6c2c71ca.js";import"./p-584d7212.js";class m{setDataUnit(i){this._dataUnit=i}setApplication(i){this._application=i}formatLabel(i,t){const{userInterface:s}=this._dataUnit.getField(i);return s===r.DATETIME?a.formatDate(this._dataUnit.valueFromString(i,t)):String(this._dataUnit.getFormattedValue(i,t))}fetchData(i,t){return new Promise((s=>{this._application.executeSelectDistinct(this._dataUnit,t,i).then((i=>{s(i.map((i=>this._dataUnit.getField(t).userInterface===r.SEARCH?Object.assign(Object.assign({},JSON.parse(i)),{check:!0}):{value:i,label:this.formatLabel(t,i),check:!0})))}))}))}}const f=class{constructor(s){i(this,s),this.actionClick=t(this,"actionClick",7),this.gridDoubleClick=t(this,"gridDoubleClick",7),this._multiSelectionListDataSource=new m,this._topTaskbarProcessor=new v({"snkGridTopTaskbar.regular":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.regular.secondary":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.finish_edition":["CANCEL","SAVE"],"snkGridTopTaskbar.finish_edition.secondary":[]}),this._headerTaskbarProcessor=new v({"snkGridHeaderTaskbar.unselected":["REFRESH","DATA_EXPORTER","ACTIONS_BUTTON"],"snkGridHeaderTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","ATTACH","REFRESH","DATA_EXPORTER","ACTIONS_BUTTON"],"snkGridHeaderTaskbar.detail.unselected":["REFRESH"],"snkGridHeaderTaskbar.detail.selected":["UPDATE","ATTACH","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","REFRESH"]}),this._dataUnit=void 0,this._dataState=void 0,this._gridConfig=void 0,this._popUpGridConfig=!1,this.configName=void 0,this.actionsList=void 0,this.isDetail=void 0,this.taskbarManager=void 0,this.statusResolver=void 0,this.multipleSelection=void 0,this.presentationMode=u.PRIMARY,this.messagesBuilder=void 0}async showConfig(){null!=this._grid&&this.openGridConfig()}async hideConfig(){null!=this._grid&&this.closeGridConfig()}async setConfig(i){this.setGridConfig(i)}async reloadFilterBar(){var i;null===(i=this._snkFilterBar)||void 0===i||i.reload()}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._popUpGridConfig=!0}))}closeGridConfig(){this._popUpGridConfig=!1}setGridConfig(i){this._gridConfig=i}loadConfig(){c.get().then((i=>{i.loadGridConfig(this.configName).then((i=>{this.setGridConfig(i)})).catch((i=>{console.warn(i)}))}))}gridConfigChangeHandler(i){c.saveGridConfig(i.detail,this.configName),i.stopPropagation()}modalConfigChangeHandler(i){const t=i.detail;this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}buildColumnsMetadata(i){const t=[];return null==i||i.forEach((i=>{var s,e;if(i.hidden&&"RECDESP"!==i.name)return;const r=null===(s=this._dataUnit)||void 0===s?void 0:s.getField(i.name);if(t.push({label:i.label,id:i.name,width:i.width,type:null==r?void 0:r.dataType,userInterface:null==r?void 0:r.userInterface}),null!=(null===(e=null==r?void 0:r.properties)||void 0===e?void 0:e.DESCRIPTIONFIELD)){const i=r.properties.mergedFrom;t.push({label:r.properties.DESCRIPTIONENTITY,id:`${i?i+".":""}${r.properties.ENTITYNAME}.${r.properties.DESCRIPTIONFIELD}`,width:200,type:o.TEXT,userInterface:l.LONGTEXT})}})),t||[]}getPaginationInfo(){var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getPaginationInfo()}getExporterOffset(i){if(null==i)return;const t=i.firstRecord;return t>0?t-1:t}async dataExporterProviderStore(){var i;const t=await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getSelectedRecordsIDsInfo()),s={getFilters:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getAppliedFilters()},getColumnsMetadata:async()=>{var i;const t=await(null===(i=this._grid)||void 0===i?void 0:i.getColumnsState());return this.buildColumnsMetadata(t)},getOrders:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getSort()},getResourceURI:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.name},getSelectedNumber:()=>{var i,t;return null===(t=null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.length},getTotalRecords:()=>{var i,t,s;const{total:e}=(null===(i=this._dataUnit)||void 0===i?void 0:i.getPaginationInfo())||{};return null!=e?e:null===(s=null===(t=this._dataUnit)||void 0===t?void 0:t.records)||void 0===s?void 0:s.length},getSelectedIDs:()=>t||[],getOffset:()=>this.getExporterOffset(this.getPaginationInfo()),getLimit:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.pageSize},getRecordID:()=>{var i,t,s;return null===(s=null===(t=null===(i=this._dataUnit)||void 0===i?void 0:i.records)||void 0===t?void 0:t[0])||void 0===s?void 0:s.__record__id__}};g.set("exporterProviders",Object.assign(Object.assign({},g.get("exporterProviders")),{[this.configName]:s}))}addElementID(){d.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}finshLoading(){this._dataUnitLoadLockerResolver=this._dataUnit.addLoadingLocker(),this.addElementID(),this._multiSelectionListDataSource.setApplication(this._application),this._multiSelectionListDataSource.setDataUnit(this._dataUnit)}componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__");let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataUnit?this.finshLoading():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail,this.finshLoading()})),this._snkDataUnit.addEventListener("dataStateChange",(i=>{this._dataState=i.detail}));break}i=i.parentElement}this.loadConfig()}getHeaderDisabledButtons(){var i;const t=[];return(null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)&&(this._dataState.selectionInfo.length>1&&t.push(h.CLONE,"ATTACH"),this._dataState.selectionInfo.isAllRecords()&&t.push("REMOVE")),t}componentWillRender(){var i;const t=this._dataUnit&&this._dataUnit.records.length>0?[]:["DATA_EXPORTER"];let s;s=this._dataState&&(null===(i=this._dataState.selectionInfo)||void 0===i?void 0:i.length)?this.isDetail?"snkGridHeaderTaskbar.detail.selected":"snkGridHeaderTaskbar.selected":this.isDetail?"snkGridHeaderTaskbar.detail.unselected":"snkGridHeaderTaskbar.unselected",this._headerTaskbarProcessor.process(s,this.taskbarManager,this._dataState,this.getHeaderDisabledButtons(),t),this._topTaskbarProcessor.process(this.getTopTaskBarId(this.presentationMode===u.SECONDARY?".secondary":""),this.taskbarManager,this._dataState,void 0,t),this.dataExporterProviderStore()}getTopTaskBarId(i){var t;return(null===(t=this._dataState)||void 0===t?void 0:t.isDirty)?`snkGridTopTaskbar.finish_edition${i}`:`snkGridTopTaskbar.regular${i}`}getPrimaryButton(){return this.presentationMode===u.PRIMARY?"INSERT":""}onEzGridReady(){var i;null===(i=this._dataUnitLoadLockerResolver)||void 0===i||i.call(this),this._dataUnitLoadLockerResolver=void 0}render(){var i,t;if(this._dataUnit)return s("div",{class:"snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large"},s("div",{class:"snk-grid__header ez-margin-bottom--medium"},s("snk-filter-bar",{ref:i=>this._snkFilterBar=i,dataUnit:this._dataUnit,"data-element-id":"gridFilter",class:"snk-grid__filter-bar ez-align--top",configName:this.configName,messagesBuilder:this.messagesBuilder}),(null===(t=null===(i=this._snkFilterBar)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.length)>0&&s("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider"}),s("snk-taskbar",{class:"ez-padding-left--medium","data-element-id":"grid_top",key:"topTaskbar",configName:this.configName,dataUnit:this._dataUnit,messagesBuilder:this.messagesBuilder,buttons:this._topTaskbarProcessor.buttons,disabledButtons:this._topTaskbarProcessor.disabledButtons,customButtons:this._topTaskbarProcessor.customButtons,primaryButton:this.getPrimaryButton()})),s("ez-grid",{ref:i=>this._grid=i,class:(this.presentationMode===u.SECONDARY?"snk-grid-container__without-shadow ":"")+"snk-grid__table","data-element-id":"embedded",dataUnit:this._dataUnit,key:"grid-"+this._snkDataUnit.entityName,config:this._gridConfig,onConfigChange:i=>{this.gridConfigChangeHandler(i)},onEzDoubleClick:()=>this.gridDoubleClick.emit(),statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,onComponentReady:()=>this.onEzGridReady(),columnfilterDataSource:this._multiSelectionListDataSource},s("snk-taskbar",{dataUnit:this._dataUnit,configName:this.configName,messagesBuilder:this.messagesBuilder,"data-element-id":"grid_left",buttons:this._headerTaskbarProcessor.buttons,disabledButtons:this._headerTaskbarProcessor.disabledButtons,customButtons:this._headerTaskbarProcessor.customButtons,slot:"leftButtons",actionsList:this.actionsList})),s("div",{class:"ez-col ez-col--sd-12"},s("slot",{name:"SnkGridFooter"})),s("ez-modal",{modalSize:"small",closeEsc:!1,closeOutsideClick:!1,opened:this._popUpGridConfig,onEzCloseModal:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this._gridConfig,"data-element-id":this._element.getAttribute(d.DATA_ELEMENT_ID_ATTRIBUTE_NAME),application:this._application,selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig()})))}get _element(){return e(this)}};f.style=".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:300px}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";export{f as snk_grid}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-b9667fbe.js";export{s as setNonce}from"./p-b9667fbe.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-ff96b509",[[0,"snk-personalized-filter",{messagesBuilder:[1040]}]]],["p-e551b19a",[[1,"teste-pesquisa"]]],["p-f3241ada",[[0,"snk-filter-modal",{getMessage:[16],filters:[1040],applyFilters:[16],clearAll:[16],closeModal:[16]}]]],["p-b680fa7a",[[2,"snk-actions-form",{action:[16],applyParameters:[16],dataUnit:[32],openPopup:[64]}]]],["p-b75ce8b8",[[2,"snk-client-confirm",{titleMessage:[1,"title-message"],message:[1],accept:[16],cancel:[16],openPopup:[64]}]]],["p-0c2afa63",[[2,"snk-entity-list",{config:[1040],rightListSlotBuilder:[1040],maxHeightList:[1,"max-height-list"],_searchValue:[32],_ezListSource:[32],reloadList:[64]}]]],["p-ff398057",[[0,"snk-filter-binary-select",{value:[1544],config:[16],presentationMode:[2,"presentation-mode"]},[[0,"ezChange","ezChangeListener"]]]]],["p-093febff",[[4,"snk-filter-list",{label:[1],iconName:[1,"icon-name"],items:[16],getMessage:[16],emptyText:[1,"empty-text"],findFilterText:[1,"find-filter-text"],buttonClass:[1,"button-class"],_filterArgument:[32],_showAll:[32],hideDetail:[64]},[[2,"keydown","keyDownHandler"]]]]],["p-786ae316",[[0,"snk-filter-multi-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-e2bb9c9a",[[0,"snk-filter-number",{config:[16],value:[2],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-80e52e85",[[0,"snk-filter-period",{config:[16],getMessage:[16],value:[8],presentationMode:[2,"presentation-mode"],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-8efb0f47",[[0,"snk-filter-personalized",{config:[16],value:[1040],fix:[16],unfix:[16],show:[64]}]]],["p-4ce96831",[[0,"snk-filter-search",{config:[16],value:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-9af04fc7",[[0,"snk-filter-text",{config:[16],value:[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-343699ad",[[2,"snk-expression-item",{expression:[16],canRemove:[516,"can-remove"],messagesBuilder:[1040],_showValueVariable:[32],_fieldSelected:[32],_optionNotNull:[32]}]]],["p-c20dd153",[[0,"snk-filter-modal-item",{filterItem:[1040]}]]],["p-44c2ed16",[[2,"snk-detail-view",{formConfigManager:[1040],dataUnitName:[1,"data-unit-name"],guideItemPath:[16],entityName:[1,"entity-name"],label:[1],dataUnit:[1040],selectedForm:[1025,"selected-form"],dataState:[1040],messagesBuilder:[1040],branchGuide:[16],_disabledButtons:[32],attachmentRegisterKey:[32],changeViewMode:[64],configGrid:[64],showUp:[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-44cf545f",[[6,"snk-configurator",{showActionButtons:[4,"show-action-buttons"],configName:[1,"config-name"],viewMode:[2,"view-mode"],messagesBuilder:[1040],_opened:[32],_permissions:[32],open:[64],close:[64]}]]],["p-e701646c",[[2,"snk-pesquisa",{searchLoader:[16],selectItem:[16],argument:[1025],_itemList:[32],_startLoading:[32]}]]],["p-9a448ff9",[[2,"snk-filter-bar",{dataUnit:[1040],configName:[1,"config-name"],filterConfig:[1040],messagesBuilder:[1040],allowDefault:[32],scrollerLocked:[32],reload:[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-e0b4aec3",[[1,"snk-select-box",{selectedOption:[1,"selected-option"]}]]],["p-1e6a95f5",[[2,"snk-grid-config",{selectedIndex:[1026,"selected-index"],application:[16],columns:[1040],config:[1040],configName:[1,"config-name"]}]]],["p-6ac29569",[[2,"snk-config-options",{fieldConfig:[16],idConfig:[513,"id-config"],dataUnit:[16],messagesBuilder:[1040],_defaultType:[32]}]]],["p-f8c66aa3",[[2,"snk-field-config",{isConfigActive:[16],fieldConfig:[16],modeInsertion:[516,"mode-insertion"],dataUnit:[16],messagesBuilder:[1040]}]]],["p-72e78de0",[[6,"snk-tab-config",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],tabItems:[16],messagesBuilder:[1040],_processedTabs:[32],_activeEditText:[32],_activeEditTextIndex:[32],_actionsHide:[32],_actionsShow:[32]}]]],["p-584a315a",[[2,"snk-form-config",{dataUnit:[16],configManager:[16],messagesBuilder:[1040],_formConfigOptions:[32],_fieldConfigSelected:[32],_layoutFormConfig:[32],_fieldsAvailable:[32],_formConfig:[32],_formConfigChanged:[32],_optionFormConfigSelected:[32],_optionFormConfigChanged:[32],_tempGroups:[32]}]]],["p-9e50681c",[[2,"snk-filter-field-search",{searchable:[4],fieldsDataSource:[16],breadcrumbItems:[32],linkItems:[32],fieldItems:[32],show:[64],applyFilter:[64]}],[0,"snk-filter-param-config",{messagesBuilder:[1040],_opened:[32],_configType:[32],_expressionItem:[32],_informedInstance:[32],_canSave:[32],open:[64],close:[64]}]]],["p-cbb5c440",[[0,"snk-filter-item",{config:[1040],getMessage:[16],detailIsVisible:[32],showUp:[64],hideDetail:[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-9f66bc54",[[2,"snk-data-unit",{dataState:[1040],messagesBuilder:[1040],dataUnitName:[1,"data-unit-name"],entityName:[1,"entity-name"],pageSize:[2,"page-size"],dataUnit:[1040],beforeSave:[16],afterSave:[16],useCancelConfirm:[4,"use-cancel-confirm"],getDataUnit:[64],getSelectedRecordsIDsInfo:[64]}]]],["p-22e44b9d",[[0,"snk-exporter-email-sender",{getMessage:[16],_config:[32],_opened:[32],_currentStep:[32],open:[64],close:[64]}]]],["p-2d0fc912",[[2,"snk-data-exporter",{provider:[16],messagesBuilder:[1040],_items:[32],_showDropdown:[32],_releasedToExport:[32]}]]],["p-f27dc5e9",[[2,"snk-actions-button",{_items:[32],_showDropdown:[32],_actions:[32],_isOrderActions:[32]}]]],["p-257c71a7",[[6,"snk-taskbar",{configName:[1,"config-name"],buttons:[1],customButtons:[16],actionsList:[16],primaryButton:[1,"primary-button"],disabledButtons:[16],dataUnit:[16],presentationMode:[1537,"presentation-mode"],messagesBuilder:[1040],_permissions:[32]}]]],["p-fa2d0376",[[6,"snk-grid",{configName:[1,"config-name"],actionsList:[16],isDetail:[4,"is-detail"],taskbarManager:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],presentationMode:[1,"presentation-mode"],messagesBuilder:[1040],_dataUnit:[32],_dataState:[32],_gridConfig:[32],_popUpGridConfig:[32],showConfig:[64],hideConfig:[64],setConfig:[64],reloadFilterBar:[64]}]]],["p-8ce9ea9f",[[2,"snk-guides-viewer",{_guideBuilders:[16],dataUnit:[16],dataState:[16],configName:[1,"config-name"],entityPath:[1,"entity-path"],actionsList:[16],recordsValidator:[16],masterFormConfig:[1040],selectedGuide:[16],taskbarManager:[16],messagesBuilder:[1040],presentationMode:[1,"presentation-mode"],_breadcrumbItems:[32],_guides:[32],_formEditorConfigManager:[32],_formEditorDataUnit:[32],showFormConfig:[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-9c7f7214",[[6,"snk-crud",{configName:[1025,"config-name"],showActionButtons:[4,"show-action-buttons"],actionsList:[16],taskbarManager:[16],recordsValidator:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],presentationMode:[1,"presentation-mode"],messagesBuilder:[1040],_dataUnit:[32],_dataState:[32],attachmentRegisterKey:[32],_currentViewMode:[32],goToView:[64],openConfigurator:[64],closeConfigurator:[64],reloadFilterBar:[64]}]]],["p-e642bf7a",[[2,"snk-form",{configName:[1,"config-name"],recordsValidator:[16],messagesBuilder:[1040],_dataUnit:[32],_dataState:[32],_showFormConfig:[32],_configManager:[32],showConfig:[64],hideConfig:[64]}]]],["p-cbe93a18",[[2,"snk-application",{messagesBuilder:[1040],configName:[1,"config-name"],isUserSup:[64],initOnboarding:[64],hasAccess:[64],getAllAccess:[64],getStringParam:[64],getIntParam:[64],getFloatParam:[64],getBooleanParam:[64],getDateParam:[64],showPopUp:[64],showModal:[64],closeModal:[64],closePopUp:[64],temOpcional:[64],getConfig:[64],saveConfig:[64],getAttributeFromHTMLWrapper:[64],openApp:[64],webConnection:[64],createDataunit:[64],updateDataunitCache:[64],getDataUnit:[64],addClientEvent:[64],removeClientEvent:[64],hasClientEvent:[64],getResourceID:[64],getUserID:[64],alert:[64],error:[64],success:[64],message:[64],confirm:[64],info:[64],loadGridConfig:[64],loadTotals:[64],executeSearch:[64],executePreparedSearch:[64],isDebugMode:[64],getAppLabel:[64],addSearchListener:[64]}]]],["p-eb07d0eb",[[2,"snk-attach",{registerKey:[1,"register-key"],entityName:[1,"entity-name"],messagesBuilder:[1040],dataUnit:[32],crudConfig:[32]}]]],["p-900b2889",[[2,"snk-form-summary",{fixed:[1540],contracted:[1540],summary:[16]}]]],["p-56d70073",[[6,"snk-form-view",{levelPath:[1,"level-path"],label:[1],name:[1],fields:[16],formMetadata:[8,"form-metadata"],dataUnit:[16],contracted:[4],fixed:[1540],summaryFields:[16],canExpand:[4,"can-expand"],canFix:[4,"can-fix"],recordsValidator:[16],showUp:[64]}]]],["p-471568c7",[[0,"snk-filter-detail",{config:[1040],getMessage:[16],show:[64]}]]],["p-0b6ddb67",[[6,"snk-simple-crud",{dataState:[16],dataUnit:[16],mode:[2],gridConfig:[16],formConfig:[16],useCancelConfirm:[4,"use-cancel-confirm"],taskbarManager:[16],messagesBuilder:[1040],_currentViewMode:[32],_config:[32],goToView:[64],setMetadata:[64],setRecords:[64],getRecords:[64]},[[0,"actionClick","actionClickListener"]]],[6,"snk-simple-bar",{label:[1],breadcrumbItens:[16],messagesBuilder:[1040]}]]]],e)));
1
+ import{p as e,b as t}from"./p-b9667fbe.js";export{s as setNonce}from"./p-b9667fbe.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-ff96b509",[[0,"snk-personalized-filter",{messagesBuilder:[1040]}]]],["p-e551b19a",[[1,"teste-pesquisa"]]],["p-f3241ada",[[0,"snk-filter-modal",{getMessage:[16],filters:[1040],applyFilters:[16],clearAll:[16],closeModal:[16]}]]],["p-b680fa7a",[[2,"snk-actions-form",{action:[16],applyParameters:[16],dataUnit:[32],openPopup:[64]}]]],["p-b75ce8b8",[[2,"snk-client-confirm",{titleMessage:[1,"title-message"],message:[1],accept:[16],cancel:[16],openPopup:[64]}]]],["p-0c2afa63",[[2,"snk-entity-list",{config:[1040],rightListSlotBuilder:[1040],maxHeightList:[1,"max-height-list"],_searchValue:[32],_ezListSource:[32],reloadList:[64]}]]],["p-ff398057",[[0,"snk-filter-binary-select",{value:[1544],config:[16],presentationMode:[2,"presentation-mode"]},[[0,"ezChange","ezChangeListener"]]]]],["p-093febff",[[4,"snk-filter-list",{label:[1],iconName:[1,"icon-name"],items:[16],getMessage:[16],emptyText:[1,"empty-text"],findFilterText:[1,"find-filter-text"],buttonClass:[1,"button-class"],_filterArgument:[32],_showAll:[32],hideDetail:[64]},[[2,"keydown","keyDownHandler"]]]]],["p-786ae316",[[0,"snk-filter-multi-select",{value:[1544],config:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-e2bb9c9a",[[0,"snk-filter-number",{config:[16],value:[2],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-80e52e85",[[0,"snk-filter-period",{config:[16],getMessage:[16],value:[8],presentationMode:[2,"presentation-mode"],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-8efb0f47",[[0,"snk-filter-personalized",{config:[16],value:[1040],fix:[16],unfix:[16],show:[64]}]]],["p-4ce96831",[[0,"snk-filter-search",{config:[16],value:[16],show:[64]},[[0,"ezChange","ezChangeListener"]]]]],["p-9af04fc7",[[0,"snk-filter-text",{config:[16],value:[1]},[[0,"ezChange","ezChangeListener"]]]]],["p-343699ad",[[2,"snk-expression-item",{expression:[16],canRemove:[516,"can-remove"],messagesBuilder:[1040],_showValueVariable:[32],_fieldSelected:[32],_optionNotNull:[32]}]]],["p-c20dd153",[[0,"snk-filter-modal-item",{filterItem:[1040]}]]],["p-44c2ed16",[[2,"snk-detail-view",{formConfigManager:[1040],dataUnitName:[1,"data-unit-name"],guideItemPath:[16],entityName:[1,"entity-name"],label:[1],dataUnit:[1040],selectedForm:[1025,"selected-form"],dataState:[1040],messagesBuilder:[1040],branchGuide:[16],_disabledButtons:[32],attachmentRegisterKey:[32],changeViewMode:[64],configGrid:[64],showUp:[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-82bc4666",[[6,"snk-configurator",{showActionButtons:[4,"show-action-buttons"],configName:[1,"config-name"],viewMode:[2,"view-mode"],messagesBuilder:[1040],_opened:[32],_permissions:[32],open:[64],close:[64]}]]],["p-e701646c",[[2,"snk-pesquisa",{searchLoader:[16],selectItem:[16],argument:[1025],_itemList:[32],_startLoading:[32]}]]],["p-9a448ff9",[[2,"snk-filter-bar",{dataUnit:[1040],configName:[1,"config-name"],filterConfig:[1040],messagesBuilder:[1040],allowDefault:[32],scrollerLocked:[32],reload:[64]},[[0,"filterChange","filterChangeListener"]]]]],["p-e0b4aec3",[[1,"snk-select-box",{selectedOption:[1,"selected-option"]}]]],["p-1e6a95f5",[[2,"snk-grid-config",{selectedIndex:[1026,"selected-index"],application:[16],columns:[1040],config:[1040],configName:[1,"config-name"]}]]],["p-6ac29569",[[2,"snk-config-options",{fieldConfig:[16],idConfig:[513,"id-config"],dataUnit:[16],messagesBuilder:[1040],_defaultType:[32]}]]],["p-f8c66aa3",[[2,"snk-field-config",{isConfigActive:[16],fieldConfig:[16],modeInsertion:[516,"mode-insertion"],dataUnit:[16],messagesBuilder:[1040]}]]],["p-72e78de0",[[6,"snk-tab-config",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1],tabItems:[16],messagesBuilder:[1040],_processedTabs:[32],_activeEditText:[32],_activeEditTextIndex:[32],_actionsHide:[32],_actionsShow:[32]}]]],["p-584a315a",[[2,"snk-form-config",{dataUnit:[16],configManager:[16],messagesBuilder:[1040],_formConfigOptions:[32],_fieldConfigSelected:[32],_layoutFormConfig:[32],_fieldsAvailable:[32],_formConfig:[32],_formConfigChanged:[32],_optionFormConfigSelected:[32],_optionFormConfigChanged:[32],_tempGroups:[32]}]]],["p-9e50681c",[[2,"snk-filter-field-search",{searchable:[4],fieldsDataSource:[16],breadcrumbItems:[32],linkItems:[32],fieldItems:[32],show:[64],applyFilter:[64]}],[0,"snk-filter-param-config",{messagesBuilder:[1040],_opened:[32],_configType:[32],_expressionItem:[32],_informedInstance:[32],_canSave:[32],open:[64],close:[64]}]]],["p-cbb5c440",[[0,"snk-filter-item",{config:[1040],getMessage:[16],detailIsVisible:[32],showUp:[64],hideDetail:[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["p-9f66bc54",[[2,"snk-data-unit",{dataState:[1040],messagesBuilder:[1040],dataUnitName:[1,"data-unit-name"],entityName:[1,"entity-name"],pageSize:[2,"page-size"],dataUnit:[1040],beforeSave:[16],afterSave:[16],useCancelConfirm:[4,"use-cancel-confirm"],getDataUnit:[64],getSelectedRecordsIDsInfo:[64]}]]],["p-22e44b9d",[[0,"snk-exporter-email-sender",{getMessage:[16],_config:[32],_opened:[32],_currentStep:[32],open:[64],close:[64]}]]],["p-2d0fc912",[[2,"snk-data-exporter",{provider:[16],messagesBuilder:[1040],_items:[32],_showDropdown:[32],_releasedToExport:[32]}]]],["p-f27dc5e9",[[2,"snk-actions-button",{_items:[32],_showDropdown:[32],_actions:[32],_isOrderActions:[32]}]]],["p-257c71a7",[[6,"snk-taskbar",{configName:[1,"config-name"],buttons:[1],customButtons:[16],actionsList:[16],primaryButton:[1,"primary-button"],disabledButtons:[16],dataUnit:[16],presentationMode:[1537,"presentation-mode"],messagesBuilder:[1040],_permissions:[32]}]]],["p-971abcc2",[[6,"snk-grid",{configName:[1,"config-name"],actionsList:[16],isDetail:[4,"is-detail"],taskbarManager:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],presentationMode:[1,"presentation-mode"],messagesBuilder:[1040],_dataUnit:[32],_dataState:[32],_gridConfig:[32],_popUpGridConfig:[32],showConfig:[64],hideConfig:[64],setConfig:[64],reloadFilterBar:[64]}]]],["p-8ce9ea9f",[[2,"snk-guides-viewer",{_guideBuilders:[16],dataUnit:[16],dataState:[16],configName:[1,"config-name"],entityPath:[1,"entity-path"],actionsList:[16],recordsValidator:[16],masterFormConfig:[1040],selectedGuide:[16],taskbarManager:[16],messagesBuilder:[1040],presentationMode:[1,"presentation-mode"],_breadcrumbItems:[32],_guides:[32],_formEditorConfigManager:[32],_formEditorDataUnit:[32],showFormConfig:[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["p-9c7f7214",[[6,"snk-crud",{configName:[1025,"config-name"],showActionButtons:[4,"show-action-buttons"],actionsList:[16],taskbarManager:[16],recordsValidator:[16],statusResolver:[16],multipleSelection:[4,"multiple-selection"],presentationMode:[1,"presentation-mode"],messagesBuilder:[1040],_dataUnit:[32],_dataState:[32],attachmentRegisterKey:[32],_currentViewMode:[32],goToView:[64],openConfigurator:[64],closeConfigurator:[64],reloadFilterBar:[64]}]]],["p-e642bf7a",[[2,"snk-form",{configName:[1,"config-name"],recordsValidator:[16],messagesBuilder:[1040],_dataUnit:[32],_dataState:[32],_showFormConfig:[32],_configManager:[32],showConfig:[64],hideConfig:[64]}]]],["p-8652d177",[[2,"snk-application",{messagesBuilder:[1040],configName:[1,"config-name"],isUserSup:[64],initOnboarding:[64],hasAccess:[64],getAllAccess:[64],getStringParam:[64],getIntParam:[64],getFloatParam:[64],getBooleanParam:[64],getDateParam:[64],showPopUp:[64],showModal:[64],closeModal:[64],closePopUp:[64],temOpcional:[64],getConfig:[64],saveConfig:[64],getAttributeFromHTMLWrapper:[64],openApp:[64],webConnection:[64],createDataunit:[64],updateDataunitCache:[64],getDataUnit:[64],addClientEvent:[64],removeClientEvent:[64],hasClientEvent:[64],getResourceID:[64],getUserID:[64],alert:[64],error:[64],success:[64],message:[64],confirm:[64],info:[64],loadGridConfig:[64],loadTotals:[64],executeSearch:[64],executePreparedSearch:[64],isDebugMode:[64],getAppLabel:[64],addSearchListener:[64],executeSelectDistinct:[64]}]]],["p-538c057a",[[2,"snk-attach",{registerKey:[1,"register-key"],entityName:[1,"entity-name"],messagesBuilder:[1040],dataUnit:[32],crudConfig:[32]}]]],["p-900b2889",[[2,"snk-form-summary",{fixed:[1540],contracted:[1540],summary:[16]}]]],["p-56d70073",[[6,"snk-form-view",{levelPath:[1,"level-path"],label:[1],name:[1],fields:[16],formMetadata:[8,"form-metadata"],dataUnit:[16],contracted:[4],fixed:[1540],summaryFields:[16],canExpand:[4,"can-expand"],canFix:[4,"can-fix"],recordsValidator:[16],showUp:[64]}]]],["p-471568c7",[[0,"snk-filter-detail",{config:[1040],getMessage:[16],show:[64]}]]],["p-0b6ddb67",[[6,"snk-simple-crud",{dataState:[16],dataUnit:[16],mode:[2],gridConfig:[16],formConfig:[16],useCancelConfirm:[4,"use-cancel-confirm"],taskbarManager:[16],messagesBuilder:[1040],_currentViewMode:[32],_config:[32],goToView:[64],setMetadata:[64],setRecords:[64],getRecords:[64]},[[0,"actionClick","actionClickListener"]]],[6,"snk-simple-bar",{label:[1],breadcrumbItens:[16],messagesBuilder:[1040]}]]]],e)));
@@ -233,6 +233,12 @@ export declare class SnkApplication {
233
233
  * Adiciona um listener no fetcher de Pesquisa
234
234
  */
235
235
  addSearchListener(entityName: string, dataUnit: DataUnit, listener: ISearchListener): Promise<IRemoveSearchListener>;
236
+ /**
237
+ * Com base em um campo realiza um "select distinct" respeitando os
238
+ * filtros atuais do dataUnit e um critério de filtro para a própria
239
+ * coluna.
240
+ */
241
+ executeSelectDistinct(dataUnit: DataUnit, fieldName: string, argument: string): Promise<Array<any>>;
236
242
  private clearContent;
237
243
  private clearPopUpTitle;
238
244
  private setPopUpTitle;
@@ -1,12 +1,13 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
- import { VIEW_MODE } from '../../lib/utils/constants';
3
2
  import { SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder';
3
+ import { VIEW_MODE } from '../../lib/utils/constants';
4
4
  export interface IConfigurator {
5
5
  viewMode: number;
6
6
  openConfig?: boolean;
7
7
  }
8
8
  export declare class SnkConfigurator {
9
9
  private _application;
10
+ private modal;
10
11
  _opened: boolean;
11
12
  _permissions: any;
12
13
  /**
@@ -30,16 +31,16 @@ export declare class SnkConfigurator {
30
31
  */
31
32
  openConfig: EventEmitter<VIEW_MODE>;
32
33
  /**
33
- * Emitido quando salva a configuração.
34
- */
34
+ * Emitido quando salva a configuração.
35
+ */
35
36
  save: EventEmitter<void>;
36
37
  /**
37
38
  * Emitido quando cancela o salvamento da configuração.
38
39
  */
39
40
  cancel: EventEmitter<void>;
40
41
  /**
41
- * Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
42
- */
42
+ * Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
43
+ */
43
44
  messagesBuilder: SnkMessageBuilder;
44
45
  /**
45
46
  * Exibe a janela de configuração.
@@ -0,0 +1,12 @@
1
+ import { DataUnit } from '@sankhyalabs/core';
2
+ import { IMultiSelectionListDataSource } from '@sankhyalabs/ezui/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource';
3
+ import { IMultiSelectionOption } from '@sankhyalabs/ezui/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionOption';
4
+ import { SnkApplication } from '../../snk-application/snk-application';
5
+ export default class SnkMultiSelectionListDataSource implements IMultiSelectionListDataSource {
6
+ private _dataUnit;
7
+ private _application;
8
+ setDataUnit(dataUnit: DataUnit): void;
9
+ setApplication(application: SnkApplication): void;
10
+ private formatLabel;
11
+ fetchData(filterTerm: string, fieldName: string): Promise<Array<IMultiSelectionOption>>;
12
+ }
@@ -7,6 +7,7 @@ import { SnkApplication } from '../snk-application/snk-application';
7
7
  import { PresentationMode } from '../../lib/@types';
8
8
  import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
9
9
  import { SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder';
10
+ import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionListDataSource';
10
11
  export declare class SnkGrid {
11
12
  _grid: HTMLEzGridElement;
12
13
  _snkDataUnit: HTMLSnkDataUnitElement;
@@ -14,6 +15,7 @@ export declare class SnkGrid {
14
15
  _snkEmailSender: HTMLSnkExporterEmailSenderElement;
15
16
  _snkFilterBar: HTMLSnkFilterBarElement;
16
17
  _dataUnitLoadLockerResolver?: Function;
18
+ _multiSelectionListDataSource: SnkMultiSelectionListDataSource;
17
19
  _topTaskbarProcessor: TaskbarProcessor;
18
20
  _headerTaskbarProcessor: TaskbarProcessor;
19
21
  _element: HTMLElement;
@@ -91,6 +93,7 @@ export declare class SnkGrid {
91
93
  private getExporterOffset;
92
94
  private dataExporterProviderStore;
93
95
  private addElementID;
96
+ private finshLoading;
94
97
  componentWillLoad(): void;
95
98
  getHeaderDisabledButtons(): Array<string>;
96
99
  componentWillRender(): void;
@@ -108,6 +108,10 @@ export namespace Components {
108
108
  * Obtém as opções em componentes de pesquisa Ex.: snk-config-options
109
109
  */
110
110
  "executeSearch": (searchArgument: ISearchArgument, fieldName: string, dataUnit: DataUnit) => Promise<Array<IOption> | IOption>;
111
+ /**
112
+ * Com base em um campo realiza um "select distinct" respeitando os filtros atuais do dataUnit e um critério de filtro para a própria coluna.
113
+ */
114
+ "executeSelectDistinct": (dataUnit: DataUnit, fieldName: string, argument: string) => Promise<Array<any>>;
111
115
  /**
112
116
  * Obtém todos os acessos do usuário logado.
113
117
  */
@@ -7,6 +7,7 @@ export default class DataUnitFetcher {
7
7
  getDataUnit(entityName: string, resourceID: string, parentDataUnit?: DataUnit): DataUnit;
8
8
  private loadMetadata;
9
9
  private loadData;
10
+ loadSelectDistinct(dataUnit: DataUnit, fieldName: string, argument: string): Promise<Array<string>>;
10
11
  private doLoadData;
11
12
  private saveData;
12
13
  private removeRecords;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/sankhyablocks",
3
- "version": "5.18.1",
3
+ "version": "5.19.0",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as o,c as r,h as t}from"./p-b9667fbe.js";import{ApplicationContext as i}from"@sankhyalabs/core";import{A as a}from"./p-dc36cfbf.js";import{c as n}from"./p-17375123.js";const s=class{constructor(t){o(this,t),this.configSelected=r(this,"configSelected",7),this.openConfig=r(this,"openConfig",7),this.save=r(this,"save",7),this.cancel=r(this,"cancel",7),this._opened=!1,this._permissions=void 0,this.showActionButtons=!1,this.configName=void 0,this.viewMode=n.GRID,this.messagesBuilder=void 0}async open(){this._opened=!0,this.configSelected.emit(this.getViewModeValue())}async close(){this.closeConfig()}closeConfig(){this._opened=!1}onViewModeChanged(o){this.viewMode=null==o?void 0:o.detail,this.configSelected.emit(this.viewMode)}onClickOpenConfig(){this.openConfig.emit(this.viewMode)}isAllowed(o){return!a[o]||!!this._permissions&&(this._permissions.isSup||this._permissions[o])}enableModeConfig(){return!(!this.isAllowed(a.CONFIG_GRID)||!this.isAllowed(a.CONFIG))}getViewModeValue(){return null!=this._permissions&&(this.isAllowed(a.CONFIG_GRID)?this.isAllowed(a.CONFIG)||(this.viewMode=n.GRID):this.viewMode=n.FORM),this.viewMode}getMessage(o){var r;return null===(r=this.messagesBuilder)||void 0===r?void 0:r.getMessage(o,{})}componentWillLoad(){this._application=i.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess().then((o=>this._permissions=o)):this._permissions={}}render(){return t("ez-modal",{opened:this._opened,"close-esc":!1,"close-outside-click":!1,"modal-size":"small",scrim:"light"},t("div",{class:"snk-configurator"},t("div",{class:"snk-configurator__header"},t("label",{class:"snk-configurator__title"},this.getMessage("snkConfigurator.titleConfigurations")),t("div",{class:"snk-configurator__button-close"},t("ez-button",{mode:"icon",iconName:"close",size:"medium",onClick:()=>this.closeConfig()}))),t("div",{class:"snk-configurator__main"},t("ez-collapsible-box",{boxBordered:!0,label:"Modo de visualização ",headerSize:"medium",class:"snk-configurator__collapsable-box"},t("ez-radio-button",{value:this.getViewModeValue().toString(),onEzChange:o=>this.onViewModeChanged(o),enabled:this.enableModeConfig()},t("ez-radio-button-option",{label:this.getMessage("snkConfigurator.labelGrid"),value:n.GRID}),t("ez-radio-button-option",{label:this.getMessage("snkConfigurator.labelForm"),value:n.FORM})),t("div",{class:"snk-configurator__collsable-box-action"},t("ez-button",{label:this.getMessage(this.viewMode===n.GRID?"snkConfigurator.labelConfigGrid":"snkConfigurator.labelConfigForm"),class:"snk-configurator__button-config ez-button--secondary",onClick:()=>this.onClickOpenConfig(),id:"openConfigurator"}))),t("div",{class:"snk-configurator__outline"},t("slot",{name:"SnkConfigContainerSlot"}))),this.showActionButtons&&t("div",{class:"snk-configurator__action-buttons"},t("ez-button",{label:"Cancelar",onClick:()=>this.cancel.emit()}),t("ez-button",{label:"Salvar",onClick:()=>this.save.emit(),class:"ez-button--primary"}))))}};s.style='.sc-snk-configurator-h{--snk-configurator__button-close--padding-left:var(--space--medium, 12px);--snk-configurator__title--color:var(--title--primary, #2B3A54);--snk-configurator__title--font-family:var(--font-pattern, "Roboto");--snk-configurator__title--font-size:var(--title--large, 20px);--snk-configurator__title--font-weight:var(--text-weight--extra-large, 700);--snk-configurator__subtitle--color:var(--title--primary, #2B3A54);--snk-configurator__subtitle--font-family:var(--font-pattern, "Roboto");--snk-configurator__subtitle--font-size:var(--text--medium, 14px);--snk-configurator__subtitle--font-weight:var(--text-weight--large, 600);--snk-configurator__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-configurator__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-configurator__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-configurator__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-configurator__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-configurator__scrollbar--width:var(--space--medium, 12px)}.snk-configurator.sc-snk-configurator{display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.snk-configurator__collsable-box-action.sc-snk-configurator{width:100%}.snk-configurator__action-buttons.sc-snk-configurator{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium)}.snk-configurator__outline.sc-snk-configurator{display:flex;flex-direction:column;gap:var(--space--small);margin-top:var(--space--small);margin-bottom:var(--space--large)}@media screen and (min-width: 480px){.snk-configurator.sc-snk-configurator{width:359px;max-width:359px}}.snk-configurator__button-config.sc-snk-configurator{--ez-button--min-width:100%}.snk-configurator__header.sc-snk-configurator{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-configurator__title.sc-snk-configurator{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-configurator__title--color);font-size:var(--snk-configurator__title--font-size);font-family:var(--snk-configurator__title--font-family);font-weight:var(--snk-configurator__title--font-weight)}.snk-configurator__subtitle.sc-snk-configurator{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-configurator__subtitle--color);font-size:var(--snk-configurator__subtitle--font-size);font-family:var(--snk-configurator__subtitle--font-family);font-weight:var(--snk-configurator__subtitle--font-weight)}.snk-configurator__button-close.sc-snk-configurator{padding-left:var(--snk-configurator__button-close--padding-left)}.snk-configurator__main.sc-snk-configurator{overflow-y:auto;scrollbar-width:thin;margin:var(--space--medium) 0;scrollbar-color:var(--snk-configurator__scrollbar--color-clicked) var(--snk-configurator__scrollbar--color-background)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar{background-color:var(--snk-configurator__scrollbar--color-background);width:var(--snk-configurator__scrollbar--width);max-width:var(--snk-configurator__scrollbar--width);min-width:var(--snk-configurator__scrollbar--width)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-track{background-color:var(--snk-configurator__scrollbar--color-background);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb{background-color:var(--snk-configurator__scrollbar--color-default);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:hover,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-configurator__scrollbar--color-hover)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:active,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-configurator__scrollbar--color-clicked)}';export{s as snk_configurator}
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i}from"./p-b9667fbe.js";import{ApplicationContext as s,DataType as n,Action as a}from"@sankhyalabs/core";import{D as r}from"./p-41d92871.js";import{c as o}from"./p-17375123.js";import{D as h}from"./p-f821768b.js";import{T as l}from"./p-19692f92.js";import"./p-112455b1.js";import"./p-4c2015a9.js";import"./p-6a02e236.js";var d;!function(t){t.LINK_AND_FILE_AT_THE_SAME_TIME="LINK_AND_FILE_AT_THE_SAME_TIME",t.ANY_LINK_OR_FILE_FILLED="ANY_LINK_OR_FILE_FILLED",t.UNKNOWN="UNKNOWN"}(d||(d={}));class c{constructor(t,e,i){var s;this.entityName=t,this.registerKey=e,this.dataUnitName=i,this.validateFields=t=>{if(t.LINK&&t.NOMEARQUIVO)throw new Error(d.LINK_AND_FILE_AT_THE_SAME_TIME);if(!t.LINK&&!t.NOMEARQUIVO)throw new Error(d.ANY_LINK_OR_FILE_FILLED);if(!this.registerKey)throw new Error("Register key can not be null")},this.resourceID=window.resourceID||(null===(s=window.workspace)||void 0===s?void 0:s.resourceID)}async save(t){var e,i;const s="AnexoSistemaSP.salvar";let{updatingFields:n}=t;n=Object.assign(Object.assign({},n),{NOMEARQUIVO:null===(e=n.NOMEARQUIVO)||void 0===e?void 0:e[0]});try{this.validateFields(n);const t=n.LINK?null:n.NOMEARQUIVO,e={serviceName:s,requestBody:{params:{resourceID:this.resourceID,description:n.DESCRICAO,fileSelect:t?1:0,keySession:null===(i=null==t?void 0:t.properties)||void 0===i?void 0:i.fileNameTmp,nameAttach:null==t?void 0:t.name,link:n.LINK,nameEntity:this.entityName,pkEntity:this.registerKey,typeAcess:n.TIPOACESSO,typeApres:n.TIPOAPRES}}},a=await r.get().callServiceBroker(s,JSON.stringify(e));return Promise.resolve([Object.assign(Object.assign(Object.assign({},a),n),{ARQUIVOOULINK:n.LINK?n.LINK:null==t?void 0:t.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}async edit(t){var e,i,s;const n="AnexoSistemaSP.salvar";let{updatingFields:a,record:o}=t;const h=t=>void 0!==a[t]?a[t]:o[t],l=h("NOMEARQUIVO"),d=null===(i=null===(e=a.NOMEARQUIVO)||void 0===e?void 0:e[0])||void 0===i?void 0:i.downloadURL;a=Object.assign(Object.assign({},a),{DESCRICAO:h("DESCRICAO"),LINK:h("LINK"),TIPOACESSO:h("TIPOACESSO"),TIPOAPRES:h("TIPOAPRES"),CHAVEARQUIVO:o.CHAVEARQUIVO,NOMEARQUIVO:null==l?void 0:l[0]});const c=a.LINK?null:a.NOMEARQUIVO;try{this.validateFields(a);const t={serviceName:n,requestBody:{params:{resourceID:this.resourceID,nuAttach:null==o?void 0:o.NUATTACH,description:a.DESCRICAO,fileSelect:d?1:0,keySession:null===(s=null==c?void 0:c.properties)||void 0===s?void 0:s.fileNameTmp,keyAttach:a.CHAVEARQUIVO,nameAttach:null==c?void 0:c.name,link:a.LINK,nameEntity:this.entityName,pkEntity:this.registerKey,typeAcess:a.TIPOACESSO,typeApres:a.TIPOAPRES}}},e=await r.get().callServiceBroker(n,JSON.stringify(t));return Promise.resolve([Object.assign(Object.assign(Object.assign({},e),a),{ARQUIVOOULINK:a.LINK?a.LINK:null==c?void 0:c.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}delete(t){var e;const i="AnexoSistemaSP.excluir",s=(null===(e=t.NOMEARQUIVO)||void 0===e?void 0:e[0])||{},n={serviceName:i,requestBody:{paramsDelete:{keyAttach:t.CHAVEARQUIVO,nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO}}};return new Promise(((t,e)=>{r.get().callServiceBroker(i,JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}getDownloadKey(t){var e;const i="AnexoSistemaSP.baixar",s=(null===(e=t.NOMEARQUIVO)||void 0===e?void 0:e[0])||{},n={serviceName:i,requestBody:{paramsDown:{nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO,keyAttach:t.CHAVEARQUIVO}}};return new Promise(((t,e)=>{r.get().callServiceBroker(i,JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}}class m{constructor(t,e){this.entityName=t,this.getMessage=e,this._application=s.getContextValue("__SNK__APPLICATION__")}initLoaders(t,e,i){this.loader||(this.loader=t.dataLoader),t.dataLoader=(t,e)=>this.dataLoader(t,e),t.saveLoader=(t,s)=>this.saveLoader(s,e).then((t=>(t.length&&i(),t))),t.removeLoader=(t,s)=>this.removeLoader(t,s,e).then((t=>(t.length&&i(),t)))}dataLoader(t,e){return new Promise((i=>{this.loader(t,e).then((t=>{const e=((null==t?void 0:t.records)||[]).map((t=>{let e;return t.LINK||(e=[{name:t.NOMEARQUIVO}]),Object.assign(Object.assign({},t),{ARQUIVOOULINK:t.LINK?t.LINK:t.NOMEARQUIVO,NOMEARQUIVO:e})}));i(Object.assign(Object.assign({},t),{records:e}))}))}))}saveLoader(t,e){return new Promise((i=>{var s;const n=Array.isArray(t)?t[0]:{};((null===(s=null==n?void 0:n.record)||void 0===s?void 0:s.NUATTACH)>=0?e.edit.bind(e):e.save.bind(e))(n).then((t=>{i(t)})).catch((t=>t.message===d.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),i([])):t.message===d.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),i([])):t.message?(this._application.error(t.title||t.name,t.message),i([])):void i([])))}))}removeLoader(t,e,i){return new Promise((s=>{const{records:n}=t.getSelectionInfo();i.delete(n[0]).then((()=>s(e)))}))}getFilters(t){return[{name:"AttachmentsByPK",expression:"this.PKREGISTRO = :PKREGISTRO",params:[{name:"PKREGISTRO",dataType:n.TEXT,value:`${t}_${this.entityName}`}]}]}getInterceptions(t,e,i){return new Promise((s=>e.type===a.EDITION_CANCELED?t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(i.goToView(o.GRID),s(e)):s(void 0))):s(e):e.type===a.DATA_SAVED?(t.loadData(),s(e)):void s(e)))}}const u=s.getContextValue("__SNK__APPLICATION__"),v=t=>{var e,i;return null===(i=null===(e=null==u?void 0:u.messagesBuilder)||void 0===e?void 0:e.getMessage)||void 0===i?void 0:i.call(e,t,null)},A={DOWNLOAD:{hint:v("snkAttach.taskbar.titleDownload"),name:"DOWNLOAD",iconName:"file-download"},LINK:{hint:v("snkAttach.taskbar.titleLink"),name:"LINK",iconName:"launch"}},O=()=>{const t=[l.REMOVE,"DOWNLOAD","LINK"];return{getButtons:(t,e,i)=>{if((null==e?void 0:e.insertionMode)||(null==e?void 0:e.isDirty))return i.reverse();i.splice(i.indexOf(l.REFRESH),1);const{selectedRecord:s}=e||{},n=(null==s?void 0:s.LINK)?A.LINK:A.DOWNLOAD;i.splice(i.indexOf(l.DIVIDER)+1,0,l.REMOVE,n,l.DIVIDER);const a=Array.from(new Set(i.filter((t=>t!==l.CLONE))));return a.splice(a.indexOf(n)+1,0,l.DIVIDER),a},isEnabled:(e,i,s)=>{const n=void 0!==(null==i?void 0:i.selectedRecord);return!(t.includes(s)&&!n)}}},I={grid:{columns:[{name:"ARQUIVOOULINK",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"DHCAD",orderIndex:2,width:0},{name:"DHALTER",orderIndex:3,width:0},{name:"TIPOAPRES",orderIndex:4,width:0},{name:"TIPOACESSO",orderIndex:5,width:0},{name:"CODUSU",orderIndex:6,width:0},{name:"CODUSUALT",orderIndex:7,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",required:!0},{name:"TIPOAPRES",required:!0},{name:"TIPOACESSO",required:!0},{name:"LINK"},{name:"NOMEARQUIVO"}]}},_=class{constructor(i){t(this,i),this.back=e(this,"back",7),this.handleTaskbarClick=({detail:t})=>{if(["DOWNLOAD","LINK"].includes(t))return this.downloadAttachment(this.dataUnit.getSelectedRecord())},this.handleBack=()=>{this.dataUnit.cancelEdition().then((t=>{t&&this.back.emit()}))},this.handleFinish=()=>{if(!this.dataUnit.isDirty())return this.back.emit();this.dataUnit.saveData().then((()=>{this.showFinishedToast(),this.back.emit()}))},this.registerKey=void 0,this.entityName=void 0,this.messagesBuilder=void 0,this.dataUnit=void 0,this.crudConfig=void 0}registerKeyWatcher(t,e){var i;e!==t&&(this.returnToGridMode(),this._attachFetcher=new c(this.entityName,this.registerKey,null===(i=this.dataUnit)||void 0===i?void 0:i.name),this._dataUnitBuilder.initLoaders(this.dataUnit,this._attachFetcher,(()=>{this.returnToGridMode()})),this.dataUnit.loadData())}getMessage(t,e){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,e)}showFinishedToast(){this._application.info(this.getMessage("snkAttach.finishedMessage"),{iconName:"check"})}downloadAttachment(t){if(!t)throw new Error("Nenhum registro selecionado");t.LINK?window.open(`${t.LINK}`):this._attachFetcher.getDownloadKey(t).then((({chave:t})=>{window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${t.valor}&forcarDownload=S`)}))}returnToGridMode(){this.dataUnit.clearSelection(),this._crudElement&&this._crudElement.goToView(o.GRID)}loadAttachmentDataUnit(){var t;try{const e=this.dataUnit||(new h).getDataUnit("AnexoSistema","br.com.sankhya.core.v3.anexoSistema");return this._attachFetcher=new c(this.entityName,this.registerKey,null===(t=this.dataUnit)||void 0===t?void 0:t.name),e.metadata||e.loadMetadata().then((()=>{this.crudConfig=I})),this._dataUnitBuilder=new m(this.entityName,this.getMessage.bind(this)),e.addFilterProvider({getFilter:()=>this._dataUnitBuilder.getFilters(this.registerKey)}),e.addInterceptor({interceptAction:t=>this._dataUnitBuilder.getInterceptions(e,t,this._crudElement)}),this.dataUnit=e,this.dataUnit.loadData(),this.dataUnit}catch(t){throw new Error("There was an error while creating the data unit")}}componentWillLoad(){this._application=s.getContextValue("__SNK__APPLICATION__"),this.loadAttachmentDataUnit()}render(){var t,e;return this.dataUnit?i("main",null,i("header",{class:"snk-attach__header"},i("snk-simple-bar",{onExit:this.handleBack,messagesBuilder:this.messagesBuilder},i("div",{slot:"rightSlot"},i("ez-button",{class:"ez-button--primary",label:this.getMessage("snkAttach.finish"),onClick:this.handleFinish})))),i("div",{class:"snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column"},i("div",{class:"ez-box__container"},i("snk-simple-crud",{ref:t=>this._crudElement=t,dataUnit:this.dataUnit,taskbarManager:O(),gridConfig:null===(t=this.crudConfig)||void 0===t?void 0:t.grid,formConfig:null===(e=this.crudConfig)||void 0===e?void 0:e.form,useCancelConfirm:!1,onActionClick:this.handleTaskbarClick},i("div",{slot:"snkSimpleCrudHeader"},i("div",{class:"ez-flex ez-flex--column"},i("span",{class:"ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium"},this.getMessage("snkAttach.title")),i("span",{class:"ez-text ez-text--medium ez-text--secondary"},this.getMessage("snkAttach.description")))))))):null}static get watchers(){return{registerKey:["registerKeyWatcher"]}}};_.style=".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}";export{_ as snk_attach}