@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-78242.2 → 0.0.0-bugfix-dev-KB-80932.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.
Files changed (175) hide show
  1. package/dist/cjs/{ConfigStorage-f079f5fd.js → ConfigStorage-d024aec8.js} +2 -2
  2. package/dist/cjs/{ContinuousInsertUtils-64e47516.js → ContinuousInsertUtils-54d44192.js} +5 -5
  3. package/dist/cjs/{DataFetcher-e059eb72.js → DataFetcher-65879b2c.js} +188 -56
  4. package/dist/cjs/{SnkFormConfigManager-63369164.js → SnkFormConfigManager-ae3185b2.js} +2 -2
  5. package/dist/cjs/{auth-fetcher-4f853233.js → auth-fetcher-8480751c.js} +1 -1
  6. package/dist/cjs/{dataunit-fetcher-228016f4.js → dataunit-fetcher-8ea97d88.js} +2 -2
  7. package/dist/cjs/{form-config-fetcher-39397ac5.js → form-config-fetcher-90126e4c.js} +38 -1
  8. package/dist/cjs/index-f9e81701.js +8 -4
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-a9bfeb22.js → pesquisa-fetcher-f3454c23.js} +179 -1
  11. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +133 -0
  12. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  13. package/dist/cjs/{snk-actions-button_4.cjs.entry.js → snk-actions-button_5.cjs.entry.js} +99 -9
  14. package/dist/cjs/snk-application.cjs.entry.js +144 -21
  15. package/dist/cjs/snk-attach.cjs.entry.js +13 -9
  16. package/dist/cjs/snk-config-options_3.cjs.entry.js +4 -4
  17. package/dist/cjs/snk-crud.cjs.entry.js +8 -7
  18. package/dist/cjs/snk-data-exporter.cjs.entry.js +29 -18
  19. package/dist/cjs/{snk-data-unit-3d9b6ed4.js → snk-data-unit-72ef8777.js} +1 -1
  20. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  21. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  22. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +27 -11
  23. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  24. package/dist/cjs/snk-grid.cjs.entry.js +9 -8
  25. package/dist/cjs/{snk-guides-viewer-2139481c.js → snk-guides-viewer-ea5d0907.js} +5 -5
  26. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  27. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  28. package/dist/cjs/snk-pesquisa.cjs.entry.js +105 -31
  29. package/dist/cjs/snk-simple-crud.cjs.entry.js +27 -29
  30. package/dist/collection/collection-manifest.json +3 -0
  31. package/dist/collection/components/snk-actions-button/actions/index.js +4 -4
  32. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +4 -3
  33. package/dist/collection/components/snk-application/snk-application.css +34 -0
  34. package/dist/collection/components/snk-application/snk-application.js +197 -14
  35. package/dist/collection/components/snk-attach/structure/builder/taskbar-builder.js +8 -4
  36. package/dist/collection/components/snk-crud/snk-crud.js +39 -20
  37. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +11 -5
  38. package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +11 -4
  39. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +1 -1
  40. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +1 -3
  41. package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +1 -1
  42. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +3 -1
  43. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +40 -8
  44. package/dist/collection/components/snk-grid/snk-grid.js +39 -20
  45. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.css +10 -0
  46. package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js +190 -0
  47. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.css +25 -0
  48. package/dist/collection/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.js +179 -0
  49. package/dist/collection/components/snk-pesquisa/pesquisaHelper.js +89 -0
  50. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +24 -5
  51. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +168 -32
  52. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +56 -41
  53. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css +22 -0
  54. package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js +181 -0
  55. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +1 -1
  56. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +41 -4
  57. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +92 -3
  58. package/dist/components/ContinuousInsertUtils.js +2 -3
  59. package/dist/components/DataFetcher.js +188 -56
  60. package/dist/components/ISave.js +346 -1
  61. package/dist/components/dataunit-fetcher.js +1 -1
  62. package/dist/components/form-config-fetcher.js +37 -0
  63. package/dist/components/index.d.ts +3 -0
  64. package/dist/components/index.js +3 -0
  65. package/dist/components/pesquisa-grid.d.ts +11 -0
  66. package/dist/components/pesquisa-grid.js +6 -0
  67. package/dist/components/pesquisa-grid2.js +86 -0
  68. package/dist/components/pesquisa-tree.d.ts +11 -0
  69. package/dist/components/pesquisa-tree.js +6 -0
  70. package/dist/components/pesquisa-tree2.js +82 -0
  71. package/dist/components/snk-actions-button2.js +4 -5
  72. package/dist/components/snk-application2.js +159 -20
  73. package/dist/components/snk-attach2.js +20 -35
  74. package/dist/components/snk-crud.js +66 -59
  75. package/dist/components/snk-data-exporter2.js +25 -15
  76. package/dist/components/snk-detail-view2.js +84 -94
  77. package/dist/components/snk-filter-bar2.js +23 -8
  78. package/dist/components/snk-filter-modal.js +3 -1
  79. package/dist/components/snk-grid2.js +5 -4
  80. package/dist/components/snk-pesquisa2.js +118 -33
  81. package/dist/components/snk-simple-crud2.js +35 -56
  82. package/dist/components/snk-simple-form-config.d.ts +11 -0
  83. package/dist/components/snk-simple-form-config.js +6 -0
  84. package/dist/components/snk-simple-form-config2.js +120 -0
  85. package/dist/components/teste-pesquisa.js +13 -1
  86. package/dist/esm/{ConfigStorage-6514d66e.js → ConfigStorage-373bb440.js} +2 -2
  87. package/dist/esm/{ContinuousInsertUtils-b62906f9.js → ContinuousInsertUtils-25e7bd9a.js} +5 -5
  88. package/dist/esm/{DataFetcher-5034df59.js → DataFetcher-5221b992.js} +188 -56
  89. package/dist/esm/{SnkFormConfigManager-b409c745.js → SnkFormConfigManager-b65e6db0.js} +2 -2
  90. package/dist/esm/{auth-fetcher-ca5d3a49.js → auth-fetcher-e32fe8a4.js} +1 -1
  91. package/dist/esm/{dataunit-fetcher-56cb648b.js → dataunit-fetcher-8dd93d8b.js} +2 -2
  92. package/dist/esm/{form-config-fetcher-a7d3e277.js → form-config-fetcher-126e2471.js} +38 -1
  93. package/dist/esm/index-a7d3d3f1.js +8 -4
  94. package/dist/esm/loader.js +1 -1
  95. package/dist/{components/pesquisa-fetcher.js → esm/pesquisa-fetcher-0af41f09.js} +180 -3
  96. package/dist/esm/pesquisa-grid_2.entry.js +128 -0
  97. package/dist/esm/sankhyablocks.js +1 -1
  98. package/dist/esm/{snk-actions-button_4.entry.js → snk-actions-button_5.entry.js} +99 -10
  99. package/dist/esm/snk-application.entry.js +146 -23
  100. package/dist/esm/snk-attach.entry.js +13 -9
  101. package/dist/esm/snk-config-options_3.entry.js +4 -4
  102. package/dist/esm/snk-crud.entry.js +8 -7
  103. package/dist/esm/snk-data-exporter.entry.js +29 -18
  104. package/dist/esm/{snk-data-unit-9fa7d2b9.js → snk-data-unit-11a49fc3.js} +1 -1
  105. package/dist/esm/snk-data-unit.entry.js +3 -3
  106. package/dist/esm/snk-detail-view.entry.js +7 -7
  107. package/dist/esm/snk-filter-bar_4.entry.js +28 -12
  108. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  109. package/dist/esm/snk-grid.entry.js +9 -8
  110. package/dist/esm/{snk-guides-viewer-b7ed39eb.js → snk-guides-viewer-830f5fb9.js} +5 -5
  111. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  112. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  113. package/dist/esm/snk-pesquisa.entry.js +105 -31
  114. package/dist/esm/snk-simple-crud.entry.js +27 -29
  115. package/dist/sankhyablocks/{p-0e206e62.js → p-05b6ff91.js} +1 -1
  116. package/dist/sankhyablocks/p-09067bee.entry.js +1 -0
  117. package/dist/sankhyablocks/p-0cda2226.entry.js +11 -0
  118. package/dist/sankhyablocks/p-1435701f.js +26 -0
  119. package/dist/sankhyablocks/{p-e97be1c8.js → p-171b7623.js} +1 -1
  120. package/dist/sankhyablocks/{p-9ffd9fc7.js → p-19dc71e9.js} +1 -1
  121. package/dist/sankhyablocks/{p-0d2a2e9e.entry.js → p-1a91d1f3.entry.js} +1 -1
  122. package/dist/sankhyablocks/{p-aa003d4e.entry.js → p-1cf39cfd.entry.js} +1 -1
  123. package/dist/sankhyablocks/{p-bb8ef149.entry.js → p-254c59d2.entry.js} +1 -1
  124. package/dist/sankhyablocks/p-422eb699.entry.js +1 -0
  125. package/dist/sankhyablocks/{p-a2c790ac.entry.js → p-469384a2.entry.js} +1 -1
  126. package/dist/sankhyablocks/p-54f5354a.entry.js +1 -0
  127. package/dist/sankhyablocks/{p-342eeb3b.js → p-60e4db34.js} +1 -1
  128. package/dist/sankhyablocks/p-618a29ed.entry.js +1 -0
  129. package/dist/sankhyablocks/p-798386c7.js +6 -0
  130. package/dist/sankhyablocks/{p-fca0e5cc.entry.js → p-82ee6dc3.entry.js} +1 -1
  131. package/dist/sankhyablocks/{p-e4391e16.js → p-8a1ee5b5.js} +1 -1
  132. package/dist/sankhyablocks/p-8bd86610.entry.js +1 -0
  133. package/dist/sankhyablocks/p-b50a0753.entry.js +1 -0
  134. package/dist/sankhyablocks/p-d62228fb.js +1 -0
  135. package/dist/sankhyablocks/p-d92d4f91.entry.js +1 -0
  136. package/dist/sankhyablocks/{p-47d24ac8.js → p-ddefbbc7.js} +1 -1
  137. package/dist/sankhyablocks/p-e5430b29.entry.js +1 -0
  138. package/dist/sankhyablocks/p-f0b9303b.js +1 -0
  139. package/dist/sankhyablocks/p-f258690a.entry.js +1 -0
  140. package/dist/sankhyablocks/{p-ec43fcc8.entry.js → p-f975370f.entry.js} +1 -1
  141. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  142. package/dist/types/components/snk-application/snk-application.d.ts +22 -4
  143. package/dist/types/components/snk-crud/snk-crud.d.ts +8 -4
  144. package/dist/types/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.d.ts +1 -0
  145. package/dist/types/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.d.ts +1 -0
  146. package/dist/types/components/snk-data-exporter/utils/ParserExport.d.ts +1 -1
  147. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +6 -1
  148. package/dist/types/components/snk-grid/snk-grid.d.ts +8 -4
  149. package/dist/types/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.d.ts +38 -0
  150. package/dist/types/components/snk-pesquisa/pesquisa-tree/pesquisa-tree.d.ts +29 -0
  151. package/dist/types/components/snk-pesquisa/pesquisaHelper.d.ts +19 -0
  152. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +35 -1
  153. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -4
  154. package/dist/types/components/snk-simple-form-config/snk-simple-form-config.d.ts +34 -0
  155. package/dist/types/components.d.ts +244 -23
  156. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +8 -2
  157. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +10 -1
  158. package/package.json +1 -1
  159. package/react/components.d.ts +3 -0
  160. package/react/components.js +3 -0
  161. package/react/components.js.map +1 -1
  162. package/dist/esm/pesquisa-fetcher-6bc2e41a.js +0 -169
  163. package/dist/sankhyablocks/p-00278e07.js +0 -1
  164. package/dist/sankhyablocks/p-0387d9d7.entry.js +0 -1
  165. package/dist/sankhyablocks/p-126c58ea.js +0 -26
  166. package/dist/sankhyablocks/p-1d3ce0d9.entry.js +0 -1
  167. package/dist/sankhyablocks/p-341465ce.js +0 -6
  168. package/dist/sankhyablocks/p-3728d2aa.entry.js +0 -11
  169. package/dist/sankhyablocks/p-4138da61.entry.js +0 -1
  170. package/dist/sankhyablocks/p-5d9788b3.entry.js +0 -1
  171. package/dist/sankhyablocks/p-7075b789.entry.js +0 -1
  172. package/dist/sankhyablocks/p-aaf94476.js +0 -1
  173. package/dist/sankhyablocks/p-af7f7b3e.entry.js +0 -1
  174. package/dist/sankhyablocks/p-d1791da2.entry.js +0 -1
  175. package/dist/sankhyablocks/p-eb7c9cf4.entry.js +0 -1
