@dataloop-ai/components 0.16.45 → 0.16.46
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/.eslintrc.js +2 -2
- package/package.json +10 -9
- package/src/App.vue +116 -57
- package/src/assets/globals.scss +2 -0
- package/src/components/basic/DlAlert/DlAlert.vue +1 -1
- package/src/components/basic/DlButton/DlButton.vue +13 -13
- package/src/components/basic/DlCard/DlCard.vue +217 -0
- package/src/components/basic/DlCard/index.ts +3 -0
- package/src/components/basic/DlCard/types.ts +20 -0
- package/src/components/basic/DlChip/DlChip.vue +1 -0
- package/src/components/basic/DlEllipsis/DlEllipsis.vue +90 -0
- package/src/components/basic/DlEllipsis/index.ts +2 -0
- package/src/components/basic/DlListItem/DlListItem.vue +11 -5
- package/src/components/basic/index.ts +2 -0
- package/src/components/compound/DlCharts/charts/DlBarChart/DlBarChart.vue +8 -1
- package/src/components/compound/DlCharts/charts/DlColumnChart/DlColumnChart.vue +22 -6
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +526 -0
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/index.ts +2 -0
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/utils.ts +96 -0
- package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChart.vue +2 -2
- package/src/components/compound/DlCharts/charts/DlLineChart/DlLineChart.vue +22 -6
- package/src/components/compound/DlCharts/charts/index.ts +1 -0
- package/src/components/compound/DlCharts/components/DlBrush.vue +8 -1
- package/src/components/compound/DlCharts/components/DlChartScrollBar.vue +34 -21
- package/src/components/compound/DlCharts/types/DlConfusionMatrix.types.ts +19 -0
- package/src/components/compound/DlCharts/types/index.ts +2 -1
- package/src/components/compound/DlCharts/types/props.ts +14 -0
- package/src/components/compound/DlDialogBox/DlDialogBox.vue +1 -1
- package/src/components/compound/DlDialogBox/components/DlDialogBoxFooter.vue +1 -0
- package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +58 -12
- package/src/components/compound/DlInput/DlInput.vue +45 -23
- package/src/components/compound/DlJsonEditor/DlJsonEditor.vue +13 -29
- package/src/components/compound/DlPagination/DlPagination.vue +14 -4
- package/src/components/compound/DlPagination/components/PageNavigation.vue +24 -25
- package/src/components/compound/DlPagination/components/PaginationLegend.vue +2 -1
- package/src/components/compound/DlPagination/components/QuickNavigation.vue +1 -0
- package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +86 -49
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +20 -13
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSuggestionsDropdown.vue +43 -4
- package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +1 -55
- package/src/components/compound/DlSearches/DlSmartSearch/utils/index.ts +42 -10
- package/src/components/compound/DlSearches/DlSmartSearch/utils/utils.ts +107 -0
- package/src/components/compound/DlSelect/DlSelect.vue +41 -8
- package/src/components/compound/DlTable/DlTable.vue +13 -10
- package/src/components/compound/DlTable/styles/dl-table-styles.scss +16 -4
- package/src/components/compound/DlToggleButton/DlToggleButton.vue +109 -0
- package/src/components/compound/DlToggleButton/config.ts +27 -0
- package/src/components/compound/DlToggleButton/index.ts +3 -0
- package/src/components/compound/DlToggleButton/types.ts +4 -0
- package/src/components/compound/index.ts +1 -0
- package/src/components/compound/types.ts +1 -0
- package/src/components/essential/DlColorPicker/DlColorPicker.vue +4 -1
- package/src/components/essential/DlColorPicker/components/DlColors.vue +2 -6
- package/src/components/essential/DlIcon/DlIcon.vue +5 -1
- package/src/components/essential/DlMenu/DlMenu.vue +30 -2
- package/src/components/essential/DlSeparator/DlSeparator.vue +62 -0
- package/src/components/essential/DlSeparator/index.ts +2 -0
- package/src/components/essential/DlSpinner/DlSpinner.vue +53 -217
- package/src/components/essential/DlSpinner/components/DlSpinnerCircle.vue +44 -0
- package/src/components/essential/DlSpinner/components/DlSpinnerClock.vue +79 -0
- package/src/components/essential/DlSpinner/components/DlSpinnerDots.vue +113 -0
- package/src/components/essential/DlSpinner/components/DlSpinnerGrid.vue +166 -0
- package/src/components/essential/DlSpinner/components/DlSpinnerLogo.vue +152 -0
- package/src/components/essential/DlSpinner/index.ts +14 -1
- package/src/components/essential/DlSpinner/styles/spinnerStyles.scss +111 -0
- package/src/components/essential/DlSpinner/types.ts +7 -0
- package/src/components/essential/index.ts +1 -0
- package/src/components/essential/types.ts +1 -0
- package/src/components/shared/DlItemSection/DlItemSection.vue +21 -15
- package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +36 -21
- package/src/components/shared/DlVirtualScroll/useVirtualScroll.ts +8 -10
- package/src/{demo → demos}/DlButtonDemo.vue +15 -0
- package/src/demos/DlCardDemo.vue +47 -0
- package/src/{demo → demos}/DlColorPickerDemo.vue +16 -1
- package/src/demos/DlConfusionMatrixDemo.vue +53 -0
- package/src/{demo → demos}/DlDialogBoxDemo.vue +4 -1
- package/src/demos/DlDropdownButtonDemo.vue +386 -0
- package/src/demos/DlEllipsisDemo.vue +30 -0
- package/src/{demo → demos}/DlLineChartDemo.vue +8 -8
- package/src/{demo → demos}/DlMenuDemo.vue +61 -2
- package/src/{demo → demos}/DlSearchDemo.vue +3 -2
- package/src/demos/DlSeparatorDemo.vue +44 -0
- package/src/demos/DlSpinnerDemo.vue +59 -0
- package/src/{demo → demos}/DlTableDemo.vue +117 -29
- package/src/demos/DlToggleButtonDemo.vue +57 -0
- package/src/{demo → demos}/DlTooltipDemo.vue +43 -2
- package/src/{demo → demos}/DlWidgetDemo.vue +34 -19
- package/src/{demo → demos}/SmartSearchDemo/DlSmartSearchDemo.vue +2 -50
- package/src/{demo → demos}/index.ts +14 -56
- package/src/hooks/use-arrow-navigation.ts +58 -0
- package/src/hooks/use-suggestions.ts +97 -74
- package/src/utils/colors.ts +1 -1
- package/src/utils/draggable-table.ts +2 -2
- package/src/utils/index.ts +1 -0
- package/src/utils/parse-smart-query.ts +87 -0
- package/src/components/compound/DlCharts/types.ts +0 -1
- package/src/demo/DlDropdownButtonDemo.vue +0 -260
- package/src/demo/DlSpinnerDemo.vue +0 -20
- /package/src/{demo → demos}/BarChartDemo.vue +0 -0
- /package/src/{demo → demos}/ColumnChartDemo.vue +0 -0
- /package/src/{demo → demos}/DlAccordionDemo.vue +0 -0
- /package/src/{demo → demos}/DlAlertDemo.vue +0 -0
- /package/src/{demo → demos}/DlAvatarDemo.vue +0 -0
- /package/src/{demo → demos}/DlBadgeDemo.vue +0 -0
- /package/src/{demo → demos}/DlChartDoughnutDemo.vue +0 -0
- /package/src/{demo → demos}/DlCheckboxDemo.vue +0 -0
- /package/src/{demo → demos}/DlChipDemo.vue +0 -0
- /package/src/{demo → demos}/DlCounterDemo.vue +0 -0
- /package/src/{demo → demos}/DlDateTimeRangeDemo.vue +0 -0
- /package/src/{demo → demos}/DlIconDemo.vue +0 -0
- /package/src/{demo → demos}/DlInputDemo.vue +0 -0
- /package/src/{demo → demos}/DlKpiDemo.vue +0 -0
- /package/src/{demo → demos}/DlLinkDemo.vue +0 -0
- /package/src/{demo → demos}/DlListDemo.vue +0 -0
- /package/src/{demo → demos}/DlOptionGroupDemo.vue +0 -0
- /package/src/{demo → demos}/DlPaginationDemo.vue +0 -0
- /package/src/{demo → demos}/DlPanelContainerDemo.vue +0 -0
- /package/src/{demo → demos}/DlPopupDemo.vue +0 -0
- /package/src/{demo → demos}/DlProgressBarDemo.vue +0 -0
- /package/src/{demo → demos}/DlProgressChartDemo.vue +0 -0
- /package/src/{demo → demos}/DlRadioDemo.vue +0 -0
- /package/src/{demo → demos}/DlRangeDemo.vue +0 -0
- /package/src/{demo → demos}/DlSelectDemo.vue +0 -0
- /package/src/{demo → demos}/DlSkeletonDemo.vue +0 -0
- /package/src/{demo → demos}/DlSliderDemo.vue +0 -0
- /package/src/{demo → demos}/DlStepperDemo/CenteredStepperInDialogBox.vue +0 -0
- /package/src/{demo → demos}/DlStepperDemo/DlStepperDemo.vue +0 -0
- /package/src/{demo → demos}/DlStepperDemo/SimpleStepper.vue +0 -0
- /package/src/{demo → demos}/DlStepperDemo/StepperInDialogBox.vue +0 -0
- /package/src/{demo → demos}/DlStepperDemo/index.ts +0 -0
- /package/src/{demo → demos}/DlStepperDemo/steps/AssignmentsStep.vue +0 -0
- /package/src/{demo → demos}/DlStepperDemo/steps/DataStep.vue +0 -0
- /package/src/{demo → demos}/DlStepperDemo/steps/GeneralStep.vue +0 -0
- /package/src/{demo → demos}/DlStepperDemo/steps/InstructionStep.vue +0 -0
- /package/src/{demo → demos}/DlStepperDemo/steps/QualityStep.vue +0 -0
- /package/src/{demo → demos}/DlSwitchDemo.vue +0 -0
- /package/src/{demo → demos}/DlTabsDemo.vue +0 -0
- /package/src/{demo → demos}/DlTdDemo.vue +0 -0
- /package/src/{demo → demos}/DlTextAreaDemo.vue +0 -0
- /package/src/{demo → demos}/DlTextHolderDemo.vue +0 -0
- /package/src/{demo → demos}/DlThDemo.vue +0 -0
- /package/src/{demo → demos}/DlToastDemo.vue +0 -0
- /package/src/{demo → demos}/DlTrDemo.vue +0 -0
- /package/src/{demo → demos}/DlTrendDemo.vue +0 -0
- /package/src/{demo → demos}/DlTypographyDemo.vue +0 -0
- /package/src/{demo → demos}/SmartSearchDemo/schema.ts +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dl-ellipsis">
|
|
3
|
+
<span
|
|
4
|
+
ref="dlEllipsisRef"
|
|
5
|
+
class="dl-ellipsis__left"
|
|
6
|
+
>
|
|
7
|
+
{{ leftText }}
|
|
8
|
+
</span>
|
|
9
|
+
<span
|
|
10
|
+
v-if="rightText"
|
|
11
|
+
class="dl-ellipsis__right"
|
|
12
|
+
>
|
|
13
|
+
{{ rightText }}
|
|
14
|
+
</span>
|
|
15
|
+
<dl-tooltip v-if="hasEllipsis && tooltip">
|
|
16
|
+
{{ fullText }}
|
|
17
|
+
</dl-tooltip>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { defineComponent, ref, computed } from 'vue-demi'
|
|
23
|
+
import DlTooltip from '../../essential/DlTooltip/DlTooltip.vue'
|
|
24
|
+
import { useSizeObserver } from '../../../hooks/use-size-observer'
|
|
25
|
+
|
|
26
|
+
export default defineComponent({
|
|
27
|
+
name: 'DlEllipsis',
|
|
28
|
+
components: {
|
|
29
|
+
DlTooltip
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
text: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
middleEllipsis: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
required: false
|
|
40
|
+
},
|
|
41
|
+
tooltip: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true,
|
|
44
|
+
required: false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
setup(props) {
|
|
48
|
+
const dlEllipsisRef = ref(null)
|
|
49
|
+
const leftText = ref('')
|
|
50
|
+
const rightText = ref('')
|
|
51
|
+
const { hasEllipsis } = useSizeObserver(dlEllipsisRef)
|
|
52
|
+
|
|
53
|
+
const splitIndex = computed(() =>
|
|
54
|
+
props.middleEllipsis
|
|
55
|
+
? Math.round(props.text.length * 0.75)
|
|
56
|
+
: props.text.length
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
const fullText = computed(() => props.text)
|
|
60
|
+
leftText.value = props.text.slice(0, splitIndex.value)
|
|
61
|
+
rightText.value = props.text.slice(splitIndex.value)
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
leftText,
|
|
65
|
+
rightText,
|
|
66
|
+
fullText,
|
|
67
|
+
dlEllipsisRef,
|
|
68
|
+
hasEllipsis
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<style scoped lang="scss">
|
|
75
|
+
.dl-ellipsis {
|
|
76
|
+
display: flex;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
|
|
79
|
+
&__left {
|
|
80
|
+
flex: 0 1 auto;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
text-overflow: ellipsis;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&__right {
|
|
86
|
+
flex: 1 0 auto;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</style>
|
|
@@ -93,14 +93,17 @@ export default defineComponent({
|
|
|
93
93
|
},
|
|
94
94
|
startIconSize: {
|
|
95
95
|
type: String,
|
|
96
|
-
default: '
|
|
96
|
+
default: '16px'
|
|
97
97
|
},
|
|
98
98
|
endIconSize: {
|
|
99
99
|
type: String,
|
|
100
|
-
default: '
|
|
100
|
+
default: '16px'
|
|
101
101
|
},
|
|
102
102
|
height: { type: String, default: null, required: false },
|
|
103
|
-
padding: { type: String, default: null, required: false }
|
|
103
|
+
padding: { type: String, default: null, required: false },
|
|
104
|
+
isHighlighted: {
|
|
105
|
+
type: Boolean
|
|
106
|
+
}
|
|
104
107
|
},
|
|
105
108
|
emits: ['click'],
|
|
106
109
|
data() {
|
|
@@ -123,7 +126,10 @@ export default defineComponent({
|
|
|
123
126
|
'--dl-list-item-border': itemBorder(this.bordered),
|
|
124
127
|
'--dl-list-item-color': itemColor(this.disabled),
|
|
125
128
|
'--dl-list-item-height': this.height ?? '28px',
|
|
126
|
-
'--dl-list-item-padding': this.padding ?? '0px 10px'
|
|
129
|
+
'--dl-list-item-padding': this.padding ?? '0px 10px',
|
|
130
|
+
'--dl-list-item-bg-color': this.isHighlighted
|
|
131
|
+
? 'var(--dl-color-fill-hover)'
|
|
132
|
+
: 'transparent'
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
135
|
},
|
|
@@ -144,7 +150,7 @@ export default defineComponent({
|
|
|
144
150
|
|
|
145
151
|
.dl-list-item {
|
|
146
152
|
-webkit-tap-highlight-color: transparent;
|
|
147
|
-
background-color:
|
|
153
|
+
background-color: var(--dl-list-item-bg-color);
|
|
148
154
|
outline: 0px;
|
|
149
155
|
border: 0px;
|
|
150
156
|
margin: 0px;
|
|
@@ -16,10 +16,14 @@
|
|
|
16
16
|
/>
|
|
17
17
|
<dl-chart-scroll-bar
|
|
18
18
|
v-if="maxItems > thisItemsInView"
|
|
19
|
+
:wrapper-styles="{
|
|
20
|
+
marginTop: '10px'
|
|
21
|
+
}"
|
|
19
22
|
:height="wrapperHeight"
|
|
20
23
|
:item-count="maxItems"
|
|
21
24
|
:items-in-view="thisItemsInView"
|
|
22
25
|
:position="scrollPosition"
|
|
26
|
+
:scroll-deficit="50"
|
|
23
27
|
@position-update="handleScrollUpdate"
|
|
24
28
|
/>
|
|
25
29
|
</div>
|
|
@@ -333,6 +337,9 @@ export default defineComponent({
|
|
|
333
337
|
scales: {
|
|
334
338
|
y: {
|
|
335
339
|
max: thisItemsInView.value
|
|
340
|
+
},
|
|
341
|
+
x: {
|
|
342
|
+
suggestedMax: chartData.value.labels.length
|
|
336
343
|
}
|
|
337
344
|
}
|
|
338
345
|
},
|
|
@@ -358,7 +365,7 @@ export default defineComponent({
|
|
|
358
365
|
|
|
359
366
|
const maxItems = computed(() => chartData.value?.labels.length)
|
|
360
367
|
|
|
361
|
-
const handleScrollUpdate = (position: number) => {
|
|
368
|
+
const handleScrollUpdate = ({ position }: { position: number }) => {
|
|
362
369
|
if (position >= maxItems.value - thisItemsInView.value) return
|
|
363
370
|
chart.value.options.scales.y.min = position
|
|
364
371
|
chart.value.options.scales.y.max = position + thisItemsInView.value
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:style="cssVars"
|
|
4
|
+
:class="chartWrapperClasses"
|
|
5
|
+
>
|
|
3
6
|
<Bar
|
|
4
7
|
:id="id"
|
|
5
8
|
ref="columnChart"
|
|
@@ -144,9 +147,10 @@ export default defineComponent({
|
|
|
144
147
|
size: { height: number; width: number }
|
|
145
148
|
) => {
|
|
146
149
|
if (chart?.scales?.x?.width) {
|
|
147
|
-
chartWidth.value = `${
|
|
148
|
-
chart.scales.x.width as unknown as string
|
|
149
|
-
|
|
150
|
+
chartWidth.value = `${
|
|
151
|
+
parseInt(chart.scales.x.width as unknown as string) -
|
|
152
|
+
parseInt(brushProperties.value.thumbSize) / 4
|
|
153
|
+
}px`
|
|
150
154
|
}
|
|
151
155
|
}
|
|
152
156
|
|
|
@@ -389,7 +393,10 @@ export default defineComponent({
|
|
|
389
393
|
() => chart.value?.scales?.x?.width,
|
|
390
394
|
(val: string) => {
|
|
391
395
|
if (val) {
|
|
392
|
-
chartWidth.value = `${
|
|
396
|
+
chartWidth.value = `${
|
|
397
|
+
parseInt(val as unknown as string) -
|
|
398
|
+
parseInt(brushProperties.value.thumbSize) / 4
|
|
399
|
+
}px`
|
|
393
400
|
}
|
|
394
401
|
},
|
|
395
402
|
{ deep: true }
|
|
@@ -433,6 +440,13 @@ export default defineComponent({
|
|
|
433
440
|
chart.value.update()
|
|
434
441
|
}
|
|
435
442
|
|
|
443
|
+
const cssVars = computed(() => {
|
|
444
|
+
return {
|
|
445
|
+
'--dl-brush-thumb-size':
|
|
446
|
+
parseInt(brushProperties.value.thumbSize) / 4 + 'px'
|
|
447
|
+
}
|
|
448
|
+
})
|
|
449
|
+
|
|
436
450
|
const onLeaveLegend = (
|
|
437
451
|
item: BarControllerDatasetOptions,
|
|
438
452
|
index: number
|
|
@@ -532,7 +546,8 @@ export default defineComponent({
|
|
|
532
546
|
onLeaveLegend,
|
|
533
547
|
onChartLeave,
|
|
534
548
|
chart,
|
|
535
|
-
labelStyles
|
|
549
|
+
labelStyles,
|
|
550
|
+
cssVars
|
|
536
551
|
}
|
|
537
552
|
},
|
|
538
553
|
data() {
|
|
@@ -560,5 +575,6 @@ export default defineComponent({
|
|
|
560
575
|
.dl-brush,
|
|
561
576
|
.dl-legend {
|
|
562
577
|
align-self: flex-end;
|
|
578
|
+
margin-right: var(--dl-brush-thumb-size);
|
|
563
579
|
}
|
|
564
580
|
</style>
|