@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-kb-85616.0 → 0.0.0-bugfix-dev-KB-81596.1

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 (186) hide show
  1. package/dist/cjs/{ClientSideExporterProvider-9bd6fa5a.js → ClientSideExporterProvider-5fff8770.js} +20 -25
  2. package/dist/cjs/{ConfigStorage-6b633b10.js → ConfigStorage-df09fb78.js} +2 -2
  3. package/dist/cjs/{DataFetcher-875371e9.js → DataFetcher-1afdb18e.js} +14 -2
  4. package/dist/cjs/{pesquisa-fetcher-30cab386.js → ISave-c76e2c51.js} +35 -3
  5. package/dist/cjs/{SnkFormConfigManager-d680be08.js → SnkFormConfigManager-45a8d7b7.js} +3 -3
  6. package/dist/cjs/{auth-fetcher-24ba4135.js → auth-fetcher-1687ac0a.js} +1 -1
  7. package/dist/cjs/{constants-241934b3.js → constants-77c1b8bd.js} +1 -0
  8. package/dist/cjs/{dataunit-fetcher-b95768e8.js → dataunit-fetcher-4a5d491a.js} +7 -6
  9. package/dist/cjs/{form-config-fetcher-e0a512c3.js → form-config-fetcher-40d3f752.js} +15 -1
  10. package/dist/cjs/index-f9e81701.js +2 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +6 -7
  13. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  14. package/dist/cjs/{snk-actions-button_5.cjs.entry.js → snk-actions-button_7.cjs.entry.js} +68 -7
  15. package/dist/cjs/snk-application.cjs.entry.js +176 -13
  16. package/dist/cjs/snk-attach.cjs.entry.js +6 -7
  17. package/dist/cjs/snk-config-options_3.cjs.entry.js +10 -8
  18. package/dist/cjs/snk-configurator.cjs.entry.js +9 -2
  19. package/dist/cjs/snk-crud.cjs.entry.js +8 -8
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -7
  21. package/dist/cjs/{snk-data-unit-33937ffe.js → snk-data-unit-4b510d6e.js} +1 -1
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +11 -11
  24. package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
  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-filter-search.cjs.entry.js +18 -5
  28. package/dist/cjs/snk-grid.cjs.entry.js +7 -8
  29. package/dist/cjs/{snk-guides-viewer-65964889.js → snk-guides-viewer-e8e5f7b4.js} +7 -8
  30. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -9
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  32. package/dist/cjs/snk-pesquisa.cjs.entry.js +12 -13
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +10 -10
  34. package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
  35. package/dist/collection/collection-manifest.json +2 -0
  36. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +5 -2
  37. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js +107 -0
  38. package/dist/collection/components/snk-application/snk-application.js +126 -4
  39. package/dist/collection/components/snk-configurator/snk-configurator.js +26 -1
  40. package/dist/collection/components/snk-crud/snk-crud.js +20 -1
  41. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css +10 -1
  42. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +25 -1
  43. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
  44. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +15 -19
  45. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +18 -5
  46. package/dist/collection/components/snk-form-config/subcomponents/snk-config-options/snk-config-options.js +5 -3
  47. package/dist/collection/components/snk-grid-config/snk-grid-config.js +2 -0
  48. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.css +3 -0
  49. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +73 -0
  50. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.css +78 -0
  51. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js +57 -0
  52. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +20 -1
  53. package/dist/collection/lib/configs/LayoutFormConfig.js +25 -0
  54. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +14 -2
  55. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +6 -5
  56. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +14 -0
  57. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +26 -2
  58. package/dist/collection/lib/utils/constants.js +1 -0
  59. package/dist/components/ContinuousInsertUtils.js +15 -19
  60. package/dist/components/DataFetcher.js +14 -2
  61. package/dist/components/ISave.js +26 -2
  62. package/dist/components/constants.js +1 -0
  63. package/dist/components/dataunit-fetcher.js +6 -5
  64. package/dist/components/form-config-fetcher.js +14 -0
  65. package/dist/components/index.d.ts +2 -0
  66. package/dist/components/index.js +2 -0
  67. package/dist/components/snk-application2.js +174 -6
  68. package/dist/components/snk-attach2.js +34 -22
  69. package/dist/components/snk-config-options2.js +5 -3
  70. package/dist/components/snk-configurator2.js +22 -2
  71. package/dist/components/snk-crud.js +76 -62
  72. package/dist/components/snk-detail-view2.js +110 -86
  73. package/dist/components/snk-filter-search.js +18 -5
  74. package/dist/components/snk-grid-config2.js +2 -0
  75. package/dist/components/snk-layout-form-config.d.ts +11 -0
  76. package/dist/components/snk-layout-form-config.js +6 -0
  77. package/dist/components/snk-layout-form-config2.js +73 -0
  78. package/dist/components/snk-simple-crud2.js +33 -19
  79. package/dist/components/snk-view-representation.d.ts +11 -0
  80. package/dist/components/snk-view-representation.js +6 -0
  81. package/dist/components/snk-view-representation2.js +41 -0
  82. package/dist/esm/{ClientSideExporterProvider-e42c5a48.js → ClientSideExporterProvider-da9935ed.js} +20 -25
  83. package/dist/esm/{ConfigStorage-e5c1f4c0.js → ConfigStorage-71e6766f.js} +2 -2
  84. package/dist/esm/{DataFetcher-ecf5f903.js → DataFetcher-88e56266.js} +14 -2
  85. package/dist/esm/{pesquisa-fetcher-e26c3295.js → ISave-5efafc97.js} +36 -4
  86. package/dist/esm/{SnkFormConfigManager-1efd102b.js → SnkFormConfigManager-be490a33.js} +3 -3
  87. package/dist/esm/{auth-fetcher-9987c66e.js → auth-fetcher-3510520e.js} +1 -1
  88. package/dist/esm/{constants-75abb876.js → constants-7db1128a.js} +1 -0
  89. package/dist/esm/{dataunit-fetcher-ed6e65ef.js → dataunit-fetcher-1d02ecfc.js} +7 -6
  90. package/dist/esm/{form-config-fetcher-34becd23.js → form-config-fetcher-fa208a6c.js} +15 -1
  91. package/dist/esm/index-a7d3d3f1.js +2 -2
  92. package/dist/esm/loader.js +1 -1
  93. package/dist/esm/pesquisa-grid_2.entry.js +5 -6
  94. package/dist/esm/sankhyablocks.js +1 -1
  95. package/dist/esm/{snk-actions-button_5.entry.js → snk-actions-button_7.entry.js} +68 -9
  96. package/dist/esm/snk-application.entry.js +176 -13
  97. package/dist/esm/snk-attach.entry.js +6 -7
  98. package/dist/esm/snk-config-options_3.entry.js +10 -8
  99. package/dist/esm/snk-configurator.entry.js +9 -2
  100. package/dist/esm/snk-crud.entry.js +8 -8
  101. package/dist/esm/snk-data-exporter.entry.js +6 -7
  102. package/dist/esm/{snk-data-unit-6258b8ae.js → snk-data-unit-7d0ce406.js} +1 -1
  103. package/dist/esm/snk-data-unit.entry.js +3 -3
  104. package/dist/esm/snk-detail-view.entry.js +11 -11
  105. package/dist/esm/snk-field-config.entry.js +1 -1
  106. package/dist/esm/snk-filter-bar_4.entry.js +3 -3
  107. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  108. package/dist/esm/snk-filter-search.entry.js +18 -5
  109. package/dist/esm/snk-grid.entry.js +7 -8
  110. package/dist/esm/{snk-guides-viewer-9e43d0ca.js → snk-guides-viewer-c44b3839.js} +7 -8
  111. package/dist/esm/snk-guides-viewer.entry.js +8 -9
  112. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  113. package/dist/esm/snk-pesquisa.entry.js +5 -6
  114. package/dist/esm/snk-simple-crud.entry.js +10 -10
  115. package/dist/esm/snk-tab-config.entry.js +1 -1
  116. package/dist/sankhyablocks/p-00796b12.entry.js +1 -0
  117. package/dist/sankhyablocks/{p-3fcb90d6.js → p-03b68a74.js} +1 -1
  118. package/dist/sankhyablocks/p-092078e3.entry.js +1 -0
  119. package/dist/sankhyablocks/{p-d3b9b377.entry.js → p-165cde3b.entry.js} +1 -1
  120. package/dist/sankhyablocks/p-35f85998.entry.js +1 -0
  121. package/dist/sankhyablocks/{p-2953c481.entry.js → p-3749dffb.entry.js} +1 -1
  122. package/dist/sankhyablocks/p-38e3ffda.entry.js +1 -0
  123. package/dist/sankhyablocks/p-3b190fb1.entry.js +1 -0
  124. package/dist/sankhyablocks/{p-6c43fcde.entry.js → p-490b75b5.entry.js} +1 -1
  125. package/dist/sankhyablocks/p-4ad638be.js +1 -0
  126. package/dist/sankhyablocks/p-5503e89f.entry.js +1 -0
  127. package/dist/sankhyablocks/p-5cc206bb.entry.js +1 -0
  128. package/dist/sankhyablocks/{p-e66bcb5c.entry.js → p-5ffa0493.entry.js} +1 -1
  129. package/dist/sankhyablocks/{p-6c9d1be4.entry.js → p-60137b7a.entry.js} +1 -1
  130. package/dist/sankhyablocks/p-601b252b.js +26 -0
  131. package/dist/sankhyablocks/p-6293ded9.entry.js +11 -0
  132. package/dist/sankhyablocks/p-6dd38d7b.js +6 -0
  133. package/dist/sankhyablocks/{p-abd9681c.js → p-6e0a5314.js} +1 -1
  134. package/dist/sankhyablocks/{p-a77bdadc.js → p-73285a8a.js} +1 -1
  135. package/dist/sankhyablocks/p-893b9483.entry.js +1 -0
  136. package/dist/sankhyablocks/p-90684a75.entry.js +1 -0
  137. package/dist/sankhyablocks/{p-1d19a5b0.js → p-9261d8a0.js} +1 -1
  138. package/dist/sankhyablocks/p-92778d5a.js +1 -0
  139. package/dist/sankhyablocks/{p-7e0a0aae.js → p-a8be1d67.js} +1 -1
  140. package/dist/sankhyablocks/{p-2746d606.entry.js → p-b2a2a83e.entry.js} +1 -1
  141. package/dist/sankhyablocks/p-b6200d32.entry.js +1 -0
  142. package/dist/sankhyablocks/{p-23cd6abf.entry.js → p-c0eb761b.entry.js} +1 -1
  143. package/dist/sankhyablocks/p-d9fdb018.entry.js +1 -0
  144. package/dist/sankhyablocks/{p-3ce68be5.js → p-ebdb9d89.js} +1 -1
  145. package/dist/sankhyablocks/p-ef6f0a1b.entry.js +1 -0
  146. package/dist/sankhyablocks/{p-5a7e18f4.js → p-fbba7e3d.js} +1 -1
  147. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  148. package/dist/types/components/snk-application/search-strategy/exec-prepared-search-plus.d.ts +5 -0
  149. package/dist/types/components/snk-application/snk-application.d.ts +17 -2
  150. package/dist/types/components/snk-configurator/snk-configurator.d.ts +6 -0
  151. package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
  152. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +5 -0
  153. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +5 -3
  154. package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +1 -0
  155. package/dist/types/components/snk-layout-form-config/snk-layout-form-config.d.ts +15 -0
  156. package/dist/types/components/snk-layout-form-config/snk-view-representation/snk-view-representation.d.ts +10 -0
  157. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
  158. package/dist/types/components.d.ts +83 -1
  159. package/dist/types/lib/configs/LayoutFormConfig.d.ts +11 -0
  160. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +6 -0
  161. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +4 -1
  162. package/dist/types/lib/utils/constants.d.ts +1 -0
  163. package/package.json +1 -1
  164. package/react/components.d.ts +2 -0
  165. package/react/components.js +2 -0
  166. package/react/components.js.map +1 -1
  167. package/dist/cjs/ISave-e91b70a7.js +0 -9
  168. package/dist/esm/ISave-d8c8bc59.js +0 -9
  169. package/dist/sankhyablocks/p-04acdc3a.entry.js +0 -1
  170. package/dist/sankhyablocks/p-05fda408.entry.js +0 -1
  171. package/dist/sankhyablocks/p-1a8295af.entry.js +0 -1
  172. package/dist/sankhyablocks/p-1e48864c.js +0 -1
  173. package/dist/sankhyablocks/p-21749402.js +0 -1
  174. package/dist/sankhyablocks/p-22ddc147.js +0 -26
  175. package/dist/sankhyablocks/p-27d12f8f.entry.js +0 -1
  176. package/dist/sankhyablocks/p-3bab7e9c.entry.js +0 -1
  177. package/dist/sankhyablocks/p-3d424ae9.entry.js +0 -1
  178. package/dist/sankhyablocks/p-4b01cbad.entry.js +0 -11
  179. package/dist/sankhyablocks/p-4c9adf1c.entry.js +0 -1
  180. package/dist/sankhyablocks/p-6b898a51.entry.js +0 -1
  181. package/dist/sankhyablocks/p-9523fc40.entry.js +0 -1
  182. package/dist/sankhyablocks/p-a18de25e.js +0 -1
  183. package/dist/sankhyablocks/p-be2e5f36.entry.js +0 -1
  184. package/dist/sankhyablocks/p-c8622597.entry.js +0 -1
  185. package/dist/sankhyablocks/p-d571e243.entry.js +0 -1
  186. package/dist/sankhyablocks/p-ef076eea.js +0 -6
