@sankhyalabs/ezui 7.1.0-dev.2 → 7.1.0-dev.21

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 (225) hide show
  1. package/dist/cjs/{ApplicationUtils-d04f5c94.js → ApplicationUtils-4fb87a9e.js} +1 -1
  2. package/dist/cjs/{app-globals-c128c97e.js → app-globals-cb31a206.js} +1 -1
  3. package/dist/cjs/ez-actions-button.cjs.entry.js +2 -2
  4. package/dist/cjs/ez-alert-list.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-avatar.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
  9. package/dist/cjs/{ez-combo-box-list_4.cjs.entry.js → ez-combo-box-list_5.cjs.entry.js} +150 -3
  10. package/dist/cjs/ez-combo-box.cjs.entry.js +2 -2
  11. package/dist/cjs/ez-date-input.cjs.entry.js +11 -4
  12. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-dialog.cjs.entry.js +2 -2
  14. package/dist/cjs/ez-double-list.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-file-item.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-form-view.cjs.entry.js +15 -7
  17. package/dist/cjs/ez-form.cjs.entry.js +17 -6
  18. package/dist/cjs/ez-grid.cjs.entry.js +12 -5
  19. package/dist/cjs/ez-guide-navigator.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-link-builder_6.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-modal-container.cjs.entry.js +16 -17
  23. package/dist/cjs/ez-modal.cjs.entry.js +2 -2
  24. package/dist/cjs/ez-multi-selection-list.cjs.entry.js +1 -1
  25. package/dist/cjs/ez-number-input.cjs.entry.js +3 -1
  26. package/dist/cjs/ez-pagination.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-popup.cjs.entry.js +20 -8
  28. package/dist/cjs/ez-search-plus.cjs.entry.js +18 -4
  29. package/dist/cjs/ez-search-result-list.cjs.entry.js +1 -1
  30. package/dist/cjs/ez-search.cjs.entry.js +30 -26
  31. package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-skeleton.cjs.entry.js +1 -1
  33. package/dist/cjs/ez-sortable-list.cjs.entry.js +1 -1
  34. package/dist/cjs/ez-spinner.cjs.entry.js +1 -1
  35. package/dist/cjs/ez-split-button.cjs.entry.js +2 -2
  36. package/dist/cjs/ez-split-item.cjs.entry.js +2 -2
  37. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  38. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  39. package/dist/cjs/ez-tooltip.cjs.entry.js +13 -2
  40. package/dist/cjs/ez-tree.cjs.entry.js +155 -8
  41. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  42. package/dist/cjs/ezui.cjs.js +3 -3
  43. package/dist/cjs/filter-column.cjs.entry.js +1 -1
  44. package/dist/cjs/index-a7b0c73d.js +2 -2
  45. package/dist/cjs/{index-00d0166b.js → index-e61642ff.js} +24 -0
  46. package/dist/cjs/loader.cjs.js +3 -3
  47. package/dist/cjs/{purify-47a2f27b.js → purify-b30a5718.js} +41 -12
  48. package/dist/cjs/{search-column-9aa090ec.js → search-column-51e50b59.js} +3 -3
  49. package/dist/collection/collection-manifest.json +1 -0
  50. package/dist/collection/components/ez-chip/ez-chip.css +3 -0
  51. package/dist/collection/components/ez-date-input/ez-date-input.js +28 -3
  52. package/dist/collection/components/ez-dialog/ez-dialog.css +6 -1
  53. package/dist/collection/components/ez-form/ez-form.js +23 -1
  54. package/dist/collection/components/ez-form-view/ez-form-view.js +24 -2
  55. package/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder.js +4 -2
  56. package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
  57. package/dist/collection/components/ez-form-view/fieldbuilder/templates/ImageInput.tpl.js +4 -0
  58. package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +3 -1
  59. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +5 -1
  60. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +3 -0
  61. package/dist/collection/components/ez-image-input/ez-image-input.css +173 -0
  62. package/dist/collection/components/ez-image-input/ez-image-input.js +324 -0
  63. package/dist/collection/components/ez-modal/ez-modal.css +3 -0
  64. package/dist/collection/components/ez-modal-container/ez-modal-container.css +4 -9
  65. package/dist/collection/components/ez-modal-container/ez-modal-container.js +32 -15
  66. package/dist/collection/components/ez-number-input/ez-number-input.js +16 -0
  67. package/dist/collection/components/ez-popup/ez-popup.css +9 -4
  68. package/dist/collection/components/ez-popup/ez-popup.js +24 -7
  69. package/dist/collection/components/ez-search/ez-search.js +41 -19
  70. package/dist/collection/components/ez-search-plus/ez-search-plus.js +16 -2
  71. package/dist/collection/components/ez-split-button/ez-split-button.css +7 -2
  72. package/dist/collection/components/ez-text-input/ez-text-input.css +3 -3
  73. package/dist/collection/components/ez-tooltip/ez-tooltip.js +13 -2
  74. package/dist/collection/components/ez-tree/ez-tree.css +4 -0
  75. package/dist/collection/components/ez-tree/ez-tree.js +185 -6
  76. package/dist/collection/components/ez-tree/subcomponents/TreeItem.js +4 -1
  77. package/dist/collection/components/ez-tree/types/Node.js +7 -0
  78. package/dist/collection/components/ez-tree/types/Tree.js +19 -0
  79. package/dist/collection/components/ez-tree/types/UpdateItemConfig.js +1 -0
  80. package/dist/collection/utils/form/DataBinder.js +1 -1
  81. package/dist/collection/utils/form/FormMetadata.js +12 -2
  82. package/dist/collection/utils/i18n/locales/en-us.js +8 -0
  83. package/dist/collection/utils/i18n/locales/es-es.js +8 -0
  84. package/dist/collection/utils/i18n/locales/pt-br.js +8 -0
  85. package/dist/custom-elements/index.d.ts +6 -0
  86. package/dist/custom-elements/index.js +530 -105
  87. package/dist/esm/{ApplicationUtils-12768f5a.js → ApplicationUtils-985c24ae.js} +1 -1
  88. package/dist/esm/{app-globals-9507c20e.js → app-globals-75f8a758.js} +1 -1
  89. package/dist/esm/ez-actions-button.entry.js +2 -2
  90. package/dist/esm/ez-alert-list.entry.js +1 -1
  91. package/dist/esm/ez-avatar.entry.js +1 -1
  92. package/dist/esm/ez-calendar.entry.js +1 -1
  93. package/dist/esm/ez-chip.entry.js +1 -1
  94. package/dist/esm/ez-collapsible-box.entry.js +2 -2
  95. package/dist/esm/{ez-combo-box-list_4.entry.js → ez-combo-box-list_5.entry.js} +150 -4
  96. package/dist/esm/ez-combo-box.entry.js +2 -2
  97. package/dist/esm/ez-date-input.entry.js +11 -4
  98. package/dist/esm/ez-date-time-input.entry.js +1 -1
  99. package/dist/esm/ez-dialog.entry.js +2 -2
  100. package/dist/esm/ez-double-list.entry.js +1 -1
  101. package/dist/esm/ez-file-item.entry.js +1 -1
  102. package/dist/esm/ez-form-view.entry.js +15 -7
  103. package/dist/esm/ez-form.entry.js +17 -6
  104. package/dist/esm/ez-grid.entry.js +12 -5
  105. package/dist/esm/ez-guide-navigator.entry.js +1 -1
  106. package/dist/esm/ez-link-builder_6.entry.js +1 -1
  107. package/dist/esm/ez-list.entry.js +1 -1
  108. package/dist/esm/ez-modal-container.entry.js +16 -17
  109. package/dist/esm/ez-modal.entry.js +2 -2
  110. package/dist/esm/ez-multi-selection-list.entry.js +1 -1
  111. package/dist/esm/ez-number-input.entry.js +3 -1
  112. package/dist/esm/ez-pagination.entry.js +1 -1
  113. package/dist/esm/ez-popup.entry.js +20 -8
  114. package/dist/esm/ez-search-plus.entry.js +18 -4
  115. package/dist/esm/ez-search-result-list.entry.js +1 -1
  116. package/dist/esm/ez-search.entry.js +25 -21
  117. package/dist/esm/ez-sidebar-navigator.entry.js +1 -1
  118. package/dist/esm/ez-skeleton.entry.js +1 -1
  119. package/dist/esm/ez-sortable-list.entry.js +1 -1
  120. package/dist/esm/ez-spinner.entry.js +1 -1
  121. package/dist/esm/ez-split-button.entry.js +2 -2
  122. package/dist/esm/ez-split-item.entry.js +2 -2
  123. package/dist/esm/ez-text-input.entry.js +1 -1
  124. package/dist/esm/ez-time-input.entry.js +1 -1
  125. package/dist/esm/ez-tooltip.entry.js +13 -2
  126. package/dist/esm/ez-tree.entry.js +155 -8
  127. package/dist/esm/ez-upload.entry.js +2 -2
  128. package/dist/esm/ezui.js +3 -3
  129. package/dist/esm/filter-column.entry.js +1 -1
  130. package/dist/esm/{index-62fc771e.js → index-a3b24b5d.js} +24 -0
  131. package/dist/esm/index-baa5e267.js +2 -2
  132. package/dist/esm/loader.js +3 -3
  133. package/dist/esm/{purify-dc6814bf.js → purify-9357603c.js} +41 -12
  134. package/dist/esm/{search-column-83562552.js → search-column-0c42248b.js} +3 -3
  135. package/dist/ezui/ezui.esm.js +1 -1
  136. package/dist/ezui/{p-e882635e.entry.js → p-0aafbc30.entry.js} +1 -1
  137. package/dist/ezui/{p-0c0eb410.entry.js → p-0e325699.entry.js} +1 -1
  138. package/dist/ezui/{p-5a11cf56.js → p-0ec5c128.js} +1 -1
  139. package/dist/ezui/p-1bf40959.entry.js +1 -0
  140. package/dist/ezui/p-1c3f43e8.entry.js +1 -0
  141. package/dist/ezui/{p-1cde96f9.entry.js → p-2676e2a3.entry.js} +1 -1
  142. package/dist/ezui/{p-e27d7dc2.entry.js → p-28af6826.entry.js} +1 -1
  143. package/dist/ezui/{p-1adf7139.entry.js → p-2b23906a.entry.js} +1 -1
  144. package/dist/ezui/{p-1730ee24.entry.js → p-2e5de2a7.entry.js} +1 -1
  145. package/dist/ezui/{p-5ab08b60.entry.js → p-2fd16ff2.entry.js} +1 -1
  146. package/dist/ezui/{p-d66bf34e.entry.js → p-3d71e8e1.entry.js} +2 -2
  147. package/dist/ezui/{p-6f119d5f.entry.js → p-3fcf79c7.entry.js} +1 -1
  148. package/dist/ezui/p-474076b3.js +1 -0
  149. package/dist/ezui/{p-a401041c.entry.js → p-47d9256e.entry.js} +1 -1
  150. package/dist/ezui/{p-124699e0.entry.js → p-4ea5c8a7.entry.js} +1 -1
  151. package/dist/ezui/p-582c3f90.entry.js +1 -0
  152. package/dist/ezui/{p-6a9a20a0.entry.js → p-5e6de2c1.entry.js} +1 -1
  153. package/dist/ezui/{p-2a70f094.entry.js → p-6570ca10.entry.js} +1 -1
  154. package/dist/ezui/{p-e99cbb51.entry.js → p-67f9fadb.entry.js} +1 -1
  155. package/dist/ezui/p-6a982147.js +1 -0
  156. package/dist/ezui/p-6c484770.entry.js +1 -0
  157. package/dist/ezui/{p-1266fe78.entry.js → p-6d7f2fdc.entry.js} +1 -1
  158. package/dist/ezui/p-6f466aec.entry.js +1 -0
  159. package/dist/ezui/{p-3fe05d6b.entry.js → p-714452c7.entry.js} +1 -1
  160. package/dist/ezui/{p-957d08cd.entry.js → p-7624767b.entry.js} +1 -1
  161. package/dist/ezui/p-782fe2e3.entry.js +1 -0
  162. package/dist/ezui/p-8709c4f6.entry.js +1 -0
  163. package/dist/ezui/{p-8dc267ff.entry.js → p-8a8006e6.entry.js} +1 -1
  164. package/dist/ezui/{p-0e49c0ff.entry.js → p-8d626d2b.entry.js} +1 -1
  165. package/dist/ezui/{p-79277e43.entry.js → p-9568a93d.entry.js} +1 -1
  166. package/dist/ezui/p-9771ea3c.entry.js +1 -0
  167. package/dist/ezui/p-98218fbc.js +1 -0
  168. package/dist/ezui/p-9d004e22.entry.js +1 -0
  169. package/dist/ezui/{p-eee3c7ff.entry.js → p-a13e65a4.entry.js} +1 -1
  170. package/dist/ezui/{p-e8c6c973.entry.js → p-a1a63294.entry.js} +1 -1
  171. package/dist/ezui/p-c711900a.entry.js +1 -0
  172. package/dist/ezui/p-cfa26133.entry.js +1 -0
  173. package/dist/ezui/{p-a7eab406.entry.js → p-dc192d01.entry.js} +1 -1
  174. package/dist/ezui/p-dff9862b.js +3 -0
  175. package/dist/ezui/{p-59a98e31.entry.js → p-e2e0dd76.entry.js} +1 -1
  176. package/dist/ezui/{p-2ba2d792.entry.js → p-e4a579f2.entry.js} +1 -1
  177. package/dist/ezui/{p-59092a66.entry.js → p-e82a12c6.entry.js} +1 -1
  178. package/dist/ezui/p-f1bbf23f.entry.js +1 -0
  179. package/dist/ezui/p-f34ec732.entry.js +1 -0
  180. package/dist/ezui/p-f45ddc1f.entry.js +1 -0
  181. package/dist/types/components/ez-date-input/ez-date-input.d.ts +5 -1
  182. package/dist/types/components/ez-form/ez-form.d.ts +5 -0
  183. package/dist/types/components/ez-form-view/ez-form-view.d.ts +4 -0
  184. package/dist/types/components/ez-form-view/fieldbuilder/FieldBuilder.d.ts +3 -1
  185. package/dist/types/components/ez-form-view/fieldbuilder/templates/ImageInput.tpl.d.ts +2 -0
  186. package/dist/types/components/ez-image-input/ez-image-input.d.ts +42 -0
  187. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +6 -2
  188. package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
  189. package/dist/types/components/ez-popup/ez-popup.d.ts +3 -0
  190. package/dist/types/components/ez-search/ez-search.d.ts +5 -6
  191. package/dist/types/components/ez-search-plus/ez-search-plus.d.ts +1 -0
  192. package/dist/types/components/ez-tooltip/ez-tooltip.d.ts +3 -0
  193. package/dist/types/components/ez-tree/ez-tree.d.ts +20 -1
  194. package/dist/types/components/ez-tree/types/Node.d.ts +1 -0
  195. package/dist/types/components/ez-tree/types/Tree.d.ts +1 -0
  196. package/dist/types/components/ez-tree/types/UpdateItemConfig.d.ts +4 -0
  197. package/dist/types/components.d.ts +140 -1
  198. package/dist/types/utils/form/interfaces/IFormSheetMetadata.d.ts +1 -0
  199. package/dist/types/utils/form/interfaces/ITabConfig.d.ts +1 -0
  200. package/dist/types/utils/i18n/locales/en-us.d.ts +8 -0
  201. package/dist/types/utils/i18n/locales/es-es.d.ts +8 -0
  202. package/dist/types/utils/i18n/locales/pt-br.d.ts +8 -0
  203. package/dist/types/utils/i18n/translations.d.ts +24 -0
  204. package/package.json +1 -1
  205. package/react/components.d.ts +1 -0
  206. package/react/components.js +1 -0
  207. package/react/components.js.map +1 -1
  208. package/dist/ezui/p-02f6e3b0.entry.js +0 -1
  209. package/dist/ezui/p-0b333f09.entry.js +0 -1
  210. package/dist/ezui/p-14807f4e.js +0 -1
  211. package/dist/ezui/p-191cfbc8.entry.js +0 -1
  212. package/dist/ezui/p-1bfef8e5.entry.js +0 -1
  213. package/dist/ezui/p-228a4d2f.js +0 -3
  214. package/dist/ezui/p-2df50161.entry.js +0 -1
  215. package/dist/ezui/p-4e1df756.entry.js +0 -1
  216. package/dist/ezui/p-623161e2.js +0 -1
  217. package/dist/ezui/p-641ee538.js +0 -1
  218. package/dist/ezui/p-7f8c1fce.entry.js +0 -1
  219. package/dist/ezui/p-8bb3aeb0.entry.js +0 -1
  220. package/dist/ezui/p-ba7e908a.entry.js +0 -1
  221. package/dist/ezui/p-bd6146c5.entry.js +0 -1
  222. package/dist/ezui/p-c943f7c4.entry.js +0 -1
  223. package/dist/ezui/p-d0e6911e.entry.js +0 -1
  224. package/dist/ezui/p-e46a4d06.entry.js +0 -1
  225. package/dist/ezui/p-f958dcb1.entry.js +0 -1
