@sankhyalabs/ezui 0.0.0-bugfix-dev-KB-78812-2.0 → 0.0.0-bugfix-dev-KB-76362.1

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 (184) hide show
  1. package/dist/cjs/RecordValidationProcessor-10846595.js +108 -0
  2. package/dist/cjs/ez-button.cjs.entry.js +1 -1
  3. package/dist/cjs/ez-card-item_3.cjs.entry.js +19 -12
  4. package/dist/cjs/ez-chart.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-combo-box.cjs.entry.js +10 -46
  6. package/dist/cjs/ez-custom-form-input_2.cjs.entry.js +2 -3
  7. package/dist/cjs/ez-date-input.cjs.entry.js +2 -8
  8. package/dist/cjs/ez-date-time-input.cjs.entry.js +2 -8
  9. package/dist/cjs/ez-dialog.cjs.entry.js +2 -10
  10. package/dist/cjs/ez-form-view.cjs.entry.js +2 -2
  11. package/dist/cjs/ez-form.cjs.entry.js +325 -5
  12. package/dist/cjs/ez-grid.cjs.entry.js +70518 -14636
  13. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-list.cjs.entry.js +100 -151
  15. package/dist/cjs/ez-modal.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-number-input.cjs.entry.js +0 -7
  17. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  18. package/dist/cjs/ez-popup.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-search.cjs.entry.js +22 -67
  20. package/dist/cjs/ez-split-button.cjs.entry.js +1 -1
  21. package/dist/cjs/ez-split-panel.cjs.entry.js +4 -14
  22. package/dist/cjs/ez-text-area.cjs.entry.js +4 -66
  23. package/dist/cjs/ez-text-input.cjs.entry.js +7 -49
  24. package/dist/cjs/ez-time-input.cjs.entry.js +0 -6
  25. package/dist/cjs/ezui.cjs.js +1 -1
  26. package/dist/cjs/loader.cjs.js +1 -1
  27. package/dist/collection/collection-manifest.json +1 -1
  28. package/dist/collection/components/ez-button/ez-button.css +2 -2
  29. package/dist/collection/components/ez-card-item/ez-card-item.css +5 -14
  30. package/dist/collection/components/ez-combo-box/ez-combo-box.js +14 -75
  31. package/dist/collection/components/ez-date-input/ez-date-input.js +4 -35
  32. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +4 -35
  33. package/dist/collection/components/ez-dialog/ez-dialog.css +3 -3
  34. package/dist/collection/components/ez-dialog/ez-dialog.js +1 -9
  35. package/dist/collection/components/ez-filter-input/ez-filter-input.css +11 -0
  36. package/dist/collection/components/ez-filter-input/ez-filter-input.js +52 -22
  37. package/dist/collection/components/ez-form/ez-form.js +0 -1
  38. package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +2 -3
  39. package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +2 -2
  40. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +27 -100
  41. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +0 -8
  42. package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +46 -164
  43. package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +0 -7
  44. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/ComboBox.tpl.js +0 -1
  45. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/DateInput.tpl.js +0 -1
  46. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +0 -1
  47. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/Search.tpl.js +0 -1
  48. package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/TextInput.tpl.js +1 -4
  49. package/dist/collection/components/ez-grid/ez-grid.js +3 -90
  50. package/dist/collection/components/ez-icon/ez-icon.css +149 -153
  51. package/dist/collection/components/ez-list/ez-list.css +5 -5
  52. package/dist/collection/components/ez-list/ez-list.js +170 -152
  53. package/dist/collection/components/ez-modal/ez-modal.css +0 -4
  54. package/dist/collection/components/ez-modal/ez-modal.js +2 -2
  55. package/dist/collection/components/ez-number-input/ez-number-input.js +0 -25
  56. package/dist/collection/components/ez-popover/ez-popover.css +10 -3
  57. package/dist/collection/components/ez-popup/ez-popup.css +8 -4
  58. package/dist/collection/components/ez-search/ez-search.css +1 -1
  59. package/dist/collection/components/ez-search/ez-search.js +24 -94
  60. package/dist/collection/components/ez-split-button/ez-split-button.css +2 -2
  61. package/dist/collection/components/ez-split-panel/ez-split-panel.js +4 -35
  62. package/dist/collection/components/ez-text-area/ez-text-area.css +0 -49
  63. package/dist/collection/components/ez-text-area/ez-text-area.js +2 -102
  64. package/dist/collection/components/ez-text-input/ez-text-input.css +53 -27
  65. package/dist/collection/components/ez-text-input/ez-text-input.js +6 -84
  66. package/dist/collection/components/ez-time-input/ez-time-input.js +0 -24
  67. package/dist/collection/utils/form/DataBinder.js +3 -18
  68. package/dist/collection/utils/form/FormMetadata.js +1 -1
  69. package/dist/collection/utils/interfaces/AbstractFieldMetadata.js +1 -1
  70. package/dist/custom-elements/index.js +71099 -15536
  71. package/dist/esm/RecordValidationProcessor-9c6cc267.js +105 -0
  72. package/dist/esm/ez-button.entry.js +1 -1
  73. package/dist/esm/ez-card-item_3.entry.js +19 -12
  74. package/dist/esm/ez-chart.entry.js +1 -1
  75. package/dist/esm/ez-combo-box.entry.js +11 -47
  76. package/dist/esm/ez-custom-form-input_2.entry.js +2 -3
  77. package/dist/esm/ez-date-input.entry.js +2 -8
  78. package/dist/esm/ez-date-time-input.entry.js +2 -8
  79. package/dist/esm/ez-dialog.entry.js +2 -10
  80. package/dist/esm/ez-form-view.entry.js +2 -2
  81. package/dist/esm/ez-form.entry.js +324 -4
  82. package/dist/esm/ez-grid.entry.js +70545 -14663
  83. package/dist/esm/ez-icon.entry.js +1 -1
  84. package/dist/esm/ez-list.entry.js +101 -152
  85. package/dist/esm/ez-modal.entry.js +1 -1
  86. package/dist/esm/ez-number-input.entry.js +0 -7
  87. package/dist/esm/ez-popover.entry.js +1 -1
  88. package/dist/esm/ez-popup.entry.js +1 -1
  89. package/dist/esm/ez-search.entry.js +22 -67
  90. package/dist/esm/ez-split-button.entry.js +1 -1
  91. package/dist/esm/ez-split-panel.entry.js +5 -15
  92. package/dist/esm/ez-text-area.entry.js +4 -66
  93. package/dist/esm/ez-text-input.entry.js +7 -49
  94. package/dist/esm/ez-time-input.entry.js +0 -6
  95. package/dist/esm/ezui.js +1 -1
  96. package/dist/esm/loader.js +1 -1
  97. package/dist/ezui/ezui.esm.js +1 -1
  98. package/dist/ezui/p-00687830.entry.js +1 -0
  99. package/dist/ezui/p-044d46d5.entry.js +1 -0
  100. package/dist/ezui/p-11b09aa1.entry.js +1 -0
  101. package/dist/ezui/p-190c190f.entry.js +304 -0
  102. package/dist/ezui/p-2de9f0aa.entry.js +1 -0
  103. package/dist/ezui/p-36180f4d.entry.js +1 -0
  104. package/dist/ezui/{p-2f53435e.entry.js → p-3b546374.entry.js} +1 -1
  105. package/dist/ezui/p-3f8c33e0.entry.js +1 -0
  106. package/dist/ezui/p-52100a6e.entry.js +1 -0
  107. package/dist/ezui/p-5a40c77a.entry.js +1 -0
  108. package/dist/ezui/p-61059f6b.entry.js +1 -0
  109. package/dist/ezui/p-68267f59.entry.js +1 -0
  110. package/dist/ezui/p-823cc11b.entry.js +1 -0
  111. package/dist/ezui/p-85b500bb.entry.js +1 -0
  112. package/dist/ezui/p-8ac13678.entry.js +1 -0
  113. package/dist/ezui/p-940760bf.entry.js +1 -0
  114. package/dist/ezui/p-9e08ddb0.entry.js +1 -0
  115. package/dist/ezui/p-b2a1398f.entry.js +1 -0
  116. package/dist/ezui/p-ba5f4ee7.entry.js +1 -0
  117. package/dist/ezui/p-d40b93a7.entry.js +1 -0
  118. package/dist/ezui/p-d4aba783.entry.js +1 -0
  119. package/dist/ezui/p-e3ec7422.entry.js +1 -0
  120. package/dist/ezui/p-f291db18.entry.js +1 -0
  121. package/dist/ezui/p-f42855b9.js +1 -0
  122. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -7
  123. package/dist/types/components/ez-date-input/ez-date-input.d.ts +1 -6
  124. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +1 -6
  125. package/dist/types/components/ez-dialog/ez-dialog.d.ts +0 -2
  126. package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +11 -4
  127. package/dist/types/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.d.ts +1 -1
  128. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +0 -12
  129. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -7
  130. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -2
  131. package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -19
  132. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +1 -3
  133. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +1 -1
  134. package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
  135. package/dist/types/components/ez-grid/controller/ag-grid/components/cellRendererStatus.d.ts +1 -1
  136. package/dist/types/components/ez-grid/controller/ag-grid/components/selectionHeader.d.ts +1 -1
  137. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +1 -1
  138. package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +1 -1
  139. package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellEditor.d.ts +0 -1
  140. package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +1 -1
  141. package/dist/types/components/ez-grid/ez-grid.d.ts +1 -11
  142. package/dist/types/components/ez-list/ez-list.d.ts +26 -3
  143. package/dist/types/components/ez-modal/ez-modal.d.ts +1 -1
  144. package/dist/types/components/ez-number-input/ez-number-input.d.ts +0 -4
  145. package/dist/types/components/ez-search/ez-search.d.ts +2 -10
  146. package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +0 -4
  147. package/dist/types/components/ez-text-area/ez-text-area.d.ts +0 -17
  148. package/dist/types/components/ez-text-input/ez-text-input.d.ts +0 -9
  149. package/dist/types/components/ez-time-input/ez-time-input.d.ts +0 -4
  150. package/dist/types/components.d.ts +44 -114
  151. package/dist/types/utils/form/DataBinder.d.ts +0 -3
  152. package/package.json +4 -11
  153. package/dist/cjs/DataBinder-3b083480.js +0 -445
  154. package/dist/cjs/FocusResolver-885f2173.js +0 -35
  155. package/dist/collection/components/ez-split-panel/interfaces/IPanelSizeInfo.js +0 -1
  156. package/dist/collection/utils/FocusResolver.js +0 -31
  157. package/dist/esm/DataBinder-02fa9bb9.js +0 -441
  158. package/dist/esm/FocusResolver-1ccbf850.js +0 -33
  159. package/dist/ezui/p-16e21a40.entry.js +0 -1
  160. package/dist/ezui/p-33675dae.entry.js +0 -1
  161. package/dist/ezui/p-397e3026.entry.js +0 -1
  162. package/dist/ezui/p-3af64edd.entry.js +0 -1
  163. package/dist/ezui/p-3c10cd94.entry.js +0 -1
  164. package/dist/ezui/p-3cc9b84a.entry.js +0 -1
  165. package/dist/ezui/p-3d38bfea.entry.js +0 -1
  166. package/dist/ezui/p-455e737c.js +0 -1
  167. package/dist/ezui/p-46a46507.entry.js +0 -1
  168. package/dist/ezui/p-6bc25bc8.entry.js +0 -1
  169. package/dist/ezui/p-6bda82d1.entry.js +0 -1
  170. package/dist/ezui/p-6d31c43c.entry.js +0 -1
  171. package/dist/ezui/p-7f5afb1f.entry.js +0 -1
  172. package/dist/ezui/p-8f026744.entry.js +0 -1
  173. package/dist/ezui/p-9fddffe3.entry.js +0 -309
  174. package/dist/ezui/p-a4ee2991.entry.js +0 -1
  175. package/dist/ezui/p-aa7779d0.entry.js +0 -1
  176. package/dist/ezui/p-be34c77f.entry.js +0 -1
  177. package/dist/ezui/p-bfc30e61.entry.js +0 -1
  178. package/dist/ezui/p-bfc59380.entry.js +0 -1
  179. package/dist/ezui/p-d960a031.entry.js +0 -1
  180. package/dist/ezui/p-dc628ed3.js +0 -1
  181. package/dist/ezui/p-dfca5946.entry.js +0 -1
  182. package/dist/ezui/p-efbe0b73.entry.js +0 -1
  183. package/dist/types/components/ez-split-panel/interfaces/IPanelSizeInfo.d.ts +0 -9
  184. package/dist/types/utils/FocusResolver.d.ts +0 -5
@@ -0,0 +1,105 @@
1
+ import { UserInterface } from '@sankhyalabs/core';
2
+ import { A as ApplicationUtils } from './ApplicationUtils-eaf91331.js';
3
+
4
+ const buildFieldMetadata = (descriptor, config) => {
5
+ let { name, label, group } = Object.assign({}, config);
6
+ let { readOnly, required } = Object.assign({}, config);
7
+ let props;
8
+ let userInterface;
9
+ if (descriptor) {
10
+ label = label || descriptor.label;
11
+ name = name || descriptor.name;
12
+ required = descriptor.required || (config === null || config === void 0 ? void 0 : config.required);
13
+ readOnly = descriptor.readOnly || (config === null || config === void 0 ? void 0 : config.readOnly);
14
+ props = descriptor.properties;
15
+ userInterface = descriptor.userInterface;
16
+ }
17
+ return {
18
+ name, label, group,
19
+ readOnly, required,
20
+ props,
21
+ userInterface: userInterface || UserInterface.SHORTTEXT
22
+ };
23
+ };
24
+
25
+ class RecordValidationProcessor {
26
+ constructor(dataUnit, validationSource, validator) {
27
+ this._dataUnit = dataUnit;
28
+ this._validationSource = validationSource;
29
+ this._validator = validator;
30
+ }
31
+ validate(isSaving = true) {
32
+ return new Promise((accept, reject) => {
33
+ const records = this._dataUnit.getModifiedRecords();
34
+ for (let i = 0; i < records.length; i++) {
35
+ const record = records[i];
36
+ const invalidResults = [];
37
+ let validationResult = this.validateRequired(record);
38
+ if (validationResult && !validationResult.isValid) {
39
+ invalidResults.push(validationResult);
40
+ }
41
+ if (this._validator) {
42
+ validationResult = this._validator.validateRecord(record);
43
+ if (validationResult && !validationResult.isValid) {
44
+ invalidResults.push(validationResult);
45
+ }
46
+ }
47
+ if (invalidResults.length > 0) {
48
+ if (!isSaving && invalidResults[0].invalidFields.length > 0) {
49
+ this._validationSource.markAsInvalid(invalidResults[0].invalidFields[0], record.__record__id__);
50
+ reject();
51
+ break;
52
+ }
53
+ this.processValidationResult(invalidResults, record.__record__id__);
54
+ reject();
55
+ break;
56
+ }
57
+ }
58
+ return accept();
59
+ });
60
+ }
61
+ validateRequired(record) {
62
+ const requiredFields = this._validationSource.getRequiredFields();
63
+ const invalidFields = [];
64
+ new Set(requiredFields).forEach(field => {
65
+ const value = record[field];
66
+ if (value == undefined || value === "") {
67
+ const errorMessage = this._validationSource.getMessageForField(field, record.__record__id__);
68
+ if (errorMessage) {
69
+ invalidFields.push({ name: field, message: errorMessage });
70
+ }
71
+ else {
72
+ invalidFields.push({ name: field, message: "Essa informação é obrigatória" });
73
+ }
74
+ }
75
+ });
76
+ if (invalidFields.length > 0) {
77
+ return { isValid: false, invalidFields, infoMessage: "Há pelo menos um campo obrigatório não preenchido." };
78
+ }
79
+ return undefined;
80
+ }
81
+ processValidationResult(validationResult, recordId) {
82
+ validationResult.forEach(invalidResult => {
83
+ const invalidFields = invalidResult.invalidFields;
84
+ this._dataUnit.savingCanceled(invalidFields, recordId);
85
+ if (invalidFields) {
86
+ invalidFields.forEach(field => {
87
+ this.markAsInvalid(field, recordId);
88
+ });
89
+ }
90
+ if (invalidResult.infoMessage) {
91
+ ApplicationUtils.info(invalidResult.infoMessage);
92
+ }
93
+ if (invalidResult.errorMessage) {
94
+ const { errorTitle, errorMessage } = invalidResult;
95
+ ApplicationUtils.error(errorTitle, errorMessage);
96
+ }
97
+ });
98
+ }
99
+ markAsInvalid(field, recordId) {
100
+ this._dataUnit.setInvalidField(field.name, field.message, recordId);
101
+ this._validationSource.markAsInvalid(field, recordId);
102
+ }
103
+ }
104
+
105
+ export { RecordValidationProcessor as R, buildFieldMetadata as b };
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-5a720e56.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
3
 
4
- const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #2B3A54);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--light, #ffffff);--ez-button--border-radius:var(--border--radius-large, 24px);--ez-button--border:1px solid var(--color--strokes);--ez-button--justify-content:center;--ez-button--hover-color:var(--color--primary-600, #007a5a);--ez-button--hover--background-color:var(--background--light, #ffffff);--ez-button--disabled-color:var(--text--primary);--ez-button--disabled--background-color:var(--background--medium);--ez-button--focus--border:var(--border--medium, 2px solid) var(--color--primary-300);--ez-button--focus--box-shadow:var(--color--primary-300) 0px 0px 0px 2px;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link-disabled-color:var(--text--secondary, #a2abb9);--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border);justify-content:var(--ez-button--justify-content)}button:focus{outline:var(--ez-button--focus--border);box-shadow:none}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.x-small{height:28px;--ez-button--font-size:var(--text--small, 12px)}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--x-small{width:28px;min-width:28px;height:28px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}";
4
+ const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--width:'auto';--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:0px;--ez-button--padding-bottom:0px;--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--title--primary, #2B3A54);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--light, #ffffff);--ez-button--border-radius:var(--border--radius-large, 24px);--ez-button--border:1px solid var(--color--strokes);--ez-button--justify-content:center;--ez-button--hover-color:var(--color--primary-600, #007a5a);--ez-button--hover--background-color:var(--background--light, #ffffff);--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--border--medium, 2px solid) var(--color--primary-300);--ez-button--focus--box-shadow:var(--color--primary-300) 0px 0px 0px 2px;--ez-button--active-color:var(--color--primary-700);--ez-button--active--background-color:var(--background--strong);--ez-button--link-color:var(--color--primary, '#008561');--ez-button--link--hover-color:var(--color--primary-700, '#1C1D22');--ez-button--link-disabled-color:var(--text--secondary, #a2abb9);--ez-button--link--small--font-size:var(--text--small, 12px);--ez-button--link--medium--font-size:var(--text--medium, 14px);--ez-button--link--large--font-size:var(--text--large, 16px)}ez-icon{--ez-icon--color:inherit}button{position:relative;display:flex;align-items:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;white-space:nowrap;min-width:var(--ez-button--min-width);width:var(--ez-button--width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border);justify-content:var(--ez-button--justify-content)}button:focus{outline:var(--ez-button--focus--border);box-shadow:none}button:hover{outline:none;background-color:var(--ez-button--hover--background-color);color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}button:active{outline:none;box-shadow:none;background-color:var(--ez-button--active--background-color);color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);--ez-icon--color:var(--ez-button--disabled-color);cursor:no-drop}.x-small{height:28px;--ez-button--font-size:var(--text--small, 12px)}.small{height:32px;--ez-button--font-size:var(--text--small, 12px)}.medium{height:42px}.large{height:46px}.btn-icon{padding:0px}.btn-icon--medium{width:42px;min-width:42px;height:42px}.btn-icon--x-small{width:28px;min-width:28px;height:28px}.btn-icon--small{width:32px;min-width:32px;height:32px}.btn-icon--large{width:46px;min-width:46px;height:46px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon:hover{color:var(--ez-button--hover-color);fill:var(--ez-button--hover-color);--ez-icon--color:var(--ez-button--hover-color)}.label-icon:active{color:var(--ez-button--active-color);fill:var(--ez-button--active-color);--ez-icon--color:var(--ez-button--active-color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);user-select:none}button:disabled+label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--disabled-color);cursor:no-drop}div.label-icon{cursor:pointer}div.label-icon,button:disabled{cursor:no-drop}a{font-family:var(--ez-button--font-family);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}a:hover{color:var(--ez-button--link--hover-color)}a.small{font-size:var(--ez-button--link--small--font-size);line-height:var(--ez-button--link--small--font-size)}a.medium{font-size:var(--ez-button--link--medium--font-size);line-height:var(--ez-button--link--medium--font-size)}a.large{font-size:var(--ez-button--link--large--font-size);line-height:var(--ez-button--link--large--font-size)}a.disabled{color:var(--ez-button--link-disabled-color);cursor:not-allowed}";
5
5
 
6
6
  const EzButton = class {
7
7
  constructor(hostRef) {
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
2
2
  import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { C as CSSVarsUtils } from './CSSVarsUtils-71ce76be.js';
4
4
 
5
- const ezCardItemCss = ":host { \n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define o tamanho da fonte do componente no modo compacto.*/\n --ez-card-item--font-size-compacted: var(--text--extra-small, 10px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-large: var(--text-weight--large, 600);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define o espaçamento inferior do title do componente.*/\n --ez-card-item__title--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--detail-label--font-weight: var(--text-weight--large, 400);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item__detail{\n display: inline-block;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: var(--opacity--soft);\n}\n\n\n\n.card-item__expanded {\n padding: var(--space--medium);\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-large);\n color: var(--ez-card-item--color);\n padding-bottom: var(--ez-card-item__title--padding-bottom);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail{\n cursor: pointer;\n}\n\n.card-item__detail-default:not(:last-child) {\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--detail-label--font-weight);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container_default{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n/* Modo compacto */\n.card-item__compacted {\n padding: var(--space--medium);\n padding-bottom: 0px;\n padding-right: 0px;\n}\n\n.card-item__detail-label-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__detail-value-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__title-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__details-container__left-compacted{\n width: 100%;\n}\n\n.card-item__details-container__right-compacted {\n width: 100%;\n}\n\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";
5
+ const ezCardItemCss = ":host { \n /*@doc Define o tamanho da fonte do componente.*/\n --ez-card-item--font-size: var(--text--medium, 14px);\n\n /*@doc Define o tamanho da fonte do componente no modo compacto.*/\n --ez-card-item--font-size-compacted: var(--text--extra-small, 10px);\n\n /*@doc Define a família da fonte do componente.*/\n --ez-card-item--font-family: var(--font-pattern, Arial);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--font-weight: var(--text-weight--medium, 400);\n\n /*@doc Define o peso da fonte do title do componente.*/\n --ez-card-item--font-weight-medium: var(--text-weight--medium, 400);\n\n /*@doc Define a cor da fonte do componente.*/\n --ez-card-item--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte da key do componente.*/\n --ez-card-item__key--color: var(--text--primary, #626e82);\n\n /*@doc Define a cor da fonte do label do detalhe do componente.*/\n --ez-card-item__detail-label--color: var(--text--secondary, #A2ABB9);\n\n /*@doc Define o espaçamento inferior dos detalhes do componente.*/\n --ez-card-item__detail--padding-bottom: var(--space--extra-small, 3px);\n\n /*@doc Define a cor do highlight / marcação nos textos do componente.*/\n --ez-card-item__highlight--color: var(--color--primary-300, #E2F4EF);\n\n /*@doc Define o peso da fonte do componente.*/\n --ez-card-item--detail-label--font-weight: var(--text-weight--large, 400);\n\n width: 100%;\n display: flex;\n cursor: pointer;\n}\n\n.card-item {\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: pointer;\n z-index: 0;\n position: relative;\n container-type: inline-size;\n container-name: box;\n white-space: pre-line;\n}\n\n.card-item__detail {\n display: inline-block;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: var(--opacity--soft);\n cursor: pointer;\n}\n\n\n\n.card-item__expanded {\n padding: var(--space--medium);\n}\n\n.card-item:hover {\n background: #F0F3F7;\n border-radius: 12px;\n}\n\n.card-item__title {\n display: flex;\n align-items: center;\n line-height: 18px;\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight-medium);\n color: var(--ez-card-item--color);\n gap: var(--space--small, 6px);\n}\n\n.card-item__key {\n /*public*/\n color: var(--ez-card-item__key--color);\n}\n\n.card-item__details {\n display: flex;\n flex-direction: column;\n cursor: pointer;\n justify-content: space-between;\n width: 100%;\n}\n\n.card-item__details-container__left {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n cursor: pointer;\n width: 50%;\n}\n\n.card-item__details-container__right {\n display: flex;\n flex-direction: column;\n white-space: pre-line;\n width: 50%;\n cursor: pointer;\n}\n\n.card-item__detail-default:not(:last-child) {\n padding-bottom: var(--ez-card-item__detail--padding-bottom);\n}\n\n.card-item__detail-label {\n cursor: pointer;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--detail-label--font-weight);\n}\n\n.card-item__detail-value {\n cursor: pointer;\n line-break: anywhere;\n\n /*public*/\n font-size: var(--ez-card-item--font-size);\n font-family: var(--ez-card-item--font-family);\n font-weight: var(--ez-card-item--font-weight);\n}\n\n.card-item__highlight {\n position: relative;\n border-radius: 8px;\n z-index: -1;\n\n /*public*/\n background-color: var(--ez-card-item__highlight--color);\n outline: 2px solid var(--ez-card-item__highlight--color);\n box-shadow: -4px 0px 0px 0px var(--ez-card-item__highlight--color), \n 4px 0px 0px 0px var(--ez-card-item__highlight--color);\n}\n\n.card-item__content{\n display: flex;\n align-items: center;\n}\n\n.card-item__details-container_default{\n display: flex;\n}\n\n.card-item__details-slot{\n margin-left: auto;\n}\n\n/* Modo compacto */\n.card-item__compacted {\n padding: var(--space--2xs, 8px) var(--space--3xs, 4px);\n}\n\n.card-item__detail-label-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__detail-value-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__title-compacted {\n font-size: var(--ez-card-item--font-size-compacted);\n}\n\n.card-item__details-container__left-compacted{\n width: 100%;\n}\n\n.card-item__details-container__right-compacted {\n width: 100%;\n}\n\n\n@container box (max-width: 550px) {\n .card-item__details {\n flex-direction: column;\n }\n\n .card-item__details-container__left {\n width: 100%;\n }\n \n .card-item__details-container__right {\n width: 100%;\n }\n}\n\n@container box (max-width: 200px) {\n .card-item__title {\n font-size: 10px;\n }\n\n .card-item__detail-label {\n font-size: 10px;\n }\n\n .card-item__detail-value {\n font-size: 10px;\n }\n\n}";
6
6
 
7
7
  const EzCardItem = class {
8
8
  constructor(hostRef) {
@@ -56,7 +56,7 @@ const EzCardItem = class {
56
56
  };
57
57
  EzCardItem.style = ezCardItemCss;
58
58
 
59
- const ezFilterInputCss = ":host{display:block;width:100%}";
59
+ const ezFilterInputCss = ":host{--ez-filter-slot--right--width:70px;display:block;width:100%}.pointerCursor{cursor:pointer}ez-text-input{--ez-text-input__icon--right--width:var(--ez-filter-slot--right--width)}";
60
60
 
61
61
  const EzFilterInput = class {
62
62
  constructor(hostRef) {
@@ -64,15 +64,19 @@ const EzFilterInput = class {
64
64
  this.ezChange = createEvent(this, "ezChange", 7);
65
65
  this.ezSearching = createEvent(this, "ezSearching", 7);
66
66
  this.ezFocusIn = createEvent(this, "ezFocusIn", 7);
67
+ this.ezIconClick = createEvent(this, "ezIconClick", 7);
67
68
  this._searchingText = "";
68
69
  this.handleFocus = () => {
70
+ this.ezFocusIn.emit();
71
+ if (!this.asyncSearch) {
72
+ return;
73
+ }
69
74
  if (this._searchingText === "") {
70
75
  this._textInput.value = "";
71
76
  }
72
77
  else {
73
78
  this._textInput.value = this._searchingText;
74
79
  }
75
- this.ezFocusIn.emit();
76
80
  };
77
81
  this.label = undefined;
78
82
  this.value = undefined;
@@ -82,7 +86,7 @@ const EzFilterInput = class {
82
86
  this.mode = "regular";
83
87
  this.asyncSearch = false;
84
88
  this.canShowError = true;
85
- this.autoFocus = false;
89
+ this.enabledIconClick = false;
86
90
  }
87
91
  observeLabel() {
88
92
  if (this._textInput) {
@@ -103,8 +107,8 @@ const EzFilterInput = class {
103
107
  /**
104
108
  * Aplica o foco no campo.
105
109
  */
106
- async setFocus(options) {
107
- this._textInput.setFocus(options);
110
+ async setFocus() {
111
+ this._textInput.setFocus();
108
112
  }
109
113
  /**
110
114
  * Remove o foco do campo.
@@ -144,6 +148,14 @@ const EzFilterInput = class {
144
148
  this._textInput.value = this.value;
145
149
  }
146
150
  }
151
+ /**
152
+ * Método usado para emitir o evento de clique no ícone
153
+ */
154
+ async handleIconClick() {
155
+ if (this.enabledIconClick) {
156
+ this.ezIconClick.emit(true);
157
+ }
158
+ }
147
159
  handleChange(evt) {
148
160
  const newValue = evt.detail;
149
161
  this.errorMessage = "";
@@ -157,15 +169,10 @@ const EzFilterInput = class {
157
169
  }
158
170
  componentDidLoad() {
159
171
  CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
160
- if (this.autoFocus) {
161
- requestAnimationFrame(() => {
162
- this.setFocus({ selectText: true });
163
- });
164
- }
165
172
  }
166
173
  render() {
167
174
  ElementIDUtils.addIDInfoIfNotExists(this._elem, 'input');
168
- return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.handleChange(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, mode: this.mode, onFocusin: this.handleFocus, canShowError: this.canShowError }, h("ez-icon", { slot: "leftIcon", iconName: "search" })));
175
+ return (h("ez-text-input", { "data-element-id": ElementIDUtils.getInternalIDInfo("textInput"), ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.handleChange(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, mode: this.mode, onFocusin: this.handleFocus, canShowError: this.canShowError }, h("ez-icon", { slot: "leftIcon", iconName: "search", onClick: () => this.handleIconClick(), class: this.enabledIconClick ? 'pointerCursor' : '' }), h("slot", { name: "right", slot: "rightIcon" })));
169
176
  }
170
177
  get _elem() { return getElement(this); }
171
178
  static get watchers() { return {