@sankhyalabs/ezui 1.2.0-beta.6 → 1.2.0-beta.7
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/{ApplicationUtils-483c0a9e.js → ApplicationUtils-2ac1b73e.js} +2 -1
- package/dist/cjs/ApplicationUtils-475b50d9.js +63 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/css-shim-3bfdba4f.js +6 -0
- package/dist/cjs/dom-8ac1ad03.js +75 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +7 -6
- package/dist/cjs/ez-application.cjs.entry.js +1 -1
- package/dist/cjs/ez-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-calendar.cjs.entry.js +4 -4
- package/dist/cjs/ez-card-item.cjs.entry.js +1 -1
- package/dist/cjs/ez-check.cjs.entry.js +1 -1
- package/dist/cjs/ez-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +7 -6
- package/dist/cjs/ez-date-input.cjs.entry.js +6 -6
- package/dist/cjs/ez-date-time-input.cjs.entry.js +4 -4
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +460 -49
- package/dist/cjs/ez-grid-config.cjs.entry.js +5 -5
- package/dist/cjs/ez-grid.cjs.entry.js +1153 -989
- package/dist/cjs/ez-icon.cjs.entry.js +3 -3
- package/dist/cjs/ez-list.cjs.entry.js +3 -1
- package/dist/cjs/ez-loading-bar.cjs.entry.js +1 -1
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +4 -4
- package/dist/cjs/ez-popover.cjs.entry.js +5 -5
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-scroller.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +1 -1
- package/dist/cjs/ez-select-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-tabselector.cjs.entry.js +2 -1
- package/dist/cjs/ez-text-area.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-input.cjs.entry.js +3 -3
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -7
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +2 -2
- package/dist/cjs/ez-view-stack.cjs.entry.js +2 -1
- package/dist/cjs/ezui.cjs.js +112 -4
- package/dist/cjs/index-0ad7c3e4.js +6 -0
- package/dist/cjs/index-2ec1da82.js +2307 -0
- package/dist/cjs/index-d9c5cb88.js +3068 -0
- package/dist/cjs/loader.cjs.js +18 -2
- package/dist/cjs/shadow-css-41d9783d.js +390 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/utils/ApplicationUtils.js +2 -1
- package/dist/custom-elements/index.js +3844 -967
- package/dist/esm/ApplicationUtils-30a69eb0.js +61 -0
- package/dist/esm/{ApplicationUtils-5f87ae60.js → ApplicationUtils-a4a76132.js} +2 -1
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/css-shim-20dbffa5.js +4 -0
- package/dist/esm/dom-c5ed0ba5.js +73 -0
- package/dist/esm/ez-actions-button.entry.js +4 -3
- package/dist/esm/ez-application.entry.js +1 -1
- package/dist/esm/ez-button.entry.js +1 -1
- package/dist/esm/ez-calendar.entry.js +2 -2
- package/dist/esm/ez-card-item.entry.js +1 -1
- package/dist/esm/ez-check.entry.js +1 -1
- package/dist/esm/ez-chip.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +4 -3
- package/dist/esm/ez-date-input.entry.js +2 -2
- package/dist/esm/ez-date-time-input.entry.js +2 -2
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-filter-input.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +426 -15
- package/dist/esm/ez-grid-config.entry.js +3 -3
- package/dist/esm/ez-grid.entry.js +1119 -955
- package/dist/esm/ez-icon.entry.js +2 -2
- package/dist/esm/ez-list.entry.js +3 -1
- package/dist/esm/ez-loading-bar.entry.js +1 -1
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +2 -2
- package/dist/esm/ez-popover.entry.js +2 -2
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-radio-button.entry.js +1 -1
- package/dist/esm/ez-scroller.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +1 -1
- package/dist/esm/ez-select-box.entry.js +1 -1
- package/dist/esm/ez-tabselector.entry.js +2 -1
- package/dist/esm/ez-text-area.entry.js +1 -1
- package/dist/esm/ez-text-input.entry.js +2 -2
- package/dist/esm/ez-time-input.entry.js +2 -2
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +2 -2
- package/dist/esm/ez-view-stack.entry.js +2 -1
- package/dist/esm/ezui.js +112 -4
- package/dist/esm/index-12b43518.js +3 -0
- package/dist/esm/index-1e9d524f.js +3031 -0
- package/dist/esm/index-b96183c8.js +2295 -0
- package/dist/esm/loader.js +18 -2
- package/dist/esm/shadow-css-8c625855.js +388 -0
- package/dist/ezui/ApplicationUtils-30a69eb0.js +61 -0
- package/dist/ezui/CSSVarsUtils-499b75c2.js +53 -0
- package/dist/ezui/DialogType-72afa679.js +8 -0
- package/dist/ezui/app-globals-0f993ce5.js +3 -0
- package/dist/ezui/css-shim-20dbffa5.js +4 -0
- package/dist/ezui/dom-c5ed0ba5.js +73 -0
- package/dist/ezui/ez-actions-button.entry.js +98 -0
- package/dist/ezui/ez-application.entry.js +22 -0
- package/dist/ezui/ez-button.entry.js +73 -0
- package/dist/ezui/ez-calendar.entry.js +219 -0
- package/dist/ezui/ez-card-item.entry.js +40 -0
- package/dist/ezui/ez-check.entry.js +72 -0
- package/dist/ezui/ez-chip.entry.js +97 -0
- package/dist/ezui/ez-collapsible-box.entry.js +57 -0
- package/dist/ezui/ez-combo-box.entry.js +439 -0
- package/dist/ezui/ez-date-input.entry.js +159 -0
- package/dist/ezui/ez-date-time-input.entry.js +214 -0
- package/dist/ezui/ez-dialog.entry.js +108 -0
- package/dist/ezui/ez-filter-input.entry.js +75 -0
- package/dist/ezui/ez-form.entry.js +1395 -0
- package/dist/ezui/ez-grid-config.entry.js +433 -0
- package/dist/ezui/ez-grid.entry.js +115419 -0
- package/dist/ezui/ez-icon.entry.js +37 -0
- package/dist/ezui/ez-list.entry.js +516 -0
- package/dist/ezui/ez-loading-bar.entry.js +24 -0
- package/dist/ezui/ez-modal.entry.js +67 -0
- package/dist/ezui/ez-number-input.entry.js +148 -0
- package/dist/ezui/ez-popover.entry.js +141 -0
- package/dist/ezui/ez-popup.entry.js +49 -0
- package/dist/ezui/ez-radio-button.entry.js +45 -0
- package/dist/ezui/ez-scroller.entry.js +101 -0
- package/dist/ezui/ez-search.entry.js +83 -0
- package/dist/ezui/ez-select-box.entry.js +18 -0
- package/dist/ezui/ez-tabselector.entry.js +195 -0
- package/dist/ezui/ez-text-area.entry.js +158 -0
- package/dist/ezui/ez-text-input.entry.js +235 -0
- package/dist/ezui/ez-time-input.entry.js +164 -0
- package/dist/ezui/ez-toast.entry.js +84 -0
- package/dist/ezui/ez-upload.entry.js +379 -0
- package/dist/ezui/ez-view-stack.entry.js +74 -0
- package/dist/ezui/ezui.esm.js +125 -1
- package/dist/ezui/index-12b43518.js +3 -0
- package/dist/ezui/index-1e9d524f.js +3031 -0
- package/dist/ezui/index-b96183c8.js +2295 -0
- package/dist/ezui/index.esm.js +1 -0
- package/dist/ezui/{p-72ab066f.entry.js → p-4eb273f8.entry.js} +1 -1
- package/dist/ezui/p-adbe4188.js +1 -0
- package/dist/ezui/{p-6cfe20a0.entry.js → p-af43be42.entry.js} +1 -1
- package/dist/ezui/{p-47e06040.entry.js → p-c9d2060e.entry.js} +1 -1
- package/dist/ezui/{p-3ae441ec.entry.js → p-d836f546.entry.js} +1 -1
- package/dist/ezui/{p-7fe1ac9a.entry.js → p-e55fc20f.entry.js} +1 -1
- package/dist/ezui/shadow-css-8c625855.js +388 -0
- package/package.json +1 -1
- package/dist/ezui/p-898b9906.js +0 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, g as getElement } from './index-1e9d524f.js';
|
|
2
|
+
import { N as NumberUtils } from './index-b96183c8.js';
|
|
3
|
+
import { C as CSSVarsUtils } from './CSSVarsUtils-499b75c2.js';
|
|
4
|
+
|
|
5
|
+
const ezNumberInputCss = ":host{display:block;width:100%}";
|
|
6
|
+
|
|
7
|
+
let EzNumberInput = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.ezChange = createEvent(this, "ezChange", 7);
|
|
11
|
+
this.ezStartChange = createEvent(this, "ezStartChange", 7);
|
|
12
|
+
this.ezCancelWaitingChange = createEvent(this, "ezCancelWaitingChange", 7);
|
|
13
|
+
this._focused = false;
|
|
14
|
+
/**
|
|
15
|
+
* Deixa o campo disponível ou não para uso.
|
|
16
|
+
*/
|
|
17
|
+
this.enabled = true;
|
|
18
|
+
/**
|
|
19
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
20
|
+
*/
|
|
21
|
+
this.mode = "regular";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Realiza o foco no componente de input
|
|
25
|
+
*/
|
|
26
|
+
async setFocus() {
|
|
27
|
+
this._textInput.setFocus();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Remove o foco no componente de input
|
|
31
|
+
*/
|
|
32
|
+
async setBlur() {
|
|
33
|
+
this._textInput.setBlur();
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Retorna informando se o campo está inválido (true | false)
|
|
37
|
+
*/
|
|
38
|
+
async isInvalid() {
|
|
39
|
+
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
40
|
+
}
|
|
41
|
+
observeLabel() {
|
|
42
|
+
if (this._textInput) {
|
|
43
|
+
this._textInput.label = this.label;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
observeErrorMessage() {
|
|
47
|
+
var _a;
|
|
48
|
+
if (this._textInput) {
|
|
49
|
+
this._textInput.errorMessage = this.errorMessage;
|
|
50
|
+
if (!((_a = this.errorMessage) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
51
|
+
this.setInputValue();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
observeValue(newValue, oldValue) {
|
|
56
|
+
if (this._textInput && newValue != oldValue) {
|
|
57
|
+
const newValueValidated = this.validateValue(newValue);
|
|
58
|
+
const oldValueValidated = this.validateValue(oldValue);
|
|
59
|
+
if (newValueValidated != oldValueValidated) {
|
|
60
|
+
const textValue = this.getTextValue(newValueValidated) || '';
|
|
61
|
+
if ((this._textInput.value || '') !== textValue) {
|
|
62
|
+
const parsedNumber = this.getParsedNumber(textValue);
|
|
63
|
+
if (parsedNumber !== undefined || !this._focused) {
|
|
64
|
+
this._textInput.value = textValue;
|
|
65
|
+
this._focused = false;
|
|
66
|
+
this.errorMessage = "";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const valueEmitted = newValueValidated === null ? undefined : newValueValidated;
|
|
70
|
+
this.ezChange.emit(valueEmitted);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
validateValue(value) {
|
|
75
|
+
return isNaN(value) || value === undefined ? null : value;
|
|
76
|
+
}
|
|
77
|
+
getTextValue(value) {
|
|
78
|
+
if (value != undefined) {
|
|
79
|
+
return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyPrecision)) : value.toString();
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
changeValue(newValue) {
|
|
84
|
+
this.errorMessage = "";
|
|
85
|
+
if (this.value != newValue) {
|
|
86
|
+
this.value = newValue === undefined ? null : newValue;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this.ezCancelWaitingChange.emit();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
setError(msg) {
|
|
93
|
+
this.value = null;
|
|
94
|
+
this.errorMessage = msg;
|
|
95
|
+
this.ezCancelWaitingChange.emit();
|
|
96
|
+
}
|
|
97
|
+
handleBlur() {
|
|
98
|
+
const parsedNumber = this.getParsedNumber();
|
|
99
|
+
if (parsedNumber !== undefined && isNaN(parsedNumber)) {
|
|
100
|
+
this.setError("O valor digitado não é um número válido");
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
try {
|
|
104
|
+
this.changeValue(parsedNumber);
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
this.setError(e.message);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
handleInput() {
|
|
113
|
+
const parsedNumber = this.getParsedNumber();
|
|
114
|
+
if (parsedNumber !== this.value) {
|
|
115
|
+
this._focused = true;
|
|
116
|
+
this.ezStartChange.emit({ waitmessage: "", blocking: false });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
getParsedNumber(value) {
|
|
120
|
+
var _a;
|
|
121
|
+
if (value === void 0) {
|
|
122
|
+
value = (_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value;
|
|
123
|
+
}
|
|
124
|
+
return (value === null || value === void 0 ? void 0 : value.trim()) ? NumberUtils.stringToNumber(value) : undefined;
|
|
125
|
+
}
|
|
126
|
+
setInputValue() {
|
|
127
|
+
const textValue = this.getTextValue(this.value) || '';
|
|
128
|
+
if ((this._textInput.value || '') !== textValue) {
|
|
129
|
+
this._textInput.value = textValue;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
componentDidLoad() {
|
|
133
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
134
|
+
this.setInputValue();
|
|
135
|
+
}
|
|
136
|
+
render() {
|
|
137
|
+
return (h("ez-text-input", { ref: elem => this._textInput = elem, "data-slave-mode": "true", label: this.label, onBlur: () => this.handleBlur(), onInput: () => this.handleInput(), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errorMessage: this.errorMessage, mode: this.mode }));
|
|
138
|
+
}
|
|
139
|
+
get _elem() { return getElement(this); }
|
|
140
|
+
static get watchers() { return {
|
|
141
|
+
"label": ["observeLabel"],
|
|
142
|
+
"errorMessage": ["observeErrorMessage"],
|
|
143
|
+
"value": ["observeValue"]
|
|
144
|
+
}; }
|
|
145
|
+
};
|
|
146
|
+
EzNumberInput.style = ezNumberInputCss;
|
|
147
|
+
|
|
148
|
+
export { EzNumberInput as ez_number_input };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-1e9d524f.js';
|
|
2
|
+
import { F as FloatingManager } from './index-b96183c8.js';
|
|
3
|
+
|
|
4
|
+
const ezPopoverCss = ":host{--ez-popover__box--border-radius:var(--border--radius-medium, 12px);--ez-popover__box--box-shadow:var(--shadow, 0px 0px 16px 0px #000);--ez-popover__box--background-color:var(--background--xlight, #fff);--ez-popover__box--z-index:var(--more-visible, 1);position:relative;display:flex;user-select:none}.popover__box{z-index:var(--ez-popover__box--z-index);display:flex;flex-direction:column;height:fit-content;background-color:var(--ez-popover__box--background-color);border-radius:var(--ez-popover__box--border-radius);box-shadow:var(--ez-popover__box--box-shadow)}.popover__box--fit-content{width:fit-content}.popover__box--full-width{width:100%}";
|
|
5
|
+
|
|
6
|
+
let EzPopover = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.ezVisibilityChange = createEvent(this, "ezVisibilityChange", 7);
|
|
10
|
+
this._firstRender = true;
|
|
11
|
+
/**
|
|
12
|
+
* No modo floating = false o popover só se tornará visível
|
|
13
|
+
* quando o método show() for acionado.
|
|
14
|
+
*/
|
|
15
|
+
this.autoClose = true;
|
|
16
|
+
/**
|
|
17
|
+
* Offset top do popover em relação ao componente pai
|
|
18
|
+
*/
|
|
19
|
+
this.top = "0px";
|
|
20
|
+
/**
|
|
21
|
+
* Offset left do popover em relação ao componente pai
|
|
22
|
+
*/
|
|
23
|
+
this.left = "0px";
|
|
24
|
+
/**
|
|
25
|
+
* Offset bottom do popover em relação ao componente pai
|
|
26
|
+
*/
|
|
27
|
+
this.bottom = "0px";
|
|
28
|
+
/**
|
|
29
|
+
* Offset right do popover em relação ao componente pai
|
|
30
|
+
*/
|
|
31
|
+
this.right = "0px";
|
|
32
|
+
/**
|
|
33
|
+
* Ajusta o comportamento da largura do popover.
|
|
34
|
+
* Opções: "100% e "fit-content" (default)
|
|
35
|
+
*/
|
|
36
|
+
this.boxWidth = "fit-content";
|
|
37
|
+
this.innerClickTest = (_popOvercontainer, node, eventOrigin) => {
|
|
38
|
+
const innerContainers = [_popOvercontainer];
|
|
39
|
+
if (this.innerElement) {
|
|
40
|
+
if (typeof (this.innerElement) == "string") {
|
|
41
|
+
innerContainers.push(document.querySelector(`#${this.innerElement}`));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.innerElement.forEach(comp => {
|
|
45
|
+
innerContainers.push(document.querySelector(`#${comp}`));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
for (var i = 0; i < innerContainers.length; i++) {
|
|
50
|
+
let _container = innerContainers[i];
|
|
51
|
+
if (_container != undefined) {
|
|
52
|
+
if (_container.contains(node)) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
if (eventOrigin && "nodeType" in (eventOrigin === null || eventOrigin === void 0 ? void 0 : eventOrigin.target) && _container.contains(eventOrigin.target)) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (_container.shadowRoot && _container.shadowRoot.contains(node)) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
_container = this._host;
|
|
62
|
+
if (!_container.lastElementChild.shadowRoot ? _container.contains(node) : _container.lastElementChild.shadowRoot.contains(node)) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
};
|
|
69
|
+
this.backClickListener = () => {
|
|
70
|
+
this.ezVisibilityChange.emit(false);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
observeOpened(newValue, oldValue) {
|
|
74
|
+
if (newValue != oldValue) {
|
|
75
|
+
if (oldValue) {
|
|
76
|
+
this.hide();
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.show();
|
|
80
|
+
}
|
|
81
|
+
this.ezVisibilityChange.emit(newValue);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Atualiza a posição do popover em relação ao componente pai.
|
|
86
|
+
*/
|
|
87
|
+
async updatePosition(top = this.top, left = this.left, bottom = this.bottom, right = this.right) {
|
|
88
|
+
const floatingOptions = {
|
|
89
|
+
autoClose: this.autoClose,
|
|
90
|
+
top,
|
|
91
|
+
left,
|
|
92
|
+
bottom,
|
|
93
|
+
right,
|
|
94
|
+
innerClickTest: this.innerClickTest,
|
|
95
|
+
backClickListener: this.backClickListener
|
|
96
|
+
};
|
|
97
|
+
FloatingManager.updateFloatPosition(this._box, this._container, floatingOptions);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Faz com que o popover seja renderizado na DOM.
|
|
101
|
+
*/
|
|
102
|
+
async show(top = this.top, left = this.left, bottom = this.bottom, right = this.right) {
|
|
103
|
+
const floatingOptions = {
|
|
104
|
+
autoClose: this.autoClose,
|
|
105
|
+
top,
|
|
106
|
+
left,
|
|
107
|
+
bottom,
|
|
108
|
+
right,
|
|
109
|
+
innerClickTest: this.innerClickTest,
|
|
110
|
+
backClickListener: this.backClickListener
|
|
111
|
+
};
|
|
112
|
+
this._floatingID = FloatingManager.float(this._box, this._container, floatingOptions);
|
|
113
|
+
this.opened = true;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Usado no modo floating. Faz com que o componente seja ocultado.
|
|
117
|
+
*/
|
|
118
|
+
async hide() {
|
|
119
|
+
if (this._floatingID !== undefined) {
|
|
120
|
+
FloatingManager.close(this._floatingID);
|
|
121
|
+
this._floatingID = undefined;
|
|
122
|
+
this.opened = false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
componentDidRender() {
|
|
126
|
+
if (this._firstRender) {
|
|
127
|
+
this._box.remove();
|
|
128
|
+
this._firstRender = false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
render() {
|
|
132
|
+
return (h(Host, null, h("section", { ref: el => this._container = el }, h("div", { class: `popover__box ${this.boxWidth === "fit-content" ? "popover__box--fit-content" : "popover__box--full-width"}`, ref: el => this._box = el }, h("slot", null)))));
|
|
133
|
+
}
|
|
134
|
+
get _host() { return getElement(this); }
|
|
135
|
+
static get watchers() { return {
|
|
136
|
+
"opened": ["observeOpened"]
|
|
137
|
+
}; }
|
|
138
|
+
};
|
|
139
|
+
EzPopover.style = ezPopoverCss;
|
|
140
|
+
|
|
141
|
+
export { EzPopover as ez_popover };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, f as Host } from './index-1e9d524f.js';
|
|
2
|
+
|
|
3
|
+
const ezPopupCss = ":host{display:flex;--ez-popup-z-index:var(--most-visible, 3);--ez-popup__container--color:var(--title--primary, #2b3a54);--ez-popup__container--padding:var(--space--large, 24px);--ez-popup__header--padding-bottom:var(--space--medium, 12px);--ez-popup__title--font-family:var(--font-pattern, \"'Sora', 'Algerian'\");--ez-popup__title--font-size:var(--title--extra-large, 24px);--ez-popup__title--color:var(--title--primary, #2b3a54);--ez-popup__title--font-weight:var(--text-weight--large, 600);--ez-popup__btn__close--icon-color:var(--title--primary, #2b3a54);--ez-popup__btn__close--icon:url('data:image/svg+xml;utf8,<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z\"/></svg>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--ez-popup-z-index);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;height:100%;display:flex;flex-wrap:wrap;overflow:hidden;background:#FFFF;color:var(--ez-popup__container--color);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--ez-popup__container--padding)}.popup__content{box-sizing:border-box;max-height:100%;width:100%;display:grid;grid-template-rows:auto 1fr}.popup__expandable-content{box-sizing:border-box;overflow-y:auto;height:100%;width:100%}.popup__header{padding-bottom:var(--ez-popup__header--padding-bottom);width:100%;display:flex}.popup__title{display:flex;margin:0;width:100%;font-family:var(--ez-popup__title--font-family);font-size:var(--ez-popup__title--font-size);font-weight:var(--ez-popup__title--font-weight);color:var(--ez-popup__title--color);line-height:1.3}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--ez-popup__btn__close--icon-color);width:14px;height:14px;-webkit-mask-image:var(--ez-popup__btn__close--icon);mask-image:var(--ez-popup__btn__close--icon)}.btn-close--solo{width:100%}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
4
|
+
|
|
5
|
+
let EzPopup = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.ezClosePopup = createEvent(this, "ezClosePopup", 7);
|
|
9
|
+
this._sizeClasses = {
|
|
10
|
+
"x-small": "col--sd-3",
|
|
11
|
+
"small": "col--sd-5",
|
|
12
|
+
"medium": "col--sd-6",
|
|
13
|
+
"large": "col--sd-9",
|
|
14
|
+
"x-large": "col--sd-11"
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Define o width que o componente deve ter, seguindo o grid system. Os valores devem estar
|
|
18
|
+
* compreendidos em [x-small | small | medium | large | x-large].
|
|
19
|
+
*/
|
|
20
|
+
this.size = "medium";
|
|
21
|
+
/**
|
|
22
|
+
* Controla a exibição do componente.
|
|
23
|
+
*/
|
|
24
|
+
this.opened = false;
|
|
25
|
+
/**
|
|
26
|
+
* Define se o componente utilizará um cabeçalho com botão de fechamento.
|
|
27
|
+
*/
|
|
28
|
+
this.useHeader = false;
|
|
29
|
+
}
|
|
30
|
+
getGridSize() {
|
|
31
|
+
return this._sizeClasses[this.size] || this._sizeClasses["medium"];
|
|
32
|
+
}
|
|
33
|
+
componentDidRender() {
|
|
34
|
+
if (this._container) {
|
|
35
|
+
this._container.focus();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
if (this.opened) {
|
|
40
|
+
return (h(Host, null, h("div", { class: "overlay" }, h("div", { class: "popup col " + this.getGridSize() }, h("div", { class: "popup__container", ref: elem => this._container = elem, tabIndex: -1 }, h("div", { class: "popup__content" }, h("div", { class: "popup__header" }, this.ezTitle ?
|
|
41
|
+
h("div", { class: "popup__title" }, this.ezTitle)
|
|
42
|
+
: undefined, h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } })), h("div", { class: "popup__expandable-content" }, h("slot", null))))))));
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
EzPopup.style = ezPopupCss;
|
|
48
|
+
|
|
49
|
+
export { EzPopup as ez_popup };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-1e9d524f.js';
|
|
2
|
+
|
|
3
|
+
const ezRadioButtonCss = ":host{--ez-radio-button--font-family:var(--font-pattern, Arial);--ez-radio-button--font-size:var(--text--large, 16px);--ez-radio-button--font-weight:var(--text-weight--large);--ez-radio-button--font-color:var(--title--primary, #2B3A54);--ez-radio-button__form-label--font-family:var(--font-pattern, Arial);--ez-radio-button__form-label--font-weight:var(--text-weight--medium, 400);--ez-radio-button__form-label--title-primary:var(--title--primary, #2B3A54);--ez-radio-button__form-label--font-size:var(--text--medium, 14px);--ez-radio-button__form-radio--border-color:var(--title--primary, #2B3A54);--ez-radio-button__form-radio--checked--color:var(--color--primary, #008561);--ez-radio-button__form-radio--disabled--border-color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--disabled--background-color:var(--background--medium, #f0f3f7);--ez-radio-button__form-radio--disabled--color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--disabled--before--background-color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--focus--background-color:var(--color--inverted, #fff);--ez-radio-button__form-radio--checked--box-shadow-color:var(--background--strong, #e4eaf1);--ez-radio-button__form-radio--checked--focus--background-color:var(--color--inverted, #fff);--ez-radio-button__form-radio--checked--focus--box-shadow-color:var(--color--primary-300, #e2f4ef);--ez-radio-button__form-radio--checked--hover--background-color:var(--color--inverted, #fff);--ez-radio-button__form-radio--checked--hover--box-shadow-color:#daece7;--ez-radio-button__form-radio--hover--box-shadow-color:var(--color--strokes, #dce0e8);--ez-radio-button__form-radio--checked--disabled--hover--background-color:var(--background--medium, #f0f3f7);display:flex;width:100%;margin:10px;flex-direction:column;align-items:flex-start}.form--vertical{display:flex;flex-direction:column}.form--horizontal{display:flex;flex-direction:row}.form__group{display:flex;align-items:center;margin-top:15px}.label{font-family:var(--ez-radio-button--font-family);font-size:var(--ez-radio-button--font-size);font-weight:var(--ez-radio-button--font-weight);color:var(--ez-radio-button--font-color)}.form__label{cursor:pointer;padding-left:12px;padding-right:25px;font-weight:var(--ez-radio-button__form-label--font-weight);color:var(--ez-radio-button__form-label--title-primary);font-family:var(--ez-radio-button__form-label--font-family);font-size:var(--ez-radio-button__form-label--font-size)}.form__radio{cursor:pointer;appearance:none;outline:none;position:relative;display:flex;align-items:center;justify-content:center;margin:0;padding:0;width:18px;height:18px;border-radius:50%;border:2px solid var(--ez-radio-button__form-radio--border-color)}.form__radio::before{content:'';display:block;position:absolute;opacity:0;transition:all 300ms ease-in-out;height:calc(18px/2);width:calc(18px/2);border-radius:50%;background:var(--ez-radio-button__form-radio--checked--color)}.form__radio:checked:before{opacity:1}.form__radio:checked{border:2px solid var(--ez-radio-button__form-radio--checked--color)}.form__radio:disabled{cursor:default;border:2px solid var(--ez-radio-button__form-radio--disabled--border-color);background-color:var(--ez-radio-button__form-radio--disabled--background-color)}.form__radio:disabled:hover{box-shadow:inherit}input[type=radio]:disabled~label{cursor:default;color:var(--ez-radio-button__form-radio--disabled--color)}.form__radio:disabled:before{background:var(--ez-radio-button__form-radio--disabled--before--background-color)}.form__radio:focus{transition:0.25s linear;background-color:var(--ez-radio-button__form-radio--focus--background-color);box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--checked--box-shadow-color)}.form__radio:checked:focus{transition:0.25s linear;background-color:var(--ez-radio-button__form-radio--checked--focus--background-color);box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--checked--focus--box-shadow-color)}.form__radio:checked:hover{transition:0.25s linear;background-color:var(--ez-radio-button__form-radio--checked--hover--background-color);box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--checked--hover--box-shadow-color)}.form__radio:hover{transition:0.25s linear;box-shadow:0px 0px 0px 6px var(--ez-radio-button__form-radio--hover--box-shadow-color)}.form__radio:checked:disabled:hover{box-shadow:none;background-color:var(--ez-radio-button__form-radio--checked--disabled--hover--background-color)}";
|
|
4
|
+
|
|
5
|
+
let EzRadioButton = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.ezChange = createEvent(this, "ezChange", 7);
|
|
9
|
+
/**
|
|
10
|
+
* Define as opções que serão apresentadas
|
|
11
|
+
*/
|
|
12
|
+
this.options = [];
|
|
13
|
+
/**
|
|
14
|
+
* Define se o componente está habilitado ou desabilitado
|
|
15
|
+
*/
|
|
16
|
+
this.enabled = true;
|
|
17
|
+
/**
|
|
18
|
+
* Define a direção em que os itens são apresentadoss, podendo ser horizontal ou vertical.
|
|
19
|
+
*/
|
|
20
|
+
this.direction = "vertical";
|
|
21
|
+
}
|
|
22
|
+
componentWillLoad() {
|
|
23
|
+
this._options = this.options;
|
|
24
|
+
const optionsTags = this.hostElement.querySelectorAll("ez-radio-button-option");
|
|
25
|
+
if (optionsTags) {
|
|
26
|
+
optionsTags.forEach(e => {
|
|
27
|
+
let label = e.getAttribute("label");
|
|
28
|
+
let value = e.getAttribute("value");
|
|
29
|
+
this._options.push({ label, value });
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
handleInputChange(ev) {
|
|
34
|
+
const slot = ev.target;
|
|
35
|
+
this.value = slot.value;
|
|
36
|
+
this.ezChange.emit(this.value);
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return (h(Host, null, this.label && h("label", { class: "label" }, this.label), h("div", { class: "form--" + this.direction }, this._options.map((option, key) => h("div", { class: "form__group" }, h("input", { id: "rad" + key, class: "form__radio", name: "theradio", type: "radio", value: option.value, onChange: (ev) => { this.handleInputChange(ev); }, disabled: !this.enabled, checked: option.value === this.value }), h("label", { htmlFor: "rad" + key, class: "form__label" }, option.label))))));
|
|
40
|
+
}
|
|
41
|
+
get hostElement() { return getElement(this); }
|
|
42
|
+
};
|
|
43
|
+
EzRadioButton.style = ezRadioButtonCss;
|
|
44
|
+
|
|
45
|
+
export { EzRadioButton as ez_radio_button };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-1e9d524f.js';
|
|
2
|
+
|
|
3
|
+
var EzScrollDirection;
|
|
4
|
+
(function (EzScrollDirection) {
|
|
5
|
+
EzScrollDirection["HORIZONTAL"] = "horizontal";
|
|
6
|
+
EzScrollDirection["VERTICAL"] = "vertical";
|
|
7
|
+
EzScrollDirection["BOTH"] = "both";
|
|
8
|
+
})(EzScrollDirection || (EzScrollDirection = {}));
|
|
9
|
+
|
|
10
|
+
const ezScrollerCss = ":host{display:flex;cursor:grab}.dragging{cursor:grabbing}.ez-scroller__container{display:flex;flex-direction:column;overflow:hidden}.ez-scroller__container--horizontal{flex-direction:row;overflow-y:hidden;overflow-x:auto}.ez-scroller__container--vertical{overflow-y:auto;overflow-x:hidden}.ez-scroller__container--both{overflow:auto}::-webkit-scrollbar-track{background-color:var(--scrollbar--secondary);border-radius:var(--border--radius-small);visibility:hidden}::-webkit-scrollbar-thumb{background-color:#00000000;border-radius:var(--border--radius-small);background-color:var(--scrollbar--primary)}:hover::-webkit-scrollbar-thumb{background-color:var(--scrollbar--primary)}::-webkit-scrollbar{background-color:#00000000;width:var(--space--small);height:var(--space--small);max-width:var(--space--small);min-width:var(--space--small)}:hover::-webkit-scrollbar{background-color:var(--scrollbar--secondary)}";
|
|
11
|
+
|
|
12
|
+
let EzScroller = class {
|
|
13
|
+
constructor(hostRef) {
|
|
14
|
+
registerInstance(this, hostRef);
|
|
15
|
+
/**
|
|
16
|
+
* Determina se haverá scroll na direção Vertical, Horizontal ou Ambos.
|
|
17
|
+
* Por padrão, a direção é "Ambos".
|
|
18
|
+
*/
|
|
19
|
+
this.direction = EzScrollDirection.BOTH;
|
|
20
|
+
}
|
|
21
|
+
//---------------------------------------------
|
|
22
|
+
// Private methods
|
|
23
|
+
//---------------------------------------------
|
|
24
|
+
getContainerClass() {
|
|
25
|
+
return `ez-scroller__container ez-scroller__container--${this.direction}`;
|
|
26
|
+
}
|
|
27
|
+
finishDrag() {
|
|
28
|
+
this._container.classList.remove("dragging");
|
|
29
|
+
}
|
|
30
|
+
//---------------------------------------------
|
|
31
|
+
// Event handlers
|
|
32
|
+
//---------------------------------------------
|
|
33
|
+
clickListener(evt) {
|
|
34
|
+
if (this._controller && this._controller.didScroll()) {
|
|
35
|
+
evt.preventDefault();
|
|
36
|
+
evt.stopPropagation();
|
|
37
|
+
evt.stopImmediatePropagation();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
mouseDownHandler(evt) {
|
|
41
|
+
if (!this._controller) {
|
|
42
|
+
this._controller = new ScrollCtrl(this._container);
|
|
43
|
+
}
|
|
44
|
+
this._controller.startDragg(evt);
|
|
45
|
+
this._container.classList.add("dragging");
|
|
46
|
+
}
|
|
47
|
+
mouseUpHandler() {
|
|
48
|
+
this.finishDrag();
|
|
49
|
+
}
|
|
50
|
+
mouseMoveHandler(evt) {
|
|
51
|
+
if (this._controller) {
|
|
52
|
+
if (evt.buttons === 0) {
|
|
53
|
+
this.finishDrag();
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this._controller.doScroll(evt);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
return (h("div", { ref: ref => this._container = ref, class: this.getContainerClass() }, h("slot", null)));
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
class ScrollCtrl {
|
|
65
|
+
constructor(scrollablePanel) {
|
|
66
|
+
this.scrollablePanel = scrollablePanel;
|
|
67
|
+
}
|
|
68
|
+
startDragg(evt) {
|
|
69
|
+
this.startX = this.measureX(evt);
|
|
70
|
+
this.startY = this.measureY(evt);
|
|
71
|
+
this.scrollWidth = 0;
|
|
72
|
+
this.scrollHeight = 0;
|
|
73
|
+
}
|
|
74
|
+
measureX(e) {
|
|
75
|
+
return e.pageX - this.scrollablePanel.offsetLeft;
|
|
76
|
+
}
|
|
77
|
+
measureY(e) {
|
|
78
|
+
return e.pageY - this.scrollablePanel.offsetTop;
|
|
79
|
+
}
|
|
80
|
+
doScroll(e) {
|
|
81
|
+
const x = this.measureX(e);
|
|
82
|
+
const y = this.measureY(e);
|
|
83
|
+
if (x != this.startX || y != this.startY) {
|
|
84
|
+
const scrollX = x - this.startX;
|
|
85
|
+
const scrollY = y - this.startY;
|
|
86
|
+
this.startX += scrollX;
|
|
87
|
+
this.startY += scrollY;
|
|
88
|
+
this.scrollWidth += Math.abs(scrollX);
|
|
89
|
+
this.scrollHeight += Math.abs(scrollY);
|
|
90
|
+
this.scrollablePanel.scrollLeft = Math.max(0, this.scrollablePanel.scrollLeft - scrollX);
|
|
91
|
+
this.scrollablePanel.scrollTop = Math.max(0, this.scrollablePanel.scrollTop - scrollY);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
didScroll() {
|
|
95
|
+
const tollerance = 5;
|
|
96
|
+
return this.scrollHeight > tollerance || this.scrollWidth > tollerance;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
EzScroller.style = ezScrollerCss;
|
|
100
|
+
|
|
101
|
+
export { EzScroller as ez_scroller };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, g as getElement } from './index-1e9d524f.js';
|
|
2
|
+
import { C as CSSVarsUtils } from './CSSVarsUtils-499b75c2.js';
|
|
3
|
+
|
|
4
|
+
const ezSearchCss = ":host{width:100%}";
|
|
5
|
+
|
|
6
|
+
let EzSearch = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.ezChange = createEvent(this, "ezChange", 7);
|
|
10
|
+
this.showPopup = createEvent(this, "showPopup", 7);
|
|
11
|
+
/**
|
|
12
|
+
* Deixa o campo disponível ou não.
|
|
13
|
+
*/
|
|
14
|
+
this.enabled = true;
|
|
15
|
+
/**
|
|
16
|
+
* Ajusta a opção de mostrar o "value" ao selecionar uma opção.
|
|
17
|
+
*/
|
|
18
|
+
this.showSelectedValue = true;
|
|
19
|
+
/**
|
|
20
|
+
* Ajusta a opção de mostrar o "value" para cada opção.
|
|
21
|
+
*/
|
|
22
|
+
this.showOptionValue = true;
|
|
23
|
+
/**
|
|
24
|
+
* Remove a opção vazia da lista de opções
|
|
25
|
+
*/
|
|
26
|
+
this.suppressEmptyOption = false;
|
|
27
|
+
/**
|
|
28
|
+
* Define o modo do tamanho do campo; opções: slim e regular.
|
|
29
|
+
*/
|
|
30
|
+
this.mode = "regular";
|
|
31
|
+
}
|
|
32
|
+
observeErrorMessage() {
|
|
33
|
+
if (this._comboElement) {
|
|
34
|
+
this._comboElement.errorMessage = this.errorMessage;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
observeValue() {
|
|
38
|
+
if (this._comboElement) {
|
|
39
|
+
this._comboElement.value = this.value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Realiza o foco no componente de pesquisa
|
|
44
|
+
*/
|
|
45
|
+
async setFocus() {
|
|
46
|
+
this._comboElement.setFocus();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Remove o foco no componente de pesquisa
|
|
50
|
+
*/
|
|
51
|
+
async setBlur() {
|
|
52
|
+
this._comboElement.setBlur();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Retorna informando se o campo está inválido (true | false)
|
|
56
|
+
*/
|
|
57
|
+
async isInvalid() {
|
|
58
|
+
return typeof this.errorMessage === "string" && this.errorMessage.trim() !== "";
|
|
59
|
+
}
|
|
60
|
+
onComboChange(event) {
|
|
61
|
+
event.stopPropagation();
|
|
62
|
+
this.value = event.detail;
|
|
63
|
+
this.ezChange.emit(event.detail);
|
|
64
|
+
if (this.errorMessage !== this._comboElement.errorMessage) {
|
|
65
|
+
this.errorMessage = this._comboElement.errorMessage;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
componentDidLoad() {
|
|
69
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._comboElement);
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
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: event => this.onComboChange(event), showSelectedValue: this.showSelectedValue, showOptionValue: this.showOptionValue, suppressEmptyOption: this.suppressEmptyOption, mode: this.mode }));
|
|
73
|
+
}
|
|
74
|
+
;
|
|
75
|
+
get _elem() { return getElement(this); }
|
|
76
|
+
static get watchers() { return {
|
|
77
|
+
"errorMessage": ["observeErrorMessage"],
|
|
78
|
+
"value": ["observeValue"]
|
|
79
|
+
}; }
|
|
80
|
+
};
|
|
81
|
+
EzSearch.style = ezSearchCss;
|
|
82
|
+
|
|
83
|
+
export { EzSearch as ez_search };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { r as registerInstance, e as createEvent, h } from './index-1e9d524f.js';
|
|
2
|
+
|
|
3
|
+
const ezSelectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
|
|
4
|
+
|
|
5
|
+
let SelectBox = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.ezChange = createEvent(this, "ezChange", 7);
|
|
9
|
+
this.selectedOption = { value: "na", label: "N/A" };
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (h("ez-combo-box", { class: "grid-config-combo ez-input--inverted", label: "", suppressSearch: true, value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true }, h("option", { value: "na" }, "N/A"), h("option", { value: "asc" }, "A-Z"), h("option", { value: "desc" }, "Z-A")));
|
|
13
|
+
}
|
|
14
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
15
|
+
};
|
|
16
|
+
SelectBox.style = ezSelectBoxCss;
|
|
17
|
+
|
|
18
|
+
export { SelectBox as ez_select_box };
|