@@ -67,6 +67,7 @@ const TAGS_BY_TYPE = {
67
67
  CHECKBOX: "ez-check",
68
68
  OPTIONSELECTOR: "ez-combo-box",
69
69
  SEARCH: "ez-search",
70
+ SEARCHPLUS: "ez-search-plus",
70
71
  INTEGERNUMBER: "ez-number-input",
71
72
  DECIMALNUMBER: "ez-number-input"
72
73
  };
@@ -495,11 +495,12 @@ class DatasetStrategy {
495
495
  return InMemoryLoader.getConvertedValue(descriptor, strValue);
496
496
  }
497
497
  getSearchDescriptionField(descriptor) {
498
- if (descriptor.userInterface === UserInterface.SEARCH) {
499
- const { ENTITYNAME, mergedFrom, DESCRIPTIONFIELD } = descriptor.properties;
500
- if (!StringUtils.isEmpty(DESCRIPTIONFIELD)) {
501
- return mergedFrom != undefined ? `${mergedFrom}.${ENTITYNAME}.${DESCRIPTIONFIELD}` : `${ENTITYNAME}.${DESCRIPTIONFIELD}`;
502
- }
498
+ if (![UserInterface.SEARCH, UserInterface.SEARCHPLUS].includes(descriptor.userInterface)) {
499
+ return undefined;
500
+ }
501
+ const { ENTITYNAME, mergedFrom, DESCRIPTIONFIELD } = descriptor.properties;
502
+ if (!StringUtils.isEmpty(DESCRIPTIONFIELD)) {
503
+ return mergedFrom != undefined ? `${mergedFrom}.${ENTITYNAME}.${DESCRIPTIONFIELD}` : `${ENTITYNAME}.${DESCRIPTIONFIELD}`;
503
504
  }
504
505
  return undefined;
505
506
  }
@@ -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';
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking, UserAgentUtils, LockManager, LockManagerOperation } from '@sankhyalabs/core';
2
+ import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, SilentException, WarningException, ErrorException, ElementIDUtils, SearchUtils, ArrayUtils, KeyboardManager, OnboardingUtils, DependencyType, ApplicationContext, DataType, ErrorTracking, UserAgentUtils, LockManager, LockManagerOperation } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { C as ConfigStorage } from './ConfigStorage.js';
5
5
  import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher.js';