@@ -0,0 +1,324 @@
1
+ import { Host, h } from '@stencil/core';
2
+ import { ElementIDUtils } from '@sankhyalabs/core';
3
+ import initI18n from '../../utils/i18n';
4
+ export class EzImageInput {
5
+ constructor() {
6
+ this.handleFileSelect = (event) => {
7
+ const input = event.target;
8
+ if (input.files && input.files[0]) {
9
+ this.processFile(input.files[0]);
10
+ }
11
+ };
12
+ this.handleDrop = (event) => {
13
+ var _a;
14
+ event.preventDefault();
15
+ event.stopPropagation();
16
+ this._isDragging = false;
17
+ if (!this.enabled)
18
+ return;
19
+ const files = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files;
20
+ if (files && files[0]) {
21
+ this.processFile(files[0]);
22
+ }
23
+ };
24
+ this.handleDragOver = (event) => {
25
+ event.preventDefault();
26
+ event.stopPropagation();
27
+ if (this.enabled) {
28
+ this._isDragging = true;
29
+ }
30
+ };
31
+ this.handleDragLeave = (event) => {
32
+ event.preventDefault();
33
+ event.stopPropagation();
34
+ this._isDragging = false;
35
+ };
36
+ this.handleRemoveImage = (event) => {
37
+ event.stopPropagation();
38
+ this.value = undefined;
39
+ this._hasImage = false;
40
+ if (this._inputElem) {
41
+ this._inputElem.value = '';
42
+ }
43
+ this.ezChange.emit('');
44
+ };
45
+ this.handleClickDropZone = () => {
46
+ var _a;
47
+ if (this.enabled && !this._hasImage) {
48
+ (_a = this._inputElem) === null || _a === void 0 ? void 0 : _a.click();
49
+ }
50
+ };
51
+ this.handleImageClick = (event) => {
52
+ event.stopPropagation();
53
+ if (this._hasImage && this.value) {
54
+ this._showImagePopup = true;
55
+ }
56
+ };
57
+ this.handlePopupAction = (event) => {
58
+ const action = event.detail;
59
+ if (action === 'CANCEL' || action === 'OK') {
60
+ this.handleClosePopup();
61
+ }
62
+ };
63
+ this.handleClosePopup = () => {
64
+ this._showImagePopup = false;
65
+ };
66
+ this.enabled = true;
67
+ this.label = undefined;
68
+ this.name = undefined;
69
+ this.value = undefined;
70
+ this.maxFileSize = 20 * 1024 * 1024;
71
+ this.accept = 'image/*';
72
+ this.loading = false;
73
+ this._hasImage = false;
74
+ this._isDragging = false;
75
+ this._showImagePopup = false;
76
+ }
77
+ onValueChange(newValue, oldValue) {
78
+ if (newValue !== oldValue) {
79
+ this._hasImage = !!newValue;
80
+ }
81
+ if (!newValue && this._inputElem) {
82
+ this._inputElem.value = '';
83
+ }
84
+ }
85
+ addInfoId() {
86
+ if (this._element) {
87
+ ElementIDUtils.addIDInfo(this._element);
88
+ }
89
+ if (this._inputElem) {
90
+ const dataInfo = { id: 'embedded' };
91
+ ElementIDUtils.addIDInfo(this._inputElem, 'image-input', dataInfo);
92
+ }
93
+ }
94
+ processFile(file) {
95
+ // Validar tipo de arquivo
96
+ if (!file.type.startsWith('image/')) {
97
+ const errorMsg = this.i18n('ez-image-input.invalidFileType');
98
+ this.ezError.emit(errorMsg);
99
+ return;
100
+ }
101
+ // Validar tamanho do arquivo
102
+ if (this.maxFileSize && file.size > this.maxFileSize) {
103
+ const maxSizeMB = (this.maxFileSize / (1024 * 1024)).toFixed(2);
104
+ const errorMsg = this.i18n('ez-image-input.fileTooLarge', { maxSize: `${maxSizeMB}MB` });
105
+ this.ezError.emit(errorMsg);
106
+ return;
107
+ }
108
+ // Converter para base64
109
+ const reader = new FileReader();
110
+ reader.onload = (e) => {
111
+ var _a;
112
+ const base64 = (_a = e.target) === null || _a === void 0 ? void 0 : _a.result;
113
+ this.value = base64;
114
+ this._hasImage = true;
115
+ this.ezChange.emit(base64);
116
+ };
117
+ reader.readAsDataURL(file);
118
+ }
119
+ async componentWillLoad() {
120
+ this.i18n = await initI18n();
121
+ this._hasImage = !!this.value;
122
+ }
123
+ componentDidLoad() {
124
+ this.addInfoId();
125
+ }
126
+ render() {
127
+ if (this.loading) {
128
+ return (h(Host, null, h("ez-skeleton", { width: "280px", height: '200px' })));
129
+ }
130
+ const dropZoneLabel = this.label || this.i18n('ez-image-input.defaultLabel');
131
+ return (h(Host, null, h("div", { class: {
132
+ 'image-input__container': true,
133
+ 'image-input__container--disabled': !this.enabled,
134
+ 'image-input__container--dragging': this._isDragging,
135
+ 'image-input__container--has-image': this._hasImage
136
+ }, "data-enabled": this.enabled.toString(), "data-has-image": this._hasImage.toString(), onClick: this.handleClickDropZone, onDrop: this.handleDrop, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, role: "button", "aria-label": dropZoneLabel, tabindex: this.enabled ? 0 : -1 }, h("input", { ref: (el) => (this._inputElem = el), type: "file", accept: this.accept, name: this.name, disabled: !this.enabled, onChange: this.handleFileSelect, class: "image-input__file-input", "aria-hidden": "true" }), this._hasImage && this.value ? (h("div", { class: "image-input__preview" }, h("img", { src: this.value, alt: this.i18n('ez-image-input.imageAlt'), class: "image-input__image", onClick: this.handleImageClick }), this.enabled && (h("ez-button", { class: "image-input__remove-button", variant: "primary", type: "button", mode: "icon", size: "small", iconName: "trash-alt", onClick: this.handleRemoveImage, "aria-label": this.i18n('ez-image-input.removeImage'), title: this.i18n('ez-image-input.removeImage') })))) : (h("div", { class: "image-input__dropzone" }, h("ez-icon", { iconName: "image", size: "x-large" }), h("span", { class: "image-input__label" }, dropZoneLabel)))), h("ez-popup", { opened: this._showImagePopup, ezTitle: this.i18n('ez-image-input.imagePreview'), size: "large", heightMode: "auto", onEzPopupAction: this.handlePopupAction, onEzClosePopup: this.handleClosePopup }, h("div", { class: "image-input__popup-content" }, h("img", { src: this.value, alt: this.i18n('ez-image-input.imageAlt'), class: "image-input__popup-image" })))));
137
+ }
138
+ static get is() { return "ez-image-input"; }
139
+ static get encapsulation() { return "shadow"; }
140
+ static get originalStyleUrls() {
141
+ return {
142
+ "$": ["ez-image-input.css"]
143
+ };
144
+ }
145
+ static get styleUrls() {
146
+ return {
147
+ "$": ["ez-image-input.css"]
148
+ };
149
+ }
150
+ static get properties() {
151
+ return {
152
+ "enabled": {
153
+ "type": "boolean",
154
+ "mutable": false,
155
+ "complexType": {
156
+ "original": "boolean",
157
+ "resolved": "boolean",
158
+ "references": {}
159
+ },
160
+ "required": false,
161
+ "optional": true,
162
+ "docs": {
163
+ "tags": [],
164
+ "text": "Define se o componente est\u00E1 habilitado"
165
+ },
166
+ "attribute": "enabled",
167
+ "reflect": false,
168
+ "defaultValue": "true"
169
+ },
170
+ "label": {
171
+ "type": "string",
172
+ "mutable": false,
173
+ "complexType": {
174
+ "original": "string",
175
+ "resolved": "string",
176
+ "references": {}
177
+ },
178
+ "required": false,
179
+ "optional": true,
180
+ "docs": {
181
+ "tags": [],
182
+ "text": "Label exibido na \u00E1rea de upload"
183
+ },
184
+ "attribute": "label",
185
+ "reflect": false
186
+ },
187
+ "name": {
188
+ "type": "string",
189
+ "mutable": false,
190
+ "complexType": {
191
+ "original": "string",
192
+ "resolved": "string",
193
+ "references": {}
194
+ },
195
+ "required": false,
196
+ "optional": true,
197
+ "docs": {
198
+ "tags": [],
199
+ "text": "Nome do componente"
200
+ },
201
+ "attribute": "name",
202
+ "reflect": false
203
+ },
204
+ "value": {
205
+ "type": "string",
206
+ "mutable": true,
207
+ "complexType": {
208
+ "original": "string",
209
+ "resolved": "string",
210
+ "references": {}
211
+ },
212
+ "required": false,
213
+ "optional": true,
214
+ "docs": {
215
+ "tags": [],
216
+ "text": "Valor da imagem em base64"
217
+ },
218
+ "attribute": "value",
219
+ "reflect": false
220
+ },
221
+ "maxFileSize": {
222
+ "type": "number",
223
+ "mutable": false,
224
+ "complexType": {
225
+ "original": "number",
226
+ "resolved": "number",
227
+ "references": {}
228
+ },
229
+ "required": false,
230
+ "optional": true,
231
+ "docs": {
232
+ "tags": [],
233
+ "text": "Define o tamanho m\u00E1ximo do arquivo em bytes (padr\u00E3o: 20MB)"
234
+ },
235
+ "attribute": "max-file-size",
236
+ "reflect": false,
237
+ "defaultValue": "20 * 1024 * 1024"
238
+ },
239
+ "accept": {
240
+ "type": "string",
241
+ "mutable": false,
242
+ "complexType": {
243
+ "original": "string",
244
+ "resolved": "string",
245
+ "references": {}
246
+ },
247
+ "required": false,
248
+ "optional": true,
249
+ "docs": {
250
+ "tags": [],
251
+ "text": "Tipos de arquivo aceitos"
252
+ },
253
+ "attribute": "accept",
254
+ "reflect": false,
255
+ "defaultValue": "'image/*'"
256
+ },
257
+ "loading": {
258
+ "type": "boolean",
259
+ "mutable": false,
260
+ "complexType": {
261
+ "original": "boolean",
262
+ "resolved": "boolean",
263
+ "references": {}
264
+ },
265
+ "required": false,
266
+ "optional": true,
267
+ "docs": {
268
+ "tags": [],
269
+ "text": "Define se o componente est\u00E1 em estado de carregamento"
270
+ },
271
+ "attribute": "loading",
272
+ "reflect": false,
273
+ "defaultValue": "false"
274
+ }
275
+ };
276
+ }
277
+ static get states() {
278
+ return {
279
+ "_hasImage": {},
280
+ "_isDragging": {},
281
+ "_showImagePopup": {}
282
+ };
283
+ }
284
+ static get events() {
285
+ return [{
286
+ "method": "ezChange",
287
+ "name": "ezChange",
288
+ "bubbles": true,
289
+ "cancelable": true,
290
+ "composed": true,
291
+ "docs": {
292
+ "tags": [],
293
+ "text": "Evento disparado quando uma imagem \u00E9 selecionada"
294
+ },
295
+ "complexType": {
296
+ "original": "string",
297
+ "resolved": "string",
298
+ "references": {}
299
+ }
300
+ }, {
301
+ "method": "ezError",
302
+ "name": "ezError",
303
+ "bubbles": true,
304
+ "cancelable": true,
305
+ "composed": true,
306
+ "docs": {
307
+ "tags": [],
308
+ "text": "Evento disparado quando ocorre um erro"
309
+ },
310
+ "complexType": {
311
+ "original": "string",
312
+ "resolved": "string",
313
+ "references": {}
314
+ }
315
+ }];
316
+ }
317
+ static get elementRef() { return "_element"; }
318
+ static get watchers() {
319
+ return [{
320
+ "propName": "value",
321
+ "methodName": "onValueChange"
322
+ }];
323
+ }
324
+ }
@@ -6,6 +6,8 @@
6
6
  /*@doc Define o padding entre o conteúdo e o modal */