@@ -2,7 +2,6 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
2
2
  import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ServiceUtils, StorageType, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { D as DataFetcher } from './DataFetcher.js';
4
4
  import { P as ParamType } from './ParamType.js';
5
- import './pesquisa-fetcher.js';
6
5
  import './ISave.js';
7
6
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
8
7
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -243,9 +242,9 @@ class Actions {
243
242
  return resultParams;
244
243
  });
245
244
  }
246
- actionExecute(execSource, callback) {
245
+ async actionExecute(execSource, callback) {
247
246
  execSource.virtualPage = this.buildVirtualPage();
248
- this.prepareAndExecute(execSource, callback);
247
+ await this.prepareAndExecute(execSource, callback);
249
248
  this.recordsReloader(execSource.refreshType);
250
249
  }
251
250
  resolvePromptParams(action, execSource, hasParamsToSave) {
@@ -440,9 +439,9 @@ class Actions {
440
439
  async buildResourceId(actionId) {
441
440
  return this._appResourceId + '.actionconfig.' + actionId;
442
441
  }
443
- prepareAndExecute(execSource, executeAction) {
442
+ async prepareAndExecute(execSource, executeAction) {
444
443
  this.addRows(execSource);
445
- executeAction(execSource);
444
+ await executeAction(execSource);
446
445
  }
447
446
  addRows(execSource) {
448
447
  const primaryKeys = this.getPrimaryKeys();
@@ -1,12 +1,14 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking, UserAgentUtils, LockManager, LockManagerOperation } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { C as ConfigStorage } from './ConfigStorage.js';
5
5
  import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher.js';
6
6
  import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher.js';
7
7
  import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher.js';
8
- import { P as PesquisaFetcher } from './pesquisa-fetcher.js';
8
+ import { a as PesquisaFetcher } from './ISave.js';
9
9
  import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
10
+ import { d as defineCustomElement$3 } from './pesquisa-grid2.js';
11
+ import { d as defineCustomElement$2 } from './pesquisa-tree2.js';
10
12
  import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
11
13
 
12
14
  class TotalsFetcher {
@@ -298,11 +300,12 @@ class DebouncedRequestListener {
298
300
  }
299
301
  ;
300
302
  onRequestEnd(param) {
303
+ var _a, _b, _c;
301
304
  const timeoutId = this.requests.get(param.requestId);
302
305
  clearTimeout(timeoutId);
303
- if (this.requestsLoadingBar.includes(param.requestId)) {
304
- this.requestsLoadingBar = this.requestsLoadingBar.filter(id => id !== param.requestId);
305
- !this.requestsLoadingBar.length && this.ezLoadingBar.hide();
306
+ if ((_a = this.requestsLoadingBar) === null || _a === void 0 ? void 0 : _a.includes(param.requestId)) {
307
+ this.requestsLoadingBar = (_b = this.requestsLoadingBar) === null || _b === void 0 ? void 0 : _b.filter(id => id !== param.requestId);
308
+ !this.requestsLoadingBar.length && ((_c = this.ezLoadingBar) === null || _c === void 0 ? void 0 : _c.hide());
306
309
  }
307
310
  }
308
311
  ;
@@ -373,7 +376,7 @@ class RequestListenerFactory {
373
376
  }
374
377
  }
375
378
 
376
- const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
379
+ const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
377
380
 
378
381
  const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
379
382
  constructor() {
@@ -388,9 +391,13 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
388
391
  this._duCache = new Map();
389
392
  this._duPromises = new Map();
390
393
  this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
394
+ this._maxTimeLockAppLoading = 10000;
395
+ this._isBrowserTypeElectron = false;
391
396
  this._pendingActions = new Map;
392
397
  this._loadPkParameter = null;
393
398
  this._isLoadedByPk = false;
399
+ this._applicationReady = false;
400
+ this.enableLockManagerLoadingApp = undefined;
394
401
  this.messagesBuilder = undefined;
395
402
  this.configName = undefined;
396
403
  this.gridLegacyConfigName = undefined;
@@ -876,15 +883,21 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
876
883
  return Promise.resolve(this._isLoadedByPk);
877
884
  }
878
885
  /**
879
- * Remove registro do cache do PreLoader do dataunit.
880
- * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
881
- */
886
+ * Remove registro do cache do PreLoader do dataunit.
887
+ * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
888
+ */
882
889
  async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
883
890
  const records = recordsIDs.map(id => {
884
891
  return { "__record__id__": id };
885
892
  });
886
893
  PreloadManager.removeRecords(dataUnit, records);
887
894
  }
895
+ getCountSkeleton(className, skeletonHeight, spacingSkeleton) {
896
+ let containerHeight = window.innerHeight - 350;
897
+ spacingSkeleton = !spacingSkeleton ? 20 : spacingSkeleton;
898
+ let skeletonCount = Math.floor(containerHeight / (skeletonHeight + spacingSkeleton));
899
+ return skeletonCount || 1;
900
+ }
888
901
  async getAuthList(auth) {
889
902
  return await (new MGEAuthorization()).parseFromJSON(auth);
890
903
  }
@@ -926,12 +939,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
926
939
  * Obtém as opções em componentes de pesquisa
927
940
  * Ex.: snk-config-options
928
941
  */
929
- async executeSearch(searchArgument, fieldName, dataUnit) {
942
+ async executeSearch(searchArgument, fieldName, dataUnit, ctxOptions) {
930
943
  const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
931
944
  if (!descriptor) ;
932
945
  else {
933
946
  const { mode, argument } = searchArgument;
934
- const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY } = descriptor.properties;
947
+ const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY, ISHIERARCHYENTITY } = descriptor.properties;
935
948
  const dependencies = descriptor.dependencies;
936
949
  let criteria;
937
950
  const searchOptions = {
@@ -961,7 +974,16 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
961
974
  }
962
975
  }
963
976
  });
964
- return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
977
+ const allowsNonAnalytic = ctxOptions === null || ctxOptions === void 0 ? void 0 : ctxOptions.allowsNonAnalytic;
978
+ const options = {
979
+ entity: ENTITYNAME,
980
+ entityDescription: DESCRIPTIONENTITY,
981
+ isHierarchyEntity: ISHIERARCHYENTITY,
982
+ criteria,
983
+ searchOptions,
984
+ allowsNonAnalytic
985
+ };
986
+ return this.executePreparedSearch(mode, argument, options);
965
987
  }
966
988
  }
