@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,796 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="card"
|
|
4
|
+
:style="cardStyles"
|
|
5
|
+
@mouseover="onCardMouseover"
|
|
6
|
+
@mouseleave="onCardMouseleave"
|
|
7
|
+
@click="onCardClick"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
v-if="icon && !isEmpty"
|
|
11
|
+
class="card--icon"
|
|
12
|
+
>
|
|
13
|
+
<dl-icon
|
|
14
|
+
:icon="icon.icon"
|
|
15
|
+
:styles="iconStyles"
|
|
16
|
+
:size="iconSize"
|
|
17
|
+
:color="iconColor"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
<div
|
|
21
|
+
v-else-if="image && !isEmpty"
|
|
22
|
+
class="card--image"
|
|
23
|
+
>
|
|
24
|
+
<div
|
|
25
|
+
v-if="interactive && hasImageLink"
|
|
26
|
+
class="card--image__link-icon"
|
|
27
|
+
@click="stopPropagationEvent"
|
|
28
|
+
>
|
|
29
|
+
<DlLink
|
|
30
|
+
newtab
|
|
31
|
+
external
|
|
32
|
+
:href="imageLink"
|
|
33
|
+
>
|
|
34
|
+
<dl-icon
|
|
35
|
+
:icon="image.link.icon"
|
|
36
|
+
:size="image.link.size"
|
|
37
|
+
:color="image.link.color"
|
|
38
|
+
/>
|
|
39
|
+
</DlLink>
|
|
40
|
+
</div>
|
|
41
|
+
<figure
|
|
42
|
+
ref="imageHolder"
|
|
43
|
+
class="card--image__image-holder"
|
|
44
|
+
@mousemove="moveMagnifier"
|
|
45
|
+
@mouseleave="hideMagnifier"
|
|
46
|
+
@mouseenter="showMagnifier"
|
|
47
|
+
>
|
|
48
|
+
<img
|
|
49
|
+
ref="imageEl"
|
|
50
|
+
:src="image.src"
|
|
51
|
+
:style="imageStyles"
|
|
52
|
+
:alt="imageAlt"
|
|
53
|
+
class="card--image__image-holder__image"
|
|
54
|
+
:onload="onImageLoad"
|
|
55
|
+
@mousemove="movePreview"
|
|
56
|
+
>
|
|
57
|
+
<div
|
|
58
|
+
v-if="hasMagnifyingGlass"
|
|
59
|
+
ref="magnifyingGlass"
|
|
60
|
+
class="card--image__image-holder__magnifying-glass"
|
|
61
|
+
/>
|
|
62
|
+
</figure>
|
|
63
|
+
<dl-tooltip
|
|
64
|
+
v-if="zoom"
|
|
65
|
+
:delay="0"
|
|
66
|
+
anchor="center right"
|
|
67
|
+
self="center right"
|
|
68
|
+
:offset="[300, 0]"
|
|
69
|
+
max-height="280px"
|
|
70
|
+
max-width="280px"
|
|
71
|
+
background-color="var(--dl-color-panel-background)"
|
|
72
|
+
:style="tooltipPreviewStyles"
|
|
73
|
+
>
|
|
74
|
+
<figure class="card--image__image-preview">
|
|
75
|
+
<img
|
|
76
|
+
ref="imagePreview"
|
|
77
|
+
:src="image.src"
|
|
78
|
+
:alt="imageAlt"
|
|
79
|
+
class="card--image__image-preview__image"
|
|
80
|
+
>
|
|
81
|
+
</figure>
|
|
82
|
+
</dl-tooltip>
|
|
83
|
+
</div>
|
|
84
|
+
<div
|
|
85
|
+
v-if="!isEmpty"
|
|
86
|
+
class="card--content"
|
|
87
|
+
>
|
|
88
|
+
<div>
|
|
89
|
+
<slot name="header">
|
|
90
|
+
<div v-if="interactive">
|
|
91
|
+
<div class="card--content__interactive-title">
|
|
92
|
+
<div
|
|
93
|
+
class="full-width"
|
|
94
|
+
style="
|
|
95
|
+
display: flex;
|
|
96
|
+
justify-content: flex-start;
|
|
97
|
+
"
|
|
98
|
+
>
|
|
99
|
+
<dl-typography
|
|
100
|
+
size="10px"
|
|
101
|
+
color="dl-color-medium"
|
|
102
|
+
>
|
|
103
|
+
{{ title }}
|
|
104
|
+
({{ tags ? tags.length : 0 }})
|
|
105
|
+
</dl-typography>
|
|
106
|
+
</div>
|
|
107
|
+
<div
|
|
108
|
+
class="card--content__interactive-title__icons"
|
|
109
|
+
>
|
|
110
|
+
<dl-icon
|
|
111
|
+
v-for="(hint, index) in hints"
|
|
112
|
+
:key="index"
|
|
113
|
+
:icon="hint.icon"
|
|
114
|
+
:color="hint.color"
|
|
115
|
+
size="12px"
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
<div
|
|
121
|
+
v-else
|
|
122
|
+
class="card--header"
|
|
123
|
+
>
|
|
124
|
+
<span class="card--header_title">{{ title }}</span>
|
|
125
|
+
</div>
|
|
126
|
+
</slot>
|
|
127
|
+
<slot name="content">
|
|
128
|
+
<div v-if="interactive">
|
|
129
|
+
<div class="card--content__interactive-chips">
|
|
130
|
+
<dl-ellipsis
|
|
131
|
+
tooltip-position="top middle"
|
|
132
|
+
:tooltip-offset="[0, 25]"
|
|
133
|
+
>
|
|
134
|
+
<div>
|
|
135
|
+
<div
|
|
136
|
+
v-if="tags.length"
|
|
137
|
+
class="card--content__interactive-chips__row"
|
|
138
|
+
>
|
|
139
|
+
<div
|
|
140
|
+
v-for="(tag, index) in tags"
|
|
141
|
+
:key="index"
|
|
142
|
+
style="width: max-content"
|
|
143
|
+
>
|
|
144
|
+
<DlChip
|
|
145
|
+
fit
|
|
146
|
+
:label="tag.label"
|
|
147
|
+
:color="tag.color"
|
|
148
|
+
:text-color="tag.textColor"
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
<div
|
|
153
|
+
v-else
|
|
154
|
+
style="
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
height: 23px;
|
|
158
|
+
"
|
|
159
|
+
>
|
|
160
|
+
<dl-typography
|
|
161
|
+
size="10px"
|
|
162
|
+
color="dl-color-lighter"
|
|
163
|
+
>
|
|
164
|
+
No classes to display
|
|
165
|
+
</dl-typography>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</dl-ellipsis>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
<span
|
|
172
|
+
v-else
|
|
173
|
+
class="card--content_text"
|
|
174
|
+
>{{ text }}</span>
|
|
175
|
+
</slot>
|
|
176
|
+
</div>
|
|
177
|
+
<slot name="footer">
|
|
178
|
+
<div v-if="interactive">
|
|
179
|
+
<div class="card__interactive-description">
|
|
180
|
+
<div class="flex full-width items-center">
|
|
181
|
+
<dl-typography
|
|
182
|
+
size="10px"
|
|
183
|
+
color="dl-color-medium"
|
|
184
|
+
>
|
|
185
|
+
Description
|
|
186
|
+
</dl-typography>
|
|
187
|
+
</div>
|
|
188
|
+
<div class="card__interactive-description__modal">
|
|
189
|
+
<description-modal
|
|
190
|
+
:description="description"
|
|
191
|
+
@onSubmit="updateDescription"
|
|
192
|
+
/>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
<div class="card__interactive-description__text">
|
|
196
|
+
<dl-ellipsis
|
|
197
|
+
v-if="description"
|
|
198
|
+
:text="description"
|
|
199
|
+
/>
|
|
200
|
+
<dl-typography
|
|
201
|
+
v-else
|
|
202
|
+
size="12px"
|
|
203
|
+
color="dl-color-lighter"
|
|
204
|
+
>
|
|
205
|
+
No description
|
|
206
|
+
</dl-typography>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
<div
|
|
210
|
+
v-else
|
|
211
|
+
class="card--links"
|
|
212
|
+
>
|
|
213
|
+
<div
|
|
214
|
+
v-for="(link, idx) in links"
|
|
215
|
+
:key="idx"
|
|
216
|
+
class="card--links_linkItem"
|
|
217
|
+
>
|
|
218
|
+
<div class="card--links_linkItem_icon">
|
|
219
|
+
<dl-icon
|
|
220
|
+
v-if="link.icon"
|
|
221
|
+
:icon="link.icon"
|
|
222
|
+
size="12px"
|
|
223
|
+
/>
|
|
224
|
+
</div>
|
|
225
|
+
<div class="card--links_linkItem_link">
|
|
226
|
+
<dl-link
|
|
227
|
+
:external="!!link.external"
|
|
228
|
+
:href="link.href"
|
|
229
|
+
:newtab="!!link.newtab"
|
|
230
|
+
>
|
|
231
|
+
{{ link.title }}
|
|
232
|
+
</dl-link>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</slot>
|
|
237
|
+
</div>
|
|
238
|
+
<dl-empty-state
|
|
239
|
+
v-if="isEmpty"
|
|
240
|
+
v-bind="emptyStateProps"
|
|
241
|
+
>
|
|
242
|
+
<template
|
|
243
|
+
v-for="(_, slot) in $slots"
|
|
244
|
+
#[slot]="props"
|
|
245
|
+
>
|
|
246
|
+
<slot
|
|
247
|
+
:name="slot"
|
|
248
|
+
v-bind="props"
|
|
249
|
+
/>
|
|
250
|
+
</template>
|
|
251
|
+
</dl-empty-state>
|
|
252
|
+
</div>
|
|
253
|
+
</template>
|
|
254
|
+
|
|
255
|
+
<script lang="ts">
|
|
256
|
+
import { isString } from 'lodash'
|
|
257
|
+
import { computed, defineComponent, PropType, ref, toRefs } from 'vue-demi'
|
|
258
|
+
import { getColor, stringStyleToRecord } from '../../../utils'
|
|
259
|
+
import { DlEmptyStateProps } from '../../basic/types'
|
|
260
|
+
import { DlTooltip } from '../../shared'
|
|
261
|
+
import { DlIcon, DlLink, DlTypography, DlEllipsis } from '../../essential'
|
|
262
|
+
import { DlChip, DlEmptyState } from '../../basic'
|
|
263
|
+
import {
|
|
264
|
+
DlCardImageType,
|
|
265
|
+
DlCardLinkType,
|
|
266
|
+
DlCardTagType,
|
|
267
|
+
DlCardHintType,
|
|
268
|
+
DlCardIconType
|
|
269
|
+
} from './types'
|
|
270
|
+
import DescriptionModal from './components/DescriptionModal.vue'
|
|
271
|
+
|
|
272
|
+
export default defineComponent({
|
|
273
|
+
name: 'DlCard',
|
|
274
|
+
components: {
|
|
275
|
+
DlLink,
|
|
276
|
+
DlIcon,
|
|
277
|
+
DlTooltip,
|
|
278
|
+
DlChip,
|
|
279
|
+
DlEllipsis,
|
|
280
|
+
DescriptionModal,
|
|
281
|
+
DlTypography,
|
|
282
|
+
DlEmptyState
|
|
283
|
+
},
|
|
284
|
+
props: {
|
|
285
|
+
image: {
|
|
286
|
+
type: Object as PropType<DlCardImageType>,
|
|
287
|
+
default: null
|
|
288
|
+
},
|
|
289
|
+
icon: {
|
|
290
|
+
type: Object as PropType<DlCardIconType>,
|
|
291
|
+
default: null
|
|
292
|
+
},
|
|
293
|
+
title: {
|
|
294
|
+
type: String,
|
|
295
|
+
default: ''
|
|
296
|
+
},
|
|
297
|
+
text: {
|
|
298
|
+
type: String,
|
|
299
|
+
default: ''
|
|
300
|
+
},
|
|
301
|
+
description: {
|
|
302
|
+
type: String,
|
|
303
|
+
default: ''
|
|
304
|
+
},
|
|
305
|
+
links: {
|
|
306
|
+
type: Array as PropType<DlCardLinkType[]>,
|
|
307
|
+
default: (): DlCardLinkType[] => []
|
|
308
|
+
},
|
|
309
|
+
height: {
|
|
310
|
+
type: String,
|
|
311
|
+
default: 'auto'
|
|
312
|
+
},
|
|
313
|
+
width: {
|
|
314
|
+
type: String,
|
|
315
|
+
default: '200px'
|
|
316
|
+
},
|
|
317
|
+
styles: {
|
|
318
|
+
type: [Object, String],
|
|
319
|
+
default: null
|
|
320
|
+
},
|
|
321
|
+
zoom: {
|
|
322
|
+
type: Boolean,
|
|
323
|
+
default: false
|
|
324
|
+
},
|
|
325
|
+
interactive: {
|
|
326
|
+
type: Boolean,
|
|
327
|
+
default: false
|
|
328
|
+
},
|
|
329
|
+
tags: {
|
|
330
|
+
type: Array as PropType<DlCardTagType[]>,
|
|
331
|
+
default: (): DlCardTagType[] => []
|
|
332
|
+
},
|
|
333
|
+
hints: {
|
|
334
|
+
type: Array as PropType<DlCardHintType[]>,
|
|
335
|
+
default: (): DlCardHintType[] => []
|
|
336
|
+
},
|
|
337
|
+
indicatorColor: {
|
|
338
|
+
type: String,
|
|
339
|
+
default: ''
|
|
340
|
+
},
|
|
341
|
+
cardId: {
|
|
342
|
+
type: Number,
|
|
343
|
+
default: null
|
|
344
|
+
},
|
|
345
|
+
isEmpty: Boolean,
|
|
346
|
+
emptyStateProps: {
|
|
347
|
+
type: Object as PropType<DlEmptyStateProps>,
|
|
348
|
+
default: null
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
emits: ['onUpdateDescription', 'onCardActive'],
|
|
352
|
+
setup(props, { emit }) {
|
|
353
|
+
const imageEl = ref<HTMLImageElement>(null as any)
|
|
354
|
+
const imageHolder = ref<HTMLDivElement>(null as any)
|
|
355
|
+
const magnifyingGlass = ref<HTMLDivElement>(null as any)
|
|
356
|
+
const imagePreview = ref<HTMLDivElement>(null as any)
|
|
357
|
+
|
|
358
|
+
const {
|
|
359
|
+
icon,
|
|
360
|
+
image,
|
|
361
|
+
indicatorColor,
|
|
362
|
+
interactive,
|
|
363
|
+
width,
|
|
364
|
+
styles,
|
|
365
|
+
cardId,
|
|
366
|
+
zoom,
|
|
367
|
+
height
|
|
368
|
+
} = toRefs(props)
|
|
369
|
+
const hasMagnifyingGlass = ref(false)
|
|
370
|
+
const showImagePreview = ref(false)
|
|
371
|
+
const previewOffset = ref({ x: 0, y: 0 })
|
|
372
|
+
const dlCardBorder = ref('1px solid var(--dl-color-separator)')
|
|
373
|
+
const dlCardBorderBottom = ref('1px solid var(--dl-color-separator)')
|
|
374
|
+
const boxShadow = ref('0px 5px 15px 0px var(--dl-color-shadow)')
|
|
375
|
+
const isCardActive = ref(false)
|
|
376
|
+
|
|
377
|
+
const iconStyles = computed(() => {
|
|
378
|
+
return icon.value?.styles ?? ''
|
|
379
|
+
})
|
|
380
|
+
const iconSize = computed(() => {
|
|
381
|
+
return icon.value?.size ?? '50px'
|
|
382
|
+
})
|
|
383
|
+
const iconColor = computed(() => {
|
|
384
|
+
return icon.value.color ?? 'var(--dl-color-darker)'
|
|
385
|
+
})
|
|
386
|
+
const hasImageLink = computed(() => {
|
|
387
|
+
return !!(image.value?.link?.icon && image.value?.link?.href)
|
|
388
|
+
})
|
|
389
|
+
const cssVars = computed(() => {
|
|
390
|
+
return {
|
|
391
|
+
'--dl-card-colored-strip': indicatorColor.value
|
|
392
|
+
? `4px solid ${getColor(
|
|
393
|
+
indicatorColor.value,
|
|
394
|
+
'dl-color-separator'
|
|
395
|
+
)}`
|
|
396
|
+
: dlCardBorderBottom.value,
|
|
397
|
+
'--dl-card-border': dlCardBorder.value,
|
|
398
|
+
'--dl-card-box-shadow': boxShadow.value,
|
|
399
|
+
'--dl-card-content-padding': interactive.value
|
|
400
|
+
? `10px 10px ${indicatorColor.value ? '16px' : '20px'} 10px`
|
|
401
|
+
: '16px',
|
|
402
|
+
'--dl-card-link-icon-circle-size': image.value?.link?.size
|
|
403
|
+
? parseInt(image.value?.link?.size) + 8 + 'px'
|
|
404
|
+
: '20px',
|
|
405
|
+
'--dl-card-link-icon-circle-color': image.value?.link
|
|
406
|
+
?.backgroundColor
|
|
407
|
+
? image.value?.link?.backgroundColor
|
|
408
|
+
: 'rgba(255, 255, 255, 0.8)',
|
|
409
|
+
'--dl-card-width': interactive.value ? '180px' : width.value,
|
|
410
|
+
'--dl-card-image-width': interactive.value ? '180px' : '200px',
|
|
411
|
+
'--dl-card-image-height': interactive.value ? '112px' : '100px'
|
|
412
|
+
}
|
|
413
|
+
})
|
|
414
|
+
const computedStyles = computed<Record<string, string>>(() => {
|
|
415
|
+
return isString(styles.value)
|
|
416
|
+
? stringStyleToRecord(styles.value)
|
|
417
|
+
: styles.value
|
|
418
|
+
})
|
|
419
|
+
const cardStyles = computed<Record<string, any>>(() => {
|
|
420
|
+
return Object.assign(
|
|
421
|
+
{ height: height.value },
|
|
422
|
+
cssVars.value,
|
|
423
|
+
computedStyles.value
|
|
424
|
+
)
|
|
425
|
+
})
|
|
426
|
+
const imageStyles = computed<any>(() => {
|
|
427
|
+
return image.value?.styles ?? ''
|
|
428
|
+
})
|
|
429
|
+
const imageAlt = computed(() => {
|
|
430
|
+
return image.value?.alt ?? ''
|
|
431
|
+
})
|
|
432
|
+
const tooltipPreviewStyles = computed(() => {
|
|
433
|
+
return {
|
|
434
|
+
border: '1px solid var(--dl-color-separator)',
|
|
435
|
+
'border-radius': '2px',
|
|
436
|
+
'box-shadow': '0px 3px 6px var(--dl-color-separator)'
|
|
437
|
+
}
|
|
438
|
+
})
|
|
439
|
+
const imageLink = computed(() => {
|
|
440
|
+
return image.value?.link?.href ?? ''
|
|
441
|
+
})
|
|
442
|
+
|
|
443
|
+
const onImageLoad = () => {
|
|
444
|
+
if (!imageEl.value) {
|
|
445
|
+
return
|
|
446
|
+
}
|
|
447
|
+
imageEl.value.setAttribute(
|
|
448
|
+
'style',
|
|
449
|
+
`height: ${imageHolder.value.clientHeight}px; width: ${imageHolder.value.clientWidth}px; object-fit: cover;`
|
|
450
|
+
)
|
|
451
|
+
}
|
|
452
|
+
const onCardMouseover = () => {
|
|
453
|
+
if (!interactive.value) {
|
|
454
|
+
return
|
|
455
|
+
}
|
|
456
|
+
dlCardBorder.value = '1px solid var(--dl-color-hover)'
|
|
457
|
+
dlCardBorderBottom.value = dlCardBorder.value
|
|
458
|
+
}
|
|
459
|
+
const onCardMouseleave = () => {
|
|
460
|
+
if (!interactive.value) {
|
|
461
|
+
return
|
|
462
|
+
}
|
|
463
|
+
dlCardBorder.value = isCardActive.value
|
|
464
|
+
? '1px solid var(--dl-color-secondary)'
|
|
465
|
+
: '1px solid var(--dl-color-separator)'
|
|
466
|
+
dlCardBorderBottom.value = dlCardBorder.value
|
|
467
|
+
}
|
|
468
|
+
const onCardClick = () => {
|
|
469
|
+
if (!interactive.value) {
|
|
470
|
+
return
|
|
471
|
+
}
|
|
472
|
+
isCardActive.value = !isCardActive.value
|
|
473
|
+
dlCardBorder.value = isCardActive.value
|
|
474
|
+
? '1px solid var(--dl-color-secondary)'
|
|
475
|
+
: '1px solid var(--dl-color-separator)'
|
|
476
|
+
dlCardBorderBottom.value = dlCardBorder.value
|
|
477
|
+
if (isCardActive.value) {
|
|
478
|
+
emit('onCardActive', {
|
|
479
|
+
cardId: cardId.value
|
|
480
|
+
})
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
const showMagnifier = () => {
|
|
484
|
+
if (!zoom.value) return
|
|
485
|
+
hasMagnifyingGlass.value = true
|
|
486
|
+
}
|
|
487
|
+
const hideMagnifier = () => {
|
|
488
|
+
if (!zoom.value) return
|
|
489
|
+
hasMagnifyingGlass.value = false
|
|
490
|
+
}
|
|
491
|
+
const getCursorPos = (event: MouseEvent) => {
|
|
492
|
+
if (!zoom.value) return
|
|
493
|
+
const rect = imageEl.value.getBoundingClientRect()
|
|
494
|
+
|
|
495
|
+
let x = event.clientX - rect.left
|
|
496
|
+
let y = event.clientY - rect.top
|
|
497
|
+
|
|
498
|
+
x = x - window.scrollX
|
|
499
|
+
y = y - window.scrollY
|
|
500
|
+
|
|
501
|
+
return { x, y }
|
|
502
|
+
}
|
|
503
|
+
const movePreview = (event: MouseEvent) => {
|
|
504
|
+
if (!zoom.value) return
|
|
505
|
+
const rect = imageEl.value.getBoundingClientRect()
|
|
506
|
+
|
|
507
|
+
const x = event.clientX - rect.left
|
|
508
|
+
const y = event.clientY - rect.top
|
|
509
|
+
|
|
510
|
+
previewOffset.value = { x, y }
|
|
511
|
+
}
|
|
512
|
+
const moveMagnifier = (event: MouseEvent) => {
|
|
513
|
+
if (!zoom.value) return
|
|
514
|
+
const pos = getCursorPos(event)!
|
|
515
|
+
|
|
516
|
+
if (!magnifyingGlass.value?.offsetWidth) return
|
|
517
|
+
|
|
518
|
+
let x = pos.x - magnifyingGlass.value?.offsetWidth / 2
|
|
519
|
+
let y = pos.y - magnifyingGlass.value?.offsetHeight / 2
|
|
520
|
+
|
|
521
|
+
if (
|
|
522
|
+
x >
|
|
523
|
+
(imageEl.value as HTMLElement).clientWidth -
|
|
524
|
+
magnifyingGlass.value.offsetWidth
|
|
525
|
+
) {
|
|
526
|
+
x =
|
|
527
|
+
imageEl.value.clientWidth -
|
|
528
|
+
magnifyingGlass.value.offsetWidth
|
|
529
|
+
}
|
|
530
|
+
if (x < 0) {
|
|
531
|
+
x = 0
|
|
532
|
+
}
|
|
533
|
+
if (
|
|
534
|
+
y >
|
|
535
|
+
imageEl.value.clientHeight - magnifyingGlass.value.offsetHeight
|
|
536
|
+
) {
|
|
537
|
+
y =
|
|
538
|
+
imageEl.value.clientHeight -
|
|
539
|
+
magnifyingGlass.value.offsetHeight
|
|
540
|
+
}
|
|
541
|
+
if (y < 0) {
|
|
542
|
+
y = 0
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
magnifyingGlass.value.style.display = 'block'
|
|
546
|
+
magnifyingGlass.value.style.left = x + 'px'
|
|
547
|
+
magnifyingGlass.value.style.top = y + 'px'
|
|
548
|
+
magnifyingGlass.value.style.backgroundPosition =
|
|
549
|
+
'-' + x * 2 + 'px -' + y * 2 + 'px'
|
|
550
|
+
|
|
551
|
+
if (!imagePreview.value?.clientWidth) return
|
|
552
|
+
|
|
553
|
+
const previewWidth = imagePreview.value.clientWidth
|
|
554
|
+
const scaleValue = 460 / previewWidth
|
|
555
|
+
|
|
556
|
+
imagePreview.value.style.transform = 'scale(' + scaleValue + ')'
|
|
557
|
+
imagePreview.value.style.top = -(1 * y) + 'px'
|
|
558
|
+
imagePreview.value.style.left = -(2.5 * x) + 'px'
|
|
559
|
+
}
|
|
560
|
+
const updateDescription = (value: string) => {
|
|
561
|
+
emit('onUpdateDescription', {
|
|
562
|
+
cardId: cardId.value,
|
|
563
|
+
description: value
|
|
564
|
+
})
|
|
565
|
+
}
|
|
566
|
+
const stopPropagationEvent: any = (event: MouseEvent) => {
|
|
567
|
+
event.stopPropagation()
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
return {
|
|
571
|
+
imageEl,
|
|
572
|
+
imageHolder,
|
|
573
|
+
magnifyingGlass,
|
|
574
|
+
imagePreview,
|
|
575
|
+
hasMagnifyingGlass,
|
|
576
|
+
showImagePreview,
|
|
577
|
+
previewOffset,
|
|
578
|
+
dlCardBorder,
|
|
579
|
+
dlCardBorderBottom,
|
|
580
|
+
boxShadow,
|
|
581
|
+
isCardActive,
|
|
582
|
+
iconStyles,
|
|
583
|
+
cardStyles,
|
|
584
|
+
iconSize,
|
|
585
|
+
iconColor,
|
|
586
|
+
imageLink,
|
|
587
|
+
hasImageLink,
|
|
588
|
+
cssVars,
|
|
589
|
+
computedStyles,
|
|
590
|
+
imageStyles,
|
|
591
|
+
imageAlt,
|
|
592
|
+
tooltipPreviewStyles,
|
|
593
|
+
onImageLoad,
|
|
594
|
+
onCardMouseover,
|
|
595
|
+
onCardMouseleave,
|
|
596
|
+
onCardClick,
|
|
597
|
+
showMagnifier,
|
|
598
|
+
hideMagnifier,
|
|
599
|
+
getCursorPos,
|
|
600
|
+
movePreview,
|
|
601
|
+
moveMagnifier,
|
|
602
|
+
updateDescription,
|
|
603
|
+
stopPropagationEvent
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
})
|
|
607
|
+
</script>
|
|
608
|
+
|
|
609
|
+
<style lang="scss" scoped>
|
|
610
|
+
.card {
|
|
611
|
+
color: var(--dl-color-darker);
|
|
612
|
+
background-color: var(--dl-color-panel-background);
|
|
613
|
+
border: var(--dl-card-border);
|
|
614
|
+
border-radius: 2px;
|
|
615
|
+
pointer-events: auto;
|
|
616
|
+
box-shadow: var(--dl-card-box-shadow);
|
|
617
|
+
border-bottom: var(--dl-card-colored-strip);
|
|
618
|
+
width: var(--dl-card-width);
|
|
619
|
+
|
|
620
|
+
&--content {
|
|
621
|
+
padding: var(--dl-card-content-padding);
|
|
622
|
+
&_text {
|
|
623
|
+
font-size: 12px;
|
|
624
|
+
color: var(--dl-color-medium);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
&__interactive-title {
|
|
628
|
+
display: flex;
|
|
629
|
+
width: 100%;
|
|
630
|
+
font-size: 10px;
|
|
631
|
+
|
|
632
|
+
&__icons {
|
|
633
|
+
display: flex;
|
|
634
|
+
width: 80%;
|
|
635
|
+
justify-content: right;
|
|
636
|
+
gap: 10px;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
&__interactive-chips {
|
|
640
|
+
margin-top: 10px;
|
|
641
|
+
|
|
642
|
+
&__row {
|
|
643
|
+
display: flex;
|
|
644
|
+
width: 100%;
|
|
645
|
+
gap: 5px;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
&--header {
|
|
651
|
+
display: flex;
|
|
652
|
+
align-items: center;
|
|
653
|
+
flex-wrap: wrap;
|
|
654
|
+
|
|
655
|
+
&_title {
|
|
656
|
+
color: var(--dl-color-darker);
|
|
657
|
+
font-size: 14px;
|
|
658
|
+
line-height: 16px;
|
|
659
|
+
font-weight: 700;
|
|
660
|
+
margin-right: 10px;
|
|
661
|
+
margin-bottom: 10px;
|
|
662
|
+
}
|
|
663
|
+
&_shortcut {
|
|
664
|
+
color: #767676;
|
|
665
|
+
font-size: 10px;
|
|
666
|
+
line-height: 10px;
|
|
667
|
+
border-radius: 2px;
|
|
668
|
+
border: 1px solid #767676;
|
|
669
|
+
padding: 4px;
|
|
670
|
+
text-align: center;
|
|
671
|
+
margin-bottom: 10px;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
&--links {
|
|
675
|
+
margin-top: 16px;
|
|
676
|
+
display: flex;
|
|
677
|
+
align-items: center;
|
|
678
|
+
flex-wrap: wrap;
|
|
679
|
+
|
|
680
|
+
&_linkItem {
|
|
681
|
+
margin-right: 15px;
|
|
682
|
+
color: var(--dl-color-secondary);
|
|
683
|
+
font-size: 10px;
|
|
684
|
+
display: flex;
|
|
685
|
+
align-items: center;
|
|
686
|
+
|
|
687
|
+
&_icon {
|
|
688
|
+
margin-right: 7px;
|
|
689
|
+
margin-top: 2px;
|
|
690
|
+
vertical-align: middle;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
&_link {
|
|
694
|
+
vertical-align: middle;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
&--image {
|
|
699
|
+
width: var(--dl-card-image-width);
|
|
700
|
+
height: var(--dl-card-image-height);
|
|
701
|
+
position: relative;
|
|
702
|
+
overflow: hidden;
|
|
703
|
+
|
|
704
|
+
&__link-icon {
|
|
705
|
+
position: absolute;
|
|
706
|
+
display: flex;
|
|
707
|
+
top: 5px;
|
|
708
|
+
right: 5px;
|
|
709
|
+
z-index: 1;
|
|
710
|
+
cursor: pointer;
|
|
711
|
+
width: var(--dl-card-link-icon-circle-size);
|
|
712
|
+
height: var(--dl-card-link-icon-circle-size);
|
|
713
|
+
align-items: center;
|
|
714
|
+
border-radius: 50%;
|
|
715
|
+
justify-content: center;
|
|
716
|
+
background: var(--dl-card-link-icon-circle-color);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
img {
|
|
720
|
+
width: 100%;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
&__image-holder {
|
|
724
|
+
position: relative;
|
|
725
|
+
width: 100%;
|
|
726
|
+
margin: 0 auto;
|
|
727
|
+
text-align: center;
|
|
728
|
+
|
|
729
|
+
img {
|
|
730
|
+
height: auto;
|
|
731
|
+
object-fit: cover;
|
|
732
|
+
object-position: center top;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
&__image {
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
&__magnifying-glass {
|
|
739
|
+
position: absolute;
|
|
740
|
+
width: 112px;
|
|
741
|
+
height: 112px;
|
|
742
|
+
border: 1px black;
|
|
743
|
+
top: 0;
|
|
744
|
+
/*left: 20%;*/
|
|
745
|
+
/*right: 10%;*/
|
|
746
|
+
background: #ffffff;
|
|
747
|
+
opacity: 0.7;
|
|
748
|
+
cursor: zoom-in;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
&__image-preview {
|
|
753
|
+
height: 280px;
|
|
754
|
+
width: 280px;
|
|
755
|
+
margin: 0;
|
|
756
|
+
padding: 0;
|
|
757
|
+
overflow: hidden;
|
|
758
|
+
|
|
759
|
+
img {
|
|
760
|
+
position: absolute;
|
|
761
|
+
top: 0;
|
|
762
|
+
left: 0;
|
|
763
|
+
transform: scale(2);
|
|
764
|
+
transform-origin: left top;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
&--icon {
|
|
769
|
+
display: flex;
|
|
770
|
+
justify-content: center;
|
|
771
|
+
align-items: center;
|
|
772
|
+
padding-top: 34px;
|
|
773
|
+
padding-bottom: 16px;
|
|
774
|
+
color: var(--dl-color-darker);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
&__interactive-description {
|
|
778
|
+
display: flex;
|
|
779
|
+
width: 100%;
|
|
780
|
+
font-size: 10px;
|
|
781
|
+
padding-top: 16px;
|
|
782
|
+
|
|
783
|
+
&__modal {
|
|
784
|
+
display: flex;
|
|
785
|
+
width: 100%;
|
|
786
|
+
justify-content: right;
|
|
787
|
+
gap: 5px;
|
|
788
|
+
}
|
|
789
|
+
&__text {
|
|
790
|
+
font-size: 12px;
|
|
791
|
+
margin-top: 6px;
|
|
792
|
+
white-space: nowrap;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
</style>
|