@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-33766.1 → 0.0.0-bugfix-dev-KB-38407.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 (133) hide show
  1. package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
  2. package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{dataunit-fetcher-bd4c52da.js → pesquisa-fetcher-977c90b1.js} +221 -25
  5. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  6. package/dist/cjs/snk-actions-button_2.cjs.entry.js +17 -4
  7. package/dist/cjs/snk-application.cjs.entry.js +12 -4
  8. package/dist/cjs/snk-attach.cjs.entry.js +388 -57
  9. package/dist/cjs/snk-crud.cjs.entry.js +3 -4
  10. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
  11. package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-82c08a8c.js} +1 -1
  12. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  13. package/dist/cjs/snk-detail-view.cjs.entry.js +4 -5
  14. package/dist/cjs/snk-filter-item.cjs.entry.js +3 -0
  15. package/dist/cjs/{snk-guides-viewer-dce60912.js → snk-guides-viewer-5803fe92.js} +2 -3
  16. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -4
  17. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -5
  19. package/dist/collection/collection-manifest.json +1 -1
  20. package/dist/collection/components/snk-application/snk-application.js +43 -0
  21. package/dist/collection/components/snk-attach/snk-attach.js +188 -39
  22. package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
  23. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
  24. package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
  25. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
  26. package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
  27. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
  28. package/dist/collection/components/snk-attach/structure/index.js +6 -3
  29. package/dist/collection/components/snk-crud/snk-crud.js +1 -1
  30. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
  31. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -0
  32. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
  33. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +15 -1
  34. package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
  35. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
  36. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
  37. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
  38. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
  39. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
  40. package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
  41. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +16 -2
  42. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +37 -23
  43. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +7 -1
  44. package/dist/collection/lib/index.js +1 -1
  45. package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
  46. package/dist/components/SnkMessageBuilder.js +13 -0
  47. package/dist/components/dataunit-fetcher.js +60 -26
  48. package/dist/components/snk-actions-button2.js +1 -0
  49. package/dist/components/snk-application2.js +11 -1
  50. package/dist/components/snk-attach2.js +394 -57
  51. package/dist/components/snk-crud.js +1 -1
  52. package/dist/components/snk-data-exporter2.js +1 -1
  53. package/dist/components/snk-filter-item2.js +3 -0
  54. package/dist/components/snk-pesquisa2.js +1 -1
  55. package/dist/components/taskbar-actions-button2.js +15 -1
  56. package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
  57. package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
  58. package/dist/esm/loader.js +1 -1
  59. package/dist/esm/{dataunit-fetcher-65714f21.js → pesquisa-fetcher-5e228b5a.js} +221 -26
  60. package/dist/esm/sankhyablocks.js +1 -1
  61. package/dist/esm/snk-actions-button_2.entry.js +17 -4
  62. package/dist/esm/snk-application.entry.js +11 -3
  63. package/dist/esm/snk-attach.entry.js +389 -58
  64. package/dist/esm/snk-crud.entry.js +3 -4
  65. package/dist/esm/snk-data-exporter.entry.js +3 -3
  66. package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-5d201fb3.js} +1 -1
  67. package/dist/esm/snk-data-unit.entry.js +2 -2
  68. package/dist/esm/snk-detail-view.entry.js +4 -5
  69. package/dist/esm/snk-filter-item.entry.js +3 -0
  70. package/dist/esm/{snk-guides-viewer-8b9564bd.js → snk-guides-viewer-c77e1c8f.js} +2 -3
  71. package/dist/esm/snk-guides-viewer.entry.js +3 -4
  72. package/dist/esm/snk-pesquisa.entry.js +1 -1
  73. package/dist/esm/snk-simple-crud.entry.js +2 -3
  74. package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
  75. package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
  76. package/dist/sankhyablocks/p-25c77ddb.js +65 -0
  77. package/dist/sankhyablocks/p-2dd38000.entry.js +1 -0
  78. package/dist/sankhyablocks/p-34156b41.entry.js +1 -0
  79. package/dist/sankhyablocks/p-3efca291.entry.js +1 -0
  80. package/dist/sankhyablocks/{p-0874adb5.entry.js → p-40915359.entry.js} +1 -1
  81. package/dist/sankhyablocks/p-59ce706a.entry.js +1 -0
  82. package/dist/sankhyablocks/{p-c223b7b2.entry.js → p-86164061.entry.js} +3 -3
  83. package/dist/sankhyablocks/{p-6977a26c.entry.js → p-86801b08.entry.js} +1 -1
  84. package/dist/sankhyablocks/p-ab568a2e.entry.js +1 -0
  85. package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
  86. package/dist/sankhyablocks/p-ce4bca21.js +1 -0
  87. package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
  88. package/dist/sankhyablocks/p-f39f48c2.entry.js +1 -0
  89. package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
  90. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  91. package/dist/types/components/snk-application/snk-application.d.ts +7 -0
  92. package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
  93. package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
  94. package/dist/types/components/snk-attach/snk-attach.d.ts +27 -6
  95. package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
  96. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
  97. package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
  98. package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
  99. package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
  100. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
  101. package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
  102. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -1
  103. package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +1 -0
  104. package/dist/types/components.d.ts +42 -2
  105. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  106. package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
  107. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
  108. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
  109. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
  110. package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
  111. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +1 -0
  112. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
  113. package/dist/types/lib/index.d.ts +1 -1
  114. package/package.json +7 -5
  115. package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
  116. package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
  117. package/dist/sankhyablocks/p-28564b5e.entry.js +0 -1
  118. package/dist/sankhyablocks/p-29804fc5.js +0 -60
  119. package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
  120. package/dist/sankhyablocks/p-55930465.entry.js +0 -1
  121. package/dist/sankhyablocks/p-95a3778f.entry.js +0 -1
  122. package/dist/sankhyablocks/p-b146a9f0.entry.js +0 -1
  123. package/dist/sankhyablocks/p-bedb8ad6.entry.js +0 -1
  124. package/dist/sankhyablocks/p-cdd66657.entry.js +0 -1
  125. package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
  126. package/dist/sankhyablocks/p-ebbc17c6.js +0 -1
  127. package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
  128. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
  129. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
  130. /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
  131. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
  132. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
  133. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -6,12 +6,11 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const taskbarElements = require('./taskbar-elements-01b85b99.js');
