@sankhyalabs/sankhyablocks 8.1.0-rc.3 → 8.1.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 (67) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  3. package/dist/cjs/snk-application.cjs.entry.js +31 -4
  4. package/dist/cjs/snk-crud.cjs.entry.js +3 -7
  5. package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
  6. package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-d5109a08.js} +3 -4
  7. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-detail-view.cjs.entry.js +15 -6
  9. package/dist/cjs/snk-grid.cjs.entry.js +1 -4
  10. package/dist/cjs/{snk-guides-viewer-27f87d90.js → snk-guides-viewer-aa3e3bfa.js} +3 -2
  11. package/dist/cjs/snk-guides-viewer.cjs.entry.js +1 -1
  12. package/dist/cjs/snk-simple-crud.cjs.entry.js +9 -3
  13. package/dist/collection/components/snk-crud/snk-crud.js +5 -26
  14. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +14 -24
  15. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +3 -20
  16. package/dist/collection/components/snk-data-unit/snk-data-unit.js +3 -21
  17. package/dist/collection/components/snk-grid/snk-grid.js +2 -60
  18. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +9 -21
  19. package/dist/components/snk-application2.js +29 -1
  20. package/dist/components/snk-crud.js +3 -8
  21. package/dist/components/snk-data-unit2.js +3 -5
  22. package/dist/components/snk-detail-view2.js +17 -10
  23. package/dist/components/snk-grid2.js +1 -7
  24. package/dist/components/snk-simple-crud2.js +9 -4
  25. package/dist/esm/loader.js +1 -1
  26. package/dist/esm/sankhyablocks.js +1 -1
  27. package/dist/esm/snk-application.entry.js +29 -2
  28. package/dist/esm/snk-crud.entry.js +3 -7
  29. package/dist/esm/snk-data-exporter.entry.js +1 -1
  30. package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-3a0bbfcb.js} +3 -4
  31. package/dist/esm/snk-data-unit.entry.js +1 -1
  32. package/dist/esm/snk-detail-view.entry.js +15 -6
  33. package/dist/esm/snk-grid.entry.js +1 -4
  34. package/dist/esm/{snk-guides-viewer-c47cd45e.js → snk-guides-viewer-aa386f6e.js} +3 -2
  35. package/dist/esm/snk-guides-viewer.entry.js +1 -1
  36. package/dist/esm/snk-simple-crud.entry.js +9 -3
  37. package/dist/sankhyablocks/{p-cfd7da4a.entry.js → p-0a94fdbd.entry.js} +1 -1
  38. package/dist/sankhyablocks/p-1e0189ff.entry.js +1 -0
  39. package/dist/sankhyablocks/p-50d72261.entry.js +1 -0
  40. package/dist/sankhyablocks/{p-e5845241.entry.js → p-7c7764bf.entry.js} +1 -1
  41. package/dist/sankhyablocks/p-8fdc3108.js +1 -0
  42. package/dist/sankhyablocks/p-9edad923.js +1 -0
  43. package/dist/sankhyablocks/p-abdcac04.entry.js +1 -0
  44. package/dist/sankhyablocks/p-b0847056.entry.js +1 -0
  45. package/dist/sankhyablocks/p-ccbfb1cf.entry.js +1 -0
  46. package/dist/sankhyablocks/p-f92fda53.entry.js +11 -0
  47. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  48. package/dist/types/components/snk-crud/snk-crud.d.ts +0 -5
  49. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -5
  50. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +0 -4
  51. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +0 -4
  52. package/dist/types/components/snk-grid/snk-grid.d.ts +0 -13
  53. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -4
  54. package/dist/types/components.d.ts +0 -64
  55. package/package.json +1 -1
  56. package/dist/cjs/auth-fetcher-58237931.js +0 -34
  57. package/dist/components/auth-fetcher.js +0 -32
  58. package/dist/esm/auth-fetcher-83a946f8.js +0 -32
  59. package/dist/sankhyablocks/p-22c6fe1a.entry.js +0 -1
  60. package/dist/sankhyablocks/p-34a1357a.entry.js +0 -1
  61. package/dist/sankhyablocks/p-4721c3db.js +0 -1
  62. package/dist/sankhyablocks/p-564efc43.js +0 -1
  63. package/dist/sankhyablocks/p-7e285d6c.entry.js +0 -11
  64. package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
  65. package/dist/sankhyablocks/p-c57bd935.entry.js +0 -1
  66. package/dist/sankhyablocks/p-f88c45bf.js +0 -1
  67. package/dist/sankhyablocks/p-fe010e54.entry.js +0 -1
