@sankhyalabs/sankhyablocks 10.1.0-dev.3 → 10.1.0-dev.5

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 (143) hide show
  1. package/dist/cjs/{ConfigStorage-b29e31be.js → ConfigStorage-72f34bd4.js} +2 -2
  2. package/dist/cjs/{DataFetcher-ed9d97ea.js → DataFetcher-991b0349.js} +19 -1
  3. package/dist/cjs/{FormConfigHelper-ebb77625.js → FormConfigHelper-e253a418.js} +42 -0
  4. package/dist/cjs/{ISave-81eb2fbc.js → ISave-ebf6b4ed.js} +1 -1
  5. package/dist/cjs/{SnkFormConfigManager-6838389c.js → SnkFormConfigManager-cdbb29d4.js} +4 -4
  6. package/dist/cjs/{SnkMultiSelectionListDataSource-1e804147.js → SnkMultiSelectionListDataSource-011bec79.js} +4 -4
  7. package/dist/cjs/{auth-fetcher-cc28d847.js → auth-fetcher-c3cac878.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-ab1cc071.js → dataunit-fetcher-8bf469e7.js} +1 -1
  9. package/dist/cjs/field-config_2.cjs.entry.js +1 -1
  10. package/dist/cjs/fields-layout.cjs.entry.js +4 -1
  11. package/dist/cjs/fields-selector.cjs.entry.js +1 -1
  12. package/dist/cjs/{form-config-fetcher-f0897eb5.js → form-config-fetcher-c7af90d8.js} +1 -1
  13. package/dist/cjs/guides-configurator.cjs.entry.js +3 -1
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  16. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  17. package/dist/cjs/snk-actions-button_9.cjs.entry.js +5 -5
  18. package/dist/cjs/snk-application.cjs.entry.js +6 -6
  19. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  20. package/dist/cjs/snk-crud.cjs.entry.js +9 -7
  21. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  22. package/dist/cjs/{snk-data-unit-68992932.js → snk-data-unit-7d587ad5.js} +2 -2
  23. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  24. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  25. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +3 -3
  26. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  27. package/dist/cjs/snk-form_2.cjs.entry.js +22 -9
  28. package/dist/cjs/snk-grid.cjs.entry.js +10 -8
  29. package/dist/cjs/{snk-guides-viewer-8b841753.js → snk-guides-viewer-366d5c32.js} +90 -28
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  32. package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
  34. package/dist/cjs/snk-taskbar.cjs.entry.js +56 -44
  35. package/dist/collection/collection-manifest.json +1 -1
  36. package/dist/collection/components/snk-crud/snk-crud.js +29 -2
  37. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +124 -23
  38. package/dist/collection/components/snk-form-config/FormConfigHelper.js +40 -0
  39. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +3 -3
  40. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +3 -0
  41. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +3 -1
  42. package/dist/collection/components/snk-form-config/snk-form-config.js +43 -6
  43. package/dist/collection/components/snk-grid/snk-grid.js +6 -3
  44. package/dist/collection/components/snk-taskbar/snk-taskbar.js +58 -44
  45. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +6 -0
  46. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +6 -0
  47. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +7 -1
  48. package/dist/components/DataFetcher.js +19 -1
  49. package/dist/components/SnkFormConfigManager.js +3 -3
  50. package/dist/components/field-config2.js +41 -1
  51. package/dist/components/fields-layout2.js +3 -0
  52. package/dist/components/guides-configurator2.js +3 -1
  53. package/dist/components/snk-crud.js +6 -2
  54. package/dist/components/snk-detail-view2.js +86 -23
  55. package/dist/components/snk-form-config2.js +19 -5
  56. package/dist/components/snk-grid2.js +5 -2
  57. package/dist/components/snk-taskbar2.js +57 -45
  58. package/dist/esm/{ConfigStorage-13d80e36.js → ConfigStorage-22324b6b.js} +2 -2
  59. package/dist/esm/{DataFetcher-f4ccd9f3.js → DataFetcher-450828a0.js} +19 -1
  60. package/dist/esm/{FormConfigHelper-4e42f0b6.js → FormConfigHelper-e89ca25c.js} +41 -1
  61. package/dist/esm/{ISave-288fa9df.js → ISave-61153166.js} +1 -1
  62. package/dist/esm/{SnkFormConfigManager-3ee2937b.js → SnkFormConfigManager-b5a92e12.js} +4 -4
  63. package/dist/esm/{SnkMultiSelectionListDataSource-5d3a93f2.js → SnkMultiSelectionListDataSource-d7ce2e54.js} +4 -4
  64. package/dist/esm/{auth-fetcher-59ab0c67.js → auth-fetcher-eef9d01e.js} +1 -1
  65. package/dist/esm/{dataunit-fetcher-c4f9f222.js → dataunit-fetcher-da9596f6.js} +1 -1
  66. package/dist/esm/field-config_2.entry.js +1 -1
  67. package/dist/esm/fields-layout.entry.js +4 -1
  68. package/dist/esm/fields-selector.entry.js +1 -1
  69. package/dist/esm/{form-config-fetcher-6a00fe9e.js → form-config-fetcher-8d0a5e1c.js} +1 -1
  70. package/dist/esm/guides-configurator.entry.js +3 -1
  71. package/dist/esm/loader.js +1 -1
  72. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  73. package/dist/esm/sankhyablocks.js +1 -1
  74. package/dist/esm/snk-actions-button_9.entry.js +5 -5
  75. package/dist/esm/snk-application.entry.js +6 -6
  76. package/dist/esm/snk-attach.entry.js +5 -5
  77. package/dist/esm/snk-crud.entry.js +9 -7
  78. package/dist/esm/snk-data-exporter.entry.js +5 -5
  79. package/dist/esm/{snk-data-unit-0edeb967.js → snk-data-unit-99616a07.js} +2 -2
  80. package/dist/esm/snk-data-unit.entry.js +3 -3
  81. package/dist/esm/snk-detail-view.entry.js +7 -7
  82. package/dist/esm/snk-filter-bar_4.entry.js +3 -3
  83. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  84. package/dist/esm/snk-form_2.entry.js +22 -9
  85. package/dist/esm/snk-grid.entry.js +10 -8
  86. package/dist/esm/{snk-guides-viewer-9cd4d20f.js → snk-guides-viewer-240de636.js} +90 -28
  87. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  88. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  89. package/dist/esm/snk-pesquisa.entry.js +4 -4
  90. package/dist/esm/snk-simple-crud.entry.js +7 -7
  91. package/dist/esm/snk-taskbar.entry.js +57 -45
  92. package/dist/sankhyablocks/{p-1c2971e4.js → p-002d4d2b.js} +1 -1
  93. package/dist/sankhyablocks/{p-ae108ffd.entry.js → p-0948dc0a.entry.js} +1 -1
  94. package/dist/sankhyablocks/{p-7b3ca294.entry.js → p-0b9a42ad.entry.js} +1 -1
  95. package/dist/sankhyablocks/p-118c221e.js +1 -0
  96. package/dist/sankhyablocks/p-1a9c5684.entry.js +1 -0
  97. package/dist/sankhyablocks/p-1d589380.entry.js +1 -0
  98. package/dist/sankhyablocks/{p-d9c54991.js → p-28f50632.js} +1 -1
  99. package/dist/sankhyablocks/p-39be771c.js +1 -0
  100. package/dist/sankhyablocks/{p-26e0f63c.entry.js → p-4963dd2a.entry.js} +1 -1
  101. package/dist/sankhyablocks/p-55f6fef2.entry.js +1 -0
  102. package/dist/sankhyablocks/p-56f16390.entry.js +1 -0
  103. package/dist/sankhyablocks/{p-5304753a.js → p-58683e28.js} +2 -2
  104. package/dist/sankhyablocks/{p-11346b8d.entry.js → p-5ea893c5.entry.js} +1 -1
  105. package/dist/sankhyablocks/{p-f15478a1.js → p-62aef37a.js} +1 -1
  106. package/dist/sankhyablocks/{p-34f447ba.entry.js → p-62e9b9b8.entry.js} +1 -1
  107. package/dist/sankhyablocks/{p-e9021f79.entry.js → p-669bb869.entry.js} +1 -1
  108. package/dist/sankhyablocks/{p-6180de07.entry.js → p-6ee2ca7a.entry.js} +1 -1
  109. package/dist/sankhyablocks/p-7cac3870.entry.js +1 -0
  110. package/dist/sankhyablocks/{p-78ff8734.js → p-7d6f1285.js} +1 -1
  111. package/dist/sankhyablocks/{p-53599b26.js → p-840fb68c.js} +1 -1
  112. package/dist/sankhyablocks/{p-b4322b87.entry.js → p-86e54841.entry.js} +1 -1
  113. package/dist/sankhyablocks/{p-34df7eca.entry.js → p-88b337fe.entry.js} +1 -1
  114. package/dist/sankhyablocks/{p-3d021bef.entry.js → p-91005a00.entry.js} +1 -1
  115. package/dist/sankhyablocks/p-92cfc028.js +1 -0
  116. package/dist/sankhyablocks/{p-44939a0e.entry.js → p-ada013c0.entry.js} +1 -1
  117. package/dist/sankhyablocks/{p-9317942f.js → p-c35fc941.js} +1 -1
  118. package/dist/sankhyablocks/p-c98c79c3.entry.js +1 -0
  119. package/dist/sankhyablocks/{p-1858c023.entry.js → p-cadf4846.entry.js} +1 -1
  120. package/dist/sankhyablocks/{p-38e56b68.entry.js → p-e91c3c57.entry.js} +1 -1
  121. package/dist/sankhyablocks/{p-f8f29e1a.entry.js → p-ea729922.entry.js} +1 -1
  122. package/dist/sankhyablocks/p-ec5fbad8.js +1 -0
  123. package/dist/sankhyablocks/{p-80014119.entry.js → p-f5e942b7.entry.js} +1 -1
  124. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  125. package/dist/types/components/snk-crud/snk-crud.d.ts +6 -0
  126. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +22 -0
  127. package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +5 -0
  128. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -1
  129. package/dist/types/components/snk-form-config/snk-form-config.d.ts +8 -2
  130. package/dist/types/components/snk-grid/snk-grid.d.ts +1 -0
  131. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +6 -3
  132. package/dist/types/components.d.ts +30 -0
  133. package/package.json +1 -1
  134. package/dist/sankhyablocks/p-0e279e7a.js +0 -1
  135. package/dist/sankhyablocks/p-3abeeefa.entry.js +0 -1
  136. package/dist/sankhyablocks/p-557368df.entry.js +0 -1
  137. package/dist/sankhyablocks/p-583151c5.entry.js +0 -1
  138. package/dist/sankhyablocks/p-8a88690f.entry.js +0 -1
  139. package/dist/sankhyablocks/p-8f73da95.js +0 -1
  140. package/dist/sankhyablocks/p-a2ed1ebd.entry.js +0 -1
  141. package/dist/sankhyablocks/p-a5108625.entry.js +0 -1
  142. package/dist/sankhyablocks/p-a644a956.js +0 -1
  143. package/dist/sankhyablocks/p-bb2f5f38.js +0 -1
