@dataloop-ai/components 0.17.83 → 0.17.85
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/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +19 -4
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/utils.ts +2 -1
- package/src/components/compound/DlSelect/DlSelect.vue +12 -2
- package/src/components/essential/DlMenu/DlMenu.vue +3 -0
- package/src/demos/DlSelectDemo.vue +26 -12
package/package.json
CHANGED
|
@@ -79,10 +79,15 @@
|
|
|
79
79
|
<div class="x-axis">
|
|
80
80
|
<span
|
|
81
81
|
v-for="(label, index) in visibleLabels"
|
|
82
|
+
ref="xAxis"
|
|
82
83
|
:key="index"
|
|
83
84
|
class="x-axis__element"
|
|
84
85
|
:style="`${
|
|
85
|
-
!labelImages[0]
|
|
86
|
+
!labelImages[0]
|
|
87
|
+
? `transform: rotate(${
|
|
88
|
+
rotateXLabels ? '70' : '0'
|
|
89
|
+
}deg);`
|
|
90
|
+
: ''
|
|
86
91
|
}`"
|
|
87
92
|
>
|
|
88
93
|
<span class="x-axis__element--text">
|
|
@@ -227,6 +232,7 @@ export default defineComponent({
|
|
|
227
232
|
max: props.matrix.length
|
|
228
233
|
})
|
|
229
234
|
const cellWidth = ref<number | null>(null)
|
|
235
|
+
const rotateXLabels = ref(true)
|
|
230
236
|
|
|
231
237
|
const getCellBackground = (value: number = 1): string => {
|
|
232
238
|
const object: { [key: string]: any } = {
|
|
@@ -251,7 +257,8 @@ export default defineComponent({
|
|
|
251
257
|
getCellTextColor,
|
|
252
258
|
cellWidth,
|
|
253
259
|
tooltipState,
|
|
254
|
-
currentBrushState
|
|
260
|
+
currentBrushState,
|
|
261
|
+
rotateXLabels
|
|
255
262
|
}
|
|
256
263
|
},
|
|
257
264
|
computed: {
|
|
@@ -309,6 +316,14 @@ export default defineComponent({
|
|
|
309
316
|
this.currentBrushState.max = value.length
|
|
310
317
|
this.resizeMatrix()
|
|
311
318
|
}
|
|
319
|
+
},
|
|
320
|
+
currentBrushState() {
|
|
321
|
+
const longest = Math.max(
|
|
322
|
+
...this.visibleLabels.map(
|
|
323
|
+
(el: DlConfusionMatrixLabel) => el.title.length
|
|
324
|
+
)
|
|
325
|
+
)
|
|
326
|
+
this.rotateXLabels = longest * 12 > getCellWidth()
|
|
312
327
|
}
|
|
313
328
|
},
|
|
314
329
|
mounted() {
|
|
@@ -424,7 +439,7 @@ export default defineComponent({
|
|
|
424
439
|
.x-axis {
|
|
425
440
|
width: 100%;
|
|
426
441
|
display: flex;
|
|
427
|
-
justify-content: space-
|
|
442
|
+
justify-content: space-evenly;
|
|
428
443
|
margin-top: 10px;
|
|
429
444
|
min-height: 100px;
|
|
430
445
|
max-height: 100px;
|
|
@@ -482,7 +497,7 @@ export default defineComponent({
|
|
|
482
497
|
grid-template-columns: repeat(var(--matrix-rows), 1fr);
|
|
483
498
|
|
|
484
499
|
&__cell {
|
|
485
|
-
font-size:
|
|
500
|
+
font-size: 12px;
|
|
486
501
|
cursor: pointer;
|
|
487
502
|
border: 1px solid var(--dl-color-separator);
|
|
488
503
|
box-sizing: border-box;
|
|
@@ -2,7 +2,8 @@ import { isObject } from 'lodash'
|
|
|
2
2
|
import { DlConfusionMatrixCell, DlConfusionMatrixLabel } from '../../types'
|
|
3
3
|
|
|
4
4
|
export function getCellWidth() {
|
|
5
|
-
return document.querySelector('.matrix__cell')
|
|
5
|
+
return document.querySelector('.matrix__cell')?.getBoundingClientRect()
|
|
6
|
+
.width
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export function setZoom(zoom: number, el: HTMLElement) {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
<span v-show="!!tooltip.length">
|
|
27
27
|
<dl-icon
|
|
28
28
|
icon="icon-dl-info"
|
|
29
|
+
:inline="false"
|
|
29
30
|
class="tooltip-icon"
|
|
30
31
|
size="12px"
|
|
31
32
|
/>
|
|
@@ -82,6 +83,9 @@
|
|
|
82
83
|
@focus="handleSearchFocus"
|
|
83
84
|
@blur="handleSearchBlur"
|
|
84
85
|
>
|
|
86
|
+
<dl-tooltip v-if="disabled">
|
|
87
|
+
{{ disabledTooltip }}
|
|
88
|
+
</dl-tooltip>
|
|
85
89
|
<div
|
|
86
90
|
v-if="hasSelectedSlot"
|
|
87
91
|
style="width: 100%"
|
|
@@ -129,6 +133,7 @@
|
|
|
129
133
|
>
|
|
130
134
|
<dl-icon
|
|
131
135
|
:icon="dropdownIcon"
|
|
136
|
+
:color="chevronIconColor"
|
|
132
137
|
class="expand-icon"
|
|
133
138
|
:inline="false"
|
|
134
139
|
:size="withoutBorders ? '12px' : '16px'"
|
|
@@ -391,7 +396,8 @@ export default defineComponent({
|
|
|
391
396
|
withoutDropdownIconPadding: { type: Boolean, default: false },
|
|
392
397
|
clearButtonTooltip: { type: Boolean, default: false },
|
|
393
398
|
dropdownMaxHeight: { type: String, default: '30vh' },
|
|
394
|
-
preserveSearch: { type: Boolean, default: false }
|
|
399
|
+
preserveSearch: { type: Boolean, default: false },
|
|
400
|
+
disabledTooltip: { type: String, default: 'Disabled' }
|
|
395
401
|
},
|
|
396
402
|
emits: [
|
|
397
403
|
'search-focus',
|
|
@@ -613,7 +619,8 @@ export default defineComponent({
|
|
|
613
619
|
'--dl-select-width': this.width,
|
|
614
620
|
'--dl-select-expand-icon-width': this.withoutDropdownIconPadding
|
|
615
621
|
? '16px'
|
|
616
|
-
: '28px'
|
|
622
|
+
: '28px',
|
|
623
|
+
'--dl-menu-scrollbar-width': '10px'
|
|
617
624
|
}
|
|
618
625
|
},
|
|
619
626
|
asteriskClasses(): string[] {
|
|
@@ -637,6 +644,9 @@ export default defineComponent({
|
|
|
637
644
|
return !!this.$scopedSlots.prepend && !this.isSmall
|
|
638
645
|
}
|
|
639
646
|
return !!this.$slots.prepend && !this.isSmall
|
|
647
|
+
},
|
|
648
|
+
chevronIconColor() {
|
|
649
|
+
return `${this.disabled ? 'dl-color-disabled' : null}`
|
|
640
650
|
}
|
|
641
651
|
},
|
|
642
652
|
watch: {
|
|
@@ -452,6 +452,9 @@ export default defineComponent({
|
|
|
452
452
|
border-radius: 2px;
|
|
453
453
|
overflow-y: auto;
|
|
454
454
|
overflow-x: hidden;
|
|
455
|
+
&::-webkit-scrollbar {
|
|
456
|
+
width: var(--dl-menu-scrollbar-width, 5px);
|
|
457
|
+
}
|
|
455
458
|
outline: 0;
|
|
456
459
|
max-height: 65vh;
|
|
457
460
|
z-index: var(--dl-z-index-menu);
|
|
@@ -64,19 +64,23 @@
|
|
|
64
64
|
{
|
|
65
65
|
label: 'Status 1',
|
|
66
66
|
value: 1,
|
|
67
|
-
badgeColor: 'dl-color-disabled'
|
|
67
|
+
badgeColor: 'var(--dl-color-disabled)'
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
label: 'Status 2',
|
|
71
71
|
value: 2,
|
|
72
|
-
badgeColor: 'dl-color-secondary'
|
|
72
|
+
badgeColor: 'var(--dl-color-secondary)'
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
label: 'Status 3',
|
|
76
76
|
value: 3,
|
|
77
|
-
badgeColor: 'dl-color-positive'
|
|
77
|
+
badgeColor: 'var(--dl-color-positive)'
|
|
78
78
|
},
|
|
79
|
-
{
|
|
79
|
+
{
|
|
80
|
+
label: 'Status 4',
|
|
81
|
+
value: 4,
|
|
82
|
+
badgeColor: 'var(--dl-color-warning)'
|
|
83
|
+
}
|
|
80
84
|
]"
|
|
81
85
|
required
|
|
82
86
|
>
|
|
@@ -125,7 +129,6 @@
|
|
|
125
129
|
:options="searchOptions"
|
|
126
130
|
size="m"
|
|
127
131
|
multiselect
|
|
128
|
-
style="background-color: beige"
|
|
129
132
|
placeholder="contributors"
|
|
130
133
|
search
|
|
131
134
|
/>
|
|
@@ -179,34 +182,42 @@
|
|
|
179
182
|
subLabel: 'not so high',
|
|
180
183
|
label: 'High',
|
|
181
184
|
value: 'high',
|
|
182
|
-
|
|
185
|
+
labelColor: 'var(--dl-color-darker)',
|
|
186
|
+
subLabelColor: 'var(--dl-color-lighter)'
|
|
183
187
|
},
|
|
184
188
|
{
|
|
185
189
|
subLabel: 'not so medium',
|
|
186
190
|
label: 'Medium',
|
|
187
191
|
value: 'medium',
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
labelColor: 'var(--dl-color-darker)',
|
|
193
|
+
subLabelColor: 'var(--dl-color-lighter)'
|
|
190
194
|
},
|
|
191
195
|
{
|
|
192
196
|
subLabel: 'not so low',
|
|
193
197
|
label: 'Low',
|
|
194
198
|
value: 'low',
|
|
195
|
-
|
|
196
|
-
|
|
199
|
+
labelColor: 'var(--dl-color-darker)',
|
|
200
|
+
subLabelColor: 'var(--dl-color-lighter)'
|
|
197
201
|
}
|
|
198
202
|
]"
|
|
199
203
|
>
|
|
200
204
|
<template #option="scope">
|
|
201
205
|
<div style="padding: 5px 0px">
|
|
202
|
-
<div
|
|
203
|
-
|
|
206
|
+
<div :style="`color: ${scope.opt.labelColor}`">
|
|
207
|
+
{{ scope.opt.label }}
|
|
208
|
+
</div>
|
|
209
|
+
<div
|
|
210
|
+
:style="`color: ${scope.opt.subLabelColor}; font-size: 10px`"
|
|
211
|
+
>
|
|
212
|
+
{{ scope.opt.subLabel }}
|
|
213
|
+
</div>
|
|
204
214
|
</div>
|
|
205
215
|
</template>
|
|
206
216
|
</dl-select>
|
|
207
217
|
With tooltip
|
|
208
218
|
<dl-select
|
|
209
219
|
v-model="selectedOption"
|
|
220
|
+
title="With tooltip"
|
|
210
221
|
:tooltip="'Test Me'"
|
|
211
222
|
:options="[
|
|
212
223
|
{
|
|
@@ -523,6 +534,9 @@ export default defineComponent({
|
|
|
523
534
|
},
|
|
524
535
|
handleInput(e: Event) {
|
|
525
536
|
return (e.target as HTMLInputElement).value
|
|
537
|
+
},
|
|
538
|
+
log(e: any) {
|
|
539
|
+
console.log(e)
|
|
526
540
|
}
|
|
527
541
|
}
|
|
528
542
|
})
|