@sankhyalabs/ezui 1.1.73 → 1.1.76
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 +2 -2
- package/dist/cjs/ez-button_16.cjs.entry.js +179 -165
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-label-chip.cjs.entry.js +12 -12
- package/dist/cjs/ez-list.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +21 -2
- package/dist/cjs/ez-toast.cjs.entry.js +5 -2
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/{index-4d2896bb.js → index-9431aeeb.js} +2 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/ez-action-chip/ez-action-chip.css +21 -21
- package/dist/collection/components/ez-action-chip/ez-action-chip.js +1 -1
- package/dist/collection/components/ez-button/ez-button.css +62 -43
- package/dist/collection/components/ez-button/ez-button.js +9 -2
- package/dist/collection/components/ez-calendar/ez-calendar.css +64 -64
- package/dist/collection/components/ez-calendar/ez-calendar.js +12 -9
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +34 -34
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +12 -12
- package/dist/collection/components/ez-combo-box/ez-combo-box.css +2 -2
- package/dist/collection/components/ez-date-input/ez-date-input.css +17 -3
- package/dist/collection/components/ez-date-input/ez-date-input.js +2 -2
- package/dist/collection/components/ez-form/ez-form.js +37 -35
- package/dist/collection/components/ez-form/store/Form.actions.js +16 -16
- package/dist/collection/components/ez-form/store/Form.reducer.js +17 -17
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +8 -8
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +12 -12
- package/dist/collection/components/ez-form/subcomponents/place-holder.js +1 -1
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +22 -22
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +7 -7
- package/dist/collection/components/ez-label-chip/ez-label-chip.css +49 -49
- package/dist/collection/components/ez-label-chip/ez-label-chip.js +11 -11
- package/dist/collection/components/ez-numeric-input/ez-numeric-input.css +4 -4
- package/dist/collection/components/ez-search/ez-search.js +9 -9
- package/dist/collection/components/ez-text-area/ez-text-area.css +48 -48
- package/dist/collection/components/ez-text-input/ez-text-input.css +60 -60
- package/dist/collection/components/ez-text-input/ez-text-input.js +16 -16
- package/dist/collection/components/ez-time-input/ez-time-input.js +3 -2
- package/dist/collection/components/ez-toast/ez-toast.css +9 -9
- package/dist/collection/components/ez-toast/ez-toast.js +4 -1
- package/dist/collection/components/ez-upload/ez-upload.css +41 -41
- package/dist/collection/components/ez-upload/ez-upload.js +53 -50
- package/dist/collection/utils/AssetsUtils.js +19 -0
- package/dist/custom-elements/index.js +219 -183
- package/dist/esm/ez-action-chip.entry.js +2 -2
- package/dist/esm/ez-button_16.entry.js +179 -165
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-label-chip.entry.js +12 -12
- package/dist/esm/ez-list.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +21 -2
- package/dist/esm/ez-toast.entry.js +5 -2
- package/dist/esm/ezui.js +2 -2
- package/dist/esm/{index-33153059.js → index-fd3c8023.js} +2 -1
- package/dist/esm/loader.js +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-67410dfa.entry.js → p-11ae4ae7.entry.js} +1 -1
- package/dist/ezui/{p-50464bdf.entry.js → p-47fa3d6c.entry.js} +1 -1
- package/dist/ezui/p-66954a04.entry.js +1 -0
- package/dist/ezui/p-823ff0a0.entry.js +1 -0
- package/dist/ezui/{p-7f3bc6d9.entry.js → p-8ab6168f.entry.js} +1 -1
- package/dist/ezui/{p-15743b09.entry.js → p-9c1fb51c.entry.js} +1 -1
- package/dist/ezui/{p-061d21ba.entry.js → p-9d85125b.entry.js} +1 -1
- package/dist/ezui/p-a0b6eee2.entry.js +1 -0
- package/dist/ezui/p-a7b546b2.entry.js +1 -0
- package/dist/ezui/p-c833c94f.entry.js +1 -0
- package/dist/ezui/{p-8818da66.entry.js → p-d443f020.entry.js} +1 -1
- package/dist/ezui/{p-4df6f855.js → p-e0ab3746.js} +1 -1
- package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +2 -2
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +4 -1
- package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +3 -3
- package/dist/types/components/ez-form/ez-form.d.ts +9 -9
- package/dist/types/components/ez-form/subcomponents/DataUnit.d.ts +1 -1
- package/dist/types/components/ez-form/subcomponents/form-metadata.d.ts +1 -1
- package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +2 -2
- package/dist/types/components/ez-search/ez-search.d.ts +5 -5
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +1 -1
- package/dist/types/components/ez-toast/ez-toast.d.ts +3 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +10 -7
- package/dist/types/components.d.ts +47 -38
- package/dist/types/utils/AssetsUtils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/ezui/p-0db8d49b.entry.js +0 -1
- package/dist/ezui/p-129b53df.entry.js +0 -1
- package/dist/ezui/p-25953d44.entry.js +0 -1
- package/dist/ezui/p-74809665.entry.js +0 -1
- package/dist/ezui/p-a99f8d42.entry.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as registerInstance, h, c as createEvent, f as forceUpdate, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, c as createEvent, f as forceUpdate, H as Host, g as getElement } from './index-fd3c8023.js';
|
|
2
2
|
import { N as NumberUtils, M as MaskFormatter } from './RequestMetadata-c265c9d5.js';
|
|
3
3
|
import { F as FloatingManager } from './FloatingManager-bb90ef41.js';
|
|
4
4
|
import { C as CSSVarsUtils } from './CSSVarsUtils-e0128b01.js';
|
|
5
5
|
|
|
6
|
-
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')}ez-icon{--ez-icon--color:inherit}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}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;}";
|
|
6
|
+
const ezButtonCss = ":host{--ez-button--min-width:100px;--ez-button--height:42px;--ez-button__icon--width:18px;--ez-button__inline__icon--padding:12px;--ez-button--padding-top:var(--space--medium, 12px);--ez-button--padding-bottom:var(--space--medium, 12px);--ez-button--padding-right:var(--space--large, 24px);--ez-button--padding-left:var(--space--large, 24px);--ez-button--color:var(--text--primary, #FFF);--ez-button--font-size:var(--text--medium, 14px);--ez-button--font-family:var(--font-pattern, Arial);--ez-button--font-weight:var(--text-weight--large);--ez-button--background-color:var(--background--medium, #c0c0c0);--ez-button--border-radius:var(--border--radius-large, 12px);--ez-button--border:none;--ez-button--hover--background-color:var(--background--strong, var(--ez-button--background-color));--ez-button--disabled-color:var(--text--disable);--ez-button--disabled--background-color:var(--color--disable-secondary);--ez-button--focus--border:var(--ez-button--border);--ez-button--focus--box-shadow:none;--ez-button--link-color:var(--title--primary, '#C0C0C0')}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--ez-button--min-width);height:var(--ez-button--height);font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);padding:var(--ez-button--padding-top) var(--ez-button--padding-right) var(--ez-button--padding-bottom) var(--ez-button--padding-left);border-radius:var(--ez-button--border-radius);background-color:var(--ez-button--background-color);color:var(--ez-button--color);fill:var(--ez-button--color);border:var(--ez-button--border)}button:hover{background-color:var(--ez-button--hover--background-color)}button:focus{outline:none;border:var(--ez-button--focus--border);box-shadow:var(--ez-button--focus--box-shadow)}button:disabled{background-color:var(--ez-button--disabled--background-color);color:var(--ez-button--disabled-color);fill:var(--ez-button--disabled-color);border:none;cursor:no-drop}button.icon{width:42px;min-width:42px;height:42px;padding:0px}.label-icon{display:flex;flex-direction:column;align-items:center;color:var(--ez-button--color)}.label-icon label{max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight)}a{font-family:var(--ez-button--font-family);font-size:var(--ez-button--font-size);font-weight:var(--ez-button--font-weight);color:var(--ez-button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";
|
|
7
7
|
|
|
8
8
|
let EzButton = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -23,10 +23,10 @@ let EzButton = class {
|
|
|
23
23
|
if (this.mode == "link") {
|
|
24
24
|
content.style.display = "inline";
|
|
25
25
|
if (slot.name == "leftIcon") {
|
|
26
|
-
content.style.paddingRight = "var(--button__inline__icon--padding)";
|
|
26
|
+
content.style.paddingRight = "var(--ez-button__inline__icon--padding)";
|
|
27
27
|
}
|
|
28
28
|
else if (slot.name == "rightIcon") {
|
|
29
|
-
content.style.paddingLeft = "var(--button__inline__icon--padding)";
|
|
29
|
+
content.style.paddingLeft = "var(--ez-button__inline__icon--padding)";
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
@@ -40,6 +40,12 @@ let EzButton = class {
|
|
|
40
40
|
evt.stopPropagation();
|
|
41
41
|
} })));
|
|
42
42
|
}
|
|
43
|
+
else if (this.mode == "label-icon") {
|
|
44
|
+
return (h("div", { class: "label-icon" }, h("button", { class: "icon", type: "button", disabled: !this.enabled }, h("ez-icon", { class: "icon", href: this.image, size: "large", onClick: evt => {
|
|
45
|
+
if (!this.enabled)
|
|
46
|
+
evt.stopPropagation();
|
|
47
|
+
} })), h("label", { title: this.label }, this.label)));
|
|
48
|
+
}
|
|
43
49
|
else if (this.mode == "link") {
|
|
44
50
|
return (h("a", null, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label, h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
|
|
45
51
|
}
|
|
@@ -93,16 +99,16 @@ class DateUtils {
|
|
|
93
99
|
}
|
|
94
100
|
}
|
|
95
101
|
|
|
96
|
-
const ezCalendarCss = ":host{--
|
|
102
|
+
const ezCalendarCss = ":host{--ez-calendar--font-family:var(--font-pattern, Arial);--ez-calendar--color:var(--title--primary, #626e82);--ez-calendar--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-calendar__body--background-color:var(--background--xlight, #FFF);--ez-calendar__body--padding:var(--space--medium, 12px);--ez-calendar__body--border-radius:var(--border--radius-medium, 12px);--ez-calendar__body--shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-calendar__header-line--stroke:2px;--ez-calendar__header-line--color:var(--color--strokes, #C0C0C0);--ez-calendar__nav-btn--fill:var(--text--primary, #008561);--ez-calendar__nav-btn--hover--fill:var(--color--primary, #350404);--ez-calendar__nav-btn--width:10px;--ez-calendar__nav-btn--height:16px;--ez-calendar__nav-btn--previous-image: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>');--ez-calendar__nav-btn--next-image: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>');--ez-calendar__cell--margin:0px var(--space--small, 12px);--ez-calendar__cell--width:var(--space--large, 24px);--ez-calendar__cell--padding:var(--space--extra-small, 3px) 0px;--ez-calendar__cell--border-radius:var(--border--radius-small, 6px);--ez-calendar__cell--over--background-color:var(--color--strokes, #C0C0C0);--ez-calendar__cell--outset--color:var(--color--strokes, #C0C0C0);--ez-calendar__cell--selected--background-color:var(--color--primary, #008561);--ez-calendar__cell--selected--color:var(--color--inverted, #FFF);--ez-calendar__btn-today--color:var(--color--primary);--ez-calendar__btn-today--hover--background-color:var(--color--strokes, #C0C0C0);--ez-calendar__btn-today--border-radius:var(--border--radius-small, 6px);position:relative;display:flex;user-select:none}.calendar{z-index:var(--more-visible, 2);display:flex;flex-direction:column;background-color:var(--ez-calendar__body--background-color);padding:var(--ez-calendar__body--padding);border-radius:var(--ez-calendar__body--border-radius);box-shadow:var(--ez-calendar__body--shadow)}.calendar__header{display:flex;justify-content:space-between;padding-bottom:var(--space--medium, 12px);margin:var(--space--small, 6px) var(--space--, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);border-bottom:solid var(--ez-calendar__header-line--stroke) var(--ez-calendar__header-line--color)}.calendar__btn-next,.calendar__btn-previous{outline:none;border:none;background-color:unset;cursor:pointer;padding:0px}.calendar__btn-next::after,.calendar__btn-previous::after{content:'';display:flex;background-color:var(--ez-calendar__nav-btn--fill);width:var(--ez-calendar__nav-btn--width);height:var(--ez-calendar__nav-btn--height)}.calendar__btn-previous::after{-webkit-mask-image:var(--ez-calendar__nav-btn--previous-image);mask-image:var(--ez-calendar__nav-btn--previous-image)}.calendar__btn-next::after{-webkit-mask-image:var(--ez-calendar__nav-btn--next-image);mask-image:var(--ez-calendar__nav-btn--next-image)}.calendar__btn-next:hover::after,.calendar__btn-previous:hover::after{background-color:var(--ez-calendar__nav-btn--hover--fill)}.calendar__lbl-month{font-weight:var(--text-weight--large, 600);font-size:var(--title--medium, 16px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__line{display:flex;padding:0px;margin:0px}.calendar__cell{display:flex;justify-content:center;align-content:center;cursor:pointer;font-size:var(--text--small, 12px);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow);padding:var(--ez-calendar__cell--padding);margin:var(--ez-calendar__cell--margin);min-width:var(--ez-calendar__cell--width);border-radius:var(--ez-calendar__cell--border-radius)}.calendar__cell:hover{background-color:var(--ez-calendar__cell--over--background-color)}.calendar__cell--secondary{color:var(--ez-calendar__cell--outset--color)}.calendar__cell--unselectable:hover{background-color:unset;border-radius:unset;cursor:unset}.calendar__cell--unselectable{font-weight:var(--text-weight--large, 600);font-family:var(--ez-calendar--font-family);color:var(--ez-calendar--color);text-shadow:var(--ez-calendar--text-shadow)}.calendar__cell--selected,.calendar__cell--selected:hover{background-color:var(--ez-calendar__cell--selected--background-color);color:var(--ez-calendar__cell--selected--color)}.calendar__body{padding:var(--space--small, 6px) 0px}.calendar__footer{display:flex;flex-direction:column}.calendar__btn-today{border:none;background-color:unset;cursor:pointer;font-weight:var(--text-weight--large, 600);font-size:var(--title--small);padding:var(--space--extra-small, 6px);font-family:var(--ez-calendar--font-family);text-shadow:var(--ez-calendar--text-shadow);color:var(--ez-calendar__btn-today--color);border-radius:var(--ez-calendar__btn-today--border-radius)}.calendar__btn-today:hover{background-color:var(--ez-calendar__btn-today--hover--background-color)}";
|
|
97
103
|
|
|
98
104
|
let EzCalendar = class {
|
|
99
105
|
constructor(hostRef) {
|
|
100
106
|
registerInstance(this, hostRef);
|
|
101
107
|
this.ezChange = createEvent(this, "ezChange", 7);
|
|
102
108
|
this._firstRender = true;
|
|
103
|
-
this._todayLabel =
|
|
104
|
-
this._weekDayLabels = [
|
|
105
|
-
this._monthLabels = [
|
|
109
|
+
this._todayLabel = "Hoje";
|
|
110
|
+
this._weekDayLabels = ["D", "S", "T", "Q", "Q", "S", "S"];
|
|
111
|
+
this._monthLabels = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
|
106
112
|
/**
|
|
107
113
|
* A data selecionada no calendário
|
|
108
114
|
*/
|
|
@@ -123,18 +129,21 @@ let EzCalendar = class {
|
|
|
123
129
|
if (this.floating) {
|
|
124
130
|
this._floatingID = FloatingManager.float(this._box, this._container, { autoClose: true, top, left, bottom, right });
|
|
125
131
|
window.requestAnimationFrame(() => {
|
|
126
|
-
this._box.scrollIntoView({ behavior:
|
|
132
|
+
this._box.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
127
133
|
});
|
|
128
134
|
}
|
|
129
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Método necessário para ajustar o posicionamento do calendar acima ou abaixo do ez-date-input conforme a disponibilidade de espaço.
|
|
138
|
+
*/
|
|
130
139
|
async fitVertical(topOffset, bottomOffset) {
|
|
131
140
|
const neededHeight = this._container.getBoundingClientRect().bottom + this._calendarHeight;
|
|
132
141
|
const availableBottom = (window.innerHeight || document.documentElement.clientHeight) > neededHeight;
|
|
133
142
|
if (availableBottom) {
|
|
134
|
-
this.show(topOffset +
|
|
143
|
+
this.show(topOffset + "px", undefined, "unset");
|
|
135
144
|
}
|
|
136
145
|
else {
|
|
137
|
-
this.show(
|
|
146
|
+
this.show("unset", undefined, bottomOffset + "px");
|
|
138
147
|
}
|
|
139
148
|
}
|
|
140
149
|
/**
|
|
@@ -271,7 +280,7 @@ let EzCheck = class {
|
|
|
271
280
|
};
|
|
272
281
|
EzCheck.style = ezCheckCss;
|
|
273
282
|
|
|
274
|
-
const ezCollapsibleBoxCss = ":host{--collapsible-box--height:42px;--collapsible-box--font-size:var(--title--medium, 14px);--collapsible-box--font-family:var(--font-pattern, Arial);--collapsible-box--font-weight:var(--text-weight--large, 600);--collapsible-box--color:var(--title--primary);--collapsible-box__btn--image--xsmall:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"12px\" width=\"7.5px\"><path d=\"M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z\"/></svg>');--collapsible-box__btn--image--small:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"14px\" width=\"8.68px\"><path d=\"M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z\"/></svg>');--collapsible-box__btn--image--medium: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>');--collapsible-box__btn--image--large:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"18px\" width=\"11.25px\"><path d=\"M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z\"/></svg>');--collapsible-box__btn--image--xlarge:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"20px\" width=\"12.5px\"><path d=\"M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z\"/></svg>');--collapsible-box__btn--fill:var(--collapsible-box--color);--collapsible-box__btn--width:10px;--collapsible-box__btn--height:16px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box__title{width:100%;align-self:center;display:flex;box-sizing:border-box}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;width:100%;font-family:var(--collapsible-box--font-family);font-size:var(--collapsible-box--font-size);font-weight:var(--collapsible-box--font-weight);color:var(--collapsible-box--color)}.collapsible-box__label--icon-right{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;font-family:var(--collapsible-box--font-family);font-size:var(--collapsible-box--font-size);font-weight:var(--collapsible-box--font-weight);color:var(--collapsible-box--color)}.collapsible-box__btn{outline:none;border:none;background-color:unset;cursor:pointer;padding:1px 6px}.collapsible-box__btn::after{content:'';display:flex;background-color:var(--collapsible-box__btn--fill);width:var(--collapsible-box__btn--width);height:var(--collapsible-box__btn--height);transition:transform var(--transition);transform:rotate(90deg)}.collapsible-box__btn--xsmall::after{width:7.5px;height:12px;-webkit-mask-image:var(--collapsible-box__btn--image--xsmall);mask-image:var(--collapsible-box__btn--image--xsmall)}.collapsible-box__btn--small::after{width:8.68px;height:14px;-webkit-mask-image:var(--collapsible-box__btn--image--small);mask-image:var(--collapsible-box__btn--image--small)}.collapsible-box__btn--medium::after{width:10px;height:16px;-webkit-mask-image:var(--collapsible-box__btn--image--medium);mask-image:var(--collapsible-box__btn--image--medium)}.collapsible-box__btn--large::after{width:11.25px;height:18px;-webkit-mask-image:var(--collapsible-box__btn--image--large);mask-image:var(--collapsible-box__btn--image--large)}.collapsible-box__btn--xlarge::after{width:12.5px;height:20px;-webkit-mask-image:var(--collapsible-box__btn--image--xlarge);mask-image:var(--collapsible-box__btn--image--xlarge)}.collapsible-box__btn--collapsed::after{transform:rotate(0deg)}.font--xsmall{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--xlarge{font-size:20px}";
|
|
283
|
+
const ezCollapsibleBoxCss = ":host{--ez-collapsible-box--height:42px;--ez-collapsible-box--font-size:var(--title--medium, 14px);--ez-collapsible-box--font-family:var(--font-pattern, Arial);--ez-collapsible-box--font-weight:var(--text-weight--large, 600);--ez-collapsible-box--color:var(--title--primary);--ez-collapsible-box__btn--image--xsmall:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"12px\" width=\"7.5px\"><path d=\"M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z\"/></svg>');--ez-collapsible-box__btn--image--small:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"14px\" width=\"8.68px\"><path d=\"M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z\"/></svg>');--ez-collapsible-box__btn--image--medium: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>');--ez-collapsible-box__btn--image--large:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"18px\" width=\"11.25px\"><path d=\"M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z\"/></svg>');--ez-collapsible-box__btn--image--xlarge:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"20px\" width=\"12.5px\"><path d=\"M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z\"/></svg>');--ez-collapsible-box__btn--fill:var(--ez-collapsible-box--color);--ez-collapsible-box__btn--width:10px;--ez-collapsible-box__btn--height:16px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box__title{width:100%;align-self:center;display:flex;box-sizing:border-box}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;width:100%;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__label--icon-right{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight);color:var(--ez-collapsible-box--color)}.collapsible-box__btn{outline:none;border:none;background-color:unset;cursor:pointer;padding:1px 6px}.collapsible-box__btn::after{content:'';display:flex;background-color:var(--ez-collapsible-box__btn--fill);width:var(--ez-collapsible-box__btn--width);height:var(--ez-collapsible-box__btn--height);transition:transform var(--transition);transform:rotate(90deg)}.collapsible-box__btn--xsmall::after{width:7.5px;height:12px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xsmall);mask-image:var(--ez-collapsible-box__btn--image--xsmall)}.collapsible-box__btn--small::after{width:8.68px;height:14px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--small);mask-image:var(--ez-collapsible-box__btn--image--small)}.collapsible-box__btn--medium::after{width:10px;height:16px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--medium);mask-image:var(--ez-collapsible-box__btn--image--medium)}.collapsible-box__btn--large::after{width:11.25px;height:18px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--large);mask-image:var(--ez-collapsible-box__btn--image--large)}.collapsible-box__btn--xlarge::after{width:12.5px;height:20px;-webkit-mask-image:var(--ez-collapsible-box__btn--image--xlarge);mask-image:var(--ez-collapsible-box__btn--image--xlarge)}.collapsible-box__btn--collapsed::after{transform:rotate(0deg)}.font--xsmall{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--xlarge{font-size:20px}";
|
|
275
284
|
|
|
276
285
|
let EzCollapsibleBox = class {
|
|
277
286
|
constructor(hostRef) {
|
|
@@ -284,11 +293,11 @@ let EzCollapsibleBox = class {
|
|
|
284
293
|
/**
|
|
285
294
|
* Define o tamanho do texto e do ícone do componente.
|
|
286
295
|
*/
|
|
287
|
-
this.
|
|
296
|
+
this.headerSize = "small";
|
|
288
297
|
/**
|
|
289
298
|
* Define o local onde o ícone será renderizado.
|
|
290
299
|
*/
|
|
291
|
-
this.
|
|
300
|
+
this.iconPlacement = "left";
|
|
292
301
|
}
|
|
293
302
|
observeValue() {
|
|
294
303
|
this.ezChange.emit();
|
|
@@ -300,10 +309,10 @@ let EzCollapsibleBox = class {
|
|
|
300
309
|
this.value = !this.value;
|
|
301
310
|
}
|
|
302
311
|
render() {
|
|
303
|
-
return (h(Host, null, this.
|
|
304
|
-
h("div", { class: "collapsible-box__title" }, h("label", { class: (this.
|
|
312
|
+
return (h(Host, null, this.iconPlacement == "right" ?
|
|
313
|
+
h("div", { class: "collapsible-box__title" }, h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label), h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }))
|
|
305
314
|
:
|
|
306
|
-
h("div", { class: "collapsible-box__title" }, h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.
|
|
315
|
+
h("div", { class: "collapsible-box__title" }, h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }), h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label)), !this.value ? h("slot", null) : null));
|
|
307
316
|
}
|
|
308
317
|
static get watchers() { return {
|
|
309
318
|
"value": ["observeValue"]
|
|
@@ -311,7 +320,7 @@ let EzCollapsibleBox = class {
|
|
|
311
320
|
};
|
|
312
321
|
EzCollapsibleBox.style = ezCollapsibleBoxCss;
|
|
313
322
|
|
|
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{--
|
|
323
|
+
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{--ez-text-input__input--background-color:var(--combo-box__input--background-color, #FFFFFF);--ez-text-input__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
324
|
|
|
316
325
|
let EzComboBox = class {
|
|
317
326
|
constructor(hostRef) {
|
|
@@ -551,7 +560,7 @@ let EzComboBox = class {
|
|
|
551
560
|
};
|
|
552
561
|
EzComboBox.style = ezComboBoxCss;
|
|
553
562
|
|
|
554
|
-
const ezDateInputCss = ":host{display:block;width:100%;--
|
|
563
|
+
const ezDateInputCss = ":host{display:block;width:100%;--ez-date-input__input--background-color:var(--background--medium, #e0e0e0);--ez-date-input__input--border-color:var(--ez-date-input__input--background-color);--ez-date-input__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.text-input{--ez-text-input__input--background-color:inherit;--ez-text-input__input--border-color:inherit}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--ez-date-input__calendar-image);mask-image:var(--ez-date-input__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}ez-text-input{--text-input__input--background-color:var(--ez-date-input__input--background-color, #FFFFFF);--text-input__input--border-color:var(--ez-date-input__input--border-color, #DCE0E8)}";
|
|
555
564
|
|
|
556
565
|
let EzDateInput = class {
|
|
557
566
|
constructor(hostRef) {
|
|
@@ -610,14 +619,14 @@ let EzDateInput = class {
|
|
|
610
619
|
}
|
|
611
620
|
}
|
|
612
621
|
getTextValue(d) {
|
|
613
|
-
return d ? new Intl.DateTimeFormat(
|
|
622
|
+
return d ? new Intl.DateTimeFormat("pt-BR").format(d) : null;
|
|
614
623
|
}
|
|
615
624
|
componentDidLoad() {
|
|
616
625
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
617
626
|
}
|
|
618
627
|
render() {
|
|
619
628
|
return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
|
|
620
|
-
if (event.key ===
|
|
629
|
+
if (event.key === "H" || event.key === "h")
|
|
621
630
|
this.changeValue(new Date());
|
|
622
631
|
}, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
|
|
623
632
|
}
|
|
@@ -1208,19 +1217,19 @@ thunk.withExtraArgument = createThunkMiddleware;
|
|
|
1208
1217
|
|
|
1209
1218
|
function changeFieldValue$1(dataUnit, recordId, fieldName, value) {
|
|
1210
1219
|
return {
|
|
1211
|
-
type:
|
|
1220
|
+
type: "FORM/CHANGEFIELD",
|
|
1212
1221
|
payload: { dataUnit, recordId, fieldName, value }
|
|
1213
1222
|
};
|
|
1214
1223
|
}
|
|
1215
1224
|
function changeTab$1(formId, index) {
|
|
1216
1225
|
return {
|
|
1217
|
-
type:
|
|
1226
|
+
type: "FORM/CHANGETAB",
|
|
1218
1227
|
payload: { formId, index }
|
|
1219
1228
|
};
|
|
1220
1229
|
}
|
|
1221
1230
|
function clearEdition$1(dataUnit, recordsLimit) {
|
|
1222
1231
|
return {
|
|
1223
|
-
type:
|
|
1232
|
+
type: "FORM/CLEAREDITION",
|
|
1224
1233
|
payload: {
|
|
1225
1234
|
dataUnit,
|
|
1226
1235
|
recordsLimit
|
|
@@ -1229,13 +1238,13 @@ function clearEdition$1(dataUnit, recordsLimit) {
|
|
|
1229
1238
|
}
|
|
1230
1239
|
function collapseExpandGroup(collapseId, collapsed) {
|
|
1231
1240
|
return {
|
|
1232
|
-
type:
|
|
1241
|
+
type: "FORM/COLLAPSEGROUP",
|
|
1233
1242
|
payload: { collapseId, collapsed }
|
|
1234
1243
|
};
|
|
1235
1244
|
}
|
|
1236
1245
|
function previousRecord(dataUnit) {
|
|
1237
1246
|
return {
|
|
1238
|
-
type:
|
|
1247
|
+
type: "FORM/NAVIGATE",
|
|
1239
1248
|
payload: {
|
|
1240
1249
|
dataUnit,
|
|
1241
1250
|
limit: 0,
|
|
@@ -1245,7 +1254,7 @@ function previousRecord(dataUnit) {
|
|
|
1245
1254
|
}
|
|
1246
1255
|
function nextRecord(dataUnit, limit) {
|
|
1247
1256
|
return {
|
|
1248
|
-
type:
|
|
1257
|
+
type: "FORM/NAVIGATE",
|
|
1249
1258
|
payload: {
|
|
1250
1259
|
dataUnit,
|
|
1251
1260
|
limit,
|
|
@@ -1255,7 +1264,7 @@ function nextRecord(dataUnit, limit) {
|
|
|
1255
1264
|
}
|
|
1256
1265
|
function insertRecord$1(dataUnit, insertionIndex) {
|
|
1257
1266
|
return {
|
|
1258
|
-
type:
|
|
1267
|
+
type: "FORM/INSERT",
|
|
1259
1268
|
payload: {
|
|
1260
1269
|
dataUnit,
|
|
1261
1270
|
insertionIndex
|
|
@@ -1264,12 +1273,12 @@ function insertRecord$1(dataUnit, insertionIndex) {
|
|
|
1264
1273
|
}
|
|
1265
1274
|
function formLoad() {
|
|
1266
1275
|
return {
|
|
1267
|
-
type:
|
|
1276
|
+
type: "FORM/LOAD"
|
|
1268
1277
|
};
|
|
1269
1278
|
}
|
|
1270
1279
|
function dataLoading$1(dataUnit) {
|
|
1271
1280
|
return {
|
|
1272
|
-
type:
|
|
1281
|
+
type: "FORM/DATALOADING",
|
|
1273
1282
|
payload: {
|
|
1274
1283
|
dataUnit
|
|
1275
1284
|
}
|
|
@@ -1277,7 +1286,7 @@ function dataLoading$1(dataUnit) {
|
|
|
1277
1286
|
}
|
|
1278
1287
|
function savingChanges$1(dataUnit) {
|
|
1279
1288
|
return {
|
|
1280
|
-
type:
|
|
1289
|
+
type: "FORM/SAVINGCHANGES",
|
|
1281
1290
|
payload: {
|
|
1282
1291
|
dataUnit
|
|
1283
1292
|
}
|
|
@@ -1285,7 +1294,7 @@ function savingChanges$1(dataUnit) {
|
|
|
1285
1294
|
}
|
|
1286
1295
|
function dataLoaded$1(dataUnit) {
|
|
1287
1296
|
return {
|
|
1288
|
-
type:
|
|
1297
|
+
type: "FORM/DATALOADED",
|
|
1289
1298
|
payload: {
|
|
1290
1299
|
dataUnit
|
|
1291
1300
|
}
|
|
@@ -1293,7 +1302,7 @@ function dataLoaded$1(dataUnit) {
|
|
|
1293
1302
|
}
|
|
1294
1303
|
function changesSaved$1(dataUnit) {
|
|
1295
1304
|
return {
|
|
1296
|
-
type:
|
|
1305
|
+
type: "FORM/CHANGESSAVED",
|
|
1297
1306
|
payload: {
|
|
1298
1307
|
dataUnit
|
|
1299
1308
|
}
|
|
@@ -1301,7 +1310,7 @@ function changesSaved$1(dataUnit) {
|
|
|
1301
1310
|
}
|
|
1302
1311
|
function removingRecord$1(dataUnit) {
|
|
1303
1312
|
return {
|
|
1304
|
-
type:
|
|
1313
|
+
type: "FORM/REMOVINGRECORD",
|
|
1305
1314
|
payload: {
|
|
1306
1315
|
dataUnit
|
|
1307
1316
|
}
|
|
@@ -1309,7 +1318,7 @@ function removingRecord$1(dataUnit) {
|
|
|
1309
1318
|
}
|
|
1310
1319
|
function recordRemoved$1(dataUnit) {
|
|
1311
1320
|
return {
|
|
1312
|
-
type:
|
|
1321
|
+
type: "FORM/RECORDREMOVED",
|
|
1313
1322
|
payload: {
|
|
1314
1323
|
dataUnit
|
|
1315
1324
|
}
|
|
@@ -1317,7 +1326,7 @@ function recordRemoved$1(dataUnit) {
|
|
|
1317
1326
|
}
|
|
1318
1327
|
function invalidField$1(tabController, tabIndex, dataUnit, recordIndex, recordId, fieldName, errorMessage) {
|
|
1319
1328
|
return {
|
|
1320
|
-
type:
|
|
1329
|
+
type: "FORM/INVALIDFIELD",
|
|
1321
1330
|
payload: {
|
|
1322
1331
|
tabController,
|
|
1323
1332
|
tabIndex,
|
|
@@ -1331,7 +1340,7 @@ function invalidField$1(tabController, tabIndex, dataUnit, recordIndex, recordId
|
|
|
1331
1340
|
}
|
|
1332
1341
|
function showHideNavigationButtons(buttonName, status) {
|
|
1333
1342
|
return {
|
|
1334
|
-
type:
|
|
1343
|
+
type: "FORM/SHOWHIDENAVBTN",
|
|
1335
1344
|
payload: {
|
|
1336
1345
|
buttonName,
|
|
1337
1346
|
status
|
|
@@ -1992,19 +2001,19 @@ const inicialNonHistState = {
|
|
|
1992
2001
|
};
|
|
1993
2002
|
function formReducer(state = inicialHistState, action) {
|
|
1994
2003
|
switch (action.type) {
|
|
1995
|
-
case
|
|
2004
|
+
case "FORM/COLLAPSEGROUP":
|
|
1996
2005
|
return collapseGroup(state, action.payload);
|
|
1997
|
-
case
|
|
2006
|
+
case "FORM/CHANGETAB":
|
|
1998
2007
|
return changeTab(state, action.payload.formId, action.payload.index);
|
|
1999
|
-
case
|
|
2008
|
+
case "FORM/NAVIGATE":
|
|
2000
2009
|
return navigate(state, action.payload);
|
|
2001
|
-
case
|
|
2010
|
+
case "FORM/INSERT":
|
|
2002
2011
|
return insertRecord(state, action.payload);
|
|
2003
|
-
case
|
|
2012
|
+
case "FORM/CHANGEFIELD":
|
|
2004
2013
|
return changeFieldValue(state, action.payload);
|
|
2005
|
-
case
|
|
2014
|
+
case "FORM/CLEAREDITION":
|
|
2006
2015
|
return clearEdition(state, action.payload);
|
|
2007
|
-
case
|
|
2016
|
+
case "FORM/INVALIDFIELD":
|
|
2008
2017
|
return navigateToInvalid(state, action.payload);
|
|
2009
2018
|
default:
|
|
2010
2019
|
return state;
|
|
@@ -2012,25 +2021,25 @@ function formReducer(state = inicialHistState, action) {
|
|
|
2012
2021
|
}
|
|
2013
2022
|
function formNonHistoricReducer(state = inicialNonHistState, action) {
|
|
2014
2023
|
switch (action.type) {
|
|
2015
|
-
case
|
|
2024
|
+
case "FORM/DATALOADING":
|
|
2016
2025
|
return dataLoading(state, action.payload);
|
|
2017
|
-
case
|
|
2026
|
+
case "FORM/DATALOADED":
|
|
2018
2027
|
return dataLoaded(state, action.payload);
|
|
2019
|
-
case
|
|
2028
|
+
case "FORM/SAVINGCHANGES":
|
|
2020
2029
|
return savingChanges(state, action.payload);
|
|
2021
|
-
case
|
|
2030
|
+
case "FORM/CHANGESSAVED":
|
|
2022
2031
|
return changesSaved(state, action.payload);
|
|
2023
|
-
case
|
|
2032
|
+
case "FORM/REMOVINGRECORD":
|
|
2024
2033
|
return removingRecord(state, action.payload);
|
|
2025
|
-
case
|
|
2034
|
+
case "FORM/RECORDREMOVED":
|
|
2026
2035
|
return recordRemoved(state, action.payload);
|
|
2027
|
-
case
|
|
2036
|
+
case "FORM/INVALIDFIELD":
|
|
2028
2037
|
return invalidField(state, action.payload);
|
|
2029
|
-
case
|
|
2038
|
+
case "FORM/CLEAREDITION":
|
|
2030
2039
|
return clearAllInvalidFields(state, action.payload);
|
|
2031
|
-
case
|
|
2040
|
+
case "FORM/CHANGEFIELD":
|
|
2032
2041
|
return clearInvalidField(state, action.payload);
|
|
2033
|
-
case
|
|
2042
|
+
case "FORM/SHOWHIDENAVBTN":
|
|
2034
2043
|
return showHideNavBtn(state, action.payload);
|
|
2035
2044
|
default:
|
|
2036
2045
|
return state;
|
|
@@ -2220,13 +2229,13 @@ const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
|
|
|
2220
2229
|
|| buttonProps.cancelVisible
|
|
2221
2230
|
|| buttonProps.reloadVisible) {
|
|
2222
2231
|
return h("div", { class: "col col--sd-12 align--right" },
|
|
2223
|
-
buttonProps.previousVisible ? h("ez-button", { key: du.name +
|
|
2224
|
-
buttonProps.nextVisible ? h("ez-button", { key: du.name +
|
|
2225
|
-
buttonProps.removeVisible ? h("ez-button", { key: du.name +
|
|
2226
|
-
buttonProps.addVisible ? h("ez-button", { key: du.name +
|
|
2227
|
-
buttonProps.reloadVisible ? h("ez-button", { key: du.name +
|
|
2228
|
-
buttonProps.cancelVisible ? h("ez-button", { key: du.name +
|
|
2229
|
-
buttonProps.saveVisible ? h("ez-button", { key: du.name +
|
|
2232
|
+
buttonProps.previousVisible ? h("ez-button", { key: du.name + "_previous", title: "Registro anterior", mode: "icon", enabled: enabled && du.hasPrevious(), onClick: () => du.previous(), image: "/themes/default/images/icons/actions-sprite.svg#previous-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
2233
|
+
buttonProps.nextVisible ? h("ez-button", { key: du.name + "_next", title: "Pr\u00F3ximo registro", mode: "icon", enabled: enabled && du.hasNext(), onClick: () => du.next(), image: "/themes/default/images/icons/actions-sprite.svg#next-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
2234
|
+
buttonProps.removeVisible ? h("ez-button", { key: du.name + "_remove", label: "Remover", enabled: enabled && du.hasCurrentRecord(), onClick: () => removeHandler(du), image: "/themes/default/images/icons/actions-sprite.svg#minus-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
2235
|
+
buttonProps.addVisible ? h("ez-button", { key: du.name + "_add", label: "Adicionar", enabled: enabled, onClick: () => du.insert(), class: "button--secondary margin-right--medium" }) : null,
|
|
2236
|
+
buttonProps.reloadVisible ? h("ez-button", { key: du.name + "_reload", title: "Recarregar", enabled: enabled, mode: "icon", onClick: () => du.load(), image: "/themes/default/images/icons/actions-sprite.svg#rotate", class: "button--secondary margin-right--medium" }) : null,
|
|
2237
|
+
buttonProps.cancelVisible ? h("ez-button", { key: du.name + "_cancel", label: "Cancelar", enabled: enabled && du.hasChanges(), onClick: () => du.cancel(), class: "button--secondary margin-right--medium" }) : null,
|
|
2238
|
+
buttonProps.saveVisible ? h("ez-button", { key: du.name + "_save", label: "Salvar", enabled: enabled && du.hasChanges(), onClick: () => saveHandler(du), class: "button--primary margin-right--medium" }) : null);
|
|
2230
2239
|
}
|
|
2231
2240
|
else {
|
|
2232
2241
|
return null;
|
|
@@ -2272,7 +2281,7 @@ const selectErrorMessage = (state, dataUnit, recordId, fieldName) => {
|
|
|
2272
2281
|
const selectVisibleButtons = state => state.nonhist.visibleButtons;
|
|
2273
2282
|
|
|
2274
2283
|
class DataUnit {
|
|
2275
|
-
constructor(name, unitLabel, cardinality =
|
|
2284
|
+
constructor(name, unitLabel, cardinality = "1", parentDU = null) {
|
|
2276
2285
|
this.name = name;
|
|
2277
2286
|
this.unitLabel = unitLabel;
|
|
2278
2287
|
this.cardinality = cardinality;
|
|
@@ -2355,13 +2364,13 @@ class DataUnit {
|
|
|
2355
2364
|
}, 100);
|
|
2356
2365
|
}
|
|
2357
2366
|
cancel() {
|
|
2358
|
-
this.records = this.records.filter(r => !r.record__id.startsWith(
|
|
2367
|
+
this.records = this.records.filter(r => !r.record__id.startsWith("NEW_"));
|
|
2359
2368
|
this._store.dispatch(clearEdition$1(this.name, this.records.length - 1));
|
|
2360
2369
|
}
|
|
2361
2370
|
insert() {
|
|
2362
2371
|
const insertionIndex = this.records.length;
|
|
2363
2372
|
const newRecordIndex = selectNewRecordIndex(this._store.getState(), this.name);
|
|
2364
|
-
const newRecord = { record__id:
|
|
2373
|
+
const newRecord = { record__id: "NEW_" + (newRecordIndex + 1) };
|
|
2365
2374
|
this.bindToParent(newRecord);
|
|
2366
2375
|
this.records.push(newRecord);
|
|
2367
2376
|
this._store.dispatch(insertRecord$1(this.name, insertionIndex));
|
|
@@ -2474,7 +2483,7 @@ class DataUnit {
|
|
|
2474
2483
|
}
|
|
2475
2484
|
else {
|
|
2476
2485
|
if (result.__data__unit === this.name) {
|
|
2477
|
-
if (this.cardinality ===
|
|
2486
|
+
if (this.cardinality === "1") {
|
|
2478
2487
|
this.records = [this.buildRecordFromSaveResult(this.records[0], result)];
|
|
2479
2488
|
}
|
|
2480
2489
|
}
|
|
@@ -2485,7 +2494,7 @@ class DataUnit {
|
|
|
2485
2494
|
this._store.dispatch(changesSaved$1(this.name));
|
|
2486
2495
|
}
|
|
2487
2496
|
buildRecordFromSaveResult(baseRecord, saveResult) {
|
|
2488
|
-
const newRecord = baseRecord ? Object.assign({}, baseRecord) : { record__id:
|
|
2497
|
+
const newRecord = baseRecord ? Object.assign({}, baseRecord) : { record__id: "" };
|
|
2489
2498
|
Object.keys(saveResult).forEach(attrib => {
|
|
2490
2499
|
if (!attrib.startsWith("__")) {
|
|
2491
2500
|
newRecord[attrib] = saveResult[attrib];
|
|
@@ -2579,19 +2588,19 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2579
2588
|
dataUnit.changeValue(name, newValue);
|
|
2580
2589
|
};
|
|
2581
2590
|
switch (userInterface) {
|
|
2582
|
-
case
|
|
2591
|
+
case "LONGTEXT":
|
|
2583
2592
|
return h("div", { class: "col col--sd-12 padding--small" }, loadingData ? h("place-holder", null) :
|
|
2584
|
-
h("ez-text-area", { value: value ||
|
|
2585
|
-
case
|
|
2586
|
-
case
|
|
2593
|
+
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 }));
|
|
2594
|
+
case "CHECKBOX":
|
|
2595
|
+
case "SWITCH":
|
|
2587
2596
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small align--middle padding-bottom--large" }, loadingData ? h("place-holder", null) :
|
|
2588
|
-
h("ez-check", { value: value, label: label, enabled: isEnabled, mode: userInterface === "CHECKBOX" ? "regular" : "switch", onEzChange: (event) => changeFieldHandler(event.target[
|
|
2589
|
-
case
|
|
2590
|
-
const optsObj = properties ? JSON.parse(getProp(properties,
|
|
2597
|
+
h("ez-check", { value: value, label: label, enabled: isEnabled, mode: userInterface === "CHECKBOX" ? "regular" : "switch", onEzChange: (event) => changeFieldHandler(event.target["value"]), ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2598
|
+
case "OPTIONSELECTOR":
|
|
2599
|
+
const optsObj = properties ? JSON.parse(getProp(properties, "options")) : {};
|
|
2591
2600
|
const normalized = Object.keys(optsObj).map(key => { return { value: key, label: optsObj[key] }; });
|
|
2592
2601
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
2593
|
-
h("ez-combo-box", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
2594
|
-
case
|
|
2602
|
+
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 }));
|
|
2603
|
+
case "SEARCH":
|
|
2595
2604
|
const context = {
|
|
2596
2605
|
__MAIN_FORM: form,
|
|
2597
2606
|
__DATA_UNIT: dataUnit.name,
|
|
@@ -2615,38 +2624,38 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2615
2624
|
}
|
|
2616
2625
|
});
|
|
2617
2626
|
if (criteriaList.length > 0) {
|
|
2618
|
-
context[
|
|
2627
|
+
context["CRITERIA"] = criteriaList;
|
|
2619
2628
|
}
|
|
2620
2629
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
2621
|
-
h("ez-search", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
2630
|
+
h("ez-search", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target["value"]), errorMessage: errorMessage, optionLoader: (argument) => {
|
|
2622
2631
|
if (form) {
|
|
2623
2632
|
return form.loadSearch(argument, context);
|
|
2624
2633
|
}
|
|
2625
2634
|
}, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
2626
|
-
case
|
|
2627
|
-
const target = getProp(properties,
|
|
2628
|
-
const strHeaders = getProp(properties,
|
|
2635
|
+
case "FILE":
|
|
2636
|
+
const target = getProp(properties, "URL");
|
|
2637
|
+
const strHeaders = getProp(properties, "HEADERS");
|
|
2629
2638
|
const headers = strHeaders ? JSON.parse(strHeaders) : {};
|
|
2630
2639
|
const maxfiles = Number(getProp(properties, "maxfiles") || 0);
|
|
2631
2640
|
return (h("div", { class: "col col--sd-12 padding--small" }, loadingData ? h("place-holder", null) :
|
|
2632
|
-
h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail),
|
|
2633
|
-
case
|
|
2641
|
+
h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlUpload: target, requestHeaders: headers, maxFiles: maxfiles })));
|
|
2642
|
+
case "DATE":
|
|
2634
2643
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
2635
|
-
h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
2636
|
-
case
|
|
2637
|
-
case
|
|
2644
|
+
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 }));
|
|
2645
|
+
case "DECIMALNUMBER":
|
|
2646
|
+
case "INTEGERNUMBER":
|
|
2638
2647
|
let precision = 0;
|
|
2639
2648
|
let prettyPrecision = 0;
|
|
2640
|
-
if (userInterface ===
|
|
2649
|
+
if (userInterface === "DECIMALNUMBER") {
|
|
2641
2650
|
precision = Number(getProp(properties, "precision") || 2);
|
|
2642
2651
|
prettyPrecision = Number(getProp(properties, "prettyprecision") || precision);
|
|
2643
2652
|
}
|
|
2644
2653
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
2645
|
-
h("ez-numeric-input", { value: !value ? null : value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target[
|
|
2654
|
+
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 }));
|
|
2646
2655
|
//IMAGE, DATETIME, ELAPSEDTIME, PASSWORD, MASKEDTEXT, HTML
|
|
2647
2656
|
default:
|
|
2648
2657
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
2649
|
-
h("ez-text-input", { value: value, label: formattedLabel, enabled: isEnabled, loading: loadingData, onInput: (event) => changeFieldHandler(event.target[
|
|
2658
|
+
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 }));
|
|
2650
2659
|
}
|
|
2651
2660
|
};
|
|
2652
2661
|
function getProp(properties, name) {
|
|
@@ -2730,8 +2739,9 @@ let EzForm = class {
|
|
|
2730
2739
|
this._preparedMetadata = undefined;
|
|
2731
2740
|
}
|
|
2732
2741
|
async validate() {
|
|
2742
|
+
const duSourcesNames = Array.from(this._duSources.keys());
|
|
2733
2743
|
for (let i = 0; i < this._duSources.size; i++) {
|
|
2734
|
-
const duName =
|
|
2744
|
+
const duName = duSourcesNames[i];
|
|
2735
2745
|
let du = this._dataUnits.get(duName);
|
|
2736
2746
|
if (du === undefined) {
|
|
2737
2747
|
const source = this._duSources.get(duName);
|
|
@@ -2745,8 +2755,9 @@ let EzForm = class {
|
|
|
2745
2755
|
}
|
|
2746
2756
|
async getChanges() {
|
|
2747
2757
|
let allChanges = [];
|
|
2758
|
+
const dataUnits = Array.from(this._dataUnits.values());
|
|
2748
2759
|
for (let i = 0; i < this._dataUnits.size; i++) {
|
|
2749
|
-
const du =
|
|
2760
|
+
const du = dataUnits[i];
|
|
2750
2761
|
//Só devemos buscar as alterações de DU raiz, pois os sub DUs serão enviados junto.
|
|
2751
2762
|
if (!du.parentDU) {
|
|
2752
2763
|
const duChanges = du.getChangesToSave();
|
|
@@ -2764,15 +2775,15 @@ let EzForm = class {
|
|
|
2764
2775
|
}
|
|
2765
2776
|
}
|
|
2766
2777
|
validateRecords(dataUnit, records, triggedBy) {
|
|
2767
|
-
const result = { isValid: true, message:
|
|
2768
|
-
if (this.
|
|
2778
|
+
const result = { isValid: true, message: "" };
|
|
2779
|
+
if (this.ignoreSaveValidation && triggedBy === "SAVE") {
|
|
2769
2780
|
return result;
|
|
2770
2781
|
}
|
|
2771
2782
|
const validateField = (field) => {
|
|
2772
2783
|
if (field.readOnly) {
|
|
2773
2784
|
return false;
|
|
2774
2785
|
}
|
|
2775
|
-
if (field.userInterface ===
|
|
2786
|
+
if (field.userInterface === "SWITCH" || field.userInterface === "CHECKBOX") {
|
|
2776
2787
|
return false;
|
|
2777
2788
|
}
|
|
2778
2789
|
return true;
|
|
@@ -2783,7 +2794,7 @@ let EzForm = class {
|
|
|
2783
2794
|
const recordIndex = record["record__index"];
|
|
2784
2795
|
const fieldName = field.name;
|
|
2785
2796
|
const fieldValue = record[fieldName];
|
|
2786
|
-
if (fieldValue === null || fieldValue === undefined || fieldValue ===
|
|
2797
|
+
if (fieldValue === null || fieldValue === undefined || fieldValue === "") {
|
|
2787
2798
|
const tabPosition = this._tabPositionByField.get(dataUnit.name + field.name);
|
|
2788
2799
|
this._store.dispatch(invalidField$1(tabPosition.tabName, tabPosition.index, dataUnit.name, recordIndex, record.record__id, field.name, "Essa informação é obrigatória"));
|
|
2789
2800
|
result.isValid = false;
|
|
@@ -2810,7 +2821,7 @@ let EzForm = class {
|
|
|
2810
2821
|
return result;
|
|
2811
2822
|
}
|
|
2812
2823
|
loadMDFromExecutor(callBack) {
|
|
2813
|
-
const loadMetadataFunction = this.parseExecutor(this.
|
|
2824
|
+
const loadMetadataFunction = this.parseExecutor(this.metadataExecutor);
|
|
2814
2825
|
if (loadMetadataFunction) {
|
|
2815
2826
|
const result = loadMetadataFunction();
|
|
2816
2827
|
if (result) {
|
|
@@ -2890,7 +2901,7 @@ let EzForm = class {
|
|
|
2890
2901
|
});
|
|
2891
2902
|
this._store = createStore(rootReducer, applyMiddleware(thunk));
|
|
2892
2903
|
this._store.subscribe(() => { forceUpdate(this); });
|
|
2893
|
-
if (this.
|
|
2904
|
+
if (this.slaveMode) {
|
|
2894
2905
|
this._store.dispatch(showHideNavigationButtons("saveVisible", false));
|
|
2895
2906
|
this._store.dispatch(showHideNavigationButtons("cancelVisible", false));
|
|
2896
2907
|
this._store.dispatch(showHideNavigationButtons("reloadVisible", false));
|
|
@@ -2913,12 +2924,12 @@ let EzForm = class {
|
|
|
2913
2924
|
this._duToLoad = [];
|
|
2914
2925
|
}
|
|
2915
2926
|
loadSearch(argument, context) {
|
|
2916
|
-
const fieldSearchExecutor = this.parseExecutor(this.
|
|
2927
|
+
const fieldSearchExecutor = this.parseExecutor(this.fieldSearchExecutor);
|
|
2917
2928
|
if (fieldSearchExecutor) {
|
|
2918
2929
|
return fieldSearchExecutor(argument, context);
|
|
2919
2930
|
}
|
|
2920
2931
|
else {
|
|
2921
|
-
return [{ value: 0, label:
|
|
2932
|
+
return [{ value: 0, label: "Sem resultados" }];
|
|
2922
2933
|
}
|
|
2923
2934
|
}
|
|
2924
2935
|
buildDataUnit(dataUnit, parentDataUnit) {
|
|
@@ -2945,9 +2956,9 @@ let EzForm = class {
|
|
|
2945
2956
|
}
|
|
2946
2957
|
decorateDU(dataUnit) {
|
|
2947
2958
|
dataUnit.store = this._store;
|
|
2948
|
-
dataUnit.loadExecutor = this.parseExecutor(this.
|
|
2949
|
-
dataUnit.saveExecutor = this.parseExecutor(this.
|
|
2950
|
-
dataUnit.removeExecutor = this.parseExecutor(this.
|
|
2959
|
+
dataUnit.loadExecutor = this.parseExecutor(this.loadExecutor);
|
|
2960
|
+
dataUnit.saveExecutor = this.parseExecutor(this.saveExecutor);
|
|
2961
|
+
dataUnit.removeExecutor = this.parseExecutor(this.removeExecutor);
|
|
2951
2962
|
dataUnit.recordsValidator = this;
|
|
2952
2963
|
}
|
|
2953
2964
|
render() {
|
|
@@ -2989,7 +3000,7 @@ let EzIcon = class {
|
|
|
2989
3000
|
};
|
|
2990
3001
|
EzIcon.style = ezIconCss;
|
|
2991
3002
|
|
|
2992
|
-
const ezNumericInputCss = ":host{display:block;width:100%;--
|
|
3003
|
+
const ezNumericInputCss = ":host{display:block;width:100%;--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color)}.text-input{--ez-text-input__input--background-color:inherit;--ez-text-input__input--border-color:inherit}";
|
|
2993
3004
|
|
|
2994
3005
|
let EzNumericInput = class {
|
|
2995
3006
|
constructor(hostRef) {
|
|
@@ -3058,11 +3069,11 @@ let EzSearch = class {
|
|
|
3058
3069
|
/**
|
|
3059
3070
|
* Ajusta a opção de mostrar o "value" ao selecionar uma opção.
|
|
3060
3071
|
*/
|
|
3061
|
-
this.
|
|
3072
|
+
this.showSelectedValue = true;
|
|
3062
3073
|
/**
|
|
3063
3074
|
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
3064
3075
|
*/
|
|
3065
|
-
this.
|
|
3076
|
+
this.showOptionValue = true;
|
|
3066
3077
|
}
|
|
3067
3078
|
updateValue() {
|
|
3068
3079
|
if (this._comboElement) {
|
|
@@ -3075,7 +3086,7 @@ let EzSearch = class {
|
|
|
3075
3086
|
this.ezChange.emit(evt.detail);
|
|
3076
3087
|
}
|
|
3077
3088
|
render() {
|
|
3078
|
-
return (h("ez-combo-box", { ref: elem => this._comboElement = elem, value: this.value, label: this.label, enabled: this.enabled, errorMessage: this.errorMessage, optionLoader: this.
|
|
3089
|
+
return (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 }));
|
|
3079
3090
|
}
|
|
3080
3091
|
;
|
|
3081
3092
|
static get watchers() { return {
|
|
@@ -3285,7 +3296,7 @@ class Tab {
|
|
|
3285
3296
|
}
|
|
3286
3297
|
EzTabselector.style = ezTabselectorCss;
|
|
3287
3298
|
|
|
3288
|
-
const ezTextAreaCss = ":host{--
|
|
3299
|
+
const ezTextAreaCss = ":host{--text-area--width:100%;--text-area--border-radius:var(--border--radius-medium, 12px);--text-area--font-size:var(--text--medium, 14px);--text-area--font-family:var(--font-pattern, Arial);--text-area--font-weight:var(--text-weight--large, 500);--text-area--color:var(--title--primary, #000);--text-area__input--background-color:var(--background--medium, #e0e0e0);--text-area__input--border:var(--border--medium, 2px solid);--text-area__input--border-color:var(--text-area__input--background-color);--text-area__input--focus--border-color:var(--color--primary, #008561);--text-area__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--text-area__input--disabled--color:var(--text--disable, #AFB6C0);--text-area__input--error--border-color:#CC2936;--text-area__message_box--font-size:var(--text--small, 12px);--text-area__message_box--info--color:var(--color--success, #22085d);--text-area__message_box--error--color:var(--color--error, #FF0000);--text-area__label--floating--top:6px;--text-area__label--padding-top:12px;--text-area__label--padding-left:14px;--text-area__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--text-area--width)}textarea{box-sizing:border-box;border:none;resize:none;margin-top:calc(var(--space--medium, 12px) + 4px);width:100%;font-weight:var(--text-weight--large, 600);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);color:var(--text-area--color);padding:0;background:none}textarea:focus{outline:none}textarea:disabled{background-color:transparent;color:var(--text-area__input--disabled--color)}.textarea{width:100%;box-sizing:border-box;padding-left:var(--space--medium);padding-right:var(--space--extra-small);border-radius:var(--text-area--border-radius);border:var(--text-area__input--border);border-color:var(--text-area__input--border-color);background-color:var(--text-area__input--background-color)}.textarea--focus{border-color:var(--text-area__input--focus--border-color)}.textarea.hasError{color:var(--text-area--color);border-color:var(--text-area__input--error--border-color)}.message-box{min-height:16px;min-width:100%;margin-top:2px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--text-area--font-family);font-size:var(--text-area__message_box--font-size);color:var(--text-area__message_box--info--color)}.hasError{color:var(--text-area__message_box--error--color)}.textarea__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--text-area__label--padding-right));left:var(--text-area--space--medium);font-family:var(--text-area--font-family);font-size:var(--text-area--font-size);font-weight:var(--text-area--font-weight);color:var(--text-area--color);top:var(--text-area__label--padding-top);left:var(--text-area__label--padding-left);padding-right:var(--text-area__label--padding-right)}.textarea__label--floated{font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--text-area__label--floating--top)}.textarea__label--disabled{color:var(--text-area__input--disabled--color)}";
|
|
3289
3300
|
|
|
3290
3301
|
let EzTextArea = class {
|
|
3291
3302
|
constructor(hostRef) {
|
|
@@ -3391,7 +3402,7 @@ let EzTextArea = class {
|
|
|
3391
3402
|
};
|
|
3392
3403
|
EzTextArea.style = ezTextAreaCss;
|
|
3393
3404
|
|
|
3394
|
-
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}";
|
|
3405
|
+
const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--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--large, 500);--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--alert-cold-800, #042EFF);--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.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(--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}";
|
|
3395
3406
|
|
|
3396
3407
|
let EzTextInput = class {
|
|
3397
3408
|
constructor(hostRef) {
|
|
@@ -3403,14 +3414,14 @@ let EzTextInput = class {
|
|
|
3403
3414
|
this.enabled = true;
|
|
3404
3415
|
}
|
|
3405
3416
|
showError() {
|
|
3406
|
-
const hasError = typeof this.errorMessage ===
|
|
3417
|
+
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
3407
3418
|
if (hasError) {
|
|
3408
|
-
this._inputElem.classList.add(
|
|
3409
|
-
this._messageBoxElem.classList.add(
|
|
3419
|
+
this._inputElem.classList.add("hasError");
|
|
3420
|
+
this._messageBoxElem.classList.add("hasError");
|
|
3410
3421
|
}
|
|
3411
3422
|
else {
|
|
3412
|
-
this._inputElem.classList.remove(
|
|
3413
|
-
this._messageBoxElem.classList.remove(
|
|
3423
|
+
this._inputElem.classList.remove("hasError");
|
|
3424
|
+
this._messageBoxElem.classList.remove("hasError");
|
|
3414
3425
|
}
|
|
3415
3426
|
}
|
|
3416
3427
|
prepareMask() {
|
|
@@ -3428,7 +3439,7 @@ let EzTextInput = class {
|
|
|
3428
3439
|
this._inputElem.value = this.value;
|
|
3429
3440
|
}
|
|
3430
3441
|
this.handleChange();
|
|
3431
|
-
this.ezChange.emit();
|
|
3442
|
+
this.ezChange.emit(this.value);
|
|
3432
3443
|
this.adjustFloatingLabel();
|
|
3433
3444
|
}
|
|
3434
3445
|
adjustFloatingLabel() {
|
|
@@ -3513,22 +3524,22 @@ let EzTextInput = class {
|
|
|
3513
3524
|
content.style.justifyContent = "center";
|
|
3514
3525
|
content.style.overflow = "hidden";
|
|
3515
3526
|
content.style.top = "0px";
|
|
3516
|
-
content.style.width = "var(--text-input__icon--width)";
|
|
3517
|
-
content.style.height = "var(--text-input--height)";
|
|
3527
|
+
content.style.width = "var(--ez-text-input__icon--width)";
|
|
3528
|
+
content.style.height = "var(--ez-text-input--height)";
|
|
3518
3529
|
if (slot.name == "leftIcon") {
|
|
3519
3530
|
content.style.left = "0px";
|
|
3520
|
-
content.style.borderRadius = "var(--text-input--border-radius) 0 0 var(--text-input--border-radius)";
|
|
3521
|
-
this._inputElem.classList.add(
|
|
3531
|
+
content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
|
|
3532
|
+
this._inputElem.classList.add("icon--left");
|
|
3522
3533
|
if (this._labelElem) {
|
|
3523
|
-
this._labelElem.classList.add(
|
|
3534
|
+
this._labelElem.classList.add("input__label--left");
|
|
3524
3535
|
}
|
|
3525
3536
|
}
|
|
3526
3537
|
else if (slot.name == "rightIcon") {
|
|
3527
3538
|
content.style.right = "0px";
|
|
3528
|
-
content.style.borderRadius = "0 var(--text-input--border-radius) var(--text-input--border-radius) 0";
|
|
3529
|
-
this._inputElem.classList.add(
|
|
3539
|
+
content.style.borderRadius = "0 var(--ez-text-input--border-radius) var(--ez-text-input--border-radius) 0";
|
|
3540
|
+
this._inputElem.classList.add("icon--right");
|
|
3530
3541
|
if (this._labelElem) {
|
|
3531
|
-
this._labelElem.classList.add(
|
|
3542
|
+
this._labelElem.classList.add("input__label--right");
|
|
3532
3543
|
}
|
|
3533
3544
|
}
|
|
3534
3545
|
}
|
|
@@ -3668,7 +3679,7 @@ class RemoteFile {
|
|
|
3668
3679
|
}
|
|
3669
3680
|
}
|
|
3670
3681
|
|
|
3671
|
-
const ezUploadCss = ":host{--
|
|
3682
|
+
const ezUploadCss = ":host{--ez-upload--height:42px;--ez-upload--width:100%;--ez-upload__icon--width:48px;--ez-upload__container--background-color:var(--background--medium, #d2dce9);--ez-upload__color--primary:var(--color--primary, #008561);--ez-upload--padding--extra-small:var(--space--extra-small, 3px);--ez-upload--padding--small:var(--space--small, 6px);--ez-upload--padding--medium:var(--space--medium, 12px);--ez-upload--padding--large:var(--space--large, 24px);--ez-upload__border--color:var(--color-strokes, #DCE0E8);--ez-upload--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--ez-upload--text--primary:var(--text-primary, #626e82);--ez-upload--font-size:var(--text--medium, 14px);--ez-upload--font-family:var(--font-pattern, Arial);--ez-upload--font-weight:var(--text-weight--large, 500);--ez-upload__btn__cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--ez-upload__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;font-family:var(--ez-upload--font-family);font-size:var(--ez-upload--font-size);width:var(--ez-upload--width);font-weight:var(--ez-upload--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:var(--ez-upload--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--ez-upload--padding--medium) var(--ez-upload--padding--medium) var(--ez-upload--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--ez-upload--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--ez-upload__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--ez-upload__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--ez-upload__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--ez-upload__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--ez-upload__btn__cancel-image);mask-image:var(--ez-upload__btn__cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-upload--font-family);font-size:var(--text--extra-small);font-weight:var(--ez-upload--font-weight);color:var(--ez-upload--text--primary);text-shadow:var(--ez-upload--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--ez-upload__file-icon-image);mask-image:var(--ez-upload__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--ez-upload--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:unset}.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%}}";
|
|
3672
3683
|
|
|
3673
3684
|
let EzUpload = class {
|
|
3674
3685
|
constructor(hostRef) {
|
|
@@ -3699,28 +3710,31 @@ let EzUpload = class {
|
|
|
3699
3710
|
}
|
|
3700
3711
|
normalizeRequestHeaders() {
|
|
3701
3712
|
this._requestHeaders = new Map();
|
|
3702
|
-
if (typeof this.
|
|
3713
|
+
if (typeof this.requestHeaders == "string") {
|
|
3703
3714
|
try {
|
|
3704
|
-
this.
|
|
3715
|
+
this.requestHeaders = JSON.parse(this.requestHeaders);
|
|
3705
3716
|
}
|
|
3706
3717
|
catch (e) {
|
|
3707
|
-
this.
|
|
3718
|
+
this.requestHeaders = undefined;
|
|
3708
3719
|
}
|
|
3709
3720
|
}
|
|
3710
|
-
for (var key in this.
|
|
3711
|
-
this._requestHeaders.set(key, this.
|
|
3721
|
+
for (var key in this.requestHeaders) {
|
|
3722
|
+
this._requestHeaders.set(key, this.requestHeaders[key]);
|
|
3712
3723
|
}
|
|
3713
3724
|
}
|
|
3725
|
+
/**
|
|
3726
|
+
* Método responsável por adicionar um ou mais arquivos ao componente.
|
|
3727
|
+
*/
|
|
3714
3728
|
async addFiles(files) {
|
|
3715
|
-
if (this.
|
|
3729
|
+
if (this.maxFiles > 0) {
|
|
3716
3730
|
let countDistinctFiles = this._filePointers.size;
|
|
3717
3731
|
files.forEach(file => {
|
|
3718
3732
|
if (!this._filePointers.has(file.name)) {
|
|
3719
3733
|
countDistinctFiles++;
|
|
3720
3734
|
}
|
|
3721
3735
|
});
|
|
3722
|
-
if (countDistinctFiles > this.
|
|
3723
|
-
this.showError(`A quantidade máxima de arquivos é ${this.
|
|
3736
|
+
if (countDistinctFiles > this.maxFiles) {
|
|
3737
|
+
this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`);
|
|
3724
3738
|
return;
|
|
3725
3739
|
}
|
|
3726
3740
|
}
|
|
@@ -3747,7 +3761,7 @@ let EzUpload = class {
|
|
|
3747
3761
|
if (this.validateFile(file)) {
|
|
3748
3762
|
const uploadingFile = new RemoteFile(file);
|
|
3749
3763
|
this._filePointers.set(file.name, uploadingFile);
|
|
3750
|
-
uploadingFile.upload(this.
|
|
3764
|
+
uploadingFile.upload(this.urlUpload, this._requestHeaders, (file) => this.updateFeedback(file))
|
|
3751
3765
|
.then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
|
|
3752
3766
|
.catch(msg => this.showError(msg));
|
|
3753
3767
|
forceUpdate(this);
|
|
@@ -3768,13 +3782,13 @@ let EzUpload = class {
|
|
|
3768
3782
|
this.ezChange.emit(this.value);
|
|
3769
3783
|
}
|
|
3770
3784
|
buildProgressId(uploading) {
|
|
3771
|
-
let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi,
|
|
3785
|
+
let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, "_");
|
|
3772
3786
|
return `PROGRESS_${sanitizedName}_${uploading.file.lastModified}`;
|
|
3773
3787
|
}
|
|
3774
3788
|
updateFeedback(uf) {
|
|
3775
3789
|
window.requestAnimationFrame(() => {
|
|
3776
3790
|
if (this._host) {
|
|
3777
|
-
const progress = this._host.shadowRoot.querySelector(
|
|
3791
|
+
const progress = this._host.shadowRoot.querySelector("#" + this.buildProgressId(uf));
|
|
3778
3792
|
if (progress) {
|
|
3779
3793
|
progress.value = uf.progress;
|
|
3780
3794
|
}
|
|
@@ -3782,20 +3796,20 @@ let EzUpload = class {
|
|
|
3782
3796
|
});
|
|
3783
3797
|
}
|
|
3784
3798
|
validateFile(file) {
|
|
3785
|
-
if (!this._filePointers.has(file.name) && this.
|
|
3786
|
-
this.showError(`A quantidade máxima de arquivos é ${this.
|
|
3799
|
+
if (!this._filePointers.has(file.name) && this.maxFiles > 0 && this._filePointers.size >= this.maxFiles) {
|
|
3800
|
+
this.showError(`A quantidade máxima de arquivos é ${this.maxFiles}.`);
|
|
3787
3801
|
return false;
|
|
3788
3802
|
}
|
|
3789
3803
|
if (file.size === 0) {
|
|
3790
3804
|
this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
|
|
3791
3805
|
return false;
|
|
3792
3806
|
}
|
|
3793
|
-
if (!this.
|
|
3807
|
+
if (!this.urlUpload) {
|
|
3794
3808
|
this.showError("Endereço de upload não informado");
|
|
3795
3809
|
return false;
|
|
3796
3810
|
}
|
|
3797
|
-
if (this.
|
|
3798
|
-
this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.
|
|
3811
|
+
if (this.maxFileSize >= 0 && file.size > this.maxFileSize) {
|
|
3812
|
+
this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxFileSize));
|
|
3799
3813
|
return false;
|
|
3800
3814
|
}
|
|
3801
3815
|
return true;
|
|
@@ -3805,17 +3819,17 @@ let EzUpload = class {
|
|
|
3805
3819
|
}
|
|
3806
3820
|
formatBytes(bytes, decimals = 1) {
|
|
3807
3821
|
if (bytes === 0)
|
|
3808
|
-
return
|
|
3822
|
+
return "0 Bytes";
|
|
3809
3823
|
const k = 1024;
|
|
3810
3824
|
const dm = decimals < 0 ? 0 : decimals;
|
|
3811
|
-
const sizes = [
|
|
3825
|
+
const sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
3812
3826
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
3813
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) +
|
|
3827
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
3814
3828
|
}
|
|
3815
3829
|
onFileInputChange(event) {
|
|
3816
3830
|
const input = event.target;
|
|
3817
3831
|
this.addFiles(Array.from(input.files));
|
|
3818
|
-
this._fileInput.value =
|
|
3832
|
+
this._fileInput.value = "";
|
|
3819
3833
|
}
|
|
3820
3834
|
isRemoteFile(item) {
|
|
3821
3835
|
return "file" in item;
|
|
@@ -3831,10 +3845,10 @@ let EzUpload = class {
|
|
|
3831
3845
|
this.removeFromList(name);
|
|
3832
3846
|
}
|
|
3833
3847
|
else {
|
|
3834
|
-
if (this.
|
|
3848
|
+
if (this.urlDelete) {
|
|
3835
3849
|
const uploadingFile = new RemoteFile(null);
|
|
3836
3850
|
this._filePointers.set(item.name, uploadingFile);
|
|
3837
|
-
uploadingFile.delete(item, this.
|
|
3851
|
+
uploadingFile.delete(item, this.urlDelete, null)
|
|
3838
3852
|
.then(_ok => this.removeFromList(name))
|
|
3839
3853
|
.catch(msg => this.showError(msg));
|
|
3840
3854
|
}
|
|
@@ -3850,20 +3864,20 @@ let EzUpload = class {
|
|
|
3850
3864
|
}
|
|
3851
3865
|
componentDidLoad() {
|
|
3852
3866
|
if (this.enabled && this._dropZone && window.FileList && window.File) {
|
|
3853
|
-
this._dropZone.addEventListener(
|
|
3867
|
+
this._dropZone.addEventListener("dragover", event => {
|
|
3854
3868
|
event.stopPropagation();
|
|
3855
3869
|
event.preventDefault();
|
|
3856
|
-
event.dataTransfer.dropEffect =
|
|
3857
|
-
this._dropZone.style.background =
|
|
3870
|
+
event.dataTransfer.dropEffect = "copy";
|
|
3871
|
+
this._dropZone.style.background = "#c2dbff";
|
|
3858
3872
|
});
|
|
3859
|
-
this._dropZone.addEventListener(
|
|
3873
|
+
this._dropZone.addEventListener("drop", event => {
|
|
3860
3874
|
event.stopPropagation();
|
|
3861
3875
|
event.preventDefault();
|
|
3862
3876
|
this.addFiles(Array.from(event.dataTransfer.files));
|
|
3863
|
-
this._dropZone.style.background =
|
|
3877
|
+
this._dropZone.style.background = "";
|
|
3864
3878
|
});
|
|
3865
|
-
this._dropZone.addEventListener(
|
|
3866
|
-
this._dropZone.style.background =
|
|
3879
|
+
this._dropZone.addEventListener("dragleave", _event => {
|
|
3880
|
+
this._dropZone.style.background = "";
|
|
3867
3881
|
});
|
|
3868
3882
|
}
|
|
3869
3883
|
}
|
|
@@ -3875,7 +3889,7 @@ let EzUpload = class {
|
|
|
3875
3889
|
}
|
|
3876
3890
|
}
|
|
3877
3891
|
render() {
|
|
3878
|
-
return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass(
|
|
3892
|
+
return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass("iu", "background--disabled") }, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu_header" }, this.label ? h("label", { class: this.evalDisabledClass("iu__label", "text--disabled"), title: this.label }, this.label) : null, h("div", { class: this.evalDisabledClass("iu__icon-label", "mouse-pointer--disabled") }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), h("div", { class: this.evalDisabledClass("text text--center text--medium text--primary", "text--disabled") }, this.enabled ? "Arraste e solte ou clique para adicionar arquivos" : "Somente leitura"))), this.buildFooter()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
|
|
3879
3893
|
}
|
|
3880
3894
|
buildFooter() {
|
|
3881
3895
|
if (this._filePointers.size === 0) {
|
|
@@ -3887,8 +3901,8 @@ let EzUpload = class {
|
|
|
3887
3901
|
}
|
|
3888
3902
|
buildFileItem(item) {
|
|
3889
3903
|
const fileName = item.name;
|
|
3890
|
-
const progress = Number(item[
|
|
3891
|
-
const downloadURL = item[
|
|
3904
|
+
const progress = Number(item["progress"]);
|
|
3905
|
+
const downloadURL = item["downloadURL"];
|
|
3892
3906
|
const label = `${fileName} (${this.formatBytes(item.size)})`;
|
|
3893
3907
|
return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, h("div", { class: "iu__item-label modificador" }, h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
|
|
3894
3908
|
?
|
|
@@ -3906,7 +3920,7 @@ let EzUpload = class {
|
|
|
3906
3920
|
get _host() { return getElement(this); }
|
|
3907
3921
|
static get watchers() { return {
|
|
3908
3922
|
"value": ["changeValue"],
|
|
3909
|
-
"
|
|
3923
|
+
"requestHeaders": ["normalizeRequestHeaders"]
|
|
3910
3924
|
}; }
|
|
3911
3925
|
};
|
|
3912
3926
|
EzUpload.style = ezUploadCss;
|
|
@@ -3925,7 +3939,7 @@ let FormMetadata = class {
|
|
|
3925
3939
|
label = "Selecione uma das opções:";
|
|
3926
3940
|
}
|
|
3927
3941
|
const objOpts = {};
|
|
3928
|
-
Array.from(element.getElementsByTagName(
|
|
3942
|
+
Array.from(element.getElementsByTagName("OPTION")).forEach((optElem, index) => {
|
|
3929
3943
|
const optValue = optElem.getAttribute("value") || index;
|
|
3930
3944
|
const optLabel = optElem.textContent;
|
|
3931
3945
|
objOpts[optValue] = optLabel;
|
|
@@ -3933,15 +3947,15 @@ let FormMetadata = class {
|
|
|
3933
3947
|
properties.push({ name: "options", value: JSON.stringify(objOpts) });
|
|
3934
3948
|
}
|
|
3935
3949
|
else if (userInterface === "FILE") {
|
|
3936
|
-
const urlElement = element.querySelector(
|
|
3937
|
-
const headersElement = element.querySelectorAll(
|
|
3950
|
+
const urlElement = element.querySelector("URL");
|
|
3951
|
+
const headersElement = element.querySelectorAll("HEADERS>HEADER");
|
|
3938
3952
|
if (urlElement) {
|
|
3939
3953
|
properties.push({ name: "URL", value: urlElement.textContent });
|
|
3940
3954
|
}
|
|
3941
3955
|
if (headersElement && headersElement.length > 0) {
|
|
3942
3956
|
const headers = {};
|
|
3943
3957
|
headersElement.forEach(header => {
|
|
3944
|
-
headers[header.getAttribute(
|
|
3958
|
+
headers[header.getAttribute("name")] = header.textContent;
|
|
3945
3959
|
});
|
|
3946
3960
|
properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
|
|
3947
3961
|
}
|
|
@@ -3967,7 +3981,7 @@ let FormMetadata = class {
|
|
|
3967
3981
|
}
|
|
3968
3982
|
buildFieldSet(dataUnit, element) {
|
|
3969
3983
|
const label = element.getAttribute("label");
|
|
3970
|
-
const fields = Array.from(element.getElementsByTagName(
|
|
3984
|
+
const fields = Array.from(element.getElementsByTagName("FIELD")).map(f => {
|
|
3971
3985
|
const field = this.buildField(f);
|
|
3972
3986
|
dataUnit.addFieldMetadata(field);
|
|
3973
3987
|
return { name: field.name };
|
|
@@ -3984,7 +3998,7 @@ let FormMetadata = class {
|
|
|
3984
3998
|
Array.from(elements).forEach(child => {
|
|
3985
3999
|
const tagName = child.tagName.toUpperCase();
|
|
3986
4000
|
switch (tagName) {
|
|
3987
|
-
case
|
|
4001
|
+
case "FIELD":
|
|
3988
4002
|
if (!form.items) {
|
|
3989
4003
|
form.items = [];
|
|
3990
4004
|
}
|
|
@@ -3992,13 +4006,13 @@ let FormMetadata = class {
|
|
|
3992
4006
|
dataUnit.addFieldMetadata(f);
|
|
3993
4007
|
form.items.push({ name: f.name });
|
|
3994
4008
|
break;
|
|
3995
|
-
case
|
|
4009
|
+
case "FIELD-SET":
|
|
3996
4010
|
if (!form.items) {
|
|
3997
4011
|
form.items = [];
|
|
3998
4012
|
}
|
|
3999
4013
|
form.items.push(this.buildFieldSet(dataUnit, child));
|
|
4000
4014
|
break;
|
|
4001
|
-
case
|
|
4015
|
+
case "SUB-FORM":
|
|
4002
4016
|
if (!form.subForms) {
|
|
4003
4017
|
form.subForms = [];
|
|
4004
4018
|
}
|
|
@@ -4007,7 +4021,7 @@ let FormMetadata = class {
|
|
|
4007
4021
|
const subDuName = child.getAttribute("dataunit");
|
|
4008
4022
|
let subDu;
|
|
4009
4023
|
if (subDuName) {
|
|
4010
|
-
subDu = new DataUnit(subDuName,
|
|
4024
|
+
subDu = new DataUnit(subDuName, "noname", child.hasAttribute("many") ? "N" : "1");
|
|
4011
4025
|
}
|
|
4012
4026
|
else {
|
|
4013
4027
|
subDu = dataUnit;
|
|
@@ -4022,7 +4036,7 @@ let FormMetadata = class {
|
|
|
4022
4036
|
if (!this.dataunit) {
|
|
4023
4037
|
this.dataunit = "dataunit_" + (this.name || this.label || new Date().getTime());
|
|
4024
4038
|
}
|
|
4025
|
-
const du = new DataUnit(this.dataunit,
|
|
4039
|
+
const du = new DataUnit(this.dataunit, "noname", this.many ? "N" : "1");
|
|
4026
4040
|
this.metadata = this.fromElements(this._host.children, this.label, this.name, du, this.autoload);
|
|
4027
4041
|
}
|
|
4028
4042
|
render() {
|