@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
@@ -1,241 +0,0 @@
1
- <template>
2
- <div
3
- class="card"
4
- :style="[{ width, height }, computedStyles]"
5
- >
6
- <div
7
- v-if="icon"
8
- class="card--icon"
9
- >
10
- <dl-icon
11
- :icon="icon.src"
12
- :styles="iconStyles"
13
- :size="iconSize"
14
- :color="iconColor"
15
- />
16
- </div>
17
- <div
18
- v-else-if="image"
19
- class="card--image"
20
- >
21
- <img
22
- :src="image.src"
23
- :style="imageStyles"
24
- :alt="imageAlt"
25
- >
26
- </div>
27
- <div class="card--content">
28
- <div>
29
- <slot
30
- v-if="!!$slots.header"
31
- name="header"
32
- />
33
- <div
34
- v-else
35
- class="card--header"
36
- >
37
- <span class="card--header_title">{{ title }}</span>
38
- <span class="card--header_shortcut">{{
39
- keyboardShortcut
40
- }}</span>
41
- </div>
42
- <slot
43
- v-if="!!$slots.content"
44
- name="content"
45
- />
46
- <span
47
- v-else
48
- class="card--content_text"
49
- >{{ text }}</span>
50
- </div>
51
- <slot
52
- v-if="!!$slots.footer"
53
- name="footer"
54
- />
55
- <div
56
- v-else
57
- class="card--links"
58
- >
59
- <div
60
- v-for="(link, idx) in links"
61
- :key="idx"
62
- class="card--links_linkItem"
63
- >
64
- <div class="card--links_linkItem_icon">
65
- <dl-icon
66
- v-if="link.icon"
67
- :icon="link.icon"
68
- size="12px"
69
- />
70
- </div>
71
- <div class="card--links_linkItem_link">
72
- <dl-link
73
- :external="!!link.external"
74
- :href="link.href"
75
- :newtab="!!link.newtab"
76
- >
77
- {{ link.title }}
78
- </dl-link>
79
- </div>
80
- </div>
81
- </div>
82
- </div>
83
- </div>
84
- </template>
85
-
86
- <script lang="ts">
87
- import { isString } from 'lodash'
88
- import { defineComponent, PropType } from 'vue-demi'
89
- import { stringStyleToRecord } from '../../../utils'
90
- import { DlIcon } from '../../essential/DlIcon'
91
- import { DlLink } from '../../essential/DlLink'
92
- import { IconItem, ImageItem, LinkItem } from './types'
93
-
94
- export default defineComponent({
95
- name: 'DlCard',
96
- components: { DlLink, DlIcon },
97
- props: {
98
- image: {
99
- type: Object as PropType<ImageItem>,
100
- default: null
101
- },
102
- icon: {
103
- type: Object as PropType<IconItem>,
104
- default: null
105
- },
106
- title: {
107
- type: String,
108
- default: ''
109
- },
110
- text: {
111
- type: String,
112
- default: ''
113
- },
114
- keyboardShortcut: {
115
- type: String,
116
- default: ''
117
- },
118
- links: {
119
- type: Array as PropType<LinkItem[]>,
120
- default: () => Array as PropType<LinkItem[]>
121
- },
122
- height: {
123
- type: String,
124
- default: 'auto'
125
- },
126
- width: {
127
- type: String,
128
- default: '200px'
129
- },
130
- styles: {
131
- type: [Object, String],
132
- default: null
133
- }
134
- },
135
- computed: {
136
- computedStyles(): Record<string, string> {
137
- return isString(this.styles)
138
- ? stringStyleToRecord(this.styles)
139
- : this.styles
140
- },
141
- iconStyles(): string {
142
- return this.icon?.styles ?? ''
143
- },
144
- iconSize(): string {
145
- return this.icon?.size ?? '50px'
146
- },
147
- iconColor(): string {
148
- return this.icon?.color ?? 'var(--dl-color-darker)'
149
- },
150
- imageStyles(): string {
151
- return this.image?.styles ?? ''
152
- },
153
- imageAlt(): string {
154
- return this.image?.alt ?? ''
155
- }
156
- }
157
- })
158
- </script>
159
-
160
- <style lang="scss" scoped>
161
- .card {
162
- color: var(--dl-color-darker);
163
- background-color: var(--dl-color-panel-background);
164
- border: 1px solid var(--dl-color-separator);
165
- border-radius: 2px;
166
- pointer-events: auto;
167
- box-shadow: 0px 5px 15px 0px var(--dl-color-shadow);
168
-
169
- &--content {
170
- padding: 16px;
171
- &_text {
172
- font-size: 12px;
173
- color: var(--dl-color-medium);
174
- }
175
- }
176
-
177
- &--header {
178
- display: flex;
179
- align-items: center;
180
- flex-wrap: wrap;
181
-
182
- &_title {
183
- color: var(--dl-color-darker);
184
- font-size: 14px;
185
- line-height: 16px;
186
- font-weight: 700;
187
- margin-right: 10px;
188
- margin-bottom: 10px;
189
- }
190
- &_shortcut {
191
- color: #767676;
192
- font-size: 10px;
193
- line-height: 10px;
194
- border-radius: 2px;
195
- border: 1px solid #767676;
196
- padding: 4px;
197
- text-align: center;
198
- margin-bottom: 10px;
199
- }
200
- }
201
- &--links {
202
- margin-top: 16px;
203
- display: flex;
204
- align-items: center;
205
- flex-wrap: wrap;
206
-
207
- &_linkItem {
208
- margin-right: 15px;
209
- color: var(--dl-color-secondary);
210
- font-size: 10px;
211
- display: flex;
212
- align-items: center;
213
-
214
- &_icon {
215
- margin-right: 7px;
216
- vertical-align: middle;
217
- }
218
-
219
- &_link {
220
- vertical-align: middle;
221
- }
222
- }
223
- }
224
- &--image {
225
- width: 200px;
226
- height: 100px;
227
- overflow: hidden;
228
- img {
229
- width: 100%;
230
- }
231
- }
232
- &--icon {
233
- display: flex;
234
- justify-content: center;
235
- align-items: center;
236
- padding-top: 34px;
237
- padding-bottom: 16px;
238
- color: var(--dl-color-darker);
239
- }
240
- }
241
- </style>
@@ -1,20 +0,0 @@
1
- export type ImageItem = {
2
- src: string
3
- styles?: string
4
- alt?: string
5
- }
6
-
7
- export type IconItem = {
8
- src: string
9
- styles?: string
10
- size?: string
11
- color?: string
12
- }
13
-
14
- export type LinkItem = {
15
- title: string
16
- href: string
17
- icon?: string
18
- newtab?: boolean
19
- external?: boolean
20
- }
@@ -1,114 +0,0 @@
1
- <template>
2
- <div class="dl-ellipsis">
3
- <span
4
- ref="dlEllipsisRef"
5
- class="dl-ellipsis__left"
6
- >
7
- {{ leftText }}
8
- </span>
9
- <span
10
- v-if="rightText"
11
- class="dl-ellipsis__right"
12
- >
13
- {{ rightText }}
14
- </span>
15
- <dl-tooltip v-if="hasEllipsis && tooltip">
16
- {{ fullText }}
17
- </dl-tooltip>
18
- </div>
19
- </template>
20
-
21
- <script lang="ts">
22
- import { defineComponent, ref, computed, toRef } from 'vue-demi'
23
- import DlTooltip from '../../essential/DlTooltip/DlTooltip.vue'
24
- import { useSizeObserver } from '../../../hooks/use-size-observer'
25
-
26
- export default defineComponent({
27
- name: 'DlEllipsis',
28
- components: {
29
- DlTooltip
30
- },
31
- props: {
32
- /**
33
- * Text to be displayed
34
- */
35
- text: {
36
- type: String,
37
- required: true
38
- },
39
- /**
40
- * Allows to split the text in two parts
41
- */
42
- split: {
43
- type: Boolean,
44
- default: false,
45
- required: false
46
- },
47
- /**
48
- * Position of the split in the text, % of the text length
49
- */
50
- splitPosition: {
51
- type: Number,
52
- required: false,
53
- default: 0.5,
54
- validator: (value: number) => value >= 0 && value <= 1
55
- },
56
- /**
57
- * Tooltip to be displayed when the text is truncated
58
- */
59
- tooltip: {
60
- type: Boolean,
61
- default: true,
62
- required: false
63
- }
64
- },
65
- setup(props) {
66
- const { text, split } = props
67
-
68
- const splitPositionsRef = toRef(props, 'splitPosition')
69
- splitPositionsRef.value = Math.min(
70
- Math.max(splitPositionsRef.value, 1),
71
- 0
72
- )
73
-
74
- const dlEllipsisRef = ref(null)
75
- const splitIndex = computed(() =>
76
- split
77
- ? Math.round(text.length * splitPositionsRef.value)
78
- : text.length
79
- )
80
-
81
- const leftText = computed(() => text.slice(0, splitIndex.value))
82
- const rightText = computed(() => text.slice(splitIndex.value))
83
-
84
- const { hasEllipsis } = useSizeObserver(dlEllipsisRef)
85
- const fullText = computed(() => text)
86
-
87
- return {
88
- leftText,
89
- rightText,
90
- fullText,
91
- dlEllipsisRef,
92
- hasEllipsis
93
- }
94
- }
95
- })
96
- </script>
97
-
98
- <style scoped lang="scss">
99
- .dl-ellipsis {
100
- display: flex;
101
- overflow: hidden;
102
-
103
- &__left {
104
- flex: 0 1 auto;
105
- overflow: hidden;
106
- text-overflow: ellipsis;
107
- }
108
-
109
- &__right {
110
- flex: 1 0 auto;
111
- overflow: hidden;
112
- }
113
- }
114
- </style>
@@ -1,33 +0,0 @@
1
- <template>
2
- <div
3
- :style="rowGap"
4
- class="dl-grid"
5
- >
6
- <slot />
7
- </div>
8
- </template>
9
-
10
- <script lang="ts">
11
- import { defineComponent } from 'vue-demi'
12
-
13
- export default defineComponent({
14
- props: {
15
- gap: {
16
- type: String,
17
- default: '30px'
18
- }
19
- },
20
- computed: {
21
- rowGap(): Record<string, string> {
22
- return { '--row-gap': this.gap }
23
- }
24
- }
25
- })
26
- </script>
27
-
28
- <style lang="scss" scoped>
29
- .dl-grid {
30
- display: flex;
31
- flex-direction: column;
32
- }
33
- </style>
@@ -1,32 +0,0 @@
1
- <template>
2
- <div
3
- :style="columnGap"
4
- class="dl-grid-row"
5
- >
6
- <slot />
7
- </div>
8
- </template>
9
-
10
- <script lang="ts">
11
- import { defineComponent } from 'vue-demi'
12
-
13
- export default defineComponent({
14
- props: {
15
- gap: {
16
- type: String,
17
- default: '30px'
18
- }
19
- },
20
- computed: {
21
- columnGap(): Record<string, string> {
22
- return { '--column-gap': this.gap }
23
- }
24
- }
25
- })
26
- </script>
27
-
28
- <style scoped>
29
- .dl-grid-row {
30
- display: flex;
31
- }
32
- </style>
@@ -1,124 +0,0 @@
1
- import { ColorSchema, SyntaxColorSchema, Filters } from '../types'
2
- import {
3
- operators,
4
- Alias,
5
- startDatePattern,
6
- endDatePattern,
7
- dateIntervalPattern
8
- } from '../../../../../hooks/use-suggestions'
9
-
10
- export function getTabItems(filters: Filters) {
11
- return [
12
- {
13
- label: `Saved DQL Queries (${filters.saved.length})`,
14
- name: 'saved'
15
- },
16
- {
17
- label: `Recent Searches (${filters.recent.length})`,
18
- name: 'recent'
19
- },
20
- {
21
- label: `Suggested Searches (${filters.suggested.length})`,
22
- name: 'suggested'
23
- }
24
- ]
25
- }
26
-
27
- export function replaceWithJsDates(str: string) {
28
- const intervals = str.match(dateIntervalPattern)
29
- const starts = str.match(startDatePattern)
30
- const ends = str.match(endDatePattern)
31
-
32
- intervals?.forEach((interval) => {
33
- str = str.replaceAll(interval, formatToDateObj(interval))
34
- })
35
- starts?.forEach((start) => {
36
- str = str.replaceAll(start, formatToDateObj(start))
37
- })
38
- ends?.forEach((end) => {
39
- str = str.replaceAll(end, formatToDateObj(end))
40
- })
41
- return str
42
- }
43
-
44
- function formatToDateObj(str: string) {
45
- const [day, month, year] = str.split(' ')[1].split('/')
46
- const date = new Date(parseInt(year), parseInt(month), parseInt(day))
47
- if (!isValidDate(date)) return str
48
- const [toDay, toMonth, toYear] = str.split(' ')[3]?.split('/') || []
49
- const toDate = new Date(
50
- parseInt(toYear),
51
- parseInt(toMonth),
52
- parseInt(toDay)
53
- )
54
- if (!isValidDate(toDate)) return date.toISOString()
55
- return JSON.stringify({
56
- from: date.toISOString(),
57
- to: toDate.toISOString()
58
- })
59
- }
60
-
61
- function isValidDate(d: Date) {
62
- return d instanceof Date && !isNaN(d as any)
63
- }
64
-
65
- export function replaceAliases(json: string, aliases: Alias[]) {
66
- let newJson = json
67
- aliases.forEach((alias) => {
68
- newJson = newJson.replaceAll(alias.alias, alias.key)
69
- })
70
- return newJson
71
- }
72
-
73
- export function createColorSchema(
74
- colorSchema: ColorSchema,
75
- aliases: Alias[]
76
- ): SyntaxColorSchema {
77
- const thisFields = []
78
- for (const key in aliases) {
79
- thisFields.push(aliases[key].alias)
80
- }
81
-
82
- const thisOperators = []
83
- for (const key in operators) {
84
- thisOperators.push(operators[key])
85
- }
86
-
87
- return {
88
- fields: {
89
- values: thisFields,
90
- color: colorSchema.fields
91
- },
92
- operators: {
93
- values: thisOperators,
94
- color: colorSchema.operators
95
- },
96
- keywords: {
97
- values: ['OR', 'AND'],
98
- color: colorSchema.keywords
99
- }
100
- }
101
- }
102
-
103
- export const isEligibleToChange = (target: HTMLElement, expanded: boolean) => {
104
- let childOffsetRight = 0
105
- let childOffsetBottom = 20
106
-
107
- if (target?.lastChild) {
108
- const range = document.createRange()
109
- range.selectNode(target?.lastChild)
110
- childOffsetRight =
111
- range.getBoundingClientRect().right -
112
- target.getBoundingClientRect().left
113
- childOffsetBottom =
114
- range.getBoundingClientRect().bottom -
115
- target.getBoundingClientRect().top +
116
- 5
117
- }
118
-
119
- if (childOffsetRight <= target.clientWidth) {
120
- return [-childOffsetRight, 5]
121
- } else {
122
- return [-target.clientWidth, 5]
123
- }
124
- }
@@ -1,17 +0,0 @@
1
- const Positions = Object.freeze({
2
- top_right: 'top-right',
3
- top: 'top',
4
- top_left: 'top-left',
5
- bottom_right: 'bottom-right',
6
- bottom: 'bottom',
7
- bottom_left: 'bottom-left'
8
- })
9
-
10
- const Types = Object.freeze({
11
- success: 'success',
12
- warning: 'warning',
13
- error: 'error',
14
- info: 'info'
15
- })
16
-
17
- export { Positions, Types }
@@ -1,65 +0,0 @@
1
- <template>
2
- <span
3
- :id="uuid"
4
- class="dl-text-holder"
5
- >
6
- <span v-if="prefix">{{ prefixPreview }}</span>
7
- <span class="dl-text-holder--value">
8
- <slot> {{ textPreview }} </slot>
9
- </span>
10
- <span v-if="suffix"> {{ suffixPreview }}</span>
11
- </span>
12
- </template>
13
-
14
- <script lang="ts">
15
- import { v4 } from 'uuid'
16
- import { defineComponent } from 'vue-demi'
17
-
18
- export default defineComponent({
19
- name: 'DlTextHolder',
20
- props: {
21
- prefix: {
22
- type: String,
23
- default: null
24
- },
25
- suffix: {
26
- type: String,
27
- default: null
28
- },
29
- text: {
30
- type: String,
31
- required: true
32
- }
33
- },
34
- data() {
35
- return {
36
- uuid: `dl-text-holder-${v4()}`
37
- }
38
- },
39
- computed: {
40
- prefixPreview(): string {
41
- return this.prefix?.trim() ?? ''
42
- },
43
- suffixPreview(): string {
44
- return this.suffix?.trim() ?? ''
45
- },
46
- textPreview(): string {
47
- return this.text
48
- }
49
- }
50
- })
51
- </script>
52
-
53
- <style scoped lang="scss">
54
- .dl-text-holder {
55
- display: flex;
56
- flex-wrap: nowrap;
57
- width: 100%;
58
-
59
- &--value {
60
- white-space: nowrap;
61
- overflow: hidden;
62
- text-overflow: ellipsis;
63
- }
64
- }
65
- </style>
@@ -1,2 +0,0 @@
1
- import DlTextHolder from './DlTextHolder.vue'
2
- export { DlTextHolder }
@@ -1,42 +0,0 @@
1
- <template>
2
- <div>
3
- <div class="dl-text-holder-demo">
4
- <dl-text-holder
5
- prefix="home/Desktop/"
6
- suffix=".mp3"
7
- text="very-loooooooooooong-named-song"
8
- />
9
-
10
- <dl-text-holder
11
- prefix="home/Desktop/"
12
- suffix=".mp3"
13
- >
14
- very-loooooooooooong-named-song2
15
- </dl-text-holder>
16
- </div>
17
- </div>
18
- </template>
19
-
20
- <script lang="ts">
21
- import { defineComponent } from 'vue-demi'
22
- import { DlTextHolder } from '../components'
23
-
24
- export default defineComponent({
25
- components: {
26
- DlTextHolder
27
- }
28
- })
29
- </script>
30
-
31
- <style scoped>
32
- .dl-text-holder-demo {
33
- display: flex;
34
- flex-wrap: wrap;
35
- resize: horizontal;
36
- overflow: auto;
37
- width: 300px;
38
- box-shadow: var(--dl-menu-shadow);
39
- padding: 5px;
40
- word-wrap: break-word;
41
- }
42
- </style>