@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,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="uuid"
|
|
4
|
+
class="dl-widget"
|
|
5
|
+
>
|
|
6
|
+
<div class="dl-widget__header">
|
|
7
|
+
<slot name="header" />
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div class="dl-widget__content">
|
|
11
|
+
<slot name="content" />
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="dl-widget__description">
|
|
15
|
+
<slot name="description" />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import { v4 } from 'uuid'
|
|
21
|
+
import { defineComponent } from 'vue-demi'
|
|
22
|
+
export default defineComponent({
|
|
23
|
+
name: 'DlWidget',
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
uuid: `dl-widget-${v4()}`
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="scss" scoped>
|
|
33
|
+
.dl-widget {
|
|
34
|
+
height: 100%;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
&__header {
|
|
38
|
+
padding: 10px;
|
|
39
|
+
border-bottom: 1px solid var(--dl-color-separator);
|
|
40
|
+
}
|
|
41
|
+
&__content {
|
|
42
|
+
padding: 5px;
|
|
43
|
+
}
|
|
44
|
+
&__description {
|
|
45
|
+
margin-top: auto;
|
|
46
|
+
padding: 5px;
|
|
47
|
+
font-size: 10px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:id="uuid"
|
|
4
|
+
class="dl-widget-grid"
|
|
5
|
+
:style="gridStyle"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
v-for="(row, rowIndex) in modelValue"
|
|
9
|
+
:key="row"
|
|
10
|
+
class="dl-widget-grid__row"
|
|
11
|
+
:style="rowStyle"
|
|
12
|
+
@mouseenter="currentRow = rowIndex"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
v-for="(widget, widgetIndex) in row"
|
|
16
|
+
:id="`${rowIndex}-${widgetIndex}`"
|
|
17
|
+
:key="widget"
|
|
18
|
+
:class="gridItemClasses"
|
|
19
|
+
:style="`flex-basis: ${100 / row.length}%`"
|
|
20
|
+
@mouseenter="
|
|
21
|
+
(e) => {
|
|
22
|
+
handleMouseEnter(e)
|
|
23
|
+
currentItem = widgetIndex
|
|
24
|
+
}
|
|
25
|
+
"
|
|
26
|
+
>
|
|
27
|
+
<dl-widget>
|
|
28
|
+
<template #header>
|
|
29
|
+
<div class="dl-widget-grid__item--header">
|
|
30
|
+
<div class="dl-widget-grid__item--titles">
|
|
31
|
+
<dl-typography size="h2">
|
|
32
|
+
{{ widget.title }}
|
|
33
|
+
</dl-typography>
|
|
34
|
+
<dl-typography size="h4">
|
|
35
|
+
{{ widget.subTitle }}
|
|
36
|
+
</dl-typography>
|
|
37
|
+
</div>
|
|
38
|
+
<dl-icon
|
|
39
|
+
class="dl-widget-grid__item--drag-icon"
|
|
40
|
+
icon="icon-dl-drag"
|
|
41
|
+
color="dl-color-medium"
|
|
42
|
+
size="15px"
|
|
43
|
+
@mousedown="
|
|
44
|
+
startDragging(
|
|
45
|
+
`${rowIndex}-${widgetIndex}`,
|
|
46
|
+
widget
|
|
47
|
+
)
|
|
48
|
+
"
|
|
49
|
+
/>
|
|
50
|
+
<div class="dl-widget-grid__item--menu">
|
|
51
|
+
<slot name="menu" />
|
|
52
|
+
<dl-icon
|
|
53
|
+
v-if="isEditable"
|
|
54
|
+
class="dl-widget-grid__item--delete-icon"
|
|
55
|
+
icon="icon-dl-delete"
|
|
56
|
+
color="dl-color-negative"
|
|
57
|
+
size="20px"
|
|
58
|
+
@mousedown="
|
|
59
|
+
removeWidget(
|
|
60
|
+
`${rowIndex}-${widgetIndex}`
|
|
61
|
+
)
|
|
62
|
+
"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
<template #content>
|
|
68
|
+
<div class="dl-widget-grid__item--content">
|
|
69
|
+
<component
|
|
70
|
+
:is="widget.content"
|
|
71
|
+
v-if="typeof widget.content === 'object'"
|
|
72
|
+
/>
|
|
73
|
+
<div v-else>
|
|
74
|
+
{{ widget.content }}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
78
|
+
<template #description>
|
|
79
|
+
{{ widget.description }}
|
|
80
|
+
</template>
|
|
81
|
+
</dl-widget>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div
|
|
86
|
+
ref="clone"
|
|
87
|
+
:class="cloneClasses"
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
|
|
92
|
+
<script lang="ts">
|
|
93
|
+
import { defineComponent, PropType } from 'vue-demi'
|
|
94
|
+
import { Widget } from './types'
|
|
95
|
+
import cloneDeep from 'lodash/cloneDeep'
|
|
96
|
+
import { equateElements, getTargetWidget, getIndex } from './utils'
|
|
97
|
+
import DlWidget from './DlWidget.vue'
|
|
98
|
+
import DlIcon from '../DlIcon.vue'
|
|
99
|
+
import DlTypography from '../DlTypography.vue'
|
|
100
|
+
import { v4 } from 'uuid'
|
|
101
|
+
|
|
102
|
+
interface DragSide {
|
|
103
|
+
previous: boolean
|
|
104
|
+
current: boolean
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export default defineComponent({
|
|
108
|
+
components: {
|
|
109
|
+
DlWidget,
|
|
110
|
+
DlIcon,
|
|
111
|
+
DlTypography
|
|
112
|
+
},
|
|
113
|
+
props: {
|
|
114
|
+
modelValue: {
|
|
115
|
+
type: Array as PropType<Widget[][]>,
|
|
116
|
+
default: () => [] as Widget[]
|
|
117
|
+
},
|
|
118
|
+
isEditable: { type: Boolean, default: false },
|
|
119
|
+
rowGap: { type: String, default: '30px' },
|
|
120
|
+
columnGap: { type: String, default: '30px' },
|
|
121
|
+
widgetLibrary: { type: Array, default: () => [] as Widget[] }
|
|
122
|
+
},
|
|
123
|
+
emits: ['update:model-value', 'remove'],
|
|
124
|
+
data(): {
|
|
125
|
+
uuid: string
|
|
126
|
+
timer: number
|
|
127
|
+
isDragging: boolean
|
|
128
|
+
dragTarget: HTMLElement
|
|
129
|
+
currentRow: number
|
|
130
|
+
currentItem: number
|
|
131
|
+
draggedWidget: Widget
|
|
132
|
+
draggedWidgetId: string
|
|
133
|
+
dragSide: DragSide
|
|
134
|
+
} {
|
|
135
|
+
return {
|
|
136
|
+
uuid: `dl-widget-grid-${v4()}`,
|
|
137
|
+
timer: null,
|
|
138
|
+
isDragging: false,
|
|
139
|
+
dragTarget: null,
|
|
140
|
+
currentRow: -1,
|
|
141
|
+
currentItem: -1,
|
|
142
|
+
draggedWidget: null,
|
|
143
|
+
draggedWidgetId: null,
|
|
144
|
+
dragSide: { previous: null, current: null }
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
computed: {
|
|
148
|
+
gridStyle(): Record<string, any> {
|
|
149
|
+
return { gap: this.rowGap }
|
|
150
|
+
},
|
|
151
|
+
rowStyle(): Record<string, any> {
|
|
152
|
+
return { gap: this.columnGap }
|
|
153
|
+
},
|
|
154
|
+
cloneClasses(): string {
|
|
155
|
+
return `dl-widget-grid__clone ${
|
|
156
|
+
this.isDragging ? 'dl-widget-grid__clone--dragging' : ''
|
|
157
|
+
}`
|
|
158
|
+
},
|
|
159
|
+
gridItemClasses(): string {
|
|
160
|
+
return `dl-widget-grid__item ${
|
|
161
|
+
this.isDragging ? 'dl-widget-grid__item--dragging' : ''
|
|
162
|
+
}`
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
mounted() {
|
|
166
|
+
window.addEventListener('mouseup', (e) => this.stopDragging(e))
|
|
167
|
+
},
|
|
168
|
+
methods: {
|
|
169
|
+
startDragging(widgetIndex: string, widget: Widget) {
|
|
170
|
+
window.addEventListener('mousemove', (e) => this.moveWidget(e))
|
|
171
|
+
this.isDragging = true
|
|
172
|
+
const draggedWidget = document.getElementById(widgetIndex)
|
|
173
|
+
draggedWidget.style.visibility = 'hidden'
|
|
174
|
+
this.draggedWidgetId = draggedWidget.id
|
|
175
|
+
this.draggedWidget = widget
|
|
176
|
+
equateElements(draggedWidget, this.$refs.clone as HTMLElement)
|
|
177
|
+
},
|
|
178
|
+
stopDragging(e: MouseEvent) {
|
|
179
|
+
if (!this.isDragging) return
|
|
180
|
+
this.isDragging = false
|
|
181
|
+
const targetId = getTargetWidget(e.target as HTMLElement)?.id
|
|
182
|
+
let newWidgets: Widget[][]
|
|
183
|
+
if (targetId && this.draggedWidgetId) {
|
|
184
|
+
newWidgets = cloneDeep(this.modelValue) as Widget[][]
|
|
185
|
+
const targetIndex = getIndex(targetId)
|
|
186
|
+
const sourceIndex = getIndex(this.draggedWidgetId)
|
|
187
|
+
const temp = newWidgets[targetIndex.row][targetIndex.column]
|
|
188
|
+
newWidgets[targetIndex.row][targetIndex.column] =
|
|
189
|
+
this.modelValue[sourceIndex.row][sourceIndex.column]
|
|
190
|
+
newWidgets[sourceIndex.row][sourceIndex.column] = temp
|
|
191
|
+
|
|
192
|
+
this.$emit('update:model-value', newWidgets)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (this.$refs.clone) {
|
|
196
|
+
(this.$refs.clone as HTMLElement).innerHTML = ''
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const activeWidget = document.getElementById(this.draggedWidgetId)
|
|
200
|
+
if (activeWidget) {
|
|
201
|
+
activeWidget.style.visibility = 'visible'
|
|
202
|
+
}
|
|
203
|
+
this.draggedWidgetId = null
|
|
204
|
+
window.removeEventListener('mousemove', this.stopDragging)
|
|
205
|
+
window.removeEventListener('mousemove', this.handleMouseMove)
|
|
206
|
+
},
|
|
207
|
+
moveWidget(e: MouseEvent) {
|
|
208
|
+
const clone = this.$refs.clone as HTMLElement
|
|
209
|
+
clone.style.left = `${e.pageX - clone.offsetWidth / 2 - 5}px`
|
|
210
|
+
clone.style.top = `${e.pageY + 10}px`
|
|
211
|
+
},
|
|
212
|
+
removeWidget(widgetId: string) {
|
|
213
|
+
this.$emit(
|
|
214
|
+
'update:model-value',
|
|
215
|
+
this.modelValue.map((row: Widget[], rowIndex: number) =>
|
|
216
|
+
row.filter((widget: Widget, widgetIndex: number) => {
|
|
217
|
+
if (`${rowIndex}-${widgetIndex}` !== widgetId)
|
|
218
|
+
return widget
|
|
219
|
+
else this.$emit('remove', widget)
|
|
220
|
+
})
|
|
221
|
+
)
|
|
222
|
+
)
|
|
223
|
+
},
|
|
224
|
+
handleMouseEnter(e: Event) {
|
|
225
|
+
this.dragTarget = e.target as HTMLElement
|
|
226
|
+
this.dragSide.previous =
|
|
227
|
+
(e as MouseEvent).x - this.dragTarget.offsetLeft <
|
|
228
|
+
this.dragTarget.offsetWidth / 2
|
|
229
|
+
if (
|
|
230
|
+
!this.isDragging ||
|
|
231
|
+
!(this.modelValue[this.currentRow].length < 3)
|
|
232
|
+
)
|
|
233
|
+
return
|
|
234
|
+
|
|
235
|
+
e.target.addEventListener('mousemove', this.handleMouseMove)
|
|
236
|
+
e.target.addEventListener('mouseleave', (e: Event) => {
|
|
237
|
+
clearTimeout(this.timer)
|
|
238
|
+
e.target.removeEventListener('mousemove', this.handleMouseMove)
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
this.timer = window.setTimeout(() => {
|
|
242
|
+
this.rearrangeWidgets()
|
|
243
|
+
}, 700)
|
|
244
|
+
},
|
|
245
|
+
handleMouseMove(e: Event) {
|
|
246
|
+
this.dragSide.current =
|
|
247
|
+
(e as MouseEvent).x - this.dragTarget.offsetLeft <
|
|
248
|
+
this.dragTarget.offsetWidth / 2
|
|
249
|
+
if (this.dragSide.current !== this.dragSide.previous) {
|
|
250
|
+
clearTimeout(this.timer)
|
|
251
|
+
this.handleMouseEnter(e)
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
rearrangeWidgets() {
|
|
255
|
+
if (
|
|
256
|
+
!this.draggedWidgetId ||
|
|
257
|
+
Number(this.draggedWidgetId[0]) == this.currentRow
|
|
258
|
+
)
|
|
259
|
+
return
|
|
260
|
+
const newTargetRow = this.modelValue[this.currentRow]
|
|
261
|
+
const newSourceRow =
|
|
262
|
+
this.modelValue[Number(this.draggedWidgetId[0])]
|
|
263
|
+
newTargetRow.splice(
|
|
264
|
+
this.dragSide.previous
|
|
265
|
+
? this.currentItem
|
|
266
|
+
: this.currentItem + 1,
|
|
267
|
+
0,
|
|
268
|
+
this.draggedWidget
|
|
269
|
+
)
|
|
270
|
+
newSourceRow.splice(Number(this.draggedWidgetId[2]), 1)
|
|
271
|
+
const newWidgets = this.modelValue
|
|
272
|
+
newWidgets[this.currentRow] = newTargetRow
|
|
273
|
+
newWidgets[Number(this.draggedWidgetId[0])] = newSourceRow
|
|
274
|
+
this.isDragging = false
|
|
275
|
+
;(this.$refs.clone as HTMLElement).innerHTML = ''
|
|
276
|
+
this.$emit('update:model-value', newWidgets)
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
})
|
|
280
|
+
</script>
|
|
281
|
+
|
|
282
|
+
<style lang="scss" scoped>
|
|
283
|
+
.dl-widget-grid {
|
|
284
|
+
display: flex;
|
|
285
|
+
flex-direction: column;
|
|
286
|
+
|
|
287
|
+
&__row {
|
|
288
|
+
display: flex;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
&__clone {
|
|
292
|
+
position: absolute;
|
|
293
|
+
background-color: var(--dl-color-shadow);
|
|
294
|
+
outline: 1px solid var(--dl-color-separator);
|
|
295
|
+
visibility: hidden;
|
|
296
|
+
padding: 10px;
|
|
297
|
+
border-radius: 2px;
|
|
298
|
+
|
|
299
|
+
&--dragging {
|
|
300
|
+
visibility: visible;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
&__item {
|
|
305
|
+
transition: 0.05s;
|
|
306
|
+
user-select: none;
|
|
307
|
+
outline: 1px solid var(--dl-color-separator);
|
|
308
|
+
border-radius: 2px;
|
|
309
|
+
|
|
310
|
+
&--dragging {
|
|
311
|
+
&:hover {
|
|
312
|
+
background-color: var(--dl-color-fill);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
&--header {
|
|
317
|
+
display: flex;
|
|
318
|
+
justify-content: space-between;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
&--titles {
|
|
322
|
+
display: flex;
|
|
323
|
+
flex-direction: column;
|
|
324
|
+
width: 45%;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
&--menu {
|
|
328
|
+
width: 50%;
|
|
329
|
+
display: flex;
|
|
330
|
+
justify-content: flex-end;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
&--drag-icon {
|
|
334
|
+
transform: rotate(90deg);
|
|
335
|
+
margin-top: -30px;
|
|
336
|
+
cursor: grab;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
&--delete-icon {
|
|
340
|
+
cursor: pointer;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
&--content {
|
|
344
|
+
width: 100%;
|
|
345
|
+
margin-bottom: 20px;
|
|
346
|
+
margin-top: 20px;
|
|
347
|
+
color: var(--dl-color-darker);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
&--footer {
|
|
351
|
+
overflow: hidden;
|
|
352
|
+
text-overflow: ellipsis;
|
|
353
|
+
display: -webkit-box;
|
|
354
|
+
-webkit-line-clamp: 2;
|
|
355
|
+
-webkit-box-orient: vertical;
|
|
356
|
+
margin-top: auto;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export function getTargetWidget(el: HTMLElement) {
|
|
2
|
+
//@ts-ignore
|
|
3
|
+
for (; el && el !== document; el = el.parentNode) {
|
|
4
|
+
if (el.classList.contains('dl-widget-grid__item')) {
|
|
5
|
+
return el
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function equateElements(
|
|
11
|
+
sourceElement: HTMLElement,
|
|
12
|
+
targetElement: HTMLElement
|
|
13
|
+
) {
|
|
14
|
+
targetElement.innerHTML = sourceElement.innerHTML
|
|
15
|
+
targetElement.style.width = `${sourceElement.offsetWidth}px`
|
|
16
|
+
targetElement.style.height = `${sourceElement.offsetHeight}px`
|
|
17
|
+
targetElement.style.top = `${
|
|
18
|
+
sourceElement.getBoundingClientRect().y + 20
|
|
19
|
+
}px`
|
|
20
|
+
targetElement.style.left = `${
|
|
21
|
+
sourceElement.getBoundingClientRect().x - 10
|
|
22
|
+
}px`
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getIndex(id: string) {
|
|
26
|
+
return {
|
|
27
|
+
row: Number(id[0]),
|
|
28
|
+
column: Number(id[2])
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { DlAccordion } from './DlAccordion'
|
|
2
|
+
import DlAvatar from './DlAvatar.vue'
|
|
3
|
+
import DlCheckbox from './DlCheckbox.vue'
|
|
4
|
+
import DlSkeleton from './DlSkeleton.vue'
|
|
5
|
+
import DlThemeProvider from './DlThemeProvider.vue'
|
|
6
|
+
import { DlLink } from './DlLink'
|
|
7
|
+
import DlSwitch from './DlSwitch.vue'
|
|
8
|
+
import DlIcon from './DlIcon.vue'
|
|
9
|
+
import DlOptionGroup from './DlOptionGroup/DlOptionGroup.vue'
|
|
10
|
+
import DlRadio from './DlRadio.vue'
|
|
11
|
+
import DlProgressBar from './DlProgressBar.vue'
|
|
12
|
+
import { DlButton } from './DlButton'
|
|
13
|
+
import { DlTabPanel, DlTabPanels } from './DlTabPanels'
|
|
14
|
+
import { DlTabs, DlTab } from './DlTabs'
|
|
15
|
+
import DlTooltip from './DlTooltip.vue'
|
|
16
|
+
import { DlSlider } from './DlSlider'
|
|
17
|
+
import { DlColorPicker } from './DlColorPicker'
|
|
18
|
+
import DlChip from './DlChip'
|
|
19
|
+
import { DlListItem } from './DlListItem'
|
|
20
|
+
import DlItemSection from './DlItemSection.vue'
|
|
21
|
+
import DlList from './DlList.vue'
|
|
22
|
+
import { DlMenu } from './DlMenu'
|
|
23
|
+
import DlCounters from './DlCounters.vue'
|
|
24
|
+
import DlRange from './DlRange/DlRange.vue'
|
|
25
|
+
import DlTextArea from './DlTextArea.vue'
|
|
26
|
+
import DlTrend from './DlTrend.vue'
|
|
27
|
+
import DlInfoErrorMessage from './DlInfoErrorMessage.vue'
|
|
28
|
+
import DlTextInput from './DlTextInput.vue'
|
|
29
|
+
import DlProgressChart from './DlProgressChart.vue'
|
|
30
|
+
import DlAlert from './DlAlert.vue'
|
|
31
|
+
import DlPopup from './DlPopup'
|
|
32
|
+
import DlDropdownButton from './DlDropdownButton.vue'
|
|
33
|
+
import DlTypography from './DlTypography.vue'
|
|
34
|
+
import {
|
|
35
|
+
DlDialogBox,
|
|
36
|
+
DlDialogBoxHeader,
|
|
37
|
+
DlDialogBoxFooter
|
|
38
|
+
} from './DlDialogBox'
|
|
39
|
+
import { DlPanelContainer, DlPanel } from './DlPanelContainer'
|
|
40
|
+
import DlSearch from './DlSearch.vue'
|
|
41
|
+
import { DlSelect } from './DlSelect'
|
|
42
|
+
import DlBadge from './DlBadge.vue'
|
|
43
|
+
import DlItem from './DlItem'
|
|
44
|
+
import { DlStepper, Stepper, Step, StepState } from './DlStepper'
|
|
45
|
+
import { DlTr, DlTh, DlTd, DlTable } from './DlTable'
|
|
46
|
+
import { DlPagination } from './DlPagination'
|
|
47
|
+
import { DlDatePicker } from './DlDatePicker'
|
|
48
|
+
import { DlTimePicker } from './DlTimePicker'
|
|
49
|
+
import { DlDateTimeRange } from './DlDateTimeRange'
|
|
50
|
+
import { DateInterval } from './DlDatePicker/types'
|
|
51
|
+
import { DlSmartSearch } from './DlSmartSearch'
|
|
52
|
+
import { DlWidget } from './DlWidget'
|
|
53
|
+
import { DlWidgetGrid } from './DlWidget'
|
|
54
|
+
import DlTextHolder from './DlTextHolder.vue'
|
|
55
|
+
|
|
56
|
+
export {
|
|
57
|
+
DlAccordion,
|
|
58
|
+
DlAvatar,
|
|
59
|
+
DlInfoErrorMessage,
|
|
60
|
+
DlCheckbox,
|
|
61
|
+
DlSkeleton,
|
|
62
|
+
DlIcon,
|
|
63
|
+
DlSelect,
|
|
64
|
+
DlLink,
|
|
65
|
+
DlRadio,
|
|
66
|
+
DlOptionGroup,
|
|
67
|
+
DlSwitch,
|
|
68
|
+
DlThemeProvider,
|
|
69
|
+
DlTrend,
|
|
70
|
+
DlProgressBar,
|
|
71
|
+
DlItem,
|
|
72
|
+
DlSlider,
|
|
73
|
+
DlButton,
|
|
74
|
+
DlChip,
|
|
75
|
+
DlTooltip,
|
|
76
|
+
DlListItem,
|
|
77
|
+
DlItemSection,
|
|
78
|
+
DlList,
|
|
79
|
+
DlMenu,
|
|
80
|
+
DlCounters,
|
|
81
|
+
DlTextInput,
|
|
82
|
+
DlColorPicker,
|
|
83
|
+
DlTab,
|
|
84
|
+
DlTabs,
|
|
85
|
+
DlTabPanel,
|
|
86
|
+
DlTabPanels,
|
|
87
|
+
DlRange,
|
|
88
|
+
DlTextArea,
|
|
89
|
+
DlPopup,
|
|
90
|
+
DlAlert,
|
|
91
|
+
DlDropdownButton,
|
|
92
|
+
DlProgressChart,
|
|
93
|
+
DlTypography,
|
|
94
|
+
DlDialogBox,
|
|
95
|
+
DlDialogBoxHeader,
|
|
96
|
+
DlDialogBoxFooter,
|
|
97
|
+
DlPanelContainer,
|
|
98
|
+
DlPanel,
|
|
99
|
+
DlSearch,
|
|
100
|
+
DlBadge,
|
|
101
|
+
DlStepper,
|
|
102
|
+
Stepper,
|
|
103
|
+
Step,
|
|
104
|
+
DlTr,
|
|
105
|
+
DlTh,
|
|
106
|
+
DlTd,
|
|
107
|
+
DlTable,
|
|
108
|
+
DlPagination,
|
|
109
|
+
DlDatePicker,
|
|
110
|
+
DlTimePicker,
|
|
111
|
+
DlDateTimeRange,
|
|
112
|
+
DlSmartSearch,
|
|
113
|
+
DlWidget,
|
|
114
|
+
DlWidgetGrid,
|
|
115
|
+
DlTextHolder
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type { StepState, DateInterval }
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<dl-accordion
|
|
4
|
+
v-model="isAccordionOpen"
|
|
5
|
+
title="Controlled with 'Animal Farm' quote and overflowing title (text to trigger overflowing)"
|
|
6
|
+
>
|
|
7
|
+
Some of the animals remembered -- or thought they remembered -- that
|
|
8
|
+
the Sixth Commandment decreed, 'No animal shall kill any other
|
|
9
|
+
animal.' And though no one cared to mention it in the hearing of the
|
|
10
|
+
pigs or the dogs, it was felt that the killings which had taken
|
|
11
|
+
place did not square with this.
|
|
12
|
+
</dl-accordion>
|
|
13
|
+
<dl-accordion
|
|
14
|
+
additional-info="Some additional info"
|
|
15
|
+
title="Uncontrolled with Lorem Ipsum"
|
|
16
|
+
>
|
|
17
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
18
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
19
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
20
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
21
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
22
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
23
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
24
|
+
</dl-accordion>
|
|
25
|
+
<dl-accordion>
|
|
26
|
+
<template #header>
|
|
27
|
+
Custom header content
|
|
28
|
+
<dl-switch
|
|
29
|
+
v-model="switchModel"
|
|
30
|
+
:value="2"
|
|
31
|
+
/>
|
|
32
|
+
</template>
|
|
33
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
34
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
35
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
36
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
37
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
38
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
39
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
40
|
+
</dl-accordion>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script lang="ts">
|
|
45
|
+
import { DlAccordion, DlSwitch } from '../components'
|
|
46
|
+
import { defineComponent } from 'vue-demi'
|
|
47
|
+
|
|
48
|
+
export default defineComponent({
|
|
49
|
+
components: {
|
|
50
|
+
DlAccordion,
|
|
51
|
+
DlSwitch
|
|
52
|
+
},
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
isAccordionOpen: true,
|
|
56
|
+
switchModel: []
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<DlAlert
|
|
4
|
+
:closable="true"
|
|
5
|
+
fluid
|
|
6
|
+
>
|
|
7
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas eos
|
|
8
|
+
amet, nobis unde animi atque itaque? Provident suscipit enim eos
|
|
9
|
+
sequi dolor minima optio tempora error tenetur, autem ratione
|
|
10
|
+
cumque!
|
|
11
|
+
</DlAlert>
|
|
12
|
+
<DlAlert type="warning">
|
|
13
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem
|
|
14
|
+
ipsum dolor sit amet, consectetur adipisicing elit. Lorem ipsum
|
|
15
|
+
dolor sit amet, consectetur adipisicing elit. Lorem ipsum dolor sit
|
|
16
|
+
amet, consectetur adipisicing elit
|
|
17
|
+
Pneumonoultramicroscopicsilicovolcanoconiosis/Pneumonoultramicroscopicsilicovolcanoconiosis/Pneumonoultramicroscopicsilicovolcanoconiosis.
|
|
18
|
+
</DlAlert>
|
|
19
|
+
<div style="display: flex; justify-content: space-between">
|
|
20
|
+
<DlAlert
|
|
21
|
+
type="error"
|
|
22
|
+
:closable="true"
|
|
23
|
+
>
|
|
24
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
|
25
|
+
</DlAlert>
|
|
26
|
+
<DlAlert
|
|
27
|
+
type="info"
|
|
28
|
+
text="Alert text"
|
|
29
|
+
fluid
|
|
30
|
+
>
|
|
31
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
|
32
|
+
</DlAlert>
|
|
33
|
+
</div>
|
|
34
|
+
<DlAlert
|
|
35
|
+
type="info"
|
|
36
|
+
text="Text: Lorem ipsum dolor sit amet, consectetur adipisicing elit. "
|
|
37
|
+
>
|
|
38
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
|
39
|
+
</DlAlert>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script lang="ts">
|
|
44
|
+
import { DlAlert } from '../components'
|
|
45
|
+
import { defineComponent } from 'vue-demi'
|
|
46
|
+
|
|
47
|
+
export default defineComponent({
|
|
48
|
+
name: 'DlAlertDemo',
|
|
49
|
+
components: {
|
|
50
|
+
DlAlert
|
|
51
|
+
},
|
|
52
|
+
template: 'dl-alert-demo'
|
|
53
|
+
})
|
|
54
|
+
</script>
|