@sankhyalabs/ezui 1.1.4 → 1.1.8
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/README.md +72 -72
- package/dist/{ezui/DataUnit-285bec19.js → cjs/DataUnit-28b290cb.js} +382 -369
- package/dist/{ezui/index-919090de.js → cjs/RequestMetadata-2cd01e8a.js} +4 -383
- package/dist/cjs/ez-action-chip.cjs.entry.js +52 -0
- package/dist/cjs/ez-button_14.cjs.entry.js +3341 -0
- package/dist/cjs/ez-label-chip.cjs.entry.js +131 -0
- package/dist/cjs/ez-modal.cjs.entry.js +115 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +248 -0
- package/dist/cjs/ez-time-input.cjs.entry.js +180 -0
- package/dist/cjs/ezui.cjs.js +19 -0
- package/dist/cjs/form-metadata.cjs.entry.js +74 -0
- package/dist/cjs/index-9403fe8f.js +1322 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +31 -0
- package/dist/collection/components/ez-action-chip/ez-action-chip.css +82 -0
- package/dist/collection/components/ez-action-chip/ez-action-chip.js +109 -0
- package/dist/collection/components/ez-button/ez-button.css +94 -0
- package/dist/collection/components/ez-button/ez-button.js +125 -0
- package/dist/collection/components/ez-calendar/ez-calendar.css +210 -0
- package/dist/collection/components/ez-calendar/ez-calendar.js +215 -0
- package/dist/collection/components/ez-check/ez-check.css +266 -0
- package/dist/collection/components/ez-check/ez-check.js +168 -0
- package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.css +68 -0
- package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.js +108 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box-interfaces.js +2 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +167 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +363 -0
- package/dist/collection/components/ez-date-input/ez-date-input.css +39 -0
- package/dist/collection/components/ez-date-input/ez-date-input.js +172 -0
- package/dist/collection/components/ez-form/ez-form.css +19 -0
- package/dist/collection/components/ez-form/ez-form.js +368 -0
- package/dist/collection/components/ez-form/store/Form.actions.js +132 -0
- package/dist/collection/components/ez-form/store/Form.reducer.js +194 -0
- package/dist/collection/components/ez-form/store/Form.selectors.js +44 -0
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +207 -0
- package/dist/collection/components/ez-form/subcomponents/FormMetadata.js +16 -0
- package/dist/collection/components/ez-form/subcomponents/css/place-holder.css +24 -0
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +173 -0
- package/dist/collection/components/ez-form/subcomponents/place-holder.js +14 -0
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +71 -0
- package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +27 -0
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +40 -0
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +27 -0
- package/dist/collection/components/ez-icon/ez-icon.css +37 -0
- package/dist/collection/components/ez-icon/ez-icon.js +56 -0
- package/dist/collection/components/ez-label-chip/ez-label-chip.css +117 -0
- package/dist/collection/components/ez-label-chip/ez-label-chip.js +276 -0
- package/dist/collection/components/ez-modal/ez-modal.css +87 -0
- package/dist/collection/components/ez-modal/ez-modal.js +224 -0
- package/dist/collection/components/ez-number-input/ez-number-input.css +144 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +465 -0
- package/dist/collection/components/ez-popover/ez-popover.css +39 -0
- package/dist/collection/components/ez-popover/ez-popover.js +323 -0
- package/dist/collection/components/ez-search/ez-search.css +296 -0
- package/dist/{ezui/ez-search.entry.js → collection/components/ez-search/ez-search.js} +527 -334
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +126 -0
- package/dist/{ezui/ez-tabselector.entry.js → collection/components/ez-tabselector/ez-tabselector.js} +283 -209
- package/dist/collection/components/ez-text-area/ez-text-area.css +140 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js +267 -0
- package/dist/collection/components/ez-text-input/ez-text-input.css +170 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js +395 -0
- package/dist/collection/components/ez-time-input/ez-time-input.css +155 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js +326 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/servidor.js +101 -0
- package/dist/collection/utils/FloatingManager.js +16 -0
- package/dist/collection/utils/utils.js +6 -0
- package/dist/custom-elements/index.js +5071 -0
- package/dist/esm/DataUnit-69e518fa.js +378 -0
- package/dist/esm/RequestMetadata-c265c9d5.js +527 -0
- package/dist/{ezui → esm}/ez-action-chip.entry.js +42 -42
- package/dist/esm/ez-button_14.entry.js +3324 -0
- package/dist/{ezui → esm}/ez-label-chip.entry.js +121 -121
- package/dist/{ezui → esm}/ez-modal.entry.js +105 -96
- package/dist/{ezui → esm}/ez-number-input.entry.js +238 -238
- package/dist/{ezui → esm}/ez-time-input.entry.js +170 -170
- package/dist/esm/ezui.js +17 -0
- package/dist/{ezui → esm}/form-metadata.entry.js +66 -66
- package/dist/esm/index-95bb3fd9.js +1293 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/ezui/ezui.esm.js +1 -122
- package/dist/ezui/index.esm.js +0 -1
- package/dist/ezui/p-10ef58b3.js +1 -0
- package/dist/ezui/p-185c57f4.js +1 -0
- package/dist/ezui/p-22b82efb.entry.js +1 -0
- package/dist/ezui/p-77fdb4fd.entry.js +1 -0
- package/dist/ezui/p-9dfccb16.js +1 -0
- package/dist/ezui/p-b0974f4f.entry.js +1 -0
- package/dist/ezui/p-db11c600.entry.js +1 -0
- package/dist/ezui/p-dd4331b7.entry.js +1 -0
- package/dist/ezui/p-f6fd31ab.entry.js +1 -0
- package/dist/ezui/p-fa260f22.entry.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +16 -16
- package/dist/types/components/ez-button/ez-button.d.ts +20 -20
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +42 -42
- package/dist/types/components/ez-check/ez-check.d.ts +32 -32
- package/dist/types/components/ez-collapsable-box/ez-collapsable-box.d.ts +18 -18
- package/dist/types/components/ez-combo-box/ez-combo-box-interfaces.d.ts +4 -4
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +68 -68
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +31 -31
- package/dist/types/components/ez-form/ez-form.d.ts +31 -27
- package/dist/types/components/ez-form/store/Form.actions.d.ts +111 -104
- package/dist/types/components/ez-form/store/Form.reducer.d.ts +20 -11
- package/dist/types/components/ez-form/store/Form.selectors.d.ts +14 -13
- package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +55 -48
- package/dist/types/components/ez-form/subcomponents/FormMetadata.d.ts +41 -41
- package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +15 -15
- package/dist/types/components/ez-form/subcomponents/place-holder.d.ts +3 -3
- package/dist/types/components/ez-form/subcomponents/structure/Field.d.ts +10 -10
- package/dist/types/components/ez-form/subcomponents/structure/FieldSet.d.ts +12 -12
- package/dist/types/components/ez-form/subcomponents/structure/FormSheet.d.ts +13 -13
- package/dist/types/components/ez-form/subcomponents/structure/NavigationBar.d.ts +17 -7
- package/dist/types/components/ez-icon/ez-icon.d.ts +5 -5
- package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +40 -40
- package/dist/types/components/ez-modal/ez-modal.d.ts +32 -26
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +73 -73
- package/dist/types/components/ez-popover/ez-popover.d.ts +52 -52
- package/dist/types/components/ez-search/ez-search.d.ts +95 -95
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +31 -31
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +49 -49
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +64 -64
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +53 -53
- package/dist/types/components.d.ts +8 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +2 -2
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +13 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +114 -114
- package/react/components.d.ts +22 -0
- package/react/components.js +25 -0
- package/react/components.js.map +1 -0
- package/react/react-component-lib/createComponent.d.ts +10 -0
- package/react/react-component-lib/createComponent.js +59 -0
- package/react/react-component-lib/createComponent.js.map +1 -0
- package/react/react-component-lib/createOverlayComponent.d.ts +20 -0
- package/react/react-component-lib/createOverlayComponent.js +89 -0
- package/react/react-component-lib/createOverlayComponent.js.map +1 -0
- package/react/react-component-lib/index.d.ts +2 -0
- package/react/react-component-lib/index.js +3 -0
- package/react/react-component-lib/index.js.map +1 -0
- package/react/react-component-lib/interfaces.d.ts +29 -0
- package/react/react-component-lib/interfaces.js +1 -0
- package/react/react-component-lib/interfaces.js.map +1 -0
- package/react/react-component-lib/utils/attachProps.d.ts +12 -0
- package/react/react-component-lib/utils/attachProps.js +96 -0
- package/react/react-component-lib/utils/attachProps.js.map +1 -0
- package/react/react-component-lib/utils/case.d.ts +2 -0
- package/react/react-component-lib/utils/case.js +7 -0
- package/react/react-component-lib/utils/case.js.map +1 -0
- package/react/react-component-lib/utils/dev.d.ts +2 -0
- package/react/react-component-lib/utils/dev.js +13 -0
- package/react/react-component-lib/utils/dev.js.map +1 -0
- package/react/react-component-lib/utils/index.d.ts +7 -0
- package/react/react-component-lib/utils/index.js +21 -0
- package/react/react-component-lib/utils/index.js.map +1 -0
- package/dist/ezui/app-globals-0f993ce5.js +0 -3
- package/dist/ezui/css-shim-003e9264.js +0 -4
- package/dist/ezui/dom-1b195079.js +0 -73
- package/dist/ezui/ez-button.entry.js +0 -47
- package/dist/ezui/ez-calendar.entry.js +0 -102
- package/dist/ezui/ez-check.entry.js +0 -62
- package/dist/ezui/ez-collapsable-box.entry.js +0 -32
- package/dist/ezui/ez-combo-box.entry.js +0 -181
- package/dist/ezui/ez-date-input.entry.js +0 -77
- package/dist/ezui/ez-form.entry.js +0 -1907
- package/dist/ezui/ez-icon.entry.js +0 -17
- package/dist/ezui/ez-popover.entry.js +0 -112
- package/dist/ezui/ez-text-area.entry.js +0 -105
- package/dist/ezui/ez-text-input.entry.js +0 -202
- package/dist/ezui/index-39044be2.js +0 -2832
- package/dist/ezui/place-holder.entry.js +0 -15
- package/dist/ezui/shadow-css-c1ad5fdc.js +0 -383
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { Component, Prop, h, Watch, Host, Method, Event, Element } from '@stencil/core';
|
|
2
|
+
import { isValidNumber } from '../../utils/utils';
|
|
3
|
+
import { MaskFormatter } from '@sankhyalabs/core';
|
|
4
|
+
export class EzTextInput {
|
|
5
|
+
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Deixa o campo disponível ou não para digitação.
|
|
8
|
+
*/
|
|
9
|
+
this.enabled = true;
|
|
10
|
+
}
|
|
11
|
+
showError() {
|
|
12
|
+
const hasError = typeof this.errormessage === 'string' && this.errormessage !== '';
|
|
13
|
+
if (hasError) {
|
|
14
|
+
this._inputElem.classList.add('hasError');
|
|
15
|
+
this._messageBoxElem.classList.add('hasError');
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this._inputElem.classList.remove('hasError');
|
|
19
|
+
this._messageBoxElem.classList.remove('hasError');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
prepareMask() {
|
|
23
|
+
if (this.mask) {
|
|
24
|
+
if (this._maskFormatter == undefined) {
|
|
25
|
+
this._maskFormatter = new MaskFormatter(this.mask);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this._maskFormatter.mask = this.mask;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
updateInputValue() {
|
|
33
|
+
this._inputElem.value = this.value;
|
|
34
|
+
this.handleChange();
|
|
35
|
+
this.ezChange.emit();
|
|
36
|
+
this.adjustFloatingLabel();
|
|
37
|
+
}
|
|
38
|
+
adjustFloatingLabel() {
|
|
39
|
+
if (this.label) {
|
|
40
|
+
if (!this._inputElem.classList.contains("input--with--label")) {
|
|
41
|
+
this._inputElem.classList.add("input--with--label");
|
|
42
|
+
}
|
|
43
|
+
const hasValue = this.value && this.value.toString().length > 0;
|
|
44
|
+
const containsFloatedClass = this._labelElem.classList.contains("input__label--floated");
|
|
45
|
+
if (hasValue || this.isFocused()) {
|
|
46
|
+
if (!containsFloatedClass) {
|
|
47
|
+
this._labelElem.classList.add("input__label--floated");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
if (containsFloatedClass) {
|
|
52
|
+
this._labelElem.classList.remove("input__label--floated");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
isFocused() {
|
|
58
|
+
return this._hostElement.shadowRoot.activeElement !== null;
|
|
59
|
+
}
|
|
60
|
+
//---------------------------------------------
|
|
61
|
+
// Public methods
|
|
62
|
+
//---------------------------------------------
|
|
63
|
+
/**
|
|
64
|
+
* Faz o foco no componente de input
|
|
65
|
+
*/
|
|
66
|
+
async setFocus() {
|
|
67
|
+
this._inputElem.focus();
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Remove o foco no componente de input
|
|
71
|
+
*/
|
|
72
|
+
async setBlur() {
|
|
73
|
+
this._inputElem.blur();
|
|
74
|
+
}
|
|
75
|
+
//---------------------------------------------
|
|
76
|
+
// Event handlers
|
|
77
|
+
//---------------------------------------------
|
|
78
|
+
handleFocusout() {
|
|
79
|
+
const value = this._inputElem.value;
|
|
80
|
+
if (value && this._maskFormatter) {
|
|
81
|
+
try {
|
|
82
|
+
this._inputElem.value = this._maskFormatter.format(value);
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
this.errormessage = e.message;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
this.value = this._inputElem.value;
|
|
89
|
+
this.adjustFloatingLabel();
|
|
90
|
+
}
|
|
91
|
+
isValidValue(value) {
|
|
92
|
+
if (this.onlynumber) {
|
|
93
|
+
return value == "" || isValidNumber(value);
|
|
94
|
+
}
|
|
95
|
+
if (this.restrict) {
|
|
96
|
+
return Array.from(value).reduce((valid, c) => valid && this.restrict.indexOf(c) > -1, true);
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
handleChange() {
|
|
101
|
+
if (!this._inputElem) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const value = this._inputElem.value;
|
|
105
|
+
if (this.isValidValue(value)) {
|
|
106
|
+
this._lastValidValue = value;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this._inputElem.value = this._lastValidValue === undefined ? "" : this._lastValidValue;
|
|
110
|
+
}
|
|
111
|
+
this.value = this._inputElem.value;
|
|
112
|
+
}
|
|
113
|
+
handleSlotChange(ev) {
|
|
114
|
+
const slot = ev.target;
|
|
115
|
+
const content = slot.assignedElements()[0];
|
|
116
|
+
if (content) {
|
|
117
|
+
content.style.position = "absolute";
|
|
118
|
+
content.style.display = "flex";
|
|
119
|
+
content.style.alignItems = "center";
|
|
120
|
+
content.style.justifyContent = "center";
|
|
121
|
+
content.style.overflow = "hidden";
|
|
122
|
+
content.style.top = "0px";
|
|
123
|
+
content.style.width = "var(--it__icon--width)";
|
|
124
|
+
content.style.height = "var(--it--height)";
|
|
125
|
+
if (slot.name == "leftIcon") {
|
|
126
|
+
content.style.left = "0px";
|
|
127
|
+
content.style.borderRadius = "var(--it--border-radius) 0 0 var(--it--border-radius)";
|
|
128
|
+
this._inputElem.classList.add('icon--left');
|
|
129
|
+
if (this._labelElem) {
|
|
130
|
+
this._labelElem.classList.add('input__label--left');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else if (slot.name == "rightIcon") {
|
|
134
|
+
content.style.right = "0px";
|
|
135
|
+
content.style.borderRadius = "0 var(--it--border-radius) var(--it--border-radius) 0";
|
|
136
|
+
this._inputElem.classList.add('icon--right');
|
|
137
|
+
if (this._labelElem) {
|
|
138
|
+
this._labelElem.classList.add('input__label--right');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
this.showError();
|
|
143
|
+
}
|
|
144
|
+
doFocus() {
|
|
145
|
+
if (this.label && this._labelElem && !this._labelElem.classList.contains("input__label--floated")) {
|
|
146
|
+
this._labelElem.classList.add("input__label--floated");
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//---------------------------------------------
|
|
150
|
+
// Lifecycle web component
|
|
151
|
+
//---------------------------------------------
|
|
152
|
+
componentDidLoad() {
|
|
153
|
+
if (this.onlynumber) {
|
|
154
|
+
this._inputElem.classList.add('text--right');
|
|
155
|
+
}
|
|
156
|
+
this.showError();
|
|
157
|
+
this.prepareMask();
|
|
158
|
+
this.adjustFloatingLabel();
|
|
159
|
+
}
|
|
160
|
+
componentWillLoad() {
|
|
161
|
+
this.prepareMask();
|
|
162
|
+
if (this.value) {
|
|
163
|
+
if (this._maskFormatter) {
|
|
164
|
+
try {
|
|
165
|
+
this.value = this._maskFormatter.format(this.value);
|
|
166
|
+
}
|
|
167
|
+
catch (e) {
|
|
168
|
+
this.errormessage = e.message;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (!this.isValidValue(this.value)) {
|
|
172
|
+
this._lastValidValue = "";
|
|
173
|
+
this.value = "";
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
render() {
|
|
178
|
+
return (h(Host, null,
|
|
179
|
+
h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
|
|
180
|
+
this.label ?
|
|
181
|
+
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
182
|
+
: null,
|
|
183
|
+
h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }),
|
|
184
|
+
h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
|
|
185
|
+
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errormessage }, this.errormessage)));
|
|
186
|
+
}
|
|
187
|
+
static get is() { return "ez-text-input"; }
|
|
188
|
+
static get encapsulation() { return "shadow"; }
|
|
189
|
+
static get originalStyleUrls() { return {
|
|
190
|
+
"$": ["ez-text-input.css"]
|
|
191
|
+
}; }
|
|
192
|
+
static get styleUrls() { return {
|
|
193
|
+
"$": ["ez-text-input.css"]
|
|
194
|
+
}; }
|
|
195
|
+
static get properties() { return {
|
|
196
|
+
"label": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"mutable": false,
|
|
199
|
+
"complexType": {
|
|
200
|
+
"original": "string",
|
|
201
|
+
"resolved": "string",
|
|
202
|
+
"references": {}
|
|
203
|
+
},
|
|
204
|
+
"required": false,
|
|
205
|
+
"optional": false,
|
|
206
|
+
"docs": {
|
|
207
|
+
"tags": [],
|
|
208
|
+
"text": "Label \u00E9 o t\u00EDtulo do campo"
|
|
209
|
+
},
|
|
210
|
+
"attribute": "label",
|
|
211
|
+
"reflect": true
|
|
212
|
+
},
|
|
213
|
+
"value": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"mutable": true,
|
|
216
|
+
"complexType": {
|
|
217
|
+
"original": "string",
|
|
218
|
+
"resolved": "string",
|
|
219
|
+
"references": {}
|
|
220
|
+
},
|
|
221
|
+
"required": false,
|
|
222
|
+
"optional": false,
|
|
223
|
+
"docs": {
|
|
224
|
+
"tags": [],
|
|
225
|
+
"text": "Valor digitado pelo usu\u00E1rio. Este valor \u00E9 o que fica vis\u00EDvel no campo."
|
|
226
|
+
},
|
|
227
|
+
"attribute": "value",
|
|
228
|
+
"reflect": true
|
|
229
|
+
},
|
|
230
|
+
"enabled": {
|
|
231
|
+
"type": "boolean",
|
|
232
|
+
"mutable": false,
|
|
233
|
+
"complexType": {
|
|
234
|
+
"original": "boolean",
|
|
235
|
+
"resolved": "boolean",
|
|
236
|
+
"references": {}
|
|
237
|
+
},
|
|
238
|
+
"required": false,
|
|
239
|
+
"optional": false,
|
|
240
|
+
"docs": {
|
|
241
|
+
"tags": [],
|
|
242
|
+
"text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para digita\u00E7\u00E3o."
|
|
243
|
+
},
|
|
244
|
+
"attribute": "enabled",
|
|
245
|
+
"reflect": true,
|
|
246
|
+
"defaultValue": "true"
|
|
247
|
+
},
|
|
248
|
+
"loading": {
|
|
249
|
+
"type": "boolean",
|
|
250
|
+
"mutable": false,
|
|
251
|
+
"complexType": {
|
|
252
|
+
"original": "boolean",
|
|
253
|
+
"resolved": "boolean",
|
|
254
|
+
"references": {}
|
|
255
|
+
},
|
|
256
|
+
"required": false,
|
|
257
|
+
"optional": false,
|
|
258
|
+
"docs": {
|
|
259
|
+
"tags": [],
|
|
260
|
+
"text": "Deixa o componente em modo \"carregando\"."
|
|
261
|
+
},
|
|
262
|
+
"attribute": "loading",
|
|
263
|
+
"reflect": true
|
|
264
|
+
},
|
|
265
|
+
"errormessage": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"mutable": true,
|
|
268
|
+
"complexType": {
|
|
269
|
+
"original": "string",
|
|
270
|
+
"resolved": "string",
|
|
271
|
+
"references": {}
|
|
272
|
+
},
|
|
273
|
+
"required": false,
|
|
274
|
+
"optional": false,
|
|
275
|
+
"docs": {
|
|
276
|
+
"tags": [],
|
|
277
|
+
"text": "Quando h\u00E1 um problema de valida\u00E7\u00E3o, serve como orienta\u00E7\u00E3o ao usu\u00E1rio"
|
|
278
|
+
},
|
|
279
|
+
"attribute": "errormessage",
|
|
280
|
+
"reflect": true
|
|
281
|
+
},
|
|
282
|
+
"onlynumber": {
|
|
283
|
+
"type": "boolean",
|
|
284
|
+
"mutable": false,
|
|
285
|
+
"complexType": {
|
|
286
|
+
"original": "boolean",
|
|
287
|
+
"resolved": "boolean",
|
|
288
|
+
"references": {}
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"optional": false,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": "Faz com que o componente s\u00F3 aceite n\u00FAmeros"
|
|
295
|
+
},
|
|
296
|
+
"attribute": "onlynumber",
|
|
297
|
+
"reflect": true
|
|
298
|
+
},
|
|
299
|
+
"mask": {
|
|
300
|
+
"type": "string",
|
|
301
|
+
"mutable": false,
|
|
302
|
+
"complexType": {
|
|
303
|
+
"original": "string",
|
|
304
|
+
"resolved": "string",
|
|
305
|
+
"references": {}
|
|
306
|
+
},
|
|
307
|
+
"required": false,
|
|
308
|
+
"optional": false,
|
|
309
|
+
"docs": {
|
|
310
|
+
"tags": [],
|
|
311
|
+
"text": "Aplica uma m\u00E1scara no conte\u00FAdo conforme um o padr\u00E3o estabelecido"
|
|
312
|
+
},
|
|
313
|
+
"attribute": "mask",
|
|
314
|
+
"reflect": false
|
|
315
|
+
},
|
|
316
|
+
"restrict": {
|
|
317
|
+
"type": "string",
|
|
318
|
+
"mutable": false,
|
|
319
|
+
"complexType": {
|
|
320
|
+
"original": "string",
|
|
321
|
+
"resolved": "string",
|
|
322
|
+
"references": {}
|
|
323
|
+
},
|
|
324
|
+
"required": false,
|
|
325
|
+
"optional": false,
|
|
326
|
+
"docs": {
|
|
327
|
+
"tags": [],
|
|
328
|
+
"text": "Restringe o que o usu\u00E1rio pode digitar. Cada caractere digitado ser\u00E1 testado\ne deve estar contido nessa string ou ser\u00E1 descartado."
|
|
329
|
+
},
|
|
330
|
+
"attribute": "restrict",
|
|
331
|
+
"reflect": false
|
|
332
|
+
}
|
|
333
|
+
}; }
|
|
334
|
+
static get events() { return [{
|
|
335
|
+
"method": "ezChange",
|
|
336
|
+
"name": "ezChange",
|
|
337
|
+
"bubbles": true,
|
|
338
|
+
"cancelable": true,
|
|
339
|
+
"composed": true,
|
|
340
|
+
"docs": {
|
|
341
|
+
"tags": [],
|
|
342
|
+
"text": ""
|
|
343
|
+
},
|
|
344
|
+
"complexType": {
|
|
345
|
+
"original": "string",
|
|
346
|
+
"resolved": "string",
|
|
347
|
+
"references": {}
|
|
348
|
+
}
|
|
349
|
+
}]; }
|
|
350
|
+
static get methods() { return {
|
|
351
|
+
"setFocus": {
|
|
352
|
+
"complexType": {
|
|
353
|
+
"signature": "() => Promise<void>",
|
|
354
|
+
"parameters": [],
|
|
355
|
+
"references": {
|
|
356
|
+
"Promise": {
|
|
357
|
+
"location": "global"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"return": "Promise<void>"
|
|
361
|
+
},
|
|
362
|
+
"docs": {
|
|
363
|
+
"text": "Faz o foco no componente de input",
|
|
364
|
+
"tags": []
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"setBlur": {
|
|
368
|
+
"complexType": {
|
|
369
|
+
"signature": "() => Promise<void>",
|
|
370
|
+
"parameters": [],
|
|
371
|
+
"references": {
|
|
372
|
+
"Promise": {
|
|
373
|
+
"location": "global"
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
"return": "Promise<void>"
|
|
377
|
+
},
|
|
378
|
+
"docs": {
|
|
379
|
+
"text": "Remove o foco no componente de input",
|
|
380
|
+
"tags": []
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}; }
|
|
384
|
+
static get elementRef() { return "_hostElement"; }
|
|
385
|
+
static get watchers() { return [{
|
|
386
|
+
"propName": "errormessage",
|
|
387
|
+
"methodName": "showError"
|
|
388
|
+
}, {
|
|
389
|
+
"propName": "mask",
|
|
390
|
+
"methodName": "prepareMask"
|
|
391
|
+
}, {
|
|
392
|
+
"propName": "value",
|
|
393
|
+
"methodName": "updateInputValue"
|
|
394
|
+
}]; }
|
|
395
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
/* dimensions */
|
|
3
|
+
--eztime--height: 42px;
|
|
4
|
+
--eztime--width: 100%;
|
|
5
|
+
--eztime__icon--width: 48px;
|
|
6
|
+
/* general */
|
|
7
|
+
--eztime--border-radius: var(--border--radius-medium, 12px);
|
|
8
|
+
--eztime--font-size: var(--text--medium, 14px);
|
|
9
|
+
--eztime--font-family: var(--font-pattern, Arial);
|
|
10
|
+
--eztime--font-weight: var(--text-weight--large, 500);
|
|
11
|
+
--eztime--space--medium: var(--space--medium, 6px);
|
|
12
|
+
|
|
13
|
+
/* input */
|
|
14
|
+
--eztime__input--background-color: var(--background--medium, #e0e0e0);
|
|
15
|
+
--eztime__input--border: var(--border--medium, 2px solid);
|
|
16
|
+
--eztime__input--border-color: var(--eztime__input--background-color);
|
|
17
|
+
/*no modo normal usamos a borda com a mesma cor do bg*/
|
|
18
|
+
--eztime__input--focus--border-color: var(--color--primary, #008561);
|
|
19
|
+
--eztime__input--disabled--background-color: var(--color--disable-secondary, #F2F5F8);
|
|
20
|
+
--eztime__input--disabled--color: var(--text--disable, #AFB6C0);
|
|
21
|
+
--eztime__input--error--border-color: #CC2936;
|
|
22
|
+
/* label */
|
|
23
|
+
--eztime__label--color: var(--title--primary, #919191);
|
|
24
|
+
/* message box */
|
|
25
|
+
--eztime__message_box--font-size: var(--text--small, 12px);
|
|
26
|
+
--eztime__message_box--info--color: var(--color--success, #22085d);
|
|
27
|
+
--eztime__message_box--error--color: var(--color--error, #FF0000);
|
|
28
|
+
/***************
|
|
29
|
+
host style
|
|
30
|
+
***************/
|
|
31
|
+
/*private*/
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
position: relative;
|
|
35
|
+
/*public*/
|
|
36
|
+
width: var(--eztime--width);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.invisible {
|
|
40
|
+
visibility: hidden;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
input {
|
|
44
|
+
/*private*/
|
|
45
|
+
width: 100%;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
padding: var(--space--medium, 6px);
|
|
48
|
+
font-weight: var(--text-weight--large, 600);
|
|
49
|
+
/*public*/
|
|
50
|
+
height: var(--eztime--height);
|
|
51
|
+
border-radius: var(--eztime--border-radius);
|
|
52
|
+
font-family: var(--eztime--font-family);
|
|
53
|
+
font-size: var(--eztime--font-size);
|
|
54
|
+
border: var(--eztime__input--border);
|
|
55
|
+
border-color: var(--eztime__input--border-color);
|
|
56
|
+
background-color: var(--eztime__input--background-color);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
input:disabled {
|
|
60
|
+
/*public*/
|
|
61
|
+
background-color: var(--eztime__input--disabled--background-color);
|
|
62
|
+
color: var(--eztime__input--disabled--color);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
input:focus {
|
|
66
|
+
/*private*/
|
|
67
|
+
outline: none;
|
|
68
|
+
/*public*/
|
|
69
|
+
border-color: var(--eztime__input--focus--border-color);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
input.icon--left {
|
|
73
|
+
padding-left: var(--eztime__icon--width);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
input.icon--right {
|
|
77
|
+
padding-right: var(--eztime__icon--width);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
input::placeholder {
|
|
81
|
+
color: var(--eztime__placeholder--color);
|
|
82
|
+
font-weight: var(--eztime__placeholder--font-weight);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
input:disabled::placeholder {
|
|
86
|
+
color: var(--eztime__placeholder--disabled--color);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
input.hasError {
|
|
90
|
+
color: inherit;
|
|
91
|
+
border-color: var(--eztime__input--error--border-color);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
input.text--right {
|
|
95
|
+
text-align: right;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.message-box {
|
|
99
|
+
/*private*/
|
|
100
|
+
min-height: 16px;
|
|
101
|
+
min-width: 100%;
|
|
102
|
+
margin-top: 2px;
|
|
103
|
+
line-height: 12px;
|
|
104
|
+
/*public*/
|
|
105
|
+
font-family: var(--eztime--font-family);
|
|
106
|
+
font-size: var(--eztime__message_box--font-size);
|
|
107
|
+
color: var(--eztime__message_box--info--color);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.hasError {
|
|
111
|
+
/*public*/
|
|
112
|
+
color: var(--eztime__message_box--error--color);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.input__label {
|
|
116
|
+
/*public*/
|
|
117
|
+
font-size: var(--eztime--font-size);
|
|
118
|
+
font-weight: var(--eztime--font-weight);
|
|
119
|
+
position: absolute;
|
|
120
|
+
color: var(it__label--color);
|
|
121
|
+
top: var(--eztime--space--medium);
|
|
122
|
+
font-family: var(--eztime--font-family);
|
|
123
|
+
-webkit-transition: font-size .3s, top .3s;
|
|
124
|
+
transition: font-size .3s, top .3s;
|
|
125
|
+
z-index: var(--visible);
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
text-overflow: ellipsis;
|
|
129
|
+
left: var(--eztime__icon--width);
|
|
130
|
+
width: calc(100% - 10px - var(--eztime__icon--width));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.input__label--floated {
|
|
134
|
+
font-family: var(--eztime--font-family);
|
|
135
|
+
font-size: var(--text--extra-small);
|
|
136
|
+
top: var(--space--small);
|
|
137
|
+
color: var(--text--primary);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.input__label--left {
|
|
141
|
+
/*public*/
|
|
142
|
+
left: var(--eztime__icon--width);
|
|
143
|
+
width: calc(100% - 10px - var(--eztime__icon--width));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.input__label--right {
|
|
147
|
+
/*public*/
|
|
148
|
+
padding-right: var(--eztime__icon--width);
|
|
149
|
+
width: calc(100% - 10px - var(--eztime__icon--width));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.input--with--label {
|
|
153
|
+
/*public*/
|
|
154
|
+
padding-bottom: 0;
|
|
155
|
+
}
|