@policystudio/policy-studio-ui-vue 1.2.0-access.86 → 1.2.0-access.88
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
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
@click="emit('click', $event)"
|
|
8
8
|
@keydown="emit('keydown',$event)"
|
|
9
9
|
>
|
|
10
|
+
<span
|
|
11
|
+
v-if="label"
|
|
12
|
+
class="sr-only"
|
|
13
|
+
>
|
|
14
|
+
{{ label }}
|
|
15
|
+
</span>
|
|
10
16
|
<span
|
|
11
17
|
v-if="getIconType === 'material-icons'"
|
|
12
18
|
class="material-icons-round"
|
|
@@ -16,12 +22,7 @@
|
|
|
16
22
|
>
|
|
17
23
|
{{ getIcon }}
|
|
18
24
|
</span>
|
|
19
|
-
|
|
20
|
-
v-if="label"
|
|
21
|
-
class="sr-only"
|
|
22
|
-
>
|
|
23
|
-
{{ label }}
|
|
24
|
-
</span>
|
|
25
|
+
|
|
25
26
|
<img
|
|
26
27
|
v-else-if="getIconType === 'url'"
|
|
27
28
|
:src="icon"
|
|
@@ -145,13 +146,14 @@ const emit = defineEmits(['click','keydown'])
|
|
|
145
146
|
|
|
146
147
|
const getIconType = computed(() => {
|
|
147
148
|
if (props.type) return props.type
|
|
148
|
-
if (!props.icon
|
|
149
|
-
if (!props.icon
|
|
149
|
+
if (!props.icon) return 'material-icons'
|
|
150
|
+
if (!props.icon.includes('/')) return 'material-icons'
|
|
151
|
+
if (!props.icon.includes('.svg')) return 'url'
|
|
150
152
|
return 'svg'
|
|
151
153
|
})
|
|
152
154
|
|
|
153
155
|
const getIcon = computed(() => {
|
|
154
|
-
if (!props.icon
|
|
156
|
+
if (!props.icon || !props.icon.includes('/')) return props.icon ? props.icon : props.loaderErrorIcon
|
|
155
157
|
if (!finishedImageLoad.value && !imageLoadError.value && props.loaderIcon) return props.loaderIcon
|
|
156
158
|
if (imageLoadError.value) return props.loaderErrorIcon
|
|
157
159
|
return props.icon ? props.icon : props.loaderErrorIcon
|
|
@@ -183,7 +185,7 @@ onMounted(() => {
|
|
|
183
185
|
})
|
|
184
186
|
|
|
185
187
|
const loadImage = () => {
|
|
186
|
-
if(getIconType.value != 'material-icons') {
|
|
188
|
+
if(getIconType.value != 'material-icons' && props.icon?.includes('/')) {
|
|
187
189
|
finishedImageLoad.value = false
|
|
188
190
|
imageLoadError.value = false
|
|
189
191
|
imageLoader({ imageUrl: props.icon, returnsBase64: false })
|