@sankhyalabs/ezui 1.1.70 → 1.1.73
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/assets/actions-sprite.svg +257 -0
- package/dist/cjs/CSSVarsUtils-f8827674.js +18 -0
- package/dist/cjs/ez-action-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-button_16.cjs.entry.js +13 -6
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-label-chip.cjs.entry.js +1 -1
- package/dist/cjs/ez-list.cjs.entry.js +174 -0
- package/dist/cjs/ez-modal.cjs.entry.js +1 -1
- package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +7 -70
- package/dist/cjs/ez-toast.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +2 -2
- package/dist/cjs/{index-0f668cc5.js → index-4d2896bb.js} +10 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/assets/actions-sprite.svg +257 -0
- package/dist/collection/components/ez-button/ez-button.css +4 -1
- package/dist/collection/components/ez-button/ez-button.js +5 -2
- package/dist/collection/components/ez-date-input/ez-date-input.css +0 -9
- package/dist/collection/components/ez-date-input/ez-date-input.js +5 -1
- package/dist/collection/components/ez-list/ez-list.css +131 -0
- package/dist/collection/components/ez-list/ez-list.js +252 -0
- package/dist/collection/components/ez-time-input/ez-time-input.css +0 -168
- package/dist/collection/components/ez-time-input/ez-time-input.js +8 -75
- package/dist/collection/utils/CSSVarsUtils.js +14 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +204 -76
- package/dist/esm/CSSVarsUtils-e0128b01.js +16 -0
- package/dist/esm/ez-action-chip.entry.js +1 -1
- package/dist/esm/ez-button_16.entry.js +13 -6
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-label-chip.entry.js +1 -1
- package/dist/esm/ez-list.entry.js +170 -0
- package/dist/esm/ez-modal.entry.js +1 -1
- package/dist/esm/ez-number-input.entry.js +1 -1
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +7 -70
- package/dist/esm/ez-toast.entry.js +1 -1
- package/dist/esm/ezui.js +2 -2
- package/dist/esm/{index-89fc9bfd.js → index-33153059.js} +10 -2
- package/dist/esm/loader.js +2 -2
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-061d21ba.entry.js +1 -0
- package/dist/ezui/{p-8d547517.entry.js → p-0db8d49b.entry.js} +1 -1
- package/dist/ezui/{p-1c33a56d.entry.js → p-129b53df.entry.js} +1 -1
- package/dist/ezui/{p-a88ee12f.entry.js → p-15743b09.entry.js} +1 -1
- package/dist/ezui/p-25953d44.entry.js +1 -0
- package/dist/ezui/p-4df6f855.js +1 -0
- package/dist/ezui/{p-a7e23f65.entry.js → p-50464bdf.entry.js} +1 -1
- package/dist/ezui/{p-1bc9ddad.entry.js → p-67410dfa.entry.js} +1 -1
- package/dist/ezui/p-74809665.entry.js +1 -0
- package/dist/ezui/{p-74e4415e.entry.js → p-7f3bc6d9.entry.js} +1 -1
- package/dist/ezui/{p-b692a0ab.entry.js → p-8818da66.entry.js} +1 -1
- package/dist/ezui/{p-9702db61.entry.js → p-a99f8d42.entry.js} +1 -1
- package/dist/ezui/p-d1889704.js +1 -0
- package/dist/types/components/ez-date-input/ez-date-input.d.ts +1 -0
- package/dist/types/components/ez-list/ez-list.d.ts +34 -0
- package/dist/types/components/ez-time-input/ez-time-input.d.ts +1 -8
- package/dist/types/components.d.ts +42 -0
- package/dist/types/utils/CSSVarsUtils.d.ts +4 -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-762ac7a0.js +0 -1
- package/dist/ezui/p-b6e0fd3e.entry.js +0 -1
- package/dist/ezui/p-f7d7fb7f.entry.js +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Component, Prop, h, Watch, Host, Method } from
|
|
2
|
-
import { TimeFormatter, MaskFormatter, NumberUtils } from
|
|
1
|
+
import { Element, Component, Prop, h, Watch, Host, Method, getAssetPath } from "@stencil/core";
|
|
2
|
+
import { TimeFormatter, MaskFormatter, NumberUtils } from "@sankhyalabs/core";
|
|
3
|
+
import CSSVarsUtils from "../../utils/CSSVarsUtils";
|
|
3
4
|
export class EzTimeInput {
|
|
4
5
|
constructor() {
|
|
5
6
|
/**
|
|
@@ -11,17 +12,6 @@ export class EzTimeInput {
|
|
|
11
12
|
*/
|
|
12
13
|
this.showSeconds = false;
|
|
13
14
|
}
|
|
14
|
-
showError() {
|
|
15
|
-
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
16
|
-
if (hasError) {
|
|
17
|
-
this._inputElem.classList.add('hasError');
|
|
18
|
-
this._messageBoxElem.classList.add('hasError');
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
this._inputElem.classList.remove('hasError');
|
|
22
|
-
this._messageBoxElem.classList.remove('hasError');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
15
|
prepareMask() {
|
|
26
16
|
if (this.showSeconds) {
|
|
27
17
|
if (this._maskFormatter == undefined) {
|
|
@@ -40,23 +30,6 @@ export class EzTimeInput {
|
|
|
40
30
|
}
|
|
41
31
|
}
|
|
42
32
|
}
|
|
43
|
-
adjustFloatingLabel() {
|
|
44
|
-
if (this.label) {
|
|
45
|
-
if (!this._inputElem.classList.contains("input--with--label")) {
|
|
46
|
-
this._inputElem.classList.add("input--with--label");
|
|
47
|
-
}
|
|
48
|
-
if (this.viewValue && this.viewValue.toString().length > 0) {
|
|
49
|
-
if (!this._labelElem.classList.contains("input__label--floated")) {
|
|
50
|
-
this._labelElem.classList.add("input__label--floated");
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
if (this._labelElem.classList.contains("input__label--floated")) {
|
|
55
|
-
this._labelElem.classList.remove("input__label--floated");
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
33
|
onValueChanged() {
|
|
61
34
|
if (this.value === NaN) {
|
|
62
35
|
this.value = undefined;
|
|
@@ -79,12 +52,6 @@ export class EzTimeInput {
|
|
|
79
52
|
this._inputElem.blur();
|
|
80
53
|
}
|
|
81
54
|
//---------------------------------------------
|
|
82
|
-
// Test Methods
|
|
83
|
-
//---------------------------------------------
|
|
84
|
-
setInputElemnt(input) {
|
|
85
|
-
this._iconElement = input;
|
|
86
|
-
}
|
|
87
|
-
//---------------------------------------------
|
|
88
55
|
// Event handlers
|
|
89
56
|
//---------------------------------------------
|
|
90
57
|
handleFocusout() {
|
|
@@ -94,7 +61,6 @@ export class EzTimeInput {
|
|
|
94
61
|
this.clearField();
|
|
95
62
|
this.errorMessage = "Favor inserir um horário válido.";
|
|
96
63
|
}
|
|
97
|
-
this.adjustFloatingLabel();
|
|
98
64
|
}
|
|
99
65
|
prepareValue(value) {
|
|
100
66
|
try {
|
|
@@ -112,40 +78,12 @@ export class EzTimeInput {
|
|
|
112
78
|
this.viewValue = this._inputElem.value;
|
|
113
79
|
this.value = NumberUtils.stringToNumber(this.viewValue.replace(/\D/g, ""));
|
|
114
80
|
}
|
|
115
|
-
adjustIconStyle() {
|
|
116
|
-
if (this._iconElement) {
|
|
117
|
-
this._iconElement.style.position = "absolute";
|
|
118
|
-
this._iconElement.style.display = "flex";
|
|
119
|
-
this._iconElement.style.alignItems = "center";
|
|
120
|
-
this._iconElement.style.justifyContent = "center";
|
|
121
|
-
this._iconElement.style.overflow = "hidden";
|
|
122
|
-
this._iconElement.style.top = "0px";
|
|
123
|
-
this._iconElement.style.width = "var(--eztime__icon--width)";
|
|
124
|
-
this._iconElement.style.height = "var(--eztime--height)";
|
|
125
|
-
this._iconElement.style.left = "0px";
|
|
126
|
-
this._iconElement.style.borderRadius = "var(--eztime--border-radius) 0 0 var(--eztime--border-radius)";
|
|
127
|
-
this._inputElem.classList.add('icon--left');
|
|
128
|
-
if (this._labelElem) {
|
|
129
|
-
this._labelElem.classList.add("input__label--left");
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
this.showError();
|
|
133
|
-
}
|
|
134
|
-
doFocus() {
|
|
135
|
-
if (this.label && this._labelElem) {
|
|
136
|
-
if (!this._labelElem.classList.contains("input__label--floated")) {
|
|
137
|
-
this._labelElem.classList.add("input__label--floated");
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
81
|
//---------------------------------------------
|
|
142
82
|
// Lifecycle web component
|
|
143
83
|
//---------------------------------------------
|
|
144
84
|
componentDidLoad() {
|
|
145
85
|
this.onValueChanged();
|
|
146
|
-
this.
|
|
147
|
-
this.adjustFloatingLabel();
|
|
148
|
-
this.showError();
|
|
86
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._inputElem);
|
|
149
87
|
}
|
|
150
88
|
componentWillLoad() {
|
|
151
89
|
this.prepareMask();
|
|
@@ -158,12 +96,8 @@ export class EzTimeInput {
|
|
|
158
96
|
}
|
|
159
97
|
render() {
|
|
160
98
|
return (h(Host, null,
|
|
161
|
-
h("ez-
|
|
162
|
-
|
|
163
|
-
h("label", { onClick: () => this._inputElem.focus(), class: this.value ? "input__label input__label--floated" : "input__label", ref: (el) => this._labelElem = el, title: this.label }, this.label)
|
|
164
|
-
: null,
|
|
165
|
-
h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.viewValue, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }),
|
|
166
|
-
h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el }, this.errorMessage)));
|
|
99
|
+
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 },
|
|
100
|
+
h("ez-icon", { slot: "leftIcon", href: getAssetPath("./assets/actions-sprite.svg") + "#timer-outline" }))));
|
|
167
101
|
}
|
|
168
102
|
static get is() { return "ez-time-input"; }
|
|
169
103
|
static get encapsulation() { return "shadow"; }
|
|
@@ -173,6 +107,7 @@ export class EzTimeInput {
|
|
|
173
107
|
static get styleUrls() { return {
|
|
174
108
|
"$": ["ez-time-input.css"]
|
|
175
109
|
}; }
|
|
110
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
176
111
|
static get properties() { return {
|
|
177
112
|
"label": {
|
|
178
113
|
"type": "string",
|
|
@@ -313,10 +248,8 @@ export class EzTimeInput {
|
|
|
313
248
|
}
|
|
314
249
|
}
|
|
315
250
|
}; }
|
|
251
|
+
static get elementRef() { return "_elem"; }
|
|
316
252
|
static get watchers() { return [{
|
|
317
|
-
"propName": "errorMessage",
|
|
318
|
-
"methodName": "showError"
|
|
319
|
-
}, {
|
|
320
253
|
"propName": "showSeconds",
|
|
321
254
|
"methodName": "prepareMask"
|
|
322
255
|
}, {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default class CSSVarsUtils {
|
|
2
|
+
static applyVarsTextInput(host, textInput) {
|
|
3
|
+
if (textInput) {
|
|
4
|
+
CSSVarsUtils.applyIfExists(host, textInput, '--text-input__input--background-color');
|
|
5
|
+
CSSVarsUtils.applyIfExists(host, textInput, '--text-input__input--border-color');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
static applyIfExists(host, textInput, varName) {
|
|
9
|
+
const prop = getComputedStyle(host).getPropertyValue(varName);
|
|
10
|
+
if (prop) {
|
|
11
|
+
textInput.style.setProperty(varName, prop);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -68,6 +68,12 @@ export const EzLabelChip: {
|
|
|
68
68
|
new (): EzLabelChip;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
+
interface EzList extends Components.EzList, HTMLElement {}
|
|
72
|
+
export const EzList: {
|
|
73
|
+
prototype: EzList;
|
|
74
|
+
new (): EzList;
|
|
75
|
+
};
|
|
76
|
+
|
|
71
77
|
interface EzModal extends Components.EzModal, HTMLElement {}
|
|
72
78
|
export const EzModal: {
|
|
73
79
|
prototype: EzModal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createEvent, h, forceUpdate, Host, proxyCustomElement } from '@stencil/core/internal/client';
|
|
1
|
+
import { createEvent, h, forceUpdate, Host, getAssetPath, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
2
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
3
3
|
|
|
4
4
|
const ezActionChipCss = ":host{--ac--height:36px;--ac--border-radius:var(--border--radius-large, 24px);--ac__border:1px solid;--ac__border-color-strokes:var(--color--strokes, #DCE0E8);--ac--font-size:var(--text--medium, 14px);--ac--font-family:var(--font-pattern, Arial);--ac--font-weight:var(--text-weight--large, 500);--ac__label--title--primary:var(--title--primary, #919191);--ac__label-color--disable-secondary:var(--color--disable-secondary, #F2F5F8);--ac__label__default--background-color--hover:var(--color--primary-200, #f2faf8);--ac__label__default--border-color--hover:var(--color--primary-600, #007a5a)}.label__container{width:fit-content;display:flex;flex-wrap:wrap;position:relative;background-color:#FFFFFF;align-items:center;align-self:center;cursor:pointer;color:var(--ac__label--title--primary);fill:var(--ac__label--title--primary);border:var(--ac__border);border-radius:var(--ac--border-radius);border-color:var(--ac__border-color-strokes);padding-right:var(--space--medium, 12px);padding-left:var(--space--medium, 12px)}.label__container:hover{border-color:var(--ac__label__default--border-color--hover);background-color:var(--ac__label__default--background-color--hover)}label{display:flex;align-items:center;font-weight:var(--text-weight--large, 600);cursor:pointer;height:var(--ac--height);font-family:var(--ac--font-family);font-size:var(--ac--font-size)}";
|
|
@@ -23,7 +23,7 @@ let EzLabelChip$2 = class extends HTMLElement {
|
|
|
23
23
|
static get style() { return ezActionChipCss; }
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const ezButtonCss = ":host{--button--min-width:100px;--button--height:42px;--button__icon--width:18px;--button__inline__icon--padding:12px;--button--padding-top:var(--space--medium, 12px);--button--padding-bottom:var(--space--medium, 12px);--button--padding-right:var(--space--large, 24px);--button--padding-left:var(--space--large, 24px);--button--color:var(--text--primary, #FFF);--button--font-size:var(--text--medium, 14px);--button--font-family:var(--font-pattern, Arial);--button--font-weight:var(--text-weight--large);--button--background-color:var(--background--medium, #c0c0c0);--button--border-radius:var(--border--radius-large, 12px);--button--border:none;--button--hover--background-color:var(--background--strong, var(--button--background-color));--button--disabled-color:var(--text--disable);--button--disabled--background-color:var(--color--disable-secondary);--button--focus--border:var(--button--border);--button--focus--box-shadow:none;--button--link-color:var(--title--primary, '#C0C0C0')}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--button--min-width);height:var(--button--height);font-family:var(--button--font-family);font-size:var(--button--font-size);font-weight:var(--button--font-weight);padding:var(--button--padding-top) var(--button--padding-right) var(--button--padding-bottom) var(--button--padding-left);border-radius:var(--button--border-radius);background-color:var(--button--background-color);color:var(--button--color);fill:var(--button--color);border:var(--button--border)}button:hover{background-color:var(--button--hover--background-color)}button:focus{outline:none;border:var(--button--focus--border);box-shadow:var(--button--focus--box-shadow)}button:disabled{background-color:var(--button--disabled--background-color);color:var(--button--disabled-color);fill:var(--button--disabled-color);border:none;cursor:no-drop}button.icon{width:42px;min-width:42px;height:42px;padding:0px
|
|
26
|
+
const ezButtonCss = ":host{--button--min-width:100px;--button--height:42px;--button__icon--width:18px;--button__inline__icon--padding:12px;--button--padding-top:var(--space--medium, 12px);--button--padding-bottom:var(--space--medium, 12px);--button--padding-right:var(--space--large, 24px);--button--padding-left:var(--space--large, 24px);--button--color:var(--text--primary, #FFF);--button--font-size:var(--text--medium, 14px);--button--font-family:var(--font-pattern, Arial);--button--font-weight:var(--text-weight--large);--button--background-color:var(--background--medium, #c0c0c0);--button--border-radius:var(--border--radius-large, 12px);--button--border:none;--button--hover--background-color:var(--background--strong, var(--button--background-color));--button--disabled-color:var(--text--disable);--button--disabled--background-color:var(--color--disable-secondary);--button--focus--border:var(--button--border);--button--focus--box-shadow:none;--button--link-color:var(--title--primary, '#C0C0C0')}ez-icon{--ez-icon--color:inherit}button{display:flex;align-items:center;justify-content:center;margin:0;cursor:pointer;transition:background-color 0.2s linear;min-width:var(--button--min-width);height:var(--button--height);font-family:var(--button--font-family);font-size:var(--button--font-size);font-weight:var(--button--font-weight);padding:var(--button--padding-top) var(--button--padding-right) var(--button--padding-bottom) var(--button--padding-left);border-radius:var(--button--border-radius);background-color:var(--button--background-color);color:var(--button--color);fill:var(--button--color);border:var(--button--border)}button:hover{background-color:var(--button--hover--background-color)}button:focus{outline:none;border:var(--button--focus--border);box-shadow:var(--button--focus--box-shadow)}button:disabled{background-color:var(--button--disabled--background-color);color:var(--button--disabled-color);fill:var(--button--disabled-color);border:none;cursor:no-drop}button.icon{width:42px;min-width:42px;height:42px;padding:0px}a{font-family:var(--button--font-family);font-size:var(--button--font-size);font-weight:var(--button--font-weight);color:var(--button--link-color);cursor:pointer;display:flex;align-items:center;justify-content:center;}";
|
|
27
27
|
|
|
28
28
|
let EzButton$1 = class extends HTMLElement {
|
|
29
29
|
constructor() {
|
|
@@ -40,9 +40,9 @@ let EzButton$1 = class extends HTMLElement {
|
|
|
40
40
|
this.mode = "regular";
|
|
41
41
|
}
|
|
42
42
|
handleSlotChange(ev) {
|
|
43
|
+
const slot = ev.target;
|
|
44
|
+
const content = slot.assignedElements()[0];
|
|
43
45
|
if (this.mode == "link") {
|
|
44
|
-
const slot = ev.target;
|
|
45
|
-
const content = slot.assignedElements()[0];
|
|
46
46
|
content.style.display = "inline";
|
|
47
47
|
if (slot.name == "leftIcon") {
|
|
48
48
|
content.style.paddingRight = "var(--button__inline__icon--padding)";
|
|
@@ -51,6 +51,9 @@ let EzButton$1 = class extends HTMLElement {
|
|
|
51
51
|
content.style.paddingLeft = "var(--button__inline__icon--padding)";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
else {
|
|
55
|
+
content.style.setProperty('--ez-icon--color', 'var(--ez-icon--color)');
|
|
56
|
+
}
|
|
54
57
|
}
|
|
55
58
|
render() {
|
|
56
59
|
if (this.mode == "icon") {
|
|
@@ -1227,7 +1230,22 @@ let EzComboBox$1 = class extends HTMLElement {
|
|
|
1227
1230
|
static get style() { return ezComboBoxCss; }
|
|
1228
1231
|
};
|
|
1229
1232
|
|
|
1230
|
-
|
|
1233
|
+
class CSSVarsUtils {
|
|
1234
|
+
static applyVarsTextInput(host, textInput) {
|
|
1235
|
+
if (textInput) {
|
|
1236
|
+
CSSVarsUtils.applyIfExists(host, textInput, '--text-input__input--background-color');
|
|
1237
|
+
CSSVarsUtils.applyIfExists(host, textInput, '--text-input__input--border-color');
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
static applyIfExists(host, textInput, varName) {
|
|
1241
|
+
const prop = getComputedStyle(host).getPropertyValue(varName);
|
|
1242
|
+
if (prop) {
|
|
1243
|
+
textInput.style.setProperty(varName, prop);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
const ezDateInputCss = ":host{display:block;width:100%;--di__calendar-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"15px\"><path d=\"M 3.171875,5.25 C 2.6485088,5.25 2.21875,5.6797588 2.21875,6.203125 2.21875,6.7264912 2.6485088,7.15625 3.171875,7.15625 3.6952412,7.15625 4.125,6.7264912 4.125,6.203125 4.125,5.6797588 3.6952412,5.25 3.171875,5.25 Z m 2.875,0 C 5.5235088,5.25 5.09375,5.6797588 5.09375,6.203125 5.09375,6.7264912 5.5235088,7.15625 6.046875,7.15625 6.5702412,7.15625 7,6.7264912 7,6.203125 7,5.6797588 6.5702412,5.25 6.046875,5.25 Z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.9511719,-0.4297588 0.9511719,-0.953125 C 9.8730469,5.6797588 9.4452412,5.25 8.921875,5.25 Z m 2.873047,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.953125 0.953125,0.953125 0.523366,0 0.953125,-0.4297588 0.953125,-0.953125 C 12.748047,5.6797588 12.318288,5.25 11.794922,5.25 Z M 3.171875,8.1230469 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 0.5233662,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297588,0.9531251 0.953125,0.9531251 C 6.5702412,10.029297 7,9.5995381 7,9.0761719 7,8.5528057 6.5702412,8.1230469 6.046875,8.1230469 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.4297587,0.9531251 0.953125,0.9531251 0.5233661,0 0.9531249,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.4297588 -0.953125,0.953125 0,0.5233662 0.429759,0.9531251 0.953125,0.9531251 0.523367,0 0.953125,-0.4297589 0.953125,-0.9531251 0,-0.5233662 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.171875,10.998047 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 0.5233662,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.875,0 c -0.5233662,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297588,0.953125 0.953125,0.953125 C 6.5702412,12.904297 7,12.474538 7,11.951172 7,11.427806 6.5702412,10.998047 6.046875,10.998047 Z m 2.8554688,0 c -0.5233663,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.4297587,0.953125 0.953125,0.953125 0.5233661,0 0.9531249,-0.429759 0.953125,-0.953125 0,-0.523366 -0.4297588,-0.953125 -0.953125,-0.953125 z m 2.9003902,0 c -0.523366,0 -0.953125,0.429759 -0.953125,0.953125 0,0.523366 0.429759,0.953125 0.953125,0.953125 0.523367,0 0.953125,-0.429759 0.953125,-0.953125 0,-0.523366 -0.429758,-0.953125 -0.953125,-0.953125 z M 3.5,0 c -0.554,0 -1,0.446 -1,1 v 0.050781 C 1.0853217,1.2909766 0,2.5186658 0,4 v 9 c 0,1.652487 1.3475134,3 3,3 h 9 c 1.652487,0 3,-1.347513 3,-3 V 4 C 15,2.5186658 13.914678,1.2909766 12.5,1.0507812 V 1 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 c 0,-0.554 -0.446,-1 -1,-1 -0.554,0 -1,0.446 -1,1 h -2 C 4.5,0.446 4.054,0 3.5,0 Z m 1,2.0996094 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -0.640625 h 2 v 0.640625 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 V 2.1738281 C 13.311725,2.3905225 13.900391,3.11278 13.900391,4 v 9 c 0,1.062113 -0.838278,1.900391 -1.900391,1.900391 H 3 C 1.9378864,14.900391 1.0996094,14.062113 1.0996094,13 V 4 C 1.0996094,3.11278 1.6882747,2.3905225 2.5,2.1738281 v 0.5664063 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 z\"/></svg>')}.btn-open-cal{outline:none;border:none;background-color:unset;cursor:pointer}.btn-open-cal:disabled{cursor:unset}.btn-open-cal::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:15px;height:16px;-webkit-mask-image:var(--di__calendar-image);mask-image:var(--di__calendar-image)}.btn-open-cal:disabled:after{background-color:var(--text--disable, #AFB6C0)}.btn-open-cal:enabled:hover::after{background-color:var(--color--primary, #4e4e4e)}";
|
|
1231
1249
|
|
|
1232
1250
|
let EzDateInput$1 = class extends HTMLElement {
|
|
1233
1251
|
constructor() {
|
|
@@ -1290,8 +1308,11 @@ let EzDateInput$1 = class extends HTMLElement {
|
|
|
1290
1308
|
getTextValue(d) {
|
|
1291
1309
|
return d ? new Intl.DateTimeFormat('pt-BR').format(d) : null;
|
|
1292
1310
|
}
|
|
1311
|
+
componentDidLoad() {
|
|
1312
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._textInput);
|
|
1313
|
+
}
|
|
1293
1314
|
render() {
|
|
1294
|
-
return (h(Host, null, h("ez-text-input", {
|
|
1315
|
+
return (h(Host, null, h("ez-text-input", { ref: elem => this._textInput = elem, onBlur: () => this.parseDate(), onKeyDown: event => {
|
|
1295
1316
|
if (event.key === 'H' || event.key === 'h')
|
|
1296
1317
|
this.changeValue(new Date());
|
|
1297
1318
|
}, 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 })));
|
|
@@ -3850,6 +3871,175 @@ let EzLabelChip$1 = class extends HTMLElement {
|
|
|
3850
3871
|
static get style() { return ezLabelChipCss; }
|
|
3851
3872
|
};
|
|
3852
3873
|
|
|
3874
|
+
const ezListCss = ":host{--list__host--border-radius:var(--border--radius-medium, 12px);--list__host--padding:var(--space--medium, 12px);--list__icon__padding:var(--space--small, 6px);--list__item__margin:0 var(--space--small, 6px);--list__item--color:var(--title--primary, #2b3a54);--list__item--border-bottom:var(--border--small, 1px solid);--list__item--border-color:var(--title--primary, #2b3a54);--list__item--font-family:var(--font-pattern, #2b3a54);--list__item--font-size:var(--text--medium, 14px);--list__draggable__icon--image:url('data:image/svg+xml;utf8,<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m 12,16 a 2,2 0 0 1 2,2 2,2 0 0 1 -2,2 2,2 0 0 1 -2,-2 2,2 0 0 1 2,-2 m 0,-6 a 2,2 0 0 1 2,2 2,2 0 0 1 -2,2 2,2 0 0 1 -2,-2 2,2 0 0 1 2,-2 m 0,-6 a 2,2 0 0 1 2,2 2,2 0 0 1 -2,2 2,2 0 0 1 -2,-2 2,2 0 0 1 2,-2 z\"/></svg>');border-radius:var(--list__host--border-radius);padding:var(--list__host--padding);max-height:100%;width:100%;background-color:#fff;display:flex}.draggable{cursor:pointer;display:flex;align-items:center;justify-content:flex-start;flex:1}.draggable-list{color:var(--text-color);padding:0;margin:0;width:100%;max-height:100%;overflow-y:auto}.draggable-list li{background-color:#fff;display:flex;margin:var(--list__item__margin);font-family:var(--list__item--font-family);font-size:var(--list__item--font-size);color:var(--list__item--color)}.draggable-list li:not(:last-of-type){border-bottom:var(--list__item--border-bottom)}.draggable-list li.over .draggable{background-color:var(--background--strong)}.draggable:hover{background-color:var(--background--medium)}.draggable-selected{background-color:var(--background--strong) !important}.draggable-selected div:hover{background-color:var(--background--strong) !important}.draggable-list::-webkit-scrollbar-track{background-color:#f0f2f5}.draggable-list::-webkit-scrollbar-thumb{background-color:var(--title--primary);border-radius:var(--space--extra-small)}.draggable-list::-webkit-scrollbar{background-color:#f0f2f5;height:6px;max-height:6px;min-height:6px;width:6px;max-width:6px;min-width:6px}.draggable-icon{align-items:flex-start;display:flex;outline:none;border:none;background-color:unset}.draggable-icon::after{content:'';display:flex;background-color:var(--list__item--color);width:24px;height:24px;-webkit-mask-image:var(--list__draggable__icon--image);mask-image:var(--list__draggable__icon--image)}*{box-sizing:border-box}.checkbox{width:fit-content}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}";
|
|
3875
|
+
|
|
3876
|
+
let EzList$1 = class extends HTMLElement {
|
|
3877
|
+
constructor() {
|
|
3878
|
+
super();
|
|
3879
|
+
this.__registerHost();
|
|
3880
|
+
this.__attachShadow();
|
|
3881
|
+
this._listItems = [];
|
|
3882
|
+
/**
|
|
3883
|
+
* Define a lista inicial do componente.
|
|
3884
|
+
*/
|
|
3885
|
+
this.initialList = [];
|
|
3886
|
+
/**
|
|
3887
|
+
* Define se o componente terá o comportamento de arrasto de linhas.
|
|
3888
|
+
*/
|
|
3889
|
+
this.draggable = true;
|
|
3890
|
+
/**
|
|
3891
|
+
* Define se é possível selecionar mais de um registro.
|
|
3892
|
+
*/
|
|
3893
|
+
this.isMultipleSelection = true;
|
|
3894
|
+
}
|
|
3895
|
+
createList() {
|
|
3896
|
+
[...this.initialList]
|
|
3897
|
+
.forEach((item, index) => {
|
|
3898
|
+
const listItem = document.createElement('li');
|
|
3899
|
+
listItem.setAttribute('data-index', index.toString());
|
|
3900
|
+
if (!this.isMultipleSelection)
|
|
3901
|
+
listItem.onclick = this.selectLine.bind(this);
|
|
3902
|
+
listItem.innerHTML = `
|
|
3903
|
+
<div class="draggable" ${this.draggable ? "draggable=true" : ""}>
|
|
3904
|
+
|
|
3905
|
+
${this.draggable ? '<span class="draggable-icon"></span>' : ""}
|
|
3906
|
+
|
|
3907
|
+
${this.isMultipleSelection ? `<ez-check class='checkbox' value=${item.checked}></ez-check>` : ''}
|
|
3908
|
+
<p title="${item.value}" class="person-name text--ellipsis">${item.value}</p>
|
|
3909
|
+
|
|
3910
|
+
</div>
|
|
3911
|
+
`;
|
|
3912
|
+
this._listItems.push(listItem);
|
|
3913
|
+
this._draggableList.appendChild(listItem);
|
|
3914
|
+
});
|
|
3915
|
+
if (this.draggable) {
|
|
3916
|
+
this.handleEventListeners(this._listItems, this._draggableList, this._hostElement, false);
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
selectLine(e) {
|
|
3920
|
+
var _a, _b, _c;
|
|
3921
|
+
this._listItems.forEach(item => { item.classList.remove('draggable-selected'); });
|
|
3922
|
+
if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.tagName) === 'SPAN') {
|
|
3923
|
+
const span = e.target;
|
|
3924
|
+
this._selectedItem = { value: span.parentElement.getElementsByTagName('p')[0].textContent };
|
|
3925
|
+
span.parentElement.parentElement.classList.add('draggable-selected');
|
|
3926
|
+
}
|
|
3927
|
+
else if (((_b = e.target) === null || _b === void 0 ? void 0 : _b.tagName) === 'P') {
|
|
3928
|
+
const paragraph = e.target;
|
|
3929
|
+
this._selectedItem = { value: paragraph.textContent };
|
|
3930
|
+
paragraph.parentElement.parentElement.classList.add('draggable-selected');
|
|
3931
|
+
}
|
|
3932
|
+
else if (((_c = e.target) === null || _c === void 0 ? void 0 : _c.tagName) === 'DIV') {
|
|
3933
|
+
const draggable = e.target;
|
|
3934
|
+
this._selectedItem = { value: draggable.getElementsByTagName('p')[0].textContent };
|
|
3935
|
+
draggable.parentElement.classList.add('draggable-selected');
|
|
3936
|
+
}
|
|
3937
|
+
}
|
|
3938
|
+
handleEventListeners(listItems, dragableList, hostElement, removeEvents) {
|
|
3939
|
+
let _dragStartIndex;
|
|
3940
|
+
let _isItemOut = false;
|
|
3941
|
+
function dragStart(item) {
|
|
3942
|
+
_dragStartIndex = item.parentElement.getAttribute('data-index');
|
|
3943
|
+
}
|
|
3944
|
+
function dragEnter(item) {
|
|
3945
|
+
item.classList.add('over');
|
|
3946
|
+
}
|
|
3947
|
+
function dragLeave(item) {
|
|
3948
|
+
item.classList.remove('over');
|
|
3949
|
+
}
|
|
3950
|
+
function dragOver(e) {
|
|
3951
|
+
e.preventDefault();
|
|
3952
|
+
}
|
|
3953
|
+
function dragDrop(item) {
|
|
3954
|
+
if (_isItemOut) {
|
|
3955
|
+
let index = +item.getAttribute('data-index');
|
|
3956
|
+
const itemRemoved = listItems[index].querySelector('.draggable');
|
|
3957
|
+
listItems[index].removeChild(itemRemoved);
|
|
3958
|
+
}
|
|
3959
|
+
const dragEndIndex = +item.getAttribute('data-index');
|
|
3960
|
+
swapItems(+_dragStartIndex, dragEndIndex);
|
|
3961
|
+
item.classList.remove('over');
|
|
3962
|
+
}
|
|
3963
|
+
function swapItems(fromIndex, toIndex) {
|
|
3964
|
+
const itemOne = listItems[fromIndex].querySelector('.draggable');
|
|
3965
|
+
const itemTwo = listItems[toIndex].querySelector('.draggable');
|
|
3966
|
+
listItems[fromIndex].appendChild(itemTwo);
|
|
3967
|
+
listItems[toIndex].appendChild(itemOne);
|
|
3968
|
+
return listItems;
|
|
3969
|
+
}
|
|
3970
|
+
if (!removeEvents) {
|
|
3971
|
+
hostElement.addEventListener('dragenter', function () { _isItemOut = false; });
|
|
3972
|
+
hostElement.addEventListener('dragleave', function () { _isItemOut = true; });
|
|
3973
|
+
const draggables = dragableList.querySelectorAll("div.draggable");
|
|
3974
|
+
draggables.forEach(draggable => {
|
|
3975
|
+
draggable.addEventListener('dragstart', function () { dragStart(draggable); });
|
|
3976
|
+
});
|
|
3977
|
+
listItems.forEach(item => {
|
|
3978
|
+
item.addEventListener('dragover', function (event) { dragOver(event); });
|
|
3979
|
+
item.addEventListener('drop', function () { dragDrop(item); });
|
|
3980
|
+
item.addEventListener('dragenter', function () { dragEnter(item); });
|
|
3981
|
+
item.addEventListener('dragleave', function () { dragLeave(item); });
|
|
3982
|
+
});
|
|
3983
|
+
}
|
|
3984
|
+
else {
|
|
3985
|
+
hostElement.removeEventListener('dragenter', function () { _isItemOut = false; });
|
|
3986
|
+
hostElement.removeEventListener('dragleave', function () { _isItemOut = true; });
|
|
3987
|
+
const draggables = dragableList.querySelectorAll("div.draggable");
|
|
3988
|
+
draggables.forEach(draggable => {
|
|
3989
|
+
draggable.removeEventListener('dragstart', function () { dragStart(draggable); });
|
|
3990
|
+
});
|
|
3991
|
+
listItems.forEach(item => {
|
|
3992
|
+
item.removeEventListener('dragover', function (event) { dragOver(event); });
|
|
3993
|
+
item.removeEventListener('drop', function () { dragDrop(item); });
|
|
3994
|
+
item.removeEventListener('dragenter', function () { dragEnter(item); });
|
|
3995
|
+
item.removeEventListener('dragleave', function () { dragLeave(item); });
|
|
3996
|
+
});
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3999
|
+
/**
|
|
4000
|
+
* Retorna uma promessa com o estado da atual lista composta por objetos do tipo {value: string, checked: boolean}.
|
|
4001
|
+
*/
|
|
4002
|
+
async getState() {
|
|
4003
|
+
let emitionList = [];
|
|
4004
|
+
this._listItems.forEach(item => {
|
|
4005
|
+
let emitionItem = {
|
|
4006
|
+
value: this.getValueItem(item),
|
|
4007
|
+
checked: this.getChecked(item)
|
|
4008
|
+
};
|
|
4009
|
+
emitionList.push(emitionItem);
|
|
4010
|
+
});
|
|
4011
|
+
return emitionList;
|
|
4012
|
+
}
|
|
4013
|
+
getChecked(item) {
|
|
4014
|
+
if (this.isMultipleSelection) {
|
|
4015
|
+
return item.children[0].children[1].value;
|
|
4016
|
+
}
|
|
4017
|
+
else {
|
|
4018
|
+
if (!this._selectedItem)
|
|
4019
|
+
return false;
|
|
4020
|
+
return (item.children[0].children[1].textContent === this._selectedItem.value);
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
getValueItem(item) {
|
|
4024
|
+
if (this.isMultipleSelection) {
|
|
4025
|
+
return item.children[0].children[2].textContent;
|
|
4026
|
+
}
|
|
4027
|
+
return item.children[0].children[1].textContent;
|
|
4028
|
+
}
|
|
4029
|
+
componentDidLoad() {
|
|
4030
|
+
this.createList();
|
|
4031
|
+
}
|
|
4032
|
+
disconnectedCallback() {
|
|
4033
|
+
if (this.draggable) {
|
|
4034
|
+
this.handleEventListeners(this._listItems, this._draggableList, this._hostElement, true);
|
|
4035
|
+
}
|
|
4036
|
+
}
|
|
4037
|
+
render() {
|
|
4038
|
+
return (h(Host, { ref: (el) => this._hostElement = el }, h("ul", { ref: (el) => this._draggableList = el, class: "draggable-list", id: "draggable-list" })));
|
|
4039
|
+
}
|
|
4040
|
+
static get style() { return ezListCss; }
|
|
4041
|
+
};
|
|
4042
|
+
|
|
3853
4043
|
const ezModalCss = ":host{--modal-z-index:var(--most-visible, 3);--modal-vertical-padding:var(--space--large, 24px);display:block}.modal{position:fixed;padding:var(--modal-vertical-padding) 0;display:flex;top:0px;z-index:var(--modal-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}@keyframes expand-modal--left{from{transform:translate(-100%)}}@keyframes expand-modal--right{from{transform:translate(100%)}}.modal__container{display:flex;flex-wrap:wrap;height:100%;box-sizing:border-box;width:100%;align-items:flex-start}.modal__container--right{animation:expand-modal--right .2s ease-in-out 1;justify-content:flex-end}.modal__container--left{animation:expand-modal--left .2s ease-in-out 1;justify-content:flex-start}.modal__content{display:flex;flex-wrap:wrap;max-height:calc(100% - 48px);height:100%;overflow-y:auto;background-color:rgb(255, 255, 255);padding:24px;border-radius:12px 0px 0px 12px;box-shadow:rgb(0 38 111 / 12%) 0px 0px 16px 0px}.modal__content--right{border-radius:12px 0px 0px 12px}.modal__content--left{border-radius:0px 12px 12px 0px}.modal__box__container{display:flex;flex-wrap:wrap;background-color:#fff;width:100%;border-radius:12px}.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%}}";
|
|
3854
4044
|
|
|
3855
4045
|
let EzModal$1 = class extends HTMLElement {
|
|
@@ -4910,7 +5100,7 @@ let EzTextInput$1 = class extends HTMLElement {
|
|
|
4910
5100
|
static get style() { return ezTextInputCss; }
|
|
4911
5101
|
};
|
|
4912
5102
|
|
|
4913
|
-
const ezTimeInputCss = ":host{
|
|
5103
|
+
const ezTimeInputCss = ":host{display:flex;flex-wrap:wrap;position:relative;width:100%}";
|
|
4914
5104
|
|
|
4915
5105
|
let EzTimeInput$1 = class extends HTMLElement {
|
|
4916
5106
|
constructor() {
|
|
@@ -4926,17 +5116,6 @@ let EzTimeInput$1 = class extends HTMLElement {
|
|
|
4926
5116
|
*/
|
|
4927
5117
|
this.showSeconds = false;
|
|
4928
5118
|
}
|
|
4929
|
-
showError() {
|
|
4930
|
-
const hasError = typeof this.errorMessage === 'string' && this.errorMessage !== '';
|
|
4931
|
-
if (hasError) {
|
|
4932
|
-
this._inputElem.classList.add('hasError');
|
|
4933
|
-
this._messageBoxElem.classList.add('hasError');
|
|
4934
|
-
}
|
|
4935
|
-
else {
|
|
4936
|
-
this._inputElem.classList.remove('hasError');
|
|
4937
|
-
this._messageBoxElem.classList.remove('hasError');
|
|
4938
|
-
}
|
|
4939
|
-
}
|
|
4940
5119
|
prepareMask() {
|
|
4941
5120
|
if (this.showSeconds) {
|
|
4942
5121
|
if (this._maskFormatter == undefined) {
|
|
@@ -4955,23 +5134,6 @@ let EzTimeInput$1 = class extends HTMLElement {
|
|
|
4955
5134
|
}
|
|
4956
5135
|
}
|
|
4957
5136
|
}
|
|
4958
|
-
adjustFloatingLabel() {
|
|
4959
|
-
if (this.label) {
|
|
4960
|
-
if (!this._inputElem.classList.contains("input--with--label")) {
|
|
4961
|
-
this._inputElem.classList.add("input--with--label");
|
|
4962
|
-
}
|
|
4963
|
-
if (this.viewValue && this.viewValue.toString().length > 0) {
|
|
4964
|
-
if (!this._labelElem.classList.contains("input__label--floated")) {
|
|
4965
|
-
this._labelElem.classList.add("input__label--floated");
|
|
4966
|
-
}
|
|
4967
|
-
}
|
|
4968
|
-
else {
|
|
4969
|
-
if (this._labelElem.classList.contains("input__label--floated")) {
|
|
4970
|
-
this._labelElem.classList.remove("input__label--floated");
|
|
4971
|
-
}
|
|
4972
|
-
}
|
|
4973
|
-
}
|
|
4974
|
-
}
|
|
4975
5137
|
onValueChanged() {
|
|
4976
5138
|
if (this.value === NaN) {
|
|
4977
5139
|
this.value = undefined;
|
|
@@ -4994,12 +5156,6 @@ let EzTimeInput$1 = class extends HTMLElement {
|
|
|
4994
5156
|
this._inputElem.blur();
|
|
4995
5157
|
}
|
|
4996
5158
|
//---------------------------------------------
|
|
4997
|
-
// Test Methods
|
|
4998
|
-
//---------------------------------------------
|
|
4999
|
-
setInputElemnt(input) {
|
|
5000
|
-
this._iconElement = input;
|
|
5001
|
-
}
|
|
5002
|
-
//---------------------------------------------
|
|
5003
5159
|
// Event handlers
|
|
5004
5160
|
//---------------------------------------------
|
|
5005
5161
|
handleFocusout() {
|
|
@@ -5009,7 +5165,6 @@ let EzTimeInput$1 = class extends HTMLElement {
|
|
|
5009
5165
|
this.clearField();
|
|
5010
5166
|
this.errorMessage = "Favor inserir um horário válido.";
|
|
5011
5167
|
}
|
|
5012
|
-
this.adjustFloatingLabel();
|
|
5013
5168
|
}
|
|
5014
5169
|
prepareValue(value) {
|
|
5015
5170
|
try {
|
|
@@ -5027,40 +5182,12 @@ let EzTimeInput$1 = class extends HTMLElement {
|
|
|
5027
5182
|
this.viewValue = this._inputElem.value;
|
|
5028
5183
|
this.value = NumberUtils.stringToNumber(this.viewValue.replace(/\D/g, ""));
|
|
5029
5184
|
}
|
|
5030
|
-
adjustIconStyle() {
|
|
5031
|
-
if (this._iconElement) {
|
|
5032
|
-
this._iconElement.style.position = "absolute";
|
|
5033
|
-
this._iconElement.style.display = "flex";
|
|
5034
|
-
this._iconElement.style.alignItems = "center";
|
|
5035
|
-
this._iconElement.style.justifyContent = "center";
|
|
5036
|
-
this._iconElement.style.overflow = "hidden";
|
|
5037
|
-
this._iconElement.style.top = "0px";
|
|
5038
|
-
this._iconElement.style.width = "var(--eztime__icon--width)";
|
|
5039
|
-
this._iconElement.style.height = "var(--eztime--height)";
|
|
5040
|
-
this._iconElement.style.left = "0px";
|
|
5041
|
-
this._iconElement.style.borderRadius = "var(--eztime--border-radius) 0 0 var(--eztime--border-radius)";
|
|
5042
|
-
this._inputElem.classList.add('icon--left');
|
|
5043
|
-
if (this._labelElem) {
|
|
5044
|
-
this._labelElem.classList.add("input__label--left");
|
|
5045
|
-
}
|
|
5046
|
-
}
|
|
5047
|
-
this.showError();
|
|
5048
|
-
}
|
|
5049
|
-
doFocus() {
|
|
5050
|
-
if (this.label && this._labelElem) {
|
|
5051
|
-
if (!this._labelElem.classList.contains("input__label--floated")) {
|
|
5052
|
-
this._labelElem.classList.add("input__label--floated");
|
|
5053
|
-
}
|
|
5054
|
-
}
|
|
5055
|
-
}
|
|
5056
5185
|
//---------------------------------------------
|
|
5057
5186
|
// Lifecycle web component
|
|
5058
5187
|
//---------------------------------------------
|
|
5059
5188
|
componentDidLoad() {
|
|
5060
5189
|
this.onValueChanged();
|
|
5061
|
-
this.
|
|
5062
|
-
this.adjustFloatingLabel();
|
|
5063
|
-
this.showError();
|
|
5190
|
+
CSSVarsUtils.applyVarsTextInput(this._elem, this._inputElem);
|
|
5064
5191
|
}
|
|
5065
5192
|
componentWillLoad() {
|
|
5066
5193
|
this.prepareMask();
|
|
@@ -5072,12 +5199,11 @@ let EzTimeInput$1 = class extends HTMLElement {
|
|
|
5072
5199
|
}
|
|
5073
5200
|
}
|
|
5074
5201
|
render() {
|
|
5075
|
-
return (h(Host, null, h("ez-
|
|
5076
|
-
h("label", { onClick: () => this._inputElem.focus(), class: this.value ? "input__label input__label--floated" : "input__label", ref: (el) => this._labelElem = el, title: this.label }, this.label)
|
|
5077
|
-
: null, h("input", { onFocus: () => this.doFocus(), ref: (el) => this._inputElem = el, type: "text", value: this.viewValue, disabled: !this.enabled, onInput: () => { this.handleChange(); }, onFocusout: () => { this.handleFocusout(); } }), h("span", { class: "message-box", ref: (el) => this._messageBoxElem = el }, this.errorMessage)));
|
|
5202
|
+
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: getAssetPath("./assets/actions-sprite.svg") + "#timer-outline" }))));
|
|
5078
5203
|
}
|
|
5204
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
5205
|
+
get _elem() { return this; }
|
|
5079
5206
|
static get watchers() { return {
|
|
5080
|
-
"errorMessage": ["showError"],
|
|
5081
5207
|
"showSeconds": ["prepareMask"],
|
|
5082
5208
|
"value": ["onValueChanged"]
|
|
5083
5209
|
}; }
|
|
@@ -5598,6 +5724,7 @@ const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"co
|
|
|
5598
5724
|
const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [0,"ez-form",{"metadataexecutor":[1],"loadexecutor":[1],"saveexecutor":[1],"removeexecutor":[1],"fieldsearchexecutor":[1],"ignoresavevalidation":[4],"metadata":[16],"slavemode":[4],"enabled":[4],"loading":[1540]}]);
|
|
5599
5725
|
const EzIcon = /*@__PURE__*/proxyCustomElement(EzIcon$1, [1,"ez-icon",{"size":[513],"href":[513]}]);
|
|
5600
5726
|
const EzLabelChip = /*@__PURE__*/proxyCustomElement(EzLabelChip$1, [1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540]}]);
|
|
5727
|
+
const EzList = /*@__PURE__*/proxyCustomElement(EzList$1, [1,"ez-list",{"initialList":[1040],"draggable":[4],"isMultipleSelection":[1540,"is-multiple-selection"]}]);
|
|
5601
5728
|
const EzModal = /*@__PURE__*/proxyCustomElement(EzModal$1, [1,"ez-modal",{"modalSize":[1,"modal-size"],"align":[1],"opened":[4],"closeEsc":[4,"close-esc"],"closeOutsideClick":[4,"close-outside-click"]}]);
|
|
5602
5729
|
const EzNumberInput = /*@__PURE__*/proxyCustomElement(NumberInput, [1,"ez-number-input",{"strvalue":[1025],"value":[1026],"label":[513],"enabled":[516],"errorMessage":[1537,"error-message"],"precision":[1538],"prettyprecision":[1538],"textleft":[516],"formatnumber":[513]}]);
|
|
5603
5730
|
const EzNumericInput = /*@__PURE__*/proxyCustomElement(EzNumericInput$1, [1,"ez-numeric-input",{"label":[513],"value":[1538],"enabled":[516],"errorMessage":[1537,"error-message"],"precision":[8],"prettyprecision":[8]}]);
|
|
@@ -5626,6 +5753,7 @@ const defineCustomElements = (opts) => {
|
|
|
5626
5753
|
EzForm,
|
|
5627
5754
|
EzIcon,
|
|
5628
5755
|
EzLabelChip,
|
|
5756
|
+
EzList,
|
|
5629
5757
|
EzModal,
|
|
5630
5758
|
EzNumberInput,
|
|
5631
5759
|
EzNumericInput,
|
|
@@ -5648,4 +5776,4 @@ const defineCustomElements = (opts) => {
|
|
|
5648
5776
|
}
|
|
5649
5777
|
};
|
|
5650
5778
|
|
|
5651
|
-
export { EzActionChip, EzButton, EzCalendar, EzCheck, EzCollapsibleBox, EzComboBox, EzDateInput, EzDialog, EzForm, EzIcon, EzLabelChip, EzModal, EzNumberInput, EzNumericInput, EzPopover, EzPopup, EzSearch, EzTabselector, EzTextArea, EzTextInput, EzTimeInput, EzToast, EzUpload, FormMetadata, PlaceHolder, defineCustomElements };
|
|
5779
|
+
export { EzActionChip, EzButton, EzCalendar, EzCheck, EzCollapsibleBox, EzComboBox, EzDateInput, EzDialog, EzForm, EzIcon, EzLabelChip, EzList, EzModal, EzNumberInput, EzNumericInput, EzPopover, EzPopup, EzSearch, EzTabselector, EzTextArea, EzTextInput, EzTimeInput, EzToast, EzUpload, FormMetadata, PlaceHolder, defineCustomElements };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
class CSSVarsUtils {
|
|
2
|
+
static applyVarsTextInput(host, textInput) {
|
|
3
|
+
if (textInput) {
|
|
4
|
+
CSSVarsUtils.applyIfExists(host, textInput, '--text-input__input--background-color');
|
|
5
|
+
CSSVarsUtils.applyIfExists(host, textInput, '--text-input__input--border-color');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
static applyIfExists(host, textInput, varName) {
|
|
9
|
+
const prop = getComputedStyle(host).getPropertyValue(varName);
|
|
10
|
+
if (prop) {
|
|
11
|
+
textInput.style.setProperty(varName, prop);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { CSSVarsUtils as C };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-33153059.js';
|
|
2
2
|
|
|
3
3
|
const ezActionChipCss = ":host{--ac--height:36px;--ac--border-radius:var(--border--radius-large, 24px);--ac__border:1px solid;--ac__border-color-strokes:var(--color--strokes, #DCE0E8);--ac--font-size:var(--text--medium, 14px);--ac--font-family:var(--font-pattern, Arial);--ac--font-weight:var(--text-weight--large, 500);--ac__label--title--primary:var(--title--primary, #919191);--ac__label-color--disable-secondary:var(--color--disable-secondary, #F2F5F8);--ac__label__default--background-color--hover:var(--color--primary-200, #f2faf8);--ac__label__default--border-color--hover:var(--color--primary-600, #007a5a)}.label__container{width:fit-content;display:flex;flex-wrap:wrap;position:relative;background-color:#FFFFFF;align-items:center;align-self:center;cursor:pointer;color:var(--ac__label--title--primary);fill:var(--ac__label--title--primary);border:var(--ac__border);border-radius:var(--ac--border-radius);border-color:var(--ac__border-color-strokes);padding-right:var(--space--medium, 12px);padding-left:var(--space--medium, 12px)}.label__container:hover{border-color:var(--ac__label__default--border-color--hover);background-color:var(--ac__label__default--background-color--hover)}label{display:flex;align-items:center;font-weight:var(--text-weight--large, 600);cursor:pointer;height:var(--ac--height);font-family:var(--ac--font-family);font-size:var(--ac--font-size)}";
|
|
4
4
|
|