@dataloop-ai/components 0.19.284 → 0.20.0
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 +59 -59
- package/src/components/basic/DlButton/DlButton.vue +5 -5
- package/src/components/basic/DlPopup/DlPopup.vue +1 -1
- package/src/components/basic/DlProgressChart/DlProgressChart.vue +11 -19
- package/src/components/compound/DlCard/DlCard.vue +14 -48
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +1 -1
- package/src/components/compound/DlCharts/components/DlChartLabels.vue +21 -25
- package/src/components/compound/DlCharts/components/DlChartLegend.vue +14 -17
- package/src/components/compound/DlRange/DlRange.vue +3 -9
- package/src/components/compound/DlSelect/DlSelect.vue +7 -3
- package/src/components/compound/DlSelect/components/DlSelectOption.vue +14 -21
- package/src/components/compound/DlSelect/types.ts +4 -1
- package/src/components/compound/DlSelect/utils.ts +1 -3
- package/src/components/compound/DlSlider/useSlider.ts +4 -1
- package/src/components/compound/DlTable/components/DlTh.vue +6 -3
- package/src/components/compound/DlTable/components/SortableJS.vue +3 -8
- package/src/components/compound/DlThumbnailGallery/DlThumbnailGallery.vue +9 -18
- package/src/components/essential/DlTypography/DlTypography.vue +6 -14
- package/src/components/essential/DlTypography/types.ts +19 -0
- package/src/components/essential/types.ts +1 -0
- package/src/demos/DlChipDemo.vue +24 -84
- package/src/demos/DlCounterDemo.vue +1 -1
- package/src/demos/DlDatasetBrowserLayoutDemo/components/MainContent/ActionsMenu.vue +4 -7
- package/src/demos/DlDatasetBrowserLayoutDemo/components/MainContent/AutomationMenu.vue +7 -19
- package/src/demos/DlDatasetBrowserLayoutDemo/components/MainContent/CardView.vue +13 -7
- package/src/demos/DlDatasetBrowserLayoutDemo/components/filters/AddFilter.vue +10 -23
- package/src/demos/DlDateTimeRangeDemo.vue +19 -16
- package/src/demos/DlLabelPickerDemo.vue +8 -5
- package/src/demos/DlMenuDemo.vue +2 -2
- package/src/demos/DlSelectDemo.vue +10 -10
- package/src/demos/DlStepperDemo/steps/GeneralStep.vue +8 -5
- package/src/demos/DlStudioLayoutDemo/components/StudioLeftDrawer.vue +10 -4
- package/src/demos/DlStudioLayoutDemo/components/StudioTabsMenu.vue +2 -10
- package/src/demos/DlTextInputDemo.vue +5 -5
- package/src/demos/DlThDemo.vue +5 -4
- package/src/demos/DlTooltipDemo.vue +1 -1
- package/src/demos/DlTreeTableDemo.vue +6 -7
- package/src/demos/DlTypographyDemo.vue +11 -8
- package/src/demos/DlVirtualScrollDemo.vue +7 -13
- package/tsconfig.json +1 -1
- package/tsconfig.vue.json +4 -0
- package/vite.config.ts +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataloop-ai/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.ts",
|
|
6
6
|
"./models": "./models.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"preserve": "./moveToPublic.sh",
|
|
11
11
|
"dev": "npm run preserve && vite",
|
|
12
12
|
"dev:2": "./misc/unpackAndRunV2.sh",
|
|
13
|
-
"build": "npm run preserve && vue-tsc --noEmit --skipLibCheck && vite build",
|
|
13
|
+
"build": "npm run preserve && vue-tsc --noEmit --skipLibCheck --project tsconfig.vue.json && vite build",
|
|
14
14
|
"preview": "vite preview",
|
|
15
15
|
"storybook": "storybook dev -p 6006",
|
|
16
16
|
"build:storybook": "storybook build",
|
|
@@ -23,72 +23,72 @@
|
|
|
23
23
|
"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"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@dataloop-ai/icons": "^3.0.
|
|
27
|
-
"@types/flat": "^5.0.
|
|
28
|
-
"@types/lodash": "^4.
|
|
29
|
-
"@types/sortablejs": "^1.15.
|
|
30
|
-
"chart.js": "^
|
|
26
|
+
"@dataloop-ai/icons": "^3.0.100",
|
|
27
|
+
"@types/flat": "^5.0.5",
|
|
28
|
+
"@types/lodash": "^4.17.4",
|
|
29
|
+
"@types/sortablejs": "^1.15.8",
|
|
30
|
+
"chart.js": "^4.4.3",
|
|
31
31
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
32
|
-
"flat": "^
|
|
33
|
-
"highlight.js": "^11.
|
|
32
|
+
"flat": "^6.0.1",
|
|
33
|
+
"highlight.js": "^11.9.0",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
|
-
"marked": "^
|
|
36
|
-
"moment": "^2.
|
|
37
|
-
"sass": "^1.
|
|
38
|
-
"sass-loader": "^
|
|
39
|
-
"sortablejs": "^1.15.
|
|
40
|
-
"uuid": "^
|
|
41
|
-
"v-wave": "^
|
|
42
|
-
"vanilla-jsoneditor": "^0.
|
|
43
|
-
"vue-demi": "^0.14.
|
|
35
|
+
"marked": "^12.0.2",
|
|
36
|
+
"moment": "^2.30.1",
|
|
37
|
+
"sass": "^1.77.2",
|
|
38
|
+
"sass-loader": "^14.2.1",
|
|
39
|
+
"sortablejs": "^1.15.2",
|
|
40
|
+
"uuid": "^9.0.1",
|
|
41
|
+
"v-wave": "^2.0.0",
|
|
42
|
+
"vanilla-jsoneditor": "^0.23.4",
|
|
43
|
+
"vue-demi": "^0.14.7",
|
|
44
44
|
"vue-sortable": "^0.1.3",
|
|
45
|
-
"vue2-teleport": "^1.
|
|
45
|
+
"vue2-teleport": "^1.1.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@babel/core": "^7.
|
|
49
|
-
"@mdx-js/react": "^
|
|
50
|
-
"@storybook/addon-actions": "^
|
|
51
|
-
"@storybook/addon-essentials": "^
|
|
52
|
-
"@storybook/addon-links": "^
|
|
53
|
-
"@storybook/addon-mdx-gfm": "^
|
|
54
|
-
"@storybook/client-api": "^7.
|
|
55
|
-
"@storybook/vue3": "^
|
|
56
|
-
"@storybook/vue3-vite": "^
|
|
57
|
-
"@types/jsdom": "^
|
|
58
|
-
"@types/node": "^
|
|
59
|
-
"@types/resize-observer-browser": "^0.1.
|
|
60
|
-
"@types/uuid": "^
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
62
|
-
"@typescript-eslint/parser": "^
|
|
63
|
-
"@vitejs/plugin-vue": "^
|
|
64
|
-
"@vitest/coverage-
|
|
65
|
-
"@vue/eslint-config-prettier": "^
|
|
66
|
-
"@vue/eslint-config-typescript": "^
|
|
67
|
-
"@vue/test-utils": "^2.
|
|
68
|
-
"babel-loader": "^
|
|
69
|
-
"eslint": "^8.
|
|
70
|
-
"eslint-config-prettier": "^
|
|
48
|
+
"@babel/core": "^7.24.5",
|
|
49
|
+
"@mdx-js/react": "^3.0.1",
|
|
50
|
+
"@storybook/addon-actions": "^8.1.1",
|
|
51
|
+
"@storybook/addon-essentials": "^8.1.1",
|
|
52
|
+
"@storybook/addon-links": "^8.1.1",
|
|
53
|
+
"@storybook/addon-mdx-gfm": "^8.1.1",
|
|
54
|
+
"@storybook/client-api": "^7.6.17",
|
|
55
|
+
"@storybook/vue3": "^8.1.1",
|
|
56
|
+
"@storybook/vue3-vite": "^8.1.1",
|
|
57
|
+
"@types/jsdom": "^21.1.6",
|
|
58
|
+
"@types/node": "^20.12.12",
|
|
59
|
+
"@types/resize-observer-browser": "^0.1.11",
|
|
60
|
+
"@types/uuid": "^9.0.8",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^7.10.0",
|
|
62
|
+
"@typescript-eslint/parser": "^7.10.0",
|
|
63
|
+
"@vitejs/plugin-vue": "^5.0.4",
|
|
64
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
65
|
+
"@vue/eslint-config-prettier": "^9.0.0",
|
|
66
|
+
"@vue/eslint-config-typescript": "^13.0.0",
|
|
67
|
+
"@vue/test-utils": "^2.4.6",
|
|
68
|
+
"babel-loader": "^9.1.3",
|
|
69
|
+
"eslint": "^8.56.0",
|
|
70
|
+
"eslint-config-prettier": "^9.1.0",
|
|
71
71
|
"eslint-plugin-member-order": "^0.0.3",
|
|
72
|
-
"eslint-plugin-prettier": "^
|
|
73
|
-
"eslint-plugin-storybook": "^0.
|
|
74
|
-
"eslint-plugin-vue": "^
|
|
75
|
-
"html-webpack-plugin": "^5.
|
|
76
|
-
"jsdom": "^
|
|
77
|
-
"lint-staged": "^
|
|
72
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
73
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
74
|
+
"eslint-plugin-vue": "^9.26.0",
|
|
75
|
+
"html-webpack-plugin": "^5.6.0",
|
|
76
|
+
"jsdom": "^24.0.0",
|
|
77
|
+
"lint-staged": "^15.2.2",
|
|
78
78
|
"pre-commit": "^1.2.2",
|
|
79
|
-
"prettier": "^2.
|
|
80
|
-
"react": "^18.1
|
|
81
|
-
"react-dom": "^18.
|
|
82
|
-
"storybook": "^
|
|
79
|
+
"prettier": "^3.2.5",
|
|
80
|
+
"react": "^18.3.1",
|
|
81
|
+
"react-dom": "^18.3.1",
|
|
82
|
+
"storybook": "^8.1.1",
|
|
83
83
|
"storybook-addon-themes": "^6.1.0",
|
|
84
|
-
"typescript": "^4.5
|
|
85
|
-
"vite": "^
|
|
86
|
-
"vitest": "^
|
|
87
|
-
"vitest-canvas-mock": "^0.
|
|
88
|
-
"vue": "^3.
|
|
84
|
+
"typescript": "^5.4.5",
|
|
85
|
+
"vite": "^5.2.11",
|
|
86
|
+
"vitest": "^1.6.0",
|
|
87
|
+
"vitest-canvas-mock": "^0.3.3",
|
|
88
|
+
"vue": "^3.4.27",
|
|
89
89
|
"vue-composition-test-utils": "^1.0.3",
|
|
90
|
-
"vue-loader": "^
|
|
91
|
-
"vue-tsc": "^0.
|
|
90
|
+
"vue-loader": "^17.4.2",
|
|
91
|
+
"vue-tsc": "^2.0.19"
|
|
92
92
|
},
|
|
93
93
|
"keywords": [],
|
|
94
94
|
"author": "fadi@dataloop.ai",
|
|
@@ -295,7 +295,7 @@ export default defineComponent({
|
|
|
295
295
|
hasIcon(): boolean {
|
|
296
296
|
return typeof this.icon === 'string' && this.icon !== ''
|
|
297
297
|
},
|
|
298
|
-
containerStyles():
|
|
298
|
+
containerStyles(): Record<string, any> {
|
|
299
299
|
return this.fluid ? { width: '100%' } : {}
|
|
300
300
|
},
|
|
301
301
|
hasContent(): boolean {
|
|
@@ -422,10 +422,10 @@ export default defineComponent({
|
|
|
422
422
|
'--dl-button-padding': this.dense
|
|
423
423
|
? '0'
|
|
424
424
|
: this.padding
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
425
|
+
? this.padding
|
|
426
|
+
: this.hasIcon && !this.hasContent
|
|
427
|
+
? setIconPadding(this.size)
|
|
428
|
+
: setPadding(this.size),
|
|
429
429
|
'--dl-button-margin': this.margin,
|
|
430
430
|
'--dl-button-font-size': setFontSize(this.size),
|
|
431
431
|
'--dl-button-cursor': this.isActionable
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
:id="uuid"
|
|
4
|
-
ref="rootRef"
|
|
5
|
-
class="root"
|
|
6
|
-
:style="rootStyle"
|
|
7
|
-
>
|
|
2
|
+
<div :id="uuid" ref="rootRef" class="root" :style="rootStyle">
|
|
8
3
|
<div class="progress-bar">
|
|
9
4
|
<div
|
|
10
5
|
v-for="item in progressBarItems"
|
|
11
6
|
:key="item.index"
|
|
12
7
|
:style="getBarItemStyles(item)"
|
|
13
8
|
>
|
|
14
|
-
<dl-tooltip
|
|
15
|
-
anchor="center middle"
|
|
16
|
-
self="bottom middle"
|
|
17
|
-
>
|
|
9
|
+
<dl-tooltip anchor="center middle" self="bottom middle">
|
|
18
10
|
{{ item.tooltipText }}
|
|
19
11
|
</dl-tooltip>
|
|
20
12
|
</div>
|
|
@@ -29,10 +21,7 @@
|
|
|
29
21
|
<dl-tooltip v-if="isOverflowing[item.index]">
|
|
30
22
|
{{ item.name }}
|
|
31
23
|
</dl-tooltip>
|
|
32
|
-
<span
|
|
33
|
-
class="circle"
|
|
34
|
-
:style="{ backgroundColor: item.color }"
|
|
35
|
-
/>
|
|
24
|
+
<span class="circle" :style="{ backgroundColor: item.color }" />
|
|
36
25
|
<div
|
|
37
26
|
v-if="isVue2"
|
|
38
27
|
ref="textRef"
|
|
@@ -46,7 +35,7 @@
|
|
|
46
35
|
v-else
|
|
47
36
|
:ref="
|
|
48
37
|
(el) => {
|
|
49
|
-
|
|
38
|
+
setTextRef(item.index, el)
|
|
50
39
|
}
|
|
51
40
|
"
|
|
52
41
|
:data-index="item.index"
|
|
@@ -63,10 +52,10 @@
|
|
|
63
52
|
:size="12"
|
|
64
53
|
color="color"
|
|
65
54
|
data-test="counter-link"
|
|
66
|
-
>({{ item.value }})</dl-link
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
>
|
|
55
|
+
>({{ item.value }})</dl-link
|
|
56
|
+
><span v-else data-test="counter-text"
|
|
57
|
+
>({{ item.value }})</span
|
|
58
|
+
>
|
|
70
59
|
</span>
|
|
71
60
|
</div>
|
|
72
61
|
</div>
|
|
@@ -220,6 +209,9 @@ export default defineComponent({
|
|
|
220
209
|
flexShrink: item.percentage,
|
|
221
210
|
backgroundColor: item.color
|
|
222
211
|
}
|
|
212
|
+
},
|
|
213
|
+
setTextRef(index: number, el: any) {
|
|
214
|
+
this.textRef[index] = el as any
|
|
223
215
|
}
|
|
224
216
|
},
|
|
225
217
|
|
|
@@ -6,10 +6,7 @@
|
|
|
6
6
|
@mouseleave="onCardMouseleave"
|
|
7
7
|
@click="onCardClick"
|
|
8
8
|
>
|
|
9
|
-
<div
|
|
10
|
-
v-if="icon && !isEmpty"
|
|
11
|
-
class="card--icon"
|
|
12
|
-
>
|
|
9
|
+
<div v-if="icon && !isEmpty" class="card--icon">
|
|
13
10
|
<dl-icon
|
|
14
11
|
:icon="icon.icon"
|
|
15
12
|
:styles="iconStyles"
|
|
@@ -17,20 +14,13 @@
|
|
|
17
14
|
:color="iconColor"
|
|
18
15
|
/>
|
|
19
16
|
</div>
|
|
20
|
-
<div
|
|
21
|
-
v-else-if="image && !isEmpty"
|
|
22
|
-
class="card--image"
|
|
23
|
-
>
|
|
17
|
+
<div v-else-if="image && !isEmpty" class="card--image">
|
|
24
18
|
<div
|
|
25
19
|
v-if="interactive && hasImageLink"
|
|
26
20
|
class="card--image__link-icon"
|
|
27
21
|
@click="stopPropagationEvent"
|
|
28
22
|
>
|
|
29
|
-
<DlLink
|
|
30
|
-
newtab
|
|
31
|
-
external
|
|
32
|
-
:href="imageLink"
|
|
33
|
-
>
|
|
23
|
+
<DlLink newtab external :href="imageLink">
|
|
34
24
|
<dl-icon
|
|
35
25
|
:icon="image.link.icon"
|
|
36
26
|
:size="image.link.size"
|
|
@@ -53,7 +43,7 @@
|
|
|
53
43
|
class="card--image__image-holder__image"
|
|
54
44
|
:onload="onImageLoad"
|
|
55
45
|
@mousemove="movePreview"
|
|
56
|
-
|
|
46
|
+
/>
|
|
57
47
|
<div
|
|
58
48
|
v-if="hasMagnifyingGlass"
|
|
59
49
|
ref="magnifyingGlass"
|
|
@@ -77,14 +67,11 @@
|
|
|
77
67
|
:src="image.src"
|
|
78
68
|
:alt="imageAlt"
|
|
79
69
|
class="card--image__image-preview__image"
|
|
80
|
-
|
|
70
|
+
/>
|
|
81
71
|
</figure>
|
|
82
72
|
</dl-tooltip>
|
|
83
73
|
</div>
|
|
84
|
-
<div
|
|
85
|
-
v-if="!isEmpty"
|
|
86
|
-
class="card--content"
|
|
87
|
-
>
|
|
74
|
+
<div v-if="!isEmpty" class="card--content">
|
|
88
75
|
<div>
|
|
89
76
|
<slot name="header">
|
|
90
77
|
<div v-if="interactive">
|
|
@@ -117,10 +104,7 @@
|
|
|
117
104
|
</div>
|
|
118
105
|
</div>
|
|
119
106
|
</div>
|
|
120
|
-
<div
|
|
121
|
-
v-else
|
|
122
|
-
class="card--header"
|
|
123
|
-
>
|
|
107
|
+
<div v-else class="card--header">
|
|
124
108
|
<span class="card--header_title">{{ title }}</span>
|
|
125
109
|
</div>
|
|
126
110
|
</slot>
|
|
@@ -168,20 +152,14 @@
|
|
|
168
152
|
</dl-ellipsis>
|
|
169
153
|
</div>
|
|
170
154
|
</div>
|
|
171
|
-
<span
|
|
172
|
-
v-else
|
|
173
|
-
class="card--content_text"
|
|
174
|
-
>{{ text }}</span>
|
|
155
|
+
<span v-else class="card--content_text">{{ text }}</span>
|
|
175
156
|
</slot>
|
|
176
157
|
</div>
|
|
177
158
|
<slot name="footer">
|
|
178
159
|
<div v-if="interactive">
|
|
179
160
|
<div class="card__interactive-description">
|
|
180
161
|
<div class="flex full-width items-center">
|
|
181
|
-
<dl-typography
|
|
182
|
-
size="10px"
|
|
183
|
-
color="dl-color-medium"
|
|
184
|
-
>
|
|
162
|
+
<dl-typography size="10px" color="dl-color-medium">
|
|
185
163
|
Description
|
|
186
164
|
</dl-typography>
|
|
187
165
|
</div>
|
|
@@ -193,10 +171,7 @@
|
|
|
193
171
|
</div>
|
|
194
172
|
</div>
|
|
195
173
|
<div class="card__interactive-description__text">
|
|
196
|
-
<dl-ellipsis
|
|
197
|
-
v-if="description"
|
|
198
|
-
:text="description"
|
|
199
|
-
/>
|
|
174
|
+
<dl-ellipsis v-if="description" :text="description" />
|
|
200
175
|
<dl-typography
|
|
201
176
|
v-else
|
|
202
177
|
size="12px"
|
|
@@ -206,10 +181,7 @@
|
|
|
206
181
|
</dl-typography>
|
|
207
182
|
</div>
|
|
208
183
|
</div>
|
|
209
|
-
<div
|
|
210
|
-
v-else
|
|
211
|
-
class="card--links"
|
|
212
|
-
>
|
|
184
|
+
<div v-else class="card--links">
|
|
213
185
|
<div
|
|
214
186
|
v-for="(link, idx) in links"
|
|
215
187
|
:key="idx"
|
|
@@ -239,14 +211,8 @@
|
|
|
239
211
|
v-if="isEmpty && emptyStateProps"
|
|
240
212
|
v-bind="emptyStateProps"
|
|
241
213
|
>
|
|
242
|
-
<template
|
|
243
|
-
v-
|
|
244
|
-
#[slot]="props"
|
|
245
|
-
>
|
|
246
|
-
<slot
|
|
247
|
-
:name="slot"
|
|
248
|
-
v-bind="props"
|
|
249
|
-
/>
|
|
214
|
+
<template v-for="(_, slot) in $slots" #[slot]="props">
|
|
215
|
+
<slot :name="slot" v-bind="props" />
|
|
250
216
|
</template>
|
|
251
217
|
</dl-empty-state>
|
|
252
218
|
</div>
|
|
@@ -304,7 +270,7 @@ export default defineComponent({
|
|
|
304
270
|
},
|
|
305
271
|
links: {
|
|
306
272
|
type: Array as PropType<DlCardLinkType[]>,
|
|
307
|
-
default: (): DlCardLinkType[] => []
|
|
273
|
+
default: (): DlCardLinkType[] => [] as DlCardLinkType[]
|
|
308
274
|
},
|
|
309
275
|
height: {
|
|
310
276
|
type: String,
|
|
@@ -494,7 +494,7 @@ export default defineComponent({
|
|
|
494
494
|
getMatrixCellWidth() {
|
|
495
495
|
return this.getMatrixWidth() / this.matrix.length
|
|
496
496
|
},
|
|
497
|
-
handleMatrixScroll(e: MouseEvent | UIEvent) {
|
|
497
|
+
handleMatrixScroll(e: MouseEvent | UIEvent | any) {
|
|
498
498
|
const target = e.target as HTMLElement
|
|
499
499
|
;(this.$refs.yAxisOuter as HTMLElement).scroll(0, target.scrollTop)
|
|
500
500
|
},
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
:style="labelStyles"
|
|
4
|
-
class="dl-chart-labels-container"
|
|
5
|
-
>
|
|
2
|
+
<div :style="labelStyles" class="dl-chart-labels-container">
|
|
6
3
|
<div class="dl-chart-labels">
|
|
7
4
|
<div
|
|
8
|
-
v-for="(label, index) in
|
|
5
|
+
v-for="(label, index) in computedLabels"
|
|
9
6
|
:key="index"
|
|
10
7
|
class="dl-chart-labels--label"
|
|
11
8
|
>
|
|
12
9
|
<dl-tooltip v-if="isOverflowing[index]">
|
|
13
|
-
{{ stringVerification(label.title
|
|
10
|
+
{{ stringVerification(label.title) }}
|
|
14
11
|
</dl-tooltip>
|
|
15
12
|
<dl-typography
|
|
16
13
|
v-if="isVue2"
|
|
@@ -19,7 +16,7 @@
|
|
|
19
16
|
:data-index="index"
|
|
20
17
|
:color="labelColor"
|
|
21
18
|
>
|
|
22
|
-
{{ label.title
|
|
19
|
+
{{ label.title }}
|
|
23
20
|
</dl-typography>
|
|
24
21
|
<dl-typography
|
|
25
22
|
v-else
|
|
@@ -28,16 +25,13 @@
|
|
|
28
25
|
:size="fontSize"
|
|
29
26
|
:color="labelColor"
|
|
30
27
|
>
|
|
31
|
-
{{ stringVerification(label.title
|
|
28
|
+
{{ stringVerification(label.title) }}
|
|
32
29
|
</dl-typography>
|
|
33
30
|
</div>
|
|
34
31
|
</div>
|
|
35
|
-
<div
|
|
36
|
-
v-if="hasSubtitles"
|
|
37
|
-
class="dl-chart-labels"
|
|
38
|
-
>
|
|
32
|
+
<div v-if="hasSubtitles" class="dl-chart-labels">
|
|
39
33
|
<div
|
|
40
|
-
v-for="(label, index) in
|
|
34
|
+
v-for="(label, index) in computedLabels"
|
|
41
35
|
:key="index"
|
|
42
36
|
class="dl-chart-labels--label"
|
|
43
37
|
>
|
|
@@ -64,14 +58,8 @@
|
|
|
64
58
|
</dl-typography>
|
|
65
59
|
</div>
|
|
66
60
|
</div>
|
|
67
|
-
<div
|
|
68
|
-
|
|
69
|
-
class="dl-chart-labels-title"
|
|
70
|
-
>
|
|
71
|
-
<dl-typography
|
|
72
|
-
:size="titleSize"
|
|
73
|
-
:color="titleColor"
|
|
74
|
-
>
|
|
61
|
+
<div v-if="title" class="dl-chart-labels-title">
|
|
62
|
+
<dl-typography :size="titleSize" :color="titleColor">
|
|
75
63
|
{{ title }}
|
|
76
64
|
</dl-typography>
|
|
77
65
|
</div>
|
|
@@ -165,6 +153,14 @@ export default defineComponent({
|
|
|
165
153
|
}
|
|
166
154
|
},
|
|
167
155
|
computed: {
|
|
156
|
+
computedLabels(): { title: string; subtitle: string }[] {
|
|
157
|
+
return this.labels.map((label) => {
|
|
158
|
+
if (typeof label === 'string') {
|
|
159
|
+
return { title: label, subtitle: '' }
|
|
160
|
+
}
|
|
161
|
+
return label
|
|
162
|
+
})
|
|
163
|
+
},
|
|
168
164
|
labelStyles(): Record<string, string> {
|
|
169
165
|
return {
|
|
170
166
|
'--dl-chart-labels-width': this.width
|
|
@@ -195,13 +191,13 @@ export default defineComponent({
|
|
|
195
191
|
) as Element[])
|
|
196
192
|
: this[elementRef]
|
|
197
193
|
for (const el of elements as Element[]) {
|
|
198
|
-
(this[ref] as ResizeObserver).observe(el)
|
|
194
|
+
;(this[ref] as ResizeObserver).observe(el)
|
|
199
195
|
}
|
|
200
196
|
})
|
|
201
197
|
},
|
|
202
198
|
beforeUnmount() {
|
|
203
199
|
observerRefs.forEach(({ ref }) => {
|
|
204
|
-
(this[ref] as ResizeObserver).disconnect()
|
|
200
|
+
;(this[ref] as ResizeObserver).disconnect()
|
|
205
201
|
this[ref] = null
|
|
206
202
|
})
|
|
207
203
|
},
|
|
@@ -218,12 +214,12 @@ export default defineComponent({
|
|
|
218
214
|
}
|
|
219
215
|
},
|
|
220
216
|
forwardChildEl(
|
|
221
|
-
el: { $el: Element },
|
|
217
|
+
el: { $el: Element } | any,
|
|
222
218
|
refName: 'textRef' | 'subtitleRef',
|
|
223
219
|
index: number
|
|
224
220
|
) {
|
|
225
221
|
if (el?.$el) {
|
|
226
|
-
(this[refName] as Element[])[index] = el.$el
|
|
222
|
+
;(this[refName] as Element[])[index] = el.$el
|
|
227
223
|
}
|
|
228
224
|
}
|
|
229
225
|
}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
:style="legendStyles"
|
|
4
|
-
class="dl-chart-legend"
|
|
5
|
-
>
|
|
2
|
+
<div :style="legendStyles" class="dl-chart-legend">
|
|
6
3
|
<div
|
|
7
4
|
v-for="(item, index) in datasets"
|
|
8
5
|
:key="index"
|
|
9
6
|
class="dl-chart-legend--item"
|
|
10
7
|
:style="{
|
|
11
|
-
'--dl-chart-badge-color': getColor(
|
|
12
|
-
item.backgroundColor.replace('--', '')
|
|
13
|
-
)
|
|
8
|
+
'--dl-chart-badge-color': getColor(item)
|
|
14
9
|
}"
|
|
15
10
|
@click="hideData($event, item, index)"
|
|
16
11
|
@mouseenter="onMouseEnter(item, index)"
|
|
@@ -18,9 +13,7 @@
|
|
|
18
13
|
>
|
|
19
14
|
<dl-badge
|
|
20
15
|
:color="
|
|
21
|
-
item.hidden
|
|
22
|
-
? 'var(--dl-color-disabled)'
|
|
23
|
-
: getColor(item.backgroundColor.replace('--', ''))
|
|
16
|
+
item.hidden ? 'var(--dl-color-disabled)' : getColor(item)
|
|
24
17
|
"
|
|
25
18
|
/>
|
|
26
19
|
<dl-typography
|
|
@@ -35,7 +28,7 @@
|
|
|
35
28
|
|
|
36
29
|
<script lang="ts">
|
|
37
30
|
import { defineComponent, PropType } from 'vue-demi'
|
|
38
|
-
import type {
|
|
31
|
+
import type { ChartDataset } from 'chart.js'
|
|
39
32
|
import { getColor } from '../../../../utils'
|
|
40
33
|
import { DlBadge, DlTypography } from '../../../essential'
|
|
41
34
|
|
|
@@ -57,8 +50,8 @@ export default defineComponent({
|
|
|
57
50
|
default: '100%'
|
|
58
51
|
},
|
|
59
52
|
datasets: {
|
|
60
|
-
type: Array
|
|
61
|
-
default: () => [] as
|
|
53
|
+
type: Array as PropType<ChartDataset[]>,
|
|
54
|
+
default: () => [] as any as ChartDataset[]
|
|
62
55
|
},
|
|
63
56
|
alignItems: {
|
|
64
57
|
type: String as PropType<'left' | 'right' | 'center'>,
|
|
@@ -75,17 +68,17 @@ export default defineComponent({
|
|
|
75
68
|
}
|
|
76
69
|
},
|
|
77
70
|
methods: {
|
|
78
|
-
onMouseEnter(item:
|
|
71
|
+
onMouseEnter(item: ChartDataset, index: number) {
|
|
79
72
|
if (!item.hidden) {
|
|
80
73
|
this.$emit('on-hover', item, index)
|
|
81
74
|
}
|
|
82
75
|
},
|
|
83
|
-
onMouseLeave(item:
|
|
76
|
+
onMouseLeave(item: ChartDataset, index: number) {
|
|
84
77
|
if (!item.hidden) {
|
|
85
78
|
this.$emit('on-leave', item, index)
|
|
86
79
|
}
|
|
87
80
|
},
|
|
88
|
-
hideData(event: Event, item:
|
|
81
|
+
hideData(event: Event, item: ChartDataset, index: number) {
|
|
89
82
|
this.$emit(
|
|
90
83
|
'hide',
|
|
91
84
|
{
|
|
@@ -95,7 +88,11 @@ export default defineComponent({
|
|
|
95
88
|
index
|
|
96
89
|
)
|
|
97
90
|
},
|
|
98
|
-
getColor
|
|
91
|
+
getColor: (item: ChartDataset) => {
|
|
92
|
+
if ((item.backgroundColor as any)?.replace) {
|
|
93
|
+
return getColor((item.backgroundColor as any).replace('--', ''))
|
|
94
|
+
}
|
|
95
|
+
}
|
|
99
96
|
}
|
|
100
97
|
})
|
|
101
98
|
</script>
|
|
@@ -40,14 +40,8 @@
|
|
|
40
40
|
data-test="track-container"
|
|
41
41
|
v-on="trackContainerEvents"
|
|
42
42
|
>
|
|
43
|
-
<div
|
|
44
|
-
class="
|
|
45
|
-
:style="trackStyle"
|
|
46
|
-
>
|
|
47
|
-
<div
|
|
48
|
-
class="selection"
|
|
49
|
-
:style="selectionBarStyle"
|
|
50
|
-
/>
|
|
43
|
+
<div class="track" :style="trackStyle">
|
|
44
|
+
<div class="selection" :style="selectionBarStyle" />
|
|
51
45
|
<div
|
|
52
46
|
key="tmin"
|
|
53
47
|
ref="minThumbRef"
|
|
@@ -67,7 +61,7 @@
|
|
|
67
61
|
type="hidden"
|
|
68
62
|
:name="name"
|
|
69
63
|
:value="displayValue"
|
|
70
|
-
|
|
64
|
+
/>
|
|
71
65
|
</div>
|
|
72
66
|
</div>
|
|
73
67
|
</div>
|
|
@@ -341,11 +341,13 @@ import {
|
|
|
341
341
|
getLabel,
|
|
342
342
|
getIconSize,
|
|
343
343
|
optionsValidator,
|
|
344
|
-
DlSelectOptionType,
|
|
345
344
|
getLabelOfSelectedOption,
|
|
346
345
|
getCaseInsensitiveInput
|
|
347
346
|
} from './utils'
|
|
348
|
-
import {
|
|
347
|
+
import {
|
|
348
|
+
DlSelectOption as DlSelectOptionEntry,
|
|
349
|
+
DlSelectOptionType
|
|
350
|
+
} from '../types'
|
|
349
351
|
import DlSelectOption from './components/DlSelectOption.vue'
|
|
350
352
|
import { cloneDeep, isEqual } from 'lodash'
|
|
351
353
|
import { getColor } from '../../../utils'
|
|
@@ -1219,7 +1221,9 @@ export default defineComponent({
|
|
|
1219
1221
|
justify-content: center !important;
|
|
1220
1222
|
align-items: center;
|
|
1221
1223
|
color: var(--dl-color-medium);
|
|
1222
|
-
transition-property:
|
|
1224
|
+
transition-property:
|
|
1225
|
+
transform,
|
|
1226
|
+
-webkit-transform;
|
|
1223
1227
|
transition-duration: 0.28s, 0.28s;
|
|
1224
1228
|
transition-timing-function: ease, ease;
|
|
1225
1229
|
transition-delay: 0s, 0s;
|