@dataloop-ai/components 0.19.178 → 0.19.179
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataloop-ai/components",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.179",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.ts",
|
|
6
6
|
"./models": "./models.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"check-only": "if grep -E -H -r --exclude-dir=.git --exclude-dir=node_modules --exclude=*.json --exclude=*.yml '^(describe|it).only' .; then echo 'Found only in test files' && exit 1; fi"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dataloop-ai/icons": "^3.0.
|
|
25
|
+
"@dataloop-ai/icons": "^3.0.22",
|
|
26
26
|
"@types/flat": "^5.0.2",
|
|
27
27
|
"@types/lodash": "^4.14.184",
|
|
28
28
|
"@types/sortablejs": "^1.15.7",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
v-if="!
|
|
3
|
+
v-if="!isSVG"
|
|
4
4
|
:id="uuid"
|
|
5
5
|
:style="[inlineStyles, computedStyles]"
|
|
6
6
|
@click="$emit('click', $event)"
|
|
@@ -39,6 +39,7 @@ import { isString } from 'lodash'
|
|
|
39
39
|
import { v4 } from 'uuid'
|
|
40
40
|
import { defineComponent } from 'vue-demi'
|
|
41
41
|
import { getColor, loggerFactory, stringStyleToRecord } from '../../../utils'
|
|
42
|
+
import { COLORED_ICONS } from '@dataloop-ai/icons/types'
|
|
42
43
|
|
|
43
44
|
export default defineComponent({
|
|
44
45
|
name: 'DlIcon',
|
|
@@ -110,10 +111,27 @@ export default defineComponent({
|
|
|
110
111
|
!this.icon.startsWith('fas') &&
|
|
111
112
|
!this.icon.startsWith('fa-')
|
|
112
113
|
)
|
|
114
|
+
},
|
|
115
|
+
cleanedIconName(): string {
|
|
116
|
+
return this.icon.startsWith('icon-dl-')
|
|
117
|
+
? this.icon.replace('icon-dl-', '')
|
|
118
|
+
: this.icon
|
|
119
|
+
},
|
|
120
|
+
isSVG(): boolean {
|
|
121
|
+
if (!this.icon) {
|
|
122
|
+
return false
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (this.svg) {
|
|
126
|
+
return true
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const coloredIcons = Object.values(COLORED_ICONS)
|
|
130
|
+
return coloredIcons.includes(this.cleanedIconName as any)
|
|
113
131
|
}
|
|
114
132
|
},
|
|
115
133
|
mounted() {
|
|
116
|
-
const possibleToLoadSvg = this.
|
|
134
|
+
const possibleToLoadSvg = this.isSVG && this.icon && this.icon !== ''
|
|
117
135
|
if (possibleToLoadSvg) {
|
|
118
136
|
this.loadSvg()
|
|
119
137
|
}
|
|
@@ -143,8 +161,8 @@ export default defineComponent({
|
|
|
143
161
|
|
|
144
162
|
try {
|
|
145
163
|
svgElement.src = this.svgSource
|
|
146
|
-
? `${this.svgSource}/${this.
|
|
147
|
-
: `https://raw.githubusercontent.com/dataloop-ai/icons/main/assets/${this.
|
|
164
|
+
? `${this.svgSource}/${this.cleanedIconName}.svg`
|
|
165
|
+
: `https://raw.githubusercontent.com/dataloop-ai/icons/main/assets/${this.cleanedIconName}.svg`
|
|
148
166
|
} catch (e) {
|
|
149
167
|
reject(e)
|
|
150
168
|
}
|
package/src/demos/DlIconDemo.vue
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<DlIcon icon="icon-dl-usage" />
|
|
4
|
-
<DlIcon
|
|
5
|
-
|
|
6
|
-
icon="icon-dl-arrow-up"
|
|
7
|
-
/>
|
|
8
|
-
<DlIcon
|
|
9
|
-
size="50px"
|
|
10
|
-
color="red"
|
|
11
|
-
icon="icon-dl-search"
|
|
12
|
-
/>
|
|
4
|
+
<DlIcon color="dl-color-secondary" icon="icon-dl-arrow-up" />
|
|
5
|
+
<DlIcon size="50px" color="red" icon="icon-dl-search" />
|
|
13
6
|
SVG ICON:
|
|
14
7
|
|
|
15
|
-
<DlIcon
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/>
|
|
8
|
+
<DlIcon size="50px" color="red" icon="mastercard" svg />
|
|
9
|
+
|
|
10
|
+
COLORED WITHOUT SVG:
|
|
11
|
+
|
|
12
|
+
<DlIcon size="50px" color="red" icon="mastercard" />
|
|
21
13
|
|
|
22
14
|
Clickable:
|
|
23
15
|
|
|
@@ -33,10 +25,7 @@
|
|
|
33
25
|
style="margin-top: 10px"
|
|
34
26
|
title="Custom Label"
|
|
35
27
|
/>
|
|
36
|
-
<DlIcon
|
|
37
|
-
size="50px"
|
|
38
|
-
:icon="inputValue"
|
|
39
|
-
/>
|
|
28
|
+
<DlIcon size="50px" :icon="inputValue" />
|
|
40
29
|
</div>
|
|
41
30
|
</template>
|
|
42
31
|
|