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

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 (163) 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-b0b676c5.js → index-6fcf07f3.js} +159 -1515
  4. package/dist/cjs/loader.cjs.js +2 -18
  5. package/dist/cjs/sankhyablocks.cjs.js +4 -116
  6. package/dist/cjs/snk-application.cjs.entry.js +84 -230
  7. package/dist/cjs/snk-crud.cjs.entry.js +3 -3
  8. package/dist/cjs/snk-data-unit.cjs.entry.js +24 -32
  9. package/dist/cjs/snk-filter-bar_5.cjs.entry.js +902 -0
  10. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +2 -2
  11. package/dist/cjs/snk-filter-detail.cjs.entry.js +38 -3
  12. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +2 -2
  13. package/dist/cjs/snk-filter-number.cjs.entry.js +2 -2
  14. package/dist/cjs/snk-filter-period.cjs.entry.js +2 -2
  15. package/dist/cjs/snk-filter-personalized.cjs.entry.js +90 -0
  16. package/dist/cjs/snk-filter-search.cjs.entry.js +4 -4
  17. package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
  18. package/dist/cjs/{snk-form.cjs.entry.js → snk-form_2.cjs.entry.js} +119 -5
  19. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
  20. package/dist/cjs/{taskbar-elements-283c737e.js → taskbar-elements-aedfeae6.js} +1 -1
  21. package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
  22. package/dist/collection/collection-manifest.json +2 -0
  23. package/dist/collection/components/snk-application/snk-application.js +54 -7
  24. package/dist/collection/components/snk-crud/snk-crud.js +2 -4
  25. package/dist/collection/components/snk-data-unit/snk-data-unit.js +0 -27
  26. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
  27. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +161 -0
  28. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +2 -0
  29. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +36 -1
  30. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +32 -9
  31. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +196 -0
  32. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +22 -0
  33. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +238 -139
  34. package/dist/collection/components/snk-grid/snk-grid.js +2 -4
  35. package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +18 -10
  36. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -2
  37. package/dist/components/SnkMessageBuilder.js +15 -119
  38. package/dist/components/filter-item-type.enum.js +2 -0
  39. package/dist/components/index.d.ts +2 -0
  40. package/dist/components/index.js +2 -4
  41. package/dist/components/snk-application2.js +47 -191
  42. package/dist/components/snk-crud.js +16 -10
  43. package/dist/components/snk-data-unit.js +3 -12
  44. package/dist/components/snk-filter-bar2.js +342 -146
  45. package/dist/components/snk-filter-detail2.js +36 -1
  46. package/dist/components/snk-filter-item2.js +33 -10
  47. package/dist/components/snk-filter-list2.js +1 -1
  48. package/dist/components/snk-filter-modal.d.ts +11 -0
  49. package/dist/components/snk-filter-modal.js +6 -0
  50. package/dist/components/snk-filter-modal2.js +58 -0
  51. package/dist/components/snk-filter-personalized.d.ts +11 -0
  52. package/dist/components/snk-filter-personalized.js +108 -0
  53. package/dist/components/snk-filter-search.js +1 -1
  54. package/dist/components/snk-form2.js +1 -1
  55. package/dist/components/snk-grid2.js +16 -10
  56. package/dist/components/snk-pesquisa2.js +1 -1
  57. package/dist/components/snk-taskbar2.js +1 -1
  58. package/dist/components/teste-pesquisa.js +1 -1
  59. package/dist/{sankhyablocks/SnkMessageBuilder-a7da466b.js → esm/SnkMessageBuilder-35a20271.js} +15 -119
  60. package/dist/esm/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
  61. package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-81dda3cf.js} +160 -1508
  62. package/dist/esm/loader.js +2 -18
  63. package/dist/esm/sankhyablocks.js +4 -116
  64. package/dist/esm/snk-application.entry.js +46 -192
  65. package/dist/esm/snk-crud.entry.js +2 -2
  66. package/dist/esm/snk-data-unit.entry.js +4 -12
  67. package/dist/esm/snk-filter-bar_5.entry.js +894 -0
  68. package/dist/esm/snk-filter-binary-select.entry.js +2 -2
  69. package/dist/esm/snk-filter-detail.entry.js +38 -3
  70. package/dist/esm/snk-filter-multi-select.entry.js +2 -2
  71. package/dist/esm/snk-filter-number.entry.js +2 -2
  72. package/dist/esm/snk-filter-period.entry.js +2 -2
  73. package/dist/esm/snk-filter-personalized.entry.js +86 -0
  74. package/dist/esm/snk-filter-search.entry.js +3 -3
  75. package/dist/esm/snk-filter-text.entry.js +1 -1
  76. package/dist/esm/{snk-form.entry.js → snk-form_2.entry.js} +117 -4
  77. package/dist/esm/snk-pesquisa.entry.js +2 -2
  78. package/dist/{sankhyablocks/taskbar-elements-35d64ff9.js → esm/taskbar-elements-38eb5d51.js} +1 -1
  79. package/dist/esm/teste-pesquisa.entry.js +2 -2
  80. package/dist/sankhyablocks/index.esm.js +0 -1
  81. package/dist/sankhyablocks/p-0352c0e2.entry.js +1 -0
  82. package/dist/sankhyablocks/p-07ebda01.entry.js +1 -0
  83. package/dist/sankhyablocks/p-322c0df2.entry.js +1 -0
  84. package/dist/sankhyablocks/p-46caa101.entry.js +1 -0
  85. package/dist/sankhyablocks/p-473cedf9.entry.js +1 -0
  86. package/dist/sankhyablocks/p-586e2522.js +1 -0
  87. package/dist/sankhyablocks/p-86f15ffe.js +1 -0
  88. package/dist/sankhyablocks/p-8f3c5709.entry.js +1 -0
  89. package/dist/sankhyablocks/p-97009a2c.entry.js +1 -0
  90. package/dist/sankhyablocks/p-9be74b46.entry.js +74 -0
  91. package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
  92. package/dist/sankhyablocks/p-a8b59c61.entry.js +1 -0
  93. package/dist/sankhyablocks/p-aecf3e0a.entry.js +1 -0
  94. package/dist/sankhyablocks/p-c1c3b5d8.entry.js +1 -0
  95. package/dist/sankhyablocks/p-c78cb79a.entry.js +1 -0
  96. package/dist/sankhyablocks/p-c9eec639.entry.js +1 -0
  97. package/dist/sankhyablocks/p-dc482a42.entry.js +1 -0
  98. package/dist/sankhyablocks/p-fac2b6a9.js +2 -0
  99. package/dist/sankhyablocks/p-fb705f81.entry.js +1 -0
  100. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -129
  101. package/dist/types/components/snk-application/snk-application.d.ts +4 -1
  102. package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
  103. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +23 -0
  104. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +3 -1
  105. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +2 -0
  106. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +23 -0
  107. package/dist/types/components.d.ts +56 -8
  108. package/package.json +3 -3
  109. package/react/components.d.ts +19 -0
  110. package/react/components.js +19 -0
  111. package/react/components.js.map +1 -1
  112. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  113. package/dist/cjs/css-shim-b8158822.js +0 -6
  114. package/dist/cjs/dom-36862b77.js +0 -75
  115. package/dist/cjs/index-02201bc9.js +0 -2397
  116. package/dist/cjs/shadow-css-346c0795.js +0 -389
  117. package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -278
  118. package/dist/cjs/snk-filter-item.cjs.entry.js +0 -154
  119. package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
  120. package/dist/cjs/snk-grid.cjs.entry.js +0 -79
  121. package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
  122. package/dist/cjs/taskbar-processor-6bd0d35c.js +0 -47
  123. package/dist/components/index2.js +0 -2384
  124. package/dist/esm/SnkMessageBuilder-a7da466b.js +0 -303
  125. package/dist/esm/app-globals-0f993ce5.js +0 -3
  126. package/dist/esm/css-shim-b3f2ee8d.js +0 -4
  127. package/dist/esm/dom-665d6011.js +0 -73
  128. package/dist/esm/index-2b4d2d14.js +0 -3262
  129. package/dist/esm/index-f1d3e4da.js +0 -2384
  130. package/dist/esm/shadow-css-b18e99d7.js +0 -387
  131. package/dist/esm/snk-filter-bar.entry.js +0 -274
  132. package/dist/esm/snk-filter-item.entry.js +0 -150
  133. package/dist/esm/snk-filter-list.entry.js +0 -87
  134. package/dist/esm/snk-grid.entry.js +0 -75
  135. package/dist/esm/snk-taskbar.entry.js +0 -156
  136. package/dist/esm/taskbar-elements-35d64ff9.js +0 -90
  137. package/dist/esm/taskbar-processor-aa6772c9.js +0 -45
  138. package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
  139. package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
  140. package/dist/sankhyablocks/dom-665d6011.js +0 -73
  141. package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +0 -12
  142. package/dist/sankhyablocks/index-f1d3e4da.js +0 -2384
  143. package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
  144. package/dist/sankhyablocks/snk-application.entry.js +0 -8148
  145. package/dist/sankhyablocks/snk-crud.entry.js +0 -66
  146. package/dist/sankhyablocks/snk-data-unit.entry.js +0 -276
  147. package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -274
  148. package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
  149. package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -45
  150. package/dist/sankhyablocks/snk-filter-item.entry.js +0 -150
  151. package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
  152. package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
  153. package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
  154. package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
  155. package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
  156. package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
  157. package/dist/sankhyablocks/snk-form.entry.js +0 -129
  158. package/dist/sankhyablocks/snk-grid.entry.js +0 -75
  159. package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
  160. package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
  161. package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
  162. package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
  163. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -51
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { F as FloatingManager } from './index2.js';
2
+ import { FloatingManager } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum.js';
4
4
  import { d as defineCustomElement$1 } from './snk-filter-detail2.js';