@@ -10,7 +10,6 @@ import { GuideBuilder } from '../GuideBuilder';
10
10
  export class SnkDetailView {
11
11
  constructor() {
12
12
  this._disabledButtons = undefined;
13
- this._currentView = undefined;
14
13
  this.attachmentRegisterKey = undefined;
15
14
  this.formConfigManager = undefined;
16
15
  this.dataUnitName = undefined;
@@ -22,8 +21,12 @@ export class SnkDetailView {
22
21
  this.dataState = undefined;
23
22
  this.messagesBuilder = undefined;
24
23
  this.branchGuide = undefined;
25
- this.canEdit = true;
26
24
  }
25
+ // /**
26
+ // * Define se a edição está habilitada na grid.
27
+ // */
28
+ // @Prop()
29
+ // canEdit: boolean = true;
27
30
  observerDataState(newValue, oldValue) {
28
31
  const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
29
32
  const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
@@ -136,8 +139,10 @@ export class SnkDetailView {
136
139
  updateViewStack(viewStack) {
137
140
  var _a, _b;
138
141
  this._viewStack = viewStack;
139
- this._currentView = this.selectedForm ? 1 : 0;
140
- (_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this._currentView);
142
+ // TODO: remove to gridEditor
143
+ (_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this.selectedForm ? 1 : 0);
144
+ // this._currentView = this.selectedForm ? 1 : 0;
145
+ // this._viewStack?.show?.(this._currentView);
141
146
  }
142
147
  getFormFields() {
143
148
  if (this.selectedForm && this._formMetadata) {
@@ -192,7 +197,11 @@ export class SnkDetailView {
192
197
  render() {
193
198
  this.updateLabel();
194
199
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
195
- 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 }))), 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 }, 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 }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
200
+ 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),
201
+ // ignoreSaveMessage={this._currentView === VIEW_MODE.GRID}
202
+ 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,
203
+ // canEdit={this.canEdit}
204
+ isDetail: true }))), 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 }, 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 }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
196
205
  }
197
206
  static get is() { return "snk-detail-view"; }
198
207
  static get encapsulation() { return "scoped"; }
@@ -398,31 +407,12 @@ export class SnkDetailView {
398
407
  "tags": [],
399
408
  "text": ""
400
409
  }
401
- },
402
- "canEdit": {
403
- "type": "boolean",
404
- "mutable": false,
405
- "complexType": {
406
- "original": "boolean",
407
- "resolved": "boolean",
408
- "references": {}
409
- },
410
- "required": false,
411
- "optional": false,
412
- "docs": {
413
- "tags": [],
414
- "text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
415
- },
416
- "attribute": "can-edit",
417
- "reflect": false,
418
- "defaultValue": "true"
419
410
  }
420
411
  };
421
412
  }
422
413
  static get states() {
423
414
  return {
424
415
  "_disabledButtons": {},
425
- "_currentView": {},
426
416
  "attachmentRegisterKey": {}
427
417
  };
428
418
  }