967
989
  filterInvalidFields(resp, item, mdByName) {
@@ -1011,13 +1033,19 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1011
1033
  */
1012
1034
  async executePreparedSearch(mode, argument, options) {
1013
1035
  const mdByName = {};
1014
- const { entity, entityDescription, criteria, searchOptions } = options;
1036
+ const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic } = options;
1015
1037
  if (mode === "ADVANCED") {
1016
1038
  return new Promise((accept, reject) => {
1017
1039
  const pesquisaContent = document.createElement("snk-pesquisa");
1018
1040
  pesquisaContent[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
1041
+ pesquisaContent.entityName = entity;
1019
1042
  pesquisaContent.argument = argument;
1020
1043
  pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
1044
+ pesquisaContent.isHierarchyEntity = isHierarchyEntity;
1045
+ if (isHierarchyEntity) {
1046
+ pesquisaContent.treeLoader = (text) => this.pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
1047
+ pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
1048
+ }
1021
1049
  pesquisaContent.selectItem = (option) => {
1022
1050
  accept(option);
1023
1051
  this.clearPopUpTitle();
@@ -1325,8 +1353,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1325
1353
  this._errorHandler = new SnkErrorHandler(this);
1326
1354
  this.messagesBuilder = new SnkMessageBuilder();
1327
1355
  ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
1328
- ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
1329
- return this.executeSearch(searchArgument, fieldName, dataUnit);
1356
+ ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit, ctxOptions) => {
1357
+ return this.executeSearch(searchArgument, fieldName, dataUnit, ctxOptions);
1330
1358
  });
1331
1359
  ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
1332
1360
  this.registerPkChangeListener();
@@ -1340,12 +1368,15 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1340
1368
  this._waitingAppReady.forEach(resolve => resolve());
1341
1369
  }
1342
1370
  connectedCallback() {
1371
+ this._isBrowserTypeElectron = UserAgentUtils.isElectron();
1343
1372
  ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
1344
1373
  DataFetcher.addRequestListener(this._requestListener);
1345
1374
  }
1346
1375
  disconnectedCallback() {
1347
- DataFetcher.removeRequestListener(this._requestListener);
1376
+ DataFetcher === null || DataFetcher === void 0 ? void 0 : DataFetcher.removeRequestListener(this._requestListener);
1348
1377
  this.removeShortcuts();
1378
+ if (this._lockManagerTimer)
1379
+ clearTimeout(this._lockManagerTimer);
1349
1380
  }
1350
1381
  async componentDidLoad() {
1351
1382
  this.applicationLoading.emit(true);
@@ -1357,6 +1388,63 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1357
1388
  ElementIDUtils.addIDInfo(this._element, `resource_${this.applicationResourceID}`);
1358
1389
  await this.handleShowNewVersionPopup();
1359
1390
  this.initKeyboardManager();
1391
+ if (this.enableLockManagerLoadingApp) {
1392
+ LockManager.addLockManagerCtxId(this._element);
1393
+ this.resolveApplicationReady();
1394
+ }
1395
+ else {
1396
+ this._applicationReady = true;
1397
+ }
1398
+ }
1399
+ async markToReload() {
1400
+ if (!this.enableLockManagerLoadingApp)
1401
+ return;
1402
+ this._applicationReady = false;
1403
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1404
+ this.resolveApplicationReady();
1405
+ }
1406
+ async addLoadingLock(forceReady = false) {
1407
+ if (!this.enableLockManagerLoadingApp)
1408
+ return;
1409
+ if (forceReady) {
1410
+ this._applicationReady = false;
1411
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1412
+ }
1413
+ this.resolveApplicationReady();
1414
+ return await LockManager.lock(this._element, LockManagerOperation.APP_LOADING);
1415
+ }
1416
+ async resolveApplicationReady() {
1417
+ if (this._applicationReady) {
1418
+ return;
1419
+ }
1420
+ try {
1421
+ await this.checkTimeoutLimitLockManager();
1422
+ await LockManager.whenHasLock(this._element, LockManagerOperation.APP_LOADING);
1423
+ await LockManager.whenResolve(this._element, LockManagerOperation.APP_LOADING, 1200);
1424
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1425
+ this._applicationReady = true;
1426
+ }
1427
+ catch (error) {
1428
+ console.warn(error);
1429
+ this._applicationReady = true;
1430
+ }
1431
+ }
1432
+ stopTimeoutLockManager() {
1433
+ if (this._lockManagerTimer) {
1434
+ clearTimeout(this._lockManagerTimer);
1435
+ }
1436
+ }
1437
+ async checkTimeoutLimitLockManager() {
1438
+ this.stopTimeoutLockManager();
1439
+ if (this._applicationReady)
1440
+ return;
1441
+ this._lockManagerTimer = setTimeout(async () => {
1442
+ if (!this._applicationReady) {
1443
+ await LockManager.resetLocks(this._element, LockManagerOperation.APP_LOADING);
1444
+ this.stopTimeoutLockManager();
1445
+ this._applicationReady = true;
1446
+ }
1447
+ }, this._maxTimeLockAppLoading);
1360
1448
  }
1361
1449
  initKeyboardManager() {
1362
1450
  this._keyboardManager
@@ -1370,8 +1458,40 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1370
1458
  .unbind("ctrl + d")
1371
1459
  .unbind("F1");
1372
1460
  }
1461
+ // TODO: Etapa 2 - implementar template de loading
1462
+ renderLoadingSkeleton(template) {
1463
+ if (this.enableLockManagerLoadingApp) {
1464
+ if (!this._isBrowserTypeElectron) {
1465
+ switch (template) {
1466
+ case TEMPLATES_LOADING_SKELETON.APPLICATION:
1467
+ case TEMPLATES_LOADING_SKELETON.GRID:
1468
+ return this.getSkeletonTemplateApplication();
1469
+ default:
1470
+ return this.getSkeletonTemplateApplication();
1471
+ }
1472
+ }
1473
+ else {
1474
+ return this.getSpinnerLoadingDefault();
1475
+ }
1476
+ }
1477
+ }
1478
+ getLoadingVisibilityStyle() {
1479
+ return {
1480
+ visibility: this._applicationReady ? "hidden" : "initial",
1481
+ display: this._applicationReady ? "none" : "unset"
1482
+ };
1483
+ }
1484
+ getSkeletonTemplateApplication() {
1485
+ 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" }))));
1486
+ }
1487
+ getSpinnerLoadingDefault() {
1488
+ 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..."))));
1489
+ }
1373
1490
  render() {
1374
- return (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 })));
1491
+ return (h(Host, { style: {
1492
+ visibility: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden",
1493
+ overflow: (!this.enableLockManagerLoadingApp || this._applicationReady) ? "unset" : "hidden"
1494
+ } }, 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())));
1375
1495
  }