@@ -39,6 +39,7 @@ export const snkFormConfigMessages = {
39
39
  labelNewGroup: "Añadir nuevo grupo",
40
40
  mainArea: "Área principal",
41
41
  tabGeneral: "General",
42
+ canNotEditCustomGuide: "No es posible editar pestañas de detalles y pestañas personalizadas",
42
43
  createNewGroup: "Crear nuevo grupo",
43
44
  newGroup: "Nuevo grupo",
44
45
  noGuideSelected: "Seleccione una pestaña y comience a configurar",
@@ -66,6 +67,10 @@ export const snkFormConfigMessages = {
66
67
  title: "Atención",
67
68
  message: "¡Seleccione una guía para iniciar la configuración!"
68
69
  },
70
+ canNotAddFieldToGuide: {
71
+ title: "Atención",
72
+ message: "¡No es posible agregar campos a pestañas de detalles o pestañas personalizadas!"
73
+ },
69
74
  alert: {
70
75
  titleGroupExists: "Ya existe un grupo con título",
71
76
  titleGroupEditing: "Hay un <b>grupo<b/> en edición. <br/> Finalice la edición para guardar las configuraciones.",
@@ -96,6 +101,7 @@ export const snkFormConfigMessages = {
96
101
  createNewGuide: "Crear nueva pestaña",
97
102
  noHiddenGuides: "No hay pestañas ocultas",
98
103
  noVisibleGuides: "No hay pestañas visibles",
104
+ canNotDeleteCustomGuide: "No es posible eliminar pestañas de detalles o pestañas personalizadas",
99
105
  actions: {
100
106
  hide: "Ocultar",
101
107
  show: "Hacer visible",
@@ -39,6 +39,7 @@ export const snkFormConfigMessages = {
39
39
  labelNewGroup: "Adicionar novo grupo",
40
40
  mainArea: "Área principal",
41
41
  tabGeneral: "Geral",
42
+ canNotEditCustomGuide: "Não é possível editar guias detalhe e guias personalizadas",
42
43
  createNewGroup: "Criar novo grupo",
43
44
  newGroup: "Criar novo grupo",
44
45
  noGuideSelected: "Selecione uma guia e comece a configurar",
@@ -66,6 +67,10 @@ export const snkFormConfigMessages = {
66
67
  title: "Atenção",
67
68
  message: "Selecione uma guia para iniciar a configuração!"
68
69
  },
70
+ canNotAddFieldToGuide: {
71
+ title: "Atenção",
72
+ message: "Não é possível adicionar campos à guias customizadas ou guias detalhe!"
73
+ },
69
74
  alert: {
70
75
  titleGroupExists: "Já existe um grupo com título",
71
76
  titleGroupEditing: "Há um <b>grupo<b/> em edição. <br/> Finalize a edição para salvar as configurações.",
@@ -96,10 +101,11 @@ export const snkFormConfigMessages = {
96
101
  createNewGuide: "Criar nova guia",
97
102
  noHiddenGuides: "Nenhuma guia oculta",
98
103
  noVisibleGuides: "Nenhuma guia visível",
104
+ canNotDeleteCustomGuide: "Não é possível excluir guias detalhe e guias personalizadas",
99
105
  actions: {
100
106
  hide: "Ocultar",
101
107
  show: "Tornar visível",
102
- delete: "Excluir"
108
+ delete: "Excluir",
103
109
  }
104
110
  }
105
111
  };
@@ -7438,6 +7438,7 @@ const snkFormConfigMessages$2 = {
7438
7438
  labelNewGroup: "Adicionar novo grupo",
7439
7439
  mainArea: "Área principal",
7440
7440
  tabGeneral: "Geral",
7441
+ canNotEditCustomGuide: "Não é possível editar guias detalhe e guias personalizadas",
7441
7442
  createNewGroup: "Criar novo grupo",
7442
7443
  newGroup: "Criar novo grupo",
7443
7444
  noGuideSelected: "Selecione uma guia e comece a configurar",
@@ -7465,6 +7466,10 @@ const snkFormConfigMessages$2 = {
7465
7466
  title: "Atenção",
7466
7467
  message: "Selecione uma guia para iniciar a configuração!"
7467
7468
  },
7469
+ canNotAddFieldToGuide: {
7470
+ title: "Atenção",
7471
+ message: "Não é possível adicionar campos à guias customizadas ou guias detalhe!"
7472
+ },
7468
7473
  alert: {
7469
7474
  titleGroupExists: "Já existe um grupo com título",
7470
7475
  titleGroupEditing: "Há um <b>grupo<b/> em edição. <br/> Finalize a edição para salvar as configurações.",
@@ -7495,10 +7500,11 @@ const snkFormConfigMessages$2 = {
7495
7500
  createNewGuide: "Criar nova guia",
7496
7501
  noHiddenGuides: "Nenhuma guia oculta",
7497
7502
  noVisibleGuides: "Nenhuma guia visível",
7503
+ canNotDeleteCustomGuide: "Não é possível excluir guias detalhe e guias personalizadas",
7498
7504
  actions: {
7499
7505
  hide: "Ocultar",
7500
7506
  show: "Tornar visível",
7501
- delete: "Excluir"
7507
+ delete: "Excluir",
7502
7508
  }
7503
7509
  }
7504
7510
  };
@@ -8296,6 +8302,7 @@ const snkFormConfigMessages$1 = {
8296
8302
  labelNewGroup: "Add new group",
8297
8303
  mainArea: "Main area",
8298
8304
  tabGeneral: "General",
8305
+ canNotEditCustomGuide: "It is not possible to edit detail tabs and custom tabs",
8299
8306
  createNewGroup: "Create new group",
8300
8307
  newGroup: "New group",
8301
8308
  noGuideSelected: "Select a tab and start configuring",
@@ -8323,6 +8330,10 @@ const snkFormConfigMessages$1 = {
8323
8330
  title: "Attention",
8324
8331
  message: "Select a guide to start configuration!"
8325
8332
  },
8333
+ canNotAddFieldToGuide: {
8334
+ title: "Attention",
8335
+ message: "It is not possible to add fields to detail tabs or custom tabs!"
8336
+ },
8326
8337
  alert: {
8327
8338
  titleGroupExists: "A group with this title already exists",
8328
8339
  titleGroupEditing: "There is a <b>group<b/> being edited. <br/> Finish editing to save the settings.",
@@ -8353,6 +8364,7 @@ const snkFormConfigMessages$1 = {
8353
8364
  createNewGuide: "Create new tab",
8354
8365
  noHiddenGuides: "No hidden tabs",
8355
8366
  noVisibleGuides: "No visible tabs",
8367
+ canNotDeleteCustomGuide: "Is not possible to detail detail tabs os a custom tabs",
8356
8368
  actions: {
8357
8369
  hide: "Hide",
8358
8370
  show: "Make visible",
@@ -9154,6 +9166,7 @@ const snkFormConfigMessages = {
9154
9166
  labelNewGroup: "Añadir nuevo grupo",
9155
9167
  mainArea: "Área principal",
9156
9168
  tabGeneral: "General",
9169
+ canNotEditCustomGuide: "No es posible editar pestañas de detalles y pestañas personalizadas",
9157
9170
  createNewGroup: "Crear nuevo grupo",
9158
9171
  newGroup: "Nuevo grupo",
9159
9172
  noGuideSelected: "Seleccione una pestaña y comience a configurar",
@@ -9181,6 +9194,10 @@ const snkFormConfigMessages = {
9181
9194
  title: "Atención",
9182
9195
  message: "¡Seleccione una guía para iniciar la configuración!"
9183
9196
  },
9197
+ canNotAddFieldToGuide: {
9198
+ title: "Atención",
9199
+ message: "¡No es posible agregar campos a pestañas de detalles o pestañas personalizadas!"
9200
+ },
9184
9201
  alert: {
9185
9202
  titleGroupExists: "Ya existe un grupo con título",
9186
9203
  titleGroupEditing: "Hay un <b>grupo<b/> en edición. <br/> Finalice la edición para guardar las configuraciones.",
@@ -9211,6 +9228,7 @@ const snkFormConfigMessages = {
9211
9228
  createNewGuide: "Crear nueva pestaña",
9212
9229
  noHiddenGuides: "No hay pestañas ocultas",
9213
9230
  noVisibleGuides: "No hay pestañas visibles",
9231
+ canNotDeleteCustomGuide: "No es posible eliminar pestañas de detalles o pestañas personalizadas",
9214
9232
  actions: {
9215
9233
  hide: "Ocultar",
9216
9234
  show: "Hacer visible",
@@ -1,5 +1,5 @@
1
- import { C as ConfigStorage } from './ConfigStorage.js';
2
1
  import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
2
+ import { C as ConfigStorage } from './ConfigStorage.js';
3
3
  import { F as FormConfigFetcher } from './form-config-fetcher.js';
4
4
  import { T as TAB_NAMES } from './constants.js';
5
5
 
@@ -83,7 +83,7 @@ class SnkFormConfigManager {
83
83
  return false;
84
84
  }
85
85
  getFieldsList(descriptionFilter, forceEmptyConfig = false) {
86
- var _a;
86
+ var _a, _b;
87
87
  const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
88
88
  const hasConfig = this.hasConfig();
89
89
  if (hasConfig && !forceEmptyConfig) {
@@ -99,7 +99,7 @@ class SnkFormConfigManager {
99
99
  })
100
100
  .filter(field => this.isFieldVisible(field, descriptionFilter));
101
101
  }
102
- if (!this._dataUnit) {
102
+ if (!this._dataUnit || !((_b = this._dataUnit.metadata) === null || _b === void 0 ? void 0 : _b.fields)) {
103
103
  return [];
104
104
  }
105
105
  const filteredFields = this._dataUnit.metadata.fields
@@ -112,6 +112,46 @@ function buildGuides(config, mainArea) {
112
112
  tabs = initializeTabsNames(tabs);
113
113
  return handleMainTab(tabs, mainArea);
114
114
  }
115
+ function buildChildrenGuides(dataUnit, initialOrderIndex = 0, guidesList) {
116
+ var _a;
117
+ if (!dataUnit || !dataUnit.metadata) {
118
+ return [];
119
+ }
120
+ const children = ((_a = dataUnit.metadata) === null || _a === void 0 ? void 0 : _a.children) || [];
121
+ const childrenWithNoGuide = [];
122
+ for (const child of children) {
123
+ if (guidesList.some((guide) => child.label === guide.label)) {
124
+ continue;
125
+ }
126
+ childrenWithNoGuide.push({
127
+ label: child.label,
128
+ name: child.name,
129
+ visible: true,
130
+ isCustom: true,
131
+ order: initialOrderIndex++
132
+ });
133
+ }
134
+ return childrenWithNoGuide;
135
+ }
136
+ function buildCustomGuides(customGuidesList, guidesList) {
137
+ let initialOrderIndex = guidesList.length;
138
+ const customGuidesToAdd = getCustomGuidesNotIncludedInList(customGuidesList, guidesList);
139
+ return customGuidesToAdd.map(guide => {
140
+ return {
141
+ name: guide.id,
142
+ label: guide.label,
143
+ visible: true,
144
+ isCustom: true,
145
+ order: initialOrderIndex++
146
+ };
147
+ });
148
+ }
149
+ function isCustomGuideIncludedInList(guidesList, guide) {
150
+ return guidesList.some(fromList => fromList.name === guide.id || fromList.label === guide.label);
151
+ }
152
+ function getCustomGuidesNotIncludedInList(customGuidesList, guidesList) {
153
+ return customGuidesList.filter(guide => !isCustomGuideIncludedInList(guidesList, guide));
154
+ }
115
155
  function handleFieldsTabNames(allFields) {
116
156
  // Campos que não fazem parte de nenhuma aba ou da aba "Geral", devem ser movidos para a aba __main.
117
157
  return allFields.map(field => {
@@ -521,4 +561,4 @@ function defineCustomElement() {
521
561
  } });
522
562
  }
523
563
 
524
- export { FieldConfig as F, ID_AVAILABLE_FIELDS as I, SORTABLE_PATH as S, getFieldsStructure as a, buildGuides as b, buildGuidesMap as c, defineCustomElement as d, getFieldsToSave as e, buildNewGuideName as f, getIconName as g, updateTabInFieldsFromGroupList as u };
564
+ export { FieldConfig as F, ID_AVAILABLE_FIELDS as I, SORTABLE_PATH as S, getFieldsStructure as a, buildGuides as b, buildChildrenGuides as c, defineCustomElement as d, buildCustomGuides as e, buildGuidesMap as f, getIconName as g, getFieldsToSave as h, buildNewGuideName as i, updateTabInFieldsFromGroupList as u };
@@ -331,6 +331,9 @@ const FieldLayoutComponent = /*@__PURE__*/ proxyCustomElement(class extends HTML
331
331
  if (!this.selectedGuide) {
332
332
  return (h(Host, { class: 'ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container' }, h("span", { class: 'no-guide-selected' }, this.getMessage('snkFormConfig.form.noGuideSelected'))));
333
333
  }
334
+ if (this.selectedGuide.isCustom || this.selectedGuide.isDetail) {
335
+ return (h(Host, { class: 'ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container' }, h("span", { class: 'no-guide-selected' }, this.getMessage('snkFormConfig.form.canNotEditCustomGuide'))));
336
+ }
334
337
  return (h(Host, { class: 'ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container' }, this.renderGuideName(), h("div", { class: 'layout-container' }, h("ez-scroller", { direction: 'vertical', activeShadow: true }, h("div", { class: 'no-group-container' }, h("div", { id: GROUP_NAMES.noGroup, class: 'group-content', "data-group-name": GROUP_NAMES.noGroup }, this.renderFixedFields())), h("hr", null), h("div", { id: this.ID_GROUPS, class: 'groups-container' }, this.renderDraggableGroups()))), h("div", { class: 'add-group-container', onClick: this.handleAddGroup.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus" }), h("span", null, this.getMessage('snkFormConfig.form.createNewGroup')))));
335
338
  }
336
339
  get el() { return this; }
@@ -101,7 +101,9 @@ const GuidesConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
101
101
  var _a;
102
102
  return (h("div", { key: guide.name, "data-guide-name": guide.name, title: guide.label, class: `guide-item ${((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.label) === guide.label ? 'selected' : ''} ${this.filterTerm.length ? 'disable-sort' : ''}`, onClick: e => this.handleSelectGuide(guide, e) }, h("span", null, h("ez-icon", { iconName: "drag-indicator", class: 'ez-margin-right--small' })), h("span", { class: 'item-label' }, guide.label), h("div", { class: 'actions' }, h("ez-button", { mode: "icon", class: "ez-button--tertiary", onClick: e => this.toggleGuideVisibility(guide, e), size: "medium", iconName: guide.visible ? 'eye-off' : 'eye', title: guide.visible ?
103
103
  this.getMessage('snkFormConfig.guidesConfigurator.actions.hide') :
104
- this.getMessage('snkFormConfig.guidesConfigurator.actions.show') }), h("ez-button", { mode: "icon", class: "ez-button--tertiary", onClick: e => this.handleDeleteGuide(guide, e), size: "medium", iconName: 'delete', title: this.getMessage('snkFormConfig.guidesConfigurator.actions.delete') }))));
104
+ this.getMessage('snkFormConfig.guidesConfigurator.actions.show') }), h("ez-button", { mode: "icon", class: "ez-button--tertiary", onClick: e => this.handleDeleteGuide(guide, e), size: "medium", isDisabled: guide.isCustom || guide.isDetail, iconName: 'delete', title: guide.isCustom || guide.isDetail ?
105
+ this.getMessage('snkFormConfig.guidesConfigurator.canNotDeleteCustomGuide') :
106
+ this.getMessage('snkFormConfig.guidesConfigurator.actions.delete') }))));
105
107
  });
106
108
  }
107
109
  getContainerElement(id) {
@@ -109,6 +109,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
109
109
  };
110
110
  this._dataUnit = undefined;
111
111
  this._dataState = undefined;
112
+ this._suppressEntitySearch = false;
112
113
  this.attachmentRegisterKey = undefined;
113
114
  this._currentViewMode = VIEW_MODE.GRID;
114
115
  this._canEdit = undefined;
@@ -145,6 +146,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
145
146
  this.layoutFormConfig = true;
146
147
  this.multipleEditionEnabled = true;
147
148
  this.paginationCounterMode = 'auto';
149
+ this.customGuidesConfig = [];
148
150
  this.showEntitySearch = true;
149
151
  this.disableNumberingConfig = false;
150
152
  }
@@ -592,7 +594,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
592
594
  }
593
595
  renderDynamicSearch(slotName) {
594
596
  var _a;
595
- if (!this.showEntitySearch || ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) === true)
597
+ if (this._suppressEntitySearch || !this.showEntitySearch || ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) === true)
596
598
  return;
597
599
  return (h("div", { slot: slotName, class: "entity-search-container", style: { position: 'relative', display: 'inline-block', marginLeft: '10px', minWidth: '200px' } }, h("ez-search", { label: "Buscar registros", optionLoader: this.loadEntitySuggestions, onEzChange: (evt) => this.searchEntitySelect(evt.detail), mode: "slim", showMore: this._showMoreOnSearch, suppressEmptyOption: true, suppressInputPersist: true })));
598
600
  }
@@ -601,7 +603,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
601
603
  return;
602
604
  }
603
605
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
604
- 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, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, 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" }), this.renderDynamicSearch("GRID_HEADER_DYNAMIC_SEARCH"))), 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" }), this.renderDynamicSearch("GUIDES_VIEWER_DYNAMIC_SEARCH"), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", { tabIndex: "0" }, 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, entityName: this._snkDataUnit.entityName, 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" }))));
606
+ 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, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, 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" }), this.renderDynamicSearch("GRID_HEADER_DYNAMIC_SEARCH"))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, 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), onFormConfigVisibilityChanged: evt => this._suppressEntitySearch = 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" }), this.renderDynamicSearch("GUIDES_VIEWER_DYNAMIC_SEARCH"), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", { tabIndex: "0" }, 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, entityName: this._snkDataUnit.entityName, 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" }))));
605
607
  }
