cy-element-ui 1.1.19 → 1.1.21

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.
Files changed (96) hide show
  1. package/lib/index.js +1 -1
  2. package/package.json +1 -1
  3. package/src/index.js +1 -1
  4. package/lib/Alert.js +0 -420
  5. package/lib/Aside.js +0 -277
  6. package/lib/Autocomplete.js +0 -2051
  7. package/lib/Avatar.js +0 -363
  8. package/lib/Backtop.js +0 -404
  9. package/lib/Badge.js +0 -334
  10. package/lib/Breadcrumb.js +0 -293
  11. package/lib/BreadcrumbItem.js +0 -322
  12. package/lib/Button.js +0 -357
  13. package/lib/ButtonGroup.js +0 -262
  14. package/lib/Calendar.js +0 -1146
  15. package/lib/Card.js +0 -297
  16. package/lib/Carousel.js +0 -707
  17. package/lib/CarouselItem.js +0 -434
  18. package/lib/Cascader.js +0 -4641
  19. package/lib/CascaderPanel.js +0 -2602
  20. package/lib/Checkbox.js +0 -627
  21. package/lib/CheckboxButton.js +0 -583
  22. package/lib/CheckboxGroup.js +0 -313
  23. package/lib/Col.js +0 -177
  24. package/lib/Collapse.js +0 -329
  25. package/lib/CollapseItem.js +0 -497
  26. package/lib/ColorPicker.js +0 -2885
  27. package/lib/Container.js +0 -288
  28. package/lib/CySelectDisplayInput.js +0 -367
  29. package/lib/CySubTitle.js +0 -295
  30. package/lib/CyTabDialog.js +0 -1184
  31. package/lib/CyTreeSelect.js +0 -4422
  32. package/lib/DatePicker.js +0 -7574
  33. package/lib/Descriptions.js +0 -457
  34. package/lib/DescriptionsItem.js +0 -140
  35. package/lib/Dialog.js +0 -598
  36. package/lib/Divider.js +0 -313
  37. package/lib/Drawer.js +0 -592
  38. package/lib/Dropdown.js +0 -856
  39. package/lib/DropdownItem.js +0 -316
  40. package/lib/DropdownMenu.js +0 -351
  41. package/lib/Empty.js +0 -730
  42. package/lib/Footer.js +0 -277
  43. package/lib/Form.js +0 -466
  44. package/lib/FormItem.js +0 -826
  45. package/lib/Header.js +0 -277
  46. package/lib/Icon.js +0 -265
  47. package/lib/Image.js +0 -1138
  48. package/lib/InfiniteScroll.js +0 -301
  49. package/lib/Input.js +0 -999
  50. package/lib/InputNumber.js +0 -1552
  51. package/lib/Link.js +0 -332
  52. package/lib/Loading.js +0 -631
  53. package/lib/Main.js +0 -264
  54. package/lib/Menu.js +0 -865
  55. package/lib/MenuItem.js +0 -818
  56. package/lib/MenuItemGroup.js +0 -308
  57. package/lib/Message.js +0 -548
  58. package/lib/MessageBox.js +0 -2134
  59. package/lib/Notification.js +0 -615
  60. package/lib/Option.js +0 -474
  61. package/lib/OptionGroup.js +0 -344
  62. package/lib/PageHeader.js +0 -319
  63. package/lib/Pagination.js +0 -4123
  64. package/lib/Popconfirm.js +0 -1025
  65. package/lib/Popover.js +0 -617
  66. package/lib/Progress.js +0 -595
  67. package/lib/Radio.js +0 -497
  68. package/lib/RadioButton.js +0 -463
  69. package/lib/RadioGroup.js +0 -391
  70. package/lib/Rate.js +0 -670
  71. package/lib/Result.js +0 -578
  72. package/lib/Row.js +0 -149
  73. package/lib/Scrollbar.js +0 -423
  74. package/lib/Select.js +0 -3368
  75. package/lib/Skeleton.js +0 -372
  76. package/lib/SkeletonItem.js +0 -342
  77. package/lib/Slider.js +0 -2854
  78. package/lib/Spinner.js +0 -301
  79. package/lib/Statistic.js +0 -533
  80. package/lib/Step.js +0 -522
  81. package/lib/Steps.js +0 -342
  82. package/lib/Submenu.js +0 -700
  83. package/lib/Switch.js +0 -554
  84. package/lib/TabPane.js +0 -332
  85. package/lib/Table.js +0 -6125
  86. package/lib/TableColumn.js +0 -1481
  87. package/lib/Tabs.js +0 -920
  88. package/lib/Tag.js +0 -304
  89. package/lib/TimePicker.js +0 -4059
  90. package/lib/TimeSelect.js +0 -2871
  91. package/lib/Timeline.js +0 -275
  92. package/lib/TimelineItem.js +0 -371
  93. package/lib/Tooltip.js +0 -425
  94. package/lib/Transfer.js +0 -2557
  95. package/lib/Tree.js +0 -2680
  96. package/lib/Upload.js +0 -1782
