@sankhyalabs/sankhyablocks 8.2.0-dev.1 → 8.2.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 (221) hide show
  1. package/dist/cjs/{ConfigStorage-12397f18.js → ConfigStorage-e9d7fa82.js} +51 -163
  2. package/dist/cjs/{DataFetcher-f2da1f79.js → DataFetcher-39b63a1e.js} +29 -67
  3. package/dist/cjs/{SnkFormConfigManager-13f79e37.js → SnkFormConfigManager-2f8eccd9.js} +21 -19
  4. package/dist/cjs/{dataunit-fetcher-e72068c1.js → dataunit-fetcher-15a7cc88.js} +1 -1
  5. package/dist/cjs/filter-bar-config-fetcher-24548cec.js +155 -0
  6. package/dist/cjs/{form-config-fetcher-5d62ab62.js → form-config-fetcher-ab3ce222.js} +3 -66
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{pesquisa-fetcher-8c363096.js → pesquisa-fetcher-96c042aa.js} +1 -1
  9. package/dist/cjs/resource-fetcher-64102551.js +68 -0
  10. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  11. package/dist/cjs/snk-actions-button.cjs.entry.js +11 -18
  12. package/dist/cjs/snk-application.cjs.entry.js +73 -51
  13. package/dist/cjs/snk-attach.cjs.entry.js +13 -7
  14. package/dist/cjs/snk-configurator.cjs.entry.js +1 -2
  15. package/dist/cjs/snk-crud.cjs.entry.js +9 -28
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  17. package/dist/cjs/{snk-data-unit-80a00ae4.js → snk-data-unit-d5109a08.js} +6 -8
  18. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-detail-view.cjs.entry.js +25 -18
  20. package/dist/cjs/snk-entity-list.cjs.entry.js +4 -0
  21. package/dist/cjs/snk-filter-bar.cjs.entry.js +17 -14
  22. package/dist/cjs/snk-filter-detail.cjs.entry.js +15 -1
  23. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +19 -5
  24. package/dist/cjs/snk-form-config.cjs.entry.js +17 -6
  25. package/dist/cjs/snk-form-view.cjs.entry.js +1 -6
  26. package/dist/cjs/snk-form.cjs.entry.js +8 -12
  27. package/dist/cjs/snk-grid-config.cjs.entry.js +6 -5
  28. package/dist/cjs/snk-grid.cjs.entry.js +20 -20
  29. package/dist/cjs/{snk-guides-viewer-a7cd6fda.js → snk-guides-viewer-8c9693aa.js} +9 -18
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +16 -13
  32. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +80 -22
  34. package/dist/cjs/snk-taskbar.cjs.entry.js +1 -2
  35. package/dist/collection/components/snk-actions-button/actions/index.js +4 -3
  36. package/dist/collection/components/snk-actions-button/snk-actions-button.js +4 -8
  37. package/dist/collection/components/snk-application/snk-application.js +65 -60
  38. package/dist/collection/components/snk-configurator/snk-configurator.js +1 -19
  39. package/dist/collection/components/snk-crud/snk-crud.js +8 -63
  40. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +15 -65
  41. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +1 -27
  42. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +30 -66
  43. package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -42
  44. package/dist/collection/components/snk-entity-list/snk-entity-list.js +23 -0
  45. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +12 -2
  46. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  47. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +16 -21
  48. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -28
  49. package/dist/collection/components/snk-form/SnkFormConfigManager.js +19 -17
  50. package/dist/collection/components/snk-form/snk-form.js +2 -46
  51. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +15 -5
  52. package/dist/collection/components/snk-grid/snk-grid.js +16 -110
  53. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +1 -19
  54. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +12 -28
  55. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +9 -43
  56. package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -19
  57. package/dist/collection/lib/configs/ConfigStorage.js +44 -33
  58. package/dist/collection/lib/dataUnit/InMemoryLoader.js +59 -2
  59. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +29 -38
  60. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +24 -0
  61. package/dist/collection/lib/index.js +0 -10
  62. package/dist/collection/lib/utils/urlutils.js +0 -29
  63. package/dist/components/ConfigStorage.js +48 -161
  64. package/dist/components/DataFetcher.js +29 -67
  65. package/dist/components/SnkFormConfigManager.js +19 -17
  66. package/dist/components/filter-bar-config-fetcher.js +153 -0
  67. package/dist/components/form-config-fetcher.js +2 -64
  68. package/dist/components/resource-fetcher.js +66 -0
  69. package/dist/components/snk-actions-button2.js +9 -23
  70. package/dist/components/snk-application2.js +154 -132
  71. package/dist/components/snk-attach2.js +8 -1
  72. package/dist/components/snk-configurator2.js +1 -3
  73. package/dist/components/snk-crud.js +7 -29
  74. package/dist/components/snk-data-unit2.js +6 -10
  75. package/dist/components/snk-detail-view2.js +23 -28
  76. package/dist/components/snk-entity-list.js +4 -0
  77. package/dist/components/snk-filter-bar2.js +12 -12
  78. package/dist/components/snk-filter-detail2.js +12 -2
  79. package/dist/components/snk-filter-modal-item2.js +16 -5
  80. package/dist/components/snk-form-config2.js +15 -5
  81. package/dist/components/snk-form-view2.js +1 -6
  82. package/dist/components/snk-form.js +2 -9
  83. package/dist/components/snk-grid-config2.js +2 -4
  84. package/dist/components/snk-grid2.js +16 -23
  85. package/dist/components/snk-personalized-filter2.js +11 -11
  86. package/dist/components/snk-simple-crud2.js +69 -12
  87. package/dist/components/snk-taskbar2.js +1 -3
  88. package/dist/esm/{ConfigStorage-932ab366.js → ConfigStorage-1090289a.js} +49 -162
  89. package/dist/esm/{DataFetcher-7e18aa30.js → DataFetcher-a4ed43e7.js} +29 -67
  90. package/dist/esm/{SnkFormConfigManager-bb9afc3f.js → SnkFormConfigManager-de537eca.js} +21 -19
  91. package/dist/esm/{dataunit-fetcher-91a4eb82.js → dataunit-fetcher-8d0bfa4a.js} +1 -1
  92. package/dist/esm/filter-bar-config-fetcher-2417b8cf.js +153 -0
  93. package/dist/esm/{form-config-fetcher-aaaa79a6.js → form-config-fetcher-4065db9a.js} +3 -65
  94. package/dist/esm/loader.js +1 -1
  95. package/dist/esm/{pesquisa-fetcher-56b30fb4.js → pesquisa-fetcher-7460b876.js} +1 -1
  96. package/dist/esm/resource-fetcher-45a70066.js +66 -0
  97. package/dist/esm/sankhyablocks.js +1 -1
  98. package/dist/esm/snk-actions-button.entry.js +11 -18
  99. package/dist/esm/snk-application.entry.js +71 -49
  100. package/dist/esm/snk-attach.entry.js +9 -3
  101. package/dist/esm/snk-configurator.entry.js +1 -2
  102. package/dist/esm/snk-crud.entry.js +9 -28
  103. package/dist/esm/snk-data-exporter.entry.js +2 -2
  104. package/dist/esm/{snk-data-unit-3ab57d1a.js → snk-data-unit-3a0bbfcb.js} +6 -8
  105. package/dist/esm/snk-data-unit.entry.js +1 -1
  106. package/dist/esm/snk-detail-view.entry.js +25 -18
  107. package/dist/esm/snk-entity-list.entry.js +4 -0
  108. package/dist/esm/snk-filter-bar.entry.js +17 -14
  109. package/dist/esm/snk-filter-detail.entry.js +16 -2
  110. package/dist/esm/snk-filter-modal-item.entry.js +20 -6
  111. package/dist/esm/snk-form-config.entry.js +18 -7
  112. package/dist/esm/snk-form-view.entry.js +1 -6
  113. package/dist/esm/snk-form.entry.js +8 -12
  114. package/dist/esm/snk-grid-config.entry.js +6 -5
  115. package/dist/esm/snk-grid.entry.js +20 -20
  116. package/dist/esm/{snk-guides-viewer-cc709b5f.js → snk-guides-viewer-a6d39c18.js} +9 -18
  117. package/dist/esm/snk-guides-viewer.entry.js +8 -8
  118. package/dist/esm/snk-personalized-filter.entry.js +16 -13
  119. package/dist/esm/snk-print-selector.entry.js +1 -1
  120. package/dist/esm/snk-simple-crud.entry.js +71 -13
  121. package/dist/esm/snk-taskbar.entry.js +1 -2
  122. package/dist/sankhyablocks/p-0fb83448.js +1 -0
  123. package/dist/sankhyablocks/p-15aba6fb.entry.js +11 -0
  124. package/dist/sankhyablocks/p-216f081a.entry.js +1 -0
  125. package/dist/sankhyablocks/p-21e7c08e.entry.js +1 -0
  126. package/dist/sankhyablocks/p-2861d44f.entry.js +1 -0
  127. package/dist/sankhyablocks/p-2d883fe9.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-d13c00b6.entry.js → p-3d6f91c2.entry.js} +1 -1
  129. package/dist/sankhyablocks/{p-f8e6b97e.js → p-44e66c8d.js} +1 -1
  130. package/dist/sankhyablocks/p-4514fc6a.entry.js +1 -0
  131. package/dist/sankhyablocks/p-4f4cd005.entry.js +1 -0
  132. package/dist/sankhyablocks/p-50c13cc8.entry.js +1 -0
  133. package/dist/sankhyablocks/p-52c6b2e7.js +1 -0
  134. package/dist/sankhyablocks/p-5994af77.js +56 -0
  135. package/dist/sankhyablocks/p-5df17074.js +1 -0
  136. package/dist/sankhyablocks/p-6bb904bb.entry.js +1 -0
  137. package/dist/sankhyablocks/p-6f0795c8.entry.js +1 -0
  138. package/dist/sankhyablocks/p-7588f006.entry.js +1 -0
  139. package/dist/sankhyablocks/p-847e6c20.js +17 -0
  140. package/dist/sankhyablocks/p-9471cbc9.entry.js +1 -0
  141. package/dist/sankhyablocks/{p-14eac6fe.js → p-9d18017a.js} +1 -1
  142. package/dist/sankhyablocks/p-9edad923.js +1 -0
  143. package/dist/sankhyablocks/p-a42dd503.entry.js +1 -0
  144. package/dist/sankhyablocks/{p-2d333d22.js → p-b978da60.js} +1 -1
  145. package/dist/sankhyablocks/p-befbc9ee.entry.js +1 -0
  146. package/dist/sankhyablocks/p-c6380ea2.entry.js +1 -0
  147. package/dist/sankhyablocks/{p-03bb1aea.entry.js → p-c6feb995.entry.js} +1 -1
  148. package/dist/sankhyablocks/p-c945318c.entry.js +1 -0
  149. package/dist/sankhyablocks/p-ccbfb1cf.entry.js +1 -0
  150. package/dist/sankhyablocks/p-d7c7a289.entry.js +1 -0
  151. package/dist/sankhyablocks/p-de69b4b0.entry.js +1 -0
  152. package/dist/sankhyablocks/p-f3b7b69e.js +10 -0
  153. package/dist/sankhyablocks/p-f7eded3a.entry.js +1 -0
  154. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  155. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -2
  156. package/dist/types/components/snk-application/snk-application.d.ts +13 -8
  157. package/dist/types/components/snk-configurator/snk-configurator.d.ts +0 -4
  158. package/dist/types/components/snk-crud/snk-crud.d.ts +0 -10
  159. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -13
  160. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +0 -5
  161. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +2 -13
  162. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +0 -8
  163. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +4 -0
  164. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +3 -0
  165. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
  166. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +4 -5
  167. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
  168. package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +4 -5
  169. package/dist/types/components/snk-form/snk-form.d.ts +1 -9
  170. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +2 -0
  171. package/dist/types/components/snk-grid/snk-grid.d.ts +1 -18
  172. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +0 -4
  173. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +1 -5
  174. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -8
  175. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -4
  176. package/dist/types/components.d.ts +21 -189
  177. package/dist/types/lib/configs/ConfigStorage.d.ts +13 -11
  178. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +7 -0
  179. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
  180. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +1 -0
  181. package/dist/types/lib/index.d.ts +0 -11
  182. package/dist/types/lib/utils/urlutils.d.ts +0 -14
  183. package/package.json +2 -2
  184. package/dist/cjs/ISave-d68ce3cd.js +0 -8
  185. package/dist/cjs/ResourceIDUtils-5ff86aa7.js +0 -12
  186. package/dist/cjs/auth-fetcher-319a4cb2.js +0 -34
  187. package/dist/collection/lib/resourceid/ResourceIDUtils.js +0 -7
  188. package/dist/components/ResourceIDUtils.js +0 -10
  189. package/dist/components/auth-fetcher.js +0 -32
  190. package/dist/esm/ISave-4412b20c.js +0 -8
  191. package/dist/esm/ResourceIDUtils-a114189a.js +0 -10
  192. package/dist/esm/auth-fetcher-6d9664b7.js +0 -32
  193. package/dist/sankhyablocks/p-01739b21.entry.js +0 -1
  194. package/dist/sankhyablocks/p-05dbc70e.entry.js +0 -1
  195. package/dist/sankhyablocks/p-41e897f1.js +0 -56
  196. package/dist/sankhyablocks/p-48a40939.js +0 -1
  197. package/dist/sankhyablocks/p-611aa624.entry.js +0 -1
  198. package/dist/sankhyablocks/p-66bb8c20.entry.js +0 -1
  199. package/dist/sankhyablocks/p-688dcb4c.js +0 -1
  200. package/dist/sankhyablocks/p-6f154396.entry.js +0 -1
  201. package/dist/sankhyablocks/p-787071a8.js +0 -1
  202. package/dist/sankhyablocks/p-8481bb59.entry.js +0 -1
  203. package/dist/sankhyablocks/p-8818d8f6.entry.js +0 -1
  204. package/dist/sankhyablocks/p-93f6ca04.entry.js +0 -1
  205. package/dist/sankhyablocks/p-9a270401.entry.js +0 -1
  206. package/dist/sankhyablocks/p-9e7d65a4.js +0 -1
  207. package/dist/sankhyablocks/p-a52a6c9d.js +0 -26
  208. package/dist/sankhyablocks/p-b6003974.entry.js +0 -1
  209. package/dist/sankhyablocks/p-c555075c.entry.js +0 -1
  210. package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
  211. package/dist/sankhyablocks/p-d53a9169.entry.js +0 -1
  212. package/dist/sankhyablocks/p-d7638f45.entry.js +0 -11
  213. package/dist/sankhyablocks/p-e086cc2a.entry.js +0 -1
  214. package/dist/sankhyablocks/p-e64f3e17.entry.js +0 -1
  215. package/dist/sankhyablocks/p-ed41b38c.js +0 -1
  216. package/dist/sankhyablocks/p-ed705cbb.entry.js +0 -1
  217. package/dist/sankhyablocks/p-efc10705.entry.js +0 -1
  218. package/dist/sankhyablocks/p-f74fe358.js +0 -1
  219. package/dist/sankhyablocks/p-f91e0c5d.entry.js +0 -1
  220. package/dist/sankhyablocks/p-fa523d6b.entry.js +0 -1
  221. package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +0 -3
