@sankhyalabs/ezui 1.1.135 → 1.1.138
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/ez-calendar.cjs.entry.js +2 -2
- package/dist/cjs/ez-check.cjs.entry.js +3 -3
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +5 -5
- package/dist/cjs/ez-date-input.cjs.entry.js +10 -10
- package/dist/cjs/ez-date-time-input.cjs.entry.js +8 -8
- package/dist/cjs/ez-filter-input.cjs.entry.js +6 -6
- package/dist/cjs/ez-form.cjs.entry.js +36 -5
- package/dist/cjs/ez-grid.cjs.entry.js +4 -4
- package/dist/cjs/ez-modal.cjs.entry.js +3 -3
- package/dist/cjs/ez-number-input.cjs.entry.js +25 -18
- package/dist/cjs/ez-popover.cjs.entry.js +2 -2
- package/dist/cjs/ez-search.cjs.entry.js +2 -2
- package/dist/cjs/ez-text-area.cjs.entry.js +11 -11
- package/dist/cjs/ez-text-input.cjs.entry.js +22 -15
- package/dist/cjs/ez-time-input.cjs.entry.js +36 -30
- package/dist/cjs/ez-upload.cjs.entry.js +5 -5
- package/dist/cjs/ez-view-stack.cjs.entry.js +71 -0
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/test-du.cjs.entry.js +43 -10
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-calendar/ez-calendar.js +2 -2
- package/dist/collection/components/ez-check/ez-check.js +3 -3
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +14 -2
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +5 -5
- package/dist/collection/components/ez-date-input/ez-date-input.js +10 -10
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +8 -8
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +6 -6
- package/dist/collection/components/ez-form/ez-form.js +17 -2
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +19 -3
- package/dist/collection/components/ez-grid/ez-grid.js +4 -4
- package/dist/collection/components/ez-modal/ez-modal.js +3 -3
- package/dist/collection/components/ez-number-input/ez-number-input.js +26 -19
- package/dist/collection/components/ez-popover/ez-popover.js +2 -2
- package/dist/collection/components/ez-search/ez-search.js +2 -2
- package/dist/collection/components/ez-text-area/ez-text-area.js +11 -11
- package/dist/collection/components/ez-text-input/ez-text-input.js +40 -15
- package/dist/collection/components/ez-time-input/ez-time-input.js +52 -31
- package/dist/collection/components/ez-upload/ez-upload.css +1 -0
- package/dist/collection/components/ez-upload/ez-upload.js +4 -4
- package/dist/collection/components/ez-view-stack/ez-view-stack.css +9 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.js +87 -0
- package/dist/collection/components/test-du/test-du.js +44 -10
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +293 -142
- package/dist/esm/ez-calendar.entry.js +2 -2
- package/dist/esm/ez-check.entry.js +3 -3
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +5 -5
- package/dist/esm/ez-date-input.entry.js +10 -10
- package/dist/esm/ez-date-time-input.entry.js +8 -8
- package/dist/esm/ez-filter-input.entry.js +6 -6
- package/dist/esm/ez-form.entry.js +36 -5
- package/dist/esm/ez-grid.entry.js +4 -4
- package/dist/esm/ez-modal.entry.js +3 -3
- package/dist/esm/ez-number-input.entry.js +25 -18
- package/dist/esm/ez-popover.entry.js +2 -2
- package/dist/esm/ez-search.entry.js +2 -2
- package/dist/esm/ez-text-area.entry.js +11 -11
- package/dist/esm/ez-text-input.entry.js +22 -15
- package/dist/esm/ez-time-input.entry.js +37 -31
- package/dist/esm/ez-upload.entry.js +5 -5
- package/dist/esm/ez-view-stack.entry.js +67 -0
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/test-du.entry.js +43 -10
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-248361f5.entry.js +1 -0
- package/dist/ezui/p-30e3793f.entry.js +1 -0
- package/dist/ezui/p-4c3cd534.entry.js +1 -0
- package/dist/ezui/p-517d7759.entry.js +1 -0
- package/dist/ezui/{p-5f2add6f.entry.js → p-51cdfa9e.entry.js} +1 -1
- package/dist/ezui/p-659df655.entry.js +1 -0
- package/dist/ezui/p-6d4b1628.entry.js +1 -0
- package/dist/ezui/p-8be1a4d6.entry.js +1 -0
- package/dist/ezui/p-b65e22a1.entry.js +1 -0
- package/dist/ezui/p-b8d64970.entry.js +1 -0
- package/dist/ezui/{p-c6c91589.entry.js → p-c246e251.entry.js} +1 -1
- package/dist/ezui/p-c2de757f.entry.js +1 -0
- package/dist/ezui/p-c620258b.entry.js +1 -0
- package/dist/ezui/p-cabe3671.entry.js +1 -0
- package/dist/ezui/p-cb73bee7.entry.js +1 -0
- package/dist/ezui/p-db0981c1.entry.js +1 -0
- package/dist/ezui/p-dd6f4872.entry.js +1 -0
- package/dist/ezui/p-ec8419f1.entry.js +1 -0
- package/dist/ezui/p-fc9b9487.entry.js +1 -0
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +1 -1
- package/dist/types/components/ez-check/ez-check.d.ts +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +3 -3
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +3 -3
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +3 -3
- package/dist/types/components/ez-form/ez-form.d.ts +1 -1
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +1 -1
- package/dist/types/components/ez-modal/ez-modal.d.ts +1 -1
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -3
- package/dist/types/components/ez-popover/ez-popover.d.ts +1 -1
- package/dist/types/components/ez-search/ez-search.d.ts +1 -1
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +4 -4
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +8 -4
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +9 -3
- package/dist/types/components/ez-upload/ez-upload.d.ts +2 -2
- package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +16 -0
- package/dist/types/components/test-du/test-du.d.ts +1 -0
- package/dist/types/components.d.ts +29 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-097d5dc6.entry.js +0 -1
- package/dist/ezui/p-0fd2624d.entry.js +0 -1
- package/dist/ezui/p-1587cbbc.entry.js +0 -1
- package/dist/ezui/p-18d67107.entry.js +0 -1
- package/dist/ezui/p-49f70be3.entry.js +0 -1
- package/dist/ezui/p-50038ae3.entry.js +0 -1
- package/dist/ezui/p-53110643.entry.js +0 -1
- package/dist/ezui/p-67d30ea7.entry.js +0 -1
- package/dist/ezui/p-685a35b3.entry.js +0 -1
- package/dist/ezui/p-699c31d1.entry.js +0 -1
- package/dist/ezui/p-6c22c9f9.entry.js +0 -1
- package/dist/ezui/p-a1304302.entry.js +0 -1
- package/dist/ezui/p-b2cc27e5.entry.js +0 -1
- package/dist/ezui/p-b71d454d.entry.js +0 -1
- package/dist/ezui/p-dcf5f013.entry.js +0 -1
- package/dist/ezui/p-e472517c.entry.js +0 -1
|
@@ -14,8 +14,12 @@ export class EzTextInput {
|
|
|
14
14
|
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
15
15
|
*/
|
|
16
16
|
this.mode = "regular";
|
|
17
|
+
/**
|
|
18
|
+
* Define se o controle de change do value será controlado por um componente pai.
|
|
19
|
+
*/
|
|
20
|
+
this.slaveMode = false;
|
|
17
21
|
}
|
|
18
|
-
|
|
22
|
+
observeErrorMessage() {
|
|
19
23
|
var _a, _b;
|
|
20
24
|
if (this._inputElem) {
|
|
21
25
|
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
@@ -29,7 +33,7 @@ export class EzTextInput {
|
|
|
29
33
|
}
|
|
30
34
|
}
|
|
31
35
|
}
|
|
32
|
-
|
|
36
|
+
observeMask() {
|
|
33
37
|
if (this.mask) {
|
|
34
38
|
if (this._maskFormatter == undefined) {
|
|
35
39
|
this._maskFormatter = new MaskFormatter(this.mask);
|
|
@@ -39,14 +43,17 @@ export class EzTextInput {
|
|
|
39
43
|
}
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
|
-
|
|
46
|
+
observeValue() {
|
|
43
47
|
if (this._inputElem) {
|
|
44
48
|
this._inputElem.value = this.value;
|
|
45
49
|
}
|
|
46
50
|
this.handleChange();
|
|
51
|
+
this.adjustFloatingLabel();
|
|
52
|
+
if (this.slaveMode) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
47
55
|
this.errorMessage = "";
|
|
48
56
|
this.ezChange.emit(this.value);
|
|
49
|
-
this.adjustFloatingLabel();
|
|
50
57
|
}
|
|
51
58
|
adjustFloatingLabel() {
|
|
52
59
|
if (this.label && this._labelElem) {
|
|
@@ -98,7 +105,7 @@ export class EzTextInput {
|
|
|
98
105
|
this.errorMessage = e.message;
|
|
99
106
|
}
|
|
100
107
|
}
|
|
101
|
-
this.
|
|
108
|
+
this.controlChangeValue();
|
|
102
109
|
this.adjustFloatingLabel();
|
|
103
110
|
}
|
|
104
111
|
isValidValue(value) {
|
|
@@ -107,7 +114,7 @@ export class EzTextInput {
|
|
|
107
114
|
}
|
|
108
115
|
return true;
|
|
109
116
|
}
|
|
110
|
-
|
|
117
|
+
controlChangeValue() {
|
|
111
118
|
if ((this.value || '') !== this._inputElem.value) {
|
|
112
119
|
this.value = this._inputElem.value;
|
|
113
120
|
}
|
|
@@ -121,9 +128,9 @@ export class EzTextInput {
|
|
|
121
128
|
this._lastValidValue = value;
|
|
122
129
|
}
|
|
123
130
|
else {
|
|
124
|
-
this._inputElem.value = this._lastValidValue
|
|
131
|
+
this._inputElem.value = this._lastValidValue == undefined ? "" : this._lastValidValue;
|
|
125
132
|
}
|
|
126
|
-
this.
|
|
133
|
+
this.controlChangeValue();
|
|
127
134
|
}
|
|
128
135
|
handleSlotChange(ev) {
|
|
129
136
|
const slot = ev.target;
|
|
@@ -154,7 +161,7 @@ export class EzTextInput {
|
|
|
154
161
|
}
|
|
155
162
|
}
|
|
156
163
|
}
|
|
157
|
-
this.
|
|
164
|
+
this.observeErrorMessage();
|
|
158
165
|
}
|
|
159
166
|
doFocus() {
|
|
160
167
|
if (this.label && this._labelElem && !this._labelElem.classList.contains("input__label--floated")) {
|
|
@@ -165,12 +172,12 @@ export class EzTextInput {
|
|
|
165
172
|
// Lifecycle web component
|
|
166
173
|
//---------------------------------------------
|
|
167
174
|
componentDidLoad() {
|
|
168
|
-
this.
|
|
169
|
-
this.
|
|
175
|
+
this.observeErrorMessage();
|
|
176
|
+
this.observeMask();
|
|
170
177
|
this.adjustFloatingLabel();
|
|
171
178
|
}
|
|
172
179
|
componentWillLoad() {
|
|
173
|
-
this.
|
|
180
|
+
this.observeMask();
|
|
174
181
|
if (this.value) {
|
|
175
182
|
if (this._maskFormatter) {
|
|
176
183
|
try {
|
|
@@ -361,6 +368,24 @@ export class EzTextInput {
|
|
|
361
368
|
"attribute": "mode",
|
|
362
369
|
"reflect": true,
|
|
363
370
|
"defaultValue": "\"regular\""
|
|
371
|
+
},
|
|
372
|
+
"slaveMode": {
|
|
373
|
+
"type": "boolean",
|
|
374
|
+
"mutable": false,
|
|
375
|
+
"complexType": {
|
|
376
|
+
"original": "boolean",
|
|
377
|
+
"resolved": "boolean",
|
|
378
|
+
"references": {}
|
|
379
|
+
},
|
|
380
|
+
"required": false,
|
|
381
|
+
"optional": false,
|
|
382
|
+
"docs": {
|
|
383
|
+
"tags": [],
|
|
384
|
+
"text": "Define se o controle de change do value ser\u00E1 controlado por um componente pai."
|
|
385
|
+
},
|
|
386
|
+
"attribute": "slave-mode",
|
|
387
|
+
"reflect": true,
|
|
388
|
+
"defaultValue": "false"
|
|
364
389
|
}
|
|
365
390
|
}; }
|
|
366
391
|
static get events() { return [{
|
|
@@ -416,12 +441,12 @@ export class EzTextInput {
|
|
|
416
441
|
static get elementRef() { return "_hostElement"; }
|
|
417
442
|
static get watchers() { return [{
|
|
418
443
|
"propName": "errorMessage",
|
|
419
|
-
"methodName": "
|
|
444
|
+
"methodName": "observeErrorMessage"
|
|
420
445
|
}, {
|
|
421
446
|
"propName": "mask",
|
|
422
|
-
"methodName": "
|
|
447
|
+
"methodName": "observeMask"
|
|
423
448
|
}, {
|
|
424
449
|
"propName": "value",
|
|
425
|
-
"methodName": "
|
|
450
|
+
"methodName": "observeValue"
|
|
426
451
|
}]; }
|
|
427
452
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Element, Component, Prop, h, Watch, Host, Method } from "@stencil/core";
|
|
1
|
+
import { Element, Component, Prop, h, Watch, Host, Method, Event } from "@stencil/core";
|
|
2
2
|
import { TimeFormatter, MaskFormatter, NumberUtils } from "@sankhyalabs/core";
|
|
3
3
|
import CSSVarsUtils from "../../utils/CSSVarsUtils";
|
|
4
4
|
export class EzTimeInput {
|
|
@@ -16,28 +16,28 @@ export class EzTimeInput {
|
|
|
16
16
|
*/
|
|
17
17
|
this.mode = "regular";
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
observeShowSeconds() {
|
|
20
20
|
if (this.showSeconds) {
|
|
21
|
-
|
|
22
|
-
this._maskFormatter = new MaskFormatter("##:##:##");
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
this._maskFormatter.mask = "##:##:##";
|
|
26
|
-
}
|
|
21
|
+
this.prepareMask("##:##:##");
|
|
27
22
|
}
|
|
28
23
|
else {
|
|
29
|
-
|
|
30
|
-
this._maskFormatter = new MaskFormatter("##:##");
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
this._maskFormatter.mask = "##:##";
|
|
34
|
-
}
|
|
24
|
+
this.prepareMask("##:##");
|
|
35
25
|
}
|
|
36
26
|
}
|
|
37
|
-
|
|
38
|
-
if (this.value
|
|
27
|
+
observeValue() {
|
|
28
|
+
if (isNaN(this.value)) {
|
|
39
29
|
this.value = undefined;
|
|
40
|
-
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//---------------------------------------------
|
|
33
|
+
// Private methods
|
|
34
|
+
//---------------------------------------------
|
|
35
|
+
prepareMask(mask) {
|
|
36
|
+
if (this._maskFormatter == undefined) {
|
|
37
|
+
this._maskFormatter = new MaskFormatter(mask);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this._maskFormatter.mask = mask;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
//---------------------------------------------
|
|
@@ -47,13 +47,13 @@ export class EzTimeInput {
|
|
|
47
47
|
* Faz o foco no componente de input
|
|
48
48
|
*/
|
|
49
49
|
async setFocus() {
|
|
50
|
-
this._inputElem.
|
|
50
|
+
this._inputElem.setFocus();
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Remove o foco no componente de input
|
|
54
54
|
*/
|
|
55
55
|
async setBlur() {
|
|
56
|
-
this._inputElem.
|
|
56
|
+
this._inputElem.setBlur();
|
|
57
57
|
}
|
|
58
58
|
//---------------------------------------------
|
|
59
59
|
// Event handlers
|
|
@@ -61,24 +61,29 @@ export class EzTimeInput {
|
|
|
61
61
|
handleFocusout() {
|
|
62
62
|
this.errorMessage = "";
|
|
63
63
|
this.prepareValue(this.viewValue);
|
|
64
|
-
if (!TimeFormatter.validateTime(this.viewValue, this.showSeconds)) {
|
|
65
|
-
this.
|
|
64
|
+
if (this.viewValue && !TimeFormatter.validateTime(this.viewValue, this.showSeconds)) {
|
|
65
|
+
this._oldViewValue = this.viewValue;
|
|
66
66
|
this.errorMessage = "Favor inserir um horário válido.";
|
|
67
67
|
}
|
|
68
|
+
else {
|
|
69
|
+
if (this.viewValue === this._oldViewValue) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this._oldViewValue = this.viewValue;
|
|
73
|
+
if (this.viewValue === "00:00" && this.value == undefined) {
|
|
74
|
+
this.value = 0;
|
|
75
|
+
}
|
|
76
|
+
this.ezChange.emit(this.value);
|
|
77
|
+
}
|
|
68
78
|
}
|
|
69
79
|
prepareValue(value) {
|
|
70
80
|
try {
|
|
71
81
|
this.viewValue = TimeFormatter.prepareValue(value, this.showSeconds);
|
|
72
82
|
}
|
|
73
83
|
catch (e) {
|
|
74
|
-
this.clearField();
|
|
75
84
|
this.errorMessage = e.message;
|
|
76
85
|
}
|
|
77
86
|
}
|
|
78
|
-
clearField() {
|
|
79
|
-
this.viewValue = '';
|
|
80
|
-
this.value = undefined;
|
|
81
|
-
}
|
|
82
87
|
handleChange() {
|
|
83
88
|
this.viewValue = this._inputElem.value;
|
|
84
89
|
this.value = NumberUtils.stringToNumber(this.viewValue.replace(/\D/g, ""));
|
|
@@ -87,11 +92,11 @@ export class EzTimeInput {
|
|
|
87
92
|
// Lifecycle web component
|
|
88
93
|
//---------------------------------------------
|
|
89
94
|
componentDidLoad() {
|
|
90
|
-
this.
|
|
95
|
+
this.observeValue();
|
|
91
96
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._inputElem);
|
|
92
97
|
}
|
|
93
98
|
componentWillLoad() {
|
|
94
|
-
this.
|
|
99
|
+
this.observeShowSeconds();
|
|
95
100
|
if (this.value) {
|
|
96
101
|
this.prepareValue(this.value.toString());
|
|
97
102
|
}
|
|
@@ -101,7 +106,7 @@ export class EzTimeInput {
|
|
|
101
106
|
}
|
|
102
107
|
render() {
|
|
103
108
|
return (h(Host, null,
|
|
104
|
-
h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage, mode: this.mode },
|
|
109
|
+
h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, restrict: "0123456789:", onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true },
|
|
105
110
|
h("ez-icon", { slot: "leftIcon", iconName: "timer-outline" }))));
|
|
106
111
|
}
|
|
107
112
|
static get is() { return "ez-time-input"; }
|
|
@@ -237,6 +242,22 @@ export class EzTimeInput {
|
|
|
237
242
|
"defaultValue": "\"regular\""
|
|
238
243
|
}
|
|
239
244
|
}; }
|
|
245
|
+
static get events() { return [{
|
|
246
|
+
"method": "ezChange",
|
|
247
|
+
"name": "ezChange",
|
|
248
|
+
"bubbles": true,
|
|
249
|
+
"cancelable": true,
|
|
250
|
+
"composed": true,
|
|
251
|
+
"docs": {
|
|
252
|
+
"tags": [],
|
|
253
|
+
"text": "Evento disparado quando o estado do componente \u00E9 alterado (onEzChange)."
|
|
254
|
+
},
|
|
255
|
+
"complexType": {
|
|
256
|
+
"original": "number",
|
|
257
|
+
"resolved": "number",
|
|
258
|
+
"references": {}
|
|
259
|
+
}
|
|
260
|
+
}]; }
|
|
240
261
|
static get methods() { return {
|
|
241
262
|
"setFocus": {
|
|
242
263
|
"complexType": {
|
|
@@ -274,9 +295,9 @@ export class EzTimeInput {
|
|
|
274
295
|
static get elementRef() { return "_elem"; }
|
|
275
296
|
static get watchers() { return [{
|
|
276
297
|
"propName": "showSeconds",
|
|
277
|
-
"methodName": "
|
|
298
|
+
"methodName": "observeShowSeconds"
|
|
278
299
|
}, {
|
|
279
300
|
"propName": "value",
|
|
280
|
-
"methodName": "
|
|
301
|
+
"methodName": "observeValue"
|
|
281
302
|
}]; }
|
|
282
303
|
}
|
|
@@ -9,7 +9,7 @@ export class EzUpload {
|
|
|
9
9
|
*/
|
|
10
10
|
this.enabled = true;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
observeValue(newValue) {
|
|
13
13
|
//Observamos o mundo externo, se um novo valor foi atribuído,
|
|
14
14
|
//precisamos cancelar a alteração anterior, isso envolve, percorrer
|
|
15
15
|
//a lista de ponteiros e cancelar todos os uploads em andamento.
|
|
@@ -29,7 +29,7 @@ export class EzUpload {
|
|
|
29
29
|
this.value.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
observeRequestHeaders() {
|
|
33
33
|
this._requestHeaders = new Map();
|
|
34
34
|
if (typeof this.requestHeaders == "string") {
|
|
35
35
|
try {
|
|
@@ -524,9 +524,9 @@ export class EzUpload {
|
|
|
524
524
|
static get elementRef() { return "_host"; }
|
|
525
525
|
static get watchers() { return [{
|
|
526
526
|
"propName": "value",
|
|
527
|
-
"methodName": "
|
|
527
|
+
"methodName": "observeValue"
|
|
528
528
|
}, {
|
|
529
529
|
"propName": "requestHeaders",
|
|
530
|
-
"methodName": "
|
|
530
|
+
"methodName": "observeRequestHeaders"
|
|
531
531
|
}]; }
|
|
532
532
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Component, h, Host, Element, Method } from '@stencil/core';
|
|
2
|
+
export class EzViewStack {
|
|
3
|
+
/**
|
|
4
|
+
* Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.
|
|
5
|
+
*/
|
|
6
|
+
async show(index) {
|
|
7
|
+
if (index !== this._focusedIndex && 0 <= index && index < this._totalStackItems) {
|
|
8
|
+
this.policyHideRemove();
|
|
9
|
+
this.policyShowAppend(index);
|
|
10
|
+
this._focusedIndex = index;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
policyHideRemove() {
|
|
14
|
+
let element = this._hostElem.querySelector(`#el_${this._focusedIndex}`);
|
|
15
|
+
this.checkElementVisibility(element);
|
|
16
|
+
}
|
|
17
|
+
policyShowAppend(index) {
|
|
18
|
+
let selectedElement = this._hostElem.querySelector(`#el_${index}`);
|
|
19
|
+
if (selectedElement) {
|
|
20
|
+
selectedElement.removeAttribute("style");
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this._hostElem.append(this._elemList[index]);
|
|
24
|
+
}
|
|
25
|
+
;
|
|
26
|
+
}
|
|
27
|
+
checkElementVisibility(element) {
|
|
28
|
+
if (element.getAttribute("hidePolicy") === "hide" || !element.getAttribute("hidePolicy")) {
|
|
29
|
+
element.setAttribute("style", "display: none");
|
|
30
|
+
}
|
|
31
|
+
else if (element.getAttribute("hidePolicy") === "remove") {
|
|
32
|
+
element.remove();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
componentWillRender() {
|
|
36
|
+
if (!this._elemList) {
|
|
37
|
+
this._elemList = [];
|
|
38
|
+
this._focusedIndex = 0;
|
|
39
|
+
this._totalStackItems = 0;
|
|
40
|
+
this._hostElem.classList.add("ez-view-stack__container");
|
|
41
|
+
this._hostElem.querySelectorAll("stack-item").forEach((element, index) => {
|
|
42
|
+
element.setAttribute("id", `el_${index}`);
|
|
43
|
+
if (index !== 0) {
|
|
44
|
+
this.checkElementVisibility(element);
|
|
45
|
+
}
|
|
46
|
+
this._totalStackItems++;
|
|
47
|
+
this._elemList.push(element);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
disconectCallback() {
|
|
52
|
+
this._hostElem = null;
|
|
53
|
+
this._elemList = null;
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return (h(Host, null));
|
|
57
|
+
}
|
|
58
|
+
static get is() { return "ez-view-stack"; }
|
|
59
|
+
static get originalStyleUrls() { return {
|
|
60
|
+
"$": ["ez-view-stack.css"]
|
|
61
|
+
}; }
|
|
62
|
+
static get styleUrls() { return {
|
|
63
|
+
"$": ["ez-view-stack.css"]
|
|
64
|
+
}; }
|
|
65
|
+
static get methods() { return {
|
|
66
|
+
"show": {
|
|
67
|
+
"complexType": {
|
|
68
|
+
"signature": "(index: number) => Promise<void>",
|
|
69
|
+
"parameters": [{
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": ""
|
|
72
|
+
}],
|
|
73
|
+
"references": {
|
|
74
|
+
"Promise": {
|
|
75
|
+
"location": "global"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"return": "Promise<void>"
|
|
79
|
+
},
|
|
80
|
+
"docs": {
|
|
81
|
+
"text": "Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.",
|
|
82
|
+
"tags": []
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}; }
|
|
86
|
+
static get elementRef() { return "_hostElem"; }
|
|
87
|
+
}
|
|
@@ -11,17 +11,50 @@ export class TestDu {
|
|
|
11
11
|
label: "Parceiro",
|
|
12
12
|
fields: [
|
|
13
13
|
{
|
|
14
|
-
name: "
|
|
15
|
-
label: "
|
|
16
|
-
dataType: DataType.
|
|
17
|
-
userInterface: UserInterface.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
name: "CODPARC",
|
|
15
|
+
label: "Parceiro",
|
|
16
|
+
dataType: DataType.NUMBER,
|
|
17
|
+
userInterface: UserInterface.INTEGERNUMBER,
|
|
18
|
+
defaultValue: 666,
|
|
19
|
+
required: false,
|
|
20
|
+
properties: {}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "RECDESP",
|
|
24
|
+
label: "Receita/Despesa",
|
|
25
|
+
dataType: DataType.TEXT,
|
|
26
|
+
userInterface: UserInterface.OPTIONSELECTOR,
|
|
27
|
+
required: true,
|
|
28
|
+
properties: { options: `{"-1": "Despesa", "1": "Receita"}` }
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "P",
|
|
32
|
+
label: "pera",
|
|
33
|
+
dataType: DataType.TEXT,
|
|
34
|
+
userInterface: UserInterface.OPTIONSELECTOR,
|
|
35
|
+
properties: { options: `{"M": "Madura", "V": "Verde", "P": "Passada"}` }
|
|
36
|
+
},
|
|
23
37
|
]
|
|
24
38
|
};
|
|
39
|
+
this.formConfig = [
|
|
40
|
+
{
|
|
41
|
+
name: "CODPARC",
|
|
42
|
+
label: "Parceiro",
|
|
43
|
+
dataType: DataType.NUMBER,
|
|
44
|
+
userInterface: UserInterface.INTEGERNUMBER,
|
|
45
|
+
defaultValue: 666,
|
|
46
|
+
required: false,
|
|
47
|
+
properties: {}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "RECDESP",
|
|
51
|
+
label: "Receita/Despesa",
|
|
52
|
+
dataType: DataType.TEXT,
|
|
53
|
+
userInterface: UserInterface.OPTIONSELECTOR,
|
|
54
|
+
required: true,
|
|
55
|
+
properties: { options: `{"-1": "Despesa", "1": "Receita"}` }
|
|
56
|
+
}
|
|
57
|
+
];
|
|
25
58
|
this.dataUnit.dataLoader = () => new Promise(accept => accept({
|
|
26
59
|
records: [{
|
|
27
60
|
__record__id__: "1321321321321321",
|
|
@@ -53,9 +86,10 @@ export class TestDu {
|
|
|
53
86
|
}
|
|
54
87
|
render() {
|
|
55
88
|
return (h("div", null,
|
|
89
|
+
h("button", { onClick: () => this.dataUnit.addRecord() }, "Novo"),
|
|
56
90
|
h("button", { onClick: () => this.dataUnit.loadData() }, "Carregar"),
|
|
57
91
|
h("button", { onClick: () => this.save(), disabled: !this.isDirty }, "Salvar"),
|
|
58
|
-
h("ez-form", { dataUnit: this.dataUnit })));
|
|
92
|
+
h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig })));
|
|
59
93
|
}
|
|
60
94
|
static get is() { return "test-du"; }
|
|
61
95
|
static get originalStyleUrls() { return {
|
|
@@ -158,6 +158,12 @@ export const EzUpload: {
|
|
|
158
158
|
new (): EzUpload;
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
+
interface EzViewStack extends Components.EzViewStack, HTMLElement {}
|
|
162
|
+
export const EzViewStack: {
|
|
163
|
+
prototype: EzViewStack;
|
|
164
|
+
new (): EzViewStack;
|
|
165
|
+
};
|
|
166
|
+
|
|
161
167
|
interface GridConfig extends Components.GridConfig, HTMLElement {}
|
|
162
168
|
export const GridConfig: {
|
|
163
169
|
prototype: GridConfig;
|