@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,137 @@
1
+ <template>
2
+ <div @click="stopPropagationEvent">
3
+ <DlButton
4
+ flat
5
+ icon-color="dl-color-darker"
6
+ icon="icon-dl-edit"
7
+ size="s"
8
+ round
9
+ @click="openModal"
10
+ />
11
+ <dl-dialog-box
12
+ ref="modalOne"
13
+ v-model="isOpenedModal"
14
+ >
15
+ <template #header>
16
+ <dl-dialog-box-header
17
+ title="Description"
18
+ @onClose="closeModal"
19
+ />
20
+ </template>
21
+ <template #body>
22
+ <dl-text-area
23
+ v-model="descriptionValueComputed"
24
+ required
25
+ show-counter
26
+ enable-resize
27
+ placeholder="Type an item description"
28
+ :max-length="1000"
29
+ clear-button-tooltip
30
+ :error-message="errorMessage"
31
+ @focus="onFocusTextarea"
32
+ @blur="textAreaFocused = false"
33
+ />
34
+ </template>
35
+ <template #footer>
36
+ <dl-dialog-box-footer>
37
+ <dl-button
38
+ :disabled="isDisabledApplyButton"
39
+ @click="updateDescription"
40
+ >
41
+ Apply
42
+ </dl-button>
43
+ </dl-dialog-box-footer>
44
+ </template>
45
+ </dl-dialog-box>
46
+ </div>
47
+ </template>
48
+
49
+ <script lang="ts">
50
+ import {
51
+ defineComponent,
52
+ ref,
53
+ computed,
54
+ onMounted,
55
+ watch,
56
+ toRef
57
+ } from 'vue-demi'
58
+ import { DlButton, DlTextArea } from '../../../../components'
59
+ import DlDialogBox from '../../../compound/DlDialogBox/DlDialogBox.vue'
60
+ import DlDialogBoxHeader from '../../../compound/DlDialogBox/components/DlDialogBoxHeader.vue'
61
+ import DlDialogBoxFooter from '../../../compound/DlDialogBox/components/DlDialogBoxFooter.vue'
62
+
63
+ export default defineComponent({
64
+ name: 'DescriptionModal',
65
+ components: {
66
+ DlButton,
67
+ DlDialogBox,
68
+ DlDialogBoxHeader,
69
+ DlDialogBoxFooter,
70
+ DlTextArea
71
+ },
72
+ props: {
73
+ description: {
74
+ type: String,
75
+ default: ''
76
+ }
77
+ },
78
+ emits: ['onSubmit'],
79
+ setup(props, ctx) {
80
+ const isOpenedModal = ref<boolean>(false)
81
+ const textAreaValue = ref<string>('')
82
+ const textAreaFocused = ref<boolean>(false)
83
+ const errorMessage = ref<string>('')
84
+ const isDisabledApplyButton = ref<boolean>(true)
85
+ const MIN_LENGTH = 3
86
+ const descriptionRef = toRef(props, 'description')
87
+
88
+ const openModal = (): void => {
89
+ isOpenedModal.value = true
90
+ }
91
+ const closeModal = (): void => {
92
+ isOpenedModal.value = false
93
+ }
94
+ const updateDescription = (): void => {
95
+ ctx.emit('onSubmit', textAreaValue.value)
96
+ closeModal()
97
+ }
98
+ const onFocusTextarea = (): void => {
99
+ textAreaFocused.value = true
100
+ }
101
+ const descriptionValueComputed = computed<string>({
102
+ get() {
103
+ return descriptionRef.value
104
+ },
105
+ set(value) {
106
+ textAreaValue.value = value
107
+ }
108
+ })
109
+ const stopPropagationEvent: any = (event: MouseEvent) => {
110
+ event.stopPropagation()
111
+ }
112
+ watch(textAreaValue, (value) => {
113
+ isDisabledApplyButton.value = value.length < MIN_LENGTH
114
+ })
115
+ onMounted(() => {
116
+ isDisabledApplyButton.value =
117
+ descriptionValueComputed.value?.length <= 1
118
+ })
119
+
120
+ return {
121
+ isOpenedModal,
122
+ openModal,
123
+ closeModal,
124
+ textAreaValue,
125
+ textAreaFocused,
126
+ errorMessage,
127
+ isDisabledApplyButton,
128
+ updateDescription,
129
+ onFocusTextarea,
130
+ descriptionValueComputed,
131
+ stopPropagationEvent
132
+ }
133
+ }
134
+ })
135
+ </script>
136
+
137
+ <style scoped></style>
@@ -0,0 +1,38 @@
1
+ export type DlCardTagType = {
2
+ label: string
3
+ color?: string
4
+ textColor?: string
5
+ }
6
+
7
+ export type DlCardImageType = {
8
+ src: string
9
+ styles?: string
10
+ alt?: string
11
+ link?: {
12
+ href: string
13
+ icon: string
14
+ color?: string
15
+ backgroundColor?: string
16
+ size?: string
17
+ }
18
+ }
19
+
20
+ export type DlCardIconType = {
21
+ icon: string
22
+ color?: string
23
+ size?: string
24
+ styles: string
25
+ }
26
+
27
+ export type DlCardHintType = {
28
+ icon: string
29
+ color?: string
30
+ }
31
+
32
+ export type DlCardLinkType = {
33
+ title: string
34
+ href: string
35
+ icon?: string
36
+ newtab?: boolean
37
+ external?: boolean
38
+ }
@@ -4,7 +4,22 @@
4
4
  class="canvas-container"
