@dataloop-ai/components 0.18.11 → 0.18.12
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/DlAccordion/DlAccordion.vue +3 -10
- package/src/components/basic/DlButton/DlButton.vue +2 -2
- package/src/components/basic/DlChip/DlChip.vue +2 -2
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +14 -7
- package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +2 -2
- package/src/components/essential/DlTypography/DlTypography.vue +2 -2
- package/src/components/shared/types.ts +1 -1
- package/src/demos/DlAccordionDemo.vue +0 -32
package/package.json
CHANGED
|
@@ -25,11 +25,7 @@
|
|
|
25
25
|
<div
|
|
26
26
|
ref="dlAccordionContent"
|
|
27
27
|
class="accordion-content"
|
|
28
|
-
:class="{
|
|
29
|
-
closed: !isOpen,
|
|
30
|
-
'right-side': rightSide,
|
|
31
|
-
'accordion-content__border': separator
|
|
32
|
-
}"
|
|
28
|
+
:class="{ closed: !isOpen, 'right-side': rightSide }"
|
|
33
29
|
>
|
|
34
30
|
<slot v-if="isOpen && !isEmpty" />
|
|
35
31
|
<dl-empty-state
|
|
@@ -79,8 +75,7 @@ export default defineComponent({
|
|
|
79
75
|
emptyStateProps: {
|
|
80
76
|
type: Object as PropType<DlEmptyStateProps>,
|
|
81
77
|
default: null
|
|
82
|
-
}
|
|
83
|
-
separator: { type: Boolean, default: false }
|
|
78
|
+
}
|
|
84
79
|
},
|
|
85
80
|
emits: ['update:model-value', 'hide', 'show'],
|
|
86
81
|
data() {
|
|
@@ -121,11 +116,9 @@ export default defineComponent({
|
|
|
121
116
|
line-height: 16px;
|
|
122
117
|
padding: 0 16px 15px 38px;
|
|
123
118
|
color: var(--dl-color-darker);
|
|
119
|
+
border-bottom: 1px solid var(--dl-color-separator);
|
|
124
120
|
max-height: fit-content;
|
|
125
121
|
overflow: hidden;
|
|
126
|
-
&__border {
|
|
127
|
-
border-bottom: 1px solid var(--dl-color-separator);
|
|
128
|
-
}
|
|
129
122
|
&.right-side {
|
|
130
123
|
padding: 0 38px 16px 16px;
|
|
131
124
|
}
|
|
@@ -77,7 +77,7 @@ import { colorNames } from '../../../utils/css-color-names'
|
|
|
77
77
|
import { useSizeObserver } from '../../../hooks/use-size-observer'
|
|
78
78
|
import { v4 } from 'uuid'
|
|
79
79
|
import { ButtonColors } from './types'
|
|
80
|
-
import {
|
|
80
|
+
import { transformOptions } from '../../shared/types'
|
|
81
81
|
import { stringStyleToRecord } from '../../../utils'
|
|
82
82
|
import { textTransform } from '../../../utils/string'
|
|
83
83
|
import { isString } from 'lodash'
|
|
@@ -153,7 +153,7 @@ export default defineComponent({
|
|
|
153
153
|
type: String,
|
|
154
154
|
default: 'default',
|
|
155
155
|
validator: (value: string): boolean =>
|
|
156
|
-
|
|
156
|
+
transformOptions.includes(value)
|
|
157
157
|
},
|
|
158
158
|
/**
|
|
159
159
|
* Doesn't allow the button's text to be wrapped along multiple rows
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
setRemoveIconWidth
|
|
64
64
|
} from './utils'
|
|
65
65
|
import { v4 } from 'uuid'
|
|
66
|
-
import {
|
|
66
|
+
import { transformOptions } from '../../shared/types'
|
|
67
67
|
|
|
68
68
|
export default defineComponent({
|
|
69
69
|
name: 'DlChip',
|
|
@@ -87,7 +87,7 @@ export default defineComponent({
|
|
|
87
87
|
type: String,
|
|
88
88
|
default: 'default',
|
|
89
89
|
validator: (value: string): boolean =>
|
|
90
|
-
|
|
90
|
+
transformOptions.includes(value)
|
|
91
91
|
},
|
|
92
92
|
overflow: { type: Boolean, default: false },
|
|
93
93
|
fit: { type: Boolean, default: false }
|
|
@@ -173,10 +173,12 @@
|
|
|
173
173
|
thumb-size="20px"
|
|
174
174
|
:max="matrix.length"
|
|
175
175
|
:min-range="2"
|
|
176
|
+
:max-range="cellDisplayLimit"
|
|
176
177
|
:selection-color="getCellBackground(0.1)"
|
|
177
178
|
:color="getCellBackground()"
|
|
178
179
|
:step="1"
|
|
179
180
|
drag-range
|
|
181
|
+
:model-value="currentBrushState"
|
|
180
182
|
@update:model-value="handleBrushUpdate"
|
|
181
183
|
/>
|
|
182
184
|
<span class="label-tag x"> {{ bottomLabel }} </span>
|
|
@@ -250,6 +252,10 @@ export default defineComponent({
|
|
|
250
252
|
type: Boolean,
|
|
251
253
|
default: true
|
|
252
254
|
},
|
|
255
|
+
cellDisplayLimit: {
|
|
256
|
+
type: Number,
|
|
257
|
+
default: 10
|
|
258
|
+
},
|
|
253
259
|
color: {
|
|
254
260
|
type: String,
|
|
255
261
|
default: '--dl-color-secondary'
|
|
@@ -277,7 +283,7 @@ export default defineComponent({
|
|
|
277
283
|
const { variables } = useThemeVariables()
|
|
278
284
|
const currentBrushState = ref<{ min: number; max: number }>({
|
|
279
285
|
min: 0,
|
|
280
|
-
max: props.matrix.length
|
|
286
|
+
max: Math.min(props.matrix.length, props.cellDisplayLimit)
|
|
281
287
|
})
|
|
282
288
|
const cellWidth = ref<number | null>(null)
|
|
283
289
|
const rotateXLabels = ref(true)
|
|
@@ -376,7 +382,10 @@ export default defineComponent({
|
|
|
376
382
|
watch: {
|
|
377
383
|
matrix: {
|
|
378
384
|
handler(value) {
|
|
379
|
-
this.currentBrushState.max = Math.min(
|
|
385
|
+
this.currentBrushState.max = Math.min(
|
|
386
|
+
this.cellDisplayLimit,
|
|
387
|
+
value.length
|
|
388
|
+
)
|
|
380
389
|
this.$nextTick(() => {
|
|
381
390
|
this.resizeMatrix()
|
|
382
391
|
})
|
|
@@ -442,7 +451,7 @@ export default defineComponent({
|
|
|
442
451
|
const width = verticalWrapper?.offsetWidth
|
|
443
452
|
|
|
444
453
|
labelY.style.marginTop = `-${this.leftLabel.length * 16}px`
|
|
445
|
-
this.cellWidth = width / this.matrix.length
|
|
454
|
+
this.cellWidth = Math.round(width / this.matrix.length)
|
|
446
455
|
colorSpectrum.style.height = `${width}px`
|
|
447
456
|
yAxisOuter.style.height = `${width}px`
|
|
448
457
|
},
|
|
@@ -460,7 +469,7 @@ export default defineComponent({
|
|
|
460
469
|
ctx.matrix.length / (brush.max - brush.min),
|
|
461
470
|
ctx.$refs.matrix
|
|
462
471
|
)
|
|
463
|
-
const scroll = brush.min *
|
|
472
|
+
const scroll = brush.min * getCellWidth()
|
|
464
473
|
const container = ctx.$refs.matrixWrapper
|
|
465
474
|
container.scroll(scroll, 0)
|
|
466
475
|
ctx.currentBrushState = brush
|
|
@@ -524,7 +533,6 @@ export default defineComponent({
|
|
|
524
533
|
&__element {
|
|
525
534
|
width: var(--cell-dimensions);
|
|
526
535
|
max-width: 100px;
|
|
527
|
-
overflow: hidden;
|
|
528
536
|
text-overflow: ellipsis;
|
|
529
537
|
&--text {
|
|
530
538
|
font-size: 12px;
|
|
@@ -575,9 +583,8 @@ export default defineComponent({
|
|
|
575
583
|
grid-template-columns: repeat(var(--matrix-rows), 1fr);
|
|
576
584
|
|
|
577
585
|
&__cell {
|
|
578
|
-
font-size:
|
|
586
|
+
font-size: calc(var(--cell-dimensions) * 0.33);
|
|
579
587
|
cursor: pointer;
|
|
580
|
-
border: 1px solid var(--dl-color-separator);
|
|
581
588
|
box-sizing: border-box;
|
|
582
589
|
width: var(--cell-dimensions);
|
|
583
590
|
height: var(--cell-dimensions);
|
|
@@ -188,7 +188,7 @@ import {
|
|
|
188
188
|
Ref
|
|
189
189
|
} from 'vue-demi'
|
|
190
190
|
import { v4 } from 'uuid'
|
|
191
|
-
import {
|
|
191
|
+
import { transformOptions } from '../../shared/types'
|
|
192
192
|
|
|
193
193
|
export default defineComponent({
|
|
194
194
|
name: 'DlDropdownButton',
|
|
@@ -242,7 +242,7 @@ export default defineComponent({
|
|
|
242
242
|
type: String,
|
|
243
243
|
default: 'default',
|
|
244
244
|
validator: (value: string): boolean =>
|
|
245
|
-
|
|
245
|
+
transformOptions.includes(value)
|
|
246
246
|
},
|
|
247
247
|
outlined: Boolean,
|
|
248
248
|
padding: { type: String, default: '5px' },
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { v4 } from 'uuid'
|
|
13
13
|
import { defineComponent, PropType } from 'vue-demi'
|
|
14
14
|
import { getColor } from '../../../utils'
|
|
15
|
-
import {
|
|
15
|
+
import { transformOptions } from '../../shared/types'
|
|
16
16
|
|
|
17
17
|
type Variant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p'
|
|
18
18
|
|
|
@@ -35,7 +35,7 @@ export default defineComponent({
|
|
|
35
35
|
type: String,
|
|
36
36
|
default: 'default',
|
|
37
37
|
validator: (value: string): boolean =>
|
|
38
|
-
|
|
38
|
+
transformOptions.includes(value)
|
|
39
39
|
},
|
|
40
40
|
bold: Boolean,
|
|
41
41
|
color: {
|
|
@@ -89,38 +89,6 @@
|
|
|
89
89
|
</template>
|
|
90
90
|
</dl-accordion>
|
|
91
91
|
</div>
|
|
92
|
-
<div style="width: 100%">
|
|
93
|
-
<dl-accordion default-opened>
|
|
94
|
-
<template #header>
|
|
95
|
-
Custom header content
|
|
96
|
-
<dl-switch
|
|
97
|
-
v-model="switchModel"
|
|
98
|
-
:value="2"
|
|
99
|
-
/>
|
|
100
|
-
</template>
|
|
101
|
-
|
|
102
|
-
<dl-accordion default-opened>
|
|
103
|
-
<template #header>
|
|
104
|
-
Custom header content
|
|
105
|
-
<dl-switch
|
|
106
|
-
v-model="switchModel"
|
|
107
|
-
:value="2"
|
|
108
|
-
/>
|
|
109
|
-
</template>
|
|
110
|
-
<template #default>
|
|
111
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
|
|
112
|
-
sed do eiusmod tempor incididunt ut labore et dolore
|
|
113
|
-
magna aliqua. Ut enim ad minim veniam, quis nostrud
|
|
114
|
-
exercitation ullamco laboris nisi ut aliquip ex ea
|
|
115
|
-
commodo consequat. Duis aute irure dolor in
|
|
116
|
-
reprehenderit in voluptate velit esse cillum dolore eu
|
|
117
|
-
fugiat nulla pariatur. Excepteur sint occaecat cupidatat
|
|
118
|
-
non proident, sunt in culpa qui officia deserunt mollit
|
|
119
|
-
anim id est laborum.
|
|
120
|
-
</template>
|
|
121
|
-
</dl-accordion>
|
|
122
|
-
</dl-accordion>
|
|
123
|
-
</div>
|
|
124
92
|
</div>
|
|
125
93
|
</template>
|
|
126
94
|
|