7
7
  --ez-modal-content-padding: 24px;
8
8
  display: block;
9
+ /*@doc Define a largura mínima do conteúdo do modal */
10
+ --ez-modal-content-min-width: auto;
9
11
  }
10
12
 
11
13
  .modal {
@@ -73,6 +75,7 @@
73
75
  flex-wrap: wrap;
74
76
  box-sizing: border-box;
75
77
  max-height: 100%;
78
+ min-width: var(--ez-modal-content-min-width);
76
79
  height: 100%;
77
80
  overflow-y: auto;
78
81
  background-color: rgb(255, 255, 255);
@@ -1,8 +1,8 @@
1
1
  :host {
2
2
  --ez-modal-container-overflow-y: auto;
3
3
  --ez-modal-container-overflow-x: hidden;
4
- display: grid;
5
- grid-template-rows: 0 auto 1fr auto 0;
4
+ display: flex;
5
+ flex-direction: column;
6
6
  width: 100%;
7
7
  height: 100%;
8
8
  }
@@ -23,6 +23,7 @@
23
23
  overflow-y: var(--ez-modal-container-overflow-y);
24
24
  overflow-x: var(--ez-modal-container-overflow-x);
25
25
  outline: none;
26
+ flex: 1 1 auto;
26
27
  }
27
28
 
