@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.
Files changed (146) hide show
  1. package/.eslintrc.js +2 -2
  2. package/package.json +10 -9
  3. package/src/App.vue +116 -57
  4. package/src/assets/globals.scss +2 -0
  5. package/src/components/basic/DlAlert/DlAlert.vue +1 -1
  6. package/src/components/basic/DlButton/DlButton.vue +13 -13
  7. package/src/components/basic/DlCard/DlCard.vue +217 -0
  8. package/src/components/basic/DlCard/index.ts +3 -0
  9. package/src/components/basic/DlCard/types.ts +20 -0
  10. package/src/components/basic/DlChip/DlChip.vue +1 -0
  11. package/src/components/basic/DlEllipsis/DlEllipsis.vue +90 -0
  12. package/src/components/basic/DlEllipsis/index.ts +2 -0
  13. package/src/components/basic/DlListItem/DlListItem.vue +11 -5
  14. package/src/components/basic/index.ts +2 -0
  15. package/src/components/compound/DlCharts/charts/DlBarChart/DlBarChart.vue +8 -1
  16. package/src/components/compound/DlCharts/charts/DlColumnChart/DlColumnChart.vue +22 -6
  17. package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +526 -0
  18. package/src/components/compound/DlCharts/charts/DlConfusionMatrix/index.ts +2 -0
  19. package/src/components/compound/DlCharts/charts/DlConfusionMatrix/utils.ts +96 -0
  20. package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChart.vue +2 -2
  21. package/src/components/compound/DlCharts/charts/DlLineChart/DlLineChart.vue +22 -6
  22. package/src/components/compound/DlCharts/charts/index.ts +1 -0
  23. package/src/components/compound/DlCharts/components/DlBrush.vue +8 -1
  24. package/src/components/compound/DlCharts/components/DlChartScrollBar.vue +34 -21
  25. package/src/components/compound/DlCharts/types/DlConfusionMatrix.types.ts +19 -0
  26. package/src/components/compound/DlCharts/types/index.ts +2 -1
  27. package/src/components/compound/DlCharts/types/props.ts +14 -0
  28. package/src/components/compound/DlDialogBox/DlDialogBox.vue +1 -1
  29. package/src/components/compound/DlDialogBox/components/DlDialogBoxFooter.vue +1 -0
  30. package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +58 -12
  31. package/src/components/compound/DlInput/DlInput.vue +45 -23
  32. package/src/components/compound/DlJsonEditor/DlJsonEditor.vue +13 -29
  33. package/src/components/compound/DlPagination/DlPagination.vue +14 -4
  34. package/src/components/compound/DlPagination/components/PageNavigation.vue +24 -25
  35. package/src/components/compound/DlPagination/components/PaginationLegend.vue +2 -1
  36. package/src/components/compound/DlPagination/components/QuickNavigation.vue +1 -0
  37. package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +86 -49
  38. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +20 -13
  39. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSuggestionsDropdown.vue +43 -4
  40. package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +1 -55
  41. package/src/components/compound/DlSearches/DlSmartSearch/utils/index.ts +42 -10
  42. package/src/components/compound/DlSearches/DlSmartSearch/utils/utils.ts +107 -0
  43. package/src/components/compound/DlSelect/DlSelect.vue +41 -8
  44. package/src/components/compound/DlTable/DlTable.vue +13 -10
  45. package/src/components/compound/DlTable/styles/dl-table-styles.scss +16 -4
  46. package/src/components/compound/DlToggleButton/DlToggleButton.vue +109 -0
  47. package/src/components/compound/DlToggleButton/config.ts +27 -0
  48. package/src/components/compound/DlToggleButton/index.ts +3 -0
  49. package/src/components/compound/DlToggleButton/types.ts +4 -0
  50. package/src/components/compound/index.ts +1 -0
  51. package/src/components/compound/types.ts +1 -0
  52. package/src/components/essential/DlColorPicker/DlColorPicker.vue +4 -1
  53. package/src/components/essential/DlColorPicker/components/DlColors.vue +2 -6
  54. package/src/components/essential/DlIcon/DlIcon.vue +5 -1
  55. package/src/components/essential/DlMenu/DlMenu.vue +30 -2
  56. package/src/components/essential/DlSeparator/DlSeparator.vue +62 -0
  57. package/src/components/essential/DlSeparator/index.ts +2 -0
  58. package/src/components/essential/DlSpinner/DlSpinner.vue +53 -217
  59. package/src/components/essential/DlSpinner/components/DlSpinnerCircle.vue +44 -0
  60. package/src/components/essential/DlSpinner/components/DlSpinnerClock.vue +79 -0
  61. package/src/components/essential/DlSpinner/components/DlSpinnerDots.vue +113 -0
  62. package/src/components/essential/DlSpinner/components/DlSpinnerGrid.vue +166 -0
  63. package/src/components/essential/DlSpinner/components/DlSpinnerLogo.vue +152 -0
  64. package/src/components/essential/DlSpinner/index.ts +14 -1
  65. package/src/components/essential/DlSpinner/styles/spinnerStyles.scss +111 -0
  66. package/src/components/essential/DlSpinner/types.ts +7 -0
  67. package/src/components/essential/index.ts +1 -0
  68. package/src/components/essential/types.ts +1 -0
  69. package/src/components/shared/DlItemSection/DlItemSection.vue +21 -15
  70. package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +36 -21
  71. package/src/components/shared/DlVirtualScroll/useVirtualScroll.ts +8 -10
  72. package/src/{demo → demos}/DlButtonDemo.vue +15 -0
  73. package/src/demos/DlCardDemo.vue +47 -0
  74. package/src/{demo → demos}/DlColorPickerDemo.vue +16 -1
  75. package/src/demos/DlConfusionMatrixDemo.vue +53 -0
  76. package/src/{demo → demos}/DlDialogBoxDemo.vue +4 -1
  77. package/src/demos/DlDropdownButtonDemo.vue +386 -0
  78. package/src/demos/DlEllipsisDemo.vue +30 -0
  79. package/src/{demo → demos}/DlLineChartDemo.vue +8 -8
  80. package/src/{demo → demos}/DlMenuDemo.vue +61 -2
  81. package/src/{demo → demos}/DlSearchDemo.vue +3 -2
  82. package/src/demos/DlSeparatorDemo.vue +44 -0
  83. package/src/demos/DlSpinnerDemo.vue +59 -0
  84. package/src/{demo → demos}/DlTableDemo.vue +117 -29
  85. package/src/demos/DlToggleButtonDemo.vue +57 -0
  86. package/src/{demo → demos}/DlTooltipDemo.vue +43 -2
  87. package/src/{demo → demos}/DlWidgetDemo.vue +34 -19
  88. package/src/{demo → demos}/SmartSearchDemo/DlSmartSearchDemo.vue +2 -50
  89. package/src/{demo → demos}/index.ts +14 -56
  90. package/src/hooks/use-arrow-navigation.ts +58 -0
  91. package/src/hooks/use-suggestions.ts +97 -74
  92. package/src/utils/colors.ts +1 -1
  93. package/src/utils/draggable-table.ts +2 -2
  94. package/src/utils/index.ts +1 -0
  95. package/src/utils/parse-smart-query.ts +87 -0
  96. package/src/components/compound/DlCharts/types.ts +0 -1
  97. package/src/demo/DlDropdownButtonDemo.vue +0 -260
  98. package/src/demo/DlSpinnerDemo.vue +0 -20
  99. /package/src/{demo → demos}/BarChartDemo.vue +0 -0
  100. /package/src/{demo → demos}/ColumnChartDemo.vue +0 -0
  101. /package/src/{demo → demos}/DlAccordionDemo.vue +0 -0
  102. /package/src/{demo → demos}/DlAlertDemo.vue +0 -0
  103. /package/src/{demo → demos}/DlAvatarDemo.vue +0 -0
  104. /package/src/{demo → demos}/DlBadgeDemo.vue +0 -0
  105. /package/src/{demo → demos}/DlChartDoughnutDemo.vue +0 -0
  106. /package/src/{demo → demos}/DlCheckboxDemo.vue +0 -0
  107. /package/src/{demo → demos}/DlChipDemo.vue +0 -0
  108. /package/src/{demo → demos}/DlCounterDemo.vue +0 -0
  109. /package/src/{demo → demos}/DlDateTimeRangeDemo.vue +0 -0
  110. /package/src/{demo → demos}/DlIconDemo.vue +0 -0
  111. /package/src/{demo → demos}/DlInputDemo.vue +0 -0
  112. /package/src/{demo → demos}/DlKpiDemo.vue +0 -0
  113. /package/src/{demo → demos}/DlLinkDemo.vue +0 -0
  114. /package/src/{demo → demos}/DlListDemo.vue +0 -0
  115. /package/src/{demo → demos}/DlOptionGroupDemo.vue +0 -0
  116. /package/src/{demo → demos}/DlPaginationDemo.vue +0 -0
  117. /package/src/{demo → demos}/DlPanelContainerDemo.vue +0 -0
  118. /package/src/{demo → demos}/DlPopupDemo.vue +0 -0
  119. /package/src/{demo → demos}/DlProgressBarDemo.vue +0 -0
  120. /package/src/{demo → demos}/DlProgressChartDemo.vue +0 -0
  121. /package/src/{demo → demos}/DlRadioDemo.vue +0 -0
  122. /package/src/{demo → demos}/DlRangeDemo.vue +0 -0
  123. /package/src/{demo → demos}/DlSelectDemo.vue +0 -0
  124. /package/src/{demo → demos}/DlSkeletonDemo.vue +0 -0
  125. /package/src/{demo → demos}/DlSliderDemo.vue +0 -0
  126. /package/src/{demo → demos}/DlStepperDemo/CenteredStepperInDialogBox.vue +0 -0
  127. /package/src/{demo → demos}/DlStepperDemo/DlStepperDemo.vue +0 -0
  128. /package/src/{demo → demos}/DlStepperDemo/SimpleStepper.vue +0 -0
  129. /package/src/{demo → demos}/DlStepperDemo/StepperInDialogBox.vue +0 -0
  130. /package/src/{demo → demos}/DlStepperDemo/index.ts +0 -0
  131. /package/src/{demo → demos}/DlStepperDemo/steps/AssignmentsStep.vue +0 -0
  132. /package/src/{demo → demos}/DlStepperDemo/steps/DataStep.vue +0 -0
  133. /package/src/{demo → demos}/DlStepperDemo/steps/GeneralStep.vue +0 -0
  134. /package/src/{demo → demos}/DlStepperDemo/steps/InstructionStep.vue +0 -0
  135. /package/src/{demo → demos}/DlStepperDemo/steps/QualityStep.vue +0 -0
  136. /package/src/{demo → demos}/DlSwitchDemo.vue +0 -0
  137. /package/src/{demo → demos}/DlTabsDemo.vue +0 -0
  138. /package/src/{demo → demos}/DlTdDemo.vue +0 -0
  139. /package/src/{demo → demos}/DlTextAreaDemo.vue +0 -0
  140. /package/src/{demo → demos}/DlTextHolderDemo.vue +0 -0
  141. /package/src/{demo → demos}/DlThDemo.vue +0 -0
  142. /package/src/{demo → demos}/DlToastDemo.vue +0 -0
  143. /package/src/{demo → demos}/DlTrDemo.vue +0 -0
  144. /package/src/{demo → demos}/DlTrendDemo.vue +0 -0
  145. /package/src/{demo → demos}/DlTypographyDemo.vue +0 -0
  146. /package/src/{demo → demos}/SmartSearchDemo/schema.ts +0 -0
