@sankhyalabs/sankhyablocks 8.15.0-dev.9 → 8.15.0-rc.2

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 (159) 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-353e4af2.js → pesquisa-fetcher-e4a7c4c3.js} +215 -26
  5. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  6. package/dist/cjs/snk-actions-button_2.cjs.entry.js +5 -4
  7. package/dist/cjs/snk-application.cjs.entry.js +33 -4
  8. package/dist/cjs/snk-attach.cjs.entry.js +388 -57
  9. package/dist/cjs/snk-crud.cjs.entry.js +2 -3
  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-bar.cjs.entry.js +25 -3
  15. package/dist/cjs/snk-filter-item.cjs.entry.js +4 -47
  16. package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -1
  17. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
  18. package/dist/cjs/{snk-guides-viewer-e60ccc5e.js → snk-guides-viewer-d32c096f.js} +2 -3
  19. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -4
  20. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  21. package/dist/cjs/snk-simple-crud.cjs.entry.js +17 -6
  22. package/dist/collection/components/snk-application/snk-application.js +52 -9
  23. package/dist/collection/components/snk-attach/snk-attach.js +188 -39
  24. package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
  25. package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
  26. package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
  27. package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
  28. package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
  29. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
  30. package/dist/collection/components/snk-attach/structure/index.js +6 -3
  31. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
  32. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +2 -1
  33. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +4 -47
  34. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +19 -1
  35. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +39 -2
  36. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
  37. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
  38. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +53 -1
  39. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +3 -1
  40. package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
  41. package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
  42. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
  43. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
  44. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
  45. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
  46. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
  47. package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
  48. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +17 -3
  49. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +29 -22
  50. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
  51. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +7 -1
  52. package/dist/collection/lib/index.js +1 -1
  53. package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
  54. package/dist/components/SnkMessageBuilder.js +13 -0
  55. package/dist/components/dataunit-fetcher.js +54 -27
  56. package/dist/components/snk-actions-button2.js +1 -0
  57. package/dist/components/snk-application2.js +32 -1
  58. package/dist/components/snk-attach2.js +394 -57
  59. package/dist/components/snk-data-exporter2.js +1 -1
  60. package/dist/components/snk-filter-bar2.js +26 -3
  61. package/dist/components/snk-filter-item2.js +4 -47
  62. package/dist/components/snk-filter-modal.js +4 -2
  63. package/dist/components/snk-filter-multi-select.js +2 -1
  64. package/dist/components/snk-pesquisa2.js +1 -1
  65. package/dist/components/snk-simple-crud2.js +15 -1
  66. package/dist/components/taskbar-actions-button2.js +3 -1
  67. package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
  68. package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/esm/{dataunit-fetcher-0fc935a0.js → pesquisa-fetcher-fa0c2540.js} +215 -27
  71. package/dist/esm/sankhyablocks.js +1 -1
  72. package/dist/esm/snk-actions-button_2.entry.js +5 -4
  73. package/dist/esm/snk-application.entry.js +32 -3
  74. package/dist/esm/snk-attach.entry.js +389 -58
  75. package/dist/esm/snk-crud.entry.js +2 -3
  76. package/dist/esm/snk-data-exporter.entry.js +3 -3
  77. package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-5d201fb3.js} +1 -1
  78. package/dist/esm/snk-data-unit.entry.js +2 -2
  79. package/dist/esm/snk-detail-view.entry.js +4 -5
  80. package/dist/esm/snk-filter-bar.entry.js +25 -3
  81. package/dist/esm/snk-filter-item.entry.js +4 -47
  82. package/dist/esm/snk-filter-modal.entry.js +2 -1
  83. package/dist/esm/snk-filter-multi-select.entry.js +2 -1
  84. package/dist/esm/{snk-guides-viewer-98a8e45e.js → snk-guides-viewer-f49613c6.js} +2 -3
  85. package/dist/esm/snk-guides-viewer.entry.js +3 -4
  86. package/dist/esm/snk-pesquisa.entry.js +1 -1
  87. package/dist/esm/snk-simple-crud.entry.js +15 -4
  88. package/dist/sankhyablocks/p-02e3a45b.entry.js +1 -0
  89. package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
  90. package/dist/sankhyablocks/p-0ec5b2e5.js +1 -0
  91. package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
  92. package/dist/sankhyablocks/p-2582537c.entry.js +1 -0
  93. package/dist/sankhyablocks/p-282789a6.entry.js +1 -0
  94. package/dist/sankhyablocks/p-3b0e4e08.js +65 -0
  95. package/dist/sankhyablocks/{p-0874adb5.entry.js → p-40915359.entry.js} +1 -1
  96. package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
  97. package/dist/sankhyablocks/p-86801b08.entry.js +1 -0
  98. package/dist/sankhyablocks/p-96ef14f9.entry.js +1 -0
  99. package/dist/sankhyablocks/p-9b5944a4.entry.js +1 -0
  100. package/dist/sankhyablocks/p-9bdbc7d8.entry.js +1 -0
  101. package/dist/sankhyablocks/{p-90f9b4db.entry.js → p-a52b9254.entry.js} +3 -3
  102. package/dist/sankhyablocks/p-ac384baf.entry.js +1 -0
  103. package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
  104. package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
  105. package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
  106. package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
  107. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  108. package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
  109. package/dist/types/components/snk-application/snk-application.d.ts +7 -0
  110. package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
  111. package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
  112. package/dist/types/components/snk-attach/snk-attach.d.ts +27 -6
  113. package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
  114. package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
  115. package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
  116. package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
  117. package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
  118. package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
  119. package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
  120. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -2
  121. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +5 -0
  122. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +7 -0
  123. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
  124. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -1
  125. package/dist/types/components.d.ts +74 -2
  126. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  127. package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
  128. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
  129. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
  130. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
  131. package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
  132. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +1 -0
  133. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
  134. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  135. package/dist/types/lib/index.d.ts +1 -1
  136. package/package.json +5 -5
  137. package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
  138. package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
  139. package/dist/sankhyablocks/p-20726710.entry.js +0 -1
  140. package/dist/sankhyablocks/p-41560fd8.entry.js +0 -1
  141. package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
  142. package/dist/sankhyablocks/p-6678d5d4.entry.js +0 -1
  143. package/dist/sankhyablocks/p-71439fd9.entry.js +0 -1
  144. package/dist/sankhyablocks/p-7d8d7fe9.entry.js +0 -1
  145. package/dist/sankhyablocks/p-a91bb13d.js +0 -1
  146. package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
  147. package/dist/sankhyablocks/p-abfa8101.entry.js +0 -1
  148. package/dist/sankhyablocks/p-b3020263.entry.js +0 -1
  149. package/dist/sankhyablocks/p-bf93a748.js +0 -60
  150. package/dist/sankhyablocks/p-c6f89389.entry.js +0 -1
  151. package/dist/sankhyablocks/p-cebae710.entry.js +0 -1
  152. package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
  153. package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
  154. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
  155. /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
  156. /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
  157. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
  158. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
  159. /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -254,6 +254,9 @@ export class SnkFilterItem {
254
254
  }