28
29
  .ez-modal-container__content::-webkit-scrollbar {
@@ -35,7 +36,7 @@
35
36
  display: flex;
36
37
  flex-direction: row;
37
38
  justify-content: flex-end;
38
- gap: var(--space--medium);
39
+ gap: var(--space--8, 8px);
39
40
  width: 100%;
40
41
  padding-top: var(--space--small, 6px);
41
42
  }
@@ -55,9 +56,3 @@
55
56
  .ez-modal-container__close-icon {
56
57
  --icon--color: var(--title--primary, #2B3A54)
57
58
  }
58
-
59
- .ez-modal-container__focus-ctrl {
60
- height: 0px;
61
- background-color: transparent;
62
- border: none;
63
- }
@@ -13,6 +13,7 @@ export class EzModalContainer {
13
13
  this.cancelButtonStatus = undefined;
14
14
  this.okButtonStatus = undefined;
15
15
  this.showCloseButton = true;
16
+ this.autoFocus = false;
16
17
  }
17
18
  async handleEzModalAction(event) {
18
19
  var _a;
@@ -26,18 +27,25 @@ export class EzModalContainer {
26
27
  okIsVisible() {
27
28
  return (this.okButtonStatus !== ModalButtonStatus.HIDDEN && this.okButtonLabel != undefined);
28
29
  }
30
+ emitOkAction() {
31
+ this.ezModalAction.emit(ModalAction.OK);
32
+ }
29
33
  async componentWillLoad() {
30
34
  this.i18n = await initI18n();
31
35
  }
36
+ connectedCallback() {
37
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element })
38
+ .bind("Enter", () => this.emitOkAction())
39
+ .bind("Escape", () => this.closeModal())
40
+ .bind("Esc", () => this.closeModal());
41
+ }
32
42
  componentDidLoad() {
33
43
  window.requestAnimationFrame(() => {
34
44
  this.ezModalAction.emit(ModalAction.LOAD);
35
- this._modalRef.focus();
45
+ if (this.autoFocus) {
46
+ this._modalRef.focus();
47
+ }
36
48
  });
37
- this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element })
38
- .bind("Enter", this.ezModalAction.emit.bind(ModalAction.OK))
39
- .bind("Escape", () => this.closeModal())
40
- .bind("Esc", () => this.closeModal());
41
49
  }
