@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,91 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
v-show="!!value.length"
|
|
4
|
+
:id="uuid"
|
|
5
|
+
:class="classes"
|
|
6
|
+
>
|
|
7
|
+
{{ value }}
|
|
8
|
+
</span>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { v4 } from 'uuid'
|
|
13
|
+
import { defineComponent } from 'vue-demi'
|
|
14
|
+
|
|
15
|
+
export default defineComponent({
|
|
16
|
+
name: 'DlInfoErrorMessage',
|
|
17
|
+
props: {
|
|
18
|
+
error: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
warning: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
value: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ''
|
|
29
|
+
},
|
|
30
|
+
position: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'below',
|
|
33
|
+
validator(value: string): boolean {
|
|
34
|
+
return ['above', 'below'].includes(value)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
uuid: `dl-info-error-message-${v4()}`
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
classes(): string[] {
|
|
45
|
+
const classes = []
|
|
46
|
+
|
|
47
|
+
if (this.error) {
|
|
48
|
+
classes.push('text-error')
|
|
49
|
+
} else if (this.warning) {
|
|
50
|
+
classes.push('text-warning')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
classes.push(this.position === 'below' ? 'text' : 'text-above')
|
|
54
|
+
|
|
55
|
+
return classes
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style scoped lang="scss">
|
|
62
|
+
.text {
|
|
63
|
+
font-size: var(--dl-font-size-small);
|
|
64
|
+
color: var(--dl-color-lighter);
|
|
65
|
+
text-overflow: ellipsis;
|
|
66
|
+
line-height: 11px;
|
|
67
|
+
max-height: 22px;
|
|
68
|
+
white-space: pre-wrap;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
display: inline-block;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.text-error {
|
|
74
|
+
color: var(--dl-color-negative) !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.text-warning {
|
|
78
|
+
color: var(--dl-color-warning) !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.text-above {
|
|
82
|
+
font-size: var(--dl-font-size-body);
|
|
83
|
+
color: var(--dl-color-darker);
|
|
84
|
+
text-overflow: ellipsis;
|
|
85
|
+
line-height: 13px;
|
|
86
|
+
max-height: 26px;
|
|
87
|
+
white-space: pre-wrap;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
display: inline-block;
|
|
90
|
+
}
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<dl-list-item
|
|
3
|
+
:id="uuid"
|
|
4
|
+
:clickable="clickable"
|
|
5
|
+
>
|
|
6
|
+
<dl-item-section>
|
|
7
|
+
<slot />
|
|
8
|
+
</dl-item-section>
|
|
9
|
+
</dl-list-item>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { defineComponent } from 'vue-demi'
|
|
14
|
+
import { DlListItem } from '../DlListItem'
|
|
15
|
+
import DlItemSection from '../DlItemSection.vue'
|
|
16
|
+
import { v4 } from 'uuid'
|
|
17
|
+
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
name: 'DlItem',
|
|
20
|
+
components: {
|
|
21
|
+
DlListItem,
|
|
22
|
+
DlItemSection
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
clickable: { type: Boolean, default: true }
|
|
26
|
+
},
|
|
27
|
+
data() {
|
|
28
|
+
return {
|
|
29
|
+
uuid: `dl-item-${v4()}`
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="uuid"
|
|
4
|
+
:style="cssVars"
|
|
5
|
+
:class="classes"
|
|
6
|
+
>
|
|
7
|
+
<slot />
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { v4 } from 'uuid'
|
|
13
|
+
import { defineComponent } from 'vue-demi'
|
|
14
|
+
import { getColor } from '../utils'
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'DlItemSection',
|
|
18
|
+
props: {
|
|
19
|
+
color: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: null
|
|
22
|
+
},
|
|
23
|
+
side: Boolean,
|
|
24
|
+
noWrap: Boolean
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
uuid: `dl-item-section-${v4()}`
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
computed: {
|
|
32
|
+
classes(): Record<string, boolean> {
|
|
33
|
+
return {
|
|
34
|
+
'dl-item__section': true,
|
|
35
|
+
'dl-item__section--side': this.side,
|
|
36
|
+
'dl-item__section--nowrap': this.noWrap,
|
|
37
|
+
'dl-item__section--main': !this.side
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
cssVars(): Record<string, string> {
|
|
41
|
+
return {
|
|
42
|
+
'--dl-item-color': this.color ? getColor(this.color) : 'inherit'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<style scoped lang="scss">
|
|
50
|
+
.dl-item__section {
|
|
51
|
+
padding-left: 0;
|
|
52
|
+
padding-right: 0;
|
|
53
|
+
font-size: var(--dl-font-size-body);
|
|
54
|
+
color: var(--dl-item-color);
|
|
55
|
+
min-width: 0;
|
|
56
|
+
justify-content: flex-start;
|
|
57
|
+
&--nowrap {
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
text-overflow: ellipsis;
|
|
61
|
+
& > * {
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
text-overflow: ellipsis;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
&--side {
|
|
67
|
+
align-items: flex-start;
|
|
68
|
+
padding-right: 10px;
|
|
69
|
+
width: auto;
|
|
70
|
+
min-width: 0;
|
|
71
|
+
max-width: 100%;
|
|
72
|
+
}
|
|
73
|
+
&--main {
|
|
74
|
+
width: auto;
|
|
75
|
+
min-width: 0;
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
flex: 10000 1 0%;
|
|
78
|
+
& + & {
|
|
79
|
+
margin-left: 8px;
|
|
80
|
+
}
|
|
81
|
+
~ .dl-item__section--side {
|
|
82
|
+
align-items: flex-end;
|
|
83
|
+
padding-right: 0;
|
|
84
|
+
padding-left: 10px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
</style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="uuid"
|
|
4
|
+
class="link-wrapper"
|
|
5
|
+
>
|
|
6
|
+
<a
|
|
7
|
+
:href="link"
|
|
8
|
+
:target="target"
|
|
9
|
+
:rel="rel"
|
|
10
|
+
:style="`color: var(--${textColor});`"
|
|
11
|
+
:class="`${disabled ? 'disabled' : ''}`"
|
|
12
|
+
@click="$emit('click')"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</a>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import { v4 } from 'uuid'
|
|
21
|
+
import { defineComponent } from 'vue-demi'
|
|
22
|
+
import { getLinkTarget, getLinkRel } from './utils'
|
|
23
|
+
|
|
24
|
+
export default defineComponent({
|
|
25
|
+
name: 'DlLink',
|
|
26
|
+
props: {
|
|
27
|
+
href: { required: true, type: String },
|
|
28
|
+
newtab: { required: false, default: false, type: Boolean },
|
|
29
|
+
external: { required: false, default: false, type: Boolean },
|
|
30
|
+
disabled: { required: false, default: false, type: Boolean },
|
|
31
|
+
color: { required: false, type: String, default: null }
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
uuid: `dl-link-${v4()}`
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
link(): string {
|
|
40
|
+
return this.external
|
|
41
|
+
? `${this.href}`
|
|
42
|
+
: `${window.origin}/${this.href}`
|
|
43
|
+
},
|
|
44
|
+
textColor(): string {
|
|
45
|
+
return this.color ?? 'dl-color-studio-secondary'
|
|
46
|
+
},
|
|
47
|
+
target(): string | null {
|
|
48
|
+
return getLinkTarget(this.external || this.newtab)
|
|
49
|
+
},
|
|
50
|
+
rel(): string | null {
|
|
51
|
+
return getLinkRel(this.external)
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
template: 'dl-link'
|
|
55
|
+
})
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style scoped lang="css">
|
|
59
|
+
a {
|
|
60
|
+
text-decoration: none;
|
|
61
|
+
font-size: var(--dl-font-size-body);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
a:hover {
|
|
65
|
+
text-decoration: underline;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.disabled {
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
color: var(--dl-color-disabled) !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.link-wrapper {
|
|
74
|
+
display: inline-block;
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="uuid"
|
|
4
|
+
:class="classes"
|
|
5
|
+
>
|
|
6
|
+
<slot :clickable="clickable" />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { v4 } from 'uuid'
|
|
12
|
+
import { defineComponent } from 'vue-demi'
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
name: 'DlList',
|
|
15
|
+
props: {
|
|
16
|
+
bordered: Boolean,
|
|
17
|
+
separator: Boolean,
|
|
18
|
+
padding: Boolean,
|
|
19
|
+
clickable: Boolean
|
|
20
|
+
},
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
uuid: `dl-list-${v4()}`
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
computed: {
|
|
27
|
+
classes(): string | Record<string, string> {
|
|
28
|
+
return (
|
|
29
|
+
'dl-list' +
|
|
30
|
+
(this.bordered ? ' dl-list--bordered' : '') +
|
|
31
|
+
(this.separator ? ' dl-list--separator' : '') +
|
|
32
|
+
(this.padding ? ' dl-list--padding' : '')
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style scoped lang="scss">
|
|
40
|
+
.dl-list {
|
|
41
|
+
padding: 5px 0;
|
|
42
|
+
background-color: var(--dl-color-panel-background);
|
|
43
|
+
&--bordered {
|
|
44
|
+
border: 1px solid var(--dl-color-separator);
|
|
45
|
+
}
|
|
46
|
+
&--separator {
|
|
47
|
+
border-top: 1px solid var(--dl-color-separator);
|
|
48
|
+
& > .dl-list-item {
|
|
49
|
+
padding: 5px 10px;
|
|
50
|
+
}
|
|
51
|
+
& > .list-item-wrapper:not(:first-child) {
|
|
52
|
+
& .separator {
|
|
53
|
+
display: block;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
&--padding {
|
|
58
|
+
padding: 8px 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="as"
|
|
4
|
+
:id="uuid"
|
|
5
|
+
class="list-item-wrapper"
|
|
6
|
+
>
|
|
7
|
+
<hr
|
|
8
|
+
class="separator"
|
|
9
|
+
:class="{ 'separator--visible': bordered }"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
v-wave="!disabled && withWave"
|
|
13
|
+
:class="[
|
|
14
|
+
{
|
|
15
|
+
'dl-list-item': true,
|
|
16
|
+
'dl-list-item-disabled': disabled,
|
|
17
|
+
'dl-list-spaced': bordered
|
|
18
|
+
},
|
|
19
|
+
'row'
|
|
20
|
+
]"
|
|
21
|
+
:style="cssItemVars"
|
|
22
|
+
@click="onClick"
|
|
23
|
+
>
|
|
24
|
+
<dl-item-section
|
|
25
|
+
v-if="startIcon"
|
|
26
|
+
side
|
|
27
|
+
>
|
|
28
|
+
<dl-icon
|
|
29
|
+
:icon="startIcon"
|
|
30
|
+
:color="startIconColor"
|
|
31
|
+
:size="startIconSize"
|
|
32
|
+
/>
|
|
33
|
+
</dl-item-section>
|
|
34
|
+
<slot />
|
|
35
|
+
<dl-item-section
|
|
36
|
+
v-if="endIcon"
|
|
37
|
+
side
|
|
38
|
+
>
|
|
39
|
+
<dl-icon
|
|
40
|
+
:icon="endIcon"
|
|
41
|
+
:color="endIconColor"
|
|
42
|
+
:size="endIconSize"
|
|
43
|
+
/>
|
|
44
|
+
</dl-item-section>
|
|
45
|
+
</div>
|
|
46
|
+
</component>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script lang="ts">
|
|
50
|
+
import { defineComponent } from 'vue-demi'
|
|
51
|
+
import DlItemSection from '../DlItemSection.vue'
|
|
52
|
+
import DlIcon from '../DlIcon.vue'
|
|
53
|
+
import {
|
|
54
|
+
itemHoverColor,
|
|
55
|
+
itemActiveColor,
|
|
56
|
+
itemCursor,
|
|
57
|
+
itemBorder,
|
|
58
|
+
itemColor
|
|
59
|
+
} from './utils'
|
|
60
|
+
import { wave, waveTrigger } from '../../utils'
|
|
61
|
+
import { v4 } from 'uuid'
|
|
62
|
+
|
|
63
|
+
export default defineComponent({
|
|
64
|
+
name: 'DlListItem',
|
|
65
|
+
components: {
|
|
66
|
+
DlItemSection,
|
|
67
|
+
DlIcon
|
|
68
|
+
},
|
|
69
|
+
directives: {
|
|
70
|
+
wave,
|
|
71
|
+
waveTrigger
|
|
72
|
+
},
|
|
73
|
+
props: {
|
|
74
|
+
disabled: Boolean,
|
|
75
|
+
clickable: Boolean,
|
|
76
|
+
bordered: Boolean,
|
|
77
|
+
withWave: Boolean,
|
|
78
|
+
startIcon: { type: String, required: false, default: '' },
|
|
79
|
+
endIcon: { type: String, required: false, default: '' },
|
|
80
|
+
as: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: 'div'
|
|
83
|
+
},
|
|
84
|
+
startIconColor: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: false,
|
|
87
|
+
default: 'dl-color-darker'
|
|
88
|
+
},
|
|
89
|
+
endIconColor: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: false,
|
|
92
|
+
default: 'dl-color-darker'
|
|
93
|
+
},
|
|
94
|
+
startIconSize: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: '12px'
|
|
97
|
+
},
|
|
98
|
+
endIconSize: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: '12px'
|
|
101
|
+
},
|
|
102
|
+
height: { type: String, default: null, required: false },
|
|
103
|
+
padding: { type: String, default: null, required: false }
|
|
104
|
+
},
|
|
105
|
+
emits: ['click'],
|
|
106
|
+
data() {
|
|
107
|
+
return {
|
|
108
|
+
uuid: `dl-list-item-${v4()}`
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
computed: {
|
|
112
|
+
isClickable(): boolean {
|
|
113
|
+
return this.clickable && !this.disabled
|
|
114
|
+
},
|
|
115
|
+
cssItemVars(): Record<string, string> {
|
|
116
|
+
return {
|
|
117
|
+
'--dl-list-item-hover': itemHoverColor(this.isClickable),
|
|
118
|
+
'--dl-list-item-active': itemActiveColor(this.isClickable),
|
|
119
|
+
'--dl-list-item-cursor': itemCursor(
|
|
120
|
+
this.isClickable,
|
|
121
|
+
this.disabled
|
|
122
|
+
),
|
|
123
|
+
'--dl-list-item-border': itemBorder(this.bordered),
|
|
124
|
+
'--dl-list-item-color': itemColor(this.disabled),
|
|
125
|
+
'--dl-list-item-height': this.height ?? '28px',
|
|
126
|
+
'--dl-list-item-padding': this.padding ?? '0px 10px'
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
methods: {
|
|
131
|
+
onClick(e: MouseEvent) {
|
|
132
|
+
if (this.isClickable) {
|
|
133
|
+
this.$emit('click', e)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<style scoped lang="scss">
|
|
141
|
+
.list-item-wrapper {
|
|
142
|
+
width: 100%;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.dl-list-item {
|
|
146
|
+
-webkit-tap-highlight-color: transparent;
|
|
147
|
+
background-color: transparent;
|
|
148
|
+
outline: 0px;
|
|
149
|
+
border: 0px;
|
|
150
|
+
margin: 0px;
|
|
151
|
+
width: 100%;
|
|
152
|
+
border-radius: 0px;
|
|
153
|
+
cursor: var(--dl-list-item-cursor);
|
|
154
|
+
user-select: none;
|
|
155
|
+
vertical-align: middle;
|
|
156
|
+
appearance: none;
|
|
157
|
+
color: var(--dl-list-item-color);
|
|
158
|
+
display: flex;
|
|
159
|
+
-webkit-box-flex: 1;
|
|
160
|
+
flex-grow: 1;
|
|
161
|
+
-webkit-box-pack: start;
|
|
162
|
+
flex-wrap: nowrap;
|
|
163
|
+
justify-content: flex-start;
|
|
164
|
+
-webkit-box-align: center;
|
|
165
|
+
align-items: center;
|
|
166
|
+
position: relative;
|
|
167
|
+
text-decoration: none;
|
|
168
|
+
min-width: 0px;
|
|
169
|
+
box-sizing: border-box;
|
|
170
|
+
text-align: left;
|
|
171
|
+
min-height: var(--dl-list-item-height);
|
|
172
|
+
height: 100%;
|
|
173
|
+
padding: var(--dl-list-item-padding);
|
|
174
|
+
font-size: var(--dl-font-size-body);
|
|
175
|
+
line-height: 14px;
|
|
176
|
+
transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
177
|
+
&:hover {
|
|
178
|
+
background-color: var(--dl-list-item-hover);
|
|
179
|
+
}
|
|
180
|
+
&:active {
|
|
181
|
+
background-color: var(--dl-list-item-active);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.separator {
|
|
186
|
+
border: none;
|
|
187
|
+
border-top: 1px solid var(--dl-color-separator);
|
|
188
|
+
display: none;
|
|
189
|
+
&--visible {
|
|
190
|
+
display: block;
|
|
191
|
+
margin: 5px 0;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.dl-list-spaced {
|
|
196
|
+
margin: 5px 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.dl-list-item-disabled {
|
|
200
|
+
color: var(--dl-color-disabled) !important;
|
|
201
|
+
& > div > i::before {
|
|
202
|
+
color: var(--dl-color-disabled) !important;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const itemHoverColor = (isActionable: boolean) =>
|
|
2
|
+
isActionable ? 'var(--dl-color-fill-hover)' : 'transparent'
|
|
3
|
+
|
|
4
|
+
export const itemActiveColor = (isActionable: boolean) =>
|
|
5
|
+
isActionable ? 'var(--dl-color-fill)' : 'transparent'
|
|
6
|
+
|
|
7
|
+
export const itemCursor = (actionable: boolean, disabled: boolean) =>
|
|
8
|
+
actionable ? 'pointer' : disabled ? 'not-allowed' : 'cursor'
|
|
9
|
+
|
|
10
|
+
export const itemBorder = (bordered: boolean) =>
|
|
11
|
+
bordered ? `1px solid var(--dl-color-separator)` : '0px'
|
|
12
|
+
|
|
13
|
+
export const itemColor = (disabled: boolean) =>
|
|
14
|
+
disabled ? 'var(--dl-color-disabled)' : 'var(--dl-color-darker)'
|