@sankhyalabs/sankhyablocks 8.16.0-dev.97 → 8.16.0-dev.99

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 (135) hide show
  1. package/dist/cjs/{ClientSideExporterProvider-9bd6fa5a.js → ClientSideExporterProvider-cc82b68a.js} +2 -3
  2. package/dist/cjs/{ConfigStorage-6b633b10.js → ConfigStorage-2235f35e.js} +1 -1
  3. package/dist/cjs/{pesquisa-fetcher-30cab386.js → ISave-62fbb1dd.js} +8 -0
  4. package/dist/cjs/{SnkFormConfigManager-d680be08.js → SnkFormConfigManager-6637cd6b.js} +2 -2
  5. package/dist/cjs/{auth-fetcher-24ba4135.js → auth-fetcher-abad589f.js} +1 -1
  6. package/dist/cjs/{form-config-fetcher-e0a512c3.js → form-config-fetcher-db332748.js} +14 -0
  7. package/dist/cjs/index-f9e81701.js +2 -2
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +3 -4
  10. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  11. package/dist/cjs/{snk-actions-button_5.cjs.entry.js → snk-actions-button_7.cjs.entry.js} +63 -4
  12. package/dist/cjs/snk-application.cjs.entry.js +48 -5
  13. package/dist/cjs/snk-attach.cjs.entry.js +3 -4
  14. package/dist/cjs/snk-config-options_3.cjs.entry.js +3 -3
  15. package/dist/cjs/snk-configurator.cjs.entry.js +8 -1
  16. package/dist/cjs/snk-crud.cjs.entry.js +5 -5
  17. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -3
  18. package/dist/cjs/snk-detail-view.cjs.entry.js +5 -6
  19. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +4 -3
  20. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -2
  21. package/dist/cjs/snk-grid.cjs.entry.js +4 -5
  22. package/dist/cjs/{snk-guides-viewer-c588a295.js → snk-guides-viewer-0e4f3b1a.js} +3 -4
  23. package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -6
  24. package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -2
  25. package/dist/cjs/snk-pesquisa.cjs.entry.js +9 -10
  26. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
  27. package/dist/collection/collection-manifest.json +2 -0
  28. package/dist/collection/components/snk-application/snk-application.js +41 -0
  29. package/dist/collection/components/snk-configurator/snk-configurator.js +26 -1
  30. package/dist/collection/components/snk-crud/snk-crud.js +20 -1
  31. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +2 -1
  32. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.css +3 -0
  33. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +73 -0
  34. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.css +78 -0
  35. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js +57 -0
  36. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +20 -1
  37. package/dist/collection/lib/configs/LayoutFormConfig.js +25 -0
  38. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +14 -0
  39. package/dist/components/form-config-fetcher.js +14 -0
  40. package/dist/components/index.d.ts +2 -0
  41. package/dist/components/index.js +2 -0
  42. package/dist/components/snk-application2.js +45 -0
  43. package/dist/components/snk-attach2.js +34 -22
  44. package/dist/components/snk-configurator2.js +22 -2
  45. package/dist/components/snk-crud.js +76 -62
  46. package/dist/components/snk-detail-view2.js +105 -83
  47. package/dist/components/snk-filter-item2.js +2 -1
  48. package/dist/components/snk-layout-form-config.d.ts +11 -0
  49. package/dist/components/snk-layout-form-config.js +6 -0
  50. package/dist/components/snk-layout-form-config2.js +73 -0
  51. package/dist/components/snk-simple-crud2.js +33 -19
  52. package/dist/components/snk-view-representation.d.ts +11 -0
  53. package/dist/components/snk-view-representation.js +6 -0
  54. package/dist/components/snk-view-representation2.js +41 -0
  55. package/dist/esm/{ClientSideExporterProvider-e42c5a48.js → ClientSideExporterProvider-8191676b.js} +2 -3
  56. package/dist/esm/{ConfigStorage-e5c1f4c0.js → ConfigStorage-9bd805d6.js} +1 -1
  57. package/dist/esm/{pesquisa-fetcher-e26c3295.js → ISave-7d546dce.js} +9 -1
  58. package/dist/esm/{SnkFormConfigManager-1efd102b.js → SnkFormConfigManager-fbc6a9a8.js} +2 -2
  59. package/dist/esm/{auth-fetcher-9987c66e.js → auth-fetcher-07d33333.js} +1 -1
  60. package/dist/esm/{form-config-fetcher-34becd23.js → form-config-fetcher-ac17cff4.js} +14 -0
  61. package/dist/esm/index-a7d3d3f1.js +2 -2
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/pesquisa-grid_2.entry.js +2 -3
  64. package/dist/esm/sankhyablocks.js +1 -1
  65. package/dist/esm/{snk-actions-button_5.entry.js → snk-actions-button_7.entry.js} +63 -6
  66. package/dist/esm/snk-application.entry.js +47 -4
  67. package/dist/esm/snk-attach.entry.js +3 -4
  68. package/dist/esm/snk-config-options_3.entry.js +3 -3
  69. package/dist/esm/snk-configurator.entry.js +8 -1
  70. package/dist/esm/snk-crud.entry.js +5 -5
  71. package/dist/esm/snk-data-exporter.entry.js +2 -3
  72. package/dist/esm/snk-detail-view.entry.js +5 -6
  73. package/dist/esm/snk-filter-bar_4.entry.js +4 -3
  74. package/dist/esm/snk-filter-modal-item.entry.js +2 -2
  75. package/dist/esm/snk-grid.entry.js +4 -5
  76. package/dist/esm/{snk-guides-viewer-c38641c5.js → snk-guides-viewer-80a8709c.js} +3 -4
  77. package/dist/esm/snk-guides-viewer.entry.js +5 -6
  78. package/dist/esm/snk-personalized-filter.entry.js +2 -2
  79. package/dist/esm/snk-pesquisa.entry.js +2 -3
  80. package/dist/esm/snk-simple-crud.entry.js +7 -7
  81. package/dist/sankhyablocks/p-01512409.js +26 -0
  82. package/dist/sankhyablocks/p-02c6dc9f.entry.js +1 -0
  83. package/dist/sankhyablocks/{p-6c43fcde.entry.js → p-0bcd4757.entry.js} +1 -1
  84. package/dist/sankhyablocks/{p-ef076eea.js → p-108fee57.js} +2 -2
  85. package/dist/sankhyablocks/{p-3fcb90d6.js → p-13f17dab.js} +1 -1
  86. package/dist/sankhyablocks/{p-d3b9b377.entry.js → p-340e2447.entry.js} +1 -1
  87. package/dist/sankhyablocks/p-35fcf37e.js +1 -0
  88. package/dist/sankhyablocks/p-3a36d4b3.entry.js +1 -0
  89. package/dist/sankhyablocks/{p-a77bdadc.js → p-48729c8c.js} +1 -1
  90. package/dist/sankhyablocks/p-513af002.entry.js +1 -0
  91. package/dist/sankhyablocks/{p-e5657d22.entry.js → p-5fea0816.entry.js} +1 -1
  92. package/dist/sankhyablocks/p-950e3cbe.entry.js +1 -0
  93. package/dist/sankhyablocks/p-9907cf67.entry.js +1 -0
  94. package/dist/sankhyablocks/p-af58c9d7.entry.js +1 -0
  95. package/dist/sankhyablocks/p-c5acb7ba.entry.js +11 -0
  96. package/dist/sankhyablocks/p-c7c6eab7.entry.js +1 -0
  97. package/dist/sankhyablocks/{p-3ce68be5.js → p-cb9d725a.js} +1 -1
  98. package/dist/sankhyablocks/p-d1f04e2c.js +1 -0
  99. package/dist/sankhyablocks/p-d2065bb4.entry.js +1 -0
  100. package/dist/sankhyablocks/p-dc617b0c.entry.js +1 -0
  101. package/dist/sankhyablocks/p-e5d8891d.entry.js +1 -0
  102. package/dist/sankhyablocks/{p-e66bcb5c.entry.js → p-f467153c.entry.js} +1 -1
  103. package/dist/sankhyablocks/p-f861bfcb.entry.js +1 -0
  104. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  105. package/dist/types/components/snk-application/snk-application.d.ts +10 -0
  106. package/dist/types/components/snk-configurator/snk-configurator.d.ts +6 -0
  107. package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
  108. package/dist/types/components/snk-layout-form-config/snk-layout-form-config.d.ts +15 -0
  109. package/dist/types/components/snk-layout-form-config/snk-view-representation/snk-view-representation.d.ts +10 -0
  110. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
  111. package/dist/types/components.d.ts +69 -1
  112. package/dist/types/lib/configs/LayoutFormConfig.d.ts +11 -0
  113. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +6 -0
  114. package/package.json +1 -1
  115. package/react/components.d.ts +2 -0
  116. package/react/components.js +2 -0
  117. package/react/components.js.map +1 -1
  118. package/dist/cjs/ISave-e91b70a7.js +0 -9
  119. package/dist/esm/ISave-d8c8bc59.js +0 -9
  120. package/dist/sankhyablocks/p-04acdc3a.entry.js +0 -1
  121. package/dist/sankhyablocks/p-04b96ffe.js +0 -1
  122. package/dist/sankhyablocks/p-05fda408.entry.js +0 -1
  123. package/dist/sankhyablocks/p-17af0b1c.entry.js +0 -1
  124. package/dist/sankhyablocks/p-21749402.js +0 -1
  125. package/dist/sankhyablocks/p-22ddc147.js +0 -26
  126. package/dist/sankhyablocks/p-27d12f8f.entry.js +0 -1
  127. package/dist/sankhyablocks/p-3bab7e9c.entry.js +0 -1
  128. package/dist/sankhyablocks/p-4b01cbad.entry.js +0 -11
  129. package/dist/sankhyablocks/p-4c9adf1c.entry.js +0 -1
  130. package/dist/sankhyablocks/p-6b898a51.entry.js +0 -1
  131. package/dist/sankhyablocks/p-9523fc40.entry.js +0 -1
  132. package/dist/sankhyablocks/p-99ab1e1d.entry.js +0 -1
  133. package/dist/sankhyablocks/p-a18de25e.js +0 -1
  134. package/dist/sankhyablocks/p-be2e5f36.entry.js +0 -1
  135. package/dist/sankhyablocks/p-d571e243.entry.js +0 -1
