@sankhyalabs/ezui 1.1.75 → 1.1.78

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 (195) hide show
  1. package/dist/cjs/ApplicationUtils-d1c1db56.js +35 -0
  2. package/dist/cjs/AssetsUtils-dd585fba.js +24 -0
  3. package/dist/cjs/CSSVarsUtils-66e86394.js +18 -0
  4. package/dist/cjs/DataUnit-fdd7c70e.js +474 -0
  5. package/dist/cjs/DateUtils-716769e0.js +46 -0
  6. package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-application.cjs.entry.js +26 -0
  8. package/dist/cjs/ez-button_11.cjs.entry.js +111771 -0
  9. package/dist/cjs/ez-calendar.cjs.entry.js +217 -0
  10. package/dist/cjs/ez-collapsible-box_6.cjs.entry.js +634 -0
  11. package/dist/cjs/ez-combo-box.cjs.entry.js +254 -0
  12. package/dist/cjs/ez-date-time-input.cjs.entry.js +133 -0
  13. package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-form.cjs.entry.js +1838 -0
  15. package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
  16. package/dist/cjs/ez-number-input.cjs.entry.js +36 -212
  17. package/dist/cjs/ez-popover.cjs.entry.js +3 -3
  18. package/dist/cjs/ez-popup.cjs.entry.js +2 -2
  19. package/dist/cjs/ez-time-input.cjs.entry.js +10 -9
  20. package/dist/cjs/ez-toast.cjs.entry.js +1 -1
  21. package/dist/cjs/ezui.cjs.js +3 -3
  22. package/dist/cjs/form-metadata.cjs.entry.js +129 -0
  23. package/dist/cjs/index-40ebb2be.js +7422 -0
  24. package/dist/cjs/{index-4d2896bb.js → index-4e4bae01.js} +3 -5
  25. package/dist/cjs/loader.cjs.js +3 -3
  26. package/dist/collection/collection-manifest.json +8 -3
  27. package/dist/collection/components/ez-application/ez-application.css +3 -0
  28. package/dist/collection/components/ez-application/ez-application.js +35 -0
  29. package/dist/collection/components/ez-button/ez-button.css +78 -44
  30. package/dist/collection/components/ez-button/ez-button.js +36 -4
  31. package/dist/collection/components/ez-calendar/ez-calendar.css +70 -3
  32. package/dist/collection/components/ez-calendar/ez-calendar.js +173 -24
  33. package/dist/collection/components/ez-check/ez-check.css +78 -78
  34. package/dist/collection/components/ez-check/ez-check.js +3 -3
  35. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +34 -34
  36. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +12 -12
  37. package/dist/collection/components/ez-combo-box/ez-combo-box.css +65 -54
  38. package/dist/collection/components/ez-combo-box/ez-combo-box.js +5 -0
  39. package/dist/collection/components/ez-date-input/ez-date-input.css +17 -3
  40. package/dist/collection/components/ez-date-input/ez-date-input.js +3 -3
  41. package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +44 -0
  42. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +243 -0
  43. package/dist/collection/components/ez-form/ez-form.js +37 -35
  44. package/dist/collection/components/ez-form/store/Form.actions.js +16 -16
  45. package/dist/collection/components/ez-form/store/Form.reducer.js +17 -17
  46. package/dist/collection/components/ez-form/subcomponents/DataUnit.js +11 -11
  47. package/dist/collection/components/ez-form/subcomponents/form-metadata.js +12 -12
  48. package/dist/collection/components/ez-form/subcomponents/place-holder.js +1 -1
  49. package/dist/collection/components/ez-form/subcomponents/structure/Field.js +21 -21
  50. package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +1 -1
  51. package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +9 -9
  52. package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +21 -0
  53. package/dist/collection/components/ez-grid/controller/EzGridController.js +1 -0
  54. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +203 -0
  55. package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +41 -0
  56. package/dist/collection/components/ez-grid/controller/ag-grid/i18n/pt-BR.js +75 -0
  57. package/dist/collection/components/ez-grid/controller/ag-grid/mock/Server.js +69 -0
  58. package/dist/collection/components/ez-grid/controller/ag-grid/template/HeaderColumnTemplate.js +12 -0
  59. package/dist/collection/components/ez-grid/ez-grid.css +15 -0
  60. package/dist/collection/components/ez-grid/ez-grid.js +414 -0
  61. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +105 -0
  62. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +354 -0
  63. package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +7 -0
  64. package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +66 -0
  65. package/dist/collection/components/ez-icon/ez-icon.css +1 -1
  66. package/dist/collection/components/ez-list/ez-list.css +227 -44
  67. package/dist/collection/components/ez-list/ez-list.js +529 -149
  68. package/dist/collection/components/ez-modal/ez-modal.css +4 -4
  69. package/dist/collection/components/ez-modal/ez-modal.js +1 -1
  70. package/dist/collection/components/ez-number-input/ez-number-input.css +1 -165
  71. package/dist/collection/components/ez-number-input/ez-number-input.js +53 -339
  72. package/dist/collection/components/ez-popover/ez-popover.css +10 -6
  73. package/dist/collection/components/ez-popup/ez-popup.css +25 -27
  74. package/dist/collection/components/ez-search/ez-search.js +6 -1
  75. package/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -1
  76. package/dist/collection/components/ez-tabselector/ez-tabselector.js +3 -3
  77. package/dist/collection/components/ez-text-area/ez-text-area.js +1 -0
  78. package/dist/collection/components/ez-text-input/ez-text-input.css +60 -60
  79. package/dist/collection/components/ez-text-input/ez-text-input.js +17 -16
  80. package/dist/collection/components/ez-time-input/ez-time-input.js +3 -2
  81. package/dist/collection/components/ez-upload/ez-upload.js +3 -3
  82. package/dist/collection/components/test-du/test-du.css +3 -0
  83. package/dist/collection/components/test-du/test-du.js +45 -0
  84. package/dist/collection/servidor.js +94 -94
  85. package/dist/collection/utils/{Application.js → ApplicationUtils.js} +4 -4
  86. package/dist/collection/utils/AssetsUtils.js +19 -0
  87. package/dist/collection/utils/CSSVarsUtils.js +6 -6
  88. package/dist/custom-elements/index.d.ts +36 -6
  89. package/dist/custom-elements/index.js +120886 -2964
  90. package/dist/esm/ApplicationUtils-01280a9d.js +33 -0
  91. package/dist/esm/AssetsUtils-3803e935.js +22 -0
  92. package/dist/esm/CSSVarsUtils-aeee9825.js +16 -0
  93. package/dist/esm/DataUnit-1cd45202.js +464 -0
  94. package/dist/esm/DateUtils-0a1bbd7a.js +44 -0
  95. package/dist/esm/ez-action-chip.entry.js +1 -1
  96. package/dist/esm/ez-application.entry.js +22 -0
  97. package/dist/esm/ez-button_11.entry.js +111757 -0
  98. package/dist/esm/ez-calendar.entry.js +213 -0
  99. package/dist/esm/ez-collapsible-box_6.entry.js +625 -0
  100. package/dist/esm/ez-combo-box.entry.js +250 -0
  101. package/dist/esm/ez-date-time-input.entry.js +129 -0
  102. package/dist/esm/ez-dialog.entry.js +1 -1
  103. package/dist/esm/ez-form.entry.js +1834 -0
  104. package/dist/esm/ez-label-chip.entry.js +1 -1
  105. package/dist/esm/ez-number-input.entry.js +36 -212
  106. package/dist/esm/ez-popover.entry.js +3 -3
  107. package/dist/esm/ez-popup.entry.js +2 -2
  108. package/dist/esm/ez-time-input.entry.js +5 -4
  109. package/dist/esm/ez-toast.entry.js +1 -1
  110. package/dist/esm/ezui.js +3 -3
  111. package/dist/esm/form-metadata.entry.js +125 -0
  112. package/dist/esm/{index-33153059.js → index-1dacecd3.js} +3 -6
  113. package/dist/esm/index-ca8700cb.js +7414 -0
  114. package/dist/esm/loader.js +3 -3
  115. package/dist/ezui/ezui.esm.js +1 -1
  116. package/dist/ezui/p-14bee38e.entry.js +1 -0
  117. package/dist/ezui/p-37a611ea.js +1 -0
  118. package/dist/ezui/p-3a09c678.entry.js +1 -0
  119. package/dist/ezui/p-43c15c94.entry.js +1 -0
  120. package/dist/ezui/{p-34d288d0.entry.js → p-516d0e0f.entry.js} +1 -1
  121. package/dist/ezui/{p-0d476efb.entry.js → p-5a86e18a.entry.js} +1 -1
  122. package/dist/ezui/{p-47406a6e.entry.js → p-5da66d3e.entry.js} +1 -1
  123. package/dist/ezui/p-7107d7ef.js +1 -0
  124. package/dist/ezui/p-72ff3c95.entry.js +1 -0
  125. package/dist/ezui/p-74f978db.entry.js +369 -0
  126. package/dist/ezui/p-88f45a83.entry.js +1 -0
  127. package/dist/ezui/p-8b099482.js +1 -0
  128. package/dist/ezui/p-8d6cdd3e.entry.js +1 -0
  129. package/dist/ezui/p-8f4851a6.js +1 -0
  130. package/dist/ezui/p-9dfd537e.js +1 -0
  131. package/dist/ezui/p-a0331955.entry.js +1 -0
  132. package/dist/ezui/p-a15093e3.entry.js +1 -0
  133. package/dist/ezui/{p-8818da66.entry.js → p-a18a2d7b.entry.js} +1 -1
  134. package/dist/ezui/p-a19f2af3.entry.js +1 -0
  135. package/dist/ezui/p-c6d469fc.entry.js +1 -0
  136. package/dist/ezui/p-c89629eb.js +1 -0
  137. package/dist/ezui/p-da929c01.js +1 -0
  138. package/dist/ezui/p-f3c5f27e.entry.js +1 -0
  139. package/dist/types/components/ez-application/ez-application.d.ts +10 -0
  140. package/dist/types/components/ez-button/ez-button.d.ts +5 -0
  141. package/dist/types/components/ez-calendar/ez-calendar.d.ts +21 -0
  142. package/dist/types/components/ez-check/ez-check.d.ts +1 -1
  143. package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +3 -3
  144. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -0
  145. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +42 -0
  146. package/dist/types/components/ez-form/ez-form.d.ts +9 -9
  147. package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +1 -1
  148. package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +1 -1
  149. package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +8 -0
  150. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +195 -0
  151. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +34 -0
  152. package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +11 -0
  153. package/dist/types/components/ez-grid/controller/ag-grid/i18n/pt-BR.d.ts +2 -0
  154. package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +8 -0
  155. package/dist/types/components/ez-grid/ez-grid.d.ts +78 -0
  156. package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +30 -0
  157. package/dist/types/components/ez-grid/subcomponents/select-box/select-box.d.ts +9 -0
  158. package/dist/types/components/ez-list/ez-list.d.ts +70 -17
  159. package/dist/types/components/ez-number-input/ez-number-input.d.ts +29 -63
  160. package/dist/types/components/ez-search/ez-search.d.ts +2 -0
  161. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +1 -1
  162. package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -1
  163. package/dist/types/components/test-du/test-du.d.ts +6 -0
  164. package/dist/types/components.d.ts +289 -139
  165. package/dist/types/stencil-public-runtime.d.ts +6 -4
  166. package/dist/types/utils/{Application.d.ts → ApplicationUtils.d.ts} +1 -1
  167. package/dist/types/utils/AssetsUtils.d.ts +1 -0
  168. package/dist/types/utils/CSSVarsUtils.d.ts +1 -1
  169. package/package.json +10 -8
  170. package/react/components.d.ts +6 -1
  171. package/react/components.js +6 -1
  172. package/react/components.js.map +1 -1
  173. package/dist/cjs/CSSVarsUtils-f8827674.js +0 -18
  174. package/dist/cjs/RequestMetadata-2cd01e8a.js +0 -531
  175. package/dist/cjs/ez-button_16.cjs.entry.js +0 -4071
  176. package/dist/cjs/ez-list.cjs.entry.js +0 -174
  177. package/dist/cjs/ez-modal.cjs.entry.js +0 -65
  178. package/dist/collection/components/ez-numeric-input/ez-numeric-input.css +0 -13
  179. package/dist/collection/components/ez-numeric-input/ez-numeric-input.js +0 -185
  180. package/dist/esm/CSSVarsUtils-e0128b01.js +0 -16
  181. package/dist/esm/RequestMetadata-c265c9d5.js +0 -527
  182. package/dist/esm/ez-button_16.entry.js +0 -4052
  183. package/dist/esm/ez-list.entry.js +0 -170
  184. package/dist/esm/ez-modal.entry.js +0 -61
  185. package/dist/ezui/p-061d21ba.entry.js +0 -1
  186. package/dist/ezui/p-15743b09.entry.js +0 -1
  187. package/dist/ezui/p-46d07e59.entry.js +0 -1
  188. package/dist/ezui/p-4df6f855.js +0 -1
  189. package/dist/ezui/p-50464bdf.entry.js +0 -1
  190. package/dist/ezui/p-67410dfa.entry.js +0 -1
  191. package/dist/ezui/p-7be54779.entry.js +0 -1
  192. package/dist/ezui/p-7f3bc6d9.entry.js +0 -1
  193. package/dist/ezui/p-9dfccb16.js +0 -1
  194. package/dist/ezui/p-d1889704.js +0 -1
  195. package/dist/types/components/ez-numeric-input/ez-numeric-input.d.ts +0 -45
