@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
@@ -0,0 +1,141 @@
1
+ <template>
2
+ <div class="dl-ellipsis">
3
+ <span
4
+ ref="dlEllipsisRef"
5
+ class="dl-ellipsis__left"
6
+ >
7
+ <slot
8
+ v-if="hasDefaultSlot"
9
+ name="default"
10
+ />
11
+ <span v-else>{{ leftText }}</span>
12
+ </span>
13
+ <span
14
+ v-if="rightText"
15
+ class="dl-ellipsis__right"
16
+ >
17
+ {{ rightText }}
18
+ </span>
19
+ <dl-tooltip
20
+ v-if="shouldShowTooltip"
21
+ :max-width="'max-content'"
22
+ :self="tooltipPosition"
23
+ :anchor="tooltipPosition"
24
+ :offset="tooltipOffset"
25
+ >
26
+ <slot
27
+ v-if="hasDefaultSlot"
28
+ name="default"
29
+ />
30
+ <span v-else>{{ fullText }}</span>
31
+ </dl-tooltip>
32
+ </div>
33
+ </template>
34
+
35
+ <script lang="ts">
36
+ import { defineComponent, ref, computed } from 'vue-demi'
37
+ import { DlTooltip } from '../../shared'
38
+ import { useSizeObserver } from '../../../hooks/use-size-observer'
39
+
40
+ export default defineComponent({
41
+ name: 'DlEllipsis',
42
+ components: {
43
+ DlTooltip
44
+ },
45
+ props: {
46
+ /**
47
+ * Text to be displayed
48
+ */
49
+ text: {
50
+ type: String,
51
+ default: ''
52
+ },
53
+ /**
54
+ * Allows to split the text in two parts
55
+ */
56
+ split: {
57
+ type: Boolean,
58
+ default: false
59
+ },
60
+ /**
61
+ * Position of the split in the text, % of the text length
62
+ */
63
+ splitPosition: {
64
+ type: Number,
65
+ default: 0.5,
66
+ validator: (value: number) => value >= 0 && value <= 1
67
+ },
68
+ /**
69
+ * Tooltip to be displayed when the text is truncated
70
+ */
71
+ tooltip: {
72
+ type: Boolean,
73
+ default: true
74
+ },
75
+ tooltipPosition: {
76
+ type: String,
77
+ default: 'top middle'
78
+ },
79
+ tooltipOffset: {
80
+ type: Array,
81
+ default: () => [0, 25]
82
+ }
83
+ },
84
+ // TODO: fix type issue here
85
+ setup(props: any, { slots }: any) {
86
+ const dlEllipsisRef = ref(null)
87
+ const { hasEllipsis } = useSizeObserver(dlEllipsisRef)
88
+
89
+ const hasDefaultSlot = computed(() => !!slots.default)
90
+ const splitIndex = computed(() => {
91
+ if (!props.text.length) return null
92
+ return props.split
93
+ ? Math.round(props.text.length * props.splitPosition)
94
+ : props.text.length
95
+ })
96
+ const leftText = computed(() => {
97
+ if (splitIndex.value !== null) {
98
+ return props.text.slice(0, splitIndex.value)
99
+ }
100
+ return ''
101
+ })
102
+ const rightText = computed(() => {
103
+ if (splitIndex.value !== null) {
104
+ return props.text.slice(splitIndex.value)
105
+ }
106
+ return ''
107
+ })
108
+ const shouldShowTooltip = computed(
109
+ () => hasEllipsis.value && props.tooltip
110
+ )
111
+ const fullText = computed(() => props.text)
112
+
113
+ return {
114
+ hasDefaultSlot,
115
+ leftText,
116
+ rightText,
117
+ shouldShowTooltip,
118
+ fullText,
119
+ dlEllipsisRef
120
+ }
121
+ }
122
+ })
123
+ </script>
124
+
125
+ <style scoped lang="scss">
126
+ .dl-ellipsis {
127
+ display: flex;
128
+ overflow: hidden;
129
+
130
+ &__left {
131
+ flex: 0 1 auto;
132
+ overflow: hidden;
133
+ text-overflow: ellipsis;
134
+ }
135
+
136
+ &__right {
137
+ flex: 1 0 auto;
138
+ overflow: hidden;
139
+ }
140
+ }
141
+ </style>
@@ -22,7 +22,7 @@
22
22
  <div