@@ -21,7 +21,6 @@ export class SnkGuidesViewer {
21
21
  this.selectedGuide = undefined;
22
22
  this.taskbarManager = undefined;
23
23
  this.messagesBuilder = undefined;
24
- this.canEdit = true;
25
24
  this.presentationMode = undefined;
26
25
  this._breadcrumbItems = [];
27
26
  this._guides = undefined;
@@ -224,7 +223,9 @@ export class SnkGuidesViewer {
224
223
  else {
225
224
  detailBranch = this.selectedGuide;
226
225
  }
227
- content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
226
+ content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`,
227
+ // canEdit={this.canEdit}
228
+ onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
228
229
  }
229
230
  else {
230
231
  const cardId = this.selectedGuide.id;
@@ -548,24 +549,6 @@ export class SnkGuidesViewer {
548
549
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
549
550
  }
550
551
  },
551
- "canEdit": {
552
- "type": "boolean",
553
- "mutable": false,
554
- "complexType": {
555
- "original": "boolean",
556
- "resolved": "boolean",
557
- "references": {}
558
- },
559
- "required": false,
560
- "optional": false,
561
- "docs": {
562
- "tags": [],
563
- "text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
564
- },
565
- "attribute": "can-edit",
566
- "reflect": false,
567
- "defaultValue": "true"
568
- },
569
552
  "presentationMode": {
570
553
  "type": "string",
571
554
  "mutable": false,
@@ -11,9 +11,9 @@ export class SnkDataUnit {
11
11
  const duState = this.buildDataState();
12
12
  this.dataState = duState;
13
13
  if (action.type === Action.DATA_SAVED) {
14
- if (this.ignoreSaveMessage) {
15
- return;
16
- }
14
+ // if(this.ignoreSaveMessage){
15
+ // return
16
+ // }
17
17
  const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
18
18
  if (msg != undefined) {
19
19
  this.showSuccessMessage(msg);
@@ -59,7 +59,6 @@ export class SnkDataUnit {
59
59
  this.beforeSave = undefined;
60
60
  this.afterSave = undefined;
61
61
  this.useCancelConfirm = true;
62
- this.ignoreSaveMessage = undefined;
63
62
  this.configName = undefined;
64
63
  }
65
64
  observePageSize() {
@@ -591,23 +590,6 @@ export class SnkDataUnit {
591
590
  "reflect": false,
592
591
  "defaultValue": "true"
593
592
  },
594
- "ignoreSaveMessage": {
595
- "type": "boolean",
596
- "mutable": false,
597
- "complexType": {
598
- "original": "boolean",
599
- "resolved": "boolean",
600
- "references": {}
601
- },
602
- "required": false,
603
- "optional": false,
604
- "docs": {
605
- "tags": [],
606
- "text": "Respons\u00E1vel por evitar a mensagem de sucesso ao salvar."
607
- },
608
- "attribute": "ignore-save-message",
609
- "reflect": false
610
- },
611
593
  "configName": {
612
594
  "type": "string",
613
595
  "mutable": false,
@@ -8,6 +8,7 @@ import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
8
8
  import store from "../../lib/store";
9
9
  import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionListDataSource';
10
10
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
11
+ // import { IRecordValidator } from '@sankhyalabs/ezui/dist/types/utils/form/interfaces';
11
12
  export class SnkGrid {
12
13
  constructor() {
13
14
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
@@ -36,9 +37,6 @@ export class SnkGrid {
36
37
  this.multipleSelection = undefined;
37
38
  this.presentationMode = PresentationMode.PRIMARY;
38
39
  this.messagesBuilder = undefined;
39
- this.useEnterLikeTab = false;
40
- this.recordsValidator = undefined;
41
- this.canEdit = true;
42
40
  }
43
41
  /**
44
42
  * Exibe a janela de configurações da grade.
@@ -307,7 +305,7 @@ export class SnkGrid {
307
305
  return undefined;
308
306
  }
309
307
  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" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
310
- 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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), 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), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
308
+ 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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource, selectionToastConfig: this.selectionToastConfig }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), 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), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
311
309
  }
312
310
  static get is() { return "snk-grid"; }
313
311
  static get encapsulation() { return "scoped"; }
@@ -503,62 +501,6 @@ export class SnkGrid {
503
501
  "tags": [],
504
502
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
505
503
  }
506
- },
507
- "useEnterLikeTab": {
508
- "type": "boolean",
509
- "mutable": false,
510
- "complexType": {
511
- "original": "boolean",
512
- "resolved": "boolean",
513
- "references": {}
514
- },
515
- "required": false,
516
- "optional": false,
517
- "docs": {
518
- "tags": [],
519
- "text": "Quando verdadeiro, o ENTER far\u00E1 a navega\u00E7\u00E3o como se fosse a tecla TAB na grade."
520
- },
521
- "attribute": "use-enter-like-tab",
522
- "reflect": false,
523
- "defaultValue": "false"
524
- },
525
- "recordsValidator": {
526
- "type": "unknown",
527
- "mutable": false,
528
- "complexType": {
529
- "original": "IRecordValidator",
530
- "resolved": "IRecordValidator",
531
- "references": {
532
- "IRecordValidator": {
533
- "location": "import",
534
- "path": "@sankhyalabs/ezui/dist/types/utils/form/interfaces"
535
- }
536
- }
537
- },
538
- "required": false,
539
- "optional": false,
540
- "docs": {
541
- "tags": [],
542
- "text": "Validador respons\u00E1vel por checar a integridade das informa\u00E7\u00F5es do registro."
543
- }
544
- },
545
- "canEdit": {
546
- "type": "boolean",
547
- "mutable": false,
548
- "complexType": {
549
- "original": "boolean",
550
- "resolved": "boolean",
551
- "references": {}
552
- },
553
- "required": false,
554
- "optional": false,
555
- "docs": {
556
- "tags": [],
557
- "text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
558
- },
559
- "attribute": "can-edit",
560
- "reflect": false,
561
- "defaultValue": "true"
562
504
  }
563
505
  };
564
506
  }
@@ -11,6 +11,11 @@ export class SnkSimpleCrud {
11
11
  this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
12
12
  this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
13
13
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
14
+ // /**
15
+ // * Quando verdadeiro, o ENTER fará a navegação como se fosse a tecla TAB na grade.
16
+ // */
17
+ // @Prop()
18
+ // useEnterLikeTab: boolean = false;
14
19
  this._taskbarProcessor = new TaskbarProcessor({
15
20
  "snkSimpleCrudTaskbar.form_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.GRID_MODE),
16
21
  "snkSimpleCrudTaskbar.grid_regular": this.resolveInMemoryBtns(this.REGULAR_DEFAULT_BTNS).concat(TaskbarElement.FORM_MODE),
@@ -29,7 +34,6 @@ export class SnkSimpleCrud {
29
34
  this.useCancelConfirm = true;
30
35
  this.taskbarManager = undefined;
31
36
  this.messagesBuilder = undefined;
32
- this.useEnterLikeTab = false;
33
37
  }
34
38
  resolveInMemoryBtns(taskbarButtons) {
35
39
  const newTaskBarConfig = [...taskbarButtons];
@@ -174,9 +178,11 @@ export class SnkSimpleCrud {
174
178
  }
175
179
  render() {
176
180
  var _a;
177
- return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
181
+ return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail),
182
+ // ignoreSaveMessage={this._currentViewMode === VIEW_MODE.GRID}
183
+ onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
178
184
  ? undefined
179
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
185
+ : this._multiSelectionListDataSource }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
180
186
  }
181
187
  static get is() { return "snk-simple-crud"; }
182
188
  static get encapsulation() { return "scoped"; }
@@ -369,24 +375,6 @@ export class SnkSimpleCrud {
369
375
  "tags": [],
370
376
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
371
377
  }
372
- },
373
- "useEnterLikeTab": {
374
- "type": "boolean",
375
- "mutable": false,
376
- "complexType": {
377
- "original": "boolean",
378
- "resolved": "boolean",
379
- "references": {}
380
- },
381
- "required": false,
382
- "optional": false,
383
- "docs": {
384
- "tags": [],
385
- "text": "Quando verdadeiro, o ENTER far\u00E1 a navega\u00E7\u00E3o como se fosse a tecla TAB na grade."
386
- },
387
- "attribute": "use-enter-like-tab",
388
- "reflect": false,
389
- "defaultValue": "false"
390
378
  }
391
379
  };
392
380
  }
@@ -5,7 +5,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { P as PesquisaFetcher } from './pesquisa-fetcher.js';
6
6
  import { G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage.js';
7
7
  import { D as DataUnitFetcher } from './dataunit-fetcher.js';
8
- import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher.js';
8
+ import { R as ResourceFetcher } from './resource-fetcher.js';
9
9
  import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
10
10
  import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
11
11
 
@@ -226,6 +226,34 @@ class ParametersFetcher {
226
226
 
227
227
  const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return !![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
228
228
 
229
+ class AuthFetcher extends ResourceFetcher {
230
+ getData(resourceID) {
231
+ const completePath = `cfg://auth/${resourceID}`;
232
+ return new Promise((resolve, reject) => {
233
+ this.loadResource(completePath)
234
+ .then((loadedResource) => {
235
+ let auth = ObjectUtils.stringToObject(loadedResource);
236
+ if (auth && typeof (auth) === 'object') {
237
+ resolve(auth);
238
+ }
239
+ }).catch((error) => {
240
+ reject(error);
241
+ });
242
+ });
243
+ }
244
+ }
245
+ var AutorizationType;
246
+ (function (AutorizationType) {
247
+ AutorizationType["INSERT"] = "I";
248
+ AutorizationType["UPDATE"] = "A";
249
+ AutorizationType["REMOVE"] = "E";
250
+ AutorizationType["SHOW"] = "C";
251
+ AutorizationType["CONFIG"] = "F";
252
+ AutorizationType["CONFIG_NUMBER"] = "N";
253
+ AutorizationType["CLONE"] = "D";
254
+ AutorizationType["CONFIG_GRID"] = "G";
255
+ })(AutorizationType || (AutorizationType = {}));
256
+
229
257
  const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
