@sankhyalabs/sankhyablocks 5.6.0 → 5.8.0

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 (146) hide show
  1. package/dist/cjs/{SnkMessageBuilder-e64dce7f.js → SnkMessageBuilder-1760d2c9.js} +16 -1
  2. package/dist/cjs/{filter-item-type.enum-3daf58d3.js → filter-item-type.enum-aa823a00.js} +1 -0
  3. package/dist/cjs/filter-type.enum-b14ce507.js +11 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/presentationMode-52ec3bdd.js +7 -0
  6. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  7. package/dist/cjs/snk-application.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  9. package/dist/cjs/{snk-data-unit-85d6565e.js → snk-data-unit-f27603c9.js} +1 -1
  10. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  11. package/dist/cjs/snk-detail-view.cjs.entry.js +1 -1
  12. package/dist/cjs/snk-filter-bar.cjs.entry.js +52 -140
  13. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +26 -15
  14. package/dist/cjs/snk-filter-detail.cjs.entry.js +5 -10
  15. package/dist/cjs/snk-filter-item.cjs.entry.js +36 -8
  16. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +67 -0
  17. package/dist/cjs/snk-filter-modal.cjs.entry.js +72 -49
  18. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +3 -1
  19. package/dist/cjs/snk-filter-number.cjs.entry.js +3 -1
  20. package/dist/cjs/snk-filter-period.cjs.entry.js +18 -2
  21. package/dist/cjs/snk-filter-personalized.cjs.entry.js +3 -1
  22. package/dist/cjs/snk-filter-search.cjs.entry.js +3 -1
  23. package/dist/cjs/snk-filter-text.cjs.entry.js +2 -0
  24. package/dist/cjs/snk-grid.cjs.entry.js +8 -1
  25. package/dist/collection/collection-manifest.json +1 -0
  26. package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js +5 -0
  27. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +60 -29
  28. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +19 -0
  29. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +19 -0
  30. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +72 -1
  31. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +19 -0
  32. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +19 -0
  33. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +19 -0
  34. package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +1 -0
  35. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +5 -10
  36. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +36 -8
  37. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +32 -2
  38. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +116 -156
  39. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css +8 -0
  40. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +116 -0
  41. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +19 -142
  42. package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js +7 -0
  43. package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +36 -0
  44. package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +315 -0
  45. package/dist/collection/components/snk-grid/snk-grid.js +8 -1
  46. package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +16 -1
  47. package/dist/components/SnkMessageBuilder.js +16 -1
  48. package/dist/components/filter-item-type.enum.js +1 -0
  49. package/dist/components/index.d.ts +1 -0
  50. package/dist/components/index.js +1 -0
  51. package/dist/components/presentationMode.js +7 -0
  52. package/dist/components/snk-crud.js +22 -34
  53. package/dist/components/snk-detail-view2.js +24 -46
  54. package/dist/components/snk-filter-bar2.js +57 -157
  55. package/dist/components/snk-filter-binary-select.js +27 -16
  56. package/dist/components/snk-filter-detail2.js +5 -10
  57. package/dist/components/snk-filter-item2.js +36 -8
  58. package/dist/components/snk-filter-list.js +171 -1
  59. package/dist/components/snk-filter-modal-item.d.ts +11 -0
  60. package/dist/components/snk-filter-modal-item.js +6 -0
  61. package/dist/components/snk-filter-modal-item2.js +86 -0
  62. package/dist/components/snk-filter-modal.js +118 -1
  63. package/dist/components/snk-filter-multi-select.js +3 -1
  64. package/dist/components/snk-filter-number.js +3 -1
  65. package/dist/components/snk-filter-period.js +20 -2
  66. package/dist/components/snk-filter-personalized.js +3 -1
  67. package/dist/components/snk-filter-search.js +3 -1
  68. package/dist/components/snk-filter-text.js +3 -1
  69. package/dist/components/snk-grid2.js +18 -23
  70. package/dist/esm/{SnkMessageBuilder-f3590f65.js → SnkMessageBuilder-4caf8b4f.js} +16 -1
  71. package/dist/esm/{filter-item-type.enum-a79b2fa8.js → filter-item-type.enum-5028ed3f.js} +1 -0
  72. package/dist/esm/filter-type.enum-a80c1b6b.js +9 -0
  73. package/dist/esm/loader.js +1 -1
  74. package/dist/esm/presentationMode-783bbf9d.js +7 -0
  75. package/dist/esm/sankhyablocks.js +1 -1
  76. package/dist/esm/snk-application.entry.js +1 -1
  77. package/dist/esm/snk-data-exporter.entry.js +2 -2
  78. package/dist/esm/{snk-data-unit-50b1660c.js → snk-data-unit-640399b3.js} +1 -1
  79. package/dist/esm/snk-data-unit.entry.js +2 -2
  80. package/dist/esm/snk-detail-view.entry.js +1 -1
  81. package/dist/esm/snk-filter-bar.entry.js +53 -141
  82. package/dist/esm/snk-filter-binary-select.entry.js +27 -16
  83. package/dist/esm/snk-filter-detail.entry.js +6 -11
  84. package/dist/esm/snk-filter-item.entry.js +37 -9
  85. package/dist/esm/snk-filter-modal-item.entry.js +63 -0
  86. package/dist/esm/snk-filter-modal.entry.js +73 -50
  87. package/dist/esm/snk-filter-multi-select.entry.js +4 -2
  88. package/dist/esm/snk-filter-number.entry.js +4 -2
  89. package/dist/esm/snk-filter-period.entry.js +19 -3
  90. package/dist/esm/snk-filter-personalized.entry.js +4 -2
  91. package/dist/esm/snk-filter-search.entry.js +4 -2
  92. package/dist/esm/snk-filter-text.entry.js +3 -1
  93. package/dist/esm/snk-grid.entry.js +8 -1
  94. package/dist/sankhyablocks/p-08779202.entry.js +1 -0
  95. package/dist/sankhyablocks/p-1465f132.entry.js +1 -0
  96. package/dist/sankhyablocks/p-1a68fb59.js +1 -0
  97. package/dist/sankhyablocks/{p-f344b811.entry.js → p-21c2b733.entry.js} +1 -1
  98. package/dist/sankhyablocks/p-29c1889f.js +1 -0
  99. package/dist/sankhyablocks/p-355e7ab0.entry.js +1 -0
  100. package/dist/sankhyablocks/p-3794686e.entry.js +1 -0
  101. package/dist/sankhyablocks/{p-c4417efb.entry.js → p-4181c36d.entry.js} +1 -1
  102. package/dist/sankhyablocks/p-4ce96831.entry.js +1 -0
  103. package/dist/sankhyablocks/{p-3fbe2d69.entry.js → p-57b74971.entry.js} +1 -1
  104. package/dist/sankhyablocks/{p-9dd2b8cb.js → p-584d7212.js} +1 -1
  105. package/dist/sankhyablocks/p-59705471.entry.js +1 -0
  106. package/dist/sankhyablocks/{p-3d3263b4.js → p-6981c03e.js} +1 -1
  107. package/dist/sankhyablocks/p-786ae316.entry.js +1 -0
  108. package/dist/sankhyablocks/p-80e52e85.entry.js +1 -0
  109. package/dist/sankhyablocks/p-8efb0f47.entry.js +1 -0
  110. package/dist/sankhyablocks/p-9af04fc7.entry.js +1 -0
  111. package/dist/sankhyablocks/{p-df8f13b4.entry.js → p-9c3f0caf.entry.js} +1 -1
  112. package/dist/sankhyablocks/p-9cbc3925.entry.js +1 -0
  113. package/dist/sankhyablocks/p-b9fb86fe.entry.js +1 -0
  114. package/dist/sankhyablocks/p-d9804798.js +1 -0
  115. package/dist/sankhyablocks/p-e2bb9c9a.entry.js +1 -0
  116. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  117. package/dist/types/components/snk-filter-bar/filter-item/editors/enum/presentationMode.d.ts +4 -0
  118. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +5 -0
  119. package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +2 -1
  120. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +11 -1
  121. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +37 -0
  122. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +17 -0
  123. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +2 -11
  124. package/dist/types/components/snk-filter-bar/types/filter-type.enum.d.ts +6 -0
  125. package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +20 -0
  126. package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +186 -0
  127. package/dist/types/components.d.ts +119 -56
  128. package/package.json +1 -1
  129. package/react/components.d.ts +1 -0
  130. package/react/components.js +1 -0
  131. package/react/components.js.map +1 -1
  132. package/dist/components/snk-filter-list2.js +0 -173
  133. package/dist/components/snk-filter-modal2.js +0 -97
  134. package/dist/sankhyablocks/p-1dcfd32a.entry.js +0 -1
  135. package/dist/sankhyablocks/p-3a2ce158.entry.js +0 -1
  136. package/dist/sankhyablocks/p-5e62a17b.entry.js +0 -1
  137. package/dist/sankhyablocks/p-5fc55684.entry.js +0 -1
  138. package/dist/sankhyablocks/p-73e830cf.entry.js +0 -1
  139. package/dist/sankhyablocks/p-86d29b6f.entry.js +0 -1
  140. package/dist/sankhyablocks/p-ad51bf1c.entry.js +0 -1
  141. package/dist/sankhyablocks/p-afba9bbe.entry.js +0 -1
  142. package/dist/sankhyablocks/p-c336170d.entry.js +0 -1
  143. package/dist/sankhyablocks/p-c9477950.js +0 -1
  144. package/dist/sankhyablocks/p-d5c9c1f8.entry.js +0 -1
  145. package/dist/sankhyablocks/p-ee82c157.entry.js +0 -1
  146. package/dist/sankhyablocks/p-fac37198.entry.js +0 -1
