@sankhyalabs/sankhyablocks 5.4.2 → 5.5.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/{SnkMessageBuilder-115e8a80.js → SnkMessageBuilder-26da04f7.js} +35 -1
- package/dist/cjs/{constants-ae0ed870.js → constants-3787fa32.js} +1 -0
- package/dist/cjs/dataunit-fetcher-8f5ade55.js +319 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +3 -315
- package/dist/cjs/snk-attach.cjs.entry.js +449 -0
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +22 -13
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-aa613f3b.js → snk-data-unit-c43df27b.js} +4 -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-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +11 -4
- package/dist/cjs/{snk-guides-viewer-7db960c2.js → snk-guides-viewer-e6a65393.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -4
- package/dist/cjs/snk-select-box.cjs.entry.js +1 -1
- package/dist/cjs/{snk-simple-crud.cjs.entry.js → snk-simple-bar_2.cjs.entry.js} +47 -5
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +5 -4
- package/dist/cjs/taskbar-elements-80285601.js +313 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/snk-attach/interfaces/index.js +1 -0
- package/dist/collection/components/snk-attach/snk-attach.css +8 -0
- package/dist/collection/components/snk-attach/snk-attach.js +202 -0
- package/dist/collection/components/snk-attach/structure/crud-config-builder.js +37 -0
- package/dist/collection/components/snk-attach/structure/data-unit-builder.js +106 -0
- package/dist/collection/components/snk-attach/structure/index.js +3 -0
- package/dist/collection/components/snk-attach/structure/taskbar-builder.js +47 -0
- package/dist/collection/components/snk-configurator/snk-configurator.js +3 -3
- package/dist/collection/components/snk-crud/snk-crud.js +22 -11
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.js +11 -3
- package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +37 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +65 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +4 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/attach-fetcher.js +136 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/ISave.js +6 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/index.js +3 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +5 -1
- package/dist/collection/lib/message/resources/snk-attach.msg.js +27 -0
- package/dist/collection/lib/message/resources/snk-simple-bar.msg.js +3 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -0
- package/dist/collection/lib/utils/constants.js +1 -0
- package/dist/components/SnkMessageBuilder.js +35 -1
- package/dist/components/constants.js +1 -0
- package/dist/components/dataunit-fetcher.js +317 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-application2.js +2 -314
- package/dist/components/snk-attach.d.ts +11 -0
- package/dist/components/snk-attach.js +6 -0
- package/dist/components/snk-attach2.js +498 -0
- package/dist/components/snk-crud.js +77 -48
- package/dist/components/snk-data-unit2.js +4 -0
- package/dist/components/snk-filter-bar2.js +1 -1
- package/dist/components/snk-grid2.js +11 -4
- package/dist/components/snk-simple-bar.js +1 -41
- package/dist/components/snk-simple-bar2.js +59 -0
- package/dist/components/snk-simple-crud.js +1 -328
- package/dist/{esm/snk-simple-crud.entry.js → components/snk-simple-crud2.js} +73 -18
- package/dist/components/snk-taskbar2.js +7 -2
- package/dist/esm/{SnkMessageBuilder-a15d22f8.js → SnkMessageBuilder-7a9392e6.js} +35 -1
- package/dist/esm/{constants-15617e7d.js → constants-e916ccc3.js} +1 -0
- package/dist/esm/dataunit-fetcher-d32c6a47.js +317 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +3 -315
- package/dist/esm/snk-attach.entry.js +445 -0
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +23 -14
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-5ed93c0e.js → snk-data-unit-f9e4c694.js} +4 -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-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-grid-config.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +11 -4
- package/dist/esm/{snk-guides-viewer-1e7c21f6.js → snk-guides-viewer-62a9f74d.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +3 -4
- package/dist/esm/snk-select-box.entry.js +1 -1
- package/dist/esm/snk-simple-bar_2.entry.js +324 -0
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +5 -4
- package/dist/esm/taskbar-elements-055ba1ad.js +309 -0
- package/dist/sankhyablocks/p-17375123.js +1 -0
- package/dist/sankhyablocks/{p-b80cf644.entry.js → p-1c0ee011.entry.js} +1 -1
- package/dist/sankhyablocks/p-4512cc6c.entry.js +1 -0
- package/dist/sankhyablocks/p-5cbbe1f7.entry.js +1 -0
- package/dist/sankhyablocks/p-63d01871.entry.js +1 -0
- package/dist/sankhyablocks/{p-0a1e7f75.entry.js → p-6ac29569.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f4d36823.entry.js → p-6f0b3cc0.entry.js} +1 -1
- package/dist/sankhyablocks/p-741b00ef.entry.js +1 -0
- package/dist/sankhyablocks/{p-6516f35a.entry.js → p-86f75e7a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-32599159.entry.js → p-8b02b276.entry.js} +1 -1
- package/dist/sankhyablocks/p-92a0fca4.js +1 -0
- package/dist/sankhyablocks/p-999d1953.entry.js +1 -0
- package/dist/sankhyablocks/{p-9bfa3cfb.entry.js → p-a412992c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-703dddb9.js → p-aeffd219.js} +1 -1
- package/dist/sankhyablocks/p-b2523981.entry.js +11 -0
- package/dist/sankhyablocks/p-c3efd4eb.entry.js +1 -0
- package/dist/sankhyablocks/{p-3169584f.entry.js → p-e0b4aec3.entry.js} +1 -1
- package/dist/sankhyablocks/p-ebe876f5.entry.js +1 -0
- package/dist/sankhyablocks/p-ed438690.js +1 -0
- package/dist/sankhyablocks/p-f2223502.js +1 -0
- package/dist/sankhyablocks/p-f3d0c744.entry.js +1 -0
- package/dist/sankhyablocks/p-f821768b.js +74 -0
- package/dist/sankhyablocks/{p-f29caa0a.entry.js → p-f8c66aa3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-adf50831.entry.js → p-fac37198.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-attach/interfaces/index.d.ts +10 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +45 -0
- package/dist/types/components/snk-attach/structure/crud-config-builder.d.ts +7 -0
- package/dist/types/components/snk-attach/structure/data-unit-builder.d.ts +16 -0
- package/dist/types/components/snk-attach/structure/index.d.ts +3 -0
- package/dist/types/components/snk-attach/structure/taskbar-builder.d.ts +8 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +5 -0
- package/dist/types/components/snk-simple-bar/snk-simple-bar.d.ts +14 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +2 -1
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
- package/dist/types/components.d.ts +67 -0
- package/dist/types/global.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +8 -2
- package/dist/types/lib/http/data-fetcher/fetchers/attach-fetcher.d.ts +14 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDelete.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/IDownloadKey.d.ts +13 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/ISave.d.ts +26 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fecthAttach/interfaces/index.d.ts +3 -0
- package/dist/types/lib/message/resources/snk-attach.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-simple-bar.msg.d.ts +1 -0
- package/dist/types/lib/utils/constants.d.ts +2 -1
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/index-fc7ca86c.js +0 -200
- package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -30
- package/dist/cjs/taskbar-elements-5e87cf44.js +0 -115
- package/dist/esm/index-e467ade5.js +0 -198
- package/dist/esm/snk-simple-bar.entry.js +0 -26
- package/dist/esm/taskbar-elements-10d80c79.js +0 -112
- package/dist/sankhyablocks/p-1393dc00.entry.js +0 -1
- package/dist/sankhyablocks/p-1c17eecf.entry.js +0 -1
- package/dist/sankhyablocks/p-2ecf14ff.js +0 -1
- package/dist/sankhyablocks/p-340d6fb0.entry.js +0 -84
- package/dist/sankhyablocks/p-74724fa7.js +0 -1
- package/dist/sankhyablocks/p-79f01b63.entry.js +0 -1
- package/dist/sankhyablocks/p-81e85890.entry.js +0 -1
- package/dist/sankhyablocks/p-94e6fc90.entry.js +0 -1
- package/dist/sankhyablocks/p-98f7f796.js +0 -1
- package/dist/sankhyablocks/p-b3e71248.entry.js +0 -1
- package/dist/sankhyablocks/p-bc281de0.js +0 -1
- package/dist/sankhyablocks/p-d61759a5.entry.js +0 -1
- package/dist/sankhyablocks/p-d65809d5.entry.js +0 -1
- package/dist/sankhyablocks/p-f587a454.js +0 -1
- package/dist/types/components/snk-application/snk-application.d.ts +0 -259
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -73
- package/dist/types/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.d.ts +0 -40
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +0 -27
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +0 -23
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +0 -23
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +0 -29
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +0 -25
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +0 -19
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -38
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +0 -74
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +0 -53
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -95
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -59
@@ -216,6 +216,20 @@ export namespace Components {
|
|
216
216
|
*/
|
217
217
|
"webConnection": (keyPort: string, methodName: string, params: IAppletCallerParams) => Promise<void>;
|
218
218
|
}
|
219
|
+
interface SnkAttach {
|
220
|
+
/**
|
221
|
+
* Nome da entidade à ser utilizada para relacionar o anexo ao DataUnit pai.
|
222
|
+
*/
|
223
|
+
"entityName": string;
|
224
|
+
/**
|
225
|
+
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
226
|
+
*/
|
227
|
+
"messagesBuilder": SnkMessageBuilder;
|
228
|
+
/**
|
229
|
+
* Identificação do registro pai.
|
230
|
+
*/
|
231
|
+
"registerKey": string;
|
232
|
+
}
|
219
233
|
interface SnkConfigOptions {
|
220
234
|
/**
|
221
235
|
* Repositório de dados responsável por controlar a manipulação dos dados.
|
@@ -346,6 +360,10 @@ export namespace Components {
|
|
346
360
|
* Determina quantas linhas são retornadas por página.
|
347
361
|
*/
|
348
362
|
"pageSize": number;
|
363
|
+
/**
|
364
|
+
* Determina se será usado mensagem de confirmação padrão na tentativa de cancelar a edição.
|
365
|
+
*/
|
366
|
+
"useCancelConfirm": boolean;
|
349
367
|
}
|
350
368
|
interface SnkDetailView {
|
351
369
|
"branchGuide": IGuideItem;
|
@@ -913,15 +931,21 @@ export namespace Components {
|
|
913
931
|
* Define o título do header
|
914
932
|
*/
|
915
933
|
"label": string;
|
934
|
+
/**
|
935
|
+
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
936
|
+
*/
|
937
|
+
"messagesBuilder": SnkMessageBuilder;
|
916
938
|
}
|
917
939
|
interface SnkSimpleCrud {
|
918
940
|
"dataState": DataState1;
|
919
941
|
"dataUnit": DataUnit;
|
942
|
+
"formConfig": IFormConfig;
|
920
943
|
"getRecords": () => Promise<Array<Record>>;
|
921
944
|
/**
|
922
945
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
923
946
|
*/
|
924
947
|
"goToView": (view: VIEW_MODE) => Promise<void>;
|
948
|
+
"gridConfig": IGridConfig;
|
925
949
|
/**
|
926
950
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
927
951
|
*/
|
@@ -933,6 +957,7 @@ export namespace Components {
|
|
933
957
|
* Gerenciador das barras de tarefas. É possível determinar botões específicos ou mesmo gerenciar o estado dos botões.
|
934
958
|
*/
|
935
959
|
"taskbarManager": TaskbarManager;
|
960
|
+
"useCancelConfirm": boolean;
|
936
961
|
}
|
937
962
|
interface SnkTabConfig {
|
938
963
|
/**
|
@@ -997,6 +1022,10 @@ export interface SnkApplicationCustomEvent<T> extends CustomEvent<T> {
|
|
997
1022
|
detail: T;
|
998
1023
|
target: HTMLSnkApplicationElement;
|
999
1024
|
}
|
1025
|
+
export interface SnkAttachCustomEvent<T> extends CustomEvent<T> {
|
1026
|
+
detail: T;
|
1027
|
+
target: HTMLSnkAttachElement;
|
1028
|
+
}
|
1000
1029
|
export interface SnkConfigOptionsCustomEvent<T> extends CustomEvent<T> {
|
1001
1030
|
detail: T;
|
1002
1031
|
target: HTMLSnkConfigOptionsElement;
|
@@ -1088,6 +1117,12 @@ declare global {
|
|
1088
1117
|
prototype: HTMLSnkApplicationElement;
|
1089
1118
|
new (): HTMLSnkApplicationElement;
|
1090
1119
|
};
|
1120
|
+
interface HTMLSnkAttachElement extends Components.SnkAttach, HTMLStencilElement {
|
1121
|
+
}
|
1122
|
+
var HTMLSnkAttachElement: {
|
1123
|
+
prototype: HTMLSnkAttachElement;
|
1124
|
+
new (): HTMLSnkAttachElement;
|
1125
|
+
};
|
1091
1126
|
interface HTMLSnkConfigOptionsElement extends Components.SnkConfigOptions, HTMLStencilElement {
|
1092
1127
|
}
|
1093
1128
|
var HTMLSnkConfigOptionsElement: {
|
@@ -1306,6 +1341,7 @@ declare global {
|
|
1306
1341
|
};
|
1307
1342
|
interface HTMLElementTagNameMap {
|
1308
1343
|
"snk-application": HTMLSnkApplicationElement;
|
1344
|
+
"snk-attach": HTMLSnkAttachElement;
|
1309
1345
|
"snk-config-options": HTMLSnkConfigOptionsElement;
|
1310
1346
|
"snk-configurator": HTMLSnkConfiguratorElement;
|
1311
1347
|
"snk-crud": HTMLSnkCrudElement;
|
@@ -1360,6 +1396,24 @@ declare namespace LocalJSX {
|
|
1360
1396
|
*/
|
1361
1397
|
"onApplicationLoading"?: (event: SnkApplicationCustomEvent<boolean>) => void;
|
1362
1398
|
}
|
1399
|
+
interface SnkAttach {
|
1400
|
+
/**
|
1401
|
+
* Nome da entidade à ser utilizada para relacionar o anexo ao DataUnit pai.
|
1402
|
+
*/
|
1403
|
+
"entityName": string;
|
1404
|
+
/**
|
1405
|
+
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
1406
|
+
*/
|
1407
|
+
"messagesBuilder"?: SnkMessageBuilder;
|
1408
|
+
/**
|
1409
|
+
* Evento disparado quando o usuário clica no botão voltar.
|
1410
|
+
*/
|
1411
|
+
"onBack"?: (event: SnkAttachCustomEvent<void>) => void;
|
1412
|
+
/**
|
1413
|
+
* Identificação do registro pai.
|
1414
|
+
*/
|
1415
|
+
"registerKey": string;
|
1416
|
+
}
|
1363
1417
|
interface SnkConfigOptions {
|
1364
1418
|
/**
|
1365
1419
|
* Repositório de dados responsável por controlar a manipulação dos dados.
|
@@ -1505,6 +1559,10 @@ declare namespace LocalJSX {
|
|
1505
1559
|
* Determina quantas linhas são retornadas por página.
|
1506
1560
|
*/
|
1507
1561
|
"pageSize"?: number;
|
1562
|
+
/**
|
1563
|
+
* Determina se será usado mensagem de confirmação padrão na tentativa de cancelar a edição.
|
1564
|
+
*/
|
1565
|
+
"useCancelConfirm"?: boolean;
|
1508
1566
|
}
|
1509
1567
|
interface SnkDetailView {
|
1510
1568
|
"branchGuide"?: IGuideItem;
|
@@ -2059,6 +2117,10 @@ declare namespace LocalJSX {
|
|
2059
2117
|
* Define o título do header
|
2060
2118
|
*/
|
2061
2119
|
"label"?: string;
|
2120
|
+
/**
|
2121
|
+
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
2122
|
+
*/
|
2123
|
+
"messagesBuilder"?: SnkMessageBuilder;
|
2062
2124
|
/**
|
2063
2125
|
* Emitido quando algum item do breadcrumb é clicado
|
2064
2126
|
*/
|
@@ -2071,6 +2133,8 @@ declare namespace LocalJSX {
|
|
2071
2133
|
interface SnkSimpleCrud {
|
2072
2134
|
"dataState"?: DataState1;
|
2073
2135
|
"dataUnit"?: DataUnit;
|
2136
|
+
"formConfig"?: IFormConfig;
|
2137
|
+
"gridConfig"?: IGridConfig;
|
2074
2138
|
/**
|
2075
2139
|
* Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
2076
2140
|
*/
|
@@ -2088,6 +2152,7 @@ declare namespace LocalJSX {
|
|
2088
2152
|
* Gerenciador das barras de tarefas. É possível determinar botões específicos ou mesmo gerenciar o estado dos botões.
|
2089
2153
|
*/
|
2090
2154
|
"taskbarManager"?: TaskbarManager;
|
2155
|
+
"useCancelConfirm"?: boolean;
|
2091
2156
|
}
|
2092
2157
|
interface SnkTabConfig {
|
2093
2158
|
/**
|
@@ -2177,6 +2242,7 @@ declare namespace LocalJSX {
|
|
2177
2242
|
}
|
2178
2243
|
interface IntrinsicElements {
|
2179
2244
|
"snk-application": SnkApplication;
|
2245
|
+
"snk-attach": SnkAttach;
|
2180
2246
|
"snk-config-options": SnkConfigOptions;
|
2181
2247
|
"snk-configurator": SnkConfigurator;
|
2182
2248
|
"snk-crud": SnkCrud;
|
@@ -2220,6 +2286,7 @@ declare module "@stencil/core" {
|
|
2220
2286
|
export namespace JSX {
|
2221
2287
|
interface IntrinsicElements {
|
2222
2288
|
"snk-application": LocalJSX.SnkApplication & JSXBase.HTMLAttributes<HTMLSnkApplicationElement>;
|
2289
|
+
"snk-attach": LocalJSX.SnkAttach & JSXBase.HTMLAttributes<HTMLSnkAttachElement>;
|
2223
2290
|
"snk-config-options": LocalJSX.SnkConfigOptions & JSXBase.HTMLAttributes<HTMLSnkConfigOptionsElement>;
|
2224
2291
|
"snk-configurator": LocalJSX.SnkConfigurator & JSXBase.HTMLAttributes<HTMLSnkConfiguratorElement>;
|
2225
2292
|
"snk-crud": LocalJSX.SnkCrud & JSXBase.HTMLAttributes<HTMLSnkCrudElement>;
|
@@ -42,10 +42,10 @@ export interface RequestListenerParams {
|
|
42
42
|
url: string;
|
43
43
|
requestBody?: any;
|
44
44
|
}
|
45
|
-
export interface ServiceBrokerResponse {
|
45
|
+
export interface ServiceBrokerResponse<T = Object> {
|
46
46
|
pendingPrinting: string;
|
47
47
|
status: number;
|
48
|
-
responseBody?:
|
48
|
+
responseBody?: T;
|
49
49
|
serviceName: string;
|
50
50
|
clientEvents?: Array<{
|
51
51
|
id: string;
|
@@ -57,3 +57,9 @@ export interface ServiceBrokerResponse {
|
|
57
57
|
tsErrorLevel: "ERROR" | "WARNING";
|
58
58
|
};
|
59
59
|
}
|
60
|
+
export interface ServiceBrokerPayload<T = Object> {
|
61
|
+
serviceName: string;
|
62
|
+
requestBody: {
|
63
|
+
[key: string]: T;
|
64
|
+
};
|
65
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Change, Record } from "@sankhyalabs/core";
|
2
|
+
import { SaveResponse, DeleteResponse, DownloadKeyResponse } from "./fecthAttach/interfaces";
|
3
|
+
export declare class AttachFetcher {
|
4
|
+
private entityName;
|
5
|
+
private registerKey;
|
6
|
+
private dataUnitName;
|
7
|
+
private resourceID;
|
8
|
+
constructor(entityName: string, registerKey: string, dataUnitName: string);
|
9
|
+
validateFields: (fields: any) => void;
|
10
|
+
save(change: Change): Promise<Array<SaveResponse>>;
|
11
|
+
edit(change: Change): Promise<Array<SaveResponse>>;
|
12
|
+
delete(record: Record): Promise<DeleteResponse>;
|
13
|
+
getDownloadKey(record: Record): Promise<DownloadKeyResponse>;
|
14
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ServiceBrokerPayload } from "../../../DataFetcher";
|
2
|
+
export type DownloadKeyPayload = ServiceBrokerPayload<{
|
3
|
+
nameAttach: string;
|
4
|
+
nameEntity: string;
|
5
|
+
nuAttach: string;
|
6
|
+
pkEntity: string;
|
7
|
+
keyAttach: string;
|
8
|
+
}>;
|
9
|
+
export type DownloadKeyResponse = {
|
10
|
+
chave: {
|
11
|
+
valor: string;
|
12
|
+
};
|
13
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { SavedRecord } from "@sankhyalabs/core";
|
2
|
+
import { ServiceBrokerPayload } from "../../../DataFetcher";
|
3
|
+
export type SavePayload = ServiceBrokerPayload<{
|
4
|
+
resourceID: string;
|
5
|
+
nuAttach?: string;
|
6
|
+
description: string;
|
7
|
+
fileSelect: number;
|
8
|
+
keySession?: string;
|
9
|
+
keyAttach?: string;
|
10
|
+
nameAttach?: string;
|
11
|
+
link?: string;
|
12
|
+
nameEntity: string;
|
13
|
+
pkEntity: string;
|
14
|
+
typeAcess: string;
|
15
|
+
typeApres: string;
|
16
|
+
}>;
|
17
|
+
export type SaveResponse = {
|
18
|
+
chave: {
|
19
|
+
valor: string;
|
20
|
+
};
|
21
|
+
} & SavedRecord;
|
22
|
+
export declare enum SaveErrorsEnum {
|
23
|
+
LINK_AND_FILE_AT_THE_SAME_TIME = "LINK_AND_FILE_AT_THE_SAME_TIME",
|
24
|
+
ANY_LINK_OR_FILE_FILLED = "ANY_LINK_OR_FILE_FILLED",
|
25
|
+
UNKNOWN = "UNKNOWN"
|
26
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const snkSimpleBarMessages: Object;
|
package/package.json
CHANGED
package/react/components.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { JSX } from '@sankhyalabs/sankhyablocks';
|
3
3
|
export declare const SnkApplication: import("react").ForwardRefExoticComponent<JSX.SnkApplication & Omit<import("react").HTMLAttributes<HTMLSnkApplicationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkApplicationElement>>;
|
4
|
+
export declare const SnkAttach: import("react").ForwardRefExoticComponent<JSX.SnkAttach & Omit<import("react").HTMLAttributes<HTMLSnkAttachElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkAttachElement>>;
|
4
5
|
export declare const SnkConfigOptions: import("react").ForwardRefExoticComponent<JSX.SnkConfigOptions & Omit<import("react").HTMLAttributes<HTMLSnkConfigOptionsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkConfigOptionsElement>>;
|
5
6
|
export declare const SnkConfigurator: import("react").ForwardRefExoticComponent<JSX.SnkConfigurator & Omit<import("react").HTMLAttributes<HTMLSnkConfiguratorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkConfiguratorElement>>;
|
6
7
|
export declare const SnkCrud: import("react").ForwardRefExoticComponent<JSX.SnkCrud & Omit<import("react").HTMLAttributes<HTMLSnkCrudElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkCrudElement>>;
|
package/react/components.js
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
/* auto-generated react proxies */
|
4
4
|
import { createReactComponent } from './react-component-lib';
|
5
5
|
export const SnkApplication = /*@__PURE__*/ createReactComponent('snk-application');
|
6
|
+
export const SnkAttach = /*@__PURE__*/ createReactComponent('snk-attach');
|
6
7
|
export const SnkConfigOptions = /*@__PURE__*/ createReactComponent('snk-config-options');
|
7
8
|
export const SnkConfigurator = /*@__PURE__*/ createReactComponent('snk-configurator');
|
8
9
|
export const SnkCrud = /*@__PURE__*/ createReactComponent('snk-crud');
|
package/react/components.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB,kCAAkC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CA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AA4C,gBAAgB,CAAC,CAAC;AAC3H,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA,oBAAoB,CAA8C,iBAAiB,CAAC,CAAC;AAC/H,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,gBAAgB,CAAC,CAAC;AAC3H,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAA,oBAAoB,CAAwC,aAAa,CAAC,CAAC;AAClH,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC"}
|
@@ -1,200 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const index = require('./index-21bd01e1.js');
|
4
|
-
|
5
|
-
const appendToMap = (map, propName, value) => {
|
6
|
-
const items = map.get(propName);
|
7
|
-
if (!items) {
|
8
|
-
map.set(propName, [value]);
|
9
|
-
}
|
10
|
-
else if (!items.includes(value)) {
|
11
|
-
items.push(value);
|
12
|
-
}
|
13
|
-
};
|
14
|
-
const debounce = (fn, ms) => {
|
15
|
-
let timeoutId;
|
16
|
-
return (...args) => {
|
17
|
-
if (timeoutId) {
|
18
|
-
clearTimeout(timeoutId);
|
19
|
-
}
|
20
|
-
timeoutId = setTimeout(() => {
|
21
|
-
timeoutId = 0;
|
22
|
-
fn(...args);
|
23
|
-
}, ms);
|
24
|
-
};
|
25
|
-
};
|
26
|
-
|
27
|
-
/**
|
28
|
-
* Check if a possible element isConnected.
|
29
|
-
* The property might not be there, so we check for it.
|
30
|
-
*
|
31
|
-
* We want it to return true if isConnected is not a property,
|
32
|
-
* otherwise we would remove these elements and would not update.
|
33
|
-
*
|
34
|
-
* Better leak in Edge than to be useless.
|
35
|
-
*/
|
36
|
-
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
37
|
-
const cleanupElements = debounce((map) => {
|
38
|
-
for (let key of map.keys()) {
|
39
|
-
map.set(key, map.get(key).filter(isConnected));
|
40
|
-
}
|
41
|
-
}, 2000);
|
42
|
-
const stencilSubscription = () => {
|
43
|
-
if (typeof index.getRenderingRef !== 'function') {
|
44
|
-
// If we are not in a stencil project, we do nothing.
|
45
|
-
// This function is not really exported by @stencil/core.
|
46
|
-
return {};
|
47
|
-
}
|
48
|
-
const elmsToUpdate = new Map();
|
49
|
-
return {
|
50
|
-
dispose: () => elmsToUpdate.clear(),
|
51
|
-
get: (propName) => {
|
52
|
-
const elm = index.getRenderingRef();
|
53
|
-
if (elm) {
|
54
|
-
appendToMap(elmsToUpdate, propName, elm);
|
55
|
-
}
|
56
|
-
},
|
57
|
-
set: (propName) => {
|
58
|
-
const elements = elmsToUpdate.get(propName);
|
59
|
-
if (elements) {
|
60
|
-
elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
|
61
|
-
}
|
62
|
-
cleanupElements(elmsToUpdate);
|
63
|
-
},
|
64
|
-
reset: () => {
|
65
|
-
elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
|
66
|
-
cleanupElements(elmsToUpdate);
|
67
|
-
},
|
68
|
-
};
|
69
|
-
};
|
70
|
-
|
71
|
-
const unwrap = (val) => (typeof val === 'function' ? val() : val);
|
72
|
-
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
73
|
-
const unwrappedState = unwrap(defaultState);
|
74
|
-
let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
|
75
|
-
const handlers = {
|
76
|
-
dispose: [],
|
77
|
-
get: [],
|
78
|
-
set: [],
|
79
|
-
reset: [],
|
80
|
-
};
|
81
|
-
const reset = () => {
|
82
|
-
var _a;
|
83
|
-
// When resetting the state, the default state may be a function - unwrap it to invoke it.
|
84
|
-
// otherwise, the state won't be properly reset
|
85
|
-
states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
|
86
|
-
handlers.reset.forEach((cb) => cb());
|
87
|
-
};
|
88
|
-
const dispose = () => {
|
89
|
-
// Call first dispose as resetting the state would
|
90
|
-
// cause less updates ;)
|
91
|
-
handlers.dispose.forEach((cb) => cb());
|
92
|
-
reset();
|
93
|
-
};
|
94
|
-
const get = (propName) => {
|
95
|
-
handlers.get.forEach((cb) => cb(propName));
|
96
|
-
return states.get(propName);
|
97
|
-
};
|
98
|
-
const set = (propName, value) => {
|
99
|
-
const oldValue = states.get(propName);
|
100
|
-
if (shouldUpdate(value, oldValue, propName)) {
|
101
|
-
states.set(propName, value);
|
102
|
-
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
103
|
-
}
|
104
|
-
};
|
105
|
-
const state = (typeof Proxy === 'undefined'
|
106
|
-
? {}
|
107
|
-
: new Proxy(unwrappedState, {
|
108
|
-
get(_, propName) {
|
109
|
-
return get(propName);
|
110
|
-
},
|
111
|
-
ownKeys(_) {
|
112
|
-
return Array.from(states.keys());
|
113
|
-
},
|
114
|
-
getOwnPropertyDescriptor() {
|
115
|
-
return {
|
116
|
-
enumerable: true,
|
117
|
-
configurable: true,
|
118
|
-
};
|
119
|
-
},
|
120
|
-
has(_, propName) {
|
121
|
-
return states.has(propName);
|
122
|
-
},
|
123
|
-
set(_, propName, value) {
|
124
|
-
set(propName, value);
|
125
|
-
return true;
|
126
|
-
},
|
127
|
-
}));
|
128
|
-
const on = (eventName, callback) => {
|
129
|
-
handlers[eventName].push(callback);
|
130
|
-
return () => {
|
131
|
-
removeFromArray(handlers[eventName], callback);
|
132
|
-
};
|
133
|
-
};
|
134
|
-
const onChange = (propName, cb) => {
|
135
|
-
const unSet = on('set', (key, newValue) => {
|
136
|
-
if (key === propName) {
|
137
|
-
cb(newValue);
|
138
|
-
}
|
139
|
-
});
|
140
|
-
// We need to unwrap the defaultState because it might be a function.
|
141
|
-
// Otherwise we might not be sending the right reset value.
|
142
|
-
const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
|
143
|
-
return () => {
|
144
|
-
unSet();
|
145
|
-
unReset();
|
146
|
-
};
|
147
|
-
};
|
148
|
-
const use = (...subscriptions) => {
|
149
|
-
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
150
|
-
if (subscription.set) {
|
151
|
-
unsubs.push(on('set', subscription.set));
|
152
|
-
}
|
153
|
-
if (subscription.get) {
|
154
|
-
unsubs.push(on('get', subscription.get));
|
155
|
-
}
|
156
|
-
if (subscription.reset) {
|
157
|
-
unsubs.push(on('reset', subscription.reset));
|
158
|
-
}
|
159
|
-
if (subscription.dispose) {
|
160
|
-
unsubs.push(on('dispose', subscription.dispose));
|
161
|
-
}
|
162
|
-
return unsubs;
|
163
|
-
}, []);
|
164
|
-
return () => unsubs.forEach((unsub) => unsub());
|
165
|
-
};
|
166
|
-
const forceUpdate = (key) => {
|
167
|
-
const oldValue = states.get(key);
|
168
|
-
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
169
|
-
};
|
170
|
-
return {
|
171
|
-
state,
|
172
|
-
get,
|
173
|
-
set,
|
174
|
-
on,
|
175
|
-
onChange,
|
176
|
-
use,
|
177
|
-
dispose,
|
178
|
-
reset,
|
179
|
-
forceUpdate,
|
180
|
-
};
|
181
|
-
};
|
182
|
-
const removeFromArray = (array, item) => {
|
183
|
-
const index = array.indexOf(item);
|
184
|
-
if (index >= 0) {
|
185
|
-
array[index] = array[array.length - 1];
|
186
|
-
array.length--;
|
187
|
-
}
|
188
|
-
};
|
189
|
-
|
190
|
-
const createStore = (defaultState, shouldUpdate) => {
|
191
|
-
const map = createObservableMap(defaultState, shouldUpdate);
|
192
|
-
map.use(stencilSubscription());
|
193
|
-
return map;
|
194
|
-
};
|
195
|
-
|
196
|
-
const store = createStore({
|
197
|
-
exporterProviders: {}
|
198
|
-
});
|
199
|
-
|
200
|
-
exports.store = store;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
const index = require('./index-21bd01e1.js');
|
6
|
-
const core = require('@sankhyalabs/core');
|
7
|
-
|
8
|
-
const snkSimpleBarCss = ".sc-snk-simple-bar-h{display:flex;height:100%;width:100%}.simple-bar__container.sc-snk-simple-bar{flex:1;display:flex;align-items:stretch;gap:var(--space--small)}.simple-bar__left-slot.sc-snk-simple-bar{min-width:280px;flex:1;display:flex;align-items:center}.simple-bar__right-slot.sc-snk-simple-bar{flex:1;display:flex;align-items:center;justify-content:flex-end}.simple-bar__column.sc-snk-simple-bar{flex:1;display:flex;flex-direction:column}";
|
9
|
-
|
10
|
-
const SnkSimpleBar = class {
|
11
|
-
constructor(hostRef) {
|
12
|
-
index.registerInstance(this, hostRef);
|
13
|
-
this.clickBreadcrumbItem = index.createEvent(this, "clickBreadcrumbItem", 3);
|
14
|
-
this.exit = index.createEvent(this, "exit", 3);
|
15
|
-
this.label = undefined;
|
16
|
-
this.breadcrumbItens = undefined;
|
17
|
-
}
|
18
|
-
componentDidLoad() {
|
19
|
-
if (!this._element)
|
20
|
-
return;
|
21
|
-
core.ElementIDUtils.addIDInfo(this._element);
|
22
|
-
}
|
23
|
-
render() {
|
24
|
-
return (index.h("div", { class: "simple-bar__container ez-margin-vertical--medium ez-padding--extra-small" }, index.h("div", { class: "simple-bar__left-slot" }, index.h("ez-button", { class: "ez-padding-right--medium", mode: 'icon', iconName: "arrow_back", size: 'medium', onClick: () => this.exit.emit() }), index.h("div", { class: "simple-bar__column" }, index.h("h1", { class: "ez-title ez-title--primary ez-title--extra-large" }, this.label), index.h("ez-breadcrumb", { items: this.breadcrumbItens, onSelectedItem: ({ detail }) => this.clickBreadcrumbItem.emit(detail) }))), index.h("div", { class: "simple-bar__right-slot" }, index.h("slot", { name: "rightSlot" }))));
|
25
|
-
}
|
26
|
-
get _element() { return index.getElement(this); }
|
27
|
-
};
|
28
|
-
SnkSimpleBar.style = snkSimpleBarCss;
|
29
|
-
|
30
|
-
exports.snk_simple_bar = SnkSimpleBar;
|