@sankhyalabs/ezui 1.1.67 → 1.1.70
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-action-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-button_16.cjs.entry.js +133 -144
- package/dist/cjs/ez-dialog.cjs.entry.js +7 -1
- package/dist/cjs/ez-modal.cjs.entry.js +16 -69
- package/dist/cjs/ez-number-input.cjs.entry.js +9 -9
- package/dist/cjs/ez-popover.cjs.entry.js +13 -18
- package/dist/cjs/ez-popup.cjs.entry.js +2 -2
- package/dist/cjs/ez-time-input.cjs.entry.js +6 -6
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-action-chip/ez-action-chip.css +2 -1
- package/dist/collection/components/ez-action-chip/ez-action-chip.js +1 -1
- package/dist/collection/components/ez-button/ez-button.css +48 -45
- package/dist/collection/components/ez-button/ez-button.js +5 -5
- package/dist/collection/components/ez-calendar/ez-calendar.css +2 -2
- package/dist/collection/components/ez-check/ez-check.css +78 -78
- package/dist/collection/components/ez-check/ez-check.js +7 -7
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +2 -2
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +1 -1
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +46 -44
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +38 -39
- package/dist/collection/components/ez-date-input/ez-date-input.js +9 -9
- package/dist/collection/components/ez-dialog/ez-dialog.css +43 -43
- package/dist/collection/components/ez-dialog/ez-dialog.js +10 -4
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +6 -6
- package/dist/collection/components/ez-form/subcomponents/structure/FormSheet.js +1 -1
- package/dist/collection/components/ez-icon/ez-icon.css +3 -1
- package/dist/collection/components/ez-icon/ez-icon.js +5 -3
- package/dist/collection/components/ez-label-chip/ez-label-chip.css +2 -1
- package/dist/collection/components/ez-label-chip/ez-label-chip.js +1 -1
- package/dist/collection/components/ez-modal/ez-modal.css +1 -1
- package/dist/collection/components/ez-modal/ez-modal.js +30 -83
- package/dist/collection/components/ez-number-input/ez-number-input.js +11 -11
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.css +1 -1
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.js +9 -9
- package/dist/collection/components/ez-popover/ez-popover.css +4 -5
- package/dist/collection/components/ez-popover/ez-popover.js +25 -30
- package/dist/collection/components/ez-popup/ez-popup.css +7 -7
- package/dist/collection/components/ez-popup/ez-popup.js +4 -4
- package/dist/collection/components/ez-search/ez-search.js +5 -5
- package/dist/collection/components/ez-tabselector/ez-tabselector.css +7 -10
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +68 -70
- package/dist/collection/components/ez-text-area/ez-text-area.css +6 -0
- package/dist/collection/components/ez-text-area/ez-text-area.js +9 -9
- package/dist/collection/components/ez-text-input/ez-text-input.css +68 -60
- package/dist/collection/components/ez-text-input/ez-text-input.js +14 -38
- package/dist/collection/components/ez-time-input/ez-time-input.css +8 -0
- package/dist/collection/components/ez-time-input/ez-time-input.js +9 -9
- package/dist/collection/components/ez-toast/ez-toast.css +2 -2
- package/dist/collection/components/ez-upload/ez-upload.css +4 -1
- package/dist/collection/components/ez-upload/ez-upload.js +3 -3
- package/dist/custom-elements/index.js +198 -261
- package/dist/esm/ez-action-chip.entry.js +1 -1
- package/dist/esm/ez-button_16.entry.js +133 -144
- package/dist/esm/ez-dialog.entry.js +7 -1
- package/dist/esm/ez-modal.entry.js +16 -69
- package/dist/esm/ez-number-input.entry.js +9 -9
- package/dist/esm/ez-popover.entry.js +13 -18
- package/dist/esm/ez-popup.entry.js +2 -2
- package/dist/esm/ez-time-input.entry.js +6 -6
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-1bc9ddad.entry.js +1 -0
- package/dist/ezui/{p-4f4b8aae.entry.js → p-1c33a56d.entry.js} +1 -1
- package/dist/ezui/{p-d8a47f23.entry.js → p-74e4415e.entry.js} +1 -1
- package/dist/ezui/p-a7e23f65.entry.js +1 -0
- package/dist/ezui/p-a88ee12f.entry.js +1 -0
- package/dist/ezui/p-b692a0ab.entry.js +1 -0
- package/dist/ezui/p-b6e0fd3e.entry.js +1 -0
- package/dist/ezui/{p-7f528c19.entry.js → p-f7d7fb7f.entry.js} +1 -1
- package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +1 -1
- package/dist/types/components/ez-button/ez-button.d.ts +1 -1
- package/dist/types/components/ez-check/ez-check.d.ts +3 -3
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +8 -8
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +2 -2
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +8 -2
- package/dist/types/components/ez-icon/ez-icon.d.ts +6 -0
- package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +1 -1
- package/dist/types/components/ez-modal/ez-modal.d.ts +9 -9
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +1 -1
- package/dist/types/components/ez-numeric-input/ez-numeric-input.d.ts +3 -3
- package/dist/types/components/ez-popover/ez-popover.d.ts +4 -5
- package/dist/types/components/ez-popup/ez-popup.d.ts +3 -3
- package/dist/types/components/ez-search/ez-search.d.ts +3 -3
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +19 -10
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +4 -4
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -8
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +2 -2
- package/dist/types/components/ez-upload/ez-upload.d.ts +3 -3
- package/dist/types/components.d.ts +142 -114
- package/package.json +2 -1
- package/dist/ezui/p-7c7dbfcb.entry.js +0 -1
- package/dist/ezui/p-8c8f1c00.entry.js +0 -1
- package/dist/ezui/p-afc553a4.entry.js +0 -1
- package/dist/ezui/p-d185d7e8.entry.js +0 -1
- package/dist/ezui/p-ee5058c1.entry.js +0 -1
|
@@ -6,7 +6,7 @@ const index = require('./index-0f668cc5.js');
|
|
|
6
6
|
const RequestMetadata = require('./RequestMetadata-2cd01e8a.js');
|
|
7
7
|
const FloatingManager = require('./FloatingManager-6cfeb947.js');
|
|
8
8
|
|
|
9
|
-
const ezButtonCss = ":host{--
|
|
9
|
+
const ezButtonCss = ":host{--button--min-width:100px;--button--height:42px;--button__icon--width:18px;--button__inline__icon--padding:12px;--button--padding-top:var(--space--medium, 12px);--button--padding-bottom:var(--space--medium, 12px);--button--padding-right:var(--space--large, 24px);--button--padding-left:var(--space--large, 24px);--button--color:var(--text--primary, #FFF);--button--font-size:var(--text--medium, 14px);--button--font-family:var(--font-pattern, Arial);--button--font-weight:var(--text-weight--large);--button--background-color:var(--background--medium, #c0c0c0);--button--border-radius:var(--border--radius-large, 12px);--button--border:none;--button--hover--background-color:var(--background--strong, var(--button--background-color));--button--disabled-color:var(--text--disable);--button--disabled--background-color:var(--color--disable-secondary);--button--focus--border:var(--button--border);--button--focus--box-shadow:none;--button--link-color:var(--title--primary, '#C0C0C0')}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--button--min-width);height:var(--button--height);font-family:var(--button--font-family);font-size:var(--button--font-size);font-weight:var(--button--font-weight);padding:var(--button--padding-top) var(--button--padding-right) var(--button--padding-bottom) var(--button--padding-left);border-radius:var(--button--border-radius);background-color:var(--button--background-color);color:var(--button--color);fill:var(--button--color);border:var(--button--border)}button:hover{background-color:var(--button--hover--background-color)}button:focus{outline:none;border:var(--button--focus--border);box-shadow:var(--button--focus--box-shadow)}button:disabled{background-color:var(--button--disabled--background-color);color:var(--button--disabled-color);fill:var(--button--disabled-color);border:none;cursor:no-drop}button.icon{width:42px;min-width:42px;height:42px;padding:0px;--icon--color:#ffffff}a{font-family:var(--button--font-family);font-size:var(--button--font-size);font-weight:var(--button--font-weight);color:var(--button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";
|
|
10
10
|
|
|
11
11
|
let EzButton = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -21,15 +21,15 @@ let EzButton = class {
|
|
|
21
21
|
this.mode = "regular";
|
|
22
22
|
}
|
|
23
23
|
handleSlotChange(ev) {
|
|
24
|
-
const slot = ev.target;
|
|
25
|
-
const content = slot.assignedElements()[0];
|
|
26
24
|
if (this.mode == "link") {
|
|
25
|
+
const slot = ev.target;
|
|
26
|
+
const content = slot.assignedElements()[0];
|
|
27
27
|
content.style.display = "inline";
|
|
28
28
|
if (slot.name == "leftIcon") {
|
|
29
|
-
content.style.paddingRight = "var(--
|
|
29
|
+
content.style.paddingRight = "var(--button__inline__icon--padding)";
|
|
30
30
|
}
|
|
31
31
|
else if (slot.name == "rightIcon") {
|
|
32
|
-
content.style.paddingLeft = "var(--
|
|
32
|
+
content.style.paddingLeft = "var(--button__inline__icon--padding)";
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -205,19 +205,19 @@ let EzCalendar = class {
|
|
|
205
205
|
};
|
|
206
206
|
EzCalendar.style = ezCalendarCss;
|
|
207
207
|
|
|
208
|
-
const ezCheckCss = ":host{--
|
|
208
|
+
const ezCheckCss = ":host{--check--box--width:18px;--check--box--height:18px;--check--width:calc(var(--check--box--width) + 14px);--check--height:calc(var(--check--box--width) + 14px);--check--border-radius:var(--border--radius-small);--check--checked--background-color:var(--color--primary-200);--check--focus--background-color:var(--color--strokes, #FFFFFF);--check--hover--background-color:var(--background--medium);--check--checked--disabled--background-color:var(--color--disable-secondary);--check--border:var(--border--medium) var(--title--primary);--check--disabled--border:var(--border--medium) var(--color--strokes);--check--checked--border:var(--border--medium) var(--color--primary);--check--checked--hover--background-color:var(--color--primary-200);--check--checked--focus--background-color:var(--color--primary-300, #FFFFFF);--check--check--image:url('data:image/svg+xml;utf8,<svg width=\"8\" height=\"7\" viewBox=\"0 0 8 7\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.70002 0.398999L7.48502 0.207997C7.31524 0.0598858 7.09376 -0.0150438 6.86894 -0.000430025C6.64411 0.0141838 6.43419 0.117153 6.28502 0.285997L2.70002 4.332L1.61802 3.384C1.44837 3.23576 1.22697 3.16067 1.00214 3.17509C0.77732 3.18952 0.567332 3.2923 0.418019 3.461L0.229019 3.674C0.0752361 3.84797 -0.00437434 4.07521 0.00721192 4.30713C0.0187982 4.53904 0.120661 4.75722 0.291019 4.915L2.27402 6.762C2.35832 6.8432 2.45842 6.90618 2.56811 6.94702C2.67779 6.98787 2.79471 7.00571 2.91159 6.99942C3.02846 6.99314 3.14279 6.96287 3.24747 6.91049C3.35214 6.85812 3.44492 6.78477 3.52002 6.695L7.79102 1.638C7.94063 1.46048 8.01486 1.23149 7.99786 0.999963C7.98085 0.768436 7.87396 0.552749 7.70002 0.398999Z\"/></svg>');--check--check--background-color:var(--color--primary);--check--check--disabled--background-color:var(--color--strokes);--switch--slider--width:34px;--switch--slider--height:14px;--switch--pin--width:20px;--switch--pin--height:20px;--switch--focus--width:32px;--switch--focus--height:32px;--switch--background-color:var(--color--strokes);--switch--disabled--background-color:var(--color--disable-secondary);--switch--checked--background-color:var(--color--primary-300);--switch--pin--background-color:var(--background--xlight);--switch--pin--disabled--background-color:var(--color--disable-secondary);--switch--pin--checked--background-color:var(--color--primary);--switch--pin--checked--disabled--background-color:#E8F7F4;--switch--pin--focus--background-color:var(--text--disable);--switch--pin--checked--focus--background-color:var(--color--primary);--check--label--font-size:var(--text--medium, 14px);--check--label--font-family:var(--font-pattern, Arial);--check--label--color:var(--title--primary, #000);--check--label--disabled--color:var(--text--disable, #AFB6C0);display:flex;width:100%;align-items:center;margin:0}input.regularMode{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;box-sizing:border-box;-webkit-appearance:none;appearance:none;cursor:pointer;border-radius:50%;position:relative;width:var(--check--width);height:var(--check--height)}input.regularMode:enabled:hover{background-color:var(--check--hover--background-color)}input.regularMode:enabled:focus{outline:none;background-color:var(--check--focus--background-color)}input.regularMode:disabled{cursor:auto;background:none}input.regularMode::before{box-sizing:border-box;content:\"\";display:block;width:var(--check--box--width);height:var(--check--box--height);border-radius:var(--check--border-radius);border:var(--check--border)}input.regularMode:disabled::before{border:var(--check--disabled--border)}input.regularMode:checked:enabled:hover{background-color:var(--check--checked--hover--background-color)}input.regularMode:checked:enabled:focus{background-color:var(--check--checked--focus--background-color)}input.regularMode:checked::before{border:var(--check--checked--border);background-color:var(--check--checked--background-color)}input.regularMode:checked:disabled:before{border:var(--check--disabled--border);background-color:var(--check--checked--disabled--background-color)}input.regularMode:checked::after{display:flex;position:absolute;content:\"\";background-color:var(--check--check--background-color);width:8px;height:7px;-webkit-mask-image:var(--check--check--image);mask-image:var(--check--check--image)}input.regularMode:checked:disabled::after{background-color:var(--check--check--disabled--background-color)}input.switchMode{flex-shrink:0;-webkit-appearance:none;appearance:none;position:relative;outline:none;cursor:pointer;border-radius:20px;border:none;transition:background-color var(--transition);width:var(--switch--slider--width);height:var(--switch--slider--height);background-color:var(--switch--background-color)}input.switchMode:disabled{background-color:var(--switch--disabled--background-color)}input.switchMode::after{content:\"\";display:block;position:absolute;box-shadow:var(--shadow);transition:transform var(--transition);transition:background-color var(--transition);transform:translateY(-3px);border-radius:50%;width:var(--switch--pin--width);height:var(--switch--pin--height);background-color:var(--switch--pin--background-color)}input.switchMode:disabled::after{background-color:var(--switch--pin--disabled--background-color)}input.switchMode:checked{transition:background-color var(--transition);background-color:var(--switch--checked--background-color)}input.switchMode::before{display:block;content:\"\";display:block;position:absolute;border-radius:50%;opacity:0;width:var(--switch--focus--width);height:var(--switch--focus--height);top:calc((var(--switch--slider--height) - var(--switch--focus--height)) / 2);left:calc((var(--switch--pin--width) - var(--switch--focus--width))/2);background-color:var(--switch--pin--focus--background-color)}input.switchMode:focus::before{opacity:0.24;transition:opacity var(--transition)}input.switchMode:checked:focus::before{background-color:var(--switch--pin--checked--focus--background-color);transform:translateX(calc(var(--switch--slider--width) - var(--switch--pin--width)))}input.switchMode:checked::after{transition:transform var(--transition);transition:background-color var(--transition);transform:translateX(calc(var(--switch--slider--width) - var(--switch--pin--width))) translateY(-3px);box-shadow:var(--shadow);background-color:var(--switch--pin--checked--background-color)}input.switchMode:checked:disabled::after{background-color:var(--switch--pin--checked--disabled--background-color)}.label{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--check--label--color);text-shadow:var(--text-shadow);font-size:var(--check--label--font-size);font-family:var(--check--label--font-family);cursor:default;padding-left:var(--space--small)}.label--disabled{color:var(--check--label--disabled--color)}";
|
|
209
209
|
|
|
210
210
|
let EzCheck = class {
|
|
211
211
|
constructor(hostRef) {
|
|
212
212
|
index.registerInstance(this, hostRef);
|
|
213
213
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
214
214
|
/**
|
|
215
|
-
* Deixa o campo disponível ou não
|
|
215
|
+
* Deixa o campo disponível ou não para interação com o usuário.
|
|
216
216
|
*/
|
|
217
217
|
this.enabled = true;
|
|
218
218
|
/**
|
|
219
219
|
* Existem dois modos de visualização: regular e switch.
|
|
220
|
-
* Se esta propriedade for omitida, o componete assume o formato "regular"
|
|
220
|
+
* Se esta propriedade for omitida, o componete assume o formato "regular".
|
|
221
221
|
* No modo "regular" a visualização é a tradicional de uma caixinha marcada/desmarcada.
|
|
222
222
|
* No modo "switch" o campo tem uma interface em formato de um pino liga/desliga.
|
|
223
223
|
*/
|
|
@@ -258,12 +258,12 @@ let EzCheck = class {
|
|
|
258
258
|
getLabelClasses() {
|
|
259
259
|
let classes = "label";
|
|
260
260
|
if (!this.enabled) {
|
|
261
|
-
classes
|
|
261
|
+
classes += " label--disabled";
|
|
262
262
|
}
|
|
263
263
|
return classes;
|
|
264
264
|
}
|
|
265
265
|
render() {
|
|
266
|
-
return (index.h(index.Host, null, index.h("input", { type: "checkbox", class: "regularMode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? index.h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) :
|
|
266
|
+
return (index.h(index.Host, null, index.h("input", { type: "checkbox", class: "regularMode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? index.h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
|
|
267
267
|
}
|
|
268
268
|
static get watchers() { return {
|
|
269
269
|
"mode": ["adjustMode"]
|
|
@@ -311,7 +311,7 @@ let EzCollapsibleBox = class {
|
|
|
311
311
|
};
|
|
312
312
|
EzCollapsibleBox.style = ezCollapsibleBoxCss;
|
|
313
313
|
|
|
314
|
-
const ezComboBoxCss = ":host{--
|
|
314
|
+
const ezComboBoxCss = ":host{--combo-box--height:42px;--combo-box--width:100%;--combo-box__icon--width:48px;--combo-box--border-radius:var(--border--radius-medium, 12px);--combo-box--border-radius-small:var(--border--radius-small, 6px);--combo-box--font-size:var(--text--medium, 14px);--combo-box--font-family:var(--font-pattern, Arial);--combo-box--font-weight--large:var(--text-weight--large, 500);--combo-box--font-weight--medium:var(--text-weight--medium, 400);--combo-box--background-color--xlight:var(--background--xlight, #fff);--combo-box__input--background-color:var(--background--medium, #e0e0e0);--combo-box__input--border:var(--border--medium, 2px solid);--combo-box__input--border-color:var(--combo-box__input--background-color);--combo-box__input--focus--border-color:var(--color--primary, #008561);--combo-box__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--combo-box__input--disabled--color:var(--text--disable, #AFB6C0);--combo-box__input--error--border-color:#CC2936;--combo-box__label--color:var(--title--primary, #919191);--combo-box__list-text--primary:var(--text--primary, #626e82);--combo-box__list-height:calc(var(--combo-box--font-size) + var(--combo-box--space--medium));--combo-box--drop-down__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--combo-box--search__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"22px\" width=\"22px\"><path d=\"m 9.4,2.3 c 4.1,0 7.4,3.2 7.4,7.2 0,1.8 -0.7,3.4 -1.8,4.7 l 0.3,0.3 h 0.9 l 5.7,5.6 -1.7,1.7 -5.7,-5.6 V 15.3 L 14.3,15 C 13,16.1 11.3,16.7 9.5,16.7 5.3,16.7 2,13.5 2,9.5 2,5.5 5.3,2.3 9.4,2.3 m 0,2.2 c -2.9,0 -5.1,2.2 -5.1,5 0,2.8 2.3,5 5.1,5 2.8,0 5.1,-2.2 5.1,-5 0,-2.8 -2.2,-5 -5.1,-5 z\"/></svg>');--combo-box--space--medium:var(--space--medium, 12px);--combo-box--space--small:var(--space--small, 6px);display:flex;flex-wrap:wrap;position:relative;width:var(--combo-box--width)}ez-text-input{--it__input--background-color:var(--combo-box__input--background-color, #FFFFFF);--it__input--border-color:var(--combo-box__input--border-color, #DCE0E8)}.list-container{position:relative;width:100%}.options-list{box-sizing:border-box;width:100%;z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--combo-box--background-color--xlight);padding:var(--combo-box--space--small);border-radius:var(--combo-box--border-radius);box-shadow:var(--shadow, 0px 0px 16px 0px #000);scroll-behavior:smooth;max-height:calc(4*var(--combo-box__list-height) + 2*var(--combo-box--space--small));overflow:auto}.item{text-align:left;display:flex;justify-content:space-between;align-items:center;border-radius:var(--combo-box--border-radius-small);padding:0 var(--combo-box--space--small);list-style-type:none;min-height:var(--combo-box__list-height)}.item--label{text-align:left;flex-basis:85%;flex-grow:1;color:var(--combo-box__list-text--primary);font-weight:var(--combo-box--font-weight--large);font-family:var(--combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item--value{text-align:right;flex-basis:15%;flex-grow:0;color:var(--combo-box__list-text--primary);font-weight:var(--combo-box--font-weight--large);font-family:var(--combo-box--font-family);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}li:hover{background-color:var(--background--medium)}.preselected{background-color:var(--background--medium)}.btn-open-options{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-options:disabled{cursor:unset}.btn-open-options::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:16px;height:16px;-webkit-mask-image:var(--combo-box--drop-down__image);mask-image:var(--combo-box--drop-down__image)}.btn-open-options:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-options:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}.btn-open-search{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-search:disabled{cursor:unset}.btn-open-search::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:22px;height:22px;-webkit-mask-image:var(--combo-box--search__image);mask-image:var(--combo-box--search__image)}.btn-open-search:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-search:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}";
|
|
315
315
|
|
|
316
316
|
let EzComboBox = class {
|
|
317
317
|
constructor(hostRef) {
|
|
@@ -324,11 +324,11 @@ let EzComboBox = class {
|
|
|
324
324
|
/**
|
|
325
325
|
* Ajusta a opção de mostrar o "value" ao selecionar uma opção. Por padrão não mostra.
|
|
326
326
|
*/
|
|
327
|
-
this.
|
|
327
|
+
this.showSelectedValue = false;
|
|
328
328
|
/**
|
|
329
329
|
* Ajusta a opção de mostrar o "value" para cada opção. Por padrão não mostra
|
|
330
330
|
*/
|
|
331
|
-
this.
|
|
331
|
+
this.showOptionValue = false;
|
|
332
332
|
}
|
|
333
333
|
internalUpdate() {
|
|
334
334
|
if (this._inputElement) {
|
|
@@ -340,29 +340,29 @@ let EzComboBox = class {
|
|
|
340
340
|
this.updateVisibleOptions();
|
|
341
341
|
}
|
|
342
342
|
getText() {
|
|
343
|
-
let text =
|
|
343
|
+
let text = "";
|
|
344
344
|
const selected = this.getSelectedOption();
|
|
345
345
|
if (selected) {
|
|
346
|
-
text = this.
|
|
346
|
+
text = this.showSelectedValue ? `${selected.value} - ${selected.label}` : selected.label;
|
|
347
347
|
}
|
|
348
348
|
return text;
|
|
349
349
|
}
|
|
350
350
|
getSelectedOption() {
|
|
351
|
-
if (typeof this.value ===
|
|
351
|
+
if (typeof this.value === "string" || this.value instanceof String) {
|
|
352
352
|
return this._visibleOptions.find(o => o.value === this.value);
|
|
353
353
|
}
|
|
354
354
|
return this.value;
|
|
355
355
|
}
|
|
356
356
|
updateVisibleOptions() {
|
|
357
357
|
let opts = this._source || [];
|
|
358
|
-
if (!this.
|
|
358
|
+
if (!this.searchMode && this._criteria) {
|
|
359
359
|
const upperCriteria = this._criteria.toUpperCase();
|
|
360
360
|
opts = opts.filter(opt => opt.label.toLocaleUpperCase().indexOf(upperCriteria) > -1);
|
|
361
361
|
}
|
|
362
|
-
this._visibleOptions = [{ value:
|
|
362
|
+
this._visibleOptions = [{ value: undefined, label: "" }].concat(opts);
|
|
363
363
|
}
|
|
364
364
|
buildItem(opt, index$1) {
|
|
365
|
-
return index.h("li", { class: index$1 === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined }, index.h("span", { class: "item--label", title: opt.label }, opt.label), this.
|
|
365
|
+
return index.h("li", { class: index$1 === this._preSelection ? "item preselected" : "item", id: `item_${opt.value}`, onMouseDown: () => this.selectOption(opt), onMouseOver: () => this._preSelection = undefined }, index.h("span", { class: "item--label", title: opt.label }, opt.label), this.showOptionValue ? index.h("span", { class: "item--value", title: opt.value }, opt.value) : undefined);
|
|
366
366
|
}
|
|
367
367
|
showOptions() {
|
|
368
368
|
if (!this.enabled) {
|
|
@@ -371,10 +371,10 @@ let EzComboBox = class {
|
|
|
371
371
|
//FIXME: Provavelmente isso fará com que o popup abra em uma
|
|
372
372
|
//posição errada no futuro. Preferi fazer simples no começo,
|
|
373
373
|
//porque não quis onerar o text input com essa funcionalidade...
|
|
374
|
-
const top = this.
|
|
374
|
+
const top = this.errorMessage ? "0px" : "-17px";
|
|
375
375
|
this._floatingID = FloatingManager.FloatingManager.float(this._optionsList, this._listContainer, { autoClose: true, top });
|
|
376
376
|
window.requestAnimationFrame(() => {
|
|
377
|
-
this._optionsList.scrollIntoView({ behavior:
|
|
377
|
+
this._optionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
378
378
|
});
|
|
379
379
|
}
|
|
380
380
|
hideOptions() {
|
|
@@ -387,7 +387,7 @@ let EzComboBox = class {
|
|
|
387
387
|
return this._floatingID !== undefined && FloatingManager.FloatingManager.isFloating(this._floatingID);
|
|
388
388
|
}
|
|
389
389
|
nextOption() {
|
|
390
|
-
if (this.
|
|
390
|
+
if (this.searchMode && !this.isOptionsVisible()) {
|
|
391
391
|
return;
|
|
392
392
|
}
|
|
393
393
|
this.showOptions();
|
|
@@ -423,7 +423,7 @@ let EzComboBox = class {
|
|
|
423
423
|
selectOption(opt) {
|
|
424
424
|
const currentOpt = this.getSelectedOption();
|
|
425
425
|
if (currentOpt !== opt) {
|
|
426
|
-
const adjustedOpt = !(opt === null || opt === void 0 ? void 0 : opt.value) ?
|
|
426
|
+
const adjustedOpt = !(opt === null || opt === void 0 ? void 0 : opt.value) ? undefined : opt;
|
|
427
427
|
this.value = adjustedOpt;
|
|
428
428
|
this.ezChange.emit(adjustedOpt);
|
|
429
429
|
}
|
|
@@ -441,10 +441,10 @@ let EzComboBox = class {
|
|
|
441
441
|
this.updateVisibleOptions();
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
loadOptions(mode, argument =
|
|
444
|
+
loadOptions(mode, argument = "") {
|
|
445
445
|
this._criteria = argument;
|
|
446
|
-
if (this.
|
|
447
|
-
this.updateSource(this.
|
|
446
|
+
if (this.optionLoader) {
|
|
447
|
+
this.updateSource(this.optionLoader({ mode, argument }));
|
|
448
448
|
}
|
|
449
449
|
else {
|
|
450
450
|
this.updateSource(this.options);
|
|
@@ -452,7 +452,7 @@ let EzComboBox = class {
|
|
|
452
452
|
}
|
|
453
453
|
cancelPreselection() {
|
|
454
454
|
if (!this._inputElement.value && this.value) {
|
|
455
|
-
this.selectOption(
|
|
455
|
+
this.selectOption(undefined);
|
|
456
456
|
}
|
|
457
457
|
else {
|
|
458
458
|
this.internalUpdate();
|
|
@@ -464,11 +464,11 @@ let EzComboBox = class {
|
|
|
464
464
|
componentWillLoad() {
|
|
465
465
|
if (this.options === undefined) {
|
|
466
466
|
this.options = [];
|
|
467
|
-
const optionsTags = this.el.querySelectorAll(
|
|
467
|
+
const optionsTags = this.el.querySelectorAll("option");
|
|
468
468
|
if (optionsTags) {
|
|
469
469
|
optionsTags.forEach(e => {
|
|
470
470
|
let label = e.innerText;
|
|
471
|
-
let value = e.getAttribute(
|
|
471
|
+
let value = e.getAttribute("value");
|
|
472
472
|
if (!value) {
|
|
473
473
|
value = label;
|
|
474
474
|
}
|
|
@@ -477,11 +477,11 @@ let EzComboBox = class {
|
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
if (this.
|
|
480
|
+
if (this.searchMode) {
|
|
481
481
|
this.updateSource([]);
|
|
482
482
|
}
|
|
483
483
|
else {
|
|
484
|
-
this.loadOptions(
|
|
484
|
+
this.loadOptions("PRELOAD");
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
487
|
componentDidRender() {
|
|
@@ -499,13 +499,12 @@ let EzComboBox = class {
|
|
|
499
499
|
const argument = event.target.value;
|
|
500
500
|
this._criteria = argument;
|
|
501
501
|
if (this._criteria) {
|
|
502
|
-
if (this.
|
|
502
|
+
if (this.searchMode) {
|
|
503
503
|
if (this._changeDeboucingTimeout) {
|
|
504
504
|
window.clearTimeout(this._changeDeboucingTimeout);
|
|
505
505
|
}
|
|
506
506
|
this._changeDeboucingTimeout = window.setTimeout(() => {
|
|
507
|
-
|
|
508
|
-
this.loadOptions('PREDICTIVE', argument);
|
|
507
|
+
this.loadOptions("PREDICTIVE", argument);
|
|
509
508
|
}, 200);
|
|
510
509
|
}
|
|
511
510
|
else {
|
|
@@ -515,7 +514,7 @@ let EzComboBox = class {
|
|
|
515
514
|
}
|
|
516
515
|
}
|
|
517
516
|
onTextInputClickHandler() {
|
|
518
|
-
if (!this.
|
|
517
|
+
if (!this.searchMode) {
|
|
519
518
|
this.showOptions();
|
|
520
519
|
}
|
|
521
520
|
}
|
|
@@ -540,8 +539,8 @@ let EzComboBox = class {
|
|
|
540
539
|
this.cancelPreselection();
|
|
541
540
|
}
|
|
542
541
|
render() {
|
|
543
|
-
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(),
|
|
544
|
-
index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions(
|
|
542
|
+
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), errorMessage: this.errorMessage }, this.searchMode ?
|
|
543
|
+
index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions("ADVANCED"); }, slot: "leftIcon" })
|
|
545
544
|
:
|
|
546
545
|
index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-options", slot: "rightIcon", onClick: () => this.showOptions() })), index.h("section", { class: "list-container", ref: elem => this._listContainer = elem }, index.h("div", { class: "options-list", ref: elem => this._optionsList = elem }, this._visibleOptions.map((opt, index) => this.buildItem(opt, index))))));
|
|
547
546
|
}
|
|
@@ -567,7 +566,7 @@ let EzDateInput = class {
|
|
|
567
566
|
this._textInput.label = this.label;
|
|
568
567
|
}
|
|
569
568
|
setErrorMessage() {
|
|
570
|
-
this._textInput.
|
|
569
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
571
570
|
}
|
|
572
571
|
applyValueToInput() {
|
|
573
572
|
if (this._textInput) {
|
|
@@ -576,7 +575,7 @@ let EzDateInput = class {
|
|
|
576
575
|
}
|
|
577
576
|
changeValue(newValue) {
|
|
578
577
|
newValue = newValue == null ? null : DateUtils.clearTime(newValue);
|
|
579
|
-
this._textInput.
|
|
578
|
+
this._textInput.errorMessage = "";
|
|
580
579
|
if (this.getTextValue(newValue) !== this.getTextValue(this.value)) {
|
|
581
580
|
this.value = newValue;
|
|
582
581
|
this.ezChange.emit();
|
|
@@ -588,7 +587,7 @@ let EzDateInput = class {
|
|
|
588
587
|
//FIXME: Provavelmente isso fará com que o popup abra em uma
|
|
589
588
|
//posição errada no futuro. Preferi fazer simples no começo,
|
|
590
589
|
//porque não quis onerar o text input com essa funcionalidade...
|
|
591
|
-
const top = this._textInput.
|
|
590
|
+
const top = this._textInput.errorMessage ? 0 : -17;
|
|
592
591
|
this._calendar.fitVertical(top, this._elem.clientHeight);
|
|
593
592
|
}
|
|
594
593
|
hideCalendar() {
|
|
@@ -607,7 +606,7 @@ let EzDateInput = class {
|
|
|
607
606
|
}
|
|
608
607
|
}
|
|
609
608
|
else {
|
|
610
|
-
this._textInput.
|
|
609
|
+
this._textInput.errorMessage = "O valor digitado não é uma data válida";
|
|
611
610
|
}
|
|
612
611
|
}
|
|
613
612
|
getTextValue(d) {
|
|
@@ -617,12 +616,12 @@ let EzDateInput = class {
|
|
|
617
616
|
return (index.h(index.Host, null, index.h("ez-text-input", { class: "text-input", ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
|
|
618
617
|
if (event.key === 'H' || event.key === 'h')
|
|
619
618
|
this.changeValue(new Date());
|
|
620
|
-
}, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled,
|
|
619
|
+
}, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), index.h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
|
|
621
620
|
}
|
|
622
621
|
get _elem() { return index.getElement(this); }
|
|
623
622
|
static get watchers() { return {
|
|
624
623
|
"label": ["setLabel"],
|
|
625
|
-
"
|
|
624
|
+
"errorMessage": ["setErrorMessage"],
|
|
626
625
|
"value": ["applyValueToInput"]
|
|
627
626
|
}; }
|
|
628
627
|
};
|
|
@@ -2579,7 +2578,7 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2579
2578
|
switch (userInterface) {
|
|
2580
2579
|
case 'LONGTEXT':
|
|
2581
2580
|
return index.h("div", { class: "col col--sd-12 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2582
|
-
index.h("ez-text-area", { value: value || '', label: formattedLabel, onEzChange: evt => changeFieldHandler(evt.target['value']),
|
|
2581
|
+
index.h("ez-text-area", { value: value || '', label: formattedLabel, onEzChange: evt => changeFieldHandler(evt.target['value']), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key, enabled: isEnabled }));
|
|
2583
2582
|
case 'CHECKBOX':
|
|
2584
2583
|
case 'SWITCH':
|
|
2585
2584
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large" }, loadingData ? index.h("place-holder", null) :
|
|
@@ -2588,7 +2587,7 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2588
2587
|
const optsObj = properties ? JSON.parse(getProp(properties, 'options')) : {};
|
|
2589
2588
|
const normalized = Object.keys(optsObj).map(key => { return { value: key, label: optsObj[key] }; });
|
|
2590
2589
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2591
|
-
index.h("ez-combo-box", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']),
|
|
2590
|
+
index.h("ez-combo-box", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key, options: normalized }));
|
|
2592
2591
|
case 'SEARCH':
|
|
2593
2592
|
const context = {
|
|
2594
2593
|
__MAIN_FORM: form,
|
|
@@ -2616,7 +2615,7 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2616
2615
|
context['CRITERIA'] = criteriaList;
|
|
2617
2616
|
}
|
|
2618
2617
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2619
|
-
index.h("ez-search", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']),
|
|
2618
|
+
index.h("ez-search", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']), errorMessage: errorMessage, optionloader: (argument) => {
|
|
2620
2619
|
if (form) {
|
|
2621
2620
|
return form.loadSearch(argument, context);
|
|
2622
2621
|
}
|
|
@@ -2630,7 +2629,7 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2630
2629
|
index.h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlupload: target, requestheaders: headers, maxfiles: maxfiles })));
|
|
2631
2630
|
case 'DATE':
|
|
2632
2631
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2633
|
-
index.h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']),
|
|
2632
|
+
index.h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2634
2633
|
case 'DECIMALNUMBER':
|
|
2635
2634
|
case 'INTEGERNUMBER':
|
|
2636
2635
|
let precision = 0;
|
|
@@ -2640,11 +2639,11 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2640
2639
|
prettyPrecision = Number(getProp(properties, "prettyprecision") || precision);
|
|
2641
2640
|
}
|
|
2642
2641
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2643
|
-
index.h("ez-numeric-input", { value: !value ? null : value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']),
|
|
2642
|
+
index.h("ez-numeric-input", { value: !value ? null : value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']), errorMessage: errorMessage, precision: precision, prettyprecision: prettyPrecision, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2644
2643
|
//IMAGE, DATETIME, ELAPSEDTIME, PASSWORD, MASKEDTEXT, HTML
|
|
2645
2644
|
default:
|
|
2646
2645
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2647
|
-
index.h("ez-text-input", { value: value, label: formattedLabel, enabled: isEnabled, loading: loadingData, onInput: (event) => changeFieldHandler(event.target['value']),
|
|
2646
|
+
index.h("ez-text-input", { value: value, label: formattedLabel, enabled: isEnabled, loading: loadingData, onInput: (event) => changeFieldHandler(event.target['value']), errorMessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2648
2647
|
}
|
|
2649
2648
|
};
|
|
2650
2649
|
function getProp(properties, name) {
|
|
@@ -2705,7 +2704,7 @@ const FormSheet = ({ store, parentName, source, parentDataUnit, dataUnitBuilder,
|
|
|
2705
2704
|
buttons.previousVisible = false;
|
|
2706
2705
|
}
|
|
2707
2706
|
return index.h("div", { class: "form-sheet" },
|
|
2708
|
-
tabs ? index.h("ez-tabselector", {
|
|
2707
|
+
tabs ? index.h("ez-tabselector", { selectedIndex: selectedTab, selectedTab: name, onChange: (evt) => changeTabHandler(evt.target.selectedindex) }, tabs) : null,
|
|
2709
2708
|
dataUnit ? index.h(NavigationBar, { enabled: enabled, dataUnit: dataUnit, buttonProps: buttons }) : null,
|
|
2710
2709
|
index.h("div", { class: "tab__container" },
|
|
2711
2710
|
items ? items.map(item => buildFormItem(item, name, store, currentDU, enabled)) : null,
|
|
@@ -2964,12 +2963,14 @@ let EzForm = class {
|
|
|
2964
2963
|
};
|
|
2965
2964
|
EzForm.style = ezFormCss;
|
|
2966
2965
|
|
|
2967
|
-
const ezIconCss = ":host{display:block;overflow:hidden;position:relative}svg{display:flex;justify-content:center;align-items:center;fill:var(--color
|
|
2966
|
+
const ezIconCss = ":host{display:block;overflow:hidden;position:relative;--ez-icon--color:var(--icon--color, #ffffff)}svg{display:flex;justify-content:center;align-items:center;fill:var(--ez-icon--color)}.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}";
|
|
2968
2967
|
|
|
2969
2968
|
let EzIcon = class {
|
|
2970
2969
|
constructor(hostRef) {
|
|
2971
2970
|
index.registerInstance(this, hostRef);
|
|
2972
|
-
|
|
2971
|
+
/**
|
|
2972
|
+
* Tamanho do ícone
|
|
2973
|
+
*/
|
|
2973
2974
|
this.size = 'medium';
|
|
2974
2975
|
}
|
|
2975
2976
|
isSprite() {
|
|
@@ -3000,7 +3001,7 @@ let EzNumericInput = class {
|
|
|
3000
3001
|
this._textInput.label = this.label;
|
|
3001
3002
|
}
|
|
3002
3003
|
setErrorMessage() {
|
|
3003
|
-
this._textInput.
|
|
3004
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
3004
3005
|
}
|
|
3005
3006
|
applyValueToInput() {
|
|
3006
3007
|
if (this._textInput) {
|
|
@@ -3008,7 +3009,7 @@ let EzNumericInput = class {
|
|
|
3008
3009
|
}
|
|
3009
3010
|
}
|
|
3010
3011
|
changeValue(newValue) {
|
|
3011
|
-
this._textInput.
|
|
3012
|
+
this._textInput.errorMessage = "";
|
|
3012
3013
|
if (newValue !== this.value) {
|
|
3013
3014
|
this.value = newValue;
|
|
3014
3015
|
this.ezChange.emit();
|
|
@@ -3017,7 +3018,7 @@ let EzNumericInput = class {
|
|
|
3017
3018
|
parseNumber() {
|
|
3018
3019
|
const parsedNumber = this._textInput.value ? RequestMetadata.NumberUtils.stringToNumber(this._textInput.value) : null;
|
|
3019
3020
|
if (parsedNumber != null && isNaN(parsedNumber)) {
|
|
3020
|
-
this._textInput.
|
|
3021
|
+
this._textInput.errorMessage = "O valor digitado não é um número válido";
|
|
3021
3022
|
}
|
|
3022
3023
|
else {
|
|
3023
3024
|
this.changeValue(parsedNumber);
|
|
@@ -3030,11 +3031,11 @@ let EzNumericInput = class {
|
|
|
3030
3031
|
return null;
|
|
3031
3032
|
}
|
|
3032
3033
|
render() {
|
|
3033
|
-
return (index.h("ez-text-input", { class: "text-input", ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled,
|
|
3034
|
+
return (index.h("ez-text-input", { class: "text-input", ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage }));
|
|
3034
3035
|
}
|
|
3035
3036
|
static get watchers() { return {
|
|
3036
3037
|
"label": ["setLabel"],
|
|
3037
|
-
"
|
|
3038
|
+
"errorMessage": ["setErrorMessage"],
|
|
3038
3039
|
"value": ["applyValueToInput"]
|
|
3039
3040
|
}; }
|
|
3040
3041
|
};
|
|
@@ -3071,7 +3072,7 @@ let EzSearch = class {
|
|
|
3071
3072
|
this.ezChange.emit(evt.detail);
|
|
3072
3073
|
}
|
|
3073
3074
|
render() {
|
|
3074
|
-
return (index.h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled,
|
|
3075
|
+
return (index.h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.optionloader, searchMode: true, onEzChange: evt => this.onComboChange(evt), showSelectedValue: this.showselectedvalue, showOptionValue: this.showoptionvalue }));
|
|
3075
3076
|
}
|
|
3076
3077
|
;
|
|
3077
3078
|
static get watchers() { return {
|
|
@@ -3080,91 +3081,91 @@ let EzSearch = class {
|
|
|
3080
3081
|
};
|
|
3081
3082
|
EzSearch.style = ezSearchCss;
|
|
3082
3083
|
|
|
3083
|
-
const ezTabselectorCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;margin-bottom:var(--space--large, 24px);--
|
|
3084
|
+
const ezTabselectorCss = "@keyframes activate{0%{clip-path:inset(calc(100% - 3px) 50% 0px 50%)}100%{clip-path:inset(calc(100% - 3px) 0px 0px 0px)}}:host{display:flex;position:relative;width:100%;overflow:hidden;margin-bottom:var(--space--large, 24px);--tabselector--backward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 9.7808475,13.860393 3.9204526,8.0000004 9.7808475,2.0624965 7.9301965,0.28895552 0.21915255,8.0000004 7.9301965,15.711044 Z\"/></svg>');--tabselector--forward-icon:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"10px\"><path d=\"M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z\"/></svg>')}.scroll{display:flex;width:100%;scroll-behavior:smooth;overflow-x:auto;scrollbar-width:none}.scroll.startHidden{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px)}.scroll.midle{-webkit-mask-image:linear-gradient(90deg, transparent 20px, #000 48px, #000 calc(100% - 48px), transparent calc(100% - 20px))}.scroll.endHidden{-webkit-mask-image:linear-gradient(90deg, #000 calc(100% - 48px), transparent calc(100% - 20px))}.tab{display:flex;border:none;min-width:100px;background-color:unset;cursor:pointer;padding:6px 12px;align-items:center;justify-content:center;color:var(--text--primary, #626e82);font-family:var(--font-pattern, \"Sora, Algerian\");font-size:var(--title--small, 14px)}.tab:focus,.forward-button,.backward-button{outline:none}.is-active{position:relative;color:var(--color--primary, #008561)}.is-active::after{content:\"\";position:absolute;width:100%;height:100%;background-color:var(--color--primary, #008561);clip-path:inset(calc(100% - 3px) 0px 0px 0px);animation:activate 0.25s ease-in-out}.is-focused{border:1px dashed var(--color--primary, #000000c5)}.tab-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-shadow:var(--text-shadow);margin-bottom:var(--space--extra-small, 3px)}.forward-button,.backward-button{position:absolute;z-index:1;display:flex;box-sizing:border-box;padding:0px;top:0px;right:0px;width:16px;height:100%;border:none;background-color:unset;cursor:pointer;justify-content:center;align-items:center}.backward-button{left:0px}.forward-button::after,.backward-button::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:10px;height:16px}.forward-button::after{-webkit-mask-image:var(--tabselector--forward-icon);mask-image:var(--tabselector--forward-icon)}.backward-button::after{-webkit-mask-image:var(--tabselector--backward-icon);mask-image:var(--tabselector--backward-icon)}.forward-button:hover::after,.backward-button:hover::after{background-color:var(--color--primary, #4e4e4e)}.hidden{display:none}.scroll::-webkit-scrollbar{display:none}";
|
|
3084
3085
|
|
|
3085
3086
|
let EzTabselector = class {
|
|
3086
3087
|
constructor(hostRef) {
|
|
3087
3088
|
index.registerInstance(this, hostRef);
|
|
3088
|
-
this.
|
|
3089
|
-
this.
|
|
3090
|
-
if (ev.key ===
|
|
3091
|
-
this.
|
|
3092
|
-
this.
|
|
3093
|
-
this.
|
|
3094
|
-
this.handleTabClick(this.
|
|
3089
|
+
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
3090
|
+
this.setFocusedParam = (ev) => {
|
|
3091
|
+
if (ev.key === "Enter") {
|
|
3092
|
+
this.selectedIndex = this.focusedIndex;
|
|
3093
|
+
this.focusedIndex = undefined;
|
|
3094
|
+
this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
|
|
3095
|
+
this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
|
|
3095
3096
|
ev.preventDefault();
|
|
3096
|
-
this.setFocusedTab(this.
|
|
3097
|
+
this.setFocusedTab(this.selectedIndex);
|
|
3097
3098
|
}
|
|
3098
|
-
else if (ev.key ===
|
|
3099
|
+
else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
|
|
3099
3100
|
let operator = undefined;
|
|
3100
|
-
if (ev.key ===
|
|
3101
|
+
if (ev.key === "ArrowLeft") {
|
|
3101
3102
|
operator = false;
|
|
3102
3103
|
}
|
|
3103
|
-
else if (ev.key ===
|
|
3104
|
+
else if (ev.key === "ArrowRight") {
|
|
3104
3105
|
operator = true;
|
|
3105
3106
|
}
|
|
3106
3107
|
else {
|
|
3107
3108
|
return;
|
|
3108
3109
|
}
|
|
3109
|
-
if (this.
|
|
3110
|
+
if (this.focusedIndex === undefined) {
|
|
3110
3111
|
if (operator === false) {
|
|
3111
|
-
this.
|
|
3112
|
+
this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) - 1).toString() : undefined;
|
|
3112
3113
|
}
|
|
3113
3114
|
else {
|
|
3114
|
-
this.
|
|
3115
|
+
this.focusedIndex = this.selectedIndex !== undefined ? (parseInt(this.selectedIndex) + 1).toString() : undefined;
|
|
3115
3116
|
}
|
|
3116
3117
|
}
|
|
3117
3118
|
else {
|
|
3118
3119
|
if (operator === false) {
|
|
3119
|
-
this.
|
|
3120
|
+
this.focusedIndex = (parseInt(this.focusedIndex) - 1).toString();
|
|
3120
3121
|
}
|
|
3121
3122
|
else {
|
|
3122
|
-
this.
|
|
3123
|
+
this.focusedIndex = (parseInt(this.focusedIndex) + 1).toString();
|
|
3123
3124
|
}
|
|
3124
3125
|
}
|
|
3125
|
-
if (parseInt(this.
|
|
3126
|
-
this.
|
|
3126
|
+
if (parseInt(this.focusedIndex) < 0) {
|
|
3127
|
+
this.focusedIndex = "0";
|
|
3127
3128
|
}
|
|
3128
|
-
else if (parseInt(this.
|
|
3129
|
-
this.
|
|
3129
|
+
else if (parseInt(this.focusedIndex) > this._processedTabs.length - 1) {
|
|
3130
|
+
this.focusedIndex = (this._processedTabs.length - 1).toString();
|
|
3130
3131
|
}
|
|
3131
|
-
this.
|
|
3132
|
-
this.setFocusedTab(this.
|
|
3133
|
-
this.
|
|
3134
|
-
}
|
|
3135
|
-
else if (ev.key ===
|
|
3136
|
-
this.
|
|
3137
|
-
this.
|
|
3138
|
-
this.handleTabClick(this.
|
|
3132
|
+
this.setFocusedBtn(true, this.focusedIndex);
|
|
3133
|
+
this.setFocusedTab(this.focusedIndex);
|
|
3134
|
+
this.ezChange.emit();
|
|
3135
|
+
}
|
|
3136
|
+
else if (ev.key === "Tab" || ev.key === "Escape") {
|
|
3137
|
+
this.focusedIndex = undefined;
|
|
3138
|
+
this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
|
|
3139
|
+
this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
|
|
3139
3140
|
ev.preventDefault();
|
|
3140
|
-
this.setFocusedTab(this.
|
|
3141
|
+
this.setFocusedTab(this.selectedIndex);
|
|
3141
3142
|
}
|
|
3142
3143
|
// this.setFocusedTab();
|
|
3143
3144
|
};
|
|
3144
3145
|
}
|
|
3145
3146
|
handleTabClick(tab, index) {
|
|
3146
|
-
this.
|
|
3147
|
-
this.
|
|
3148
|
-
this.
|
|
3149
|
-
this.
|
|
3150
|
-
this.
|
|
3147
|
+
this.selectedIndex = index.toString();
|
|
3148
|
+
this.focusedIndex = undefined;
|
|
3149
|
+
this.selectedTab = tab;
|
|
3150
|
+
this.ezChange.emit();
|
|
3151
|
+
this.setFocusedBtn(false, this.selectedIndex);
|
|
3151
3152
|
}
|
|
3152
3153
|
componentWillRender() {
|
|
3153
3154
|
if (!this._processedTabs) {
|
|
3154
3155
|
this._processedTabs = [];
|
|
3155
3156
|
if (this.tabs) {
|
|
3156
|
-
this.tabs.split(
|
|
3157
|
+
this.tabs.split(",").forEach((label) => {
|
|
3157
3158
|
label = label.trim();
|
|
3158
3159
|
this._processedTabs.push(new Tab(label, label));
|
|
3159
3160
|
});
|
|
3160
3161
|
}
|
|
3161
|
-
this._hostElem.querySelectorAll(
|
|
3162
|
-
const tabKey = elem.getAttribute(
|
|
3163
|
-
const label = elem.getAttribute(
|
|
3162
|
+
this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
|
|
3163
|
+
const tabKey = elem.getAttribute("tabKey");
|
|
3164
|
+
const label = elem.getAttribute("label");
|
|
3164
3165
|
const t = new Tab(label, tabKey);
|
|
3165
3166
|
const content = elem.firstChild;
|
|
3166
3167
|
if (content) {
|
|
3167
|
-
content.setAttribute(
|
|
3168
|
+
content.setAttribute("slot", "tab" + this._processedTabs.length);
|
|
3168
3169
|
this._hostElem.appendChild(content);
|
|
3169
3170
|
}
|
|
3170
3171
|
this._processedTabs.push(t);
|
|
@@ -3188,7 +3189,7 @@ let EzTabselector = class {
|
|
|
3188
3189
|
const container = this._scrollContainer;
|
|
3189
3190
|
if (container) {
|
|
3190
3191
|
let lastTab = null;
|
|
3191
|
-
container.querySelectorAll(
|
|
3192
|
+
container.querySelectorAll(".tab").forEach((tab) => {
|
|
3192
3193
|
if (tab.getBoundingClientRect().right < container.clientWidth) {
|
|
3193
3194
|
lastTab = tab;
|
|
3194
3195
|
}
|
|
@@ -3207,18 +3208,18 @@ let EzTabselector = class {
|
|
|
3207
3208
|
this._startHidden = container.scrollLeft > 0;
|
|
3208
3209
|
this._endHidden = remainingScroll > 0;
|
|
3209
3210
|
if (this._startHidden) {
|
|
3210
|
-
this._backwardButton.classList.remove(
|
|
3211
|
+
this._backwardButton.classList.remove("hidden");
|
|
3211
3212
|
}
|
|
3212
3213
|
else {
|
|
3213
|
-
this._backwardButton.classList.add(
|
|
3214
|
+
this._backwardButton.classList.add("hidden");
|
|
3214
3215
|
}
|
|
3215
3216
|
if (this._endHidden) {
|
|
3216
|
-
this._forwardButton.classList.remove(
|
|
3217
|
+
this._forwardButton.classList.remove("hidden");
|
|
3217
3218
|
}
|
|
3218
3219
|
else {
|
|
3219
|
-
this._forwardButton.classList.add(
|
|
3220
|
+
this._forwardButton.classList.add("hidden");
|
|
3220
3221
|
}
|
|
3221
|
-
const classNames = [
|
|
3222
|
+
const classNames = ["", "startHidden", "endHidden", "midle"];
|
|
3222
3223
|
const currentClass = classNames[Number(this._startHidden) | Number(this._endHidden) << 1];
|
|
3223
3224
|
classNames.forEach((name) => {
|
|
3224
3225
|
if (name !== currentClass && container.classList.contains(name)) {
|
|
@@ -3235,11 +3236,9 @@ let EzTabselector = class {
|
|
|
3235
3236
|
this._scrollCallBack = window.setTimeout(() => { this.updateScroll(); }, 200);
|
|
3236
3237
|
}
|
|
3237
3238
|
setFocusedTab(index) {
|
|
3238
|
-
window.clearTimeout(this.
|
|
3239
|
-
this.
|
|
3239
|
+
window.clearTimeout(this._scrollCallBackTest);
|
|
3240
|
+
this._scrollCallBackTest = window.setTimeout(() => {
|
|
3240
3241
|
const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
|
|
3241
|
-
console.log('tabtoscroll => ID', `#tab${this.selectedindex}`);
|
|
3242
|
-
console.log('tabtoscroll', tabtoscroll);
|
|
3243
3242
|
tabtoscroll.scrollIntoView();
|
|
3244
3243
|
}, 200);
|
|
3245
3244
|
}
|
|
@@ -3248,27 +3247,27 @@ let EzTabselector = class {
|
|
|
3248
3247
|
this._textMesurement = this._hostElem.shadowRoot.ownerDocument.createElement("canvas");
|
|
3249
3248
|
}
|
|
3250
3249
|
const context = this._textMesurement.getContext("2d");
|
|
3251
|
-
context.font =
|
|
3252
|
-
return Math.min(220, 24 + context.measureText(text).width) +
|
|
3250
|
+
context.font = "14px Sora, Algerian";
|
|
3251
|
+
return Math.min(220, 24 + context.measureText(text).width) + "px";
|
|
3253
3252
|
}
|
|
3254
3253
|
;
|
|
3255
|
-
|
|
3256
|
-
const tabsButtons = this._scrollContainer.querySelectorAll(
|
|
3254
|
+
setFocusedBtn(visible, parameter) {
|
|
3255
|
+
const tabsButtons = this._scrollContainer.querySelectorAll(".tab");
|
|
3257
3256
|
tabsButtons.forEach((el) => {
|
|
3258
|
-
el.classList.remove(
|
|
3259
|
-
if (el.id ===
|
|
3260
|
-
el.classList.add(
|
|
3257
|
+
el.classList.remove("is-focused");
|
|
3258
|
+
if (el.id === "tab" + parameter && visible) {
|
|
3259
|
+
el.classList.add("is-focused");
|
|
3261
3260
|
}
|
|
3262
3261
|
});
|
|
3263
3262
|
}
|
|
3264
3263
|
render() {
|
|
3265
|
-
return (index.h(index.Host, null, index.h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), index.h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.
|
|
3266
|
-
const labelStyle = {
|
|
3264
|
+
return (index.h(index.Host, null, index.h("button", { class: "backward-button", ref: (el) => this._backwardButton = el, onClick: () => this.scrollBackward() }), index.h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index$1) => {
|
|
3265
|
+
const labelStyle = { "min-width": this.getTextWidth(tab.label) };
|
|
3267
3266
|
const tabId = "tab" + index$1;
|
|
3268
|
-
const isSelected = index$1 === parseInt(this.
|
|
3267
|
+
const isSelected = index$1 === parseInt(this.selectedIndex) || (this.selectedTab && tab.tabKey === this.selectedTab);
|
|
3269
3268
|
if (isSelected) {
|
|
3270
|
-
this.
|
|
3271
|
-
this.
|
|
3269
|
+
this.selectedTab = tab.tabKey;
|
|
3270
|
+
this.selectedIndex = index$1.toString();
|
|
3272
3271
|
}
|
|
3273
3272
|
return index.h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab.tabKey, index$1), style: labelStyle }, index.h("span", { class: "tab-label", title: tab.label }, tab.label), index.h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
|
|
3274
3273
|
})), index.h("button", { class: "forward-button", ref: (el) => this._forwardButton = el, onClick: () => this.scrollFoward() })));
|
|
@@ -3294,12 +3293,12 @@ let EzTextArea = class {
|
|
|
3294
3293
|
*/
|
|
3295
3294
|
this.enabled = true;
|
|
3296
3295
|
/**
|
|
3297
|
-
* Ajusta o
|
|
3296
|
+
* Ajusta o número de linhas e consequentemente o height do textarea. Valor default: 4
|
|
3298
3297
|
*/
|
|
3299
3298
|
this.rows = 4;
|
|
3300
3299
|
}
|
|
3301
3300
|
showError() {
|
|
3302
|
-
const hasError = typeof this.
|
|
3301
|
+
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
3303
3302
|
if (hasError) {
|
|
3304
3303
|
this._container.classList.add('hasError');
|
|
3305
3304
|
this._messageBoxElem.classList.add('hasError');
|
|
@@ -3379,21 +3378,17 @@ let EzTextArea = class {
|
|
|
3379
3378
|
render() {
|
|
3380
3379
|
return (index.h(index.Host, null, index.h("div", { class: "textarea", ref: (el) => this._container = el }, this.label ?
|
|
3381
3380
|
index.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)
|
|
3382
|
-
: null, index.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 })), index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.
|
|
3381
|
+
: null, index.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 })), index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
3383
3382
|
}
|
|
3384
3383
|
get _hostElement() { return index.getElement(this); }
|
|
3385
3384
|
static get watchers() { return {
|
|
3386
|
-
"
|
|
3385
|
+
"errorMessage": ["showError"],
|
|
3387
3386
|
"value": ["updateInputValue"]
|
|
3388
3387
|
}; }
|
|
3389
3388
|
};
|
|
3390
3389
|
EzTextArea.style = ezTextAreaCss;
|
|
3391
3390
|
|
|
3392
|
-
|
|
3393
|
-
return strValue && /^-?\d*[.,]?\d*$/.test(strValue);
|
|
3394
|
-
}
|
|
3395
|
-
|
|
3396
|
-
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--alert-cold-800, #042EFF);--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{display:flex;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{text-align: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}";
|
|
3391
|
+
const ezTextInputCss = ":host{--text-input--height:42px;--text-input--width:100%;--text-input__icon--width:48px;--text-input--border-radius:var(--border--radius-medium, 12px);--text-input--font-size:var(--text--medium, 14px);--text-input--font-family:var(--font-pattern, Arial);--text-input--font-weight:var(--text-weight--large, 500);--text-input--color:var(--title--primary, #000);--text-input__input--background-color:var(--background--medium, #e0e0e0);--text-input__input--border:var(--border--medium, 2px solid);--text-input__input--border-color:var(--text-input__input--background-color);--text-input__input--focus--border-color:var(--color--alert-cold-800, #042EFF);--text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--text-input__input--disabled--color:var(--text--disable, #AFB6C0);--text-input__input--error--border-color:#CC2936;--text-input__message_box--font-size:var(--text--small, 12px);--text-input__message_box--info--color:var(--color--success, #22085d);--text-input__message_box--error--color:var(--color--error, #FF0000);--text-input__label--floating--top:6px;--text-input__label--padding-top:12px;--text-input__label--padding-left:14px;--text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--text-input--height);border-radius:var(--text-input--border-radius);font-family:var(--text-input--font-family);font-size:var(--text-input--font-size);border:var(--text-input__input--border);border-color:var(--text-input__input--border-color);background-color:var(--text-input__input--background-color);color:var(--text-input--color)}input:disabled{background-color:var(--text-input__input--disabled--background-color);color:var(--text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--text-input__input--focus--border-color)}input.icon--left{padding-left:var(--text-input__icon--width)}input.icon--right{padding-right:var(--text-input__icon--width)}input.hasError{color:var(--text-input--color);border-color:var(--text-input__input--error--border-color)}input.text--right{text-align:right}.message-box{display:flex;min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-input--font-family);font-size:var(--text-input__message_box--font-size);color:var(--text-input__message_box--info--color)}.hasError{color:var(--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(--text-input__label--padding-right));left:var(--text-input--space--medium);font-family:var(--text-input--font-family);font-size:var(--text-input--font-size);font-weight:var(--text-input--font-weight);color:var(--text-input--color);top:var(--text-input__label--padding-top);left:var(--text-input__label--padding-left);padding-right:var(--text-input__label--padding-right)}.input__label--floated{font-family:var(--text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-input__label--floating--top)}.input__label--disabled{color:var(--text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--text-input__icon--width) + 2px);width:calc(100% - var(--text-input__icon--width))}.input__label--right{right:var(--text-input__icon--width);width:calc(100% - var(--text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--text-input__icon--width) + 2px);width:calc(100% - var(--text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}";
|
|
3397
3392
|
|
|
3398
3393
|
let EzTextInput = class {
|
|
3399
3394
|
constructor(hostRef) {
|
|
@@ -3405,7 +3400,7 @@ let EzTextInput = class {
|
|
|
3405
3400
|
this.enabled = true;
|
|
3406
3401
|
}
|
|
3407
3402
|
showError() {
|
|
3408
|
-
const hasError = typeof this.
|
|
3403
|
+
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
3409
3404
|
if (hasError) {
|
|
3410
3405
|
this._inputElem.classList.add('hasError');
|
|
3411
3406
|
this._messageBoxElem.classList.add('hasError');
|
|
@@ -3480,16 +3475,13 @@ let EzTextInput = class {
|
|
|
3480
3475
|
this._inputElem.value = this._maskFormatter.format(value);
|
|
3481
3476
|
}
|
|
3482
3477
|
catch (e) {
|
|
3483
|
-
this.
|
|
3478
|
+
this.errorMessage = e.message;
|
|
3484
3479
|
}
|
|
3485
3480
|
}
|
|
3486
3481
|
this.value = this._inputElem.value;
|
|
3487
3482
|
this.adjustFloatingLabel();
|
|
3488
3483
|
}
|
|
3489
3484
|
isValidValue(value) {
|
|
3490
|
-
if (this.onlynumber) {
|
|
3491
|
-
return value == "" || isValidNumber(value);
|
|
3492
|
-
}
|
|
3493
3485
|
if (this.restrict) {
|
|
3494
3486
|
return Array.from(value).reduce((valid, c) => valid && this.restrict.indexOf(c) > -1, true);
|
|
3495
3487
|
}
|
|
@@ -3518,11 +3510,11 @@ let EzTextInput = class {
|
|
|
3518
3510
|
content.style.justifyContent = "center";
|
|
3519
3511
|
content.style.overflow = "hidden";
|
|
3520
3512
|
content.style.top = "0px";
|
|
3521
|
-
content.style.width = "var(--
|
|
3522
|
-
content.style.height = "var(--
|
|
3513
|
+
content.style.width = "var(--text-input__icon--width)";
|
|
3514
|
+
content.style.height = "var(--text-input--height)";
|
|
3523
3515
|
if (slot.name == "leftIcon") {
|
|
3524
3516
|
content.style.left = "0px";
|
|
3525
|
-
content.style.borderRadius = "var(--
|
|
3517
|
+
content.style.borderRadius = "var(--text-input--border-radius) 0 0 var(--text-input--border-radius)";
|
|
3526
3518
|
this._inputElem.classList.add('icon--left');
|
|
3527
3519
|
if (this._labelElem) {
|
|
3528
3520
|
this._labelElem.classList.add('input__label--left');
|
|
@@ -3530,7 +3522,7 @@ let EzTextInput = class {
|
|
|
3530
3522
|
}
|
|
3531
3523
|
else if (slot.name == "rightIcon") {
|
|
3532
3524
|
content.style.right = "0px";
|
|
3533
|
-
content.style.borderRadius = "0 var(--
|
|
3525
|
+
content.style.borderRadius = "0 var(--text-input--border-radius) var(--text-input--border-radius) 0";
|
|
3534
3526
|
this._inputElem.classList.add('icon--right');
|
|
3535
3527
|
if (this._labelElem) {
|
|
3536
3528
|
this._labelElem.classList.add('input__label--right');
|
|
@@ -3548,9 +3540,6 @@ let EzTextInput = class {
|
|
|
3548
3540
|
// Lifecycle web component
|
|
3549
3541
|
//---------------------------------------------
|
|
3550
3542
|
componentDidLoad() {
|
|
3551
|
-
if (this.onlynumber) {
|
|
3552
|
-
this._inputElem.classList.add('text--right');
|
|
3553
|
-
}
|
|
3554
3543
|
this.showError();
|
|
3555
3544
|
this.prepareMask();
|
|
3556
3545
|
this.adjustFloatingLabel();
|
|
@@ -3563,7 +3552,7 @@ let EzTextInput = class {
|
|
|
3563
3552
|
this.value = this._maskFormatter.format(this.value);
|
|
3564
3553
|
}
|
|
3565
3554
|
catch (e) {
|
|
3566
|
-
this.
|
|
3555
|
+
this.errorMessage = e.message;
|
|
3567
3556
|
}
|
|
3568
3557
|
}
|
|
3569
3558
|
if (!this.isValidValue(this.value)) {
|
|
@@ -3575,11 +3564,11 @@ let EzTextInput = class {
|
|
|
3575
3564
|
render() {
|
|
3576
3565
|
return (index.h(index.Host, null, index.h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label ?
|
|
3577
3566
|
index.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)
|
|
3578
|
-
: null, index.h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.
|
|
3567
|
+
: null, index.h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), index.h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), index.h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
3579
3568
|
}
|
|
3580
3569
|
get _hostElement() { return index.getElement(this); }
|
|
3581
3570
|
static get watchers() { return {
|
|
3582
|
-
"
|
|
3571
|
+
"errorMessage": ["showError"],
|
|
3583
3572
|
"mask": ["prepareMask"],
|
|
3584
3573
|
"value": ["updateInputValue"]
|
|
3585
3574
|
}; }
|