@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-76362.1 → 0.0.0-bugfix-dev-KB-78242.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 (153) hide show
  1. package/dist/cjs/{SnkMessageBuilder-7691a2c1.js → SnkMessageBuilder-bae64d0d.js} +0 -10
  2. package/dist/cjs/index-f9e81701.js +0 -8
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  5. package/dist/cjs/snk-actions-button_4.cjs.entry.js +25 -22
  6. package/dist/cjs/snk-application.cjs.entry.js +18 -2
  7. package/dist/cjs/snk-config-options_3.cjs.entry.js +17 -5
  8. package/dist/cjs/snk-crud.cjs.entry.js +8 -2
  9. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  10. package/dist/cjs/{snk-data-unit-7dbdad0e.js → snk-data-unit-3d9b6ed4.js} +26 -14
  11. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  12. package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
  13. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +9 -0
  14. package/dist/cjs/snk-filter-text.cjs.entry.js +2 -1
  15. package/dist/cjs/snk-grid.cjs.entry.js +11 -2
  16. package/dist/cjs/{snk-guides-viewer-eee43c8b.js → snk-guides-viewer-2139481c.js} +1 -1
  17. package/dist/cjs/snk-guides-viewer.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -3
  19. package/dist/cjs/snk-simple-crud.cjs.entry.js +26 -5
  20. package/dist/cjs/snk-taskbar.cjs.entry.js +40 -37
  21. package/dist/collection/collection-manifest.json +0 -3
  22. package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -26
  23. package/dist/collection/components/snk-application/snk-application.js +41 -1
  24. package/dist/collection/components/snk-crud/snk-crud.js +26 -2
  25. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +1 -1
  26. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
  27. package/dist/collection/components/snk-data-unit/snk-data-unit.js +25 -13
  28. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +2 -1
  29. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css +13 -0
  30. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +2 -2
  31. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js +8 -0
  32. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +5 -1
  33. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +20 -0
  34. package/dist/collection/components/snk-form-config/snk-form-config.js +17 -5
  35. package/dist/collection/components/snk-grid/snk-grid.js +47 -2
  36. package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +1 -0
  37. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +62 -5
  38. package/dist/collection/components/snk-taskbar/snk-taskbar.js +41 -38
  39. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +7 -1
  40. package/dist/collection/lib/message/SnkMessageBuilder.js +0 -2
  41. package/dist/components/SnkMessageBuilder.js +0 -10
  42. package/dist/components/index.d.ts +0 -3
  43. package/dist/components/index.js +0 -3
  44. package/dist/components/snk-actions-button2.js +27 -26
  45. package/dist/components/snk-application2.js +19 -2
  46. package/dist/components/snk-crud.js +9 -2
  47. package/dist/components/snk-data-unit2.js +25 -13
  48. package/dist/components/snk-detail-view2.js +2 -2
  49. package/dist/components/snk-filter-bar2.js +6 -0
  50. package/dist/components/snk-filter-item2.js +5 -1
  51. package/dist/components/snk-filter-text.js +2 -1
  52. package/dist/components/snk-form-config2.js +17 -5
  53. package/dist/components/snk-grid2.js +13 -2
  54. package/dist/components/snk-personalized-filter-editor.js +3 -3
  55. package/dist/components/snk-simple-crud2.js +29 -6
  56. package/dist/components/snk-taskbar2.js +41 -38
  57. package/dist/esm/{SnkMessageBuilder-7ace6803.js → SnkMessageBuilder-6fff4a4c.js} +0 -10
  58. package/dist/esm/index-a7d3d3f1.js +0 -8
  59. package/dist/esm/loader.js +1 -1
  60. package/dist/esm/sankhyablocks.js +1 -1
  61. package/dist/esm/snk-actions-button_4.entry.js +26 -23
  62. package/dist/esm/snk-application.entry.js +19 -3
  63. package/dist/esm/snk-config-options_3.entry.js +17 -5
  64. package/dist/esm/snk-crud.entry.js +8 -2
  65. package/dist/esm/snk-data-exporter.entry.js +2 -2
  66. package/dist/esm/{snk-data-unit-7a579dbd.js → snk-data-unit-9fa7d2b9.js} +26 -14
  67. package/dist/esm/snk-data-unit.entry.js +2 -2
  68. package/dist/esm/snk-detail-view.entry.js +3 -3
  69. package/dist/esm/snk-filter-bar_4.entry.js +10 -1
  70. package/dist/esm/snk-filter-text.entry.js +2 -1
  71. package/dist/esm/snk-grid.entry.js +11 -2
  72. package/dist/esm/{snk-guides-viewer-e8ca764a.js → snk-guides-viewer-b7ed39eb.js} +1 -1
  73. package/dist/esm/snk-guides-viewer.entry.js +1 -1
  74. package/dist/esm/snk-personalized-filter-editor.entry.js +3 -3
  75. package/dist/esm/snk-simple-crud.entry.js +27 -6
  76. package/dist/esm/snk-taskbar.entry.js +41 -38
  77. package/dist/sankhyablocks/p-0387d9d7.entry.js +1 -0
  78. package/dist/sankhyablocks/{p-f4e221b2.entry.js → p-0d2a2e9e.entry.js} +1 -1
  79. package/dist/sankhyablocks/p-17425c72.js +1 -0
  80. package/dist/sankhyablocks/p-1d3ce0d9.entry.js +1 -0
  81. package/dist/sankhyablocks/p-342eeb3b.js +1 -0
  82. package/dist/sankhyablocks/p-3728d2aa.entry.js +11 -0
  83. package/dist/sankhyablocks/p-37629dc1.entry.js +1 -0
  84. package/dist/sankhyablocks/{p-42130213.entry.js → p-4138da61.entry.js} +1 -1
  85. package/dist/sankhyablocks/p-47178038.entry.js +1 -0
  86. package/dist/sankhyablocks/p-619aeac8.entry.js +1 -0
  87. package/dist/sankhyablocks/{p-00f9fe5c.entry.js → p-7075b789.entry.js} +1 -1
  88. package/dist/sankhyablocks/p-89c92727.entry.js +1 -0
  89. package/dist/sankhyablocks/p-af7f7b3e.entry.js +1 -0
  90. package/dist/sankhyablocks/{p-b389ed49.entry.js → p-b2172152.entry.js} +1 -1
  91. package/dist/sankhyablocks/{p-e3a285a2.js → p-e97be1c8.js} +1 -1
  92. package/dist/sankhyablocks/p-ec43fcc8.entry.js +1 -0
  93. package/dist/sankhyablocks/p-f8be20c7.entry.js +1 -0
  94. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  95. package/dist/types/components/snk-actions-button/interfaces/index.d.ts +3 -0
  96. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +3 -2
  97. package/dist/types/components/snk-application/snk-application.d.ts +6 -1
  98. package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
  99. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.d.ts +7 -0
  100. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
  101. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  102. package/dist/types/components/snk-grid/snk-grid.d.ts +10 -0
  103. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +9 -0
  104. package/dist/types/components.d.ts +47 -393
  105. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
  106. package/package.json +1 -1
  107. package/react/components.d.ts +0 -3
  108. package/react/components.js +0 -3
  109. package/react/components.js.map +1 -1
  110. package/dist/cjs/input-distinct-search_2.cjs.entry.js +0 -471
  111. package/dist/cjs/snk-distinct-search.cjs.entry.js +0 -123
  112. package/dist/collection/components/snk-distinct-search/snk-distinct-search.css +0 -4
  113. package/dist/collection/components/snk-distinct-search/snk-distinct-search.js +0 -372
  114. package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.css +0 -110
  115. package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js +0 -544
  116. package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.css +0 -28
  117. package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.js +0 -593
  118. package/dist/collection/components/snk-distinct-search/utils/filter-distinct-search.js +0 -15
  119. package/dist/collection/lib/http/data-fetcher/fetchers/distinct-search-fetcher.js +0 -25
  120. package/dist/collection/lib/message/resources/snk-distinct-search.msg.js +0 -9
  121. package/dist/components/filter-distinct-search.js +0 -17
  122. package/dist/components/input-distinct-search.d.ts +0 -11
  123. package/dist/components/input-distinct-search.js +0 -6
  124. package/dist/components/input-distinct-search2.js +0 -264
  125. package/dist/components/search-modal.d.ts +0 -11
  126. package/dist/components/search-modal.js +0 -6
  127. package/dist/components/search-modal2.js +0 -264
  128. package/dist/components/snk-distinct-search.d.ts +0 -11
  129. package/dist/components/snk-distinct-search.js +0 -163
  130. package/dist/esm/input-distinct-search_2.entry.js +0 -466
  131. package/dist/esm/snk-distinct-search.entry.js +0 -119
  132. package/dist/sankhyablocks/p-0e250436.entry.js +0 -1
  133. package/dist/sankhyablocks/p-154aa2a6.entry.js +0 -11
  134. package/dist/sankhyablocks/p-18cb1acb.entry.js +0 -1
  135. package/dist/sankhyablocks/p-1dbd5c18.entry.js +0 -1
  136. package/dist/sankhyablocks/p-2aae03a1.entry.js +0 -1
  137. package/dist/sankhyablocks/p-30ebcbe0.entry.js +0 -1
  138. package/dist/sankhyablocks/p-3858a2e4.entry.js +0 -1
  139. package/dist/sankhyablocks/p-563b7c28.entry.js +0 -1
  140. package/dist/sankhyablocks/p-5b51491f.entry.js +0 -1
  141. package/dist/sankhyablocks/p-96a89d58.entry.js +0 -1
  142. package/dist/sankhyablocks/p-987c7328.entry.js +0 -1
  143. package/dist/sankhyablocks/p-c75fae8e.js +0 -1
  144. package/dist/sankhyablocks/p-d8665750.js +0 -1
  145. package/dist/sankhyablocks/p-f0aaad2b.entry.js +0 -1
  146. package/dist/types/components/snk-distinct-search/snk-distinct-search.d.ts +0 -83
  147. package/dist/types/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.d.ts +0 -105
  148. package/dist/types/components/snk-distinct-search/subcomponents/search-modal/search-modal.d.ts +0 -127
  149. package/dist/types/components/snk-distinct-search/types/index.d.ts +0 -12
  150. package/dist/types/components/snk-distinct-search/utils/filter-distinct-search.d.ts +0 -4
  151. package/dist/types/lib/http/data-fetcher/fetchers/distinct-search-fetcher.d.ts +0 -6
  152. package/dist/types/lib/message/resources/snk-distinct-search.msg.d.ts +0 -2
  153. /package/dist/collection/components/{snk-distinct-search/types → snk-actions-button/interfaces}/index.js +0 -0