@@ -5,15 +5,17 @@ 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-1aeb625d.js');
8
- const ConfigStorage = require('./ConfigStorage-12397f18.js');
8
+ const ConfigStorage = require('./ConfigStorage-e9d7fa82.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-aa823a00.js');
13
- require('./form-config-fetcher-5d62ab62.js');
14
- require('./DataFetcher-f2da1f79.js');
13
+ require('./form-config-fetcher-ab3ce222.js');
14
+ require('./DataFetcher-39b63a1e.js');
15
15
  require('./_commonjsHelpers-537d719a.js');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
+ require('./resource-fetcher-64102551.js');
18
+ require('./filter-bar-config-fetcher-24548cec.js');
17
19
 
18
20
  const snkPersonalizedFilterCss = ".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";
19
21
 
@@ -43,7 +45,6 @@ const SnkPersonalizedFilter = class {
43
45
  this.entityUri = undefined;
44
46
  this.filterId = undefined;
45
47
  this.configName = undefined;
46
- this.resourceID = undefined;
47
48
  }
48
49
  /*
49
50
  * Cria um novo filtro se não houver nenhum filtro existente
@@ -80,15 +81,17 @@ const SnkPersonalizedFilter = class {
80
81
  this._filterAssistent = core.ObjectUtils.copy(newPersonalizedFilter);
81
82
  }
82
83
  loadFilter(newValue, oldValue) {
83
- if (newValue == null || oldValue == newValue || this.resourceID == undefined) {
84
+ if (newValue == null || oldValue == newValue) {
84
85
  return;
85
86
  }
86
- ConfigStorage.ConfigStorage.loadPersonalizedFilter(newValue, this.resourceID, this.configName)
87
- .then((resp) => {
88
- const personalizedFilter = this.addLabelToItems(resp);
89
- this._filterAssistent = personalizedFilter;
90
- this._originalFilterAssistent = core.ObjectUtils.copy(personalizedFilter);
91
- this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
87
+ ConfigStorage.ConfigStorage.get().then((_instance) => {
88
+ ConfigStorage.ConfigStorage.loadPersonalizedFilter(newValue, this.configName)
89
+ .then((resp) => {
90
+ const personalizedFilter = this.addLabelToItems(resp);
91
+ this._filterAssistent = personalizedFilter;
92
+ this._originalFilterAssistent = core.ObjectUtils.copy(personalizedFilter);
93
+ this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
94
+ });
92
95
  });
93
96
  }
94
97
  componentWillLoad() {
@@ -113,7 +116,7 @@ const SnkPersonalizedFilter = class {
113
116
  return this._application.messagesBuilder.getMessage(key, params);
114
117
  }
115
118
  saveFilter() {
116
- ConfigStorage.ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName).then((personalizedFilter) => {
119
+ ConfigStorage.ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.configName).then((personalizedFilter) => {
117
120
  this._elButtonSave.enabled = false;
118
121
  const messageToken = !!this._filterAssistent.id ? 'confirmEdit' : 'confirmSave';
119
122
  utils.ApplicationUtils.info(this.getMessage(`snkPersonalizedFilter.${messageToken}.title`), { iconName: "check" });
@@ -124,7 +127,7 @@ const SnkPersonalizedFilter = class {
124
127
  });
125
128
  }
126
129
  removeFilter() {
127
- ConfigStorage.ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName);
130
+ ConfigStorage.ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.configName);
128
131
  }
129
132
  hasChangesToSave() {
130
133
  return JSON.stringify(this._filterAssistent) === JSON.stringify(this._originalFilterAssistent);
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
- const DataFetcher = require('./DataFetcher-f2da1f79.js');
6
+ const DataFetcher = require('./DataFetcher-39b63a1e.js');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const core = require('@sankhyalabs/core');
9
9
  const ModalButtonStatus = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container/modal-button-status');
@@ -4,20 +4,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
- const constants = require('./constants-d187e03e.js');
7
+ const constants$1 = require('./constants-d187e03e.js');
8
8
  const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
9
- require('./DataFetcher-f2da1f79.js');
10
- require('./pesquisa-fetcher-8c363096.js');
9
+ require('./DataFetcher-39b63a1e.js');
10
+ require('./pesquisa-fetcher-96c042aa.js');
11
11
  const index$1 = require('./index-0e663819.js');
12
- require('./ISave-d68ce3cd.js');
13
- require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
- require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
- require('./filter-item-type.enum-aa823a00.js');
16
- require('./form-config-fetcher-5d62ab62.js');
17
12
  const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
13
+ const constants = require('@sankhyalabs/ezui/dist/collection/utils/constants');
18
14
  const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-804ff4c7.js');
19
15
  require('./index-102ba62d.js');
20
16
  require('./_commonjsHelpers-537d719a.js');
17
+ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
21
18
 
22
19
  class InMemoryLoader {
23
20
  constructor(metadata, records) {
@@ -25,7 +22,7 @@ class InMemoryLoader {
25
22
  this.metadata = metadata;
26
23
  this._dataUnit = new core.DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
27
24
  this._dataUnit.metadataLoader = () => this.metadaLoader();
28
- this._dataUnit.dataLoader = (dataUnit, request) => core.defaultDataLoader(dataUnit, request, this._records);
25
+ this._dataUnit.dataLoader = (dataUnit, request) => this.dataLoader(dataUnit, request);
29
26
  this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
30
27
  this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
31
28
  this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
@@ -62,6 +59,62 @@ class InMemoryLoader {
62
59
  metadaLoader() {
63
60
  return Promise.resolve(this._metadata);
64
61
  }
62
+ dataLoader(dataUnit, request) {
63
+ const filters = this.getColumnFilters(dataUnit);
64
+ let records = this.applyFilters(filters);
65
+ if (request.sort) {
66
+ request.sort.forEach(sort => {
67
+ records = records.sort((recordA, recordB) => {
68
+ const fieldA = recordA[sort.field];
69
+ const fieldB = recordB[sort.field];
70
+ const sortFn = this.getSortFn(sort.dataType);
71
+ return sortFn(fieldA, fieldB) * (sort.mode == core.SortMode.ASC ? 1 : -1);
72
+ });
73
+ });
74
+ }
75
+ return Promise.resolve({ records: records });
76
+ }
77
+ applyFilters(filters) {
78
+ let records = [...this._records];
79
+ filters.forEach(filter => {
80
+ records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
81
+ });
82
+ return records;
83
+ }
84
+ getColumnFilters(dataUnit) {
85
+ var _a, _b;
86
+ const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
87
+ const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(constants.DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
88
+ return columnFilters.map(filter => {
89
+ var _a, _b;
90
+ return {
91
+ column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(constants.DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
92
+ values: filter.params.map(param => param.value),
93
+ };
94
+ });
95
+ }
96
+ getSortFn(type) {
97
+ switch (type) {
98
+ case core.DataType.NUMBER:
99
+ return this.sortNumber;
100
+ case core.DataType.DATE:
101
+ return this.sortDate;
102
+ case core.DataType.OBJECT:
103
+ return this.sortObject;
104
+ default:
105
+ return core.StringUtils.compare;
106
+ }
107
+ }
108
+ sortObject(a, b) {
109
+ return core.StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
110
+ }
111
+ sortNumber(a, b) {
112
+ return a - b;
113
+ }
114
+ sortDate(a, b) {
115
+ let timeA = a.getTime(), timeB = b.getTime();
116
+ return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
117
+ }
65
118
  saveLoader(_dataUnit, changes) {
66
119
  return new Promise((resolve) => {
67
120
  let dataUnitRecords = [];
@@ -104,10 +157,14 @@ const SnkSimpleCrud = class {
104
157
  this.dataStateChange = index.createEvent(this, "dataStateChange", 3);
105
158
  this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
106
159
  this.actionClick = index.createEvent(this, "actionClick", 7);
107
- this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
108
160
  this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
109
161
  this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
110
162
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
163
+ // /**
164
+ // * Quando verdadeiro, o ENTER fará a navegação como se fosse a tecla TAB na grade.
165
+ // */
166
+ // @Prop()
167
+ // useEnterLikeTab: boolean = false;
111
168
  this._taskbarProcessor = new taskbarProcessor.TaskbarProcessor({
112
169
  "snkSimpleCrudTaskbar.form_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(taskbarElements.TaskbarElement.GRID_MODE),
113
170
  "snkSimpleCrudTaskbar.grid_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(taskbarElements.TaskbarElement.FORM_MODE),
@@ -115,22 +172,21 @@ const SnkSimpleCrud = class {
115
172
  "snkSimpleCrudTaskbar.grid_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(taskbarElements.TaskbarElement.FORM_MODE),
116
173
  "snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
117
174
  });
118
- this._currentViewMode = constants.VIEW_MODE.GRID;
175
+ this._currentViewMode = constants$1.VIEW_MODE.GRID;
119
176
  this._config = undefined;
120
177
  this.dataState = undefined;
121
178
  this.dataUnit = undefined;
122
- this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
179
+ this.mode = constants$1.SIMPLE_CRUD_MODE.SERVER;
123
180
  this.gridConfig = undefined;
124
181
  this.formConfig = undefined;
125
182
  this.multipleSelection = undefined;
126
183
  this.useCancelConfirm = true;
127
184
  this.taskbarManager = undefined;
128
185
  this.messagesBuilder = undefined;
129
- this.useEnterLikeTab = false;
130
186
  }
