vueless 0.0.372 → 0.0.373
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 +1 -1
- package/ui.image-avatar/UAvatar.vue +14 -6
- package/web-types.json +4 -3
package/package.json
CHANGED
|
@@ -10,17 +10,23 @@
|
|
|
10
10
|
<template v-if="labelFirstLetters">{{ labelFirstLetters }}</template>
|
|
11
11
|
<!--
|
|
12
12
|
@slot Use it to add something instead of the avatar image placeholder.
|
|
13
|
+
@binding {string} icon-name
|
|
13
14
|
@binding {string} icon-color
|
|
14
15
|
@binding {string} icon-size
|
|
15
16
|
-->
|
|
16
17
|
<slot
|
|
17
18
|
v-else
|
|
18
19
|
name="placeholder"
|
|
19
|
-
:icon-name="
|
|
20
|
+
:icon-name="placeholderIcon"
|
|
20
21
|
:icon-color="componentColor"
|
|
21
22
|
:icon-size="size"
|
|
22
23
|
>
|
|
23
|
-
<UIcon
|
|
24
|
+
<UIcon
|
|
25
|
+
:name="placeholderIcon"
|
|
26
|
+
:color="componentColor"
|
|
27
|
+
:size="size"
|
|
28
|
+
v-bind="placeholderIconAttrs"
|
|
29
|
+
/>
|
|
24
30
|
</slot>
|
|
25
31
|
</template>
|
|
26
32
|
</div>
|
|
@@ -58,7 +64,7 @@ const props = defineProps({
|
|
|
58
64
|
/**
|
|
59
65
|
* Avatar icon placeholder.
|
|
60
66
|
*/
|
|
61
|
-
|
|
67
|
+
placeholderIcon: {
|
|
62
68
|
type: String,
|
|
63
69
|
default: getDefault(defaultConfig, UAvatar).placeholderIcon,
|
|
64
70
|
},
|
|
@@ -122,6 +128,8 @@ const emit = defineEmits([
|
|
|
122
128
|
"click",
|
|
123
129
|
]);
|
|
124
130
|
|
|
131
|
+
const { avatarAttrs, placeholderIconAttrs } = useAttrs(props);
|
|
132
|
+
|
|
125
133
|
const labelFirstLetters = computed(() => {
|
|
126
134
|
const [firstWord, secondWord] = props.label.split(" ");
|
|
127
135
|
|
|
@@ -138,9 +146,9 @@ const backgroundImage = computed(() => {
|
|
|
138
146
|
return props.src ? `background-image: url(${src});` : "";
|
|
139
147
|
});
|
|
140
148
|
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
149
|
+
const componentColor = computed(() => {
|
|
150
|
+
return props.color === "white" ? "grayscale" : props.color;
|
|
151
|
+
});
|
|
144
152
|
|
|
145
153
|
function onClick(event) {
|
|
146
154
|
emit("click", event);
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.373",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -347,13 +347,13 @@
|
|
|
347
347
|
"default": "\"\""
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
|
-
"name": "
|
|
350
|
+
"name": "placeholderIcon",
|
|
351
351
|
"description": "Avatar icon placeholder.",
|
|
352
352
|
"value": {
|
|
353
353
|
"kind": "expression",
|
|
354
354
|
"type": "string"
|
|
355
355
|
},
|
|
356
|
-
"default": "
|
|
356
|
+
"default": "image"
|
|
357
357
|
},
|
|
358
358
|
{
|
|
359
359
|
"name": "size",
|
|
@@ -423,6 +423,7 @@
|
|
|
423
423
|
"description": "Use it to add something instead of the avatar image placeholder.",
|
|
424
424
|
"bindings": [
|
|
425
425
|
{
|
|
426
|
+
"type": "string",
|
|
426
427
|
"name": "icon-name"
|
|
427
428
|
},
|
|
428
429
|
{
|