@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.
- package/package.json +6 -3
- package/src/App.vue +5 -227
- package/src/assets/constants.scss +2 -1
- package/src/assets/globals.scss +21 -0
- package/src/components/basic/DlAccordion/DlAccordion.vue +26 -4
- package/src/components/basic/DlAccordion/components/AccordionHeader.vue +2 -1
- package/src/components/basic/DlAvatar/DlAvatar.vue +1 -1
- package/src/components/basic/DlButton/DlButton.vue +115 -25
- package/src/components/basic/DlButton/utils.ts +45 -2
- package/src/components/basic/DlChip/DlChip.vue +3 -7
- package/src/components/basic/DlChip/utils.ts +4 -4
- package/src/components/basic/DlContainer/DlContainer.vue +70 -0
- package/src/components/basic/DlContainer/index.ts +3 -0
- 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/DlGrid/DlGrid.vue +163 -0
- package/src/components/basic/DlGrid/index.ts +4 -0
- package/src/components/basic/DlGrid/types.ts +5 -0
- package/src/components/basic/DlKpi/components/KpiInfo.vue +2 -1
- package/src/components/basic/DlListItem/DlListItem.vue +96 -66
- package/src/components/basic/DlListItem/utils.ts +0 -3
- package/src/components/basic/DlPanelContainer/DlPanelContainer.vue +37 -13
- package/src/components/basic/DlPopup/DlPopup.vue +58 -11
- package/src/components/basic/DlPopup/components/PopupHeader.vue +11 -6
- package/src/components/basic/DlProgressChart/DlProgressChart.vue +2 -1
- package/src/components/basic/DlWidget/DlWidget.vue +273 -141
- package/src/components/basic/DlWidget/index.ts +1 -3
- package/src/components/basic/DlWidget/utils.ts +90 -8
- package/src/components/basic/index.ts +4 -2
- 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 +39 -4
- package/src/components/compound/DlCharts/charts/DlColumnChart/DlColumnChart.vue +128 -36
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +167 -87
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/utils.ts +2 -1
- package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChart.vue +44 -3
- package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChartWidget.vue +1 -2
- package/src/components/compound/DlCharts/charts/DlDoughnutChart/components/DlDoughnutChartLegend.vue +9 -18
- package/src/components/compound/DlCharts/charts/DlLineChart/DlLineChart.vue +48 -9
- package/src/components/compound/DlCharts/charts/DlScatterChart/DlScatterChart.vue +667 -0
- package/src/components/compound/DlCharts/charts/DlScatterChart/index.ts +2 -0
- package/src/components/compound/DlCharts/charts/index.ts +1 -0
- package/src/components/compound/DlCharts/components/DlBrush.vue +3 -2
- package/src/components/compound/DlCharts/components/DlChartLabels.vue +2 -1
- package/src/components/compound/DlCharts/components/DlChartScrollBar.vue +1 -0
- 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 +173 -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/DlDatePicker/DlDatePicker.vue +9 -1
- package/src/components/compound/DlDateTime/DlDatePicker/components/DlCalendar.vue +4 -2
- package/src/components/compound/DlDateTime/DlDatePicker/components/DlMonthCalendar.vue +2 -1
- package/src/components/compound/DlDateTime/DlDateTimeRange/{DlCardSidebar.vue → CardSidebar.vue} +10 -11
- package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +18 -9
- package/src/components/compound/DlDateTime/DlTimePicker/DlTimePicker.vue +2 -2
- package/src/components/compound/DlDialogBox/DlDialogBox.vue +74 -15
- package/src/components/compound/DlDialogBox/components/DlDialogBoxFooter.vue +1 -1
- package/src/components/compound/DlDialogBox/components/DlDialogBoxHeader.vue +9 -7
- package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +13 -4
- package/src/components/compound/DlInput/DlInput.vue +80 -17
- package/src/components/compound/DlJsonEditor/DlJsonEditor.vue +42 -219
- package/src/components/compound/DlOptionGroup/DlOptionGroup.vue +16 -17
- package/src/components/compound/DlOptionGroup/components/MenuItemWrapper.vue +2 -2
- package/src/components/compound/DlPagination/DlPagination.vue +1 -1
- package/src/components/compound/DlPagination/components/PaginationLegend.vue +0 -2
- package/src/components/compound/DlPagination/components/RowsSelector.vue +0 -2
- package/src/components/compound/DlRange/DlRange.vue +3 -2
- package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +12 -5
- package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +413 -97
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchFilters.vue +4 -1
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +100 -39
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSuggestionsDropdown.vue +12 -7
- package/src/components/compound/DlSearches/DlSmartSearch/components/FiltersQuery.vue +5 -6
- package/src/components/compound/DlSearches/DlSmartSearch/types.ts +14 -0
- package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +10 -6
- package/src/components/compound/DlSearches/DlSmartSearch/utils/index.ts +172 -48
- package/src/components/compound/DlSelect/DlSelect.vue +264 -130
- package/src/components/compound/DlSelect/utils.ts +4 -1
- package/src/components/compound/DlSlider/DlSlider.vue +10 -2
- package/src/components/compound/DlSlider/components/DlSliderBase.vue +3 -3
- package/src/components/compound/DlSlider/components/DlSliderInput.vue +17 -26
- package/src/components/compound/DlSlider/sliderStyles.scss +5 -1
- package/src/components/compound/DlSlider/useSlider.ts +2 -2
- package/src/components/compound/DlSlider/utils.ts +2 -2
- package/src/components/compound/DlStepper/DlStepper.vue +46 -4
- package/src/components/compound/DlStepper/components/DlStepperContent.vue +6 -2
- package/src/components/compound/DlStepper/components/DlStepperFooter.vue +12 -0
- package/src/components/compound/DlStepper/components/DlStepperSidebar.vue +24 -11
- package/src/components/compound/DlStepper/models/Step.ts +37 -8
- package/src/components/compound/DlStepper/models/Stepper.ts +108 -15
- package/src/components/compound/DlStepper/models/interfaces.ts +2 -1
- package/src/components/compound/DlTable/DlTable.vue +49 -14
- package/src/components/compound/DlTable/components/DlTd.vue +9 -9
- package/src/components/compound/DlTable/components/DlTh.vue +3 -2
- 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 +18 -18
- 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/DlTable/styles/dl-table-styles.scss +8 -0
- package/src/components/compound/DlTabs/DlTabs.vue +83 -31
- package/src/components/compound/DlTabs/components/DlTab.vue +14 -4
- package/src/components/compound/DlTabs/components/TabsWrapper.vue +32 -27
- 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/DlToast/api/useToast.ts +42 -1
- package/src/components/compound/DlToast/components/ToastComponent.vue +24 -32
- package/src/components/compound/DlToast/types.ts +52 -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 +14 -1
- package/src/components/compound/types.ts +2 -0
- package/src/components/essential/DlBadge/DlBadge.vue +3 -3
- package/src/components/essential/DlCheckbox/DlCheckbox.vue +10 -7
- package/src/components/essential/DlEllipsis/DlEllipsis.vue +141 -0
- package/src/components/essential/DlIcon/DlIcon.vue +5 -5
- package/src/components/essential/DlLabel/DlLabel.vue +190 -0
- package/src/components/essential/DlLabel/index.ts +2 -0
- package/src/components/essential/DlList/DlList.vue +3 -3
- package/src/components/essential/DlMenu/DlMenu.vue +41 -22
- package/src/components/essential/DlMenu/utils.ts +8 -7
- package/src/components/essential/DlPageLayout/DlPageLayout.vue +90 -0
- package/src/components/essential/DlPageLayout/index.ts +2 -0
- package/src/components/essential/DlProgressBar/DlProgressBar.vue +1 -1
- package/src/components/essential/DlRadio/DlRadio.vue +10 -5
- package/src/components/essential/DlSeparator/DlSeparator.vue +2 -2
- package/src/components/essential/DlSpinner/index.ts +1 -13
- package/src/components/essential/DlSpinner/styles/spinnerStyles.scss +7 -0
- package/src/components/essential/DlSwitch/DlSwitch.vue +6 -3
- package/src/components/essential/DlTextArea/DlTextArea.vue +212 -7
- package/src/components/essential/DlThemeProvider/DlThemeProvider.vue +6 -0
- package/src/components/essential/DlTypography/DlTypography.vue +7 -1
- package/src/components/essential/index.ts +3 -2
- package/src/components/shared/DlInfoErrorMessage/DlInfoErrorMessage.vue +1 -1
- package/src/components/{essential → shared}/DlTooltip/DlTooltip.vue +26 -19
- package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +106 -43
- package/src/components/shared/DlVirtualScroll/useVirtualScroll.ts +28 -4
- package/src/components/shared/index.ts +1 -0
- package/src/components/types.ts +2 -0
- package/src/demos/BarChartDemo.vue +59 -2
- package/src/demos/ColumnChartDemo.vue +67 -2
- package/src/demos/DlAccordionDemo.vue +92 -43
- package/src/demos/DlAlertDemo.vue +14 -0
- package/src/demos/DlButtonDemo.vue +41 -4
- package/src/demos/DlCardDemo.vue +156 -19
- package/src/demos/DlChartDoughnutDemo.vue +49 -2
- package/src/demos/DlCheckboxDemo.vue +28 -3
- package/src/demos/DlCodeEditor/DlCodeEditorDemo.vue +247 -0
- package/src/demos/DlCodeEditor/index.ts +2 -0
- package/src/demos/DlConfusionMatrixDemo.vue +93 -37
- package/src/demos/DlDemoPage.vue +235 -0
- package/src/demos/DlDialogBoxDemo.vue +56 -51
- package/src/demos/DlDropdownButtonDemo.vue +35 -27
- package/src/demos/DlEmptyStateDemo.vue +81 -0
- package/src/demos/DlGridDemo.vue +40 -0
- package/src/demos/DlInputDemo.vue +21 -1
- package/src/demos/DlJsonEditorDemo.vue +59 -0
- package/src/demos/DlLabelDemo.vue +208 -0
- package/src/demos/DlLineChartDemo.vue +50 -2
- package/src/demos/DlListDemo.vue +12 -9
- package/src/demos/DlMenuDemo.vue +147 -20
- package/src/demos/DlPageLayoutDemo.vue +146 -0
- package/src/demos/DlPanelContainerDemo.vue +113 -2
- package/src/demos/DlPopupDemo.vue +82 -1
- package/src/demos/DlRadioDemo.vue +16 -1
- package/src/demos/DlScatterChartDemo.vue +161 -0
- package/src/demos/DlSearchDemo.vue +9 -0
- package/src/demos/DlSelectDemo.vue +124 -27
- package/src/demos/DlSpinnerDemo.vue +0 -2
- package/src/demos/DlStepperDemo/DlStepperDemo.vue +5 -1
- package/src/demos/DlStepperDemo/EmptyStateStepper.vue +149 -0
- package/src/demos/DlStepperDemo/SimpleStepper.vue +4 -0
- package/src/demos/DlStepperDemo/steps/GeneralStep.vue +1 -0
- package/src/demos/DlSwitchDemo.vue +12 -0
- package/src/demos/DlTableDemo.vue +84 -5
- package/src/demos/DlTabsDemo.vue +92 -3
- package/src/demos/DlTextAreaDemo.vue +14 -17
- package/src/demos/DlThumbnailGalleryDemo.vue +99 -0
- package/src/demos/DlToastDemo.vue +3 -9
- package/src/demos/DlTooltipDemo.vue +66 -2
- package/src/demos/DlTreeTableDemo.vue +694 -0
- package/src/demos/DlVirtualScrollDemo.vue +3 -12
- package/src/demos/DlWidgetDemo.vue +252 -61
- package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +151 -32
- package/src/demos/index.ts +23 -4
- package/src/hooks/use-anchor.ts +15 -17
- package/src/hooks/use-arrow-navigation.ts +64 -21
- package/src/hooks/use-model-toggle.ts +14 -16
- package/src/hooks/use-portal.ts +9 -3
- package/src/hooks/use-scroll-target.ts +2 -4
- package/src/hooks/use-size-observer.ts +3 -2
- package/src/hooks/use-suggestions.ts +239 -49
- 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/input-sizes.ts +5 -2
- package/src/utils/is-ellipsis-active.ts +4 -1
- package/src/utils/parse-smart-query.ts +209 -111
- package/src/utils/portal.ts +5 -5
- package/src/utils/position-engine.ts +7 -7
- 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 -241
- package/src/components/basic/DlCard/types.ts +0 -20
- package/src/components/basic/DlEllipsis/DlEllipsis.vue +0 -114
- package/src/components/basic/DlWidget/DlGrid.vue +0 -33
- package/src/components/basic/DlWidget/DlGridRow.vue +0 -32
- package/src/components/compound/DlSearches/DlSmartSearch/utils/utils.ts +0 -124
- package/src/components/compound/DlToast/utils/config.ts +0 -17
- package/src/components/essential/DlTextHolder/DlTextHolder.vue +0 -65
- package/src/components/essential/DlTextHolder/index.ts +0 -2
- package/src/demos/DlTextHolderDemo.vue +0 -42
- package/src/utils/swapNodes.ts +0 -30
- /package/src/components/{basic → compound}/DlCard/index.ts +0 -0
- /package/src/components/compound/DlDateTime/DlDateTimeRange/{DlDateInput.vue → DateInput.vue} +0 -0
- /package/src/components/{basic → essential}/DlEllipsis/index.ts +0 -0
- /package/src/components/{essential → shared}/DlTooltip/index.ts +0 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="uuid"
|
|
4
|
+
ref="dlEtaRef"
|
|
5
|
+
:style="cssVars"
|
|
6
|
+
:class="[{ 'empty-state': true }, `empty-state--${align}`]"
|
|
7
|
+
>
|
|
8
|
+
<dl-icon
|
|
9
|
+
:class="iconClassName"
|
|
10
|
+
:color="iconColor"
|
|
11
|
+
:size="iconFontSize"
|
|
12
|
+
:icon="icon"
|
|
13
|
+
/>
|
|
14
|
+
|
|
15
|
+
<dl-typography
|
|
16
|
+
v-if="title"
|
|
17
|
+
bold
|
|
18
|
+
:size="titleFontSize"
|
|
19
|
+
:color="titleColor"
|
|
20
|
+
:class="titleClassName"
|
|
21
|
+
>
|
|
22
|
+
{{ title }}
|
|
23
|
+
</dl-typography>
|
|
24
|
+
|
|
25
|
+
<dl-typography
|
|
26
|
+
v-if="subtitle"
|
|
27
|
+
:size="subtitleFontSize"
|
|
28
|
+
:color="subtitleColor"
|
|
29
|
+
:class="subtitleClassName"
|
|
30
|
+
>
|
|
31
|
+
{{ subtitle }}
|
|
32
|
+
</dl-typography>
|
|
33
|
+
|
|
34
|
+
<div
|
|
35
|
+
v-if="hasCTASlot"
|
|
36
|
+
class="empty-state--cta"
|
|
37
|
+
>
|
|
38
|
+
<slot name="cta" />
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<dl-typography
|
|
42
|
+
v-if="info"
|
|
43
|
+
:size="infoFontSize"
|
|
44
|
+
:color="infoColor"
|
|
45
|
+
class="empty-state--info"
|
|
46
|
+
>
|
|
47
|
+
{{ info }}
|
|
48
|
+
</dl-typography>
|
|
49
|
+
|
|
50
|
+
<div
|
|
51
|
+
v-if="hasLinkSlot"
|
|
52
|
+
class="empty-state--links"
|
|
53
|
+
>
|
|
54
|
+
<slot name="links" />
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<script lang="ts">
|
|
60
|
+
import { v4 } from 'uuid'
|
|
61
|
+
import { DlIcon, DlTypography } from '../../essential'
|
|
62
|
+
import { useSizeObserver } from '../../../hooks/use-size-observer'
|
|
63
|
+
import { defineComponent, computed, ref } from 'vue-demi'
|
|
64
|
+
|
|
65
|
+
export default defineComponent({
|
|
66
|
+
name: 'DlEmptyState',
|
|
67
|
+
components: {
|
|
68
|
+
DlIcon,
|
|
69
|
+
DlTypography
|
|
70
|
+
},
|
|
71
|
+
props: {
|
|
72
|
+
bgImage: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: null
|
|
75
|
+
},
|
|
76
|
+
bgSize: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: '240px'
|
|
79
|
+
},
|
|
80
|
+
title: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: 'Something Went Wrong'
|
|
83
|
+
},
|
|
84
|
+
titleColor: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: 'dl-color-darker'
|
|
87
|
+
},
|
|
88
|
+
titleSize: {
|
|
89
|
+
type: String,
|
|
90
|
+
default: '20px'
|
|
91
|
+
},
|
|
92
|
+
subtitle: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: ''
|
|
95
|
+
},
|
|
96
|
+
subtitleSize: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: '14px'
|
|
99
|
+
},
|
|
100
|
+
subtitleColor: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: 'dl-color-medium'
|
|
103
|
+
},
|
|
104
|
+
info: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: ''
|
|
107
|
+
},
|
|
108
|
+
infoColor: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: 'dl-color-darker'
|
|
111
|
+
},
|
|
112
|
+
infoSize: {
|
|
113
|
+
type: String,
|
|
114
|
+
default: '14px'
|
|
115
|
+
},
|
|
116
|
+
icon: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: 'icon-dl-alert-filled'
|
|
119
|
+
},
|
|
120
|
+
iconSize: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: '40px'
|
|
123
|
+
},
|
|
124
|
+
iconColor: {
|
|
125
|
+
type: String,
|
|
126
|
+
default: 'dl-color-darker'
|
|
127
|
+
},
|
|
128
|
+
responsive: Boolean,
|
|
129
|
+
align: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: 'center'
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
setup(props, { slots }) {
|
|
135
|
+
const uuid = ref(`dl-empty-state-${v4()}`)
|
|
136
|
+
|
|
137
|
+
const dlEtaRef = ref(null)
|
|
138
|
+
|
|
139
|
+
const { widthRef, heightRef } = useSizeObserver(dlEtaRef)
|
|
140
|
+
|
|
141
|
+
const metric = computed(() => {
|
|
142
|
+
return widthRef.value > heightRef.value
|
|
143
|
+
? widthRef.value
|
|
144
|
+
: heightRef.value
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
const fontSize = (value: number) => metric.value * (value / 365)
|
|
148
|
+
|
|
149
|
+
const titleFontSize = computed(() =>
|
|
150
|
+
props.responsive
|
|
151
|
+
? fontSize(parseInt(props.titleSize)) + 'px'
|
|
152
|
+
: props.titleSize
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
const infoFontSize = computed(() =>
|
|
156
|
+
props.responsive
|
|
157
|
+
? fontSize(parseInt(props.infoSize)) + 'px'
|
|
158
|
+
: props.infoSize
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
const iconFontSize = computed(() =>
|
|
162
|
+
props.responsive
|
|
163
|
+
? fontSize(parseInt(props.iconSize)) + 'px'
|
|
164
|
+
: props.iconSize
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
const subtitleFontSize = computed(() =>
|
|
168
|
+
props.responsive
|
|
169
|
+
? fontSize(parseInt(props.subtitleSize)) + 'px'
|
|
170
|
+
: props.subtitleSize
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
const bgImageSize = computed(() =>
|
|
174
|
+
props.responsive
|
|
175
|
+
? fontSize(parseInt(props.bgSize)) + 'px'
|
|
176
|
+
: props.bgSize
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
const hasCTASlot = !!slots['cta']
|
|
180
|
+
|
|
181
|
+
const hasLinkSlot = !!slots['links']
|
|
182
|
+
|
|
183
|
+
const iconClassName = computed(() => {
|
|
184
|
+
const classname = 'empty-state--icon'
|
|
185
|
+
|
|
186
|
+
return classname
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
const titleClassName = computed(() => {
|
|
190
|
+
const classname = 'empty-state--title'
|
|
191
|
+
|
|
192
|
+
return classname
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
const subtitleClassName = computed(() => {
|
|
196
|
+
const classname = 'empty-state--subtitle'
|
|
197
|
+
|
|
198
|
+
return classname
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
const infoClassName = computed(() => {
|
|
202
|
+
const classname = 'empty-state--info'
|
|
203
|
+
|
|
204
|
+
return classname
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
const cssVars = computed(() => {
|
|
208
|
+
return {
|
|
209
|
+
'--bg-image': props.bgImage,
|
|
210
|
+
'--bg-size': bgImageSize.value
|
|
211
|
+
}
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
return {
|
|
215
|
+
uuid,
|
|
216
|
+
cssVars,
|
|
217
|
+
iconClassName,
|
|
218
|
+
titleClassName,
|
|
219
|
+
infoClassName,
|
|
220
|
+
subtitleClassName,
|
|
221
|
+
hasCTASlot,
|
|
222
|
+
hasLinkSlot,
|
|
223
|
+
dlEtaRef,
|
|
224
|
+
titleFontSize,
|
|
225
|
+
subtitleFontSize,
|
|
226
|
+
infoFontSize,
|
|
227
|
+
iconFontSize
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
</script>
|
|
232
|
+
|
|
233
|
+
<style scoped lang="scss">
|
|
234
|
+
.empty-state {
|
|
235
|
+
display: flex;
|
|
236
|
+
justify-content: center;
|
|
237
|
+
align-items: center;
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
background-repeat: no-repeat;
|
|
240
|
+
background-position: 50% 50%;
|
|
241
|
+
|
|
242
|
+
background-image: var(--bg-image);
|
|
243
|
+
background-size: var(--bg-size);
|
|
244
|
+
|
|
245
|
+
&--title {
|
|
246
|
+
line-height: 24px;
|
|
247
|
+
margin-bottom: 2px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
&--subtitle,
|
|
251
|
+
&--cta,
|
|
252
|
+
&--links,
|
|
253
|
+
&--info {
|
|
254
|
+
margin-bottom: 20px;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&--nowrap {
|
|
258
|
+
white-space: nowrap;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&--icon {
|
|
262
|
+
margin-bottom: 10px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&--center,
|
|
266
|
+
&--left {
|
|
267
|
+
display: flex;
|
|
268
|
+
width: 100%;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
&--center {
|
|
272
|
+
justify-content: center;
|
|
273
|
+
align-items: center;
|
|
274
|
+
text-align: center;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
&--left {
|
|
278
|
+
align-items: flex-start;
|
|
279
|
+
text-align: start;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type DlEmptyStateProps = {
|
|
2
|
+
bgImage?: string
|
|
3
|
+
bgSize?: string
|
|
4
|
+
title?: string
|
|
5
|
+
titleColor?: string
|
|
6
|
+
titleSize?: string
|
|
7
|
+
subtitle?: string
|
|
8
|
+
subtitleSize?: string
|
|
9
|
+
subtitleColor?: string
|
|
10
|
+
info?: string
|
|
11
|
+
infoColor?: string
|
|
12
|
+
infoSize?: string
|
|
13
|
+
icon?: string
|
|
14
|
+
iconSize?: string
|
|
15
|
+
iconColor?: string
|
|
16
|
+
responsive?: boolean
|
|
17
|
+
align: 'center' | 'left'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type DlEmptyStateSlots = ['cta', 'links']
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="grid"
|
|
4
|
+
:style="gridStyles"
|
|
5
|
+
:class="gridClass"
|
|
6
|
+
>
|
|
7
|
+
<slot />
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { defineComponent, PropType } from 'vue-demi'
|
|
13
|
+
import {
|
|
14
|
+
getGridTemplate,
|
|
15
|
+
getElementAbove,
|
|
16
|
+
findIndexInMatrix,
|
|
17
|
+
swapElemensInMatrix,
|
|
18
|
+
isCustomEvent
|
|
19
|
+
} from '../DlWidget/utils'
|
|
20
|
+
|
|
21
|
+
export default defineComponent({
|
|
22
|
+
model: {
|
|
23
|
+
prop: 'modelValue',
|
|
24
|
+
event: 'update:modelValue'
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: Array as PropType<number[][]>,
|
|
29
|
+
default: null
|
|
30
|
+
},
|
|
31
|
+
rowGap: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: '30px'
|
|
34
|
+
},
|
|
35
|
+
columnGap: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: '30px'
|
|
38
|
+
},
|
|
39
|
+
maxElementsPerRow: {
|
|
40
|
+
type: Number,
|
|
41
|
+
default: 3
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
emits: ['update:modelValue', 'layout-changed'],
|
|
45
|
+
computed: {
|
|
46
|
+
gridStyles(): object {
|
|
47
|
+
return {
|
|
48
|
+
'--row-gap': this.rowGap,
|
|
49
|
+
'--column-gap': this.columnGap
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
gridClass(): string {
|
|
53
|
+
return this.modelValue
|
|
54
|
+
? 'dl-grid-wrapper__grid'
|
|
55
|
+
: 'dl-grid-wrapper__flex'
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
watch: {
|
|
59
|
+
modelValue: {
|
|
60
|
+
handler(val, oldVal) {
|
|
61
|
+
this.$nextTick(() => {
|
|
62
|
+
if (val) {
|
|
63
|
+
if (val.length !== oldVal?.length) {
|
|
64
|
+
this.applyIndexesForChildren()
|
|
65
|
+
}
|
|
66
|
+
this.applyGridElementStyles()
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
},
|
|
70
|
+
immediate: true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
mounted() {
|
|
74
|
+
this.applyIndexesForChildren()
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
applyGridElementStyles() {
|
|
78
|
+
if (!this.modelValue) return
|
|
79
|
+
const gridElements = Array.from(
|
|
80
|
+
(this.$refs.grid as HTMLElement).children
|
|
81
|
+
)
|
|
82
|
+
const gridTemplate = getGridTemplate(this.modelValue)
|
|
83
|
+
if (gridElements.length > gridTemplate.length) return
|
|
84
|
+
|
|
85
|
+
const order = this.modelValue.flat()
|
|
86
|
+
gridElements.forEach((element: Element, index: number) => {
|
|
87
|
+
const orderIndex =
|
|
88
|
+
order.findIndex((nr: number) => nr === index + 1) + 1
|
|
89
|
+
const htmlElement = element as HTMLElement
|
|
90
|
+
htmlElement.style.order = `${orderIndex}`
|
|
91
|
+
htmlElement.style.gridColumn = gridTemplate[orderIndex - 1]
|
|
92
|
+
htmlElement.addEventListener('position-changing', (e) => {
|
|
93
|
+
if (!isCustomEvent(e)) return
|
|
94
|
+
this.changePosition(e)
|
|
95
|
+
})
|
|
96
|
+
htmlElement.addEventListener(
|
|
97
|
+
'position-changed',
|
|
98
|
+
this.layoutChanged.bind(this)
|
|
99
|
+
)
|
|
100
|
+
})
|
|
101
|
+
},
|
|
102
|
+
changePosition(e: CustomEvent) {
|
|
103
|
+
if (!this.modelValue) return
|
|
104
|
+
const side = e.detail.side
|
|
105
|
+
const className = (this.$refs.grid as HTMLElement).children[0]
|
|
106
|
+
.classList[0]
|
|
107
|
+
const sourceIndex =
|
|
108
|
+
parseInt(
|
|
109
|
+
getElementAbove(e.detail.source, className).dataset.index
|
|
110
|
+
) + 1
|
|
111
|
+
const targetIndex =
|
|
112
|
+
parseInt(
|
|
113
|
+
getElementAbove(e.detail.target, className).dataset.index
|
|
114
|
+
) + 1
|
|
115
|
+
const sourceMatrixIndex = findIndexInMatrix(
|
|
116
|
+
this.modelValue,
|
|
117
|
+
sourceIndex
|
|
118
|
+
)
|
|
119
|
+
const targetMatrixIndex = findIndexInMatrix(
|
|
120
|
+
this.modelValue,
|
|
121
|
+
targetIndex
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
const newLayout = swapElemensInMatrix(
|
|
125
|
+
this.modelValue,
|
|
126
|
+
sourceMatrixIndex,
|
|
127
|
+
targetMatrixIndex,
|
|
128
|
+
side,
|
|
129
|
+
this.maxElementsPerRow
|
|
130
|
+
)
|
|
131
|
+
// Update modelValue is required to trigger visualization of the changes
|
|
132
|
+
this.$emit('update:modelValue', newLayout)
|
|
133
|
+
if (e.detail.endDragging) {
|
|
134
|
+
this.layoutChanged()
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
layoutChanged() {
|
|
138
|
+
this.$emit('layout-changed', this.modelValue)
|
|
139
|
+
},
|
|
140
|
+
applyIndexesForChildren() {
|
|
141
|
+
Array.from((this.$refs.grid as HTMLElement).children).forEach(
|
|
142
|
+
(element: Element, index: number) => {
|
|
143
|
+
(element as HTMLElement).dataset.index = `${index}`
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
</script>
|
|
150
|
+
|
|
151
|
+
<style lang="scss" scoped>
|
|
152
|
+
.dl-grid-wrapper {
|
|
153
|
+
&__grid {
|
|
154
|
+
display: grid;
|
|
155
|
+
row-gap: var(--row-gap);
|
|
156
|
+
column-gap: var(--column-gap);
|
|
157
|
+
}
|
|
158
|
+
&__flex {
|
|
159
|
+
display: flex;
|
|
160
|
+
flex-wrap: wrap;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
</style>
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
<script lang="ts">
|
|
20
20
|
import { defineComponent, ref, computed } from 'vue-demi'
|
|
21
|
-
import {
|
|
21
|
+
import { DlIcon } from '../../../essential'
|
|
22
|
+
import { DlTooltip } from '../../../shared'
|
|
22
23
|
|
|
23
24
|
export default defineComponent({
|
|
24
25
|
name: 'KpiInfo',
|