@sankhyalabs/sankhyablocks 6.4.2 → 6.6.0

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 (180) hide show
  1. package/dist/cjs/{PersonalizedFilterUtils-7d959e91.js → PersonalizedFilterUtils-cfcd9af2.js} +47 -10
  2. package/dist/cjs/{SnkMessageBuilder-aec46b5d.js → SnkMessageBuilder-ba6d4ade.js} +4 -1
  3. package/dist/cjs/{index-614af008.js → index-0e663819.js} +0 -36
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  6. package/dist/cjs/snk-actions-button.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-application.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  9. package/dist/cjs/snk-crud.cjs.entry.js +4 -3
  10. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
  11. package/dist/cjs/{snk-data-unit-ba0c368c.js → snk-data-unit-5f434275.js} +1 -1
  12. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  13. package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
  14. package/dist/cjs/snk-expression-group.cjs.entry.js +21 -17
  15. package/dist/cjs/snk-expression-item_3.cjs.entry.js +21 -31
  16. package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -16
  17. package/dist/cjs/snk-filter-detail.cjs.entry.js +11 -7
  18. package/dist/cjs/snk-filter-item.cjs.entry.js +16 -7
  19. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +10 -8
  20. package/dist/cjs/snk-filter-modal.cjs.entry.js +13 -7
  21. package/dist/cjs/snk-grid.cjs.entry.js +4 -3
  22. package/dist/cjs/{snk-guides-viewer-7bedfa91.js → snk-guides-viewer-27586701.js} +2 -2
  23. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  24. package/dist/cjs/{snk-filter-personalized.cjs.entry.js → snk-personalized-filter-editor.cjs.entry.js} +35 -12
  25. package/dist/cjs/snk-personalized-filter.cjs.entry.js +24 -13
  26. package/dist/cjs/snk-simple-crud.cjs.entry.js +2 -2
  27. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
  28. package/dist/cjs/{taskbar-elements-7f91f4cd.js → taskbar-elements-b98dd6e9.js} +1 -1
  29. package/dist/collection/collection-manifest.json +1 -1
  30. package/dist/collection/components/snk-crud/snk-crud.js +22 -1
  31. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +1 -1
  32. package/dist/collection/components/snk-filter-bar/filter-item/editors/{snk-filter-personalized/snk-filter-personalized.js → snk-personalized-filter-editor/snk-personalized-filter-editor.js} +36 -13
  33. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +9 -5
  34. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +16 -7
  35. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +11 -5
  36. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +10 -8
  37. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +4 -5
  38. package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +2 -12
  39. package/dist/collection/components/snk-grid/snk-grid.js +22 -1
  40. package/dist/collection/components/snk-personalized-filter/interfaces/index.js +39 -0
  41. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +24 -12
  42. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +25 -21
  43. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +7 -7
  44. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +3 -3
  45. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +6 -6
  46. package/dist/collection/lib/@types/index.js +0 -36
  47. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +4 -1
  48. package/dist/components/PersonalizedFilterUtils.js +49 -7
  49. package/dist/components/SnkMessageBuilder.js +4 -1
  50. package/dist/components/index.d.ts +1 -1
  51. package/dist/components/index.js +1 -1
  52. package/dist/components/index2.js +1 -37
  53. package/dist/components/snk-crud.js +3 -1
  54. package/dist/components/snk-expression-group2.js +22 -23
  55. package/dist/components/snk-expression-item2.js +4 -4
  56. package/dist/components/snk-filter-bar2.js +5 -7
  57. package/dist/components/snk-filter-detail2.js +9 -5
  58. package/dist/components/snk-filter-field-search2.js +2 -12
  59. package/dist/components/snk-filter-item2.js +16 -7
  60. package/dist/components/snk-filter-modal-item2.js +10 -8
  61. package/dist/components/snk-filter-modal.js +11 -5
  62. package/dist/components/snk-filter-param-config2.js +1 -2
  63. package/dist/components/snk-grid2.js +3 -1
  64. package/dist/components/snk-personalized-filter-editor.d.ts +11 -0
  65. package/dist/components/{snk-filter-personalized.js → snk-personalized-filter-editor.js} +42 -19
  66. package/dist/components/snk-personalized-filter2.js +25 -13
  67. package/dist/esm/{PersonalizedFilterUtils-202cd721.js → PersonalizedFilterUtils-1a167d89.js} +44 -7
  68. package/dist/esm/{SnkMessageBuilder-a4f7d858.js → SnkMessageBuilder-9d2becfb.js} +4 -1
  69. package/dist/esm/index-1564817d.js +33 -0
  70. package/dist/esm/loader.js +1 -1
  71. package/dist/esm/sankhyablocks.js +1 -1
  72. package/dist/esm/snk-actions-button.entry.js +1 -1
  73. package/dist/esm/snk-application.entry.js +1 -1
  74. package/dist/esm/snk-attach.entry.js +2 -2
  75. package/dist/esm/snk-crud.entry.js +4 -3
  76. package/dist/esm/snk-data-exporter.entry.js +3 -3
  77. package/dist/esm/{snk-data-unit-3ecaf52c.js → snk-data-unit-ca4bcba6.js} +1 -1
  78. package/dist/esm/snk-data-unit.entry.js +2 -2
  79. package/dist/esm/snk-detail-view.entry.js +4 -4
  80. package/dist/esm/snk-expression-group.entry.js +21 -17
  81. package/dist/esm/snk-expression-item_3.entry.js +7 -17
  82. package/dist/esm/snk-filter-bar.entry.js +6 -7
  83. package/dist/esm/snk-filter-detail.entry.js +11 -7
  84. package/dist/esm/snk-filter-item.entry.js +16 -7
  85. package/dist/esm/snk-filter-modal-item.entry.js +10 -8
  86. package/dist/esm/snk-filter-modal.entry.js +13 -7
  87. package/dist/esm/snk-grid.entry.js +4 -3
  88. package/dist/esm/{snk-guides-viewer-9240c017.js → snk-guides-viewer-950dd3b5.js} +2 -2
  89. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  90. package/dist/esm/{snk-filter-personalized.entry.js → snk-personalized-filter-editor.entry.js} +35 -12
  91. package/dist/esm/snk-personalized-filter.entry.js +24 -13
  92. package/dist/esm/snk-simple-crud.entry.js +2 -2
  93. package/dist/esm/snk-taskbar.entry.js +2 -2
  94. package/dist/esm/{taskbar-elements-139b1058.js → taskbar-elements-2c761819.js} +1 -1
  95. package/dist/sankhyablocks/{p-ab33e180.js → p-01070d6d.js} +1 -1
  96. package/dist/sankhyablocks/p-25df01a1.entry.js +1 -0
  97. package/dist/sankhyablocks/p-30134b16.entry.js +1 -0
  98. package/dist/sankhyablocks/{p-09f33525.entry.js → p-402db136.entry.js} +1 -1
  99. package/dist/sankhyablocks/p-40a5d35e.entry.js +1 -0
  100. package/dist/sankhyablocks/p-5534e08c.js +1 -0
  101. package/dist/sankhyablocks/{p-257aeea4.entry.js → p-5e06e139.entry.js} +1 -1
  102. package/dist/sankhyablocks/{p-43485c54.js → p-602dfb9e.js} +1 -1
  103. package/dist/sankhyablocks/{p-78a226a1.js → p-6f4f88ef.js} +1 -1
  104. package/dist/sankhyablocks/p-775e60f5.entry.js +1 -0
  105. package/dist/sankhyablocks/p-7c10486f.entry.js +1 -0
  106. package/dist/sankhyablocks/{p-a1cab141.entry.js → p-7c50ded4.entry.js} +1 -1
  107. package/dist/sankhyablocks/p-7d68a43a.js +1 -0
  108. package/dist/sankhyablocks/p-7f37b801.entry.js +1 -0
  109. package/dist/sankhyablocks/p-86e10ecc.entry.js +1 -0
  110. package/dist/sankhyablocks/p-88a40b96.entry.js +1 -0
  111. package/dist/sankhyablocks/{p-f1edaec0.js → p-a2493d11.js} +1 -1
  112. package/dist/sankhyablocks/p-b6f9f702.entry.js +1 -0
  113. package/dist/sankhyablocks/{p-6564f621.entry.js → p-c2d3e4fb.entry.js} +1 -1
  114. package/dist/sankhyablocks/{p-2adb4481.entry.js → p-c6380ea2.entry.js} +1 -1
  115. package/dist/sankhyablocks/{p-0d670404.entry.js → p-c7c4ed56.entry.js} +1 -1
  116. package/dist/sankhyablocks/{p-e8be0aae.entry.js → p-ca29b093.entry.js} +1 -1
  117. package/dist/sankhyablocks/p-d881cab2.entry.js +1 -0
  118. package/dist/sankhyablocks/p-d9586ead.entry.js +1 -0
  119. package/dist/sankhyablocks/p-f8ce17d3.entry.js +1 -0
  120. package/dist/sankhyablocks/{p-cea58f8b.entry.js → p-fdc262aa.entry.js} +1 -1
  121. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  122. package/dist/types/components/snk-crud/snk-crud.d.ts +5 -0
  123. package/dist/types/components/snk-filter-bar/filter-item/editors/{snk-filter-personalized/snk-filter-personalized.d.ts → snk-personalized-filter-editor/snk-personalized-filter-editor.d.ts} +8 -25
  124. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +2 -0
  125. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +3 -0
  126. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +2 -1
  127. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +3 -1
  128. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -0
  129. package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +0 -1
  130. package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
  131. package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionItem.d.ts +1 -1
  132. package/dist/types/components/snk-personalized-filter/interfaces/IParameter.d.ts +37 -0
  133. package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IUserFilterConfig.d.ts +1 -1
  134. package/dist/types/components/snk-personalized-filter/interfaces/index.d.ts +35 -0
  135. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +3 -1
  136. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +5 -2
  137. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +1 -1
  138. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +2 -1
  139. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.d.ts +1 -1
  140. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +2 -2
  141. package/dist/types/components.d.ts +79 -62
  142. package/dist/types/lib/@types/index.d.ts +0 -32
  143. package/dist/types/lib/configs/ConfigStorage.d.ts +1 -1
  144. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +1 -1
  145. package/package.json +2 -2
  146. package/react/components.d.ts +1 -1
  147. package/react/components.js +1 -1
  148. package/react/components.js.map +1 -1
  149. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.js +0 -3
  150. package/dist/components/snk-filter-personalized.d.ts +0 -11
  151. package/dist/esm/index-a255b326.js +0 -69
  152. package/dist/sankhyablocks/p-0364abc8.entry.js +0 -1
  153. package/dist/sankhyablocks/p-18e3a2b7.entry.js +0 -1
  154. package/dist/sankhyablocks/p-19ae873b.entry.js +0 -1
  155. package/dist/sankhyablocks/p-257e3eaf.entry.js +0 -1
  156. package/dist/sankhyablocks/p-36ecb6ab.js +0 -1
  157. package/dist/sankhyablocks/p-4374cc15.entry.js +0 -1
  158. package/dist/sankhyablocks/p-50c3700f.entry.js +0 -1
  159. package/dist/sankhyablocks/p-6ce48ae3.entry.js +0 -1
  160. package/dist/sankhyablocks/p-7add855c.entry.js +0 -1
  161. package/dist/sankhyablocks/p-abc4ae66.entry.js +0 -1
  162. package/dist/sankhyablocks/p-c7dd701c.entry.js +0 -1
  163. package/dist/sankhyablocks/p-d5a25c7d.entry.js +0 -1
  164. package/dist/sankhyablocks/p-e962ce72.entry.js +0 -1
  165. package/dist/sankhyablocks/p-eb90de43.js +0 -1
  166. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.d.ts +0 -21
  167. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.d.ts +0 -3
  168. /package/dist/cjs/{IExpressionItem-1090c3fd.js → IExpressionItem-0e32ebb7.js} +0 -0
  169. /package/dist/collection/components/snk-filter-bar/filter-item/editors/{snk-filter-personalized/snk-filter-personalized.css → snk-personalized-filter-editor/snk-personalized-filter-editor.css} +0 -0
  170. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionGroup.js +0 -0
  171. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionItem.js +0 -0
  172. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IParameter.js +0 -0
  173. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IPersonalizedFilter.js +0 -0
  174. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/ISystemFilterConfig.js +0 -0
  175. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IUserFilterConfig.js +0 -0
  176. /package/dist/esm/{IExpressionItem-2e922b2c.js → IExpressionItem-21f225bf.js} +0 -0
  177. /package/dist/sankhyablocks/{p-c6bf66e0.js → p-63bff2a8.js} +0 -0
  178. /package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionGroup.d.ts +0 -0
  179. /package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IPersonalizedFilter.d.ts +0 -0
  180. /package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/ISystemFilterConfig.d.ts +0 -0