@@ -8,6 +8,8 @@ import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher.js
8
8
  import { a as PesquisaFetcher } from './ISave.js';
9
9
  import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
10
10
  import { T as TEMPLATES_SKELETON } from './constants.js';
11
+ import './filter-item-type.enum.js';
12
+ import { F as FormConfigFetcher } from './form-config-fetcher.js';
11
13
  import { d as defineCustomElement$3 } from './pesquisa-grid2.js';
12
14
  import { d as defineCustomElement$2 } from './pesquisa-tree2.js';
13
15
  import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
@@ -257,7 +259,10 @@ class SnkErrorHandler {
257
259
  if (exception.errorCode) {
258
260
  exception.message += this.buildErrorCodeHTML(exception.errorCode);
259
261
  }
260
- if (exception instanceof WaitingChangeException) {
262
+ if (exception instanceof SilentException) {
263
+ console.warn("SilentException ignorada", exception);
264
+ }
265
+ else if (exception instanceof WaitingChangeException) {
261
266
  this._app.alert(exception.title, exception.message);
262
267
  }
263
268
  else if (exception instanceof WarningException) {
@@ -377,6 +382,136 @@ class RequestListenerFactory {
377
382
  }
378
383
  }
379
384
 
385
+ const QTD_DETAIL_FIELDS_PREDICTIVE_SEARCH = 6;
386
+ const INVALID_CONTENT_PATTERNS = ['<img', '<svg'];
387
+ const executePreparedSearchPlus = async (mode, argument, options, app, pesquisaFetcher) => {
388
+ var _a;
389
+ const mdByName = {};
390
+ const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic } = options;
391
+ if (mode === "ADVANCED") {
392
+ return new Promise((accept, reject) => {
393
+ const pesquisaContent = document.createElement("snk-pesquisa");
394
+ pesquisaContent[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
395
+ pesquisaContent.entityName = entity;
396
+ pesquisaContent.argument = argument;
397
+ pesquisaContent.searchLoader = (text) => pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
398
+ pesquisaContent.isHierarchyEntity = isHierarchyEntity;
399
+ if (isHierarchyEntity) {
400
+ pesquisaContent.treeLoader = (text) => pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
401
+ pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
402
+ }
403
+ pesquisaContent.selectItem = (option) => {
404
+ accept(option);
405
+ app.clearPopUpTitle();
406
+ app.closePopUp();
407
+ };
408
+ app.setPopUpTitle(entityDescription);
409
+ app.showPopUp(pesquisaContent, undefined, undefined, reject);
410
+ });
411
+ }
412
+ else if (mode === "LOAD_DESCRIPTION") {
413
+ let result = await pesquisaFetcher.loadByCode(entity, argument, criteria, searchOptions);
414
+ result = ObjectUtils.stringToObject(result.json.$);
415
+ let descriptionField = result.descriptionField;
416
+ const option = (_a = result.data) === null || _a === void 0 ? void 0 : _a[0];
417
+ if (!option) {
418
+ return {
419
+ value: argument,
420
+ label: ""
421
+ };
422
+ }
423
+ return {
424
+ value: argument,
425
+ label: option[descriptionField]
426
+ };
427
+ }
428
+ else {
429
+ let codeValue;
430
+ let result = await pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions, codeValue);
431
+ result = ObjectUtils.stringToObject(result.json.$);
432
+ let descriptionField = result.descriptionField;
433
+ let pkField = result.pkField;
434
+ const list = result.data.map((item) => {
435
+ let fieldsMetadata = filterInvalidFields(result, item, mdByName);
436
+ let fields = filterMathFields(item['__matchFields'], fieldsMetadata, QTD_DETAIL_FIELDS_PREDICTIVE_SEARCH, mdByName);
437
+ return buildOptionItem(argument, item, fields, descriptionField, pkField);
438
+ });
439
+ return list;
440
+ }
441
+ };
442
+ const buildOptionItem = (argument, item, fields, descriptionField, pkField) => {
443
+ var _a;
444
+ const matchFields = item['__matchFields'];
445
+ const descriptionValue = (_a = item[descriptionField]) !== null && _a !== void 0 ? _a : "";
446
+ const pkValue = item[pkField];
447
+ let searchOption = {
448
+ value: pkValue,
449
+ label: descriptionValue,
450
+ presentationValue: StringUtils.highlightValue(argument, matchFields, pkValue, fields, true),
451
+ presentationLabel: descriptionField ? StringUtils.highlightValue(argument, matchFields, descriptionValue, fields, true) : "",
452
+ details: SearchUtils.buildDetails(argument, fields, item)
453
+ };
454
+ return searchOption;
455
+ };
456
+ const filterInvalidFields = (resp, item, mdByName) => {
457
+ let fieldsMetadata = resp.fieldsMetadata.filter((field) => {
458
+ let accept = !StringUtils.isEmpty(item[field.fieldName]) &&
459
+ field.visible !== false &&
460
+ field.type !== 'B' &&
461
+ resp.pkField !== field.fieldName &&
462
+ resp.descriptionField !== field.fieldName &&
463
+ (field.isPrimaryKey || !field.isLinkField) &&
464
+ !(field.type === 'S' && field.presentationType === 'H');
465
+ if (accept) {
466
+ mdByName[field.fieldName] = field;
467
+ }
468
+ //Condição que trata o problema de trazer imagem no entityCard na pesquisa de registros
469
+ if (typeof item[field.fieldName] === 'string' && INVALID_CONTENT_PATTERNS.some(pattern => item[field.fieldName].includes(pattern))) {
470
+ return false;
471
+ }
472
+ return accept;
473
+ });
474
+ return fieldsMetadata;
475
+ };
476
+ const filterMathFields = (matchFields, fields, qtyFields, mdByName) => {
477
+ if (matchFields && Array.isArray(matchFields)) {
478
+ matchFields.forEach((matchField) => {
479
+ let fieldMD = ArrayUtils.removeReference(fields, mdByName[matchField]);
480
+ if (fieldMD) {
481
+ fields.unshift(fieldMD);
482
+ }
483
+ });
484
+ }
485
+ fields = fields.slice(0, qtyFields);
486
+ return fields;
487
+ };
488
+
489
+ class LayoutFormConfig {
490
+ constructor() {
491
+ this._config = null;
492
+ this.listeners = [];
493
+ }
494
+ static getInstance() {
495
+ if (!LayoutFormConfig.instance) {
496
+ LayoutFormConfig.instance = new LayoutFormConfig();
497
+ }
498
+ return LayoutFormConfig.instance;
499
+ }
500
+ get config() {
501
+ return this._config;
502
+ }
503
+ setConfig(newConfig) {
504
+ this._config = newConfig;
505
+ this.notifyListeners();
506
+ }
507
+ onConfigChange(listener) {
508
+ this.listeners.push(listener);
509
+ }
510
+ notifyListeners() {
511
+ this.listeners.forEach(listener => listener(this._config));
512
+ }
513
+ }
514
+
380
515
  const snkApplicationCss = ".sc-snk-application-h{--scrim-z-index:var(--elevation--100, 100);display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
381
516
 
382
517
  const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -397,6 +532,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
397
532
  this._pendingActions = new Map;
398
533
  this._loadPkParameter = null;
399
534
  this._isLoadedByPk = false;
535
+ this._formConfigFetcher = new FormConfigFetcher();
536
+ this._LayoutFormConfigSingleton = LayoutFormConfig.getInstance();
400
537
  this._applicationReady = false;
401
538
  this._templateSkeleton = TEMPLATES_SKELETON.GRID;
402
539
  this._activeScrimWindow = false;
@@ -471,6 +608,14 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
471
608
  async getKeyboardManager() {
472
609
  return Promise.resolve(this._keyboardManager);
473
610
  }
611
+ /**
612
+ * Obtém o notificador de Layout de formulario.
613
+ *
614
+ * @return {LayoutFormConfig} the Configurador de Layout do Formulario
615
+ */
616
+ async getLayoutFormConfig() {
617
+ return Promise.resolve(this._LayoutFormConfigSingleton);
618
+ }
474
619
  /**
475
620
  * Obtém `true` caso o usuário logado seja o SUP.
476
621
  */
@@ -1001,7 +1146,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1001
1146
  searchOptions,
1002
1147
  allowsNonAnalytic
1003
1148
  };
