@sankhyalabs/ezui 6.1.0-dev.30 → 6.1.0-dev.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ez-avatar.cjs.entry.js +4 -1
- package/dist/cjs/ez-chip.cjs.entry.js +51 -47
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-avatar/ez-avatar.js +21 -1
- package/dist/collection/components/ez-chip/ez-chip.css +102 -83
- package/dist/collection/components/ez-chip/ez-chip.js +158 -53
- package/dist/custom-elements/index.js +57 -50
- package/dist/esm/ez-avatar.entry.js +4 -1
- package/dist/esm/ez-chip.entry.js +51 -47
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-d8bdc3fd.entry.js +1 -0
- package/dist/ezui/p-fcdc7d0b.entry.js +1 -0
- package/dist/types/components/ez-avatar/ez-avatar.d.ts +3 -0
- package/dist/types/components/ez-chip/ez-chip.d.ts +32 -6
- package/dist/types/components.d.ts +52 -0
- package/package.json +1 -1
- package/dist/ezui/p-beb42de1.entry.js +0 -1
- package/dist/ezui/p-d5fb569d.entry.js +0 -1
|
@@ -4,8 +4,10 @@ export class EzAvatar {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.DECIMAL_PARSE_BASE = 10;
|
|
6
6
|
this.FONT_SIZE_BASE_CALC = 0.375;
|
|
7
|
+
this.DEFAULT_ICON_NAME = "account-outline";
|
|
7
8
|
this.name = undefined;
|
|
8
9
|
this.imageSrc = undefined;
|
|
10
|
+
this.iconName = undefined;
|
|
9
11
|
this.size = '100';
|
|
10
12
|
this.shape = 'circle';
|
|
11
13
|
this.isInteractive = false;
|
|
@@ -23,13 +25,14 @@ export class EzAvatar {
|
|
|
23
25
|
return `avatar avatar--${this.size} avatar--${this.shape} ${this.imageSrc ? 'avatar--has-image' : ''}`;
|
|
24
26
|
}
|
|
25
27
|
renderAvatarContent() {
|
|
28
|
+
var _a;
|
|
26
29
|
if (this.imageSrc) {
|
|
27
30
|
return h("img", { src: this.imageSrc, alt: this.name || 'Avatar', class: "avatar-image" });
|
|
28
31
|
}
|
|
29
32
|
if (this.name) {
|
|
30
33
|
return h("span", { class: "avatar-initial", "aria-hidden": "true" }, this.getInitial());
|
|
31
34
|
}
|
|
32
|
-
return h("ez-icon", { class: "avatar-icon", iconName:
|
|
35
|
+
return h("ez-icon", { class: "avatar-icon", iconName: (_a = this.iconName) !== null && _a !== void 0 ? _a : this.DEFAULT_ICON_NAME, fontSize: this.calcFontSize() });
|
|
33
36
|
}
|
|
34
37
|
async componentWillLoad() {
|
|
35
38
|
this.i18n = await initI18n();
|
|
@@ -88,6 +91,23 @@ export class EzAvatar {
|
|
|
88
91
|
"attribute": "image-src",
|
|
89
92
|
"reflect": true
|
|
90
93
|
},
|
|
94
|
+
"iconName": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"mutable": false,
|
|
97
|
+
"complexType": {
|
|
98
|
+
"original": "string",
|
|
99
|
+
"resolved": "string",
|
|
100
|
+
"references": {}
|
|
101
|
+
},
|
|
102
|
+
"required": false,
|
|
103
|
+
"optional": true,
|
|
104
|
+
"docs": {
|
|
105
|
+
"tags": [],
|
|
106
|
+
"text": "Nome do \u00EDcone que deve ser exibido no avatar."
|
|
107
|
+
},
|
|
108
|
+
"attribute": "icon-name",
|
|
109
|
+
"reflect": true
|
|
110
|
+
},
|
|
91
111
|
"size": {
|
|
92
112
|
"type": "string",
|
|
93
113
|
"mutable": false,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
/* dimensions */
|
|
3
3
|
/*@doc Define a altura do chip.*/
|
|
4
|
-
--ez-label-chip--height:
|
|
4
|
+
--ez-label-chip--height: 32px;
|
|
5
5
|
|
|
6
6
|
/* Label */
|
|
7
7
|
/*@doc Define o tamanho do label.*/
|
|
8
|
-
--ez-label-chip__label--font-size: var(--
|
|
8
|
+
--ez-label-chip__label--font-size: var(--font-size--default, 14px);
|
|
9
9
|
/*@doc Define a família da fonte do label.*/
|
|
10
10
|
--ez-label-chip__label--font-family: var(--font-pattern, Arial);
|
|
11
11
|
/*@doc Define o peso da fonte do label.*/
|
|
12
|
-
--ez-label-chip__label--font-weight: var(--
|
|
12
|
+
--ez-label-chip__label--font-weight: var(--font-weight--regular, 400);
|
|
13
13
|
/*@doc Define o espaçamento do label.*/
|
|
14
|
-
--ez-label-
|
|
14
|
+
--ez-label-chip__horizontal-padding: var(--space--8, 8px);
|
|
15
15
|
/*@doc Define a cor do texto.*/
|
|
16
|
-
--ez-label-chip__label--
|
|
16
|
+
--ez-label-chip__label--text--primary: var(--color--gray-70, #FFFFFF);
|
|
17
17
|
/*@doc Define a cor do ícone.*/
|
|
18
|
-
--ez-label-chip__label--
|
|
18
|
+
--ez-label-chip__label--icon--primary: var(--color--gray-70, #FFFFFF);
|
|
19
19
|
|
|
20
20
|
/* Label Container */
|
|
21
21
|
/*@doc Define o raio da borda do container do chip.*/
|
|
@@ -23,53 +23,46 @@
|
|
|
23
23
|
/*@doc Define o estilo da borda do container.*/
|
|
24
24
|
--ez-label-chip__label__container--border: 1px solid;
|
|
25
25
|
/*@doc Define a cor da borda do container.*/
|
|
26
|
-
--ez-label-chip__label__container--border-color-strokes:
|
|
26
|
+
--ez-label-chip__label__container--border-color-strokes: transparent;
|
|
27
27
|
/*@doc Define a cor do texto, do ícone do label e do botão de remoção (quando o chip está ativo).*/
|
|
28
28
|
--ez-label-chip__label__container--color-primary: var(--color--primary, #008561);
|
|
29
29
|
/*@doc Define a cor da borda e do fundo quando o chip está desativado.*/
|
|
30
|
-
--ez-label-chip__label__container-color--disable-secondary: var(--color--
|
|
31
|
-
/*@doc Define a cor de fundo do container
|
|
32
|
-
--ez-label-chip__label__container--background-color: var(--color--
|
|
30
|
+
--ez-label-chip__label__container-color--disable-secondary: var(--color--gray-80, #F9F9F9);
|
|
31
|
+
/*@doc Define a cor de fundo do container.*/
|
|
32
|
+
--ez-label-chip__label__container--background-color: var(--color--ocean-green-600, #008561);
|
|
33
33
|
/*@doc Define a cor da borda do container quando ativo.*/
|
|
34
34
|
--ez-label-chip__label__container--border-color: #0085610F;
|
|
35
|
-
|
|
36
|
-
--ez-label-chip__label__container--
|
|
37
|
-
/*@doc Define a cor do fundo do container quando o cursor está
|
|
38
|
-
--ez-label-chip__label__container--default--background-color--
|
|
35
|
+
/*@doc Define a cor da borda do container quando ativo.*/
|
|
36
|
+
--ez-label-chip__label__container--border-color-active: transparent;
|
|
37
|
+
/*@doc Define a cor do fundo do container quando o cursor está ativo.*/
|
|
38
|
+
--ez-label-chip__label__container--default--background-color--active: var(--color--ocean-green-700, #00684C);
|
|
39
39
|
/*@doc Define a cor do texto quando o cursor está sobre ele.*/
|
|
40
|
-
--ez-label-chip__label__container--default--color--
|
|
40
|
+
--ez-label-chip__label__container--default--color--active: var(--color--gray-70, #FFFFFF);
|
|
41
41
|
/*@doc Define a cor do texto e do ícone quando o chip está desabilitado.*/
|
|
42
|
-
--ez-label-chip__label__container--text--disabled: var(--
|
|
42
|
+
--ez-label-chip__label__container--text--disabled: var(--color--gray-300, #A4A5A7);
|
|
43
43
|
/*@doc Define a cor da borda quando o componente está ativo.*/
|
|
44
|
-
--ez-label-chip__label__container--default--border-color--active:
|
|
44
|
+
--ez-label-chip__label__container--default--border-color--active: transparent;
|
|
45
45
|
/*@doc Define a margem superior.*/
|
|
46
|
-
--ez-label-chip__label__container--default--margin-top: var(--space-extra-small,
|
|
46
|
+
--ez-label-chip__label__container--default--margin-top: var(--space-extra-small, 0px);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.
|
|
49
|
+
.label__text {
|
|
50
50
|
/*private*/
|
|
51
|
-
display: flex;
|
|
52
|
-
white-space: nowrap;
|
|
53
|
-
align-items: center;
|
|
54
51
|
cursor: pointer;
|
|
52
|
+
white-space: nowrap;
|
|
55
53
|
user-select: none;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
max-width: 100%;
|
|
56
57
|
|
|
57
58
|
/*public*/
|
|
58
|
-
color: var(--ez-label-chip__label--title--primary);
|
|
59
|
-
height: var(--ez-label-chip--height);
|
|
60
59
|
font-family: var(--ez-label-chip__label--font-family);
|
|
61
60
|
font-size: var(--ez-label-chip__label--font-size);
|
|
62
61
|
font-weight: var(--ez-label-chip__label--font-weight);
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
.
|
|
66
|
-
|
|
67
|
-
color: var(--ez-label-chip__label__container--default--color--hover);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.lbl--disabled {
|
|
71
|
-
/*public*/
|
|
72
|
-
color: var(--ez-label-chip__label__container--text--disabled);
|
|
64
|
+
.label__text--disabled {
|
|
65
|
+
cursor: not-allowed;
|
|
73
66
|
}
|
|
74
67
|
|
|
75
68
|
.label__container {
|
|
@@ -79,47 +72,40 @@
|
|
|
79
72
|
display: flex;
|
|
80
73
|
flex-wrap: wrap;
|
|
81
74
|
align-items: center;
|
|
82
|
-
|
|
75
|
+
gap: var(--space--4);
|
|
83
76
|
/*public*/
|
|
84
|
-
|
|
85
|
-
fill: var(--ez-label-chip__label--text--primary);
|
|
86
|
-
--ez-icon--color: var(--ez-label-chip__label--text--primary);
|
|
77
|
+
height: var(--ez-label-chip--height);
|
|
87
78
|
border: var(--ez-label-chip__label__container--border);
|
|
88
79
|
border-radius: var(--ez-label-chip__label__container--border-radius);
|
|
89
|
-
|
|
90
|
-
padding-right: var(--ez-label-chip__label--space--medium);
|
|
91
|
-
padding-left: var(--ez-label-chip__label--space--medium);
|
|
80
|
+
padding: 0 var(--ez-label-chip__horizontal-padding);
|
|
92
81
|
outline-color: var(--ez-label-chip__label__container--default--border-color--active);
|
|
93
82
|
margin-top: var(--ez-label-chip__label__container--default--margin-top);
|
|
94
83
|
}
|
|
95
84
|
|
|
96
|
-
.
|
|
97
|
-
|
|
98
|
-
display: flex;
|
|
99
|
-
align-items: center;
|
|
100
|
-
flex-wrap: wrap;
|
|
101
|
-
--ez-icon--color: var(--ez-label-chip__label--text--primary);
|
|
85
|
+
.label__container[data-size="default"] {
|
|
86
|
+
height: var(--ez-label-chip--height, 32px);
|
|
102
87
|
}
|
|
103
88
|
|
|
104
|
-
.label__container
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
--ez-icon--color: var(--ez-label-chip__label__container--text--disabled);
|
|
89
|
+
.label__container[data-size="medium"] {
|
|
90
|
+
height: 42px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.label__container[data-size="large"] {
|
|
94
|
+
height: 50px;
|
|
111
95
|
}
|
|
112
96
|
|
|
113
|
-
.label__container--
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
97
|
+
.label__container--row-reverse {
|
|
98
|
+
flex-direction: row-reverse;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.label__container--disabled {
|
|
102
|
+
cursor: not-allowed;
|
|
119
103
|
}
|
|
120
104
|
|
|
121
105
|
.label__container:hover {
|
|
122
|
-
|
|
106
|
+
-webkit-transition: 150ms -webkit-filter linear;
|
|
107
|
+
transition: 150ms filter linear, 150ms -webkit-filter linear;
|
|
108
|
+
filter: brightness(90%);
|
|
123
109
|
}
|
|
124
110
|
|
|
125
111
|
.label__container:focus {
|
|
@@ -127,41 +113,74 @@
|
|
|
127
113
|
box-shadow: 0 0 0 2px var(--ez-label-chip__label__container--default--border-color--active);
|
|
128
114
|
}
|
|
129
115
|
|
|
130
|
-
.label__container
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
background-color: var(--ez-label-chip__label__container-color--disable-secondary);
|
|
135
|
-
fill: var(--ez-label-chip__label__container--text--disabled);
|
|
136
|
-
color: var(--ez-label-chip__label__container--text--disabled);
|
|
137
|
-
--ez-icon--color: var(--ez-label-chip__label__container--text--disabled);
|
|
116
|
+
.label__container:active {
|
|
117
|
+
-webkit-transition: 150ms -webkit-filter linear;
|
|
118
|
+
transition: 150ms filter linear, 150ms -webkit-filter linear;
|
|
119
|
+
filter: brightness(85%);
|
|
138
120
|
}
|
|
139
121
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
122
|
+
/*PRIMARY*/
|
|
123
|
+
|
|
124
|
+
.label__container[data-color-type="primary"] ez-icon {
|
|
125
|
+
--ez-icon--color: var(--ez-label-chip__label--icon--primary);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host .label__container[data-color-type="primary"] ::slotted(ez-icon) {
|
|
129
|
+
--ez-icon--color: var(--ez-label-chip__label--icon--primary);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.label__container[data-color-type="primary"][data-color-state="default"] {
|
|
133
|
+
border-color: var(--ez-label-chip__label__container--border-color-strokes);
|
|
134
|
+
background-color: var(--ez-label-chip__label__container--background-color);
|
|
143
135
|
color: var(--ez-label-chip__label--text--primary);
|
|
144
|
-
fill: var(--ez-label-chip__label--text--primary);
|
|
145
|
-
--ez-icon--color: var(--ez-label-chip__label--text--primary);
|
|
146
136
|
}
|
|
147
137
|
|
|
148
|
-
.label__container
|
|
149
|
-
|
|
138
|
+
.label__container[data-color-type="primary"][data-color-state="active"] {
|
|
139
|
+
border-color: var(--ez-label-chip__label__container--border-color-active);
|
|
140
|
+
background-color: var(--ez-label-chip__label__container--default--background-color--active);
|
|
141
|
+
color: var(--ez-label-chip__label__container--default--color--active);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.label__container[data-color-type="primary"]:focus {
|
|
145
|
+
border-color: var(--ez-label-chip__label__container--default--border-color--active);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/*SECONDARY*/
|
|
149
|
+
|
|
150
|
+
.label__container[data-color-type="secondary"] ez-icon {
|
|
151
|
+
--ez-icon--color: var(--color--gray-300, #A4A5A7);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:host .label__container[data-color-type="secondary"] ::slotted(ez-icon) {
|
|
155
|
+
--ez-icon--color: var(--color--gray-300, #A4A5A7);
|
|
150
156
|
}
|
|
151
157
|
|
|
152
|
-
.label__container
|
|
153
|
-
|
|
158
|
+
.label__container[data-color-type="secondary"][data-color-state="default"] {
|
|
159
|
+
border-color: var(--color--gray-200, #D2D2D3);
|
|
160
|
+
background-color: var(--color--gray-70);
|
|
161
|
+
color: var(--color--ocean-green-1000, #00281D);
|
|
154
162
|
}
|
|
155
163
|
|
|
156
|
-
.label__container
|
|
157
|
-
|
|
158
|
-
|
|
164
|
+
.label__container[data-color-type="secondary"][data-color-state="active"] {
|
|
165
|
+
border-color: var(--color--gray-200, #D2D2D3);
|
|
166
|
+
background-color: var(--color--primary-300, #f2faf8);
|
|
167
|
+
color: var(--color--primary, #f2faf8);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.label__container[data-color-type="secondary"]:focus {
|
|
171
|
+
color: var(--color--primary, #007a5a);
|
|
172
|
+
}
|
|
159
173
|
|
|
174
|
+
/*DISABLED*/
|
|
160
175
|
|
|
161
|
-
.
|
|
162
|
-
|
|
176
|
+
.label__container[data-color-state="disabled"] {
|
|
177
|
+
border-color: var(--ez-label-chip__label__container-color--disable-secondary);
|
|
178
|
+
background-color: var(--ez-label-chip__label__container-color--disable-secondary);
|
|
179
|
+
color: var(--ez-label-chip__label__container--text--disabled);
|
|
180
|
+
cursor: not-allowed;
|
|
181
|
+
filter: none;
|
|
163
182
|
}
|
|
164
183
|
|
|
165
|
-
ez-icon {
|
|
166
|
-
--ez-icon--color:
|
|
184
|
+
.label__container[data-color-state="disabled"] ez-icon {
|
|
185
|
+
--ez-icon--color: var(--ez-label-chip__label__container--text--disabled);
|
|
167
186
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
1
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { h } from "@stencil/core";
|
|
3
3
|
export class EzChip {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.label = undefined;
|
|
@@ -7,8 +7,14 @@ export class EzChip {
|
|
|
7
7
|
this.removePosition = undefined;
|
|
8
8
|
this.mode = undefined;
|
|
9
9
|
this.value = false;
|
|
10
|
-
this.showNativeTooltip =
|
|
10
|
+
this.showNativeTooltip = false;
|
|
11
11
|
this.disableAutoUpdateValue = false;
|
|
12
|
+
this.maxWidth = undefined;
|
|
13
|
+
this.size = 'default';
|
|
14
|
+
this.iconNameLeft = undefined;
|
|
15
|
+
this.iconNameRight = undefined;
|
|
16
|
+
this.type = 'primary';
|
|
17
|
+
this._isOverflowing = false;
|
|
12
18
|
}
|
|
13
19
|
//---------------------------------------------
|
|
14
20
|
// Public methods
|
|
@@ -25,54 +31,46 @@ export class EzChip {
|
|
|
25
31
|
async setBlur() {
|
|
26
32
|
this._containerElem.blur();
|
|
27
33
|
}
|
|
28
|
-
//---------------------------------------------
|
|
29
|
-
// Event handlers
|
|
30
|
-
//---------------------------------------------
|
|
31
|
-
handleSlotChange(ev) {
|
|
32
|
-
const slot = ev.target;
|
|
33
|
-
const content = slot.assignedElements()[0];
|
|
34
|
-
content.style.setProperty("--ez-icon--color", "var(--ez-icon--color)");
|
|
35
|
-
}
|
|
36
34
|
handleValueChange() {
|
|
37
35
|
this.swichState();
|
|
38
36
|
this.valueChange.emit(this.value);
|
|
39
37
|
}
|
|
40
|
-
handleClick(
|
|
41
|
-
|
|
42
|
-
if (!this.enabled)
|
|
38
|
+
handleClick() {
|
|
39
|
+
if (!this.enabled) {
|
|
43
40
|
return;
|
|
44
|
-
|
|
41
|
+
}
|
|
42
|
+
if (this.mode === "action") {
|
|
45
43
|
return this.actionClick.emit();
|
|
46
|
-
|
|
44
|
+
}
|
|
45
|
+
if (!this.disableAutoUpdateValue) {
|
|
47
46
|
return this.handleValueChange();
|
|
48
|
-
if (target.classList.contains("btn-close"))
|
|
49
|
-
return this.removeChip.emit();
|
|
50
|
-
}
|
|
51
|
-
swichState() {
|
|
52
|
-
if (this.enabled) {
|
|
53
|
-
this.value = !this.value;
|
|
54
47
|
}
|
|
55
48
|
}
|
|
56
|
-
|
|
57
|
-
if (this.
|
|
58
|
-
return
|
|
49
|
+
handleClickRemoveButton(event) {
|
|
50
|
+
if (!this.enabled) {
|
|
51
|
+
return;
|
|
59
52
|
}
|
|
60
|
-
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
this.removeChip.emit();
|
|
61
55
|
}
|
|
62
|
-
|
|
63
|
-
(this.
|
|
56
|
+
handleIconClick(event, icon) {
|
|
57
|
+
if (!this.enabled) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
event.stopPropagation();
|
|
61
|
+
this.iconClick.emit({ icon });
|
|
64
62
|
}
|
|
65
|
-
|
|
63
|
+
swichState() {
|
|
66
64
|
if (this.enabled) {
|
|
67
|
-
this.
|
|
68
|
-
this._labelElem.classList.remove("lbl--disabled");
|
|
69
|
-
this._labelElem.classList.remove("cursor-disable");
|
|
65
|
+
this.value = !this.value;
|
|
70
66
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this._labelElem.
|
|
67
|
+
}
|
|
68
|
+
checkIsOverflowing() {
|
|
69
|
+
if (this._labelElem) {
|
|
70
|
+
this._isOverflowing = this._labelElem.offsetWidth < this._labelElem.scrollWidth;
|
|
71
|
+
return;
|
|
75
72
|
}
|
|
73
|
+
this._isOverflowing = false;
|
|
76
74
|
}
|
|
77
75
|
//---------------------------------------------
|
|
78
76
|
// Lifecycle web component
|
|
@@ -82,14 +80,27 @@ export class EzChip {
|
|
|
82
80
|
ElementIDUtils.addIDInfo(this._element, 'ezChip');
|
|
83
81
|
}
|
|
84
82
|
if (this._containerElem) {
|
|
85
|
-
this.observeValue();
|
|
86
|
-
this.observeEnabled();
|
|
87
83
|
this._containerElem.setAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME, ElementIDUtils.getInternalIDInfo('button'));
|
|
88
84
|
}
|
|
85
|
+
this.checkIsOverflowing();
|
|
89
86
|
}
|
|
90
87
|
render() {
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
let colorState = 'default';
|
|
89
|
+
if (!this.enabled) {
|
|
90
|
+
colorState = 'disabled';
|
|
91
|
+
}
|
|
92
|
+
else if (this.value && this.mode !== "action") {
|
|
93
|
+
colorState = 'active';
|
|
94
|
+
}
|
|
95
|
+
return (h("ez-tooltip", { active: this.showNativeTooltip || this._isOverflowing, message: this.label }, h("button", { ref: (el) => this._containerElem = el, class: {
|
|
96
|
+
"label__container--row-reverse": this.removePosition === "left",
|
|
97
|
+
"label__container": true,
|
|
98
|
+
}, "data-color-state": colorState, "data-color-type": this.type, "data-size": this.size, onClick: () => this.handleClick(), style: {
|
|
99
|
+
maxWidth: this.maxWidth
|
|
100
|
+
} }, this.iconNameLeft && (h("ez-icon", { size: "medium", "icon-name": this.iconNameLeft, onClick: (event) => this.handleIconClick(event, 'left') })), h("slot", { name: "leftIcon" }), h("label", { ref: (el) => this._labelElem = el, class: {
|
|
101
|
+
"label__text--disabled": !this.enabled,
|
|
102
|
+
"label__text": true,
|
|
103
|
+
} }, this.label), h("slot", { name: "rightIcon" }), this.iconNameRight && (h("ez-icon", { size: "medium", "icon-name": this.iconNameRight, onClick: (event) => this.handleIconClick(event, 'right') })), (this.mode !== 'action' && this.removePosition) && (h("ez-icon", { class: "btn-close", size: "medium", "icon-name": "close", onClick: (event) => this.handleClickRemoveButton(event) })))));
|
|
93
104
|
}
|
|
94
105
|
static get is() { return "ez-chip"; }
|
|
95
106
|
static get encapsulation() { return "shadow"; }
|
|
@@ -208,7 +219,7 @@ export class EzChip {
|
|
|
208
219
|
},
|
|
209
220
|
"attribute": "show-native-tooltip",
|
|
210
221
|
"reflect": false,
|
|
211
|
-
"defaultValue": "
|
|
222
|
+
"defaultValue": "false"
|
|
212
223
|
},
|
|
213
224
|
"disableAutoUpdateValue": {
|
|
214
225
|
"type": "boolean",
|
|
@@ -227,9 +238,101 @@ export class EzChip {
|
|
|
227
238
|
"attribute": "disable-auto-update-value",
|
|
228
239
|
"reflect": false,
|
|
229
240
|
"defaultValue": "false"
|
|
241
|
+
},
|
|
242
|
+
"maxWidth": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"mutable": false,
|
|
245
|
+
"complexType": {
|
|
246
|
+
"original": "string",
|
|
247
|
+
"resolved": "string",
|
|
248
|
+
"references": {}
|
|
249
|
+
},
|
|
250
|
+
"required": false,
|
|
251
|
+
"optional": false,
|
|
252
|
+
"docs": {
|
|
253
|
+
"tags": [],
|
|
254
|
+
"text": "Define o tamanho m\u00E1ximo do chip."
|
|
255
|
+
},
|
|
256
|
+
"attribute": "max-width",
|
|
257
|
+
"reflect": false
|
|
258
|
+
},
|
|
259
|
+
"size": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"mutable": false,
|
|
262
|
+
"complexType": {
|
|
263
|
+
"original": "'default' | 'medium' | 'large'",
|
|
264
|
+
"resolved": "\"default\" | \"large\" | \"medium\"",
|
|
265
|
+
"references": {}
|
|
266
|
+
},
|
|
267
|
+
"required": false,
|
|
268
|
+
"optional": false,
|
|
269
|
+
"docs": {
|
|
270
|
+
"tags": [],
|
|
271
|
+
"text": "Define o tamanho do chip."
|
|
272
|
+
},
|
|
273
|
+
"attribute": "size",
|
|
274
|
+
"reflect": false,
|
|
275
|
+
"defaultValue": "'default'"
|
|
276
|
+
},
|
|
277
|
+
"iconNameLeft": {
|
|
278
|
+
"type": "string",
|
|
279
|
+
"mutable": false,
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "string",
|
|
282
|
+
"resolved": "string",
|
|
283
|
+
"references": {}
|
|
284
|
+
},
|
|
285
|
+
"required": false,
|
|
286
|
+
"optional": false,
|
|
287
|
+
"docs": {
|
|
288
|
+
"tags": [],
|
|
289
|
+
"text": "Define o icone esquerdo."
|
|
290
|
+
},
|
|
291
|
+
"attribute": "icon-name-left",
|
|
292
|
+
"reflect": false
|
|
293
|
+
},
|
|
294
|
+
"iconNameRight": {
|
|
295
|
+
"type": "string",
|
|
296
|
+
"mutable": false,
|
|
297
|
+
"complexType": {
|
|
298
|
+
"original": "string",
|
|
299
|
+
"resolved": "string",
|
|
300
|
+
"references": {}
|
|
301
|
+
},
|
|
302
|
+
"required": false,
|
|
303
|
+
"optional": false,
|
|
304
|
+
"docs": {
|
|
305
|
+
"tags": [],
|
|
306
|
+
"text": "Define o icone direito."
|
|
307
|
+
},
|
|
308
|
+
"attribute": "icon-name-right",
|
|
309
|
+
"reflect": false
|
|
310
|
+
},
|
|
311
|
+
"type": {
|
|
312
|
+
"type": "string",
|
|
313
|
+
"mutable": false,
|
|
314
|
+
"complexType": {
|
|
315
|
+
"original": "'primary' | 'secondary'",
|
|
316
|
+
"resolved": "\"primary\" | \"secondary\"",
|
|
317
|
+
"references": {}
|
|
318
|
+
},
|
|
319
|
+
"required": false,
|
|
320
|
+
"optional": false,
|
|
321
|
+
"docs": {
|
|
322
|
+
"tags": [],
|
|
323
|
+
"text": "Define o tipo de estiliza\u00E7\u00E3o do chip."
|
|
324
|
+
},
|
|
325
|
+
"attribute": "type",
|
|
326
|
+
"reflect": false,
|
|
327
|
+
"defaultValue": "'primary'"
|
|
230
328
|
}
|
|
231
329
|
};
|
|
232
330
|
}
|
|
331
|
+
static get states() {
|
|
332
|
+
return {
|
|
333
|
+
"_isOverflowing": {}
|
|
334
|
+
};
|
|
335
|
+
}
|
|
233
336
|
static get events() {
|
|
234
337
|
return [{
|
|
235
338
|
"method": "valueChange",
|
|
@@ -276,6 +379,21 @@ export class EzChip {
|
|
|
276
379
|
"resolved": "void",
|
|
277
380
|
"references": {}
|
|
278
381
|
}
|
|
382
|
+
}, {
|
|
383
|
+
"method": "iconClick",
|
|
384
|
+
"name": "iconClick",
|
|
385
|
+
"bubbles": true,
|
|
386
|
+
"cancelable": true,
|
|
387
|
+
"composed": true,
|
|
388
|
+
"docs": {
|
|
389
|
+
"tags": [],
|
|
390
|
+
"text": "Emitido quando o icone \u00E9 acionado."
|
|
391
|
+
},
|
|
392
|
+
"complexType": {
|
|
393
|
+
"original": "{ icon: \"left\" | \"right\" }",
|
|
394
|
+
"resolved": "{ icon: \"left\" | \"right\"; }",
|
|
395
|
+
"references": {}
|
|
396
|
+
}
|
|
279
397
|
}];
|
|
280
398
|
}
|
|
281
399
|
static get methods() {
|
|
@@ -315,17 +433,4 @@ export class EzChip {
|
|
|
315
433
|
};
|
|
316
434
|
}
|
|
317
435
|
static get elementRef() { return "_element"; }
|
|
318
|
-
static get watchers() {
|
|
319
|
-
return [{
|
|
320
|
-
"propName": "value",
|
|
321
|
-
"methodName": "observeValue"
|
|
322
|
-
}, {
|
|
323
|
-
"propName": "enabled",
|
|
324
|
-
"methodName": "observeEnabled"
|
|
325
|
-
}];
|
|
326
|
-
}
|
|
327
436
|
}
|
|
328
|
-
var ChipSize;
|
|
329
|
-
(function (ChipSize) {
|
|
330
|
-
ChipSize[ChipSize["CHAR_LIMIT"] = 28] = "CHAR_LIMIT";
|
|
331
|
-
})(ChipSize || (ChipSize = {}));
|