@@ -1,237 +1,57 @@
1
- import { Component, h, Host, Prop, Watch, Method, Element, Event } from '@stencil/core';
2
- import { NumberUtils } from '@sankhyalabs/core';
3
- export class NumberInput {
1
+ import { NumberUtils } from "@sankhyalabs/core";
2
+ import { Component, h, Event, Prop, Watch, Element } from "@stencil/core";
3
+ import CSSVarsUtils from "../../utils/CSSVarsUtils";
4
+ export class EzNumberInput {
4
5
  constructor() {
5
6
  /**
6
- * Deixa o campo disponível ou não para digitação.
7
+ * Deixa o campo disponível ou não para uso.
7
8
  */
8
9
  this.enabled = true;
9
- /**
10
- * Deixa o campo disponível ou não para digitação.
11
- */
12
- this.textleft = false;
13
- /**
14
- * Opção de configurar a transformação de string to number entre formatação pt-BR e en-US
15
- * (formatação de ENTRADA e SAÍDA do componente: pt-BR="###.###,##" en-US="###,###.##"; Default: "pt-BR")
16
- * Qualquer outro valor que não seja "en-US", adotará a formatação "pt-BR"
17
- * Não é case sensitive
18
- */
19
- this.formatnumber = "PT-BR";
20
- //---------------------------------------------
21
- // Private Methods
22
- //---------------------------------------------
23
- this.settingStrValueIntNumber = (strvalue) => {
24
- if (this.precision === 0 && strvalue) {
25
- return strvalue = strvalue.replace(/\./g, '').replace(/\,/g, '');
26
- }
27
- else {
28
- return strvalue;
29
- }
30
- };
31
- this.checkNumberValidation = (valuePtBRorNumber) => {
32
- try {
33
- if (valuePtBRorNumber != "" && NumberUtils.format(valuePtBRorNumber, this.precision, this.prettyprecision) === "NaN") {
34
- this.errorMessage = `Valor não é um número válido`;
35
- this.value = undefined;
36
- this.strvalue = undefined;
37
- if (this._inputElem) {
38
- this._inputElem.value = "";
39
- }
40
- return false;
41
- }
42
- }
43
- catch (err) {
44
- this.errorMessage = err.message;
45
- return false;
46
- }
47
- return true;
48
- };
49
- }
50
- showError() {
51
- const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
52
- if (this._inputElem) {
53
- if (hasError) {
54
- this._inputElem.classList.add('hasError');
55
- this._messageBoxElem.classList.add('hasError');
56
- }
57
- else {
58
- this._inputElem.classList.remove('hasError');
59
- this._messageBoxElem.classList.remove('hasError');
60
- }
61
- }
62
- }
63
- onPrecisionChanged(newPrecision) {
64
- if (isNaN(newPrecision)) {
65
- this.precision = 0;
66
- }
67
- this.handleFocusout();
68
10
  }
69
- onPrettyPrecisionChanged(newPrettyPrecision) {
70
- if (isNaN(newPrettyPrecision)) {
71
- this.prettyprecision = 0;
72
- }
73
- this.handleFocusout();
11
+ setLabel() {
12
+ this._textInput.label = this.label;
74
13
  }
75
- onValueChanged(newValue) {
76
- if (isNaN(newValue) && newValue !== undefined) {
77
- this.value = undefined;
78
- this.strvalue = "";
79
- this.errorMessage = `Valor não é um número válido`;
80
- this.adjustFloatingLabel();
81
- }
82
- else {
83
- this.settingComponent();
84
- }
14
+ setErrorMessage() {
15
+ this._textInput.errorMessage = this.errorMessage;
85
16
  }
86
- adjustFloatingLabel() {
87
- if (this._labelElem) {
88
- if (this.label && this._inputElem.value && this._inputElem.value.toString().length > 0) {
89
- if (!this._labelElem.classList.contains("input__label--floated")) {
90
- this._labelElem.classList.add("input__label--floated");
91
- }
92
- if (!this._inputElem.classList.contains("input--with--label")) {
93
- this._inputElem.classList.add("input--with--label");
94
- }
95
- }
96
- else {
97
- this._labelElem.classList.remove("input__label--floated");
98
- }
17
+ applyValueToInput() {
18
+ if (this._textInput) {
19
+ this._textInput.value = this.getTextValue(this.value);
99
20
  }
100
21
  }
101
- //---------------------------------------------
102
- // Public methods
103
- //---------------------------------------------
104
- /**
105
- * Faz o foco no componente de input
106
- */
107
- async setFocus() {
108
- this._inputElem.focus();
109
- }
110
- /**
111
- * Remove o foco no componente de input
112
- */
113
- async setBlur() {
114
- this._inputElem.blur();
115
- }
116
- //---------------------------------------------
117
- // Event handlers
118
- //---------------------------------------------
119
- /**
120
- * Promove a atualização do componente
121
- */
122
- async handleFocusout() {
123
- //Setting value and strvalue by stringinput
124
- if (this._inputElem) {
125
- this.errorMessage = "";
126
- if (this._inputElem.value !== "") {
127
- this._inputElem.value = this.settingStrValueIntNumber(this._inputElem.value);
128
- const value = NumberUtils.keepOnlyDecimalSeparator(this._inputElem.value, this.formatnumber.toUpperCase());
129
- if (!this.checkNumberValidation(value)) {
130
- return;
131
- }
132
- if (value) {
133
- try {
134
- this._inputElem.value = this.formatnumber.toUpperCase() !== "EN-US" ? NumberUtils.format(value, this.precision, this.prettyprecision) : NumberUtils.changeFormat(NumberUtils.format(value, this.precision, this.prettyprecision));
135
- }
136
- catch (e) {
137
- this.errorMessage = e.message;
138
- return;
139
- }
140
- }
141
- this.strvalue = this._inputElem.value;
142
- this.value = NumberUtils.stringToNumber(value);
143
- }
144
- else {
145
- this.strvalue = undefined;
146
- this.value = undefined;
147
- }
148
- this.adjustFloatingLabel();
22
+ changeValue(newValue) {
23
+ this.errorMessage = "";
24
+ if (newValue && newValue !== this.value) {
25
+ this.value = newValue;
26
+ this.ezChange.emit(this.value);
149
27
  }
150
28
  }
151
- handleChange() {
152
- this._inputElem.value = this.settingStrValueIntNumber(this._inputElem.value);
153
- }
154
- handleSlotChange(ev) {
155
- const slot = ev.target;
156
- const content = slot.assignedElements()[0];
157
- content.style.position = "absolute";
158
- content.style.display = "flex";
159
- content.style.alignItems = "center";
160
- content.style.justifyContent = "center";
161
- content.style.overflow = "hidden";
162
- content.style.top = "0px";
163
- content.style.width = "var(--ni__icon--width)";
164
- content.style.height = "var(--ni--height)";
165
- if (slot.name == "leftIcon") {
166
- content.style.left = "0px";
167
- content.style.borderRadius = "var(--ni--border-radius) 0 0 var(--ni--border-radius)";
168
- this._inputElem.classList.add('icon--left');
169
- if (this._labelElem) {
170
- this._labelElem.classList.add("input__label--left");
171
- }
172
- }
173
- else if (slot.name == "rightIcon") {
174
- content.style.right = "0px";
175
- content.style.borderRadius = "0 var(--ni--border-radius) var(--ni--border-radius) 0";
176
- this._inputElem.classList.add('icon--right');
29
+ parseNumber() {
30
+ const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : null;
31
+ if (parsedNumber != null && isNaN(parsedNumber)) {
32
+ this.errorMessage = "O valor digitado não é um número válido";
177
33
  }
178
- this.showError();
179
- }
180
- doFocus() {
181
- if (this.label && this._labelElem) {
182
- this._labelElem.classList.contains("input__label--floated") ? undefined : this._labelElem.classList.add("input__label--floated");
183
- }
184
- }
185
- settingComponent() {
186
- const value = '' + this.value;
187
- if (this.value !== undefined) {
34
+ else {
188
35
  try {
189
- this._inputElem.value = this.formatnumber.toUpperCase() !== "EN-US" ? NumberUtils.format(value, this.precision, this.prettyprecision) : NumberUtils.changeFormat(NumberUtils.format(value, this.precision, this.prettyprecision));
36
+ this.changeValue(parsedNumber);
190
37
  }
191
38
  catch (e) {
192
39
  this.errorMessage = e.message;
193
40
  return;
194
41
  }
195
- this.strvalue = this._inputElem.value;
196
42
  }
197
- this.ezChange.emit({ strValue: this.strvalue, value: this.value });
198
- this.adjustFloatingLabel();
199
43
  }
200
- settingValue() {
201
- //this.value: en-US format => Need to convert
202
- const value = !isNaN(this.value) ? '' + this.value : 'NaN';
203
- if (!this.checkNumberValidation(value)) {
204
- return;
44
+ getTextValue(value) {
45
+ if (value) {
46
+ return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
205
47
  }
206
- //output default from ".format": pt-BR
207
- const tempStrValue = NumberUtils.format(value, this.precision, this.prettyprecision);
208
- //output => depends to formatnumber
209
- this.strvalue = this.formatnumber.toUpperCase() !== 'EN-US' ? tempStrValue : NumberUtils.changeFormat(tempStrValue);
210
- NumberUtils.format(this.value.toString(), this.precision, this.prettyprecision);
48
+ return null;
211
49
  }
212
- //---------------------------------------------
213
- // Lifecycle web component
214
- //---------------------------------------------
215
50
  componentDidLoad() {
216
- if (!this.textleft) {
217
- this._inputElem.classList.add('text--right');
218
- }
219
- this.showError();
220
- this.adjustFloatingLabel();
221
- }
222
- componentWillLoad() {
223
- this.onPrecisionChanged(this.precision);
224
- this.onPrettyPrecisionChanged(this.prettyprecision);
225
- this.settingValue();
51
+ CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
226
52
  }
227
53
  render() {
228
- const labelInput = this.label ? h("label", { onClick: () => this._inputElem.focus(), class: "input__label", ref: (el) => this._labelElem = el }, this.label) : null;
229
- return (h(Host, null,
230
- h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
231
- labelInput,
232
- h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.strvalue, disabled: !this.enabled, onInput: this.handleChange.bind(this), onFocusout: this.handleFocusout.bind(this) }),
233
- h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
234
- h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el }, this.errorMessage)));
54
+ return (h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage }));
235
55
  }
236
56
  static get is() { return "ez-number-input"; }
237
57
  static get encapsulation() { return "shadow"; }
@@ -242,9 +62,9 @@ export class NumberInput {
242
62
  "$": ["ez-number-input.css"]
243
63
  }; }
244
64
  static get properties() { return {
245
- "strvalue": {
65
+ "label": {
246
66
  "type": "string",
247
- "mutable": true,
67
+ "mutable": false,
248
68
  "complexType": {
249
69
  "original": "string",
250
70
  "resolved": "string",
@@ -254,9 +74,9 @@ export class NumberInput {
254
74
  "optional": false,
255
75
  "docs": {
256
76
  "tags": [],
257
- "text": "Valor digitado pelo usu\u00E1rio. Este valor \u00E9 o que fica vis\u00EDvel no campo."
77
+ "text": "T\u00EDtulo do campo"
258
78
  },
259
- "attribute": "strvalue",
79
+ "attribute": "label",
260
80
  "reflect": false
261
81
  },
262
82
  "value": {
@@ -271,26 +91,9 @@ export class NumberInput {
271
91
  "optional": false,
272
92
  "docs": {
273
93
  "tags": [],
274
- "text": "Valor guardado pelo componente. Este valor \u00E9 o que ira ser utilizado para alimentar o backend.\nEsta vari\u00E1vel pode ser setada para alimentar o componente."
94
+ "text": "O valor informado pelo usu\u00E1rio"
275
95
  },
276
96
  "attribute": "value",
277
- "reflect": false
278
- },
279
- "label": {
280
- "type": "string",
281
- "mutable": false,
282
- "complexType": {
283
- "original": "string",
284
- "resolved": "string",
285
- "references": {}
286
- },
287
- "required": false,
288
- "optional": false,
289
- "docs": {
290
- "tags": [],
291
- "text": "Label \u00E9 o t\u00EDtulo do campo"
292
- },
293
- "attribute": "label",
294
97
  "reflect": true
295
98
  },
296
99
  "enabled": {
@@ -305,10 +108,10 @@ export class NumberInput {
305
108
  "optional": false,
306
109
  "docs": {
307
110
  "tags": [],
308
- "text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para digita\u00E7\u00E3o."
111
+ "text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para uso."
309
112
  },
310
113
  "attribute": "enabled",
311
- "reflect": true,
114
+ "reflect": false,
312
115
  "defaultValue": "true"
313
116
  },
314
117
  "errorMessage": {
@@ -330,7 +133,7 @@ export class NumberInput {
330
133
  },
331
134
  "precision": {
332
135
  "type": "number",
333
- "mutable": true,
136
+ "mutable": false,
334
137
  "complexType": {
335
138
  "original": "number",
336
139
  "resolved": "number",
@@ -340,14 +143,14 @@ export class NumberInput {
340
143
  "optional": false,
341
144
  "docs": {
342
145
  "tags": [],
343
- "text": "Precis\u00E3o de arredondamento do n\u00FAmero"
146
+ "text": "Precis\u00E3o decimal, ou seja, quantas casas decimais podem ser exibidas. Caso a\nquantidade de casas decimais do valor seja maior que precision, haver\u00E1 arredondamento"
344
147
  },
345
148
  "attribute": "precision",
346
- "reflect": true
149
+ "reflect": false
347
150
  },
348
- "prettyprecision": {
151
+ "prettyPrecision": {
349
152
  "type": "number",
350
- "mutable": true,
153
+ "mutable": false,
351
154
  "complexType": {
352
155
  "original": "number",
353
156
  "resolved": "number",
@@ -357,46 +160,10 @@ export class NumberInput {
357
160
  "optional": false,
358
161
  "docs": {
359
162
  "tags": [],
360
- "text": "N\u00FAmeros de zeros retirados ap\u00F3s arredondamento"
361
- },
362
- "attribute": "prettyprecision",
363
- "reflect": true
364
- },
365
- "textleft": {
366
- "type": "boolean",
367
- "mutable": false,
368
- "complexType": {
369
- "original": "boolean",
370
- "resolved": "boolean",
371
- "references": {}
372
- },
373
- "required": false,
374
- "optional": false,
375
- "docs": {
376
- "tags": [],
377
- "text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para digita\u00E7\u00E3o."
378
- },
379
- "attribute": "textleft",
380
- "reflect": true,
381
- "defaultValue": "false"
382
- },
383
- "formatnumber": {
384
- "type": "string",
385
- "mutable": false,
386
- "complexType": {
387
- "original": "string",
388
- "resolved": "string",
389
- "references": {}
390
- },
391
- "required": false,
392
- "optional": false,
393
- "docs": {
394
- "tags": [],
395
- "text": "Op\u00E7\u00E3o de configurar a transforma\u00E7\u00E3o de string to number entre formata\u00E7\u00E3o pt-BR e en-US\n(formata\u00E7\u00E3o de ENTRADA e SA\u00CDDA do componente: pt-BR=\"###.###,##\" en-US=\"###,###.##\"; Default: \"pt-BR\")\nQualquer outro valor que n\u00E3o seja \"en-US\", adotar\u00E1 a formata\u00E7\u00E3o \"pt-BR\"\nN\u00E3o \u00E9 case sensitive"
163
+ "text": "Esse atributo determina qual \u00E9 o n\u00FAmero m\u00EDnimo de casas depois da v\u00EDrgula.\nExemplo: Digamos que a precision seja igual a 4, assim qualquer n\u00FAmero ser\u00E1 \nrepresentado com 4 casas decimais mesmo que iguais a zero: 1,0100.\nSe prettiprecision igual a 2, como n\u00E3o h\u00E1 necessidade de mais de duas casas decimais\no valor exibido ser\u00E1 1,01. Por outro lado, at\u00E9 a quarta casa n\u00E3o haver\u00E1 arredondamento\n(1,1234 = 1,1234) mas a partir da quinta casa sim (1,12345 = 1,1235)."
396
164
  },
397
- "attribute": "formatnumber",
398
- "reflect": true,
399
- "defaultValue": "\"PT-BR\""
165
+ "attribute": "pretty-precision",
166
+ "reflect": false
400
167
  }
401
168
  }; }
402
169
  static get events() { return [{
@@ -407,76 +174,23 @@ export class NumberInput {
407
174
  "composed": true,
408
175
  "docs": {
409
176
  "tags": [],
410
- "text": "Um evento disparado quando o estado do componente \u00E9 alterado (onEzChange)."
177
+ "text": "Evento disparado quando o estado do componente \u00E9 alterado (onEzChange)."
411
178
  },
412
179
  "complexType": {
413
- "original": "{ strValue: string, value: number }",
414
- "resolved": "{ strValue: string; value: number; }",
180
+ "original": "number",
181
+ "resolved": "number",
415
182
  "references": {}
416
183
  }
417
184
  }]; }
418
- static get methods() { return {
419
- "setFocus": {
420
- "complexType": {
421
- "signature": "() => Promise<void>",
422
- "parameters": [],
423
- "references": {
424
- "Promise": {
425
- "location": "global"
426
- }
427
- },
428
- "return": "Promise<void>"
429
- },
430
- "docs": {
431
- "text": "Faz o foco no componente de input",
432
- "tags": []
433
- }
434
- },
435
- "setBlur": {
436
- "complexType": {
437
- "signature": "() => Promise<void>",
438
- "parameters": [],
439
- "references": {
440
- "Promise": {
441
- "location": "global"
442
- }
443
- },
444
- "return": "Promise<void>"
445
- },
446
- "docs": {
447
- "text": "Remove o foco no componente de input",
448
- "tags": []
449
- }
450
- },
451
- "handleFocusout": {
452
- "complexType": {
453
- "signature": "() => Promise<void>",
454
- "parameters": [],
455
- "references": {
456
- "Promise": {
457
- "location": "global"
458
- }
459
- },
460
- "return": "Promise<void>"
461
- },
462
- "docs": {
463
- "text": "Promove a atualiza\u00E7\u00E3o do componente",
464
- "tags": []
465
- }
466
- }
467
- }; }
468
- static get elementRef() { return "el"; }
185
+ static get elementRef() { return "_elem"; }
469
186
  static get watchers() { return [{
470
- "propName": "errorMessage",
471
- "methodName": "showError"
472
- }, {
473
- "propName": "precision",
474
- "methodName": "onPrecisionChanged"
187
+ "propName": "label",
188
+ "methodName": "setLabel"
475
189
  }, {
476
- "propName": "prettyprecision",
477
- "methodName": "onPrettyPrecisionChanged"
190
+ "propName": "errorMessage",
191
+ "methodName": "setErrorMessage"
478
192
  }, {
479
193
  "propName": "value",
480
- "methodName": "onValueChanged"
194
+ "methodName": "applyValueToInput"
481
195
  }]; }
482
196
  }
@@ -2,9 +2,13 @@
2
2
 
3
3
  /* box */
4
4
  /*@doc Define o raio da borda do popover.*/
5
- --popover__box--border-radius: var(--border--radius-medium, 12px);
5
+ --ez-popover__box--border-radius: var(--border--radius-medium, 12px);
6
6
  /*@doc Define a sombra do popover.*/
7
- --popover__box--box-shadow: var(--shadow, 0px 0px 16px 0px #000);
7
+ --ez-popover__box--box-shadow: var(--shadow, 0px 0px 16px 0px #000);
8
+ /*@doc Define a cor de fundo do popover.*/
9
+ --ez-popover__box--background-color: var(--background--xlight, #fff);
10
+ /*@doc Define a camada de visibilidade do popover.*/
11
+ --ez-popover__box--z-index: var(--more-visible, 1);
8
12
 
9
13
  /***************
10
14
  host style
@@ -19,16 +23,16 @@
19
23
 
20
24
  .box {
21
25
  /*private*/
22
- z-index: var(--more-visible, 1);
26
+ z-index: var(--ez-popover__box--z-index);
23
27
  display: flex;
24
28
  flex-direction: column;
25
29
 
26
30
  height: fit-content;
27
31
 
28
32
  /*public*/
29
- background-color: var(--background--xlight);
30
- border-radius: var(--popover__box--border-radius);
31
- box-shadow: var(--popover__box--box-shadow);
33
+ background-color: var(--ez-popover__box--background-color);
34
+ border-radius: var(--ez-popover__box--border-radius);
35
+ box-shadow: var(--ez-popover__box--box-shadow);
32
36
  }
33
37
 
34
38
  .box--fit-content {
@@ -2,33 +2,33 @@
2
2
  display: flex;
3
3
  /* General */
4
4
  /*@doc Define a camada em que o componente será exibido.*/
5
- --popup-z-index: var(--most-visible, 3);
5
+ --ez-popup-z-index: var(--most-visible, 3);
6
6
 
7
7
  /* Popup */
8
8
  /*@doc Define a cor do texto do container do popup.*/
9
- --popup__container--color: var(--title--primary, #2b3a54);
9
+ --ez-popup__container--color: var(--title--primary, #2b3a54);
10
10
  /*@doc Define o espaçamento do container do popup.*/
11
- --popup__container--padding: var(--space--large, 24px);
11
+ --ez-popup__container--padding: var(--space--large, 24px);
12
12
 
13
13
  /* Popup Header */
14
14
  /*@doc Define o espaçamento inferior do cabeçalho do popup.*/
15
- --popup__header--padding-bottom: var(--space--medium, 12px);
15
+ --ez-popup__header--padding-bottom: var(--space--medium, 12px);
16
16
 
17
17
  /* Title */
18
18
  /*@doc Define a família da fonte do título do popup.*/
19
- --popup__title--font-family: var(--font-pattern, "'Sora', 'Algerian'");
19
+ --ez-popup__title--font-family: var(--font-pattern, "'Sora', 'Algerian'");
20
20
  /*@doc Define o tamanho da fonte do título do popup.*/
21
- --popup__title--font-size: var(--title--extra-large, 24px);
21
+ --ez-popup__title--font-size: var(--title--extra-large, 24px);
22
22
  /*@doc Define a cor da fonte do título do popup.*/
23
- --popup__title--color: var(--title--primary, #2b3a54);
23
+ --ez-popup__title--color: var(--title--primary, #2b3a54);
24
24
  /*@doc Define o peso da fonte do título do popup.*/
25
- --popup__title--font-weight: var(--text-weight--large, 600);
25
+ --ez-popup__title--font-weight: var(--text-weight--large, 600);
26
26
 
27
27
  /* Buttons */
28
28
  /* @doc Define a cor do ícone do botão de fechamento. */
29
- --popup__btn__close--icon-color: var(--title--primary, #2b3a54);
29
+ --ez-popup__btn__close--icon-color: var(--title--primary, #2b3a54);
30
30
  /* @doc Contém o ícone do botão de fechamento. */
31
- --popup__btn__close--icon: url('data:image/svg+xml;utf8,<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z"/></svg>');
31
+ --ez-popup__btn__close--icon: url('data:image/svg+xml;utf8,<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z"/></svg>');
32
32
 
33
33
  }
34
34
 
@@ -36,7 +36,7 @@
36
36
  position: fixed;
37
37
  display: flex;
38
38
  top: 0px;
39
- z-index: var(--popup-z-index);
39
+ z-index: var(--ez-popup-z-index);
40
40
  left: 0px;
41
41
  width: 100%;
42
42
  align-items: center;
@@ -58,37 +58,35 @@
58
58
  .popup__container {
59
59
  width: 100%;
60
60
  max-height: 90%;
61
+ height: 100%;
61
62
  display: flex;
62
63
  flex-wrap: wrap;
63
64
  overflow: hidden;
64
65
  background: #FFFF;
65
- color: var(--popup__container--color);
66
+ color: var(--ez-popup__container--color);
66
67
  border-radius: 12px;
67
68
  box-shadow: 0px 0px 16px rgba(0, 38, 111, 0.122);
68
69
  box-sizing: border-box;
69
- padding: var(--popup__container--padding)
70
+ padding: var(--ez-popup__container--padding)
70
71
  }
71
72
 
72
73
  .popup__content {
73
74
  box-sizing: border-box;
74
75
  max-height: 100%;
75
76
  width: 100%;
76
- display: flex;
77
- flex-wrap: wrap;
77
+ display: grid;
78
+ grid-template-rows: auto 1fr;
78
79
  }
79
80
 
80
81
  .popup__expandable-content {
81
82
  box-sizing: border-box;
82
83
  overflow-y: auto;
84
+ height: 100%;
83
85
  width: 100%;
84
- display: flex;
85
- flex-wrap: wrap;
86
- max-height: 80vh;
87
- content-visibility: auto;
88
86
  }
89
87
 
90
88
  .popup__header {
91
- padding-bottom: var(--popup__header--padding-bottom);
89
+ padding-bottom: var(--ez-popup__header--padding-bottom);
92
90
  width: 100%;
93
91
  display: flex;
94
92
  }
@@ -97,10 +95,10 @@
97
95
  display: flex;
98
96
  margin: 0;
99
97
  width: 100%;
100
- font-family: var(--popup__title--font-family);
101
- font-size: var(--popup__title--font-size);
102
- font-weight: var(--popup__title--font-weight);
103
- color: var(--popup__title--color);
98
+ font-family: var(--ez-popup__title--font-family);
99
+ font-size: var(--ez-popup__title--font-size);
100
+ font-weight: var(--ez-popup__title--font-weight);
101
+ color: var(--ez-popup__title--color);
104
102
  line-height: 1.3;
105
103
  }
106
104
 
@@ -118,11 +116,11 @@
118
116
  .btn-close::after {
119
117
  content: '';
120
118
  display: flex;
121
- background-color: var(--popup__btn__close--icon-color);
119
+ background-color: var(--ez-popup__btn__close--icon-color);
122
120
  width: 14px;
123
121
  height: 14px;
124
- -webkit-mask-image: var(--popup__btn__close--icon);
125
- mask-image: var(--popup__btn__close--icon);
122
+ -webkit-mask-image: var(--ez-popup__btn__close--icon);
123
+ mask-image: var(--ez-popup__btn__close--icon);
126
124
  }
127
125
 
128
126
  .btn-close--solo {