@webitel/ui-sdk 3.1.35 → 3.1.36
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/dist/ui-sdk.common.js +6774 -6922
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +6774 -6922
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +8 -9
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/index.js +0 -2
- package/src/components/molecules/wt-datepicker/wt-datepicker.vue +106 -39
- package/src/css/components/molecules/wt-datepicker/_variables.scss +52 -17
- package/src/locale/i18n.js +1 -0
- package/src/modules/QueryFilters/components/filter-datetime.vue +3 -2
- package/src/components/molecules/wt-datetimepicker/__tests__/WtDatetimepicker.spec.js +0 -82
- package/src/components/molecules/wt-datetimepicker/wt-datetimepicker.vue +0 -300
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-dropdown
|
|
3
|
-
class="wt-datetimepicker"
|
|
4
|
-
:class="{
|
|
5
|
-
'wt-datetimepicker--active': isOpened,
|
|
6
|
-
'wt-datetimepicker--disabled': disabled,
|
|
7
|
-
}"
|
|
8
|
-
:shown.sync="isOpened"
|
|
9
|
-
placement="bottom-start"
|
|
10
|
-
>
|
|
11
|
-
<wt-label :disabled="disabled" v-bind="labelProps">
|
|
12
|
-
<!-- @slot Custom input label -->
|
|
13
|
-
<slot name="label" v-bind="{ label }">{{ label }}</slot>
|
|
14
|
-
</wt-label>
|
|
15
|
-
<div
|
|
16
|
-
class="wt-datetimepicker__preview"
|
|
17
|
-
tabindex="0"
|
|
18
|
-
@keyup.enter="isOpened = !isOpened"
|
|
19
|
-
>
|
|
20
|
-
<wt-icon class="wt-datetimepicker__calendar-icon" icon="calendar"></wt-icon>
|
|
21
|
-
<input
|
|
22
|
-
class="wt-datetimepicker__preview__input"
|
|
23
|
-
:value="displayValue"
|
|
24
|
-
autocomplete="off"
|
|
25
|
-
readonly
|
|
26
|
-
>
|
|
27
|
-
<wt-icon
|
|
28
|
-
class="wt-datetimepicker__arrow-icon"
|
|
29
|
-
icon="arrow-down"
|
|
30
|
-
></wt-icon>
|
|
31
|
-
</div>
|
|
32
|
-
<template v-slot:popper>
|
|
33
|
-
<div
|
|
34
|
-
class="wt-datetimepicker__form"
|
|
35
|
-
>
|
|
36
|
-
<div class="wt-datetimepicker__quick-filters-wrapper">
|
|
37
|
-
<span class="wt-datetimepicker__quick-filter" @click="setLastHour">
|
|
38
|
-
{{$t('webitelUI.datetimepicker.lastHour')}}
|
|
39
|
-
</span>
|
|
40
|
-
<span class="wt-datetimepicker__quick-filter" @click="setLastDay">
|
|
41
|
-
{{$t('webitelUI.datetimepicker.lastDay')}}
|
|
42
|
-
</span>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="wt-datetimepicker__form-wrapper">
|
|
45
|
-
<!-- <datepicker-->
|
|
46
|
-
<!-- class="wt-datetimepicker__datepicker"-->
|
|
47
|
-
<!-- :value="draft"-->
|
|
48
|
-
<!-- :maximum-view="'day'"-->
|
|
49
|
-
<!-- :disabled-dates="disabledDates"-->
|
|
50
|
-
<!-- monday-first-->
|
|
51
|
-
<!-- inline-->
|
|
52
|
-
<!-- @input="setDraft($event.getTime())"-->
|
|
53
|
-
<!-- ></datepicker>-->
|
|
54
|
-
<wt-datepicker
|
|
55
|
-
class="wt-datetimepicker__datepicker"
|
|
56
|
-
:value="draft"
|
|
57
|
-
:maximum-view="'day'"
|
|
58
|
-
:disabled-dates="disabledDates"
|
|
59
|
-
monday-first
|
|
60
|
-
inline
|
|
61
|
-
@change="setDraft"
|
|
62
|
-
></wt-datepicker>
|
|
63
|
-
<wt-timepicker
|
|
64
|
-
class="wt-datetimepicker__timepicker"
|
|
65
|
-
v-model="draft"
|
|
66
|
-
format="hh:mm"
|
|
67
|
-
date-mode
|
|
68
|
-
></wt-timepicker>
|
|
69
|
-
</div>
|
|
70
|
-
<div class="wt-datetimepicker__actions">
|
|
71
|
-
<wt-button @click="input">
|
|
72
|
-
{{$t('reusable.add')}}
|
|
73
|
-
</wt-button>
|
|
74
|
-
<wt-button color="secondary" @click="close">
|
|
75
|
-
{{$t('reusable.cancel')}}
|
|
76
|
-
</wt-button>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
</template>
|
|
81
|
-
</v-dropdown>
|
|
82
|
-
</template>
|
|
83
|
-
|
|
84
|
-
<script>
|
|
85
|
-
// import Datepicker from 'vuejs-datepicker';
|
|
86
|
-
|
|
87
|
-
export default {
|
|
88
|
-
name: 'wt-datetimepicker',
|
|
89
|
-
components: {
|
|
90
|
-
// Datepicker,
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
props: {
|
|
94
|
-
value: {
|
|
95
|
-
type: [String, Number],
|
|
96
|
-
default: 0,
|
|
97
|
-
},
|
|
98
|
-
label: {
|
|
99
|
-
type: String,
|
|
100
|
-
default: '',
|
|
101
|
-
},
|
|
102
|
-
disabled: {
|
|
103
|
-
type: Boolean,
|
|
104
|
-
default: false,
|
|
105
|
-
},
|
|
106
|
-
disabledDates: {
|
|
107
|
-
type: Object,
|
|
108
|
-
},
|
|
109
|
-
labelProps: {
|
|
110
|
-
type: Object,
|
|
111
|
-
description: 'Object with props, passed down to wt-label as props',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
model: {
|
|
115
|
-
prop: 'value',
|
|
116
|
-
event: 'change',
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
watch: {
|
|
120
|
-
isOpened: {
|
|
121
|
-
handler() {
|
|
122
|
-
this.draft = this.value;
|
|
123
|
-
},
|
|
124
|
-
immediate: true,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
data: () => ({
|
|
129
|
-
isOpened: false,
|
|
130
|
-
draft: 0,
|
|
131
|
-
}),
|
|
132
|
-
|
|
133
|
-
computed: {
|
|
134
|
-
// prop value representation on picker preview
|
|
135
|
-
displayValue() {
|
|
136
|
-
// const date = new Date(+this.value).toLocaleDateString();
|
|
137
|
-
// const time = new Date(+this.value).toLocaleTimeString() // https://stackoverflow.com/questions/17913681/how-do-i-use-tolocaletimestring-without-displaying-seconds
|
|
138
|
-
// .slice(0, 5);
|
|
139
|
-
// return `${date} ${time}`;
|
|
140
|
-
return new Date(+this.value).toLocaleString();
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
methods: {
|
|
145
|
-
setLastHour() {
|
|
146
|
-
const value = Date.now() - 60 * 60 * 10 ** 3; // 60 min x 60 sec x 1000 ms
|
|
147
|
-
this.$emit('change', value);
|
|
148
|
-
this.close();
|
|
149
|
-
},
|
|
150
|
-
setLastDay() {
|
|
151
|
-
const value = Date.now() - 24 * 60 * 60 * 10 ** 3; // 24hour x 60 min x 60 sec x 1000 ms
|
|
152
|
-
this.$emit('change', value);
|
|
153
|
-
this.close();
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
input() {
|
|
157
|
-
this.$emit('change', this.draft);
|
|
158
|
-
this.close();
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
setDraft(value) {
|
|
162
|
-
this.draft = value;
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
close() {
|
|
166
|
-
this.isOpened = false;
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
};
|
|
170
|
-
</script>
|
|
171
|
-
|
|
172
|
-
<style lang="scss" scoped>
|
|
173
|
-
.wt-datetimepicker {
|
|
174
|
-
position: relative;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.wt-datetimepicker__preview {
|
|
178
|
-
position: relative;
|
|
179
|
-
cursor: text;
|
|
180
|
-
outline: none;
|
|
181
|
-
|
|
182
|
-
&__input {
|
|
183
|
-
@extend %typo-body-1;
|
|
184
|
-
display: block;
|
|
185
|
-
width: 100%;
|
|
186
|
-
box-sizing: border-box;
|
|
187
|
-
padding: var(--datetimepicker-padding);
|
|
188
|
-
border: var(--datetimepicker-border);
|
|
189
|
-
border-color: var(--form-border-color);
|
|
190
|
-
border-radius: var(--border-radius);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.wt-datetimepicker__calendar-icon {
|
|
194
|
-
position: absolute;
|
|
195
|
-
top: 50%;
|
|
196
|
-
left: var(--datetimepicker-icon-margin);
|
|
197
|
-
transform: translateY(-50%);
|
|
198
|
-
pointer-events: none;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.wt-datetimepicker__arrow-icon {
|
|
202
|
-
position: absolute;
|
|
203
|
-
top: 50%;
|
|
204
|
-
right: var(--datetimepicker-icon-margin);
|
|
205
|
-
transform: translateY(-50%);
|
|
206
|
-
pointer-events: none;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.wt-datetimepicker__form {
|
|
211
|
-
padding: var(--datetimepicker-form-padding);
|
|
212
|
-
background: var(--datetimepicker-form-bg-color);
|
|
213
|
-
box-sizing: border-box;
|
|
214
|
-
border: var(--datetimepicker-border);
|
|
215
|
-
border-color: var(--form-border-color);
|
|
216
|
-
border-radius: var(--border-radius);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.wt-datetimepicker__quick-filters-wrapper {
|
|
220
|
-
text-align: center;
|
|
221
|
-
display: flex;
|
|
222
|
-
justify-content: space-evenly;
|
|
223
|
-
margin-bottom: var(--datetimepicker-form-content-margin);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.wt-datetimepicker__quick-filter {
|
|
227
|
-
@extend %typo-caption;
|
|
228
|
-
text-decoration: underline;
|
|
229
|
-
cursor: pointer;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.wt-datetimepicker__form-wrapper {
|
|
233
|
-
display: flex;
|
|
234
|
-
flex-direction: column;
|
|
235
|
-
|
|
236
|
-
.wt-datetimepicker__datepicker ::v-deep {
|
|
237
|
-
.wt-datepicker__calendar-icon,
|
|
238
|
-
.wt-datepicker__arrow-icon {
|
|
239
|
-
display: none;
|
|
240
|
-
}
|
|
241
|
-
.vdp-datepicker__calendar {
|
|
242
|
-
padding: 0;
|
|
243
|
-
border-color: transparent;
|
|
244
|
-
box-shadow: none;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
.wt-datetimepicker__timepicker {
|
|
249
|
-
margin: var(--datetimepicker-form-content-margin) auto 0;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.wt-datetimepicker__actions {
|
|
254
|
-
display: flex;
|
|
255
|
-
justify-content: center;
|
|
256
|
-
margin-top: var(--datetimepicker-form-content-margin);
|
|
257
|
-
|
|
258
|
-
.wt-button {
|
|
259
|
-
&.secondary {
|
|
260
|
-
margin-left: var(--datetimepicker-form-content-margin);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.wt-datetimepicker:hover {
|
|
266
|
-
.wt-label {
|
|
267
|
-
color: var(--form-label--hover-color);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.wt-datetimepicker__preview__input {
|
|
271
|
-
border-color: var(--form-border--hover-color);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.wt-datetimepicker:focus-within,
|
|
276
|
-
.wt-datetimepicker--active {
|
|
277
|
-
.wt-label {
|
|
278
|
-
color: var(--form-label--active-color);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.wt-datetimepicker__preview__input {
|
|
282
|
-
border-color: var(--form-border--active-color);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.wt-datetimepicker--active {
|
|
287
|
-
.wt-datetimepicker__arrow-icon {
|
|
288
|
-
transform: translateY(-50%) rotate(180deg);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.wt-datetimepicker--disabled {
|
|
293
|
-
pointer-events: none;
|
|
294
|
-
|
|
295
|
-
.wt-datetimepicker__preview__input {
|
|
296
|
-
border-color: var(--form-border--disabled-color);
|
|
297
|
-
background: var(--form-border--disabled-color);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
</style>
|