@sankhyalabs/ezui 1.1.113 → 1.1.116
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-combo-box.cjs.entry.js +13 -4
- package/dist/cjs/ez-date-input.cjs.entry.js +6 -2
- package/dist/cjs/ez-date-time-input.cjs.entry.js +6 -2
- package/dist/cjs/ez-filter-input.cjs.entry.js +73 -0
- package/dist/cjs/ez-grid.cjs.entry.js +74 -12
- package/dist/cjs/ez-number-input.cjs.entry.js +5 -1
- package/dist/cjs/ez-search.cjs.entry.js +17 -13
- package/dist/cjs/ez-text-area.cjs.entry.js +28 -9
- package/dist/cjs/ez-text-input.cjs.entry.js +11 -6
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -2
- package/dist/cjs/ez-toast.cjs.entry.js +3 -2
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/test-du.cjs.entry.js +2 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +31 -4
- package/dist/collection/components/ez-date-input/ez-date-input.js +24 -2
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +24 -2
- package/dist/collection/components/ez-filter-input/ez-filter-input.css +4 -0
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +248 -0
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +14 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +60 -11
- package/dist/collection/components/ez-number-input/ez-number-input.js +23 -1
- package/dist/collection/components/ez-search/ez-search.js +35 -13
- package/dist/collection/components/ez-text-area/ez-text-area.css +71 -1
- package/dist/collection/components/ez-text-area/ez-text-area.js +67 -9
- package/dist/collection/components/ez-text-input/ez-text-input.css +78 -0
- package/dist/collection/components/ez-text-input/ez-text-input.js +29 -6
- package/dist/collection/components/ez-time-input/ez-time-input.js +25 -2
- package/dist/collection/components/ez-toast/ez-toast.css +1 -1
- package/dist/collection/components/ez-toast/ez-toast.js +2 -1
- package/dist/collection/components/test-du/test-du.js +2 -1
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +250 -63
- package/dist/esm/ez-combo-box.entry.js +13 -4
- package/dist/esm/ez-date-input.entry.js +6 -2
- package/dist/esm/ez-date-time-input.entry.js +6 -2
- package/dist/esm/ez-filter-input.entry.js +69 -0
- package/dist/esm/ez-grid.entry.js +74 -12
- package/dist/esm/ez-number-input.entry.js +5 -1
- package/dist/esm/ez-search.entry.js +17 -13
- package/dist/esm/ez-text-area.entry.js +28 -9
- package/dist/esm/ez-text-input.entry.js +11 -6
- package/dist/esm/ez-time-input.entry.js +7 -2
- package/dist/esm/ez-toast.entry.js +3 -2
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/test-du.entry.js +2 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-01169201.entry.js +1 -0
- package/dist/ezui/p-055f1b6a.entry.js +1 -0
- package/dist/ezui/p-2f14fe3d.entry.js +1 -0
- package/dist/ezui/{p-a038e7a5.entry.js → p-3cd17150.entry.js} +1 -1
- package/dist/ezui/p-43feac7d.entry.js +1 -0
- package/dist/ezui/p-6f39077b.entry.js +1 -0
- package/dist/ezui/p-7247379d.entry.js +1 -0
- package/dist/ezui/p-83d5f1ca.entry.js +1 -0
- package/dist/ezui/p-8c447785.entry.js +1 -0
- package/dist/ezui/p-8f2d46f8.entry.js +1 -0
- package/dist/ezui/p-d3d3e2ac.entry.js +1 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +4 -0
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +4 -0
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +4 -0
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +52 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +16 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +5 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +4 -0
- package/dist/types/components/ez-search/ez-search.d.ts +24 -20
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +11 -0
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +4 -0
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +4 -0
- package/dist/types/components/ez-toast/ez-toast.d.ts +1 -0
- package/dist/types/components.d.ts +153 -0
- package/package.json +6 -5
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-25e87823.entry.js +0 -1
- package/dist/ezui/p-3a8bf0a8.entry.js +0 -1
- package/dist/ezui/p-44d4f8d6.entry.js +0 -1
- package/dist/ezui/p-65893e25.entry.js +0 -1
- package/dist/ezui/p-9aecc079.entry.js +0 -1
- package/dist/ezui/p-9ea5b22e.entry.js +0 -1
- package/dist/ezui/p-bc2834fa.entry.js +0 -1
- package/dist/ezui/p-c27495d9.entry.js +0 -1
- package/dist/ezui/p-fb73f557.entry.js +0 -1
|
@@ -28,6 +28,10 @@ let EzComboBox = class {
|
|
|
28
28
|
* Permite exibir a mensagem de erro.
|
|
29
29
|
*/
|
|
30
30
|
this.canShowError = true;
|
|
31
|
+
/**
|
|
32
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
33
|
+
*/
|
|
34
|
+
this.mode = "regular";
|
|
31
35
|
}
|
|
32
36
|
internalUpdate() {
|
|
33
37
|
if (this._inputElement) {
|
|
@@ -87,7 +91,7 @@ let EzComboBox = class {
|
|
|
87
91
|
//FIXME: Provavelmente isso fará com que o popup abra em uma
|
|
88
92
|
//posição errada no futuro. Preferi fazer simples no começo,
|
|
89
93
|
//porque não quis onerar o text input com essa funcionalidade...
|
|
90
|
-
const top = (this.errorMessage || !this.canShowError) ? "0px" : "-
|
|
94
|
+
const top = (this.errorMessage || !this.canShowError || this.mode == "slim") ? "0px" : "-19px";
|
|
91
95
|
this._floatingID = FloatingManager.float(this._optionsList, this._listContainer, { autoClose: true, top });
|
|
92
96
|
window.requestAnimationFrame(() => {
|
|
93
97
|
this._optionsList.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
@@ -154,8 +158,13 @@ let EzComboBox = class {
|
|
|
154
158
|
this.updateVisibleOptions();
|
|
155
159
|
}
|
|
156
160
|
else {
|
|
157
|
-
|
|
158
|
-
|
|
161
|
+
if (Array.isArray(source)) {
|
|
162
|
+
this._source = source;
|
|
163
|
+
this.updateVisibleOptions();
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this.value = source;
|
|
167
|
+
}
|
|
159
168
|
}
|
|
160
169
|
}
|
|
161
170
|
loadOptions(mode, argument = "") {
|
|
@@ -259,7 +268,7 @@ let EzComboBox = class {
|
|
|
259
268
|
this.cancelPreselection();
|
|
260
269
|
}
|
|
261
270
|
render() {
|
|
262
|
-
return (h(Host, null, h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), canShowError: this.canShowError, errorMessage: this.errorMessage }, this.searchMode ?
|
|
271
|
+
return (h(Host, null, h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, this.searchMode ?
|
|
263
272
|
h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions("ADVANCED"); }, slot: "leftIcon" })
|
|
264
273
|
:
|
|
265
274
|
h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-options", slot: "rightIcon", onClick: () => this.showOptions() })), h("section", { class: "list-container", ref: elem => this._listContainer = elem }, h("div", { class: "options-list", ref: elem => this._optionsList = elem }, this._visibleOptions.map((opt, index) => this.buildItem(opt, index))))));
|
|
@@ -12,6 +12,10 @@ let EzDateInput = class {
|
|
|
12
12
|
* Deixa o campo disponível ou não para uso.
|
|
13
13
|
*/
|
|
14
14
|
this.enabled = true;
|
|
15
|
+
/**
|
|
16
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
17
|
+
*/
|
|
18
|
+
this.mode = "regular";
|
|
15
19
|
}
|
|
16
20
|
setLabel() {
|
|
17
21
|
this._textInput.label = this.label;
|
|
@@ -52,7 +56,7 @@ let EzDateInput = class {
|
|
|
52
56
|
//FIXME: Provavelmente isso fará com que o popup abra em uma
|
|
53
57
|
//posição errada no futuro. Preferi fazer simples no começo,
|
|
54
58
|
//porque não quis onerar o text input com essa funcionalidade...
|
|
55
|
-
const top = this._textInput.errorMessage ? 0 : -
|
|
59
|
+
const top = this._textInput.errorMessage || this.mode == "slim" ? 0 : -19;
|
|
56
60
|
this._calendar.fitVertical(top, this._elem.clientHeight);
|
|
57
61
|
}
|
|
58
62
|
hideCalendar() {
|
|
@@ -84,7 +88,7 @@ let EzDateInput = class {
|
|
|
84
88
|
return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
|
|
85
89
|
if (event.key === "H" || event.key === "h")
|
|
86
90
|
this.changeValue(new Date());
|
|
87
|
-
}, 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 })));
|
|
91
|
+
}, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode }, 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 })));
|
|
88
92
|
}
|
|
89
93
|
get _elem() { return getElement(this); }
|
|
90
94
|
static get watchers() { return {
|
|
@@ -16,6 +16,10 @@ let EzDateTimeInput = class {
|
|
|
16
16
|
* Exibe ou não os segundos no input
|
|
17
17
|
*/
|
|
18
18
|
this.showSeconds = false;
|
|
19
|
+
/**
|
|
20
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
21
|
+
*/
|
|
22
|
+
this.mode = "regular";
|
|
19
23
|
}
|
|
20
24
|
setLabel() {
|
|
21
25
|
this._textInput.label = this.label;
|
|
@@ -88,7 +92,7 @@ let EzDateTimeInput = class {
|
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
showCalendar() {
|
|
91
|
-
const top = this._textInput.errorMessage ? 0 : -
|
|
95
|
+
const top = this._textInput.errorMessage || this.mode == "slim" ? 0 : -19;
|
|
92
96
|
this._calendar.fitVertical(top, this._elem.clientHeight);
|
|
93
97
|
this._calendar.style.visibility = 'inherit';
|
|
94
98
|
}
|
|
@@ -127,7 +131,7 @@ let EzDateTimeInput = class {
|
|
|
127
131
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
128
132
|
}
|
|
129
133
|
render() {
|
|
130
|
-
return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, onFocus: () => this.onFocused(), onClick: () => this.onClicked() }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
|
|
134
|
+
return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onFocus: () => this.onFocused(), onClick: () => this.onClicked() }, h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
|
|
131
135
|
}
|
|
132
136
|
get _elem() { return getElement(this); }
|
|
133
137
|
static get watchers() { return {
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-6b8bfbeb.js';
|
|
2
|
+
import { C as CSSVarsUtils } from './CSSVarsUtils-667e0016.js';
|
|
3
|
+
|
|
4
|
+
const ezFilterInputCss = ":host{display:block;width:100%}";
|
|
5
|
+
|
|
6
|
+
let EzFilterInput = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.ezChange = createEvent(this, "ezChange", 7);
|
|
10
|
+
/**
|
|
11
|
+
* Deixa o campo disponível ou não para uso.
|
|
12
|
+
*/
|
|
13
|
+
this.enabled = true;
|
|
14
|
+
/**
|
|
15
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
16
|
+
*/
|
|
17
|
+
this.mode = "regular";
|
|
18
|
+
}
|
|
19
|
+
setLabel() {
|
|
20
|
+
if (this._textInput) {
|
|
21
|
+
this._textInput.label = this.label;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
setErrorMessage() {
|
|
25
|
+
if (this._textInput) {
|
|
26
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
applyValueToInput() {
|
|
30
|
+
if (this._textInput) {
|
|
31
|
+
this._textInput.value = this.value;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Realiza o foco no componente de input
|
|
36
|
+
*/
|
|
37
|
+
async setFocus() {
|
|
38
|
+
this._textInput.setFocus();
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Remove o foco no componente de input
|
|
42
|
+
*/
|
|
43
|
+
async setBlur() {
|
|
44
|
+
this._textInput.setBlur();
|
|
45
|
+
}
|
|
46
|
+
changeValue(evt) {
|
|
47
|
+
const newValue = evt.detail;
|
|
48
|
+
this.errorMessage = "";
|
|
49
|
+
if (newValue !== this.value) {
|
|
50
|
+
this.value = newValue;
|
|
51
|
+
this.ezChange.emit(this.value);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
componentDidLoad() {
|
|
55
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return (h("ez-text-input", { ref: elem => this._textInput = elem, label: this.label, onEzChange: evt => this.changeValue(evt), value: this.value, enabled: this.enabled, errorMessage: this.errorMessage, restrict: this.restrict, loading: this.loading, mode: this.mode }, h("ez-icon", { slot: "leftIcon", iconName: "search" })));
|
|
59
|
+
}
|
|
60
|
+
get _elem() { return getElement(this); }
|
|
61
|
+
static get watchers() { return {
|
|
62
|
+
"label": ["setLabel"],
|
|
63
|
+
"errorMessage": ["setErrorMessage"],
|
|
64
|
+
"value": ["applyValueToInput"]
|
|
65
|
+
}; }
|
|
66
|
+
};
|
|
67
|
+
EzFilterInput.style = ezFilterInputCss;
|
|
68
|
+
|
|
69
|
+
export { EzFilterInput as ez_filter_input };
|
|
@@ -110057,11 +110057,14 @@ class DataSource {
|
|
|
110057
110057
|
class AgGridController {
|
|
110058
110058
|
constructor(enterprise) {
|
|
110059
110059
|
this._menuItems = [];
|
|
110060
|
+
this._idAttribName = "__record__id__";
|
|
110060
110061
|
this._enterprise = enterprise;
|
|
110061
110062
|
}
|
|
110062
110063
|
getSort() {
|
|
110063
110064
|
const sortedColumns = [];
|
|
110064
|
-
this._gridOptions.
|
|
110065
|
+
this._gridOptions.columnApi.getColumnState()
|
|
110066
|
+
.sort((colA, colB) => colA.sortIndex - colB.sortIndex)
|
|
110067
|
+
.forEach(({ colId, sort }) => {
|
|
110065
110068
|
if (sort) {
|
|
110066
110069
|
const field = this._dataUnit.getField(colId);
|
|
110067
110070
|
const mode = sort === "asc" ? SortMode.ASC : SortMode.DESC;
|
|
@@ -110086,10 +110089,9 @@ class AgGridController {
|
|
|
110086
110089
|
this._gridOptions = {
|
|
110087
110090
|
localeText: gridTerms,
|
|
110088
110091
|
rowModelType: "serverSide",
|
|
110089
|
-
serverSideStoreType: "partial",
|
|
110090
110092
|
rowSelection: this._multipleSelection ? "multiple" : "single",
|
|
110091
110093
|
serverSideDatasource: new DataSource(this._dataUnit, this._serverURL),
|
|
110092
|
-
getRowNodeId: (params) => params.
|
|
110094
|
+
getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
|
|
110093
110095
|
getMainMenuItems: (params) => {
|
|
110094
110096
|
const column = params.column;
|
|
110095
110097
|
const items = [column.isPinned() ? "clearPinned" : "pinLeft", "separator"];
|
|
@@ -110099,14 +110101,9 @@ class AgGridController {
|
|
|
110099
110101
|
}));
|
|
110100
110102
|
return items;
|
|
110101
110103
|
},
|
|
110102
|
-
onViewportChanged: (
|
|
110103
|
-
if (this.
|
|
110104
|
-
|
|
110105
|
-
this._dataUnit.getSelection().forEach(id => {
|
|
110106
|
-
let node = evt.api.getRowNode(id);
|
|
110107
|
-
node.setSelected(true);
|
|
110108
|
-
});
|
|
110109
|
-
}
|
|
110104
|
+
onViewportChanged: () => {
|
|
110105
|
+
if (this._dataUnit) {
|
|
110106
|
+
this.selectRows(this._dataUnit.getSelection());
|
|
110110
110107
|
}
|
|
110111
110108
|
}
|
|
110112
110109
|
};
|
|
@@ -110147,6 +110144,58 @@ class AgGridController {
|
|
|
110147
110144
|
}
|
|
110148
110145
|
this._gridOptions.api.setRowData(data);
|
|
110149
110146
|
}
|
|
110147
|
+
addRows(rows) {
|
|
110148
|
+
if (this._grid === undefined) {
|
|
110149
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110150
|
+
}
|
|
110151
|
+
this._gridOptions.api.applyServerSideTransaction({ add: rows });
|
|
110152
|
+
}
|
|
110153
|
+
selectRows(rowIds) {
|
|
110154
|
+
if (this._grid === undefined) {
|
|
110155
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110156
|
+
}
|
|
110157
|
+
if (rowIds && rowIds.length > 0) {
|
|
110158
|
+
rowIds.forEach(rowId => {
|
|
110159
|
+
const row = this._gridOptions.api.getRowNode(rowId);
|
|
110160
|
+
if (row) {
|
|
110161
|
+
row.setSelected(true);
|
|
110162
|
+
}
|
|
110163
|
+
});
|
|
110164
|
+
}
|
|
110165
|
+
}
|
|
110166
|
+
removeRows(rowIds) {
|
|
110167
|
+
if (this._grid === undefined) {
|
|
110168
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110169
|
+
}
|
|
110170
|
+
this._gridOptions.api.applyServerSideTransaction({ remove: rowIds });
|
|
110171
|
+
}
|
|
110172
|
+
changeValues(changes, rowIds) {
|
|
110173
|
+
if (this._grid === undefined) {
|
|
110174
|
+
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
110175
|
+
}
|
|
110176
|
+
if (changes) {
|
|
110177
|
+
let rowNodes;
|
|
110178
|
+
if (rowIds) {
|
|
110179
|
+
rowNodes = [];
|
|
110180
|
+
rowIds.forEach(id => {
|
|
110181
|
+
const rowNode = this._gridOptions.api.getRowNode(id);
|
|
110182
|
+
if (rowNode) {
|
|
110183
|
+
rowNodes.push(rowNode);
|
|
110184
|
+
}
|
|
110185
|
+
});
|
|
110186
|
+
}
|
|
110187
|
+
else {
|
|
110188
|
+
rowNodes = this._gridOptions.api.getSelectedNodes();
|
|
110189
|
+
}
|
|
110190
|
+
rowNodes.forEach(r => {
|
|
110191
|
+
const data = r.data;
|
|
110192
|
+
Object.entries(changes).forEach(([field, value]) => {
|
|
110193
|
+
data[field] = value;
|
|
110194
|
+
});
|
|
110195
|
+
r.setData(data);
|
|
110196
|
+
});
|
|
110197
|
+
}
|
|
110198
|
+
}
|
|
110150
110199
|
refresh() {
|
|
110151
110200
|
if (this._grid === undefined) {
|
|
110152
110201
|
throw new Error("Erro interno: Grid ainda não inicializado.");
|
|
@@ -110354,12 +110403,25 @@ class DataUnitBridge {
|
|
|
110354
110403
|
this._gridController.setColumnsDef(this.buildColumnDefs(), true);
|
|
110355
110404
|
break;
|
|
110356
110405
|
case Action.RECORDS_REMOVED:
|
|
110357
|
-
|
|
110406
|
+
const { records } = action.payload;
|
|
110407
|
+
this._gridController.removeRows(records);
|
|
110408
|
+
break;
|
|
110358
110409
|
case Action.RECORDS_ADDED:
|
|
110359
110410
|
case Action.RECORDS_COPIED:
|
|
110411
|
+
this._gridController.addRows(action.payload);
|
|
110412
|
+
break;
|
|
110413
|
+
case Action.EDITION_CANCELED:
|
|
110360
110414
|
case Action.DATA_SAVED:
|
|
110361
110415
|
this._gridController.refresh();
|
|
110362
110416
|
break;
|
|
110417
|
+
case Action.SELECTION_CHANGED:
|
|
110418
|
+
const { selection } = action.payload;
|
|
110419
|
+
this._gridController.selectRows(selection);
|
|
110420
|
+
break;
|
|
110421
|
+
case Action.DATA_CHANGED:
|
|
110422
|
+
const changes = Object.assign({}, action.payload);
|
|
110423
|
+
delete changes.records;
|
|
110424
|
+
this._gridController.changeValues(changes, action.payload.records);
|
|
110363
110425
|
}
|
|
110364
110426
|
}
|
|
110365
110427
|
buildColumnDefs() {
|
|
@@ -12,6 +12,10 @@ let EzNumberInput = class {
|
|
|
12
12
|
* Deixa o campo disponível ou não para uso.
|
|
13
13
|
*/
|
|
14
14
|
this.enabled = true;
|
|
15
|
+
/**
|
|
16
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
17
|
+
*/
|
|
18
|
+
this.mode = "regular";
|
|
15
19
|
}
|
|
16
20
|
setLabel() {
|
|
17
21
|
this._textInput.label = this.label;
|
|
@@ -68,7 +72,7 @@ let EzNumberInput = class {
|
|
|
68
72
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
69
73
|
}
|
|
70
74
|
render() {
|
|
71
|
-
return (h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage }));
|
|
75
|
+
return (h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode }));
|
|
72
76
|
}
|
|
73
77
|
get _elem() { return getElement(this); }
|
|
74
78
|
static get watchers() { return {
|
|
@@ -9,21 +9,25 @@ let EzSearch = class {
|
|
|
9
9
|
this.ezChange = createEvent(this, "ezChange", 7);
|
|
10
10
|
this.showPopup = createEvent(this, "showPopup", 7);
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
* Deixa o campo disponível ou não.
|
|
13
|
+
*/
|
|
14
14
|
this.enabled = true;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
* Ajusta a opção de mostrar o "value" ao selecionar uma opção.
|
|
17
|
+
*/
|
|
18
18
|
this.showSelectedValue = true;
|
|
19
19
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
21
|
+
*/
|
|
22
22
|
this.showOptionValue = true;
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
* Remove a opção vazia da lista de opções
|
|
25
|
+
*/
|
|
26
26
|
this.suppressEmptyOption = false;
|
|
27
|
+
/**
|
|
28
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
29
|
+
*/
|
|
30
|
+
this.mode = "regular";
|
|
27
31
|
}
|
|
28
32
|
updateValue() {
|
|
29
33
|
if (this._comboElement) {
|
|
@@ -31,14 +35,14 @@ let EzSearch = class {
|
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
* Realiza o foco no componente de pesquisa
|
|
39
|
+
*/
|
|
36
40
|
async setFocus() {
|
|
37
41
|
this._comboElement.setFocus();
|
|
38
42
|
}
|
|
39
43
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
* Remove o foco no componente de pesquisa
|
|
45
|
+
*/
|
|
42
46
|
async setBlur() {
|
|
43
47
|
this._comboElement.setBlur();
|
|
44
48
|
}
|
|
@@ -51,7 +55,7 @@ let EzSearch = class {
|
|
|
51
55
|
CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
52
56
|
}
|
|
53
57
|
render() {
|
|
54
|
-
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, suppressEmptyOption: this.suppressEmptyOption }));
|
|
58
|
+
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, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode }));
|
|
55
59
|
}
|
|
56
60
|
;
|
|
57
61
|
get _elem() { return getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-6b8bfbeb.js';
|
|
2
2
|
|
|
3
|
-
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--
|
|
3
|
+
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--medium, 400);--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:3px;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)}.textarea--slim{margin-top:var(--space--small, 6px)}.textarea--slim::-webkit-input-placeholder{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)}.textarea--slim:-moz-placeholder{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)}.textarea--slim::-moz-placeholder{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)}.textarea--slim:-ms-input-placeholder{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)}.textarea--slim::placeholder{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)}.textarea--slim:disabled::-webkit-input-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled:-moz-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled::-moz-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled:-ms-input-placeholder{color:var(--text-area__input--disabled--color)}.textarea--slim:disabled::placeholder{color:var(--text-area__input--disabled--color)}";
|
|
4
4
|
|
|
5
5
|
let EzTextArea = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -11,19 +11,24 @@ let EzTextArea = class {
|
|
|
11
11
|
*/
|
|
12
12
|
this.enabled = true;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Permite exibir a mensagem de erro.
|
|
15
15
|
*/
|
|
16
|
-
this.
|
|
16
|
+
this.canShowError = true;
|
|
17
|
+
/**
|
|
18
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
19
|
+
*/
|
|
20
|
+
this.mode = "regular";
|
|
17
21
|
}
|
|
18
22
|
showError() {
|
|
23
|
+
var _a, _b;
|
|
19
24
|
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
20
25
|
if (hasError) {
|
|
21
26
|
this._container.classList.add('hasError');
|
|
22
|
-
this._messageBoxElem.classList.add('hasError');
|
|
27
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add('hasError');
|
|
23
28
|
}
|
|
24
29
|
else {
|
|
25
30
|
this._container.classList.remove('hasError');
|
|
26
|
-
this._messageBoxElem.classList.remove('hasError');
|
|
31
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove('hasError');
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
updateInputValue() {
|
|
@@ -32,8 +37,18 @@ let EzTextArea = class {
|
|
|
32
37
|
this.adjustFloatingLabel();
|
|
33
38
|
this.ezChange.emit(this.value);
|
|
34
39
|
}
|
|
40
|
+
adjustRowsForMode() {
|
|
41
|
+
if (this._initialRows == undefined) {
|
|
42
|
+
this._initialRows = this.rows > 0 ? this.rows : undefined;
|
|
43
|
+
}
|
|
44
|
+
this.rows = this._initialRows > 0 ? this._initialRows : this.mode != "slim" ? 4 : 2;
|
|
45
|
+
}
|
|
46
|
+
adjustRowsValue() {
|
|
47
|
+
this.rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
|
|
48
|
+
this._initialRows = this.rows;
|
|
49
|
+
}
|
|
35
50
|
adjustFloatingLabel() {
|
|
36
|
-
if (this.label) {
|
|
51
|
+
if (this.label && this._labelElem) {
|
|
37
52
|
const hasValue = this.value && this.value.toString().length > 0;
|
|
38
53
|
const containsFloatedClass = this._labelElem.classList.contains("textarea__label--floated");
|
|
39
54
|
if (hasValue || this.isFocused()) {
|
|
@@ -93,16 +108,20 @@ let EzTextArea = class {
|
|
|
93
108
|
componentDidLoad() {
|
|
94
109
|
this.showError();
|
|
95
110
|
this.adjustFloatingLabel();
|
|
111
|
+
this.adjustRowsForMode();
|
|
96
112
|
}
|
|
97
113
|
render() {
|
|
98
|
-
return (h(Host, null, h("div", { class: "textarea", ref: (el) => this._container = el }, this.label ?
|
|
114
|
+
return (h(Host, null, h("div", { class: "textarea", ref: (el) => this._container = el }, this.label && this.mode != "slim" ?
|
|
99
115
|
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "textarea__label" : "textarea__label textarea__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
100
|
-
: null, h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })),
|
|
116
|
+
: null, h("textarea", { onFocus: () => this.handleFocus(), ref: (el) => this._inputElem = el, value: this.value, disabled: !this.enabled, class: this.mode == "slim" ? "textarea--slim" : "", placeholder: this.mode == "slim" && this.label ? this.label : "", onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, onKeyDown: event => event.stopPropagation(), rows: this.rows })), this.canShowError && this.mode != "slim" &&
|
|
117
|
+
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
101
118
|
}
|
|
102
119
|
get _hostElement() { return getElement(this); }
|
|
103
120
|
static get watchers() { return {
|
|
104
121
|
"errorMessage": ["showError"],
|
|
105
|
-
"value": ["updateInputValue"]
|
|
122
|
+
"value": ["updateInputValue"],
|
|
123
|
+
"mode": ["adjustRowsForMode"],
|
|
124
|
+
"rows": ["adjustRowsValue"]
|
|
106
125
|
}; }
|
|
107
126
|
};
|
|
108
127
|
EzTextArea.style = ezTextAreaCss;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-6b8bfbeb.js';
|
|
2
2
|
import { MaskFormatter } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
|
-
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--medium, 400);--ez-text-input--color:var(--title--primary, #000);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input.text--right{text-align:right}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}";
|
|
4
|
+
const ezTextInputCss = ":host{--ez-text-input--height:42px;--ez-text-input--width:100%;--ez-text-input__icon--width:48px;--ez-text-input--height--slim:32px;--ez-text-input--border-radius:var(--border--radius-medium, 12px);--ez-text-input--font-size:var(--text--medium, 14px);--ez-text-input--font-family:var(--font-pattern, Arial);--ez-text-input--font-weight:var(--text-weight--medium, 400);--ez-text-input--color:var(--title--primary, #000);--ez-text-input__input--background-color:var(--background--medium, #e0e0e0);--ez-text-input__input--border:var(--border--medium, 2px solid);--ez-text-input__input--border-color:var(--ez-text-input__input--background-color);--ez-text-input__input--focus--border-color:var(--color--primary, #008561);--ez-text-input__input--disabled--background-color:var(--color--disable-secondary, #F2F5F8);--ez-text-input__input--disabled--color:var(--text--disable, #AFB6C0);--ez-text-input__input--error--border-color:#CC2936;--ez-text-input__message_box--font-size:var(--text--small, 12px);--ez-text-input__message_box--info--color:var(--color--success, #22085d);--ez-text-input__message_box--error--color:var(--color--error, #FF0000);--ez-text-input__label--floating--top:6px;--ez-text-input__label--padding-top:12px;--ez-text-input__label--padding-left:14px;--ez-text-input__label--padding-right:12px;display:flex;flex-wrap:wrap;position:relative;width:var(--ez-text-input--width)}input{width:100%;box-sizing:border-box;padding:var(--space--medium, 6px);font-weight:var(--text-weight--large, 600);height:var(--ez-text-input--height);border-radius:var(--ez-text-input--border-radius);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);border:var(--ez-text-input__input--border);border-color:var(--ez-text-input__input--border-color);background-color:var(--ez-text-input__input--background-color);color:var(--ez-text-input--color)}input:disabled{background-color:var(--ez-text-input__input--disabled--background-color);color:var(--ez-text-input__input--disabled--color)}input:focus{outline:none;border-color:var(--ez-text-input__input--focus--border-color)}input.icon--left{padding-left:var(--ez-text-input__icon--width)}input.icon--right{padding-right:var(--ez-text-input__icon--width)}input.hasError{color:var(--ez-text-input--color);border-color:var(--ez-text-input__input--error--border-color)}input:disabled.hasError{color:var(--ez-text-input__input--disabled--color)}input.text--right{text-align:right}.message-box{min-height:16px;min-width:100%;margin-top:3px;line-height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input__message_box--font-size);color:var(--ez-text-input__message_box--info--color)}.hasError{color:var(--ez-text-input__message_box--error--color)}.input__label{box-sizing:border-box;position:absolute;z-index:var(--visible);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:font-size .05s, top .05s;transition:font-size .05s, top .05s;width:calc(100% - var(--ez-text-input__label--padding-right));left:var(--ez-text-input--space--medium);font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color);top:var(--ez-text-input__label--padding-top);left:var(--ez-text-input__label--padding-left);padding-right:var(--ez-text-input__label--padding-right)}.input__label--floated{font-family:var(--ez-text-input--font-family);font-size:var(--text--extra-small);color:var(--text--primary);top:var(--ez-text-input__label--floating--top)}.input__label--disabled{color:var(--ez-text-input__input--disabled--color)}.input__label--left{text-align:left;left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--right{right:var(--ez-text-input__icon--width);width:calc(100% - var(--ez-text-input__icon--width))}.input__label--left.input__label--right{left:calc(var(--ez-text-input__icon--width) + 2px);width:calc(100% - var(--ez-text-input__icon--width) * 2)}.input--with--label{padding-bottom:0}.input--slim{padding-top:var(--space--small, 3px);padding-bottom:var(--space--small, 3px);height:var(--ez-text-input--height--slim)}.input--slim::-webkit-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::-moz-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:-ms-input-placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim::placeholder{font-family:var(--ez-text-input--font-family);font-size:var(--ez-text-input--font-size);font-weight:var(--ez-text-input--font-weight);color:var(--ez-text-input--color)}.input--slim:disabled::-webkit-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::-moz-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled:-ms-input-placeholder{color:var(--ez-text-input__input--disabled--color)}.input--slim:disabled::placeholder{color:var(--ez-text-input__input--disabled--color)}";
|
|
5
5
|
|
|
6
6
|
let EzTextInput = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -15,16 +15,21 @@ let EzTextInput = class {
|
|
|
15
15
|
* Permite exibir a mensagem de erro.
|
|
16
16
|
*/
|
|
17
17
|
this.canShowError = true;
|
|
18
|
+
/**
|
|
19
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
20
|
+
*/
|
|
21
|
+
this.mode = "regular";
|
|
18
22
|
}
|
|
19
23
|
showError() {
|
|
24
|
+
var _a, _b;
|
|
20
25
|
const hasError = typeof this.errorMessage === "string" && this.errorMessage !== "";
|
|
21
26
|
if (hasError) {
|
|
22
27
|
this._inputElem.classList.add("hasError");
|
|
23
|
-
this._messageBoxElem.classList.add("hasError");
|
|
28
|
+
(_a = this._messageBoxElem) === null || _a === void 0 ? void 0 : _a.classList.add("hasError");
|
|
24
29
|
}
|
|
25
30
|
else {
|
|
26
31
|
this._inputElem.classList.remove("hasError");
|
|
27
|
-
this._messageBoxElem.classList.remove("hasError");
|
|
32
|
+
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove("hasError");
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
prepareMask() {
|
|
@@ -129,7 +134,7 @@ let EzTextInput = class {
|
|
|
129
134
|
content.style.overflow = "hidden";
|
|
130
135
|
content.style.top = "0px";
|
|
131
136
|
content.style.width = "var(--ez-text-input__icon--width)";
|
|
132
|
-
content.style.height = "var(--ez-text-input--height)";
|
|
137
|
+
content.style.height = this.mode != "slim" ? "var(--ez-text-input--height)" : "var(--ez-text-input--height--slim)";
|
|
133
138
|
if (slot.name == "leftIcon") {
|
|
134
139
|
content.style.left = "0px";
|
|
135
140
|
content.style.borderRadius = "var(--ez-text-input--border-radius) 0 0 var(--ez-text-input--border-radius)";
|
|
@@ -180,9 +185,9 @@ let EzTextInput = class {
|
|
|
180
185
|
}
|
|
181
186
|
}
|
|
182
187
|
render() {
|
|
183
|
-
return (h(Host, null, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label ?
|
|
188
|
+
return (h(Host, null, h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.label && this.mode != "slim" ?
|
|
184
189
|
h("label", { ref: (el) => this._labelElem = el, class: this.enabled ? "input__label" : "input__label input__label--disabled", onClick: () => this._inputElem.focus(), title: this.label }, this.label)
|
|
185
|
-
: null, h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError &&
|
|
190
|
+
: null, h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", class: this.mode == "slim" ? "input--slim" : "", placeholder: this.mode == "slim" && this.label ? this.label : "", value: this.value, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }), this.canShowError && this.mode != "slim" &&
|
|
186
191
|
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el, title: this.errorMessage }, this.errorMessage)));
|
|
187
192
|
}
|
|
188
193
|
get _hostElement() { return getElement(this); }
|
|
@@ -16,6 +16,10 @@ let EzTimeInput = class {
|
|
|
16
16
|
* Define se o componente irá ou não considerar os segundos
|
|
17
17
|
*/
|
|
18
18
|
this.showSeconds = false;
|
|
19
|
+
/**
|
|
20
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
21
|
+
*/
|
|
22
|
+
this.mode = "regular";
|
|
19
23
|
}
|
|
20
24
|
prepareMask() {
|
|
21
25
|
if (this.showSeconds) {
|
|
@@ -77,7 +81,8 @@ let EzTimeInput = class {
|
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
clearField() {
|
|
80
|
-
this.viewValue =
|
|
84
|
+
this.viewValue = '';
|
|
85
|
+
this.value = undefined;
|
|
81
86
|
}
|
|
82
87
|
handleChange() {
|
|
83
88
|
this.viewValue = this._inputElem.value;
|
|
@@ -100,7 +105,7 @@ let EzTimeInput = class {
|
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
107
|
render() {
|
|
103
|
-
return (h(Host, null, h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage }, h("ez-icon", { slot: "leftIcon", href: getSpritePath("timer-outline") }))));
|
|
108
|
+
return (h(Host, null, h("ez-text-input", { ref: (el) => this._inputElem = el, value: this.viewValue, enabled: this.enabled, label: this.label, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); }, errorMessage: this.errorMessage, mode: this.mode }, h("ez-icon", { slot: "leftIcon", href: getSpritePath("timer-outline") }))));
|
|
104
109
|
}
|
|
105
110
|
static get assetsDirs() { return ["../assets"]; }
|
|
106
111
|
get _elem() { return getElement(this); }
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-6b8bfbeb.js';
|
|
2
2
|
|
|
3
|
-
const ezToastCss = ":host{--ez-toast__btn__close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--ez-toast__container-z-index:var(--more-visible, 2);--ez-toast__container--background-color:var(--color--secondary, #383c45);--ez-toast__icon--padding-left:var(--space--small, 6px)}.toast__container{position:fixed;display:flex;bottom:100px;z-index:var(--ez-toast__container-z-index);left:100px;width:280px;box-sizing:border-box;background-color:var(--ez-toast__container--background-color);border-radius:6px;align-items:center;padding:12px;visibility:hidden}.message__container{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent;color:#FFFFFF;font-size:14px;width:90%;overflow:hidden;
|
|
3
|
+
const ezToastCss = ":host{--ez-toast__btn__close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--ez-toast__container-z-index:var(--more-visible, 2);--ez-toast__container--background-color:var(--color--secondary, #383c45);--ez-toast__icon--padding-left:var(--space--small, 6px)}.toast__container{position:fixed;display:flex;bottom:100px;z-index:var(--ez-toast__container-z-index);left:100px;width:280px;box-sizing:border-box;background-color:var(--ez-toast__container--background-color);border-radius:6px;align-items:center;padding:12px;visibility:hidden}.message__container{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent;color:#FFFFFF;font-size:14px;width:90%;overflow:hidden;hyphens:auto;height:auto;-webkit-box-orient:vertical;-webkit-line-clamp:4;display:-webkit-box;text-overflow:ellipsis}.message__conteiner--icon{padding-left:var(--ez-toast__icon--padding-left);width:80%}.btn-close{margin-top:3px;display:flex;justify-content:flex-end;align-self:flex-start;padding:0;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:#FFFFFF;width:12px;height:12px;-webkit-mask-image:var(--ez-toast__btn__close__image);mask-image:var(--ez-toast__btn__close__image)}.toast__container--oppened{animation:fadein 0.5s, fadeout 0.5s 3s;visibility:visible}@-webkit-keyframes fadein{from{left:-100px;opacity:0}to{left:100px;opacity:1}}@keyframes fadein{from{left:-100px;opacity:0}to{left:100px;opacity:1}}@-webkit-keyframes fadeout{from{left:100px;opacity:1}to{bottom:0;opacity:0}}@keyframes fadeout{from{left:100px;opacity:1}to{bottom:0;opacity:0}}";
|
|
4
4
|
|
|
5
5
|
let EzToast = class {
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
|
+
this._lang = "pt"; // Controla qual idioma será usado para definir a regras de hifenização.
|
|
8
9
|
/**
|
|
9
10
|
* Controla o tempo de exibição do componente em milissegundos.
|
|
10
11
|
*/
|
|
@@ -31,7 +32,7 @@ let EzToast = class {
|
|
|
31
32
|
}
|
|
32
33
|
render() {
|
|
33
34
|
return (h("div", { ref: (el) => this.container = el, class: "toast__container" }, this.useIcon &&
|
|
34
|
-
h("slot", { name: "icon" }), h("div", { class: this.useIcon ? "message__container message__conteiner--icon" : "message__container", title: this.message, innerHTML: this.message }), this.canClose &&
|
|
35
|
+
h("slot", { name: "icon" }), h("div", { lang: this._lang, class: this.useIcon ? "message__container message__conteiner--icon" : "message__container", title: this.message, innerHTML: this.message }), this.canClose &&
|
|
35
36
|
h("button", { class: "btn-close", onClick: () => { this.container.classList.remove("toast__container--oppened"); this.container.style.animation = `none`; } })));
|
|
36
37
|
}
|
|
37
38
|
};
|