@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.
Files changed (145) hide show
  1. package/.eslintrc.js +2 -2
  2. package/package.json +10 -9
  3. package/src/App.vue +120 -58
  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 +234 -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 +542 -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 +86 -69
  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 +66 -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 +156 -0
  60. package/src/components/essential/DlSpinner/components/DlSpinnerClock.vue +191 -0
  61. package/src/components/essential/DlSpinner/components/DlSpinnerDots.vue +225 -0
  62. package/src/components/essential/DlSpinner/components/DlSpinnerGrid.vue +278 -0
  63. package/src/components/essential/DlSpinner/components/DlSpinnerLogo.vue +264 -0
  64. package/src/components/essential/DlSpinner/index.ts +14 -1
  65. package/src/components/essential/DlSpinner/types.ts +7 -0
  66. package/src/components/essential/index.ts +1 -0
  67. package/src/components/essential/types.ts +1 -0
  68. package/src/components/shared/DlItemSection/DlItemSection.vue +21 -15
  69. package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +36 -21
  70. package/src/components/shared/DlVirtualScroll/useVirtualScroll.ts +8 -10
  71. package/src/{demo → demos}/DlButtonDemo.vue +15 -0
  72. package/src/demos/DlCardDemo.vue +47 -0
  73. package/src/{demo → demos}/DlColorPickerDemo.vue +16 -1
  74. package/src/demos/DlConfusionMatrixDemo.vue +53 -0
  75. package/src/{demo → demos}/DlDialogBoxDemo.vue +4 -1
  76. package/src/demos/DlDropdownButtonDemo.vue +386 -0
  77. package/src/demos/DlEllipsisDemo.vue +30 -0
  78. package/src/{demo → demos}/DlLineChartDemo.vue +8 -8
  79. package/src/{demo → demos}/DlMenuDemo.vue +61 -2
  80. package/src/{demo → demos}/DlSearchDemo.vue +3 -2
  81. package/src/demos/DlSeparatorDemo.vue +44 -0
  82. package/src/demos/DlSpinnerDemo.vue +59 -0
  83. package/src/{demo → demos}/DlTableDemo.vue +117 -29
  84. package/src/demos/DlToggleButtonDemo.vue +55 -0
  85. package/src/{demo → demos}/DlTooltipDemo.vue +43 -2
  86. package/src/{demo → demos}/DlWidgetDemo.vue +34 -19
  87. package/src/{demo → demos}/SmartSearchDemo/DlSmartSearchDemo.vue +2 -50
  88. package/src/{demo → demos}/index.ts +14 -56
  89. package/src/hooks/use-arrow-navigation.ts +58 -0
  90. package/src/hooks/use-suggestions.ts +97 -74
  91. package/src/utils/colors.ts +1 -1
  92. package/src/utils/draggable-table.ts +2 -2
  93. package/src/utils/index.ts +1 -0
  94. package/src/utils/parse-smart-query.ts +87 -0
  95. package/src/components/compound/DlCharts/types.ts +0 -1
  96. package/src/demo/DlDropdownButtonDemo.vue +0 -260
  97. package/src/demo/DlSpinnerDemo.vue +0 -20
  98. /package/src/{demo → demos}/BarChartDemo.vue +0 -0
  99. /package/src/{demo → demos}/ColumnChartDemo.vue +0 -0
  100. /package/src/{demo → demos}/DlAccordionDemo.vue +0 -0
  101. /package/src/{demo → demos}/DlAlertDemo.vue +0 -0
  102. /package/src/{demo → demos}/DlAvatarDemo.vue +0 -0
  103. /package/src/{demo → demos}/DlBadgeDemo.vue +0 -0
  104. /package/src/{demo → demos}/DlChartDoughnutDemo.vue +0 -0
  105. /package/src/{demo → demos}/DlCheckboxDemo.vue +0 -0
  106. /package/src/{demo → demos}/DlChipDemo.vue +0 -0
  107. /package/src/{demo → demos}/DlCounterDemo.vue +0 -0
  108. /package/src/{demo → demos}/DlDateTimeRangeDemo.vue +0 -0
  109. /package/src/{demo → demos}/DlIconDemo.vue +0 -0
  110. /package/src/{demo → demos}/DlInputDemo.vue +0 -0
  111. /package/src/{demo → demos}/DlKpiDemo.vue +0 -0
  112. /package/src/{demo → demos}/DlLinkDemo.vue +0 -0
  113. /package/src/{demo → demos}/DlListDemo.vue +0 -0
  114. /package/src/{demo → demos}/DlOptionGroupDemo.vue +0 -0
  115. /package/src/{demo → demos}/DlPaginationDemo.vue +0 -0
  116. /package/src/{demo → demos}/DlPanelContainerDemo.vue +0 -0
  117. /package/src/{demo → demos}/DlPopupDemo.vue +0 -0
  118. /package/src/{demo → demos}/DlProgressBarDemo.vue +0 -0
  119. /package/src/{demo → demos}/DlProgressChartDemo.vue +0 -0
  120. /package/src/{demo → demos}/DlRadioDemo.vue +0 -0
  121. /package/src/{demo → demos}/DlRangeDemo.vue +0 -0
  122. /package/src/{demo → demos}/DlSelectDemo.vue +0 -0
  123. /package/src/{demo → demos}/DlSkeletonDemo.vue +0 -0
  124. /package/src/{demo → demos}/DlSliderDemo.vue +0 -0
  125. /package/src/{demo → demos}/DlStepperDemo/CenteredStepperInDialogBox.vue +0 -0
  126. /package/src/{demo → demos}/DlStepperDemo/DlStepperDemo.vue +0 -0
  127. /package/src/{demo → demos}/DlStepperDemo/SimpleStepper.vue +0 -0
  128. /package/src/{demo → demos}/DlStepperDemo/StepperInDialogBox.vue +0 -0
  129. /package/src/{demo → demos}/DlStepperDemo/index.ts +0 -0
  130. /package/src/{demo → demos}/DlStepperDemo/steps/AssignmentsStep.vue +0 -0
  131. /package/src/{demo → demos}/DlStepperDemo/steps/DataStep.vue +0 -0
  132. /package/src/{demo → demos}/DlStepperDemo/steps/GeneralStep.vue +0 -0
  133. /package/src/{demo → demos}/DlStepperDemo/steps/InstructionStep.vue +0 -0
  134. /package/src/{demo → demos}/DlStepperDemo/steps/QualityStep.vue +0 -0
  135. /package/src/{demo → demos}/DlSwitchDemo.vue +0 -0
  136. /package/src/{demo → demos}/DlTabsDemo.vue +0 -0
  137. /package/src/{demo → demos}/DlTdDemo.vue +0 -0
  138. /package/src/{demo → demos}/DlTextAreaDemo.vue +0 -0
  139. /package/src/{demo → demos}/DlTextHolderDemo.vue +0 -0
  140. /package/src/{demo → demos}/DlThDemo.vue +0 -0
  141. /package/src/{demo → demos}/DlToastDemo.vue +0 -0
  142. /package/src/{demo → demos}/DlTrDemo.vue +0 -0
  143. /package/src/{demo → demos}/DlTrendDemo.vue +0 -0
  144. /package/src/{demo → demos}/DlTypographyDemo.vue +0 -0
  145. /package/src/{demo → demos}/SmartSearchDemo/schema.ts +0 -0