@@ -1,10 +1,14 @@
1
1
  import { ElementIDUtils } from '@sankhyalabs/core';
2
2
  import { h, Host } from '@stencil/core';
3
3
  import FilterItemType from '../filter-item-type.enum';
4
+ import { EPresentationMode } from './enum/presentationMode';
4
5
  export class SnkFilterBinarySelect {
5
6
  constructor() {
7
+ this._noOptionValue = 'NO_VALUE';
8
+ this._radioButtonValue = undefined;
6
9
  this.value = undefined;
7
10
  this.config = undefined;
11
+ this.presentationMode = EPresentationMode.CHIP;
8
12
  }
9
13
  isSelected(option) {
10
14
  return this.value == undefined || this.value === option;
@@ -13,15 +17,15 @@ export class SnkFilterBinarySelect {
13
17
  * Emitido quando acontece a alteração de valor do componente snk-filter-binary-select
14
18
  */
15
19
  ezChangeListener(evt) {
16
- if (!evt.detail) {
17
- this.assertCheckedOption(evt.target);
18
- }
19
- this.updateValue();
20
- }
21
- componentDidLoad() {
22
- if (this._element) {
23
- ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
20
+ if (this.presentationMode === EPresentationMode.MODAL) {
21
+ if (!evt.detail) {
22
+ this.assertCheckedOption(evt.target);
23
+ }
24
+ this.updateValue();
25
+ return;
24
26
  }
27
+ this.value = evt.detail === this._noOptionValue ? undefined : evt.detail;
28
+ this._radioButtonValue = evt.detail;
25
29
  }
26
30
  assertCheckedOption(updatingCheck) {
27
31
  if (updatingCheck === this._checkOne) {
@@ -39,19 +43,25 @@ export class SnkFilterBinarySelect {
39
43
  else {
40
44
  this.value = undefined;
41
45
  }
46
+ this.valueChanged.emit(this.value);
42
47
  }
43
- /**
44
- * Exibe o componente snk-filter-binary-select
45
- */
46
- async show() {
47
- this._checkOne.setFocus();
48
+ componentDidLoad() {
49
+ if (this._element) {
50
+ ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
51
+ }
52
+ }
53
+ componentWillLoad() {
54
+ this._radioButtonValue = this.value || this._noOptionValue;
48
55
  }
49
56
  render() {
50
57
  if (!this.config || this.config.type !== FilterItemType.BINARY_SELECT) {
51
58
  return undefined;
52
59
  }
53
60
  const [optOne, optTwo] = this.config.props.options;
54
- return (h(Host, null, h("ez-check", { id: `${this.config.id}_${optOne.name || "option1"}`, label: optOne.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkOne = ref, value: this.isSelected(optOne.name) }), h("ez-check", { id: `${this.config.id}_${optTwo.name || "option2"}`, label: optTwo.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkTwo = ref, value: this.isSelected(optTwo.name) })));
61
+ if (this.presentationMode === EPresentationMode.MODAL) {
62
+ return (h(Host, null, h("div", { class: "ez-flex ez-flex--row ez-flex--align-items-center" }, h("label", { class: "ez-text ez-title--small ez-title--primary", style: { flex: '1 1 0', width: '0px' } }, this.config.detailModal), h("ez-check", { compact: true, style: { flex: '1 1 0', width: '0px' }, id: `${this.config.id}_${optOne.name || "option1"}`, label: optOne.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkOne = ref, value: this.isSelected(optOne.name) }), h("ez-check", { compact: true, style: { flex: '1 1 0', width: '0px' }, id: `${this.config.id}_${optTwo.name || "option2"}`, label: optTwo.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkTwo = ref, value: this.isSelected(optTwo.name) }))));
63
+ }
64
+ return (h(Host, null, h("ez-radio-button", { value: this._radioButtonValue }, h("ez-radio-button-option", { id: `${this.config.id}_${optOne.name || "option1"}`, class: "sc-snk-filter-bar editor__ez-check", label: optOne.label, value: optOne.name }), h("ez-radio-button-option", { id: `${this.config.id}_${optTwo.name || "option2"}`, class: "sc-snk-filter-bar editor__ez-check", label: optTwo.label, value: optTwo.name }), h("ez-radio-button-option", { id: `${this.config.id}_option3`, class: "sc-snk-filter-bar editor__ez-check", label: `${optOne.label} + ${optTwo.label}`, value: this._noOptionValue }))));
55
65
  }
56
66
  static get is() { return "snk-filter-binary-select"; }
57
67
  static get properties() {
@@ -92,29 +102,50 @@ export class SnkFilterBinarySelect {
92
102
  "tags": [],
93
103
  "text": "Define as configura\u00E7\u00F5es do componente snk-filter-binary-select"
94
104
  }
95
- }
96
- };
97
- }
98
- static get methods() {
99
- return {
100
- "show": {
105
+ },
106
+ "presentationMode": {
107
+ "type": "number",
108
+ "mutable": false,
101
109
  "complexType": {
102
- "signature": "() => Promise<void>",
103
- "parameters": [],
110
+ "original": "EPresentationMode",
111
+ "resolved": "EPresentationMode.CHIP | EPresentationMode.MODAL",
104
112
  "references": {
105
- "Promise": {
106
- "location": "global"
113
+ "EPresentationMode": {
114
+ "location": "import",
115
+ "path": "./enum/presentationMode"
107
116
  }
108
- },
109
- "return": "Promise<void>"
117
+ }
110
118
  },
119
+ "required": false,
120
+ "optional": false,
111
121
  "docs": {
112
- "text": "Exibe o componente snk-filter-binary-select",
113
- "tags": []
114
- }
122
+ "tags": [],
123
+ "text": "Define a varia\u00E7\u00E3o do componente"
124
+ },
125
+ "attribute": "presentation-mode",
126
+ "reflect": false,
127
+ "defaultValue": "EPresentationMode.CHIP"
115
128
  }
116
129
  };
117
130
  }
131
+ static get events() {
132
+ return [{
133
+ "method": "valueChanged",
134
+ "name": "valueChanged",
135
+ "bubbles": true,
136
+ "cancelable": true,
137
+ "composed": true,
138
+ "docs": {
139
+ "tags": [],
140
+ "text": "Emitido quando o valor do filtro \u00E9 alterado."
141
+ },
142
+ "complexType": {
143
+ "original": "any",
144
+ "resolved": "any",
145
+ "references": {}
146
+ }
147
+ }];
148
+ }
118
149
  static get elementRef() { return "_element"; }
119
150
  static get listeners() {
120
151
  return [{
@@ -11,6 +11,7 @@ export class SnkFilterMultiSelect {
11
11
  */
12
12
  ezChangeListener(evt) {
13
13
  this.value = evt.detail.value;
14
+ this.valueChanged.emit(this.value);
14
15
  }
15
16
  /**
16
17
  * Exibe o componente snk-filter-multi-select
@@ -71,6 +72,24 @@ export class SnkFilterMultiSelect {
71
72
  }
72
73
  };
73
74
  }
75
+ static get events() {
76
+ return [{
77
+ "method": "valueChanged",
78
+ "name": "valueChanged",
79
+ "bubbles": true,
80
+ "cancelable": true,
81
+ "composed": true,
82
+ "docs": {
83
+ "tags": [],
84
+ "text": "Emitido quando o valor do filtro \u00E9 alterado."
85
+ },
86
+ "complexType": {
87
+ "original": "any",
88
+ "resolved": "any",
89
+ "references": {}
90
+ }
91
+ }];
92
+ }
74
93
  static get methods() {
75
94
  return {
76
95
  "show": {
@@ -11,6 +11,7 @@ export class SnkFilterPeriod {
11
11
  */
12
12
  ezChangeListener(evt) {
13
13
  this.value = evt.detail;
14
+ this.valueChanged.emit(this.value);
14
15
  }
15
16
  /**
16
17
  * Exibe o componente snk-filter-number
@@ -72,6 +73,24 @@ export class SnkFilterPeriod {
72
73
  }
73
74
  };
74
75
  }
76
+ static get events() {
77
+ return [{
78
+ "method": "valueChanged",
79
+ "name": "valueChanged",
80
+ "bubbles": true,
81
+ "cancelable": true,
82
+ "composed": true,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": "Emitido quando o valor do filtro \u00E9 alterado."
86
+ },
87
+ "complexType": {
88
+ "original": "any",
89
+ "resolved": "any",
90
+ "references": {}
91
+ }
92
+ }];
93
+ }
75
94
  static get methods() {
76
95
  return {
77
96
  "show": {
@@ -1,10 +1,15 @@
1
1
  import { ElementIDUtils } from '@sankhyalabs/core';
2
2
  import { h } from '@stencil/core';
3
3
  import FilterItemType from '../filter-item-type.enum';
4
+ import { EPresentationMode } from './enum/presentationMode';
4
5
  export class SnkFilterPeriod {
5
6
  constructor() {
7
+ this._startDateLabel = 'Inicial';
8
+ this._endDateLabel = 'Final';
6
9
  this.config = undefined;
10
+ this.getMessage = undefined;
7
11
  this.value = undefined;
12
+ this.presentationMode = EPresentationMode.CHIP;
8
13
  }
9
14
  /**
10
15
  * Emitido quando acontece a alteração de valor do componente snk-filter-period
@@ -13,6 +18,7 @@ export class SnkFilterPeriod {
13
18
  const start = this._startDate.value;
14
19
  const end = this._endDate.value;
15
20
  this.value = (start || end ? { start, end } : undefined);
21
+ this.valueChanged.emit(this.value);
16
22
  }
17
23
  componentDidLoad() {
18
24
  if (this._element) {
@@ -37,11 +43,20 @@ export class SnkFilterPeriod {
37
43
  async show() {
38
44
  this._startDate.setFocus();
39
45
  }
46
+ buildLabel() {
47
+ if (this.presentationMode === EPresentationMode.CHIP) {
48
+ return h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin--medium" }, "at\u00E9");
49
+ }
50
+ }
51
+ componentWillLoad() {
52
+ this._startDateLabel = this.getMessage('snkFilterBar.labelStartDatePeriod');
53
+ this._endDateLabel = this.getMessage('snkFilterBar.labelEndDatePeriod');
54
+ }
40
55
  render() {
41
56
  if (!this.config || this.config.type !== FilterItemType.PERIOD) {
42
57
  return undefined;
43
58
  }
44
- return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { id: `${this.config.id}_start`, label: this.config.label, ref: ref => this._startDate = ref, value: this.getDate("start") }), h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin--medium" }, "at\u00E9"), h("ez-date-input", { id: `${this.config.id}_end`, label: this.config.label, ref: ref => this._endDate = ref, value: this.getDate("end") })));
59
+ return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { id: `${this.config.id}_start`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._startDateLabel, ref: ref => this._startDate = ref, value: this.getDate("start") }), this.buildLabel(), h("ez-date-input", { id: `${this.config.id}_end`, class: this.presentationMode === EPresentationMode.MODAL ? 'ez-padding--small' : '', label: this._endDateLabel, ref: ref => this._endDate = ref, value: this.getDate("end") })));
45
60
  }
46
61
  static get is() { return "snk-filter-period"; }
47
62
  static get properties() {
@@ -66,6 +81,21 @@ export class SnkFilterPeriod {
66
81
  "text": "Define as configura\u00E7\u00F5es do componente snk-filter-period"
67
82
  }
68
83
  },
84
+ "getMessage": {
85
+ "type": "unknown",
86
+ "mutable": false,
87
+ "complexType": {
88
+ "original": "(key: string, props?: any) => string",
89
+ "resolved": "(key: string, props?: any) => string",
90
+ "references": {}
91
+ },
92
+ "required": false,
93
+ "optional": false,
94
+ "docs": {
95
+ "tags": [],
96
+ "text": "Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder."
97
+ }
98
+ },
69
99
  "value": {
70
100
  "type": "any",
71
101
  "mutable": false,
@@ -82,9 +112,50 @@ export class SnkFilterPeriod {
82
112
  },
83
113
  "attribute": "value",
84
114
  "reflect": false
115
+ },
116
+ "presentationMode": {
117
+ "type": "number",
118
+ "mutable": false,
119
+ "complexType": {
120
+ "original": "EPresentationMode",
121
+ "resolved": "EPresentationMode.CHIP | EPresentationMode.MODAL",
122
+ "references": {
123
+ "EPresentationMode": {
124
+ "location": "import",
125
+ "path": "./enum/presentationMode"
126
+ }
127
+ }
128
+ },
129
+ "required": false,
130
+ "optional": false,
131
+ "docs": {
132
+ "tags": [],
133
+ "text": "Define a varia\u00E7\u00E3o do componente"
134
+ },
135
+ "attribute": "presentation-mode",
136
+ "reflect": false,
137
+ "defaultValue": "EPresentationMode.CHIP"
85
138
  }
86
139
  };
87
140
  }
141
+ static get events() {
142
+ return [{
143
+ "method": "valueChanged",
144
+ "name": "valueChanged",
145
+ "bubbles": true,
146
+ "cancelable": true,
147
+ "composed": true,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": "Emitido quando o valor do filtro \u00E9 alterado."
151
+ },
152
+ "complexType": {
153
+ "original": "any",
154
+ "resolved": "any",
155
+ "references": {}
156
+ }
157
+ }];
158
+ }
88
159
  static get methods() {
89
160
  return {
90
161
  "show": {
@@ -36,6 +36,7 @@ export class SnkFilterPersonalized {
36
36
  if (this.value.filter(item => item != undefined).length == 0) {
37
37
  this.value = null;
38
38
  }
39
+ this.valueChanged.emit(this.value || []);
39
40
  }
40
41
  doSearch(mode, argument, param) {
41
42
  const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
@@ -171,6 +172,24 @@ export class SnkFilterPersonalized {
171
172
  }
172
173
  };
173
174
  }
175
+ static get events() {
176
+ return [{
177
+ "method": "valueChanged",
178
+ "name": "valueChanged",
179
+ "bubbles": true,
180
+ "cancelable": true,
181
+ "composed": true,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": "Emitido quando o valor do filtro \u00E9 alterado."
185
+ },
186
+ "complexType": {
187
+ "original": "any",
188
+ "resolved": "any",
189
+ "references": {}
190
+ }
191
+ }];
192
+ }
174
193
  static get methods() {
175
194
  return {
176
195
  "show": {
@@ -11,6 +11,7 @@ export class SnkFilterSearch {
11
11
  */
12
12
  ezChangeListener(_evt) {
13
13
  this.value = this._searchInput.value;
14
+ this.valueChanged.emit(this.value);
14
15
  }
15
16
  componentDidLoad() {
16
17
  if (this._element) {
@@ -85,6 +86,24 @@ export class SnkFilterSearch {
85
86
  }
86
87
  };
87
88
  }
89
+ static get events() {
90
+ return [{
91
+ "method": "valueChanged",
92
+ "name": "valueChanged",
93
+ "bubbles": true,
94
+ "cancelable": true,
95
+ "composed": true,
96
+ "docs": {
97
+ "tags": [],
98
+ "text": "Emitido quando o valor do filtro \u00E9 alterado."
99
+ },
100
+ "complexType": {
101
+ "original": "any",
102
+ "resolved": "any",
103
+ "references": {}
104
+ }
105
+ }];
106
+ }
88
107
  static get methods() {
89
108
  return {
90
109
  "show": {
@@ -10,6 +10,7 @@ export class SnkFilterText {
10
10
  */
11
11
  ezChangeListener(evt) {
12
12
  this.value = evt.detail;
13
+ this.valueChanged.emit(this.value);
13
14
  }
14
15
  componentDidLoad() {
15
16
  if (this._element) {
@@ -64,6 +65,24 @@ export class SnkFilterText {
64
65
  }
65
66
  };
66
67
  }
68
+ static get events() {
69
+ return [{
70
+ "method": "valueChanged",
71
+ "name": "valueChanged",
72
+ "bubbles": true,
73
+ "cancelable": true,
74
+ "composed": true,
75
+ "docs": {
76
+ "tags": [],
77
+ "text": "Emitido quando o valor do filtro \u00E9 alterado."
78
+ },
79
+ "complexType": {
80
+ "original": "any",
81
+ "resolved": "any",
82
+ "references": {}
83
+ }
84
+ }];
85
+ }
67
86
  static get elementRef() { return "_element"; }
68
87
  static get listeners() {
69
88
  return [{
@@ -8,5 +8,6 @@ var FilterItemType;
8
8
  FilterItemType["NUMBER"] = "NUMBER";
9
9
  FilterItemType["DEFAULT_FILTER"] = "DEFAULT_FILTER";
10
10
  FilterItemType["PERSONALIZED"] = "PERSONALIZED";
11
+ FilterItemType["MULTI_LIST"] = "MULTI_LIST";
11
12
  })(FilterItemType || (FilterItemType = {}));
12
13
  export default FilterItemType;
@@ -1,4 +1,4 @@
1
- import { h, Host } from '@stencil/core';
1
+ import { h, Host, Fragment } from '@stencil/core';
2
2
  import { ApplicationUtils } from "@sankhyalabs/ezui/dist/collection/utils";
3
3
  import FilterItemType from './filter-item-type.enum';
4
4
  import { ElementIDUtils, DataType } from '@sankhyalabs/core';
@@ -11,7 +11,8 @@ export class SnkFilterDetail {
11
11
  * Exibe o componente snk-filter-detail.
12
12
  */
13
13
  async show() {
14
- this._editor["show"]();
14
+ var _a, _b;
15
+ (_b = (_a = this._editor)["show"]) === null || _b === void 0 ? void 0 : _b.call(_a);
15
16
  }
16
17
  componentDidLoad() {
17
18
  if (this._element) {
@@ -44,13 +45,7 @@ export class SnkFilterDetail {
44
45
  this.changeConfig(Object.assign(Object.assign({}, this.config), { visible: false, fixed: false, value: undefined }));
45
46
  }
46
47
  getPopUpHeaderButtons() {
47
- if (this.config.hardFixed) {
48
- return undefined;
49
- }
50
- return ([
51
- this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()),
52
- this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))
53
- ]);
48
+ return (h(Fragment, null, !this.config.removalBlocked && this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), !this.config.hardFixed && this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
54
49
  }
55
50
  buildIcon(title, iconName, action) {
56
51
  return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", ref: elem => elem && this.buildIdButton(elem, title) }, h("ez-icon", Object.assign({ title: title, iconName: iconName }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`_${title}`)}` }))));
@@ -122,7 +117,7 @@ export class SnkFilterDetail {
122
117
  }
123
118
  render() {
124
119
  const ContentEditor = this.getContentEditor();
125
- 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, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor }), 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.clear(), size: "small" }), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
120
+ 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, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage }), 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.clear(), size: "small" }), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
126
121
  }
127
122
  static get is() { return "snk-filter-detail"; }
128
123
  static get properties() {
@@ -1,4 +1,4 @@
1
- import { ElementIDUtils, FloatingManager } from '@sankhyalabs/core';
1
+ import { ElementIDUtils, FloatingManager, DateUtils } from '@sankhyalabs/core';
2
2
  import { h, Host } from '@stencil/core';
3
3
  import FilterItemType from './filter-item-type.enum';
4
4
  export class SnkFilterItem {
@@ -110,16 +110,17 @@ export class SnkFilterItem {
110
110
  evt.stopPropagation();
111
111
  }
112
112
  }
113
- getLabel() {
113
+ getLabel(isTooltipLabel = false) {
114
114
  const { type, value, label, props } = this.config;
115
115
  if (value) {
116
116
  if (type === FilterItemType.BINARY_SELECT) {
117
117
  const [optOne, optTwo] = props.options;
118
+ const tooltip = this.getMessage('snkFilterBar.binarySelectTooltip');
118
119
  if (optOne.name === value) {
119
- return optOne.label;
120
+ return isTooltipLabel ? `${tooltip} ${String(optOne.label).toLowerCase()}` : optOne.label;
120
121
  }
121
122
  if (optTwo.name === value) {
122
- return optTwo.label;
123
+ return isTooltipLabel ? `${tooltip} ${String(optTwo.label).toLowerCase()}` : optTwo.label;
123
124
  }
124
125
  }
125
126
  if (type === FilterItemType.MULTI_SELECT) {
@@ -138,14 +139,21 @@ export class SnkFilterItem {
138
139
  }
139
140
  const dateFormater = new Intl.DateTimeFormat("pt-BR");
140
141
  if (end && start) {
141
- return `${label}: ${dateFormater.format(start)} a ${dateFormater.format(end)}`;
142
+ const isSameYear = start.getFullYear() === end.getFullYear();
143
+ const formatOptions = Object.assign({ day: '2-digit', month: '2-digit' }, ((!isSameYear || isTooltipLabel) && { year: '2-digit' }));
144
+ const startLabel = DateUtils.formatDate(start, formatOptions);
145
+ const endLabel = DateUtils.formatDate(end, formatOptions);
146
+ if (isTooltipLabel) {
147
+ return this.getMessage('snkFilterBar.fullPeriodTooltip', { LABEL: label, START_LABEL: startLabel, END_LABEL: endLabel });
148
+ }
149
+ return `${label}: ${startLabel} \u2192 ${endLabel}`;
142
150
  }
143
151
  else {
144
152
  if (start) {
145
- return `${label}: A partir de ${dateFormater.format(start)}`;
153
+ return `${label}: ${this.getMessage('snkFilterBar.onlyStartPeriodToltip')} ${dateFormater.format(start)}`;
146
154
  }
147
155
  else if (end) {
148
- return `${label}: Até ${dateFormater.format(end)}`;
156
+ return `${label}: ${this.getMessage('snkFilterBar.onlyEndPeriodToltip')} ${dateFormater.format(end)}`;
149
157
  }
150
158
  else {
151
159
  return label;
@@ -158,10 +166,30 @@ export class SnkFilterItem {
158
166
  if (type === FilterItemType.PERSONALIZED) {
159
167
  return label;
160
168
  }
169
+ if (type === FilterItemType.MULTI_LIST) {
170
+ const selectedOptions = value.filter(item => item.check);
171
+ const checkedAmount = selectedOptions.length;
172
+ if (checkedAmount > 1) {
173
+ if (isTooltipLabel) {
174
+ const selectedOptionsDescrptions = selectedOptions.map(item => item.description);
175
+ return `${label}: ${selectedOptionsDescrptions.join(',')}`;
176
+ }
177
+ return `${label}: ${checkedAmount} ${this.getMessage('snkFilterBar.multiListToltip')}`;
178
+ }
179
+ return `${label}: ${value.description}`;
180
+ }
161
181
  return `${label}: ${value}`;
162
182
  }
163
183
  return label;
164
184
  }
185
+ applyTooltip() {
186
+ if (!this.config.value)
187
+ return undefined;
188
+ return {
189
+ 'data-tooltip': this.getLabel(true),
190
+ 'data-flow': 'bottom'
191
+ };
192
+ }
165
193
  componentDidLoad() {
166
194
  if (this._filterItemElement) {
167
195
  ElementIDUtils.addIDInfo(this._filterItemElement);
@@ -199,7 +227,7 @@ export class SnkFilterItem {
199
227
  }
200
228
  render() {
201
229
  const leftIcon = this.getLeftIconName();
202
- return (h(Host, null, h("ez-chip", { ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.config.value != undefined, id: this.config.id }, 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", id: "removeFilter" })), 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, "data-element-id": this._idSnkFilterDetail }))));
230
+ return (h(Host, Object.assign({}, this.applyTooltip()), h("ez-chip", { id: this.config.id, 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", id: "removeFilter" })), 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, "data-element-id": this._idSnkFilterDetail }))));
203
231
  }
204
232
  static get is() { return "snk-filter-item"; }
205
233
  static get properties() {
@@ -1,5 +1,35 @@
1
1
 
2
+ ez-modal {
3
+ --ez-modal-content-padding: 24px 12px;
4
+ }
5
+
2
6
  .snk-filter__modal-container{
3
- width: 359px;
4
- max-width: 359px;
7
+ width: 344px;
8
+ max-width: 344px;
9
+ overflow: hidden;
10
+ }
11
+
12
+ .snk-filter__modal-content{
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: 12px;
16
+ max-height: 760px;
17
+ overflow-x: clip;
18
+ overflow-y: auto;
19
+ padding-right: 4px;
20
+ }
21
+
22
+ .snk-filter__modal-content::-webkit-scrollbar {
23
+ width: var(--space--small);
24
+ min-width: var(--space--small);
25
+ max-width: var(--space--small);
5
26
  }
27
+
28
+
29
+ .snk-filter__modal-collapsible-box{
30
+ border: 1px solid #DCE0E8;
31
+ border-radius: var(--border--radius-medium);
32
+ padding: 12px 6px;
33
+ }
34
+
35
+