@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-76031.3 → 0.0.0-bugfix-dev-kb-80398.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/{ContinuousInsertUtils-2718aaaa.js → ContinuousInsertUtils-c27b439e.js} +3 -2
- package/dist/cjs/{SnkFormConfigManager-07f747be.js → SnkFormConfigManager-c11d8468.js} +1 -1
- package/dist/cjs/{constants-35ddd366.js → constants-241934b3.js} +9 -0
- package/dist/cjs/{dataunit-fetcher-c32fdff7.js → dataunit-fetcher-8291ac21.js} +21 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-3b86b6c4.js → pesquisa-fetcher-5c583c93.js} +16 -5
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +3 -2
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_5.cjs.entry.js +3 -3
- package/dist/cjs/snk-application.cjs.entry.js +72 -27
- package/dist/cjs/snk-attach.cjs.entry.js +3 -3
- package/dist/cjs/snk-config-options_3.cjs.entry.js +2 -2
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +3 -3
- package/dist/cjs/snk-data-exporter.cjs.entry.js +4 -4
- package/dist/cjs/{snk-data-unit-2c7c1964.js → snk-data-unit-d75e6220.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +5 -5
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +6 -6
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +21 -6
- package/dist/cjs/{snk-guides-viewer-266339d2.js → snk-guides-viewer-bff0d27d.js} +4 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -5
- package/dist/cjs/snk-pesquisa.cjs.entry.js +3 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/collection/components/snk-application/snk-application.css +2 -0
- package/dist/collection/components/snk-application/snk-application.js +108 -28
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +3 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +3 -3
- package/dist/collection/components/snk-grid/snk-grid.js +17 -3
- package/dist/collection/components/snk-pesquisa/pesquisaHelper.js +4 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +21 -7
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +12 -5
- package/dist/collection/lib/index.js +1 -0
- package/dist/collection/lib/utils/constants.js +9 -0
- package/dist/components/ContinuousInsertUtils.js +1 -0
- package/dist/components/ISave.js +16 -5
- package/dist/components/SnkFormConfigManager.js +1 -1
- package/dist/components/constants.js +10 -1
- package/dist/components/dataunit-fetcher.js +21 -7
- package/dist/components/pesquisa-grid2.js +1 -0
- package/dist/components/snk-actions-button2.js +1 -0
- package/dist/components/snk-application2.js +73 -25
- package/dist/components/snk-config-options2.js +1 -1
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-filter-bar2.js +3 -3
- package/dist/components/snk-filter-item2.js +3 -3
- package/dist/components/snk-filter-number.js +1 -1
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-grid2.js +18 -3
- package/dist/components/snk-pesquisa2.js +1 -0
- package/dist/components/snk-simple-form-config2.js +1 -0
- package/dist/components/snk-tab-config2.js +1 -1
- package/dist/esm/{ContinuousInsertUtils-deb7767f.js → ContinuousInsertUtils-6bf78c5e.js} +3 -2
- package/dist/esm/{SnkFormConfigManager-1ff928fa.js → SnkFormConfigManager-5022f87f.js} +1 -1
- package/dist/esm/{constants-7302ee87.js → constants-75abb876.js} +10 -1
- package/dist/esm/{dataunit-fetcher-26c2bed4.js → dataunit-fetcher-5247a708.js} +21 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-767abffa.js → pesquisa-fetcher-4284f2a3.js} +16 -5
- package/dist/esm/pesquisa-grid_2.entry.js +3 -2
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_5.entry.js +3 -3
- package/dist/esm/snk-application.entry.js +72 -27
- package/dist/esm/snk-attach.entry.js +3 -3
- package/dist/esm/snk-config-options_3.entry.js +2 -2
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +3 -3
- package/dist/esm/snk-data-exporter.entry.js +4 -4
- package/dist/esm/{snk-data-unit-a36df23f.js → snk-data-unit-bfd10c71.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +5 -5
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar_4.entry.js +6 -6
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +21 -6
- package/dist/esm/{snk-guides-viewer-9f03a9a0.js → snk-guides-viewer-454ebc07.js} +4 -4
- package/dist/esm/snk-guides-viewer.entry.js +5 -5
- package/dist/esm/snk-pesquisa.entry.js +3 -2
- package/dist/esm/snk-simple-crud.entry.js +5 -5
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/sankhyablocks/p-03e6825e.js +1 -0
- package/dist/sankhyablocks/{p-edbe8e15.entry.js → p-198c48c5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-95ce311a.js → p-1d19a5b0.js} +1 -1
- package/dist/sankhyablocks/{p-2d3f9482.entry.js → p-23cd6abf.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8b4fc28f.entry.js → p-2953c481.entry.js} +1 -1
- package/dist/sankhyablocks/p-38179225.js +60 -0
- package/dist/sankhyablocks/{p-aaef93e8.js → p-3ba431c9.js} +1 -1
- package/dist/sankhyablocks/p-41c3bee5.js +6 -0
- package/dist/sankhyablocks/{p-18f58d73.js → p-478ab2b6.js} +1 -1
- package/dist/sankhyablocks/{p-6beac917.entry.js → p-4c9adf1c.entry.js} +1 -1
- package/dist/sankhyablocks/p-50bf8dbc.entry.js +1 -0
- package/dist/sankhyablocks/{p-09b4a36b.entry.js → p-643b2aaa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-70ae0779.js → p-655bdd60.js} +1 -1
- package/dist/sankhyablocks/p-6fc8bfa2.entry.js +1 -0
- package/dist/sankhyablocks/{p-9070bfe3.entry.js → p-73b037a8.entry.js} +1 -1
- package/dist/sankhyablocks/p-79f823f3.entry.js +1 -0
- package/dist/sankhyablocks/{p-5dbed7b4.entry.js → p-8ad7c8bc.entry.js} +1 -1
- package/dist/sankhyablocks/p-91e34755.entry.js +1 -0
- package/dist/sankhyablocks/p-9a99c67b.entry.js +1 -0
- package/dist/sankhyablocks/{p-b896f0df.entry.js → p-a04f38aa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1f17a44e.entry.js → p-ae26e8d0.entry.js} +1 -1
- package/dist/sankhyablocks/p-bd234604.entry.js +1 -0
- package/dist/sankhyablocks/{p-0d86c004.entry.js → p-c021a3a9.entry.js} +1 -1
- package/dist/sankhyablocks/p-d9bb48c4.entry.js +11 -0
- package/dist/sankhyablocks/{p-045398fb.entry.js → p-f8db6795.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +14 -4
- package/dist/types/components/snk-grid/snk-grid.d.ts +2 -0
- package/dist/types/components.d.ts +4 -3
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +9 -2
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/utils/constants.d.ts +7 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-01ba23cd.entry.js +0 -1
- package/dist/sankhyablocks/p-0d2c8bc8.entry.js +0 -1
- package/dist/sankhyablocks/p-270b83d1.entry.js +0 -1
- package/dist/sankhyablocks/p-4aca10f3.entry.js +0 -1
- package/dist/sankhyablocks/p-4fe8bb73.js +0 -6
- package/dist/sankhyablocks/p-78d49c74.js +0 -60
- package/dist/sankhyablocks/p-800a8209.entry.js +0 -1
- package/dist/sankhyablocks/p-86fc5865.js +0 -1
- package/dist/sankhyablocks/p-9cec99d8.entry.js +0 -11
- package/dist/sankhyablocks/p-d3a44f8f.entry.js +0 -1
|
@@ -17,6 +17,7 @@ import Workspace from "../../lib/workspace/workspace";
|
|
|
17
17
|
import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
|
|
18
18
|
import RequestListenerFactory from "./request-listener/RequestListenerFactory";
|
|
19
19
|
import PreloadManager from "../../lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager";
|
|
20
|
+
import { TEMPLATES_SKELETON } from "../../lib/utils/constants";
|
|
20
21
|
/**
|
|
21
22
|
* É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
|
|
22
23
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
@@ -31,12 +32,14 @@ export class SnkApplication {
|
|
|
31
32
|
this._duCache = new Map();
|
|
32
33
|
this._duPromises = new Map();
|
|
33
34
|
this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
|
|
34
|
-
this.
|
|
35
|
+
this._maxTimerAppLoading = 10000;
|
|
35
36
|
this._isBrowserTypeElectron = false;
|
|
36
37
|
this._pendingActions = new Map;
|
|
37
38
|
this._loadPkParameter = null;
|
|
38
39
|
this._isLoadedByPk = false;
|
|
39
40
|
this._applicationReady = false;
|
|
41
|
+
this._templateSkeleton = TEMPLATES_SKELETON.GRID;
|
|
42
|
+
this._activeScrimWindow = false;
|
|
40
43
|
this.enableLockManagerLoadingApp = undefined;
|
|
41
44
|
this.messagesBuilder = undefined;
|
|
42
45
|
this.configName = undefined;
|
|
@@ -532,12 +535,20 @@ export class SnkApplication {
|
|
|
532
535
|
});
|
|
533
536
|
PreloadManager.removeRecords(dataUnit, records);
|
|
534
537
|
}
|
|
535
|
-
getCountSkeleton(
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
538
|
+
getCountSkeleton(skeletonHeight, spacingSkeleton, headerHeight) {
|
|
539
|
+
headerHeight = headerHeight || 160;
|
|
540
|
+
const containerHeight = window.innerHeight - headerHeight;
|
|
541
|
+
const skeletonSpacing = spacingSkeleton || 10;
|
|
542
|
+
const totalHeightPerSkeleton = skeletonHeight + skeletonSpacing;
|
|
543
|
+
const skeletonCount = Math.floor(containerHeight / totalHeightPerSkeleton) - 1;
|
|
539
544
|
return skeletonCount || 1;
|
|
540
545
|
}
|
|
546
|
+
getSkeletonRandomWidth() {
|
|
547
|
+
const min = 30;
|
|
548
|
+
const max = 100;
|
|
549
|
+
const randomWidth = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
550
|
+
return `${randomWidth}%`;
|
|
551
|
+
}
|
|
541
552
|
async getAuthList(auth) {
|
|
542
553
|
return await (new MGEAuthorization()).parseFromJSON(auth);
|
|
543
554
|
}
|
|
@@ -1019,6 +1030,8 @@ export class SnkApplication {
|
|
|
1019
1030
|
this.removeShortcuts();
|
|
1020
1031
|
if (this._lockManagerTimer)
|
|
1021
1032
|
clearTimeout(this._lockManagerTimer);
|
|
1033
|
+
if (this._scrimWindowTimer)
|
|
1034
|
+
clearTimeout(this._scrimWindowTimer);
|
|
1022
1035
|
}
|
|
1023
1036
|
async componentDidLoad() {
|
|
1024
1037
|
this.applicationLoading.emit(true);
|
|
@@ -1038,18 +1051,39 @@ export class SnkApplication {
|
|
|
1038
1051
|
this._applicationReady = true;
|
|
1039
1052
|
}
|
|
1040
1053
|
}
|
|
1041
|
-
async
|
|
1054
|
+
async showScrimApp(active) {
|
|
1055
|
+
if (!this.enableLockManagerLoadingApp || !this._applicationReady || !active) {
|
|
1056
|
+
this._activeScrimWindow = false;
|
|
1057
|
+
if (this._scrimWindowTimer)
|
|
1058
|
+
clearTimeout(this._scrimWindowTimer);
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
this._activeScrimWindow = true;
|
|
1062
|
+
this._scrimWindowTimer = setTimeout(async () => {
|
|
1063
|
+
if (this._activeScrimWindow) {
|
|
1064
|
+
this._activeScrimWindow = false;
|
|
1065
|
+
clearTimeout(this._scrimWindowTimer);
|
|
1066
|
+
}
|
|
1067
|
+
}, this._maxTimerAppLoading);
|
|
1068
|
+
}
|
|
1069
|
+
async changeTemplateSkeleton(templateSkeletonType) {
|
|
1070
|
+
this._templateSkeleton = templateSkeletonType ? templateSkeletonType : this._templateSkeleton;
|
|
1071
|
+
}
|
|
1072
|
+
async markToReload(templateSkeletonType) {
|
|
1042
1073
|
if (!this.enableLockManagerLoadingApp)
|
|
1043
1074
|
return;
|
|
1075
|
+
await this.changeTemplateSkeleton(templateSkeletonType);
|
|
1044
1076
|
this._applicationReady = false;
|
|
1045
1077
|
await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
|
|
1046
1078
|
this.resolveApplicationReady();
|
|
1047
1079
|
}
|
|
1048
|
-
async addLoadingLock(forceReady = false) {
|
|
1080
|
+
async addLoadingLock(forceReady = false, templateSkeletonType) {
|
|
1049
1081
|
if (!this.enableLockManagerLoadingApp)
|
|
1050
1082
|
return;
|
|
1083
|
+
await this.changeTemplateSkeleton(templateSkeletonType);
|
|
1051
1084
|
if (forceReady) {
|
|
1052
1085
|
this._applicationReady = false;
|
|
1086
|
+
this._activeScrimWindow = this._applicationReady ? true : false;
|
|
1053
1087
|
await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
|
|
1054
1088
|
}
|
|
1055
1089
|
this.resolveApplicationReady();
|
|
@@ -1087,7 +1121,7 @@ export class SnkApplication {
|
|
|
1087
1121
|
this.stopTimeoutLockManager();
|
|
1088
1122
|
this._applicationReady = true;
|
|
1089
1123
|
}
|
|
1090
|
-
}, this.
|
|
1124
|
+
}, this._maxTimerAppLoading);
|
|
1091
1125
|
}
|
|
1092
1126
|
initKeyboardManager() {
|
|
1093
1127
|
this._keyboardManager
|
|
@@ -1101,19 +1135,26 @@ export class SnkApplication {
|
|
|
1101
1135
|
.unbind("ctrl + d")
|
|
1102
1136
|
.unbind("F1");
|
|
1103
1137
|
}
|
|
1104
|
-
|
|
1105
|
-
renderLoadingSkeleton(template) {
|
|
1138
|
+
renderLoadingSkeleton() {
|
|
1106
1139
|
if (!this.enableLockManagerLoadingApp)
|
|
1107
1140
|
return;
|
|
1108
1141
|
if (this._isBrowserTypeElectron) {
|
|
1109
1142
|
return this.getSpinnerLoadingDefault();
|
|
1110
1143
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1144
|
+
else {
|
|
1145
|
+
switch (this._templateSkeleton) {
|
|
1146
|
+
case TEMPLATES_SKELETON.CUSTOM_TEMPLATE:
|
|
1147
|
+
case TEMPLATES_SKELETON.GRID:
|
|
1148
|
+
return this.getSkeletonTemplateGrid();
|
|
1149
|
+
case TEMPLATES_SKELETON.GRID_WITH_SIDEBAR:
|
|
1150
|
+
return this.getSkeletonTemplateGridWithSidebar();
|
|
1151
|
+
case TEMPLATES_SKELETON.GRID_WITH_PANEL:
|
|
1152
|
+
return this.getSkeletonTemplateGridWithPanel();
|
|
1153
|
+
case TEMPLATES_SKELETON.FORM_WITH_SIDEBAR:
|
|
1154
|
+
return this.getSkeletonTemplateFormWithSidebar();
|
|
1155
|
+
default:
|
|
1156
|
+
return this.getSkeletonTemplateGrid();
|
|
1157
|
+
}
|
|
1117
1158
|
}
|
|
1118
1159
|
}
|
|
1119
1160
|
getLoadingVisibilityStyle() {
|
|
@@ -1122,8 +1163,17 @@ export class SnkApplication {
|
|
|
1122
1163
|
display: this._applicationReady ? "none" : "unset"
|
|
1123
1164
|
};
|
|
1124
1165
|
}
|
|
1125
|
-
|
|
1126
|
-
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-margin--
|
|
1166
|
+
getSkeletonTemplateGrid() {
|
|
1167
|
+
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-flex ez-flex--column ez-margin--large ez-margin-top--medium" }, h("div", { class: "ez-margin-bottom--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "20%", height: "35px", animation: "progress" })), h("div", { class: "" }, h("ez-skeleton", { count: 1, variant: "rect", width: "70%", height: "25px", animation: "progress" }))), h("div", { class: "ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large", style: { height: "calc(-105px + 100vh)" } }, [1, 2, 3, 4].map((_, index) => (h("div", { class: "ez-margin-right--large", key: index, style: { width: "25%" } }, h("ez-skeleton", { count: this.getCountSkeleton(50, 10), variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" })))))));
|
|
1168
|
+
}
|
|
1169
|
+
getSkeletonTemplateGridWithSidebar() {
|
|
1170
|
+
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-flex ez-flex--column ez-margin--large ez-margin-top--medium" }, h("div", { class: "ez-margin-bottom--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "20%", height: "35px", animation: "progress" })), h("div", { class: "" }, h("ez-skeleton", { count: 1, variant: "rect", width: "70%", height: "25px", animation: "progress" }))), h("div", { class: "ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large", style: { height: "calc(100vh - 160px)" } }, h("div", { class: "ez-flex ez-flex--column ez-margin-right--large", style: { width: "25%", overflow: "hidden" } }, Array(this.getCountSkeleton(30, 6)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: this.getSkeletonRandomWidth(), height: "30px", animation: "progress", marginBottom: "10px" }))), h("div", { class: "ez-margin-right--large", style: { width: "75%" } }, h("ez-skeleton", { count: this.getCountSkeleton(50, 10), variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" })))));
|
|
1171
|
+
}
|
|
1172
|
+
getSkeletonTemplateGridWithPanel() {
|
|
1173
|
+
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-margin--medium ez-margin-top--medium ez-padding--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "70%", height: "25px", animation: "progress" })), h("div", { class: "ez-flex ez-margin--medium ez-margin-top--medium", style: { maxHeight: "calc(-105px + 100vh)", overflow: "hidden" } }, h("div", { class: "", style: { width: "70%", overflow: "hidden" } }, h("div", { class: "ez-padding--medium", style: { height: "50%" } }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "100%", animation: "progress" })), h("div", { class: "ez-padding--medium", style: {} }, h("ez-skeleton", { count: 1, variant: "rect", width: "250px", height: "25px", animation: "progress" })), h("div", { class: "ez-flex ez-padding--medium", style: { height: "45%" } }, [1, 2].map(() => (h("div", { style: { width: "50%" } }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "100%", animation: "progress" })))))), h("div", { class: "ez-flex ez-flex--column ez-padding--medium", style: { width: "30%", overflow: "hidden" } }, Array(this.getCountSkeleton(30, 10)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" }))))));
|
|
1174
|
+
}
|
|
1175
|
+
getSkeletonTemplateFormWithSidebar() {
|
|
1176
|
+
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-margin--medium ez-margin-top--medium ez-padding--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "70%", height: "25px", animation: "progress" })), h("div", { class: "ez-flex ez-margin--medium ez-margin-top--medium", style: { maxHeight: "calc(-105px + 100vh)", overflow: "hidden" } }, h("div", { class: "ez-flex ez-flex--column ez-margin-right--large", style: { width: "25%", overflow: "hidden" } }, Array(this.getCountSkeleton(30, 6)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: this.getSkeletonRandomWidth(), height: "30px", animation: "progress", marginBottom: "10px" }))), h("div", { class: "ez-flex ez-flex--column", style: { width: "75%" } }, h("div", { class: "ez-padding--medium", style: { width: "100%" } }, h("ez-skeleton", { count: 1, variant: "rect", width: "30%", height: "25px", animation: "progress" })), h("div", { class: "ez-padding--medium", style: { height: "45%" } }, h("div", { class: "ez-flex", style: { width: "100%", height: "100%" } }, [1, 2, 3, 4].map((_, columnIndex) => (h("div", { key: columnIndex, class: "ez-padding-right--large", style: { width: "25%", overflow: "hidden" } }, Array(this.getCountSkeleton(50, 20)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" }))))))), h("div", { class: "ez-padding--medium", style: { width: "100%" } }, h("ez-skeleton", { count: 1, variant: "rect", width: "30%", height: "25px", animation: "progress" })), h("div", { class: "ez-padding--medium", style: { height: "45%" } }, h("div", { class: "ez-flex", style: { width: "100%", height: "100%" } }, [1, 2, 3, 4].map((_, columnIndex) => (h("div", { key: columnIndex, class: "ez-padding-right--large", style: { width: "25%", overflow: "hidden" } }, Array(this.getCountSkeleton(50, 20)).fill(null).map((_, index) => h("ez-skeleton", { key: index, count: 1, variant: "rect", width: "100%", height: "50px", animation: "progress", marginBottom: "10px" })))))))))));
|
|
1127
1177
|
}
|
|
1128
1178
|
getSpinnerLoadingDefault() {
|
|
1129
1179
|
return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-flex ez-size-height--full ez-size-width--full ez-flex--justify-center ez-flex--align-items-center spinner" }, h("ez-icon", { iconName: "sync", size: "x-large", class: "spin" }), h("span", { class: "ez-title ez-title--secondary ez-title--extra-large" }, "Carregando..."))));
|
|
@@ -1132,7 +1182,7 @@ export class SnkApplication {
|
|
|
1132
1182
|
return (h(Host, { style: {
|
|
1133
1183
|
visibility: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden",
|
|
1134
1184
|
overflow: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden"
|
|
1135
|
-
} }, h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true }), this.renderLoadingSkeleton())));
|
|
1185
|
+
} }, h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.ezLoadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true }), this.renderLoadingSkeleton(), this._activeScrimWindow && (h("div", { class: "ez-scrim ez-scrim--light", style: { cursor: "progress", zIndex: "var(--scrim-z-index)" } })))));
|
|
1136
1186
|
}
|
|
1137
1187
|
static get is() { return "snk-application"; }
|
|
1138
1188
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1259,7 +1309,9 @@ export class SnkApplication {
|
|
|
1259
1309
|
}
|
|
1260
1310
|
static get states() {
|
|
1261
1311
|
return {
|
|
1262
|
-
"_applicationReady": {}
|
|
1312
|
+
"_applicationReady": {},
|
|
1313
|
+
"_templateSkeleton": {},
|
|
1314
|
+
"_activeScrimWindow": {}
|
|
1263
1315
|
};
|
|
1264
1316
|
}
|
|
1265
1317
|
static get events() {
|
|
@@ -2685,13 +2737,39 @@ export class SnkApplication {
|
|
|
2685
2737
|
}]
|
|
2686
2738
|
}
|
|
2687
2739
|
},
|
|
2740
|
+
"showScrimApp": {
|
|
2741
|
+
"complexType": {
|
|
2742
|
+
"signature": "(active: boolean) => Promise<void>",
|
|
2743
|
+
"parameters": [{
|
|
2744
|
+
"tags": [],
|
|
2745
|
+
"text": ""
|
|
2746
|
+
}],
|
|
2747
|
+
"references": {
|
|
2748
|
+
"Promise": {
|
|
2749
|
+
"location": "global"
|
|
2750
|
+
}
|
|
2751
|
+
},
|
|
2752
|
+
"return": "Promise<void>"
|
|
2753
|
+
},
|
|
2754
|
+
"docs": {
|
|
2755
|
+
"text": "",
|
|
2756
|
+
"tags": []
|
|
2757
|
+
}
|
|
2758
|
+
},
|
|
2688
2759
|
"markToReload": {
|
|
2689
2760
|
"complexType": {
|
|
2690
|
-
"signature": "() => Promise<void>",
|
|
2691
|
-
"parameters": [
|
|
2761
|
+
"signature": "(templateSkeletonType?: TEMPLATES_SKELETON) => Promise<void>",
|
|
2762
|
+
"parameters": [{
|
|
2763
|
+
"tags": [],
|
|
2764
|
+
"text": ""
|
|
2765
|
+
}],
|
|
2692
2766
|
"references": {
|
|
2693
2767
|
"Promise": {
|
|
2694
2768
|
"location": "global"
|
|
2769
|
+
},
|
|
2770
|
+
"TEMPLATES_SKELETON": {
|
|
2771
|
+
"location": "import",
|
|
2772
|
+
"path": "../../lib/utils/constants"
|
|
2695
2773
|
}
|
|
2696
2774
|
},
|
|
2697
2775
|
"return": "Promise<void>"
|
|
@@ -2703,14 +2781,21 @@ export class SnkApplication {
|
|
|
2703
2781
|
},
|
|
2704
2782
|
"addLoadingLock": {
|
|
2705
2783
|
"complexType": {
|
|
2706
|
-
"signature": "(forceReady?: boolean) => Promise<() => void>",
|
|
2784
|
+
"signature": "(forceReady?: boolean, templateSkeletonType?: TEMPLATES_SKELETON) => Promise<() => void>",
|
|
2707
2785
|
"parameters": [{
|
|
2708
2786
|
"tags": [],
|
|
2709
2787
|
"text": ""
|
|
2788
|
+
}, {
|
|
2789
|
+
"tags": [],
|
|
2790
|
+
"text": ""
|
|
2710
2791
|
}],
|
|
2711
2792
|
"references": {
|
|
2712
2793
|
"Promise": {
|
|
2713
2794
|
"location": "global"
|
|
2795
|
+
},
|
|
2796
|
+
"TEMPLATES_SKELETON": {
|
|
2797
|
+
"location": "import",
|
|
2798
|
+
"path": "../../lib/utils/constants"
|
|
2714
2799
|
}
|
|
2715
2800
|
},
|
|
2716
2801
|
"return": "Promise<() => void>"
|
|
@@ -2736,8 +2821,3 @@ class PendingPromise {
|
|
|
2736
2821
|
this.reject = reject;
|
|
2737
2822
|
}
|
|
2738
2823
|
}
|
|
2739
|
-
var TEMPLATES_LOADING_SKELETON;
|
|
2740
|
-
(function (TEMPLATES_LOADING_SKELETON) {
|
|
2741
|
-
TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["APPLICATION"] = 1] = "APPLICATION";
|
|
2742
|
-
TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["GRID"] = 2] = "GRID";
|
|
2743
|
-
})(TEMPLATES_LOADING_SKELETON || (TEMPLATES_LOADING_SKELETON = {}));
|
|
@@ -125,7 +125,7 @@ function buildNumber(item) {
|
|
|
125
125
|
const variation = props.variation;
|
|
126
126
|
if (variation === FilterNumberVariation.INTERVAL) {
|
|
127
127
|
const { start, end } = value !== null && value !== void 0 ? value : { start: 0, end: 0 };
|
|
128
|
-
if (start && end) {
|
|
128
|
+
if (!isNaN(start) && !isNaN(end)) {
|
|
129
129
|
return {
|
|
130
130
|
name: id,
|
|
131
131
|
expression: props.intervalExpression.fullfill,
|
|
@@ -135,7 +135,7 @@ function buildNumber(item) {
|
|
|
135
135
|
]
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
if (start) {
|
|
138
|
+
if (!isNaN(start)) {
|
|
139
139
|
return {
|
|
140
140
|
name: id,
|
|
141
141
|
expression: props.intervalExpression.onlystart,
|
|
@@ -144,7 +144,7 @@ function buildNumber(item) {
|
|
|
144
144
|
]
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
-
if (end) {
|
|
147
|
+
if (!isNaN(end)) {
|
|
148
148
|
return {
|
|
149
149
|
name: id,
|
|
150
150
|
expression: props.intervalExpression.onlyend,
|
|
@@ -19,7 +19,7 @@ export class SnkFilterPeriod {
|
|
|
19
19
|
if (this.getVariation() === FilterNumberVariation.INTERVAL) {
|
|
20
20
|
const start = this._startInterval.value;
|
|
21
21
|
const end = this._endInterval.value;
|
|
22
|
-
this.value = (start || end ? { start, end } : undefined);
|
|
22
|
+
this.value = (!isNaN(start) || !isNaN(end) ? { start, end } : undefined);
|
|
23
23
|
this.valueChanged.emit(this.value);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -201,13 +201,13 @@ export class SnkFilterItem {
|
|
|
201
201
|
}
|
|
202
202
|
if (type === FilterItemType.NUMBER && props.variation === FilterNumberVariation.INTERVAL) {
|
|
203
203
|
const { start, end } = value;
|
|
204
|
-
if (start && end) {
|
|
204
|
+
if (!isNaN(start) && !isNaN(end)) {
|
|
205
205
|
return this.getMessage('snkFilterBar.fullIntervalTooltip', { LABEL: label, START_LABEL: start, END_LABEL: end });
|
|
206
206
|
}
|
|
207
|
-
if (start) {
|
|
207
|
+
if (!isNaN(start)) {
|
|
208
208
|
return `${label}: ${this.getMessage('snkFilterBar.onlyStartToltip')} ${Number(start)}`;
|
|
209
209
|
}
|
|
210
|
-
if (end) {
|
|
210
|
+
if (!isNaN(end)) {
|
|
211
211
|
return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
@@ -211,10 +211,24 @@ export class SnkGrid {
|
|
|
211
211
|
this._gridConfig = config;
|
|
212
212
|
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
|
213
213
|
}
|
|
214
|
+
fixColumNameCharset(columnName) {
|
|
215
|
+
try {
|
|
216
|
+
return decodeURIComponent(escape(columnName));
|
|
217
|
+
}
|
|
218
|
+
catch (e) {
|
|
219
|
+
return columnName;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
normalizeGridConfig(config) {
|
|
223
|
+
if (!config)
|
|
224
|
+
return config;
|
|
225
|
+
const columnsMapped = config.columns.map(column => (Object.assign(Object.assign({}, column), { name: this.fixColumNameCharset(column.name) })));
|
|
226
|
+
return Object.assign(Object.assign({}, config), { columns: columnsMapped });
|
|
227
|
+
}
|
|
214
228
|
loadConfig() {
|
|
215
229
|
ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
|
216
230
|
.then((config) => {
|
|
217
|
-
this.setGridConfig(config);
|
|
231
|
+
this.setGridConfig(this.normalizeGridConfig(config));
|
|
218
232
|
})
|
|
219
233
|
.catch((error) => {
|
|
220
234
|
console.warn(error);
|
|
@@ -226,12 +240,12 @@ export class SnkGrid {
|
|
|
226
240
|
}
|
|
227
241
|
}
|
|
228
242
|
gridConfigChangeHandler(evt) {
|
|
229
|
-
const config = evt.detail;
|
|
243
|
+
const config = this.normalizeGridConfig(evt.detail);
|
|
230
244
|
ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
|
231
245
|
evt.stopPropagation();
|
|
232
246
|
}
|
|
233
247
|
modalConfigChangeHandler(evt) {
|
|
234
|
-
const config = evt.detail;
|
|
248
|
+
const config = this.normalizeGridConfig(evt.detail);
|
|
235
249
|
this._grid.setColumnsState(config.columns)
|
|
236
250
|
.then(() => {
|
|
237
251
|
this.setGridConfig(config);
|
|
@@ -55,6 +55,8 @@ function buildUserInterface(field) {
|
|
|
55
55
|
return UserInterface.DATETIME;
|
|
56
56
|
if (field['type'] === 'T')
|
|
57
57
|
return UserInterface.TIME;
|
|
58
|
+
if (field['type'] === 'I')
|
|
59
|
+
return UserInterface.INTEGERNUMBER;
|
|
58
60
|
return undefined;
|
|
59
61
|
}
|
|
60
62
|
function buildDataType(rawType) {
|
|
@@ -66,6 +68,8 @@ function buildDataType(rawType) {
|
|
|
66
68
|
return DataType.DATE;
|
|
67
69
|
case 'B':
|
|
68
70
|
return DataType.OBJECT;
|
|
71
|
+
case 'I':
|
|
72
|
+
return DataType.NUMBER;
|
|
69
73
|
default:
|
|
70
74
|
return DataType.TEXT;
|
|
71
75
|
}
|
|
@@ -2,6 +2,9 @@ import { ObjectUtils } from "@sankhyalabs/core";
|
|
|
2
2
|
export class ArrayRepository {
|
|
3
3
|
constructor(equalsFunction) {
|
|
4
4
|
this._list = [];
|
|
5
|
+
this._listCopy = [];
|
|
6
|
+
this._listLastUpdate = 0;
|
|
7
|
+
this._listCopyLastUpdate = 0;
|
|
5
8
|
this._equalsFunction = equalsFunction;
|
|
6
9
|
}
|
|
7
10
|
async load(filterFunction, sortingFunction, offset, limit) {
|
|
@@ -40,13 +43,13 @@ export class ArrayRepository {
|
|
|
40
43
|
return Promise.resolve(new Map(processedItems.map(item => [item.key, item.value])));
|
|
41
44
|
}
|
|
42
45
|
async push(items) {
|
|
43
|
-
this.
|
|
46
|
+
this.updateList([...this._list, ...items]);
|
|
44
47
|
}
|
|
45
48
|
async clear() {
|
|
46
|
-
this.
|
|
49
|
+
this.updateList([]);
|
|
47
50
|
}
|
|
48
51
|
async delete(items) {
|
|
49
|
-
|
|
52
|
+
const list = this._list.filter(item => {
|
|
50
53
|
for (const removed of items) {
|
|
51
54
|
if (this._equalsFunction(item, removed)) {
|
|
52
55
|
return false;
|
|
@@ -54,20 +57,23 @@ export class ArrayRepository {
|
|
|
54
57
|
}
|
|
55
58
|
return true;
|
|
56
59
|
});
|
|
60
|
+
this.updateList(list);
|
|
57
61
|
}
|
|
58
62
|
async update(items) {
|
|
59
|
-
|
|
63
|
+
const list = this._list.map(existingItem => {
|
|
60
64
|
const newItem = items.find(newItem => this._equalsFunction(existingItem, newItem));
|
|
61
65
|
return newItem == undefined ? existingItem : newItem;
|
|
62
66
|
});
|
|
67
|
+
this.updateList(list);
|
|
63
68
|
}
|
|
64
69
|
async insert(itemReference, items) {
|
|
65
70
|
const itemPosition = this._list.indexOf(itemReference);
|
|
66
71
|
if (itemPosition == -1) {
|
|
67
|
-
this.
|
|
72
|
+
this.push(items);
|
|
68
73
|
return;
|
|
69
74
|
}
|
|
70
|
-
|
|
75
|
+
const list = this._list.slice(0, itemPosition).concat(items).concat(this._list.slice(itemPosition));
|
|
76
|
+
this.updateList(list);
|
|
71
77
|
}
|
|
72
78
|
isOperating() {
|
|
73
79
|
return true;
|
|
@@ -79,6 +85,14 @@ export class ArrayRepository {
|
|
|
79
85
|
return Promise.resolve(this._list.length);
|
|
80
86
|
}
|
|
81
87
|
getFromCache() {
|
|
82
|
-
|
|
88
|
+
if (this._listLastUpdate > this._listCopyLastUpdate) {
|
|
89
|
+
this._listCopyLastUpdate = this._listLastUpdate;
|
|
90
|
+
this._listCopy = ObjectUtils.copy(this._list);
|
|
91
|
+
}
|
|
92
|
+
return this._listCopy;
|
|
93
|
+
}
|
|
94
|
+
updateList(newList) {
|
|
95
|
+
this._list = newList;
|
|
96
|
+
this._listLastUpdate = Date.now();
|
|
83
97
|
}
|
|
84
98
|
}
|
|
@@ -176,13 +176,13 @@ export class PesquisaFetcher {
|
|
|
176
176
|
return parseLegacyTree(response);
|
|
177
177
|
}
|
|
178
178
|
buildLoadTreeRequestBody(entityName, argument, criteria, searchOptions) {
|
|
179
|
-
var _a, _b
|
|
179
|
+
var _a, _b;
|
|
180
180
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
|
181
181
|
const incomeSearchOptions = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) !== null && _a !== void 0 ? _a : searchOptions;
|
|
182
182
|
const rootEntity = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.rootEntity;
|
|
183
183
|
const codeFieldName = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.codeFieldName;
|
|
184
184
|
const expression = (_b = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _b === void 0 ? void 0 : _b.expression;
|
|
185
|
-
const params = (
|
|
185
|
+
const params = this.buildParams(listenerResult);
|
|
186
186
|
const instancia = {
|
|
187
187
|
'nome': entityName,
|
|
188
188
|
'nomeInstanciaLocal': rootEntity,
|
|
@@ -200,6 +200,14 @@ export class PesquisaFetcher {
|
|
|
200
200
|
'instancia': instancia,
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
+
buildParams(listenerResult) {
|
|
204
|
+
var _a, _b;
|
|
205
|
+
let params = (_b = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : [];
|
|
206
|
+
params = params.map(param => {
|
|
207
|
+
return Object.assign(Object.assign({}, param), { tipo: convertParamType(param.dataType), $: param.value });
|
|
208
|
+
});
|
|
209
|
+
return params;
|
|
210
|
+
}
|
|
203
211
|
}
|
|
204
212
|
function buildLoadGridConfigPayload(entityName) {
|
|
205
213
|
return {
|
|
@@ -237,9 +245,8 @@ function buildSaveConfig(entityName, lastUsedMode) {
|
|
|
237
245
|
};
|
|
238
246
|
}
|
|
239
247
|
function convertParamType(dataType) {
|
|
240
|
-
//Alerta: Cuidado
|
|
241
|
-
//
|
|
242
|
-
//data (com ou sem hora) e string são realmente relevantes
|
|
248
|
+
// Alerta: Cuidado para não contaminar o DataType com a implementação atual da pesquisa!
|
|
249
|
+
// Em geral, somente inteiros, data (com ou sem hora) e string são realmente relevantes.
|
|
243
250
|
switch (dataType) {
|
|
244
251
|
case DataType.NUMBER:
|
|
245
252
|
return "I";
|
|
@@ -12,3 +12,4 @@ export { default as GridConfigFetcher } from './http/data-fetcher/fetchers/grid-
|
|
|
12
12
|
export { default as ParametersFetcher } from './http/data-fetcher/fetchers/parameters-fecher';
|
|
13
13
|
export { default as PersonalizedFilterFetcher } from './http/data-fetcher/fetchers/personalized-filter-fetcher';
|
|
14
14
|
export { ResourceFetcher } from './http/data-fetcher/fetchers/resource-fetcher';
|
|
15
|
+
export { TEMPLATES_SKELETON } from './utils/constants';
|
|
@@ -103,3 +103,12 @@ export var SIMPLE_CRUD_MODE;
|
|
|
103
103
|
SIMPLE_CRUD_MODE[SIMPLE_CRUD_MODE["SERVER"] = 0] = "SERVER";
|
|
104
104
|
SIMPLE_CRUD_MODE[SIMPLE_CRUD_MODE["IN_MEMORY"] = 1] = "IN_MEMORY";
|
|
105
105
|
})(SIMPLE_CRUD_MODE || (SIMPLE_CRUD_MODE = {}));
|
|
106
|
+
// TODO: validar forma de compartilhar os templates com outros projetos
|
|
107
|
+
export var TEMPLATES_SKELETON;
|
|
108
|
+
(function (TEMPLATES_SKELETON) {
|
|
109
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["CUSTOM_TEMPLATE"] = 0] = "CUSTOM_TEMPLATE";
|
|
110
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["GRID"] = 1] = "GRID";
|
|
111
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["GRID_WITH_SIDEBAR"] = 2] = "GRID_WITH_SIDEBAR";
|
|
112
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["GRID_WITH_PANEL"] = 3] = "GRID_WITH_PANEL";
|
|
113
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["FORM_WITH_SIDEBAR"] = 4] = "FORM_WITH_SIDEBAR";
|
|
114
|
+
})(TEMPLATES_SKELETON || (TEMPLATES_SKELETON = {}));
|
|
@@ -6,6 +6,7 @@ import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/datauni
|
|
|
6
6
|
import { P as PreloadManager } from './dataunit-fetcher.js';
|
|
7
7
|
import './filter-item-type.enum.js';
|
|
8
8
|
import './form-config-fetcher.js';
|
|
9
|
+
import './constants.js';
|
|
9
10
|
import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
|
10
11
|
import { h } from '@stencil/core/internal/client';
|
|
11
12
|
|
package/dist/components/ISave.js
CHANGED
|
@@ -57,6 +57,8 @@ function buildUserInterface(field) {
|
|
|
57
57
|
return UserInterface.DATETIME;
|
|
58
58
|
if (field['type'] === 'T')
|
|
59
59
|
return UserInterface.TIME;
|
|
60
|
+
if (field['type'] === 'I')
|
|
61
|
+
return UserInterface.INTEGERNUMBER;
|
|
60
62
|
return undefined;
|
|
61
63
|
}
|
|
62
64
|
function buildDataType(rawType) {
|
|
@@ -68,6 +70,8 @@ function buildDataType(rawType) {
|
|
|
68
70
|
return DataType.DATE;
|
|
69
71
|
case 'B':
|
|
70
72
|
return DataType.OBJECT;
|
|
73
|
+
case 'I':
|
|
74
|
+
return DataType.NUMBER;
|
|
71
75
|
default:
|
|
72
76
|
return DataType.TEXT;
|
|
73
77
|
}
|
|
@@ -270,13 +274,13 @@ class PesquisaFetcher {
|
|
|
270
274
|
return parseLegacyTree(response);
|
|
271
275
|
}
|
|
272
276
|
buildLoadTreeRequestBody(entityName, argument, criteria, searchOptions) {
|
|
273
|
-
var _a, _b
|
|
277
|
+
var _a, _b;
|
|
274
278
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
|
275
279
|
const incomeSearchOptions = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) !== null && _a !== void 0 ? _a : searchOptions;
|
|
276
280
|
const rootEntity = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.rootEntity;
|
|
277
281
|
const codeFieldName = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.codeFieldName;
|
|
278
282
|
const expression = (_b = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _b === void 0 ? void 0 : _b.expression;
|
|
279
|
-
const params = (
|
|
283
|
+
const params = this.buildParams(listenerResult);
|
|
280
284
|
const instancia = {
|
|
281
285
|
'nome': entityName,
|
|
282
286
|
'nomeInstanciaLocal': rootEntity,
|
|
@@ -294,6 +298,14 @@ class PesquisaFetcher {
|
|
|
294
298
|
'instancia': instancia,
|
|
295
299
|
};
|
|
296
300
|
}
|
|
301
|
+
buildParams(listenerResult) {
|
|
302
|
+
var _a, _b;
|
|
303
|
+
let params = (_b = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : [];
|
|
304
|
+
params = params.map(param => {
|
|
305
|
+
return Object.assign(Object.assign({}, param), { tipo: convertParamType(param.dataType), $: param.value });
|
|
306
|
+
});
|
|
307
|
+
return params;
|
|
308
|
+
}
|
|
297
309
|
}
|
|
298
310
|
function buildLoadGridConfigPayload(entityName) {
|
|
299
311
|
return {
|
|
@@ -331,9 +343,8 @@ function buildSaveConfig(entityName, lastUsedMode) {
|
|
|
331
343
|
};
|
|
332
344
|
}
|
|
333
345
|
function convertParamType(dataType) {
|
|
334
|
-
//Alerta: Cuidado
|
|
335
|
-
//
|
|
336
|
-
//data (com ou sem hora) e string são realmente relevantes
|
|
346
|
+
// Alerta: Cuidado para não contaminar o DataType com a implementação atual da pesquisa!
|
|
347
|
+
// Em geral, somente inteiros, data (com ou sem hora) e string são realmente relevantes.
|
|
337
348
|
switch (dataType) {
|
|
338
349
|
case DataType.NUMBER:
|
|
339
350
|
return "I";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FormConfigFetcher } from './form-config-fetcher.js';
|
|
4
|
-
import {
|
|
4
|
+
import { d as TAB_NAMES } from './constants.js';
|
|
5
5
|
|
|
6
6
|
class SnkFormConfigManager {
|
|
7
7
|
constructor(configName, resourceID, onConfigChange, dataUnit) {
|
|
@@ -89,5 +89,14 @@ var SIMPLE_CRUD_MODE;
|
|
|
89
89
|
SIMPLE_CRUD_MODE[SIMPLE_CRUD_MODE["SERVER"] = 0] = "SERVER";
|
|
90
90
|
SIMPLE_CRUD_MODE[SIMPLE_CRUD_MODE["IN_MEMORY"] = 1] = "IN_MEMORY";
|
|
91
91
|
})(SIMPLE_CRUD_MODE || (SIMPLE_CRUD_MODE = {}));
|
|
92
|
+
// TODO: validar forma de compartilhar os templates com outros projetos
|
|
93
|
+
var TEMPLATES_SKELETON;
|
|
94
|
+
(function (TEMPLATES_SKELETON) {
|
|
95
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["CUSTOM_TEMPLATE"] = 0] = "CUSTOM_TEMPLATE";
|
|
96
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["GRID"] = 1] = "GRID";
|
|
97
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["GRID_WITH_SIDEBAR"] = 2] = "GRID_WITH_SIDEBAR";
|
|
98
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["GRID_WITH_PANEL"] = 3] = "GRID_WITH_PANEL";
|
|
99
|
+
TEMPLATES_SKELETON[TEMPLATES_SKELETON["FORM_WITH_SIDEBAR"] = 4] = "FORM_WITH_SIDEBAR";
|
|
100
|
+
})(TEMPLATES_SKELETON || (TEMPLATES_SKELETON = {}));
|
|
92
101
|
|
|
93
|
-
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, REPORT_LAUNCHER_RESOURCE_ID as R, SIMPLE_CRUD_MODE as S,
|
|
102
|
+
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, REPORT_LAUNCHER_RESOURCE_ID as R, SIMPLE_CRUD_MODE as S, TEMPLATES_SKELETON as T, VIEW_MODE as V, VARS_BY_TYPE as a, TAGS_BY_TYPE as b, CONFIG_SORTABLE_EVENTS as c, TAB_NAMES as d, TYPE_ACTIONS as e };
|