606
608
  get _element() { return this; }
607
609
  static get watchers() { return {
@@ -637,10 +639,12 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
637
639
  "layoutFormConfig": [4, "layout-form-config"],
638
640
  "multipleEditionEnabled": [4, "multiple-edition-enabled"],
639
641
  "paginationCounterMode": [1, "pagination-counter-mode"],
642
+ "customGuidesConfig": [16],
640
643
  "showEntitySearch": [4, "show-entity-search"],
641
644
  "disableNumberingConfig": [4, "disable-numbering-config"],
642
645
  "_dataUnit": [32],
643
646
  "_dataState": [32],
647
+ "_suppressEntitySearch": [32],
644
648
  "attachmentRegisterKey": [32],
645
649
  "_currentViewMode": [32],
646
650
  "_canEdit": [32],
@@ -63,10 +63,13 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
63
63
  super();
64
64
  this.__registerHost();
65
65
  this.snkMasterFormConfigChange = createEvent(this, "snkMasterFormConfigChange", 7);
66
+ this.formConfigVisibilityChanged = createEvent(this, "formConfigVisibilityChanged", 7);
66
67
  this.exit = createEvent(this, "exit", 7);
67
68
  this.actionClick = createEvent(this, "actionClick", 7);
68
69
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
69
70
  this._guideBuilders = new Map();
71
+ this.CUSTOM_GUIDE_ID_PREFIX = "CUSTOM_GUIDE_";
72
+ this.CUSTOM_GUIDE_DATA_CUSTOM_ID = "CUSTOM_GUIDE";
70
73
  this.dataUnit = undefined;
71
74
  this.dataState = undefined;
72
75
  this.configName = undefined;
@@ -85,6 +88,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
85
88
  this.enableGridInsert = false;
86
89
  this.ignoreReadOnlyFormFields = undefined;
87
90
  this.getCustomTitle = undefined;
91
+ this.customGuidesConfig = [];
88
92
  this._hasToCreateFieldSearch = true;
89
93
  this._breadcrumbItems = [];
90
94
  this._guides = undefined;
@@ -99,6 +103,9 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
99
103
  observeDataUnit() {
100
104
  this.loadGuides(true);
101
105
  }
106
+ observeFormConfigManager(value) {
107
+ this.formConfigVisibilityChanged.emit(!!value);
108
+ }
102
109
  observeDataState(newValue, oldValue) {
103
110
  var _a, _b, _c, _d, _e, _f;
104
111
  const newRecordsIds = (_b = (_a = newValue === null || newValue === void 0 ? void 0 : newValue.selectionInfo) === null || _a === void 0 ? void 0 : _a.recordIds) !== null && _b !== void 0 ? _b : (_c = newValue === null || newValue === void 0 ? void 0 : newValue.selectedRecord) === null || _c === void 0 ? void 0 : _c['__record__id__'];
@@ -197,7 +204,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
197
204
  if (!this._configManager.isLoaded) {
198
205
  return;
199
206
  }
200
- this._masterFormMetadata = buildFormMetadata(this.masterFormConfig, this.dataUnit, true);
207
+ this._masterFormMetadata = buildFormMetadata(this.masterFormConfig, this.dataUnit, true, this.customGuidesConfig);
201
208
  const allSheets = this._masterFormMetadata.getAllSheets();
202
209
  const currentRecord = this.dataUnit.getSelectedRecord();
203
210
  const disableDetails = this.hasToDisableDetails(currentRecord);
@@ -343,38 +350,67 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
343
350
  return `${this.entityPath}/${entityName}`;
344
351
  }
345
352
  getContent() {
346
- var _a, _b, _c, _d, _e;
347
353
  if (!this.selectedGuide) {
348
354
  return;
349
355
  }
350
356
  const guideId = this.selectedGuide.id;
351
- let content;
357
+ if (this.isCustomGuide(guideId)) {
358
+ return h("div", { "data-custom-id": `${this.CUSTOM_GUIDE_DATA_CUSTOM_ID}`, "data-reserved-slot-id": guideId, id: this.buildCustomGuideContainerId(guideId) });
359
+ }
352
360
  const levels = guideId.split("::");
353
361
  const currentLevel = levels.pop();
354
362
  const childEntityName = FormMetadata.getDetailName(currentLevel);
355
363
  let detailId = guideId;
356
- if (childEntityName || levels.length > 0) {
357
- let formName;
358
- let detailBranch;
359
- if (guideId.includes(FORM_NAME_PREFIX)) {
360
- [detailId, formName] = guideId.split(FORM_NAME_PREFIX);
361
- const pathSize = ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) || 0;
362
- detailBranch = pathSize > 1 ? this._breadcrumbItems[pathSize - 2] : this.selectedGuide;
363
- }
364
- else {
365
- detailBranch = this.selectedGuide;
366
- }
367
- 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), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders, presentationMode: this.presentationMode }));
364
+ if (this.isDetailGuide(childEntityName, levels)) {
365
+ return this.buildDetailGuideContent(guideId, detailId, levels, childEntityName);
366
+ }
367
+ return this.buildFormViewGuideContent(guideId);
368
+ }
369
+ buildCustomGuideContainerId(guideId) {
370
+ return `${this.CUSTOM_GUIDE_ID_PREFIX}${guideId}`;
371
+ }
372
+ buildFormViewGuideContent(cardId) {
373
+ var _a, _b, _c, _d;
374
+ const sheet = this._masterFormMetadata.getSheet(cardId);
375
+ if (!sheet)
376
+ return;
377
+ const cardConfig = (_b = (_a = this.masterFormConfig) === null || _a === void 0 ? void 0 : _a.cardsState) === null || _b === void 0 ? void 0 : _b.get(cardId);
378
+ return (h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_d = (_c = this.masterFormConfig) === null || _c === void 0 ? void 0 : _c.summary) === null || _d === void 0 ? void 0 : _d.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: cardId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar()));
379
+ }
380
+ isDetailGuide(childEntityName, levels) {
381
+ return childEntityName || levels.length > 0;
382
+ }
383
+ buildDetailGuideContent(guideId, detailId, levels, childEntityName) {
384
+ var _a;
385
+ let formName;
386
+ let detailBranch;
387
+ if (guideId.includes(FORM_NAME_PREFIX)) {
388
+ [detailId, formName] = guideId.split(FORM_NAME_PREFIX);
389
+ const pathSize = ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) || 0;
390
+ detailBranch = pathSize > 1 ? this._breadcrumbItems[pathSize - 2] : this.selectedGuide;
368
391
  }
