@sankhyalabs/sankhyablocks 1.4.0-beta.1 → 1.4.0-beta.2

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 (120) hide show
  1. package/dist/cjs/{SnkMessageBuilder-7717f1e4.js → SnkMessageBuilder-d8215915.js} +14 -119
  2. package/dist/cjs/{filter-item-type.enum-e2e1bc5b.js → filter-item-type.enum-3daf58d3.js} +2 -0
  3. package/dist/cjs/index-84fe3b86.js +20 -0
  4. package/dist/cjs/index-93965c41.js +141 -0
  5. package/dist/cjs/{index-02201bc9.js → index-e90ae303.js} +11 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  8. package/dist/cjs/snk-application.cjs.entry.js +43 -25
  9. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  10. package/dist/cjs/snk-data-unit.cjs.entry.js +10 -18
  11. package/dist/cjs/snk-filter-bar.cjs.entry.js +334 -146
  12. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-filter-detail.cjs.entry.js +37 -2
  14. package/dist/cjs/snk-filter-item.cjs.entry.js +34 -11
  15. package/dist/cjs/snk-filter-list.cjs.entry.js +1 -1
  16. package/dist/cjs/snk-filter-modal.cjs.entry.js +37 -0
  17. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  18. package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
  19. package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
  20. package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
  21. package/dist/cjs/snk-filter-search.cjs.entry.js +2 -2
  22. package/dist/cjs/snk-form.cjs.entry.js +1 -1
  23. package/dist/cjs/snk-grid.cjs.entry.js +1 -1
  24. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  25. package/dist/cjs/snk-taskbar.cjs.entry.js +1 -1
  26. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  27. package/dist/collection/collection-manifest.json +2 -0
  28. package/dist/collection/components/snk-application/snk-application.js +54 -7
  29. package/dist/collection/components/snk-crud/snk-crud.js +2 -4
  30. package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -27
  31. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
  32. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +161 -0
  33. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +2 -0
  34. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +36 -1
  35. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +32 -9
  36. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +196 -0
  37. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +22 -0
  38. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +238 -139
  39. package/dist/collection/components/snk-grid/snk-grid.js +2 -4
  40. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +18 -10
  41. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -2
  42. package/dist/components/SnkMessageBuilder.js +15 -119
  43. package/dist/components/filter-item-type.enum.js +2 -0
  44. package/dist/components/index.d.ts +2 -0
  45. package/dist/components/index.js +2 -0
  46. package/dist/components/index2.js +11 -1
  47. package/dist/components/index3.js +139 -0
  48. package/dist/components/snk-application2.js +39 -19
  49. package/dist/components/snk-crud.js +15 -9
  50. package/dist/components/snk-data-unit.js +2 -11
  51. package/dist/components/snk-filter-bar2.js +340 -146
  52. package/dist/components/snk-filter-detail2.js +36 -1
  53. package/dist/components/snk-filter-item2.js +32 -9
  54. package/dist/components/snk-filter-list2.js +1 -1
  55. package/dist/components/snk-filter-modal.d.ts +11 -0
  56. package/dist/components/snk-filter-modal.js +6 -0
  57. package/dist/components/snk-filter-modal2.js +73 -0
  58. package/dist/components/snk-filter-personalized.d.ts +11 -0
  59. package/dist/components/snk-filter-personalized.js +107 -0
  60. package/dist/components/snk-grid2.js +15 -9
  61. package/dist/{sankhyablocks/SnkMessageBuilder-a7da466b.js → esm/SnkMessageBuilder-35a20271.js} +15 -119
  62. package/dist/esm/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
  63. package/dist/esm/index-5992b7e6.js +139 -0
  64. package/dist/esm/{index-f1d3e4da.js → index-c683b2b0.js} +11 -1
  65. package/dist/esm/index-c71285cb.js +17 -0
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/sankhyablocks.js +1 -1
  68. package/dist/esm/snk-application.entry.js +37 -19
  69. package/dist/esm/snk-crud.entry.js +1 -1
  70. package/dist/esm/snk-data-unit.entry.js +3 -11
  71. package/dist/esm/snk-filter-bar.entry.js +328 -140
  72. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  73. package/dist/esm/snk-filter-detail.entry.js +37 -2
  74. package/dist/esm/snk-filter-item.entry.js +34 -11
  75. package/dist/esm/snk-filter-list.entry.js +1 -1
  76. package/dist/esm/snk-filter-modal.entry.js +33 -0
  77. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  78. package/dist/esm/snk-filter-number.entry.js +1 -1
  79. package/dist/esm/snk-filter-period.entry.js +1 -1
  80. package/dist/esm/snk-filter-personalized.entry.js +85 -0
  81. package/dist/esm/snk-filter-search.entry.js +2 -2
  82. package/dist/esm/snk-form.entry.js +1 -1
  83. package/dist/esm/snk-grid.entry.js +1 -1
  84. package/dist/esm/snk-pesquisa.entry.js +1 -1
  85. package/dist/esm/snk-taskbar.entry.js +1 -1
  86. package/dist/esm/teste-pesquisa.entry.js +1 -1
  87. package/dist/{esm/SnkMessageBuilder-a7da466b.js → sankhyablocks/SnkMessageBuilder-35a20271.js} +15 -119
  88. package/dist/sankhyablocks/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
  89. package/dist/sankhyablocks/index-5992b7e6.js +139 -0
  90. package/dist/sankhyablocks/{index-f1d3e4da.js → index-c683b2b0.js} +11 -1
  91. package/dist/sankhyablocks/index-c71285cb.js +17 -0
  92. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  93. package/dist/sankhyablocks/snk-application.entry.js +37 -19
  94. package/dist/sankhyablocks/snk-crud.entry.js +1 -1
  95. package/dist/sankhyablocks/snk-data-unit.entry.js +3 -11
  96. package/dist/sankhyablocks/snk-filter-bar.entry.js +328 -140
  97. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +1 -1
  98. package/dist/sankhyablocks/snk-filter-detail.entry.js +37 -2
  99. package/dist/sankhyablocks/snk-filter-item.entry.js +34 -11
  100. package/dist/sankhyablocks/snk-filter-list.entry.js +1 -1
  101. package/dist/sankhyablocks/snk-filter-modal.entry.js +33 -0
  102. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +1 -1
  103. package/dist/sankhyablocks/snk-filter-number.entry.js +1 -1
  104. package/dist/sankhyablocks/snk-filter-period.entry.js +1 -1
  105. package/dist/sankhyablocks/snk-filter-personalized.entry.js +85 -0
  106. package/dist/sankhyablocks/snk-filter-search.entry.js +2 -2
  107. package/dist/sankhyablocks/snk-form.entry.js +1 -1
  108. package/dist/sankhyablocks/snk-grid.entry.js +1 -1
  109. package/dist/sankhyablocks/snk-pesquisa.entry.js +1 -1
  110. package/dist/sankhyablocks/snk-taskbar.entry.js +1 -1
  111. package/dist/sankhyablocks/teste-pesquisa.entry.js +1 -1
  112. package/dist/types/components/snk-application/snk-application.d.ts +4 -1
  113. package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
  114. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +23 -0
  115. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +3 -1
  116. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +2 -0
  117. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +23 -0
  118. package/dist/types/components.d.ts +56 -8
  119. package/package.json +3 -3
  120. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -51
