@dataloop-ai/components 0.17.134 → 0.18.1

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 (180) hide show
  1. package/package.json +3 -1
  2. package/src/App.vue +5 -227
  3. package/src/assets/globals.scss +4 -0
  4. package/src/components/basic/DlAccordion/DlAccordion.vue +26 -4
  5. package/src/components/basic/DlButton/DlButton.vue +2 -6
  6. package/src/components/basic/DlChip/DlChip.vue +1 -5
  7. package/src/components/basic/DlEmptyState/DlEmptyState.vue +282 -0
  8. package/src/components/basic/DlEmptyState/index.ts +2 -0
  9. package/src/components/basic/DlEmptyState/types.ts +20 -0
  10. package/src/components/basic/DlListItem/DlListItem.vue +96 -63
  11. package/src/components/basic/DlListItem/utils.ts +0 -3
  12. package/src/components/basic/DlPanelContainer/DlPanelContainer.vue +35 -12
  13. package/src/components/basic/DlPopup/DlPopup.vue +29 -7
  14. package/src/components/basic/DlWidget/DlWidget.vue +32 -4
  15. package/src/components/basic/index.ts +2 -1
  16. package/src/components/basic/types.ts +2 -0
  17. package/src/components/compound/DlCard/DlCard.vue +796 -0
  18. package/src/components/compound/DlCard/components/DescriptionModal.vue +137 -0
  19. package/src/components/compound/DlCard/types.ts +38 -0
  20. package/src/components/compound/DlCharts/charts/DlBarChart/DlBarChart.vue +35 -3
  21. package/src/components/compound/DlCharts/charts/DlColumnChart/DlColumnChart.vue +51 -12
  22. package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +71 -14
  23. package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChart.vue +28 -4
  24. package/src/components/compound/DlCharts/charts/DlDoughnutChart/components/DlDoughnutChartLegend.vue +1 -1
  25. package/src/components/compound/DlCharts/charts/DlLineChart/DlLineChart.vue +46 -8
  26. package/src/components/compound/DlCharts/components/DlBrush.vue +2 -2
  27. package/src/components/compound/DlCharts/types/props.ts +5 -1
  28. package/src/components/compound/DlCharts/utils.ts +1 -1
  29. package/src/components/compound/DlCodeEditor/DlCodeEditor.vue +171 -0
  30. package/src/components/compound/DlCodeEditor/README.md +11 -0
  31. package/src/components/compound/DlCodeEditor/components/CodeEditor.vue +705 -0
  32. package/src/components/compound/DlCodeEditor/index.ts +3 -0
  33. package/src/components/compound/DlCodeEditor/styles/themes-base16.css +12809 -0
  34. package/src/components/compound/DlCodeEditor/styles/themes.css +3999 -0
  35. package/src/components/compound/DlCodeEditor/types.ts +21 -0
  36. package/src/components/compound/DlDateTime/DlDateTimeRange/{DlCardSidebar.vue → CardSidebar.vue} +10 -11
  37. package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +8 -8
  38. package/src/components/compound/DlDialogBox/DlDialogBox.vue +26 -2
  39. package/src/components/compound/DlInput/DlInput.vue +2 -2
  40. package/src/components/compound/DlOptionGroup/components/MenuItemWrapper.vue +2 -2
  41. package/src/components/compound/DlRange/DlRange.vue +2 -2
  42. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +1 -1
  43. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSuggestionsDropdown.vue +1 -1
  44. package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +10 -6
  45. package/src/components/compound/DlSelect/DlSelect.vue +78 -70
  46. package/src/components/compound/DlSlider/components/DlSliderBase.vue +2 -2
  47. package/src/components/compound/DlSlider/useSlider.ts +2 -2
  48. package/src/components/compound/DlStepper/DlStepper.vue +33 -3
  49. package/src/components/compound/DlStepper/components/DlStepperContent.vue +6 -2
  50. package/src/components/compound/DlStepper/components/DlStepperSidebar.vue +12 -6
  51. package/src/components/compound/DlTable/DlTable.vue +30 -4
  52. package/src/components/compound/DlTable/components/DlTd.vue +8 -8
  53. package/src/components/compound/DlTable/components/DlTh.vue +1 -1
  54. package/src/components/compound/DlTable/hooks/tableColumnSelection.ts +35 -40
  55. package/src/components/compound/DlTable/hooks/tableFilter.ts +33 -21
  56. package/src/components/compound/DlTable/hooks/tablePagination.ts +10 -13
  57. package/src/components/compound/DlTable/hooks/tableRowExpand.ts +2 -1
  58. package/src/components/compound/DlTable/hooks/tableRowSelection.ts +0 -1
  59. package/src/components/compound/DlTable/hooks/tableSort.ts +52 -47
  60. package/src/components/compound/DlThumbnailGallery/DlThumbnailGallery.vue +268 -0
  61. package/src/components/compound/DlThumbnailGallery/index.ts +2 -0
  62. package/src/components/compound/DlThumbnailGallery/types.ts +11 -0
  63. package/src/components/compound/DlTreeTable/DlTreeTable.vue +1293 -0
  64. package/src/components/compound/DlTreeTable/components/DlTdTree.vue +119 -0
  65. package/src/components/compound/DlTreeTable/components/DlTrTree.vue +52 -0
  66. package/src/components/compound/DlTreeTable/index.ts +3 -0
  67. package/src/components/compound/DlTreeTable/types.ts +1 -0
  68. package/src/components/compound/DlTreeTable/utils/convertToNestedObject.ts +51 -0
  69. package/src/components/compound/DlTreeTable/utils/flatTreeData.ts +19 -0
  70. package/src/components/compound/DlTreeTable/utils/getFromChildren.ts +39 -0
  71. package/src/components/compound/DlTreeTable/utils/trSpacing.ts +13 -0
  72. package/src/components/compound/DlTreeTable/utils/treeTableRowSelection.ts +184 -0
  73. package/src/components/compound/index.ts +5 -0
  74. package/src/components/compound/types.ts +2 -0
  75. package/src/components/essential/DlBadge/DlBadge.vue +3 -3
  76. package/src/components/essential/DlCheckbox/DlCheckbox.vue +6 -3
  77. package/src/components/essential/DlEllipsis/DlEllipsis.vue +18 -14
  78. package/src/components/essential/DlIcon/DlIcon.vue +1 -1
  79. package/src/components/essential/DlLabel/DlLabel.vue +174 -0
  80. package/src/components/essential/DlLabel/index.ts +2 -0
  81. package/src/components/essential/DlList/DlList.vue +2 -2
  82. package/src/components/essential/DlMenu/DlMenu.vue +26 -20
  83. package/src/components/essential/DlMenu/utils.ts +7 -6
  84. package/src/components/essential/DlPageLayout/DlPageLayout.vue +90 -0
  85. package/src/components/essential/DlPageLayout/index.ts +2 -0
  86. package/src/components/essential/DlSeparator/DlSeparator.vue +2 -2
  87. package/src/components/essential/DlThemeProvider/DlThemeProvider.vue +6 -0
  88. package/src/components/essential/index.ts +2 -1
  89. package/src/components/shared/DlTooltip/DlTooltip.vue +9 -10
  90. package/src/demos/BarChartDemo.vue +47 -2
  91. package/src/demos/ColumnChartDemo.vue +51 -2
  92. package/src/demos/DlAccordionDemo.vue +92 -43
  93. package/src/demos/DlCardDemo.vue +156 -19
  94. package/src/demos/DlChartDoughnutDemo.vue +49 -2
  95. package/src/demos/DlCheckboxDemo.vue +13 -0
  96. package/src/demos/DlCodeEditor/DlCodeEditorDemo.vue +247 -0
  97. package/src/demos/DlCodeEditor/index.ts +2 -0
  98. package/src/demos/DlConfusionMatrixDemo.vue +51 -6
  99. package/src/demos/DlDemoPage.vue +235 -0
  100. package/src/demos/DlDialogBoxDemo.vue +56 -51
  101. package/src/demos/DlDropdownButtonDemo.vue +1 -1
  102. package/src/demos/DlEmptyStateDemo.vue +81 -0
  103. package/src/demos/DlLabelDemo.vue +128 -0
  104. package/src/demos/DlLineChartDemo.vue +50 -2
  105. package/src/demos/DlListDemo.vue +12 -9
  106. package/src/demos/DlMenuDemo.vue +13 -14
  107. package/src/demos/DlPageLayoutDemo.vue +146 -0
  108. package/src/demos/DlPanelContainerDemo.vue +113 -2
  109. package/src/demos/DlPopupDemo.vue +51 -0
  110. package/src/demos/DlSelectDemo.vue +14 -5
  111. package/src/demos/DlStepperDemo/DlStepperDemo.vue +5 -1
  112. package/src/demos/DlStepperDemo/EmptyStateStepper.vue +149 -0
  113. package/src/demos/DlTableDemo.vue +65 -2
  114. package/src/demos/DlTabsDemo.vue +1 -1
  115. package/src/demos/DlThumbnailGalleryDemo.vue +99 -0
  116. package/src/demos/DlTreeTableDemo.vue +694 -0
  117. package/src/demos/DlWidgetDemo.vue +48 -3
  118. package/src/demos/index.ts +17 -4
  119. package/src/hooks/use-anchor.ts +14 -16
  120. package/src/hooks/use-model-toggle.ts +12 -14
  121. package/src/hooks/use-portal.ts +2 -2
  122. package/src/hooks/use-scroll-target.ts +2 -4
  123. package/src/hooks/use-size-observer.ts +3 -2
  124. package/src/hooks/use-transition.ts +10 -4
  125. package/src/index.ts +22 -1
  126. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetFooter.vue +78 -0
  127. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetHeader.vue +22 -0
  128. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetLeftDrawer.vue +96 -0
  129. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetMainContent.vue +51 -0
  130. package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetRightDrawer.vue +88 -0
  131. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/ActionsMenu.vue +70 -0
  132. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/AutomationMenu.vue +106 -0
  133. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardView.vue +101 -0
  134. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardViewGallery.vue +141 -0
  135. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardViewTable.vue +193 -0
  136. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/EmptyState/LayoutEmptyState.vue +227 -0
  137. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/EmptyState/UploadData.vue +106 -0
  138. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/MainContentImages.vue +540 -0
  139. package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/MainContentNav.vue +329 -0
  140. package/src/layouts/DlDatasetBrowser/DemoComponents/NavbarKpi.vue +84 -0
  141. package/src/layouts/DlDatasetBrowser/DemoComponents/NavbarSearch.vue +132 -0
  142. package/src/layouts/DlDatasetBrowser/DemoComponents/SearchFilterMenu.vue +19 -0
  143. package/src/layouts/DlDatasetBrowser/DemoComponents/filters/AddFilter.vue +212 -0
  144. package/src/layouts/DlDatasetBrowser/DemoComponents/types/imageMetadata.ts +28 -0
  145. package/src/layouts/DlDatasetBrowser/DlDatasetBrowser.vue +42 -0
  146. package/src/layouts/DlStudioLayout/DlStudioLayout.vue +42 -0
  147. package/src/layouts/DlStudioLayout/components/Demo/LeftMenuContent.vue +23 -0
  148. package/src/layouts/DlStudioLayout/components/Demo/StudioFooter.vue +25 -0
  149. package/src/layouts/DlStudioLayout/components/Demo/StudioHeader.vue +121 -0
  150. package/src/layouts/DlStudioLayout/components/Demo/StudioLeftDrawer.vue +245 -0
  151. package/src/layouts/DlStudioLayout/components/Demo/StudioMainContent.vue +31 -0
  152. package/src/layouts/DlStudioLayout/components/Demo/StudioTabsMenu.vue +117 -0
  153. package/src/layouts/DlStudioLayout/components/Demo/TabMenu/FilterMenu.vue +62 -0
  154. package/src/layouts/DlStudioLayout/components/Demo/TabMenu/TabMenuAnnotations.vue +98 -0
  155. package/src/layouts/DlStudioLayout/components/Demo/TabMenu/TabMenuItem.vue +66 -0
  156. package/src/layouts/DlStudioLayout/components/LayoutNavbar.vue +24 -0
  157. package/src/layouts/DlStudioLayout/components/ListAutocomplete.vue +149 -0
  158. package/src/layouts/DlStudioLayout/components/NavigationDrawer.vue +147 -0
  159. package/src/layouts/DlStudioLayout/index.ts +2 -0
  160. package/src/layouts/DlStudioLayout/types/HorizontalItems.ts +9 -0
  161. package/src/layouts/DlStudioLayout/types/VerticalItems.ts +10 -0
  162. package/src/simple-code-editor.d.ts +1 -0
  163. package/src/utils/click-outside.ts +1 -1
  164. package/src/utils/dom.ts +5 -5
  165. package/src/utils/events.ts +3 -3
  166. package/src/utils/global-nodes.ts +2 -2
  167. package/src/utils/is-ellipsis-active.ts +4 -1
  168. package/src/utils/portal.ts +5 -5
  169. package/src/utils/position-engine.ts +5 -5
  170. package/src/utils/render.ts +1 -1
  171. package/src/utils/scroll.ts +2 -2
  172. package/src/utils/selection.ts +3 -3
  173. package/vite.config.ts +9 -1
  174. package/src/components/basic/DlCard/DlCard.vue +0 -242
  175. package/src/components/basic/DlCard/types.ts +0 -20
  176. package/src/components/essential/DlTextHolder/DlTextHolder.vue +0 -93
  177. package/src/components/essential/DlTextHolder/index.ts +0 -2
  178. package/src/demos/DlTextHolderDemo.vue +0 -50
  179. /package/src/components/{basic → compound}/DlCard/index.ts +0 -0
  180. /package/src/components/compound/DlDateTime/DlDateTimeRange/{DlDateInput.vue → DateInput.vue} +0 -0