5
5
 
@@ -24,16 +24,20 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
24
24
  } while ((current = current.offsetParent) != null);
25
25
  }
26
26
  this.detailIsVisible = false;
27
+ this.executeCloseCallback();
27
28
  return false;
28
29
  };
29
30
  }
30
31
  async showUp(open = false) {
31
- this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
32
- if (open) {
33
- window.requestAnimationFrame(() => {
34
- this.showDetail();
35
- });
36
- }
32
+ return new Promise(resolve => {
33
+ this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
34
+ if (open) {
35
+ window.requestAnimationFrame(() => {
36
+ this._closeCallback = resolve;
37
+ this.showDetail();
38
+ });
39
+ }
40
+ });
37
41
  }
38
42
  showDetail() {
39
43
  this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, { autoClose: true, innerClickTest: this.innerClickCheck, left: this.getScrollOffset() });
@@ -48,6 +52,13 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
48
52
  }
49
53
  this._floatingID = undefined;
50
54
  this.detailIsVisible = false;
55
+ this.executeCloseCallback();
56
+ }
57
+ executeCloseCallback() {
58
+ if (this._closeCallback) {
59
+ this._closeCallback();
60
+ this._closeCallback = undefined;
61
+ }
51
62
  }
52
63
  //---------------------------------------------
