@sankhyalabs/ezui 1.1.76 → 1.1.77
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.
- package/dist/cjs/ApplicationUtils-d1c1db56.js +35 -0
- package/dist/cjs/AssetsUtils-dd585fba.js +24 -0
- package/dist/cjs/DataUnit-fdd7c70e.js +474 -0
- package/dist/cjs/DateUtils-716769e0.js +46 -0
- package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-application.cjs.entry.js +28 -0
- package/dist/cjs/ez-button_11.cjs.entry.js +111771 -0
- package/dist/cjs/ez-calendar.cjs.entry.js +212 -0
- package/dist/cjs/ez-collapsible-box_6.cjs.entry.js +630 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +250 -0
- package/dist/cjs/ez-date-time-input.cjs.entry.js +144 -0
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +1838 -0
- package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +61 -190
- package/dist/cjs/ez-popover.cjs.entry.js +3 -3
- package/dist/cjs/ez-popup.cjs.entry.js +2 -2
- package/dist/cjs/ez-time-input.cjs.entry.js +9 -27
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +3 -3
- package/dist/cjs/form-metadata.cjs.entry.js +129 -0
- package/dist/cjs/index-262d703b.js +7442 -0
- package/dist/cjs/{index-9431aeeb.js → index-4e4bae01.js} +1 -5
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +8 -3
- package/dist/collection/components/ez-application/ez-application.css +3 -0
- package/dist/collection/components/ez-application/ez-application.js +37 -0
- package/dist/collection/components/ez-button/ez-button.css +16 -1
- package/dist/collection/components/ez-button/ez-button.js +27 -2
- package/dist/collection/components/ez-calendar/ez-calendar.css +70 -3
- package/dist/collection/components/ez-calendar/ez-calendar.js +168 -24
- package/dist/collection/components/ez-check/ez-check.css +78 -78
- package/dist/collection/components/ez-check/ez-check.js +3 -3
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +67 -51
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +1 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.css +49 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +254 -0
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +4 -4
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +1 -1
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +2 -2
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +21 -0
- package/dist/collection/components/ez-grid/controller/EzGridController.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +203 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +41 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/i18n/pt-BR.js +75 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/mock/Server.js +69 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/template/HeaderColumnTemplate.js +12 -0
- package/dist/collection/components/ez-grid/ez-grid.css +15 -0
- package/dist/collection/components/ez-grid/ez-grid.js +414 -0
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +105 -0
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +354 -0
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +7 -0
- package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +66 -0
- package/dist/collection/components/ez-icon/ez-icon.css +1 -1
- package/dist/collection/components/ez-list/ez-list.css +227 -44
- package/dist/collection/components/ez-list/ez-list.js +529 -149
- package/dist/collection/components/ez-modal/ez-modal.css +4 -4
- package/dist/collection/components/ez-modal/ez-modal.js +1 -1
- package/dist/collection/components/ez-number-input/ez-number-input.css +7 -162
- package/dist/collection/components/ez-number-input/ez-number-input.js +90 -281
- package/dist/collection/components/ez-popover/ez-popover.css +10 -6
- package/dist/collection/components/ez-popup/ez-popup.css +25 -27
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +0 -1
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +3 -3
- package/dist/collection/components/ez-text-area/ez-text-area.js +1 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js +1 -0
- package/dist/collection/components/ez-upload/ez-upload.js +3 -3
- package/dist/collection/components/test-du/test-du.css +3 -0
- package/dist/collection/components/test-du/test-du.js +45 -0
- package/dist/collection/servidor.js +94 -94
- package/dist/collection/utils/{Application.js → ApplicationUtils.js} +4 -4
- package/dist/custom-elements/index.d.ts +36 -6
- package/dist/custom-elements/index.js +120975 -3013
- package/dist/esm/ApplicationUtils-01280a9d.js +33 -0
- package/dist/esm/AssetsUtils-3803e935.js +22 -0
- package/dist/esm/DataUnit-1cd45202.js +464 -0
- package/dist/esm/DateUtils-0a1bbd7a.js +44 -0
- package/dist/esm/ez-action-chip.entry.js +1 -1
- package/dist/esm/ez-application.entry.js +24 -0
- package/dist/esm/ez-button_11.entry.js +111757 -0
- package/dist/esm/ez-calendar.entry.js +208 -0
- package/dist/esm/ez-collapsible-box_6.entry.js +621 -0
- package/dist/esm/ez-combo-box.entry.js +246 -0
- package/dist/esm/ez-date-time-input.entry.js +140 -0
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +1834 -0
- package/dist/esm/ez-label-chip.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +61 -190
- package/dist/esm/ez-popover.entry.js +3 -3
- package/dist/esm/ez-popup.entry.js +2 -2
- package/dist/esm/ez-time-input.entry.js +3 -21
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ezui.js +3 -3
- package/dist/esm/form-metadata.entry.js +125 -0
- package/dist/esm/{index-fd3c8023.js → index-1dacecd3.js} +1 -5
- package/dist/esm/index-cfd5e193.js +7433 -0
- package/dist/esm/loader.js +3 -3
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-1ea8187e.entry.js +369 -0
- package/dist/ezui/p-37a611ea.js +1 -0
- package/dist/ezui/p-45689464.entry.js +1 -0
- package/dist/ezui/{p-a0b6eee2.entry.js → p-516d0e0f.entry.js} +1 -1
- package/dist/ezui/p-57291f97.entry.js +1 -0
- package/dist/ezui/{p-66954a04.entry.js → p-5a86e18a.entry.js} +1 -1
- package/dist/ezui/{p-823ff0a0.entry.js → p-5da66d3e.entry.js} +1 -1
- package/dist/ezui/p-69416bec.entry.js +1 -0
- package/dist/ezui/p-7107d7ef.js +1 -0
- package/dist/ezui/p-7ef97c5f.entry.js +1 -0
- package/dist/ezui/p-88f45a83.entry.js +1 -0
- package/dist/ezui/p-8c51a6aa.entry.js +1 -0
- package/dist/ezui/{p-e0ab3746.js → p-8f4851a6.js} +1 -1
- package/dist/ezui/p-9dfd537e.js +1 -0
- package/dist/ezui/{p-d443f020.entry.js → p-a18a2d7b.entry.js} +1 -1
- package/dist/ezui/p-a223eed8.entry.js +1 -0
- package/dist/ezui/p-b36308e7.js +1 -0
- package/dist/ezui/p-c0af195b.entry.js +1 -0
- package/dist/ezui/p-c6d469fc.entry.js +1 -0
- package/dist/ezui/p-c89629eb.js +1 -0
- package/dist/ezui/p-e7ee2836.entry.js +1 -0
- package/dist/ezui/p-f7b835cf.entry.js +1 -0
- package/dist/types/components/ez-application/ez-application.d.ts +12 -0
- package/dist/types/components/ez-button/ez-button.d.ts +5 -0
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +21 -0
- package/dist/types/components/ez-check/ez-check.d.ts +1 -1
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +42 -0
- package/dist/types/components/ez-grid/controller/DataUnitBridge.d.ts +8 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +195 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +34 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/i18n/pt-BR.d.ts +2 -0
- package/dist/types/components/ez-grid/controller/ag-grid/mock/Server.d.ts +8 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +78 -0
- package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +30 -0
- package/dist/types/components/ez-grid/subcomponents/select-box/select-box.d.ts +9 -0
- package/dist/types/components/ez-list/ez-list.d.ts +70 -17
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +33 -50
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +1 -1
- package/dist/types/components/test-du/test-du.d.ts +6 -0
- package/dist/types/components.d.ts +283 -117
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/dist/types/utils/{Application.d.ts → ApplicationUtils.d.ts} +1 -1
- package/package.json +10 -8
- package/react/components.d.ts +6 -1
- package/react/components.js +6 -1
- package/react/components.js.map +1 -1
- package/dist/cjs/RequestMetadata-2cd01e8a.js +0 -531
- package/dist/cjs/ez-button_16.cjs.entry.js +0 -4079
- package/dist/cjs/ez-list.cjs.entry.js +0 -174
- package/dist/cjs/ez-modal.cjs.entry.js +0 -65
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.css +0 -13
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.js +0 -185
- package/dist/esm/RequestMetadata-c265c9d5.js +0 -527
- package/dist/esm/ez-button_16.entry.js +0 -4060
- package/dist/esm/ez-list.entry.js +0 -170
- package/dist/esm/ez-modal.entry.js +0 -61
- package/dist/ezui/p-11ae4ae7.entry.js +0 -1
- package/dist/ezui/p-47fa3d6c.entry.js +0 -1
- package/dist/ezui/p-8ab6168f.entry.js +0 -1
- package/dist/ezui/p-9c1fb51c.entry.js +0 -1
- package/dist/ezui/p-9d85125b.entry.js +0 -1
- package/dist/ezui/p-9dfccb16.js +0 -1
- package/dist/ezui/p-a7b546b2.entry.js +0 -1
- package/dist/ezui/p-c833c94f.entry.js +0 -1
- package/dist/types/components/ez-numeric-input/ez-numeric-input.d.ts +0 -45
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export class
|
|
1
|
+
import { NumberUtils } from "@sankhyalabs/core";
|
|
2
|
+
import { Component, h, Event, Prop, Watch, State, Host } from "@stencil/core";
|
|
3
|
+
export class EzNumberInput {
|
|
4
4
|
constructor() {
|
|
5
5
|
/**
|
|
6
|
-
* Deixa o campo disponível ou não para
|
|
6
|
+
* Deixa o campo disponível ou não para uso.
|
|
7
7
|
*/
|
|
8
8
|
this.enabled = true;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Configura o alinhamento do texto.
|
|
11
11
|
*/
|
|
12
12
|
this.textleft = false;
|
|
13
13
|
/**
|
|
@@ -16,222 +16,92 @@ export class NumberInput {
|
|
|
16
16
|
* Qualquer outro valor que não seja "en-US", adotará a formatação "pt-BR"
|
|
17
17
|
* Não é case sensitive
|
|
18
18
|
*/
|
|
19
|
-
this.
|
|
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
|
-
};
|
|
19
|
+
this.formatNumber = "PT-BR";
|
|
49
20
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this._messageBoxElem.classList.remove('hasError');
|
|
60
|
-
}
|
|
21
|
+
setLabel() {
|
|
22
|
+
this._textInput.label = this.label;
|
|
23
|
+
}
|
|
24
|
+
setErrorMessage() {
|
|
25
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
26
|
+
}
|
|
27
|
+
applyValueToInput() {
|
|
28
|
+
if (this._textInput) {
|
|
29
|
+
this._textInput.value = this.getTextValue(this.value);
|
|
61
30
|
}
|
|
62
31
|
}
|
|
63
32
|
onPrecisionChanged(newPrecision) {
|
|
64
33
|
if (isNaN(newPrecision)) {
|
|
65
34
|
this.precision = 0;
|
|
66
35
|
}
|
|
67
|
-
this.handleFocusout();
|
|
68
36
|
}
|
|
69
37
|
onPrettyPrecisionChanged(newPrettyPrecision) {
|
|
70
38
|
if (isNaN(newPrettyPrecision)) {
|
|
71
|
-
this.
|
|
39
|
+
this.prettyPrecision = 0;
|
|
72
40
|
}
|
|
73
|
-
this.handleFocusout();
|
|
74
41
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
this.
|
|
79
|
-
this.
|
|
80
|
-
this.
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
this.settingComponent();
|
|
42
|
+
changeValue(newValue) {
|
|
43
|
+
this.errorMessage = "";
|
|
44
|
+
if (newValue && newValue !== this.value) {
|
|
45
|
+
this.value = newValue;
|
|
46
|
+
this._textInput.value = this.getTextValue(newValue);
|
|
47
|
+
this.ezChange.emit();
|
|
84
48
|
}
|
|
85
49
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
}
|
|
50
|
+
parseNumber() {
|
|
51
|
+
const parsedNumber = this._textInput.value ? NumberUtils.stringToNumber(this._textInput.value) : null;
|
|
52
|
+
if (parsedNumber != null && isNaN(parsedNumber)) {
|
|
53
|
+
this.errorMessage = "O valor digitado não é um número válido";
|
|
99
54
|
}
|
|
100
|
-
|
|
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();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
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');
|
|
177
|
-
}
|
|
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) {
|
|
55
|
+
else {
|
|
188
56
|
try {
|
|
189
|
-
this.
|
|
57
|
+
this.changeValue(parsedNumber);
|
|
190
58
|
}
|
|
191
59
|
catch (e) {
|
|
192
60
|
this.errorMessage = e.message;
|
|
193
61
|
return;
|
|
194
62
|
}
|
|
195
|
-
this.strvalue = this._inputElem.value;
|
|
196
63
|
}
|
|
197
|
-
this.ezChange.emit({ strValue: this.strvalue, value: this.value });
|
|
198
|
-
this.adjustFloatingLabel();
|
|
199
64
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
return;
|
|
65
|
+
getTextValue(value) {
|
|
66
|
+
const parsedNumber = value ? NumberUtils.stringToNumber(value) : null;
|
|
67
|
+
if (parsedNumber != null && isNaN(parsedNumber)) {
|
|
68
|
+
this.errorMessage = "O valor digitado não é um número válido";
|
|
205
69
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
NumberUtils.format(this.value.toString(), this.precision, this.prettyprecision);
|
|
70
|
+
else {
|
|
71
|
+
return this.formatNumber.toUpperCase() !== "EN-US" ? NumberUtils.format(value.toString(), this.precision, this.prettyPrecision) : NumberUtils.changeFormat(NumberUtils.format(value.toString(), this.precision, this.prettyPrecision));
|
|
72
|
+
}
|
|
73
|
+
return "";
|
|
211
74
|
}
|
|
212
|
-
//---------------------------------------------
|
|
213
|
-
// Lifecycle web component
|
|
214
|
-
//---------------------------------------------
|
|
215
75
|
componentDidLoad() {
|
|
216
76
|
if (!this.textleft) {
|
|
217
|
-
this.
|
|
77
|
+
this._textInput.shadowRoot.querySelector('input').classList.add('text--right');
|
|
78
|
+
}
|
|
79
|
+
let rightItem;
|
|
80
|
+
let letfItem;
|
|
81
|
+
for (const key in this._hostElement.children) {
|
|
82
|
+
if (Object.prototype.hasOwnProperty.call(this._hostElement.children, key)) {
|
|
83
|
+
const element = this._hostElement.children[key];
|
|
84
|
+
if (element.getAttribute('slot') === 'rightIcon') {
|
|
85
|
+
rightItem = element;
|
|
86
|
+
}
|
|
87
|
+
else if (element.getAttribute('slot') === 'leftIcon') {
|
|
88
|
+
letfItem = element;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
218
91
|
}
|
|
219
|
-
this.
|
|
220
|
-
this.
|
|
92
|
+
this._leftSlotItem = letfItem;
|
|
93
|
+
this._rightSlotItem = rightItem;
|
|
94
|
+
this.slotElement;
|
|
221
95
|
}
|
|
222
96
|
componentWillLoad() {
|
|
223
97
|
this.onPrecisionChanged(this.precision);
|
|
224
|
-
this.onPrettyPrecisionChanged(this.
|
|
225
|
-
this.settingValue();
|
|
98
|
+
this.onPrettyPrecisionChanged(this.prettyPrecision);
|
|
226
99
|
}
|
|
227
100
|
render() {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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)));
|
|
101
|
+
return (h(Host, { ref: elem => this._hostElement = elem },
|
|
102
|
+
h("ez-text-input", { class: "text-input", ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789-,.", enabled: this.enabled, errorMessage: this.errorMessage },
|
|
103
|
+
this._rightSlotItem ? h("slot", { name: "rightIcon", slot: "rightIcon" }) : undefined,
|
|
104
|
+
this._leftSlotItem ? h("slot", { name: "leftIcon", slot: "leftIcon" }) : undefined)));
|
|
235
105
|
}
|
|
236
106
|
static get is() { return "ez-number-input"; }
|
|
237
107
|
static get encapsulation() { return "shadow"; }
|
|
@@ -242,9 +112,9 @@ export class NumberInput {
|
|
|
242
112
|
"$": ["ez-number-input.css"]
|
|
243
113
|
}; }
|
|
244
114
|
static get properties() { return {
|
|
245
|
-
"
|
|
115
|
+
"label": {
|
|
246
116
|
"type": "string",
|
|
247
|
-
"mutable":
|
|
117
|
+
"mutable": false,
|
|
248
118
|
"complexType": {
|
|
249
119
|
"original": "string",
|
|
250
120
|
"resolved": "string",
|
|
@@ -254,43 +124,26 @@ export class NumberInput {
|
|
|
254
124
|
"optional": false,
|
|
255
125
|
"docs": {
|
|
256
126
|
"tags": [],
|
|
257
|
-
"text": "
|
|
127
|
+
"text": "T\u00EDtulo do campo"
|
|
258
128
|
},
|
|
259
|
-
"attribute": "
|
|
260
|
-
"reflect":
|
|
129
|
+
"attribute": "label",
|
|
130
|
+
"reflect": true
|
|
261
131
|
},
|
|
262
132
|
"value": {
|
|
263
|
-
"type": "
|
|
133
|
+
"type": "any",
|
|
264
134
|
"mutable": true,
|
|
265
135
|
"complexType": {
|
|
266
|
-
"original": "number",
|
|
267
|
-
"resolved": "number",
|
|
136
|
+
"original": "string | number",
|
|
137
|
+
"resolved": "number | string",
|
|
268
138
|
"references": {}
|
|
269
139
|
},
|
|
270
140
|
"required": false,
|
|
271
141
|
"optional": false,
|
|
272
142
|
"docs": {
|
|
273
143
|
"tags": [],
|
|
274
|
-
"text": "
|
|
144
|
+
"text": "O valor informado pelo usu\u00E1rio"
|
|
275
145
|
},
|
|
276
146
|
"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
147
|
"reflect": true
|
|
295
148
|
},
|
|
296
149
|
"enabled": {
|
|
@@ -305,7 +158,7 @@ export class NumberInput {
|
|
|
305
158
|
"optional": false,
|
|
306
159
|
"docs": {
|
|
307
160
|
"tags": [],
|
|
308
|
-
"text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para
|
|
161
|
+
"text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para uso."
|
|
309
162
|
},
|
|
310
163
|
"attribute": "enabled",
|
|
311
164
|
"reflect": true,
|
|
@@ -340,12 +193,12 @@ export class NumberInput {
|
|
|
340
193
|
"optional": false,
|
|
341
194
|
"docs": {
|
|
342
195
|
"tags": [],
|
|
343
|
-
"text": "Precis\u00E3o de
|
|
196
|
+
"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
197
|
},
|
|
345
198
|
"attribute": "precision",
|
|
346
199
|
"reflect": true
|
|
347
200
|
},
|
|
348
|
-
"
|
|
201
|
+
"prettyPrecision": {
|
|
349
202
|
"type": "number",
|
|
350
203
|
"mutable": true,
|
|
351
204
|
"complexType": {
|
|
@@ -357,9 +210,9 @@ export class NumberInput {
|
|
|
357
210
|
"optional": false,
|
|
358
211
|
"docs": {
|
|
359
212
|
"tags": [],
|
|
360
|
-
"text": "
|
|
213
|
+
"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)."
|
|
361
214
|
},
|
|
362
|
-
"attribute": "
|
|
215
|
+
"attribute": "pretty-precision",
|
|
363
216
|
"reflect": true
|
|
364
217
|
},
|
|
365
218
|
"textleft": {
|
|
@@ -374,13 +227,13 @@ export class NumberInput {
|
|
|
374
227
|
"optional": false,
|
|
375
228
|
"docs": {
|
|
376
229
|
"tags": [],
|
|
377
|
-
"text": "
|
|
230
|
+
"text": "Configura o alinhamento do texto."
|
|
378
231
|
},
|
|
379
232
|
"attribute": "textleft",
|
|
380
233
|
"reflect": true,
|
|
381
234
|
"defaultValue": "false"
|
|
382
235
|
},
|
|
383
|
-
"
|
|
236
|
+
"formatNumber": {
|
|
384
237
|
"type": "string",
|
|
385
238
|
"mutable": false,
|
|
386
239
|
"complexType": {
|
|
@@ -394,11 +247,15 @@ export class NumberInput {
|
|
|
394
247
|
"tags": [],
|
|
395
248
|
"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"
|
|
396
249
|
},
|
|
397
|
-
"attribute": "
|
|
250
|
+
"attribute": "format-number",
|
|
398
251
|
"reflect": true,
|
|
399
252
|
"defaultValue": "\"PT-BR\""
|
|
400
253
|
}
|
|
401
254
|
}; }
|
|
255
|
+
static get states() { return {
|
|
256
|
+
"_leftSlotItem": {},
|
|
257
|
+
"_rightSlotItem": {}
|
|
258
|
+
}; }
|
|
402
259
|
static get events() { return [{
|
|
403
260
|
"method": "ezChange",
|
|
404
261
|
"name": "ezChange",
|
|
@@ -407,76 +264,28 @@ export class NumberInput {
|
|
|
407
264
|
"composed": true,
|
|
408
265
|
"docs": {
|
|
409
266
|
"tags": [],
|
|
410
|
-
"text": "
|
|
267
|
+
"text": "Evento disparado quando o estado do componente \u00E9 alterado (onEzChange)."
|
|
411
268
|
},
|
|
412
269
|
"complexType": {
|
|
413
|
-
"original": "
|
|
414
|
-
"resolved": "
|
|
270
|
+
"original": "string",
|
|
271
|
+
"resolved": "string",
|
|
415
272
|
"references": {}
|
|
416
273
|
}
|
|
417
274
|
}]; }
|
|
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"; }
|
|
469
275
|
static get watchers() { return [{
|
|
276
|
+
"propName": "label",
|
|
277
|
+
"methodName": "setLabel"
|
|
278
|
+
}, {
|
|
470
279
|
"propName": "errorMessage",
|
|
471
|
-
"methodName": "
|
|
280
|
+
"methodName": "setErrorMessage"
|
|
281
|
+
}, {
|
|
282
|
+
"propName": "value",
|
|
283
|
+
"methodName": "applyValueToInput"
|
|
472
284
|
}, {
|
|
473
285
|
"propName": "precision",
|
|
474
286
|
"methodName": "onPrecisionChanged"
|
|
475
287
|
}, {
|
|
476
|
-
"propName": "
|
|
288
|
+
"propName": "prettyPrecision",
|
|
477
289
|
"methodName": "onPrettyPrecisionChanged"
|
|
478
|
-
}, {
|
|
479
|
-
"propName": "value",
|
|
480
|
-
"methodName": "onValueChanged"
|
|
481
290
|
}]; }
|
|
482
291
|
}
|
|
@@ -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(--
|
|
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
|
|
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 {
|