@sankhyalabs/sankhyablocks 8.1.0-dev.10 → 8.1.0-dev.11
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-e32e1391.js → ConfigStorage-d688c739.js} +160 -47
- package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
- package/dist/cjs/{SnkFormConfigManager-5e61b0a9.js → SnkFormConfigManager-29b73c81.js} +18 -20
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +11 -8
- package/dist/cjs/snk-application.cjs.entry.js +42 -38
- package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
- package/dist/cjs/snk-crud.cjs.entry.js +16 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-80a00ae4.js} +4 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +6 -6
- package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
- package/dist/cjs/snk-filter-bar.cjs.entry.js +11 -13
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -15
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -16
- package/dist/cjs/snk-form-config.cjs.entry.js +4 -14
- package/dist/cjs/snk-form.cjs.entry.js +9 -5
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +11 -14
- package/dist/cjs/{snk-guides-viewer-eb0a79a4.js → snk-guides-viewer-f67f9cea.js} +9 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -4
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +11 -13
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
- package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
- package/dist/collection/components/snk-application/snk-application.js +58 -65
- package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
- package/dist/collection/components/snk-crud/snk-crud.js +18 -6
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +20 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +25 -28
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -4
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +2 -12
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +27 -11
- package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
- package/dist/collection/components/snk-form/snk-form.js +24 -2
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
- package/dist/collection/components/snk-grid/snk-grid.js +27 -12
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +19 -1
- package/dist/collection/lib/configs/ConfigStorage.js +33 -44
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
- package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
- package/dist/components/ConfigStorage.js +161 -48
- package/dist/components/ResourceIDUtils.js +10 -0
- package/dist/components/SnkFormConfigManager.js +17 -19
- package/dist/components/auth-fetcher.js +1 -1
- package/dist/components/form-config-fetcher.js +64 -2
- package/dist/components/snk-actions-button2.js +11 -8
- package/dist/components/snk-application2.js +42 -38
- package/dist/components/snk-configurator2.js +3 -1
- package/dist/components/snk-crud.js +17 -5
- package/dist/components/snk-data-unit2.js +5 -3
- package/dist/components/snk-detail-view2.js +13 -7
- package/dist/components/snk-entity-list.js +0 -4
- package/dist/components/snk-filter-bar2.js +11 -11
- package/dist/components/snk-filter-detail2.js +2 -12
- package/dist/components/snk-filter-modal-item2.js +5 -16
- package/dist/components/snk-form-config2.js +5 -15
- package/dist/components/snk-form.js +8 -2
- package/dist/components/snk-grid-config2.js +4 -2
- package/dist/components/snk-grid2.js +11 -12
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-taskbar2.js +3 -1
- package/dist/esm/{ConfigStorage-b6aefe42.js → ConfigStorage-cfe03e99.js} +160 -46
- package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
- package/dist/esm/{SnkFormConfigManager-80901f2d.js → SnkFormConfigManager-bfd8eabd.js} +18 -20
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +11 -8
- package/dist/esm/snk-application.entry.js +42 -38
- package/dist/esm/snk-configurator.entry.js +2 -1
- package/dist/esm/snk-crud.entry.js +16 -5
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-3ab57d1a.js} +4 -3
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +6 -6
- package/dist/esm/snk-entity-list.entry.js +0 -4
- package/dist/esm/snk-filter-bar.entry.js +11 -13
- package/dist/esm/snk-filter-detail.entry.js +2 -16
- package/dist/esm/snk-filter-modal-item.entry.js +4 -17
- package/dist/esm/snk-form-config.entry.js +5 -15
- package/dist/esm/snk-form.entry.js +9 -5
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +11 -14
- package/dist/esm/{snk-guides-viewer-ee42eb53.js → snk-guides-viewer-3ea14ab4.js} +9 -5
- package/dist/esm/snk-guides-viewer.entry.js +3 -4
- package/dist/esm/snk-personalized-filter.entry.js +11 -13
- package/dist/esm/snk-taskbar.entry.js +2 -1
- package/dist/sankhyablocks/p-0ae5b923.entry.js +1 -0
- package/dist/sankhyablocks/p-15230263.js +1 -0
- package/dist/sankhyablocks/p-18fa618e.entry.js +1 -0
- package/dist/sankhyablocks/p-48a40939.js +1 -0
- package/dist/sankhyablocks/p-4c33a77c.entry.js +1 -0
- package/dist/sankhyablocks/p-53884b5f.entry.js +1 -0
- package/dist/sankhyablocks/p-688dcb4c.js +1 -0
- package/dist/sankhyablocks/p-70e785db.entry.js +1 -0
- package/dist/sankhyablocks/p-861a3495.entry.js +1 -0
- package/dist/sankhyablocks/p-878b0dd3.entry.js +1 -0
- package/dist/sankhyablocks/p-97d2fbd9.entry.js +1 -0
- package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
- package/dist/sankhyablocks/p-9d591463.js +1 -0
- package/dist/sankhyablocks/p-9d93da18.js +56 -0
- package/dist/sankhyablocks/{p-77ecc583.entry.js → p-9f387187.entry.js} +1 -1
- package/dist/sankhyablocks/p-aa4c112f.entry.js +11 -0
- package/dist/sankhyablocks/p-bae87498.entry.js +1 -0
- package/dist/sankhyablocks/p-cc67bd06.entry.js +1 -0
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
- package/dist/sankhyablocks/p-e070d7a3.entry.js +1 -0
- package/dist/sankhyablocks/p-e086cc2a.entry.js +1 -0
- package/dist/sankhyablocks/p-ed705cbb.entry.js +1 -0
- package/dist/sankhyablocks/p-fa523d6b.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
- package/dist/types/components/snk-application/snk-application.d.ts +8 -13
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +4 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +5 -2
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
- package/dist/types/components/snk-form/snk-form.d.ts +5 -1
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +4 -0
- package/dist/types/components.d.ts +99 -21
- package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
- package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/filter-bar-config-fetcher-80b033ce.js +0 -155
- package/dist/components/filter-bar-config-fetcher.js +0 -153
- package/dist/components/resource-fetcher.js +0 -66
- package/dist/esm/filter-bar-config-fetcher-317cb6bf.js +0 -153
- package/dist/sankhyablocks/p-0b64f036.entry.js +0 -1
- package/dist/sankhyablocks/p-0e97ec46.entry.js +0 -1
- package/dist/sankhyablocks/p-35ecafcb.entry.js +0 -1
- package/dist/sankhyablocks/p-42843f0e.js +0 -1
- package/dist/sankhyablocks/p-459d4267.entry.js +0 -1
- package/dist/sankhyablocks/p-557affc8.entry.js +0 -1
- package/dist/sankhyablocks/p-564efc43.js +0 -1
- package/dist/sankhyablocks/p-6295424d.entry.js +0 -1
- package/dist/sankhyablocks/p-803b79d6.js +0 -1
- package/dist/sankhyablocks/p-80729c9b.entry.js +0 -11
- package/dist/sankhyablocks/p-95fa8af6.entry.js +0 -1
- package/dist/sankhyablocks/p-96c1ae78.entry.js +0 -1
- package/dist/sankhyablocks/p-b556fadc.entry.js +0 -1
- package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
- package/dist/sankhyablocks/p-bf3bd954.entry.js +0 -1
- package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
- package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
- package/dist/sankhyablocks/p-dd1fa35d.js +0 -56
- package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
- package/dist/sankhyablocks/p-e42f1f2a.js +0 -1
- package/dist/sankhyablocks/p-f24c4bc7.entry.js +0 -1
- package/dist/sankhyablocks/p-fd69eab9.entry.js +0 -1
@@ -27,9 +27,13 @@ export declare class SnkPersonalizedFilter {
|
|
27
27
|
*/
|
28
28
|
filterId: string;
|
29
29
|
/**
|
30
|
-
* Nome da
|
30
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
31
31
|
*/
|
32
32
|
configName: string;
|
33
|
+
/**
|
34
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
35
|
+
*/
|
36
|
+
resourceID: string;
|
33
37
|
ezCancel: EventEmitter<void>;
|
34
38
|
ezSave: EventEmitter<string>;
|
35
39
|
createPersonalizedFilter(): Promise<void>;
|
@@ -14,6 +14,10 @@ export declare class SnkTaskbar {
|
|
14
14
|
* Usado para guardar ou recuperar as configurações do formulário.
|
15
15
|
*/
|
16
16
|
configName: string;
|
17
|
+
/**
|
18
|
+
* Identificador de recursos como configurações e acesso.
|
19
|
+
*/
|
20
|
+
resourceID: string;
|
17
21
|
/**
|
18
22
|
* Lista separada por virgula, contendo todos os elementos a serem criados.
|
19
23
|
*/
|
@@ -14,13 +14,13 @@ import { IClientEventResponse } from "./lib/http/data-fetcher/interfaces/IClient
|
|
14
14
|
import { IDataFetcherRecaller } from "./lib/http/data-fetcher/recaller/IDataFetcherRecaller";
|
15
15
|
import { DataFetcher, Options } from "./lib/http/data-fetcher/DataFetcher";
|
16
16
|
import { DialogType, MessageOptions } from "@sankhyalabs/ezui/dist/collection/utils";
|
17
|
-
import { EzGridColumn, IGridConfig, IStatusResolver, StatusResolverFunction } from "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController";
|
18
17
|
import { IOption, ISearchArgument } from "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box";
|
19
18
|
import { IRemoveSearchListener, ISearchListener, SearchCriteria } from "./lib/http/data-fetcher/fetchers/pesquisa-fetcher";
|
20
19
|
import { IFieldConfig, IFormCardConfig, IFormConfig, IRecordValidator, ISummaryField } from "@sankhyalabs/ezui/dist/types/utils/form/interfaces";
|
21
20
|
import { SIMPLE_CRUD_MODE, VIEW_MODE } from "./lib/utils/constants";
|
22
21
|
import { ISelectionToastConfig } from "@sankhyalabs/ezui/dist/types/components/ez-grid/interfaces";
|
23
22
|
import { Action, TaskbarManager } from "./components/snk-taskbar/snk-taskbar";
|
23
|
+
import { EzGridColumn, IGridConfig, IStatusResolver, StatusResolverFunction } from "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController";
|
24
24
|
import { PresentationMode } from "./lib";
|
25
25
|
import { IExporterProvider } from "./components/snk-data-exporter/interfaces/IExporterProvider";
|
26
26
|
import { DataState } from "./components/snk-data-unit/snk-data-unit";
|
@@ -108,7 +108,7 @@ export namespace Components {
|
|
108
108
|
/**
|
109
109
|
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
|
110
110
|
*/
|
111
|
-
"createDataunit": (entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string) => Promise<DataUnit>;
|
111
|
+
"createDataunit": (entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string) => Promise<DataUnit>;
|
112
112
|
/**
|
113
113
|
* Exibe o diálogo de erro de acordo com os parâmetros passados.
|
114
114
|
*/
|
@@ -128,7 +128,7 @@ export namespace Components {
|
|
128
128
|
/**
|
129
129
|
* Obtém todos os acessos do usuário logado.
|
130
130
|
*/
|
131
|
-
"getAllAccess": () => Promise<any>;
|
131
|
+
"getAllAccess": (resourceID?: string) => Promise<any>;
|
132
132
|
/**
|
133
133
|
* Obtém o nome das telas da aplicação
|
134
134
|
*/
|
@@ -157,7 +157,7 @@ export namespace Components {
|
|
157
157
|
/**
|
158
158
|
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
159
159
|
*/
|
160
|
-
"getDataUnit": (entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string) => Promise<DataUnit>;
|
160
|
+
"getDataUnit": (entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string) => Promise<DataUnit>;
|
161
161
|
/**
|
162
162
|
* Obtém o valor de um parâmetro do tipo data.
|
163
163
|
*/
|
@@ -185,7 +185,7 @@ export namespace Components {
|
|
185
185
|
/**
|
186
186
|
* Obtém `true` caso o usuário logado tem permissão pra determinada ação.
|
187
187
|
*/
|
188
|
-
"hasAccess": (access: AutorizationType) => Promise<boolean>;
|
188
|
+
"hasAccess": (access: AutorizationType, resourceID?: string) => Promise<boolean>;
|
189
189
|
/**
|
190
190
|
* Verfica se um client event está registrado no DataFetcher da aplicação.
|
191
191
|
* @param eventID - Nome do evento a ser verificado.
|
@@ -209,10 +209,6 @@ export namespace Components {
|
|
209
209
|
* Obtém `true` caso o usuário logado seja o SUP.
|
210
210
|
*/
|
211
211
|
"isUserSup": () => Promise<boolean>;
|
212
|
-
/**
|
213
|
-
* Obtém a configuração de grade.
|
214
|
-
*/
|
215
|
-
"loadGridConfig": (name: string) => Promise<IGridConfig>;
|
216
212
|
/**
|
217
213
|
* Obtém os totalizadores da grade.
|
218
214
|
*/
|
@@ -337,6 +333,10 @@ export namespace Components {
|
|
337
333
|
* Exibe a janela de configuração.
|
338
334
|
*/
|
339
335
|
"open": () => Promise<void>;
|
336
|
+
/**
|
337
|
+
* Identificador de recursos como configurações e acesso.
|
338
|
+
*/
|
339
|
+
"resourceID": string;
|
340
340
|
/**
|
341
341
|
* Usado para exibir os botões de ação
|
342
342
|
*/
|
@@ -468,6 +468,10 @@ export namespace Components {
|
|
468
468
|
* Determina quantas linhas são retornadas por página.
|
469
469
|
*/
|
470
470
|
"pageSize": number;
|
471
|
+
/**
|
472
|
+
* Identificador de recursos como configurações e acesso.
|
473
|
+
*/
|
474
|
+
"resourceID": string;
|
471
475
|
/**
|
472
476
|
* Determina se será usado mensagem de confirmação padrão na tentativa de cancelar a edição.
|
473
477
|
*/
|
@@ -517,6 +521,10 @@ export namespace Components {
|
|
517
521
|
*/
|
518
522
|
"label": string;
|
519
523
|
"messagesBuilder": SnkMessageBuilder;
|
524
|
+
/**
|
525
|
+
* Identificador de recursos como configurações e acesso.
|
526
|
+
*/
|
527
|
+
"resourceID": string;
|
520
528
|
/**
|
521
529
|
* Representa o formulário selecionado.
|
522
530
|
*/
|
@@ -659,6 +667,10 @@ export namespace Components {
|
|
659
667
|
* Faz o recarregamento da filterbar buscando o state no servidor.
|
660
668
|
*/
|
661
669
|
"reload": () => Promise<void>;
|
670
|
+
/**
|
671
|
+
* Identificador de recursos como configurações e acesso.
|
672
|
+
*/
|
673
|
+
"resourceID": string;
|
662
674
|
}
|
663
675
|
interface SnkFilterBinarySelect {
|
664
676
|
/**
|
@@ -780,7 +792,7 @@ export namespace Components {
|
|
780
792
|
*/
|
781
793
|
"closeModal": () => void;
|
782
794
|
/**
|
783
|
-
* Nome da
|
795
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
784
796
|
*/
|
785
797
|
"configName": string;
|
786
798
|
/**
|
@@ -798,10 +810,14 @@ export namespace Components {
|
|
798
810
|
}
|
799
811
|
interface SnkFilterModalItem {
|
800
812
|
/**
|
801
|
-
* Nome da
|
813
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
802
814
|
*/
|
803
815
|
"configName": string;
|
804
816
|
"filterItem": SnkFilterItemConfig;
|
817
|
+
/**
|
818
|
+
* Identificador de recursos como configurações e acesso.
|
819
|
+
*/
|
820
|
+
"resourceID": string;
|
805
821
|
}
|
806
822
|
interface SnkFilterMultiSelect {
|
807
823
|
/**
|
@@ -908,6 +924,10 @@ export namespace Components {
|
|
908
924
|
* Validador responsável por checar a integridade das informações do registro.
|
909
925
|
*/
|
910
926
|
"recordsValidator": IRecordValidator;
|
927
|
+
/**
|
928
|
+
* Identificador de recursos como configurações e acesso.
|
929
|
+
*/
|
930
|
+
"resourceID": string;
|
911
931
|
/**
|
912
932
|
* Exibe a janela de configurações do formulário.
|
913
933
|
*/
|
@@ -1031,6 +1051,10 @@ export namespace Components {
|
|
1031
1051
|
* Faz o recarregamento da filter-bar da grade buscando o state no servidor.
|
1032
1052
|
*/
|
1033
1053
|
"reloadFilterBar": () => Promise<void>;
|
1054
|
+
/**
|
1055
|
+
* Identificador de recursos como configurações e acesso.
|
1056
|
+
*/
|
1057
|
+
"resourceID": string;
|
1034
1058
|
/**
|
1035
1059
|
* Configuração da seleção de grade no toast.
|
1036
1060
|
*/
|
@@ -1073,13 +1097,16 @@ export namespace Components {
|
|
1073
1097
|
* Nome usado para salvar/recuperar a configuração.
|
1074
1098
|
*/
|
1075
1099
|
"configName": string;
|
1100
|
+
/**
|
1101
|
+
* Nome usado para salvar/recuperar a configuração.
|
1102
|
+
*/
|
1103
|
+
"resourceID": string;
|
1076
1104
|
/**
|
1077
1105
|
* Aba selecionada das configurações da grade.
|
1078
1106
|
*/
|
1079
1107
|
"selectedIndex": number;
|
1080
1108
|
}
|
1081
1109
|
interface SnkGuidesViewer {
|
1082
|
-
"_guideBuilders": Map<string, GuideBuilder>;
|
1083
1110
|
/**
|
1084
1111
|
* Ações a serem colocadas no botão "Mais opções" do componente snk-taskbar.
|
1085
1112
|
*/
|
@@ -1120,6 +1147,10 @@ export namespace Components {
|
|
1120
1147
|
* Validador responsável por checar a integridade das informações do registro.
|
1121
1148
|
*/
|
1122
1149
|
"recordsValidator": IRecordValidator;
|
1150
|
+
/**
|
1151
|
+
* Identificador de recursos como configurações e acesso.
|
1152
|
+
*/
|
1153
|
+
"resourceID": string;
|
1123
1154
|
/**
|
1124
1155
|
* Guia selecionada.
|
1125
1156
|
*/
|
@@ -1136,7 +1167,7 @@ export namespace Components {
|
|
1136
1167
|
}
|
1137
1168
|
interface SnkPersonalizedFilter {
|
1138
1169
|
/**
|
1139
|
-
* Nome da
|
1170
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
1140
1171
|
*/
|
1141
1172
|
"configName": string;
|
1142
1173
|
"createPersonalizedFilter": () => Promise<void>;
|
@@ -1152,6 +1183,10 @@ export namespace Components {
|
|
1152
1183
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
1153
1184
|
*/
|
1154
1185
|
"messagesBuilder": SnkMessageBuilder;
|
1186
|
+
/**
|
1187
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
1188
|
+
*/
|
1189
|
+
"resourceID": string;
|
1155
1190
|
}
|
1156
1191
|
interface SnkPersonalizedFilterEditor {
|
1157
1192
|
/**
|
@@ -1302,6 +1337,10 @@ export namespace Components {
|
|
1302
1337
|
* Determina qual botão deve ter aparência primária.
|
1303
1338
|
*/
|
1304
1339
|
"primaryButton": string;
|
1340
|
+
/**
|
1341
|
+
* Identificador de recursos como configurações e acesso.
|
1342
|
+
*/
|
1343
|
+
"resourceID": string;
|
1305
1344
|
}
|
1306
1345
|
interface TestePesquisa {
|
1307
1346
|
}
|
@@ -1912,6 +1951,10 @@ declare namespace LocalJSX {
|
|
1912
1951
|
* Emitido quando salva a configuração.
|
1913
1952
|
*/
|
1914
1953
|
"onSave"?: (event: SnkConfiguratorCustomEvent<void>) => void;
|
1954
|
+
/**
|
1955
|
+
* Identificador de recursos como configurações e acesso.
|
1956
|
+
*/
|
1957
|
+
"resourceID"?: string;
|
1915
1958
|
/**
|
1916
1959
|
* Usado para exibir os botões de ação
|
1917
1960
|
*/
|
@@ -2054,6 +2097,10 @@ declare namespace LocalJSX {
|
|
2054
2097
|
* Determina quantas linhas são retornadas por página.
|
2055
2098
|
*/
|
2056
2099
|
"pageSize"?: number;
|
2100
|
+
/**
|
2101
|
+
* Identificador de recursos como configurações e acesso.
|
2102
|
+
*/
|
2103
|
+
"resourceID"?: string;
|
2057
2104
|
/**
|
2058
2105
|
* Determina se será usado mensagem de confirmação padrão na tentativa de cancelar a edição.
|
2059
2106
|
*/
|
@@ -2106,6 +2153,10 @@ declare namespace LocalJSX {
|
|
2106
2153
|
* Emitido quando há necessidade de comutar entre grid e form.
|
2107
2154
|
*/
|
2108
2155
|
"onSnkSwitchGuide"?: (event: SnkDetailViewCustomEvent<string>) => void;
|
2156
|
+
/**
|
2157
|
+
* Identificador de recursos como configurações e acesso.
|
2158
|
+
*/
|
2159
|
+
"resourceID"?: string;
|
2109
2160
|
/**
|
2110
2161
|
* Representa o formulário selecionado.
|
2111
2162
|
*/
|
@@ -2120,10 +2171,6 @@ declare namespace LocalJSX {
|
|
2120
2171
|
* Permite definir uma altura máxima para o ez-list, adicionando um scroll ao atingir esta medida
|
2121
2172
|
*/
|
2122
2173
|
"maxHeightList"?: string;
|
2123
|
-
/**
|
2124
|
-
* Evento emitido ao realizar alguma ação que altera os dados do config.value permitindo salvar estas informações
|
2125
|
-
*/
|
2126
|
-
"onSaveConfig"?: (event: SnkEntityListCustomEvent<SnkFilterItemConfig>) => void;
|
2127
2174
|
/**
|
2128
2175
|
* Emite um evento customizado ao realizar alteração nos valores do componente
|
2129
2176
|
*/
|
@@ -2276,6 +2323,10 @@ declare namespace LocalJSX {
|
|
2276
2323
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
2277
2324
|
*/
|
2278
2325
|
"messagesBuilder"?: SnkMessageBuilder;
|
2326
|
+
/**
|
2327
|
+
* Identificador de recursos como configurações e acesso.
|
2328
|
+
*/
|
2329
|
+
"resourceID"?: string;
|
2279
2330
|
}
|
2280
2331
|
interface SnkFilterBinarySelect {
|
2281
2332
|
/**
|
@@ -2390,7 +2441,7 @@ declare namespace LocalJSX {
|
|
2390
2441
|
*/
|
2391
2442
|
"closeModal"?: () => void;
|
2392
2443
|
/**
|
2393
|
-
* Nome da
|
2444
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
2394
2445
|
*/
|
2395
2446
|
"configName"?: string;
|
2396
2447
|
/**
|
@@ -2408,13 +2459,17 @@ declare namespace LocalJSX {
|
|
2408
2459
|
}
|
2409
2460
|
interface SnkFilterModalItem {
|
2410
2461
|
/**
|
2411
|
-
* Nome da
|
2462
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
2412
2463
|
*/
|
2413
2464
|
"configName"?: string;
|
2414
2465
|
"filterItem"?: SnkFilterItemConfig;
|
2415
2466
|
"onAddPersonalizedFilter"?: (event: SnkFilterModalItemCustomEvent<void>) => void;
|
2416
2467
|
"onEditPersonalizedFilter"?: (event: SnkFilterModalItemCustomEvent<string>) => void;
|
2417
2468
|
"onFilterChange"?: (event: SnkFilterModalItemCustomEvent<SnkFilterItemConfig>) => void;
|
2469
|
+
/**
|
2470
|
+
* Identificador de recursos como configurações e acesso.
|
2471
|
+
*/
|
2472
|
+
"resourceID"?: string;
|
2418
2473
|
}
|
2419
2474
|
interface SnkFilterMultiSelect {
|
2420
2475
|
/**
|
@@ -2525,6 +2580,10 @@ declare namespace LocalJSX {
|
|
2525
2580
|
* Validador responsável por checar a integridade das informações do registro.
|
2526
2581
|
*/
|
2527
2582
|
"recordsValidator"?: IRecordValidator;
|
2583
|
+
/**
|
2584
|
+
* Identificador de recursos como configurações e acesso.
|
2585
|
+
*/
|
2586
|
+
"resourceID"?: string;
|
2528
2587
|
}
|
2529
2588
|
interface SnkFormConfig {
|
2530
2589
|
/**
|
@@ -2659,6 +2718,10 @@ declare namespace LocalJSX {
|
|
2659
2718
|
* Validador responsável por checar a integridade das informações do registro.
|
2660
2719
|
*/
|
2661
2720
|
"recordsValidator"?: IRecordValidator;
|
2721
|
+
/**
|
2722
|
+
* Identificador de recursos como configurações e acesso.
|
2723
|
+
*/
|
2724
|
+
"resourceID"?: string;
|
2662
2725
|
/**
|
2663
2726
|
* Configuração da seleção de grade no toast.
|
2664
2727
|
*/
|
@@ -2701,13 +2764,16 @@ declare namespace LocalJSX {
|
|
2701
2764
|
* Emitido ao salvar a alteração das configurações.
|
2702
2765
|
*/
|
2703
2766
|
"onConfigChange"?: (event: SnkGridConfigCustomEvent<IGridConfig>) => void;
|
2767
|
+
/**
|
2768
|
+
* Nome usado para salvar/recuperar a configuração.
|
2769
|
+
*/
|
2770
|
+
"resourceID"?: string;
|
2704
2771
|
/**
|
2705
2772
|
* Aba selecionada das configurações da grade.
|
2706
2773
|
*/
|
2707
2774
|
"selectedIndex"?: number;
|
2708
2775
|
}
|
2709
2776
|
interface SnkGuidesViewer {
|
2710
|
-
"_guideBuilders"?: Map<string, GuideBuilder>;
|
2711
2777
|
/**
|
2712
2778
|
* Ações a serem colocadas no botão "Mais opções" do componente snk-taskbar.
|
2713
2779
|
*/
|
@@ -2760,6 +2826,10 @@ declare namespace LocalJSX {
|
|
2760
2826
|
* Validador responsável por checar a integridade das informações do registro.
|
2761
2827
|
*/
|
2762
2828
|
"recordsValidator"?: IRecordValidator;
|
2829
|
+
/**
|
2830
|
+
* Identificador de recursos como configurações e acesso.
|
2831
|
+
*/
|
2832
|
+
"resourceID"?: string;
|
2763
2833
|
/**
|
2764
2834
|
* Guia selecionada.
|
2765
2835
|
*/
|
@@ -2771,7 +2841,7 @@ declare namespace LocalJSX {
|
|
2771
2841
|
}
|
2772
2842
|
interface SnkPersonalizedFilter {
|
2773
2843
|
/**
|
2774
|
-
* Nome da
|
2844
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
2775
2845
|
*/
|
2776
2846
|
"configName"?: string;
|
2777
2847
|
/**
|
@@ -2788,6 +2858,10 @@ declare namespace LocalJSX {
|
|
2788
2858
|
"messagesBuilder"?: SnkMessageBuilder;
|
2789
2859
|
"onEzCancel"?: (event: SnkPersonalizedFilterCustomEvent<void>) => void;
|
2790
2860
|
"onEzSave"?: (event: SnkPersonalizedFilterCustomEvent<string>) => void;
|
2861
|
+
/**
|
2862
|
+
* Nome da configuração. Serve para distinguir várias instâncias do componente.
|
2863
|
+
*/
|
2864
|
+
"resourceID"?: string;
|
2791
2865
|
}
|
2792
2866
|
interface SnkPersonalizedFilterEditor {
|
2793
2867
|
/**
|
@@ -2989,6 +3063,10 @@ declare namespace LocalJSX {
|
|
2989
3063
|
* Determina qual botão deve ter aparência primária.
|
2990
3064
|
*/
|
2991
3065
|
"primaryButton"?: string;
|
3066
|
+
/**
|
3067
|
+
* Identificador de recursos como configurações e acesso.
|
3068
|
+
*/
|
3069
|
+
"resourceID"?: string;
|
2992
3070
|
}
|
2993
3071
|
interface TestePesquisa {
|
2994
3072
|
}
|
@@ -4,24 +4,22 @@ import { IFormCardConfig, IFormConfig } from "@sankhyalabs/ezui/dist/types/utils
|
|
4
4
|
import { ISaveResourceResponse } from "../http/data-fetcher/fetchers/resource-fetcher";
|
5
5
|
import { IPersonalizedFilter, IValidateFilter } from "../../components/snk-personalized-filter/interfaces/IPersonalizedFilter";
|
6
6
|
export declare class ConfigStorage {
|
7
|
-
private static instance;
|
8
7
|
private static configById;
|
9
8
|
private static filterBarConfigFetcher;
|
10
9
|
private static formConfigFetcher;
|
11
10
|
private static gridConfigFetcher;
|
12
11
|
private static personalizedFilterFetcher;
|
13
|
-
|
14
|
-
static
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
static
|
19
|
-
static
|
20
|
-
static
|
21
|
-
static
|
22
|
-
static
|
23
|
-
static
|
24
|
-
static removePersonalizedFilter(personalizedFilter: IPersonalizedFilter, configName?: string): Promise<IPersonalizedFilter>;
|
12
|
+
static preload(resourceID: string, configName: string): void;
|
13
|
+
static loadFilterBarConfig(name: string, resourceID: string, urlParams?: object): Promise<Array<SnkFilterItemConfig>>;
|
14
|
+
static loadFormConfig(name: string, resourceID: string): Promise<IFormConfig>;
|
15
|
+
static loadGridConfig(name: string, resourceID: string): Promise<IGridConfig>;
|
16
|
+
static saveFilterBarConfig(config: Array<SnkFilterItemConfig>, name: string, resourceID: string): Promise<ISaveResourceResponse>;
|
17
|
+
static saveFormConfig(config: IFormConfig, name: string, resourceID: string): Promise<IFormConfig>;
|
18
|
+
static saveCardState(config: Map<string, IFormCardConfig>, name: string, resourceID: string): Promise<Map<string, IFormCardConfig>>;
|
19
|
+
static saveGridConfig(config: IGridConfig, name: string, resourceID: string): Promise<IGridConfig>;
|
20
|
+
static loadPersonalizedFilter(filterId: string, resourceID: string, configName?: string): Promise<IPersonalizedFilter>;
|
21
|
+
static savePersonalizedFilter(personalizedFilter: IPersonalizedFilter, resourceID: string, configName?: string): Promise<IPersonalizedFilter>;
|
22
|
+
static removePersonalizedFilter(personalizedFilter: IPersonalizedFilter, resourceID: string, configName?: string): Promise<IPersonalizedFilter>;
|
25
23
|
static validatePersonalizedFilter(dataUnitName: string, expression: string): Promise<IValidateFilter>;
|
26
24
|
private static buildCacheID;
|
27
25
|
}
|
@@ -4,7 +4,6 @@ export default class FilterBarConfigFetcher extends ResourceFetcher {
|
|
4
4
|
private normalize;
|
5
5
|
saveConfig(items: Array<SnkFilterItemConfig>, resourceID: string, configName: string): Promise<ISaveResourceResponse>;
|
6
6
|
getConfig(resourceID: string, configName: string, urlParams?: object): Promise<Array<SnkFilterItemConfig>>;
|
7
|
-
saveEntityListConfig(item: SnkFilterItemConfig, resourceID: string, configName: string): Promise<ISaveResourceResponse>;
|
8
7
|
private buildFieldList;
|
9
8
|
private getPath;
|
10
9
|
private buildQueryString;
|
package/package.json
CHANGED
@@ -1,155 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
4
|
-
const resourceFetcher = require('./resource-fetcher-95d24dff.js');
|
5
|
-
|
6
|
-
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
7
|
-
var t = {};
|
8
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
9
|
-
t[p] = s[p];
|
10
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
11
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
12
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
13
|
-
t[p[i]] = s[p[i]];
|
14
|
-
}
|
15
|
-
return t;
|
16
|
-
};
|
17
|
-
function normalizeValue(value, type) {
|
18
|
-
if (value == undefined) {
|
19
|
-
return value;
|
20
|
-
}
|
21
|
-
if (value instanceof Date) {
|
22
|
-
return value.toISOString();
|
23
|
-
}
|
24
|
-
if (typeof value === "object") {
|
25
|
-
if (value instanceof Array) {
|
26
|
-
return value.map(item => {
|
27
|
-
if (filterItemType_enum.FilterItemType.MULTI_LIST === type) {
|
28
|
-
const values = __rest(item, ["label"]);
|
29
|
-
return normalizeValue(values);
|
30
|
-
}
|
31
|
-
return normalizeValue(item);
|
32
|
-
});
|
33
|
-
}
|
34
|
-
else {
|
35
|
-
const normalized = Object.assign({}, value);
|
36
|
-
Object.keys(value).forEach(prop => {
|
37
|
-
if (value[prop] !== undefined) {
|
38
|
-
normalized[prop] = normalizeValue(value[prop], type);
|
39
|
-
}
|
40
|
-
else {
|
41
|
-
delete normalized[prop];
|
42
|
-
}
|
43
|
-
});
|
44
|
-
return normalized;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
return value;
|
48
|
-
}
|
49
|
-
class FilterBarConfigFetcher extends resourceFetcher.ResourceFetcher {
|
50
|
-
normalize(items) {
|
51
|
-
return items.map(item => {
|
52
|
-
const { id, value, fixed, visible, type, groupedItems } = item;
|
53
|
-
const stateItem = { id };
|
54
|
-
if (value) {
|
55
|
-
stateItem["value"] = normalizeValue(value, type);
|
56
|
-
}
|
57
|
-
if (fixed) {
|
58
|
-
stateItem["fixed"] = fixed;
|
59
|
-
}
|
60
|
-
if (groupedItems) {
|
61
|
-
if (groupedItems.length === 0) {
|
62
|
-
return;
|
63
|
-
}
|
64
|
-
if (groupedItems.filter(item => item.visible).length > 0) {
|
65
|
-
stateItem["visible"] = true;
|
66
|
-
}
|
67
|
-
stateItem["groupedItems"] = this.normalize(groupedItems);
|
68
|
-
}
|
69
|
-
else {
|
70
|
-
if (visible) {
|
71
|
-
stateItem["visible"] = true;
|
72
|
-
}
|
73
|
-
}
|
74
|
-
return stateItem;
|
75
|
-
}).filter(item => item != undefined);
|
76
|
-
}
|
77
|
-
saveConfig(items, resourceID, configName) {
|
78
|
-
return this.saveResource(this.normalize(items), this.getPath(resourceID, configName));
|
79
|
-
}
|
80
|
-
getConfig(resourceID, configName, urlParams) {
|
81
|
-
return new Promise((accept, reject) => {
|
82
|
-
this.loadResource(this.getPath(resourceID, configName, urlParams))
|
83
|
-
.then((configAsString) => {
|
84
|
-
let fieldsList;
|
85
|
-
if (configAsString) {
|
86
|
-
const filterBarConfig = JSON.parse(configAsString);
|
87
|
-
fieldsList = this.buildFieldList(filterBarConfig.items);
|
88
|
-
}
|
89
|
-
accept(fieldsList || []);
|
90
|
-
})
|
91
|
-
.catch((error) => {
|
92
|
-
reject(error);
|
93
|
-
});
|
94
|
-
});
|
95
|
-
}
|
96
|
-
saveEntityListConfig(item, resourceID, configName) {
|
97
|
-
return new Promise((accept, reject) => {
|
98
|
-
this.getConfig(resourceID, configName).then(config => {
|
99
|
-
const state = config.map(({ id, value, fixed, visible, type, groupedItems }) => {
|
100
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({ id }, (value && { value: normalizeValue(value, type) })), (fixed && { fixed })), (visible && { visible: true })), { groupedItems });
|
101
|
-
});
|
102
|
-
const index = state.findIndex(({ id }) => id === item.id);
|
103
|
-
const newItem = { id: item.id, value: normalizeValue(item.value, item.type), fixed: item.fixed, visible: true };
|
104
|
-
if (index > -1) {
|
105
|
-
state[index] = newItem;
|
106
|
-
}
|
107
|
-
else {
|
108
|
-
state.push(newItem);
|
109
|
-
}
|
110
|
-
this.saveResource(state, this.getPath(resourceID, configName)).then(resp => {
|
111
|
-
accept(resp);
|
112
|
-
}).catch(exception => {
|
113
|
-
reject(exception);
|
114
|
-
});
|
115
|
-
}).catch(exception => {
|
116
|
-
reject(exception);
|
117
|
-
});
|
118
|
-
});
|
119
|
-
}
|
120
|
-
buildFieldList(items) {
|
121
|
-
return items.map(item => {
|
122
|
-
var _a, _b;
|
123
|
-
if (item.type === filterItemType_enum.FilterItemType.MULTI_LIST) {
|
124
|
-
const multiListValue = item.value;
|
125
|
-
item.value = (_b = (_a = multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.elements) !== null && _a !== void 0 ? _a : multiListValue === null || multiListValue === void 0 ? void 0 : multiListValue.members) !== null && _b !== void 0 ? _b : multiListValue;
|
126
|
-
}
|
127
|
-
return item;
|
128
|
-
});
|
129
|
-
}
|
130
|
-
getPath(resourceID, name, urlParams) {
|
131
|
-
let path = `cfg://filter/FilterBarState:${resourceID}`;
|
132
|
-
if (name) {
|
133
|
-
path += `.${name}`;
|
134
|
-
}
|
135
|
-
if (urlParams) {
|
136
|
-
path += this.buildQueryString(urlParams);
|
137
|
-
}
|
138
|
-
return path;
|
139
|
-
}
|
140
|
-
buildQueryString(urlParams) {
|
141
|
-
let queryString = '?';
|
142
|
-
for (let key in urlParams) {
|
143
|
-
if (!urlParams.hasOwnProperty(key)) {
|
144
|
-
continue;
|
145
|
-
}
|
146
|
-
if (queryString.length > 1) {
|
147
|
-
queryString += '&';
|
148
|
-
}
|
149
|
-
queryString += key + '=' + urlParams[key];
|
150
|
-
}
|
151
|
-
return queryString;
|
152
|
-
}
|
153
|
-
}
|
154
|
-
|
155
|
-
exports.FilterBarConfigFetcher = FilterBarConfigFetcher;
|