@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,217 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dl-dtr">
|
|
3
|
+
<div class="dl-dtr--options">
|
|
4
|
+
<span class="dl-dtr--options_title">General Configuration</span>
|
|
5
|
+
<div class="dl-dtr--option">
|
|
6
|
+
<span class="dl-dtr--option_title">Show time:</span>
|
|
7
|
+
<dl-switch
|
|
8
|
+
v-model="switchState"
|
|
9
|
+
value="showTime"
|
|
10
|
+
left-label="No"
|
|
11
|
+
right-label="Yes"
|
|
12
|
+
class="dl-dtr--option_switch"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="dl-dtr--option">
|
|
16
|
+
<span class="dl-dtr--option_title">Type:</span>
|
|
17
|
+
<dl-switch
|
|
18
|
+
v-model="switchState"
|
|
19
|
+
value="type"
|
|
20
|
+
left-label="Day"
|
|
21
|
+
right-label="Month"
|
|
22
|
+
class="dl-dtr--option_switch"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="dl-dtr--option">
|
|
26
|
+
<span class="dl-dtr--option_title">Mode:</span>
|
|
27
|
+
<dl-switch
|
|
28
|
+
v-model="switchState"
|
|
29
|
+
value="mode"
|
|
30
|
+
left-label="Single"
|
|
31
|
+
right-label="Multi"
|
|
32
|
+
class="dl-dtr--option_switch"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
style="margin-top: 10px"
|
|
37
|
+
class="dl-dtr--option__range"
|
|
38
|
+
>
|
|
39
|
+
<span class="dl-dtr--option_title">Available Range: </span>
|
|
40
|
+
<dl-switch
|
|
41
|
+
v-model="switchState"
|
|
42
|
+
value="range"
|
|
43
|
+
class="dl-dtr--option_switch"
|
|
44
|
+
@input="handleRange"
|
|
45
|
+
/>
|
|
46
|
+
<span class="dl-dtr--option_title">Auto Close: </span>
|
|
47
|
+
<dl-switch
|
|
48
|
+
v-model="switchState"
|
|
49
|
+
value="auto-close"
|
|
50
|
+
class="dl-dtr--option_switch"
|
|
51
|
+
/>
|
|
52
|
+
<br>
|
|
53
|
+
<span>From</span>
|
|
54
|
+
<input
|
|
55
|
+
type="date"
|
|
56
|
+
:disabled="!range"
|
|
57
|
+
:value="availableRangeFrom"
|
|
58
|
+
class="dl-dtr--range-input"
|
|
59
|
+
placeholder="from"
|
|
60
|
+
@input="setRangeFrom"
|
|
61
|
+
>
|
|
62
|
+
<span style="margin-left: 5px">To</span>
|
|
63
|
+
<input
|
|
64
|
+
:disabled="!range"
|
|
65
|
+
type="date"
|
|
66
|
+
:value="availableRangeTo"
|
|
67
|
+
class="dl-dtr--range-input"
|
|
68
|
+
placeholder="to"
|
|
69
|
+
@input="setRangeTo"
|
|
70
|
+
>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="dl-dtr--input">
|
|
74
|
+
<dl-date-time-range
|
|
75
|
+
:type="type"
|
|
76
|
+
:available-range="range ? availableRange : null"
|
|
77
|
+
:mode="mode"
|
|
78
|
+
:show-time="showTime"
|
|
79
|
+
:auto-close="autoClose"
|
|
80
|
+
@set-type="handleSetType"
|
|
81
|
+
@update:modelValue="handleModelValueUpdate"
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
<script lang="ts">
|
|
87
|
+
import { defineComponent } from 'vue-demi'
|
|
88
|
+
import { DlSwitch, DlDateTimeRange } from '../components'
|
|
89
|
+
import { DateInterval } from '../components/DlDatePicker/types'
|
|
90
|
+
|
|
91
|
+
export default defineComponent({
|
|
92
|
+
components: {
|
|
93
|
+
DlSwitch,
|
|
94
|
+
DlDateTimeRange
|
|
95
|
+
},
|
|
96
|
+
data(): {
|
|
97
|
+
switchState: any[]
|
|
98
|
+
availableRange: Partial<DateInterval>
|
|
99
|
+
} {
|
|
100
|
+
const from = new Date()
|
|
101
|
+
from.setDate(from.getDate() - 35)
|
|
102
|
+
const to = new Date()
|
|
103
|
+
to.setDate(to.getDate() + 35)
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
availableRange: {
|
|
107
|
+
from,
|
|
108
|
+
to
|
|
109
|
+
},
|
|
110
|
+
switchState: ['range']
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
computed: {
|
|
114
|
+
type(): string {
|
|
115
|
+
return this.switchState.includes('type') ? 'month' : 'day'
|
|
116
|
+
},
|
|
117
|
+
mode(): string {
|
|
118
|
+
return this.switchState.includes('mode') ? 'multi' : 'single'
|
|
119
|
+
},
|
|
120
|
+
showTime(): boolean {
|
|
121
|
+
return this.switchState.includes('showTime')
|
|
122
|
+
},
|
|
123
|
+
range(): boolean {
|
|
124
|
+
return this.switchState.includes('range')
|
|
125
|
+
},
|
|
126
|
+
availableRangeFrom(): string {
|
|
127
|
+
return this.availableRange?.from?.toISOString().split('T')[0] ?? ''
|
|
128
|
+
},
|
|
129
|
+
availableRangeTo(): string {
|
|
130
|
+
return this.availableRange?.to?.toISOString().split('T')[0] ?? ''
|
|
131
|
+
},
|
|
132
|
+
autoClose(): boolean {
|
|
133
|
+
return this.switchState.includes('auto-close')
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
methods: {
|
|
137
|
+
handleModelValueUpdate(value: DateInterval) {
|
|
138
|
+
console.log('Date: ', value)
|
|
139
|
+
},
|
|
140
|
+
handleSetType(value: string) {
|
|
141
|
+
if (value === 'day') {
|
|
142
|
+
const typeIndex = this.switchState.findIndex(
|
|
143
|
+
(t) => t === 'type'
|
|
144
|
+
)
|
|
145
|
+
if (typeIndex > -1) {
|
|
146
|
+
this.switchState.splice(typeIndex, 1)
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
this.switchState.push('type')
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
setRangeFrom({ target }: { target: HTMLInputElement }) {
|
|
153
|
+
this.availableRange = {
|
|
154
|
+
from: target.value ? new Date(target.value) : null,
|
|
155
|
+
to: this.availableRange?.to
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
setRangeTo({ target }: { target: HTMLInputElement }) {
|
|
159
|
+
this.availableRange = {
|
|
160
|
+
to: target.value ? new Date(target.value) : null,
|
|
161
|
+
from: this.availableRange?.from
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
handleRange({ target }: { target: HTMLInputElement }) {
|
|
165
|
+
if (!target.checked) this.availableRange = null
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
</script>
|
|
170
|
+
<style lang="scss" scoped>
|
|
171
|
+
.dl-dtr {
|
|
172
|
+
display: flex;
|
|
173
|
+
justify-content: center;
|
|
174
|
+
padding-top: 30px;
|
|
175
|
+
|
|
176
|
+
&--range-input {
|
|
177
|
+
height: 18px;
|
|
178
|
+
padding: 5px;
|
|
179
|
+
color: darkgray;
|
|
180
|
+
margin-top: 10px;
|
|
181
|
+
margin-left: 5px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&--options {
|
|
185
|
+
color: var(--dl-color-darker);
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
padding: 0 30px 0 0;
|
|
189
|
+
text-align: left;
|
|
190
|
+
|
|
191
|
+
&_title {
|
|
192
|
+
font-size: 20px;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&--option {
|
|
197
|
+
padding: 8px;
|
|
198
|
+
|
|
199
|
+
&__range {
|
|
200
|
+
font-size: 12px;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&--option_title {
|
|
205
|
+
font-size: 14px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&--option_switch {
|
|
209
|
+
font-size: 12px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&--input {
|
|
213
|
+
display: flex;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
</style>
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<button @click="openModal">
|
|
4
|
+
Open modal
|
|
5
|
+
</button>
|
|
6
|
+
<dl-dialog-box
|
|
7
|
+
ref="modalOne"
|
|
8
|
+
v-model="isOpenedFirstModal"
|
|
9
|
+
>
|
|
10
|
+
<template #header>
|
|
11
|
+
<dl-dialog-box-header
|
|
12
|
+
title="Dialog Box Title"
|
|
13
|
+
subtitle="updated by rotemshaham@dataloop.ai"
|
|
14
|
+
@on-close="closeModal"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
<template #body>
|
|
18
|
+
<p
|
|
19
|
+
style="
|
|
20
|
+
margin: 0;
|
|
21
|
+
color: var(--dl-color-medium);
|
|
22
|
+
font-size: 10px;
|
|
23
|
+
"
|
|
24
|
+
>
|
|
25
|
+
Updated by rotemshaham@dataloop.ai
|
|
26
|
+
</p>
|
|
27
|
+
<p
|
|
28
|
+
style="
|
|
29
|
+
margin: 0;
|
|
30
|
+
color: var(--dl-color-medium);
|
|
31
|
+
font-size: 10px;
|
|
32
|
+
margin-bottom: 20px;
|
|
33
|
+
"
|
|
34
|
+
>
|
|
35
|
+
Dec 1, 2020, 12:21pm
|
|
36
|
+
</p>
|
|
37
|
+
<p
|
|
38
|
+
style="
|
|
39
|
+
margin: 0;
|
|
40
|
+
color: var(--dl-color-darker);
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
"
|
|
43
|
+
>
|
|
44
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
45
|
+
Erat ac duis sed ullamcorper sagittis, sed. Tempus ac
|
|
46
|
+
pellentesque dignissim lobortis.
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
<dl-dialog-box ref="modalTwo">
|
|
50
|
+
<template #header>
|
|
51
|
+
<dl-dialog-box-header
|
|
52
|
+
has-back-button
|
|
53
|
+
title="Dialog Box Title"
|
|
54
|
+
subtitle="updated by rotemshaham@dataloop.ai"
|
|
55
|
+
@on-close="closeSecondModal"
|
|
56
|
+
/>
|
|
57
|
+
</template>
|
|
58
|
+
<template #body>
|
|
59
|
+
<p
|
|
60
|
+
style="
|
|
61
|
+
margin: 0;
|
|
62
|
+
color: var(--dl-color-medium);
|
|
63
|
+
font-size: 10px;
|
|
64
|
+
"
|
|
65
|
+
>
|
|
66
|
+
Updated by rotemshaham@dataloop.ai
|
|
67
|
+
</p>
|
|
68
|
+
<p
|
|
69
|
+
style="
|
|
70
|
+
margin: 0;
|
|
71
|
+
color: var(--dl-color-medium);
|
|
72
|
+
font-size: 10px;
|
|
73
|
+
margin-bottom: 20px;
|
|
74
|
+
"
|
|
75
|
+
>
|
|
76
|
+
Dec 1, 2020, 12:21pm
|
|
77
|
+
</p>
|
|
78
|
+
<p
|
|
79
|
+
style="
|
|
80
|
+
margin: 0;
|
|
81
|
+
color: var(--dl-color-darker);
|
|
82
|
+
font-size: 12px;
|
|
83
|
+
"
|
|
84
|
+
>
|
|
85
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing
|
|
86
|
+
elit. Erat ac duis sed ullamcorper sagittis, sed.
|
|
87
|
+
Tempus ac pellentesque dignissim lobortis.
|
|
88
|
+
</p>
|
|
89
|
+
</template>
|
|
90
|
+
<template #footer>
|
|
91
|
+
<dl-dialog-box-footer>
|
|
92
|
+
<dl-button @click="closeSecondModal">
|
|
93
|
+
Close
|
|
94
|
+
</dl-button>
|
|
95
|
+
</dl-dialog-box-footer>
|
|
96
|
+
</template>
|
|
97
|
+
</dl-dialog-box>
|
|
98
|
+
</template>
|
|
99
|
+
<template #footer>
|
|
100
|
+
<dl-dialog-box-footer>
|
|
101
|
+
<dl-button @click="openSecondModal">
|
|
102
|
+
Open second modal
|
|
103
|
+
</dl-button>
|
|
104
|
+
<dl-button @click="closeModal">
|
|
105
|
+
Close
|
|
106
|
+
</dl-button>
|
|
107
|
+
</dl-dialog-box-footer>
|
|
108
|
+
</template>
|
|
109
|
+
</dl-dialog-box>
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<script lang="ts">
|
|
114
|
+
import { defineComponent, ref } from 'vue-demi'
|
|
115
|
+
import { DlDialogBox, DlButton } from '../components'
|
|
116
|
+
import { DlDialogBoxHeader, DlDialogBoxFooter } from '../components/DlDialogBox'
|
|
117
|
+
|
|
118
|
+
export default defineComponent({
|
|
119
|
+
name: 'DlDialogBoxDemo',
|
|
120
|
+
components: {
|
|
121
|
+
DlButton,
|
|
122
|
+
DlDialogBox,
|
|
123
|
+
DlDialogBoxHeader,
|
|
124
|
+
DlDialogBoxFooter
|
|
125
|
+
},
|
|
126
|
+
setup() {
|
|
127
|
+
const modalOne = ref<any>(null)
|
|
128
|
+
const modalTwo = ref<any>(null)
|
|
129
|
+
|
|
130
|
+
const isOpenedFirstModal = ref(false)
|
|
131
|
+
|
|
132
|
+
const openModal = () => {
|
|
133
|
+
if (!modalOne.value) {
|
|
134
|
+
return
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
modalOne.value.openModal()
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const closeModal = () => {
|
|
141
|
+
if (!modalOne.value) {
|
|
142
|
+
return
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
modalOne.value.closeModal()
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const openSecondModal = () => {
|
|
149
|
+
if (!modalTwo.value) {
|
|
150
|
+
return
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
modalTwo.value.openModal()
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const closeSecondModal = () => {
|
|
157
|
+
if (!modalTwo.value) {
|
|
158
|
+
return
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
modalTwo.value.closeModal()
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
openModal,
|
|
166
|
+
closeModal,
|
|
167
|
+
openSecondModal,
|
|
168
|
+
closeSecondModal,
|
|
169
|
+
modalOne,
|
|
170
|
+
modalTwo,
|
|
171
|
+
isOpenedFirstModal
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
</script>
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div style="display: flex; gap: 20px; flex-direction: column">
|
|
4
|
+
<h2>Splitted</h2>
|
|
5
|
+
<dl-dropdown-button
|
|
6
|
+
auto-close
|
|
7
|
+
outlined
|
|
8
|
+
split
|
|
9
|
+
label="Dropdown Button Outlined"
|
|
10
|
+
>
|
|
11
|
+
<dl-list>
|
|
12
|
+
<dl-list-item clickable>
|
|
13
|
+
<dl-item-section> Photos </dl-item-section>
|
|
14
|
+
</dl-list-item>
|
|
15
|
+
|
|
16
|
+
<dl-list-item clickable>
|
|
17
|
+
<dl-item-section> Videos </dl-item-section>
|
|
18
|
+
</dl-list-item>
|
|
19
|
+
|
|
20
|
+
<dl-list-item clickable>
|
|
21
|
+
<dl-item-section> Articles </dl-item-section>
|
|
22
|
+
</dl-list-item>
|
|
23
|
+
</dl-list>
|
|
24
|
+
</dl-dropdown-button>
|
|
25
|
+
|
|
26
|
+
<dl-dropdown-button
|
|
27
|
+
disabled
|
|
28
|
+
auto-close
|
|
29
|
+
outlined
|
|
30
|
+
split
|
|
31
|
+
label="Dropdown Button Outlined"
|
|
32
|
+
>
|
|
33
|
+
<dl-list>
|
|
34
|
+
<dl-list-item clickable>
|
|
35
|
+
<dl-item-section> Photos </dl-item-section>
|
|
36
|
+
</dl-list-item>
|
|
37
|
+
|
|
38
|
+
<dl-list-item clickable>
|
|
39
|
+
<dl-item-section> Videos </dl-item-section>
|
|
40
|
+
</dl-list-item>
|
|
41
|
+
|
|
42
|
+
<dl-list-item clickable>
|
|
43
|
+
<dl-item-section> Articles </dl-item-section>
|
|
44
|
+
</dl-list-item>
|
|
45
|
+
</dl-list>
|
|
46
|
+
</dl-dropdown-button>
|
|
47
|
+
|
|
48
|
+
<dl-dropdown-button
|
|
49
|
+
split
|
|
50
|
+
label="Dropdown Button Contained"
|
|
51
|
+
>
|
|
52
|
+
<dl-list>
|
|
53
|
+
<dl-list-item clickable>
|
|
54
|
+
<dl-item-section> Photos </dl-item-section>
|
|
55
|
+
</dl-list-item>
|
|
56
|
+
|
|
57
|
+
<dl-list-item clickable>
|
|
58
|
+
<dl-item-section> Videos </dl-item-section>
|
|
59
|
+
</dl-list-item>
|
|
60
|
+
|
|
61
|
+
<dl-list-item clickable>
|
|
62
|
+
<dl-item-section> Articles </dl-item-section>
|
|
63
|
+
</dl-list-item>
|
|
64
|
+
</dl-list>
|
|
65
|
+
</dl-dropdown-button>
|
|
66
|
+
|
|
67
|
+
<dl-dropdown-button
|
|
68
|
+
v-model="showing"
|
|
69
|
+
auto-close
|
|
70
|
+
split
|
|
71
|
+
:label="name"
|
|
72
|
+
main-btn-style="width: 120px"
|
|
73
|
+
@click="onClick"
|
|
74
|
+
>
|
|
75
|
+
<dl-list>
|
|
76
|
+
<dl-list-item
|
|
77
|
+
clickable
|
|
78
|
+
@click="() => onClose('Photos')"
|
|
79
|
+
>
|
|
80
|
+
<dl-item-section> Photos </dl-item-section>
|
|
81
|
+
</dl-list-item>
|
|
82
|
+
|
|
83
|
+
<dl-list-item
|
|
84
|
+
clickable
|
|
85
|
+
@click="() => onClose('Videos and long text')"
|
|
86
|
+
>
|
|
87
|
+
<dl-item-section>
|
|
88
|
+
Videos and long text
|
|
89
|
+
</dl-item-section>
|
|
90
|
+
</dl-list-item>
|
|
91
|
+
|
|
92
|
+
<dl-list-item
|
|
93
|
+
clickable
|
|
94
|
+
@click="() => onClose('Articles')"
|
|
95
|
+
>
|
|
96
|
+
<dl-item-section> Articles </dl-item-section>
|
|
97
|
+
</dl-list-item>
|
|
98
|
+
</dl-list>
|
|
99
|
+
</dl-dropdown-button>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div style="display: flex; gap: 20px; flex-direction: column">
|
|
103
|
+
<h2>One Button</h2>
|
|
104
|
+
<dl-dropdown-button
|
|
105
|
+
auto-close
|
|
106
|
+
outlined
|
|
107
|
+
label="Dropdown Button Outlined"
|
|
108
|
+
>
|
|
109
|
+
<dl-list>
|
|
110
|
+
<dl-list-item clickable>
|
|
111
|
+
<dl-item-section> Photos </dl-item-section>
|
|
112
|
+
</dl-list-item>
|
|
113
|
+
|
|
114
|
+
<dl-list-item clickable>
|
|
115
|
+
<dl-item-section> Videos </dl-item-section>
|
|
116
|
+
</dl-list-item>
|
|
117
|
+
|
|
118
|
+
<dl-list-item clickable>
|
|
119
|
+
<dl-item-section> Articles </dl-item-section>
|
|
120
|
+
</dl-list-item>
|
|
121
|
+
</dl-list>
|
|
122
|
+
</dl-dropdown-button>
|
|
123
|
+
|
|
124
|
+
<dl-dropdown-button
|
|
125
|
+
disabled
|
|
126
|
+
auto-close
|
|
127
|
+
outlined
|
|
128
|
+
label="Dropdown Button Outlined"
|
|
129
|
+
>
|
|
130
|
+
<dl-list>
|
|
131
|
+
<dl-list-item clickable>
|
|
132
|
+
<dl-item-section> Photos </dl-item-section>
|
|
133
|
+
</dl-list-item>
|
|
134
|
+
|
|
135
|
+
<dl-list-item clickable>
|
|
136
|
+
<dl-item-section> Videos </dl-item-section>
|
|
137
|
+
</dl-list-item>
|
|
138
|
+
|
|
139
|
+
<dl-list-item clickable>
|
|
140
|
+
<dl-item-section> Articles </dl-item-section>
|
|
141
|
+
</dl-list-item>
|
|
142
|
+
</dl-list>
|
|
143
|
+
</dl-dropdown-button>
|
|
144
|
+
|
|
145
|
+
<dl-dropdown-button
|
|
146
|
+
auto-close
|
|
147
|
+
label="Dropdown Button Contained"
|
|
148
|
+
max-height="210px"
|
|
149
|
+
>
|
|
150
|
+
<dl-list>
|
|
151
|
+
<dl-list-item clickable>
|
|
152
|
+
<dl-item-section> Photos </dl-item-section>
|
|
153
|
+
</dl-list-item>
|
|
154
|
+
|
|
155
|
+
<dl-list-item clickable>
|
|
156
|
+
<dl-item-section> Videos </dl-item-section>
|
|
157
|
+
</dl-list-item>
|
|
158
|
+
|
|
159
|
+
<dl-list-item clickable>
|
|
160
|
+
<dl-item-section> Articles </dl-item-section>
|
|
161
|
+
</dl-list-item>
|
|
162
|
+
<dl-list-item clickable>
|
|
163
|
+
<dl-item-section> Photos </dl-item-section>
|
|
164
|
+
</dl-list-item>
|
|
165
|
+
|
|
166
|
+
<dl-list-item clickable>
|
|
167
|
+
<dl-item-section> Videos </dl-item-section>
|
|
168
|
+
</dl-list-item>
|
|
169
|
+
|
|
170
|
+
<dl-list-item clickable>
|
|
171
|
+
<dl-item-section> Articles </dl-item-section>
|
|
172
|
+
</dl-list-item>
|
|
173
|
+
<dl-list-item clickable>
|
|
174
|
+
<dl-item-section> Photos </dl-item-section>
|
|
175
|
+
</dl-list-item>
|
|
176
|
+
|
|
177
|
+
<dl-list-item clickable>
|
|
178
|
+
<dl-item-section> Videos </dl-item-section>
|
|
179
|
+
</dl-list-item>
|
|
180
|
+
|
|
181
|
+
<dl-list-item clickable>
|
|
182
|
+
<dl-item-section> Articles </dl-item-section>
|
|
183
|
+
</dl-list-item>
|
|
184
|
+
</dl-list>
|
|
185
|
+
</dl-dropdown-button>
|
|
186
|
+
|
|
187
|
+
<dl-dropdown-button
|
|
188
|
+
auto-close
|
|
189
|
+
:model-value="showing"
|
|
190
|
+
:label="name"
|
|
191
|
+
main-btn-style="width: 150px;"
|
|
192
|
+
@show="onOpen"
|
|
193
|
+
>
|
|
194
|
+
<dl-list>
|
|
195
|
+
<dl-list-item
|
|
196
|
+
clickable
|
|
197
|
+
@click="() => onClose('Photos')"
|
|
198
|
+
>
|
|
199
|
+
<dl-item-section> Photos </dl-item-section>
|
|
200
|
+
</dl-list-item>
|
|
201
|
+
|
|
202
|
+
<dl-list-item
|
|
203
|
+
clickable
|
|
204
|
+
@click="() => onClose('Videos and long text')"
|
|
205
|
+
>
|
|
206
|
+
<dl-item-section>
|
|
207
|
+
Videos and long text
|
|
208
|
+
</dl-item-section>
|
|
209
|
+
</dl-list-item>
|
|
210
|
+
|
|
211
|
+
<dl-list-item
|
|
212
|
+
clickable
|
|
213
|
+
@click="() => onClose('Articles')"
|
|
214
|
+
>
|
|
215
|
+
<dl-item-section> Articles </dl-item-section>
|
|
216
|
+
</dl-list-item>
|
|
217
|
+
</dl-list>
|
|
218
|
+
</dl-dropdown-button>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
</template>
|
|
222
|
+
|
|
223
|
+
<script lang="ts">
|
|
224
|
+
import { defineComponent } from 'vue-demi'
|
|
225
|
+
import {
|
|
226
|
+
DlListItem,
|
|
227
|
+
DlItemSection,
|
|
228
|
+
DlList,
|
|
229
|
+
DlDropdownButton
|
|
230
|
+
} from '../components'
|
|
231
|
+
|
|
232
|
+
export default defineComponent({
|
|
233
|
+
name: 'DlDropdownButtonDemo',
|
|
234
|
+
components: {
|
|
235
|
+
DlListItem,
|
|
236
|
+
DlItemSection,
|
|
237
|
+
DlList,
|
|
238
|
+
DlDropdownButton
|
|
239
|
+
},
|
|
240
|
+
data() {
|
|
241
|
+
return {
|
|
242
|
+
name: 'Dropdown Button Controlled',
|
|
243
|
+
showing: false
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
methods: {
|
|
247
|
+
onClose(name: string) {
|
|
248
|
+
this.name = name
|
|
249
|
+
this.showing = false
|
|
250
|
+
alert(this.name)
|
|
251
|
+
},
|
|
252
|
+
onOpen() {
|
|
253
|
+
this.showing = true
|
|
254
|
+
},
|
|
255
|
+
onClick() {
|
|
256
|
+
alert(this.name)
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<DlIcon icon="icon-dl-usage" />
|
|
4
|
+
<DlIcon
|
|
5
|
+
color="dl-color-secondary"
|
|
6
|
+
icon="icon-dl-arrow-up"
|
|
7
|
+
/>
|
|
8
|
+
<DlIcon
|
|
9
|
+
size="50px"
|
|
10
|
+
color="red"
|
|
11
|
+
icon="icon-dl-search"
|
|
12
|
+
/>
|
|
13
|
+
SVG ICON:
|
|
14
|
+
|
|
15
|
+
<DlIcon
|
|
16
|
+
size="50px"
|
|
17
|
+
color="red"
|
|
18
|
+
icon="mastercard"
|
|
19
|
+
svg
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
Clickable:
|
|
23
|
+
|
|
24
|
+
<DlIcon
|
|
25
|
+
size="50px"
|
|
26
|
+
color="red"
|
|
27
|
+
icon="icon-dl-search"
|
|
28
|
+
@click.stop="onClick"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script lang="ts">
|
|
34
|
+
import { defineComponent } from 'vue-demi'
|
|
35
|
+
import { DlIcon } from '../components'
|
|
36
|
+
export default defineComponent({
|
|
37
|
+
name: 'DlIconDemo',
|
|
38
|
+
components: {
|
|
39
|
+
DlIcon
|
|
40
|
+
},
|
|
41
|
+
methods: {
|
|
42
|
+
onClick() {
|
|
43
|
+
console.log('clicked')
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
</script>
|