@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
@@ -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 { F as FloatingManager, h as ArrayUtils } from './index2.js';
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,73 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { h as ArrayUtils } from './index2.js';
3
+
4
+ var ModalAction;
5
+ (function (ModalAction) {
6
+ ModalAction["CLOSE"] = "CLOSE";
7
+ ModalAction["OK"] = "OK";
8
+ ModalAction["CANCEL"] = "CANCEL";
9
+ })(ModalAction || (ModalAction = {}));
10
+ const ModalAction$1 = ModalAction;
11
+
12
+ var ModalButtonStatus;
13
+ (function (ModalButtonStatus) {
14
+ ModalButtonStatus["ENABLED"] = "ENABLED";
15
+ ModalButtonStatus["DISABLED"] = "DISABLED";
16
+ ModalButtonStatus["HIDDEN"] = "HIDDEN";
17
+ })(ModalButtonStatus || (ModalButtonStatus = {}));
18
+ const ModalButtonStatus$1 = ModalButtonStatus;
19
+
20
+ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
21
+ constructor() {
22
+ super();
23
+ this.__registerHost();
24
+ }
25
+ updateValue(id, value) {
26
+ this.items = this.items.map(item => {
27
+ if (item.id === id) {
28
+ return Object.assign(Object.assign({}, item), { active: value });
29
+ }
30
+ return item;
31
+ });
32
+ }
33
+ getActiveFiltersMsg() {
34
+ const activeFilters = this.items.filter(item => item.active).length;
35
+ if (activeFilters === 0) {
36
+ return this.getMessage("snkFilterBar.noActiveFilters");
37
+ }
38
+ return this.getMessage(activeFilters > 1 ? "snkFilterBar.activeFilters" : "snkFilterBar.activeFilter", { ACTIVE_FILTERS: activeFilters });
39
+ }
40
+ getFilteredItems() {
41
+ return this.items ? ArrayUtils.applyStringFilter(this._filterArgument, this.items) : [];
42
+ }
43
+ render() {
44
+ const allowCancel = this.items.filter(item => item.active).length > 0;
45
+ 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$1.ENABLED : ModalButtonStatus$1.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))));
46
+ }
47
+ }, [0, "snk-filter-modal", {
48
+ "getMessage": [16],
49
+ "items": [1040],
50
+ "modalTitle": [1, "modal-title"],
51
+ "modalSubTitle": [1, "modal-sub-title"],
52
+ "cancelButtonLabel": [1, "cancel-button-label"],
53
+ "okButtonLabel": [1, "ok-button-label"],
54
+ "infoText": [1, "info-text"],
55
+ "useSearch": [4, "use-search"],
56
+ "processModalAction": [16],
57
+ "_filterArgument": [32]
58
+ }]);
59
+ function defineCustomElement() {
60
+ if (typeof customElements === "undefined") {
61
+ return;
62
+ }
63
+ const components = ["snk-filter-modal"];
64
+ components.forEach(tagName => { switch (tagName) {
65
+ case "snk-filter-modal":
66
+ if (!customElements.get(tagName)) {
67
+ customElements.define(tagName, SnkFilterModal);
68
+ }
69
+ break;
70
+ } });
71
+ }
72
+
73
+ export { ModalAction$1 as M, 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,107 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { U as UserInterface, c as convertType, A as ApplicationContext } from './index2.js';
3
+ import { F as FilterItemType } from './filter-item-type.enum.js';
4
+
5
+ const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ }
10
+ getValue(param, index) {
11
+ if (this.value && index >= 0 && index < this.value.length) {
12
+ const rawValue = this.value[index];
13
+ if (param.type === UserInterface.SEARCH) {
14
+ return rawValue;
15
+ }
16
+ return convertType(param.dataType, rawValue);
17
+ }
18
+ return undefined;
19
+ }
20
+ setValue(index, value) {
21
+ if (this.value == undefined) {
22
+ this.value = Array(index).fill(null);
23
+ }
24
+ else {
25
+ this.value = [...this.value];
26
+ }
27
+ this.value[index] = value;
28
+ if (this.value.filter(item => item != undefined).length == 0) {
29
+ this.value = null;
30
+ }
31
+ }
32
+ doSearch(mode, argument, param) {
33
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
34
+ if (this.fix) {
35
+ this.fix();
36
+ }
37
+ return new Promise((resolve, reject) => {
38
+ application.executePreparedSearch(mode, argument, param.searchContext)
39
+ .then(result => {
40
+ resolve(result);
41
+ if (this.unfix) {
42
+ this.unfix();
43
+ }
44
+ }).catch(reason => {
45
+ reject(reason);
46
+ if (this.unfix) {
47
+ this.unfix();
48
+ }
49
+ });
50
+ });
51
+ }
52
+ getParamsInterface() {
53
+ var _a, _b, _c;
54
+ 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;
55
+ return params.map((param, index) => {
56
+ var _a;
57
+ switch (param.type) {
58
+ case UserInterface.SEARCH:
59
+ 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) });
60
+ case UserInterface.SWITCH:
61
+ case UserInterface.CHECKBOX:
62
+ const mode = UserInterface.SWITCH === param.type ? "switch" : "regular";
63
+ 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) });
64
+ case UserInterface.DECIMALNUMBER:
65
+ case UserInterface.INTEGERNUMBER:
66
+ 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) });
67
+ case UserInterface.OPTIONSELECTOR:
68
+ 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); } });
69
+ case UserInterface.DATE:
70
+ return h("ez-date-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
71
+ case UserInterface.DATETIME:
72
+ return h("ez-date-time-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
73
+ default:
74
+ return h("ez-text-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
75
+ }
76
+ });
77
+ }
78
+ render() {
79
+ if (!this.config || this.config.type !== FilterItemType.PERSONALIZED) {
80
+ return undefined;
81
+ }
82
+ return (h(Host, null, this.getParamsInterface()));
83
+ }
84
+ }, [0, "snk-filter-personalized", {
85
+ "config": [16],
86
+ "value": [1040],
87
+ "fix": [16],
88
+ "unfix": [16]
89
+ }]);
90
+ function defineCustomElement$1() {
91
+ if (typeof customElements === "undefined") {
92
+ return;
93
+ }
94
+ const components = ["snk-filter-personalized"];
95
+ components.forEach(tagName => { switch (tagName) {
96
+ case "snk-filter-personalized":
97
+ if (!customElements.get(tagName)) {
98
+ customElements.define(tagName, SnkFilterPersonalized$1);
99
+ }
100
+ break;
101
+ } });
102
+ }
103
+
104
+ const SnkFilterPersonalized = SnkFilterPersonalized$1;
105
+ const defineCustomElement = defineCustomElement$1;
106
+
107
+ export { SnkFilterPersonalized, defineCustomElement };
@@ -2,10 +2,11 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
2
2
  import { A as ApplicationContext } from './index2.js';
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,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
 
