@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
@@ -242,6 +242,21 @@
242
242
  </dl-menu>
243
243
  </dl-button>
244
244
  </div>
245
+ <div>
246
+ <h3>Button with icon no label and menu</h3>
247
+ <p>should have</p>
248
+ <dl-button icon="icon-dl-search">
249
+ <div>
250
+ test
251
+ <dl-menu>
252
+ <dl-list>
253
+ <dl-list-item>item 1</dl-list-item>
254
+ <dl-list-item> item 2</dl-list-item>
255
+ </dl-list>
256
+ </dl-menu>
257
+ </div>
258
+ </dl-button>
259
+ </div>
245
260
  </div>
246
261
  </template>
247
262
 
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <div>
3
+ <DlCard
4
+ :image="image"
5
+ :text="text"
6
+ :title="title"
7
+ :keyboard-shortcut="keyboardShortcut"
8
+ :links="links"
9
+ />
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ import { defineComponent } from 'vue-demi'
15
+ import { DlCard } from '../components'
16
+
17
+ export default defineComponent({
18
+ name: 'DlCardDemo',
19
+ components: {
20
+ DlCard
21
+ },
22
+ data() {
23
+ return {
24
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Egestas volutpat quam blandit integer mattis. consectetur adipiscing elit. Egestas volutpat quam blandit integer mattis. ',
25
+ image: {
26
+ src: 'https://i0.wp.com/www.printmag.com/wp-content/uploads/2021/02/4cbe8d_f1ed2800a49649848102c68fc5a66e53mv2.gif?fit=476%2C280&ssl=1'
27
+ },
28
+ title: 'Lorem ipsum',
29
+ keyboardShortcut: 'Shift + E',
30
+ links: [
31
+ {
32
+ icon: 'icon-dl-list-view',
33
+ href: 'https://www.google.md/?hl=ru',
34
+ title: 'Lorem',
35
+ newtab: true,
36
+ external: true
37
+ },
38
+ {
39
+ href: '#test',
40
+ title: 'Developers',
41
+ icon: 'icon-dl-code'
42
+ }
43
+ ]
44
+ }
45
+ }
46
+ })
47
+ </script>
@@ -7,7 +7,10 @@
7
7
  @changeColor="onColorChange"
8
8
  @updateColor="onColorUpdate"
9
9
  />
10
- <h1 :style="{ color: colorPickerValue }">
10
+ <h1
11
+ class="textShadow"
12
+ :style="{ color: colorPickerValue }"
13
+ >
11
14
  The chosen color is {{ colorPickerValue }}
12
15
  </h1>
13
16
  </div>
@@ -38,6 +41,18 @@ export default defineComponent({
38
41
  ...colorsHistory.value
39
42
  ].slice(0, 7)
40
43
  }
44
+
45
+ return {
46
+ colorPickerValue,
47
+ colorsHistory,
48
+ onColorChange,
49
+ onColorUpdate
50
+ }
41
51
  }
42
52
  })
43
53
  </script>
54
+ <style lang="scss">
55
+ .textShadow {
56
+ text-shadow: 1px 1px 2px var(--dl-color-darker);
57
+ }
58
+ </style>
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <dl-confusion-matrix
3
+ :matrix="matrix"
4
+ :labels="labels"
5
+ />
6
+ </template>
7
+
8
+ <script lang="ts">
9
+ import { defineComponent } from 'vue-demi'
10
+ import { DlConfusionMatrix } from '../components'
11
+ export default defineComponent({
12
+ components: {
13
+ DlConfusionMatrix
14
+ },
15
+ setup() {
16
+ const matrix = []
17
+ const labels = []
18
+ const size = 10
19
+
20
+ const getLink = (number: number) => {
21
+ return `www.confusion-matrix.com/cell-${number}`
22
+ }
23
+
24
+ for (let i = 0; i < size; i++) {
25
+ const row = []
26
+ for (let j = 0; j < size; j++) {
27
+ const value = Math.floor(Math.random() * 10)
28
+ row.push({
29
+ value,
30
+ link: getLink(value)
31
+ })
32
+ }
33
+ matrix.push(row)
34
+ }
35
+
36
+ // const items = [
37
+ // { title: 'Van', image: 'https://picsum.photos/200/200' },
38
+ // { title: 'Truck', image: 'https://picsum.photos/200/200' },
39
+ // { title: 'Motorcycle', image: 'https://picsum.photos/200/200'},
40
+ // { title: 'Car', image: 'https://picsum.photos/200/200'},
41
+ // { title: 'Bus', image: 'https://picsum.photos/200/200'}
42
+ // ]
43
+
44
+ const items = ['Van', 'Truck', 'Motorcycle', 'Car', 'Bus']
45
+
46
+ for (let i = 0; i < size; i++) {
47
+ labels.push(items[Math.floor(Math.random() * items.length)])
48
+ }
49
+
50
+ return { matrix, labels, getLink }
51
+ }
52
+ })
53
+ </script>
@@ -103,7 +103,10 @@
103
103
  </template>