@@ -2,19 +2,120 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0b676c5.js');
6
- const index$1 = require('./index-02201bc9.js');
7
- const filterItemType_enum = require('./filter-item-type.enum-e2e1bc5b.js');
5
+ const index$1 = require('./index-b0b676c5.js');
6
+ const index = require('./index-e90ae303.js');
7
+ const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
8
+ const index$2 = require('./index-84fe3b86.js');
8
9
 
9
- const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 1);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;flex-grow:0}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px)}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.preselected.sc-snk-filter-bar{background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}";
10
+ const buildFilter = (item) => {
11
+ switch (item.type) {
12
+ case filterItemType_enum.FilterItemType.DEFAULT_FILTER:
13
+ return buildDefault(item);
14
+ case filterItemType_enum.FilterItemType.BINARY_SELECT:
15
+ return buildBinary(item);
16
+ case filterItemType_enum.FilterItemType.MULTI_SELECT:
17
+ return buildMultSelect(item);
18
+ case filterItemType_enum.FilterItemType.PERIOD:
19
+ return buildPeriod(item);
20
+ case filterItemType_enum.FilterItemType.SEARCH:
21
+ return buildSearch(item);
22
+ case filterItemType_enum.FilterItemType.TEXT:
23
+ return buildText(item);
24
+ case filterItemType_enum.FilterItemType.NUMBER:
25
+ return buildNumber(item);
26
+ case filterItemType_enum.FilterItemType.PERSONALIZED:
27
+ return buildPersonalized(item);
28
+ default:
29
+ return undefined;
30
+ }
31
+ };
32
+ function buildDefault(item) {
33
+ return { name: item.id, expression: item.props.expression, params: [] };
34
+ }
35
+ function buildBinary(item) {
36
+ const { id, value, props } = item;
37
+ const options = props.options;
38
+ const selectedOption = options.find(opt => opt.name === value);
39
+ return { name: id, expression: selectedOption.expression, params: [] };
40
+ }
41
+ function buildMultSelect(item) {
42
+ const { id, value, props } = item;
43
+ return { name: id, expression: props.expression, params: [{ name: id, dataType: index.DataType.TEXT, value }] };
44
+ }
45
+ function buildPeriod(item) {
46
+ const { id, value, props } = item;
47
+ let { end, start } = value;
48
+ if (typeof end === "string") {
49
+ end = new Date(end);
50
+ }
51
+ if (typeof start === "string") {
52
+ start = new Date(start);
53
+ }
54
+ const params = [];
55
+ let expression;
56
+ if (end && start) {
57
+ expression = props.expression.fullfill;
58
+ params.push({ name: `${id}.START`, dataType: index.DataType.DATE, value: index.toString(index.DataType.DATE, start) }, { name: `${id}.END`, dataType: index.DataType.DATE, value: index.toString(index.DataType.DATE, end) });
59
+ }
60
+ else {
61
+ if (start) {
62
+ expression = props.expression.onlystart;
63
+ params.push({ name: id, dataType: index.DataType.DATE, value: index.toString(index.DataType.DATE, start) });
64
+ }
65
+ else {
66
+ expression = props.expression.onlyend;
67
+ params.push({ name: id, dataType: index.DataType.DATE, value: index.toString(index.DataType.DATE, end) });
68
+ }
69
+ }
70
+ return { name: id, expression, params };
71
+ }
72
+ function buildSearch(item) {
73
+ const { id, value, props } = item;
74
+ const expression = props.expression;
75
+ return { name: id, expression, params: [{ name: id, dataType: index.DataType.TEXT, value: index.toString(index.DataType.TEXT, value.value) }] };
76
+ }
77
+ function buildText(item) {
78
+ const { id, value, props } = item;
79
+ const expression = props.expression;
80
+ return { name: id, expression, params: [{ name: id, dataType: index.DataType.TEXT, value: index.toString(index.DataType.TEXT, value) }] };
81
+ }
82
+ function buildNumber(item) {
83
+ const { id, value, props } = item;
84
+ const expression = props.expression;
85
+ return { name: id, expression, params: [{ name: id, dataType: index.DataType.NUMBER, value: index.toString(index.DataType.NUMBER, value) }] };
86
+ }
87
+ function buildPersonalized(item) {
88
+ var _a;
89
+ const { id, value, props } = item;
90
+ const expression = props.expression;
91
+ return {
92
+ name: id, expression, params: (((_a = props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || []).map((param, index$1) => {
93
+ const valuesArray = Array.from(value);
94
+ const dataType = param.dataType;
95
+ let paramValue = (index$1 >= 0 && index$1 < valuesArray.length ? valuesArray[index$1] : null);
96
+ if (paramValue != undefined && typeof paramValue === "object" && "value" in paramValue) {
97
+ paramValue = paramValue["value"];
98
+ }
99
+ if (paramValue == undefined && dataType === index.DataType.BOOLEAN) {
100
+ paramValue = false;
101
+ }
102
+ return { name: param.name, dataType, value: typeof paramValue === "string" ? paramValue : index.toString(dataType, paramValue) };
103
+ })
104
+ };
105
+ }
106
+
107
+ const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--more-visible, 1);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;flex-grow:0}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px)}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.preselected.sc-snk-filter-bar{background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{display:flex;flex-direction:row;border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium);width:100%}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:100%;height:100%}";
10
108
 