5
5
  :style="`height: ${wrapperHeight}`"
6
6
  >
7
+ <dl-empty-state
8
+ v-if="isEmpty"
9
+ v-bind="emptyStateProps"
10
+ >
11
+ <template
12
+ v-for="(_, slot) in $slots"
13
+ #[slot]="props"
14
+ >
15
+ <slot
16
+ :name="slot"
17
+ v-bind="props"
18
+ />
19
+ </template>
20
+ </dl-empty-state>
7
21
  <Bar
22
+ v-if="!isEmpty"
8
23
  :id="id"
9
24
  ref="barChart"
10
25
  :class="chartClasses"
@@ -15,7 +30,7 @@
15
30
  @wheel.native="handleChartScroll"
16
31
  />
17
32
  <dl-chart-scroll-bar
18
- v-if="maxItems > thisItemsInView"
33
+ v-if="!isEmpty || (maxItems > thisItemsInView && !isEmpty)"
19
34
  :wrapper-styles="{
20
35
  marginTop: '10px'
21
36
  }"
@@ -28,10 +43,12 @@
28
43
  />
29
44
  </div>
30
45
  <slot
46
+ v-if="!isEmpty"
31
47
  v-bind="{ labels: xLabels, chartWidth }"
32
48
  name="axe-x-labels"
33
49
  />
34
50
  <slot
51
+ v-if="!isEmpty"
35
52
  v-bind="{
36
53
  data: legendDatasets,
37
54
  chartWidth,
@@ -46,7 +63,7 @@
46
63
  :datasets="legendDatasets"
47
64
  :width="chartWidth"
48
65
  :class="legendClasses"
49
- :align-items="legendProperties.alignItems"
66
+ :align-items="legendProps.alignItems"
50
67
  @hide="hideData"
51
68
  @on-hover="onHoverLegend"
52
69
  @on-leave="onLeaveLegend"
@@ -62,7 +79,14 @@ import {
62
79
  BarChartProps,
63
80
  defaultBarChartProps
64
81
  } from '../../types/props'
65
- import { defineComponent, reactive, ref, watch, computed } from 'vue-demi'
82
+ import {
83
+ defineComponent,
84
+ reactive,
85
+ ref,
86
+ watch,
87
+ computed,
88
+ PropType
89
+ } from 'vue-demi'
66
90
  import DlChartLegend from '../../components/DlChartLegend.vue'
67
91
  import DlChartScrollBar from '../../components/DlChartScrollBar.vue'
68
92
  import { updateKey } from '../../../../../utils/update-key'
@@ -82,6 +106,8 @@ import type { Chart, ChartMeta, ChartDataset, ActiveElement } from 'chart.js'
82
106
  import { isEqual, merge } from 'lodash'
83
107
  import { rgba2hex, hexToRgbA, revertRGBAOpacity } from '../../../../../utils'
84
108
  import { useThemeVariables } from '../../../../../hooks/use-theme'
109
+ import { DlEmptyStateProps } from '../../../../basic/DlEmptyState/types'
110
+ import DlEmptyState from '../../../../basic/DlEmptyState/DlEmptyState.vue'
85
111
 