255
255
  canClearFilter() {
256
256
  const { value, groupedItems = [] } = this.config;
257
+ if (value != undefined && this.config.type === FilterItemType.MULTI_LIST) {
258
+ return value.some((item) => item.check);
259
+ }
257
260
  return value !== undefined || groupedItems.some(item => item.visible);
258
261
  }
259
262
  getRightIconName() {
@@ -284,14 +287,9 @@ export class SnkFilterItem {
284
287
  }
285
288
  return this.hasActiveValue(this.config);
286
289
  }
287
- onEzClick() {
288
- console.log("onEzClick");
289
- }
290
290
  render() {
291
291
  const leftIcon = this.getLeftIconName();
292
- return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("ez-split-button", { label: "Split Button", class: "ez-button--primary", mode: "label-icon", iconName: "acao", size: "small", onEzClick: this.onEzClick,
293
- //onclick={this.onEzClick}
294
- items: items }), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
292
+ return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
295
293
  }
296
294
  static get is() { return "snk-filter-item"; }
297
295
  static get properties() {
@@ -442,44 +440,3 @@ export class SnkFilterItem {
442
440
  }];
443
441
  }
444
442
  }
445
- const items = [
446
- {
447
- id: "1",
448
- label: "Emitir NFe",
449
- type: "item"
450
- },
451
- {
452
- id: "2",
453
- label: "Cancelar NFe",
454
- type: "item"
455
- },
456
- {
457
- id: "3",
458
- label: "Exportar NFe",
459
- type: "item",
460
- children: [
461
- {
462
- id: "4",
463
- label: "Danfe PDF",
464
- type: "item",
465
- children: [
466
- {
467
- id: "6",
468
- label: "Modo retrato",
469
- type: "item"
470
- },
471
- {
472
- id: "7",
473
- label: "Modo paisagem",
474
- type: "item"
475
- }
476
- ]
477
- },
478
- {
479
- id: "5",
480
- label: "XML",
481
- type: "item"
482
- }
483
- ]
484
- }
485
- ];
@@ -17,6 +17,7 @@ export class SnkFilterModal {
17
17
  this.editPersonalizedFilter = undefined;
18
18
  this.deletePersonalizedFilter = undefined;
19
19
  this.filtersToDelete = [];
20
+ this.disablePersonalizedFilter = undefined;
20
21
  }
