@dataloop-ai/components 0.20.183-ds-v3.2 → 0.20.183
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 +1 -1
- package/src/assets/theme.css +2 -0
- package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +106 -101
- package/src/components/compound/DlDateTime/DlDateTimeRange/types.ts +0 -5
- package/src/components/compound/DlInput/DlInput.vue +0 -4
- package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +0 -12
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +7 -24
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchJsonEditorDialog.vue +45 -187
- package/src/components/compound/DlSelect/DlSelect.vue +3 -15
- package/src/components/compound/DlSelect/components/DlSelectOption.vue +6 -7
- package/src/components/compound/DlTable/DlTable.vue +11 -11
- package/src/components/compound/DlTreeTable/DlTreeTable.vue +2 -4
- package/src/components/compound/DlTreeTable/views/DlTrTreeView.vue +1 -1
- package/src/components/essential/DlProgressBar/DlProgressBar.vue +8 -10
- package/src/components/essential/DlSwitch/DlSwitch.vue +4 -14
- package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +1 -3
- package/src/demos/DlDateTimeRangeDemo.vue +0 -20
- package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +0 -1
- package/src/components/compound/DlDateTime/DlDateTimeRange/DateTimeRangeContent.vue +0 -177
package/package.json
CHANGED
package/src/assets/theme.css
CHANGED
|
@@ -69,6 +69,7 @@ body {
|
|
|
69
69
|
--dl-color-link: #20abfa;
|
|
70
70
|
--dl-color-cell-background: #fffae2;
|
|
71
71
|
--dl-color-disabled-slider: #b3b3b3;
|
|
72
|
+
--dl-color-text-800: #101019;
|
|
72
73
|
--q-color-positive: #38d079;
|
|
73
74
|
--q-color-warning: #e1b75b;
|
|
74
75
|
|
|
@@ -139,6 +140,7 @@ body {
|
|
|
139
140
|
--dl-color-link: #53b2e8;
|
|
140
141
|
--dl-color-cell-background: #fffae2;
|
|
141
142
|
--dl-color-disabled-slider: #64686d;
|
|
143
|
+
--dl-color-text-800: #ffffff;
|
|
142
144
|
--q-color-positive: #3FC97F;
|
|
143
145
|
--q-color-warning: #f8d29a;
|
|
144
146
|
|
|
@@ -1,71 +1,104 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :id="uuid" class="dl-date-time-range">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
<date-input
|
|
4
|
+
:text="dateInputText"
|
|
5
|
+
:input-style="dateInputStyle"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
:width="width"
|
|
8
|
+
>
|
|
9
|
+
<dl-menu
|
|
10
|
+
ref="dateTimeRangeMenu"
|
|
11
|
+
anchor="bottom middle"
|
|
12
|
+
self="top middle"
|
|
13
|
+
:offset="[0, 5]"
|
|
7
14
|
:disabled="disabled"
|
|
8
|
-
:width="width"
|
|
9
15
|
>
|
|
10
|
-
<dl-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
16
|
+
<div class="dl-date-time-range--card">
|
|
17
|
+
<div
|
|
18
|
+
v-if="mode === 'multi'"
|
|
19
|
+
class="dl-date-time-range--card_sidebar"
|
|
20
|
+
>
|
|
21
|
+
<card-sidebar
|
|
22
|
+
v-if="typeState === 'day'"
|
|
23
|
+
:options="sidebarDayOptions"
|
|
24
|
+
:current-option="currentSidebarOption"
|
|
25
|
+
@click="handleDayTypeOptionClick"
|
|
26
|
+
/>
|
|
27
|
+
<card-sidebar
|
|
28
|
+
v-else
|
|
29
|
+
:options="sidebarMonthOptions"
|
|
30
|
+
:current-option="currentSidebarOption"
|
|
31
|
+
@click="handleMonthTypeOptionClick"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
<div
|
|
35
|
+
class="dl-date-time-range--card_content"
|
|
36
|
+
:style="cardContentStyles"
|
|
37
|
+
>
|
|
38
|
+
<dl-date-picker
|
|
39
|
+
:model-value="dateInterval"
|
|
40
|
+
:type="typeState"
|
|
41
|
+
:available-range="availableRange"
|
|
42
|
+
:disabled="isInputDisabled"
|
|
43
|
+
:normalize-calendars="normalizeCalendars"
|
|
44
|
+
:active-date-from="activeDateFrom"
|
|
45
|
+
:active-date-to="activeDateTo"
|
|
46
|
+
@update:model-value="
|
|
47
|
+
updateDateIntervalWithAutoClose
|
|
48
|
+
"
|
|
49
|
+
@update:from-to-date="updateFromToDate"
|
|
50
|
+
/>
|
|
51
|
+
<dl-time-picker
|
|
52
|
+
v-if="showTime && typeState === 'day'"
|
|
53
|
+
:disabled="isInputDisabled"
|
|
54
|
+
:model-value="dateInterval"
|
|
55
|
+
@update:model-value="updateDateInterval"
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
<dl-button
|
|
59
|
+
size="s"
|
|
60
|
+
outlined
|
|
61
|
+
class="dl-date-time-range--button"
|
|
62
|
+
@click="handleClearAction"
|
|
63
|
+
>
|
|
64
|
+
<span style="text-transform: capitalize">
|
|
65
|
+
Clear
|
|
66
|
+
</span>
|
|
67
|
+
</dl-button>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</dl-menu>
|
|
71
|
+
</date-input>
|
|
44
72
|
</div>
|
|
45
73
|
</template>
|
|
46
74
|
<script lang="ts">
|
|
75
|
+
import { DlTimePicker } from '../DlTimePicker'
|
|
47
76
|
import { DateInterval } from '../types'
|
|
77
|
+
import CardSidebar from './CardSidebar.vue'
|
|
48
78
|
import {
|
|
49
79
|
DayTypeOption,
|
|
50
80
|
DAY_SIDEBAR_OPTION,
|
|
51
81
|
MonthTypeOption,
|
|
52
|
-
MONTH_SIDEBAR_OPTION
|
|
53
|
-
DATETIME_RANGE_VIEW_MODE
|
|
82
|
+
MONTH_SIDEBAR_OPTION
|
|
54
83
|
} from './types'
|
|
55
84
|
import { CustomDate } from '../DlDatePicker/models/CustomDate'
|
|
85
|
+
import DlDatePicker from '../DlDatePicker/DlDatePicker.vue'
|
|
56
86
|
import { CalendarDate } from '../DlDatePicker/models/CalendarDate'
|
|
57
87
|
import DateInput from './DateInput.vue'
|
|
58
|
-
import DateTimeRangeContent from './DateTimeRangeContent.vue'
|
|
59
88
|
import { DlMenu } from '../../../essential'
|
|
89
|
+
import { DlButton } from '../../../basic'
|
|
60
90
|
import { defineComponent, PropType } from 'vue-demi'
|
|
61
91
|
import { isInRange } from '../DlDatePicker/utils'
|
|
62
92
|
import { v4 } from 'uuid'
|
|
63
93
|
|
|
64
94
|
export default defineComponent({
|
|
65
95
|
components: {
|
|
96
|
+
CardSidebar,
|
|
97
|
+
DlDatePicker,
|
|
98
|
+
DlTimePicker,
|
|
66
99
|
DateInput,
|
|
67
|
-
|
|
68
|
-
|
|
100
|
+
DlMenu,
|
|
101
|
+
DlButton
|
|
69
102
|
},
|
|
70
103
|
model: {
|
|
71
104
|
prop: 'modelValue',
|
|
@@ -119,14 +152,6 @@ export default defineComponent({
|
|
|
119
152
|
shouldClearSelectFirstOption: {
|
|
120
153
|
type: Boolean,
|
|
121
154
|
default: false
|
|
122
|
-
},
|
|
123
|
-
viewMode: {
|
|
124
|
-
type: String as PropType<DATETIME_RANGE_VIEW_MODE>,
|
|
125
|
-
default: DATETIME_RANGE_VIEW_MODE.input
|
|
126
|
-
},
|
|
127
|
-
hideClearButton: {
|
|
128
|
-
type: Boolean,
|
|
129
|
-
default: false
|
|
130
155
|
}
|
|
131
156
|
},
|
|
132
157
|
emits: ['update:model-value', 'set-type', 'change'],
|
|
@@ -412,27 +437,6 @@ export default defineComponent({
|
|
|
412
437
|
return {
|
|
413
438
|
'--card-content-width': this.datePickerCardWidth
|
|
414
439
|
}
|
|
415
|
-
},
|
|
416
|
-
isInputMode(): boolean {
|
|
417
|
-
return this.viewMode === DATETIME_RANGE_VIEW_MODE.input
|
|
418
|
-
},
|
|
419
|
-
dateTimeRangeContentProps(): Record<string, any> {
|
|
420
|
-
return {
|
|
421
|
-
mode: this.mode,
|
|
422
|
-
typeState: this.typeState,
|
|
423
|
-
sidebarDayOptions: this.sidebarDayOptions,
|
|
424
|
-
sidebarMonthOptions: this.sidebarMonthOptions,
|
|
425
|
-
currentSidebarOption: this.currentSidebarOption,
|
|
426
|
-
dateInterval: this.dateInterval,
|
|
427
|
-
availableRange: this.availableRange,
|
|
428
|
-
isInputDisabled: this.isInputDisabled,
|
|
429
|
-
normalizeCalendars: this.normalizeCalendars,
|
|
430
|
-
activeDateFrom: this.activeDateFrom,
|
|
431
|
-
activeDateTo: this.activeDateTo,
|
|
432
|
-
showTime: this.showTime,
|
|
433
|
-
cardContentStyles: this.cardContentStyles,
|
|
434
|
-
hideClearButton: this.hideClearButton
|
|
435
|
-
}
|
|
436
440
|
}
|
|
437
441
|
},
|
|
438
442
|
watch: {
|
|
@@ -512,10 +516,7 @@ export default defineComponent({
|
|
|
512
516
|
this.typeState = value
|
|
513
517
|
this.$emit('set-type', value)
|
|
514
518
|
},
|
|
515
|
-
updateDateInterval(
|
|
516
|
-
value: DateInterval | null,
|
|
517
|
-
skipSidebarUpdate = false
|
|
518
|
-
) {
|
|
519
|
+
updateDateInterval(value: DateInterval | null) {
|
|
519
520
|
if (value === null) {
|
|
520
521
|
this.dateInterval = null
|
|
521
522
|
} else {
|
|
@@ -523,14 +524,6 @@ export default defineComponent({
|
|
|
523
524
|
from: value.from,
|
|
524
525
|
to: new Date(value.to)
|
|
525
526
|
}
|
|
526
|
-
// When in multi mode, update sidebar option to custom if user manually selects date
|
|
527
|
-
if (this.mode === 'multi' && !skipSidebarUpdate) {
|
|
528
|
-
this.currentSidebarOption =
|
|
529
|
-
this.typeState === 'day'
|
|
530
|
-
? DAY_SIDEBAR_OPTION.custom
|
|
531
|
-
: MONTH_SIDEBAR_OPTION.custom
|
|
532
|
-
this.isInputDisabled = false
|
|
533
|
-
}
|
|
534
527
|
}
|
|
535
528
|
this.$emit('update:model-value', value)
|
|
536
529
|
this.$emit('change', value)
|
|
@@ -539,24 +532,16 @@ export default defineComponent({
|
|
|
539
532
|
this.activeDateFrom = value?.from || null
|
|
540
533
|
this.activeDateTo = value?.to || null
|
|
541
534
|
},
|
|
542
|
-
updateDateIntervalWithAutoClose(
|
|
543
|
-
value
|
|
544
|
-
skipSidebarUpdate = false
|
|
545
|
-
) {
|
|
546
|
-
this.updateDateInterval(value, skipSidebarUpdate)
|
|
535
|
+
updateDateIntervalWithAutoClose(value: DateInterval) {
|
|
536
|
+
this.updateDateInterval(value)
|
|
547
537
|
|
|
548
|
-
if (
|
|
549
|
-
this.autoClose &&
|
|
550
|
-
this.viewMode === DATETIME_RANGE_VIEW_MODE.input
|
|
551
|
-
) {
|
|
538
|
+
if (this.autoClose) {
|
|
552
539
|
const dateTimeRangeMenu = this.$refs[
|
|
553
540
|
'dateTimeRangeMenu'
|
|
554
541
|
] as unknown as {
|
|
555
542
|
hide: () => void
|
|
556
543
|
}
|
|
557
|
-
|
|
558
|
-
dateTimeRangeMenu.hide()
|
|
559
|
-
}
|
|
544
|
+
dateTimeRangeMenu.hide()
|
|
560
545
|
}
|
|
561
546
|
},
|
|
562
547
|
handleDayTypeOptionClick(option: DayTypeOption) {
|
|
@@ -570,9 +555,9 @@ export default defineComponent({
|
|
|
570
555
|
|
|
571
556
|
if (option.key === DAY_SIDEBAR_OPTION.custom_by_month) {
|
|
572
557
|
this.handleTypeChange('month')
|
|
573
|
-
this.updateDateInterval(option.value
|
|
558
|
+
this.updateDateInterval(option.value)
|
|
574
559
|
} else {
|
|
575
|
-
this.updateDateIntervalWithAutoClose(option.value
|
|
560
|
+
this.updateDateIntervalWithAutoClose(option.value)
|
|
576
561
|
}
|
|
577
562
|
},
|
|
578
563
|
handleMonthTypeOptionClick(option: MonthTypeOption) {
|
|
@@ -586,9 +571,9 @@ export default defineComponent({
|
|
|
586
571
|
|
|
587
572
|
if (option.key === MONTH_SIDEBAR_OPTION.custom_by_day) {
|
|
588
573
|
this.handleTypeChange('day')
|
|
589
|
-
this.updateDateInterval(option.value
|
|
574
|
+
this.updateDateInterval(option.value)
|
|
590
575
|
} else {
|
|
591
|
-
this.updateDateIntervalWithAutoClose(option.value
|
|
576
|
+
this.updateDateIntervalWithAutoClose(option.value)
|
|
592
577
|
}
|
|
593
578
|
}
|
|
594
579
|
}
|
|
@@ -598,5 +583,25 @@ export default defineComponent({
|
|
|
598
583
|
.dl-date-time-range {
|
|
599
584
|
display: flex;
|
|
600
585
|
justify-content: center;
|
|
586
|
+
|
|
587
|
+
&--card {
|
|
588
|
+
background-color: var(--dl-color-bg);
|
|
589
|
+
z-index: 1;
|
|
590
|
+
display: flex;
|
|
591
|
+
border-radius: 2px;
|
|
592
|
+
border-radius: 2px;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
&--card_content {
|
|
596
|
+
width: var(--card-content-width);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
&--button {
|
|
600
|
+
display: flex;
|
|
601
|
+
margin-left: auto;
|
|
602
|
+
width: fit-content;
|
|
603
|
+
margin-right: 16px;
|
|
604
|
+
margin-bottom: 16px;
|
|
605
|
+
}
|
|
601
606
|
}
|
|
602
607
|
</style>
|
|
@@ -1470,9 +1470,6 @@ export default defineComponent({
|
|
|
1470
1470
|
&--s {
|
|
1471
1471
|
height: 18px;
|
|
1472
1472
|
}
|
|
1473
|
-
&--m {
|
|
1474
|
-
height: 26px;
|
|
1475
|
-
}
|
|
1476
1473
|
}
|
|
1477
1474
|
|
|
1478
1475
|
&__input {
|
|
@@ -1521,7 +1518,6 @@ export default defineComponent({
|
|
|
1521
1518
|
}
|
|
1522
1519
|
|
|
1523
1520
|
&--m {
|
|
1524
|
-
height: 12px;
|
|
1525
1521
|
line-height: 12px;
|
|
1526
1522
|
padding-top: 7px;
|
|
1527
1523
|
padding-bottom: 7px;
|
|
@@ -158,18 +158,6 @@ export default defineComponent({
|
|
|
158
158
|
},
|
|
159
159
|
onSearchButtonPress(): void {
|
|
160
160
|
this.$emit('search', this.modelValue)
|
|
161
|
-
},
|
|
162
|
-
focus(): void {
|
|
163
|
-
const inputComponent = this.$refs.input as InstanceType<
|
|
164
|
-
typeof DlInput
|
|
165
|
-
>
|
|
166
|
-
inputComponent?.focus()
|
|
167
|
-
},
|
|
168
|
-
blur(): void {
|
|
169
|
-
const inputComponent = this.$refs.input as InstanceType<
|
|
170
|
-
typeof DlInput
|
|
171
|
-
>
|
|
172
|
-
inputComponent?.blur()
|
|
173
161
|
}
|
|
174
162
|
}
|
|
175
163
|
})
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
55
|
<dl-tooltip
|
|
56
|
-
v-if="!focused
|
|
56
|
+
v-if="!focused"
|
|
57
57
|
border="1px solid var(--dl-color-separator)"
|
|
58
58
|
background-color="dl-color-panel-background"
|
|
59
59
|
color="dl-color-darker"
|
|
@@ -248,10 +248,6 @@ export default defineComponent({
|
|
|
248
248
|
type: String,
|
|
249
249
|
default: '28px'
|
|
250
250
|
},
|
|
251
|
-
noTooltip: {
|
|
252
|
-
type: Boolean,
|
|
253
|
-
default: false
|
|
254
|
-
},
|
|
255
251
|
omitSuggestions: {
|
|
256
252
|
type: Array as PropType<string[]>,
|
|
257
253
|
default: () => [] as string[]
|
|
@@ -279,7 +275,6 @@ export default defineComponent({
|
|
|
279
275
|
'blur',
|
|
280
276
|
'input',
|
|
281
277
|
'search',
|
|
282
|
-
'status',
|
|
283
278
|
'error',
|
|
284
279
|
'clear'
|
|
285
280
|
],
|
|
@@ -302,7 +297,6 @@ export default defineComponent({
|
|
|
302
297
|
defaultIcon,
|
|
303
298
|
defaultIconColor,
|
|
304
299
|
schema,
|
|
305
|
-
noTooltip,
|
|
306
300
|
omitSuggestions,
|
|
307
301
|
operatorsOverride,
|
|
308
302
|
height,
|
|
@@ -1041,35 +1035,24 @@ export default defineComponent({
|
|
|
1041
1035
|
return status.value
|
|
1042
1036
|
}
|
|
1043
1037
|
|
|
1044
|
-
let newStatus: {
|
|
1045
|
-
type: string
|
|
1046
|
-
message: string
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
1038
|
if (!error.value && searchQuery.value !== '') {
|
|
1050
|
-
|
|
1039
|
+
return {
|
|
1051
1040
|
type: 'success',
|
|
1052
1041
|
message: ''
|
|
1053
1042
|
}
|
|
1054
1043
|
}
|
|
1055
1044
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1045
|
+
if (error.value === 'warning') {
|
|
1046
|
+
return {
|
|
1058
1047
|
type: 'warning',
|
|
1059
1048
|
message: 'The query is not supported technically.'
|
|
1060
1049
|
}
|
|
1061
1050
|
}
|
|
1062
1051
|
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
message: error.value
|
|
1067
|
-
}
|
|
1052
|
+
return {
|
|
1053
|
+
type: 'error',
|
|
1054
|
+
message: error.value
|
|
1068
1055
|
}
|
|
1069
|
-
|
|
1070
|
-
emit('status', newStatus)
|
|
1071
|
-
|
|
1072
|
-
return newStatus
|
|
1073
1056
|
})
|
|
1074
1057
|
|
|
1075
1058
|
const inputPlaceholder = computed<string>(() => {
|
|
@@ -4,116 +4,48 @@
|
|
|
4
4
|
v-model="isOpen"
|
|
5
5
|
:height="500"
|
|
6
6
|
:width="800"
|
|
7
|
-
style="--dl-dialog-box-footer-padding: 10px 16px
|
|
7
|
+
style="--dl-dialog-box-footer-padding: 10px 16px"
|
|
8
8
|
>
|
|
9
9
|
<template #header>
|
|
10
10
|
<dl-dialog-box-header
|
|
11
|
-
title="DQL
|
|
11
|
+
title="DQL Search"
|
|
12
12
|
:close-button="true"
|
|
13
13
|
@onClose="isOpen = false"
|
|
14
14
|
/>
|
|
15
15
|
</template>
|
|
16
16
|
<template #body>
|
|
17
17
|
<div class="json-editor-layout">
|
|
18
|
-
<div
|
|
18
|
+
<div
|
|
19
|
+
class="json-query-menu"
|
|
20
|
+
style="margin-bottom: 10px"
|
|
21
|
+
>
|
|
19
22
|
<dl-select
|
|
20
23
|
:model-value="selectedOption"
|
|
21
|
-
ref="jsonQueryMenu"
|
|
22
24
|
width="300px"
|
|
23
25
|
:options="selectOptions"
|
|
24
26
|
placeholder="New Query"
|
|
25
|
-
searchable
|
|
26
|
-
size="m"
|
|
27
|
-
after-options-padding="0"
|
|
28
|
-
no-options-padding="0"
|
|
29
|
-
menu-style="overflow-y: hidden;"
|
|
30
27
|
@update:model-value="onQuerySelect"
|
|
31
28
|
>
|
|
32
29
|
<template #selected="scope">
|
|
33
|
-
<span class="json-query-menu-
|
|
30
|
+
<span class="json-query-menu-option">
|
|
34
31
|
{{ scope.opt ? scope.opt.label : '' }}
|
|
35
32
|
</span>
|
|
36
33
|
</template>
|
|
37
34
|
<template #option="scope">
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
disabled
|
|
42
|
-
style="cursor: default !important; padding: 14px 0 10px 0;"
|
|
43
|
-
>
|
|
44
|
-
No Saved Queries
|
|
45
|
-
</div>
|
|
46
|
-
<div v-else class="json-query-menu-option">
|
|
47
|
-
<div class="json-query-menu-option-label">
|
|
48
|
-
{{ scope.opt.label }}
|
|
49
|
-
</div>
|
|
50
|
-
<dl-icon
|
|
51
|
-
v-if="scope.opt.label !== 'New Query'"
|
|
52
|
-
icon="icon-dl-delete"
|
|
53
|
-
color="dl-color-negative"
|
|
54
|
-
class="json-query-menu-option-delete"
|
|
55
|
-
@click.stop="onDelete(scope.opt)"
|
|
56
|
-
>
|
|
57
|
-
<dl-tooltip>Delete</dl-tooltip>
|
|
58
|
-
</dl-icon>
|
|
59
|
-
</div>
|
|
60
|
-
</template>
|
|
61
|
-
<template #after-options>
|
|
62
|
-
<dl-separator
|
|
63
|
-
style="margin: 0 0 2px 0 !important"
|
|
64
|
-
type="horizontal"
|
|
65
|
-
/>
|
|
66
|
-
<dl-button
|
|
67
|
-
icon="icon-dl-save"
|
|
68
|
-
flat
|
|
69
|
-
fluid
|
|
70
|
-
secondary
|
|
71
|
-
size="s"
|
|
72
|
-
label="Save Query"
|
|
73
|
-
class="json-query-menu-save-button"
|
|
74
|
-
@click="onSave"
|
|
75
|
-
/>
|
|
76
|
-
</template>
|
|
77
|
-
<template #no-options>
|
|
78
|
-
<div class="json-query-menu-no-option">
|
|
79
|
-
No Results Found
|
|
80
|
-
</div>
|
|
81
|
-
<dl-separator
|
|
82
|
-
style="margin: 0 0 2px 0 !important"
|
|
83
|
-
type="horizontal"
|
|
84
|
-
/>
|
|
85
|
-
<dl-button
|
|
86
|
-
icon="icon-dl-save"
|
|
87
|
-
flat
|
|
88
|
-
fluid
|
|
89
|
-
secondary
|
|
90
|
-
size="s"
|
|
91
|
-
label="Save Query"
|
|
92
|
-
class="json-query-menu-save-button"
|
|
93
|
-
@click="onSave"
|
|
94
|
-
/>
|
|
35
|
+
<span class="json-query-menu-option">
|
|
36
|
+
{{ scope.opt.label }}
|
|
37
|
+
</span>
|
|
95
38
|
</template>
|
|
96
39
|
</dl-select>
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/>
|
|
107
|
-
<dl-button
|
|
108
|
-
icon="icon-dl-copy"
|
|
109
|
-
tooltip="Copy"
|
|
110
|
-
flat
|
|
111
|
-
color="secondary"
|
|
112
|
-
padding="0px 3px"
|
|
113
|
-
:disabled="alignDisabled"
|
|
114
|
-
@click="copyJSON"
|
|
115
|
-
/>
|
|
116
|
-
</div>
|
|
40
|
+
<dl-button
|
|
41
|
+
icon="icon-dl-align-left"
|
|
42
|
+
label="Align Left"
|
|
43
|
+
flat
|
|
44
|
+
color="secondary"
|
|
45
|
+
padding="0px 3px"
|
|
46
|
+
:disabled="alignDisabled"
|
|
47
|
+
@click="alignJSON"
|
|
48
|
+
/>
|
|
117
49
|
</div>
|
|
118
50
|
<dl-json-editor
|
|
119
51
|
ref="jsonEditor"
|
|
@@ -133,7 +65,7 @@
|
|
|
133
65
|
flat
|
|
134
66
|
color="secondary"
|
|
135
67
|
padding="0"
|
|
136
|
-
@click="
|
|
68
|
+
@click="showDeleteDialog = true"
|
|
137
69
|
/>
|
|
138
70
|
<div class="json-editor-footer-actions">
|
|
139
71
|
<dl-button
|
|
@@ -169,20 +101,27 @@
|
|
|
169
101
|
<template #body>
|
|
170
102
|
<dl-input
|
|
171
103
|
v-model="newQueryName"
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
placeholder="Insert query name"
|
|
104
|
+
title="Query name"
|
|
105
|
+
style="text-align: center"
|
|
106
|
+
placeholder="Type query name"
|
|
176
107
|
/>
|
|
177
108
|
</template>
|
|
178
109
|
<template #footer>
|
|
179
110
|
<div class="dl-smart-search__buttons--save">
|
|
180
111
|
<dl-button
|
|
181
112
|
:disabled="!newQueryName"
|
|
113
|
+
outlined
|
|
114
|
+
style="margin-right: 5px"
|
|
182
115
|
@click="() => saveQuery(false)"
|
|
183
116
|
>
|
|
184
117
|
Save
|
|
185
118
|
</dl-button>
|
|
119
|
+
<dl-button
|
|
120
|
+
:disabled="!newQueryName"
|
|
121
|
+
@click="() => saveQuery(true)"
|
|
122
|
+
>
|
|
123
|
+
Save and Search
|
|
124
|
+
</dl-button>
|
|
186
125
|
</div>
|
|
187
126
|
</template>
|
|
188
127
|
</dl-dialog-box>
|
|
@@ -196,13 +135,12 @@
|
|
|
196
135
|
/>
|
|
197
136
|
</template>
|
|
198
137
|
<template #body>
|
|
199
|
-
<dl-typography
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
This action cannot be undone.
|
|
138
|
+
<dl-typography
|
|
139
|
+
size="h3"
|
|
140
|
+
style="display: flex; justify-content: center"
|
|
141
|
+
>
|
|
142
|
+
Are you sure you want to delete
|
|
143
|
+
{{ selectedOption.label }}?
|
|
206
144
|
</dl-typography>
|
|
207
145
|
</template>
|
|
208
146
|
<template #footer>
|
|
@@ -228,12 +166,10 @@ import {
|
|
|
228
166
|
} from 'vue-demi'
|
|
229
167
|
import { DlSelect } from '../../../DlSelect'
|
|
230
168
|
import { DlSelectOption } from '../../../DlSelect/types'
|
|
231
|
-
import { DlSeparator } from '../../../../essential/DlSeparator'
|
|
232
169
|
import { DlButton } from '../../../../basic'
|
|
233
170
|
import { DlDialogBox, DlDialogBoxHeader } from '../../../DlDialogBox'
|
|
234
171
|
import { DlJsonEditor } from '../../../DlJsonEditor'
|
|
235
|
-
import {
|
|
236
|
-
import { DlTypography, DlIcon } from '../../../../essential'
|
|
172
|
+
import { DlTypography } from '../../../../essential'
|
|
237
173
|
import { DlInput } from '../../../DlInput'
|
|
238
174
|
import { stateManager } from '../../../../../StateManager'
|
|
239
175
|
import { cloneDeep, isEqual, uniqBy } from 'lodash'
|
|
@@ -243,12 +179,9 @@ export default defineComponent({
|
|
|
243
179
|
components: {
|
|
244
180
|
DlDialogBox,
|
|
245
181
|
DlDialogBoxHeader,
|
|
246
|
-
DlIcon,
|
|
247
182
|
DlJsonEditor,
|
|
248
183
|
DlButton,
|
|
249
184
|
DlSelect,
|
|
250
|
-
DlSeparator,
|
|
251
|
-
DlTooltip,
|
|
252
185
|
DlTypography,
|
|
253
186
|
DlInput
|
|
254
187
|
},
|
|
@@ -281,24 +214,11 @@ export default defineComponent({
|
|
|
281
214
|
'update:modelValue',
|
|
282
215
|
'search',
|
|
283
216
|
'change',
|
|
284
|
-
'copied',
|
|
285
217
|
'update:options',
|
|
286
218
|
'save',
|
|
287
219
|
'delete',
|
|
288
220
|
'select'
|
|
289
221
|
],
|
|
290
|
-
methods: {
|
|
291
|
-
onDelete(option: DlSelectOption) {
|
|
292
|
-
const select = this.$refs['jsonQueryMenu'] as InstanceType<typeof DlSelect>
|
|
293
|
-
select?.closeMenu()
|
|
294
|
-
this.optionToDelete = option
|
|
295
|
-
},
|
|
296
|
-
onSave() {
|
|
297
|
-
const select = this.$refs['jsonQueryMenu'] as InstanceType<typeof DlSelect>
|
|
298
|
-
select?.closeMenu()
|
|
299
|
-
this.showSaveDialog = true
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
222
|
setup(props, { emit }) {
|
|
303
223
|
const { modelValue, options, json, selectedFilter } = toRefs(props)
|
|
304
224
|
|
|
@@ -310,15 +230,7 @@ export default defineComponent({
|
|
|
310
230
|
const currentQuery = ref<{ [key: string]: any }>(cloneDeep(json.value))
|
|
311
231
|
const jsonEditor = ref<any>(null)
|
|
312
232
|
const showSaveDialog = ref(false)
|
|
313
|
-
const
|
|
314
|
-
const showDeleteDialog = computed<boolean>({
|
|
315
|
-
get: () => !!optionToDelete.value,
|
|
316
|
-
set: (val) => {
|
|
317
|
-
if (!val) {
|
|
318
|
-
optionToDelete.value = null
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
})
|
|
233
|
+
const showDeleteDialog = ref(false)
|
|
322
234
|
const newQueryName = ref('')
|
|
323
235
|
const alignDisabled = ref(false)
|
|
324
236
|
|
|
@@ -361,11 +273,6 @@ export default defineComponent({
|
|
|
361
273
|
jsonEditor.value?.format()
|
|
362
274
|
}
|
|
363
275
|
|
|
364
|
-
const copyJSON = async () => {
|
|
365
|
-
await navigator.clipboard.writeText(stringifiedJSON.value)
|
|
366
|
-
emit('copied')
|
|
367
|
-
}
|
|
368
|
-
|
|
369
276
|
const onQuerySelect = (option: DlSelectOption) => {
|
|
370
277
|
if (option.label === selectedOption.value.label) {
|
|
371
278
|
return
|
|
@@ -449,10 +356,10 @@ export default defineComponent({
|
|
|
449
356
|
|
|
450
357
|
const deleteQuery = () => {
|
|
451
358
|
const toDelete = options.value.find(
|
|
452
|
-
(o: DlSelectOption) => o.label ===
|
|
359
|
+
(o: DlSelectOption) => o.label === selectedOption.value.label
|
|
453
360
|
)
|
|
454
361
|
const newOptions = options.value.filter(
|
|
455
|
-
(o: DlSelectOption) => o.label !==
|
|
362
|
+
(o: DlSelectOption) => o.label !== selectedOption.value.label
|
|
456
363
|
)
|
|
457
364
|
|
|
458
365
|
emit('delete', toDelete)
|
|
@@ -485,11 +392,9 @@ export default defineComponent({
|
|
|
485
392
|
selectedOption,
|
|
486
393
|
hasActiveFilter,
|
|
487
394
|
alignJSON,
|
|
488
|
-
copyJSON,
|
|
489
395
|
onQuerySelect,
|
|
490
396
|
newQueryName,
|
|
491
397
|
alignDisabled,
|
|
492
|
-
optionToDelete,
|
|
493
398
|
showDeleteDialog,
|
|
494
399
|
selectOptions,
|
|
495
400
|
search,
|
|
@@ -502,76 +407,29 @@ export default defineComponent({
|
|
|
502
407
|
})
|
|
503
408
|
</script>
|
|
504
409
|
|
|
505
|
-
<style scoped>
|
|
410
|
+
<style scoped lang="scss">
|
|
506
411
|
.json-editor-layout {
|
|
507
412
|
display: flex;
|
|
508
413
|
flex-direction: column;
|
|
509
414
|
height: 100%;
|
|
510
415
|
}
|
|
511
416
|
|
|
512
|
-
.json-editor-footer
|
|
513
|
-
width: 100%;
|
|
514
|
-
display: flex;
|
|
515
|
-
align-items: center;
|
|
516
|
-
justify-content: space-between;
|
|
517
|
-
}
|
|
417
|
+
.json-editor-footer,
|
|
518
418
|
.json-query-menu {
|
|
419
|
+
width: 100%;
|
|
519
420
|
display: flex;
|
|
520
421
|
align-items: center;
|
|
521
|
-
background-color: var(--dl-color-fill);
|
|
522
422
|
justify-content: space-between;
|
|
523
|
-
padding: 6px 16px;
|
|
524
423
|
}
|
|
525
424
|
.json-editor {
|
|
526
|
-
height:
|
|
527
|
-
--jse-main-border: none;
|
|
425
|
+
height: 100%;
|
|
528
426
|
}
|
|
529
427
|
|
|
530
428
|
.json-query-menu-option {
|
|
531
|
-
display: flex;
|
|
532
|
-
flex-direction: row;
|
|
533
|
-
}
|
|
534
|
-
.json-query-menu-option-label,
|
|
535
|
-
.json-query-menu-selected {
|
|
536
|
-
padding-top: 3px;
|
|
537
429
|
white-space: nowrap;
|
|
538
430
|
display: inline-block;
|
|
539
431
|
width: 265px;
|
|
540
432
|
overflow: hidden;
|
|
541
433
|
text-overflow: ellipsis;
|
|
542
434
|
}
|
|
543
|
-
.json-query-menu-option:hover .json-query-menu-option-label {
|
|
544
|
-
margin-right: 6px;
|
|
545
|
-
width: 255px;
|
|
546
|
-
}
|
|
547
|
-
.json-query-menu-option-delete {
|
|
548
|
-
overflow-x: hidden;
|
|
549
|
-
width: 0;
|
|
550
|
-
}
|
|
551
|
-
.json-query-menu-option:hover .json-query-menu-option-delete {
|
|
552
|
-
border-radius: 4px;
|
|
553
|
-
overflow-x: visible;
|
|
554
|
-
padding: 4px;
|
|
555
|
-
width: auto;
|
|
556
|
-
}
|
|
557
|
-
.json-query-menu-option-delete:hover {
|
|
558
|
-
background-color: var(--dl-color-fill-secondary);
|
|
559
|
-
}
|
|
560
|
-
.json-query-menu-option-delete:active {
|
|
561
|
-
background-color: var(--dl-color-negative-background);
|
|
562
|
-
}
|
|
563
|
-
.json-query-menu-no-option {
|
|
564
|
-
display: flex;
|
|
565
|
-
padding: 20px 0;
|
|
566
|
-
flex-direction: column;
|
|
567
|
-
align-items: center;
|
|
568
|
-
align-self: stretch;
|
|
569
|
-
}
|
|
570
|
-
.json-query-menu-save-button:hover {
|
|
571
|
-
background-color: var(--dl-color-fill-secondary);
|
|
572
|
-
}
|
|
573
|
-
.dl-smart-search__buttons--save {
|
|
574
|
-
text-align: right;
|
|
575
|
-
width: 100%;
|
|
576
|
-
}
|
|
577
435
|
</style>
|
|
@@ -170,17 +170,13 @@
|
|
|
170
170
|
<slot name="before-options" />
|
|
171
171
|
</dl-item-section>
|
|
172
172
|
</dl-list-item>
|
|
173
|
-
<dl-list-item
|
|
174
|
-
v-if="noOptions"
|
|
175
|
-
:style="computedNoOptionsStyle"
|
|
176
|
-
:padding="noOptionsPadding"
|
|
177
|
-
>
|
|
173
|
+
<dl-list-item v-if="noOptions" :style="computedNoOptionsStyle">
|
|
178
174
|
<dl-item-section color="dl-color-medium">
|
|
179
175
|
<slot name="no-options"> No options </slot>
|
|
180
176
|
</dl-item-section>
|
|
181
177
|
</dl-list-item>
|
|
182
178
|
<dl-list
|
|
183
|
-
v-
|
|
179
|
+
v-if="showMenuList"
|
|
184
180
|
class="select-list"
|
|
185
181
|
:padding="false"
|
|
186
182
|
:style="
|
|
@@ -519,10 +515,6 @@ export default defineComponent({
|
|
|
519
515
|
type: String,
|
|
520
516
|
default: null
|
|
521
517
|
},
|
|
522
|
-
noOptionsPadding: {
|
|
523
|
-
type: String,
|
|
524
|
-
default: null
|
|
525
|
-
},
|
|
526
518
|
keepFocusOnBlur: {
|
|
527
519
|
type: Boolean,
|
|
528
520
|
default: false
|
|
@@ -1056,11 +1048,7 @@ export default defineComponent({
|
|
|
1056
1048
|
return !!option?.readonly
|
|
1057
1049
|
},
|
|
1058
1050
|
isDisableRowOption(option: DlSelectOptionType) {
|
|
1059
|
-
return
|
|
1060
|
-
typeof option === 'object' &&
|
|
1061
|
-
option !== null &&
|
|
1062
|
-
!!option.disableRow
|
|
1063
|
-
)
|
|
1051
|
+
return typeof option === 'object' && option !== null && !!option.disableRow
|
|
1064
1052
|
},
|
|
1065
1053
|
getOptionCount(option: any) {
|
|
1066
1054
|
return option?.count ?? null
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<dl-list-item
|
|
18
18
|
v-else
|
|
19
19
|
class="option"
|
|
20
|
-
:class="{
|
|
20
|
+
:class="{
|
|
21
21
|
highlighted: highlightSelected && isSelected,
|
|
22
22
|
'disabled-row': disableRow
|
|
23
23
|
}"
|
|
@@ -142,7 +142,10 @@ import { v4 } from 'uuid'
|
|
|
142
142
|
import { debounce } from 'lodash'
|
|
143
143
|
import { stateManager } from '../../../../StateManager'
|
|
144
144
|
import { getCaseInsensitiveInput, getLabel } from '../utils'
|
|
145
|
-
import {
|
|
145
|
+
import {
|
|
146
|
+
DlSelectOption,
|
|
147
|
+
DlSelectOptionType
|
|
148
|
+
} from '../../types'
|
|
146
149
|
|
|
147
150
|
const ValueTypes = [Array, Boolean, String, Number, Object, Function]
|
|
148
151
|
|
|
@@ -403,11 +406,7 @@ export default defineComponent({
|
|
|
403
406
|
return !!option?.readonly
|
|
404
407
|
},
|
|
405
408
|
isDisableRowOption(option: DlSelectOptionType) {
|
|
406
|
-
return
|
|
407
|
-
typeof option === 'object' &&
|
|
408
|
-
option !== null &&
|
|
409
|
-
!!option.disableRow
|
|
410
|
-
)
|
|
409
|
+
return typeof option === 'object' && option !== null && !!option.disableRow
|
|
411
410
|
}
|
|
412
411
|
}
|
|
413
412
|
})
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
<div
|
|
157
157
|
v-if="
|
|
158
158
|
visibleColumns &&
|
|
159
|
-
|
|
159
|
+
visibleColumns.length
|
|
160
160
|
"
|
|
161
161
|
class="visible-columns-justify-end"
|
|
162
162
|
style="width: 100%; display: flex"
|
|
@@ -269,8 +269,8 @@
|
|
|
269
269
|
isRowSelected(getRowKey(props.item))
|
|
270
270
|
? 'selected'
|
|
271
271
|
: hasAnyAction
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
? ' cursor-pointer'
|
|
273
|
+
: ''
|
|
274
274
|
"
|
|
275
275
|
:no-hover="noHover"
|
|
276
276
|
@click="
|
|
@@ -555,7 +555,7 @@
|
|
|
555
555
|
<div
|
|
556
556
|
v-if="
|
|
557
557
|
visibleColumns &&
|
|
558
|
-
|
|
558
|
+
visibleColumns.length
|
|
559
559
|
"
|
|
560
560
|
class="visible-columns-justify-end"
|
|
561
561
|
style="width: 100%; display: flex"
|
|
@@ -666,8 +666,8 @@
|
|
|
666
666
|
<dl-top-scroll
|
|
667
667
|
v-if="
|
|
668
668
|
tableScroll &&
|
|
669
|
-
|
|
670
|
-
|
|
669
|
+
infiniteScroll &&
|
|
670
|
+
!isDataEmpty
|
|
671
671
|
"
|
|
672
672
|
:container-ref="tableScroll"
|
|
673
673
|
@scroll-to-top="
|
|
@@ -701,8 +701,8 @@
|
|
|
701
701
|
isRowSelected(getRowKey(row))
|
|
702
702
|
? 'selected'
|
|
703
703
|
: hasAnyAction
|
|
704
|
-
|
|
705
|
-
|
|
704
|
+
? ' cursor-pointer'
|
|
705
|
+
: ''
|
|
706
706
|
"
|
|
707
707
|
:no-hover="noHover"
|
|
708
708
|
@click="onTrClick($event, row, pageIndex)"
|
|
@@ -837,8 +837,8 @@
|
|
|
837
837
|
<dl-bottom-scroll
|
|
838
838
|
v-if="
|
|
839
839
|
tableScroll &&
|
|
840
|
-
|
|
841
|
-
|
|
840
|
+
infiniteScroll &&
|
|
841
|
+
!isDataEmpty
|
|
842
842
|
"
|
|
843
843
|
:container-ref="tableScroll"
|
|
844
844
|
@scroll-to-bottom="
|
|
@@ -895,7 +895,7 @@
|
|
|
895
895
|
<div
|
|
896
896
|
v-if="
|
|
897
897
|
hasBottomSelectionBanner &&
|
|
898
|
-
|
|
898
|
+
selectedRowsLabel(rowsSelectedNumber)
|
|
899
899
|
"
|
|
900
900
|
class="dl-table__control"
|
|
901
901
|
>
|
|
@@ -804,9 +804,7 @@ export default defineComponent({
|
|
|
804
804
|
targetRow: finalTarget
|
|
805
805
|
})
|
|
806
806
|
|
|
807
|
-
const isDragValid =
|
|
808
|
-
shouldSkipValidation ||
|
|
809
|
-
checkParentCondition(draggedRow.value, finalTarget)
|
|
807
|
+
const isDragValid = shouldSkipValidation || checkParentCondition(draggedRow.value, finalTarget)
|
|
810
808
|
if (isDragValid) {
|
|
811
809
|
const smartSortingMovement = {
|
|
812
810
|
...sortingMovement.value,
|
|
@@ -931,7 +929,7 @@ export default defineComponent({
|
|
|
931
929
|
}
|
|
932
930
|
|
|
933
931
|
const isValid = checkParentCondition(draggedRow.value, targetRow)
|
|
934
|
-
|
|
932
|
+
|
|
935
933
|
if (isValid) {
|
|
936
934
|
storedValidTarget.value = targetRow
|
|
937
935
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
:id="uuid"
|
|
4
|
-
class="dl-progress-wrapper"
|
|
5
|
-
:style="`width: ${width};`"
|
|
6
|
-
>
|
|
2
|
+
<div :id="uuid" class="dl-progress-wrapper" :style="`width: ${width};`">
|
|
7
3
|
<p
|
|
8
|
-
v-if="label"
|
|
4
|
+
v-if="label || labelSlot"
|
|
9
5
|
data-test-id="progress-label"
|
|
10
6
|
align="left"
|
|
11
7
|
class="dl-progress-bar-label"
|
|
12
8
|
>
|
|
13
9
|
{{ label }}
|
|
10
|
+
<slot name="label"> </slot>
|
|
14
11
|
</p>
|
|
15
12
|
<div class="progress-container">
|
|
16
13
|
<span
|
|
@@ -35,10 +32,7 @@
|
|
|
35
32
|
{{ computedValue }}{{ showPercentage ? '%' : '' }}
|
|
36
33
|
</p>
|
|
37
34
|
</div>
|
|
38
|
-
<div
|
|
39
|
-
v-if="summary"
|
|
40
|
-
class="summary"
|
|
41
|
-
>
|
|
35
|
+
<div v-if="summary" class="summary">
|
|
42
36
|
<div>
|
|
43
37
|
{{ summary }}
|
|
44
38
|
</div>
|
|
@@ -63,6 +57,10 @@ export default defineComponent({
|
|
|
63
57
|
type: String,
|
|
64
58
|
default: null
|
|
65
59
|
},
|
|
60
|
+
labelSlot: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
66
64
|
showValue: {
|
|
67
65
|
type: Boolean,
|
|
68
66
|
required: false,
|
|
@@ -7,14 +7,12 @@
|
|
|
7
7
|
}`"
|
|
8
8
|
>
|
|
9
9
|
<label
|
|
10
|
-
v-if="
|
|
10
|
+
v-if="!!leftLabel"
|
|
11
11
|
class="left dl-switch-label"
|
|
12
12
|
:for="computedId"
|
|
13
13
|
:style="cssLabelVars"
|
|
14
14
|
>
|
|
15
|
-
|
|
16
|
-
{{ leftLabel }}
|
|
17
|
-
</slot>
|
|
15
|
+
{{ leftLabel }}
|
|
18
16
|
</label>
|
|
19
17
|
<span
|
|
20
18
|
class="dl-switch-container"
|
|
@@ -37,14 +35,12 @@
|
|
|
37
35
|
/>
|
|
38
36
|
</span>
|
|
39
37
|
<label
|
|
40
|
-
v-if="
|
|
38
|
+
v-if="!!rightLabel"
|
|
41
39
|
class="right dl-switch-label"
|
|
42
40
|
:for="computedId"
|
|
43
41
|
:style="cssLabelVars"
|
|
44
42
|
>
|
|
45
|
-
|
|
46
|
-
{{ rightLabel }}
|
|
47
|
-
</slot>
|
|
43
|
+
{{ rightLabel }}
|
|
48
44
|
</label>
|
|
49
45
|
</div>
|
|
50
46
|
</template>
|
|
@@ -147,12 +143,6 @@ export default defineComponent({
|
|
|
147
143
|
? this.index === -1
|
|
148
144
|
: toRaw(this.modelValue) === toRaw(this.falseValue)
|
|
149
145
|
},
|
|
150
|
-
hasLeftLabel(): boolean {
|
|
151
|
-
return !!this.leftLabel || !!this.$slots['left-label']
|
|
152
|
-
},
|
|
153
|
-
hasRightLabel(): boolean {
|
|
154
|
-
return !!this.rightLabel || !!this.$slots['right-label']
|
|
155
|
-
},
|
|
156
146
|
cssVars(): Record<string, string> {
|
|
157
147
|
return {
|
|
158
148
|
'--dl-checkbox-height': `${this.size}px`,
|
|
@@ -124,9 +124,7 @@ export default defineComponent({
|
|
|
124
124
|
|
|
125
125
|
let localScrollTarget: HTMLElement | undefined
|
|
126
126
|
const rootRef: Ref<HTMLElement | null> = ref(null)
|
|
127
|
-
const scrollSizeItem: Ref<number> = ref(
|
|
128
|
-
virtualScrollItemSize.value || 40
|
|
129
|
-
)
|
|
127
|
+
const scrollSizeItem: Ref<number> = ref(40)
|
|
130
128
|
|
|
131
129
|
const isDefined = (v: any) => v !== undefined && v !== null
|
|
132
130
|
|
|
@@ -176,26 +176,6 @@
|
|
|
176
176
|
@change="handleModelValueUpdate"
|
|
177
177
|
/>
|
|
178
178
|
</div>
|
|
179
|
-
<div style="width: 500px; margin-top: 30px">
|
|
180
|
-
<div style="margin-bottom: 10px; font-weight: bold">
|
|
181
|
-
Inline Mode
|
|
182
|
-
</div>
|
|
183
|
-
<dl-date-time-range
|
|
184
|
-
v-model="date"
|
|
185
|
-
:type="type"
|
|
186
|
-
width="100%"
|
|
187
|
-
:available-range="range ? availableRange : null"
|
|
188
|
-
:mode="mode"
|
|
189
|
-
:show-time="showTime"
|
|
190
|
-
:auto-close="autoClose"
|
|
191
|
-
:including-current-month="includesCurrentMonthEnd"
|
|
192
|
-
:should-clear-select-first-option="shouldClearSelectFirstOption"
|
|
193
|
-
:disabled-type="type === 'day' ? 'month' : 'day'"
|
|
194
|
-
view-mode="inline"
|
|
195
|
-
@set-type="handleSetType"
|
|
196
|
-
@change="handleModelValueUpdate"
|
|
197
|
-
/>
|
|
198
|
-
</div>
|
|
199
179
|
</div>
|
|
200
180
|
</template>
|
|
201
181
|
<script lang="ts">
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="dl-date-time-range--card">
|
|
3
|
-
<div v-if="mode === 'multi'" class="dl-date-time-range--card_sidebar">
|
|
4
|
-
<card-sidebar
|
|
5
|
-
v-if="typeState === 'day'"
|
|
6
|
-
:options="sidebarDayOptions"
|
|
7
|
-
:current-option="currentSidebarOption"
|
|
8
|
-
@click="handleDayTypeOptionClick"
|
|
9
|
-
/>
|
|
10
|
-
<card-sidebar
|
|
11
|
-
v-else
|
|
12
|
-
:options="sidebarMonthOptions"
|
|
13
|
-
:current-option="currentSidebarOption"
|
|
14
|
-
@click="handleMonthTypeOptionClick"
|
|
15
|
-
/>
|
|
16
|
-
</div>
|
|
17
|
-
<div
|
|
18
|
-
class="dl-date-time-range--card_content"
|
|
19
|
-
:style="cardContentStyles"
|
|
20
|
-
>
|
|
21
|
-
<dl-date-picker
|
|
22
|
-
:model-value="dateInterval"
|
|
23
|
-
:type="typeState"
|
|
24
|
-
:available-range="availableRange"
|
|
25
|
-
:disabled="isInputDisabled"
|
|
26
|
-
:normalize-calendars="normalizeCalendars"
|
|
27
|
-
:active-date-from="activeDateFrom"
|
|
28
|
-
:active-date-to="activeDateTo"
|
|
29
|
-
@update:model-value="updateDateIntervalWithAutoClose"
|
|
30
|
-
@update:from-to-date="updateFromToDate"
|
|
31
|
-
/>
|
|
32
|
-
<dl-time-picker
|
|
33
|
-
v-if="showTime && typeState === 'day'"
|
|
34
|
-
:disabled="isInputDisabled"
|
|
35
|
-
:model-value="dateInterval"
|
|
36
|
-
@update:model-value="updateDateInterval"
|
|
37
|
-
/>
|
|
38
|
-
|
|
39
|
-
<dl-button
|
|
40
|
-
v-if="!hideClearButton"
|
|
41
|
-
size="s"
|
|
42
|
-
outlined
|
|
43
|
-
class="dl-date-time-range--button"
|
|
44
|
-
@click="handleClear"
|
|
45
|
-
>
|
|
46
|
-
<span style="text-transform: capitalize"> Clear </span>
|
|
47
|
-
</dl-button>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<script lang="ts">
|
|
53
|
-
import { defineComponent, PropType } from 'vue-demi'
|
|
54
|
-
import { DlTimePicker } from '../DlTimePicker'
|
|
55
|
-
import { DateInterval } from '../types'
|
|
56
|
-
import CardSidebar from './CardSidebar.vue'
|
|
57
|
-
import { DayTypeOption, MonthTypeOption } from './types'
|
|
58
|
-
import DlDatePicker from '../DlDatePicker/DlDatePicker.vue'
|
|
59
|
-
import { CalendarDate } from '../DlDatePicker/models/CalendarDate'
|
|
60
|
-
import { DlButton } from '../../../basic'
|
|
61
|
-
|
|
62
|
-
export default defineComponent({
|
|
63
|
-
components: {
|
|
64
|
-
CardSidebar,
|
|
65
|
-
DlDatePicker,
|
|
66
|
-
DlTimePicker,
|
|
67
|
-
DlButton
|
|
68
|
-
},
|
|
69
|
-
props: {
|
|
70
|
-
mode: {
|
|
71
|
-
type: String as PropType<'single' | 'multi'>,
|
|
72
|
-
required: true
|
|
73
|
-
},
|
|
74
|
-
typeState: {
|
|
75
|
-
type: String as PropType<'day' | 'month'>,
|
|
76
|
-
required: true
|
|
77
|
-
},
|
|
78
|
-
sidebarDayOptions: {
|
|
79
|
-
type: Array as PropType<DayTypeOption[]>,
|
|
80
|
-
required: true
|
|
81
|
-
},
|
|
82
|
-
sidebarMonthOptions: {
|
|
83
|
-
type: Array as PropType<MonthTypeOption[]>,
|
|
84
|
-
required: true
|
|
85
|
-
},
|
|
86
|
-
currentSidebarOption: {
|
|
87
|
-
type: String,
|
|
88
|
-
required: true
|
|
89
|
-
},
|
|
90
|
-
dateInterval: {
|
|
91
|
-
type: Object as PropType<DateInterval | null>,
|
|
92
|
-
default: null
|
|
93
|
-
},
|
|
94
|
-
availableRange: {
|
|
95
|
-
type: Object as PropType<Partial<DateInterval> | null>,
|
|
96
|
-
default: null
|
|
97
|
-
},
|
|
98
|
-
isInputDisabled: {
|
|
99
|
-
type: Boolean,
|
|
100
|
-
default: false
|
|
101
|
-
},
|
|
102
|
-
normalizeCalendars: {
|
|
103
|
-
type: Boolean,
|
|
104
|
-
default: false
|
|
105
|
-
},
|
|
106
|
-
activeDateFrom: {
|
|
107
|
-
type: Object as PropType<CalendarDate | null>,
|
|
108
|
-
default: null
|
|
109
|
-
},
|
|
110
|
-
activeDateTo: {
|
|
111
|
-
type: Object as PropType<CalendarDate | null>,
|
|
112
|
-
default: null
|
|
113
|
-
},
|
|
114
|
-
showTime: {
|
|
115
|
-
type: Boolean,
|
|
116
|
-
default: false
|
|
117
|
-
},
|
|
118
|
-
cardContentStyles: {
|
|
119
|
-
type: Object as PropType<Record<string, any>>,
|
|
120
|
-
default: () => ({})
|
|
121
|
-
},
|
|
122
|
-
hideClearButton: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: false
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
emits: [
|
|
128
|
-
'day-type-option-click',
|
|
129
|
-
'month-type-option-click',
|
|
130
|
-
'update-date-interval',
|
|
131
|
-
'update-date-interval-with-auto-close',
|
|
132
|
-
'update-from-to-date',
|
|
133
|
-
'clear'
|
|
134
|
-
],
|
|
135
|
-
methods: {
|
|
136
|
-
handleDayTypeOptionClick(option: DayTypeOption) {
|
|
137
|
-
this.$emit('day-type-option-click', option)
|
|
138
|
-
},
|
|
139
|
-
handleMonthTypeOptionClick(option: MonthTypeOption) {
|
|
140
|
-
this.$emit('month-type-option-click', option)
|
|
141
|
-
},
|
|
142
|
-
updateDateInterval(value: DateInterval | null) {
|
|
143
|
-
this.$emit('update-date-interval', value)
|
|
144
|
-
},
|
|
145
|
-
updateDateIntervalWithAutoClose(value: DateInterval) {
|
|
146
|
-
this.$emit('update-date-interval-with-auto-close', value)
|
|
147
|
-
},
|
|
148
|
-
updateFromToDate(value?: { from: CalendarDate; to: CalendarDate }) {
|
|
149
|
-
this.$emit('update-from-to-date', value)
|
|
150
|
-
},
|
|
151
|
-
handleClear() {
|
|
152
|
-
this.$emit('clear')
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
</script>
|
|
157
|
-
|
|
158
|
-
<style lang="scss" scoped>
|
|
159
|
-
.dl-date-time-range--card {
|
|
160
|
-
background-color: var(--dl-color-bg);
|
|
161
|
-
z-index: 1;
|
|
162
|
-
display: flex;
|
|
163
|
-
border-radius: 2px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.dl-date-time-range--card_content {
|
|
167
|
-
width: var(--card-content-width);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.dl-date-time-range--button {
|
|
171
|
-
display: flex;
|
|
172
|
-
margin-left: auto;
|
|
173
|
-
width: fit-content;
|
|
174
|
-
margin-right: 16px;
|
|
175
|
-
margin-bottom: 16px;
|
|
176
|
-
}
|
|
177
|
-
</style>
|