@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-74246.1 → 0.0.0-bugfix-dev-KB-74224.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 (145) hide show
  1. package/dist/cjs/{ConfigStorage-f079f5fd.js → ConfigStorage-ecc0ed20.js} +2 -2
  2. package/dist/cjs/{ContinuousInsertUtils-64e47516.js → ContinuousInsertUtils-29b65619.js} +20 -29
  3. package/dist/cjs/{DataFetcher-e059eb72.js → DataFetcher-cadeef8e.js} +5 -7
  4. package/dist/cjs/{SnkFormConfigManager-bff848f1.js → SnkFormConfigManager-f1c92f79.js} +5 -5
  5. package/dist/cjs/{auth-fetcher-4f853233.js → auth-fetcher-d68841bc.js} +1 -1
  6. package/dist/cjs/{dataunit-fetcher-228016f4.js → dataunit-fetcher-f89461c1.js} +3 -3
  7. package/dist/cjs/{form-config-fetcher-39397ac5.js → form-config-fetcher-ed497282.js} +1 -1
  8. package/dist/cjs/index-f9e81701.js +28 -8
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-a9bfeb22.js → pesquisa-fetcher-ca89181c.js} +2 -7
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button_4.cjs.entry.js +30 -27
  13. package/dist/cjs/snk-application.cjs.entry.js +59 -101
  14. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  15. package/dist/cjs/snk-config-options.cjs.entry.js +239 -0
  16. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  18. package/dist/cjs/{snk-data-unit-3d4d0e2a.js → snk-data-unit-668dc5e8.js} +1 -1
  19. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  20. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  21. package/dist/cjs/{snk-filter-bar_4.cjs.entry.js → snk-filter-bar.cjs.entry.js} +3 -688
  22. package/dist/cjs/snk-filter-item.cjs.entry.js +312 -0
  23. package/dist/cjs/snk-filter-list.cjs.entry.js +152 -0
  24. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  25. package/dist/cjs/snk-filter-modal.cjs.entry.js +249 -0
  26. package/dist/cjs/{snk-config-options_3.cjs.entry.js → snk-form-config.cjs.entry.js} +3 -365
  27. package/dist/cjs/snk-form.cjs.entry.js +144 -0
  28. package/dist/cjs/snk-grid.cjs.entry.js +6 -6
  29. package/dist/cjs/{snk-guides-viewer-2b44c804.js → snk-guides-viewer-4236cb9d.js} +5 -8
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  32. package/dist/cjs/snk-simple-crud.cjs.entry.js +14 -14
  33. package/dist/collection/collection-manifest.json +31 -11
  34. package/dist/collection/components/snk-actions-button/interfaces/index.js +1 -0
  35. package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -26
  36. package/dist/collection/components/snk-application/snk-application.js +53 -3
  37. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +0 -3
  38. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +3 -3
  39. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +7 -7
  40. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +6 -8
  41. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
  42. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -6
  43. package/dist/collection/lib/utils/CrudUtils.js +16 -25
  44. package/dist/components/ContinuousInsertUtils.js +16 -25
  45. package/dist/components/DataFetcher.js +5 -7
  46. package/dist/components/SnkFormConfigManager.js +3 -3
  47. package/dist/components/dataunit-fetcher.js +2 -2
  48. package/dist/components/pesquisa-fetcher.js +1 -6
  49. package/dist/components/snk-actions-button2.js +27 -26
  50. package/dist/components/snk-application2.js +53 -95
  51. package/dist/components/snk-detail-view2.js +0 -3
  52. package/dist/components/snk-simple-crud2.js +7 -7
  53. package/dist/esm/{ConfigStorage-6514d66e.js → ConfigStorage-7b36d041.js} +2 -2
  54. package/dist/esm/{ContinuousInsertUtils-b62906f9.js → ContinuousInsertUtils-30caa626.js} +20 -29
  55. package/dist/esm/{DataFetcher-5034df59.js → DataFetcher-a9c598f2.js} +5 -7
  56. package/dist/esm/{SnkFormConfigManager-f0532f7d.js → SnkFormConfigManager-139f09fa.js} +6 -6
  57. package/dist/esm/{auth-fetcher-ca5d3a49.js → auth-fetcher-749d880f.js} +1 -1
  58. package/dist/esm/{constants-7302ee87.js → constants-8457af36.js} +1 -1
  59. package/dist/esm/{dataunit-fetcher-56cb648b.js → dataunit-fetcher-c24c76c6.js} +3 -3
  60. package/dist/esm/{form-config-fetcher-a7d3e277.js → form-config-fetcher-adbe5d34.js} +1 -1
  61. package/dist/esm/index-a7d3d3f1.js +28 -8
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/{pesquisa-fetcher-6bc2e41a.js → pesquisa-fetcher-8edaa8cd.js} +2 -7
  64. package/dist/esm/sankhyablocks.js +1 -1
  65. package/dist/esm/snk-actions-button_4.entry.js +32 -29
  66. package/dist/esm/snk-application.entry.js +59 -101
  67. package/dist/esm/snk-attach.entry.js +6 -6
  68. package/dist/esm/snk-config-options.entry.js +235 -0
  69. package/dist/esm/snk-configurator.entry.js +1 -1
  70. package/dist/esm/snk-crud.entry.js +6 -6
  71. package/dist/esm/snk-data-exporter.entry.js +6 -6
  72. package/dist/esm/{snk-data-unit-618e0b80.js → snk-data-unit-0fdfb6c2.js} +1 -1
  73. package/dist/esm/snk-data-unit.entry.js +3 -3
  74. package/dist/esm/snk-detail-view.entry.js +8 -8
  75. package/dist/esm/snk-field-config.entry.js +1 -1
  76. package/dist/esm/{snk-filter-bar_4.entry.js → snk-filter-bar.entry.js} +5 -687
  77. package/dist/esm/snk-filter-item.entry.js +308 -0
  78. package/dist/esm/snk-filter-list.entry.js +148 -0
  79. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  80. package/dist/esm/snk-filter-modal.entry.js +245 -0
  81. package/dist/esm/{snk-config-options_3.entry.js → snk-form-config.entry.js} +6 -366
  82. package/dist/esm/snk-form.entry.js +140 -0
  83. package/dist/esm/snk-grid.entry.js +6 -6
  84. package/dist/esm/{snk-guides-viewer-15c916a3.js → snk-guides-viewer-8934c537.js} +6 -9
  85. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  86. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  87. package/dist/esm/snk-simple-crud.entry.js +15 -15
  88. package/dist/esm/snk-tab-config.entry.js +1 -1
  89. package/dist/sankhyablocks/p-01086ff7.entry.js +1 -0
  90. package/dist/sankhyablocks/{p-126c58ea.js → p-06421fdb.js} +1 -1
  91. package/dist/sankhyablocks/{p-ae50d69f.js → p-16869f77.js} +1 -1
  92. package/dist/sankhyablocks/{p-341465ce.js → p-1bf06cd3.js} +2 -2
  93. package/dist/sankhyablocks/{p-aa003d4e.entry.js → p-212213d9.entry.js} +1 -1
  94. package/dist/sankhyablocks/p-2923c1b5.js +1 -0
  95. package/dist/sankhyablocks/p-3b60db06.entry.js +1 -0
  96. package/dist/sankhyablocks/{p-9c3138f5.entry.js → p-430e4d3c.entry.js} +1 -1
  97. package/dist/sankhyablocks/{p-9ffd9fc7.js → p-4d9549cf.js} +1 -1
  98. package/dist/sankhyablocks/p-4f35399c.entry.js +1 -0
  99. package/dist/sankhyablocks/{p-a75e9dcc.js → p-5dd8cf4f.js} +1 -1
  100. package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
  101. package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
  102. package/dist/sankhyablocks/{p-41793e17.entry.js → p-7663f597.entry.js} +1 -1
  103. package/dist/sankhyablocks/{p-47d24ac8.js → p-7ac7932c.js} +2 -2
  104. package/dist/sankhyablocks/{p-2d3f9482.entry.js → p-8eb67fa4.entry.js} +1 -1
  105. package/dist/sankhyablocks/{p-f0aaad2b.entry.js → p-92eadb1c.entry.js} +1 -1
  106. package/dist/sankhyablocks/{p-8b4fc28f.entry.js → p-95df461f.entry.js} +1 -1
  107. package/dist/sankhyablocks/p-a42e7a1e.entry.js +11 -0
  108. package/dist/sankhyablocks/p-a724e798.entry.js +1 -0
  109. package/dist/sankhyablocks/{p-1dbd5c18.entry.js → p-a75d242d.entry.js} +1 -1
  110. package/dist/sankhyablocks/p-afbb070d.js +1 -0
  111. package/dist/sankhyablocks/{p-95ce311a.js → p-b0ef4383.js} +1 -1
  112. package/dist/sankhyablocks/p-b9679243.entry.js +1 -0
  113. package/dist/sankhyablocks/{p-c1adf0dd.entry.js → p-b9c67e45.entry.js} +1 -1
  114. package/dist/sankhyablocks/{p-e41bd8ee.entry.js → p-be5d8fcb.entry.js} +1 -1
  115. package/dist/sankhyablocks/p-ca5ec380.js +1 -0
  116. package/dist/sankhyablocks/p-d3f53df2.entry.js +1 -0
  117. package/dist/sankhyablocks/{p-a2c790ac.entry.js → p-dcead955.entry.js} +1 -1
  118. package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
  119. package/dist/sankhyablocks/{p-00278e07.js → p-f3434fc4.js} +1 -1
  120. package/dist/sankhyablocks/{p-fca0e5cc.entry.js → p-fb34e0cf.entry.js} +1 -1
  121. package/dist/sankhyablocks/p-feba9d4b.entry.js +1 -0
  122. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  123. package/dist/types/components/snk-actions-button/interfaces/index.d.ts +3 -0
  124. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +3 -2
  125. package/dist/types/components/snk-application/snk-application.d.ts +12 -3
  126. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -0
  127. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +0 -1
  128. package/dist/types/lib/utils/CrudUtils.d.ts +0 -1
  129. package/package.json +2 -3
  130. package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +0 -28
  131. package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js +0 -16
  132. package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js +0 -52
  133. package/dist/collection/sw.js +0 -46
  134. package/dist/sankhyablocks/p-3858a2e4.entry.js +0 -1
  135. package/dist/sankhyablocks/p-563b7c28.entry.js +0 -1
  136. package/dist/sankhyablocks/p-a0ebd886.js +0 -1
  137. package/dist/sankhyablocks/p-aaf94476.js +0 -1
  138. package/dist/sankhyablocks/p-bab79110.entry.js +0 -1
  139. package/dist/sankhyablocks/p-c88ad28e.entry.js +0 -1
  140. package/dist/sankhyablocks/p-d1da52e1.entry.js +0 -1
  141. package/dist/sankhyablocks/p-da87e42c.entry.js +0 -11
  142. package/dist/sankhyablocks/p-e4391e16.js +0 -1
  143. package/dist/types/components/snk-application/request-listener/DebouncedRequestListener.d.ts +0 -11
  144. package/dist/types/components/snk-application/request-listener/RequestListenerFactory.d.ts +0 -12
  145. package/dist/types/components/snk-application/request-listener/RequestListenerLoadingBar.d.ts +0 -13
