@sankhyalabs/sankhyablocks 1.3.31-beta.16 → 1.3.31-beta.18

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 (190) hide show
  1. package/dist/cjs/{SnkMessageBuilder-79cf15c5.js → SnkMessageBuilder-02c2ca02.js} +137 -1
  2. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  3. package/dist/cjs/css-shim-b8158822.js +6 -0
  4. package/dist/cjs/dom-36862b77.js +75 -0
  5. package/dist/cjs/filter-item-type.enum-e2e1bc5b.js +14 -0
  6. package/dist/cjs/index-02201bc9.js +2397 -0
  7. package/dist/cjs/{index-5575fe3d.js → index-b0b676c5.js} +1598 -145
  8. package/dist/cjs/loader.cjs.js +18 -2
  9. package/dist/cjs/sankhyablocks.cjs.js +116 -4
  10. package/dist/cjs/shadow-css-346c0795.js +389 -0
  11. package/dist/cjs/snk-application.cjs.entry.js +662 -66
  12. package/dist/cjs/snk-crud.cjs.entry.js +3 -2
  13. package/dist/cjs/snk-data-unit.cjs.entry.js +23 -24
  14. package/dist/cjs/snk-filter-bar.cjs.entry.js +247 -0
  15. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +47 -0
  16. package/dist/cjs/snk-filter-detail.cjs.entry.js +49 -0
  17. package/dist/cjs/snk-filter-item.cjs.entry.js +143 -0
  18. package/dist/cjs/snk-filter-list.cjs.entry.js +91 -0
  19. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +23 -0
  20. package/dist/cjs/snk-filter-number.cjs.entry.js +24 -0
  21. package/dist/cjs/snk-filter-period.cjs.entry.js +26 -0
  22. package/dist/cjs/snk-filter-search.cjs.entry.js +44 -0
  23. package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
  24. package/dist/cjs/{snk-form_2.cjs.entry.js → snk-form.cjs.entry.js} +21 -65
  25. package/dist/cjs/snk-grid.cjs.entry.js +79 -0
  26. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  27. package/dist/cjs/snk-taskbar.cjs.entry.js +17 -13
  28. package/dist/cjs/{taskbar-elements-2ae0d005.js → taskbar-elements-283c737e.js} +37 -18
  29. package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
  30. package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
  31. package/dist/collection/collection-manifest.json +10 -0
  32. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +7 -0
  33. package/dist/collection/components/snk-application/snk-application.js +89 -17
  34. package/dist/collection/components/snk-crud/snk-crud.js +41 -3
  35. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +88 -0
  36. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +64 -0
  37. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +65 -0
  38. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +69 -0
  39. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +118 -0
  40. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
  41. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +10 -0
  42. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +118 -0
  43. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +244 -0
  44. package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +233 -0
  45. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +114 -0
  46. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +305 -0
  47. package/dist/collection/components/snk-form/snk-form.js +41 -1
  48. package/dist/collection/components/snk-grid/snk-grid.css +14 -1
  49. package/dist/collection/components/snk-grid/snk-grid.js +35 -3
  50. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +35 -17
  51. package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
  52. package/dist/collection/components/snk-taskbar/snk-taskbar.js +36 -11
  53. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +24 -2
  54. package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +1 -1
  55. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +388 -0
  56. package/dist/collection/lib/message/SnkMessageBuilder.js +3 -1
  57. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +18 -0
  58. package/dist/components/SnkMessageBuilder.js +137 -2
  59. package/dist/components/filter-item-type.enum.js +12 -0
  60. package/dist/components/index.d.ts +10 -0
  61. package/dist/components/index.js +14 -0
  62. package/dist/components/index2.js +2384 -0
  63. package/dist/components/snk-application2.js +628 -30
  64. package/dist/components/snk-crud.js +29 -3
  65. package/dist/components/snk-data-unit.js +2 -3
  66. package/dist/components/snk-filter-bar.d.ts +11 -0
  67. package/dist/components/snk-filter-bar.js +6 -0
  68. package/dist/components/snk-filter-bar2.js +278 -0
  69. package/dist/components/snk-filter-binary-select.d.ts +11 -0
  70. package/dist/components/snk-filter-binary-select.js +63 -0
  71. package/dist/components/snk-filter-detail.d.ts +11 -0
  72. package/dist/components/snk-filter-detail.js +6 -0
  73. package/dist/components/snk-filter-detail2.js +63 -0
  74. package/dist/components/snk-filter-item.d.ts +11 -0
  75. package/dist/components/snk-filter-item.js +6 -0
  76. package/dist/components/snk-filter-item2.js +164 -0
  77. package/dist/components/snk-filter-list.d.ts +11 -0
  78. package/dist/components/snk-filter-list.js +6 -0
  79. package/dist/components/snk-filter-list2.js +111 -0
  80. package/dist/components/snk-filter-multi-select.d.ts +11 -0
  81. package/dist/components/snk-filter-multi-select.js +39 -0
  82. package/dist/components/snk-filter-number.d.ts +11 -0
  83. package/dist/components/snk-filter-number.js +40 -0
  84. package/dist/components/snk-filter-period.d.ts +11 -0
  85. package/dist/components/snk-filter-period.js +42 -0
  86. package/dist/components/snk-filter-search.d.ts +11 -0
  87. package/dist/components/snk-filter-search.js +62 -0
  88. package/dist/components/snk-filter-text.d.ts +11 -0
  89. package/dist/components/snk-filter-text.js +38 -0
  90. package/dist/components/snk-form2.js +21 -2
  91. package/dist/components/snk-grid2.js +42 -7
  92. package/dist/components/snk-pesquisa2.js +1 -1
  93. package/dist/components/snk-taskbar2.js +50 -27
  94. package/dist/components/taskbar-processor.js +45 -0
  95. package/dist/components/teste-pesquisa.js +1 -1
  96. package/dist/esm/{SnkMessageBuilder-3cdde541.js → SnkMessageBuilder-65d431bd.js} +137 -2
  97. package/dist/esm/app-globals-0f993ce5.js +3 -0
  98. package/dist/esm/css-shim-b3f2ee8d.js +4 -0
  99. package/dist/esm/dom-665d6011.js +73 -0
  100. package/dist/esm/filter-item-type.enum-61fbf80a.js +12 -0
  101. package/dist/esm/index-2b4d2d14.js +3262 -0
  102. package/dist/esm/index-e5b61043.js +2384 -0
  103. package/dist/esm/loader.js +18 -2
  104. package/dist/esm/sankhyablocks.js +116 -4
  105. package/dist/esm/shadow-css-b18e99d7.js +387 -0
  106. package/dist/esm/snk-application.entry.js +627 -31
  107. package/dist/esm/snk-crud.entry.js +3 -2
  108. package/dist/esm/snk-data-unit.entry.js +3 -4
  109. package/dist/esm/snk-filter-bar.entry.js +243 -0
  110. package/dist/esm/snk-filter-binary-select.entry.js +43 -0
  111. package/dist/esm/snk-filter-detail.entry.js +45 -0
  112. package/dist/esm/snk-filter-item.entry.js +139 -0
  113. package/dist/esm/snk-filter-list.entry.js +87 -0
  114. package/dist/esm/snk-filter-multi-select.entry.js +19 -0
  115. package/dist/esm/snk-filter-number.entry.js +20 -0
  116. package/dist/esm/snk-filter-period.entry.js +22 -0
  117. package/dist/esm/snk-filter-search.entry.js +40 -0
  118. package/dist/esm/snk-filter-text.entry.js +18 -0
  119. package/dist/esm/{snk-form_2.entry.js → snk-form.entry.js} +21 -64
  120. package/dist/esm/snk-grid.entry.js +75 -0
  121. package/dist/esm/snk-pesquisa.entry.js +2 -2
  122. package/dist/esm/snk-taskbar.entry.js +16 -12
  123. package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
  124. package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
  125. package/dist/esm/teste-pesquisa.entry.js +2 -2
  126. package/dist/sankhyablocks/SnkMessageBuilder-65d431bd.js +303 -0
  127. package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
  128. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
  129. package/dist/sankhyablocks/dom-665d6011.js +73 -0
  130. package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +12 -0
  131. package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
  132. package/dist/sankhyablocks/index-e5b61043.js +2384 -0
  133. package/dist/sankhyablocks/index.esm.js +1 -0
  134. package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
  135. package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
  136. package/dist/sankhyablocks/snk-application.entry.js +8426 -0
  137. package/dist/sankhyablocks/snk-crud.entry.js +61 -0
  138. package/dist/sankhyablocks/snk-data-unit.entry.js +272 -0
  139. package/dist/sankhyablocks/snk-filter-bar.entry.js +243 -0
  140. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
  141. package/dist/sankhyablocks/snk-filter-detail.entry.js +45 -0
  142. package/dist/sankhyablocks/snk-filter-item.entry.js +139 -0
  143. package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
  144. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
  145. package/dist/sankhyablocks/snk-filter-number.entry.js +20 -0
  146. package/dist/sankhyablocks/snk-filter-period.entry.js +22 -0
  147. package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
  148. package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
  149. package/dist/sankhyablocks/snk-form.entry.js +129 -0
  150. package/dist/sankhyablocks/snk-grid.entry.js +75 -0
  151. package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
  152. package/dist/sankhyablocks/snk-taskbar.entry.js +156 -0
  153. package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
  154. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
  155. package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
  156. package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
  157. package/dist/types/components/snk-application/snk-application.d.ts +9 -0
  158. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
  159. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
  160. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
  161. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +13 -0
  162. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
  163. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
  164. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +9 -0
  165. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +14 -0
  166. package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +40 -0
  167. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +45 -0
  168. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +3 -2
  169. package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
  170. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +17 -1
  171. package/dist/types/components.d.ts +277 -2
  172. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
  173. package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +5 -0
  174. package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
  175. package/package.json +2 -2
  176. package/react/components.d.ts +0 -7
  177. package/react/components.js +0 -7
  178. package/react/components.js.map +1 -1
  179. package/dist/esm/index-cf91f542.js +0 -1817
  180. package/dist/esm/taskbar-elements-bcccc0ff.js +0 -72
  181. package/dist/sankhyablocks/p-1ba29824.entry.js +0 -74
  182. package/dist/sankhyablocks/p-2266555e.entry.js +0 -1
  183. package/dist/sankhyablocks/p-23c4c94f.js +0 -2
  184. package/dist/sankhyablocks/p-2454be94.js +0 -1
  185. package/dist/sankhyablocks/p-49743bc5.js +0 -1
  186. package/dist/sankhyablocks/p-4fa389bd.entry.js +0 -1
  187. package/dist/sankhyablocks/p-5327ba05.entry.js +0 -1
  188. package/dist/sankhyablocks/p-7a922fb4.entry.js +0 -1
  189. package/dist/sankhyablocks/p-92d6f826.entry.js +0 -1
  190. package/dist/sankhyablocks/p-bdeef7f2.entry.js +0 -1