@@ -0,0 +1,264 @@
1
+ <template>
2
+ <div class="spinner-wrapper">
3
+ <div
4
+ class="spinner"
5
+ :style="spinnerStyles"
6
+ >
7
+ <div class="spin-bg">
8
+ <svg
9
+ id="Layer_2"
10
+ data-name="Layer 2"
11
+ viewBox="0 0 140 140"
12
+ >
13
+ <g
14
+ id="Layer_1-2"
15
+ data-name="Layer 1"
16
+ >
17
+ <path
18
+ class="dl-svg"
19
+ d="M70,0C31.33,0,0,31.33,0,70s31.33,70,70,70,70-31.33,70-70S108.67,0,70,0Zm0,131.97c-34.2,0-61.97-27.77-61.97-61.97S35.8,8.03,70,8.03s61.97,27.77,61.97,61.97-27.77,61.97-61.97,61.97Z"
20
+ />
21
+ </g>
22
+ </svg>
23
+ </div>
24
+ <div class="spin-loader">
25
+ <svg
26
+ id="Layer_2"
27
+ data-name="Layer 2"
28
+ viewBox="0 0 140 140"
29
+ >
30
+ <defs>
31
+ <linearGradient
32
+ id="linear-gradient"
33
+ x1="12.53"
34
+ y1="229.07"
35
+ x2="119.46"
36
+ y2="229.07"
37
+ gradientTransform="translate(0 246.89) scale(1 -1)"
38
+ gradientUnits="userSpaceOnUse"
39
+ >
40
+ <stop
41
+ offset="0"
42
+ :stop-color="color"
43
+ stop-opacity="0"
44
+ />
45
+ <stop
46
+ offset=".12"
47
+ :stop-color="color"
48
+ stop-opacity="0"
49
+ />
50
+ <stop
51
+ offset=".34"
52
+ :stop-color="color"
53
+ />
54
+ <stop
55
+ offset=".69"
56
+ :stop-color="color"
57
+ />
58
+ <stop
59
+ offset=".91"
60
+ :stop-color="color"
61
+ stop-opacity="0"
62
+ />
63
+ </linearGradient>
64
+ </defs>
65
+ <g
66
+ id="Layer_1-2"
67
+ data-name="Layer 1"
68
+ >
69
+ <g>
70
+ <path
71
+ class="spinner-color-bg"
72
+ d="M70,0C31.33,0,0,31.33,0,70s31.33,70,70,70,70-31.33,70-70S108.67,0,70,0Zm0,131.97c-34.2,0-61.97-27.77-61.97-61.97S35.8,8.03,70,8.03s61.97,27.77,61.97,61.97-27.77,61.97-61.97,61.97Z"
73
+ />
74
+ <path
75
+ class="spinner-color"
76
+ d="M114.87,25.82c1.38-1.38,2.87-2.75,4.25-4.13,.46-.34,.46-1.03,0-1.49C106.49,7.69,89.16,0,70,0,46.36,0,25.48,11.7,12.74,29.72c-.34,.46-.23,.92,.11,1.38l4.25,4.25c.46,.46,1.15,.34,1.61-.11,11.25-16.52,29.95-27.2,51.3-27.2,16.98,0,32.25,6.77,43.49,17.79,.34,.34,1.03,.34,1.38,0Z"
77
+ />
78
+ </g>
79
+ </g>
80
+ </svg>
81
+ </div>
82
+ <div class="dl-spinner-icon">
83
+ <svg
84
+ viewBox="0 0 51 45"
85
+ fill="none"
86
+ >
87
+ <path
88
+ d="M23.2962 0.558083H0.830566V32.2536L10.1727 44.284H23.2962V38.5002H12.6195L6.39136 30.4028V6.11058H23.2962V0.558083Z"
89
+ :fill="iconColor"
90
+ />
91
+ <path
92
+ d="M27.5224 6.11058V0.558083C33.3056 -0.137737 52.8796 3.56565 50.6553 25.0816C48.9091 41.9727 34.3436 44.901 27.5224 44.284V38.5002C41.2242 39.4256 45.0945 29.1689 45.3169 23.9249C46.2067 8.19281 33.8246 5.49365 27.5224 6.11058Z"
93
+ :fill="iconColor"
94
+ />
95
+ <path
96
+ d="M23.2962 19.0664V13.5139H13.0643V27.3952L16.8457 31.7909H23.2962V26.2384H19.07L18.6251 25.5443V19.0664H23.2962Z"
97
+ :fill="iconColor"
98
+ />
99
+ <path
100
+ d="M27.5224 19.0664V13.5139C31.2296 13.2054 38.644 14.5782 38.644 22.5367C38.644 30.4953 31.2296 32.0223 27.5224 31.7909V26.2384C29.3018 26.7782 33.3056 26.9038 33.3056 22.9994C33.3056 19.0664 29.5984 18.758 27.5224 19.0664Z"
101
+ :fill="iconColor"
102
+ />
103
+ </svg>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ </template>
108
+
109
+ <script>
110
+ import { defineComponent } from 'vue-demi'
111
+
112
+ export default defineComponent({
113
+ props: {
114
+ size: {
115
+ type: String,
116
+ default: '140px'
117
+ },
118
+ iconSize: {
119
+ type: String,
120
+ default: '50px'
121
+ },
122
+ borderColor: {
123
+ type: String,
124
+ default: 'var(--dl-color-separator)'
125
+ },
126
+ color: {
127
+ type: String,
128
+ default: 'var(--dl-color-secondary)'
129
+ },
130
+ iconColor: {
131
+ type: String,
132
+ default: 'var(--dl-color-tooltip-background)'
133
+ }
134
+ },
135
+ computed: {
136
+ spinnerStyles() {
137
+ return {
138
+ '--dl-spinner-size': this.size,
139
+ '--dl-spinner-icon-size': this.iconSize,
140
+ '--dl-spinner-border-color': this.borderColor,
141
+ '--icon-top': `${
142
+ parseInt(this.size) / 2 -
143
+ parseInt(this.iconSize) / 2 +
144
+ parseInt(this.iconSize) / 25
145
+ }px`
146
+ }
147
+ }
148
+ }
149
+ })
150
+ </script>
151
+
152
+ <style lang="scss">
153
+ .spinner-wrapper {
154
+ display: flex;
155
+ justify-content: center;
156
+ align-items: center;
157
+ }
158
+ .dl-spinner {
159
+ vertical-align: middle;
160
+ }
161
+
162
+ .dl-spinner-mat {
163
+ animation: spinCircle 2s linear infinite;
164
+ transform-origin: center center;
165
+ }
166
+ .spinner-path {
167
+ stroke-dasharray: 1, 200 #{'/* rtl:ignore */'};
168
+ stroke-dashoffset: 0 #{'/* rtl:ignore */'};
169
+ animation: dash 1.5s ease-in-out infinite;
170
+ }
171
+
172
+ .spinner {
173
+ position: relative;
174
+ }
175
+
176
+ .spin-loader,
177
+ .spin-bg {
178
+ width: var(--dl-spinner-size);
179
+ height: var(--dl-spinner-size);
180
+ top: 0;
181
+ left: 0;
182
+ }
183
+
184
+ .spin-loader {
185
+ position: absolute;
186
+ animation: spin 2s linear infinite;
187
+ }
188
+
189
+ .dl-spinner-icon {
190
+ top: var(--icon-top);
191
+ left: var(--icon-top);
192
+ position: absolute;
193
+ width: var(--dl-spinner-icon-size);
194
+ height: var(--dl-spinner-icon-size);
195
+ opacity: 1;
196
+ animation: pulse 2s infinite;
197
+ }
198
+
199
+ .dl-svg {
200
+ fill: var(--dl-spinner-border-color);
201
+ }
202
+
203
+ .spinner-color-bg {
204
+ fill: none;
205
+ }
206
+
207
+ .spinner-color {
208
+ fill: url(#linear-gradient);
209
+ }
210
+
211
+ @keyframes dash {
212
+ 0% {
213
+ stroke-dasharray: 1, 200;
214
+ stroke-dashoffset: 0;
215
+ }
216
+ 50% {
217
+ stroke-dasharray: 89, 200;
218
+ stroke-dashoffset: -35px;
219
+ }
220
+ 100% {
221
+ stroke-dasharray: 89, 200;
222
+ stroke-dashoffset: -124px;
223
+ }
224
+ }
225
+
226
+ @keyframes spinCircle {
227
+ 0% {
228
+ transform: rotate3d(0, 0, 1, 0deg) #{'/* rtl:ignore */'};
229
+ }
230
+ 25% {
231
+ transform: rotate3d(0, 0, 1, 90deg) #{'/* rtl:ignore */'};
232
+ }
233
+ 50% {
234
+ transform: rotate3d(0, 0, 1, 180deg) #{'/* rtl:ignore */'};
235
+ }
236
+ 75% {
237
+ transform: rotate3d(0, 0, 1, 270deg) #{'/* rtl:ignore */'};
238
+ }
239
+ 100% {
240
+ transform: rotate3d(0, 0, 1, 359deg) #{'/* rtl:ignore */'};
241
+ }
242
+ }
243
+
244
+ @keyframes spin {
245
+ 0% {
246
+ transform: rotate(0deg);
247
+ }
248
+ 100% {
249
+ transform: rotate(360deg);
250
+ }
251
+ }
252
+
253
+ @keyframes pulse {
254
+ 0% {
255
+ opacity: 1;
256
+ }
257
+ 50% {
258
+ opacity: 0;
259
+ }
260
+ 100% {
261
+ opacity: 1;
262
+ }
263
+ }
264
+ </style>
@@ -1,2 +1,15 @@
1
+ import DlSpinnerGrid from './components/DlSpinnerGrid.vue'
2
+ import DlSpinnerCircle from './components/DlSpinnerCircle.vue'
3
+ import DlSpinnerClock from './components/DlSpinnerClock.vue'
4
+ import DlSpinnerDots from './components/DlSpinnerDots.vue'
5
+ import DlSpinnerLogo from './components/DlSpinnerLogo.vue'
1
6
  import DlSpinner from './DlSpinner.vue'
2
- export { DlSpinner }
7
+
8
+ export {
9
+ DlSpinner,
10
+ DlSpinnerLogo,
11
+ DlSpinnerCircle,
12
+ DlSpinnerGrid,
13
+ DlSpinnerDots,
14
+ DlSpinnerClock
15
+ }
@@ -0,0 +1,7 @@
1
+ export enum DlSpinnerTypes {
2
+ GRID = 'grid',
3
+ CIRCLE = 'circle',
4
+ DOTS = 'dots',
5
+ CLOCK = 'clock',
6
+ LOGO = 'logo'
7
+ }
@@ -17,3 +17,4 @@ export * from './DlTextArea'
17
17
  export * from './DlLink'
18
18
  export * from './DlColorPicker'
19
19
  export * from './DlSpinner'
20
+ export * from './DlSeparator'
@@ -1 +1,2 @@
1
1
  export * from './DlColorPicker/types'
2
+ export * from './DlSpinner/types'
@@ -10,7 +10,7 @@
10
10
 
11
11
  <script lang="ts">
12
12
  import { v4 } from 'uuid'
13
- import { defineComponent } from 'vue-demi'
13
+ import { defineComponent, ref, computed } from 'vue-demi'
14
14
  import { getColor } from '../../../utils'
15
15
 
16
16
  export default defineComponent({
@@ -23,24 +23,29 @@ export default defineComponent({
23
23
  side: Boolean,
24
24
  noWrap: Boolean
25
25
  },
26
- data() {
27
- return {
28
- uuid: `dl-item-section-${v4()}`
29
- }
30
- },
31
- computed: {
32
- classes(): Record<string, boolean> {
26
+ setup(props) {
27
+ const uuid = `dl-item-section-${v4()}`
28
+
29
+ const classes = computed(() => {
33
30
  return {
34
31
  'dl-item__section': true,
35
- 'dl-item__section--side': this.side,
36
- 'dl-item__section--nowrap': this.noWrap,
37
- 'dl-item__section--main': !this.side
32
+ 'dl-item__section--side': props.side,
33
+ 'dl-item__section--nowrap': props.noWrap,
34
+ 'dl-item__section--main': !props.side
38
35
  }
39
- },
40
- cssVars(): Record<string, string> {
36
+ })
37
+ const cssVars = computed(() => {
41
38
  return {
42
- '--dl-item-color': this.color ? getColor(this.color) : 'inherit'
39
+ '--dl-item-color': props.color
40
+ ? getColor(props.color)
41
+ : 'inherit'
43
42
  }
43
+ })
44
+
45
+ return {
46
+ uuid,
47
+ classes,
48
+ cssVars
44
49
  }
45
50
  }
46
51
  })
@@ -56,8 +61,9 @@ export default defineComponent({
56
61
  justify-content: flex-start;
57
62
  &--nowrap {
58
63
  white-space: nowrap;
64
+ width: 100%;
59
65
  overflow: hidden;
60
- text-overflow: ellipsis;
66
+ text-overflow-middle: ellipsis;
61
67
  & > * {
62
68
  overflow: hidden;
63
69
  text-overflow: ellipsis;
@@ -3,10 +3,14 @@
3
3
  <div
4
4
  :id="uuid"
5
5
  ref="rootRef"
6
+ :style="cssVars"
6
7
  class="dl-table__middle"
7
8
  :class="classes"
8
9
  >
9
- <table class="dl-table">
10
+ <table
11
+ class="dl-table"
12
+ :class="draggableClasses"
13
+ >
10
14
  <slot
11
15
  v-if="hasBeforeSlot"
12
16
  name="before"
@@ -18,16 +22,13 @@
18
22
  >
19
23
  <tr>
20
24
  <td
21
- :style="{
22
- height: virtualScrollPaddingBefore + 'px',
23
- '--dl-virtual-scroll-item-height':
24
- virtualScrollItemSize + 'px'
25
- }"
25
+ class="dl-virtual-scroll__before"
26
26
  :colspan="colspanAttr"
27
27
  />
28
28
  </tr>
29
29
  </tbody>
30
30
  <tbody
31
+ id="draggable"
31
32
  key="content"
32
33
  ref="contentRef"
33
34
  class="dl-virtual-scroll__content"
@@ -45,11 +46,7 @@
45
46
  >
46
47
  <tr>
47
48
  <td
48
- :style="{
49
- height: virtualScrollPaddingAfter + 'px',
50
- '--dl-virtual-scroll-item-height':
51
- virtualScrollItemSize + 'px'
52
- }"
49
+ class="dl-virtual-scroll__after"
53
50
  :colspan="colspanAttr"
54
51
  />
55
52
  </tr>
@@ -81,6 +78,7 @@ import { getScrollTarget } from '../../../utils/scroll'
81
78
  import { useVirtualScroll, useVirtualScrollProps } from './useVirtualScroll'
82
79
 
83
80
  export default defineComponent({
81
+ name: 'DlVirtualScroll',
84
82
  props: {
85
83
  ...useVirtualScrollProps,
86
84
 
@@ -89,6 +87,11 @@ export default defineComponent({
89
87
  default: () => [] as Record<string, any>[]
90
88
  },
91
89
 
90
+ draggableClasses: {
91
+ type: [String, Array, Object],
92
+ default: null
93
+ },
94
+
92
95
  itemsFn: { type: Function, default: void 0 },
93
96
  itemsSize: { type: Number, default: 0 },
94
97
 
@@ -98,6 +101,7 @@ export default defineComponent({
98
101
  },
99
102
  setup(props, { slots, attrs }) {
100
103
  const vm = getCurrentInstance()
104
+
101
105
  let localScrollTarget: HTMLElement | undefined
102
106
  const rootRef: Ref<HTMLElement | null> = ref(null)
103
107
 
@@ -157,6 +161,15 @@ export default defineComponent({
157
161
  (props.scrollTarget !== void 0 ? '' : ' scroll')
158
162
  )
159
163
 
164
+ const cssVars = computed(() => {
165
+ return {
166
+ '--item-height-before': virtualScrollPaddingBefore.value + 'px',
167
+ '--item-height-after': virtualScrollPaddingAfter.value + 'px',
168
+ '--dl-virtual-scroll-item-height':
169
+ props.virtualScrollItemSize + 'px'
170
+ }
171
+ })
172
+
160
173
  const attributes = computed(() =>
161
174
  props.scrollTarget !== void 0 ? {} : { tabindex: 0 }
162
175
  )
@@ -243,7 +256,8 @@ export default defineComponent({
243
256
  classes,
244
257
  hasBeforeSlot,
245
258
  hasAfterSlot,
246
- colspanAttr
259
+ colspanAttr,
260
+ cssVars
247
261
  }
248
262
  }
249
263
  })
@@ -265,17 +279,18 @@ export default defineComponent({
265
279
  overflow-anchor: auto;
266
280
  }
267
281
  }
282
+ &__before {
283
+ height: var(--item-height-before);
284
+ }
285
+
286
+ &__after {
287
+ height: var(--item-height-after);
288
+ }
268
289
  &__padding {
269
- background: linear-gradient(
270
- rgba(255, 255, 255, 0),
271
- rgba(255, 255, 255, 0) 20%,
272
- rgba(128, 128, 128, 0.03) 20%,
273
- rgba(128, 128, 128, 0.08) 50%,
274
- rgba(128, 128, 128, 0.03) 80%,
275
- rgba(255, 255, 255, 0) 80%,
276
- rgba(255, 255, 255, 0)
290
+ background: repeating-linear-gradient(
291
+ rgba(128, 128, 128, 0.03),
292
+ rgba(128, 128, 128, 0.08) var(--dl-virtual-scroll-item-height, 50px)
277
293
  );
278
- background-size: 100%, var(--dl-virtual-scroll-item-height, 50px);
279
294
 
280
295
  .dl-table & {
281
296
  tr {
@@ -203,7 +203,7 @@ export const commonVirtScrollProps = {
203
203
 
204
204
  virtualScrollItemSize: {
205
205
  type: [Number, String],
206
- default: 24
206
+ default: 0
207
207
  },
208
208
 
209
209
  virtualScrollStickySizeStart: {
@@ -756,15 +756,13 @@ export function useVirtualScroll({
756
756
 
757
757
  function emitScroll(index: number) {
758
758
  if (prevToIndex !== index) {
759
- if (props.onVirtualScroll !== void 0) {
760
- emit('virtual-scroll', {
761
- index,
762
- from: virtualScrollSliceRange.value.from,
763
- to: virtualScrollSliceRange.value.to - 1,
764
- direction: index < prevToIndex ? 'decrease' : 'increase',
765
- ref: proxy
766
- })
767
- }
759
+ emit('virtual-scroll', {
760
+ index,
761
+ from: virtualScrollSliceRange.value.from,
762
+ to: virtualScrollSliceRange.value.to - 1,
763
+ direction: index < prevToIndex ? 'decrease' : 'increase',
764
+ ref: proxy
765
+ })
768
766
 
769
767
  prevToIndex = index
770
768
  }
@@ -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">