@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-33766.1 → 0.0.0-bugfix-dev-KB-38407.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-bd4c52da.js → pesquisa-fetcher-977c90b1.js} +221 -25
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +17 -4
- package/dist/cjs/snk-application.cjs.entry.js +12 -4
- package/dist/cjs/snk-attach.cjs.entry.js +388 -57
- package/dist/cjs/snk-crud.cjs.entry.js +3 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- 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 +4 -5
- package/dist/cjs/snk-filter-item.cjs.entry.js +3 -0
- package/dist/cjs/{snk-guides-viewer-dce60912.js → snk-guides-viewer-5803fe92.js} +2 -3
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -4
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -5
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +43 -0
- package/dist/collection/components/snk-attach/snk-attach.js +188 -39
- package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
- package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
- package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
- package/dist/collection/components/snk-attach/structure/index.js +6 -3
- package/dist/collection/components/snk-crud/snk-crud.js +1 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -0
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +15 -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 +16 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +37 -23
- 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/SnkMessageBuilder.js +13 -0
- package/dist/components/dataunit-fetcher.js +60 -26
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +11 -1
- package/dist/components/snk-attach2.js +394 -57
- package/dist/components/snk-crud.js +1 -1
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-filter-item2.js +3 -0
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/taskbar-actions-button2.js +15 -1
- package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-65714f21.js → pesquisa-fetcher-5e228b5a.js} +221 -26
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +17 -4
- package/dist/esm/snk-application.entry.js +11 -3
- package/dist/esm/snk-attach.entry.js +389 -58
- package/dist/esm/snk-crud.entry.js +3 -4
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- 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 +4 -5
- package/dist/esm/snk-filter-item.entry.js +3 -0
- package/dist/esm/{snk-guides-viewer-8b9564bd.js → snk-guides-viewer-c77e1c8f.js} +2 -3
- package/dist/esm/snk-guides-viewer.entry.js +3 -4
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +2 -3
- package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-25c77ddb.js +65 -0
- package/dist/sankhyablocks/p-2dd38000.entry.js +1 -0
- package/dist/sankhyablocks/p-34156b41.entry.js +1 -0
- package/dist/sankhyablocks/p-3efca291.entry.js +1 -0
- package/dist/sankhyablocks/{p-0874adb5.entry.js → p-40915359.entry.js} +1 -1
- package/dist/sankhyablocks/p-59ce706a.entry.js +1 -0
- package/dist/sankhyablocks/{p-c223b7b2.entry.js → p-86164061.entry.js} +3 -3
- package/dist/sankhyablocks/{p-6977a26c.entry.js → p-86801b08.entry.js} +1 -1
- package/dist/sankhyablocks/p-ab568a2e.entry.js +1 -0
- package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
- package/dist/sankhyablocks/p-ce4bca21.js +1 -0
- package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
- package/dist/sankhyablocks/p-f39f48c2.entry.js +1 -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-application/snk-application.d.ts +7 -0
- package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
- package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +27 -6
- package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
- package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
- package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
- package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -1
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +1 -0
- package/dist/types/components.d.ts +42 -2
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +1 -0
- package/dist/types/lib/index.d.ts +1 -1
- package/package.json +7 -5
- package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
- package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
- package/dist/sankhyablocks/p-28564b5e.entry.js +0 -1
- package/dist/sankhyablocks/p-29804fc5.js +0 -60
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-55930465.entry.js +0 -1
- package/dist/sankhyablocks/p-95a3778f.entry.js +0 -1
- package/dist/sankhyablocks/p-b146a9f0.entry.js +0 -1
- package/dist/sankhyablocks/p-bedb8ad6.entry.js +0 -1
- package/dist/sankhyablocks/p-cdd66657.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
- package/dist/sankhyablocks/p-ebbc17c6.js +0 -1
- package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
- /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TCrudConfig } from "../../interfaces/ICrudConfig";
|
|
2
|
+
import { DataType, UserInterface } from "@sankhyalabs/core";
|
|
3
|
+
export declare const attachCrudConfig: TCrudConfig;
|
|
4
|
+
export declare const attachFetcherMetadataBuilder: {
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
fields: ({
|
|
8
|
+
name: string;
|
|
9
|
+
label: string;
|
|
10
|
+
dataType: DataType;
|
|
11
|
+
userInterface?: undefined;
|
|
12
|
+
readOnly?: undefined;
|
|
13
|
+
required?: undefined;
|
|
14
|
+
visible?: undefined;
|
|
15
|
+
properties?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
name: string;
|
|
18
|
+
label: string;
|
|
19
|
+
dataType: DataType;
|
|
20
|
+
userInterface: UserInterface;
|
|
21
|
+
readOnly: boolean;
|
|
22
|
+
required: boolean;
|
|
23
|
+
visible: boolean;
|
|
24
|
+
properties: {
|
|
25
|
+
subTitle: string;
|
|
26
|
+
MAX_FILES: number;
|
|
27
|
+
STORAGESTRATEGY: string;
|
|
28
|
+
INTERNAL_FILENAME: string;
|
|
29
|
+
};
|
|
30
|
+
})[];
|
|
31
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Change, DataUnit, DataUnitAction, Filter, LoadDataRequest, LoadDataResponse, SavedRecord, UnitMetadata } from "@sankhyalabs/core";
|
|
2
|
+
import { AttachFetcherFacadeInterface } from "../../../../../lib";
|
|
3
|
+
export interface FetcherFacade {
|
|
4
|
+
initLoaders(dataUnit: DataUnit, fetcher: AttachFetcherFacadeInterface, onSuccess: (data?: any) => void): any;
|
|
5
|
+
metadataLoader(dataUnit: DataUnit): Promise<UnitMetadata>;
|
|
6
|
+
dataLoader(dataUnit: DataUnit, request: LoadDataRequest): Promise<LoadDataResponse>;
|
|
7
|
+
saveLoader(changes: Array<Change>, fetcher: AttachFetcherFacadeInterface): Promise<Array<SavedRecord>>;
|
|
8
|
+
removeLoader(dataUnit: DataUnit, ids: string[], fetcher: AttachFetcherFacadeInterface): Promise<string[]>;
|
|
9
|
+
getFilters(registerKey: string): Array<Filter>;
|
|
10
|
+
getInterceptions(dataUnit: DataUnit, action: DataUnitAction, crudRef: HTMLSnkSimpleCrudElement): Promise<DataUnitAction>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Change, DataUnit, DataUnitAction, Filter, LoadDataRequest, LoadDataResponse, SavedRecord, UnitMetadata } from "@sankhyalabs/core";
|
|
2
|
+
import { AttachFetcherFacadeInterface } from "../../../../../lib";
|
|
3
|
+
import { FetcherFacade } from "../facade/fetcher.facade";
|
|
4
|
+
export declare class AnexoSistemaDataUnitFactory implements FetcherFacade {
|
|
5
|
+
private entityName;
|
|
6
|
+
private getMessage;
|
|
7
|
+
private _application;
|
|
8
|
+
private loader;
|
|
9
|
+
constructor(entityName: string, getMessage: Function);
|
|
10
|
+
initLoaders(dataUnit: DataUnit, fetcher: AttachFetcherFacadeInterface, onSuccess: (data?: any) => void): void;
|
|
11
|
+
metadataLoader(dataUnit: DataUnit): Promise<UnitMetadata>;
|
|
12
|
+
dataLoader(dataUnit: DataUnit, request: LoadDataRequest): Promise<LoadDataResponse>;
|
|
13
|
+
saveLoader(changes: Array<Change>, fetcher: AttachFetcherFacadeInterface): Promise<Array<SavedRecord>>;
|
|
14
|
+
removeLoader(dataUnit: DataUnit, ids: string[], fetcher: AttachFetcherFacadeInterface): Promise<string[]>;
|
|
15
|
+
getFilters(registerKey: string): Array<Filter>;
|
|
16
|
+
getInterceptions(dataUnit: DataUnit, action: DataUnitAction, crudRef: HTMLSnkSimpleCrudElement): Promise<DataUnitAction>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Change, DataUnit, DataUnitAction, Filter, LoadDataRequest, LoadDataResponse, SavedRecord, UnitMetadata } from "@sankhyalabs/core";
|
|
2
|
+
import { AttachFetcherFacadeInterface } from "../../../../../lib";
|
|
3
|
+
import { FetcherFacade } from "../facade/fetcher.facade";
|
|
4
|
+
export declare class AttachFetcherDataUnitFactory implements FetcherFacade {
|
|
5
|
+
private getMessage?;
|
|
6
|
+
private _application;
|
|
7
|
+
constructor(getMessage?: Function);
|
|
8
|
+
initLoaders(dataUnit: DataUnit, fetcher: AttachFetcherFacadeInterface, onSuccess: (data?: any) => void): void;
|
|
9
|
+
metadataLoader(_: DataUnit): Promise<UnitMetadata>;
|
|
10
|
+
dataLoader(_: DataUnit, request: LoadDataRequest): Promise<LoadDataResponse>;
|
|
11
|
+
saveLoader(changes: Array<Change>, fetcher: AttachFetcherFacadeInterface): Promise<Array<SavedRecord>>;
|
|
12
|
+
removeLoader(dataUnit: DataUnit, ids: string[], fetcher: AttachFetcherFacadeInterface): Promise<string[]>;
|
|
13
|
+
getFilters(): Array<Filter>;
|
|
14
|
+
getInterceptions(dataUnit: DataUnit, action: DataUnitAction, crudRef: HTMLSnkSimpleCrudElement): Promise<DataUnitAction>;
|
|
15
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './fetcher/facade/fetcher.facade';
|
|
2
|
+
export * from './fetcher/factory/anexo-sistema-data-unit.factory';
|
|
3
|
+
export * from './fetcher/factory/attach-fetcher-data-unit.factory';
|
|
4
|
+
export * from './builder/taskbar-builder';
|
|
5
|
+
export * from './builder/anexo-sistema-crud-config.builder';
|
|
6
|
+
export * from './builder/attach-crud-config.builder';
|
|
@@ -56,7 +56,7 @@ export declare class SnkFilterItem {
|
|
|
56
56
|
* Emitido quando o estado do filtro é alterado.
|
|
57
57
|
*/
|
|
58
58
|
filterChangeListener(): void;
|
|
59
|
-
canClearFilter():
|
|
59
|
+
canClearFilter(): any;
|
|
60
60
|
getRightIconName(): "close" | "chevron-up" | "chevron-down";
|
|
61
61
|
getLeftIconName(): "calendar" | "tune";
|
|
62
62
|
hasActiveElements(value: any): boolean;
|
|
@@ -45,6 +45,7 @@ export declare class TaskbarActionsButton {
|
|
|
45
45
|
private loadItems;
|
|
46
46
|
private canShowDropdown;
|
|
47
47
|
private onSelectAction;
|
|
48
|
+
private getSelectedAction;
|
|
48
49
|
private dropdownItemBuilder;
|
|
49
50
|
/**
|
|
50
51
|
* Existem algumas actions que precisam ser inicializadas assim que o componente é carregado,
|
|
@@ -17,12 +17,14 @@ import { IDataFetcherRecaller } from "./lib/http/data-fetcher/recaller/IDataFetc
|
|
|
17
17
|
import { DialogType, MessageOptions } from "@sankhyalabs/ezui/dist/collection/utils";
|
|
18
18
|
import { IOption, ISearchArgument } from "@sankhyalabs/ezui/dist/types/components/ez-search/ez-search";
|
|
19
19
|
import { IRemoveSearchListener, ISearchListener, SearchCriteria } from "./lib/http/data-fetcher/fetchers/pesquisa-fetcher";
|
|
20
|
+
import { TFetcherType } from "./components/snk-attach/interfaces/TFetcherType";
|
|
21
|
+
import { AttachFetcherFacadeInterface, PresentationMode } from "./lib";
|
|
22
|
+
import { FetcherFacade } from "./components/snk-attach/structure";
|
|
20
23
|
import { IFieldConfig, IFormCardConfig, IFormConfig, IRecordValidator, ISummaryField } from "@sankhyalabs/ezui/dist/types/utils/form/interfaces";
|
|
21
24
|
import { SIMPLE_CRUD_MODE, VIEW_MODE } from "./lib/utils/constants";
|
|
22
25
|
import { ISelectionToastConfig } from "@sankhyalabs/ezui/dist/types/components/ez-grid/interfaces";
|
|
23
26
|
import { Action, TaskbarManager } from "./components/snk-taskbar/snk-taskbar";
|
|
24
27
|
import { EzGridColumn, IGridConfig, IStatusResolver, StatusResolverFunction } from "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController";
|
|
25
|
-
import { PresentationMode } from "./lib";
|
|
26
28
|
import { IExporterProvider } from "./components/snk-data-exporter/interfaces/IExporterProvider";
|
|
27
29
|
import { DataState } from "./components/snk-data-unit/snk-data-unit";
|
|
28
30
|
import { IRecordID } from "./components/snk-data-exporter/interfaces/IRecordID";
|
|
@@ -254,6 +256,12 @@ export namespace Components {
|
|
|
254
256
|
* Salva a configuração de determinado recurso.
|
|
255
257
|
*/
|
|
256
258
|
"saveConfig": (key: string, data: Object) => Promise<any>;
|
|
259
|
+
/**
|
|
260
|
+
* Atribui valor para parâmetros de contexto no componente de pesquisa.
|
|
261
|
+
* @param name - Nome do parâmetro
|
|
262
|
+
* @param value - String conversível de acordo com o tipo do parâmetro
|
|
263
|
+
*/
|
|
264
|
+
"setSearchFilterContext": (name: string, value: string) => Promise<void>;
|
|
257
265
|
/**
|
|
258
266
|
* Apresenta uma lista de alertas, geralmente é utilizado para apresentar resultados de processamentos em lote.
|
|
259
267
|
*/
|
|
@@ -295,10 +303,26 @@ export namespace Components {
|
|
|
295
303
|
"whenApplicationReady": () => Promise<SnkApplication>;
|
|
296
304
|
}
|
|
297
305
|
interface SnkAttach {
|
|
306
|
+
/**
|
|
307
|
+
* DataUnit responsável por carregar os dados.
|
|
308
|
+
*/
|
|
309
|
+
"dataUnit": DataUnit;
|
|
310
|
+
/**
|
|
311
|
+
* DataUnitBuilder responsável por implementar dados a serem utilizados no DataUnit.
|
|
312
|
+
*/
|
|
313
|
+
"dataUnitBuilder": FetcherFacade;
|
|
298
314
|
/**
|
|
299
315
|
* Nome da entidade à ser utilizada para relacionar o anexo ao DataUnit pai.
|
|
300
316
|
*/
|
|
301
317
|
"entityName": string;
|
|
318
|
+
/**
|
|
319
|
+
* Fetcher responsável por carregar os dados do DataUnit.
|
|
320
|
+
*/
|
|
321
|
+
"fetcher": AttachFetcherFacadeInterface;
|
|
322
|
+
/**
|
|
323
|
+
* FetcherType define o tipo de fetcher responsável por carregar os dados do DataUnit.
|
|
324
|
+
*/
|
|
325
|
+
"fetcherType": TFetcherType;
|
|
302
326
|
/**
|
|
303
327
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
|
304
328
|
*/
|
|
@@ -2064,10 +2088,26 @@ declare namespace LocalJSX {
|
|
|
2064
2088
|
"onApplicationLoading"?: (event: SnkApplicationCustomEvent<boolean>) => void;
|
|
2065
2089
|
}
|
|
2066
2090
|
interface SnkAttach {
|
|
2091
|
+
/**
|
|
2092
|
+
* DataUnit responsável por carregar os dados.
|
|
2093
|
+
*/
|
|
2094
|
+
"dataUnit"?: DataUnit;
|
|
2095
|
+
/**
|
|
2096
|
+
* DataUnitBuilder responsável por implementar dados a serem utilizados no DataUnit.
|
|
2097
|
+
*/
|
|
2098
|
+
"dataUnitBuilder"?: FetcherFacade;
|
|
2067
2099
|
/**
|
|
2068
2100
|
* Nome da entidade à ser utilizada para relacionar o anexo ao DataUnit pai.
|
|
2069
2101
|
*/
|
|
2070
|
-
"entityName"
|
|
2102
|
+
"entityName"?: string;
|
|
2103
|
+
/**
|
|
2104
|
+
* Fetcher responsável por carregar os dados do DataUnit.
|
|
2105
|
+
*/
|
|
2106
|
+
"fetcher"?: AttachFetcherFacadeInterface;
|
|
2107
|
+
/**
|
|
2108
|
+
* FetcherType define o tipo de fetcher responsável por carregar os dados do DataUnit.
|
|
2109
|
+
*/
|
|
2110
|
+
"fetcherType"?: TFetcherType;
|
|
2071
2111
|
/**
|
|
2072
2112
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
|
2073
2113
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IClientEventResponse } from './interfaces/IClientEventResponse';
|
|
2
2
|
import { IDataFetcherRecaller } from './recaller/IDataFetcherRecaller';
|
|
3
|
-
type ClientEventHandler = (clientEvent: IClientEventResponse, dataFetcherReacaller: IDataFetcherRecaller) => Promise<void>;
|
|
4
3
|
export declare class DataFetcher {
|
|
5
4
|
private static appTagName;
|
|
6
5
|
private static instance;
|
|
@@ -39,6 +38,7 @@ export declare class DataFetcher {
|
|
|
39
38
|
static hasClientEvent(eventID: String): boolean;
|
|
40
39
|
static removeClientEvent(eventID: String): boolean;
|
|
41
40
|
}
|
|
41
|
+
type ClientEventHandler = (clientEvent: IClientEventResponse, dataFetcherReacaller: IDataFetcherRecaller) => void | Promise<void>;
|
|
42
42
|
export interface RequestListener {
|
|
43
43
|
onRequestStart(param: RequestListenerParams): void;
|
|
44
44
|
onRequestEnd(param: RequestListenerParams): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Change, Record } from "@sankhyalabs/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { DeleteResponse, DownloadKeyResponse, SaveResponse } from "./interfaces";
|
|
3
|
+
import { AttachFetcherFacadeInterface } from "./facade/attach-fetcher.facade";
|
|
4
|
+
export declare class AnexoSistemaFetcher implements AttachFetcherFacadeInterface {
|
|
4
5
|
private entityName;
|
|
5
6
|
private registerKey;
|
|
6
7
|
private dataUnitName;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Change, Record } from "@sankhyalabs/core";
|
|
2
|
+
import { SaveResponse, DeleteResponse, DownloadKeyResponse } from "./interfaces";
|
|
3
|
+
import { AttachFetcherFacadeInterface } from "./facade/attach-fetcher.facade";
|
|
4
|
+
export declare class AttachFetcher implements AttachFetcherFacadeInterface {
|
|
5
|
+
private dataUnitName?;
|
|
6
|
+
constructor(dataUnitName?: string);
|
|
7
|
+
save({ dataUnit: dataUnitName, record, updatingFields: fields, operation }: Change): Promise<Array<SaveResponse>>;
|
|
8
|
+
edit(change: Change): Promise<SaveResponse[]>;
|
|
9
|
+
delete(record: Record): Promise<DeleteResponse>;
|
|
10
|
+
getDownloadKey(record: Record): Promise<DownloadKeyResponse>;
|
|
11
|
+
}
|
package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Change, Record } from '@sankhyalabs/core';
|
|
2
|
+
import { DeleteResponse, DownloadKeyResponse, SaveResponse } from '../interfaces';
|
|
3
|
+
export interface AttachFetcherFacadeInterface {
|
|
4
|
+
save(change: Change): Promise<Array<SaveResponse>>;
|
|
5
|
+
edit(change: Change): Promise<Array<SaveResponse>>;
|
|
6
|
+
delete(record: Record): Promise<DeleteResponse>;
|
|
7
|
+
getDownloadKey(record: Record): Promise<DownloadKeyResponse>;
|
|
8
|
+
}
|
|
@@ -22,5 +22,6 @@ export type SaveResponse = {
|
|
|
22
22
|
export declare enum SaveErrorsEnum {
|
|
23
23
|
LINK_AND_FILE_AT_THE_SAME_TIME = "LINK_AND_FILE_AT_THE_SAME_TIME",
|
|
24
24
|
ANY_LINK_OR_FILE_FILLED = "ANY_LINK_OR_FILE_FILLED",
|
|
25
|
-
UNKNOWN = "UNKNOWN"
|
|
25
|
+
UNKNOWN = "UNKNOWN",
|
|
26
|
+
DESCRIPTION_CANNOT_BE_CHANGED = "DESCRIPTION_CANNOT_BE_CHANGED"
|
|
26
27
|
}
|
|
@@ -10,6 +10,7 @@ export default class DataUnitFetcher {
|
|
|
10
10
|
getDataUnit(entityName: string, resourceID: string, parentDataUnit?: DataUnit, configName?: string): DataUnit;
|
|
11
11
|
private loadMetadata;
|
|
12
12
|
loadSelectDistinct(dataUnit: DataUnit, fieldName: string, argument: string): Promise<Array<string>>;
|
|
13
|
+
private addTransientProperties;
|
|
13
14
|
private saveData;
|
|
14
15
|
private updateCache;
|
|
15
16
|
private getTransientInfo;
|
package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { ILoadDataStrategy } from "../interfaces/ILoadDataStrategy";
|
|
|
4
4
|
import { ILoadingInfo } from "../interfaces/ILoadingInfo";
|
|
5
5
|
export declare class DatasetStrategy implements ILoadDataStrategy {
|
|
6
6
|
canSlice(): boolean;
|
|
7
|
+
private processSortingSide;
|
|
7
8
|
load(dataUnit: DataUnit, request: LoadDataRequest, loadingInfo: ILoadingInfo): Promise<ILoadDataResult>;
|
|
8
9
|
private getFieldsList;
|
|
9
10
|
private getStandAloneFieldsList;
|
|
@@ -4,7 +4,7 @@ export { CrudUtils } from './utils/CrudUtils';
|
|
|
4
4
|
export { PresentationMode } from "./@types";
|
|
5
5
|
export { TotalsFetcher } from './http/data-fetcher/fetchers/totals-fetcher';
|
|
6
6
|
export { default as ApplicationConfigFetcher } from './http/data-fetcher/fetchers/application-config-fetcher';
|
|
7
|
-
export { AttachFetcher } from './http/data-fetcher/fetchers/
|
|
7
|
+
export { AttachFetcher, AnexoSistemaFetcher, AttachFetcherFacadeInterface } from './http/data-fetcher/fetchers/AttachFetcher';
|
|
8
8
|
export { Authorization } from './http/data-fetcher/fetchers/auth-fetcher';
|
|
9
9
|
export { default as DataUnitFetcher } from './http/data-fetcher/fetchers/data-unit/dataunit-fetcher';
|
|
10
10
|
export { default as FilterBarConfigFetcher } from './http/data-fetcher/fetchers/filter-bar-config-fetcher';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sankhyalabs/sankhyablocks",
|
|
3
|
-
"version": "0.0.0-bugfix-dev-KB-
|
|
3
|
+
"version": "0.0.0-bugfix-dev-KB-38407.0",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -20,11 +20,12 @@
|
|
|
20
20
|
"react/"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
|
+
"prebuild": "(test -f ./src/components.d.ts && git checkout ./src/components.d.ts) || true",
|
|
23
24
|
"build": "stencil build --docs",
|
|
24
|
-
"build.prod": "stencil build --docs --prod",
|
|
25
|
+
"build.prod": "npm run prebuild && stencil build --docs --prod",
|
|
25
26
|
"build.with.peerdeps": "stencil build --docs --prod --force-peer-deps",
|
|
26
27
|
"start": "stencil build --dev --watch --serve --force-peer-deps",
|
|
27
|
-
"test": "stencil test --spec --e2e",
|
|
28
|
+
"test": "stencil test --spec --e2e --coverage --silent --testResultsProcessor jest-sonar-reporter",
|
|
28
29
|
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
29
30
|
"generate": "stencil generate",
|
|
30
31
|
"build.css.docs": "node docscsstask.js",
|
|
@@ -42,9 +43,9 @@
|
|
|
42
43
|
"@babel/preset-env": "^7.18.2",
|
|
43
44
|
"@commitlint/cli": "^18.4.3",
|
|
44
45
|
"@commitlint/config-conventional": "^18.4.3",
|
|
45
|
-
"@sankhyalabs/core": "^5.
|
|
46
|
+
"@sankhyalabs/core": "^5.16.0",
|
|
46
47
|
"@sankhyalabs/docscss": "^1.0.4",
|
|
47
|
-
"@sankhyalabs/ezui": "^5.19.
|
|
48
|
+
"@sankhyalabs/ezui": "^5.19.4",
|
|
48
49
|
"@sankhyalabs/skippeerdeps": "^1.0.2",
|
|
49
50
|
"@stencil/core": "^2.13.0",
|
|
50
51
|
"@stencil/react-output-target": "0.0.9",
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
"husky": "^8.0.3",
|
|
58
59
|
"jest": "^27.4.5",
|
|
59
60
|
"jest-cli": "^27.4.5",
|
|
61
|
+
"jest-sonar-reporter": "^2.0.0",
|
|
60
62
|
"puppeteer": "^10.0.0",
|
|
61
63
|
"redux": "^4.1.2"
|
|
62
64
|
},
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const core = require('@sankhyalabs/core');
|
|
4
|
-
const DataFetcher = require('./DataFetcher-ba94ed5b.js');
|
|
5
|
-
|
|
6
|
-
class PesquisaFetcher {
|
|
7
|
-
constructor() {
|
|
8
|
-
this._defaultPageSize = 100;
|
|
9
|
-
this._templateByQuery = new Map();
|
|
10
|
-
this._searchListenersByDataUnit = new Map();
|
|
11
|
-
this.buldTemplates();
|
|
12
|
-
}
|
|
13
|
-
buldTemplates() {
|
|
14
|
-
this._templateByQuery.set("search", DataFetcher.dist.gql `query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
|
|
15
|
-
$queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
|
|
16
|
-
value
|
|
17
|
-
label
|
|
18
|
-
}
|
|
19
|
-
}`);
|
|
20
|
-
}
|
|
21
|
-
loadSearchOptions(entityName, argument, criteria, options) {
|
|
22
|
-
var _a;
|
|
23
|
-
const cleanText = (argument === null || argument === void 0 ? void 0 : argument.toString().trim()) || undefined;
|
|
24
|
-
argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
|
|
25
|
-
criteria === null || criteria === void 0 ? void 0 : criteria.params.forEach(param => {
|
|
26
|
-
if (param.dataType === core.DataType.OBJECT) {
|
|
27
|
-
param.value = JSON.stringify(param.value);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, options);
|
|
31
|
-
const values = {
|
|
32
|
-
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
|
33
|
-
entityName,
|
|
34
|
-
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
|
35
|
-
options: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) || options,
|
|
36
|
-
};
|
|
37
|
-
if (values.options) {
|
|
38
|
-
(_a = values.options) === null || _a === void 0 ? true : delete _a.dataUnitId;
|
|
39
|
-
}
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
DataFetcher.DataFetcher.get()
|
|
42
|
-
.callGraphQL({
|
|
43
|
-
values,
|
|
44
|
-
query: this._templateByQuery.get("search"),
|
|
45
|
-
})
|
|
46
|
-
.then((result) => {
|
|
47
|
-
resolve(result);
|
|
48
|
-
})
|
|
49
|
-
.catch((error) => {
|
|
50
|
-
reject(error);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
loadAdvancedSearch(entityName, argument, criteria, searchOptions) {
|
|
55
|
-
var _a, _b, _c;
|
|
56
|
-
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
|
57
|
-
const values = {
|
|
58
|
-
argument: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.argument) || argument,
|
|
59
|
-
criteria: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) || criteria,
|
|
60
|
-
searchOptions: (listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) || searchOptions,
|
|
61
|
-
};
|
|
62
|
-
const serviceName = "PesquisaSP.getSuggestion";
|
|
63
|
-
const externalCriteria = {
|
|
64
|
-
query: {
|
|
65
|
-
$: (_a = values.criteria) === null || _a === void 0 ? void 0 : _a.expression
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
if (((_b = values.criteria) === null || _b === void 0 ? void 0 : _b.params.length) > 0) {
|
|
69
|
-
externalCriteria.params = {
|
|
70
|
-
param: values.criteria.params.map(param => {
|
|
71
|
-
let value = param.value;
|
|
72
|
-
let type = param.dataType;
|
|
73
|
-
if (type === core.DataType.OBJECT) {
|
|
74
|
-
value = value.value;
|
|
75
|
-
type = "S";
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
type = convertParamType(param.dataType);
|
|
79
|
-
}
|
|
80
|
-
return { $: value, type };
|
|
81
|
-
})
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
const options = searchOptions != undefined
|
|
85
|
-
? {
|
|
86
|
-
"pkFieldName": searchOptions.codeFieldName,
|
|
87
|
-
"label": searchOptions.descriptionFieldName,
|
|
88
|
-
"fieldName": searchOptions.codeFieldName,
|
|
89
|
-
"useDescriptionOptions": false,
|
|
90
|
-
"enableRowsCounter": true
|
|
91
|
-
}
|
|
92
|
-
: undefined;
|
|
93
|
-
const reqBody = {
|
|
94
|
-
"serviceName": serviceName,
|
|
95
|
-
"requestBody": {
|
|
96
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": false, "limit": this._defaultPageSize, "query": { "$": values.argument }, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_c = values.searchOptions) === null || _c === void 0 ? void 0 : _c.rootEntity }, { options }),
|
|
97
|
-
"clientEventList": {
|
|
98
|
-
"clientEvent": []
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
return new Promise((resolve, reject) => {
|
|
103
|
-
DataFetcher.DataFetcher.get()
|
|
104
|
-
.callServiceBroker("PesquisaSP.getSuggestion", JSON.stringify(reqBody))
|
|
105
|
-
.then(result => resolve(result))
|
|
106
|
-
.catch(error => reject(error));
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
addSearchListener(entityName, dataUnitID, listener) {
|
|
110
|
-
var _a;
|
|
111
|
-
const dataUnitSearchListeners = this._searchListenersByDataUnit.get(dataUnitID) || [];
|
|
112
|
-
const entityListener = dataUnitSearchListeners.find(currentListener => currentListener.entity === entityName);
|
|
113
|
-
if (!entityListener) {
|
|
114
|
-
this._searchListenersByDataUnit.set(dataUnitID, [...dataUnitSearchListeners, { entity: entityName, listener }]);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
for (const type of Object.keys(listener)) {
|
|
118
|
-
if (type in entityListener.listener) {
|
|
119
|
-
const listenerFunctionIsEquals = ((_a = entityListener.listener[type]) === null || _a === void 0 ? void 0 : _a.toString()) === listener[type].toString();
|
|
120
|
-
if (listenerFunctionIsEquals)
|
|
121
|
-
continue;
|
|
122
|
-
entityListener.listener[type] = listener[type];
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return () => {
|
|
127
|
-
const newListeners = dataUnitSearchListeners.filter(currentListener => currentListener.entity !== entityName);
|
|
128
|
-
if (!newListeners.length) {
|
|
129
|
-
this._searchListenersByDataUnit.delete(dataUnitID);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
this._searchListenersByDataUnit.set(dataUnitID, newListeners);
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
applySearchListener(listenerType, entityName, argument, criteria, searchOptions) {
|
|
136
|
-
var _a;
|
|
137
|
-
const dataUnitId = searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.dataUnitId;
|
|
138
|
-
if (!dataUnitId)
|
|
139
|
-
return;
|
|
140
|
-
const entityListener = (_a = this._searchListenersByDataUnit.get(dataUnitId)) === null || _a === void 0 ? void 0 : _a.find(({ entity }) => entity === entityName);
|
|
141
|
-
if (!entityListener)
|
|
142
|
-
return;
|
|
143
|
-
const { listener } = entityListener;
|
|
144
|
-
if (!(listenerType in listener))
|
|
145
|
-
return;
|
|
146
|
-
return listener[listenerType]({ argument, criteria, searchOptions });
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function convertParamType(dataType) {
|
|
150
|
-
//Alerta: Cuidado pra não contaminar o DataType com a implementação
|
|
151
|
-
//atual da pesquisa... em geral, somente inteiros,
|
|
152
|
-
//data (com ou sem hora) e string são realmente relevantes
|
|
153
|
-
switch (dataType) {
|
|
154
|
-
case core.DataType.NUMBER:
|
|
155
|
-
return "I";
|
|
156
|
-
case core.DataType.DATE:
|
|
157
|
-
return "D";
|
|
158
|
-
default:
|
|
159
|
-
return "S";
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
var SearchListenerType;
|
|
163
|
-
(function (SearchListenerType) {
|
|
164
|
-
SearchListenerType["beforeSearch"] = "beforeSearch";
|
|
165
|
-
})(SearchListenerType || (SearchListenerType = {}));
|
|
166
|
-
|
|
167
|
-
exports.PesquisaFetcher = PesquisaFetcher;
|