@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,475 @@
|
|
|
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-text-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
|
+
<p>Separator</p>
|
|
39
|
+
<DlOptionGroup
|
|
40
|
+
v-model="separator"
|
|
41
|
+
inline
|
|
42
|
+
:options="[
|
|
43
|
+
{
|
|
44
|
+
label: 'Horizontal (default)',
|
|
45
|
+
value: 'horizontal'
|
|
46
|
+
},
|
|
47
|
+
{ label: 'Vertical', value: 'vertical' },
|
|
48
|
+
{ label: 'Cell', value: 'cell' },
|
|
49
|
+
{ label: 'None', value: 'none' }
|
|
50
|
+
]"
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div>
|
|
55
|
+
<p>Draggable</p>
|
|
56
|
+
<DlOptionGroup
|
|
57
|
+
v-model="draggable"
|
|
58
|
+
inline
|
|
59
|
+
:options="[
|
|
60
|
+
{ label: 'rows', value: 'rows' },
|
|
61
|
+
{ label: 'columns', value: 'columns' },
|
|
62
|
+
{ label: 'both', value: 'both' },
|
|
63
|
+
{ label: 'none', value: 'none' }
|
|
64
|
+
]"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div>
|
|
69
|
+
<p>Selection</p>
|
|
70
|
+
<DlOptionGroup
|
|
71
|
+
v-model="selection"
|
|
72
|
+
inline
|
|
73
|
+
:options="[
|
|
74
|
+
{ label: 'none', value: 'none' },
|
|
75
|
+
{ label: 'single', value: 'single' },
|
|
76
|
+
{ label: 'multiple', value: 'multiple' }
|
|
77
|
+
]"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div>
|
|
82
|
+
<p>Loading</p>
|
|
83
|
+
<DlOptionGroup
|
|
84
|
+
v-model="loading"
|
|
85
|
+
inline
|
|
86
|
+
:options="[
|
|
87
|
+
{ label: 'True', value: true },
|
|
88
|
+
{ label: 'False', value: false }
|
|
89
|
+
]"
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<DlTable
|
|
94
|
+
:selected="selected"
|
|
95
|
+
:separator="separator"
|
|
96
|
+
:columns="columns"
|
|
97
|
+
:bordered="bordered"
|
|
98
|
+
:draggable="draggable"
|
|
99
|
+
:dense="dense"
|
|
100
|
+
class="sticky-header"
|
|
101
|
+
:filter="filter"
|
|
102
|
+
:selection="selection"
|
|
103
|
+
:loading="loading"
|
|
104
|
+
:rows="rows"
|
|
105
|
+
:resizable="resizable"
|
|
106
|
+
row-key="name"
|
|
107
|
+
:pagination="{
|
|
108
|
+
rowsPerPage: 25,
|
|
109
|
+
maxPages: 4
|
|
110
|
+
}"
|
|
111
|
+
color="dl-color-secondary"
|
|
112
|
+
title="Table Title"
|
|
113
|
+
:virtual-scroll="vScroll"
|
|
114
|
+
style="height: 500px"
|
|
115
|
+
@row-click="log"
|
|
116
|
+
@update:selected="updateSeleted"
|
|
117
|
+
>
|
|
118
|
+
<!-- <template #top> Top Table </template> -->
|
|
119
|
+
<!-- <template #top-left> Top Table Left </template> -->
|
|
120
|
+
<!-- <template #top-right> Top Table Right </template>
|
|
121
|
+
|
|
122
|
+
<template #top-selection> Top Selection </template> -->
|
|
123
|
+
|
|
124
|
+
<!-- <template #header="props">
|
|
125
|
+
<dl-tr :props="props">
|
|
126
|
+
<dl-th auto-width />
|
|
127
|
+
<dl-th
|
|
128
|
+
v-for="col in props.cols"
|
|
129
|
+
:key="col.name"
|
|
130
|
+
:props="props"
|
|
131
|
+
>
|
|
132
|
+
{{ col.label }}
|
|
133
|
+
</dl-th>
|
|
134
|
+
</dl-tr>
|
|
135
|
+
</template> -->
|
|
136
|
+
|
|
137
|
+
<!-- <template #header-cell="props">
|
|
138
|
+
<dl-th :props="props">
|
|
139
|
+
{{ props.col.label }}
|
|
140
|
+
</dl-th>
|
|
141
|
+
</template>
|
|
142
|
+
|
|
143
|
+
<template #header-cell-calories="props">
|
|
144
|
+
<dl-th :props="props">
|
|
145
|
+
custom
|
|
146
|
+
{{ props.col.label }}
|
|
147
|
+
</dl-th>
|
|
148
|
+
</template> -->
|
|
149
|
+
|
|
150
|
+
<!-- <template #body="props">
|
|
151
|
+
<dl-tr :props="props">
|
|
152
|
+
<dl-td auto-width>
|
|
153
|
+
<dl-button
|
|
154
|
+
flat
|
|
155
|
+
size="s"
|
|
156
|
+
text-color="dl-color-darker"
|
|
157
|
+
style="padding: 0; border-width: 0!important; :active: border-width: 0"
|
|
158
|
+
:icon="
|
|
159
|
+
props.expand
|
|
160
|
+
? 'icon-dl-down-chevron'
|
|
161
|
+
: 'icon-dl-right-chevron'
|
|
162
|
+
"
|
|
163
|
+
@click="props.expand = !props.expand"
|
|
164
|
+
/>
|
|
165
|
+
</dl-td>
|
|
166
|
+
<dl-td
|
|
167
|
+
v-for="col in props.cols"
|
|
168
|
+
:key="col.name"
|
|
169
|
+
:props="props"
|
|
170
|
+
>
|
|
171
|
+
{{ col.value }}
|
|
172
|
+
</dl-td>
|
|
173
|
+
</dl-tr>
|
|
174
|
+
<dl-tr v-show="props.expand" :props="props">
|
|
175
|
+
<dl-td colspan="100%" style="padding: 16px">
|
|
176
|
+
<div class="text-left">
|
|
177
|
+
This is expand slot for row above:
|
|
178
|
+
{{ props.row.name }}.
|
|
179
|
+
</div>
|
|
180
|
+
</dl-td>
|
|
181
|
+
</dl-tr>
|
|
182
|
+
</template> -->
|
|
183
|
+
|
|
184
|
+
<!-- <template #loading> Loading ... </template> -->
|
|
185
|
+
|
|
186
|
+
<!-- <template #bottom="props">
|
|
187
|
+
<dl-pagination v-bind="props.pagination" />
|
|
188
|
+
</template> -->
|
|
189
|
+
</DlTable>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
</template>
|
|
193
|
+
|
|
194
|
+
<script lang="ts">
|
|
195
|
+
import {
|
|
196
|
+
DlTable,
|
|
197
|
+
DlOptionGroup,
|
|
198
|
+
DlSwitch,
|
|
199
|
+
DlTextInput
|
|
200
|
+
// DlTr,
|
|
201
|
+
// DlTh,
|
|
202
|
+
// DlTd,
|
|
203
|
+
// DlPagination,
|
|
204
|
+
// DlButton
|
|
205
|
+
} from '../components'
|
|
206
|
+
import { defineComponent } from 'vue-demi'
|
|
207
|
+
import { times } from 'lodash'
|
|
208
|
+
|
|
209
|
+
const columns = [
|
|
210
|
+
{
|
|
211
|
+
name: 'name',
|
|
212
|
+
required: true,
|
|
213
|
+
label: 'Dessert (100g serving)',
|
|
214
|
+
align: 'left',
|
|
215
|
+
field: 'name',
|
|
216
|
+
sortable: true
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'calories',
|
|
220
|
+
align: 'center',
|
|
221
|
+
label: 'Calories',
|
|
222
|
+
field: 'calories',
|
|
223
|
+
sortable: true
|
|
224
|
+
},
|
|
225
|
+
{ name: 'fat', label: 'Fat (g)', field: 'fat', sortable: true },
|
|
226
|
+
{ name: 'carbs', label: 'Carbs (g)', field: 'carbs' },
|
|
227
|
+
{ name: 'protein', label: 'Protein (g)', field: 'protein' },
|
|
228
|
+
{ name: 'sodium', label: 'Sodium (mg)', field: 'sodium' },
|
|
229
|
+
{
|
|
230
|
+
name: 'calcium',
|
|
231
|
+
label: 'Calcium (%)',
|
|
232
|
+
field: 'calcium',
|
|
233
|
+
sortable: true,
|
|
234
|
+
sort: (a: string | number, b: string | number) =>
|
|
235
|
+
parseInt(a as string, 10) - parseInt(b as string, 10)
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'iron',
|
|
239
|
+
label: 'Iron (%)',
|
|
240
|
+
field: 'iron',
|
|
241
|
+
sortable: true,
|
|
242
|
+
sort: (a: string | number, b: string | number) =>
|
|
243
|
+
parseInt(a as string, 10) - parseInt(b as string, 10)
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
|
|
247
|
+
const rows = [
|
|
248
|
+
{
|
|
249
|
+
name: 'Frozen Yogurt',
|
|
250
|
+
calories: 159,
|
|
251
|
+
fat: 6.0,
|
|
252
|
+
carbs: 24,
|
|
253
|
+
protein: 4.0,
|
|
254
|
+
sodium: 87,
|
|
255
|
+
calcium: '14%',
|
|
256
|
+
iron: '1%'
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: 'Ice cream sandwich',
|
|
260
|
+
calories: 237,
|
|
261
|
+
fat: 9.0,
|
|
262
|
+
carbs: 37,
|
|
263
|
+
protein: 4.3,
|
|
264
|
+
sodium: 129,
|
|
265
|
+
calcium: '8%',
|
|
266
|
+
iron: '1%'
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'Eclair',
|
|
270
|
+
calories: 262,
|
|
271
|
+
fat: 16.0,
|
|
272
|
+
carbs: 23,
|
|
273
|
+
protein: 6.0,
|
|
274
|
+
sodium: 337,
|
|
275
|
+
calcium: '6%',
|
|
276
|
+
iron: '7%'
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: 'Cupcake',
|
|
280
|
+
calories: 305,
|
|
281
|
+
fat: 3.7,
|
|
282
|
+
carbs: 67,
|
|
283
|
+
protein: 4.3,
|
|
284
|
+
sodium: 413,
|
|
285
|
+
calcium: '3%',
|
|
286
|
+
iron: '8%'
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: 'Gingerbread',
|
|
290
|
+
calories: 356,
|
|
291
|
+
fat: 16.0,
|
|
292
|
+
carbs: 49,
|
|
293
|
+
protein: 3.9,
|
|
294
|
+
sodium: 327,
|
|
295
|
+
calcium: '7%',
|
|
296
|
+
iron: '16%'
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: 'Jelly bean',
|
|
300
|
+
calories: 375,
|
|
301
|
+
fat: 0.0,
|
|
302
|
+
carbs: 94,
|
|
303
|
+
protein: 0.0,
|
|
304
|
+
sodium: 50,
|
|
305
|
+
calcium: '0%',
|
|
306
|
+
iron: '0%'
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'Lollipop',
|
|
310
|
+
calories: 392,
|
|
311
|
+
fat: 0.2,
|
|
312
|
+
carbs: 98,
|
|
313
|
+
protein: 0,
|
|
314
|
+
sodium: 38,
|
|
315
|
+
calcium: '0%',
|
|
316
|
+
iron: '2%'
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: 'Honeycomb',
|
|
320
|
+
calories: 408,
|
|
321
|
+
fat: 3.2,
|
|
322
|
+
carbs: 87,
|
|
323
|
+
protein: 6.5,
|
|
324
|
+
sodium: 562,
|
|
325
|
+
calcium: '0%',
|
|
326
|
+
iron: '45%'
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
name: 'Donut',
|
|
330
|
+
calories: 452,
|
|
331
|
+
fat: 25.0,
|
|
332
|
+
carbs: 51,
|
|
333
|
+
protein: 4.9,
|
|
334
|
+
sodium: 326,
|
|
335
|
+
calcium: '2%',
|
|
336
|
+
iron: '22%'
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: 'KitKat',
|
|
340
|
+
calories: 518,
|
|
341
|
+
fat: 26.0,
|
|
342
|
+
carbs: 65,
|
|
343
|
+
protein: 7,
|
|
344
|
+
sodium: 54,
|
|
345
|
+
calcium: '12%',
|
|
346
|
+
iron: '6%'
|
|
347
|
+
},
|
|
348
|
+
...times(100, (index) => ({
|
|
349
|
+
name: 'KitKat' + index,
|
|
350
|
+
calories: 518,
|
|
351
|
+
fat: 26.0,
|
|
352
|
+
carbs: 65,
|
|
353
|
+
protein: 7,
|
|
354
|
+
sodium: 54,
|
|
355
|
+
calcium: '12%',
|
|
356
|
+
iron: '6%'
|
|
357
|
+
}))
|
|
358
|
+
]
|
|
359
|
+
|
|
360
|
+
export default defineComponent({
|
|
361
|
+
components: {
|
|
362
|
+
DlTable,
|
|
363
|
+
DlSwitch,
|
|
364
|
+
DlOptionGroup,
|
|
365
|
+
DlTextInput
|
|
366
|
+
// DlTr,
|
|
367
|
+
// DlTh,
|
|
368
|
+
// DlPagination,
|
|
369
|
+
// DlTd,
|
|
370
|
+
// DlButton
|
|
371
|
+
},
|
|
372
|
+
data() {
|
|
373
|
+
return {
|
|
374
|
+
filter: '',
|
|
375
|
+
selected: [],
|
|
376
|
+
selection: 'none',
|
|
377
|
+
separator: 'horizontal',
|
|
378
|
+
bordered: false,
|
|
379
|
+
loading: false,
|
|
380
|
+
dense: false,
|
|
381
|
+
vScroll: false,
|
|
382
|
+
resizable: false,
|
|
383
|
+
borderState: [] as boolean[],
|
|
384
|
+
denseState: [] as boolean[],
|
|
385
|
+
virtualScroll: [] as boolean[],
|
|
386
|
+
resizableState: [] as boolean[],
|
|
387
|
+
rows,
|
|
388
|
+
draggable: 'both',
|
|
389
|
+
columns
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
methods: {
|
|
393
|
+
updateSeleted(payload: any) {
|
|
394
|
+
this.selected = payload
|
|
395
|
+
},
|
|
396
|
+
updateBorderedState(val: boolean[]): void {
|
|
397
|
+
this.borderState = val
|
|
398
|
+
|
|
399
|
+
this.bordered = val.length !== 0
|
|
400
|
+
},
|
|
401
|
+
updateVirtualScrollState(val: boolean[]): void {
|
|
402
|
+
this.virtualScroll = val
|
|
403
|
+
|
|
404
|
+
this.vScroll = val.length !== 0
|
|
405
|
+
},
|
|
406
|
+
updateDenseState(val: boolean[]): void {
|
|
407
|
+
this.denseState = val
|
|
408
|
+
|
|
409
|
+
this.dense = val.length !== 0
|
|
410
|
+
},
|
|
411
|
+
updateResizableState(val: boolean[]): void {
|
|
412
|
+
this.resizableState = val
|
|
413
|
+
|
|
414
|
+
this.resizable = val.length !== 0
|
|
415
|
+
},
|
|
416
|
+
log(...args: any[]) {
|
|
417
|
+
console.log(...args)
|
|
418
|
+
},
|
|
419
|
+
filterMethod(
|
|
420
|
+
rows: Record<string, any>[],
|
|
421
|
+
filterTerms: string | Record<string, any>,
|
|
422
|
+
cols: Record<string, any>[],
|
|
423
|
+
cellValue: Function
|
|
424
|
+
) {
|
|
425
|
+
const lowerTerms = filterTerms ? filterTerms.toLowerCase() : ''
|
|
426
|
+
return rows.filter(
|
|
427
|
+
(row) =>
|
|
428
|
+
!cols.some((col) => {
|
|
429
|
+
const val = cellValue(col, row) + ''
|
|
430
|
+
const haystack =
|
|
431
|
+
val === 'undefined' || val === 'null'
|
|
432
|
+
? ''
|
|
433
|
+
: val.toLowerCase()
|
|
434
|
+
return haystack.indexOf(lowerTerms) > -1
|
|
435
|
+
})
|
|
436
|
+
)
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
})
|
|
440
|
+
</script>
|
|
441
|
+
|
|
442
|
+
<style scoped lang="scss">
|
|
443
|
+
.settings {
|
|
444
|
+
display: flex;
|
|
445
|
+
width: 100%;
|
|
446
|
+
max-width: 600px;
|
|
447
|
+
gap: 10px;
|
|
448
|
+
justify-content: center;
|
|
449
|
+
flex-wrap: wrap;
|
|
450
|
+
& > * {
|
|
451
|
+
flex-grow: 1;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.sticky-header {
|
|
456
|
+
::v-deep .dl-table__top,
|
|
457
|
+
::v-deep .dl-table__bottom,
|
|
458
|
+
::v-deep thead tr:first-child th {
|
|
459
|
+
/* bg color is important for th; just specify one */
|
|
460
|
+
background-color: var(--dl-color-panel-background);
|
|
461
|
+
}
|
|
462
|
+
::v-deep thead tr th {
|
|
463
|
+
position: sticky !important;
|
|
464
|
+
z-index: 1;
|
|
465
|
+
}
|
|
466
|
+
::v-deep thead tr:first-child th {
|
|
467
|
+
top: 0;
|
|
468
|
+
}
|
|
469
|
+
/* this is when the loading indicator appears */
|
|
470
|
+
&.dl-table--loading thead tr:last-child th {
|
|
471
|
+
/* height of all previous header rows */
|
|
472
|
+
top: 40px;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<dl-tabs
|
|
4
|
+
v-model="selectedTab"
|
|
5
|
+
:items="tabItems"
|
|
6
|
+
@update:model-value="handleModelValueUpdate"
|
|
7
|
+
/>
|
|
8
|
+
<div style="height: 4px" />
|
|
9
|
+
<dl-tab-panels v-model="selectedTab">
|
|
10
|
+
<dl-tab-panel
|
|
11
|
+
v-for="item in tabItems"
|
|
12
|
+
:key="item.name"
|
|
13
|
+
class="tabpanel"
|
|
14
|
+
:name="item.name"
|
|
15
|
+
>
|
|
16
|
+
<h1>{{ item.label }}</h1>
|
|
17
|
+
</dl-tab-panel>
|
|
18
|
+
</dl-tab-panels>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { defineComponent } from 'vue-demi'
|
|
23
|
+
import { DlTabs, DlTabPanel, DlTabPanels } from '../components'
|
|
24
|
+
import { TabDetails } from '../components/DlTabs/types'
|
|
25
|
+
|
|
26
|
+
export default defineComponent({
|
|
27
|
+
components: {
|
|
28
|
+
DlTabs,
|
|
29
|
+
DlTabPanel,
|
|
30
|
+
DlTabPanels
|
|
31
|
+
},
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
selectedTab: 'one',
|
|
35
|
+
tabItems: [
|
|
36
|
+
{
|
|
37
|
+
label: 'One',
|
|
38
|
+
name: 'one',
|
|
39
|
+
showTooltip: true,
|
|
40
|
+
tooltip: 'Some tooltip content'
|
|
41
|
+
},
|
|
42
|
+
{ label: 'Two', name: 'two' },
|
|
43
|
+
{ label: 'Three', name: 'three' },
|
|
44
|
+
{ label: 'Four', name: 'four', disabled: true },
|
|
45
|
+
{ label: 'Five', name: 'five' },
|
|
46
|
+
{ label: 'Six', name: 'six' },
|
|
47
|
+
{ label: 'Seven', name: 'seven' },
|
|
48
|
+
{ label: 'Eight', name: 'eight' }
|
|
49
|
+
] as TabDetails[]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
methods: {
|
|
53
|
+
handleModelValueUpdate(e: string) {
|
|
54
|
+
console.log(e)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
</script>
|
|
59
|
+
<style>
|
|
60
|
+
.tabpanel {
|
|
61
|
+
margin: 0 auto;
|
|
62
|
+
padding: 1rem;
|
|
63
|
+
border: 1px solid var(--dl-color-separator);
|
|
64
|
+
border-bottom-left-radius: 8px;
|
|
65
|
+
border-bottom-right-radius: 8px;
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<DlTd> Table Td component </DlTd>
|
|
4
|
+
<DlTd :auto-width="true">
|
|
5
|
+
Table Td component auto width
|
|
6
|
+
</DlTd>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { DlTd } from '../components'
|
|
12
|
+
import { defineComponent } from 'vue-demi'
|
|
13
|
+
|
|
14
|
+
export default defineComponent({
|
|
15
|
+
components: {
|
|
16
|
+
DlTd
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<dl-text-area
|
|
4
|
+
v-model="textAreaValue"
|
|
5
|
+
placeholder="Type your text..."
|
|
6
|
+
show-counter
|
|
7
|
+
:max-length="20"
|
|
8
|
+
enable-resize
|
|
9
|
+
@focus="textAreaFocused = true"
|
|
10
|
+
@blur="textAreaFocused = false"
|
|
11
|
+
/>
|
|
12
|
+
<div style="margin-left: 20px">
|
|
13
|
+
<p>Value: {{ textAreaValue }}</p>
|
|
14
|
+
<p>Status: {{ textAreaFocused ? 'focused' : 'unfocused' }}</p>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import { defineComponent, ref } from 'vue-demi'
|
|
21
|
+
import { DlTextArea } from '../components'
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
name: 'DlTextAreaDemo',
|
|
24
|
+
components: {
|
|
25
|
+
DlTextArea
|
|
26
|
+
},
|
|
27
|
+
setup() {
|
|
28
|
+
const textAreaValue = ref('')
|
|
29
|
+
const textAreaFocused = ref(false)
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
textAreaValue,
|
|
33
|
+
textAreaFocused
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="dl-text-holder-demo">
|
|
4
|
+
<dl-text-holder
|
|
5
|
+
prefix="home/Desktop/"
|
|
6
|
+
suffix=".mp3"
|
|
7
|
+
text="very-loooooooooooong-named-song"
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<dl-text-holder
|
|
11
|
+
prefix="home/Desktop/"
|
|
12
|
+
suffix=".mp3"
|
|
13
|
+
>
|
|
14
|
+
very-loooooooooooong-named-song2
|
|
15
|
+
</dl-text-holder>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { defineComponent } from 'vue-demi'
|
|
22
|
+
import { DlTextHolder } from '../components'
|
|
23
|
+
|
|
24
|
+
export default defineComponent({
|
|
25
|
+
components: {
|
|
26
|
+
DlTextHolder
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
.dl-text-holder-demo {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
resize: horizontal;
|
|
36
|
+
overflow: auto;
|
|
37
|
+
width: 300px;
|
|
38
|
+
box-shadow: var(--dl-menu-shadow);
|
|
39
|
+
padding: 5px;
|
|
40
|
+
word-wrap: break-word;
|
|
41
|
+
}
|
|
42
|
+
</style>
|