131
187
  resolveInMemoryBtns(taskbarButtons) {
132
188
  const newTaskBarConfig = [...taskbarButtons];
133
- if (this.mode === constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
189
+ if (this.mode === constants$1.SIMPLE_CRUD_MODE.IN_MEMORY) {
134
190
  newTaskBarConfig.splice(1, 1);
135
191
  }
136
192
  return newTaskBarConfig;
@@ -147,15 +203,15 @@ const SnkSimpleCrud = class {
147
203
  actionClickListener(evt) {
148
204
  const act = evt.detail;
149
205
  if (act === taskbarElements.TaskbarElement.GRID_MODE) {
150
- this.goToView(constants.VIEW_MODE.GRID);
206
+ this.goToView(constants$1.VIEW_MODE.GRID);
151
207
  }
152
208
  else if (act === taskbarElements.TaskbarElement.FORM_MODE) {
153
- this.goToView(constants.VIEW_MODE.FORM);
209
+ this.goToView(constants$1.VIEW_MODE.FORM);
154
210
  }
155
211
  evt.stopPropagation();
156
212
  }
157
213
  onModeChange() {
158
- if (this.mode == constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
214
+ if (this.mode == constants$1.SIMPLE_CRUD_MODE.IN_MEMORY) {
159
215
  this.initInMemoryDataUnit();
160
216
  }
161
217
  }
@@ -185,9 +241,9 @@ const SnkSimpleCrud = class {
185
241
  if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
186
242
  !this.dataState.selectionInfo.isAllRecords() &&
187
243
  ((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
188
- return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
244
+ return this._currentViewMode === constants$1.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
189
245
  }
190
- return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
246
+ return this._currentViewMode === constants$1.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
191
247
  }
192
248
  initInMemoryDataUnit() {
193
249
  this._inMemoryLoader = new InMemoryLoader(this._metadata);
@@ -265,15 +321,17 @@ const SnkSimpleCrud = class {
265
321
  handleCancelEdit() {
266
322
  var _a;
267
323
  if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
268
- this.goToView(constants.VIEW_MODE.GRID);
324
+ this.goToView(constants$1.VIEW_MODE.GRID);
269
325
  this.dataUnit.clearSelection();
270
326
  }
271
327
  }
272
328
  render() {
273
329
  var _a;
274
- return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", 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, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }), index.h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
330
+ return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants$1.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail),
331
+ // ignoreSaveMessage={this._currentViewMode === VIEW_MODE.GRID}
332
+ onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", 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, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }), index.h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants$1.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
275
333
  ? undefined
276
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
334
+ : this._multiSelectionListDataSource }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
277
335
  }
278
336
  get _element() { return index.getElement(this); }
279
337
  static get watchers() { return {
@@ -33,7 +33,6 @@ const SnkTaskbar = class {
33
33
  };
34
34
  this._permissions = undefined;
35
35
  this.configName = undefined;
36
- this.resourceID = undefined;
37
36
  this.buttons = undefined;
38
37
  this.customButtons = undefined;
39
38
  this.actionsList = undefined;
@@ -175,7 +174,7 @@ const SnkTaskbar = class {
175
174
  componentWillLoad() {
176
175
  this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
177
176
  if (this._application) {
178
- this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
177
+ this._application.getAllAccess().then(access => this._permissions = access);
179
178
  }
180
179
  else {
181
180
  this._permissions = {};
@@ -8,14 +8,13 @@ const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
8
8
  const NUFIN_COLUMN = 'NUFIN';
9
9
  const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
10
10
  export default class Actions {
11
- constructor(actionsExecuteInterface, dataUnit, appResourceId) {
11
+ constructor(actionsExecuteInterface, dataUnit) {
12
12
  var _a;
13
13
  this._lastValuesCache = {};
14
14
  this._actionsExecuteInterface = actionsExecuteInterface;
15
15
  this._dataUnit = dataUnit;
16
16
  this._selectedRows = ((_a = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo()) === null || _a === void 0 ? void 0 : _a.isAllRecords()) ? [] : dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo().records;
17
17
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
18
- this._appResourceId = appResourceId;
19
18
  }
20
19
  apply(action, hasParamsToSave) {
21
20
  this._application.closePopUp();
@@ -278,7 +277,9 @@ export default class Actions {
278
277
  }
279
278
  }
280
279
  async buildResourceId(actionId) {
281
- return this._appResourceId + '.actionconfig.' + actionId;
280
+ let appResId = '';
281
+ appResId = await this._application.getResourceID();
282
+ return appResId + '.actionconfig.' + actionId;
282
283
  }
283
284
  prepareAndExecute(execSource, executeAction) {
284
285
  this.addRows(execSource);
@@ -4,14 +4,13 @@ import { DataFetcher } from '../../lib/http/data-fetcher/DataFetcher';
4
4
  import ExecutorFactory from './actions/factory/executor.factory';
5
5
  import Actions from './actions';
6
6
  import ClientEventConfirm from './clientEvent';
7
- import ResourceIDUtils from '../../lib/resourceid/ResourceIDUtils';
8
7
  export class SnkActionsButton {
9
8
  constructor() {
10
9
  this.CLIENT_EVENT_CONFIRM_NAME = "br.com.sankhya.actionbutton.clientconfirm";
11
10
  this.handleClick = (evt) => {
12
11
  const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
13
12
  const executor = new ExecutorFactory(selectedAction.type).executor;
14
- const action = new Actions(executor, this._dataUnit, this._resourceID);
13
+ const action = new Actions(executor, this._dataUnit);
15
14
  action.execute(Object.assign({}, selectedAction));
16
15
  this._showDropdown = false;
17
16
  };
@@ -69,15 +68,12 @@ export class SnkActionsButton {
69
68
  document.addEventListener("scroll", this.positionDropdown.bind(this));
70
69
  }
71
70
  async componentWillLoad() {
71
+ var _a;
72
72
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
73
+ this._resourceID = await this._application.getResourceID();
73
74
  this._isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
74
- const snkDataUnit = this._element.parentElement;
75
- this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
76
- this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
75
+ this._dataUnit = (_a = this._element.parentElement) === null || _a === void 0 ? void 0 : _a.dataUnit;
77
76
  this._entityName = this._dataUnit.name.split('/')[2];
78
- if (this._resourceID == undefined) {
79
- this._resourceID = await ResourceIDUtils.getResourceID();
80
- }
81
77
  this.setEvents();
82
78
  this.getActions().then(() => {
83
79
  this.loadItems();
@@ -13,6 +13,7 @@ import Workspace from "../../lib/workspace/workspace";
13
13
  import AppletCaller from "../../lib/applet-caller/applet-caller";
14
14
  import ParametersFetcher from "../../lib/http/data-fetcher/fetchers/parameters-fecher";
15
15
  import MGEAuthorization from '../../lib/auth/mgeauthorization.module';
16
+ import GridConfigFetcher from "../../lib/http/data-fetcher/fetchers/grid-config-fetcher";
16
17
  import AuthFetcher, { AutorizationType } from "../../lib/http/data-fetcher/fetchers/auth-fetcher";
17
18
  import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
18
19
  /**
@@ -35,21 +36,16 @@ export class SnkApplication {
35
36
  }
36
37
  return this._parameters;
37
38
  }
38
- async getAuth(resourceID) {
39
- if (resourceID == undefined) {
40
- return this.getApplicationAuth();
41
- }
42
- else {
43
- return new Promise((resolve, reject) => {
44
- this.authFetcher.getData(resourceID).then((authList) => {
45
- resolve(authList);
46
- }).catch(error => {
47
- reject(error);
48
- });
49
- });
39
+ get resourceID() {
40
+ if (!this._resourceID) {
41
+ this._resourceID = this.urlParams.get("workspaceResourceID") ||
42
+ this.urlParams.get("resourceID") ||
43
+ Workspace.resourceID ||
44
+ "unknown.resource.id";
50
45
  }
46
+ return this._resourceID;
51
47
  }
52
- async getApplicationAuth() {
48
+ get auth() {
53
49
  if (this._auth) {
54
50
  return Promise.resolve(this._auth);
55
51
  }
@@ -58,7 +54,7 @@ export class SnkApplication {
58
54
  const waitingAuth = this._authPromises.length > 0;
59
55
  this._authPromises.push(new PendingPromise(resolve, reject));
60
56
  if (!waitingAuth) {
61
- this.authFetcher.getData(this.applicationResourceID).then((authList) => {
57
+ this.authFetcher.getData(this.resourceID).then((authList) => {
62
58
  this._auth = authList;
63
59
  while (this._authPromises.length > 0) {
64
60
  this._authPromises.pop().resolve(this._auth);
@@ -77,7 +73,7 @@ export class SnkApplication {
77
73
  */
78
74
  async isUserSup() {
79
75
  return new Promise((resolve, reject) => {
80
- this.getAuth().then((authorization) => {
76
+ this.auth.then((authorization) => {
81
77
  this.getAuthList(authorization).then((auths) => {
82
78
  resolve(auths.isSup);
83
79
  }).catch(error => reject(error));
@@ -91,9 +87,9 @@ export class SnkApplication {
91
87
  /**
92
88
  * Obtém `true` caso o usuário logado tem permissão pra determinada ação.
93
89
  */
94
- async hasAccess(access, resourceID) {
90
+ async hasAccess(access) {
95
91
  return new Promise((resolve, reject) => {
96
- this.getAuth(resourceID).then((authorization) => {
92
+ this.auth.then((authorization) => {
97
93
  this.getAuthList(authorization).then((auths) => {
98
94
  resolve(auths.isSup || auths.actions[access]);
99
95
  }).catch(error => reject(error));
@@ -103,9 +99,9 @@ export class SnkApplication {
103
99
  /**
104
100
  * Obtém todos os acessos do usuário logado.
105
101
  */
106
- async getAllAccess(resourceID) {
102
+ async getAllAccess() {
107
103
  return new Promise((resolve, reject) => {
108
- this.getAuth(resourceID).then((authorization) => {
104
+ this.auth.then((authorization) => {
109
105
  this.getAuthList(authorization).then((auths) => {
110
106
  const allAccess = {};
111
107
  allAccess['isSup'] = auths.isSup;
@@ -289,16 +285,13 @@ export class SnkApplication {
289
285
  * Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
290
286
  * passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
291
287
  */
292
- async createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
293
- if (resourceID == undefined) {
294
- resourceID = this.applicationResourceID;
295
- }
288
+ async createDataunit(entityName, dataUnitName, parentDataUnit, configName) {
296
289
  return new Promise((resolve, reject) => {
297
290
  const duPromisses = this.getDuPromissesStack(dataUnitName);
298
291
  const waitingDu = duPromisses.length > 0;
299
292
  duPromisses.push(new PendingPromise(resolve, reject));
300
293
  if (!waitingDu) {
301
- const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
294
+ const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID, parentDataUnit, configName);
302
295
  dataUnit.loadMetadata().then(() => {
303
296
  if (dataUnitName) {
304
297
  this.updateDataunitCache(undefined, dataUnitName, dataUnit);
@@ -329,14 +322,14 @@ export class SnkApplication {
329
322
  /**
330
323
  * Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
331
324
  */
332
- async getDataUnit(entityName, dataUnitName, parentDataUnit, configName, resourceID) {
325
+ async getDataUnit(entityName, dataUnitName, parentDataUnit, configName) {
333
326
  return new Promise((resolve, reject) => {
334
327
  const dataUnit = this._duCache.get(dataUnitName);
335
328
  if (dataUnit) {
336
329
  resolve(dataUnit);
337
330
  }
338
331
  else {
339
- this.createDataunit(entityName, dataUnitName, parentDataUnit, configName, resourceID).then(dataUnit => {
332
+ this.createDataunit(entityName, dataUnitName, parentDataUnit, configName).then(dataUnit => {
340
333
  resolve(dataUnit);
341
334
  }).catch(reason => reject(reason));
342
335
  }
@@ -385,20 +378,11 @@ export class SnkApplication {
385
378
  async callServiceBroker(serviceName, payload, options) {
386
379
  return DataFetcher.get().callServiceBroker(serviceName, payload, options);
387
380
  }
388
- get applicationResourceID() {
389
- if (!this._applicationResourceID) {
390
- this._applicationResourceID = this.urlParams.get("workspaceResourceID") ||
391
- this.urlParams.get("resourceID") ||
392
- Workspace.resourceID ||
393
- "unknown.resource.id";
394
- }
395
- return this._applicationResourceID;
396
- }
397
381
  /**
398
382
  * Obtém o resourceID da tela em questão.
399
383
  */
400
384
  async getResourceID() {
401
- return Promise.resolve(this.applicationResourceID);
385
+ return Promise.resolve(this.resourceID);
402
386
  }
403
387
  /**
404
388
  * Obtém o UserId da tela em questão.
@@ -442,14 +426,20 @@ export class SnkApplication {
442
426
  async info(message, options) {
443
427
  return ApplicationUtils.info(message, options);
444
428
  }
429
+ /**
430
+ * Obtém a configuração de grade.
431
+ */
432
+ async loadGridConfig(name) {
433
+ return this.gridConfigFetcher.getConfig(name, this.resourceID);
434
+ }
445
435
  /**
446
436
  * Obtém os totalizadores da grade.
447
437
  */
448
438
  async loadTotals(name, resourceID, filters) {
449
439
  return this.totalsFetcher.fetchTotals(name, resourceID, filters);
450
440
  }
451
- async getAuthList(auth) {
452
- return await (new MGEAuthorization()).parseFromJSON(auth);
441
+ async getAuthList(_auth) {
442
+ return await (new MGEAuthorization()).parseFromJSON(_auth);
453
443
  }
454
444
  get urlParams() {
455
445
  if (!this._urlParams) {
@@ -463,6 +453,12 @@ export class SnkApplication {
463
453
  }
464
454
  return this._dataUnitFetcher;
465
455
  }
456
+ get gridConfigFetcher() {
457
+ if (!this._gridConfigFetcher) {
458
+ this._gridConfigFetcher = new GridConfigFetcher();
459
+ }
460
+ return this._gridConfigFetcher;
461
+ }
466
462
  get totalsFetcher() {
467
463
  if (!this._totalsFetcher) {
468
464
  this._totalsFetcher = new TotalsFetcher();
@@ -562,7 +558,7 @@ export class SnkApplication {
562
558
  * Obtém o nome das telas da aplicação
563
559
  */
564
560
  async getAppLabel() {
565
- return Workspace.getAppLabel(this.applicationResourceID);
561
+ return Workspace.getAppLabel(this._resourceID);
566
562
  }
567
563
  /**
568
564
  * Adiciona um listener no fetcher de Pesquisa
@@ -634,7 +630,6 @@ export class SnkApplication {
634
630
  this._popUp.ezTitle = title;
635
631
  }
636
632
  componentWillLoad() {
637
- ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", true);
638
633
  this._errorHandler = new SnkErrorHandler(this);
639
634
  this.messagesBuilder = new SnkMessageBuilder();
640
635
  ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
@@ -643,7 +638,7 @@ export class SnkApplication {
643
638
  });
644
639
  ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
645
640
  ErrorTracking.init();
646
- ConfigStorage.preload(this.applicationResourceID, this.configName);
641
+ ConfigStorage.get();
647
642
  }
648
643
  connectedCallback() {
649
644
  ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
@@ -655,10 +650,9 @@ export class SnkApplication {
655
650
  componentDidLoad() {
656
651
  this.applicationLoading.emit(true);
657
652
  window.requestAnimationFrame(() => {
658
- ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", false);
659
653
  this.applicationLoaded.emit(true);
660
654
  });
661
- ElementIDUtils.addIDInfo(this._element, `resource_${this.applicationResourceID}`);
655
+ ElementIDUtils.addIDInfo(this._element, `resource_${this._resourceID}`);
662
656
  }
663
657
  render() {
664
658
  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 })));
@@ -788,13 +782,10 @@ export class SnkApplication {
788
782
  },
789
783
  "hasAccess": {
790
784
  "complexType": {
791
- "signature": "(access: AutorizationType, resourceID?: string) => Promise<boolean>",
785
+ "signature": "(access: AutorizationType) => Promise<boolean>",
792
786
  "parameters": [{
793
787
  "tags": [],
794
788
  "text": ""
795
- }, {
796
- "tags": [],
797
- "text": ""
798
789
  }],
799
790
  "references": {
800
791
  "Promise": {
@@ -814,11 +805,8 @@ export class SnkApplication {
814
805
  },
815
806
  "getAllAccess": {
816
807
  "complexType": {
817
- "signature": "(resourceID?: string) => Promise<any>",
818
- "parameters": [{
819
- "tags": [],
820
- "text": ""
821
- }],
808
+ "signature": "() => Promise<any>",
809
+ "parameters": [],
822
810
  "references": {
823
811
  "Promise": {
824
812
  "location": "global"
@@ -1167,7 +1155,7 @@ export class SnkApplication {
1167
1155
  },
1168
1156
  "createDataunit": {
1169
1157
  "complexType": {
1170
- "signature": "(entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string) => Promise<DataUnit>",
1158
+ "signature": "(entityName: string, dataUnitName?: string, parentDataUnit?: DataUnit, configName?: string) => Promise<DataUnit>",
1171
1159
  "parameters": [{
1172
1160
  "tags": [],
1173
1161
  "text": ""
@@ -1180,9 +1168,6 @@ export class SnkApplication {
1180
1168
  }, {
1181
1169
  "tags": [],
1182
1170
  "text": ""
1183
- }, {
1184
- "tags": [],
1185
- "text": ""
1186
1171
  }],
1187
1172
  "references": {
1188
1173
  "Promise": {
@@ -1249,7 +1234,7 @@ export class SnkApplication {
1249
1234
  },
1250
1235
  "getDataUnit": {
1251
1236
  "complexType": {
1252
- "signature": "(entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string, resourceID?: string) => Promise<DataUnit>",
1237
+ "signature": "(entityName: string, dataUnitName: string, parentDataUnit?: DataUnit, configName?: string) => Promise<DataUnit>",
1253
1238
  "parameters": [{
1254
1239
  "tags": [],
1255
1240
  "text": ""
@@ -1262,9 +1247,6 @@ export class SnkApplication {
1262
1247
  }, {
1263
1248
  "tags": [],
1264
1249
  "text": ""
1265
- }, {
1266
- "tags": [],
1267
- "text": ""
1268
1250
  }],
1269
1251
  "references": {
1270
1252
  "Promise": {
@@ -1658,6 +1640,29 @@ export class SnkApplication {
1658
1640
  "tags": []
1659
1641
  }
1660
1642
  },
1643
+ "loadGridConfig": {
1644
+ "complexType": {
1645
+ "signature": "(name: string) => Promise<IGridConfig>",
1646
+ "parameters": [{
1647
+ "tags": [],
1648
+ "text": ""
1649
+ }],
1650
+ "references": {
1651
+ "Promise": {
1652
+ "location": "global"
1653
+ },
1654
+ "IGridConfig": {
1655
+ "location": "import",
1656
+ "path": "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController"
1657
+ }
1658
+ },
1659
+ "return": "Promise<IGridConfig>"
1660
+ },
1661
+ "docs": {
1662
+ "text": "Obt\u00E9m a configura\u00E7\u00E3o de grade.",
1663
+ "tags": []
1664
+ }
1665
+ },
1661
1666
  "loadTotals": {
1662
1667
  "complexType": {
1663
1668
  "signature": "(name: string, resourceID: string, filters: Array<Filter>) => Promise<Map<string, number>>",