@dataloop-ai/components 0.19.276 → 0.19.278
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
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<dl-empty-state
|
|
7
|
-
v-if="isEmpty"
|
|
8
|
-
v-bind="emptyStateProps"
|
|
9
|
-
>
|
|
10
|
-
<template
|
|
11
|
-
v-for="(_, slot) in $slots"
|
|
12
|
-
#[slot]="props"
|
|
13
|
-
>
|
|
14
|
-
<slot
|
|
15
|
-
:name="slot"
|
|
16
|
-
v-bind="props"
|
|
17
|
-
/>
|
|
2
|
+
<div :style="cssVars" :class="chartWrapperClasses">
|
|
3
|
+
<dl-empty-state v-if="isEmpty" v-bind="emptyStateProps">
|
|
4
|
+
<template v-for="(_, slot) in $slots" #[slot]="props">
|
|
5
|
+
<slot :name="slot" v-bind="props" />
|
|
18
6
|
</template>
|
|
19
7
|
</dl-empty-state>
|
|
20
8
|
<Bar
|
|
@@ -25,6 +13,7 @@
|
|
|
25
13
|
:style="(chartStyles, `max-height: ${wrapperHeight}`)"
|
|
26
14
|
:data="chartData"
|
|
27
15
|
:options="chartOptions"
|
|
16
|
+
:plugins="chartPlugins"
|
|
28
17
|
@mouseout="onChartLeave"
|
|
29
18
|
/>
|
|
30
19
|
<slot
|
|
@@ -484,6 +473,8 @@ export default defineComponent({
|
|
|
484
473
|
)
|
|
485
474
|
)
|
|
486
475
|
|
|
476
|
+
const chartPlugins = props.plugins || []
|
|
477
|
+
|
|
487
478
|
watch(
|
|
488
479
|
() => chart.value?.scales?.x?.width,
|
|
489
480
|
(val: string) => {
|
|
@@ -627,6 +618,7 @@ export default defineComponent({
|
|
|
627
618
|
variables,
|
|
628
619
|
chartData,
|
|
629
620
|
chartOptions,
|
|
621
|
+
chartPlugins,
|
|
630
622
|
brush,
|
|
631
623
|
xLabels,
|
|
632
624
|
columnChart,
|
|
@@ -155,17 +155,25 @@
|
|
|
155
155
|
@highlighted-item="setHighlightedIndex"
|
|
156
156
|
@selected-item="handleSelectedItem"
|
|
157
157
|
>
|
|
158
|
-
<dl-list
|
|
159
|
-
<dl-
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<dl-
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
158
|
+
<dl-list-item v-if="hasBeforeOptions && !noOptions">
|
|
159
|
+
<dl-item-section color="dl-color-medium">
|
|
160
|
+
<slot name="before-options" />
|
|
161
|
+
</dl-item-section>
|
|
162
|
+
</dl-list-item>
|
|
163
|
+
<dl-list-item v-if="noOptions">
|
|
164
|
+
<dl-item-section color="dl-color-medium">
|
|
165
|
+
<slot name="no-options"> No options </slot>
|
|
166
|
+
</dl-item-section>
|
|
167
|
+
</dl-list-item>
|
|
168
|
+
<dl-list
|
|
169
|
+
class="select-list"
|
|
170
|
+
:padding="false"
|
|
171
|
+
:style="
|
|
172
|
+
optionsCount > MAX_ITEMS_PER_LIST
|
|
173
|
+
? ''
|
|
174
|
+
: `width: 100%; max-height: calc(${calculatedDropdownMaxHeight} - 20px); overflow-y: scroll;`
|
|
175
|
+
"
|
|
176
|
+
>
|
|
169
177
|
<dl-select-option
|
|
170
178
|
v-if="showAllItems"
|
|
171
179
|
:multiselect="multiselect"
|
|
@@ -194,7 +202,7 @@
|
|
|
194
202
|
:virtual-scroll-item-size="28"
|
|
195
203
|
:virtual-scroll-sticky-size-start="28"
|
|
196
204
|
:virtual-scroll-sticky-size-end="20"
|
|
197
|
-
:style="`width: 100%; max-height: calc(${
|
|
205
|
+
:style="`width: 100%; max-height: calc(${calculatedDropdownMaxHeight} - 20px);`"
|
|
198
206
|
>
|
|
199
207
|
<dl-select-option
|
|
200
208
|
:key="getKeyForOption(item)"
|
|
@@ -290,12 +298,12 @@
|
|
|
290
298
|
</slot>
|
|
291
299
|
</dl-select-option>
|
|
292
300
|
</div>
|
|
293
|
-
<dl-list-item v-if="hasAfterOptions && !noOptions">
|
|
294
|
-
<dl-item-section>
|
|
295
|
-
<slot name="after-options" />
|
|
296
|
-
</dl-item-section>
|
|
297
|
-
</dl-list-item>
|
|
298
301
|
</dl-list>
|
|
302
|
+
<dl-list-item v-if="hasAfterOptions && !noOptions">
|
|
303
|
+
<dl-item-section>
|
|
304
|
+
<slot name="after-options" />
|
|
305
|
+
</dl-item-section>
|
|
306
|
+
</dl-list-item>
|
|
299
307
|
</dl-menu>
|
|
300
308
|
</div>
|
|
301
309
|
<div
|
|
@@ -487,46 +495,6 @@ export default defineComponent({
|
|
|
487
495
|
if (this.customFilter || this.searchTerm === '') {
|
|
488
496
|
return this.options
|
|
489
497
|
}
|
|
490
|
-
|
|
491
|
-
// alternate version here it shows from child down
|
|
492
|
-
// const labelIncluded = (
|
|
493
|
-
// options: DlSelectOptionType[],
|
|
494
|
-
// term: string
|
|
495
|
-
// ): DlSelectOptionType[] => {
|
|
496
|
-
// const filteredNodes: DlSelectOptionType[] = []
|
|
497
|
-
|
|
498
|
-
// for (const op of options) {
|
|
499
|
-
// const queue: DlSelectOptionType[] = [op]
|
|
500
|
-
// while (queue.length) {
|
|
501
|
-
// const node = queue.shift()
|
|
502
|
-
// let shouldPush = false
|
|
503
|
-
|
|
504
|
-
// const label = getLabel(node)
|
|
505
|
-
|
|
506
|
-
// if (
|
|
507
|
-
// label &&
|
|
508
|
-
// label
|
|
509
|
-
// .toLowerCase()
|
|
510
|
-
// .includes(term.toLowerCase().trim())
|
|
511
|
-
// ) {
|
|
512
|
-
// filteredNodes.push(node)
|
|
513
|
-
// shouldPush = true
|
|
514
|
-
// }
|
|
515
|
-
|
|
516
|
-
// if (
|
|
517
|
-
// !shouldPush &&
|
|
518
|
-
// (node as DlSelectOptionEntry)?.children?.length
|
|
519
|
-
// ) {
|
|
520
|
-
// queue.push(
|
|
521
|
-
// ...(node as DlSelectOptionEntry).children
|
|
522
|
-
// )
|
|
523
|
-
// }
|
|
524
|
-
// }
|
|
525
|
-
// }
|
|
526
|
-
|
|
527
|
-
// return filteredNodes
|
|
528
|
-
// }
|
|
529
|
-
|
|
530
498
|
const labelIncluded = (
|
|
531
499
|
options: DlSelectOptionType[],
|
|
532
500
|
term: string
|
|
@@ -574,6 +542,27 @@ export default defineComponent({
|
|
|
574
542
|
|
|
575
543
|
return labelIncluded(cloneDeep(this.options), this.searchTerm)
|
|
576
544
|
},
|
|
545
|
+
calculatedDropdownMaxHeight(): string {
|
|
546
|
+
const knownValuePhrases = ['vh', 'px', 'vw', 'em', 'rem', '%']
|
|
547
|
+
let val = this.dropdownMaxHeight
|
|
548
|
+
|
|
549
|
+
for (const phrase of knownValuePhrases) {
|
|
550
|
+
if (val.includes(phrase)) {
|
|
551
|
+
val = val.replace(phrase, '')
|
|
552
|
+
let value = parseInt(val)
|
|
553
|
+
if (this.hasAfterOptions) {
|
|
554
|
+
value -= 5
|
|
555
|
+
}
|
|
556
|
+
if (this.hasBeforeOptions) {
|
|
557
|
+
value -= 5
|
|
558
|
+
}
|
|
559
|
+
return String(value + phrase)
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// :shrug: if it's not a known value, just return it
|
|
564
|
+
return `calc(${this.dropdownMaxHeight} - 20px)`
|
|
565
|
+
},
|
|
577
566
|
computedMenuStyle(): string {
|
|
578
567
|
let style = this.menuStyle ?? ''
|
|
579
568
|
if (this.optionsCount > this.MAX_ITEMS_PER_LIST) {
|
|
@@ -156,10 +156,7 @@
|
|
|
156
156
|
all-items-option
|
|
157
157
|
>
|
|
158
158
|
<template #prepend>
|
|
159
|
-
<dl-icon
|
|
160
|
-
size="12px"
|
|
161
|
-
icon="icon-dl-filter"
|
|
162
|
-
/>
|
|
159
|
+
<dl-icon size="12px" icon="icon-dl-filter" />
|
|
163
160
|
</template>
|
|
164
161
|
</dl-select>
|
|
165
162
|
custom search
|
|
@@ -594,13 +591,47 @@
|
|
|
594
591
|
multiselect
|
|
595
592
|
style="margin-bottom: 150px"
|
|
596
593
|
/>
|
|
594
|
+
|
|
595
|
+
<dl-select
|
|
596
|
+
:options="searchOptions"
|
|
597
|
+
title="With before and after options"
|
|
598
|
+
>
|
|
599
|
+
<template #before-options>
|
|
600
|
+
<dl-button label="Button" />
|
|
601
|
+
</template>
|
|
602
|
+
<template #after-options>
|
|
603
|
+
<dl-button label="Button" />
|
|
604
|
+
</template>
|
|
605
|
+
</dl-select>
|
|
606
|
+
<dl-select
|
|
607
|
+
:options="alotOfOptions"
|
|
608
|
+
title="With before and after options - lots of options"
|
|
609
|
+
>
|
|
610
|
+
<template #before-options>
|
|
611
|
+
<dl-button label="Button" />
|
|
612
|
+
</template>
|
|
613
|
+
<template #after-options>
|
|
614
|
+
<dl-button label="Button" />
|
|
615
|
+
</template>
|
|
616
|
+
</dl-select>
|
|
617
|
+
<dl-select
|
|
618
|
+
:options="someOptions"
|
|
619
|
+
title="With before and after options - some options"
|
|
620
|
+
>
|
|
621
|
+
<template #before-options>
|
|
622
|
+
<dl-button label="Button" />
|
|
623
|
+
</template>
|
|
624
|
+
<template #after-options>
|
|
625
|
+
<dl-button label="Button" />
|
|
626
|
+
</template>
|
|
627
|
+
</dl-select>
|
|
597
628
|
</div>
|
|
598
629
|
</template>
|
|
599
630
|
|
|
600
631
|
<script lang="ts">
|
|
601
632
|
import { cloneDeep } from 'lodash'
|
|
602
633
|
import { defineComponent } from 'vue-demi'
|
|
603
|
-
import { DlChip, DlSelect, DlIcon, DlBadge } from '../components'
|
|
634
|
+
import { DlChip, DlSelect, DlIcon, DlBadge, DlButton } from '../components'
|
|
604
635
|
import { DlSelectOptionType } from '../components/compound/DlSelect/utils'
|
|
605
636
|
|
|
606
637
|
const defaultOptions = [
|
|
@@ -828,7 +859,7 @@ const treeOptionsExpanded: DlSelectOptionType[] = [
|
|
|
828
859
|
]
|
|
829
860
|
|
|
830
861
|
export default defineComponent({
|
|
831
|
-
components: { DlSelect, DlIcon, DlChip, DlBadge },
|
|
862
|
+
components: { DlSelect, DlIcon, DlChip, DlBadge, DlButton },
|
|
832
863
|
data() {
|
|
833
864
|
return {
|
|
834
865
|
selectedWithFit: [],
|
|
@@ -883,6 +914,21 @@ export default defineComponent({
|
|
|
883
914
|
|
|
884
915
|
return arr
|
|
885
916
|
},
|
|
917
|
+
someOptions(): DlSelectOptionType[] {
|
|
918
|
+
const arr = [] as any[]
|
|
919
|
+
|
|
920
|
+
for (let i = 0; i < 10; ++i) {
|
|
921
|
+
arr.push({
|
|
922
|
+
key: i,
|
|
923
|
+
subLabel: 'not so high',
|
|
924
|
+
label: 'High ' + i,
|
|
925
|
+
value: 'high',
|
|
926
|
+
bgColor: 'dl-color-negative'
|
|
927
|
+
})
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
return arr
|
|
931
|
+
},
|
|
886
932
|
alotOfOptionsExpanded(): DlSelectOptionType[] {
|
|
887
933
|
const arr = cloneDeep(this.alotOfOptions)
|
|
888
934
|
arr.push(treeOptionsExpanded[0])
|