53
64
  // Event handlers
@@ -122,6 +133,9 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
122
133
  if (type === FilterItemType.SEARCH) {
123
134
  return `${label}: ${value.value} - ${value.label}`;
124
135
  }
136
+ if (type === FilterItemType.PERSONALIZED) {
137
+ return label;
138
+ }
125
139
  return `${label}: ${value}`;
126
140
  }
127
141
  return label;
@@ -136,15 +150,24 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
136
150
  filterChangeListener() {
137
151
  this.hideDetail();
138
152
  }
139
- getIconName() {
153
+ getRightIconName() {
140
154
  if (this.config.value != undefined) {
141
155
  return "close";
142
156
  }
143
157
  return this.detailIsVisible ? "chevron-up" : "chevron-down";
144
158
  }
159
+ getLeftIconName() {
160
+ switch (this.config.type) {
161
+ case FilterItemType.PERIOD:
162
+ return "calendar";
163
+ case FilterItemType.PERSONALIZED:
164
+ return "tune";
165
+ }
166
+ return undefined;
167
+ }
145
168
  render() {
146
- const leftIcon = this.config.type === FilterItemType.PERIOD ? "calendar" : undefined;
147
- return (h(Host, null, h("ez-chip", { ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.config.value != undefined }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getIconName(), class: "ez-padding-left--small", slot: "rightIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id }))));
169
+ const leftIcon = this.getLeftIconName();
170
+ return (h(Host, null, h("ez-chip", { ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.config.value != undefined }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon" })), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small", ref: elem => this._popover = elem, key: this.config.id }))));
148
171
  }
149
172
  get _filterItemElement() { return this; }
150
173
  }, [0, "snk-filter-item", {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { F as FloatingManager, g as ArrayUtils } from './index2.js';
2
+ import { FloatingManager, ArrayUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const SHOW_MORE_ITEM_NAME = "__SHOWMORE__";
5
5
  const MAX_FILTERS = 5;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterModal extends Components.SnkFilterModal, HTMLElement {}
4
+ export const SnkFilterModal: {
5
+ prototype: SnkFilterModal;
6
+ new (): SnkFilterModal;
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 SnkFilterModal$1, d as defineCustomElement$1 } from './snk-filter-modal2.js';
2
+
3
+ const SnkFilterModal = SnkFilterModal$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { SnkFilterModal, defineCustomElement };
@@ -0,0 +1,58 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { ModalButtonStatus } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
3
+ import { ArrayUtils } from '@sankhyalabs/core';
4
+
5
+ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ }
10
+ updateValue(id, value) {
11
+ this.items = this.items.map(item => {
12
+ if (item.id === id) {
13
+ return Object.assign(Object.assign({}, item), { active: value });
14
+ }
15
+ return item;
16
+ });
17
+ }
18
+ getActiveFiltersMsg() {
19
+ const activeFilters = this.items.filter(item => item.active).length;
20
+ if (activeFilters === 0) {
21
+ return this.getMessage("snkFilterBar.noActiveFilters");
22
+ }
23
+ return this.getMessage(activeFilters > 1 ? "snkFilterBar.activeFilters" : "snkFilterBar.activeFilter", { ACTIVE_FILTERS: activeFilters });
24
+ }
25
+ getFilteredItems() {
26
+ return this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items) : [];
27
+ }
28
+ render() {
29
+ const allowCancel = this.items.filter(item => item.active).length > 0;
30
+ return (h("ez-modal-container", { modalTitle: this.modalTitle, modalSubTitle: this.modalSubTitle, cancelButtonLabel: this.cancelButtonLabel, okButtonLabel: this.okButtonLabel, onEzModalAction: evt => this.processModalAction(evt.detail), cancelButtonStatus: allowCancel ? ModalButtonStatus.ENABLED : ModalButtonStatus.DISABLED }, h("div", { class: "sc-snk-filter-bar snk-filter-bar__filter-modal-content" }, h("div", null, this.useSearch ? h("ez-filter-input", { label: this.getMessage("snkFilterBar.modalFindFilter"), onEzChange: (evt) => this._filterArgument = evt.detail }) : undefined), this.getFilteredItems().length > 0 ? h("div", { class: "ez-text ez-text--medium ez-text--primary ez-padding-bottom--small" }, this.getActiveFiltersMsg()) : undefined, h("div", null, this.getFilteredItems().map(item => h("div", { class: "ez-padding--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item ez-align--middle ez-margin-bottom--small" }, h("ez-check", { class: "sc-snk-filter-bar snk-filter-bar__filter-modal-item__check", onEzChange: evt => this.updateValue(item.id, evt.detail), enabled: item.enabled, value: item.active, mode: "switch" }), h("div", { class: "ez-text ez-title--primary ez-text--medium ez-margin-left--medium sc-snk-filter-bar snk-filter-bar__filter-modal-item__label" }, item.label)))), h("div", { class: "ez-text ez-text--large ez-align--middle ez-text--secondary ez-text--center ez-padding-bottom--large" }, this.infoText))));
31
+ }
32
+ }, [0, "snk-filter-modal", {
33
+ "getMessage": [16],
34
+ "items": [1040],
35
+ "modalTitle": [1, "modal-title"],
36
+ "modalSubTitle": [1, "modal-sub-title"],
37
+ "cancelButtonLabel": [1, "cancel-button-label"],
38
+ "okButtonLabel": [1, "ok-button-label"],
39
+ "infoText": [1, "info-text"],
40
+ "useSearch": [4, "use-search"],
41
+ "processModalAction": [16],
42
+ "_filterArgument": [32]
43
+ }]);
44
+ function defineCustomElement() {
45
+ if (typeof customElements === "undefined") {
46
+ return;
47
+ }
48
+ const components = ["snk-filter-modal"];
49
+ components.forEach(tagName => { switch (tagName) {
50
+ case "snk-filter-modal":
51
+ if (!customElements.get(tagName)) {
52
+ customElements.define(tagName, SnkFilterModal);
53
+ }
54
+ break;
55
+ } });
56
+ }
57
+
58
+ export { SnkFilterModal as S, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SnkFilterPersonalized extends Components.SnkFilterPersonalized, HTMLElement {}
4
+ export const SnkFilterPersonalized: {
5
+ prototype: SnkFilterPersonalized;
6
+ new (): SnkFilterPersonalized;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,108 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { UserInterface, ApplicationContext } from '@sankhyalabs/core';
3
+ import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
4
+ import { F as FilterItemType } from './filter-item-type.enum.js';
5
+
6
+ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ }
11
+ getValue(param, index) {
12
+ if (this.value && index >= 0 && index < this.value.length) {
13
+ const rawValue = this.value[index];
14
+ if (param.type === UserInterface.SEARCH) {
15
+ return rawValue;
16
+ }
17
+ return convertType(param.dataType, rawValue);
18
+ }
19
+ return undefined;
20
+ }
21
+ setValue(index, value) {
22
+ if (this.value == undefined) {
23
+ this.value = Array(index).fill(null);
24
+ }
25
+ else {
26
+ this.value = [...this.value];
27
+ }
28
+ this.value[index] = value;
29
+ if (this.value.filter(item => item != undefined).length == 0) {
30
+ this.value = null;
31
+ }
32
+ }
33
+ doSearch(mode, argument, param) {
34
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
35
+ if (this.fix) {
36
+ this.fix();
37
+ }
38
+ return new Promise((resolve, reject) => {
39
+ application.executePreparedSearch(mode, argument, param.searchContext)
40
+ .then(result => {
41
+ resolve(result);
42
+ if (this.unfix) {
43
+ this.unfix();
44
+ }
45
+ }).catch(reason => {
46
+ reject(reason);
47
+ if (this.unfix) {
48
+ this.unfix();
49
+ }
50
+ });
51
+ });
52
+ }
53
+ getParamsInterface() {
54
+ var _a, _b, _c;
55
+ const params = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.personalizedFilter) === null || _c === void 0 ? void 0 : _c.parameters;
56
+ return params.map((param, index) => {
57
+ var _a;
58
+ switch (param.type) {
59
+ case UserInterface.SEARCH:
60
+ return h("ez-search", { suppressEmptyOption: true, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
61
+ case UserInterface.SWITCH:
62
+ case UserInterface.CHECKBOX:
63
+ const mode = UserInterface.SWITCH === param.type ? "switch" : "regular";
64
+ return h("ez-check", { class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index), label: param.label, onEzChange: evt => this.setValue(index, evt.detail) });
65
+ case UserInterface.DECIMALNUMBER:
66
+ case UserInterface.INTEGERNUMBER:
67
+ return h("ez-number-input", { label: param.label, value: this.getValue(param, index), precision: (_a = param.props) === null || _a === void 0 ? void 0 : _a.precision, onEzChange: evt => this.setValue(index, evt.detail) });
68
+ case UserInterface.OPTIONSELECTOR:
69
+ return h("ez-combo-box", { label: param.label, value: this.getValue(param, index), options: param.options, onEzChange: evt => { var _a; return this.setValue(index, (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); } });
70
+ case UserInterface.DATE:
71
+ return h("ez-date-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
72
+ case UserInterface.DATETIME:
73
+ return h("ez-date-time-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
74
+ default:
75
+ return h("ez-text-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
76
+ }
77
+ });
78
+ }
79
+ render() {
80
+ if (!this.config || this.config.type !== FilterItemType.PERSONALIZED) {
81
+ return undefined;
82
+ }
83
+ return (h(Host, null, this.getParamsInterface()));
84
+ }
85
+ }, [0, "snk-filter-personalized", {
86
+ "config": [16],
87
+ "value": [1040],
88
+ "fix": [16],
89
+ "unfix": [16]
90
+ }]);
91
+ function defineCustomElement$1() {
92
+ if (typeof customElements === "undefined") {
93
+ return;
94
+ }
95
+ const components = ["snk-filter-personalized"];
96
+ components.forEach(tagName => { switch (tagName) {
97
+ case "snk-filter-personalized":
98
+ if (!customElements.get(tagName)) {
99
+ customElements.define(tagName, SnkFilterPersonalized$1);
100
+ }
101
+ break;
102
+ } });
103
+ }
104
+
105
+ const SnkFilterPersonalized = SnkFilterPersonalized$1;
106
+ const defineCustomElement = defineCustomElement$1;
107
+
108
+ export { SnkFilterPersonalized, defineCustomElement };
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { A as ApplicationContext } from './index2.js';
2
+ import { ApplicationContext } from '@sankhyalabs/core';
3
3
  import { F as FilterItemType } from './filter-item-type.enum.js';
4
4
 
5
5
  const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { A as ApplicationContext } from './index2.js';
2
+ import { ApplicationContext } from '@sankhyalabs/core';
3
3
  import { T as TaskbarProcessor } from './taskbar-processor.js';
4
4
  import { d as defineCustomElement$1 } from './snk-taskbar2.js';
5
5
 
@@ -1,11 +1,12 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { A as ApplicationContext } from './index2.js';
2
+ import { ApplicationContext } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement, d as defineCustomElement$1 } from './snk-taskbar2.js';
4
4
  import { T as TaskbarProcessor } from './taskbar-processor.js';
5
- import { d as defineCustomElement$5 } from './snk-filter-bar2.js';
6
- import { d as defineCustomElement$4 } from './snk-filter-detail2.js';
7
- import { d as defineCustomElement$3 } from './snk-filter-item2.js';
8
- import { d as defineCustomElement$2 } from './snk-filter-list2.js';
5
+ import { d as defineCustomElement$6 } from './snk-filter-bar2.js';
6
+ import { d as defineCustomElement$5 } from './snk-filter-detail2.js';
7
+ import { d as defineCustomElement$4 } from './snk-filter-item2.js';
8
+ import { d as defineCustomElement$3 } from './snk-filter-list2.js';
9
+ import { d as defineCustomElement$2 } from './snk-filter-modal2.js';
9
10
 
10
11
  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--small)}";
