@dataloop-ai/components 0.13.0
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/.eslintrc.js +154 -0
- package/.prettierrc.json +7 -0
- package/Dockerfile +12 -0
- package/LICENSE +201 -0
- package/README.md +43 -0
- package/favicon.ico +0 -0
- package/index.html +13 -0
- package/index.ts +1 -0
- package/jest.config.js +16 -0
- package/jest.setup.js +59 -0
- package/models.ts +1 -0
- package/package.json +109 -0
- package/src/App.vue +201 -0
- package/src/assets/globals.scss +253 -0
- package/src/assets/globalsKeys.ts +28 -0
- package/src/components/DlAccordion/AccordionHeader.vue +148 -0
- package/src/components/DlAccordion/DlAccordion.vue +108 -0
- package/src/components/DlAccordion/index.ts +2 -0
- package/src/components/DlAlert.vue +227 -0
- package/src/components/DlAvatar.vue +99 -0
- package/src/components/DlBadge.vue +127 -0
- package/src/components/DlButton/DlButton.vue +370 -0
- package/src/components/DlButton/index.ts +4 -0
- package/src/components/DlButton/utils.ts +169 -0
- package/src/components/DlButtonGroup.vue +122 -0
- package/src/components/DlCheckbox.vue +298 -0
- package/src/components/DlChip/DlChip.vue +244 -0
- package/src/components/DlChip/index.ts +4 -0
- package/src/components/DlChip/utils.ts +100 -0
- package/src/components/DlColorPicker/DlAlpha.vue +142 -0
- package/src/components/DlColorPicker/DlBox.vue +75 -0
- package/src/components/DlColorPicker/DlColorPicker.vue +306 -0
- package/src/components/DlColorPicker/DlColors.vue +139 -0
- package/src/components/DlColorPicker/DlHue.vue +135 -0
- package/src/components/DlColorPicker/DlPreview.vue +61 -0
- package/src/components/DlColorPicker/DlSaturation.vue +152 -0
- package/src/components/DlColorPicker/constants.ts +16 -0
- package/src/components/DlColorPicker/index.ts +20 -0
- package/src/components/DlColorPicker/types.ts +11 -0
- package/src/components/DlColorPicker/utils.ts +128 -0
- package/src/components/DlCounters.vue +173 -0
- package/src/components/DlDatePicker/DlCalendar.vue +332 -0
- package/src/components/DlDatePicker/DlDatePicker.vue +315 -0
- package/src/components/DlDatePicker/DlMonthCalendar.vue +282 -0
- package/src/components/DlDatePicker/classes/Calendar.ts +110 -0
- package/src/components/DlDatePicker/classes/CalendarDate.ts +12 -0
- package/src/components/DlDatePicker/classes/CustomDate.ts +218 -0
- package/src/components/DlDatePicker/index.ts +3 -0
- package/src/components/DlDatePicker/isInRange.ts +44 -0
- package/src/components/DlDatePicker/types.ts +4 -0
- package/src/components/DlDatePicker/utils.ts +39 -0
- package/src/components/DlDateTimeRange/DlCardSidebar.vue +109 -0
- package/src/components/DlDateTimeRange/DlDateInput.vue +105 -0
- package/src/components/DlDateTimeRange/DlDateTimeRange.vue +468 -0
- package/src/components/DlDateTimeRange/index.ts +3 -0
- package/src/components/DlDateTimeRange/types.ts +42 -0
- package/src/components/DlDialogBox/DlDialogBox.vue +196 -0
- package/src/components/DlDialogBox/DlDialogBoxFooter.vue +22 -0
- package/src/components/DlDialogBox/DlDialogBoxHeader.vue +75 -0
- package/src/components/DlDialogBox/index.ts +5 -0
- package/src/components/DlDropdownButton.vue +463 -0
- package/src/components/DlIcon.vue +147 -0
- package/src/components/DlInfoErrorMessage.vue +91 -0
- package/src/components/DlItem/DlItem.vue +35 -0
- package/src/components/DlItem/index.ts +2 -0
- package/src/components/DlItemSection.vue +88 -0
- package/src/components/DlLink/DlLink.vue +76 -0
- package/src/components/DlLink/index.ts +4 -0
- package/src/components/DlLink/utils.ts +4 -0
- package/src/components/DlList.vue +61 -0
- package/src/components/DlListItem/DlListItem.vue +205 -0
- package/src/components/DlListItem/index.ts +3 -0
- package/src/components/DlListItem/utils.ts +14 -0
- package/src/components/DlMenu/DlMenu.vue +438 -0
- package/src/components/DlMenu/index.ts +3 -0
- package/src/components/DlMenu/utils.ts +138 -0
- package/src/components/DlOptionGroup/DlOptionGroup.vue +201 -0
- package/src/components/DlOptionGroup/MenuItemWrapper.vue +48 -0
- package/src/components/DlOptionGroup/OptionGroup.types.ts +36 -0
- package/src/components/DlOptionGroup/SimpleWrapper.vue +28 -0
- package/src/components/DlOptionGroup/index.ts +4 -0
- package/src/components/DlOptionGroup/utils.ts +40 -0
- package/src/components/DlPagination/DlPagination.vue +184 -0
- package/src/components/DlPagination/PageNavigation.vue +350 -0
- package/src/components/DlPagination/PaginationLegend.vue +41 -0
- package/src/components/DlPagination/QuickNavigation.vue +146 -0
- package/src/components/DlPagination/RowsSelector.vue +74 -0
- package/src/components/DlPagination/index.ts +3 -0
- package/src/components/DlPanelContainer/DlPanel.vue +213 -0
- package/src/components/DlPanelContainer/DlPanelContainer.vue +527 -0
- package/src/components/DlPanelContainer/index.ts +4 -0
- package/src/components/DlPopup/DlPopup.vue +478 -0
- package/src/components/DlPopup/DraggableUpper.vue +64 -0
- package/src/components/DlPopup/PopupHeader.vue +129 -0
- package/src/components/DlPopup/index.ts +1 -0
- package/src/components/DlProgressBar.vue +159 -0
- package/src/components/DlProgressChart.vue +299 -0
- package/src/components/DlRadio.vue +218 -0
- package/src/components/DlRange/DlRange.vue +439 -0
- package/src/components/DlRange/utils.ts +209 -0
- package/src/components/DlSearch.vue +155 -0
- package/src/components/DlSelect/DlSelect.vue +992 -0
- package/src/components/DlSelect/SelectOption.vue +261 -0
- package/src/components/DlSelect/index.ts +4 -0
- package/src/components/DlSelect/utils.ts +43 -0
- package/src/components/DlSkeleton.vue +72 -0
- package/src/components/DlSlider/DlSlider.vue +243 -0
- package/src/components/DlSlider/components/DlSliderBase.vue +380 -0
- package/src/components/DlSlider/components/DlSliderInput.vue +123 -0
- package/src/components/DlSlider/components/index.ts +4 -0
- package/src/components/DlSlider/index.ts +3 -0
- package/src/components/DlSlider/sliderStyles.scss +109 -0
- package/src/components/DlSlider/useSlider.ts +277 -0
- package/src/components/DlSlider/utils.ts +7 -0
- package/src/components/DlSmartSearch/DlJsonEditor.vue +309 -0
- package/src/components/DlSmartSearch/DlSmartSearch.vue +333 -0
- package/src/components/DlSmartSearch/DlSmartSearchInput.vue +741 -0
- package/src/components/DlSmartSearch/DlSuggestionsDropdown.vue +73 -0
- package/src/components/DlSmartSearch/highlightSyntax.ts +169 -0
- package/src/components/DlSmartSearch/index.ts +4 -0
- package/src/components/DlSmartSearch/types.ts +36 -0
- package/src/components/DlSmartSearch/utils.ts +45 -0
- package/src/components/DlStepper/DlStepper.vue +196 -0
- package/src/components/DlStepper/DlStepperContainer.vue +55 -0
- package/src/components/DlStepper/DlStepperContent.vue +101 -0
- package/src/components/DlStepper/DlStepperFooter.vue +133 -0
- package/src/components/DlStepper/DlStepperHeader.vue +49 -0
- package/src/components/DlStepper/DlStepperSidebar.vue +167 -0
- package/src/components/DlStepper/Step.ts +101 -0
- package/src/components/DlStepper/Stepper.ts +107 -0
- package/src/components/DlStepper/index.ts +7 -0
- package/src/components/DlStepper/interfaces.ts +11 -0
- package/src/components/DlSwitch.vue +280 -0
- package/src/components/DlTabPanels/DlTabPanel.vue +22 -0
- package/src/components/DlTabPanels/DlTabPanels.vue +41 -0
- package/src/components/DlTabPanels/index.ts +4 -0
- package/src/components/DlTabPanels/utils.ts +19 -0
- package/src/components/DlTable/DlTable.vue +1264 -0
- package/src/components/DlTable/DlTd.vue +109 -0
- package/src/components/DlTable/DlTh.vue +126 -0
- package/src/components/DlTable/DlTr.vue +44 -0
- package/src/components/DlTable/ResizableManager.ts +233 -0
- package/src/components/DlTable/dl-table-styles.scss +466 -0
- package/src/components/DlTable/hooks/tableActions.ts +64 -0
- package/src/components/DlTable/hooks/tableColumnSelection.ts +112 -0
- package/src/components/DlTable/hooks/tableFilter.ts +42 -0
- package/src/components/DlTable/hooks/tablePagination.ts +197 -0
- package/src/components/DlTable/hooks/tableRowExpand.ts +55 -0
- package/src/components/DlTable/hooks/tableRowSelection.ts +106 -0
- package/src/components/DlTable/hooks/tableSort.ts +125 -0
- package/src/components/DlTable/index.ts +6 -0
- package/src/components/DlTable/types.ts +96 -0
- package/src/components/DlTabs/DlTab.vue +146 -0
- package/src/components/DlTabs/DlTabs.vue +192 -0
- package/src/components/DlTabs/TabsWrapper.vue +104 -0
- package/src/components/DlTabs/index.ts +4 -0
- package/src/components/DlTabs/types.ts +8 -0
- package/src/components/DlTextArea.vue +151 -0
- package/src/components/DlTextHolder.vue +65 -0
- package/src/components/DlTextInput.vue +753 -0
- package/src/components/DlThemeProvider.vue +41 -0
- package/src/components/DlTimePicker/DlTimeCounter.vue +81 -0
- package/src/components/DlTimePicker/DlTimePicker.vue +151 -0
- package/src/components/DlTimePicker/DlTimePickerInput.vue +311 -0
- package/src/components/DlTimePicker/index.ts +3 -0
- package/src/components/DlTimePicker/types.ts +4 -0
- package/src/components/DlTooltip.vue +456 -0
- package/src/components/DlTrend.vue +97 -0
- package/src/components/DlTypography.vue +87 -0
- package/src/components/DlVirtualScroll/DlVirtualScroll.vue +290 -0
- package/src/components/DlVirtualScroll/index.ts +3 -0
- package/src/components/DlVirtualScroll/useVirtualScroll.ts +833 -0
- package/src/components/DlWidget/DlWidget.vue +50 -0
- package/src/components/DlWidget/DlWidgetGrid.vue +360 -0
- package/src/components/DlWidget/index.ts +4 -0
- package/src/components/DlWidget/types.ts +6 -0
- package/src/components/DlWidget/utils.ts +30 -0
- package/src/components/index.ts +118 -0
- package/src/demo/DlAccordionDemo.vue +60 -0
- package/src/demo/DlAlertDemo.vue +54 -0
- package/src/demo/DlAvatarDemo.vue +43 -0
- package/src/demo/DlBadgeDemo.vue +65 -0
- package/src/demo/DlButtonDemo.vue +266 -0
- package/src/demo/DlCheckboxDemo.vue +50 -0
- package/src/demo/DlChipDemo.vue +181 -0
- package/src/demo/DlColorPickerDemo.vue +43 -0
- package/src/demo/DlCounterDemo.vue +53 -0
- package/src/demo/DlDateTimeRangeDemo.vue +217 -0
- package/src/demo/DlDialogBoxDemo.vue +175 -0
- package/src/demo/DlDropdownButtonDemo.vue +260 -0
- package/src/demo/DlIconDemo.vue +47 -0
- package/src/demo/DlLinkDemo.vue +23 -0
- package/src/demo/DlListDemo.vue +177 -0
- package/src/demo/DlMenuDemo.vue +524 -0
- package/src/demo/DlOptionGroupDemo.vue +79 -0
- package/src/demo/DlPaginationDemo.vue +44 -0
- package/src/demo/DlPanelContainerDemo.vue +221 -0
- package/src/demo/DlPopupDemo.vue +58 -0
- package/src/demo/DlProgressBarDemo.vue +22 -0
- package/src/demo/DlProgressChartDemo.vue +71 -0
- package/src/demo/DlRadioDemo.vue +35 -0
- package/src/demo/DlRangeDemo.vue +44 -0
- package/src/demo/DlSearchDemo.vue +27 -0
- package/src/demo/DlSelectDemo.vue +355 -0
- package/src/demo/DlSkeletonDemo.vue +20 -0
- package/src/demo/DlSliderDemo.vue +47 -0
- package/src/demo/DlStepperDemo/CenteredStepperInDialogBox.vue +260 -0
- package/src/demo/DlStepperDemo/SimpleStepper.vue +202 -0
- package/src/demo/DlStepperDemo/StepperInDialogBox.vue +261 -0
- package/src/demo/DlStepperDemo/index.ts +5 -0
- package/src/demo/DlStepperDemo/steps/AssignmentsStep.vue +97 -0
- package/src/demo/DlStepperDemo/steps/DataStep.vue +158 -0
- package/src/demo/DlStepperDemo/steps/GeneralStep.vue +106 -0
- package/src/demo/DlStepperDemo/steps/InstructionStep.vue +176 -0
- package/src/demo/DlStepperDemo/steps/QualityStep.vue +65 -0
- package/src/demo/DlSwitchDemo.vue +49 -0
- package/src/demo/DlTableDemo.vue +475 -0
- package/src/demo/DlTabsDemo.vue +67 -0
- package/src/demo/DlTdDemo.vue +19 -0
- package/src/demo/DlTextAreaDemo.vue +37 -0
- package/src/demo/DlTextHolderDemo.vue +42 -0
- package/src/demo/DlTextInputDemo.vue +89 -0
- package/src/demo/DlThDemo.vue +32 -0
- package/src/demo/DlTooltipDemo.vue +60 -0
- package/src/demo/DlTrDemo.vue +18 -0
- package/src/demo/DlTrendDemo.vue +25 -0
- package/src/demo/DlTypographyDemo.vue +93 -0
- package/src/demo/DlWidgetDemo.vue +157 -0
- package/src/demo/SmartSearchDemo/DlSmartSearchDemo.vue +202 -0
- package/src/demo/SmartSearchDemo/schema.ts +44 -0
- package/src/demo/index.ts +141 -0
- package/src/directives/TouchPan.ts +525 -0
- package/src/env.d.ts +8 -0
- package/src/hooks/use-anchor.ts +223 -0
- package/src/hooks/use-model-toggle.ts +181 -0
- package/src/hooks/use-portal.ts +104 -0
- package/src/hooks/use-scroll-target.ts +53 -0
- package/src/hooks/use-size-observer.ts +24 -0
- package/src/hooks/use-suggestions.ts +355 -0
- package/src/hooks/use-tick.ts +32 -0
- package/src/hooks/use-timeout.ts +20 -0
- package/src/hooks/use-transition.ts +32 -0
- package/src/hooks/use-window-size.ts +25 -0
- package/src/hooks/useForm.ts +12 -0
- package/src/index.ts +7 -0
- package/src/main.ts +4 -0
- package/src/models.ts +4 -0
- package/src/types.ts +6 -0
- package/src/utils/calcs.ts +18 -0
- package/src/utils/click-outside.ts +108 -0
- package/src/utils/component-name-parser.ts +1 -0
- package/src/utils/css-color-names.ts +150 -0
- package/src/utils/dom.ts +55 -0
- package/src/utils/draggable-table.ts +416 -0
- package/src/utils/escape-key.ts +54 -0
- package/src/utils/events.ts +67 -0
- package/src/utils/focus-manager.ts +33 -0
- package/src/utils/focusout.ts +29 -0
- package/src/utils/format.ts +3 -0
- package/src/utils/getColor.ts +17 -0
- package/src/utils/getLighterGradient.ts +36 -0
- package/src/utils/getRootStyles.ts +52 -0
- package/src/utils/global-config.ts +6 -0
- package/src/utils/global-nodes.ts +42 -0
- package/src/utils/includes.ts +3 -0
- package/src/utils/index.ts +29 -0
- package/src/utils/inject-object-prop.ts +21 -0
- package/src/utils/input-sizes.ts +7 -0
- package/src/utils/is-ellipsis-active.ts +3 -0
- package/src/utils/is-in-viewport.ts +13 -0
- package/src/utils/is.ts +15 -0
- package/src/utils/key-composition.ts +17 -0
- package/src/utils/keyCodes.ts +12 -0
- package/src/utils/logger/ConsoleLogger.ts +65 -0
- package/src/utils/logger/ILogger.ts +8 -0
- package/src/utils/logger/index.ts +8 -0
- package/src/utils/nav-keys-constants.ts +1 -0
- package/src/utils/portal.ts +55 -0
- package/src/utils/position-engine.ts +381 -0
- package/src/utils/render.ts +36 -0
- package/src/utils/ripple.ts +7 -0
- package/src/utils/scroll.ts +73 -0
- package/src/utils/selection.ts +15 -0
- package/src/utils/sort.ts +7 -0
- package/src/utils/splitByQuotes.ts +32 -0
- package/src/utils/string.ts +6 -0
- package/src/utils/teleport.ts +14 -0
- package/src/utils/theme.ts +2 -0
- package/src/utils/vm.ts +16 -0
- package/storybook.js +8 -0
- package/tsconfig.json +44 -0
- package/tsconfig.node.json +8 -0
- package/types.ts +1 -0
- package/vite.config.ts +13 -0
|
@@ -0,0 +1,1264 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="uuid"
|
|
4
|
+
ref="rootRef"
|
|
5
|
+
:class="containerClass"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
ref="dragRef"
|
|
9
|
+
class="dl-table__drag"
|
|
10
|
+
/>
|
|
11
|
+
<!-- Top Slots -->
|
|
12
|
+
<div
|
|
13
|
+
v-if="hasTopSlots"
|
|
14
|
+
class="dl-table__top row items-center"
|
|
15
|
+
>
|
|
16
|
+
<slot
|
|
17
|
+
v-bind="marginalsScope"
|
|
18
|
+
name="top"
|
|
19
|
+
>
|
|
20
|
+
<slot
|
|
21
|
+
v-if="hasTopSelectionMode"
|
|
22
|
+
v-bind="marginalsScope"
|
|
23
|
+
name="top-selection"
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
<div
|
|
27
|
+
v-else
|
|
28
|
+
class="dl-table__control"
|
|
29
|
+
>
|
|
30
|
+
<slot
|
|
31
|
+
name="top-left"
|
|
32
|
+
v-bind="marginalsScope"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
v-if="title"
|
|
36
|
+
class="dl-table__control"
|
|
37
|
+
>
|
|
38
|
+
<div :class="titleClasses">
|
|
39
|
+
{{ title }}
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</slot>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="dl-table__separator col" />
|
|
46
|
+
<div class="dl-table__control">
|
|
47
|
+
<slot
|
|
48
|
+
name="top-right"
|
|
49
|
+
v-bind="marginalsScope"
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
</slot>
|
|
53
|
+
</div>
|
|
54
|
+
<!-- -->
|
|
55
|
+
|
|
56
|
+
<!-- Virtual scroll -->
|
|
57
|
+
<DlVirtualScroll
|
|
58
|
+
v-if="hasVirtScroll"
|
|
59
|
+
ref="virtScrollRef"
|
|
60
|
+
:class="tableClass"
|
|
61
|
+
:style="tableStyle"
|
|
62
|
+
:scroll-target="virtualScrollTarget"
|
|
63
|
+
:items="computedRows"
|
|
64
|
+
:on-virtual-scroll="onVScroll"
|
|
65
|
+
:table-colspan="computedColspan"
|
|
66
|
+
v-bind="virtProps"
|
|
67
|
+
>
|
|
68
|
+
<template #before>
|
|
69
|
+
<thead>
|
|
70
|
+
<slot
|
|
71
|
+
v-if="!hideHeader"
|
|
72
|
+
name="header"
|
|
73
|
+
v-bind="getHeaderScope({ header: true })"
|
|
74
|
+
>
|
|
75
|
+
<DlTr>
|
|
76
|
+
<th
|
|
77
|
+
v-if="hasDraggableRows"
|
|
78
|
+
class="dl-table--col-auto-with empty-col"
|
|
79
|
+
:data-resizable="false"
|
|
80
|
+
/>
|
|
81
|
+
<th
|
|
82
|
+
v-if="singleSelection"
|
|
83
|
+
class="dl-table--col-auto-with"
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
<th
|
|
87
|
+
v-else-if="multipleSelection"
|
|
88
|
+
class="dl-table--col-auto-with dl-table--col-checkbox-wrapper"
|
|
89
|
+
:data-resizable="false"
|
|
90
|
+
>
|
|
91
|
+
<slot
|
|
92
|
+
name="header-selection"
|
|
93
|
+
v-bind="getHeaderScope({})"
|
|
94
|
+
>
|
|
95
|
+
<DlCheckbox
|
|
96
|
+
:color="color"
|
|
97
|
+
:model-value="headerSelectedValue"
|
|
98
|
+
:indeterminate-value="
|
|
99
|
+
selectionCheckboxIndeterminateVal
|
|
100
|
+
"
|
|
101
|
+
@update:model-value="
|
|
102
|
+
onMultipleSelectionSet
|
|
103
|
+
"
|
|
104
|
+
/>
|
|
105
|
+
</slot>
|
|
106
|
+
</th>
|
|
107
|
+
|
|
108
|
+
<slot
|
|
109
|
+
v-for="col in computedCols"
|
|
110
|
+
v-bind="getHeaderScope({ col })"
|
|
111
|
+
:name="
|
|
112
|
+
hasSlotByName(`header-cell-${col.name}`)
|
|
113
|
+
? `header-cell-${col.name}`
|
|
114
|
+
: 'header-cell'
|
|
115
|
+
"
|
|
116
|
+
>
|
|
117
|
+
<DlTh
|
|
118
|
+
:key="col.name"
|
|
119
|
+
:props="getHeaderScope({ col })"
|
|
120
|
+
>
|
|
121
|
+
{{ col.label }}
|
|
122
|
+
</DlTh>
|
|
123
|
+
</slot>
|
|
124
|
+
</DlTr>
|
|
125
|
+
|
|
126
|
+
<tr
|
|
127
|
+
v-if="loading && !hasLoadingSlot"
|
|
128
|
+
class="dl-table__progress"
|
|
129
|
+
>
|
|
130
|
+
<th
|
|
131
|
+
:colspan="computedColspan"
|
|
132
|
+
class="relative-position"
|
|
133
|
+
>
|
|
134
|
+
<dl-progress-bar
|
|
135
|
+
indeterminate
|
|
136
|
+
:color="color"
|
|
137
|
+
/>
|
|
138
|
+
</th>
|
|
139
|
+
</tr>
|
|
140
|
+
</slot>
|
|
141
|
+
</thead>
|
|
142
|
+
</template>
|
|
143
|
+
<template #default="props">
|
|
144
|
+
<DlTr
|
|
145
|
+
:key="getRowKey(props.item)"
|
|
146
|
+
:class="
|
|
147
|
+
isRowSelected(getRowKey(row))
|
|
148
|
+
? 'selected'
|
|
149
|
+
: hasAnyAction
|
|
150
|
+
? ' cursor-pointer'
|
|
151
|
+
: ''
|
|
152
|
+
"
|
|
153
|
+
:no-hover="noHover"
|
|
154
|
+
@click="onTrClick($event, row, pageIndex)"
|
|
155
|
+
@dblclick="onTrDblClick($event, row, pageIndex)"
|
|
156
|
+
@contextmenu="onTrContextMenu($event, row, pageIndex)"
|
|
157
|
+
>
|
|
158
|
+
<td v-if="hasDraggableRows">
|
|
159
|
+
<dl-icon
|
|
160
|
+
class="draggable-icon"
|
|
161
|
+
icon="icon-dl-drag"
|
|
162
|
+
size="12px"
|
|
163
|
+
/>
|
|
164
|
+
</td>
|
|
165
|
+
<td
|
|
166
|
+
v-if="hasSelectionMode"
|
|
167
|
+
class="dl-table--col-auto-with"
|
|
168
|
+
>
|
|
169
|
+
<slot
|
|
170
|
+
name="body-selection"
|
|
171
|
+
v-bind="
|
|
172
|
+
getBodySelectionScope({
|
|
173
|
+
key: getRowKey(props.item),
|
|
174
|
+
row: props.item,
|
|
175
|
+
pageIndex: props.pageIndex
|
|
176
|
+
})
|
|
177
|
+
"
|
|
178
|
+
>
|
|
179
|
+
<DlCheckbox
|
|
180
|
+
:color="color"
|
|
181
|
+
:model-value="
|
|
182
|
+
isRowSelected(getRowKey(props.item))
|
|
183
|
+
"
|
|
184
|
+
@update:model-value="
|
|
185
|
+
(adding, evt) =>
|
|
186
|
+
updateSelection(
|
|
187
|
+
[getRowKey(props.item)],
|
|
188
|
+
[props.item],
|
|
189
|
+
adding,
|
|
190
|
+
evt
|
|
191
|
+
)
|
|
192
|
+
"
|
|
193
|
+
/>
|
|
194
|
+
</slot>
|
|
195
|
+
</td>
|
|
196
|
+
<slot
|
|
197
|
+
v-for="col in computedCols"
|
|
198
|
+
v-bind="
|
|
199
|
+
getBodyCellScope({
|
|
200
|
+
key: getRowKey(props.item),
|
|
201
|
+
row: props.item,
|
|
202
|
+
pageIndex: props.pageIndex,
|
|
203
|
+
col
|
|
204
|
+
})
|
|
205
|
+
"
|
|
206
|
+
:name="
|
|
207
|
+
hasSlotByName(`body-cell-${col.name}`)
|
|
208
|
+
? `body-cell-${col.name}`
|
|
209
|
+
: 'body-cell'
|
|
210
|
+
"
|
|
211
|
+
>
|
|
212
|
+
<DlTd
|
|
213
|
+
:class="col.tdClass(props.item)"
|
|
214
|
+
:style="col.tdStyle(props.item)"
|
|
215
|
+
:no-hover="noHover"
|
|
216
|
+
>
|
|
217
|
+
{{ getCellValue(col, props.item) }}
|
|
218
|
+
</DlTd>
|
|
219
|
+
</slot>
|
|
220
|
+
</DlTr>
|
|
221
|
+
</template>
|
|
222
|
+
</DlVirtualScroll>
|
|
223
|
+
<!-- -->
|
|
224
|
+
|
|
225
|
+
<div
|
|
226
|
+
v-else
|
|
227
|
+
class="dl-table__middle scroll"
|
|
228
|
+
>
|
|
229
|
+
<table
|
|
230
|
+
class="dl-table"
|
|
231
|
+
:class="additionalClasses"
|
|
232
|
+
>
|
|
233
|
+
<thead>
|
|
234
|
+
<slot
|
|
235
|
+
v-if="!hideHeader"
|
|
236
|
+
name="header"
|
|
237
|
+
v-bind="getHeaderScope({ header: true })"
|
|
238
|
+
>
|
|
239
|
+
<DlTr>
|
|
240
|
+
<th
|
|
241
|
+
v-if="hasDraggableRows"
|
|
242
|
+
class="dl-table--col-auto-with empty-col"
|
|
243
|
+
:data-resizable="false"
|
|
244
|
+
/>
|
|
245
|
+
<th
|
|
246
|
+
v-if="singleSelection"
|
|
247
|
+
class="dl-table--col-auto-with"
|
|
248
|
+
/>
|
|
249
|
+
|
|
250
|
+
<th
|
|
251
|
+
v-else-if="multipleSelection"
|
|
252
|
+
class="dl-table--col-auto-with dl-table--col-checkbox-wrapper"
|
|
253
|
+
:data-resizable="false"
|
|
254
|
+
>
|
|
255
|
+
<slot
|
|
256
|
+
name="header-selection"
|
|
257
|
+
v-bind="getHeaderScope({})"
|
|
258
|
+
>
|
|
259
|
+
<DlCheckbox
|
|
260
|
+
:color="color"
|
|
261
|
+
:model-value="headerSelectedValue"
|
|
262
|
+
:indeterminate-value="true"
|
|
263
|
+
@update:model-value="
|
|
264
|
+
onMultipleSelectionSet
|
|
265
|
+
"
|
|
266
|
+
/>
|
|
267
|
+
</slot>
|
|
268
|
+
</th>
|
|
269
|
+
|
|
270
|
+
<slot
|
|
271
|
+
v-for="col in computedCols"
|
|
272
|
+
v-bind="getHeaderScope({ col })"
|
|
273
|
+
:name="
|
|
274
|
+
hasSlotByName(`header-cell-${col.name}`)
|
|
275
|
+
? `header-cell-${col.name}`
|
|
276
|
+
: 'header-cell'
|
|
277
|
+
"
|
|
278
|
+
>
|
|
279
|
+
<DlTh
|
|
280
|
+
:key="col.name"
|
|
281
|
+
:props="getHeaderScope({ col })"
|
|
282
|
+
>
|
|
283
|
+
{{ col.label }}
|
|
284
|
+
</DlTh>
|
|
285
|
+
</slot>
|
|
286
|
+
</DlTr>
|
|
287
|
+
|
|
288
|
+
<tr
|
|
289
|
+
v-if="loading && !hasLoadingSlot"
|
|
290
|
+
class="dl-table__progress"
|
|
291
|
+
>
|
|
292
|
+
<th
|
|
293
|
+
:colspan="computedColspan"
|
|
294
|
+
class="relative-position"
|
|
295
|
+
>
|
|
296
|
+
<dl-progress-bar
|
|
297
|
+
indeterminate
|
|
298
|
+
:color="color"
|
|
299
|
+
/>
|
|
300
|
+
</th>
|
|
301
|
+
</tr>
|
|
302
|
+
</slot>
|
|
303
|
+
</thead>
|
|
304
|
+
<tbody>
|
|
305
|
+
<slot
|
|
306
|
+
name="top-row"
|
|
307
|
+
:cols="computedCols"
|
|
308
|
+
/>
|
|
309
|
+
<slot
|
|
310
|
+
v-for="(row, pageIndex) in computedRows"
|
|
311
|
+
v-bind="
|
|
312
|
+
getBodyScope({
|
|
313
|
+
key: getRowKey(row),
|
|
314
|
+
row,
|
|
315
|
+
pageIndex,
|
|
316
|
+
trClass: isRowSelected(getRowKey(row))
|
|
317
|
+
? 'selected'
|
|
318
|
+
: ''
|
|
319
|
+
})
|
|
320
|
+
"
|
|
321
|
+
name="body"
|
|
322
|
+
>
|
|
323
|
+
<DlTr
|
|
324
|
+
:key="getRowKey(row)"
|
|
325
|
+
:class="
|
|
326
|
+
isRowSelected(getRowKey(row))
|
|
327
|
+
? 'selected'
|
|
328
|
+
: hasAnyAction
|
|
329
|
+
? ' cursor-pointer'
|
|
330
|
+
: ''
|
|
331
|
+
"
|
|
332
|
+
:no-hover="noHover"
|
|
333
|
+
@click="onTrClick($event, row, pageIndex)"
|
|
334
|
+
@dblclick="onTrDblClick($event, row, pageIndex)"
|
|
335
|
+
@contextmenu="
|
|
336
|
+
onTrContextMenu($event, row, pageIndex)
|
|
337
|
+
"
|
|
338
|
+
>
|
|
339
|
+
<td v-if="hasDraggableRows">
|
|
340
|
+
<dl-icon
|
|
341
|
+
class="draggable-icon"
|
|
342
|
+
icon="icon-dl-drag"
|
|
343
|
+
size="12px"
|
|
344
|
+
/>
|
|
345
|
+
</td>
|
|
346
|
+
<td
|
|
347
|
+
v-if="hasSelectionMode"
|
|
348
|
+
class="dl-table--col-auto-with"
|
|
349
|
+
>
|
|
350
|
+
<slot
|
|
351
|
+
name="body-selection"
|
|
352
|
+
v-bind="
|
|
353
|
+
getBodySelectionScope({
|
|
354
|
+
key: getRowKey(row),
|
|
355
|
+
row,
|
|
356
|
+
pageIndex
|
|
357
|
+
})
|
|
358
|
+
"
|
|
359
|
+
>
|
|
360
|
+
<DlCheckbox
|
|
361
|
+
:color="color"
|
|
362
|
+
:model-value="
|
|
363
|
+
isRowSelected(getRowKey(row))
|
|
364
|
+
"
|
|
365
|
+
@update:model-value="
|
|
366
|
+
(adding, evt) =>
|
|
367
|
+
updateSelection(
|
|
368
|
+
[getRowKey(row)],
|
|
369
|
+
[row],
|
|
370
|
+
adding,
|
|
371
|
+
evt
|
|
372
|
+
)
|
|
373
|
+
"
|
|
374
|
+
/>
|
|
375
|
+
</slot>
|
|
376
|
+
</td>
|
|
377
|
+
<slot
|
|
378
|
+
v-for="col in computedCols"
|
|
379
|
+
v-bind="
|
|
380
|
+
getBodyCellScope({
|
|
381
|
+
key: getRowKey(row),
|
|
382
|
+
row,
|
|
383
|
+
pageIndex,
|
|
384
|
+
col
|
|
385
|
+
})
|
|
386
|
+
"
|
|
387
|
+
:name="
|
|
388
|
+
hasSlotByName(`body-cell-${col.name}`)
|
|
389
|
+
? `body-cell-${col.name}`
|
|
390
|
+
: 'body-cell'
|
|
391
|
+
"
|
|
392
|
+
>
|
|
393
|
+
<DlTd
|
|
394
|
+
:class="col.tdClass(row)"
|
|
395
|
+
:style="col.tdStyle(row)"
|
|
396
|
+
>
|
|
397
|
+
{{ getCellValue(col, row) }}
|
|
398
|
+
</DlTd>
|
|
399
|
+
</slot>
|
|
400
|
+
</DlTr>
|
|
401
|
+
</slot>
|
|
402
|
+
<slot
|
|
403
|
+
name="bottom-row"
|
|
404
|
+
:cols="computedCols"
|
|
405
|
+
/>
|
|
406
|
+
</tbody>
|
|
407
|
+
</table>
|
|
408
|
+
</div>
|
|
409
|
+
|
|
410
|
+
<div
|
|
411
|
+
v-if="!hideBottom || hideNoData"
|
|
412
|
+
:class="bottomClasses"
|
|
413
|
+
>
|
|
414
|
+
<div class="dl-table__control">
|
|
415
|
+
<slot
|
|
416
|
+
name="bottom"
|
|
417
|
+
v-bind="marginalsScope"
|
|
418
|
+
>
|
|
419
|
+
<div
|
|
420
|
+
v-if="hasBotomSelectionBanner"
|
|
421
|
+
class="dl-table__control"
|
|
422
|
+
>
|
|
423
|
+
<div>
|
|
424
|
+
{{ selectedRowsLabel(rowsSelectedNumber) }}
|
|
425
|
+
</div>
|
|
426
|
+
</div>
|
|
427
|
+
<dl-pagination
|
|
428
|
+
v-if="displayPagination"
|
|
429
|
+
v-bind="marginalsScope.pagination"
|
|
430
|
+
@update:rowsPerPage="
|
|
431
|
+
(v) => setPagination({ rowsPerPage: v })
|
|
432
|
+
"
|
|
433
|
+
@update:modelValue="(v) => setPagination({ page: v })"
|
|
434
|
+
/>
|
|
435
|
+
|
|
436
|
+
<slot
|
|
437
|
+
v-if="nothingToDisplay && !hideNoData"
|
|
438
|
+
name="no-data"
|
|
439
|
+
>
|
|
440
|
+
{{ bottomMessage }}
|
|
441
|
+
</slot>
|
|
442
|
+
</slot>
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
445
|
+
|
|
446
|
+
<slot
|
|
447
|
+
v-if="loading"
|
|
448
|
+
name="loading"
|
|
449
|
+
/>
|
|
450
|
+
</div>
|
|
451
|
+
</template>
|
|
452
|
+
|
|
453
|
+
<script lang="ts">
|
|
454
|
+
import {
|
|
455
|
+
defineComponent,
|
|
456
|
+
computed,
|
|
457
|
+
ref,
|
|
458
|
+
PropType,
|
|
459
|
+
watch,
|
|
460
|
+
getCurrentInstance,
|
|
461
|
+
ComputedRef,
|
|
462
|
+
onMounted
|
|
463
|
+
} from 'vue-demi'
|
|
464
|
+
import {
|
|
465
|
+
useTablePagination,
|
|
466
|
+
useTablePaginationState,
|
|
467
|
+
useTablePaginationProps
|
|
468
|
+
} from './hooks/tablePagination'
|
|
469
|
+
import { DlTr, DlTh, DlTd } from './'
|
|
470
|
+
import {
|
|
471
|
+
commonVirtPropsList,
|
|
472
|
+
commonVirtScrollProps,
|
|
473
|
+
ScrollDetails
|
|
474
|
+
} from '../DlVirtualScroll/useVirtualScroll'
|
|
475
|
+
import { DlVirtualScroll } from '../DlVirtualScroll'
|
|
476
|
+
import { useTableFilter, useTableFilterProps } from './hooks/tableFilter'
|
|
477
|
+
import { useTableSort, useTableSortProps } from './hooks/tableSort'
|
|
478
|
+
import {
|
|
479
|
+
useTableRowSelection,
|
|
480
|
+
useTableRowSelectionProps,
|
|
481
|
+
useTableRowSelectionEmits
|
|
482
|
+
} from './hooks/tableRowSelection'
|
|
483
|
+
import {
|
|
484
|
+
useTableColumnSelection,
|
|
485
|
+
useTableColumnSelectionProps
|
|
486
|
+
} from './hooks/tableColumnSelection'
|
|
487
|
+
import {
|
|
488
|
+
useTableRowExpand,
|
|
489
|
+
useTableRowExpandProps,
|
|
490
|
+
useTableRowExpandEmits
|
|
491
|
+
} from './hooks/tableRowExpand'
|
|
492
|
+
import { useTableActionsProps, useTableActions } from './hooks/tableActions'
|
|
493
|
+
import {
|
|
494
|
+
applyDraggableRows,
|
|
495
|
+
applyDraggableColumns
|
|
496
|
+
} from '../../utils/draggable-table'
|
|
497
|
+
import { injectProp } from '../../utils/inject-object-prop'
|
|
498
|
+
import { TableRow, TableProps, TableColumn } from './types'
|
|
499
|
+
import { DlPagination } from '../DlPagination'
|
|
500
|
+
import DlCheckbox from '../DlCheckbox.vue'
|
|
501
|
+
import DlProgressBar from '../DlProgressBar.vue'
|
|
502
|
+
import { ResizableManager } from './ResizableManager'
|
|
503
|
+
import DlIcon from '../DlIcon.vue'
|
|
504
|
+
import { v4 } from 'uuid'
|
|
505
|
+
|
|
506
|
+
export default defineComponent({
|
|
507
|
+
name: 'DlTable',
|
|
508
|
+
components: {
|
|
509
|
+
DlTr,
|
|
510
|
+
DlTh,
|
|
511
|
+
DlTd,
|
|
512
|
+
DlVirtualScroll,
|
|
513
|
+
DlPagination,
|
|
514
|
+
DlProgressBar,
|
|
515
|
+
DlIcon,
|
|
516
|
+
DlCheckbox
|
|
517
|
+
},
|
|
518
|
+
props: {
|
|
519
|
+
columns: { type: Array, default: () => [] as Record<string, any>[] },
|
|
520
|
+
rows: {
|
|
521
|
+
type: Array,
|
|
522
|
+
default: () => [] as Record<string, any>[]
|
|
523
|
+
},
|
|
524
|
+
rowKey: {
|
|
525
|
+
type: [String, Function],
|
|
526
|
+
default: 'id'
|
|
527
|
+
},
|
|
528
|
+
bordered: Boolean,
|
|
529
|
+
separator: {
|
|
530
|
+
type: String,
|
|
531
|
+
default: 'horizontal',
|
|
532
|
+
validator: (v: string) =>
|
|
533
|
+
['horizontal', 'vertical', 'cell', 'none'].includes(v)
|
|
534
|
+
},
|
|
535
|
+
draggable: {
|
|
536
|
+
type: String,
|
|
537
|
+
default: 'none',
|
|
538
|
+
validator: (v: string) =>
|
|
539
|
+
['rows', 'columns', 'none', 'both'].includes(v)
|
|
540
|
+
},
|
|
541
|
+
title: { type: String, default: null },
|
|
542
|
+
color: {
|
|
543
|
+
type: String,
|
|
544
|
+
default: 'dl-color-darker'
|
|
545
|
+
},
|
|
546
|
+
loading: Boolean,
|
|
547
|
+
dense: Boolean,
|
|
548
|
+
resizable: Boolean,
|
|
549
|
+
hideNoData: Boolean,
|
|
550
|
+
hideHeader: Boolean,
|
|
551
|
+
hideBottom: Boolean,
|
|
552
|
+
virtualScroll: Boolean,
|
|
553
|
+
hidePagination: Boolean,
|
|
554
|
+
hideSelectedBanner: Boolean,
|
|
555
|
+
selectedRowsLabel: {
|
|
556
|
+
type: Function,
|
|
557
|
+
default: (val: number) => `${val} records selected`
|
|
558
|
+
},
|
|
559
|
+
loadingLabel: {
|
|
560
|
+
type: String,
|
|
561
|
+
default: 'Loading...'
|
|
562
|
+
},
|
|
563
|
+
noResultsLabel: {
|
|
564
|
+
type: String,
|
|
565
|
+
default: 'There are no results to display'
|
|
566
|
+
},
|
|
567
|
+
noDataLabel: {
|
|
568
|
+
type: String,
|
|
569
|
+
default: 'No data available'
|
|
570
|
+
},
|
|
571
|
+
virtualScrollTarget: {
|
|
572
|
+
type: Object as PropType<HTMLElement>,
|
|
573
|
+
default: void 0
|
|
574
|
+
},
|
|
575
|
+
titleClass: {
|
|
576
|
+
type: [String, Array, Object],
|
|
577
|
+
default: null
|
|
578
|
+
},
|
|
579
|
+
tableStyle: {
|
|
580
|
+
type: [String, Array, Object],
|
|
581
|
+
default: null
|
|
582
|
+
},
|
|
583
|
+
tableClass: {
|
|
584
|
+
type: [String, Array, Object],
|
|
585
|
+
default: null
|
|
586
|
+
},
|
|
587
|
+
tableHeaderStyle: {
|
|
588
|
+
type: [String, Array, Object],
|
|
589
|
+
default: null
|
|
590
|
+
},
|
|
591
|
+
tableHeaderClass: {
|
|
592
|
+
type: [String, Array, Object],
|
|
593
|
+
default: null
|
|
594
|
+
},
|
|
595
|
+
noHover: Boolean,
|
|
596
|
+
...useTableActionsProps,
|
|
597
|
+
...commonVirtScrollProps,
|
|
598
|
+
...useTableRowExpandProps,
|
|
599
|
+
...useTablePaginationProps,
|
|
600
|
+
...useTableFilterProps,
|
|
601
|
+
...useTableSortProps,
|
|
602
|
+
...useTableColumnSelectionProps,
|
|
603
|
+
...useTableRowSelectionProps
|
|
604
|
+
},
|
|
605
|
+
emits: [
|
|
606
|
+
'request',
|
|
607
|
+
'virtual-scroll',
|
|
608
|
+
'row-reorder',
|
|
609
|
+
'col-reorder',
|
|
610
|
+
'row-click',
|
|
611
|
+
'row-dblclick',
|
|
612
|
+
'row-contextmenu',
|
|
613
|
+
...useTableRowExpandEmits,
|
|
614
|
+
...useTableRowSelectionEmits
|
|
615
|
+
],
|
|
616
|
+
setup(props, { emit, slots }) {
|
|
617
|
+
const vm = getCurrentInstance()
|
|
618
|
+
|
|
619
|
+
const rootRef = ref(null)
|
|
620
|
+
const virtScrollRef = ref(null)
|
|
621
|
+
const hasVirtScroll = computed(() => props.virtualScroll === true)
|
|
622
|
+
|
|
623
|
+
const {
|
|
624
|
+
hasClickEvent,
|
|
625
|
+
hasDblClickEvent,
|
|
626
|
+
hasContextMenuEvent,
|
|
627
|
+
hasAnyAction
|
|
628
|
+
} = useTableActions(props)
|
|
629
|
+
|
|
630
|
+
const getRowKey = computed(() =>
|
|
631
|
+
typeof props.rowKey === 'function'
|
|
632
|
+
? props.rowKey
|
|
633
|
+
: (row: Record<string, any>) => row[props.rowKey as string]
|
|
634
|
+
)
|
|
635
|
+
|
|
636
|
+
// table slots
|
|
637
|
+
const hasSlotByName = (name: string) => !!slots[name]
|
|
638
|
+
|
|
639
|
+
const hasTopSlots = computed(
|
|
640
|
+
() =>
|
|
641
|
+
!!slots['top'] ||
|
|
642
|
+
!!slots['top-left'] ||
|
|
643
|
+
!!slots['top-right'] ||
|
|
644
|
+
!!slots['top-selection']
|
|
645
|
+
)
|
|
646
|
+
//
|
|
647
|
+
|
|
648
|
+
// table class names
|
|
649
|
+
const __containerClass = computed(() => {
|
|
650
|
+
let classNames = `dl-table__container dl-table--${props.separator}-separator column no-wrap dl-table--no-wrap`
|
|
651
|
+
|
|
652
|
+
if (props.bordered) {
|
|
653
|
+
classNames = classNames + ' dl-table--bordered'
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (props.dense) {
|
|
657
|
+
classNames = classNames + ' dl-table--dense'
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
return classNames
|
|
661
|
+
})
|
|
662
|
+
|
|
663
|
+
const containerClass = computed(() => {
|
|
664
|
+
let classNames = __containerClass.value
|
|
665
|
+
|
|
666
|
+
if (props.loading) {
|
|
667
|
+
classNames = classNames + ' dl-table--loading'
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
return classNames
|
|
671
|
+
})
|
|
672
|
+
|
|
673
|
+
const nothingToDisplay = computed(() => computedRows.value.length === 0)
|
|
674
|
+
|
|
675
|
+
const titleClasses = computed(
|
|
676
|
+
() => 'dl-table__title ' + (props.titleClass || '')
|
|
677
|
+
)
|
|
678
|
+
|
|
679
|
+
const bottomClasses = computed(() => {
|
|
680
|
+
let classNames = 'dl-table__bottom row items-center'
|
|
681
|
+
|
|
682
|
+
if (nothingToDisplay.value && !props.hideNoData) {
|
|
683
|
+
// TODO add styles for this class
|
|
684
|
+
classNames = classNames + ' dl-table__bottom--nodata'
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
return classNames
|
|
688
|
+
})
|
|
689
|
+
//
|
|
690
|
+
|
|
691
|
+
const bottomMessage = computed(() => {
|
|
692
|
+
if (props.loading) {
|
|
693
|
+
return props.loadingLabel
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
if (props.filter) {
|
|
697
|
+
return props.noResultsLabel
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
return props.noDataLabel
|
|
701
|
+
})
|
|
702
|
+
|
|
703
|
+
const hasDraggableRows = computed(() =>
|
|
704
|
+
['rows', 'both'].includes(props.draggable)
|
|
705
|
+
)
|
|
706
|
+
const hasDraggableColumns = computed(() =>
|
|
707
|
+
['columns', 'both'].includes(props.draggable)
|
|
708
|
+
)
|
|
709
|
+
|
|
710
|
+
let removeDraggableRows = () => {}
|
|
711
|
+
let removeDraggableColumns = () => {}
|
|
712
|
+
|
|
713
|
+
let resizableManager: ResizableManager | null = null
|
|
714
|
+
let tableEl: HTMLTableElement = null
|
|
715
|
+
|
|
716
|
+
onMounted(() => {
|
|
717
|
+
tableEl = (rootRef.value as HTMLDivElement).querySelector(
|
|
718
|
+
'.dl-table'
|
|
719
|
+
) as HTMLTableElement
|
|
720
|
+
resizableManager = new ResizableManager()
|
|
721
|
+
|
|
722
|
+
if (props.resizable === true) {
|
|
723
|
+
resizableManager.addResizeCapability(tableEl)
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
if (hasDraggableRows.value === true) {
|
|
727
|
+
removeDraggableRows = applyDraggableRows(
|
|
728
|
+
tableEl,
|
|
729
|
+
vm,
|
|
730
|
+
rootRef.value
|
|
731
|
+
)
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
if (hasDraggableColumns.value === true) {
|
|
735
|
+
removeDraggableColumns = applyDraggableColumns(
|
|
736
|
+
tableEl,
|
|
737
|
+
vm,
|
|
738
|
+
vm.refs.dragRef as HTMLDivElement,
|
|
739
|
+
rootRef.value
|
|
740
|
+
)
|
|
741
|
+
}
|
|
742
|
+
})
|
|
743
|
+
|
|
744
|
+
watch(
|
|
745
|
+
hasVirtScroll,
|
|
746
|
+
() => {
|
|
747
|
+
tableEl = (rootRef.value as HTMLDivElement).querySelector(
|
|
748
|
+
'.dl-table'
|
|
749
|
+
) as HTMLTableElement
|
|
750
|
+
|
|
751
|
+
if (props.resizable) {
|
|
752
|
+
resizableManager.removeResizeCapability()
|
|
753
|
+
resizableManager.addResizeCapability(tableEl)
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
if (hasDraggableRows.value === true) {
|
|
757
|
+
removeDraggableRows()
|
|
758
|
+
removeDraggableRows = applyDraggableRows(
|
|
759
|
+
tableEl,
|
|
760
|
+
vm,
|
|
761
|
+
rootRef.value
|
|
762
|
+
)
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
if (hasDraggableColumns.value === true) {
|
|
766
|
+
removeDraggableColumns()
|
|
767
|
+
removeDraggableColumns = applyDraggableColumns(
|
|
768
|
+
tableEl,
|
|
769
|
+
vm,
|
|
770
|
+
vm.refs.dragRef as HTMLDivElement,
|
|
771
|
+
rootRef.value
|
|
772
|
+
)
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
flush: 'post'
|
|
777
|
+
}
|
|
778
|
+
)
|
|
779
|
+
|
|
780
|
+
watch(
|
|
781
|
+
() => props.resizable,
|
|
782
|
+
(value: boolean) => {
|
|
783
|
+
if (value) {
|
|
784
|
+
resizableManager.addResizeCapability(tableEl)
|
|
785
|
+
} else {
|
|
786
|
+
resizableManager.removeResizeCapability()
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
)
|
|
790
|
+
|
|
791
|
+
watch(
|
|
792
|
+
() => props.draggable,
|
|
793
|
+
() => {
|
|
794
|
+
if (tableEl) {
|
|
795
|
+
if (hasDraggableRows.value === true) {
|
|
796
|
+
removeDraggableRows = applyDraggableRows(
|
|
797
|
+
tableEl,
|
|
798
|
+
vm,
|
|
799
|
+
rootRef.value
|
|
800
|
+
)
|
|
801
|
+
} else {
|
|
802
|
+
removeDraggableRows()
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
if (hasDraggableColumns.value === true) {
|
|
806
|
+
removeDraggableColumns = applyDraggableColumns(
|
|
807
|
+
tableEl,
|
|
808
|
+
vm,
|
|
809
|
+
vm.refs.dragRef as HTMLDivElement,
|
|
810
|
+
rootRef.value
|
|
811
|
+
)
|
|
812
|
+
} else {
|
|
813
|
+
removeDraggableColumns()
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
{ immediate: true }
|
|
818
|
+
)
|
|
819
|
+
|
|
820
|
+
watch(
|
|
821
|
+
() =>
|
|
822
|
+
(props.tableStyle as string) +
|
|
823
|
+
props.tableClass +
|
|
824
|
+
props.tableHeaderStyle +
|
|
825
|
+
props.tableHeaderClass +
|
|
826
|
+
__containerClass,
|
|
827
|
+
() => {
|
|
828
|
+
if (
|
|
829
|
+
hasVirtScroll.value === true &&
|
|
830
|
+
virtScrollRef.value !== null
|
|
831
|
+
) {
|
|
832
|
+
virtScrollRef.value.reset()
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
)
|
|
836
|
+
|
|
837
|
+
const { innerPagination, computedPagination, setPagination } =
|
|
838
|
+
useTablePaginationState(vm, getCellValue)
|
|
839
|
+
|
|
840
|
+
watch(
|
|
841
|
+
[computedPagination, () => props.dense],
|
|
842
|
+
() => {
|
|
843
|
+
if (tableEl && props.resizable && resizableManager) {
|
|
844
|
+
const tableHeight = tableEl.offsetHeight || 0
|
|
845
|
+
|
|
846
|
+
resizableManager.updateResizersHeight(tableHeight)
|
|
847
|
+
}
|
|
848
|
+
},
|
|
849
|
+
{ deep: true, flush: 'post' }
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
const { computedFilterMethod } = useTableFilter(props, setPagination)
|
|
853
|
+
|
|
854
|
+
const { isRowExpanded, setExpanded, updateExpanded } =
|
|
855
|
+
useTableRowExpand(props, emit)
|
|
856
|
+
|
|
857
|
+
const filteredSortedRows = computed(() => {
|
|
858
|
+
let rows = props.rows as TableRow[]
|
|
859
|
+
|
|
860
|
+
if (rows.length === 0) {
|
|
861
|
+
return rows
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const { sortBy, descending } = computedPagination.value
|
|
865
|
+
|
|
866
|
+
if (props.filter) {
|
|
867
|
+
rows = computedFilterMethod.value(
|
|
868
|
+
rows,
|
|
869
|
+
props.filter,
|
|
870
|
+
computedCols.value,
|
|
871
|
+
getCellValue
|
|
872
|
+
)
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
if (columnToSort.value !== null) {
|
|
876
|
+
rows = computedSortMethod.value(
|
|
877
|
+
props.rows === rows ? rows.slice() : rows,
|
|
878
|
+
sortBy,
|
|
879
|
+
descending
|
|
880
|
+
)
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
return rows
|
|
884
|
+
})
|
|
885
|
+
|
|
886
|
+
const filteredSortedRowsNumber = computed(
|
|
887
|
+
() => filteredSortedRows.value.length
|
|
888
|
+
)
|
|
889
|
+
|
|
890
|
+
const computedRows = computed(() => {
|
|
891
|
+
let rows = filteredSortedRows.value
|
|
892
|
+
|
|
893
|
+
const { rowsPerPage } = computedPagination.value
|
|
894
|
+
|
|
895
|
+
if (rowsPerPage !== 0) {
|
|
896
|
+
if (firstRowIndex.value === 0 && props.rows !== rows) {
|
|
897
|
+
if (rows.length > lastRowIndex.value) {
|
|
898
|
+
rows = rows.slice(0, lastRowIndex.value)
|
|
899
|
+
}
|
|
900
|
+
} else {
|
|
901
|
+
rows = rows.slice(firstRowIndex.value, lastRowIndex.value)
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
return rows
|
|
906
|
+
})
|
|
907
|
+
|
|
908
|
+
const additionalClasses = computed(() => {
|
|
909
|
+
const classes = []
|
|
910
|
+
|
|
911
|
+
if (hasDraggableRows.value === true) {
|
|
912
|
+
classes.push('dl-table--draggable-rows')
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
if (hasDraggableColumns.value === true) {
|
|
916
|
+
classes.push('dl-table--draggable-columns')
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
return classes
|
|
920
|
+
})
|
|
921
|
+
|
|
922
|
+
const displayPagination = computed(
|
|
923
|
+
() => !(props.hidePagination || nothingToDisplay.value)
|
|
924
|
+
)
|
|
925
|
+
|
|
926
|
+
const {
|
|
927
|
+
hasSelectionMode,
|
|
928
|
+
singleSelection,
|
|
929
|
+
multipleSelection,
|
|
930
|
+
allRowsSelected,
|
|
931
|
+
someRowsSelected,
|
|
932
|
+
rowsSelectedNumber,
|
|
933
|
+
|
|
934
|
+
isRowSelected,
|
|
935
|
+
clearSelection,
|
|
936
|
+
updateSelection
|
|
937
|
+
} = useTableRowSelection(
|
|
938
|
+
props as unknown as TableProps,
|
|
939
|
+
emit,
|
|
940
|
+
computedRows,
|
|
941
|
+
getRowKey as ComputedRef<(val: string | TableRow) => any>
|
|
942
|
+
)
|
|
943
|
+
|
|
944
|
+
const { colList, computedCols, computedColsMap, computedColspan } =
|
|
945
|
+
useTableColumnSelection(
|
|
946
|
+
props as unknown as TableProps,
|
|
947
|
+
computedPagination,
|
|
948
|
+
hasSelectionMode,
|
|
949
|
+
hasDraggableRows
|
|
950
|
+
)
|
|
951
|
+
|
|
952
|
+
const { columnToSort, computedSortMethod, sort } = useTableSort(
|
|
953
|
+
props as unknown as TableProps,
|
|
954
|
+
computedPagination,
|
|
955
|
+
colList,
|
|
956
|
+
setPagination
|
|
957
|
+
)
|
|
958
|
+
|
|
959
|
+
const headerSelectedValue = computed(() =>
|
|
960
|
+
someRowsSelected.value === true ? null : allRowsSelected.value
|
|
961
|
+
)
|
|
962
|
+
|
|
963
|
+
const selectionCheckboxIndeterminateVal = computed(
|
|
964
|
+
() =>
|
|
965
|
+
multipleSelection.value === true &&
|
|
966
|
+
computedRows.value.length > 0 &&
|
|
967
|
+
computedRows.value.length < props.rows.length
|
|
968
|
+
)
|
|
969
|
+
|
|
970
|
+
function onMultipleSelectionSet(val: boolean) {
|
|
971
|
+
if (someRowsSelected.value === true) {
|
|
972
|
+
val = false
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
updateSelection(
|
|
976
|
+
computedRows.value.map(getRowKey.value as any),
|
|
977
|
+
computedRows.value,
|
|
978
|
+
val
|
|
979
|
+
)
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
const hasTopSelectionMode = computed(() => {
|
|
983
|
+
return (
|
|
984
|
+
hasSelectionMode.value === true && rowsSelectedNumber.value > 0
|
|
985
|
+
)
|
|
986
|
+
})
|
|
987
|
+
|
|
988
|
+
const hasBotomSelectionBanner = computed(() => {
|
|
989
|
+
return (
|
|
990
|
+
props.hideSelectedBanner !== true &&
|
|
991
|
+
hasSelectionMode.value === true &&
|
|
992
|
+
rowsSelectedNumber.value > 0
|
|
993
|
+
)
|
|
994
|
+
})
|
|
995
|
+
|
|
996
|
+
const {
|
|
997
|
+
firstRowIndex,
|
|
998
|
+
lastRowIndex,
|
|
999
|
+
isFirstPage,
|
|
1000
|
+
isLastPage,
|
|
1001
|
+
pagesNumber,
|
|
1002
|
+
computedRowsNumber
|
|
1003
|
+
} = useTablePagination(
|
|
1004
|
+
vm,
|
|
1005
|
+
computedPagination,
|
|
1006
|
+
setPagination,
|
|
1007
|
+
filteredSortedRowsNumber
|
|
1008
|
+
)
|
|
1009
|
+
|
|
1010
|
+
function getHeaderScope(data: Record<string, any>) {
|
|
1011
|
+
Object.assign(data, {
|
|
1012
|
+
cols: computedCols.value,
|
|
1013
|
+
sort,
|
|
1014
|
+
colsMap: computedColsMap.value,
|
|
1015
|
+
color: props.color,
|
|
1016
|
+
dense: props.dense
|
|
1017
|
+
})
|
|
1018
|
+
|
|
1019
|
+
if (multipleSelection.value === true) {
|
|
1020
|
+
injectProp(
|
|
1021
|
+
data,
|
|
1022
|
+
'selected',
|
|
1023
|
+
() => headerSelectedValue.value,
|
|
1024
|
+
onMultipleSelectionSet
|
|
1025
|
+
)
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
return data
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
// Virtual scroll functionality
|
|
1032
|
+
|
|
1033
|
+
const virtProps = computed(() => {
|
|
1034
|
+
const acc: Record<string, any> = {}
|
|
1035
|
+
|
|
1036
|
+
commonVirtPropsList.forEach((p) => {
|
|
1037
|
+
acc[p] = (props as Record<string, any>)[p]
|
|
1038
|
+
})
|
|
1039
|
+
|
|
1040
|
+
if (acc.virtualScrollItemSize === void 0) {
|
|
1041
|
+
acc.virtualScrollItemSize = props.dense === true ? 28 : 48
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
return acc
|
|
1045
|
+
})
|
|
1046
|
+
|
|
1047
|
+
const marginalsScope = computed(() => ({
|
|
1048
|
+
pagination: paginationState.value
|
|
1049
|
+
}))
|
|
1050
|
+
|
|
1051
|
+
function getCellValue(
|
|
1052
|
+
col: Record<string, any>,
|
|
1053
|
+
row: Record<string, any>
|
|
1054
|
+
) {
|
|
1055
|
+
const val =
|
|
1056
|
+
typeof col.field === 'function'
|
|
1057
|
+
? col.field(row)
|
|
1058
|
+
: row[col.field]
|
|
1059
|
+
return col.format !== void 0 ? col.format(val, row) : val
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
function resetVirtualScroll() {
|
|
1063
|
+
if (hasVirtScroll.value === true) {
|
|
1064
|
+
virtScrollRef.value.reset()
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
function scrollTo(toIndex: string | number, edge?: string) {
|
|
1069
|
+
if (virtScrollRef.value !== null) {
|
|
1070
|
+
virtScrollRef.value.scrollTo(toIndex, edge)
|
|
1071
|
+
return
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
toIndex = parseInt(toIndex as string, 10)
|
|
1075
|
+
const rowEl = rootRef.value.querySelector(
|
|
1076
|
+
`tbody tr:nth-of-type(${toIndex + 1})`
|
|
1077
|
+
)
|
|
1078
|
+
|
|
1079
|
+
if (rowEl !== null) {
|
|
1080
|
+
const scrollTarget = rootRef.value.querySelector(
|
|
1081
|
+
'.dl-table__middle.scroll'
|
|
1082
|
+
)
|
|
1083
|
+
const offsetTop =
|
|
1084
|
+
rowEl.offsetTop -
|
|
1085
|
+
(props.virtualScrollStickySizeStart as number)
|
|
1086
|
+
const direction =
|
|
1087
|
+
offsetTop < scrollTarget.scrollTop ? 'decrease' : 'increase'
|
|
1088
|
+
|
|
1089
|
+
scrollTarget.scrollTop = offsetTop
|
|
1090
|
+
|
|
1091
|
+
emit('virtual-scroll', {
|
|
1092
|
+
index: toIndex,
|
|
1093
|
+
from: 0,
|
|
1094
|
+
to: innerPagination.value.rowsPerPage - 1,
|
|
1095
|
+
direction
|
|
1096
|
+
})
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
function onVScroll(info: ScrollDetails) {
|
|
1101
|
+
emit('virtual-scroll', info)
|
|
1102
|
+
}
|
|
1103
|
+
//
|
|
1104
|
+
|
|
1105
|
+
const onTrClick = (
|
|
1106
|
+
evt: MouseEvent,
|
|
1107
|
+
row: TableRow,
|
|
1108
|
+
pageIndex: number
|
|
1109
|
+
) => {
|
|
1110
|
+
if (hasClickEvent.value) {
|
|
1111
|
+
emit('row-click', evt, row, pageIndex)
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
const onTrDblClick = (
|
|
1116
|
+
evt: MouseEvent,
|
|
1117
|
+
row: TableRow,
|
|
1118
|
+
pageIndex: number
|
|
1119
|
+
) => {
|
|
1120
|
+
if (hasDblClickEvent.value) {
|
|
1121
|
+
emit('row-dblclick', evt, row, pageIndex)
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
const onTrContextMenu = (
|
|
1126
|
+
evt: MouseEvent,
|
|
1127
|
+
row: TableRow,
|
|
1128
|
+
pageIndex: number
|
|
1129
|
+
) => {
|
|
1130
|
+
if (hasContextMenuEvent.value) {
|
|
1131
|
+
emit('row-contextmenu', evt, row, pageIndex)
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
function injectBodyCommonScope(data: Record<string, any>) {
|
|
1136
|
+
Object.assign(data, {
|
|
1137
|
+
cols: computedCols.value,
|
|
1138
|
+
colsMap: computedColsMap.value,
|
|
1139
|
+
sort,
|
|
1140
|
+
rowIndex: firstRowIndex.value + data.pageIndex,
|
|
1141
|
+
color: props.color,
|
|
1142
|
+
dense: props.dense,
|
|
1143
|
+
noHover: props.noHover
|
|
1144
|
+
})
|
|
1145
|
+
|
|
1146
|
+
if (hasSelectionMode.value === true) {
|
|
1147
|
+
injectProp(
|
|
1148
|
+
data,
|
|
1149
|
+
'selected',
|
|
1150
|
+
() => isRowSelected(data.key),
|
|
1151
|
+
(adding: boolean, evt: any) => {
|
|
1152
|
+
updateSelection([data.key], [data.row], adding, evt)
|
|
1153
|
+
}
|
|
1154
|
+
)
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
injectProp(
|
|
1158
|
+
data,
|
|
1159
|
+
'expand',
|
|
1160
|
+
() => isRowExpanded(data.key),
|
|
1161
|
+
(adding) => {
|
|
1162
|
+
updateExpanded(data.key, adding)
|
|
1163
|
+
}
|
|
1164
|
+
)
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
function getBodyScope(data: Record<string, any>) {
|
|
1168
|
+
injectBodyCommonScope(data)
|
|
1169
|
+
|
|
1170
|
+
data.cols = data.cols.map((col: TableColumn) =>
|
|
1171
|
+
Object.defineProperty({ ...col }, 'value', {
|
|
1172
|
+
get: () => getCellValue(col, data.row),
|
|
1173
|
+
enumerable: true
|
|
1174
|
+
})
|
|
1175
|
+
)
|
|
1176
|
+
|
|
1177
|
+
return data
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
function getBodyCellScope(data: Record<string, any>) {
|
|
1181
|
+
injectBodyCommonScope(data)
|
|
1182
|
+
injectProp(data, 'value', () => getCellValue(data.col, data.row))
|
|
1183
|
+
|
|
1184
|
+
return data
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
function getBodySelectionScope(data: Record<string, any>) {
|
|
1188
|
+
injectBodyCommonScope(data)
|
|
1189
|
+
return data
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
const hasLoadingSlot = computed(() => slots['loading'] !== void 0)
|
|
1193
|
+
|
|
1194
|
+
const paginationState = computed(() => {
|
|
1195
|
+
return {
|
|
1196
|
+
...computedPagination.value,
|
|
1197
|
+
'update:rowsPerPage': (rowsPerPage: number) =>
|
|
1198
|
+
setPagination({ rowsPerPage }),
|
|
1199
|
+
'update:modelValue': (page: number) => setPagination({ page }),
|
|
1200
|
+
modelValue: computedPagination.value.page,
|
|
1201
|
+
totalItems: computedRowsNumber.value
|
|
1202
|
+
}
|
|
1203
|
+
})
|
|
1204
|
+
|
|
1205
|
+
// expose public methods and needed computed props
|
|
1206
|
+
Object.assign(vm.proxy, {
|
|
1207
|
+
resetVirtualScroll,
|
|
1208
|
+
scrollTo,
|
|
1209
|
+
setExpanded,
|
|
1210
|
+
sort
|
|
1211
|
+
})
|
|
1212
|
+
|
|
1213
|
+
return {
|
|
1214
|
+
uuid: `dl-table-${v4()}`,
|
|
1215
|
+
rootRef,
|
|
1216
|
+
containerClass,
|
|
1217
|
+
computedRows,
|
|
1218
|
+
computedCols,
|
|
1219
|
+
computedColspan,
|
|
1220
|
+
getRowKey,
|
|
1221
|
+
additionalClasses,
|
|
1222
|
+
getHeaderScope,
|
|
1223
|
+
virtScrollRef,
|
|
1224
|
+
hasVirtScroll,
|
|
1225
|
+
virtProps,
|
|
1226
|
+
onVScroll,
|
|
1227
|
+
hasSlotByName,
|
|
1228
|
+
hasDraggableRows,
|
|
1229
|
+
hasDraggableColumns,
|
|
1230
|
+
marginalsScope,
|
|
1231
|
+
titleClasses,
|
|
1232
|
+
bottomClasses,
|
|
1233
|
+
hasTopSlots,
|
|
1234
|
+
nothingToDisplay,
|
|
1235
|
+
bottomMessage,
|
|
1236
|
+
paginationState,
|
|
1237
|
+
hasTopSelectionMode,
|
|
1238
|
+
hasBotomSelectionBanner,
|
|
1239
|
+
rowsSelectedNumber,
|
|
1240
|
+
singleSelection,
|
|
1241
|
+
multipleSelection,
|
|
1242
|
+
headerSelectedValue,
|
|
1243
|
+
selectionCheckboxIndeterminateVal,
|
|
1244
|
+
onMultipleSelectionSet,
|
|
1245
|
+
getBodyScope,
|
|
1246
|
+
isRowSelected,
|
|
1247
|
+
getCellValue,
|
|
1248
|
+
getBodyCellScope,
|
|
1249
|
+
hasSelectionMode,
|
|
1250
|
+
getBodySelectionScope,
|
|
1251
|
+
hasAnyAction,
|
|
1252
|
+
updateSelection,
|
|
1253
|
+
setPagination,
|
|
1254
|
+
hasLoadingSlot,
|
|
1255
|
+
displayPagination,
|
|
1256
|
+
onTrClick,
|
|
1257
|
+
onTrDblClick,
|
|
1258
|
+
onTrContextMenu
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
})
|
|
1262
|
+
</script>
|
|
1263
|
+
|
|
1264
|
+
<style scoped src="./dl-table-styles.scss" lang="scss" />
|