@sankhyalabs/sankhyablocks 10.1.0-dev.37 → 10.1.0-dev.38

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 (225) hide show
  1. package/dist/cjs/{ConfigStorage-e384fb7b.js → ConfigStorage-a1fab5ca.js} +2 -2
  2. package/dist/cjs/ContinuousInsertUtils-1ae0c6ac.js +41 -0
  3. package/dist/cjs/{DataFetcher-3a8ea521.js → DataFetcher-384d2ce8.js} +1 -1
  4. package/dist/cjs/{ISave-a66bb65e.js → ISave-ecbe9336.js} +1 -1
  5. package/dist/cjs/{ImageUtils-5e3f406b.js → ImageUtils-c46f2d11.js} +1 -1
  6. package/dist/cjs/{SnkFormConfigManager-73df0f8b.js → SnkFormConfigManager-44386305.js} +2 -2
  7. package/dist/cjs/{SnkMessageBuilder-d9558dba.js → SnkMessageBuilder-a9300ebe.js} +24 -0
  8. package/dist/cjs/{SnkMultiSelectionListDataSource-016393f3.js → SnkMultiSelectionListDataSource-b951ed91.js} +61 -47
  9. package/dist/cjs/{auth-fetcher-80e608b0.js → auth-fetcher-6b134ec4.js} +1 -1
  10. package/dist/cjs/{dataunit-fetcher-6febd6c4.js → dataunit-fetcher-93f53260.js} +2 -2
  11. package/dist/cjs/{form-config-fetcher-81cbd405.js → form-config-fetcher-45d1964c.js} +1 -1
  12. package/dist/cjs/index-1894343a.js +8 -8
  13. package/dist/cjs/loader.cjs.js +1 -1
  14. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +5 -5
  15. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  16. package/dist/cjs/{snk-actions-button_8.cjs.entry.js → snk-actions-button_9.cjs.entry.js} +52 -12
  17. package/dist/cjs/snk-application.cjs.entry.js +7 -7
  18. package/dist/cjs/snk-attach.cjs.entry.js +50 -24
  19. package/dist/cjs/snk-crud.cjs.entry.js +349 -109
  20. package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -7
  21. package/dist/cjs/{snk-data-unit-94757628.js → snk-data-unit-6abc5efc.js} +2 -2
  22. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
  23. package/dist/cjs/snk-detail-view.cjs.entry.js +11 -16
  24. package/dist/cjs/snk-entity-search.cjs.entry.js +211 -0
  25. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
  26. package/dist/cjs/{snk-filter-advanced-mode_2.cjs.entry.js → snk-filter-advanced-mode_3.cjs.entry.js} +39 -1
  27. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +106 -95
  28. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +4 -4
  29. package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
  30. package/dist/cjs/snk-form_2.cjs.entry.js +5 -5
  31. package/dist/cjs/snk-grid.cjs.entry.js +40 -17
  32. package/dist/cjs/{snk-guides-viewer-688c4398.js → snk-guides-viewer-b4ca3437.js} +37 -153
  33. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -17
  34. package/dist/cjs/snk-image-input.cjs.entry.js +2 -2
  35. package/dist/cjs/snk-layout-form-config.cjs.entry.js +5 -5
  36. package/dist/cjs/snk-personalized-filter.cjs.entry.js +5 -5
  37. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  38. package/dist/cjs/snk-simple-crud.cjs.entry.js +12 -12
  39. package/dist/cjs/snk-taskbar.cjs.entry.js +181 -124
  40. package/dist/cjs/taskbar-elements-80eddec8.js +152 -0
  41. package/dist/collection/collection-manifest.json +2 -0
  42. package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -3
  43. package/dist/collection/components/snk-attach/snk-attach.css +29 -7
  44. package/dist/collection/components/snk-attach/snk-attach.js +81 -18
  45. package/dist/collection/components/snk-crud/snk-crud.css +46 -0
  46. package/dist/collection/components/snk-crud/snk-crud.js +148 -94
  47. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -5
  48. package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.css +17 -0
  49. package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.js +330 -0
  50. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +22 -8
  51. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +35 -144
  52. package/dist/collection/components/snk-crud/utils/taskbarUtils.js +144 -0
  53. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +1 -1
  54. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +20 -1
  55. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +2 -2
  56. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +23 -1
  57. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +6 -1
  58. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +8 -5
  59. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -6
  60. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +139 -84
  61. package/dist/collection/components/snk-grid/snk-grid.css +12 -3
  62. package/dist/collection/components/snk-grid/snk-grid.js +148 -4
  63. package/dist/collection/components/snk-image-input/utils/ImageUtils.js +1 -1
  64. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -1
  65. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +8 -0
  66. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +38 -2
  67. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +51 -35
  68. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js +27 -1
  69. package/dist/collection/components/snk-taskbar/processor/simple-taskbar-processor.js +55 -0
  70. package/dist/collection/components/snk-taskbar/snk-taskbar.css +44 -1
  71. package/dist/collection/components/snk-taskbar/snk-taskbar.js +248 -132
  72. package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.css +12 -0
  73. package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.js +19 -0
  74. package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js +8 -0
  75. package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js +8 -0
  76. package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js +8 -0
  77. package/dist/components/ContinuousInsertUtils.js +1 -1
  78. package/dist/components/SnkMessageBuilder.js +24 -0
  79. package/dist/components/index.d.ts +2 -0
  80. package/dist/components/index.js +2 -0
  81. package/dist/components/snk-actions-button2.js +6 -3
  82. package/dist/components/snk-attach2.js +56 -27
  83. package/dist/components/snk-crud.js +427 -175
  84. package/dist/components/snk-data-exporter2.js +3 -1
  85. package/dist/components/snk-detail-view2.js +158 -258
  86. package/dist/components/snk-entity-search.d.ts +11 -0
  87. package/dist/components/snk-entity-search.js +6 -0
  88. package/dist/components/snk-entity-search2.js +231 -0
  89. package/dist/components/snk-exporter-email-sender2.js +1 -1
  90. package/dist/components/snk-filter-bar2.js +94 -85
  91. package/dist/components/snk-filter-item2.js +4 -2
  92. package/dist/components/snk-filter-modal2.js +8 -5
  93. package/dist/components/snk-grid2.js +82 -47
  94. package/dist/components/snk-image-input2.js +1 -1
  95. package/dist/components/snk-personalized-filter2.js +1 -1
  96. package/dist/components/snk-simple-crud2.js +29 -23
  97. package/dist/components/snk-taskbar-skeleton.d.ts +11 -0
  98. package/dist/components/snk-taskbar-skeleton.js +6 -0
  99. package/dist/components/snk-taskbar-skeleton2.js +29 -0
  100. package/dist/components/snk-taskbar2.js +253 -174
  101. package/dist/components/taskbar-actions-button2.js +21 -2
  102. package/dist/components/taskbar-split-button2.js +10 -1
  103. package/dist/esm/{ConfigStorage-82ff76fb.js → ConfigStorage-76872695.js} +2 -2
  104. package/dist/esm/ContinuousInsertUtils-bce77dc1.js +39 -0
  105. package/dist/esm/{DataFetcher-1dd7e8c0.js → DataFetcher-e60f8d53.js} +1 -1
  106. package/dist/esm/{ISave-498c4831.js → ISave-4929c071.js} +1 -1
  107. package/dist/esm/{ImageUtils-8fc8d905.js → ImageUtils-7f3a4149.js} +1 -1
  108. package/dist/esm/{SnkFormConfigManager-e8ae1561.js → SnkFormConfigManager-83f6b22f.js} +2 -2
  109. package/dist/esm/{SnkMessageBuilder-c0bc4424.js → SnkMessageBuilder-1eb7a1af.js} +24 -0
  110. package/dist/esm/{SnkMultiSelectionListDataSource-ec783ded.js → SnkMultiSelectionListDataSource-7fe25a58.js} +55 -41
  111. package/dist/esm/{auth-fetcher-38a83f5e.js → auth-fetcher-1a31c1e4.js} +1 -1
  112. package/dist/esm/{dataunit-fetcher-21c43ec7.js → dataunit-fetcher-050b6d31.js} +2 -2
  113. package/dist/esm/{form-config-fetcher-24eb587c.js → form-config-fetcher-b44b2727.js} +1 -1
  114. package/dist/esm/index-04f73a26.js +8 -8
  115. package/dist/esm/loader.js +1 -1
  116. package/dist/esm/pesquisa-grid_2.entry.js +5 -5
  117. package/dist/esm/sankhyablocks.js +1 -1
  118. package/dist/esm/{snk-actions-button_8.entry.js → snk-actions-button_9.entry.js} +52 -13
  119. package/dist/esm/snk-application.entry.js +7 -7
  120. package/dist/esm/snk-attach.entry.js +50 -24
  121. package/dist/esm/snk-crud.entry.js +338 -98
  122. package/dist/esm/snk-data-exporter.entry.js +8 -7
  123. package/dist/esm/{snk-data-unit-3b06a0f3.js → snk-data-unit-ca2c9858.js} +2 -2
  124. package/dist/esm/snk-data-unit.entry.js +4 -4
  125. package/dist/esm/snk-detail-view.entry.js +11 -16
  126. package/dist/esm/snk-entity-search.entry.js +207 -0
  127. package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
  128. package/dist/esm/{snk-filter-advanced-mode_2.entry.js → snk-filter-advanced-mode_3.entry.js} +40 -3
  129. package/dist/esm/snk-filter-bar_4.entry.js +107 -96
  130. package/dist/esm/snk-filter-modal-item.entry.js +4 -4
  131. package/dist/esm/snk-form-view.entry.js +1 -1
  132. package/dist/esm/snk-form_2.entry.js +5 -5
  133. package/dist/esm/snk-grid.entry.js +37 -14
  134. package/dist/esm/{snk-guides-viewer-6ddc7e6a.js → snk-guides-viewer-cc37535b.js} +38 -154
  135. package/dist/esm/snk-guides-viewer.entry.js +9 -17
  136. package/dist/esm/snk-image-input.entry.js +2 -2
  137. package/dist/esm/snk-layout-form-config.entry.js +5 -5
  138. package/dist/esm/snk-personalized-filter.entry.js +5 -5
  139. package/dist/esm/snk-pesquisa.entry.js +5 -5
  140. package/dist/esm/snk-simple-crud.entry.js +10 -10
  141. package/dist/esm/snk-taskbar.entry.js +182 -125
  142. package/dist/esm/taskbar-elements-63651ca7.js +149 -0
  143. package/dist/sankhyablocks/p-09ba6bd4.js +1 -0
  144. package/dist/sankhyablocks/p-10f27dc6.entry.js +1 -0
  145. package/dist/sankhyablocks/{p-54f5c36d.entry.js → p-20af4b6a.entry.js} +1 -1
  146. package/dist/sankhyablocks/p-225f92cf.entry.js +1 -0
  147. package/dist/sankhyablocks/{p-605a2a99.entry.js → p-251aee41.entry.js} +1 -1
  148. package/dist/sankhyablocks/{p-bdf0077f.js → p-2af8aca3.js} +1 -1
  149. package/dist/sankhyablocks/p-3072136e.js +1 -0
  150. package/dist/sankhyablocks/p-33492640.entry.js +1 -0
  151. package/dist/sankhyablocks/{p-f208ec52.entry.js → p-35317d9a.entry.js} +1 -1
  152. package/dist/sankhyablocks/{p-6753f16e.js → p-3704bf1b.js} +1 -1
  153. package/dist/sankhyablocks/{p-2d606189.js → p-3870748a.js} +1 -1
  154. package/dist/sankhyablocks/{p-e057ecb6.js → p-3c990841.js} +1 -1
  155. package/dist/sankhyablocks/{p-4ff3b494.js → p-420b39b5.js} +1 -1
  156. package/dist/sankhyablocks/{p-8bb4e86b.entry.js → p-46f75667.entry.js} +1 -1
  157. package/dist/sankhyablocks/{p-32ad76cc.js → p-4f7adf97.js} +2 -2
  158. package/dist/sankhyablocks/p-554c0e54.js +1 -0
  159. package/dist/sankhyablocks/p-6ae7543b.entry.js +1 -0
  160. package/dist/sankhyablocks/p-771b137e.js +1 -0
  161. package/dist/sankhyablocks/p-77f608bc.entry.js +1 -0
  162. package/dist/sankhyablocks/p-7c8bf699.entry.js +1 -0
  163. package/dist/sankhyablocks/{p-d34a41ec.entry.js → p-8a8900a9.entry.js} +1 -1
  164. package/dist/sankhyablocks/{p-e484913b.entry.js → p-95af0bb1.entry.js} +1 -1
  165. package/dist/sankhyablocks/{p-10cad767.entry.js → p-98241c21.entry.js} +1 -1
  166. package/dist/sankhyablocks/{p-f5b929c2.entry.js → p-ab12f544.entry.js} +1 -1
  167. package/dist/sankhyablocks/{p-ef8cf0e2.js → p-ab5e12fa.js} +1 -1
  168. package/dist/sankhyablocks/p-ac384a1e.entry.js +1 -0
  169. package/dist/sankhyablocks/p-ac85f011.entry.js +1 -0
  170. package/dist/sankhyablocks/{p-3a98c337.entry.js → p-aff2d081.entry.js} +1 -1
  171. package/dist/sankhyablocks/p-b3b51693.entry.js +1 -0
  172. package/dist/sankhyablocks/{p-08415ef7.entry.js → p-bab4cde4.entry.js} +1 -1
  173. package/dist/sankhyablocks/p-ce3b284c.entry.js +1 -0
  174. package/dist/sankhyablocks/p-ce8ccd72.entry.js +1 -0
  175. package/dist/sankhyablocks/{p-b9970342.js → p-d972a9c1.js} +1 -1
  176. package/dist/sankhyablocks/p-e5a3711f.js +1 -0
  177. package/dist/sankhyablocks/{p-2b882835.entry.js → p-e737fd5a.entry.js} +1 -1
  178. package/dist/sankhyablocks/p-efd18bc2.entry.js +1 -0
  179. package/dist/sankhyablocks/{p-362e6e8c.js → p-f185d5ad.js} +1 -1
  180. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  181. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +4 -0
  182. package/dist/types/components/snk-attach/snk-attach.d.ts +20 -4
  183. package/dist/types/components/snk-crud/snk-crud.d.ts +28 -10
  184. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
  185. package/dist/types/components/snk-crud/subcomponents/snk-entity-search.d.ts +62 -0
  186. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +4 -18
  187. package/dist/types/components/snk-crud/utils/taskbarUtils.d.ts +13 -0
  188. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -0
  189. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +4 -0
  190. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +32 -20
  191. package/dist/types/components/snk-grid/snk-grid.d.ts +28 -1
  192. package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +6 -0
  193. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -2
  194. package/dist/types/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.d.ts +5 -0
  195. package/dist/types/components/snk-taskbar/processor/simple-taskbar-processor.d.ts +31 -0
  196. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +32 -21
  197. package/dist/types/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.d.ts +3 -0
  198. package/dist/types/components.d.ts +197 -4
  199. package/package.json +2 -2
  200. package/react/components.d.ts +2 -0
  201. package/react/components.js +2 -0
  202. package/react/components.js.map +1 -1
  203. package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -45
  204. package/dist/cjs/taskbar-elements-a94d4318.js +0 -133
  205. package/dist/cjs/taskbar-processor-2fba34a8.js +0 -53
  206. package/dist/esm/snk-simple-bar.entry.js +0 -41
  207. package/dist/esm/taskbar-elements-97541bdd.js +0 -130
  208. package/dist/esm/taskbar-processor-3436124c.js +0 -51
  209. package/dist/sankhyablocks/p-07aa8192.entry.js +0 -1
  210. package/dist/sankhyablocks/p-1a0caadb.js +0 -1
  211. package/dist/sankhyablocks/p-27aea149.entry.js +0 -1
  212. package/dist/sankhyablocks/p-27d6590e.js +0 -1
  213. package/dist/sankhyablocks/p-449e36d2.entry.js +0 -1
  214. package/dist/sankhyablocks/p-615655bd.entry.js +0 -1
  215. package/dist/sankhyablocks/p-62e17eea.entry.js +0 -1
  216. package/dist/sankhyablocks/p-6e1a7929.entry.js +0 -1
  217. package/dist/sankhyablocks/p-72d62f22.js +0 -1
  218. package/dist/sankhyablocks/p-9c1ff75e.entry.js +0 -1
  219. package/dist/sankhyablocks/p-a8c5ebf1.entry.js +0 -1
  220. package/dist/sankhyablocks/p-b25777fa.entry.js +0 -1
  221. package/dist/sankhyablocks/p-b6d47f08.entry.js +0 -1
  222. package/dist/sankhyablocks/p-b8453e18.js +0 -1
  223. package/dist/sankhyablocks/p-c8043a53.entry.js +0 -1
  224. package/dist/sankhyablocks/p-f0c9969e.entry.js +0 -1
  225. package/dist/sankhyablocks/p-fc5938fb.js +0 -1
