@sankhyalabs/ezui 1.1.130 → 1.1.131
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-modal.cjs.entry.js +6 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +10 -8
- package/dist/collection/components/ez-modal/ez-modal.js +20 -0
- package/dist/collection/components/ez-number-input/ez-number-input.js +1 -1
- package/dist/collection/components/ez-text-input/ez-text-input.js +10 -8
- package/dist/custom-elements/index.js +17 -9
- package/dist/esm/ez-modal.entry.js +6 -0
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +10 -8
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-48ba92b2.entry.js +1 -0
- package/dist/ezui/p-4ded39c2.entry.js +1 -0
- package/dist/ezui/p-c8f9b691.entry.js +1 -0
- package/dist/types/components/ez-modal/ez-modal.d.ts +5 -0
- package/dist/types/components.d.ts +4 -0
- package/package.json +1 -1
- package/dist/ezui/p-c6b2b2e5.entry.js +0 -1
- package/dist/ezui/p-ef8f1275.entry.js +0 -1
- package/dist/ezui/p-f65302bb.entry.js +0 -1
|
@@ -10,6 +10,7 @@ let EzModal = class {
|
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
12
|
this.ezCloseModal = index.createEvent(this, "ezCloseModal", 7);
|
|
13
|
+
this.ezOpenModal = index.createEvent(this, "ezOpenModal", 7);
|
|
13
14
|
/**
|
|
14
15
|
* Controle de exibição do Modal
|
|
15
16
|
*/
|
|
@@ -43,6 +44,11 @@ let EzModal = class {
|
|
|
43
44
|
componentDidLoad() {
|
|
44
45
|
this.handleopenedChange();
|
|
45
46
|
}
|
|
47
|
+
componentDidRender() {
|
|
48
|
+
if (this.opened) {
|
|
49
|
+
this.ezOpenModal.emit();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
46
52
|
onMouseDownHandler(event) {
|
|
47
53
|
if (this.closeOutsideClick && event.target === this._overlay) {
|
|
48
54
|
this.closeModal();
|
|
@@ -26,14 +26,16 @@ let EzTextInput = class {
|
|
|
26
26
|
}
|
|
27
27
|
showError() {
|
|
28
28
|
var _a, _b;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
if (this._inputElem) {
|
|
30
|
+
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
31
|
+
if (hasError) {
|
|
32
|
+
this._inputElem.classList.add("hasError");
|
|
33
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this._inputElem.classList.remove("hasError");
|
|
37
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
prepareMask() {
|
|
@@ -34,6 +34,11 @@ export class EzModal {
|
|
|
34
34
|
componentDidLoad() {
|
|
35
35
|
this.handleopenedChange();
|
|
36
36
|
}
|
|
37
|
+
componentDidRender() {
|
|
38
|
+
if (this.opened) {
|
|
39
|
+
this.ezOpenModal.emit();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
37
42
|
onMouseDownHandler(event) {
|
|
38
43
|
if (this.closeOutsideClick && event.target === this._overlay) {
|
|
39
44
|
this.closeModal();
|
|
@@ -163,6 +168,21 @@ export class EzModal {
|
|
|
163
168
|
"resolved": "boolean",
|
|
164
169
|
"references": {}
|
|
165
170
|
}
|
|
171
|
+
}, {
|
|
172
|
+
"method": "ezOpenModal",
|
|
173
|
+
"name": "ezOpenModal",
|
|
174
|
+
"bubbles": true,
|
|
175
|
+
"cancelable": true,
|
|
176
|
+
"composed": true,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Um evento disparado quando o modal \u00E9 aberto (onEzOpenModal)."
|
|
180
|
+
},
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "any",
|
|
183
|
+
"resolved": "any",
|
|
184
|
+
"references": {}
|
|
185
|
+
}
|
|
166
186
|
}]; }
|
|
167
187
|
static get watchers() { return [{
|
|
168
188
|
"propName": "opened",
|
|
@@ -17,14 +17,16 @@ export class EzTextInput {
|
|
|
17
17
|
}
|
|
18
18
|
showError() {
|
|
19
19
|
var _a, _b;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
if (this._inputElem) {
|
|
21
|
+
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
22
|
+
if (hasError) {
|
|
23
|
+
this._inputElem.classList.add("hasError");
|
|
24
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this._inputElem.classList.remove("hasError");
|
|
28
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
|
|
29
|
+
}
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
prepareMask() {
|
|
@@ -113362,6 +113362,7 @@ let EzModal$1 = class extends HTMLElement$1 {
|
|
|
113362
113362
|
this.__registerHost();
|
|
113363
113363
|
this.__attachShadow();
|
|
113364
113364
|
this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
|
|
113365
|
+
this.ezOpenModal = createEvent(this, "ezOpenModal", 7);
|
|
113365
113366
|
/**
|
|
113366
113367
|
* Controle de exibição do Modal
|
|
113367
113368
|
*/
|
|
@@ -113395,6 +113396,11 @@ let EzModal$1 = class extends HTMLElement$1 {
|
|
|
113395
113396
|
componentDidLoad() {
|
|
113396
113397
|
this.handleopenedChange();
|
|
113397
113398
|
}
|
|
113399
|
+
componentDidRender() {
|
|
113400
|
+
if (this.opened) {
|
|
113401
|
+
this.ezOpenModal.emit();
|
|
113402
|
+
}
|
|
113403
|
+
}
|
|
113398
113404
|
onMouseDownHandler(event) {
|
|
113399
113405
|
if (this.closeOutsideClick && event.target === this._overlay) {
|
|
113400
113406
|
this.closeModal();
|
|
@@ -113456,7 +113462,7 @@ let EzNumberInput$1 = class extends HTMLElement$1 {
|
|
|
113456
113462
|
}
|
|
113457
113463
|
changeValue(newValue) {
|
|
113458
113464
|
this.errorMessage = "";
|
|
113459
|
-
if (newValue
|
|
113465
|
+
if (newValue !== this.value) {
|
|
113460
113466
|
this.value = newValue;
|
|
113461
113467
|
this.ezChange.emit(this.value);
|
|
113462
113468
|
}
|
|
@@ -114093,14 +114099,16 @@ let EzTextInput$1 = class extends HTMLElement$1 {
|
|
|
114093
114099
|
}
|
|
114094
114100
|
showError() {
|
|
114095
114101
|
var _a, _b;
|
|
114096
|
-
|
|
114097
|
-
|
|
114098
|
-
|
|
114099
|
-
|
|
114100
|
-
|
|
114101
|
-
|
|
114102
|
-
|
|
114103
|
-
|
|
114102
|
+
if (this._inputElem) {
|
|
114103
|
+
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
114104
|
+
if (hasError) {
|
|
114105
|
+
this._inputElem.classList.add("hasError");
|
|
114106
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
|
|
114107
|
+
}
|
|
114108
|
+
else {
|
|
114109
|
+
this._inputElem.classList.remove("hasError");
|
|
114110
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
|
|
114111
|
+
}
|
|
114104
114112
|
}
|
|
114105
114113
|
}
|
|
114106
114114
|
prepareMask() {
|
|
@@ -6,6 +6,7 @@ let EzModal = class {
|
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
|
|
9
|
+
this.ezOpenModal = createEvent(this, "ezOpenModal", 7);
|
|
9
10
|
/**
|
|
10
11
|
* Controle de exibição do Modal
|
|
11
12
|
*/
|
|
@@ -39,6 +40,11 @@ let EzModal = class {
|
|
|
39
40
|
componentDidLoad() {
|
|
40
41
|
this.handleopenedChange();
|
|
41
42
|
}
|
|
43
|
+
componentDidRender() {
|
|
44
|
+
if (this.opened) {
|
|
45
|
+
this.ezOpenModal.emit();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
42
48
|
onMouseDownHandler(event) {
|
|
43
49
|
if (this.closeOutsideClick && event.target === this._overlay) {
|
|
44
50
|
this.closeModal();
|
|
@@ -22,14 +22,16 @@ let EzTextInput = class {
|
|
|
22
22
|
}
|
|
23
23
|
showError() {
|
|
24
24
|
var _a, _b;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
if (this._inputElem) {
|
|
26
|
+
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
27
|
+
if (hasError) {
|
|
28
|
+
this._inputElem.classList.add("hasError");
|
|
29
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this._inputElem.classList.remove("hasError");
|
|
33
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
|
|
34
|
+
}
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
prepareMask() {
|
package/dist/ezui/ezui.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as s}from"./p-60138b72.js";(()=>{const s=import.meta.url,o={};return""!==s&&(o.resourcesUrl=new URL(".",s).href),e(o)})().then((e=>s([["p-2d165ca8",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],pageSize:[2,"page-size"],serverUrl:[1,"server-url"],dataUnit:[16],_navigationHasPrevious:[32],_navigationHasNext:[32],_navigationFirstRow:[32],_navigationLastRow:[32],_navigationTotalRows:[32],_popUpVisible:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],refresh:[64],quickFilter:[64]}]]],["p-05cca198",[[1,"ez-dialog",{confirm:[1028],critical:[1028],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],handleButtonClick:[64],show:[64]}]]],["p-ec205792",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],loading:[516],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-8a0e5e59",[[1,"ez-action-chip",{label:[513],enabled:[516]}]]],["p-4884b056",[[0,"ez-application"]]],["p-bd29c55f",[[1,"ez-label-chip",{label:[513],enabled:[516],removable:[516],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-0cb4aec1",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],innerElement:[1537,"inner-element"],updatePosition:[64],show:[64],hide:[64]}]]],["p-1ced597f",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[1540,"use-header"],ezTitle:[1,"ez-title"]}]]],["p-2d55888f",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-6d39b7ea",[[2,"grid-config",{selectedTab:[1025,"selected-tab"],columns:[1040],config:[1040]}]]],["p-
|
|
1
|
+
import{p as e,b as s}from"./p-60138b72.js";(()=>{const s=import.meta.url,o={};return""!==s&&(o.resourcesUrl=new URL(".",s).href),e(o)})().then((e=>s([["p-2d165ca8",[[6,"ez-grid",{multipleSelection:[4,"multiple-selection"],config:[1040],pageSize:[2,"page-size"],serverUrl:[1,"server-url"],dataUnit:[16],_navigationHasPrevious:[32],_navigationHasNext:[32],_navigationFirstRow:[32],_navigationLastRow:[32],_navigationTotalRows:[32],_popUpVisible:[32],setColumnsDef:[64],addColumnMenuItem:[64],setColumnsState:[64],setData:[64],getSelection:[64],getColumnsState:[64],getColumns:[64],refresh:[64],quickFilter:[64]}]]],["p-05cca198",[[1,"ez-dialog",{confirm:[1028],critical:[1028],message:[1025],opened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],handleButtonClick:[64],show:[64]}]]],["p-ec205792",[[1,"ez-filter-input",{label:[1],value:[1537],enabled:[4],loading:[516],errorMessage:[1537,"error-message"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-8a0e5e59",[[1,"ez-action-chip",{label:[513],enabled:[516]}]]],["p-4884b056",[[0,"ez-application"]]],["p-bd29c55f",[[1,"ez-label-chip",{label:[513],enabled:[516],removable:[516],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-0cb4aec1",[[1,"ez-popover",{autoClose:[516,"auto-close"],top:[1537],left:[1537],bottom:[1537],right:[1537],boxWidth:[513,"box-width"],opened:[1540],innerElement:[1537,"inner-element"],updatePosition:[64],show:[64],hide:[64]}]]],["p-1ced597f",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[1540,"use-header"],ezTitle:[1,"ez-title"]}]]],["p-2d55888f",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],canClose:[1028,"can-close"],show:[64]}]]],["p-6d39b7ea",[[2,"grid-config",{selectedTab:[1025,"selected-tab"],columns:[1040],config:[1040]}]]],["p-48ba92b2",[[1,"ez-modal",{modalSize:[1,"modal-size"],align:[1],opened:[1028],closeEsc:[4,"close-esc"],closeOutsideClick:[4,"close-outside-click"]}]]],["p-c8f9b691",[[1,"ez-text-input",{label:[513],value:[1537],enabled:[516],loading:[516],errorMessage:[1537,"error-message"],mask:[1],canShowError:[516,"can-show-error"],restrict:[1],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-5821c335",[[1,"ez-search",{value:[1537],label:[1537],enabled:[1540],errorMessage:[1537,"error-message"],optionLoader:[16],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressEmptyOption:[4,"suppress-empty-option"],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-5b7405e8",[[1,"select-box",{selectedOption:[1,"selected-option"]}]]],["p-cbfb94cb",[[1,"ez-date-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-5f725a93",[[1,"ez-date-time-input",{label:[513],value:[1040],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-ed1e0331",[[1,"ez-time-input",{label:[513],viewValue:[1537,"view-value"],value:[1026],enabled:[516],errorMessage:[1537,"error-message"],showSeconds:[516,"show-seconds"],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-4ded39c2",[[1,"ez-number-input",{label:[1],value:[1538],enabled:[4],errorMessage:[1537,"error-message"],precision:[2],prettyPrecision:[2,"pretty-precision"],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-7d5b2ebf",[[1,"ez-list",{dataSource:[1040],useGroups:[1540,"use-groups"],ezDraggable:[1028,"ez-draggable"],ezSelectable:[1028,"ez-selectable"],itemSlotBuilder:[1040],_listItems:[32],_listGroupItems:[32],clearHistory:[64],setSelection:[64],getSelection:[64],getList:[64]}]]],["p-5a9ab4f7",[[1,"ez-text-area",{label:[513],value:[1537],enabled:[516],loading:[516],errorMessage:[1537,"error-message"],rows:[1538],canShowError:[516,"can-show-error"],mode:[513],setFocus:[64],setBlur:[64]}]]],["p-fa9157c1",[[1,"ez-icon",{size:[513],href:[513],iconName:[513,"icon-name"]}]]],["p-ef17f443",[[1,"ez-collapsible-box",{value:[1540],label:[513],headerSize:[513,"header-size"],iconPlacement:[513,"icon-placement"],stretchTitle:[516,"stretch-title"],showHide:[64]}]]],["p-a4a21738",[[1,"ez-upload",{label:[1],enabled:[4],maxFileSize:[2,"max-file-size"],maxFiles:[2,"max-files"],requestHeaders:[8,"request-headers"],urlUpload:[1,"url-upload"],urlDelete:[1,"url-delete"],value:[1040],addFiles:[64],setFocus:[64],setBlur:[64]}]]],["p-27db8fba",[[1,"ez-button",{label:[513],enabled:[516],mode:[513],image:[513],iconName:[513,"icon-name"],size:[513],setFocus:[64],setBlur:[64]}]]],["p-593a17e7",[[1,"ez-calendar",{value:[1040],floating:[516],time:[516],showSeconds:[516,"show-seconds"],show:[64],fitVertical:[64],hide:[64]}]]],["p-dc0aa563",[[1,"ez-check",{label:[513],value:[1540],enabled:[1540],mode:[513],getMode:[64],setFocus:[64]}]]],["p-66adbed5",[[1,"ez-tabselector",{selectedIndex:[1538,"selected-index"],selectedTab:[1537,"selected-tab"],tabs:[1]}]]],["p-6e844308",[[1,"ez-combo-box",{value:[1537],label:[513],enabled:[516],options:[1040],errorMessage:[1537,"error-message"],searchMode:[4,"search-mode"],showSelectedValue:[4,"show-selected-value"],showOptionValue:[4,"show-option-value"],suppressSearch:[4,"suppress-search"],optionLoader:[16],suppressEmptyOption:[4,"suppress-empty-option"],canShowError:[516,"can-show-error"],mode:[513],_preSelection:[32],_visibleOptions:[32],setFocus:[64],setBlur:[64]}]]],["p-47fe4273",[[0,"ez-form",{dataUnit:[1040],config:[16],submit:[64],cancel:[64],validate:[64]}]]],["p-6aa0c6f1",[[0,"test-du",{isDirty:[32]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,c as t,h as i,H as o}from"./p-60138b72.js";let l=class{constructor(i){d(this,i),this.ezCloseModal=t(this,"ezCloseModal",7),this.ezOpenModal=t(this,"ezOpenModal",7),this.opened=!0,this.closeEsc=!1,this.closeOutsideClick=!1,this.handleKeyboardEvent=d=>{"Escape"===(null==d?void 0:d.key)&&this.closeEsc&&this.closeModal()}}handleopenedChange(){this.opened?document.addEventListener("keydown",this.handleKeyboardEvent):document.removeEventListener("keydown",this.handleKeyboardEvent)}closeModal(){this.opened=!1,this.ezCloseModal.emit(this.opened)}componentDidLoad(){this.handleopenedChange()}componentDidRender(){this.opened&&this.ezOpenModal.emit()}onMouseDownHandler(d){this.closeOutsideClick&&d.target===this._overlay&&this.closeModal()}render(){const d="left"===this.align?"left":"right";return i(o,null,this.opened?i("div",{class:"modal",onMouseDown:d=>this.onMouseDownHandler(d)},i("div",{class:`modal__container modal__container--${d}`,ref:d=>this._overlay=d},i("div",{class:`modal__content modal__content--${d} ${this.modalSize}`},i("slot",null)))):void 0)}static get watchers(){return{opened:["handleopenedChange"]}}};l.style=":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;max-height:calc(100% - 48px);height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";export{l as ez_modal}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as e,g as i}from"./p-60138b72.js";import{NumberUtils as r}from"@sankhyalabs/core";import{C as h}from"./p-933a7475.js";let a=class{constructor(e){t(this,e),this.ezChange=s(this,"ezChange",7),this.enabled=!0,this.mode="regular"}setLabel(){this._textInput.label=this.label}setErrorMessage(){this._textInput.errorMessage=this.errorMessage}applyValueToInput(){this._textInput&&(this._textInput.value=this.getTextValue(this.value))}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}changeValue(t){this.errorMessage="",t!==this.value&&(this.value=t,this.ezChange.emit(this.value))}parseNumber(){const t=this._textInput.value?r.stringToNumber(this._textInput.value):null;if(null!=t&&isNaN(t))this.errorMessage="O valor digitado não é um número válido";else try{this.changeValue(t)}catch(t){return void(this.errorMessage=t.message)}}getTextValue(t){return t?this.precision>0?r.format(t.toString(),Number(this.precision),Number(this.prettyPrecision)):t.toString():null}componentDidLoad(){h.applyVarsTextInput(this._elem,this._textInput)}render(){return e("ez-text-input",{ref:t=>this._textInput=t,onBlur:()=>this.parseNumber(),label:this.label,onEzChange:t=>t.stopPropagation(),value:this.getTextValue(this.value),restrict:this.precision>0?"0123456789-,.":"0123456789-",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode})}get _elem(){return i(this)}static get watchers(){return{label:["setLabel"],errorMessage:["setErrorMessage"],value:["applyValueToInput"]}}};a.style=":host{display:block;width:100%}";export{a as ez_number_input}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,H as o,g as r}from"./p-60138b72.js";import{MaskFormatter as n}from"@sankhyalabs/core";let a=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.enabled=!0,this.canShowError=!0,this.mode="regular"}showError(){var t,i;this._inputElem&&("string"==typeof this.errorMessage&&""!==this.errorMessage?(this._inputElem.classList.add("hasError"),null===(t=this._messageBoxElem)||void 0===t||t.classList.add("hasError")):(this._inputElem.classList.remove("hasError"),null===(i=this._messageBoxElem)||void 0===i||i.classList.remove("hasError")))}prepareMask(){this.mask&&(null==this._maskFormatter?this._maskFormatter=new n(this.mask):this._maskFormatter.mask=this.mask)}updateInputValue(){this._inputElem&&(this._inputElem.value=this.value),this.handleChange(),this.errorMessage="",this.ezChange.emit(this.value),this.adjustFloatingLabel()}adjustFloatingLabel(){if(this.label&&this._labelElem){this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label");const t=this.value&&this.value.toString().length>0,i=this._labelElem.classList.contains("input__label--floated");t||this.isFocused()?i||this._labelElem.classList.add("input__label--floated"):i&&this._labelElem.classList.remove("input__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this._inputElem.value=this._maskFormatter.format(t)}catch(t){this.errorMessage=t.message}this.value=this._inputElem.value,this.adjustFloatingLabel()}isValidValue(t){return!this.restrict||Array.from(t).reduce(((t,i)=>t&&this.restrict.indexOf(i)>-1),!0)}handleChange(){if(!this._inputElem)return;const t=this._inputElem.value;this.isValidValue(t)?this._lastValidValue=t:this._inputElem.value=void 0===this._lastValidValue?"":this._lastValidValue,this.value=this._inputElem.value}handleSlotChange(t){const i=t.target,e=i.assignedElements()[0];e&&(e.style.position="absolute",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.overflow="hidden",e.style.top="0px",e.style.width="var(--ez-text-input__icon--width)",e.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==i.name?(e.style.left="0px",e.style.borderRadius="var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)",this._inputElem.classList.add("icon--left"),this._labelElem&&this._labelElem.classList.add("input__label--left")):"rightIcon"==i.name&&(e.style.right="0px",e.style.borderRadius="0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0",this._inputElem.classList.add("icon--right"),this._labelElem&&this._labelElem.classList.add("input__label--right"))),this.showError()}doFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("input__label--floated")&&this._labelElem.classList.add("input__label--floated")}componentDidLoad(){this.showError(),this.prepareMask(),this.adjustFloatingLabel()}componentWillLoad(){if(this.prepareMask(),this.value){if(this._maskFormatter)try{this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}render(){return e(o,null,e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:this.enabled?"input__label":"input__label input__label--disabled",onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,e("input",{onFocus:()=>this.doFocus(),ref:t=>this._inputElem=t,type:"text",class:"slim"==this.mode?"input--slim":"",placeholder:"slim"==this.mode&&this.label?this.label:"",value:this.value,disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.canShowError&&"slim"!=this.mode&&e("span",{class:"message-box",ref:t=>this._messageBoxElem=t,title:this.errorMessage},this.errorMessage))}get _hostElement(){return r(this)}static get watchers(){return{errorMessage:["showError"],mask:["prepareMask"],value:["updateInputValue"]}}};a.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #000);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:read-only{cursor:default}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__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(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input--slim::-webkit-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-ms-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:disabled::-webkit-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-ms-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}";export{a as ez_text_input}
|
|
@@ -25,10 +25,15 @@ export declare class EzModal {
|
|
|
25
25
|
* Um evento disparado quando o modal é fechado (onEzCloseModal).
|
|
26
26
|
*/
|
|
27
27
|
ezCloseModal: EventEmitter<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Um evento disparado quando o modal é aberto (onEzOpenModal).
|
|
30
|
+
*/
|
|
31
|
+
ezOpenModal: EventEmitter;
|
|
28
32
|
handleopenedChange(): void;
|
|
29
33
|
handleKeyboardEvent: (ev: any) => void;
|
|
30
34
|
closeModal(): void;
|
|
31
35
|
componentDidLoad(): void;
|
|
36
|
+
componentDidRender(): void;
|
|
32
37
|
onMouseDownHandler(event: any): void;
|
|
33
38
|
render(): any;
|
|
34
39
|
}
|
|
@@ -1507,6 +1507,10 @@ declare namespace LocalJSX {
|
|
|
1507
1507
|
* Um evento disparado quando o modal é fechado (onEzCloseModal).
|
|
1508
1508
|
*/
|
|
1509
1509
|
"onEzCloseModal"?: (event: CustomEvent<boolean>) => void;
|
|
1510
|
+
/**
|
|
1511
|
+
* Um evento disparado quando o modal é aberto (onEzOpenModal).
|
|
1512
|
+
*/
|
|
1513
|
+
"onEzOpenModal"?: (event: CustomEvent<any>) => void;
|
|
1510
1514
|
/**
|
|
1511
1515
|
* Controle de exibição do Modal
|
|
1512
1516
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,g as i}from"./p-60138b72.js";import{NumberUtils as r}from"@sankhyalabs/core";import{C as h}from"./p-933a7475.js";let a=class{constructor(e){t(this,e),this.ezChange=s(this,"ezChange",7),this.enabled=!0,this.mode="regular"}setLabel(){this._textInput.label=this.label}setErrorMessage(){this._textInput.errorMessage=this.errorMessage}applyValueToInput(){this._textInput&&(this._textInput.value=this.getTextValue(this.value))}async setFocus(){this._textInput.setFocus()}async setBlur(){this._textInput.setBlur()}changeValue(t){this.errorMessage="",t&&t!==this.value&&(this.value=t,this.ezChange.emit(this.value))}parseNumber(){const t=this._textInput.value?r.stringToNumber(this._textInput.value):null;if(null!=t&&isNaN(t))this.errorMessage="O valor digitado não é um número válido";else try{this.changeValue(t)}catch(t){return void(this.errorMessage=t.message)}}getTextValue(t){return t?this.precision>0?r.format(t.toString(),Number(this.precision),Number(this.prettyPrecision)):t.toString():null}componentDidLoad(){h.applyVarsTextInput(this._elem,this._textInput)}render(){return e("ez-text-input",{ref:t=>this._textInput=t,onBlur:()=>this.parseNumber(),label:this.label,onEzChange:t=>t.stopPropagation(),value:this.getTextValue(this.value),restrict:this.precision>0?"0123456789-,.":"0123456789-",enabled:this.enabled,errorMessage:this.errorMessage,mode:this.mode})}get _elem(){return i(this)}static get watchers(){return{label:["setLabel"],errorMessage:["setErrorMessage"],value:["applyValueToInput"]}}};a.style=":host{display:block;width:100%}";export{a as ez_number_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,c as t,h as i,H as o}from"./p-60138b72.js";let l=class{constructor(i){d(this,i),this.ezCloseModal=t(this,"ezCloseModal",7),this.opened=!0,this.closeEsc=!1,this.closeOutsideClick=!1,this.handleKeyboardEvent=d=>{"Escape"===(null==d?void 0:d.key)&&this.closeEsc&&this.closeModal()}}handleopenedChange(){this.opened?document.addEventListener("keydown",this.handleKeyboardEvent):document.removeEventListener("keydown",this.handleKeyboardEvent)}closeModal(){this.opened=!1,this.ezCloseModal.emit(this.opened)}componentDidLoad(){this.handleopenedChange()}onMouseDownHandler(d){this.closeOutsideClick&&d.target===this._overlay&&this.closeModal()}render(){const d="left"===this.align?"left":"right";return i(o,null,this.opened?i("div",{class:"modal",onMouseDown:d=>this.onMouseDownHandler(d)},i("div",{class:`modal__container modal__container--${d}`,ref:d=>this._overlay=d},i("div",{class:`modal__content modal__content--${d} ${this.modalSize}`},i("slot",null)))):void 0)}static get watchers(){return{opened:["handleopenedChange"]}}};l.style=":host{--ez-modal-z-index:var(--most-visible, 3);--ez-modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--ez-modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--ez-modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;max-height:calc(100% - 48px);height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";export{l as ez_modal}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as o,g as r}from"./p-60138b72.js";import{MaskFormatter as n}from"@sankhyalabs/core";let a=class{constructor(e){t(this,e),this.ezChange=i(this,"ezChange",7),this.enabled=!0,this.canShowError=!0,this.mode="regular"}showError(){var t,i;"string"==typeof this.errorMessage&&""!==this.errorMessage?(this._inputElem.classList.add("hasError"),null===(t=this._messageBoxElem)||void 0===t||t.classList.add("hasError")):(this._inputElem.classList.remove("hasError"),null===(i=this._messageBoxElem)||void 0===i||i.classList.remove("hasError"))}prepareMask(){this.mask&&(null==this._maskFormatter?this._maskFormatter=new n(this.mask):this._maskFormatter.mask=this.mask)}updateInputValue(){this._inputElem&&(this._inputElem.value=this.value),this.handleChange(),this.errorMessage="",this.ezChange.emit(this.value),this.adjustFloatingLabel()}adjustFloatingLabel(){if(this.label&&this._labelElem){this._inputElem&&!this._inputElem.classList.contains("input--with--label")&&this._inputElem.classList.add("input--with--label");const t=this.value&&this.value.toString().length>0,i=this._labelElem.classList.contains("input__label--floated");t||this.isFocused()?i||this._labelElem.classList.add("input__label--floated"):i&&this._labelElem.classList.remove("input__label--floated")}}isFocused(){return null!==this._hostElement.shadowRoot.activeElement}async setFocus(){this._inputElem.focus()}async setBlur(){this._inputElem.blur()}handleFocusout(){const t=this._inputElem.value;if(t&&this._maskFormatter)try{this._inputElem.value=this._maskFormatter.format(t)}catch(t){this.errorMessage=t.message}this.value=this._inputElem.value,this.adjustFloatingLabel()}isValidValue(t){return!this.restrict||Array.from(t).reduce(((t,i)=>t&&this.restrict.indexOf(i)>-1),!0)}handleChange(){if(!this._inputElem)return;const t=this._inputElem.value;this.isValidValue(t)?this._lastValidValue=t:this._inputElem.value=void 0===this._lastValidValue?"":this._lastValidValue,this.value=this._inputElem.value}handleSlotChange(t){const i=t.target,e=i.assignedElements()[0];e&&(e.style.position="absolute",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.overflow="hidden",e.style.top="0px",e.style.width="var(--ez-text-input__icon--width)",e.style.height="slim"!=this.mode?"var(--ez-text-input--height)":"var(--ez-text-input--height--slim)","leftIcon"==i.name?(e.style.left="0px",e.style.borderRadius="var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)",this._inputElem.classList.add("icon--left"),this._labelElem&&this._labelElem.classList.add("input__label--left")):"rightIcon"==i.name&&(e.style.right="0px",e.style.borderRadius="0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0",this._inputElem.classList.add("icon--right"),this._labelElem&&this._labelElem.classList.add("input__label--right"))),this.showError()}doFocus(){this.label&&this._labelElem&&!this._labelElem.classList.contains("input__label--floated")&&this._labelElem.classList.add("input__label--floated")}componentDidLoad(){this.showError(),this.prepareMask(),this.adjustFloatingLabel()}componentWillLoad(){if(this.prepareMask(),this.value){if(this._maskFormatter)try{this.value=this._maskFormatter.format(this.value)}catch(t){this.errorMessage=t.message}this.isValidValue(this.value)||(this._lastValidValue="",this.value="")}}render(){return e(o,null,e("slot",{name:"leftIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.label&&"slim"!=this.mode?e("label",{ref:t=>this._labelElem=t,class:this.enabled?"input__label":"input__label input__label--disabled",onClick:()=>this._inputElem.focus(),title:this.label},this.label):null,e("input",{onFocus:()=>this.doFocus(),ref:t=>this._inputElem=t,type:"text",class:"slim"==this.mode?"input--slim":"",placeholder:"slim"==this.mode&&this.label?this.label:"",value:this.value,disabled:!this.enabled,onInput:()=>{this.handleChange()},onFocusout:()=>{this.handleFocusout()}}),e("slot",{name:"rightIcon",onSlotchange:t=>{this.handleSlotChange(t)}}),this.canShowError&&"slim"!=this.mode&&e("span",{class:"message-box",ref:t=>this._messageBoxElem=t,title:this.errorMessage},this.errorMessage))}get _hostElement(){return r(this)}static get watchers(){return{errorMessage:["showError"],mask:["prepareMask"],value:["updateInputValue"]}}};a.style=":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #000);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}input:read-only{cursor:default}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__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(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input--slim::-webkit-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-ms-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:disabled::-webkit-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-ms-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}";export{a as ez_text_input}
|