@sankhyalabs/sankhyablocks 8.16.0-dev.75 → 8.16.0-dev.77

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. package/dist/cjs/{ContinuousInsertUtils-b5de47db.js → ContinuousInsertUtils-aa63f0a9.js} +2 -1
  2. package/dist/cjs/{SnkFormConfigManager-07f747be.js → SnkFormConfigManager-c11d8468.js} +1 -1
  3. package/dist/cjs/{constants-35ddd366.js → constants-241934b3.js} +9 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{pesquisa-fetcher-36d039c4.js → pesquisa-fetcher-5c583c93.js} +12 -5
  6. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +2 -1
  7. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  8. package/dist/cjs/snk-actions-button_5.cjs.entry.js +2 -2
  9. package/dist/cjs/snk-application.cjs.entry.js +71 -26
  10. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  11. package/dist/cjs/snk-config-options_3.cjs.entry.js +2 -2
  12. package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-crud.cjs.entry.js +2 -2
  14. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  15. package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
  16. package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
  17. package/dist/cjs/snk-grid.cjs.entry.js +3 -2
  18. package/dist/cjs/{snk-guides-viewer-a651b9b8.js → snk-guides-viewer-c1c56eca.js} +3 -3
  19. package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -4
  20. package/dist/cjs/snk-pesquisa.cjs.entry.js +2 -1
  21. package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -4
  22. package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
  23. package/dist/collection/components/snk-application/snk-application.css +2 -0
  24. package/dist/collection/components/snk-application/snk-application.js +108 -28
  25. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +12 -5
  26. package/dist/collection/lib/index.js +1 -0
  27. package/dist/collection/lib/utils/constants.js +9 -0
  28. package/dist/components/ContinuousInsertUtils.js +1 -0
  29. package/dist/components/ISave.js +12 -5
  30. package/dist/components/SnkFormConfigManager.js +1 -1
  31. package/dist/components/constants.js +10 -1
  32. package/dist/components/pesquisa-grid2.js +1 -0
  33. package/dist/components/snk-actions-button2.js +1 -0
  34. package/dist/components/snk-application2.js +73 -25
  35. package/dist/components/snk-config-options2.js +1 -1
  36. package/dist/components/snk-detail-view2.js +1 -1
  37. package/dist/components/snk-form-config2.js +1 -1
  38. package/dist/components/snk-grid2.js +1 -0
  39. package/dist/components/snk-pesquisa2.js +1 -0
  40. package/dist/components/snk-simple-form-config2.js +1 -0
  41. package/dist/components/snk-tab-config2.js +1 -1
  42. package/dist/esm/{ContinuousInsertUtils-213385f5.js → ContinuousInsertUtils-af683684.js} +2 -1
  43. package/dist/esm/{SnkFormConfigManager-1ff928fa.js → SnkFormConfigManager-5022f87f.js} +1 -1
  44. package/dist/esm/{constants-7302ee87.js → constants-75abb876.js} +10 -1
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/{pesquisa-fetcher-aab1fe14.js → pesquisa-fetcher-4284f2a3.js} +12 -5
  47. package/dist/esm/pesquisa-grid_2.entry.js +2 -1
  48. package/dist/esm/sankhyablocks.js +1 -1
  49. package/dist/esm/snk-actions-button_5.entry.js +2 -2
  50. package/dist/esm/snk-application.entry.js +71 -26
  51. package/dist/esm/snk-attach.entry.js +2 -2
  52. package/dist/esm/snk-config-options_3.entry.js +2 -2
  53. package/dist/esm/snk-configurator.entry.js +1 -1
  54. package/dist/esm/snk-crud.entry.js +2 -2
  55. package/dist/esm/snk-data-exporter.entry.js +2 -2
  56. package/dist/esm/snk-detail-view.entry.js +4 -4
  57. package/dist/esm/snk-field-config.entry.js +1 -1
  58. package/dist/esm/snk-grid.entry.js +3 -2
  59. package/dist/esm/{snk-guides-viewer-cbd8511f.js → snk-guides-viewer-2b96b7f7.js} +3 -3
  60. package/dist/esm/snk-guides-viewer.entry.js +4 -4
  61. package/dist/esm/snk-pesquisa.entry.js +2 -1
  62. package/dist/esm/snk-simple-crud.entry.js +4 -4
  63. package/dist/esm/snk-tab-config.entry.js +1 -1
  64. package/dist/sankhyablocks/p-0c50ba37.entry.js +11 -0
  65. package/dist/sankhyablocks/p-15f5f702.js +1 -0
  66. package/dist/sankhyablocks/{p-95ce311a.js → p-1d19a5b0.js} +1 -1
  67. package/dist/sankhyablocks/{p-2d3f9482.entry.js → p-23cd6abf.entry.js} +1 -1
  68. package/dist/sankhyablocks/{p-8b4fc28f.entry.js → p-2953c481.entry.js} +1 -1
  69. package/dist/sankhyablocks/p-31c3c9d0.entry.js +1 -0
  70. package/dist/sankhyablocks/{p-aaef93e8.js → p-3ba431c9.js} +1 -1
  71. package/dist/sankhyablocks/p-41c3bee5.js +6 -0
  72. package/dist/sankhyablocks/{p-b5ebc20a.entry.js → p-43d58b74.entry.js} +1 -1
  73. package/dist/sankhyablocks/p-538b3174.entry.js +1 -0
  74. package/dist/sankhyablocks/{p-3b2e5822.entry.js → p-78e91134.entry.js} +1 -1
  75. package/dist/sankhyablocks/{p-bfdc08f2.entry.js → p-7d0627f4.entry.js} +1 -1
  76. package/dist/sankhyablocks/{p-b738af3a.entry.js → p-80dd8976.entry.js} +1 -1
  77. package/dist/sankhyablocks/{p-0d86c004.entry.js → p-c021a3a9.entry.js} +1 -1
  78. package/dist/sankhyablocks/{p-76041b30.entry.js → p-c4d87e71.entry.js} +1 -1
  79. package/dist/sankhyablocks/{p-4ec70a7b.js → p-c6aefba8.js} +1 -1
  80. package/dist/sankhyablocks/{p-7a95cbc7.entry.js → p-c9eb2bf5.entry.js} +1 -1
  81. package/dist/sankhyablocks/p-d434bb9a.entry.js +1 -0
  82. package/dist/sankhyablocks/p-d5687306.entry.js +1 -0
  83. package/dist/sankhyablocks/{p-41793e17.entry.js → p-f4ceb72c.entry.js} +1 -1
  84. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  85. package/dist/types/components/snk-application/snk-application.d.ts +14 -4
  86. package/dist/types/components.d.ts +4 -3
  87. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +9 -2
  88. package/dist/types/lib/index.d.ts +1 -0
  89. package/dist/types/lib/utils/constants.d.ts +7 -0
  90. package/package.json +1 -1
  91. package/dist/sankhyablocks/p-167ac365.entry.js +0 -11
  92. package/dist/sankhyablocks/p-2098a093.entry.js +0 -1
  93. package/dist/sankhyablocks/p-70a546e9.entry.js +0 -1
  94. package/dist/sankhyablocks/p-92dd432c.entry.js +0 -1
  95. package/dist/sankhyablocks/p-9f9128d3.entry.js +0 -1
  96. package/dist/sankhyablocks/p-c9f22653.js +0 -6
  97. package/dist/sankhyablocks/p-dd37be7e.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._maxTimeLockAppLoading = 10000;
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(className, skeletonHeight, spacingSkeleton) {
536
- let containerHeight = window.innerHeight - 350;
537
- spacingSkeleton = !spacingSkeleton ? 20 : spacingSkeleton;
538
- let skeletonCount = Math.floor(containerHeight / (skeletonHeight + spacingSkeleton));
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 markToReload() {
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._maxTimeLockAppLoading);
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
- // TODO: Etapa 2 - implementar template de loading
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
- switch (template) {
1112
- case TEMPLATES_LOADING_SKELETON.APPLICATION:
1113
- case TEMPLATES_LOADING_SKELETON.GRID:
1114
- return this.getSkeletonTemplateApplication();
1115
- default:
1116
- return this.getSkeletonTemplateApplication();
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
- getSkeletonTemplateApplication() {
1126
- return (h("div", { class: "loading-hidden", style: this.getLoadingVisibilityStyle() }, h("div", { class: "ez-margin--medium ez-margin-top--extra-small" }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "150px", animation: "progress" })), h("div", { class: "ez-flex ez-flex--align-items-stretch skeleton-content" }, h("div", { class: "skeleton-content-left ez-margin--medium" }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "calc(100% - 15px)", animation: "progress", marginBottom: "20px" })), h("div", { class: "ez-flex-item--auto skeleton-content-right ez-margin--medium" }, h("ez-skeleton", { count: this.getCountSkeleton("skeleton-content-right", 50, 20), variant: "rect", width: "100%", height: "49px", animation: "progress", marginBottom: "20px" }))), h("div", { class: "skeleton-content-footer ez-margin--medium ez-margin-top--extra-small" }, h("ez-skeleton", { count: 1, variant: "rect", width: "100%", height: "100px", animation: "progress" }))));
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 = {}));
@@ -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, _c;
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 = (_c = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _c === void 0 ? void 0 : _c.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 pra não contaminar o DataType com a implementação
241
- //atual da pesquisa... em geral, somente inteiros,
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
 
@@ -274,13 +274,13 @@ class PesquisaFetcher {
274
274
  return parseLegacyTree(response);
275
275
  }
276
276
  buildLoadTreeRequestBody(entityName, argument, criteria, searchOptions) {
277
- var _a, _b, _c;
277
+ var _a, _b;
278
278
  const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
279
279
  const incomeSearchOptions = (_a = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.searchOptions) !== null && _a !== void 0 ? _a : searchOptions;
280
280
  const rootEntity = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.rootEntity;
281
281
  const codeFieldName = incomeSearchOptions === null || incomeSearchOptions === void 0 ? void 0 : incomeSearchOptions.codeFieldName;
282
282
  const expression = (_b = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _b === void 0 ? void 0 : _b.expression;
283
- const params = (_c = listenerResult === null || listenerResult === void 0 ? void 0 : listenerResult.criteria) === null || _c === void 0 ? void 0 : _c.params;
283
+ const params = this.buildParams(listenerResult);
284
284
  const instancia = {
285
285
  'nome': entityName,
286
286
  'nomeInstanciaLocal': rootEntity,
@@ -298,6 +298,14 @@ class PesquisaFetcher {
298
298
  'instancia': instancia,
299
299
  };
300
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
+ }
301
309
  }
302
310
  function buildLoadGridConfigPayload(entityName) {
303
311
  return {
@@ -335,9 +343,8 @@ function buildSaveConfig(entityName, lastUsedMode) {
335
343
  };
336
344
  }
337
345
  function convertParamType(dataType) {
338
- //Alerta: Cuidado pra não contaminar o DataType com a implementação
339
- //atual da pesquisa... em geral, somente inteiros,
340
- //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.
341
348
  switch (dataType) {
342
349
  case DataType.NUMBER:
343
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 { c as TAB_NAMES } from './constants.js';
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, TAGS_BY_TYPE as T, VIEW_MODE as V, VARS_BY_TYPE as a, CONFIG_SORTABLE_EVENTS as b, TAB_NAMES as c, TYPE_ACTIONS as d };
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 };
@@ -7,6 +7,7 @@ import '@sankhyalabs/ezui/dist/collection/utils/constants';
7
7
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
8
  import './filter-item-type.enum.js';
9
9
  import './form-config-fetcher.js';
10
+ import './constants.js';
10
11
 
11
12
  const pesquisaGridCss = ".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";
12
13
 
@@ -8,6 +8,7 @@ import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
8
  import './dataunit-fetcher.js';
9
9
  import './filter-item-type.enum.js';
10
10
  import './form-config-fetcher.js';
11
+ import './constants.js';
11
12
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo.js';
12
13
  import { R as ResourceIDUtils } from './ResourceIDUtils.js';
13
14