42
50
  disconnectedCallback() {
43
51
  var _a;
@@ -46,17 +54,8 @@ export class EzModalContainer {
46
54
  closeModal() {
47
55
  this.ezModalAction.emit("CLOSE");
48
56
  }
49
- focusLast() {
50
- if (this._okButton == undefined) {
51
- return;
52
- }
53
- this._okButton.setFocus();
54
- }
55
- focusFirst() {
56
- this._closeButton.focus();
57
- }
58
57
  render() {
59
- return (h(Host, null, h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusLast() }), h("div", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE), "aria-label": this.i18n("app.close") }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("div", { tabIndex: -1, class: "ez-modal-container__content" }, h("slot", null)), h("div", { tabIndex: -1, class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel || this.i18n("app.cancel"), enabled: this.cancelButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel || this.i18n("app.ok"), enabled: this.okButtonStatus !== ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.OK) }))), h("button", { class: "ez-modal-container__focus-ctrl", onFocusin: () => this.focusFirst() })));
58
+ return (h(Host, null, h("header", { ref: ref => this._modalRef = ref, tabIndex: -1, class: "ez-modal-container__header-container" }, this.showTitleBar && (h("div", { class: "ez-modal-container__header ez-margin-bottom--medium" }, h("div", { class: "ez-col ez-align--middle ez-modal-container__title" }, h("h2", { class: "ez-text ez-title--large ez-title--primary ez-text--bold ez-margin-vertical--extra-small" }, this.modalTitle), this.modalSubTitle && (h("div", { class: "ez-text ez-text--medium ez-text--primary ez-margin-vertical--extra-small" }, this.modalSubTitle))), (this.showCloseButton && h("button", { ref: ref => this._closeButton = ref, class: "ez-modal-container__close-button", onClick: () => this.ezModalAction.emit(ModalAction.CLOSE), "aria-label": this.i18n("app.close") }, h("ez-icon", { class: "ez-modal-container__close-icon", size: "medium", iconName: "close" })))))), h("main", { tabIndex: -1, class: "ez-modal-container__content" }, h("slot", null)), h("footer", { tabIndex: -1, class: "ez-modal-container__footer" }, this.cancelIsVisible() && (h("ez-button", { label: this.cancelButtonLabel || this.i18n("app.cancel"), isDisabled: this.cancelButtonStatus === ModalButtonStatus.DISABLED, onClick: () => this.ezModalAction.emit(ModalAction.CANCEL) })), this.okIsVisible() && (h("ez-button", { ref: ref => this._okButton = ref, class: "ez-button--primary", label: this.okButtonLabel || this.i18n("app.ok"), isDisabled: this.okButtonStatus === ModalButtonStatus.DISABLED, onClick: () => this.emitOkAction() })))));
60
59
  }
