@dataloop-ai/components 0.18.0 → 0.18.2

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 (277) hide show
  1. package/package.json +6 -3
  2. package/src/App.vue +5 -227
  3. package/src/assets/constants.scss +2 -1
  4. package/src/assets/globals.scss +21 -0
  5. package/src/components/basic/DlAccordion/DlAccordion.vue +26 -4
  6. package/src/components/basic/DlAccordion/components/AccordionHeader.vue +2 -1
  7. package/src/components/basic/DlAvatar/DlAvatar.vue +1 -1
  8. package/src/components/basic/DlButton/DlButton.vue +115 -25
  9. package/src/components/basic/DlButton/utils.ts +45 -2
  10. package/src/components/basic/DlChip/DlChip.vue +3 -7
  11. package/src/components/basic/DlChip/utils.ts +4 -4
  12. package/src/components/basic/DlContainer/DlContainer.vue +70 -0
  13. package/src/components/basic/DlContainer/index.ts +3 -0
  14. package/src/components/basic/DlEmptyState/DlEmptyState.vue +282 -0
  15. package/src/components/basic/DlEmptyState/index.ts +2 -0
  16. package/src/components/basic/DlEmptyState/types.ts +20 -0
  17. package/src/components/basic/DlGrid/DlGrid.vue +163 -0
  18. package/src/components/basic/DlGrid/index.ts +4 -0
  19. package/src/components/basic/DlGrid/types.ts +5 -0
  20. package/src/components/basic/DlKpi/components/KpiInfo.vue +2 -1
  21. package/src/components/basic/DlListItem/DlListItem.vue +96 -66
  22. package/src/components/basic/DlListItem/utils.ts +0 -3
  23. package/src/components/basic/DlPanelContainer/DlPanelContainer.vue +37 -13
  24. package/src/components/basic/DlPopup/DlPopup.vue +58 -11
  25. package/src/components/basic/DlPopup/components/PopupHeader.vue +11 -6
  26. package/src/components/basic/DlProgressChart/DlProgressChart.vue +2 -1
  27. package/src/components/basic/DlWidget/DlWidget.vue +273 -141
  28. package/src/components/basic/DlWidget/index.ts +1 -3
  29. package/src/components/basic/DlWidget/utils.ts +90 -8
  30. package/src/components/basic/index.ts +4 -2
  31. package/src/components/basic/types.ts +2 -0
  32. package/src/components/compound/DlCard/DlCard.vue +796 -0
  33. package/src/components/compound/DlCard/components/DescriptionModal.vue +137 -0
  34. package/src/components/compound/DlCard/types.ts +38 -0
  35. package/src/components/compound/DlCharts/charts/DlBarChart/DlBarChart.vue +39 -4
  36. package/src/components/compound/DlCharts/charts/DlColumnChart/DlColumnChart.vue +128 -36
  37. package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +167 -87
  38. package/src/components/compound/DlCharts/charts/DlConfusionMatrix/utils.ts +2 -1
  39. package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChart.vue +44 -3
  40. package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChartWidget.vue +1 -2
  41. package/src/components/compound/DlCharts/charts/DlDoughnutChart/components/DlDoughnutChartLegend.vue +9 -18
  42. package/src/components/compound/DlCharts/charts/DlLineChart/DlLineChart.vue +48 -9
  43. package/src/components/compound/DlCharts/charts/DlScatterChart/DlScatterChart.vue +667 -0
  44. package/src/components/compound/DlCharts/charts/DlScatterChart/index.ts +2 -0
  45. package/src/components/compound/DlCharts/charts/index.ts +1 -0
  46. package/src/components/compound/DlCharts/components/DlBrush.vue +3 -2
  47. package/src/components/compound/DlCharts/components/DlChartLabels.vue +2 -1
  48. package/src/components/compound/DlCharts/components/DlChartScrollBar.vue +1 -0
  49. package/src/components/compound/DlCharts/types/props.ts +5 -1
  50. package/src/components/compound/DlCharts/utils.ts +1 -1
  51. package/src/components/compound/DlCodeEditor/DlCodeEditor.vue +173 -0
  52. package/src/components/compound/DlCodeEditor/README.md +11 -0
  53. package/src/components/compound/DlCodeEditor/components/CodeEditor.vue +705 -0
  54. package/src/components/compound/DlCodeEditor/index.ts +3 -0
  55. package/src/components/compound/DlCodeEditor/styles/themes-base16.css +12809 -0
  56. package/src/components/compound/DlCodeEditor/styles/themes.css +3999 -0
  57. package/src/components/compound/DlCodeEditor/types.ts +21 -0
  58. package/src/components/compound/DlDateTime/DlDatePicker/DlDatePicker.vue +9 -1
  59. package/src/components/compound/DlDateTime/DlDatePicker/components/DlCalendar.vue +4 -2
  60. package/src/components/compound/DlDateTime/DlDatePicker/components/DlMonthCalendar.vue +2 -1
  61. package/src/components/compound/DlDateTime/DlDateTimeRange/{DlCardSidebar.vue → CardSidebar.vue} +10 -11
  62. package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +18 -9
  63. package/src/components/compound/DlDateTime/DlTimePicker/DlTimePicker.vue +2 -2
  64. package/src/components/compound/DlDialogBox/DlDialogBox.vue +74 -15
  65. package/src/components/compound/DlDialogBox/components/DlDialogBoxFooter.vue +1 -1
  66. package/src/components/compound/DlDialogBox/components/DlDialogBoxHeader.vue +9 -7
  67. package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +13 -4
  68. package/src/components/compound/DlInput/DlInput.vue +80 -17
  69. package/src/components/compound/DlJsonEditor/DlJsonEditor.vue +42 -219
  70. package/src/components/compound/DlOptionGroup/DlOptionGroup.vue +16 -17
  71. package/src/components/compound/DlOptionGroup/components/MenuItemWrapper.vue +2 -2
  72. package/src/components/compound/DlPagination/DlPagination.vue +1 -1
  73. package/src/components/compound/DlPagination/components/PaginationLegend.vue +0 -2
  74. package/src/components/compound/DlPagination/components/RowsSelector.vue +0 -2
  75. package/src/components/compound/DlRange/DlRange.vue +3 -2
  76. package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +12 -5
  77. package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +413 -97
  78. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchFilters.vue +4 -1
  79. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +100 -39
  80. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSuggestionsDropdown.vue +12 -7
  81. package/src/components/compound/DlSearches/DlSmartSearch/components/FiltersQuery.vue +5 -6
  82. package/src/components/compound/DlSearches/DlSmartSearch/types.ts +14 -0
  83. package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +10 -6
  84. package/src/components/compound/DlSearches/DlSmartSearch/utils/index.ts +172 -48
  85. package/src/components/compound/DlSelect/DlSelect.vue +264 -130
  86. package/src/components/compound/DlSelect/utils.ts +4 -1
  87. package/src/components/compound/DlSlider/DlSlider.vue +10 -2
  88. package/src/components/compound/DlSlider/components/DlSliderBase.vue +3 -3
  89. package/src/components/compound/DlSlider/components/DlSliderInput.vue +17 -26
  90. package/src/components/compound/DlSlider/sliderStyles.scss +5 -1
  91. package/src/components/compound/DlSlider/useSlider.ts +2 -2
  92. package/src/components/compound/DlSlider/utils.ts +2 -2
  93. package/src/components/compound/DlStepper/DlStepper.vue +46 -4
  94. package/src/components/compound/DlStepper/components/DlStepperContent.vue +6 -2
  95. package/src/components/compound/DlStepper/components/DlStepperFooter.vue +12 -0
  96. package/src/components/compound/DlStepper/components/DlStepperSidebar.vue +24 -11
  97. package/src/components/compound/DlStepper/models/Step.ts +37 -8
  98. package/src/components/compound/DlStepper/models/Stepper.ts +108 -15
  99. package/src/components/compound/DlStepper/models/interfaces.ts +2 -1
  100. package/src/components/compound/DlTable/DlTable.vue +49 -14
  101. package/src/components/compound/DlTable/components/DlTd.vue +9 -9
  102. package/src/components/compound/DlTable/components/DlTh.vue +3 -2
  103. package/src/components/compound/DlTable/hooks/tableColumnSelection.ts +35 -40
  104. package/src/components/compound/DlTable/hooks/tableFilter.ts +33 -21
  105. package/src/components/compound/DlTable/hooks/tablePagination.ts +18 -18
  106. package/src/components/compound/DlTable/hooks/tableRowExpand.ts +2 -1
  107. package/src/components/compound/DlTable/hooks/tableRowSelection.ts +0 -1
  108. package/src/components/compound/DlTable/hooks/tableSort.ts +52 -47
  109. package/src/components/compound/DlTable/styles/dl-table-styles.scss +8 -0
  110. package/src/components/compound/DlTabs/DlTabs.vue +83 -31
  111. package/src/components/compound/DlTabs/components/DlTab.vue +14 -4
  112. package/src/components/compound/DlTabs/components/TabsWrapper.vue +32 -27
  113. package/src/components/compound/DlThumbnailGallery/DlThumbnailGallery.vue +268 -0
  114. package/src/components/compound/DlThumbnailGallery/index.ts +2 -0
  115. package/src/components/compound/DlThumbnailGallery/types.ts +11 -0
  116. package/src/components/compound/DlToast/api/useToast.ts +42 -1
  117. package/src/components/compound/DlToast/components/ToastComponent.vue +24 -32
  118. package/src/components/compound/DlToast/types.ts +52 -0
  119. package/src/components/compound/DlTreeTable/DlTreeTable.vue +1293 -0
  120. package/src/components/compound/DlTreeTable/components/DlTdTree.vue +119 -0
  121. package/src/components/compound/DlTreeTable/components/DlTrTree.vue +52 -0
  122. package/src/components/compound/DlTreeTable/index.ts +3 -0
  123. package/src/components/compound/DlTreeTable/types.ts +1 -0
  124. package/src/components/compound/DlTreeTable/utils/convertToNestedObject.ts +51 -0
  125. package/src/components/compound/DlTreeTable/utils/flatTreeData.ts +19 -0
  126. package/src/components/compound/DlTreeTable/utils/getFromChildren.ts +39 -0
  127. package/src/components/compound/DlTreeTable/utils/trSpacing.ts +13 -0
  128. package/src/components/compound/DlTreeTable/utils/treeTableRowSelection.ts +184 -0
  129. package/src/components/compound/index.ts +14 -1
  130. package/src/components/compound/types.ts +2 -0
  131. package/src/components/essential/DlBadge/DlBadge.vue +3 -3
  132. package/src/components/essential/DlCheckbox/DlCheckbox.vue +10 -7
  133. package/src/components/essential/DlEllipsis/DlEllipsis.vue +141 -0
  134. package/src/components/essential/DlIcon/DlIcon.vue +5 -5
  135. package/src/components/essential/DlLabel/DlLabel.vue +190 -0
  136. package/src/components/essential/DlLabel/index.ts +2 -0
  137. package/src/components/essential/DlList/DlList.vue +3 -3
  138. package/src/components/essential/DlMenu/DlMenu.vue +41 -22
  139. package/src/components/essential/DlMenu/utils.ts +8 -7
  140. package/src/components/essential/DlPageLayout/DlPageLayout.vue +90 -0
  141. package/src/components/essential/DlPageLayout/index.ts +2 -0
  142. package/src/components/essential/DlProgressBar/DlProgressBar.vue +1 -1
  143. package/src/components/essential/DlRadio/DlRadio.vue +10 -5
  144. package/src/components/essential/DlSeparator/DlSeparator.vue +2 -2
  145. package/src/components/essential/DlSpinner/index.ts +1 -13
  146. package/src/components/essential/DlSpinner/styles/spinnerStyles.scss +7 -0
  147. package/src/components/essential/DlSwitch/DlSwitch.vue +6 -3
  148. package/src/components/essential/DlTextArea/DlTextArea.vue +212 -7
  149. package/src/components/essential/DlThemeProvider/DlThemeProvider.vue +6 -0
  150. package/src/components/essential/DlTypography/DlTypography.vue +7 -1
  151. package/src/components/essential/index.ts +3 -2
  152. package/src/components/shared/DlInfoErrorMessage/DlInfoErrorMessage.vue +1 -1
  153. package/src/components/{essential → shared}/DlTooltip/DlTooltip.vue +26 -19
  154. package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +106 -43
  155. package/src/components/shared/DlVirtualScroll/useVirtualScroll.ts +28 -4
  156. package/src/components/shared/index.ts +1 -0
  157. package/src/components/types.ts +2 -0
  158. package/src/demos/BarChartDemo.vue +59 -2
  159. package/src/demos/ColumnChartDemo.vue +67 -2
  160. package/src/demos/DlAccordionDemo.vue +92 -43
  161. package/src/demos/DlAlertDemo.vue +14 -0
  162. package/src/demos/DlButtonDemo.vue +41 -4
  163. package/src/demos/DlCardDemo.vue +156 -19
  164. package/src/demos/DlChartDoughnutDemo.vue +49 -2
  165. package/src/demos/DlCheckboxDemo.vue +28 -3
  166. package/src/demos/DlCodeEditor/DlCodeEditorDemo.vue +247 -0
  167. package/src/demos/DlCodeEditor/index.ts +2 -0
  168. package/src/demos/DlConfusionMatrixDemo.vue +93 -37
  169. package/src/demos/DlDemoPage.vue +235 -0
  170. package/src/demos/DlDialogBoxDemo.vue +56 -51
  171. package/src/demos/DlDropdownButtonDemo.vue +35 -27
  172. package/src/demos/DlEmptyStateDemo.vue +81 -0
  173. package/src/demos/DlGridDemo.vue +40 -0
  174. package/src/demos/DlInputDemo.vue +21 -1
  175. package/src/demos/DlJsonEditorDemo.vue +59 -0
  176. package/src/demos/DlLabelDemo.vue +208 -0
  177. package/src/demos/DlLineChartDemo.vue +50 -2
  178. package/src/demos/DlListDemo.vue +12 -9
  179. package/src/demos/DlMenuDemo.vue +147 -20
  180. package/src/demos/DlPageLayoutDemo.vue +146 -0
  181. package/src/demos/DlPanelContainerDemo.vue +113 -2
  182. package/src/demos/DlPopupDemo.vue +82 -1
  183. package/src/demos/DlRadioDemo.vue +16 -1
  184. package/src/demos/DlScatterChartDemo.vue +161 -0
  185. package/src/demos/DlSearchDemo.vue +9 -0
  186. package/src/demos/DlSelectDemo.vue +124 -27
  187. package/src/demos/DlSpinnerDemo.vue +0 -2
  188. package/src/demos/DlStepperDemo/DlStepperDemo.vue +5 -1
  189. package/src/demos/DlStepperDemo/EmptyStateStepper.vue +149 -0
  190. package/src/demos/DlStepperDemo/SimpleStepper.vue +4 -0
  191. package/src/demos/DlStepperDemo/steps/GeneralStep.vue +1 -0
  192. package/src/demos/DlSwitchDemo.vue +12 -0
  193. package/src/demos/DlTableDemo.vue +84 -5
  194. package/src/demos/DlTabsDemo.vue +92 -3
  195. package/src/demos/DlTextAreaDemo.vue +14 -17
  196. package/src/demos/DlThumbnailGalleryDemo.vue +99 -0
  197. package/src/demos/DlToastDemo.vue +3 -9
  198. package/src/demos/DlTooltipDemo.vue +66 -2
  199. package/src/demos/DlTreeTableDemo.vue +694 -0
  200. package/src/demos/DlVirtualScrollDemo.vue +3 -12
  201. package/src/demos/DlWidgetDemo.vue +252 -61
  202. package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +151 -32
  203. package/src/demos/index.ts +23 -4
  204. package/src/hooks/use-anchor.ts +15 -17
  205. package/src/hooks/use-arrow-navigation.ts +64 -21
  206. package/src/hooks/use-model-toggle.ts +14 -16
  207. package/src/hooks/use-portal.ts +9 -3
  208. package/src/hooks/use-scroll-target.ts +2 -4
  209. package/src/hooks/use-size-observer.ts +3 -2
  210. package/src/hooks/use-suggestions.ts +239 -49
  211. package/src/hooks/use-transition.ts +10 -4
  212. package/src/index.ts +22 -1
  213. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetFooter.vue +78 -0
  214. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetHeader.vue +22 -0
  215. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetLeftDrawer.vue +96 -0
  216. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetMainContent.vue +51 -0
  217. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetRightDrawer.vue +88 -0
  218. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/ActionsMenu.vue +70 -0
  219. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/AutomationMenu.vue +106 -0
  220. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardView.vue +101 -0
  221. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardViewGallery.vue +141 -0
  222. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardViewTable.vue +193 -0
  223. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/EmptyState/LayoutEmptyState.vue +227 -0
  224. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/EmptyState/UploadData.vue +106 -0
  225. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/MainContentImages.vue +540 -0
  226. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/MainContentNav.vue +329 -0
  227. package/src/layouts/DlDatasetBrowser/DemoComponents/NavbarKpi.vue +84 -0
  228. package/src/layouts/DlDatasetBrowser/DemoComponents/NavbarSearch.vue +132 -0
  229. package/src/layouts/DlDatasetBrowser/DemoComponents/SearchFilterMenu.vue +19 -0
  230. package/src/layouts/DlDatasetBrowser/DemoComponents/filters/AddFilter.vue +212 -0
  231. package/src/layouts/DlDatasetBrowser/DemoComponents/types/imageMetadata.ts +28 -0
  232. package/src/layouts/DlDatasetBrowser/DlDatasetBrowser.vue +42 -0
  233. package/src/layouts/DlStudioLayout/DlStudioLayout.vue +42 -0
  234. package/src/layouts/DlStudioLayout/components/Demo/LeftMenuContent.vue +23 -0
  235. package/src/layouts/DlStudioLayout/components/Demo/StudioFooter.vue +25 -0
  236. package/src/layouts/DlStudioLayout/components/Demo/StudioHeader.vue +121 -0
  237. package/src/layouts/DlStudioLayout/components/Demo/StudioLeftDrawer.vue +245 -0
  238. package/src/layouts/DlStudioLayout/components/Demo/StudioMainContent.vue +31 -0
  239. package/src/layouts/DlStudioLayout/components/Demo/StudioTabsMenu.vue +117 -0
  240. package/src/layouts/DlStudioLayout/components/Demo/TabMenu/FilterMenu.vue +62 -0
  241. package/src/layouts/DlStudioLayout/components/Demo/TabMenu/TabMenuAnnotations.vue +98 -0
  242. package/src/layouts/DlStudioLayout/components/Demo/TabMenu/TabMenuItem.vue +66 -0
  243. package/src/layouts/DlStudioLayout/components/LayoutNavbar.vue +24 -0
  244. package/src/layouts/DlStudioLayout/components/ListAutocomplete.vue +149 -0
  245. package/src/layouts/DlStudioLayout/components/NavigationDrawer.vue +147 -0
  246. package/src/layouts/DlStudioLayout/index.ts +2 -0
  247. package/src/layouts/DlStudioLayout/types/HorizontalItems.ts +9 -0
  248. package/src/layouts/DlStudioLayout/types/VerticalItems.ts +10 -0
  249. package/src/simple-code-editor.d.ts +1 -0
  250. package/src/utils/click-outside.ts +1 -1
  251. package/src/utils/dom.ts +5 -5
  252. package/src/utils/events.ts +3 -3
  253. package/src/utils/global-nodes.ts +2 -2
  254. package/src/utils/input-sizes.ts +5 -2
  255. package/src/utils/is-ellipsis-active.ts +4 -1
  256. package/src/utils/parse-smart-query.ts +209 -111
  257. package/src/utils/portal.ts +5 -5
  258. package/src/utils/position-engine.ts +7 -7
  259. package/src/utils/render.ts +1 -1
  260. package/src/utils/scroll.ts +2 -2
  261. package/src/utils/selection.ts +3 -3
  262. package/vite.config.ts +9 -1
  263. package/src/components/basic/DlCard/DlCard.vue +0 -241
  264. package/src/components/basic/DlCard/types.ts +0 -20
  265. package/src/components/basic/DlEllipsis/DlEllipsis.vue +0 -114
  266. package/src/components/basic/DlWidget/DlGrid.vue +0 -33
  267. package/src/components/basic/DlWidget/DlGridRow.vue +0 -32
  268. package/src/components/compound/DlSearches/DlSmartSearch/utils/utils.ts +0 -124
  269. package/src/components/compound/DlToast/utils/config.ts +0 -17
  270. package/src/components/essential/DlTextHolder/DlTextHolder.vue +0 -65
  271. package/src/components/essential/DlTextHolder/index.ts +0 -2
  272. package/src/demos/DlTextHolderDemo.vue +0 -42
  273. package/src/utils/swapNodes.ts +0 -30
  274. /package/src/components/{basic → compound}/DlCard/index.ts +0 -0
  275. /package/src/components/compound/DlDateTime/DlDateTimeRange/{DlDateInput.vue → DateInput.vue} +0 -0
  276. /package/src/components/{basic → essential}/DlEllipsis/index.ts +0 -0
  277. /package/src/components/{essential → shared}/DlTooltip/index.ts +0 -0