104
104
  <template #footer>
105
105
  <dl-dialog-box-footer>
106
- <dl-button @click="openSecondModal">
106
+ <dl-button
107
+ outlined
108
+ @click="openSecondModal"
109
+ >
107
110
  Open second modal
108
111
  </dl-button>
109
112
  <dl-button @click="closeModal">
@@ -0,0 +1,386 @@
1
+ <template>
2
+ <div>
3
+ <div style="display: flex; gap: 20px; flex-direction: column">
4
+ <h2>Splitted</h2>
5
+ <dl-dropdown-button
6
+ auto-close
7
+ outlined
8
+ split
9
+ label="Dropdown Button Outlined"
10
+ >
11
+ <dl-list>
12
+ <dl-list-item clickable>
13
+ <dl-item-section> Photos </dl-item-section>
14
+ </dl-list-item>
15
+
16
+ <dl-list-item clickable>
17
+ <dl-item-section> Videos </dl-item-section>
18
+ </dl-list-item>
19
+
20
+ <dl-list-item clickable>
21
+ <dl-item-section> Articles </dl-item-section>
22
+ </dl-list-item>
23
+ </dl-list>
24
+ </dl-dropdown-button>
25
+
26
+ <dl-dropdown-button
27
+ disabled
28
+ auto-close
29
+ outlined
30
+ split
31
+ label="Dropdown Button Outlined"
32
+ >
33
+ <dl-list>
34
+ <dl-list-item clickable>
35
+ <dl-item-section> Photos </dl-item-section>
36
+ </dl-list-item>
37
+
38
+ <dl-list-item clickable>
39
+ <dl-item-section> Videos </dl-item-section>
40
+ </dl-list-item>
41
+
42
+ <dl-list-item clickable>
43
+ <dl-item-section> Articles </dl-item-section>
44
+ </dl-list-item>
45
+ </dl-list>
46
+ </dl-dropdown-button>
47
+
48
+ <dl-dropdown-button
49
+ split
50
+ label="Dropdown Button Contained"
51
+ >
52
+ <dl-list>
53
+ <dl-list-item clickable>
54
+ <dl-item-section> Photos </dl-item-section>
55
+ </dl-list-item>
56
+
57
+ <dl-list-item clickable>
58
+ <dl-item-section> Videos </dl-item-section>
59
+ </dl-list-item>
60
+
61
+ <dl-list-item clickable>
62
+ <dl-item-section> Articles </dl-item-section>
63
+ </dl-list-item>
64
+ </dl-list>
65
+ </dl-dropdown-button>
66
+
67
+ <dl-dropdown-button
68
+ v-model="showing"
69
+ auto-close
70
+ split
71
+ :label="name"
72
+ main-btn-style="width: 120px"
73
+ @click="onClick"
74
+ >
75
+ <dl-list>
76
+ <dl-list-item
77
+ clickable
78
+ @click="() => onClose('Photos')"
79
+ >
80
+ <dl-item-section> Photos </dl-item-section>
81
+ </dl-list-item>
82
+
83
+ <dl-list-item
84
+ clickable
85
+ @click="() => onClose('Videos and long text')"
86
+ >
87
+ <dl-item-section :no-wrap="true">
88
+ Videos and long text ideos and long text ideos and
89
+ long text ideos and long text ideos and long text
90
+ </dl-item-section>
91
+ </dl-list-item>
92
+
93
+ <dl-list-item
94
+ clickable
95
+ @click="() => onClose('Articles')"
96
+ >
97
+ <dl-item-section> Articles </dl-item-section>
98
+ </dl-list-item>
99
+ </dl-list>
100
+ </dl-dropdown-button>
101
+ </div>
102
+
103
+ <div style="display: flex; gap: 20px; flex-direction: column">
104
+ <h2>One Button</h2>
105
+ <div
106
+ class="grid grid-cols-3"
107
+ style="column-gap: 10px"
108
+ >
109
+ <dl-dropdown-button
110
+ auto-close
111
+ outlined
112
+ label="Dropdown Button Outlined"
113
+ >
114
+ <dl-list>
115
+ <dl-list-item clickable>
116
+ <dl-item-section> Photos </dl-item-section>
117
+ </dl-list-item>
118
+
119
+ <dl-list-item clickable>
120
+ <dl-item-section> Videos </dl-item-section>
121
+ </dl-list-item>
122
+
123
+ <dl-list-item clickable>
124
+ <dl-item-section> Articles </dl-item-section>
125
+ </dl-list-item>
126
+ </dl-list>
127
+ </dl-dropdown-button>
128
+
129
+ <dl-dropdown-button
130
+ disabled
131
+ auto-close
132
+ outlined
133
+ label="Dropdown Button Outlined"
134
+ >
135
+ <dl-list>
136
+ <dl-list-item clickable>
137
+ <dl-item-section> Photos </dl-item-section>
138
+ </dl-list-item>
139
+
140
+ <dl-list-item clickable>
141
+ <dl-item-section> Videos </dl-item-section>
142
+ </dl-list-item>
143
+
144
+ <dl-list-item clickable>
145
+ <dl-item-section> Articles </dl-item-section>
146
+ </dl-list-item>
147
+ </dl-list>
148
+ </dl-dropdown-button>
149
+
150
+ <dl-dropdown-button
151
+ auto-close
152
+ label="Dropdown Button Contained"
153
+ max-height="210px"
154
+ >
155
+ <dl-list>
156
+ <dl-list-item clickable>
157
+ <dl-item-section> Photos </dl-item-section>
158
+ </dl-list-item>
159
+
160
+ <dl-list-item clickable>
161
+ <dl-item-section> Videos </dl-item-section>
162
+ </dl-list-item>
163
+
164
+ <dl-list-item clickable>
165
+ <dl-item-section> Articles </dl-item-section>
166
+ </dl-list-item>
167
+ <dl-list-item clickable>
168
+ <dl-item-section> Photos </dl-item-section>
169
+ </dl-list-item>
170
+
171
+ <dl-list-item clickable>
172
+ <dl-item-section> Videos </dl-item-section>
173
+ </dl-list-item>
174
+
175
+ <dl-list-item clickable>
176
+ <dl-item-section> Articles </dl-item-section>
177
+ </dl-list-item>
178
+ <dl-list-item clickable>
179
+ <dl-item-section> Photos </dl-item-section>
180
+ </dl-list-item>
181
+
182
+ <dl-list-item clickable>
183
+ <dl-item-section> Videos </dl-item-section>
184
+ </dl-list-item>
185
+
186
+ <dl-list-item clickable>
187
+ <dl-item-section> Articles </dl-item-section>
188
+ </dl-list-item>
189
+ </dl-list>
190
+ </dl-dropdown-button>
191
+ </div>
192
+
193
+ <div
194
+ class="grid grid-cols-3"
195
+ style="column-gap: 10px"
196
+ >
197
+ <dl-dropdown-button
198
+ auto-close
199
+ :model-value="showing"
200
+ :label="name"
201
+ main-btn-style="width: 150px;"
202
+ @show="onOpen"
203
+ >
204
+ <dl-list>
205
+ <dl-list-item
206
+ clickable
207
+ @click="() => onClose('Photos')"
208
+ >
209
+ <dl-item-section> Photos </dl-item-section>
210
+ </dl-list-item>
211
+
212
+ <dl-list-item
213
+ clickable
214
+ @click="() => onClose('Videos and long text')"
215
+ >
216
+ <dl-item-section>
217
+ Videos and long text
218
+ </dl-item-section>
219
+ </dl-list-item>
220
+ <dl-list-item
221
+ clickable
222
+ @click="() => onClose('Movies and long text')"
223
+ >
224
+ <dl-item-section>
225
+ Movies and long text
226
+ </dl-item-section>
227
+ </dl-list-item>
228
+
229
+ <dl-list-item
230
+ clickable
231
+ @click="() => onClose('Articles')"
232
+ >
233
+ <dl-item-section> Articles </dl-item-section>
234
+ </dl-list-item>
235
+ </dl-list>
236
+ </dl-dropdown-button>
237
+
238
+ <dl-dropdown-button
239
+ auto-close
240
+ :model-value="showing"
241
+ label="Ellipsis for very long text"
242
+ main-btn-style="width: 150px;"
243
+ :overflow="true"
244
+ :no-wrap="true"
245
+ tooltip="Tooltip message"
246
+ @show="onOpen"
247
+ >
248
+ <dl-list>
249
+ <dl-list-item
250
+ clickable
251
+ @click="() => onClose('Photos')"
252
+ >
253
+ <dl-item-section> Photos </dl-item-section>
254
+ </dl-list-item>
255
+
256
+ <dl-list-item
257
+ clickable
258
+ @click="() => onClose('Videos and long text')"
259
+ >
260
+ <dl-item-section :no-wrap="true">
261
+ <dl-ellipsis
262
+ text="Very very very very long long long long text text text"
263
+ :middle-ellipsis="true"
264
+ />
265
+ </dl-item-section>
266
+ </dl-list-item>
267
+ <dl-list-item
268
+ clickable
269
+ @click="() => onClose('Movies and long text')"
270
+ >
271
+ <dl-item-section :no-wrap="true">
272
+ <dl-ellipsis
273
+ text="Very very very very long long long long text text text"
274
+ />
275
+ </dl-item-section>
276
+ </dl-list-item>
277
+
278
+ <dl-list-item
279
+ clickable
280
+ @click="() => onClose('Articles')"
281
+ >
282
+ <dl-item-section> Articles </dl-item-section>
283
+ </dl-list-item>
284
+ </dl-list>
285
+ </dl-dropdown-button>
286
+
287
+ <dl-dropdown-button
288
+ auto-close
289
+ :model-value="showing"
290
+ :label="arrowNavigationLabel"
291
+ main-btn-style="width: 150px;"
292
+ :overflow="true"
293
+ :no-wrap="true"
294
+ tooltip="Tooltip message"
295
+ :arrow-nav-items="listItems"
296
+ @show="onOpen"
297
+ @highlightedIndex="setHighlightedIndex"
298
+ @handleSelectedItem="handleSelectedItem"
299
+ >
300
+ <dl-list>
301
+ <dl-list-item
302
+ v-for="(item, index) in listItems"
303
+ :key="index"
304
+ clickable
305
+ :is-highlighted="index === highlightedIndex"
306
+ >
307
+ <dl-item-section>
308
+ {{ item }}
309
+ </dl-item-section>
310
+ </dl-list-item>
311
+ </dl-list>
312
+ </dl-dropdown-button>
313
+ </div>
314
+ </div>
315
+ </div>
316
+ </template>
317
+
318
+ <script lang="ts">
319
+ import { defineComponent, ref } from 'vue-demi'
320
+ import {
321
+ DlListItem,
322
+ DlItemSection,
323
+ DlList,
324
+ DlDropdownButton,
325
+ DlEllipsis
326
+ } from '../components'
327
+
328
+ export default defineComponent({
329
+ name: 'DlDropdownButtonDemo',
330
+ components: {
331
+ DlListItem,
332
+ DlItemSection,
333
+ DlList,
334
+ DlDropdownButton,
335
+ DlEllipsis
336
+ },
337
+ setup() {
338
+ const highlightedIndex = ref(-1)
339
+ const name = ref('Dropdown Button Controlled')
340
+ const showing = ref(false)
341
+ const arrowNavigationLabel = ref('Arrow Navigation Label')
342
+
343
+ const listItems = ref([
344
+ 'New tab',
345
+ 'New incognito tab',
346
+ 'Recent tabs',
347
+ 'History',
348
+ 'Downloads',
349
+ 'Settings',
350
+ 'Help & Feedback'
351
+ ])
352
+
353
+ const handleSelectedItem = (value: any) => {
354
+ arrowNavigationLabel.value = value
355
+ showing.value = false
356
+ }
357
+ const onClose = (newName: string) => {
358
+ name.value = newName
359
+ showing.value = false
360
+ alert(name.value)
361
+ }
362
+ const onOpen = () => {
363
+ showing.value = true
364
+ }
365
+ const onClick = () => {
366
+ alert(name.value)
367
+ }
368
+ const setHighlightedIndex = (value: number) => {
369
+ highlightedIndex.value = value
370
+ }
371
+
372
+ return {
373
+ listItems,
374
+ onClose,
375
+ onOpen,
376
+ onClick,
377
+ name,
378
+ showing,
379
+ setHighlightedIndex,
380
+ handleSelectedItem,
381
+ highlightedIndex,
382
+ arrowNavigationLabel
383
+ }
384
+ }
385
+ })
386
+ </script>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div style="width: 90%">
3
+ <div style="white-space: nowrap; width: 350px">
4
+ <p style="font-weight: bold">
5
+ Ellipsis at the end
6
+ </p>
7
+ <dl-ellipsis
8
+ text="Lorem ipsum dolor sit amet consectetur adipisicing elit."
9
+ />
10
+ </div>
11
+ <div style="white-space: nowrap; width: 350px">
12
+ <p style="font-weight: bold">
13
+ Ellipsis at the middle
14
+ </p>
15
+ <dl-ellipsis
16
+ text="Lorem ipsum dolor sit amet consectetur adipisicing elit. "
17
+ middle-ellipsis="true"
18
+ />
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script lang="ts">
24
+ import { defineComponent } from 'vue-demi'
25
+ import { DlEllipsis } from '../components'
26
+
27
+ export default defineComponent({
28
+ components: { DlEllipsis }
29
+ })
30
+ </script>
@@ -282,29 +282,29 @@ const data = {
282
282
  datasets: [
283
283
  {
284
284
  label: 'Discarded',
285
- backgroundColor: '--dl-color-secondary',
286
- borderColor: '--dl-color-secondary',
285
+ backgroundColor: '--dl-color-chart-7',
286
+ borderColor: '--dl-color-chart-7',
287
287
  pointRadius: 4,
288
288
  data: randomIntFromInterval(0, 4)
289
289
  },
290
290
  {
291
291
  label: 'Undiscarded',
292
- backgroundColor: '--dl-color-warning',
293
- borderColor: '--dl-color-warning',
292
+ backgroundColor: '--dl-color-chart-1',
293
+ borderColor: '--dl-color-chart-1',
294
294
  pointRadius: 4,
295
295
  data: randomIntFromInterval(2, 6)
296
296
  },
297
297
  {
298
298
  label: 'Completed',
299
- backgroundColor: '--dl-color-positive',
300
- borderColor: '--dl-color-positive',
299
+ backgroundColor: '--dl-color-chart-14',
300
+ borderColor: '--dl-color-chart-14',
301
301
  pointRadius: 4,
302
302
  data: randomIntFromInterval(1, 5)
303
303
  },
304
304
  {
305
305
  label: 'Uncompleted',
306
- backgroundColor: '--dl-color-negative',
307
- borderColor: '--dl-color-negative',
306
+ backgroundColor: '--dl-color-secondary',
307
+ borderColor: '--dl-color-secondary',
308
308
  pointRadius: 4,
309
309
  data: randomIntFromInterval(0, 5)
310
310
  }