@@ -0,0 +1,174 @@
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
+ :text="text"
23
+ />
24
+ <dl-ellipsis
25
+ v-else
26
+ class="dl-label__text"
27
+ >
28
+ <slot name="default" />
29
+ </dl-ellipsis>
30
+ <span v-if="suffix"> {{ suffixPreview }}</span>
31
+ <div class="dl-label__suffix">
32
+ <div class="dl-label__suffix-slot">
33
+ <slot
34
+ v-if="mouseOver"
35
+ name="actions"
36
+ />
37
+ </div>
38
+ <dl-icon
39
+ v-if="hint"
40
+ class="dl-label__suffix-icon"
41
+ icon="icon-dl-info"
42
+ >
43
+ <dl-tooltip>{{ hint }}</dl-tooltip>
44
+ </dl-icon>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </template>
49
+
50
+ <script lang="ts">
51
+ import { v4 } from 'uuid'
52
+ import { DlTooltip } from '../../shared'
53
+ // todo: this will cause issues
54
+ import { DlIcon, DlEllipsis } from '../../essential'
55
+ import { computed, defineComponent, ref, toRef, toRefs } from 'vue-demi'
56
+ import { getColor } from '../../../utils'
57
+
58
+ export default defineComponent({
59
+ name: 'DlLabel',
60
+ components: { DlEllipsis, DlIcon, DlTooltip },
61
+ props: {
62
+ /**
63
+ * Text to be displayed
64
+ */
65
+ text: {
66
+ type: String,
67
+ default: ''
68
+ },
69
+ /**
70
+ * Prefix to be displayed
71
+ */
72
+ prefix: {
73
+ type: String,
74
+ default: null
75
+ },
76
+ /**
77
+ * Suffix to be displayed
78
+ */
79
+ suffix: {
80
+ type: String,
81
+ default: null
82
+ },
83
+ /**
84
+ * Color of the left side line
85
+ */
86
+ labelColor: {
87
+ type: String,
88
+ default: null
89
+ },
90
+ /**
91
+ * Text to be displayed inside the info tooltip
92
+ */
93
+ hint: {
94
+ type: String,
95
+ default: null
96
+ },
97
+ /**
98
+ * Label text color
99
+ */
100
+ color: {
101
+ type: String,
102
+ default: 'dl-color-darker'
103
+ }
104
+ },
105
+ setup(props, { emit, slots }) {
106
+ const mouseOver = ref(false)
107
+ const { labelColor, color, prefix, suffix } = toRefs(props)
108
+
109
+ const styles = computed<Record<string, any>>(() => {
110
+ return {
111
+ '--dl-label-color': getColor(labelColor.value),
112
+ '--dl-label-text-color': getColor(color.value)
113
+ }
114
+ })
115
+
116
+ const hasActions = computed(() => {
117
+ return !!slots['actions']
118
+ })
119
+
120
+ const prefixPreview = computed(() => {
121
+ return prefix.value?.trim() ?? ''
122
+ })
123
+ const suffixPreview = computed(() => {
124
+ return suffix.value?.trim() ?? ''
125
+ })
126
+
127
+ return {
128
+ uuid: `dl-text-holder-${v4()}`,
129
+ mouseOver,
130
+ styles,
131
+ hasActions,
132
+ prefixPreview,
133
+ suffixPreview
134
+ }
135
+ }
136
+ })
137
+ </script>
138
+
139
+ <style scoped lang="scss">
140
+ .dl-label {
141
+ display: flex;
142
+ flex-wrap: nowrap;
143
+ width: 100%;
144
+ white-space: nowrap;
145
+ position: relative;
146
+ &__line {
147
+ border-radius: 2px;
148
+ background-color: var(--dl-label-color);
149
+ width: 2px;
150
+ height: 100%;
151
+ margin-right: 5px;
152
+ }
153
+ &__suffix {
154
+ height: 100%;
155
+ margin-left: 5px;
156
+ display: flex;
157
+ align-items: center;
158
+ &-icon {
159
+ cursor: pointer;
160
+ }
161
+ }
162
+ &__content {
163
+ color: var(--dl-label-text-color);
164
+ display: flex;
165
+ width: 100%;
166
+ }
167
+ &__text {
168
+ flex-grow: 100;
169
+ overflow: hidden;
170
+ text-overflow: ellipsis;
171
+ white-space: nowrap;
172
+ }
173
+ }
174
+ </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
  }
