@sankhyalabs/sankhyablocks 8.15.0-dev.2 → 8.15.0-dev.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-0d507a8f.js → ConfigStorage-302bbbd4.js} +25 -15
- package/dist/cjs/{ISave-d68ce3cd.js → ISave-e91b70a7.js} +1 -0
- package/dist/cjs/{SnkFormConfigManager-467907f6.js → SnkFormConfigManager-71c4768e.js} +1 -1
- package/dist/cjs/{SnkMessageBuilder-7293d0ad.js → SnkMessageBuilder-e7dcf408.js} +13 -0
- package/dist/cjs/{index-0e663819.js → index-0922807b.js} +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{dataunit-fetcher-bdaf9482.js → pesquisa-fetcher-e4a7c4c3.js} +254 -34
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +23 -5
- package/dist/cjs/snk-application.cjs.entry.js +74 -6
- package/dist/cjs/snk-attach.cjs.entry.js +395 -57
- package/dist/cjs/snk-crud.cjs.entry.js +5 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
- package/dist/cjs/{snk-data-unit-1bc69073.js → snk-data-unit-82c08a8c.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
- package/dist/cjs/snk-filter-bar.cjs.entry.js +40 -5
- package/dist/cjs/snk-filter-item.cjs.entry.js +3 -0
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -2
- package/dist/cjs/snk-filter-modal.cjs.entry.js +16 -1
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -1
- package/dist/cjs/snk-form.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +41 -18
- package/dist/cjs/{snk-guides-viewer-9342bca1.js → snk-guides-viewer-d32c096f.js} +6 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -2
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +19 -8
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-b8c428a9.js → taskbar-elements-01b85b99.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-application/snk-application.js +119 -13
- package/dist/collection/components/snk-attach/snk-attach.js +194 -38
- package/dist/collection/components/snk-attach/structure/{crud-config-builder.js → builder/anexo-sistema-crud-config.builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +62 -0
- package/dist/collection/components/snk-attach/structure/{taskbar-builder.js → builder/taskbar-builder.js} +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/facade/fetcher.facade.js +1 -0
- package/dist/collection/components/snk-attach/structure/{data-unit-builder.js → fetcher/factory/anexo-sistema-data-unit.factory.js} +14 -11
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +111 -0
- package/dist/collection/components/snk-attach/structure/index.js +6 -3
- package/dist/collection/components/snk-crud/snk-crud.js +2 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +2 -2
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +84 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +0 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +84 -3
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +5 -1
- package/dist/collection/components/snk-grid/snk-grid.js +39 -16
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -1
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +2 -4
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +53 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +26 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -1
- package/dist/collection/lib/@types/index.js +1 -0
- package/dist/collection/lib/configs/ConfigStorage.js +24 -14
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/{attach-fetcher.js → AttachFetcher/anexo-sistema-fetcher.js} +16 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.js +90 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/index.js +2 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDelete.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/interfaces/IDownloadKey.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +31 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +55 -31
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +1 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +7 -1
- package/dist/collection/lib/index.js +1 -1
- package/dist/collection/lib/message/resources/snk-attach.msg.js +13 -0
- package/dist/components/ConfigStorage.js +25 -15
- package/dist/components/SnkMessageBuilder.js +13 -0
- package/dist/components/dataunit-fetcher.js +93 -35
- package/dist/components/index2.js +1 -0
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +73 -3
- package/dist/components/snk-attach2.js +400 -56
- package/dist/components/snk-crud.js +1 -1
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-filter-bar2.js +42 -5
- package/dist/components/snk-filter-item2.js +3 -0
- package/dist/components/snk-filter-modal-item2.js +0 -1
- package/dist/components/snk-filter-modal.js +21 -3
- package/dist/components/snk-filter-multi-select.js +2 -1
- package/dist/components/snk-grid2.js +38 -15
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-simple-crud2.js +15 -1
- package/dist/components/taskbar-actions-button2.js +21 -2
- package/dist/esm/{ConfigStorage-379a9cba.js → ConfigStorage-4151acc8.js} +25 -15
- package/dist/esm/{ISave-4412b20c.js → ISave-d8c8bc59.js} +1 -0
- package/dist/esm/{SnkFormConfigManager-587e9030.js → SnkFormConfigManager-5c7d3771.js} +1 -1
- package/dist/esm/{SnkMessageBuilder-ca843d1b.js → SnkMessageBuilder-0fb796b9.js} +13 -0
- package/dist/esm/{index-1564817d.js → index-0ece87a6.js} +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{dataunit-fetcher-cc1650eb.js → pesquisa-fetcher-fa0c2540.js} +255 -36
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_2.entry.js +23 -5
- package/dist/esm/snk-application.entry.js +74 -6
- package/dist/esm/snk-attach.entry.js +396 -58
- package/dist/esm/snk-crud.entry.js +5 -6
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/{snk-data-unit-6208ebf0.js → snk-data-unit-5d201fb3.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +8 -9
- package/dist/esm/snk-filter-bar.entry.js +40 -5
- package/dist/esm/snk-filter-item.entry.js +3 -0
- package/dist/esm/snk-filter-modal-item.entry.js +1 -2
- package/dist/esm/snk-filter-modal.entry.js +16 -1
- package/dist/esm/snk-filter-multi-select.entry.js +2 -1
- package/dist/esm/snk-form.entry.js +2 -2
- package/dist/esm/snk-grid-config.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +41 -18
- package/dist/esm/{snk-guides-viewer-9ce9588c.js → snk-guides-viewer-f49613c6.js} +6 -7
- package/dist/esm/snk-guides-viewer.entry.js +7 -8
- package/dist/esm/snk-personalized-filter.entry.js +2 -2
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +17 -6
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-26c981af.js → taskbar-elements-d4d0b424.js} +1 -1
- package/dist/sankhyablocks/p-02e3a45b.entry.js +1 -0
- package/dist/sankhyablocks/{p-ff6064e7.js → p-05243555.js} +1 -1
- package/dist/sankhyablocks/p-0ec5b2e5.js +1 -0
- package/dist/sankhyablocks/{p-729f5f5b.entry.js → p-1d75d9f9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9e7d65a4.js → p-21749402.js} +1 -1
- package/dist/sankhyablocks/p-2582537c.entry.js +1 -0
- package/dist/sankhyablocks/p-282789a6.entry.js +1 -0
- package/dist/sankhyablocks/p-374d03f6.js +1 -0
- package/dist/sankhyablocks/p-38289a55.js +1 -0
- package/dist/sankhyablocks/p-3b0e4e08.js +65 -0
- package/dist/sankhyablocks/{p-35fe6e61.entry.js → p-40915359.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2028633c.js → p-573a07c5.js} +1 -1
- package/dist/sankhyablocks/p-62896624.entry.js +1 -0
- package/dist/sankhyablocks/{p-953346b9.entry.js → p-69efa80d.entry.js} +1 -1
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/{p-aaa1438e.entry.js → p-761ed32f.entry.js} +1 -1
- package/dist/sankhyablocks/p-7f3c7b09.entry.js +1 -0
- package/dist/sankhyablocks/{p-6977a26c.entry.js → p-86801b08.entry.js} +1 -1
- package/dist/sankhyablocks/p-9b5944a4.entry.js +1 -0
- package/dist/sankhyablocks/p-9bdbc7d8.entry.js +1 -0
- package/dist/sankhyablocks/p-aa95fb2c.js +56 -0
- package/dist/sankhyablocks/p-ac384baf.entry.js +1 -0
- package/dist/sankhyablocks/p-b05ab13d.entry.js +1 -0
- package/dist/sankhyablocks/p-bf2acf72.entry.js +1 -0
- package/dist/sankhyablocks/p-c4874327.entry.js +1 -0
- package/dist/sankhyablocks/{p-247a8b36.entry.js → p-d1791da2.entry.js} +1 -1
- package/dist/sankhyablocks/p-e0fd9555.entry.js +1 -0
- package/dist/sankhyablocks/p-e817f254.entry.js +11 -0
- package/dist/sankhyablocks/{p-32f0935f.js → p-f3d1c48e.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/subcomponents/snk-actions-form.d.ts +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +12 -2
- package/dist/types/components/snk-attach/{structure/crud-config-builder.d.ts → interfaces/ICrudConfig.d.ts} +1 -2
- package/dist/types/components/snk-attach/interfaces/TFetcherType.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +28 -6
- package/dist/types/components/snk-attach/structure/builder/anexo-sistema-crud-config.builder.d.ts +2 -0
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +31 -0
- package/dist/types/components/snk-attach/structure/{taskbar-builder.d.ts → builder/taskbar-builder.d.ts} +1 -1
- package/dist/types/components/snk-attach/structure/fetcher/facade/fetcher.facade.d.ts +11 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/anexo-sistema-data-unit.factory.d.ts +17 -0
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +15 -0
- package/dist/types/components/snk-attach/structure/index.d.ts +6 -3
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +19 -1
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +16 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +7 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +1 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -1
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +2 -0
- package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +1 -0
- package/dist/types/components.d.ts +108 -13
- package/dist/types/lib/@types/index.d.ts +2 -1
- package/dist/types/lib/configs/ConfigStorage.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/{attach-fetcher.d.ts → AttachFetcher/anexo-sistema-fetcher.d.ts} +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/attach-fetcher.d.ts +11 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/facade/attach-fetcher.facade.d.ts +8 -0
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/index.d.ts +3 -0
- package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/ISave.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +4 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/package.json +15 -6
- package/dist/cjs/pesquisa-fetcher-ef050a47.js +0 -167
- package/dist/esm/pesquisa-fetcher-dd3ca0a5.js +0 -165
- package/dist/sankhyablocks/p-145c4434.js +0 -1
- package/dist/sankhyablocks/p-17dda7a2.entry.js +0 -1
- package/dist/sankhyablocks/p-19f51c6b.entry.js +0 -11
- package/dist/sankhyablocks/p-20726710.entry.js +0 -1
- package/dist/sankhyablocks/p-311c6173.entry.js +0 -1
- package/dist/sankhyablocks/p-4396d1a6.js +0 -56
- package/dist/sankhyablocks/p-44e894af.entry.js +0 -1
- package/dist/sankhyablocks/p-4775a293.entry.js +0 -1
- package/dist/sankhyablocks/p-4b0ea83f.entry.js +0 -1
- package/dist/sankhyablocks/p-5534e08c.js +0 -1
- package/dist/sankhyablocks/p-78777ae0.entry.js +0 -1
- package/dist/sankhyablocks/p-9c3229fc.entry.js +0 -1
- package/dist/sankhyablocks/p-a037f5b4.entry.js +0 -1
- package/dist/sankhyablocks/p-a702a1a2.js +0 -60
- package/dist/sankhyablocks/p-c259545b.entry.js +0 -1
- package/dist/sankhyablocks/p-d1677df0.entry.js +0 -1
- package/dist/sankhyablocks/p-d9bb09b3.js +0 -6
- package/dist/sankhyablocks/p-dd6a8377.js +0 -1
- package/dist/sankhyablocks/p-e138e7d4.entry.js +0 -1
- package/dist/sankhyablocks/p-e1b29d4c.entry.js +0 -1
- package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +0 -15
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js → components/snk-attach/interfaces/ICrudConfig.js} +0 -0
- /package/dist/collection/{lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js → components/snk-attach/interfaces/TFetcherType.js} +0 -0
- /package/dist/collection/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.js +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDelete.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/IDownloadKey.d.ts +0 -0
- /package/dist/types/lib/http/data-fetcher/fetchers/{fecthAttach → AttachFetcher}/interfaces/index.d.ts +0 -0
@@ -15,14 +15,16 @@ import { IAppletCallerParams } from "./lib/applet-caller/applet-caller";
|
|
15
15
|
import { IClientEventResponse } from "./lib/http/data-fetcher/interfaces/IClientEventResponse";
|
16
16
|
import { IDataFetcherRecaller } from "./lib/http/data-fetcher/recaller/IDataFetcherRecaller";
|
17
17
|
import { DialogType, MessageOptions } from "@sankhyalabs/ezui/dist/collection/utils";
|
18
|
-
import { IOption, ISearchArgument } from "@sankhyalabs/ezui/dist/types/components/ez-
|
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";
|
@@ -43,6 +45,7 @@ import { FilterFieldsDataSource, IFilterField, IFilterLink } from "./components/
|
|
43
45
|
import { IEzPopoverAnchorOptions } from "@sankhyalabs/ezui/dist/types/components/ez-popover/ez-popover";
|
44
46
|
import { SnkFilterItemConfig as SnkFilterItemConfig1 } from "./components/snk-filter-bar/filter-item/snk-filter-item";
|
45
47
|
import { ListItem as ListItem1 } from "./components/snk-filter-bar/filter-list/snk-filter-list";
|
48
|
+
import { IOption as IOption1 } from "@sankhyalabs/ezui/dist/types/components/ez-combo-box/ez-combo-box";
|
46
49
|
import { IFormViewField } from "@sankhyalabs/ezui/dist/types/components/ez-form-view/interfaces/IFormViewField";
|
47
50
|
import { FormMetadata } from "@sankhyalabs/ezui/dist/collection/utils/form";
|
48
51
|
import { IMultiSelectionListDataSource } from "@sankhyalabs/ezui/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource";
|
@@ -253,6 +256,12 @@ export namespace Components {
|
|
253
256
|
* Salva a configuração de determinado recurso.
|
254
257
|
*/
|
255
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>;
|
256
265
|
/**
|
257
266
|
* Apresenta uma lista de alertas, geralmente é utilizado para apresentar resultados de processamentos em lote.
|
258
267
|
*/
|
@@ -294,10 +303,26 @@ export namespace Components {
|
|
294
303
|
"whenApplicationReady": () => Promise<SnkApplication>;
|
295
304
|
}
|
296
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;
|
297
314
|
/**
|
298
315
|
* Nome da entidade à ser utilizada para relacionar o anexo ao DataUnit pai.
|
299
316
|
*/
|
300
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;
|
301
326
|
/**
|
302
327
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
303
328
|
*/
|
@@ -709,6 +734,10 @@ export namespace Components {
|
|
709
734
|
* Recebe o DataUnit do ambiente. Se não for informado, procura pela referência do SnkDataUnit. Necessário para se registrar como provedor de filtros.
|
710
735
|
*/
|
711
736
|
"dataUnit": DataUnit;
|
737
|
+
/**
|
738
|
+
* Desabilita a apresentação da opção de filtros personalizados na filter bar (chip de filtros) e no modal lateral de filtros (container de filtros personalizados).
|
739
|
+
*/
|
740
|
+
"disablePersonalizedFilter": boolean;
|
712
741
|
/**
|
713
742
|
* Lista todos os filtros disponíveis ao usuário.
|
714
743
|
*/
|
@@ -725,6 +754,12 @@ export namespace Components {
|
|
725
754
|
* Faz o recarregamento da filterbar buscando o state no servidor.
|
726
755
|
*/
|
727
756
|
"reload": () => Promise<void>;
|
757
|
+
/**
|
758
|
+
* Remove um item de filtro.
|
759
|
+
* @param filterID - ID do a ser adicionado
|
760
|
+
* @returns - Retorna o item de filtro removido, ou undefined caso não encontrado.
|
761
|
+
*/
|
762
|
+
"removeFilterItem": (filterID: string) => Promise<SnkFilterItemConfig | undefined>;
|
728
763
|
/**
|
729
764
|
* Identificador de recursos como configurações e acesso.
|
730
765
|
*/
|
@@ -865,13 +900,25 @@ export namespace Components {
|
|
865
900
|
*/
|
866
901
|
"configName": string;
|
867
902
|
/**
|
868
|
-
* Ação executada ao
|
903
|
+
* Ação executada ao deletar um filtro personalizado
|
904
|
+
*/
|
905
|
+
"deletePersonalizedFilter": (filter: IPersonalizedFilter, configName: string) => void;
|
906
|
+
/**
|
907
|
+
* Desabilita a apresentação da opção de filtros personalizados na filter bar (chip de filtros) e no modal lateral de filtros (container de filtros personalizados).
|
908
|
+
*/
|
909
|
+
"disablePersonalizedFilter": boolean;
|
910
|
+
/**
|
911
|
+
* Ação executada ao editar um filtro personalizado
|
869
912
|
*/
|
870
913
|
"editPersonalizedFilter": (id:string) => void;
|
871
914
|
/**
|
872
915
|
* Filtros a serem apresentados
|
873
916
|
*/
|
874
917
|
"filters": Array<SnkFilterItemConfig>;
|
918
|
+
/**
|
919
|
+
* Guarda filtros a serem deletados no Apply do modal
|
920
|
+
*/
|
921
|
+
"filtersToDelete": IPersonalizedFilter[];
|
875
922
|
/**
|
876
923
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
877
924
|
*/
|
@@ -972,7 +1019,7 @@ export namespace Components {
|
|
972
1019
|
/**
|
973
1020
|
* Define o valor do componente snk-filter-search
|
974
1021
|
*/
|
975
|
-
"value":
|
1022
|
+
"value": IOption1;
|
976
1023
|
}
|
977
1024
|
interface SnkFilterText {
|
978
1025
|
/**
|
@@ -1317,7 +1364,7 @@ export namespace Components {
|
|
1317
1364
|
/**
|
1318
1365
|
* Controla o valor do componente.
|
1319
1366
|
*/
|
1320
|
-
"value": Array<
|
1367
|
+
"value": Array<IOption1|boolean|string|number|Date>;
|
1321
1368
|
}
|
1322
1369
|
interface SnkPesquisa {
|
1323
1370
|
/**
|
@@ -1331,7 +1378,7 @@ export namespace Components {
|
|
1331
1378
|
/**
|
1332
1379
|
* Função disparada ao selecionar um item.
|
1333
1380
|
*/
|
1334
|
-
"selectItem": (option:
|
1381
|
+
"selectItem": (option: IOption1) => void;
|
1335
1382
|
}
|
1336
1383
|
interface SnkPrintSelector {
|
1337
1384
|
"openPrintSelector": (printJobData: PendingPrintJobData) => Promise<PrintSelectorResponse>;
|
@@ -1340,7 +1387,7 @@ export namespace Components {
|
|
1340
1387
|
/**
|
1341
1388
|
* Determina a opção selecionada.
|
1342
1389
|
*/
|
1343
|
-
"selectedOption":
|
1390
|
+
"selectedOption": IOption1 | string;
|
1344
1391
|
}
|
1345
1392
|
interface SnkSimpleBar {
|
1346
1393
|
/**
|
@@ -1357,6 +1404,14 @@ export namespace Components {
|
|
1357
1404
|
"messagesBuilder": SnkMessageBuilder;
|
1358
1405
|
}
|
1359
1406
|
interface SnkSimpleCrud {
|
1407
|
+
/**
|
1408
|
+
* Ações a serem colocadas no botão "Mais opções" do componente snk-taskbar.
|
1409
|
+
*/
|
1410
|
+
"actionsList": Array<Action>;
|
1411
|
+
/**
|
1412
|
+
* Usado para salvar as configurações dos blocos de construção.
|
1413
|
+
*/
|
1414
|
+
"configName": string;
|
1360
1415
|
"dataState": DataState1;
|
1361
1416
|
"dataUnit": DataUnit;
|
1362
1417
|
"formConfig": IFormConfig;
|
@@ -2049,10 +2104,26 @@ declare namespace LocalJSX {
|
|
2049
2104
|
"onApplicationLoading"?: (event: SnkApplicationCustomEvent<boolean>) => void;
|
2050
2105
|
}
|
2051
2106
|
interface SnkAttach {
|
2107
|
+
/**
|
2108
|
+
* DataUnit responsável por carregar os dados.
|
2109
|
+
*/
|
2110
|
+
"dataUnit"?: DataUnit;
|
2111
|
+
/**
|
2112
|
+
* DataUnitBuilder responsável por implementar dados a serem utilizados no DataUnit.
|
2113
|
+
*/
|
2114
|
+
"dataUnitBuilder"?: FetcherFacade;
|
2052
2115
|
/**
|
2053
2116
|
* Nome da entidade à ser utilizada para relacionar o anexo ao DataUnit pai.
|
2054
2117
|
*/
|
2055
|
-
"entityName"
|
2118
|
+
"entityName"?: string;
|
2119
|
+
/**
|
2120
|
+
* Fetcher responsável por carregar os dados do DataUnit.
|
2121
|
+
*/
|
2122
|
+
"fetcher"?: AttachFetcherFacadeInterface;
|
2123
|
+
/**
|
2124
|
+
* FetcherType define o tipo de fetcher responsável por carregar os dados do DataUnit.
|
2125
|
+
*/
|
2126
|
+
"fetcherType"?: TFetcherType;
|
2056
2127
|
/**
|
2057
2128
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
2058
2129
|
*/
|
@@ -2509,6 +2580,10 @@ declare namespace LocalJSX {
|
|
2509
2580
|
* Recebe o DataUnit do ambiente. Se não for informado, procura pela referência do SnkDataUnit. Necessário para se registrar como provedor de filtros.
|
2510
2581
|
*/
|
2511
2582
|
"dataUnit"?: DataUnit;
|
2583
|
+
/**
|
2584
|
+
* Desabilita a apresentação da opção de filtros personalizados na filter bar (chip de filtros) e no modal lateral de filtros (container de filtros personalizados).
|
2585
|
+
*/
|
2586
|
+
"disablePersonalizedFilter"?: boolean;
|
2512
2587
|
/**
|
2513
2588
|
* Lista todos os filtros disponíveis ao usuário.
|
2514
2589
|
*/
|
@@ -2650,13 +2725,25 @@ declare namespace LocalJSX {
|
|
2650
2725
|
*/
|
2651
2726
|
"configName"?: string;
|
2652
2727
|
/**
|
2653
|
-
* Ação executada ao
|
2728
|
+
* Ação executada ao deletar um filtro personalizado
|
2729
|
+
*/
|
2730
|
+
"deletePersonalizedFilter"?: (filter: IPersonalizedFilter, configName: string) => void;
|
2731
|
+
/**
|
2732
|
+
* Desabilita a apresentação da opção de filtros personalizados na filter bar (chip de filtros) e no modal lateral de filtros (container de filtros personalizados).
|
2733
|
+
*/
|
2734
|
+
"disablePersonalizedFilter"?: boolean;
|
2735
|
+
/**
|
2736
|
+
* Ação executada ao editar um filtro personalizado
|
2654
2737
|
*/
|
2655
2738
|
"editPersonalizedFilter"?: (id:string) => void;
|
2656
2739
|
/**
|
2657
2740
|
* Filtros a serem apresentados
|
2658
2741
|
*/
|
2659
2742
|
"filters"?: Array<SnkFilterItemConfig>;
|
2743
|
+
/**
|
2744
|
+
* Guarda filtros a serem deletados no Apply do modal
|
2745
|
+
*/
|
2746
|
+
"filtersToDelete"?: IPersonalizedFilter[];
|
2660
2747
|
/**
|
2661
2748
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
2662
2749
|
*/
|
@@ -2752,7 +2839,7 @@ declare namespace LocalJSX {
|
|
2752
2839
|
/**
|
2753
2840
|
* Define o valor do componente snk-filter-search
|
2754
2841
|
*/
|
2755
|
-
"value"?:
|
2842
|
+
"value"?: IOption1;
|
2756
2843
|
}
|
2757
2844
|
interface SnkFilterText {
|
2758
2845
|
/**
|
@@ -3124,7 +3211,7 @@ declare namespace LocalJSX {
|
|
3124
3211
|
/**
|
3125
3212
|
* Controla o valor do componente.
|
3126
3213
|
*/
|
3127
|
-
"value"?: Array<
|
3214
|
+
"value"?: Array<IOption1|boolean|string|number|Date>;
|
3128
3215
|
}
|
3129
3216
|
interface SnkPesquisa {
|
3130
3217
|
/**
|
@@ -3138,7 +3225,7 @@ declare namespace LocalJSX {
|
|
3138
3225
|
/**
|
3139
3226
|
* Função disparada ao selecionar um item.
|
3140
3227
|
*/
|
3141
|
-
"selectItem"?: (option:
|
3228
|
+
"selectItem"?: (option: IOption1) => void;
|
3142
3229
|
}
|
3143
3230
|
interface SnkPrintSelector {
|
3144
3231
|
}
|
@@ -3150,7 +3237,7 @@ declare namespace LocalJSX {
|
|
3150
3237
|
/**
|
3151
3238
|
* Determina a opção selecionada.
|
3152
3239
|
*/
|
3153
|
-
"selectedOption"?:
|
3240
|
+
"selectedOption"?: IOption1 | string;
|
3154
3241
|
}
|
3155
3242
|
interface SnkSimpleBar {
|
3156
3243
|
/**
|
@@ -3175,6 +3262,14 @@ declare namespace LocalJSX {
|
|
3175
3262
|
"onExit"?: (event: SnkSimpleBarCustomEvent<void>) => void;
|
3176
3263
|
}
|
3177
3264
|
interface SnkSimpleCrud {
|
3265
|
+
/**
|
3266
|
+
* Ações a serem colocadas no botão "Mais opções" do componente snk-taskbar.
|
3267
|
+
*/
|
3268
|
+
"actionsList"?: Array<Action>;
|
3269
|
+
/**
|
3270
|
+
* Usado para salvar as configurações dos blocos de construção.
|
3271
|
+
*/
|
3272
|
+
"configName"?: string;
|
3178
3273
|
"dataState"?: DataState1;
|
3179
3274
|
"dataUnit"?: DataUnit;
|
3180
3275
|
"formConfig"?: IFormConfig;
|
@@ -21,5 +21,9 @@ export declare class ConfigStorage {
|
|
21
21
|
static savePersonalizedFilter(personalizedFilter: IPersonalizedFilter, resourceID: string, configName?: string): Promise<IPersonalizedFilter>;
|
22
22
|
static removePersonalizedFilter(personalizedFilter: IPersonalizedFilter, resourceID: string, configName?: string): Promise<IPersonalizedFilter>;
|
23
23
|
static validatePersonalizedFilter(dataUnitName: string, expression: string): Promise<IValidateFilter>;
|
24
|
+
static deleteGridConfigCache(name: string, resourceID: string): Promise<void>;
|
25
|
+
static deleteFormConfigCache(name: string, resourceID: string): Promise<void>;
|
26
|
+
static deleteFilterBarConfigCache(name: string, resourceID: string): Promise<void>;
|
27
|
+
private static deleteConfigCache;
|
24
28
|
private static buildCacheID;
|
25
29
|
}
|
@@ -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,8 @@ 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;
|
14
|
+
private getUpdatingFields;
|
13
15
|
private saveData;
|
14
16
|
private updateCache;
|
15
17
|
private getTransientInfo;
|
package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts
CHANGED
@@ -1,13 +1,16 @@
|
|
1
|
-
import { DataUnit, LoadDataRequest } from
|
1
|
+
import { DataUnit, LoadDataRequest } from '@sankhyalabs/core';
|
2
2
|
import { ILoadDataResult } from "../interfaces/ILoadDataResult";
|
3
3
|
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;
|
10
|
+
private getStandAloneFieldsList;
|
9
11
|
private getFieldNames;
|
10
12
|
private buildRequestBody;
|
13
|
+
private getModuleName;
|
11
14
|
private getTxProperties;
|
12
15
|
private processRecords;
|
13
16
|
private buildFieldValue;
|
@@ -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": "8.15.0-dev.
|
3
|
+
"version": "8.15.0-dev.20",
|
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.
|
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,11 +58,19 @@
|
|
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
|
},
|
63
65
|
"jest": {
|
64
|
-
"verbose": true
|
66
|
+
"verbose": true,
|
67
|
+
"testResultsProcessor": "jest-sonar-reporter"
|
68
|
+
},
|
69
|
+
"jestSonar": {
|
70
|
+
"sonar56x": true,
|
71
|
+
"reportPath": "reports",
|
72
|
+
"reportFile": "test-report.xml",
|
73
|
+
"indent": 4
|
65
74
|
},
|
66
75
|
"peerDependencies": {
|
67
76
|
"@sankhyalabs/core": "^5.0.0",
|
@@ -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;
|