@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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Ref, ref } from 'vue-demi'
|
|
2
2
|
import { splitByQuotes } from '../utils/splitByQuotes'
|
|
3
|
+
import { flatten } from 'flat'
|
|
4
|
+
import { isObject } from 'lodash'
|
|
3
5
|
|
|
4
6
|
export type Schema = {
|
|
5
7
|
[key: string]:
|
|
@@ -50,6 +52,15 @@ const operatorToDataTypeMap: OperatorToDataTypeMap = {
|
|
|
50
52
|
$nin: []
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
const knownDataTypes = [
|
|
56
|
+
'number',
|
|
57
|
+
'boolean',
|
|
58
|
+
'string',
|
|
59
|
+
'date',
|
|
60
|
+
'datetime',
|
|
61
|
+
'time'
|
|
62
|
+
]
|
|
63
|
+
|
|
53
64
|
type Suggestion = string
|
|
54
65
|
|
|
55
66
|
type Expression = {
|
|
@@ -60,36 +71,86 @@ type Expression = {
|
|
|
60
71
|
}
|
|
61
72
|
|
|
62
73
|
const space = ' '
|
|
63
|
-
const
|
|
64
|
-
const dateEndSuggestionString = '(To dd/mm/yyyy)'
|
|
65
|
-
const dateIntervalSuggestionString = '(From (dd/mm/yyyy) To (dd/mm/yyyy))'
|
|
74
|
+
const dateSuggestionPattern = '(dd/mm/yyyy)'
|
|
66
75
|
|
|
67
76
|
let localSuggestions: Suggestion[] = []
|
|
68
77
|
|
|
69
|
-
export const
|
|
70
|
-
/(
|
|
71
|
-
'gi'
|
|
72
|
-
)
|
|
73
|
-
export const endDatePattern = new RegExp(
|
|
74
|
-
/(to\s?\d{2}\/\d{2}\/\d{4}\s?|to\s?dd\/mm\/yyyy\s?)/,
|
|
75
|
-
'gi'
|
|
76
|
-
)
|
|
77
|
-
export const dateIntervalPattern = new RegExp(
|
|
78
|
-
/(from\s?\d{2}\/\d{2}\/\d{4}\s?to\s?\d{2}\/\d{2}\/\d{4})|(from\s?dd\/mm\/yyyy\s?to\s?dd\/mm\/yyyy)/,
|
|
78
|
+
export const datePattern = new RegExp(
|
|
79
|
+
/([\(']?\d{2}\/\d{2}\/\d{4}[\)']?\s?|\s?\(dd\/mm\/yyyy\)\s?)/,
|
|
79
80
|
'gi'
|
|
80
81
|
)
|
|
82
|
+
export const datePatternNoBrackets =
|
|
83
|
+
/(\d{2}\/\d{2}\/\d{4}\s?|\s?dd\/mm\/yyyy\s?)/
|
|
84
|
+
|
|
85
|
+
const mergeWords = (words: string[]) => {
|
|
86
|
+
const result: string[] = []
|
|
87
|
+
let merging = false
|
|
88
|
+
let mergeIndex = -1
|
|
89
|
+
|
|
90
|
+
for (let i = 0; i < words.length; ++i) {
|
|
91
|
+
const currentItem = words[i]
|
|
92
|
+
|
|
93
|
+
if (currentItem === 'IN' || currentItem === 'NOT-IN') {
|
|
94
|
+
merging = true
|
|
95
|
+
mergeIndex = i + 1
|
|
96
|
+
result.push(currentItem)
|
|
97
|
+
continue
|
|
98
|
+
} else if (
|
|
99
|
+
Object.values(Logical).includes(currentItem as any) ||
|
|
100
|
+
Object.values(operators).includes(currentItem as any)
|
|
101
|
+
) {
|
|
102
|
+
merging = false
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (merging) {
|
|
106
|
+
if (!result[mergeIndex]) {
|
|
107
|
+
result[mergeIndex] = ''
|
|
108
|
+
}
|
|
109
|
+
result[mergeIndex] += ' ' + currentItem
|
|
110
|
+
continue
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
result.push(currentItem)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return result
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const useSuggestions = (
|
|
120
|
+
schema: Schema,
|
|
121
|
+
aliases: Alias[],
|
|
122
|
+
options: { strict?: Ref<boolean> } = {}
|
|
123
|
+
) => {
|
|
124
|
+
const { strict } = options
|
|
125
|
+
const initialSuggestions = Object.keys(schema)
|
|
126
|
+
const aliasedKeys = aliases.map((alias) => alias.key)
|
|
127
|
+
const aliasedSuggestions = initialSuggestions.map((suggestion) =>
|
|
128
|
+
aliasedKeys.includes(suggestion)
|
|
129
|
+
? aliases.find((alias) => alias.key === suggestion)?.alias
|
|
130
|
+
: suggestion
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
for (const alias of aliases) {
|
|
134
|
+
if (aliasedSuggestions.includes(alias.alias)) {
|
|
135
|
+
continue
|
|
136
|
+
}
|
|
137
|
+
aliasedSuggestions.push(alias.alias)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const sortString = (a: string, b: string) =>
|
|
141
|
+
a.localeCompare(b, undefined, { sensitivity: 'base' })
|
|
142
|
+
const sortedSuggestions = aliasedSuggestions.sort(sortString)
|
|
81
143
|
|
|
82
|
-
|
|
83
|
-
const initialSuggestions = aliases.map((alias) => alias.alias)
|
|
84
|
-
const suggestions: Ref<Suggestion[]> = ref(initialSuggestions)
|
|
144
|
+
const suggestions: Ref<Suggestion[]> = ref(sortedSuggestions)
|
|
85
145
|
const error: Ref<string | null> = ref(null)
|
|
86
146
|
|
|
87
147
|
const findSuggestions = (input: string) => {
|
|
88
148
|
input = input.replace(/\s+/g, ' ').trimStart()
|
|
89
|
-
localSuggestions =
|
|
149
|
+
localSuggestions = sortedSuggestions
|
|
90
150
|
|
|
91
151
|
const words = splitByQuotes(input, space)
|
|
92
|
-
const
|
|
152
|
+
const mergedWords = mergeWords(words)
|
|
153
|
+
const expressions = mapWordsToExpressions(mergedWords)
|
|
93
154
|
|
|
94
155
|
for (const { field, operator, value, keyword } of expressions) {
|
|
95
156
|
let matchedField: Suggestion | null = null
|
|
@@ -98,33 +159,67 @@ export const useSuggestions = (schema: Schema, aliases: Alias[]) => {
|
|
|
98
159
|
|
|
99
160
|
if (!field) continue
|
|
100
161
|
|
|
101
|
-
|
|
102
|
-
|
|
162
|
+
const fieldSeparated: any = field.split('.')
|
|
163
|
+
|
|
164
|
+
if (fieldSeparated.length > 1) {
|
|
165
|
+
localSuggestions = []
|
|
166
|
+
matchedField = field
|
|
167
|
+
} else {
|
|
168
|
+
localSuggestions = getMatches(localSuggestions, field)
|
|
169
|
+
matchedField = getMatch(localSuggestions, field)
|
|
170
|
+
}
|
|
103
171
|
|
|
104
172
|
if (!matchedField && isNextCharSpace(input, field)) {
|
|
105
173
|
localSuggestions = []
|
|
106
174
|
continue
|
|
107
175
|
}
|
|
108
176
|
|
|
109
|
-
if (
|
|
177
|
+
if (
|
|
178
|
+
!matchedField ||
|
|
179
|
+
(!isNextCharSpace(input, matchedField) &&
|
|
180
|
+
fieldSeparated.length === 1)
|
|
181
|
+
) {
|
|
110
182
|
continue
|
|
111
183
|
}
|
|
112
184
|
|
|
113
|
-
const
|
|
114
|
-
if (!alias) continue
|
|
115
|
-
const dataType = getDataTypeByAliasKey(schema, alias.key)
|
|
185
|
+
const dataType = getDataType(schema, aliases, matchedField)
|
|
116
186
|
if (!dataType) {
|
|
117
187
|
localSuggestions = []
|
|
118
188
|
continue
|
|
119
189
|
}
|
|
120
190
|
|
|
191
|
+
if (operator && (!value || value === '')) {
|
|
192
|
+
const valueSuggestion = getValueSuggestions(dataType, operator)
|
|
193
|
+
if (valueSuggestion) {
|
|
194
|
+
localSuggestions = valueSuggestion
|
|
195
|
+
continue
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
121
199
|
const ops: string[] = Array.isArray(dataType)
|
|
122
200
|
? getGenericOperators()
|
|
123
201
|
: getOperatorByDataType(dataType)
|
|
124
202
|
|
|
125
203
|
localSuggestions = getOperators(ops)
|
|
126
204
|
|
|
127
|
-
if (!operator)
|
|
205
|
+
if (!operator) {
|
|
206
|
+
const dotSeparated = matchedField.split('.').filter((el) => el)
|
|
207
|
+
let fieldOf = schema
|
|
208
|
+
for (const key of dotSeparated) {
|
|
209
|
+
fieldOf = fieldOf[key] as Schema
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (isObject(fieldOf) && !Array.isArray(fieldOf)) {
|
|
213
|
+
const toConcat: string[] = []
|
|
214
|
+
for (const key of Object.keys(fieldOf)) {
|
|
215
|
+
if (key === '*') continue
|
|
216
|
+
toConcat.push(`.${key}`)
|
|
217
|
+
}
|
|
218
|
+
localSuggestions = localSuggestions.concat(toConcat)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
continue
|
|
222
|
+
}
|
|
128
223
|
|
|
129
224
|
localSuggestions = getMatches(localSuggestions, operator)
|
|
130
225
|
matchedOperator = getMatch(localSuggestions, operator)
|
|
@@ -139,7 +234,9 @@ export const useSuggestions = (schema: Schema, aliases: Alias[]) => {
|
|
|
139
234
|
}
|
|
140
235
|
|
|
141
236
|
if (Array.isArray(dataType)) {
|
|
142
|
-
localSuggestions = dataType
|
|
237
|
+
localSuggestions = dataType.filter(
|
|
238
|
+
(type) => !knownDataTypes.includes(type)
|
|
239
|
+
)
|
|
143
240
|
|
|
144
241
|
if (!value) continue
|
|
145
242
|
|
|
@@ -149,11 +246,7 @@ export const useSuggestions = (schema: Schema, aliases: Alias[]) => {
|
|
|
149
246
|
dataType === 'date' ||
|
|
150
247
|
dataType === 'time'
|
|
151
248
|
) {
|
|
152
|
-
localSuggestions = [
|
|
153
|
-
dateIntervalSuggestionString,
|
|
154
|
-
dateStartSuggestionString,
|
|
155
|
-
dateEndSuggestionString
|
|
156
|
-
]
|
|
249
|
+
localSuggestions = [dateSuggestionPattern]
|
|
157
250
|
|
|
158
251
|
if (!value) continue
|
|
159
252
|
|
|
@@ -176,11 +269,11 @@ export const useSuggestions = (schema: Schema, aliases: Alias[]) => {
|
|
|
176
269
|
if (!matchedKeyword || !isNextCharSpace(input, matchedKeyword))
|
|
177
270
|
continue
|
|
178
271
|
|
|
179
|
-
localSuggestions =
|
|
272
|
+
localSuggestions = sortedSuggestions
|
|
180
273
|
}
|
|
181
274
|
|
|
182
275
|
error.value = input.length
|
|
183
|
-
? getError(schema, aliases, expressions)
|
|
276
|
+
? getError(schema, aliases, expressions, { strict })
|
|
184
277
|
: null
|
|
185
278
|
|
|
186
279
|
suggestions.value = localSuggestions
|
|
@@ -194,11 +287,38 @@ const errors = {
|
|
|
194
287
|
INVALID_VALUE: (field: string) => `Invalid value for "${field}" field`
|
|
195
288
|
}
|
|
196
289
|
|
|
290
|
+
const isInputAllowed = (input: string, allowedKeys: string[]): boolean => {
|
|
291
|
+
for (const key of allowedKeys) {
|
|
292
|
+
const keyParts = key.split('.')
|
|
293
|
+
const inputParts = input.split('.')
|
|
294
|
+
|
|
295
|
+
if (keyParts.length > inputParts.length) {
|
|
296
|
+
continue
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
let isMatch = true
|
|
300
|
+
for (let i = 0; i < keyParts.length; i++) {
|
|
301
|
+
if (keyParts[i] !== '*' && keyParts[i] !== inputParts[i]) {
|
|
302
|
+
isMatch = false
|
|
303
|
+
break
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (isMatch) {
|
|
308
|
+
return true
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return false
|
|
313
|
+
}
|
|
314
|
+
|
|
197
315
|
const getError = (
|
|
198
316
|
schema: Schema,
|
|
199
317
|
aliases: Alias[],
|
|
200
|
-
expressions: Expression[]
|
|
318
|
+
expressions: Expression[],
|
|
319
|
+
options: { strict?: Ref<boolean> } = {}
|
|
201
320
|
): string | null => {
|
|
321
|
+
const { strict } = options
|
|
202
322
|
const hasErrorInStructure = expressions
|
|
203
323
|
.flatMap((exp) => Object.values(exp))
|
|
204
324
|
.some((el, index, arr) => {
|
|
@@ -214,11 +334,29 @@ const getError = (
|
|
|
214
334
|
.filter(({ field, value }) => field !== null && value !== null)
|
|
215
335
|
.reduce<string | null>((acc, { field, value, operator }, _, arr) => {
|
|
216
336
|
if (acc === 'warning') return acc
|
|
217
|
-
const
|
|
218
|
-
|
|
337
|
+
const key: string = getAliasObjByAlias(aliases, field)?.key ?? field
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Handle nested keys to validate if the key exists in the schema or not.
|
|
341
|
+
*/
|
|
342
|
+
const keys: string[] = []
|
|
343
|
+
for (const key of Object.keys(schema)) {
|
|
344
|
+
if (isObject(schema[key]) && !Array.isArray(schema[key])) {
|
|
345
|
+
const flattened = flatten({ [key]: schema[key] })
|
|
346
|
+
keys.push(...Object.keys(flattened))
|
|
347
|
+
} else {
|
|
348
|
+
keys.push(key)
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
const isValid = isInputAllowed(key, keys)
|
|
353
|
+
if (!keys.includes(key) && !isValid) {
|
|
354
|
+
return strict.value ? errors.INVALID_EXPRESSION : 'warning'
|
|
355
|
+
}
|
|
356
|
+
|
|
219
357
|
const valid = isValidByDataType(
|
|
220
358
|
validateBracketValues(value),
|
|
221
|
-
|
|
359
|
+
getDataType(schema, aliases, key),
|
|
222
360
|
operator
|
|
223
361
|
)
|
|
224
362
|
|
|
@@ -236,8 +374,16 @@ const isValidByDataType = (
|
|
|
236
374
|
dataType: string | string[],
|
|
237
375
|
operator: string // TODO: use operator
|
|
238
376
|
): boolean => {
|
|
377
|
+
if (dataType === 'any') {
|
|
378
|
+
return true
|
|
379
|
+
}
|
|
380
|
+
|
|
239
381
|
if (Array.isArray(dataType)) {
|
|
240
|
-
|
|
382
|
+
let isOneOf = !!getValueMatch(dataType, str)
|
|
383
|
+
for (const type of dataType) {
|
|
384
|
+
isOneOf = isOneOf || isValidByDataType(str, type, operator)
|
|
385
|
+
}
|
|
386
|
+
return isOneOf
|
|
241
387
|
}
|
|
242
388
|
|
|
243
389
|
switch (dataType) {
|
|
@@ -261,11 +407,7 @@ const validateBracketValues = (value: string) => {
|
|
|
261
407
|
}
|
|
262
408
|
|
|
263
409
|
const isValidDateIntervalPattern = (str: string) => {
|
|
264
|
-
return (
|
|
265
|
-
!!str.match(dateIntervalPattern) ||
|
|
266
|
-
!!str.match(startDatePattern) ||
|
|
267
|
-
!!str.match(endDatePattern)
|
|
268
|
-
)
|
|
410
|
+
return !!str.match(datePatternNoBrackets)
|
|
269
411
|
}
|
|
270
412
|
|
|
271
413
|
const isValidNumber = (str: string) => {
|
|
@@ -283,10 +425,18 @@ const isValidString = (str: string) => {
|
|
|
283
425
|
}
|
|
284
426
|
|
|
285
427
|
const getOperatorByDataType = (dataType: string) => {
|
|
286
|
-
|
|
428
|
+
if (dataType === 'boolean') return ['$eq', '$neq']
|
|
429
|
+
|
|
430
|
+
if (dataType === 'object') {
|
|
431
|
+
return []
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
const operators = Object.keys(operatorToDataTypeMap).filter((key) => {
|
|
287
435
|
const value = operatorToDataTypeMap[key]
|
|
288
436
|
return value.length === 0 || value.includes(dataType)
|
|
289
437
|
})
|
|
438
|
+
|
|
439
|
+
return operators
|
|
290
440
|
}
|
|
291
441
|
|
|
292
442
|
const getOperators = (op: string[]) => op.map((o) => operators[o])
|
|
@@ -300,22 +450,32 @@ const mapWordsToExpression = (words: string[]): Expression => {
|
|
|
300
450
|
}
|
|
301
451
|
}
|
|
302
452
|
|
|
303
|
-
const
|
|
453
|
+
const getDataType = (
|
|
304
454
|
schema: Schema,
|
|
455
|
+
aliases: Alias[],
|
|
305
456
|
key: string
|
|
306
457
|
): string | string[] | null => {
|
|
307
|
-
const
|
|
458
|
+
const aliasedKey = getAliasObjByAlias(aliases, key)?.key ?? key
|
|
308
459
|
|
|
309
|
-
|
|
310
|
-
return (schema[nestedKey[0]] as string | string[]) ?? null
|
|
311
|
-
}
|
|
460
|
+
const nestedKey = aliasedKey.split('.').filter((el) => el)
|
|
312
461
|
|
|
313
462
|
let value = schema[nestedKey[0]] as Schema
|
|
463
|
+
if (!value) return null
|
|
464
|
+
|
|
314
465
|
for (let i = 1; i < nestedKey.length; i++) {
|
|
466
|
+
if (!value) return null
|
|
467
|
+
|
|
315
468
|
const nextKey = nestedKey[i]
|
|
469
|
+
if (!value[nextKey] && value['*']) {
|
|
470
|
+
return 'any'
|
|
471
|
+
}
|
|
316
472
|
value = (value[nextKey] as Schema) ?? null
|
|
317
473
|
}
|
|
318
474
|
|
|
475
|
+
if (isObject(value) && !Array.isArray(value)) {
|
|
476
|
+
return 'object'
|
|
477
|
+
}
|
|
478
|
+
|
|
319
479
|
return value as unknown as string | string[] | null
|
|
320
480
|
}
|
|
321
481
|
|
|
@@ -381,3 +541,33 @@ export const removeBrackets = (str: string) => {
|
|
|
381
541
|
const removeQuotes = (str: string) => {
|
|
382
542
|
return str.replaceAll('"', '').replaceAll("'", '')
|
|
383
543
|
}
|
|
544
|
+
|
|
545
|
+
const getValueSuggestions = (dataType: string | string[], operator: string) => {
|
|
546
|
+
const types: string[] = Array.isArray(dataType) ? dataType : [dataType]
|
|
547
|
+
const suggestion: string[] = []
|
|
548
|
+
|
|
549
|
+
if (Array.isArray(dataType)) {
|
|
550
|
+
suggestion.push(
|
|
551
|
+
...dataType.filter((type) => !knownDataTypes.includes(type))
|
|
552
|
+
)
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
for (const type of types) {
|
|
556
|
+
switch (type) {
|
|
557
|
+
case 'boolean':
|
|
558
|
+
if (operator === '=' || operator === '!=') {
|
|
559
|
+
suggestion.push('true', 'false')
|
|
560
|
+
}
|
|
561
|
+
break
|
|
562
|
+
case 'date':
|
|
563
|
+
case 'time':
|
|
564
|
+
case 'datetime':
|
|
565
|
+
suggestion.push(dateSuggestionPattern)
|
|
566
|
+
default:
|
|
567
|
+
// do nothing
|
|
568
|
+
break
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
return suggestion
|
|
573
|
+
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computed, watch, nextTick, Ref } from 'vue-demi'
|
|
2
2
|
|
|
3
3
|
export const useTransitionProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The duration of the transition in milliseconds.
|
|
6
|
+
* @default 300
|
|
7
|
+
* @type {number}
|
|
8
|
+
*
|
|
9
|
+
* Disabled for Vue2
|
|
10
|
+
*/
|
|
4
11
|
transitionDuration: {
|
|
5
12
|
type: Number,
|
|
6
13
|
default: 300
|
|
@@ -13,11 +20,10 @@ export default function (
|
|
|
13
20
|
},
|
|
14
21
|
showing: Ref<boolean>
|
|
15
22
|
) {
|
|
16
|
-
const transitionState = ref(showing.value)
|
|
17
|
-
|
|
18
23
|
watch(showing, (val) => {
|
|
19
24
|
nextTick(() => {
|
|
20
|
-
|
|
25
|
+
if (showing.value === val) return
|
|
26
|
+
showing.value = val
|
|
21
27
|
})
|
|
22
28
|
})
|
|
23
29
|
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
import { install } from 'vue-demi'
|
|
1
|
+
import { computed, install, reactive } from 'vue-demi'
|
|
2
2
|
|
|
3
3
|
install()
|
|
4
4
|
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
window.DlComponents = window.DlComponents || {
|
|
7
|
+
state: reactive({}),
|
|
8
|
+
setTheme: (theme: 'light' | 'dark') => {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
window.DlComponents.state.theme = theme
|
|
11
|
+
},
|
|
12
|
+
get theme(): 'light' | 'dark' {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
return window.DlComponents.state.theme
|
|
15
|
+
},
|
|
16
|
+
isDark: computed(() => {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
return window.DlComponents.state.theme === 'dark'
|
|
19
|
+
}),
|
|
20
|
+
isLight: computed(() => {
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
return window.DlComponents.state.theme === 'light'
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
5
26
|
export * from './components'
|
|
6
27
|
import DlComponentsDemo from './App.vue'
|
|
7
28
|
export { DlComponentsDemo }
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="footer-content">
|
|
3
|
+
<div style="width: 300px">
|
|
4
|
+
<DlSlider
|
|
5
|
+
text="Thumb size"
|
|
6
|
+
editable
|
|
7
|
+
/>
|
|
8
|
+
</div>
|
|
9
|
+
<div style="width: 100%; display: flex; padding-left: 20px">
|
|
10
|
+
<dl-pagination
|
|
11
|
+
v-model="page"
|
|
12
|
+
:rows-per-page="rowsPerPage"
|
|
13
|
+
:boundary-numbers="boundaryNumbers"
|
|
14
|
+
:boundary-links="boundaryLinks"
|
|
15
|
+
:direction-links="directionLinks"
|
|
16
|
+
:max-pages="maxPages"
|
|
17
|
+
:disabled="disabled"
|
|
18
|
+
:with-legend="withLegend"
|
|
19
|
+
:total-items="total"
|
|
20
|
+
:items-name="itemsName"
|
|
21
|
+
:with-quick-navigation="withQuickNavigation"
|
|
22
|
+
:with-rows-per-page="withRowsPerPage"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
import { defineComponent, ref } from 'vue-demi'
|
|
30
|
+
import { DlSlider, DlPagination } from '../../../components'
|
|
31
|
+
|
|
32
|
+
export default defineComponent({
|
|
33
|
+
name: 'DatasetFooter',
|
|
34
|
+
components: {
|
|
35
|
+
DlSlider,
|
|
36
|
+
DlPagination
|
|
37
|
+
},
|
|
38
|
+
setup() {
|
|
39
|
+
const page = ref(18)
|
|
40
|
+
const rowsPerPage = ref(10)
|
|
41
|
+
const boundaryNumbers = ref(true)
|
|
42
|
+
const boundaryLinks = ref(true)
|
|
43
|
+
const directionLinks = ref(true)
|
|
44
|
+
const maxPages = ref(6)
|
|
45
|
+
const disabled = ref(false)
|
|
46
|
+
const withLegend = ref(true)
|
|
47
|
+
const total = ref(200)
|
|
48
|
+
const itemsName = ref('Rows')
|
|
49
|
+
const withQuickNavigation = ref(true)
|
|
50
|
+
const withRowsPerPage = ref(true)
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
page,
|
|
54
|
+
rowsPerPage,
|
|
55
|
+
boundaryNumbers,
|
|
56
|
+
boundaryLinks,
|
|
57
|
+
directionLinks,
|
|
58
|
+
maxPages,
|
|
59
|
+
disabled,
|
|
60
|
+
withLegend,
|
|
61
|
+
total,
|
|
62
|
+
itemsName,
|
|
63
|
+
withQuickNavigation,
|
|
64
|
+
withRowsPerPage
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style scoped lang="scss">
|
|
71
|
+
.footer-content {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
height: 40px;
|
|
75
|
+
padding: 0 15px 0 15px;
|
|
76
|
+
gap: 20px;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<navbar-kpi />
|
|
4
|
+
<navbar-search />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { defineComponent } from 'vue-demi'
|
|
10
|
+
import NavbarKpi from './NavbarKpi.vue'
|
|
11
|
+
import NavbarSearch from './NavbarSearch.vue'
|
|
12
|
+
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
name: 'DatasetHeader',
|
|
15
|
+
components: {
|
|
16
|
+
NavbarKpi,
|
|
17
|
+
NavbarSearch
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="left-drawer-content"
|
|
4
|
+
:style="cssVars"
|
|
5
|
+
>
|
|
6
|
+
<div style="padding: 10px">
|
|
7
|
+
<div class="left-drawer-content__toggle-icon">
|
|
8
|
+
<dl-button
|
|
9
|
+
flat
|
|
10
|
+
color="secondary"
|
|
11
|
+
:icon="expandIcon"
|
|
12
|
+
@click="onToggle"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
<div style="padding: 40px 0 10px">
|
|
16
|
+
<dl-typography
|
|
17
|
+
size="12px"
|
|
18
|
+
color="dl-color-dark"
|
|
19
|
+
>
|
|
20
|
+
Search in:
|
|
21
|
+
</dl-typography>
|
|
22
|
+
</div>
|
|
23
|
+
<dl-radio
|
|
24
|
+
v-model="checkModel"
|
|
25
|
+
label="All Dataset items"
|
|
26
|
+
:value="1"
|
|
27
|
+
/>
|
|
28
|
+
<dl-radio
|
|
29
|
+
v-model="checkModel"
|
|
30
|
+
label="Folders"
|
|
31
|
+
:value="2"
|
|
32
|
+
/>
|
|
33
|
+
<dl-radio
|
|
34
|
+
v-model="checkModel"
|
|
35
|
+
label="Tasks"
|
|
36
|
+
:value="3"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script lang="ts">
|
|
43
|
+
import { computed, defineComponent, ref } from 'vue-demi'
|
|
44
|
+
import { DlRadio, DlTypography, DlButton } from '../../../components'
|
|
45
|
+
|
|
46
|
+
export default defineComponent({
|
|
47
|
+
name: 'DatasetLeftDrawer',
|
|
48
|
+
components: {
|
|
49
|
+
DlRadio,
|
|
50
|
+
DlTypography,
|
|
51
|
+
DlButton
|
|
52
|
+
},
|
|
53
|
+
setup() {
|
|
54
|
+
const LARGE_WIDTH = '300px'
|
|
55
|
+
const SMALL_WIDTH = '50px'
|
|
56
|
+
const leftDrawerContentWidth = ref(LARGE_WIDTH)
|
|
57
|
+
const isExpanded = ref(true)
|
|
58
|
+
const checkModel = ref('')
|
|
59
|
+
|
|
60
|
+
const onToggle = () => {
|
|
61
|
+
isExpanded.value = !isExpanded.value
|
|
62
|
+
leftDrawerContentWidth.value = isExpanded.value
|
|
63
|
+
? LARGE_WIDTH
|
|
64
|
+
: SMALL_WIDTH
|
|
65
|
+
}
|
|
66
|
+
const expandIcon = computed(() =>
|
|
67
|
+
isExpanded.value ? 'icon-dl-expand' : 'icon-dl-collapse'
|
|
68
|
+
)
|
|
69
|
+
const cssVars = computed(() => {
|
|
70
|
+
return {
|
|
71
|
+
'--left-drawer-content-width': leftDrawerContentWidth.value
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
checkModel,
|
|
77
|
+
onToggle,
|
|
78
|
+
expandIcon,
|
|
79
|
+
cssVars
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style scoped lang="scss">
|
|
86
|
+
.left-drawer-content {
|
|
87
|
+
width: var(--left-drawer-content-width);
|
|
88
|
+
position: relative;
|
|
89
|
+
transition: all 300ms;
|
|
90
|
+
|
|
91
|
+
&__toggle-icon {
|
|
92
|
+
position: absolute;
|
|
93
|
+
right: 0;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</style>
|