86
112
  ChartJS.register(
87
113
  CategoryScale,
@@ -98,7 +124,8 @@ export default defineComponent({
98
124
  components: {
99
125
  Bar,
100
126
  DlChartScrollBar,
101
- DlChartLegend
127
+ DlChartLegend,
128
+ DlEmptyState
102
129
  },
103
130
  props: {
104
131
  ...CommonProps,
@@ -110,6 +137,11 @@ export default defineComponent({
110
137
  id: {
111
138
  type: String,
112
139
  default: null
140
+ },
141
+ isEmpty: Boolean,
142
+ emptyStateProps: {
143
+ type: Object as PropType<DlEmptyStateProps>,
144
+ default: null
113
145
  }
114
146
  },
115
147
  setup(props) {
@@ -225,6 +257,9 @@ export default defineComponent({
225
257
  if (event.type !== 'mousemove') {
226
258
  return
227
259
  }
260
+ const hover = !!document.querySelector('.drag-clone')
261
+ chartJS.options.plugins.tooltip.enabled = !hover
262
+ if (hover) return
228
263
  if (
229
264
  items.length === 0 ||
230
265
  chartJS.getElementsAtEventForMode(
@@ -3,7 +3,22 @@
3
3
  :style="cssVars"
4
4
  :class="chartWrapperClasses"
5
5
  >
6
+ <dl-empty-state
7
+ v-if="isEmpty"
8
+ v-bind="emptyStateProps"
9
+ >
10
+ <template
11
+ v-for="(_, slot) in $slots"
12
+ #[slot]="props"
13
+ >
14
+ <slot
15
+ :name="slot"
16
+ v-bind="props"
17
+ />
18
+ </template>
19
+ </dl-empty-state>
6
20
  <Bar
21
+ v-if="!isEmpty"
7
22
  :id="id"
8
23
  ref="columnChart"
9
24
  :class="chartClasses"
@@ -13,12 +28,12 @@
13
28
  @mouseout="onChartLeave"
14
29
  />
15
30
  <slot
16
- v-if="displayLabels"
31
+ v-if="!isEmpty || displayLabels"
17
32
  v-bind="{ ...labelStyles, labels: xLabels, chartWidth }"
18
33
  name="axe-x-labels"
19
34
  >
20
35
  <dl-chart-labels
21
- :font-size="labelStyles.labelSize"
36
+ :font-size="labelStyles.fontSize"
22
37
  :title="labelStyles.title"
23
38
  :title-size="labelStyles.titleSize"
24
39
  :title-color="labelStyles.titleColor"
@@ -28,7 +43,7 @@
28
43
  />
29
44
  </slot>
30
45
  <slot
31
- v-if="displayBrush"
46
+ v-if="displayBrush || !isEmpty"
32
47
  v-bind="{
33
48
  chartWidth,
34
49
  modelValue: brush.value,
@@ -52,7 +67,7 @@
52
67
  />
53
68
  </slot>
54
69
  <slot
55
- v-if="displayLegend"
70
+ v-if="displayLegend || !isEmpty"
56
71
  v-bind="{
57
72
  data: legendDatasets,
58
73
  chartWidth,
@@ -81,14 +96,23 @@ import { Bar } from '../../types/typedCharts'
81
96
  import {
82
97
  CommonProps,
83
98
  ColumnChartProps,
84
- defaultColumnChartProps
99
+ defaultColumnChartProps,
100
+ CommonPropsType,
101
+ ColumnChartPropsType
85
102
  } from '../../types/props'
86
- import { defineComponent, reactive, watch, ref, computed } from 'vue-demi'
103
+ import {
104
+ defineComponent,
105
+ reactive,
106
+ watch,
107
+ ref,
108
+ computed,
109
+ PropType
110
+ } from 'vue-demi'
87
111
  import DlBrush from '../../components/DlBrush.vue'
88
112
  import DlChartLegend from '../../components/DlChartLegend.vue'
89
113
  import DlChartLabels from '../../components/DlChartLabels.vue'
90
114
  import { updateKey } from '../../../../../utils/update-key'
91
- import { rgba2hex, hexToRgbA, revertRGBAOpacity } from '../../../../../utils'
115
+ import { hexToRgbA } from '../../../../../utils'
92
116
  import {
93
117
  Chart as ChartJS,
94
118
  Title,
@@ -99,10 +123,20 @@ import {
99
123
  LinearScale,
100
124
  PointElement,
101
125
  LineElement,
126
+ DatasetController,
102
127
  BarControllerDatasetOptions
103
128
  } from 'chart.js'
104
- import type { Chart, ChartMeta, ChartDataset, ActiveElement } from 'chart.js'
105
- import { unionBy, orderBy, merge, isEqual } from 'lodash'
129
+ import DlEmptyState from '../../../../basic/DlEmptyState/DlEmptyState.vue'
130
+ import { DlEmptyStateProps } from '../../../../basic/DlEmptyState/types'
131
+ import type {
132
+ Chart,
133
+ ChartMeta,
134
+ ChartDataset,
135
+ ActiveElement,
136
+ ChartData
137
+ } from 'chart.js'
138
+ import { unionBy, orderBy, merge, isEqual, cloneDeep } from 'lodash'
139
+ import { updateKeys } from '../../../../../utils/update-key'
106
140
  import { useThemeVariables } from '../../../../../hooks/use-theme'
107
141
  import { getMaxDatasetValue } from '../../utils'
108
142
 
@@ -117,23 +151,36 @@ ChartJS.register(
117
151
  LineElement
118
152
  )
119
153
 
154
+ type ComponentType = {
155
+ id: string
156
+ isEmpty: boolean
157
+ emptyStateProps: DlEmptyStateProps
158
+ } & CommonPropsType &
159
+ ColumnChartPropsType
160
+
120
161
  export default defineComponent({
121
162
  name: 'DlColumnChart',
122
163
  components: {
123
164
  DlBrush,
124
165
  DlChartLegend,
125
166
  Bar,
126
- DlChartLabels
167
+ DlChartLabels,
168
+ DlEmptyState
127
169
  },
128
170
  props: {
129
171
  id: {
130
172
  type: String,
131
173
  default: null
132
174
  },
175
+ isEmpty: Boolean,
176
+ emptyStateProps: {
177
+ type: Object as PropType<DlEmptyStateProps>,
178
+ default: null
179
+ },
133
180
  ...CommonProps,
134
181
  ...ColumnChartProps
135
- },
136
- setup(props, { slots }) {
182
+ } as { [key: string]: any },
183
+ setup(props) {
137
184
  const { variables } = useThemeVariables()
138
185
 
139
186
  const chartWidth = ref('100%')
@@ -144,7 +191,7 @@ export default defineComponent({
144
191
 
145
192
  const onResize = (
146
193
  chart: Chart,
147
- size: { height: number; width: number }
194
+ _size: { height: number; width: number }
148
195
  ) => {
149
196
  if (chart?.scales?.x?.width) {
150
197
  chartWidth.value = `${
@@ -154,15 +201,15 @@ export default defineComponent({
154
201
  }
155
202
  }
156
203
 
157
- const chart = computed(() => {
158
- return columnChart.value?.chart?.value || {}
159
- })
160
-
161
204
  const replaceColor = (key: keyof typeof variables) =>
162
205
  variables[key] || key
163
206
 
164
207
  const columnChart = ref(null)
165
208
 
209
+ const chart = computed(() => {
210
+ return columnChart.value?.chart?.value || {}
211
+ })
212
+
166
213
  const brush = reactive({
167
214
  value: {
168
215
  min: 0,
@@ -232,9 +279,49 @@ export default defineComponent({
232
279
  props.legendProps?.datasets || [],
233
280
  props.data?.datasets || [],
234
281
  'label'
235
- )
282
+ ) as { [key: string]: any }[]
236
283
  )
237
284
 
285
+ const getChartBackup = () => {
286
+ if (!chart.value) {
287
+ return {
288
+ data: {},
289
+ options: {}
290
+ }
291
+ }
292
+ const datasets: DatasetController<'bar'> = updateKeys(
293
+ props.data.datasets,
294
+ [
295
+ 'backgroundColor',
296
+ 'pointBackgroundColor',
297
+ 'pointBorderColor',
298
+ 'borderColor',
299
+ 'hoverBorderColor',
300
+ 'hoverBackgroundColor',
301
+ 'pointHoverBackgroundColor',
302
+ 'pointHoverBorderColor'
303
+ ],
304
+ replaceColor
305
+ ).map((item: BarControllerDatasetOptions) => {
306
+ return {
307
+ ...item,
308
+ backgroundColor:
309
+ item.backgroundColor ||
310
+ hexToRgbA(item.backgroundColor as string, 0.2)
311
+ }
312
+ })
313
+
314
+ const chartProps = cloneDeep({
315
+ options: props.options,
316
+ data: {
317
+ ...props.data,
318
+ datasets
319
+ }
320
+ })
321
+
322
+ return chartProps
323
+ }
324
+
238
325
  const onChartLeave = () => {
239
326
  if (chartHoverDataset.value) {
240
327
  const filteredItems = chart.value.data.datasets
@@ -247,11 +334,16 @@ export default defineComponent({
247
334
  dataset.label !== chartHoverDataset.value.label
248
335
  )
249
336
 
337
+ const backup = getChartBackup()
338
+
250
339
  for (const dataset of filteredItems) {
251
- chart.value.data.datasets[dataset.index].backgroundColor =
252
- rgba2hex(revertRGBAOpacity(dataset.backgroundColor))
340
+ chart.value.data.datasets[dataset.index].backgroundColor = (
341
+ backup.data as ChartData<'line'>
342
+ ).datasets[dataset.index].backgroundColor
253
343
  }
344
+
254
345
  chart.value.update()
346
+
255
347
  chartHoverDataset.value = null
256
348
  }
257
349
  }
@@ -286,13 +378,11 @@ export default defineComponent({
286
378
  dataset.label !== chartHoverDataset.value.label
287
379
  )
288
380
 
381
+ const backup = getChartBackup()
289
382
  for (const dataset of filteredItems) {
290
- chartJS.data.datasets[dataset.index].backgroundColor =
291
- rgba2hex(
292
- revertRGBAOpacity(
293
- dataset.backgroundColor as string
294
- )
295
- )
383
+ chartJS.data.datasets[dataset.index].backgroundColor = (
384
+ backup.data as ChartData<'bar'>
385
+ ).datasets[dataset.index].backgroundColor
296
386
  }
297
387
  chartJS.update()
298
388
 
@@ -337,13 +427,12 @@ export default defineComponent({
337
427
  dataset.label !== chartHoverDataset.value.label
338
428
  )
339
429
 
430
+ const backup = getChartBackup()
431
+
340
432
  for (const dataset of filteredItems) {
341
- chartJS.data.datasets[dataset.index].backgroundColor =
342
- rgba2hex(
343
- revertRGBAOpacity(
344
- dataset.backgroundColor as string
345
- )
346
- )
433
+ chartJS.data.datasets[dataset.index].backgroundColor = (
434
+ backup.data as ChartData<'bar'>
435
+ ).datasets[dataset.index].backgroundColor
347
436
  }
348
437
 
349
438
  chartHoverDataset.value = datasetItem
@@ -420,7 +509,7 @@ export default defineComponent({
420
509
  const xLabels = ref(props.data.labels)
421
510
 
422
511
  const onHoverLegend = (
423
- item: BarControllerDatasetOptions,
512
+ _item: BarControllerDatasetOptions,
424
513
  index: number
425
514
  ) => {
426
515
  const filteredItems = chart.value.data.datasets
@@ -448,7 +537,7 @@ export default defineComponent({
448
537
  })
449
538
 
450
539
  const onLeaveLegend = (
451
- item: BarControllerDatasetOptions,
540
+ _item: BarControllerDatasetOptions,
452
541
  index: number
453
542
  ) => {
454
543
  const filteredItems = chart.value.data.datasets
@@ -461,9 +550,12 @@ export default defineComponent({
461
550
  dataset.index !== index
462
551
  )
463
552
 
553
+ const backup = getChartBackup()
554
+
464
555
  for (const dataset of filteredItems) {
465
- chart.value.data.datasets[dataset.index].backgroundColor =
466
- rgba2hex(revertRGBAOpacity(dataset.backgroundColor))
556
+ chart.value.data.datasets[dataset.index].backgroundColor = (
557
+ backup.data as ChartData<'bar'>
558
+ ).datasets[dataset.index].backgroundColor
467
559
  }
468
560
  chart.value.update()
469
561
  }