@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,355 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<dl-select
|
|
4
|
+
:options="['one', 'two', 'three']"
|
|
5
|
+
title="Title"
|
|
6
|
+
required
|
|
7
|
+
/>
|
|
8
|
+
<dl-select
|
|
9
|
+
v-model="disabledSelected"
|
|
10
|
+
:options="['disabled option', 'two', 'three']"
|
|
11
|
+
title="Disabled"
|
|
12
|
+
disabled
|
|
13
|
+
/>
|
|
14
|
+
<dl-select
|
|
15
|
+
v-model="selectedOption"
|
|
16
|
+
width="84px"
|
|
17
|
+
without-borders
|
|
18
|
+
without-placeholder
|
|
19
|
+
with-chips
|
|
20
|
+
align-right
|
|
21
|
+
:options="[
|
|
22
|
+
{ label: 'High', value: 'high', bgColor: 'dl-color-negative' },
|
|
23
|
+
{
|
|
24
|
+
label: 'Medium',
|
|
25
|
+
value: 'medium',
|
|
26
|
+
bgColor: 'dl-color-warning',
|
|
27
|
+
textColor: 'dl-color-darker'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'Low',
|
|
31
|
+
value: 'low',
|
|
32
|
+
bgColor: 'dl-color-positive',
|
|
33
|
+
textColor: 'dl-color-darker'
|
|
34
|
+
}
|
|
35
|
+
]"
|
|
36
|
+
required
|
|
37
|
+
>
|
|
38
|
+
<template #selected="scope">
|
|
39
|
+
<dl-chip
|
|
40
|
+
:text-color="scope.opt.textColor"
|
|
41
|
+
:color="scope.opt.bgColor"
|
|
42
|
+
>
|
|
43
|
+
{{ scope.opt.label }}
|
|
44
|
+
</dl-chip>
|
|
45
|
+
</template>
|
|
46
|
+
<template #option="scope">
|
|
47
|
+
<dl-chip
|
|
48
|
+
:text-color="scope.opt.textColor"
|
|
49
|
+
:color="scope.opt.bgColor"
|
|
50
|
+
>
|
|
51
|
+
{{ scope.opt.label }}
|
|
52
|
+
</dl-chip>
|
|
53
|
+
</template>
|
|
54
|
+
</dl-select>
|
|
55
|
+
|
|
56
|
+
<dl-select
|
|
57
|
+
v-model="statusOption"
|
|
58
|
+
width="96px"
|
|
59
|
+
without-borders
|
|
60
|
+
align-right
|
|
61
|
+
:options="[
|
|
62
|
+
{
|
|
63
|
+
label: 'Status 1',
|
|
64
|
+
value: 1,
|
|
65
|
+
badgeColor: 'dl-color-disabled'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: 'Status 2',
|
|
69
|
+
value: 2,
|
|
70
|
+
badgeColor: 'dl-color-secondary'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: 'Status 3',
|
|
74
|
+
value: 3,
|
|
75
|
+
badgeColor: 'dl-color-positive'
|
|
76
|
+
},
|
|
77
|
+
{ label: 'Status 4', value: 4, badgeColor: 'dl-color-warning' }
|
|
78
|
+
]"
|
|
79
|
+
required
|
|
80
|
+
>
|
|
81
|
+
<template #selected="scope">
|
|
82
|
+
<div style="display: flex; align-items: center; gap: 5px">
|
|
83
|
+
<dl-badge :color="scope.opt.badgeColor" />
|
|
84
|
+
{{ scope.opt.label }}
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
87
|
+
<template #option="scope">
|
|
88
|
+
<div style="display: flex; align-items: center; gap: 5px">
|
|
89
|
+
<dl-badge :color="scope.opt.badgeColor" />
|
|
90
|
+
{{ scope.opt.label }}
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
</dl-select>
|
|
94
|
+
<dl-select
|
|
95
|
+
v-model="tasksFilter"
|
|
96
|
+
multiselect
|
|
97
|
+
:options="[
|
|
98
|
+
{ label: 'Hard', value: 'hard', count: 20 },
|
|
99
|
+
{ label: 'Easy', value: 'easy', count: 50 }
|
|
100
|
+
]"
|
|
101
|
+
has-prepend
|
|
102
|
+
all-items-option
|
|
103
|
+
>
|
|
104
|
+
<template #prepend>
|
|
105
|
+
<dl-icon
|
|
106
|
+
size="12px"
|
|
107
|
+
icon="icon-dl-filter"
|
|
108
|
+
/>
|
|
109
|
+
</template>
|
|
110
|
+
</dl-select>
|
|
111
|
+
<dl-select
|
|
112
|
+
v-model="selectedBySearch"
|
|
113
|
+
size="m"
|
|
114
|
+
title="Title"
|
|
115
|
+
optional
|
|
116
|
+
:options="searchOptions"
|
|
117
|
+
search
|
|
118
|
+
emit-val
|
|
119
|
+
@filter="filterFn"
|
|
120
|
+
/>
|
|
121
|
+
<dl-select
|
|
122
|
+
v-model="selectedByFilteringSearch"
|
|
123
|
+
:options="searchOptions"
|
|
124
|
+
size="m"
|
|
125
|
+
multiselect
|
|
126
|
+
style="background-color: beige"
|
|
127
|
+
placeholder="contributors"
|
|
128
|
+
search
|
|
129
|
+
/>
|
|
130
|
+
|
|
131
|
+
<dl-select
|
|
132
|
+
v-model="selectedWithEmitValue"
|
|
133
|
+
title="Emit Value"
|
|
134
|
+
:options="searchOptions"
|
|
135
|
+
size="m"
|
|
136
|
+
emit-value
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
Expandable tree view
|
|
140
|
+
<dl-select
|
|
141
|
+
v-model="selectedWithChildrenSearch"
|
|
142
|
+
:options="treeOptions"
|
|
143
|
+
size="m"
|
|
144
|
+
multiselect
|
|
145
|
+
/>
|
|
146
|
+
<dl-select
|
|
147
|
+
v-model="selectedWithChildren"
|
|
148
|
+
:options="treeOptions"
|
|
149
|
+
size="m"
|
|
150
|
+
multiselect
|
|
151
|
+
search
|
|
152
|
+
/>
|
|
153
|
+
Capitalized options
|
|
154
|
+
<dl-select
|
|
155
|
+
v-model="selectedWithChildrenCapitalized"
|
|
156
|
+
:options="treeOptions"
|
|
157
|
+
size="m"
|
|
158
|
+
multiselect
|
|
159
|
+
search
|
|
160
|
+
capitalized-options
|
|
161
|
+
/>
|
|
162
|
+
With Fit
|
|
163
|
+
<dl-select
|
|
164
|
+
v-model="selectedWithChildrenCapitalized"
|
|
165
|
+
:options="treeOptions"
|
|
166
|
+
size="m"
|
|
167
|
+
multiselect
|
|
168
|
+
search
|
|
169
|
+
capitalized-options
|
|
170
|
+
fit
|
|
171
|
+
/>
|
|
172
|
+
With Label and sub label
|
|
173
|
+
<dl-select
|
|
174
|
+
v-model="selectedOption"
|
|
175
|
+
:options="[
|
|
176
|
+
{
|
|
177
|
+
subLabel: 'not so high',
|
|
178
|
+
label: 'High',
|
|
179
|
+
value: 'high',
|
|
180
|
+
bgColor: 'dl-color-negative'
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
subLabel: 'not so medium',
|
|
184
|
+
label: 'Medium',
|
|
185
|
+
value: 'medium',
|
|
186
|
+
bgColor: 'dl-color-warning',
|
|
187
|
+
textColor: 'dl-color-darker'
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
subLabel: 'not so low',
|
|
191
|
+
label: 'Low',
|
|
192
|
+
value: 'low',
|
|
193
|
+
bgColor: 'dl-color-positive',
|
|
194
|
+
textColor: 'dl-color-darker'
|
|
195
|
+
}
|
|
196
|
+
]"
|
|
197
|
+
>
|
|
198
|
+
<template #option="scope">
|
|
199
|
+
<div style="padding: 5px 0px">
|
|
200
|
+
<div>{{ scope.opt.label }}</div>
|
|
201
|
+
<div>{{ scope.opt.subLabel }}</div>
|
|
202
|
+
</div>
|
|
203
|
+
</template>
|
|
204
|
+
</dl-select>
|
|
205
|
+
</div>
|
|
206
|
+
</template>
|
|
207
|
+
|
|
208
|
+
<script lang="ts">
|
|
209
|
+
import { defineComponent } from 'vue-demi'
|
|
210
|
+
import { DlChip, DlSelect, DlIcon, DlBadge } from '../components'
|
|
211
|
+
|
|
212
|
+
const defaultOptions = [
|
|
213
|
+
{ label: 'Contributor 1', value: 'c1' },
|
|
214
|
+
{ label: 'Contributor 2', value: 'c2' },
|
|
215
|
+
{ label: 'Contributor 3', value: 'c3' }
|
|
216
|
+
]
|
|
217
|
+
|
|
218
|
+
const treeOptions = [
|
|
219
|
+
{
|
|
220
|
+
label: 'root',
|
|
221
|
+
value: 'root',
|
|
222
|
+
children: [
|
|
223
|
+
{ label: 'child 1', value: 'c1' },
|
|
224
|
+
{ label: 'child 2', value: 'c2' },
|
|
225
|
+
{
|
|
226
|
+
label: 'child 3',
|
|
227
|
+
value: 'c3',
|
|
228
|
+
children: [
|
|
229
|
+
{ label: 'child 4', value: 'c4' },
|
|
230
|
+
{
|
|
231
|
+
label: 'child 5',
|
|
232
|
+
value: 'c5',
|
|
233
|
+
children: [
|
|
234
|
+
{ label: 'child 6', value: 'c6' },
|
|
235
|
+
{
|
|
236
|
+
label: 'child 7',
|
|
237
|
+
value: 'c7',
|
|
238
|
+
children: [
|
|
239
|
+
{ label: 'child 8', value: 'c8' },
|
|
240
|
+
{
|
|
241
|
+
label: 'child 9',
|
|
242
|
+
value: 'c9',
|
|
243
|
+
children: [
|
|
244
|
+
{ label: 'child 10', value: 'c10' },
|
|
245
|
+
{
|
|
246
|
+
label: 'child 11',
|
|
247
|
+
value: 'c11',
|
|
248
|
+
children: [
|
|
249
|
+
{
|
|
250
|
+
label: 'child 12',
|
|
251
|
+
value: 'c12'
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
label: 'child 13',
|
|
255
|
+
value: 'c13',
|
|
256
|
+
children: [
|
|
257
|
+
{
|
|
258
|
+
label: 'child 14',
|
|
259
|
+
value: 'c14'
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
label: 'Really long line Really long line Really long line Really long line Really long line Really long line',
|
|
263
|
+
value: 'c17',
|
|
264
|
+
children: [
|
|
265
|
+
{
|
|
266
|
+
label: 'child 15',
|
|
267
|
+
value: '15'
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
label: 'child 16',
|
|
271
|
+
value: '16'
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
label: 'root1',
|
|
291
|
+
value: 'root1',
|
|
292
|
+
children: [
|
|
293
|
+
{ label: 'child 1', value: 'c6' },
|
|
294
|
+
{ label: 'child 2', value: 'c7' },
|
|
295
|
+
{
|
|
296
|
+
label: 'child 3',
|
|
297
|
+
value: 'c8',
|
|
298
|
+
children: [
|
|
299
|
+
{ label: 'child 4', value: 'c9' },
|
|
300
|
+
{ label: 'child 5', value: 'c10' }
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
|
|
307
|
+
export default defineComponent({
|
|
308
|
+
components: { DlSelect, DlIcon, DlChip, DlBadge },
|
|
309
|
+
data() {
|
|
310
|
+
return {
|
|
311
|
+
selectedOption: {
|
|
312
|
+
label: 'High',
|
|
313
|
+
value: 'high',
|
|
314
|
+
bgColor: 'dl-color-error',
|
|
315
|
+
textColor: 'dl-color-white'
|
|
316
|
+
},
|
|
317
|
+
statusOption: {
|
|
318
|
+
label: 'Status 1',
|
|
319
|
+
value: 1,
|
|
320
|
+
badgeColor: 'dl-color-disabled'
|
|
321
|
+
},
|
|
322
|
+
searchOptions: defaultOptions,
|
|
323
|
+
treeOptions,
|
|
324
|
+
selectedBySearch: undefined,
|
|
325
|
+
selectedByFilteringSearch: [],
|
|
326
|
+
selectedWithEmitValue: 'c1',
|
|
327
|
+
selectedWithChildren: [],
|
|
328
|
+
selectedWithChildrenSearch: [],
|
|
329
|
+
selectedWithChildrenCapitalized: [],
|
|
330
|
+
tasksFilter: [],
|
|
331
|
+
showAllOption: true,
|
|
332
|
+
disabledSelected: 'disabled option'
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
computed: {
|
|
336
|
+
isNotSelected() {
|
|
337
|
+
// @ts-ignore
|
|
338
|
+
return defaultOptions.includes(this.selectedBySearch as any)
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
methods: {
|
|
342
|
+
filterFn(val: string) {
|
|
343
|
+
this.searchOptions = defaultOptions.filter(
|
|
344
|
+
(v: { label: string; value: string } | undefined) =>
|
|
345
|
+
v.label.toLowerCase().indexOf(val.toLowerCase()) > -1
|
|
346
|
+
)
|
|
347
|
+
this.showAllOption =
|
|
348
|
+
this.searchOptions.length === defaultOptions.length
|
|
349
|
+
},
|
|
350
|
+
handleInput(e: Event) {
|
|
351
|
+
return (e.target as HTMLInputElement).value
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
})
|
|
355
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<DlSkeleton
|
|
4
|
+
height="200px"
|
|
5
|
+
width="200px"
|
|
6
|
+
/>
|
|
7
|
+
<div />
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { defineComponent } from 'vue-demi'
|
|
13
|
+
import { DlSkeleton } from '../components'
|
|
14
|
+
export default defineComponent({
|
|
15
|
+
name: 'DlSkeletonDemo',
|
|
16
|
+
components: {
|
|
17
|
+
DlSkeleton
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<dl-slider
|
|
4
|
+
v-model.number="value"
|
|
5
|
+
width="500px"
|
|
6
|
+
text="slider"
|
|
7
|
+
:step="1"
|
|
8
|
+
:min="-100"
|
|
9
|
+
:max="100"
|
|
10
|
+
:editable="editable"
|
|
11
|
+
:readonly="readonly"
|
|
12
|
+
:disabled="disabled"
|
|
13
|
+
/>
|
|
14
|
+
<div>
|
|
15
|
+
<button @click="editable = !editable">
|
|
16
|
+
Editable: {{ editable }}
|
|
17
|
+
</button>
|
|
18
|
+
<button @click="readonly = !readonly">
|
|
19
|
+
Readonly: {{ readonly }}
|
|
20
|
+
</button>
|
|
21
|
+
<button @click="disabled = !disabled">
|
|
22
|
+
Disable: {{ disabled }}
|
|
23
|
+
</button>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { DlSlider } from '../components'
|
|
30
|
+
import { defineComponent } from 'vue-demi'
|
|
31
|
+
|
|
32
|
+
export default defineComponent({
|
|
33
|
+
name: 'DlSliderDemo',
|
|
34
|
+
components: {
|
|
35
|
+
DlSlider
|
|
36
|
+
},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
value: 0,
|
|
40
|
+
editable: false,
|
|
41
|
+
disabled: false,
|
|
42
|
+
readonly: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
template: 'dl-slider-demo'
|
|
46
|
+
})
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<dl-button
|
|
4
|
+
label="Open Dialog Box (Center)"
|
|
5
|
+
@click="openStepper"
|
|
6
|
+
/>
|
|
7
|
+
<div
|
|
8
|
+
class="dl-stepper-wrapper"
|
|
9
|
+
:style="cssVars"
|
|
10
|
+
>
|
|
11
|
+
<dl-stepper
|
|
12
|
+
v-model="isOpen"
|
|
13
|
+
done-button-label="Create"
|
|
14
|
+
width="800px"
|
|
15
|
+
style="max-height: 400px"
|
|
16
|
+
header-title="Create New Task"
|
|
17
|
+
:content-title="`${stepper.currentIndex + 1}. ${
|
|
18
|
+
stepper.currentStep.value
|
|
19
|
+
}`"
|
|
20
|
+
:with-transition="true"
|
|
21
|
+
:bg-color="bgColor"
|
|
22
|
+
:state="stepper.currentStep"
|
|
23
|
+
:steps="stepper.steps"
|
|
24
|
+
:disabled-prev-step="!stepper.hasPrevStep()"
|
|
25
|
+
:disabled-next-step="!stepper.hasNextStep()"
|
|
26
|
+
:is-done="stepper.isDone()"
|
|
27
|
+
:next-step="stepper.getNextStep()"
|
|
28
|
+
:prev-step="stepper.getPrevStep()"
|
|
29
|
+
@next="handleNext"
|
|
30
|
+
@prev="handlePrev"
|
|
31
|
+
@done="handleDone"
|
|
32
|
+
@set-step="handleStep"
|
|
33
|
+
>
|
|
34
|
+
<template #content-header="{ state }">
|
|
35
|
+
<div style="display: flex; gap: 20px; align-items: center">
|
|
36
|
+
<dl-typography
|
|
37
|
+
size="h3"
|
|
38
|
+
variant="h3"
|
|
39
|
+
>
|
|
40
|
+
{{
|
|
41
|
+
`${stepper.currentIndex + 1}. ${
|
|
42
|
+
stepper.currentStep.value
|
|
43
|
+
.charAt(0)
|
|
44
|
+
.toUpperCase() +
|
|
45
|
+
stepper.currentStep.value.slice(1)
|
|
46
|
+
}`
|
|
47
|
+
}}
|
|
48
|
+
</dl-typography>
|
|
49
|
+
<dl-chip
|
|
50
|
+
v-if="state.warning"
|
|
51
|
+
max-width="100%"
|
|
52
|
+
color="dl-color-warning-background"
|
|
53
|
+
text-color="dl-color-darker"
|
|
54
|
+
>
|
|
55
|
+
{{ state.warning }}
|
|
56
|
+
</dl-chip>
|
|
57
|
+
|
|
58
|
+
<dl-counters
|
|
59
|
+
style="padding: 0; margin-left: auto"
|
|
60
|
+
small
|
|
61
|
+
:items="counters"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
<template #general>
|
|
66
|
+
<general-step
|
|
67
|
+
@error-click="stepper.failStep('Custom Error')"
|
|
68
|
+
@complete-click="stepper.completeStep()"
|
|
69
|
+
@warning-click="
|
|
70
|
+
stepper.setStepWarning('Custom Warning')
|
|
71
|
+
"
|
|
72
|
+
@reset-click="stepper.resetStep()"
|
|
73
|
+
/>
|
|
74
|
+
</template>
|
|
75
|
+
<template #data>
|
|
76
|
+
<data-step
|
|
77
|
+
@error-click="stepper.failStep('Custom Error')"
|
|
78
|
+
@complete-click="stepper.completeStep()"
|
|
79
|
+
@warning-click="
|
|
80
|
+
stepper.setStepWarning('Custom Warning')
|
|
81
|
+
"
|
|
82
|
+
@reset-click="stepper.resetStep()"
|
|
83
|
+
/>
|
|
84
|
+
</template>
|
|
85
|
+
<template #instructions>
|
|
86
|
+
<instruction-step
|
|
87
|
+
@error-click="stepper.failStep('Custom Error')"
|
|
88
|
+
@complete-click="stepper.completeStep()"
|
|
89
|
+
@warning-click="
|
|
90
|
+
stepper.setStepWarning('Custom Warning')
|
|
91
|
+
"
|
|
92
|
+
@reset-click="stepper.resetStep()"
|
|
93
|
+
/>
|
|
94
|
+
</template>
|
|
95
|
+
<template #assignments>
|
|
96
|
+
<assignments-step
|
|
97
|
+
@error-click="stepper.failStep('Custom Error')"
|
|
98
|
+
@complete-click="stepper.completeStep()"
|
|
99
|
+
@warning-click="
|
|
100
|
+
stepper.setStepWarning('Custom Warning')
|
|
101
|
+
"
|
|
102
|
+
@reset-click="stepper.resetStep()"
|
|
103
|
+
/>
|
|
104
|
+
</template>
|
|
105
|
+
<template #quality>
|
|
106
|
+
<quality-step
|
|
107
|
+
@error-click="stepper.failStep('Custom Error')"
|
|
108
|
+
@complete-click="stepper.completeStep()"
|
|
109
|
+
@warning-click="
|
|
110
|
+
stepper.setStepWarning('Custom Warning')
|
|
111
|
+
"
|
|
112
|
+
@reset-click="stepper.resetStep()"
|
|
113
|
+
/>
|
|
114
|
+
</template>
|
|
115
|
+
</dl-stepper>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</template>
|
|
119
|
+
<script lang="ts">
|
|
120
|
+
import { defineComponent } from 'vue-demi'
|
|
121
|
+
import GeneralStep from './steps/GeneralStep.vue'
|
|
122
|
+
import InstructionStep from './steps/InstructionStep.vue'
|
|
123
|
+
import DataStep from './steps/DataStep.vue'
|
|
124
|
+
import AssignmentsStep from './steps/AssignmentsStep.vue'
|
|
125
|
+
import QualityStep from './steps/QualityStep.vue'
|
|
126
|
+
import {
|
|
127
|
+
DlButton,
|
|
128
|
+
DlStepper,
|
|
129
|
+
Stepper,
|
|
130
|
+
Step,
|
|
131
|
+
StepState,
|
|
132
|
+
DlTypography,
|
|
133
|
+
DlChip,
|
|
134
|
+
DlCounters
|
|
135
|
+
} from '../..'
|
|
136
|
+
import { getColor } from '../../utils'
|
|
137
|
+
|
|
138
|
+
class CustomStepper extends Stepper {
|
|
139
|
+
constructor(steps: Step[]) {
|
|
140
|
+
super(steps)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
public completeStep() {
|
|
144
|
+
super.completeStep()
|
|
145
|
+
console.log('COMPLETED')
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export default defineComponent({
|
|
150
|
+
components: {
|
|
151
|
+
DlStepper,
|
|
152
|
+
DlButton,
|
|
153
|
+
AssignmentsStep,
|
|
154
|
+
InstructionStep,
|
|
155
|
+
DataStep,
|
|
156
|
+
GeneralStep,
|
|
157
|
+
QualityStep,
|
|
158
|
+
DlTypography,
|
|
159
|
+
DlChip,
|
|
160
|
+
DlCounters
|
|
161
|
+
},
|
|
162
|
+
data() {
|
|
163
|
+
const stepper: Stepper = null
|
|
164
|
+
|
|
165
|
+
return {
|
|
166
|
+
counters: [{ value: 3, text: 'Assigmments' }],
|
|
167
|
+
isOpen: false,
|
|
168
|
+
stepper,
|
|
169
|
+
steps: [
|
|
170
|
+
{
|
|
171
|
+
value: 'general',
|
|
172
|
+
title: 'general',
|
|
173
|
+
warning: 'Some issues in the step',
|
|
174
|
+
completed: true
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
value: 'data',
|
|
178
|
+
title: 'data',
|
|
179
|
+
completed: true
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
value: 'instructions',
|
|
183
|
+
title: 'instructions'
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
value: 'assignments',
|
|
187
|
+
title: 'assignments'
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
value: 'quality',
|
|
191
|
+
title: 'quality',
|
|
192
|
+
optional: true
|
|
193
|
+
}
|
|
194
|
+
] as StepState[],
|
|
195
|
+
bgColor: 'dl-color-fill-third'
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
computed: {
|
|
199
|
+
cssVars(): Record<string, string | number> {
|
|
200
|
+
return {
|
|
201
|
+
'--dl-overlay-display': this.isOpen ? 'flex' : 'none',
|
|
202
|
+
'--dl-stepper-bg': getColor(
|
|
203
|
+
this.bgColor,
|
|
204
|
+
'dl-color-fill-third'
|
|
205
|
+
),
|
|
206
|
+
'--dl-stepper-position': 'center'
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
watch: {
|
|
211
|
+
modelValue(newVal: boolean) {
|
|
212
|
+
this.isOpen = newVal
|
|
213
|
+
if (newVal) document.documentElement.style.overflow = 'hidden'
|
|
214
|
+
else document.documentElement.style.overflow = 'auto'
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
beforeMount() {
|
|
218
|
+
const steps = this.steps.map((step) => new Step(step))
|
|
219
|
+
this.stepper = new CustomStepper(steps)
|
|
220
|
+
},
|
|
221
|
+
methods: {
|
|
222
|
+
openStepper() {
|
|
223
|
+
this.isOpen = true
|
|
224
|
+
},
|
|
225
|
+
handleNext() {
|
|
226
|
+
this.stepper.moveToNextStep()
|
|
227
|
+
},
|
|
228
|
+
handlePrev() {
|
|
229
|
+
this.stepper.moveToPrevStep()
|
|
230
|
+
},
|
|
231
|
+
handleDone() {
|
|
232
|
+
console.log('DONE')
|
|
233
|
+
},
|
|
234
|
+
handleStep(step: Step) {
|
|
235
|
+
this.stepper.currentIndex = this.stepper.steps.findIndex(
|
|
236
|
+
(s) => s.value === step.value
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
</script>
|
|
242
|
+
<style lang="scss" scoped>
|
|
243
|
+
.dl-stepper-wrapper {
|
|
244
|
+
position: fixed; /* Sit on top of the page content */
|
|
245
|
+
display: var(--dl-overlay-display); /* Hidden by default */
|
|
246
|
+
justify-content: var(--dl-stepper-position);
|
|
247
|
+
align-items: center;
|
|
248
|
+
width: 100%; /* Full width (cover the whole page) */
|
|
249
|
+
height: 100vh; /* Full height (cover the whole page) */
|
|
250
|
+
top: 0;
|
|
251
|
+
left: 0;
|
|
252
|
+
right: 0;
|
|
253
|
+
bottom: 0;
|
|
254
|
+
overscroll-behavior: contain;
|
|
255
|
+
background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */
|
|
256
|
+
z-index: var(
|
|
257
|
+
--dl-z-index-overlay
|
|
258
|
+
); /* Specify a stack order in case you're using a different order for other elements */
|
|
259
|
+
}
|
|
260
|
+
</style>
|