@@ -486,6 +486,27 @@
486
486
  </dl-list>
487
487
  </dl-menu>
488
488
  </dl-button>
489
+
490
+ <h4>Arrow navigation</h4>
491
+ <dl-button :label="arrowNavigationLabel">
492
+ <dl-menu
493
+ @show="onShow"
494
+ @hide="onHide"
495
+ >
496
+ <dl-list style="min-width: 100px">
497
+ <dl-list-item
498
+ v-for="(item, index) in listItems"
499
+ :key="index"
500
+ clickable
501
+ :is-highlighted="index === highlightedIndex"
502
+ >
503
+ <dl-item-section>
504
+ {{ item }}
505
+ </dl-item-section>
506
+ </dl-list-item>
507
+ </dl-list>
508
+ </dl-menu>
509
+ </dl-button>
489
510
  </div>
490
511
  </div>
491
512
  </div>
@@ -500,7 +521,8 @@ import {
500
521
  DlList,
501
522
  DlMenu
502
523
  } from '../components'
503
- import { defineComponent, onMounted, ref } from 'vue-demi'
524
+ import { defineComponent, onMounted, ref, watch } from 'vue-demi'
525
+ import { useArrowNavigation } from '../hooks/use-arrow-navigation'
504
526
 
505
527
  export default defineComponent({
506
528
  name: 'DlMenuDemo',
@@ -514,11 +536,48 @@ export default defineComponent({
514
536
  },
515
537
  setup() {
516
538
  const showing = ref(false)
539
+ const isMenuOpen = ref(false)
540
+ const arrowNavigationLabel = ref('Arrow Navigation Label')
541
+
542
+ const listItems = ref([
543
+ 'New tab',
544
+ 'New incognito tab',
545
+ 'Recent tabs',
546
+ 'History',
547
+ 'Downloads',
548
+ 'Settings',
549
+ 'Help & Feedback'
550
+ ])
551
+
552
+ const onShow = (value: any) => {
553
+ isMenuOpen.value = !!value
554
+ }
555
+ const onHide = (value: any) => {
556
+ isMenuOpen.value = !value
557
+ }
558
+ const { selectedItem, highlightedIndex } = useArrowNavigation(
559
+ listItems,
560
+ isMenuOpen
561
+ )
562
+
563
+ watch(selectedItem, (value: string) => {
564
+ arrowNavigationLabel.value = value
565
+ })
566
+
517
567
  onMounted(() => {
518
568
  // @ts-ignore
519
569
  window.menuDemo = { showing }
520
570
  })
521
- return { showing }
571
+ return {
572
+ showing,
573
+ listItems,
574
+ onShow,
575
+ onHide,
576
+ isMenuOpen,
577
+ selectedItem,
578
+ highlightedIndex,
579
+ arrowNavigationLabel
580
+ }
522
581
  }
523
582
  })
524
583
  </script>
@@ -6,7 +6,7 @@
6
6
  with-search-btn
7
7
  highlight-matches
8
8
  placeholder="Search here"
9
- :auto-suggest-items="['foo', 'bar']"
9
+ :auto-suggest-items="suggestItems"
10
10
  />
11
11
  </div>
12
12
  </template>
@@ -21,7 +21,8 @@ export default defineComponent({
21
21
  },
22
22
  setup() {
23
23
  const searchValue = ref<string>('')
24
- return { searchValue }
24
+ const suggestItems = ['foo', 'foo bar', 'bar', 'bar foo']
25
+ return { searchValue, suggestItems }
25
26
  }
26
27
  })
