@sankhyalabs/ezui 5.19.2 → 5.20.0-dev.10

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 (206) hide show
  1. package/README.md +4 -5
  2. package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-alert-list.cjs.entry.js +108 -47
  4. package/dist/cjs/ez-alert.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-application.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-badge.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-breadcrumb.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  9. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  10. package/dist/cjs/ez-card-item_3.cjs.entry.js +182 -0
  11. package/dist/cjs/ez-check.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-combo-box.cjs.entry.js +13 -157
  15. package/dist/cjs/ez-date-input.cjs.entry.js +1 -4
  16. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -4
  17. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-dropdown.cjs.entry.js +10 -4
  19. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-form-view.cjs.entry.js +5 -3
  21. package/dist/cjs/ez-form.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-grid.cjs.entry.js +21 -22
  23. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  24. package/dist/cjs/ez-icon.cjs.entry.js +2 -2
  25. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-modal-container.cjs.entry.js +1 -1
  28. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  29. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-number-input.cjs.entry.js +1 -4
  31. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-popup.cjs.entry.js +2 -2
  33. package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-scroller_3.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-search.cjs.entry.js +612 -32
  36. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  37. package/dist/cjs/ez-split-item.cjs.entry.js +12 -3
  38. package/dist/cjs/ez-split-panel.cjs.entry.js +12 -10
  39. package/dist/cjs/ez-tabselector.cjs.entry.js +1 -1
  40. package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
  41. package/dist/cjs/ez-text-edit.cjs.entry.js +1 -1
  42. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  43. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  44. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  45. package/dist/cjs/ez-upload.cjs.entry.js +1 -1
  46. package/dist/cjs/ez-view-stack.cjs.entry.js +1 -1
  47. package/dist/cjs/ezui.cjs.js +2 -2
  48. package/dist/cjs/filter-column.cjs.entry.js +17 -6
  49. package/dist/cjs/{index-1064511f.js → index-a7b0c73d.js} +4 -6
  50. package/dist/cjs/loader.cjs.js +2 -2
  51. package/dist/collection/collection-manifest.json +3 -3
  52. package/dist/collection/components/ez-alert-list/ez-alert-list.css +15 -1
  53. package/dist/collection/components/ez-alert-list/ez-alert-list.js +109 -46
  54. package/dist/collection/components/ez-card-item/ez-card-item.css +35 -0
  55. package/dist/collection/components/ez-combo-box/ez-combo-box.js +13 -174
  56. package/dist/collection/components/ez-date-input/ez-date-input.js +0 -3
  57. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +0 -3
  58. package/dist/collection/components/ez-dropdown/ez-dropdown.js +32 -3
  59. package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +4 -2
  60. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +7 -10
  61. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +12 -1
  62. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +1 -3
  63. package/dist/collection/components/ez-grid/ez-grid.css +1 -0
  64. package/dist/collection/components/ez-grid/ez-grid.js +2 -2
  65. package/dist/collection/components/ez-grid/subcomponents/filter-column.js +16 -5
  66. package/dist/collection/components/ez-icon/ez-icon.css +1 -1
  67. package/dist/collection/components/ez-number-input/ez-number-input.js +0 -3
  68. package/dist/collection/components/ez-popup/ez-popup.css +0 -1
  69. package/dist/collection/components/ez-search/ez-search.css +331 -0
  70. package/dist/collection/components/ez-search/ez-search.js +689 -55
  71. package/dist/collection/components/ez-split-panel/ez-split-panel.css +7 -7
  72. package/dist/collection/components/ez-split-panel/ez-split-panel.js +30 -10
  73. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +36 -12
  74. package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +57 -2
  75. package/dist/collection/utils/form/test/DataBinder.test.js +9 -0
  76. package/dist/custom-elements/index.js +812 -298
  77. package/dist/esm/ez-actions-button.entry.js +1 -1
  78. package/dist/esm/ez-alert-list.entry.js +108 -47
  79. package/dist/esm/ez-alert.entry.js +1 -1
  80. package/dist/esm/ez-application.entry.js +1 -1
  81. package/dist/esm/ez-badge.entry.js +1 -1
  82. package/dist/esm/ez-breadcrumb.entry.js +1 -1
  83. package/dist/esm/ez-button.entry.js +1 -1
  84. package/dist/esm/ez-calendar.entry.js +1 -1
  85. package/dist/esm/ez-card-item_3.entry.js +176 -0
  86. package/dist/esm/ez-check.entry.js +1 -1
  87. package/dist/esm/ez-chip.entry.js +1 -1
  88. package/dist/esm/ez-collapsible-box.entry.js +1 -1
  89. package/dist/esm/ez-combo-box.entry.js +14 -158
  90. package/dist/esm/ez-date-input.entry.js +1 -4
  91. package/dist/esm/ez-date-time-input.entry.js +1 -4
  92. package/dist/esm/ez-dialog.entry.js +1 -1
  93. package/dist/esm/ez-dropdown.entry.js +10 -4
  94. package/dist/esm/ez-file-item.entry.js +1 -1
  95. package/dist/esm/ez-form-view.entry.js +5 -3
  96. package/dist/esm/ez-form.entry.js +1 -1
  97. package/dist/esm/ez-grid.entry.js +21 -22
  98. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  99. package/dist/esm/ez-icon.entry.js +2 -2
  100. package/dist/esm/ez-list.entry.js +1 -1
  101. package/dist/esm/ez-loading-bar.entry.js +1 -1
  102. package/dist/esm/ez-modal-container.entry.js +1 -1
  103. package/dist/esm/ez-modal.entry.js +1 -1
  104. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  105. package/dist/esm/ez-number-input.entry.js +1 -4
  106. package/dist/esm/ez-popover.entry.js +1 -1
  107. package/dist/esm/ez-popup.entry.js +2 -2
  108. package/dist/esm/ez-radio-button.entry.js +1 -1
  109. package/dist/esm/ez-scroller_3.entry.js +1 -1
  110. package/dist/esm/ez-search.entry.js +613 -33
  111. package/dist/esm/ez-skeleton.entry.js +1 -1
  112. package/dist/esm/ez-split-item.entry.js +12 -3
  113. package/dist/esm/ez-split-panel.entry.js +12 -10
  114. package/dist/esm/ez-tabselector.entry.js +1 -1
  115. package/dist/esm/ez-text-area.entry.js +1 -1
  116. package/dist/esm/ez-text-edit.entry.js +1 -1
  117. package/dist/esm/ez-text-input.entry.js +1 -1
  118. package/dist/esm/ez-time-input.entry.js +1 -1
  119. package/dist/esm/ez-toast.entry.js +1 -1
  120. package/dist/esm/ez-upload.entry.js +1 -1
  121. package/dist/esm/ez-view-stack.entry.js +1 -1
  122. package/dist/esm/ezui.js +3 -3
  123. package/dist/esm/filter-column.entry.js +17 -6
  124. package/dist/esm/{index-296b8458.js → index-baa5e267.js} +4 -6
  125. package/dist/esm/loader.js +3 -3
  126. package/dist/ezui/ezui.esm.js +1 -1
  127. package/dist/ezui/{p-99692afa.entry.js → p-02c8831a.entry.js} +1 -1
  128. package/dist/ezui/{p-5cef0264.entry.js → p-0306dff7.entry.js} +1 -1
  129. package/dist/ezui/{p-871c1a07.entry.js → p-0447d17c.entry.js} +1 -1
  130. package/dist/ezui/p-072e6347.entry.js +1 -0
  131. package/dist/ezui/p-133fae4a.entry.js +1 -0
  132. package/dist/ezui/p-13dbad96.entry.js +1 -0
  133. package/dist/ezui/{p-f4208819.entry.js → p-17be134a.entry.js} +1 -1
  134. package/dist/ezui/{p-cd19a6f8.entry.js → p-1e7a8633.entry.js} +1 -1
  135. package/dist/ezui/{p-60ba28ea.entry.js → p-1f50fa05.entry.js} +1 -1
  136. package/dist/ezui/{p-245a44ed.entry.js → p-20ec22c0.entry.js} +1 -1
  137. package/dist/ezui/{p-e318d280.js → p-23a36bb6.js} +1 -1
  138. package/dist/ezui/p-24d3fede.entry.js +1 -0
  139. package/dist/ezui/{p-8252d9b5.entry.js → p-2a1a0e04.entry.js} +1 -1
  140. package/dist/ezui/{p-d20ed286.entry.js → p-300bf244.entry.js} +1 -1
  141. package/dist/ezui/{p-22208198.entry.js → p-40f72de4.entry.js} +1 -1
  142. package/dist/ezui/p-428a05fe.entry.js +1 -0
  143. package/dist/ezui/{p-9b347f04.entry.js → p-44caad9a.entry.js} +1 -1
  144. package/dist/ezui/{p-7319c253.entry.js → p-49456b34.entry.js} +1 -1
  145. package/dist/ezui/{p-ccb4ccd9.entry.js → p-555c9018.entry.js} +1 -1
  146. package/dist/ezui/p-596634e9.entry.js +1 -0
  147. package/dist/ezui/{p-52dd8b4c.entry.js → p-5bd5e68f.entry.js} +1 -1
  148. package/dist/ezui/{p-a01068e1.entry.js → p-5d692ed1.entry.js} +1 -1
  149. package/dist/ezui/{p-95426f93.entry.js → p-5d86cca9.entry.js} +1 -1
  150. package/dist/ezui/{p-62304715.entry.js → p-5e1d036e.entry.js} +1 -1
  151. package/dist/ezui/{p-7525e604.entry.js → p-5ed81457.entry.js} +1 -1
  152. package/dist/ezui/p-60848ef6.entry.js +1 -0
  153. package/dist/ezui/{p-c49dbf23.entry.js → p-650e4b6d.entry.js} +1 -1
  154. package/dist/ezui/{p-f55d75e7.entry.js → p-6e429cff.entry.js} +1 -1
  155. package/dist/ezui/{p-0b902469.entry.js → p-77a4bd35.entry.js} +1 -1
  156. package/dist/ezui/{p-5d6f2550.entry.js → p-85c8baae.entry.js} +1 -1
  157. package/dist/ezui/{p-fa571a4e.entry.js → p-8becebf8.entry.js} +1 -1
  158. package/dist/ezui/{p-d3b5228e.entry.js → p-8defa6d3.entry.js} +1 -1
  159. package/dist/ezui/{p-391de0e4.entry.js → p-9050d2cd.entry.js} +1 -1
  160. package/dist/ezui/p-940ed30b.entry.js +1 -0
  161. package/dist/ezui/{p-028f264f.entry.js → p-9cad9b6e.entry.js} +1 -1
  162. package/dist/ezui/{p-b11f035c.entry.js → p-9f5fa3f9.entry.js} +1 -1
  163. package/dist/ezui/{p-d81917fd.entry.js → p-a08b309b.entry.js} +1 -1
  164. package/dist/ezui/{p-2da09f70.entry.js → p-a80b1287.entry.js} +1 -1
  165. package/dist/ezui/{p-4b988ee7.entry.js → p-ab629244.entry.js} +2 -2
  166. package/dist/ezui/{p-32b4163f.entry.js → p-b041333c.entry.js} +1 -1
  167. package/dist/ezui/p-baf80b13.entry.js +1 -0
  168. package/dist/ezui/p-bc2f844e.entry.js +1 -0
  169. package/dist/ezui/{p-12526044.entry.js → p-c0f1715f.entry.js} +1 -1
  170. package/dist/ezui/{p-83885b21.entry.js → p-cc2dc4f4.entry.js} +1 -1
  171. package/dist/ezui/p-cd0499a2.entry.js +1 -0
  172. package/dist/ezui/p-e52cbcc7.entry.js +1 -0
  173. package/dist/ezui/{p-3e7cc8a4.entry.js → p-eb36f072.entry.js} +1 -1
  174. package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +33 -4
  175. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +0 -15
  176. package/dist/types/components/ez-dropdown/ez-dropdown.d.ts +5 -0
  177. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -1
  178. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
  179. package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +4 -1
  180. package/dist/types/components/ez-search/ez-search.d.ts +100 -10
  181. package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +23 -0
  182. package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +17 -0
  183. package/dist/types/components.d.ts +51 -14
  184. package/dist/types/utils/form/test/DataBinder.test.d.ts +1 -0
  185. package/dist/types/utils/interfaces/AbstractFieldMetadata.d.ts +2 -1
  186. package/dist/types/utils/interfaces/IAction.d.ts +1 -1
  187. package/package.json +12 -5
  188. package/dist/cjs/ez-card-item.cjs.entry.js +0 -52
  189. package/dist/cjs/ez-filter-input_2.cjs.entry.js +0 -137
  190. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridUtils.js +0 -8
  191. package/dist/esm/ez-card-item.entry.js +0 -48
  192. package/dist/esm/ez-filter-input_2.entry.js +0 -132
  193. package/dist/ezui/p-0843df02.entry.js +0 -1
  194. package/dist/ezui/p-47afb974.entry.js +0 -1
  195. package/dist/ezui/p-59bcb27c.entry.js +0 -1
  196. package/dist/ezui/p-74049254.entry.js +0 -1
  197. package/dist/ezui/p-76d16a24.entry.js +0 -1
  198. package/dist/ezui/p-7fd54841.entry.js +0 -1
  199. package/dist/ezui/p-87e85160.entry.js +0 -1
  200. package/dist/ezui/p-a42fe2ce.entry.js +0 -1
  201. package/dist/ezui/p-af285e68.entry.js +0 -1
  202. package/dist/ezui/p-b6867f19.entry.js +0 -1
  203. package/dist/ezui/p-d51aa09b.entry.js +0 -1
  204. package/dist/ezui/p-e8f88361.entry.js +0 -1
  205. package/dist/ezui/p-f8653522.entry.js +0 -1
  206. package/dist/types/components/ez-grid/controller/ag-grid/AgGridUtils.d.ts +0 -1
