@sankhyalabs/sankhyablocks 10.1.0-dev.1 → 10.1.0-dev.11

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 (197) hide show
  1. package/dist/cjs/{ConfigStorage-5a73e979.js → ConfigStorage-5c0590b3.js} +2 -2
  2. package/dist/cjs/{DataFetcher-eeb3b0b7.js → DataFetcher-5181a917.js} +23 -2
  3. package/dist/cjs/{FormConfigHelper-ebb77625.js → FormConfigHelper-28fe4668.js} +44 -0
  4. package/dist/cjs/{ISave-861e9d6d.js → ISave-0f98a457.js} +4 -4
  5. package/dist/cjs/{SnkFormConfigManager-8d4fded8.js → SnkFormConfigManager-1907ffed.js} +7 -7
  6. package/dist/cjs/{SnkMultiSelectionListDataSource-3b93f6a6.js → SnkMultiSelectionListDataSource-e4e38139.js} +4 -4
  7. package/dist/cjs/{auth-fetcher-8d8acd69.js → auth-fetcher-cff55b1f.js} +1 -1
  8. package/dist/cjs/{dataunit-fetcher-1cea0695.js → dataunit-fetcher-1ba5e2cc.js} +1 -1
  9. package/dist/cjs/field-config_2.cjs.entry.js +1 -1
  10. package/dist/cjs/fields-layout.cjs.entry.js +6 -3
  11. package/dist/cjs/fields-selector.cjs.entry.js +1 -1
  12. package/dist/cjs/{form-config-fetcher-f347f884.js → form-config-fetcher-4a679e23.js} +1 -1
  13. package/dist/cjs/guides-configurator.cjs.entry.js +5 -3
  14. package/dist/cjs/index-1cf293c1.js +4 -0
  15. package/dist/cjs/loader.cjs.js +1 -1
  16. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
  17. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  18. package/dist/cjs/snk-actions-button_9.cjs.entry.js +14 -7
  19. package/dist/cjs/snk-application.cjs.entry.js +81 -69
  20. package/dist/cjs/snk-attach.cjs.entry.js +5 -5
  21. package/dist/cjs/snk-crud.cjs.entry.js +97 -6
  22. package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +40 -0
  23. package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
  24. package/dist/cjs/{snk-data-unit-de248308.js → snk-data-unit-061487a8.js} +4 -2
  25. package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
  26. package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
  27. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +3 -3
  28. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  29. package/dist/cjs/snk-form-view.cjs.entry.js +2 -6
  30. package/dist/cjs/snk-form_2.cjs.entry.js +32 -9
  31. package/dist/cjs/snk-grid.cjs.entry.js +13 -10
  32. package/dist/cjs/{snk-guides-viewer-4ec3e7e1.js → snk-guides-viewer-2efe60a7.js} +84 -38
  33. package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
  34. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  35. package/dist/cjs/snk-pesquisa.cjs.entry.js +16 -5
  36. package/dist/cjs/snk-simple-crud.cjs.entry.js +9 -17
  37. package/dist/cjs/snk-taskbar.cjs.entry.js +64 -48
  38. package/dist/collection/collection-manifest.json +2 -1
  39. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.js +27 -0
  40. package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js +5 -25
  41. package/dist/collection/components/snk-application/snk-application.js +87 -44
  42. package/dist/collection/components/snk-attach/snk-attach.js +1 -1
  43. package/dist/collection/components/snk-crud/snk-crud.js +151 -2
  44. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +2 -6
  45. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +133 -34
  46. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.css +3 -0
  47. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.js +95 -0
  48. package/dist/collection/components/snk-data-unit/snk-data-unit.js +2 -0
  49. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
  50. package/dist/collection/components/snk-form-config/FormConfigHelper.js +42 -0
  51. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -6
  52. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
  53. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +6 -3
  54. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -3
  55. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +5 -3
  56. package/dist/collection/components/snk-form-config/snk-form-config.js +53 -6
  57. package/dist/collection/components/snk-grid/snk-grid.css +14 -0
  58. package/dist/collection/components/snk-grid/snk-grid.js +26 -4
  59. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +9 -2
  60. package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +5 -1
  61. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +43 -0
  62. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +3 -11
  63. package/dist/collection/components/snk-taskbar/snk-taskbar.js +87 -48
  64. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +3 -3
  65. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +7 -0
  66. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +7 -0
  67. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +8 -1
  68. package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js +1 -1
  69. package/dist/components/DataFetcher.js +23 -2
  70. package/dist/components/ISave.js +3 -3
  71. package/dist/components/SnkFormConfigManager.js +6 -6
  72. package/dist/components/field-config2.js +43 -1
  73. package/dist/components/fields-layout2.js +6 -3
  74. package/dist/components/guides-configurator2.js +5 -3
  75. package/dist/components/index.d.ts +1 -0
  76. package/dist/components/index.js +1 -0
  77. package/dist/components/snk-application2.js +76 -63
  78. package/dist/components/snk-attach2.js +1 -1
  79. package/dist/components/snk-crud.js +96 -1
  80. package/dist/components/snk-custom-slot-guide.d.ts +11 -0
  81. package/dist/components/snk-custom-slot-guide.js +55 -0
  82. package/dist/components/snk-data-unit2.js +2 -0
  83. package/dist/components/snk-detail-view2.js +81 -34
  84. package/dist/components/snk-filter-number.js +1 -1
  85. package/dist/components/snk-form-config2.js +29 -5
  86. package/dist/components/snk-form-view2.js +2 -6
  87. package/dist/components/snk-grid2.js +9 -4
  88. package/dist/components/snk-layout-form-config2.js +9 -2
  89. package/dist/components/snk-pesquisa2.js +14 -2
  90. package/dist/components/snk-simple-crud2.js +3 -11
  91. package/dist/components/snk-taskbar2.js +66 -49
  92. package/dist/esm/{ConfigStorage-568dc227.js → ConfigStorage-bd096633.js} +2 -2
  93. package/dist/esm/{DataFetcher-743feb3b.js → DataFetcher-5780ad39.js} +23 -2
  94. package/dist/esm/{FormConfigHelper-4e42f0b6.js → FormConfigHelper-d09669f3.js} +43 -1
  95. package/dist/esm/{ISave-345481c1.js → ISave-8a22ec18.js} +4 -4
  96. package/dist/esm/{SnkFormConfigManager-d61df0c8.js → SnkFormConfigManager-437e98bb.js} +7 -7
  97. package/dist/esm/{SnkMultiSelectionListDataSource-ca8d7a09.js → SnkMultiSelectionListDataSource-42125ef4.js} +4 -4
  98. package/dist/esm/{auth-fetcher-c353127d.js → auth-fetcher-28b9d0db.js} +1 -1
  99. package/dist/esm/{dataunit-fetcher-7f2c61ca.js → dataunit-fetcher-c4251d80.js} +1 -1
  100. package/dist/esm/field-config_2.entry.js +1 -1
  101. package/dist/esm/fields-layout.entry.js +6 -3
  102. package/dist/esm/fields-selector.entry.js +1 -1
  103. package/dist/esm/{form-config-fetcher-898d2dd1.js → form-config-fetcher-d0536a71.js} +1 -1
  104. package/dist/esm/guides-configurator.entry.js +5 -3
  105. package/dist/esm/index-479e1293.js +4 -0
  106. package/dist/esm/loader.js +1 -1
  107. package/dist/esm/pesquisa-grid_2.entry.js +4 -4
  108. package/dist/esm/sankhyablocks.js +1 -1
  109. package/dist/esm/snk-actions-button_9.entry.js +14 -7
  110. package/dist/esm/snk-application.entry.js +81 -69
  111. package/dist/esm/snk-attach.entry.js +5 -5
  112. package/dist/esm/snk-crud.entry.js +97 -6
  113. package/dist/esm/snk-custom-slot-guide.entry.js +36 -0
  114. package/dist/esm/snk-data-exporter.entry.js +5 -5
  115. package/dist/esm/{snk-data-unit-60b338c5.js → snk-data-unit-4a1ef77f.js} +4 -2
  116. package/dist/esm/snk-data-unit.entry.js +3 -3
  117. package/dist/esm/snk-detail-view.entry.js +7 -7
  118. package/dist/esm/snk-filter-bar_4.entry.js +3 -3
  119. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  120. package/dist/esm/snk-form-view.entry.js +2 -6
  121. package/dist/esm/snk-form_2.entry.js +32 -9
  122. package/dist/esm/snk-grid.entry.js +13 -10
  123. package/dist/esm/{snk-guides-viewer-339e10b3.js → snk-guides-viewer-c182d058.js} +84 -38
  124. package/dist/esm/snk-guides-viewer.entry.js +7 -7
  125. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  126. package/dist/esm/snk-pesquisa.entry.js +16 -5
  127. package/dist/esm/snk-simple-crud.entry.js +9 -17
  128. package/dist/esm/snk-taskbar.entry.js +65 -49
  129. package/dist/sankhyablocks/{p-e6b1c769.entry.js → p-01ca59fc.entry.js} +1 -1
  130. package/dist/sankhyablocks/p-028fb380.entry.js +11 -0
  131. package/dist/sankhyablocks/{p-1f8cb438.entry.js → p-03f02b12.entry.js} +1 -1
  132. package/dist/sankhyablocks/{p-1788d191.js → p-0e4f8b86.js} +1 -1
  133. package/dist/sankhyablocks/p-1037ea7b.entry.js +1 -0
  134. package/dist/sankhyablocks/{p-6d241415.js → p-1b1373b6.js} +1 -1
  135. package/dist/sankhyablocks/{p-27005fac.entry.js → p-2e882241.entry.js} +1 -1
  136. package/dist/sankhyablocks/p-30a58e29.entry.js +1 -0
  137. package/dist/sankhyablocks/p-3b167a03.entry.js +1 -0
  138. package/dist/sankhyablocks/{p-e8c49c12.js → p-3c046287.js} +2 -2
  139. package/dist/sankhyablocks/{p-bd203e8d.entry.js → p-42272de8.entry.js} +1 -1
  140. package/dist/sankhyablocks/{p-11346b8d.entry.js → p-4c2e2767.entry.js} +1 -1
  141. package/dist/sankhyablocks/{p-7fc46290.js → p-4db9dbf8.js} +1 -1
  142. package/dist/sankhyablocks/{p-626b7a17.js → p-55d7abe7.js} +1 -1
  143. package/dist/sankhyablocks/p-5d408e7e.entry.js +1 -0
  144. package/dist/sankhyablocks/{p-9b6d4950.entry.js → p-6e5af618.entry.js} +1 -1
  145. package/dist/sankhyablocks/{p-144da1d1.entry.js → p-78d4b3e3.entry.js} +1 -1
  146. package/dist/sankhyablocks/p-82a3d522.entry.js +1 -0
  147. package/dist/sankhyablocks/p-8b4d6719.js +1 -0
  148. package/dist/sankhyablocks/{p-e64958ba.entry.js → p-903fa0b4.entry.js} +1 -1
  149. package/dist/sankhyablocks/p-987cd79d.entry.js +1 -0
  150. package/dist/sankhyablocks/{p-88ed2793.js → p-9ab6ae1e.js} +2 -2
  151. package/dist/sankhyablocks/{p-c90f337a.entry.js → p-9f16d33e.entry.js} +1 -1
  152. package/dist/sankhyablocks/p-a1d23fef.js +1 -0
  153. package/dist/sankhyablocks/{p-bb0de89c.entry.js → p-a64ffe30.entry.js} +1 -1
  154. package/dist/sankhyablocks/p-aca74b21.js +1 -0
  155. package/dist/sankhyablocks/p-b7e891cc.entry.js +1 -0
  156. package/dist/sankhyablocks/{p-1d585081.js → p-b9699067.js} +1 -1
  157. package/dist/sankhyablocks/p-c98c79c3.entry.js +1 -0
  158. package/dist/sankhyablocks/p-d2ec9a24.entry.js +1 -0
  159. package/dist/sankhyablocks/{p-59b8f277.js → p-d3534985.js} +1 -1
  160. package/dist/sankhyablocks/{p-7b3ca294.entry.js → p-f3027bc9.entry.js} +1 -1
  161. package/dist/sankhyablocks/{p-f8f29e1a.entry.js → p-f35f2eb3.entry.js} +1 -1
  162. package/dist/sankhyablocks/p-fd05e31d.entry.js +1 -0
  163. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  164. package/dist/types/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.d.ts +5 -0
  165. package/dist/types/components/snk-application/snk-application.d.ts +9 -0
  166. package/dist/types/components/snk-crud/snk-crud.d.ts +22 -0
  167. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +23 -0
  168. package/dist/types/components/snk-custom-slot-guide/snk-custom-slot-guide.d.ts +16 -0
  169. package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +6 -1
  170. package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -1
  171. package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
  172. package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
  173. package/dist/types/components/snk-form-config/snk-form-config.d.ts +9 -2
  174. package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
  175. package/dist/types/components/snk-layout-form-config/snk-layout-form-config.d.ts +2 -2
  176. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +8 -0
  177. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -1
  178. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +12 -4
  179. package/dist/types/components.d.ts +105 -0
  180. package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
  181. package/package.json +1 -1
  182. package/react/components.d.ts +1 -0
  183. package/react/components.js +1 -0
  184. package/react/components.js.map +1 -1
  185. package/dist/sankhyablocks/p-0cf9aa38.js +0 -1
  186. package/dist/sankhyablocks/p-1649f51e.entry.js +0 -1
  187. package/dist/sankhyablocks/p-2c86cfab.entry.js +0 -1
  188. package/dist/sankhyablocks/p-4759912d.entry.js +0 -1
  189. package/dist/sankhyablocks/p-56948f00.entry.js +0 -11
  190. package/dist/sankhyablocks/p-8f73da95.js +0 -1
  191. package/dist/sankhyablocks/p-95c71f5e.entry.js +0 -1
  192. package/dist/sankhyablocks/p-9f2cdaab.entry.js +0 -1
  193. package/dist/sankhyablocks/p-9fe91526.js +0 -1
  194. package/dist/sankhyablocks/p-a5108625.entry.js +0 -1
  195. package/dist/sankhyablocks/p-aae4258d.entry.js +0 -1
  196. package/dist/sankhyablocks/p-af9d79e0.entry.js +0 -1
  197. package/dist/sankhyablocks/p-f25c50f7.entry.js +0 -1
@@ -33,6 +33,7 @@ import { Action, TaskbarManager } from "./components/snk-taskbar/snk-taskbar";
33
33
  import { IFormCardConfig, IFormConfig, IRecordValidator, ISummaryField } from "@sankhyalabs/ezui/dist/types/utils/form/interfaces";
34
34
  import { EzGridColumn, IGridConfig, IStatusResolver, StatusResolverFunction } from "@sankhyalabs/ezui/dist/types/components/ez-grid/controller/EzGridController";
35
35
  import { IExporterStrategyMode, IRecordID } from "./components/snk-data-exporter/interfaces/IRecordID";
36
+ import { CustomGuideItem } from "./components/snk-crud/subcomponents/snk-guides-viewer";
36
37
  import { PayloadSaveConfig, ResponseGetConfig } from "./components/snk-numbering-config/services/ServicesNumberingConfig";
37
38
  import { ICustomEditor, ICustomRender } from "@sankhyalabs/ezui/dist/types/utils";
38
39
  import { IExporterProvider } from "./components/snk-data-exporter/interfaces/IExporterProvider";
@@ -65,6 +66,7 @@ import { FormMetadata } from "@sankhyalabs/ezui/dist/collection/utils/form";
65
66
  import { ICustomEditor as ICustomEditor1 } from "@sankhyalabs/ezui/dist/types/utils/customEditor/interfaces/ICustomEditor";
66
67
  import { IMultiSelectionListDataSource } from "@sankhyalabs/ezui/dist/types/components/ez-multi-selection-list/interfaces/IMultiSelectionListDataSource";
67
68
  import { PresentationMode as PresentationMode1 } from "./lib/@types";
69
+ import { CustomGuideItem as CustomGuideItem1 } from "./components/snk-crud/subcomponents/snk-guides-viewer";
68
70
  import { PrintSelectorResponse } from "./components/snk-print-selector/snk-print-selector";
69
71
  import { PendingPrintJobData } from "./lib/utils/PrintUtils";