@@ -0,0 +1,144 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-f9e81701.js');
6
+ const core = require('@sankhyalabs/core');
7
+ const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
8
+ const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
9
+ require('./ConfigStorage-ecc0ed20.js');
10
+ require('./form-config-fetcher-ed497282.js');
11
+ require('./DataFetcher-cadeef8e.js');
12
+ require('./PrintUtils-bcaeb82f.js');
13
+ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
+ require('./filter-item-type.enum-a7ffdaa6.js');
15
+ require('./constants-35ddd366.js');
16
+
17
+ const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
18
+
19
+ const SnkForm = class {
20
+ constructor(hostRef) {
21
+ index.registerInstance(this, hostRef);
22
+ this.exit = index.createEvent(this, "exit", 7);
23
+ this.actionClick = index.createEvent(this, "actionClick", 7);
24
+ this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
25
+ this._customEditors = new Map();
26
+ this._dataUnit = undefined;
27
+ this._dataState = undefined;
28
+ this._showFormConfig = false;
29
+ this._configManager = undefined;
30
+ this.configName = undefined;
31
+ this.recordsValidator = undefined;
32
+ this.messagesBuilder = undefined;
33
+ this.formLegacyConfigName = undefined;
34
+ this.resourceID = undefined;
35
+ }
36
+ /**
37
+ * Exibe a janela de configurações do formulário.
38
+ */
39
+ async showConfig() {
40
+ this._showFormConfig = true;
41
+ }
42
+ /**
43
+ * Fecha a janela de configurações do formulário.
44
+ */
45
+ async hideConfig() {
46
+ this._showFormConfig = false;
47
+ }
48
+ /**
49
+ * Registra um editor customizado para campos da grade e formulário.
50
+ */
51
+ async addCustomEditor(fieldName, customEditor) {
52
+ if (this._form) {
53
+ this._form.addCustomEditor(fieldName, customEditor);
54
+ return;
55
+ }
56
+ const newCustomEditors = new Map(this._customEditors);
57
+ newCustomEditors.set(fieldName, customEditor);
58
+ this._customEditors = newCustomEditors;
59
+ }
60
+ /**
61
+ * Altera/adiciona uma propriedade nos metadados do campo.
62
+ */
63
+ async setFieldProp(fieldName, propName, value) {
64
+ await this._form.setFieldProp(fieldName, propName, value);
65
+ }
66
+ closeConfig() {
67
+ this.hideConfig();
68
+ }
69
+ dataunitReady() {
70
+ const dataInfo = { dataUnit: this._dataUnit };
71
+ core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
72
+ }
73
+ setCustomEditors() {
74
+ if (!this._form) {
75
+ return;
76
+ }
77
+ for (const [fieldName, customEditor] of this._customEditors) {
78
+ this._form.addCustomEditor(fieldName, customEditor);
79
+ this._customEditors.delete(fieldName);
80
+ }
81
+ }
82
+ async componentDidRender() {
83
+ this.setCustomEditors();
84
+ }
85
+ async componentWillLoad() {
86
+ let parent = this._element.parentElement;
87
+ while (parent) {
88
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
89
+ this._snkDataUnit = parent;
90
+ this._dataUnit = this._snkDataUnit.dataUnit;
91
+ this._dataState = this._snkDataUnit.dataState;
92
+ if (this._dataUnit) {
93
+ this.dataunitReady();
94
+ }
95
+ else {
96
+ this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
97
+ this._dataUnit = evt.detail;
98
+ });
99
+ }
100
+ this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
101
+ break;
102
+ }
103
+ parent = parent.parentElement;
104
+ }
105
+ if (this.resourceID == undefined) {
106
+ this.resourceID = await ResourceIDUtils.ResourceIDUtils.getResourceID();
107
+ }
108
+ this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
109
+ this.addFormLegacyConfig();
110
+ await this._configManager.loadConfig();
111
+ }
112
+ async handleDataStateChange(evt) {
113
+ var _a;
114
+ this._dataState = evt.detail;
115
+ const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
116
+ for (const field of fieldsWithRmPrecision || []) {
117
+ if (!field) {
118
+ continue;
119
+ }
120
+ const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
121
+ if (!rmPrecision && rmPrecision !== 0) {
122
+ continue;
123
+ }
124
+ await this.setFieldProp(field, 'precision', rmPrecision);
125
+ await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
126
+ }
127
+ }
128
+ addFormLegacyConfig() {
129
+ if (this.formLegacyConfigName) {
130
+ this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
131
+ }
132
+ }
133
+ render() {
134
+ if (!this._dataUnit || !this._dataState) {
135
+ return undefined;
136
+ }
137
+ return (index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
138
+ index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
139
+ }
140
+ get _element() { return index.getElement(this); }
141
+ };
142
+ SnkForm.style = snkFormCss;
143
+
144
+ exports.snk_form = SnkForm;
@@ -5,20 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
8
- const ConfigStorage = require('./ConfigStorage-f079f5fd.js');
8
+ const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
9
9
  const index$1 = require('./index-1dfc7a6e.js');