@@ -0,0 +1,139 @@
1
+ var DialogType;
2
+ (function (DialogType) {
3
+ DialogType["WARN"] = "warn";
4
+ DialogType["CRITICAL"] = "critical";
5
+ DialogType["SUCCESS"] = "success";
6
+ DialogType["DEFAULT"] = "default";
7
+ })(DialogType || (DialogType = {}));
8
+
9
+ class ApplicationUtils {
10
+ static async showDialog(title, message, icon = null, confirm, dialogType = DialogType.DEFAULT, options) {
11
+ if (options) {
12
+ options = Object.assign(Object.assign({}, ApplicationUtils.defaultMessageOptions), options);
13
+ }
14
+ return new Promise(resolve => {
15
+ let dialog = document.querySelector("ez-dialog");
16
+ if (!dialog) {
17
+ dialog = document.createElement("ez-dialog");
18
+ window.document.body.appendChild(dialog);
19
+ }
20
+ dialog.show(title, message, dialogType, confirm, icon, options.labelCancel, options.labelConfirm, options.btnConfirmDanger).then(ok => resolve(ok));
21
+ });
22
+ }
23
+ static async alert(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
24
+ return ApplicationUtils.showDialog(title, message, icon, false, DialogType.WARN, options);
25
+ }
26
+ static async error(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
27
+ return ApplicationUtils.showDialog(title, message, icon, false, DialogType.CRITICAL, options);
28
+ }
29
+ static async success(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
30
+ return ApplicationUtils.showDialog(title, message, icon, false, DialogType.SUCCESS, options);
31
+ }
32
+ static async confirm(title, message, icon = null, dialogType = DialogType.WARN, options = ApplicationUtils.defaultMessageOptions) {
33
+ return ApplicationUtils.showDialog(title, message, icon, true, dialogType, options);
34
+ }
35
+ static async message(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
36
+ return ApplicationUtils.showDialog(title, message, icon, false, DialogType.DEFAULT, options);
37
+ }
38
+ static async info(message, options = ApplicationUtils.defaultMessageOptions) {
39
+ let toast = document.querySelector("ez-toast");
40
+ if (!toast) {
41
+ toast = document.createElement("ez-toast");
42
+ const icon = document.createElement("ez-icon");
43
+ icon.className = "ez-margin-right--small";
44
+ icon.slot = "icon";
45
+ icon.style.setProperty('--ez-icon--color', 'var(--color--success)');
46
+ toast.appendChild(icon);
47
+ window.document.body.appendChild(toast);
48
+ }
49
+ if (options.iconName) {
50
+ const iconElem = toast.querySelector("ez-icon");
51
+ if (iconElem) {
52
+ iconElem.iconName = options.iconName;
53
+ toast.useIcon = true;
54
+ }
55
+ }
56
+ else {
57
+ toast.useIcon = false;
58
+ }
59
+ toast.show(message, 5000, false, options.canClose);
60
+ }
61
+ }
62
+ ApplicationUtils.defaultMessageOptions = {
63
+ canClose: true,
64
+ labelCancel: 'Não',
65
+ labelConfirm: 'Sim',
66
+ btnConfirmDanger: false
67
+ };
68
+ ;
69
+
70
+ class CSSVarsUtils {
71
+ static applyCSSVars(document, host, child) {
72
+ const isSameDomain = (styleSheet) => {
73
+ if (!styleSheet.href) {
74
+ return true;
75
+ }
76
+ return styleSheet.href.indexOf(window.location.origin) === 0;
77
+ };
78
+ Array.from(document.styleSheets).filter(isSameDomain).forEach((sheet) => {
79
+ Array.from(sheet.cssRules).filter(rule => rule instanceof CSSStyleRule).forEach((rule) => {
80
+ Array.from(rule.style).forEach((propName) => {
81
+ if (propName.startsWith("--")) {
82
+ CSSVarsUtils.applyIfExists(host, child, propName);
83
+ }
84
+ });
85
+ });
86
+ });
87
+ }
88
+ static applyVarsTextInput(host, child) {
89
+ if (child) {
90
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--background-color');
91
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--border-color');
92
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input--height');
93
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--background-color');
94
+ CSSVarsUtils.applyIfExists(host, child, '--ez-text-input__input--disabled--color');
95
+ }
96
+ }
97
+ static applyVarsButton(host, child) {
98
+ if (child) {
99
+ ["--ez-button--min-width",
100
+ "--ez-button--height",
101
+ "--ez-button__icon--width",
102
+ "--ez-button__inline__icon--padding",
103
+ "--ez-button--padding-top",
104
+ "--ez-button--padding-bottom",
105
+ "--ez-button--padding-right",
106
+ "--ez-button--padding-left",
107
+ "--ez-button--color",
108
+ "--ez-button--font-size",
109
+ "--ez-button--font-family",
110
+ "--ez-button--font-weight",
111
+ "--ez-button--background-color",
112
+ "--ez-button--border-radius",
113
+ "--ez-button--border",
114
+ "--ez-button--hover-color",
115
+ "--ez-button--hover--background-color",
116
+ "--ez-button--disabled-color",
117
+ "--ez-button--disabled--background-color",
118
+ "--ez-button--focus--border",
119
+ "--ez-button--focus--box-shadow",
120
+ "--ez-button--active-color",
121
+ "--ez-button--active--background-color",
122
+ "--ez-button--link-color",
123
+ "--ez-button--link--hover-color",
124
+ "--ez-button--link--small--font-size",
125
+ "--ez-button--link--medium--font-size",
126
+ "--ez-button--link--large--font-size",].forEach(prop => {
127
+ CSSVarsUtils.applyIfExists(host, child, prop);
128
+ });
129
+ }
130
+ }
131
+ static applyIfExists(host, element, varName) {
132
+ const prop = getComputedStyle(host).getPropertyValue(varName);
133
+ if (prop) {
134
+ element.style.setProperty(varName, prop);
135
+ }
136
+ }
137
+ }
138
+
139
+ export { ApplicationUtils as A, DialogType as D };