1004
- return this.executePreparedSearch(mode, argument, options);
1149
+ return (ctxOptions === null || ctxOptions === void 0 ? void 0 : ctxOptions.useSearchPlus) ? this.executePreparedSearchPlus(mode, argument, options) : this.executePreparedSearch(mode, argument, options);
1005
1150
  }
1006
1151
  }
1007
1152
  filterInvalidFields(resp, item, mdByName) {
@@ -1045,13 +1190,23 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1045
1190
  };
1046
1191
  return exibitionItem;
1047
1192
  }
1193
+ /**
1194
+ * Realiza a pesquisa de registros
1195
+ * Ex.: snk-config-options
1196
+ */
1197
+ async executePreparedSearchPlus(mode, argument, options) {
1198
+ return await this.executePreparedSearch(mode, argument, Object.assign(Object.assign({}, options), { useSearchPlus: true }));
1199
+ }
1048
1200
  /**
1049
1201
  * Obtém as opções em componentes de pesquisa
1050
1202
  * Ex.: snk-config-options
1051
1203
  */
1052
1204
  async executePreparedSearch(mode, argument, options) {
1053
1205
  const mdByName = {};
1054
- const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic } = options;
1206
+ const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic, useSearchPlus } = options;
1207
+ if (useSearchPlus) {
1208
+ return executePreparedSearchPlus(mode, argument, options, this, this.pesquisaFetcher);
1209
+ }
1055
1210
  if (mode === "ADVANCED") {
1056
1211
  return new Promise((accept, reject) => {
1057
1212
  const pesquisaContent = document.createElement("snk-pesquisa");
@@ -1201,10 +1356,10 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1201
1356
  });
1202
1357
  }
