@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
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div>
|
|
4
|
+
<dl-input
|
|
5
|
+
v-model="inputValue"
|
|
6
|
+
placeholder="No items selected"
|
|
7
|
+
size="l"
|
|
8
|
+
has-prepend
|
|
9
|
+
padding-prop="0px 0px 0px 0px"
|
|
10
|
+
:border-left="inputBorderLeft"
|
|
11
|
+
@clear="clearAutocomplete"
|
|
12
|
+
@update:model-value="onChange"
|
|
13
|
+
@focus="onActiveInput"
|
|
14
|
+
>
|
|
15
|
+
<template #prepend>
|
|
16
|
+
<dl-icon
|
|
17
|
+
style="margin-bottom: 5px"
|
|
18
|
+
icon="icon-dl-search"
|
|
19
|
+
size="12px"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
</dl-input>
|
|
23
|
+
</div>
|
|
24
|
+
<div>
|
|
25
|
+
<dl-list clickable>
|
|
26
|
+
<template #default="{ clickable }">
|
|
27
|
+
<dl-list-item
|
|
28
|
+
v-for="(item, itemIndex) in results"
|
|
29
|
+
:key="itemIndex"
|
|
30
|
+
:clickable="clickable"
|
|
31
|
+
:border-left="`2px solid ${item.color}`"
|
|
32
|
+
:end-icon="
|
|
33
|
+
item.name === inputValue ? `icon-dl-approve` : ''
|
|
34
|
+
"
|
|
35
|
+
:style="`background-color: ${activeBackground(
|
|
36
|
+
item.name
|
|
37
|
+
)}`"
|
|
38
|
+
:highlighted="itemIndex === highlightedIndex"
|
|
39
|
+
@click="handleOption(item)"
|
|
40
|
+
>
|
|
41
|
+
<dl-item-section no-wrap>
|
|
42
|
+
<dl-ellipsis
|
|
43
|
+
color="dl-color-darker"
|
|
44
|
+
:text="item.name"
|
|
45
|
+
/>
|
|
46
|
+
</dl-item-section>
|
|
47
|
+
</dl-list-item>
|
|
48
|
+
</template>
|
|
49
|
+
</dl-list>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script lang="ts">
|
|
55
|
+
import { defineComponent, ref, watch, onMounted, PropType } from 'vue-demi'
|
|
56
|
+
import { useArrowNavigation } from '../../../hooks/use-arrow-navigation'
|
|
57
|
+
import {
|
|
58
|
+
DlList,
|
|
59
|
+
DlItemSection,
|
|
60
|
+
DlListItem,
|
|
61
|
+
DlInput,
|
|
62
|
+
DlIcon,
|
|
63
|
+
DlEllipsis
|
|
64
|
+
} from '../../../components'
|
|
65
|
+
|
|
66
|
+
type TListAutocomplete = {
|
|
67
|
+
name: string
|
|
68
|
+
color: string
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default defineComponent({
|
|
72
|
+
name: 'ListAutocomplete',
|
|
73
|
+
components: {
|
|
74
|
+
DlList,
|
|
75
|
+
DlItemSection,
|
|
76
|
+
DlListItem,
|
|
77
|
+
DlInput,
|
|
78
|
+
DlIcon,
|
|
79
|
+
DlEllipsis
|
|
80
|
+
},
|
|
81
|
+
props: {
|
|
82
|
+
items: {
|
|
83
|
+
type: Array,
|
|
84
|
+
default: () => Array as PropType<any[]>
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
emit: ['selectedOption'],
|
|
88
|
+
setup(props, ctx) {
|
|
89
|
+
const inputValue = ref('')
|
|
90
|
+
const isInputActive = ref(false)
|
|
91
|
+
const inputBorderLeft = ref('')
|
|
92
|
+
const results = ref(null)
|
|
93
|
+
const { selectedItem, highlightedIndex } = useArrowNavigation(
|
|
94
|
+
results,
|
|
95
|
+
isInputActive
|
|
96
|
+
)
|
|
97
|
+
watch(selectedItem, (value: any) => {
|
|
98
|
+
handleOption(value)
|
|
99
|
+
})
|
|
100
|
+
const filterResults = () => {
|
|
101
|
+
results.value = props.items.filter((item: any) => {
|
|
102
|
+
return (
|
|
103
|
+
item.name
|
|
104
|
+
.toLowerCase()
|
|
105
|
+
.indexOf(inputValue.value.toLowerCase()) > -1
|
|
106
|
+
)
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
const onChange = () => {
|
|
110
|
+
filterResults()
|
|
111
|
+
}
|
|
112
|
+
const activeBackground = (name: string) =>
|
|
113
|
+
name === inputValue.value ? 'var(--dl-color-fill)' : 'transparent'
|
|
114
|
+
|
|
115
|
+
onMounted(() => {
|
|
116
|
+
filterResults()
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const handleOption = (item: TListAutocomplete) => {
|
|
120
|
+
inputValue.value = item.name
|
|
121
|
+
inputBorderLeft.value = `2px solid ${item.color}`
|
|
122
|
+
ctx.emit('selectedOption', item)
|
|
123
|
+
}
|
|
124
|
+
const clearAutocomplete = () => {
|
|
125
|
+
inputBorderLeft.value = ''
|
|
126
|
+
ctx.emit('selectedOption', null)
|
|
127
|
+
}
|
|
128
|
+
const onActiveInput = () => {
|
|
129
|
+
isInputActive.value = true
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
handleOption,
|
|
134
|
+
inputValue,
|
|
135
|
+
clearAutocomplete,
|
|
136
|
+
filterResults,
|
|
137
|
+
results,
|
|
138
|
+
onChange,
|
|
139
|
+
inputBorderLeft,
|
|
140
|
+
activeBackground,
|
|
141
|
+
onActiveInput,
|
|
142
|
+
selectedItem,
|
|
143
|
+
highlightedIndex
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
</script>
|
|
148
|
+
|
|
149
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="dl-layout-drawer"
|
|
4
|
+
:style="cssVars"
|
|
5
|
+
@mouseenter="onMouseEnter"
|
|
6
|
+
@mouseleave="onMouseLeave"
|
|
7
|
+
>
|
|
8
|
+
<div style="height: 100%; position: relative">
|
|
9
|
+
<div
|
|
10
|
+
v-if="location === 'right'"
|
|
11
|
+
class="dl-layout-drawer__wrapper"
|
|
12
|
+
>
|
|
13
|
+
<dl-icon
|
|
14
|
+
:icon="expandIcon"
|
|
15
|
+
size="25px"
|
|
16
|
+
class="dl-layout-drawer__wrapper__expand-icon"
|
|
17
|
+
:class="{ expanded: !isExpanded }"
|
|
18
|
+
@click="toggleExpandDrawer"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
<slot />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import { defineComponent, ref, computed, onMounted, watch } from 'vue-demi'
|
|
28
|
+
import DlIcon from '../../../essential/DlIcon/DlIcon.vue'
|
|
29
|
+
|
|
30
|
+
export default defineComponent({
|
|
31
|
+
name: 'NavigationDrawer',
|
|
32
|
+
components: {
|
|
33
|
+
DlIcon
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
position: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: 'relative',
|
|
39
|
+
validator: (val: string) => ['relative', 'absolute'].includes(val)
|
|
40
|
+
},
|
|
41
|
+
location: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'left',
|
|
44
|
+
validator: (val: string) => ['left', 'right'].includes(val)
|
|
45
|
+
},
|
|
46
|
+
expandDrawer: {
|
|
47
|
+
type: Boolean
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
emits: ['expand'],
|
|
51
|
+
setup(props, context) {
|
|
52
|
+
const isVisible = ref(true)
|
|
53
|
+
const propsExpandDrawer = computed(() => props.expandDrawer)
|
|
54
|
+
const isExpanded = ref(propsExpandDrawer.value)
|
|
55
|
+
const drawerWidth = ref('')
|
|
56
|
+
const LARGE_WIDTH = '250px'
|
|
57
|
+
const SMALL_WIDTH = '0px'
|
|
58
|
+
|
|
59
|
+
const onMouseEnter = () => {
|
|
60
|
+
if (isExpanded.value) return
|
|
61
|
+
drawerWidth.value = LARGE_WIDTH
|
|
62
|
+
isVisible.value = true
|
|
63
|
+
}
|
|
64
|
+
const onMouseLeave = () => {
|
|
65
|
+
if (isExpanded.value) return
|
|
66
|
+
drawerWidth.value = SMALL_WIDTH
|
|
67
|
+
isVisible.value = false
|
|
68
|
+
}
|
|
69
|
+
const expandIcon = computed(() =>
|
|
70
|
+
props.location === 'left'
|
|
71
|
+
? 'icon-dl-left-chevron'
|
|
72
|
+
: 'icon-dl-right-chevron'
|
|
73
|
+
)
|
|
74
|
+
const toggleExpandDrawer = () => {
|
|
75
|
+
isExpanded.value = !isExpanded.value
|
|
76
|
+
context.emit('expand', isExpanded.value)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
onMounted(() => {
|
|
80
|
+
drawerWidth.value = SMALL_WIDTH
|
|
81
|
+
})
|
|
82
|
+
watch(isExpanded, (value) => {
|
|
83
|
+
isVisible.value = value
|
|
84
|
+
drawerWidth.value = value ? LARGE_WIDTH : SMALL_WIDTH
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
watch(propsExpandDrawer, (value) => {
|
|
88
|
+
isExpanded.value = value
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
const cssVars = computed(() => {
|
|
92
|
+
return {
|
|
93
|
+
'--dl-layout-drawer-width': isExpanded.value
|
|
94
|
+
? LARGE_WIDTH
|
|
95
|
+
: SMALL_WIDTH,
|
|
96
|
+
'--dl-layout-position': props.position,
|
|
97
|
+
'--dl-layout-drawer-overflow':
|
|
98
|
+
props.position === 'absolute' ? 'hidden' : null
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
return {
|
|
102
|
+
cssVars,
|
|
103
|
+
onMouseEnter,
|
|
104
|
+
drawerWidth,
|
|
105
|
+
onMouseLeave,
|
|
106
|
+
isVisible,
|
|
107
|
+
expandIcon,
|
|
108
|
+
isExpanded,
|
|
109
|
+
toggleExpandDrawer
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<style scoped lang="scss">
|
|
116
|
+
.dl-layout-drawer {
|
|
117
|
+
position: var(--dl-layout-position);
|
|
118
|
+
z-index: 1;
|
|
119
|
+
width: var(--dl-layout-drawer-width);
|
|
120
|
+
height: 100%;
|
|
121
|
+
overflow: var(--dl-layout-drawer-overflow);
|
|
122
|
+
transition: all 300ms;
|
|
123
|
+
box-shadow: 1px 1px 9px rgba(0, 0, 0, 0.08);
|
|
124
|
+
background-color: transparent;
|
|
125
|
+
|
|
126
|
+
&__wrapper {
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 70px;
|
|
129
|
+
left: -17px;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
color: var(--dl-color-lighter);
|
|
132
|
+
text-align: right;
|
|
133
|
+
margin-top: 8px;
|
|
134
|
+
background-color: var(--dl-color-bg);
|
|
135
|
+
border-radius: 50px;
|
|
136
|
+
|
|
137
|
+
&__expand-icon {
|
|
138
|
+
display: flex !important;
|
|
139
|
+
transition: all 300ms;
|
|
140
|
+
|
|
141
|
+
&.expanded {
|
|
142
|
+
transform: rotate(180deg);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'simple-code-editor'
|
package/src/utils/dom.ts
CHANGED
|
@@ -12,15 +12,15 @@ export function css(element: HTMLElement, css: Record<string, string>) {
|
|
|
12
12
|
export function getElement(
|
|
13
13
|
el: HTMLElement | Ref<HTMLElement> | Element | null | string
|
|
14
14
|
) {
|
|
15
|
-
if (el
|
|
16
|
-
return
|
|
15
|
+
if (!el) {
|
|
16
|
+
return null
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
if (typeof el === 'string') {
|
|
20
20
|
try {
|
|
21
|
-
return document.querySelector(el) ||
|
|
21
|
+
return document.querySelector(el) || null
|
|
22
22
|
} catch (err) {
|
|
23
|
-
return
|
|
23
|
+
return null
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -33,7 +33,7 @@ export function getElement(
|
|
|
33
33
|
|
|
34
34
|
// internal
|
|
35
35
|
export function childHasFocus(el: HTMLElement, focusedEl: Node) {
|
|
36
|
-
if (el
|
|
36
|
+
if (!el || el.contains(focusedEl) === true) {
|
|
37
37
|
return true
|
|
38
38
|
}
|
|
39
39
|
|
package/src/utils/events.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function addEvt(
|
|
|
65
65
|
) {
|
|
66
66
|
const name = `__dl_${targetName}_evt`
|
|
67
67
|
|
|
68
|
-
ctx[name] = ctx[name]
|
|
68
|
+
ctx[name] = ctx[name] ? ctx[name].concat(events) : events
|
|
69
69
|
|
|
70
70
|
events.forEach((evt: any[]) => {
|
|
71
71
|
evt[0].addEventListener(evt[1], ctx[evt[2]], listenOpts[evt[3]])
|
|
@@ -75,10 +75,10 @@ export function addEvt(
|
|
|
75
75
|
export function cleanEvt(ctx: Record<string, any>, targetName: string) {
|
|
76
76
|
const name = `__dl_${targetName}_evt`
|
|
77
77
|
|
|
78
|
-
if (ctx[name]
|
|
78
|
+
if (ctx[name]) {
|
|
79
79
|
ctx[name].forEach((evt: any[]) => {
|
|
80
80
|
evt[0].removeEventListener(evt[1], ctx[evt[2]], listenOpts[evt[3]])
|
|
81
81
|
})
|
|
82
|
-
ctx[name] =
|
|
82
|
+
ctx[name] = null
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -11,9 +11,9 @@ export function createGlobalNode(id: string | null = null) {
|
|
|
11
11
|
el.id = id
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
if (globalConfig.globalNodes
|
|
14
|
+
if (globalConfig.globalNodes) {
|
|
15
15
|
const cls = globalConfig.globalNodes.class
|
|
16
|
-
if (cls
|
|
16
|
+
if (cls) {
|
|
17
17
|
el.className = cls
|
|
18
18
|
}
|
|
19
19
|
}
|
package/src/utils/input-sizes.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export const InputSizes = {
|
|
2
2
|
l: 'l',
|
|
3
3
|
m: 'm',
|
|
4
|
-
s: 's'
|
|
4
|
+
s: 's',
|
|
5
|
+
large: 'large',
|
|
6
|
+
medium: 'medium',
|
|
7
|
+
small: 'small'
|
|
5
8
|
} as const
|
|
6
9
|
|
|
7
|
-
export type TInputSizes = typeof InputSizes[keyof typeof InputSizes]
|
|
10
|
+
export type TInputSizes = (typeof InputSizes)[keyof typeof InputSizes]
|