230
258
 
231
259
  const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -5,7 +5,6 @@ import './DataFetcher.js';
5
5
  import './pesquisa-fetcher.js';
6
6
  import { P as PresentationMode } from './index2.js';
7
7
  import { V as VIEW_MODE } from './constants.js';
8
- import { A as AutorizationType } from './auth-fetcher.js';
9
8
  import { d as defineCustomElement$v } from './snk-actions-button2.js';
10
9
  import { d as defineCustomElement$u } from './snk-attach2.js';
11
10
  import { d as defineCustomElement$t } from './snk-config-options2.js';
@@ -49,7 +48,6 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
49
48
  this._dataState = undefined;
50
49
  this.attachmentRegisterKey = undefined;
51
50
  this._currentViewMode = VIEW_MODE.GRID;
52
- this._canEdit = undefined;
53
51
  this.configName = undefined;
54
52
  this.selectionToastConfig = undefined;
55
53
  this.showActionButtons = false;
@@ -60,7 +58,6 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
60
58
  this.multipleSelection = true;
61
59
  this.presentationMode = PresentationMode.PRIMARY;
62
60
  this.messagesBuilder = undefined;
63
- this.useEnterLikeTab = false;
64
61
  }
65
62
  /**
66
63
  * Usado para alternar a visão entre GRID e FORM externamente.
@@ -144,7 +141,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
144
141
  }
145
142
  componentWillLoad() {
146
143
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
147
- application.hasAccess(AutorizationType.UPDATE).then(canEdit => this._canEdit = canEdit);
144
+ // application.hasAccess(AutorizationType.UPDATE).then(canEdit=>this._canEdit = canEdit)
148
145
  let parent = this._element.parentElement;
149
146
  while (parent) {
150
147
  if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
@@ -191,8 +188,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
191
188
  this.configuratorCancel.emit();
192
189
  }
193
190
  render() {
194
- this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
195
- return (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, "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, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit }, 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 }, 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') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
191
+ // this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
192
+ return (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, "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, selectionToastConfig: this.selectionToastConfig }, 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" }, 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') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
196
193
  }
197
194
  get _element() { return this; }
198
195
  static get watchers() { return {
@@ -210,12 +207,10 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
210
207
  "multipleSelection": [4, "multiple-selection"],
211
208
  "presentationMode": [1, "presentation-mode"],
212
209
  "messagesBuilder": [1040],
213
- "useEnterLikeTab": [4, "use-enter-like-tab"],
214
210
  "_dataUnit": [32],
215
211
  "_dataState": [32],
216
212
  "attachmentRegisterKey": [32],
217
213
  "_currentViewMode": [32],
218
- "_canEdit": [32],
219
214
  "goToView": [64],
220
215
  "openConfigurator": [64],
221
216
  "closeConfigurator": [64],
@@ -21,9 +21,9 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
21
21
  const duState = this.buildDataState();
22
22
  this.dataState = duState;
23
23
  if (action.type === Action.DATA_SAVED) {
24
- if (this.ignoreSaveMessage) {
25
- return;
26
- }
24
+ // if(this.ignoreSaveMessage){
25
+ // return
26
+ // }
27
27
  const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
28
28
  if (msg != undefined) {
29
29
  this.showSuccessMessage(msg);
@@ -69,7 +69,6 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
69
69
  this.beforeSave = undefined;
70
70
  this.afterSave = undefined;
71
71
  this.useCancelConfirm = true;
72
- this.ignoreSaveMessage = undefined;
73
72
  this.configName = undefined;
74
73
  }
75
74
  observePageSize() {
@@ -434,7 +433,6 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
434
433
  "beforeSave": [16],
435
434
  "afterSave": [16],
436
435
  "useCancelConfirm": [4, "use-cancel-confirm"],
437
- "ignoreSaveMessage": [4, "ignore-save-message"],
438
436
  "configName": [1, "config-name"],
439
437
  "getDataUnit": [64],
440
438
  "getSelectedRecordsIDsInfo": [64]
@@ -58,7 +58,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
58
58
  this.selectedGuide = undefined;
59
59
  this.taskbarManager = undefined;
60
60
  this.messagesBuilder = undefined;
61
- this.canEdit = true;
62
61
  this.presentationMode = undefined;
63
62
  this._breadcrumbItems = [];
64
63
  this._guides = undefined;
@@ -261,7 +260,9 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
261
260
  else {
262
261
  detailBranch = this.selectedGuide;
263
262
  }
264
- content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
263
+ content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`,
264
+ // canEdit={this.canEdit}
265
+ onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
265
266
  }
266
267
  else {
267
268
  const cardId = this.selectedGuide.id;
@@ -368,7 +369,6 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
368
369
  "selectedGuide": [16],
369
370
  "taskbarManager": [16],
370
371
  "messagesBuilder": [1040],
371
- "canEdit": [4, "can-edit"],
372
372
  "presentationMode": [1, "presentation-mode"],
373
373
  "_breadcrumbItems": [32],
374
374
  "_guides": [32],
@@ -587,7 +587,6 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
587
587
  this.snkDetailGuidesChange = createEvent(this, "snkDetailGuidesChange", 7);
588
588
  this.snkSwitchGuide = createEvent(this, "snkSwitchGuide", 7);
589
589
  this._disabledButtons = undefined;
590
- this._currentView = undefined;
591
590
  this.attachmentRegisterKey = undefined;
592
591
  this.formConfigManager = undefined;
593
592
  this.dataUnitName = undefined;
@@ -599,8 +598,12 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
599
598
  this.dataState = undefined;
600
599
  this.messagesBuilder = undefined;
601
600
  this.branchGuide = undefined;
602
- this.canEdit = true;
603
601
  }
602
+ // /**
603
+ // * Define se a edição está habilitada na grid.
604
+ // */
605
+ // @Prop()
606
+ // canEdit: boolean = true;
604
607
  observerDataState(newValue, oldValue) {
605
608
  const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
606
609
  const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
@@ -713,8 +716,10 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
713
716
  updateViewStack(viewStack) {
714
717
  var _a, _b;
715
718
  this._viewStack = viewStack;
716
- this._currentView = this.selectedForm ? 1 : 0;
717
- (_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this._currentView);
719
+ // TODO: remove to gridEditor
720
+ (_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this.selectedForm ? 1 : 0);
721
+ // this._currentView = this.selectedForm ? 1 : 0;
722
+ // this._viewStack?.show?.(this._currentView);
718
723
  }
719
724
  getFormFields() {
720
725
  if (this.selectedForm && this._formMetadata) {
@@ -769,7 +774,11 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
769
774
  render() {
770
775
  this.updateLabel();
771
776
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
772
- 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 }))), 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 }, 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 }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
777
+ 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),
778
+ // ignoreSaveMessage={this._currentView === VIEW_MODE.GRID}
779
+ 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,
780
+ // canEdit={this.canEdit}
781
+ isDetail: true }))), 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 }, 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 }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
773
782
  }