@@ -1,4 +1,8 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$8 } from './snk-filter-bar2.js';
3
+ import { d as defineCustomElement$7 } from './snk-filter-detail2.js';
4
+ import { d as defineCustomElement$6 } from './snk-filter-item2.js';
5
+ import { d as defineCustomElement$5 } from './snk-filter-list2.js';
2
6
  import { d as defineCustomElement$4 } from './snk-form2.js';
3
7
  import { d as defineCustomElement$3 } from './snk-grid2.js';
4
8
  import { d as defineCustomElement$2 } from './snk-taskbar2.js';
@@ -11,6 +15,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
11
15
  constructor() {
12
16
  super();
13
17
  this.__registerHost();
18
+ this.actionClick = createEvent(this, "actionClick", 7);
14
19
  }
15
20
  async gridToForm(keepFormMode = false) {
16
21
  this._backToGrid = !keepFormMode && await this._viewStack.getSelectedIndex() === GRID_MODE;
@@ -55,13 +60,14 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
55
60
  }
56
61
  }
57
62
  render() {
58
- return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }))), h("stack-item", null, h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE), recordsValidator: this.recordsValidator, onActionClick: evt => this.executeAction(evt.detail) }))));
63
+ return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref }, h("stack-item", null, h("snk-grid", { configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), actionsList: this.actionsList }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-form", { configName: this.configName, actionsList: this.actionsList, onExit: () => this._viewStack.show(GRID_MODE), recordsValidator: this.recordsValidator, taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail) }, h("slot", { name: "SnkFormTaskBar" })))));
59
64
  }
