@dataloop-ai/components 0.16.45 → 0.16.47
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 +120 -58
- 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 +234 -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 +542 -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 +86 -69
- 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 +66 -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 +156 -0
- package/src/components/essential/DlSpinner/components/DlSpinnerClock.vue +191 -0
- package/src/components/essential/DlSpinner/components/DlSpinnerDots.vue +225 -0
- package/src/components/essential/DlSpinner/components/DlSpinnerGrid.vue +278 -0
- package/src/components/essential/DlSpinner/components/DlSpinnerLogo.vue +264 -0
- package/src/components/essential/DlSpinner/index.ts +14 -1
- 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 +55 -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
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
<DlTable
|
|
97
97
|
:selected="selected"
|
|
98
98
|
:separator="separator"
|
|
99
|
-
:columns="
|
|
99
|
+
:columns="tableColumns"
|
|
100
100
|
:bordered="bordered"
|
|
101
101
|
:draggable="draggable"
|
|
102
102
|
:dense="dense"
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
:filter="filter"
|
|
105
105
|
:selection="selection"
|
|
106
106
|
:loading="loading"
|
|
107
|
-
:rows="
|
|
107
|
+
:rows="tableRows"
|
|
108
108
|
:resizable="resizable"
|
|
109
109
|
row-key="name"
|
|
110
110
|
color="dl-color-secondary"
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
<DlTable
|
|
122
122
|
:selected="selected"
|
|
123
123
|
:separator="separator"
|
|
124
|
-
:columns="
|
|
124
|
+
:columns="tableColumns"
|
|
125
125
|
:bordered="bordered"
|
|
126
126
|
:draggable="draggable"
|
|
127
127
|
:pagination="pagination"
|
|
@@ -215,6 +215,30 @@
|
|
|
215
215
|
@click="lastPage"
|
|
216
216
|
/>
|
|
217
217
|
</div>
|
|
218
|
+
|
|
219
|
+
<div style="margin-top: 100px">
|
|
220
|
+
<p>Infinite scrolling</p>
|
|
221
|
+
<DlTable
|
|
222
|
+
:selected="selected"
|
|
223
|
+
:separator="separator"
|
|
224
|
+
:draggable="draggable"
|
|
225
|
+
class="sticky-header"
|
|
226
|
+
:filter="filter"
|
|
227
|
+
:selection="selection"
|
|
228
|
+
:dense="dense"
|
|
229
|
+
title="Treats"
|
|
230
|
+
color="dl-color-secondary"
|
|
231
|
+
:loading="infiniteLoading"
|
|
232
|
+
:rows="computedRows"
|
|
233
|
+
:columns="tableColumns"
|
|
234
|
+
style="height: 500px"
|
|
235
|
+
row-key="index"
|
|
236
|
+
:pagination="{ rowsPerPage: 0 }"
|
|
237
|
+
virtual-scroll
|
|
238
|
+
:rows-per-page-options="[0]"
|
|
239
|
+
@virtual-scroll="onScroll"
|
|
240
|
+
/>
|
|
241
|
+
</div>
|
|
218
242
|
</div>
|
|
219
243
|
<div>
|
|
220
244
|
<p>#no-data & #pagination declare together</p>
|
|
@@ -259,8 +283,8 @@ import {
|
|
|
259
283
|
DlInput,
|
|
260
284
|
DlButton
|
|
261
285
|
} from '../components'
|
|
262
|
-
import { defineComponent, ref, computed,
|
|
263
|
-
import { times } from 'lodash'
|
|
286
|
+
import { defineComponent, ref, computed, nextTick } from 'vue-demi'
|
|
287
|
+
import { times, cloneDeep } from 'lodash'
|
|
264
288
|
|
|
265
289
|
const columns = [
|
|
266
290
|
{
|
|
@@ -413,6 +437,12 @@ const rows = [
|
|
|
413
437
|
}))
|
|
414
438
|
]
|
|
415
439
|
|
|
440
|
+
type Rows = (typeof rows)[0]
|
|
441
|
+
|
|
442
|
+
interface RowsWithIndex extends Rows {
|
|
443
|
+
index?: number
|
|
444
|
+
}
|
|
445
|
+
|
|
416
446
|
export default defineComponent({
|
|
417
447
|
components: {
|
|
418
448
|
DlTable,
|
|
@@ -422,6 +452,67 @@ export default defineComponent({
|
|
|
422
452
|
DlButton
|
|
423
453
|
},
|
|
424
454
|
setup() {
|
|
455
|
+
const filter = ref('')
|
|
456
|
+
const selected = ref([])
|
|
457
|
+
const selection = ref('none')
|
|
458
|
+
const separator = ref('horizontal')
|
|
459
|
+
const bordered = ref(false)
|
|
460
|
+
const loading = ref(false)
|
|
461
|
+
const dense = ref(false)
|
|
462
|
+
const vScroll = ref(false)
|
|
463
|
+
const resizable = ref(false)
|
|
464
|
+
const borderState = ref([])
|
|
465
|
+
const denseState = ref([])
|
|
466
|
+
const virtualScroll = ref([])
|
|
467
|
+
const resizableState = ref([])
|
|
468
|
+
const tableRows = ref(cloneDeep(rows))
|
|
469
|
+
const draggable = ref('both')
|
|
470
|
+
const tableColumns = ref(columns)
|
|
471
|
+
const rowsPerPageOptions = ref([10, 12, 14, 16])
|
|
472
|
+
|
|
473
|
+
const infiniteLoading = ref(false)
|
|
474
|
+
|
|
475
|
+
const nextPageNumber = ref(2)
|
|
476
|
+
|
|
477
|
+
let allRows: RowsWithIndex[] = []
|
|
478
|
+
for (let i = 0; i < 100; i++) {
|
|
479
|
+
allRows = allRows.concat(
|
|
480
|
+
cloneDeep(rows)
|
|
481
|
+
.slice(0)
|
|
482
|
+
.map((r) => ({ ...r }))
|
|
483
|
+
)
|
|
484
|
+
}
|
|
485
|
+
allRows.forEach((row, index) => {
|
|
486
|
+
row.index = index
|
|
487
|
+
})
|
|
488
|
+
|
|
489
|
+
const pageSize = 50
|
|
490
|
+
const lastPageNumber = Math.ceil(allRows.length / pageSize)
|
|
491
|
+
|
|
492
|
+
const computedRows = computed(() =>
|
|
493
|
+
allRows.slice(0, pageSize * (nextPageNumber.value - 1))
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
const onScroll = ({ to, ref }: { to: number; ref: any }) => {
|
|
497
|
+
const lastIndex = computedRows.value.length - 1
|
|
498
|
+
|
|
499
|
+
if (
|
|
500
|
+
infiniteLoading.value !== true &&
|
|
501
|
+
nextPageNumber.value < lastPageNumber &&
|
|
502
|
+
to === lastIndex
|
|
503
|
+
) {
|
|
504
|
+
infiniteLoading.value = true
|
|
505
|
+
|
|
506
|
+
setTimeout(() => {
|
|
507
|
+
nextPageNumber.value++
|
|
508
|
+
nextTick(() => {
|
|
509
|
+
ref.refresh()
|
|
510
|
+
infiniteLoading.value = false
|
|
511
|
+
})
|
|
512
|
+
}, 500)
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
425
516
|
const pagination = ref({
|
|
426
517
|
sortBy: 'desc',
|
|
427
518
|
descending: false,
|
|
@@ -467,8 +558,6 @@ export default defineComponent({
|
|
|
467
558
|
}
|
|
468
559
|
}
|
|
469
560
|
|
|
470
|
-
const tableRows = ref(rows)
|
|
471
|
-
|
|
472
561
|
function nextPage() {
|
|
473
562
|
const { page, rowsPerPage } = pagination.value
|
|
474
563
|
|
|
@@ -491,9 +580,28 @@ export default defineComponent({
|
|
|
491
580
|
}
|
|
492
581
|
|
|
493
582
|
return {
|
|
583
|
+
filter,
|
|
584
|
+
selected,
|
|
585
|
+
selection,
|
|
586
|
+
separator,
|
|
587
|
+
bordered,
|
|
588
|
+
loading,
|
|
589
|
+
dense,
|
|
590
|
+
vScroll,
|
|
591
|
+
resizable,
|
|
592
|
+
denseState,
|
|
593
|
+
borderState,
|
|
594
|
+
virtualScroll,
|
|
595
|
+
resizableState,
|
|
596
|
+
tableRows,
|
|
597
|
+
draggable,
|
|
598
|
+
tableColumns,
|
|
599
|
+
rowsPerPageOptions,
|
|
600
|
+
onScroll,
|
|
601
|
+
computedRows,
|
|
602
|
+
infiniteLoading,
|
|
494
603
|
pagination,
|
|
495
604
|
pagesNumber,
|
|
496
|
-
tableRows,
|
|
497
605
|
firstPage,
|
|
498
606
|
lastPage,
|
|
499
607
|
nextPage,
|
|
@@ -502,27 +610,7 @@ export default defineComponent({
|
|
|
502
610
|
isFirstPage
|
|
503
611
|
}
|
|
504
612
|
},
|
|
505
|
-
|
|
506
|
-
return {
|
|
507
|
-
filter: '',
|
|
508
|
-
selected: [],
|
|
509
|
-
selection: 'none',
|
|
510
|
-
separator: 'horizontal',
|
|
511
|
-
bordered: false,
|
|
512
|
-
loading: false,
|
|
513
|
-
dense: false,
|
|
514
|
-
vScroll: false,
|
|
515
|
-
resizable: false,
|
|
516
|
-
borderState: [] as boolean[],
|
|
517
|
-
denseState: [] as boolean[],
|
|
518
|
-
virtualScroll: [] as boolean[],
|
|
519
|
-
resizableState: [] as boolean[],
|
|
520
|
-
rows,
|
|
521
|
-
draggable: 'both',
|
|
522
|
-
columns,
|
|
523
|
-
rowsPerPageOptions: [10, 12, 14, 16]
|
|
524
|
-
}
|
|
525
|
-
},
|
|
613
|
+
|
|
526
614
|
methods: {
|
|
527
615
|
addRowPerPage() {
|
|
528
616
|
this.rowsPerPageOptions.push(
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="width: 950px; padding-top: 20px">
|
|
3
|
+
<dl-input
|
|
4
|
+
v-model="width"
|
|
5
|
+
title="Custom width container"
|
|
6
|
+
/>
|
|
7
|
+
<DlToggleButton
|
|
8
|
+
v-model="selectedValue"
|
|
9
|
+
:options="options"
|
|
10
|
+
:width="width"
|
|
11
|
+
@change="change"
|
|
12
|
+
>
|
|
13
|
+
<template #button-1>
|
|
14
|
+
<p>
|
|
15
|
+
Changed with slot
|
|
16
|
+
<DlIcon icon="icon-dl-info-filled" />
|
|
17
|
+
</p>
|
|
18
|
+
</template>
|
|
19
|
+
</DlToggleButton>
|
|
20
|
+
Selected button: {{ label || 'Not selected' }}
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
import { DlIcon, DlInput, DlToggleButton } from '../components'
|
|
26
|
+
import { DlToggleButtonOption } from '../components/types'
|
|
27
|
+
import { defineComponent } from 'vue-demi'
|
|
28
|
+
|
|
29
|
+
export default defineComponent({
|
|
30
|
+
name: 'DlToggleButtonDemo',
|
|
31
|
+
components: { DlIcon, DlInput, DlToggleButton },
|
|
32
|
+
data: () => ({
|
|
33
|
+
options: [
|
|
34
|
+
{ label: 'Button 1', value: 1 },
|
|
35
|
+
{ label: 'Button 2', value: 2 },
|
|
36
|
+
{ label: 'Button 3', value: 3 }
|
|
37
|
+
] as DlToggleButtonOption[],
|
|
38
|
+
selectedValue: 1,
|
|
39
|
+
width: '100%'
|
|
40
|
+
}),
|
|
41
|
+
computed: {
|
|
42
|
+
label(): string {
|
|
43
|
+
const option = this.options.find(
|
|
44
|
+
(o: DlToggleButtonOption) => o.value === this.selectedValue
|
|
45
|
+
)
|
|
46
|
+
return option?.label ?? ''
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
change(val: any) {
|
|
51
|
+
console.log(val)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
</script>
|
|
@@ -39,21 +39,62 @@
|
|
|
39
39
|
voluptate commodi molestiae animi fuga natus assumenda aliquam ad?
|
|
40
40
|
Dicta harum recusandae rem!
|
|
41
41
|
</p>
|
|
42
|
+
<div>
|
|
43
|
+
Show smart tooltip
|
|
44
|
+
<dl-tooltip
|
|
45
|
+
:hide-delay="delay"
|
|
46
|
+
style="padding: 0; border-radius: 2px"
|
|
47
|
+
>
|
|
48
|
+
<DlCard
|
|
49
|
+
:image="image"
|
|
50
|
+
:text="text"
|
|
51
|
+
:title="title"
|
|
52
|
+
:keyboard-shortcut="keyboardShortcut"
|
|
53
|
+
:links="links"
|
|
54
|
+
/>
|
|
55
|
+
</dl-tooltip>
|
|
56
|
+
</div>
|
|
42
57
|
</div>
|
|
43
58
|
</template>
|
|
44
59
|
|
|
45
60
|
<script lang="ts">
|
|
46
|
-
import { DlTooltip, DlLink } from '../components'
|
|
61
|
+
import { DlTooltip, DlLink, DlCard } from '../components'
|
|
47
62
|
import { defineComponent } from 'vue-demi'
|
|
48
63
|
|
|
49
64
|
export default defineComponent({
|
|
50
65
|
name: 'DlTooltipDemo',
|
|
51
66
|
components: {
|
|
67
|
+
DlCard,
|
|
52
68
|
DlTooltip,
|
|
53
69
|
DlLink
|
|
54
70
|
},
|
|
55
71
|
data() {
|
|
56
|
-
return {
|
|
72
|
+
return {
|
|
73
|
+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Egestas volutpat quam blandit integer mattis. consectetur adipiscing elit. Egestas volutpat quam blandit integer mattis. ',
|
|
74
|
+
icon: {
|
|
75
|
+
src: 'icon-dl-search'
|
|
76
|
+
},
|
|
77
|
+
image: {
|
|
78
|
+
src: 'https://i0.wp.com/www.printmag.com/wp-content/uploads/2021/02/4cbe8d_f1ed2800a49649848102c68fc5a66e53mv2.gif?fit=476%2C280&ssl=1'
|
|
79
|
+
},
|
|
80
|
+
delay: 100000,
|
|
81
|
+
title: 'Lorem ipsum',
|
|
82
|
+
keyboardShortcut: 'Shift + E',
|
|
83
|
+
links: [
|
|
84
|
+
{
|
|
85
|
+
icon: 'icon-dl-list-view',
|
|
86
|
+
href: 'https://www.google.md/?hl=ru',
|
|
87
|
+
title: 'Lorem',
|
|
88
|
+
newtab: true,
|
|
89
|
+
external: true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
href: '#test',
|
|
93
|
+
title: 'Developers',
|
|
94
|
+
icon: 'icon-dl-code'
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
57
98
|
},
|
|
58
99
|
template: 'dl-tooltip-demo'
|
|
59
100
|
})
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { defineComponent } from 'vue-demi'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
DlWidget,
|
|
5
|
+
DlGridRow,
|
|
6
|
+
DlGrid,
|
|
7
|
+
DlBarChart,
|
|
8
|
+
DlConfusionMatrix
|
|
9
|
+
} from '../components'
|
|
4
10
|
|
|
5
11
|
const labelsFn = () => {
|
|
6
12
|
const a = []
|
|
@@ -36,15 +42,34 @@ const data = {
|
|
|
36
42
|
]
|
|
37
43
|
}
|
|
38
44
|
|
|
45
|
+
const matrix: number[][] = []
|
|
46
|
+
const labels: string[] = []
|
|
47
|
+
const size: number = 10
|
|
48
|
+
|
|
49
|
+
for (let i = 0; i < size; i++) {
|
|
50
|
+
const row = []
|
|
51
|
+
for (let j = 0; j < size; j++) {
|
|
52
|
+
row.push(Math.floor(Math.random() * 10))
|
|
53
|
+
}
|
|
54
|
+
matrix.push(row)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const items = ['Van', 'Truck', 'Motorcycle', 'Car', 'Bus']
|
|
58
|
+
|
|
59
|
+
for (let i = 0; i < size; i++) {
|
|
60
|
+
labels.push(items[Math.floor(Math.random() * items.length)])
|
|
61
|
+
}
|
|
62
|
+
|
|
39
63
|
export default defineComponent({
|
|
40
64
|
components: {
|
|
41
65
|
DlGrid,
|
|
42
66
|
DlWidget,
|
|
43
67
|
DlBarChart,
|
|
44
|
-
DlGridRow
|
|
68
|
+
DlGridRow,
|
|
69
|
+
DlConfusionMatrix
|
|
45
70
|
},
|
|
46
71
|
setup() {
|
|
47
|
-
return { data }
|
|
72
|
+
return { data, labels, matrix }
|
|
48
73
|
}
|
|
49
74
|
})
|
|
50
75
|
</script>
|
|
@@ -55,29 +80,19 @@ export default defineComponent({
|
|
|
55
80
|
<dl-grid-row>
|
|
56
81
|
<dl-widget>
|
|
57
82
|
<template #header>
|
|
58
|
-
<span>Widget
|
|
83
|
+
<span>Widget 7</span>
|
|
59
84
|
<span style="font-size: 12px; color: gray">Subtitle</span>
|
|
60
85
|
</template>
|
|
61
|
-
<template #menu>
|
|
62
|
-
<div>
|
|
63
|
-
Menu
|
|
64
|
-
<div />
|
|
65
|
-
</div>
|
|
66
|
-
</template>
|
|
67
86
|
<template #content>
|
|
68
|
-
<dl-
|
|
69
|
-
:
|
|
70
|
-
:
|
|
71
|
-
:options="options"
|
|
72
|
-
:items-in-view="8"
|
|
87
|
+
<dl-confusion-matrix
|
|
88
|
+
:matrix="matrix"
|
|
89
|
+
:labels="labels"
|
|
73
90
|
/>
|
|
74
91
|
</template>
|
|
75
92
|
<template #description>
|
|
76
93
|
<span>Lorem ipsum dolor sit amet consectetur adipisicing
|
|
77
|
-
elit. Libero
|
|
78
|
-
veritatis
|
|
79
|
-
autem. Doloremque tenetur repudiandae a cupiditate
|
|
80
|
-
modi dicta eveniet veritatis?</span>
|
|
94
|
+
elit. Libero eligee a cupiditate modi dicta eveniet
|
|
95
|
+
veritatis?</span>
|
|
81
96
|
</template>
|
|
82
97
|
</dl-widget>
|
|
83
98
|
</dl-grid-row>
|
|
@@ -10,34 +10,8 @@
|
|
|
10
10
|
<div
|
|
11
11
|
style="width: 100px"
|
|
12
12
|
class="props"
|
|
13
|
-
|
|
14
|
-
<select
|
|
15
|
-
id="status_select"
|
|
16
|
-
class="prop"
|
|
17
|
-
placeholder="Status type"
|
|
18
|
-
@input="updateStatusType"
|
|
19
|
-
>
|
|
20
|
-
<option value="info">
|
|
21
|
-
Info
|
|
22
|
-
</option>
|
|
23
|
-
<option value="warning">
|
|
24
|
-
Warning
|
|
25
|
-
</option>
|
|
26
|
-
<option value="error">
|
|
27
|
-
Error
|
|
28
|
-
</option>
|
|
29
|
-
<option value="success">
|
|
30
|
-
Success
|
|
31
|
-
</option>
|
|
32
|
-
</select>
|
|
33
|
-
<input
|
|
34
|
-
class="prop"
|
|
35
|
-
placeholder="Status Messaee"
|
|
36
|
-
@input="updateStatusMessage"
|
|
37
|
-
>
|
|
38
|
-
</div>
|
|
13
|
+
/>
|
|
39
14
|
<dl-smart-search
|
|
40
|
-
:status="status"
|
|
41
15
|
:aliases="aliases"
|
|
42
16
|
:schema="schema"
|
|
43
17
|
:color-schema="{
|
|
@@ -74,10 +48,6 @@ export default defineComponent({
|
|
|
74
48
|
return {
|
|
75
49
|
switchState: false,
|
|
76
50
|
isLoading: false,
|
|
77
|
-
status: {
|
|
78
|
-
type: 'info',
|
|
79
|
-
message: ''
|
|
80
|
-
},
|
|
81
51
|
filters: [
|
|
82
52
|
{
|
|
83
53
|
label: 'Saved DQL Queries',
|
|
@@ -93,7 +63,7 @@ export default defineComponent({
|
|
|
93
63
|
},
|
|
94
64
|
{
|
|
95
65
|
name: 'Query 3',
|
|
96
|
-
query: ''
|
|
66
|
+
query: '{"query3": "query3"}'
|
|
97
67
|
},
|
|
98
68
|
{
|
|
99
69
|
name: 'Query 4',
|
|
@@ -143,8 +113,6 @@ export default defineComponent({
|
|
|
143
113
|
]
|
|
144
114
|
}
|
|
145
115
|
},
|
|
146
|
-
|
|
147
|
-
mounted() {},
|
|
148
116
|
methods: {
|
|
149
117
|
handleSearchQuery({ query }: { query: string }) {
|
|
150
118
|
this.isLoading = true
|
|
@@ -154,22 +122,6 @@ export default defineComponent({
|
|
|
154
122
|
this.isLoading = false
|
|
155
123
|
}, 2000)
|
|
156
124
|
},
|
|
157
|
-
|
|
158
|
-
updateStatusType(e: Event) {
|
|
159
|
-
const newType = (e.target as HTMLInputElement).value
|
|
160
|
-
this.status = {
|
|
161
|
-
type: newType,
|
|
162
|
-
message: this.status.message
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
updateStatusMessage(e: Event) {
|
|
166
|
-
const newMessage = (e.target as HTMLInputElement).value
|
|
167
|
-
this.status = {
|
|
168
|
-
type: this.status.type,
|
|
169
|
-
message: newMessage
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
|
|
173
125
|
handleSaveQuery(query: Query) {
|
|
174
126
|
const saveQueryIndex = this.filters[0].queries.findIndex(
|
|
175
127
|
(q: Query) => q.name === query.name || q.query === query.query
|
|
@@ -47,9 +47,14 @@ import DlToastDemo from './DlToastDemo.vue'
|
|
|
47
47
|
import DlChartDoughnutDemo from './DlChartDoughnutDemo.vue'
|
|
48
48
|
import DlLineChartDemo from './DlLineChartDemo.vue'
|
|
49
49
|
import DlSpinner from './DlSpinnerDemo.vue'
|
|
50
|
+
import DlConfusionMatrix from './DlConfusionMatrixDemo.vue'
|
|
51
|
+
import DlToggleButtonDemo from './DlToggleButtonDemo.vue'
|
|
50
52
|
import DlKpiDemo from './DlKpiDemo.vue'
|
|
53
|
+
import DlEllipsisDemo from './DlEllipsisDemo.vue'
|
|
54
|
+
import DlSeparatorDemo from './DlSeparatorDemo.vue'
|
|
55
|
+
import DlCardDemo from './DlCardDemo.vue'
|
|
51
56
|
|
|
52
|
-
export {
|
|
57
|
+
export default {
|
|
53
58
|
AvatarDemo,
|
|
54
59
|
DlAlertDemo,
|
|
55
60
|
DlProgressChartDemo,
|
|
@@ -92,64 +97,17 @@ export {
|
|
|
92
97
|
DlWidgetDemo,
|
|
93
98
|
DlRadioDemo,
|
|
94
99
|
DlTextHolderDemo,
|
|
95
|
-
DlToastDemo
|
|
100
|
+
DlToastDemo,
|
|
96
101
|
DlColumnChartDemo,
|
|
97
102
|
DlSwitchDemo,
|
|
98
103
|
DlChartDoughnutDemo,
|
|
99
104
|
DlBarChartDemo,
|
|
100
105
|
DlLineChartDemo,
|
|
101
|
-
DlSpinner
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
badge: DlBadgeDemo,
|
|
109
|
-
button: DlButtonDemo,
|
|
110
|
-
column_chart: DlColumnChartDemo,
|
|
111
|
-
bar_chart: DlBarChartDemo,
|
|
112
|
-
line_chart: DlLineChartDemo,
|
|
113
|
-
checkbox: DlCheckboxDemo,
|
|
114
|
-
chip: DlChipDemo,
|
|
115
|
-
color_picker: DlColorPickerDemo,
|
|
116
|
-
counter: DlCounterDemo,
|
|
117
|
-
dialog_box: DlDialogBoxDemo,
|
|
118
|
-
doughnut_chart: DlChartDoughnutDemo,
|
|
119
|
-
dropdown_button: DropdownButtonDemo,
|
|
120
|
-
icon: DlIconDemo,
|
|
121
|
-
link: DlLinkDemo,
|
|
122
|
-
list: DlListDemo,
|
|
123
|
-
menu: DlMenuDemo,
|
|
124
|
-
option_group: DlOptionGroupDemo,
|
|
125
|
-
pagination: DlPaginationDemo,
|
|
126
|
-
panel_container: DlPanelContainerDemo,
|
|
127
|
-
popup: PopupDemo,
|
|
128
|
-
progress_bar: DlProgressBarDemo,
|
|
129
|
-
progress_chart: DlProgressChartDemo,
|
|
130
|
-
kpi: DlKpiDemo,
|
|
131
|
-
range: DlRangeDemo,
|
|
132
|
-
search: DlSearchDemo,
|
|
133
|
-
select: DlSelectDemo,
|
|
134
|
-
skeleton: DlSkeletonDemo,
|
|
135
|
-
slider: DlSliderDemo,
|
|
136
|
-
stepper: DlStepperDemo,
|
|
137
|
-
table: DlTableDemo,
|
|
138
|
-
table_td: DlTdDemo,
|
|
139
|
-
table_th: DlThDemo,
|
|
140
|
-
table_tr: DlTrDemo,
|
|
141
|
-
tabs: TabsDemo,
|
|
142
|
-
input: DlInputDemo,
|
|
143
|
-
textarea: DlTextareaDemo,
|
|
144
|
-
text_holder: DlTextHolderDemo,
|
|
145
|
-
time_picker: DlDateTimeRangeDemo,
|
|
146
|
-
tooltip: DlTooltipDemo,
|
|
147
|
-
trend: DlTrendDemo,
|
|
148
|
-
typography: DlTypographyDemo,
|
|
149
|
-
widget: DlWidgetDemo,
|
|
150
|
-
radio: DlRadioDemo,
|
|
151
|
-
switch: DlSwitchDemo,
|
|
152
|
-
smart_search: DlSmartSearchDemo,
|
|
153
|
-
toast: DlToastDemo,
|
|
154
|
-
spinner: DlSpinner
|
|
106
|
+
DlSpinner,
|
|
107
|
+
DlConfusionMatrix,
|
|
108
|
+
DlToggleButtonDemo,
|
|
109
|
+
DlEllipsisDemo,
|
|
110
|
+
DlSeparatorDemo,
|
|
111
|
+
DlKpiDemo,
|
|
112
|
+
DlCardDemo
|
|
155
113
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ref, onMounted, onBeforeUnmount } from 'vue-demi'
|
|
2
|
+
|
|
3
|
+
export function useArrowNavigation(items: any, isOpen: any) {
|
|
4
|
+
const selectedItem = ref(null)
|
|
5
|
+
const highlightedIndex = ref(-1)
|
|
6
|
+
|
|
7
|
+
const handleArrowUp = () => {
|
|
8
|
+
if (highlightedIndex.value > 0) {
|
|
9
|
+
highlightedIndex.value--
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
const handleArrowDown = () => {
|
|
13
|
+
if (highlightedIndex.value < items.value.length - 1) {
|
|
14
|
+
highlightedIndex.value++
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const handleEnter = () => {
|
|
18
|
+
if (
|
|
19
|
+
highlightedIndex.value >= 0 &&
|
|
20
|
+
highlightedIndex.value < items.value.length
|
|
21
|
+
) {
|
|
22
|
+
selectedItem.value = items.value[highlightedIndex.value]
|
|
23
|
+
resetNavigation()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const resetNavigation = () => {
|
|
27
|
+
highlightedIndex.value = -1
|
|
28
|
+
}
|
|
29
|
+
const navigateList = (event: KeyboardEvent) => {
|
|
30
|
+
if (!items.value?.length || !isOpen.value) {
|
|
31
|
+
return
|
|
32
|
+
}
|
|
33
|
+
switch (event.key) {
|
|
34
|
+
case 'ArrowUp':
|
|
35
|
+
handleArrowUp()
|
|
36
|
+
break
|
|
37
|
+
case 'ArrowDown':
|
|
38
|
+
handleArrowDown()
|
|
39
|
+
break
|
|
40
|
+
case 'Enter':
|
|
41
|
+
handleEnter()
|
|
42
|
+
break
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
onMounted(() => {
|
|
47
|
+
window.addEventListener('keydown', navigateList)
|
|
48
|
+
})
|
|
49
|
+
onBeforeUnmount(() => {
|
|
50
|
+
window.removeEventListener('keydown', navigateList)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
handleEnter,
|
|
55
|
+
highlightedIndex,
|
|
56
|
+
selectedItem
|
|
57
|
+
}
|
|
58
|
+
}
|