@dataloop-ai/components 0.16.47 → 0.16.49
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/src/components/basic/DlButton/DlButton.vue +9 -2
- package/src/components/basic/DlCard/DlCard.vue +9 -2
- package/src/components/basic/DlPopup/DlPopup.vue +5 -1
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/utils.ts +8 -5
- package/src/components/compound/DlSelect/components/DlSelectOption.vue +1 -0
- package/src/components/essential/DlIcon/DlIcon.vue +18 -6
- package/src/components/essential/DlSpinner/components/DlSpinnerCircle.vue +1 -113
- package/src/components/essential/DlSpinner/components/DlSpinnerClock.vue +1 -113
- package/src/components/essential/DlSpinner/components/DlSpinnerDots.vue +1 -113
- package/src/components/essential/DlSpinner/components/DlSpinnerGrid.vue +1 -113
- package/src/components/essential/DlSpinner/components/DlSpinnerLogo.vue +1 -113
- package/src/components/essential/DlSpinner/styles/spinnerStyles.scss +111 -0
- package/src/components/essential/DlTooltip/DlTooltip.vue +6 -2
- package/src/demos/DlAlertDemo.vue +1 -0
- package/src/hooks/use-suggestions.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/stringStyleToRecord.ts +17 -0
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:tabindex="tabIndex"
|
|
11
11
|
:aria-disabled="disabled ? 'true' : 'false'"
|
|
12
12
|
:disabled="disabled"
|
|
13
|
-
:style="[cssButtonVars,
|
|
13
|
+
:style="[cssButtonVars, computedStyles]"
|
|
14
14
|
style="pointer-events: auto"
|
|
15
15
|
class="dl-button"
|
|
16
16
|
@click="onClick"
|
|
@@ -73,6 +73,8 @@ import { colorNames } from '../../../utils/css-color-names'
|
|
|
73
73
|
import { useSizeObserver } from '../../../hooks/use-size-observer'
|
|
74
74
|
import { v4 } from 'uuid'
|
|
75
75
|
import { ButtonColors } from './types'
|
|
76
|
+
import { stringStyleToRecord } from '../../../utils'
|
|
77
|
+
import { isString } from 'lodash'
|
|
76
78
|
|
|
77
79
|
export default defineComponent({
|
|
78
80
|
name: 'DlButton',
|
|
@@ -108,7 +110,7 @@ export default defineComponent({
|
|
|
108
110
|
icon: { type: String, default: '' },
|
|
109
111
|
overflow: { type: Boolean, default: false, required: false },
|
|
110
112
|
tooltip: { type: String, default: null, required: false },
|
|
111
|
-
styles: { type: [Object, String
|
|
113
|
+
styles: { type: [Object, String], default: null }
|
|
112
114
|
},
|
|
113
115
|
emits: ['click', 'mousedown'],
|
|
114
116
|
setup() {
|
|
@@ -122,6 +124,11 @@ export default defineComponent({
|
|
|
122
124
|
}
|
|
123
125
|
},
|
|
124
126
|
computed: {
|
|
127
|
+
computedStyles(): Record<string, string> {
|
|
128
|
+
return isString(this.styles)
|
|
129
|
+
? stringStyleToRecord(this.styles)
|
|
130
|
+
: this.styles
|
|
131
|
+
},
|
|
125
132
|
isActionable(): boolean {
|
|
126
133
|
return this.disabled !== true
|
|
127
134
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="card"
|
|
4
|
-
:style="[{ width, height },
|
|
4
|
+
:style="[{ width, height }, computedStyles]"
|
|
5
5
|
>
|
|
6
6
|
<div
|
|
7
7
|
v-if="icon"
|
|
@@ -84,7 +84,9 @@
|
|
|
84
84
|
</template>
|
|
85
85
|
|
|
86
86
|
<script lang="ts">
|
|
87
|
+
import { isString } from 'lodash'
|
|
87
88
|
import { defineComponent, PropType } from 'vue-demi'
|
|
89
|
+
import { stringStyleToRecord } from '../../../utils'
|
|
88
90
|
import { DlIcon } from '../../essential/DlIcon'
|
|
89
91
|
import { DlLink } from '../../essential/DlLink'
|
|
90
92
|
import { IconItem, ImageItem, LinkItem } from './types'
|
|
@@ -126,11 +128,16 @@ export default defineComponent({
|
|
|
126
128
|
default: '200px'
|
|
127
129
|
},
|
|
128
130
|
styles: {
|
|
129
|
-
type: [Object, String
|
|
131
|
+
type: [Object, String],
|
|
130
132
|
default: null
|
|
131
133
|
}
|
|
132
134
|
},
|
|
133
135
|
computed: {
|
|
136
|
+
computedStyles(): Record<string, string> {
|
|
137
|
+
return isString(this.styles)
|
|
138
|
+
? stringStyleToRecord(this.styles)
|
|
139
|
+
: this.styles
|
|
140
|
+
},
|
|
134
141
|
iconStyles(): string {
|
|
135
142
|
return this.icon?.styles ?? ''
|
|
136
143
|
},
|
|
@@ -112,6 +112,8 @@ import {
|
|
|
112
112
|
import DraggableUpper from './components/DraggableUpper.vue'
|
|
113
113
|
import PopupHeader from './components/PopupHeader.vue'
|
|
114
114
|
import { v4 } from 'uuid'
|
|
115
|
+
import { isString } from 'lodash'
|
|
116
|
+
import { stringStyleToRecord } from '../../../utils'
|
|
115
117
|
|
|
116
118
|
export default defineComponent({
|
|
117
119
|
name: 'DlPopup',
|
|
@@ -446,7 +448,9 @@ export default defineComponent({
|
|
|
446
448
|
portalIsActive,
|
|
447
449
|
classes: 'dl-popup dl-position-engine scroll',
|
|
448
450
|
styles: [
|
|
449
|
-
attrs.style
|
|
451
|
+
isString(attrs.style)
|
|
452
|
+
? stringStyleToRecord(attrs.style)
|
|
453
|
+
: attrs.style,
|
|
450
454
|
transitionStyle.value,
|
|
451
455
|
stylesFromProps.value
|
|
452
456
|
] as any
|
|
@@ -78,18 +78,21 @@ export function flattenConfusionMatrix(
|
|
|
78
78
|
|
|
79
79
|
for (const [rowIndex, row] of matrix.entries()) {
|
|
80
80
|
for (const [cellIndex, cell] of row.entries()) {
|
|
81
|
-
const
|
|
81
|
+
const cellIsObject = isObject(cell)
|
|
82
|
+
const value: number = cellIsObject
|
|
82
83
|
? (cell as DlConfusionMatrixCell).value
|
|
83
|
-
: cell
|
|
84
|
-
|
|
84
|
+
: (cell as number)
|
|
85
|
+
|
|
86
|
+
const object: DlConfusionMatrixCell = {
|
|
85
87
|
value,
|
|
86
88
|
unnormalizedValue: value,
|
|
87
89
|
xLabel: labelStrings[rowIndex],
|
|
88
90
|
yLabel: labelStrings[cellIndex],
|
|
89
91
|
x: rowIndex,
|
|
90
92
|
y: cellIndex,
|
|
91
|
-
link:
|
|
92
|
-
}
|
|
93
|
+
link: cellIsObject ? (cell as DlConfusionMatrixCell).link : ''
|
|
94
|
+
}
|
|
95
|
+
toNormalize.push(object)
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
return normalizeMatrix(toNormalize)
|
|
@@ -121,6 +121,7 @@ export default defineComponent({
|
|
|
121
121
|
},
|
|
122
122
|
props: {
|
|
123
123
|
withWave: Boolean,
|
|
124
|
+
// todo: clean this up; rename the prop to something better
|
|
124
125
|
defaultStyles: { type: Boolean, default: true },
|
|
125
126
|
multiselect: { type: Boolean, default: false },
|
|
126
127
|
value: { type: ValueTypes, default: null },
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
<div
|
|
3
3
|
v-if="!svg"
|
|
4
4
|
:id="uuid"
|
|
5
|
-
:style="[inlineStyles,
|
|
5
|
+
:style="[inlineStyles, computedStyles]"
|
|
6
6
|
@click="$emit('click', $event)"
|
|
7
|
+
@mousedown="$emit('mousedown', $event)"
|
|
8
|
+
@mouseup="$emit('mouseup', $event)"
|
|
9
|
+
@mousemove="$emit('mousemove', $event)"
|
|
7
10
|
>
|
|
8
11
|
<i
|
|
9
12
|
class="dl-icon"
|
|
@@ -21,6 +24,9 @@
|
|
|
21
24
|
:id="uuid"
|
|
22
25
|
style="display: inline"
|
|
23
26
|
@click="$emit('click', $event)"
|
|
27
|
+
@mousedown="$emit('mousedown', $event)"
|
|
28
|
+
@mouseup="$emit('mouseup', $event)"
|
|
29
|
+
@mousemove="$emit('mousemove', $event)"
|
|
24
30
|
>
|
|
25
31
|
<div ref="svgIcon">
|
|
26
32
|
<div ref="childToReplace" />
|
|
@@ -29,9 +35,10 @@
|
|
|
29
35
|
</template>
|
|
30
36
|
|
|
31
37
|
<script lang="ts">
|
|
38
|
+
import { isString } from 'lodash'
|
|
32
39
|
import { v4 } from 'uuid'
|
|
33
40
|
import { defineComponent } from 'vue-demi'
|
|
34
|
-
import { getColor, loggerFactory } from '../../../utils'
|
|
41
|
+
import { getColor, loggerFactory, stringStyleToRecord } from '../../../utils'
|
|
35
42
|
|
|
36
43
|
export default defineComponent({
|
|
37
44
|
name: 'DlIcon',
|
|
@@ -49,7 +56,7 @@ export default defineComponent({
|
|
|
49
56
|
default: '12px'
|
|
50
57
|
},
|
|
51
58
|
styles: {
|
|
52
|
-
type: [
|
|
59
|
+
type: [String, Object],
|
|
53
60
|
default: null
|
|
54
61
|
},
|
|
55
62
|
svg: {
|
|
@@ -65,7 +72,7 @@ export default defineComponent({
|
|
|
65
72
|
default: null
|
|
66
73
|
}
|
|
67
74
|
},
|
|
68
|
-
emits: ['click'],
|
|
75
|
+
emits: ['click', 'mousemove', 'mouseup', 'mousedown'],
|
|
69
76
|
data() {
|
|
70
77
|
return {
|
|
71
78
|
uuid: `dl-icon-${v4()}`,
|
|
@@ -74,6 +81,11 @@ export default defineComponent({
|
|
|
74
81
|
}
|
|
75
82
|
},
|
|
76
83
|
computed: {
|
|
84
|
+
computedStyles(): Record<string, string> {
|
|
85
|
+
return isString(this.styles)
|
|
86
|
+
? stringStyleToRecord(this.styles)
|
|
87
|
+
: this.styles
|
|
88
|
+
},
|
|
77
89
|
cssIconVars(): Record<string, string> {
|
|
78
90
|
return {
|
|
79
91
|
'--dl-icon-font-size': `${this.size}`,
|
|
@@ -88,8 +100,8 @@ export default defineComponent({
|
|
|
88
100
|
: 'inherit'
|
|
89
101
|
}
|
|
90
102
|
},
|
|
91
|
-
inlineStyles(): string {
|
|
92
|
-
return this.inline ? '
|
|
103
|
+
inlineStyles(): Record<string, string> {
|
|
104
|
+
return { display: this.inline ? 'inline' : 'flex;' }
|
|
93
105
|
},
|
|
94
106
|
// needed to allow external source of icons that do not use class based
|
|
95
107
|
externalIcon(): boolean {
|
|
@@ -41,116 +41,4 @@ export default defineComponent({
|
|
|
41
41
|
})
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
|
-
<style lang="scss"
|
|
45
|
-
.spinner-wrapper {
|
|
46
|
-
display: flex;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
align-items: center;
|
|
49
|
-
}
|
|
50
|
-
.dl-spinner {
|
|
51
|
-
vertical-align: middle;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.dl-spinner-mat {
|
|
55
|
-
animation: spinCircle 2s linear infinite;
|
|
56
|
-
transform-origin: center center;
|
|
57
|
-
}
|
|
58
|
-
.spinner-path {
|
|
59
|
-
stroke-dasharray: 1, 200 #{'/* rtl:ignore */'};
|
|
60
|
-
stroke-dashoffset: 0 #{'/* rtl:ignore */'};
|
|
61
|
-
animation: dash 1.5s ease-in-out infinite;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.spinner {
|
|
65
|
-
position: relative;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.spin-loader,
|
|
69
|
-
.spin-bg {
|
|
70
|
-
width: var(--dl-spinner-size);
|
|
71
|
-
height: var(--dl-spinner-size);
|
|
72
|
-
top: 0;
|
|
73
|
-
left: 0;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.spin-loader {
|
|
77
|
-
position: absolute;
|
|
78
|
-
animation: spin 2s linear infinite;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.dl-spinner-icon {
|
|
82
|
-
top: var(--icon-top);
|
|
83
|
-
left: var(--icon-top);
|
|
84
|
-
position: absolute;
|
|
85
|
-
width: var(--dl-spinner-icon-size);
|
|
86
|
-
height: var(--dl-spinner-icon-size);
|
|
87
|
-
opacity: 1;
|
|
88
|
-
animation: pulse 2s infinite;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.dl-svg {
|
|
92
|
-
fill: var(--dl-spinner-border-color);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.spinner-color-bg {
|
|
96
|
-
fill: none;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.spinner-color {
|
|
100
|
-
fill: url(#linear-gradient);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@keyframes dash {
|
|
104
|
-
0% {
|
|
105
|
-
stroke-dasharray: 1, 200;
|
|
106
|
-
stroke-dashoffset: 0;
|
|
107
|
-
}
|
|
108
|
-
50% {
|
|
109
|
-
stroke-dasharray: 89, 200;
|
|
110
|
-
stroke-dashoffset: -35px;
|
|
111
|
-
}
|
|
112
|
-
100% {
|
|
113
|
-
stroke-dasharray: 89, 200;
|
|
114
|
-
stroke-dashoffset: -124px;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
@keyframes spinCircle {
|
|
119
|
-
0% {
|
|
120
|
-
transform: rotate3d(0, 0, 1, 0deg) #{'/* rtl:ignore */'};
|
|
121
|
-
}
|
|
122
|
-
25% {
|
|
123
|
-
transform: rotate3d(0, 0, 1, 90deg) #{'/* rtl:ignore */'};
|
|
124
|
-
}
|
|
125
|
-
50% {
|
|
126
|
-
transform: rotate3d(0, 0, 1, 180deg) #{'/* rtl:ignore */'};
|
|
127
|
-
}
|
|
128
|
-
75% {
|
|
129
|
-
transform: rotate3d(0, 0, 1, 270deg) #{'/* rtl:ignore */'};
|
|
130
|
-
}
|
|
131
|
-
100% {
|
|
132
|
-
transform: rotate3d(0, 0, 1, 359deg) #{'/* rtl:ignore */'};
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
@keyframes spin {
|
|
137
|
-
0% {
|
|
138
|
-
transform: rotate(0deg);
|
|
139
|
-
}
|
|
140
|
-
100% {
|
|
141
|
-
transform: rotate(360deg);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@keyframes pulse {
|
|
146
|
-
0% {
|
|
147
|
-
opacity: 1;
|
|
148
|
-
}
|
|
149
|
-
50% {
|
|
150
|
-
opacity: 0;
|
|
151
|
-
}
|
|
152
|
-
100% {
|
|
153
|
-
opacity: 1;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
</style>
|
|
44
|
+
<style lang="scss" src="../styles/spinnerStyles.scss" />
|
|
@@ -76,116 +76,4 @@ export default defineComponent({
|
|
|
76
76
|
})
|
|
77
77
|
</script>
|
|
78
78
|
|
|
79
|
-
<style lang="scss"
|
|
80
|
-
.spinner-wrapper {
|
|
81
|
-
display: flex;
|
|
82
|
-
justify-content: center;
|
|
83
|
-
align-items: center;
|
|
84
|
-
}
|
|
85
|
-
.dl-spinner {
|
|
86
|
-
vertical-align: middle;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.dl-spinner-mat {
|
|
90
|
-
animation: spinCircle 2s linear infinite;
|
|
91
|
-
transform-origin: center center;
|
|
92
|
-
}
|
|
93
|
-
.spinner-path {
|
|
94
|
-
stroke-dasharray: 1, 200 #{'/* rtl:ignore */'};
|
|
95
|
-
stroke-dashoffset: 0 #{'/* rtl:ignore */'};
|
|
96
|
-
animation: dash 1.5s ease-in-out infinite;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.spinner {
|
|
100
|
-
position: relative;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.spin-loader,
|
|
104
|
-
.spin-bg {
|
|
105
|
-
width: var(--dl-spinner-size);
|
|
106
|
-
height: var(--dl-spinner-size);
|
|
107
|
-
top: 0;
|
|
108
|
-
left: 0;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.spin-loader {
|
|
112
|
-
position: absolute;
|
|
113
|
-
animation: spin 2s linear infinite;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.dl-spinner-icon {
|
|
117
|
-
top: var(--icon-top);
|
|
118
|
-
left: var(--icon-top);
|
|
119
|
-
position: absolute;
|
|
120
|
-
width: var(--dl-spinner-icon-size);
|
|
121
|
-
height: var(--dl-spinner-icon-size);
|
|
122
|
-
opacity: 1;
|
|
123
|
-
animation: pulse 2s infinite;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.dl-svg {
|
|
127
|
-
fill: var(--dl-spinner-border-color);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.spinner-color-bg {
|
|
131
|
-
fill: none;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.spinner-color {
|
|
135
|
-
fill: url(#linear-gradient);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
@keyframes dash {
|
|
139
|
-
0% {
|
|
140
|
-
stroke-dasharray: 1, 200;
|
|
141
|
-
stroke-dashoffset: 0;
|
|
142
|
-
}
|
|
143
|
-
50% {
|
|
144
|
-
stroke-dasharray: 89, 200;
|
|
145
|
-
stroke-dashoffset: -35px;
|
|
146
|
-
}
|
|
147
|
-
100% {
|
|
148
|
-
stroke-dasharray: 89, 200;
|
|
149
|
-
stroke-dashoffset: -124px;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
@keyframes spinCircle {
|
|
154
|
-
0% {
|
|
155
|
-
transform: rotate3d(0, 0, 1, 0deg) #{'/* rtl:ignore */'};
|
|
156
|
-
}
|
|
157
|
-
25% {
|
|
158
|
-
transform: rotate3d(0, 0, 1, 90deg) #{'/* rtl:ignore */'};
|
|
159
|
-
}
|
|
160
|
-
50% {
|
|
161
|
-
transform: rotate3d(0, 0, 1, 180deg) #{'/* rtl:ignore */'};
|
|
162
|
-
}
|
|
163
|
-
75% {
|
|
164
|
-
transform: rotate3d(0, 0, 1, 270deg) #{'/* rtl:ignore */'};
|
|
165
|
-
}
|
|
166
|
-
100% {
|
|
167
|
-
transform: rotate3d(0, 0, 1, 359deg) #{'/* rtl:ignore */'};
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
@keyframes spin {
|
|
172
|
-
0% {
|
|
173
|
-
transform: rotate(0deg);
|
|
174
|
-
}
|
|
175
|
-
100% {
|
|
176
|
-
transform: rotate(360deg);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
@keyframes pulse {
|
|
181
|
-
0% {
|
|
182
|
-
opacity: 1;
|
|
183
|
-
}
|
|
184
|
-
50% {
|
|
185
|
-
opacity: 0;
|
|
186
|
-
}
|
|
187
|
-
100% {
|
|
188
|
-
opacity: 1;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
</style>
|
|
79
|
+
<style lang="scss" src="../styles/spinnerStyles.scss" />
|
|
@@ -110,116 +110,4 @@ export default defineComponent({
|
|
|
110
110
|
})
|
|
111
111
|
</script>
|
|
112
112
|
|
|
113
|
-
<style lang="scss"
|
|
114
|
-
.spinner-wrapper {
|
|
115
|
-
display: flex;
|
|
116
|
-
justify-content: center;
|
|
117
|
-
align-items: center;
|
|
118
|
-
}
|
|
119
|
-
.dl-spinner {
|
|
120
|
-
vertical-align: middle;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.dl-spinner-mat {
|
|
124
|
-
animation: spinCircle 2s linear infinite;
|
|
125
|
-
transform-origin: center center;
|
|
126
|
-
}
|
|
127
|
-
.spinner-path {
|
|
128
|
-
stroke-dasharray: 1, 200 #{'/* rtl:ignore */'};
|
|
129
|
-
stroke-dashoffset: 0 #{'/* rtl:ignore */'};
|
|
130
|
-
animation: dash 1.5s ease-in-out infinite;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.spinner {
|
|
134
|
-
position: relative;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.spin-loader,
|
|
138
|
-
.spin-bg {
|
|
139
|
-
width: var(--dl-spinner-size);
|
|
140
|
-
height: var(--dl-spinner-size);
|
|
141
|
-
top: 0;
|
|
142
|
-
left: 0;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.spin-loader {
|
|
146
|
-
position: absolute;
|
|
147
|
-
animation: spin 2s linear infinite;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.dl-spinner-icon {
|
|
151
|
-
top: var(--icon-top);
|
|
152
|
-
left: var(--icon-top);
|
|
153
|
-
position: absolute;
|
|
154
|
-
width: var(--dl-spinner-icon-size);
|
|
155
|
-
height: var(--dl-spinner-icon-size);
|
|
156
|
-
opacity: 1;
|
|
157
|
-
animation: pulse 2s infinite;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.dl-svg {
|
|
161
|
-
fill: var(--dl-spinner-border-color);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.spinner-color-bg {
|
|
165
|
-
fill: none;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.spinner-color {
|
|
169
|
-
fill: url(#linear-gradient);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
@keyframes dash {
|
|
173
|
-
0% {
|
|
174
|
-
stroke-dasharray: 1, 200;
|
|
175
|
-
stroke-dashoffset: 0;
|
|
176
|
-
}
|
|
177
|
-
50% {
|
|
178
|
-
stroke-dasharray: 89, 200;
|
|
179
|
-
stroke-dashoffset: -35px;
|
|
180
|
-
}
|
|
181
|
-
100% {
|
|
182
|
-
stroke-dasharray: 89, 200;
|
|
183
|
-
stroke-dashoffset: -124px;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
@keyframes spinCircle {
|
|
188
|
-
0% {
|
|
189
|
-
transform: rotate3d(0, 0, 1, 0deg) #{'/* rtl:ignore */'};
|
|
190
|
-
}
|
|
191
|
-
25% {
|
|
192
|
-
transform: rotate3d(0, 0, 1, 90deg) #{'/* rtl:ignore */'};
|
|
193
|
-
}
|
|
194
|
-
50% {
|
|
195
|
-
transform: rotate3d(0, 0, 1, 180deg) #{'/* rtl:ignore */'};
|
|
196
|
-
}
|
|
197
|
-
75% {
|
|
198
|
-
transform: rotate3d(0, 0, 1, 270deg) #{'/* rtl:ignore */'};
|
|
199
|
-
}
|
|
200
|
-
100% {
|
|
201
|
-
transform: rotate3d(0, 0, 1, 359deg) #{'/* rtl:ignore */'};
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
@keyframes spin {
|
|
206
|
-
0% {
|
|
207
|
-
transform: rotate(0deg);
|
|
208
|
-
}
|
|
209
|
-
100% {
|
|
210
|
-
transform: rotate(360deg);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
@keyframes pulse {
|
|
215
|
-
0% {
|
|
216
|
-
opacity: 1;
|
|
217
|
-
}
|
|
218
|
-
50% {
|
|
219
|
-
opacity: 0;
|
|
220
|
-
}
|
|
221
|
-
100% {
|
|
222
|
-
opacity: 1;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
</style>
|
|
113
|
+
<style lang="scss" src="../styles/spinnerStyles.scss" />
|
|
@@ -163,116 +163,4 @@ export default defineComponent({
|
|
|
163
163
|
})
|
|
164
164
|
</script>
|
|
165
165
|
|
|
166
|
-
<style lang="scss"
|
|
167
|
-
.spinner-wrapper {
|
|
168
|
-
display: flex;
|
|
169
|
-
justify-content: center;
|
|
170
|
-
align-items: center;
|
|
171
|
-
}
|
|
172
|
-
.dl-spinner {
|
|
173
|
-
vertical-align: middle;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.dl-spinner-mat {
|
|
177
|
-
animation: spinCircle 2s linear infinite;
|
|
178
|
-
transform-origin: center center;
|
|
179
|
-
}
|
|
180
|
-
.spinner-path {
|
|
181
|
-
stroke-dasharray: 1, 200 #{'/* rtl:ignore */'};
|
|
182
|
-
stroke-dashoffset: 0 #{'/* rtl:ignore */'};
|
|
183
|
-
animation: dash 1.5s ease-in-out infinite;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.spinner {
|
|
187
|
-
position: relative;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.spin-loader,
|
|
191
|
-
.spin-bg {
|
|
192
|
-
width: var(--dl-spinner-size);
|
|
193
|
-
height: var(--dl-spinner-size);
|
|
194
|
-
top: 0;
|
|
195
|
-
left: 0;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.spin-loader {
|
|
199
|
-
position: absolute;
|
|
200
|
-
animation: spin 2s linear infinite;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.dl-spinner-icon {
|
|
204
|
-
top: var(--icon-top);
|
|
205
|
-
left: var(--icon-top);
|
|
206
|
-
position: absolute;
|
|
207
|
-
width: var(--dl-spinner-icon-size);
|
|
208
|
-
height: var(--dl-spinner-icon-size);
|
|
209
|
-
opacity: 1;
|
|
210
|
-
animation: pulse 2s infinite;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.dl-svg {
|
|
214
|
-
fill: var(--dl-spinner-border-color);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.spinner-color-bg {
|
|
218
|
-
fill: none;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.spinner-color {
|
|
222
|
-
fill: url(#linear-gradient);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
@keyframes dash {
|
|
226
|
-
0% {
|
|
227
|
-
stroke-dasharray: 1, 200;
|
|
228
|
-
stroke-dashoffset: 0;
|
|
229
|
-
}
|
|
230
|
-
50% {
|
|
231
|
-
stroke-dasharray: 89, 200;
|
|
232
|
-
stroke-dashoffset: -35px;
|
|
233
|
-
}
|
|
234
|
-
100% {
|
|
235
|
-
stroke-dasharray: 89, 200;
|
|
236
|
-
stroke-dashoffset: -124px;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
@keyframes spinCircle {
|
|
241
|
-
0% {
|
|
242
|
-
transform: rotate3d(0, 0, 1, 0deg) #{'/* rtl:ignore */'};
|
|
243
|
-
}
|
|
244
|
-
25% {
|
|
245
|
-
transform: rotate3d(0, 0, 1, 90deg) #{'/* rtl:ignore */'};
|
|
246
|
-
}
|
|
247
|
-
50% {
|
|
248
|
-
transform: rotate3d(0, 0, 1, 180deg) #{'/* rtl:ignore */'};
|
|
249
|
-
}
|
|
250
|
-
75% {
|
|
251
|
-
transform: rotate3d(0, 0, 1, 270deg) #{'/* rtl:ignore */'};
|
|
252
|
-
}
|
|
253
|
-
100% {
|
|
254
|
-
transform: rotate3d(0, 0, 1, 359deg) #{'/* rtl:ignore */'};
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
@keyframes spin {
|
|
259
|
-
0% {
|
|
260
|
-
transform: rotate(0deg);
|
|
261
|
-
}
|
|
262
|
-
100% {
|
|
263
|
-
transform: rotate(360deg);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
@keyframes pulse {
|
|
268
|
-
0% {
|
|
269
|
-
opacity: 1;
|
|
270
|
-
}
|
|
271
|
-
50% {
|
|
272
|
-
opacity: 0;
|
|
273
|
-
}
|
|
274
|
-
100% {
|
|
275
|
-
opacity: 1;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
</style>
|
|
166
|
+
<style lang="scss" src="../styles/spinnerStyles.scss" />
|
|
@@ -149,116 +149,4 @@ export default defineComponent({
|
|
|
149
149
|
})
|
|
150
150
|
</script>
|
|
151
151
|
|
|
152
|
-
<style lang="scss"
|
|
153
|
-
.spinner-wrapper {
|
|
154
|
-
display: flex;
|
|
155
|
-
justify-content: center;
|
|
156
|
-
align-items: center;
|
|
157
|
-
}
|
|
158
|
-
.dl-spinner {
|
|
159
|
-
vertical-align: middle;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.dl-spinner-mat {
|
|
163
|
-
animation: spinCircle 2s linear infinite;
|
|
164
|
-
transform-origin: center center;
|
|
165
|
-
}
|
|
166
|
-
.spinner-path {
|
|
167
|
-
stroke-dasharray: 1, 200 #{'/* rtl:ignore */'};
|
|
168
|
-
stroke-dashoffset: 0 #{'/* rtl:ignore */'};
|
|
169
|
-
animation: dash 1.5s ease-in-out infinite;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.spinner {
|
|
173
|
-
position: relative;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.spin-loader,
|
|
177
|
-
.spin-bg {
|
|
178
|
-
width: var(--dl-spinner-size);
|
|
179
|
-
height: var(--dl-spinner-size);
|
|
180
|
-
top: 0;
|
|
181
|
-
left: 0;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.spin-loader {
|
|
185
|
-
position: absolute;
|
|
186
|
-
animation: spin 2s linear infinite;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.dl-spinner-icon {
|
|
190
|
-
top: var(--icon-top);
|
|
191
|
-
left: var(--icon-top);
|
|
192
|
-
position: absolute;
|
|
193
|
-
width: var(--dl-spinner-icon-size);
|
|
194
|
-
height: var(--dl-spinner-icon-size);
|
|
195
|
-
opacity: 1;
|
|
196
|
-
animation: pulse 2s infinite;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.dl-svg {
|
|
200
|
-
fill: var(--dl-spinner-border-color);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.spinner-color-bg {
|
|
204
|
-
fill: none;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.spinner-color {
|
|
208
|
-
fill: url(#linear-gradient);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
@keyframes dash {
|
|
212
|
-
0% {
|
|
213
|
-
stroke-dasharray: 1, 200;
|
|
214
|
-
stroke-dashoffset: 0;
|
|
215
|
-
}
|
|
216
|
-
50% {
|
|
217
|
-
stroke-dasharray: 89, 200;
|
|
218
|
-
stroke-dashoffset: -35px;
|
|
219
|
-
}
|
|
220
|
-
100% {
|
|
221
|
-
stroke-dasharray: 89, 200;
|
|
222
|
-
stroke-dashoffset: -124px;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
@keyframes spinCircle {
|
|
227
|
-
0% {
|
|
228
|
-
transform: rotate3d(0, 0, 1, 0deg) #{'/* rtl:ignore */'};
|
|
229
|
-
}
|
|
230
|
-
25% {
|
|
231
|
-
transform: rotate3d(0, 0, 1, 90deg) #{'/* rtl:ignore */'};
|
|
232
|
-
}
|
|
233
|
-
50% {
|
|
234
|
-
transform: rotate3d(0, 0, 1, 180deg) #{'/* rtl:ignore */'};
|
|
235
|
-
}
|
|
236
|
-
75% {
|
|
237
|
-
transform: rotate3d(0, 0, 1, 270deg) #{'/* rtl:ignore */'};
|
|
238
|
-
}
|
|
239
|
-
100% {
|
|
240
|
-
transform: rotate3d(0, 0, 1, 359deg) #{'/* rtl:ignore */'};
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
@keyframes spin {
|
|
245
|
-
0% {
|
|
246
|
-
transform: rotate(0deg);
|
|
247
|
-
}
|
|
248
|
-
100% {
|
|
249
|
-
transform: rotate(360deg);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
@keyframes pulse {
|
|
254
|
-
0% {
|
|
255
|
-
opacity: 1;
|
|
256
|
-
}
|
|
257
|
-
50% {
|
|
258
|
-
opacity: 0;
|
|
259
|
-
}
|
|
260
|
-
100% {
|
|
261
|
-
opacity: 1;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
</style>
|
|
152
|
+
<style lang="scss" src="../styles/spinnerStyles.scss" />
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.spinner-wrapper {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
align-items: center;
|
|
5
|
+
}
|
|
6
|
+
.dl-spinner {
|
|
7
|
+
vertical-align: middle;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.dl-spinner-mat {
|
|
11
|
+
animation: spinCircle 2s linear infinite;
|
|
12
|
+
transform-origin: center center;
|
|
13
|
+
}
|
|
14
|
+
.spinner-path {
|
|
15
|
+
stroke-dasharray: 1, 200 #{'/* rtl:ignore */'};
|
|
16
|
+
stroke-dashoffset: 0 #{'/* rtl:ignore */'};
|
|
17
|
+
animation: dash 1.5s ease-in-out infinite;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.spinner {
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.spin-loader,
|
|
25
|
+
.spin-bg {
|
|
26
|
+
width: var(--dl-spinner-size);
|
|
27
|
+
height: var(--dl-spinner-size);
|
|
28
|
+
top: 0;
|
|
29
|
+
left: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.spin-loader {
|
|
33
|
+
position: absolute;
|
|
34
|
+
animation: spin 2s linear infinite;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.dl-spinner-icon {
|
|
38
|
+
top: var(--icon-top);
|
|
39
|
+
left: var(--icon-top);
|
|
40
|
+
position: absolute;
|
|
41
|
+
width: var(--dl-spinner-icon-size);
|
|
42
|
+
height: var(--dl-spinner-icon-size);
|
|
43
|
+
opacity: 1;
|
|
44
|
+
animation: pulse 2s infinite;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.dl-svg {
|
|
48
|
+
fill: var(--dl-spinner-border-color);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.spinner-color-bg {
|
|
52
|
+
fill: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.spinner-color {
|
|
56
|
+
fill: url(#linear-gradient);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@keyframes dash {
|
|
60
|
+
0% {
|
|
61
|
+
stroke-dasharray: 1, 200;
|
|
62
|
+
stroke-dashoffset: 0;
|
|
63
|
+
}
|
|
64
|
+
50% {
|
|
65
|
+
stroke-dasharray: 89, 200;
|
|
66
|
+
stroke-dashoffset: -35px;
|
|
67
|
+
}
|
|
68
|
+
100% {
|
|
69
|
+
stroke-dasharray: 89, 200;
|
|
70
|
+
stroke-dashoffset: -124px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@keyframes spinCircle {
|
|
75
|
+
0% {
|
|
76
|
+
transform: rotate3d(0, 0, 1, 0deg) #{'/* rtl:ignore */'};
|
|
77
|
+
}
|
|
78
|
+
25% {
|
|
79
|
+
transform: rotate3d(0, 0, 1, 90deg) #{'/* rtl:ignore */'};
|
|
80
|
+
}
|
|
81
|
+
50% {
|
|
82
|
+
transform: rotate3d(0, 0, 1, 180deg) #{'/* rtl:ignore */'};
|
|
83
|
+
}
|
|
84
|
+
75% {
|
|
85
|
+
transform: rotate3d(0, 0, 1, 270deg) #{'/* rtl:ignore */'};
|
|
86
|
+
}
|
|
87
|
+
100% {
|
|
88
|
+
transform: rotate3d(0, 0, 1, 359deg) #{'/* rtl:ignore */'};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@keyframes spin {
|
|
93
|
+
0% {
|
|
94
|
+
transform: rotate(0deg);
|
|
95
|
+
}
|
|
96
|
+
100% {
|
|
97
|
+
transform: rotate(360deg);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@keyframes pulse {
|
|
102
|
+
0% {
|
|
103
|
+
opacity: 1;
|
|
104
|
+
}
|
|
105
|
+
50% {
|
|
106
|
+
opacity: 0;
|
|
107
|
+
}
|
|
108
|
+
100% {
|
|
109
|
+
opacity: 1;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -48,7 +48,8 @@ import {
|
|
|
48
48
|
cleanEvt,
|
|
49
49
|
clearSelection,
|
|
50
50
|
getColor,
|
|
51
|
-
isMobileOrTablet
|
|
51
|
+
isMobileOrTablet,
|
|
52
|
+
stringStyleToRecord
|
|
52
53
|
} from '../../../utils'
|
|
53
54
|
import {
|
|
54
55
|
parsePosition,
|
|
@@ -65,6 +66,7 @@ import {
|
|
|
65
66
|
} from '../../../utils/click-outside'
|
|
66
67
|
import DlTeleport from '../../../utils/teleport'
|
|
67
68
|
import { v4 } from 'uuid'
|
|
69
|
+
import { isString } from 'lodash'
|
|
68
70
|
|
|
69
71
|
export default defineComponent({
|
|
70
72
|
name: 'DlTooltip',
|
|
@@ -391,7 +393,9 @@ export default defineComponent({
|
|
|
391
393
|
innerRef,
|
|
392
394
|
portalEl: isVue2 ? 'body' : portalEl,
|
|
393
395
|
styles: [
|
|
394
|
-
attrs.style
|
|
396
|
+
isString(attrs.style)
|
|
397
|
+
? stringStyleToRecord(attrs.style)
|
|
398
|
+
: attrs.style,
|
|
395
399
|
transitionStyle.value,
|
|
396
400
|
{
|
|
397
401
|
'--dl-tooltip-color': getColor(
|
|
@@ -374,5 +374,5 @@ const matchStringEnd = (input: string, str: string) =>
|
|
|
374
374
|
input.lastIndexOf(str + '" ') > -1 || input.lastIndexOf(str + "' ") > -1
|
|
375
375
|
|
|
376
376
|
export const removeBrackets = (str: string) => {
|
|
377
|
-
return str.
|
|
377
|
+
return str.replace(/\(/g, '').replace(/\)/g, '')
|
|
378
378
|
}
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const stringStyleToRecord = (input: string): Record<string, string> => {
|
|
2
|
+
const style = input.split(';')
|
|
3
|
+
const output: Record<string, string> = {}
|
|
4
|
+
style.forEach((item) => {
|
|
5
|
+
const [key, value] = item.split(':')
|
|
6
|
+
if (key && value) {
|
|
7
|
+
output[snakeToCamel(key.trim())] = value.trim()
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
return output
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const snakeToCamel = (str: string): string => {
|
|
14
|
+
return str.replace(/([-_][a-z])/g, (group) =>
|
|
15
|
+
group.toUpperCase().replace('-', '').replace('_', '')
|
|
16
|
+
)
|
|
17
|
+
}
|