@sankhyalabs/sankhyablocks 6.5.0 → 6.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) 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/SnkMultiSelectionListDataSource-804ff4c7.js +34 -0
  4. package/dist/cjs/{index-614af008.js → index-0e663819.js} +0 -36
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  7. package/dist/cjs/snk-actions-button.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-application.cjs.entry.js +1 -1
  9. package/dist/cjs/snk-attach.cjs.entry.js +2 -2
  10. package/dist/cjs/snk-crud.cjs.entry.js +2 -2
  11. package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
  12. package/dist/cjs/{snk-data-unit-ba0c368c.js → snk-data-unit-5f434275.js} +1 -1
  13. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  14. package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
  15. package/dist/cjs/snk-expression-group.cjs.entry.js +21 -17
  16. package/dist/cjs/snk-expression-item_3.cjs.entry.js +21 -31
  17. package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -16
  18. package/dist/cjs/snk-filter-detail.cjs.entry.js +11 -7
  19. package/dist/cjs/snk-filter-item.cjs.entry.js +16 -7
  20. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +10 -8
  21. package/dist/cjs/snk-filter-modal.cjs.entry.js +13 -7
  22. package/dist/cjs/snk-grid.cjs.entry.js +4 -32
  23. package/dist/cjs/{snk-guides-viewer-7bedfa91.js → snk-guides-viewer-27586701.js} +2 -2
  24. package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
  25. package/dist/cjs/{snk-filter-personalized.cjs.entry.js → snk-personalized-filter-editor.cjs.entry.js} +35 -12
  26. package/dist/cjs/snk-personalized-filter.cjs.entry.js +24 -13
  27. package/dist/cjs/snk-simple-crud.cjs.entry.js +44 -15
  28. package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
  29. package/dist/cjs/{taskbar-elements-7f91f4cd.js → taskbar-elements-b98dd6e9.js} +1 -1
  30. package/dist/collection/collection-manifest.json +1 -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-personalized-filter/interfaces/index.js +39 -0
  40. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +24 -12
  41. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.js +25 -21
  42. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +7 -7
  43. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +3 -3
  44. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +6 -6
  45. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +10 -2
  46. package/dist/collection/lib/@types/index.js +0 -36
  47. package/dist/collection/lib/dataUnit/InMemoryLoader.js +25 -4
  48. package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +4 -1
  49. package/dist/components/PersonalizedFilterUtils.js +49 -7
  50. package/dist/components/SnkMessageBuilder.js +4 -1
  51. package/dist/components/{taskbar-processor.js → SnkMultiSelectionListDataSource.js} +32 -1
  52. package/dist/components/index.d.ts +1 -1
  53. package/dist/components/index.js +1 -1
  54. package/dist/components/index2.js +1 -37
  55. package/dist/components/snk-detail-view2.js +1 -1
  56. package/dist/components/snk-expression-group2.js +22 -23
  57. package/dist/components/snk-expression-item2.js +4 -4
  58. package/dist/components/snk-filter-bar2.js +5 -7
  59. package/dist/components/snk-filter-detail2.js +9 -5
  60. package/dist/components/snk-filter-field-search2.js +2 -12
  61. package/dist/components/snk-filter-item2.js +16 -7
  62. package/dist/components/snk-filter-modal-item2.js +10 -8
  63. package/dist/components/snk-filter-modal.js +11 -5
  64. package/dist/components/snk-filter-param-config2.js +1 -2
  65. package/dist/components/snk-grid2.js +4 -33
  66. package/dist/components/snk-personalized-filter-editor.d.ts +11 -0
  67. package/dist/components/{snk-filter-personalized.js → snk-personalized-filter-editor.js} +42 -19
  68. package/dist/components/snk-personalized-filter2.js +25 -13
  69. package/dist/components/snk-simple-crud2.js +34 -6
  70. package/dist/esm/{PersonalizedFilterUtils-202cd721.js → PersonalizedFilterUtils-1a167d89.js} +44 -7
  71. package/dist/esm/{SnkMessageBuilder-a4f7d858.js → SnkMessageBuilder-9d2becfb.js} +4 -1
  72. package/dist/esm/SnkMultiSelectionListDataSource-892f37f9.js +32 -0
  73. package/dist/esm/index-1564817d.js +33 -0
  74. package/dist/esm/loader.js +1 -1
  75. package/dist/esm/sankhyablocks.js +1 -1
  76. package/dist/esm/snk-actions-button.entry.js +1 -1
  77. package/dist/esm/snk-application.entry.js +1 -1
  78. package/dist/esm/snk-attach.entry.js +2 -2
  79. package/dist/esm/snk-crud.entry.js +2 -2
  80. package/dist/esm/snk-data-exporter.entry.js +3 -3
  81. package/dist/esm/{snk-data-unit-3ecaf52c.js → snk-data-unit-ca4bcba6.js} +1 -1
  82. package/dist/esm/snk-data-unit.entry.js +2 -2
  83. package/dist/esm/snk-detail-view.entry.js +4 -4
  84. package/dist/esm/snk-expression-group.entry.js +21 -17
  85. package/dist/esm/snk-expression-item_3.entry.js +7 -17
  86. package/dist/esm/snk-filter-bar.entry.js +6 -7
  87. package/dist/esm/snk-filter-detail.entry.js +11 -7
  88. package/dist/esm/snk-filter-item.entry.js +16 -7
  89. package/dist/esm/snk-filter-modal-item.entry.js +10 -8
  90. package/dist/esm/snk-filter-modal.entry.js +13 -7
  91. package/dist/esm/snk-grid.entry.js +6 -34
  92. package/dist/esm/{snk-guides-viewer-9240c017.js → snk-guides-viewer-950dd3b5.js} +2 -2
  93. package/dist/esm/snk-guides-viewer.entry.js +3 -3
  94. package/dist/esm/{snk-filter-personalized.entry.js → snk-personalized-filter-editor.entry.js} +35 -12
  95. package/dist/esm/snk-personalized-filter.entry.js +24 -13
  96. package/dist/esm/snk-simple-crud.entry.js +36 -7
  97. package/dist/esm/snk-taskbar.entry.js +2 -2
  98. package/dist/esm/{taskbar-elements-139b1058.js → taskbar-elements-2c761819.js} +1 -1
  99. package/dist/sankhyablocks/{p-ab33e180.js → p-01070d6d.js} +1 -1
  100. package/dist/sankhyablocks/p-18de3bbd.entry.js +1 -0
  101. package/dist/sankhyablocks/p-25df01a1.entry.js +1 -0
  102. package/dist/sankhyablocks/p-30134b16.entry.js +1 -0
  103. package/dist/sankhyablocks/{p-09f33525.entry.js → p-402db136.entry.js} +1 -1
  104. package/dist/sankhyablocks/p-40a5d35e.entry.js +1 -0
  105. package/dist/sankhyablocks/p-4c8d0516.entry.js +1 -0
  106. package/dist/sankhyablocks/p-5534e08c.js +1 -0
  107. package/dist/sankhyablocks/{p-257aeea4.entry.js → p-5e06e139.entry.js} +1 -1
  108. package/dist/sankhyablocks/{p-43485c54.js → p-602dfb9e.js} +1 -1
  109. package/dist/sankhyablocks/{p-78a226a1.js → p-6f4f88ef.js} +1 -1
  110. package/dist/sankhyablocks/p-775e60f5.entry.js +1 -0
  111. package/dist/sankhyablocks/{p-aa4e880f.entry.js → p-7c10486f.entry.js} +1 -1
  112. package/dist/sankhyablocks/p-7d68a43a.js +1 -0
  113. package/dist/sankhyablocks/p-86e10ecc.entry.js +1 -0
  114. package/dist/sankhyablocks/p-88a40b96.entry.js +1 -0
  115. package/dist/sankhyablocks/{p-f1edaec0.js → p-a2493d11.js} +1 -1
  116. package/dist/sankhyablocks/p-b6f9f702.entry.js +1 -0
  117. package/dist/sankhyablocks/{p-6564f621.entry.js → p-c2d3e4fb.entry.js} +1 -1
  118. package/dist/sankhyablocks/{p-2adb4481.entry.js → p-c6380ea2.entry.js} +1 -1
  119. package/dist/sankhyablocks/{p-0d670404.entry.js → p-c7c4ed56.entry.js} +1 -1
  120. package/dist/sankhyablocks/{p-e8be0aae.entry.js → p-ca29b093.entry.js} +1 -1
  121. package/dist/sankhyablocks/p-d881cab2.entry.js +1 -0
  122. package/dist/sankhyablocks/p-d9586ead.entry.js +1 -0
  123. package/dist/sankhyablocks/p-f8ce17d3.entry.js +1 -0
  124. package/dist/sankhyablocks/p-fa9d3f73.js +1 -0
  125. package/dist/sankhyablocks/{p-cea58f8b.entry.js → p-fdc262aa.entry.js} +1 -1
  126. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  127. 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
  128. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +2 -0
  129. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +3 -0
  130. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +2 -1
  131. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +3 -1
  132. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +1 -0
  133. package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +0 -1
  134. package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionItem.d.ts +1 -1
  135. package/dist/types/components/snk-personalized-filter/interfaces/IParameter.d.ts +37 -0
  136. package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IUserFilterConfig.d.ts +1 -1
  137. package/dist/types/components/snk-personalized-filter/interfaces/index.d.ts +35 -0
  138. package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +3 -1
  139. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group.d.ts +5 -2
  140. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +1 -1
  141. package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +2 -1
  142. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.d.ts +1 -1
  143. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.d.ts +2 -2
  144. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +3 -0
  145. package/dist/types/components.d.ts +62 -62
  146. package/dist/types/lib/@types/index.d.ts +0 -32
  147. package/dist/types/lib/configs/ConfigStorage.d.ts +1 -1
  148. package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +3 -1
  149. package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +1 -1
  150. package/package.json +1 -1
  151. package/react/components.d.ts +1 -1
  152. package/react/components.js +1 -1
  153. package/react/components.js.map +1 -1
  154. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.js +0 -3
  155. package/dist/components/snk-filter-personalized.d.ts +0 -11
  156. package/dist/esm/index-a255b326.js +0 -69
  157. package/dist/sankhyablocks/p-0364abc8.entry.js +0 -1
  158. package/dist/sankhyablocks/p-18e3a2b7.entry.js +0 -1
  159. package/dist/sankhyablocks/p-36ecb6ab.js +0 -1
  160. package/dist/sankhyablocks/p-4374cc15.entry.js +0 -1
  161. package/dist/sankhyablocks/p-50c3700f.entry.js +0 -1
  162. package/dist/sankhyablocks/p-6ce48ae3.entry.js +0 -1
  163. package/dist/sankhyablocks/p-7add855c.entry.js +0 -1
  164. package/dist/sankhyablocks/p-a1cab141.entry.js +0 -1
  165. package/dist/sankhyablocks/p-abc4ae66.entry.js +0 -1
  166. package/dist/sankhyablocks/p-c7dd701c.entry.js +0 -1
  167. package/dist/sankhyablocks/p-d5a25c7d.entry.js +0 -1
  168. package/dist/sankhyablocks/p-e962ce72.entry.js +0 -1
  169. package/dist/sankhyablocks/p-eb90de43.js +0 -1
  170. package/dist/sankhyablocks/p-f75dceb1.entry.js +0 -1
  171. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IParameter.d.ts +0 -21
  172. package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/index.d.ts +0 -3
  173. /package/dist/cjs/{IExpressionItem-1090c3fd.js → IExpressionItem-0e32ebb7.js} +0 -0
  174. /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
  175. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionGroup.js +0 -0
  176. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionItem.js +0 -0
  177. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IParameter.js +0 -0
  178. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IPersonalizedFilter.js +0 -0
  179. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/ISystemFilterConfig.js +0 -0
  180. /package/dist/collection/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IUserFilterConfig.js +0 -0
  181. /package/dist/esm/{IExpressionItem-2e922b2c.js → IExpressionItem-21f225bf.js} +0 -0
  182. /package/dist/sankhyablocks/{p-c6bf66e0.js → p-63bff2a8.js} +0 -0
  183. /package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IExpressionGroup.d.ts +0 -0
  184. /package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/IPersonalizedFilter.d.ts +0 -0
  185. /package/dist/types/components/snk-personalized-filter/{subcomponents/snk-filter-param-config/interfaces → interfaces}/ISystemFilterConfig.d.ts +0 -0
