@sankhyalabs/sankhyablocks 8.15.0-dev.3 → 8.15.0-dev.30
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-d4c99a5e.js} +27 -17
- 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-467907f6.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/{index-0e663819.js → index-0922807b.js} +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-de65b9fc.js → pesquisa-fetcher-c416a6b7.js} +249 -34
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +23 -8
- package/dist/cjs/snk-application.cjs.entry.js +98 -9
- package/dist/cjs/snk-attach.cjs.entry.js +396 -58
- package/dist/cjs/snk-crud.cjs.entry.js +14 -11
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- 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 +10 -11
- package/dist/cjs/snk-entity-list.cjs.entry.js +5 -3
- package/dist/cjs/snk-filter-bar.cjs.entry.js +68 -11
- package/dist/cjs/snk-filter-item.cjs.entry.js +3 -0
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -4
- 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-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 +45 -20
- package/dist/cjs/{snk-guides-viewer-7e87ffce.js → snk-guides-viewer-bd69fce4.js} +11 -12
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -10
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +4 -4
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +22 -11
- package/dist/cjs/snk-taskbar.cjs.entry.js +91 -7
- package/dist/cjs/{taskbar-elements-b8c428a9.js → taskbar-elements-1e4fb2e0.js} +9 -9
- 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 +111 -5
- 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 +42 -4
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +11 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +4 -4
- 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 +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.css +23 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +175 -6
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +5 -1
- package/dist/collection/components/snk-grid/snk-grid.js +75 -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 +55 -3
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +18 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +8 -8
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +17 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +129 -7
- 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/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 +48 -29
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +1 -1
- 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/ConfigStorage.js +25 -15
- package/dist/components/DataFetcher.js +5 -3
- package/dist/components/SnkMessageBuilder.js +13 -0
- package/dist/components/dataunit-fetcher.js +90 -37
- package/dist/components/index2.js +1 -0
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +94 -3
- package/dist/components/snk-attach2.js +400 -56
- package/dist/components/snk-crud.js +9 -3
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +4 -4
- package/dist/components/snk-entity-list.js +5 -3
- package/dist/components/snk-filter-bar2.js +71 -9
- 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 +42 -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 +17 -3
- package/dist/components/snk-taskbar2.js +103 -15
- package/dist/components/taskbar-actions-button2.js +18 -2
- package/dist/esm/{ConfigStorage-379a9cba.js → ConfigStorage-39ed8aeb.js} +27 -17
- 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-587e9030.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/{index-1564817d.js → index-0ece87a6.js} +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-e218c6d2.js → pesquisa-fetcher-ab16a2e8.js} +249 -35
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +23 -8
- package/dist/esm/snk-application.entry.js +98 -9
- package/dist/esm/snk-attach.entry.js +397 -59
- package/dist/esm/snk-crud.entry.js +14 -11
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- 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 +10 -11
- package/dist/esm/snk-entity-list.entry.js +5 -3
- package/dist/esm/snk-filter-bar.entry.js +68 -11
- package/dist/esm/snk-filter-item.entry.js +3 -0
- package/dist/esm/snk-filter-modal-item.entry.js +3 -4
- 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-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 +45 -20
- package/dist/esm/{snk-guides-viewer-2134aba2.js → snk-guides-viewer-fde82cc1.js} +11 -12
- package/dist/esm/snk-guides-viewer.entry.js +9 -10
- package/dist/esm/snk-personalized-filter.entry.js +4 -4
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +21 -10
- package/dist/esm/snk-taskbar.entry.js +92 -8
- package/dist/esm/{taskbar-elements-26c981af.js → taskbar-elements-846c027c.js} +9 -9
- package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
- package/dist/sankhyablocks/{p-cb7419e0.entry.js → p-0b0b36ac.entry.js} +1 -1
- package/dist/sankhyablocks/p-11ad137d.entry.js +1 -0
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-33718dfc.entry.js +1 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/p-3e2e2424.entry.js +1 -0
- package/dist/sankhyablocks/p-50783a8b.js +1 -0
- package/dist/sankhyablocks/p-57212bb5.js +1 -0
- package/dist/sankhyablocks/p-5f5b58b6.entry.js +1 -0
- package/dist/sankhyablocks/p-67aedbe0.js +56 -0
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/{p-2028633c.js → p-725d04ba.js} +1 -1
- package/dist/sankhyablocks/p-827e4b01.entry.js +1 -0
- package/dist/sankhyablocks/p-84bb8f47.entry.js +1 -0
- package/dist/sankhyablocks/{p-6977a26c.entry.js → p-86801b08.entry.js} +1 -1
- package/dist/sankhyablocks/p-8c13d8d6.entry.js +1 -0
- package/dist/sankhyablocks/p-8c49760e.js +1 -0
- package/dist/sankhyablocks/p-91b7f78a.entry.js +1 -0
- package/dist/sankhyablocks/p-9d608b62.entry.js +1 -0
- package/dist/sankhyablocks/{p-0d7863ed.js → p-a13ccb86.js} +1 -1
- package/dist/sankhyablocks/p-b7004423.entry.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-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-d4802f81.entry.js +1 -0
- package/dist/sankhyablocks/{p-aaa1438e.entry.js → p-e3bd000e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
- package/dist/sankhyablocks/p-fb842329.entry.js +1 -0
- package/dist/sankhyablocks/{p-729f5f5b.entry.js → p-fcdcb0e2.entry.js} +1 -1
- package/dist/sankhyablocks/p-fd0a8d68.entry.js +11 -0
- package/dist/sankhyablocks/{p-35fe6e61.entry.js → p-fdc4cb9b.entry.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/__mocks__/snk-application.d.ts +3 -0
- 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-crud/snk-crud.d.ts +9 -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 +19 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +30 -1
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +7 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +10 -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 +27 -1
- package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +1 -0
- package/dist/types/components.d.ts +177 -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 +2 -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-0cd2e986.entry.js +0 -1
- package/dist/sankhyablocks/p-145c4434.js +0 -1
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-4396d1a6.js +0 -56
- 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-58218eb7.entry.js +0 -1
- package/dist/sankhyablocks/p-78777ae0.entry.js +0 -1
- package/dist/sankhyablocks/p-7915c452.entry.js +0 -1
- package/dist/sankhyablocks/p-953346b9.entry.js +0 -1
- package/dist/sankhyablocks/p-a037f5b4.entry.js +0 -1
- package/dist/sankhyablocks/p-a49b1019.entry.js +0 -1
- package/dist/sankhyablocks/p-a7923832.entry.js +0 -1
- package/dist/sankhyablocks/p-b52c2175.js +0 -1
- package/dist/sankhyablocks/p-ba627e85.js +0 -60
- package/dist/sankhyablocks/p-bf9b7149.entry.js +0 -11
- package/dist/sankhyablocks/p-c259545b.entry.js +0 -1
- package/dist/sankhyablocks/p-ca8e7da0.entry.js +0 -1
- package/dist/sankhyablocks/p-d1677df0.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/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
@@ -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) => {
|
@@ -27,10 +28,13 @@ export class SnkFilterBar {
|
|
27
28
|
return this._calculateSortIndex(b) - this._calculateSortIndex(a);
|
28
29
|
};
|
29
30
|
this.dataUnit = undefined;
|
31
|
+
this.title = undefined;
|
30
32
|
this.configName = undefined;
|
31
33
|
this.resourceID = undefined;
|
34
|
+
this.mode = "regular";
|
32
35
|
this.filterConfig = undefined;
|
33
36
|
this.messagesBuilder = undefined;
|
37
|
+
this.disablePersonalizedFilter = undefined;
|
34
38
|
this.allowDefault = undefined;
|
35
39
|
this.scrollerLocked = false;
|
36
40
|
this.showPersonalizedFilter = false;
|
@@ -74,7 +78,7 @@ export class SnkFilterBar {
|
|
74
78
|
* Faz o recarregamento da filterbar buscando o state no servidor.
|
75
79
|
*/
|
76
80
|
async reload() {
|
77
|
-
this.loadConfigFromStorage();
|
81
|
+
this.loadConfigFromStorage(true);
|
78
82
|
}
|
79
83
|
/**
|
80
84
|
* Retorna um item de filtro pelo ID.
|
@@ -114,6 +118,24 @@ export class SnkFilterBar {
|
|
114
118
|
this.updateFilter(filterItem);
|
115
119
|
return Promise.resolve();
|
116
120
|
}
|
121
|
+
/**
|
122
|
+
* Remove um item de filtro.
|
123
|
+
*
|
124
|
+
* @param filterID - ID do a ser adicionado
|
125
|
+
*
|
126
|
+
* @returns {Promise<SnkFilterItemConfig|undefined>} - Retorna o item de filtro removido, ou undefined caso não encontrado.
|
127
|
+
*/
|
128
|
+
async removeFilterItem(filterID) {
|
129
|
+
const itemIndex = this.filterConfig.findIndex(item => item.id === filterID);
|
130
|
+
if (itemIndex == -1) {
|
131
|
+
console.warn("[SnkFilterBar.removeFilterItem] FilterItem não encontrado");
|
132
|
+
return Promise.resolve(undefined);
|
133
|
+
}
|
134
|
+
const itemToRemove = this.filterConfig[itemIndex];
|
135
|
+
;
|
136
|
+
this.filterConfig = this.filterConfig.filter(item => item.id !== filterID);
|
137
|
+
return Promise.resolve(itemToRemove);
|
138
|
+
}
|
117
139
|
componentDidLoad() {
|
118
140
|
if (this._element) {
|
119
141
|
const dataInfo = { dataUnit: this.dataUnit };
|
@@ -146,13 +168,27 @@ export class SnkFilterBar {
|
|
146
168
|
return;
|
147
169
|
}
|
148
170
|
this._loadingPending = false;
|
149
|
-
this.dataUnit.
|
171
|
+
this.doLoadData(this.dataUnit.getLastLoadRequest() != undefined);
|
150
172
|
}
|
151
173
|
if (this._configUpdated) {
|
152
174
|
this._configUpdated = false;
|
153
175
|
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
|
154
176
|
}
|
155
177
|
}
|
178
|
+
async doLoadData(forceReload = false) {
|
179
|
+
try {
|
180
|
+
if (this._firstLoad && !forceReload) {
|
181
|
+
let autoLoad = await this._application.getBooleanParam("global.carregar.registros.iniciar.tela");
|
182
|
+
if (!autoLoad) {
|
183
|
+
return;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
this.dataUnit.loadData(undefined, undefined, true);
|
187
|
+
}
|
188
|
+
finally {
|
189
|
+
this._firstLoad = false;
|
190
|
+
}
|
191
|
+
}
|
156
192
|
/**
|
157
193
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
158
194
|
* através de um pequeno modulo na estrutura da aplicação:
|
@@ -161,6 +197,9 @@ export class SnkFilterBar {
|
|
161
197
|
*/
|
162
198
|
getMessage(key, params, defaultValue) {
|
163
199
|
var _a;
|
200
|
+
if (this.messagesBuilder == undefined && this._application) {
|
201
|
+
this.messagesBuilder = this._application.messagesBuilder;
|
202
|
+
}
|
164
203
|
return ((_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params)) || defaultValue;
|
165
204
|
}
|
166
205
|
getFilter(_dataUnit) {
|
@@ -187,7 +226,7 @@ export class SnkFilterBar {
|
|
187
226
|
registryFilterProvider() {
|
188
227
|
this.dataUnit.addFilterProvider(this);
|
189
228
|
if (this.filterConfig) {
|
190
|
-
this.
|
229
|
+
this.doLoadData();
|
191
230
|
}
|
192
231
|
}
|
193
232
|
itemFocused(selectedItem) {
|
@@ -264,7 +303,10 @@ export class SnkFilterBar {
|
|
264
303
|
loadPermitions() {
|
265
304
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
266
305
|
}
|
267
|
-
loadConfigFromStorage() {
|
306
|
+
async loadConfigFromStorage(clearCache) {
|
307
|
+
if (clearCache) {
|
308
|
+
await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
|
309
|
+
}
|
268
310
|
return new Promise(accept => {
|
269
311
|
ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
|
270
312
|
.then((filters) => {
|
@@ -307,6 +349,9 @@ export class SnkFilterBar {
|
|
307
349
|
filterChangeListener(evt) {
|
308
350
|
this.updateFilter(evt.detail);
|
309
351
|
}
|
352
|
+
/**
|
353
|
+
* Abre o modal de filtros
|
354
|
+
*/
|
310
355
|
async showFilterModal() {
|
311
356
|
const callbackOnApplyFilter = (filters) => {
|
312
357
|
this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
|
@@ -319,9 +364,11 @@ export class SnkFilterBar {
|
|
319
364
|
filterConfig: filtersConfigCopy,
|
320
365
|
configName: this.configName,
|
321
366
|
onComplete: callbackOnApplyFilter,
|
367
|
+
disablePersonalizedFilter: this.disablePersonalizedFilter,
|
322
368
|
getMessage: (key, props) => this.getMessage(key, props),
|
323
369
|
onAddPersonalizedFilter: () => this.addPersonalizedFilter(),
|
324
|
-
onEditPersonalizedFilter: (id) => this.editPersonalizedFilter(id)
|
370
|
+
onEditPersonalizedFilter: (id) => this.editPersonalizedFilter(id),
|
371
|
+
onDeletePersonalizedFilter: (filter, configName) => this.deletePersonalizedFilter(filter, FilterItemType.PERSONALIZED, configName),
|
325
372
|
};
|
326
373
|
this._filterModalFactory = new SnkFilterModalFactory(factoryParams);
|
327
374
|
await this._filterModalFactory.showModal();
|
@@ -339,6 +386,11 @@ export class SnkFilterBar {
|
|
339
386
|
this.showPersonalizedFilter = true;
|
340
387
|
this.personalizedFilterId = id;
|
341
388
|
}
|
389
|
+
deletePersonalizedFilter(filter, filterItemType, configName) {
|
390
|
+
if (filterItemType === FilterItemType.PERSONALIZED) {
|
391
|
+
ConfigStorage.removePersonalizedFilter(filter, this.resourceID, configName);
|
392
|
+
}
|
393
|
+
}
|
342
394
|
handleHidePersonalizedFilter(reloadFilterBar) {
|
343
395
|
if (reloadFilterBar) {
|
344
396
|
this.loadConfigFromStorage().then(() => {
|
@@ -371,7 +423,9 @@ export class SnkFilterBar {
|
|
371
423
|
if (this.showPersonalizedFilter) {
|
372
424
|
return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.handleHidePersonalizedFilter(false), onEzAfterSave: () => this.handleHidePersonalizedFilter(true), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
|
373
425
|
}
|
374
|
-
|
426
|
+
if (this.mode === "button")
|
427
|
+
return (h(Host, { "data-mode": this.mode }, h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) })));
|
428
|
+
return (h(Host, { "data-mode": this.mode }, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
375
429
|
}
|
376
430
|
static get is() { return "snk-filter-bar"; }
|
377
431
|
static get encapsulation() { return "scoped"; }
|
@@ -407,6 +461,23 @@ export class SnkFilterBar {
|
|
407
461
|
"text": "Recebe o DataUnit do ambiente. Se n\u00E3o for informado, procura pela refer\u00EAncia\ndo SnkDataUnit. Necess\u00E1rio para se registrar como provedor de filtros."
|
408
462
|
}
|
409
463
|
},
|
464
|
+
"title": {
|
465
|
+
"type": "string",
|
466
|
+
"mutable": false,
|
467
|
+
"complexType": {
|
468
|
+
"original": "string",
|
469
|
+
"resolved": "string",
|
470
|
+
"references": {}
|
471
|
+
},
|
472
|
+
"required": false,
|
473
|
+
"optional": false,
|
474
|
+
"docs": {
|
475
|
+
"tags": [],
|
476
|
+
"text": "T\u00EDtulo que ser\u00E1 apresentado na barra de filtros"
|
477
|
+
},
|
478
|
+
"attribute": "title",
|
479
|
+
"reflect": false
|
480
|
+
},
|
410
481
|
"configName": {
|
411
482
|
"type": "string",
|
412
483
|
"mutable": false,
|
@@ -441,6 +512,24 @@ export class SnkFilterBar {
|
|
441
512
|
"attribute": "resource-i-d",
|
442
513
|
"reflect": false
|
443
514
|
},
|
515
|
+
"mode": {
|
516
|
+
"type": "string",
|
517
|
+
"mutable": false,
|
518
|
+
"complexType": {
|
519
|
+
"original": "\"regular\" | \"button\" | \"hidden\"",
|
520
|
+
"resolved": "\"button\" | \"hidden\" | \"regular\"",
|
521
|
+
"references": {}
|
522
|
+
},
|
523
|
+
"required": false,
|
524
|
+
"optional": false,
|
525
|
+
"docs": {
|
526
|
+
"tags": [],
|
527
|
+
"text": "Modo de apresenta\u00E7\u00E3o da filterbar."
|
528
|
+
},
|
529
|
+
"attribute": "mode",
|
530
|
+
"reflect": false,
|
531
|
+
"defaultValue": "\"regular\""
|
532
|
+
},
|
444
533
|
"filterConfig": {
|
445
534
|
"type": "unknown",
|
446
535
|
"mutable": true,
|
@@ -483,6 +572,23 @@ export class SnkFilterBar {
|
|
483
572
|
"tags": [],
|
484
573
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
485
574
|
}
|
575
|
+
},
|
576
|
+
"disablePersonalizedFilter": {
|
577
|
+
"type": "boolean",
|
578
|
+
"mutable": false,
|
579
|
+
"complexType": {
|
580
|
+
"original": "boolean",
|
581
|
+
"resolved": "boolean",
|
582
|
+
"references": {}
|
583
|
+
},
|
584
|
+
"required": false,
|
585
|
+
"optional": false,
|
586
|
+
"docs": {
|
587
|
+
"tags": [],
|
588
|
+
"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)."
|
589
|
+
},
|
590
|
+
"attribute": "disable-personalized-filter",
|
591
|
+
"reflect": false
|
486
592
|
}
|
487
593
|
};
|
488
594
|
}
|
@@ -612,6 +718,69 @@ export class SnkFilterBar {
|
|
612
718
|
"text": "filterItem - Item a ser adicionado, caso o item j\u00E1 exista com o ID ele n\u00E3o ser\u00E1 adicionado novamente"
|
613
719
|
}]
|
614
720
|
}
|
721
|
+
},
|
722
|
+
"removeFilterItem": {
|
723
|
+
"complexType": {
|
724
|
+
"signature": "(filterID: string) => Promise<SnkFilterItemConfig | undefined>",
|
725
|
+
"parameters": [{
|
726
|
+
"tags": [{
|
727
|
+
"name": "param",
|
728
|
+
"text": "filterID - ID do a ser adicionado"
|
729
|
+
}],
|
730
|
+
"text": "- ID do a ser adicionado"
|
731
|
+
}],
|
732
|
+
"references": {
|
733
|
+
"Promise": {
|
734
|
+
"location": "global"
|
735
|
+
},
|
736
|
+
"SnkFilterItemConfig": {
|
737
|
+
"location": "import",
|
738
|
+
"path": "./filter-item/snk-filter-item"
|
739
|
+
}
|
740
|
+
},
|
741
|
+
"return": "Promise<SnkFilterItemConfig>"
|
742
|
+
},
|
743
|
+
"docs": {
|
744
|
+
"text": "Remove um item de filtro.",
|
745
|
+
"tags": [{
|
746
|
+
"name": "param",
|
747
|
+
"text": "filterID - ID do a ser adicionado"
|
748
|
+
}, {
|
749
|
+
"name": "returns",
|
750
|
+
"text": "- Retorna o item de filtro removido, ou undefined caso n\u00E3o encontrado."
|
751
|
+
}]
|
752
|
+
}
|
753
|
+
},
|
754
|
+
"showFilterModal": {
|
755
|
+
"complexType": {
|
756
|
+
"signature": "() => Promise<void>",
|
757
|
+
"parameters": [],
|
758
|
+
"references": {
|
759
|
+
"Promise": {
|
760
|
+
"location": "global"
|
761
|
+
},
|
762
|
+
"SnkFilterItemConfig": {
|
763
|
+
"location": "import",
|
764
|
+
"path": "./filter-item/snk-filter-item"
|
765
|
+
},
|
766
|
+
"Array": {
|
767
|
+
"location": "global"
|
768
|
+
},
|
769
|
+
"SnkFilterModalFactoryParams": {
|
770
|
+
"location": "import",
|
771
|
+
"path": "./utils/SnkFilterModalFactory"
|
772
|
+
},
|
773
|
+
"IPersonalizedFilter": {
|
774
|
+
"location": "import",
|
775
|
+
"path": "../snk-personalized-filter/interfaces/IPersonalizedFilter"
|
776
|
+
}
|
777
|
+
},
|
778
|
+
"return": "Promise<void>"
|
779
|
+
},
|
780
|
+
"docs": {
|
781
|
+
"text": "Abre o modal de filtros",
|
782
|
+
"tags": []
|
783
|
+
}
|
615
784
|
}
|
616
785
|
};
|
617
786
|
}
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
|
2
2
|
class SnkFilterModalFactory {
|
3
|
-
constructor({ filterConfig, configName, onComplete, getMessage, onAddPersonalizedFilter, onEditPersonalizedFilter }) {
|
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;
|
11
|
+
this._onDeletePersonalizedFilter = onDeletePersonalizedFilter;
|
10
12
|
}
|
11
13
|
applyFilters(newFilterConfig) {
|
12
14
|
this._onComplete(newFilterConfig);
|
@@ -17,11 +19,13 @@ class SnkFilterModalFactory {
|
|
17
19
|
filterModal.className = "ez-size-height--full";
|
18
20
|
filterModal.filters = this._filterConfig;
|
19
21
|
filterModal.configName = this._configName;
|
22
|
+
filterModal.disablePersonalizedFilter = this._disablePersonalizedFilter;
|
20
23
|
filterModal.getMessage = this._getMessage.bind(this);
|
21
24
|
filterModal.applyFilters = this.applyFilters.bind(this);
|
22
25
|
filterModal.closeModal = () => this._closeModal();
|
23
26
|
filterModal.addPersonalizedFilter = () => this._addPersonalizedFilterFn();
|
24
27
|
filterModal.editPersonalizedFilter = (id) => this._editPersonalizedFilterFn(id);
|
28
|
+
filterModal.deletePersonalizedFilter = (filter, configName) => this._onDeletePersonalizedFilter(filter, configName);
|
25
29
|
return filterModal;
|
26
30
|
}
|
27
31
|
async showModal() {
|
@@ -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;
|
@@ -30,6 +37,7 @@ export class SnkGrid {
|
|
30
37
|
this._showSnkFilterBar = true;
|
31
38
|
this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
|
32
39
|
this.configName = undefined;
|
40
|
+
this.filterBarTitle = undefined;
|
33
41
|
this.resourceID = undefined;
|
34
42
|
this.selectionToastConfig = undefined;
|
35
43
|
this.actionsList = undefined;
|
@@ -45,6 +53,7 @@ export class SnkGrid {
|
|
45
53
|
this.taskbarCustomContainerId = undefined;
|
46
54
|
this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
|
47
55
|
this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
|
56
|
+
this.disablePersonalizedFilter = undefined;
|
48
57
|
}
|
49
58
|
/**
|
50
59
|
* Exibe a janela de configurações da grade.
|
@@ -302,30 +311,46 @@ export class SnkGrid {
|
|
302
311
|
return invisibleButtons;
|
303
312
|
}
|
304
313
|
componentWillRender() {
|
305
|
-
var _a;
|
306
314
|
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);
|
315
|
+
this._headerTaskbarProcessor.process(this.getHeaderTaskbarId(), this.taskbarManager, this._dataState, this.getHeaderDisabledButtons(), invisibleButtons);
|
316
316
|
this._topTaskbarProcessor.process(this.getTopTaskBarId(), this.taskbarManager, this._dataState, undefined, invisibleButtons);
|
317
317
|
this.dataExporterProviderStore();
|
318
318
|
}
|
319
|
+
getHeaderTaskbarId() {
|
320
|
+
var _a, _b;
|
321
|
+
const hasSelectedRecord = this._dataState && !!((_a = this._dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.length);
|
322
|
+
const taskbarIdPrefixLookup = {
|
323
|
+
primary: this.isDetail ? "snkGridHeaderTaskbar.detail" : "snkGridHeaderTaskbar",
|
324
|
+
secondary: this.isDetail ? "snkGridHeaderTaskbar.detail" : "snkGridHeaderTaskbar",
|
325
|
+
singleTaskbar: this.isDetail ? "snkGridHeaderTaskbar.singleTaskbar.detail" : "snkGridHeaderTaskbar.singleTaskbar"
|
326
|
+
};
|
327
|
+
const taskbarIdPrefix = taskbarIdPrefixLookup[this.presentationMode];
|
328
|
+
let headerTaskbarId = hasSelectedRecord ? `${taskbarIdPrefix}.selected` : `${taskbarIdPrefix}.unselected`;
|
329
|
+
if (((_b = this._dataState) === null || _b === void 0 ? void 0 : _b.isDirty) && this.presentationMode === PresentationMode.SINGLE_TASKBAR) {
|
330
|
+
headerTaskbarId = "snkGridHeaderTaskbar.singleTaskbar.finish_edition";
|
331
|
+
}
|
332
|
+
return headerTaskbarId;
|
333
|
+
}
|
319
334
|
getTopTaskBarId() {
|
320
335
|
var _a;
|
321
|
-
const
|
336
|
+
const suffixLookup = {
|
337
|
+
primary: "",
|
338
|
+
secondary: ".secondary",
|
339
|
+
singleTaskbar: ".singleTaskbar"
|
340
|
+
};
|
341
|
+
const sufix = suffixLookup[this.presentationMode];
|
322
342
|
if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) {
|
323
343
|
return `snkGridTopTaskbar.finish_edition${sufix}`;
|
324
344
|
}
|
325
345
|
return `snkGridTopTaskbar.regular${sufix}`;
|
326
346
|
}
|
327
347
|
getPrimaryButton() {
|
328
|
-
|
348
|
+
const primaryButtonLookup = {
|
349
|
+
primary: "INSERT",
|
350
|
+
secondary: "",
|
351
|
+
singleTaskbar: "INSERT"
|
352
|
+
};
|
353
|
+
return primaryButtonLookup[this.presentationMode];
|
329
354
|
}
|
330
355
|
getColumnSearch(actionButton, item) {
|
331
356
|
if (this._columnSearch != undefined) {
|
@@ -376,7 +401,7 @@ export class SnkGrid {
|
|
376
401
|
return undefined;
|
377
402
|
}
|
378
403
|
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 }))));
|
404
|
+
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, 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), disablePersonalizedFilter: this.disablePersonalizedFilter }), 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, overflowStrategy: 'none' }, 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", { id: 'teste', 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
405
|
}
|
381
406
|
static get is() { return "snk-grid"; }
|
382
407
|
static get encapsulation() { return "scoped"; }
|
@@ -430,6 +455,23 @@ export class SnkGrid {
|
|
430
455
|
"attribute": "config-name",
|
431
456
|
"reflect": false
|
432
457
|
},
|
458
|
+
"filterBarTitle": {
|
459
|
+
"type": "string",
|
460
|
+
"mutable": false,
|
461
|
+
"complexType": {
|
462
|
+
"original": "string",
|
463
|
+
"resolved": "string",
|
464
|
+
"references": {}
|
465
|
+
},
|
466
|
+
"required": false,
|
467
|
+
"optional": false,
|
468
|
+
"docs": {
|
469
|
+
"tags": [],
|
470
|
+
"text": "T\u00EDtulo que ser\u00E1 apresentado na barra de filtros"
|
471
|
+
},
|
472
|
+
"attribute": "filter-bar-title",
|
473
|
+
"reflect": false
|
474
|
+
},
|
433
475
|
"resourceID": {
|
434
476
|
"type": "string",
|
435
477
|
"mutable": false,
|
@@ -573,7 +615,7 @@ export class SnkGrid {
|
|
573
615
|
"mutable": false,
|
574
616
|
"complexType": {
|
575
617
|
"original": "PresentationMode",
|
576
|
-
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY",
|
618
|
+
"resolved": "PresentationMode.PRIMARY | PresentationMode.SECONDARY | PresentationMode.SINGLE_TASKBAR",
|
577
619
|
"references": {
|
578
620
|
"PresentationMode": {
|
579
621
|
"location": "import",
|
@@ -719,6 +761,23 @@ export class SnkGrid {
|
|
719
761
|
"attribute": "top-taskbar-custom-slot-id",
|
720
762
|
"reflect": false,
|
721
763
|
"defaultValue": "'GRID_TASKBAR_CUSTOM_ELEMENTS'"
|
764
|
+
},
|
765
|
+
"disablePersonalizedFilter": {
|
766
|
+
"type": "boolean",
|
767
|
+
"mutable": false,
|
768
|
+
"complexType": {
|
769
|
+
"original": "boolean",
|
770
|
+
"resolved": "boolean",
|
771
|
+
"references": {}
|
772
|
+
},
|
773
|
+
"required": false,
|
774
|
+
"optional": false,
|
775
|
+
"docs": {
|
776
|
+
"tags": [],
|
777
|
+
"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)."
|
778
|
+
},
|
779
|
+
"attribute": "disable-personalized-filter",
|
780
|
+
"reflect": false
|
722
781
|
}
|
723
782
|
};
|
724
783
|
}
|
@@ -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") {
|
@@ -281,9 +293,9 @@ export class SnkSimpleCrud {
|
|
281
293
|
}
|
282
294
|
render() {
|
283
295
|
var _a;
|
284
|
-
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium
|
296
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
285
297
|
? undefined
|
286
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig, fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }))))));
|
298
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { class: "ez-margin-top--large", dataUnit: this.dataUnit, config: this.formConfig, fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }))))));
|
287
299
|
}
|
288
300
|
static get is() { return "snk-simple-crud"; }
|
289
301
|
static get encapsulation() { return "scoped"; }
|
@@ -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
|
}
|