@@ -1,11 +1,16 @@
1
- import { ApplicationContext, Action as DUAction, ElementIDUtils, KeyboardManager, StringUtils } from '@sankhyalabs/core';
1
+ import { Action as DUAction, ApplicationContext, ElementIDUtils, KeyboardManager, StringUtils, } from '@sankhyalabs/core';
2
2
  import { h, Host } from '@stencil/core';
3
3
  import { PresentationMode } from '../../lib';
4
4
  import { ExporterStrategy } from '../../lib/@types';
5
5
  import { AutorizationType } from '../../lib/http/data-fetcher/fetchers/auth-fetcher';
6
6
  import { VIEW_MODE } from '../../lib/utils/constants';
7
- import { ServicesNumberingConfig } from '../snk-numbering-config/services/ServicesNumberingConfig';
7
+ import { ServicesNumberingConfig, } from '../snk-numbering-config/services/ServicesNumberingConfig';
8
8
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
9
+ import SimpleTaskbarProcessor from '../snk-taskbar/processor/simple-taskbar-processor';
10
+ import { buildNativeTaskbarManager, CustomTaskbarButton, DEFAULT_TASKBAR_BUTTONS, getHeaderTaskbarId, getTopTaskBarId, } from './utils/taskbarUtils';
11
+ import { validateFilters } from '../snk-filter-bar/utils/filter-validate';
12
+ import { buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
13
+ import { ContinuousInsertUtils } from '../../lib/utils/ContinuousInsertUtils';
9
14
  /**
10
15
  * É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
11
16
  * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
@@ -16,44 +21,18 @@ export class SnkCrud {
16
21
  this._viewHistory = [];
17
22
  this._customEditors = new Map();
18
23
  this._customRenders = new Map();
19
- this.loadEntitySuggestions = async (argument) => {
20
- var _a;
21
- const value = (_a = argument === null || argument === void 0 ? void 0 : argument.argument) !== null && _a !== void 0 ? _a : '';
22
- const mode = (argument === null || argument === void 0 ? void 0 : argument.mode) || "PREDICTIVE";
23
- if (!value || value.trim().length === 0) {
24
- return [];
25
- }
26
- try {
27
- this._showMoreOnSearch = false;
28
- const entityName = this._snkDataUnit.entityName;
29
- if (mode === "PREDICTIVE") {
30
- return await this.handlePredictiveSearch(value, entityName);
31
- }
32
- return await this._application.executePreparedSearch(mode, value, this.buildSearchOptions(entityName));
33
- }
34
- catch (error) {
35
- console.error('Erro ao carregar sugestões de entidades:', error);
36
- return [];
37
- }
38
- };
39
- this.searchEntitySelect = async (item) => {
40
- if (!this._entityPKField || !item) {
41
- return;
42
- }
43
- try {
44
- const pk = [{ name: this._entityPKField, value: item.value }];
45
- await this.refreshDataUnitByPk(pk);
46
- }
47
- catch (error) {
48
- console.error('Erro ao selecionar entidade:', error);
49
- }
50
- };
24
+ this._taskbarProcessor = new SimpleTaskbarProcessor(DEFAULT_TASKBAR_BUTTONS);
25
+ this._taskbarCustomProcessor = new SimpleTaskbarProcessor([]);
51
26
  this.dataUnitInterceptor = {
52
- interceptAction: (action) => {
53
- if (action.type === DUAction.DATA_SAVED) {
54
- action = this.interceptDataSaved(action);
27
+ interceptAction: async (action) => {
28
+ switch (action.type) {
29
+ case DUAction.DATA_SAVED:
30
+ return this.interceptDataSaved(action);
31
+ case DUAction.LOADING_DATA:
32
+ return await this.interceptLoadData(action);
33
+ default:
34
+ return action;
55
35
  }
56
- return action;
57
36
  },
58
37
  };
59
38
  this._dataUnit = undefined;
@@ -64,8 +43,9 @@ export class SnkCrud {
64
43
  this._resourceID = undefined;
65
44
  this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
66
45
  this.numberingConfig = undefined;
67
- this._showMoreOnSearch = false;
68
- this._entityPKField = undefined;
46
+ this._filterMode = 'regular';
47
+ this._enableContinuousInsert = false;
48
+ this._headerVisible = true;
69
49
  this.enableLockManagerLoadingComp = false;
70
50
  this.enableLockManagerTaskbarClick = false;
71
51
  this.configName = undefined;
@@ -98,6 +78,9 @@ export class SnkCrud {
98
78
  this.showEntitySearch = true;
99
79
  this.disableNumberingConfig = false;
100
80
  }
81
+ handleActionClick(evt) {
82
+ this.executeAction(evt.detail);
83
+ }
101
84
  /**
102
85
  * Usado para alternar a visão entre GRID e FORM externamente.
103
86
  */
@@ -195,6 +178,7 @@ export class SnkCrud {
195
178
  this.setViewMode(VIEW_MODE.FORM);
196
179
  }
197
180
  async executeAction(act) {
181
+ var _a;
198
182
  switch (act) {
199
183
  case TaskbarElement.GRID_MODE:
200
184
  return this.setViewMode(VIEW_MODE.GRID);
@@ -207,13 +191,13 @@ export class SnkCrud {
207
191
  case TaskbarElement.CONFIGURATOR:
208
192
  return this._snkConfigurator.open();
209
193
  case TaskbarElement.ATTACH:
210
- return this.setViewMode(VIEW_MODE.ATTACHMENT);
194
+ return this._snkAttach.open();
195
+ case CustomTaskbarButton.FILTER:
196
+ return (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.showFilterModal();
197
+ case CustomTaskbarButton.ENTITY_SEARCH:
198
+ return this.openSearchPopover();
211
199
  }
212
200
  }
213
- backView() {
214
- const lastView = this._viewHistory.at(-2) || VIEW_MODE.GRID;
215
- this.setViewMode(lastView);
216
- }
217
201
  setViewMode(viewMode) {
218
202
  this._viewStack.show(viewMode);
219
203
  this._currentViewMode = viewMode;
@@ -275,6 +259,16 @@ export class SnkCrud {
275
259
  this._customEditors.delete(fieldName);
276
260
  }
277
261
  }
262
+ initializeTaskbarProcessor() {
263
+ const nativeTaskbarManager = buildNativeTaskbarManager(this._currentViewMode, this.taskbarManager, this.messagesBuilder);
264
+ const topTaskbarId = getTopTaskBarId(this._dataState, this.presentationMode);
265
+ this._taskbarProcessor.process(topTaskbarId, nativeTaskbarManager, this._dataState, undefined, []);
266
+ const headerTaskbarId = getHeaderTaskbarId(this._dataState, this.presentationMode);
267
+ this._taskbarCustomProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, undefined, []);
268
+ }
269
+ componentWillRender() {
270
+ this.initializeTaskbarProcessor();
271
+ }
278
272
  componentDidRender() {
279
273
  this.setCustomRenders();
280
274
  this.setCustomEditors();
@@ -310,6 +304,7 @@ export class SnkCrud {
310
304
  if (!this.configName) {
311
305
  this.configName = this._application.configName;
312
306
  }
307
+ this.initContinuousInsertUtils();
313
308
  }
314
309
  componentDidLoad() {
315
310
  this.initKeyboardManager();
@@ -392,49 +387,6 @@ export class SnkCrud {
392
387
  var _a;
393
388
  (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
394
389
  }
395
- async handlePredictiveSearch(argument, entityName) {
396
- var _a, _b;
397
- const response = await this._application.executePreparedSearchWithFullResponse(argument, this.buildSearchOptions(entityName, 5));
398
- this._showMoreOnSearch = (_a = response === null || response === void 0 ? void 0 : response.hasMore) !== null && _a !== void 0 ? _a : false;
399
- this._entityPKField = response === null || response === void 0 ? void 0 : response.pkField;
400
- return (_b = response === null || response === void 0 ? void 0 : response.data) !== null && _b !== void 0 ? _b : [];
401
- }
402
- async refreshDataUnitByPk(pks) {
403
- try {
404
- const pkField = pks[0].name;
405
- const pkValue = pks[0].value;
406
- // Criar filtro para a busca específica
407
- const quickFilter = {
408
- term: '',
409
- filter: {
410
- name: '',
411
- params: [],
412
- expression: `(${pkField} = ${pkValue})`
413
- }
414
- };
415
- // Carregar dados com o filtro aplicado diretamente
416
- await this._dataUnit.loadData(quickFilter);
417
- // Navegar para o formulário se houver apenas um registro
418
- if (this._dataUnit.records.length === 1) {
419
- this._dataUnit.selectFirst();
420
- this.gridToForm(true);
421
- }
422
- }
423
- catch (error) {
424
- console.error('Erro ao atualizar dataset:', error);
425
- }
426
- }
427
- buildSearchOptions(entityName, limit) {
428
- return {
429
- entity: entityName,
430
- entityDescription: entityName,
431
- executeOnOpen: true,
432
- searchOptions: {
433
- localEntityName: entityName,
434
- limit,
435
- }
436
- };
437
- }
438
390
  async toggleView() {
439
391
  const currentView = await this._viewStack.getSelectedIndex();
440
392
  this.setViewMode(VIEW_MODE.GRID === currentView ? VIEW_MODE.FORM : VIEW_MODE.GRID);
@@ -478,6 +430,17 @@ export class SnkCrud {
478
430
  this.updateNumberingConfigAfterInsert(action);
479
431
  return action;
480
432
  }
433
+ async interceptLoadData(action) {
434
+ var _a;
435
+ const hasInvalidFilters = !validateFilters((_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig);
436
+ if (hasInvalidFilters) {
437
+ const errorTitle = this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.title", {});
438
+ const errorMessage = this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.message", {});
439
+ await this._application.error(errorTitle, errorMessage);
440
+ return;
441
+ }
442
+ return action;
443
+ }
481
444
  onDataUnitReady() {
482
445
  var _a;
483
446
  (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.addInterceptor(this.dataUnitInterceptor);
@@ -497,6 +460,12 @@ export class SnkCrud {
497
460
  }
498
461
  this.onDataUnitReady();
499
462
  }
463
+ initContinuousInsertUtils() {
464
+ this._continuousInsertUtils = new ContinuousInsertUtils(this._application, this._resourceID, this.configName);
465
+ if (this.enableGridInsert) {
466
+ this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
467
+ }
468
+ }
500
469
  async loadNumberingConfig() {
501
470
  if (this.numberingConfig || !this._snkDataUnit || !this._snkDataUnit.entityName || this.disableNumberingConfig) {
502
471
  return;
@@ -546,18 +515,93 @@ export class SnkCrud {
546
515
  return;
547
516
  return this.customGuidesConfig.map(g => h("slot", { name: g.id }));
548
517
  }
549
- renderDynamicSearch(slotName) {
518
+ getColumnSearch(item) {
519
+ if (this._columnSearch != undefined) {
520
+ return this._columnSearch;
521
+ }
522
+ this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
523
+ this._snkGrid.filterColumns(argument).then((columns) => {
524
+ accept(columns
525
+ .filter(column => !column.hidden)
526
+ .map(column => ({ label: column.label, value: column.name })));
527
+ });
528
+ }), (option) => {
529
+ if (option != undefined) {
530
+ this._snkGrid.locateColumn(option.value);
531
+ }
532
+ });
533
+ return this._columnSearch;
534
+ }
535
+ buildTaskbarCustomActionsList() {
536
+ return [this.buildSearchColumnTaskbarAction()];
537
+ }
538
+ buildSearchColumnTaskbarAction() {
539
+ return {
540
+ value: StringUtils.generateUUID(),
541
+ label: this.messagesBuilder.getMessage('snkGrid.findColumn', {}),
542
+ disableCloseOnSelect: true,
543
+ eagerInitialize: true,
544
+ itemBuilder: (_, item) => this.getColumnSearch(item),
545
+ };
546
+ }
547
+ isGridInsertActive() {
548
+ return this.enableGridInsert && this._dataUnit.hasNewRecord();
549
+ }
550
+ getActionsList() {
551
+ const hardList = [];
552
+ if (this.enableGridInsert) {
553
+ hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
554
+ this._enableContinuousInsert = !this._enableContinuousInsert;
555
+ this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
556
+ }));
557
+ }
558
+ if (this.isGridInsertActive())
559
+ return hardList;
560
+ if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
561
+ const taskbarID = getTopTaskBarId(this._dataState, this.presentationMode);
562
+ return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this._dataState, this.actionsList));
563
+ }
564
+ return hardList.concat(this.actionsList);
565
+ }
566
+ async openSearchPopover() {
567
+ if (!this._popoverSearchEntity) {
568
+ return;
569
+ }
570
+ const buttonElement = this._element.querySelector(`[data-taskbar-element="${CustomTaskbarButton.ENTITY_SEARCH}"]`);
571
+ await this._popoverSearchEntity.showUnder(buttonElement);
572
+ }
573
+ handleLoadedSearch(evt) {
574
+ if (evt.detail.length === 1) {
575
+ this._dataUnit.selectFirst();
576
+ this.gridToForm(true);
577
+ }
578
+ }
579
+ renderDynamicSearch() {
550
580
  var _a;
551
- if (!this.showEntitySearch || ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) === true)
581
+ if (!this.showEntitySearch)
552
582
  return;
553
- return (h("div", { slot: slotName, class: "entity-search-container", style: { position: 'relative', display: 'inline-block', marginLeft: '10px', minWidth: '200px' } }, h("ez-search", { label: "Buscar registros", optionLoader: this.loadEntitySuggestions, onEzChange: (evt) => this.searchEntitySelect(evt.detail), mode: "slim", showMore: this._showMoreOnSearch, suppressEmptyOption: true, suppressInputPersist: true })));
583
+ return (h("snk-entity-search", { ref: (ref) => this._popoverSearchEntity = ref, dataUnit: this._dataUnit, entityName: (_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.entityName, messagesBuilder: this.messagesBuilder, onLoaded: (evt) => this.handleLoadedSearch(evt) }));
584
+ }
585
+ handleFilterConfigUpdated(filterConfig) {
586
+ if (!filterConfig.length) {
587
+ return;
588
+ }
589
+ if (filterConfig.length === 1 && filterConfig[0].id === 'PERSONALIZED_FILTER_GROUP') {
590
+ this._filterMode = filterConfig[0].groupedItems.length > 0 ? 'regular' : 'button';
591
+ return;
592
+ }
554
593
  }
555
594
  render() {
595
+ var _a;
556
596
  if (this._resourceID == undefined) {
557
597
  return;
558
598
  }
559
599
  this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
560
- return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }), this.renderDynamicSearch("GRID_HEADER_DYNAMIC_SEARCH"))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), this.renderDynamicSearch("GUIDES_VIEWER_DYNAMIC_SEARCH"), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", { tabIndex: "0" }, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
600
+ return (h(Host, null, h("header", { class: { 'snk-crud--hidden': !this._headerVisible } }, h("div", { class: "snk-crud__header-top" }, h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' }), h("div", { class: "snk-crud__header-bottom" }, h("ez-record-navigation", { dataUnit: this._dataUnit, primaryKeys: this._dataUnit.metadata.fields.filter(field => field.properties['isPrimaryKey']).map(field => field.name), textPosition: 'left', disabled: (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty, class: {
601
+ "snk-crud--hidden": this._currentViewMode === VIEW_MODE.GRID
602
+ } }))), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("ez-grid-pagination", { dataUnit: this._dataUnit, paginationCounterMode: this.paginationCounterMode, onPageChange: () => this._snkGrid.handlePageChange(), paginationTextPosition: "left", buttonsSize: "medium", class: {
603
+ "snk-crud--hidden": this._currentViewMode !== VIEW_MODE.GRID
604
+ } }), h("stack-item", { class: 'snk-crud__grid-stack-item' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), 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, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), h("slot", { name: "SnkFormTaskBar" })))), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
561
605
  }