61
60
  static get is() { return "ez-modal-container"; }
62
61
  static get encapsulation() { return "scoped"; }
@@ -209,6 +208,24 @@ export class EzModalContainer {
209
208
  "attribute": "show-close-button",
210
209
  "reflect": false,
211
210
  "defaultValue": "true"
211
+ },
212
+ "autoFocus": {
213
+ "type": "boolean",
214
+ "mutable": false,
215
+ "complexType": {
216
+ "original": "boolean",
217
+ "resolved": "boolean",
218
+ "references": {}
219
+ },
220
+ "required": false,
221
+ "optional": true,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": "Se true o modal container receber\u00E1 o foco ao ser renderizado."
225
+ },
226
+ "attribute": "auto-focus",
227
+ "reflect": false,
228
+ "defaultValue": "false"
212
229
  }
213
230
  };
214
231
  }
@@ -149,6 +149,7 @@ export class EzNumberInput {
149
149
  if (parsedNumber !== this.value) {
150
150
  this._focused = true;
151
151
  this._changePending = true;
152
+ this.ezInput.emit(parsedNumber);
152
153
  this.ezStartChange.emit({ waitmessage: "", blocking: false });
153
154
  }
154
155
  }
@@ -446,6 +447,21 @@ export class EzNumberInput {
446
447
  "resolved": "void",
447
448
  "references": {}
448
449
  }