@@ -6,11 +6,11 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const FieldBuilder = require('@sankhyalabs/ezui/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder');
9
- const index$2 = require('./index-614af008.js');
9
+ const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-cfcd9af2.js');
10
10
  const index$1 = require('./index-102ba62d.js');
11
11
  const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
12
12
  const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
13
- const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7d959e91.js');
13
+ require('./IExpressionItem-0e32ebb7.js');
14
14
  require('./filter-item-type.enum-aa823a00.js');
15
15
 
16
16
  var SelectedItemType;
@@ -47,7 +47,6 @@ const FIELD_TYPE_SEARCH_AND_TEXT = [
47
47
 
48
48
  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}";
49
49
 
50
- const DEFAULT_FIELD_NAME = 'NOT_DEFINED';
51
50
  const SnkExpressionItem = class {
52
51
  constructor(hostRef) {
53
52
  index.registerInstance(this, hostRef);
@@ -56,6 +55,7 @@ const SnkExpressionItem = class {
56
55
  this.application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
57
56
  this.filterOperandDefault = FilterOperandDefault;
58
57
  this.filterOperandTypeTextSearch = FilterOperandTypeTextSearch;
58
+ this.DEFAULT_FIELD_NAME = 'NOT_DEFINED';
59
59
  this._showValueVariable = false;
60
60
  this._fieldSelected = undefined;
61
61
  this._optionNotNull = false;
@@ -207,8 +207,8 @@ const SnkExpressionItem = class {
207
207
  this.setValueExpression("operand", optionSelected);
208
208
  }
209
209
  checkOptionIsNull(optionSelected) {
210
- const filterOperandValue = index$2.FilterOperand[optionSelected];
211
- if ([index$2.FilterOperand.NULL, index$2.FilterOperand.NOT_NULL].includes(filterOperandValue)) {
210
+ const filterOperandValue = PersonalizedFilterUtils.FilterOperand[optionSelected];
211
+ if ([PersonalizedFilterUtils.FilterOperand.NULL, PersonalizedFilterUtils.FilterOperand.NOT_NULL].includes(filterOperandValue)) {
212
212
  this._optionNotNull = true;
213
213
  if (this._elFieldDynamic) {
214
214
  this._elFieldDynamic.enabled = false;
@@ -240,7 +240,7 @@ const SnkExpressionItem = class {
240
240
  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)) {
241
241
  inputFieldData.$attrs$.enabled = false;
242
242
  }
243
- if (this.expression.value) {
243
+ if (this.expression.value != undefined) {
244
244
  inputFieldData.$attrs$.value = this.getExpressiontValue(this.expression);
245
245
  }
246
246
  inputFieldData.$attrs$.onEzChange = (event) => {
@@ -295,7 +295,7 @@ const SnkExpressionItem = class {
295
295
  }
296
296
  render() {
297
297
  var _a;
298
- return (index.h(index.Host, null, index.h("div", { class: "dashes" }), index.h("div", { class: "box" }, index.h("div", { class: "box__container" }, index.h("div", { class: "box__container--input-filter" }, index.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() }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `expressionFilterInput_${this.expression.fieldName || DEFAULT_FIELD_NAME}` })), index.h("snk-filter-field-search", { ref: ref => this._elFilterFieldSearch = ref, searchable: false, onEzSelectFilterItem: (ev) => this.handleSelectItem(ev.detail), fieldsDataSource: this._dataSourceFetcher })), index.h("div", { class: "box__container--input-operator" }, index.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 }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxOperand_${this.expression.fieldName || DEFAULT_FIELD_NAME}` }))), index.h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
298
+ return (index.h(index.Host, null, index.h("div", { class: "dashes" }), index.h("div", { class: "box" }, index.h("div", { class: "box__container" }, index.h("div", { class: "box__container--input-filter" }, index.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() }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `expressionFilterInput_${this.expression.fieldName || this.DEFAULT_FIELD_NAME}` })), index.h("snk-filter-field-search", { ref: ref => this._elFilterFieldSearch = ref, searchable: false, onEzSelectFilterItem: (ev) => this.handleSelectItem(ev.detail), fieldsDataSource: this._dataSourceFetcher })), index.h("div", { class: "box__container--input-operator" }, index.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 }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `comboBoxOperand_${this.expression.fieldName || this.DEFAULT_FIELD_NAME}` }))), index.h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
299
299
  index.h("ez-number-input", { label: "Valor", canShowError: false, enabled: (!this._showValueVariable && !this._optionNotNull) }) :
300
300
  this.buildFieldByType()), index.h("div", { class: "box__container--input-value-variable" }, !this._optionNotNull &&
301
301
  index.h("ez-check", { ref: ref => this._elValueVariable = ref, value: this.expression.paramVariable, label: this.getMessage("snkPersonalizedFilter.info.labelValueVarible"), mode: utils.CheckMode.SWITCH, onEzChange: (evt) => this.handleChangeValueVariable(evt.detail) }), (this._showValueVariable && !this._optionNotNull) &&
@@ -338,7 +338,6 @@ const SnkFilterFieldSearch = class {
338
338
  constructor(hostRef) {
339
339
  index.registerInstance(this, hostRef);
340
340
  this.ezSelectFilterItem = index.createEvent(this, "ezSelectFilterItem", 7);
341
- this._filterMetadataStorage = new Map();
342
341
  this._currentMetadata = null;
343
342
  this._filterText = "";
344
343
  this._isLoading = false;
@@ -381,15 +380,8 @@ const SnkFilterFieldSearch = class {
381
380
  async loadData() {
382
381
  var _a, _b;
383
382
  this._isLoading = true;
384
- let metadata;
385
- if (this._currentLink != undefined) {
386
- metadata = this._filterMetadataStorage.get(this._currentLink.uri);
387
- }
388
- if (!metadata) {
389
- metadata = await this.fieldsDataSource.fetchData(this._currentLink);
390
- this._currentLink = metadata.currentLink;
391
- this._filterMetadataStorage.set(this._currentLink.uri, metadata);
392
- }
383
+ let metadata = await this.fieldsDataSource.fetchData(this._currentLink);
384
+ this._currentLink = metadata.currentLink;
393
385
  const { fields, links } = metadata || {};
394
386
  if (!Array.isArray(fields) || !Array.isArray(links))
395
387
  throw new Error('Invalid metadata');
@@ -442,7 +434,6 @@ const SnkFilterFieldSearch = class {
442
434
  if (this._isLoading)
443
435
  return;
444
436
  const breadcrumbByIndex = this.breadcrumbItems.findIndex(breadcrumbItem => breadcrumbItem.id === item.id);
445
- item.cache = this._filterMetadataStorage.has(item.uri);
446
437
  if (breadcrumbByIndex > -1) {
447
438
  this.breadcrumbItems = this.breadcrumbItems.slice(0, (breadcrumbByIndex + 1));
448
439
  }
@@ -494,7 +485,6 @@ const SnkFilterFieldSearch = class {
494
485
  }
495
486
  disconnectedCallback() {
496
487
  var _a;
497
- this._filterMetadataStorage.clear();
498
488
  (_a = this._ezPopover) === null || _a === void 0 ? void 0 : _a.hide();
499
489
  }
500
490
  render() {
@@ -517,7 +507,7 @@ const SnkFilterParamConfig = class {
517
507
  constructor(hostRef) {
518
508
  index.registerInstance(this, hostRef);
519
509
  this._opened = false;
520
- this._configType = index$2.FilterConfigType.SYSTEM_CONFIG;
510
+ this._configType = PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG;
521
511
  this._expressionItem = undefined;
522
512
  this._informedInstance = false;
523
513
  this._canSave = false;
@@ -559,10 +549,10 @@ const SnkFilterParamConfig = class {
559
549
  const description = this.getConfigValue("userConfig", "description");
560
550
  const type = this.getConfigValue("userConfig", "type");
561
551
  if (((_a = this._expressionItem) === null || _a === void 0 ? void 0 : _a.userConfig) != undefined) {
562
- this._configType = index$2.FilterConfigType.USER_CONFIG;
552
+ this._configType = PersonalizedFilterUtils.FilterConfigType.USER_CONFIG;
563
553
  }
564
554
  else {
565
- this._configType = index$2.FilterConfigType.SYSTEM_CONFIG;
555
+ this._configType = PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG;
566
556
  }
567
557
  if (!core.StringUtils.isEmpty(entityName) && !core.StringUtils.isEmpty(fieldName)) {
568
558
  this._instanceElement.value = { value: entityName, label: "" };
@@ -575,14 +565,14 @@ const SnkFilterParamConfig = class {
575
565
  this.buildFilterExpression();
576
566
  }
577
567
  changeDefinitionUsed(option) {
578
- this._configType = option !== null && option !== void 0 ? option : index$2.FilterConfigType.SYSTEM_CONFIG;
579
- if (this._configType === index$2.FilterConfigType.SYSTEM_CONFIG) {
568
+ this._configType = option !== null && option !== void 0 ? option : PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG;
569
+ if (this._configType === PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG) {
580
570
  const entityName = this.getConfigValue("systemConfig", "entity", "entityName");
581
571
  const fieldName = this.getConfigValue("systemConfig", "fieldName");
582
572
  this._instanceElement.value = this._instanceElement.value || { value: entityName, label: "" };
583
573
  this._fieldElement.value = this._fieldElement.value || { value: fieldName, label: "" };
584
574
  }
585
- else if (this._configType === index$2.FilterConfigType.USER_CONFIG) {
575
+ else if (this._configType === PersonalizedFilterUtils.FilterConfigType.USER_CONFIG) {
586
576
  const description = this.getConfigValue("userConfig", "description");
587
577
  const type = this.getConfigValue("userConfig", "type");
588
578
  this._descriptionElement.value = this._descriptionElement.value || description;
@@ -599,12 +589,12 @@ const SnkFilterParamConfig = class {
599
589
  var _a, _b, _c, _d, _e;
600
590
  let systemConfig;
601
591
  let userConfig;
602
- if (this._configType === index$2.FilterConfigType.SYSTEM_CONFIG) {
592
+ if (this._configType === PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG) {
603
593
  const entity = (_b = (_a = this._instanceElement) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.value;
604
594
  const fieldName = (_d = (_c = this._fieldElement) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.value;
605
595
  systemConfig = { entity, fieldName };
606
596
  }
607
- else if (this._configType === index$2.FilterConfigType.USER_CONFIG) {
597
+ else if (this._configType === PersonalizedFilterUtils.FilterConfigType.USER_CONFIG) {
608
598
  const description = (_e = this._descriptionElement) === null || _e === void 0 ? void 0 : _e.value;
609
599
  const type = this.getTypeValue();
610
600
  userConfig = { description, type };
@@ -656,7 +646,7 @@ const SnkFilterParamConfig = class {
656
646
  if (this._application == undefined || !this._opened) {
657
647
  return;
658
648
  }
659
- const isField = entity === index$2.FilterEntities.FIELD;
649
+ const isField = entity === PersonalizedFilterUtils.FilterEntities.FIELD;
660
650
  const criteria = isField ? this.getInstanceCriteria() : undefined;
661
651
  const messageKey = `snkFilterParamConfig.label${isField ? "Field" : "Instance"}`;
662
652
  const entityDescription = this.getMessage(messageKey);
@@ -682,7 +672,7 @@ const SnkFilterParamConfig = class {
682
672
  }
683
673
  getCanSave() {
684
674
  var _a;
685
- if (this._configType === index$2.FilterConfigType.USER_CONFIG) {
675
+ if (this._configType === PersonalizedFilterUtils.FilterConfigType.USER_CONFIG) {
686
676
  const description = (_a = this._descriptionElement) === null || _a === void 0 ? void 0 : _a.value;
687
677
  const type = this.getTypeValue();
688
678
  return !core.StringUtils.isEmpty(description) && !core.StringUtils.isEmpty(type);
@@ -697,8 +687,8 @@ const SnkFilterParamConfig = class {
697
687
  return (index.h("ez-popup", Object.assign({ useHeader: false, size: "small", heightMode: "auto", opened: this._opened }, this.getElementID("popup")), index.h("ez-modal-container", Object.assign({ onEzModalAction: (evt) => {
698
688
  if (evt.detail === ezModalContainer.ModalAction.CLOSE)
699
689
  this.close();
700
- }, modalTitle: this.getMessage("snkFilterParamConfig.modalTitle") }, this.getElementID("modalContainer")), index.h("div", { class: "ez-flex" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, index.h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("systemConfigOption")), index.h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelSystemConfig"), value: index$2.FilterConfigType.SYSTEM_CONFIG })), index.h("ez-search", Object.assign({ ref: (ref) => this._instanceElement = ref, label: this.getMessage("snkFilterParamConfig.labelInstance"), enabled: this.isEnabled(index$2.FilterConfigType.SYSTEM_CONFIG), suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.handleChangeInstance(), optionLoader: (searchArgument) => this.onSearch(searchArgument, index$2.FilterEntities.INSTANCE) }, this.getElementID("configFindEntity"))), index.h("ez-search", Object.assign({ ref: (ref) => this._fieldElement = ref, label: this.getMessage("snkFilterParamConfig.labelField"), enabled: this.isEnabled(index$2.FilterConfigType.SYSTEM_CONFIG) && this._informedInstance, suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.buildFilterExpression(), optionLoader: (searchArgument) => this.onSearch(searchArgument, index$2.FilterEntities.FIELD) }, this.getElementID("configFindField")))), index.h("div", { class: "ez-flex ez-padding--medium" }, index.h("hr", { class: "ez-divider-vertical" })), index.h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, index.h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("userConfigOption")), index.h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelUserConfig"), value: index$2.FilterConfigType.USER_CONFIG })), index.h("ez-text-input", Object.assign({ ref: (ref) => this._descriptionElement = ref, label: this.getMessage("snkFilterParamConfig.labelDescription"), enabled: this.isEnabled(index$2.FilterConfigType.USER_CONFIG), onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamLabel"))), index.h("ez-combo-box", Object.assign({ ref: (ref) => this._typeElement = ref, label: this.getMessage("snkFilterParamConfig.labelType"), enabled: this.isEnabled(index$2.FilterConfigType.USER_CONFIG), suppressEmptyOption: true, onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamType")), Object.keys(index$2.FilterUserConfigTypes).map((configType) => {
701
- return (index.h("option", { value: index$2.FilterUserConfigTypes[configType] }, this.getMessage(`snkFilterParamConfig.labelTypeValues.${configType.toLowerCase()}`)));
690
+ }, modalTitle: this.getMessage("snkFilterParamConfig.modalTitle") }, this.getElementID("modalContainer")), index.h("div", { class: "ez-flex" }, index.h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, index.h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("systemConfigOption")), index.h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelSystemConfig"), value: PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG })), index.h("ez-search", Object.assign({ ref: (ref) => this._instanceElement = ref, label: this.getMessage("snkFilterParamConfig.labelInstance"), enabled: this.isEnabled(PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG), suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.handleChangeInstance(), optionLoader: (searchArgument) => this.onSearch(searchArgument, PersonalizedFilterUtils.FilterEntities.INSTANCE) }, this.getElementID("configFindEntity"))), index.h("ez-search", Object.assign({ ref: (ref) => this._fieldElement = ref, label: this.getMessage("snkFilterParamConfig.labelField"), enabled: this.isEnabled(PersonalizedFilterUtils.FilterConfigType.SYSTEM_CONFIG) && this._informedInstance, suppressEmptyOption: true, showOptionValue: false, showSelectedValue: false, onEzChange: () => this.buildFilterExpression(), optionLoader: (searchArgument) => this.onSearch(searchArgument, PersonalizedFilterUtils.FilterEntities.FIELD) }, this.getElementID("configFindField")))), index.h("div", { class: "ez-flex ez-padding--medium" }, index.h("hr", { class: "ez-divider-vertical" })), index.h("div", { class: "ez-col ez-col--sd-6 ez-flex--column" }, index.h("ez-radio-button", Object.assign({ value: this._configType, onEzChange: (evt) => this.changeDefinitionUsed(evt.detail) }, this.getElementID("userConfigOption")), index.h("ez-radio-button-option", { label: this.getMessage("snkFilterParamConfig.labelUserConfig"), value: PersonalizedFilterUtils.FilterConfigType.USER_CONFIG })), index.h("ez-text-input", Object.assign({ ref: (ref) => this._descriptionElement = ref, label: this.getMessage("snkFilterParamConfig.labelDescription"), enabled: this.isEnabled(PersonalizedFilterUtils.FilterConfigType.USER_CONFIG), onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamLabel"))), index.h("ez-combo-box", Object.assign({ ref: (ref) => this._typeElement = ref, label: this.getMessage("snkFilterParamConfig.labelType"), enabled: this.isEnabled(PersonalizedFilterUtils.FilterConfigType.USER_CONFIG), suppressEmptyOption: true, onEzChange: () => this.buildFilterExpression() }, this.getElementID("configParamType")), Object.keys(PersonalizedFilterUtils.FilterUserConfigTypes).map((configType) => {
691
+ return (index.h("option", { value: PersonalizedFilterUtils.FilterUserConfigTypes[configType] }, this.getMessage(`snkFilterParamConfig.labelTypeValues.${configType.toLowerCase()}`)));
702
692
  })))), index.h("ez-text-area", Object.assign({ ref: (ref) => this._expressionElement = ref, class: "snk-filter-param-config__expression", label: this.getMessage("snkFilterParamConfig.labelExpression"), enabled: false }, this.getElementID("presentationExpression"))), index.h("div", { class: "ez-col ez-col--sd-12 ez-flex--justify-end ez-margin-vertical--small" }, index.h("ez-button", Object.assign({ class: "ez-padding-right--medium", label: this.getMessage("snkFilterParamConfig.labelCancel"), onClick: () => this.close() }, this.getElementID("cancelEditParam"))), index.h("ez-button", Object.assign({ class: "ez-button--primary", label: this.getMessage("snkFilterParamConfig.labelSave"), onClick: () => this.save(), enabled: this._canSave }, this.getElementID("saveEditParam")))))));
703
693
  }
704
694
  get _element() { return index.getElement(this); }
@@ -2,20 +2,20 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index$1 = require('./index-f9e81701.js');
5
+ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
8
8
  const ConfigStorage = require('./ConfigStorage-0a738cdc.js');
9
9
  const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
10
10
  const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
11
- const index = require('./index-614af008.js');
11
+ const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-cfcd9af2.js');
12
12
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
13
- const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7d959e91.js');
14
13
  require('./form-config-fetcher-92bc8fe7.js');
15
14
  require('./DataFetcher-a9d0228f.js');
16
15
  require('./_commonjsHelpers-537d719a.js');
17
16
  require('./resource-fetcher-2979b54b.js');
18
17
  require('./filter-bar-config-fetcher-75219599.js');
18
+ require('./IExpressionItem-0e32ebb7.js');
19
19
 
20
20
  const buildFilter = (item) => {
21
21
  switch (item.type) {
@@ -136,7 +136,7 @@ function buildPersonalized(item) {
136
136
  });
137
137
  return { expression, name: item.id, params };
138
138
  });
139
- const expression = filters.map(filter => `(${filter.expression})`).join(` ${index.FilterOperand.AND} `);
139
+ const expression = filters.map(filter => `(${filter.expression})`).join(` ${PersonalizedFilterUtils.FilterOperand.AND} `);
140
140
  const params = filters.flatMap(filter => filter.params);
141
141
  return { name: id, expression, params };
142
142
  }
@@ -186,7 +186,7 @@ const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns
186
186
 
187
187
  const SnkFilterBar = class {
188
188
  constructor(hostRef) {
189
- index$1.registerInstance(this, hostRef);
189
+ index.registerInstance(this, hostRef);
190
190
  this._updateSequence = [];
191
191
  this._loadingPending = false;
192
192
  this._configUpdated = false;
@@ -271,13 +271,12 @@ const SnkFilterBar = class {
271
271
  this.processAfterUpdateConfig();
272
272
  }
273
273
  }
274
+ getPersonalizedFilterItem() {
275
+ return this.filterConfig.find(item => item.type === filterItemType_enum.FilterItemType.PERSONALIZED);
276
+ }
274
277
  async processAfterUpdateConfig() {
275
278
  if (this._loadingPending) {
276
- const personalizedFilter = this.filterConfig.find(item => {
277
- if (item.type === filterItemType_enum.FilterItemType.PERSONALIZED) {
278
- return true;
279
- }
280
- });
279
+ const personalizedFilter = this.getPersonalizedFilterItem();
281
280
  this._pendingVariables = !PersonalizedFilterUtils.PersonalizedFilterUtils.validateVariableValues(personalizedFilter);
282
281
  if (this._pendingVariables) {
283
282
  return;
@@ -347,10 +346,10 @@ const SnkFilterBar = class {
347
346
  const unpinnedItems = [];
348
347
  this.filterConfig
349
348
  .filter(this.filterActiveFilter)
350
- .forEach((item, index) => {
349
+ .forEach((item, index$1) => {
351
350
  item = core.ObjectUtils.copy(item);
352
351
  const itemId = `filter-${item.id}`;
353
- const filterItem = (index$1.h("snk-filter-item", { onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
352
+ const filterItem = (index.h("snk-filter-item", { onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), onFocusin: () => this.itemFocused(itemId), id: itemId, config: item, class: index$1 > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
354
353
  if (item.fixed || item.hardFixed) {
355
354
  pinnedItems.push(filterItem);
356
355
  }
@@ -362,7 +361,7 @@ const SnkFilterBar = class {
362
361
  const elements = [];
363
362
  elements.push(...pinnedItems);
364
363
  if (pinnedItems.length > 0 && unpinnedItems.length > 0) {
365
- elements.push(index$1.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider" }));
364
+ elements.push(index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider" }));
366
365
  }
367
366
  elements.push(...unpinnedItems);
368
367
  return elements;
@@ -496,11 +495,11 @@ const SnkFilterBar = class {
496
495
  return undefined;
497
496
  }
498
497
  if (this.showPersonalizedFilter) {
499
- return index$1.h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName });
498
+ return index.h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.hidePersonalizedFilter(), entityUri: this.dataUnit.name, configName: this.configName });
500
499
  }
501
- return (index$1.h(index$1.Host, null, index$1.h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, index$1.h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), index$1.h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, index$1.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
500
+ return (index.h(index.Host, null, index.h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, index.h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), index.h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, index.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
502
501
  }
503
- get _element() { return index$1.getElement(this); }
502
+ get _element() { return index.getElement(this); }
504
503
  static get watchers() { return {
505
504
  "filterConfig": ["observeFilterConfig"]
506
505
  }; }
@@ -8,11 +8,11 @@ const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
8
8
  const core = require('@sankhyalabs/core');
9
9
  const filterBarConfigFetcher = require('./filter-bar-config-fetcher-75219599.js');
10
10
  const presentationMode = require('./presentationMode-52ec3bdd.js');
11
- const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7d959e91.js');
11
+ const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-cfcd9af2.js');
12
12
  require('./resource-fetcher-2979b54b.js');
13
13
  require('./DataFetcher-a9d0228f.js');
14
14
  require('./_commonjsHelpers-537d719a.js');
15
- require('./index-614af008.js');
15
+ require('./IExpressionItem-0e32ebb7.js');
16
16
 
17
17
  const SnkFilterDetail = class {
18
18
  constructor(hostRef) {
@@ -58,12 +58,9 @@ const SnkFilterDetail = class {
58
58
  return { tag: "snk-filter-number" };
59
59
  case filterItemType_enum.FilterItemType.PERSONALIZED:
60
60
  const snkFilterPersonalizedProps = {
61
- tag: "snk-filter-personalized", props: {
61
+ tag: "snk-personalized-filter-editor", props: {
62
62
  presentationMode: presentationMode.EPresentationMode.CHIP,
63
- onValueChanged: ({ detail }) => {
64
- const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
65
- this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
66
- }
63
+ onValueChanged: evt => this.handleValueChanged(evt),
67
64
  }
68
65
  };
69
66
  return snkFilterPersonalizedProps;
@@ -72,6 +69,10 @@ const SnkFilterDetail = class {
72
69
  }
73
70
  return { tag: "snk-filter-text" };
74
71
  }
72
+ handleValueChanged({ detail }) {
73
+ const groupedItems = (detail === null || detail === void 0 ? void 0 : detail.items) || this.config.groupedItems;
74
+ this.config = Object.assign(Object.assign({}, this.config), { groupedItems, visible: (groupedItems || []).filter(item => item.visible).length > 0 });
75
+ }
75
76
  removeItem() {
76
77
  const hasMultiValues = this.config.type === filterItemType_enum.FilterItemType.MULTI_LIST && Array.isArray(this.config.value);
77
78
  const newValue = hasMultiValues ? this.config.value.map((valueItem) => (Object.assign(Object.assign({}, valueItem), { check: false }))) : undefined;
@@ -81,6 +82,9 @@ const SnkFilterDetail = class {
81
82
  }
82
83
  this.changeConfig(removedConfig);
83
84
  }
85
+ removeItemFromGroup(item) {
86
+ return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
87
+ }
84
88
  getPopUpHeaderButtons() {
85
89
  return (index.h(index.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 })))));
86
90
  }
@@ -185,11 +185,7 @@ const SnkFilterItem = class {
185
185
  return `${label}: ${value.value} - ${value.label}`;
186
186
  }
187
187
  if (type === filterItemType_enum.FilterItemType.PERSONALIZED) {
188
- const activeCount = groupedItems.reduce((total, item) => {
189
- if (!!item.visible)
190
- return total + 1;
191
- return total;
192
- }, 0);
188
+ const activeCount = this.calculateActiveCount(groupedItems);
193
189
  if (activeCount <= 0)
194
190
  return label;
195
191
  return `${label}: ${this.getMessage('snkFilterBar.personalizedCount', { activeCount })}`;
@@ -213,6 +209,13 @@ const SnkFilterItem = class {
213
209
  }
214
210
  return label;
215
211
  }
212
+ calculateActiveCount(groupedItems) {
213
+ return groupedItems.reduce((total, item) => {
214
+ if (!!item.visible)
215
+ return total + 1;
216
+ return total;
217
+ }, 0);
218
+ }
216
219
  applyTooltip() {
217
220
  if (!this.config.value)
218
221
  return undefined;
@@ -261,13 +264,19 @@ const SnkFilterItem = class {
261
264
  }
262
265
  return undefined;
263
266
  }
267
+ hasActiveElements(value) {
268
+ var _a, _b, _c;
269
+ 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;
270
+ }
271
+ hasActiveValue(config) {
272
+ return (config.type !== filterItemType_enum.FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
273
+ }
264
274
  getEnabledChip() {
265
- var _a, _b, _c, _d;
266
275
  if (this.config.type === filterItemType_enum.FilterItemType.PERSONALIZED) {
267
276
  const { groupedItems = [] } = this.config;
268
277
  return groupedItems.some(item => item.visible);
269
278
  }
270
- return (filterItemType_enum.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);
279
+ return this.hasActiveValue(this.config);
271
280
  }
272
281
  render() {
273
282
  const leftIcon = this.getLeftIconName();
@@ -47,19 +47,21 @@ const SnkFilterModalItem = class {
47
47
  case filterItemType_enum.FilterItemType.NUMBER:
48
48
  return { tag: "snk-filter-number" };
49
49
  case filterItemType_enum.FilterItemType.PERSONALIZED:
50
- const snkFilterPersonalizedProps = {
51
- tag: "snk-filter-personalized", props: {
52
- onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, filterItemType_enum.FilterItemType.PERSONALIZED),
53
- onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
54
- onAddFilter: () => this.addPersonalizedFilter.emit(),
55
- }
56
- };
57
- return snkFilterPersonalizedProps;
50
+ return this.buildSnkFilterPersonalizedProps();
58
51
  case filterItemType_enum.FilterItemType.MULTI_LIST:
59
52
  return { tag: "snk-entity-list", props: { maxHeightList: "640px", rightListSlotBuilder: item => this.buildRightSlot(item) } };
60
53
  }
61
54
  return { tag: "snk-filter-text" };
62
55
  }
56
+ buildSnkFilterPersonalizedProps() {
57
+ return {
58
+ tag: "snk-personalized-filter-editor", props: {
59
+ onDeleteFilter: (event) => this.handleDeleteFilter(event.detail, filterItemType_enum.FilterItemType.PERSONALIZED),
60
+ onEditFilter: (event) => this.editPersonalizedFilter.emit(event.detail),
61
+ onAddFilter: () => this.addPersonalizedFilter.emit(),
62
+ }
63
+ };
64
+ }
63
65
  isVisible(newValue) {
64
66
  return !this.filterItem.visible ? newValue !== undefined : true;
65
67
  }
@@ -8,8 +8,8 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
8
8
  const filterType_enum = require('./filter-type.enum-b14ce507.js');
9
9
  const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
10
10
  const core = require('@sankhyalabs/core');
11
- const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7d959e91.js');
12
- require('./index-614af008.js');
11
+ const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-cfcd9af2.js');
12
+ require('./IExpressionItem-0e32ebb7.js');
13
13
 
14
14
  const snkFilterModalCss = "ez-modal{--ez-modal-content-padding:24px 12px}.snk-filter-modal__container{width:344px;max-width:344px;min-width:344px;overflow:hidden}.snk-filter-modal__content{display:flex;flex-direction:column;gap:var(--space--medium, 12px);padding-right:var(--space--3xs, 4px)}.snk-filter-modal__collapsible-box{border:var(--border--small, 1px solid) var(--color--strokes, #DCE0E8);border-radius:var(--border--radius-medium);padding:var(--space--medium, 12px) var(--space--small, 6px)}.snk-filter-modal__rendered-items{max-height:760px;overflow-x:clip;overflow-y:auto}.snk-filter-modal__rendered-items::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";
15
15
 
@@ -75,7 +75,7 @@ const SnkFilterModal = class {
75
75
  });
76
76
  }
77
77
  handleClose() {
78
- const hasChangesToSave = JSON.stringify(this.filters) !== JSON.stringify(this._originalFilterConfig);
78
+ const hasChangesToSave = core.ObjectUtils.objectToString(this.filters) !== core.ObjectUtils.objectToString(this._originalFilterConfig);
79
79
  if (!hasChangesToSave) {
80
80
  this.closeModal();
81
81
  return;
@@ -85,13 +85,19 @@ const SnkFilterModal = class {
85
85
  this.closeModal();
86
86
  });
87
87
  }
88
- validatePersonalizedFilter() {
88
+ handleApplyFilters() {
89
89
  const filterPersonalized = this.filters.find(filter => filter.filterType === filterType_enum.FilterType.CUSTOM_FILTER);
90
+ if (this.isValidCustomFilter(filterPersonalized)) {
91
+ this.applyFilters(this.filters);
92
+ }
93
+ }
94
+ isValidCustomFilter(filterPersonalized) {
90
95
  const isValid = PersonalizedFilterUtils.PersonalizedFilterUtils.validateVariableValues(filterPersonalized);
91
96
  if (!isValid) {
92
- return utils.ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
97
+ utils.ApplicationUtils.alert(this.getCustomMessage('validations.notFullFilled.title'), this.getCustomMessage('validations.notFullFilled.message'));
98
+ return false;
93
99
  }
94
- this.applyFilters(this.filters);
100
+ return true;
95
101
  }
96
102
  modalActionListener(evt) {
97
103
  const modalAction = evt.detail;
@@ -100,7 +106,7 @@ const SnkFilterModal = class {
100
106
  this.handleClearAll();
101
107
  break;
102
108
  case ezModalContainer.ModalAction.OK:
103
- this.validatePersonalizedFilter();
109
+ this.handleApplyFilters();
104
110
  break;
105
111
  case ezModalContainer.ModalAction.CLOSE:
106
112
  this.handleClose();
@@ -5,11 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
8
- const taskbarElements = require('./taskbar-elements-7f91f4cd.js');
8
+ const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
9
9
  const ConfigStorage = require('./ConfigStorage-0a738cdc.js');
10
- const index$1 = require('./index-614af008.js');
10
+ const index$1 = require('./index-0e663819.js');
11
11
  const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
12
12
  const index$2 = require('./index-102ba62d.js');
13
+ const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-804ff4c7.js');
13
14
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
14
15
  require('./form-config-fetcher-92bc8fe7.js');
15
16
  require('./DataFetcher-a9d0228f.js');
@@ -18,35 +19,6 @@ require('./resource-fetcher-2979b54b.js');
18
19
  require('./filter-bar-config-fetcher-75219599.js');
19
20
  require('./filter-item-type.enum-aa823a00.js');
20
21
 
21
- class SnkMultiSelectionListDataSource {
22
- setDataUnit(dataUnit) {
23
- this._dataUnit = dataUnit;
24
- }
25
- setApplication(application) {
26
- this._application = application;
27
- }
28
- formatLabel(fieldName, value) {
29
- const { userInterface } = this._dataUnit.getField(fieldName);
30
- if (userInterface === core.UserInterface.DATETIME) {
31
- return core.DateUtils.formatDate(this._dataUnit.valueFromString(fieldName, value));
32
- }
33
- return String(this._dataUnit.getFormattedValue(fieldName, value));
34
- }
35
- fetchData(filterTerm, fieldName) {
36
- return new Promise(resolve => {
37
- this._application.executeSelectDistinct(this._dataUnit, fieldName, filterTerm).then(result => {
38
- resolve(result.map(item => {
39
- const field = this._dataUnit.getField(fieldName);
40
- if (field.userInterface === core.UserInterface.SEARCH) {
41
- return Object.assign(Object.assign({}, JSON.parse(item)), { check: true });
42
- }
43
- return { value: item, label: this.formatLabel(fieldName, item), check: true };
44
- }));
45
- });
46
- });
47
- }
48
- }
49
-
50
22
  const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:300px}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
51
23
 
52
24
  const SnkGrid = class {
@@ -54,7 +26,7 @@ const SnkGrid = class {
54
26
  index.registerInstance(this, hostRef);
55
27
  this.actionClick = index.createEvent(this, "actionClick", 7);
56
28
  this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
57
- this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
29
+ this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
58
30
  this._topTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
59
31
  "snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
60
32
  "snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
@@ -5,11 +5,11 @@ const core = require('@sankhyalabs/core');
5
5
  const SnkFormConfigManager = require('./SnkFormConfigManager-a583f503.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
8
- const taskbarElements = require('./taskbar-elements-7f91f4cd.js');
8
+ const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
9
9
  const constants = require('./constants-d187e03e.js');
10
10
  require('./DataFetcher-a9d0228f.js');
11
11
  require('./pesquisa-fetcher-954b74c3.js');
12
- const index$1 = require('./index-614af008.js');
12
+ const index$1 = require('./index-0e663819.js');
13
13
 
14
14
  const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
15
15
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-7bedfa91.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-27586701.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
8
  require('./SnkFormConfigManager-a583f503.js');
@@ -15,8 +15,8 @@ require('./filter-bar-config-fetcher-75219599.js');
15
15
  require('./filter-item-type.enum-aa823a00.js');
16
16
  require('@sankhyalabs/ezui/dist/collection/utils/form');
17
17
  require('./taskbar-processor-bce3f499.js');
18
- require('./taskbar-elements-7f91f4cd.js');
19
- require('./index-614af008.js');
18
+ require('./taskbar-elements-b98dd6e9.js');
19
+ require('./index-0e663819.js');
20
20
  require('./index-102ba62d.js');
21
21
  require('./constants-d187e03e.js');
22
22
  require('./pesquisa-fetcher-954b74c3.js');