@king-design/vue 3.6.0 → 3.6.2-beta.0
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/__tests__/__snapshots__/Vue Next Demos.md +15 -15
- package/__tests__/components/editable.spec.ts +1 -1
- package/__tests__/components/table.spec.ts +1 -0
- package/components/copy/index.spec.js +14 -31
- package/components/datepicker/index.spec.js +646 -608
- package/components/datepicker/useValueBase.js +5 -2
- package/components/dropdown/constants.d.ts +22 -0
- package/components/dropdown/constants.js +7 -0
- package/components/dropdown/item.js +1 -1
- package/components/dropdown/menu.js +1 -1
- package/components/dropdown/useItemKeyboard.d.ts +6 -0
- package/components/dropdown/useItemKeyboard.js +32 -0
- package/components/dropdown/useMenuKeyboard.d.ts +2 -0
- package/components/dropdown/{useKeyboard.js → useMenuKeyboard.js} +3 -38
- package/components/form/form.d.ts +1 -0
- package/components/form/form.js +7 -0
- package/components/form/index.spec.js +10 -8
- package/components/menu/index.spec.js +28 -0
- package/components/menu/styles.js +2 -2
- package/components/select/index.spec.js +231 -177
- package/components/select/menu.js +1 -1
- package/components/select/useCard.d.ts +4 -3
- package/components/select/useCard.js +15 -4
- package/components/spinner/index.spec.js +82 -44
- package/components/spinner/useValue.js +2 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/yarn-error.log +44 -43
- package/components/dropdown/useKeyboard.d.ts +0 -23
|
@@ -11,7 +11,7 @@ import ClearableDemo from '~/components/datepicker/demos/clearable';
|
|
|
11
11
|
import DatetimeDemo from '~/components/datepicker/demos/datetime';
|
|
12
12
|
import RangeDemo from '~/components/datepicker/demos/range';
|
|
13
13
|
import MultipleDemo from '~/components/datepicker/demos/multiple';
|
|
14
|
-
import { mount, dispatchEvent, wait, getElement } from '../../test/utils';
|
|
14
|
+
import { mount, unmount, dispatchEvent, wait, getElement } from '../../test/utils';
|
|
15
15
|
import { Component } from 'intact-vue-next';
|
|
16
16
|
import { Datepicker } from './';
|
|
17
17
|
import FormatDemo from '~/components/datepicker/demos/format';
|
|
@@ -28,21 +28,21 @@ function clickConfirm(_x) {
|
|
|
28
28
|
function _clickConfirm() {
|
|
29
29
|
_clickConfirm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(content) {
|
|
30
30
|
var confirm;
|
|
31
|
-
return _regeneratorRuntime.wrap(function _callee60$(
|
|
32
|
-
while (1) switch (
|
|
31
|
+
return _regeneratorRuntime.wrap(function _callee60$(_context64) {
|
|
32
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
33
33
|
case 0:
|
|
34
|
-
|
|
34
|
+
_context64.next = 2;
|
|
35
35
|
return wait();
|
|
36
36
|
case 2:
|
|
37
37
|
confirm = content.querySelector('.k-datepicker-footer .k-btn');
|
|
38
38
|
confirm.click();
|
|
39
|
-
|
|
39
|
+
_context64.next = 6;
|
|
40
40
|
return wait();
|
|
41
41
|
case 6:
|
|
42
|
-
return
|
|
42
|
+
return _context64.abrupt("return", confirm);
|
|
43
43
|
case 7:
|
|
44
44
|
case "end":
|
|
45
|
-
return
|
|
45
|
+
return _context64.stop();
|
|
46
46
|
}
|
|
47
47
|
}, _callee60);
|
|
48
48
|
}));
|
|
@@ -57,50 +57,59 @@ function getDateString(date) {
|
|
|
57
57
|
return dayjs(now).date(date).format('YYYY-MM-DD');
|
|
58
58
|
}
|
|
59
59
|
describe('Datepicker', function () {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
61
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
62
|
+
while (1) switch (_context.prev = _context.next) {
|
|
63
|
+
case 0:
|
|
64
|
+
unmount();
|
|
65
|
+
_context.next = 3;
|
|
66
|
+
return wait(500);
|
|
67
|
+
case 3:
|
|
68
|
+
case "end":
|
|
69
|
+
return _context.stop();
|
|
70
|
+
}
|
|
71
|
+
}, _callee);
|
|
72
|
+
})));
|
|
64
73
|
describe('Pick', function () {
|
|
65
|
-
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
74
|
+
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
66
75
|
var _mount, instance, element, input, content;
|
|
67
|
-
return _regeneratorRuntime.wrap(function
|
|
68
|
-
while (1) switch (
|
|
76
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
77
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
69
78
|
case 0:
|
|
70
79
|
_mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
|
|
71
80
|
input = element.querySelector('.k-input');
|
|
72
81
|
input.click();
|
|
73
|
-
|
|
82
|
+
_context2.next = 5;
|
|
74
83
|
return wait();
|
|
75
84
|
case 5:
|
|
76
85
|
content = getElement('.k-datepicker-content');
|
|
77
86
|
content.querySelector('.k-calendar-item').click();
|
|
78
|
-
|
|
87
|
+
_context2.next = 9;
|
|
79
88
|
return wait();
|
|
80
89
|
case 9:
|
|
81
90
|
expect(instance.get('date')).to.be.string;
|
|
82
91
|
checkDisplay(content, false);
|
|
83
92
|
case 11:
|
|
84
93
|
case "end":
|
|
85
|
-
return
|
|
94
|
+
return _context2.stop();
|
|
86
95
|
}
|
|
87
|
-
},
|
|
96
|
+
}, _callee2);
|
|
88
97
|
})));
|
|
89
98
|
describe('datetime', function () {
|
|
90
|
-
it('basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
99
|
+
it('basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
91
100
|
var _mount2, instance, element, input, content;
|
|
92
|
-
return _regeneratorRuntime.wrap(function
|
|
93
|
-
while (1) switch (
|
|
101
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
102
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
94
103
|
case 0:
|
|
95
104
|
_mount2 = mount(DatetimeDemo), instance = _mount2[0], element = _mount2[1];
|
|
96
105
|
input = element.querySelector('.k-input');
|
|
97
106
|
input.click();
|
|
98
|
-
|
|
107
|
+
_context3.next = 5;
|
|
99
108
|
return wait();
|
|
100
109
|
case 5:
|
|
101
110
|
content = getElement('.k-datepicker-content'); // change to time panel
|
|
102
111
|
content.querySelector('.k-calendar-item').click();
|
|
103
|
-
|
|
112
|
+
_context3.next = 9;
|
|
104
113
|
return wait();
|
|
105
114
|
case 9:
|
|
106
115
|
dispatchEvent(content.querySelector('.k-scroll-select-item'), 'click');
|
|
@@ -108,30 +117,30 @@ describe('Datepicker', function () {
|
|
|
108
117
|
expect(instance.get('datetime1').split(' ')[1]).eql('15:00:00');
|
|
109
118
|
case 12:
|
|
110
119
|
case "end":
|
|
111
|
-
return
|
|
120
|
+
return _context3.stop();
|
|
112
121
|
}
|
|
113
|
-
},
|
|
122
|
+
}, _callee3);
|
|
114
123
|
})));
|
|
115
|
-
it('skip select date and select time directly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
124
|
+
it('skip select date and select time directly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
116
125
|
var _mount3, instance, element, input, content, show, _show, inputInner, confirm, activeHour;
|
|
117
|
-
return _regeneratorRuntime.wrap(function
|
|
118
|
-
while (1) switch (
|
|
126
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
127
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
119
128
|
case 0:
|
|
120
129
|
_show = function _show3() {
|
|
121
|
-
_show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
122
|
-
return _regeneratorRuntime.wrap(function
|
|
123
|
-
while (1) switch (
|
|
130
|
+
_show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
131
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
132
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
124
133
|
case 0:
|
|
125
134
|
input.click();
|
|
126
|
-
|
|
135
|
+
_context4.next = 3;
|
|
127
136
|
return wait();
|
|
128
137
|
case 3:
|
|
129
138
|
content = getElement('.k-datepicker-content');
|
|
130
139
|
case 4:
|
|
131
140
|
case "end":
|
|
132
|
-
return
|
|
141
|
+
return _context4.stop();
|
|
133
142
|
}
|
|
134
|
-
},
|
|
143
|
+
}, _callee4);
|
|
135
144
|
}));
|
|
136
145
|
return _show.apply(this, arguments);
|
|
137
146
|
};
|
|
@@ -140,11 +149,11 @@ describe('Datepicker', function () {
|
|
|
140
149
|
};
|
|
141
150
|
_mount3 = mount(DatetimeDemo), instance = _mount3[0], element = _mount3[1];
|
|
142
151
|
input = element.querySelector('.k-input');
|
|
143
|
-
|
|
152
|
+
_context5.next = 6;
|
|
144
153
|
return show();
|
|
145
154
|
case 6:
|
|
146
155
|
dispatchEvent(content.querySelector('.k-scroll-select-item'), 'click');
|
|
147
|
-
|
|
156
|
+
_context5.next = 9;
|
|
148
157
|
return wait();
|
|
149
158
|
case 9:
|
|
150
159
|
inputInner = input.querySelector('.k-input-inner');
|
|
@@ -152,58 +161,58 @@ describe('Datepicker', function () {
|
|
|
152
161
|
expect(instance.get('datetime1')).eql(null);
|
|
153
162
|
// hide to reset selected state
|
|
154
163
|
document.body.click();
|
|
155
|
-
|
|
164
|
+
_context5.next = 15;
|
|
156
165
|
return wait();
|
|
157
166
|
case 15:
|
|
158
167
|
expect(inputInner.getAttribute('placeholder')).eql("\u8BF7\u9009\u62E9\u65E5\u671F\u548C\u65F6\u95F4");
|
|
159
168
|
expect(inputInner.value).eql('');
|
|
160
169
|
expect(instance.get('datetime1')).eql(null);
|
|
161
170
|
// show again
|
|
162
|
-
|
|
171
|
+
_context5.next = 20;
|
|
163
172
|
return show();
|
|
164
173
|
case 20:
|
|
165
174
|
dispatchEvent(content.querySelector('.k-scroll-select-item'), 'click');
|
|
166
|
-
|
|
175
|
+
_context5.next = 23;
|
|
167
176
|
return wait();
|
|
168
177
|
case 23:
|
|
169
178
|
confirm = content.querySelector('.k-datepicker-footer .k-btn');
|
|
170
179
|
confirm.click();
|
|
171
|
-
|
|
180
|
+
_context5.next = 27;
|
|
172
181
|
return wait();
|
|
173
182
|
case 27:
|
|
174
183
|
expect(inputInner.value).eql(dateString + " 15:00:00");
|
|
175
184
|
expect(instance.get('datetime1')).eql(dateString + " 15:00:00");
|
|
176
185
|
checkDisplay(content, false);
|
|
177
186
|
// change time
|
|
178
|
-
|
|
187
|
+
_context5.next = 32;
|
|
179
188
|
return show();
|
|
180
189
|
case 32:
|
|
181
190
|
activeHour = content.querySelector('.k-scroll-select-item.k-active');
|
|
182
191
|
dispatchEvent(activeHour.nextElementSibling, 'click');
|
|
183
|
-
|
|
192
|
+
_context5.next = 36;
|
|
184
193
|
return wait();
|
|
185
194
|
case 36:
|
|
186
195
|
confirm.click();
|
|
187
|
-
|
|
196
|
+
_context5.next = 39;
|
|
188
197
|
return wait();
|
|
189
198
|
case 39:
|
|
190
199
|
expect(instance.get('datetime1')).eql(dateString + " 16:00:00");
|
|
191
200
|
case 40:
|
|
192
201
|
case "end":
|
|
193
|
-
return
|
|
202
|
+
return _context5.stop();
|
|
194
203
|
}
|
|
195
|
-
},
|
|
204
|
+
}, _callee5);
|
|
196
205
|
})));
|
|
197
206
|
});
|
|
198
|
-
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
207
|
+
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
199
208
|
var _mount4, instance, element, _element$querySelecto, yearInput, content, yearDom, nextYearDom;
|
|
200
|
-
return _regeneratorRuntime.wrap(function
|
|
201
|
-
while (1) switch (
|
|
209
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
210
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
202
211
|
case 0:
|
|
203
212
|
_mount4 = mount(YearMonthDemo), instance = _mount4[0], element = _mount4[1];
|
|
204
213
|
_element$querySelecto = element.querySelectorAll('.k-input'), yearInput = _element$querySelecto[0]; // year
|
|
205
214
|
yearInput.click();
|
|
206
|
-
|
|
215
|
+
_context6.next = 5;
|
|
207
216
|
return wait();
|
|
208
217
|
case 5:
|
|
209
218
|
content = getElement('.k-datepicker-content');
|
|
@@ -213,19 +222,19 @@ describe('Datepicker', function () {
|
|
|
213
222
|
expect(instance.get('year') - 1).eql(year);
|
|
214
223
|
case 10:
|
|
215
224
|
case "end":
|
|
216
|
-
return
|
|
225
|
+
return _context6.stop();
|
|
217
226
|
}
|
|
218
|
-
},
|
|
227
|
+
}, _callee6);
|
|
219
228
|
})));
|
|
220
|
-
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
229
|
+
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
221
230
|
var _mount5, instance, element, _element$querySelecto2, monthInput, content, monthDom, _instance$get$split, _year, _month;
|
|
222
|
-
return _regeneratorRuntime.wrap(function
|
|
223
|
-
while (1) switch (
|
|
231
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
232
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
224
233
|
case 0:
|
|
225
234
|
_mount5 = mount(YearMonthDemo), instance = _mount5[0], element = _mount5[1];
|
|
226
235
|
_element$querySelecto2 = element.querySelectorAll('.k-input'), monthInput = _element$querySelecto2[1]; // month
|
|
227
236
|
monthInput.click();
|
|
228
|
-
|
|
237
|
+
_context7.next = 5;
|
|
229
238
|
return wait();
|
|
230
239
|
case 5:
|
|
231
240
|
content = getElement('.k-datepicker-content');
|
|
@@ -235,70 +244,49 @@ describe('Datepicker', function () {
|
|
|
235
244
|
expect(+_year).eql(year);
|
|
236
245
|
expect(+_month - 1).eql(month);
|
|
237
246
|
case 11:
|
|
238
|
-
case "end":
|
|
239
|
-
return _context6.stop();
|
|
240
|
-
}
|
|
241
|
-
}, _callee6);
|
|
242
|
-
})));
|
|
243
|
-
it('week', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
244
|
-
var _mount6, instance, element, inputs, weekInput, content, weekItem;
|
|
245
|
-
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
246
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
247
|
-
case 0:
|
|
248
|
-
_mount6 = mount(YearMonthDemo), instance = _mount6[0], element = _mount6[1];
|
|
249
|
-
inputs = element.querySelectorAll('.k-input');
|
|
250
|
-
weekInput = inputs[2];
|
|
251
|
-
weekInput.click();
|
|
252
|
-
_context7.next = 6;
|
|
253
|
-
return wait();
|
|
254
|
-
case 6:
|
|
255
|
-
content = getElement('.k-datepicker-content');
|
|
256
|
-
weekItem = content.querySelector('.week-row:nth-child(1) .k-week-number');
|
|
257
|
-
weekItem.click();
|
|
258
|
-
expect(instance.get('week')).to.match(/^\d{4}-\d+周$/);
|
|
259
|
-
case 10:
|
|
260
247
|
case "end":
|
|
261
248
|
return _context7.stop();
|
|
262
249
|
}
|
|
263
250
|
}, _callee7);
|
|
264
251
|
})));
|
|
265
|
-
it('
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
252
|
+
// it('week', async () => {
|
|
253
|
+
// const [instance, element] = mount(YearMonthDemo);
|
|
254
|
+
// const inputs = element.querySelectorAll<HTMLElement>('.k-input');
|
|
255
|
+
// const weekInput = inputs[2];
|
|
256
|
+
// weekInput.click();
|
|
257
|
+
// await wait();
|
|
258
|
+
// const content = getElement('.k-datepicker-content')!;
|
|
259
|
+
// const weekItem = content.querySelector('.week-row:nth-child(1) .k-week-number') as HTMLElement;
|
|
260
|
+
// weekItem.click();
|
|
261
|
+
// expect(instance.get<string>('week')).to.match(/^\d{4}-\d+周$/)
|
|
262
|
+
// });
|
|
263
|
+
// it('quarter', async () => {
|
|
264
|
+
// const [instance, element] = mount(YearMonthDemo);
|
|
265
|
+
// const inputs = element.querySelectorAll<HTMLElement>('.k-input');
|
|
266
|
+
// const QuarterInput = inputs[3];
|
|
267
|
+
// QuarterInput.click();
|
|
268
|
+
// await wait();
|
|
269
|
+
// const content = getElement('.k-datepicker-content')!;
|
|
270
|
+
// // 选择第一个季度
|
|
271
|
+
// const quarterItem = content.querySelector('.k-calendar-item:nth-child(1)') as HTMLElement;
|
|
272
|
+
// quarterItem.click();
|
|
273
|
+
// // 验证输入框的值是否包含Q1
|
|
274
|
+
// expect(instance.get<string>('quarter')).to.include('Q1')
|
|
275
|
+
// });
|
|
288
276
|
});
|
|
289
|
-
describe('Panel', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
290
|
-
return _regeneratorRuntime.wrap(function
|
|
291
|
-
while (1) switch (
|
|
277
|
+
describe('Panel', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
278
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
279
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
292
280
|
case 0:
|
|
293
|
-
it('single date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
294
|
-
var
|
|
295
|
-
return _regeneratorRuntime.wrap(function
|
|
296
|
-
while (1) switch (
|
|
281
|
+
it('single date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
282
|
+
var _mount6, instance, element, input, content, _Array$from, prevYear, prevMonth, _Array$from3, nextMonth, nextYear, curDate, _Array$from4, yearDom, monthDom, curDate1, curMonth;
|
|
283
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
284
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
297
285
|
case 0:
|
|
298
|
-
|
|
286
|
+
_mount6 = mount(BasicDemo), instance = _mount6[0], element = _mount6[1];
|
|
299
287
|
input = element.querySelector('.k-input');
|
|
300
288
|
input.click();
|
|
301
|
-
|
|
289
|
+
_context8.next = 5;
|
|
302
290
|
return wait();
|
|
303
291
|
case 5:
|
|
304
292
|
content = getElement('.k-datepicker-content');
|
|
@@ -313,7 +301,7 @@ describe('Datepicker', function () {
|
|
|
313
301
|
dispatchEvent(nextMonth, 'click');
|
|
314
302
|
// click next year once
|
|
315
303
|
dispatchEvent(nextYear, 'click');
|
|
316
|
-
|
|
304
|
+
_context8.next = 16;
|
|
317
305
|
return wait();
|
|
318
306
|
case 16:
|
|
319
307
|
// select the middle date
|
|
@@ -325,21 +313,21 @@ describe('Datepicker', function () {
|
|
|
325
313
|
expect(curDate.getMonth()).be.eql(month);
|
|
326
314
|
// change year and month in year/month panel
|
|
327
315
|
input.click();
|
|
328
|
-
|
|
316
|
+
_context8.next = 25;
|
|
329
317
|
return wait();
|
|
330
318
|
case 25:
|
|
331
319
|
content = getElement('.k-datepicker-content');
|
|
332
320
|
_Array$from4 = _Array$from2(content.querySelectorAll('.k-month-value')), yearDom = _Array$from4[0], monthDom = _Array$from4[1];
|
|
333
321
|
yearDom.click();
|
|
334
|
-
|
|
322
|
+
_context8.next = 30;
|
|
335
323
|
return wait();
|
|
336
324
|
case 30:
|
|
337
325
|
content.querySelector('.k-today').click();
|
|
338
|
-
|
|
326
|
+
_context8.next = 33;
|
|
339
327
|
return wait();
|
|
340
328
|
case 33:
|
|
341
329
|
content.querySelector('.k-today').click();
|
|
342
|
-
|
|
330
|
+
_context8.next = 36;
|
|
343
331
|
return wait();
|
|
344
332
|
case 36:
|
|
345
333
|
// select the middle date
|
|
@@ -350,19 +338,19 @@ describe('Datepicker', function () {
|
|
|
350
338
|
expect(curDate1.getFullYear()).be.eql(year);
|
|
351
339
|
case 41:
|
|
352
340
|
case "end":
|
|
353
|
-
return
|
|
341
|
+
return _context8.stop();
|
|
354
342
|
}
|
|
355
|
-
},
|
|
343
|
+
}, _callee8);
|
|
356
344
|
})));
|
|
357
|
-
it('range date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
358
|
-
var
|
|
359
|
-
return _regeneratorRuntime.wrap(function
|
|
360
|
-
while (1) switch (
|
|
345
|
+
it('range date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
346
|
+
var _mount7, instance, element, select, content, _content$querySelecto, panel1, panel2, _panel1$querySelector, nextMonth, nextYear, _content$querySelecto2, monthValues1, monthValues2, monthStart, yearStart, monthEnd, yearEnd, _panel2$querySelector, prevYear, firstDecadeStart, secondDecadeStart;
|
|
347
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
348
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
361
349
|
case 0:
|
|
362
|
-
|
|
350
|
+
_mount7 = mount(RangeDemo), instance = _mount7[0], element = _mount7[1];
|
|
363
351
|
select = element.querySelector('.k-datepicker');
|
|
364
352
|
select.click();
|
|
365
|
-
|
|
353
|
+
_context9.next = 5;
|
|
366
354
|
return wait();
|
|
367
355
|
case 5:
|
|
368
356
|
content = getElement('.k-datepicker-content');
|
|
@@ -374,20 +362,20 @@ describe('Datepicker', function () {
|
|
|
374
362
|
yearStart = year + Math.floor((month + 1) / 12);
|
|
375
363
|
monthEnd = (month + 2) % 12 + 1;
|
|
376
364
|
yearEnd = year + Math.floor((month + 2) / 12);
|
|
377
|
-
|
|
365
|
+
_context9.next = 16;
|
|
378
366
|
return wait();
|
|
379
367
|
case 16:
|
|
380
368
|
expect(monthValues1.textContent).to.eql(yearStart + "\u5E74" + monthStart + "\u6708");
|
|
381
369
|
expect(monthValues2.textContent).to.eql(yearEnd + "\u5E74" + monthEnd + "\u6708");
|
|
382
370
|
nextYear.click();
|
|
383
|
-
|
|
371
|
+
_context9.next = 21;
|
|
384
372
|
return wait();
|
|
385
373
|
case 21:
|
|
386
374
|
expect(monthValues1.textContent).to.eql(yearStart + 1 + "\u5E74" + monthStart + "\u6708");
|
|
387
375
|
expect(monthValues2.textContent).to.eql(yearEnd + 1 + "\u5E74" + monthEnd + "\u6708");
|
|
388
376
|
_panel2$querySelector = panel2.querySelectorAll('.k-prev'), prevYear = _panel2$querySelector[0];
|
|
389
377
|
prevYear.click();
|
|
390
|
-
|
|
378
|
+
_context9.next = 27;
|
|
391
379
|
return wait();
|
|
392
380
|
case 27:
|
|
393
381
|
expect(monthValues1.textContent).to.eql(yearStart + "\u5E74" + monthStart + "\u6708");
|
|
@@ -395,7 +383,7 @@ describe('Datepicker', function () {
|
|
|
395
383
|
// year panel
|
|
396
384
|
dispatchEvent(monthValues1.firstElementChild, 'click');
|
|
397
385
|
dispatchEvent(monthValues2.firstElementChild, 'click');
|
|
398
|
-
|
|
386
|
+
_context9.next = 33;
|
|
399
387
|
return wait();
|
|
400
388
|
case 33:
|
|
401
389
|
firstDecadeStart = Math.floor(yearStart / 10) * 10;
|
|
@@ -403,26 +391,26 @@ describe('Datepicker', function () {
|
|
|
403
391
|
expect(monthValues1.textContent).to.eql(firstDecadeStart + "\u5E74 - " + (firstDecadeStart + 9) + "\u5E74");
|
|
404
392
|
expect(monthValues1.textContent).to.eql(secondDecadeStart + "\u5E74 - " + (secondDecadeStart + 9) + "\u5E74");
|
|
405
393
|
nextYear.click();
|
|
406
|
-
|
|
394
|
+
_context9.next = 40;
|
|
407
395
|
return wait();
|
|
408
396
|
case 40:
|
|
409
397
|
expect(monthValues1.textContent).to.eql(firstDecadeStart + 10 + "\u5E74 - " + (secondDecadeStart + 19) + "\u5E74");
|
|
410
398
|
expect(monthValues1.textContent).to.eql(secondDecadeStart + 10 + "\u5E74 - " + (secondDecadeStart + 19) + "\u5E74");
|
|
411
399
|
case 42:
|
|
412
400
|
case "end":
|
|
413
|
-
return
|
|
401
|
+
return _context9.stop();
|
|
414
402
|
}
|
|
415
|
-
},
|
|
403
|
+
}, _callee9);
|
|
416
404
|
})));
|
|
417
|
-
it('range year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
418
|
-
var
|
|
419
|
-
return _regeneratorRuntime.wrap(function
|
|
420
|
-
while (1) switch (
|
|
405
|
+
it('range year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
406
|
+
var _mount8, instance, element, _element$querySelecto3, select, content, _content$querySelecto3, panel1, panel2, _panel1$querySelector2, next, _panel2$querySelector2, prev, _content$querySelecto4, label1, label2;
|
|
407
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
408
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
421
409
|
case 0:
|
|
422
|
-
|
|
410
|
+
_mount8 = mount(RangeDemo), instance = _mount8[0], element = _mount8[1];
|
|
423
411
|
_element$querySelecto3 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto3[2];
|
|
424
412
|
select.click();
|
|
425
|
-
|
|
413
|
+
_context10.next = 5;
|
|
426
414
|
return wait();
|
|
427
415
|
case 5:
|
|
428
416
|
content = getElement('.k-datepicker-content');
|
|
@@ -433,32 +421,32 @@ describe('Datepicker', function () {
|
|
|
433
421
|
expect(label1.textContent).to.eql(startYear + "\u5E74 - " + (startYear + 9) + "\u5E74");
|
|
434
422
|
expect(label2.textContent).to.eql(startYear + 10 + "\u5E74 - " + (startYear + 19) + "\u5E74");
|
|
435
423
|
next.click();
|
|
436
|
-
|
|
424
|
+
_context10.next = 15;
|
|
437
425
|
return wait();
|
|
438
426
|
case 15:
|
|
439
427
|
expect(label1.textContent).to.eql(startYear + 10 + "\u5E74 - " + (startYear + 19) + "\u5E74");
|
|
440
428
|
expect(label2.textContent).to.eql(startYear + 20 + "\u5E74 - " + (startYear + 29) + "\u5E74");
|
|
441
429
|
prev.click();
|
|
442
|
-
|
|
430
|
+
_context10.next = 20;
|
|
443
431
|
return wait();
|
|
444
432
|
case 20:
|
|
445
433
|
expect(label1.textContent).to.eql(startYear + "\u5E74 - " + (startYear + 9) + "\u5E74");
|
|
446
434
|
expect(label2.textContent).to.eql(startYear + 10 + "\u5E74 - " + (startYear + 19) + "\u5E74");
|
|
447
435
|
case 22:
|
|
448
436
|
case "end":
|
|
449
|
-
return
|
|
437
|
+
return _context10.stop();
|
|
450
438
|
}
|
|
451
|
-
},
|
|
439
|
+
}, _callee10);
|
|
452
440
|
})));
|
|
453
|
-
it('range month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
454
|
-
var
|
|
455
|
-
return _regeneratorRuntime.wrap(function
|
|
456
|
-
while (1) switch (
|
|
441
|
+
it('range month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
442
|
+
var _mount9, instance, element, _element$querySelecto4, select, content, _content$querySelecto5, panel1, panel2, _panel1$querySelector3, next, _panel2$querySelector3, prev, _content$querySelecto6, label1, label2;
|
|
443
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
444
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
457
445
|
case 0:
|
|
458
|
-
|
|
446
|
+
_mount9 = mount(RangeDemo), instance = _mount9[0], element = _mount9[1];
|
|
459
447
|
_element$querySelecto4 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto4[3];
|
|
460
448
|
select.click();
|
|
461
|
-
|
|
449
|
+
_context11.next = 5;
|
|
462
450
|
return wait();
|
|
463
451
|
case 5:
|
|
464
452
|
content = getElement('.k-datepicker-content');
|
|
@@ -469,67 +457,67 @@ describe('Datepicker', function () {
|
|
|
469
457
|
expect(label1.textContent).to.eql(year + "\u5E74" + (month + 1) + "\u6708");
|
|
470
458
|
expect(label2.textContent).to.eql(year + 1 + "\u5E74" + (month + 1) + "\u6708");
|
|
471
459
|
next.click();
|
|
472
|
-
|
|
460
|
+
_context11.next = 15;
|
|
473
461
|
return wait();
|
|
474
462
|
case 15:
|
|
475
463
|
expect(label1.textContent).to.eql(year + 1 + "\u5E74" + (month + 1) + "\u6708");
|
|
476
464
|
expect(label2.textContent).to.eql(year + 2 + "\u5E74" + (month + 1) + "\u6708");
|
|
477
465
|
prev.click();
|
|
478
|
-
|
|
466
|
+
_context11.next = 20;
|
|
479
467
|
return wait();
|
|
480
468
|
case 20:
|
|
481
469
|
expect(label1.textContent).to.eql(year + "\u5E74" + (month + 1) + "\u6708");
|
|
482
470
|
expect(label2.textContent).to.eql(year + 1 + "\u5E74" + (month + 1) + "\u6708");
|
|
483
471
|
case 22:
|
|
484
472
|
case "end":
|
|
485
|
-
return
|
|
473
|
+
return _context11.stop();
|
|
486
474
|
}
|
|
487
|
-
},
|
|
475
|
+
}, _callee11);
|
|
488
476
|
})));
|
|
489
477
|
case 4:
|
|
490
478
|
case "end":
|
|
491
|
-
return
|
|
479
|
+
return _context12.stop();
|
|
492
480
|
}
|
|
493
|
-
},
|
|
481
|
+
}, _callee12);
|
|
494
482
|
})));
|
|
495
483
|
describe('Clear', function () {
|
|
496
|
-
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
497
|
-
var
|
|
498
|
-
return _regeneratorRuntime.wrap(function
|
|
499
|
-
while (1) switch (
|
|
484
|
+
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
485
|
+
var _mount10, instance, element;
|
|
486
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
487
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
500
488
|
case 0:
|
|
501
|
-
|
|
489
|
+
_mount10 = mount(ClearableDemo), instance = _mount10[0], element = _mount10[1];
|
|
502
490
|
instance.set('date', '2018-03-04');
|
|
503
|
-
|
|
491
|
+
_context13.next = 4;
|
|
504
492
|
return wait();
|
|
505
493
|
case 4:
|
|
506
494
|
dispatchEvent(element.querySelector('.k-select-clear'), 'click');
|
|
507
495
|
expect(instance.get('date')).be.eql(null);
|
|
508
496
|
case 6:
|
|
509
497
|
case "end":
|
|
510
|
-
return
|
|
498
|
+
return _context13.stop();
|
|
511
499
|
}
|
|
512
|
-
},
|
|
500
|
+
}, _callee13);
|
|
513
501
|
})));
|
|
514
|
-
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
515
|
-
var
|
|
516
|
-
return _regeneratorRuntime.wrap(function
|
|
517
|
-
while (1) switch (
|
|
502
|
+
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
503
|
+
var _mount11, instance, element, input, content;
|
|
504
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
505
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
518
506
|
case 0:
|
|
519
|
-
|
|
507
|
+
_mount11 = mount(DatetimeDemo), instance = _mount11[0], element = _mount11[1];
|
|
520
508
|
input = element.querySelector('.k-input');
|
|
521
509
|
input.click();
|
|
522
|
-
|
|
510
|
+
_context14.next = 5;
|
|
523
511
|
return wait();
|
|
524
512
|
case 5:
|
|
525
513
|
content = getElement('.k-datepicker-content'); // change to time panel
|
|
526
514
|
content.querySelector('.k-calendar-item').click();
|
|
527
|
-
|
|
515
|
+
_context14.next = 9;
|
|
528
516
|
return wait();
|
|
529
517
|
case 9:
|
|
530
518
|
content.querySelector('.k-datepicker-footer .k-btn').click();
|
|
531
519
|
// clear the value
|
|
532
|
-
|
|
520
|
+
_context14.next = 12;
|
|
533
521
|
return wait();
|
|
534
522
|
case 12:
|
|
535
523
|
expect(instance.get('datetime1')).to.be.string;
|
|
@@ -537,7 +525,7 @@ describe('Datepicker', function () {
|
|
|
537
525
|
expect(instance.get('datetime1')).be.eql(null);
|
|
538
526
|
// set value to empty string should clear datetime
|
|
539
527
|
input.click();
|
|
540
|
-
|
|
528
|
+
_context14.next = 18;
|
|
541
529
|
return wait();
|
|
542
530
|
case 18:
|
|
543
531
|
content.querySelector('.k-calendar-item').click();
|
|
@@ -545,21 +533,21 @@ describe('Datepicker', function () {
|
|
|
545
533
|
expect(instance.get('datetime1')).to.eql('');
|
|
546
534
|
case 21:
|
|
547
535
|
case "end":
|
|
548
|
-
return
|
|
536
|
+
return _context14.stop();
|
|
549
537
|
}
|
|
550
|
-
},
|
|
538
|
+
}, _callee14);
|
|
551
539
|
})));
|
|
552
540
|
});
|
|
553
541
|
describe('Multiple', function () {
|
|
554
|
-
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
555
|
-
var
|
|
556
|
-
return _regeneratorRuntime.wrap(function
|
|
557
|
-
while (1) switch (
|
|
542
|
+
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
543
|
+
var _mount12, instance, element, select, content, items, close;
|
|
544
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
545
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
558
546
|
case 0:
|
|
559
|
-
|
|
547
|
+
_mount12 = mount(MultipleDemo), instance = _mount12[0], element = _mount12[1];
|
|
560
548
|
select = element.querySelector('.k-datepicker');
|
|
561
549
|
dispatchEvent(select, 'click');
|
|
562
|
-
|
|
550
|
+
_context15.next = 5;
|
|
563
551
|
return wait();
|
|
564
552
|
case 5:
|
|
565
553
|
content = getElement('.k-datepicker-content');
|
|
@@ -569,19 +557,19 @@ describe('Datepicker', function () {
|
|
|
569
557
|
expect(instance.get('date')).have.lengthOf(2);
|
|
570
558
|
dispatchEvent(items[18], 'click');
|
|
571
559
|
expect(instance.get('date')).have.lengthOf(1);
|
|
572
|
-
|
|
560
|
+
_context15.next = 14;
|
|
573
561
|
return wait();
|
|
574
562
|
case 14:
|
|
575
563
|
// remove specified item
|
|
576
564
|
close = element.querySelector('.k-tag-close');
|
|
577
565
|
close.click();
|
|
578
566
|
expect(instance.get('date')).have.lengthOf(0);
|
|
579
|
-
|
|
567
|
+
_context15.next = 19;
|
|
580
568
|
return wait();
|
|
581
569
|
case 19:
|
|
582
570
|
dispatchEvent(items[17], 'click');
|
|
583
571
|
expect(instance.get('date')).have.lengthOf(1);
|
|
584
|
-
|
|
572
|
+
_context15.next = 23;
|
|
585
573
|
return wait();
|
|
586
574
|
case 23:
|
|
587
575
|
// clear
|
|
@@ -589,173 +577,173 @@ describe('Datepicker', function () {
|
|
|
589
577
|
expect(instance.get('date')).have.lengthOf(0);
|
|
590
578
|
case 25:
|
|
591
579
|
case "end":
|
|
592
|
-
return
|
|
580
|
+
return _context15.stop();
|
|
593
581
|
}
|
|
594
|
-
},
|
|
582
|
+
}, _callee15);
|
|
595
583
|
})));
|
|
596
|
-
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
597
|
-
var
|
|
598
|
-
return _regeneratorRuntime.wrap(function
|
|
599
|
-
while (1) switch (
|
|
584
|
+
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
|
|
585
|
+
var _mount13, instance, element, _element$querySelecto5, select, content, activeHour, confirm;
|
|
586
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
587
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
600
588
|
case 0:
|
|
601
|
-
|
|
589
|
+
_mount13 = mount(MultipleDemo), instance = _mount13[0], element = _mount13[1];
|
|
602
590
|
_element$querySelecto5 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto5[1];
|
|
603
591
|
dispatchEvent(select, 'click');
|
|
604
|
-
|
|
592
|
+
_context16.next = 5;
|
|
605
593
|
return wait();
|
|
606
594
|
case 5:
|
|
607
595
|
content = getElement('.k-datepicker-content');
|
|
608
596
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
609
|
-
|
|
597
|
+
_context16.next = 9;
|
|
610
598
|
return wait();
|
|
611
599
|
case 9:
|
|
612
600
|
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
613
|
-
|
|
601
|
+
_context16.next = 12;
|
|
614
602
|
return wait();
|
|
615
603
|
case 12:
|
|
616
604
|
expect(instance.get('datetime')).have.lengthOf(1);
|
|
617
605
|
// select the same datetime
|
|
618
606
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
619
|
-
|
|
607
|
+
_context16.next = 16;
|
|
620
608
|
return wait();
|
|
621
609
|
case 16:
|
|
622
610
|
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
623
|
-
|
|
611
|
+
_context16.next = 19;
|
|
624
612
|
return wait();
|
|
625
613
|
case 19:
|
|
626
614
|
expect(instance.get('datetime')).have.lengthOf(1);
|
|
627
615
|
// select different time with the same date
|
|
628
616
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
629
|
-
|
|
617
|
+
_context16.next = 23;
|
|
630
618
|
return wait();
|
|
631
619
|
case 23:
|
|
632
620
|
dispatchEvent(content.querySelector('.k-scroll-select-item'), 'click');
|
|
633
|
-
|
|
621
|
+
_context16.next = 26;
|
|
634
622
|
return wait();
|
|
635
623
|
case 26:
|
|
636
624
|
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
637
|
-
|
|
625
|
+
_context16.next = 29;
|
|
638
626
|
return wait();
|
|
639
627
|
case 29:
|
|
640
628
|
expect(instance.get('datetime')).have.lengthOf(2);
|
|
641
629
|
// select time directly
|
|
642
630
|
activeHour = content.querySelector('.k-scroll-select-item.k-active');
|
|
643
631
|
dispatchEvent(activeHour.nextElementSibling, 'click');
|
|
644
|
-
|
|
632
|
+
_context16.next = 34;
|
|
645
633
|
return wait();
|
|
646
634
|
case 34:
|
|
647
|
-
|
|
635
|
+
_context16.next = 36;
|
|
648
636
|
return clickConfirm(content);
|
|
649
637
|
case 36:
|
|
650
|
-
confirm =
|
|
638
|
+
confirm = _context16.sent;
|
|
651
639
|
expect(instance.get('datetime')).have.lengthOf(3);
|
|
652
640
|
// select time firstly, then select date should only add one value
|
|
653
641
|
dispatchEvent(activeHour.nextElementSibling.nextElementSibling, 'click');
|
|
654
|
-
|
|
642
|
+
_context16.next = 41;
|
|
655
643
|
return wait();
|
|
656
644
|
case 41:
|
|
657
645
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(19)'), 'click');
|
|
658
|
-
|
|
646
|
+
_context16.next = 44;
|
|
659
647
|
return wait();
|
|
660
648
|
case 44:
|
|
661
649
|
confirm.click();
|
|
662
|
-
|
|
650
|
+
_context16.next = 47;
|
|
663
651
|
return wait();
|
|
664
652
|
case 47:
|
|
665
653
|
expect(instance.get('datetime')).have.lengthOf(4);
|
|
666
654
|
case 48:
|
|
667
655
|
case "end":
|
|
668
|
-
return
|
|
656
|
+
return _context16.stop();
|
|
669
657
|
}
|
|
670
|
-
},
|
|
658
|
+
}, _callee16);
|
|
671
659
|
})));
|
|
672
|
-
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
673
|
-
var
|
|
674
|
-
return _regeneratorRuntime.wrap(function
|
|
675
|
-
while (1) switch (
|
|
660
|
+
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
|
661
|
+
var _mount14, instance, element, _element$querySelecto6, select, content;
|
|
662
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
663
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
676
664
|
case 0:
|
|
677
|
-
|
|
665
|
+
_mount14 = mount(MultipleDemo), instance = _mount14[0], element = _mount14[1];
|
|
678
666
|
_element$querySelecto6 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto6[2];
|
|
679
667
|
dispatchEvent(select, 'click');
|
|
680
|
-
|
|
668
|
+
_context17.next = 5;
|
|
681
669
|
return wait();
|
|
682
670
|
case 5:
|
|
683
671
|
content = getElement('.k-datepicker-content');
|
|
684
672
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(6)'), 'click');
|
|
685
|
-
|
|
673
|
+
_context17.next = 9;
|
|
686
674
|
return wait();
|
|
687
675
|
case 9:
|
|
688
676
|
expect(instance.get('year')).have.lengthOf(1);
|
|
689
677
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(7)'), 'click');
|
|
690
|
-
|
|
678
|
+
_context17.next = 13;
|
|
691
679
|
return wait();
|
|
692
680
|
case 13:
|
|
693
681
|
expect(instance.get('year')).have.lengthOf(2);
|
|
694
682
|
instance.set('year', []);
|
|
695
|
-
|
|
683
|
+
_context17.next = 17;
|
|
696
684
|
return wait();
|
|
697
685
|
case 17:
|
|
698
686
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(6)'), 'click');
|
|
699
|
-
|
|
687
|
+
_context17.next = 20;
|
|
700
688
|
return wait();
|
|
701
689
|
case 20:
|
|
702
690
|
expect(instance.get('year')).have.lengthOf(1);
|
|
703
691
|
case 21:
|
|
704
692
|
case "end":
|
|
705
|
-
return
|
|
693
|
+
return _context17.stop();
|
|
706
694
|
}
|
|
707
|
-
},
|
|
695
|
+
}, _callee17);
|
|
708
696
|
})));
|
|
709
|
-
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
710
|
-
var
|
|
711
|
-
return _regeneratorRuntime.wrap(function
|
|
712
|
-
while (1) switch (
|
|
697
|
+
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
|
698
|
+
var _mount15, instance, element, _element$querySelecto7, select, content;
|
|
699
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
700
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
713
701
|
case 0:
|
|
714
|
-
|
|
702
|
+
_mount15 = mount(MultipleDemo), instance = _mount15[0], element = _mount15[1];
|
|
715
703
|
_element$querySelecto7 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto7[3];
|
|
716
704
|
dispatchEvent(select, 'click');
|
|
717
|
-
|
|
705
|
+
_context18.next = 5;
|
|
718
706
|
return wait();
|
|
719
707
|
case 5:
|
|
720
708
|
content = getElement('.k-datepicker-content');
|
|
721
709
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(6)'), 'click');
|
|
722
|
-
|
|
710
|
+
_context18.next = 9;
|
|
723
711
|
return wait();
|
|
724
712
|
case 9:
|
|
725
713
|
expect(instance.get('month')).have.lengthOf(1);
|
|
726
714
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(7)'), 'click');
|
|
727
|
-
|
|
715
|
+
_context18.next = 13;
|
|
728
716
|
return wait();
|
|
729
717
|
case 13:
|
|
730
718
|
expect(instance.get('month')).have.lengthOf(2);
|
|
731
719
|
instance.set('month', []);
|
|
732
|
-
|
|
720
|
+
_context18.next = 17;
|
|
733
721
|
return wait();
|
|
734
722
|
case 17:
|
|
735
723
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(6)'), 'click');
|
|
736
|
-
|
|
724
|
+
_context18.next = 20;
|
|
737
725
|
return wait();
|
|
738
726
|
case 20:
|
|
739
727
|
expect(instance.get('month')).have.lengthOf(1);
|
|
740
728
|
case 21:
|
|
741
729
|
case "end":
|
|
742
|
-
return
|
|
730
|
+
return _context18.stop();
|
|
743
731
|
}
|
|
744
|
-
},
|
|
732
|
+
}, _callee18);
|
|
745
733
|
})));
|
|
746
|
-
describe('date range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
747
|
-
return _regeneratorRuntime.wrap(function
|
|
748
|
-
while (1) switch (
|
|
734
|
+
describe('date range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
|
|
735
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
736
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
749
737
|
case 0:
|
|
750
|
-
it('date range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
751
|
-
var
|
|
752
|
-
return _regeneratorRuntime.wrap(function
|
|
753
|
-
while (1) switch (
|
|
738
|
+
it('date range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19() {
|
|
739
|
+
var _mount16, instance, element, _element$querySelecto8, select, content, _content$querySelecto7, calendar1, calendar2, first, second, value1, third, fourth, value2;
|
|
740
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
741
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
754
742
|
case 0:
|
|
755
|
-
|
|
743
|
+
_mount16 = mount(MultipleDemo), instance = _mount16[0], element = _mount16[1];
|
|
756
744
|
_element$querySelecto8 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto8[4];
|
|
757
745
|
dispatchEvent(select, 'click');
|
|
758
|
-
|
|
746
|
+
_context19.next = 5;
|
|
759
747
|
return wait();
|
|
760
748
|
case 5:
|
|
761
749
|
content = getElement('.k-datepicker-content');
|
|
@@ -764,7 +752,7 @@ describe('Datepicker', function () {
|
|
|
764
752
|
second = first.nextElementSibling;
|
|
765
753
|
first.click();
|
|
766
754
|
second.click();
|
|
767
|
-
|
|
755
|
+
_context19.next = 13;
|
|
768
756
|
return wait();
|
|
769
757
|
case 13:
|
|
770
758
|
value1 = ["" + getDateString(1), "" + getDateString(2)];
|
|
@@ -773,43 +761,43 @@ describe('Datepicker', function () {
|
|
|
773
761
|
fourth = third.nextElementSibling;
|
|
774
762
|
third.click();
|
|
775
763
|
fourth.click();
|
|
776
|
-
|
|
764
|
+
_context19.next = 21;
|
|
777
765
|
return wait();
|
|
778
766
|
case 21:
|
|
779
767
|
value2 = ["" + getDateString(3), "" + getDateString(4)];
|
|
780
768
|
expect(instance.get('dateRange')).eql([value1, value2]);
|
|
781
769
|
first.click();
|
|
782
770
|
second.click();
|
|
783
|
-
|
|
771
|
+
_context19.next = 27;
|
|
784
772
|
return wait();
|
|
785
773
|
case 27:
|
|
786
774
|
expect(instance.get('dateRange')).eql([value2]);
|
|
787
775
|
instance.set('dateRange', []);
|
|
788
|
-
|
|
776
|
+
_context19.next = 31;
|
|
789
777
|
return wait();
|
|
790
778
|
case 31:
|
|
791
779
|
first.click();
|
|
792
780
|
second.click();
|
|
793
|
-
|
|
781
|
+
_context19.next = 35;
|
|
794
782
|
return wait();
|
|
795
783
|
case 35:
|
|
796
784
|
expect(instance.get('dateRange')).eql([value1]);
|
|
797
785
|
case 36:
|
|
798
786
|
case "end":
|
|
799
|
-
return
|
|
787
|
+
return _context19.stop();
|
|
800
788
|
}
|
|
801
|
-
},
|
|
789
|
+
}, _callee19);
|
|
802
790
|
})));
|
|
803
|
-
it('hover status', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
804
|
-
var
|
|
805
|
-
return _regeneratorRuntime.wrap(function
|
|
806
|
-
while (1) switch (
|
|
791
|
+
it('hover status', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
|
|
792
|
+
var _mount17, instance, element, _element$querySelecto9, select, content, _content$querySelecto8, calendar1, calendar2, first, second;
|
|
793
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
794
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
807
795
|
case 0:
|
|
808
|
-
|
|
796
|
+
_mount17 = mount(MultipleDemo), instance = _mount17[0], element = _mount17[1];
|
|
809
797
|
instance.set('dateRange', [['2025-07-11', '2025-07-15']]);
|
|
810
798
|
_element$querySelecto9 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto9[4];
|
|
811
799
|
dispatchEvent(select, 'click');
|
|
812
|
-
|
|
800
|
+
_context20.next = 6;
|
|
813
801
|
return wait();
|
|
814
802
|
case 6:
|
|
815
803
|
content = getElement('.k-datepicker-content');
|
|
@@ -817,35 +805,35 @@ describe('Datepicker', function () {
|
|
|
817
805
|
first = calendar1.querySelector('.k-calendar-item:not(.k-exceed)');
|
|
818
806
|
second = first.nextElementSibling;
|
|
819
807
|
dispatchEvent(first, 'mouseenter');
|
|
820
|
-
|
|
808
|
+
_context20.next = 13;
|
|
821
809
|
return wait();
|
|
822
810
|
case 13:
|
|
823
811
|
expect(second.classList.contains('k-in-range')).eql(false);
|
|
824
812
|
case 14:
|
|
825
813
|
case "end":
|
|
826
|
-
return
|
|
814
|
+
return _context20.stop();
|
|
827
815
|
}
|
|
828
|
-
},
|
|
816
|
+
}, _callee20);
|
|
829
817
|
})));
|
|
830
818
|
case 2:
|
|
831
819
|
case "end":
|
|
832
|
-
return
|
|
820
|
+
return _context21.stop();
|
|
833
821
|
}
|
|
834
|
-
},
|
|
822
|
+
}, _callee21);
|
|
835
823
|
})));
|
|
836
|
-
describe('datetime range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
837
|
-
return _regeneratorRuntime.wrap(function
|
|
838
|
-
while (1) switch (
|
|
824
|
+
describe('datetime range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
|
|
825
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
826
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
839
827
|
case 0:
|
|
840
|
-
it('basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
841
|
-
var
|
|
842
|
-
return _regeneratorRuntime.wrap(function
|
|
843
|
-
while (1) switch (
|
|
828
|
+
it('basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
829
|
+
var _mount18, instance, element, _element$querySelecto10, select, content, calendar1, first, second, inputInner, value1, third, fourth, value2, confirm;
|
|
830
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
831
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
844
832
|
case 0:
|
|
845
|
-
|
|
833
|
+
_mount18 = mount(MultipleDemo), instance = _mount18[0], element = _mount18[1];
|
|
846
834
|
_element$querySelecto10 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto10[5];
|
|
847
835
|
dispatchEvent(select, 'click');
|
|
848
|
-
|
|
836
|
+
_context22.next = 5;
|
|
849
837
|
return wait();
|
|
850
838
|
case 5:
|
|
851
839
|
content = getElement('.k-datepicker-content');
|
|
@@ -854,16 +842,16 @@ describe('Datepicker', function () {
|
|
|
854
842
|
second = first.nextElementSibling;
|
|
855
843
|
inputInner = select.querySelector('.k-input-inner');
|
|
856
844
|
first.click();
|
|
857
|
-
|
|
845
|
+
_context22.next = 13;
|
|
858
846
|
return clickConfirm(content);
|
|
859
847
|
case 13:
|
|
860
848
|
expect(inputInner.value).eql(getDateString(1) + " 00:00:00 ~");
|
|
861
849
|
second.click();
|
|
862
|
-
|
|
850
|
+
_context22.next = 17;
|
|
863
851
|
return wait();
|
|
864
852
|
case 17:
|
|
865
853
|
expect(inputInner.value).eql(getDateString(1) + " 00:00:00 ~ " + getDateString(2) + " 00:00:00");
|
|
866
|
-
|
|
854
|
+
_context22.next = 20;
|
|
867
855
|
return clickConfirm(content);
|
|
868
856
|
case 20:
|
|
869
857
|
value1 = [getDateString(1) + " 00:00:00", getDateString(2) + " 00:00:00"];
|
|
@@ -871,92 +859,92 @@ describe('Datepicker', function () {
|
|
|
871
859
|
third = second.nextElementSibling;
|
|
872
860
|
fourth = third.nextElementSibling;
|
|
873
861
|
third.click();
|
|
874
|
-
|
|
862
|
+
_context22.next = 27;
|
|
875
863
|
return clickConfirm(content);
|
|
876
864
|
case 27:
|
|
877
865
|
fourth.click();
|
|
878
|
-
|
|
866
|
+
_context22.next = 30;
|
|
879
867
|
return clickConfirm(content);
|
|
880
868
|
case 30:
|
|
881
869
|
value2 = [getDateString(3) + " 00:00:00", getDateString(4) + " 00:00:00"];
|
|
882
870
|
expect(instance.get('datetimeRange')).eql([value1, value2]);
|
|
883
871
|
// selecting the same date time will do nothing
|
|
884
872
|
third.click();
|
|
885
|
-
|
|
873
|
+
_context22.next = 35;
|
|
886
874
|
return clickConfirm(content);
|
|
887
875
|
case 35:
|
|
888
876
|
fourth.click();
|
|
889
|
-
|
|
877
|
+
_context22.next = 38;
|
|
890
878
|
return clickConfirm(content);
|
|
891
879
|
case 38:
|
|
892
880
|
expect(instance.get('datetimeRange')).eql([value1, value2]);
|
|
893
881
|
instance.set('datetimeRange', []);
|
|
894
|
-
|
|
882
|
+
_context22.next = 42;
|
|
895
883
|
return wait();
|
|
896
884
|
case 42:
|
|
897
885
|
first.click();
|
|
898
|
-
|
|
886
|
+
_context22.next = 45;
|
|
899
887
|
return clickConfirm(content);
|
|
900
888
|
case 45:
|
|
901
889
|
second.click();
|
|
902
|
-
|
|
890
|
+
_context22.next = 48;
|
|
903
891
|
return clickConfirm(content);
|
|
904
892
|
case 48:
|
|
905
|
-
confirm =
|
|
893
|
+
confirm = _context22.sent;
|
|
906
894
|
expect(instance.get('datetimeRange')).eql([value1]);
|
|
907
895
|
expect(confirm.classList.contains('k-disabled')).eql(true);
|
|
908
896
|
case 51:
|
|
909
897
|
case "end":
|
|
910
|
-
return
|
|
898
|
+
return _context22.stop();
|
|
911
899
|
}
|
|
912
|
-
},
|
|
900
|
+
}, _callee22);
|
|
913
901
|
})));
|
|
914
|
-
it('select time directly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
915
|
-
var
|
|
916
|
-
return _regeneratorRuntime.wrap(function
|
|
917
|
-
while (1) switch (
|
|
902
|
+
it('select time directly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
903
|
+
var _mount19, instance, element, _element$querySelecto11, select, content, calendar, activeHour;
|
|
904
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
905
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
918
906
|
case 0:
|
|
919
|
-
|
|
907
|
+
_mount19 = mount(MultipleDemo), instance = _mount19[0], element = _mount19[1];
|
|
920
908
|
_element$querySelecto11 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto11[5];
|
|
921
909
|
dispatchEvent(select, 'click');
|
|
922
|
-
|
|
910
|
+
_context23.next = 5;
|
|
923
911
|
return wait();
|
|
924
912
|
case 5:
|
|
925
913
|
content = getElement('.k-datepicker-content');
|
|
926
914
|
calendar = content.querySelector('.k-datepicker-wrapper');
|
|
927
915
|
activeHour = calendar.querySelector('.k-scroll-select-item.k-active');
|
|
928
916
|
activeHour.nextElementSibling.click();
|
|
929
|
-
|
|
917
|
+
_context23.next = 11;
|
|
930
918
|
return clickConfirm(content);
|
|
931
919
|
case 11:
|
|
932
920
|
activeHour.nextElementSibling.click();
|
|
933
|
-
|
|
921
|
+
_context23.next = 14;
|
|
934
922
|
return clickConfirm(content);
|
|
935
923
|
case 14:
|
|
936
924
|
expect(instance.get('datetimeRange')).to.eql([[dateString + " 01:00:00", dateString + " 02:00:00"]]);
|
|
937
925
|
case 15:
|
|
938
926
|
case "end":
|
|
939
|
-
return
|
|
927
|
+
return _context23.stop();
|
|
940
928
|
}
|
|
941
|
-
},
|
|
929
|
+
}, _callee23);
|
|
942
930
|
})));
|
|
943
931
|
case 2:
|
|
944
932
|
case "end":
|
|
945
|
-
return
|
|
933
|
+
return _context24.stop();
|
|
946
934
|
}
|
|
947
|
-
},
|
|
935
|
+
}, _callee24);
|
|
948
936
|
})));
|
|
949
937
|
});
|
|
950
938
|
describe('Range', function () {
|
|
951
|
-
describe('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
939
|
+
describe('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
|
|
952
940
|
var instance, element, select, content, first;
|
|
953
|
-
return _regeneratorRuntime.wrap(function
|
|
954
|
-
while (1) switch (
|
|
941
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
942
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
955
943
|
case 0:
|
|
956
|
-
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
944
|
+
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
|
|
957
945
|
var result;
|
|
958
|
-
return _regeneratorRuntime.wrap(function
|
|
959
|
-
while (1) switch (
|
|
946
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
947
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
960
948
|
case 0:
|
|
961
949
|
result = mount(RangeDemo);
|
|
962
950
|
instance = result[0];
|
|
@@ -964,7 +952,7 @@ describe('Datepicker', function () {
|
|
|
964
952
|
// date
|
|
965
953
|
select = element.querySelector('.k-datepicker');
|
|
966
954
|
select.click();
|
|
967
|
-
|
|
955
|
+
_context25.next = 7;
|
|
968
956
|
return wait();
|
|
969
957
|
case 7:
|
|
970
958
|
content = getElement('.k-datepicker-content');
|
|
@@ -972,34 +960,34 @@ describe('Datepicker', function () {
|
|
|
972
960
|
first = content.querySelector('.k-calendar-item:nth-child(18)');
|
|
973
961
|
case 9:
|
|
974
962
|
case "end":
|
|
975
|
-
return
|
|
963
|
+
return _context25.stop();
|
|
976
964
|
}
|
|
977
|
-
},
|
|
965
|
+
}, _callee25);
|
|
978
966
|
})));
|
|
979
|
-
it('basic selection', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
967
|
+
it('basic selection', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
|
|
980
968
|
var value;
|
|
981
|
-
return _regeneratorRuntime.wrap(function
|
|
982
|
-
while (1) switch (
|
|
969
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
970
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
983
971
|
case 0:
|
|
984
972
|
first.click();
|
|
985
|
-
|
|
973
|
+
_context26.next = 3;
|
|
986
974
|
return wait();
|
|
987
975
|
case 3:
|
|
988
976
|
expect(instance.get('date')).to.be.null;
|
|
989
977
|
// hover status
|
|
990
978
|
dispatchEvent(first.nextElementSibling.nextElementSibling, 'mouseenter');
|
|
991
|
-
|
|
979
|
+
_context26.next = 7;
|
|
992
980
|
return wait();
|
|
993
981
|
case 7:
|
|
994
982
|
expect(first.nextElementSibling.classList.contains('k-in-range')).to.be.true;
|
|
995
983
|
dispatchEvent(first.previousElementSibling.previousElementSibling, 'mouseenter');
|
|
996
|
-
|
|
984
|
+
_context26.next = 11;
|
|
997
985
|
return wait();
|
|
998
986
|
case 11:
|
|
999
987
|
expect(first.previousElementSibling.classList.contains('k-in-range')).to.be.true;
|
|
1000
988
|
expect(first.nextElementSibling.classList.contains('k-in-range')).to.be.false;
|
|
1001
989
|
dispatchEvent(first.previousElementSibling.previousElementSibling, 'click');
|
|
1002
|
-
|
|
990
|
+
_context26.next = 16;
|
|
1003
991
|
return wait();
|
|
1004
992
|
case 16:
|
|
1005
993
|
value = instance.get('date');
|
|
@@ -1007,19 +995,19 @@ describe('Datepicker', function () {
|
|
|
1007
995
|
expect(value[0] < value[1]).to.be.true;
|
|
1008
996
|
case 19:
|
|
1009
997
|
case "end":
|
|
1010
|
-
return
|
|
998
|
+
return _context26.stop();
|
|
1011
999
|
}
|
|
1012
|
-
},
|
|
1000
|
+
}, _callee26);
|
|
1013
1001
|
})));
|
|
1014
|
-
it('select the same date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1002
|
+
it('select the same date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
|
|
1015
1003
|
var value1;
|
|
1016
|
-
return _regeneratorRuntime.wrap(function
|
|
1017
|
-
while (1) switch (
|
|
1004
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
1005
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1018
1006
|
case 0:
|
|
1019
1007
|
// select the middle date
|
|
1020
1008
|
first.click();
|
|
1021
1009
|
first.click();
|
|
1022
|
-
|
|
1010
|
+
_context27.next = 4;
|
|
1023
1011
|
return wait();
|
|
1024
1012
|
case 4:
|
|
1025
1013
|
value1 = instance.get('date');
|
|
@@ -1027,51 +1015,51 @@ describe('Datepicker', function () {
|
|
|
1027
1015
|
expect(value1[0]).eql(value1[1]);
|
|
1028
1016
|
case 7:
|
|
1029
1017
|
case "end":
|
|
1030
|
-
return
|
|
1018
|
+
return _context27.stop();
|
|
1031
1019
|
}
|
|
1032
|
-
},
|
|
1020
|
+
}, _callee27);
|
|
1033
1021
|
})));
|
|
1034
|
-
it('cross months', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1022
|
+
it('cross months', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
|
|
1035
1023
|
var second;
|
|
1036
|
-
return _regeneratorRuntime.wrap(function
|
|
1037
|
-
while (1) switch (
|
|
1024
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
1025
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1038
1026
|
case 0:
|
|
1039
1027
|
first.click();
|
|
1040
1028
|
second = content.querySelector('.k-datepicker-calendar-time-wrapper:nth-child(2) .k-calendar-item:nth-child(19)');
|
|
1041
1029
|
second.click();
|
|
1042
|
-
|
|
1030
|
+
_context28.next = 5;
|
|
1043
1031
|
return wait();
|
|
1044
1032
|
case 5:
|
|
1045
1033
|
expect(instance.get('date')).have.lengthOf(2);
|
|
1046
1034
|
case 6:
|
|
1047
1035
|
case "end":
|
|
1048
|
-
return
|
|
1036
|
+
return _context28.stop();
|
|
1049
1037
|
}
|
|
1050
|
-
},
|
|
1038
|
+
}, _callee28);
|
|
1051
1039
|
})));
|
|
1052
|
-
it('can select end date which is less than start date on selecting', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1040
|
+
it('can select end date which is less than start date on selecting', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
|
|
1053
1041
|
var first, inputInner;
|
|
1054
|
-
return _regeneratorRuntime.wrap(function
|
|
1055
|
-
while (1) switch (
|
|
1042
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
1043
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1056
1044
|
case 0:
|
|
1057
1045
|
// hide firstly
|
|
1058
1046
|
document.body.click();
|
|
1059
|
-
|
|
1047
|
+
_context29.next = 3;
|
|
1060
1048
|
return wait();
|
|
1061
1049
|
case 3:
|
|
1062
1050
|
instance.set('date', ['2025-08-01', '2025-08-02']);
|
|
1063
|
-
|
|
1051
|
+
_context29.next = 6;
|
|
1064
1052
|
return wait();
|
|
1065
1053
|
case 6:
|
|
1066
1054
|
// show again
|
|
1067
1055
|
select.click();
|
|
1068
|
-
|
|
1056
|
+
_context29.next = 9;
|
|
1069
1057
|
return wait();
|
|
1070
1058
|
case 9:
|
|
1071
1059
|
// select date 3
|
|
1072
1060
|
first = content.querySelector('.k-calendar-item:not(.k-exceed):not(.k-active)');
|
|
1073
1061
|
first.click();
|
|
1074
|
-
|
|
1062
|
+
_context29.next = 13;
|
|
1075
1063
|
return wait();
|
|
1076
1064
|
case 13:
|
|
1077
1065
|
inputInner = select.querySelector('.k-input-inner');
|
|
@@ -1079,50 +1067,50 @@ describe('Datepicker', function () {
|
|
|
1079
1067
|
expect(instance.get('date')).eql(['2025-08-01', '2025-08-02']);
|
|
1080
1068
|
// should update value after hiding
|
|
1081
1069
|
document.body.click();
|
|
1082
|
-
|
|
1070
|
+
_context29.next = 19;
|
|
1083
1071
|
return wait();
|
|
1084
1072
|
case 19:
|
|
1085
1073
|
expect(inputInner.value).eql('2025-08-02 ~ 2025-08-03');
|
|
1086
1074
|
expect(instance.get('date')).eql(['2025-08-02', '2025-08-03']);
|
|
1087
1075
|
case 21:
|
|
1088
1076
|
case "end":
|
|
1089
|
-
return
|
|
1077
|
+
return _context29.stop();
|
|
1090
1078
|
}
|
|
1091
|
-
},
|
|
1079
|
+
}, _callee29);
|
|
1092
1080
|
})));
|
|
1093
1081
|
case 5:
|
|
1094
1082
|
case "end":
|
|
1095
|
-
return
|
|
1083
|
+
return _context30.stop();
|
|
1096
1084
|
}
|
|
1097
|
-
},
|
|
1085
|
+
}, _callee30);
|
|
1098
1086
|
})));
|
|
1099
|
-
describe('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1087
|
+
describe('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40() {
|
|
1100
1088
|
var instance, element, datetime, dateString, match, show, _show4;
|
|
1101
|
-
return _regeneratorRuntime.wrap(function
|
|
1102
|
-
while (1) switch (
|
|
1089
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
1090
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
1103
1091
|
case 0:
|
|
1104
1092
|
_show4 = function _show6() {
|
|
1105
|
-
_show4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1093
|
+
_show4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39() {
|
|
1106
1094
|
var content, first;
|
|
1107
|
-
return _regeneratorRuntime.wrap(function
|
|
1108
|
-
while (1) switch (
|
|
1095
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
1096
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
1109
1097
|
case 0:
|
|
1110
1098
|
datetime.click();
|
|
1111
|
-
|
|
1099
|
+
_context39.next = 3;
|
|
1112
1100
|
return wait();
|
|
1113
1101
|
case 3:
|
|
1114
1102
|
content = getElement('.k-datepicker-content');
|
|
1115
1103
|
first = content.querySelector('.k-calendar-item:not(.k-exceed)');
|
|
1116
1104
|
first.click();
|
|
1117
|
-
|
|
1105
|
+
_context39.next = 8;
|
|
1118
1106
|
return wait();
|
|
1119
1107
|
case 8:
|
|
1120
|
-
return
|
|
1108
|
+
return _context39.abrupt("return", [content, first]);
|
|
1121
1109
|
case 9:
|
|
1122
1110
|
case "end":
|
|
1123
|
-
return
|
|
1111
|
+
return _context39.stop();
|
|
1124
1112
|
}
|
|
1125
|
-
},
|
|
1113
|
+
}, _callee39);
|
|
1126
1114
|
}));
|
|
1127
1115
|
return _show4.apply(this, arguments);
|
|
1128
1116
|
};
|
|
@@ -1139,15 +1127,15 @@ describe('Datepicker', function () {
|
|
|
1139
1127
|
element = result[1];
|
|
1140
1128
|
datetime = element.querySelectorAll('.k-datepicker')[1];
|
|
1141
1129
|
});
|
|
1142
|
-
it('basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1130
|
+
it('basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
|
|
1143
1131
|
var _yield$show, content, first, confirm, inputInner, second, endDateString;
|
|
1144
|
-
return _regeneratorRuntime.wrap(function
|
|
1145
|
-
while (1) switch (
|
|
1132
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
1133
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1146
1134
|
case 0:
|
|
1147
|
-
|
|
1135
|
+
_context31.next = 2;
|
|
1148
1136
|
return show();
|
|
1149
1137
|
case 2:
|
|
1150
|
-
_yield$show =
|
|
1138
|
+
_yield$show = _context31.sent;
|
|
1151
1139
|
content = _yield$show[0];
|
|
1152
1140
|
first = _yield$show[1];
|
|
1153
1141
|
// should enable confirm button and show the first date string in input
|
|
@@ -1159,13 +1147,13 @@ describe('Datepicker', function () {
|
|
|
1159
1147
|
expect(instance.get('time')).eql(null);
|
|
1160
1148
|
// select time
|
|
1161
1149
|
dispatchEvent(content.querySelector('.k-scroll-select-item'), 'click');
|
|
1162
|
-
|
|
1150
|
+
_context31.next = 14;
|
|
1163
1151
|
return wait();
|
|
1164
1152
|
case 14:
|
|
1165
1153
|
match(inputInner.getAttribute('placeholder'), '15:00:00 ~');
|
|
1166
1154
|
match(inputInner.value, '15:00:00 ~');
|
|
1167
1155
|
confirm.click();
|
|
1168
|
-
|
|
1156
|
+
_context31.next = 19;
|
|
1169
1157
|
return wait();
|
|
1170
1158
|
case 19:
|
|
1171
1159
|
// should disable confirm button on first click
|
|
@@ -1173,7 +1161,7 @@ describe('Datepicker', function () {
|
|
|
1173
1161
|
// select the second datetime
|
|
1174
1162
|
second = first.nextElementSibling;
|
|
1175
1163
|
second.click();
|
|
1176
|
-
|
|
1164
|
+
_context31.next = 24;
|
|
1177
1165
|
return wait();
|
|
1178
1166
|
case 24:
|
|
1179
1167
|
endDateString = dayjs(now).date(2).format('YYYY-MM-DD');
|
|
@@ -1181,132 +1169,132 @@ describe('Datepicker', function () {
|
|
|
1181
1169
|
expect(inputInner.value).eql(dateString + " 15:00:00 ~ " + endDateString + " 00:00:00");
|
|
1182
1170
|
expect(instance.get('time')).eql(null);
|
|
1183
1171
|
confirm.click();
|
|
1184
|
-
|
|
1172
|
+
_context31.next = 31;
|
|
1185
1173
|
return wait();
|
|
1186
1174
|
case 31:
|
|
1187
1175
|
expect(instance.get('time')).eql([dateString + " 15:00:00", endDateString + " 00:00:00"]);
|
|
1188
1176
|
case 32:
|
|
1189
1177
|
case "end":
|
|
1190
|
-
return
|
|
1178
|
+
return _context31.stop();
|
|
1191
1179
|
}
|
|
1192
|
-
},
|
|
1180
|
+
}, _callee31);
|
|
1193
1181
|
})));
|
|
1194
|
-
it('skip select date and select time for the end value directly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1182
|
+
it('skip select date and select time for the end value directly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
|
|
1195
1183
|
var _yield$show2, content, confirm;
|
|
1196
|
-
return _regeneratorRuntime.wrap(function
|
|
1197
|
-
while (1) switch (
|
|
1184
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
1185
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1198
1186
|
case 0:
|
|
1199
|
-
|
|
1187
|
+
_context32.next = 2;
|
|
1200
1188
|
return show();
|
|
1201
1189
|
case 2:
|
|
1202
|
-
_yield$show2 =
|
|
1190
|
+
_yield$show2 = _context32.sent;
|
|
1203
1191
|
content = _yield$show2[0];
|
|
1204
|
-
|
|
1192
|
+
_context32.next = 6;
|
|
1205
1193
|
return clickConfirm(content);
|
|
1206
1194
|
case 6:
|
|
1207
|
-
confirm =
|
|
1195
|
+
confirm = _context32.sent;
|
|
1208
1196
|
// select time
|
|
1209
1197
|
dispatchEvent(content.querySelector('.k-scroll-select-item'), 'click');
|
|
1210
|
-
|
|
1198
|
+
_context32.next = 10;
|
|
1211
1199
|
return wait();
|
|
1212
1200
|
case 10:
|
|
1213
1201
|
confirm.click();
|
|
1214
|
-
|
|
1202
|
+
_context32.next = 13;
|
|
1215
1203
|
return wait();
|
|
1216
1204
|
case 13:
|
|
1217
1205
|
expect(instance.get('time')).eql([dateString + " 00:00:00", dateString + " 15:00:00"]);
|
|
1218
1206
|
case 14:
|
|
1219
1207
|
case "end":
|
|
1220
|
-
return
|
|
1208
|
+
return _context32.stop();
|
|
1221
1209
|
}
|
|
1222
|
-
},
|
|
1210
|
+
}, _callee32);
|
|
1223
1211
|
})));
|
|
1224
|
-
it('can change date before click confirm button', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1212
|
+
it('can change date before click confirm button', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
|
|
1225
1213
|
var _yield$show3, content, first, nextFirst, inputInner, dateString, confirm, second;
|
|
1226
|
-
return _regeneratorRuntime.wrap(function
|
|
1227
|
-
while (1) switch (
|
|
1214
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
1215
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
1228
1216
|
case 0:
|
|
1229
|
-
|
|
1217
|
+
_context33.next = 2;
|
|
1230
1218
|
return show();
|
|
1231
1219
|
case 2:
|
|
1232
|
-
_yield$show3 =
|
|
1220
|
+
_yield$show3 = _context33.sent;
|
|
1233
1221
|
content = _yield$show3[0];
|
|
1234
1222
|
first = _yield$show3[1];
|
|
1235
1223
|
nextFirst = first.nextElementSibling;
|
|
1236
1224
|
nextFirst.click();
|
|
1237
|
-
|
|
1225
|
+
_context33.next = 9;
|
|
1238
1226
|
return wait();
|
|
1239
1227
|
case 9:
|
|
1240
1228
|
inputInner = datetime.querySelector('.k-input-inner');
|
|
1241
1229
|
dateString = dayjs(now).date(2).format('YYYY-MM-DD');
|
|
1242
1230
|
expect(inputInner.value).to.eql(dateString + " 00:00:00 ~");
|
|
1243
|
-
|
|
1231
|
+
_context33.next = 14;
|
|
1244
1232
|
return clickConfirm(content);
|
|
1245
1233
|
case 14:
|
|
1246
|
-
confirm =
|
|
1234
|
+
confirm = _context33.sent;
|
|
1247
1235
|
second = nextFirst.nextElementSibling;
|
|
1248
1236
|
second.click();
|
|
1249
|
-
|
|
1237
|
+
_context33.next = 19;
|
|
1250
1238
|
return wait();
|
|
1251
1239
|
case 19:
|
|
1252
1240
|
expect(inputInner.value).to.eql(dateString + " 00:00:00 ~ " + getDateString(3) + " 00:00:00");
|
|
1253
1241
|
second.nextElementSibling.click();
|
|
1254
|
-
|
|
1242
|
+
_context33.next = 23;
|
|
1255
1243
|
return wait();
|
|
1256
1244
|
case 23:
|
|
1257
1245
|
expect(inputInner.value).to.eql(dateString + " 00:00:00 ~ " + getDateString(4) + " 00:00:00");
|
|
1258
1246
|
confirm.click();
|
|
1259
|
-
|
|
1247
|
+
_context33.next = 27;
|
|
1260
1248
|
return wait();
|
|
1261
1249
|
case 27:
|
|
1262
1250
|
expect(inputInner.value).to.eql(dateString + " 00:00:00 ~ " + getDateString(4) + " 00:00:00");
|
|
1263
1251
|
expect(instance.get('time')).to.eql([dateString + " 00:00:00", getDateString(4) + " 00:00:00"]);
|
|
1264
1252
|
case 29:
|
|
1265
1253
|
case "end":
|
|
1266
|
-
return
|
|
1254
|
+
return _context33.stop();
|
|
1267
1255
|
}
|
|
1268
|
-
},
|
|
1256
|
+
}, _callee33);
|
|
1269
1257
|
})));
|
|
1270
|
-
it('can select end date which is less than start date on selecting', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1258
|
+
it('can select end date which is less than start date on selecting', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
|
|
1271
1259
|
var _yield$show4, content, first, nextFirst, inputInner, confirm, a, b;
|
|
1272
|
-
return _regeneratorRuntime.wrap(function
|
|
1273
|
-
while (1) switch (
|
|
1260
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
1261
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
1274
1262
|
case 0:
|
|
1275
|
-
|
|
1263
|
+
_context34.next = 2;
|
|
1276
1264
|
return show();
|
|
1277
1265
|
case 2:
|
|
1278
|
-
_yield$show4 =
|
|
1266
|
+
_yield$show4 = _context34.sent;
|
|
1279
1267
|
content = _yield$show4[0];
|
|
1280
1268
|
first = _yield$show4[1];
|
|
1281
1269
|
nextFirst = first.nextElementSibling;
|
|
1282
1270
|
nextFirst.click();
|
|
1283
|
-
|
|
1271
|
+
_context34.next = 9;
|
|
1284
1272
|
return wait();
|
|
1285
1273
|
case 9:
|
|
1286
1274
|
inputInner = datetime.querySelector('.k-input-inner');
|
|
1287
1275
|
expect(inputInner.value).to.eql(getDateString(2) + " 00:00:00 ~");
|
|
1288
1276
|
// hide to reset the selected state
|
|
1289
1277
|
document.body.click();
|
|
1290
|
-
|
|
1278
|
+
_context34.next = 14;
|
|
1291
1279
|
return wait();
|
|
1292
1280
|
case 14:
|
|
1293
1281
|
expect(inputInner.value).to.eql("");
|
|
1294
1282
|
expect(instance.get('time')).to.be.null;
|
|
1295
1283
|
// show again
|
|
1296
1284
|
datetime.click();
|
|
1297
|
-
|
|
1285
|
+
_context34.next = 19;
|
|
1298
1286
|
return wait();
|
|
1299
1287
|
case 19:
|
|
1300
1288
|
nextFirst.click();
|
|
1301
|
-
|
|
1289
|
+
_context34.next = 22;
|
|
1302
1290
|
return wait();
|
|
1303
1291
|
case 22:
|
|
1304
|
-
|
|
1292
|
+
_context34.next = 24;
|
|
1305
1293
|
return clickConfirm(content);
|
|
1306
1294
|
case 24:
|
|
1307
|
-
confirm =
|
|
1295
|
+
confirm = _context34.sent;
|
|
1308
1296
|
first.click();
|
|
1309
|
-
|
|
1297
|
+
_context34.next = 28;
|
|
1310
1298
|
return wait();
|
|
1311
1299
|
case 28:
|
|
1312
1300
|
a = getDateString(2) + " 00:00:00";
|
|
@@ -1314,52 +1302,52 @@ describe('Datepicker', function () {
|
|
|
1314
1302
|
expect(inputInner.value).to.eql(a + " ~ " + b);
|
|
1315
1303
|
expect(instance.get('time')).to.eql(null);
|
|
1316
1304
|
confirm.click();
|
|
1317
|
-
|
|
1305
|
+
_context34.next = 35;
|
|
1318
1306
|
return wait();
|
|
1319
1307
|
case 35:
|
|
1320
1308
|
expect(instance.get('time')).to.eql([b, a]);
|
|
1321
1309
|
case 36:
|
|
1322
1310
|
case "end":
|
|
1323
|
-
return
|
|
1311
|
+
return _context34.stop();
|
|
1324
1312
|
}
|
|
1325
|
-
},
|
|
1313
|
+
}, _callee34);
|
|
1326
1314
|
})));
|
|
1327
|
-
it('should reset position on clear value or set value to empty', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1315
|
+
it('should reset position on clear value or set value to empty', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36() {
|
|
1328
1316
|
var a, b, _yield$show5, content, first, selectAgain, _selectAgain;
|
|
1329
|
-
return _regeneratorRuntime.wrap(function
|
|
1330
|
-
while (1) switch (
|
|
1317
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
1318
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
1331
1319
|
case 0:
|
|
1332
1320
|
_selectAgain = function _selectAgain3() {
|
|
1333
|
-
_selectAgain = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1321
|
+
_selectAgain = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
|
|
1334
1322
|
var confirm;
|
|
1335
|
-
return _regeneratorRuntime.wrap(function
|
|
1336
|
-
while (1) switch (
|
|
1323
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
1324
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
1337
1325
|
case 0:
|
|
1338
|
-
|
|
1326
|
+
_context35.next = 2;
|
|
1339
1327
|
return wait();
|
|
1340
1328
|
case 2:
|
|
1341
1329
|
first.click();
|
|
1342
|
-
|
|
1330
|
+
_context35.next = 5;
|
|
1343
1331
|
return wait();
|
|
1344
1332
|
case 5:
|
|
1345
|
-
|
|
1333
|
+
_context35.next = 7;
|
|
1346
1334
|
return clickConfirm(content);
|
|
1347
1335
|
case 7:
|
|
1348
|
-
confirm =
|
|
1336
|
+
confirm = _context35.sent;
|
|
1349
1337
|
first.nextElementSibling.click();
|
|
1350
|
-
|
|
1338
|
+
_context35.next = 11;
|
|
1351
1339
|
return wait();
|
|
1352
1340
|
case 11:
|
|
1353
1341
|
confirm.click();
|
|
1354
|
-
|
|
1342
|
+
_context35.next = 14;
|
|
1355
1343
|
return wait();
|
|
1356
1344
|
case 14:
|
|
1357
1345
|
expect(instance.get('time')).eql([a, b]);
|
|
1358
1346
|
case 15:
|
|
1359
1347
|
case "end":
|
|
1360
|
-
return
|
|
1348
|
+
return _context35.stop();
|
|
1361
1349
|
}
|
|
1362
|
-
},
|
|
1350
|
+
}, _callee35);
|
|
1363
1351
|
}));
|
|
1364
1352
|
return _selectAgain.apply(this, arguments);
|
|
1365
1353
|
};
|
|
@@ -1369,67 +1357,67 @@ describe('Datepicker', function () {
|
|
|
1369
1357
|
a = getDateString(1) + " 00:00:00";
|
|
1370
1358
|
b = getDateString(2) + " 00:00:00";
|
|
1371
1359
|
instance.set('time', [a, b]);
|
|
1372
|
-
|
|
1360
|
+
_context36.next = 7;
|
|
1373
1361
|
return show();
|
|
1374
1362
|
case 7:
|
|
1375
|
-
_yield$show5 =
|
|
1363
|
+
_yield$show5 = _context36.sent;
|
|
1376
1364
|
content = _yield$show5[0];
|
|
1377
1365
|
first = _yield$show5[1];
|
|
1378
1366
|
// clear
|
|
1379
1367
|
dispatchEvent(datetime.querySelector('.k-select-clear'), 'click');
|
|
1380
|
-
|
|
1368
|
+
_context36.next = 13;
|
|
1381
1369
|
return wait();
|
|
1382
1370
|
case 13:
|
|
1383
1371
|
expect(instance.get('time')).eql(null);
|
|
1384
|
-
|
|
1372
|
+
_context36.next = 16;
|
|
1385
1373
|
return selectAgain();
|
|
1386
1374
|
case 16:
|
|
1387
1375
|
// set time to null
|
|
1388
1376
|
datetime.click();
|
|
1389
|
-
|
|
1377
|
+
_context36.next = 19;
|
|
1390
1378
|
return wait();
|
|
1391
1379
|
case 19:
|
|
1392
1380
|
instance.set('time', null);
|
|
1393
|
-
|
|
1381
|
+
_context36.next = 22;
|
|
1394
1382
|
return selectAgain();
|
|
1395
1383
|
case 22:
|
|
1396
1384
|
// set time to empty array
|
|
1397
1385
|
datetime.click();
|
|
1398
|
-
|
|
1386
|
+
_context36.next = 25;
|
|
1399
1387
|
return wait();
|
|
1400
1388
|
case 25:
|
|
1401
1389
|
instance.set('time', []);
|
|
1402
|
-
|
|
1390
|
+
_context36.next = 28;
|
|
1403
1391
|
return selectAgain();
|
|
1404
1392
|
case 28:
|
|
1405
1393
|
case "end":
|
|
1406
|
-
return
|
|
1394
|
+
return _context36.stop();
|
|
1407
1395
|
}
|
|
1408
|
-
},
|
|
1396
|
+
}, _callee36);
|
|
1409
1397
|
})));
|
|
1410
|
-
it('should only auto hide after twice selection and the start and end datetime are already selected', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1398
|
+
it('should only auto hide after twice selection and the start and end datetime are already selected', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38() {
|
|
1411
1399
|
var _yield$show6, content, first, next, confirm, startDate, endDate, inputInner, separatePos, newFirst, _checkDisplay, setCursor, resetAndShow, _resetAndShow;
|
|
1412
|
-
return _regeneratorRuntime.wrap(function
|
|
1413
|
-
while (1) switch (
|
|
1400
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
1401
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
1414
1402
|
case 0:
|
|
1415
1403
|
_resetAndShow = function _resetAndShow3() {
|
|
1416
|
-
_resetAndShow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1417
|
-
return _regeneratorRuntime.wrap(function
|
|
1418
|
-
while (1) switch (
|
|
1404
|
+
_resetAndShow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37() {
|
|
1405
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
1406
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
1419
1407
|
case 0:
|
|
1420
1408
|
instance.set('time', [startDate, endDate]);
|
|
1421
|
-
|
|
1409
|
+
_context37.next = 3;
|
|
1422
1410
|
return wait();
|
|
1423
1411
|
case 3:
|
|
1424
1412
|
setCursor(separatePos + 1);
|
|
1425
1413
|
datetime.click();
|
|
1426
|
-
|
|
1414
|
+
_context37.next = 7;
|
|
1427
1415
|
return wait();
|
|
1428
1416
|
case 7:
|
|
1429
1417
|
case "end":
|
|
1430
|
-
return
|
|
1418
|
+
return _context37.stop();
|
|
1431
1419
|
}
|
|
1432
|
-
},
|
|
1420
|
+
}, _callee37);
|
|
1433
1421
|
}));
|
|
1434
1422
|
return _resetAndShow.apply(this, arguments);
|
|
1435
1423
|
};
|
|
@@ -1443,31 +1431,31 @@ describe('Datepicker', function () {
|
|
|
1443
1431
|
_checkDisplay = function _checkDisplay2(isShow) {
|
|
1444
1432
|
checkDisplay(content, isShow);
|
|
1445
1433
|
};
|
|
1446
|
-
|
|
1434
|
+
_context38.next = 6;
|
|
1447
1435
|
return show();
|
|
1448
1436
|
case 6:
|
|
1449
|
-
_yield$show6 =
|
|
1437
|
+
_yield$show6 = _context38.sent;
|
|
1450
1438
|
content = _yield$show6[0];
|
|
1451
1439
|
first = _yield$show6[1];
|
|
1452
1440
|
next = first.nextElementSibling;
|
|
1453
1441
|
next.click();
|
|
1454
|
-
|
|
1442
|
+
_context38.next = 13;
|
|
1455
1443
|
return wait();
|
|
1456
1444
|
case 13:
|
|
1457
|
-
|
|
1445
|
+
_context38.next = 15;
|
|
1458
1446
|
return clickConfirm(content);
|
|
1459
1447
|
case 15:
|
|
1460
|
-
confirm =
|
|
1461
|
-
|
|
1448
|
+
confirm = _context38.sent;
|
|
1449
|
+
_context38.next = 18;
|
|
1462
1450
|
return wait();
|
|
1463
1451
|
case 18:
|
|
1464
1452
|
_checkDisplay(true);
|
|
1465
1453
|
first.click();
|
|
1466
|
-
|
|
1454
|
+
_context38.next = 22;
|
|
1467
1455
|
return wait();
|
|
1468
1456
|
case 22:
|
|
1469
1457
|
confirm.click();
|
|
1470
|
-
|
|
1458
|
+
_context38.next = 25;
|
|
1471
1459
|
return wait();
|
|
1472
1460
|
case 25:
|
|
1473
1461
|
_checkDisplay(false);
|
|
@@ -1475,108 +1463,108 @@ describe('Datepicker', function () {
|
|
|
1475
1463
|
endDate = '2025-08-10 00:00:00';
|
|
1476
1464
|
inputInner = datetime.querySelector('.k-input-inner');
|
|
1477
1465
|
separatePos = (dateString + " 00:00:00 ~").length;
|
|
1478
|
-
|
|
1466
|
+
_context38.next = 32;
|
|
1479
1467
|
return resetAndShow();
|
|
1480
1468
|
case 32:
|
|
1481
1469
|
newFirst = content.querySelector('.k-calendar-item:not(.k-exceed)');
|
|
1482
1470
|
newFirst.click();
|
|
1483
|
-
|
|
1471
|
+
_context38.next = 36;
|
|
1484
1472
|
return wait();
|
|
1485
1473
|
case 36:
|
|
1486
1474
|
confirm.click();
|
|
1487
|
-
|
|
1475
|
+
_context38.next = 39;
|
|
1488
1476
|
return wait();
|
|
1489
1477
|
case 39:
|
|
1490
1478
|
_checkDisplay(true);
|
|
1491
1479
|
expect(instance.get('time')).eql([startDate, endDate]);
|
|
1492
1480
|
// cancel the start time selection
|
|
1493
1481
|
document.body.click();
|
|
1494
|
-
|
|
1482
|
+
_context38.next = 44;
|
|
1495
1483
|
return wait();
|
|
1496
1484
|
case 44:
|
|
1497
1485
|
expect(instance.get('time')).eql(['2025-08-01 00:00:00', startDate]);
|
|
1498
1486
|
// select from end position to start position
|
|
1499
|
-
|
|
1487
|
+
_context38.next = 47;
|
|
1500
1488
|
return resetAndShow();
|
|
1501
1489
|
case 47:
|
|
1502
1490
|
newFirst.click();
|
|
1503
|
-
|
|
1491
|
+
_context38.next = 50;
|
|
1504
1492
|
return wait();
|
|
1505
1493
|
case 50:
|
|
1506
1494
|
confirm.click();
|
|
1507
|
-
|
|
1495
|
+
_context38.next = 53;
|
|
1508
1496
|
return wait();
|
|
1509
1497
|
case 53:
|
|
1510
1498
|
newFirst.nextElementSibling.click();
|
|
1511
|
-
|
|
1499
|
+
_context38.next = 56;
|
|
1512
1500
|
return wait();
|
|
1513
1501
|
case 56:
|
|
1514
1502
|
_checkDisplay(true);
|
|
1515
1503
|
expect(instance.get('time')).eql([startDate, endDate]);
|
|
1516
1504
|
confirm.click();
|
|
1517
|
-
|
|
1505
|
+
_context38.next = 61;
|
|
1518
1506
|
return wait();
|
|
1519
1507
|
case 61:
|
|
1520
1508
|
_checkDisplay(false);
|
|
1521
1509
|
expect(instance.get('time')).eql(['2025-08-01 00:00:00', '2025-08-02 00:00:00']);
|
|
1522
1510
|
// select the end position value then change to end position again
|
|
1523
|
-
|
|
1511
|
+
_context38.next = 65;
|
|
1524
1512
|
return resetAndShow();
|
|
1525
1513
|
case 65:
|
|
1526
1514
|
newFirst.click();
|
|
1527
|
-
|
|
1515
|
+
_context38.next = 68;
|
|
1528
1516
|
return wait();
|
|
1529
1517
|
case 68:
|
|
1530
1518
|
confirm.click();
|
|
1531
|
-
|
|
1519
|
+
_context38.next = 71;
|
|
1532
1520
|
return wait();
|
|
1533
1521
|
case 71:
|
|
1534
1522
|
// change to the end position
|
|
1535
1523
|
setCursor(separatePos + 1);
|
|
1536
1524
|
datetime.click();
|
|
1537
1525
|
newFirst.nextElementSibling.click();
|
|
1538
|
-
|
|
1526
|
+
_context38.next = 76;
|
|
1539
1527
|
return wait();
|
|
1540
1528
|
case 76:
|
|
1541
1529
|
_checkDisplay(true);
|
|
1542
1530
|
confirm.click();
|
|
1543
1531
|
// should not hide
|
|
1544
|
-
|
|
1532
|
+
_context38.next = 80;
|
|
1545
1533
|
return wait();
|
|
1546
1534
|
case 80:
|
|
1547
1535
|
_checkDisplay(true);
|
|
1548
1536
|
// select the start position value
|
|
1549
1537
|
newFirst.click();
|
|
1550
|
-
|
|
1538
|
+
_context38.next = 84;
|
|
1551
1539
|
return wait();
|
|
1552
1540
|
case 84:
|
|
1553
1541
|
confirm.click();
|
|
1554
|
-
|
|
1542
|
+
_context38.next = 87;
|
|
1555
1543
|
return wait();
|
|
1556
1544
|
case 87:
|
|
1557
1545
|
_checkDisplay(false);
|
|
1558
1546
|
expect(instance.get('time')).eql(['2025-08-01 00:00:00', '2025-08-02 00:00:00']);
|
|
1559
1547
|
case 89:
|
|
1560
1548
|
case "end":
|
|
1561
|
-
return
|
|
1549
|
+
return _context38.stop();
|
|
1562
1550
|
}
|
|
1563
|
-
},
|
|
1551
|
+
}, _callee38);
|
|
1564
1552
|
})));
|
|
1565
1553
|
case 11:
|
|
1566
1554
|
case "end":
|
|
1567
|
-
return
|
|
1555
|
+
return _context40.stop();
|
|
1568
1556
|
}
|
|
1569
|
-
},
|
|
1557
|
+
}, _callee40);
|
|
1570
1558
|
})));
|
|
1571
|
-
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1572
|
-
var
|
|
1573
|
-
return _regeneratorRuntime.wrap(function
|
|
1574
|
-
while (1) switch (
|
|
1559
|
+
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41() {
|
|
1560
|
+
var _mount20, instance, element, _element$querySelecto12, select, content, _content$querySelecto9, calendar1, calendar2, first, second, value;
|
|
1561
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
1562
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
1575
1563
|
case 0:
|
|
1576
|
-
|
|
1564
|
+
_mount20 = mount(RangeDemo), instance = _mount20[0], element = _mount20[1];
|
|
1577
1565
|
_element$querySelecto12 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto12[2];
|
|
1578
1566
|
select.click();
|
|
1579
|
-
|
|
1567
|
+
_context41.next = 5;
|
|
1580
1568
|
return wait();
|
|
1581
1569
|
case 5:
|
|
1582
1570
|
content = getElement('.k-datepicker-content');
|
|
@@ -1585,26 +1573,26 @@ describe('Datepicker', function () {
|
|
|
1585
1573
|
second = calendar2.querySelector('.k-calendar-item:nth-child(2)');
|
|
1586
1574
|
first.click();
|
|
1587
1575
|
second.click();
|
|
1588
|
-
|
|
1576
|
+
_context41.next = 13;
|
|
1589
1577
|
return wait();
|
|
1590
1578
|
case 13:
|
|
1591
1579
|
value = instance.get('year');
|
|
1592
1580
|
expect(value).eql([String(startYear), String(startYear + 10)]);
|
|
1593
1581
|
case 15:
|
|
1594
1582
|
case "end":
|
|
1595
|
-
return
|
|
1583
|
+
return _context41.stop();
|
|
1596
1584
|
}
|
|
1597
|
-
},
|
|
1585
|
+
}, _callee41);
|
|
1598
1586
|
})));
|
|
1599
|
-
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1600
|
-
var
|
|
1601
|
-
return _regeneratorRuntime.wrap(function
|
|
1602
|
-
while (1) switch (
|
|
1587
|
+
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
|
|
1588
|
+
var _mount21, instance, element, _element$querySelecto13, select, content, _content$querySelecto10, calendar1, calendar2, first, second, value;
|
|
1589
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
1590
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
1603
1591
|
case 0:
|
|
1604
|
-
|
|
1592
|
+
_mount21 = mount(RangeDemo), instance = _mount21[0], element = _mount21[1];
|
|
1605
1593
|
_element$querySelecto13 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto13[3];
|
|
1606
1594
|
select.click();
|
|
1607
|
-
|
|
1595
|
+
_context42.next = 5;
|
|
1608
1596
|
return wait();
|
|
1609
1597
|
case 5:
|
|
1610
1598
|
content = getElement('.k-datepicker-content');
|
|
@@ -1613,37 +1601,37 @@ describe('Datepicker', function () {
|
|
|
1613
1601
|
second = calendar2.querySelector('.k-calendar-item:nth-child(1)');
|
|
1614
1602
|
first.click();
|
|
1615
1603
|
second.click();
|
|
1616
|
-
|
|
1604
|
+
_context42.next = 13;
|
|
1617
1605
|
return wait();
|
|
1618
1606
|
case 13:
|
|
1619
1607
|
value = instance.get('month');
|
|
1620
1608
|
expect(value).eql([year + "-01", year + 1 + "-01"]);
|
|
1621
1609
|
case 15:
|
|
1622
1610
|
case "end":
|
|
1623
|
-
return
|
|
1611
|
+
return _context42.stop();
|
|
1624
1612
|
}
|
|
1625
|
-
},
|
|
1613
|
+
}, _callee42);
|
|
1626
1614
|
})));
|
|
1627
1615
|
});
|
|
1628
1616
|
describe('Keybord', function () {
|
|
1629
|
-
it('single date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1630
|
-
var
|
|
1631
|
-
var
|
|
1632
|
-
return _regeneratorRuntime.wrap(function
|
|
1633
|
-
while (1) switch (
|
|
1617
|
+
it('single date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
|
|
1618
|
+
var _context43;
|
|
1619
|
+
var _mount22, instance, element, now, select, content;
|
|
1620
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context44) {
|
|
1621
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
1634
1622
|
case 0:
|
|
1635
|
-
|
|
1623
|
+
_mount22 = mount(BasicDemo), instance = _mount22[0], element = _mount22[1];
|
|
1636
1624
|
now = new Date();
|
|
1637
1625
|
select = element.querySelector('.k-datepicker');
|
|
1638
1626
|
select.click();
|
|
1639
|
-
|
|
1627
|
+
_context44.next = 6;
|
|
1640
1628
|
return wait();
|
|
1641
1629
|
case 6:
|
|
1642
1630
|
content = getElement('.k-datepicker-content'); // down
|
|
1643
1631
|
dispatchEvent(select, 'keydown', {
|
|
1644
1632
|
keyCode: 40
|
|
1645
1633
|
});
|
|
1646
|
-
|
|
1634
|
+
_context44.next = 10;
|
|
1647
1635
|
return wait();
|
|
1648
1636
|
case 10:
|
|
1649
1637
|
expect(+content.querySelector('.k-hover').textContent).to.eql(now.getDate());
|
|
@@ -1651,7 +1639,7 @@ describe('Datepicker', function () {
|
|
|
1651
1639
|
dispatchEvent(select, 'keydown', {
|
|
1652
1640
|
keyCode: 38
|
|
1653
1641
|
});
|
|
1654
|
-
|
|
1642
|
+
_context44.next = 14;
|
|
1655
1643
|
return wait();
|
|
1656
1644
|
case 14:
|
|
1657
1645
|
now.setDate(now.getDate() - 7);
|
|
@@ -1660,7 +1648,7 @@ describe('Datepicker', function () {
|
|
|
1660
1648
|
dispatchEvent(select, 'keydown', {
|
|
1661
1649
|
keyCode: 39
|
|
1662
1650
|
});
|
|
1663
|
-
|
|
1651
|
+
_context44.next = 19;
|
|
1664
1652
|
return wait();
|
|
1665
1653
|
case 19:
|
|
1666
1654
|
now.setDate(now.getDate() + 1);
|
|
@@ -1669,7 +1657,7 @@ describe('Datepicker', function () {
|
|
|
1669
1657
|
dispatchEvent(select, 'keydown', {
|
|
1670
1658
|
keyCode: 37
|
|
1671
1659
|
});
|
|
1672
|
-
|
|
1660
|
+
_context44.next = 24;
|
|
1673
1661
|
return wait();
|
|
1674
1662
|
case 24:
|
|
1675
1663
|
now.setDate(now.getDate() - 1);
|
|
@@ -1678,39 +1666,39 @@ describe('Datepicker', function () {
|
|
|
1678
1666
|
dispatchEvent(select, 'keydown', {
|
|
1679
1667
|
keyCode: 13
|
|
1680
1668
|
});
|
|
1681
|
-
|
|
1669
|
+
_context44.next = 29;
|
|
1682
1670
|
return wait();
|
|
1683
1671
|
case 29:
|
|
1684
|
-
expect(_mapInstanceProperty(
|
|
1672
|
+
expect(_mapInstanceProperty(_context43 = instance.get('date').split('-')).call(_context43, function (v) {
|
|
1685
1673
|
return +v;
|
|
1686
1674
|
})).to.eql([now.getFullYear(), now.getMonth() + 1, now.getDate()]);
|
|
1687
1675
|
// again
|
|
1688
1676
|
select.click();
|
|
1689
|
-
|
|
1677
|
+
_context44.next = 33;
|
|
1690
1678
|
return wait();
|
|
1691
1679
|
case 33:
|
|
1692
1680
|
dispatchEvent(select, 'keydown', {
|
|
1693
1681
|
keyCode: 40
|
|
1694
1682
|
});
|
|
1695
|
-
|
|
1683
|
+
_context44.next = 36;
|
|
1696
1684
|
return wait();
|
|
1697
1685
|
case 36:
|
|
1698
1686
|
expect(+content.querySelector('.k-hover').textContent).to.eql(now.getDate());
|
|
1699
1687
|
case 37:
|
|
1700
1688
|
case "end":
|
|
1701
|
-
return
|
|
1689
|
+
return _context44.stop();
|
|
1702
1690
|
}
|
|
1703
|
-
},
|
|
1691
|
+
}, _callee43);
|
|
1704
1692
|
})));
|
|
1705
|
-
it('range date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1706
|
-
var
|
|
1707
|
-
return _regeneratorRuntime.wrap(function
|
|
1708
|
-
while (1) switch (
|
|
1693
|
+
it('range date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
|
|
1694
|
+
var _mount23, instance, element, select, value, _value;
|
|
1695
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context45) {
|
|
1696
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
1709
1697
|
case 0:
|
|
1710
|
-
|
|
1698
|
+
_mount23 = mount(RangeDemo), instance = _mount23[0], element = _mount23[1];
|
|
1711
1699
|
select = element.querySelector('.k-datepicker');
|
|
1712
1700
|
select.click();
|
|
1713
|
-
|
|
1701
|
+
_context45.next = 5;
|
|
1714
1702
|
return wait();
|
|
1715
1703
|
case 5:
|
|
1716
1704
|
dispatchEvent(select, 'keydown', {
|
|
@@ -1725,14 +1713,14 @@ describe('Datepicker', function () {
|
|
|
1725
1713
|
dispatchEvent(select, 'keydown', {
|
|
1726
1714
|
keyCode: 13
|
|
1727
1715
|
});
|
|
1728
|
-
|
|
1716
|
+
_context45.next = 11;
|
|
1729
1717
|
return wait();
|
|
1730
1718
|
case 11:
|
|
1731
1719
|
value = instance.get('date');
|
|
1732
1720
|
expect(value).have.lengthOf(2);
|
|
1733
1721
|
// again
|
|
1734
1722
|
select.click();
|
|
1735
|
-
|
|
1723
|
+
_context45.next = 16;
|
|
1736
1724
|
return wait();
|
|
1737
1725
|
case 16:
|
|
1738
1726
|
dispatchEvent(select, 'keydown', {
|
|
@@ -1744,26 +1732,26 @@ describe('Datepicker', function () {
|
|
|
1744
1732
|
dispatchEvent(select, 'keydown', {
|
|
1745
1733
|
keyCode: 13
|
|
1746
1734
|
});
|
|
1747
|
-
|
|
1735
|
+
_context45.next = 21;
|
|
1748
1736
|
return wait();
|
|
1749
1737
|
case 21:
|
|
1750
1738
|
_value = instance.get('date');
|
|
1751
1739
|
expect(_value[0]).eql(_value[1]);
|
|
1752
1740
|
case 23:
|
|
1753
1741
|
case "end":
|
|
1754
|
-
return
|
|
1742
|
+
return _context45.stop();
|
|
1755
1743
|
}
|
|
1756
|
-
},
|
|
1744
|
+
}, _callee44);
|
|
1757
1745
|
})));
|
|
1758
1746
|
});
|
|
1759
1747
|
describe('Event', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47() {
|
|
1760
|
-
return _regeneratorRuntime.wrap(function _callee47$(
|
|
1761
|
-
while (1) switch (
|
|
1748
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context50) {
|
|
1749
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
1762
1750
|
case 0:
|
|
1763
|
-
it('selecting', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1764
|
-
var fn, Demo,
|
|
1765
|
-
return _regeneratorRuntime.wrap(function
|
|
1766
|
-
while (1) switch (
|
|
1751
|
+
it('selecting', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
|
|
1752
|
+
var fn, Demo, _mount24, instance, element, content, calendar, first, second, firstDateItem, activeTimeItem, nextTimeItem, confirmBtn, endCalendar, endFirst, endSecond, endDateItem, endActiveTimeItem, endNextTimeItem, finalConfirmBtn;
|
|
1753
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context47) {
|
|
1754
|
+
while (1) switch (_context47.prev = _context47.next) {
|
|
1767
1755
|
case 0:
|
|
1768
1756
|
fn = sinon.spy(function (v) {
|
|
1769
1757
|
return console.log(v);
|
|
@@ -1771,12 +1759,12 @@ describe('Datepicker', function () {
|
|
|
1771
1759
|
Demo = /*#__PURE__*/function (_Component) {
|
|
1772
1760
|
_inheritsLoose(Demo, _Component);
|
|
1773
1761
|
function Demo() {
|
|
1774
|
-
var
|
|
1762
|
+
var _context46;
|
|
1775
1763
|
var _this;
|
|
1776
1764
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1777
1765
|
args[_key] = arguments[_key];
|
|
1778
1766
|
}
|
|
1779
|
-
_this = _Component.call.apply(_Component, _concatInstanceProperty(
|
|
1767
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context46 = [this]).call(_context46, args)) || this;
|
|
1780
1768
|
_this.Datepicker = Datepicker;
|
|
1781
1769
|
return _this;
|
|
1782
1770
|
}
|
|
@@ -1787,9 +1775,9 @@ describe('Datepicker', function () {
|
|
|
1787
1775
|
return Demo;
|
|
1788
1776
|
}(Component);
|
|
1789
1777
|
Demo.template = "\n const {Datepicker} = this;\n <Datepicker ev-selecting={this.onSelecting} range type=\"datetime\" />\n ";
|
|
1790
|
-
|
|
1778
|
+
_mount24 = mount(Demo), instance = _mount24[0], element = _mount24[1];
|
|
1791
1779
|
element.click();
|
|
1792
|
-
|
|
1780
|
+
_context47.next = 7;
|
|
1793
1781
|
return wait();
|
|
1794
1782
|
case 7:
|
|
1795
1783
|
content = getElement('.k-datepicker-content');
|
|
@@ -1807,7 +1795,7 @@ describe('Datepicker', function () {
|
|
|
1807
1795
|
expect(fn.lastCall.args[0]).have.lengthOf(1);
|
|
1808
1796
|
confirmBtn = content.querySelector('.k-datepicker-footer .k-btn');
|
|
1809
1797
|
confirmBtn.click();
|
|
1810
|
-
|
|
1798
|
+
_context47.next = 24;
|
|
1811
1799
|
return wait();
|
|
1812
1800
|
case 24:
|
|
1813
1801
|
endCalendar = content.querySelector('.k-datepicker-calendar-time-wrapper');
|
|
@@ -1824,111 +1812,161 @@ describe('Datepicker', function () {
|
|
|
1824
1812
|
expect(fn.lastCall.args[0]).have.lengthOf(1);
|
|
1825
1813
|
finalConfirmBtn = content.querySelector('.k-datepicker-footer .k-btn');
|
|
1826
1814
|
finalConfirmBtn.click();
|
|
1827
|
-
|
|
1815
|
+
_context47.next = 40;
|
|
1828
1816
|
return wait();
|
|
1829
1817
|
case 40:
|
|
1830
1818
|
expect(fn.callCount).to.eql(4);
|
|
1831
1819
|
case 41:
|
|
1832
1820
|
case "end":
|
|
1833
|
-
return
|
|
1821
|
+
return _context47.stop();
|
|
1822
|
+
}
|
|
1823
|
+
}, _callee45);
|
|
1824
|
+
})));
|
|
1825
|
+
it('should trigger change event once', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46() {
|
|
1826
|
+
var change, Demo, _mount25, instance, element, input, calendar, _calendar$querySelect, day1, day2;
|
|
1827
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context49) {
|
|
1828
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
1829
|
+
case 0:
|
|
1830
|
+
change = sinon.spy(function () {
|
|
1831
|
+
return console.log('change');
|
|
1832
|
+
});
|
|
1833
|
+
Demo = /*#__PURE__*/function (_Component2) {
|
|
1834
|
+
_inheritsLoose(Demo, _Component2);
|
|
1835
|
+
function Demo() {
|
|
1836
|
+
var _context48;
|
|
1837
|
+
var _this2;
|
|
1838
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1839
|
+
args[_key2] = arguments[_key2];
|
|
1840
|
+
}
|
|
1841
|
+
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context48 = [this]).call(_context48, args)) || this;
|
|
1842
|
+
_this2.Datepicker = Datepicker;
|
|
1843
|
+
return _this2;
|
|
1844
|
+
}
|
|
1845
|
+
var _proto2 = Demo.prototype;
|
|
1846
|
+
_proto2.onChange = function onChange() {
|
|
1847
|
+
change();
|
|
1848
|
+
};
|
|
1849
|
+
return Demo;
|
|
1850
|
+
}(Component);
|
|
1851
|
+
Demo.template = "\n const {Datepicker} = this;\n <Datepicker range ev-$change:value={this.onChange} v-model=\"value\" clearable />\n ";
|
|
1852
|
+
_mount25 = mount(Demo), instance = _mount25[0], element = _mount25[1];
|
|
1853
|
+
input = element.querySelector('.k-input-inner');
|
|
1854
|
+
input.click();
|
|
1855
|
+
_context49.next = 8;
|
|
1856
|
+
return wait();
|
|
1857
|
+
case 8:
|
|
1858
|
+
calendar = getElement('.k-datepicker-content');
|
|
1859
|
+
_calendar$querySelect = calendar.querySelectorAll('.k-calendar-item:not(.k-exceed)'), day1 = _calendar$querySelect[0], day2 = _calendar$querySelect[1];
|
|
1860
|
+
day1.click();
|
|
1861
|
+
_context49.next = 13;
|
|
1862
|
+
return wait();
|
|
1863
|
+
case 13:
|
|
1864
|
+
day2.click();
|
|
1865
|
+
_context49.next = 16;
|
|
1866
|
+
return wait();
|
|
1867
|
+
case 16:
|
|
1868
|
+
expect(change.callCount).to.eql(1);
|
|
1869
|
+
case 17:
|
|
1870
|
+
case "end":
|
|
1871
|
+
return _context49.stop();
|
|
1834
1872
|
}
|
|
1835
1873
|
}, _callee46);
|
|
1836
1874
|
})));
|
|
1837
|
-
case
|
|
1875
|
+
case 2:
|
|
1838
1876
|
case "end":
|
|
1839
|
-
return
|
|
1877
|
+
return _context50.stop();
|
|
1840
1878
|
}
|
|
1841
1879
|
}, _callee47);
|
|
1842
1880
|
})));
|
|
1843
1881
|
it('should disable some time pickers', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48() {
|
|
1844
|
-
var
|
|
1845
|
-
return _regeneratorRuntime.wrap(function _callee48$(
|
|
1846
|
-
while (1) switch (
|
|
1882
|
+
var _mount26, instance, element, input, content;
|
|
1883
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context51) {
|
|
1884
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
1847
1885
|
case 0:
|
|
1848
|
-
|
|
1886
|
+
_mount26 = mount(DatetimeDemo), instance = _mount26[0], element = _mount26[1];
|
|
1849
1887
|
input = element.querySelectorAll('.k-input')[1];
|
|
1850
1888
|
input.click();
|
|
1851
|
-
|
|
1889
|
+
_context51.next = 5;
|
|
1852
1890
|
return wait();
|
|
1853
1891
|
case 5:
|
|
1854
1892
|
content = getElement('.k-datepicker-content'); // change to time panel
|
|
1855
1893
|
content.querySelector('.k-calendar-item').click();
|
|
1856
|
-
|
|
1894
|
+
_context51.next = 9;
|
|
1857
1895
|
return wait();
|
|
1858
1896
|
case 9:
|
|
1859
1897
|
dispatchEvent(content.querySelector('.k-scroll-select:nth-child(3) .k-scroll-select-item'), 'click');
|
|
1860
1898
|
content.querySelector('.k-datepicker-footer .k-btn').click();
|
|
1861
|
-
|
|
1899
|
+
_context51.next = 13;
|
|
1862
1900
|
return wait();
|
|
1863
1901
|
case 13:
|
|
1864
1902
|
expect(instance.get('datetime2').split(' ')[1]).eql('00:00');
|
|
1865
1903
|
case 14:
|
|
1866
1904
|
case "end":
|
|
1867
|
-
return
|
|
1905
|
+
return _context51.stop();
|
|
1868
1906
|
}
|
|
1869
1907
|
}, _callee48);
|
|
1870
1908
|
})));
|
|
1871
1909
|
it('format', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49() {
|
|
1872
|
-
var
|
|
1873
|
-
return _regeneratorRuntime.wrap(function _callee49$(
|
|
1874
|
-
while (1) switch (
|
|
1910
|
+
var _mount27, instance, element, _element$querySelecto14, input1, input2, input3, content;
|
|
1911
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context52) {
|
|
1912
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
1875
1913
|
case 0:
|
|
1876
|
-
|
|
1914
|
+
_mount27 = mount(FormatDemo), instance = _mount27[0], element = _mount27[1];
|
|
1877
1915
|
_element$querySelecto14 = element.querySelectorAll('.k-input-inner'), input1 = _element$querySelecto14[0], input2 = _element$querySelecto14[1], input3 = _element$querySelecto14[2];
|
|
1878
1916
|
input1.click();
|
|
1879
|
-
|
|
1917
|
+
_context52.next = 5;
|
|
1880
1918
|
return wait();
|
|
1881
1919
|
case 5:
|
|
1882
1920
|
content = getElement('.k-datepicker-content');
|
|
1883
1921
|
content.querySelector('.k-today').click();
|
|
1884
|
-
|
|
1922
|
+
_context52.next = 9;
|
|
1885
1923
|
return wait();
|
|
1886
1924
|
case 9:
|
|
1887
1925
|
expect(instance.get('date1')).to.eql(dayjs().format('MM/DD/YYYY'));
|
|
1888
1926
|
expect(input1.value).to.eql(dayjs().format('MM/DD/YYYY'));
|
|
1889
1927
|
input2.click();
|
|
1890
|
-
|
|
1928
|
+
_context52.next = 14;
|
|
1891
1929
|
return wait();
|
|
1892
1930
|
case 14:
|
|
1893
1931
|
content = getElement('.k-datepicker-content');
|
|
1894
1932
|
content.querySelector('.k-today').click();
|
|
1895
|
-
|
|
1933
|
+
_context52.next = 18;
|
|
1896
1934
|
return wait();
|
|
1897
1935
|
case 18:
|
|
1898
1936
|
expect(instance.get('date2')).to.eql(dayjs().format('YYYY-MM-DD'));
|
|
1899
1937
|
expect(input2.value).to.eql(dayjs().format('YYYY年M月D日'));
|
|
1900
1938
|
input3.click();
|
|
1901
|
-
|
|
1939
|
+
_context52.next = 23;
|
|
1902
1940
|
return wait();
|
|
1903
1941
|
case 23:
|
|
1904
1942
|
content = getElement('.k-datepicker-content');
|
|
1905
1943
|
content.querySelector('.k-today').click();
|
|
1906
|
-
|
|
1944
|
+
_context52.next = 27;
|
|
1907
1945
|
return wait();
|
|
1908
1946
|
case 27:
|
|
1909
1947
|
content.querySelector('.k-datepicker-footer .k-btn').click();
|
|
1910
|
-
|
|
1948
|
+
_context52.next = 30;
|
|
1911
1949
|
return wait();
|
|
1912
1950
|
case 30:
|
|
1913
1951
|
expect(instance.get('date3')).to.eql(dayjs().format('YYYY-MM-DD') + 'T00:00:00.000Z');
|
|
1914
1952
|
expect(input3.value).to.eql(dayjs().format('YYYY-MM-DD') + ' 00:00:00');
|
|
1915
1953
|
case 32:
|
|
1916
1954
|
case "end":
|
|
1917
|
-
return
|
|
1955
|
+
return _context52.stop();
|
|
1918
1956
|
}
|
|
1919
1957
|
}, _callee49);
|
|
1920
1958
|
})));
|
|
1921
1959
|
describe('Max / Min', function () {
|
|
1922
1960
|
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50() {
|
|
1923
|
-
var
|
|
1924
|
-
return _regeneratorRuntime.wrap(function _callee50$(
|
|
1925
|
-
while (1) switch (
|
|
1961
|
+
var _mount28, instance, element, now, content, dateDoms;
|
|
1962
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context53) {
|
|
1963
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
1926
1964
|
case 0:
|
|
1927
|
-
|
|
1965
|
+
_mount28 = mount(MaxMinDemo), instance = _mount28[0], element = _mount28[1];
|
|
1928
1966
|
now = dayjs().format('YYYY-MM-DD');
|
|
1929
1967
|
instance.set('to', now);
|
|
1930
1968
|
element.querySelector('.k-datepicker').click();
|
|
1931
|
-
|
|
1969
|
+
_context53.next = 6;
|
|
1932
1970
|
return wait();
|
|
1933
1971
|
case 6:
|
|
1934
1972
|
content = getElement('.k-datepicker-content');
|
|
@@ -1937,62 +1975,62 @@ describe('Datepicker', function () {
|
|
|
1937
1975
|
expect(+dateDoms[0].textContent).to.eql(+now.split('-')[2]);
|
|
1938
1976
|
case 10:
|
|
1939
1977
|
case "end":
|
|
1940
|
-
return
|
|
1978
|
+
return _context53.stop();
|
|
1941
1979
|
}
|
|
1942
1980
|
}, _callee50);
|
|
1943
1981
|
})));
|
|
1944
1982
|
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51() {
|
|
1945
|
-
var
|
|
1946
|
-
return _regeneratorRuntime.wrap(function _callee51$(
|
|
1947
|
-
while (1) switch (
|
|
1983
|
+
var _mount29, instance, element, now, content;
|
|
1984
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context54) {
|
|
1985
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
1948
1986
|
case 0:
|
|
1949
|
-
|
|
1987
|
+
_mount29 = mount(MaxMinDemo), instance = _mount29[0], element = _mount29[1];
|
|
1950
1988
|
now = dayjs().format('YYYY-MM-DD') + '00:00:00';
|
|
1951
1989
|
instance.set('toTime', now);
|
|
1952
1990
|
element.querySelectorAll('.k-datepicker')[2].click();
|
|
1953
|
-
|
|
1991
|
+
_context54.next = 6;
|
|
1954
1992
|
return wait();
|
|
1955
1993
|
case 6:
|
|
1956
1994
|
content = getElement('.k-datepicker-content');
|
|
1957
1995
|
content.querySelector('.k-today').click();
|
|
1958
|
-
|
|
1996
|
+
_context54.next = 10;
|
|
1959
1997
|
return wait();
|
|
1960
1998
|
case 10:
|
|
1961
1999
|
expect(content.querySelectorAll('.k-scroll-select-item:not(.k-disabled)')).have.lengthOf(3);
|
|
1962
2000
|
case 11:
|
|
1963
2001
|
case "end":
|
|
1964
|
-
return
|
|
2002
|
+
return _context54.stop();
|
|
1965
2003
|
}
|
|
1966
2004
|
}, _callee51);
|
|
1967
2005
|
})));
|
|
1968
2006
|
it('should auto place scrollSeelct to the time that equal to the minDate after selecting the date in datetime picker', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52() {
|
|
1969
|
-
var
|
|
1970
|
-
return _regeneratorRuntime.wrap(function _callee52$(
|
|
1971
|
-
while (1) switch (
|
|
2007
|
+
var _mount30, instance, element, date, time, fromTime, endTimeTrigger, content;
|
|
2008
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context55) {
|
|
2009
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
1972
2010
|
case 0:
|
|
1973
|
-
|
|
2011
|
+
_mount30 = mount(MaxMinDemo), instance = _mount30[0], element = _mount30[1];
|
|
1974
2012
|
date = dayjs().format('YYYY-MM-DD');
|
|
1975
2013
|
time = '01:00:00';
|
|
1976
2014
|
fromTime = date + " " + time;
|
|
1977
2015
|
instance.set('fromTime', fromTime);
|
|
1978
2016
|
endTimeTrigger = element.querySelectorAll('.k-datepicker')[3];
|
|
1979
2017
|
endTimeTrigger.click();
|
|
1980
|
-
|
|
2018
|
+
_context55.next = 9;
|
|
1981
2019
|
return wait();
|
|
1982
2020
|
case 9:
|
|
1983
2021
|
content = getElement('.k-datepicker-content');
|
|
1984
2022
|
content.querySelector('.k-today').click();
|
|
1985
|
-
|
|
2023
|
+
_context55.next = 13;
|
|
1986
2024
|
return wait();
|
|
1987
2025
|
case 13:
|
|
1988
2026
|
content.querySelector('.k-datepicker-footer .k-btn').click();
|
|
1989
|
-
|
|
2027
|
+
_context55.next = 16;
|
|
1990
2028
|
return wait();
|
|
1991
2029
|
case 16:
|
|
1992
2030
|
expect(instance.get('toTime')).to.eql(date + " " + time);
|
|
1993
2031
|
case 17:
|
|
1994
2032
|
case "end":
|
|
1995
|
-
return
|
|
2033
|
+
return _context55.stop();
|
|
1996
2034
|
}
|
|
1997
2035
|
}, _callee52);
|
|
1998
2036
|
})));
|
|
@@ -2000,40 +2038,40 @@ describe('Datepicker', function () {
|
|
|
2000
2038
|
describe('Input', function () {
|
|
2001
2039
|
var globalInput;
|
|
2002
2040
|
function test(template) {
|
|
2003
|
-
var Demo = /*#__PURE__*/function (
|
|
2004
|
-
_inheritsLoose(Demo,
|
|
2041
|
+
var Demo = /*#__PURE__*/function (_Component3) {
|
|
2042
|
+
_inheritsLoose(Demo, _Component3);
|
|
2005
2043
|
function Demo() {
|
|
2006
|
-
var
|
|
2007
|
-
var
|
|
2008
|
-
for (var
|
|
2009
|
-
args[
|
|
2044
|
+
var _context56;
|
|
2045
|
+
var _this3;
|
|
2046
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
2047
|
+
args[_key3] = arguments[_key3];
|
|
2010
2048
|
}
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
return
|
|
2049
|
+
_this3 = _Component3.call.apply(_Component3, _concatInstanceProperty(_context56 = [this]).call(_context56, args)) || this;
|
|
2050
|
+
_this3.Datepicker = Datepicker;
|
|
2051
|
+
return _this3;
|
|
2014
2052
|
}
|
|
2015
2053
|
return Demo;
|
|
2016
2054
|
}(Component);
|
|
2017
2055
|
Demo.template = "\n const {Datepicker} = this;\n " + template + "\n ";
|
|
2018
|
-
var
|
|
2019
|
-
instance =
|
|
2020
|
-
element =
|
|
2056
|
+
var _mount31 = mount(Demo),
|
|
2057
|
+
instance = _mount31[0],
|
|
2058
|
+
element = _mount31[1];
|
|
2021
2059
|
var input = element.querySelector('.k-input-inner');
|
|
2022
2060
|
globalInput = input;
|
|
2023
2061
|
return /*#__PURE__*/function () {
|
|
2024
2062
|
var _ref49 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(value, result) {
|
|
2025
|
-
return _regeneratorRuntime.wrap(function _callee53$(
|
|
2026
|
-
while (1) switch (
|
|
2063
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context57) {
|
|
2064
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
2027
2065
|
case 0:
|
|
2028
2066
|
input.value = value;
|
|
2029
2067
|
dispatchEvent(input, 'input');
|
|
2030
|
-
|
|
2068
|
+
_context57.next = 4;
|
|
2031
2069
|
return wait();
|
|
2032
2070
|
case 4:
|
|
2033
2071
|
expect(instance.get('value')).to.eql(result);
|
|
2034
2072
|
case 5:
|
|
2035
2073
|
case "end":
|
|
2036
|
-
return
|
|
2074
|
+
return _context57.stop();
|
|
2037
2075
|
}
|
|
2038
2076
|
}, _callee53);
|
|
2039
2077
|
}));
|
|
@@ -2044,131 +2082,131 @@ describe('Datepicker', function () {
|
|
|
2044
2082
|
}
|
|
2045
2083
|
it('basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54() {
|
|
2046
2084
|
var myTest;
|
|
2047
|
-
return _regeneratorRuntime.wrap(function _callee54$(
|
|
2048
|
-
while (1) switch (
|
|
2085
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context58) {
|
|
2086
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
2049
2087
|
case 0:
|
|
2050
2088
|
myTest = test("<Datepicker v-model=\"value\" max=\"2021-11-11\" min=\"2020-01-01\" />"); // input incorrect value
|
|
2051
|
-
|
|
2089
|
+
_context58.next = 3;
|
|
2052
2090
|
return myTest('2020', undefined);
|
|
2053
2091
|
case 3:
|
|
2054
|
-
|
|
2092
|
+
_context58.next = 5;
|
|
2055
2093
|
return myTest('2020-02-02', '2020-02-02');
|
|
2056
2094
|
case 5:
|
|
2057
|
-
|
|
2095
|
+
_context58.next = 7;
|
|
2058
2096
|
return myTest('', null);
|
|
2059
2097
|
case 7:
|
|
2060
|
-
|
|
2098
|
+
_context58.next = 9;
|
|
2061
2099
|
return myTest('1999-01-01', null);
|
|
2062
2100
|
case 9:
|
|
2063
2101
|
case "end":
|
|
2064
|
-
return
|
|
2102
|
+
return _context58.stop();
|
|
2065
2103
|
}
|
|
2066
2104
|
}, _callee54);
|
|
2067
2105
|
})));
|
|
2068
2106
|
it('multiple', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55() {
|
|
2069
2107
|
var myTest;
|
|
2070
|
-
return _regeneratorRuntime.wrap(function _callee55$(
|
|
2071
|
-
while (1) switch (
|
|
2108
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context59) {
|
|
2109
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
2072
2110
|
case 0:
|
|
2073
2111
|
myTest = test("<Datepicker v-model=\"value\" multiple />"); // input incorrect value
|
|
2074
|
-
|
|
2112
|
+
_context59.next = 3;
|
|
2075
2113
|
return myTest('2', undefined);
|
|
2076
2114
|
case 3:
|
|
2077
|
-
|
|
2115
|
+
_context59.next = 5;
|
|
2078
2116
|
return myTest('2020-02-02', ['2020-02-02']);
|
|
2079
2117
|
case 5:
|
|
2080
|
-
|
|
2118
|
+
_context59.next = 7;
|
|
2081
2119
|
return myTest('2', ['2020-02-02']);
|
|
2082
2120
|
case 7:
|
|
2083
|
-
|
|
2121
|
+
_context59.next = 9;
|
|
2084
2122
|
return myTest('2020-03-03', ['2020-02-02', '2020-03-03']);
|
|
2085
2123
|
case 9:
|
|
2086
2124
|
case "end":
|
|
2087
|
-
return
|
|
2125
|
+
return _context59.stop();
|
|
2088
2126
|
}
|
|
2089
2127
|
}, _callee55);
|
|
2090
2128
|
})));
|
|
2091
2129
|
it('range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56() {
|
|
2092
2130
|
var myTest;
|
|
2093
|
-
return _regeneratorRuntime.wrap(function _callee56$(
|
|
2094
|
-
while (1) switch (
|
|
2131
|
+
return _regeneratorRuntime.wrap(function _callee56$(_context60) {
|
|
2132
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
2095
2133
|
case 0:
|
|
2096
2134
|
myTest = test("<Datepicker v-model=\"value\" range max=\"2021-11-11\" min=\"2020-01-01\" />");
|
|
2097
|
-
|
|
2135
|
+
_context60.next = 3;
|
|
2098
2136
|
return myTest('2020-03-03', undefined);
|
|
2099
2137
|
case 3:
|
|
2100
|
-
|
|
2138
|
+
_context60.next = 5;
|
|
2101
2139
|
return myTest('2020-03-03~', undefined);
|
|
2102
2140
|
case 5:
|
|
2103
2141
|
// input correct value
|
|
2104
2142
|
dispatchEvent(globalInput, 'click'); // show calendar
|
|
2105
|
-
|
|
2143
|
+
_context60.next = 8;
|
|
2106
2144
|
return wait();
|
|
2107
2145
|
case 8:
|
|
2108
|
-
|
|
2146
|
+
_context60.next = 10;
|
|
2109
2147
|
return myTest('2020-03-03~2020-03-04', ['2020-03-03', '2020-03-04']);
|
|
2110
2148
|
case 10:
|
|
2111
2149
|
expect(getElement('.k-datepicker-content').querySelector('.k-datepicker-calendar-time-wrapper:nth-child(1)').innerHTML).to.matchSnapshot();
|
|
2112
2150
|
// clear value
|
|
2113
|
-
|
|
2151
|
+
_context60.next = 13;
|
|
2114
2152
|
return myTest('', null);
|
|
2115
2153
|
case 13:
|
|
2116
|
-
|
|
2154
|
+
_context60.next = 15;
|
|
2117
2155
|
return myTest('1999-01-01~2020-03-04', null);
|
|
2118
2156
|
case 15:
|
|
2119
2157
|
case "end":
|
|
2120
|
-
return
|
|
2158
|
+
return _context60.stop();
|
|
2121
2159
|
}
|
|
2122
2160
|
}, _callee56);
|
|
2123
2161
|
})));
|
|
2124
2162
|
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57() {
|
|
2125
2163
|
var myTest;
|
|
2126
|
-
return _regeneratorRuntime.wrap(function _callee57$(
|
|
2127
|
-
while (1) switch (
|
|
2164
|
+
return _regeneratorRuntime.wrap(function _callee57$(_context61) {
|
|
2165
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
2128
2166
|
case 0:
|
|
2129
2167
|
myTest = test("<Datepicker v-model=\"value\" type=\"datetime\" />");
|
|
2130
|
-
|
|
2168
|
+
_context61.next = 3;
|
|
2131
2169
|
return myTest('2020-03-03', undefined);
|
|
2132
2170
|
case 3:
|
|
2133
|
-
|
|
2171
|
+
_context61.next = 5;
|
|
2134
2172
|
return myTest('2020-03-03 02:02:02', '2020-03-03 02:02:02');
|
|
2135
2173
|
case 5:
|
|
2136
2174
|
case "end":
|
|
2137
|
-
return
|
|
2175
|
+
return _context61.stop();
|
|
2138
2176
|
}
|
|
2139
2177
|
}, _callee57);
|
|
2140
2178
|
})));
|
|
2141
2179
|
it('datetime range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58() {
|
|
2142
2180
|
var myTest;
|
|
2143
|
-
return _regeneratorRuntime.wrap(function _callee58$(
|
|
2144
|
-
while (1) switch (
|
|
2181
|
+
return _regeneratorRuntime.wrap(function _callee58$(_context62) {
|
|
2182
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
2145
2183
|
case 0:
|
|
2146
2184
|
myTest = test('<Datepicker v-model="value" type="datetime" range />');
|
|
2147
|
-
|
|
2185
|
+
_context62.next = 3;
|
|
2148
2186
|
return myTest('2020-08-11 00:00:00 ~ 2020-08-11 01:00:00', ['2020-08-11 00:00:00', '2020-08-11 01:00:00']);
|
|
2149
2187
|
case 3:
|
|
2150
|
-
|
|
2188
|
+
_context62.next = 5;
|
|
2151
2189
|
return myTest('2020-08-11 00:01:00 ~ 2020-08-11 01:00:00', ['2020-08-11 00:01:00', '2020-08-11 01:00:00']);
|
|
2152
2190
|
case 5:
|
|
2153
|
-
|
|
2191
|
+
_context62.next = 7;
|
|
2154
2192
|
return myTest('2020-08-11 00:01:00 ~ 2020-08-11 01:01:00', ['2020-08-11 00:01:00', '2020-08-11 01:01:00']);
|
|
2155
2193
|
case 7:
|
|
2156
2194
|
case "end":
|
|
2157
|
-
return
|
|
2195
|
+
return _context62.stop();
|
|
2158
2196
|
}
|
|
2159
2197
|
}, _callee58);
|
|
2160
2198
|
})));
|
|
2161
2199
|
it('date format', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59() {
|
|
2162
2200
|
var myTest;
|
|
2163
|
-
return _regeneratorRuntime.wrap(function _callee59$(
|
|
2164
|
-
while (1) switch (
|
|
2201
|
+
return _regeneratorRuntime.wrap(function _callee59$(_context63) {
|
|
2202
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
2165
2203
|
case 0:
|
|
2166
2204
|
myTest = test("<Datepicker v-model=\"value\" showFormat=\"YYYY\u5E74M\u6708D\u65E5\" />");
|
|
2167
|
-
|
|
2205
|
+
_context63.next = 3;
|
|
2168
2206
|
return myTest('2020年2月19日', '2020-02-19');
|
|
2169
2207
|
case 3:
|
|
2170
2208
|
case "end":
|
|
2171
|
-
return
|
|
2209
|
+
return _context63.stop();
|
|
2172
2210
|
}
|
|
2173
2211
|
}, _callee59);
|
|
2174
2212
|
})));
|