774
783
  static get watchers() { return {
775
784
  "dataState": ["observerDataState"]
@@ -786,9 +795,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
786
795
  "dataState": [1040],
787
796
  "messagesBuilder": [1040],
788
797
  "branchGuide": [16],
789
- "canEdit": [4, "can-edit"],
790
798
  "_disabledButtons": [32],
791
- "_currentView": [32],
792
799
  "attachmentRegisterKey": [32],
793
800
  "changeViewMode": [64],
794
801
  "configGrid": [64],
@@ -58,9 +58,6 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
58
58
  this.multipleSelection = undefined;
59
59
  this.presentationMode = PresentationMode.PRIMARY;
60
60
  this.messagesBuilder = undefined;
61
- this.useEnterLikeTab = false;
62
- this.recordsValidator = undefined;
63
- this.canEdit = true;
64
61
  }
65
62
  /**
66
63
  * Exibe a janela de configurações da grade.
@@ -329,7 +326,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
329
326
  return undefined;
330
327
  }
331
328
  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" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
332
- 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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), 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), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
329
+ 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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource, selectionToastConfig: this.selectionToastConfig }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), 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), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
333
330
  }
334
331
  get _element() { return this; }
335
332
  static get style() { return snkGridCss; }
@@ -343,9 +340,6 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
343
340
  "multipleSelection": [4, "multiple-selection"],
344
341
  "presentationMode": [1, "presentation-mode"],
345
342
  "messagesBuilder": [1040],
346
- "useEnterLikeTab": [4, "use-enter-like-tab"],
347
- "recordsValidator": [16],
348
- "canEdit": [4, "can-edit"],
349
343
  "_dataUnit": [32],
350
344
  "_dataState": [32],
351
345
  "_gridConfig": [32],