21
22
  /**
22
23
  * Emitido quando um filtro personalizado é deletado.
@@ -233,7 +234,7 @@ export class SnkFilterModal {
233
234
  const customFilters = this.filters.filter(filter => filter.filterType === FilterType.CUSTOM_FILTER);
234
235
  const quickFilters = this.filters.filter(filter => filter.filterType === FilterType.QUICK_FILTER);
235
236
  const otherFilters = this.filters.filter(filter => filter.filterType === FilterType.OTHER_FILTERS);
236
- return (h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
237
+ return (h("ez-modal-container", { class: "snk-filter-modal__container", modalTitle: this._modalTitle, cancelButtonLabel: this._cancelButtonLabel, okButtonLabel: this._okButtonLabel, onEzModalAction: this.modalActionListener.bind(this) }, h("div", { class: "snk-filter-modal__content ez-col--sd-12" }, !this.disablePersonalizedFilter && this.renderCollapsibleFilterBox(this.getCustomMessage('customFilters'), customFilters, false, false), this.renderCollapsibleFilterBox(this.getCustomMessage('quickFilters'), quickFilters, false), otherFilters.map(filter => this.renderCollapsibleFilterBox(filter.label, [filter], true)))));
237
238
  }
238
239
  static get is() { return "snk-filter-modal"; }
239
240
  static get originalStyleUrls() {
@@ -411,6 +412,23 @@ export class SnkFilterModal {
411
412
  "text": "Guarda filtros a serem deletados no Apply do modal"
412
413
  },
413
414
  "defaultValue": "[]"
415
+ },
416
+ "disablePersonalizedFilter": {
417
+ "type": "boolean",
418
+ "mutable": false,
419
+ "complexType": {
420
+ "original": "boolean",
421
+ "resolved": "boolean",
422
+ "references": {}
423
+ },
424
+ "required": false,
425
+ "optional": false,
426
+ "docs": {
427
+ "tags": [],
428
+ "text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
429
+ },
430
+ "attribute": "disable-personalized-filter",
431
+ "reflect": false
414
432
  }
415
433
  };
416
434
  }
@@ -11,6 +11,7 @@ export class SnkFilterBar {
11
11
  this._updateSequence = [];
12
12
  this._loadingPending = false;
13
13
  this._configUpdated = false;
14
+ this._firstLoad = true;
14
15
  this._pendingVariables = false;
15
16
  this._customfiltersToBeUpdated = [];
16
17
  this._calculateSortIndex = (item) => {
@@ -31,6 +32,7 @@ export class SnkFilterBar {
31
32
  this.resourceID = undefined;
32
33
  this.filterConfig = undefined;
33
34
  this.messagesBuilder = undefined;
35
+ this.disablePersonalizedFilter = undefined;
34
36
  this.allowDefault = undefined;
35
37
  this.scrollerLocked = false;
36
38
  this.showPersonalizedFilter = false;
@@ -164,13 +166,27 @@ export class SnkFilterBar {
164
166
  return;
165
167
  }
166
168
  this._loadingPending = false;
167
- this.dataUnit.loadData(undefined, undefined, true);
169
+ this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
168
170
  }
169
171
  if (this._configUpdated) {
170
172
  this._configUpdated = false;
171
173
  ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
172
174
  }
173
175
  }
176
+ async doLoadData(forceReload = false) {
177
+ try {
178
+ if (this._firstLoad && !forceReload) {
179
+ let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
180
+ if (!autoLoad) {
181
+ return;
182
+ }
183
+ }
184
+ this.dataUnit.loadData(undefined, undefined, true);
185
+ }
186
+ finally {
187
+ this._firstLoad = false;
188
+ }
189
+ }
174
190
  /**
175
191
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
176
192
  * através de um pequeno modulo na estrutura da aplicação:
@@ -179,6 +195,9 @@ export class SnkFilterBar {
179
195
  */