@@ -18,6 +18,8 @@ import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
18
18
  import RequestListenerFactory from "./request-listener/RequestListenerFactory";
19
19
  import PreloadManager from "../../lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager";
20
20
  import { TEMPLATES_SKELETON } from "../../lib/utils/constants";
21
+ import { LayoutFormConfig } from "../../lib/configs/LayoutFormConfig";
22
+ import { FormConfigFetcher } from "../../lib";
21
23
  /**
22
24
  * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
23
25
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
@@ -37,6 +39,8 @@ export class SnkApplication {
37
39
  this._pendingActions = new Map;
38
40
  this._loadPkParameter = null;
39
41
  this._isLoadedByPk = false;
42
+ this._formConfigFetcher = new FormConfigFetcher();
43
+ this._LayoutFormConfigSingleton = LayoutFormConfig.getInstance();
40
44
  this._applicationReady = false;
41
45
  this._templateSkeleton = TEMPLATES_SKELETON.GRID;
42
46
  this._activeScrimWindow = false;
@@ -111,6 +115,14 @@ export class SnkApplication {
111
115
  async getKeyboardManager() {
112
116
  return Promise.resolve(this._keyboardManager);
113
117
  }
118
+ /**
119
+ * Obtém o notificador de Layout de formulario.
120
+ *
121
+ * @return {LayoutFormConfig} the Configurador de Layout do Formulario
122
+ */
123
+ async getLayoutFormConfig() {
124
+ return Promise.resolve(this._LayoutFormConfigSingleton);
125
+ }
114
126
  /**
115
127
  * Obtém `true` caso o usuário logado seja o SUP.
116
128
  */
