air-vue-components-2 3.2.164 → 3.2.166
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/package.json
CHANGED
|
@@ -87,18 +87,30 @@
|
|
|
87
87
|
const iniciais = (primeira + segunda).toUpperCase()
|
|
88
88
|
return iniciais || '?'
|
|
89
89
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
'#F7B7B7',
|
|
93
|
-
'#
|
|
94
|
-
'#BFD7FF',
|
|
95
|
-
'#FFD6A5',
|
|
96
|
-
'#FBC4E2',
|
|
97
|
-
'#
|
|
98
|
-
'#BFEFEA',
|
|
99
|
-
'#FFF1A8'
|
|
90
|
+
paletaPastel () {
|
|
91
|
+
return [
|
|
92
|
+
'#F7B7B7',
|
|
93
|
+
'#D7C6FF',
|
|
94
|
+
'#BFD7FF',
|
|
95
|
+
'#FFD6A5',
|
|
96
|
+
'#FBC4E2',
|
|
97
|
+
'#BFE7C2',
|
|
98
|
+
'#BFEFEA',
|
|
99
|
+
'#FFF1A8'
|
|
100
100
|
]
|
|
101
|
-
|
|
101
|
+
},
|
|
102
|
+
corPastelPorLetra (letra) {
|
|
103
|
+
const paleta = this.paletaPastel()
|
|
104
|
+
|
|
105
|
+
const ch = String(letra || '?').toUpperCase()
|
|
106
|
+
const code = ch.charCodeAt(0)
|
|
107
|
+
|
|
108
|
+
if (code >= 65 && code <= 90) {
|
|
109
|
+
const idx = (code - 65) % paleta.length
|
|
110
|
+
return paleta[idx]
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return paleta[0]
|
|
102
114
|
},
|
|
103
115
|
hexParaRgb (hex) {
|
|
104
116
|
const h = String(hex || '').replace('#', '').trim()
|
|
@@ -124,29 +136,27 @@
|
|
|
124
136
|
},
|
|
125
137
|
gerarAvatarDataUrl (email) {
|
|
126
138
|
const iniciais = this.gerarIniciaisDoEmail(email)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const bg = this.avatarBg
|
|
139
|
+
const primeiraLetra = (iniciais && iniciais !== '?') ? iniciais[0] : '?'
|
|
140
|
+
const bg = this.corPastelPorLetra(primeiraLetra)
|
|
131
141
|
const fg = this.escurecerHex(bg, 0.55)
|
|
132
142
|
|
|
133
143
|
const svg = `
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128">
|
|
145
|
+
<rect width="128" height="128" rx="64" ry="64" fill="${bg}"/>
|
|
146
|
+
<text x="64" y="64"
|
|
147
|
+
text-anchor="middle"
|
|
148
|
+
dominant-baseline="central"
|
|
149
|
+
font-family="Arial, Helvetica, sans-serif"
|
|
150
|
+
font-size="56"
|
|
151
|
+
font-weight="700"
|
|
152
|
+
fill="${fg}">
|
|
153
|
+
${iniciais}
|
|
154
|
+
</text>
|
|
155
|
+
</svg>
|
|
156
|
+
`.trim()
|
|
147
157
|
|
|
148
158
|
return 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg)
|
|
149
159
|
}
|
|
150
160
|
}
|
|
151
161
|
}
|
|
152
|
-
</script>
|
|
162
|
+
</script>
|
|
@@ -99,18 +99,30 @@
|
|
|
99
99
|
const iniciais = (primeira + segunda).toUpperCase()
|
|
100
100
|
return iniciais || '?'
|
|
101
101
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
'#F7B7B7',
|
|
105
|
-
'#
|
|
106
|
-
'#BFD7FF',
|
|
107
|
-
'#FFD6A5',
|
|
108
|
-
'#FBC4E2',
|
|
109
|
-
'#
|
|
110
|
-
'#BFEFEA',
|
|
111
|
-
'#FFF1A8'
|
|
102
|
+
paletaPastel () {
|
|
103
|
+
return [
|
|
104
|
+
'#F7B7B7',
|
|
105
|
+
'#D7C6FF',
|
|
106
|
+
'#BFD7FF',
|
|
107
|
+
'#FFD6A5',
|
|
108
|
+
'#FBC4E2',
|
|
109
|
+
'#BFE7C2',
|
|
110
|
+
'#BFEFEA',
|
|
111
|
+
'#FFF1A8'
|
|
112
112
|
]
|
|
113
|
-
|
|
113
|
+
},
|
|
114
|
+
corPastelPorLetra (letra) {
|
|
115
|
+
const paleta = this.paletaPastel()
|
|
116
|
+
|
|
117
|
+
const ch = String(letra || '?').toUpperCase()
|
|
118
|
+
const code = ch.charCodeAt(0)
|
|
119
|
+
|
|
120
|
+
if (code >= 65 && code <= 90) {
|
|
121
|
+
const idx = (code - 65) % paleta.length
|
|
122
|
+
return paleta[idx]
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return paleta[0]
|
|
114
126
|
},
|
|
115
127
|
hexParaRgb (hex) {
|
|
116
128
|
const h = String(hex || '').replace('#', '').trim()
|
|
@@ -136,26 +148,24 @@
|
|
|
136
148
|
},
|
|
137
149
|
gerarAvatarDataUrl (email) {
|
|
138
150
|
const iniciais = this.gerarIniciaisDoEmail(email)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const bg = this.avatarBg
|
|
151
|
+
const primeiraLetra = (iniciais && iniciais !== '?') ? iniciais[0] : '?'
|
|
152
|
+
const bg = this.corPastelPorLetra(primeiraLetra)
|
|
143
153
|
const fg = this.escurecerHex(bg, 0.55)
|
|
144
154
|
|
|
145
155
|
const svg = `
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128">
|
|
157
|
+
<rect width="128" height="128" rx="64" ry="64" fill="${bg}"/>
|
|
158
|
+
<text x="64" y="64"
|
|
159
|
+
text-anchor="middle"
|
|
160
|
+
dominant-baseline="central"
|
|
161
|
+
font-family="Arial, Helvetica, sans-serif"
|
|
162
|
+
font-size="56"
|
|
163
|
+
font-weight="700"
|
|
164
|
+
fill="${fg}">
|
|
165
|
+
${iniciais}
|
|
166
|
+
</text>
|
|
167
|
+
</svg>
|
|
168
|
+
`.trim()
|
|
159
169
|
|
|
160
170
|
return 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg)
|
|
161
171
|
}
|
|
@@ -150,18 +150,30 @@
|
|
|
150
150
|
const iniciais = (primeira + segunda).toUpperCase()
|
|
151
151
|
return iniciais || '?'
|
|
152
152
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
'#F7B7B7',
|
|
156
|
-
'#
|
|
157
|
-
'#BFD7FF',
|
|
158
|
-
'#FFD6A5',
|
|
159
|
-
'#FBC4E2',
|
|
160
|
-
'#
|
|
161
|
-
'#BFEFEA',
|
|
162
|
-
'#FFF1A8'
|
|
153
|
+
paletaPastel () {
|
|
154
|
+
return [
|
|
155
|
+
'#F7B7B7',
|
|
156
|
+
'#D7C6FF',
|
|
157
|
+
'#BFD7FF',
|
|
158
|
+
'#FFD6A5',
|
|
159
|
+
'#FBC4E2',
|
|
160
|
+
'#BFE7C2',
|
|
161
|
+
'#BFEFEA',
|
|
162
|
+
'#FFF1A8'
|
|
163
163
|
]
|
|
164
|
-
|
|
164
|
+
},
|
|
165
|
+
corPastelPorLetra (letra) {
|
|
166
|
+
const paleta = this.paletaPastel()
|
|
167
|
+
|
|
168
|
+
const ch = String(letra || '?').toUpperCase()
|
|
169
|
+
const code = ch.charCodeAt(0)
|
|
170
|
+
|
|
171
|
+
if (code >= 65 && code <= 90) {
|
|
172
|
+
const idx = (code - 65) % paleta.length
|
|
173
|
+
return paleta[idx]
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return paleta[0]
|
|
165
177
|
},
|
|
166
178
|
hexParaRgb (hex) {
|
|
167
179
|
const h = String(hex || '').replace('#', '').trim()
|
|
@@ -187,26 +199,24 @@
|
|
|
187
199
|
},
|
|
188
200
|
gerarAvatarDataUrl (email) {
|
|
189
201
|
const iniciais = this.gerarIniciaisDoEmail(email)
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const bg = this.avatarBg
|
|
202
|
+
const primeiraLetra = (iniciais && iniciais !== '?') ? iniciais[0] : '?'
|
|
203
|
+
const bg = this.corPastelPorLetra(primeiraLetra)
|
|
194
204
|
const fg = this.escurecerHex(bg, 0.55)
|
|
195
205
|
|
|
196
206
|
const svg = `
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128">
|
|
208
|
+
<rect width="128" height="128" rx="64" ry="64" fill="${bg}"/>
|
|
209
|
+
<text x="64" y="64"
|
|
210
|
+
text-anchor="middle"
|
|
211
|
+
dominant-baseline="central"
|
|
212
|
+
font-family="Arial, Helvetica, sans-serif"
|
|
213
|
+
font-size="56"
|
|
214
|
+
font-weight="700"
|
|
215
|
+
fill="${fg}">
|
|
216
|
+
${iniciais}
|
|
217
|
+
</text>
|
|
218
|
+
</svg>
|
|
219
|
+
`.trim()
|
|
210
220
|
|
|
211
221
|
return 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg)
|
|
212
222
|
}
|
|
@@ -87,18 +87,30 @@
|
|
|
87
87
|
const iniciais = (primeira + segunda).toUpperCase()
|
|
88
88
|
return iniciais || '?'
|
|
89
89
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
'#F7B7B7',
|
|
93
|
-
'#
|
|
94
|
-
'#BFD7FF',
|
|
95
|
-
'#FFD6A5',
|
|
96
|
-
'#FBC4E2',
|
|
97
|
-
'#
|
|
98
|
-
'#BFEFEA',
|
|
99
|
-
'#FFF1A8'
|
|
90
|
+
paletaPastel () {
|
|
91
|
+
return [
|
|
92
|
+
'#F7B7B7',
|
|
93
|
+
'#D7C6FF',
|
|
94
|
+
'#BFD7FF',
|
|
95
|
+
'#FFD6A5',
|
|
96
|
+
'#FBC4E2',
|
|
97
|
+
'#BFE7C2',
|
|
98
|
+
'#BFEFEA',
|
|
99
|
+
'#FFF1A8'
|
|
100
100
|
]
|
|
101
|
-
|
|
101
|
+
},
|
|
102
|
+
corPastelPorLetra (letra) {
|
|
103
|
+
const paleta = this.paletaPastel()
|
|
104
|
+
|
|
105
|
+
const ch = String(letra || '?').toUpperCase()
|
|
106
|
+
const code = ch.charCodeAt(0)
|
|
107
|
+
|
|
108
|
+
if (code >= 65 && code <= 90) {
|
|
109
|
+
const idx = (code - 65) % paleta.length
|
|
110
|
+
return paleta[idx]
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return paleta[0]
|
|
102
114
|
},
|
|
103
115
|
hexParaRgb (hex) {
|
|
104
116
|
const h = String(hex || '').replace('#', '').trim()
|
|
@@ -124,26 +136,24 @@
|
|
|
124
136
|
},
|
|
125
137
|
gerarAvatarDataUrl (email) {
|
|
126
138
|
const iniciais = this.gerarIniciaisDoEmail(email)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const bg = this.avatarBg
|
|
139
|
+
const primeiraLetra = (iniciais && iniciais !== '?') ? iniciais[0] : '?'
|
|
140
|
+
const bg = this.corPastelPorLetra(primeiraLetra)
|
|
131
141
|
const fg = this.escurecerHex(bg, 0.55)
|
|
132
142
|
|
|
133
143
|
const svg = `
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128">
|
|
145
|
+
<rect width="128" height="128" rx="64" ry="64" fill="${bg}"/>
|
|
146
|
+
<text x="64" y="64"
|
|
147
|
+
text-anchor="middle"
|
|
148
|
+
dominant-baseline="central"
|
|
149
|
+
font-family="Arial, Helvetica, sans-serif"
|
|
150
|
+
font-size="56"
|
|
151
|
+
font-weight="700"
|
|
152
|
+
fill="${fg}">
|
|
153
|
+
${iniciais}
|
|
154
|
+
</text>
|
|
155
|
+
</svg>
|
|
156
|
+
`.trim()
|
|
147
157
|
|
|
148
158
|
return 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg)
|
|
149
159
|
}
|
|
@@ -107,18 +107,30 @@
|
|
|
107
107
|
const iniciais = (primeira + segunda).toUpperCase()
|
|
108
108
|
return iniciais || '?'
|
|
109
109
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
'#F7B7B7',
|
|
113
|
-
'#
|
|
114
|
-
'#BFD7FF',
|
|
115
|
-
'#FFD6A5',
|
|
116
|
-
'#FBC4E2',
|
|
117
|
-
'#
|
|
118
|
-
'#BFEFEA',
|
|
119
|
-
'#FFF1A8'
|
|
110
|
+
paletaPastel () {
|
|
111
|
+
return [
|
|
112
|
+
'#F7B7B7',
|
|
113
|
+
'#D7C6FF',
|
|
114
|
+
'#BFD7FF',
|
|
115
|
+
'#FFD6A5',
|
|
116
|
+
'#FBC4E2',
|
|
117
|
+
'#BFE7C2',
|
|
118
|
+
'#BFEFEA',
|
|
119
|
+
'#FFF1A8'
|
|
120
120
|
]
|
|
121
|
-
|
|
121
|
+
},
|
|
122
|
+
corPastelPorLetra (letra) {
|
|
123
|
+
const paleta = this.paletaPastel()
|
|
124
|
+
|
|
125
|
+
const ch = String(letra || '?').toUpperCase()
|
|
126
|
+
const code = ch.charCodeAt(0)
|
|
127
|
+
|
|
128
|
+
if (code >= 65 && code <= 90) {
|
|
129
|
+
const idx = (code - 65) % paleta.length
|
|
130
|
+
return paleta[idx]
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return paleta[0]
|
|
122
134
|
},
|
|
123
135
|
hexParaRgb (hex) {
|
|
124
136
|
const h = String(hex || '').replace('#', '').trim()
|
|
@@ -144,26 +156,24 @@
|
|
|
144
156
|
},
|
|
145
157
|
gerarAvatarDataUrl (email) {
|
|
146
158
|
const iniciais = this.gerarIniciaisDoEmail(email)
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const bg = this.avatarBg
|
|
159
|
+
const primeiraLetra = (iniciais && iniciais !== '?') ? iniciais[0] : '?'
|
|
160
|
+
const bg = this.corPastelPorLetra(primeiraLetra)
|
|
151
161
|
const fg = this.escurecerHex(bg, 0.55)
|
|
152
162
|
|
|
153
163
|
const svg = `
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128">
|
|
165
|
+
<rect width="128" height="128" rx="64" ry="64" fill="${bg}"/>
|
|
166
|
+
<text x="64" y="64"
|
|
167
|
+
text-anchor="middle"
|
|
168
|
+
dominant-baseline="central"
|
|
169
|
+
font-family="Arial, Helvetica, sans-serif"
|
|
170
|
+
font-size="56"
|
|
171
|
+
font-weight="700"
|
|
172
|
+
fill="${fg}">
|
|
173
|
+
${iniciais}
|
|
174
|
+
</text>
|
|
175
|
+
</svg>
|
|
176
|
+
`.trim()
|
|
167
177
|
|
|
168
178
|
return 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svg)
|
|
169
179
|
}
|