@dataloop-ai/components 0.20.0 → 0.20.1
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 +19 -11
- package/src/components/compound/DlCard/DlCard.vue +48 -14
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +1 -1
- package/src/components/compound/DlCharts/components/DlChartLabels.vue +25 -21
- package/src/components/compound/DlCharts/components/DlChartLegend.vue +17 -14
- package/src/components/compound/DlRange/DlRange.vue +9 -3
- package/src/components/compound/DlSelect/components/DlSelectOption.vue +1 -1
- package/src/components/compound/DlSelect/types.ts +1 -2
- package/src/components/compound/DlSlider/useSlider.ts +1 -4
- package/src/components/compound/DlTable/components/DlTh.vue +3 -6
- package/src/components/compound/DlTable/components/SortableJS.vue +8 -3
- package/src/components/compound/DlThumbnailGallery/DlThumbnailGallery.vue +18 -9
- package/src/components/essential/DlTypography/DlTypography.vue +14 -6
- package/src/components/essential/types.ts +0 -1
- package/src/demos/DlChipDemo.vue +84 -24
- package/src/demos/DlCounterDemo.vue +1 -1
- package/src/demos/DlDatasetBrowserLayoutDemo/components/MainContent/ActionsMenu.vue +7 -4
- package/src/demos/DlDatasetBrowserLayoutDemo/components/MainContent/AutomationMenu.vue +19 -7
- package/src/demos/DlDatasetBrowserLayoutDemo/components/MainContent/CardView.vue +7 -13
- package/src/demos/DlDatasetBrowserLayoutDemo/components/filters/AddFilter.vue +23 -10
- package/src/demos/DlDateTimeRangeDemo.vue +16 -19
- package/src/demos/DlLabelPickerDemo.vue +5 -8
- package/src/demos/DlMenuDemo.vue +2 -2
- package/src/demos/DlSelectDemo.vue +10 -10
- package/src/demos/DlStepperDemo/steps/GeneralStep.vue +5 -8
- package/src/demos/DlStudioLayoutDemo/components/StudioLeftDrawer.vue +4 -10
- package/src/demos/DlStudioLayoutDemo/components/StudioTabsMenu.vue +10 -2
- package/src/demos/DlTextInputDemo.vue +5 -5
- package/src/demos/DlThDemo.vue +4 -5
- package/src/demos/DlTooltipDemo.vue +1 -1
- package/src/demos/DlTreeTableDemo.vue +7 -6
- package/src/demos/DlTypographyDemo.vue +8 -11
- package/src/demos/DlVirtualScrollDemo.vue +13 -7
- package/tsconfig.json +1 -1
- package/vite.config.ts +3 -0
- package/src/components/essential/DlTypography/types.ts +0 -19
- package/tsconfig.vue.json +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataloop-ai/components",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.1",
|
|
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
|
|
13
|
+
"build": "npm run preserve && vue-tsc --noEmit --skipLibCheck && 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.91",
|
|
27
|
+
"@types/flat": "^5.0.2",
|
|
28
|
+
"@types/lodash": "^4.14.184",
|
|
29
|
+
"@types/sortablejs": "^1.15.7",
|
|
30
|
+
"chart.js": "^3.9.1",
|
|
31
31
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
32
|
-
"flat": "^
|
|
33
|
-
"highlight.js": "^11.
|
|
32
|
+
"flat": "^5.0.2",
|
|
33
|
+
"highlight.js": "^11.8.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": "^11.1.1",
|
|
36
|
+
"moment": "^2.29.4",
|
|
37
|
+
"sass": "^1.51.0",
|
|
38
|
+
"sass-loader": "^12.6.0",
|
|
39
|
+
"sortablejs": "^1.15.0",
|
|
40
|
+
"uuid": "^8.3.2",
|
|
41
|
+
"v-wave": "^1.5.0",
|
|
42
|
+
"vanilla-jsoneditor": "^0.10.2",
|
|
43
|
+
"vue-demi": "^0.14.5",
|
|
44
44
|
"vue-sortable": "^0.1.3",
|
|
45
|
-
"vue2-teleport": "^1.1
|
|
45
|
+
"vue2-teleport": "^1.0.1"
|
|
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.17.9",
|
|
49
|
+
"@mdx-js/react": "^2.1.1",
|
|
50
|
+
"@storybook/addon-actions": "^7.0.4",
|
|
51
|
+
"@storybook/addon-essentials": "^7.0.4",
|
|
52
|
+
"@storybook/addon-links": "^7.0.4",
|
|
53
|
+
"@storybook/addon-mdx-gfm": "^7.0.4",
|
|
54
|
+
"@storybook/client-api": "^7.0.4",
|
|
55
|
+
"@storybook/vue3": "^7.0.4",
|
|
56
|
+
"@storybook/vue3-vite": "^7.0.4",
|
|
57
|
+
"@types/jsdom": "^16.2.14",
|
|
58
|
+
"@types/node": "^18.7.18",
|
|
59
|
+
"@types/resize-observer-browser": "^0.1.7",
|
|
60
|
+
"@types/uuid": "^8.3.4",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
|
62
|
+
"@typescript-eslint/parser": "^5.20.0",
|
|
63
|
+
"@vitejs/plugin-vue": "^4.0.0",
|
|
64
|
+
"@vitest/coverage-c8": "^0.29.2",
|
|
65
|
+
"@vue/eslint-config-prettier": "^7.0.0",
|
|
66
|
+
"@vue/eslint-config-typescript": "^10.0.0",
|
|
67
|
+
"@vue/test-utils": "^2.0.0-rc.18",
|
|
68
|
+
"babel-loader": "^8.2.4",
|
|
69
|
+
"eslint": "^8.13.0",
|
|
70
|
+
"eslint-config-prettier": "^8.5.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": "^4.0.0",
|
|
73
|
+
"eslint-plugin-storybook": "^0.6.11",
|
|
74
|
+
"eslint-plugin-vue": "^8.6.0",
|
|
75
|
+
"html-webpack-plugin": "^5.5.0",
|
|
76
|
+
"jsdom": "^21.1.0",
|
|
77
|
+
"lint-staged": "^12.3.8",
|
|
78
78
|
"pre-commit": "^1.2.2",
|
|
79
|
-
"prettier": "^
|
|
80
|
-
"react": "^18.
|
|
81
|
-
"react-dom": "^18.
|
|
82
|
-
"storybook": "^
|
|
79
|
+
"prettier": "^2.6.2",
|
|
80
|
+
"react": "^18.1.0",
|
|
81
|
+
"react-dom": "^18.2.0",
|
|
82
|
+
"storybook": "^7.0.4",
|
|
83
83
|
"storybook-addon-themes": "^6.1.0",
|
|
84
|
-
"typescript": "^5.4
|
|
85
|
-
"vite": "^5.2
|
|
86
|
-
"vitest": "^
|
|
87
|
-
"vitest-canvas-mock": "^0.
|
|
88
|
-
"vue": "^3.4
|
|
84
|
+
"typescript": "^4.5.4",
|
|
85
|
+
"vite": "^4.5.2",
|
|
86
|
+
"vitest": "^0.29.2",
|
|
87
|
+
"vitest-canvas-mock": "^0.2.2",
|
|
88
|
+
"vue": "^3.3.4",
|
|
89
89
|
"vue-composition-test-utils": "^1.0.3",
|
|
90
|
-
"vue-loader": "^
|
|
91
|
-
"vue-tsc": "^
|
|
90
|
+
"vue-loader": "^16.8.3",
|
|
91
|
+
"vue-tsc": "^0.35.2"
|
|
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(): object {
|
|
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,12 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:id="uuid"
|
|
4
|
+
ref="rootRef"
|
|
5
|
+
class="root"
|
|
6
|
+
:style="rootStyle"
|
|
7
|
+
>
|
|
3
8
|
<div class="progress-bar">
|
|
4
9
|
<div
|
|
5
10
|
v-for="item in progressBarItems"
|
|
6
11
|
:key="item.index"
|
|
7
12
|
:style="getBarItemStyles(item)"
|
|
8
13
|
>
|
|
9
|
-
<dl-tooltip
|
|
14
|
+
<dl-tooltip
|
|
15
|
+
anchor="center middle"
|
|
16
|
+
self="bottom middle"
|
|
17
|
+
>
|
|
10
18
|
{{ item.tooltipText }}
|
|
11
19
|
</dl-tooltip>
|
|
12
20
|
</div>
|
|
@@ -21,7 +29,10 @@
|
|
|
21
29
|
<dl-tooltip v-if="isOverflowing[item.index]">
|
|
22
30
|
{{ item.name }}
|
|
23
31
|
</dl-tooltip>
|
|
24
|
-
<span
|
|
32
|
+
<span
|
|
33
|
+
class="circle"
|
|
34
|
+
:style="{ backgroundColor: item.color }"
|
|
35
|
+
/>
|
|
25
36
|
<div
|
|
26
37
|
v-if="isVue2"
|
|
27
38
|
ref="textRef"
|
|
@@ -35,7 +46,7 @@
|
|
|
35
46
|
v-else
|
|
36
47
|
:ref="
|
|
37
48
|
(el) => {
|
|
38
|
-
|
|
49
|
+
textRef[item.index] = el
|
|
39
50
|
}
|
|
40
51
|
"
|
|
41
52
|
:data-index="item.index"
|
|
@@ -52,10 +63,10 @@
|
|
|
52
63
|
:size="12"
|
|
53
64
|
color="color"
|
|
54
65
|
data-test="counter-link"
|
|
55
|
-
>({{ item.value }})</dl-link
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
>
|
|
66
|
+
>({{ item.value }})</dl-link><span
|
|
67
|
+
v-else
|
|
68
|
+
data-test="counter-text"
|
|
69
|
+
>({{ item.value }})</span>
|
|
59
70
|
</span>
|
|
60
71
|
</div>
|
|
61
72
|
</div>
|
|
@@ -209,9 +220,6 @@ export default defineComponent({
|
|
|
209
220
|
flexShrink: item.percentage,
|
|
210
221
|
backgroundColor: item.color
|
|
211
222
|
}
|
|
212
|
-
},
|
|
213
|
-
setTextRef(index: number, el: any) {
|
|
214
|
-
this.textRef[index] = el as any
|
|
215
223
|
}
|
|
216
224
|
},
|
|
217
225
|
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
@mouseleave="onCardMouseleave"
|
|
7
7
|
@click="onCardClick"
|
|
8
8
|
>
|
|
9
|
-
<div
|
|
9
|
+
<div
|
|
10
|
+
v-if="icon && !isEmpty"
|
|
11
|
+
class="card--icon"
|
|
12
|
+
>
|
|
10
13
|
<dl-icon
|
|
11
14
|
:icon="icon.icon"
|
|
12
15
|
:styles="iconStyles"
|
|
@@ -14,13 +17,20 @@
|
|
|
14
17
|
:color="iconColor"
|
|
15
18
|
/>
|
|
16
19
|
</div>
|
|
17
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
v-else-if="image && !isEmpty"
|
|
22
|
+
class="card--image"
|
|
23
|
+
>
|
|
18
24
|
<div
|
|
19
25
|
v-if="interactive && hasImageLink"
|
|
20
26
|
class="card--image__link-icon"
|
|
21
27
|
@click="stopPropagationEvent"
|
|
22
28
|
>
|
|
23
|
-
<DlLink
|
|
29
|
+
<DlLink
|
|
30
|
+
newtab
|
|
31
|
+
external
|
|
32
|
+
:href="imageLink"
|
|
33
|
+
>
|
|
24
34
|
<dl-icon
|
|
25
35
|
:icon="image.link.icon"
|
|
26
36
|
:size="image.link.size"
|
|
@@ -43,7 +53,7 @@
|
|
|
43
53
|
class="card--image__image-holder__image"
|
|
44
54
|
:onload="onImageLoad"
|
|
45
55
|
@mousemove="movePreview"
|
|
46
|
-
|
|
56
|
+
>
|
|
47
57
|
<div
|
|
48
58
|
v-if="hasMagnifyingGlass"
|
|
49
59
|
ref="magnifyingGlass"
|
|
@@ -67,11 +77,14 @@
|
|
|
67
77
|
:src="image.src"
|
|
68
78
|
:alt="imageAlt"
|
|
69
79
|
class="card--image__image-preview__image"
|
|
70
|
-
|
|
80
|
+
>
|
|
71
81
|
</figure>
|
|
72
82
|
</dl-tooltip>
|
|
73
83
|
</div>
|
|
74
|
-
<div
|
|
84
|
+
<div
|
|
85
|
+
v-if="!isEmpty"
|
|
86
|
+
class="card--content"
|
|
87
|
+
>
|
|
75
88
|
<div>
|
|
76
89
|
<slot name="header">
|
|
77
90
|
<div v-if="interactive">
|
|
@@ -104,7 +117,10 @@
|
|
|
104
117
|
</div>
|
|
105
118
|
</div>
|
|
106
119
|
</div>
|
|
107
|
-
<div
|
|
120
|
+
<div
|
|
121
|
+
v-else
|
|
122
|
+
class="card--header"
|
|
123
|
+
>
|
|
108
124
|
<span class="card--header_title">{{ title }}</span>
|
|
109
125
|
</div>
|
|
110
126
|
</slot>
|
|
@@ -152,14 +168,20 @@
|
|
|
152
168
|
</dl-ellipsis>
|
|
153
169
|
</div>
|
|
154
170
|
</div>
|
|
155
|
-
<span
|
|
171
|
+
<span
|
|
172
|
+
v-else
|
|
173
|
+
class="card--content_text"
|
|
174
|
+
>{{ text }}</span>
|
|
156
175
|
</slot>
|
|
157
176
|
</div>
|
|
158
177
|
<slot name="footer">
|
|
159
178
|
<div v-if="interactive">
|
|
160
179
|
<div class="card__interactive-description">
|
|
161
180
|
<div class="flex full-width items-center">
|
|
162
|
-
<dl-typography
|
|
181
|
+
<dl-typography
|
|
182
|
+
size="10px"
|
|
183
|
+
color="dl-color-medium"
|
|
184
|
+
>
|
|
163
185
|
Description
|
|
164
186
|
</dl-typography>
|
|
165
187
|
</div>
|
|
@@ -171,7 +193,10 @@
|
|
|
171
193
|
</div>
|
|
172
194
|
</div>
|
|
173
195
|
<div class="card__interactive-description__text">
|
|
174
|
-
<dl-ellipsis
|
|
196
|
+
<dl-ellipsis
|
|
197
|
+
v-if="description"
|
|
198
|
+
:text="description"
|
|
199
|
+
/>
|
|
175
200
|
<dl-typography
|
|
176
201
|
v-else
|
|
177
202
|
size="12px"
|
|
@@ -181,7 +206,10 @@
|
|
|
181
206
|
</dl-typography>
|
|
182
207
|
</div>
|
|
183
208
|
</div>
|
|
184
|
-
<div
|
|
209
|
+
<div
|
|
210
|
+
v-else
|
|
211
|
+
class="card--links"
|
|
212
|
+
>
|
|
185
213
|
<div
|
|
186
214
|
v-for="(link, idx) in links"
|
|
187
215
|
:key="idx"
|
|
@@ -211,8 +239,14 @@
|
|
|
211
239
|
v-if="isEmpty && emptyStateProps"
|
|
212
240
|
v-bind="emptyStateProps"
|
|
213
241
|
>
|
|
214
|
-
<template
|
|
215
|
-
|
|
242
|
+
<template
|
|
243
|
+
v-for="(_, slot) in $slots"
|
|
244
|
+
#[slot]="props"
|
|
245
|
+
>
|
|
246
|
+
<slot
|
|
247
|
+
:name="slot"
|
|
248
|
+
v-bind="props"
|
|
249
|
+
/>
|
|
216
250
|
</template>
|
|
217
251
|
</dl-empty-state>
|
|
218
252
|
</div>
|
|
@@ -270,7 +304,7 @@ export default defineComponent({
|
|
|
270
304
|
},
|
|
271
305
|
links: {
|
|
272
306
|
type: Array as PropType<DlCardLinkType[]>,
|
|
273
|
-
default: (): DlCardLinkType[] => []
|
|
307
|
+
default: (): DlCardLinkType[] => []
|
|
274
308
|
},
|
|
275
309
|
height: {
|
|
276
310
|
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) {
|
|
498
498
|
const target = e.target as HTMLElement
|
|
499
499
|
;(this.$refs.yAxisOuter as HTMLElement).scroll(0, target.scrollTop)
|
|
500
500
|
},
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:style="labelStyles"
|
|
4
|
+
class="dl-chart-labels-container"
|
|
5
|
+
>
|
|
3
6
|
<div class="dl-chart-labels">
|
|
4
7
|
<div
|
|
5
|
-
v-for="(label, index) in
|
|
8
|
+
v-for="(label, index) in labels"
|
|
6
9
|
:key="index"
|
|
7
10
|
class="dl-chart-labels--label"
|
|
8
11
|
>
|
|
9
12
|
<dl-tooltip v-if="isOverflowing[index]">
|
|
10
|
-
{{ stringVerification(label.title) }}
|
|
13
|
+
{{ stringVerification(label.title, label) }}
|
|
11
14
|
</dl-tooltip>
|
|
12
15
|
<dl-typography
|
|
13
16
|
v-if="isVue2"
|
|
@@ -16,7 +19,7 @@
|
|
|
16
19
|
:data-index="index"
|
|
17
20
|
:color="labelColor"
|
|
18
21
|
>
|
|
19
|
-
{{ label.title }}
|
|
22
|
+
{{ label.title || label }}
|
|
20
23
|
</dl-typography>
|
|
21
24
|
<dl-typography
|
|
22
25
|
v-else
|
|
@@ -25,13 +28,16 @@
|
|
|
25
28
|
:size="fontSize"
|
|
26
29
|
:color="labelColor"
|
|
27
30
|
>
|
|
28
|
-
{{ stringVerification(label.title) }}
|
|
31
|
+
{{ stringVerification(label.title, label) }}
|
|
29
32
|
</dl-typography>
|
|
30
33
|
</div>
|
|
31
34
|
</div>
|
|
32
|
-
<div
|
|
35
|
+
<div
|
|
36
|
+
v-if="hasSubtitles"
|
|
37
|
+
class="dl-chart-labels"
|
|
38
|
+
>
|
|
33
39
|
<div
|
|
34
|
-
v-for="(label, index) in
|
|
40
|
+
v-for="(label, index) in labels"
|
|
35
41
|
:key="index"
|
|
36
42
|
class="dl-chart-labels--label"
|
|
37
43
|
>
|
|
@@ -58,8 +64,14 @@
|
|
|
58
64
|
</dl-typography>
|
|
59
65
|
</div>
|
|
60
66
|
</div>
|
|
61
|
-
<div
|
|
62
|
-
|
|
67
|
+
<div
|
|
68
|
+
v-if="title"
|
|
69
|
+
class="dl-chart-labels-title"
|
|
70
|
+
>
|
|
71
|
+
<dl-typography
|
|
72
|
+
:size="titleSize"
|
|
73
|
+
:color="titleColor"
|
|
74
|
+
>
|
|
63
75
|
{{ title }}
|
|
64
76
|
</dl-typography>
|
|
65
77
|
</div>
|
|
@@ -153,14 +165,6 @@ export default defineComponent({
|
|
|
153
165
|
}
|
|
154
166
|
},
|
|
155
167
|
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
|
-
},
|
|
164
168
|
labelStyles(): Record<string, string> {
|
|
165
169
|
return {
|
|
166
170
|
'--dl-chart-labels-width': this.width
|
|
@@ -191,13 +195,13 @@ export default defineComponent({
|
|
|
191
195
|
) as Element[])
|
|
192
196
|
: this[elementRef]
|
|
193
197
|
for (const el of elements as Element[]) {
|
|
194
|
-
|
|
198
|
+
(this[ref] as ResizeObserver).observe(el)
|
|
195
199
|
}
|
|
196
200
|
})
|
|
197
201
|
},
|
|
198
202
|
beforeUnmount() {
|
|
199
203
|
observerRefs.forEach(({ ref }) => {
|
|
200
|
-
|
|
204
|
+
(this[ref] as ResizeObserver).disconnect()
|
|
201
205
|
this[ref] = null
|
|
202
206
|
})
|
|
203
207
|
},
|
|
@@ -214,12 +218,12 @@ export default defineComponent({
|
|
|
214
218
|
}
|
|
215
219
|
},
|
|
216
220
|
forwardChildEl(
|
|
217
|
-
el: { $el: Element }
|
|
221
|
+
el: { $el: Element },
|
|
218
222
|
refName: 'textRef' | 'subtitleRef',
|
|
219
223
|
index: number
|
|
220
224
|
) {
|
|
221
225
|
if (el?.$el) {
|
|
222
|
-
|
|
226
|
+
(this[refName] as Element[])[index] = el.$el
|
|
223
227
|
}
|
|
224
228
|
}
|
|
225
229
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:style="legendStyles"
|
|
4
|
+
class="dl-chart-legend"
|
|
5
|
+
>
|
|
3
6
|
<div
|
|
4
7
|
v-for="(item, index) in datasets"
|
|
5
8
|
:key="index"
|
|
6
9
|
class="dl-chart-legend--item"
|
|
7
10
|
:style="{
|
|
8
|
-
'--dl-chart-badge-color': getColor(
|
|
11
|
+
'--dl-chart-badge-color': getColor(
|
|
12
|
+
item.backgroundColor.replace('--', '')
|
|
13
|
+
)
|
|
9
14
|
}"
|
|
10
15
|
@click="hideData($event, item, index)"
|
|
11
16
|
@mouseenter="onMouseEnter(item, index)"
|
|
@@ -13,7 +18,9 @@
|
|
|
13
18
|
>
|
|
14
19
|
<dl-badge
|
|
15
20
|
:color="
|
|
16
|
-
item.hidden
|
|
21
|
+
item.hidden
|
|
22
|
+
? 'var(--dl-color-disabled)'
|
|
23
|
+
: getColor(item.backgroundColor.replace('--', ''))
|
|
17
24
|
"
|
|
18
25
|
/>
|
|
19
26
|
<dl-typography
|
|
@@ -28,7 +35,7 @@
|
|
|
28
35
|
|
|
29
36
|
<script lang="ts">
|
|
30
37
|
import { defineComponent, PropType } from 'vue-demi'
|
|
31
|
-
import type {
|
|
38
|
+
import type { LegendItem, DatasetChartOptions } from 'chart.js'
|
|
32
39
|
import { getColor } from '../../../../utils'
|
|
33
40
|
import { DlBadge, DlTypography } from '../../../essential'
|
|
34
41
|
|
|
@@ -50,8 +57,8 @@ export default defineComponent({
|
|
|
50
57
|
default: '100%'
|
|
51
58
|
},
|
|
52
59
|
datasets: {
|
|
53
|
-
type: Array
|
|
54
|
-
default: () => [] as
|
|
60
|
+
type: Array,
|
|
61
|
+
default: () => [] as unknown as DatasetChartOptions
|
|
55
62
|
},
|
|
56
63
|
alignItems: {
|
|
57
64
|
type: String as PropType<'left' | 'right' | 'center'>,
|
|
@@ -68,17 +75,17 @@ export default defineComponent({
|
|
|
68
75
|
}
|
|
69
76
|
},
|
|
70
77
|
methods: {
|
|
71
|
-
onMouseEnter(item:
|
|
78
|
+
onMouseEnter(item: LegendItem, index: number) {
|
|
72
79
|
if (!item.hidden) {
|
|
73
80
|
this.$emit('on-hover', item, index)
|
|
74
81
|
}
|
|
75
82
|
},
|
|
76
|
-
onMouseLeave(item:
|
|
83
|
+
onMouseLeave(item: LegendItem, index: number) {
|
|
77
84
|
if (!item.hidden) {
|
|
78
85
|
this.$emit('on-leave', item, index)
|
|
79
86
|
}
|
|
80
87
|
},
|
|
81
|
-
hideData(event: Event, item:
|
|
88
|
+
hideData(event: Event, item: LegendItem, index: number) {
|
|
82
89
|
this.$emit(
|
|
83
90
|
'hide',
|
|
84
91
|
{
|
|
@@ -88,11 +95,7 @@ export default defineComponent({
|
|
|
88
95
|
index
|
|
89
96
|
)
|
|
90
97
|
},
|
|
91
|
-
getColor
|
|
92
|
-
if ((item.backgroundColor as any)?.replace) {
|
|
93
|
-
return getColor((item.backgroundColor as any).replace('--', ''))
|
|
94
|
-
}
|
|
95
|
-
}
|
|
98
|
+
getColor
|
|
96
99
|
}
|
|
97
100
|
})
|
|
98
101
|
</script>
|
|
@@ -40,8 +40,14 @@
|
|
|
40
40
|
data-test="track-container"
|
|
41
41
|
v-on="trackContainerEvents"
|
|
42
42
|
>
|
|
43
|
-
<div
|
|
44
|
-
|
|
43
|
+
<div
|
|
44
|
+
class="track"
|
|
45
|
+
:style="trackStyle"
|
|
46
|
+
>
|
|
47
|
+
<div
|
|
48
|
+
class="selection"
|
|
49
|
+
:style="selectionBarStyle"
|
|
50
|
+
/>
|
|
45
51
|
<div
|
|
46
52
|
key="tmin"
|
|
47
53
|
ref="minThumbRef"
|
|
@@ -61,7 +67,7 @@
|
|
|
61
67
|
type="hidden"
|
|
62
68
|
:name="name"
|
|
63
69
|
:value="displayValue"
|
|
64
|
-
|
|
70
|
+
>
|
|
65
71
|
</div>
|
|
66
72
|
</div>
|
|
67
73
|
</div>
|
|
@@ -231,7 +231,7 @@ export default defineComponent({
|
|
|
231
231
|
getOptionLabel(option: any) {
|
|
232
232
|
return getLabel(option) ?? this.getOptionValue(option)
|
|
233
233
|
},
|
|
234
|
-
getOptionHtml(option: DlSelectOptionType
|
|
234
|
+
getOptionHtml(option: DlSelectOptionType) {
|
|
235
235
|
const label = `${this.getOptionLabel(option)}`
|
|
236
236
|
let highlightedHtml = label
|
|
237
237
|
|