@dataloop-ai/components 0.18.0 → 0.18.2
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/package.json +6 -3
- package/src/App.vue +5 -227
- package/src/assets/constants.scss +2 -1
- package/src/assets/globals.scss +21 -0
- package/src/components/basic/DlAccordion/DlAccordion.vue +26 -4
- package/src/components/basic/DlAccordion/components/AccordionHeader.vue +2 -1
- package/src/components/basic/DlAvatar/DlAvatar.vue +1 -1
- package/src/components/basic/DlButton/DlButton.vue +115 -25
- package/src/components/basic/DlButton/utils.ts +45 -2
- package/src/components/basic/DlChip/DlChip.vue +3 -7
- package/src/components/basic/DlChip/utils.ts +4 -4
- package/src/components/basic/DlContainer/DlContainer.vue +70 -0
- package/src/components/basic/DlContainer/index.ts +3 -0
- package/src/components/basic/DlEmptyState/DlEmptyState.vue +282 -0
- package/src/components/basic/DlEmptyState/index.ts +2 -0
- package/src/components/basic/DlEmptyState/types.ts +20 -0
- package/src/components/basic/DlGrid/DlGrid.vue +163 -0
- package/src/components/basic/DlGrid/index.ts +4 -0
- package/src/components/basic/DlGrid/types.ts +5 -0
- package/src/components/basic/DlKpi/components/KpiInfo.vue +2 -1
- package/src/components/basic/DlListItem/DlListItem.vue +96 -66
- package/src/components/basic/DlListItem/utils.ts +0 -3
- package/src/components/basic/DlPanelContainer/DlPanelContainer.vue +37 -13
- package/src/components/basic/DlPopup/DlPopup.vue +58 -11
- package/src/components/basic/DlPopup/components/PopupHeader.vue +11 -6
- package/src/components/basic/DlProgressChart/DlProgressChart.vue +2 -1
- package/src/components/basic/DlWidget/DlWidget.vue +273 -141
- package/src/components/basic/DlWidget/index.ts +1 -3
- package/src/components/basic/DlWidget/utils.ts +90 -8
- package/src/components/basic/index.ts +4 -2
- package/src/components/basic/types.ts +2 -0
- package/src/components/compound/DlCard/DlCard.vue +796 -0
- package/src/components/compound/DlCard/components/DescriptionModal.vue +137 -0
- package/src/components/compound/DlCard/types.ts +38 -0
- package/src/components/compound/DlCharts/charts/DlBarChart/DlBarChart.vue +39 -4
- package/src/components/compound/DlCharts/charts/DlColumnChart/DlColumnChart.vue +128 -36
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +167 -87
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/utils.ts +2 -1
- package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChart.vue +44 -3
- package/src/components/compound/DlCharts/charts/DlDoughnutChart/DlDoughnutChartWidget.vue +1 -2
- package/src/components/compound/DlCharts/charts/DlDoughnutChart/components/DlDoughnutChartLegend.vue +9 -18
- package/src/components/compound/DlCharts/charts/DlLineChart/DlLineChart.vue +48 -9
- package/src/components/compound/DlCharts/charts/DlScatterChart/DlScatterChart.vue +667 -0
- package/src/components/compound/DlCharts/charts/DlScatterChart/index.ts +2 -0
- package/src/components/compound/DlCharts/charts/index.ts +1 -0
- package/src/components/compound/DlCharts/components/DlBrush.vue +3 -2
- package/src/components/compound/DlCharts/components/DlChartLabels.vue +2 -1
- package/src/components/compound/DlCharts/components/DlChartScrollBar.vue +1 -0
- package/src/components/compound/DlCharts/types/props.ts +5 -1
- package/src/components/compound/DlCharts/utils.ts +1 -1
- package/src/components/compound/DlCodeEditor/DlCodeEditor.vue +173 -0
- package/src/components/compound/DlCodeEditor/README.md +11 -0
- package/src/components/compound/DlCodeEditor/components/CodeEditor.vue +705 -0
- package/src/components/compound/DlCodeEditor/index.ts +3 -0
- package/src/components/compound/DlCodeEditor/styles/themes-base16.css +12809 -0
- package/src/components/compound/DlCodeEditor/styles/themes.css +3999 -0
- package/src/components/compound/DlCodeEditor/types.ts +21 -0
- package/src/components/compound/DlDateTime/DlDatePicker/DlDatePicker.vue +9 -1
- package/src/components/compound/DlDateTime/DlDatePicker/components/DlCalendar.vue +4 -2
- package/src/components/compound/DlDateTime/DlDatePicker/components/DlMonthCalendar.vue +2 -1
- package/src/components/compound/DlDateTime/DlDateTimeRange/{DlCardSidebar.vue → CardSidebar.vue} +10 -11
- package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +18 -9
- package/src/components/compound/DlDateTime/DlTimePicker/DlTimePicker.vue +2 -2
- package/src/components/compound/DlDialogBox/DlDialogBox.vue +74 -15
- package/src/components/compound/DlDialogBox/components/DlDialogBoxFooter.vue +1 -1
- package/src/components/compound/DlDialogBox/components/DlDialogBoxHeader.vue +9 -7
- package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +13 -4
- package/src/components/compound/DlInput/DlInput.vue +80 -17
- package/src/components/compound/DlJsonEditor/DlJsonEditor.vue +42 -219
- package/src/components/compound/DlOptionGroup/DlOptionGroup.vue +16 -17
- package/src/components/compound/DlOptionGroup/components/MenuItemWrapper.vue +2 -2
- package/src/components/compound/DlPagination/DlPagination.vue +1 -1
- package/src/components/compound/DlPagination/components/PaginationLegend.vue +0 -2
- package/src/components/compound/DlPagination/components/RowsSelector.vue +0 -2
- package/src/components/compound/DlRange/DlRange.vue +3 -2
- package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +12 -5
- package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +413 -97
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchFilters.vue +4 -1
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +100 -39
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSuggestionsDropdown.vue +12 -7
- package/src/components/compound/DlSearches/DlSmartSearch/components/FiltersQuery.vue +5 -6
- package/src/components/compound/DlSearches/DlSmartSearch/types.ts +14 -0
- package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +10 -6
- package/src/components/compound/DlSearches/DlSmartSearch/utils/index.ts +172 -48
- package/src/components/compound/DlSelect/DlSelect.vue +264 -130
- package/src/components/compound/DlSelect/utils.ts +4 -1
- package/src/components/compound/DlSlider/DlSlider.vue +10 -2
- package/src/components/compound/DlSlider/components/DlSliderBase.vue +3 -3
- package/src/components/compound/DlSlider/components/DlSliderInput.vue +17 -26
- package/src/components/compound/DlSlider/sliderStyles.scss +5 -1
- package/src/components/compound/DlSlider/useSlider.ts +2 -2
- package/src/components/compound/DlSlider/utils.ts +2 -2
- package/src/components/compound/DlStepper/DlStepper.vue +46 -4
- package/src/components/compound/DlStepper/components/DlStepperContent.vue +6 -2
- package/src/components/compound/DlStepper/components/DlStepperFooter.vue +12 -0
- package/src/components/compound/DlStepper/components/DlStepperSidebar.vue +24 -11
- package/src/components/compound/DlStepper/models/Step.ts +37 -8
- package/src/components/compound/DlStepper/models/Stepper.ts +108 -15
- package/src/components/compound/DlStepper/models/interfaces.ts +2 -1
- package/src/components/compound/DlTable/DlTable.vue +49 -14
- package/src/components/compound/DlTable/components/DlTd.vue +9 -9
- package/src/components/compound/DlTable/components/DlTh.vue +3 -2
- package/src/components/compound/DlTable/hooks/tableColumnSelection.ts +35 -40
- package/src/components/compound/DlTable/hooks/tableFilter.ts +33 -21
- package/src/components/compound/DlTable/hooks/tablePagination.ts +18 -18
- package/src/components/compound/DlTable/hooks/tableRowExpand.ts +2 -1
- package/src/components/compound/DlTable/hooks/tableRowSelection.ts +0 -1
- package/src/components/compound/DlTable/hooks/tableSort.ts +52 -47
- package/src/components/compound/DlTable/styles/dl-table-styles.scss +8 -0
- package/src/components/compound/DlTabs/DlTabs.vue +83 -31
- package/src/components/compound/DlTabs/components/DlTab.vue +14 -4
- package/src/components/compound/DlTabs/components/TabsWrapper.vue +32 -27
- package/src/components/compound/DlThumbnailGallery/DlThumbnailGallery.vue +268 -0
- package/src/components/compound/DlThumbnailGallery/index.ts +2 -0
- package/src/components/compound/DlThumbnailGallery/types.ts +11 -0
- package/src/components/compound/DlToast/api/useToast.ts +42 -1
- package/src/components/compound/DlToast/components/ToastComponent.vue +24 -32
- package/src/components/compound/DlToast/types.ts +52 -0
- package/src/components/compound/DlTreeTable/DlTreeTable.vue +1293 -0
- package/src/components/compound/DlTreeTable/components/DlTdTree.vue +119 -0
- package/src/components/compound/DlTreeTable/components/DlTrTree.vue +52 -0
- package/src/components/compound/DlTreeTable/index.ts +3 -0
- package/src/components/compound/DlTreeTable/types.ts +1 -0
- package/src/components/compound/DlTreeTable/utils/convertToNestedObject.ts +51 -0
- package/src/components/compound/DlTreeTable/utils/flatTreeData.ts +19 -0
- package/src/components/compound/DlTreeTable/utils/getFromChildren.ts +39 -0
- package/src/components/compound/DlTreeTable/utils/trSpacing.ts +13 -0
- package/src/components/compound/DlTreeTable/utils/treeTableRowSelection.ts +184 -0
- package/src/components/compound/index.ts +14 -1
- package/src/components/compound/types.ts +2 -0
- package/src/components/essential/DlBadge/DlBadge.vue +3 -3
- package/src/components/essential/DlCheckbox/DlCheckbox.vue +10 -7
- package/src/components/essential/DlEllipsis/DlEllipsis.vue +141 -0
- package/src/components/essential/DlIcon/DlIcon.vue +5 -5
- package/src/components/essential/DlLabel/DlLabel.vue +190 -0
- package/src/components/essential/DlLabel/index.ts +2 -0
- package/src/components/essential/DlList/DlList.vue +3 -3
- package/src/components/essential/DlMenu/DlMenu.vue +41 -22
- package/src/components/essential/DlMenu/utils.ts +8 -7
- package/src/components/essential/DlPageLayout/DlPageLayout.vue +90 -0
- package/src/components/essential/DlPageLayout/index.ts +2 -0
- package/src/components/essential/DlProgressBar/DlProgressBar.vue +1 -1
- package/src/components/essential/DlRadio/DlRadio.vue +10 -5
- package/src/components/essential/DlSeparator/DlSeparator.vue +2 -2
- package/src/components/essential/DlSpinner/index.ts +1 -13
- package/src/components/essential/DlSpinner/styles/spinnerStyles.scss +7 -0
- package/src/components/essential/DlSwitch/DlSwitch.vue +6 -3
- package/src/components/essential/DlTextArea/DlTextArea.vue +212 -7
- package/src/components/essential/DlThemeProvider/DlThemeProvider.vue +6 -0
- package/src/components/essential/DlTypography/DlTypography.vue +7 -1
- package/src/components/essential/index.ts +3 -2
- package/src/components/shared/DlInfoErrorMessage/DlInfoErrorMessage.vue +1 -1
- package/src/components/{essential → shared}/DlTooltip/DlTooltip.vue +26 -19
- package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +106 -43
- package/src/components/shared/DlVirtualScroll/useVirtualScroll.ts +28 -4
- package/src/components/shared/index.ts +1 -0
- package/src/components/types.ts +2 -0
- package/src/demos/BarChartDemo.vue +59 -2
- package/src/demos/ColumnChartDemo.vue +67 -2
- package/src/demos/DlAccordionDemo.vue +92 -43
- package/src/demos/DlAlertDemo.vue +14 -0
- package/src/demos/DlButtonDemo.vue +41 -4
- package/src/demos/DlCardDemo.vue +156 -19
- package/src/demos/DlChartDoughnutDemo.vue +49 -2
- package/src/demos/DlCheckboxDemo.vue +28 -3
- package/src/demos/DlCodeEditor/DlCodeEditorDemo.vue +247 -0
- package/src/demos/DlCodeEditor/index.ts +2 -0
- package/src/demos/DlConfusionMatrixDemo.vue +93 -37
- package/src/demos/DlDemoPage.vue +235 -0
- package/src/demos/DlDialogBoxDemo.vue +56 -51
- package/src/demos/DlDropdownButtonDemo.vue +35 -27
- package/src/demos/DlEmptyStateDemo.vue +81 -0
- package/src/demos/DlGridDemo.vue +40 -0
- package/src/demos/DlInputDemo.vue +21 -1
- package/src/demos/DlJsonEditorDemo.vue +59 -0
- package/src/demos/DlLabelDemo.vue +208 -0
- package/src/demos/DlLineChartDemo.vue +50 -2
- package/src/demos/DlListDemo.vue +12 -9
- package/src/demos/DlMenuDemo.vue +147 -20
- package/src/demos/DlPageLayoutDemo.vue +146 -0
- package/src/demos/DlPanelContainerDemo.vue +113 -2
- package/src/demos/DlPopupDemo.vue +82 -1
- package/src/demos/DlRadioDemo.vue +16 -1
- package/src/demos/DlScatterChartDemo.vue +161 -0
- package/src/demos/DlSearchDemo.vue +9 -0
- package/src/demos/DlSelectDemo.vue +124 -27
- package/src/demos/DlSpinnerDemo.vue +0 -2
- package/src/demos/DlStepperDemo/DlStepperDemo.vue +5 -1
- package/src/demos/DlStepperDemo/EmptyStateStepper.vue +149 -0
- package/src/demos/DlStepperDemo/SimpleStepper.vue +4 -0
- package/src/demos/DlStepperDemo/steps/GeneralStep.vue +1 -0
- package/src/demos/DlSwitchDemo.vue +12 -0
- package/src/demos/DlTableDemo.vue +84 -5
- package/src/demos/DlTabsDemo.vue +92 -3
- package/src/demos/DlTextAreaDemo.vue +14 -17
- package/src/demos/DlThumbnailGalleryDemo.vue +99 -0
- package/src/demos/DlToastDemo.vue +3 -9
- package/src/demos/DlTooltipDemo.vue +66 -2
- package/src/demos/DlTreeTableDemo.vue +694 -0
- package/src/demos/DlVirtualScrollDemo.vue +3 -12
- package/src/demos/DlWidgetDemo.vue +252 -61
- package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +151 -32
- package/src/demos/index.ts +23 -4
- package/src/hooks/use-anchor.ts +15 -17
- package/src/hooks/use-arrow-navigation.ts +64 -21
- package/src/hooks/use-model-toggle.ts +14 -16
- package/src/hooks/use-portal.ts +9 -3
- package/src/hooks/use-scroll-target.ts +2 -4
- package/src/hooks/use-size-observer.ts +3 -2
- package/src/hooks/use-suggestions.ts +239 -49
- package/src/hooks/use-transition.ts +10 -4
- package/src/index.ts +22 -1
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetFooter.vue +78 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetHeader.vue +22 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetLeftDrawer.vue +96 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetMainContent.vue +51 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/DatasetRightDrawer.vue +88 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/ActionsMenu.vue +70 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/AutomationMenu.vue +106 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardView.vue +101 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardViewGallery.vue +141 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/CardViewTable.vue +193 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/EmptyState/LayoutEmptyState.vue +227 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/EmptyState/UploadData.vue +106 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/MainContentImages.vue +540 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/MainContent/MainContentNav.vue +329 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/NavbarKpi.vue +84 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/NavbarSearch.vue +132 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/SearchFilterMenu.vue +19 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/filters/AddFilter.vue +212 -0
- package/src/layouts/DlDatasetBrowser/DemoComponents/types/imageMetadata.ts +28 -0
- package/src/layouts/DlDatasetBrowser/DlDatasetBrowser.vue +42 -0
- package/src/layouts/DlStudioLayout/DlStudioLayout.vue +42 -0
- package/src/layouts/DlStudioLayout/components/Demo/LeftMenuContent.vue +23 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioFooter.vue +25 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioHeader.vue +121 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioLeftDrawer.vue +245 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioMainContent.vue +31 -0
- package/src/layouts/DlStudioLayout/components/Demo/StudioTabsMenu.vue +117 -0
- package/src/layouts/DlStudioLayout/components/Demo/TabMenu/FilterMenu.vue +62 -0
- package/src/layouts/DlStudioLayout/components/Demo/TabMenu/TabMenuAnnotations.vue +98 -0
- package/src/layouts/DlStudioLayout/components/Demo/TabMenu/TabMenuItem.vue +66 -0
- package/src/layouts/DlStudioLayout/components/LayoutNavbar.vue +24 -0
- package/src/layouts/DlStudioLayout/components/ListAutocomplete.vue +149 -0
- package/src/layouts/DlStudioLayout/components/NavigationDrawer.vue +147 -0
- package/src/layouts/DlStudioLayout/index.ts +2 -0
- package/src/layouts/DlStudioLayout/types/HorizontalItems.ts +9 -0
- package/src/layouts/DlStudioLayout/types/VerticalItems.ts +10 -0
- package/src/simple-code-editor.d.ts +1 -0
- package/src/utils/click-outside.ts +1 -1
- package/src/utils/dom.ts +5 -5
- package/src/utils/events.ts +3 -3
- package/src/utils/global-nodes.ts +2 -2
- package/src/utils/input-sizes.ts +5 -2
- package/src/utils/is-ellipsis-active.ts +4 -1
- package/src/utils/parse-smart-query.ts +209 -111
- package/src/utils/portal.ts +5 -5
- package/src/utils/position-engine.ts +7 -7
- package/src/utils/render.ts +1 -1
- package/src/utils/scroll.ts +2 -2
- package/src/utils/selection.ts +3 -3
- package/vite.config.ts +9 -1
- package/src/components/basic/DlCard/DlCard.vue +0 -241
- package/src/components/basic/DlCard/types.ts +0 -20
- package/src/components/basic/DlEllipsis/DlEllipsis.vue +0 -114
- package/src/components/basic/DlWidget/DlGrid.vue +0 -33
- package/src/components/basic/DlWidget/DlGridRow.vue +0 -32
- package/src/components/compound/DlSearches/DlSmartSearch/utils/utils.ts +0 -124
- package/src/components/compound/DlToast/utils/config.ts +0 -17
- package/src/components/essential/DlTextHolder/DlTextHolder.vue +0 -65
- package/src/components/essential/DlTextHolder/index.ts +0 -2
- package/src/demos/DlTextHolderDemo.vue +0 -42
- package/src/utils/swapNodes.ts +0 -30
- /package/src/components/{basic → compound}/DlCard/index.ts +0 -0
- /package/src/components/compound/DlDateTime/DlDateTimeRange/{DlDateInput.vue → DateInput.vue} +0 -0
- /package/src/components/{basic → essential}/DlEllipsis/index.ts +0 -0
- /package/src/components/{essential → shared}/DlTooltip/index.ts +0 -0
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
:color="color"
|
|
29
29
|
:readonly="readonly"
|
|
30
30
|
:disabled="disabled"
|
|
31
|
+
:thumb-size="thumbSize"
|
|
31
32
|
:snap="snap"
|
|
32
33
|
:tabindex="tabindex"
|
|
33
34
|
:name="name"
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
<div class="right-container capitalize">
|
|
57
58
|
<dl-button
|
|
58
59
|
flat
|
|
59
|
-
size="
|
|
60
|
+
size="12px"
|
|
60
61
|
label="Reset"
|
|
61
62
|
:disabled="disabled || readonly"
|
|
62
63
|
data-test="non-editable-slider-button"
|
|
@@ -82,6 +83,7 @@
|
|
|
82
83
|
:step="step"
|
|
83
84
|
:color="color"
|
|
84
85
|
:readonly="readonly"
|
|
86
|
+
:thumb-size="thumbSize"
|
|
85
87
|
:disabled="disabled"
|
|
86
88
|
:snap="snap"
|
|
87
89
|
:name="name"
|
|
@@ -96,7 +98,8 @@
|
|
|
96
98
|
import { defineComponent } from 'vue-demi'
|
|
97
99
|
import { DlSliderBase, DlSliderInput } from './components/'
|
|
98
100
|
import { DlButton } from '../../basic'
|
|
99
|
-
import { DlIcon
|
|
101
|
+
import { DlIcon } from '../../essential'
|
|
102
|
+
import { DlTooltip } from '../../shared'
|
|
100
103
|
import { getColor, between } from '../../../utils'
|
|
101
104
|
import { v4 } from 'uuid'
|
|
102
105
|
|
|
@@ -134,6 +137,10 @@ export default defineComponent({
|
|
|
134
137
|
type: Boolean,
|
|
135
138
|
default: false
|
|
136
139
|
},
|
|
140
|
+
thumbSize: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: '10px'
|
|
143
|
+
},
|
|
137
144
|
min: {
|
|
138
145
|
type: Number,
|
|
139
146
|
default: 0
|
|
@@ -210,6 +217,7 @@ export default defineComponent({
|
|
|
210
217
|
return {
|
|
211
218
|
'--text-color': getColor(this.textColor, 'dl-color-darker'),
|
|
212
219
|
'--width': this.width,
|
|
220
|
+
'--thumb-size': parseInt(this.thumbSize) / 2 + 'px',
|
|
213
221
|
'--color': getColor(this.color, 'dl-color-secondary')
|
|
214
222
|
}
|
|
215
223
|
}
|
|
@@ -146,7 +146,7 @@ export default defineComponent({
|
|
|
146
146
|
color:
|
|
147
147
|
this.disabled !== true
|
|
148
148
|
? getColor(this.color, 'dl-color-secondary')
|
|
149
|
-
: 'var(--dl-color-
|
|
149
|
+
: 'var(--dl-color-disabled-slider)'
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
thumbStyle(): Record<string, any> {
|
|
@@ -350,12 +350,12 @@ export default defineComponent({
|
|
|
350
350
|
},
|
|
351
351
|
onPan(event: any): void {
|
|
352
352
|
if (event.isFinal === true) {
|
|
353
|
-
if (this.dragging
|
|
353
|
+
if (this.dragging) {
|
|
354
354
|
this.updatePosition(event.evt)
|
|
355
355
|
if (event.touch === true) {
|
|
356
356
|
this.updateValue(true)
|
|
357
357
|
}
|
|
358
|
-
this.dragging =
|
|
358
|
+
this.dragging = null
|
|
359
359
|
this.$emit('pan', 'end')
|
|
360
360
|
}
|
|
361
361
|
this.active = false
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<input
|
|
3
3
|
ref="sliderInput"
|
|
4
|
-
:value="
|
|
4
|
+
:value="modelRef"
|
|
5
5
|
type="number"
|
|
6
6
|
:min="min"
|
|
7
7
|
:max="max"
|
|
8
8
|
:readonly="readonly"
|
|
9
9
|
:disabled="disabled"
|
|
10
|
-
@input="
|
|
10
|
+
@input="handleChange"
|
|
11
11
|
@change="handleChange"
|
|
12
12
|
>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script lang="ts">
|
|
16
|
-
import {
|
|
16
|
+
import { debounce } from 'lodash'
|
|
17
|
+
import { defineComponent, toRef } from 'vue-demi'
|
|
17
18
|
import { getInputValue } from '../utils'
|
|
18
19
|
|
|
19
20
|
export default defineComponent({
|
|
@@ -45,34 +46,24 @@ export default defineComponent({
|
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
48
|
emits: ['update:model-value', 'change'],
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
get(): number | undefined {
|
|
51
|
-
return this.modelValue
|
|
52
|
-
},
|
|
53
|
-
set(evt: any): void {
|
|
54
|
-
const val = evt.target.value
|
|
49
|
+
setup(props, { emit }) {
|
|
50
|
+
const modelRef = toRef(props, 'modelValue')
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const { value } = getInputValue(val, this.min, this.max)
|
|
59
|
-
|
|
60
|
-
;(this.$refs.sliderInput as HTMLInputElement).value = value
|
|
61
|
-
|
|
62
|
-
this.$emit('update:model-value', Number(value))
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
methods: {
|
|
67
|
-
handleChange(evt: any) {
|
|
52
|
+
const handleChange = (evt: any) => {
|
|
68
53
|
const val = evt.target.value
|
|
69
54
|
if (val === '') return
|
|
70
55
|
|
|
71
|
-
const { value } = getInputValue(val,
|
|
56
|
+
const { value } = getInputValue(val, props.min, props.max)
|
|
57
|
+
|
|
58
|
+
emit('change', Number(value))
|
|
59
|
+
emit('update:model-value', Number(value))
|
|
60
|
+
}
|
|
72
61
|
|
|
73
|
-
|
|
62
|
+
const debouncedHandleChange = debounce(handleChange, 300)
|
|
74
63
|
|
|
75
|
-
|
|
64
|
+
return {
|
|
65
|
+
modelRef,
|
|
66
|
+
handleChange: debouncedHandleChange
|
|
76
67
|
}
|
|
77
68
|
},
|
|
78
69
|
template: 'dl-slider-input'
|
|
@@ -82,7 +73,7 @@ export default defineComponent({
|
|
|
82
73
|
<style scoped>
|
|
83
74
|
input[type='number'] {
|
|
84
75
|
width: 31px;
|
|
85
|
-
height:
|
|
76
|
+
height: 20px;
|
|
86
77
|
padding-top: 3px;
|
|
87
78
|
padding-left: 5px;
|
|
88
79
|
padding-bottom: 3px;
|
|
@@ -70,7 +70,8 @@
|
|
|
70
70
|
& .slider-bar-container {
|
|
71
71
|
display: flex;
|
|
72
72
|
align-items: center;
|
|
73
|
-
width: 100
|
|
73
|
+
width: calc(100% - var(--thumb-size));
|
|
74
|
+
align-self: center;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
& .text {
|
|
@@ -102,6 +103,9 @@
|
|
|
102
103
|
display: flex;
|
|
103
104
|
align-items: center;
|
|
104
105
|
justify-content: space-between;
|
|
106
|
+
& > * {
|
|
107
|
+
margin: 0px 5px
|
|
108
|
+
}
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
}
|
|
@@ -215,13 +215,13 @@ export default function ({
|
|
|
215
215
|
|
|
216
216
|
function onPan(event: any) {
|
|
217
217
|
if (event.isFinal === true) {
|
|
218
|
-
if (dragging.value
|
|
218
|
+
if (dragging.value) {
|
|
219
219
|
updatePosition(event.evt)
|
|
220
220
|
// only if touch, because we also have mousedown/up:
|
|
221
221
|
if (event.touch === true) {
|
|
222
222
|
updateValue(true)
|
|
223
223
|
}
|
|
224
|
-
dragging.value =
|
|
224
|
+
dragging.value = null
|
|
225
225
|
emit('pan', 'end')
|
|
226
226
|
}
|
|
227
227
|
active.value = false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const getInputValue = (value: string, min: number, max: number) => {
|
|
2
|
-
if (
|
|
3
|
-
return { value: (
|
|
2
|
+
if (parseFloat(value) > max || parseFloat(value) < min) {
|
|
3
|
+
return { value: (parseFloat(value) > max ? max : min).toString() }
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
return { value }
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
<dl-stepper-sidebar
|
|
17
17
|
:steps="steps"
|
|
18
18
|
:bg-color="bgColor"
|
|
19
|
-
:
|
|
19
|
+
:hide="hide"
|
|
20
|
+
:disabled="disabled"
|
|
20
21
|
@step-click="$emit('set-step', $event)"
|
|
21
22
|
/>
|
|
22
23
|
<div class="dl-stepper-content dl-stepper-content--slot">
|
|
@@ -24,18 +25,35 @@
|
|
|
24
25
|
v-if="state"
|
|
25
26
|
:title="contentTitle"
|
|
26
27
|
:error="state.error"
|
|
28
|
+
:hide="hide"
|
|
27
29
|
:completed="state.completed"
|
|
28
30
|
>
|
|
29
31
|
<template #header>
|
|
30
32
|
<slot
|
|
33
|
+
v-if="!isEmpty"
|
|
31
34
|
name="content-header"
|
|
32
35
|
:state="state"
|
|
33
36
|
/>
|
|
34
37
|
</template>
|
|
35
38
|
<slot
|
|
39
|
+
v-if="!isEmpty"
|
|
36
40
|
:name="state.value"
|
|
37
41
|
:state="state"
|
|
38
42
|
/>
|
|
43
|
+
<dl-empty-state
|
|
44
|
+
v-if="isEmpty"
|
|
45
|
+
v-bind="emptyStateProps"
|
|
46
|
+
>
|
|
47
|
+
<template
|
|
48
|
+
v-for="(_, slot) in $slots"
|
|
49
|
+
#[slot]="props"
|
|
50
|
+
>
|
|
51
|
+
<slot
|
|
52
|
+
:name="slot"
|
|
53
|
+
v-bind="props"
|
|
54
|
+
/>
|
|
55
|
+
</template>
|
|
56
|
+
</dl-empty-state>
|
|
39
57
|
</dl-stepper-content>
|
|
40
58
|
<dl-stepper-footer
|
|
41
59
|
:finished="isDone"
|
|
@@ -44,6 +62,8 @@
|
|
|
44
62
|
:prev-button-label="prevButtonLabel"
|
|
45
63
|
:disabled-next-step="disabledNextStep"
|
|
46
64
|
:disabled-prev-step="disabledPrevStep"
|
|
65
|
+
:prev-step-disabled-tooltip="prevStepDisabledTooltip"
|
|
66
|
+
:next-step-disabled-tooltip="nextStepDisabledTooltip"
|
|
47
67
|
@next="$emit('next')"
|
|
48
68
|
@prev="$emit('prev')"
|
|
49
69
|
@done="$emit('done')"
|
|
@@ -60,6 +80,8 @@ import DlStepperHeader from './components/DlStepperHeader.vue'
|
|
|
60
80
|
import DlStepperFooter from './components/DlStepperFooter.vue'
|
|
61
81
|
import DlStepperSidebar from './components/DlStepperSidebar.vue'
|
|
62
82
|
import DlStepperContent from './components/DlStepperContent.vue'
|
|
83
|
+
import DlEmptyState from '../../basic/DlEmptyState/DlEmptyState.vue'
|
|
84
|
+
import { DlEmptyStateProps } from '../../basic/DlEmptyState/types'
|
|
63
85
|
import { StepState } from './models/interfaces'
|
|
64
86
|
import { Step } from './models'
|
|
65
87
|
import { getColor } from '../../../utils'
|
|
@@ -71,7 +93,8 @@ export default defineComponent({
|
|
|
71
93
|
DlStepperFooter,
|
|
72
94
|
DlStepperSidebar,
|
|
73
95
|
DlStepperContent,
|
|
74
|
-
DlStepperContainer
|
|
96
|
+
DlStepperContainer,
|
|
97
|
+
DlEmptyState
|
|
75
98
|
},
|
|
76
99
|
model: {
|
|
77
100
|
prop: 'modelValue',
|
|
@@ -92,7 +115,7 @@ export default defineComponent({
|
|
|
92
115
|
},
|
|
93
116
|
state: {
|
|
94
117
|
type: Object as PropType<StepState>,
|
|
95
|
-
default:
|
|
118
|
+
default: null
|
|
96
119
|
},
|
|
97
120
|
modelValue: {
|
|
98
121
|
type: Boolean,
|
|
@@ -132,7 +155,13 @@ export default defineComponent({
|
|
|
132
155
|
disabledPrevStep: Boolean,
|
|
133
156
|
isDone: Boolean,
|
|
134
157
|
hideCloseButton: Boolean,
|
|
135
|
-
|
|
158
|
+
disabled: { type: Boolean, default: false },
|
|
159
|
+
isEmpty: Boolean,
|
|
160
|
+
emptyStateProps: {
|
|
161
|
+
type: Object as PropType<DlEmptyStateProps>,
|
|
162
|
+
required: false,
|
|
163
|
+
default: null
|
|
164
|
+
}
|
|
136
165
|
},
|
|
137
166
|
emits: ['update:modelValue', 'done', 'next', 'prev', 'set-step', 'close'],
|
|
138
167
|
data() {
|
|
@@ -142,12 +171,25 @@ export default defineComponent({
|
|
|
142
171
|
}
|
|
143
172
|
},
|
|
144
173
|
computed: {
|
|
174
|
+
hide(): boolean {
|
|
175
|
+
return this.isEmpty
|
|
176
|
+
},
|
|
145
177
|
nextButtonLabel(): string {
|
|
146
178
|
return this.nextStep?.title ?? null
|
|
147
179
|
},
|
|
148
180
|
prevButtonLabel(): string {
|
|
149
181
|
return this.prevStep?.title ?? null
|
|
150
182
|
},
|
|
183
|
+
nextStepDisabledTooltip(): string {
|
|
184
|
+
return this.disabledNextStep
|
|
185
|
+
? this.nextStep?.disabledTooltip ?? ''
|
|
186
|
+
: ''
|
|
187
|
+
},
|
|
188
|
+
prevStepDisabledTooltip(): string {
|
|
189
|
+
return this.disabledPrevStep
|
|
190
|
+
? this.prevStep?.disabledTooltip ?? ''
|
|
191
|
+
: ''
|
|
192
|
+
},
|
|
151
193
|
cssVars(): Record<string, string | number> {
|
|
152
194
|
return {
|
|
153
195
|
'--dl-stepper-width': this.width,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="stepper-content">
|
|
3
|
-
<slot
|
|
3
|
+
<slot
|
|
4
|
+
v-if="!hide"
|
|
5
|
+
name="header"
|
|
6
|
+
>
|
|
4
7
|
<div class="stepper-content--header">
|
|
5
8
|
<dl-typography
|
|
6
9
|
size="h3"
|
|
@@ -53,7 +56,8 @@ export default defineComponent({
|
|
|
53
56
|
type: String,
|
|
54
57
|
default: ''
|
|
55
58
|
},
|
|
56
|
-
completed: Boolean
|
|
59
|
+
completed: Boolean,
|
|
60
|
+
hide: Boolean
|
|
57
61
|
},
|
|
58
62
|
emits: ['next', 'prev']
|
|
59
63
|
})
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
<div class="dl-stepper-footer__left-actions">
|
|
5
5
|
<dl-button
|
|
6
6
|
:disabled="disabledPrevStep"
|
|
7
|
+
:tooltip="prevStepDisabledTooltip"
|
|
7
8
|
outlined
|
|
8
9
|
:colors-object="prevButtonColorsObject"
|
|
9
10
|
:label="prevLabel"
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
/>
|
|
12
13
|
<dl-button
|
|
13
14
|
:disabled="disabledNextStep"
|
|
15
|
+
:tooltip="nextStepDisabledTooltip"
|
|
14
16
|
class="justify-end"
|
|
15
17
|
outlined
|
|
16
18
|
:label="nextLabel"
|
|
@@ -55,6 +57,16 @@ export default defineComponent({
|
|
|
55
57
|
required: false,
|
|
56
58
|
default: ''
|
|
57
59
|
},
|
|
60
|
+
nextStepDisabledTooltip: {
|
|
61
|
+
type: String,
|
|
62
|
+
required: false,
|
|
63
|
+
default: ''
|
|
64
|
+
},
|
|
65
|
+
prevStepDisabledTooltip: {
|
|
66
|
+
type: String,
|
|
67
|
+
required: false,
|
|
68
|
+
default: ''
|
|
69
|
+
},
|
|
58
70
|
disabledNextStep: Boolean,
|
|
59
71
|
disabledPrevStep: Boolean
|
|
60
72
|
},
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="sidebar">
|
|
3
|
-
<dl-list>
|
|
3
|
+
<dl-list v-if="!hide">
|
|
4
4
|
<dl-list-item
|
|
5
5
|
v-for="(step, index) in steps"
|
|
6
6
|
:key="index"
|
|
7
7
|
:data-test-index="index"
|
|
8
|
-
:end-icon="
|
|
9
|
-
:
|
|
10
|
-
|
|
11
|
-
:clickable="sidebarNavigation"
|
|
12
|
-
:disabled="!getStepSidebarNavigation(step)"
|
|
8
|
+
:end-icon="endIcon(step)"
|
|
9
|
+
:clickable="!disabled"
|
|
10
|
+
:disabled="!isStepDisabled(step)"
|
|
13
11
|
:class="sidebarItemClasses(step)"
|
|
14
12
|
@click="handleStepClick(step, index)"
|
|
15
13
|
>
|
|
@@ -24,6 +22,9 @@
|
|
|
24
22
|
{{ getStepSubtitle(step) }}
|
|
25
23
|
</span>
|
|
26
24
|
</div>
|
|
25
|
+
<dl-tooltip v-if="isStepDisabled(step)">
|
|
26
|
+
{{ getStepDisabledTooltip(step) }}
|
|
27
|
+
</dl-tooltip>
|
|
27
28
|
</span>
|
|
28
29
|
</dl-item-section>
|
|
29
30
|
</dl-list-item>
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
<script lang="ts">
|
|
35
36
|
import { defineComponent, PropType } from 'vue-demi'
|
|
36
37
|
import { DlListItem } from '../../../basic'
|
|
37
|
-
import { DlItemSection } from '../../../shared'
|
|
38
|
+
import { DlItemSection, DlTooltip } from '../../../shared'
|
|
38
39
|
import { DlList } from '../../../essential'
|
|
39
40
|
import { Step } from '../models'
|
|
40
41
|
|
|
@@ -43,7 +44,8 @@ export default defineComponent({
|
|
|
43
44
|
components: {
|
|
44
45
|
DlList,
|
|
45
46
|
DlListItem,
|
|
46
|
-
DlItemSection
|
|
47
|
+
DlItemSection,
|
|
48
|
+
DlTooltip
|
|
47
49
|
},
|
|
48
50
|
props: {
|
|
49
51
|
steps: {
|
|
@@ -55,10 +57,18 @@ export default defineComponent({
|
|
|
55
57
|
required: false,
|
|
56
58
|
default: 'dl-color-fill-third'
|
|
57
59
|
},
|
|
58
|
-
|
|
60
|
+
disabled: { type: Boolean, default: false },
|
|
61
|
+
hide: { type: Boolean, default: false }
|
|
59
62
|
},
|
|
60
63
|
emits: ['step-click'],
|
|
61
64
|
methods: {
|
|
65
|
+
endIcon(step: Step) {
|
|
66
|
+
return {
|
|
67
|
+
icon: this.getStepIcon(step),
|
|
68
|
+
color: this.getStepIconColor(step),
|
|
69
|
+
size: '16px'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
62
72
|
getStepTitle(step: Step): string {
|
|
63
73
|
const optional = step.optional ? ' (Optional)' : ''
|
|
64
74
|
return `${this.capitalize(step.title)}${optional}`
|
|
@@ -104,8 +114,11 @@ export default defineComponent({
|
|
|
104
114
|
? 'dl-color-positive'
|
|
105
115
|
: 'dl-color-transparent'
|
|
106
116
|
},
|
|
107
|
-
|
|
108
|
-
return step.
|
|
117
|
+
isStepDisabled(step: Step): boolean {
|
|
118
|
+
return step.disabled ?? false
|
|
119
|
+
},
|
|
120
|
+
getStepDisabledTooltip(step: Step): string {
|
|
121
|
+
return step.disabledTooltip ?? ''
|
|
109
122
|
}
|
|
110
123
|
}
|
|
111
124
|
})
|
|
@@ -11,7 +11,8 @@ export class Step {
|
|
|
11
11
|
subtitle: '',
|
|
12
12
|
completed: false,
|
|
13
13
|
optional: false,
|
|
14
|
-
|
|
14
|
+
disabled: false,
|
|
15
|
+
disabledTooltip: '',
|
|
15
16
|
error: '',
|
|
16
17
|
warning: '',
|
|
17
18
|
...state
|
|
@@ -28,10 +29,18 @@ export class Step {
|
|
|
28
29
|
return this._state.title
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
public set title(value: string) {
|
|
33
|
+
set(this._state, 'title', value)
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
public get subtitle(): string {
|
|
32
37
|
return this._state.subtitle
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
public set subtitle(value: string) {
|
|
41
|
+
set(this._state, 'subtitle', value)
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
public get optional(): boolean {
|
|
36
45
|
return this._state.optional
|
|
37
46
|
}
|
|
@@ -46,7 +55,7 @@ export class Step {
|
|
|
46
55
|
|
|
47
56
|
public set completed(value: boolean) {
|
|
48
57
|
set(this._state, 'error', '')
|
|
49
|
-
set(this._state, 'warning',
|
|
58
|
+
set(this._state, 'warning', '')
|
|
50
59
|
set(this._state, 'completed', value)
|
|
51
60
|
}
|
|
52
61
|
|
|
@@ -56,7 +65,7 @@ export class Step {
|
|
|
56
65
|
|
|
57
66
|
public set error(value: string) {
|
|
58
67
|
set(this._state, 'error', value)
|
|
59
|
-
set(this._state, 'warning',
|
|
68
|
+
set(this._state, 'warning', '')
|
|
60
69
|
set(this._state, 'completed', false)
|
|
61
70
|
}
|
|
62
71
|
|
|
@@ -66,7 +75,7 @@ export class Step {
|
|
|
66
75
|
|
|
67
76
|
public set warning(value: string) {
|
|
68
77
|
set(this._state, 'warning', value)
|
|
69
|
-
set(this._state, 'error',
|
|
78
|
+
set(this._state, 'error', '')
|
|
70
79
|
set(this._state, 'completed', true)
|
|
71
80
|
}
|
|
72
81
|
|
|
@@ -82,12 +91,32 @@ export class Step {
|
|
|
82
91
|
set(this._state, 'active', value)
|
|
83
92
|
}
|
|
84
93
|
|
|
85
|
-
public get
|
|
86
|
-
return this._state.
|
|
94
|
+
public get disabled() {
|
|
95
|
+
return this._state.disabled
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public set disabled(value: boolean) {
|
|
99
|
+
set(this._state, 'disabled', value)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public get disabledTooltip() {
|
|
103
|
+
return this._state.disabledTooltip
|
|
87
104
|
}
|
|
88
105
|
|
|
89
|
-
public set
|
|
90
|
-
set(this._state, '
|
|
106
|
+
public set disabledTooltip(value: string) {
|
|
107
|
+
set(this._state, 'disabledTooltip', value)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
public clearError() {
|
|
111
|
+
set(this._state, 'error', '')
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public clearWarning() {
|
|
115
|
+
set(this._state, 'warning', '')
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
public clearCompleted() {
|
|
119
|
+
set(this._state, 'completed', false)
|
|
91
120
|
}
|
|
92
121
|
|
|
93
122
|
public reset() {
|