@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-33766.1 → 0.0.0-bugfix-dev-KB-39469.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.
- package/dist/cjs/{ConfigStorage-302bbbd4.js → ConfigStorage-d4c99a5e.js} +2 -2
- package/dist/cjs/{DataFetcher-ba94ed5b.js → DataFetcher-99f0f6ed.js} +5 -3
- package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
- package/dist/cjs/{SnkFormConfigManager-71c4768e.js → SnkFormConfigManager-3621bfc4.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
- package/dist/cjs/{auth-fetcher-c8467c07.js → auth-fetcher-5161d082.js} +1 -1
- package/dist/cjs/{form-config-fetcher-df043d3d.js → form-config-fetcher-9f1a13ca.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-bd4c52da.js → pesquisa-fetcher-c416a6b7.js} +238 -28
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +21 -6
- package/dist/cjs/snk-application.cjs.entry.js +37 -8
- package/dist/cjs/snk-attach.cjs.entry.js +389 -58
- package/dist/cjs/snk-crud.cjs.entry.js +11 -9
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
- package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-82c08a8c.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
- package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +28 -6
- package/dist/cjs/snk-filter-item.cjs.entry.js +3 -0
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal.cjs.entry.js +2 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +5 -4
- package/dist/cjs/{snk-guides-viewer-dce60912.js → snk-guides-viewer-3ab9623e.js} +8 -9
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +19 -8
- package/dist/cjs/snk-taskbar.cjs.entry.js +51 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/__mocks__/snk-application.js +7 -0
- package/dist/collection/components/snk-application/snk-application.js +43 -0
- package/dist/collection/components/snk-attach/snk-attach.js +188 -39
- package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
- package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
- package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
- package/dist/collection/components/snk-attach/structure/index.js +6 -3
- package/dist/collection/components/snk-crud/snk-crud.js +23 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +2 -2
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +5 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +19 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +39 -2
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
- package/dist/collection/components/snk-grid/snk-grid.js +19 -1
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +53 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +17 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +88 -3
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +5 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +31 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +37 -23
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +21 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +10 -4
- package/dist/collection/lib/index.js +1 -1
- package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
- package/dist/components/DataFetcher.js +5 -3
- package/dist/components/SnkMessageBuilder.js +13 -0
- package/dist/components/dataunit-fetcher.js +79 -31
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +32 -1
- package/dist/components/snk-attach2.js +394 -57
- package/dist/components/snk-crud.js +7 -3
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +3 -3
- package/dist/components/snk-entity-list.js +5 -3
- package/dist/components/snk-filter-bar2.js +26 -3
- package/dist/components/snk-filter-item2.js +3 -0
- package/dist/components/snk-filter-modal.js +4 -2
- package/dist/components/snk-filter-multi-select.js +2 -1
- package/dist/components/snk-grid2.js +3 -1
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-simple-crud2.js +15 -1
- package/dist/components/snk-taskbar2.js +55 -4
- package/dist/components/taskbar-actions-button2.js +17 -1
- package/dist/esm/{ConfigStorage-4151acc8.js → ConfigStorage-39ed8aeb.js} +2 -2
- package/dist/esm/{DataFetcher-aa159c5a.js → DataFetcher-a650ae58.js} +5 -3
- package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
- package/dist/esm/{SnkFormConfigManager-5c7d3771.js → SnkFormConfigManager-692e20c7.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
- package/dist/esm/{auth-fetcher-c05dc474.js → auth-fetcher-17dc5b5e.js} +1 -1
- package/dist/esm/{form-config-fetcher-36219cd3.js → form-config-fetcher-f121f880.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-65714f21.js → pesquisa-fetcher-ab16a2e8.js} +238 -29
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +21 -6
- package/dist/esm/snk-application.entry.js +36 -7
- package/dist/esm/snk-attach.entry.js +390 -59
- package/dist/esm/snk-crud.entry.js +11 -9
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-5d201fb3.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +8 -9
- package/dist/esm/snk-entity-list.entry.js +5 -3
- package/dist/esm/snk-filter-bar.entry.js +28 -6
- package/dist/esm/snk-filter-item.entry.js +3 -0
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-filter-modal.entry.js +2 -1
- package/dist/esm/snk-filter-multi-select.entry.js +2 -1
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +5 -4
- package/dist/esm/{snk-guides-viewer-8b9564bd.js → snk-guides-viewer-462b4c9e.js} +8 -9
- package/dist/esm/snk-guides-viewer.entry.js +7 -8
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +17 -6
- package/dist/esm/snk-taskbar.entry.js +52 -4
- package/dist/sankhyablocks/p-007f1026.entry.js +1 -0
- package/dist/sankhyablocks/p-0264dba5.entry.js +1 -0
- package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
- package/dist/sankhyablocks/p-0ae89faa.entry.js +1 -0
- package/dist/sankhyablocks/{p-cb7419e0.entry.js → p-0b0b36ac.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/p-33bc44a6.entry.js +1 -0
- package/dist/sankhyablocks/p-48afb1d3.entry.js +1 -0
- package/dist/sankhyablocks/p-50783a8b.js +1 -0
- package/dist/sankhyablocks/{p-aa95fb2c.js → p-67aedbe0.js} +1 -1
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/{p-573a07c5.js → p-725d04ba.js} +1 -1
- package/dist/sankhyablocks/{p-e0fd9555.entry.js → p-827e4b01.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6977a26c.entry.js → p-86801b08.entry.js} +1 -1
- package/dist/sankhyablocks/p-88c7dd9a.entry.js +1 -0
- package/dist/sankhyablocks/p-93d7e848.entry.js +1 -0
- package/dist/sankhyablocks/{p-7f3c7b09.entry.js → p-9d608b62.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
- package/dist/sankhyablocks/p-a3a9d37d.js +1 -0
- package/dist/sankhyablocks/{p-9695f78b.js → p-be75153c.js} +1 -1
- package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
- package/dist/sankhyablocks/p-c093edc7.entry.js +1 -0
- package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
- package/dist/sankhyablocks/p-c6247955.js +65 -0
- package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-761ed32f.entry.js → p-e3bd000e.entry.js} +1 -1
- package/dist/sankhyablocks/p-ed2dce4b.entry.js +1 -0
- package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
- package/dist/sankhyablocks/{p-1d75d9f9.entry.js → p-fcdcb0e2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c223b7b2.entry.js → p-fd0a8d68.entry.js} +3 -3
- package/dist/sankhyablocks/{p-0874adb5.entry.js → p-fdc4cb9b.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/__mocks__/snk-application.d.ts +3 -0
- package/dist/types/components/snk-application/snk-application.d.ts +7 -0
- package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
- package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +27 -6
- package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
- package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
- package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
- package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
- package/dist/types/components/snk-crud/snk-crud.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +3 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -1
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +1 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +20 -1
- package/dist/types/components.d.ts +106 -2
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
- package/dist/types/lib/index.d.ts +1 -1
- package/package.json +15 -6
- package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
- package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-28564b5e.entry.js +0 -1
- package/dist/sankhyablocks/p-29804fc5.js +0 -60
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-55930465.entry.js +0 -1
- package/dist/sankhyablocks/p-69efa80d.entry.js +0 -1
- package/dist/sankhyablocks/p-7d8d7fe9.entry.js +0 -1
- package/dist/sankhyablocks/p-95a3778f.entry.js +0 -1
- package/dist/sankhyablocks/p-a9e5b094.entry.js +0 -1
- package/dist/sankhyablocks/p-b05ab13d.entry.js +0 -1
- package/dist/sankhyablocks/p-b146a9f0.entry.js +0 -1
- package/dist/sankhyablocks/p-bedb8ad6.entry.js +0 -1
- package/dist/sankhyablocks/p-cdd66657.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
- package/dist/sankhyablocks/p-e6380c60.js +0 -1
- package/dist/sankhyablocks/p-ebbc17c6.js +0 -1
- package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
- /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
|
@@ -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
|
-
|
|
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
|
}
|
|
@@ -59,12 +59,28 @@ export class TaskbarActionsButton {
|
|
|
59
59
|
return this._showDropdown && ((_a = this.actions) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
60
60
|
}
|
|
61
61
|
onSelectAction(iAction) {
|
|
62
|
-
const
|
|
62
|
+
const actions = this.actions.map(action => (Object.assign(Object.assign({}, action), { id: action.value })));
|
|
63
|
+
const selectedAction = this.getSelectedAction(iAction.id, actions);
|
|
63
64
|
this.taskbarActionSelected.emit(selectedAction);
|
|
64
65
|
if (!selectedAction.disableCloseOnSelect) {
|
|
65
66
|
this._showDropdown = false;
|
|
66
67
|
}
|
|
67
68
|
}
|
|
69
|
+
getSelectedAction(id, actions) {
|
|
70
|
+
let selectedItem = null;
|
|
71
|
+
for (const item of actions) {
|
|
72
|
+
if (item.id === id) {
|
|
73
|
+
selectedItem = item;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
if (!(item === null || item === void 0 ? void 0 : item.children))
|
|
77
|
+
continue;
|
|
78
|
+
selectedItem = this.getSelectedAction(id, item.children);
|
|
79
|
+
if (selectedItem)
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
return selectedItem;
|
|
83
|
+
}
|
|
68
84
|
dropdownItemBuilder(item, _level) {
|
|
69
85
|
const itemAction = this.actions.find(action => action.value === item.id);
|
|
70
86
|
if (!itemAction || !itemAction.itemBuilder) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
|
1
|
+
import { ApplicationContext, ElementIDUtils, OverflowDirection, OverflowWatcher, StringUtils, OVERFLOWED_CLASS_NAME } from '@sankhyalabs/core';
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
3
|
import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
|
|
4
4
|
import { AuthorizationElements, buildCustomButton, buildElem, TaskbarElement, VisibleWhenForbidden, } from './elements/taskbar-elements';
|
|
@@ -6,6 +6,8 @@ import { PresentationMode } from '../../lib/@types';
|
|
|
6
6
|
export class SnkTaskbar {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
|
9
|
+
this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
|
|
10
|
+
this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
|
|
9
11
|
this._titleKeyByElement = {
|
|
10
12
|
[TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
|
11
13
|
[TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
|
@@ -23,11 +25,14 @@ export class SnkTaskbar {
|
|
|
23
25
|
[TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
|
24
26
|
};
|
|
25
27
|
this._permissions = undefined;
|
|
28
|
+
this._overFlowedElements = [];
|
|
26
29
|
this._customElements = undefined;
|
|
27
30
|
this._customElementsId = undefined;
|
|
28
31
|
this._slotContainer = undefined;
|
|
32
|
+
this.alignRigth = false;
|
|
29
33
|
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
|
30
34
|
this.customContainerId = undefined;
|
|
35
|
+
this.overflowStrategy = 'hiddenItems';
|
|
31
36
|
this.configName = undefined;
|
|
32
37
|
this.resourceID = undefined;
|
|
33
38
|
this.buttons = undefined;
|
|
@@ -41,6 +46,7 @@ export class SnkTaskbar {
|
|
|
41
46
|
}
|
|
42
47
|
observeButtons() {
|
|
43
48
|
this._definitions = undefined;
|
|
49
|
+
requestAnimationFrame(() => { var _a; return (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.forceUpdate(); });
|
|
44
50
|
}
|
|
45
51
|
// Internal methods
|
|
46
52
|
elementsFromString(strButtons) {
|
|
@@ -221,15 +227,52 @@ export class SnkTaskbar {
|
|
|
221
227
|
}
|
|
222
228
|
this.validatePresentationMode();
|
|
223
229
|
}
|
|
230
|
+
handleOverFlow(overFlowingElements) {
|
|
231
|
+
const elementsToHandle = overFlowingElements.filter(element => !this.hasToIgnoreOverFlow(element));
|
|
232
|
+
this.resetOverFlowedElements();
|
|
233
|
+
this.doOverFlowElements(elementsToHandle);
|
|
234
|
+
}
|
|
235
|
+
resetOverFlowedElements() {
|
|
236
|
+
this._overFlowedElements.forEach(element => {
|
|
237
|
+
element.classList.remove(OVERFLOWED_CLASS_NAME);
|
|
238
|
+
});
|
|
239
|
+
this._overFlowedElements = [];
|
|
240
|
+
}
|
|
241
|
+
doOverFlowElements(overFlowedElements) {
|
|
242
|
+
overFlowedElements.forEach(element => {
|
|
243
|
+
element.classList.add(OVERFLOWED_CLASS_NAME);
|
|
244
|
+
this._overFlowedElements.push(element);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
hasToIgnoreOverFlow(element) {
|
|
248
|
+
return element.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME);
|
|
249
|
+
}
|
|
250
|
+
handleOverFlowStrategy() {
|
|
251
|
+
if (this.overflowStrategy === 'hiddenItems') {
|
|
252
|
+
this._overFlowWatcher = new OverflowWatcher(this.buildOverFlowWatcherParams());
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
buildOverFlowWatcherParams() {
|
|
256
|
+
return {
|
|
257
|
+
element: this._element,
|
|
258
|
+
callback: this.handleOverFlow.bind(this),
|
|
259
|
+
overFlowDirection: OverflowDirection.HORIZONTAL,
|
|
260
|
+
deltaSize: 1,
|
|
261
|
+
notOverFlow: ["moreOptions"]
|
|
262
|
+
};
|
|
263
|
+
}
|
|
224
264
|
componentDidLoad() {
|
|
225
265
|
const dataInfo = { dataUnit: this.dataUnit };
|
|
226
266
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
267
|
+
this.handleOverFlowStrategy();
|
|
227
268
|
}
|
|
228
269
|
componentDidRender() {
|
|
229
270
|
this.appendCustomElementsInTaskbar();
|
|
230
271
|
}
|
|
231
272
|
disconnectedCallback() {
|
|
273
|
+
var _a;
|
|
232
274
|
this.unlinkAllCustomElements();
|
|
275
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
233
276
|
}
|
|
234
277
|
unlinkAllCustomElements() {
|
|
235
278
|
var _a;
|
|
@@ -247,7 +290,7 @@ export class SnkTaskbar {
|
|
|
247
290
|
return undefined;
|
|
248
291
|
}
|
|
249
292
|
let index = 0;
|
|
250
|
-
return (h(Host,
|
|
293
|
+
return (h(Host, { class: this.getHostClasses() }, this.removeEmpty(this._definitions.map((elem) => {
|
|
251
294
|
var _a;
|
|
252
295
|
if (elem === TaskbarElement.DIVIDER) {
|
|
253
296
|
index = 0;
|
|
@@ -265,7 +308,12 @@ export class SnkTaskbar {
|
|
|
265
308
|
return this.addCustomElementContainer(elem);
|
|
266
309
|
}
|
|
267
310
|
return h("slot", { name: elem });
|
|
268
|
-
})), h("div", { class:
|
|
311
|
+
})), h("div", { class: this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME }, h("slot", { name: this.customSlotId }))));
|
|
312
|
+
}
|
|
313
|
+
getHostClasses() {
|
|
314
|
+
if (this.overflowStrategy !== 'hiddenItems')
|
|
315
|
+
return 'no-wrap';
|
|
316
|
+
return `full-width ${this.alignRigth ? 'align-right' : ""}`;
|
|
269
317
|
}
|
|
270
318
|
static get is() { return "snk-taskbar"; }
|
|
271
319
|
static get encapsulation() { return "scoped"; }
|
|
@@ -281,6 +329,24 @@ export class SnkTaskbar {
|
|
|
281
329
|
}
|
|
282
330
|
static get properties() {
|
|
283
331
|
return {
|
|
332
|
+
"alignRigth": {
|
|
333
|
+
"type": "boolean",
|
|
334
|
+
"mutable": false,
|
|
335
|
+
"complexType": {
|
|
336
|
+
"original": "boolean",
|
|
337
|
+
"resolved": "boolean",
|
|
338
|
+
"references": {}
|
|
339
|
+
},
|
|
340
|
+
"required": false,
|
|
341
|
+
"optional": false,
|
|
342
|
+
"docs": {
|
|
343
|
+
"tags": [],
|
|
344
|
+
"text": "Usado para determinar O alinhamento dos items na taskbar."
|
|
345
|
+
},
|
|
346
|
+
"attribute": "align-rigth",
|
|
347
|
+
"reflect": false,
|
|
348
|
+
"defaultValue": "false"
|
|
349
|
+
},
|
|
284
350
|
"customSlotId": {
|
|
285
351
|
"type": "string",
|
|
286
352
|
"mutable": false,
|
|
@@ -316,6 +382,24 @@ export class SnkTaskbar {
|
|
|
316
382
|
"attribute": "custom-container-id",
|
|
317
383
|
"reflect": false
|
|
318
384
|
},
|
|
385
|
+
"overflowStrategy": {
|
|
386
|
+
"type": "string",
|
|
387
|
+
"mutable": false,
|
|
388
|
+
"complexType": {
|
|
389
|
+
"original": "'hiddenItems' | 'none'",
|
|
390
|
+
"resolved": "\"hiddenItems\" | \"none\"",
|
|
391
|
+
"references": {}
|
|
392
|
+
},
|
|
393
|
+
"required": false,
|
|
394
|
+
"optional": false,
|
|
395
|
+
"docs": {
|
|
396
|
+
"tags": [],
|
|
397
|
+
"text": "Define como ser\u00E1 o comportamento da taskbar quando ocorrer overflow"
|
|
398
|
+
},
|
|
399
|
+
"attribute": "overflow-strategy",
|
|
400
|
+
"reflect": false,
|
|
401
|
+
"defaultValue": "'hiddenItems'"
|
|
402
|
+
},
|
|
319
403
|
"configName": {
|
|
320
404
|
"type": "string",
|
|
321
405
|
"mutable": false,
|
|
@@ -515,6 +599,7 @@ export class SnkTaskbar {
|
|
|
515
599
|
static get states() {
|
|
516
600
|
return {
|
|
517
601
|
"_permissions": {},
|
|
602
|
+
"_overFlowedElements": {},
|
|
518
603
|
"_customElements": {},
|
|
519
604
|
"_customElementsId": {},
|
|
520
605
|
"_slotContainer": {}
|
|
@@ -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
|
|
16
|
+
if (this._initialRecords == undefined || this.dataUnit.records.length > 0) {
|
|
17
17
|
this._initialRecords = this.dataUnit.records;
|
|
18
18
|
}
|
|
19
19
|
return this._initialRecords;
|
|
@@ -275,7 +275,6 @@ export class DataFetcher {
|
|
|
275
275
|
if (http.readyState == 4 && http.status == 200) {
|
|
276
276
|
try {
|
|
277
277
|
const jsonResp = JSON.parse(http.responseText);
|
|
278
|
-
await this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
|
279
278
|
/**
|
|
280
279
|
* Este trecho difere do projeto HTML5 devido à decisão de adotar uma abordagem síncrona para esta chamada. Isso é justificado pelo fato de que, no cenário em questão, a abordagem assíncrona teria impactos negativos.
|
|
281
280
|
*
|
|
@@ -286,8 +285,10 @@ export class DataFetcher {
|
|
|
286
285
|
if (this.isServiceBrokerError(jsonResp)) {
|
|
287
286
|
reject(this.processServiceBrokerErrorInfo(jsonResp));
|
|
288
287
|
}
|
|
289
|
-
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED
|
|
290
|
-
|
|
288
|
+
else if (jsonResp.status == DataFetcher.SERVICE_BROKER_STATUS.SERVICE_CANCELED) {
|
|
289
|
+
if (jsonResp.statusMessage) {
|
|
290
|
+
console.debug(`[DataFetcher] ${jsonResp.statusMessage}`);
|
|
291
|
+
}
|
|
291
292
|
}
|
|
292
293
|
else {
|
|
293
294
|
accept(jsonResp.responseBody);
|
|
@@ -295,6 +296,7 @@ export class DataFetcher {
|
|
|
295
296
|
(_a = this.application) === null || _a === void 0 ? void 0 : _a.info(jsonResp.statusMessage);
|
|
296
297
|
}
|
|
297
298
|
}
|
|
299
|
+
this.processServiceBrokerClientEvents({ clientEvents: jsonResp === null || jsonResp === void 0 ? void 0 : jsonResp.clientEvents, serviceName, payloadJson, accept, reject });
|
|
298
300
|
}
|
|
299
301
|
catch (err) {
|
|
300
302
|
console.warn(`Erro ao executar serviço: ${err}`);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
+
}
|
package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 = {}));
|
|
@@ -171,14 +171,41 @@ export default class DataUnitFetcher {
|
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
+
addTransientProperties(dataUnit, updatingFields) {
|
|
175
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
|
176
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
|
177
|
+
return updatingFields;
|
|
178
|
+
}
|
|
179
|
+
if (updatingFields == undefined) {
|
|
180
|
+
updatingFields = {};
|
|
181
|
+
}
|
|
182
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
|
183
|
+
updatingFields[`transient.${name}`] = value;
|
|
184
|
+
});
|
|
185
|
+
return updatingFields;
|
|
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
|
+
}
|
|
174
200
|
saveData(dataUnit, duChanges) {
|
|
175
201
|
const updatedRecordsIds = [];
|
|
176
202
|
const addedRecordsIds = [];
|
|
177
203
|
const changes = duChanges.map((change) => {
|
|
178
|
-
const { dataUnit: changeDU, record,
|
|
204
|
+
const { dataUnit: changeDU, record, operation } = change;
|
|
179
205
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
|
206
|
+
const updatingFields = this.getUpdatingFields(dataUnitInstance, change.updatingFields);
|
|
180
207
|
let parsedUpdatingFields;
|
|
181
|
-
if (updatingFields) {
|
|
208
|
+
if (updatingFields != undefined) {
|
|
182
209
|
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
|
183
210
|
const descriptor = dataUnitInstance.getField(fieldName);
|
|
184
211
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
|
@@ -226,7 +253,8 @@ export default class DataUnitFetcher {
|
|
|
226
253
|
}
|
|
227
254
|
responseRecord.fields.forEach(({ name, value }) => {
|
|
228
255
|
var _a;
|
|
229
|
-
|
|
256
|
+
const valueFromString = (_a = dataUnitInstance === null || dataUnitInstance === void 0 ? void 0 : dataUnitInstance.valueFromString) === null || _a === void 0 ? void 0 : _a.call(dataUnitInstance, name, value);
|
|
257
|
+
duRecord[name] = (valueFromString !== undefined) ? valueFromString : value;
|
|
230
258
|
});
|
|
231
259
|
dataUnitRecords.push(duRecord);
|
|
232
260
|
});
|