1203
1358
  }
1204
- clearPopUpTitle() {
1359
+ async clearPopUpTitle() {
1205
1360
  this._popUp.ezTitle = "";
1206
1361
  }
1207
- setPopUpTitle(title) {
1362
+ async setPopUpTitle(title) {
1208
1363
  this._popUp.ezTitle = title;
1209
1364
  }
1210
1365
  async pkChangeListener() {
@@ -1374,6 +1529,9 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1374
1529
  ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit, ctxOptions) => {
1375
1530
  return this.executeSearch(searchArgument, fieldName, dataUnit, ctxOptions);
1376
1531
  });
1532
+ ApplicationContext.setContextValue("__EZUI__SEARCH__PLUS__OPTION__LOADER__", (searchArgument, fieldName, dataUnit, ctxOptions) => {
1533
+ return this.executeSearch(searchArgument, fieldName, dataUnit, Object.assign(Object.assign({}, ctxOptions), { useSearchPlus: true }));
1534
+ });
1377
1535
  ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
1378
1536
  this.registerPkChangeListener();
1379
1537
  ErrorTracking.init();
@@ -1384,6 +1542,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1384
1542
  ConfigStorage.preload(this.applicationResourceID, this.configName, legacyConfig);
1385
1543
  document.addEventListener("click", () => Workspace.applicationClick());
1386
1544
  this._waitingAppReady.forEach(resolve => resolve());
1545
+ this.setLayoutFormConfig();
1546
+ }
1547
+ async setLayoutFormConfig() {
1548
+ const response = await this._formConfigFetcher.fetchLayoutFormConfig('formColCfg.' + this.applicationResourceID);
1549
+ const config = isNaN(Number(response === null || response === void 0 ? void 0 : response.config)) ? null : Number(response === null || response === void 0 ? void 0 : response.config);
1550
+ this._LayoutFormConfigSingleton.setConfig(config);
1387
1551
  }