@@ -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,
@@ -267,7 +267,7 @@ export default defineComponent({
267
267
  showPortal()
268
268
  configureScrollTarget()
269
269
 
270
- absoluteOffset = void 0
270
+ absoluteOffset = null
271
271
 
272
272
  const offsetOnShow = setOffsetOnShow(evt as TouchEvent, {
273
273
  contextMenu: props.contextMenu,
@@ -278,7 +278,7 @@ export default defineComponent({
278
278
 
279
279
  absoluteOffset = offsetOnShow as Record<any, any> | undefined
280
280
 
281
- if (unwatchPosition === void 0) {
281
+ if (!unwatchPosition) {
282
282
  unwatchPosition = watch(() => screen, updatePosition, {
283
283
  deep: true
284
284
  })
@@ -291,18 +291,21 @@ export default defineComponent({
291
291
  { continuous: true }
292
292
  )
293
293
 
294
- registerTimeout(() => {
295
- // required in order to avoid the "double-tap needed" issue
296
- avoidAutoClose = avoidAutoCloseFn(isMobile.value, {
297
- avoidAutoClose,
298
- autoClose: props.autoClose,
299
- innerRef
300
- })
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
+ })
301
302
 
302
- updatePosition()
303
- showPortal(true) // done showing portal
304
- emit('show', evt)
305
- }, props.transitionDuration)
303
+ updatePosition()
304
+ showPortal(true) // done showing portal
305
+ emit('show', evt)
306
+ },
307
+ isVue2 ? 5 : props.transitionDuration
308
+ )
306
309
  }
307
310
 
308
311
  function handleHide(evt: ClickOutsideEvent) {
@@ -314,14 +317,17 @@ export default defineComponent({
314
317
  anchorCleanup(true)
315
318
  refocusTarget = refocusTargetFn(evt, refocusTarget as HTMLElement)
316
319
 
317
- registerTimeout(() => {
318
- hidePortal(true) // done hiding, now destroy
319
- emit('hide', evt)
320
- }, props.transitionDuration)
320
+ registerTimeout(
321
+ () => {
322
+ hidePortal(true) // done hiding, now destroy
323
+ emit('hide', evt)
324
+ },
325
+ isVue2 ? 5 : props.transitionDuration
326
+ )
321
327
  }
322
328
 
323
329
  function anchorCleanup(hiding: boolean) {
324
- absoluteOffset = void 0
330
+ absoluteOffset = null
325
331
 
326
332
  unwatchPosition = updateUnwatchPosition(unwatchPosition)
327
333
 
@@ -337,7 +343,7 @@ export default defineComponent({
337
343
  }
338
344
 
339
345
  function configureScrollTarget() {
340
- if (anchorEl.value !== null || props.scrollTarget !== void 0) {
346
+ if (anchorEl.value !== null || props.scrollTarget) {
341
347
  (localScrollTarget as Ref<any>).value = getScrollTarget(
342
348
  anchorEl.value as HTMLElement,
343
349
  props.scrollTarget
@@ -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,7 +114,7 @@ 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
119
  evt.dlClickOutside !== true)
119
120
  ) {
@@ -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 }
@@ -40,7 +40,7 @@ export default defineComponent({
40
40
  case 'horizontal':
41
41
  styles = {
42
42
  backgroundColor: color,
43
- width: width ?? '300px',
43
+ width: width ?? 'auto',
44
44
  height: height ?? '1px',
45
45
  marginTop: indent,
46
46
  marginBottom: indent
@@ -50,7 +50,7 @@ export default defineComponent({
50
50
  styles = {
51
51
  backgroundColor: color,
52
52
  width: width ?? '1px',
53
- height: height ?? '300px',
53
+ height: height ?? 'auto',
54
54
  marginLeft: indent,
55
55
  marginRight: indent
56
56
  }
@@ -26,6 +26,9 @@ export default defineComponent({
26
26
 
27
27
  const isDarkTheme = ref(props.isDark)
28
28
 
29
+ // @ts-ignore
30
+ window.DlComponents?.setTheme(props.isDark ? 'dark' : 'light')
31
+
29
32
  provide('theme', isDarkTheme)
30
33
 
31
34
  watch(
@@ -36,6 +39,9 @@ export default defineComponent({
36
39
  'data-theme',
37
40
  getThemeModeAttr(isDark)
38
41
  ) // sets the dl data-theme attr
42
+
43
+ // @ts-ignore
44
+ window.DlComponents?.setTheme(props.isDark ? 'dark' : 'light')
39
45
  }
40
46
  )
41
47
  },
@@ -8,7 +8,7 @@ export * from './DlRadio'
8
8
  export * from './DlSkeleton'
9
9
  export * from './DlSwitch'
10
10
  export * from './DlEllipsis'
11
- export * from './DlTextHolder'
11
+ export * from './DlLabel'
12
12
  export * from './DlThemeProvider'
13
13
  export * from './DlTrend'
14
14
  export * from './DlTypography'
@@ -18,3 +18,4 @@ export * from './DlLink'
18
18
  export * from './DlColorPicker'
19
19
  export * from './DlSpinner'
20
20
  export * from './DlSeparator'
21
+ export * from './DlPageLayout'
@@ -116,7 +116,7 @@ export default defineComponent({
116
116
  },
117
117
  scrollTarget: {
118
118
  type: String as PropType<Element | string>,
119
- default: void 0
119
+ default: null
120
120
  },
121
121
  delay: {
122
122
  type: Number,
@@ -224,7 +224,7 @@ export default defineComponent({
224
224
  configureScrollTarget()
225
225
  })
226
226
 
227
- if (unwatchPosition === void 0) {
227
+ if (!unwatchPosition) {
228
228
  unwatchPosition = watch(
229
229
  () =>
230
230
  width +
@@ -258,14 +258,14 @@ export default defineComponent({
258
258
  }
259
259
 
260
260
  function anchorCleanup() {
261
- if (observer !== void 0) {
261
+ if (observer) {
262
262
  observer.disconnect()
263
- observer = void 0
263
+ observer = null
264
264
  }
265
265
 
266
- if (unwatchPosition !== void 0) {
266
+ if (unwatchPosition) {
267
267
  unwatchPosition()
268
- unwatchPosition = void 0
268
+ unwatchPosition = null
269
269
  }
270
270
 
271
271
  unconfigureScrollTarget()
@@ -369,7 +369,7 @@ export default defineComponent({
369
369
  }
370
370
 
371
371
  function configureScrollTarget() {
372
- if (anchorEl.value !== null || props.scrollTarget !== void 0) {
372
+ if (anchorEl.value !== null || props.scrollTarget) {
373
373
  (localScrollTarget as Ref<any>).value = getScrollTarget(
374
374
  anchorEl.value as HTMLElement,
375
375
  props.scrollTarget as Element
@@ -400,7 +400,7 @@ export default defineComponent({
400
400
 
401
401
  return {
402
402
  uuid: (attrs.id as string)?.length
403
- ? attrs.id
403
+ ? (attrs.id as string)
404
404
  : `dl-tooltip-${v4()}`,
405
405
  portalIsActive,
406
406
  classes: ['dl-tooltip dl-position-engine', attrs.class],
@@ -424,8 +424,7 @@ export default defineComponent({
424
424
  '--dl-tooltip-text-align': props.textAlignment,
425
425
  '--dl-tooltip-text-transform': props.capitalized
426
426
  ? 'capitalize'
427
- : 'none',
428
- '--dl-tooltip-padding': '--dl-tooltip-padding'
427
+ : 'none'
429
428
  }
430
429
  ] as any
431
430
  }
@@ -14,13 +14,57 @@
14
14
  :options="options"
15
15
  :items-in-view="6"
16
16
  />
17
+
18
+ <dl-bar-chart
19
+ :legend-props="legendProps"
20
+ :data="data"
21
+ :options="options"
22
+ :items-in-view="6"
23
+ is-empty
24
+ :empty-state-props="{
25
+ responsive: true,
26
+ style: 'min-height: 350px;',
27
+ bgSize: '130px',
28
+ bgImage: `url(https://raw.githubusercontent.com/dataloop-ai/icons/main/assets/usage.svg)`,
29
+ title: 'Lorem ipsum',
30
+ subtitle:
31
+ 'Lorem ipsum dolor sit amet consectetur. Senectus condimentum dolor sit',
32
+ info: 'To learn more about this analytics, read our documentation.'
33
+ }"
34
+ >
35
+ <template #links="">
36
+ <div style="display: flex; gap: 5px; padding: 0 20px">
37
+ <dl-button
38
+ padding="0px"
39
+ icon="icon-dl-sdk-documentation"
40
+ flat
41
+ uppercase
42
+ label="SDK"
43
+ />
44
+ <div class="break" />
45
+ <dl-button
46
+ padding="0px"
47
+ icon="icon-dl-file"
48
+ flat
49
+ label="Documentation"
50
+ />
51
+ <div class="break" />
52
+ <dl-button
53
+ padding="0px"
54
+ icon="icon-dl-youtube"
55
+ flat
56
+ label="Video"
57
+ />
58
+ </div>
59
+ </template>
60
+ </dl-bar-chart>
17
61
  </div>
18
62
  </template>
19
63
 
20
64
  <script lang="ts">
21
65
  import { defineComponent } from 'vue-demi'
22
66
  import { ChartOptions } from 'chart.js'
23
- import { DlBarChart } from '../components'
67
+ import { DlBarChart, DlButton } from '../components'
24
68
 
25
69
  const labelsFn = () => {
26
70
  const a = []
@@ -73,7 +117,8 @@ const options: ChartOptions = {
73
117
  export default defineComponent({
74
118
  name: 'DlChartDemo',
75
119
  components: {
76
- DlBarChart
120
+ DlBarChart,
121
+ DlButton
77
122
  },
78
123
  data() {
79
124
  return {
@@ -66,12 +66,60 @@
66
66
  :options="options[0]"
67
67
  style="width: 100%"
68
68
  />
69
+
70
+ <dl-column-chart
71
+ :brush-props="brushProps"
72
+ :display-brush="false"
73
+ :display-labels="false"
74
+ :display-legend="false"
75
+ :legend-props="legendProps"
76
+ :data="data[0]"
77
+ :options="options[0]"
78
+ style="width: 50%"
79
+ is-empty
80
+ :empty-state-props="{
81
+ responsive: true,
82
+ style: 'min-height: 350px;',
83
+ bgSize: '130px',
84
+ bgImage: `url(https://raw.githubusercontent.com/dataloop-ai/icons/main/assets/usage.svg)`,
85
+ title: 'Lorem ipsum',
86
+ subtitle:
87
+ 'Lorem ipsum dolor sit amet consectetur. Senectus condimentum dolor sit',
88
+ info: 'To learn more about this analytics, read our documentation.'
89
+ }"
90
+ >
91
+ <template #links="">
92
+ <div style="display: flex; gap: 5px; padding: 0 20px">
93
+ <dl-button
94
+ padding="0px"
95
+ icon="icon-dl-sdk-documentation"
96
+ flat
97
+ uppercase
98
+ label="SDK"
99
+ />
100
+ <div class="break" />
101
+ <dl-button
102
+ padding="0px"
103
+ icon="icon-dl-file"
104
+ flat
105
+ label="Documentation"
106
+ />
107
+ <div class="break" />
108
+ <dl-button
109
+ padding="0px"
110
+ icon="icon-dl-youtube"
111
+ flat
112
+ label="Video"
113
+ />
114
+ </div>
115
+ </template>
116
+ </dl-column-chart>
69
117
  </div>
70
118
  </template>
71
119
 
72
120
  <script lang="ts">
73
121
  import { defineComponent } from 'vue-demi'
74
- import { DlAvatar, DlColumnChart, DlTooltip } from '../components'
122
+ import { DlAvatar, DlColumnChart, DlTooltip, DlButton } from '../components'
75
123
 
76
124
  import { orderBy } from 'lodash'
77
125
 
@@ -229,7 +277,8 @@ export default defineComponent({
229
277
  components: {
230
278
  DlColumnChart,
231
279
  DlAvatar,
232
- DlTooltip
280
+ DlTooltip,
281
+ DlButton
233
282
  },
234
283
  data() {
235
284
  return {