@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,694 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="width: 900px; align-items: inherit">
|
|
3
|
+
<div>
|
|
4
|
+
<div class="settings">
|
|
5
|
+
<dl-switch
|
|
6
|
+
left-label="bordered"
|
|
7
|
+
value="bordered"
|
|
8
|
+
:model-value="borderState"
|
|
9
|
+
@update:model-value="updateBorderedState"
|
|
10
|
+
/>
|
|
11
|
+
<dl-switch
|
|
12
|
+
left-label="dense"
|
|
13
|
+
value="dense"
|
|
14
|
+
:model-value="denseState"
|
|
15
|
+
@update:model-value="updateDenseState"
|
|
16
|
+
/>
|
|
17
|
+
<dl-switch
|
|
18
|
+
left-label="virtual scroll"
|
|
19
|
+
value="vScroll"
|
|
20
|
+
:model-value="virtualScroll"
|
|
21
|
+
@update:model-value="updateVirtualScrollState"
|
|
22
|
+
/>
|
|
23
|
+
<dl-switch
|
|
24
|
+
left-label="resizable"
|
|
25
|
+
value="resizable"
|
|
26
|
+
:model-value="resizableState"
|
|
27
|
+
@update:model-value="updateResizableState"
|
|
28
|
+
/>
|
|
29
|
+
<dl-input
|
|
30
|
+
v-model="filter"
|
|
31
|
+
title="Filter"
|
|
32
|
+
style="width: 220px"
|
|
33
|
+
placeholder="Filter option"
|
|
34
|
+
size="m"
|
|
35
|
+
type="text"
|
|
36
|
+
/>
|
|
37
|
+
<div>
|
|
38
|
+
<div>
|
|
39
|
+
<p>Separator</p>
|
|
40
|
+
<DlOptionGroup
|
|
41
|
+
v-model="separator"
|
|
42
|
+
inline
|
|
43
|
+
:options="[
|
|
44
|
+
{
|
|
45
|
+
label: 'Horizontal (default)',
|
|
46
|
+
value: 'horizontal'
|
|
47
|
+
},
|
|
48
|
+
{ label: 'Vertical', value: 'vertical' },
|
|
49
|
+
{ label: 'Cell', value: 'cell' },
|
|
50
|
+
{ label: 'None', value: 'none' }
|
|
51
|
+
]"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div>
|
|
56
|
+
<p>Selection</p>
|
|
57
|
+
<DlOptionGroup
|
|
58
|
+
v-model="selection"
|
|
59
|
+
inline
|
|
60
|
+
:options="[
|
|
61
|
+
{ label: 'none', value: 'none' },
|
|
62
|
+
{ label: 'single', value: 'single' },
|
|
63
|
+
{ label: 'multiple', value: 'multiple' }
|
|
64
|
+
]"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div>
|
|
69
|
+
<p>Loading</p>
|
|
70
|
+
<DlOptionGroup
|
|
71
|
+
v-model="loading"
|
|
72
|
+
inline
|
|
73
|
+
:options="[
|
|
74
|
+
{ label: 'True', value: true },
|
|
75
|
+
{ label: 'False', value: false }
|
|
76
|
+
]"
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div style="margin-top: 100px">
|
|
82
|
+
<DlTreeTable
|
|
83
|
+
:separator="separator"
|
|
84
|
+
:columns="tableColumns"
|
|
85
|
+
:bordered="bordered"
|
|
86
|
+
:draggable="draggable"
|
|
87
|
+
:dense="dense"
|
|
88
|
+
class="sticky-header"
|
|
89
|
+
:filter="filter"
|
|
90
|
+
:selection="selection"
|
|
91
|
+
:loading="loading"
|
|
92
|
+
:rows="tableRows"
|
|
93
|
+
:resizable="resizable"
|
|
94
|
+
row-key="name"
|
|
95
|
+
color="dl-color-secondary"
|
|
96
|
+
title="Table Title"
|
|
97
|
+
:virtual-scroll="vScroll"
|
|
98
|
+
style="height: 500px"
|
|
99
|
+
:rows-per-page-options="rowsPerPageOptions"
|
|
100
|
+
@row-click="onRowClick"
|
|
101
|
+
@th-click="log"
|
|
102
|
+
@selectedItems="selectedItems"
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div style="margin-top: 100px">
|
|
107
|
+
<p>Infinite scrolling</p>
|
|
108
|
+
<DlTreeTable
|
|
109
|
+
:separator="separator"
|
|
110
|
+
:columns="tableColumns"
|
|
111
|
+
:bordered="bordered"
|
|
112
|
+
:draggable="draggable"
|
|
113
|
+
:dense="dense"
|
|
114
|
+
class="sticky-header"
|
|
115
|
+
:filter="filter"
|
|
116
|
+
:selection="selection"
|
|
117
|
+
:loading="loading"
|
|
118
|
+
:rows="tableRowsVS"
|
|
119
|
+
virtual-scroll
|
|
120
|
+
row-key="name"
|
|
121
|
+
color="dl-color-secondary"
|
|
122
|
+
style="height: 500px"
|
|
123
|
+
@selectedItems="selectedItems"
|
|
124
|
+
/>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</template>
|
|
129
|
+
|
|
130
|
+
<script lang="ts">
|
|
131
|
+
import {
|
|
132
|
+
DlTable,
|
|
133
|
+
DlOptionGroup,
|
|
134
|
+
DlSwitch,
|
|
135
|
+
DlInput,
|
|
136
|
+
DlButton,
|
|
137
|
+
DlTreeTable
|
|
138
|
+
} from '../components'
|
|
139
|
+
import { defineComponent, ref, computed, nextTick } from 'vue-demi'
|
|
140
|
+
import { times, cloneDeep } from 'lodash'
|
|
141
|
+
|
|
142
|
+
const columns = [
|
|
143
|
+
{
|
|
144
|
+
name: 'name',
|
|
145
|
+
required: true,
|
|
146
|
+
label: 'Dessert (100g serving)',
|
|
147
|
+
align: 'left',
|
|
148
|
+
field: 'name',
|
|
149
|
+
sortable: true
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'calories',
|
|
153
|
+
align: 'center',
|
|
154
|
+
label: 'Calories',
|
|
155
|
+
field: 'calories',
|
|
156
|
+
sortable: true
|
|
157
|
+
},
|
|
158
|
+
{ name: 'fat', label: 'Fat (g)', field: 'fat', sortable: true },
|
|
159
|
+
{ name: 'carbs', label: 'Carbs (g)', field: 'carbs' },
|
|
160
|
+
{ name: 'protein', label: 'Protein (g)', field: 'protein' },
|
|
161
|
+
{ name: 'sodium', label: 'Sodium (mg)', field: 'sodium' },
|
|
162
|
+
{
|
|
163
|
+
name: 'calcium',
|
|
164
|
+
label: 'Calcium (%)',
|
|
165
|
+
field: 'calcium',
|
|
166
|
+
sortable: true,
|
|
167
|
+
sort: (a: string | number, b: string | number) =>
|
|
168
|
+
parseInt(a as string, 10) - parseInt(b as string, 10)
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'iron',
|
|
172
|
+
label: 'Iron (%)',
|
|
173
|
+
field: 'iron',
|
|
174
|
+
sortable: true,
|
|
175
|
+
sort: (a: string | number, b: string | number) =>
|
|
176
|
+
parseInt(a as string, 10) - parseInt(b as string, 10)
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
|
|
180
|
+
const rows = [
|
|
181
|
+
{
|
|
182
|
+
name: 'Frozen Yogurt',
|
|
183
|
+
calories: 159,
|
|
184
|
+
fat: 6.0,
|
|
185
|
+
carbs: 24,
|
|
186
|
+
protein: 4.0,
|
|
187
|
+
sodium: 87,
|
|
188
|
+
calcium: '14%',
|
|
189
|
+
iron: '1%'
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'Ice cream sandwich',
|
|
193
|
+
calories: 237,
|
|
194
|
+
fat: 9.0,
|
|
195
|
+
carbs: 37,
|
|
196
|
+
protein: 4.3,
|
|
197
|
+
sodium: 129,
|
|
198
|
+
calcium: '8%',
|
|
199
|
+
iron: '1%'
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: 'Eclair',
|
|
203
|
+
calories: 262,
|
|
204
|
+
fat: 16.0,
|
|
205
|
+
carbs: 23,
|
|
206
|
+
protein: 6.0,
|
|
207
|
+
sodium: 337,
|
|
208
|
+
calcium: '6%',
|
|
209
|
+
iron: '7%'
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'Cupcake',
|
|
213
|
+
calories: 305,
|
|
214
|
+
fat: 3.7,
|
|
215
|
+
carbs: 67,
|
|
216
|
+
protein: 4.3,
|
|
217
|
+
sodium: 413,
|
|
218
|
+
calcium: '3%',
|
|
219
|
+
iron: '8%'
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: 'Gingerbread',
|
|
223
|
+
calories: 356,
|
|
224
|
+
fat: 16.0,
|
|
225
|
+
carbs: 49,
|
|
226
|
+
protein: 3.9,
|
|
227
|
+
sodium: 327,
|
|
228
|
+
calcium: '7%',
|
|
229
|
+
iron: '16%'
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: 'Jelly bean',
|
|
233
|
+
calories: 375,
|
|
234
|
+
fat: 0.0,
|
|
235
|
+
carbs: 94,
|
|
236
|
+
protein: 0.0,
|
|
237
|
+
sodium: 50,
|
|
238
|
+
calcium: '0%',
|
|
239
|
+
iron: '0%'
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: 'Lollipop',
|
|
243
|
+
calories: 392,
|
|
244
|
+
fat: 0.2,
|
|
245
|
+
carbs: 98,
|
|
246
|
+
protein: 0,
|
|
247
|
+
sodium: 38,
|
|
248
|
+
calcium: '0%',
|
|
249
|
+
iron: '2%'
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: 'Honeycomb',
|
|
253
|
+
calories: 408,
|
|
254
|
+
fat: 3.2,
|
|
255
|
+
carbs: 87,
|
|
256
|
+
protein: 6.5,
|
|
257
|
+
sodium: 562,
|
|
258
|
+
calcium: '0%',
|
|
259
|
+
iron: '45%'
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: 'Donut',
|
|
263
|
+
calories: 452,
|
|
264
|
+
fat: 25.0,
|
|
265
|
+
carbs: 51,
|
|
266
|
+
protein: 4.9,
|
|
267
|
+
sodium: 326,
|
|
268
|
+
calcium: '2%',
|
|
269
|
+
iron: '22%'
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'KitKat',
|
|
273
|
+
calories: 518,
|
|
274
|
+
fat: 26.0,
|
|
275
|
+
carbs: 65,
|
|
276
|
+
protein: 7,
|
|
277
|
+
sodium: 54,
|
|
278
|
+
calcium: '12%',
|
|
279
|
+
iron: '6%'
|
|
280
|
+
},
|
|
281
|
+
...times(100, (index) => ({
|
|
282
|
+
name: 'KitKat' + index,
|
|
283
|
+
calories: 518,
|
|
284
|
+
fat: 26.0,
|
|
285
|
+
carbs: 65,
|
|
286
|
+
protein: 7,
|
|
287
|
+
sodium: 54,
|
|
288
|
+
calcium: '12%',
|
|
289
|
+
iron: '6%'
|
|
290
|
+
}))
|
|
291
|
+
]
|
|
292
|
+
|
|
293
|
+
const rows2 = [
|
|
294
|
+
{
|
|
295
|
+
name: 'Frozen Yogurt',
|
|
296
|
+
calories: 159,
|
|
297
|
+
fat: 6,
|
|
298
|
+
carbs: 24,
|
|
299
|
+
protein: 4,
|
|
300
|
+
sodium: 87,
|
|
301
|
+
calcium: '14%',
|
|
302
|
+
iron: '1%',
|
|
303
|
+
children: [
|
|
304
|
+
{
|
|
305
|
+
name: 'Eclair1',
|
|
306
|
+
calories: 262,
|
|
307
|
+
fat: 16,
|
|
308
|
+
carbs: 23,
|
|
309
|
+
protein: 6,
|
|
310
|
+
sodium: 337,
|
|
311
|
+
calcium: '6%',
|
|
312
|
+
iron: '7%'
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: 'Eclair2',
|
|
318
|
+
calories: 262,
|
|
319
|
+
fat: 16,
|
|
320
|
+
carbs: 23,
|
|
321
|
+
protein: 6,
|
|
322
|
+
sodium: 337,
|
|
323
|
+
calcium: '6%',
|
|
324
|
+
iron: '7%'
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: 'Ice cream sandwich',
|
|
328
|
+
calories: 237,
|
|
329
|
+
fat: 9,
|
|
330
|
+
carbs: 37,
|
|
331
|
+
protein: 4.3,
|
|
332
|
+
sodium: 129,
|
|
333
|
+
calcium: '8%',
|
|
334
|
+
iron: '1%',
|
|
335
|
+
children: [
|
|
336
|
+
{
|
|
337
|
+
name: 'Eclair3.0',
|
|
338
|
+
calories: 262,
|
|
339
|
+
fat: 16,
|
|
340
|
+
carbs: 23,
|
|
341
|
+
protein: 6,
|
|
342
|
+
sodium: 337,
|
|
343
|
+
calcium: '6%',
|
|
344
|
+
iron: '7%'
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: 'Eclair3',
|
|
348
|
+
calories: 262,
|
|
349
|
+
fat: 16,
|
|
350
|
+
carbs: 23,
|
|
351
|
+
protein: 6,
|
|
352
|
+
sodium: 337,
|
|
353
|
+
calcium: '6%',
|
|
354
|
+
iron: '7%',
|
|
355
|
+
children: [
|
|
356
|
+
{
|
|
357
|
+
name: 'Eclair4',
|
|
358
|
+
calories: 262,
|
|
359
|
+
fat: 16,
|
|
360
|
+
carbs: 23,
|
|
361
|
+
protein: 6,
|
|
362
|
+
sodium: 337,
|
|
363
|
+
calcium: '6%',
|
|
364
|
+
iron: '7%',
|
|
365
|
+
children: [
|
|
366
|
+
{
|
|
367
|
+
name: 'Eclair5',
|
|
368
|
+
calories: 262,
|
|
369
|
+
fat: 16,
|
|
370
|
+
carbs: 23,
|
|
371
|
+
protein: 6,
|
|
372
|
+
sodium: 337,
|
|
373
|
+
calcium: '6%',
|
|
374
|
+
iron: '7%',
|
|
375
|
+
children: [
|
|
376
|
+
{
|
|
377
|
+
name: 'Eclair6',
|
|
378
|
+
calories: 262,
|
|
379
|
+
fat: 16,
|
|
380
|
+
carbs: 23,
|
|
381
|
+
protein: 6,
|
|
382
|
+
sodium: 337,
|
|
383
|
+
calcium: '6%',
|
|
384
|
+
iron: '7%',
|
|
385
|
+
children: [
|
|
386
|
+
{
|
|
387
|
+
name: 'EclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclairEclair',
|
|
388
|
+
calories: 262,
|
|
389
|
+
fat: 16,
|
|
390
|
+
carbs: 23,
|
|
391
|
+
protein: 6,
|
|
392
|
+
sodium: 337,
|
|
393
|
+
calcium: '6%',
|
|
394
|
+
iron: '7%'
|
|
395
|
+
}
|
|
396
|
+
]
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
]
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: 'Eclair7',
|
|
408
|
+
calories: 262,
|
|
409
|
+
fat: 16,
|
|
410
|
+
carbs: 23,
|
|
411
|
+
protein: 6,
|
|
412
|
+
sodium: 337,
|
|
413
|
+
calcium: '6%',
|
|
414
|
+
iron: '7%',
|
|
415
|
+
children: [
|
|
416
|
+
{
|
|
417
|
+
name: 'Eclair8',
|
|
418
|
+
calories: 262,
|
|
419
|
+
fat: 16,
|
|
420
|
+
carbs: 23,
|
|
421
|
+
protein: 6,
|
|
422
|
+
sodium: 337,
|
|
423
|
+
calcium: '6%',
|
|
424
|
+
iron: '7%'
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: 'Eclair9',
|
|
430
|
+
calories: 262,
|
|
431
|
+
fat: 16,
|
|
432
|
+
carbs: 23,
|
|
433
|
+
protein: 6,
|
|
434
|
+
sodium: 337,
|
|
435
|
+
calcium: '6%',
|
|
436
|
+
iron: '7%'
|
|
437
|
+
},
|
|
438
|
+
...times(100, (index) => ({
|
|
439
|
+
name: 'KitKat' + index,
|
|
440
|
+
calories: 518,
|
|
441
|
+
fat: 26.0,
|
|
442
|
+
carbs: 65,
|
|
443
|
+
protein: 7,
|
|
444
|
+
sodium: 54,
|
|
445
|
+
calcium: '12%',
|
|
446
|
+
iron: '6%'
|
|
447
|
+
}))
|
|
448
|
+
]
|
|
449
|
+
|
|
450
|
+
type Rows = (typeof rows)[0]
|
|
451
|
+
|
|
452
|
+
interface RowsWithIndex extends Rows {
|
|
453
|
+
index?: number
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export default defineComponent({
|
|
457
|
+
components: {
|
|
458
|
+
DlSwitch,
|
|
459
|
+
DlOptionGroup,
|
|
460
|
+
DlInput,
|
|
461
|
+
DlTreeTable
|
|
462
|
+
},
|
|
463
|
+
setup() {
|
|
464
|
+
const filter = ref('')
|
|
465
|
+
const selected = ref([])
|
|
466
|
+
const selection = ref('none')
|
|
467
|
+
const separator = ref('horizontal')
|
|
468
|
+
const bordered = ref(false)
|
|
469
|
+
const loading = ref(false)
|
|
470
|
+
const dense = ref(false)
|
|
471
|
+
const vScroll = ref(false)
|
|
472
|
+
const resizable = ref(false)
|
|
473
|
+
const borderState = ref([])
|
|
474
|
+
const denseState = ref([])
|
|
475
|
+
const virtualScroll = ref([])
|
|
476
|
+
const resizableState = ref([])
|
|
477
|
+
const tableRows = ref(cloneDeep(rows2))
|
|
478
|
+
const tableRowsVS = ref(cloneDeep(rows2))
|
|
479
|
+
const draggable = ref('both')
|
|
480
|
+
const tableColumns = ref(columns)
|
|
481
|
+
const rowsPerPageOptions = ref([10, 12, 14, 16])
|
|
482
|
+
|
|
483
|
+
const infiniteLoading = ref(false)
|
|
484
|
+
|
|
485
|
+
const nextPageNumber = ref(2)
|
|
486
|
+
|
|
487
|
+
let allRows: RowsWithIndex[] = []
|
|
488
|
+
for (let i = 0; i < 100; i++) {
|
|
489
|
+
allRows = allRows.concat(
|
|
490
|
+
cloneDeep(rows)
|
|
491
|
+
.slice(0)
|
|
492
|
+
.map((r) => ({ ...r }))
|
|
493
|
+
)
|
|
494
|
+
}
|
|
495
|
+
allRows.forEach((row, index) => {
|
|
496
|
+
row.index = index
|
|
497
|
+
})
|
|
498
|
+
|
|
499
|
+
const pageSize = 50
|
|
500
|
+
const lastPageNumber = Math.ceil(allRows.length / pageSize)
|
|
501
|
+
|
|
502
|
+
const computedRows = computed(() =>
|
|
503
|
+
allRows.slice(0, pageSize * (nextPageNumber.value - 1))
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
const onScroll = ({ to, ref }: { to: number; ref: any }) => {
|
|
507
|
+
const lastIndex = computedRows.value.length - 1
|
|
508
|
+
|
|
509
|
+
if (
|
|
510
|
+
infiniteLoading.value !== true &&
|
|
511
|
+
nextPageNumber.value < lastPageNumber &&
|
|
512
|
+
to === lastIndex
|
|
513
|
+
) {
|
|
514
|
+
infiniteLoading.value = true
|
|
515
|
+
|
|
516
|
+
setTimeout(() => {
|
|
517
|
+
nextPageNumber.value++
|
|
518
|
+
nextTick(() => {
|
|
519
|
+
ref.refresh()
|
|
520
|
+
infiniteLoading.value = false
|
|
521
|
+
})
|
|
522
|
+
}, 500)
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
const pagination = ref({
|
|
527
|
+
sortBy: 'desc',
|
|
528
|
+
descending: false,
|
|
529
|
+
page: 2,
|
|
530
|
+
rowsPerPage: 3
|
|
531
|
+
// rowsNumber: xx if getting data from a server
|
|
532
|
+
})
|
|
533
|
+
|
|
534
|
+
const pagesNumber = computed(() => {
|
|
535
|
+
return Math.ceil(rows.length / pagination.value.rowsPerPage)
|
|
536
|
+
})
|
|
537
|
+
|
|
538
|
+
function fixPagination(p: typeof pagination.value) {
|
|
539
|
+
if (p.page < 1) {
|
|
540
|
+
p.page = 1
|
|
541
|
+
}
|
|
542
|
+
if (p.rowsPerPage !== void 0 && p.rowsPerPage < 1) {
|
|
543
|
+
p.rowsPerPage = 0
|
|
544
|
+
}
|
|
545
|
+
return p
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
const lastRowIndex = computed(() => {
|
|
549
|
+
const { page, rowsPerPage } = pagination.value
|
|
550
|
+
return page * rowsPerPage
|
|
551
|
+
})
|
|
552
|
+
|
|
553
|
+
const setPagination = (val: Partial<typeof pagination.value>) => {
|
|
554
|
+
pagination.value = fixPagination({
|
|
555
|
+
...pagination.value,
|
|
556
|
+
...val
|
|
557
|
+
})
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
function firstPage() {
|
|
561
|
+
setPagination({ page: 1 })
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
function prevPage() {
|
|
565
|
+
const { page } = pagination.value
|
|
566
|
+
if (page > 1) {
|
|
567
|
+
setPagination({ page: page - 1 })
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
function nextPage() {
|
|
572
|
+
const { page, rowsPerPage } = pagination.value
|
|
573
|
+
|
|
574
|
+
if (
|
|
575
|
+
lastRowIndex.value > 0 &&
|
|
576
|
+
page * rowsPerPage < tableRows.value.length
|
|
577
|
+
) {
|
|
578
|
+
setPagination({ page: page + 1 })
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
const isLastPage = computed(
|
|
583
|
+
() => pagination.value.page >= pagesNumber.value
|
|
584
|
+
)
|
|
585
|
+
|
|
586
|
+
const isFirstPage = computed(() => pagination.value.page === 1)
|
|
587
|
+
|
|
588
|
+
function lastPage() {
|
|
589
|
+
setPagination({ page: pagesNumber.value })
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
const onRowClick = (item: any) => {
|
|
593
|
+
console.log('onRowClick: ', item)
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
return {
|
|
597
|
+
filter,
|
|
598
|
+
selected,
|
|
599
|
+
selection,
|
|
600
|
+
separator,
|
|
601
|
+
bordered,
|
|
602
|
+
loading,
|
|
603
|
+
dense,
|
|
604
|
+
vScroll,
|
|
605
|
+
resizable,
|
|
606
|
+
denseState,
|
|
607
|
+
borderState,
|
|
608
|
+
virtualScroll,
|
|
609
|
+
resizableState,
|
|
610
|
+
tableRows,
|
|
611
|
+
tableRowsVS,
|
|
612
|
+
draggable,
|
|
613
|
+
tableColumns,
|
|
614
|
+
rowsPerPageOptions,
|
|
615
|
+
onScroll,
|
|
616
|
+
computedRows,
|
|
617
|
+
infiniteLoading,
|
|
618
|
+
pagination,
|
|
619
|
+
pagesNumber,
|
|
620
|
+
firstPage,
|
|
621
|
+
lastPage,
|
|
622
|
+
nextPage,
|
|
623
|
+
prevPage,
|
|
624
|
+
isLastPage,
|
|
625
|
+
isFirstPage,
|
|
626
|
+
onRowClick
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
|
|
630
|
+
methods: {
|
|
631
|
+
selectedItems(payload: any) {
|
|
632
|
+
console.log('Demo updateSelected: ', payload)
|
|
633
|
+
},
|
|
634
|
+
updateBorderedState(val: boolean[]): void {
|
|
635
|
+
this.borderState = val
|
|
636
|
+
|
|
637
|
+
this.bordered = val.length !== 0
|
|
638
|
+
},
|
|
639
|
+
updateVirtualScrollState(val: boolean[]): void {
|
|
640
|
+
this.virtualScroll = val
|
|
641
|
+
|
|
642
|
+
this.vScroll = val.length !== 0
|
|
643
|
+
},
|
|
644
|
+
updateDenseState(val: boolean[]): void {
|
|
645
|
+
this.denseState = val
|
|
646
|
+
|
|
647
|
+
this.dense = val.length !== 0
|
|
648
|
+
},
|
|
649
|
+
updateResizableState(val: boolean[]): void {
|
|
650
|
+
this.resizableState = val
|
|
651
|
+
|
|
652
|
+
this.resizable = val.length !== 0
|
|
653
|
+
},
|
|
654
|
+
log(...args: any[]) {
|
|
655
|
+
console.log(...args)
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
})
|
|
659
|
+
</script>
|
|
660
|
+
|
|
661
|
+
<style scoped lang="scss">
|
|
662
|
+
.settings {
|
|
663
|
+
display: flex;
|
|
664
|
+
width: 100%;
|
|
665
|
+
max-width: 600px;
|
|
666
|
+
gap: 10px;
|
|
667
|
+
justify-content: center;
|
|
668
|
+
flex-wrap: wrap;
|
|
669
|
+
& > * {
|
|
670
|
+
flex-grow: 1;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.sticky-header {
|
|
675
|
+
::v-deep .dl-table__top,
|
|
676
|
+
::v-deep .dl-table__bottom,
|
|
677
|
+
::v-deep thead tr:first-child th {
|
|
678
|
+
/* bg color is important for th; just specify one */
|
|
679
|
+
background-color: var(--dl-color-panel-background);
|
|
680
|
+
}
|
|
681
|
+
::v-deep thead tr th {
|
|
682
|
+
position: sticky !important;
|
|
683
|
+
z-index: 1;
|
|
684
|
+
}
|
|
685
|
+
::v-deep thead tr:first-child th {
|
|
686
|
+
top: 0;
|
|
687
|
+
}
|
|
688
|
+
/* this is when the loading indicator appears */
|
|
689
|
+
&.dl-table--loading thead tr:last-child th {
|
|
690
|
+
/* height of all previous header rows */
|
|
691
|
+
top: 40px;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
</style>
|