70
72
  import { IBreadcrumbItem } from "@sankhyalabs/ezui/dist/types/components/ez-breadcrumb/ez-breadcrumb";
@@ -303,6 +305,14 @@ export namespace Components {
303
305
  * @async
304
306
  */
305
307
  "executePreparedSearchPlus": (mode: string, argument: string, options: any) => Promise<Array<IOption1> | IOption1>;
308
+ /**
309
+ * Obtém as opções em componentes de pesquisa além dos metadados como showMore e entityPk.
310
+ * @param argument - O argumento da pesquisa.
311
+ * @param options - Opções preparadas para a pesquisa.
312
+ * @returns Uma lista de opções ou uma única opção.
313
+ * @async
314
+ */
315
+ "executePreparedSearchWithFullResponse": (argument: string, options: any) => Promise<any>;
306
316
  /**
307
317
  * Obtém as opções em componentes de pesquisa. Ex.: snk-config-options
308
318
  * @param searchArgument - Argumentos da pesquisa.
@@ -771,6 +781,10 @@ export namespace Components {
771
781
  * Usado para salvar as configurações dos blocos de construção.
772
782
  */
773
783
  "configName": string;
784
+ /**
785
+ * Fornece as informações das guias personalizadas.
786
+ */
787
+ "customGuidesConfig"?: Array<CustomGuideItem>;
774
788
  /**
775
789
  * Define se a configuração de numeração será desabilitada.
776
790
  */
@@ -883,6 +897,10 @@ export namespace Components {
883
897
  * Usado para exibir os botões de ação do snk-configurator
884
898
  */
885
899
  "showActionButtons": boolean;
900
+ /**
901
+ * Define se o campo de busca de entidades será exibido na barra superior.
902
+ */
903
+ "showEntitySearch"?: boolean;
886
904
  /**
887
905
  * Configuração do valor da coluna de status. Exemplo: { "RECDESP": { "-1" : "#BD0025", "1" : "#157A00" } }
888
906
  */
@@ -910,6 +928,12 @@ export namespace Components {
910
928
  */
911
929
  "slotName": string;
912
930
  }
931
+ interface SnkCustomSlotGuide {
932
+ /**
933
+ * Nome do slot onde os elementos customizados deverão aparecer.
934
+ */
935
+ "slotName": string;
936
+ }
913
937
  interface SnkDataExporter {
914
938
  /**
915
939
  * Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
@@ -1759,6 +1783,10 @@ export namespace Components {
1759
1783
  * Campos de configuração de formulário.
1760
1784
  */
1761
1785
  "configManager": SnkFormConfigManager;
1786
+ /**
1787
+ * Informações das guias personalizadas.
1788
+ */
1789
+ "customGuidesConfig"?: Array<CustomGuideItem>;
1762
1790
  /**
1763
1791
  * Repositório de dados, controla a manipulação dos dados.
1764
1792
  */
@@ -1966,6 +1994,10 @@ export namespace Components {
1966
1994
  * Define o nome do slot para elementos customizados na `Taskbar` do cabeçalho da grade.
1967
1995
  */
1968
1996
  "gridHeaderCustomSlotId": string;
1997
+ /**
1998
+ * Define o nome do slot para a aba de pesquisa no cabeçalho da grade.
1999
+ */
2000
+ "gridHeaderDynamicSearchSlotId": string;
1969
2001
  /**
1970
2002
  * Chave da configuração legada da grade.
1971
2003
  */
@@ -2145,6 +2177,10 @@ export namespace Components {
2145
2177
  * Nome usado para guardar/recuperar as configurações do formulário.
2146
2178
  */
2147
2179
  "configName": string;
2180
+ /**
2181
+ * Fornece as informações das guias personalizadas.
2182
+ */
2183
+ "customGuidesConfig"?: Array<CustomGuideItem>;
2148
2184
  /**
2149
2185
  * Representa o estado do dataUnit master.
2150
2186
  */
@@ -2330,6 +2366,12 @@ export namespace Components {
2330
2366
  * @example entityName="Produto"
2331
2367
  */
2332
2368
  "entityName": string;
2369
+ /**
2370
+ * * Executa uma pesquisa programaticamente. Útil para cenários onde a pesquisa precisa ser disparada sem interação do usuário.
2371
+ * @param text Texto utilizado como argumento de pesquisa.
2372
+ * @example await pesquisaRef.executeSearch("Texto para pesquisa");
2373
+ */
2374
+ "executeSearch": (text: string) => Promise<void>;
2333
2375
  /**
2334
2376
  * Define se a popup de pesquisa terá ou não modo hierárquico.
2335
2377
  * @type {boolean}
@@ -2610,6 +2652,10 @@ export namespace Components {
2610
2652
  * @description Lista de ações que devem ser usadas no botão "Mais opções" do componente snk-taskbar.
2611
2653
  */
2612
2654
  "actionsSettingsList": Array<Action>;
2655
+ /**
2656
+ * @description Define o identificador do slot adicional.
2657
+ */
2658
+ "additionalSlotId": string;
2613
2659
  /**
2614
2660
  * @description Define o alinhamento dos itens da barra de tarefas à direita.
2615
2661
  */
@@ -2790,6 +2836,10 @@ export interface SnkCustomSlotElementsCustomEvent<T> extends CustomEvent<T> {
2790
2836
  detail: T;
2791
2837
  target: HTMLSnkCustomSlotElementsElement;
2792
2838
  }
2839
+ export interface SnkCustomSlotGuideCustomEvent<T> extends CustomEvent<T> {
2840
+ detail: T;
2841
+ target: HTMLSnkCustomSlotGuideElement;
2842
+ }
2793
2843
  export interface SnkDataUnitCustomEvent<T> extends CustomEvent<T> {
2794
2844
  detail: T;
2795
2845
  target: HTMLSnkDataUnitElement;
@@ -3033,6 +3083,12 @@ declare global {
3033
3083
  prototype: HTMLSnkCustomSlotElementsElement;
3034
3084
  new (): HTMLSnkCustomSlotElementsElement;
3035
3085
  };
3086
+ interface HTMLSnkCustomSlotGuideElement extends Components.SnkCustomSlotGuide, HTMLStencilElement {
3087
+ }
3088
+ var HTMLSnkCustomSlotGuideElement: {
3089
+ prototype: HTMLSnkCustomSlotGuideElement;
3090
+ new (): HTMLSnkCustomSlotGuideElement;
3091
+ };
3036
3092
  interface HTMLSnkDataExporterElement extends Components.SnkDataExporter, HTMLStencilElement {
3037
3093
  }
3038
3094
  var HTMLSnkDataExporterElement: {
@@ -3333,6 +3389,7 @@ declare global {
3333
3389
  "snk-configurator": HTMLSnkConfiguratorElement;
3334
3390
  "snk-crud": HTMLSnkCrudElement;
3335
3391
  "snk-custom-slot-elements": HTMLSnkCustomSlotElementsElement;
3392
+ "snk-custom-slot-guide": HTMLSnkCustomSlotGuideElement;
3336
3393
  "snk-data-exporter": HTMLSnkDataExporterElement;
3337
3394
  "snk-data-unit": HTMLSnkDataUnitElement;
3338
3395
  "snk-default-filter": HTMLSnkDefaultFilterElement;
@@ -3664,6 +3721,10 @@ declare namespace LocalJSX {
3664
3721
  * Usado para salvar as configurações dos blocos de construção.
3665
3722
  */
3666
3723
  "configName"?: string;
3724
+ /**
3725
+ * Fornece as informações das guias personalizadas.
3726
+ */
3727
+ "customGuidesConfig"?: Array<CustomGuideItem>;
3667
3728
  /**
3668
3729
  * Define se a configuração de numeração será desabilitada.
3669
3730
  */
@@ -3744,6 +3805,10 @@ declare namespace LocalJSX {
3744
3805
  * Emitido quando a configuração de numeração é alterada.
3745
3806
  */
3746
3807
  "onNumberingConfigChanged"?: (event: SnkCrudCustomEvent<ResponseGetConfig>) => void;
3808
+ /**
3809
+ * Emitido pelo guides-viewer sempre que houver mudança de guia.
3810
+ */
3811
+ "onSnkShowGuide"?: (event: SnkCrudCustomEvent<string>) => void;
3747
3812
  "onViewModeChanged"?: (event: SnkCrudCustomEvent<VIEW_MODE>) => void;
3748
3813
  /**
3749
3814
  * Define se a grid será focada ao ser carregada.
@@ -3769,6 +3834,10 @@ declare namespace LocalJSX {
3769
3834
  * Usado para exibir os botões de ação do snk-configurator
3770
3835
  */
3771
3836
  "showActionButtons"?: boolean;
3837
+ /**
3838
+ * Define se o campo de busca de entidades será exibido na barra superior.
3839
+ */
3840
+ "showEntitySearch"?: boolean;
3772
3841
  /**
3773
3842
  * Configuração do valor da coluna de status. Exemplo: { "RECDESP": { "-1" : "#BD0025", "1" : "#157A00" } }
3774
3843
  */
@@ -3796,6 +3865,16 @@ declare namespace LocalJSX {
3796
3865
  */
3797
3866
  "slotName"?: string;
3798
3867
  }
3868
+ interface SnkCustomSlotGuide {
3869
+ /**
3870
+ * Emitido quando elemento é carregado na tela.
3871
+ */
3872
+ "onSnkCustomSlotGuideLoaded"?: (event: SnkCustomSlotGuideCustomEvent<string>) => void;
3873
+ /**
3874
+ * Nome do slot onde os elementos customizados deverão aparecer.
3875
+ */
3876
+ "slotName"?: string;
3877
+ }
3799
3878
  interface SnkDataExporter {
3800
3879
  /**
3801
3880
  * Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
@@ -4564,6 +4643,10 @@ declare namespace LocalJSX {
4564
4643
  * Campos de configuração de formulário.
4565
4644
  */
4566
4645
  "configManager"?: SnkFormConfigManager;
4646
+ /**
4647
+ * Informações das guias personalizadas.
4648
+ */
4649
+ "customGuidesConfig"?: Array<CustomGuideItem>;
4567
4650
  /**
4568
4651
  * Repositório de dados, controla a manipulação dos dados.
4569
4652
  */
@@ -4742,6 +4825,10 @@ declare namespace LocalJSX {
4742
4825
  * Define o nome do slot para elementos customizados na `Taskbar` do cabeçalho da grade.
4743
4826
  */
4744
4827
  "gridHeaderCustomSlotId"?: string;
4828
+ /**
4829
+ * Define o nome do slot para a aba de pesquisa no cabeçalho da grade.
4830
+ */
4831
+ "gridHeaderDynamicSearchSlotId"?: string;
4745
4832
  /**
4746
4833
  * Chave da configuração legada da grade.
4747
4834
  */
@@ -4887,6 +4974,10 @@ declare namespace LocalJSX {
4887
4974
  * Nome usado para guardar/recuperar as configurações do formulário.
4888
4975
  */
4889
4976
  "configName"?: string;
4977
+ /**
4978
+ * Fornece as informações das guias personalizadas.
4979
+ */
4980
+ "customGuidesConfig"?: Array<CustomGuideItem>;
4890
4981
  /**
4891
4982
  * Representa o estado do dataUnit master.
4892
4983
  */
@@ -4935,6 +5026,10 @@ declare namespace LocalJSX {
4935
5026
  * Emitido quando o botão de voltar é acionado.
4936
5027
  */
4937
5028
  "onExit"?: (event: SnkGuidesViewerCustomEvent<void>) => void;
5029
+ /**
5030
+ * Emitido quando a visibilidade do configurador do formulário é alterada.
5031
+ */
5032
+ "onFormConfigVisibilityChanged"?: (event: SnkGuidesViewerCustomEvent<boolean>) => void;
4938
5033
  /**
4939
5034
  * Responsável por notificar quando ocorrer a renderização de itens do formulário.
4940
5035
  */
@@ -4943,6 +5038,10 @@ declare namespace LocalJSX {
4943
5038
  * Emitido quando a configuração do formulário master é definida.
4944
5039
  */
4945
5040
  "onSnkMasterFormConfigChange"?: (event: SnkGuidesViewerCustomEvent<IFormConfig>) => void;
5041
+ /**
5042
+ * Emitido quando a uma gua é exibida no formulário.
5043
+ */
5044
+ "onSnkShowGuide"?: (event: SnkGuidesViewerCustomEvent<string>) => void;
4946
5045
  /**
4947
5046
  * Altera o modo de apresentação dos botões do snk-taskbar.
4948
5047
  */
@@ -5314,6 +5413,10 @@ declare namespace LocalJSX {
5314
5413
  * @description Lista de ações que devem ser usadas no botão "Mais opções" do componente snk-taskbar.
5315
5414
  */
5316
5415
  "actionsSettingsList"?: Array<Action>;
5416
+ /**
5417
+ * @description Define o identificador do slot adicional.
5418
+ */
5419
+ "additionalSlotId"?: string;
5317
5420
  /**
5318
5421
  * @description Define o alinhamento dos itens da barra de tarefas à direita.
5319
5422
  */
@@ -5470,6 +5573,7 @@ declare namespace LocalJSX {
5470
5573
  "snk-configurator": SnkConfigurator;
5471
5574
  "snk-crud": SnkCrud;
5472
5575
  "snk-custom-slot-elements": SnkCustomSlotElements;
5576
+ "snk-custom-slot-guide": SnkCustomSlotGuide;
5473
5577
  "snk-data-exporter": SnkDataExporter;
5474
5578
  "snk-data-unit": SnkDataUnit;
5475
5579
  "snk-default-filter": SnkDefaultFilter;
@@ -5540,6 +5644,7 @@ declare module "@stencil/core" {
5540
5644
  "snk-configurator": LocalJSX.SnkConfigurator & JSXBase.HTMLAttributes<HTMLSnkConfiguratorElement>;
5541
5645
  "snk-crud": LocalJSX.SnkCrud & JSXBase.HTMLAttributes<HTMLSnkCrudElement>;
5542
5646
  "snk-custom-slot-elements": LocalJSX.SnkCustomSlotElements & JSXBase.HTMLAttributes<HTMLSnkCustomSlotElementsElement>;
5647
+ "snk-custom-slot-guide": LocalJSX.SnkCustomSlotGuide & JSXBase.HTMLAttributes<HTMLSnkCustomSlotGuideElement>;
5543
5648
  "snk-data-exporter": LocalJSX.SnkDataExporter & JSXBase.HTMLAttributes<HTMLSnkDataExporterElement>;
5544
5649
  "snk-data-unit": LocalJSX.SnkDataUnit & JSXBase.HTMLAttributes<HTMLSnkDataUnitElement>;
5545
5650
  "snk-default-filter": LocalJSX.SnkDefaultFilter & JSXBase.HTMLAttributes<HTMLSnkDefaultFilterElement>;
@@ -45,6 +45,7 @@ export interface SearchOptions {
45
45
  showInactives?: boolean;
46
46
  dataUnitId?: string;
47
47
  ignoreEntityCriteria?: boolean;
48
+ limit?: number;
48
49
  }
49
50
  type DataUnitID = string;
50
51
  export type IRemoveSearchListener = () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/sankhyablocks",
3
- "version": "10.1.0-dev.1",
3
+ "version": "10.1.0-dev.11",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -17,6 +17,7 @@ export declare const SnkClientConfirm: import("react").ForwardRefExoticComponent
17
17
  export declare const SnkConfigurator: import("react").ForwardRefExoticComponent<JSX.SnkConfigurator & Omit<import("react").HTMLAttributes<HTMLSnkConfiguratorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkConfiguratorElement>>;
18
18
  export declare const SnkCrud: import("react").ForwardRefExoticComponent<JSX.SnkCrud & Omit<import("react").HTMLAttributes<HTMLSnkCrudElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkCrudElement>>;
19
19
  export declare const SnkCustomSlotElements: import("react").ForwardRefExoticComponent<JSX.SnkCustomSlotElements & Omit<import("react").HTMLAttributes<HTMLSnkCustomSlotElementsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkCustomSlotElementsElement>>;
20
+ export declare const SnkCustomSlotGuide: import("react").ForwardRefExoticComponent<JSX.SnkCustomSlotGuide & Omit<import("react").HTMLAttributes<HTMLSnkCustomSlotGuideElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkCustomSlotGuideElement>>;
20
21
  export declare const SnkDataExporter: import("react").ForwardRefExoticComponent<JSX.SnkDataExporter & Omit<import("react").HTMLAttributes<HTMLSnkDataExporterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkDataExporterElement>>;
21
22
  export declare const SnkDataUnit: import("react").ForwardRefExoticComponent<JSX.SnkDataUnit & Omit<import("react").HTMLAttributes<HTMLSnkDataUnitElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkDataUnitElement>>;
22
23
  export declare const SnkDefaultFilter: import("react").ForwardRefExoticComponent<JSX.SnkDefaultFilter & Omit<import("react").HTMLAttributes<HTMLSnkDefaultFilterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLSnkDefaultFilterElement>>;
@@ -19,6 +19,7 @@ export const SnkClientConfirm = /*@__PURE__*/ createReactComponent('snk-client-c
19
19
  export const SnkConfigurator = /*@__PURE__*/ createReactComponent('snk-configurator');
20
20
  export const SnkCrud = /*@__PURE__*/ createReactComponent('snk-crud');
21
21
  export const SnkCustomSlotElements = /*@__PURE__*/ createReactComponent('snk-custom-slot-elements');
22
+ export const SnkCustomSlotGuide = /*@__PURE__*/ createReactComponent('snk-custom-slot-guide');
22
23
  export const SnkDataExporter = /*@__PURE__*/ createReactComponent('snk-data-exporter');
23
24
  export const SnkDataUnit = /*@__PURE__*/ createReactComponent('snk-data-unit');
24
25
  export const SnkDefaultFilter = /*@__PURE__*/ createReactComponent('snk-default-filter');
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB,kCAAkC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAM7D,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC;AAC9H,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA,oBAAoB,CAA0C,cAAc,CAAC,CAAC;AACtH,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAA,oBAAoB,CAAsC,YAAY,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,eAAe,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G,aAAa,CAAA,oBAAoB,CAA0C,cAAc,CAAC,CAAC;AACtH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAA,oBAAoB,CAAoD,oBAAoB,CAAC,CAAC;AAC3I,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,gBAAgB,CAAC,CAAC;AAC3H,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,gBAAgB,CAAC,CAAC;AAC3H,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA,oBAAoB,CAA8C,iBAAiB,CAAC,CAAC;AAC/H,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAA,oBAAoB,CAA0D,wBAAwB,CAAC,CAAC;AACxJ,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAA,oBAAoB,CAAwC,aAAa,CAAC,CAAC;AAClH,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAA,oBAAoB,CAA8D,yBAAyB,CAAC,CAAC;AAC/J,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAA,oBAAoB,CAA4D,wBAAwB,CAAC,CAAC;AAC3J,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAA,oBAAoB,CAAwD,sBAAsB,CAAC,CAAC;AACnJ,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- import{C as t}from"./p-1788d191.js";import{ObjectUtils as i,StringUtils as e}from"@sankhyalabs/core";import{F as s}from"./p-7fc46290.js";import{a as r}from"./p-9019a32f.js";class n{constructor(t,i,e,s){this._resourceID=i,this._configName=t,this._onConfigChange=e,this._dataUnit=s}addFormLegacyConfig(i){this._configName&&t.addFormLegacyConfig(this._configName,i)}async loadConfig(){return new Promise((i=>{t.loadFormConfig(this._configName,this._resourceID).then((t=>{t=this.buildFormMetadataUITabs(t),this.setConfig(t),i(t)})).catch((t=>{console.warn(t)}))}))}getEmptyConfig(){return this.buildFormMetadataUITabs({fields:[],emptyConfig:!0},!0)}saveConfig(e){const s=i.copy(e);return new Promise((i=>{t.saveFormConfig(e,this._configName,this._resourceID).then((t=>{this.setConfig(Object.assign(Object.assign({},s),t)),i(Object.assign(Object.assign({},s),t))}))}))}saveCardState(i,e,s){return new Promise((r=>{var n;const l=(null===(n=this._config)||void 0===n?void 0:n.cardsState)||new Map,o=l.get(i);l.set(i,"fixed"===s?this.updateFixSequence(Object.assign(Object.assign({},o),{fixed:e.fixed}),l):Object.assign(Object.assign({},o),{[s]:e[s]})),t.saveCardState(l,this._configName,this._resourceID).then((t=>{this._config=Object.assign(Object.assign({},this._config),{cardsState:l}),r(t)}))}))}updateFixSequence(t,i){let e=-1;return Array.from(i.values()).forEach((i=>{i.fixed||delete t.fixSequence,null!=i.fixSequence&&(e=Math.max(e,i.fixSequence))})),t.fixed?t.fixSequence=e+1:delete t.fixSequence,t}hasConfig(t){var i;const e=null!=t?t:this._config;return!(!e||!(null===(i=e.fields)||void 0===i?void 0:i.length))}getFieldsList(t,i=!1){var e;const s=null===(e=this._config)||void 0===e?void 0:e.fields;return this.hasConfig()&&!i?s.map((({label:t,name:i,readOnly:e,visible:s,required:r,tab:n,group:l})=>{var o;if(null==t){const t=null===(o=this._dataUnit)||void 0===o?void 0:o.getField(i);if(!t)return;return Object.assign(Object.assign({},t),{name:null!=i?i:t.name,readOnly:null!=e?e:t.readOnly,visible:null!=s?s:t.visible,required:null!=r?r:t.required,tab:n,group:l})}return{name:i,label:t,readOnly:e,visible:s,required:r,tab:n,group:l}})).filter((i=>this.isFieldVisible(i,t))):this._dataUnit?this._dataUnit.metadata.fields.filter((i=>this.isFieldVisible(i,t))).map((({label:t,name:i,readOnly:e,visible:s,required:r,properties:n})=>({label:t,name:i,readOnly:e,visible:s,required:r,tab:null==n?void 0:n.UITabName}))):[]}isFieldVisible(t,i){if(void 0===t||!1===t.visible)return!1;if(null==i)return!0;const s=e.replaceAccentuatedCharsLower((t.label||t.name).toLocaleLowerCase()),r=e.replaceAccentuatedCharsLower(i.toLocaleLowerCase());return s.includes(r)}getFormConfig(t,i,e=!1){let s=this.getFieldsList(void 0,e);return i&&(s=s.filter((i=>{if(t){const e=t.getField(i.name);if(e&&e.readOnly)return!1}return!i.readOnly}))),Object.assign(Object.assign({},this._config),{fields:s})}setConfig(t){this.isLoaded=!0;const{cardsState:i,summary:e,defaultVars:s}=this._config||{};this._config=Object.assign({},t),i&&(this._config.cardsState=i),e&&(this._config.summary=e),s&&(this._config.defaultVars=s),this._onConfigChange&&this._onConfigChange(Object.assign({},this._config))}getConfig(t,i){return this.getFormConfig(t,i)}getFormConfigFetcher(){return null==this._formConfigFetcher&&(this._formConfigFetcher=new s),this._formConfigFetcher}async fetchUserAvailableConfigs(){return null!=this._configName?Promise.resolve(void 0):this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,this._resourceID)}async fetchLegacyConfig(){return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,this._resourceID)}async fetchDefaultConfig(){return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,this._resourceID)}parseObjectList(t){return t?Array.isArray(t)?t:[t]:[]}buildFormMetadataUITabs(t,i=!1){var e;const s=this.hasConfig(t);if(!i&&(!this._dataUnit||s))return t;(t=this.getFormConfig(this._dataUnit,!1,!0)).tabs=this.parseObjectList(t.tabs),t.emptyConfig=!1,t.defaultConfiguration=!0;const n=this._dataUnit.metadata.fields;for(const i of n){const s=t.fields.find((t=>t.name===i.name)),n=null===(e=i.properties)||void 0===e?void 0:e.UITabName;n&&n!==r.main&&(t.tabs.some((t=>t.label===n))||t.tabs.push({label:n,name:n,order:0,visible:!0}),s&&(s.tab=n))}return t}}export{n as S}
@@ -1 +0,0 @@
1
- import{r as i,c as t,h as s,g as e,H as h}from"./p-d8d8169b.js";import{ElementIDUtils as a,ObjectUtils as o,ApplicationContext as n}from"@sankhyalabs/core";import{S as d}from"./p-0cf9aa38.js";import{R as l}from"./p-688dcb4c.js";import{buildFormConfigFromDataUnit as r}from"@sankhyalabs/ezui/dist/collection/utils/form";import{b as c,a as f,g,u as m,c as u}from"./p-8f73da95.js";import{a as v,G as p}from"./p-9019a32f.js";import{ApplicationUtils as C}from"@sankhyalabs/ezui/dist/collection/utils";import{U as b}from"./p-7fc46290.js";import"./p-1788d191.js";import"./p-6d241415.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";const y=class{constructor(s){i(this,s),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this._dataUnit=void 0,this._dataState=void 0,this._showFormConfig=!1,this._configManager=void 0,this.configName=void 0,this.recordsValidator=void 0,this.messagesBuilder=void 0,this.formLegacyConfigName=void 0,this.resourceID=void 0}async showConfig(){this._showFormConfig=!0}async hideConfig(){this._showFormConfig=!1}async addCustomEditor(i,t){if(this._form)return void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async setFieldProp(i,t,s){await this._form.setFieldProp(i,t,s)}async validate(){await this._form.validate()}closeConfig(){this.hideConfig()}dataunitReady(){a.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}setCustomEditors(){if(this._form)for(const[i,t]of this._customEditors)this._form.addCustomEditor(i,t),this._customEditors.delete(i)}async componentDidRender(){this.setCustomEditors()}async componentWillLoad(){let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.dataunitReady():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}i=i.parentElement}null==this.resourceID&&(this.resourceID=await l.getResourceID()),this._configManager=new d(this.configName,this.resourceID,void 0,this._dataUnit),this.addFormLegacyConfig(),await this._configManager.loadConfig()}async handleDataStateChange(i){var t;this._dataState=i.detail;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const i of s||[]){if(!i)continue;const s=null===(t=this._dataState.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",i);(s||0===s)&&(await this.setFieldProp(i,"precision",s),await this.setFieldProp(i,"prettyPrecision",s))}}addFormLegacyConfig(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}render(){if(this._dataUnit&&this._dataState)return s("section",null,s("div",{class:"ez-row"},s("div",{class:"ez-col ez-col--sd-12"},s("ez-form",{ref:i=>this._form=i,key:"ezForm"+this._snkDataUnit.entityName,"data-element-id":"embedded",dataUnit:this._dataUnit,config:this._configManager.getConfig(this._dataUnit),recordsValidator:this.recordsValidator,class:this._showFormConfig?"snk-form__form--hidden":""}),this._showFormConfig&&s("snk-form-config",{messagesBuilder:this.messagesBuilder,dataUnit:this._dataUnit,configManager:this._configManager,onConfigClose:()=>this.closeConfig()}))))}get _element(){return e(this)}};y.style=".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";const k=class{constructor(s){i(this,s),this.configClose=t(this,"configClose",7),this.configChange=t(this,"configChange",7),this.guidesMap=new Map,this.availableFields=[],this.guidesList=[],this.groupsList=[],this.selectedGuide=void 0,this._formConfig={},this.configOptions=[],this.originalConfigSelected=void 0,this.configSelected=void 0,this.hasChanges=!1,this.optionConfigChanged=!1,this.dataUnit=void 0,this.configManager=void 0,this.ignoreReadOnlyFormFields=void 0,this.messagesBuilder=void 0}handleFieldConfigChanged(){this.hasChanges=!0}async handleFormConfigOptionSelected({detail:i}){this.configSelected=i,await this.loadConfigByUser(),this.selectedGuide=void 0,this.optionConfigChanged=!o.equals(this.configSelected,this.originalConfigSelected),this.configSelected.origin===b.DEFAULT&&(this.hasChanges=!1)}async handleAddFieldToGuide({detail:i}){var t;this.selectedGuide?(this.availableFields=[...this.availableFields.filter((t=>t.name!==i.name))],await(null===(t=this.refFieldsLayout)||void 0===t?void 0:t.addFieldToLayout(i))):this.showNoGuideSelectedDialog()}async handleSetFieldAsAvailable({detail:i}){this.availableFields.some((t=>t.name===i.name))||(this.availableFields=[...this.availableFields,i])}async handleRemoveFieldFromAvailable({detail:i}){this.availableFields=this.availableFields.filter((t=>t.name!==i.name))}observeSelectedGuide(i){var t;const s=null!==(t=this.guidesMap.get(null==i?void 0:i.name))&&void 0!==t?t:[];this.groupsList=[...s]}observeConfigManager(){this.loadFormConfig()}showNoGuideSelectedDialog(){const i=this.getMessage("snkFormConfig.noGuideSelected.title"),t=this.getMessage("snkFormConfig.noGuideSelected.message");C.alert(i,t)}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}async initializeUserConfig(){if(null!=this.configManager)try{const i=await this.configManager.fetchUserAvailableConfigs();this.configOptions=i;const t=null==this._formConfig||this._formConfig.defaultConfiguration?b.DEFAULT:b.USER;this.configSelected=i.find((i=>i.origin===t)),this.originalConfigSelected=i.find((i=>i.origin===t))}catch(i){console.error(this.getMessage("snkFormConfig.errors.failFetchUserConfig")),console.error(i)}}async loadConfigByUser(){this.configManager&&this.configSelected&&(this.isConfigDefaultSelected()?await this.handleLoadDefaultConfig():this.loadFormConfig())}async handleLoadDefaultConfig(){const i=await this.configManager.fetchDefaultConfig();if(i)return void this.loadFormConfig(i);const t=this.configManager.getEmptyConfig();t&&this.loadFormConfig(t)}isConfigDefaultSelected(){return this.configSelected.origin===b.DEFAULT}loadFormConfig(i){this._formConfig=i||this.getConfig(),this.loadGuides(),this.initializeAvailableFields()}initializeAvailableFields(){var i;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;const t=[...this._formConfig.fields];this.availableFields=this.dataUnit.metadata.fields.filter((({name:i,visible:s,properties:e})=>{const h=t.some((({name:t})=>t===i));return h||!0!==e.visibleOnConfig||s?!0===s&&!1===h:e.visibleOnConfig}))}loadGuides(){var i;this.guidesList=[...c(this._formConfig,this.getMessage("snkFormConfig.form.mainArea"))],this.guidesMap=f(null===(i=this._formConfig)||void 0===i?void 0:i.fields,this.guidesList,this.dataUnit,this.getMessage("snkFormConfig.form.tabGeneral"))}getConfig(){let i=this.configManager.getConfig(this.dataUnit,!1);return i.fields&&0===i.fields.length&&(i=void 0),null==i&&(i=r(this.dataUnit)),o.copy(i)}handleSelectGuide({detail:i}){this.selectedGuide=i}handleLayoutChanged({detail:i}){this.hasChanges=!0,this.groupsList=[...i],this.guidesMap.set(this.selectedGuide.name,[...i])}getIsDefaultConfig(){var i;return(null===(i=this.configSelected)||void 0===i?void 0:i.origin)===b.DEFAULT&&!0===this.optionConfigChanged&&!1===this.hasChanges}getTabsToSave(){return this.guidesList.map((i=>({name:i.name,label:i.name===v.main?i.name:i.label,order:i.name===v.main?0:i.order,visible:i.visible})))}async handleSaveConfig(){var i;const t=await this.configManager.saveConfig(this.buildConfigToSave());this.configSelected=null===(i=this.configOptions)||void 0===i?void 0:i.find((i=>i.origin===(this.hasChanges?b.USER:b.DEFAULT))),this.originalConfigSelected=this.configSelected,this.hasChanges=!1,this.optionConfigChanged=!1,C.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"),{iconName:"check"}),this.configChange.emit(t)}buildConfigToSave(){if(this.getIsDefaultConfig()){const i=this._formConfig;return i.defaultConfiguration=!0,i}const i=o.copy(this._formConfig);return i.tabs=this.getTabsToSave(),i.fields=g(this.guidesMap),i.defaultConfiguration=!1,i}handleAvailableFieldListChanged({detail:i}){this.availableFields=[...i]}handleSetFieldListAsAvailable({detail:i}){this.availableFields=[...this.availableFields,...i]}handleGuideDeleted({detail:i}){var t,s;const e=i.name,h=null!==(t=this.guidesMap.get(e))&&void 0!==t?t:[],a=[];h.forEach((i=>a.push(...i.fields))),this.availableFields=[...this.availableFields,...a],this.guidesList=[...this.guidesList.filter((i=>i.name!==e))],this.guidesMap.delete(e),(null===(s=this.selectedGuide)||void 0===s?void 0:s.name)===e&&(this.selectedGuide=void 0),this.hasChanges=!0}handleGuideListChanged({detail:i}){this.hasChanges=!0,this.guidesList=[...i]}handleGuideRenamed({detail:i}){var t;const s=null!==(t=this.guidesMap.get(this.selectedGuide.name))&&void 0!==t?t:[],e=m(s,i);this.guidesMap.delete(this.selectedGuide.name),this.guidesMap.set(i,e);const h={name:i,label:i,visible:this.selectedGuide.visible,order:this.selectedGuide.order};this.guidesList=[...this.guidesList.map((i=>i.name===this.selectedGuide.name?h:i))],this.groupsList=[...e],this.selectedGuide=h,this.hasChanges=!0}handleCreateNewGuide(){const i=u(this.guidesList,this.getMessage.bind(this)),t={name:i,label:i,visible:!0,order:this.guidesList.length+1},s={name:p.noGroup,fields:[]};this.guidesList=[...this.guidesList,t],this.guidesMap.set(i,[s]),this.selectedGuide=t,this.hasChanges=!0}getGuideNames(){return[...this.guidesList.map((i=>i.name.toLowerCase())),this.getMessage("snkFormConfig.form.mainArea").toLowerCase()]}async componentWillRender(){if(null==this.messagesBuilder){const i=n.getContextValue("__SNK__APPLICATION__");this.messagesBuilder=i.messagesBuilder}}async componentWillLoad(){this.loadFormConfig(),await this.initializeUserConfig()}render(){return s(h,null,s("config-header",{configOptions:this.configOptions,selectedConfig:this.configSelected,messagesBuilder:this.messagesBuilder,hasChanges:this.hasChanges,optionConfigChanged:this.optionConfigChanged,onConfigClose:()=>this.configClose.emit(),onSaveConfig:async()=>await this.handleSaveConfig()}),s("div",{class:"ez-padding--medium"},s("div",{class:"ez-flex sidebarNavigator__container"},s("guides-configurator",{messagesBuilder:this.messagesBuilder,guidesList:this.guidesList,selectedGuide:this.selectedGuide,onGuideSelected:this.handleSelectGuide.bind(this),onGuideListChanged:this.handleGuideListChanged.bind(this),onCreateNewGuide:this.handleCreateNewGuide.bind(this),onGuideDeleted:this.handleGuideDeleted.bind(this)}),s("fields-layout",{ref:i=>this.refFieldsLayout=i,selectedGuide:this.selectedGuide,guideNames:this.getGuideNames(),groupsList:this.groupsList,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,onGuideRenamed:this.handleGuideRenamed.bind(this),onLayoutChanged:this.handleLayoutChanged.bind(this),onSetFieldListAsAvailable:this.handleSetFieldListAsAvailable.bind(this)}),s("fields-selector",{dataUnit:this.dataUnit,availableFields:this.availableFields,onFieldListChanged:this.handleAvailableFieldListChanged.bind(this),messagesBuilder:this.messagesBuilder}))))}static get watchers(){return{selectedGuide:["observeSelectedGuide"],configManager:["observeConfigManager"]}}};k.style='.sc-snk-form-config-h{display:flex;flex-direction:column;height:100vh;width:100vw;font-family:var(--font-pattern, "Roboto");background:white;color:#2b3a54;--snk-form-config-container-height:calc(100vh - 95px);outline:none}.sidebarNavigator__container.sc-snk-form-config{height:var(--snk-form-config-container-height);gap:20px;align-items:flex-start}.guide-header.sc-snk-form-config{display:flex;width:100%;padding-bottom:12px;border-bottom:1px solid #dce0e8;height:30px;font-weight:500;font-size:16px}';export{y as snk_form,k as snk_form_config}
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as s,H as e}from"./p-d8d8169b.js";import{ApplicationContext as o,ElementIDUtils as r}from"@sankhyalabs/core";import{DataBinder as h}from"@sankhyalabs/ezui/dist/collection/utils/form";import{focusOnFieldSerch as a,SEARCH_FIELD_FULL_WIDTH as n,FormLayout as l}from"@sankhyalabs/ezui/dist/collection/utils";const d=class{constructor(s){t(this,s),this.snkContentCardChanged=i(this,"snkContentCardChanged",7),this.snkRequestClearFieldToFocus=i(this,"snkRequestClearFieldToFocus",7),this.formItemsReady=i(this,"formItemsReady",7),this._customEditors=new Map,this._fieldProps=new Map,this._singleColumn=!0,this.levelPath=void 0,this.fieldSearch=void 0,this.label=void 0,this.name=void 0,this.fields=void 0,this.formMetadata=void 0,this.dataUnit=void 0,this.contracted=void 0,this.fixed=!1,this.summaryFields=void 0,this.canExpand=!0,this.canFix=!0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.customEditors=void 0,this.fieldsProps=void 0}async showUp(){this._formView&&this._formView.showUp()}async addCustomEditor(t,i,s){if(this._formView)return void this._formView.addCustomEditor(t,i,s);const e=new Map(this._customEditors);e.set(t,{customEditor:i,detailContext:s}),this._customEditors=e}async setFieldProp(t,i,s){const e=this._fieldProps.get(t)||[];this._fieldProps.set(t,[...e,{propName:i,value:s}])}async showSearchField(){if(!this._headerContainer||!this._ezPopoverFieldColumn)return;const t=this._headerContainer.getBoundingClientRect();await a(this.fieldSearch),this._ezPopoverFieldColumn.showUnder(this._headerContainer,{horizontalGap:t.width-n,verticalGap:-1*t.height})}observePropsCustomEditor(t){for(const i in t)this.addCustomEditor(i,t[i])}async observeFieldsProps(t){for(const i in t){const s=t[i],e=Object.keys(s);for(const t of e)await this.setFieldProp(i,t,s[t])}}changeFix(){this.fixed=!this.fixed,this.emitEvent("fixed")}changeContracted(){this.contracted=!this.contracted,this.emitEvent("presentation")}emitEvent(t){this.snkContentCardChanged.emit({formName:this.name,cardConfig:{fixed:this.fixed,presentation:this.contracted?"CONTRACTED":"EXPANDED"},propertyChanged:t})}getCardSummary(){const t={};return this.getSummaryFields().forEach((({field:i,label:s})=>{var e;const o=this.dataUnit.getFormattedValue(i);""!==o&&(null==s&&(s=null===(e=this.dataUnit.getField(i))||void 0===e?void 0:e.label),t[s]=o)})),t}getSummaryFields(){return null==this.summaryFields?this.fields.map((t=>{const i=this.dataUnit.getField(t.name);return{field:t.name,label:t.label||(null==i?void 0:i.label)}})):this.summaryFields}bindFields(t){null==this._dataBinder&&null!=this.dataUnit&&(this._dataBinder=new h(this.dataUnit)),this._dataBinder&&this._dataBinder.bind(t,this.dataUnit.dataUnitId,this.formMetadata,this.recordsValidator)}handleFormItemsReady(t){t.stopPropagation(),this.formItemsReady.emit(Object.assign(Object.assign({},t.detail),{formId:this.name}))}disconnectedCallback(){null!=this._dataBinder&&this._dataBinder.onDisconnectedCallback()}componentDidLoad(){this.observePropsCustomEditor(this.customEditors),this.observeFieldsProps(this.fieldsProps),this.initLayoutFormConfig()}async initLayoutFormConfig(){const t=o.getContextValue("__SNK__APPLICATION__"),i=await(null==t?void 0:t.getLayoutFormConfig());i&&(this.setSingleColumn(i),this.registerNotifyListeners(i))}setSingleColumn(t){this._singleColumn=!(null==t?void 0:t.config)||t.config===l.CASCADE}registerNotifyListeners(t){t&&t.onConfigChange((t=>{this._singleColumn=t===l.CASCADE}))}componentDidRender(){this.setCustomEditors(),this.setFieldProps(),null!=this.fieldToFocus&&this.fields.some((t=>t.name===this.fieldToFocus))&&requestAnimationFrame((()=>{this._dataBinder.setFocus(this.fieldToFocus),this.snkRequestClearFieldToFocus.emit()}))}setCustomEditors(){if(this._formView)for(const[t,i]of this._customEditors)this._formView.addCustomEditor(t,i.customEditor,i.detailContext),this._customEditors.delete(t)}setFieldProps(){if(this._formView)for(const[t,i]of this._fieldProps)i.forEach((i=>{this._formView.setFieldProp(t,i.propName,i.value),this._fieldProps.delete(t)}))}render(){return s(e,{class:"ez-box__container"},s("div",{class:"summary-header ez-flex ez-size-width--full",ref:t=>this._headerContainer=t},s("div",{class:"ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9"},this.levelPath?s("span",{class:"level-path"},this.levelPath+" /"):void 0,this.label),s("div",{class:"ez-flex ez-flex--justify-end ez-col--sd-3"},this.canFix&&s("ez-button",{class:"ez-padding-left--medium",mode:"icon",size:"small",iconName:this.fixed?"un-pin":"push-pin","data-element-id":r.getInternalIDInfo("toggleFixed_ezFormCard"),onClick:()=>this.changeFix(),title:this.fixed?"Desafixar":"Fixar"}),this.canExpand&&s("ez-button",{class:"ez-padding-left--medium",mode:"icon",size:"small",iconName:this.contracted?"chevron-down":"chevron-up","data-element-id":r.getInternalIDInfo("toggleExpand_ezFormCard"),onClick:()=>this.changeContracted(),title:this.contracted?"Expandir":"Resumir"}))),s("slot",null),this.contracted?s("snk-form-summary",{summary:this.getCardSummary()}):s("ez-form-view",{ref:t=>this._formView=t,fields:this.fields,onEzContentReady:t=>this.bindFields(t.detail),onFormItemsReady:t=>this.handleFormItemsReady(t),singleColumn:this._singleColumn}),this.fieldSearch&&s("ez-popover",{ref:t=>this._ezPopoverFieldColumn=t,overlayType:"none"},this.fieldSearch))}static get watchers(){return{customEditors:["observePropsCustomEditor"],fieldsProps:["observeFieldsProps"]}}};d.style=".sc-snk-form-view-h{display:flex;width:100%;--ez-form-card-summary-field-content-weight:700}.level-path.sc-snk-form-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.summary-wrapper.sc-snk-form-view{display:flex;overflow:hidden}.summary-header.sc-snk-form-view{border-bottom:1px solid var(--color--strokes);margin-bottom:var(--space--medium);padding-bottom:var(--space--medium)}.summary-container.sc-snk-form-view{display:flex;flex-direction:column}.summary-container.sc-snk-form-view{padding-right:calc(var(--space--extra-large) / 1.5)}.summary-field.sc-snk-form-view{min-width:30px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-field__title.sc-snk-form-view{color:var(--text--primary, #626e82);font-size:var(--title--small);white-space:nowrap;font-weight:var(--text-weight--medium)}.summary-field__content.sc-snk-form-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large);font-weight:var(--ez-form-card-summary-field-content-weight)}";export{d as snk_form_view}
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as s,H as e,g as h}from"./p-d8d8169b.js";import{Action as n,StringUtils as a,ElementIDUtils as o,ApplicationContext as r,KeyboardManager as d}from"@sankhyalabs/core";import"./p-6d241415.js";import"./p-e8c49c12.js";import{P as c,E as l}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-88ed2793.js";import"./p-ff1990ad.js";import"./p-7fc46290.js";import{V as u}from"./p-9019a32f.js";import{A as m}from"./p-1d585081.js";import{S as f}from"./p-cad964b5.js";import{T as g}from"./p-b987e15d.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-55798617.js";const p=class{constructor(s){t(this,s),this.actionClick=i(this,"actionClick",7),this.configuratorSave=i(this,"configuratorSave",7),this.configuratorCancel=i(this,"configuratorCancel",7),this.formItemsReady=i(this,"formItemsReady",7),this.viewModeChanged=i(this,"viewModeChanged",7),this.numberingConfigChanged=i(this,"numberingConfigChanged",7),this._viewHistory=[],this._customEditors=new Map,this._customRenders=new Map,this.dataUnitInterceptor={interceptAction:t=>(t.type===n.DATA_SAVED&&(t=this.interceptDataSaved(t)),t)},this._dataUnit=void 0,this._dataState=void 0,this.attachmentRegisterKey=void 0,this._currentViewMode=u.GRID,this._canEdit=void 0,this._resourceID=void 0,this.customContainerId=`SNK-CRUD-CUSTOM-CONTAINER-${a.generateUUID()}`,this.numberingConfig=void 0,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!1,this.configName=void 0,this.filterBarTitle=void 0,this.selectionToastConfig=void 0,this.showActionButtons=!1,this.actionsList=void 0,this.taskbarManager=void 0,this.recordsValidator=void 0,this.statusResolver=void 0,this.multipleSelection=!0,this.presentationMode=c.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.disablePersonalizedFilter=void 0,this.autoLoad=void 0,this.autoFocus=!0,this.enableGridInsert=!1,this.domainMessagesBuilder=void 0,this.ignoreReadOnlyFormFields=void 0,this.setCustomFormTitle=void 0,this.strategyExporter=l.SERVER_SIDE,this.layoutFormConfig=!0,this.multipleEditionEnabled=!0,this.paginationCounterMode="auto",this.disableNumberingConfig=!1}async goToView(t){this.executeAction(t)}async openConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.open()}async closeConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.close()}async reloadFilterBar(){var t;null===(t=this._snkGrid)||void 0===t||t.reloadFilterBar()}async getFilterBar(){return await this._snkGrid.getFilterBar()}async addCustomEditor(t,i){if(this._guidesViewer&&this._snkGrid)return this._guidesViewer.addCustomEditor(t,i),void this._snkGrid.addCustomEditor(t,i);const s=new Map(this._customEditors);s.set(t,i),this._customEditors=s}async addGridCustomRender(t,i){if(this._snkGrid)return void this._snkGrid.addGridCustomRender(t,i);const s=new Map(this._customRenders);s.set(t,i),this._customRenders=s}async addCustomValueFormatter(t,i){this._snkGrid.addCustomValueFormatter(t,i)}async removeCustomValueFormatter(t){this._snkGrid.removeCustomValueFormatter(t)}async setFieldProp(t,i,s){await this._guidesViewer.setFieldProp(t,i,s)}async getNumberingConfig(){return this.numberingConfig}async updateNumberingConfig(t){this.numberingConfig=t,this.applyNumberingConfigToFields()}currentViewModeWatcher(t){this._viewHistory=[...this._viewHistory.slice(-1),t]}async gridToForm(t=!1){this._backToGrid=!t&&await this._viewStack.getSelectedIndex()===u.GRID,this.setViewMode(u.FORM)}async executeAction(t){switch(t){case g.GRID_MODE:return this.setViewMode(u.GRID);case g.FORM_MODE:case g.UPDATE:return this.gridToForm(t!==g.UPDATE);case g.UPDATE_MULTIPLE:return this._dataUnit.isMultipleEdition=!0,this.setViewMode(u.FORM);case g.CONFIGURATOR:return this._snkConfigurator.open();case g.ATTACH:return this.setViewMode(u.ATTACHMENT)}}backView(){const t=this._viewHistory.at(-2)||u.GRID;this.setViewMode(t)}setViewMode(t){this._viewStack.show(t),this._currentViewMode=t,t===u.GRID?(this._dataUnit.isMultipleEdition=!1,this._snkGrid.setFocus()):t===u.FORM&&this._guidesViewer.setFocus(),this.viewModeChanged.emit(t)}openConfig(t){this._snkConfigurator.close(),t===u.GRID?this._snkGrid.showConfig():t===u.FORM&&this._guidesViewer.showFormConfig()}addDataElementID(){o.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}insertionModeHandler(){this.enableGridInsert||this.gridToForm()}cancelHandler(){this._backToGrid&&this.setViewMode(u.GRID)}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}setCustomRenders(){if(this._snkGrid)for(const[t,i]of this._customRenders)this._snkGrid.addGridCustomRender(t,i),this._customRenders.delete(t)}setCustomEditors(){if(this._snkGrid&&this._guidesViewer)for(const[t,i]of this._customEditors)this._guidesViewer.addCustomEditor(t,i),this._snkGrid.addCustomEditor(t,i),this._customEditors.delete(t)}componentDidRender(){this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this._application=r.getContextValue("__SNK__APPLICATION__");let t=this._element.parentElement;for(this._application.hasAccess(m.UPDATE,this._resourceID).then((t=>this._canEdit=t));t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._snkDataUnit.domainMessagesBuilder=this.domainMessagesBuilder,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.initDataUnit():this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail,this.initDataUnit()})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}t=t.parentElement}this.configName||(this.configName=this._application.configName)}componentDidLoad(){this.initKeyboardManager()}disconnectedCallback(){var t;this.removeShortcuts(),null===(t=this._dataUnit)||void 0===t||t.removeInterceptor(this.dataUnitInterceptor)}async handleDataStateChange(t){var i;this._dataState=t.detail,void 0!==this._dataState.selectedRecord&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey());const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const t of s||[]){if(!t)continue;const s=null===(i=this._dataState.rowMetadata)||void 0===i?void 0:i.getProp("rm_precision",t);(s||0===s)&&(await this.setFieldProp(t,"precision",s),await this.setFieldProp(t,"prettyPrecision",s))}}async initKeyboardManager(){this._keyboardManager=new d({propagate:!1,element:this._element});const t=this._dataUnit||await this._snkDataUnit.getDataUnit();async function i(){const i=document.activeElement,s=i==document.body;s||i.blur(),await t.saveData(),s||null==i.setFocus?s||i.focus():i.setFocus()}this._keyboardManager&&this._keyboardManager.bind("F6",this.toggleView.bind(this),{description:this.getMessage("snkCrud.shortcuts.toggleView"),element:this._element}).bind("F7",i.bind(this),{description:this.getMessage("snkCrud.shortcuts.saveData"),element:this._element}).bind("ctrl + \\",i.bind(this),{description:this.getMessage("snkCrud.shortcuts.addRecord"),element:this._element}).bind("F8",async function(){t.hasNewRecord()||t.addRecord()}.bind(this),{description:this.getMessage("snkCrud.shortcuts.addRecord"),element:this._element}).bind("F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkCrud.shortcuts.removeRecord"),element:this._element}).bind("ctrl + F9",t.removeSelectedRecords.bind(t),{description:this.getMessage("snkCrud.shortcuts.removeRecord"),element:this._element}).bind("F5",(async()=>{const i=await this._viewStack.getSelectedIndex();u.GRID===i&&t.loadData()}),{description:this.getMessage("snkCrud.shortcuts.refreshData"),element:this._element}).bind("Escape",(()=>{t.isDirty()&&t.cancelEdition()}),{debounceTime:1e3,description:this.getMessage("snkCrud.shortcuts.cancelAction"),element:this._element})}getMessage(t,i){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,i)}async removeShortcuts(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async toggleView(){const t=await this._viewStack.getSelectedIndex();this.setViewMode(u.GRID===t?u.FORM:u.GRID)}getLastRecordSaved(t){var i;return(null===(i=t.payload)||void 0===i?void 0:i.records.length)?t.payload.records[t.payload.records.length-1]:null}async saveNumberingConfig(){const t={entityName:this._snkDataUnit.entityName,isAutoNum:this.numberingConfig.isAutoNumbering,numInicial:this.numberingConfig.initialNumber};await this._servicesNumberingConfig.saveConfig(t)}updateNumberingConfigAfterInsert(t){var i,s;if(!(null===(i=t.payload)||void 0===i?void 0:i.changes.length)||this.disableNumberingConfig||!(null===(s=this.numberingConfig)||void 0===s?void 0:s.isAutoNumbering)||!this._fieldAutoNum)return t;if(!t.payload.changes.some((t=>"INSERT"===t.operation||"COPY"===t.operation)))return t;const e=this.getLastRecordSaved(t);if(e&&e.hasOwnProperty(this._fieldAutoNum)){const t=Number(e[this._fieldAutoNum]);this.numberingConfig.initialNumber=t,this.saveNumberingConfig()}else this.numberingConfig.initialNumber=this.numberingConfig.initialNumber+1;return this.numberingConfigChanged.emit(this.numberingConfig),t}interceptDataSaved(t){return this.updateNumberingConfigAfterInsert(t),t}onDataUnitReady(){var t;null===(t=this._dataUnit)||void 0===t||t.addInterceptor(this.dataUnitInterceptor),this.loadNumberingConfig()}async initDataUnit(){this.addDataElementID(),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),null==this._resourceID&&(this._resourceID=this._snkDataUnit.resourceID,null==this._resourceID&&(this._resourceID=await this._application.getResourceID())),this.onDataUnitReady()}async loadNumberingConfig(){if(!this.numberingConfig&&this._snkDataUnit&&this._snkDataUnit.entityName&&!this.disableNumberingConfig){this._servicesNumberingConfig||(this._servicesNumberingConfig=new f(this._application,this._resourceID));try{this.numberingConfig=await this._servicesNumberingConfig.getConfig(this._snkDataUnit.entityName),this.getFieldAutoNum(),this.applyNumberingConfigToFields()}catch(t){console.error("Error loading numbering config in snk-crud:",t),this.numberingConfig={isAutoNumbering:!1,initialNumber:null}}}}getFieldAutoNum(){if(this._fieldAutoNum)return;const t=this._dataUnit.metadata.fields.find((t=>{var i;return"true"===(null===(i=t.properties)||void 0===i?void 0:i.isAutoNumField)}));this._fieldAutoNum=(null==t?void 0:t.name)||null}async applyNumberingConfigToFields(){if(!this.numberingConfig||!this._snkDataUnit||!this._fieldAutoNum)return;const t=this._dataUnit.getField(this._fieldAutoNum);t.readOnly=this.numberingConfig.isAutoNumbering,t.required=!this.numberingConfig.isAutoNumbering}handleConfiguratorEvent(t,i){if(t.stopImmediatePropagation(),"SAVE"===i)return this._guidesViewer.reloadGuides(),void this.configuratorSave.emit();this.configuratorCancel.emit()}render(){if(null!=this._resourceID)return this._snkDataUnit.ignoreSaveMessage=this._currentViewMode===u.GRID&&!this.enableGridInsert,s(e,null,s("ez-view-stack",{ref:t=>this._viewStack=t,"data-element-id":"crud"},s("stack-item",{class:"ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium"},s("snk-grid",{ref:t=>this._snkGrid=t,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(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.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},s("slot",{name:"GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}))),s("stack-item",null,s("snk-guides-viewer",{ref:t=>this._guidesViewer=t,entityPath:this._snkDataUnit.entityName,messagesBuilder:this.messagesBuilder,onExit:()=>this.setViewMode(u.GRID),dataState:this._dataState,dataUnit:this._dataUnit,actionsList:this.actionsList,taskbarManager:this.taskbarManager,configName:this.configName,onActionClick:t=>this.executeAction(t.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},s("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkFormTaskBar"}))),s("stack-item",{tabIndex:"0"},s("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this._snkDataUnit.entityName,onBack:this.backView.bind(this)})),s("snk-configurator",{ref:t=>this._snkConfigurator=t,entityName:this._snkDataUnit.entityName,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:t=>this.setViewMode(t.detail),onOpenConfig:t=>this.openConfig(t.detail),showActionButtons:this.showActionButtons,onSave:t=>this.handleConfiguratorEvent(t,"SAVE"),onCancel:t=>this.handleConfiguratorEvent(t,"CANCEL"),resourceID:this._resourceID,customContainerId:this.customContainerId,layoutFormConfig:this.layoutFormConfig})),s("div",{id:`${this.customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}),s("slot",{name:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))}get _element(){return h(this)}static get watchers(){return{_currentViewMode:["currentViewModeWatcher"]}}};p.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";export{p as snk_crud}
@@ -1,11 +0,0 @@
1
- import{r as t,c as e,h as i,H as s,g as n}from"./p-d8d8169b.js";import{DateUtils as r,StringUtils as a,ObjectUtils as o,WaitingChangeException as h,SilentException as l,WarningException as c,ErrorException as d,ElementIDUtils as u,SearchUtils as p,ArrayUtils as m,KeyboardManager as g,OnboardingUtils as w,DependencyType as y,DataType as v,ApplicationContext as f,ErrorTracking as P,UserAgentUtils as k,LockManager as z,LockManagerOperation as _}from"@sankhyalabs/core";import{ApplicationUtils as x}from"@sankhyalabs/ezui/dist/collection/utils";import{C as A}from"./p-1788d191.js";import{d as S,D as b,U as I,S as T}from"./p-6d241415.js";import{A as N,a as L}from"./p-1d585081.js";import{P as E,D as C}from"./p-88ed2793.js";import{P as O}from"./p-e8c49c12.js";import{T as D}from"./p-9019a32f.js";import"./p-0f3698af.js";import"./p-ff1990ad.js";import{F as R}from"./p-7fc46290.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";class M{static webConnectionCaller(t,e,i){var s;null===(s=window.AppletCaller)||void 0===s||s.webConnectionCaller(t,e,i)}}const F=U;function U(t,e){const i=$();return(U=function(t){return i[t-=378]})(t,e)}function $(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return($=function(){return t})()}!function(){const t=U,e=$();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class j{[F(397)](t){const e=F;if(typeof(t=utxt(t[e(390)]))==e(392)&&(t=JSON[e(400)](t)),null==t)throw Error(e(395));const i=new H("S"===t[e(402)]||!0===t[e(402)]);return Array[e(394)](t[e(391)])&&t[e(391)][e(385)]((t=>i.putAccess(t[e(382)],String(t.status)==e(398)))),i}}class H{constructor(t){const e=F;this.isSup=t,this[e(384)]={}}[F(378)](t,e){this[F(384)][t]=e}[F(393)](t){const e=F;if(this[e(402)])return!0;let i=!0;return this[e(384)][e(380)](t)&&(i=this.actions[t]),i}isUserSup(){return this.isSup}}class B{constructor(){this._embeddedParams=new Map,this._cachedParams=new Map,this.templateByQuery=new Map;try{if(null!=window.MGE_PARAMS){atob(window.MGE_PARAMS).split("__;__").forEach((t=>{const[e,i]=t.split("__=__");this._embeddedParams.set(e,i)}))}}catch(t){console.error("Problemas ao obter parâmetros embarcados"),console.error(t)}this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",S.gql`query($name: String!) {
2
- $queryAlias$: fetchResource(name: $name){
3
- name
4
- resource
5
- }
6
- }`)}async getParam(t){if(this._embeddedParams.has(t))return Promise.resolve(this._embeddedParams.get(t));if(this._cachedParams.has(t))return this._cachedParams.get(t);const e=`param://application?params=${t}`,i=await b.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchParam")});return this._cachedParams.set(t,i),i}async asString(t){const e=await this.getParam(t);return this.getValue(e)}async asInteger(t){const e=await this.getParam(t);return parseInt(this.getValue(e))}async asFloat(t){const e=await this.getParam(t);return parseFloat(this.getValue(e))}async asBoolean(t){const e=await this.getParam(t);return"S"===this.getValue(e)}async asDate(t){const e=await this.getParam(t);return r.strToDate(this.getValue(e))}async getBatchParams(t){const e=await this.getParam(t.join(",")),i={};return e.forEach((t=>i[t.name]=t.resource)),i}getValue(t={}){if(Array.isArray(t)&&t.length>0&&(t=t[0]),"string"==typeof t)return t;if(a.isEmpty(t.resource))return"";try{const e=o.stringToObject(t.resource),[i]=Object.keys(e);return e[i]}catch(t){console.warn("Erro ao converter string JSON.")}}}class q{constructor(){this.templateByQuery=new Map,this.cancel=[],this.buildTemplates()}buildTemplates(){this.templateByQuery.set("fetchTotals",S.gql`query($filters: [InputFilter!] $name: String!) {
7
- $queryAlias$: fetchTotals(name: $name, filters: $filters ){
8
- name
9
- value
10
- }
11
- }`)}fetchTotals(t,e,i=[]){const s=`${t}_${e}`,n=this.cancel.findIndex((t=>t[s]));return n>=0&&(this.cancel[n][s](),this.cancel.splice(n,1)),Promise.race([new Promise((t=>this.cancel.push({[s]:t}))),this.getTotals(t,e,i)]).then((t=>{let e=new Map;if(t){e=t;const i=this.cancel.findIndex((t=>t[s]));i>=0&&this.cancel.splice(i,1)}return e}))}getTotals(t,e,i=[]){return new Promise(((s,n)=>{b.get().callGraphQL({query:this.templateByQuery.get("fetchTotals"),values:{name:`totals://${t}/${e}`,filters:i}}).then((t=>{if(t.length>0){const e=new Map;return t.forEach((t=>e.set(t.name,parseFloat(t.value)))),s(e)}return n("Não foi possível recuperar os totalizadores")})).catch(n)}))}}var K;class V{static openAppActivity(t,e){var i;null===(i=window.workspace)||void 0===i||i.openAppActivity(t,e)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}static setScreenToUseV3Layout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseV3Layout()}static setScreenToUseOldLayout(){var t;null===(t=window.workspace)||void 0===t||t.setScreenToUseOldLayout()}static showDesktop(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.showDesktop)||void 0===e||e.call(t)}static searchApp(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.searchApp)||void 0===e||e.call(t)}static openHelp(){var t,e;null===(e=null===(t=window.workspace)||void 0===t?void 0:t.openHelp)||void 0===e||e.call(t)}static applicationClick(){var t,e;(null===(t=window.workspace)||void 0===t?void 0:t.applicationClick)&&(null===(e=window.workspace)||void 0===e||e.applicationClick())}}V.resourceID=null===(K=window.workspace)||void 0===K?void 0:K.resourceID;class W{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}getMessage(t,e){return this._app.messagesBuilder.getMessage(t,e)}rejectionHandler(t){const e=t.reason;e instanceof h||(e?this.processException(e):this._app.isDebugMode().then((t=>{t&&this._app.error(this.getMessage("snkErrorHandler.title.promiseRejected"),this.getMessage("snkErrorHandler.message.undeterminedPromiseRejection"))})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return`<br><a href="#" onclick="try{window.workspace.openHelp('_tbcode:${t}')} catch(e){alert('${this.getMessage("snkErrorHandler.message.cannotOpenHelp")}');}">${this.getMessage("snkErrorHandler.errorCode.label")}${t}</a>`}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof l?console.warn(this.getMessage("snkErrorHandler.message.silentExceptionIgnored"),t):t instanceof h||t instanceof c?this._app.alert(t.title,t.message):t instanceof d?this._app.error(t.title,t.message):this._app.isDebugMode().then((e=>{if(e)if(t instanceof Error)this._app.error(t.name,t.message);else{const e=(null==t?void 0:t.title)||this.getMessage("snkErrorHandler.title.errorDetected",void 0),i="string"==typeof t?t:t.message||`${this.getMessage("snkErrorHandler.error.internal")} "${o.objectToString(t)}"`;this._app.error(e,i)}}))}}class G{constructor(){this._debounceTime=1500,this.requests=new Map,this.requestsLoadingBar=[]}onRequestStart(t){if(t.url.includes("quietMode=true"))return;this.requestsLoadingBar.push(t.requestId);const e=setTimeout((()=>{this.ezLoadingBar.show()}),this._debounceTime);this.requests.set(t.requestId,e)}onRequestEnd(t){var e,i,s;const n=this.requests.get(t.requestId);clearTimeout(n),(null===(e=this.requestsLoadingBar)||void 0===e?void 0:e.includes(t.requestId))&&(this.requestsLoadingBar=null===(i=this.requestsLoadingBar)||void 0===i?void 0:i.filter((e=>e!==t.requestId)),!this.requestsLoadingBar.length&&(null===(s=this.ezLoadingBar)||void 0===s||s.hide()))}}class J{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.ezLoadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.ezLoadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){if(null==t)return!1;if(t.url.includes("quietMode=true"))return!0;if(null==t.requestBody)return!1;if(1==t.requestBody.length){const{name:e}=t.requestBody[0].variables;if(e){const t=e.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class Y{static create({strategy:t}){switch(t){case"request_name":return new J;case"request_time":return new G;default:throw new Error("Strategy not found")}}}const Z=["<img","<svg"];class X{constructor(){this._config=null,this.listeners=[]}static getInstance(){return X.instance||(X.instance=new X),X.instance}get config(){return this._config}setConfig(t){this._config=t,this.notifyListeners()}onConfigChange(t){this.listeners.push(t)}notifyListeners(){this.listeners.forEach((t=>t(this._config)))}}const Q=class{constructor(i){t(this,i),this.applicationLoaded=e(this,"applicationLoaded",7),this.applicationLoading=e(this,"applicationLoading",7),this.NEW_VERSION_POPUP_LOCKER="NEW_VERSION_POPUP_LOCKER",this.FEATURE_FLAG_CACHE_DURATION=36e5,this._authPromises=[],this._keyboardManager=new g,this._waitingAppReady=new Array,this._duCache=new Map,this._duPromises=new Map,this._requestListener=Y.create({strategy:"request_time"}),this._maxTimerAppLoading=1e4,this._featureFlagsCache=new Map,this._isBrowserTypeElectron=!1,this._pendingActions=new Map,this._loadPkParameter=null,this._isLoadedByPk=!1,this._formConfigFetcher=new R,this._LayoutFormConfigSingleton=X.getInstance(),this._applicationReady=!1,this._templateSkeleton=D.GRID,this._activeScrimWindow=!1,this.enableLockManagerLoadingApp=void 0,this.messagesBuilder=void 0,this.configName=void 0,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.loadByPK=void 0}async processPendingActions(t){const e=this._pendingActions.get(t);e&&e.length&&(e.forEach((t=>t())),this._pendingActions.set(t,[]))}get parameters(){return this._parameters||(this._parameters=new B),this._parameters}async getAuth(t){return null==t?this.getApplicationAuth():new Promise(((e,i)=>{this.authFetcher.getData(t).then((t=>{e(t)})).catch((t=>{i(t)}))}))}async getApplicationAuth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,e)=>{const i=this._authPromises.length>0;this._authPromises.push(new tt(t,e)),i||this.authFetcher.getData(this.applicationResourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}watchPropHandler(t,e){t&&this._loadPkParameter&&(this.loadByPK(this._loadPkParameter.pk,this._loadPkParameter.redirect),this._loadPkParameter=null)}async getKeyboardManager(){return Promise.resolve(this._keyboardManager)}async getLayoutFormConfig(){return Promise.resolve(this._LayoutFormConfigSingleton)}async isUserSup(){return new Promise(((t,e)=>{this.getAuth().then((i=>{this.getAuthList(i).then((e=>{t(e.isSup)})).catch((t=>e(t)))}))}))}async addPendingAction(t,e){var i;const s=null!==(i=this._pendingActions.get(t))&&void 0!==i?i:[];this._pendingActions.set(t,[...s,e])}async callServiceBroker(t,e,i){return b.get().callServiceBroker(t,e,i)}async initOnboarding(t){this.hasToShowNewVersionPopup()?await this.addPendingAction(this.NEW_VERSION_POPUP_LOCKER,(()=>this.doInitOnboarding(t))):this.doInitOnboarding(t)}doInitOnboarding(t){w.getInstance().init(t,window.envContext)}async hasAccess(t,e){return new Promise(((i,s)=>{this.getAuth(e).then((e=>{this.getAuthList(e).then((e=>{i(e.isSup||e.actions[t])})).catch((t=>s(t)))}))}))}async getAllAccess(t){return new Promise(((e,i)=>{this.getAuth(t).then((t=>{this.getAuthList(t).then((t=>{const i={};i.isSup=t.isSup,Object.entries(N).forEach((e=>{i[e[0]]=e[1]===N.CLONE?t.actions[N.INSERT]&&t.actions[N.CLONE]||!1:t.actions[e[1]]||!1})),e(i)})).catch((t=>i(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,e="full",i=!0,s){this.clearContent(this._popUp),this._popUp.addEventListener("ezClosePopup",(()=>{s()}),{once:!0}),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=e,this._popUp.useHeader=i,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}showAlerts(t){return x.showAlerts({alerts:t})}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const e=t.split(",");return new Promise(((t,i)=>{this.getAttributeFromHTMLWrapper("opc0009").then((s=>{"1"===s?t(!0):Promise.all(e.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((e=>{t(e.includes("1"))})).catch((t=>{i(t)}))})).catch((t=>{i(t)}))}))}async getConfig(t){let e={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,i)=>{b.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(e)).then((e=>{var i;return t(null===(i=e.config)||void 0===i?void 0:i.data)})).catch((t=>i(t)))}))}async isFeatureActive(t){const e=Date.now();let i={serviceName:"SystemUtilsSP.featureIsActive",requestBody:{featureName:t}};if(this._featureFlagsCache.get(t)&&e<this._featureFlagsCache.get(t).expires)return Promise.resolve(this._featureFlagsCache.get(t).isActive);const s=(await b.get().callServiceBroker("SystemUtilsSP.featureIsActive",JSON.stringify(i))).isActive;return this._featureFlagsCache.set(t,{isActive:s,expires:e+this.FEATURE_FLAG_CACHE_DURATION}),s}async saveConfig(t,e){let i={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:e}}};return new Promise(((t,e)=>{b.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(i)).then((e=>t(e))).catch((t=>e(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,e){V.openAppActivity(t,e)}async webConnection(t,e,i){this.getStringParam(t).then((t=>{M.webConnectionCaller(t,e,i)}))}getDuPromissesStack(t){let e;return t&&(e=this._duPromises.get(t),e||(e=[],this._duPromises.set(t,e))),e||[]}async createDataunit(t,e,i,s,n){return null==n&&(n=this.applicationResourceID),new Promise(((r,a)=>{const o=this.getDuPromissesStack(e),h=o.length>0;if(o.push(new tt(r,a)),!h){const r=this.dataUnitFetcher.getDataUnit(t,n,i,s);r.loadMetadata().then((()=>{this.processResolveDataUnit(r,e,o)})).catch((t=>{for(;o.length>0;)o.pop().reject(t)}))}}))}processResolveDataUnit(t,e,i){for(e&&this.updateDataunitCache(void 0,e,t);i.length>0;)i.pop().resolve(t)}async updateDataunitCache(t,e,i){t&&this._duCache.delete(t),this._duCache.set(e,i)}async getDataUnit(t,e,i,s,n){return new Promise(((r,a)=>{const o=this._duCache.get(e);o?r(o):this.createDataunit(t,e,i,s,n).then((t=>{r(t)})).catch((t=>a(t)))}))}async addClientEvent(t,e){return new Promise((i=>{b.addClientEvent(t,e),i()}))}async removeClientEvent(t){return new Promise((e=>{b.removeClientEvent(t),e()}))}async hasClientEvent(t){return new Promise((e=>{e(b.hasClientEvent(t))}))}get applicationResourceID(){return this._applicationResourceID||(this._applicationResourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||V.resourceID||"unknown.resource.id"),this._applicationResourceID}async getResourceID(){return Promise.resolve(this.applicationResourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,e,i,s){return x.alert(t,e,i,s)}async error(t,e,i,s){return x.error(t,e,i,s)}async success(t,e,i,s){return x.success(t,e,i,s)}async message(t,e,i,s){return x.message(t,e,i,s)}async confirm(t,e,i,s,n){return x.confirm(t,e,i,s,n)}async info(t,e){return x.info(t,e)}async loadTotals(t,e,i){return this.totalsFetcher.fetchTotals(t,e,i)}async isLoadedByPk(){return Promise.resolve(this._isLoadedByPk)}async preloadMangerRemoveRecord(t,e){const i=e.map((t=>({__record__id__:t})));E.removeRecords(t,i)}getCountSkeleton(t,e,i){i=i||160;const s=window.innerHeight-i;return Math.floor(s/(t+(e||10)))-1||1}getSkeletonRandomWidth(){return`${Math.floor(71*Math.random())+30}%`}async getAuthList(t){return await(new j).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=I.getQueryParams(location.search)),this._urlParams}getMessage(t,e){var i;return null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage(t,e)}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new C),this._dataUnitFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new q),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new O),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new L),this._authFetcher}async executeSearch(t,e,i,s){const n=null==i?void 0:i.getField(e);if(n){const{mode:e,argument:a}=t,{ENTITYNAME:o,CODEFIELD:h,DESCRIPTIONFIELD:l,ROOTENTITY:c,DESCRIPTIONENTITY:d,ISHIERARCHYENTITY:u}=n.properties,p=n.dependencies;let m;const g={rootEntity:c,descriptionFieldName:l,codeFieldName:h,showInactives:!1,dataUnitId:i.dataUnitId};null==p||p.filter((t=>t.masterFields)).forEach((t=>{var e;t.type===y.SEARCHING&&(null===(e=t.masterFields)||void 0===e?void 0:e.length)>0&&(m={expression:t.expression,params:t.masterFields.map((t=>{const e=i.getField(t),s=(null==e?void 0:e.dataType)||v.TEXT,n=s===v.DATE?r.formatDate(new Date(null==e?void 0:e.defaultValue)):null==e?void 0:e.defaultValue,a=i.getFieldValue(t)||n;if(null==a)throw this.alert(this.getMessage("snkApplication.search.error.title"),this.getMessage("snkApplication.search.error.requiredField",{fieldLabel:e.label})),new Error(this.getMessage("snkApplication.search.error.requiredField",{fieldLabel:e.label}));return{name:t,value:a,dataType:s}}))})}));const w={entity:o,entityDescription:d,isHierarchyEntity:u,criteria:m,searchOptions:g,allowsNonAnalytic:null==s?void 0:s.allowsNonAnalytic};return(null==s?void 0:s.useSearchPlus)?this.executePreparedSearchPlus(e,a,w):this.executePreparedSearch(e,a,w)}}filterInvalidFields(t,e,i){return t.fieldsMetadata.filter((s=>{let n=!a.isEmpty(e[s.fieldName])&&!1!==s.visible&&"B"!==s.type&&t.pkField!==s.fieldName&&t.descriptionField!==s.fieldName&&(s.isPrimaryKey||!s.isLinkField)&&!("S"===s.type&&"H"===s.presentationType);return n&&(i[s.fieldName]=s),("string"!=typeof e[s.fieldName]||!(e[s.fieldName].indexOf("<img")>-1||e[s.fieldName].indexOf("<svg")>-1))&&n}))}filterMathFields(t,e,i,s){return t&&Array.isArray(t)&&t.forEach((t=>{let i=m.removeReference(e,s[t]);i&&e.unshift(i)})),e=e.slice(0,i)}builOptionItem(t,e,i,s,n){var r;return{value:a.highlightValue(t,e.__matchFields,null===(r=e[n])||void 0===r?void 0:r.toString(),i,!0),label:s?a.highlightValue(t,e.__matchFields,e[s],i,!0):"",details:p.buildDetails(t,i,e)}}async executePreparedSearchPlus(t,e,i){return await this.executePreparedSearch(t,e,Object.assign(Object.assign({},i),{useSearchPlus:!0}))}async executePreparedSearch(t,e,i){const s={},{entity:n,entityDescription:r,criteria:h,searchOptions:l,isHierarchyEntity:c,allowsNonAnalytic:d,useSearchPlus:g}=i;return g?(async(t,e,i,s,n)=>{var r;const h={},{entity:l,entityDescription:c,criteria:d,searchOptions:g,isHierarchyEntity:w,allowsNonAnalytic:y}=i;if("ADVANCED"===t)return new Promise(((t,i)=>{const r=document.createElement("snk-pesquisa");r[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${l}`,r.entityName=l,r.argument=e,r.searchLoader=t=>n.loadAdvancedSearch(l,t,d,g),r.isHierarchyEntity=w,w&&(r.treeLoader=t=>n.loadTree(l,t,d,g),r.allowsNonAnalytic=y),r.selectItem=e=>{t(e),s.clearPopUpTitle(),s.closePopUp()},s.setPopUpTitle(c),s.showPopUp(r,void 0,void 0,i)}));if("LOAD_DESCRIPTION"===t){let t=await n.loadByCode(l,e,d,g);t=o.stringToObject(t.json.$);const i=null===(r=t.data)||void 0===r?void 0:r[0];return i?{value:e,label:i[t.descriptionField]}:{value:e,label:""}}{let t,i=await n.loadAdvancedSearch(l,e,d,g,t);i=o.stringToObject(i.json.$);let s=i.descriptionField,r=i.pkField;return i.data.map((t=>{let n=((t,e,i)=>t.fieldsMetadata.filter((s=>{let n=!a.isEmpty(e[s.fieldName])&&!1!==s.visible&&"B"!==s.type&&t.pkField!==s.fieldName&&t.descriptionField!==s.fieldName&&(s.isPrimaryKey||!s.isLinkField)&&!("S"===s.type&&"H"===s.presentationType);return n&&(i[s.fieldName]=s),("string"!=typeof e[s.fieldName]||!Z.some((t=>e[s.fieldName].includes(t))))&&n})))(i,t,h),o=((t,e,i,s)=>(t&&Array.isArray(t)&&t.forEach((t=>{let i=m.removeReference(e,s[t]);i&&e.unshift(i)})),e=e.slice(0,i)))(t.__matchFields,n,6,h);return((t,e,i,s,n)=>{var r;const o=e.__matchFields,h=null!==(r=e[s])&&void 0!==r?r:"",l=e[n];return{value:l,label:h,presentationValue:a.highlightValue(t,o,l,i,!0),presentationLabel:s?a.highlightValue(t,o,h,i,!0):"",details:p.buildDetails(t,i,e)}})(e,t,o,s,r)}))}})(t,e,i,this,this.pesquisaFetcher):new Promise("ADVANCED"===t?(t,i)=>{const s=document.createElement("snk-pesquisa");s[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${n}`,s.entityName=n,s.argument=e,s.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(n,t,h,l),s.isHierarchyEntity=c,c&&(s.treeLoader=t=>this.pesquisaFetcher.loadTree(n,t,h,l),s.allowsNonAnalytic=d),s.selectItem=e=>{t(e),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(r),this.showPopUp(s,void 0,void 0,i)}:(t,i)=>{this.pesquisaFetcher.loadAdvancedSearch(n,e,h,l).then((i=>{let n=(i=o.stringToObject(i.json.$)).descriptionField,r=i.pkField;const a=[];i.data.forEach((t=>{let o=this.filterInvalidFields(i,t,s),h=this.filterMathFields(t.__matchFields,o,6,s);a.push(this.builOptionItem(e,t,h,n,r))})),t(a)})).catch((t=>{i(t)}))})}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return V.getAppLabel(this.applicationResourceID)}addSearchListener(t,e,i){return new Promise((s=>{s(this.pesquisaFetcher.addSearchListener(t,e.dataUnitId,i))}))}importScript(t){return new Promise((e=>{this.getApplicationPath().then((i=>{let s=[];Array.isArray(t)||(s=[t]),s.forEach((t=>{const e=document.createElement("script");e.src=`${i}/${t}`,e.async=!0,document.body.appendChild(e)})),e()}))}))}async getApplicationPath(){return new Promise((t=>{"dev"===window.applicationenv?t(""):t(`/${this.getModuleName()}/labsApps/${window.APPLICATION_NAME}/build`)}))}getModuleName(){return window.MGE_MODULE_NAME||"mgefin-bff"}executeSelectDistinct(t,e,i){return this.dataUnitFetcher.loadSelectDistinct(t,e,i)}getDataFetcher(){return Promise.resolve(b.get())}async whenApplicationReady(){return f.getContextValue("__SNK__APPLICATION__LOADING__")?Promise.resolve(this):new Promise((t=>{this._waitingAppReady.push((()=>t(this)))}))}async setSearchFilterContext(t,e){f.setContextValue(`__SNK__APPLICATION__FILTER__CONTEXT(${t})__`,e)}clearContent(t){t&&Array.from(t.children).forEach((e=>{t.removeChild(e)}))}async clearPopUpTitle(){this._popUp.ezTitle=""}async setPopUpTitle(t){this._popUp.ezTitle=t}async pkChangeListener(){const t=top.window.location.hash.split("/")[2];if(this._currentPkParameter===t)return;const e=this.getResourceIdFromToken(),i=I.getPkObjectFromUrlToken(top.window.location.hash),s=window.redirectFrom;if(void 0===i)return;if((!s||-1===s.split("_")[0].indexOf(e.split("_")[0]))&&e!==this.applicationResourceID)return;const n={pk:i};if(this._isLoadedByPk=!0,this.loadByPK)return this.loadByPK(n,s),void(this._currentPkParameter=t);this._loadPkParameter={pk:n,redirect:s},this.defaultLoadByPK(n,t)}getResourceIdFromToken(){var t;return(null===(t=top.window.location.pathname)||void 0===t?void 0:t.indexOf("tabContent.jsp"))>-1&&window.location.generateHash?I.getResourceIdFromUrlToken(window.location.generateHash(window.location.hash)):I.getResourceIdFromUrlToken(top.window.location.hash)}defaultLoadByPK(t,e){if(!(null==t?void 0:t.pk))return;const i=this.getFirstDataUnitFromDOM(),s=i.dataUnit;if(!s)return console.warn(this.getMessage("snkApplication.dataUnit.initDataUnitError")),void i.addEventListener("dataUnitReady",(i=>{this.loadDataWithPKFilter(t,i.detail),this._currentPkParameter=e}));this.loadDataWithPKFilter(t,s),this._currentPkParameter=e}loadDataWithPKFilter(t,e){const i={term:"",filter:{name:"LOAD_BY_PK_FILTER",expression:this.buildFilterExpressionByPkObject(t),params:this.getFilterParamsFromPkObject(t,e)}};e.loadData(i)}getFirstDataUnitFromDOM(){let t=this._element.querySelector("snk-data-unit[data-load-by-pk]");if(t||(t=this._element.querySelector("snk-data-unit")),t)return t}getFilterParamsFromPkObject(t,e){var i;const s=[];for(const n in t.pk)t.pk.hasOwnProperty(n)&&!Array.isArray(t.pk[n])&&s.push({name:n,dataType:(null===(i=e.getField(n))||void 0===i?void 0:i.dataType)||this.getDefaultDataTypeLoadByPK(t.pk[n]),value:t.pk[n]});return s}getDefaultDataTypeLoadByPK(t){return"number"==typeof t||t instanceof Number?v.NUMBER:"boolean"==typeof t||t instanceof Boolean?v.BOOLEAN:t instanceof Date?v.DATE:v.TEXT}buildFilterExpressionByPkObject(t){let e="";for(const i in t.pk)a.isEmpty(e)||(e+=" AND "),Array.isArray(t.pk[i])?e+=`${i} IN (${t.pk[i].toString()})`:e+=`${i} = :${i}`;return e}async showNewVersionPopup(){const t=document.createElement("ez-modal-container"),e=await this.getAppLabel();t.modalTitle=this.getMessage("snkApplication.newVersionPopup.title",{screenName:e}),t.okButtonLabel=this.getMessage("snkApplication.newVersionPopup.okButton"),t.cancelButtonLabel=this.getMessage("snkApplication.newVersionPopup.cancelButton");const i=document.createElement("p");i.innerText=this.getMessage("snkApplication.newVersionPopup.info"),i.className="ez-text",t.appendChild(i),t.addEventListener("ezModalAction",this.newVersionPopupEventListener.bind(this));const s=await x.showPopup({content:t});this._removeVersionLayoutPopup=async()=>{await s(),await this.processPendingActions(this.NEW_VERSION_POPUP_LOCKER)}}async newVersionPopupEventListener(t){"LOAD"!==t.detail&&("OK"===t.detail&&V.setScreenToUseV3Layout(),"CANCEL"===t.detail&&V.setScreenToUseOldLayout(),this._popUp.opened=!1,this._removeVersionLayoutPopup&&await this._removeVersionLayoutPopup())}async handleShowNewVersionPopup(){this.hasToShowNewVersionPopup()&&await this.showNewVersionPopup()}hasToShowNewVersionPopup(){const t=new URLSearchParams(window.location.search).get("firstLoadConv");return t&&"S"===t}registerPkChangeListener(){window.hasOwnProperty("onhashchange")?window.onhashchange=this.pkChangeListener.bind(this):setInterval(this.pkChangeListener.bind(this),100)}componentWillLoad(){f.setContextValue("__SNK__APPLICATION__LOADING__",!0),this._errorHandler=new W(this),this.messagesBuilder=new T,f.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${I.getUrlBase()}/mge/upload/file`),f.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,e,i,s)=>this.executeSearch(t,e,i,s))),f.setContextValue("__EZUI__SEARCH__PLUS__OPTION__LOADER__",((t,e,i,s)=>this.executeSearch(t,e,i,Object.assign(Object.assign({},s),{useSearchPlus:!0})))),this.registerPkChangeListener(),P.init(),A.preload(this.applicationResourceID,this.configName,{gridLegacyConfig:this.gridLegacyConfigName,formLegacyConfig:this.formLegacyConfigName}),document.addEventListener("click",(()=>V.applicationClick())),this._waitingAppReady.forEach((t=>t())),this.setLayoutFormConfig()}async setLayoutFormConfig(){const t=await this._formConfigFetcher.fetchLayoutFormConfig("formColCfg."+this.applicationResourceID),e=isNaN(Number(null==t?void 0:t.config))?null:Number(null==t?void 0:t.config);this._LayoutFormConfigSingleton.setConfig(e)}connectedCallback(){this._isBrowserTypeElectron=k.isElectron(),f.setContextValue("__SNK__APPLICATION__",this),b.addRequestListener(this._requestListener)}disconnectedCallback(){null==b||b.removeRequestListener(this._requestListener),this.removeShortcuts(),this._lockManagerTimer&&clearTimeout(this._lockManagerTimer),this._scrimWindowTimer&&clearTimeout(this._scrimWindowTimer)}async componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{f.setContextValue("__SNK__APPLICATION__LOADING__",!1),this.applicationLoaded.emit(!0),this.pkChangeListener()})),u.addIDInfo(this._element,`resource_${this.applicationResourceID}`),await this.handleShowNewVersionPopup(),this.initKeyboardManager(),this.enableLockManagerLoadingApp?(z.addLockManagerCtxId(this._element),this.resolveApplicationReady()):this._applicationReady=!0}async showScrimApp(t){if(!this.enableLockManagerLoadingApp||!this._applicationReady||!t)return this._activeScrimWindow=!1,void(this._scrimWindowTimer&&clearTimeout(this._scrimWindowTimer));this._activeScrimWindow=!0,this._scrimWindowTimer=setTimeout((async()=>{this._activeScrimWindow&&(this._activeScrimWindow=!1,clearTimeout(this._scrimWindowTimer))}),this._maxTimerAppLoading)}async changeTemplateSkeleton(t){this._templateSkeleton=t||this._templateSkeleton}async markToReload(t){this.enableLockManagerLoadingApp&&(await this.changeTemplateSkeleton(t),this._applicationReady=!1,await z.resetLocks(this._element,_.APP_LOADING),this.resolveApplicationReady())}async addLoadingLock(t=!1,e){if(this.enableLockManagerLoadingApp)return await this.changeTemplateSkeleton(e),t&&(this._applicationReady=!1,this._activeScrimWindow=!!this._applicationReady,await z.resetLocks(this._element,_.APP_LOADING)),this.resolveApplicationReady(),await z.lock(this._element,_.APP_LOADING)}async resolveApplicationReady(){if(!this._applicationReady)try{await this.checkTimeoutLimitLockManager(),await z.whenHasLock(this._element,_.APP_LOADING),await z.whenResolve(this._element,_.APP_LOADING,200),await z.resetLocks(this._element,_.APP_LOADING),this._applicationReady=!0}catch(t){console.warn(t),this._applicationReady=!0}}stopTimeoutLockManager(){this._lockManagerTimer&&clearTimeout(this._lockManagerTimer)}async checkTimeoutLimitLockManager(){this.stopTimeoutLockManager(),this._applicationReady||(this._lockManagerTimer=setTimeout((async()=>{this._applicationReady||(await z.resetLocks(this._element,_.APP_LOADING),this.stopTimeoutLockManager(),this._applicationReady=!0)}),this._maxTimerAppLoading))}initKeyboardManager(){this._keyboardManager.bind("ctrl + g",V.searchApp.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.searchApp")}).bind("ctrl + d",V.showDesktop.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.showDesktop")}).bind("F1",V.openHelp.bind(this),{description:this.getMessage("snkApplication.keyboard.shortcuts.openHelp")})}removeShortcuts(){this._keyboardManager.unbindAllShortcutKeys()}renderLoadingSkeleton(){if(this.enableLockManagerLoadingApp){if(this._isBrowserTypeElectron)return this.getSpinnerLoadingDefault();switch(this._templateSkeleton){case D.CUSTOM_TEMPLATE:case D.GRID:return this.getSkeletonTemplateGrid();case D.GRID_WITH_SIDEBAR:return this.getSkeletonTemplateGridWithSidebar();case D.GRID_WITH_PANEL:return this.getSkeletonTemplateGridWithPanel();case D.FORM_WITH_SIDEBAR:return this.getSkeletonTemplateFormWithSidebar();default:return this.getSkeletonTemplateGrid()}}}getLoadingVisibilityStyle(){return{visibility:this._applicationReady?"hidden":"initial",display:this._applicationReady?"none":"unset"}}getSkeletonTemplateGrid(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-flex--column ez-margin--large ez-margin-top--medium"},i("div",{class:"ez-margin-bottom--medium"},i("ez-skeleton",{count:1,variant:"text",width:"20%",height:"35px",animation:"progress"})),i("div",{class:""},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"}))),i("div",{class:"ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large",style:{height:"calc(-105px + 100vh)"}},[1,2,3,4].map(((t,e)=>i("div",{class:"ez-margin-right--large",key:e,style:{width:"25%"}},i("ez-skeleton",{count:this.getCountSkeleton(50,10),variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))))}getSkeletonTemplateGridWithSidebar(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-flex--column ez-margin--large ez-margin-top--medium"},i("div",{class:"ez-margin-bottom--medium"},i("ez-skeleton",{count:1,variant:"text",width:"20%",height:"35px",animation:"progress"})),i("div",{class:""},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"}))),i("div",{class:"ez-flex ez-flex--justify-start skeleton-content-column ez-margin-horizontal--large",style:{height:"calc(100vh - 160px)"}},i("div",{class:"ez-flex ez-flex--column ez-margin-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(30,6)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:this.getSkeletonRandomWidth(),height:"30px",animation:"progress",marginBottom:"10px"})))),i("div",{class:"ez-margin-right--large",style:{width:"75%"}},i("ez-skeleton",{count:this.getCountSkeleton(50,10),variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))}getSkeletonTemplateGridWithPanel(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-margin--medium ez-margin-top--medium ez-padding--medium"},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-margin--medium ez-margin-top--medium",style:{maxHeight:"calc(-105px + 100vh)",overflow:"hidden"}},i("div",{class:"",style:{width:"70%",overflow:"hidden"}},i("div",{class:"ez-padding--medium",style:{height:"50%"}},i("ez-skeleton",{count:1,variant:"text",width:"100%",height:"100%",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{}},i("ez-skeleton",{count:1,variant:"text",width:"250px",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-padding--medium",style:{height:"45%"}},[1,2].map((()=>i("div",{style:{width:"50%"}},i("ez-skeleton",{count:1,variant:"text",width:"100%",height:"100%",animation:"progress"})))))),i("div",{class:"ez-flex ez-flex--column ez-padding--medium",style:{width:"30%",overflow:"hidden"}},Array(this.getCountSkeleton(30,10)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"}))))))}getSkeletonTemplateFormWithSidebar(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-margin--medium ez-margin-top--medium ez-padding--medium"},i("ez-skeleton",{count:1,variant:"text",width:"70%",height:"25px",animation:"progress"})),i("div",{class:"ez-flex ez-margin--medium ez-margin-top--medium",style:{maxHeight:"calc(-105px + 100vh)",overflow:"hidden"}},i("div",{class:"ez-flex ez-flex--column ez-margin-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(30,6)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:this.getSkeletonRandomWidth(),height:"30px",animation:"progress",marginBottom:"10px"})))),i("div",{class:"ez-flex ez-flex--column",style:{width:"75%"}},i("div",{class:"ez-padding--medium",style:{width:"100%"}},i("ez-skeleton",{count:1,variant:"text",width:"30%",height:"25px",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{height:"45%"}},i("div",{class:"ez-flex",style:{width:"100%",height:"100%"}},[1,2,3,4].map(((t,e)=>i("div",{key:e,class:"ez-padding-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(50,20)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"})))))))),i("div",{class:"ez-padding--medium",style:{width:"100%"}},i("ez-skeleton",{count:1,variant:"text",width:"30%",height:"25px",animation:"progress"})),i("div",{class:"ez-padding--medium",style:{height:"45%"}},i("div",{class:"ez-flex",style:{width:"100%",height:"100%"}},[1,2,3,4].map(((t,e)=>i("div",{key:e,class:"ez-padding-right--large",style:{width:"25%",overflow:"hidden"}},Array(this.getCountSkeleton(50,20)).fill(null).map(((t,e)=>i("ez-skeleton",{key:e,count:1,variant:"text",width:"100%",height:"50px",animation:"progress",marginBottom:"10px"})))))))))))}getSpinnerLoadingDefault(){return i("div",{class:"loading-hidden",style:this.getLoadingVisibilityStyle()},i("div",{class:"ez-flex ez-size-height--full ez-size-width--full ez-flex--justify-center ez-flex--align-items-center spinner"},i("ez-icon",{iconName:"sync",size:"x-large",class:"spin"}),i("span",{class:"ez-title ez-title--secondary ez-title--extra-large"},this.getMessage("snkApplication.loading.text"))))}render(){return i(s,{style:{visibility:!this.enableLockManagerLoadingApp||this._applicationReady?"unset":"hidden",overflow:!this.enableLockManagerLoadingApp||this._applicationReady?"unset":"hidden"}},i("div",null,i("ez-loading-bar",{ref:t=>this._requestListener.ezLoadingBar=t}),i("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),i("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}),this.renderLoadingSkeleton(),this._activeScrimWindow&&i("div",{class:"ez-scrim ez-scrim--light",style:{cursor:"progress",zIndex:"var(--scrim-z-index)"}})))}get _element(){return n(this)}static get watchers(){return{loadByPK:["watchPropHandler"]}}};class tt{constructor(t,e){this.resolve=t,this.reject=e}}Q.style=".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)}}";export{Q as snk_application}
@@ -1 +0,0 @@
1
- import{UserInterface as n,DataType as t}from"@sankhyalabs/core";import{a as o,G as e,D as r}from"./p-9019a32f.js";const u=new Map([[n.DATE,"calendar"],[n.DATETIME,"calendar-clock"],[n.ELAPSEDTIME,"timer-outline"],[n.TIME,"timer-outline"],[n.DECIMALNUMBER,"number"],[n.INTEGERNUMBER,"number"],[n.FILE,"zip"],[n.IMAGE,"pdf"],[n.HTML,"tag_code"],[n.SEARCH,"search"],[n.SEARCHPLUS,"search"],[n.OPTIONSELECTOR,"list"],[n.CHECKBOX,"list"],[n.SWITCH,"boolean"],[n.PASSWORD,"eye-off"]]),i="container-available-fields";var l;function c(n,t,o,e){var r;const u=null===(r=null==n?void 0:n[t])||void 0===r?void 0:r.children;return u?Array.from(u).map((({fieldConfig:n})=>Object.assign(Object.assign({},n),{group:o,tab:e}))):[]}function a(n,t){return n.map((n=>Object.assign(Object.assign({},n),{fields:n.fields.map((n=>Object.assign(Object.assign({},n),{tab:t})))})))}function f(n,o,e){var r;if(null==n||!o||!e)return;const u=null===(r=o.getField(e))||void 0===r?void 0:r.dataType;if(null==u)return;if(void 0!==(null==n?void 0:n.waitmessage))return;const i=u!==t.OBJECT&&u!==t.DATE&&"object"==typeof n?n.value:n;return u===t.OBJECT?JSON.stringify(i):i}function s(n,t,o){if(!o)return!0;const e=o.properties||{},r=!0!==o[n];return e.hasOwnProperty(t)?"S"!==e[t]:r}function d(n,t,o){return!(!t||!0!==t[n])||o}function v(n){return u.get(n)||"text"}function b(n,t){var o,e;const r=t("snkFormConfig.form.newGuide"),u=null!==(e=null===(o=n.filter((n=>n.name.includes(r))))||void 0===o?void 0:o.length)&&void 0!==e?e:0;return 0===u?r:`${r} (${u})`}function m(n){const t=[];return n.forEach((n=>{n.forEach((({fields:n})=>{null==n||n.forEach((n=>{t.push(function(n){const t={cleanOnCopy:n.cleanOnCopy||!1,group:n.group===e.noGroup?void 0:n.group,label:n.label,name:n.name,required:n.required,readOnly:n.readOnly,tab:n.tab};return null!=n.defaultValue&&(t.defaultValue=null==n.defaultValue.type?{type:r.fixed,value:n.defaultValue}:n.defaultValue),t}(n))}))}))})),t}function p(n,t,e,r){const u=n.map((n=>{const t=n.tab;return Object.assign(Object.assign({},n),{tab:t&&t!==o.general?n.tab:o.main})})),i=function(n){const t=new Map;return j(n).forEach((n=>{t.set(n.name,[])})),t}(t);if(null==u?void 0:u.length){for(let n of i.keys()){const t=M(k(C(u,n,r),e,r));i.set(n,t)}return i}}function O(n,t){let e=n.tabs?[...n.tabs]:function(n){const t=[];let o=1;return null==n||n.forEach((n=>{const e=n.tab;(function(n,t){return n&&!t.map((n=>n.name)).includes(n)})(e,t)&&(t.push({name:e,label:e,visible:!0,order:o}),o+=1)})),t}(null==n?void 0:n.fields);return e=j(e),e=function(n){return n.map((n=>Object.assign(Object.assign({},n),{name:n.name?n.name:n.label})))}(e),function(n,t){const e={name:o.main,label:t,visible:!0};return n.some((n=>n.name===o.main))?n=n.map((n=>n.name===o.main?e:n)):n.unshift(e),n}(e,t)}function j(n){return[...n.filter((n=>n.label!==o.general))]}function y(n,t){n.label||(n.label=t.label)}function g(n,t){n.tab||(n.tab=t)}function h(n){n.group||(n.group=e.noGroup)}function w(n){var t;return!0===(null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t.visibleOnConfig)&&!1===(null==n?void 0:n.visible)}function k(n,t,o){const r=new Map;r.set(e.noGroup,[]);for(let e of n){const n=t.getField(e.name);((null==n?void 0:n.visible)||w(n))&&(y(e,n),g(e,o),h(e),r.has(e.group)?r.get(e.group).push(e):r.set(e.group,[e]))}return r}function C(n,t,o){return n.filter((n=>{const e=function(n,t){var o;return"string"==typeof n?n:null!==(o=null==n?void 0:n.label)&&void 0!==o?o:t}(n.tab,o);return e===t}))}function M(n){const t=[];for(let o of n.keys())t.push({name:o,fields:n.get(o)});return t}!function(n){n.FROM="from",n.TO="to"}(l||(l={}));export{i as I,l as S,p as a,O as b,b as c,c as d,f as e,s as f,m as g,d as h,v as i,a as u}
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as i,H as e,g as a}from"./p-d8d8169b.js";import{Action as h,LockManager as n,LockManagerOperation as r,SilentException as o,StringUtils as l,ApplicationContext as d,OVERFLOWED_CLASS_NAME as v,OverflowWatcher as u,OverflowDirection as c,ElementIDUtils as k}from"@sankhyalabs/core";import{A as m}from"./p-dc36cfbf.js";import{T as b,V as p,A as T,b as f,a as g}from"./p-b987e15d.js";import{P as w}from"./p-0f3698af.js";import"./p-55798617.js";const E=class{constructor(i){t(this,i),this.actionClick=s(this,"actionClick",7),this.taskbarSaveLocker=s(this,"taskbarSaveLocker",7),this.taskbarSaveUnlocker=s(this,"taskbarSaveUnlocker",7),this.TASKBAR_ITEM_ID_PREFIX="TASKBAR_ITEM_",this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME="taskbar-custom-elements-container",this.ACTIONS_BUTTON_TAG="TASKBAR-ACTIONS-BUTTON",this.NOT_OVERFLOW_ELEMENTS=["moreOptions","dataExporter_snkDataExporter","actionsButton_snkActionsButton"],this.TASKBAR_CUSTOM_ELEMENTS="taskbar-custom-elements-container",this._titleKeyByElement={[b.UPDATE_MULTIPLE]:"snkTaskbar.titleUpdateMultiple",[b.UPDATE]:"snkTaskbar.titleUpdate",[b.PREVIOUS]:"snkTaskbar.titlePrevious",[b.NEXT]:"snkTaskbar.titleNext",[b.REFRESH]:"snkTaskbar.titleRefresh",[b.CLONE]:"snkTaskbar.titleClone",[b.REMOVE]:"snkTaskbar.titleRemove",[b.MORE_OPTIONS]:"snkTaskbar.titleMoreOptions",[b.INSERT]:"snkTaskbar.titleInsert",[b.CANCEL]:"snkTaskbar.titleCancel",[b.SAVE]:"snkTaskbar.titleSave",[b.GRID_MODE]:"snkTaskbar.titleGridMode",[b.FORM_MODE]:"snkTaskbar.titleFormMode",[b.CONFIGURATOR]:"snkTaskbar.titleConfigurator",[b.ATTACH]:"snkTaskbar.titleAttach"},this.onSaveEvent=t=>{switch(t.type){case h.FIELD_INVALIDATED:case h.INVALIDATE_CLEAN:case h.DATA_SAVED:case h.SAVING_ERROR:case h.SAVING_CANCELED:this._isWaitingForSave=!1;break;case h.SAVING_DATA:this._isWaitingForSave=!0}},this._permissions=void 0,this._overFlowedElements=[],this._customElements=void 0,this._customElementsId=void 0,this._slotContainer=void 0,this._hiddenActionsList=[],this._lastWidth=void 0,this._hasToUpdateOverFlow=!1,this._isWaitingForSave=!1,this.alignRigth=!1,this.customSlotId="TASKBAR_CUSTOM_ELEMENTS",this.customContainerId=void 0,this.overflowStrategy="hiddenItems",this.configName=void 0,this.resourceID=void 0,this.buttons=void 0,this.customButtons=void 0,this.actionsList=void 0,this.actionsSettingsList=void 0,this.primaryButton=void 0,this.disabledButtons=void 0,this.dataUnit=void 0,this.presentationMode=w.PRIMARY,this.messagesBuilder=void 0}handleCustomSlotElementsLoaded(t){this.hasToSearchCustomElements(t)&&this.getCustomElements(!0)}handleTaskbarSaveLocker(){!0!==this._isWaitingForSave&&(this._isWaitingForSave=!0)}handleTaskbarSaveUnlocker(){!0===this._isWaitingForSave&&(this._isWaitingForSave=!1)}hasToSearchCustomElements(t){return this.customSlotId===t.detail&&!this._slotContainer}observeButtons(){this._definitions=void 0,requestAnimationFrame((()=>{requestAnimationFrame((()=>{var t;return null===(t=this._overFlowWatcher)||void 0===t?void 0:t.forceUpdate()}))}))}observeDisabledButtons(){var t;null===(t=this._overFlowWatcher)||void 0===t||t.forceUpdate()}observeLastWidth(t,s){0===s&&0!==t&&(this._hasToUpdateOverFlow=!0)}observeIsWaitingForSave(t,s){1==t&&0==s&&this.taskbarSaveLocker.emit(),0==t&&1==s&&this.taskbarSaveUnlocker.emit()}elementsFromString(t){const s=[];return null==t||t.split(",").forEach((t=>{t=t.trim(),(p[t]||this.isAllowed(t))&&s.push(t.trim())})),s}isAllowed(t){return t===T.CONFIGURATOR?!!this._permissions&&(this._permissions.isSup||this._permissions[m.CONFIG_GRID]||this._permissions[m.CONFIG]):!T[t]||!!this._permissions&&(this._permissions.isSup||this._permissions[t])}getTitle(t){var s;let i;return i=this.isAllowed(t)?this._titleKeyByElement[t]:"snkTaskbar.forbidden",i?null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(i,{}):""}elementClick(t){n.whenResolve(this._element,r.TASKBAR_CLICK).then((()=>{if(this.dataUnit)switch(t){case b.PREVIOUS:this.dataUnit.previousRecord();break;case b.NEXT:this.dataUnit.nextRecord();break;case b.REFRESH:this.dataUnit.loadData();break;case b.CLONE:this.dataUnit.copySelected();break;case b.REMOVE:this.dataUnit.removeSelectedRecords();break;case b.INSERT:this.dataUnit.addRecord();break;case b.CANCEL:this.dataUnit.cancelEdition();break;case b.SAVE:this._isWaitingForSave||(this._isWaitingForSave=!0,this.dataUnit.saveData().catch((t=>{if(!(t instanceof o))throw t})).finally((()=>{this._isWaitingForSave=!1})))}this.isEnabled(t)&&this.actionClick.emit(t)}))}isEnabled(t){return!(!this.isAllowed(t)||this.disabledButtons&&this.disabledButtons.includes(t))}validatePresentationMode(){Object.values(w).includes(this.presentationMode)||(this.presentationMode=w.PRIMARY)}getElement(t,s){let i=s===this.primaryButton?"ez-button--primary ":"";t>1&&(i+="ez-padding-left--medium");const e=b[s.toString()],a=this._element.dataset.exporterStoreKey||this.configName;return e?f(s,i,this.getIdElemBtnNative(s),(t=>this.getTitle(t)),(t=>this.elementClick(t)),(t=>this.isEnabled(t)),s!==b.CONFIGURATOR?this.buildDynamicActionsList():this.buildActionsSettingsList(),a,this.presentationMode):g(s,i,this.getIdElemBtnCustom(s),(t=>this.elementClick(t)),(t=>this.isEnabled(t)))}buildDynamicActionsList(){var t;return this._hiddenActionsList.length?[...null!==(t=this.actionsList)&&void 0!==t?t:[],...this._hiddenActionsList]:this.actionsList}buildActionsSettingsList(){return this.actionsSettingsList}getIdElemBtnNative(t){return l.toCamelCase(t)}getIdElemBtnCustom(t){return l.toCamelCase(t.name)}isDivider(t){var s;return void 0!==t&&(null===(s=t.t)||void 0===s?void 0:s["data-taskbar-divider"])}removeEmpty(t){let s;return t.filter((t=>!(null==t||this.isDivider(s)&&this.isDivider(t)||(s=t,0))))}appendCustomElementsInTaskbar(){this._customElementsId.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s),e=this._element.querySelector(`#${t}`);e?null==e||e.appendChild(i):this.unlinkCustomElementFromTaskbar(i)}))}addCustomElementContainer(t){var s;const e=`${this.TASKBAR_ITEM_ID_PREFIX}${t}`;return this._customElementsId.includes(e)||(this._customElementsId.push(e),null===(s=this._overFlowWatcher)||void 0===s||s.addNotOverFlowElement(e)),i("span",{class:"ez-padding-left--medium",key:e,id:e})}getCustomElements(t){var s,i;this._customElementsId=[],this._customElements=new Map,this._slotContainer=this.buildSlotContainer(t),Array.from(null!==(i=null===(s=this._slotContainer)||void 0===s?void 0:s.children)&&void 0!==i?i:[]).forEach((t=>this._customElements.set(t.id,t)))}buildSlotContainer(t){let s;if(this.customContainerId){const t=document.querySelector(`#${this.customContainerId}`);s=null==t?void 0:t.querySelector(`#${this.customSlotId}`)}else s=this._element.querySelector(`#${this.customSlotId}`);return t&&!s&&(s=document.querySelector(`#${this.customSlotId}`)),s}componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess(this.resourceID).then((t=>this._permissions=t)):this._permissions={},this.getCustomElements()}componentWillRender(){this.handleDefinitions(),this.validatePresentationMode(),this.updateOverFlowIfNeeded()}handleDefinitions(){null==this._definitions&&this._permissions&&(this._definitions=this.elementsFromString(this.buttons))}updateOverFlowIfNeeded(){this._hasToUpdateOverFlow&&(requestAnimationFrame((()=>{var t;return null===(t=this._overFlowWatcher)||void 0===t?void 0:t.forceUpdate()})),this._hasToUpdateOverFlow=!1)}handleOverFlow(t){const s=t.filter((t=>!this.hasToIgnoreOverFlow(t)));this.resetOverFlowedElements(),this.doOverFlowElements(s)}resetOverFlowedElements(){this._overFlowedElements.forEach((t=>{t.classList.remove(v)})),this._hiddenActionsList=[],this._overFlowedElements=[]}doOverFlowElements(t){t.forEach((t=>{t.classList.add(v),this._overFlowedElements.push(t),this.addItemToActionList(t)}))}addItemToActionList(t){const s=this.getTaskbarElementName(t);if(s&&this.isEnabled(s)&&this.isAllowed(s)){const i={value:s,label:this.getTaskbarElementLabel(t),iconName:this.getTaskbarElementIcon(t)};this._hiddenActionsList.push(i)}}getTaskbarElementName(t){var s;return null!==(s=t.getAttribute("data-taskbar-element"))&&void 0!==s?s:""}getTaskbarElementIcon(t){var s;return null!==(s=t.getAttribute("data-taskbar-icon"))&&void 0!==s?s:""}getTaskbarElementLabel(t){var s;return null!==(s=t.getAttribute("data-taskbar-label"))&&void 0!==s?s:""}hasToIgnoreOverFlow(t){return t.classList.contains(this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME)}handleOverFlowStrategy(){"hiddenItems"===this.overflowStrategy&&(this._overFlowWatcher=new u(this.buildOverFlowWatcherParams()))}buildOverFlowWatcherParams(){return{element:this._element,callback:this.handleOverFlow.bind(this),overFlowDirection:c.HORIZONTAL,notOverFlow:this.NOT_OVERFLOW_ELEMENTS}}componentDidLoad(){k.addIDInfo(this._element,null,{dataUnit:this.dataUnit}),this.handleOverFlowStrategy(),this.dataUnit.subscribe(this.onSaveEvent)}componentDidRender(){this.appendCustomElementsInTaskbar(),this.updateLastWidth()}updateLastWidth(){this._lastWidth=this._element.getBoundingClientRect().width}disconnectedCallback(){var t,s;null===(t=this.dataUnit)||void 0===t||t.unsubscribe(this.onSaveEvent),this.unlinkAllCustomElements(),null===(s=this._overFlowWatcher)||void 0===s||s.destroy()}unlinkAllCustomElements(){var t;null===(t=this._customElementsId)||void 0===t||t.forEach((t=>{const s=t.replace(this.TASKBAR_ITEM_ID_PREFIX,""),i=this._customElements.get(s);this.unlinkCustomElementFromTaskbar(i)}))}unlinkCustomElementFromTaskbar(t){this._slotContainer.appendChild(t)}render(){var t;if(void 0===this._definitions)return;let s=0;return i(e,{class:this.getHostClasses()},this.removeEmpty(this._definitions.map((t=>{var e,a;return s++,b[t]?this.getElement(s,b[t]):(null===(e=this.customButtons)||void 0===e?void 0:e.has(t))?this.getElement(s,this.customButtons.get(t)):this._customElements.has(t)?this.addCustomElementContainer(t):(null===(a=this._overFlowWatcher)||void 0===a||a.addNotOverFlowElement(t),i("slot",{name:t}))}))),i("div",{id:this.TASKBAR_CUSTOM_ELEMENTS,class:this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME},i("slot",{name:this.customSlotId}),null===(t=this._overFlowWatcher)||void 0===t?void 0:t.addNotOverFlowElement(this.TASKBAR_CUSTOM_ELEMENTS)))}getHostClasses(){return"hiddenItems"!==this.overflowStrategy?"no-wrap":"full-width "+(this.alignRigth?"align-right":"")}get _element(){return a(this)}static get watchers(){return{buttons:["observeButtons"],disabledButtons:["observeDisabledButtons"],_lastWidth:["observeLastWidth"],_isWaitingForSave:["observeIsWaitingForSave"]}}};E.style=".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";export{E as snk_taskbar}