180
196
  getMessage(key, params, defaultValue) {
181
197
  var _a;
198
+ if (this.messagesBuilder == undefined && this._application) {
199
+ this.messagesBuilder = this._application.messagesBuilder;
200
+ }
182
201
  return ((_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params)) || defaultValue;
183
202
  }
184
203
  getFilter(_dataUnit) {
@@ -205,7 +224,7 @@ export class SnkFilterBar {
205
224
  registryFilterProvider() {
206
225
  this.dataUnit.addFilterProvider(this);
207
226
  if (this.filterConfig) {
208
- this.dataUnit.loadData(undefined, undefined, true);
227
+ this.doLoadData();
209
228
  }
210
229
  }
211
230
  itemFocused(selectedItem) {
@@ -340,6 +359,7 @@ export class SnkFilterBar {
340
359
  filterConfig: filtersConfigCopy,
341
360
  configName: this.configName,
342
361
  onComplete: callbackOnApplyFilter,
362
+ disablePersonalizedFilter: this.disablePersonalizedFilter,
343
363
  getMessage: (key, props) => this.getMessage(key, props),
344
364
  onAddPersonalizedFilter: () => this.addPersonalizedFilter(),
345
365
  onEditPersonalizedFilter: (id) => this.editPersonalizedFilter(id),
@@ -510,6 +530,23 @@ export class SnkFilterBar {
510
530
  "tags": [],
511
531
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
512
532
  }
533
+ },
534
+ "disablePersonalizedFilter": {
535
+ "type": "boolean",
536
+ "mutable": false,
537
+ "complexType": {
538
+ "original": "boolean",
539
+ "resolved": "boolean",
540
+ "references": {}
541
+ },
542
+ "required": false,
543
+ "optional": false,
544
+ "docs": {
545
+ "tags": [],
546
+ "text": "Desabilita a apresenta\u00E7\u00E3o da op\u00E7\u00E3o de filtros personalizados na filter bar (chip de filtros) \ne no modal lateral de filtros (container de filtros personalizados)."
547
+ },
548
+ "attribute": "disable-personalized-filter",
549
+ "reflect": false
513
550
  }
514
551
  };
515
552
  }
@@ -1,10 +1,11 @@
1
1
  import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
2
2
  class SnkFilterModalFactory {
3
- constructor({ filterConfig, configName, onComplete, getMessage, onAddPersonalizedFilter, onEditPersonalizedFilter, onDeletePersonalizedFilter }) {
3
+ constructor({ filterConfig, configName, onComplete, getMessage, disablePersonalizedFilter, onAddPersonalizedFilter, onEditPersonalizedFilter, onDeletePersonalizedFilter }) {
4
4
  this._filterConfig = filterConfig;
5
5
  this._configName = configName;
6
6
  this._onComplete = onComplete;
7
7
  this._getMessage = getMessage;
8
+ this._disablePersonalizedFilter = disablePersonalizedFilter;
8
9
  this._addPersonalizedFilterFn = onAddPersonalizedFilter;
9
10
  this._editPersonalizedFilterFn = onEditPersonalizedFilter;
10
11
  this._onDeletePersonalizedFilter = onDeletePersonalizedFilter;
@@ -18,6 +19,7 @@ class SnkFilterModalFactory {
18
19
  filterModal.className = "ez-size-height--full";
19
20
  filterModal.filters = this._filterConfig;
20
21
  filterModal.configName = this._configName;
22
+ filterModal.disablePersonalizedFilter = this._disablePersonalizedFilter;
21
23
  filterModal.getMessage = this._getMessage.bind(this);
22
24
  filterModal.applyFilters = this.applyFilters.bind(this);
23
25
  filterModal.closeModal = () => this._closeModal();
@@ -6,7 +6,7 @@
6
6
  --snk-pesquisa--font-family: var(--font-pattern, Arial);
7
7
  /*@doc Define o peso da fonte do componente.*/
8
8
  --snk-pesquisa--font-weight: var(--text-weight--medium, 400);
9
-
9
+
10
10
  /* records */
11
11
  /*@doc Define a cor da fonte do indicador de registros do componente.*/
12
12
  --snk-pesquisa__records--color: var(--text--primary, #626e82);
@@ -39,7 +39,6 @@
39
39
  /*@doc Define a largura da barra de rolagem do componente.*/
40
40
  --snk-pesquisa__scrollbar--width: var(--space--medium, 12px);
41
41
 
42
- max-height: 100%;
43
42
  height: 100%;
44
43
  display: flex;
45
44
  flex-direction: column;
@@ -70,7 +69,6 @@
70
69
  .snk-pesquisa__content {
71
70
  display: flex;
72
71
  flex-direction: column;
73
- height: 100%;
74
72
  overflow-y: auto;
75
73
  scrollbar-width: thin;
76
74
 
@@ -148,4 +146,4 @@
148
146
  .snk-pesquisa__btn:hover {
149
147
  /*public*/
150
148
  color: var(--snk-pesquisa__btn-hover--color);
151
- }
149
+ }
@@ -34,6 +34,8 @@ export class SnkSimpleCrud {
34
34
  this.taskbarManager = undefined;
35
35
  this.messagesBuilder = undefined;
36
36
  this.useEnterLikeTab = false;
37
+ this.actionsList = undefined;
38
+ this.configName = undefined;
37
39
  }
38
40
  resolveInMemoryBtns(taskbarButtons) {
39
41
  const newTaskBarConfig = [...taskbarButtons];
@@ -232,7 +234,7 @@ export class SnkSimpleCrud {
232
234
  }
233
235
  getActionsList() {
234
236
  var _a, _b;
235
- return [{
237
+ const hardList = [{
236
238
  value: StringUtils.generateUUID(),
237
239
  label: (_b = (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage("snkSimpleCrud.findColumn", undefined)) !== null && _b !== void 0 ? _b : "Buscar",
238
240
  disableCloseOnSelect: true,
@@ -241,6 +243,16 @@ export class SnkSimpleCrud {
241
243
  ? this.getColumnSearch(actionButton, item)
242
244
  : this.getFieldSearch(actionButton, item)
243
245
  }];
246
+ if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
247
+ const taskbarID = this.getTopTaskBarId();
248
+ return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
249
+ }
250
+ return hardList.concat(this.actionsList);
251
+ }
252
+ getTopTaskBarId() {
253
+ var _a;
254
+ return ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? `snkGridTopTaskbar.finish_edition${PresentationMode.PRIMARY}` :
255
+ `snkGridTopTaskbar.regular${PresentationMode.PRIMARY}`;
244
256
  }
245
257
  async keyDownListener(event) {
246
258
  if (!event.ctrlKey || event.key == undefined || event.key.toUpperCase() !== "F") {
@@ -494,6 +506,46 @@ export class SnkSimpleCrud {
494
506
  "attribute": "use-enter-like-tab",
495
507
  "reflect": false,
496
508
  "defaultValue": "false"
509
+ },
510
+ "actionsList": {
511
+ "type": "unknown",
512
+ "mutable": false,
513
+ "complexType": {
514
+ "original": "Array<Action>",
515
+ "resolved": "Action[]",
516
+ "references": {
517
+ "Array": {
518
+ "location": "global"
519
+ },
520
+ "Action": {
521
+ "location": "import",
522
+ "path": "../snk-taskbar/snk-taskbar"
523
+ }
524
+ }
525
+ },
526
+ "required": false,
527
+ "optional": false,
528
+ "docs": {
529
+ "tags": [],
530
+ "text": "A\u00E7\u00F5es a serem colocadas no bot\u00E3o \"Mais op\u00E7\u00F5es\" do componente snk-taskbar."
531
+ }
532
+ },
533
+ "configName": {
534
+ "type": "string",
535
+ "mutable": true,
536
+ "complexType": {
537
+ "original": "string",
538
+ "resolved": "string",
539
+ "references": {}
540
+ },
541
+ "required": false,
542
+ "optional": false,
543
+ "docs": {
544
+ "tags": [],
545
+ "text": "Usado para salvar as configura\u00E7\u00F5es dos blocos de constru\u00E7\u00E3o."
546
+ },
547
+ "attribute": "config-name",
548
+ "reflect": false
497
549
  }
498
550
  };
499
551
  }
@@ -67,7 +67,7 @@ export class TaskbarActionsButton {
67
67
  }
68
68
  }
69
69
  getSelectedAction(id, actions) {
70
- let selectedItem;
70
+ let selectedItem = null;
71
71
  for (const item of actions) {
72
72
  if (item.id === id) {
73
73
  selectedItem = item;
@@ -76,6 +76,8 @@ export class TaskbarActionsButton {
76
76
  if (!(item === null || item === void 0 ? void 0 : item.children))
77
77
  continue;
78
78
  selectedItem = this.getSelectedAction(id, item.children);
79
+ if (selectedItem)
80
+ break;
79
81
  }
80
82
  return selectedItem;
81
83
  }
@@ -13,7 +13,7 @@ export default class InMemoryLoader {
13
13
  this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
14
14
  }
15
15
  getRecordsToLoad() {
16
- if (this._initialRecords == undefined && this.dataUnit.records.length > 0) {
16
+ if (this._initialRecords == undefined || this.dataUnit.records.length > 0) {
17
17
  this._initialRecords = this.dataUnit.records;
18
18
  }
19
19
  return this._initialRecords;
@@ -1,6 +1,11 @@
1
- import { DataFetcher } from "../DataFetcher";
2
- import { SaveErrorsEnum } from "./fecthAttach/interfaces";
3
- export class AttachFetcher {
1
+ import { SaveErrorsEnum } from "./interfaces";
2
+ import { DataFetcher } from "../../DataFetcher";
3
+ const SERVICE = {
4
+ save: "AnexoSistemaSP.salvar",
5
+ delete: "AnexoSistemaSP.excluir",
6
+ download: "AnexoSistemaSP.baixar",
7
+ };
8
+ export class AnexoSistemaFetcher {
4
9
  constructor(entityName, registerKey, dataUnitName) {
5
10
  var _a;
6
11
  this.entityName = entityName;
@@ -18,14 +23,13 @@ export class AttachFetcher {
18
23
  }
19
24
  async save(change) {
20
25
  var _a, _b;
21
- const serviceName = "AnexoSistemaSP.salvar";
22
26
  let { updatingFields: fields } = change;
23
27
  fields = Object.assign(Object.assign({}, fields), { NOMEARQUIVO: (_a = fields.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0] });
24
28
  try {
25
29
  this.validateFields(fields);
26
30
  const fileInfo = !fields.LINK ? fields.NOMEARQUIVO : null;
27
31
  const reqBody = {
28
- serviceName,
32
+ serviceName: SERVICE.save,
29
33
  requestBody: {
30
34
  params: {
31
35
  resourceID: this.resourceID,
@@ -41,7 +45,7 @@ export class AttachFetcher {
41
45
  }
42
46
  }
43
47
  };
44
- const result = await DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody));
48
+ const result = await DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
45
49
  return Promise.resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { ARQUIVOOULINK: !!fields.LINK ? fields.LINK : fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name, __owner__dataunit__name__: this.dataUnitName })]);
46
50
  }
47
51
  catch (error) {
@@ -50,7 +54,6 @@ export class AttachFetcher {
50
54
  }
51
55
  async edit(change) {
52
56
  var _a, _b, _c;
53
- const serviceName = "AnexoSistemaSP.salvar";
54
57
  let { updatingFields: fields, record } = change;
55
58
  const getFieldValue = (fieldValue) => {
56
59
  if (fields[fieldValue] !== undefined)
@@ -64,7 +67,7 @@ export class AttachFetcher {
64
67
  try {
65
68
  this.validateFields(fields);
66
69
  const reqBody = {
67
- serviceName,
70
+ serviceName: SERVICE.save,
68
71
  requestBody: {
69
72
  params: {
70
73
  resourceID: this.resourceID,
@@ -82,7 +85,7 @@ export class AttachFetcher {
82
85
  }
83
86
  }
84
87
  };
85
- const result = await DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody));
88
+ const result = await DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody));
86
89
  return Promise.resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { ARQUIVOOULINK: !!fields.LINK ? fields.LINK : fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name, __owner__dataunit__name__: this.dataUnitName })]);
87
90
  }
88
91
  catch (error) {
@@ -91,10 +94,9 @@ export class AttachFetcher {
91
94
  }
92
95
  delete(record) {
93
96
  var _a;
94
- const serviceName = "AnexoSistemaSP.excluir";
95
97
  const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
96
98
  const reqBody = {
97
- serviceName,
99
+ serviceName: SERVICE.delete,
98
100
  requestBody: {
99
101
  paramsDelete: {
100
102
  keyAttach: record.CHAVEARQUIVO,
@@ -106,17 +108,16 @@ export class AttachFetcher {
106
108
  }
107
109
  };
108
110
  return new Promise((resolve, reject) => {
109
- DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody))
111
+ DataFetcher.get().callServiceBroker(SERVICE.delete, JSON.stringify(reqBody))
110
112
  .then(result => resolve(result))
111
113
  .catch(error => reject(error));
112
114
  });
113
115
  }
114
116
  getDownloadKey(record) {
115
117
  var _a;
116
- const serviceName = "AnexoSistemaSP.baixar";
117
118
  const attachField = ((_a = record.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) || {};
118
119
  const reqBody = {
119
- serviceName,
120
+ serviceName: SERVICE.download,
120
121
  requestBody: {
121
122
  paramsDown: {
122
123
  nameAttach: attachField === null || attachField === void 0 ? void 0 : attachField.name,
@@ -128,7 +129,7 @@ export class AttachFetcher {
128
129
  }
129
130
  };
130
131
  return new Promise((resolve, reject) => {
131
- DataFetcher.get().callServiceBroker(serviceName, JSON.stringify(reqBody))
132
+ DataFetcher.get().callServiceBroker(SERVICE.download, JSON.stringify(reqBody))
132
133
  .then(result => resolve(result))
133
134
  .catch(error => reject(error));
134
135
  });
@@ -0,0 +1,90 @@
1
+ import { SaveErrorsEnum } from "./interfaces";
2
+ import { DataFetcher } from "../../DataFetcher";
3
+ const SERVICE = {
4
+ save: "Attach.save",
5
+ delete: "Attach.remove",
6
+ view: "Attach.view",
7
+ repository: "RepositorioArquivoSP.abreArquivo"
8
+ };
9
+ export class AttachFetcher {
10
+ constructor(dataUnitName) {
11
+ this.dataUnitName = dataUnitName;
12
+ }
13
+ async save({ dataUnit: dataUnitName, record, updatingFields: fields, operation }) {
14
+ var _a, _b;
15
+ const isInsert = operation == "INSERT";
16
+ const dataBody = isInsert ? fields : record;
17
+ if (!isInsert && (fields === null || fields === void 0 ? void 0 : fields.DESCRICAO) && (fields === null || fields === void 0 ? void 0 : fields.DESCRICAO) !== (record === null || record === void 0 ? void 0 : record.DESCRICAO)) {
18
+ throw new Error(SaveErrorsEnum.DESCRIPTION_CANNOT_BE_CHANGED);
19
+ }
20
+ const reqBody = {
21
+ "anexo": {
22
+ "codata": isInsert ? fields === null || fields === void 0 ? void 0 : fields.REGISTER_KEY : record === null || record === void 0 ? void 0 : record.CODATA,
23
+ "sequencia": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.SEQUENCIA) || "0",
24
+ "tipo": (dataBody === null || dataBody === void 0 ? void 0 : dataBody.TIPO) || "N",
25
+ "descricao": dataBody === null || dataBody === void 0 ? void 0 : dataBody.DESCRICAO,
26
+ "arquivo": (_b = (_a = fields.CAMINHO_ARQUIVO) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name,
27
+ "ehInclusao": isInsert ? "S" : "N",
28
+ "ehArquivoRepositorio": "N"
29
+ }
30
+ };
31
+ return new Promise((resolve, reject) => {
32
+ DataFetcher.get().callServiceBroker(SERVICE.save, JSON.stringify(reqBody))
33
+ .then(result => {
34
+ var _a;
35
+ return resolve([Object.assign(Object.assign(Object.assign({}, result), fields), { __owner__dataunit__name__: (_a = this.dataUnitName) !== null && _a !== void 0 ? _a : dataUnitName })]);
36
+ })
37
+ .catch(error => reject(error));
38
+ });
39
+ }
40
+ async edit(change) {
41
+ throw new Error("Method not implemented.");
42
+ }
43
+ async delete(record) {
44
+ var request = {
45
+ anexo: {
46
+ codata: record.CODATA,
47
+ tipo: record.TIPO,
48
+ descricao: record.DESCRICAO,
49
+ }
50
+ };
51
+ const result = await DataFetcher.get().callServiceBroker(SERVICE.delete, JSON.stringify(request));
52
+ return Promise.resolve(result);
53
+ }
54
+ async getDownloadKey(record) {
55
+ var _a, _b, _c;
56
+ if (record.EHARQUIVOREPOSITORIO == 'S') {
57
+ const request = {
58
+ config: {
59
+ path: record.ARQUIVO,
60
+ tipoconteudo: record.TIPOCONTEUDO
61
+ }
62
+ };
63
+ const result = await DataFetcher.get().callServiceBroker(SERVICE.repository, JSON.stringify(request));
64
+ return Promise.resolve({
65
+ chave: {
66
+ valor: (_b = (_a = result === null || result === void 0 ? void 0 : result.responseBody) === null || _a === void 0 ? void 0 : _a.chave) === null || _b === void 0 ? void 0 : _b.valor
67
+ }
68
+ });
69
+ }
70
+ const criteria = {
71
+ anexo: {
72
+ codata: record.CODATA,
73
+ codemp: record.CODEMP,
74
+ sequencia: record.SEQUENCIA,
75
+ tipo: record.TIPO,
76
+ descricao: record.DESCRICAO,
77
+ tipoConteudo: record.TIPOCONTEUDO
78
+ }
79
+ };
80
+ const result = await DataFetcher.get().callServiceBroker(SERVICE.view, JSON.stringify(criteria));
81
+ if (result === null || result === void 0 ? void 0 : result.chaveAnexo) {
82
+ return Promise.resolve({
83
+ chave: {
84
+ valor: (_c = result === null || result === void 0 ? void 0 : result.chaveAnexo) === null || _c === void 0 ? void 0 : _c.idChaveAnexo
85
+ }
86
+ });
87
+ }
88
+ return Promise.reject(new Error("File not found."));
89
+ }
90
+ }
@@ -0,0 +1,2 @@
1
+ export { AttachFetcher } from "./attach-fetcher";
2
+ export { AnexoSistemaFetcher } from "./anexo-sistema-fetcher";
@@ -3,4 +3,5 @@ export var SaveErrorsEnum;
3
3
  SaveErrorsEnum["LINK_AND_FILE_AT_THE_SAME_TIME"] = "LINK_AND_FILE_AT_THE_SAME_TIME";
4
4
  SaveErrorsEnum["ANY_LINK_OR_FILE_FILLED"] = "ANY_LINK_OR_FILE_FILLED";
5
5
  SaveErrorsEnum["UNKNOWN"] = "UNKNOWN";
6
+ SaveErrorsEnum["DESCRIPTION_CANNOT_BE_CHANGED"] = "DESCRIPTION_CANNOT_BE_CHANGED";
6
7
  })(SaveErrorsEnum || (SaveErrorsEnum = {}));
@@ -184,15 +184,29 @@ export default class DataUnitFetcher {
184
184
  });
185
185
  return updatingFields;
186
186
  }
187
+ getUpdatingFields(dataUnit, originalUpdatingFields) {
188
+ if (originalUpdatingFields == undefined) {
189
+ return;
190
+ }
191
+ const updatingFields = Object.assign({}, originalUpdatingFields);
192
+ Object.keys(updatingFields).forEach(key => {
193
+ const descriptor = dataUnit.getField(key);
194
+ if (descriptor != undefined && descriptor.standAlone) {
195
+ delete updatingFields[key];
196
+ }
197
+ });
198
+ return this.addTransientProperties(dataUnit, updatingFields);
199
+ }
187
200
  saveData(dataUnit, duChanges) {
188
201
  const updatedRecordsIds = [];
189
202
  const addedRecordsIds = [];
190
203
  const changes = duChanges.map((change) => {
191
- const { dataUnit: changeDU, record, updatingFields, operation } = change;
204
+ const { dataUnit: changeDU, record, operation } = change;
192
205
  const dataUnitInstance = DataUnitStorage.get(changeDU);
206
+ const updatingFields = this.getUpdatingFields(dataUnitInstance, change.updatingFields);
193
207
  let parsedUpdatingFields;
194
- if (updatingFields) {
195
- parsedUpdatingFields = Object.entries(this.addTransientProperties(dataUnit, updatingFields)).map(([fieldName, value]) => {
208
+ if (updatingFields != undefined) {
209
+ parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
196
210
  const descriptor = dataUnitInstance.getField(fieldName);
197
211
  const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
198
212
  return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };