@sankhyalabs/ezui 1.2.0-beta.2 → 1.2.0-beta.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 (216) hide show
  1. package/dist/cjs/{ApplicationUtils-483c0a9e.js → ApplicationUtils-edc62c5c.js} +6 -2
  2. package/dist/cjs/{CSSVarsUtils-09b431cc.js → CSSVarsUtils-af809e73.js} +17 -0
  3. package/dist/cjs/{DialogType-a1e288e6.js → DialogType-aa435c52.js} +1 -0
  4. package/dist/cjs/FieldBuilder-cd3e45ed.js +119 -0
  5. package/dist/cjs/ez-actions-button.cjs.entry.js +67 -15
  6. package/dist/cjs/ez-button.cjs.entry.js +12 -10
  7. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-chip.cjs.entry.js +6 -6
  9. package/dist/cjs/ez-collapsible-box.cjs.entry.js +85 -6
  10. package/dist/cjs/ez-combo-box.cjs.entry.js +38 -13
  11. package/dist/cjs/ez-date-input.cjs.entry.js +9 -14
  12. package/dist/cjs/ez-date-time-input.cjs.entry.js +9 -14
  13. package/dist/cjs/ez-dialog.cjs.entry.js +42 -7
  14. package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-form.cjs.entry.js +44 -133
  16. package/dist/cjs/ez-grid-config.cjs.entry.js +4 -5
  17. package/dist/cjs/ez-grid.cjs.entry.js +97 -10
  18. package/dist/cjs/ez-icon.cjs.entry.js +1 -1
  19. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  20. package/dist/cjs/ez-modal-container.cjs.entry.js +54 -0
  21. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  22. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  23. package/dist/cjs/ez-popup.cjs.entry.js +7 -3
  24. package/dist/cjs/ez-radio-button.cjs.entry.js +2 -2
  25. package/dist/cjs/ez-scroller.cjs.entry.js +1 -1
  26. package/dist/cjs/ez-search.cjs.entry.js +1 -1
  27. package/dist/cjs/ez-tabselector.cjs.entry.js +7 -5
  28. package/dist/cjs/ez-text-area.cjs.entry.js +6 -6
  29. package/dist/cjs/ez-text-edit.cjs.entry.js +103 -0
  30. package/dist/cjs/ez-text-input.cjs.entry.js +11 -1
  31. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  32. package/dist/cjs/ez-upload.cjs.entry.js +2 -2
  33. package/dist/cjs/ez-view-stack.cjs.entry.js +9 -5
  34. package/dist/cjs/ezui.cjs.js +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/collection/collection-manifest.json +6 -4
  37. package/dist/collection/components/ez-actions-button/ez-actions-button.css +49 -20
  38. package/dist/collection/components/ez-actions-button/ez-actions-button.js +219 -23
  39. package/dist/collection/components/ez-button/ez-button.css +1 -6
  40. package/dist/collection/components/ez-button/ez-button.js +11 -9
  41. package/dist/collection/components/ez-calendar/ez-calendar.css +17 -20
  42. package/dist/collection/components/ez-chip/ez-chip.css +6 -3
  43. package/dist/collection/components/ez-chip/ez-chip.js +5 -5
  44. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +16 -0
  45. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +226 -7
  46. package/dist/collection/components/ez-combo-box/ez-combo-box.css +1 -22
  47. package/dist/collection/components/ez-combo-box/ez-combo-box.js +42 -18
  48. package/dist/collection/components/ez-date-input/ez-date-input.js +8 -13
  49. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +8 -13
  50. package/dist/collection/components/ez-dialog/DialogType.js +1 -0
  51. package/dist/collection/components/ez-dialog/ez-dialog.css +19 -25
  52. package/dist/collection/components/ez-dialog/ez-dialog.js +41 -6
  53. package/dist/collection/components/ez-form/DataBinder.js +1 -0
  54. package/dist/collection/components/ez-form/ez-form.js +22 -13
  55. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +1 -1
  56. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +24 -14
  57. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +3 -0
  58. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +64 -10
  59. package/dist/collection/components/ez-grid/controller/ag-grid/components/cellRenderer.js +31 -0
  60. package/dist/collection/components/ez-grid/ez-grid.js +40 -3
  61. package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.css +36 -25
  62. package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.js +1 -2
  63. package/dist/collection/components/ez-grid/subcomponents/ez-select-box/ez-select-box.js +5 -4
  64. package/dist/collection/components/ez-icon/ez-icon.css +117 -98
  65. package/dist/collection/components/ez-list/ez-list.css +9 -1
  66. package/dist/collection/components/ez-modal-container/ez-modal-container.css +38 -0
  67. package/dist/collection/components/ez-modal-container/ez-modal-container.js +166 -0
  68. package/dist/collection/components/ez-modal-container/index.js +2 -0
  69. package/dist/collection/components/ez-modal-container/modal-action.js +8 -0
  70. package/dist/collection/components/ez-modal-container/modal-button-status.js +7 -0
  71. package/dist/collection/components/ez-popover/ez-popover.css +1 -1
  72. package/dist/collection/components/ez-popup/ez-popup.css +4 -0
  73. package/dist/collection/components/ez-popup/ez-popup.js +26 -4
  74. package/dist/collection/components/ez-radio-button/ez-radio-button.css +16 -5
  75. package/dist/collection/components/ez-radio-button/ez-radio-button.js +1 -1
  76. package/dist/collection/components/ez-scroller/ez-scroller.css +4 -2
  77. package/dist/collection/components/ez-search/ez-search.js +6 -6
  78. package/dist/collection/components/ez-tabselector/ez-tabselector.css +9 -0
  79. package/dist/collection/components/ez-tabselector/ez-tabselector.js +7 -3
  80. package/dist/collection/components/ez-text-area/ez-text-area.css +6 -3
  81. package/dist/collection/components/ez-text-area/ez-text-area.js +5 -5
  82. package/dist/collection/components/ez-text-edit/ez-text-edit.css +19 -0
  83. package/dist/collection/components/ez-text-edit/ez-text-edit.js +188 -0
  84. package/dist/collection/components/ez-text-input/ez-text-input.css +18 -2
  85. package/dist/collection/components/ez-text-input/ez-text-input.js +28 -0
  86. package/dist/collection/components/ez-view-stack/ez-view-stack.js +12 -6
  87. package/dist/collection/utils/ApplicationUtils.js +5 -1
  88. package/dist/collection/utils/CSSVarsUtils.js +17 -0
  89. package/dist/collection/utils/index.js +1 -0
  90. package/dist/custom-elements/index.d.ts +12 -0
  91. package/dist/custom-elements/index.js +728 -254
  92. package/dist/esm/{ApplicationUtils-5f87ae60.js → ApplicationUtils-205ac4bc.js} +6 -2
  93. package/dist/esm/{CSSVarsUtils-499b75c2.js → CSSVarsUtils-00f67f32.js} +17 -0
  94. package/dist/esm/{DialogType-72afa679.js → DialogType-4059dc4d.js} +1 -0
  95. package/dist/esm/FieldBuilder-9e9545fc.js +117 -0
  96. package/dist/esm/ez-actions-button.entry.js +67 -15
  97. package/dist/esm/ez-button.entry.js +12 -10
  98. package/dist/esm/ez-calendar.entry.js +1 -1
  99. package/dist/esm/ez-chip.entry.js +6 -6
  100. package/dist/esm/ez-collapsible-box.entry.js +86 -7
  101. package/dist/esm/ez-combo-box.entry.js +38 -13
  102. package/dist/esm/ez-date-input.entry.js +9 -14
  103. package/dist/esm/ez-date-time-input.entry.js +10 -15
  104. package/dist/esm/ez-dialog.entry.js +42 -7
  105. package/dist/esm/ez-filter-input.entry.js +1 -1
  106. package/dist/esm/ez-form.entry.js +43 -132
  107. package/dist/esm/ez-grid-config.entry.js +4 -5
  108. package/dist/esm/ez-grid.entry.js +97 -10
  109. package/dist/esm/ez-icon.entry.js +1 -1
  110. package/dist/esm/ez-list.entry.js +1 -1
  111. package/dist/esm/ez-modal-container.entry.js +50 -0
  112. package/dist/esm/ez-number-input.entry.js +1 -1
  113. package/dist/esm/ez-popover.entry.js +1 -1
  114. package/dist/esm/ez-popup.entry.js +7 -3
  115. package/dist/esm/ez-radio-button.entry.js +2 -2
  116. package/dist/esm/ez-scroller.entry.js +1 -1
  117. package/dist/esm/ez-search.entry.js +1 -1
  118. package/dist/esm/ez-tabselector.entry.js +7 -5
  119. package/dist/esm/ez-text-area.entry.js +6 -6
  120. package/dist/esm/ez-text-edit.entry.js +99 -0
  121. package/dist/esm/ez-text-input.entry.js +11 -1
  122. package/dist/esm/ez-time-input.entry.js +1 -1
  123. package/dist/esm/ez-upload.entry.js +2 -2
  124. package/dist/esm/ez-view-stack.entry.js +9 -5
  125. package/dist/esm/ezui.js +1 -1
  126. package/dist/esm/loader.js +1 -1
  127. package/dist/ezui/ezui.esm.js +1 -1
  128. package/dist/ezui/p-0b44cf1c.js +1 -0
  129. package/dist/ezui/p-0c7203d5.entry.js +1 -0
  130. package/dist/ezui/p-2cc6dd66.entry.js +1 -0
  131. package/dist/ezui/p-2ccad880.entry.js +1 -0
  132. package/dist/ezui/p-333d79c4.entry.js +1 -0
  133. package/dist/ezui/p-3987f8d8.entry.js +1 -0
  134. package/dist/ezui/p-3c87845d.entry.js +1 -0
  135. package/dist/ezui/{p-768053d0.entry.js → p-43bb6a59.entry.js} +1 -1
  136. package/dist/ezui/p-4a5e37a7.js +1 -0
  137. package/dist/ezui/p-4ad647fc.entry.js +1 -0
  138. package/dist/ezui/p-54ecd19a.js +1 -0
  139. package/dist/ezui/{p-03742d3e.entry.js → p-56688470.entry.js} +1 -1
  140. package/dist/ezui/{p-b901ba02.entry.js → p-5a1927a2.entry.js} +1 -1
  141. package/dist/ezui/{p-b2cf7db2.entry.js → p-63d567cc.entry.js} +1 -1
  142. package/dist/ezui/p-6befd7e4.entry.js +1 -0
  143. package/dist/ezui/p-712bd293.entry.js +1 -0
  144. package/dist/ezui/{p-d9c72ff7.entry.js → p-72c75a43.entry.js} +1 -1
  145. package/dist/ezui/{p-15d18ece.entry.js → p-744eb735.entry.js} +1 -1
  146. package/dist/ezui/{p-81eb2738.entry.js → p-802d23d9.entry.js} +1 -1
  147. package/dist/ezui/p-86daa81a.entry.js +1 -0
  148. package/dist/ezui/{p-72ab066f.entry.js → p-b706619e.entry.js} +1 -1
  149. package/dist/ezui/p-bca406db.entry.js +1 -0
  150. package/dist/ezui/p-be06251d.entry.js +1 -0
  151. package/dist/ezui/{p-e7d03a0d.entry.js → p-bffae598.entry.js} +1 -1
  152. package/dist/ezui/p-d91527dc.entry.js +1 -0
  153. package/dist/ezui/p-dd257f17.entry.js +1 -0
  154. package/dist/ezui/p-e1148f5c.js +1 -0
  155. package/dist/ezui/p-e1f2b5da.entry.js +1 -0
  156. package/dist/ezui/p-e230bfd2.entry.js +1 -0
  157. package/dist/ezui/{p-5c721278.entry.js → p-e3ee814c.entry.js} +1 -1
  158. package/dist/ezui/p-e697ffd5.entry.js +1 -0
  159. package/dist/ezui/p-ec9decf2.entry.js +1 -0
  160. package/dist/ezui/p-f36dbc21.entry.js +1 -0
  161. package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +42 -9
  162. package/dist/types/components/ez-chip/ez-chip.d.ts +1 -1
  163. package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +46 -1
  164. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +15 -5
  165. package/dist/types/components/ez-date-input/ez-date-input.d.ts +0 -1
  166. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +0 -1
  167. package/dist/types/components/ez-dialog/DialogType.d.ts +1 -0
  168. package/dist/types/components/ez-dialog/ez-dialog.d.ts +3 -0
  169. package/dist/types/components/ez-form/DataBinder.d.ts +2 -2
  170. package/dist/types/components/ez-form/ez-form.d.ts +21 -11
  171. package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -3
  172. package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +2 -5
  173. package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -3
  174. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +11 -0
  175. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -1
  176. package/dist/types/components/ez-grid/controller/ag-grid/components/cellRenderer.d.ts +9 -0
  177. package/dist/types/components/ez-grid/ez-grid.d.ts +8 -3
  178. package/dist/types/components/ez-grid/subcomponents/ez-select-box/ez-select-box.d.ts +2 -6
  179. package/dist/types/components/ez-modal-container/ez-modal-container.d.ts +43 -0
  180. package/dist/types/components/ez-modal-container/index.d.ts +2 -0
  181. package/dist/types/components/ez-modal-container/modal-action.d.ts +7 -0
  182. package/dist/types/components/ez-modal-container/modal-button-status.d.ts +6 -0
  183. package/dist/types/components/ez-popup/ez-popup.d.ts +4 -0
  184. package/dist/types/components/ez-search/ez-search.d.ts +3 -3
  185. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -0
  186. package/dist/types/components/ez-text-edit/ez-text-edit.d.ts +39 -0
  187. package/dist/types/components/ez-text-input/ez-text-input.d.ts +5 -0
  188. package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +5 -1
  189. package/dist/types/components.d.ts +266 -28
  190. package/dist/types/utils/ApplicationUtils.d.ts +1 -0
  191. package/dist/types/utils/CSSVarsUtils.d.ts +1 -0
  192. package/dist/types/utils/index.d.ts +1 -0
  193. package/package.json +5 -5
  194. package/react/components.d.ts +2 -0
  195. package/react/components.js +2 -0
  196. package/react/components.js.map +1 -1
  197. package/dist/ezui/p-3263a002.js +0 -1
  198. package/dist/ezui/p-3ae441ec.entry.js +0 -1
  199. package/dist/ezui/p-3ffdde40.entry.js +0 -1
  200. package/dist/ezui/p-416bedbe.entry.js +0 -1
  201. package/dist/ezui/p-47e06040.entry.js +0 -1
  202. package/dist/ezui/p-6cfe20a0.entry.js +0 -1
  203. package/dist/ezui/p-719e9ef9.entry.js +0 -1
  204. package/dist/ezui/p-787fbdfe.js +0 -1
  205. package/dist/ezui/p-7fe1ac9a.entry.js +0 -1
  206. package/dist/ezui/p-898b9906.js +0 -1
  207. package/dist/ezui/p-9c3c9da8.entry.js +0 -1
  208. package/dist/ezui/p-a27dafa4.entry.js +0 -1
  209. package/dist/ezui/p-a3ff4f0e.entry.js +0 -1
  210. package/dist/ezui/p-aba3fa6c.entry.js +0 -1
  211. package/dist/ezui/p-b3e978aa.entry.js +0 -1
  212. package/dist/ezui/p-cccd8cde.entry.js +0 -1
  213. package/dist/ezui/p-cf283c4a.entry.js +0 -1
  214. package/dist/ezui/p-d0671e14.entry.js +0 -1
  215. package/dist/ezui/p-e0f06d73.entry.js +0 -1
  216. package/dist/ezui/p-ed835b36.entry.js +0 -1
@@ -40,10 +40,12 @@
40
40
  /* Ícones */
41
41
  /*@doc Define a cor dos ícones dos indicadores de modo.*/
42
42
  --dialog__icon--color: var(--text--inverted, #fff);
43
- /*@doc Define a cor de fundo dos indicadores do modo crítico.*/
43
+ /*@doc Define a cor do indicador do dialog de erro.*/
44
44
  --dialog__critical--background-color: var(--color--alert-error-800, #BD0025);
45
- /*@doc Define a cor de fundo da lista de opções.*/
45
+ /*@doc Define a cor do indicador do dialog de alert.*/
46
46
  --dialog__warning--background-color: var(--color--alert-warning-500, #EFB103);
47
+ /*@doc Define a cor do indicador do dialog de sucesso.*/
48
+ --dialog__success--background-color: var(--color--alert-success-500, #00523c);
47
49
 
48
50
  /*@doc Define a camada que o dialog será exibido.*/
49
51
  --dialog-z-index: var(--most-visible, 3);
@@ -123,6 +125,13 @@ h2 {
123
125
  background-color: var(--dialog__warning--background-color);
124
126
  }
125
127
 
128
+ .dialog__success--indicator{
129
+ width: 12px;
130
+ border-radius: 6px 0px 0px 6px;
131
+ box-sizing: border-box;
132
+ background-color: var(--dialog__success--background-color);
133
+ }
134
+
126
135
  .message {
127
136
  font-size: var(--dialog__body--font-size);
128
137
  font-weight: var(--dialog__body--text-weight--medium);
@@ -178,23 +187,18 @@ h2 {
178
187
  padding-left: 0;
179
188
  }
180
189
 
181
- .title-icon {
182
- outline: none;
183
- border: none;
184
- background-color: var(--dialog__warning--background-color);
185
- width: 26px;
186
- height: 26px;
187
- border-radius: 100%;
188
- padding: 0;
189
- display: flex;
190
- justify-content: center;
191
- align-items: center;
192
- }
193
-
194
190
  .title-icon--critical {
195
191
  background-color: var(--dialog__critical--background-color);
196
192
  }
197
193
 
194
+ .title-icon--success {
195
+ background-color: var(--dialog__success--background-color);
196
+ }
197
+
198
+ .title-icon--warn {
199
+ background-color: var(--dialog__warning--background-color);
200
+ }
201
+
198
202
  .btn-close {
199
203
  justify-content: flex-end;
200
204
  align-self: flex-start;
@@ -227,16 +231,6 @@ h2 {
227
231
  mask-image: var(--dialog--warning__image);
228
232
  }
229
233
 
230
- .title-icon--critical::after {
231
- content: '';
232
- display: flex;
233
- background-color: #FFFF;
234
- width: 13px;
235
- height: 13px;
236
- -webkit-mask-image: var(--dialog--critical__image);
237
- mask-image: var(--dialog--critical__image);
238
- }
239
-
240
234
  .button-yes-no__container {
241
235
  display: flex;
242
236
  box-sizing: border-box;
@@ -55,19 +55,54 @@ export class EzDialog {
55
55
  return dialogType === DialogType.CRITICAL;
56
56
  }
57
57
  getIconElement(message) {
58
- if (message.icon) {
59
- return h("ez-icon", { class: this.isCritical(message.dialogType) ? "changeable__icon critical" : "changeable__icon", size: "small", iconName: message.icon });
60
- }
61
58
  if (message.dialogType === DialogType.DEFAULT) {
62
59
  return;
63
60
  }
64
- return h("div", { class: this.isCritical(message.dialogType) ? "title-icon title-icon--critical" : "title-icon" });
61
+ return h("ez-icon", { class: "changeable__icon " + this.getIconClass(message.dialogType), size: "small", iconName: this.getIconName(message) });
62
+ }
63
+ getIconClass(dialogType) {
64
+ if (this.isCritical(dialogType)) {
65
+ return "title-icon--critical";
66
+ }
67
+ else if (dialogType === DialogType.SUCCESS) {
68
+ return "title-icon--success";
69
+ }
70
+ else if (dialogType === DialogType.WARN) {
71
+ return "title-icon--warn";
72
+ }
73
+ return "";
74
+ }
75
+ getIconName(message) {
76
+ if (message.icon) {
77
+ return message.icon;
78
+ }
79
+ else if (this.isCritical(message.dialogType)) {
80
+ return "alert-circle-inverted";
81
+ }
82
+ else if (message.dialogType === DialogType.WARN) {
83
+ return "warning-outline";
84
+ }
85
+ else if (message.dialogType === DialogType.SUCCESS) {
86
+ return "check";
87
+ }
65
88
  }
66
89
  getTypeIndicatorElement(message) {
67
90
  if (message.dialogType === DialogType.DEFAULT) {
68
91
  return;
69
92
  }
70
- return h("div", { class: this.isCritical(message.dialogType) ? "dialog__critical--indicator" : "dialog__warning--indicator" });
93
+ return h("div", { class: this.getClassIconIndicator(message.dialogType) });
94
+ }
95
+ getClassIconIndicator(dialogType) {
96
+ if (this.isCritical(dialogType)) {
97
+ return "dialog__critical--indicator";
98
+ }
99
+ else if (dialogType == DialogType.SUCCESS) {
100
+ return "dialog__success--indicator";
101
+ }
102
+ else if (dialogType == DialogType.WARN) {
103
+ return "dialog__warning--indicator";
104
+ }
105
+ return "";
71
106
  }
72
107
  getClassContainer(message) {
73
108
  const type = message.dialogType || DialogType.DEFAULT;
@@ -142,7 +177,7 @@ export class EzDialog {
142
177
  "mutable": true,
143
178
  "complexType": {
144
179
  "original": "DialogType",
145
- "resolved": "DialogType.CRITICAL | DialogType.DEFAULT | DialogType.WARN",
180
+ "resolved": "DialogType.CRITICAL | DialogType.DEFAULT | DialogType.SUCCESS | DialogType.WARN",
146
181
  "references": {
147
182
  "DialogType": {
148
183
  "location": "import",
@@ -18,6 +18,7 @@ export default class DataBinder {
18
18
  case Action.DATA_CHANGED:
19
19
  case Action.CHANGE_UNDONE:
20
20
  case Action.CHANGE_REDONE:
21
+ case Action.RECORD_LOADED:
21
22
  (_a = this._fields) === null || _a === void 0 ? void 0 : _a.forEach(field => {
22
23
  this.updateValue(field.fieldName, field.field);
23
24
  });
@@ -1,5 +1,5 @@
1
1
  import { Component, h, Host, Prop, Element, forceUpdate, Method, Watch, Event } from "@stencil/core";
2
- import { DataUnit, Action, DataUnitAction } from "@sankhyalabs/core";
2
+ import { DataUnit, Action, DataUnitAction, DateUtils } from "@sankhyalabs/core";
3
3
  import { FormSheet } from "./structure/FormSheet";
4
4
  import { buildFromConfig, buildFromDataUnit } from "./structure/FormSheetMetadata";
5
5
  import { createStore } from "redux";
@@ -101,7 +101,7 @@ export class EzForm {
101
101
  }
102
102
  processMetadata() {
103
103
  if (!this.isStatic() && this.dataUnit) {
104
- const metadata = this.config && this.config.length > 0 ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
104
+ const metadata = this.config != undefined ? buildFromConfig(this.config, this.dataUnit) : buildFromDataUnit(this.dataUnit);
105
105
  this._store.dispatch(loadMetadata(metadata));
106
106
  }
107
107
  }
@@ -109,6 +109,16 @@ export class EzForm {
109
109
  var _a;
110
110
  return ((_a = this._staticFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
111
111
  }
112
+ getValidatedValue(value) {
113
+ switch (value) {
114
+ case "${data}":
115
+ return DateUtils.getToday();
116
+ case "${datahora}":
117
+ return DateUtils.getToday(true);
118
+ default:
119
+ return value;
120
+ }
121
+ }
112
122
  interceptAction(action) {
113
123
  if (action.type === Action.RECORDS_COPIED) {
114
124
  const metadata = selectFormMetadata(this._store.getState());
@@ -137,7 +147,9 @@ export class EzForm {
137
147
  return new DataUnitAction(Action.RECORDS_ADDED, records.map(record => {
138
148
  const newRecord = Object.assign({}, record);
139
149
  for (const field in defaultValues) {
140
- newRecord[field] = this.dataUnit.valueFromString(field, defaultValues[field]);
150
+ const defaultValue = defaultValues[field].value;
151
+ const fieldValue = defaultValue != undefined ? defaultValue : defaultValues[field];
152
+ newRecord[field] = this.dataUnit.valueFromString(field, this.getValidatedValue(fieldValue));
141
153
  }
142
154
  return newRecord;
143
155
  }));
@@ -201,13 +213,10 @@ export class EzForm {
201
213
  "type": "unknown",
202
214
  "mutable": false,
203
215
  "complexType": {
204
- "original": "Array<FieldConfig>",
205
- "resolved": "FieldConfig[]",
216
+ "original": "IFormConfig",
217
+ "resolved": "IFormConfig",
206
218
  "references": {
207
- "Array": {
208
- "location": "global"
209
- },
210
- "FieldConfig": {
219
+ "IFormConfig": {
211
220
  "location": "local"
212
221
  }
213
222
  }
@@ -223,10 +232,10 @@ export class EzForm {
223
232
  "type": "unknown",
224
233
  "mutable": false,
225
234
  "complexType": {
226
- "original": "RecordValidator",
227
- "resolved": "RecordValidator",
235
+ "original": "IRecordValidator",
236
+ "resolved": "IRecordValidator",
228
237
  "references": {
229
- "RecordValidator": {
238
+ "IRecordValidator": {
230
239
  "location": "local"
231
240
  }
232
241
  }
@@ -303,7 +312,7 @@ export class EzForm {
303
312
  "location": "import",
304
313
  "path": "@sankhyalabs/core"
305
314
  },
306
- "ValidationResult": {
315
+ "IValidationResult": {
307
316
  "location": "local"
308
317
  }
309
318
  },
@@ -41,7 +41,7 @@ export const buildField = (field) => {
41
41
  builder = uiBuilders.get(descriptor.userInterface);
42
42
  }
43
43
  if (config.required) {
44
- config.label = `* ${config.label} (obrigatório)`;
44
+ config.label = `${config.label} (obrigatório) *`;
45
45
  }
46
46
  if (!builder) {
47
47
  builder = buildTextInput;
@@ -59,35 +59,45 @@ function getTabConfig(tab, sheets) {
59
59
  function sortTabs(a, b) {
60
60
  return a[0].label == '__main' ? -1 : (a[0].order || 10000) - (b[0].order || 10000);
61
61
  }
62
- export const buildFromConfig = (fields, dataUnit) => {
62
+ export const buildFromConfig = (config, dataUnit) => {
63
+ var _a, _b;
63
64
  const sheets = new Map();
65
+ const hiddenTabs = new Map();
64
66
  const requiredFields = [];
65
67
  const cleanOnCopyFields = [];
66
68
  const defaultValues = {};
67
- fields.forEach(config => {
69
+ (_a = config === null || config === void 0 ? void 0 : config.tabs) === null || _a === void 0 ? void 0 : _a.forEach((tab) => {
70
+ if (!hiddenTabs.has(tab.label) && tab.visible === false) {
71
+ hiddenTabs.set(tab.label, tab);
72
+ }
73
+ });
74
+ (_b = config === null || config === void 0 ? void 0 : config.fields) === null || _b === void 0 ? void 0 : _b.forEach((field) => {
68
75
  var _a, _b, _c;
69
- if (config.visible !== false) {
70
- const tabConfig = getTabConfig(config.tab || "__main", sheets);
71
- const descriptor = dataUnit.getField(config.name);
76
+ if (field.visible !== false) {
77
+ const tabConfig = getTabConfig(field.tab || "__main", sheets);
78
+ if (hiddenTabs.has(tabConfig.label)) {
79
+ return;
80
+ }
81
+ const descriptor = dataUnit.getField(field.name);
72
82
  if (descriptor && tabConfig.visible) {
73
83
  if (!sheets.has(tabConfig)) {
74
84
  sheets.set(tabConfig, new Map());
75
85
  }
76
86
  const tabItens = sheets.get(tabConfig);
77
- const isRequired = config.required === undefined ? descriptor.required : config.required;
87
+ const isRequired = field.required == undefined ? descriptor.required : field.required;
78
88
  if (isRequired) {
79
- requiredFields.push(config.name);
89
+ requiredFields.push(field.name);
80
90
  }
81
- const clearOnCopy = config.cleanOnCopy === undefined ? (((_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy) || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum)) : config.cleanOnCopy;
91
+ const clearOnCopy = field.cleanOnCopy == undefined ? (((_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy) || ((_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.autoNum)) : field.cleanOnCopy;
82
92
  if (clearOnCopy) {
83
- cleanOnCopyFields.push(config.name);
93
+ cleanOnCopyFields.push(field.name);
84
94
  }
85
- const defaultValue = config.defaultValue === undefined ? (_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.defaultValue : config.defaultValue;
95
+ const defaultValue = field.defaultValue == undefined ? (_c = descriptor.properties) === null || _c === void 0 ? void 0 : _c.defaultValue : field.defaultValue;
86
96
  if (defaultValue) {
87
- defaultValues[config.name] = config.defaultValue;
97
+ defaultValues[field.name] = field.defaultValue;
88
98
  }
89
- const fieldMD = { config, descriptor };
90
- const group = config.group;
99
+ const fieldMD = { config: field, descriptor };
100
+ const group = field.group;
91
101
  if (group) {
92
102
  const key = `group::${group}`;
93
103
  if (!tabItens.has(key)) {
@@ -98,7 +108,7 @@ export const buildFromConfig = (fields, dataUnit) => {
98
108
  }
99
109
  }
100
110
  else {
101
- tabItens.set(config.name, fieldMD);
111
+ tabItens.set(field.name, fieldMD);
102
112
  }
103
113
  }
104
114
  }
@@ -26,6 +26,9 @@ export default class DataUnitBridge {
26
26
  const changes = Object.assign({}, action.payload);
27
27
  delete changes.records;
28
28
  this._gridController.changeValues(changes, action.payload.records);
29
+ break;
30
+ case Action.RECORD_LOADED:
31
+ this._gridController.changeValues(changes, action.payload.records);
29
32
  }
30
33
  };
31
34
  this._gridController = gridController;
@@ -1,14 +1,15 @@
1
1
  import { Grid as EnterpriseGrid, LicenseManager } from "ag-grid-enterprise";
2
2
  import { Grid } from "ag-grid-community";
3
+ import { ApplicationContext, DataType, SortMode, UserInterface, NumberUtils, StringUtils } from "@sankhyalabs/core";
3
4
  import gridTerms from "./i18n/pt-BR.js";
4
5
  import getHeaderColumnTemplate from "./template/HeaderColumnTemplate.js";
5
6
  import DataSource from "./DataSource";
6
- import { ApplicationContext, DataType, SortMode, UserInterface } from "@sankhyalabs/core";
7
- import { NumberUtils, StringUtils } from "@sankhyalabs/core";
7
+ import { CellRenderer } from "./components/cellRenderer";
8
8
  export default class AgGridController {
9
9
  constructor(enterprise) {
10
10
  this.DEFAULT_ROW_HEIGHT = 30;
11
11
  this.CHECK_BOX_COL_ID = "checkBoxColumn";
12
+ this.STATUS_COL_ID = "statusColumn";
12
13
  this.RECORD_ARCHIVE_COL_ID = "__RECORD_ARCHIVE__";
13
14
  this.BLOCK_LOAD_DEBOUNCE = 400;
14
15
  this._menuItems = [];
@@ -38,6 +39,7 @@ export default class AgGridController {
38
39
  this._doubleClickCallBack = options.onDoubleClick;
39
40
  this._multipleSelection = options.allowMultipleSelection;
40
41
  this._dataUnit = options.dataUnit;
42
+ this._statusResolver = options.statusResolver;
41
43
  if (this._dataUnit) {
42
44
  this._dataUnit.sortingProvider = this;
43
45
  }
@@ -61,7 +63,11 @@ export default class AgGridController {
61
63
  }));
62
64
  return items;
63
65
  },
64
- getRowHeight: this.getRowHeight.bind(this)
66
+ getRowHeight: this.getRowHeight.bind(this),
67
+ defaultColDef: {
68
+ headerClass: "ez-grid__cell-header",
69
+ cellClass: "ez-grid__cell-body"
70
+ }
65
71
  };
66
72
  this.setOptionsEvents(this._gridOptions);
67
73
  this.setOptionsSupress(this._gridOptions);
@@ -173,7 +179,29 @@ export default class AgGridController {
173
179
  suppressMovable: true,
174
180
  suppressAutoSize: true,
175
181
  suppressMenu: true,
176
- lockPosition: true
182
+ lockPosition: true,
183
+ pinned: true
184
+ });
185
+ }
186
+ if (this._statusResolver != undefined) {
187
+ newColDefs.push({
188
+ colId: this.STATUS_COL_ID,
189
+ headerName: "",
190
+ checkboxSelection: false,
191
+ headerCheckboxSelection: false,
192
+ width: 28,
193
+ suppressMovable: true,
194
+ suppressAutoSize: true,
195
+ suppressMenu: true,
196
+ lockPosition: true,
197
+ pinned: true,
198
+ cellRenderer: CellRenderer,
199
+ cellRendererParams: {
200
+ statusResolver: this._statusResolver
201
+ },
202
+ cellStyle: {
203
+ "text-align": "center"
204
+ }
177
205
  });
178
206
  }
179
207
  cols.forEach(c => {
@@ -189,7 +217,7 @@ export default class AgGridController {
189
217
  throw new Error("Erro interno: Grid ainda não inicializado.");
190
218
  }
191
219
  const colDef = this._gridOptions.columnApi.getAllColumns();
192
- return colDef.filter(c => c.getColId() !== "checkBoxColumn").map(c => {
220
+ return colDef.filter(c => ![this.CHECK_BOX_COL_ID, this.STATUS_COL_ID].includes(c.getColId())).map(c => {
193
221
  const def = c.getColDef();
194
222
  const colDef = { name: def.field, label: def.headerName };
195
223
  this.conditionalSet(colDef, "sortable", def.sortable);
@@ -258,7 +286,7 @@ export default class AgGridController {
258
286
  term,
259
287
  fields: this._gridOptions.columnApi
260
288
  .getColumns()
261
- .filter(col => col.isVisible() && ![this.CHECK_BOX_COL_ID, this.RECORD_ARCHIVE_COL_ID].includes(col.getColId()))
289
+ .filter(col => col.isVisible() && ![this.CHECK_BOX_COL_ID, this.STATUS_COL_ID, this.RECORD_ARCHIVE_COL_ID].includes(col.getColId()))
262
290
  .map(col => col.getColId())
263
291
  };
264
292
  this._dataSource.quickFilter = quickFilter;
@@ -290,11 +318,34 @@ export default class AgGridController {
290
318
  },
291
319
  valueFormatter: params => {
292
320
  return this.getFormatterByColumn(params, source);
293
- }
321
+ },
322
+ cellStyle: this.getStyleByColumn(source)
323
+ };
324
+ }
325
+ getInitCellStyle() {
326
+ return {
327
+ "line-height": (this.getRowHeight() - 1) + "px"
294
328
  };
295
329
  }
330
+ getStyleByColumn(source) {
331
+ let cellStyle = this.getInitCellStyle();
332
+ switch (source === null || source === void 0 ? void 0 : source.userInterface) {
333
+ case UserInterface.DECIMALNUMBER:
334
+ case UserInterface.INTEGERNUMBER:
335
+ cellStyle["text-align"] = "right";
336
+ break;
337
+ case UserInterface.DATE:
338
+ case UserInterface.DATETIME:
339
+ case UserInterface.TIME:
340
+ cellStyle["text-align"] = "center";
341
+ break;
342
+ default:
343
+ cellStyle["text-align"] = "left";
344
+ }
345
+ return cellStyle;
346
+ }
296
347
  getFormatterByColumn(params, source) {
297
- var _a, _b;
348
+ var _a;
298
349
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === "OPTIONSELECTOR" && source.options) {
299
350
  const prop = source === null || source === void 0 ? void 0 : source.options;
300
351
  let options;
@@ -322,8 +373,11 @@ export default class AgGridController {
322
373
  }
323
374
  }
324
375
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.SEARCH) {
325
- if (params.value != undefined) {
326
- return ((_a = params === null || params === void 0 ? void 0 : params.value) === null || _a === void 0 ? void 0 : _a.value) + " - " + ((_b = params === null || params === void 0 ? void 0 : params.value) === null || _b === void 0 ? void 0 : _b.label);
376
+ if (((_a = params === null || params === void 0 ? void 0 : params.value) === null || _a === void 0 ? void 0 : _a.value) != undefined) {
377
+ return params.value.value + " - " + params.value.label;
378
+ }
379
+ else {
380
+ return params === null || params === void 0 ? void 0 : params.value;
327
381
  }
328
382
  }
329
383
  if ((source === null || source === void 0 ? void 0 : source.userInterface) === UserInterface.DECIMALNUMBER) {
@@ -0,0 +1,31 @@
1
+ export class CellRenderer {
2
+ constructor() {
3
+ this._eGui = undefined;
4
+ }
5
+ init(params) {
6
+ this.renderStatus(params);
7
+ }
8
+ refresh(params) {
9
+ this.renderStatus(params);
10
+ return true;
11
+ }
12
+ destroy() {
13
+ this._eGui = undefined;
14
+ }
15
+ getGui() {
16
+ return this._eGui;
17
+ }
18
+ renderStatus(params) {
19
+ const statusResolver = params === null || params === void 0 ? void 0 : params.statusResolver;
20
+ if (statusResolver != undefined) {
21
+ const statusKey = Object.keys(statusResolver)[0];
22
+ const statusValues = statusResolver[statusKey];
23
+ const value = params === null || params === void 0 ? void 0 : params.data[statusKey];
24
+ const color = statusValues != undefined && value != undefined && statusValues[value];
25
+ this._eGui = document.createElement('div');
26
+ this._eGui.innerHTML = `
27
+ <span class="ez-grid__cell-status" style="background-color: ${color || ""};"></span>
28
+ `;
29
+ }
30
+ }
31
+ }
@@ -134,7 +134,8 @@ export class EzGrid {
134
134
  },
135
135
  allowMultipleSelection: this.multipleSelection,
136
136
  serverURL: this.serverUrl,
137
- dataUnit: this.dataUnit
137
+ dataUnit: this.dataUnit,
138
+ statusResolver: this.statusResolver
138
139
  });
139
140
  if (this.config) {
140
141
  this.observeConfig(this.config);
@@ -167,7 +168,7 @@ export class EzGrid {
167
168
  this._gridController.setColumnsState(config.columns);
168
169
  this.closeGridConfig();
169
170
  }
170
- closeGridConfig() {
171
+ async closeGridConfig() {
171
172
  this._popUpGridConfig = false;
172
173
  }
173
174
  async openGridConfig() {
@@ -267,7 +268,27 @@ export class EzGrid {
267
268
  "optional": false,
268
269
  "docs": {
269
270
  "tags": [],
270
- "text": ""
271
+ "text": "Reposit\u00F3rio de dados, controla a manipula\u00E7\u00E3o dos dados."
272
+ }
273
+ },
274
+ "statusResolver": {
275
+ "type": "unknown",
276
+ "mutable": false,
277
+ "complexType": {
278
+ "original": "IStatusResolver",
279
+ "resolved": "IStatusResolver",
280
+ "references": {
281
+ "IStatusResolver": {
282
+ "location": "import",
283
+ "path": "./controller/EzGridController"
284
+ }
285
+ }
286
+ },
287
+ "required": false,
288
+ "optional": false,
289
+ "docs": {
290
+ "tags": [],
291
+ "text": "Configura\u00E7\u00E3o do valor da coluna de status.\nExemplo: { \"RECDESP\": { \"-1\" : \"#BD0025\", \"1\" : \"#157A00\" } }"
271
292
  }
272
293
  }
273
294
  }; }
@@ -537,6 +558,22 @@ export class EzGrid {
537
558
  "tags": []
538
559
  }
539
560
  },
561
+ "closeGridConfig": {
562
+ "complexType": {
563
+ "signature": "() => Promise<void>",
564
+ "parameters": [],
565
+ "references": {
566
+ "Promise": {
567
+ "location": "global"
568
+ }
569
+ },
570
+ "return": "Promise<void>"
571
+ },
572
+ "docs": {
573
+ "text": "",
574
+ "tags": []
575
+ }
576
+ },
540
577
  "openGridConfig": {
541
578
  "complexType": {
542
579
  "signature": "() => Promise<void>",