@sankhyalabs/sankhyablocks 8.15.0-dev.2 → 8.15.0-dev.20
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-0d507a8f.js → ConfigStorage-302bbbd4.js} +25 -15
- package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
- package/dist/cjs/{SnkFormConfigManager-467907f6.js → SnkFormConfigManager-71c4768e.js} +1 -1
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
- package/dist/cjs/{index-0e663819.js → index-0922807b.js} +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-bdaf9482.js → pesquisa-fetcher-e4a7c4c3.js} +254 -34
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +23 -5
- package/dist/cjs/snk-application.cjs.entry.js +74 -6
- package/dist/cjs/snk-attach.cjs.entry.js +395 -57
- package/dist/cjs/snk-crud.cjs.entry.js +5 -6
- 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-filter-bar.cjs.entry.js +40 -5
- package/dist/cjs/snk-filter-item.cjs.entry.js +3 -0
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -2
- package/dist/cjs/snk-filter-modal.cjs.entry.js +16 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
- package/dist/cjs/snk-form.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +41 -18
- package/dist/cjs/{snk-guides-viewer-9342bca1.js → snk-guides-viewer-d32c096f.js} +6 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/{taskbar-elements-b8c428a9.js → taskbar-elements-01b85b99.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +119 -13
- package/dist/collection/components/snk-attach/snk-attach.js +194 -38
- 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 +2 -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-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 +84 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +0 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +84 -3
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +5 -1
- package/dist/collection/components/snk-grid/snk-grid.js +39 -16
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -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 +26 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -1
- package/dist/collection/lib/@types/index.js +1 -0
- package/dist/collection/lib/configs/ConfigStorage.js +24 -14
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
- 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 +55 -31
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +7 -1
- package/dist/collection/lib/index.js +1 -1
- package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
- package/dist/components/ConfigStorage.js +25 -15
- package/dist/components/SnkMessageBuilder.js +13 -0
- package/dist/components/dataunit-fetcher.js +93 -35
- package/dist/components/index2.js +1 -0
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +73 -3
- package/dist/components/snk-attach2.js +400 -56
- package/dist/components/snk-crud.js +1 -1
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-filter-bar2.js +42 -5
- package/dist/components/snk-filter-item2.js +3 -0
- package/dist/components/snk-filter-modal-item2.js +0 -1
- package/dist/components/snk-filter-modal.js +21 -3
- package/dist/components/snk-filter-multi-select.js +2 -1
- package/dist/components/snk-grid2.js +38 -15
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-simple-crud2.js +15 -1
- package/dist/components/taskbar-actions-button2.js +21 -2
- package/dist/esm/{ConfigStorage-379a9cba.js → ConfigStorage-4151acc8.js} +25 -15
- package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
- package/dist/esm/{SnkFormConfigManager-587e9030.js → SnkFormConfigManager-5c7d3771.js} +1 -1
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
- package/dist/esm/{index-1564817d.js → index-0ece87a6.js} +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-cc1650eb.js → pesquisa-fetcher-fa0c2540.js} +255 -36
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +23 -5
- package/dist/esm/snk-application.entry.js +74 -6
- package/dist/esm/snk-attach.entry.js +396 -58
- package/dist/esm/snk-crud.entry.js +5 -6
- 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-filter-bar.entry.js +40 -5
- package/dist/esm/snk-filter-item.entry.js +3 -0
- package/dist/esm/snk-filter-modal-item.entry.js +1 -2
- package/dist/esm/snk-filter-modal.entry.js +16 -1
- package/dist/esm/snk-filter-multi-select.entry.js +2 -1
- package/dist/esm/snk-form.entry.js +2 -2
- package/dist/esm/snk-grid-config.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +41 -18
- package/dist/esm/{snk-guides-viewer-9ce9588c.js → snk-guides-viewer-f49613c6.js} +6 -7
- package/dist/esm/snk-guides-viewer.entry.js +7 -8
- package/dist/esm/snk-personalized-filter.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/{taskbar-elements-26c981af.js → taskbar-elements-d4d0b424.js} +1 -1
- package/dist/sankhyablocks/p-02e3a45b.entry.js +1 -0
- package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
- package/dist/sankhyablocks/p-0ec5b2e5.js +1 -0
- package/dist/sankhyablocks/{p-729f5f5b.entry.js → p-1d75d9f9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-2582537c.entry.js +1 -0
- package/dist/sankhyablocks/p-282789a6.entry.js +1 -0
- package/dist/sankhyablocks/p-374d03f6.js +1 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/p-3b0e4e08.js +65 -0
- package/dist/sankhyablocks/{p-35fe6e61.entry.js → p-40915359.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2028633c.js → p-573a07c5.js} +1 -1
- package/dist/sankhyablocks/p-62896624.entry.js +1 -0
- package/dist/sankhyablocks/{p-953346b9.entry.js → p-69efa80d.entry.js} +1 -1
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/{p-aaa1438e.entry.js → p-761ed32f.entry.js} +1 -1
- package/dist/sankhyablocks/p-7f3c7b09.entry.js +1 -0
- package/dist/sankhyablocks/{p-6977a26c.entry.js → p-86801b08.entry.js} +1 -1
- package/dist/sankhyablocks/p-9b5944a4.entry.js +1 -0
- package/dist/sankhyablocks/p-9bdbc7d8.entry.js +1 -0
- package/dist/sankhyablocks/p-aa95fb2c.js +56 -0
- package/dist/sankhyablocks/p-ac384baf.entry.js +1 -0
- package/dist/sankhyablocks/p-b05ab13d.entry.js +1 -0
- package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
- package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
- package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
- package/dist/sankhyablocks/p-e0fd9555.entry.js +1 -0
- package/dist/sankhyablocks/p-e817f254.entry.js +11 -0
- package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +12 -2
- 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 +28 -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-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 +19 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +16 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +7 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +1 -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 +2 -0
- package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +1 -0
- package/dist/types/components.d.ts +108 -13
- package/dist/types/lib/@types/index.d.ts +2 -1
- package/dist/types/lib/configs/ConfigStorage.d.ts +4 -0
- 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 +4 -1
- 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-145c4434.js +0 -1
- package/dist/sankhyablocks/p-17dda7a2.entry.js +0 -1
- package/dist/sankhyablocks/p-19f51c6b.entry.js +0 -11
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-311c6173.entry.js +0 -1
- package/dist/sankhyablocks/p-4396d1a6.js +0 -56
- package/dist/sankhyablocks/p-44e894af.entry.js +0 -1
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-4b0ea83f.entry.js +0 -1
- package/dist/sankhyablocks/p-5534e08c.js +0 -1
- package/dist/sankhyablocks/p-78777ae0.entry.js +0 -1
- package/dist/sankhyablocks/p-9c3229fc.entry.js +0 -1
- package/dist/sankhyablocks/p-a037f5b4.entry.js +0 -1
- package/dist/sankhyablocks/p-a702a1a2.js +0 -60
- package/dist/sankhyablocks/p-c259545b.entry.js +0 -1
- package/dist/sankhyablocks/p-d1677df0.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
- package/dist/sankhyablocks/p-dd6a8377.js +0 -1
- package/dist/sankhyablocks/p-e138e7d4.entry.js +0 -1
- package/dist/sankhyablocks/p-e1b29d4c.entry.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
@@ -14,14 +14,21 @@ export class SnkGrid {
|
|
14
14
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
15
15
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
16
16
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
17
|
+
"snkGridTopTaskbar.regular.singleTaskbar": [],
|
17
18
|
"snkGridTopTaskbar.finish_edition": ["CANCEL", "SAVE"],
|
18
|
-
"snkGridTopTaskbar.finish_edition.secondary": []
|
19
|
+
"snkGridTopTaskbar.finish_edition.secondary": [],
|
20
|
+
"snkGridTopTaskbar.finish_edition.singleTaskbar": [],
|
19
21
|
});
|
20
22
|
this._headerTaskbarProcessor = new TaskbarProcessor({
|
21
23
|
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON", "MORE_OPTIONS"],
|
22
24
|
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "ATTACH", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON"],
|
23
25
|
"snkGridHeaderTaskbar.detail.unselected": ["REFRESH", "MORE_OPTIONS"],
|
24
|
-
"snkGridHeaderTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
26
|
+
"snkGridHeaderTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"],
|
27
|
+
"snkGridHeaderTaskbar.singleTaskbar.unselected": ["INSERT", "FORM_MODE", "CONFIGURATOR", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON", "MORE_OPTIONS"],
|
28
|
+
"snkGridHeaderTaskbar.singleTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "ATTACH", "FORM_MODE", "CONFIGURATOR", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON"],
|
29
|
+
"snkGridHeaderTaskbar.singleTaskbar.detail.unselected": ["INSERT", "FORM_MODE", "CONFIGURATOR", "REFRESH", "MORE_OPTIONS"],
|
30
|
+
"snkGridHeaderTaskbar.singleTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "FORM_MODE", "CONFIGURATOR", "REFRESH"],
|
31
|
+
"snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
25
32
|
});
|
26
33
|
this._dataUnit = undefined;
|
27
34
|
this._dataState = undefined;
|
@@ -302,30 +309,46 @@ export class SnkGrid {
|
|
302
309
|
return invisibleButtons;
|
303
310
|
}
|
304
311
|
componentWillRender() {
|
305
|
-
var _a;
|
306
312
|
const invisibleButtons = this.getInvisibleButtons();
|
307
|
-
|
308
|
-
let headerTaskbarId;
|
309
|
-
if (hasSelectedRecord) {
|
310
|
-
headerTaskbarId = this.isDetail ? "snkGridHeaderTaskbar.detail.selected" : "snkGridHeaderTaskbar.selected";
|
311
|
-
}
|
312
|
-
else {
|
313
|
-
headerTaskbarId = this.isDetail ? "snkGridHeaderTaskbar.detail.unselected" : "snkGridHeaderTaskbar.unselected";
|
314
|
-
}
|
315
|
-
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, this.getHeaderDisabledButtons(), invisibleButtons);
|
313
|
+
this._headerTaskbarProcessor.process(this.getHeaderTaskbarId(), this.taskbarManager, this._dataState, this.getHeaderDisabledButtons(), invisibleButtons);
|
316
314
|
this._topTaskbarProcessor.process(this.getTopTaskBarId(), this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
317
315
|
this.dataExporterProviderStore();
|
318
316
|
}
|
317
|
+
getHeaderTaskbarId() {
|
318
|
+
var _a, _b;
|
319
|
+
const hasSelectedRecord = this._dataState && !!((_a = this._dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.length);
|
320
|
+
const taskbarIdPrefixLookup = {
|
321
|
+
primary: this.isDetail ? "snkGridHeaderTaskbar.detail" : "snkGridHeaderTaskbar",
|
322
|
+
secondary: this.isDetail ? "snkGridHeaderTaskbar.detail" : "snkGridHeaderTaskbar",
|
323
|
+
singleTaskbar: this.isDetail ? "snkGridHeaderTaskbar.singleTaskbar.detail" : "snkGridHeaderTaskbar.singleTaskbar"
|
324
|
+
};
|
325
|
+
const taskbarIdPrefix = taskbarIdPrefixLookup[this.presentationMode];
|
326
|
+
let headerTaskbarId = hasSelectedRecord ? `${taskbarIdPrefix}.selected` : `${taskbarIdPrefix}.unselected`;
|
327
|
+
if (((_b = this._dataState) === null || _b === void 0 ? void 0 : _b.isDirty) && this.presentationMode === PresentationMode.SINGLE_TASKBAR) {
|
328
|
+
headerTaskbarId = "snkGridHeaderTaskbar.singleTaskbar.finish_edition";
|
329
|
+
}
|
330
|
+
return headerTaskbarId;
|
331
|
+
}
|
319
332
|
getTopTaskBarId() {
|
320
333
|
var _a;
|
321
|
-
const
|
334
|
+
const suffixLookup = {
|
335
|
+
primary: "",
|
336
|
+
secondary: ".secondary",
|
337
|
+
singleTaskbar: ".singleTaskbar"
|
338
|
+
};
|
339
|
+
const sufix = suffixLookup[this.presentationMode];
|
322
340
|
if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
323
341
|
return `snkGridTopTaskbar.finish_edition${sufix}`;
|
324
342
|
}
|
325
343
|
return `snkGridTopTaskbar.regular${sufix}`;
|
326
344
|
}
|
327
345
|
getPrimaryButton() {
|
328
|
-
|
346
|
+
const primaryButtonLookup = {
|
347
|
+
primary: "INSERT",
|
348
|
+
secondary: "",
|
349
|
+
singleTaskbar: "INSERT"
|
350
|
+
};
|
351
|
+
return primaryButtonLookup[this.presentationMode];
|
329
352
|
}
|
330
353
|
getColumnSearch(actionButton, item) {
|
331
354
|
if (this._columnSearch != undefined) {
|
@@ -376,7 +399,7 @@ export class SnkGrid {
|
|
376
399
|
return undefined;
|
377
400
|
}
|
378
401
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
379
|
-
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail) }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
402
|
+
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail) }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
380
403
|
}
|
381
404
|
static get is() { return "snk-grid"; }
|
382
405
|
static get encapsulation() { return "scoped"; }
|
@@ -573,7 +596,7 @@ export class SnkGrid {
|
|
573
596
|
"mutable": false,
|
574
597
|
"complexType": {
|
575
598
|
"original": "PresentationMode",
|
576
|
-
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY",
|
599
|
+
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY | PresentationMode.SINGLE_TASKBAR",
|
577
600
|
"references": {
|
578
601
|
"PresentationMode": {
|
579
602
|
"location": "import",
|
@@ -190,7 +190,7 @@ export class SnkPersonalizedFilter {
|
|
190
190
|
return personalizedFilter;
|
191
191
|
}
|
192
192
|
addFilterGroupCondition(personalizedFilter) {
|
193
|
-
if (!personalizedFilter.assistent.operand) {
|
193
|
+
if (personalizedFilter.assistent && !personalizedFilter.assistent.operand) {
|
194
194
|
personalizedFilter.assistent.operand = FilterGroupCondition.AND;
|
195
195
|
}
|
196
196
|
}
|
@@ -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
|
-
|
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
|
}
|
@@ -11,6 +11,9 @@ export class TaskbarActionsButton {
|
|
11
11
|
await this.hideActions();
|
12
12
|
}
|
13
13
|
}
|
14
|
+
async handleClose() {
|
15
|
+
await this.hideActions();
|
16
|
+
}
|
14
17
|
/**
|
15
18
|
* Exibe a lista de ações.
|
16
19
|
*/
|
@@ -56,12 +59,28 @@ export class TaskbarActionsButton {
|
|
56
59
|
return this._showDropdown && ((_a = this.actions) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
57
60
|
}
|
58
61
|
onSelectAction(iAction) {
|
59
|
-
const
|
62
|
+
const actions = this.actions.map(action => (Object.assign(Object.assign({}, action), { id: action.value })));
|
63
|
+
const selectedAction = this.getSelectedAction(iAction.id, actions);
|
60
64
|
this.taskbarActionSelected.emit(selectedAction);
|
61
65
|
if (!selectedAction.disableCloseOnSelect) {
|
62
66
|
this._showDropdown = false;
|
63
67
|
}
|
64
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
|
+
}
|
65
84
|
dropdownItemBuilder(item, _level) {
|
66
85
|
const itemAction = this.actions.find(action => action.value === item.id);
|
67
86
|
if (!itemAction || !itemAction.itemBuilder) {
|
@@ -296,6 +315,12 @@ export class TaskbarActionsButton {
|
|
296
315
|
"target": "window",
|
297
316
|
"capture": false,
|
298
317
|
"passive": false
|
318
|
+
}, {
|
319
|
+
"name": "ezOpenModal",
|
320
|
+
"method": "handleClose",
|
321
|
+
"target": "window",
|
322
|
+
"capture": false,
|
323
|
+
"passive": false
|
299
324
|
}];
|
300
325
|
}
|
301
326
|
}
|
@@ -472,7 +472,7 @@ export class SnkTaskbar {
|
|
472
472
|
"mutable": true,
|
473
473
|
"complexType": {
|
474
474
|
"original": "PresentationMode",
|
475
|
-
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY",
|
475
|
+
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY | PresentationMode.SINGLE_TASKBAR",
|
476
476
|
"references": {
|
477
477
|
"PresentationMode": {
|
478
478
|
"location": "import",
|
@@ -2,6 +2,7 @@ export var PresentationMode;
|
|
2
2
|
(function (PresentationMode) {
|
3
3
|
PresentationMode["PRIMARY"] = "primary";
|
4
4
|
PresentationMode["SECONDARY"] = "secondary";
|
5
|
+
PresentationMode["SINGLE_TASKBAR"] = "singleTaskbar";
|
5
6
|
})(PresentationMode || (PresentationMode = {}));
|
6
7
|
export var DataExporterOption;
|
7
8
|
(function (DataExporterOption) {
|
@@ -2,11 +2,12 @@ import { FormConfigFetcher } from "../http/data-fetcher/fetchers/form-config-fet
|
|
2
2
|
import GridConfigFetcher from "../http/data-fetcher/fetchers/grid-config-fetcher";
|
3
3
|
import FilterBarConfigFetcher from "../http/data-fetcher/fetchers/filter-bar-config-fetcher";
|
4
4
|
import PersonalizedFilterFetcher from "../http/data-fetcher/fetchers/personalized-filter-fetcher";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
var CONFIG_SOURCE;
|
6
|
+
(function (CONFIG_SOURCE) {
|
7
|
+
CONFIG_SOURCE["form"] = "form";
|
8
|
+
CONFIG_SOURCE["grid"] = "grid";
|
9
|
+
CONFIG_SOURCE["filterBar"] = "filterBar";
|
10
|
+
})(CONFIG_SOURCE || (CONFIG_SOURCE = {}));
|
10
11
|
export class ConfigStorage {
|
11
12
|
static preload(resourceID, configName) {
|
12
13
|
ConfigStorage.loadFormConfig(configName, resourceID);
|
@@ -34,13 +35,11 @@ export class ConfigStorage {
|
|
34
35
|
return ConfigStorage.configById.get(cacheID);
|
35
36
|
}
|
36
37
|
static async saveFilterBarConfig(config, name, resourceID) {
|
37
|
-
|
38
|
-
this.configById.delete(cacheID);
|
38
|
+
await this.deleteFilterBarConfigCache(name, resourceID);
|
39
39
|
return this.filterBarConfigFetcher.saveConfig(config, resourceID, name);
|
40
40
|
}
|
41
41
|
static async saveFormConfig(config, name, resourceID) {
|
42
|
-
|
43
|
-
this.configById.delete(cacheID);
|
42
|
+
await this.deleteFormConfigCache(name, resourceID);
|
44
43
|
return this.formConfigFetcher.saveConfig(config, name, resourceID);
|
45
44
|
}
|
46
45
|
static async saveCardState(config, name, resourceID) {
|
@@ -50,18 +49,16 @@ export class ConfigStorage {
|
|
50
49
|
if (config == undefined) {
|
51
50
|
return;
|
52
51
|
}
|
53
|
-
|
54
|
-
this.configById.delete(cacheID);
|
52
|
+
await this.deleteGridConfigCache(name, resourceID);
|
55
53
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
56
54
|
}
|
57
55
|
static async loadPersonalizedFilter(filterId, resourceID, configName) {
|
58
56
|
return this.personalizedFilterFetcher.loadPersonalizedFilter(resourceID, filterId, configName);
|
59
57
|
}
|
60
58
|
static async savePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
61
|
-
//Ao criar ou alterar um filtro personalizado,
|
59
|
+
//Ao criar ou alterar um filtro personalizado,
|
62
60
|
//precisamos remover o cache do status da filterbar.
|
63
|
-
|
64
|
-
this.configById.delete(cacheID);
|
61
|
+
await this.deleteFilterBarConfigCache(configName, resourceID);
|
65
62
|
return this.personalizedFilterFetcher.savePersonalizedFilter(personalizedFilter, resourceID, configName);
|
66
63
|
}
|
67
64
|
static async removePersonalizedFilter(personalizedFilter, resourceID, configName) {
|
@@ -70,6 +67,19 @@ export class ConfigStorage {
|
|
70
67
|
static async validatePersonalizedFilter(dataUnitName, expression) {
|
71
68
|
return this.personalizedFilterFetcher.validatePersonalizedFilter(dataUnitName, expression);
|
72
69
|
}
|
70
|
+
static async deleteGridConfigCache(name, resourceID) {
|
71
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.grid);
|
72
|
+
}
|
73
|
+
static async deleteFormConfigCache(name, resourceID) {
|
74
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.form);
|
75
|
+
}
|
76
|
+
static async deleteFilterBarConfigCache(name, resourceID) {
|
77
|
+
await this.deleteConfigCache(name, resourceID, CONFIG_SOURCE.filterBar);
|
78
|
+
}
|
79
|
+
static async deleteConfigCache(name, resourceID, source) {
|
80
|
+
const cacheID = ConfigStorage.buildCacheID(name, source, resourceID);
|
81
|
+
this.configById.delete(cacheID);
|
82
|
+
}
|
73
83
|
static buildCacheID(name, source, resourceID) {
|
74
84
|
if (name == undefined) {
|
75
85
|
return `req_${source}_${resourceID}`;
|
@@ -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;
|
@@ -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 = {}));
|