@@ -16,6 +16,7 @@ import UrlUtils from "../../lib/utils/urlutils";
16
16
  import Workspace from "../../lib/workspace/workspace";
17
17
  import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
18
18
  import RequestListenerFactory from "./request-listener/RequestListenerFactory";
19
+ import PreloadManager from "../../lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager";
19
20
  /**
20
21
  * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
21
22
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
@@ -517,6 +518,16 @@ export class SnkApplication {
517
518
  async isLoadedByPk() {
518
519
  return Promise.resolve(this._isLoadedByPk);
519
520
  }
521
+ /**
522
+ * Remove registro do cache do PreLoader do dataunit.
523
+ * Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
524
+ */
525
+ async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
526
+ const records = recordsIDs.map(id => {
527
+ return { "__record__id__": id };
528
+ });
529
+ PreloadManager.removeRecords(dataUnit, records);
530
+ }
520
531
  async getAuthList(auth) {
521
532
  return await (new MGEAuthorization()).parseFromJSON(auth);
522
533
  }
@@ -1097,7 +1108,7 @@ export class SnkApplication {
1097
1108
  "mutable": false,
1098
1109
  "complexType": {
1099
1110
  "original": "LoadByPkHandler",
1100
- "resolved": "(objPK: { pk: Record<string, any>; }, redirectFrom?: string) => void",
1111
+ "resolved": "(objPK: { pk: any; }, redirectFrom?: string) => void",
1101
1112
  "references": {
1102
1113
  "LoadByPkHandler": {
1103
1114
  "location": "global"
@@ -2201,6 +2212,35 @@ export class SnkApplication {
2201
2212
  }]
2202
2213
  }
2203
2214
  },
2215
+ "preloadMangerRemoveRecord": {
2216
+ "complexType": {
2217
+ "signature": "(dataUnit: DataUnit, recordsIDs: Array<string>) => Promise<void>",
2218
+ "parameters": [{
2219
+ "tags": [],
2220
+ "text": ""
2221
+ }, {
2222
+ "tags": [],
2223
+ "text": ""
2224
+ }],
2225
+ "references": {
2226
+ "Promise": {
2227
+ "location": "global"
2228
+ },
2229
+ "DataUnit": {
2230
+ "location": "import",
2231
+ "path": "@sankhyalabs/core"
2232
+ },
2233
+ "Array": {
2234
+ "location": "global"
2235
+ }
2236
+ },
2237
+ "return": "Promise<void>"
2238
+ },
2239
+ "docs": {
2240
+ "text": "Remove registro do cache do PreLoader do dataunit.\nDeve ser usado quando existe um dataunit usando loader do application, mas o removeLoader est\u00E1 sendo sobrescrito.",
2241
+ "tags": []
2242
+ }
2243
+ },
2204
2244
  "executeSearch": {
2205
2245
  "complexType": {
2206
2246
  "signature": "(searchArgument: ISearchArgument, fieldName: string, dataUnit: DataUnit) => Promise<Array<IOption> | IOption>",
@@ -42,6 +42,7 @@ export class SnkCrud {
42
42
  this.enableGridInsert = false;
43
43
  this.domainMessagesBuilder = undefined;
44
44
  this.ignoreReadOnlyFormFields = undefined;
45
+ this.enableLockManger = false;
45
46
  this.setCustomFormTitle = undefined;
46
47
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
47
48
  }
@@ -283,11 +284,16 @@ export class SnkCrud {
283
284
  if (!isDocumentBody)
284
285
  element.focus();
285
286
  }
287
+ async function handleAddRecord() {
288
+ if (!dataUnit.hasNewRecord()) {
289
+ dataUnit.addRecord();
290
+ }
291
+ }
286
292
  keyboardManager
287
293
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
288
294
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
289
295
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
290
- .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
296
+ .bind("F8", handleAddRecord.bind(this), { description: "Adiciona um novo registro.", element: this._element })
291
297
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
292
298
  .bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
293
299
  .bind("ctrl + .", () => {
@@ -384,7 +390,7 @@ export class SnkCrud {
384
390
  return;
385
391
  }
386
392
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
387
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
393
+ return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManger: this.enableLockManger }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
388
394
  }
389
395
  static get is() { return "snk-crud"; }
390
396
  static get encapsulation() { return "scoped"; }
@@ -793,6 +799,24 @@ export class SnkCrud {
793
799
  "attribute": "ignore-read-only-form-fields",
794
800
  "reflect": false
795
801
  },
802
+ "enableLockManger": {
803
+ "type": "boolean",
804
+ "mutable": false,
805
+ "complexType": {
806
+ "original": "boolean",
807
+ "resolved": "boolean",
808
+ "references": {}
809
+ },
810
+ "required": false,
811
+ "optional": true,
812
+ "docs": {
813
+ "tags": [],
814
+ "text": "Ativa o gerenciamento de locks na grade."
815
+ },
816
+ "attribute": "enable-lock-manger",
817
+ "reflect": false,
818
+ "defaultValue": "false"
819
+ },
796
820
  "setCustomFormTitle": {
797
821
  "type": "unknown",
798
822
  "mutable": false,
@@ -247,7 +247,7 @@ export class SnkDetailView {
247
247
  render() {
248
248
  this.updateLabel();
249
249
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
250
- return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
250
+ return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", boxShadow: false }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
251
251
  }
252
252
  static get is() { return "snk-detail-view"; }
253
253
  static get encapsulation() { return "scoped"; }
@@ -440,7 +440,7 @@ export class SnkGuidesViewer {
440
440
  await this.openGuideNavigator(guideName);
441
441
  }
442
442
  if (action.type === DUAction.METADATA_LOADED) {
443
- this.loadGuides(false);
443
+ this.loadGuides(this.noGuideSelected());
444
444
  }
445
445
  }
446
446
  async addErrorBadgeToGuide(guideName) {
@@ -16,7 +16,7 @@ export class SnkDataUnit {
16
16
  this._rowMetadataCache = new Map();
17
17
  this.REGEX_DATAUNIT_NAME = /dd:\/\/(.+?)\//;
18
18
  this._dataUnitObserver = async (action) => {
19
- const duState = this.buildDataState(action.type);
19
+ const duState = await this.buildDataState(action.type);
20
20
  this.dataState = duState;
21
21
  this.messagesBuilder.currentOperation = this.getMessageOperation();
22
22
  switch (action.type) {
@@ -130,14 +130,22 @@ export class SnkDataUnit {
130
130
  async getRowMetadata(record) {
131
131
  return this.doGetRowMetadata(record);
132
132
  }
133
- doGetRowMetadata(record) {
133
+ async doGetRowMetadata(record) {
134
134
  const selectedRecord = this.dataUnit.getSelectedRecord();
135
135
  if (!record && !selectedRecord) {
136
136
  return;
137
137
  }
138
138
  const currentRecord = record || selectedRecord;
139
139
  const recordId = typeof currentRecord === 'string' ? currentRecord : currentRecord.__record__id__;
140
- const rowMetadata = this._metadataByRow.get(recordId);
140
+ let rowMetadata = this._metadataByRow.get(recordId);
141
+ /*
142
+ Nao fazemos cache de metadataByRow pra registros novos, pois a chave do mesmo
143
+ muda ao ser salvo, por isso essa tratativa é necessária para que o dataState fique com metadados
144
+ corretos nao confiando apenas no _metadataByRow
145
+ */
146
+ if (this.dataUnit.isNewRecord(recordId) && !rowMetadata) {
147
+ rowMetadata = await this.handleLoadRowMetadata(selectedRecord);
148
+ }
141
149
  if (!rowMetadata) {
142
150
  return;
143
151
  }
@@ -331,7 +339,7 @@ export class SnkDataUnit {
331
339
  case Action.RECORDS_COPIED:
332
340
  return this.interceptRecordsCopied(action);
333
341
  case Action.DATA_CHANGED:
334
- await this.handleLoadRowMetadata(action);
342
+ await this.handleLoadRowMetadata(action.payload);
335
343
  return await this.interceptDataChange(action);
336
344
  case Action.CHANGING_DATA:
337
345
  return await this.interceptDataChange(action);
@@ -351,8 +359,9 @@ export class SnkDataUnit {
351
359
  return action;
352
360
  }
353
361
  }
354
- async handleLoadRowMetadata(action) {
355
- const record = action.type === Action.DATA_CHANGED ? action.payload : action.payload.changes[0].record;
362
+ async handleLoadRowMetadata(record) {
363
+ if (!record)
364
+ return;
356
365
  const keysPayload = Object.keys(record);
357
366
  const rmpField = keysPayload.find((field) => this._fieldsWithRmp.includes(field));
358
367
  if (rmpField) {
@@ -431,7 +440,7 @@ export class SnkDataUnit {
431
440
  isAllowed(flag) {
432
441
  return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
433
442
  }
434
- buildDataState(actionType) {
443
+ async buildDataState(actionType) {
435
444
  var _a;
436
445
  const selectionInfo = this.dataUnit.getSelectionInfo();
437
446
  const isStartingInsertionMode = (this.dataUnit.hasDirtyRecords() || this.dataUnit.hasWaitingChanges()) && (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isEmpty());
@@ -439,7 +448,7 @@ export class SnkDataUnit {
439
448
  let rowMetadata = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata;
440
449
  const allowedOverwrite = [Action.SELECTION_CHANGED, Action.EDITION_CANCELED, Action.NEXT_SELECTED, Action.PREVIOUS_SELECTED];
441
450
  if (selectedRecord && (!rowMetadata || allowedOverwrite.includes(actionType))) {
442
- rowMetadata = this.doGetRowMetadata(selectedRecord);
451
+ rowMetadata = await this.doGetRowMetadata(selectedRecord);
443
452
  }
444
453
  else if (rowMetadata) {
445
454
  rowMetadata.getProp = this.buildGetPropRowMetadata(rowMetadata);
@@ -461,17 +470,20 @@ export class SnkDataUnit {
461
470
  });
462
471
  }
463
472
  async handleDataSaved(action) {
464
- const newRowMetadata = await this.handleLoadRowMetadata(action);
473
+ var _a, _b, _c;
474
+ const newRowMetadata = await this.handleLoadRowMetadata((_c = (_b = (_a = action === null || action === void 0 ? void 0 : action.payload) === null || _a === void 0 ? void 0 : _a.changes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.record);
465
475
  if (newRowMetadata) {
466
476
  newRowMetadata.getProp = this.buildGetPropRowMetadata(newRowMetadata);
467
477
  }
468
478
  const recordId = action.payload.records[0].__record__id__;
469
479
  this._metadataByRow.set(recordId, newRowMetadata);
470
- this.dataState = this.buildDataState();
471
- if (this.ignoreSaveMessage) {
480
+ this.dataState = await this.buildDataState();
481
+ let saveOperation = action.payload.changes[0]._operation.toLowerCase();
482
+ if (saveOperation == 'copy')
483
+ saveOperation = OperationMap.CLONE;
484
+ if (this.ignoreSaveMessage && ![OperationMap.CLONE, OperationMap.INSERT].includes(saveOperation)) {
472
485
  return;
473
486
  }
474
- const saveOperation = action.payload.changes[0]._operation.toLowerCase();
475
487
  const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
476
488
  if (msg != undefined) {
477
489
  this.showSuccessMessage(msg);
@@ -564,7 +576,7 @@ export class SnkDataUnit {
564
576
  const { records } = this.getMetadataByRow(this.dataUnit);
565
577
  this.dataUnit.records = records;
566
578
  }
567
- this.dataState = this.buildDataState();
579
+ this.dataState = await this.buildDataState();
568
580
  let resolver;
569
581
  while (resolver = this._onDataUnitResolve.pop()) {
570
582
  resolver(this.dataUnit);
@@ -18,10 +18,11 @@ export class SnkFilterText {
18
18
  }
19
19
  }
20
20
  render() {
21
+ var _a;
21
22
  if (!this.config) {
22
23
  return undefined;
23
24
  }
24
- return (h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value }));
25
+ return (h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, cleanValueMask: true }));
25
26
  }
26
27
  static get is() { return "snk-filter-text"; }
27
28
  static get properties() {
@@ -48,6 +48,7 @@
48
48
  .SnkFilterPersonalized_list-actions {
49
49
  display: none;
50
50
  align-items: center;
51
+ gap: var(--space--3xs);
51
52
  }
52
53
 
53
54
  .SnkFilterPersonalized_list-item--modal:hover .SnkFilterPersonalized_list-actions {
@@ -64,3 +65,15 @@
64
65
  .SnkFilterPersonalized_list-item--chip :first-of-type {
65
66
  gap: var(--space--3xs);
66
67
  }
68
+
69
+ .SnkFilterPersonalized_list-icon {
70
+ --ez-icon--color: var(--title--primary, #2B3A54);
71
+ cursor: pointer;
72
+ }
73
+
74
+ .SnkFilterPersonalized_list-icon:hover {
75
+ outline: none;
76
+ color: var(--color--primary-600, #007a5a);
77
+ fill: var(--color--primary-600, #007a5a);
78
+ --ez-icon--color: var(--color--primary-600, #007a5a);
79
+ }
@@ -41,13 +41,13 @@ export class SnkFilterPersonalized {
41
41
  var _a, _b;
42
42
  const CheckboxElement = () => (h("ez-check", Object.assign({ class: "SnkFilterPersonalized_checkbox", id: `param_${item.id}`, key: item.id, value: item.visible, label: item.label, onEzChange: ({ detail: visible }) => this.handleItemChange.bind(this)(visible, item.id) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`checkboxFilter_${item.id}`)}` })));
43
43
  const isVariable = !!((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters.length);
44
- return (h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, h("div", { class: "ez-flex ez-flex--align-items-center ez-margin-right--small ez-size-width--full" }, h(CheckboxElement, null), this.buildModalListActions(item, isVariable))), (item.visible && isVariable) && (h("div", { class: "ez-row ez-padding--small" }, this.getFormField(item)))));
44
+ return (h("div", { class: `${!this.isModalMode() ? "SnkFilterPersonalized_list-item--chip" : ""}` }, h("li", { class: `${this.isModalMode() ? "SnkFilterPersonalized_list-item--modal" : ""}` }, h("div", { class: "ez-flex ez-flex--align-items-center ez-flex--justify-between ez-size-width--full" }, h(CheckboxElement, null), this.buildModalListActions(item, isVariable))), (item.visible && isVariable) && (h("div", { class: "ez-row ez-padding--small" }, this.getFormField(item)))));
45
45
  }
46
46
  buildModalListActions(item, isVariable) {
47
47
  if (!this.isModalMode())
48
48
  return;
49
49
  return (this.isModalMode() ?
50
- h("div", { class: "SnkFilterPersonalized_list-actions" }, h("ez-button", { size: "small", mode: "icon", iconName: "edit", title: this.getMessage('snkPersonalizedFilter.listActions.edit'), onClick: () => this.editFilter.emit(item.id) }), h("ez-button", { size: "small", mode: "icon", iconName: "delete", title: this.getMessage('snkPersonalizedFilter.listActions.delete'), onClick: this.handleDeleteFilter.bind(this, item) }))
50
+ h("div", { class: "SnkFilterPersonalized_list-actions" }, h("ez-icon", { class: 'SnkFilterPersonalized_list-icon', iconName: "edit", title: this.getMessage('snkPersonalizedFilter.listActions.edit'), onClick: () => this.editFilter.emit(item.id) }), h("ez-icon", { class: 'SnkFilterPersonalized_list-icon', iconName: "delete", title: this.getMessage('snkPersonalizedFilter.listActions.delete'), onClick: this.handleDeleteFilter.bind(this, item) }))
51
51
  :
52
52
  isVariable && (h("ez-badge", Object.assign({ class: "ez-badge--warning-subtle ez-margin-right--small", label: this.getMessage('snkPersonalizedFilter.info.badgeVariable'), size: "medium" }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`variableBadge_${item.id}`)}` }))));
53
53
  }
@@ -0,0 +1,8 @@
1
+ var FilterItemTypeMask;
2
+ (function (FilterItemTypeMask) {
3
+ FilterItemTypeMask["CEP"] = "#####-###";
4
+ FilterItemTypeMask["TELEFONE"] = "(##) ####-####";
5
+ FilterItemTypeMask["CPF"] = "###.###.###-##";
6
+ FilterItemTypeMask["CNPJ"] = "##.###.###/####-##";
7
+ })(FilterItemTypeMask || (FilterItemTypeMask = {}));
8
+ export default FilterItemTypeMask;
@@ -1,4 +1,4 @@
1
- import { ElementIDUtils, FloatingManager, DateUtils } from '@sankhyalabs/core';
1
+ import { ElementIDUtils, FloatingManager, DateUtils, MaskFormatter } from '@sankhyalabs/core';
2
2
  import { h, Host } from '@stencil/core';
3
3
  import FilterItemType from './filter-item-type.enum';
4
4
  import { FilterNumberVariation } from './editors/enum/filterNumberVariation';
@@ -211,6 +211,10 @@ export class SnkFilterItem {
211
211
  return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
212
212
  }
213
213
  }
214
+ if (this.config.mask) {
215
+ const _maskFormatter = new MaskFormatter(this.config.mask);
216
+ return `${label}: ${_maskFormatter.format(value)}`;
217
+ }
214
218
  return `${label}: ${value}`;
215
219
  }
216
220
  return label;
@@ -38,6 +38,7 @@ export class SnkFilterBar {
38
38
  this.disablePersonalizedFilter = undefined;
39
39
  this.filterBarLegacyConfigName = undefined;
40
40
  this.autoLoad = undefined;
41
+ this.afterApplyConfig = undefined;
41
42
  this.allowDefault = undefined;
42
43
  this.scrollerLocked = false;
43
44
  this.showPersonalizedFilter = false;
@@ -174,6 +175,7 @@ export class SnkFilterBar {
174
175
  return this.filterConfig.find(item => item.type === FilterItemType.PERSONALIZED);
175
176
  }
176
177
  async processAfterUpdateConfig() {
178
+ var _a;
177
179
  if (this._loadingPending) {
178
180
  if (await this._application.isLoadedByPk() && !this._configUpdated)
179
181
  return;
@@ -188,6 +190,7 @@ export class SnkFilterBar {
188
190
  if (this._configUpdated) {
189
191
  this._configUpdated = false;
190
192
  ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
193
+ (_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
191
194
  }
192
195
  }
193
196
  async doLoadData(forceReload = false) {
@@ -392,7 +395,9 @@ export class SnkFilterBar {
392
395
  */
393
396
  async showFilterModal() {
394
397
  const callbackOnApplyFilter = (filters) => {
398
+ var _a;
395
399
  this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
400
+ (_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
396
401
  };
397
402
  let filtersConfigCopy = ObjectUtils.copy(this.filterConfig);
398
403
  filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
@@ -689,6 +694,21 @@ export class SnkFilterBar {
689
694
  },
690
695
  "attribute": "auto-load",
691
696
  "reflect": false
697
+ },
698
+ "afterApplyConfig": {
699
+ "type": "unknown",
700
+ "mutable": false,
701
+ "complexType": {
702
+ "original": "() => void",
703
+ "resolved": "() => void",
704
+ "references": {}
705
+ },
706
+ "required": false,
707
+ "optional": true,
708
+ "docs": {
709
+ "tags": [],
710
+ "text": "Fun\u00E7\u00E3o chamada depois de aplicar os filtros."
711
+ }
692
712
  }
693
713
  };
694
714
  }
@@ -679,7 +679,7 @@ export class SnkFormConfig {
679
679
  }
680
680
  }
681
681
  getLayoutFormConfig() {
682
- var _a, _b;
682
+ var _a, _b, _c;
683
683
  if (((_a = this._formConfig) === null || _a === void 0 ? void 0 : _a.fields) == undefined) {
684
684
  return;
685
685
  }
@@ -692,7 +692,11 @@ export class SnkFormConfig {
692
692
  if (hasField == undefined) {
693
693
  fields.push(field);
694
694
  const fieldMD = this.dataUnit.getField(field.name);
695
- if (fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.visible) {
695
+ /**
696
+ * Quando um campo é ocultado pelo dev, mas queremos manter ele na config precisamos fazer essa tratativa.
697
+ */
698
+ const visibleOnConfig = ((_b = fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.properties) === null || _b === void 0 ? void 0 : _b.visibleOnConfig) === true && (fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.visible) === false;
699
+ if ((fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.visible) || visibleOnConfig) {
696
700
  if (field.label == undefined || field.label === "") {
697
701
  field.label = fieldMD.label;
698
702
  }
@@ -708,7 +712,7 @@ export class SnkFormConfig {
708
712
  visible = configTabs[0].visible;
709
713
  }
710
714
  }
711
- const tabLabel = ((_b = field.tab) === null || _b === void 0 ? void 0 : _b.label) || field.tab;
715
+ const tabLabel = ((_c = field.tab) === null || _c === void 0 ? void 0 : _c.label) || field.tab;
712
716
  if (visible !== null) {
713
717
  tab = { tab: tabLabel, groups: [], visible };
714
718
  }
@@ -793,8 +797,16 @@ export class SnkFormConfig {
793
797
  for (const field of this._formConfig.fields) {
794
798
  fieldsFormConfig.push(field);
795
799
  }
796
- const listFieldsAvailable = fieldsMetadata.filter(({ name: _nameFieldMetadado, visible: _visibleMetadado }) => _visibleMetadado === true
797
- && fieldsFormConfig.some(({ name: _nameFieldForm }) => _nameFieldForm === _nameFieldMetadado) === false);
800
+ const listFieldsAvailable = fieldsMetadata.filter(({ name: _nameFieldMetadado, visible: _visibleMetadado, properties }) => {
801
+ const hasCfg = fieldsFormConfig.some(({ name: _nameFieldForm }) => _nameFieldForm === _nameFieldMetadado);
802
+ /**
803
+ * Quando a visibilidade de um campo é alterada pelo dataunit, mas o desenvolvedor deseja que o mesmo continue
804
+ * sendo apresentado no configurador, precisamos fazer essa tratativa, verificando se o campo não tem configuração
805
+ */
806
+ if (!hasCfg && properties.visibleOnConfig === true && !_visibleMetadado)
807
+ return properties.visibleOnConfig;
808
+ return _visibleMetadado === true && hasCfg === false;
809
+ });
798
810
  this._fieldsAvailable = listFieldsAvailable;
799
811
  this._listEnabledFields = listFieldsAvailable;
800
812
  if (((_b = this._filterFieldsAvailable) === null || _b === void 0 ? void 0 : _b.value) != undefined) {
@@ -73,6 +73,8 @@ export class SnkGrid {
73
73
  this.autoLoad = undefined;
74
74
  this.autoFocus = true;
75
75
  this.enableGridInsert = false;
76
+ this.enableLockManger = false;
77
+ this.boxShadow = true;
76
78
  }
77
79
  /**
78
80
  * Exibe a janela de configurações da grade.
@@ -160,10 +162,17 @@ export class SnkGrid {
160
162
  this._grid.setFocus();
161
163
  }
162
164
  async handleClick(event) {
165
+ var _a;
163
166
  if (this.hasToBlockEvent(event)) {
164
167
  event.preventDefault();
165
168
  event.stopPropagation();
166
- await this._dataUnit.cancelEdition();
169
+ if (!await this._dataUnit.cancelEdition())
170
+ return;
171
+ const newEvent = new event.constructor(event.type, event);
172
+ (_a = event.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(newEvent);
173
+ }
174
+ if (this._grid && !this._grid.contains(event.target)) {
175
+ this._grid.stopEdit();
167
176
  }
168
177
  }
169
178
  hasToBlockEvent(event) {
@@ -454,7 +463,7 @@ export class SnkGrid {
454
463
  return undefined;
455
464
  }
456
465
  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 &&
457
- 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 }))));
466
+ 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, enableLockManger: this.enableLockManger, boxShadow: this.boxShadow }, 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 }))));
458
467
  }
459
468
  static get is() { return "snk-grid"; }
460
469
  static get encapsulation() { return "scoped"; }
@@ -918,6 +927,42 @@ export class SnkGrid {
918
927
  "attribute": "enable-grid-insert",
919
928
  "reflect": false,
920
929
  "defaultValue": "false"
930
+ },
931
+ "enableLockManger": {
932
+ "type": "boolean",
933
+ "mutable": false,
934
+ "complexType": {
935
+ "original": "boolean",
936
+ "resolved": "boolean",
937
+ "references": {}
938
+ },
939
+ "required": false,
940
+ "optional": true,
941
+ "docs": {
942
+ "tags": [],
943
+ "text": "Ativa o gerenciamento de locks na grade."
944
+ },
945
+ "attribute": "enable-lock-manger",
946
+ "reflect": false,
947
+ "defaultValue": "false"
948
+ },
949
+ "boxShadow": {
950
+ "type": "boolean",
951
+ "mutable": false,
952
+ "complexType": {
953
+ "original": "boolean",
954
+ "resolved": "boolean",
955
+ "references": {}
956
+ },
957
+ "required": false,
958
+ "optional": true,
959
+ "docs": {
960
+ "tags": [],
961
+ "text": "Altera visualmente as sombras e bordas do componente\nQuando true, aplica o padr\u00E3o de sombras ao componente (Utilizar quando for o elemento principal do layout)\nQuando false, aplica o padr\u00E3o de outline ao componente (Utilizar quando estiver contido em outro elemento como um painel ou pop-up)"
962
+ },
963
+ "attribute": "box-shadow",
964
+ "reflect": false,
965
+ "defaultValue": "true"
921
966
  }
922
967
  };
923
968
  }
@@ -25,6 +25,7 @@
25
25
 
26
26
  ez-grid {
27
27
  --ez-grid__container--shadow: none;
28
+ --ez-grid__container--outline: none;
28
29
  --ez-grid--min-height: var(--snk-simple-crud-grid--min-height);
29
30
  }
30
31