@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
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-39044be2.js';
|
|
2
|
-
|
|
3
|
-
const ezIconCss = ":host{display:block;overflow:hidden;position:relative}svg{display:flex;justify-content:center;align-items:center;fill:var(--color--icon)}.x-small{width:12px;height:12px}.small{width:16px;height:16px}.medium{width:20px;height:20px}.large{width:24px;height:24px}.x-large{width:30px;height:30px}";
|
|
4
|
-
|
|
5
|
-
const EzIcon = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
/*Tamanho do icone*/
|
|
9
|
-
this.size = 'medium';
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return (h("svg", { class: this.size, role: "img" }, h("use", { xlinkHref: this.href })));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
EzIcon.style = ezIconCss;
|
|
16
|
-
|
|
17
|
-
export { EzIcon as ez_icon };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, i as Host, g as getElement } from './index-39044be2.js';
|
|
2
|
-
import { F as FloatingManager } from './index-919090de.js';
|
|
3
|
-
|
|
4
|
-
const ezPopoverCss = ":host{--pop__box--border-radius:var(--border--radius-medium, 12px);--pop__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);position:relative;display:flex;user-select:none;width:100%}.box{z-index:var(--more-visible, 1);display:flex;flex-direction:column;height:fit-content;background-color:transparent;border-radius:var(--pop__box--border-radius);box-shadow:var(--pop__box--box-shadow)}.box--fit-content{width:fit-content}.box--full-width{width:100%}";
|
|
5
|
-
|
|
6
|
-
const EzPopover = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this._firstRender = true;
|
|
10
|
-
/**
|
|
11
|
-
* No modo floating = false o popover só se tornará visível
|
|
12
|
-
* quando o método show() for acionado.
|
|
13
|
-
*/
|
|
14
|
-
this.autoclose = true;
|
|
15
|
-
/**
|
|
16
|
-
* Offset top do popover em relação ao componente pai
|
|
17
|
-
*/
|
|
18
|
-
this.top = '0px';
|
|
19
|
-
/**
|
|
20
|
-
* Offset left do popover em relação ao componente pai
|
|
21
|
-
*/
|
|
22
|
-
this.left = '0px';
|
|
23
|
-
/**
|
|
24
|
-
* Offset bottom do popover em relação ao componente pai
|
|
25
|
-
*/
|
|
26
|
-
this.bottom = '0px';
|
|
27
|
-
/**
|
|
28
|
-
* Offset right do popover em relação ao componente pai
|
|
29
|
-
*/
|
|
30
|
-
this.right = '0px';
|
|
31
|
-
/**
|
|
32
|
-
* Ajusta o comportamento da largura do popover.
|
|
33
|
-
* Opções: "100% e "fit-content" (default)
|
|
34
|
-
*/
|
|
35
|
-
this.boxwidth = 'fit-content';
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Atualiza a posição do popover em relação ao componente pai.
|
|
39
|
-
*/
|
|
40
|
-
async updatePosition(top = this.top, left = this.left, bottom = this.bottom, right = this.right) {
|
|
41
|
-
const floatingOptions = {
|
|
42
|
-
autoClose: this.autoclose,
|
|
43
|
-
top,
|
|
44
|
-
left,
|
|
45
|
-
bottom,
|
|
46
|
-
right,
|
|
47
|
-
innerClickTest: (_container, node) => {
|
|
48
|
-
if (_container.contains(node)) {
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
if (_container.shadowRoot && _container.shadowRoot.contains(node)) {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
//Here: we pass this._box as parameter but we need to change to _host
|
|
55
|
-
//because we need to get the lasChild (inner content to put in slot)
|
|
56
|
-
_container = this._host;
|
|
57
|
-
return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
FloatingManager.updateFloatPosition(this._box, this._container, floatingOptions);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Faz com que o popover seja renderizado na DOM.
|
|
64
|
-
*
|
|
65
|
-
*/
|
|
66
|
-
async show(top = this.top, left = this.left, bottom = this.bottom, right = this.right) {
|
|
67
|
-
const floatingOptions = {
|
|
68
|
-
autoClose: this.autoclose,
|
|
69
|
-
top,
|
|
70
|
-
left,
|
|
71
|
-
bottom,
|
|
72
|
-
right,
|
|
73
|
-
innerClickTest: (_container, node) => {
|
|
74
|
-
if (_container.contains(node)) {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
if (_container.shadowRoot && _container.shadowRoot.contains(node)) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
// Here: we pass this._box as parameter but we need to change to _host
|
|
81
|
-
// because we need to get the lasChild (inner content to put in slot)
|
|
82
|
-
_container = this._host;
|
|
83
|
-
return !_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
this._floatingID = FloatingManager.float(this._box, this._container, floatingOptions);
|
|
87
|
-
this.isOpened = true;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Usado no modo floating. Faz com que o componente seja ocultado.
|
|
91
|
-
*/
|
|
92
|
-
async hide() {
|
|
93
|
-
if (this._floatingID !== undefined) {
|
|
94
|
-
FloatingManager.close(this._floatingID);
|
|
95
|
-
this._floatingID = undefined;
|
|
96
|
-
this.isOpened = false;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
componentDidRender() {
|
|
100
|
-
if (this._firstRender) {
|
|
101
|
-
this._box.remove();
|
|
102
|
-
this._firstRender = false;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
render() {
|
|
106
|
-
return (h(Host, null, h("section", { ref: el => this._container = el }, h("div", { class: `box ${this.boxwidth === 'fit-content' ? 'box--fit-content' : 'box--full-width'}`, ref: el => this._box = el }, h("slot", null)))));
|
|
107
|
-
}
|
|
108
|
-
get _host() { return getElement(this); }
|
|
109
|
-
};
|
|
110
|
-
EzPopover.style = ezPopoverCss;
|
|
111
|
-
|
|
112
|
-
export { EzPopover as ez_popover };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, i as Host, g as getElement } from './index-39044be2.js';
|
|
2
|
-
|
|
3
|
-
const ezTextAreaCss = ":host{--ta--width:100%;--ta--border-radius:var(--border--radius-medium, 12px);--ta--font-size:var(--text--medium, 14px);--ta--font-family:var(--font-pattern, Arial);--ta--font-weight:var(--text-weight--large, 500);--ta--color:var(--title--primary, #000);--ta__input--background-color:var(--background--medium, #e0e0e0);--ta__input--border:var(--border--medium, 2px solid);--ta__input--border-color:var(--ta__input--background-color);--ta__input--focus--border-color:var(--color--primary, #008561);--ta__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ta__input--disabled--color:var(--text--disable, #AFB6C0);--ta__input--error--border-color:#CC2936;--ta__input--floating--padding-top:16px;--ta__message_box--font-size:var(--text--small, 12px);--ta__message_box--info--color:var(--color--success, #22085d);--ta__message_box--error--color:var(--color--error, #FF0000);--ta__label--floating--top:6px;--ta__label--padding-top:12px;--ta__label--padding-left:14px;--ta__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ta--width)}textarea{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);resize:none;border-radius:var(--ta--border-radius);font-family:var(--ta--font-family);font-size:var(--ta--font-size);border:var(--ta__input--border);border-color:var(--ta__input--border-color);background-color:var(--ta__input--background-color);color:var(--ta--color)}textarea:disabled{background-color:var(--ta__input--disabled--background-color);color:var(--ta__input--disabled--color)}textarea:focus{outline:none;border-color:var(--ta__input--focus--border-color)}textarea.hasError{color:var(--ta--color);border-color:var(--ta__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ta--font-family);font-size:var(--ta__message_box--font-size);color:var(--ta__message_box--info--color)}.hasError{color:var(--ta__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ta__label--padding-right));left:var(--ta--space--medium);font-family:var(--ta--font-family);font-size:var(--ta--font-size);font-weight:var(--ta--font-weight);color:var(--ta--color);top:var(--ta__label--padding-top);left:var(--ta__label--padding-left);padding-right:var(--ta__label--padding-right)}.textarea__label--floated{font-family:var(--ta--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ta__label--floating--top)}.textarea__label--disabled{color:var(--ta__input--disabled--color)}.input--with--label{padding-bottom:0;padding-top:var(--ta__input--floating--padding-top)}";
|
|
4
|
-
|
|
5
|
-
const EzTextArea = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
9
|
-
/**
|
|
10
|
-
* Deixa o campo disponível ou não para digitação.
|
|
11
|
-
*/
|
|
12
|
-
this.enabled = true;
|
|
13
|
-
/**
|
|
14
|
-
* Ajusta o numero de linhas e consequentemente o height do textarea. Valor default: 4
|
|
15
|
-
*/
|
|
16
|
-
this.rows = 4;
|
|
17
|
-
}
|
|
18
|
-
showError() {
|
|
19
|
-
const hasError = typeof this.errormessage === 'string' && this.errormessage !== '';
|
|
20
|
-
if (hasError) {
|
|
21
|
-
this._inputElem.classList.add('hasError');
|
|
22
|
-
this._messageBoxElem.classList.add('hasError');
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
this._inputElem.classList.remove('hasError');
|
|
26
|
-
this._messageBoxElem.classList.remove('hasError');
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
updateInputValue() {
|
|
30
|
-
this._inputElem.value = this.value;
|
|
31
|
-
this.handleChange();
|
|
32
|
-
this.adjustFloatingLabel();
|
|
33
|
-
}
|
|
34
|
-
adjustFloatingLabel() {
|
|
35
|
-
if (this.label) {
|
|
36
|
-
if (!this._inputElem.classList.contains("input--with--label")) {
|
|
37
|
-
this._inputElem.classList.add("input--with--label");
|
|
38
|
-
}
|
|
39
|
-
const hasValue = this.value && this.value.toString().length > 0;
|
|
40
|
-
const containsFloatedClass = this._labelElem.classList.contains("textarea__label--floated");
|
|
41
|
-
if (hasValue || this.isFocused()) {
|
|
42
|
-
if (!containsFloatedClass) {
|
|
43
|
-
this._labelElem.classList.add("textarea__label--floated");
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
if (containsFloatedClass) {
|
|
48
|
-
this._labelElem.classList.remove("textarea__label--floated");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
isFocused() {
|
|
54
|
-
return this._hostElement.shadowRoot.activeElement !== null;
|
|
55
|
-
}
|
|
56
|
-
//---------------------------------------------
|
|
57
|
-
// Public methods
|
|
58
|
-
//---------------------------------------------
|
|
59
|
-
/**
|
|
60
|
-
* Faz o foco no componente de input
|
|
61
|
-
*/
|
|
62
|
-
async setFocus() {
|
|
63
|
-
this._inputElem.focus();
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Remove o foco no componente de input
|
|
67
|
-
*/
|
|
68
|
-
async setBlur() {
|
|
69
|
-
this._inputElem.blur();
|
|
70
|
-
}
|
|
71
|
-
//---------------------------------------------
|
|
72
|
-
// Event handlers
|
|
73
|
-
//---------------------------------------------
|
|
74
|
-
handleFocusout() {
|
|
75
|
-
this.adjustFloatingLabel();
|
|
76
|
-
}
|
|
77
|
-
handleChange() {
|
|
78
|
-
this.value = this._inputElem.value;
|
|
79
|
-
}
|
|
80
|
-
handleFocus() {
|
|
81
|
-
if (this.label && this._labelElem && !this._labelElem.classList.contains("textarea__label--floated")) {
|
|
82
|
-
this._labelElem.classList.add("textarea__label--floated");
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
//---------------------------------------------
|
|
86
|
-
// Lifecycle web component
|
|
87
|
-
//---------------------------------------------
|
|
88
|
-
componentDidLoad() {
|
|
89
|
-
this.showError();
|
|
90
|
-
this.adjustFloatingLabel();
|
|
91
|
-
}
|
|
92
|
-
render() {
|
|
93
|
-
return (h(Host, null, this.label ?
|
|
94
|
-
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "textarea__label" : "textarea__label textarea__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
95
|
-
: null, h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows }), h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errormessage }, this.errormessage)));
|
|
96
|
-
}
|
|
97
|
-
get _hostElement() { return getElement(this); }
|
|
98
|
-
static get watchers() { return {
|
|
99
|
-
"errormessage": ["showError"],
|
|
100
|
-
"value": ["updateInputValue"]
|
|
101
|
-
}; }
|
|
102
|
-
};
|
|
103
|
-
EzTextArea.style = ezTextAreaCss;
|
|
104
|
-
|
|
105
|
-
export { EzTextArea as ez_text_area };
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, i as Host, g as getElement } from './index-39044be2.js';
|
|
2
|
-
import { M as MaskFormatter } from './index-919090de.js';
|
|
3
|
-
|
|
4
|
-
function format(first, middle, last) {
|
|
5
|
-
return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
|
|
6
|
-
}
|
|
7
|
-
function isValidNumber(strValue) {
|
|
8
|
-
return strValue && /^-?\d*[.,]?\d*$/.test(strValue);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const ezTextInputCss = ":host{--it--height:42px;--it--width:100%;--it__icon--width:48px;--it--border-radius:var(--border--radius-medium, 12px);--it--font-size:var(--text--medium, 14px);--it--font-family:var(--font-pattern, Arial);--it--font-weight:var(--text-weight--large, 500);--it--color:var(--title--primary, #000);--it__input--background-color:var(--background--medium, #e0e0e0);--it__input--border:var(--border--medium, 2px solid);--it__input--border-color:var(--it__input--background-color);--it__input--focus--border-color:var(--color--primary, #008561);--it__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--it__input--disabled--color:var(--text--disable, #AFB6C0);--it__input--error--border-color:#CC2936;--it__message_box--font-size:var(--text--small, 12px);--it__message_box--info--color:var(--color--success, #22085d);--it__message_box--error--color:var(--color--error, #FF0000);--it__label--floating--top:6px;--it__label--padding-top:12px;--it__label--padding-left:14px;--it__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--it--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--it--height);border-radius:var(--it--border-radius);font-family:var(--it--font-family);font-size:var(--it--font-size);border:var(--it__input--border);border-color:var(--it__input--border-color);background-color:var(--it__input--background-color);color:var(--it--color)}input:disabled{background-color:var(--it__input--disabled--background-color);color:var(--it__input--disabled--color)}input:focus{outline:none;border-color:var(--it__input--focus--border-color)}input.icon--left{padding-left:var(--it__icon--width)}input.icon--right{padding-right:var(--it__icon--width)}input.hasError{color:var(--it--color);border-color:var(--it__input--error--border-color)}input.text--right{text-align:right}.message-box{min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--it--font-family);font-size:var(--it__message_box--font-size);color:var(--it__message_box--info--color)}.hasError{color:var(--it__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--it__label--padding-right));left:var(--it--space--medium);font-family:var(--it--font-family);font-size:var(--it--font-size);font-weight:var(--it--font-weight);color:var(--it--color);top:var(--it__label--padding-top);left:var(--it__label--padding-left);padding-right:var(--it__label--padding-right)}.input__label--floated{font-family:var(--it--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--it__label--floating--top)}.input__label--disabled{color:var(--it__input--disabled--color)}.input__label--left{left:calc(var(--it__icon--width) + 2px);width:calc(100% - var(--it__icon--width))}.input__label--right{right:var(--it__icon--width);width:calc(100% - var(--it__icon--width))}.input__label--left.input__label--right{left:calc(var(--it__icon--width) + 2px);width:calc(100% - var(--it__icon--width) * 2)}.input--with--label{padding-bottom:0}";
|
|
12
|
-
|
|
13
|
-
const EzTextInput = class {
|
|
14
|
-
constructor(hostRef) {
|
|
15
|
-
registerInstance(this, hostRef);
|
|
16
|
-
this.ezChange = createEvent(this, "ezChange", 7);
|
|
17
|
-
/**
|
|
18
|
-
* Deixa o campo disponível ou não para digitação.
|
|
19
|
-
*/
|
|
20
|
-
this.enabled = true;
|
|
21
|
-
}
|
|
22
|
-
showError() {
|
|
23
|
-
const hasError = typeof this.errormessage === 'string' && this.errormessage !== '';
|
|
24
|
-
if (hasError) {
|
|
25
|
-
this._inputElem.classList.add('hasError');
|
|
26
|
-
this._messageBoxElem.classList.add('hasError');
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this._inputElem.classList.remove('hasError');
|
|
30
|
-
this._messageBoxElem.classList.remove('hasError');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
prepareMask() {
|
|
34
|
-
if (this.mask) {
|
|
35
|
-
if (this._maskFormatter == undefined) {
|
|
36
|
-
this._maskFormatter = new MaskFormatter(this.mask);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
this._maskFormatter.mask = this.mask;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
updateInputValue() {
|
|
44
|
-
this._inputElem.value = this.value;
|
|
45
|
-
this.handleChange();
|
|
46
|
-
this.ezChange.emit();
|
|
47
|
-
this.adjustFloatingLabel();
|
|
48
|
-
}
|
|
49
|
-
adjustFloatingLabel() {
|
|
50
|
-
if (this.label) {
|
|
51
|
-
if (!this._inputElem.classList.contains("input--with--label")) {
|
|
52
|
-
this._inputElem.classList.add("input--with--label");
|
|
53
|
-
}
|
|
54
|
-
const hasValue = this.value && this.value.toString().length > 0;
|
|
55
|
-
const containsFloatedClass = this._labelElem.classList.contains("input__label--floated");
|
|
56
|
-
if (hasValue || this.isFocused()) {
|
|
57
|
-
if (!containsFloatedClass) {
|
|
58
|
-
this._labelElem.classList.add("input__label--floated");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
if (containsFloatedClass) {
|
|
63
|
-
this._labelElem.classList.remove("input__label--floated");
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
isFocused() {
|
|
69
|
-
return this._hostElement.shadowRoot.activeElement !== null;
|
|
70
|
-
}
|
|
71
|
-
//---------------------------------------------
|
|
72
|
-
// Public methods
|
|
73
|
-
//---------------------------------------------
|
|
74
|
-
/**
|
|
75
|
-
* Faz o foco no componente de input
|
|
76
|
-
*/
|
|
77
|
-
async setFocus() {
|
|
78
|
-
this._inputElem.focus();
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Remove o foco no componente de input
|
|
82
|
-
*/
|
|
83
|
-
async setBlur() {
|
|
84
|
-
this._inputElem.blur();
|
|
85
|
-
}
|
|
86
|
-
//---------------------------------------------
|
|
87
|
-
// Event handlers
|
|
88
|
-
//---------------------------------------------
|
|
89
|
-
handleFocusout() {
|
|
90
|
-
const value = this._inputElem.value;
|
|
91
|
-
if (value && this._maskFormatter) {
|
|
92
|
-
try {
|
|
93
|
-
this._inputElem.value = this._maskFormatter.format(value);
|
|
94
|
-
}
|
|
95
|
-
catch (e) {
|
|
96
|
-
this.errormessage = e.message;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
this.value = this._inputElem.value;
|
|
100
|
-
this.adjustFloatingLabel();
|
|
101
|
-
}
|
|
102
|
-
isValidValue(value) {
|
|
103
|
-
if (this.onlynumber) {
|
|
104
|
-
return value == "" || isValidNumber(value);
|
|
105
|
-
}
|
|
106
|
-
if (this.restrict) {
|
|
107
|
-
return Array.from(value).reduce((valid, c) => valid && this.restrict.indexOf(c) > -1, true);
|
|
108
|
-
}
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
handleChange() {
|
|
112
|
-
if (!this._inputElem) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const value = this._inputElem.value;
|
|
116
|
-
if (this.isValidValue(value)) {
|
|
117
|
-
this._lastValidValue = value;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
this._inputElem.value = this._lastValidValue === undefined ? "" : this._lastValidValue;
|
|
121
|
-
}
|
|
122
|
-
this.value = this._inputElem.value;
|
|
123
|
-
}
|
|
124
|
-
handleSlotChange(ev) {
|
|
125
|
-
const slot = ev.target;
|
|
126
|
-
const content = slot.assignedElements()[0];
|
|
127
|
-
if (content) {
|
|
128
|
-
content.style.position = "absolute";
|
|
129
|
-
content.style.display = "flex";
|
|
130
|
-
content.style.alignItems = "center";
|
|
131
|
-
content.style.justifyContent = "center";
|
|
132
|
-
content.style.overflow = "hidden";
|
|
133
|
-
content.style.top = "0px";
|
|
134
|
-
content.style.width = "var(--it__icon--width)";
|
|
135
|
-
content.style.height = "var(--it--height)";
|
|
136
|
-
if (slot.name == "leftIcon") {
|
|
137
|
-
content.style.left = "0px";
|
|
138
|
-
content.style.borderRadius = "var(--it--border-radius) 0 0 var(--it--border-radius)";
|
|
139
|
-
this._inputElem.classList.add('icon--left');
|
|
140
|
-
if (this._labelElem) {
|
|
141
|
-
this._labelElem.classList.add('input__label--left');
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
else if (slot.name == "rightIcon") {
|
|
145
|
-
content.style.right = "0px";
|
|
146
|
-
content.style.borderRadius = "0 var(--it--border-radius) var(--it--border-radius) 0";
|
|
147
|
-
this._inputElem.classList.add('icon--right');
|
|
148
|
-
if (this._labelElem) {
|
|
149
|
-
this._labelElem.classList.add('input__label--right');
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
this.showError();
|
|
154
|
-
}
|
|
155
|
-
doFocus() {
|
|
156
|
-
if (this.label && this._labelElem && !this._labelElem.classList.contains("input__label--floated")) {
|
|
157
|
-
this._labelElem.classList.add("input__label--floated");
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
//---------------------------------------------
|
|
161
|
-
// Lifecycle web component
|
|
162
|
-
//---------------------------------------------
|
|
163
|
-
componentDidLoad() {
|
|
164
|
-
if (this.onlynumber) {
|
|
165
|
-
this._inputElem.classList.add('text--right');
|
|
166
|
-
}
|
|
167
|
-
this.showError();
|
|
168
|
-
this.prepareMask();
|
|
169
|
-
this.adjustFloatingLabel();
|
|
170
|
-
}
|
|
171
|
-
componentWillLoad() {
|
|
172
|
-
this.prepareMask();
|
|
173
|
-
if (this.value) {
|
|
174
|
-
if (this._maskFormatter) {
|
|
175
|
-
try {
|
|
176
|
-
this.value = this._maskFormatter.format(this.value);
|
|
177
|
-
}
|
|
178
|
-
catch (e) {
|
|
179
|
-
this.errormessage = e.message;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
if (!this.isValidValue(this.value)) {
|
|
183
|
-
this._lastValidValue = "";
|
|
184
|
-
this.value = "";
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
render() {
|
|
189
|
-
return (h(Host, null, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label ?
|
|
190
|
-
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)
|
|
191
|
-
: null, h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errormessage }, this.errormessage)));
|
|
192
|
-
}
|
|
193
|
-
get _hostElement() { return getElement(this); }
|
|
194
|
-
static get watchers() { return {
|
|
195
|
-
"errormessage": ["showError"],
|
|
196
|
-
"mask": ["prepareMask"],
|
|
197
|
-
"value": ["updateInputValue"]
|
|
198
|
-
}; }
|
|
199
|
-
};
|
|
200
|
-
EzTextInput.style = ezTextInputCss;
|
|
201
|
-
|
|
202
|
-
export { EzTextInput as ez_text_input };
|