8
8
  require('./DataFetcher-ba94ed5b.js');
9
- require('./pesquisa-fetcher-ef050a47.js');
9
+ require('./pesquisa-fetcher-977c90b1.js');
10
10
  const index$1 = require('./index-0922807b.js');
11
- require('./ISave-d68ce3cd.js');
11
+ require('./ISave-e91b70a7.js');
12
12
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
- require('./dataunit-fetcher-bd4c52da.js');
15
14
  require('./PreloadManager-84466da6.js');
16
15
  require('./filter-item-type.enum-a7ffdaa6.js');
17
16
  require('./form-config-fetcher-df043d3d.js');
@@ -298,7 +297,7 @@ const SnkCrud = class {
298
297
  return;
299
298
  }
300
299
  this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === constants.VIEW_MODE.GRID;
301
- return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
300
+ return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
302
301
  }
303
302
  get _element() { return index.getElement(this); }
304
303
  static get watchers() { return {
@@ -8,10 +8,10 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const index = require('./index-0922807b.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  const DataFetcher = require('./DataFetcher-ba94ed5b.js');
11
- const snkDataUnit = require('./snk-data-unit-1bc69073.js');
11
+ const snkDataUnit = require('./snk-data-unit-82c08a8c.js');
12
12
  require('./PrintUtils-bcaeb82f.js');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
- require('./SnkMessageBuilder-7293d0ad.js');
14
+ require('./SnkMessageBuilder-e7dcf408.js');
15
15
 
16
16
  class ItemBuilder {
17
17
  constructor(getMessage, selectedNumber) {
@@ -447,7 +447,7 @@ const SnkDataExporter = class {
447
447
  pkObject[`PK_${name}`] = { type: this.parseDataType(type), value };
448
448
  pkObject['pks'] = [];
449
449
  }
450
- const dataFields = { nome: name, tipo: type, valor: value };
450
+ const dataFields = { nome: name, tipo: this.parseDataType(type), valor: value };
451
451
  fields['fields'].push(dataFields);
452
452
  pkObject['pks'].push(fields);
453
453
  });
@@ -3,7 +3,7 @@
3
3
  const index = require('./index-f9e81701.js');
4
4
  const core = require('@sankhyalabs/core');
5
5
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
6
- const SnkMessageBuilder = require('./SnkMessageBuilder-7293d0ad.js');
6
+ const SnkMessageBuilder = require('./SnkMessageBuilder-e7dcf408.js');
7
7
 
8
8
  const SnkDataUnit = class {
9
9
  constructor(hostRef) {
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkDataUnit = require('./snk-data-unit-1bc69073.js');
5
+ const snkDataUnit = require('./snk-data-unit-82c08a8c.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('@sankhyalabs/ezui/dist/collection/utils');
9
- require('./SnkMessageBuilder-7293d0ad.js');
9
+ require('./SnkMessageBuilder-e7dcf408.js');
10
10
 
11
11
 
12
12
 
@@ -7,19 +7,18 @@ const core = require('@sankhyalabs/core');
7
7
  const SnkFormConfigManager = require('./SnkFormConfigManager-71c4768e.js');
8
8
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
9
9
  require('./DataFetcher-ba94ed5b.js');
10
- require('./pesquisa-fetcher-ef050a47.js');
10
+ require('./pesquisa-fetcher-977c90b1.js');
11
11
  const index$1 = require('./index-0922807b.js');
12
- require('./ISave-d68ce3cd.js');
12
+ require('./ISave-e91b70a7.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
- require('./dataunit-fetcher-bd4c52da.js');
16
15
  require('./PreloadManager-84466da6.js');
17
16
  require('./filter-item-type.enum-a7ffdaa6.js');
18
17
  require('./form-config-fetcher-df043d3d.js');
19
18
  const taskbarElements = require('./taskbar-elements-01b85b99.js');
20
19
  const constants = require('./constants-35ddd366.js');
21
- const snkGuidesViewer = require('./snk-guides-viewer-dce60912.js');
22
- const SnkMessageBuilder = require('./SnkMessageBuilder-7293d0ad.js');
20
+ const snkGuidesViewer = require('./snk-guides-viewer-5803fe92.js');
21
+ const SnkMessageBuilder = require('./SnkMessageBuilder-e7dcf408.js');
23
22
  require('./ConfigStorage-302bbbd4.js');
24
23
  require('./PrintUtils-bcaeb82f.js');
25
24
  require('./ResourceIDUtils-5ff86aa7.js');
@@ -262,6 +262,9 @@ const SnkFilterItem = class {
262
262
  }
263
263
  canClearFilter() {
264
264
  const { value, groupedItems = [] } = this.config;
265
+ if (value != undefined && this.config.type === filterItemType_enum.FilterItemType.MULTI_LIST) {
266
+ return value.some((item) => item.check);
267
+ }
265
268
  return value !== undefined || groupedItems.some(item => item.visible);
266
269
  }
267
270
  getRightIconName() {
@@ -8,12 +8,11 @@ const fieldSearch = require('./field-search-f56aa7d6.js');
8
8
  const taskbarElements = require('./taskbar-elements-01b85b99.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
10
  require('./DataFetcher-ba94ed5b.js');
11
- require('./pesquisa-fetcher-ef050a47.js');
11
+ require('./pesquisa-fetcher-977c90b1.js');
12
12
  const index$1 = require('./index-0922807b.js');
13
- require('./ISave-d68ce3cd.js');
13
+ require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
16
- require('./dataunit-fetcher-bd4c52da.js');
17
16
  require('./PreloadManager-84466da6.js');
18
17
  require('./filter-item-type.enum-a7ffdaa6.js');
19
18
  require('./form-config-fetcher-df043d3d.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-dce60912.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-5803fe92.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('./SnkFormConfigManager-71c4768e.js');
@@ -18,13 +18,12 @@ require('./taskbar-elements-01b85b99.js');
18
18
  require('./index-0922807b.js');
19
19
  require('./index-102ba62d.js');
20
20
  require('./constants-35ddd366.js');
21
- require('./pesquisa-fetcher-ef050a47.js');
22
- require('./ISave-d68ce3cd.js');
21
+ require('./pesquisa-fetcher-977c90b1.js');
23
22
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
24
- require('./dataunit-fetcher-bd4c52da.js');
25
23
  require('./PreloadManager-84466da6.js');
26
24
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
27
25
  require('./ResourceIDUtils-5ff86aa7.js');
26
+ require('./ISave-e91b70a7.js');
28
27
  require('@sankhyalabs/core/dist/dataunit/DataUnit');
29
28
 
30
29
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
 
8
- const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--medium, 12px);max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";
8
+ const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--medium, 12px);height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";
9
9
 
10
10
  const SnkPesquisa = class {
11
11
  constructor(hostRef) {
@@ -7,12 +7,11 @@ const core = require('@sankhyalabs/core');
7
7
  const constants = require('./constants-35ddd366.js');
8
8
  const taskbarElements = require('./taskbar-elements-01b85b99.js');
9
9
  require('./DataFetcher-ba94ed5b.js');
10
- require('./pesquisa-fetcher-ef050a47.js');
10
+ const pesquisaFetcher = require('./pesquisa-fetcher-977c90b1.js');
11
11
  const index$1 = require('./index-0922807b.js');
12
- require('./ISave-d68ce3cd.js');
12
+ require('./ISave-e91b70a7.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
- const dataunitFetcher = require('./dataunit-fetcher-bd4c52da.js');
16
15
  require('./PreloadManager-84466da6.js');
17
16
  require('./filter-item-type.enum-a7ffdaa6.js');
18
17
  require('./form-config-fetcher-df043d3d.js');
@@ -121,7 +120,7 @@ const SnkSimpleCrud = class {
121
120
  return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
122
121
  }
123
122
  initInMemoryDataUnit() {
124
- this._inMemoryLoader = new dataunitFetcher.InMemoryLoader(this._metadata);
123
+ this._inMemoryLoader = new pesquisaFetcher.InMemoryLoader(this._metadata);
125
124
  this.dataUnit = this._inMemoryLoader.dataUnit;
126
125
  this.dataUnitReady.emit(this.dataUnit);
127
126
  }
@@ -305,7 +304,7 @@ const SnkSimpleCrud = class {
305
304
  }
306
305
  render() {
307
306
  var _a;
308
- return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
307
+ return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(pesquisaFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
309
308
  ? undefined
310
309
  : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig, fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }))))));
311
310
  }
@@ -5,6 +5,7 @@
5
5
  "./components/snk-data-unit/snk-data-unit.js",
6
6
  "./components/snk-taskbar/snk-taskbar.js",
7
7
  "./components/snk-filter-bar/filter-list/snk-filter-list.js",
8
+ "./components/snk-print-selector/snk-print-selector.js",
8
9
  "./components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js",
9
10
  "./components/snk-actions-button/snk-actions-button.js",
10
11
  "./components/snk-actions-button/subcomponents/snk-actions-form.js",
@@ -47,7 +48,6 @@
47
48
  "./components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js",
48
49
  "./components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js",
49
50
  "./components/snk-pesquisa/snk-pesquisa.js",
50
- "./components/snk-print-selector/snk-print-selector.js",
51
51
  "./components/snk-simple-bar/snk-simple-bar.js",
52
52
  "./components/snk-simple-crud/snk-simple-crud.js",
53
53
  "./components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js",
@@ -757,6 +757,15 @@ export class SnkApplication {
757
757
  this._waitingAppReady.push(() => resolve(this));
758
758
  });
759
759
  }
760
+ /**
761
+ * Atribui valor para parâmetros de contexto no componente de pesquisa.
762
+ *
763
+ * @param name - Nome do parâmetro
764
+ * @param value - String conversível de acordo com o tipo do parâmetro
765
+ */
766
+ async setSearchFilterContext(name, value) {
767
+ ApplicationContext.setContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${name})__`, value);
768
+ }
760
769
  clearContent(container) {
761
770
  if (container) {
762
771
  Array.from(container.children).forEach(child => {
@@ -2392,6 +2401,40 @@ export class SnkApplication {
2392
2401
  "text": "SnkApplication carregado."
2393
2402
  }]
2394
2403
  }
2404
+ },
2405
+ "setSearchFilterContext": {
2406
+ "complexType": {
2407
+ "signature": "(name: string, value: string) => Promise<void>",
2408
+ "parameters": [{
2409
+ "tags": [{
2410
+ "name": "param",
2411
+ "text": "name - Nome do par\u00E2metro"
2412
+ }],
2413
+ "text": "- Nome do par\u00E2metro"
2414
+ }, {
2415
+ "tags": [{
2416
+ "name": "param",
2417
+ "text": "value - String convers\u00EDvel de acordo com o tipo do par\u00E2metro"
2418
+ }],
2419
+ "text": "- String convers\u00EDvel de acordo com o tipo do par\u00E2metro"
2420
+ }],
2421
+ "references": {
2422
+ "Promise": {
2423
+ "location": "global"
2424
+ }
2425
+ },
2426
+ "return": "Promise<void>"
2427
+ },
2428
+ "docs": {
2429
+ "text": "Atribui valor para par\u00E2metros de contexto no componente de pesquisa.",
2430
+ "tags": [{
2431
+ "name": "param",
2432
+ "text": "name - Nome do par\u00E2metro"
2433
+ }, {
2434
+ "name": "param",
2435
+ "text": "value - String convers\u00EDvel de acordo com o tipo do par\u00E2metro"
2436
+ }]
2437
+ }
2395
2438
  }
2396
2439
  };
2397
2440
  }
@@ -1,47 +1,66 @@
1
1
  import { h } from "@stencil/core";
2
- import { ApplicationContext } from "@sankhyalabs/core";
3
- import { AttachFetcher } from "../../lib/http/data-fetcher/fetchers/attach-fetcher";
2
+ import { DataUnit, ApplicationContext } from "@sankhyalabs/core";
3
+ import { AnexoSistemaFetcher, AttachFetcher, DataUnitFetcher } from "../../lib";
4
4
  import { VIEW_MODE } from "../../lib/utils/constants";
5
- import DataUnitFetcher from "../../lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher";
6
- import { AttachmentDataUnitBuilder, buildTaskBarManager, crudConfig } from "./structure";
5
+ import { AnexoSistemaDataUnitFactory, AttachFetcherDataUnitFactory, buildTaskBarManager, anexoSistemaCrudConfig, attachCrudConfig } from "./structure";
7
6
  const RESOURCE_ID = 'AnexoSistema';
8
7
  const DATA_UNIT_NAME = 'br.com.sankhya.core.v3.anexoSistema';
9
8
  export class SnkAttach {
10
9
  constructor() {
11
- this.handleTaskbarClick = ({ detail: taskbar }) => {
10
+ this.handleTaskbarClick = async ({ detail: taskbar }) => {
12
11
  if (["DOWNLOAD", "LINK"].includes(taskbar))
13
- return this.downloadAttachment(this.dataUnit.getSelectedRecord());
12
+ return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());
13
+ if (this.fetcherType === "Attach" && ["SAVE"].includes(taskbar) && this._currentDataUnit.isDirty()) {
14
+ await this._currentDataUnit.setFieldValue("REGISTER_KEY", this.registerKey);
15
+ }
14
16
  };
15
17
  this.handleBack = () => {
16
- this.dataUnit.cancelEdition().then((cancelationConfirmed) => {
18
+ this._currentDataUnit.cancelEdition().then((cancelationConfirmed) => {
17
19
  if (cancelationConfirmed)
18
20
  this.back.emit();
19
21
  });
20
22
  };
21
23
  this.handleFinish = () => {
22
- if (!this.dataUnit.isDirty())
24
+ if (!this._currentDataUnit.isDirty())
23
25
  return this.back.emit();
24
- this.dataUnit.saveData().then(() => {
26
+ this._currentDataUnit.saveData().then(() => {
25
27
  this.showFinishedToast();
26
28
  this.back.emit();
27
29
  });
28
30
  };
31
+ this.fetcherType = "AnexoSistema";
32
+ this.fetcher = undefined;
33
+ this.dataUnit = undefined;
34
+ this.dataUnitBuilder = undefined;
29
35
  this.registerKey = undefined;
30
36
  this.entityName = undefined;
31
37
  this.messagesBuilder = undefined;
32
- this.dataUnit = undefined;
38
+ this._currentFetcher = undefined;
39
+ this._currentDataUnit = undefined;
33
40
  this.crudConfig = undefined;
34
41
  }
35
42
  registerKeyWatcher(newRegisterKey, oldRegisterKey) {
36
- var _a;
37
- if (this.dataUnit == null) {
43
+ var _a, _b, _c, _d;
44
+ if (this._currentDataUnit == null) {
38
45
  this.loadAttachmentDataUnit();
39
46
  }
40
47
  if (oldRegisterKey !== newRegisterKey) {
41
48
  this.returnToGridMode();
42
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
43
- this._dataUnitBuilder.initLoaders(this.dataUnit, this._attachFetcher, () => { this.returnToGridMode(); });
44
- this.dataUnit.loadData();
49
+ if (this.fetcherType === "AnexoSistema") {
50
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
51
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
52
+ return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
53
+ }
54
+ if (this.fetcherType === "Attach") {
55
+ const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
56
+ if (hasMoreOneItem)
57
+ return;
58
+ }
59
+ return this._currentDataUnit
60
+ .loadMetadata()
61
+ .then(() => {
62
+ this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
63
+ });
45
64
  }
46
65
  }
47
66
  /**
@@ -64,44 +83,90 @@ export class SnkAttach {
64
83
  window.open(`${selectedRecord.LINK}`);
65
84
  return;
66
85
  }
67
- this._attachFetcher.getDownloadKey(selectedRecord).then(({ chave }) => {
68
- window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}&forcarDownload=S`);
86
+ this._currentFetcher
87
+ .getDownloadKey(selectedRecord)
88
+ .then(({ chave }) => {
89
+ var _a;
90
+ let forceDownload = false;
91
+ if (!((_a = selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.ARQUIVO) === null || _a === void 0 ? void 0 : _a.endsWith(".pdf"))) {
92
+ forceDownload = true;
93
+ }
94
+ window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${chave.valor}${forceDownload ? "&forcarDownload=S" : ""}`);
69
95
  });
70
96
  }
71
97
  returnToGridMode() {
72
- this.dataUnit.clearSelection();
98
+ var _a;
99
+ (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.clearSelection();
73
100
  if (this._crudElement)
74
101
  this._crudElement.goToView(VIEW_MODE.GRID);
75
102
  }
76
103
  loadAttachmentDataUnit() {
77
- var _a;
78
104
  try {
79
- const dataUnit = this.dataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
80
- this._attachFetcher = new AttachFetcher(this.entityName, this.registerKey, (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.name);
81
- if (!dataUnit.metadata)
82
- dataUnit.loadMetadata().then(() => {
83
- this.crudConfig = crudConfig;
84
- });
85
- this._dataUnitBuilder = new AttachmentDataUnitBuilder(this.entityName, this.getMessage.bind(this));
86
- dataUnit.addFilterProvider({ getFilter: () => this._dataUnitBuilder.getFilters(this.registerKey) });
87
- dataUnit.addInterceptor({ interceptAction: (action) => this._dataUnitBuilder.getInterceptions(dataUnit, action, this._crudElement) });
88
- this.dataUnit = dataUnit;
89
- this.dataUnit.loadData().then(() => {
90
- this.disableEditFieldsNotInForm();
91
- });
92
- return this.dataUnit;
105
+ switch (this.fetcherType) {
106
+ case "AnexoSistema":
107
+ this.loadAnexoSistema();
108
+ break;
109
+ case "Attach":
110
+ this.loadAttach();
111
+ break;
112
+ default:
113
+ this._currentFetcher = this.fetcher;
114
+ this._currentDataUnit = this.dataUnit;
115
+ this._currentDataUnitBuilder = this.dataUnitBuilder;
116
+ }
93
117
  }
94
118
  catch (error) {
95
119
  throw new Error('There was an error while creating the data unit');
96
120
  }
97
121
  }
122
+ loadAnexoSistema() {
123
+ var _a;
124
+ this._currentDataUnit = this._currentDataUnit || new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
125
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
126
+ if (!this._currentDataUnit.metadata) {
127
+ this._currentDataUnit
128
+ .loadMetadata()
129
+ .then(() => this.crudConfig = anexoSistemaCrudConfig);
130
+ }
131
+ this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
132
+ this._currentDataUnit.addFilterProvider({
133
+ getFilter: () => this._currentDataUnitBuilder.getFilters(this.registerKey)
134
+ });
135
+ this._currentDataUnit.addInterceptor({
136
+ interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
137
+ });
138
+ this._currentDataUnit.loadData().then(this.disableEditFieldsNotInForm.bind(this));
139
+ }
140
+ loadAttach() {
141
+ var _a;
142
+ this._currentFetcher = new AttachFetcher();
143
+ this._currentDataUnit = new DataUnit();
144
+ this._currentDataUnit.addInterceptor({
145
+ interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
146
+ });
147
+ this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
148
+ (_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
149
+ await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
150
+ this.returnToGridMode();
151
+ });
152
+ if (!this._currentDataUnit.metadata) {
153
+ this._currentDataUnit
154
+ .loadMetadata()
155
+ .then(() => {
156
+ this.crudConfig = attachCrudConfig;
157
+ this._currentDataUnit
158
+ .loadData(undefined, undefined, true, this.registerKey)
159
+ .then(this.disableEditFieldsNotInForm.bind(this));
160
+ });
161
+ }
162
+ }
98
163
  disableEditFieldsNotInForm() {
99
164
  var _a;
100
165
  (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
101
166
  var _a;
102
167
  const fieldName = column.name;
103
168
  if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
104
- this.dataUnit.disableField(fieldName);
169
+ this._currentDataUnit.disableField(fieldName);
105
170
  }
106
171
  });
107
172
  }
@@ -109,15 +174,15 @@ export class SnkAttach {
109
174
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
110
175
  }
111
176
  componentWillRender() {
112
- if (this.dataUnit == null) {
177
+ if (this._currentDataUnit == null) {
113
178
  this.loadAttachmentDataUnit();
114
179
  }
115
180
  }
116
181
  render() {
117
182
  var _a, _b;
118
- if (!this.dataUnit)
183
+ if (!this._currentDataUnit)
119
184
  return null;
120
- return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this.dataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
185
+ return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
121
186
  }
122
187
  static get is() { return "snk-attach"; }
123
188
  static get encapsulation() { return "scoped"; }
@@ -133,6 +198,89 @@ export class SnkAttach {
133
198
  }
134
199
  static get properties() {
135
200
  return {
201
+ "fetcherType": {
202
+ "type": "string",
203
+ "mutable": false,
204
+ "complexType": {
205
+ "original": "TFetcherType",
206
+ "resolved": "\"AnexoSistema\" | \"Another\" | \"Attach\"",
207
+ "references": {
208
+ "TFetcherType": {
209
+ "location": "import",
210
+ "path": "./interfaces/TFetcherType"
211
+ }
212
+ }
213
+ },
214
+ "required": false,
215
+ "optional": false,
216
+ "docs": {
217
+ "tags": [],
218
+ "text": "FetcherType define o tipo de fetcher respons\u00E1vel por carregar os dados do DataUnit."
219
+ },
220
+ "attribute": "fetcher-type",
221
+ "reflect": false,
222
+ "defaultValue": "\"AnexoSistema\""
223
+ },
224
+ "fetcher": {
225
+ "type": "unknown",
226
+ "mutable": false,
227
+ "complexType": {
228
+ "original": "AttachFetcherFacadeInterface",
229
+ "resolved": "AttachFetcherFacadeInterface",
230
+ "references": {
231
+ "AttachFetcherFacadeInterface": {
232
+ "location": "import",
233
+ "path": "../../lib"
234
+ }
235
+ }
236
+ },
237
+ "required": false,
238
+ "optional": false,
239
+ "docs": {
240
+ "tags": [],
241
+ "text": "Fetcher respons\u00E1vel por carregar os dados do DataUnit."
242
+ }
243
+ },
244
+ "dataUnit": {
245
+ "type": "unknown",
246
+ "mutable": false,
247
+ "complexType": {
248
+ "original": "DataUnit",
249
+ "resolved": "DataUnit",
250
+ "references": {
251
+ "DataUnit": {
252
+ "location": "import",
253
+ "path": "@sankhyalabs/core"
254
+ }
255
+ }
256
+ },
257
+ "required": false,
258
+ "optional": false,
259
+ "docs": {
260
+ "tags": [],
261
+ "text": "DataUnit respons\u00E1vel por carregar os dados."
262
+ }
263
+ },
264
+ "dataUnitBuilder": {
265
+ "type": "unknown",
266
+ "mutable": false,
267
+ "complexType": {
268
+ "original": "FetcherFacade",
269
+ "resolved": "FetcherFacade",
270
+ "references": {
271
+ "FetcherFacade": {
272
+ "location": "import",
273
+ "path": "./structure"
274
+ }
275
+ }
276
+ },
277
+ "required": false,
278
+ "optional": false,
279
+ "docs": {
280
+ "tags": [],
281
+ "text": "DataUnitBuilder respons\u00E1vel por implementar dados a serem utilizados no DataUnit."
282
+ }
283
+ },
136
284
  "registerKey": {
137
285
  "type": "string",
138
286
  "mutable": false,
@@ -158,7 +306,7 @@ export class SnkAttach {
158
306
  "resolved": "string",
159
307
  "references": {}
160
308
  },
161
- "required": true,
309
+ "required": false,
162
310
  "optional": false,
163
311
  "docs": {
164
312
  "tags": [],
@@ -191,7 +339,8 @@ export class SnkAttach {
191
339
  }
192
340
  static get states() {
193
341
  return {
194
- "dataUnit": {},
342
+ "_currentFetcher": {},
343
+ "_currentDataUnit": {},
195
344
  "crudConfig": {}
196
345
  };
197
346
  }
@@ -1,4 +1,4 @@
1
- export const crudConfig = {
1
+ export const anexoSistemaCrudConfig = {
2
2
  grid: {
3
3
  columns: [
4
4
  { name: "ARQUIVOOULINK", orderIndex: 0, width: 0 },