@@ -29,41 +29,5 @@ var DataExporterType;
29
29
  DataExporterType["EXPORT_PDF_TO_EMAIL"] = "PDF";
30
30
  DataExporterType["EXPORT_XLS_TO_EMAIL"] = "XLS";
31
31
  })(DataExporterType || (DataExporterType = {}));
32
- var FilterConfigType;
33
- (function (FilterConfigType) {
34
- FilterConfigType["SYSTEM_CONFIG"] = "S";
35
- FilterConfigType["USER_CONFIG"] = "E";
36
- })(FilterConfigType || (FilterConfigType = {}));
37
- var FilterUserConfigTypes;
38
- (function (FilterUserConfigTypes) {
39
- FilterUserConfigTypes["DATE"] = "D";
40
- FilterUserConfigTypes["HORA"] = "H";
41
- FilterUserConfigTypes["TEXT"] = "S";
42
- FilterUserConfigTypes["INTEGER"] = "I";
43
- FilterUserConfigTypes["DECIMAL"] = "F";
44
- FilterUserConfigTypes["NUMBER"] = "NUMBER";
45
- })(FilterUserConfigTypes || (FilterUserConfigTypes = {}));
46
- var FilterOperand;
47
- (function (FilterOperand) {
48
- FilterOperand["AND"] = "AND";
49
- FilterOperand["OR"] = "OR";
50
- FilterOperand["IN"] = "IN";
51
- FilterOperand["DIFFERENT"] = "<>";
52
- FilterOperand["LIKE"] = "LIKE";
53
- FilterOperand["START_WITH"] = "LIKE_START";
54
- FilterOperand["FINISHED_WITH"] = "LIKE_END";
55
- FilterOperand["NULL"] = "NULL";
56
- FilterOperand["NOT_NULL"] = "NOT NULL";
57
- FilterOperand["EQUAL"] = "=";
58
- FilterOperand["LARGER"] = ">";
59
- FilterOperand["LARGER_EQUAL"] = ">=";
60
- FilterOperand["SMALLER"] = "<";
61
- FilterOperand["SMALLER_EQUAL"] = "<=";
62
- })(FilterOperand || (FilterOperand = {}));
63
- var FilterEntities;
64
- (function (FilterEntities) {
65
- FilterEntities["FIELD"] = "Campo";
66
- FilterEntities["INSTANCE"] = "Instancia";
67
- })(FilterEntities || (FilterEntities = {}));
68
32
 