@@ -11,7 +11,8 @@ import {
11
11
  ref,
12
12
  watch,
13
13
  isVue2,
14
- h
14
+ h,
15
+ onUnmounted
15
16
  } from 'vue-demi'
16
17
  import getTableMiddle from '../../compound/DlTable/utils/getTableMiddle'
17
18
  import { listenOpts, mergeSlot } from '../../../utils'
@@ -43,31 +44,40 @@ export default defineComponent({
43
44
 
44
45
  virtualScrollSliceRatioBefore: {
45
46
  type: [Number, String],
47
+ required: false,
46
48
  default: 1
47
49
  },
48
50
 
49
51
  virtualScrollSliceRatioAfter: {
50
52
  type: [Number, String],
53
+ required: false,
51
54
  default: 1
52
55
  },
53
56
 
54
57
  virtualScrollItemSize: {
55
- type: [Number, String],
58
+ type: Number,
59
+ required: false,
56
60
  default: 0
57
61
  },
58
62
 
59
63
  virtualScrollStickySizeStart: {
60
64
  type: [Number, String],
65
+ required: false,
61
66
  default: 0
62
67
  },
63
68
 
64
69
  virtualScrollStickySizeEnd: {
65
70
  type: [Number, String],
71
+ required: false,
66
72
  default: 0
67
73
  },
68
- tableColspan: [Number, String],
69
- virtualScrollHorizontal: Boolean,
70
- onVirtualScroll: Function,
74
+ tableColspan: { type: [Number, String], required: false, default: 100 },
75
+ virtualScrollHorizontal: {
76
+ type: Boolean,
77
+ required: false,
78
+ default: false
79
+ },
80
+ onVirtualScroll: { type: Function, default: null },
71
81
  items: {
72
82
  type: Array,
73
83
  default: () => [] as Record<string, any>[]
@@ -80,26 +90,56 @@ export default defineComponent({
80
90
  typeOptions.includes(v)
81
91
  },
82
92
 
83
- itemsFn: { type: Function, default: void 0 },
93
+ itemsFn: { type: Function, default: null },
84
94
  itemsSize: { type: Number, default: 0 },
85
95
 
86
96
  scrollTarget: {
87
- default: void 0
97
+ type: [String, Object],
98
+ default: null
99
+ },
100
+ scrollDebounce: {
101
+ type: Number,
102
+ default: 100
88
103
  }
89
104
  },
90
105
  emits: ['virtual-scroll'],
91
106
  setup(props, { slots, attrs }) {
92
107
  let localScrollTarget: HTMLElement | undefined
93
108
  const rootRef: Ref<HTMLElement | null> = ref(null)
109
+ const scrollSizeItem: Ref<number> = ref(40)
110
+
111
+ const isDefined = (v: any) => v !== undefined && v !== null
94
112
 
95
113
  const virtualScrollLength = computed(() => {
96
- return props.itemsSize >= 0 && props.itemsFn !== void 0
114
+ return props.itemsSize >= 0 && isDefined(props.itemsFn)
97
115
  ? parseInt(props.itemsSize as unknown as string, 10)
98
116
  : Array.isArray(props.items)
99
117
  ? props.items.length
100
118
  : 0
101
119
  })
102
120
 
121
+ const setItemSize = () => {
122
+ scrollSizeItem.value = props.virtualScrollItemSize
123
+ ? props.virtualScrollItemSize
124
+ : typeof rootRef.value?.getElementsByClassName === 'function'
125
+ ? rootRef.value?.getElementsByClassName(
126
+ 'dl-virtual-scroll__content'
127
+ )[0]?.children[0]?.clientHeight ?? 40
128
+ : 40
129
+ }
130
+
131
+ watch(
132
+ props,
133
+ () => {
134
+ setItemSize()
135
+ },
136
+ { deep: true }
137
+ )
138
+
139
+ const virtualScrollItemSizeComputed = computed(() => {
140
+ return scrollSizeItem.value
141
+ })
142
+
103
143
  const {
104
144
  virtualScrollSliceRange,
105
145
  localResetVirtualScroll,
@@ -108,7 +148,9 @@ export default defineComponent({
108
148
  } = useVirtualScroll({
109
149
  virtualScrollLength,
110
150
  getVirtualScrollTarget,
111
- getVirtualScrollEl
151
+ getVirtualScrollEl,
152
+ virtualScrollItemSizeComputed,
153
+ debounceValue: props.scrollDebounce
112
154
  })
113
155
 
114
156
  const virtualScrollScope = computed(() => {
@@ -121,20 +163,21 @@ export default defineComponent({
121
163
  item
122
164
  })
123
165
 
124
- return props.itemsFn === void 0
125
- ? props.items
166
+ const itemsFn = props.itemsFn as Function
167
+ const items = props.items as Record<string, any>[]
168
+
169
+ return isDefined(itemsFn)
170
+ ? itemsFn(
171
+ virtualScrollSliceRange.value.from,
172
+ virtualScrollSliceRange.value.to -
173
+ virtualScrollSliceRange.value.from
174
+ ).map(mapFn)
175
+ : items
126
176
  .slice(
127
177
  virtualScrollSliceRange.value.from,
128
178
  virtualScrollSliceRange.value.to
129
179
  )
130
180
  .map(mapFn)
131
- : props
132
- .itemsFn(
133
- virtualScrollSliceRange.value.from,
134
- virtualScrollSliceRange.value.to -
135
- virtualScrollSliceRange.value.from
136
- )
137
- .map(mapFn)
138
181
  })
139
182
 
140
183
  const classes = computed(
@@ -143,11 +186,11 @@ export default defineComponent({
143
186
  (props.virtualScrollHorizontal === true
144
187
  ? '--horizontal'
145
188
  : '--vertical') +
146
- (props.scrollTarget !== void 0 ? '' : ' scroll')
189
+ (isDefined(props.scrollTarget) ? '' : ' scroll')
147
190
  )
148
191
 
149
192
  const attributes = computed(() =>
150
- props.scrollTarget !== void 0 ? {} : { tabindex: 0 }
193
+ isDefined(props.scrollTarget) ? {} : { tabindex: 0 }
151
194
  )
152
195
 
153
196
  watch(virtualScrollLength, () => {
@@ -173,7 +216,7 @@ export default defineComponent({
173
216
  function configureScrollTarget() {
174
217
  localScrollTarget = getScrollTarget(
175
218
  getVirtualScrollEl(),
176
- props.scrollTarget
219
+ props.scrollTarget as any
177
220
  )
178
221
 
179
222
  localScrollTarget!.addEventListener(
@@ -184,13 +227,13 @@ export default defineComponent({
184
227
  }
185
228
 
186
229
  function unconfigureScrollTarget() {
187
- if (localScrollTarget !== void 0) {
230
+ if (isDefined(localScrollTarget)) {
188
231
  localScrollTarget.removeEventListener(
189
232
  'scroll',
190
233
  onVirtualScrollEvt,
191
234
  listenOpts.passive
192
235
  )
193
- localScrollTarget = void 0
236
+ localScrollTarget = null
194
237
  }
195
238
  }
196
239
 
@@ -203,7 +246,7 @@ export default defineComponent({
203
246
  create
204
247
  )
205
248
 
206
- if (slots.before !== void 0) {
249
+ if (isDefined(slots.before)) {
207
250
  child = slots.before().concat(child)
208
251
  }
209
252
 
@@ -216,8 +259,11 @@ export default defineComponent({
216
259
 
217
260
  onMounted(() => {
218
261
  configureScrollTarget()
262
+ window.addEventListener('load', setItemSize)
219
263
  })
220
264
 
265
+ onUnmounted(() => window.removeEventListener('load', () => {}))
266
+
221
267
  onActivated(() => {
222
268
  configureScrollTarget()
223
269
  })
@@ -245,6 +291,12 @@ export default defineComponent({
245
291
  }
246
292
  },
247
293
  render(createElement: Function) {
294
+ /**
295
+ * Had to do some general Typescript hackery here to get this to work in webpack based builder project.
296
+ * The original code is written in Vue 2, but this project is using Vue 3.
297
+ * Some of the types are not compatible, so I had to cast some of the types to any.
298
+ */
299
+
248
300
  const renderFn = isVue2 ? createElement : h
249
301
  const renderSlot = (fn: Function) => (isVue2 ? fn() : () => fn())
250
302
 
@@ -255,25 +307,36 @@ export default defineComponent({
255
307
  return
256
308
  }
257
309
 
258
- return this.$props.type === '__dltable'
259
- ? getTableMiddle(
260
- {
261
- ref: 'rootRef',
262
- class: 'dl-table__middle ' + this.classes
263
- },
264
- this.getVirtualChildren(renderFn),
265
- renderFn
266
- )
267
- : renderFn(
268
- this.tag,
269
- {
270
- ...this.attrs,
271
- ref: 'rootRef',
272
- class: [this.attrs.class, this.classes],
273
- ...this.attributes
274
- },
275
- renderSlot(() => this.getVirtualChildren(renderFn))
276
- )
310
+ const isDlTable = (this.$props as any).type === '__dltable'
311
+ const getVirtualChildren = (this as any).getVirtualChildren as Function
312
+
313
+ if (isDlTable) {
314
+ return getTableMiddle(
315
+ {
316
+ ref: 'rootRef',
317
+ class: 'dl-table__middle ' + this.classes
318
+ },
319
+ getVirtualChildren(renderFn),
320
+ renderFn
321
+ )
322
+ }
323
+
324
+ const attrs = this.attrs as Record<string, any>
325
+ const attributes = this.attributes as Record<string, any>
326
+ const classes = this.classes as string // todo: does this have to be casted to an object?
327
+ const attributeClasses = attrs.class as Record<string, any>
328
+ const tag = this.tag as string
329
+
330
+ return renderFn(
331
+ tag,
332
+ {
333
+ ...attrs,
334
+ ref: 'rootRef',
335
+ class: [attributeClasses, classes],
336
+ ...attributes
337
+ },
338
+ renderSlot(() => getVirtualChildren(renderFn))
339
+ )
277
340
  }
278
341
  })
279
342
  </script>
@@ -279,17 +279,34 @@ export function useVirtualScroll({
279
279
  virtualScrollLength,
280
280
  getVirtualScrollTarget,
281
281
  getVirtualScrollEl,
282
- virtualScrollItemSizeComputed // optional
282
+ virtualScrollItemSizeComputed, // optional
283
+ debounceValue
283
284
  }: {
284
285
  virtualScrollLength: ComputedRef<number>
285
286
  getVirtualScrollTarget: () => HTMLElement | undefined
286
287
  getVirtualScrollEl: () => HTMLElement
287
288
  virtualScrollItemSizeComputed?: ComputedRef<number>
289
+ debounceValue?: number
288
290
  }) {
289
291
  const vm = getCurrentInstance()
290
292
 
291
293
  const { props, emit, proxy } = vm
292
294
 
295
+ let scrollAnimationFrameId: number | null = null
296
+ let changedRangeAnimationFrameId: number | null = null
297
+
298
+ onBeforeUnmount(() => {
299
+ resetAnimationFrame(scrollAnimationFrameId)
300
+ resetAnimationFrame(changedRangeAnimationFrameId)
301
+ })
302
+
303
+ const resetAnimationFrame = (frameId: number | null) => {
304
+ if (frameId) {
305
+ cancelAnimationFrame(frameId)
306
+ }
307
+ frameId = null
308
+ }
309
+
293
310
  let prevScrollStart: number | undefined
294
311
  let prevToIndex: number
295
312
  let localScrollViewSize: number | undefined
@@ -571,7 +588,9 @@ export function useVirtualScroll({
571
588
  virtualScrollLength.value
572
589
  )
573
590
 
574
- requestAnimationFrame(() => {
591
+ resetAnimationFrame(changedRangeAnimationFrameId)
592
+
593
+ changedRangeAnimationFrameId = requestAnimationFrame(() => {
575
594
  if (
576
595
  virtualScrollSliceRange.value.to !== to &&
577
596
  prevScrollStart === scrollDetails.scrollStart
@@ -590,7 +609,9 @@ export function useVirtualScroll({
590
609
  })
591
610
  }
592
611
 
593
- requestAnimationFrame(() => {
612
+ resetAnimationFrame(scrollAnimationFrameId)
613
+
614
+ scrollAnimationFrameId = requestAnimationFrame(() => {
594
615
  // if the scroll was changed give up
595
616
  // (another call to setVirtualScrollSliceRange before animation frame)
596
617
  if (prevScrollStart !== scrollDetails.scrollStart) {
@@ -916,7 +937,10 @@ export function useVirtualScroll({
916
937
  }
917
938
 
918
939
  setVirtualScrollSize()
919
- const onVirtualScrollEvt = debounce(localOnVirtualScrollEvt, 35)
940
+ const onVirtualScrollEvt = debounce(
941
+ localOnVirtualScrollEvt,
942
+ debounceValue ?? 100
943
+ )
920
944
 
921
945
  onBeforeMount(() => {
922
946
  setVirtualScrollSize()
@@ -1,3 +1,4 @@
1
1
  export * from './DlItemSection'
2
2
  export * from './DlInfoErrorMessage'
3
3
  export * from './DlVirtualScroll'
4
+ export * from './DlTooltip'
@@ -1,3 +1,5 @@
1
1
  export * from './essential/types'
2
2
  export * from './basic/types'
3
3
  export * from './compound/types'
4
+ import { TInputSizes as DlInputSizes } from '../utils/input-sizes'
5
+ export type { DlInputSizes }
@@ -14,12 +14,57 @@
14
14
  :options="options"
15
15
  :items-in-view="6"
16
16
  />
17
+
18
+ <dl-bar-chart
19
+ :legend-props="legendProps"
20
+ :data="data"
21
+ :options="options"
22
+ :items-in-view="6"
23
+ is-empty
24
+ :empty-state-props="{
25
+ responsive: true,
26
+ style: 'min-height: 350px;',
27
+ bgSize: '130px',
28
+ bgImage: `url(https://raw.githubusercontent.com/dataloop-ai/icons/main/assets/usage.svg)`,
29
+ title: 'Lorem ipsum',
30
+ subtitle:
31
+ 'Lorem ipsum dolor sit amet consectetur. Senectus condimentum dolor sit',
32
+ info: 'To learn more about this analytics, read our documentation.'
33
+ }"
34
+ >
35
+ <template #links="">
36
+ <div style="display: flex; gap: 5px; padding: 0 20px">
37
+ <dl-button
38
+ padding="0px"
39
+ icon="icon-dl-sdk-documentation"
40
+ flat
41
+ uppercase
42
+ label="SDK"
43
+ />
44
+ <div class="break" />
45
+ <dl-button
46
+ padding="0px"
47
+ icon="icon-dl-file"
48
+ flat
49
+ label="Documentation"
50
+ />
51
+ <div class="break" />
52
+ <dl-button
53
+ padding="0px"
54
+ icon="icon-dl-youtube"
55
+ flat
56
+ label="Video"
57
+ />
58
+ </div>
59
+ </template>
60
+ </dl-bar-chart>
17
61
  </div>
18
62
  </template>
19
63
 
20
64
  <script lang="ts">
21
65
  import { defineComponent } from 'vue-demi'
22
- import { DlBarChart } from '../components'
66
+ import { ChartOptions } from 'chart.js'
67
+ import { DlBarChart, DlButton } from '../components'
23
68
 
24
69
  const labelsFn = () => {
25
70
  const a = []
@@ -59,14 +104,26 @@ const legendProps = {
59
104
  alignItems: 'center'
60
105
  }
61
106
 
107
+ const options: ChartOptions = {
108
+ scales: {
109
+ y: {
110
+ afterFit: (scaleInstance) => {
111
+ scaleInstance.width = 50
112
+ }
113
+ }
114
+ }
115
+ }
116
+
62
117
  export default defineComponent({
63
118
  name: 'DlChartDemo',
64
119
  components: {
65
- DlBarChart
120
+ DlBarChart,
121
+ DlButton
66
122
  },
67
123
  data() {
68
124
  return {
69
125
  data,
126
+ options,
70
127
  legendProps
71
128
  }
72
129
  },
@@ -38,6 +38,21 @@
38
38
  <dl-avatar size="24px">
39
39
  <img :src="url">
40
40
  </dl-avatar>
41
+ <dl-tooltip>
42
+ <div
43
+ style="
44
+ display: flex;
45
+ flex-direction: column;
46
+ align-items: center;
47
+ padding: 10px;
48
+ "
49
+ >
50
+ <dl-avatar size="24px">
51
+ <img :src="url">
52
+ </dl-avatar>
53
+ <p>rotem.shaham@dataloop.com</p>
54
+ </div>
55
+ </dl-tooltip>
41
56
  <div />
42
57
  </div>
43
58
  </div>
@@ -51,12 +66,60 @@
51
66
  :options="options[0]"
52
67
  style="width: 100%"
53
68
  />
69
+
70
+ <dl-column-chart
71
+ :brush-props="brushProps"
72
+ :display-brush="false"
73
+ :display-labels="false"
74
+ :display-legend="false"
75
+ :legend-props="legendProps"
76
+ :data="data[0]"
77
+ :options="options[0]"
78
+ style="width: 50%"
79
+ is-empty
80
+ :empty-state-props="{
81
+ responsive: true,
82
+ style: 'min-height: 350px;',
83
+ bgSize: '130px',
84
+ bgImage: `url(https://raw.githubusercontent.com/dataloop-ai/icons/main/assets/usage.svg)`,
85
+ title: 'Lorem ipsum',
86
+ subtitle:
87
+ 'Lorem ipsum dolor sit amet consectetur. Senectus condimentum dolor sit',
88
+ info: 'To learn more about this analytics, read our documentation.'
89
+ }"
90
+ >
91
+ <template #links="">
92
+ <div style="display: flex; gap: 5px; padding: 0 20px">
93
+ <dl-button
94
+ padding="0px"
95
+ icon="icon-dl-sdk-documentation"
96
+ flat
97
+ uppercase
98
+ label="SDK"
99
+ />
100
+ <div class="break" />
101
+ <dl-button
102
+ padding="0px"
103
+ icon="icon-dl-file"
104
+ flat
105
+ label="Documentation"
106
+ />
107
+ <div class="break" />
108
+ <dl-button
109
+ padding="0px"
110
+ icon="icon-dl-youtube"
111
+ flat
112
+ label="Video"
113
+ />
114
+ </div>
115
+ </template>
116
+ </dl-column-chart>
54
117
  </div>
55
118
  </template>
56
119
 
57
120
  <script lang="ts">
58
121
  import { defineComponent } from 'vue-demi'
59
- import { DlAvatar, DlColumnChart } from '../components'
122
+ import { DlAvatar, DlColumnChart, DlTooltip, DlButton } from '../components'
60
123
 
61
124
  import { orderBy } from 'lodash'
62
125
 
@@ -213,7 +276,9 @@ export default defineComponent({
213
276
  name: 'DlColumnChartDemo',
214
277
  components: {
215
278
  DlColumnChart,
216
- DlAvatar
279
+ DlAvatar,
280
+ DlTooltip,
281
+ DlButton
217
282
  },
218
283
  data() {
219
284
  return {