562
606
  static get is() { return "snk-crud"; }
563
607
  static get encapsulation() { return "scoped"; }
@@ -1166,8 +1210,9 @@ export class SnkCrud {
1166
1210
  "_resourceID": {},
1167
1211
  "customContainerId": {},
1168
1212
  "numberingConfig": {},
1169
- "_showMoreOnSearch": {},
1170
- "_entityPKField": {}
1213
+ "_filterMode": {},
1214
+ "_enableContinuousInsert": {},
1215
+ "_headerVisible": {}
1171
1216
  };
1172
1217
  }
1173
1218
  static get events() {
@@ -1557,4 +1602,13 @@ export class SnkCrud {
1557
1602
  "methodName": "currentViewModeWatcher"
1558
1603
  }];
1559
1604
  }
1605
+ static get listeners() {
1606
+ return [{
1607
+ "name": "actionClick",
1608
+ "method": "handleActionClick",
1609
+ "target": undefined,
1610
+ "capture": false,
1611
+ "passive": false
1612
+ }];
1613
+ }
1560
1614
  }
@@ -194,9 +194,6 @@ export class SnkDetailView {
194
194
  this.snkSwitchGuide.emit(guideId);
195
195
  }
196
196
  }
197
- handleAttachBack() {
198
- this._viewStack.show(VIEW_MODE.GRID);
199
- }
200
197
  executeActionHandler(evt) {
201
198
  if (evt.detail === TaskbarElement.GRID_MODE) {
202
199
  this.emitSwitchEvent(VIEW_MODE.GRID);
@@ -207,7 +204,7 @@ export class SnkDetailView {
207
204
  evt.stopPropagation();
208
205
  }
209
206
  if (evt.detail === TaskbarElement.ATTACH) {
210
- this._viewStack.show(VIEW_MODE.ATTACHMENT);
207
+ this._snkAttach.open();
211
208
  evt.stopPropagation();
212
209
  }
213
210
  }
@@ -302,7 +299,7 @@ export class SnkDetailView {
302
299
  render() {
303
300
  this.updateLabel();
304
301
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
305
- return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: false, enableGridInsert: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), fieldToFocus: this._fieldToGetFocus, label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems), onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch, entityPath: this.entityName }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS", actionsSettingsList: this.getSettingsListForm() }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
302
+ return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: false, enableGridInsert: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), fieldToFocus: this._fieldToGetFocus, label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems), onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch, entityPath: this.entityName }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS", actionsSettingsList: this.getSettingsListForm() }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))))), h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName }))));
306
303
  }
307
304
  static get is() { return "snk-detail-view"; }
308
305
  static get encapsulation() { return "scoped"; }
@@ -0,0 +1,17 @@
1
+ .entity-search-popover {
2
+ width: 432px;
3
+
4
+ font-family: var(--font-pattern, "Roboto");
5
+ color: var(--color--gray-600, #1C1D22);
6
+ text-shadow: 0 0 var(--color--gray-500, #494A4E), 0 0 1px transparent;
7
+ font-size: var(--font-size--large, 18px);
8
+
9
+ padding: var(--space--24, 24px);
10
+ max-width: 430px;
11
+ display: flex;
12
+ flex-direction: column;
13
+ }
14
+
15
+ .entity-search-popover label {
16
+ margin-bottom: var(--space--16, 16px);
17
+ }