11
109
  const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
12
110
  const DEFAULT_FILTER = "DEFAULT_FILTER";
13
111
  const CLEAR_ALL_FILTERS = "CLEAR_ALL_FILTERS";
14
112
  const SnkFilterBar = class {
15
113
  constructor(hostRef) {
16
- index.registerInstance(this, hostRef);
114
+ index$1.registerInstance(this, hostRef);
17
115
  this._updateSequence = [];
116
+ this._loadingPending = false;
117
+ this._configUpdated = false;
118
+ this._pendingFilters = [];
18
119
  this._calculateSortIndex = (item) => {
19
120
  let index = item.hardFixed ? 1000000 : 0;
20
121
  //campos Hard Fixed não variam a ordem
@@ -29,6 +130,54 @@ const SnkFilterBar = class {
29
130
  return this._calculateSortIndex(b) - this._calculateSortIndex(a);
30
131
  };
31
132
  }
133
+ observeFilterConfig(newValue, oldValue) {
134
+ if (oldValue != undefined && newValue == undefined) {
135
+ this._loadingPending = true;
136
+ this._configUpdated = true;
137
+ }
138
+ else {
139
+ const oldItems = new Map(oldValue ? oldValue.map(item => [item.id, item]) : undefined);
140
+ newValue.forEach(newItem => {
141
+ const oldItem = oldItems.get(newItem.id);
142
+ if (oldItem != undefined) {
143
+ this._configUpdated = this._configUpdated || index.ObjectUtils.objectToString(oldItem) != index.ObjectUtils.objectToString(newItem);
144
+ this._loadingPending = this._loadingPending || index.ObjectUtils.objectToString(oldItem.value) !== index.ObjectUtils.objectToString(newItem.value);
145
+ }
146
+ else {
147
+ this._configUpdated = true;
148
+ this._loadingPending = this._loadingPending || newItem.value != undefined;
149
+ }
150
+ });
151
+ }
152
+ this.processAfterUpdateConfig();
153
+ }
154
+ processPendingFilter() {
155
+ if (this._pendingFilters.length > 0 && this._currentPendingFilter == undefined) {
156
+ this._currentPendingFilter = this._element.querySelector("#filter-" + this._pendingFilters.pop());
157
+ if (this._currentPendingFilter) {
158
+ this._currentPendingFilter.showUp(true).then(() => {
159
+ this._currentPendingFilter = undefined;
160
+ this.processPendingFilter();
161
+ });
162
+ }
163
+ }
164
+ if (this._currentPendingFilter == undefined) {
165
+ this.processAfterUpdateConfig();
166
+ }
167
+ }
168
+ processAfterUpdateConfig() {
169
+ if (this._pendingFilters.length > 0) {
170
+ return;
171
+ }
172
+ if (this._loadingPending) {
173
+ this._loadingPending = false;
174
+ this.dataUnit.loadData();
175
+ }
176
+ if (this._configUpdated) {
177
+ this._configUpdated = false;
178
+ this._application.saveFilterBarConfig(this.filterConfig, this.configName);
179
+ }
180
+ }
32
181
  /**
33
182
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
34
183
  * através de um pequeno modulo na estrutura da aplicação:
@@ -41,101 +190,21 @@ const SnkFilterBar = class {
41
190
  getFilter(_dataUnit) {
42
191
  var _a;
43
192
  const filters = [];
44
- (_a = this.filterConfig) === null || _a === void 0 ? void 0 : _a.filter(item => item.value).forEach(item => {
45
- const filter = this.buildDUFilter(item);
193
+ (_a = this.filterConfig) === null || _a === void 0 ? void 0 : _a.filter(item => this.isActiveFilter(item)).forEach(item => {
194
+ const filter = buildFilter(item);
46
195
  if (filter) {
47
196
  filters.push(filter);
48
197
  }
49
198
  });
50
199
  return filters;
51
200
  }
52
- buildDUFilter(item) {
53
- const { id, value, type, props, visible } = item;
54
- if (value && visible) {
55
- if (type === filterItemType_enum.FilterItemType.BINARY_SELECT) {
56
- const options = props.options;
57
- const selectedOption = options.find(opt => opt.name === value);
58
- //FIXME: ajustar o backend para não exigir parametros
59
- return { name: id, expression: selectedOption.expression, params: [] };
60
- }
61
- if (type === filterItemType_enum.FilterItemType.MULTI_SELECT) {
62
- return { name: id, expression: props.expression, params: [{ name: id, dataType: index$1.DataType.TEXT, value }] };
63
- }
64
- if (type === filterItemType_enum.FilterItemType.PERIOD) {
65
- let { end, start } = value;
66
- if (typeof end === "string") {
67
- end = new Date(end);
68
- }
69
- if (typeof start === "string") {
70
- start = new Date(start);
71
- }
72
- const params = [];
73
- let expression;
74
- if (end && start) {
75
- expression = props.expression.fullfill;
76
- params.push({ name: `${id}.START`, dataType: index$1.DataType.DATE, value: index$1.toString(index$1.DataType.DATE, start) }, { name: `${id}.END`, dataType: index$1.DataType.DATE, value: index$1.toString(index$1.DataType.DATE, end) });
77
- }
78
- else {
79
- if (start) {
80
- expression = props.expression.onlystart;
81
- params.push({ name: id, dataType: index$1.DataType.DATE, value: index$1.toString(index$1.DataType.DATE, start) });
82
- }
83
- else {
84
- expression = props.expression.onlyend;
85
- params.push({ name: id, dataType: index$1.DataType.DATE, value: index$1.toString(index$1.DataType.DATE, end) });
86
- }
87
- }
88
- return { name: id, expression, params };
89
- }
90
- if (type === filterItemType_enum.FilterItemType.SEARCH) {
91
- const expression = props.expression;
92
- return { name: id, expression, params: [{ name: id, dataType: index$1.DataType.TEXT, value: index$1.toString(index$1.DataType.TEXT, value.value) }] };
93
- }
94
- if (type === filterItemType_enum.FilterItemType.TEXT) {
95
- const expression = props.expression;
96
- return { name: id, expression, params: [{ name: id, dataType: index$1.DataType.TEXT, value: index$1.toString(index$1.DataType.TEXT, value) }] };
97
- }
98
- if (type === filterItemType_enum.FilterItemType.NUMBER) {
99
- const expression = props.expression;
100
- return { name: id, expression, params: [{ name: id, dataType: index$1.DataType.NUMBER, value: index$1.toString(index$1.DataType.NUMBER, value) }] };
101
- }
102
- //No mapeamento dos outros tipos precisamos saber o tipo de dado.
103
- }
104
- return undefined;
201
+ isActiveFilter(item) {
202
+ return (item.visible && item.value != undefined) || item.type === filterItemType_enum.FilterItemType.DEFAULT_FILTER;
105
203
  }
106
- componentWillLoad() {
107
- this._application = index$1.ApplicationContext.getContextValue("__SNK__APPLICATION__");
108
- if (this._application) {
109
- this._application.getFilterBarConfig(this.configName)
110
- .then((filters) => {
111
- this.filterConfig = filters;
112
- })
113
- .catch(reason => {
114
- throw new index$1.ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
115
- });
116
- }
117
- if (this.dataUnit == undefined) {
118
- let parent = this._element.parentElement;
119
- while (parent) {
120
- if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
121
- const snkDataUnit = parent;
122
- this.dataUnit = snkDataUnit.dataUnit;
123
- if (this.dataUnit) {
124
- this.dataUnit.addFilterProvider(this);
125
- }
126
- else {
127
- snkDataUnit.addEventListener("dataUnitReady", (evt) => {
128
- this.dataUnit = evt.detail;
129
- this.dataUnit.addFilterProvider(this);
130
- });
131
- }
132
- break;
133
- }
134
- }
135
- parent = parent.parentElement;
136
- }
137
- else {
138
- this.dataUnit.addFilterProvider(this);
204
+ registryFilterProvider() {
205
+ this.dataUnit.addFilterProvider(this);
206
+ if (this.filterConfig) {
207
+ this.dataUnit.loadData();
139
208
  }
140
209
  }
141
210
  getFilterItems() {
@@ -143,9 +212,8 @@ const SnkFilterBar = class {
143
212
  const unpinnedItems = [];
144
213
  this.filterConfig
145
214
  .filter(item => item.visible)
146
- .sort((a, b) => this._filtersComparator(a, b))
147
- .forEach((item, index$1) => {
148
- const filterItem = (index.h("snk-filter-item", { id: `filter-${item.id}`, config: this.normalizeItem(item), class: index$1 > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
215
+ .forEach((item, index) => {
216
+ const filterItem = (index$1.h("snk-filter-item", { id: `filter-${item.id}`, config: item, class: index > 0 ? "ez-padding-left--medium" : "", getMessage: (key, props) => this.getMessage(key, props), key: item.id }));
149
217
  if (item.fixed || item.hardFixed) {
150
218
  pinnedItems.push(filterItem);
151
219
  }
@@ -157,7 +225,7 @@ const SnkFilterBar = class {
157
225
  const elements = [];
158
226
  elements.push(...pinnedItems);
159
227
  if (pinnedItems.length > 0 && unpinnedItems.length > 0) {
160
- elements.push(index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider" }));
228
+ elements.push(index$1.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider" }));
161
229
  }
162
230
  elements.push(...unpinnedItems);
163
231
  return elements;
@@ -168,9 +236,6 @@ const SnkFilterBar = class {
168
236
  this._updateSequence.push(item.id);
169
237
  }
170
238
  }
171
- filterChangeListener(evt) {
172
- this.updateFilter(evt.detail);
173
- }
174
239
  normalizeItem(item) {
175
240
  const normalized = Object.assign({}, item);
176
241
  const optionals = ["props", "value", "hardFixed", "fixed"];
@@ -184,94 +249,217 @@ const SnkFilterBar = class {
184
249
  }
185
250
  return normalized;
186
251
  }
187
- updateFilter(newItem, clear = false) {
188
- let needLoad = false;
189
- let updated = false;
252
+ updateFilter(newItem) {
190
253
  this.filterConfig = this.filterConfig.map(item => {
191
- if (clear) {
192
- if (item.value != undefined) {
193
- updated = true;
194
- needLoad = true;
195
- }
196
- return Object.assign(Object.assign({}, item), { value: undefined });
197
- }
198
- else {
199
- if (item.id === newItem.id) {
200
- const normalizedOne = this.normalizeItem(item);
201
- const normalizedTwo = this.normalizeItem(newItem);
202
- updated = index$1.ObjectUtils.objectToString(normalizedOne) != index$1.ObjectUtils.objectToString(normalizedTwo);
203
- needLoad = index$1.ObjectUtils.objectToString(normalizedOne.value) !== index$1.ObjectUtils.objectToString(normalizedTwo.value);
204
- return newItem;
254
+ newItem = this.normalizeItem(newItem);
255
+ if (item.id === newItem.id) {
256
+ if (index.ObjectUtils.objectToString(item) != index.ObjectUtils.objectToString(newItem)) {
257
+ this.calculateUpdateSequence(newItem);
205
258
  }
259
+ return newItem;
206
260
  }
207
261
  return item;
208
- });
209
- if (needLoad) {
210
- this.dataUnit.loadData();
211
- }
212
- if (updated) {
213
- this.calculateUpdateSequence(newItem);
214
- this._application.saveFilterBarConfig(this.filterConfig, this.configName);
215
- }
216
- return needLoad;
262
+ }).sort((a, b) => this._filtersComparator(a, b));
217
263
  }
218
264
  getAddListItems() {
219
265
  const hiddenItems = this.filterConfig
220
- .filter(item => !item.visible)
221
- .sort(this._filtersComparator);
222
- return hiddenItems.map(filter => {
223
- return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
224
- }).concat([
225
- { name: PERSONALIZED_FILTER, label: this.getMessage("snkFilterBar.customFilter"), iconName: "tune", kind: "FOOTER" },
226
- { name: DEFAULT_FILTER, label: this.getMessage("snkFilterBar.defaultFilter"), iconName: "configuration", kind: "FOOTER" }
227
- ]);
266
+ .filter(item => !item.visible && this.isListable(item));
267
+ const footerItems = [{ name: PERSONALIZED_FILTER, label: this.getMessage("snkFilterBar.customFilter"), iconName: "tune", kind: "FOOTER" }];
268
+ if (this.allowDefault) {
269
+ footerItems.push({ name: DEFAULT_FILTER, label: this.getMessage("snkFilterBar.defaultFilter"), iconName: "configuration", kind: "FOOTER" });
270
+ }
271
+ return hiddenItems.map(filter => { return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null }; })
272
+ .concat(footerItems);
228
273
  }
229
274
  getActiveClass() {
230
275
  const filterApplied = this.filterConfig.filter(item => item.value != undefined).length > 0;
231
276
  return filterApplied ? "sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active" : "";
232
277
  }
278
+ isListable(item, allowPersonalized = false) {
279
+ return item.type !== filterItemType_enum.FilterItemType.DEFAULT_FILTER && (allowPersonalized || item.type !== filterItemType_enum.FilterItemType.PERSONALIZED);
280
+ }
233
281
  getAppliedListItems() {
234
282
  const appliedItems = this.filterConfig
235
- .filter(item => item.value != undefined)
236
- .sort(this._filtersComparator);
283
+ .filter(item => this.isActiveFilter(item) && this.isListable(item, true));
237
284
  return appliedItems.map(filter => {
238
285
  return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
239
286
  }).concat([
240
287
  { name: CLEAR_ALL_FILTERS, label: this.getMessage("snkFilterBar.clearAllFilters"), iconName: "cleaning", kind: "FOOTER" }
241
288
  ]);
242
289
  }
290
+ addPersonalizedFilters(personalizedItems) {
291
+ const activeFilters = {};
292
+ personalizedItems.forEach(item => {
293
+ if (item.active) {
294
+ activeFilters[item.id] = true;
295
+ }
296
+ });
297
+ this.filterConfig = this.filterConfig.map(item => {
298
+ var _a, _b;
299
+ if (item.type === filterItemType_enum.FilterItemType.PERSONALIZED) {
300
+ const visible = activeFilters[item.id];
301
+ if (!item.visible && visible) {
302
+ this.calculateUpdateSequence(item);
303
+ if (((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters) != undefined) {
304
+ this._pendingFilters.push(item.id);
305
+ }
306
+ }
307
+ return this.normalizeItem(visible ? Object.assign(Object.assign({}, item), { visible }) : Object.assign(Object.assign({}, item), { visible, value: undefined, fixed: undefined }));
308
+ }
309
+ return item;
310
+ }).sort((a, b) => this._filtersComparator(a, b));
311
+ }
312
+ openDefaultFilterModal() {
313
+ const filterModal = document.createElement("snk-filter-modal");
314
+ const defaultFilter = this.filterConfig.filter(item => item.type === filterItemType_enum.FilterItemType.DEFAULT_FILTER);
315
+ filterModal.getMessage = (key, props) => this.getMessage(key, props);
316
+ filterModal.modalTitle = this.getMessage("snkFilterBar.modalDefaultFilterTitle");
317
+ filterModal.infoText = this.getMessage(defaultFilter.length == 0 ? "snkFilterBar.modalInfoTextCreateDefault" : "snkFilterBar.modalInfoTextEditDefault");
318
+ filterModal.items = defaultFilter.map(item => {
319
+ return { id: item.id, active: true, enabled: false, label: item.label };
320
+ });
321
+ filterModal.processModalAction = (_action) => {
322
+ this._application.closeModal();
323
+ };
324
+ this._application.showModal(filterModal);
325
+ }
326
+ openPersonalizedModal() {
327
+ const filterModal = document.createElement("snk-filter-modal");
328
+ const personalizedFilter = this.filterConfig
329
+ .filter(item => item.type === filterItemType_enum.FilterItemType.PERSONALIZED)
330
+ .sort((itemA, itemB) => index.StringUtils.compare(itemA.label, itemB.label));
331
+ filterModal.getMessage = (key, props) => this.getMessage(key, props);
332
+ filterModal.modalTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterTitle");
333
+ filterModal.modalSubTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterSubTitle");
334
+ filterModal.okButtonLabel = this.getMessage("snkFilterBar.modalOkButtonLabel");
335
+ filterModal.cancelButtonLabel = this.getMessage("snkFilterBar.modalCancelButtonLabel");
336
+ filterModal.infoText = this.getMessage("snkFilterBar.modalInfoTextCreateEditPersonalized");
337
+ filterModal.useSearch = true;
338
+ filterModal.items = personalizedFilter.map(item => {
339
+ return { id: item.id, active: item.visible, enabled: true, label: item.label };
340
+ });
341
+ filterModal.processModalAction = (action) => {
342
+ if (action === index$2.ModalAction.CANCEL) {
343
+ // O Botão de cancelar, tem efeito específico:
344
+ // - Desmarcar todos os filtros personalizados.
345
+ filterModal.items = filterModal.items.map(item => {
346
+ return Object.assign(Object.assign({}, item), { active: false });
347
+ });
348
+ }
349
+ else {
350
+ if (action === index$2.ModalAction.OK) {
351
+ this.addPersonalizedFilters(filterModal.items);
352
+ }
353
+ this._application.closeModal();
354
+ }
355
+ };
356
+ this._application.showModal(filterModal);
357
+ }
358
+ clearFilters() {
359
+ let changed = false;
360
+ this.filterConfig = this.filterConfig.map(item => {
361
+ if (item.value != undefined) {
362
+ changed = true;
363
+ }
364
+ return Object.assign(Object.assign({}, item), { value: undefined });
365
+ }).sort((a, b) => this._filtersComparator(a, b));
366
+ return changed;
367
+ }
368
+ loadPermitions() {
369
+ this._application.isUserSup().then(value => this.allowDefault = value);
370
+ }
371
+ loadConfigFromApplication() {
372
+ this._application.getFilterBarConfig(this.configName)
373
+ .then((filters) => {
374
+ this.filterConfig = filters.map(item => this.normalizeItem(item));
375
+ if (this.dataUnit) {
376
+ this.dataUnit.loadData();
377
+ }
378
+ })
379
+ .catch(reason => {
380
+ throw new index.ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
381
+ });
382
+ }
383
+ attachDataUnit() {
384
+ if (this.dataUnit == undefined) {
385
+ let parent = this._element.parentElement;
386
+ while (parent) {
387
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
388
+ const snkDataUnit = parent;
389
+ this.dataUnit = snkDataUnit.dataUnit;
390
+ if (this.dataUnit) {
391
+ this.registryFilterProvider();
392
+ }
393
+ else {
394
+ snkDataUnit.addEventListener("dataUnitReady", (evt) => {
395
+ this.dataUnit = evt.detail;
396
+ this.registryFilterProvider();
397
+ });
398
+ }
399
+ break;
400
+ }
401
+ }
402
+ parent = parent.parentElement;
403
+ }
404
+ else {
405
+ this.registryFilterProvider();
406
+ }
407
+ }
408
+ filterChangeListener(evt) {
409
+ this.updateFilter(evt.detail);
410
+ }
243
411
  addFilterHandler(itemName) {
244
412
  const filterItem = this.filterConfig.find(currentFilter => currentFilter.id === itemName);
245
- if (filterItem) {
413
+ if (itemName === PERSONALIZED_FILTER) {
414
+ this.openPersonalizedModal();
415
+ }
416
+ else if (itemName === DEFAULT_FILTER) {
417
+ this.openDefaultFilterModal();
418
+ }
419
+ else if (filterItem) {
246
420
  this.updateFilter(Object.assign(Object.assign({}, filterItem), { visible: true }));
247
421
  window.requestAnimationFrame(() => {
248
- const itemElement = this._element.querySelector("#filter-" + itemName);
249
- if (itemElement) {
250
- itemElement.showUp();
422
+ const filterItemElement = this._element.querySelector("#filter-" + itemName);
423
+ if (filterItemElement) {
424
+ filterItemElement.showUp();
251
425
  }
252
426
  });
253
427
  }
254
428
  }
255
429
  appliedFilterHandler(itemName) {
256
430
  if (itemName === CLEAR_ALL_FILTERS) {
257
- if (this.updateFilter(null, true)) {
431
+ if (this.clearFilters()) {
258
432
  this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"), { iconName: "check" });
259
433
  }
260
434
  }
261
435
  else {
262
- const itemElement = this._element.querySelector("#filter-" + itemName);
263
- if (itemElement) {
264
- itemElement.showUp(true);
436
+ const filterItemElement = this._element.querySelector("#filter-" + itemName);
437
+ if (filterItemElement) {
438
+ filterItemElement.showUp(true);
265
439
  }
266
440
  }
267
441
  }
442
+ componentWillLoad() {
443
+ this._application = index.ApplicationContext.getContextValue("__SNK__APPLICATION__");
444
+ if (this._application) {
445
+ this.loadPermitions();
446
+ this.loadConfigFromApplication();
447
+ }
448
+ this.attachDataUnit();
449
+ }
450
+ componentDidRender() {
451
+ this.processPendingFilter();
452
+ }
268
453
  render() {
269
454
  if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
270
455
  return undefined;
271
456
  }
272
- return (index.h(index.Host, null, index.h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), index.h("snk-filter-list", { items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail) }), index.h("snk-filter-list", { items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail) }, index.h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
457
+ return (index$1.h(index$1.Host, null, index$1.h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), index$1.h("snk-filter-list", { items: this.getAppliedListItems(), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyAppliedFiltersList"), findFilterText: this.getMessage("snkFilterBar.findFilter"), iconName: "filter", class: "ez-padding-left--medium", buttonClass: this.getActiveClass(), onSnkItemSelected: evt => this.appliedFilterHandler(evt.detail) }), index$1.h("snk-filter-list", { items: this.getAddListItems(), label: this.getMessage("snkFilterBar.addFilter"), getMessage: (key, params) => this.getMessage(key, params), emptyText: this.getMessage("snkFilterBar.emptyFiltersList"), findFilterText: this.getMessage("snkFilterBar.findField"), class: "ez-padding-left--medium", onSnkItemSelected: evt => this.addFilterHandler(evt.detail) }, index$1.h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
273
458
  }
274
- get _element() { return index.getElement(this); }
459
+ get _element() { return index$1.getElement(this); }
460
+ static get watchers() { return {
461
+ "filterConfig": ["observeFilterConfig"]
462
+ }; }
275
463
  };
276
464
  SnkFilterBar.style = snkFilterBarCss;
277
465
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b0b676c5.js');
6
- const filterItemType_enum = require('./filter-item-type.enum-e2e1bc5b.js');
6
+ const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
7
7
 
8
8
  const SnkFilterBinarySelect = class {
9
9
  constructor(hostRef) {
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b0b676c5.js');
6
- const filterItemType_enum = require('./filter-item-type.enum-e2e1bc5b.js');
6
+ const index$1 = require('./index-93965c41.js');
7
+ const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
7
8
 
8
9
  const SnkFilterDetail = class {
9
10
  constructor(hostRef) {
@@ -25,6 +26,8 @@ const SnkFilterDetail = class {
25
26
  return "snk-filter-search";
26
27
  case filterItemType_enum.FilterItemType.NUMBER:
27
28
  return "snk-filter-number";
29
+ case filterItemType_enum.FilterItemType.PERSONALIZED:
30
+ return "snk-filter-personalized";
28
31
  }
29
32
  return "snk-filter-text";
30
33
  }
@@ -40,9 +43,41 @@ const SnkFilterDetail = class {
40
43
  index.h("ez-icon", { title: this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), class: "ez-margin-left--small sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: this.config.fixed ? "un-pin" : "push-pin", onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })) })
41
44
  ]);
42
45
  }
46
+ apply() {
47
+ var _a;
48
+ let isValid = true;
49
+ const value = this._editor["value"];
50
+ /* WARNING: Temporário. Isso só está sendo feito até desconsiderar os parametros não informados para PersonalizedFilter*/
51
+ if (value != undefined && this.config.type === filterItemType_enum.FilterItemType.PERSONALIZED) {
52
+ const params = ((_a = this.config.props.personalizedFilter) === null || _a === void 0 ? void 0 : _a.parameters) || [];
53
+ if (params.length > 1) {
54
+ if (params.length > value.length) {
55
+ isValid = false;
56
+ }
57
+ else {
58
+ value.forEach(item => {
59
+ if (item == undefined) {
60
+ isValid = false;
61
+ }
62
+ });
63
+ }
64
+ }
65
+ if (!isValid) {
66
+ this.keepOpened = true;
67
+ index$1.ApplicationUtils.alert("Filtro parcialmente preenchido", "Favor completar todas as informações do filtro.").then(() => setTimeout(() => this.keepOpened = false, 1));
68
+ }
69
+ }
70
+ /* WARNING: Temporário.*/
71
+ if (isValid) {
72
+ this.changeConfig(Object.assign(Object.assign({}, this.config), { value: value }));
73
+ }
74
+ }
75
+ clear() {
76
+ this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined }));
77
+ }
43
78
  render() {
44
79
  const ContentEditor = this.getContentEditor();
45
- return (index.h(index.Host, null, index.h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, index.h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), index.h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), index.h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), index.h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, index.h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), index.h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: this._editor["value"] })), class: "ez-button--primary ez-padding-left--medium" }))));
80
+ return (index.h(index.Host, null, index.h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, index.h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), index.h(ContentEditor, { ref: ref => this._editor = ref, value: this.config.value, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), index.h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), index.h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, index.h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" }), index.h("ez-button", { label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
46
81
  }
47
82
  };
48
83