@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
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
:disabled="disabled"
|
|
13
13
|
:style="[computedStyles]"
|
|
14
14
|
style="pointer-events: auto"
|
|
15
|
-
class="
|
|
15
|
+
:class="buttonClass"
|
|
16
16
|
@click="onClick"
|
|
17
17
|
@mousedown="onMouseDown"
|
|
18
18
|
>
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<div class="dl-button-content dl-anchor--skip">
|
|
25
25
|
<dl-icon
|
|
26
26
|
v-if="hasIcon"
|
|
27
|
+
class="dl-button-icon"
|
|
27
28
|
:size="iconSizePX"
|
|
28
29
|
:color="iconColor || textColor"
|
|
29
30
|
:icon="icon"
|
|
@@ -52,7 +53,8 @@
|
|
|
52
53
|
</template>
|
|
53
54
|
|
|
54
55
|
<script lang="ts">
|
|
55
|
-
import { DlTooltip
|
|
56
|
+
import { DlTooltip } from '../../shared'
|
|
57
|
+
import { DlIcon } from '../../essential'
|
|
56
58
|
import {
|
|
57
59
|
setPadding,
|
|
58
60
|
setFontSize,
|
|
@@ -62,18 +64,22 @@ import {
|
|
|
62
64
|
setColorOnHover,
|
|
63
65
|
setBorderOnHover,
|
|
64
66
|
setBgOnHover,
|
|
67
|
+
setBgOnPressed,
|
|
68
|
+
setBorderOnPressed,
|
|
69
|
+
setTextOnPressed,
|
|
65
70
|
setIconSize,
|
|
66
71
|
setIconPadding,
|
|
67
72
|
setMaxHeight
|
|
68
73
|
} from './utils'
|
|
69
74
|
import type { ButtonSizes } from './utils'
|
|
70
|
-
import { defineComponent, PropType, ref } from 'vue-demi'
|
|
75
|
+
import { computed, defineComponent, PropType, ref } from 'vue-demi'
|
|
71
76
|
import { colorNames } from '../../../utils/css-color-names'
|
|
72
77
|
import { useSizeObserver } from '../../../hooks/use-size-observer'
|
|
73
78
|
import { v4 } from 'uuid'
|
|
74
79
|
import { ButtonColors } from './types'
|
|
75
80
|
import { transformOptions } from '../../shared/types'
|
|
76
81
|
import { stringStyleToRecord } from '../../../utils'
|
|
82
|
+
import { textTransform } from '../../../utils/string'
|
|
77
83
|
import { isString } from 'lodash'
|
|
78
84
|
|
|
79
85
|
export default defineComponent({
|
|
@@ -84,49 +90,106 @@ export default defineComponent({
|
|
|
84
90
|
},
|
|
85
91
|
|
|
86
92
|
props: {
|
|
93
|
+
/**
|
|
94
|
+
* The user will not be able to press on the button
|
|
95
|
+
*/
|
|
87
96
|
disabled: Boolean,
|
|
97
|
+
/**
|
|
98
|
+
* The color of the button
|
|
99
|
+
*/
|
|
88
100
|
color: {
|
|
89
|
-
type: String! as PropType<keyof typeof colorNames>,
|
|
101
|
+
type: String! as PropType<keyof typeof colorNames | string>,
|
|
90
102
|
default: ''
|
|
91
103
|
},
|
|
104
|
+
/**
|
|
105
|
+
* The button's padding is lowered and the white space shrinks
|
|
106
|
+
*/
|
|
92
107
|
dense: { type: Boolean, default: false },
|
|
108
|
+
/**
|
|
109
|
+
* The text content of the button
|
|
110
|
+
*/
|
|
93
111
|
label: { type: String, default: '' },
|
|
112
|
+
/**
|
|
113
|
+
* The color of the button's text
|
|
114
|
+
*/
|
|
94
115
|
textColor: { type: String!, default: '' },
|
|
95
116
|
colorsObject: {
|
|
96
117
|
type: Object as PropType<ButtonColors>,
|
|
97
118
|
default: null
|
|
98
119
|
},
|
|
120
|
+
/**
|
|
121
|
+
* The color of the icon inside the button
|
|
122
|
+
*/
|
|
99
123
|
iconColor: { type: String!, default: '' },
|
|
124
|
+
/** Padding inside the button */
|
|
100
125
|
padding: { type: String, default: '' },
|
|
126
|
+
/**
|
|
127
|
+
* The size of the button, it can be s,m,l or xl
|
|
128
|
+
*/
|
|
101
129
|
margin: { type: String, default: '0 auto' },
|
|
102
130
|
size: { type: String! as PropType<ButtonSizes>, default: 'm' },
|
|
131
|
+
/**
|
|
132
|
+
* The assigned color will fill the entirety of the button
|
|
133
|
+
*/
|
|
103
134
|
filled: { type: Boolean, default: true },
|
|
135
|
+
/** Makes the button rounded */
|
|
104
136
|
round: { type: Boolean, default: false },
|
|
105
|
-
|
|
137
|
+
/**
|
|
138
|
+
* The width of the button will take that of its container
|
|
139
|
+
*/
|
|
106
140
|
fluid: Boolean,
|
|
141
|
+
/**
|
|
142
|
+
* The button will not have an outline
|
|
143
|
+
*/
|
|
107
144
|
flat: Boolean,
|
|
145
|
+
/**
|
|
146
|
+
* All the characters inside the button will be uppercase
|
|
147
|
+
*/
|
|
148
|
+
uppercase: Boolean,
|
|
149
|
+
/**
|
|
150
|
+
* The button will be transparent with a colored outline
|
|
151
|
+
*/
|
|
108
152
|
transform: {
|
|
109
153
|
type: String,
|
|
110
154
|
default: 'default',
|
|
111
155
|
validator: (value: string): boolean =>
|
|
112
156
|
transformOptions.includes(value)
|
|
113
157
|
},
|
|
114
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Doesn't allow the button's text to be wrapped along multiple rows
|
|
160
|
+
*/
|
|
115
161
|
noWrap: Boolean,
|
|
162
|
+
/**
|
|
163
|
+
* The name of the icon to go inside the button
|
|
164
|
+
*/
|
|
116
165
|
icon: { type: String, default: '' },
|
|
117
166
|
overflow: { type: Boolean, default: false, required: false },
|
|
167
|
+
/**
|
|
168
|
+
* The tooltip displayed when hovering over the button
|
|
169
|
+
*/
|
|
118
170
|
tooltip: { type: String, default: null, required: false },
|
|
119
|
-
|
|
171
|
+
/**
|
|
172
|
+
* The button will maintain the styles it has when it's pressed if this prop is active
|
|
173
|
+
*/
|
|
174
|
+
active: { type: Boolean, default: false, required: false },
|
|
175
|
+
styles: { type: [Object, String], default: null },
|
|
176
|
+
shaded: { type: Boolean, default: false },
|
|
177
|
+
outlined: Boolean
|
|
120
178
|
},
|
|
121
179
|
emits: ['click', 'mousedown'],
|
|
122
|
-
setup() {
|
|
180
|
+
setup(props) {
|
|
123
181
|
const buttonLabelRef = ref(null)
|
|
124
182
|
const { hasEllipsis } = useSizeObserver(buttonLabelRef)
|
|
125
183
|
|
|
184
|
+
const buttonClass = computed(() => {
|
|
185
|
+
return props.active ? 'dl-button active-class' : 'dl-button'
|
|
186
|
+
})
|
|
187
|
+
|
|
126
188
|
return {
|
|
127
189
|
uuid: `dl-button-${v4()}`,
|
|
128
190
|
buttonLabelRef,
|
|
129
|
-
isOverflowing: hasEllipsis
|
|
191
|
+
isOverflowing: hasEllipsis,
|
|
192
|
+
buttonClass
|
|
130
193
|
}
|
|
131
194
|
},
|
|
132
195
|
computed: {
|
|
@@ -151,11 +214,10 @@ export default defineComponent({
|
|
|
151
214
|
return setIconSize(this.$props.size)
|
|
152
215
|
},
|
|
153
216
|
hasLabel(): boolean {
|
|
154
|
-
return
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
)
|
|
217
|
+
return !!this.label
|
|
218
|
+
},
|
|
219
|
+
buttonLabel(): string {
|
|
220
|
+
return textTransform(this.label)
|
|
159
221
|
},
|
|
160
222
|
hasIcon(): boolean {
|
|
161
223
|
return typeof this.icon === 'string' && this.icon !== ''
|
|
@@ -230,7 +292,8 @@ export default defineComponent({
|
|
|
230
292
|
disabled: this.disabled,
|
|
231
293
|
flat: this.flat,
|
|
232
294
|
shaded: this.shaded,
|
|
233
|
-
color: this.color
|
|
295
|
+
color: this.color,
|
|
296
|
+
outlined: this.outlined
|
|
234
297
|
}),
|
|
235
298
|
'--dl-button-text-color-hover': setColorOnHover({
|
|
236
299
|
disabled: this.disabled,
|
|
@@ -253,14 +316,24 @@ export default defineComponent({
|
|
|
253
316
|
filled: this.filled,
|
|
254
317
|
color: this.color
|
|
255
318
|
}),
|
|
256
|
-
'--dl-button-text-color-pressed':
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
319
|
+
'--dl-button-text-color-pressed': setTextOnPressed({
|
|
320
|
+
shaded: this.shaded,
|
|
321
|
+
outlined: this.shaded
|
|
322
|
+
}),
|
|
323
|
+
'--dl-button-bg-pressed': setBgOnPressed({
|
|
324
|
+
shaded: this.shaded,
|
|
325
|
+
outlined: this.outlined
|
|
326
|
+
}),
|
|
327
|
+
'--dl-button-border-pressed': setBorderOnPressed({
|
|
328
|
+
shaded: this.shaded,
|
|
329
|
+
outlined: this.outlined
|
|
330
|
+
})
|
|
260
331
|
}
|
|
261
332
|
}
|
|
262
333
|
|
|
263
334
|
return {
|
|
335
|
+
'--dl-button-transition-duration': 'all ease 0.15s',
|
|
336
|
+
'--dl-button-text-transition-duration': 'all ease 0.05s',
|
|
264
337
|
'--dl-button-container-width': this.fluid ? '100%' : 'auto',
|
|
265
338
|
'--dl-button-padding': this.dense
|
|
266
339
|
? '0'
|
|
@@ -304,7 +377,7 @@ export default defineComponent({
|
|
|
304
377
|
},
|
|
305
378
|
onMouseDown(e: Event) {
|
|
306
379
|
if (this.isActionable) {
|
|
307
|
-
if (e
|
|
380
|
+
if (e) {
|
|
308
381
|
if (e.defaultPrevented === true) {
|
|
309
382
|
return
|
|
310
383
|
}
|
|
@@ -343,27 +416,28 @@ export default defineComponent({
|
|
|
343
416
|
align-items: stretch;
|
|
344
417
|
position: relative;
|
|
345
418
|
vertical-align: middle;
|
|
346
|
-
transition:
|
|
419
|
+
transition: var(--dl-button-transition-duration);
|
|
347
420
|
justify-content: center;
|
|
348
421
|
|
|
349
422
|
&:active {
|
|
350
|
-
transition:
|
|
423
|
+
transition: var(--dl-button-transition-duration);
|
|
351
424
|
color: var(--dl-button-text-color-pressed) !important;
|
|
352
425
|
background-color: var(--dl-button-bg-pressed) !important;
|
|
353
426
|
border-color: var(--dl-button-border-pressed) !important;
|
|
354
427
|
|
|
355
428
|
& > span > i {
|
|
356
|
-
transition:
|
|
429
|
+
transition: var(--dl-button-text-transition-duration);
|
|
357
430
|
}
|
|
358
431
|
}
|
|
359
432
|
|
|
360
433
|
&:hover:enabled:not(:active) {
|
|
434
|
+
transition: var(--dl-button-transition-duration);
|
|
361
435
|
color: var(--dl-button-text-color-hover);
|
|
362
436
|
background-color: var(--dl-button-bg-hover);
|
|
363
437
|
border-color: var(--dl-button-border-hover);
|
|
364
438
|
|
|
365
439
|
& .dl-button-label {
|
|
366
|
-
transition:
|
|
440
|
+
transition: var(--dl-button-text-transition-duration);
|
|
367
441
|
color: var(--dl-button-color-hover);
|
|
368
442
|
}
|
|
369
443
|
}
|
|
@@ -383,7 +457,11 @@ export default defineComponent({
|
|
|
383
457
|
gap: var(--dl-button-content-gap, 7px);
|
|
384
458
|
}
|
|
385
459
|
|
|
386
|
-
.dl-
|
|
460
|
+
.dl-button-icon {
|
|
461
|
+
transition: var(--dl-button-text-transition-duration);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.dl-button-container.first-letter-capitalized {
|
|
387
465
|
&::first-letter,
|
|
388
466
|
& > *::first-letter {
|
|
389
467
|
text-transform: capitalize;
|
|
@@ -394,4 +472,16 @@ export default defineComponent({
|
|
|
394
472
|
display: inline-block;
|
|
395
473
|
width: var(--dl-button-container-width);
|
|
396
474
|
}
|
|
475
|
+
|
|
476
|
+
.active-class {
|
|
477
|
+
color: var(--dl-button-text-color-hover);
|
|
478
|
+
background-color: var(--dl-button-bg-hover);
|
|
479
|
+
border-color: var(--dl-button-border-hover);
|
|
480
|
+
transition: var(--dl-button-transition-duration);
|
|
481
|
+
|
|
482
|
+
& .dl-button-label {
|
|
483
|
+
color: var(--dl-button-color-hover);
|
|
484
|
+
transition: var(--dl-button-text-transition-duration);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
397
487
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getColor } from '../../../utils'
|
|
2
2
|
import { getLighterGradient } from '../../../utils/getLighterGradient'
|
|
3
3
|
|
|
4
|
-
export type ButtonSizes = 's' | 'm' | 'l' | 'xl'
|
|
4
|
+
export type ButtonSizes = 's' | 'm' | 'l' | ('xl' & string)
|
|
5
5
|
|
|
6
6
|
const paddings = {
|
|
7
7
|
s: '7px 16px',
|
|
@@ -70,6 +70,9 @@ export const setTextColor = ({
|
|
|
70
70
|
if (disabled) {
|
|
71
71
|
return getColor('', 'dl-color-disabled')
|
|
72
72
|
}
|
|
73
|
+
if (shaded && outlined) {
|
|
74
|
+
return getColor(textColor, 'dl-color-text-darker-buttons')
|
|
75
|
+
}
|
|
73
76
|
if (outlined) {
|
|
74
77
|
return getColor(textColor, 'dl-color-secondary')
|
|
75
78
|
}
|
|
@@ -111,13 +114,17 @@ export const setBorder = ({
|
|
|
111
114
|
disabled,
|
|
112
115
|
flat,
|
|
113
116
|
color = '',
|
|
114
|
-
shaded
|
|
117
|
+
shaded,
|
|
118
|
+
outlined
|
|
115
119
|
}: Partial<DlButtonProps>) => {
|
|
116
120
|
if (disabled) {
|
|
117
121
|
return flat
|
|
118
122
|
? 'var(--dl-color-transparent)'
|
|
119
123
|
: 'var(--dl-color-separator)'
|
|
120
124
|
}
|
|
125
|
+
if (shaded && outlined) {
|
|
126
|
+
return 'var(--dl-color-separator)'
|
|
127
|
+
}
|
|
121
128
|
if (flat || shaded) {
|
|
122
129
|
return 'var(--dl-color-transparent)'
|
|
123
130
|
}
|
|
@@ -177,3 +184,39 @@ export const setBgOnHover = ({
|
|
|
177
184
|
|
|
178
185
|
return 'var(--dl-color-panel-background)'
|
|
179
186
|
}
|
|
187
|
+
|
|
188
|
+
export const setBgOnPressed = ({
|
|
189
|
+
shaded,
|
|
190
|
+
outlined
|
|
191
|
+
}: Partial<DlButtonProps>) => {
|
|
192
|
+
if (shaded && outlined) {
|
|
193
|
+
return 'var(--dl-color-text-buttons)'
|
|
194
|
+
}
|
|
195
|
+
if (shaded) {
|
|
196
|
+
return 'var(--dl-color-secondary)'
|
|
197
|
+
}
|
|
198
|
+
return 'var(--dl-button-bg)'
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export const setTextOnPressed = ({
|
|
202
|
+
shaded,
|
|
203
|
+
outlined
|
|
204
|
+
}: Partial<DlButtonProps>) => {
|
|
205
|
+
if (shaded && outlined) {
|
|
206
|
+
return 'var(--dl-color-secondary)'
|
|
207
|
+
}
|
|
208
|
+
if (shaded) {
|
|
209
|
+
return 'var(--dl-color-text-buttons)'
|
|
210
|
+
}
|
|
211
|
+
return 'var(--dl-button-text-color)'
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export const setBorderOnPressed = ({
|
|
215
|
+
shaded,
|
|
216
|
+
outlined
|
|
217
|
+
}: Partial<DlButtonProps>) => {
|
|
218
|
+
if (shaded && outlined) {
|
|
219
|
+
return 'var(--dl-color-secondary)'
|
|
220
|
+
}
|
|
221
|
+
return 'var(--dl-button-border)'
|
|
222
|
+
}
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
|
|
51
51
|
<script lang="ts">
|
|
52
52
|
import { defineComponent, ref } from 'vue-demi'
|
|
53
|
-
import {
|
|
53
|
+
import { DlTooltip } from '../../shared'
|
|
54
|
+
import { DlIcon } from '../../essential'
|
|
54
55
|
import { useSizeObserver } from '../../../hooks/use-size-observer'
|
|
55
56
|
import {
|
|
56
57
|
setTextColor,
|
|
@@ -106,11 +107,7 @@ export default defineComponent({
|
|
|
106
107
|
},
|
|
107
108
|
computed: {
|
|
108
109
|
hasLabel(): boolean {
|
|
109
|
-
return
|
|
110
|
-
this.label !== void 0 &&
|
|
111
|
-
this.label !== null &&
|
|
112
|
-
this.label !== ''
|
|
113
|
-
)
|
|
110
|
+
return !!this.label
|
|
114
111
|
},
|
|
115
112
|
hasLabelSlot(): boolean {
|
|
116
113
|
return !!this.$slots['default']
|
|
@@ -220,7 +217,6 @@ export default defineComponent({
|
|
|
220
217
|
text-overflow: ellipsis;
|
|
221
218
|
white-space: nowrap;
|
|
222
219
|
overflow: hidden;
|
|
223
|
-
padding: 3px 5px 3px 5px;
|
|
224
220
|
}
|
|
225
221
|
}
|
|
226
222
|
|
|
@@ -59,17 +59,17 @@ export const setPadding = ({
|
|
|
59
59
|
const right = removable ? 20 : 5
|
|
60
60
|
|
|
61
61
|
if (hasLabel && (removable || hasIcon)) {
|
|
62
|
-
return `
|
|
62
|
+
return `5px ${right}px 5px ${left}px`
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
if (!hasLabel && hasIcon && removable) {
|
|
66
|
-
return `
|
|
66
|
+
return `5px ${right}px 5px 0`
|
|
67
67
|
}
|
|
68
68
|
if (removable || hasIcon) {
|
|
69
|
-
return '
|
|
69
|
+
return '5px 0'
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
return '
|
|
72
|
+
return '5px'
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export const setRemoveIconWidth = ({
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="wrapper"
|
|
4
|
+
class="container-wrapper"
|
|
5
|
+
>
|
|
6
|
+
<div
|
|
7
|
+
:id="uuid"
|
|
8
|
+
ref="container"
|
|
9
|
+
:class="containerStyles"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
v-if="hasHeaderSlot"
|
|
13
|
+
class="dl-container__header"
|
|
14
|
+
>
|
|
15
|
+
<slot name="header" />
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="dl-container__content">
|
|
19
|
+
<slot />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
import { v4 } from 'uuid'
|
|
26
|
+
import { defineComponent } from 'vue-demi'
|
|
27
|
+
|
|
28
|
+
export default defineComponent({
|
|
29
|
+
name: 'DlContainer',
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
uuid: `dl-container-${v4()}`
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
containerStyles() {
|
|
37
|
+
return 'dl-container'
|
|
38
|
+
},
|
|
39
|
+
hasHeaderSlot(): boolean {
|
|
40
|
+
return this.$slots.header !== undefined
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style lang="scss" scoped>
|
|
47
|
+
.dl-container {
|
|
48
|
+
border: 1px solid var(--dl-color-separator);
|
|
49
|
+
user-select: none;
|
|
50
|
+
height: 100%;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
&__header {
|
|
54
|
+
display: flex;
|
|
55
|
+
padding: 10px;
|
|
56
|
+
border-bottom: 1px solid var(--dl-color-separator);
|
|
57
|
+
}
|
|
58
|
+
&__content {
|
|
59
|
+
padding: 10px;
|
|
60
|
+
height: 100%;
|
|
61
|
+
overflow-y: auto;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.container-wrapper {
|
|
66
|
+
flex-basis: var(--container-flex-basis);
|
|
67
|
+
margin: var(--row-gap) var(--column-gap);
|
|
68
|
+
height: 100%;
|
|
69
|
+
}
|
|
70
|
+
</style>
|