@dataloop-ai/components 0.20.186-ds-v3.0 → 0.20.186
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/globals.scss +226 -3
- package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +106 -101
- package/src/components/compound/DlDateTime/DlDateTimeRange/types.ts +0 -5
- package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +27 -24
- 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/DlSmartSearch.vue +8 -3
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +18 -58
- 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 +15 -12
- package/src/components/compound/DlTable/hooks/use-sortable.ts +148 -5
- package/src/components/compound/DlTreeTable/DlTreeTable.vue +55 -31
- package/src/components/compound/DlTreeTable/views/DlTrTreeView.vue +1 -1
- 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/globals.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import './theme.css';
|
|
2
2
|
|
|
3
3
|
body {
|
|
4
4
|
& > * {
|
|
@@ -8,6 +8,231 @@ body {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
html.dl-sortable--dragging,
|
|
12
|
+
html.dl-sortable--dragging * {
|
|
13
|
+
cursor: grabbing !important;
|
|
14
|
+
user-select: none !important;
|
|
15
|
+
-webkit-user-select: none !important;
|
|
16
|
+
-moz-user-select: none !important;
|
|
17
|
+
-ms-user-select: none !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.dl-table-fallback-row.sortable-drag {
|
|
21
|
+
display: table !important;
|
|
22
|
+
table-layout: fixed;
|
|
23
|
+
border-collapse: collapse;
|
|
24
|
+
border-spacing: 0;
|
|
25
|
+
font-family: 'Roboto', sans-serif;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
font-style: normal;
|
|
28
|
+
font-size: var(--dl-font-size-body);
|
|
29
|
+
line-height: 14px;
|
|
30
|
+
color: var(--dl-color-darker);
|
|
31
|
+
background-color: var(--dl-color-fill-hover);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
tr.dl-table-fallback-row.sortable-drag {
|
|
35
|
+
display: table !important;
|
|
36
|
+
table-layout: fixed;
|
|
37
|
+
border-collapse: collapse;
|
|
38
|
+
border-spacing: 0;
|
|
39
|
+
font-family: 'Roboto', sans-serif;
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
font-style: normal;
|
|
42
|
+
font-size: var(--dl-font-size-body);
|
|
43
|
+
line-height: 14px;
|
|
44
|
+
color: var(--dl-color-darker);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
tr.dl-table-fallback-row.sortable-drag > th,
|
|
48
|
+
tr.dl-table-fallback-row.sortable-drag > td {
|
|
49
|
+
display: table-cell;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
background-color: var(--dl-color-fill-hover);
|
|
52
|
+
color: var(--dl-color-darker);
|
|
53
|
+
vertical-align: middle;
|
|
54
|
+
height: 40px;
|
|
55
|
+
padding-top: 0 !important;
|
|
56
|
+
padding-bottom: 0 !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
tbody.dl-table-fallback-row.sortable-drag {
|
|
60
|
+
display: table-row-group !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dl-tree-table-fallback-row.sortable-drag {
|
|
64
|
+
display: table !important;
|
|
65
|
+
table-layout: fixed;
|
|
66
|
+
border-collapse: collapse;
|
|
67
|
+
border-spacing: 0;
|
|
68
|
+
font-family: 'Roboto', sans-serif;
|
|
69
|
+
font-weight: 400;
|
|
70
|
+
font-style: normal;
|
|
71
|
+
font-size: var(--dl-font-size-body);
|
|
72
|
+
line-height: 14px;
|
|
73
|
+
color: var(--dl-color-darker);
|
|
74
|
+
background-color: var(--dl-color-panel-background);
|
|
75
|
+
border-radius: 4px;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
tr.dl-tree-table-fallback-row.sortable-drag {
|
|
81
|
+
display: table !important;
|
|
82
|
+
table-layout: fixed;
|
|
83
|
+
border-collapse: collapse;
|
|
84
|
+
border-spacing: 0;
|
|
85
|
+
font-family: 'Roboto', sans-serif;
|
|
86
|
+
font-weight: 400;
|
|
87
|
+
font-style: normal;
|
|
88
|
+
font-size: var(--dl-font-size-body);
|
|
89
|
+
line-height: 14px;
|
|
90
|
+
color: var(--dl-color-darker);
|
|
91
|
+
background-color: var(--dl-color-panel-background);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
tr.dl-tree-table-fallback-row.sortable-drag > th,
|
|
95
|
+
tr.dl-tree-table-fallback-row.sortable-drag > td {
|
|
96
|
+
display: table-cell;
|
|
97
|
+
box-sizing: border-box;
|
|
98
|
+
background-color: var(--dl-color-fill-hover);
|
|
99
|
+
color: var(--dl-color-darker);
|
|
100
|
+
vertical-align: middle;
|
|
101
|
+
height: 40px;
|
|
102
|
+
padding-top: 0 !important;
|
|
103
|
+
padding-bottom: 0 !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
tbody.dl-tree-table-fallback-row.sortable-drag {
|
|
107
|
+
display: table-row-group !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.dl-table-fallback-row.sortable-drag > tr {
|
|
111
|
+
display: table-row;
|
|
112
|
+
height: 40px;
|
|
113
|
+
vertical-align: middle;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.dl-tree-table-fallback-row.sortable-drag > tr {
|
|
117
|
+
display: table-row;
|
|
118
|
+
height: 40px;
|
|
119
|
+
vertical-align: middle;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.dl-table-fallback-row.sortable-drag > tr > th,
|
|
123
|
+
.dl-table-fallback-row.sortable-drag > tr > td {
|
|
124
|
+
display: table-cell;
|
|
125
|
+
box-sizing: border-box;
|
|
126
|
+
background-color: var(--dl-color-fill-hover);
|
|
127
|
+
color: var(--dl-color-darker);
|
|
128
|
+
vertical-align: middle;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.dl-tree-table-fallback-row.sortable-drag > tr > th,
|
|
132
|
+
.dl-tree-table-fallback-row.sortable-drag > tr > td {
|
|
133
|
+
display: table-cell;
|
|
134
|
+
box-sizing: border-box;
|
|
135
|
+
background-color: var(--dl-color-fill-hover);
|
|
136
|
+
color: var(--dl-color-darker);
|
|
137
|
+
vertical-align: middle;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.dl-tree-table-fallback-row.sortable-drag > tr:first-child > th,
|
|
141
|
+
.dl-tree-table-fallback-row.sortable-drag > tr:first-child > td {
|
|
142
|
+
background-color: var(--dl-color-fill-hover);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.dl-tree-table-fallback-row.sortable-drag > tr:not(:first-child) > th,
|
|
146
|
+
.dl-tree-table-fallback-row.sortable-drag > tr:not(:first-child) > td {
|
|
147
|
+
background-color: var(--dl-color-fill-hover);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
151
|
+
tr[data-level]:not([data-level='1'])
|
|
152
|
+
> td:first-child,
|
|
153
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
154
|
+
tr[data-level]:not([data-level='1'])
|
|
155
|
+
> td.dl-table--col-auto-width,
|
|
156
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
157
|
+
tr[data-level]:not([data-level='1'])
|
|
158
|
+
> td.chevron-icon-container {
|
|
159
|
+
background-color: transparent !important;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
163
|
+
tr[data-level]:not([data-level='1'])
|
|
164
|
+
> td.chevron-icon-container,
|
|
165
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
166
|
+
tr[data-level]:not([data-level='1'])
|
|
167
|
+
> td.chevron-icon-container
|
|
168
|
+
*,
|
|
169
|
+
.dl-tree-table-fallback-row.sortable-drag > tr:not(:first-child) .chevron-icon,
|
|
170
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
171
|
+
tr[data-level]:not([data-level='1'])
|
|
172
|
+
.chevron-icon
|
|
173
|
+
* {
|
|
174
|
+
background-color: transparent !important;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
178
|
+
tbody[data-level]:not([data-level='1'])
|
|
179
|
+
> tr
|
|
180
|
+
> td:first-child,
|
|
181
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
182
|
+
tbody[data-level]:not([data-level='1'])
|
|
183
|
+
> tr
|
|
184
|
+
> td.dl-table--col-auto-width,
|
|
185
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
186
|
+
tbody[data-level]:not([data-level='1'])
|
|
187
|
+
> tr
|
|
188
|
+
> td.chevron-icon-container {
|
|
189
|
+
background-color: transparent !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
193
|
+
tbody[data-level]:not([data-level='1'])
|
|
194
|
+
> tr
|
|
195
|
+
> td:nth-child(-n + 3) {
|
|
196
|
+
background-color: transparent !important;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
200
|
+
tr:not(:first-child)
|
|
201
|
+
> td:nth-child(-n + 3) {
|
|
202
|
+
background-color: transparent !important;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
206
|
+
tbody[data-level]:not([data-level='1'])
|
|
207
|
+
> tr
|
|
208
|
+
> td.chevron-icon-container,
|
|
209
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
210
|
+
tbody[data-level]:not([data-level='1'])
|
|
211
|
+
> tr
|
|
212
|
+
> td.chevron-icon-container
|
|
213
|
+
*,
|
|
214
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
215
|
+
tbody[data-level]:not([data-level='1'])
|
|
216
|
+
.chevron-icon,
|
|
217
|
+
.dl-tree-table-fallback-row.sortable-drag
|
|
218
|
+
tbody[data-level]:not([data-level='1'])
|
|
219
|
+
.chevron-icon
|
|
220
|
+
* {
|
|
221
|
+
background-color: transparent !important;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.dl-table-fallback-row.sortable-drag .draggable-icon {
|
|
225
|
+
visibility: hidden !important;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.dl-tree-table-fallback-row.sortable-drag .draggable-icon {
|
|
229
|
+
visibility: hidden !important;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.dl-table-fallback-row.sortable-drag > tr:not(:first-child) {
|
|
233
|
+
display: none !important;
|
|
234
|
+
}
|
|
235
|
+
|
|
11
236
|
// tranform
|
|
12
237
|
.rotate-180 {
|
|
13
238
|
transform: rotate(180deg);
|
|
@@ -145,7 +370,6 @@ body {
|
|
|
145
370
|
}
|
|
146
371
|
|
|
147
372
|
.non-draggable {
|
|
148
|
-
user-drag: none;
|
|
149
373
|
-webkit-user-drag: none;
|
|
150
374
|
user-select: none;
|
|
151
375
|
-moz-user-select: none;
|
|
@@ -185,7 +409,6 @@ body {
|
|
|
185
409
|
height: 100%;
|
|
186
410
|
}
|
|
187
411
|
|
|
188
|
-
|
|
189
412
|
// scrollbar
|
|
190
413
|
|
|
191
414
|
html {
|
|
@@ -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>
|
|
@@ -58,17 +58,15 @@
|
|
|
58
58
|
:style="`
|
|
59
59
|
background-color: ${separatorColor}`"
|
|
60
60
|
/>
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/>
|
|
71
|
-
</slot>
|
|
61
|
+
<dl-icon
|
|
62
|
+
class="expand-icon"
|
|
63
|
+
:class="iconClass"
|
|
64
|
+
:icon="dropdownIcon"
|
|
65
|
+
:size="iconSize"
|
|
66
|
+
:color="getIconColor"
|
|
67
|
+
:tooltip="iconTooltip"
|
|
68
|
+
@click="onIconClicked"
|
|
69
|
+
/>
|
|
72
70
|
</dl-button>
|
|
73
71
|
<dl-menu
|
|
74
72
|
ref="menuRef"
|
|
@@ -118,7 +116,10 @@
|
|
|
118
116
|
@click="onClick"
|
|
119
117
|
>
|
|
120
118
|
<div class="dl-button-dropdown--simple__title">
|
|
121
|
-
<
|
|
119
|
+
<template v-if="hasLabelSlot">
|
|
120
|
+
<slot name="label" />
|
|
121
|
+
</template>
|
|
122
|
+
<template v-else>
|
|
122
123
|
<span
|
|
123
124
|
:class="{
|
|
124
125
|
'dl-button-no-wrap': noWrap
|
|
@@ -127,17 +128,15 @@
|
|
|
127
128
|
>
|
|
128
129
|
{{ label }}
|
|
129
130
|
</span>
|
|
130
|
-
</
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
/>
|
|
140
|
-
</slot>
|
|
131
|
+
</template>
|
|
132
|
+
<dl-icon
|
|
133
|
+
:class="iconClass"
|
|
134
|
+
:icon="dropdownIcon"
|
|
135
|
+
:size="iconSize"
|
|
136
|
+
:color="getIconColor"
|
|
137
|
+
:tooltip="iconTooltip"
|
|
138
|
+
@click="onIconClicked"
|
|
139
|
+
/>
|
|
141
140
|
</div>
|
|
142
141
|
|
|
143
142
|
<dl-menu
|
|
@@ -302,6 +301,9 @@ export default defineComponent({
|
|
|
302
301
|
const showing = ref<boolean>(!!props.modelValue) as Ref<boolean>
|
|
303
302
|
const menuRef = ref(null)
|
|
304
303
|
|
|
304
|
+
const hasLabelSlot = computed(() => {
|
|
305
|
+
return !!slots.label
|
|
306
|
+
})
|
|
305
307
|
const attributes = computed(() => {
|
|
306
308
|
const acc: Record<string, string> = {
|
|
307
309
|
'aria-expanded': showing.value === true ? 'true' : 'false',
|
|
@@ -510,7 +512,8 @@ export default defineComponent({
|
|
|
510
512
|
cssVars,
|
|
511
513
|
getIconColor,
|
|
512
514
|
computedTextColor,
|
|
513
|
-
separatorColor
|
|
515
|
+
separatorColor,
|
|
516
|
+
hasLabelSlot
|
|
514
517
|
}
|
|
515
518
|
}
|
|
516
519
|
})
|
|
@@ -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
|
})
|