@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
@@ -108,6 +108,48 @@ export function buildGuides(config, mainArea) {
108
108
  tabs = initializeTabsNames(tabs);
109
109
  return handleMainTab(tabs, mainArea);
110
110
  }
111
+ export function buildChildrenGuides(dataUnit, initialOrderIndex = 0, guidesList) {
112
+ var _a;
113
+ if (!dataUnit || !dataUnit.metadata) {
114
+ return [];
115
+ }
116
+ const children = ((_a = dataUnit.metadata) === null || _a === void 0 ? void 0 : _a.children) || [];
117
+ const childrenWithNoGuide = [];
118
+ for (const child of children) {
119
+ const guideOnConfig = guidesList.find(guide => child.label === guide.label);
120
+ if (guideOnConfig) {
121
+ guideOnConfig.isCustom = true;
122
+ continue;
123
+ }
124
+ childrenWithNoGuide.push({
125
+ label: child.label,
126
+ name: child.name,
127
+ visible: true,
128
+ isCustom: true,
129
+ order: initialOrderIndex++
130
+ });
131
+ }
132
+ return childrenWithNoGuide;
133
+ }
134
+ export function buildCustomGuides(customGuidesList, guidesList) {
135
+ let initialOrderIndex = guidesList.length;
136
+ const customGuidesToAdd = getCustomGuidesNotIncludedInList(customGuidesList, guidesList);
137
+ return customGuidesToAdd.map(guide => {
138
+ return {
139
+ name: guide.id,
140
+ label: guide.label,
141
+ visible: true,
142
+ isCustom: true,
143
+ order: initialOrderIndex++
144
+ };
145
+ });
146
+ }
147
+ function isCustomGuideIncludedInList(guidesList, guide) {
148
+ return guidesList.some(fromList => fromList.name === guide.id || fromList.label === guide.label);
149
+ }
150
+ function getCustomGuidesNotIncludedInList(customGuidesList, guidesList) {
151
+ return customGuidesList.filter(guide => !isCustomGuideIncludedInList(guidesList, guide));
152
+ }
111
153
  function handleFieldsTabNames(allFields) {
112
154
  // Campos que não fazem parte de nenhuma aba ou da aba "Geral", devem ser movidos para a aba __main.
113
155
  return allFields.map(field => {
@@ -1,5 +1,5 @@
1
- import { ConfigStorage } from '../../lib/configs/ConfigStorage';
2
1
  import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
2
+ import { ConfigStorage } from '../../lib/configs/ConfigStorage';
3
3
  import { FormConfigFetcher } from '../../lib/http/data-fetcher/fetchers/form-config-fetcher';
4
4
  import { TAB_NAMES } from '../../lib/utils/constants';
5
5
  export class SnkFormConfigManager {
@@ -82,7 +82,7 @@ export class SnkFormConfigManager {
82
82
  return false;
83
83
  }
84
84
  getFieldsList(descriptionFilter, forceEmptyConfig = false) {
85
- var _a;
85
+ var _a, _b;
86
86
  const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
87
87
  const hasConfig = this.hasConfig();
88
88
  if (hasConfig && !forceEmptyConfig) {
@@ -98,7 +98,7 @@ export class SnkFormConfigManager {
98
98
  })
99
99
  .filter(field => this.isFieldVisible(field, descriptionFilter));
100
100
  }
101
- if (!this._dataUnit) {
101
+ if (!this._dataUnit || !((_b = this._dataUnit.metadata) === null || _b === void 0 ? void 0 : _b.fields)) {
102
102
  return [];
103
103
  }
104
104
  const filteredFields = this._dataUnit.metadata.fields
@@ -178,7 +178,7 @@ export class SnkFormConfigManager {
178
178
  return Array.isArray(object) ? object : [object];
179
179
  }
180
180
  buildFormMetadataUITabs(config, forceEmptyConfig = false) {
181
- var _a;
181
+ var _a, _b, _c;
182
182
  const hasConfig = this.hasConfig(config);
183
183
  if (!forceEmptyConfig && (!this._dataUnit || hasConfig)) {
184
184
  return config;
@@ -187,10 +187,10 @@ export class SnkFormConfigManager {
187
187
  config.tabs = this.parseObjectList(config.tabs);
188
188
  config.emptyConfig = false;
189
189
  config.defaultConfiguration = true;
190
- const fields = this._dataUnit.metadata.fields;
190
+ const fields = (_b = (_a = this._dataUnit.metadata) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : [];
191
191
  for (const currentField of fields) {
192
192
  const field = config.fields.find(field => field.name === currentField.name);
193
- const uiTabName = (_a = currentField.properties) === null || _a === void 0 ? void 0 : _a.UITabName;
193
+ const uiTabName = (_c = currentField.properties) === null || _c === void 0 ? void 0 : _c.UITabName;
194
194
  if (!uiTabName || uiTabName === TAB_NAMES.main) {
195
195
  continue;
196
196
  }
@@ -119,6 +119,22 @@
119
119
  font-weight: 500;
120
120
  }
121
121
 
122
+ .message-container {
123
+ margin: auto;
124
+ display: flex;
125
+ flex-direction: column;
126
+ justify-content: center;
127
+ align-items: center;
128
+ }
129
+
130
+ .message-config-detail {
131
+ display: block;
132
+ margin: auto;
133
+ font-size: var(--font-size--medium, 16px);
134
+ color: #AFB6C0;
135
+ font-weight: var(--font-weight--medium, 500);
136
+ }
137
+
122
138
  .ghost {
123
139
  opacity: .5;
124
140
  background: #c8fbe2;
@@ -1,9 +1,9 @@
1
- import { forceUpdate, h, Host, } from '@stencil/core';
2
1
  import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
2
+ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
3
+ import { forceUpdate, h, Host, } from '@stencil/core';
3
4
  import Sortable from 'sortablejs';
4
- import { getFieldsStructure, ID_AVAILABLE_FIELDS, SORTABLE_PATH, } from '../FormConfigHelper';
5
5
  import { GROUP_NAMES, TAB_NAMES } from '../../../lib/utils/constants';
6
- import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
6
+ import { getFieldsStructure, ID_AVAILABLE_FIELDS, SORTABLE_PATH, } from '../FormConfigHelper';
7
7
  export class FieldLayoutComponent {
8
8
  constructor() {
9
9
  this.ID_GROUPS = 'container-groups';
@@ -320,6 +320,9 @@ export class FieldLayoutComponent {
320
320
  if (!this.selectedGuide) {
321
321
  return (h(Host, { class: 'ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container' }, h("span", { class: 'no-guide-selected' }, this.getMessage('snkFormConfig.form.noGuideSelected'))));
322
322
  }
323
+ if (this.selectedGuide.isCustom || this.selectedGuide.isDetail) {
324
+ return (h(Host, { class: 'ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container' }, h("div", { class: 'message-container' }, h("h1", { class: 'no-guide-selected' }, this.getMessage('snkFormConfig.form.canNotEditCustomGuide')), h("span", { class: 'message-config-detail' }, this.getMessage('snkFormConfig.form.canNotEditDetailGuide')))));
325
+ }
323
326
  return (h(Host, { class: 'ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container' }, this.renderGuideName(), h("div", { class: 'layout-container' }, h("ez-scroller", { direction: 'vertical', activeShadow: true }, h("div", { class: 'no-group-container' }, h("div", { id: GROUP_NAMES.noGroup, class: 'group-content', "data-group-name": GROUP_NAMES.noGroup }, this.renderFixedFields())), h("hr", null), h("div", { id: this.ID_GROUPS, class: 'groups-container' }, this.renderDraggableGroups()))), h("div", { class: 'add-group-container', onClick: this.handleAddGroup.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus" }), h("span", null, this.getMessage('snkFormConfig.form.createNewGroup')))));
324
327
  }
325
328
  static get is() { return "fields-layout"; }
@@ -91,13 +91,13 @@
91
91
  .guide-item .actions {
92
92
  display: flex;
93
93
  gap: 8px;
94
- transition: 0.2s ease-in-out;
95
- visibility: hidden;
94
+ transition: opacity 0.2s ease-in-out;
95
+ display: none;
96
96
  opacity: 0;
97
97
  }
98
98
 
99
99
  .guide-item:hover .actions {
100
- visibility: visible;
100
+ display: flex;
101
101
  opacity: 1;
102
102
  }
103
103
 
@@ -1,7 +1,7 @@
1
- import { h } from '@stencil/core';
2
- import Sortable from 'sortablejs';
3
1
  import { ArrayUtils, ObjectUtils } from '@sankhyalabs/core';
4
2
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
3
+ import { h } from '@stencil/core';
4
+ import Sortable from 'sortablejs';
5
5
  import { TAB_NAMES } from '../../../lib/utils/constants';
6
6
  export class GuidesConfigurator {
7
7
  constructor() {
@@ -92,7 +92,9 @@ export class GuidesConfigurator {
92
92
  var _a;
93
93
  return (h("div", { key: guide.name, "data-guide-name": guide.name, title: guide.label, class: `guide-item ${((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.label) === guide.label ? 'selected' : ''} ${this.filterTerm.length ? 'disable-sort' : ''}`, onClick: e => this.handleSelectGuide(guide, e) }, h("span", null, h("ez-icon", { iconName: "drag-indicator", class: 'ez-margin-right--small' })), h("span", { class: 'item-label' }, guide.label), h("div", { class: 'actions' }, h("ez-button", { mode: "icon", class: "ez-button--tertiary", onClick: e => this.toggleGuideVisibility(guide, e), size: "medium", iconName: guide.visible ? 'eye-off' : 'eye', title: guide.visible ?
94
94
  this.getMessage('snkFormConfig.guidesConfigurator.actions.hide') :
95
- this.getMessage('snkFormConfig.guidesConfigurator.actions.show') }), h("ez-button", { mode: "icon", class: "ez-button--tertiary", onClick: e => this.handleDeleteGuide(guide, e), size: "medium", iconName: 'delete', title: this.getMessage('snkFormConfig.guidesConfigurator.actions.delete') }))));
95
+ this.getMessage('snkFormConfig.guidesConfigurator.actions.show') }), h("ez-button", { mode: "icon", class: "ez-button--tertiary", onClick: e => this.handleDeleteGuide(guide, e), size: "medium", isDisabled: guide.isCustom || guide.isDetail, iconName: 'delete', title: guide.isCustom || guide.isDetail ?
96
+ this.getMessage('snkFormConfig.guidesConfigurator.canNotDeleteCustomGuide') :
97
+ this.getMessage('snkFormConfig.guidesConfigurator.actions.delete') }))));
96
98
  });
97
99
  }
98
100
  getContainerElement(id) {
@@ -1,10 +1,10 @@
1
- import { h, Host } from '@stencil/core';
2
1
  import { ApplicationContext, ObjectUtils } from '@sankhyalabs/core';
3
2
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
4
- import { updateTabInFieldsFromGroupList, buildGuides, buildGuidesMap, buildNewGuideName, getFieldsToSave, } from './FormConfigHelper';
5
- import { GROUP_NAMES, TAB_NAMES } from '../../lib/utils/constants';
3
+ import { h, Host } from '@stencil/core';
6
4
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
7
5
  import { UserConfigType } from '../../lib/http/data-fetcher/fetchers/form-config-fetcher';
6
+ import { GROUP_NAMES, TAB_NAMES } from '../../lib/utils/constants';
7
+ import { buildChildrenGuides, buildCustomGuides, buildGuides, buildGuidesMap, buildNewGuideName, getFieldsToSave, updateTabInFieldsFromGroupList, } from './FormConfigHelper';
8
8
  export class SnkFormConfig {
9
9
  constructor() {
10
10
  this.guidesMap = new Map();
@@ -22,6 +22,7 @@ export class SnkFormConfig {
22
22
  this.configManager = undefined;
23
23
  this.ignoreReadOnlyFormFields = undefined;
24
24
  this.messagesBuilder = undefined;
25
+ this.customGuidesConfig = [];
25
26
  }
26
27
  handleFieldConfigChanged() {
27
28
  this.hasChanges = true;
@@ -41,6 +42,10 @@ export class SnkFormConfig {
41
42
  this.showNoGuideSelectedDialog();
42
43
  return;
43
44
  }
45
+ if (this.selectedGuide.isCustom || this.selectedGuide.isDetail) {
46
+ this.showCanNotAddFieldToGuideDialog();
47
+ return;
48
+ }
44
49
  this.availableFields = [...this.availableFields.filter(f => f.name !== fieldItem.name)];
45
50
  await ((_a = this.refFieldsLayout) === null || _a === void 0 ? void 0 : _a.addFieldToLayout(fieldItem));
46
51
  }
@@ -66,6 +71,11 @@ export class SnkFormConfig {
66
71
  const message = this.getMessage('snkFormConfig.noGuideSelected.message');
67
72
  ApplicationUtils.alert(title, message);
68
73
  }
74
+ showCanNotAddFieldToGuideDialog() {
75
+ const title = this.getMessage('snkFormConfig.canNotAddFieldToGuide.title');
76
+ const message = this.getMessage('snkFormConfig.canNotAddFieldToGuide.message');
77
+ ApplicationUtils.alert(title, message);
78
+ }
69
79
  /**
70
80
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
71
81
  * através de um pequeno modulo na estrutura da aplicação:
@@ -83,8 +93,8 @@ export class SnkFormConfig {
83
93
  this.configOptions = userConfig;
84
94
  const isDefault = this._formConfig != undefined ? this._formConfig.defaultConfiguration : true;
85
95
  const origin = (isDefault ? UserConfigType.DEFAULT : UserConfigType.USER);
86
- this.configSelected = userConfig.find((config) => config.origin === origin);
87
- this.originalConfigSelected = userConfig.find((config) => config.origin === origin);
96
+ this.configSelected = userConfig === null || userConfig === void 0 ? void 0 : userConfig.find((config) => config.origin === origin);
97
+ this.originalConfigSelected = userConfig === null || userConfig === void 0 ? void 0 : userConfig.find((config) => config.origin === origin);
88
98
  }
89
99
  catch (error) {
90
100
  console.error(this.getMessage('snkFormConfig.errors.failFetchUserConfig'));
@@ -137,9 +147,22 @@ export class SnkFormConfig {
137
147
  return fieldVisible === true && hasCfg === false;
138
148
  });
139
149
  }
150
+ getInitialOrder(guidesList) {
151
+ var _a, _b;
152
+ if (Array.isArray((_a = this._formConfig) === null || _a === void 0 ? void 0 : _a.tabs)) {
153
+ return (_b = this._formConfig.tabs) === null || _b === void 0 ? void 0 : _b.length;
154
+ }
155
+ if (guidesList.length > 0) {
156
+ return Math.max(...guidesList.map(g => g.order));
157
+ }
158
+ return 0;
159
+ }
140
160
  loadGuides() {
141
161
  var _a;
142
- this.guidesList = [...buildGuides(this._formConfig, this.getMessage('snkFormConfig.form.mainArea'))];
162
+ this.guidesList = [];
163
+ this.guidesList.push(...buildGuides(this._formConfig, this.getMessage('snkFormConfig.form.mainArea')));
164
+ this.guidesList.push(...buildChildrenGuides(this.dataUnit, this.getInitialOrder(this.guidesList), this.guidesList));
165
+ this.guidesList.push(...buildCustomGuides(this.customGuidesConfig, this.guidesList));
143
166
  this.guidesMap = buildGuidesMap((_a = this._formConfig) === null || _a === void 0 ? void 0 : _a.fields, this.guidesList, this.dataUnit, this.getMessage('snkFormConfig.form.tabGeneral'));
144
167
  }
145
168
  getConfig() {
@@ -368,6 +391,30 @@ export class SnkFormConfig {
368
391
  "tags": [],
369
392
  "text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
370
393
  }
394
+ },
395
+ "customGuidesConfig": {
396
+ "type": "unknown",
397
+ "mutable": false,
398
+ "complexType": {
399
+ "original": "Array<CustomGuideItem>",
400
+ "resolved": "CustomGuideItem[]",
401
+ "references": {
402
+ "Array": {
403
+ "location": "global"
404
+ },
405
+ "CustomGuideItem": {
406
+ "location": "import",
407
+ "path": "../snk-crud/subcomponents/snk-guides-viewer"
408
+ }
409
+ }
410
+ },
411
+ "required": false,
412
+ "optional": true,
413
+ "docs": {
414
+ "tags": [],
415
+ "text": "Informa\u00E7\u00F5es das guias personalizadas."
416
+ },
417
+ "defaultValue": "[]"
371
418
  }
372
419
  };
373
420
  }
@@ -9,6 +9,8 @@
9
9
  width: 100%;
10
10
  padding: var(--snk-grid-padding);
11
11
  outline: none;
12
+
13
+ --snk-grid-header--min-height: 40px;
12
14
  }
13
15
 
14
16
  .snk-grid__header {
@@ -16,15 +18,27 @@
16
18
  display: flex;
17
19
  flex-wrap: nowrap;
18
20
  justify-content: flex-end;
21
+ align-items: flex-start;
22
+ min-height: var(--snk-grid-header--min-height);
19
23
  }
20
24
 
21
25
  .snk-grid__filter-bar {
22
26
  width: 100%;
27
+ display: flex;
28
+ align-items: flex-start;
23
29
  }
24
30
 
25
31
  .snk-grid__header-divider {
26
32
  /*public*/
27
33
  margin-bottom: var(--space--medium);
34
+ margin-top: var(--space--small);
35
+ align-self: stretch;
36
+ }
37
+
38
+ .snk-grid__header snk-taskbar {
39
+ display: flex;
40
+ align-items: flex-start;
41
+ min-height: var(--snk-grid-header--min-height);
28
42
  }
29
43
 
30
44
  .snk-grid__table {
@@ -55,6 +55,7 @@ export class SnkGrid {
55
55
  this._popUpGridConfig = false;
56
56
  this._showSnkFilterBar = true;
57
57
  this._enableContinuousInsert = false;
58
+ this._filterMode = 'regular';
58
59
  this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
59
60
  this.enableLockManagerLoadingComp = false;
60
61
  this.enableLockManagerTaskbarClick = false;
@@ -74,6 +75,7 @@ export class SnkGrid {
74
75
  this.canEdit = true;
75
76
  this.taskbarCustomContainerId = undefined;
76
77
  this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
78
+ this.gridHeaderDynamicSearchSlotId = 'GRID_HEADER_DYNAMIC_SEARCH';
77
79
  this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
78
80
  this.disablePersonalizedFilter = undefined;
79
81
  this.gridLegacyConfigName = undefined;
@@ -572,7 +574,8 @@ export class SnkGrid {
572
574
  return;
573
575
  }
574
576
  if (filterConfig.length === 1 && filterConfig[0].id === 'PERSONALIZED_FILTER_GROUP') {
575
- this._showSnkFilterBar = filterConfig[0].groupedItems.length > 0;
577
+ this._showSnkFilterBar = true;
578
+ this._filterMode = filterConfig[0].groupedItems.length > 0 ? 'regular' : 'button';
576
579
  return;
577
580
  }
578
581
  this._showSnkFilterBar = true;
@@ -590,9 +593,9 @@ export class SnkGrid {
590
593
  return undefined;
591
594
  }
592
595
  return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large ez-box--no-outline", tabindex: "0" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
593
- h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, filterCustomConfig: this.filterCustomConfig, filterCustomConfigInterceptor: this.filterCustomConfigInterceptor }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium ez-padding-top--extra-small", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none', actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? 'snk-grid-container__without-shadow ' : '') + 'snk-grid__table', "data-element-id": "embedded", dataUnit: this._dataUnit, key: 'grid-' + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => {
596
+ h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, filterCustomConfig: this.filterCustomConfig, filterCustomConfigInterceptor: this.filterCustomConfigInterceptor, mode: this._filterMode }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium ez-padding-top--extra-small", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none', actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? 'snk-grid-container__without-shadow ' : '') + 'snk-grid__table', "data-element-id": "embedded", dataUnit: this._dataUnit, key: 'grid-' + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => {
594
597
  this.gridConfigChangeHandler(evt);
595
- }, onEzColumnFilterChanged: async () => await this.dataExporterProviderStore(), onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode, useSearchColumn: this.useSearchColumn, suppressHorizontalScroll: this.suppressHorizontalScroll, paginationCounterMode: this.paginationCounterMode, suppressCheckboxColumn: this.suppressCheckboxColumn, suppressFilterColumn: this.suppressFilterColumn, compact: this.compact }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId, actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, opened: this._popUpGridConfig, onEzClosePopup: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
598
+ }, onEzColumnFilterChanged: async () => await this.dataExporterProviderStore(), onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode, useSearchColumn: this.useSearchColumn, suppressHorizontalScroll: this.suppressHorizontalScroll, paginationCounterMode: this.paginationCounterMode, suppressCheckboxColumn: this.suppressCheckboxColumn, suppressFilterColumn: this.suppressFilterColumn, compact: this.compact }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId, additionalSlotId: this.gridHeaderDynamicSearchSlotId, actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.gridHeaderCustomSlotId }), h("slot", { name: this.gridHeaderDynamicSearchSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-popup", { size: "medium", heightMode: "auto", useHeader: false, opened: this._popUpGridConfig, onEzClosePopup: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
596
599
  }
597
600
  static get is() { return "snk-grid"; }
598
601
  static get encapsulation() { return "scoped"; }
@@ -974,6 +977,24 @@ export class SnkGrid {
974
977
  "reflect": false,
975
978
  "defaultValue": "'GRID_HEADER_CUSTOM_ELEMENTS'"
976
979
  },
980
+ "gridHeaderDynamicSearchSlotId": {
981
+ "type": "string",
982
+ "mutable": false,
983
+ "complexType": {
984
+ "original": "string",
985
+ "resolved": "string",
986
+ "references": {}
987
+ },
988
+ "required": false,
989
+ "optional": false,
990
+ "docs": {
991
+ "tags": [],
992
+ "text": "Define o nome do slot para a aba de pesquisa no cabe\u00E7alho da grade."
993
+ },
994
+ "attribute": "grid-header-dynamic-search-slot-id",
995
+ "reflect": false,
996
+ "defaultValue": "'GRID_HEADER_DYNAMIC_SEARCH'"
997
+ },
977
998
  "topTaskbarCustomSlotId": {
978
999
  "type": "string",
979
1000
  "mutable": false,
@@ -1331,7 +1352,8 @@ export class SnkGrid {
1331
1352
  "_gridConfig": {},
1332
1353
  "_popUpGridConfig": {},
1333
1354
  "_showSnkFilterBar": {},
1334
- "_enableContinuousInsert": {}
1355
+ "_enableContinuousInsert": {},
1356
+ "_filterMode": {}
1335
1357
  };
1336
1358
  }
1337
1359
  static get events() {
@@ -7,7 +7,7 @@ export class SnkLayoutFormConfig {
7
7
  constructor() {
8
8
  this._formConfigFetcher = new FormConfigFetcher();
9
9
  this.messagesBuilder = undefined;
10
- this.layoutType = FormLayout.CASCADE;
10
+ this.layoutType = FormLayout.SIDE_BY_SIDE;
11
11
  }
12
12
  /**
13
13
  * Salva o tipo de layout escolhido. Sem retorno.
@@ -26,7 +26,14 @@ export class SnkLayoutFormConfig {
26
26
  if (!this._LayoutFormConfigSingleton)
27
27
  return;
28
28
  const { config } = this._LayoutFormConfigSingleton;
29
- this.layoutType = Number(config) in FormLayout ? Number(config) : FormLayout.CASCADE;
29
+ if (config == null) {
30
+ this.layoutType = FormLayout.SIDE_BY_SIDE;
31
+ return;
32
+ }
33
+ const configAsNumber = Number(config);
34
+ this.layoutType = Object.values(FormLayout).includes(configAsNumber)
35
+ ? configAsNumber
36
+ : FormLayout.SIDE_BY_SIDE;
30
37
  }
31
38
  toggleLayout(key) {
32
39
  this.layoutType = key;
@@ -43,6 +43,10 @@
43
43
  /*@doc Define a largura da barra de rolagem do componente.*/
44
44
  --snk-pesquisa__scrollbar--width: var(--space--small, 6px);
45
45
 
46
+ /*@doc Define o tamanho do conteúdo scrollável do popup */
47
+ --snk-pesquisa__scrollable-content--height: calc(100vh - 300px);
48
+
49
+
46
50
  height: 100%;
47
51
  display: flex;
48
52
  flex-direction: column;
@@ -79,7 +83,7 @@
79
83
  /*public*/
80
84
  scrollbar-color: var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);
81
85
  padding-right: var(--snk-pesquisa__content--padding-right);
82
- height: 100vh;
86
+ height: var(--snk-pesquisa__scrollable-content--height);
83
87
  }
84
88
 
85
89
  .snk-pesquisa__content::-webkit-scrollbar {
@@ -33,6 +33,17 @@ export class SnkPesquisa {
33
33
  this._textInput.value = this.argument;
34
34
  }
35
35
  }
36
+ /** * Executa uma pesquisa programaticamente.
37
+ * Útil para cenários onde a pesquisa precisa ser disparada sem interação do usuário.
38
+ *
39
+ * @param text Texto utilizado como argumento de pesquisa.
40
+ * @example
41
+ * await pesquisaRef.executeSearch("Texto para pesquisa");
42
+ */
43
+ async executeSearch(text) {
44
+ this.argument = text;
45
+ this.onChangeValue({ detail: text });
46
+ }
36
47
  clearSearch() {
37
48
  this.argument = "";
38
49
  this._itemList = undefined;
@@ -606,6 +617,38 @@ export class SnkPesquisa {
606
617
  "_valideDataSource": {}
607
618
  };
608
619
  }
620
+ static get methods() {
621
+ return {
622
+ "executeSearch": {
623
+ "complexType": {
624
+ "signature": "(text: string) => Promise<void>",
625
+ "parameters": [{
626
+ "tags": [{
627
+ "name": "param",
628
+ "text": "text Texto utilizado como argumento de pesquisa."
629
+ }],
630
+ "text": "Texto utilizado como argumento de pesquisa."
631
+ }],
632
+ "references": {
633
+ "Promise": {
634
+ "location": "global"
635
+ }
636
+ },
637
+ "return": "Promise<void>"
638
+ },
639
+ "docs": {
640
+ "text": "* Executa uma pesquisa programaticamente.\n\u00DAtil para cen\u00E1rios onde a pesquisa precisa ser disparada sem intera\u00E7\u00E3o do usu\u00E1rio.",
641
+ "tags": [{
642
+ "name": "param",
643
+ "text": "text Texto utilizado como argumento de pesquisa."
644
+ }, {
645
+ "name": "example",
646
+ "text": "await pesquisaRef.executeSearch(\"Texto para pesquisa\");"
647
+ }]
648
+ }
649
+ }
650
+ };
651
+ }
609
652
  static get elementRef() { return "_element"; }
610
653
  static get watchers() {
611
654
  return [{
@@ -157,11 +157,10 @@ export class SnkSimpleCrud {
157
157
  }
158
158
  getButtons(selected, extraButtons, removeRefresh) {
159
159
  let btnList = selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS;
160
- if (removeRefresh) {
160
+ if (removeRefresh || this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
161
161
  btnList = btnList.filter(item => item !== TaskbarElement.REFRESH);
162
162
  }
163
- return this.addConfigButton(this.resolveInMemoryBtns(btnList)
164
- .concat(extraButtons));
163
+ return this.addConfigButton(btnList.concat(extraButtons));
165
164
  }
166
165
  addConfigButton(buttons) {
167
166
  if (this.configName === undefined || (this.configName && this.gridLegacyConfigName)) {
@@ -172,13 +171,6 @@ export class SnkSimpleCrud {
172
171
  get application() {
173
172
  return ApplicationContext.getContextValue("__SNK__APPLICATION__");
174
173
  }
175
- resolveInMemoryBtns(taskbarButtons) {
176
- const newTaskBarConfig = [...taskbarButtons];
177
- if (this.mode === SIMPLE_CRUD_MODE.IN_MEMORY) {
178
- newTaskBarConfig.splice(1, 1);
179
- }
180
- return newTaskBarConfig;
181
- }
182
174
  /**
183
175
  * @description Usado para alternar a visão entre GRID e FORM externamente.
184
176
  * @param {VIEW_MODE} view - A visão para a qual navegar.
@@ -879,7 +871,7 @@ export class SnkSimpleCrud {
879
871
  },
880
872
  "dataState": {
881
873
  "type": "unknown",
882
- "mutable": false,
874
+ "mutable": true,
883
875
  "complexType": {
884
876
  "original": "DataState",
885
877
  "resolved": "DataState",