@@ -1026,6 +1038,12 @@ export class SnkApplication {
1026
1038
  ConfigStorage.preload(this.applicationResourceID, this.configName, legacyConfig);
1027
1039
  document.addEventListener("click", () => Workspace.applicationClick());
1028
1040
  this._waitingAppReady.forEach(resolve => resolve());
1041
+ this.setLayoutFormConfig();
1042
+ }
1043
+ async setLayoutFormConfig() {
1044
+ const response = await this._formConfigFetcher.fetchLayoutFormConfig('formColCfg.' + this.applicationResourceID);
1045
+ const config = isNaN(Number(response === null || response === void 0 ? void 0 : response.config)) ? null : Number(response === null || response === void 0 ? void 0 : response.config);
1046
+ this._LayoutFormConfigSingleton.setConfig(config);
1029
1047
  }
1030
1048
  connectedCallback() {
1031
1049
  this._isBrowserTypeElectron = UserAgentUtils.isElectron();
@@ -1379,6 +1397,29 @@ export class SnkApplication {
1379
1397
  }]
1380
1398
  }
1381
1399
  },
1400
+ "getLayoutFormConfig": {
1401
+ "complexType": {
1402
+ "signature": "() => Promise<LayoutFormConfig>",
1403
+ "parameters": [],
1404
+ "references": {
1405
+ "Promise": {
1406
+ "location": "global"
1407
+ },
1408
+ "LayoutFormConfig": {
1409
+ "location": "import",
1410
+ "path": "../../lib/configs/LayoutFormConfig"
1411
+ }
1412
+ },
1413
+ "return": "Promise<LayoutFormConfig>"
1414
+ },
1415
+ "docs": {
1416
+ "text": "Obt\u00E9m o notificador de Layout de formulario.",
1417
+ "tags": [{
1418
+ "name": "return",
1419
+ "text": "the Configurador de Layout do Formulario"
1420
+ }]
1421
+ }
1422
+ },
1382
1423
  "isUserSup": {
1383
1424
  "complexType": {
1384
1425
  "signature": "() => Promise<boolean>",
@@ -11,6 +11,7 @@ export class SnkConfigurator {
11
11
  this.resourceID = undefined;
12
12
  this.viewMode = VIEW_MODE.GRID;
13
13
  this.customContainerId = undefined;
14
+ this.layoutFormConfig = false;
14
15
  this.messagesBuilder = undefined;
15
16
  }
16
17
  /**
@@ -71,6 +72,12 @@ export class SnkConfigurator {
71
72
  var _a;
72
73
  return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, {});
73
74
  }
75
+ handleSave() {
76
+ if (this.layoutFormConfig) {
77
+ this._snkLayoutFormConfig.save();
78
+ }
79
+ this.save.emit();
80
+ }
74
81
  componentWillLoad() {
75
82
  this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
76
83
  if (this._application) {
@@ -94,7 +101,7 @@ export class SnkConfigurator {
94
101
  insideCustomElementsContainer === null || insideCustomElementsContainer === void 0 ? void 0 : insideCustomElementsContainer.appendChild(configuratorCustomElement);
95
102
  }
96
103
  render() {
97
- return (h("ez-modal", { ref: (element) => (this.modal = element), opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small", scrim: "light" }, h("div", { class: "snk-configurator" }, h("div", { class: "snk-configurator__header" }, h("label", { class: "snk-configurator__title" }, this.getMessage('snkConfigurator.titleConfigurations')), h("div", { class: "snk-configurator__button-close" }, h("ez-button", { mode: "icon", iconName: "close", size: "medium", onClick: () => this.closeConfig() }))), h("div", { class: "snk-configurator__main" }, h("ez-collapsible-box", { boxBordered: true, label: "Modo de visualiza\u00E7\u00E3o ", headerSize: "medium", class: "snk-configurator__collapsable-box" }, h("ez-radio-button", { value: this.getViewModeValue().toString(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelGrid'), value: VIEW_MODE.GRID }), h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelForm'), value: VIEW_MODE.FORM })), h("div", { class: "snk-configurator__collsable-box-action" }, h("ez-button", { label: this.viewMode === VIEW_MODE.GRID ? this.getMessage('snkConfigurator.labelConfigGrid') : this.getMessage('snkConfigurator.labelConfigForm'), class: "snk-configurator__button-config ez-button--secondary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }))), h("div", { id: "slotContainer", class: "snk-configurator__outline" })), this.showActionButtons && (h("div", { class: "snk-configurator__action-buttons" }, h("ez-button", { label: "Cancelar", onClick: () => this.cancel.emit() }), h("ez-button", { label: "Salvar", onClick: () => this.save.emit(), class: "ez-button--primary" }))))));
104
+ return (h("ez-modal", { ref: (element) => (this.modal = element), opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small", scrim: "light" }, h("div", { class: "snk-configurator" }, h("div", { class: "snk-configurator__header" }, h("label", { class: "snk-configurator__title" }, this.getMessage('snkConfigurator.titleConfigurations')), h("div", { class: "snk-configurator__button-close" }, h("ez-button", { mode: "icon", iconName: "close", size: "medium", onClick: () => this.closeConfig() }))), h("div", { class: "snk-configurator__main" }, h("ez-collapsible-box", { boxBordered: true, label: "Modo de visualiza\u00E7\u00E3o ", headerSize: "medium", class: "snk-configurator__collapsable-box" }, h("ez-radio-button", { value: this.getViewModeValue().toString(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelGrid'), value: VIEW_MODE.GRID }), h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelForm'), value: VIEW_MODE.FORM })), h("div", { class: "snk-configurator__collsable-box-action" }, h("ez-button", { label: this.viewMode === VIEW_MODE.GRID ? this.getMessage('snkConfigurator.labelConfigGrid') : this.getMessage('snkConfigurator.labelConfigForm'), class: "snk-configurator__button-config ez-button--secondary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }))), this.layoutFormConfig && h("ez-collapsible-box", { boxBordered: true, value: true, label: "Layout do formul\u00E1rio", headerSize: "medium", class: "snk-configurator__collapsable-box ez-margin-top--medium" }, h("div", { class: 'ez-flex ez-flex--column ez-size-width--full' }, h("snk-layout-form-config", { ref: (ref) => this._snkLayoutFormConfig = ref }))), h("div", { id: "slotContainer", class: "snk-configurator__outline" })), this.showActionButtons && (h("div", { class: "snk-configurator__action-buttons" }, h("ez-button", { label: "Cancelar", onClick: () => this.cancel.emit() }), h("ez-button", { label: "Salvar", onClick: () => this.handleSave(), class: "ez-button--primary" }))))));
98
105
  }
99
106
  static get is() { return "snk-configurator"; }
100
107
  static get encapsulation() { return "scoped"; }
@@ -202,6 +209,24 @@ export class SnkConfigurator {
202
209
  "attribute": "custom-container-id",
203
210
  "reflect": false
204
211
  },
212
+ "layoutFormConfig": {
213
+ "type": "boolean",
214
+ "mutable": false,
215
+ "complexType": {
216
+ "original": "boolean",
217
+ "resolved": "boolean",
218
+ "references": {}
219
+ },
220
+ "required": false,
221
+ "optional": false,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": "Define se o LayoutFormConfig ser\u00E1 exibido no configurador."
225
+ },
226
+ "attribute": "layout-form-config",
227
+ "reflect": false,
228
+ "defaultValue": "false"
229
+ },
205
230
  "messagesBuilder": {
206
231
  "type": "unknown",
207
232
  "mutable": true,
@@ -47,6 +47,7 @@ export class SnkCrud {
47
47
  this.ignoreReadOnlyFormFields = undefined;
48
48
  this.setCustomFormTitle = undefined;
49
49
  this.strategyExporter = ExporterStrategy.SERVER_SIDE;
50
+ this.layoutFormConfig = false;
50
51
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
51
52
  }
52
53
  /**
@@ -382,7 +383,7 @@ export class SnkCrud {
382
383
  return;
383
384
  }
384
385
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
385
- 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, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter }, 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" }))));
386
+ 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, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter }, 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, layoutFormConfig: this.layoutFormConfig })), 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" }))));
386
387
  }
387
388
  static get is() { return "snk-crud"; }
388
389
  static get encapsulation() { return "scoped"; }
@@ -864,6 +865,24 @@ export class SnkCrud {
864
865
  "attribute": "strategy-exporter",
865
866
  "reflect": false,
866
867
  "defaultValue": "ExporterStrategy.SERVER_SIDE"
868
+ },
869
+ "layoutFormConfig": {
870
+ "type": "boolean",
871
+ "mutable": false,
872
+ "complexType": {
873
+ "original": "boolean",
874
+ "resolved": "boolean",
875
+ "references": {}
876
+ },
877
+ "required": false,
878
+ "optional": false,
879
+ "docs": {
880
+ "tags": [],
881
+ "text": "Define se o LayoutFormConfig ser\u00E1 exibido no configurador."
882
+ },
883
+ "attribute": "layout-form-config",
884
+ "reflect": false,
885
+ "defaultValue": "false"
867
886
  }
868
887
  };
869
888
  }
@@ -24,10 +24,11 @@ export class SnkFilterItem {
24
24
  */
25
25
  async showUp(open = false) {
26
26
  return new Promise(resolve => {
27
+ var _a;
27
28
  this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
28
29
  if (open) {
29
30
  this._closeCallback = resolve;
30
- this._chipElement.blur();
31
+ (_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.blur();
31
32
  window.requestAnimationFrame(() => {
32
33
  this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
33
34
  this._popover.show();
@@ -0,0 +1,73 @@
1
+ import { h } from '@stencil/core';
2
+ import { FormConfigFetcher } from '../../lib';
3
+ import { ApplicationContext } from '@sankhyalabs/core';
4
+ import { FormLayout } from '@sankhyalabs/ezui/dist/collection/utils';
5
+ const FORM_COL_CONFIG_PREFIX = 'formColCfg.';
6
+ export class SnkLayoutFormConfig {
7
+ constructor() {
8
+ this._formConfigFetcher = new FormConfigFetcher();
9
+ this.layoutType = FormLayout.CASCADE;
10
+ }
11
+ /**
12
+ * Salva o tipo de layout escolhido. Sem retorno.
13
+ */
14
+ async save() {
15
+ this._LayoutFormConfigSingleton.setConfig(this.layoutType);
16
+ this._formConfigFetcher.saveLayoutFormConfig(FORM_COL_CONFIG_PREFIX + this._resourceID, { config: this.layoutType, newConfig: true });
17
+ }
18
+ async componentWillLoad() {
19
+ const _application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
20
+ this._LayoutFormConfigSingleton = await (_application === null || _application === void 0 ? void 0 : _application.getLayoutFormConfig());
21
+ this._resourceID = await (_application === null || _application === void 0 ? void 0 : _application.getResourceID());
22
+ this.setLayoutInit();
23
+ }
24
+ setLayoutInit() {
25
+ if (!this._LayoutFormConfigSingleton)
26
+ return;
27
+ const { config } = this._LayoutFormConfigSingleton;
28
+ this.layoutType = Number(config) in FormLayout ? Number(config) : FormLayout.CASCADE;
29
+ }
30
+ toggleLayout(key) {
31
+ this.layoutType = key;
32
+ }
33
+ render() {
34
+ return (h("div", { class: "ez-flex ez-flex--column" }, h("div", { class: "ez-margin-bottom--small" }, h("ez-check", { label: "Layout em cascata", class: "ez-margin-bottom--small", onEzChange: () => this.toggleLayout(FormLayout.CASCADE), value: this.layoutType === FormLayout.CASCADE }), h("snk-view-representation", { mode: FormLayout.CASCADE }), h("label", { class: "ez-label ez-margin--small ez-flex ez-text--medium" }, "Todos os campos ser\u00E3o organizados em uma coluna \u00FAnica.")), h("div", null, h("ez-check", { label: "Layout lado a lado", class: "ez-margin-bottom--small", onEzChange: () => this.toggleLayout(FormLayout.SIDE_BY_SIDE), value: this.layoutType === FormLayout.SIDE_BY_SIDE }), h("snk-view-representation", { mode: FormLayout.SIDE_BY_SIDE }), h("label", { class: "ez-label ez-margin--small ez-flex ez-text--medium" }, "Todos os campos ser\u00E3o dispostos lado a lado, ajustando-se automaticamente \u00E0 largura da tela."))));
35
+ }
36
+ static get is() { return "snk-layout-form-config"; }
37
+ static get encapsulation() { return "scoped"; }
38
+ static get originalStyleUrls() {
39
+ return {
40
+ "$": ["snk-layout-form-config.css"]
41
+ };
42
+ }
43
+ static get styleUrls() {
44
+ return {
45
+ "$": ["snk-layout-form-config.css"]
46
+ };
47
+ }
48
+ static get states() {
49
+ return {
50
+ "layoutType": {}
51
+ };
52
+ }
53
+ static get methods() {
54
+ return {
55
+ "save": {
56
+ "complexType": {
57
+ "signature": "() => Promise<void>",
58
+ "parameters": [],
59
+ "references": {
60
+ "Promise": {
61
+ "location": "global"
62
+ }
63
+ },
64
+ "return": "Promise<void>"
65
+ },
66
+ "docs": {
67
+ "text": "Salva o tipo de layout escolhido. Sem retorno.",
68
+ "tags": []
69
+ }
70
+ }
71
+ };
72
+ }
73
+ }
@@ -0,0 +1,78 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .svg-container {
6
+ display: flex;
7
+ width: 185px;
8
+ height: 125px;
9
+ border-radius: 8px;
10
+ background-color: #f7f7f7;
11
+ padding: 10px 12px;
12
+ box-sizing: border-box;
13
+ position: relative;
14
+ }
15
+
16
+ .svg-container__background{
17
+ display: flex;
18
+ flex-direction: column;
19
+ width: 100%;
20
+ }
21
+
22
+ .svg-container__header {
23
+ display: flex;
24
+ gap: 2px;
25
+ margin-bottom: 12px;
26
+ }
27
+
28
+ .svg-container__circle {
29
+ width: 9px;
30
+ height: 9px;
31
+ border-radius: 50%;
32
+ }
33
+
34
+ .svg-container__circle--red {
35
+ background-color: #ed7678;
36
+ }
37
+
38
+ .svg-container__circle--yellow {
39
+ background-color: #eddb76;
40
+ }
41
+
42
+ .svg-container__circle--green {
43
+ background-color: #7ad08e;
44
+ }
45
+
46
+ .svg-container__section{
47
+ width: 100%;
48
+ }
49
+
50
+ .svg-container__collumn {
51
+ width: 100%;
52
+ display: flex;
53
+ flex-direction: column;
54
+ }
55
+
56
+ .svg-container__inline {
57
+ display: flex;
58
+ flex-direction: row;
59
+ gap: 6px;
60
+ }
61
+
62
+ .svg-container__line {
63
+ height: 13px;
64
+ border-radius: 4px;
65
+ background-color: #d9d9d9;
66
+ margin-bottom: 4px;
67
+ }
68
+
69
+ .svg-container__line--short {
70
+ width: 39.68px;
71
+ height: 7px;
72
+ border-radius: 3.5px;
73
+ }
74
+
75
+ .svg-container__line--long {
76
+ width: 100%;
77
+ }
78
+
@@ -0,0 +1,57 @@
1
+ import { h } from '@stencil/core';
2
+ import { FormLayout } from '@sankhyalabs/ezui/dist/collection/utils';
3
+ export class SnkViewRepresentation {
4
+ constructor() {
5
+ this.mode = FormLayout.SIDE_BY_SIDE;
6
+ }
7
+ renderCascadeLayout() {
8
+ return (h("div", { class: "svg-container__collumn" }, [...Array(3)].map(() => (h("div", { class: "svg-container__section" }, h("div", { class: "svg-container__line svg-container__line--short" }), h("div", { class: "svg-container__line svg-container__line--long" }))))));
9
+ }
10
+ renderSideBySideLayout() {
11
+ return (h("div", { class: "svg-container__inline" }, [...Array(2)].map(() => this.renderCascadeLayout())));
12
+ }
13
+ render() {
14
+ return (h("div", { class: "svg-container ez-margin-left--small" }, h("div", { class: "svg-container__background" }, h("div", { class: "svg-container__header" }, h("div", { class: "svg-container__circle svg-container__circle--red" }), h("div", { class: "svg-container__circle svg-container__circle--yellow" }), h("div", { class: "svg-container__circle svg-container__circle--green" })), this.mode === FormLayout.CASCADE
15
+ ? this.renderCascadeLayout()
16
+ : this.renderSideBySideLayout())));
17
+ }
18
+ static get is() { return "snk-view-representation"; }
19
+ static get encapsulation() { return "scoped"; }
20
+ static get originalStyleUrls() {
21
+ return {
22
+ "$": ["snk-view-representation.css"]
23
+ };
24
+ }
25
+ static get styleUrls() {
26
+ return {
27
+ "$": ["snk-view-representation.css"]
28
+ };
29
+ }
30
+ static get properties() {
31
+ return {
32
+ "mode": {
33
+ "type": "any",
34
+ "mutable": false,
35
+ "complexType": {
36
+ "original": "FormLayout",
37
+ "resolved": "FormLayout",
38
+ "references": {
39
+ "FormLayout": {
40
+ "location": "import",
41
+ "path": "@sankhyalabs/ezui/dist/collection/utils"
42
+ }
43
+ }
44
+ },
45
+ "required": false,
46
+ "optional": false,
47
+ "docs": {
48
+ "tags": [],
49
+ "text": "Define o layout do componente: 'CASCADE' ou 'SIDE_BY_SIDE'"
50
+ },
51
+ "attribute": "mode",
52
+ "reflect": false,
53
+ "defaultValue": "FormLayout.SIDE_BY_SIDE"
54
+ }
55
+ };
56
+ }
57
+ }
@@ -61,6 +61,7 @@ export class SnkSimpleCrud {
61
61
  this.ignoreReadOnlyFormFields = false;
62
62
  this.autoFocus = true;
63
63
  this.domainMessagesBuilder = undefined;
64
+ this.layoutFormConfig = false;
64
65
  this.autoLoad = undefined;
65
66
  this.outlineMode = false;
66
67
  }
@@ -753,7 +754,7 @@ export class SnkSimpleCrud {
753
754
  }
754
755
  return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
755
756
  ? undefined
756
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, this.renderTaskbarContent(), h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, 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.resolveResourceID() }))));
757
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, this.renderTaskbarContent(), h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId, layoutFormConfig: this.layoutFormConfig })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, 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.resolveResourceID() }))));
757
758
  }