450
+ }, {
451
+ "method": "ezInput",
452
+ "name": "ezInput",
453
+ "bubbles": true,
454
+ "cancelable": true,
455
+ "composed": true,
456
+ "docs": {
457
+ "tags": [],
458
+ "text": "Emitido quando o usu\u00E1rio digita no campo."
459
+ },
460
+ "complexType": {
461
+ "original": "number",
462
+ "resolved": "number",
463
+ "references": {}
464
+ }
449
465
  }];
450
466
  }
451
467
  static get methods() {
@@ -38,7 +38,7 @@
38
38
  }
39
39
 
40
40
  .popup__container {
41
- width: 100%;
41
+ width: auto;
42
42
  max-height: 90%;
43
43
  height: 100%;
44
44
  display: flex;
@@ -54,7 +54,6 @@
54
54
  margin: 0;
55
55
  border: none;
56
56
  position: unset;
57
- gap: var(--space--16, 16px);
58
57
  }
59
58
 
60
59
  .popup__container--auto {
@@ -72,20 +71,21 @@
72
71
  }
73
72
 
74
73
  .popup__expandable-content {
74
+ flex-grow: 1;
75
75
  box-sizing: border-box;
76
76
  width: 100%;
77
- flex: 1;
78
77
  font-family: var(--font--pattern, "Roboto");
79
78
  font-size: var(--font-size--default, 14px);
80
79
  color: var(--title--primary, #00281D);
81
80
  font-weight: var(--font-weight--regular, 400);
82
- line-height: var(--line-height--24, 24px);
83
81
  }
84
82
 
85
83
  .popup__header {
84
+ flex-shrink: 0;
86
85
  width: 100%;
87
86
  display: flex;
88
87
  align-items: center;
88
+ margin-bottom: var(--space--16, 16px);
89
89
  }
90
90
 
91
91
  .popup__title {
@@ -115,12 +115,17 @@
115
115
  }
116
116
 
117
117
  .popup__footer {
118
+ flex-shrink: 0;
118
119
  display: flex;
119
120
  width: 100%;
120
121
  flex-direction: row-reverse;
121
122
  gap: var(--space--8, 8px);
122
123
  }
123
124
 
125
+ .popup_margin-top {
126
+ margin-top: var(--space--16, 16px);
127
+ }
128
+
124
129
  /* //////// GRID SYSTEM //////// */
125
130
 
126
131
  .row {
@@ -3,12 +3,17 @@ import { h, Host } from "@stencil/core";
3
3
  import initI18n from '../../utils/i18n';
4
4
  export class EzPopup {
5
5
  constructor() {
6
+ this.handleFooterSlotChange = (event) => {
7
+ const slot = event.target;
8
+ this._hasFooterSlotContent = slot.assignedElements().length > 0;
9
+ };
10
+ this._hasFooterSlotContent = false;
6
11
  this.size = "medium";
7
12
  this.opened = false;
8
13
  this.useHeader = true;
9
14
  this.heightMode = "full";
10
15
  this.ezTitle = undefined;
11
- this.enabledScroll = false;
16
+ this.enabledScroll = true;
12
17
  this.autoClose = true;
13
18
  this.footerButtons = [];
14
19
  }
@@ -59,6 +64,7 @@ export class EzPopup {
59
64
  }
60
65
  }
61
66
  getGridSize() {
67
+ var _a;
62
68
  const _sizeClasses = {
63
69
  "x-small": "col--sd-3 ez-popup__size-limit--x-small",
64
70
  "small": "col--sd-5",
@@ -71,16 +77,13 @@ export class EzPopup {
71
77
  if (!this.size || !_sizeClasses.hasOwnProperty(this.size)) {
72
78
  return _sizeClasses["medium"];
73
79
  }
74
- return _sizeClasses[this.size] || _sizeClasses["medium"];
80
+ return (_a = _sizeClasses[this.size]) !== null && _a !== void 0 ? _a : _sizeClasses["medium"];
75
81
  }
76
82
  getDialogClass() {
77
83
  let className = 'popup__container';
78
84
  if (this.heightMode === 'auto') {
79
85
  className += ' popup__container--auto';
80
86
  }
81
- if (this.enabledScroll) {
82
- className += ' popup__overflow-y--auto';
83
- }
84
87
  className += ` ${this.getGridSize()}`;
85
88
  return className;
86
89
  }
@@ -141,9 +144,18 @@ export class EzPopup {
141
144
  };
142
145
  }
143
146
  }
147
+ renderFooterButtons() {
148
+ return this.footerButtons.slice(0, 3).map((buttonProps, index) => (h("ez-button", Object.assign({ key: index }, this.handleDefaultPropsButtonsByIndex(index), buttonProps))));
149
+ }
144
150
  render() {
145
151
  return (h(Host, null, this.opened && (h("div", { class: "overlay", tabIndex: -1, onClick: this.handleAutoClose.bind(this) }, h("dialog", { ref: ref => this._popupRef = ref, class: this.getDialogClass() }, this.useHeader &&
146
- h("header", { class: "popup__header" }, !!this.ezTitle && h("h1", { class: "popup__title" }, this.ezTitle), h("ez-button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", variant: "tertiary", mode: "icon", iconName: "close", size: "small", onClick: this.closePopup.bind(this) })), h("main", { class: "popup__expandable-content" }, h("slot", null)), this.footerButtons.length > 0 && (h("footer", { class: "popup__footer" }, this.footerButtons.slice(0, 3).map((buttonProps, index) => (h("ez-button", Object.assign({ key: index }, this.handleDefaultPropsButtonsByIndex(index), buttonProps)))))))))));
152
+ h("header", { class: "popup__header" }, !!this.ezTitle && h("h1", { class: "popup__title" }, this.ezTitle), h("ez-button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", variant: "tertiary", mode: "icon", iconName: "close", size: "small", onClick: this.closePopup.bind(this) })), h("main", { class: {
153
+ "popup__expandable-content": true,
154
+ "popup__overflow-y--auto": this.enabledScroll
155
+ } }, h("slot", null)), h("footer", { class: {
156
+ "popup__footer": true,
157
+ "popup_margin-top": this.footerButtons.length > 0 || this._hasFooterSlotContent
158
+ } }, this.footerButtons.length > 0 && (this.renderFooterButtons()), h("slot", { name: 'footer', onSlotchange: this.handleFooterSlotChange })))))));
147
159
  }
148
160
  static get is() { return "ez-popup"; }
149
161
  static get encapsulation() { return "shadow"; }
@@ -264,7 +276,7 @@ export class EzPopup {
264
276
  },
265
277
  "attribute": "enabled-scroll",
266
278
  "reflect": false,
267
- "defaultValue": "false"
279
+ "defaultValue": "true"
268
280
  },
269
281
  "autoClose": {
270
282
  "type": "boolean",
@@ -313,6 +325,11 @@ export class EzPopup {
313
325
  }
314
326
  };
315
327
  }
328
+ static get states() {
329
+ return {
330
+ "_hasFooterSlotContent": {}
331
+ };
332
+ }
316
333
  static get events() {
317
334
  return [{
318
335
  "method": "ezClosePopup",