369
392
  else {
370
- const cardId = this.selectedGuide.id;
371
- const sheet = this._masterFormMetadata.getSheet(cardId);
372
- if (sheet) {
373
- const cardConfig = (_c = (_b = this.masterFormConfig) === null || _b === void 0 ? void 0 : _b.cardsState) === null || _c === void 0 ? void 0 : _c.get(cardId);
374
- content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
375
- }
393
+ detailBranch = this.selectedGuide;
376
394
  }
377
- return content;
395
+ return 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), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders, presentationMode: this.presentationMode }));
396
+ }
397
+ isCustomGuide(guideId) {
398
+ var _a;
399
+ return (_a = this.customGuidesConfig) === null || _a === void 0 ? void 0 : _a.map(g => g.id).includes(guideId);
400
+ }
401
+ attachCustomGuideInView() {
402
+ //As guias customizadas ficam em slots reservados na DOM e
403
+ // precisam ser acessadas via querySelector e colocadas no container correto na view.
404
+ var _a;
405
+ const guideId = (_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id;
406
+ if (!this.isCustomGuide(guideId))
407
+ return;
408
+ const customGuideSlot = document.querySelector(`#${guideId}`);
409
+ const customGuideElement = customGuideSlot === null || customGuideSlot === void 0 ? void 0 : customGuideSlot.firstElementChild;
410
+ const customGuideViewContainer = document.querySelector(`#${this.buildCustomGuideContainerId(guideId)}`);
411
+ if (!customGuideElement || !customGuideViewContainer)
412
+ return;
413
+ customGuideViewContainer.appendChild(customGuideElement);
378
414
  }
379
415
  onBreadcrumbClickHandler(item) {
380
416
  if ((item === null || item === void 0 ? void 0 : item.id) == undefined) {
@@ -457,7 +493,29 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
457
493
  this.addFormLegacyConfigName();
458
494
  this._configManager.loadConfig();
459
495
  }
496
+ componentWillRender() {
497
+ this.detachCustomGuideFromView();
498
+ }
499
+ detachCustomGuideFromView() {
500
+ // Antes de cada renderização, o componente remove a guia customizada da view
501
+ // e a coloca de volta no slot reservado na DOM para que não seja perdida sua referência.
502
+ if (!this.customGuidesConfig || this.customGuidesConfig.length === 0)
503
+ return;
504
+ const viewCustomGuideContainer = this._element.querySelector(`[data-custom-id="${this.CUSTOM_GUIDE_DATA_CUSTOM_ID}"]`);
505
+ const reservedSlotId = viewCustomGuideContainer === null || viewCustomGuideContainer === void 0 ? void 0 : viewCustomGuideContainer.getAttribute('data-reserved-slot-id');
506
+ if (!(viewCustomGuideContainer === null || viewCustomGuideContainer === void 0 ? void 0 : viewCustomGuideContainer.hasChildNodes()) || !reservedSlotId)
507
+ return;
508
+ const customGuideReservedSlot = document.querySelector(`#${reservedSlotId}`);
509
+ const customGuideElement = viewCustomGuideContainer === null || viewCustomGuideContainer === void 0 ? void 0 : viewCustomGuideContainer.firstElementChild;
510
+ if (!customGuideReservedSlot || !customGuideElement)
511
+ return;
512
+ customGuideReservedSlot.appendChild(customGuideElement);
513
+ }
460
514
  componentDidRender() {
515
+ var _a;
516
+ if (this.isCustomGuide((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id)) {
517
+ this.attachCustomGuideInView();
518
+ }
461
519
  if (!this._guideHasChanged) {
462
520
  return;
463
521
  }
@@ -586,6 +644,9 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
586
644
  const labels = selectedRecords.map(record => this.messagesBuilder.getMessage("snkCrud.title", record));
587
645
  return `[${labels.join(", ")}]`;
588
646
  }
647
+ getCustomGuidesConfig() {
648
+ return this._currentDetail ? [] : this.customGuidesConfig;
649
+ }
589
650
  componentDidLoad() {
590
651
  this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
591
652
  this.initKeyboardManager();
@@ -605,7 +666,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
605
666
  render() {
606
667
  var _a, _b;
607
668
  if (this._formEditorConfigManager != undefined) {
608
- return (h("snk-form-config", { ref: ref => this._container = ref, tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null }));
669
+ return (h("snk-form-config", { ref: ref => this._container = ref, tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null, customGuidesConfig: this.getCustomGuidesConfig() }));
609
670
  }
610
671
  if (!this.dataUnit || !this._configManager.isLoaded) {
611
672
  return;
@@ -631,6 +692,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
631
692
  get _element() { return this; }
632
693
  static get watchers() { return {
633
694
  "dataUnit": ["observeDataUnit"],
695
+ "_formEditorConfigManager": ["observeFormConfigManager"],
634
696
  "dataState": ["observeDataState"],
635
697
  "masterFormConfig": ["observeMasterFormConfig"]
636
698
  }; }
@@ -654,6 +716,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
654
716
  "enableGridInsert": [4, "enable-grid-insert"],
655
717
  "ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
656
718
  "getCustomTitle": [16],
719
+ "customGuidesConfig": [16],
657
720
  "_hasToCreateFieldSearch": [32],
658
721
  "_breadcrumbItems": [32],
659
722
  "_guides": [32],
@@ -1,10 +1,10 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
4
- import { b as buildGuides, c as buildGuidesMap, e as getFieldsToSave, u as updateTabInFieldsFromGroupList, f as buildNewGuideName, d as defineCustomElement$5 } from './field-config2.js';
5
- import { T as TAB_NAMES, G as GROUP_NAMES } from './constants.js';
6
4
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
7
5
  import { U as UserConfigType } from './form-config-fetcher.js';
6
+ import { T as TAB_NAMES, G as GROUP_NAMES } from './constants.js';
7
+ import { b as buildGuides, c as buildChildrenGuides, e as buildCustomGuides, f as buildGuidesMap, h as getFieldsToSave, u as updateTabInFieldsFromGroupList, i as buildNewGuideName, d as defineCustomElement$5 } from './field-config2.js';
8
8
  import { d as defineCustomElement$7 } from './config-header2.js';
9
9
  import { d as defineCustomElement$6 } from './configs-button2.js';
10
10
  import { d as defineCustomElement$4 } from './field-item2.js';
@@ -35,6 +35,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
35
35
  this.configManager = undefined;
36
36
  this.ignoreReadOnlyFormFields = undefined;
37
37
  this.messagesBuilder = undefined;
38
+ this.customGuidesConfig = [];
38
39
  }
39
40
  handleFieldConfigChanged() {
40
41
  this.hasChanges = true;
@@ -54,6 +55,10 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
54
55
  this.showNoGuideSelectedDialog();
55
56
  return;
56
57
  }
58
+ if (this.selectedGuide.isCustom || this.selectedGuide.isDetail) {
59
+ this.showCanNotAddFieldToGuideDialog();
60
+ return;
61
+ }
57
62
  this.availableFields = [...this.availableFields.filter(f => f.name !== fieldItem.name)];
58
63
  await ((_a = this.refFieldsLayout) === null || _a === void 0 ? void 0 : _a.addFieldToLayout(fieldItem));
59
64
  }
@@ -79,6 +84,11 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
79
84
  const message = this.getMessage('snkFormConfig.noGuideSelected.message');
80
85
  ApplicationUtils.alert(title, message);
81
86
  }
87
+ showCanNotAddFieldToGuideDialog() {
88
+ const title = this.getMessage('snkFormConfig.canNotAddFieldToGuide.title');
89
+ const message = this.getMessage('snkFormConfig.canNotAddFieldToGuide.message');
90
+ ApplicationUtils.alert(title, message);
91
+ }
82
92
  /**
83
93
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
84
94
  * através de um pequeno modulo na estrutura da aplicação:
@@ -151,9 +161,12 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
151
161
  });
152
162
  }
153
163
  loadGuides() {
154
- var _a;
155
- this.guidesList = [...buildGuides(this._formConfig, this.getMessage('snkFormConfig.form.mainArea'))];
156
- this.guidesMap = buildGuidesMap((_a = this._formConfig) === null || _a === void 0 ? void 0 : _a.fields, this.guidesList, this.dataUnit, this.getMessage('snkFormConfig.form.tabGeneral'));
164
+ var _a, _b, _c, _d;
165
+ this.guidesList = [];
166
+ this.guidesList.push(...buildGuides(this._formConfig, this.getMessage('snkFormConfig.form.mainArea')));
167
+ this.guidesList.push(...buildChildrenGuides(this.dataUnit, (_c = (_b = (_a = this._formConfig) === null || _a === void 0 ? void 0 : _a.tabs) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0, this.guidesList));
168
+ this.guidesList.push(...buildCustomGuides(this.customGuidesConfig, this.guidesList));
169
+ this.guidesMap = buildGuidesMap((_d = this._formConfig) === null || _d === void 0 ? void 0 : _d.fields, this.guidesList, this.dataUnit, this.getMessage('snkFormConfig.form.tabGeneral'));
157
170
  }
158
171
  getConfig() {
159
172
  let config = this.configManager.getConfig(this.dataUnit, false);
@@ -301,6 +314,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
301
314
  "configManager": [16],
302
315
  "ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
303
316
  "messagesBuilder": [1040],
317
+ "customGuidesConfig": [16],
304
318
  "availableFields": [32],
305
319
  "guidesList": [32],
306
320
  "groupsList": [32],
@@ -139,6 +139,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
139
139
  this._popUpGridConfig = false;
140
140
  this._showSnkFilterBar = true;
141
141
  this._enableContinuousInsert = false;
142
+ this._filterMode = 'regular';
142
143
  this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
143
144
  this.enableLockManagerLoadingComp = false;
144
145
  this.enableLockManagerTaskbarClick = false;
@@ -657,7 +658,8 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
657
658
  return;
658
659
  }
659
660
  if (filterConfig.length === 1 && filterConfig[0].id === 'PERSONALIZED_FILTER_GROUP') {
660
- this._showSnkFilterBar = filterConfig[0].groupedItems.length > 0;
661
+ this._showSnkFilterBar = true;
662
+ this._filterMode = filterConfig[0].groupedItems.length > 0 ? 'regular' : 'button';
661
663
  return;
662
664
  }
663
665
  this._showSnkFilterBar = true;
@@ -675,7 +677,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
675
677
  return undefined;
676
678
  }
677
679
  return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large ez-box--no-outline", tabindex: "0" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
678
- h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, filterCustomConfig: this.filterCustomConfig, filterCustomConfigInterceptor: this.filterCustomConfigInterceptor }), 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 ez-padding-top--extra-small", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none', actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? 'snk-grid-container__without-shadow ' : '') + 'snk-grid__table', "data-element-id": "embedded", dataUnit: this._dataUnit, key: 'grid-' + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => {
680
+ h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, filterCustomConfig: this.filterCustomConfig, filterCustomConfigInterceptor: this.filterCustomConfigInterceptor, mode: this._filterMode }), 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 ez-padding-top--extra-small", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none', actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? 'snk-grid-container__without-shadow ' : '') + 'snk-grid__table', "data-element-id": "embedded", dataUnit: this._dataUnit, key: 'grid-' + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => {
679
681
  this.gridConfigChangeHandler(evt);
680
682
  }, onEzColumnFilterChanged: async () => await this.dataExporterProviderStore(), onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode, useSearchColumn: this.useSearchColumn, suppressHorizontalScroll: this.suppressHorizontalScroll, paginationCounterMode: this.paginationCounterMode, suppressCheckboxColumn: this.suppressCheckboxColumn, suppressFilterColumn: this.suppressFilterColumn, compact: this.compact }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId, additionalSlotId: this.gridHeaderDynamicSearchSlotId, actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.gridHeaderCustomSlotId }), h("slot", { name: this.gridHeaderDynamicSearchSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, opened: this._popUpGridConfig, onEzClosePopup: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
681
683
  }
@@ -729,6 +731,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
729
731
  "_popUpGridConfig": [32],
730
732
  "_showSnkFilterBar": [32],
731
733
  "_enableContinuousInsert": [32],
734
+ "_filterMode": [32],
732
735
  "refreshColumnFilterDataSource": [64],
733
736
  "reloadConfig": [64],
734
737
  "showConfig": [64],