27
28
  </script>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <div>
3
+ <div style="display: flex">
4
+ <p>
5
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas
6
+ eos amet, nobis unde animi atque itaque? Provident suscipit enim
7
+ eos sequi dolor minima optio tempora error tenetur, autem
8
+ ratione cumque!
9
+ </p>
10
+ <DlSeparator type="vertical" />
11
+ <p>
12
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas
13
+ eos amet, nobis unde animi atque itaque? Provident suscipit enim
14
+ eos sequi dolor minima optio tempora error tenetur, autem
15
+ ratione cumque!
16
+ </p>
17
+ </div>
18
+ <div>
19
+ <p>
20
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas
21
+ eos amet, nobis unde animi atque itaque? Provident suscipit enim
22
+ eos sequi dolor minima optio tempora error tenetur, autem
23
+ ratione cumque!
24
+ </p>
25
+ <DlSeparator width="100%" />
26
+ <p>
27
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas
28
+ eos amet, nobis unde animi atque itaque? Provident suscipit enim
29
+ eos sequi dolor minima optio tempora error tenetur, autem
30
+ ratione cumque!
31
+ </p>
32
+ </div>
33
+ </div>
34
+ </template>
35
+
36
+ <script>
37
+ import { defineComponent } from 'vue-demi'
38
+ import { DlSeparator } from '../components'
39
+
40
+ export default defineComponent({
41
+ name: 'DlSeparatorDemo',
42
+ components: { DlSeparator }
43
+ })
44
+ </script>
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <div class="spinner-dl">
3
+ <div class="spinner-container">
4
+ <span class="spinner-title">Dl Spinner</span>
5
+ <dl-spinner
6
+ type="default"
7
+ text="Loading..."
8
+ :text-styles="{
9
+ fontSize: '1em',
10
+ marginTop: '15px',
11
+ marginLeft: '10px'
12
+ }"
13
+ />
14
+ </div>
15
+
16
+ <div class="spinner-container">
17
+ <span class="spinner-title">Circle Spinner</span>
18
+ <dl-spinner type="circle" />
19
+ </div>
20
+
21
+ <div class="spinner-container">
22
+ <span class="spinner-title">Grid Spinner</span>
23
+ <dl-spinner type="grid" />
24
+ </div>
25
+
26
+ <div class="spinner-container">
27
+ <span class="spinner-title">Dots Spinner</span>
28
+ <dl-spinner type="dots" />
29
+ </div>
30
+
31
+ <div class="spinner-container">
32
+ <span class="spinner-title">Clock Spinner</span>
33
+ <dl-spinner type="clock" />
34
+ </div>
35
+ </div>
36
+ </template>
37
+
38
+ <script>
39
+ import { defineComponent } from 'vue-demi'
40
+ import { DlSpinner } from '../components'
41
+
42
+ export default defineComponent({
43
+ components: {
44
+ DlSpinner
45
+ }
46
+ })
47
+ </script>
48
+
49
+ <style lang="scss">
50
+ .spinner-container {
51
+ display: flex;
52
+ flex-direction: column;
53
+ align-items: center;
54
+ }
55
+
56
+ .spinner-title {
57
+ margin-bottom: 20px;
58
+ }
59
+ </style>
@@ -96,7 +96,7 @@
96
96
  <DlTable
