@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
package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchFilters.vue
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
volatile
|
|
9
9
|
full-width
|
|
10
10
|
:items="tabItems"
|
|
11
|
+
font-size="14px"
|
|
11
12
|
/>
|
|
12
13
|
<div class="dl-filters-tabs">
|
|
13
14
|
<dl-tab-panels v-model="currentTab">
|
|
@@ -36,8 +37,9 @@ import { defineComponent, PropType } from 'vue-demi'
|
|
|
36
37
|
import { DlTabs } from '../../../DlTabs'
|
|
37
38
|
import { DlTabPanels, DlTabPanel } from '../../../DlTabPanels'
|
|
38
39
|
import { Filters } from '../../../DlSearches/DlSmartSearch/types'
|
|
39
|
-
import { getTabItems } from '../utils
|
|
40
|
+
import { getTabItems } from '../utils'
|
|
40
41
|
import FiltersQuery from './FiltersQuery.vue'
|
|
42
|
+
import { v4 } from 'uuid'
|
|
41
43
|
|
|
42
44
|
export default defineComponent({
|
|
43
45
|
components: {
|
|
@@ -55,6 +57,7 @@ export default defineComponent({
|
|
|
55
57
|
emits: ['filters-delete', 'filters-search'],
|
|
56
58
|
data() {
|
|
57
59
|
return {
|
|
60
|
+
uuid: `dl-smart-search-filters-${v4()}`,
|
|
58
61
|
currentTab: 'saved'
|
|
59
62
|
}
|
|
60
63
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
+
:id="`DlSmartSearchInput${uuid}`"
|
|
3
4
|
class="dl-smart-search-input"
|
|
4
5
|
:style="cssVars"
|
|
5
6
|
>
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
</div>
|
|
20
21
|
<div class="dl-smart-search-input__textarea-wrapper">
|
|
21
22
|
<div
|
|
22
|
-
id="
|
|
23
|
+
:id="`dl-smart-search-input-text-area-${uuid}`"
|
|
23
24
|
ref="input"
|
|
24
25
|
:class="inputClass"
|
|
25
26
|
:style="textareaStyles"
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
:contenteditable="!disabled"
|
|
28
29
|
@keypress="keyPress"
|
|
29
30
|
@input="handleValueChange"
|
|
30
|
-
@click="focus"
|
|
31
|
+
@click.stop.prevent="focus"
|
|
31
32
|
@blur="blur"
|
|
32
33
|
/>
|
|
33
34
|
</div>
|
|
@@ -66,15 +67,16 @@
|
|
|
66
67
|
v-if="withSaveButton"
|
|
67
68
|
class="dl-smart-search-input__save-btn-wrapper"
|
|
68
69
|
>
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
<div>
|
|
71
|
+
<dl-button
|
|
72
|
+
icon="icon-dl-save"
|
|
73
|
+
size="16px"
|
|
74
|
+
flat
|
|
75
|
+
:disabled="saveStatus"
|
|
76
|
+
@click="save"
|
|
77
|
+
/>
|
|
76
78
|
<dl-tooltip> Save Query </dl-tooltip>
|
|
77
|
-
</
|
|
79
|
+
</div>
|
|
78
80
|
<dl-button
|
|
79
81
|
icon="icon-dl-edit"
|
|
80
82
|
size="16px"
|
|
@@ -103,6 +105,7 @@
|
|
|
103
105
|
</div>
|
|
104
106
|
<dl-suggestions-dropdown
|
|
105
107
|
v-model="suggestionModal"
|
|
108
|
+
:parent-id="`${uuid}`"
|
|
106
109
|
:disabled="disabled"
|
|
107
110
|
:suggestions="suggestions"
|
|
108
111
|
:offset="menuOffset"
|
|
@@ -110,19 +113,22 @@
|
|
|
110
113
|
@set-input-value="setInputValue"
|
|
111
114
|
/>
|
|
112
115
|
<dl-menu
|
|
113
|
-
v-if="isDatePickerVisible"
|
|
116
|
+
v-if="isDatePickerVisible && focused"
|
|
114
117
|
v-model="isDatePickerVisible"
|
|
115
118
|
:disabled="disabled"
|
|
116
119
|
:offset="[0, 3]"
|
|
117
120
|
>
|
|
118
121
|
<div class="dl-smart-search-input__date-picker-wrapper">
|
|
119
|
-
<dl-date-picker
|
|
122
|
+
<dl-date-picker
|
|
123
|
+
:single-selection="false"
|
|
124
|
+
@change="handleDateSelectionUpdate"
|
|
125
|
+
/>
|
|
120
126
|
</div>
|
|
121
127
|
</dl-menu>
|
|
122
128
|
</div>
|
|
123
129
|
</template>
|
|
124
130
|
<script lang="ts">
|
|
125
|
-
import { defineComponent, ref, PropType } from 'vue-demi'
|
|
131
|
+
import { defineComponent, ref, PropType, nextTick } from 'vue-demi'
|
|
126
132
|
import { DlButton } from '../../../../basic'
|
|
127
133
|
import { DlDatePicker } from '../../../DlDateTime'
|
|
128
134
|
import { DlMenu, DlIcon } from '../../../../essential'
|
|
@@ -130,16 +136,17 @@ import { isEllipsisActive } from '../../../../../utils/is-ellipsis-active'
|
|
|
130
136
|
import { useSizeObserver } from '../../../../../hooks/use-size-observer'
|
|
131
137
|
import { SearchStatus, SyntaxColorSchema } from '../types'
|
|
132
138
|
import { debounce } from 'lodash'
|
|
133
|
-
import { DlTooltip } from '../../../../
|
|
139
|
+
import { DlTooltip } from '../../../../shared'
|
|
134
140
|
import DlSuggestionsDropdown from './DlSuggestionsDropdown.vue'
|
|
135
141
|
import { DateInterval } from '../../../DlDateTime/types'
|
|
136
142
|
import {
|
|
137
143
|
isEndingWithDateIntervalPattern,
|
|
138
144
|
replaceDateInterval,
|
|
139
145
|
setCaret,
|
|
140
|
-
updateEditor
|
|
146
|
+
updateEditor,
|
|
147
|
+
isEligibleToChange
|
|
141
148
|
} from '../utils'
|
|
142
|
-
import {
|
|
149
|
+
import { v4 } from 'uuid'
|
|
143
150
|
|
|
144
151
|
export default defineComponent({
|
|
145
152
|
components: {
|
|
@@ -161,7 +168,7 @@ export default defineComponent({
|
|
|
161
168
|
},
|
|
162
169
|
styleModel: {
|
|
163
170
|
type: Object as PropType<SyntaxColorSchema>,
|
|
164
|
-
default:
|
|
171
|
+
default: null
|
|
165
172
|
},
|
|
166
173
|
placeholder: {
|
|
167
174
|
type: String,
|
|
@@ -261,17 +268,55 @@ export default defineComponent({
|
|
|
261
268
|
.join(' ')
|
|
262
269
|
.replace(' ', ' ')
|
|
263
270
|
} else {
|
|
264
|
-
query.
|
|
271
|
+
if (query[query.length - 1].endsWith('.')) {
|
|
272
|
+
query[query.length - 1] = query[
|
|
273
|
+
query.length - 1
|
|
274
|
+
].replace('.', '')
|
|
275
|
+
} else {
|
|
276
|
+
query.splice(-1)
|
|
277
|
+
}
|
|
265
278
|
stringValue = [...query, value, ''].join(' ')
|
|
266
279
|
}
|
|
267
280
|
} else {
|
|
268
|
-
|
|
281
|
+
if (query[query.length - 1].endsWith('.')) {
|
|
282
|
+
query[query.length - 1] = query[query.length - 1].replace(
|
|
283
|
+
'.',
|
|
284
|
+
''
|
|
285
|
+
)
|
|
286
|
+
stringValue = [...query, value, ''].join(' ')
|
|
287
|
+
} else {
|
|
288
|
+
stringValue = [value, ''].join(' ')
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// to handle date suggestion modal to open automatically.
|
|
293
|
+
if (stringValue.includes('(dd/mm/yyyy)')) {
|
|
294
|
+
stringValue = stringValue.trimEnd()
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const specialSuggestions = props.suggestions.filter((suggestion) =>
|
|
298
|
+
suggestion.startsWith('.')
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
for (const suggestion of specialSuggestions) {
|
|
302
|
+
if (stringValue.includes(suggestion)) {
|
|
303
|
+
stringValue = stringValue.replace(
|
|
304
|
+
` ${suggestion}`,
|
|
305
|
+
suggestion
|
|
306
|
+
)
|
|
307
|
+
}
|
|
269
308
|
}
|
|
270
309
|
|
|
271
310
|
emit('update:modelValue', stringValue)
|
|
272
311
|
}
|
|
273
312
|
|
|
313
|
+
const debouncedSetModal = debounce(
|
|
314
|
+
() => (suggestionModal.value = true),
|
|
315
|
+
200
|
|
316
|
+
)
|
|
317
|
+
|
|
274
318
|
return {
|
|
319
|
+
uuid: v4(),
|
|
275
320
|
input,
|
|
276
321
|
label,
|
|
277
322
|
hasEllipsis,
|
|
@@ -287,7 +332,8 @@ export default defineComponent({
|
|
|
287
332
|
focused,
|
|
288
333
|
isOverflow,
|
|
289
334
|
isTyping,
|
|
290
|
-
scroll
|
|
335
|
+
scroll,
|
|
336
|
+
debouncedSetModal
|
|
291
337
|
}
|
|
292
338
|
},
|
|
293
339
|
computed: {
|
|
@@ -393,35 +439,44 @@ export default defineComponent({
|
|
|
393
439
|
modelValue(value: string) {
|
|
394
440
|
const target = this.$refs['input'] as HTMLInputElement
|
|
395
441
|
value = value?.replaceAll(' ', ' ') ?? ''
|
|
396
|
-
|
|
442
|
+
/*
|
|
443
|
+
* I commented out this line because it was blocking arrow navigation
|
|
444
|
+
* */
|
|
445
|
+
// if (!this.isTyping) target.innerHTML = value
|
|
446
|
+
target.innerHTML = value
|
|
397
447
|
updateEditor(this.styleModel)
|
|
398
448
|
this.setMenuOffset(isEligibleToChange(target, this.expanded))
|
|
399
|
-
|
|
449
|
+
/*
|
|
450
|
+
* I commented out this line because it was blocking arrow navigation
|
|
451
|
+
* */
|
|
452
|
+
// if (!this.isTyping) setCaret(target)
|
|
453
|
+
setCaret(target)
|
|
400
454
|
if (!this.expanded) {
|
|
401
455
|
this.isOverflow =
|
|
402
456
|
isEllipsisActive(this.$refs['input'] as Element) ||
|
|
403
457
|
this.hasEllipsis
|
|
404
458
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
if (isEndingWithDateIntervalPattern(value)) {
|
|
459
|
+
|
|
460
|
+
if (value.length && isEndingWithDateIntervalPattern(value)) {
|
|
409
461
|
this.isDatePickerVisible = true
|
|
410
462
|
this.suggestionModal = false
|
|
463
|
+
} else {
|
|
464
|
+
this.isDatePickerVisible = false
|
|
465
|
+
this.suggestionModal = true
|
|
411
466
|
}
|
|
412
467
|
this.scroll = (this.$refs.input as HTMLDivElement).offsetHeight > 40
|
|
413
468
|
},
|
|
414
469
|
suggestions(val) {
|
|
415
470
|
if (this.isDatePickerVisible) return
|
|
471
|
+
nextTick(() => {
|
|
472
|
+
if (!val.length) {
|
|
473
|
+
this.suggestionModal = false
|
|
474
|
+
}
|
|
416
475
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
if (!this.suggestionModal && val.length > 0 && this.focused) {
|
|
422
|
-
const deb = debounce(() => (this.suggestionModal = true), 200)
|
|
423
|
-
deb()
|
|
424
|
-
}
|
|
476
|
+
if (!this.suggestionModal && val.length > 0 && this.focused) {
|
|
477
|
+
this.suggestionModal = true
|
|
478
|
+
}
|
|
479
|
+
})
|
|
425
480
|
},
|
|
426
481
|
expanded(value) {
|
|
427
482
|
this.$nextTick(() => {
|
|
@@ -433,7 +488,9 @@ export default defineComponent({
|
|
|
433
488
|
|
|
434
489
|
this.setMenuOffset(isEligibleToChange(element, value))
|
|
435
490
|
|
|
436
|
-
|
|
491
|
+
if (value) {
|
|
492
|
+
this.focus()
|
|
493
|
+
}
|
|
437
494
|
})
|
|
438
495
|
},
|
|
439
496
|
focused(value) {
|
|
@@ -449,9 +506,9 @@ export default defineComponent({
|
|
|
449
506
|
if (!val) {
|
|
450
507
|
this.datePickerSelection = null
|
|
451
508
|
|
|
452
|
-
|
|
509
|
+
nextTick(() => {
|
|
453
510
|
this.focus()
|
|
454
|
-
}
|
|
511
|
+
})
|
|
455
512
|
}
|
|
456
513
|
}
|
|
457
514
|
},
|
|
@@ -493,9 +550,11 @@ export default defineComponent({
|
|
|
493
550
|
this.focused = true
|
|
494
551
|
return
|
|
495
552
|
}
|
|
553
|
+
|
|
496
554
|
element.scrollLeft = 0
|
|
497
555
|
element.scrollTop = 0
|
|
498
556
|
this.focused = false
|
|
557
|
+
this.expanded = false
|
|
499
558
|
this.$emit('focus', false)
|
|
500
559
|
} else {
|
|
501
560
|
this.focus()
|
|
@@ -527,6 +586,7 @@ export default defineComponent({
|
|
|
527
586
|
},
|
|
528
587
|
handleValueChange(e: Event) {
|
|
529
588
|
this.isTyping = true
|
|
589
|
+
|
|
530
590
|
const text = (e.target as HTMLElement).textContent
|
|
531
591
|
.toString()
|
|
532
592
|
.replaceAll(' ', ' ')
|
|
@@ -600,6 +660,7 @@ export default defineComponent({
|
|
|
600
660
|
}
|
|
601
661
|
|
|
602
662
|
&--expanded {
|
|
663
|
+
z-index: var(--dl-z-index-overlay);
|
|
603
664
|
transition: height 0.3s ease-out;
|
|
604
665
|
position: relative;
|
|
605
666
|
top: 0;
|
|
@@ -610,7 +671,7 @@ export default defineComponent({
|
|
|
610
671
|
}
|
|
611
672
|
|
|
612
673
|
&--disabled {
|
|
613
|
-
border-color: var(--dl-color-
|
|
674
|
+
border-color: var(--dl-color-separator);
|
|
614
675
|
}
|
|
615
676
|
}
|
|
616
677
|
|
|
@@ -648,7 +709,7 @@ export default defineComponent({
|
|
|
648
709
|
height: auto;
|
|
649
710
|
|
|
650
711
|
min-height: 14px;
|
|
651
|
-
max-height:
|
|
712
|
+
max-height: var(--dl-smart-search-bar-wrapper-height);
|
|
652
713
|
display: block;
|
|
653
714
|
}
|
|
654
715
|
|
package/src/components/compound/DlSearches/DlSmartSearch/components/DlSuggestionsDropdown.vue
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
fit-container
|
|
11
11
|
:model-value="modelValue"
|
|
12
12
|
:arrow-nav-items="suggestions"
|
|
13
|
+
:auto-close="false"
|
|
13
14
|
@update:modelValue="emitModelValue($event)"
|
|
14
15
|
@show="onShow"
|
|
15
16
|
@hide="onHide"
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
v-for="(item, suggestionIndex) in suggestions"
|
|
22
23
|
:key="item"
|
|
23
24
|
:clickable="true"
|
|
24
|
-
:
|
|
25
|
+
:highlighted="suggestionIndex === highlightedIndex"
|
|
25
26
|
@click="handleOption(item)"
|
|
26
27
|
>
|
|
27
28
|
{{ item }}
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
</div>
|
|
32
33
|
</template>
|
|
33
34
|
<script lang="ts">
|
|
34
|
-
import { defineComponent, PropType, ref } from 'vue-demi'
|
|
35
|
+
import { computed, defineComponent, PropType, ref } from 'vue-demi'
|
|
35
36
|
import { DlMenu, DlList } from '../../../../essential'
|
|
36
37
|
import { DlListItem } from '../../../../basic'
|
|
37
38
|
|
|
@@ -46,6 +47,10 @@ export default defineComponent({
|
|
|
46
47
|
event: 'update:modelValue'
|
|
47
48
|
},
|
|
48
49
|
props: {
|
|
50
|
+
parentId: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
49
54
|
expanded: {
|
|
50
55
|
type: Boolean,
|
|
51
56
|
default: false
|
|
@@ -91,7 +96,12 @@ export default defineComponent({
|
|
|
91
96
|
emit('set-input-value', item)
|
|
92
97
|
}
|
|
93
98
|
|
|
99
|
+
const defaultTarget = computed(() => {
|
|
100
|
+
return `#dl-smart-search-input-text-area-${props.parentId}`
|
|
101
|
+
})
|
|
102
|
+
|
|
94
103
|
return {
|
|
104
|
+
defaultTarget,
|
|
95
105
|
setHighlightedIndex,
|
|
96
106
|
handleSelectedItem,
|
|
97
107
|
highlightedIndex,
|
|
@@ -100,11 +110,6 @@ export default defineComponent({
|
|
|
100
110
|
emitModelValue,
|
|
101
111
|
handleOption
|
|
102
112
|
}
|
|
103
|
-
},
|
|
104
|
-
computed: {
|
|
105
|
-
defaultTarget() {
|
|
106
|
-
return '.dl-smart-search-input__textarea'
|
|
107
|
-
}
|
|
108
113
|
}
|
|
109
114
|
})
|
|
110
115
|
</script>
|
|
@@ -8,10 +8,7 @@
|
|
|
8
8
|
class="query__header"
|
|
9
9
|
@mousedown="$emit('select')"
|
|
10
10
|
>
|
|
11
|
-
<dl-icon
|
|
12
|
-
:icon="icon"
|
|
13
|
-
style="margin-bottom: 3px"
|
|
14
|
-
/>
|
|
11
|
+
<dl-icon :icon="icon" />
|
|
15
12
|
<span class="query__header--title">
|
|
16
13
|
{{ name }}
|
|
17
14
|
</span>
|
|
@@ -37,7 +34,9 @@
|
|
|
37
34
|
|
|
38
35
|
<script lang="ts">
|
|
39
36
|
import { defineComponent } from 'vue-demi'
|
|
40
|
-
import { DlIcon
|
|
37
|
+
import { DlIcon } from '../../../../essential'
|
|
38
|
+
import { DlTooltip } from '../../../../shared'
|
|
39
|
+
|
|
41
40
|
export default defineComponent({
|
|
42
41
|
components: {
|
|
43
42
|
DlIcon,
|
|
@@ -80,7 +79,7 @@ export default defineComponent({
|
|
|
80
79
|
display: flex;
|
|
81
80
|
align-items: center;
|
|
82
81
|
&--title {
|
|
83
|
-
font-size:
|
|
82
|
+
font-size: 12px;
|
|
84
83
|
margin: 0px 12px;
|
|
85
84
|
}
|
|
86
85
|
}
|
|
@@ -34,3 +34,17 @@ export type SyntaxColorSchema = {
|
|
|
34
34
|
color: string
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
import {
|
|
39
|
+
Alias as DlSmartSearchAlias,
|
|
40
|
+
Schema as DlSmartSearchSchema
|
|
41
|
+
} from '../../../../hooks/use-suggestions'
|
|
42
|
+
|
|
43
|
+
type DlSmartSearchFilters = Filters & { [key: string]: any }
|
|
44
|
+
|
|
45
|
+
export type {
|
|
46
|
+
DlSmartSearchAlias,
|
|
47
|
+
DlSmartSearchSchema,
|
|
48
|
+
ColorSchema as DlSmartSearchColorSchema,
|
|
49
|
+
DlSmartSearchFilters
|
|
50
|
+
}
|
|
@@ -94,12 +94,16 @@ function restoreSelection(
|
|
|
94
94
|
function renderText(text: string) {
|
|
95
95
|
const words = text?.split(/(\s+)/)
|
|
96
96
|
const output = words?.map((word) => {
|
|
97
|
-
if (styleModel
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
if (styleModel) {
|
|
98
|
+
if (styleModel.keywords.values.includes(word)) {
|
|
99
|
+
return `<strong style='${SPAN_STYLES}; color:${styleModel.keywords.color}'>${word}</strong>`
|
|
100
|
+
} else if (styleModel.fields.values.includes(word)) {
|
|
101
|
+
return `<span style='color:${styleModel.fields.color}; ${SPAN_STYLES}'>${word}</span>`
|
|
102
|
+
} else if (styleModel.operators.values.includes(word)) {
|
|
103
|
+
return `<span style='color:${styleModel.operators.color}; ${SPAN_STYLES}'>${word}</span>`
|
|
104
|
+
} else {
|
|
105
|
+
return `<span style='${SPAN_STYLES}'>${word}</span>`
|
|
106
|
+
}
|
|
103
107
|
} else {
|
|
104
108
|
return `<span style='${SPAN_STYLES}'>${word}</span>`
|
|
105
109
|
}
|