@@ -4,7 +4,7 @@ export class EzAlertList {
4
4
  constructor() {
5
5
  this.alerts = [];
6
6
  this.enableDragAndDrop = undefined;
7
- this.enableExpand = undefined;
7
+ this.enableExpand = true;
8
8
  this.itemRightSlotBuilder = undefined;
9
9
  this.opened = true;
10
10
  this.expanded = false;
@@ -12,67 +12,129 @@ export class EzAlertList {
12
12
  observeOpened() {
13
13
  this.manageOverlay();
14
14
  }
15
+ /**
16
+ * Retorna o id do alerta a partir do título e do índice.
17
+ */
18
+ alertId(title, index) {
19
+ const concatTitle = (title) => { var _a; return (_a = title === null || title === void 0 ? void 0 : title.split(' ').join('-')) !== null && _a !== void 0 ? _a : ""; };
20
+ return `alert-${index}-${concatTitle(title)}`;
21
+ }
22
+ /**
23
+ * Retorna o título do alerta a partir do id.
24
+ */
25
+ getAlertTitle(id) {
26
+ var _a;
27
+ return (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === id)) === null || _a === void 0 ? void 0 : _a.title;
28
+ }
29
+ /**
30
+ * Retorna o texto do título do alerta.
31
+ */
32
+ getTitleText(item) {
33
+ var _a;
34
+ const title = (_a = this.getAlertTitle(item.id)) !== null && _a !== void 0 ? _a : '';
35
+ return `${title}${(title && item.label) ? ':' : ''}`;
36
+ }
37
+ /**
38
+ * Gerencia a exibição do conteúdo expandido.
39
+ */
40
+ toggleExpandContainer() {
41
+ if (!this.enableExpand) {
42
+ return;
43
+ }
44
+ ;
45
+ this.expanded = !this.expanded;
46
+ this._container.classList.toggle('expanded', this.expanded);
47
+ if (this.expanded) {
48
+ this.updatePosition(this.getBoundingRight(), this.getBoundingBottom());
49
+ }
50
+ else {
51
+ this.updatePosition(`10px`, `10px`);
52
+ }
53
+ }
15
54
  /**
16
55
  * Gerencia a exibição do overlay usando FloatingManager do Core.
17
56
  */
18
- async manageOverlay() {
19
- if (this.opened) {
20
- this._overlayId = FloatingManager.float(this._container, this._overlayRef, {
21
- autoClose: false,
22
- isFixed: !this.enableDragAndDrop,
23
- bottom: '10px',
24
- right: '10px'
25
- });
57
+ manageOverlay() {
58
+ if (this.opened && this._container) {
59
+ this._overlayId = FloatingManager.float(this._container, this._overlayRef, this.getFloatOptions());
26
60
  }
27
61
  else {
62
+ if (this._overlayId === undefined)
63
+ return;
28
64
  FloatingManager.close(this._overlayId);
29
65
  this._overlayId = undefined;
30
66
  }
31
67
  }
32
- componentDidRender() {
33
- this.manageOverlay();
68
+ /**
69
+ * Atualiza a posição da lista.
70
+ */
71
+ updatePosition(right, bottom) {
34
72
  if (this.opened) {
35
- this._container.focus();
73
+ FloatingManager.updateFloatPosition(this._container, this._overlayRef, Object.assign(Object.assign({}, this.getFloatOptions()), { right,
74
+ bottom }));
36
75
  }
37
76
  }
38
- componentWillLoad() {
39
- this.dataElementId = ElementIDUtils.addIDInfo(this._element, 'EzAlertList');
77
+ ;
78
+ /**
79
+ * Retorna valores padrões do componente
80
+ */
81
+ getFloatOptions() {
82
+ return {
83
+ autoClose: false,
84
+ isFixed: true,
85
+ bottom: '10px',
86
+ right: '10px',
87
+ };
40
88
  }
41
- alertId(title, index) {
42
- const concatTitle = (title) => { var _a; return (_a = title === null || title === void 0 ? void 0 : title.split(' ').join('-')) !== null && _a !== void 0 ? _a : ""; };
43
- return `alert-${index}-${concatTitle(title)}`;
89
+ ;
90
+ /**
91
+ * Retorna o valor para o alinhamento horizontal do componente.
92
+ */
93
+ getBoundingRight() {
94
+ const docWidth = document.body.clientWidth;
95
+ const boxWidth = this._container.getBoundingClientRect().width;
96
+ return ((docWidth - boxWidth) / 2) + 'px';
44
97
  }
45
- getAlertTitle(id) {
46
- var _a;
47
- return (_a = this.alerts.find((alert, index) => this.alertId(alert.title, index) === id)) === null || _a === void 0 ? void 0 : _a.title;
98
+ /**
99
+ * Retorna o valor para o alinhamento vertical do componente.
100
+ */
101
+ getBoundingBottom() {
102
+ const docHeight = document.body.clientHeight;
103
+ const boxHeight = this._container.getBoundingClientRect().height;
104
+ return ((docHeight - boxHeight) / 2) + 'px';
48
105
  }
49
- getTitleText(item) {
50
- var _a;
51
- const title = (_a = this.getAlertTitle(item.id)) !== null && _a !== void 0 ? _a : '';
52
- return `${title}${(title && item.label) ? ':' : ''}`;
106
+ componentDidLoad() {
107
+ this.manageOverlay();
108
+ if (this.opened && this._container) {
109
+ this._container.focus();
110
+ }
111
+ }
112
+ componentWillLoad() {
113
+ this.dataElementId = ElementIDUtils.addIDInfo(this._element, 'EzAlertList');
53
114
  }
54
115
  render() {
55
- return (h(Host, Object.assign({}, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: this.dataElementId }), h("div", { ref: elem => (this._overlayRef = elem) }, h("div", { class: "alert-list__container", ref: elem => (this._container = elem) }, h("div", { class: "alert-list__content" }, h("div", { class: "alert-list__header" }, h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), h("div", { class: "alert-list__header__buttons" }, h("ez-button", { mode: "icon", size: "small", iconName: "expand", "data-element-id": ElementIDUtils.getInternalIDInfo('expandButton'), onClick: () => { }, title: this.expanded ? 'Resumir' : 'Expandir' }), h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
56
- this.opened = false;
57
- }, title: 'Fechar' }))), h("div", { class: "alert-list__expandable-content" }, h("ez-list", { hoverFeedback: true, itemLeftSlotBuilder: item => {
58
- return (h("a", { href: "#", style: {
59
- fontFamily: "var(--font-pattern, 'Roboto')",
60
- fontSize: 'var(--text--medium, 14px)',
61
- fontWeight: 'var(--text-weight--medium, 400)',
62
- color: 'var(--color--primary, #008561)',
63
- marginRight: '4px',
64
- cursor: 'pointer',
65
- display: 'flex',
66
- width: 'max-content',
67
- textDecoration: 'none'
68
- } }, this.getTitleText(item)));
69
- }, dataSource: this.alerts.map((alert, index) => {
70
- var _a;
71
- return {
72
- id: this.alertId(alert.title, index),
73
- label: (_a = alert.detail) !== null && _a !== void 0 ? _a : "",
74
- };
75
- }) })))))));
116
+ return (h(Host, Object.assign({}, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: this.dataElementId }), this.opened ?
117
+ (h("div", { ref: elem => (this._overlayRef = elem) }, h("div", { class: `alert-list__container ${this.expanded ? 'expanded' : ''}`, ref: elem => (this._container = elem) }, h("div", { class: "alert-list__content" }, h("div", { class: "alert-list__header" }, h("div", { class: "alert-list__title" }, `Avisos (${this.alerts.length})`), h("div", { class: "alert-list__header__buttons" }, this.enableExpand && (h("ez-button", { mode: "icon", size: "small", iconName: "expand", onClick: () => this.toggleExpandContainer(), "data-element-id": ElementIDUtils.getInternalIDInfo('expandButton'), title: this.expanded ? 'Resumir' : 'Expandir' })), h("ez-button", { mode: "icon", size: "small", iconName: "close", "data-element-id": ElementIDUtils.getInternalIDInfo('closeButton'), onClick: () => {
118
+ this.opened = false;
119
+ }, title: 'Fechar' }))), h("div", { class: "alert-list__expandable-content" }, h("ez-list", { itemSlotBuilder: this.itemRightSlotBuilder, hoverFeedback: true, itemLeftSlotBuilder: item => {
120
+ return (h("a", { href: "#", style: {
121
+ fontFamily: "var(--font-pattern, 'Roboto')",
122
+ fontSize: 'var(--text--medium, 14px)',
123
+ fontWeight: 'var(--text-weight--medium, 400)',
124
+ color: 'var(--color--primary, #008561)',
125
+ marginRight: '4px',
126
+ cursor: 'pointer',
127
+ display: 'flex',
128
+ width: 'max-content',
129
+ textDecoration: 'none'
130
+ } }, this.getTitleText(item)));
131
+ }, dataSource: this.alerts.map((alert, index) => {
132
+ var _a;
133
+ return {
134
+ id: this.alertId(alert.title, index),
135
+ label: (_a = alert.detail) !== null && _a !== void 0 ? _a : "",
136
+ };
137
+ }) })))))) : null));
76
138
  }
77
139
  static get is() { return "ez-alert-list"; }
78
140
  static get encapsulation() { return "shadow"; }
@@ -140,7 +202,8 @@ export class EzAlertList {
140
202
  "text": "Define se o componente pode ser expandido."
141
203
  },
142
204
  "attribute": "enable-expand",
143
- "reflect": true
205
+ "reflect": true,
206
+ "defaultValue": "true"
144
207
  },
145
208
  "itemRightSlotBuilder": {
146
209
  "type": "unknown",
@@ -42,6 +42,9 @@
42
42
  padding: 12px;
43
43
  z-index: 0;
44
44
  position: relative;
45
+ container-type: inline-size;
46
+ container-name: box;
47
+ white-space: pre-line;
45
48
  }
46
49
 
47
50
  .card-item:hover {
@@ -77,17 +80,20 @@
77
80
  }
78
81
 
79
82
  .card-item__details-left {
83
+ white-space: pre-line;
80
84
  cursor: pointer;
81
85
  width: 50%;
82
86
  }
83
87
 
84
88
  .card-item__details-right {
89
+ white-space: pre-line;
85
90
  width: 50%;
86
91
  cursor: pointer;
87
92
  }
88
93
 
89
94
  .card-item__detail:not(:last-child) {
90
95
  cursor: pointer;
96
+ white-space: pre-line;
91
97
 
92
98
  /*public*/
93
99
  padding-bottom: var(--ez-card-item__detail--padding-bottom);
@@ -124,4 +130,33 @@
124
130
  outline: 2px solid var(--ez-card-item__highlight--color);
125
131
  box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color),
126
132
  4px 0px 0px 0px var(--ez-card-item__highlight--color);
133
+ }
134
+
135
+ @container box (max-width: 550px) {
136
+ .card-item__details {
137
+ flex-direction: column;
138
+ }
139
+
140
+ .card-item__details-left {
141
+ width: 100%;
142
+ }
143
+
144
+ .card-item__details-right {
145
+ width: 100%;
146
+ }
147
+ }
148
+
149
+ @container box (max-width: 200px) {
150
+ .card-item__title {
151
+ font-size: 10px;
152
+ }
153
+
154
+ .card-item__detail-label {
155
+ font-size: 10px;
156
+ }
157
+
158
+ .card-item__detail-value {
159
+ font-size: 10px;
160
+ }
161
+
127
162
  }
@@ -1,7 +1,6 @@
1
- import { ElementIDUtils, FloatingManager, ObjectUtils, StringUtils } from "@sankhyalabs/core";
1
+ import { ElementIDUtils, FloatingManager, ObjectUtils } from "@sankhyalabs/core";
2
2
  import { h, Host } from "@stencil/core";
3
- import { ApplicationUtils, CSSVarsUtils } from "../../utils";
4
- import { REQUIRED_INFO } from "../../utils/constants";
3
+ import { CSSVarsUtils } from "../../utils";
5
4
  export class EzComboBox {
6
5
  constructor() {
7
6
  this._changeDeboucingTimeout = null;
@@ -9,7 +8,6 @@ export class EzComboBox {
9
8
  this._maxWidthValue = 0;
10
9
  this._tabPressed = false;
11
10
  this._textEmptyList = "Nenhum resultado encontrado";
12
- this._textEmptySearch = "Nenhum resultado de {0} encontrado";
13
11
  this._lookupMode = false;
14
12
  this._preSelection = undefined;
15
13
  this._visibleOptions = undefined;
@@ -22,7 +20,6 @@ export class EzComboBox {
22
20
  this.enabled = true;
23
21
  this.options = undefined;
24
22
  this.errorMessage = undefined;
25
- this.searchMode = undefined;
26
23
  this.showSelectedValue = false;
27
24
  this.showOptionValue = false;
28
25
  this.suppressSearch = false;
@@ -46,7 +43,7 @@ export class EzComboBox {
46
43
  observeValue(newValue, oldValue) {
47
44
  if (this._textInput && newValue != oldValue) {
48
45
  try {
49
- if (this.searchMode && typeof newValue === "string") {
46
+ if (typeof newValue === "string") {
50
47
  this.setInputValue();
51
48
  return;
52
49
  }
@@ -209,7 +206,7 @@ export class EzComboBox {
209
206
  }
210
207
  updateVisibleOptions() {
211
208
  let opts = this._source || [];
212
- if (!this.searchMode && this._criteria) {
209
+ if (this._criteria) {
213
210
  const upperCriteria = this._criteria.toUpperCase();
214
211
  opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
215
212
  }
@@ -284,7 +281,7 @@ export class EzComboBox {
284
281
  return this._floatingID !== undefined && FloatingManager.isFloating(this._floatingID);
285
282
  }
286
283
  nextOption() {
287
- if (this.searchMode && !this.isOptionsVisible()) {
284
+ if (!this.isOptionsVisible()) {
288
285
  return;
289
286
  }
290
287
  this.showOptions();
@@ -307,9 +304,6 @@ export class EzComboBox {
307
304
  this.selectOption(this._visibleOptions[this._preSelection]);
308
305
  this._preSelection = undefined;
309
306
  }
310
- else {
311
- this.controlListWithOnlyOne();
312
- }
313
307
  }
314
308
  updateSource(source) {
315
309
  this._startLoading = false;
@@ -328,7 +322,6 @@ export class EzComboBox {
328
322
  this.updateVisibleOptions();
329
323
  if (this._tabPressed) {
330
324
  this._tabPressed = false;
331
- this.controlEmptySearch();
332
325
  }
333
326
  }
334
327
  else {
@@ -336,10 +329,6 @@ export class EzComboBox {
336
329
  }
337
330
  }
338
331
  }
339
- clearSource() {
340
- this._source = [];
341
- this.updateVisibleOptions();
342
- }
343
332
  selectOption(newOption) {
344
333
  var _a, _b;
345
334
  const currentValue = this.getSelectedOption(this.value);
@@ -351,10 +340,6 @@ export class EzComboBox {
351
340
  else {
352
341
  this.resetOptions();
353
342
  }
354
- if (this.searchMode) {
355
- this._visibleOptions = [];
356
- this.clearSource();
357
- }
358
343
  }
359
344
  loadOptions(mode, argument = "") {
360
345
  this._criteria = argument;
@@ -373,7 +358,7 @@ export class EzComboBox {
373
358
  }
374
359
  else {
375
360
  window.setTimeout(() => {
376
- this.setInputValue(false);
361
+ this.setInputValue();
377
362
  }, this._deboucingTime);
378
363
  }
379
364
  this.resetOptions();
@@ -390,93 +375,6 @@ export class EzComboBox {
390
375
  clearSearch() {
391
376
  this.value = null;
392
377
  }
393
- controlListWithOnlyOne() {
394
- var _a;
395
- if (this.searchMode) {
396
- const source = (_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.filter((opt) => opt.label !== "" && opt.value != undefined);
397
- if ((source === null || source === void 0 ? void 0 : source.length) === 1) {
398
- this.selectOption(source[0]);
399
- }
400
- }
401
- }
402
- controlEmptySearch() {
403
- var _a;
404
- if (this.searchMode) {
405
- if (!((_a = this._visibleOptions) === null || _a === void 0 ? void 0 : _a.length)) {
406
- this.clearSearch();
407
- ApplicationUtils.info(this._textEmptyList);
408
- }
409
- else {
410
- this.controlListWithOnlyOne();
411
- }
412
- }
413
- }
414
- validateDescriptionValue() {
415
- if (!this.searchMode || StringUtils.isEmpty(this.value)) {
416
- return;
417
- }
418
- let value = this.value;
419
- if (typeof value === "object") {
420
- return;
421
- }
422
- if (StringUtils.isEmpty(value)) {
423
- return;
424
- }
425
- this.loadDescriptionValue(value);
426
- }
427
- async loadDescriptionValue(argument) {
428
- var _a, _b;
429
- if (argument == undefined) {
430
- return;
431
- }
432
- if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
433
- this.loadOptionValue(argument);
434
- return;
435
- }
436
- const searchArgument = {
437
- mode: SearchMode.PREDICTIVE,
438
- argument
439
- };
440
- const source = await ((_b = this.optionLoader) === null || _b === void 0 ? void 0 : _b.call(this, searchArgument));
441
- if (source == undefined) {
442
- return;
443
- }
444
- if (source instanceof Promise) {
445
- source.then((result) => {
446
- this.setDescriptionValue(result);
447
- });
448
- }
449
- else {
450
- this.setDescriptionValue(source);
451
- }
452
- }
453
- setDescriptionValue(source) {
454
- const value = (source === null || source === void 0 ? void 0 : source[0]) || source;
455
- if (value == undefined || !Object.keys(value).length) {
456
- this.showNoResultMessage();
457
- return;
458
- }
459
- this._lookupMode = true;
460
- this.value = value;
461
- }
462
- loadOptionValue(argument) {
463
- var _a;
464
- const source = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === argument);
465
- if (source != undefined) {
466
- this.selectOption(source);
467
- }
468
- else {
469
- this.showNoResultMessage();
470
- }
471
- }
472
- async showNoResultMessage() {
473
- this.clearSearch();
474
- ApplicationUtils.info(this._textEmptySearch.replace("{0}", this.getFieldLabel()));
475
- }
476
- getFieldLabel() {
477
- var _a;
478
- return (_a = this.label) === null || _a === void 0 ? void 0 : _a.replace(REQUIRED_INFO, "").toUpperCase();
479
- }
480
378
  resetOptions() {
481
379
  this.hideOptions();
482
380
  this._criteria = undefined;
@@ -502,12 +400,7 @@ export class EzComboBox {
502
400
  });
503
401
  }
504
402
  }
505
- if (this.searchMode) {
506
- this.updateSource([]);
507
- }
508
- else {
509
- this.loadOptions(SearchMode.PRELOAD);
510
- }
403
+ this.loadOptions(SearchMode.PRELOAD);
511
404
  }
512
405
  componentDidRender() {
513
406
  var _a;
@@ -517,7 +410,6 @@ export class EzComboBox {
517
410
  (_a = this._optionsList) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".item").forEach((elem) => {
518
411
  ElementIDUtils.addIDInfoIfNotExists(elem, "itemComboBox");
519
412
  });
520
- this.validateDescriptionValue();
521
413
  }
522
414
  componentDidLoad() {
523
415
  CSSVarsUtils.applyVarsTextInput(this.el, this._textInput);
@@ -537,13 +429,7 @@ export class EzComboBox {
537
429
  // Event handlers
538
430
  //---------------------------------------------
539
431
  handlerIconClick() {
540
- this.searchMode ? this.loadOptions(SearchMode.ADVANCED) : this.showOptions();
541
- }
542
- buildNumberArgument(argument) {
543
- if (this.isTextSearch) {
544
- return NaN;
545
- }
546
- return Number(argument || undefined);
432
+ this.showOptions();
547
433
  }
548
434
  onTextInputChangeHandler(event) {
549
435
  var _a;
@@ -560,36 +446,12 @@ export class EzComboBox {
560
446
  }
561
447
  this._criteria = argument;
562
448
  if (argument) {
563
- if (this.searchMode) {
564
- this._showLoading = false;
565
- this.clearSource();
566
- const enoughChars = argument.length >= this.limitCharsToSearch;
567
- const argumentNumber = this.buildNumberArgument(argument);
568
- if (enoughChars || !isNaN(argumentNumber)) {
569
- this._showLoading = true;
570
- this._changeDeboucingTimeout = window.setTimeout(() => {
571
- this.loadOptions(SearchMode.PREDICTIVE, isNaN(argumentNumber) ? argument : argumentNumber.toString());
572
- }, this._deboucingTime);
573
- this.showOptions();
574
- }
575
- else {
576
- this.hideOptions();
577
- }
578
- }
579
- else {
580
- this.updateVisibleOptions();
581
- this.showOptions();
582
- }
449
+ this.updateVisibleOptions();
450
+ this.showOptions();
583
451
  }
584
452
  else {
585
453
  this.hideOptions();
586
- if (this.searchMode) {
587
- this._showLoading = false;
588
- this.clearSource();
589
- }
590
- else {
591
- this.updateVisibleOptions();
592
- }
454
+ this.updateVisibleOptions();
593
455
  }
594
456
  }
595
457
  clearDeboucingTimeout() {
@@ -599,9 +461,7 @@ export class EzComboBox {
599
461
  }
600
462
  }
601
463
  onTextInputClickHandler() {
602
- if (!this.searchMode) {
603
- this.showOptions();
604
- }
464
+ this.showOptions();
605
465
  }
606
466
  keyDownHandler(event) {
607
467
  this._tabPressed = false;
@@ -633,7 +493,6 @@ export class EzComboBox {
633
493
  break;
634
494
  case "Tab":
635
495
  this._tabPressed = true;
636
- this.controlListWithOnlyOne();
637
496
  break;
638
497
  }
639
498
  //ATENÇÃO: Existe a necessidade de propagar o evento de teclado.
@@ -650,11 +509,8 @@ export class EzComboBox {
650
509
  return !this._showLoading && this._visibleOptions.length > 0;
651
510
  }
652
511
  render() {
653
- var _a;
654
512
  ElementIDUtils.addIDInfoIfNotExists(this.el, 'input');
655
- return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: this.searchMode ? "leftIcon" : "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: this.searchMode ? "search" : "chevron-down" })), this.searchMode && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) && (this._criteria || this.value)
656
- ? h("button", { class: "btn btn__close", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
657
- : undefined), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
513
+ return (h(Host, null, h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._textInput = elem, "data-slave-mode": "true", enabled: this.enabled && !this.suppressSearch, onInput: event => this.onTextInputChangeHandler(event), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, h("button", { class: "btn", slot: "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, h("ez-icon", { iconName: "chevron-down" }))), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "list-wrapper", ref: elem => this._listWrapper = elem }, h("ul", { class: "list-options", ref: elem => this._optionsList = elem }, !this._showLoading
658
514
  && this._visibleOptions.length === 0
659
515
  && h("div", { class: "message" }, h("span", { class: "message__no-result" }, this._textEmptyList)), this._showLoading
660
516
  && h("div", { class: "message" }, h("div", { class: "message__loading" })), this.showOptionValue
@@ -788,23 +644,6 @@ export class EzComboBox {
788
644
  "attribute": "error-message",
789
645
  "reflect": true
790
646
  },
791
- "searchMode": {
792
- "type": "boolean",
793
- "mutable": false,
794
- "complexType": {
795
- "original": "boolean",
796
- "resolved": "boolean",
797
- "references": {}
798
- },
799
- "required": false,
800
- "optional": false,
801
- "docs": {
802
- "tags": [],
803
- "text": "Se true ativa o modo pesquisa do ez-combo-box."
804
- },
805
- "attribute": "search-mode",
806
- "reflect": false
807
- },
808
647
  "showSelectedValue": {
809
648
  "type": "boolean",
810
649
  "mutable": false,
@@ -100,9 +100,6 @@ export class EzDateInput {
100
100
  this._calendar.hide();
101
101
  }
102
102
  handleBlur() {
103
- if (!this._changePending) {
104
- return;
105
- }
106
103
  try {
107
104
  const strValue = this._textInput.value;
108
105
  const newValue = DateUtils.strToDate(strValue);
@@ -152,9 +152,6 @@ export class EzDateTimeInput {
152
152
  }
153
153
  handleBlur() {
154
154
  var _a, _b;
155
- if (!this._changePending) {
156
- return;
157
- }
158
155
  try {
159
156
  const strValue = ((_b = (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.trim()) || "";
160
157
  const newValue = this.getParsedDateTime();
@@ -16,6 +16,11 @@ export class EzDropdown {
16
16
  this.value = undefined;
17
17
  this.itemBuilder = undefined;
18
18
  }
19
+ handleClickOutside(event) {
20
+ if (!this._element.contains(event.target)) {
21
+ this.ezOutsideClick.emit();
22
+ }
23
+ }
19
24
  //---------------------------------------------
20
25
  // Private methods
21
26
  //---------------------------------------------
@@ -94,13 +99,13 @@ export class EzDropdown {
94
99
  this._itemList[item.id] = {};
95
100
  }
96
101
  }
97
- getContainerItemBuilder(item, level) {
102
+ getContainerItemBuilder(item, level, isLockedLevels, hasIcon, hasChildren) {
98
103
  if (this.itemBuilder == undefined) {
99
104
  return;
100
105
  }
101
106
  const customContent = this.itemBuilder(item, level);
102
107
  if (customContent == undefined) {
103
- return;
108
+ return this.defaultItemBuilder(item, isLockedLevels, hasIcon, hasChildren);
104
109
  }
105
110
  if (typeof customContent !== "string") {
106
111
  return (h("div", { class: "ez-dropdown__item-builder" }, customContent));
@@ -121,7 +126,7 @@ export class EzDropdown {
121
126
  var _a;
122
127
  return (item.type !== "divider"
123
128
  ? h("div", Object.assign({ ref: (ref) => this._itemList[item.id] = ref, class: "ez-dropdown__item", "data-level": level }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(`${item.id}_ezDropdownItem`) }), h("div", { class: "ez-dropdown__item-content", onClick: (evt) => this.onItemClick(evt, item), onMouseOver: (evt) => this.onShowSubmenu(evt, item) }, this.itemBuilder
124
- ? this.getContainerItemBuilder(item, level)
129
+ ? this.getContainerItemBuilder(item, level, isLockedLevels, hasIcon, hasChildren)
125
130
  : this.defaultItemBuilder(item, isLockedLevels, hasIcon, hasChildren)), ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
126
131
  !isLockedLevels &&
127
132
  hasChildren &&
@@ -350,7 +355,31 @@ export class EzDropdown {
350
355
  }
351
356
  }
352
357
  }
358
+ }, {
359
+ "method": "ezOutsideClick",
360
+ "name": "ezOutsideClick",
361
+ "bubbles": true,
362
+ "cancelable": true,
363
+ "composed": true,
364
+ "docs": {
365
+ "tags": [],
366
+ "text": "Emitido quando ocorrer um click fora do componente."
367
+ },
368
+ "complexType": {
369
+ "original": "void",
370
+ "resolved": "void",
371
+ "references": {}
372
+ }
353
373
  }];
354
374
  }
355
375
  static get elementRef() { return "_element"; }
376
+ static get listeners() {
377
+ return [{
378
+ "name": "click",
379
+ "method": "handleClickOutside",
380
+ "target": "document",
381
+ "capture": false,
382
+ "passive": false
383
+ }];
384
+ }
356
385
  }