97
97
  :selected="selected"
98
98
  :separator="separator"
99
- :columns="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="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="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, watch } from 'vue-demi'
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
- data() {
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,57 @@
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 { defineComponent } from 'vue-demi'
27
+
28
+ export default defineComponent({
29
+ name: 'DlToggleButtonDemo',
30
+ components: { DlIcon, DlInput, DlToggleButton },
31
+ setup() {
32
+ return {
33
+ DlToggleButton
34
+ }
35
+ },
36
+ data: () => ({
37
+ options: [
38
+ { label: 'Button 1', value: 1 },
39
+ { label: 'Button 2', value: 2 },
40
+ { label: 'Button 3', value: 3 }
41
+ ],
42
+ selectedValue: 1,
43
+ width: '100%'
44
+ }),
45
+ computed: {
46
+ label() {
47
+ return this.options.find((o) => o.value === this.selectedValue)
48
+ ?.label
49
+ }
50
+ },
51
+ methods: {
52
+ change(val: any) {
53
+ console.log(val)
54
+ }
55
+ }
56
+ })
57
+ </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 { DlWidget, DlGridRow, DlGrid, DlBarChart } from '../components'
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 1</span>
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-bar-chart
69
- :legend-props="legendProps"
70
- :data="data"
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 eligendi dolore, similique possimus
78
- veritatis in vitae quia praesentium fuga quibusdam
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>