package/lib/TimeSelect.js DELETED
@@ -1,2871 +0,0 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // define getter function for harmony exports
38
- /******/ __webpack_require__.d = function(exports, name, getter) {
39
- /******/ if(!__webpack_require__.o(exports, name)) {
40
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
- /******/ }
42
- /******/ };
43
- /******/
44
- /******/ // define __esModule on exports
45
- /******/ __webpack_require__.r = function(exports) {
46
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
- /******/ }
49
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
- /******/ };
51
- /******/
52
- /******/ // create a fake namespace object
53
- /******/ // mode & 1: value is a module id, require it
54
- /******/ // mode & 2: merge all properties of value into the ns
55
- /******/ // mode & 4: return value when already ns object
56
- /******/ // mode & 8|1: behave like require
57
- /******/ __webpack_require__.t = function(value, mode) {
58
- /******/ if(mode & 1) value = __webpack_require__(value);
59
- /******/ if(mode & 8) return value;
60
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
- /******/ var ns = Object.create(null);
62
- /******/ __webpack_require__.r(ns);
63
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
- /******/ return ns;
66
- /******/ };
67
- /******/
68
- /******/ // getDefaultExport function for compatibility with non-harmony modules
69
- /******/ __webpack_require__.n = function(module) {
70
- /******/ var getter = module && module.__esModule ?
71
- /******/ function getDefault() { return module['default']; } :
72
- /******/ function getModuleExports() { return module; };
73
- /******/ __webpack_require__.d(getter, 'a', getter);
74
- /******/ return getter;
75
- /******/ };
76
- /******/
77
- /******/ // Object.prototype.hasOwnProperty.call
78
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
- /******/
80
- /******/ // __webpack_public_path__
81
- /******/ __webpack_require__.p = "/dist/";
82
- /******/
83
- /******/
84
- /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 74);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
-
93
- "use strict";
94
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
95
- /* globals __VUE_SSR_CONTEXT__ */
96
-
97
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
98
- // This module is a runtime utility for cleaner component module output and will
99
- // be included in the final webpack user bundle.
100
-
101
- function normalizeComponent(
102
- scriptExports,
103
- render,
104
- staticRenderFns,
105
- functionalTemplate,
106
- injectStyles,
107
- scopeId,
108
- moduleIdentifier /* server only */,
109
- shadowMode /* vue-cli only */
110
- ) {
111
- // Vue.extend constructor export interop
112
- var options =
113
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
114
-
115
- // render functions
116
- if (render) {
117
- options.render = render
118
- options.staticRenderFns = staticRenderFns
119
- options._compiled = true
120
- }
121
-
122
- // functional template
123
- if (functionalTemplate) {
124
- options.functional = true
125
- }
126
-
127
- // scopedId
128
- if (scopeId) {
129
- options._scopeId = 'data-v-' + scopeId
130
- }
131
-
132
- var hook
133
- if (moduleIdentifier) {
134
- // server build
135
- hook = function (context) {
136
- // 2.3 injection
137
- context =
138
- context || // cached call
139
- (this.$vnode && this.$vnode.ssrContext) || // stateful
140
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
141
- // 2.2 with runInNewContext: true
142
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
143
- context = __VUE_SSR_CONTEXT__
144
- }
145
- // inject component styles
146
- if (injectStyles) {
147
- injectStyles.call(this, context)
148
- }
149
- // register component module identifier for async chunk inferrence
150
- if (context && context._registeredComponents) {
151
- context._registeredComponents.add(moduleIdentifier)
152
- }
153
- }
154
- // used by ssr in case component is cached and beforeCreate
155
- // never gets called
156
- options._ssrRegister = hook
157
- } else if (injectStyles) {
158
- hook = shadowMode
159
- ? function () {
160
- injectStyles.call(
161
- this,
162
- (options.functional ? this.parent : this).$root.$options.shadowRoot
163
- )
164
- }
165
- : injectStyles
166
- }
167
-
168
- if (hook) {
169
- if (options.functional) {
170
- // for template-only hot-reload because in that case the render fn doesn't
171
- // go through the normalizer
172
- options._injectStyles = hook
173
- // register for functional component in vue file
174
- var originalRender = options.render
175
- options.render = function renderWithStyleInjection(h, context) {
176
- hook.call(context)
177
- return originalRender(h, context)
178
- }
179
- } else {
180
- // inject component registration as beforeCreate hook
181
- var existing = options.beforeCreate
182
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
183
- }
184
- }
185
-
186
- return {
187
- exports: scriptExports,
188
- options: options
189
- }
190
- }
191
-
192
-
193
- /***/ }),
194
-
195
- /***/ 1:
196
- /***/ (function(module, exports) {
197
-
198
- module.exports = require("element-ui/lib/utils/dom");
199
-
200
- /***/ }),
201
-
202
- /***/ 10:
203
- /***/ (function(module, exports) {
204
-
205
- module.exports = require("element-ui/lib/utils/resize-event");
206
-
207
- /***/ }),
208
-
209
- /***/ 11:
210
- /***/ (function(module, exports) {
211
-
212
- module.exports = require("element-ui/lib/utils/shared");
213
-
214
- /***/ }),
215
-
216
- /***/ 13:
217
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
218
-
219
- "use strict";
220
- // ESM COMPAT FLAG
221
- __webpack_require__.r(__webpack_exports__);
222
-
223
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=048a9cde
224
- var render = function () {
225
- var _vm = this
226
- var _h = _vm.$createElement
227
- var _c = _vm._self._c || _h
228
- return _c(
229
- "div",
230
- {
231
- class: [
232
- _vm.type === "textarea" ? "el-textarea" : "el-input",
233
- _vm.inputSize ? "el-input--" + _vm.inputSize : "",
234
- {
235
- "is-disabled": _vm.inputDisabled,
236
- "is-exceed": _vm.inputExceed,
237
- "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
238
- "el-input-group--append": _vm.$slots.append,
239
- "el-input-group--prepend": _vm.$slots.prepend,
240
- "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
241
- "el-input--suffix":
242
- _vm.$slots.suffix ||
243
- _vm.suffixIcon ||
244
- _vm.clearable ||
245
- _vm.showPassword,
246
- },
247
- ],
248
- on: {
249
- mouseenter: function ($event) {
250
- _vm.hovering = true
251
- },
252
- mouseleave: function ($event) {
253
- _vm.hovering = false
254
- },
255
- },
256
- },
257
- [
258
- _vm.type !== "textarea"
259
- ? [
260
- _vm.$slots.prepend
261
- ? _c(
262
- "div",
263
- { staticClass: "el-input-group__prepend" },
264
- [_vm._t("prepend")],
265
- 2
266
- )
267
- : _vm._e(),
268
- _vm.type !== "textarea"
269
- ? _c(
270
- "input",
271
- _vm._b(
272
- {
273
- ref: "input",
274
- staticClass: "el-input__inner",
275
- attrs: {
276
- tabindex: _vm.tabindex,
277
- type: _vm.showPassword
278
- ? _vm.passwordVisible
279
- ? "text"
280
- : "password"
281
- : _vm.type,
282
- disabled: _vm.inputDisabled,
283
- readonly: _vm.readonly,
284
- autocomplete: _vm.autoComplete || _vm.autocomplete,
285
- "aria-label": _vm.label,
286
- },
287
- on: {
288
- compositionstart: _vm.handleCompositionStart,
289
- compositionupdate: _vm.handleCompositionUpdate,
290
- compositionend: _vm.handleCompositionEnd,
291
- input: _vm.handleInput,
292
- focus: _vm.handleFocus,
293
- blur: _vm.handleBlur,
294
- change: _vm.handleChange,
295
- },
296
- },
297
- "input",
298
- _vm.$attrs,
299
- false
300
- )
301
- )
302
- : _vm._e(),
303
- _vm.$slots.prefix || _vm.prefixIcon
304
- ? _c(
305
- "span",
306
- { staticClass: "el-input__prefix" },
307
- [
308
- _vm._t("prefix"),
309
- _vm.prefixIcon
310
- ? _c("i", {
311
- staticClass: "el-input__icon",
312
- class: _vm.prefixIcon,
313
- })
314
- : _vm._e(),
315
- ],
316
- 2
317
- )
318
- : _vm._e(),
319
- _vm.getSuffixVisible()
320
- ? _c("span", { staticClass: "el-input__suffix" }, [
321
- _c(
322
- "span",
323
- { staticClass: "el-input__suffix-inner" },
324
- [
325
- !_vm.showClear ||
326
- !_vm.showPwdVisible ||
327
- !_vm.isWordLimitVisible
328
- ? [
329
- _vm._t("suffix"),
330
- _vm.suffixIcon
331
- ? _c("i", {
332
- staticClass: "el-input__icon",
333
- class: _vm.suffixIcon,
334
- })
335
- : _vm._e(),
336
- ]
337
- : _vm._e(),
338
- _vm.showClear
339
- ? _c("i", {
340
- staticClass:
341
- "el-input__icon el-icon-circle-close el-input__clear",
342
- on: {
343
- mousedown: function ($event) {
344
- $event.preventDefault()
345
- },
346
- click: _vm.clear,
347
- },
348
- })
349
- : _vm._e(),
350
- _vm.showPwdVisible
351
- ? _c("i", {
352
- staticClass:
353
- "el-input__icon el-icon-view el-input__clear",
354
- on: { click: _vm.handlePasswordVisible },
355
- })
356
- : _vm._e(),
357
- _vm.isWordLimitVisible
358
- ? _c("span", { staticClass: "el-input__count" }, [
359
- _c(
360
- "span",
361
- { staticClass: "el-input__count-inner" },
362
- [
363
- _vm._v(
364
- "\n\t\t\t\t\t\t\t" +
365
- _vm._s(_vm.textLength) +
366
- "/" +
367
- _vm._s(_vm.upperLimit) +
368
- "\n\t\t\t\t\t\t"
369
- ),
370
- ]
371
- ),
372
- ])
373
- : _vm._e(),
374
- ],
375
- 2
376
- ),
377
- _vm.validateState
378
- ? _c("i", {
379
- staticClass: "el-input__icon",
380
- class: ["el-input__validateIcon", _vm.validateIcon],
381
- })
382
- : _vm._e(),
383
- ])
384
- : _vm._e(),
385
- _vm.$slots.append
386
- ? _c(
387
- "div",
388
- { staticClass: "el-input-group__append" },
389
- [_vm._t("append")],
390
- 2
391
- )
392
- : _vm._e(),
393
- ]
394
- : _c(
395
- "textarea",
396
- _vm._b(
397
- {
398
- ref: "textarea",
399
- staticClass: "el-textarea__inner",
400
- style: _vm.textareaStyle,
401
- attrs: {
402
- tabindex: _vm.tabindex,
403
- disabled: _vm.inputDisabled,
404
- readonly: _vm.readonly,
405
- autocomplete: _vm.autoComplete || _vm.autocomplete,
406
- "aria-label": _vm.label,
407
- },
408
- on: {
409
- compositionstart: _vm.handleCompositionStart,
410
- compositionupdate: _vm.handleCompositionUpdate,
411
- compositionend: _vm.handleCompositionEnd,
412
- input: _vm.handleInput,
413
- focus: _vm.handleFocus,
414
- blur: _vm.handleBlur,
415
- change: _vm.handleChange,
416
- },
417
- },
418
- "textarea",
419
- _vm.$attrs,
420
- false
421
- )
422
- ),
423
- _vm.isWordLimitVisible && _vm.type === "textarea"
424
- ? _c("span", { staticClass: "el-input__count" }, [
425
- _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit)),
426
- ])
427
- : _vm._e(),
428
- ],
429
- 2
430
- )
431
- }
432
- var staticRenderFns = []
433
- render._withStripped = true
434
-
435
-
436
- // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=048a9cde
437
-
438
- // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
439
- var emitter_ = __webpack_require__(4);
440
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
441
-
442
- // EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"
443
- var migrating_ = __webpack_require__(7);
444
- var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
445
-
446
- // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
447
- var hiddenTextarea = void 0;
448
-
449
- var HIDDEN_STYLE = '\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
450
-
451
- var CONTEXT_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
452
-
453
- function calculateNodeStyling(targetElement) {
454
- var style = window.getComputedStyle(targetElement);
455
-
456
- var boxSizing = style.getPropertyValue('box-sizing');
457
-
458
- var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
459
-
460
- var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
461
-
462
- var contextStyle = CONTEXT_STYLE.map(function (name) {
463
- return name + ':' + style.getPropertyValue(name);
464
- }).join(';');
465
-
466
- return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
467
- }
468
-
469
- function calcTextareaHeight(targetElement) {
470
- var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
471
- var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
472
-
473
- if (!hiddenTextarea) {
474
- hiddenTextarea = document.createElement('textarea');
475
- document.body.appendChild(hiddenTextarea);
476
- }
477
-
478
- var _calculateNodeStyling = calculateNodeStyling(targetElement),
479
- paddingSize = _calculateNodeStyling.paddingSize,
480
- borderSize = _calculateNodeStyling.borderSize,
481
- boxSizing = _calculateNodeStyling.boxSizing,
482
- contextStyle = _calculateNodeStyling.contextStyle;
483
-
484
- hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
485
- hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
486
-
487
- var height = hiddenTextarea.scrollHeight;
488
- var result = {};
489
-
490
- if (boxSizing === 'border-box') {
491
- height = height + borderSize;
492
- } else if (boxSizing === 'content-box') {
493
- height = height - paddingSize;
494
- }
495
-
496
- hiddenTextarea.value = '';
497
- var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
498
-
499
- if (minRows !== null) {
500
- var minHeight = singleRowHeight * minRows;
501
- if (boxSizing === 'border-box') {
502
- minHeight = minHeight + paddingSize + borderSize;
503
- }
504
- height = Math.max(minHeight, height);
505
- result.minHeight = minHeight + 'px';
506
- }
507
- if (maxRows !== null) {
508
- var maxHeight = singleRowHeight * maxRows;
509
- if (boxSizing === 'border-box') {
510
- maxHeight = maxHeight + paddingSize + borderSize;
511
- }
512
- height = Math.min(maxHeight, height);
513
- }
514
- result.height = height + 'px';
515
- hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
516
- hiddenTextarea = null;
517
- return result;
518
- };
519
- // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
520
- var merge_ = __webpack_require__(6);
521
- var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
522
-
523
- // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
524
- var shared_ = __webpack_require__(11);
525
-
526
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=script&lang=js
527
- //
528
- //
529
- //
530
- //
531
- //
532
- //
533
- //
534
- //
535
- //
536
- //
537
- //
538
- //
539
- //
540
- //
541
- //
542
- //
543
- //
544
- //
545
- //
546
- //
547
- //
548
- //
549
- //
550
- //
551
- //
552
- //
553
- //
554
- //
555
- //
556
- //
557
- //
558
- //
559
- //
560
- //
561
- //
562
- //
563
- //
564
- //
565
- //
566
- //
567
- //
568
- //
569
- //
570
- //
571
- //
572
- //
573
- //
574
- //
575
- //
576
- //
577
- //
578
- //
579
- //
580
- //
581
- //
582
- //
583
- //
584
- //
585
- //
586
- //
587
- //
588
- //
589
- //
590
- //
591
- //
592
- //
593
- //
594
- //
595
- //
596
- //
597
- //
598
- //
599
- //
600
- //
601
- //
602
- //
603
- //
604
- //
605
- //
606
- //
607
- //
608
- //
609
- //
610
- //
611
- //
612
- //
613
- //
614
- //
615
- //
616
- //
617
- //
618
- //
619
- //
620
- //
621
- //
622
- //
623
- //
624
- //
625
- //
626
- //
627
- //
628
- //
629
- //
630
- //
631
- //
632
- //
633
- //
634
- //
635
- //
636
-
637
-
638
-
639
-
640
-
641
-
642
-
643
- /* harmony default export */ var inputvue_type_script_lang_js = ({
644
- name: 'ElInput',
645
-
646
- componentName: 'ElInput',
647
-
648
- mixins: [emitter_default.a, migrating_default.a],
649
-
650
- inheritAttrs: false,
651
-
652
- inject: {
653
- elForm: {
654
- default: ''
655
- },
656
- elFormItem: {
657
- default: ''
658
- }
659
- },
660
-
661
- data: function data() {
662
- return {
663
- textareaCalcStyle: {},
664
- hovering: false,
665
- focused: false,
666
- isComposing: false,
667
- passwordVisible: false
668
- };
669
- },
670
-
671
-
672
- props: {
673
- value: [String, Number],
674
- size: String,
675
- resize: String,
676
- form: String,
677
- disabled: Boolean,
678
- readonly: Boolean,
679
- type: {
680
- type: String,
681
- default: 'text'
682
- },
683
- autosize: {
684
- type: [Boolean, Object],
685
- default: false
686
- },
687
- autocomplete: {
688
- type: String,
689
- default: 'off'
690
- },
691
- /** @Deprecated in next major version */
692
- autoComplete: {
693
- type: String,
694
- validator: function validator(val) {
695
- false && false;
696
- return true;
697
- }
698
- },
699
- validateEvent: {
700
- type: Boolean,
701
- default: true
702
- },
703
- suffixIcon: String,
704
- prefixIcon: String,
705
- label: String,
706
- clearable: {
707
- type: Boolean,
708
- default: false
709
- },
710
- showPassword: {
711
- type: Boolean,
712
- default: false
713
- },
714
- showWordLimit: {
715
- type: Boolean,
716
- default: false
717
- },
718
- tabindex: String
719
- },
720
-
721
- computed: {
722
- _elFormItemSize: function _elFormItemSize() {
723
- return (this.elFormItem || {}).elFormItemSize;
724
- },
725
- validateState: function validateState() {
726
- return this.elFormItem ? this.elFormItem.validateState : '';
727
- },
728
- needStatusIcon: function needStatusIcon() {
729
- return this.elForm ? this.elForm.statusIcon : false;
730
- },
731
- validateIcon: function validateIcon() {
732
- return {
733
- validating: 'el-icon-loading',
734
- success: 'el-icon-circle-check',
735
- error: 'el-icon-circle-close'
736
- }[this.validateState];
737
- },
738
- textareaStyle: function textareaStyle() {
739
- return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
740
- },
741
- inputSize: function inputSize() {
742
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
743
- },
744
- inputDisabled: function inputDisabled() {
745
- return this.disabled || (this.elForm || {}).disabled;
746
- },
747
- nativeInputValue: function nativeInputValue() {
748
- return this.value === null || this.value === undefined ? '' : String(this.value);
749
- },
750
- showClear: function showClear() {
751
- return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
752
- },
753
- showPwdVisible: function showPwdVisible() {
754
- return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
755
- },
756
- isWordLimitVisible: function isWordLimitVisible() {
757
- return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
758
- },
759
- upperLimit: function upperLimit() {
760
- return this.$attrs.maxlength;
761
- },
762
- textLength: function textLength() {
763
- if (typeof this.value === 'number') {
764
- return String(this.value).length;
765
- }
766
-
767
- return (this.value || '').length;
768
- },
769
- inputExceed: function inputExceed() {
770
- // show exceed style if length of initial value greater then maxlength
771
- return this.isWordLimitVisible && this.textLength > this.upperLimit;
772
- }
773
- },
774
-
775
- watch: {
776
- value: function value(val) {
777
- this.$nextTick(this.resizeTextarea);
778
- if (this.validateEvent) {
779
- this.dispatch('ElFormItem', 'el.form.change', [val]);
780
- }
781
- },
782
-
783
- // native input value is set explicitly
784
- // do not use v-model / :value in template
785
- // see: https://github.com/ElemeFE/element/issues/14521
786
- nativeInputValue: function nativeInputValue() {
787
- this.setNativeInputValue();
788
- },
789
-
790
- // when change between <input> and <textarea>,
791
- // update DOM dependent value and styles
792
- // https://github.com/ElemeFE/element/issues/14857
793
- type: function type() {
794
- var _this = this;
795
-
796
- this.$nextTick(function () {
797
- _this.setNativeInputValue();
798
- _this.resizeTextarea();
799
- _this.updateIconOffset();
800
- });
801
- }
802
- },
803
-
804
- methods: {
805
- focus: function focus() {
806
- this.getInput().focus();
807
- },
808
- blur: function blur() {
809
- this.getInput().blur();
810
- },
811
- getMigratingConfig: function getMigratingConfig() {
812
- return {
813
- props: {
814
- 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
815
- 'on-icon-click': 'on-icon-click is removed.'
816
- },
817
- events: {
818
- 'click': 'click is removed.'
819
- }
820
- };
821
- },
822
- handleBlur: function handleBlur(event) {
823
- this.focused = false;
824
- this.$emit('blur', event);
825
- if (this.validateEvent) {
826
- this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
827
- }
828
- },
829
- select: function select() {
830
- this.getInput().select();
831
- },
832
- resizeTextarea: function resizeTextarea() {
833
- if (this.$isServer) return;
834
- var autosize = this.autosize,
835
- type = this.type;
836
-
837
- if (type !== 'textarea') return;
838
- if (!autosize) {
839
- this.textareaCalcStyle = {
840
- minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
841
- };
842
- return;
843
- }
844
- var minRows = autosize.minRows;
845
- var maxRows = autosize.maxRows;
846
-
847
- this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
848
- },
849
- setNativeInputValue: function setNativeInputValue() {
850
- var input = this.getInput();
851
- if (!input) return;
852
- if (input.value === this.nativeInputValue) return;
853
- input.value = this.nativeInputValue;
854
- },
855
- handleFocus: function handleFocus(event) {
856
- this.focused = true;
857
- this.$emit('focus', event);
858
- },
859
- handleCompositionStart: function handleCompositionStart(event) {
860
- this.$emit('compositionstart', event);
861
- this.isComposing = true;
862
- },
863
- handleCompositionUpdate: function handleCompositionUpdate(event) {
864
- this.$emit('compositionupdate', event);
865
- var text = event.target.value;
866
- var lastCharacter = text[text.length - 1] || '';
867
- this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
868
- },
869
- handleCompositionEnd: function handleCompositionEnd(event) {
870
- this.$emit('compositionend', event);
871
- if (this.isComposing) {
872
- this.isComposing = false;
873
- this.handleInput(event);
874
- }
875
- },
876
- handleInput: function handleInput(event) {
877
- // should not emit input during composition
878
- // see: https://github.com/ElemeFE/element/issues/10516
879
- if (this.isComposing) return;
880
-
881
- // hack for https://github.com/ElemeFE/element/issues/8548
882
- // should remove the following line when we don't support IE
883
- if (event.target.value === this.nativeInputValue) return;
884
-
885
- this.$emit('input', event.target.value);
886
-
887
- // ensure native input value is controlled
888
- // see: https://github.com/ElemeFE/element/issues/12850
889
- this.$nextTick(this.setNativeInputValue);
890
- },
891
- handleChange: function handleChange(event) {
892
- this.$emit('change', event.target.value);
893
- },
894
- calcIconOffset: function calcIconOffset(place) {
895
- var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
896
- if (!elList.length) return;
897
- var el = null;
898
- for (var i = 0; i < elList.length; i++) {
899
- if (elList[i].parentNode === this.$el) {
900
- el = elList[i];
901
- break;
902
- }
903
- }
904
- if (!el) return;
905
- var pendantMap = {
906
- suffix: 'append',
907
- prefix: 'prepend'
908
- };
909
-
910
- var pendant = pendantMap[place];
911
- if (this.$slots[pendant]) {
912
- el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
913
- } else {
914
- el.removeAttribute('style');
915
- }
916
- },
917
- updateIconOffset: function updateIconOffset() {
918
- this.calcIconOffset('prefix');
919
- this.calcIconOffset('suffix');
920
- },
921
- clear: function clear() {
922
- this.$emit('input', '');
923
- this.$emit('change', '');
924
- this.$emit('clear');
925
- },
926
- handlePasswordVisible: function handlePasswordVisible() {
927
- var _this2 = this;
928
-
929
- this.passwordVisible = !this.passwordVisible;
930
- this.$nextTick(function () {
931
- _this2.focus();
932
- });
933
- },
934
- getInput: function getInput() {
935
- return this.$refs.input || this.$refs.textarea;
936
- },
937
- getSuffixVisible: function getSuffixVisible() {
938
- return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
939
- }
940
- },
941
-
942
- created: function created() {
943
- this.$on('inputSelect', this.select);
944
- },
945
- mounted: function mounted() {
946
- this.setNativeInputValue();
947
- this.resizeTextarea();
948
- this.updateIconOffset();
949
- },
950
- updated: function updated() {
951
- this.$nextTick(this.updateIconOffset);
952
- }
953
- });
954
- // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js
955
- /* harmony default export */ var src_inputvue_type_script_lang_js = (inputvue_type_script_lang_js);
956
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
957
- var componentNormalizer = __webpack_require__(0);
958
-
959
- // CONCATENATED MODULE: ./packages/input/src/input.vue
960
-
961
-
962
-
963
-
964
-
965
- /* normalize component */
966
-
967
- var component = Object(componentNormalizer["a" /* default */])(
968
- src_inputvue_type_script_lang_js,
969
- render,
970
- staticRenderFns,
971
- false,
972
- null,
973
- null,
974
- null
975
-
976
- )
977
-
978
- /* harmony default export */ var input = (component.exports);
979
- // CONCATENATED MODULE: ./packages/input/index.js
980
-
981
-
982
- /* istanbul ignore next */
983
- input.install = function (Vue) {
984
- Vue.component(input.name, input);
985
- };
986
-
987
- /* harmony default export */ var packages_input = __webpack_exports__["default"] = (input);
988
-
989
- /***/ }),
990
-
991
- /***/ 14:
992
- /***/ (function(module, exports) {
993
-
994
- module.exports = require("element-ui/lib/utils/clickoutside");
995
-
996
- /***/ }),
997
-
998
- /***/ 17:
999
- /***/ (function(module, exports) {
1000
-
1001
- module.exports = require("element-ui/lib/utils/scrollbar-width");
1002
-
1003
- /***/ }),
1004
-
1005
- /***/ 18:
1006
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1007
-
1008
- "use strict";
1009
- // ESM COMPAT FLAG
1010
- __webpack_require__.r(__webpack_exports__);
1011
-
1012
- // EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
1013
- var resize_event_ = __webpack_require__(10);
1014
-
1015
- // EXTERNAL MODULE: external "element-ui/lib/utils/scrollbar-width"
1016
- var scrollbar_width_ = __webpack_require__(17);
1017
- var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
1018
-
1019
- // EXTERNAL MODULE: external "element-ui/lib/utils/util"
1020
- var util_ = __webpack_require__(3);
1021
-
1022
- // EXTERNAL MODULE: external "element-ui/lib/utils/dom"
1023
- var dom_ = __webpack_require__(1);
1024
-
1025
- // CONCATENATED MODULE: ./packages/scrollbar/src/util.js
1026
- var BAR_MAP = {
1027
- vertical: {
1028
- offset: 'offsetHeight',
1029
- scroll: 'scrollTop',
1030
- scrollSize: 'scrollHeight',
1031
- size: 'height',
1032
- key: 'vertical',
1033
- axis: 'Y',
1034
- client: 'clientY',
1035
- direction: 'top'
1036
- },
1037
- horizontal: {
1038
- offset: 'offsetWidth',
1039
- scroll: 'scrollLeft',
1040
- scrollSize: 'scrollWidth',
1041
- size: 'width',
1042
- key: 'horizontal',
1043
- axis: 'X',
1044
- client: 'clientX',
1045
- direction: 'left'
1046
- }
1047
- };
1048
-
1049
- function renderThumbStyle(_ref) {
1050
- var move = _ref.move,
1051
- size = _ref.size,
1052
- bar = _ref.bar;
1053
-
1054
- var style = {};
1055
- var translate = 'translate' + bar.axis + '(' + move + '%)';
1056
-
1057
- style[bar.size] = size;
1058
- style.transform = translate;
1059
- style.msTransform = translate;
1060
- style.webkitTransform = translate;
1061
-
1062
- return style;
1063
- };
1064
- // CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
1065
-
1066
-
1067
-
1068
- /* istanbul ignore next */
1069
- /* harmony default export */ var src_bar = ({
1070
- name: 'Bar',
1071
-
1072
- props: {
1073
- vertical: Boolean,
1074
- size: String,
1075
- move: Number
1076
- },
1077
-
1078
- computed: {
1079
- bar: function bar() {
1080
- return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
1081
- },
1082
- wrap: function wrap() {
1083
- return this.$parent.wrap;
1084
- }
1085
- },
1086
-
1087
- render: function render(h) {
1088
- var size = this.size,
1089
- move = this.move,
1090
- bar = this.bar;
1091
-
1092
-
1093
- return h(
1094
- 'div',
1095
- {
1096
- 'class': ['el-scrollbar__bar', 'is-' + bar.key],
1097
- on: {
1098
- 'mousedown': this.clickTrackHandler
1099
- }
1100
- },
1101
- [h('div', {
1102
- ref: 'thumb',
1103
- 'class': 'el-scrollbar__thumb',
1104
- on: {
1105
- 'mousedown': this.clickThumbHandler
1106
- },
1107
-
1108
- style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
1109
- );
1110
- },
1111
-
1112
-
1113
- methods: {
1114
- clickThumbHandler: function clickThumbHandler(e) {
1115
- // prevent click event of right button
1116
- if (e.ctrlKey || e.button === 2) {
1117
- return;
1118
- }
1119
- this.startDrag(e);
1120
- this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
1121
- },
1122
- clickTrackHandler: function clickTrackHandler(e) {
1123
- var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
1124
- var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
1125
- var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
1126
-
1127
- this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
1128
- },
1129
- startDrag: function startDrag(e) {
1130
- e.stopImmediatePropagation();
1131
- this.cursorDown = true;
1132
-
1133
- Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
1134
- Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
1135
- document.onselectstart = function () {
1136
- return false;
1137
- };
1138
- },
1139
- mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
1140
- if (this.cursorDown === false) return;
1141
- var prevPage = this[this.bar.axis];
1142
-
1143
- if (!prevPage) return;
1144
-
1145
- var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
1146
- var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
1147
- var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
1148
-
1149
- this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
1150
- },
1151
- mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
1152
- this.cursorDown = false;
1153
- this[this.bar.axis] = 0;
1154
- Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
1155
- document.onselectstart = null;
1156
- }
1157
- },
1158
-
1159
- destroyed: function destroyed() {
1160
- Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
1161
- }
1162
- });
1163
- // CONCATENATED MODULE: ./packages/scrollbar/src/main.js
1164
- // reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
1165
-
1166
-
1167
-
1168
-
1169
-
1170
-
1171
- /* istanbul ignore next */
1172
- /* harmony default export */ var main = ({
1173
- name: 'ElScrollbar',
1174
-
1175
- components: { Bar: src_bar },
1176
-
1177
- props: {
1178
- native: Boolean,
1179
- wrapStyle: {},
1180
- wrapClass: {},
1181
- viewClass: {},
1182
- viewStyle: {},
1183
- noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
1184
- tag: {
1185
- type: String,
1186
- default: 'div'
1187
- }
1188
- },
1189
-
1190
- data: function data() {
1191
- return {
1192
- sizeWidth: '0',
1193
- sizeHeight: '0',
1194
- moveX: 0,
1195
- moveY: 0
1196
- };
1197
- },
1198
-
1199
-
1200
- computed: {
1201
- wrap: function wrap() {
1202
- return this.$refs.wrap;
1203
- }
1204
- },
1205
-
1206
- render: function render(h) {
1207
- var gutter = scrollbar_width_default()();
1208
- var style = this.wrapStyle;
1209
-
1210
- if (gutter) {
1211
- var gutterWith = '-' + gutter + 'px';
1212
- var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
1213
-
1214
- if (Array.isArray(this.wrapStyle)) {
1215
- style = Object(util_["toObject"])(this.wrapStyle);
1216
- style.marginRight = style.marginBottom = gutterWith;
1217
- } else if (typeof this.wrapStyle === 'string') {
1218
- style += gutterStyle;
1219
- } else {
1220
- style = gutterStyle;
1221
- }
1222
- }
1223
- var view = h(this.tag, {
1224
- class: ['el-scrollbar__view', this.viewClass],
1225
- style: this.viewStyle,
1226
- ref: 'resize'
1227
- }, this.$slots.default);
1228
- var wrap = h(
1229
- 'div',
1230
- {
1231
- ref: 'wrap',
1232
- style: style,
1233
- on: {
1234
- 'scroll': this.handleScroll
1235
- },
1236
-
1237
- 'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
1238
- [[view]]
1239
- );
1240
- var nodes = void 0;
1241
-
1242
- if (!this.native) {
1243
- nodes = [wrap, h(src_bar, {
1244
- attrs: {
1245
- move: this.moveX,
1246
- size: this.sizeWidth }
1247
- }), h(src_bar, {
1248
- attrs: {
1249
- vertical: true,
1250
- move: this.moveY,
1251
- size: this.sizeHeight }
1252
- })];
1253
- } else {
1254
- nodes = [h(
1255
- 'div',
1256
- {
1257
- ref: 'wrap',
1258
- 'class': [this.wrapClass, 'el-scrollbar__wrap'],
1259
- style: style },
1260
- [[view]]
1261
- )];
1262
- }
1263
- return h('div', { class: 'el-scrollbar' }, nodes);
1264
- },
1265
-
1266
-
1267
- methods: {
1268
- handleScroll: function handleScroll() {
1269
- var wrap = this.wrap;
1270
-
1271
- this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
1272
- this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
1273
- },
1274
- update: function update() {
1275
- var heightPercentage = void 0,
1276
- widthPercentage = void 0;
1277
- var wrap = this.wrap;
1278
- if (!wrap) return;
1279
-
1280
- heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
1281
- widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
1282
-
1283
- this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
1284
- this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
1285
- }
1286
- },
1287
-
1288
- mounted: function mounted() {
1289
- if (this.native) return;
1290
- this.$nextTick(this.update);
1291
- !this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
1292
- },
1293
- beforeDestroy: function beforeDestroy() {
1294
- if (this.native) return;
1295
- !this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
1296
- }
1297
- });
1298
- // CONCATENATED MODULE: ./packages/scrollbar/index.js
1299
-
1300
-
1301
- /* istanbul ignore next */
1302
- main.install = function (Vue) {
1303
- Vue.component(main.name, main);
1304
- };
1305
-
1306
- /* harmony default export */ var scrollbar = __webpack_exports__["default"] = (main);
1307
-
1308
- /***/ }),
1309
-
1310
- /***/ 2:
1311
- /***/ (function(module, exports) {
1312
-
1313
- module.exports = require("element-ui/lib/utils/date-util");
1314
-
1315
- /***/ }),
1316
-
1317
- /***/ 26:
1318
- /***/ (function(module, exports) {
1319
-
1320
- module.exports = require("element-ui/lib/utils/scroll-into-view");
1321
-
1322
- /***/ }),
1323
-
1324
- /***/ 3:
1325
- /***/ (function(module, exports) {
1326
-
1327
- module.exports = require("element-ui/lib/utils/util");
1328
-
1329
- /***/ }),
1330
-
1331
- /***/ 35:
1332
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1333
-
1334
- "use strict";
1335
-
1336
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=template&id=2d3bd15e
1337
- var render = function () {
1338
- var _vm = this
1339
- var _h = _vm.$createElement
1340
- var _c = _vm._self._c || _h
1341
- return !_vm.ranged
1342
- ? _c(
1343
- "el-input",
1344
- _vm._b(
1345
- {
1346
- directives: [
1347
- {
1348
- name: "clickoutside",
1349
- rawName: "v-clickoutside",
1350
- value: _vm.handleClose,
1351
- expression: "handleClose",
1352
- },
1353
- ],
1354
- ref: "reference",
1355
- staticClass: "el-date-editor",
1356
- class: "el-date-editor--" + _vm.type,
1357
- attrs: {
1358
- readonly:
1359
- !_vm.editable ||
1360
- _vm.readonly ||
1361
- _vm.type === "dates" ||
1362
- _vm.type === "week" ||
1363
- _vm.type === "years" ||
1364
- _vm.type === "months",
1365
- disabled: _vm.pickerDisabled,
1366
- size: _vm.pickerSize,
1367
- name: _vm.name,
1368
- placeholder: _vm.placeholder,
1369
- value: _vm.displayValue,
1370
- validateEvent: false,
1371
- },
1372
- on: {
1373
- focus: _vm.handleFocus,
1374
- input: function (value) {
1375
- return (_vm.userInput = value)
1376
- },
1377
- change: _vm.handleChange,
1378
- },
1379
- nativeOn: {
1380
- keydown: function ($event) {
1381
- return _vm.handleKeydown($event)
1382
- },
1383
- mouseenter: function ($event) {
1384
- return _vm.handleMouseEnter($event)
1385
- },
1386
- mouseleave: function ($event) {
1387
- _vm.showClose = false
1388
- },
1389
- },
1390
- },
1391
- "el-input",
1392
- _vm.firstInputId,
1393
- false
1394
- ),
1395
- [
1396
- _c("i", {
1397
- staticClass: "el-input__icon",
1398
- class: _vm.triggerClass,
1399
- attrs: { slot: "prefix" },
1400
- on: { click: _vm.handleFocus },
1401
- slot: "prefix",
1402
- }),
1403
- _vm.haveTrigger
1404
- ? _c("i", {
1405
- staticClass: "el-input__icon",
1406
- class: [_vm.showClose ? "" + _vm.clearIcon : ""],
1407
- attrs: { slot: "suffix" },
1408
- on: { click: _vm.handleClickIcon },
1409
- slot: "suffix",
1410
- })
1411
- : _vm._e(),
1412
- ]
1413
- )
1414
- : _c(
1415
- "div",
1416
- {
1417
- directives: [
1418
- {
1419
- name: "clickoutside",
1420
- rawName: "v-clickoutside",
1421
- value: _vm.handleClose,
1422
- expression: "handleClose",
1423
- },
1424
- ],
1425
- ref: "reference",
1426
- staticClass: "el-date-editor el-range-editor el-input__inner",
1427
- class: [
1428
- "el-date-editor--" + _vm.type,
1429
- _vm.pickerSize ? "el-range-editor--" + _vm.pickerSize : "",
1430
- _vm.pickerDisabled ? "is-disabled" : "",
1431
- _vm.pickerVisible ? "is-active" : "",
1432
- ],
1433
- on: {
1434
- click: _vm.handleRangeClick,
1435
- mouseenter: _vm.handleMouseEnter,
1436
- mouseleave: function ($event) {
1437
- _vm.showClose = false
1438
- },
1439
- keydown: _vm.handleKeydown,
1440
- },
1441
- },
1442
- [
1443
- _c("i", {
1444
- class: ["el-input__icon", "el-range__icon", _vm.triggerClass],
1445
- }),
1446
- _c(
1447
- "input",
1448
- _vm._b(
1449
- {
1450
- staticClass: "el-range-input",
1451
- attrs: {
1452
- autocomplete: "off",
1453
- placeholder: _vm.startPlaceholder,
1454
- disabled: _vm.pickerDisabled,
1455
- readonly: !_vm.editable || _vm.readonly,
1456
- name: _vm.name && _vm.name[0],
1457
- },
1458
- domProps: { value: _vm.displayValue && _vm.displayValue[0] },
1459
- on: {
1460
- input: _vm.handleStartInput,
1461
- change: _vm.handleStartChange,
1462
- focus: _vm.handleFocus,
1463
- },
1464
- },
1465
- "input",
1466
- _vm.firstInputId,
1467
- false
1468
- )
1469
- ),
1470
- _vm._t("range-separator", [
1471
- _c("span", { staticClass: "el-range-separator" }, [
1472
- _vm._v(_vm._s(_vm.rangeSeparator)),
1473
- ]),
1474
- ]),
1475
- _c(
1476
- "input",
1477
- _vm._b(
1478
- {
1479
- staticClass: "el-range-input",
1480
- attrs: {
1481
- autocomplete: "off",
1482
- placeholder: _vm.endPlaceholder,
1483
- disabled: _vm.pickerDisabled,
1484
- readonly: !_vm.editable || _vm.readonly,
1485
- name: _vm.name && _vm.name[1],
1486
- },
1487
- domProps: { value: _vm.displayValue && _vm.displayValue[1] },
1488
- on: {
1489
- input: _vm.handleEndInput,
1490
- change: _vm.handleEndChange,
1491
- focus: _vm.handleFocus,
1492
- },
1493
- },
1494
- "input",
1495
- _vm.secondInputId,
1496
- false
1497
- )
1498
- ),
1499
- _vm.haveTrigger
1500
- ? _c("i", {
1501
- staticClass: "el-input__icon el-range__close-icon",
1502
- class: [_vm.showClose ? "" + _vm.clearIcon : ""],
1503
- on: { click: _vm.handleClickIcon },
1504
- })
1505
- : _vm._e(),
1506
- ],
1507
- 2
1508
- )
1509
- }
1510
- var staticRenderFns = []
1511
- render._withStripped = true
1512
-
1513
-
1514
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=2d3bd15e
1515
-
1516
- // EXTERNAL MODULE: external "vue"
1517
- var external_vue_ = __webpack_require__(8);
1518
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
1519
-
1520
- // EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside"
1521
- var clickoutside_ = __webpack_require__(14);
1522
- var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
1523
-
1524
- // EXTERNAL MODULE: external "element-ui/lib/utils/date-util"
1525
- var date_util_ = __webpack_require__(2);
1526
-
1527
- // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
1528
- var vue_popper_ = __webpack_require__(5);
1529
- var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
1530
-
1531
- // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
1532
- var emitter_ = __webpack_require__(4);
1533
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
1534
-
1535
- // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
1536
- var input = __webpack_require__(13);
1537
-
1538
- // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
1539
- var merge_ = __webpack_require__(6);
1540
- var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
1541
-
1542
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=script&lang=js
1543
- //
1544
- //
1545
- //
1546
- //
1547
- //
1548
- //
1549
- //
1550
- //
1551
- //
1552
- //
1553
- //
1554
- //
1555
- //
1556
- //
1557
- //
1558
- //
1559
- //
1560
- //
1561
- //
1562
- //
1563
- //
1564
- //
1565
- //
1566
- //
1567
- //
1568
- //
1569
- //
1570
- //
1571
- //
1572
- //
1573
- //
1574
- //
1575
- //
1576
- //
1577
- //
1578
- //
1579
- //
1580
- //
1581
- //
1582
- //
1583
- //
1584
- //
1585
- //
1586
- //
1587
- //
1588
- //
1589
- //
1590
- //
1591
- //
1592
- //
1593
- //
1594
- //
1595
- //
1596
- //
1597
- //
1598
- //
1599
- //
1600
- //
1601
- //
1602
- //
1603
- //
1604
- //
1605
- //
1606
- //
1607
- //
1608
- //
1609
- //
1610
- //
1611
- //
1612
- //
1613
- //
1614
- //
1615
- //
1616
- //
1617
- //
1618
- //
1619
- //
1620
- //
1621
- //
1622
- //
1623
- //
1624
- //
1625
- //
1626
- //
1627
- //
1628
-
1629
-
1630
-
1631
-
1632
-
1633
-
1634
-
1635
-
1636
-
1637
- var NewPopper = {
1638
- props: {
1639
- appendToBody: vue_popper_default.a.props.appendToBody,
1640
- offset: vue_popper_default.a.props.offset,
1641
- boundariesPadding: vue_popper_default.a.props.boundariesPadding,
1642
- arrowOffset: vue_popper_default.a.props.arrowOffset,
1643
- transformOrigin: vue_popper_default.a.props.transformOrigin
1644
- },
1645
- methods: vue_popper_default.a.methods,
1646
- data: function data() {
1647
- return merge_default()({ visibleArrow: true }, vue_popper_default.a.data);
1648
- },
1649
-
1650
- beforeDestroy: vue_popper_default.a.beforeDestroy
1651
- };
1652
-
1653
- var DEFAULT_FORMATS = {
1654
- date: 'yyyy-MM-dd',
1655
- month: 'yyyy-MM',
1656
- months: 'yyyy-MM',
1657
- datetime: 'yyyy-MM-dd HH:mm:ss',
1658
- time: 'HH:mm:ss',
1659
- week: 'yyyywWW',
1660
- timerange: 'HH:mm:ss',
1661
- daterange: 'yyyy-MM-dd',
1662
- monthrange: 'yyyy-MM',
1663
- datetimerange: 'yyyy-MM-dd HH:mm:ss',
1664
- year: 'yyyy',
1665
- years: 'yyyy'
1666
- };
1667
- var HAVE_TRIGGER_TYPES = ['date', 'datetime', 'time', 'time-select', 'week', 'month', 'year', 'daterange', 'monthrange', 'timerange', 'datetimerange', 'dates', 'months', 'years'];
1668
- var pickervue_type_script_lang_js_DATE_FORMATTER = function DATE_FORMATTER(value, format) {
1669
- if (format === 'timestamp') return value.getTime();
1670
- return Object(date_util_["formatDate"])(value, format);
1671
- };
1672
- var pickervue_type_script_lang_js_DATE_PARSER = function DATE_PARSER(text, format) {
1673
- if (format === 'timestamp') return new Date(Number(text));
1674
- return Object(date_util_["parseDate"])(text, format);
1675
- };
1676
- var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
1677
- if (Array.isArray(value) && value.length === 2) {
1678
- var start = value[0];
1679
- var end = value[1];
1680
-
1681
- if (start && end) {
1682
- return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
1683
- }
1684
- }
1685
- return '';
1686
- };
1687
- var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
1688
- if (!Array.isArray(array)) {
1689
- array = array.split(separator);
1690
- }
1691
- if (array.length === 2) {
1692
- var range1 = array[0];
1693
- var range2 = array[1];
1694
-
1695
- return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
1696
- }
1697
- return [];
1698
- };
1699
- var TYPE_VALUE_RESOLVER_MAP = {
1700
- default: {
1701
- formatter: function formatter(value) {
1702
- if (!value) return '';
1703
- return '' + value;
1704
- },
1705
- parser: function parser(text) {
1706
- if (text === undefined || text === '') return null;
1707
- return text;
1708
- }
1709
- },
1710
- week: {
1711
- formatter: function formatter(value, format) {
1712
- var week = Object(date_util_["getWeekNumber"])(value);
1713
- var month = value.getMonth();
1714
- var trueDate = new Date(value);
1715
- if (week === 1 && month === 11) {
1716
- trueDate.setHours(0, 0, 0, 0);
1717
- trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
1718
- }
1719
- var date = Object(date_util_["formatDate"])(trueDate, format);
1720
-
1721
- date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
1722
- return date;
1723
- },
1724
- parser: function parser(text, format) {
1725
- // parse as if a normal date
1726
- return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
1727
- }
1728
- },
1729
- date: {
1730
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1731
- parser: pickervue_type_script_lang_js_DATE_PARSER
1732
- },
1733
- datetime: {
1734
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1735
- parser: pickervue_type_script_lang_js_DATE_PARSER
1736
- },
1737
- daterange: {
1738
- formatter: RANGE_FORMATTER,
1739
- parser: RANGE_PARSER
1740
- },
1741
- monthrange: {
1742
- formatter: RANGE_FORMATTER,
1743
- parser: RANGE_PARSER
1744
- },
1745
- datetimerange: {
1746
- formatter: RANGE_FORMATTER,
1747
- parser: RANGE_PARSER
1748
- },
1749
- timerange: {
1750
- formatter: RANGE_FORMATTER,
1751
- parser: RANGE_PARSER
1752
- },
1753
- time: {
1754
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1755
- parser: pickervue_type_script_lang_js_DATE_PARSER
1756
- },
1757
- month: {
1758
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1759
- parser: pickervue_type_script_lang_js_DATE_PARSER
1760
- },
1761
- year: {
1762
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1763
- parser: pickervue_type_script_lang_js_DATE_PARSER
1764
- },
1765
- number: {
1766
- formatter: function formatter(value) {
1767
- if (!value) return '';
1768
- return '' + value;
1769
- },
1770
- parser: function parser(text) {
1771
- var result = Number(text);
1772
-
1773
- if (!isNaN(text)) {
1774
- return result;
1775
- } else {
1776
- return null;
1777
- }
1778
- }
1779
- },
1780
- dates: {
1781
- formatter: function formatter(value, format) {
1782
- return value.map(function (date) {
1783
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
1784
- });
1785
- },
1786
- parser: function parser(value, format) {
1787
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
1788
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
1789
- });
1790
- }
1791
- },
1792
- months: {
1793
- formatter: function formatter(value, format) {
1794
- return value.map(function (date) {
1795
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
1796
- });
1797
- },
1798
- parser: function parser(value, format) {
1799
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
1800
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
1801
- });
1802
- }
1803
- },
1804
- years: {
1805
- formatter: function formatter(value, format) {
1806
- return value.map(function (date) {
1807
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
1808
- });
1809
- },
1810
- parser: function parser(value, format) {
1811
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
1812
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
1813
- });
1814
- }
1815
- }
1816
- };
1817
- var PLACEMENT_MAP = {
1818
- left: 'bottom-start',
1819
- center: 'bottom',
1820
- right: 'bottom-end'
1821
- };
1822
-
1823
- var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
1824
- var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
1825
-
1826
- if (!value) return null;
1827
- var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
1828
- var format = customFormat || DEFAULT_FORMATS[type];
1829
- return parser(value, format, rangeSeparator);
1830
- };
1831
-
1832
- var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
1833
- if (!value) return null;
1834
- var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
1835
- var format = customFormat || DEFAULT_FORMATS[type];
1836
- return formatter(value, format);
1837
- };
1838
-
1839
- /*
1840
- * Considers:
1841
- * 1. Date object
1842
- * 2. date string
1843
- * 3. array of 1 or 2
1844
- */
1845
- var valueEquals = function valueEquals(a, b) {
1846
- // considers Date object and string
1847
- var dateEquals = function dateEquals(a, b) {
1848
- var aIsDate = a instanceof Date;
1849
- var bIsDate = b instanceof Date;
1850
- if (aIsDate && bIsDate) {
1851
- return a.getTime() === b.getTime();
1852
- }
1853
- if (!aIsDate && !bIsDate) {
1854
- return a === b;
1855
- }
1856
- return false;
1857
- };
1858
-
1859
- var aIsArray = a instanceof Array;
1860
- var bIsArray = b instanceof Array;
1861
- if (aIsArray && bIsArray) {
1862
- if (a.length !== b.length) {
1863
- return false;
1864
- }
1865
- return a.every(function (item, index) {
1866
- return dateEquals(item, b[index]);
1867
- });
1868
- }
1869
- if (!aIsArray && !bIsArray) {
1870
- return dateEquals(a, b);
1871
- }
1872
- return false;
1873
- };
1874
-
1875
- var isString = function isString(val) {
1876
- return typeof val === 'string' || val instanceof String;
1877
- };
1878
-
1879
- var validator = function validator(val) {
1880
- // either: String, Array of String, null / undefined
1881
- return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
1882
- };
1883
-
1884
- /* harmony default export */ var pickervue_type_script_lang_js = ({
1885
- mixins: [emitter_default.a, NewPopper],
1886
-
1887
- inject: {
1888
- elForm: {
1889
- default: ''
1890
- },
1891
- elFormItem: {
1892
- default: ''
1893
- }
1894
- },
1895
-
1896
- props: {
1897
- size: String,
1898
- format: String,
1899
- valueFormat: String,
1900
- readonly: Boolean,
1901
- placeholder: String,
1902
- startPlaceholder: String,
1903
- endPlaceholder: String,
1904
- prefixIcon: String,
1905
- clearIcon: {
1906
- type: String,
1907
- default: 'el-icon-circle-close'
1908
- },
1909
- name: {
1910
- default: '',
1911
- validator: validator
1912
- },
1913
- disabled: Boolean,
1914
- clearable: {
1915
- type: Boolean,
1916
- default: true
1917
- },
1918
- id: {
1919
- default: '',
1920
- validator: validator
1921
- },
1922
- popperClass: String,
1923
- editable: {
1924
- type: Boolean,
1925
- default: true
1926
- },
1927
- align: {
1928
- type: String,
1929
- default: 'left'
1930
- },
1931
- value: {},
1932
- defaultValue: {},
1933
- defaultTime: {},
1934
- rangeSeparator: {
1935
- default: '-'
1936
- },
1937
- pickerOptions: {},
1938
- unlinkPanels: Boolean,
1939
- validateEvent: {
1940
- type: Boolean,
1941
- default: true
1942
- }
1943
- },
1944
-
1945
- components: { ElInput: input["default"] },
1946
-
1947
- directives: { Clickoutside: clickoutside_default.a },
1948
-
1949
- data: function data() {
1950
- return {
1951
- pickerVisible: false,
1952
- showClose: false,
1953
- userInput: null,
1954
- valueOnOpen: null, // value when picker opens, used to determine whether to emit change
1955
- unwatchPickerOptions: null
1956
- };
1957
- },
1958
-
1959
-
1960
- watch: {
1961
- pickerVisible: function pickerVisible(val) {
1962
- if (this.readonly || this.pickerDisabled) return;
1963
- if (val) {
1964
- this.showPicker();
1965
- this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
1966
- } else {
1967
- this.hidePicker();
1968
- this.emitChange(this.value);
1969
- this.userInput = null;
1970
- if (this.validateEvent) {
1971
- this.dispatch('ElFormItem', 'el.form.blur');
1972
- }
1973
- this.$emit('blur', this);
1974
- this.blur();
1975
- }
1976
- },
1977
-
1978
- parsedValue: {
1979
- immediate: true,
1980
- handler: function handler(val) {
1981
- if (this.picker) {
1982
- this.picker.value = val;
1983
- }
1984
- }
1985
- },
1986
- defaultValue: function defaultValue(val) {
1987
- // NOTE: should eventually move to jsx style picker + panel ?
1988
- if (this.picker) {
1989
- this.picker.defaultValue = val;
1990
- }
1991
- },
1992
- value: function value(val, oldVal) {
1993
- if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
1994
- this.dispatch('ElFormItem', 'el.form.change', val);
1995
- }
1996
- }
1997
- },
1998
-
1999
- computed: {
2000
- ranged: function ranged() {
2001
- return this.type.indexOf('range') > -1;
2002
- },
2003
- reference: function reference() {
2004
- var reference = this.$refs.reference;
2005
- return reference.$el || reference;
2006
- },
2007
- refInput: function refInput() {
2008
- if (this.reference) {
2009
- return [].slice.call(this.reference.querySelectorAll('input'));
2010
- }
2011
- return [];
2012
- },
2013
- valueIsEmpty: function valueIsEmpty() {
2014
- var val = this.value;
2015
- if (Array.isArray(val)) {
2016
- for (var i = 0, len = val.length; i < len; i++) {
2017
- if (val[i]) {
2018
- return false;
2019
- }
2020
- }
2021
- } else {
2022
- if (val) {
2023
- return false;
2024
- }
2025
- }
2026
- return true;
2027
- },
2028
- triggerClass: function triggerClass() {
2029
- return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
2030
- },
2031
- selectionMode: function selectionMode() {
2032
- if (this.type === 'week') {
2033
- return 'week';
2034
- } else if (this.type === 'month') {
2035
- return 'month';
2036
- } else if (this.type === 'year') {
2037
- return 'year';
2038
- } else if (this.type === 'dates') {
2039
- return 'dates';
2040
- } else if (this.type === 'months') {
2041
- return 'months';
2042
- } else if (this.type === 'years') {
2043
- return 'years';
2044
- }
2045
-
2046
- return 'day';
2047
- },
2048
- haveTrigger: function haveTrigger() {
2049
- if (typeof this.showTrigger !== 'undefined') {
2050
- return this.showTrigger;
2051
- }
2052
- return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
2053
- },
2054
- displayValue: function displayValue() {
2055
- var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
2056
- if (Array.isArray(this.userInput)) {
2057
- return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
2058
- } else if (this.userInput !== null) {
2059
- return this.userInput;
2060
- } else if (formattedValue) {
2061
- return this.type === 'dates' || this.type === 'years' || this.type === 'months' ? formattedValue.join(', ') : formattedValue;
2062
- } else {
2063
- return '';
2064
- }
2065
- },
2066
- parsedValue: function parsedValue() {
2067
- if (!this.value) return this.value; // component value is not set
2068
- if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
2069
-
2070
- var valueIsDateObject = Object(date_util_["isDateObject"])(this.value) || Array.isArray(this.value) && this.value.every(date_util_["isDateObject"]);
2071
- if (valueIsDateObject) {
2072
- return this.value;
2073
- }
2074
-
2075
- if (this.valueFormat) {
2076
- return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
2077
- }
2078
-
2079
- // NOTE: deal with common but incorrect usage, should remove in next major version
2080
- // user might provide string / timestamp without value-format, coerce them into date (or array of date)
2081
- return Array.isArray(this.value) ? this.value.map(function (val) {
2082
- return new Date(val);
2083
- }) : new Date(this.value);
2084
- },
2085
- _elFormItemSize: function _elFormItemSize() {
2086
- return (this.elFormItem || {}).elFormItemSize;
2087
- },
2088
- pickerSize: function pickerSize() {
2089
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
2090
- },
2091
- pickerDisabled: function pickerDisabled() {
2092
- return this.disabled || (this.elForm || {}).disabled;
2093
- },
2094
- firstInputId: function firstInputId() {
2095
- var obj = {};
2096
- var id = void 0;
2097
- if (this.ranged) {
2098
- id = this.id && this.id[0];
2099
- } else {
2100
- id = this.id;
2101
- }
2102
- if (id) obj.id = id;
2103
- return obj;
2104
- },
2105
- secondInputId: function secondInputId() {
2106
- var obj = {};
2107
- var id = void 0;
2108
- if (this.ranged) {
2109
- id = this.id && this.id[1];
2110
- }
2111
- if (id) obj.id = id;
2112
- return obj;
2113
- }
2114
- },
2115
-
2116
- created: function created() {
2117
- // vue-popper
2118
- this.popperOptions = {
2119
- boundariesPadding: 0,
2120
- gpuAcceleration: false
2121
- };
2122
- this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
2123
-
2124
- this.$on('fieldReset', this.handleFieldReset);
2125
- },
2126
-
2127
-
2128
- methods: {
2129
- focus: function focus() {
2130
- if (!this.ranged) {
2131
- this.$refs.reference.focus();
2132
- } else {
2133
- this.handleFocus();
2134
- }
2135
- },
2136
- blur: function blur() {
2137
- this.refInput.forEach(function (input) {
2138
- return input.blur();
2139
- });
2140
- },
2141
-
2142
-
2143
- // {parse, formatTo} Value deals maps component value with internal Date
2144
- parseValue: function parseValue(value) {
2145
- var isParsed = Object(date_util_["isDateObject"])(value) || Array.isArray(value) && value.every(date_util_["isDateObject"]);
2146
- if (this.valueFormat && !isParsed) {
2147
- return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
2148
- } else {
2149
- return value;
2150
- }
2151
- },
2152
- formatToValue: function formatToValue(date) {
2153
- var isFormattable = Object(date_util_["isDateObject"])(date) || Array.isArray(date) && date.every(date_util_["isDateObject"]);
2154
- if (this.valueFormat && isFormattable) {
2155
- return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
2156
- } else {
2157
- return date;
2158
- }
2159
- },
2160
-
2161
-
2162
- // {parse, formatTo} String deals with user input
2163
- parseString: function parseString(value) {
2164
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
2165
- return parseAsFormatAndType(value, this.format, type);
2166
- },
2167
- formatToString: function formatToString(value) {
2168
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
2169
- return formatAsFormatAndType(value, this.format, type);
2170
- },
2171
- handleMouseEnter: function handleMouseEnter() {
2172
- if (this.readonly || this.pickerDisabled) return;
2173
- if (!this.valueIsEmpty && this.clearable) {
2174
- this.showClose = true;
2175
- }
2176
- },
2177
- handleChange: function handleChange() {
2178
- if (this.userInput) {
2179
- var value = this.parseString(this.displayValue);
2180
- if (value) {
2181
- this.picker.value = value;
2182
- if (this.isValidValue(value)) {
2183
- this.emitInput(value);
2184
- this.userInput = null;
2185
- }
2186
- }
2187
- }
2188
- if (this.userInput === '') {
2189
- this.emitInput(null);
2190
- this.emitChange(null);
2191
- this.userInput = null;
2192
- }
2193
- },
2194
- handleStartInput: function handleStartInput(event) {
2195
- if (this.userInput) {
2196
- this.userInput = [event.target.value, this.userInput[1]];
2197
- } else {
2198
- this.userInput = [event.target.value, null];
2199
- }
2200
- },
2201
- handleEndInput: function handleEndInput(event) {
2202
- if (this.userInput) {
2203
- this.userInput = [this.userInput[0], event.target.value];
2204
- } else {
2205
- this.userInput = [null, event.target.value];
2206
- }
2207
- },
2208
- handleStartChange: function handleStartChange(event) {
2209
- var value = this.parseString(this.userInput && this.userInput[0]);
2210
- if (value) {
2211
- this.userInput = [this.formatToString(value), this.displayValue[1]];
2212
- var newValue = [value, this.picker.value && this.picker.value[1]];
2213
- this.picker.value = newValue;
2214
- if (this.isValidValue(newValue)) {
2215
- this.emitInput(newValue);
2216
- this.userInput = null;
2217
- }
2218
- }
2219
- },
2220
- handleEndChange: function handleEndChange(event) {
2221
- var value = this.parseString(this.userInput && this.userInput[1]);
2222
- if (value) {
2223
- this.userInput = [this.displayValue[0], this.formatToString(value)];
2224
- var newValue = [this.picker.value && this.picker.value[0], value];
2225
- this.picker.value = newValue;
2226
- if (this.isValidValue(newValue)) {
2227
- this.emitInput(newValue);
2228
- this.userInput = null;
2229
- }
2230
- }
2231
- },
2232
- handleClickIcon: function handleClickIcon(event) {
2233
- if (this.readonly || this.pickerDisabled) return;
2234
- if (this.showClose) {
2235
- this.valueOnOpen = this.value;
2236
- event.stopPropagation();
2237
- this.emitInput(null);
2238
- this.emitChange(null);
2239
- this.showClose = false;
2240
- if (this.picker && typeof this.picker.handleClear === 'function') {
2241
- this.picker.handleClear();
2242
- }
2243
- } else {
2244
- this.pickerVisible = !this.pickerVisible;
2245
- }
2246
- },
2247
- handleClose: function handleClose() {
2248
- if (!this.pickerVisible) return;
2249
- this.pickerVisible = false;
2250
-
2251
- if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
2252
- // restore to former value
2253
- var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
2254
- this.emitInput(oldValue);
2255
- }
2256
- },
2257
- handleFieldReset: function handleFieldReset(initialValue) {
2258
- this.userInput = initialValue === '' ? null : initialValue;
2259
- },
2260
- handleFocus: function handleFocus() {
2261
- var type = this.type;
2262
-
2263
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
2264
- this.pickerVisible = true;
2265
- }
2266
- this.$emit('focus', this);
2267
- },
2268
- handleKeydown: function handleKeydown(event) {
2269
- var _this = this;
2270
-
2271
- var keyCode = event.keyCode;
2272
-
2273
- // ESC
2274
- if (keyCode === 27) {
2275
- this.pickerVisible = false;
2276
- event.stopPropagation();
2277
- return;
2278
- }
2279
-
2280
- // Tab
2281
- if (keyCode === 9) {
2282
- if (!this.ranged) {
2283
- this.handleChange();
2284
- this.pickerVisible = this.picker.visible = false;
2285
- this.blur();
2286
- event.stopPropagation();
2287
- } else {
2288
- // user may change focus between two input
2289
- setTimeout(function () {
2290
- if (_this.refInput.indexOf(document.activeElement) === -1) {
2291
- _this.pickerVisible = false;
2292
- _this.blur();
2293
- event.stopPropagation();
2294
- }
2295
- }, 0);
2296
- }
2297
- return;
2298
- }
2299
-
2300
- // Enter
2301
- if (keyCode === 13) {
2302
- if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
2303
- this.handleChange();
2304
- this.pickerVisible = this.picker.visible = false;
2305
- this.blur();
2306
- }
2307
- event.stopPropagation();
2308
- return;
2309
- }
2310
-
2311
- // if user is typing, do not let picker handle key input
2312
- if (this.userInput) {
2313
- event.stopPropagation();
2314
- return;
2315
- }
2316
-
2317
- // delegate other keys to panel
2318
- if (this.picker && this.picker.handleKeydown) {
2319
- this.picker.handleKeydown(event);
2320
- }
2321
- },
2322
- handleRangeClick: function handleRangeClick() {
2323
- var type = this.type;
2324
-
2325
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
2326
- this.pickerVisible = true;
2327
- }
2328
- this.$emit('focus', this);
2329
- },
2330
- hidePicker: function hidePicker() {
2331
- if (this.picker) {
2332
- this.picker.resetView && this.picker.resetView();
2333
- this.pickerVisible = this.picker.visible = false;
2334
- this.destroyPopper();
2335
- }
2336
- },
2337
- showPicker: function showPicker() {
2338
- var _this2 = this;
2339
-
2340
- if (this.$isServer) return;
2341
- if (!this.picker) {
2342
- this.mountPicker();
2343
- }
2344
- this.pickerVisible = this.picker.visible = true;
2345
-
2346
- this.updatePopper();
2347
-
2348
- this.picker.value = this.parsedValue;
2349
- this.picker.resetView && this.picker.resetView();
2350
-
2351
- this.$nextTick(function () {
2352
- _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
2353
- });
2354
- },
2355
- mountPicker: function mountPicker() {
2356
- var _this3 = this;
2357
-
2358
- this.picker = new external_vue_default.a(this.panel).$mount();
2359
- this.picker.defaultValue = this.defaultValue;
2360
- this.picker.defaultTime = this.defaultTime;
2361
- this.picker.popperClass = this.popperClass;
2362
- this.popperElm = this.picker.$el;
2363
- this.picker.width = this.reference.getBoundingClientRect().width;
2364
- this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
2365
- this.picker.selectionMode = this.selectionMode;
2366
- this.picker.unlinkPanels = this.unlinkPanels;
2367
- this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
2368
- this.$watch('format', function (format) {
2369
- _this3.picker.format = format;
2370
- });
2371
-
2372
- var updateOptions = function updateOptions() {
2373
- var options = _this3.pickerOptions;
2374
-
2375
- if (options && options.selectableRange) {
2376
- var ranges = options.selectableRange;
2377
- var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
2378
- var format = DEFAULT_FORMATS.timerange;
2379
-
2380
- ranges = Array.isArray(ranges) ? ranges : [ranges];
2381
- _this3.picker.selectableRange = ranges.map(function (range) {
2382
- return parser(range, format, _this3.rangeSeparator);
2383
- });
2384
- }
2385
-
2386
- for (var option in options) {
2387
- if (options.hasOwnProperty(option) &&
2388
- // 忽略 time-picker 的该配置项
2389
- option !== 'selectableRange') {
2390
- _this3.picker[option] = options[option];
2391
- }
2392
- }
2393
-
2394
- // main format must prevail over undocumented pickerOptions.format
2395
- if (_this3.format) {
2396
- _this3.picker.format = _this3.format;
2397
- }
2398
- };
2399
- updateOptions();
2400
- this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
2401
- return updateOptions();
2402
- }, { deep: true });
2403
- this.$el.appendChild(this.picker.$el);
2404
- this.picker.resetView && this.picker.resetView();
2405
-
2406
- this.picker.$on('dodestroy', this.doDestroy);
2407
- this.picker.$on('pick', function () {
2408
- var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2409
- var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2410
-
2411
- _this3.userInput = null;
2412
- _this3.pickerVisible = _this3.picker.visible = visible;
2413
- _this3.emitInput(date);
2414
- _this3.picker.resetView && _this3.picker.resetView();
2415
- });
2416
-
2417
- this.picker.$on('select-range', function (start, end, pos) {
2418
- if (_this3.refInput.length === 0) return;
2419
- if (!pos || pos === 'min') {
2420
- _this3.refInput[0].setSelectionRange(start, end);
2421
- _this3.refInput[0].focus();
2422
- } else if (pos === 'max') {
2423
- _this3.refInput[1].setSelectionRange(start, end);
2424
- _this3.refInput[1].focus();
2425
- }
2426
- });
2427
- },
2428
- unmountPicker: function unmountPicker() {
2429
- if (this.picker) {
2430
- this.picker.$destroy();
2431
- this.picker.$off();
2432
- if (typeof this.unwatchPickerOptions === 'function') {
2433
- this.unwatchPickerOptions();
2434
- }
2435
- this.picker.$el.parentNode.removeChild(this.picker.$el);
2436
- }
2437
- },
2438
- emitChange: function emitChange(val) {
2439
- // determine user real change only
2440
- if (!valueEquals(val, this.valueOnOpen)) {
2441
- this.$emit('change', val);
2442
- this.valueOnOpen = val;
2443
- if (this.validateEvent) {
2444
- this.dispatch('ElFormItem', 'el.form.change', val);
2445
- }
2446
- }
2447
- },
2448
- emitInput: function emitInput(val) {
2449
- var formatted = this.formatToValue(val);
2450
- if (!valueEquals(this.value, formatted)) {
2451
- this.$emit('input', formatted);
2452
- }
2453
- },
2454
- isValidValue: function isValidValue(value) {
2455
- if (!this.picker) {
2456
- this.mountPicker();
2457
- }
2458
- if (this.picker.isValidValue) {
2459
- return value && this.picker.isValidValue(value);
2460
- } else {
2461
- return true;
2462
- }
2463
- }
2464
- }
2465
- });
2466
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js
2467
- /* harmony default export */ var src_pickervue_type_script_lang_js = (pickervue_type_script_lang_js);
2468
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2469
- var componentNormalizer = __webpack_require__(0);
2470
-
2471
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue
2472
-
2473
-
2474
-
2475
-
2476
-
2477
- /* normalize component */
2478
-
2479
- var component = Object(componentNormalizer["a" /* default */])(
2480
- src_pickervue_type_script_lang_js,
2481
- render,
2482
- staticRenderFns,
2483
- false,
2484
- null,
2485
- null,
2486
- null
2487
-
2488
- )
2489
-
2490
- /* harmony default export */ var picker = __webpack_exports__["a"] = (component.exports);
2491
-
2492
- /***/ }),
2493
-
2494
- /***/ 4:
2495
- /***/ (function(module, exports) {
2496
-
2497
- module.exports = require("element-ui/lib/mixins/emitter");
2498
-
2499
- /***/ }),
2500
-
2501
- /***/ 5:
2502
- /***/ (function(module, exports) {
2503
-
2504
- module.exports = require("element-ui/lib/utils/vue-popper");
2505
-
2506
- /***/ }),
2507
-
2508
- /***/ 6:
2509
- /***/ (function(module, exports) {
2510
-
2511
- module.exports = require("element-ui/lib/utils/merge");
2512
-
2513
- /***/ }),
2514
-
2515
- /***/ 7:
2516
- /***/ (function(module, exports) {
2517
-
2518
- module.exports = require("element-ui/lib/mixins/migrating");
2519
-
2520
- /***/ }),
2521
-
2522
- /***/ 74:
2523
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
2524
-
2525
- "use strict";
2526
- // ESM COMPAT FLAG
2527
- __webpack_require__.r(__webpack_exports__);
2528
-
2529
- // EXTERNAL MODULE: ./packages/date-picker/src/picker.vue + 4 modules
2530
- var picker = __webpack_require__(35);
2531
-
2532
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=c5c70a18
2533
- var render = function () {
2534
- var _vm = this
2535
- var _h = _vm.$createElement
2536
- var _c = _vm._self._c || _h
2537
- return _c(
2538
- "transition",
2539
- {
2540
- attrs: { name: "el-zoom-in-top" },
2541
- on: {
2542
- "before-enter": _vm.handleMenuEnter,
2543
- "after-leave": function ($event) {
2544
- _vm.$emit("dodestroy")
2545
- },
2546
- },
2547
- },
2548
- [
2549
- _c(
2550
- "div",
2551
- {
2552
- directives: [
2553
- {
2554
- name: "show",
2555
- rawName: "v-show",
2556
- value: _vm.visible,
2557
- expression: "visible",
2558
- },
2559
- ],
2560
- ref: "popper",
2561
- staticClass: "el-picker-panel time-select el-popper",
2562
- class: _vm.popperClass,
2563
- style: { width: _vm.width + "px" },
2564
- },
2565
- [
2566
- _c(
2567
- "el-scrollbar",
2568
- {
2569
- attrs: { noresize: "", "wrap-class": "el-picker-panel__content" },
2570
- },
2571
- _vm._l(_vm.items, function (item) {
2572
- return _c(
2573
- "div",
2574
- {
2575
- key: item.value,
2576
- staticClass: "time-select-item",
2577
- class: {
2578
- selected: _vm.value === item.value,
2579
- disabled: item.disabled,
2580
- default: item.value === _vm.defaultValue,
2581
- },
2582
- attrs: { disabled: item.disabled },
2583
- on: {
2584
- click: function ($event) {
2585
- _vm.handleClick(item)
2586
- },
2587
- },
2588
- },
2589
- [_vm._v(_vm._s(item.value))]
2590
- )
2591
- }),
2592
- 0
2593
- ),
2594
- ],
2595
- 1
2596
- ),
2597
- ]
2598
- )
2599
- }
2600
- var staticRenderFns = []
2601
- render._withStripped = true
2602
-
2603
-
2604
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=c5c70a18
2605
-
2606
- // EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
2607
- var scrollbar = __webpack_require__(18);
2608
-
2609
- // EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view"
2610
- var scroll_into_view_ = __webpack_require__(26);
2611
- var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
2612
-
2613
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-select.vue?vue&type=script&lang=js
2614
- //
2615
- //
2616
- //
2617
- //
2618
- //
2619
- //
2620
- //
2621
- //
2622
- //
2623
- //
2624
- //
2625
- //
2626
- //
2627
- //
2628
- //
2629
- //
2630
- //
2631
- //
2632
- //
2633
- //
2634
-
2635
-
2636
-
2637
-
2638
- var parseTime = function parseTime(time) {
2639
- var values = (time || '').split(':');
2640
- if (values.length >= 2) {
2641
- var hours = parseInt(values[0], 10);
2642
- var minutes = parseInt(values[1], 10);
2643
-
2644
- return {
2645
- hours: hours,
2646
- minutes: minutes
2647
- };
2648
- }
2649
- /* istanbul ignore next */
2650
- return null;
2651
- };
2652
-
2653
- var compareTime = function compareTime(time1, time2) {
2654
- var value1 = parseTime(time1);
2655
- var value2 = parseTime(time2);
2656
-
2657
- var minutes1 = value1.minutes + value1.hours * 60;
2658
- var minutes2 = value2.minutes + value2.hours * 60;
2659
-
2660
- if (minutes1 === minutes2) {
2661
- return 0;
2662
- }
2663
-
2664
- return minutes1 > minutes2 ? 1 : -1;
2665
- };
2666
-
2667
- var formatTime = function formatTime(time) {
2668
- return (time.hours < 10 ? '0' + time.hours : time.hours) + ':' + (time.minutes < 10 ? '0' + time.minutes : time.minutes);
2669
- };
2670
-
2671
- var nextTime = function nextTime(time, step) {
2672
- var timeValue = parseTime(time);
2673
- var stepValue = parseTime(step);
2674
-
2675
- var next = {
2676
- hours: timeValue.hours,
2677
- minutes: timeValue.minutes
2678
- };
2679
-
2680
- next.minutes += stepValue.minutes;
2681
- next.hours += stepValue.hours;
2682
-
2683
- next.hours += Math.floor(next.minutes / 60);
2684
- next.minutes = next.minutes % 60;
2685
-
2686
- return formatTime(next);
2687
- };
2688
-
2689
- /* harmony default export */ var time_selectvue_type_script_lang_js = ({
2690
- components: { ElScrollbar: scrollbar["default"] },
2691
-
2692
- watch: {
2693
- value: function value(val) {
2694
- var _this = this;
2695
-
2696
- if (!val) return;
2697
- this.$nextTick(function () {
2698
- return _this.scrollToOption();
2699
- });
2700
- }
2701
- },
2702
-
2703
- methods: {
2704
- handleClick: function handleClick(item) {
2705
- if (!item.disabled) {
2706
- this.$emit('pick', item.value);
2707
- }
2708
- },
2709
- handleClear: function handleClear() {
2710
- this.$emit('pick', null);
2711
- },
2712
- scrollToOption: function scrollToOption() {
2713
- var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.selected';
2714
-
2715
- var menu = this.$refs.popper.querySelector('.el-picker-panel__content');
2716
- scroll_into_view_default()(menu, menu.querySelector(selector));
2717
- },
2718
- handleMenuEnter: function handleMenuEnter() {
2719
- var _this2 = this;
2720
-
2721
- var selected = this.items.map(function (item) {
2722
- return item.value;
2723
- }).indexOf(this.value) !== -1;
2724
- var hasDefault = this.items.map(function (item) {
2725
- return item.value;
2726
- }).indexOf(this.defaultValue) !== -1;
2727
- var option = selected && '.selected' || hasDefault && '.default' || '.time-select-item:not(.disabled)';
2728
- this.$nextTick(function () {
2729
- return _this2.scrollToOption(option);
2730
- });
2731
- },
2732
- scrollDown: function scrollDown(step) {
2733
- var items = this.items;
2734
- var length = items.length;
2735
- var total = items.length;
2736
- var index = items.map(function (item) {
2737
- return item.value;
2738
- }).indexOf(this.value);
2739
- while (total--) {
2740
- index = (index + step + length) % length;
2741
- if (!items[index].disabled) {
2742
- this.$emit('pick', items[index].value, true);
2743
- return;
2744
- }
2745
- }
2746
- },
2747
- isValidValue: function isValidValue(date) {
2748
- return this.items.filter(function (item) {
2749
- return !item.disabled;
2750
- }).map(function (item) {
2751
- return item.value;
2752
- }).indexOf(date) !== -1;
2753
- },
2754
- handleKeydown: function handleKeydown(event) {
2755
- var keyCode = event.keyCode;
2756
- if (keyCode === 38 || keyCode === 40) {
2757
- var mapping = { 40: 1, 38: -1 };
2758
- var offset = mapping[keyCode.toString()];
2759
- this.scrollDown(offset);
2760
- event.stopPropagation();
2761
- return;
2762
- }
2763
- }
2764
- },
2765
-
2766
- data: function data() {
2767
- return {
2768
- popperClass: '',
2769
- start: '09:00',
2770
- end: '18:00',
2771
- step: '00:30',
2772
- value: '',
2773
- defaultValue: '',
2774
- visible: false,
2775
- minTime: '',
2776
- maxTime: '',
2777
- width: 0
2778
- };
2779
- },
2780
-
2781
-
2782
- computed: {
2783
- items: function items() {
2784
- var start = this.start;
2785
- var end = this.end;
2786
- var step = this.step;
2787
-
2788
- var result = [];
2789
-
2790
- if (start && end && step) {
2791
- var current = start;
2792
- while (compareTime(current, end) <= 0) {
2793
- result.push({
2794
- value: current,
2795
- disabled: compareTime(current, this.minTime || '-1:-1') <= 0 || compareTime(current, this.maxTime || '100:100') >= 0
2796
- });
2797
- current = nextTime(current, step);
2798
- }
2799
- }
2800
-
2801
- return result;
2802
- }
2803
- }
2804
- });
2805
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=script&lang=js
2806
- /* harmony default export */ var panel_time_selectvue_type_script_lang_js = (time_selectvue_type_script_lang_js);
2807
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2808
- var componentNormalizer = __webpack_require__(0);
2809
-
2810
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue
2811
-
2812
-
2813
-
2814
-
2815
-
2816
- /* normalize component */
2817
-
2818
- var component = Object(componentNormalizer["a" /* default */])(
2819
- panel_time_selectvue_type_script_lang_js,
2820
- render,
2821
- staticRenderFns,
2822
- false,
2823
- null,
2824
- null,
2825
- null
2826
-
2827
- )
2828
-
2829
- /* harmony default export */ var time_select = (component.exports);
2830
- // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-select.js
2831
-
2832
-
2833
-
2834
- /* harmony default export */ var picker_time_select = ({
2835
- mixins: [picker["a" /* default */]],
2836
-
2837
- name: 'ElTimeSelect',
2838
-
2839
- componentName: 'ElTimeSelect',
2840
-
2841
- props: {
2842
- type: {
2843
- type: String,
2844
- default: 'time-select'
2845
- }
2846
- },
2847
-
2848
- beforeCreate: function beforeCreate() {
2849
- this.panel = time_select;
2850
- }
2851
- });
2852
- // CONCATENATED MODULE: ./packages/time-select/index.js
2853
-
2854
-
2855
- /* istanbul ignore next */
2856
- picker_time_select.install = function (Vue) {
2857
- Vue.component(picker_time_select.name, picker_time_select);
2858
- };
2859
-
2860
- /* harmony default export */ var packages_time_select = __webpack_exports__["default"] = (picker_time_select);
2861
-
2862
- /***/ }),
2863
-
2864
- /***/ 8:
2865
- /***/ (function(module, exports) {
2866
-
2867
- module.exports = require("vue");
2868
-
2869
- /***/ })
2870
-
2871
- /******/ });