@sankhyalabs/sankhyablocks 8.16.0-rc.1 → 8.16.0-rc.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. package/dist/cjs/{ConfigStorage-a343e418.js → ConfigStorage-ecc0ed20.js} +2 -2
  2. package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-807730a8.js} +39 -6
  3. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-cadeef8e.js} +21 -15
  4. package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
  5. package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-f1c92f79.js} +72 -16
  6. package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
  7. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-d68841bc.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-f89461c1.js} +46 -18
  9. package/dist/cjs/{field-search-f56aa7d6.js → field-search-68e34bf4.js} +5 -1
  10. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-ed497282.js} +5 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-ca89181c.js} +1 -1
  13. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  14. package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
  15. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  16. package/dist/cjs/snk-attach.cjs.entry.js +37 -28
  17. package/dist/cjs/snk-crud.cjs.entry.js +12 -6
  18. package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -9
  19. package/dist/cjs/{snk-data-unit-04df81bf.js → snk-data-unit-47202e42.js} +20 -11
  20. package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
  21. package/dist/cjs/snk-detail-view.cjs.entry.js +11 -11
  22. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  23. package/dist/cjs/snk-filter-bar.cjs.entry.js +37 -25
  24. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  26. package/dist/cjs/snk-form-config.cjs.entry.js +15 -4
  27. package/dist/cjs/snk-form.cjs.entry.js +7 -6
  28. package/dist/cjs/snk-grid.cjs.entry.js +61 -21
  29. package/dist/cjs/{snk-guides-viewer-bdc41281.js → snk-guides-viewer-68777d37.js} +23 -11
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  32. package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +53 -21
  34. package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
  35. package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
  36. package/dist/collection/components/snk-attach/snk-attach.js +24 -15
  37. package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
  38. package/dist/collection/components/snk-crud/snk-crud.js +59 -1
  39. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
  40. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +50 -5
  41. package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
  42. package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
  43. package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
  44. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
  45. package/dist/collection/components/snk-data-unit/snk-data-unit.js +18 -9
  46. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
  47. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
  48. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +59 -21
  49. package/dist/collection/components/snk-form/snk-form.js +2 -2
  50. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +70 -14
  51. package/dist/collection/components/snk-form-config/snk-form-config.js +13 -2
  52. package/dist/collection/components/snk-grid/snk-grid.css +2 -0
  53. package/dist/collection/components/snk-grid/snk-grid.js +68 -8
  54. package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
  55. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +0 -1
  56. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +62 -29
  57. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
  58. package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
  59. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
  60. package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
  61. package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
  62. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +22 -16
  63. package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
  64. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
  65. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
  66. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
  67. package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
  68. package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
  69. package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
  70. package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
  71. package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +40 -5
  72. package/dist/components/DataFetcher.js +22 -16
  73. package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
  74. package/dist/components/SnkFormConfigManager.js +70 -14
  75. package/dist/components/SnkMessageBuilder.js +7 -3
  76. package/dist/components/dataunit-fetcher.js +45 -15
  77. package/dist/components/form-config-fetcher.js +4 -1
  78. package/dist/components/snk-actions-button2.js +12 -9
  79. package/dist/components/snk-attach2.js +33 -24
  80. package/dist/components/snk-crud.js +9 -1
  81. package/dist/components/snk-data-exporter2.js +2 -2
  82. package/dist/components/snk-data-unit2.js +21 -49
  83. package/dist/components/snk-detail-view2.js +22 -8
  84. package/dist/components/snk-exporter-email-sender2.js +1 -1
  85. package/dist/components/snk-filter-bar2.js +35 -22
  86. package/dist/components/snk-filter-checkbox-list.js +1 -1
  87. package/dist/components/snk-form-config2.js +13 -2
  88. package/dist/components/snk-form.js +2 -2
  89. package/dist/components/snk-grid2.js +53 -11
  90. package/dist/components/snk-simple-bar2.js +1 -1
  91. package/dist/components/snk-simple-crud2.js +45 -10
  92. package/dist/components/snk-taskbar2.js +24 -2
  93. package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-7b36d041.js} +2 -2
  94. package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-1a82a768.js} +40 -8
  95. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-a9c598f2.js} +22 -16
  96. package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
  97. package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-139f09fa.js} +72 -16
  98. package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
  99. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-749d880f.js} +1 -1
  100. package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-c24c76c6.js} +46 -16
  101. package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
  102. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-adbe5d34.js} +5 -2
  103. package/dist/esm/loader.js +1 -1
  104. package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-8edaa8cd.js} +1 -1
  105. package/dist/esm/sankhyablocks.js +1 -1
  106. package/dist/esm/snk-actions-button_4.entry.js +17 -14
  107. package/dist/esm/snk-application.entry.js +7 -7
  108. package/dist/esm/snk-attach.entry.js +37 -28
  109. package/dist/esm/snk-crud.entry.js +12 -6
  110. package/dist/esm/snk-data-exporter.entry.js +9 -9
  111. package/dist/esm/{snk-data-unit-8eec78bd.js → snk-data-unit-de45e0e1.js} +20 -11
  112. package/dist/esm/snk-data-unit.entry.js +5 -5
  113. package/dist/esm/snk-detail-view.entry.js +11 -11
  114. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  115. package/dist/esm/snk-filter-bar.entry.js +37 -25
  116. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  117. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  118. package/dist/esm/snk-form-config.entry.js +15 -4
  119. package/dist/esm/snk-form.entry.js +7 -6
  120. package/dist/esm/snk-grid.entry.js +56 -16
  121. package/dist/esm/{snk-guides-viewer-dda0fede.js → snk-guides-viewer-b5dd30e6.js} +23 -11
  122. package/dist/esm/snk-guides-viewer.entry.js +9 -9
  123. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  124. package/dist/esm/snk-simple-bar.entry.js +1 -1
  125. package/dist/esm/snk-simple-crud.entry.js +49 -17
  126. package/dist/esm/snk-taskbar.entry.js +23 -1
  127. package/dist/sankhyablocks/p-0035ad6e.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
  129. package/dist/sankhyablocks/p-0911e61a.entry.js +1 -0
  130. package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
  131. package/dist/sankhyablocks/p-17425c72.js +1 -0
  132. package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
  133. package/dist/sankhyablocks/{p-af8efd95.js → p-1bf06cd3.js} +2 -2
  134. package/dist/sankhyablocks/{p-47db7e88.entry.js → p-212213d9.entry.js} +1 -1
  135. package/dist/sankhyablocks/p-23736d75.js +1 -0
  136. package/dist/sankhyablocks/p-3ae9d08a.js +1 -0
  137. package/dist/sankhyablocks/p-3e3cc017.js +1 -0
  138. package/dist/sankhyablocks/{p-52920496.js → p-4d9549cf.js} +1 -1
  139. package/dist/sankhyablocks/p-50779ad3.entry.js +1 -0
  140. package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
  141. package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
  142. package/dist/sankhyablocks/p-62e048c6.entry.js +1 -0
  143. package/dist/sankhyablocks/{p-c1d57831.entry.js → p-694e1c4a.entry.js} +1 -1
  144. package/dist/sankhyablocks/p-73185e58.entry.js +1 -0
  145. package/dist/sankhyablocks/p-7ac7932c.js +60 -0
  146. package/dist/sankhyablocks/p-7dd49d15.js +1 -0
  147. package/dist/sankhyablocks/p-7eef0898.entry.js +1 -0
  148. package/dist/sankhyablocks/{p-045eae4d.entry.js → p-a42e7a1e.entry.js} +2 -2
  149. package/dist/sankhyablocks/p-afbb070d.js +1 -0
  150. package/dist/sankhyablocks/p-b9679243.entry.js +1 -0
  151. package/dist/sankhyablocks/p-bccfc262.js +1 -0
  152. package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
  153. package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
  154. package/dist/sankhyablocks/p-da34270e.entry.js +1 -0
  155. package/dist/sankhyablocks/p-e16e87fc.entry.js +1 -0
  156. package/dist/sankhyablocks/p-eb9f0407.entry.js +1 -0
  157. package/dist/sankhyablocks/p-f3434fc4.js +1 -0
  158. package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-fb34e0cf.entry.js} +1 -1
  159. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  160. package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
  161. package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
  162. package/dist/types/components/snk-crud/snk-crud.d.ts +9 -0
  163. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +11 -0
  164. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
  165. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
  166. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +7 -2
  167. package/dist/types/components/snk-grid/snk-grid.d.ts +12 -0
  168. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -4
  169. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
  170. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
  171. package/dist/types/components.d.ts +67 -2
  172. package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
  173. package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
  174. package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
  175. package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
  176. package/package.json +2 -2
  177. package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
  178. package/dist/sankhyablocks/p-2a408684.js +0 -1
  179. package/dist/sankhyablocks/p-3a212712.js +0 -1
  180. package/dist/sankhyablocks/p-450c60e4.entry.js +0 -1
  181. package/dist/sankhyablocks/p-46d38387.entry.js +0 -1
  182. package/dist/sankhyablocks/p-4e5e1313.entry.js +0 -1
  183. package/dist/sankhyablocks/p-547eeac8.entry.js +0 -1
  184. package/dist/sankhyablocks/p-62ba211a.entry.js +0 -1
  185. package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
  186. package/dist/sankhyablocks/p-75e674ed.entry.js +0 -1
  187. package/dist/sankhyablocks/p-7a337364.js +0 -1
  188. package/dist/sankhyablocks/p-7a85fd49.entry.js +0 -1
  189. package/dist/sankhyablocks/p-7b08d0f8.entry.js +0 -1
  190. package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
  191. package/dist/sankhyablocks/p-9863d682.js +0 -1
  192. package/dist/sankhyablocks/p-b05d8893.entry.js +0 -1
  193. package/dist/sankhyablocks/p-c2495304.js +0 -1
  194. package/dist/sankhyablocks/p-d6e26ea8.entry.js +0 -1
  195. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
  196. package/dist/sankhyablocks/p-e549f7d1.js +0 -1
  197. package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
  198. package/dist/sankhyablocks/p-fa4d8cb4.js +0 -1
  199. package/dist/sankhyablocks/p-fe79f83a.js +0 -60
  200. package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -1,4 +1,4 @@