758
759
  static get is() { return "snk-simple-crud"; }
759
760
  static get encapsulation() { return "scoped"; }
@@ -1233,6 +1234,24 @@ export class SnkSimpleCrud {
1233
1234
  "attribute": "domain-messages-builder",
1234
1235
  "reflect": false
1235
1236
  },
1237
+ "layoutFormConfig": {
1238
+ "type": "boolean",
1239
+ "mutable": false,
1240
+ "complexType": {
1241
+ "original": "boolean",
1242
+ "resolved": "boolean",
1243
+ "references": {}
1244
+ },
1245
+ "required": false,
1246
+ "optional": false,
1247
+ "docs": {
1248
+ "tags": [],
1249
+ "text": "Define se o LayoutFormConfig ser\u00E1 exibido no configurador."
1250
+ },
1251
+ "attribute": "layout-form-config",
1252
+ "reflect": false,
1253
+ "defaultValue": "false"
1254
+ },
1236
1255
  "autoLoad": {
1237
1256
  "type": "boolean",
1238
1257
  "mutable": false,
@@ -0,0 +1,25 @@
1
+ export class LayoutFormConfig {
2
+ constructor() {
3
+ this._config = null;
4
+ this.listeners = [];
5
+ }
6
+ static getInstance() {
7
+ if (!LayoutFormConfig.instance) {
8
+ LayoutFormConfig.instance = new LayoutFormConfig();
9
+ }
10
+ return LayoutFormConfig.instance;
11
+ }
12
+ get config() {
13
+ return this._config;
14
+ }
15
+ setConfig(newConfig) {
16
+ this._config = newConfig;
17
+ this.notifyListeners();
18
+ }
19
+ onConfigChange(listener) {
20
+ this.listeners.push(listener);
21
+ }
22
+ notifyListeners() {
23
+ this.listeners.forEach(listener => listener(this._config));
24
+ }
25
+ }
@@ -220,6 +220,20 @@ export class FormConfigFetcher extends ResourceFetcher {
220
220
  const rawFields = (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
221
221
  return { emptyConfig: false, fields: Array.isArray(rawFields) ? rawFields : [rawFields] };
222
222
  }
223
+ async fetchLayoutFormConfig(configName) {
224
+ const payload = { 'requestBody': { 'config': { 'chave': configName, 'tipo': 'T' } } };
225
+ const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
226
+ if (ObjectUtils.isEmpty(response))
227
+ return undefined;
228
+ return response.config;
229
+ }
230
+ async saveLayoutFormConfig(configName, config) {
231
+ const payload = { 'requestBody': { 'config': Object.assign(Object.assign({}, config), { 'chave': configName, 'tipo': 'T' }) } };
232
+ const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.saveConf', JSON.stringify(payload));
233
+ if (ObjectUtils.isEmpty(response))
234
+ return undefined;
235
+ return response;
236
+ }
223
237
  }
224
238
  export var UserConfigType;
225
239
  (function (UserConfigType) {
@@ -282,6 +282,20 @@ class FormConfigFetcher extends ResourceFetcher {
282
282
  const rawFields = (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
283
283
  return { emptyConfig: false, fields: Array.isArray(rawFields) ? rawFields : [rawFields] };
284
284
  }
285
+ async fetchLayoutFormConfig(configName) {
286
+ const payload = { 'requestBody': { 'config': { 'chave': configName, 'tipo': 'T' } } };
287
+ const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
288
+ if (ObjectUtils.isEmpty(response))
289
+ return undefined;
290
+ return response.config;
291
+ }
292
+ async saveLayoutFormConfig(configName, config) {
293
+ const payload = { 'requestBody': { 'config': Object.assign(Object.assign({}, config), { 'chave': configName, 'tipo': 'T' }) } };
294
+ const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.saveConf', JSON.stringify(payload));
295
+ if (ObjectUtils.isEmpty(response))
296
+ return undefined;
297
+ return response;
298
+ }
285
299
  }
286
300
  var UserConfigType;
287
301
  (function (UserConfigType) {
@@ -42,6 +42,7 @@ export { SnkFormView as SnkFormView } from '../types/components/snk-crud/subcomp
42
42
  export { SnkGrid as SnkGrid } from '../types/components/snk-grid/snk-grid';
43
43
  export { SnkGridConfig as SnkGridConfig } from '../types/components/snk-grid-config/snk-grid-config';
44
44
  export { SnkGuidesViewer as SnkGuidesViewer } from '../types/components/snk-crud/subcomponents/snk-guides-viewer';
45
+ export { SnkLayoutFormConfig as SnkLayoutFormConfig } from '../types/components/snk-layout-form-config/snk-layout-form-config';
45
46
  export { SnkPersonalizedFilter as SnkPersonalizedFilter } from '../types/components/snk-personalized-filter/snk-personalized-filter';
46
47
  export { SnkFilterPersonalized as SnkPersonalizedFilterEditor } from '../types/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor';
47
48
  export { SnkPesquisa as SnkPesquisa } from '../types/components/snk-pesquisa/snk-pesquisa';
@@ -52,6 +53,7 @@ export { SnkSimpleCrud as SnkSimpleCrud } from '../types/components/snk-simple-c
52
53
  export { SnkSimpleFormConfig as SnkSimpleFormConfig } from '../types/components/snk-simple-form-config/snk-simple-form-config';
53
54
  export { SnkTabConfig as SnkTabConfig } from '../types/components/snk-form-config/subcomponents/snk-tab-config/snk-tab-config';
54
55
  export { SnkTaskbar as SnkTaskbar } from '../types/components/snk-taskbar/snk-taskbar';
56
+ export { SnkViewRepresentation as SnkViewRepresentation } from '../types/components/snk-layout-form-config/snk-view-representation/snk-view-representation';
55
57
  export { TaskbarActionsButton as TaskbarActionsButton } from '../types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button';
56
58
  export { TestePesquisa as TestePesquisa } from '../types/components/teste-pesquisa/teste-pesquisa';
57
59
 
@@ -42,6 +42,7 @@ export { SnkFormView, defineCustomElement as defineCustomElementSnkFormView } fr
42
42
  export { SnkGrid, defineCustomElement as defineCustomElementSnkGrid } from './snk-grid.js';
43
43
  export { SnkGridConfig, defineCustomElement as defineCustomElementSnkGridConfig } from './snk-grid-config.js';
44
44
  export { SnkGuidesViewer, defineCustomElement as defineCustomElementSnkGuidesViewer } from './snk-guides-viewer.js';
45
+ export { SnkLayoutFormConfig, defineCustomElement as defineCustomElementSnkLayoutFormConfig } from './snk-layout-form-config.js';
45
46
  export { SnkPersonalizedFilter, defineCustomElement as defineCustomElementSnkPersonalizedFilter } from './snk-personalized-filter.js';
46
47
  export { SnkPersonalizedFilterEditor, defineCustomElement as defineCustomElementSnkPersonalizedFilterEditor } from './snk-personalized-filter-editor.js';
47
48
  export { SnkPesquisa, defineCustomElement as defineCustomElementSnkPesquisa } from './snk-pesquisa.js';
@@ -52,5 +53,6 @@ export { SnkSimpleCrud, defineCustomElement as defineCustomElementSnkSimpleCrud
52
53
  export { SnkSimpleFormConfig, defineCustomElement as defineCustomElementSnkSimpleFormConfig } from './snk-simple-form-config.js';
53
54
  export { SnkTabConfig, defineCustomElement as defineCustomElementSnkTabConfig } from './snk-tab-config.js';
54
55
  export { SnkTaskbar, defineCustomElement as defineCustomElementSnkTaskbar } from './snk-taskbar.js';
56
+ export { SnkViewRepresentation, defineCustomElement as defineCustomElementSnkViewRepresentation } from './snk-view-representation.js';
55
57
  export { TaskbarActionsButton, defineCustomElement as defineCustomElementTaskbarActionsButton } from './taskbar-actions-button.js';
56
58
  export { TestePesquisa, defineCustomElement as defineCustomElementTestePesquisa } from './teste-pesquisa.js';