23
23
  v-else
24
24
  :id="uuid"
25
- style="display: inline"
25
+ :style="[inlineStyles, computedStyles]"
26
26
  @click="$emit('click', $event)"
27
27
  @mousedown="$emit('mousedown', $event)"
28
28
  @mouseup="$emit('mouseup', $event)"
@@ -90,7 +90,7 @@ export default defineComponent({
90
90
  return {
91
91
  '--dl-icon-font-size': `${this.size}`,
92
92
  '--dl-icon-color': this.color
93
- ? // needed for now until the swap of DLBTN in OA
93
+ ? // todo: remove this. this is needed for now until the swap of DLBTN in OA
94
94
  getColor(
95
95
  this.color === 'secondary'
96
96
  ? 'q-color-secondary'
@@ -101,7 +101,7 @@ export default defineComponent({
101
101
  }
102
102
  },
103
103
  inlineStyles(): Record<string, string> {
104
- return { display: this.inline ? 'inline' : 'flex' }
104
+ return { display: this.inline ? 'inline-flex' : 'flex' }
105
105
  },
106
106
  // needed to allow external source of icons that do not use class based
107
107
  externalIcon(): boolean {
@@ -144,7 +144,7 @@ export default defineComponent({
144
144
  try {
145
145
  svgElement.src = this.svgSource
146
146
  ? `${this.svgSource}/${this.icon}.svg`
147
- : require(`@dataloop-ai/icons/assets/${this.icon}.svg`)
147
+ : `https://raw.githubusercontent.com/dataloop-ai/icons/main/assets/${this.icon}.svg`
148
148
  } catch (e) {
149
149
  reject(e)
150
150
  }
@@ -156,7 +156,7 @@ export default defineComponent({
156
156
 
157
157
  <style scoped lang="scss">
158
158
  .dl-icon {
159
- display: inline-block;
159
+ display: inline-flex;
160
160
  color: var(--dl-icon-color);
161
161
  font-size: var(--dl-icon-font-size);
162
162
  }
@@ -0,0 +1,190 @@
1
+ <template>
2
+ <div
3
+ :id="uuid"
4
+ class="dl-label"
5
+ :style="styles"
6
+ @mouseenter="mouseOver = true"
7
+ @mouseleave="mouseOver = false"
8
+ >
9
+ <div class="dl-label__prefix">
10
+ <slot name="prefix">
11
+ <div
12
+ v-if="labelColor"
13
+ class="dl-label__line"
14
+ />
15
+ </slot>
16
+ </div>
17
+ <div class="dl-label__content">
18
+ <span v-if="prefix">{{ prefixPreview }}</span>
19
+ <dl-ellipsis
20
+ v-if="text"
21
+ class="dl-label__text"
22
+ :class="!suffix && fluid ? 'dl-label__fluid' : ''"
23
+ :text="text"
24
+ />
25
+ <dl-ellipsis
26
+ v-else
27
+ class="dl-label__text"
28
+ >
29
+ <slot name="default" />
30
+ </dl-ellipsis>
31
+ <span
32
+ v-if="suffix"
33
+ :class="fluid ? 'dl-label__fluid' : ''"
34
+ >
35
+ {{ suffixPreview }}</span>
36
+ <div class="dl-label__suffix">
37
+ <div class="dl-label__suffix-slot">
38
+ <slot
39
+ v-if="mouseOver"
40
+ name="actions"
41
+ />
42
+ </div>
43
+ <dl-icon
44
+ v-if="hint"
45
+ class="dl-label__suffix-icon"
46
+ icon="icon-dl-info"
47
+ >
48
+ <dl-tooltip>{{ hint }}</dl-tooltip>
49
+ </dl-icon>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </template>
54
+
55
+ <script lang="ts">
56
+ import { v4 } from 'uuid'
57
+ import { DlTooltip } from '../../shared'
58
+ // todo: this will cause issues
59
+ import { DlIcon, DlEllipsis } from '../../essential'
60
+ import { computed, defineComponent, ref, toRef, toRefs } from 'vue-demi'
61
+ import { getColor } from '../../../utils'
62
+
63
+ export default defineComponent({
64
+ name: 'DlLabel',
65
+ components: { DlEllipsis, DlIcon, DlTooltip },
66
+ props: {
67
+ /**
68
+ * Text to be displayed
69
+ */
70
+ text: {
71
+ type: String,
72
+ default: ''
73
+ },
74
+ /**
75
+ * Prefix to be displayed
76
+ */
77
+ prefix: {
78
+ type: String,
79
+ default: null
80
+ },
81
+ /**
82
+ * Suffix to be displayed
83
+ */
84
+ suffix: {
85
+ type: String,
86
+ default: null
87
+ },
88
+ /**
89
+ * Color of the left side line
90
+ */
91
+ labelColor: {
92
+ type: String,
93
+ default: null
94
+ },
95
+ /**
96
+ * Text to be displayed inside the info tooltip
97
+ */
98
+ hint: {
99
+ type: String,
100
+ default: null
101
+ },
102
+ /**
103
+ * Label text color
104
+ */
105
+ color: {
106
+ type: String,
107
+ default: 'dl-color-darker'
108
+ },
109
+ /**
110
+ * Will fill the container size its given
111
+ */
112
+ fluid: {
113
+ type: Boolean,
114
+ default: false
115
+ }
116
+ },
117
+ setup(props, { emit, slots }) {
118
+ const mouseOver = ref(false)
119
+ const { labelColor, color, prefix, suffix } = toRefs(props)
120
+
121
+ const styles = computed<Record<string, any>>(() => {
122
+ return {
123
+ '--dl-label-color': getColor(labelColor.value),
124
+ '--dl-label-text-color': getColor(color.value)
125
+ }
126
+ })
127
+
128
+ const hasActions = computed(() => {
129
+ return !!slots['actions']
130
+ })
131
+
132
+ const prefixPreview = computed(() => {
133
+ return prefix.value?.trim() ?? ''
134
+ })
135
+ const suffixPreview = computed(() => {
136
+ return suffix.value?.trim() ?? ''
137
+ })
138
+
139
+ return {
140
+ uuid: `dl-text-holder-${v4()}`,
141
+ mouseOver,
142
+ styles,
143
+ hasActions,
144
+ prefixPreview,
145
+ suffixPreview
146
+ }
147
+ }
148
+ })
149
+ </script>
150
+
151
+ <style scoped lang="scss">
152
+ .dl-label {
153
+ display: flex;
154
+ flex-wrap: nowrap;
155
+ width: 100%;
156
+ white-space: nowrap;
157
+ position: relative;
158
+ &__line {
159
+ border-radius: 2px;
160
+ background-color: var(--dl-label-color);
161
+ width: 2px;
162
+ height: 100%;
163
+ margin-right: 5px;
164
+ }
165
+ &__suffix {
166
+ height: 100%;
167
+ margin-left: 5px;
168
+ display: flex;
169
+ align-items: center;
170
+ &-icon {
171
+ cursor: pointer;
172
+ }
173
+ }
174
+ &__content {
175
+ color: var(--dl-label-text-color);
176
+ display: flex;
177
+ width: 95%;
178
+ }
179
+ &__text {
180
+ overflow: hidden;
181
+ text-overflow: ellipsis;
182
+ white-space: nowrap;
183
+ }
184
+
185
+ &__fluid {
186
+ flex-grow: 100;
187
+ max-width: 100%;
188
+ }
189
+ }
190
+ </style>
@@ -0,0 +1,2 @@
1
+ import DlLabel from './DlLabel.vue'
2
+ export { DlLabel }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <component
3
- :is="tag"
3
+ :is="type"
4
4
  :id="uuid"
5
5
  :class="classes"
6
6
  >
@@ -18,7 +18,7 @@ export default defineComponent({
18
18
  separator: Boolean,
19
19
  padding: Boolean,
20
20
  clickable: Boolean,
21
- tag: {
21
+ type: {
22
22
  type: String,
23
23
  default: 'div'
24
24
  }
@@ -43,7 +43,7 @@ export default defineComponent({
43
43
 
44
44
  <style scoped lang="scss">
45
45
  .dl-list {
46
- padding: 5px 0;
46
+ padding: 6px 0;
47
47
  background-color: var(--dl-color-panel-background);
48
48
  &--bordered {
49
49
  border: 1px solid var(--dl-color-separator);
@@ -125,7 +125,7 @@ export default defineComponent({
125
125
 
126
126
  scrollTarget: {
127
127
  type: String as PropType<Element | string>,
128
- default: void 0
128
+ default: null
129
129
  },
130
130
 
131
131
  touchPosition: Boolean,
@@ -145,6 +145,10 @@ export default defineComponent({
145
145
  arrowNavItems: {
146
146
  type: [String, Array, Object],
147
147
  default: () => [] as any[]
148
+ },
149
+ zIndex: {
150
+ type: [Number, String],
151
+ default: 'var(--dl-z-index-menu)'
148
152
  }
149
153
  },
150
154
 
@@ -263,7 +267,7 @@ export default defineComponent({
263
267
  showPortal()
264
268
  configureScrollTarget()
265
269
 
266
- absoluteOffset = void 0
270
+ absoluteOffset = null
267
271
 
268
272
  const offsetOnShow = setOffsetOnShow(evt as TouchEvent, {
269
273
  contextMenu: props.contextMenu,
@@ -274,7 +278,7 @@ export default defineComponent({
274
278
 
275
279
  absoluteOffset = offsetOnShow as Record<any, any> | undefined
276
280
 
277
- if (unwatchPosition === void 0) {
281
+ if (!unwatchPosition) {
278
282
  unwatchPosition = watch(() => screen, updatePosition, {
279
283
  deep: true
280
284
  })
@@ -287,18 +291,21 @@ export default defineComponent({
287
291
  { continuous: true }
288
292
  )
289
293
 
290
- registerTimeout(() => {
291
- // required in order to avoid the "double-tap needed" issue
292
- avoidAutoClose = avoidAutoCloseFn(isMobile.value, {
293
- avoidAutoClose,
294
- autoClose: props.autoClose,
295
- innerRef
296
- })
294
+ registerTimeout(
295
+ () => {
296
+ // required in order to avoid the "double-tap needed" issue
297
+ avoidAutoClose = avoidAutoCloseFn(isMobile.value, {
298
+ avoidAutoClose,
299
+ autoClose: props.autoClose,
300
+ innerRef
301
+ })
297
302
 
298
- updatePosition()
299
- showPortal(true) // done showing portal
300
- emit('show', evt)
301
- }, props.transitionDuration)
303
+ updatePosition()
304
+ showPortal(true) // done showing portal
305
+ emit('show', evt)
306
+ },
307
+ isVue2 ? 5 : props.transitionDuration
308
+ )
302
309
  }
303
310
 
304
311
  function handleHide(evt: ClickOutsideEvent) {
@@ -310,14 +317,17 @@ export default defineComponent({
310
317
  anchorCleanup(true)
311
318
  refocusTarget = refocusTargetFn(evt, refocusTarget as HTMLElement)
312
319
 
313
- registerTimeout(() => {
314
- hidePortal(true) // done hiding, now destroy
315
- emit('hide', evt)
316
- }, props.transitionDuration)
320
+ registerTimeout(
321
+ () => {
322
+ hidePortal(true) // done hiding, now destroy
323
+ emit('hide', evt)
324
+ },
325
+ isVue2 ? 5 : props.transitionDuration
326
+ )
317
327
  }
318
328
 
319
329
  function anchorCleanup(hiding: boolean) {
320
- absoluteOffset = void 0
330
+ absoluteOffset = null
321
331
 
322
332
  unwatchPosition = updateUnwatchPosition(unwatchPosition)
323
333
 
@@ -333,7 +343,7 @@ export default defineComponent({
333
343
  }
334
344
 
335
345
  function configureScrollTarget() {
336
- if (anchorEl.value !== null || props.scrollTarget !== void 0) {
346
+ if (anchorEl.value !== null || props.scrollTarget) {
337
347
  (localScrollTarget as Ref<any>).value = getScrollTarget(
338
348
  anchorEl.value as HTMLElement,
339
349
  props.scrollTarget
@@ -432,7 +442,13 @@ export default defineComponent({
432
442
  portalEl: isVue2 ? '[data-test-id="portal"]' : portalEl,
433
443
  portalIsActive,
434
444
  classes: 'dl-menu dl-position-engine scroll' + classes.value,
435
- styles: [attrs.style, transitionStyle.value] as any,
445
+ styles: [
446
+ attrs.style,
447
+ transitionStyle.value,
448
+ {
449
+ '--menu-z-index': props.zIndex ?? 'var(--dl-z-index-menu)'
450
+ }
451
+ ] as any,
436
452
  selectedItem,
437
453
  highlightedIndex
438
454
  }
@@ -452,9 +468,12 @@ export default defineComponent({
452
468
  border-radius: 2px;
453
469
  overflow-y: auto;
454
470
  overflow-x: hidden;
471
+ &::-webkit-scrollbar {
472
+ width: var(--dl-menu-scrollbar-width, 5px);
473
+ }
455
474
  outline: 0;
456
475
  max-height: 65vh;
457
- z-index: var(--dl-z-index-menu);
476
+ z-index: var(--menu-z-index);
458
477
 
459
478
  &--square {
460
479
  border-radius: 0;
@@ -8,6 +8,7 @@ import {
8
8
  removeClickOutside,
9
9
  ClickOutsideEvent
10
10
  } from '../../../utils/click-outside'
11
+ import { isNumber } from 'lodash'
11
12
 
12
13
  interface ClickOutsideProps {
13
14
  persistent: boolean
@@ -62,12 +63,12 @@ export const setOffsetOnShow = (
62
63
  evt: TouchEvent,
63
64
  { contextMenu, touchPosition, anchorEl, absoluteOffset }: OffsetOnShowProps
64
65
  ) => {
65
- if (evt !== void 0 && (touchPosition || contextMenu)) {
66
+ if (evt && (touchPosition || contextMenu)) {
66
67
  const pos = position(evt)
67
68
 
68
- if (pos.top !== void 0 && pos.left !== void 0 && anchorEl.value) {
69
+ if (isNumber(pos.top) && isNumber(pos.left) && anchorEl.value) {
69
70
  const { top, left } = anchorEl.value.getBoundingClientRect()
70
- if (top !== void 0 && left !== void 0) {
71
+ if (isNumber(top) && isNumber(left)) {
71
72
  return {
72
73
  left: pos.left - left,
73
74
  top: pos.top - top
@@ -99,11 +100,11 @@ export const avoidAutoCloseFn = (
99
100
  export const updateUnwatchPosition = (
100
101
  unwatchPosition: Function | undefined
101
102
  ): undefined => {
102
- if (unwatchPosition !== void 0) {
103
+ if (unwatchPosition) {
103
104
  unwatchPosition()
104
105
  }
105
106
 
106
- return void 0
107
+ return null
107
108
  }
108
109
 
109
110
  export const refocusTargetFn = (
@@ -113,9 +114,9 @@ export const refocusTargetFn = (
113
114
  if (
114
115
  refocusTarget !== null &&
115
116
  // menu was hidden from code or ESC plugin
116
- (evt === void 0 ||
117
+ (evt ||
117
118
  // menu was not closed from a mouse or touch clickOutside
118
- evt.dlClickOutside !== true)
119
+ evt?.dlClickOutside !== true)
119
120
  ) {
120
121
  (refocusTarget as HTMLElement).focus()
121
122
  }
@@ -0,0 +1,90 @@
1
+ <template>
2
+ <div
3
+ class="dl-page-layout"
4
+ :style="cssVars"
5
+ >
6
+ <div class="dl-page-layout__main-head">
7
+ <slot name="header" />
8
+ </div>
9
+ <div class="dl-page-layout__left-drawer">
10
+ <slot name="leftDrawer" />
11
+ </div>
12
+ <div class="dl-page-layout__right-drawer">
13
+ <slot name="rightDrawer" />
14
+ </div>
15
+ <div class="dl-page-layout__content">
16
+ <slot name="mainContent" />
17
+ </div>
18
+ <div class="dl-page-layout__footer">
19
+ <slot name="footer" />
20
+ </div>
21
+ </div>
22
+ </template>
23
+
24
+ <script lang="ts">
25
+ import { defineComponent, computed } from 'vue-demi'
26
+ export default defineComponent({
27
+ name: 'DlPageLayout',
28
+ props: {
29
+ template: {
30
+ type: String,
31
+ default: '"h h h" "l p r" "f f f"'
32
+ }
33
+ },
34
+ setup(props) {
35
+ const cssVars = computed(() => {
36
+ return {
37
+ '--dl-page-layout-template': props.template
38
+ }
39
+ })
40
+ return {
41
+ cssVars
42
+ }
43
+ }
44
+ })
45
+ </script>
46
+
47
+ <style scoped lang="scss">
48
+ .dl-page-layout {
49
+ height: 100vh;
50
+ width: 100%;
51
+ display: grid;
52
+ grid-template-areas: var(--dl-page-layout-template);
53
+ grid-template-rows: auto 1fr auto;
54
+ grid-template-columns: auto 1fr auto;
55
+ box-shadow: 1px 1px 1px var(--dl-color-separator);
56
+
57
+ &__main-head {
58
+ grid-area: h;
59
+ box-shadow: 1px 1px 1px var(--dl-color-separator);
60
+ }
61
+
62
+ &__content {
63
+ grid-area: p;
64
+ overflow-y: scroll;
65
+ box-shadow: 1px 1px 1px var(--dl-color-separator);
66
+ }
67
+
68
+ &__left-drawer {
69
+ grid-area: l;
70
+ overflow: auto;
71
+ box-shadow: 1px 1px 1px var(--dl-color-separator);
72
+ }
73
+
74
+ &__right-drawer {
75
+ grid-area: r;
76
+ overflow: auto;
77
+ box-shadow: 1px 1px 1px var(--dl-color-separator);
78
+ }
79
+
80
+ &__sidebar-content {
81
+ position: absolute;
82
+ margin-left: 0;
83
+ }
84
+
85
+ &__footer {
86
+ grid-area: f;
87
+ box-shadow: 1px 1px 1px var(--dl-color-separator);
88
+ }
89
+ }
90
+ </style>
@@ -0,0 +1,2 @@
1
+ import DlPageLayout from './DlPageLayout.vue'
2
+ export { DlPageLayout }
@@ -87,7 +87,7 @@ export default defineComponent({
87
87
  },
88
88
  height: {
89
89
  type: String,
90
- default: '4px'
90
+ default: '5px'
91
91
  },
92
92
  summary: {
93
93
  type: String,