1
- import { ApplicationContext, ElementIDUtils, ErrorException, ObjectUtils } from '@sankhyalabs/core';
1
+ import { ApplicationContext, ElementIDUtils, ObjectUtils, ErrorException } from '@sankhyalabs/core';
2
2
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
3
3
  import { h, Host } from '@stencil/core';
4
4
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
@@ -15,18 +15,19 @@ export class SnkFilterBar {
15
15
  this._pendingVariables = false;
16
16
  this._customfiltersToBeUpdated = [];
17
17
  this._calculateSortIndex = (item) => {
18
- let index = item.hardFixed ? 1000000 : 0;
19
- //campos Hard Fixed não variam a ordem
20
- if (!item.hardFixed) {
21
- index += item.fixed ? 100000 : 0;
22
- index += item.value == undefined ? 0 : 10000;
23
- index += this._updateSequence.lastIndexOf(item.id) + 1;
24
- }
18
+ if (!item.visible)
19
+ return 0;
20
+ if (item.hardFixed)
21
+ return 1000000; //campos Hard Fixed não variam a ordem
22
+ let index = item.fixed ? 100000 : 0;
23
+ index += this.hasValidValue(item) ? 10000 : 0;
24
+ index += this._updateSequence.lastIndexOf(item.id) + 1;
25
25
  return index;
26
26
  };
27
27
  this._filtersComparator = (a, b) => {
28
28
  return this._calculateSortIndex(b) - this._calculateSortIndex(a);
29
29
  };
30
+ this.customFilterBarConfig = undefined;
30
31
  this.dataUnit = undefined;
31
32
  this.title = undefined;
32
33
  this.configName = undefined;
@@ -42,6 +43,13 @@ export class SnkFilterBar {
42
43
  this.showPersonalizedFilter = false;
43
44
  this.personalizedFilterId = undefined;
44
45
  }
46
+ hasValidValue(item) {
47
+ if (item.value === undefined || item.value === null)
48
+ return false;
49
+ if (!Array.isArray(item.value))
50
+ return true;
51
+ return item.value.some(filterItem => filterItem.check === true);
52
+ }
45
53
  observeFilterConfig(newValue, oldValue) {
46
54
  if (ObjectUtils.equals(newValue, oldValue))
47
55
  return;
@@ -268,7 +276,7 @@ export class SnkFilterBar {
268
276
  getFilterItems() {
269
277
  const pinnedItems = [];
270
278
  const unpinnedItems = [];
271
- this.filterConfig
279
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b))
272
280
  .filter(this.filterActiveFilter)
273
281
  .forEach((item, index) => {
274
282
  item = ObjectUtils.copy(item);
@@ -330,19 +338,23 @@ export class SnkFilterBar {
330
338
  }
331
339
  }
332
340
  async loadConfigFromStorage(clearCache) {
333
- if (clearCache) {
334
- await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
341
+ try {
342
+ if (clearCache) {
343
+ await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
344
+ }
345
+ let config;
346
+ if (this.customFilterBarConfig) {
347
+ config = await this.customFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
348
+ }
349
+ else {
350
+ config = await ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
351
+ }
352
+ this.filterConfig = config.map(item => this.normalizeItem(item));
353
+ this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
354
+ }
355
+ catch (e) {
356
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), e);
335
357
  }
336
- return new Promise(accept => {
337
- ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
338
- .then((filters) => {
339
- accept();
340
- this.filterConfig = filters.map(item => this.normalizeItem(item));
341
- })
342
- .catch(reason => {
343
- throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
344
- });
345
- });
346
358
  }
347
359
  attachDataUnit() {
348
360
  if (this.dataUnit == undefined) {
@@ -469,6 +481,32 @@ export class SnkFilterBar {
469
481
  }
470
482
  static get properties() {
471
483
  return {
484
+ "customFilterBarConfig": {
485
+ "type": "unknown",
486
+ "mutable": false,
487
+ "complexType": {
488
+ "original": "(configName: string, resourceId: string, options: any) => Promise<Array<SnkFilterItemConfig>>",
489
+ "resolved": "(configName: string, resourceId: string, options: any) => Promise<SnkFilterItemConfig[]>",
490
+ "references": {
491
+ "Promise": {
492
+ "location": "global"
493
+ },
494
+ "Array": {
495
+ "location": "global"
496
+ },
497
+ "SnkFilterItemConfig": {
498
+ "location": "import",
499
+ "path": "./filter-item/snk-filter-item"
500
+ }
501
+ }
502
+ },
503
+ "required": false,
504
+ "optional": true,
505
+ "docs": {
506
+ "tags": [],
507
+ "text": "Loader customizado para carregar as configura\u00E7\u00F5es"
508
+ }
509
+ },
472
510
  "dataUnit": {
473
511
  "type": "unknown",
474
512
  "mutable": true,
@@ -87,7 +87,7 @@ export class SnkForm {
87
87
  if (this.resourceID == undefined) {
88
88
  this.resourceID = await ResourceIDUtils.getResourceID();
89
89
  }
90
- this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
90
+ this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
91
91
  this.addFormLegacyConfig();
92
92
  await this._configManager.loadConfig();
93
93
  }
@@ -117,7 +117,7 @@ export class SnkForm {
117
117
  if (!this._dataUnit || !this._dataState) {
118
118
  return undefined;
119
119
  }
120
- return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, 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._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
120
+ return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, 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 &&
121
121
  h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
122
122
  }
123
123
  static get is() { return "snk-form"; }
@@ -1,11 +1,13 @@
1
1
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
2
2
  import { ObjectUtils, StringUtils } from "@sankhyalabs/core";
3
3
  import { FormConfigFetcher } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
4
+ import { TAB_NAMES } from "../../lib/utils/constants";
4
5
  export class SnkFormConfigManager {
5
- constructor(configName, resourceID, onConfigChange) {
6
+ constructor(configName, resourceID, onConfigChange, dataUnit) {
6
7
  this._resourceID = resourceID;
7
8
  this._configName = configName;
8
9
  this._onConfigChange = onConfigChange;
10
+ this._dataUnit = dataUnit;
9
11
  }
10
12
  addFormLegacyConfig(legacyConfigName) {
11
13
  if (this._configName) {
@@ -16,6 +18,7 @@ export class SnkFormConfigManager {
16
18
  return new Promise(resolve => {
17
19
  ConfigStorage.loadFormConfig(this._configName, this._resourceID)
18
20
  .then((config) => {
21
+ config = this.buildFormMetadataUITabs(config);
19
22
  this.setConfig(config);
20
23
  resolve(config);
21
24
  })
@@ -24,6 +27,10 @@ export class SnkFormConfigManager {
24
27
  });
25
28
  });
26
29
  }
30
+ getEmptyConfig() {
31
+ const config = this.buildFormMetadataUITabs({ fields: [], emptyConfig: true }, true);
32
+ return config;
33
+ }
27
34
  saveConfig(config) {
28
35
  const configToSave = ObjectUtils.copy(config);
29
36
  return new Promise(accept => {
@@ -67,25 +74,36 @@ export class SnkFormConfigManager {
67
74
  }
68
75
  return updatingCardConfig;
69
76
  }
70
- getFieldsList(dataUnit, descriptionFilter) {
77
+ hasConfig(config) {
78
+ var _a;
79
+ const currentConfig = config !== null && config !== void 0 ? config : this._config;
80
+ if (currentConfig && ((_a = currentConfig.fields) === null || _a === void 0 ? void 0 : _a.length)) {
81
+ return true;
82
+ }
83
+ return false;
84
+ }
85
+ getFieldsList(descriptionFilter, forceEmptyConfig = false) {
71
86
  var _a;
72
87
  const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
73
- if (fields != undefined && fields.length > 0) {
74
- return fields.map(({ label, name, readOnly, visible, required }) => {
88
+ const hasConfig = this.hasConfig();
89
+ if (hasConfig && !forceEmptyConfig) {
90
+ return fields.map(({ label, name, readOnly, visible, required, tab }) => {
91
+ var _a;
75
92
  if (label == undefined) {
76
- const currentField = dataUnit.getField(name);
77
- 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 });
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 });
78
95
  }
79
- return { name, label, readOnly, visible, required };
96
+ return { name, label, readOnly, visible, required, tab };
80
97
  })
81
98
  .filter(field => this.isFieldVisible(field, descriptionFilter));
82
99
  }
83
- if (dataUnit != undefined) {
84
- return dataUnit.metadata.fields
85
- .filter(field => this.isFieldVisible(field, descriptionFilter))
86
- .map(({ label, name, readOnly }) => { return { label, name, readOnly }; });
100
+ if (!this._dataUnit) {
101
+ return [];
87
102
  }
88
- return [];
103
+ const filteredFields = this._dataUnit.metadata.fields
104
+ .filter(field => this.isFieldVisible(field, descriptionFilter))
105
+ .map(({ label, name, readOnly, visible, required, properties }) => ({ label, name, readOnly, visible, required, tab: properties === null || properties === void 0 ? void 0 : properties.UITabName }));
106
+ return filteredFields;
89
107
  }
90
108
  isFieldVisible(field, descriptionFilter) {
91
109
  if (field.visible === false) {
@@ -98,8 +116,8 @@ export class SnkFormConfigManager {
98
116
  const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
99
117
  return normalizedText.includes(normalizedFilter);
100
118
  }
101
- getFormConfig(dataUnit, ignoreReadOnlyFormFields) {
102
- let fields = this.getFieldsList(dataUnit);
119
+ getFormConfig(dataUnit, ignoreReadOnlyFormFields, forceEmptyConfig = false) {
120
+ let fields = this.getFieldsList(undefined, forceEmptyConfig);
103
121
  if (ignoreReadOnlyFormFields) {
104
122
  fields = fields.filter(field => {
105
123
  if (dataUnit) {
@@ -152,4 +170,42 @@ export class SnkFormConfigManager {
152
170
  async fetchDefaultConfig() {
153
171
  return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
154
172
  }
173
+ parseObjectList(object) {
174
+ if (!object) {
175
+ return [];
176
+ }
177
+ return Array.isArray(object) ? object : [object];
178
+ }
179
+ buildFormMetadataUITabs(config, forceEmptyConfig = false) {
180
+ var _a;
181
+ const hasConfig = this.hasConfig(config);
182
+ if (!forceEmptyConfig && (!this._dataUnit || hasConfig)) {
183
+ return config;
184
+ }
185
+ config = this.getFormConfig(this._dataUnit, false, true);
186
+ config.tabs = this.parseObjectList(config.tabs);
187
+ config.emptyConfig = false;
188
+ config.defaultConfiguration = true;
189
+ const fields = this._dataUnit.metadata.fields;
190
+ for (const currentField of fields) {
191
+ const field = config.fields.find(field => field.name === currentField.name);
192
+ const uiTabName = (_a = currentField.properties) === null || _a === void 0 ? void 0 : _a.UITabName;
193
+ if (!uiTabName || uiTabName === TAB_NAMES.main) {
194
+ continue;
195
+ }
196
+ const haveTab = config.tabs.some((tab) => tab.label === uiTabName);
197
+ if (!haveTab) {
198
+ config.tabs.push({
199
+ label: uiTabName,
200
+ name: uiTabName,
201
+ order: 0,
202
+ visible: true,
203
+ });
204
+ }
205
+ if (field) {
206
+ field.tab = uiTabName;
207
+ }
208
+ }
209
+ return config;
210
+ }
155
211
  }
@@ -193,6 +193,11 @@ export class SnkFormConfig {
193
193
  this.configManager.saveConfig(this.buildConfigToSave())
194
194
  .then(savedConfig => {
195
195
  ApplicationUtils.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"), { iconName: "check" });
196
+ const userOption = this._formConfigOptions
197
+ .find((config) => {
198
+ return config.origin === UserConfigType.USER;
199
+ });
200
+ this.setFormConfig(userOption);
196
201
  this.configChange.emit(savedConfig);
197
202
  });
198
203
  }
@@ -529,9 +534,12 @@ export class SnkFormConfig {
529
534
  switch (this._optionFormConfigSelected.origin) {
530
535
  case UserConfigType.DEFAULT:
531
536
  config = await this.configManager.fetchDefaultConfig();
537
+ if (!config) {
538
+ config = this.configManager.getEmptyConfig();
539
+ }
532
540
  break;
533
- case UserConfigType.DEFAULT:
534
- config = await this.configManager.fetchDefaultConfig();
541
+ default:
542
+ config = this.getConfig();
535
543
  break;
536
544
  }
537
545
  if (config != undefined) {
@@ -734,6 +742,9 @@ export class SnkFormConfig {
734
742
  if (layoutFormConfig == undefined) {
735
743
  layoutFormConfig = [];
736
744
  }
745
+ if (this._formConfig.defaultConfiguration) {
746
+ return layoutFormConfig;
747
+ }
737
748
  return this._formConfig.tabs.map((tab) => {
738
749
  return layoutFormConfig.find(config => { var _a, _b; return ((_a = tab.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = config.tab) === null || _b === void 0 ? void 0 : _b.toLowerCase()); })
739
750
  || { tab: tab.label, groups: [], visible: tab.visible };
@@ -1,11 +1,13 @@
1
1
  :host {
2
2
  --snk-grid-min-height: 300px;
3
+ --snk-grid-padding: var(--space--small);
3
4
  }
4
5
 
5
6
  .snk-grid__container {
6
7
  display: flex;
7
8
  height: 100%;
8
9
  width: 100%;
10
+ padding: var(--snk-grid-padding);
9
11
  }
10
12
 
11
13
  .snk-grid__header {
@@ -1,4 +1,4 @@
1
- import { h, Fragment } from '@stencil/core';
1
+ import { h, Fragment, } from '@stencil/core';
2
2
  import { Action as DUAction, ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
3
3
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
4
4
  import { ConfigStorage } from '../../lib/configs/ConfigStorage';
@@ -11,6 +11,7 @@ import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/
11
11
  import { CrudUtils } from '../../lib';
12
12
  import RmPrecisionCustomValueFormatter from '../../lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter';
13
13
  import ServerSideExporterProvider from '../snk-data-exporter/providers/ServerSideExporterProvider';
14
+ import { ContinuousInsertUtils } from '../../lib/utils/ContinuousInsertUtils';
14
15
  export class SnkGrid {
15
16
  constructor() {
16
17
  this._customEditors = new Map();
@@ -19,7 +20,7 @@ export class SnkGrid {
19
20
  "snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
20
21
  "snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
21
22
  "snkGridTopTaskbar.regular.singleTaskbar": [],
22
- "snkGridTopTaskbar.finish_edition": ["CANCEL", "SAVE"],
23
+ "snkGridTopTaskbar.finish_edition": ["CANCEL", "SAVE", this.handleAddFormMode()],
23
24
  "snkGridTopTaskbar.finish_edition.secondary": [],
24
25
  "snkGridTopTaskbar.finish_edition.singleTaskbar": [],
25
26
  });
@@ -32,7 +33,7 @@ export class SnkGrid {
32
33
  "snkGridHeaderTaskbar.singleTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "ATTACH", "FORM_MODE", "CONFIGURATOR", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON"],
33
34
  "snkGridHeaderTaskbar.singleTaskbar.detail.unselected": ["INSERT", "FORM_MODE", "CONFIGURATOR", "REFRESH", "MORE_OPTIONS"],
34
35
  "snkGridHeaderTaskbar.singleTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "FORM_MODE", "CONFIGURATOR", "REFRESH"],
35
- "snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"]
36
+ "snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE", this.handleAddFormMode()]
36
37
  });
37
38
  this.dataUnitInterceptor = {
38
39
  interceptAction: async (action) => {
@@ -47,6 +48,7 @@ export class SnkGrid {
47
48
  this._gridConfig = undefined;
48
49
  this._popUpGridConfig = false;
49
50
  this._showSnkFilterBar = true;
51
+ this._enableContinuousInsert = false;
50
52
  this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
51
53
  this.configName = undefined;
52
54
  this.filterBarTitle = undefined;
@@ -70,6 +72,7 @@ export class SnkGrid {
70
72
  this.filterBarLegacyConfigName = undefined;
71
73
  this.autoLoad = undefined;
72
74
  this.autoFocus = true;
75
+ this.enableGridInsert = false;
73
76
  }
74
77
  /**
75
78
  * Exibe a janela de configurações da grade.
@@ -156,6 +159,16 @@ export class SnkGrid {
156
159
  async setFocus() {
157
160
  this._grid.setFocus();
158
161
  }
162
+ async handleClick(event) {
163
+ if (this.hasToBlockEvent(event)) {
164
+ event.preventDefault();
165
+ event.stopPropagation();
166
+ await this._dataUnit.cancelEdition();
167
+ }
168
+ }
169
+ hasToBlockEvent(event) {
170
+ return this._snkFilterBar.contains(event.target) && this.enableGridInsert && this._dataUnit.hasNewRecord();
171
+ }
159
172
  async handleGridLegacyConfigName(newLegacyConfig, oldLegacyConfig) {
160
173
  if (!newLegacyConfig) {
161
174
  return;
@@ -166,6 +179,9 @@ export class SnkGrid {
166
179
  this.addGridLegacyConfigName();
167
180
  this.loadConfig();
168
181
  }
182
+ handleAddFormMode() {
183
+ return this.enableGridInsert ? TaskbarElement.FORM_MODE : "";
184
+ }
169
185
  openGridConfig() {
170
186
  this._grid.getColumnsState()
171
187
  .then((gridColumns) => {
@@ -290,13 +306,21 @@ export class SnkGrid {
290
306
  }
291
307
  parent = parent.parentElement;
292
308
  }
309
+ if (this._snkFilterBar) {
310
+ this._snkFilterBar.addEventListener('click', this.handleClick);
311
+ }
293
312
  this._rmPrecisionCustomValueFormatter = new RmPrecisionCustomValueFormatter();
294
313
  this.addGridLegacyConfigName();
295
314
  this.loadConfig();
315
+ this._continuousInsertUtils = new ContinuousInsertUtils(this._application, this.resourceID, this.configName);
316
+ if (this.enableGridInsert) {
317
+ this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
318
+ }
296
319
  }
297
320
  componentDidRender() {
321
+ var _a, _b;
298
322
  this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
299
- this.loadGridCustomFormatters(this._dataUnit.metadata.fields);
323
+ this.loadGridCustomFormatters((_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.fields);
300
324
  this.setCustomRenders();
301
325
  this.setCustomEditors();
302
326
  }
@@ -309,7 +333,7 @@ export class SnkGrid {
309
333
  const disabledButtons = [];
310
334
  if ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectionInfo) {
311
335
  if (this._dataState.selectionInfo.length > 1) {
312
- disabledButtons.push(TaskbarElement.CLONE, "ATTACH");
336
+ disabledButtons.push(TaskbarElement.CLONE, "ATTACH", TaskbarElement.UPDATE);
313
337
  }
314
338
  if (this._dataState.selectionInfo.isAllRecords()) {
315
339
  disabledButtons.push("REMOVE");
@@ -394,12 +418,21 @@ export class SnkGrid {
394
418
  eagerInitialize: true,
395
419
  itemBuilder: (actionButton, item) => this.getColumnSearch(actionButton, item)
396
420
  }];
421
+ if (this.enableGridInsert) {
422
+ hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, this.handleEnableContinuousInsert));
423
+ }
424
+ if (this.isGridInsertActive())
425
+ return hardList;
397
426
  if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
398
427
  const taskbarID = this.getTopTaskBarId();
399
428
  return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this._dataState, this.actionsList));
400
429
  }
401
430
  return hardList.concat(this.actionsList);
402
431
  }
432
+ handleEnableContinuousInsert() {
433
+ this._enableContinuousInsert = !this._enableContinuousInsert;
434
+ this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
435
+ }
403
436
  handleFilterConfigUpdated(filterConfig) {
404
437
  if (!filterConfig.length) {
405
438
  this._showSnkFilterBar = false;
@@ -411,12 +444,20 @@ export class SnkGrid {
411
444
  }
412
445
  this._showSnkFilterBar = true;
413
446
  }
447
+ getGridHeaderButtons() {
448
+ if (this.isGridInsertActive())
449
+ return TaskbarElement.MORE_OPTIONS;
450
+ return this._headerTaskbarProcessor.buttons;
451
+ }
452
+ isGridInsertActive() {
453
+ return this.enableGridInsert && this._dataUnit.hasNewRecord();
454
+ }
414
455
  render() {
415
456
  if (!this._dataUnit) {
416
457
  return undefined;
417
458
  }
418
- return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
419
- h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
459
+ return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
460
+ h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
420
461
  }
421
462
  static get is() { return "snk-grid"; }
422
463
  static get encapsulation() { return "scoped"; }
@@ -862,6 +903,24 @@ export class SnkGrid {
862
903
  "attribute": "auto-focus",
863
904
  "reflect": false,
864
905
  "defaultValue": "true"
906
+ },
907
+ "enableGridInsert": {
908
+ "type": "boolean",
909
+ "mutable": false,
910
+ "complexType": {
911
+ "original": "boolean",
912
+ "resolved": "boolean",
913
+ "references": {}
914
+ },
915
+ "required": false,
916
+ "optional": true,
917
+ "docs": {
918
+ "tags": [],
919
+ "text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
920
+ },
921
+ "attribute": "enable-grid-insert",
922
+ "reflect": false,
923
+ "defaultValue": "false"
865
924
  }
866
925
  };
867
926
  }
@@ -871,7 +930,8 @@ export class SnkGrid {
871
930
  "_dataState": {},
872
931
  "_gridConfig": {},
873
932
  "_popUpGridConfig": {},
874
- "_showSnkFilterBar": {}
933
+ "_showSnkFilterBar": {},
934
+ "_enableContinuousInsert": {}
875
935
  };
876
936
  }
877
937
  static get events() {
@@ -26,7 +26,7 @@ export class SnkSimpleBar {
26
26
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
27
27
  }
28
28
  render() {
29
- return (h("div", { class: "simple-bar__container ez-margin-vertical--medium ez-padding--extra-small" }, h("div", { class: "simple-bar__left-slot" }, h("ez-button", { class: "ez-padding-right--medium", title: this.getMessage('snkSimpleBar.backTitle'), mode: 'icon', iconName: "arrow_back", size: 'medium', onClick: () => this.exit.emit() }), h("div", { class: "simple-bar__column" }, h("h1", { class: "ez-title ez-title--primary ez-title--extra-large" }, this.label), h("ez-breadcrumb", { items: this.breadcrumbItens, onSelectedItem: ({ detail }) => this.clickBreadcrumbItem.emit(detail) }))), h("div", { class: "simple-bar__right-slot" }, h("slot", { name: "rightSlot" }))));
29
+ return (h("div", { class: "simple-bar__container ez-margin-vertical--small ez-padding--extra-small" }, h("div", { class: "simple-bar__left-slot" }, h("ez-button", { class: "ez-padding-right--medium", title: this.getMessage('snkSimpleBar.backTitle'), mode: 'icon', iconName: "arrow_back", size: 'medium', onClick: () => this.exit.emit() }), h("div", { class: "simple-bar__column" }, h("h1", { class: "ez-title ez-title--primary ez-title--extra-large" }, this.label), h("ez-breadcrumb", { items: this.breadcrumbItens, onSelectedItem: ({ detail }) => this.clickBreadcrumbItem.emit(detail) }))), h("div", { class: "simple-bar__right-slot" }, h("slot", { name: "rightSlot" }))));
30
30
  }
31
31
  static get is() { return "snk-simple-bar"; }
32
32
  static get encapsulation() { return "scoped"; }
@@ -10,7 +10,6 @@
10
10
  .simple-crud__container {
11
11
  display: grid;
12
12
  grid-template-rows: auto 1fr;
13
- row-gap: 12px;
14
13
  height: 100%;
15
14
  width: 100%;
16
15
  }