@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
package/src/App.vue
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DlThemeProvider :is-dark="isDarkMode">
|
|
3
|
+
<div style="display: flex">
|
|
4
|
+
<dl-typography
|
|
5
|
+
color="dl-color-medium"
|
|
6
|
+
size="h1"
|
|
7
|
+
variant="h1"
|
|
8
|
+
>
|
|
9
|
+
Dataloop AI UI Library
|
|
10
|
+
</dl-typography>
|
|
11
|
+
<dl-button
|
|
12
|
+
v-if="!hasProps"
|
|
13
|
+
style="margin: 0 20px"
|
|
14
|
+
@click="toggleColorMode"
|
|
15
|
+
>
|
|
16
|
+
{{ (isDarkMode ? 'Light' : 'Dark') + ' theme' }}
|
|
17
|
+
</dl-button>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="layout-wrapper">
|
|
20
|
+
<div class="sidebar">
|
|
21
|
+
<dl-search
|
|
22
|
+
v-model="activeDemo"
|
|
23
|
+
style="margin-bottom: 5px"
|
|
24
|
+
/>
|
|
25
|
+
<dl-list
|
|
26
|
+
bordered
|
|
27
|
+
clickable
|
|
28
|
+
style="
|
|
29
|
+
min-width: 200px;
|
|
30
|
+
height: 100%;
|
|
31
|
+
height: calc(100vh - 60px);
|
|
32
|
+
overflow: auto;
|
|
33
|
+
"
|
|
34
|
+
>
|
|
35
|
+
<template #default="{ clickable }">
|
|
36
|
+
<dl-list-item
|
|
37
|
+
v-for="(componentName, index) in Object.keys(
|
|
38
|
+
demoState
|
|
39
|
+
)"
|
|
40
|
+
:key="componentName"
|
|
41
|
+
:bordered="index !== 0"
|
|
42
|
+
:clickable="clickable"
|
|
43
|
+
:class="
|
|
44
|
+
componentName === activeDemo ? 'selected' : ''
|
|
45
|
+
"
|
|
46
|
+
style="text-transform: capitalize"
|
|
47
|
+
@click="setActiveDemo(componentName)"
|
|
48
|
+
>
|
|
49
|
+
{{ parseName(componentName) }}
|
|
50
|
+
</dl-list-item>
|
|
51
|
+
</template>
|
|
52
|
+
</dl-list>
|
|
53
|
+
</div>
|
|
54
|
+
<div
|
|
55
|
+
v-if="activeDemo !== 'stepper'"
|
|
56
|
+
class="content"
|
|
57
|
+
>
|
|
58
|
+
<div style="display: flex; justify-content: center">
|
|
59
|
+
<dl-typography
|
|
60
|
+
size="h2"
|
|
61
|
+
variant="h2"
|
|
62
|
+
style="text-transform: capitalize"
|
|
63
|
+
>
|
|
64
|
+
{{ parseName(activeDemo) }} component
|
|
65
|
+
</dl-typography>
|
|
66
|
+
</div>
|
|
67
|
+
<component
|
|
68
|
+
:is="demoState[activeDemo]"
|
|
69
|
+
class="data-container"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
<div
|
|
73
|
+
v-else
|
|
74
|
+
class="content"
|
|
75
|
+
>
|
|
76
|
+
<SimpleStepper />
|
|
77
|
+
<div style="height: 10px" />
|
|
78
|
+
<StepperInDialogBox />
|
|
79
|
+
<div style="height: 10px" />
|
|
80
|
+
<CenteredStepperInDialogBox />
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</DlThemeProvider>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script lang="ts">
|
|
87
|
+
import { defineComponent, ref, computed } from 'vue-demi'
|
|
88
|
+
import {
|
|
89
|
+
DlThemeProvider,
|
|
90
|
+
DlButton,
|
|
91
|
+
DlListItem,
|
|
92
|
+
DlList,
|
|
93
|
+
DlTypography,
|
|
94
|
+
DlSearch
|
|
95
|
+
} from './components'
|
|
96
|
+
import {
|
|
97
|
+
demoState,
|
|
98
|
+
SimpleStepper,
|
|
99
|
+
StepperInDialogBox,
|
|
100
|
+
CenteredStepperInDialogBox
|
|
101
|
+
} from './demo'
|
|
102
|
+
import { parseName } from './utils'
|
|
103
|
+
|
|
104
|
+
export default defineComponent({
|
|
105
|
+
name: 'DlComponentsDemo',
|
|
106
|
+
components: {
|
|
107
|
+
DlThemeProvider,
|
|
108
|
+
DlButton,
|
|
109
|
+
DlListItem,
|
|
110
|
+
DlList,
|
|
111
|
+
DlTypography,
|
|
112
|
+
DlSearch,
|
|
113
|
+
SimpleStepper,
|
|
114
|
+
StepperInDialogBox,
|
|
115
|
+
CenteredStepperInDialogBox
|
|
116
|
+
},
|
|
117
|
+
props: {
|
|
118
|
+
isDark: { required: false, default: null, type: Boolean }
|
|
119
|
+
},
|
|
120
|
+
setup(props) {
|
|
121
|
+
const hasProps = computed(() => props.isDark !== null)
|
|
122
|
+
const darkMode = ref(false)
|
|
123
|
+
const demos = Object.keys(demoState)
|
|
124
|
+
const activeDemo = ref(
|
|
125
|
+
window.localStorage.getItem('dl-active-demo') ?? demos[0] ?? ''
|
|
126
|
+
)
|
|
127
|
+
const setActiveDemo = (demo: string) => {
|
|
128
|
+
activeDemo.value = demo
|
|
129
|
+
|
|
130
|
+
if (demos.includes(demo)) {
|
|
131
|
+
window.localStorage.setItem('dl-active-demo', demo)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const toggleColorMode = () => {
|
|
135
|
+
darkMode.value = !darkMode.value
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const isDarkMode = computed(() => {
|
|
139
|
+
if (hasProps.value) {
|
|
140
|
+
return props.isDark
|
|
141
|
+
}
|
|
142
|
+
return darkMode.value
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
hasProps,
|
|
147
|
+
isDarkMode,
|
|
148
|
+
activeDemo,
|
|
149
|
+
setActiveDemo,
|
|
150
|
+
toggleColorMode,
|
|
151
|
+
demoState,
|
|
152
|
+
parseName
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
</script>
|
|
157
|
+
|
|
158
|
+
<style scoped lang="scss">
|
|
159
|
+
#app {
|
|
160
|
+
-webkit-font-smoothing: antialiased;
|
|
161
|
+
-moz-osx-font-smoothing: grayscale;
|
|
162
|
+
text-align: center;
|
|
163
|
+
color: #2c3e50;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.layout-wrapper {
|
|
167
|
+
display: flex;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.sidebar {
|
|
171
|
+
display: flex;
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.content {
|
|
176
|
+
padding: 20px 30px;
|
|
177
|
+
flex-grow: 1;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.data-container {
|
|
181
|
+
display: flex;
|
|
182
|
+
gap: 1rem;
|
|
183
|
+
align-items: center;
|
|
184
|
+
max-width: 100%;
|
|
185
|
+
overflow: auto;
|
|
186
|
+
padding: 20px;
|
|
187
|
+
margin: 0 auto;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
width: 950px;
|
|
191
|
+
resize: both;
|
|
192
|
+
box-shadow: var(--dl-menu-shadow);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.selected {
|
|
196
|
+
::v-deep .row {
|
|
197
|
+
color: var(--dl-color-secondary) !important;
|
|
198
|
+
background-color: var(--dl-color-fill);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
</style>
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');
|
|
2
|
+
|
|
3
|
+
body {
|
|
4
|
+
font-family: 'Roboto', sans-serif;
|
|
5
|
+
font-weight: 400;
|
|
6
|
+
|
|
7
|
+
&>* {
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
font-family: 'Roboto', sans-serif;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
background-color: var(--dl-color-bg);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// tranform
|
|
16
|
+
.rotate-180 {
|
|
17
|
+
transform: rotate(180deg);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.text {
|
|
21
|
+
&-center {
|
|
22
|
+
text-align: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-left {
|
|
26
|
+
text-align: left;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-right {
|
|
30
|
+
text-align: right;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.scroll {
|
|
35
|
+
overflow: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.scroll,
|
|
39
|
+
.scroll-x,
|
|
40
|
+
.scroll-y {
|
|
41
|
+
-webkit-overflow-scrolling: touch;
|
|
42
|
+
will-change: scroll-position;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.row.inline,
|
|
46
|
+
.column.inline,
|
|
47
|
+
.flex.inline {
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.no-wrap {
|
|
52
|
+
flex-wrap: nowrap !important;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.justify-center {
|
|
56
|
+
justify-content: center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.justify-between {
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.justify-end {
|
|
64
|
+
justify-content: flex-end;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.column {
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.row,
|
|
72
|
+
.column,
|
|
73
|
+
.flex {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-wrap: wrap;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.relative-position {
|
|
79
|
+
position: relative;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.cursor-pointer {
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.non-selectable {
|
|
87
|
+
user-select: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.no-outline {
|
|
91
|
+
outline: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.text-center {
|
|
95
|
+
text-align: center;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.items-center {
|
|
99
|
+
align-items: center;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.col {
|
|
103
|
+
flex: 10000 1 0%;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.full-width {
|
|
107
|
+
width: 100%;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:root {
|
|
111
|
+
// common
|
|
112
|
+
--dl-color-white: #fff;
|
|
113
|
+
--dl-color-black: #000;
|
|
114
|
+
--dl-color-bg: #fff;
|
|
115
|
+
--dl-color-transparent: transparent;
|
|
116
|
+
|
|
117
|
+
// fontSizes
|
|
118
|
+
--dl-font-size-h1: 30px;
|
|
119
|
+
--dl-font-size-h2: 20px;
|
|
120
|
+
--dl-font-size-h3: 16px;
|
|
121
|
+
--dl-font-size-h4: 14px;
|
|
122
|
+
--dl-font-size-body: 12px;
|
|
123
|
+
--dl-font-size-small: 10px;
|
|
124
|
+
|
|
125
|
+
// shadows
|
|
126
|
+
--dl-menu-shadow: 0px 3px 6px rgba(16, 30, 115, 0.15);
|
|
127
|
+
|
|
128
|
+
// colors
|
|
129
|
+
--dl-color-tooltip-text: #FEFEFE;
|
|
130
|
+
--dl-color-tooltip-background: #171723d9;
|
|
131
|
+
--dl-color-text-darker-buttons: #171723;
|
|
132
|
+
--dl-color-secondary: #3452FF;
|
|
133
|
+
--dl-color-text-buttons: #FFFFFF;
|
|
134
|
+
--dl-color-darker: #171723;
|
|
135
|
+
--dl-color-medium: #767676;
|
|
136
|
+
--dl-color-lighter: #999999;
|
|
137
|
+
--dl-color-hover: #7B8CFF;
|
|
138
|
+
--dl-color-disabled: #B3B3B3;
|
|
139
|
+
--dl-color-fill: #F5F5F5;
|
|
140
|
+
--dl-color-fill-hover: #F8F8F8;
|
|
141
|
+
--dl-color-separator: #E4E4E4;
|
|
142
|
+
--dl-color-scrollbar: #E4E4E4;
|
|
143
|
+
--dl-color-body-background: #EEF1FF;
|
|
144
|
+
--dl-color-panel-background: #FFFFFF;
|
|
145
|
+
--dl-color-side-panel: #18195C;
|
|
146
|
+
--dl-color-shadow: #FFFFFF;
|
|
147
|
+
--dl-color-negative: #FF3434;
|
|
148
|
+
--dl-color-negative-background: #FFEAEA;
|
|
149
|
+
--dl-color-warning: #FFDA3A;
|
|
150
|
+
--dl-color-warning-background: #EEF1FF;
|
|
151
|
+
--dl-color-positive: #039E49;
|
|
152
|
+
--dl-color-positive-background: #E1FFF0;
|
|
153
|
+
--dl-color-info-background: #F3F9FF;
|
|
154
|
+
--dl-color-icon-default: #171723;
|
|
155
|
+
--dl-color-fill-secondary: #FBF8F8;
|
|
156
|
+
--dl-color-fill-third: #FBFBFB;
|
|
157
|
+
--dl-color-link: #20ABFA;
|
|
158
|
+
--dl-color-info: #4E81B3;
|
|
159
|
+
--dl-color-cell-background: #FFFAE2;
|
|
160
|
+
--q-color-positive: #38D079;
|
|
161
|
+
--q-color-warning: #E1B75B;
|
|
162
|
+
|
|
163
|
+
--dl-date-picker-shadow: 0px 3px 6px #101e7326;
|
|
164
|
+
|
|
165
|
+
// z-index
|
|
166
|
+
--dl-z-index-panel: 3000; // panel & panel contaiener content
|
|
167
|
+
--dl-z-index-panel-elements: 3010; // separator + glutter
|
|
168
|
+
--dl-z-index-panel-header-footer: 3020;
|
|
169
|
+
--dl-z-index-panel-container-overlay: 3025;
|
|
170
|
+
--dl-z-index-panel-container-elements: 3030; // collapse icon + separator
|
|
171
|
+
|
|
172
|
+
--dl-z-index-overlay: 5000;
|
|
173
|
+
|
|
174
|
+
--dl-z-index-menu: 6000;
|
|
175
|
+
--dl-z-index-tooltip: 9000;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Define styles for the root window with dark - mode preference */
|
|
179
|
+
[data-theme='dark-mode'] {
|
|
180
|
+
|
|
181
|
+
// shadows
|
|
182
|
+
--dl-menu-shadow: 0px 3px 6px rgba(41, 46, 53, 0.5);
|
|
183
|
+
|
|
184
|
+
// colors
|
|
185
|
+
--dl-color-bg: #30363D;
|
|
186
|
+
--dl-color-tooltip-text: #161616;
|
|
187
|
+
--dl-color-tooltip-background: #ffffffd9;
|
|
188
|
+
--dl-color-text-darker-buttons: #171723;
|
|
189
|
+
--dl-color-secondary: #7C8CFF;
|
|
190
|
+
--dl-color-text-buttons: #FFFFFF;
|
|
191
|
+
--dl-color-darker: #ffffffcc;
|
|
192
|
+
--dl-color-medium: #ffffff99;
|
|
193
|
+
--dl-color-lighter: #ffffff66;
|
|
194
|
+
--dl-color-hover: #AEB9FF;
|
|
195
|
+
--dl-color-disabled: #ffffff40;
|
|
196
|
+
--dl-color-fill: #ffffff40;
|
|
197
|
+
--dl-color-fill-secondary: #F8F8F8;
|
|
198
|
+
|
|
199
|
+
--dl-color-fill-hover: #ffffff26;
|
|
200
|
+
--dl-color-separator: #ffffff26;
|
|
201
|
+
--dl-color-body-background: #24282D;
|
|
202
|
+
--dl-color-panel-background: #30363D;
|
|
203
|
+
--dl-color-side-panel: #2A343E;
|
|
204
|
+
--dl-color-shadow: #30363D;
|
|
205
|
+
--dl-color-negative: #FF3434;
|
|
206
|
+
--dl-color-negative-background: #734145;
|
|
207
|
+
--dl-color-warning: #FFDA3A;
|
|
208
|
+
--dl-color-warning-background: #7B7241;
|
|
209
|
+
--dl-color-positive: #00DE93;
|
|
210
|
+
--dl-color-positive-background: #3A644E;
|
|
211
|
+
--dl-color-info-background: #2F3C4B;
|
|
212
|
+
--dl-color-icon-default: #ffffffbf;
|
|
213
|
+
--dl-color-fill-secondary: #FFFFFF %10;
|
|
214
|
+
--dl-color-fill-third: #9E9E9E %10;
|
|
215
|
+
--dl-color-link: #53B2E8;
|
|
216
|
+
--dl-color-info: #92CDF2;
|
|
217
|
+
--dl-color-cell-background: #FFFAE2;
|
|
218
|
+
--q-color-positive: #A1E5B6;
|
|
219
|
+
--q-color-warning: #F8D29A;
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
--dl-date-picker-shadow: 0px 3px 6px #292e3580;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// scrollbar
|
|
226
|
+
|
|
227
|
+
html {
|
|
228
|
+
// Mozilla Firefox
|
|
229
|
+
scrollbar-width: thin;
|
|
230
|
+
scrollbar-color: var(--dl-color-scrollbar);
|
|
231
|
+
|
|
232
|
+
// IE
|
|
233
|
+
scrollbar-face-color: #E4E4E4;
|
|
234
|
+
scrollbar-face-color: var(--dl-color-scrollbar);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Google Chrome & Safari
|
|
238
|
+
::-webkit-scrollbar {
|
|
239
|
+
width: 3px;
|
|
240
|
+
height: 3px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
::-webkit-scrollbar-thumb {
|
|
244
|
+
background-color: var(--dl-color-scrollbar);
|
|
245
|
+
border-radius: 3px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.no-user-select {
|
|
249
|
+
user-select: none;
|
|
250
|
+
-moz-user-select: none;
|
|
251
|
+
-webkit-user-select: none;
|
|
252
|
+
-ms-user-select: none;
|
|
253
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const colors = [
|
|
2
|
+
'dl-color-white',
|
|
3
|
+
'dl-color-black',
|
|
4
|
+
'dl-color-tooltip-text',
|
|
5
|
+
'dl-color-tooltip-background',
|
|
6
|
+
'dl-color-text-darker-buttons',
|
|
7
|
+
'dl-color-secondary',
|
|
8
|
+
'dl-color-text-buttons',
|
|
9
|
+
'dl-color-darker',
|
|
10
|
+
'dl-color-medium',
|
|
11
|
+
'dl-color-lighter',
|
|
12
|
+
'dl-color-hover',
|
|
13
|
+
'dl-color-disabled',
|
|
14
|
+
'dl-color-fill',
|
|
15
|
+
'dl-color-fill-hover',
|
|
16
|
+
'dl-color-separator',
|
|
17
|
+
'dl-color-body-background',
|
|
18
|
+
'dl-color-panel-background',
|
|
19
|
+
'dl-color-side-panel',
|
|
20
|
+
'dl-color-shadow',
|
|
21
|
+
'dl-color-negative',
|
|
22
|
+
'dl-color-negative-background',
|
|
23
|
+
'dl-color-warning',
|
|
24
|
+
'dl-color-warning-background',
|
|
25
|
+
'dl-color-positive',
|
|
26
|
+
'dl-color-positive-background',
|
|
27
|
+
'dl-color-info-background'
|
|
28
|
+
]
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="accordion-header"
|
|
4
|
+
tabindex="0"
|
|
5
|
+
:style="accordionHeadStyles"
|
|
6
|
+
@click="handleClick"
|
|
7
|
+
>
|
|
8
|
+
<dl-icon
|
|
9
|
+
class="expand-icon"
|
|
10
|
+
:size="$props.fontSize"
|
|
11
|
+
:class="{ expanded: isOpen }"
|
|
12
|
+
icon="icon-dl-right-chevron"
|
|
13
|
+
:color="titleColor"
|
|
14
|
+
/>
|
|
15
|
+
<div class="header-content">
|
|
16
|
+
<slot
|
|
17
|
+
v-if="hasSlot"
|
|
18
|
+
name="header"
|
|
19
|
+
/>
|
|
20
|
+
<span
|
|
21
|
+
v-else
|
|
22
|
+
ref="dlAccordionTitleRef"
|
|
23
|
+
class="accordion-title"
|
|
24
|
+
>
|
|
25
|
+
<dl-tooltip v-if="isOverflowing">
|
|
26
|
+
{{ title }}
|
|
27
|
+
</dl-tooltip>
|
|
28
|
+
{{ title }}
|
|
29
|
+
</span>
|
|
30
|
+
<span class="flex">
|
|
31
|
+
<dl-icon
|
|
32
|
+
v-if="hasAdditionalInfo"
|
|
33
|
+
:size="$props.fontSize"
|
|
34
|
+
icon="icon-dl-info"
|
|
35
|
+
class="info-icon"
|
|
36
|
+
/>
|
|
37
|
+
<dl-tooltip>
|
|
38
|
+
{{ additionalInfo }}
|
|
39
|
+
</dl-tooltip>
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts">
|
|
46
|
+
import DlIcon from '../DlIcon.vue'
|
|
47
|
+
import DlTooltip from '../DlTooltip.vue'
|
|
48
|
+
import { defineComponent, ref } from 'vue-demi'
|
|
49
|
+
import { getColor } from '../../utils'
|
|
50
|
+
import { useSizeObserver } from '../../hooks/use-size-observer'
|
|
51
|
+
export default defineComponent({
|
|
52
|
+
name: 'AccordionHeader',
|
|
53
|
+
components: {
|
|
54
|
+
DlIcon,
|
|
55
|
+
DlTooltip
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
additionalInfo: { type: String!, default: '' },
|
|
59
|
+
defaultOpened: { type: Boolean, default: false },
|
|
60
|
+
fontSize: { type: String, default: '12px' },
|
|
61
|
+
title: { type: String, default: null },
|
|
62
|
+
titleColor: { type: String, default: 'dl-color-medium' },
|
|
63
|
+
isOpen: { type: Boolean, default: false },
|
|
64
|
+
rightSide: { type: Boolean, default: false }
|
|
65
|
+
},
|
|
66
|
+
emits: ['click'],
|
|
67
|
+
setup() {
|
|
68
|
+
const dlAccordionTitleRef = ref(null)
|
|
69
|
+
const { hasEllipsis } = useSizeObserver(dlAccordionTitleRef)
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
dlAccordionTitleRef,
|
|
73
|
+
isOverflowing: hasEllipsis
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
computed: {
|
|
77
|
+
accordionHeadStyles(): Record<string, string> {
|
|
78
|
+
return {
|
|
79
|
+
'--dl-title-color': getColor(
|
|
80
|
+
this.titleColor,
|
|
81
|
+
'dl-color-medium'
|
|
82
|
+
),
|
|
83
|
+
'--dl-expand-icon-color': `var(--${
|
|
84
|
+
this.isOpen ? 'dl-color-darker' : this.titleColor
|
|
85
|
+
})`,
|
|
86
|
+
'--dl-accordion-header-flex-direction': this.rightSide
|
|
87
|
+
? 'row-reverse'
|
|
88
|
+
: 'row',
|
|
89
|
+
'--dl-accordion-header-fontsize': this.fontSize
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
hasSlot(): boolean {
|
|
93
|
+
return this.$slots.header !== undefined
|
|
94
|
+
},
|
|
95
|
+
hasAdditionalInfo(): boolean {
|
|
96
|
+
return this.additionalInfo !== ''
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
handleClick(e: Event) {
|
|
101
|
+
this.$emit('click', e)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<style scoped lang="scss">
|
|
108
|
+
.accordion-header {
|
|
109
|
+
padding: 13px 16px;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
font-size: var(--dl-accordion-header-fontsize);
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
gap: 10px;
|
|
115
|
+
flex-direction: var(--dl-accordion-header-flex-direction);
|
|
116
|
+
color: var(--dl-title-color);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.accordion-title {
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
text-overflow: ellipsis;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.header-content {
|
|
126
|
+
max-width: calc(100% - 0px);
|
|
127
|
+
flex-grow: 1;
|
|
128
|
+
color: var(--dl-title-color);
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
gap: 5px;
|
|
132
|
+
text-align: left;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.info-icon {
|
|
136
|
+
color: var(--dl-title-color);
|
|
137
|
+
display: flex !important;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.expand-icon {
|
|
141
|
+
display: flex !important;
|
|
142
|
+
color: var(--dl-expand-icon-color);
|
|
143
|
+
transition: all 300ms;
|
|
144
|
+
&.expanded {
|
|
145
|
+
transform: rotate(90deg);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
</style>
|