60
65
  get _element() { return this; }
61
66
  static get style() { return snkCrudCss; }
62
67
  }, [6, "snk-crud", {
63
68
  "configName": [1, "config-name"],
64
69
  "actionsList": [16],
70
+ "taskbarManager": [16],
65
71
  "recordsValidator": [16],
66
72
  "_dataUnit": [32],
67
73
  "_dataState": [32]
@@ -70,13 +76,33 @@ function defineCustomElement$1() {
70
76
  if (typeof customElements === "undefined") {
71
77
  return;
72
78
  }
73
- const components = ["snk-crud", "snk-form", "snk-grid", "snk-taskbar"];
79
+ const components = ["snk-crud", "snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-form", "snk-grid", "snk-taskbar"];
74
80
  components.forEach(tagName => { switch (tagName) {
75
81
  case "snk-crud":
76
82
  if (!customElements.get(tagName)) {
77
83
  customElements.define(tagName, SnkCrud$1);
78
84
  }
79
85
  break;
86
+ case "snk-filter-bar":
87
+ if (!customElements.get(tagName)) {
88
+ defineCustomElement$8();
89
+ }
90
+ break;
91
+ case "snk-filter-detail":
92
+ if (!customElements.get(tagName)) {
93
+ defineCustomElement$7();
94
+ }
95
+ break;
96
+ case "snk-filter-item":
97
+ if (!customElements.get(tagName)) {
98
+ defineCustomElement$6();
99
+ }
100
+ break;
101
+ case "snk-filter-list":
102
+ if (!customElements.get(tagName)) {
103
+ defineCustomElement$5();
104
+ }
105
+ break;
80
106
  case "snk-form":
81
107
  if (!customElements.get(tagName)) {
82
108
  defineCustomElement$4();
@@ -1,7 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { Action, ApplicationContext } from '@sankhyalabs/core';
3
- import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
- import { O as OperationMap } from './SnkMessageBuilder.js';
2
+ import { A as Action, a as ApplicationContext } from './index2.js';
3
+ import { A as ApplicationUtils, D as DialogType, O as OperationMap } from './SnkMessageBuilder.js';
5
4
 
6
5
  const snkDataUnitCss = ".sc-snk-data-unit-h{display:flex;flex-direction:column;height:100%}";
7
6
 
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterBar extends Components.SnkFilterBar, HTMLElement {}
4
+ export const SnkFilterBar: {
5
+ prototype: SnkFilterBar;
6
+ new (): SnkFilterBar;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { S as SnkFilterBar$1, d as defineCustomElement$1 } from './snk-filter-bar2.js';
2
+
3
+ const SnkFilterBar = SnkFilterBar$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { SnkFilterBar, defineCustomElement };
@@ -0,0 +1,278 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { b as DataType, t as toString, a as ApplicationContext, E as ErrorException, O as ObjectUtils } from './index2.js';
3
+ import { F as FilterItemType } from './filter-item-type.enum.js';
4
+ import { d as defineCustomElement$3 } from './snk-filter-detail2.js';
5
+ import { d as defineCustomElement$2 } from './snk-filter-item2.js';
6
+ import { d as defineCustomElement$1 } from './snk-filter-list2.js';
7
+
8
+ 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%}";
9
+
10
+ const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
11
+ const DEFAULT_FILTER = "DEFAULT_FILTER";
12
+ const CLEAR_ALL_FILTERS = "CLEAR_ALL_FILTERS";
13
+ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
14
+ constructor() {
15
+ super();
16
+ this.__registerHost();
17
+ this._updateSequence = [];
18
+ this._calculateSortIndex = (item) => {
19
+ let index = item.hardFixed ? 1000000 : 0;
20
+ //campos Hard Fixed não variam a ordem
21
+ if (!item.hardFixed) {
22
+ index += item.fixed ? 100000 : 0;
23
+ index += item.value == undefined ? 0 : 10000;
24
+ index += this._updateSequence.lastIndexOf(item.id) + 1;
25
+ }
26
+ return index;
27
+ };
28
+ this._filtersComparator = (a, b) => {
29
+ return this._calculateSortIndex(b) - this._calculateSortIndex(a);
30
+ };
31
+ }
32
+ /**
33
+ * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
34
+ * através de um pequeno modulo na estrutura da aplicação:
35
+ * - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
36
+ * Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-bar.msg.ts"
37
+ */
38
+ getMessage(key, params) {
39
+ return this._application.messagesBuilder.getMessage(key, params);
40
+ }
41
+ getFilter(_dataUnit) {
42
+ const filters = [];
43
+ this.filterConfig.filter(item => item.value).forEach(item => {
44
+ const filter = this.buildDUFilter(item);
45
+ if (filter) {
46
+ filters.push(filter);
47
+ }
48
+ });
49
+ return filters;
50
+ }
51
+ buildDUFilter(item) {
52
+ const { id, value, type, props, visible } = item;
53
+ if (value && visible) {
54
+ if (type === FilterItemType.BINARY_SELECT) {
55
+ const options = props.options;
56
+ const selectedOption = options.find(opt => opt.name === value);
57
+ //FIXME: ajustar o backend para não exigir parametros
58
+ return { name: id, expression: selectedOption.expression, params: [] };
59
+ }
60
+ if (type === FilterItemType.MULTI_SELECT) {
61
+ return { name: id, expression: props.expression, params: [{ name: id, dataType: DataType.TEXT, value }] };
62
+ }
63
+ if (type === FilterItemType.PERIOD) {
64
+ const { end, start } = value;
65
+ const params = [];
66
+ let expression;
67
+ if (end && start) {
68
+ expression = props.expression.fullfill;
69
+ params.push({ name: `${id}.START`, dataType: DataType.DATE, value: toString(DataType.DATE, start) }, { name: `${id}.END`, dataType: DataType.DATE, value: toString(DataType.DATE, end) });
70
+ }
71
+ else {
72
+ if (start) {
73
+ expression = props.expression.onlystart;
74
+ params.push({ name: id, dataType: DataType.DATE, value: toString(DataType.DATE, start) });
75
+ }
76
+ else {
77
+ expression = props.expression.onlyend;
78
+ params.push({ name: id, dataType: DataType.DATE, value: toString(DataType.DATE, end) });
79
+ }
80
+ }
81
+ return { name: id, expression, params };
82
+ }
83
+ if (type === FilterItemType.SEARCH) {
84
+ const expression = props.expression;
85
+ return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value.value) }] };
86
+ }
87
+ if (type === FilterItemType.TEXT) {
88
+ const expression = props.expression;
89
+ return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value) }] };
90
+ }
91
+ if (type === FilterItemType.NUMBER) {
92
+ const expression = props.expression;
93
+ return { name: id, expression, params: [{ name: id, dataType: DataType.NUMBER, value: toString(DataType.NUMBER, value) }] };
94
+ }
95
+ //No mapeamento dos outros tipos precisamos saber o tipo de dado.
96
+ }
97
+ return undefined;
98
+ }
99
+ componentWillLoad() {
100
+ this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
101
+ if (this._application) {
102
+ this._application.getFilterBarConfig()
103
+ .then((filters) => {
104
+ this.filterConfig = filters;
105
+ })
106
+ .catch(reason => {
107
+ throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
108
+ });
109
+ }
110
+ if (this.dataUnit == undefined) {
111
+ let parent = this._element.parentElement;
112
+ while (parent) {
113
+ if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
114
+ const snkDataUnit = parent;
115
+ this.dataUnit = snkDataUnit.dataUnit;
116
+ if (this.dataUnit) {
117
+ this.dataUnit.addFilterProvider(this);
118
+ }
119
+ else {
120
+ snkDataUnit.addEventListener("dataUnitReady", (evt) => {
121
+ this.dataUnit = evt.detail;
122
+ this.dataUnit.addFilterProvider(this);
123
+ });
124
+ }
125
+ break;
126
+ }
127
+ parent = parent.parentElement;
128
+ }
129
+ }
130
+ }
131
+ getFilterItems() {
132
+ const pinnedItems = [];
133
+ const unpinnedItems = [];
134
+ this.filterConfig
135
+ .filter(item => item.visible)
136
+ .sort((a, b) => this._filtersComparator(a, b))
137
+ .forEach((item, index) => {
138
+ const filterItem = (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 }));
139
+ if (item.fixed || item.hardFixed) {
140
+ pinnedItems.push(filterItem);
141
+ }
142
+ else {
143
+ unpinnedItems.push(filterItem);
144
+ }
145
+ return filterItem;
146
+ });
147
+ const elements = [];
148
+ elements.push(...pinnedItems);
149
+ if (pinnedItems.length > 0 && unpinnedItems.length > 0) {
150
+ elements.push(h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider" }));
151
+ }
152
+ elements.push(...unpinnedItems);
153
+ return elements;
154
+ }
155
+ calculateUpdateSequence(item) {
156
+ if (item) {
157
+ this._updateSequence = this._updateSequence.filter(itemId => item.id !== itemId);
158
+ this._updateSequence.push(item.id);
159
+ }
160
+ }
161
+ filterChangeListener(evt) {
162
+ this.updateFilter(evt.detail);
163
+ }
164
+ updateFilter(newItem, clear = false) {
165
+ this.calculateUpdateSequence(newItem);
166
+ let upToDate = false;
167
+ this.filterConfig = this.filterConfig.map(item => {
168
+ if (clear) {
169
+ if (item.value != undefined) {
170
+ upToDate = true;
171
+ }
172
+ return Object.assign(Object.assign({}, item), { value: undefined });
173
+ }
174
+ else {
175
+ if (item.id === newItem.id) {
176
+ upToDate = ObjectUtils.objectToString(item.value) !== ObjectUtils.objectToString(newItem.value);
177
+ return newItem;
178
+ }
179
+ }
180
+ return item;
181
+ });
182
+ if (upToDate) {
183
+ this.dataUnit.loadData();
184
+ }
185
+ return upToDate;
186
+ }
187
+ getAddListItems() {
188
+ const hiddenItems = this.filterConfig
189
+ .filter(item => !item.visible)
190
+ .sort(this._filtersComparator);
191
+ return hiddenItems.map(filter => {
192
+ return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
193
+ }).concat([
194
+ { name: PERSONALIZED_FILTER, label: this.getMessage("snkFilterBar.customFilter"), iconName: "tune", kind: "FOOTER" },
195
+ { name: DEFAULT_FILTER, label: this.getMessage("snkFilterBar.defaultFilter"), iconName: "configuration", kind: "FOOTER" }
196
+ ]);
197
+ }
198
+ getActiveClass() {
199
+ const filterApplied = this.filterConfig.filter(item => item.value != undefined).length > 0;
200
+ return filterApplied ? "sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active" : "";
201
+ }
202
+ getAppliedListItems() {
203
+ const appliedItems = this.filterConfig
204
+ .filter(item => item.value != undefined)
205
+ .sort(this._filtersComparator);
206
+ return appliedItems.map(filter => {
207
+ return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
208
+ }).concat([
209
+ { name: CLEAR_ALL_FILTERS, label: this.getMessage("snkFilterBar.clearAllFilters"), iconName: "cleaning", kind: "FOOTER" }
210
+ ]);
211
+ }
212
+ addFilterHandler(itemName) {
213
+ const filterItem = this.filterConfig.find(currentFilter => currentFilter.id === itemName);
214
+ if (filterItem) {
215
+ this.updateFilter(Object.assign(Object.assign({}, filterItem), { visible: true }));
216
+ window.requestAnimationFrame(() => {
217
+ const itemElement = this._element.querySelector("#filter-" + itemName);
218
+ if (itemElement) {
219
+ itemElement.showUp();
220
+ }
221
+ });
222
+ }
223
+ }
224
+ appliedFilterHandler(itemName) {
225
+ if (itemName === CLEAR_ALL_FILTERS) {
226
+ if (this.updateFilter(null, true)) {
227
+ this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"), { iconName: "check" });
228
+ }
229
+ }
230
+ else {
231
+ const itemElement = this._element.querySelector("#filter-" + itemName);
232
+ if (itemElement) {
233
+ itemElement.showUp(true);
234
+ }
235
+ }
236
+ }
237
+ render() {
238
+ if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
239
+ return undefined;
240
+ }
241
+ return (h(Host, null, h("ez-scroller", { direction: "horizontal" }, this.getFilterItems()), 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) }), 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) }, h("ez-icon", { slot: "leftIcon", class: "ez-padding-right--small", iconName: "plus" }))));
242
+ }
243
+ get _element() { return this; }
244
+ static get style() { return snkFilterBarCss; }
245
+ }, [2, "snk-filter-bar", {
246
+ "dataUnit": [1040],
247
+ "filterConfig": [1040]
248
+ }, [[0, "filterChange", "filterChangeListener"]]]);
249
+ function defineCustomElement() {
250
+ if (typeof customElements === "undefined") {
251
+ return;
252
+ }
253
+ const components = ["snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list"];
254
+ components.forEach(tagName => { switch (tagName) {
255
+ case "snk-filter-bar":
256
+ if (!customElements.get(tagName)) {
257
+ customElements.define(tagName, SnkFilterBar);
258
+ }
259
+ break;
260
+ case "snk-filter-detail":
261
+ if (!customElements.get(tagName)) {
262
+ defineCustomElement$3();
263
+ }
264
+ break;
265
+ case "snk-filter-item":
266
+ if (!customElements.get(tagName)) {
267
+ defineCustomElement$2();
268
+ }
269
+ break;
270
+ case "snk-filter-list":
271
+ if (!customElements.get(tagName)) {
272
+ defineCustomElement$1();
273
+ }
274
+ break;
275
+ } });
276
+ }
277
+
278
+ export { SnkFilterBar as S, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterBinarySelect extends Components.SnkFilterBinarySelect, HTMLElement {}
4
+ export const SnkFilterBinarySelect: {
5
+ prototype: SnkFilterBinarySelect;
6
+ new (): SnkFilterBinarySelect;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,63 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { F as FilterItemType } from './filter-item-type.enum.js';
3
+
4
+ const SnkFilterBinarySelect$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
5
+ constructor() {
6
+ super();
7
+ this.__registerHost();
8
+ }
9
+ isSelected(option) {
10
+ return this.config.value == undefined || this.config.value === option;
11
+ }
12
+ ezChangeListener(evt) {
13
+ if (!evt.detail) {
14
+ this.assertCheckedOption(evt.target);
15
+ }
16
+ this.updateValue();
17
+ }
18
+ assertCheckedOption(updatingCheck) {
19
+ if (updatingCheck === this._checkOne) {
20
+ this._checkTwo.value = true;
21
+ }
22
+ else {
23
+ this._checkOne.value = true;
24
+ }
25
+ }
26
+ updateValue() {
27
+ if (!this._checkOne.value || !this._checkTwo.value) {
28
+ const [optOne, optTwo] = this.config.props.options;
29
+ this.value = this._checkOne.value ? optOne.name : optTwo.name;
30
+ }
31
+ else {
32
+ this.value = undefined;
33
+ }
34
+ }
35
+ render() {
36
+ if (!this.config || this.config.type !== FilterItemType.BINARY_SELECT) {
37
+ return undefined;
38
+ }
39
+ const [optOne, optTwo] = this.config.props.options;
40
+ return (h(Host, null, h("ez-check", { label: optOne.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkOne = ref, value: this.isSelected(optOne.name) }), h("ez-check", { label: optTwo.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkTwo = ref, value: this.isSelected(optTwo.name) })));
41
+ }
42
+ }, [0, "snk-filter-binary-select", {
43
+ "value": [1544],
44
+ "config": [16]
45
+ }, [[0, "ezChange", "ezChangeListener"]]]);
46
+ function defineCustomElement$1() {
47
+ if (typeof customElements === "undefined") {
48
+ return;
49
+ }
50
+ const components = ["snk-filter-binary-select"];
51
+ components.forEach(tagName => { switch (tagName) {
52
+ case "snk-filter-binary-select":
53
+ if (!customElements.get(tagName)) {
54
+ customElements.define(tagName, SnkFilterBinarySelect$1);
55
+ }
56
+ break;
57
+ } });
58
+ }
59
+
60
+ const SnkFilterBinarySelect = SnkFilterBinarySelect$1;
61
+ const defineCustomElement = defineCustomElement$1;
62
+
63
+ export { SnkFilterBinarySelect, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterDetail extends Components.SnkFilterDetail, HTMLElement {}
4
+ export const SnkFilterDetail: {
5
+ prototype: SnkFilterDetail;
6
+ new (): SnkFilterDetail;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { S as SnkFilterDetail$1, d as defineCustomElement$1 } from './snk-filter-detail2.js';
2
+
3
+ const SnkFilterDetail = SnkFilterDetail$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { SnkFilterDetail, defineCustomElement };
@@ -0,0 +1,63 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { F as FilterItemType } from './filter-item-type.enum.js';
3
+
4
+ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
5
+ constructor() {
6
+ super();
7
+ this.__registerHost();
8
+ this.filterChange = createEvent(this, "filterChange", 7);
9
+ }
10
+ changeConfig(newConfig) {
11
+ this.filterChange.emit(newConfig);
12
+ }
13
+ getContentEditor() {
14
+ switch (this.config.type) {
15
+ case FilterItemType.BINARY_SELECT:
16
+ return "snk-filter-binary-select";
17
+ case FilterItemType.MULTI_SELECT:
18
+ return "snk-filter-multi-select";
19
+ case FilterItemType.PERIOD:
20
+ return "snk-filter-period";
21
+ case FilterItemType.SEARCH:
22
+ return "snk-filter-search";
23
+ case FilterItemType.NUMBER:
24
+ return "snk-filter-number";
25
+ }
26
+ return "snk-filter-text";
27
+ }
28
+ removeItem() {
29
+ this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: false, fixed: false, value: undefined }));
30
+ }
31
+ getPopUpHeaderButtons() {
32
+ if (this.config.hardFixed) {
33
+ return undefined;
34
+ }
35
+ return ([
36
+ h("ez-icon", { title: this.getMessage("snkFilterBar.removeFilter"), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", iconName: "delete", onClick: () => this.removeItem() }),
37
+ 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 })) })
38
+ ]);
39
+ }
40
+ render() {
41
+ const ContentEditor = this.getContentEditor();
42
+ return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, 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()), h(ContentEditor, { ref: ref => this._editor = ref, config: this.config, fix: () => this.keepOpened = true, unfix: () => this.keepOpened = false }), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.changeConfig(Object.assign(Object.assign({}, this.config), { value: undefined })) }), 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" }))));
43
+ }
44
+ }, [0, "snk-filter-detail", {
45
+ "config": [1040],
46
+ "keepOpened": [1028, "keep-opened"],
47
+ "getMessage": [16]
48
+ }]);
49
+ function defineCustomElement() {
50
+ if (typeof customElements === "undefined") {
51
+ return;
52
+ }
53
+ const components = ["snk-filter-detail"];
54
+ components.forEach(tagName => { switch (tagName) {
55
+ case "snk-filter-detail":
56
+ if (!customElements.get(tagName)) {
57
+ customElements.define(tagName, SnkFilterDetail);
58
+ }
59
+ break;
60
+ } });
61
+ }
62
+
63
+ export { SnkFilterDetail as S, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterItem extends Components.SnkFilterItem, HTMLElement {}
4
+ export const SnkFilterItem: {
5
+ prototype: SnkFilterItem;
6
+ new (): SnkFilterItem;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { S as SnkFilterItem$1, d as defineCustomElement$1 } from './snk-filter-item2.js';
2
+
3
+ const SnkFilterItem = SnkFilterItem$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { SnkFilterItem, defineCustomElement };