@sankhyalabs/ezui 1.1.135 → 1.1.138
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-calendar.cjs.entry.js +2 -2
- package/dist/cjs/ez-check.cjs.entry.js +3 -3
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +5 -5
- package/dist/cjs/ez-date-input.cjs.entry.js +10 -10
- package/dist/cjs/ez-date-time-input.cjs.entry.js +8 -8
- package/dist/cjs/ez-filter-input.cjs.entry.js +6 -6
- package/dist/cjs/ez-form.cjs.entry.js +36 -5
- package/dist/cjs/ez-grid.cjs.entry.js +4 -4
- package/dist/cjs/ez-modal.cjs.entry.js +3 -3
- package/dist/cjs/ez-number-input.cjs.entry.js +25 -18
- package/dist/cjs/ez-popover.cjs.entry.js +2 -2
- package/dist/cjs/ez-search.cjs.entry.js +2 -2
- package/dist/cjs/ez-text-area.cjs.entry.js +11 -11
- package/dist/cjs/ez-text-input.cjs.entry.js +22 -15
- package/dist/cjs/ez-time-input.cjs.entry.js +36 -30
- package/dist/cjs/ez-upload.cjs.entry.js +5 -5
- package/dist/cjs/ez-view-stack.cjs.entry.js +71 -0
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/test-du.cjs.entry.js +43 -10
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ez-calendar/ez-calendar.js +2 -2
- package/dist/collection/components/ez-check/ez-check.js +3 -3
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +14 -2
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +5 -5
- package/dist/collection/components/ez-date-input/ez-date-input.js +10 -10
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +8 -8
- package/dist/collection/components/ez-filter-input/ez-filter-input.js +6 -6
- package/dist/collection/components/ez-form/ez-form.js +17 -2
- package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +19 -3
- package/dist/collection/components/ez-grid/ez-grid.js +4 -4
- package/dist/collection/components/ez-modal/ez-modal.js +3 -3
- package/dist/collection/components/ez-number-input/ez-number-input.js +26 -19
- package/dist/collection/components/ez-popover/ez-popover.js +2 -2
- package/dist/collection/components/ez-search/ez-search.js +2 -2
- package/dist/collection/components/ez-text-area/ez-text-area.js +11 -11
- package/dist/collection/components/ez-text-input/ez-text-input.js +40 -15
- package/dist/collection/components/ez-time-input/ez-time-input.js +52 -31
- package/dist/collection/components/ez-upload/ez-upload.css +1 -0
- package/dist/collection/components/ez-upload/ez-upload.js +4 -4
- package/dist/collection/components/ez-view-stack/ez-view-stack.css +9 -0
- package/dist/collection/components/ez-view-stack/ez-view-stack.js +87 -0
- package/dist/collection/components/test-du/test-du.js +44 -10
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +293 -142
- package/dist/esm/ez-calendar.entry.js +2 -2
- package/dist/esm/ez-check.entry.js +3 -3
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +5 -5
- package/dist/esm/ez-date-input.entry.js +10 -10
- package/dist/esm/ez-date-time-input.entry.js +8 -8
- package/dist/esm/ez-filter-input.entry.js +6 -6
- package/dist/esm/ez-form.entry.js +36 -5
- package/dist/esm/ez-grid.entry.js +4 -4
- package/dist/esm/ez-modal.entry.js +3 -3
- package/dist/esm/ez-number-input.entry.js +25 -18
- package/dist/esm/ez-popover.entry.js +2 -2
- package/dist/esm/ez-search.entry.js +2 -2
- package/dist/esm/ez-text-area.entry.js +11 -11
- package/dist/esm/ez-text-input.entry.js +22 -15
- package/dist/esm/ez-time-input.entry.js +37 -31
- package/dist/esm/ez-upload.entry.js +5 -5
- package/dist/esm/ez-view-stack.entry.js +67 -0
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/test-du.entry.js +43 -10
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-248361f5.entry.js +1 -0
- package/dist/ezui/p-30e3793f.entry.js +1 -0
- package/dist/ezui/p-4c3cd534.entry.js +1 -0
- package/dist/ezui/p-517d7759.entry.js +1 -0
- package/dist/ezui/{p-5f2add6f.entry.js → p-51cdfa9e.entry.js} +1 -1
- package/dist/ezui/p-659df655.entry.js +1 -0
- package/dist/ezui/p-6d4b1628.entry.js +1 -0
- package/dist/ezui/p-8be1a4d6.entry.js +1 -0
- package/dist/ezui/p-b65e22a1.entry.js +1 -0
- package/dist/ezui/p-b8d64970.entry.js +1 -0
- package/dist/ezui/{p-c6c91589.entry.js → p-c246e251.entry.js} +1 -1
- package/dist/ezui/p-c2de757f.entry.js +1 -0
- package/dist/ezui/p-c620258b.entry.js +1 -0
- package/dist/ezui/p-cabe3671.entry.js +1 -0
- package/dist/ezui/p-cb73bee7.entry.js +1 -0
- package/dist/ezui/p-db0981c1.entry.js +1 -0
- package/dist/ezui/p-dd6f4872.entry.js +1 -0
- package/dist/ezui/p-ec8419f1.entry.js +1 -0
- package/dist/ezui/p-fc9b9487.entry.js +1 -0
- package/dist/types/components/ez-calendar/ez-calendar.d.ts +1 -1
- package/dist/types/components/ez-check/ez-check.d.ts +1 -1
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -1
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +3 -3
- package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +3 -3
- package/dist/types/components/ez-filter-input/ez-filter-input.d.ts +3 -3
- package/dist/types/components/ez-form/ez-form.d.ts +1 -1
- package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +1 -1
- package/dist/types/components/ez-modal/ez-modal.d.ts +1 -1
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -3
- package/dist/types/components/ez-popover/ez-popover.d.ts +1 -1
- package/dist/types/components/ez-search/ez-search.d.ts +1 -1
- package/dist/types/components/ez-text-area/ez-text-area.d.ts +4 -4
- package/dist/types/components/ez-text-input/ez-text-input.d.ts +8 -4
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +9 -3
- package/dist/types/components/ez-upload/ez-upload.d.ts +2 -2
- package/dist/types/components/ez-view-stack/ez-view-stack.d.ts +16 -0
- package/dist/types/components/test-du/test-du.d.ts +1 -0
- package/dist/types/components.d.ts +29 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-097d5dc6.entry.js +0 -1
- package/dist/ezui/p-0fd2624d.entry.js +0 -1
- package/dist/ezui/p-1587cbbc.entry.js +0 -1
- package/dist/ezui/p-18d67107.entry.js +0 -1
- package/dist/ezui/p-49f70be3.entry.js +0 -1
- package/dist/ezui/p-50038ae3.entry.js +0 -1
- package/dist/ezui/p-53110643.entry.js +0 -1
- package/dist/ezui/p-67d30ea7.entry.js +0 -1
- package/dist/ezui/p-685a35b3.entry.js +0 -1
- package/dist/ezui/p-699c31d1.entry.js +0 -1
- package/dist/ezui/p-6c22c9f9.entry.js +0 -1
- package/dist/ezui/p-a1304302.entry.js +0 -1
- package/dist/ezui/p-b2cc27e5.entry.js +0 -1
- package/dist/ezui/p-b71d454d.entry.js +0 -1
- package/dist/ezui/p-dcf5f013.entry.js +0 -1
- package/dist/ezui/p-e472517c.entry.js +0 -1
|
@@ -72,7 +72,7 @@ let EzCalendar = class {
|
|
|
72
72
|
this._floatingID = undefined;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
observeValue() {
|
|
76
76
|
if (this.value) {
|
|
77
77
|
this._currentPosition.setTime(this.value.getTime());
|
|
78
78
|
this._currentPosition.setDate(1);
|
|
@@ -215,7 +215,7 @@ let EzCalendar = class {
|
|
|
215
215
|
})))))));
|
|
216
216
|
}
|
|
217
217
|
static get watchers() { return {
|
|
218
|
-
"value": ["
|
|
218
|
+
"value": ["observeValue"]
|
|
219
219
|
}; }
|
|
220
220
|
};
|
|
221
221
|
EzCalendar.style = ezCalendarCss;
|
|
@@ -22,7 +22,7 @@ let EzCheck = class {
|
|
|
22
22
|
*/
|
|
23
23
|
this.mode = "regular";
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
observeMode() {
|
|
26
26
|
if (this.mode === "switch") {
|
|
27
27
|
this._inputElem.classList.remove("regularMode");
|
|
28
28
|
this._inputElem.classList.add("switchMode");
|
|
@@ -48,7 +48,7 @@ let EzCheck = class {
|
|
|
48
48
|
this._inputElem.focus();
|
|
49
49
|
}
|
|
50
50
|
componentDidLoad() {
|
|
51
|
-
this.
|
|
51
|
+
this.observeMode();
|
|
52
52
|
}
|
|
53
53
|
changeValue() {
|
|
54
54
|
if (!this.enabled) {
|
|
@@ -68,7 +68,7 @@ let EzCheck = class {
|
|
|
68
68
|
return (index.h(index.Host, null, index.h("input", { type: "checkbox", class: "regularMode", checked: this.value === true, onChange: () => { this.changeValue(); }, disabled: !this.enabled, ref: (el) => this._inputElem = el }), this.label ? index.h("label", { class: this.getLabelClasses(), onClick: () => { this.changeValue(); }, title: this.label }, this.label) : undefined));
|
|
69
69
|
}
|
|
70
70
|
static get watchers() { return {
|
|
71
|
-
"mode": ["
|
|
71
|
+
"mode": ["observeMode"]
|
|
72
72
|
}; }
|
|
73
73
|
};
|
|
74
74
|
EzCheck.style = ezCheckCss;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-c15a9551.js');
|
|
6
6
|
|
|
7
|
-
const ezCollapsibleBoxCss = ":host{--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__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;margin-bottom:var(--space--medium, 12px)}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)
|
|
7
|
+
const ezCollapsibleBoxCss = ":host{--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--focus--color:var(--color--primary-600);--ez-collapsible-box__icon--color:var(--ez-collapsible-box--color);--ez-collapsible-box__header--padding-top:0px;--ez-collapsible-box__header--padding-bottom:0px;--ez-collapsible-box__header--padding-right:0px;--ez-collapsible-box__header--padding-left:0px;display:flex;flex-wrap:wrap;width:100%}ez-icon{--ez-icon--color:inherit}.collapsible-box{display:flex;flex-direction:column;width:100%}.collapsible-box__header{display:flex;box-sizing:border-box;padding-top:var(--ez-collapsible-box__header--padding-top);padding-bottom:var(--ez-collapsible-box__header--padding-bottom);padding-right:var(--ez-collapsible-box__header--padding-right);padding-left:var(--ez-collapsible-box__header--padding-left)}.collapsible-box__title{position:relative;width:auto;display:flex;box-sizing:border-box;align-items:center;outline:none;border:none;background-color:unset;cursor:pointer;padding:0px;text-align:left;color:var(--ez-collapsible-box--color);--ez-icon--color:var(--ez-collapsible-box__icon--color);margin-bottom:var(--space--medium, 12px)}.collapsible-box__title:focus{color:var(--ez-collapsible-box--focus--color);--ez-icon--color:var(--ez-collapsible-box--focus--color)}.collapsible-box__label{white-space:nowrap;overflow:hidden;cursor:pointer;text-overflow:ellipsis;box-sizing:border-box;margin-left:6px;font-family:var(--ez-collapsible-box--font-family);font-size:var(--ez-collapsible-box--font-size);font-weight:var(--ez-collapsible-box--font-weight)}.collapsible-box__icon{transform:rotate(90deg) translate(0px, 14%);transition:transform var(--transition)}.collapsible-box__icon--collapsed{transform:rotate(0deg) translate(-14%, 0px)}.collapsible-box__title--icon-right{flex-direction:row-reverse}.collapsible-box__title--icon-right .collapsible-box__icon{transform:rotate(90deg) translate(0px, -14%)}.collapsible-box__title--icon-right .collapsible-box__icon--collapsed{transform:rotate(0deg) translate(14%, 0px)}.collapsible-box__title--icon-right .collapsible-box__label{margin-left:0px;margin-right:6px}.collapsible-box__title--stretched{width:100%;justify-content:space-between}.collapsible-box__content{display:flex;flex-wrap:wrap;width:100%;height:0px;max-height:0px;opacity:0;overflow:hidden;transition:all var(--transition, 0.5s)}.collapsible-box__content--show{height:100%;max-height:none;opacity:1;overflow:visible;transition:all var(--transition, 0.5s)}.font--x-small{font-size:10px}.font--small{font-size:12px}.font--medium{font-size:14px}.font--large{font-size:16px}.font--x-large{font-size:20px}";
|
|
8
8
|
|
|
9
9
|
let EzCollapsibleBox = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -41,7 +41,7 @@ let EzComboBox = class {
|
|
|
41
41
|
*/
|
|
42
42
|
this.mode = "regular";
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
observeValue() {
|
|
45
45
|
if (this._inputElement) {
|
|
46
46
|
this._inputElement.value = this.getText();
|
|
47
47
|
}
|
|
@@ -157,7 +157,7 @@ let EzComboBox = class {
|
|
|
157
157
|
this.ezChange.emit(adjustedOpt);
|
|
158
158
|
}
|
|
159
159
|
else {
|
|
160
|
-
this.
|
|
160
|
+
this.observeValue();
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
updateSource(source) {
|
|
@@ -189,7 +189,7 @@ let EzComboBox = class {
|
|
|
189
189
|
this.selectOption(undefined);
|
|
190
190
|
}
|
|
191
191
|
else {
|
|
192
|
-
this.
|
|
192
|
+
this.observeValue();
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
//---------------------------------------------
|
|
@@ -279,11 +279,11 @@ let EzComboBox = class {
|
|
|
279
279
|
this.cancelPreselection();
|
|
280
280
|
}
|
|
281
281
|
render() {
|
|
282
|
-
return (index.h(index.Host, null, index.h("ez-text-input", { class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._inputElement = elem, enabled: this.enabled && !this.suppressSearch, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(),
|
|
282
|
+
return (index.h(index.Host, null, index.h("ez-text-input", { class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._inputElement = elem, enabled: this.enabled && !this.suppressSearch, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }, index.h("button", { class: "btn", slot: this.searchMode ? "leftIcon" : "rightIcon", disabled: !this.enabled, tabindex: -1, onClick: () => this.handlerIconClick() }, index.h("ez-icon", { slot: "icon", "icon-name": this.searchMode ? "search" : "chevron-down" }))), index.h("section", { class: "list-container", ref: elem => this._listContainer = elem }, index.h("div", { class: "options-list", ref: elem => this._optionsList = elem }, this._visibleOptions.map((opt, index) => this.buildItem(opt, index))))));
|
|
283
283
|
}
|
|
284
284
|
get el() { return index.getElement(this); }
|
|
285
285
|
static get watchers() { return {
|
|
286
|
-
"value": ["
|
|
286
|
+
"value": ["observeValue"]
|
|
287
287
|
}; }
|
|
288
288
|
};
|
|
289
289
|
EzComboBox.style = ezComboBoxCss;
|
|
@@ -21,13 +21,13 @@ let EzDateInput = class {
|
|
|
21
21
|
*/
|
|
22
22
|
this.mode = "regular";
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
observeLabel() {
|
|
25
25
|
this._textInput.label = this.label;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
observeErrorMessage() {
|
|
28
28
|
this._textInput.errorMessage = this.errorMessage;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
observeValue() {
|
|
31
31
|
if (this._textInput) {
|
|
32
32
|
this._textInput.value = this.getTextValue(this.value);
|
|
33
33
|
}
|
|
@@ -46,8 +46,8 @@ let EzDateInput = class {
|
|
|
46
46
|
}
|
|
47
47
|
changeValue(newValue) {
|
|
48
48
|
var _a;
|
|
49
|
-
newValue = newValue instanceof Date ? core.DateUtils.clearTime(newValue) :
|
|
50
|
-
this.value = this.value instanceof Date ? core.DateUtils.clearTime(this.value) :
|
|
49
|
+
newValue = newValue instanceof Date ? core.DateUtils.clearTime(newValue) : undefined;
|
|
50
|
+
this.value = this.value instanceof Date ? core.DateUtils.clearTime(this.value) : undefined;
|
|
51
51
|
this._textInput.errorMessage = "";
|
|
52
52
|
if ((newValue === null || newValue === void 0 ? void 0 : newValue.toString()) !== ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString())) {
|
|
53
53
|
this.value = newValue;
|
|
@@ -83,7 +83,7 @@ let EzDateInput = class {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
getTextValue(d) {
|
|
86
|
-
return d ? new Intl.DateTimeFormat("pt-BR").format(d) :
|
|
86
|
+
return d ? new Intl.DateTimeFormat("pt-BR").format(d) : undefined;
|
|
87
87
|
}
|
|
88
88
|
componentDidLoad() {
|
|
89
89
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
@@ -92,13 +92,13 @@ let EzDateInput = class {
|
|
|
92
92
|
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
|
|
93
93
|
if (event.key === "H" || event.key === "h")
|
|
94
94
|
this.changeValue(new Date());
|
|
95
|
-
}, label: this.label,
|
|
95
|
+
}, label: this.label, value: this.getTextValue(this.value), restrict: "0123456789/", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), index.h("ez-calendar", { onEzChange: (event) => { this.hideCalendar(); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem })));
|
|
96
96
|
}
|
|
97
97
|
get _elem() { return index.getElement(this); }
|
|
98
98
|
static get watchers() { return {
|
|
99
|
-
"label": ["
|
|
100
|
-
"errorMessage": ["
|
|
101
|
-
"value": ["
|
|
99
|
+
"label": ["observeLabel"],
|
|
100
|
+
"errorMessage": ["observeErrorMessage"],
|
|
101
|
+
"value": ["observeValue"]
|
|
102
102
|
}; }
|
|
103
103
|
};
|
|
104
104
|
EzDateInput.style = ezDateInputCss;
|
|
@@ -25,13 +25,13 @@ let EzDateTimeInput = class {
|
|
|
25
25
|
*/
|
|
26
26
|
this.mode = "regular";
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
observeLabel() {
|
|
29
29
|
this._textInput.label = this.label;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
observeErrorMessage() {
|
|
32
32
|
this._textInput.errorMessage = this.errorMessage;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
observeValue() {
|
|
35
35
|
if (this._textInput) {
|
|
36
36
|
this._textInput.value = this.getTextValue(this.value);
|
|
37
37
|
}
|
|
@@ -129,19 +129,19 @@ let EzDateTimeInput = class {
|
|
|
129
129
|
year: 'numeric', month: 'numeric', day: 'numeric',
|
|
130
130
|
hour: 'numeric', minute: 'numeric', second: 'numeric'
|
|
131
131
|
};
|
|
132
|
-
return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) :
|
|
132
|
+
return d ? (new Intl.DateTimeFormat('pt-BR', this.showSeconds ? optionsSecond : options).format(d)) : undefined;
|
|
133
133
|
}
|
|
134
134
|
componentDidLoad() {
|
|
135
135
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
136
136
|
}
|
|
137
137
|
render() {
|
|
138
|
-
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label,
|
|
138
|
+
return (index.h(index.Host, null, index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => { this.onChangeKeyDown(event); }, label: this.label, value: this.getTextValue(this.value), restrict: "0123456789/: ", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, onFocus: () => this.onFocused(), onClick: () => this.onClicked(), slaveMode: true }, index.h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-cal", onClick: () => this.showCalendar(), slot: "leftIcon" })), index.h("ez-calendar", { onEzChange: (event) => { this.changeValue(this._calendar.value); event.stopPropagation(); }, floating: true, ref: elem => this._calendar = elem, time: true, showSeconds: this.showSeconds })));
|
|
139
139
|
}
|
|
140
140
|
get _elem() { return index.getElement(this); }
|
|
141
141
|
static get watchers() { return {
|
|
142
|
-
"label": ["
|
|
143
|
-
"errorMessage": ["
|
|
144
|
-
"value": ["
|
|
142
|
+
"label": ["observeLabel"],
|
|
143
|
+
"errorMessage": ["observeErrorMessage"],
|
|
144
|
+
"value": ["observeValue"]
|
|
145
145
|
}; }
|
|
146
146
|
};
|
|
147
147
|
EzDateTimeInput.style = ezDateTimeInputCss;
|
|
@@ -20,17 +20,17 @@ let EzFilterInput = class {
|
|
|
20
20
|
*/
|
|
21
21
|
this.mode = "regular";
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
observeLabel() {
|
|
24
24
|
if (this._textInput) {
|
|
25
25
|
this._textInput.label = this.label;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
observeErrorMessage() {
|
|
29
29
|
if (this._textInput) {
|
|
30
30
|
this._textInput.errorMessage = this.errorMessage;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
observeValue() {
|
|
34
34
|
if (this._textInput) {
|
|
35
35
|
this._textInput.value = this.value;
|
|
36
36
|
}
|
|
@@ -63,9 +63,9 @@ let EzFilterInput = class {
|
|
|
63
63
|
}
|
|
64
64
|
get _elem() { return index.getElement(this); }
|
|
65
65
|
static get watchers() { return {
|
|
66
|
-
"label": ["
|
|
67
|
-
"errorMessage": ["
|
|
68
|
-
"value": ["
|
|
66
|
+
"label": ["observeLabel"],
|
|
67
|
+
"errorMessage": ["observeErrorMessage"],
|
|
68
|
+
"value": ["observeValue"]
|
|
69
69
|
}; }
|
|
70
70
|
};
|
|
71
71
|
EzFilterInput.style = ezFilterInputCss;
|
|
@@ -139,6 +139,7 @@ class FormMetadata {
|
|
|
139
139
|
this._sheets = new Map();
|
|
140
140
|
this._requiredFields = [];
|
|
141
141
|
this._cleanOnCopyFields = [];
|
|
142
|
+
this._defaultValues = {};
|
|
142
143
|
}
|
|
143
144
|
getSheet(name) {
|
|
144
145
|
return this._sheets.get(name);
|
|
@@ -150,6 +151,7 @@ class FormMetadata {
|
|
|
150
151
|
this._sheets.set(sheet.name, sheet);
|
|
151
152
|
this._requiredFields = this._requiredFields.concat(sheet.requiredFields);
|
|
152
153
|
this._cleanOnCopyFields = this._cleanOnCopyFields.concat(sheet.cleanOnCopyFields);
|
|
154
|
+
this._defaultValues = sheet.defaultValues;
|
|
153
155
|
}
|
|
154
156
|
getRequiredFields() {
|
|
155
157
|
return this._requiredFields;
|
|
@@ -157,6 +159,9 @@ class FormMetadata {
|
|
|
157
159
|
getCleanOnCopyFields() {
|
|
158
160
|
return this._cleanOnCopyFields;
|
|
159
161
|
}
|
|
162
|
+
getDefaultValues() {
|
|
163
|
+
return this._defaultValues;
|
|
164
|
+
}
|
|
160
165
|
}
|
|
161
166
|
const buildFromDataUnit = (dataUnit) => {
|
|
162
167
|
var _a;
|
|
@@ -164,6 +169,10 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
164
169
|
const metadata = new FormMetadata();
|
|
165
170
|
if (unitMD) {
|
|
166
171
|
const visibleFields = (_a = unitMD.fields) === null || _a === void 0 ? void 0 : _a.filter(descriptor => descriptor.visible !== false);
|
|
172
|
+
let defaultValues = {};
|
|
173
|
+
visibleFields
|
|
174
|
+
.filter(descriptor => descriptor.defaultValue)
|
|
175
|
+
.map((descriptor) => defaultValues[descriptor.name] = descriptor.defaultValue);
|
|
167
176
|
metadata.addSheet({
|
|
168
177
|
label: unitMD.label,
|
|
169
178
|
name: unitMD.name,
|
|
@@ -173,7 +182,8 @@ const buildFromDataUnit = (dataUnit) => {
|
|
|
173
182
|
.map(descriptor => descriptor.name),
|
|
174
183
|
cleanOnCopyFields: visibleFields
|
|
175
184
|
.filter(descriptor => { var _a; return (_a = descriptor.properties) === null || _a === void 0 ? void 0 : _a.cleanOnCopy; })
|
|
176
|
-
.map(descriptor => descriptor.name)
|
|
185
|
+
.map(descriptor => descriptor.name),
|
|
186
|
+
defaultValues
|
|
177
187
|
});
|
|
178
188
|
}
|
|
179
189
|
return metadata;
|
|
@@ -189,8 +199,9 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
189
199
|
const sheets = new Map();
|
|
190
200
|
const requiredFields = [];
|
|
191
201
|
const cleanOnCopyFields = [];
|
|
202
|
+
const defaultValues = {};
|
|
192
203
|
fields.forEach(config => {
|
|
193
|
-
var _a;
|
|
204
|
+
var _a, _b;
|
|
194
205
|
if (config.visible !== false) {
|
|
195
206
|
const tabConfig = getTabConfig(config.tab || "Geral", sheets);
|
|
196
207
|
const descriptor = dataUnit.getField(config.name);
|
|
@@ -207,6 +218,10 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
207
218
|
if (clearOnCopy) {
|
|
208
219
|
cleanOnCopyFields.push(config.name);
|
|
209
220
|
}
|
|
221
|
+
const defaultValue = config.defaultValue === undefined ? (_b = descriptor.properties) === null || _b === void 0 ? void 0 : _b.defaultValue : config.defaultValue;
|
|
222
|
+
if (defaultValue) {
|
|
223
|
+
defaultValues[config.name] = config.defaultValue;
|
|
224
|
+
}
|
|
210
225
|
const fieldMD = { config, descriptor };
|
|
211
226
|
const group = config.group;
|
|
212
227
|
if (group) {
|
|
@@ -233,7 +248,8 @@ const buildFromConfig = (fields, dataUnit) => {
|
|
|
233
248
|
name: key.label,
|
|
234
249
|
items: Array.from(value.values()),
|
|
235
250
|
requiredFields,
|
|
236
|
-
cleanOnCopyFields
|
|
251
|
+
cleanOnCopyFields,
|
|
252
|
+
defaultValues
|
|
237
253
|
});
|
|
238
254
|
});
|
|
239
255
|
return metadata;
|
|
@@ -757,7 +773,7 @@ let EzForm = class {
|
|
|
757
773
|
accept();
|
|
758
774
|
});
|
|
759
775
|
}
|
|
760
|
-
|
|
776
|
+
observeConfig() {
|
|
761
777
|
this.processMetadata();
|
|
762
778
|
}
|
|
763
779
|
validateRequired(requiredFields, record) {
|
|
@@ -819,6 +835,21 @@ let EzForm = class {
|
|
|
819
835
|
}));
|
|
820
836
|
}
|
|
821
837
|
}
|
|
838
|
+
if (action.type === core.Action.RECORDS_ADDED) {
|
|
839
|
+
debugger;
|
|
840
|
+
const metadata = selectFormMetadata(this._store.getState());
|
|
841
|
+
const defaultValues = metadata.getDefaultValues();
|
|
842
|
+
if (defaultValues) {
|
|
843
|
+
const records = action.payload;
|
|
844
|
+
return new core.DataUnitAction(core.Action.RECORDS_ADDED, records.map(record => {
|
|
845
|
+
const newRecord = Object.assign({}, record);
|
|
846
|
+
for (const field in defaultValues) {
|
|
847
|
+
newRecord[field] = this.dataUnit.valueFromString(field, defaultValues[field]);
|
|
848
|
+
}
|
|
849
|
+
return newRecord;
|
|
850
|
+
}));
|
|
851
|
+
}
|
|
852
|
+
}
|
|
822
853
|
return action;
|
|
823
854
|
}
|
|
824
855
|
componentWillLoad() {
|
|
@@ -847,7 +878,7 @@ let EzForm = class {
|
|
|
847
878
|
}
|
|
848
879
|
get _element() { return index.getElement(this); }
|
|
849
880
|
static get watchers() { return {
|
|
850
|
-
"config": ["
|
|
881
|
+
"config": ["observeConfig"]
|
|
851
882
|
}; }
|
|
852
883
|
};
|
|
853
884
|
EzForm.style = ezFormCss;
|
|
@@ -110814,7 +110814,7 @@ let EzGrid = class {
|
|
|
110814
110814
|
this._gridController.setColumnsDef(this._dataUnitBridge.buildColumnDefs(), true);
|
|
110815
110815
|
}
|
|
110816
110816
|
if (this.config) {
|
|
110817
|
-
this.
|
|
110817
|
+
this.observeConfig(this.config);
|
|
110818
110818
|
}
|
|
110819
110819
|
}
|
|
110820
110820
|
disconnectedCallback() {
|
|
@@ -110832,7 +110832,7 @@ let EzGrid = class {
|
|
|
110832
110832
|
index.h("ez-button", { size: "small", iconName: "chevron-right", class: "ez-margin-right--medium", mode: "icon", enabled: this._navigationHasNext, onClick: () => this.nextPage(), label: "Pr\u00F3xima P\u00E1gina" })
|
|
110833
110833
|
];
|
|
110834
110834
|
}
|
|
110835
|
-
|
|
110835
|
+
observeConfig(config) {
|
|
110836
110836
|
this._gridController.setColumnsState(config.columns);
|
|
110837
110837
|
this.closeGridConfig();
|
|
110838
110838
|
}
|
|
@@ -110845,11 +110845,11 @@ let EzGrid = class {
|
|
|
110845
110845
|
this._popUpGridConfig = true;
|
|
110846
110846
|
}
|
|
110847
110847
|
render() {
|
|
110848
|
-
return (index.h(index.Host, null, index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container" }, this.getPaginationControl())), index.h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" }), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("grid-config", { ref: ref => this._gridConfig = ref, config: this.config, selectedTab: "Colunas", onConfigFinish: evt => { this.
|
|
110848
|
+
return (index.h(index.Host, null, index.h("div", { class: "ez-box ez-box--shadow ez-padding--medium grid-header" }, index.h("div", { class: "grid-header__container" }, index.h("slot", { name: "leftButtons" })), index.h("div", { class: "grid-header__container" }, this.getPaginationControl())), index.h("div", { class: "grid__container ez-grid", ref: elem => this._container = elem }), index.h("div", { class: "grid__footer" }), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("grid-config", { ref: ref => this._gridConfig = ref, config: this.config, selectedTab: "Colunas", onConfigFinish: evt => { this.observeConfig(evt.detail); this.configChange.emit(evt.detail); }, onConfigCancel: _evt => this.closeGridConfig() }))));
|
|
110849
110849
|
}
|
|
110850
110850
|
static get assetsDirs() { return ["../assets"]; }
|
|
110851
110851
|
static get watchers() { return {
|
|
110852
|
-
"config": ["
|
|
110852
|
+
"config": ["observeConfig"]
|
|
110853
110853
|
}; }
|
|
110854
110854
|
};
|
|
110855
110855
|
EzGrid.style = ezGridCss;
|
|
@@ -29,7 +29,7 @@ let EzModal = class {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
observeOpened() {
|
|
33
33
|
if (this.opened) {
|
|
34
34
|
document.addEventListener("keydown", this.handleKeyboardEvent);
|
|
35
35
|
}
|
|
@@ -42,7 +42,7 @@ let EzModal = class {
|
|
|
42
42
|
this.ezCloseModal.emit(this.opened);
|
|
43
43
|
}
|
|
44
44
|
componentDidLoad() {
|
|
45
|
-
this.
|
|
45
|
+
this.observeOpened();
|
|
46
46
|
}
|
|
47
47
|
componentDidRender() {
|
|
48
48
|
if (this.opened) {
|
|
@@ -63,7 +63,7 @@ let EzModal = class {
|
|
|
63
63
|
undefined));
|
|
64
64
|
}
|
|
65
65
|
static get watchers() { return {
|
|
66
|
-
"opened": ["
|
|
66
|
+
"opened": ["observeOpened"]
|
|
67
67
|
}; }
|
|
68
68
|
};
|
|
69
69
|
EzModal.style = ezModalCss;
|
|
@@ -21,17 +21,6 @@ let EzNumberInput = class {
|
|
|
21
21
|
*/
|
|
22
22
|
this.mode = "regular";
|
|
23
23
|
}
|
|
24
|
-
setLabel() {
|
|
25
|
-
this._textInput.label = this.label;
|
|
26
|
-
}
|
|
27
|
-
setErrorMessage() {
|
|
28
|
-
this._textInput.errorMessage = this.errorMessage;
|
|
29
|
-
}
|
|
30
|
-
applyValueToInput() {
|
|
31
|
-
if (this._textInput) {
|
|
32
|
-
this._textInput.value = this.getTextValue(this.value);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
24
|
/**
|
|
36
25
|
* Realiza o foco no componente de input
|
|
37
26
|
*/
|
|
@@ -44,16 +33,34 @@ let EzNumberInput = class {
|
|
|
44
33
|
async setBlur() {
|
|
45
34
|
this._textInput.setBlur();
|
|
46
35
|
}
|
|
36
|
+
observeLabel() {
|
|
37
|
+
if (this._textInput) {
|
|
38
|
+
this._textInput.label = this.label;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
observeErrorMessage() {
|
|
42
|
+
if (this._textInput) {
|
|
43
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
observeValue() {
|
|
47
|
+
if (this._textInput) {
|
|
48
|
+
this._textInput.value = this.getTextValue(this.value) || '';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
47
51
|
changeValue(newValue) {
|
|
48
52
|
this.errorMessage = "";
|
|
49
53
|
if (newValue !== this.value) {
|
|
50
54
|
this.value = newValue;
|
|
51
55
|
this.ezChange.emit(this.value);
|
|
52
56
|
}
|
|
57
|
+
else {
|
|
58
|
+
this.observeValue();
|
|
59
|
+
}
|
|
53
60
|
}
|
|
54
61
|
parseNumber() {
|
|
55
|
-
const parsedNumber = this._textInput.value ? core.NumberUtils.stringToNumber(this._textInput.value) :
|
|
56
|
-
if (parsedNumber
|
|
62
|
+
const parsedNumber = this._textInput.value ? core.NumberUtils.stringToNumber(this._textInput.value) : undefined;
|
|
63
|
+
if (parsedNumber !== undefined && isNaN(parsedNumber)) {
|
|
57
64
|
this.errorMessage = "O valor digitado não é um número válido";
|
|
58
65
|
}
|
|
59
66
|
else {
|
|
@@ -70,19 +77,19 @@ let EzNumberInput = class {
|
|
|
70
77
|
if (value) {
|
|
71
78
|
return this.precision > 0 ? core.NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
72
79
|
}
|
|
73
|
-
return
|
|
80
|
+
return undefined;
|
|
74
81
|
}
|
|
75
82
|
componentDidLoad() {
|
|
76
83
|
CSSVarsUtils.CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
77
84
|
}
|
|
78
85
|
render() {
|
|
79
|
-
return (index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label,
|
|
86
|
+
return (index.h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode, slaveMode: true }));
|
|
80
87
|
}
|
|
81
88
|
get _elem() { return index.getElement(this); }
|
|
82
89
|
static get watchers() { return {
|
|
83
|
-
"label": ["
|
|
84
|
-
"errorMessage": ["
|
|
85
|
-
"value": ["
|
|
90
|
+
"label": ["observeLabel"],
|
|
91
|
+
"errorMessage": ["observeErrorMessage"],
|
|
92
|
+
"value": ["observeValue"]
|
|
86
93
|
}; }
|
|
87
94
|
};
|
|
88
95
|
EzNumberInput.style = ezNumberInputCss;
|
|
@@ -74,7 +74,7 @@ let EzPopover = class {
|
|
|
74
74
|
this.ezVisibilityChange.emit(false);
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
observeOpened(newValue, oldValue) {
|
|
78
78
|
if (newValue != oldValue) {
|
|
79
79
|
this.ezVisibilityChange.emit(newValue);
|
|
80
80
|
}
|
|
@@ -131,7 +131,7 @@ let EzPopover = class {
|
|
|
131
131
|
}
|
|
132
132
|
get _host() { return index.getElement(this); }
|
|
133
133
|
static get watchers() { return {
|
|
134
|
-
"opened": ["
|
|
134
|
+
"opened": ["observeOpened"]
|
|
135
135
|
}; }
|
|
136
136
|
};
|
|
137
137
|
EzPopover.style = ezPopoverCss;
|
|
@@ -33,7 +33,7 @@ let EzSearch = class {
|
|
|
33
33
|
*/
|
|
34
34
|
this.mode = "regular";
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
observeValue() {
|
|
37
37
|
if (this._comboElement) {
|
|
38
38
|
this._comboElement.value = this.value;
|
|
39
39
|
}
|
|
@@ -64,7 +64,7 @@ let EzSearch = class {
|
|
|
64
64
|
;
|
|
65
65
|
get _elem() { return index.getElement(this); }
|
|
66
66
|
static get watchers() { return {
|
|
67
|
-
"value": ["
|
|
67
|
+
"value": ["observeValue"]
|
|
68
68
|
}; }
|
|
69
69
|
};
|
|
70
70
|
EzSearch.style = ezSearchCss;
|
|
@@ -27,7 +27,7 @@ let EzTextArea = class {
|
|
|
27
27
|
*/
|
|
28
28
|
this.mode = "regular";
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
observeErrorMessage() {
|
|
31
31
|
var _a, _b;
|
|
32
32
|
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
33
33
|
if (hasError) {
|
|
@@ -39,13 +39,13 @@ let EzTextArea = class {
|
|
|
39
39
|
(_b = this._messageBoxElem) === null || _b === void 0 ? void 0 : _b.classList.remove('hasError');
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
this._inputElem.value = this.value
|
|
42
|
+
observeValue() {
|
|
43
|
+
this._inputElem.value = this.value == undefined ? "" : this.value;
|
|
44
44
|
this.handleChange();
|
|
45
45
|
this.adjustFloatingLabel();
|
|
46
46
|
this.ezChange.emit(this.value);
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
observeMode() {
|
|
49
49
|
if (this._initialRows == undefined) {
|
|
50
50
|
this._initialRows = this.rows > 0 ? this.rows : undefined;
|
|
51
51
|
}
|
|
@@ -54,7 +54,7 @@ let EzTextArea = class {
|
|
|
54
54
|
this.rows = rows;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
observeRows() {
|
|
58
58
|
const rows = this.rows > 0 ? this.rows : this.mode != "slim" ? 4 : 2;
|
|
59
59
|
if (rows !== this.rows) {
|
|
60
60
|
this.rows = rows;
|
|
@@ -120,9 +120,9 @@ let EzTextArea = class {
|
|
|
120
120
|
// Lifecycle web component
|
|
121
121
|
//---------------------------------------------
|
|
122
122
|
componentDidLoad() {
|
|
123
|
-
this.
|
|
123
|
+
this.observeErrorMessage();
|
|
124
124
|
this.adjustFloatingLabel();
|
|
125
|
-
this.
|
|
125
|
+
this.observeMode();
|
|
126
126
|
}
|
|
127
127
|
render() {
|
|
128
128
|
return (index.h(index.Host, null, index.h("div", { class: "textarea", ref: (el) => this._container = el }, this.label && this.mode != "slim" ?
|
|
@@ -132,10 +132,10 @@ let EzTextArea = class {
|
|
|
132
132
|
}
|
|
133
133
|
get _hostElement() { return index.getElement(this); }
|
|
134
134
|
static get watchers() { return {
|
|
135
|
-
"errorMessage": ["
|
|
136
|
-
"value": ["
|
|
137
|
-
"mode": ["
|
|
138
|
-
"rows": ["
|
|
135
|
+
"errorMessage": ["observeErrorMessage"],
|
|
136
|
+
"value": ["observeValue"],
|
|
137
|
+
"mode": ["observeMode"],
|
|
138
|
+
"rows": ["observeRows"]
|
|
139
139
|
}; }
|
|
140
140
|
};
|
|
141
141
|
EzTextArea.style = ezTextAreaCss;
|