@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.
- package/package.json +3 -1
- package/src/App.vue +5 -227
- package/src/assets/globals.scss +4 -0
- package/src/components/basic/DlAccordion/DlAccordion.vue +26 -4
- package/src/components/basic/DlButton/DlButton.vue +2 -6
- package/src/components/basic/DlChip/DlChip.vue +1 -5
- package/src/components/basic/DlEmptyState/DlEmptyState.vue +282 -0
- package/src/components/basic/DlEmptyState/index.ts +2 -0
- package/src/components/basic/DlEmptyState/types.ts +20 -0
- package/src/components/basic/DlListItem/DlListItem.vue +96 -63
- package/src/components/basic/DlListItem/utils.ts +0 -3
- package/src/components/basic/DlPanelContainer/DlPanelContainer.vue +35 -12
- package/src/components/basic/DlPopup/DlPopup.vue +29 -7
- package/src/components/basic/DlWidget/DlWidget.vue +32 -4
- package/src/components/basic/index.ts +2 -1
- package/src/components/basic/types.ts +2 -0
- package/src/components/compound/DlCard/DlCard.vue +796 -0
- package/src/components/compound/DlCard/components/DescriptionModal.vue +137 -0
- package/src/components/compound/DlCard/types.ts +38 -0
- package/src/components/compound/DlCharts/charts/DlBarChart/DlBarChart.vue +35 -3
- package/src/components/compound/DlCharts/charts/DlColumnChart/DlColumnChart.vue +51 -12
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +71 -14
- package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChart.vue +28 -4
- package/src/components/compound/DlCharts/charts/DlDoughnutChart/components/DlDoughnutChartLegend.vue +1 -1
- package/src/components/compound/DlCharts/charts/DlLineChart/DlLineChart.vue +46 -8
- package/src/components/compound/DlCharts/components/DlBrush.vue +2 -2
- package/src/components/compound/DlCharts/types/props.ts +5 -1
- package/src/components/compound/DlCharts/utils.ts +1 -1
- package/src/components/compound/DlCodeEditor/DlCodeEditor.vue +171 -0
- package/src/components/compound/DlCodeEditor/README.md +11 -0
- package/src/components/compound/DlCodeEditor/components/CodeEditor.vue +705 -0
- package/src/components/compound/DlCodeEditor/index.ts +3 -0
- package/src/components/compound/DlCodeEditor/styles/themes-base16.css +12809 -0
- package/src/components/compound/DlCodeEditor/styles/themes.css +3999 -0
- package/src/components/compound/DlCodeEditor/types.ts +21 -0
- package/src/components/compound/DlDateTime/DlDateTimeRange/{DlCardSidebar.vue → CardSidebar.vue} +10 -11
- package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +8 -8
- package/src/components/compound/DlDialogBox/DlDialogBox.vue +26 -2
- package/src/components/compound/DlInput/DlInput.vue +2 -2
- package/src/components/compound/DlOptionGroup/components/MenuItemWrapper.vue +2 -2
- package/src/components/compound/DlRange/DlRange.vue +2 -2
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +1 -1
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSuggestionsDropdown.vue +1 -1
- package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +10 -6
- package/src/components/compound/DlSelect/DlSelect.vue +78 -70
- package/src/components/compound/DlSlider/components/DlSliderBase.vue +2 -2
- package/src/components/compound/DlSlider/useSlider.ts +2 -2
- package/src/components/compound/DlStepper/DlStepper.vue +33 -3
- package/src/components/compound/DlStepper/components/DlStepperContent.vue +6 -2
- package/src/components/compound/DlStepper/components/DlStepperSidebar.vue +12 -6
- package/src/components/compound/DlTable/DlTable.vue +30 -4
- package/src/components/compound/DlTable/components/DlTd.vue +8 -8
- package/src/components/compound/DlTable/components/DlTh.vue +1 -1
- package/src/components/compound/DlTable/hooks/tableColumnSelection.ts +35 -40
- package/src/components/compound/DlTable/hooks/tableFilter.ts +33 -21
- package/src/components/compound/DlTable/hooks/tablePagination.ts +10 -13
- package/src/components/compound/DlTable/hooks/tableRowExpand.ts +2 -1
- package/src/components/compound/DlTable/hooks/tableRowSelection.ts +0 -1
- package/src/components/compound/DlTable/hooks/tableSort.ts +52 -47
- package/src/components/compound/DlThumbnailGallery/DlThumbnailGallery.vue +268 -0
- package/src/components/compound/DlThumbnailGallery/index.ts +2 -0
- package/src/components/compound/DlThumbnailGallery/types.ts +11 -0
- package/src/components/compound/DlTreeTable/DlTreeTable.vue +1293 -0
- package/src/components/compound/DlTreeTable/components/DlTdTree.vue +119 -0
- package/src/components/compound/DlTreeTable/components/DlTrTree.vue +52 -0
- package/src/components/compound/DlTreeTable/index.ts +3 -0
- package/src/components/compound/DlTreeTable/types.ts +1 -0
- package/src/components/compound/DlTreeTable/utils/convertToNestedObject.ts +51 -0
- package/src/components/compound/DlTreeTable/utils/flatTreeData.ts +19 -0
- package/src/components/compound/DlTreeTable/utils/getFromChildren.ts +39 -0
- package/src/components/compound/DlTreeTable/utils/trSpacing.ts +13 -0
- package/src/components/compound/DlTreeTable/utils/treeTableRowSelection.ts +184 -0
- package/src/components/compound/index.ts +5 -0
- package/src/components/compound/types.ts +2 -0
- package/src/components/essential/DlBadge/DlBadge.vue +3 -3
- package/src/components/essential/DlCheckbox/DlCheckbox.vue +6 -3
- package/src/components/essential/DlEllipsis/DlEllipsis.vue +18 -14
- package/src/components/essential/DlIcon/DlIcon.vue +1 -1
- package/src/components/essential/DlLabel/DlLabel.vue +174 -0
- package/src/components/essential/DlLabel/index.ts +2 -0
- package/src/components/essential/DlList/DlList.vue +2 -2
- package/src/components/essential/DlMenu/DlMenu.vue +26 -20
- package/src/components/essential/DlMenu/utils.ts +7 -6
- package/src/components/essential/DlPageLayout/DlPageLayout.vue +90 -0
- package/src/components/essential/DlPageLayout/index.ts +2 -0
- package/src/components/essential/DlSeparator/DlSeparator.vue +2 -2
- package/src/components/essential/DlThemeProvider/DlThemeProvider.vue +6 -0
- package/src/components/essential/index.ts +2 -1
- package/src/components/shared/DlTooltip/DlTooltip.vue +9 -10
- package/src/demos/BarChartDemo.vue +47 -2
- package/src/demos/ColumnChartDemo.vue +51 -2
- package/src/demos/DlAccordionDemo.vue +92 -43
- package/src/demos/DlCardDemo.vue +156 -19
- package/src/demos/DlChartDoughnutDemo.vue +49 -2
- package/src/demos/DlCheckboxDemo.vue +13 -0
- package/src/demos/DlCodeEditor/DlCodeEditorDemo.vue +247 -0
- package/src/demos/DlCodeEditor/index.ts +2 -0
- package/src/demos/DlConfusionMatrixDemo.vue +51 -6
- package/src/demos/DlDemoPage.vue +235 -0
- package/src/demos/DlDialogBoxDemo.vue +56 -51
- package/src/demos/DlDropdownButtonDemo.vue +1 -1
- package/src/demos/DlEmptyStateDemo.vue +81 -0
- package/src/demos/DlLabelDemo.vue +128 -0
- package/src/demos/DlLineChartDemo.vue +50 -2
- package/src/demos/DlListDemo.vue +12 -9
- package/src/demos/DlMenuDemo.vue +13 -14
- package/src/demos/DlPageLayoutDemo.vue +146 -0
- package/src/demos/DlPanelContainerDemo.vue +113 -2
- package/src/demos/DlPopupDemo.vue +51 -0
- package/src/demos/DlSelectDemo.vue +14 -5
- package/src/demos/DlStepperDemo/DlStepperDemo.vue +5 -1
- package/src/demos/DlStepperDemo/EmptyStateStepper.vue +149 -0
- package/src/demos/DlTableDemo.vue +65 -2
- package/src/demos/DlTabsDemo.vue +1 -1
- package/src/demos/DlThumbnailGalleryDemo.vue +99 -0
- package/src/demos/DlTreeTableDemo.vue +694 -0
- package/src/demos/DlWidgetDemo.vue +48 -3
- package/src/demos/index.ts +17 -4
- package/src/hooks/use-anchor.ts +14 -16
- package/src/hooks/use-model-toggle.ts +12 -14
- package/src/hooks/use-portal.ts +2 -2
- package/src/hooks/use-scroll-target.ts +2 -4
- package/src/hooks/use-size-observer.ts +3 -2
- package/src/hooks/use-transition.ts +10 -4
- package/src/index.ts +22 -1
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetFooter.vue +78 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetHeader.vue +22 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetLeftDrawer.vue +96 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetMainContent.vue +51 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetRightDrawer.vue +88 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/ActionsMenu.vue +70 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/AutomationMenu.vue +106 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardView.vue +101 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardViewGallery.vue +141 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardViewTable.vue +193 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/EmptyState/LayoutEmptyState.vue +227 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/EmptyState/UploadData.vue +106 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/MainContentImages.vue +540 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/MainContentNav.vue +329 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/NavbarKpi.vue +84 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/NavbarSearch.vue +132 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/SearchFilterMenu.vue +19 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/filters/AddFilter.vue +212 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/types/imageMetadata.ts +28 -0
- package/src/layouts/DlDatasetBrowser/DlDatasetBrowser.vue +42 -0
- package/src/layouts/DlStudioLayout/DlStudioLayout.vue +42 -0
- package/src/layouts/DlStudioLayout/components/Demo/LeftMenuContent.vue +23 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioFooter.vue +25 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioHeader.vue +121 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioLeftDrawer.vue +245 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioMainContent.vue +31 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioTabsMenu.vue +117 -0
- package/src/layouts/DlStudioLayout/components/Demo/TabMenu/FilterMenu.vue +62 -0
- package/src/layouts/DlStudioLayout/components/Demo/TabMenu/TabMenuAnnotations.vue +98 -0
- package/src/layouts/DlStudioLayout/components/Demo/TabMenu/TabMenuItem.vue +66 -0
- package/src/layouts/DlStudioLayout/components/LayoutNavbar.vue +24 -0
- package/src/layouts/DlStudioLayout/components/ListAutocomplete.vue +149 -0
- package/src/layouts/DlStudioLayout/components/NavigationDrawer.vue +147 -0
- package/src/layouts/DlStudioLayout/index.ts +2 -0
- package/src/layouts/DlStudioLayout/types/HorizontalItems.ts +9 -0
- package/src/layouts/DlStudioLayout/types/VerticalItems.ts +10 -0
- package/src/simple-code-editor.d.ts +1 -0
- package/src/utils/click-outside.ts +1 -1
- package/src/utils/dom.ts +5 -5
- package/src/utils/events.ts +3 -3
- package/src/utils/global-nodes.ts +2 -2
- package/src/utils/is-ellipsis-active.ts +4 -1
- package/src/utils/portal.ts +5 -5
- package/src/utils/position-engine.ts +5 -5
- package/src/utils/render.ts +1 -1
- package/src/utils/scroll.ts +2 -2
- package/src/utils/selection.ts +3 -3
- package/vite.config.ts +9 -1
- package/src/components/basic/DlCard/DlCard.vue +0 -242
- package/src/components/basic/DlCard/types.ts +0 -20
- package/src/components/essential/DlTextHolder/DlTextHolder.vue +0 -93
- package/src/components/essential/DlTextHolder/index.ts +0 -2
- package/src/demos/DlTextHolderDemo.vue +0 -50
- /package/src/components/{basic → compound}/DlCard/index.ts +0 -0
- /package/src/components/compound/DlDateTime/DlDateTimeRange/{DlDateInput.vue → DateInput.vue} +0 -0
|
@@ -122,6 +122,49 @@
|
|
|
122
122
|
/>
|
|
123
123
|
</template>
|
|
124
124
|
</dl-widget>
|
|
125
|
+
|
|
126
|
+
<dl-widget
|
|
127
|
+
is-empty
|
|
128
|
+
:empty-state-props="{
|
|
129
|
+
responsive: true,
|
|
130
|
+
style: 'min-height: 350px;',
|
|
131
|
+
bgSize: '130px',
|
|
132
|
+
bgImage: `url(https://raw.githubusercontent.com/dataloop-ai/icons/main/assets/usage.svg)`,
|
|
133
|
+
title: 'Lorem ipsum',
|
|
134
|
+
subtitle:
|
|
135
|
+
'Lorem ipsum dolor sit amet consectetur. Senectus condimentum dolor sit',
|
|
136
|
+
info: 'To learn more about this analytics, read our documentation.'
|
|
137
|
+
}"
|
|
138
|
+
>
|
|
139
|
+
<template #header>
|
|
140
|
+
<span>Widget 5</span>
|
|
141
|
+
</template>
|
|
142
|
+
<template #links="">
|
|
143
|
+
<div style="display: flex; gap: 5px; padding: 0 20px">
|
|
144
|
+
<dl-button
|
|
145
|
+
padding="0px"
|
|
146
|
+
icon="icon-dl-sdk-documentation"
|
|
147
|
+
flat
|
|
148
|
+
uppercase
|
|
149
|
+
label="SDK"
|
|
150
|
+
/>
|
|
151
|
+
<div class="break" />
|
|
152
|
+
<dl-button
|
|
153
|
+
padding="0px"
|
|
154
|
+
icon="icon-dl-file"
|
|
155
|
+
flat
|
|
156
|
+
label="Documentation"
|
|
157
|
+
/>
|
|
158
|
+
<div class="break" />
|
|
159
|
+
<dl-button
|
|
160
|
+
padding="0px"
|
|
161
|
+
icon="icon-dl-youtube"
|
|
162
|
+
flat
|
|
163
|
+
label="Video"
|
|
164
|
+
/>
|
|
165
|
+
</div>
|
|
166
|
+
</template>
|
|
167
|
+
</dl-widget>
|
|
125
168
|
</dl-grid>
|
|
126
169
|
</div>
|
|
127
170
|
</template>
|
|
@@ -133,7 +176,8 @@ import {
|
|
|
133
176
|
DlGrid,
|
|
134
177
|
DlBarChart,
|
|
135
178
|
DlGridLayout,
|
|
136
|
-
DlIcon
|
|
179
|
+
DlIcon,
|
|
180
|
+
DlButton
|
|
137
181
|
} from '../components'
|
|
138
182
|
|
|
139
183
|
const labelsFn = () => {
|
|
@@ -193,12 +237,13 @@ export default defineComponent({
|
|
|
193
237
|
DlGrid,
|
|
194
238
|
DlWidget,
|
|
195
239
|
DlBarChart,
|
|
196
|
-
DlIcon
|
|
240
|
+
DlIcon,
|
|
241
|
+
DlButton
|
|
197
242
|
},
|
|
198
243
|
setup() {
|
|
199
244
|
const layout = ref([
|
|
200
245
|
[1, 5, 2],
|
|
201
|
-
[3, 4]
|
|
246
|
+
[3, 4, 6]
|
|
202
247
|
])
|
|
203
248
|
|
|
204
249
|
const layouts = ref<DlGridLayout[]>([
|
package/src/demos/index.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import DlDemoPage from './DlDemoPage.vue'
|
|
2
|
+
export { DlDemoPage }
|
|
3
|
+
|
|
1
4
|
import AvatarDemo from './DlAvatarDemo.vue'
|
|
2
5
|
import DlAlertDemo from './DlAlertDemo.vue'
|
|
3
6
|
import DlProgressChartDemo from './DlProgressChartDemo.vue'
|
|
@@ -39,7 +42,7 @@ import DlBadgeDemo from './DlBadgeDemo.vue'
|
|
|
39
42
|
import DlTrendDemo from './DlTrendDemo.vue'
|
|
40
43
|
import DlWidgetDemo from './DlWidgetDemo.vue'
|
|
41
44
|
import DlRadioDemo from './DlRadioDemo.vue'
|
|
42
|
-
import
|
|
45
|
+
import DlLabel from './DlLabelDemo.vue'
|
|
43
46
|
import DlColumnChartDemo from './ColumnChartDemo.vue'
|
|
44
47
|
import DlBarChartDemo from './BarChartDemo.vue'
|
|
45
48
|
import DlSwitchDemo from './DlSwitchDemo.vue'
|
|
@@ -48,16 +51,21 @@ import DlChartDoughnutDemo from './DlChartDoughnutDemo.vue'
|
|
|
48
51
|
import DlLineChartDemo from './DlLineChartDemo.vue'
|
|
49
52
|
import DlScatterChartDemo from './DlScatterChartDemo.vue'
|
|
50
53
|
import DlSpinner from './DlSpinnerDemo.vue'
|
|
54
|
+
import DlEmptyStateDemo from './DlEmptyStateDemo.vue'
|
|
51
55
|
import DlConfusionMatrix from './DlConfusionMatrixDemo.vue'
|
|
52
56
|
import DlToggleButtonDemo from './DlToggleButtonDemo.vue'
|
|
53
57
|
import DlKpiDemo from './DlKpiDemo.vue'
|
|
54
58
|
import DlEllipsisDemo from './DlEllipsisDemo.vue'
|
|
55
59
|
import DlSeparatorDemo from './DlSeparatorDemo.vue'
|
|
56
60
|
import DlCardDemo from './DlCardDemo.vue'
|
|
61
|
+
import DlTreeTableDemo from './DlTreeTableDemo.vue'
|
|
57
62
|
import DlGridDemo from './DlGridDemo.vue'
|
|
58
63
|
import DlMarkupTableDemo from './DlMarkupTableDemo.vue'
|
|
59
64
|
import DlVirtualScrollDemo from './DlVirtualScrollDemo.vue'
|
|
60
65
|
import DlJsonEditorDemo from './DlJsonEditorDemo.vue'
|
|
66
|
+
import DlThumbnailGallery from './DlThumbnailGalleryDemo.vue'
|
|
67
|
+
import DlPageLayoutDemo from './DlPageLayoutDemo.vue'
|
|
68
|
+
import { DlCodeEditorDemo } from './DlCodeEditor'
|
|
61
69
|
|
|
62
70
|
export default {
|
|
63
71
|
AvatarDemo,
|
|
@@ -80,6 +88,7 @@ export default {
|
|
|
80
88
|
DlThDemo,
|
|
81
89
|
DlTdDemo,
|
|
82
90
|
DlTableDemo,
|
|
91
|
+
DlTreeTableDemo,
|
|
83
92
|
DlPaginationDemo,
|
|
84
93
|
DlDateTimeRangeDemo,
|
|
85
94
|
DlSmartSearchDemo,
|
|
@@ -101,7 +110,7 @@ export default {
|
|
|
101
110
|
DlTrendDemo,
|
|
102
111
|
DlWidgetDemo,
|
|
103
112
|
DlRadioDemo,
|
|
104
|
-
|
|
113
|
+
DlLabel,
|
|
105
114
|
DlToastDemo,
|
|
106
115
|
DlColumnChartDemo,
|
|
107
116
|
DlSwitchDemo,
|
|
@@ -110,14 +119,18 @@ export default {
|
|
|
110
119
|
DlLineChartDemo,
|
|
111
120
|
DlScatterChartDemo,
|
|
112
121
|
DlSpinner,
|
|
122
|
+
DlEmptyStateDemo,
|
|
123
|
+
DlEllipsisDemo,
|
|
113
124
|
DlConfusionMatrix,
|
|
114
125
|
DlToggleButtonDemo,
|
|
115
|
-
DlEllipsisDemo,
|
|
116
126
|
DlSeparatorDemo,
|
|
117
127
|
DlKpiDemo,
|
|
118
128
|
DlCardDemo,
|
|
119
129
|
DlGridDemo,
|
|
120
130
|
DlMarkupTableDemo,
|
|
121
131
|
DlVirtualScrollDemo,
|
|
122
|
-
DlJsonEditorDemo
|
|
132
|
+
DlJsonEditorDemo,
|
|
133
|
+
DlThumbnailGallery,
|
|
134
|
+
DlCodeEditorDemo,
|
|
135
|
+
DlPageLayoutDemo
|
|
123
136
|
}
|
package/src/hooks/use-anchor.ts
CHANGED
|
@@ -15,6 +15,14 @@ interface AnchorEvent extends KeyboardEvent {
|
|
|
15
15
|
dlAnchorHandled?: boolean
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
interface AnchorElements {
|
|
19
|
+
hide: Function
|
|
20
|
+
toggle?: Function
|
|
21
|
+
toggleKey: Function
|
|
22
|
+
contextClick: Function
|
|
23
|
+
prevent: Function
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
export const useAnchorProps = {
|
|
19
27
|
target: {
|
|
20
28
|
type: [String, Boolean],
|
|
@@ -24,7 +32,7 @@ export const useAnchorProps = {
|
|
|
24
32
|
contextMenu: Boolean
|
|
25
33
|
}
|
|
26
34
|
|
|
27
|
-
export default function ({
|
|
35
|
+
export default function useAnchor({
|
|
28
36
|
configureAnchorEl
|
|
29
37
|
}: {
|
|
30
38
|
configureAnchorEl?: Function
|
|
@@ -39,22 +47,12 @@ export default function ({
|
|
|
39
47
|
// abort with no parent configured or on multi-touch
|
|
40
48
|
return anchorEl?.value === null
|
|
41
49
|
? false
|
|
42
|
-
: evt
|
|
43
|
-
evt.touches === void 0 ||
|
|
44
|
-
evt.touches.length <= 1
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
interface AnchorElements {
|
|
48
|
-
hide: Function
|
|
49
|
-
toggle?: Function
|
|
50
|
-
toggleKey: Function
|
|
51
|
-
contextClick: Function
|
|
52
|
-
prevent: Function
|
|
50
|
+
: !evt || !evt.touches || evt.touches.length <= 1
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
const anchorEvents: Partial<AnchorElements> = {}
|
|
56
54
|
|
|
57
|
-
if (configureAnchorEl
|
|
55
|
+
if (!configureAnchorEl && proxy) {
|
|
58
56
|
// default configureAnchorEl is designed for
|
|
59
57
|
// DlMenu & DlPopupProxy (which is why it's handled here)
|
|
60
58
|
|
|
@@ -71,7 +69,7 @@ export default function ({
|
|
|
71
69
|
},
|
|
72
70
|
|
|
73
71
|
toggleKey(evt: AnchorEvent) {
|
|
74
|
-
if (isKeyCode(evt, 13) && anchorEvents.toggle
|
|
72
|
+
if (isKeyCode(evt, 13) && anchorEvents.toggle) {
|
|
75
73
|
anchorEvents.toggle(evt)
|
|
76
74
|
}
|
|
77
75
|
},
|
|
@@ -149,11 +147,11 @@ export default function ({
|
|
|
149
147
|
try {
|
|
150
148
|
el = document.querySelector(props.target)
|
|
151
149
|
} catch (err) {
|
|
152
|
-
el =
|
|
150
|
+
el = null
|
|
153
151
|
}
|
|
154
152
|
}
|
|
155
153
|
|
|
156
|
-
if (el
|
|
154
|
+
if (el) {
|
|
157
155
|
anchorEl.value = (el as any).$el || el // cannot use VUE type to work on both vue versions, so let it be any
|
|
158
156
|
if (configureAnchorEl) {
|
|
159
157
|
configureAnchorEl()
|
|
@@ -41,7 +41,7 @@ export interface AnchorEvent extends KeyboardEvent {
|
|
|
41
41
|
|
|
42
42
|
// handleShow/handleHide -> removeTick(), self (& emit show)
|
|
43
43
|
|
|
44
|
-
export default function ({
|
|
44
|
+
export default function useModelToggle({
|
|
45
45
|
showing,
|
|
46
46
|
canShow, // optional
|
|
47
47
|
handleShow, // optional
|
|
@@ -70,16 +70,15 @@ export default function ({
|
|
|
70
70
|
function show(evt: AnchorEvent) {
|
|
71
71
|
if (
|
|
72
72
|
props.disabled === true ||
|
|
73
|
-
(evt
|
|
74
|
-
(canShow
|
|
73
|
+
(evt && evt.dlAnchorHandled === true) ||
|
|
74
|
+
(canShow && canShow(evt) !== true)
|
|
75
75
|
) {
|
|
76
76
|
return
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
const listener =
|
|
80
|
-
props[`onUpdate:${modelValueNaming}`]
|
|
81
|
-
(vm!.proxy! as any)?.$listeners?.[`update:${modelValueNaming}`]
|
|
82
|
-
void 0
|
|
80
|
+
props[`onUpdate:${modelValueNaming}`] ||
|
|
81
|
+
(vm!.proxy! as any)?.$listeners?.[`update:${modelValueNaming}`]
|
|
83
82
|
|
|
84
83
|
if (listener === true) {
|
|
85
84
|
emit(`update:${modelValueNaming}`, true)
|
|
@@ -87,7 +86,7 @@ export default function ({
|
|
|
87
86
|
|
|
88
87
|
nextTick(() => {
|
|
89
88
|
if (payload === evt) {
|
|
90
|
-
payload =
|
|
89
|
+
payload = null
|
|
91
90
|
}
|
|
92
91
|
})
|
|
93
92
|
}
|
|
@@ -106,7 +105,7 @@ export default function ({
|
|
|
106
105
|
|
|
107
106
|
emit('before-show', evt)
|
|
108
107
|
|
|
109
|
-
if (handleShow
|
|
108
|
+
if (handleShow) {
|
|
110
109
|
handleShow(evt)
|
|
111
110
|
} else {
|
|
112
111
|
emit('show', evt)
|
|
@@ -119,16 +118,15 @@ export default function ({
|
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
const listener =
|
|
122
|
-
props[`onUpdate:${modelValueNaming}`]
|
|
123
|
-
(vm!.proxy! as any)?.$listeners?.[`update:${modelValueNaming}`]
|
|
124
|
-
void 0
|
|
121
|
+
props[`onUpdate:${modelValueNaming}`] ||
|
|
122
|
+
(vm!.proxy! as any)?.$listeners?.[`update:${modelValueNaming}`]
|
|
125
123
|
|
|
126
124
|
if (listener === true) {
|
|
127
125
|
emit(`update:${modelValueNaming}`, false)
|
|
128
126
|
payload = evt
|
|
129
127
|
nextTick(() => {
|
|
130
128
|
if (payload === evt) {
|
|
131
|
-
payload =
|
|
129
|
+
payload = null
|
|
132
130
|
}
|
|
133
131
|
})
|
|
134
132
|
}
|
|
@@ -147,7 +145,7 @@ export default function ({
|
|
|
147
145
|
|
|
148
146
|
emit('before-hide', evt)
|
|
149
147
|
|
|
150
|
-
if (handleHide
|
|
148
|
+
if (handleHide) {
|
|
151
149
|
handleHide(evt)
|
|
152
150
|
} else {
|
|
153
151
|
emit('hide', evt)
|
|
@@ -156,7 +154,7 @@ export default function ({
|
|
|
156
154
|
|
|
157
155
|
function processModelChange(val: boolean) {
|
|
158
156
|
if (props.disabled === true && val === true) {
|
|
159
|
-
if (props[`onUpdate:${modelValueNaming}`]
|
|
157
|
+
if (props[`onUpdate:${modelValueNaming}`]) {
|
|
160
158
|
emit(`update:${modelValueNaming}`, false)
|
|
161
159
|
}
|
|
162
160
|
} else if ((val === true) !== showing.value) {
|
package/src/hooks/use-portal.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { portalList } from '../utils/portal'
|
|
|
7
7
|
function isOnGlobalDialog(vm: any) {
|
|
8
8
|
vm = vm.parent
|
|
9
9
|
|
|
10
|
-
while (vm
|
|
10
|
+
while (vm) {
|
|
11
11
|
if (vm.type.name === 'DlGlobalDialog') {
|
|
12
12
|
return true
|
|
13
13
|
}
|
|
@@ -24,7 +24,7 @@ function isOnGlobalDialog(vm: any) {
|
|
|
24
24
|
// Warning!
|
|
25
25
|
// You MUST specify "inheritAttrs: false" in your component
|
|
26
26
|
|
|
27
|
-
export default function (
|
|
27
|
+
export default function usePortal(
|
|
28
28
|
vm: ComponentInternalInstance | null,
|
|
29
29
|
innerRef: Ref<HTMLElement | null>,
|
|
30
30
|
checkGlobalDialog = false,
|
|
@@ -8,10 +8,8 @@ export default function (props: any, configureScrollTarget: Function) {
|
|
|
8
8
|
let scrollFn: Function | undefined
|
|
9
9
|
|
|
10
10
|
function changeScrollEvent(scrollTarget: any, fn: Function = () => {}) {
|
|
11
|
-
const fnProp: string = `${
|
|
12
|
-
|
|
13
|
-
}EventListener`
|
|
14
|
-
const fnHandler = fn !== void 0 ? fn : scrollFn
|
|
11
|
+
const fnProp: string = `${fn ? 'add' : 'remove'}EventListener`
|
|
12
|
+
const fnHandler = fn ? fn : scrollFn
|
|
15
13
|
|
|
16
14
|
if (scrollTarget !== window) {
|
|
17
15
|
scrollTarget[fnProp]('scroll', fnHandler, listenOpts.passive)
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { onBeforeUnmount, onMounted, ref, Ref } from 'vue-demi'
|
|
2
2
|
import { isEllipsisActive } from '../utils/is-ellipsis-active'
|
|
3
|
+
import { get } from 'lodash'
|
|
3
4
|
|
|
4
|
-
export function useSizeObserver(elRef: Ref) {
|
|
5
|
+
export function useSizeObserver(elRef: Ref, entryLevel = 'target') {
|
|
5
6
|
const widthRef = ref(0)
|
|
6
7
|
const heightRef = ref(0)
|
|
7
8
|
const hasEllipsis = ref(false)
|
|
8
9
|
const borderBoxSize = ref(null)
|
|
9
10
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
10
11
|
for (const entry of entries) {
|
|
11
|
-
hasEllipsis.value = isEllipsisActive(entry
|
|
12
|
+
hasEllipsis.value = isEllipsisActive(get(entry, entryLevel))
|
|
12
13
|
widthRef.value = entry.contentRect.width
|
|
13
14
|
heightRef.value = entry.contentRect.height
|
|
14
15
|
borderBoxSize.value = entry.borderBoxSize
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computed, watch, nextTick, Ref } from 'vue-demi'
|
|
2
2
|
|
|
3
3
|
export const useTransitionProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The duration of the transition in milliseconds.
|
|
6
|
+
* @default 300
|
|
7
|
+
* @type {number}
|
|
8
|
+
*
|
|
9
|
+
* Disabled for Vue2
|
|
10
|
+
*/
|
|
4
11
|
transitionDuration: {
|
|
5
12
|
type: Number,
|
|
6
13
|
default: 300
|
|
@@ -13,11 +20,10 @@ export default function (
|
|
|
13
20
|
},
|
|
14
21
|
showing: Ref<boolean>
|
|
15
22
|
) {
|
|
16
|
-
const transitionState = ref(showing.value)
|
|
17
|
-
|
|
18
23
|
watch(showing, (val) => {
|
|
19
24
|
nextTick(() => {
|
|
20
|
-
|
|
25
|
+
if (showing.value === val) return
|
|
26
|
+
showing.value = val
|
|
21
27
|
})
|
|
22
28
|
})
|
|
23
29
|
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
import { install } from 'vue-demi'
|
|
1
|
+
import { computed, install, reactive } from 'vue-demi'
|
|
2
2
|
|
|
3
3
|
install()
|
|
4
4
|
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
window.DlComponents = window.DlComponents || {
|
|
7
|
+
state: reactive({}),
|
|
8
|
+
setTheme: (theme: 'light' | 'dark') => {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
window.DlComponents.state.theme = theme
|
|
11
|
+
},
|
|
12
|
+
get theme(): 'light' | 'dark' {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
return window.DlComponents.state.theme
|
|
15
|
+
},
|
|
16
|
+
isDark: computed(() => {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
return window.DlComponents.state.theme === 'dark'
|
|
19
|
+
}),
|
|
20
|
+
isLight: computed(() => {
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
return window.DlComponents.state.theme === 'light'
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
5
26
|
export * from './components'
|
|
6
27
|
import DlComponentsDemo from './App.vue'
|
|
7
28
|
export { DlComponentsDemo }
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="footer-content">
|
|
3
|
+
<div style="width: 300px">
|
|
4
|
+
<DlSlider
|
|
5
|
+
text="Thumb size"
|
|
6
|
+
editable
|
|
7
|
+
/>
|
|
8
|
+
</div>
|
|
9
|
+
<div style="width: 100%; display: flex; padding-left: 20px">
|
|
10
|
+
<dl-pagination
|
|
11
|
+
v-model="page"
|
|
12
|
+
:rows-per-page="rowsPerPage"
|
|
13
|
+
:boundary-numbers="boundaryNumbers"
|
|
14
|
+
:boundary-links="boundaryLinks"
|
|
15
|
+
:direction-links="directionLinks"
|
|
16
|
+
:max-pages="maxPages"
|
|
17
|
+
:disabled="disabled"
|
|
18
|
+
:with-legend="withLegend"
|
|
19
|
+
:total-items="total"
|
|
20
|
+
:items-name="itemsName"
|
|
21
|
+
:with-quick-navigation="withQuickNavigation"
|
|
22
|
+
:with-rows-per-page="withRowsPerPage"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { defineComponent, ref } from 'vue-demi'
|
|
30
|
+
import { DlSlider, DlPagination } from '../../../components'
|
|
31
|
+
|
|
32
|
+
export default defineComponent({
|
|
33
|
+
name: 'DatasetFooter',
|
|
34
|
+
components: {
|
|
35
|
+
DlSlider,
|
|
36
|
+
DlPagination
|
|
37
|
+
},
|
|
38
|
+
setup() {
|
|
39
|
+
const page = ref(18)
|
|
40
|
+
const rowsPerPage = ref(10)
|
|
41
|
+
const boundaryNumbers = ref(true)
|
|
42
|
+
const boundaryLinks = ref(true)
|
|
43
|
+
const directionLinks = ref(true)
|
|
44
|
+
const maxPages = ref(6)
|
|
45
|
+
const disabled = ref(false)
|
|
46
|
+
const withLegend = ref(true)
|
|
47
|
+
const total = ref(200)
|
|
48
|
+
const itemsName = ref('Rows')
|
|
49
|
+
const withQuickNavigation = ref(true)
|
|
50
|
+
const withRowsPerPage = ref(true)
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
page,
|
|
54
|
+
rowsPerPage,
|
|
55
|
+
boundaryNumbers,
|
|
56
|
+
boundaryLinks,
|
|
57
|
+
directionLinks,
|
|
58
|
+
maxPages,
|
|
59
|
+
disabled,
|
|
60
|
+
withLegend,
|
|
61
|
+
total,
|
|
62
|
+
itemsName,
|
|
63
|
+
withQuickNavigation,
|
|
64
|
+
withRowsPerPage
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style scoped lang="scss">
|
|
71
|
+
.footer-content {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
height: 40px;
|
|
75
|
+
padding: 0 15px 0 15px;
|
|
76
|
+
gap: 20px;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<navbar-kpi />
|
|
4
|
+
<navbar-search />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { defineComponent } from 'vue-demi'
|
|
10
|
+
import NavbarKpi from './NavbarKpi.vue'
|
|
11
|
+
import NavbarSearch from './NavbarSearch.vue'
|
|
12
|
+
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
name: 'DatasetHeader',
|
|
15
|
+
components: {
|
|
16
|
+
NavbarKpi,
|
|
17
|
+
NavbarSearch
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="left-drawer-content"
|
|
4
|
+
:style="cssVars"
|
|
5
|
+
>
|
|
6
|
+
<div style="padding: 10px">
|
|
7
|
+
<div class="left-drawer-content__toggle-icon">
|
|
8
|
+
<dl-button
|
|
9
|
+
flat
|
|
10
|
+
color="secondary"
|
|
11
|
+
:icon="expandIcon"
|
|
12
|
+
@click="onToggle"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
<div style="padding: 40px 0 10px">
|
|
16
|
+
<dl-typography
|
|
17
|
+
size="12px"
|
|
18
|
+
color="dl-color-dark"
|
|
19
|
+
>
|
|
20
|
+
Search in:
|
|
21
|
+
</dl-typography>
|
|
22
|
+
</div>
|
|
23
|
+
<dl-radio
|
|
24
|
+
v-model="checkModel"
|
|
25
|
+
label="All Dataset items"
|
|
26
|
+
:value="1"
|
|
27
|
+
/>
|
|
28
|
+
<dl-radio
|
|
29
|
+
v-model="checkModel"
|
|
30
|
+
label="Folders"
|
|
31
|
+
:value="2"
|
|
32
|
+
/>
|
|
33
|
+
<dl-radio
|
|
34
|
+
v-model="checkModel"
|
|
35
|
+
label="Tasks"
|
|
36
|
+
:value="3"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script lang="ts">
|
|
43
|
+
import { computed, defineComponent, ref } from 'vue-demi'
|
|
44
|
+
import { DlRadio, DlTypography, DlButton } from '../../../components'
|
|
45
|
+
|
|
46
|
+
export default defineComponent({
|
|
47
|
+
name: 'DatasetLeftDrawer',
|
|
48
|
+
components: {
|
|
49
|
+
DlRadio,
|
|
50
|
+
DlTypography,
|
|
51
|
+
DlButton
|
|
52
|
+
},
|
|
53
|
+
setup() {
|
|
54
|
+
const LARGE_WIDTH = '300px'
|
|
55
|
+
const SMALL_WIDTH = '50px'
|
|
56
|
+
const leftDrawerContentWidth = ref(LARGE_WIDTH)
|
|
57
|
+
const isExpanded = ref(true)
|
|
58
|
+
const checkModel = ref('')
|
|
59
|
+
|
|
60
|
+
const onToggle = () => {
|
|
61
|
+
isExpanded.value = !isExpanded.value
|
|
62
|
+
leftDrawerContentWidth.value = isExpanded.value
|
|
63
|
+
? LARGE_WIDTH
|
|
64
|
+
: SMALL_WIDTH
|
|
65
|
+
}
|
|
66
|
+
const expandIcon = computed(() =>
|
|
67
|
+
isExpanded.value ? 'icon-dl-expand' : 'icon-dl-collapse'
|
|
68
|
+
)
|
|
69
|
+
const cssVars = computed(() => {
|
|
70
|
+
return {
|
|
71
|
+
'--left-drawer-content-width': leftDrawerContentWidth.value
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
checkModel,
|
|
77
|
+
onToggle,
|
|
78
|
+
expandIcon,
|
|
79
|
+
cssVars
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style scoped lang="scss">
|
|
86
|
+
.left-drawer-content {
|
|
87
|
+
width: var(--left-drawer-content-width);
|
|
88
|
+
position: relative;
|
|
89
|
+
transition: all 300ms;
|
|
90
|
+
|
|
91
|
+
&__toggle-icon {
|
|
92
|
+
position: absolute;
|
|
93
|
+
right: 0;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="main-content">
|
|
3
|
+
<main-content-header @onChangeViewMode="handleViewMode" />
|
|
4
|
+
<main-content-images :view-mode="viewMode" />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { defineComponent, ref } from 'vue-demi'
|
|
10
|
+
import MainContentHeader from './MainContent/MainContentNav.vue'
|
|
11
|
+
import MainContentImages from './MainContent/MainContentImages.vue'
|
|
12
|
+
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
name: 'DatasetMainContent',
|
|
15
|
+
components: {
|
|
16
|
+
MainContentHeader,
|
|
17
|
+
MainContentImages
|
|
18
|
+
},
|
|
19
|
+
setup() {
|
|
20
|
+
const viewMode = ref('')
|
|
21
|
+
const handleViewMode = (value: string) => {
|
|
22
|
+
viewMode.value = value
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
viewMode,
|
|
27
|
+
handleViewMode
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style scoped lang="scss">
|
|
34
|
+
.main-content {
|
|
35
|
+
display: flex;
|
|
36
|
+
gap: 10px;
|
|
37
|
+
flex-wrap: wrap;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
padding-top: 10px;
|
|
40
|
+
padding-inline: 20px;
|
|
41
|
+
align-content: center;
|
|
42
|
+
text-align: center;
|
|
43
|
+
|
|
44
|
+
img {
|
|
45
|
+
width: 135px;
|
|
46
|
+
height: 135px;
|
|
47
|
+
object-fit: cover;
|
|
48
|
+
border-radius: 2px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</style>
|