11
12
 
@@ -79,7 +80,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
79
80
  "configName": [1, "config-name"],
80
81
  "actionsList": [16],
81
82
  "taskbarManager": [16],
82
- "statusResolver": [8, "status-resolver"],
83
+ "statusResolver": [16],
83
84
  "_dataUnit": [32],
84
85
  "_configLoaded": [32],
85
86
  "_dataState": [32],
@@ -89,7 +90,7 @@ function defineCustomElement() {
89
90
  if (typeof customElements === "undefined") {
90
91
  return;
91
92
  }
92
- const components = ["snk-grid", "snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-taskbar"];
93
+ const components = ["snk-grid", "snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-filter-modal", "snk-taskbar"];
93
94
  components.forEach(tagName => { switch (tagName) {
94
95
  case "snk-grid":
95
96
  if (!customElements.get(tagName)) {
@@ -98,20 +99,25 @@ function defineCustomElement() {
98
99
  break;
99
100
  case "snk-filter-bar":
100
101
  if (!customElements.get(tagName)) {
101
- defineCustomElement$5();
102
+ defineCustomElement$6();
102
103
  }
103
104
  break;
104
105
  case "snk-filter-detail":
105
106
  if (!customElements.get(tagName)) {
106
- defineCustomElement$4();
107
+ defineCustomElement$5();
107
108
  }
108
109
  break;
109
110
  case "snk-filter-item":
110
111
  if (!customElements.get(tagName)) {
111
- defineCustomElement$3();
112
+ defineCustomElement$4();
112
113
  }
113
114
  break;
114
115
  case "snk-filter-list":
116
+ if (!customElements.get(tagName)) {
117
+ defineCustomElement$3();
118
+ }
119
+ break;
120
+ case "snk-filter-modal":
115
121
  if (!customElements.get(tagName)) {
116
122
  defineCustomElement$2();
117
123
  }
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { O as ObjectUtils, S as StringUtils } from './index2.js';
2
+ import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
3
3
 
4
4
  const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__content-scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--snk-pesquisa__content-scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--snk-pesquisa__content-scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__content-scrollbar--width:var(--space--medium, 12px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__content-scrollbar--background-color-primary) var(--snk-pesquisa__content-scrollbar--background-color-secondary);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__content-scrollbar--background-color-secondary);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__content-scrollbar--background-color-primary);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__content-scrollbar--background-color-secondary);width:var(--snk-pesquisa__content-scrollbar--width);max-width:var(--snk-pesquisa__content-scrollbar--width);min-width:var(--snk-pesquisa__content-scrollbar--width)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { h, proxyCustomElement, HTMLElement, createEvent, Host } from '@stencil/core/internal/client';
2
- import { A as ApplicationContext } from './index2.js';
2
+ import { ApplicationContext } from '@sankhyalabs/core';
3
3
 
4
4
  var TaskbarElement;
5
5
  (function (TaskbarElement) {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { D as DataUnit, b as DataType, U as UserInterface } from './index2.js';
2
+ import { DataUnit, DataType, UserInterface } from '@sankhyalabs/core';
3
3
  import { d as defineCustomElement$3 } from './snk-application2.js';
4
4
  import { d as defineCustomElement$2 } from './snk-pesquisa2.js';
5
5
 
@@ -1,119 +1,3 @@
1
- var DialogType;
2
- (function (DialogType) {
3
- DialogType["WARN"] = "warn";
4
- DialogType["CRITICAL"] = "critical";
5
- DialogType["DEFAULT"] = "default";
6
- })(DialogType || (DialogType = {}));
7
-
8
- class ApplicationUtils {
9
- static async showDialog(title, message, icon = null, confirm, dialogType = DialogType.DEFAULT, options) {
10
- if (options) {
11
- options = Object.assign(Object.assign({}, ApplicationUtils.defaultMessageOptions), options);
12
- }
13
- return new Promise(resolve => {
14
- let dialog = document.querySelector("ez-dialog");
15
- if (!dialog) {
16
- dialog = document.createElement("ez-dialog");
17
- window.document.body.appendChild(dialog);
18
- }
19
- dialog.show(title, message, dialogType, confirm, icon, options.labelCancel, options.labelConfirm, options.btnConfirmDanger).then(ok => resolve(ok));
20
- });
21
- }
22
- static async alert(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
23
- return ApplicationUtils.showDialog(title, message, icon, false, DialogType.WARN, options);
24
- }
25
- static async error(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
26
- return ApplicationUtils.showDialog(title, message, icon, false, DialogType.CRITICAL, options);
27
- }
28
- static async confirm(title, message, icon = null, dialogType = DialogType.WARN, options = ApplicationUtils.defaultMessageOptions) {
29
- return ApplicationUtils.showDialog(title, message, icon, true, dialogType, options);
30
- }
31
- static async message(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
32
- return ApplicationUtils.showDialog(title, message, icon, false, DialogType.DEFAULT, options);
33
- }
34
- static async info(message, options = ApplicationUtils.defaultMessageOptions) {
35
- let toast = document.querySelector("ez-toast");
36
- if (!toast) {
37
- toast = document.createElement("ez-toast");
38
- const icon = document.createElement("ez-icon");
39
- icon.className = "ez-margin-right--small toast__icon--color";
40
- icon.slot = "icon";
41
- toast.appendChild(icon);
42
- window.document.body.appendChild(toast);
43
- }
44
- if (options.iconName) {
45
- const iconElem = toast.querySelector("ez-icon");
46
- if (iconElem) {
47
- iconElem.iconName = options.iconName;
48
- toast.useIcon = true;
49
- }
50
- }
51
- else {
52
- toast.useIcon = false;
53
- }
54
- toast.show(message, 5000, false, options.canClose);
55
- }
56
- }
57
- ApplicationUtils.defaultMessageOptions = {
58
- canClose: true,
59
- labelCancel: 'Não',
60
- labelConfirm: 'Sim',
61
- btnConfirmDanger: false
62
- };
63
- ;
64
-
65
- class CSSVarsUtils {
66
- static applyVarsTextInput(host, child) {
67
- if (child) {
68
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--background-color');
69
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--border-color');
70
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input--height');
71
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--background-color');
72
- CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--color');
73
- }
74
- }
75
- static applyVarsButton(host, child) {
76
- if (child) {
77
- ["--ez-button--min-width",
78
- "--ez-button--height",
79
- "--ez-button__icon--width",
80
- "--ez-button__inline__icon--padding",
81
- "--ez-button--padding-top",
82
- "--ez-button--padding-bottom",
83
- "--ez-button--padding-right",
84
- "--ez-button--padding-left",
85
- "--ez-button--color",
86
- "--ez-button--font-size",
87
- "--ez-button--font-family",
88
- "--ez-button--font-weight",
89
- "--ez-button--background-color",
90
- "--ez-button--border-radius",
91
- "--ez-button--border",
92
- "--ez-button--hover-color",
93
- "--ez-button--hover--background-color",
94
- "--ez-button--disabled-color",
95
- "--ez-button--disabled--background-color",
96
- "--ez-button--focus--border",
97
- "--ez-button--focus--box-shadow",
98
- "--ez-button--active-color",
99
- "--ez-button--active--background-color",
100
- "--ez-button--link-color",
101
- "--ez-button--link--hover-color",
102
- "--ez-button--link--small--font-size",
103
- "--ez-button--link--medium--font-size",
104
- "--ez-button--link--large--font-size",].forEach(prop => {
105
- CSSVarsUtils.applyIfExists(host, child, prop);
106
- });
107
- }
108
- }
109
- static applyIfExists(host, element, varName) {
110
- const prop = getComputedStyle(host).getPropertyValue(varName);
111
- if (prop) {
112
- element.style.setProperty(varName, prop);
113
- }
114
- }
115
- }
116
-
117
1
  const snkDataUnitMessages = {
118
2
  saveInfo: {
119
3
  clone: "Duplicação realizada!",
@@ -146,13 +30,25 @@ const snkFilterBarMessages = {
146
30
  "applyFilter": "Aplicar",
147
31
  "findFilter": "Buscar filtros...",
148
32
  "findField": "Buscar filtros...",
33
+ "modalFindFilter": "Buscar filtro",
149
34
  "emptyFiltersList": "Não há filtros disponíveis",
150
35
  "emptyAppliedFiltersList": "Não há filtros aplicados",
151
36
  "customFilter": "Filtro personalizado",
152
- "defaultFilter": "Filtro padrao",
37
+ "defaultFilter": "Filtro padrão",
153
38
  "failToLoadConfig": "Falha ao buscar configuração de filtros",
154
39
  "clearAllFilters": "Limpar todos os filtros",
155
- "successfullyCleaned": "Filtro limpo com sucesso!"
40
+ "successfullyCleaned": "Filtro limpo com sucesso!",
41
+ "activeFilter": "{{ACTIVE_FILTERS}} filtro aplicado",
42
+ "activeFilters": "{{ACTIVE_FILTERS}} filtros aplicados",
43
+ "noActiveFilters": "Nenhum filtro aplicado",
44
+ "modalDefaultFilterTitle": "Filtro padrão",
45
+ "modalInfoTextEditDefault": "Use o layout antigo para editar o seu filtro padrão, em breve traremos uma nova experiência.",
46
+ "modalInfoTextCreateDefault": "Use o layout antigo para criar o seu filtro padrão, em breve traremos uma nova experiência.",
47
+ "modalPersonalizedFilterTitle": "Filtro personalizado",
48
+ "modalPersonalizedFilterSubTitle": "Gerencie seus filtros",
49
+ "modalInfoTextCreateEditPersonalized": "Use o layout antigo para criar ou editar filtros, em breve traremos uma nova experiência",
50
+ "modalOkButtonLabel": "Aplicar",
51
+ "modalCancelButtonLabel": "Limpar"
156
52
  };
157
53
 
158
54
  const snkFormMessages = {
@@ -300,4 +196,4 @@ var OperationMap;
300
196
  OperationMap["CLEAN"] = "clean";
301
197
  })(OperationMap || (OperationMap = {}));
302
198
 
303
- export { ApplicationUtils as A, DialogType as D, OperationMap as O, SnkMessageBuilder as S };
199
+ export { OperationMap as O, SnkMessageBuilder as S };
@@ -6,6 +6,8 @@ var FilterItemType;
6
6
  FilterItemType["SEARCH"] = "SEARCH";
7
7
  FilterItemType["TEXT"] = "TEXT";
8
8
  FilterItemType["NUMBER"] = "NUMBER";
9
+ FilterItemType["DEFAULT_FILTER"] = "DEFAULT_FILTER";
10
+ FilterItemType["PERSONALIZED"] = "PERSONALIZED";
9
11
  })(FilterItemType || (FilterItemType = {}));
10
12
  const FilterItemType$1 = FilterItemType;
11
13