10
10
  const fieldSearch = require('./field-search-68e34bf4.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
- const ContinuousInsertUtils = require('./ContinuousInsertUtils-64e47516.js');
12
+ const ContinuousInsertUtils = require('./ContinuousInsertUtils-29b65619.js');
13
13
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
14
- require('./DataFetcher-e059eb72.js');
15
- require('./pesquisa-fetcher-a9bfeb22.js');
14
+ require('./DataFetcher-cadeef8e.js');
15
+ require('./pesquisa-fetcher-ca89181c.js');
16
16
  require('./ISave-e91b70a7.js');
17
17
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
18
18
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
19
- require('./dataunit-fetcher-228016f4.js');
19
+ require('./dataunit-fetcher-f89461c1.js');
20
20
  require('./filter-item-type.enum-a7ffdaa6.js');
21
- require('./form-config-fetcher-39397ac5.js');
21
+ require('./form-config-fetcher-ed497282.js');
22
22
  const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
23
23
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
24
24
  require('./PrintUtils-bcaeb82f.js');
@@ -2,20 +2,20 @@
2
2
 
3
3
  const index = require('./index-f9e81701.js');
4
4
  const core = require('@sankhyalabs/core');
5
- const SnkFormConfigManager = require('./SnkFormConfigManager-bff848f1.js');
5
+ const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const fieldSearch = require('./field-search-68e34bf4.js');
8
8
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
9
9
  const constants = require('./constants-35ddd366.js');
10
- require('./DataFetcher-e059eb72.js');
11
- require('./pesquisa-fetcher-a9bfeb22.js');
10
+ require('./DataFetcher-cadeef8e.js');
11
+ require('./pesquisa-fetcher-ca89181c.js');
12
12
  const index$1 = require('./index-1dfc7a6e.js');
13
13
  require('./ISave-e91b70a7.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
16
- require('./dataunit-fetcher-228016f4.js');
16
+ require('./dataunit-fetcher-f89461c1.js');
17
17
  require('./filter-item-type.enum-a7ffdaa6.js');
18
- require('./form-config-fetcher-39397ac5.js');
18
+ require('./form-config-fetcher-ed497282.js');
19
19
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
20
20
 
21
21
  const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
@@ -455,9 +455,6 @@ const SnkGuidesViewer = class {
455
455
  await this.addErrorBadgeToGuide(guideName);
456
456
  await this.openGuideNavigator(guideName);
457
457
  }
458
- if (action.type === core.Action.METADATA_LOADED) {
459
- this.loadGuides(false);
460
- }
461
458
  }
462
459
  async addErrorBadgeToGuide(guideName) {
463
460
  var _a;
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-2b44c804.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-4236cb9d.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
- require('./SnkFormConfigManager-bff848f1.js');
9
- require('./ConfigStorage-f079f5fd.js');
10
- require('./form-config-fetcher-39397ac5.js');
11
- require('./DataFetcher-e059eb72.js');
8
+ require('./SnkFormConfigManager-f1c92f79.js');
9
+ require('./ConfigStorage-ecc0ed20.js');
10
+ require('./form-config-fetcher-ed497282.js');
11
+ require('./DataFetcher-cadeef8e.js');
12
12
  require('./PrintUtils-bcaeb82f.js');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
14
  require('./filter-item-type.enum-a7ffdaa6.js');
@@ -18,10 +18,10 @@ require('./field-search-68e34bf4.js');
18
18
  require('./taskbar-elements-9ad1f9c0.js');
19
19
  require('./index-1dfc7a6e.js');
20
20
  require('./index-102ba62d.js');
21
- require('./pesquisa-fetcher-a9bfeb22.js');
21
+ require('./pesquisa-fetcher-ca89181c.js');
22
22
  require('./ISave-e91b70a7.js');
23
23
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
24
- require('./dataunit-fetcher-228016f4.js');
24
+ require('./dataunit-fetcher-f89461c1.js');
25
25
  require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
26
26
  require('@sankhyalabs/core/dist/utils/SortingUtils');
27
27
  require('./ResourceIDUtils-5ff86aa7.js');
@@ -5,13 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
8
- const ConfigStorage = require('./ConfigStorage-f079f5fd.js');
8
+ const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
9
9
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
10
10
  const index$1 = require('./index-c5771aba.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
12
  require('./filter-item-type.enum-a7ffdaa6.js');
13
- require('./form-config-fetcher-39397ac5.js');
14
- require('./DataFetcher-e059eb72.js');
13
+ require('./form-config-fetcher-ed497282.js');
14
+ require('./DataFetcher-cadeef8e.js');
15
15
  require('./PrintUtils-bcaeb82f.js');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
17
 
@@ -7,19 +7,19 @@ const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const constants = require('./constants-35ddd366.js');
9
9
  const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
10
- require('./DataFetcher-e059eb72.js');
11
- require('./pesquisa-fetcher-a9bfeb22.js');
12
- const ContinuousInsertUtils = require('./ContinuousInsertUtils-64e47516.js');
10
+ require('./DataFetcher-cadeef8e.js');
11
+ require('./pesquisa-fetcher-ca89181c.js');
12
+ const ContinuousInsertUtils = require('./ContinuousInsertUtils-29b65619.js');
13
13
  const index = require('./index-1dfc7a6e.js');
14
14
  require('./ISave-e91b70a7.js');
15
15
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
- const dataunitFetcher = require('./dataunit-fetcher-228016f4.js');
17
+ const dataunitFetcher = require('./dataunit-fetcher-f89461c1.js');
18
18
  require('./filter-item-type.enum-a7ffdaa6.js');
19
- const formConfigFetcher = require('./form-config-fetcher-39397ac5.js');
19
+ const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
20
20
  const fieldSearch = require('./field-search-68e34bf4.js');
21
- const ConfigStorage = require('./ConfigStorage-f079f5fd.js');
22
- const SnkFormConfigManager = require('./SnkFormConfigManager-bff848f1.js');
21
+ const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
22
+ const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
23
23
  const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
24
24
  const index$2 = require('./index-102ba62d.js');
25
25
  require('./PrintUtils-bcaeb82f.js');
@@ -724,11 +724,9 @@ const SnkSimpleCrud = class {
724
724
  window.removeEventListener("keydown", this._keyDownHandler);
725
725
  }
726
726
  gridConfigChangeHandler(evt) {
727
- evt.stopPropagation();
728
- if (!this.configName)
729
- return;
730
727
  const config = evt.detail;
731
728
  ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
729
+ evt.stopPropagation();
732
730
  }
733
731
  modalConfigChangeHandler(evt) {
734
732
  const config = evt.detail;
@@ -805,16 +803,18 @@ const SnkSimpleCrud = class {
805
803
  return;
806
804
  this.goToView(constants.VIEW_MODE.FORM);
807
805
  }
806
+ renderTaskbarContent() {
807
+ var _a;
808
+ return (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
809
+ }
808
810
  /* istanbul ignore next */
809
811
  render() {
810
- var _a;
811
812
  if (this.dataUnit == undefined) {
812
813
  return;
813
814
  }
814
- const taskbarContent = (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
815
- return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID && !this.enableGridInsert, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, this._currentViewMode === constants.VIEW_MODE.FORM && taskbarContent, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
815
+ return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID && !this.enableGridInsert, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
816
816
  ? undefined
817
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this._currentViewMode === constants.VIEW_MODE.GRID && taskbarContent, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
817
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this.renderTaskbarContent(), index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, this.renderTaskbarContent(), index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
818
818
  }
819
819
  get _element() { return index$1.getElement(this); }
820
820
  static get watchers() { return {
@@ -65,6 +65,21 @@
65
65
  "snk-application"
66
66
  ]
67
67
  },
68
+ {
69
+ "components": [
70
+ "snk-form"
71
+ ]
72
+ },
73
+ {
74
+ "components": [
75
+ "snk-form-config"
76
+ ]
77
+ },
78
+ {
79
+ "components": [
80
+ "snk-config-options"
81
+ ]
82
+ },
68
83
  {
69
84
  "components": [
70
85
  "snk-tab-config"
@@ -117,37 +132,42 @@
117
132
  },
118
133
  {
119
134
  "components": [
120
- "snk-field-config"
135
+ "snk-filter-bar"
121
136
  ]
122
137
  },
123
138
  {
124
139
  "components": [
125
- "snk-grid"
140
+ "snk-filter-item"
126
141
  ]
127
142
  },
128
143
  {
129
144
  "components": [
130
- "snk-pesquisa"
145
+ "snk-filter-list"
131
146
  ]
132
147
  },
133
148
  {
134
149
  "components": [
135
- "snk-taskbar"
150
+ "snk-filter-modal"
136
151
  ]
137
152
  },
138
153
  {
139
154
  "components": [
140
- "snk-config-options",
141
- "snk-form",
142
- "snk-form-config"
155
+ "snk-field-config"
143
156
  ]
144
157
  },
145
158
  {
146
159
  "components": [
147
- "snk-filter-bar",
148
- "snk-filter-item",
149
- "snk-filter-list",
150
- "snk-filter-modal"
160
+ "snk-grid"
161
+ ]
162
+ },
163
+ {
164
+ "components": [
165
+ "snk-pesquisa"
166
+ ]
167
+ },
168
+ {
169
+ "components": [
170
+ "snk-taskbar"
151
171
  ]
152
172
  }
153
173
  ]
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from '@stencil/core';
2
- import { ApplicationContext, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
2
+ import { ApplicationContext, ArrayUtils, ElementIDUtils, ServiceUtils, StorageType } from '@sankhyalabs/core';
3
3
  import { DataFetcher } from '../../lib/http/data-fetcher/DataFetcher';
4
4
  import ExecutorFactory from './actions/factory/executor.factory';
5
5
  import Actions from './actions';
@@ -8,6 +8,7 @@ import ResourceIDUtils from '../../lib/resourceid/ResourceIDUtils';
8
8
  export class SnkActionsButton {
9
9
  constructor() {
10
10
  this.CLIENT_EVENT_CONFIRM_NAME = "br.com.sankhya.actionbutton.clientconfirm";
11
+ this._actions = [];
11
12
  this.handleClick = (evt) => {
12
13
  const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
13
14
  const executor = new ExecutorFactory(selectedAction.type).executor;
@@ -17,27 +18,22 @@ export class SnkActionsButton {
17
18
  };
18
19
  this._items = [];
19
20
  this._showDropdown = false;
20
- this._actions = [];
21
- this._isOrderActions = false;
22
21
  }
23
22
  async getActions() {
24
- let param = {
25
- param: {
26
- entityName: this._entityName,
27
- resourceID: this._resourceID
28
- }
29
- };
30
- return DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param).then((result) => {
23
+ const actions = await ServiceUtils.useCacheWithService(`SnkActionsButton_${this._entityName}-${this._resourceID}`, async () => {
31
24
  var _a;
32
- if (!((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action))
33
- return;
34
- if (this._isOrderActions) {
35
- this._actions = ArrayUtils.sortAlphabetically(result.actions.action, 'description');
36
- }
37
- else {
38
- this._actions = result.actions.action;
39
- }
40
- });
25
+ const param = {
26
+ param: {
27
+ entityName: this._entityName,
28
+ resourceID: this._resourceID,
29
+ },
30
+ };
31
+ const result = await DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param);
32
+ return ((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action) || [];
33
+ }, StorageType.SESSION_STORAGE);
34
+ this._actions = SnkActionsButton.parameters.isOrderActions
35
+ ? ArrayUtils.sortAlphabetically(actions, 'description')
36
+ : actions;
41
37
  }
42
38
  controlDropdown() {
43
39
  this._showDropdown = !this._showDropdown;
@@ -70,7 +66,7 @@ export class SnkActionsButton {
70
66
  }
71
67
  async componentWillLoad() {
72
68
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
73
- this._isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
69
+ await this.loadParameters();
74
70
  const snkDataUnit = this._element.parentElement;
75
71
  this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
76
72
  this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
@@ -79,9 +75,8 @@ export class SnkActionsButton {
79
75
  this._resourceID = await ResourceIDUtils.getResourceID();
80
76
  }
81
77
  this.setEvents();
82
- this.getActions().then(() => {
83
- this.loadItems();
84
- });
78
+ await this.getActions();
79
+ this.loadItems();
85
80
  }
86
81
  async componentDidLoad() {
87
82
  if (!this._element)
@@ -108,6 +103,11 @@ export class SnkActionsButton {
108
103
  [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
109
104
  };
110
105
  }
106
+ async loadParameters() {
107
+ if (SnkActionsButton.parameters.isOrderActions != null)
108
+ return;
109
+ SnkActionsButton.parameters.isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
110
+ }
111
111
  render() {
112
112
  return (h(Host, null, (this._actions && this._actions.length > 0) &&
113
113
  (h("div", { class: `ez-padding-left--medium snk-actions-button
@@ -134,10 +134,11 @@ export class SnkActionsButton {
134
134
  static get states() {
135
135
  return {
136
136
  "_items": {},
137
- "_showDropdown": {},
138
- "_actions": {},
139
- "_isOrderActions": {}
137
+ "_showDropdown": {}
140
138
  };
141
139
  }
142
140
  static get elementRef() { return "_element"; }
143
141
  }
142
+ SnkActionsButton.parameters = {
143
+ isOrderActions: null
144
+ };
@@ -15,7 +15,6 @@ import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
15
15
  import UrlUtils from "../../lib/utils/urlutils";
16
16
  import Workspace from "../../lib/workspace/workspace";
17
17
  import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
18
- import RequestListenerFactory from "./request-listener/RequestListenerFactory";
19
18
  /**
20
19
  * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
21
20
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
@@ -29,7 +28,7 @@ export class SnkApplication {
29
28
  this._waitingAppReady = new Array();
30
29
  this._duCache = new Map();
31
30
  this._duPromises = new Map();
32
- this._requestListener = RequestListenerFactory.create({ strategy: 'request_time' });
31
+ this._requestListener = new RequestListenerLoadingBar();
33
32
  this._pendingActions = new Map;
34
33
  this._loadPkParameter = null;
35
34
  this._isLoadedByPk = false;
@@ -1005,7 +1004,7 @@ export class SnkApplication {
1005
1004
  .unbind("F1");
1006
1005
  }
1007
1006
  render() {
1008
- 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 })));
1007
+ return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = 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 })));
1009
1008
  }
1010
1009
  static get is() { return "snk-application"; }
1011
1010
  static get encapsulation() { return "scoped"; }
@@ -2514,6 +2513,57 @@ export class SnkApplication {
2514
2513
  }];
2515
2514
  }
2516
2515
  }
2516
+ class RequestListenerLoadingBar {
2517
+ constructor() {
2518
+ this._debounceTime = 1000;
2519
+ this._ignoredNameTypes = ["totals"];
2520
+ this._countRequest = 0;
2521
+ }
2522
+ onRequestStart(param) {
2523
+ if (this.isIgnoreLoadingOnRequest(param)) {
2524
+ return;
2525
+ }
2526
+ this._countRequest++;
2527
+ this.loadingBar.show();
2528
+ if (this._timerLoading) {
2529
+ clearTimeout(this._timerLoading);
2530
+ }
2531
+ }
2532
+ ;
2533
+ onRequestEnd(param) {
2534
+ if (this.isIgnoreLoadingOnRequest(param)) {
2535
+ return;
2536
+ }
2537
+ this._countRequest--;
2538
+ this._timerLoading = setTimeout(() => {
2539
+ if (this._countRequest <= 0) {
2540
+ this.loadingBar.hide();
2541
+ }
2542
+ }, this._debounceTime);
2543
+ }
2544
+ ;
2545
+ isIgnoreLoadingOnRequest(param) {
2546
+ if (param == undefined) {
2547
+ return false;
2548
+ }
2549
+ if (param.url.includes("quietMode=true")) {
2550
+ return true;
2551
+ }
2552
+ if (param.requestBody == undefined) {
2553
+ return false;
2554
+ }
2555
+ if (param.requestBody.length == 1) {
2556
+ const { name } = param.requestBody[0].variables;
2557
+ if (name) {
2558
+ const nameParts = name.split(":");
2559
+ const nameType = nameParts[0];
2560
+ return this._ignoredNameTypes.indexOf(nameType) >= 0;
2561
+ }
2562
+ }
2563
+ return false;
2564
+ }
2565
+ ;
2566
+ }
2517
2567
  class PendingPromise {
2518
2568
  constructor(resolve, reject) {
2519
2569
  this.resolve = resolve;
@@ -439,9 +439,6 @@ export class SnkGuidesViewer {
439
439
  await this.addErrorBadgeToGuide(guideName);
440
440
  await this.openGuideNavigator(guideName);
441
441
  }
442
- if (action.type === DUAction.METADATA_LOADED) {
443
- this.loadGuides(false);
444
- }
445
442
  }
446
443
  async addErrorBadgeToGuide(guideName) {
447
444
  var _a;
@@ -87,13 +87,13 @@ export class SnkFormConfigManager {
87
87
  const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
88
88
  const hasConfig = this.hasConfig();
89
89
  if (hasConfig && !forceEmptyConfig) {
90
- return fields.map(({ label, name, readOnly, visible, required, tab, group }) => {
90
+ return fields.map(({ label, name, readOnly, visible, required, tab }) => {
91
91
  var _a;
92
92
  if (label == undefined) {
93
93
  const currentField = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
94
- return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required, tab: tab, group: group });
94
+ return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required, tab: tab });
95
95
  }
96
- return { name, label, readOnly, visible, required, tab, group };
96
+ return { name, label, readOnly, visible, required, tab };
97
97
  })
98
98
  .filter(field => this.isFieldVisible(field, descriptionFilter));
99
99
  }