69
- export { DataExporterOption as D, FilterOperand as F, PresentationMode as P, DataExporterFormat as a, DataExporterType as b, FilterConfigType as c, FilterEntities as d, FilterUserConfigTypes as e };
33
+ export { DataExporterOption as D, PresentationMode as P, DataExporterFormat as a, DataExporterType as b };
@@ -47,6 +47,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
47
47
  this.attachmentRegisterKey = undefined;
48
48
  this._currentViewMode = VIEW_MODE.GRID;
49
49
  this.configName = undefined;
50
+ this.selectionToastConfig = undefined;
50
51
  this.showActionButtons = false;
51
52
  this.actionsList = undefined;
52
53
  this.taskbarManager = undefined;
@@ -184,7 +185,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
184
185
  this.configuratorCancel.emit();
185
186
  }
186
187
  render() {
187
- return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "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 }, 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, 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" }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, 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, 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') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
188
+ return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "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, selectionToastConfig: this.selectionToastConfig }, 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, 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" }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, 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, 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') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
188
189
  }
189
190
  get _element() { return this; }
190
191
  static get watchers() { return {
@@ -193,6 +194,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
193
194
  static get style() { return snkCrudCss; }
194
195
  }, [6, "snk-crud", {
195
196
  "configName": [1025, "config-name"],
197
+ "selectionToastConfig": [16],
196
198
  "showActionButtons": [4, "show-action-buttons"],
197
199
  "actionsList": [16],
198
200
  "taskbarManager": [16],
@@ -1,19 +1,13 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, forceUpdate, Host } from '@stencil/core/internal/client';
2
+ import { F as FilterGroupCondition } from './PersonalizedFilterUtils.js';
2
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
3
4
  import { ApplicationContext, StringUtils, ElementIDUtils } from '@sankhyalabs/core';
4
5
  import { d as defineCustomElement$3 } from './snk-expression-item2.js';
5
6
  import { d as defineCustomElement$2 } from './snk-filter-field-search2.js';
6
7
  import { d as defineCustomElement$1 } from './snk-filter-param-config2.js';
7
8
 
8
- var FilterGroupCondition;
9
- (function (FilterGroupCondition) {
10
- FilterGroupCondition["AND"] = "AND";
11
- FilterGroupCondition["OR"] = "OR";
12
- })(FilterGroupCondition || (FilterGroupCondition = {}));
13
-
14
9
  const snkExpressionGroupCss = ".sc-snk-expression-group-h{display:block;--snk-expression-group--container-condition--width:184px;--snk-expression-group--container-condition--height:38px;--snk-expression-group--container-condition--border-radius:var(--border--radius-medium, 12px);--snk-expression-group--container-option--width:85px;--snk-expression-group__container-condition--background-and:#66B6A0;--snk-expression-group__container-condition--background-or:#EBC65E;--snk-expression-group__container-expression--padding-left:26px;--snk-expression-group__background-color-dashed:var(--background--body, #fafcff)}.snk-expression-group__container-condition.sc-snk-expression-group{width:var(--snk-expression-group--container-condition--width);height:var(--snk-expression-group--container-condition--height);border-radius:var(--snk-expression-group--container-condition--border-radius);z-index:var(--more-visible--2x, 3)}.snk-expression-group__container-option.sc-snk-expression-group{width:var(--snk-expression-group--container-option--width)}.snk-expression-group__container-condition[data-condition=\"AND\"].sc-snk-expression-group{background-color:var(--snk-expression-group__container-condition--background-and)}.snk-expression-group__container-condition[data-condition=\"OR\"].sc-snk-expression-group{background-color:var(--snk-expression-group__container-condition--background-or)}.snk-expression-group__container-expression.sc-snk-expression-group{padding-left:var(--snk-expression-group__container-expression--padding-left)}.dashes.sc-snk-expression-group{z-index:var(--visible, 1);background:var(--snk-expression-group__background-color-dashed);border-left:2px dashed var(--text-secondary, #A2ABB9);position:absolute;width:15px;height:58px;margin-left:-15px;margin-top:-36.5px}.horizontal-dashes.sc-snk-expression-group{z-index:var(--more-visible, 2);border-bottom:2px dashed var(--text-secondary, #A2ABB9);position:absolute;width:15px;height:54px;margin-left:-15px;margin-top:-33.5px}.hidden.sc-snk-expression-group{display:none}";
15
10
 
16
- const LIMIT_GROUP_LEVEL = 4;
17
11
  const SnkExpressionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
18
12
  constructor() {
19
13
  super();
@@ -22,6 +16,7 @@ const SnkExpressionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
22
16
  this.ezFilterGroupRemove = createEvent(this, "ezFilterGroupRemove", 7);
23
17
  this.ezExpressionGroupLayoutChanged = createEvent(this, "ezExpressionLayoutChanged", 7);
24
18
  this.FIRST_LEVEL = "0";
19
+ this.LIMIT_GROUP_LEVEL = 4;
25
20
  this.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
26
21
  this._conditionOperator = FilterGroupCondition.AND;
27
22
  this._group = undefined;
@@ -48,11 +43,11 @@ const SnkExpressionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
48
43
  }
49
44
  watchGroup(newValue) {
50
45
  this._group = newValue;
51
- this._conditionOperator = !this._group.operand ? FilterGroupCondition.AND : this._group.operand;
46
+ this._conditionOperator = this.getOperand();
52
47
  }
53
48
  componentWillLoad() {
54
49
  this._group = this.group;
55
- this._conditionOperator = !this._group.operand ? FilterGroupCondition.AND : this._group.operand;
50
+ this._conditionOperator = this.getOperand();
56
51
  if (!this.getDataGroupLevel()) {
57
52
  this._element.setAttribute('data-group-level', this.FIRST_LEVEL);
58
53
  }
@@ -78,6 +73,9 @@ const SnkExpressionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
78
73
  getDashedHeight() {
79
74
  return this._selfTop - this.parentTop;
80
75
  }
76
+ getOperand() {
77
+ return !this._group.operand ? FilterGroupCondition.AND : this._group.operand;
78
+ }
81
79
  getMessage(key, params) {
82
80
  return this.application.messagesBuilder.getMessage(key, params);
83
81
  }
@@ -111,18 +109,19 @@ const SnkExpressionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
111
109
  this.changeHandler();
112
110
  this.canAddExpression = true;
113
111
  }
112
+ isFilledItem(item) {
113
+ if (!item.fieldName || !item.operand)
114
+ return false;
115
+ if (item.operand === 'NULL' || item.operand === 'NOT_NULL') {
116
+ return true;
117
+ }
118
+ else {
119
+ return item.paramVariable || (item.userInterface === 'SWITCH') ? true : !!item.value;
120
+ }
121
+ }
114
122
  handleFilterItemChange() {
115
123
  this.ezFilterGroupChange.emit(this._group);
116
- this.canAddExpression = this.group.items.every(item => {
117
- if (!item.fieldName || !item.operand)
118
- return false;
119
- if (item.operand === 'NULL' || item.operand === 'NOT_NULL') {
120
- return true;
121
- }
122
- else {
123
- return item.paramVariable || (item.userInterface === 'SWITCH') ? true : !!item.value;
124
- }
125
- });
124
+ this.canAddExpression = this.group.items.every(this.isFilledItem);
126
125
  }
127
126
  handleAddExpression() {
128
127
  const newItem = {
@@ -211,7 +210,7 @@ const SnkExpressionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
211
210
  }
212
211
  canAddGroup() {
213
212
  const dataGroupLevel = Number(this.getDataGroupLevel() || this.FIRST_LEVEL);
214
- return dataGroupLevel < LIMIT_GROUP_LEVEL;
213
+ return dataGroupLevel < this.LIMIT_GROUP_LEVEL;
215
214
  }
216
215
  isFirstLevel() {
217
216
  return Boolean(this.getDataGroupLevel() === this.FIRST_LEVEL);
@@ -220,7 +219,7 @@ const SnkExpressionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
220
219
  evt.preventDefault();
221
220
  evt.stopPropagation();
222
221
  }
223
- handleMessageAddTooltip() {
222
+ getMessageAddTooltip() {
224
223
  if (this.isFirstLevel()) {
225
224
  const allValidItems = this.group.items.every(item => {
226
225
  if (!item.fieldName || !item.operand)
@@ -239,7 +238,7 @@ const SnkExpressionGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
239
238
  }
240
239
  render() {
241
240
  const canAddGroup = this.canAddGroup();
242
- return (h(Host, null, h("div", { class: !this.isFirstLevel() && this._showDashes ? 'dashes' : 'hidden', style: this.buildGroupStyle() }), h("div", { class: !this.isFirstLevel() && this._showDashes ? 'horizontal-dashes' : 'hidden' }), h("div", { class: 'ez-flex ez-flex--align-items-center' }, h("div", { class: 'snk-expression-group__container-condition ez-flex ez-flex-item--align-center ez-flex--align-items-center', "data-condition": this._conditionOperator, title: this.getTooltipMessageForOperator() }, h("label", { class: "ez-label ez-padding-right--medium ez-padding-left--medium ez-title--primary" }, "Condi\u00E7\u00E3o:"), h("div", null, h("ez-combo-box", Object.assign({ class: "snk-expression-group__container-option", canShowError: false, mode: "slim", suppressEmptyOption: true, enabled: this.canChangeGroupCondition(), value: this._conditionOperator, onEzChange: (evt) => this.handleConditionOperatorChange(evt.detail.value) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxConditions_level_${this.getDataGroupLevel()}` }), h("option", { value: FilterGroupCondition.AND }, "E"), h("option", { value: FilterGroupCondition.OR }, "OU")))), h("ez-button", { class: "ez-padding-right--medium ez-padding-left--medium", mode: "icon", iconName: "plus", size: "small", enabled: this.canAddExpression, title: this.handleMessageAddTooltip(), onClick: () => this.handleAddExpression() }), h("ez-button", { label: "Adicionar grupo", size: "small", enabled: canAddGroup, title: !canAddGroup ? this.getMessage('snkPersonalizedFilter.info.labelDisabledAddGroupButton', { LIMIT_GROUP_LEVEL: LIMIT_GROUP_LEVEL + 1 }) : '', onClick: () => this.handleAddGroup() }, h("ez-icon", { slot: "leftIcon", iconName: "plus" })), !this.isFirstLevel() && h("ez-button", { title: this.getMessage("snkPersonalizedFilter.info.labelDeleteExpression"), class: "ez-padding-left--medium", mode: "icon", iconName: "delete", size: "small", onClick: (evt) => this.confirmRemoveGroup(evt) })), h("div", { class: "ez-padding-top--small snk-expression-group__container-expression" }, h("div", { class: "ez-padding-top--small" }, this.renderExpressionItems())), h("div", { class: "ez-padding-top--small snk-expression-group__container-expression" }, h("div", { class: "ez-padding-top--small" }, this.renderGroups()))));
241
+ return (h(Host, null, h("div", { class: !this.isFirstLevel() && this._showDashes ? 'dashes' : 'hidden', style: this.buildGroupStyle() }), h("div", { class: !this.isFirstLevel() && this._showDashes ? 'horizontal-dashes' : 'hidden' }), h("div", { class: 'ez-flex ez-flex--align-items-center' }, h("div", { class: 'snk-expression-group__container-condition ez-flex ez-flex-item--align-center ez-flex--align-items-center', "data-condition": this._conditionOperator, title: this.getTooltipMessageForOperator() }, h("label", { class: "ez-label ez-padding-right--medium ez-padding-left--medium ez-title--primary" }, this.getMessage("snkPersonalizedFilter.info.condition")), h("div", null, h("ez-combo-box", Object.assign({ class: "snk-expression-group__container-option", canShowError: false, mode: "slim", suppressEmptyOption: true, enabled: this.canChangeGroupCondition(), value: this._conditionOperator, onEzChange: (evt) => this.handleConditionOperatorChange(evt.detail.value) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxConditions_level_${this.getDataGroupLevel()}` }), h("option", { value: FilterGroupCondition.AND }, "E"), h("option", { value: FilterGroupCondition.OR }, "OU")))), h("ez-button", { class: "ez-padding-right--medium ez-padding-left--medium", mode: "icon", iconName: "plus", size: "small", enabled: this.canAddExpression, title: this.getMessageAddTooltip(), onClick: () => this.handleAddExpression() }), h("ez-button", { label: this.getMessage("snkPersonalizedFilter.info.addGroup"), size: "small", enabled: canAddGroup, title: !canAddGroup ? this.getMessage('snkPersonalizedFilter.info.labelDisabledAddGroupButton', { LIMIT_GROUP_LEVEL: this.LIMIT_GROUP_LEVEL + 1 }) : '', onClick: () => this.handleAddGroup() }, h("ez-icon", { slot: "leftIcon", iconName: "plus" })), !this.isFirstLevel() && h("ez-button", { title: this.getMessage("snkPersonalizedFilter.info.labelDeleteExpression"), class: "ez-padding-left--medium", mode: "icon", iconName: "delete", size: "small", onClick: (evt) => this.confirmRemoveGroup(evt) })), h("div", { class: "ez-padding-top--small snk-expression-group__container-expression" }, h("div", { class: "ez-padding-top--small" }, this.renderExpressionItems())), h("div", { class: "ez-padding-top--small snk-expression-group__container-expression" }, h("div", { class: "ez-padding-top--small" }, this.renderGroups()))));
243
242
  }
244
243
  get _element() { return this; }
245
244
  static get watchers() { return {
@@ -293,4 +292,4 @@ function defineCustomElement() {
293
292
  } });
294
293
  }
295
294
 
296
- export { FilterGroupCondition as F, SnkExpressionGroup as S, defineCustomElement as d };
295
+ export { SnkExpressionGroup as S, defineCustomElement as d };
@@ -3,7 +3,7 @@ import { UserInterface, ApplicationContext, ElementIDUtils } from '@sankhyalabs/
3
3
  import { a as SelectedItemType, d as defineCustomElement$2 } from './snk-filter-field-search2.js';
4
4
  import { ApplicationUtils, CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { fieldBuilder } from '@sankhyalabs/ezui/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder';
6
- import { F as FilterOperand } from './index2.js';
6
+ import { a as FilterOperand } from './PersonalizedFilterUtils.js';
7
7
  import { s as store } from './index3.js';
8
8
  import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
9
9
  import { d as defineCustomElement$1 } from './snk-filter-param-config2.js';
@@ -36,7 +36,6 @@ const FIELD_TYPE_SEARCH_AND_TEXT = [
36
36
 
37
37
  const snkExpressionItemCss = ".sc-snk-expression-item-h{display:flex;width:100%;--snk-expression-item--background-color:var(--background--xlight, #fff);--snk-expression-item__itens--padding:var(--space--small, 6px);--snk-expression-item__width--input-operator:220px;--snk-expression-item__width--input-value:240px;--snk-expression-item__width--input-value-variable:176px;--snk-expression-item--border-radius:var(--border--radius-medium, 12px);--snk-expression-item--border-color:var(--color--strokes, #DCE0E8);--snk-expression-item--border-style:var(--border--small, 1px solid);--snk-expression-item__background-color-dashed:var(--background--body, #fafcff)}.box.sc-snk-expression-item{width:100%;height:56px;background:var(--snk-expression-item--background-color);border:var(--snk-expression-item--border-color) var(--snk-expression-item--border-style);border-radius:var(--snk-expression-item--border-radius)}.box__container.sc-snk-expression-item{display:flex;align-items:center;justify-content:space-between;white-space:nowrap;margin:var(--space--small, 6px)}.box__container--input-filter.sc-snk-expression-item{width:100%}.box__container--input-operator.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-operator);min-width:var(--snk-expression-item__width--input-operator)}.box__container--input-value.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value);min-width:var(--snk-expression-item__width--input-value)}.box__container--input-value-variable.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value-variable);min-width:var(--snk-expression-item__width--input-value-variable)}.box__container--button-delete.sc-snk-expression-item{display:flex}.box__container.sc-snk-expression-item>div.sc-snk-expression-item{padding-left:var(--snk-expression-item__itens--padding);padding-right:var(--snk-expression-item__itens--padding)}.box__container--button-delete--icon.sc-snk-expression-item{width:42px;min-width:42px}.box__container--input-value-variable--icon.sc-snk-expression-item{cursor:pointer}.dashes.sc-snk-expression-item{z-index:var(--more-visible, 2);background:var(--snk-expression-item__background-color-dashed);border-bottom:2px dashed var(--text-secondary, #A2ABB9);border-left:2px dashed var(--text-secondary, #A2ABB9);position:absolute;width:15px;height:62px;margin-left:-15px;margin-top:-33.5px}";
38
38
 
39
- const DEFAULT_FIELD_NAME = 'NOT_DEFINED';
40
39
  const SnkExpressionItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
41
40
  constructor() {
42
41
  super();
@@ -46,6 +45,7 @@ const SnkExpressionItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
46
45
  this.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
47
46
  this.filterOperandDefault = FilterOperandDefault;
48
47
  this.filterOperandTypeTextSearch = FilterOperandTypeTextSearch;
48
+ this.DEFAULT_FIELD_NAME = 'NOT_DEFINED';
49
49
  this._showValueVariable = false;
50
50
  this._fieldSelected = undefined;
51
51
  this._optionNotNull = false;
@@ -230,7 +230,7 @@ const SnkExpressionItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
230
230
  if (this._optionNotNull && inputFieldData || ((_b = this._elValueVariable) === null || _b === void 0 ? void 0 : _b.value) && inputFieldData || this.expression.paramVariable || this._showValueVariable || !((_c = this._fieldSelected) === null || _c === void 0 ? void 0 : _c.dataType)) {
231
231
  inputFieldData.$attrs$.enabled = false;
232
232
  }
233
- if (this.expression.value) {
233
+ if (this.expression.value != undefined) {
234
234
  inputFieldData.$attrs$.value = this.getExpressiontValue(this.expression);
235
235
  }
236
236
  inputFieldData.$attrs$.onEzChange = (event) => {
@@ -285,7 +285,7 @@ const SnkExpressionItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
285
285
  }
286
286
  render() {
287
287
  var _a;
288
- return (h(Host, null, h("div", { class: "dashes" }), h("div", { class: "box" }, h("div", { class: "box__container" }, h("div", { class: "box__container--input-filter" }, h("ez-filter-input", Object.assign({ ref: ref => this._elFilterInput = ref, value: (_a = this._fieldSelected) === null || _a === void 0 ? void 0 : _a.path, label: this.getMessage("snkPersonalizedFilter.info.labelSearchField"), canShowError: false, onEzChange: (evt) => this.handleChangeFilterInput(evt), onFocus: () => this.handleFocus() }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `expressionFilterInput_${this.expression.fieldName || DEFAULT_FIELD_NAME}` })), h("snk-filter-field-search", { ref: ref => this._elFilterFieldSearch = ref, searchable: false, onEzSelectFilterItem: (ev) => this.handleSelectItem(ev.detail), fieldsDataSource: this._dataSourceFetcher })), h("div", { class: "box__container--input-operator" }, h("ez-combo-box", Object.assign({ label: this.getMessage("snkPersonalizedFilter.info.labelOperator"), value: this.expression.operand, canShowError: false, options: this.buildOptionsOperator(), onEzChange: (evt) => { var _a; return this.handleChangeOperator((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); }, suppressEmptyOption: true }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxOperand_${this.expression.fieldName || DEFAULT_FIELD_NAME}` }))), h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
288
+ return (h(Host, null, h("div", { class: "dashes" }), h("div", { class: "box" }, h("div", { class: "box__container" }, h("div", { class: "box__container--input-filter" }, h("ez-filter-input", Object.assign({ ref: ref => this._elFilterInput = ref, value: (_a = this._fieldSelected) === null || _a === void 0 ? void 0 : _a.path, label: this.getMessage("snkPersonalizedFilter.info.labelSearchField"), canShowError: false, onEzChange: (evt) => this.handleChangeFilterInput(evt), onFocus: () => this.handleFocus() }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `expressionFilterInput_${this.expression.fieldName || this.DEFAULT_FIELD_NAME}` })), h("snk-filter-field-search", { ref: ref => this._elFilterFieldSearch = ref, searchable: false, onEzSelectFilterItem: (ev) => this.handleSelectItem(ev.detail), fieldsDataSource: this._dataSourceFetcher })), h("div", { class: "box__container--input-operator" }, h("ez-combo-box", Object.assign({ label: this.getMessage("snkPersonalizedFilter.info.labelOperator"), value: this.expression.operand, canShowError: false, options: this.buildOptionsOperator(), onEzChange: (evt) => { var _a; return this.handleChangeOperator((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); }, suppressEmptyOption: true }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxOperand_${this.expression.fieldName || this.DEFAULT_FIELD_NAME}` }))), h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
289
289
  h("ez-number-input", { label: "Valor", canShowError: false, enabled: (!this._showValueVariable && !this._optionNotNull) }) :
290
290
  this.buildFieldByType()), h("div", { class: "box__container--input-value-variable" }, !this._optionNotNull &&
291
291
  h("ez-check", { ref: ref => this._elValueVariable = ref, value: this.expression.paramVariable, label: this.getMessage("snkPersonalizedFilter.info.labelValueVarible"), mode: CheckMode.SWITCH, onEzChange: (evt) => this.handleChangeValueVariable(evt.detail) }), (this._showValueVariable && !this._optionNotNull) &&
@@ -4,9 +4,8 @@ import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/
4
4
  import { C as ConfigStorage } from './ConfigStorage.js';
5
5
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
6
6
  import { F as FilterItemType } from './filter-item-type.enum.js';
7
- import { F as FilterOperand } from './index2.js';
7
+ import { a as FilterOperand, P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
8
8
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
9
- import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
10
9
  import { d as defineCustomElement$8 } from './snk-expression-group2.js';
11
10
  import { d as defineCustomElement$7 } from './snk-expression-item2.js';
12
11
  import { d as defineCustomElement$6 } from './snk-filter-detail2.js';
@@ -271,13 +270,12 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
271
270
  this.processAfterUpdateConfig();
272
271
  }
273
272
  }
273
+ getPersonalizedFilterItem() {
274
+ return this.filterConfig.find(item => item.type === FilterItemType.PERSONALIZED);
275
+ }
274
276
  async processAfterUpdateConfig() {
275
277
  if (this._loadingPending) {
276
- const personalizedFilter = this.filterConfig.find(item => {
277
- if (item.type === FilterItemType.PERSONALIZED) {
278
- return true;
279
- }
280
- });
278
+ const personalizedFilter = this.getPersonalizedFilterItem();
281
279
  this._pendingVariables = !PersonalizedFilterUtils.validateVariableValues(personalizedFilter);
282
280
  if (this._pendingVariables) {
283
281
  return;
@@ -51,12 +51,9 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
51
51
  return { tag: "snk-filter-number" };
52
52
  case FilterItemType.PERSONALIZED:
53
53
  const snkFilterPersonalizedProps = {
54
- tag: "snk-filter-personalized", props: {
54
+ tag: "snk-personalized-filter-editor", props: {
55
55
  presentationMode: EPresentationMode.CHIP,
56
- onValueChanged: ({ detail }) => {
57
- const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
58
- this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
59
- }
56
+ onValueChanged: evt => this.handleValueChanged(evt),
60
57
  }
61
58
  };
62
59
  return snkFilterPersonalizedProps;
@@ -65,6 +62,10 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
65
62
  }
66
63
  return { tag: "snk-filter-text" };
67
64
  }
65
+ handleValueChanged({ detail }) {
66
+ const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
67
+ this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
68
+ }
68
69
  removeItem() {
69
70
  const hasMultiValues = this.config.type === FilterItemType.MULTI_LIST && Array.isArray(this.config.value);
70
71
  const newValue = hasMultiValues ? this.config.value.map((valueItem) => (Object.assign(Object.assign({}, valueItem), { check: false }))) : undefined;
@@ -74,6 +75,9 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
74
75
  }
75
76
  this.changeConfig(removedConfig);
76
77
  }
78
+ removeItemFromGroup(item) {
79
+ return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
80
+ }
77
81
  getPopUpHeaderButtons() {
78
82
  return (h(Fragment, null, !this.config.removalBlocked && this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), !this.config.hardFixed && this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
79
83
  }
@@ -39,7 +39,6 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
39
39
  super();
40
40
  this.__registerHost();
41
41
  this.ezSelectFilterItem = createEvent(this, "ezSelectFilterItem", 7);
42
- this._filterMetadataStorage = new Map();
43
42
  this._currentMetadata = null;
44
43
  this._filterText = "";
45
44
  this._isLoading = false;
@@ -82,15 +81,8 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
82
81
  async loadData() {
83
82
  var _a, _b;
84
83
  this._isLoading = true;
85
- let metadata;
86
- if (this._currentLink != undefined) {
87
- metadata = this._filterMetadataStorage.get(this._currentLink.uri);
88
- }
89
- if (!metadata) {
90
- metadata = await this.fieldsDataSource.fetchData(this._currentLink);
91
- this._currentLink = metadata.currentLink;
92
- this._filterMetadataStorage.set(this._currentLink.uri, metadata);
93
- }
84
+ let metadata = await this.fieldsDataSource.fetchData(this._currentLink);
85
+ this._currentLink = metadata.currentLink;
94
86
  const { fields, links } = metadata || {};
95
87
  if (!Array.isArray(fields) || !Array.isArray(links))
96
88
  throw new Error('Invalid metadata');
@@ -143,7 +135,6 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
143
135
  if (this._isLoading)
144
136
  return;
145
137
  const breadcrumbByIndex = this.breadcrumbItems.findIndex(breadcrumbItem => breadcrumbItem.id === item.id);
146
- item.cache = this._filterMetadataStorage.has(item.uri);
147
138
  if (breadcrumbByIndex > -1) {
148
139
  this.breadcrumbItems = this.breadcrumbItems.slice(0, (breadcrumbByIndex + 1));
149
140
  }
@@ -195,7 +186,6 @@ const SnkFilterFieldSearch = /*@__PURE__*/ proxyCustomElement(class extends HTML
195
186
  }
196
187
  disconnectedCallback() {
197
188
  var _a;
198
- this._filterMetadataStorage.clear();
199
189
  (_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
200
190
  }
201
191
  render() {
@@ -183,11 +183,7 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
183
183
  return `${label}: ${value.value} - ${value.label}`;
184
184
  }
185
185
  if (type === FilterItemType.PERSONALIZED) {
186
- const activeCount = groupedItems.reduce((total, item) => {
187
- if (!!item.visible)
188
- return total + 1;
189
- return total;
190
- }, 0);
186
+ const activeCount = this.calculateActiveCount(groupedItems);
191
187
  if (activeCount <= 0)
192
188
  return label;
193
189
  return `${label}: ${this.getMessage('snkFilterBar.personalizedCount', { activeCount })}`;
@@ -211,6 +207,13 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
211
207
  }
212
208
  return label;
213
209
  }
210
+ calculateActiveCount(groupedItems) {
211
+ return groupedItems.reduce((total, item) => {
212
+ if (!!item.visible)
213
+ return total + 1;
214
+ return total;
215
+ }, 0);
216
+ }
214
217
  applyTooltip() {
215
218
  if (!this.config.value)
216
219
  return undefined;
@@ -259,13 +262,19 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
259
262
  }
260
263
  return undefined;
261
264
  }
265
+ hasActiveElements(value) {
266
+ var _a, _b, _c;
267
+ return ((_c = (_b = ((_a = value === null || value === void 0 ? void 0 : value.elements) !== null && _a !== void 0 ? _a : value)) === null || _b === void 0 ? void 0 : _b.filter(val => val === null || val === void 0 ? void 0 : val.check)) === null || _c === void 0 ? void 0 : _c.length) > 0;
268
+ }
269
+ hasActiveValue(config) {
270
+ return (config.type !== FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
271
+ }
262
272
  getEnabledChip() {
263
- var _a, _b, _c, _d;
264
273
  if (this.config.type === FilterItemType.PERSONALIZED) {
265
274
  const { groupedItems = [] } = this.config;
266
275
  return groupedItems.some(item => item.visible);
267
276
  }
268
- return (FilterItemType.MULTI_LIST != this.config.type && this.config.value != undefined) || (((_d = (_c = ((_b = (_a = this.config.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : this.config.value)) === null || _c === void 0 ? void 0 : _c.filter(value => value === null || value === void 0 ? void 0 : value.check)) === null || _d === void 0 ? void 0 : _d.length) > 0);
277
+ return this.hasActiveValue(this.config);
269
278
  }
270
279
  render() {
271
280
  const leftIcon = this.getLeftIconName();
@@ -46,19 +46,21 @@ const SnkFilterModalItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
46
46
  case FilterItemType.NUMBER:
47
47
  return { tag: "snk-filter-number" };
48
48
  case FilterItemType.PERSONALIZED:
49
- const snkFilterPersonalizedProps = {
50
- tag: "snk-filter-personalized", props: {
51
- onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, FilterItemType.PERSONALIZED),
52
- onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
53
- onAddFilter: () => this.addPersonalizedFilter.emit(),
54
- }
55
- };
56
- return snkFilterPersonalizedProps;
49
+ return this.buildSnkFilterPersonalizedProps();
57
50
  case FilterItemType.MULTI_LIST:
58
51
  return { tag: "snk-entity-list", props: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
59
52
  }
60
53
  return { tag: "snk-filter-text" };
61
54
  }
55
+ buildSnkFilterPersonalizedProps() {
56
+ return {
57
+ tag: "snk-personalized-filter-editor", props: {
58
+ onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, FilterItemType.PERSONALIZED),
59
+ onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
60
+ onAddFilter: () => this.addPersonalizedFilter.emit(),
61
+ }
62
+ };
63
+ }
62
64
  isVisible(newValue) {
63
65
  return !this.filterItem.visible ? newValue !== undefined : true;
64
66
  }
@@ -71,7 +71,7 @@ const SnkFilterModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
71
71
  });
72
72
  }
73
73
  handleClose() {
74
- const hasChangesToSave = JSON.stringify(this.filters) !== JSON.stringify(this._originalFilterConfig);
74
+ const hasChangesToSave = ObjectUtils.objectToString(this.filters) !== ObjectUtils.objectToString(this._originalFilterConfig);
75
75
  if (!hasChangesToSave) {
76
76
  this.closeModal();
77
77
  return;
@@ -81,13 +81,19 @@ const SnkFilterModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
81
81
  this.closeModal();
82
82
  });
83
83
  }
84
- validatePersonalizedFilter() {
84
+ handleApplyFilters() {
85
85
  const filterPersonalized = this.filters.find(filter => filter.filterType === FilterType.CUSTOM_FILTER);
86
+ if (this.isValidCustomFilter(filterPersonalized)) {
87
+ this.applyFilters(this.filters);
88
+ }
89
+ }
90
+ isValidCustomFilter(filterPersonalized) {
86
91
  const isValid = PersonalizedFilterUtils.validateVariableValues(filterPersonalized);
87
92
  if (!isValid) {
88
- return ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
93
+ ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
94
+ return false;
89
95
  }
90
- this.applyFilters(this.filters);
96
+ return true;
91
97
  }
92
98
  modalActionListener(evt) {
93
99
  const modalAction = evt.detail;
@@ -96,7 +102,7 @@ const SnkFilterModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
96
102
  this.handleClearAll();
97
103
  break;
98
104
  case ModalAction.OK:
99
- this.validatePersonalizedFilter();
105
+ this.handleApplyFilters();
100
106
  break;
101
107
  case ModalAction.CLOSE:
102
108
  this.handleClose();
@@ -1,8 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
2
  import { StringUtils, DataType, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
4
- import { c as FilterConfigType, d as FilterEntities, e as FilterUserConfigTypes } from './index2.js';
5
- import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils.js';
4
+ import { b as FilterConfigType, P as PersonalizedFilterUtils, c as FilterEntities, d as FilterUserConfigTypes } from './PersonalizedFilterUtils.js';
6
5
 
7
6
  const snkFilterParamConfigCss = ":host{--snk-filter-param-config__expression--color:var(--title--primary, #2b3a54);display:flex;position:relative}.snk-filter-param-config__expression{--text-area__input--disabled--color:var(--snk-filter-param-config__expression--color)}";
8
7
 
@@ -77,6 +77,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
77
77
  this._gridConfig = undefined;
78
78
  this._popUpGridConfig = false;
79
79
  this.configName = undefined;
80
+ this.selectionToastConfig = undefined;
80
81
  this.actionsList = undefined;
81
82
  this.isDetail = undefined;
82
83
  this.taskbarManager = undefined;
@@ -346,12 +347,13 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
346
347
  return undefined;
347
348
  }
348
349
  return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
349
- 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", "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() })), 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) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => 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), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
350
+ 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", "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() })), 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) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this._multiSelectionListDataSource, selectionToastConfig: this.selectionToastConfig }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => 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), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
350
351
  }
351
352
  get _element() { return this; }
352
353
  static get style() { return snkGridCss; }
353
354
  }, [6, "snk-grid", {
354
355
  "configName": [1, "config-name"],
356
+ "selectionToastConfig": [16],
355
357
  "actionsList": [16],
356
358
  "isDetail": [4, "is-detail"],
357
359
  "taskbarManager": [16],
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkPersonalizedFilterEditor extends Components.SnkPersonalizedFilterEditor, HTMLElement {}
4
+ export const SnkPersonalizedFilterEditor: {
5
+ prototype: SnkPersonalizedFilterEditor;
6
+ new (): SnkPersonalizedFilterEditor;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;