@king-design/intact 3.5.2 → 3.6.0-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/components/button/index.md +1 -0
- package/components/datepicker/basepicker.ts +60 -13
- package/components/datepicker/calendar.ts +5 -1
- package/components/datepicker/calendar.vdt +20 -6
- package/components/datepicker/dayjs.ts +22 -2
- package/components/datepicker/demos/multiple.md +0 -5
- package/components/datepicker/demos/nowrap.md +35 -0
- package/components/datepicker/demos/yearMonth.md +8 -2
- package/components/datepicker/helpers.ts +5 -5
- package/components/datepicker/index.md +3 -2
- package/components/datepicker/index.spec.ts +107 -90
- package/components/datepicker/index.ts +23 -5
- package/components/datepicker/index.vdt +34 -35
- package/components/datepicker/styles.ts +102 -3
- package/components/datepicker/useDisabled.ts +3 -3
- package/components/datepicker/useFormats.ts +2 -0
- package/components/datepicker/useMergeRange.ts +54 -0
- package/components/datepicker/usePosition.ts +169 -0
- package/components/datepicker/useQuarters.ts +47 -0
- package/components/datepicker/useShowDate.ts +42 -11
- package/components/datepicker/useValue.ts +35 -4
- package/components/datepicker/useWeeks.ts +58 -0
- package/components/dialog/useFixBody.ts +7 -64
- package/components/ellipsis/styles.ts +4 -0
- package/components/form/styles.ts +1 -0
- package/components/scrollSelect/index.spec.ts +3 -3
- package/components/scrollSelect/useMouseEvents.ts +23 -10
- package/components/select/base.vdt +2 -1
- package/components/select/demos/creatable.md +13 -0
- package/components/select/index.md +1 -0
- package/components/select/index.spec.ts +146 -0
- package/components/select/option.ts +9 -1
- package/components/select/select.ts +2 -0
- package/components/select/useFilterable.ts +1 -1
- package/components/select/useInput.ts +4 -2
- package/components/select/useSearchable.ts +2 -2
- package/components/timepicker/demos/step.md +1 -1
- package/components/timepicker/panelPicker.vdt +5 -1
- package/components/timepicker/styles.ts +0 -1
- package/components/tour/demos/basic.md +73 -0
- package/components/tour/demos/beforeChange.md +109 -0
- package/components/tour/demos/closable.md +70 -0
- package/components/tour/demos/custom.md +98 -0
- package/components/tour/demos/customText.md +94 -0
- package/components/tour/demos/declarative.md +72 -0
- package/components/tour/demos/events.md +101 -0
- package/components/tour/demos/maskClosable.md +76 -0
- package/components/tour/demos/notarget.md +59 -0
- package/components/tour/index.md +48 -0
- package/components/tour/index.spec.ts +259 -0
- package/components/tour/index.ts +2 -0
- package/components/tour/step.ts +55 -0
- package/components/tour/step.vdt +75 -0
- package/components/tour/styles.ts +283 -0
- package/components/tour/tour.ts +107 -0
- package/components/tour/tour.vdt +83 -0
- package/components/tour/useArrow.ts +46 -0
- package/components/tour/useFixBody.ts +22 -0
- package/components/tour/useHighlight.ts +36 -0
- package/components/tour/useMaskClosable.ts +26 -0
- package/components/tour/useNavigation.ts +46 -0
- package/components/tour/usePosition.ts +91 -0
- package/components/tour/useSteps.ts +80 -0
- package/es/components/datepicker/basepicker.d.ts +4 -2
- package/es/components/datepicker/basepicker.js +46 -13
- package/es/components/datepicker/calendar.d.ts +34 -6
- package/es/components/datepicker/calendar.js +4 -0
- package/es/components/datepicker/calendar.vdt.js +21 -5
- package/es/components/datepicker/dayjs.d.ts +13 -2
- package/es/components/datepicker/dayjs.js +6 -0
- package/es/components/datepicker/helpers.d.ts +5 -5
- package/es/components/datepicker/index.d.ts +17 -2
- package/es/components/datepicker/index.js +23 -5
- package/es/components/datepicker/index.spec.js +356 -355
- package/es/components/datepicker/index.vdt.js +25 -29
- package/es/components/datepicker/styles.d.ts +17 -0
- package/es/components/datepicker/styles.js +29 -2
- package/es/components/datepicker/useDisabled.d.ts +2 -2
- package/es/components/datepicker/useDisabled.js +1 -1
- package/es/components/datepicker/useFormats.js +3 -1
- package/es/components/datepicker/useMergeRange.d.ts +5 -0
- package/es/components/datepicker/useMergeRange.js +50 -0
- package/es/components/datepicker/usePosition.d.ts +10 -0
- package/es/components/datepicker/usePosition.js +166 -0
- package/es/components/datepicker/useQuarters.d.ts +15 -0
- package/es/components/datepicker/useQuarters.js +36 -0
- package/es/components/datepicker/useShowDate.d.ts +1 -1
- package/es/components/datepicker/useShowDate.js +42 -9
- package/es/components/datepicker/useStatus.d.ts +1 -1
- package/es/components/datepicker/useValue.d.ts +1 -0
- package/es/components/datepicker/useValue.js +26 -2
- package/es/components/datepicker/useWeeks.d.ts +19 -0
- package/es/components/datepicker/useWeeks.js +48 -0
- package/es/components/dialog/useFixBody.js +6 -58
- package/es/components/ellipsis/styles.js +1 -1
- package/es/components/form/styles.js +1 -1
- package/es/components/scrollSelect/index.spec.js +4 -6
- package/es/components/scrollSelect/useMouseEvents.js +21 -9
- package/es/components/select/base.vdt.js +4 -2
- package/es/components/select/index.spec.js +235 -62
- package/es/components/select/option.d.ts +1 -0
- package/es/components/select/option.js +9 -2
- package/es/components/select/select.d.ts +1 -0
- package/es/components/select/select.js +2 -1
- package/es/components/select/useFilterable.js +2 -1
- package/es/components/select/useInput.js +5 -2
- package/es/components/select/useSearchable.js +1 -0
- package/es/components/timepicker/panelPicker.d.ts +2 -1
- package/es/components/timepicker/panelPicker.vdt.js +12 -4
- package/es/components/timepicker/selectPicker.d.ts +1 -1
- package/es/components/timepicker/styles.js +1 -1
- package/es/components/timepicker/useDisabled.d.ts +1 -1
- package/es/components/timepicker/useValue.d.ts +1 -0
- package/es/components/tour/index.d.ts +2 -0
- package/es/components/tour/index.js +2 -0
- package/es/components/tour/index.spec.d.ts +1 -0
- package/es/components/tour/index.spec.js +356 -0
- package/es/components/tour/step.d.ts +23 -0
- package/es/components/tour/step.js +46 -0
- package/es/components/tour/step.vdt.js +74 -0
- package/es/components/tour/styles.d.ts +7 -0
- package/es/components/tour/styles.js +84 -0
- package/es/components/tour/tour.d.ts +73 -0
- package/es/components/tour/tour.js +70 -0
- package/es/components/tour/tour.vdt.js +66 -0
- package/es/components/tour/useArrow.d.ts +4 -0
- package/es/components/tour/useArrow.js +40 -0
- package/es/components/tour/useFixBody.d.ts +4 -0
- package/es/components/tour/useFixBody.js +17 -0
- package/es/components/tour/useHighlight.d.ts +4 -0
- package/es/components/tour/useHighlight.js +31 -0
- package/es/components/tour/useMaskClosable.d.ts +1 -0
- package/es/components/tour/useMaskClosable.js +25 -0
- package/es/components/tour/useNavigation.d.ts +5 -0
- package/es/components/tour/useNavigation.js +103 -0
- package/es/components/tour/usePosition.d.ts +6 -0
- package/es/components/tour/usePosition.js +93 -0
- package/es/components/tour/useSteps.d.ts +6 -0
- package/es/components/tour/useSteps.js +68 -0
- package/es/hooks/useFixBody.d.ts +11 -0
- package/es/hooks/useFixBody.js +72 -0
- package/es/index.d.ts +3 -2
- package/es/index.js +3 -2
- package/es/site/data/components/datepicker/demos/multiple/index.d.ts +0 -1
- package/es/site/data/components/datepicker/demos/multiple/index.js +1 -2
- package/es/site/data/components/datepicker/demos/multiple/react.d.ts +0 -1
- package/es/site/data/components/datepicker/demos/multiple/react.js +2 -13
- package/es/site/data/components/datepicker/demos/nowrap/index.d.ts +10 -0
- package/es/site/data/components/datepicker/demos/nowrap/index.js +19 -0
- package/es/site/data/components/datepicker/demos/nowrap/react.d.ts +10 -0
- package/es/site/data/components/datepicker/demos/nowrap/react.js +49 -0
- package/es/site/data/components/datepicker/demos/yearMonth/index.d.ts +2 -0
- package/es/site/data/components/datepicker/demos/yearMonth/index.js +3 -1
- package/es/site/data/components/datepicker/demos/yearMonth/react.d.ts +2 -0
- package/es/site/data/components/datepicker/demos/yearMonth/react.js +21 -1
- package/es/site/data/components/select/demos/creatable/index.d.ts +1 -0
- package/es/site/data/components/select/demos/creatable/index.js +2 -1
- package/es/site/data/components/select/demos/creatable/react.d.ts +1 -0
- package/es/site/data/components/select/demos/creatable/react.js +31 -2
- package/es/site/data/components/select/demos/searchable/index.js +1 -1
- package/es/site/data/components/select/demos/searchable/react.js +1 -1
- package/es/site/data/components/tour/demos/basic/index.d.ts +17 -0
- package/es/site/data/components/tour/demos/basic/index.js +46 -0
- package/es/site/data/components/tour/demos/basic/react.d.ts +16 -0
- package/es/site/data/components/tour/demos/basic/react.js +82 -0
- package/es/site/data/components/tour/demos/beforeChange/index.d.ts +20 -0
- package/es/site/data/components/tour/demos/beforeChange/index.js +69 -0
- package/es/site/data/components/tour/demos/beforeChange/react.d.ts +19 -0
- package/es/site/data/components/tour/demos/beforeChange/react.js +129 -0
- package/es/site/data/components/tour/demos/closable/index.d.ts +18 -0
- package/es/site/data/components/tour/demos/closable/index.js +42 -0
- package/es/site/data/components/tour/demos/closable/react.d.ts +17 -0
- package/es/site/data/components/tour/demos/closable/react.js +85 -0
- package/es/site/data/components/tour/demos/custom/index.d.ts +11 -0
- package/es/site/data/components/tour/demos/custom/index.js +35 -0
- package/es/site/data/components/tour/demos/custom/react.d.ts +11 -0
- package/es/site/data/components/tour/demos/custom/react.js +108 -0
- package/es/site/data/components/tour/demos/customButtons/index.d.ts +33 -0
- package/es/site/data/components/tour/demos/customButtons/index.js +55 -0
- package/es/site/data/components/tour/demos/customButtons/react.d.ts +33 -0
- package/es/site/data/components/tour/demos/customButtons/react.js +99 -0
- package/es/site/data/components/tour/demos/customText/index.d.ts +20 -0
- package/es/site/data/components/tour/demos/customText/index.js +54 -0
- package/es/site/data/components/tour/demos/customText/react.d.ts +19 -0
- package/es/site/data/components/tour/demos/customText/react.js +95 -0
- package/es/site/data/components/tour/demos/declarative/index.d.ts +11 -0
- package/es/site/data/components/tour/demos/declarative/index.js +36 -0
- package/es/site/data/components/tour/demos/declarative/react.d.ts +10 -0
- package/es/site/data/components/tour/demos/declarative/react.js +80 -0
- package/es/site/data/components/tour/demos/events/index.d.ts +18 -0
- package/es/site/data/components/tour/demos/events/index.js +58 -0
- package/es/site/data/components/tour/demos/events/react.d.ts +18 -0
- package/es/site/data/components/tour/demos/events/react.js +101 -0
- package/es/site/data/components/tour/demos/maskClosable/index.d.ts +18 -0
- package/es/site/data/components/tour/demos/maskClosable/index.js +47 -0
- package/es/site/data/components/tour/demos/maskClosable/react.d.ts +17 -0
- package/es/site/data/components/tour/demos/maskClosable/react.js +95 -0
- package/es/site/data/components/tour/demos/notarget/index.d.ts +11 -0
- package/es/site/data/components/tour/demos/notarget/index.js +35 -0
- package/es/site/data/components/tour/demos/notarget/react.d.ts +10 -0
- package/es/site/data/components/tour/demos/notarget/react.js +61 -0
- package/es/site/data/components/tour/index.d.ts +57 -0
- package/es/site/data/components/tour/index.js +32 -0
- package/hooks/useFixBody.ts +87 -0
- package/index.ts +3 -2
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
3
3
|
import _Array$from2 from "@babel/runtime-corejs3/core-js/array/from";
|
|
4
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
5
4
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
6
5
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
7
6
|
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
@@ -126,20 +125,65 @@ describe('Datepicker', function () {
|
|
|
126
125
|
}
|
|
127
126
|
}, _callee5);
|
|
128
127
|
})));
|
|
128
|
+
it('week', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
129
|
+
var _mount5, instance, element, inputs, WeekInput, content, weekItem;
|
|
130
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
131
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
132
|
+
case 0:
|
|
133
|
+
_mount5 = mount(YearMonthDemo), instance = _mount5[0], element = _mount5[1];
|
|
134
|
+
inputs = element.querySelectorAll('.k-input');
|
|
135
|
+
WeekInput = inputs[2];
|
|
136
|
+
WeekInput.click();
|
|
137
|
+
_context6.next = 6;
|
|
138
|
+
return wait();
|
|
139
|
+
case 6:
|
|
140
|
+
content = getElement('.k-datepicker-content');
|
|
141
|
+
weekItem = content.querySelector('.week-row:nth-child(1) .k-week-number');
|
|
142
|
+
weekItem.click();
|
|
143
|
+
expect(instance.get('week')).to.match(/^\d{4}-\d+周$/);
|
|
144
|
+
case 10:
|
|
145
|
+
case "end":
|
|
146
|
+
return _context6.stop();
|
|
147
|
+
}
|
|
148
|
+
}, _callee6);
|
|
149
|
+
})));
|
|
150
|
+
it('quarter', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
151
|
+
var _mount6, instance, element, inputs, QuarterInput, content, quarterItem;
|
|
152
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
153
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
154
|
+
case 0:
|
|
155
|
+
_mount6 = mount(YearMonthDemo), instance = _mount6[0], element = _mount6[1];
|
|
156
|
+
inputs = element.querySelectorAll('.k-input');
|
|
157
|
+
QuarterInput = inputs[3];
|
|
158
|
+
QuarterInput.click();
|
|
159
|
+
_context7.next = 6;
|
|
160
|
+
return wait();
|
|
161
|
+
case 6:
|
|
162
|
+
content = getElement('.k-datepicker-content'); // 选择第一个季度
|
|
163
|
+
quarterItem = content.querySelector('.k-calendar-item:nth-child(1)');
|
|
164
|
+
quarterItem.click();
|
|
165
|
+
// 验证输入框的值是否包含Q1
|
|
166
|
+
expect(instance.get('quarter')).to.include('Q1');
|
|
167
|
+
case 10:
|
|
168
|
+
case "end":
|
|
169
|
+
return _context7.stop();
|
|
170
|
+
}
|
|
171
|
+
}, _callee7);
|
|
172
|
+
})));
|
|
129
173
|
});
|
|
130
|
-
describe('Panel', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
131
|
-
return _regeneratorRuntime.wrap(function
|
|
132
|
-
while (1) switch (
|
|
174
|
+
describe('Panel', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
175
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
176
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
133
177
|
case 0:
|
|
134
|
-
it('single date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
135
|
-
var
|
|
136
|
-
return _regeneratorRuntime.wrap(function
|
|
137
|
-
while (1) switch (
|
|
178
|
+
it('single date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
179
|
+
var _mount7, instance, element, input, content, _Array$from, prevYear, prevMonth, _Array$from3, nextMonth, nextYear, curDate, _Array$from4, yearDom, monthDom, curDate1, curMonth;
|
|
180
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
181
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
138
182
|
case 0:
|
|
139
|
-
|
|
183
|
+
_mount7 = mount(BasicDemo), instance = _mount7[0], element = _mount7[1];
|
|
140
184
|
input = element.querySelector('.k-input');
|
|
141
185
|
input.click();
|
|
142
|
-
|
|
186
|
+
_context8.next = 5;
|
|
143
187
|
return wait();
|
|
144
188
|
case 5:
|
|
145
189
|
content = getElement('.k-datepicker-content');
|
|
@@ -154,7 +198,7 @@ describe('Datepicker', function () {
|
|
|
154
198
|
dispatchEvent(nextMonth, 'click');
|
|
155
199
|
// click next year once
|
|
156
200
|
dispatchEvent(nextYear, 'click');
|
|
157
|
-
|
|
201
|
+
_context8.next = 16;
|
|
158
202
|
return wait();
|
|
159
203
|
case 16:
|
|
160
204
|
// select the middle date
|
|
@@ -166,21 +210,21 @@ describe('Datepicker', function () {
|
|
|
166
210
|
expect(curDate.getMonth()).be.eql(month);
|
|
167
211
|
// change year and month in year/month panel
|
|
168
212
|
input.click();
|
|
169
|
-
|
|
213
|
+
_context8.next = 25;
|
|
170
214
|
return wait();
|
|
171
215
|
case 25:
|
|
172
216
|
content = getElement('.k-datepicker-content');
|
|
173
217
|
_Array$from4 = _Array$from2(content.querySelectorAll('.k-month-value')), yearDom = _Array$from4[0], monthDom = _Array$from4[1];
|
|
174
218
|
yearDom.click();
|
|
175
|
-
|
|
219
|
+
_context8.next = 30;
|
|
176
220
|
return wait();
|
|
177
221
|
case 30:
|
|
178
222
|
content.querySelector('.k-today').click();
|
|
179
|
-
|
|
223
|
+
_context8.next = 33;
|
|
180
224
|
return wait();
|
|
181
225
|
case 33:
|
|
182
226
|
content.querySelector('.k-today').click();
|
|
183
|
-
|
|
227
|
+
_context8.next = 36;
|
|
184
228
|
return wait();
|
|
185
229
|
case 36:
|
|
186
230
|
// select the middle date
|
|
@@ -191,23 +235,23 @@ describe('Datepicker', function () {
|
|
|
191
235
|
expect(curDate1.getFullYear()).be.eql(year);
|
|
192
236
|
case 41:
|
|
193
237
|
case "end":
|
|
194
|
-
return
|
|
238
|
+
return _context8.stop();
|
|
195
239
|
}
|
|
196
|
-
},
|
|
240
|
+
}, _callee8);
|
|
197
241
|
})));
|
|
198
|
-
it('range date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
199
|
-
var
|
|
200
|
-
return _regeneratorRuntime.wrap(function
|
|
201
|
-
while (1) switch (
|
|
242
|
+
it('range date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
243
|
+
var _mount8, 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;
|
|
244
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
245
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
202
246
|
case 0:
|
|
203
|
-
|
|
247
|
+
_mount8 = mount(RangeDemo), instance = _mount8[0], element = _mount8[1];
|
|
204
248
|
select = element.querySelector('.k-datepicker');
|
|
205
249
|
select.click();
|
|
206
|
-
|
|
250
|
+
_context9.next = 5;
|
|
207
251
|
return wait();
|
|
208
252
|
case 5:
|
|
209
253
|
content = getElement('.k-datepicker-content');
|
|
210
|
-
_content$querySelecto = content.querySelectorAll('.k-datepicker-calendar-wrapper'), panel1 = _content$querySelecto[0], panel2 = _content$querySelecto[1];
|
|
254
|
+
_content$querySelecto = content.querySelectorAll('.k-datepicker-calendar-time-wrapper'), panel1 = _content$querySelecto[0], panel2 = _content$querySelecto[1];
|
|
211
255
|
_panel1$querySelector = panel1.querySelectorAll('.k-next'), nextMonth = _panel1$querySelector[0], nextYear = _panel1$querySelector[1];
|
|
212
256
|
_content$querySelecto2 = content.querySelectorAll('.k-month-values'), monthValues1 = _content$querySelecto2[0], monthValues2 = _content$querySelecto2[1];
|
|
213
257
|
nextMonth.click();
|
|
@@ -215,20 +259,20 @@ describe('Datepicker', function () {
|
|
|
215
259
|
yearStart = year + Math.floor((month + 1) / 12);
|
|
216
260
|
monthEnd = (month + 2) % 12 + 1;
|
|
217
261
|
yearEnd = year + Math.floor((month + 2) / 12);
|
|
218
|
-
|
|
262
|
+
_context9.next = 16;
|
|
219
263
|
return wait();
|
|
220
264
|
case 16:
|
|
221
265
|
expect(monthValues1.textContent).to.eql(yearStart + "\u5E74" + monthStart + "\u6708");
|
|
222
266
|
expect(monthValues2.textContent).to.eql(yearEnd + "\u5E74" + monthEnd + "\u6708");
|
|
223
267
|
nextYear.click();
|
|
224
|
-
|
|
268
|
+
_context9.next = 21;
|
|
225
269
|
return wait();
|
|
226
270
|
case 21:
|
|
227
271
|
expect(monthValues1.textContent).to.eql(yearStart + 1 + "\u5E74" + monthStart + "\u6708");
|
|
228
272
|
expect(monthValues2.textContent).to.eql(yearEnd + 1 + "\u5E74" + monthEnd + "\u6708");
|
|
229
273
|
_panel2$querySelector = panel2.querySelectorAll('.k-prev'), prevYear = _panel2$querySelector[0];
|
|
230
274
|
prevYear.click();
|
|
231
|
-
|
|
275
|
+
_context9.next = 27;
|
|
232
276
|
return wait();
|
|
233
277
|
case 27:
|
|
234
278
|
expect(monthValues1.textContent).to.eql(yearStart + "\u5E74" + monthStart + "\u6708");
|
|
@@ -236,7 +280,7 @@ describe('Datepicker', function () {
|
|
|
236
280
|
// year panel
|
|
237
281
|
dispatchEvent(monthValues1.firstElementChild, 'click');
|
|
238
282
|
dispatchEvent(monthValues2.firstElementChild, 'click');
|
|
239
|
-
|
|
283
|
+
_context9.next = 33;
|
|
240
284
|
return wait();
|
|
241
285
|
case 33:
|
|
242
286
|
firstDecadeStart = Math.floor(yearStart / 10) * 10;
|
|
@@ -244,133 +288,133 @@ describe('Datepicker', function () {
|
|
|
244
288
|
expect(monthValues1.textContent).to.eql(firstDecadeStart + "\u5E74 - " + (firstDecadeStart + 9) + "\u5E74");
|
|
245
289
|
expect(monthValues1.textContent).to.eql(secondDecadeStart + "\u5E74 - " + (secondDecadeStart + 9) + "\u5E74");
|
|
246
290
|
nextYear.click();
|
|
247
|
-
|
|
291
|
+
_context9.next = 40;
|
|
248
292
|
return wait();
|
|
249
293
|
case 40:
|
|
250
294
|
expect(monthValues1.textContent).to.eql(firstDecadeStart + 10 + "\u5E74 - " + (secondDecadeStart + 19) + "\u5E74");
|
|
251
295
|
expect(monthValues1.textContent).to.eql(secondDecadeStart + 10 + "\u5E74 - " + (secondDecadeStart + 19) + "\u5E74");
|
|
252
296
|
case 42:
|
|
253
297
|
case "end":
|
|
254
|
-
return
|
|
298
|
+
return _context9.stop();
|
|
255
299
|
}
|
|
256
|
-
},
|
|
300
|
+
}, _callee9);
|
|
257
301
|
})));
|
|
258
|
-
it('range year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
259
|
-
var
|
|
260
|
-
return _regeneratorRuntime.wrap(function
|
|
261
|
-
while (1) switch (
|
|
302
|
+
it('range year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
303
|
+
var _mount9, instance, element, _element$querySelecto3, select, content, _content$querySelecto3, panel1, panel2, _panel1$querySelector2, next, _panel2$querySelector2, prev, _content$querySelecto4, label1, label2;
|
|
304
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
305
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
262
306
|
case 0:
|
|
263
|
-
|
|
307
|
+
_mount9 = mount(RangeDemo), instance = _mount9[0], element = _mount9[1];
|
|
264
308
|
_element$querySelecto3 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto3[2];
|
|
265
309
|
select.click();
|
|
266
|
-
|
|
310
|
+
_context10.next = 5;
|
|
267
311
|
return wait();
|
|
268
312
|
case 5:
|
|
269
313
|
content = getElement('.k-datepicker-content');
|
|
270
|
-
_content$querySelecto3 = content.querySelectorAll('.k-datepicker-calendar-wrapper'), panel1 = _content$querySelecto3[0], panel2 = _content$querySelecto3[1];
|
|
314
|
+
_content$querySelecto3 = content.querySelectorAll('.k-datepicker-calendar-time-wrapper'), panel1 = _content$querySelecto3[0], panel2 = _content$querySelecto3[1];
|
|
271
315
|
_panel1$querySelector2 = panel1.querySelectorAll('.k-next'), next = _panel1$querySelector2[0];
|
|
272
316
|
_panel2$querySelector2 = panel2.querySelectorAll('.k-prev'), prev = _panel2$querySelector2[0];
|
|
273
317
|
_content$querySelecto4 = content.querySelectorAll('.k-month-values'), label1 = _content$querySelecto4[0], label2 = _content$querySelecto4[1];
|
|
274
318
|
expect(label1.textContent).to.eql(startYear + "\u5E74 - " + (startYear + 9) + "\u5E74");
|
|
275
319
|
expect(label2.textContent).to.eql(startYear + 10 + "\u5E74 - " + (startYear + 19) + "\u5E74");
|
|
276
320
|
next.click();
|
|
277
|
-
|
|
321
|
+
_context10.next = 15;
|
|
278
322
|
return wait();
|
|
279
323
|
case 15:
|
|
280
324
|
expect(label1.textContent).to.eql(startYear + 10 + "\u5E74 - " + (startYear + 19) + "\u5E74");
|
|
281
325
|
expect(label2.textContent).to.eql(startYear + 20 + "\u5E74 - " + (startYear + 29) + "\u5E74");
|
|
282
326
|
prev.click();
|
|
283
|
-
|
|
327
|
+
_context10.next = 20;
|
|
284
328
|
return wait();
|
|
285
329
|
case 20:
|
|
286
330
|
expect(label1.textContent).to.eql(startYear + "\u5E74 - " + (startYear + 9) + "\u5E74");
|
|
287
331
|
expect(label2.textContent).to.eql(startYear + 10 + "\u5E74 - " + (startYear + 19) + "\u5E74");
|
|
288
332
|
case 22:
|
|
289
333
|
case "end":
|
|
290
|
-
return
|
|
334
|
+
return _context10.stop();
|
|
291
335
|
}
|
|
292
|
-
},
|
|
336
|
+
}, _callee10);
|
|
293
337
|
})));
|
|
294
|
-
it('range month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
295
|
-
var
|
|
296
|
-
return _regeneratorRuntime.wrap(function
|
|
297
|
-
while (1) switch (
|
|
338
|
+
it('range month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
339
|
+
var _mount10, instance, element, _element$querySelecto4, select, content, _content$querySelecto5, panel1, panel2, _panel1$querySelector3, next, _panel2$querySelector3, prev, _content$querySelecto6, label1, label2;
|
|
340
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
341
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
298
342
|
case 0:
|
|
299
|
-
|
|
343
|
+
_mount10 = mount(RangeDemo), instance = _mount10[0], element = _mount10[1];
|
|
300
344
|
_element$querySelecto4 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto4[3];
|
|
301
345
|
select.click();
|
|
302
|
-
|
|
346
|
+
_context11.next = 5;
|
|
303
347
|
return wait();
|
|
304
348
|
case 5:
|
|
305
349
|
content = getElement('.k-datepicker-content');
|
|
306
|
-
_content$querySelecto5 = content.querySelectorAll('.k-datepicker-calendar-wrapper'), panel1 = _content$querySelecto5[0], panel2 = _content$querySelecto5[1];
|
|
350
|
+
_content$querySelecto5 = content.querySelectorAll('.k-datepicker-calendar-time-wrapper'), panel1 = _content$querySelecto5[0], panel2 = _content$querySelecto5[1];
|
|
307
351
|
_panel1$querySelector3 = panel1.querySelectorAll('.k-next'), next = _panel1$querySelector3[0];
|
|
308
352
|
_panel2$querySelector3 = panel2.querySelectorAll('.k-prev'), prev = _panel2$querySelector3[0];
|
|
309
353
|
_content$querySelecto6 = content.querySelectorAll('.k-month-values'), label1 = _content$querySelecto6[0], label2 = _content$querySelecto6[1];
|
|
310
354
|
expect(label1.textContent).to.eql(year + "\u5E74" + (month + 1) + "\u6708");
|
|
311
355
|
expect(label2.textContent).to.eql(year + 1 + "\u5E74" + (month + 1) + "\u6708");
|
|
312
356
|
next.click();
|
|
313
|
-
|
|
357
|
+
_context11.next = 15;
|
|
314
358
|
return wait();
|
|
315
359
|
case 15:
|
|
316
360
|
expect(label1.textContent).to.eql(year + 1 + "\u5E74" + (month + 1) + "\u6708");
|
|
317
361
|
expect(label2.textContent).to.eql(year + 2 + "\u5E74" + (month + 1) + "\u6708");
|
|
318
362
|
prev.click();
|
|
319
|
-
|
|
363
|
+
_context11.next = 20;
|
|
320
364
|
return wait();
|
|
321
365
|
case 20:
|
|
322
366
|
expect(label1.textContent).to.eql(year + "\u5E74" + (month + 1) + "\u6708");
|
|
323
367
|
expect(label2.textContent).to.eql(year + 1 + "\u5E74" + (month + 1) + "\u6708");
|
|
324
368
|
case 22:
|
|
325
369
|
case "end":
|
|
326
|
-
return
|
|
370
|
+
return _context11.stop();
|
|
327
371
|
}
|
|
328
|
-
},
|
|
372
|
+
}, _callee11);
|
|
329
373
|
})));
|
|
330
374
|
case 4:
|
|
331
375
|
case "end":
|
|
332
|
-
return
|
|
376
|
+
return _context12.stop();
|
|
333
377
|
}
|
|
334
|
-
},
|
|
378
|
+
}, _callee12);
|
|
335
379
|
})));
|
|
336
380
|
describe('Clear', function () {
|
|
337
|
-
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
338
|
-
var
|
|
339
|
-
return _regeneratorRuntime.wrap(function
|
|
340
|
-
while (1) switch (
|
|
381
|
+
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
382
|
+
var _mount11, instance, element;
|
|
383
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
384
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
341
385
|
case 0:
|
|
342
|
-
|
|
386
|
+
_mount11 = mount(ClearableDemo), instance = _mount11[0], element = _mount11[1];
|
|
343
387
|
instance.set('date', '2018-03-04');
|
|
344
|
-
|
|
388
|
+
_context13.next = 4;
|
|
345
389
|
return wait();
|
|
346
390
|
case 4:
|
|
347
391
|
dispatchEvent(element.querySelector('.k-select-clear'), 'click');
|
|
348
392
|
expect(instance.get('date')).be.eql(null);
|
|
349
393
|
case 6:
|
|
350
394
|
case "end":
|
|
351
|
-
return
|
|
395
|
+
return _context13.stop();
|
|
352
396
|
}
|
|
353
|
-
},
|
|
397
|
+
}, _callee13);
|
|
354
398
|
})));
|
|
355
|
-
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
356
|
-
var
|
|
357
|
-
return _regeneratorRuntime.wrap(function
|
|
358
|
-
while (1) switch (
|
|
399
|
+
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
400
|
+
var _mount12, instance, element, input, content;
|
|
401
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
402
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
359
403
|
case 0:
|
|
360
|
-
|
|
404
|
+
_mount12 = mount(DatetimeDemo), instance = _mount12[0], element = _mount12[1];
|
|
361
405
|
input = element.querySelector('.k-input');
|
|
362
406
|
input.click();
|
|
363
|
-
|
|
407
|
+
_context14.next = 5;
|
|
364
408
|
return wait();
|
|
365
409
|
case 5:
|
|
366
410
|
content = getElement('.k-datepicker-content'); // change to time panel
|
|
367
411
|
content.querySelector('.k-calendar-item').click();
|
|
368
|
-
|
|
412
|
+
_context14.next = 9;
|
|
369
413
|
return wait();
|
|
370
414
|
case 9:
|
|
371
415
|
content.querySelector('.k-datepicker-footer .k-btn').click();
|
|
372
416
|
// clear the value
|
|
373
|
-
|
|
417
|
+
_context14.next = 12;
|
|
374
418
|
return wait();
|
|
375
419
|
case 12:
|
|
376
420
|
expect(instance.get('datetime1')).to.be.string;
|
|
@@ -378,7 +422,7 @@ describe('Datepicker', function () {
|
|
|
378
422
|
expect(instance.get('datetime1')).be.eql(null);
|
|
379
423
|
// set value to empty string should clear datetime
|
|
380
424
|
input.click();
|
|
381
|
-
|
|
425
|
+
_context14.next = 18;
|
|
382
426
|
return wait();
|
|
383
427
|
case 18:
|
|
384
428
|
content.querySelector('.k-calendar-item').click();
|
|
@@ -386,21 +430,21 @@ describe('Datepicker', function () {
|
|
|
386
430
|
expect(instance.get('datetime1')).to.eql('');
|
|
387
431
|
case 21:
|
|
388
432
|
case "end":
|
|
389
|
-
return
|
|
433
|
+
return _context14.stop();
|
|
390
434
|
}
|
|
391
|
-
},
|
|
435
|
+
}, _callee14);
|
|
392
436
|
})));
|
|
393
437
|
});
|
|
394
438
|
describe('Multiple', function () {
|
|
395
|
-
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
396
|
-
var
|
|
397
|
-
return _regeneratorRuntime.wrap(function
|
|
398
|
-
while (1) switch (
|
|
439
|
+
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
440
|
+
var _mount13, instance, element, select, content, items, close;
|
|
441
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
442
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
399
443
|
case 0:
|
|
400
|
-
|
|
444
|
+
_mount13 = mount(MultipleDemo), instance = _mount13[0], element = _mount13[1];
|
|
401
445
|
select = element.querySelector('.k-datepicker');
|
|
402
446
|
dispatchEvent(select, 'click');
|
|
403
|
-
|
|
447
|
+
_context15.next = 5;
|
|
404
448
|
return wait();
|
|
405
449
|
case 5:
|
|
406
450
|
content = getElement('.k-datepicker-content');
|
|
@@ -410,19 +454,19 @@ describe('Datepicker', function () {
|
|
|
410
454
|
expect(instance.get('date')).have.lengthOf(2);
|
|
411
455
|
dispatchEvent(items[18], 'click');
|
|
412
456
|
expect(instance.get('date')).have.lengthOf(1);
|
|
413
|
-
|
|
457
|
+
_context15.next = 14;
|
|
414
458
|
return wait();
|
|
415
459
|
case 14:
|
|
416
460
|
// remove specified item
|
|
417
461
|
close = element.querySelector('.k-tag-close');
|
|
418
462
|
close.click();
|
|
419
463
|
expect(instance.get('date')).have.lengthOf(0);
|
|
420
|
-
|
|
464
|
+
_context15.next = 19;
|
|
421
465
|
return wait();
|
|
422
466
|
case 19:
|
|
423
467
|
dispatchEvent(items[17], 'click');
|
|
424
468
|
expect(instance.get('date')).have.lengthOf(1);
|
|
425
|
-
|
|
469
|
+
_context15.next = 23;
|
|
426
470
|
return wait();
|
|
427
471
|
case 23:
|
|
428
472
|
// clear
|
|
@@ -430,284 +474,206 @@ describe('Datepicker', function () {
|
|
|
430
474
|
expect(instance.get('date')).have.lengthOf(0);
|
|
431
475
|
case 25:
|
|
432
476
|
case "end":
|
|
433
|
-
return
|
|
477
|
+
return _context15.stop();
|
|
434
478
|
}
|
|
435
|
-
},
|
|
479
|
+
}, _callee15);
|
|
436
480
|
})));
|
|
437
|
-
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
438
|
-
var
|
|
439
|
-
return _regeneratorRuntime.wrap(function
|
|
440
|
-
while (1) switch (
|
|
481
|
+
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
|
|
482
|
+
var _mount14, instance, element, _element$querySelecto5, select, content;
|
|
483
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
484
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
441
485
|
case 0:
|
|
442
|
-
|
|
486
|
+
_mount14 = mount(MultipleDemo), instance = _mount14[0], element = _mount14[1];
|
|
443
487
|
_element$querySelecto5 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto5[1];
|
|
444
488
|
dispatchEvent(select, 'click');
|
|
445
|
-
|
|
489
|
+
_context16.next = 5;
|
|
446
490
|
return wait();
|
|
447
491
|
case 5:
|
|
448
492
|
content = getElement('.k-datepicker-content');
|
|
449
493
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
450
|
-
|
|
494
|
+
_context16.next = 9;
|
|
451
495
|
return wait();
|
|
452
496
|
case 9:
|
|
453
|
-
dispatchEvent(content.querySelector('.k-btn'), 'click');
|
|
454
|
-
|
|
497
|
+
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
498
|
+
_context16.next = 12;
|
|
455
499
|
return wait();
|
|
456
500
|
case 12:
|
|
457
501
|
expect(instance.get('datetime')).have.lengthOf(1);
|
|
458
502
|
// select the same datetime
|
|
459
503
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
460
|
-
|
|
504
|
+
_context16.next = 16;
|
|
461
505
|
return wait();
|
|
462
506
|
case 16:
|
|
463
|
-
dispatchEvent(content.querySelector('.k-btn'), 'click');
|
|
464
|
-
|
|
507
|
+
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
508
|
+
_context16.next = 19;
|
|
465
509
|
return wait();
|
|
466
510
|
case 19:
|
|
467
511
|
expect(instance.get('datetime')).have.lengthOf(1);
|
|
468
512
|
// select different time with the same date
|
|
469
513
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
470
|
-
|
|
514
|
+
_context16.next = 23;
|
|
471
515
|
return wait();
|
|
472
516
|
case 23:
|
|
473
517
|
dispatchEvent(content.querySelector('.k-scroll-select-item'), 'click');
|
|
474
|
-
|
|
518
|
+
_context16.next = 26;
|
|
475
519
|
return wait();
|
|
476
520
|
case 26:
|
|
477
|
-
dispatchEvent(content.querySelector('.k-btn'), 'click');
|
|
478
|
-
|
|
521
|
+
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
522
|
+
_context16.next = 29;
|
|
479
523
|
return wait();
|
|
480
524
|
case 29:
|
|
481
525
|
expect(instance.get('datetime')).have.lengthOf(2);
|
|
482
526
|
// change to time panel, and remove the selections, then click confirm ok
|
|
483
527
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
484
|
-
|
|
528
|
+
_context16.next = 33;
|
|
485
529
|
return wait();
|
|
486
530
|
case 33:
|
|
487
531
|
instance.set('datetime', []);
|
|
488
|
-
|
|
532
|
+
_context16.next = 36;
|
|
489
533
|
return wait();
|
|
490
534
|
case 36:
|
|
491
|
-
dispatchEvent(content.querySelector('.k-btn'), 'click');
|
|
492
|
-
|
|
535
|
+
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
536
|
+
_context16.next = 39;
|
|
493
537
|
return wait();
|
|
494
538
|
case 39:
|
|
495
539
|
expect(instance.get('datetime')).have.lengthOf(1);
|
|
496
540
|
case 40:
|
|
497
541
|
case "end":
|
|
498
|
-
return
|
|
542
|
+
return _context16.stop();
|
|
499
543
|
}
|
|
500
|
-
},
|
|
544
|
+
}, _callee16);
|
|
501
545
|
})));
|
|
502
|
-
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
503
|
-
var
|
|
504
|
-
return _regeneratorRuntime.wrap(function
|
|
505
|
-
while (1) switch (
|
|
546
|
+
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
|
547
|
+
var _mount15, instance, element, _element$querySelecto6, select, content;
|
|
548
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
549
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
506
550
|
case 0:
|
|
507
|
-
|
|
551
|
+
_mount15 = mount(MultipleDemo), instance = _mount15[0], element = _mount15[1];
|
|
508
552
|
_element$querySelecto6 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto6[2];
|
|
509
553
|
dispatchEvent(select, 'click');
|
|
510
|
-
|
|
554
|
+
_context17.next = 5;
|
|
511
555
|
return wait();
|
|
512
556
|
case 5:
|
|
513
557
|
content = getElement('.k-datepicker-content');
|
|
514
558
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(6)'), 'click');
|
|
515
|
-
|
|
559
|
+
_context17.next = 9;
|
|
516
560
|
return wait();
|
|
517
561
|
case 9:
|
|
518
562
|
expect(instance.get('year')).have.lengthOf(1);
|
|
519
563
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(7)'), 'click');
|
|
520
|
-
|
|
564
|
+
_context17.next = 13;
|
|
521
565
|
return wait();
|
|
522
566
|
case 13:
|
|
523
567
|
expect(instance.get('year')).have.lengthOf(2);
|
|
524
568
|
instance.set('year', []);
|
|
525
|
-
|
|
569
|
+
_context17.next = 17;
|
|
526
570
|
return wait();
|
|
527
571
|
case 17:
|
|
528
572
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(6)'), 'click');
|
|
529
|
-
|
|
573
|
+
_context17.next = 20;
|
|
530
574
|
return wait();
|
|
531
575
|
case 20:
|
|
532
576
|
expect(instance.get('year')).have.lengthOf(1);
|
|
533
577
|
case 21:
|
|
534
578
|
case "end":
|
|
535
|
-
return
|
|
579
|
+
return _context17.stop();
|
|
536
580
|
}
|
|
537
|
-
},
|
|
581
|
+
}, _callee17);
|
|
538
582
|
})));
|
|
539
|
-
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
540
|
-
var
|
|
541
|
-
return _regeneratorRuntime.wrap(function
|
|
542
|
-
while (1) switch (
|
|
583
|
+
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
|
584
|
+
var _mount16, instance, element, _element$querySelecto7, select, content;
|
|
585
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
586
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
543
587
|
case 0:
|
|
544
|
-
|
|
588
|
+
_mount16 = mount(MultipleDemo), instance = _mount16[0], element = _mount16[1];
|
|
545
589
|
_element$querySelecto7 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto7[3];
|
|
546
590
|
dispatchEvent(select, 'click');
|
|
547
|
-
|
|
591
|
+
_context18.next = 5;
|
|
548
592
|
return wait();
|
|
549
593
|
case 5:
|
|
550
594
|
content = getElement('.k-datepicker-content');
|
|
551
595
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(6)'), 'click');
|
|
552
|
-
|
|
596
|
+
_context18.next = 9;
|
|
553
597
|
return wait();
|
|
554
598
|
case 9:
|
|
555
599
|
expect(instance.get('month')).have.lengthOf(1);
|
|
556
600
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(7)'), 'click');
|
|
557
|
-
|
|
601
|
+
_context18.next = 13;
|
|
558
602
|
return wait();
|
|
559
603
|
case 13:
|
|
560
604
|
expect(instance.get('month')).have.lengthOf(2);
|
|
561
605
|
instance.set('month', []);
|
|
562
|
-
|
|
606
|
+
_context18.next = 17;
|
|
563
607
|
return wait();
|
|
564
608
|
case 17:
|
|
565
609
|
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(6)'), 'click');
|
|
566
|
-
|
|
610
|
+
_context18.next = 20;
|
|
567
611
|
return wait();
|
|
568
612
|
case 20:
|
|
569
613
|
expect(instance.get('month')).have.lengthOf(1);
|
|
570
614
|
case 21:
|
|
571
615
|
case "end":
|
|
572
|
-
return
|
|
616
|
+
return _context18.stop();
|
|
573
617
|
}
|
|
574
|
-
},
|
|
618
|
+
}, _callee18);
|
|
575
619
|
})));
|
|
576
|
-
it('date range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
577
|
-
var
|
|
578
|
-
return _regeneratorRuntime.wrap(function
|
|
579
|
-
while (1) switch (
|
|
620
|
+
it('date range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19() {
|
|
621
|
+
var _mount17, instance, element, _element$querySelecto8, select, content, _content$querySelecto7, calendar1, calendar2, first, second;
|
|
622
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
623
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
580
624
|
case 0:
|
|
581
|
-
|
|
625
|
+
_mount17 = mount(MultipleDemo), instance = _mount17[0], element = _mount17[1];
|
|
582
626
|
_element$querySelecto8 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto8[4];
|
|
583
627
|
dispatchEvent(select, 'click');
|
|
584
|
-
|
|
628
|
+
_context19.next = 5;
|
|
585
629
|
return wait();
|
|
586
630
|
case 5:
|
|
587
631
|
content = getElement('.k-datepicker-content');
|
|
588
|
-
_content$querySelecto7 = content.querySelectorAll('.k-datepicker-calendar-wrapper'), calendar1 = _content$querySelecto7[0], calendar2 = _content$querySelecto7[1];
|
|
632
|
+
_content$querySelecto7 = content.querySelectorAll('.k-datepicker-calendar-time-wrapper'), calendar1 = _content$querySelecto7[0], calendar2 = _content$querySelecto7[1];
|
|
589
633
|
first = calendar1.querySelectorAll('.k-calendar-item')[17];
|
|
590
634
|
second = calendar2.querySelectorAll('.k-calendar-item')[17];
|
|
591
635
|
first.click();
|
|
592
636
|
second.click();
|
|
593
|
-
|
|
637
|
+
_context19.next = 13;
|
|
594
638
|
return wait();
|
|
595
639
|
case 13:
|
|
596
640
|
expect(instance.get('dateRange')).have.lengthOf(1);
|
|
597
641
|
dispatchEvent(first.nextElementSibling, 'click');
|
|
598
642
|
dispatchEvent(second.nextElementSibling, 'click');
|
|
599
|
-
|
|
643
|
+
_context19.next = 18;
|
|
600
644
|
return wait();
|
|
601
645
|
case 18:
|
|
602
646
|
expect(instance.get('dateRange')).have.lengthOf(2);
|
|
603
647
|
first.click();
|
|
604
648
|
second.click();
|
|
605
|
-
|
|
649
|
+
_context19.next = 23;
|
|
606
650
|
return wait();
|
|
607
651
|
case 23:
|
|
608
652
|
expect(instance.get('dateRange')).have.lengthOf(1);
|
|
609
653
|
instance.set('dateRange', []);
|
|
610
|
-
|
|
654
|
+
_context19.next = 27;
|
|
611
655
|
return wait();
|
|
612
656
|
case 27:
|
|
613
657
|
first.click();
|
|
614
658
|
second.click();
|
|
615
|
-
|
|
659
|
+
_context19.next = 31;
|
|
616
660
|
return wait();
|
|
617
661
|
case 31:
|
|
618
662
|
expect(instance.get('dateRange')).have.lengthOf(1);
|
|
619
663
|
case 32:
|
|
620
|
-
case "end":
|
|
621
|
-
return _context17.stop();
|
|
622
|
-
}
|
|
623
|
-
}, _callee17);
|
|
624
|
-
})));
|
|
625
|
-
it('datetime range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
|
626
|
-
var _context18;
|
|
627
|
-
var _mount16, instance, element, _element$querySelecto9, select, content, _content$querySelecto8, calendar1, calendar2, values;
|
|
628
|
-
return _regeneratorRuntime.wrap(function _callee18$(_context19) {
|
|
629
|
-
while (1) switch (_context19.prev = _context19.next) {
|
|
630
|
-
case 0:
|
|
631
|
-
_mount16 = mount(MultipleDemo), instance = _mount16[0], element = _mount16[1];
|
|
632
|
-
_element$querySelecto9 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto9[5];
|
|
633
|
-
dispatchEvent(select, 'click');
|
|
634
|
-
_context19.next = 5;
|
|
635
|
-
return wait();
|
|
636
|
-
case 5:
|
|
637
|
-
content = getElement('.k-datepicker-content');
|
|
638
|
-
_content$querySelecto8 = content.querySelectorAll('.k-datepicker-calendar-wrapper'), calendar1 = _content$querySelecto8[0], calendar2 = _content$querySelecto8[1];
|
|
639
|
-
calendar1.querySelectorAll('.k-calendar-item')[17].click();
|
|
640
|
-
calendar2.querySelectorAll('.k-calendar-item')[17].click();
|
|
641
|
-
_context19.next = 11;
|
|
642
|
-
return wait();
|
|
643
|
-
case 11:
|
|
644
|
-
content.querySelector('.k-btn').click();
|
|
645
|
-
_context19.next = 14;
|
|
646
|
-
return wait();
|
|
647
|
-
case 14:
|
|
648
|
-
expect(instance.get('datetimeRange')).have.lengthOf(1);
|
|
649
|
-
calendar1.querySelectorAll('.k-calendar-item')[18].click();
|
|
650
|
-
calendar2.querySelectorAll('.k-calendar-item')[18].click();
|
|
651
|
-
_context19.next = 19;
|
|
652
|
-
return wait();
|
|
653
|
-
case 19:
|
|
654
|
-
content.querySelector('.k-btn').click();
|
|
655
|
-
_context19.next = 22;
|
|
656
|
-
return wait();
|
|
657
|
-
case 22:
|
|
658
|
-
expect(instance.get('datetimeRange')).have.lengthOf(2);
|
|
659
|
-
// selecting the same date time will do nothing
|
|
660
|
-
calendar1.querySelectorAll('.k-calendar-item')[17].click();
|
|
661
|
-
calendar2.querySelectorAll('.k-calendar-item')[17].click();
|
|
662
|
-
_context19.next = 27;
|
|
663
|
-
return wait();
|
|
664
|
-
case 27:
|
|
665
|
-
content.querySelector('.k-btn').click();
|
|
666
|
-
_context19.next = 30;
|
|
667
|
-
return wait();
|
|
668
|
-
case 30:
|
|
669
|
-
expect(instance.get('datetimeRange')).have.lengthOf(2);
|
|
670
|
-
instance.set('datetimeRange', []);
|
|
671
|
-
_context19.next = 34;
|
|
672
|
-
return wait();
|
|
673
|
-
case 34:
|
|
674
|
-
calendar1.querySelectorAll('.k-calendar-item')[17].click();
|
|
675
|
-
calendar2.querySelectorAll('.k-calendar-item')[17].click();
|
|
676
|
-
_context19.next = 38;
|
|
677
|
-
return wait();
|
|
678
|
-
case 38:
|
|
679
|
-
content.querySelector('.k-btn').click();
|
|
680
|
-
_context19.next = 41;
|
|
681
|
-
return wait();
|
|
682
|
-
case 41:
|
|
683
|
-
expect(instance.get('datetimeRange')).have.lengthOf(1);
|
|
684
|
-
// select the first value in end panel
|
|
685
|
-
calendar2.querySelectorAll('.k-calendar-item')[17].click();
|
|
686
|
-
calendar2.querySelectorAll('.k-calendar-item')[17].click();
|
|
687
|
-
_context19.next = 46;
|
|
688
|
-
return wait();
|
|
689
|
-
case 46:
|
|
690
|
-
content.querySelector('.k-btn').click();
|
|
691
|
-
_context19.next = 49;
|
|
692
|
-
return wait();
|
|
693
|
-
case 49:
|
|
694
|
-
values = instance.get('datetimeRange');
|
|
695
|
-
expect(values).have.lengthOf(2);
|
|
696
|
-
expect(_includesInstanceProperty(_context18 = values[1][1]).call(_context18, '23:59:59')).to.be.true;
|
|
697
|
-
case 52:
|
|
698
664
|
case "end":
|
|
699
665
|
return _context19.stop();
|
|
700
666
|
}
|
|
701
|
-
},
|
|
667
|
+
}, _callee19);
|
|
702
668
|
})));
|
|
703
669
|
});
|
|
704
670
|
describe('Range', function () {
|
|
705
|
-
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
706
|
-
var
|
|
707
|
-
return _regeneratorRuntime.wrap(function
|
|
671
|
+
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
|
|
672
|
+
var _mount18, instance, element, select, content, first, value, value1, second;
|
|
673
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
708
674
|
while (1) switch (_context20.prev = _context20.next) {
|
|
709
675
|
case 0:
|
|
710
|
-
|
|
676
|
+
_mount18 = mount(RangeDemo), instance = _mount18[0], element = _mount18[1]; // date
|
|
711
677
|
select = element.querySelector('.k-datepicker');
|
|
712
678
|
select.click();
|
|
713
679
|
_context20.next = 5;
|
|
@@ -773,7 +739,7 @@ describe('Datepicker', function () {
|
|
|
773
739
|
return wait();
|
|
774
740
|
case 49:
|
|
775
741
|
first.click();
|
|
776
|
-
second = content.querySelector('.k-datepicker-calendar-wrapper:nth-child(2) .k-calendar-item:nth-child(19)');
|
|
742
|
+
second = content.querySelector('.k-datepicker-calendar-time-wrapper:nth-child(2) .k-calendar-item:nth-child(19)');
|
|
777
743
|
second.click();
|
|
778
744
|
_context20.next = 54;
|
|
779
745
|
return wait();
|
|
@@ -783,63 +749,86 @@ describe('Datepicker', function () {
|
|
|
783
749
|
case "end":
|
|
784
750
|
return _context20.stop();
|
|
785
751
|
}
|
|
786
|
-
},
|
|
752
|
+
}, _callee20);
|
|
787
753
|
})));
|
|
788
|
-
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
789
|
-
var
|
|
790
|
-
return _regeneratorRuntime.wrap(function
|
|
754
|
+
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
|
|
755
|
+
var _mount19, instance, element, _element$querySelecto9, select, content;
|
|
756
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
791
757
|
while (1) switch (_context21.prev = _context21.next) {
|
|
792
758
|
case 0:
|
|
793
|
-
|
|
794
|
-
_element$
|
|
795
|
-
|
|
759
|
+
_mount19 = mount(MultipleDemo), instance = _mount19[0], element = _mount19[1];
|
|
760
|
+
_element$querySelecto9 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto9[1];
|
|
761
|
+
dispatchEvent(select, 'click');
|
|
796
762
|
_context21.next = 5;
|
|
797
763
|
return wait();
|
|
798
764
|
case 5:
|
|
799
765
|
content = getElement('.k-datepicker-content');
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
766
|
+
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
767
|
+
_context21.next = 9;
|
|
768
|
+
return wait();
|
|
769
|
+
case 9:
|
|
770
|
+
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
805
771
|
_context21.next = 12;
|
|
806
772
|
return wait();
|
|
807
773
|
case 12:
|
|
808
|
-
expect(
|
|
809
|
-
|
|
774
|
+
expect(instance.get('datetime')).have.lengthOf(1);
|
|
775
|
+
// select the same datetime
|
|
776
|
+
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
810
777
|
_context21.next = 16;
|
|
811
778
|
return wait();
|
|
812
779
|
case 16:
|
|
813
|
-
dispatchEvent(
|
|
814
|
-
|
|
815
|
-
content.querySelector('.k-datepicker-footer .k-btn').click();
|
|
816
|
-
_context21.next = 21;
|
|
780
|
+
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
781
|
+
_context21.next = 19;
|
|
817
782
|
return wait();
|
|
818
|
-
case
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
case
|
|
783
|
+
case 19:
|
|
784
|
+
expect(instance.get('datetime')).have.lengthOf(1);
|
|
785
|
+
// select different time with the same date
|
|
786
|
+
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
787
|
+
_context21.next = 23;
|
|
788
|
+
return wait();
|
|
789
|
+
case 23:
|
|
790
|
+
dispatchEvent(content.querySelector('.k-scroll-select-item'), 'click');
|
|
791
|
+
_context21.next = 26;
|
|
792
|
+
return wait();
|
|
793
|
+
case 26:
|
|
794
|
+
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
795
|
+
_context21.next = 29;
|
|
796
|
+
return wait();
|
|
797
|
+
case 29:
|
|
798
|
+
expect(instance.get('datetime')).have.lengthOf(2);
|
|
799
|
+
// change to time panel, and remove the selections, then click confirm ok
|
|
800
|
+
dispatchEvent(content.querySelector('.k-calendar-item:nth-child(18)'), 'click');
|
|
801
|
+
_context21.next = 33;
|
|
802
|
+
return wait();
|
|
803
|
+
case 33:
|
|
804
|
+
instance.set('datetime', []);
|
|
805
|
+
_context21.next = 36;
|
|
806
|
+
return wait();
|
|
807
|
+
case 36:
|
|
808
|
+
dispatchEvent(content.querySelector('.k-datepicker-footer .k-btn'), 'click');
|
|
809
|
+
_context21.next = 39;
|
|
810
|
+
return wait();
|
|
811
|
+
case 39:
|
|
812
|
+
expect(instance.get('datetime')).have.lengthOf(1);
|
|
813
|
+
case 40:
|
|
825
814
|
case "end":
|
|
826
815
|
return _context21.stop();
|
|
827
816
|
}
|
|
828
|
-
},
|
|
817
|
+
}, _callee21);
|
|
829
818
|
})));
|
|
830
|
-
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
831
|
-
var
|
|
832
|
-
return _regeneratorRuntime.wrap(function
|
|
819
|
+
it('year', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
820
|
+
var _mount20, instance, element, _element$querySelecto10, select, content, _content$querySelecto8, calendar1, calendar2, first, second, value;
|
|
821
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
833
822
|
while (1) switch (_context22.prev = _context22.next) {
|
|
834
823
|
case 0:
|
|
835
|
-
|
|
836
|
-
_element$
|
|
824
|
+
_mount20 = mount(RangeDemo), instance = _mount20[0], element = _mount20[1];
|
|
825
|
+
_element$querySelecto10 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto10[2];
|
|
837
826
|
select.click();
|
|
838
827
|
_context22.next = 5;
|
|
839
828
|
return wait();
|
|
840
829
|
case 5:
|
|
841
830
|
content = getElement('.k-datepicker-content');
|
|
842
|
-
_content$
|
|
831
|
+
_content$querySelecto8 = content.querySelectorAll('.k-datepicker-calendar-time-wrapper'), calendar1 = _content$querySelecto8[0], calendar2 = _content$querySelecto8[1];
|
|
843
832
|
first = calendar1.querySelector('.k-calendar-item:nth-child(2)');
|
|
844
833
|
second = calendar2.querySelector('.k-calendar-item:nth-child(2)');
|
|
845
834
|
first.click();
|
|
@@ -853,21 +842,21 @@ describe('Datepicker', function () {
|
|
|
853
842
|
case "end":
|
|
854
843
|
return _context22.stop();
|
|
855
844
|
}
|
|
856
|
-
},
|
|
845
|
+
}, _callee22);
|
|
857
846
|
})));
|
|
858
|
-
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
859
|
-
var
|
|
860
|
-
return _regeneratorRuntime.wrap(function
|
|
847
|
+
it('month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
848
|
+
var _mount21, instance, element, _element$querySelecto11, select, content, _content$querySelecto9, calendar1, calendar2, first, second, value;
|
|
849
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
861
850
|
while (1) switch (_context23.prev = _context23.next) {
|
|
862
851
|
case 0:
|
|
863
|
-
|
|
864
|
-
_element$
|
|
852
|
+
_mount21 = mount(RangeDemo), instance = _mount21[0], element = _mount21[1];
|
|
853
|
+
_element$querySelecto11 = element.querySelectorAll('.k-datepicker'), select = _element$querySelecto11[3];
|
|
865
854
|
select.click();
|
|
866
855
|
_context23.next = 5;
|
|
867
856
|
return wait();
|
|
868
857
|
case 5:
|
|
869
858
|
content = getElement('.k-datepicker-content');
|
|
870
|
-
_content$
|
|
859
|
+
_content$querySelecto9 = content.querySelectorAll('.k-datepicker-calendar-time-wrapper'), calendar1 = _content$querySelecto9[0], calendar2 = _content$querySelecto9[1];
|
|
871
860
|
first = calendar1.querySelector('.k-calendar-item:nth-child(1)');
|
|
872
861
|
second = calendar2.querySelector('.k-calendar-item:nth-child(1)');
|
|
873
862
|
first.click();
|
|
@@ -881,17 +870,17 @@ describe('Datepicker', function () {
|
|
|
881
870
|
case "end":
|
|
882
871
|
return _context23.stop();
|
|
883
872
|
}
|
|
884
|
-
},
|
|
873
|
+
}, _callee23);
|
|
885
874
|
})));
|
|
886
875
|
});
|
|
887
876
|
describe('Keybord', function () {
|
|
888
|
-
it('single date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
877
|
+
it('single date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
|
|
889
878
|
var _context24;
|
|
890
|
-
var
|
|
891
|
-
return _regeneratorRuntime.wrap(function
|
|
879
|
+
var _mount22, instance, element, now, select, content;
|
|
880
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context25) {
|
|
892
881
|
while (1) switch (_context25.prev = _context25.next) {
|
|
893
882
|
case 0:
|
|
894
|
-
|
|
883
|
+
_mount22 = mount(BasicDemo), instance = _mount22[0], element = _mount22[1];
|
|
895
884
|
now = new Date();
|
|
896
885
|
select = element.querySelector('.k-datepicker');
|
|
897
886
|
select.click();
|
|
@@ -959,14 +948,14 @@ describe('Datepicker', function () {
|
|
|
959
948
|
case "end":
|
|
960
949
|
return _context25.stop();
|
|
961
950
|
}
|
|
962
|
-
},
|
|
951
|
+
}, _callee24);
|
|
963
952
|
})));
|
|
964
|
-
it('range date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
965
|
-
var
|
|
966
|
-
return _regeneratorRuntime.wrap(function
|
|
953
|
+
it('range date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
|
|
954
|
+
var _mount23, instance, element, select, value, _value;
|
|
955
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context26) {
|
|
967
956
|
while (1) switch (_context26.prev = _context26.next) {
|
|
968
957
|
case 0:
|
|
969
|
-
|
|
958
|
+
_mount23 = mount(RangeDemo), instance = _mount23[0], element = _mount23[1];
|
|
970
959
|
select = element.querySelector('.k-datepicker');
|
|
971
960
|
select.click();
|
|
972
961
|
_context26.next = 5;
|
|
@@ -1012,16 +1001,16 @@ describe('Datepicker', function () {
|
|
|
1012
1001
|
case "end":
|
|
1013
1002
|
return _context26.stop();
|
|
1014
1003
|
}
|
|
1015
|
-
},
|
|
1004
|
+
}, _callee25);
|
|
1016
1005
|
})));
|
|
1017
1006
|
});
|
|
1018
|
-
describe('Event', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1019
|
-
return _regeneratorRuntime.wrap(function
|
|
1007
|
+
describe('Event', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
|
|
1008
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context29) {
|
|
1020
1009
|
while (1) switch (_context29.prev = _context29.next) {
|
|
1021
1010
|
case 0:
|
|
1022
|
-
it('selecting', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1023
|
-
var fn, Demo,
|
|
1024
|
-
return _regeneratorRuntime.wrap(function
|
|
1011
|
+
it('selecting', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
|
|
1012
|
+
var fn, Demo, _mount24, instance, element, content, calendar, first, second, firstDateItem, activeTimeItem, nextTimeItem, confirmBtn, endCalendar, endFirst, endSecond, endDateItem, endActiveTimeItem, endNextTimeItem, finalConfirmBtn;
|
|
1013
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context28) {
|
|
1025
1014
|
while (1) switch (_context28.prev = _context28.next) {
|
|
1026
1015
|
case 0:
|
|
1027
1016
|
fn = sinon.spy(function (v) {
|
|
@@ -1046,53 +1035,65 @@ describe('Datepicker', function () {
|
|
|
1046
1035
|
return Demo;
|
|
1047
1036
|
}(Component);
|
|
1048
1037
|
Demo.template = "\n const {Datepicker} = this;\n <Datepicker ev-selecting={this.onSelecting} range type=\"datetime\" />\n ";
|
|
1049
|
-
|
|
1038
|
+
_mount24 = mount(Demo), instance = _mount24[0], element = _mount24[1];
|
|
1050
1039
|
element.click();
|
|
1051
1040
|
_context28.next = 7;
|
|
1052
1041
|
return wait();
|
|
1053
1042
|
case 7:
|
|
1054
1043
|
content = getElement('.k-datepicker-content');
|
|
1055
|
-
|
|
1056
|
-
first =
|
|
1057
|
-
second =
|
|
1058
|
-
first.
|
|
1044
|
+
calendar = content.querySelector('.k-datepicker-calendar-time-wrapper');
|
|
1045
|
+
first = calendar.querySelector('.k-datepicker-calendar');
|
|
1046
|
+
second = calendar.querySelector('.k-datepicker-time-wrapper');
|
|
1047
|
+
firstDateItem = first.querySelector('.k-calendar-item');
|
|
1048
|
+
firstDateItem.click();
|
|
1059
1049
|
expect(fn.callCount).to.eql(1);
|
|
1060
1050
|
expect(fn.lastCall.args[0]).have.lengthOf(1);
|
|
1061
|
-
second.
|
|
1051
|
+
activeTimeItem = second.querySelector('.k-scroll-select-wrapper .k-active');
|
|
1052
|
+
nextTimeItem = activeTimeItem.nextElementSibling;
|
|
1053
|
+
nextTimeItem.click();
|
|
1062
1054
|
expect(fn.callCount).to.eql(2);
|
|
1063
|
-
expect(fn.lastCall.args[0]).have.lengthOf(
|
|
1064
|
-
|
|
1055
|
+
expect(fn.lastCall.args[0]).have.lengthOf(1);
|
|
1056
|
+
confirmBtn = content.querySelector('.k-datepicker-footer .k-btn');
|
|
1057
|
+
confirmBtn.click();
|
|
1058
|
+
_context28.next = 24;
|
|
1065
1059
|
return wait();
|
|
1066
|
-
case
|
|
1067
|
-
|
|
1060
|
+
case 24:
|
|
1061
|
+
endCalendar = content.querySelector('.k-datepicker-calendar-time-wrapper');
|
|
1062
|
+
endFirst = endCalendar.querySelector('.k-datepicker-calendar');
|
|
1063
|
+
endSecond = endCalendar.querySelector('.k-datepicker-time-wrapper');
|
|
1064
|
+
endDateItem = endFirst.querySelector('.k-calendar-item');
|
|
1065
|
+
endDateItem.click();
|
|
1068
1066
|
expect(fn.callCount).to.eql(3);
|
|
1069
|
-
expect(fn.lastCall.args[0]).have.lengthOf(
|
|
1070
|
-
|
|
1067
|
+
expect(fn.lastCall.args[0]).have.lengthOf(1);
|
|
1068
|
+
endActiveTimeItem = endSecond.querySelector('.k-scroll-select-wrapper .k-active');
|
|
1069
|
+
endNextTimeItem = endActiveTimeItem.nextElementSibling;
|
|
1070
|
+
endNextTimeItem.click();
|
|
1071
1071
|
expect(fn.callCount).to.eql(4);
|
|
1072
|
-
expect(fn.lastCall.args[0]).have.lengthOf(
|
|
1073
|
-
content.querySelector('.k-datepicker-footer .k-btn')
|
|
1074
|
-
|
|
1072
|
+
expect(fn.lastCall.args[0]).have.lengthOf(1);
|
|
1073
|
+
finalConfirmBtn = content.querySelector('.k-datepicker-footer .k-btn');
|
|
1074
|
+
finalConfirmBtn.click();
|
|
1075
|
+
_context28.next = 40;
|
|
1075
1076
|
return wait();
|
|
1076
|
-
case
|
|
1077
|
+
case 40:
|
|
1077
1078
|
expect(fn.callCount).to.eql(4);
|
|
1078
|
-
case
|
|
1079
|
+
case 41:
|
|
1079
1080
|
case "end":
|
|
1080
1081
|
return _context28.stop();
|
|
1081
1082
|
}
|
|
1082
|
-
},
|
|
1083
|
+
}, _callee26);
|
|
1083
1084
|
})));
|
|
1084
1085
|
case 1:
|
|
1085
1086
|
case "end":
|
|
1086
1087
|
return _context29.stop();
|
|
1087
1088
|
}
|
|
1088
|
-
},
|
|
1089
|
+
}, _callee27);
|
|
1089
1090
|
})));
|
|
1090
|
-
it('should disable some time pickers', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1091
|
-
var
|
|
1092
|
-
return _regeneratorRuntime.wrap(function
|
|
1091
|
+
it('should disable some time pickers', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
|
|
1092
|
+
var _mount25, instance, element, input, content;
|
|
1093
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context30) {
|
|
1093
1094
|
while (1) switch (_context30.prev = _context30.next) {
|
|
1094
1095
|
case 0:
|
|
1095
|
-
|
|
1096
|
+
_mount25 = mount(DatetimeDemo), instance = _mount25[0], element = _mount25[1];
|
|
1096
1097
|
input = element.querySelectorAll('.k-input')[1];
|
|
1097
1098
|
input.click();
|
|
1098
1099
|
_context30.next = 5;
|
|
@@ -1110,15 +1111,15 @@ describe('Datepicker', function () {
|
|
|
1110
1111
|
case "end":
|
|
1111
1112
|
return _context30.stop();
|
|
1112
1113
|
}
|
|
1113
|
-
},
|
|
1114
|
+
}, _callee28);
|
|
1114
1115
|
})));
|
|
1115
|
-
it('format', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1116
|
-
var
|
|
1117
|
-
return _regeneratorRuntime.wrap(function
|
|
1116
|
+
it('format', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
|
|
1117
|
+
var _mount26, instance, element, _element$querySelecto12, input1, input2, input3, content;
|
|
1118
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context31) {
|
|
1118
1119
|
while (1) switch (_context31.prev = _context31.next) {
|
|
1119
1120
|
case 0:
|
|
1120
|
-
|
|
1121
|
-
_element$
|
|
1121
|
+
_mount26 = mount(FormatDemo), instance = _mount26[0], element = _mount26[1];
|
|
1122
|
+
_element$querySelecto12 = element.querySelectorAll('.k-input-inner'), input1 = _element$querySelecto12[0], input2 = _element$querySelecto12[1], input3 = _element$querySelecto12[2];
|
|
1122
1123
|
input1.click();
|
|
1123
1124
|
_context31.next = 5;
|
|
1124
1125
|
return wait();
|
|
@@ -1150,7 +1151,7 @@ describe('Datepicker', function () {
|
|
|
1150
1151
|
_context31.next = 27;
|
|
1151
1152
|
return wait();
|
|
1152
1153
|
case 27:
|
|
1153
|
-
content.querySelector('.k-btn').click();
|
|
1154
|
+
content.querySelector('.k-datepicker-footer .k-btn').click();
|
|
1154
1155
|
_context31.next = 30;
|
|
1155
1156
|
return wait();
|
|
1156
1157
|
case 30:
|
|
@@ -1160,15 +1161,15 @@ describe('Datepicker', function () {
|
|
|
1160
1161
|
case "end":
|
|
1161
1162
|
return _context31.stop();
|
|
1162
1163
|
}
|
|
1163
|
-
},
|
|
1164
|
+
}, _callee29);
|
|
1164
1165
|
})));
|
|
1165
1166
|
describe('Max / Min', function () {
|
|
1166
|
-
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1167
|
-
var
|
|
1168
|
-
return _regeneratorRuntime.wrap(function
|
|
1167
|
+
it('date', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
|
|
1168
|
+
var _mount27, instance, element, now, content, dateDoms;
|
|
1169
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context32) {
|
|
1169
1170
|
while (1) switch (_context32.prev = _context32.next) {
|
|
1170
1171
|
case 0:
|
|
1171
|
-
|
|
1172
|
+
_mount27 = mount(MaxMinDemo), instance = _mount27[0], element = _mount27[1];
|
|
1172
1173
|
now = dayjs().format('YYYY-MM-DD');
|
|
1173
1174
|
instance.set('to', now);
|
|
1174
1175
|
element.querySelector('.k-datepicker').click();
|
|
@@ -1183,14 +1184,14 @@ describe('Datepicker', function () {
|
|
|
1183
1184
|
case "end":
|
|
1184
1185
|
return _context32.stop();
|
|
1185
1186
|
}
|
|
1186
|
-
},
|
|
1187
|
+
}, _callee30);
|
|
1187
1188
|
})));
|
|
1188
|
-
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1189
|
-
var
|
|
1190
|
-
return _regeneratorRuntime.wrap(function
|
|
1189
|
+
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
|
|
1190
|
+
var _mount28, instance, element, now, content;
|
|
1191
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context33) {
|
|
1191
1192
|
while (1) switch (_context33.prev = _context33.next) {
|
|
1192
1193
|
case 0:
|
|
1193
|
-
|
|
1194
|
+
_mount28 = mount(MaxMinDemo), instance = _mount28[0], element = _mount28[1];
|
|
1194
1195
|
now = dayjs().format('YYYY-MM-DD') + '00:00:00';
|
|
1195
1196
|
instance.set('toTime', now);
|
|
1196
1197
|
element.querySelectorAll('.k-datepicker')[2].click();
|
|
@@ -1207,14 +1208,14 @@ describe('Datepicker', function () {
|
|
|
1207
1208
|
case "end":
|
|
1208
1209
|
return _context33.stop();
|
|
1209
1210
|
}
|
|
1210
|
-
},
|
|
1211
|
+
}, _callee31);
|
|
1211
1212
|
})));
|
|
1212
|
-
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
|
|
1213
|
-
var
|
|
1214
|
-
return _regeneratorRuntime.wrap(function
|
|
1213
|
+
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 _callee32() {
|
|
1214
|
+
var _mount29, instance, element, date, time, fromTime, endTimeTrigger, content;
|
|
1215
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context34) {
|
|
1215
1216
|
while (1) switch (_context34.prev = _context34.next) {
|
|
1216
1217
|
case 0:
|
|
1217
|
-
|
|
1218
|
+
_mount29 = mount(MaxMinDemo), instance = _mount29[0], element = _mount29[1];
|
|
1218
1219
|
date = dayjs().format('YYYY-MM-DD');
|
|
1219
1220
|
time = '01:00:00';
|
|
1220
1221
|
fromTime = date + " " + time;
|
|
@@ -1229,7 +1230,7 @@ describe('Datepicker', function () {
|
|
|
1229
1230
|
_context34.next = 13;
|
|
1230
1231
|
return wait();
|
|
1231
1232
|
case 13:
|
|
1232
|
-
content.querySelector('.k-btn').click();
|
|
1233
|
+
content.querySelector('.k-datepicker-footer .k-btn').click();
|
|
1233
1234
|
_context34.next = 16;
|
|
1234
1235
|
return wait();
|
|
1235
1236
|
case 16:
|
|
@@ -1238,7 +1239,7 @@ describe('Datepicker', function () {
|
|
|
1238
1239
|
case "end":
|
|
1239
1240
|
return _context34.stop();
|
|
1240
1241
|
}
|
|
1241
|
-
},
|
|
1242
|
+
}, _callee32);
|
|
1242
1243
|
})));
|
|
1243
1244
|
});
|
|
1244
1245
|
describe('Input', function () {
|
|
@@ -1259,14 +1260,14 @@ describe('Datepicker', function () {
|
|
|
1259
1260
|
return Demo;
|
|
1260
1261
|
}(Component);
|
|
1261
1262
|
Demo.template = "\n const {Datepicker} = this;\n " + template + "\n ";
|
|
1262
|
-
var
|
|
1263
|
-
instance =
|
|
1264
|
-
element =
|
|
1263
|
+
var _mount30 = mount(Demo),
|
|
1264
|
+
instance = _mount30[0],
|
|
1265
|
+
element = _mount30[1];
|
|
1265
1266
|
var input = element.querySelector('.k-input-inner');
|
|
1266
1267
|
globalInput = input;
|
|
1267
1268
|
return /*#__PURE__*/function () {
|
|
1268
|
-
var
|
|
1269
|
-
return _regeneratorRuntime.wrap(function
|
|
1269
|
+
var _ref33 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(value, result) {
|
|
1270
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context36) {
|
|
1270
1271
|
while (1) switch (_context36.prev = _context36.next) {
|
|
1271
1272
|
case 0:
|
|
1272
1273
|
input.value = value;
|
|
@@ -1279,16 +1280,16 @@ describe('Datepicker', function () {
|
|
|
1279
1280
|
case "end":
|
|
1280
1281
|
return _context36.stop();
|
|
1281
1282
|
}
|
|
1282
|
-
},
|
|
1283
|
+
}, _callee33);
|
|
1283
1284
|
}));
|
|
1284
1285
|
return function (_x, _x2) {
|
|
1285
|
-
return
|
|
1286
|
+
return _ref33.apply(this, arguments);
|
|
1286
1287
|
};
|
|
1287
1288
|
}();
|
|
1288
1289
|
}
|
|
1289
|
-
it('basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1290
|
+
it('basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
|
|
1290
1291
|
var myTest;
|
|
1291
|
-
return _regeneratorRuntime.wrap(function
|
|
1292
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context37) {
|
|
1292
1293
|
while (1) switch (_context37.prev = _context37.next) {
|
|
1293
1294
|
case 0:
|
|
1294
1295
|
myTest = test("<Datepicker v-model=\"value\" max=\"2021-11-11\" min=\"2020-01-01\" />"); // input incorrect value
|
|
@@ -1307,11 +1308,11 @@ describe('Datepicker', function () {
|
|
|
1307
1308
|
case "end":
|
|
1308
1309
|
return _context37.stop();
|
|
1309
1310
|
}
|
|
1310
|
-
},
|
|
1311
|
+
}, _callee34);
|
|
1311
1312
|
})));
|
|
1312
|
-
it('multiple', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1313
|
+
it('multiple', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
|
|
1313
1314
|
var myTest;
|
|
1314
|
-
return _regeneratorRuntime.wrap(function
|
|
1315
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context38) {
|
|
1315
1316
|
while (1) switch (_context38.prev = _context38.next) {
|
|
1316
1317
|
case 0:
|
|
1317
1318
|
myTest = test("<Datepicker v-model=\"value\" multiple />"); // input incorrect value
|
|
@@ -1330,11 +1331,11 @@ describe('Datepicker', function () {
|
|
|
1330
1331
|
case "end":
|
|
1331
1332
|
return _context38.stop();
|
|
1332
1333
|
}
|
|
1333
|
-
},
|
|
1334
|
+
}, _callee35);
|
|
1334
1335
|
})));
|
|
1335
|
-
it('range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1336
|
+
it('range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36() {
|
|
1336
1337
|
var myTest;
|
|
1337
|
-
return _regeneratorRuntime.wrap(function
|
|
1338
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context39) {
|
|
1338
1339
|
while (1) switch (_context39.prev = _context39.next) {
|
|
1339
1340
|
case 0:
|
|
1340
1341
|
myTest = test("<Datepicker v-model=\"value\" range max=\"2021-11-11\" min=\"2020-01-01\" />");
|
|
@@ -1352,7 +1353,7 @@ describe('Datepicker', function () {
|
|
|
1352
1353
|
_context39.next = 10;
|
|
1353
1354
|
return myTest('2020-03-03~2020-03-04', ['2020-03-03', '2020-03-04']);
|
|
1354
1355
|
case 10:
|
|
1355
|
-
expect(getElement('.k-datepicker-content').querySelector('.k-datepicker-calendar-wrapper:nth-child(1)').innerHTML).to.matchSnapshot();
|
|
1356
|
+
expect(getElement('.k-datepicker-content').querySelector('.k-datepicker-calendar-time-wrapper:nth-child(1)').innerHTML).to.matchSnapshot();
|
|
1356
1357
|
// clear value
|
|
1357
1358
|
_context39.next = 13;
|
|
1358
1359
|
return myTest('', null);
|
|
@@ -1363,11 +1364,11 @@ describe('Datepicker', function () {
|
|
|
1363
1364
|
case "end":
|
|
1364
1365
|
return _context39.stop();
|
|
1365
1366
|
}
|
|
1366
|
-
},
|
|
1367
|
+
}, _callee36);
|
|
1367
1368
|
})));
|
|
1368
|
-
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1369
|
+
it('datetime', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37() {
|
|
1369
1370
|
var myTest;
|
|
1370
|
-
return _regeneratorRuntime.wrap(function
|
|
1371
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context40) {
|
|
1371
1372
|
while (1) switch (_context40.prev = _context40.next) {
|
|
1372
1373
|
case 0:
|
|
1373
1374
|
myTest = test("<Datepicker v-model=\"value\" type=\"datetime\" />");
|
|
@@ -1380,11 +1381,11 @@ describe('Datepicker', function () {
|
|
|
1380
1381
|
case "end":
|
|
1381
1382
|
return _context40.stop();
|
|
1382
1383
|
}
|
|
1383
|
-
},
|
|
1384
|
+
}, _callee37);
|
|
1384
1385
|
})));
|
|
1385
|
-
it('datetime range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1386
|
+
it('datetime range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38() {
|
|
1386
1387
|
var myTest;
|
|
1387
|
-
return _regeneratorRuntime.wrap(function
|
|
1388
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context41) {
|
|
1388
1389
|
while (1) switch (_context41.prev = _context41.next) {
|
|
1389
1390
|
case 0:
|
|
1390
1391
|
myTest = test('<Datepicker v-model="value" type="datetime" range />');
|
|
@@ -1400,11 +1401,11 @@ describe('Datepicker', function () {
|
|
|
1400
1401
|
case "end":
|
|
1401
1402
|
return _context41.stop();
|
|
1402
1403
|
}
|
|
1403
|
-
},
|
|
1404
|
+
}, _callee38);
|
|
1404
1405
|
})));
|
|
1405
|
-
it('date format', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1406
|
+
it('date format', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39() {
|
|
1406
1407
|
var myTest;
|
|
1407
|
-
return _regeneratorRuntime.wrap(function
|
|
1408
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context42) {
|
|
1408
1409
|
while (1) switch (_context42.prev = _context42.next) {
|
|
1409
1410
|
case 0:
|
|
1410
1411
|
myTest = test("<Datepicker v-model=\"value\" showFormat=\"YYYY\u5E74M\u6708D\u65E5\" />");
|
|
@@ -1414,7 +1415,7 @@ describe('Datepicker', function () {
|
|
|
1414
1415
|
case "end":
|
|
1415
1416
|
return _context42.stop();
|
|
1416
1417
|
}
|
|
1417
|
-
},
|
|
1418
|
+
}, _callee39);
|
|
1418
1419
|
})));
|
|
1419
1420
|
});
|
|
1420
1421
|
});
|