1376
1496
  get _element() { return this; }
1377
1497
  static get watchers() { return {
@@ -1379,11 +1499,13 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1379
1499
  }; }
1380
1500
  static get style() { return snkApplicationCss; }
1381
1501
  }, [2, "snk-application", {
1502
+ "enableLockManagerLoadingApp": [4, "enable-lock-manager-loading-app"],
1382
1503
  "messagesBuilder": [1040],
1383
1504
  "configName": [1, "config-name"],
1384
1505
  "gridLegacyConfigName": [1, "grid-legacy-config-name"],
1385
1506
  "formLegacyConfigName": [1, "form-legacy-config-name"],
1386
1507
  "loadByPK": [16],
1508
+ "_applicationReady": [32],
1387
1509
  "getKeyboardManager": [64],
1388
1510
  "isUserSup": [64],
1389
1511
  "addPendingAction": [64],
@@ -1434,7 +1556,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1434
1556
  "executeSelectDistinct": [64],
1435
1557
  "getDataFetcher": [64],
1436
1558
  "whenApplicationReady": [64],
1437
- "setSearchFilterContext": [64]
1559
+ "setSearchFilterContext": [64],
1560
+ "markToReload": [64],
1561
+ "addLoadingLock": [64]
1438
1562
  }]);
1439
1563
  class PendingPromise {
1440
1564
  constructor(resolve, reject) {
@@ -1442,17 +1566,32 @@ class PendingPromise {
1442
1566
  this.reject = reject;
1443
1567
  }
1444
1568
  }
1569
+ var TEMPLATES_LOADING_SKELETON;
1570
+ (function (TEMPLATES_LOADING_SKELETON) {
1571
+ TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["APPLICATION"] = 1] = "APPLICATION";
1572
+ TEMPLATES_LOADING_SKELETON[TEMPLATES_LOADING_SKELETON["GRID"] = 2] = "GRID";
1573
+ })(TEMPLATES_LOADING_SKELETON || (TEMPLATES_LOADING_SKELETON = {}));
1445
1574
  function defineCustomElement() {
1446
1575
  if (typeof customElements === "undefined") {
1447
1576
  return;
1448
1577
  }
1449
- const components = ["snk-application", "snk-pesquisa"];
1578
+ const components = ["snk-application", "pesquisa-grid", "pesquisa-tree", "snk-pesquisa"];
1450
1579
  components.forEach(tagName => { switch (tagName) {
1451
1580
  case "snk-application":
1452
1581
  if (!customElements.get(tagName)) {
1453
1582
  customElements.define(tagName, SnkApplication);
1454
1583
  }
1455
1584
  break;
1585
+ case "pesquisa-grid":
1586
+ if (!customElements.get(tagName)) {
1587
+ defineCustomElement$3();
1588
+ }
1589
+ break;
1590
+ case "pesquisa-tree":
1591
+ if (!customElements.get(tagName)) {
1592
+ defineCustomElement$2();
1593
+ }
1594
+ break;
1456
1595
  case "snk-pesquisa":
1457
1596
  if (!customElements.get(tagName)) {
1458
1597
  defineCustomElement$1();
@@ -1,7 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
3
3
  import { D as DataFetcher } from './DataFetcher.js';
4
- import './pesquisa-fetcher.js';
5
4
  import { S as SaveErrorsEnum } from './ISave.js';
6
5
  import { P as PreloadManager, b as buildLoadDataResponse, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher.js';
7
6
  import './filter-item-type.enum.js';
@@ -9,19 +8,16 @@ import './form-config-fetcher.js';
9
8
  import { V as VIEW_MODE } from './constants.js';
10
9
  import { A as AutorizationType } from './auth-fetcher.js';
11
10
  import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
12
- import { d as defineCustomElement$f } from './snk-actions-button2.js';
13
- import { d as defineCustomElement$e } from './snk-config-options2.js';
14
- import { d as defineCustomElement$d } from './snk-configurator2.js';
15
- import { d as defineCustomElement$c } from './snk-data-exporter2.js';
16
- import { d as defineCustomElement$b } from './snk-data-unit2.js';
17
- import { d as defineCustomElement$a } from './snk-exporter-email-sender2.js';
18
- import { d as defineCustomElement$9 } from './snk-field-config2.js';
19
- import { d as defineCustomElement$8 } from './snk-form-config2.js';
11
+ import { d as defineCustomElement$c } from './snk-actions-button2.js';
12
+ import { d as defineCustomElement$b } from './snk-configurator2.js';
13
+ import { d as defineCustomElement$a } from './snk-data-exporter2.js';
14
+ import { d as defineCustomElement$9 } from './snk-data-unit2.js';
15
+ import { d as defineCustomElement$8 } from './snk-exporter-email-sender2.js';
20
16
  import { d as defineCustomElement$7 } from './snk-grid-config2.js';
21
17
  import { d as defineCustomElement$6 } from './snk-select-box2.js';
22
18
  import { d as defineCustomElement$5 } from './snk-simple-bar2.js';
23
19
  import { d as defineCustomElement$4 } from './snk-simple-crud2.js';
24
- import { d as defineCustomElement$3 } from './snk-tab-config2.js';
20
+ import { d as defineCustomElement$3 } from './snk-simple-form-config2.js';
25
21
  import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
26
22
 
27
23
  const SERVICE$1 = {
@@ -557,14 +553,18 @@ const buildTaskBarManager = () => {
557
553
  ];
558
554
  return {
559
555
  getButtons: (_, dataState, currentButtons) => {
560
- if ((dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty))
556
+ const refreshBtnIndex = currentButtons.indexOf(TaskbarElement.REFRESH);
557
+ if ((dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty)) {
561
558
  return currentButtons.reverse();
562
- else
563
- currentButtons.splice(currentButtons.indexOf(TaskbarElement.REFRESH), 1);
559
+ }
560
+ else if (refreshBtnIndex !== -1) {
561
+ currentButtons.splice(refreshBtnIndex, 1);
562
+ }
564
563
  const { selectedRecord } = dataState || {};
565
564
  const taskbarTobeAdded = !!(selectedRecord === null || selectedRecord === void 0 ? void 0 : selectedRecord.LINK) ? TaskbarAttachButtons.LINK : TaskbarAttachButtons.DOWNLOAD;
566
565
  currentButtons.splice(currentButtons.indexOf(TaskbarElement.DIVIDER) + 1, 0, TaskbarElement.REMOVE, taskbarTobeAdded, TaskbarElement.DIVIDER);
567
- const updatedButtons = Array.from(new Set(currentButtons.filter(button => button !== TaskbarElement.CLONE)));
566
+ const buttonsToRemove = [TaskbarElement.CLONE, TaskbarElement.DATA_EXPORTER];
567
+ const updatedButtons = Array.from(new Set(currentButtons.filter((button) => !buttonsToRemove.includes(button))));
568
568
  updatedButtons.splice(updatedButtons.indexOf(taskbarTobeAdded) + 1, 0, TaskbarElement.DIVIDER);
569
569
  return updatedButtons;
570
570
  },
@@ -869,7 +869,7 @@ function defineCustomElement() {
869
869
  if (typeof customElements === "undefined") {
870
870
  return;
871
871
  }
872
- const components = ["snk-attach", "snk-actions-button", "snk-config-options", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-field-config", "snk-form-config", "snk-grid-config", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-tab-config", "snk-taskbar", "taskbar-actions-button"];
872
+ const components = ["snk-attach", "snk-actions-button", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-grid-config", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-simple-form-config", "snk-taskbar", "taskbar-actions-button"];
873
873
  components.forEach(tagName => { switch (tagName) {
874
874
  case "snk-attach":
875
875
  if (!customElements.get(tagName)) {
@@ -877,41 +877,26 @@ function defineCustomElement() {
877
877
  }
878
878
  break;
879
879
  case "snk-actions-button":
880
- if (!customElements.get(tagName)) {
881
- defineCustomElement$f();
882
- }
883
- break;
884
- case "snk-config-options":
885
- if (!customElements.get(tagName)) {
886
- defineCustomElement$e();
887
- }
888
- break;
889
- case "snk-configurator":
890
- if (!customElements.get(tagName)) {
891
- defineCustomElement$d();
892
- }
893
- break;
894
- case "snk-data-exporter":
895
880
  if (!customElements.get(tagName)) {
896
881
  defineCustomElement$c();
897
882
  }
898
883
  break;
899
- case "snk-data-unit":
884
+ case "snk-configurator":
900
885
  if (!customElements.get(tagName)) {
901
886
  defineCustomElement$b();
902
887
  }
903
888
  break;
904
- case "snk-exporter-email-sender":
889
+ case "snk-data-exporter":
905
890
  if (!customElements.get(tagName)) {
906
891
  defineCustomElement$a();
907
892
  }
908
893
  break;
909
- case "snk-field-config":
894
+ case "snk-data-unit":
910
895
  if (!customElements.get(tagName)) {
911
896
  defineCustomElement$9();
912
897
  }
913
898
  break;
914
- case "snk-form-config":
899
+ case "snk-exporter-email-sender":
915
900
  if (!customElements.get(tagName)) {
916
901
  defineCustomElement$8();
917
902
  }
@@ -936,7 +921,7 @@ function defineCustomElement() {
936
921
  defineCustomElement$4();
937
922
  }
938
923
  break;
939
- case "snk-tab-config":
924
+ case "snk-simple-form-config":
940
925
  if (!customElements.get(tagName)) {
941
926
  defineCustomElement$3();
942
927
  }