1388
1552
  connectedCallback() {
1389
1553
  this._isBrowserTypeElectron = UserAgentUtils.isElectron();
@@ -1564,6 +1728,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1564
1728
  "_templateSkeleton": [32],
1565
1729
  "_activeScrimWindow": [32],
1566
1730
  "getKeyboardManager": [64],
1731
+ "getLayoutFormConfig": [64],
1567
1732
  "isUserSup": [64],
1568
1733
  "addPendingAction": [64],
1569
1734
  "callServiceBroker": [64],
@@ -1604,6 +1769,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1604
1769
  "isLoadedByPk": [64],
1605
1770
  "preloadMangerRemoveRecord": [64],
1606
1771
  "executeSearch": [64],
1772
+ "executePreparedSearchPlus": [64],
1607
1773
  "executePreparedSearch": [64],
1608
1774
  "isDebugMode": [64],
1609
1775
  "getAppLabel": [64],
@@ -1614,6 +1780,8 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1614
1780
  "getDataFetcher": [64],
1615
1781
  "whenApplicationReady": [64],
1616
1782
  "setSearchFilterContext": [64],
1783
+ "clearPopUpTitle": [64],
1784
+ "setPopUpTitle": [64],
1617
1785
  "showScrimApp": [64],
1618
1786
  "markToReload": [64],
1619
1787
  "addLoadingLock": [64]
@@ -7,17 +7,19 @@ import './filter-item-type.enum.js';
7
7
  import './form-config-fetcher.js';
8
8
  import { V as VIEW_MODE } from './constants.js';
9
9
  import { A as AutorizationType } from './auth-fetcher.js';
10
- import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
11
- import { d as defineCustomElement$c } from './snk-actions-button2.js';
12
- import { d as defineCustomElement$b } from './snk-configurator2.js';
13
- import { d as defineCustomElement$a } from './snk-data-exporter2.js';
14
- import { d as defineCustomElement$9 } from './snk-data-unit2.js';
15
- import { d as defineCustomElement$8 } from './snk-exporter-email-sender2.js';
16
- import { d as defineCustomElement$7 } from './snk-grid-config2.js';
17
- import { d as defineCustomElement$6 } from './snk-select-box2.js';
18
- import { d as defineCustomElement$5 } from './snk-simple-bar2.js';
19
- import { d as defineCustomElement$4 } from './snk-simple-crud2.js';
20
- import { d as defineCustomElement$3 } from './snk-simple-form-config2.js';
10
+ import { T as TaskbarElement, d as defineCustomElement$3 } from './snk-taskbar2.js';
11
+ import { d as defineCustomElement$e } from './snk-actions-button2.js';
12
+ import { d as defineCustomElement$d } from './snk-configurator2.js';
13
+ import { d as defineCustomElement$c } from './snk-data-exporter2.js';
14
+ import { d as defineCustomElement$b } from './snk-data-unit2.js';
15
+ import { d as defineCustomElement$a } from './snk-exporter-email-sender2.js';
16
+ import { d as defineCustomElement$9 } from './snk-grid-config2.js';
17
+ import { d as defineCustomElement$8 } from './snk-layout-form-config2.js';
18
+ import { d as defineCustomElement$7 } from './snk-select-box2.js';
19
+ import { d as defineCustomElement$6 } from './snk-simple-bar2.js';
20
+ import { d as defineCustomElement$5 } from './snk-simple-crud2.js';
21
+ import { d as defineCustomElement$4 } from './snk-simple-form-config2.js';
22
+ import { d as defineCustomElement$2 } from './snk-view-representation2.js';
21
23
  import { d as defineCustomElement$1 } from './taskbar-actions-button2.js';
22
24
 
23
25
  const SERVICE$1 = {
@@ -869,7 +871,7 @@ function defineCustomElement() {
869
871
  if (typeof customElements === "undefined") {
870
872
  return;
871
873
  }
872
- const components = ["snk-attach", "snk-actions-button", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-grid-config", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-simple-form-config", "snk-taskbar", "taskbar-actions-button"];
874
+ const components = ["snk-attach", "snk-actions-button", "snk-configurator", "snk-data-exporter", "snk-data-unit", "snk-exporter-email-sender", "snk-grid-config", "snk-layout-form-config", "snk-select-box", "snk-simple-bar", "snk-simple-crud", "snk-simple-form-config", "snk-taskbar", "snk-view-representation", "taskbar-actions-button"];
873
875
  components.forEach(tagName => { switch (tagName) {
874
876
  case "snk-attach":
875
877
  if (!customElements.get(tagName)) {
@@ -878,55 +880,65 @@ function defineCustomElement() {
878
880
  break;
879
881
  case "snk-actions-button":
880
882
  if (!customElements.get(tagName)) {
881
- defineCustomElement$c();
883
+ defineCustomElement$e();
882
884
  }
883
885
  break;
884
886
  case "snk-configurator":
885
887
  if (!customElements.get(tagName)) {
886
- defineCustomElement$b();
888
+ defineCustomElement$d();
887
889
  }
888
890
  break;
889
891
  case "snk-data-exporter":
890
892
  if (!customElements.get(tagName)) {
891
- defineCustomElement$a();
893
+ defineCustomElement$c();
892
894
  }
893
895
  break;
894
896
  case "snk-data-unit":
895
897
  if (!customElements.get(tagName)) {
896
- defineCustomElement$9();
898
+ defineCustomElement$b();
897
899
  }
898
900
  break;
899
901
  case "snk-exporter-email-sender":
900
902
  if (!customElements.get(tagName)) {
901
- defineCustomElement$8();
903
+ defineCustomElement$a();
902
904
  }
903
905
  break;
904
906
  case "snk-grid-config":
905
907
  if (!customElements.get(tagName)) {
906
- defineCustomElement$7();
908
+ defineCustomElement$9();
909
+ }
910
+ break;
911
+ case "snk-layout-form-config":
912
+ if (!customElements.get(tagName)) {
913
+ defineCustomElement$8();
907
914
  }
908
915
  break;
909
916
  case "snk-select-box":
910
917
  if (!customElements.get(tagName)) {
911
- defineCustomElement$6();
918
+ defineCustomElement$7();
912
919
  }
913
920
  break;
914
921
  case "snk-simple-bar":
915
922
  if (!customElements.get(tagName)) {
916
- defineCustomElement$5();
923
+ defineCustomElement$6();
917
924
  }
918
925
  break;
919
926
  case "snk-simple-crud":
920
927
  if (!customElements.get(tagName)) {
921
- defineCustomElement$4();
928
+ defineCustomElement$5();
922
929
  }
923
930
  break;
924
931
  case "snk-simple-form-config":
925
932
  if (!customElements.get(tagName)) {
926
- defineCustomElement$3();
933
+ defineCustomElement$4();
927
934
  }
928
935
  break;
929
936
  case "snk-taskbar":
937
+ if (!customElements.get(tagName)) {
938
+ defineCustomElement$3();
939
+ }
940
+ break;
941
+ case "snk-view-representation":
930
942
  if (!customElements.get(tagName)) {
931
943
  defineCustomElement$2();
932
944
  }
@@ -142,11 +142,13 @@ const SnkConfigOptions = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
142
142
  return h(TagName, Object.assign({ value: value, enabled: enabled, label: label, "data-field-name": name, key: name, onEzChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail) }, (this.getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode))));
143
143
  }
144
144
  getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode) {
145
+ const useSearchPlus = userInterface == UserInterface.SEARCHPLUS;
145
146
  switch (userInterface) {
146
147
  case UserInterface.SEARCH:
148
+ case UserInterface.SEARCHPLUS:
147
149
  return {
148
150
  suppressEmptyOption: required,
149
- optionLoader: (searchArgument) => this.onSearch(searchArgument)
151
+ optionLoader: (searchArgument) => this.onSearch(searchArgument, { useSearchPlus })
150
152
  };
151
153
  case UserInterface.OPTIONSELECTOR:
152
154
  return {
@@ -179,9 +181,9 @@ const SnkConfigOptions = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
179
181
  this.fieldConfig.defaultValue.value = this.getValidatedValue(fieldValue);
180
182
  this.configOptionsChanged.emit(this.fieldConfig);
181
183
  }
182
- onSearch(searchArgument) {
184
+ onSearch(searchArgument, ctxOptions) {
183
185
  if (this._application != undefined && this.fieldConfig != undefined) {
184
- return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit);
186
+ return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit, ctxOptions);
185
187
  }
186
188
  }
187
189
  buildField(descriptor, config) {
@@ -2,6 +2,8 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
2
2
  import { ApplicationContext } from '@sankhyalabs/core';
3
3
  import { V as VIEW_MODE } from './constants.js';
4
4
  import { A as AuthorizationConfig } from './AuthorizationConfig.js';
5
+ import { d as defineCustomElement$2 } from './snk-layout-form-config2.js';
6
+ import { d as defineCustomElement$1 } from './snk-view-representation2.js';
5
7
 
6
8
  const snkConfiguratorCss = ".sc-snk-configurator-h{--snk-configurator__button-close--padding-left:var(--space--medium, 12px);--snk-configurator__title--color:var(--title--primary, #2B3A54);--snk-configurator__title--font-family:var(--font-pattern, \"Roboto\");--snk-configurator__title--font-size:var(--title--large, 20px);--snk-configurator__title--font-weight:var(--text-weight--extra-large, 700);--snk-configurator__subtitle--color:var(--title--primary, #2B3A54);--snk-configurator__subtitle--font-family:var(--font-pattern, \"Roboto\");--snk-configurator__subtitle--font-size:var(--text--medium, 14px);--snk-configurator__subtitle--font-weight:var(--text-weight--large, 600);--snk-configurator__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-configurator__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-configurator__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-configurator__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-configurator__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-configurator__scrollbar--width:var(--space--small, 6px)}.snk-configurator.sc-snk-configurator{display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.snk-configurator__collsable-box-action.sc-snk-configurator{width:100%}.snk-configurator__action-buttons.sc-snk-configurator{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium)}.snk-configurator__outline.sc-snk-configurator{display:flex;flex-direction:column;gap:var(--space--small);margin-top:var(--space--small);margin-bottom:var(--space--large)}@media screen and (min-width: 480px){.snk-configurator.sc-snk-configurator{width:359px;max-width:359px}}.snk-configurator__button-config.sc-snk-configurator{--ez-button--min-width:100%}.snk-configurator__header.sc-snk-configurator{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-configurator__title.sc-snk-configurator{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-configurator__title--color);font-size:var(--snk-configurator__title--font-size);font-family:var(--snk-configurator__title--font-family);font-weight:var(--snk-configurator__title--font-weight)}.snk-configurator__subtitle.sc-snk-configurator{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-configurator__subtitle--color);font-size:var(--snk-configurator__subtitle--font-size);font-family:var(--snk-configurator__subtitle--font-family);font-weight:var(--snk-configurator__subtitle--font-weight)}.snk-configurator__button-close.sc-snk-configurator{padding-left:var(--snk-configurator__button-close--padding-left)}.snk-configurator__main.sc-snk-configurator{overflow-y:auto;scrollbar-width:thin;margin:var(--space--medium) 0;scrollbar-color:var(--snk-configurator__scrollbar--color-clicked) var(--snk-configurator__scrollbar--color-background)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar{background-color:var(--snk-configurator__scrollbar--color-background);width:var(--snk-configurator__scrollbar--width);max-width:var(--snk-configurator__scrollbar--width);min-width:var(--snk-configurator__scrollbar--width)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-track{background-color:var(--snk-configurator__scrollbar--color-background);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb{background-color:var(--snk-configurator__scrollbar--color-default);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:hover,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-configurator__scrollbar--color-hover)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:active,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-configurator__scrollbar--color-clicked)}";
7
9
 
@@ -20,6 +22,7 @@ const SnkConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
20
22
  this.resourceID = undefined;
21
23
  this.viewMode = VIEW_MODE.GRID;
22
24
  this.customContainerId = undefined;
25
+ this.layoutFormConfig = false;
23
26
  this.messagesBuilder = undefined;
24
27
  }
25
28
  /**
@@ -80,6 +83,12 @@ const SnkConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
80
83
  var _a;
81
84
  return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, {});
82
85
  }
86
+ handleSave() {
87
+ if (this.layoutFormConfig) {
88
+ this._snkLayoutFormConfig.save();
89
+ }
90
+ this.save.emit();
91
+ }
83
92
  componentWillLoad() {
84
93
  this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
85
94
  if (this._application) {
@@ -103,7 +112,7 @@ const SnkConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
103
112
  insideCustomElementsContainer === null || insideCustomElementsContainer === void 0 ? void 0 : insideCustomElementsContainer.appendChild(configuratorCustomElement);
104
113
  }
105
114
  render() {
106
- 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" }))))));
115
+ 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" }))))));
107
116
  }
108
117
  get _element() { return this; }
109
118
  static get style() { return snkConfiguratorCss; }
@@ -113,6 +122,7 @@ const SnkConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
113
122
  "resourceID": [1, "resource-i-d"],
114
123
  "viewMode": [2, "view-mode"],
115
124
  "customContainerId": [1, "custom-container-id"],
125
+ "layoutFormConfig": [4, "layout-form-config"],
116
126
  "messagesBuilder": [1040],
117
127
  "_opened": [32],
118
128
  "_permissions": [32],
@@ -123,13 +133,23 @@ function defineCustomElement() {
123
133
  if (typeof customElements === "undefined") {
124
134
  return;
125
135
  }
126
- const components = ["snk-configurator"];
136
+ const components = ["snk-configurator", "snk-layout-form-config", "snk-view-representation"];
127
137
  components.forEach(tagName => { switch (tagName) {
128
138
  case "snk-configurator":
129
139
  if (!customElements.get(tagName)) {
130
140
  customElements.define(tagName, SnkConfigurator);
131
141
  }
132
142
  break;
143
+ case "snk-layout-form-config":
144
+ if (!customElements.get(tagName)) {
145
+ defineCustomElement$2();
146
+ }
147
+ break;
148
+ case "snk-view-representation":
149
+ if (!customElements.get(tagName)) {
150
+ defineCustomElement$1();
151
+ }
152
+ break;
133
153
  } });
134
154
  }
135
155