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/Pagination.js DELETED
@@ -1,4123 +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 = 73);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ([
89
- /* 0 */
90
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
91
-
92
- "use strict";
93
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
94
- /* globals __VUE_SSR_CONTEXT__ */
95
-
96
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
97
- // This module is a runtime utility for cleaner component module output and will
98
- // be included in the final webpack user bundle.
99
-
100
- function normalizeComponent(
101
- scriptExports,
102
- render,
103
- staticRenderFns,
104
- functionalTemplate,
105
- injectStyles,
106
- scopeId,
107
- moduleIdentifier /* server only */,
108
- shadowMode /* vue-cli only */
109
- ) {
110
- // Vue.extend constructor export interop
111
- var options =
112
- typeof scriptExports === 'function' ? scriptExports.options : scriptExports
113
-
114
- // render functions
115
- if (render) {
116
- options.render = render
117
- options.staticRenderFns = staticRenderFns
118
- options._compiled = true
119
- }
120
-
121
- // functional template
122
- if (functionalTemplate) {
123
- options.functional = true
124
- }
125
-
126
- // scopedId
127
- if (scopeId) {
128
- options._scopeId = 'data-v-' + scopeId
129
- }
130
-
131
- var hook
132
- if (moduleIdentifier) {
133
- // server build
134
- hook = function (context) {
135
- // 2.3 injection
136
- context =
137
- context || // cached call
138
- (this.$vnode && this.$vnode.ssrContext) || // stateful
139
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
140
- // 2.2 with runInNewContext: true
141
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
142
- context = __VUE_SSR_CONTEXT__
143
- }
144
- // inject component styles
145
- if (injectStyles) {
146
- injectStyles.call(this, context)
147
- }
148
- // register component module identifier for async chunk inferrence
149
- if (context && context._registeredComponents) {
150
- context._registeredComponents.add(moduleIdentifier)
151
- }
152
- }
153
- // used by ssr in case component is cached and beforeCreate
154
- // never gets called
155
- options._ssrRegister = hook
156
- } else if (injectStyles) {
157
- hook = shadowMode
158
- ? function () {
159
- injectStyles.call(
160
- this,
161
- (options.functional ? this.parent : this).$root.$options.shadowRoot
162
- )
163
- }
164
- : injectStyles
165
- }
166
-
167
- if (hook) {
168
- if (options.functional) {
169
- // for template-only hot-reload because in that case the render fn doesn't
170
- // go through the normalizer
171
- options._injectStyles = hook
172
- // register for functional component in vue file
173
- var originalRender = options.render
174
- options.render = function renderWithStyleInjection(h, context) {
175
- hook.call(context)
176
- return originalRender(h, context)
177
- }
178
- } else {
179
- // inject component registration as beforeCreate hook
180
- var existing = options.beforeCreate
181
- options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
182
- }
183
- }
184
-
185
- return {
186
- exports: scriptExports,
187
- options: options
188
- }
189
- }
190
-
191
-
192
- /***/ }),
193
- /* 1 */
194
- /***/ (function(module, exports) {
195
-
196
- module.exports = require("element-ui/lib/utils/dom");
197
-
198
- /***/ }),
199
- /* 2 */,
200
- /* 3 */
201
- /***/ (function(module, exports) {
202
-
203
- module.exports = require("element-ui/lib/utils/util");
204
-
205
- /***/ }),
206
- /* 4 */
207
- /***/ (function(module, exports) {
208
-
209
- module.exports = require("element-ui/lib/mixins/emitter");
210
-
211
- /***/ }),
212
- /* 5 */
213
- /***/ (function(module, exports) {
214
-
215
- module.exports = require("element-ui/lib/utils/vue-popper");
216
-
217
- /***/ }),
218
- /* 6 */
219
- /***/ (function(module, exports) {
220
-
221
- module.exports = require("element-ui/lib/utils/merge");
222
-
223
- /***/ }),
224
- /* 7 */
225
- /***/ (function(module, exports) {
226
-
227
- module.exports = require("element-ui/lib/mixins/migrating");
228
-
229
- /***/ }),
230
- /* 8 */,
231
- /* 9 */
232
- /***/ (function(module, exports) {
233
-
234
- module.exports = require("element-ui/lib/mixins/locale");
235
-
236
- /***/ }),
237
- /* 10 */
238
- /***/ (function(module, exports) {
239
-
240
- module.exports = require("element-ui/lib/utils/resize-event");
241
-
242
- /***/ }),
243
- /* 11 */
244
- /***/ (function(module, exports) {
245
-
246
- module.exports = require("element-ui/lib/utils/shared");
247
-
248
- /***/ }),
249
- /* 12 */,
250
- /* 13 */
251
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
252
-
253
- "use strict";
254
- // ESM COMPAT FLAG
255
- __webpack_require__.r(__webpack_exports__);
256
-
257
- // 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
258
- var render = function () {
259
- var _vm = this
260
- var _h = _vm.$createElement
261
- var _c = _vm._self._c || _h
262
- return _c(
263
- "div",
264
- {
265
- class: [
266
- _vm.type === "textarea" ? "el-textarea" : "el-input",
267
- _vm.inputSize ? "el-input--" + _vm.inputSize : "",
268
- {
269
- "is-disabled": _vm.inputDisabled,
270
- "is-exceed": _vm.inputExceed,
271
- "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
272
- "el-input-group--append": _vm.$slots.append,
273
- "el-input-group--prepend": _vm.$slots.prepend,
274
- "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
275
- "el-input--suffix":
276
- _vm.$slots.suffix ||
277
- _vm.suffixIcon ||
278
- _vm.clearable ||
279
- _vm.showPassword,
280
- },
281
- ],
282
- on: {
283
- mouseenter: function ($event) {
284
- _vm.hovering = true
285
- },
286
- mouseleave: function ($event) {
287
- _vm.hovering = false
288
- },
289
- },
290
- },
291
- [
292
- _vm.type !== "textarea"
293
- ? [
294
- _vm.$slots.prepend
295
- ? _c(
296
- "div",
297
- { staticClass: "el-input-group__prepend" },
298
- [_vm._t("prepend")],
299
- 2
300
- )
301
- : _vm._e(),
302
- _vm.type !== "textarea"
303
- ? _c(
304
- "input",
305
- _vm._b(
306
- {
307
- ref: "input",
308
- staticClass: "el-input__inner",
309
- attrs: {
310
- tabindex: _vm.tabindex,
311
- type: _vm.showPassword
312
- ? _vm.passwordVisible
313
- ? "text"
314
- : "password"
315
- : _vm.type,
316
- disabled: _vm.inputDisabled,
317
- readonly: _vm.readonly,
318
- autocomplete: _vm.autoComplete || _vm.autocomplete,
319
- "aria-label": _vm.label,
320
- },
321
- on: {
322
- compositionstart: _vm.handleCompositionStart,
323
- compositionupdate: _vm.handleCompositionUpdate,
324
- compositionend: _vm.handleCompositionEnd,
325
- input: _vm.handleInput,
326
- focus: _vm.handleFocus,
327
- blur: _vm.handleBlur,
328
- change: _vm.handleChange,
329
- },
330
- },
331
- "input",
332
- _vm.$attrs,
333
- false
334
- )
335
- )
336
- : _vm._e(),
337
- _vm.$slots.prefix || _vm.prefixIcon
338
- ? _c(
339
- "span",
340
- { staticClass: "el-input__prefix" },
341
- [
342
- _vm._t("prefix"),
343
- _vm.prefixIcon
344
- ? _c("i", {
345
- staticClass: "el-input__icon",
346
- class: _vm.prefixIcon,
347
- })
348
- : _vm._e(),
349
- ],
350
- 2
351
- )
352
- : _vm._e(),
353
- _vm.getSuffixVisible()
354
- ? _c("span", { staticClass: "el-input__suffix" }, [
355
- _c(
356
- "span",
357
- { staticClass: "el-input__suffix-inner" },
358
- [
359
- !_vm.showClear ||
360
- !_vm.showPwdVisible ||
361
- !_vm.isWordLimitVisible
362
- ? [
363
- _vm._t("suffix"),
364
- _vm.suffixIcon
365
- ? _c("i", {
366
- staticClass: "el-input__icon",
367
- class: _vm.suffixIcon,
368
- })
369
- : _vm._e(),
370
- ]
371
- : _vm._e(),
372
- _vm.showClear
373
- ? _c("i", {
374
- staticClass:
375
- "el-input__icon el-icon-circle-close el-input__clear",
376
- on: {
377
- mousedown: function ($event) {
378
- $event.preventDefault()
379
- },
380
- click: _vm.clear,
381
- },
382
- })
383
- : _vm._e(),
384
- _vm.showPwdVisible
385
- ? _c("i", {
386
- staticClass:
387
- "el-input__icon el-icon-view el-input__clear",
388
- on: { click: _vm.handlePasswordVisible },
389
- })
390
- : _vm._e(),
391
- _vm.isWordLimitVisible
392
- ? _c("span", { staticClass: "el-input__count" }, [
393
- _c(
394
- "span",
395
- { staticClass: "el-input__count-inner" },
396
- [
397
- _vm._v(
398
- "\n\t\t\t\t\t\t\t" +
399
- _vm._s(_vm.textLength) +
400
- "/" +
401
- _vm._s(_vm.upperLimit) +
402
- "\n\t\t\t\t\t\t"
403
- ),
404
- ]
405
- ),
406
- ])
407
- : _vm._e(),
408
- ],
409
- 2
410
- ),
411
- _vm.validateState
412
- ? _c("i", {
413
- staticClass: "el-input__icon",
414
- class: ["el-input__validateIcon", _vm.validateIcon],
415
- })
416
- : _vm._e(),
417
- ])
418
- : _vm._e(),
419
- _vm.$slots.append
420
- ? _c(
421
- "div",
422
- { staticClass: "el-input-group__append" },
423
- [_vm._t("append")],
424
- 2
425
- )
426
- : _vm._e(),
427
- ]
428
- : _c(
429
- "textarea",
430
- _vm._b(
431
- {
432
- ref: "textarea",
433
- staticClass: "el-textarea__inner",
434
- style: _vm.textareaStyle,
435
- attrs: {
436
- tabindex: _vm.tabindex,
437
- disabled: _vm.inputDisabled,
438
- readonly: _vm.readonly,
439
- autocomplete: _vm.autoComplete || _vm.autocomplete,
440
- "aria-label": _vm.label,
441
- },
442
- on: {
443
- compositionstart: _vm.handleCompositionStart,
444
- compositionupdate: _vm.handleCompositionUpdate,
445
- compositionend: _vm.handleCompositionEnd,
446
- input: _vm.handleInput,
447
- focus: _vm.handleFocus,
448
- blur: _vm.handleBlur,
449
- change: _vm.handleChange,
450
- },
451
- },
452
- "textarea",
453
- _vm.$attrs,
454
- false
455
- )
456
- ),
457
- _vm.isWordLimitVisible && _vm.type === "textarea"
458
- ? _c("span", { staticClass: "el-input__count" }, [
459
- _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit)),
460
- ])
461
- : _vm._e(),
462
- ],
463
- 2
464
- )
465
- }
466
- var staticRenderFns = []
467
- render._withStripped = true
468
-
469
-
470
- // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=048a9cde
471
-
472
- // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
473
- var emitter_ = __webpack_require__(4);
474
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
475
-
476
- // EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"
477
- var migrating_ = __webpack_require__(7);
478
- var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
479
-
480
- // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
481
- var hiddenTextarea = void 0;
482
-
483
- 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';
484
-
485
- 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'];
486
-
487
- function calculateNodeStyling(targetElement) {
488
- var style = window.getComputedStyle(targetElement);
489
-
490
- var boxSizing = style.getPropertyValue('box-sizing');
491
-
492
- var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
493
-
494
- var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
495
-
496
- var contextStyle = CONTEXT_STYLE.map(function (name) {
497
- return name + ':' + style.getPropertyValue(name);
498
- }).join(';');
499
-
500
- return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
501
- }
502
-
503
- function calcTextareaHeight(targetElement) {
504
- var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
505
- var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
506
-
507
- if (!hiddenTextarea) {
508
- hiddenTextarea = document.createElement('textarea');
509
- document.body.appendChild(hiddenTextarea);
510
- }
511
-
512
- var _calculateNodeStyling = calculateNodeStyling(targetElement),
513
- paddingSize = _calculateNodeStyling.paddingSize,
514
- borderSize = _calculateNodeStyling.borderSize,
515
- boxSizing = _calculateNodeStyling.boxSizing,
516
- contextStyle = _calculateNodeStyling.contextStyle;
517
-
518
- hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
519
- hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
520
-
521
- var height = hiddenTextarea.scrollHeight;
522
- var result = {};
523
-
524
- if (boxSizing === 'border-box') {
525
- height = height + borderSize;
526
- } else if (boxSizing === 'content-box') {
527
- height = height - paddingSize;
528
- }
529
-
530
- hiddenTextarea.value = '';
531
- var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
532
-
533
- if (minRows !== null) {
534
- var minHeight = singleRowHeight * minRows;
535
- if (boxSizing === 'border-box') {
536
- minHeight = minHeight + paddingSize + borderSize;
537
- }
538
- height = Math.max(minHeight, height);
539
- result.minHeight = minHeight + 'px';
540
- }
541
- if (maxRows !== null) {
542
- var maxHeight = singleRowHeight * maxRows;
543
- if (boxSizing === 'border-box') {
544
- maxHeight = maxHeight + paddingSize + borderSize;
545
- }
546
- height = Math.min(maxHeight, height);
547
- }
548
- result.height = height + 'px';
549
- hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
550
- hiddenTextarea = null;
551
- return result;
552
- };
553
- // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
554
- var merge_ = __webpack_require__(6);
555
- var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
556
-
557
- // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
558
- var shared_ = __webpack_require__(11);
559
-
560
- // 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
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
- //
644
- //
645
- //
646
- //
647
- //
648
- //
649
- //
650
- //
651
- //
652
- //
653
- //
654
- //
655
- //
656
- //
657
- //
658
- //
659
- //
660
- //
661
- //
662
- //
663
- //
664
- //
665
- //
666
- //
667
- //
668
- //
669
- //
670
-
671
-
672
-
673
-
674
-
675
-
676
-
677
- /* harmony default export */ var inputvue_type_script_lang_js = ({
678
- name: 'ElInput',
679
-
680
- componentName: 'ElInput',
681
-
682
- mixins: [emitter_default.a, migrating_default.a],
683
-
684
- inheritAttrs: false,
685
-
686
- inject: {
687
- elForm: {
688
- default: ''
689
- },
690
- elFormItem: {
691
- default: ''
692
- }
693
- },
694
-
695
- data: function data() {
696
- return {
697
- textareaCalcStyle: {},
698
- hovering: false,
699
- focused: false,
700
- isComposing: false,
701
- passwordVisible: false
702
- };
703
- },
704
-
705
-
706
- props: {
707
- value: [String, Number],
708
- size: String,
709
- resize: String,
710
- form: String,
711
- disabled: Boolean,
712
- readonly: Boolean,
713
- type: {
714
- type: String,
715
- default: 'text'
716
- },
717
- autosize: {
718
- type: [Boolean, Object],
719
- default: false
720
- },
721
- autocomplete: {
722
- type: String,
723
- default: 'off'
724
- },
725
- /** @Deprecated in next major version */
726
- autoComplete: {
727
- type: String,
728
- validator: function validator(val) {
729
- false && false;
730
- return true;
731
- }
732
- },
733
- validateEvent: {
734
- type: Boolean,
735
- default: true
736
- },
737
- suffixIcon: String,
738
- prefixIcon: String,
739
- label: String,
740
- clearable: {
741
- type: Boolean,
742
- default: false
743
- },
744
- showPassword: {
745
- type: Boolean,
746
- default: false
747
- },
748
- showWordLimit: {
749
- type: Boolean,
750
- default: false
751
- },
752
- tabindex: String
753
- },
754
-
755
- computed: {
756
- _elFormItemSize: function _elFormItemSize() {
757
- return (this.elFormItem || {}).elFormItemSize;
758
- },
759
- validateState: function validateState() {
760
- return this.elFormItem ? this.elFormItem.validateState : '';
761
- },
762
- needStatusIcon: function needStatusIcon() {
763
- return this.elForm ? this.elForm.statusIcon : false;
764
- },
765
- validateIcon: function validateIcon() {
766
- return {
767
- validating: 'el-icon-loading',
768
- success: 'el-icon-circle-check',
769
- error: 'el-icon-circle-close'
770
- }[this.validateState];
771
- },
772
- textareaStyle: function textareaStyle() {
773
- return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
774
- },
775
- inputSize: function inputSize() {
776
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
777
- },
778
- inputDisabled: function inputDisabled() {
779
- return this.disabled || (this.elForm || {}).disabled;
780
- },
781
- nativeInputValue: function nativeInputValue() {
782
- return this.value === null || this.value === undefined ? '' : String(this.value);
783
- },
784
- showClear: function showClear() {
785
- return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
786
- },
787
- showPwdVisible: function showPwdVisible() {
788
- return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
789
- },
790
- isWordLimitVisible: function isWordLimitVisible() {
791
- return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
792
- },
793
- upperLimit: function upperLimit() {
794
- return this.$attrs.maxlength;
795
- },
796
- textLength: function textLength() {
797
- if (typeof this.value === 'number') {
798
- return String(this.value).length;
799
- }
800
-
801
- return (this.value || '').length;
802
- },
803
- inputExceed: function inputExceed() {
804
- // show exceed style if length of initial value greater then maxlength
805
- return this.isWordLimitVisible && this.textLength > this.upperLimit;
806
- }
807
- },
808
-
809
- watch: {
810
- value: function value(val) {
811
- this.$nextTick(this.resizeTextarea);
812
- if (this.validateEvent) {
813
- this.dispatch('ElFormItem', 'el.form.change', [val]);
814
- }
815
- },
816
-
817
- // native input value is set explicitly
818
- // do not use v-model / :value in template
819
- // see: https://github.com/ElemeFE/element/issues/14521
820
- nativeInputValue: function nativeInputValue() {
821
- this.setNativeInputValue();
822
- },
823
-
824
- // when change between <input> and <textarea>,
825
- // update DOM dependent value and styles
826
- // https://github.com/ElemeFE/element/issues/14857
827
- type: function type() {
828
- var _this = this;
829
-
830
- this.$nextTick(function () {
831
- _this.setNativeInputValue();
832
- _this.resizeTextarea();
833
- _this.updateIconOffset();
834
- });
835
- }
836
- },
837
-
838
- methods: {
839
- focus: function focus() {
840
- this.getInput().focus();
841
- },
842
- blur: function blur() {
843
- this.getInput().blur();
844
- },
845
- getMigratingConfig: function getMigratingConfig() {
846
- return {
847
- props: {
848
- 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
849
- 'on-icon-click': 'on-icon-click is removed.'
850
- },
851
- events: {
852
- 'click': 'click is removed.'
853
- }
854
- };
855
- },
856
- handleBlur: function handleBlur(event) {
857
- this.focused = false;
858
- this.$emit('blur', event);
859
- if (this.validateEvent) {
860
- this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
861
- }
862
- },
863
- select: function select() {
864
- this.getInput().select();
865
- },
866
- resizeTextarea: function resizeTextarea() {
867
- if (this.$isServer) return;
868
- var autosize = this.autosize,
869
- type = this.type;
870
-
871
- if (type !== 'textarea') return;
872
- if (!autosize) {
873
- this.textareaCalcStyle = {
874
- minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
875
- };
876
- return;
877
- }
878
- var minRows = autosize.minRows;
879
- var maxRows = autosize.maxRows;
880
-
881
- this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
882
- },
883
- setNativeInputValue: function setNativeInputValue() {
884
- var input = this.getInput();
885
- if (!input) return;
886
- if (input.value === this.nativeInputValue) return;
887
- input.value = this.nativeInputValue;
888
- },
889
- handleFocus: function handleFocus(event) {
890
- this.focused = true;
891
- this.$emit('focus', event);
892
- },
893
- handleCompositionStart: function handleCompositionStart(event) {
894
- this.$emit('compositionstart', event);
895
- this.isComposing = true;
896
- },
897
- handleCompositionUpdate: function handleCompositionUpdate(event) {
898
- this.$emit('compositionupdate', event);
899
- var text = event.target.value;
900
- var lastCharacter = text[text.length - 1] || '';
901
- this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
902
- },
903
- handleCompositionEnd: function handleCompositionEnd(event) {
904
- this.$emit('compositionend', event);
905
- if (this.isComposing) {
906
- this.isComposing = false;
907
- this.handleInput(event);
908
- }
909
- },
910
- handleInput: function handleInput(event) {
911
- // should not emit input during composition
912
- // see: https://github.com/ElemeFE/element/issues/10516
913
- if (this.isComposing) return;
914
-
915
- // hack for https://github.com/ElemeFE/element/issues/8548
916
- // should remove the following line when we don't support IE
917
- if (event.target.value === this.nativeInputValue) return;
918
-
919
- this.$emit('input', event.target.value);
920
-
921
- // ensure native input value is controlled
922
- // see: https://github.com/ElemeFE/element/issues/12850
923
- this.$nextTick(this.setNativeInputValue);
924
- },
925
- handleChange: function handleChange(event) {
926
- this.$emit('change', event.target.value);
927
- },
928
- calcIconOffset: function calcIconOffset(place) {
929
- var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
930
- if (!elList.length) return;
931
- var el = null;
932
- for (var i = 0; i < elList.length; i++) {
933
- if (elList[i].parentNode === this.$el) {
934
- el = elList[i];
935
- break;
936
- }
937
- }
938
- if (!el) return;
939
- var pendantMap = {
940
- suffix: 'append',
941
- prefix: 'prepend'
942
- };
943
-
944
- var pendant = pendantMap[place];
945
- if (this.$slots[pendant]) {
946
- el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
947
- } else {
948
- el.removeAttribute('style');
949
- }
950
- },
951
- updateIconOffset: function updateIconOffset() {
952
- this.calcIconOffset('prefix');
953
- this.calcIconOffset('suffix');
954
- },
955
- clear: function clear() {
956
- this.$emit('input', '');
957
- this.$emit('change', '');
958
- this.$emit('clear');
959
- },
960
- handlePasswordVisible: function handlePasswordVisible() {
961
- var _this2 = this;
962
-
963
- this.passwordVisible = !this.passwordVisible;
964
- this.$nextTick(function () {
965
- _this2.focus();
966
- });
967
- },
968
- getInput: function getInput() {
969
- return this.$refs.input || this.$refs.textarea;
970
- },
971
- getSuffixVisible: function getSuffixVisible() {
972
- return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
973
- }
974
- },
975
-
976
- created: function created() {
977
- this.$on('inputSelect', this.select);
978
- },
979
- mounted: function mounted() {
980
- this.setNativeInputValue();
981
- this.resizeTextarea();
982
- this.updateIconOffset();
983
- },
984
- updated: function updated() {
985
- this.$nextTick(this.updateIconOffset);
986
- }
987
- });
988
- // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js
989
- /* harmony default export */ var src_inputvue_type_script_lang_js = (inputvue_type_script_lang_js);
990
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
991
- var componentNormalizer = __webpack_require__(0);
992
-
993
- // CONCATENATED MODULE: ./packages/input/src/input.vue
994
-
995
-
996
-
997
-
998
-
999
- /* normalize component */
1000
-
1001
- var component = Object(componentNormalizer["a" /* default */])(
1002
- src_inputvue_type_script_lang_js,
1003
- render,
1004
- staticRenderFns,
1005
- false,
1006
- null,
1007
- null,
1008
- null
1009
-
1010
- )
1011
-
1012
- /* harmony default export */ var input = (component.exports);
1013
- // CONCATENATED MODULE: ./packages/input/index.js
1014
-
1015
-
1016
- /* istanbul ignore next */
1017
- input.install = function (Vue) {
1018
- Vue.component(input.name, input);
1019
- };
1020
-
1021
- /* harmony default export */ var packages_input = __webpack_exports__["default"] = (input);
1022
-
1023
- /***/ }),
1024
- /* 14 */
1025
- /***/ (function(module, exports) {
1026
-
1027
- module.exports = require("element-ui/lib/utils/clickoutside");
1028
-
1029
- /***/ }),
1030
- /* 15 */
1031
- /***/ (function(module, exports) {
1032
-
1033
- module.exports = require("throttle-debounce/debounce");
1034
-
1035
- /***/ }),
1036
- /* 16 */,
1037
- /* 17 */
1038
- /***/ (function(module, exports) {
1039
-
1040
- module.exports = require("element-ui/lib/utils/scrollbar-width");
1041
-
1042
- /***/ }),
1043
- /* 18 */
1044
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1045
-
1046
- "use strict";
1047
- // ESM COMPAT FLAG
1048
- __webpack_require__.r(__webpack_exports__);
1049
-
1050
- // EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
1051
- var resize_event_ = __webpack_require__(10);
1052
-
1053
- // EXTERNAL MODULE: external "element-ui/lib/utils/scrollbar-width"
1054
- var scrollbar_width_ = __webpack_require__(17);
1055
- var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
1056
-
1057
- // EXTERNAL MODULE: external "element-ui/lib/utils/util"
1058
- var util_ = __webpack_require__(3);
1059
-
1060
- // EXTERNAL MODULE: external "element-ui/lib/utils/dom"
1061
- var dom_ = __webpack_require__(1);
1062
-
1063
- // CONCATENATED MODULE: ./packages/scrollbar/src/util.js
1064
- var BAR_MAP = {
1065
- vertical: {
1066
- offset: 'offsetHeight',
1067
- scroll: 'scrollTop',
1068
- scrollSize: 'scrollHeight',
1069
- size: 'height',
1070
- key: 'vertical',
1071
- axis: 'Y',
1072
- client: 'clientY',
1073
- direction: 'top'
1074
- },
1075
- horizontal: {
1076
- offset: 'offsetWidth',
1077
- scroll: 'scrollLeft',
1078
- scrollSize: 'scrollWidth',
1079
- size: 'width',
1080
- key: 'horizontal',
1081
- axis: 'X',
1082
- client: 'clientX',
1083
- direction: 'left'
1084
- }
1085
- };
1086
-
1087
- function renderThumbStyle(_ref) {
1088
- var move = _ref.move,
1089
- size = _ref.size,
1090
- bar = _ref.bar;
1091
-
1092
- var style = {};
1093
- var translate = 'translate' + bar.axis + '(' + move + '%)';
1094
-
1095
- style[bar.size] = size;
1096
- style.transform = translate;
1097
- style.msTransform = translate;
1098
- style.webkitTransform = translate;
1099
-
1100
- return style;
1101
- };
1102
- // CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
1103
-
1104
-
1105
-
1106
- /* istanbul ignore next */
1107
- /* harmony default export */ var src_bar = ({
1108
- name: 'Bar',
1109
-
1110
- props: {
1111
- vertical: Boolean,
1112
- size: String,
1113
- move: Number
1114
- },
1115
-
1116
- computed: {
1117
- bar: function bar() {
1118
- return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
1119
- },
1120
- wrap: function wrap() {
1121
- return this.$parent.wrap;
1122
- }
1123
- },
1124
-
1125
- render: function render(h) {
1126
- var size = this.size,
1127
- move = this.move,
1128
- bar = this.bar;
1129
-
1130
-
1131
- return h(
1132
- 'div',
1133
- {
1134
- 'class': ['el-scrollbar__bar', 'is-' + bar.key],
1135
- on: {
1136
- 'mousedown': this.clickTrackHandler
1137
- }
1138
- },
1139
- [h('div', {
1140
- ref: 'thumb',
1141
- 'class': 'el-scrollbar__thumb',
1142
- on: {
1143
- 'mousedown': this.clickThumbHandler
1144
- },
1145
-
1146
- style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
1147
- );
1148
- },
1149
-
1150
-
1151
- methods: {
1152
- clickThumbHandler: function clickThumbHandler(e) {
1153
- // prevent click event of right button
1154
- if (e.ctrlKey || e.button === 2) {
1155
- return;
1156
- }
1157
- this.startDrag(e);
1158
- this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
1159
- },
1160
- clickTrackHandler: function clickTrackHandler(e) {
1161
- var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
1162
- var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
1163
- var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
1164
-
1165
- this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
1166
- },
1167
- startDrag: function startDrag(e) {
1168
- e.stopImmediatePropagation();
1169
- this.cursorDown = true;
1170
-
1171
- Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
1172
- Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
1173
- document.onselectstart = function () {
1174
- return false;
1175
- };
1176
- },
1177
- mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
1178
- if (this.cursorDown === false) return;
1179
- var prevPage = this[this.bar.axis];
1180
-
1181
- if (!prevPage) return;
1182
-
1183
- var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
1184
- var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
1185
- var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
1186
-
1187
- this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
1188
- },
1189
- mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
1190
- this.cursorDown = false;
1191
- this[this.bar.axis] = 0;
1192
- Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
1193
- document.onselectstart = null;
1194
- }
1195
- },
1196
-
1197
- destroyed: function destroyed() {
1198
- Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
1199
- }
1200
- });
1201
- // CONCATENATED MODULE: ./packages/scrollbar/src/main.js
1202
- // reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
1203
-
1204
-
1205
-
1206
-
1207
-
1208
-
1209
- /* istanbul ignore next */
1210
- /* harmony default export */ var main = ({
1211
- name: 'ElScrollbar',
1212
-
1213
- components: { Bar: src_bar },
1214
-
1215
- props: {
1216
- native: Boolean,
1217
- wrapStyle: {},
1218
- wrapClass: {},
1219
- viewClass: {},
1220
- viewStyle: {},
1221
- noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
1222
- tag: {
1223
- type: String,
1224
- default: 'div'
1225
- }
1226
- },
1227
-
1228
- data: function data() {
1229
- return {
1230
- sizeWidth: '0',
1231
- sizeHeight: '0',
1232
- moveX: 0,
1233
- moveY: 0
1234
- };
1235
- },
1236
-
1237
-
1238
- computed: {
1239
- wrap: function wrap() {
1240
- return this.$refs.wrap;
1241
- }
1242
- },
1243
-
1244
- render: function render(h) {
1245
- var gutter = scrollbar_width_default()();
1246
- var style = this.wrapStyle;
1247
-
1248
- if (gutter) {
1249
- var gutterWith = '-' + gutter + 'px';
1250
- var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
1251
-
1252
- if (Array.isArray(this.wrapStyle)) {
1253
- style = Object(util_["toObject"])(this.wrapStyle);
1254
- style.marginRight = style.marginBottom = gutterWith;
1255
- } else if (typeof this.wrapStyle === 'string') {
1256
- style += gutterStyle;
1257
- } else {
1258
- style = gutterStyle;
1259
- }
1260
- }
1261
- var view = h(this.tag, {
1262
- class: ['el-scrollbar__view', this.viewClass],
1263
- style: this.viewStyle,
1264
- ref: 'resize'
1265
- }, this.$slots.default);
1266
- var wrap = h(
1267
- 'div',
1268
- {
1269
- ref: 'wrap',
1270
- style: style,
1271
- on: {
1272
- 'scroll': this.handleScroll
1273
- },
1274
-
1275
- 'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
1276
- [[view]]
1277
- );
1278
- var nodes = void 0;
1279
-
1280
- if (!this.native) {
1281
- nodes = [wrap, h(src_bar, {
1282
- attrs: {
1283
- move: this.moveX,
1284
- size: this.sizeWidth }
1285
- }), h(src_bar, {
1286
- attrs: {
1287
- vertical: true,
1288
- move: this.moveY,
1289
- size: this.sizeHeight }
1290
- })];
1291
- } else {
1292
- nodes = [h(
1293
- 'div',
1294
- {
1295
- ref: 'wrap',
1296
- 'class': [this.wrapClass, 'el-scrollbar__wrap'],
1297
- style: style },
1298
- [[view]]
1299
- )];
1300
- }
1301
- return h('div', { class: 'el-scrollbar' }, nodes);
1302
- },
1303
-
1304
-
1305
- methods: {
1306
- handleScroll: function handleScroll() {
1307
- var wrap = this.wrap;
1308
-
1309
- this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
1310
- this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
1311
- },
1312
- update: function update() {
1313
- var heightPercentage = void 0,
1314
- widthPercentage = void 0;
1315
- var wrap = this.wrap;
1316
- if (!wrap) return;
1317
-
1318
- heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
1319
- widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
1320
-
1321
- this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
1322
- this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
1323
- }
1324
- },
1325
-
1326
- mounted: function mounted() {
1327
- if (this.native) return;
1328
- this.$nextTick(this.update);
1329
- !this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
1330
- },
1331
- beforeDestroy: function beforeDestroy() {
1332
- if (this.native) return;
1333
- !this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
1334
- }
1335
- });
1336
- // CONCATENATED MODULE: ./packages/scrollbar/index.js
1337
-
1338
-
1339
- /* istanbul ignore next */
1340
- main.install = function (Vue) {
1341
- Vue.component(main.name, main);
1342
- };
1343
-
1344
- /* harmony default export */ var scrollbar = __webpack_exports__["default"] = (main);
1345
-
1346
- /***/ }),
1347
- /* 19 */,
1348
- /* 20 */,
1349
- /* 21 */,
1350
- /* 22 */,
1351
- /* 23 */
1352
- /***/ (function(module, exports) {
1353
-
1354
- module.exports = require("element-ui/lib/mixins/focus");
1355
-
1356
- /***/ }),
1357
- /* 24 */,
1358
- /* 25 */
1359
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1360
-
1361
- "use strict";
1362
-
1363
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option.vue?vue&type=template&id=2340096e
1364
- var render = function () {
1365
- var _vm = this
1366
- var _h = _vm.$createElement
1367
- var _c = _vm._self._c || _h
1368
- return _c(
1369
- "li",
1370
- {
1371
- directives: [
1372
- {
1373
- name: "show",
1374
- rawName: "v-show",
1375
- value: _vm.visible,
1376
- expression: "visible",
1377
- },
1378
- ],
1379
- staticClass: "el-select-dropdown__item",
1380
- class: {
1381
- selected: _vm.itemSelected,
1382
- "is-disabled": _vm.disabled || _vm.groupDisabled || _vm.limitReached,
1383
- hover: _vm.hover,
1384
- },
1385
- on: {
1386
- mouseenter: _vm.hoverItem,
1387
- click: function ($event) {
1388
- $event.stopPropagation()
1389
- return _vm.selectOptionClick($event)
1390
- },
1391
- },
1392
- },
1393
- [_vm._t("default", [_c("span", [_vm._v(_vm._s(_vm.currentLabel))])])],
1394
- 2
1395
- )
1396
- }
1397
- var staticRenderFns = []
1398
- render._withStripped = true
1399
-
1400
-
1401
- // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=template&id=2340096e
1402
-
1403
- // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
1404
- var emitter_ = __webpack_require__(4);
1405
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
1406
-
1407
- // EXTERNAL MODULE: external "element-ui/lib/utils/util"
1408
- var util_ = __webpack_require__(3);
1409
-
1410
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option.vue?vue&type=script&lang=js
1411
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1412
-
1413
- //
1414
- //
1415
- //
1416
- //
1417
- //
1418
- //
1419
- //
1420
- //
1421
- //
1422
- //
1423
- //
1424
- //
1425
- //
1426
- //
1427
- //
1428
- //
1429
- //
1430
-
1431
-
1432
-
1433
-
1434
- /* harmony default export */ var optionvue_type_script_lang_js = ({
1435
- mixins: [emitter_default.a],
1436
-
1437
- name: 'ElOption',
1438
-
1439
- componentName: 'ElOption',
1440
-
1441
- inject: ['select'],
1442
-
1443
- props: {
1444
- value: {
1445
- required: true
1446
- },
1447
- label: [String, Number],
1448
- created: Boolean,
1449
- disabled: {
1450
- type: Boolean,
1451
- default: false
1452
- }
1453
- },
1454
-
1455
- data: function data() {
1456
- return {
1457
- index: -1,
1458
- groupDisabled: false,
1459
- visible: true,
1460
- hitState: false,
1461
- hover: false
1462
- };
1463
- },
1464
-
1465
-
1466
- computed: {
1467
- isObject: function isObject() {
1468
- return Object.prototype.toString.call(this.value).toLowerCase() === '[object object]';
1469
- },
1470
- currentLabel: function currentLabel() {
1471
- return this.label || (this.isObject ? '' : this.value);
1472
- },
1473
- currentValue: function currentValue() {
1474
- return this.value || this.label || '';
1475
- },
1476
- itemSelected: function itemSelected() {
1477
- if (!this.select.multiple) {
1478
- return this.isEqual(this.value, this.select.value);
1479
- } else {
1480
- return this.contains(this.select.value, this.value);
1481
- }
1482
- },
1483
- limitReached: function limitReached() {
1484
- if (this.select.multiple) {
1485
- return !this.itemSelected && (this.select.value || []).length >= this.select.multipleLimit && this.select.multipleLimit > 0;
1486
- } else {
1487
- return false;
1488
- }
1489
- }
1490
- },
1491
-
1492
- watch: {
1493
- currentLabel: function currentLabel() {
1494
- if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
1495
- },
1496
- value: function value(val, oldVal) {
1497
- var _select = this.select,
1498
- remote = _select.remote,
1499
- valueKey = _select.valueKey;
1500
-
1501
- if (!this.created && !remote) {
1502
- if (valueKey && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && (typeof oldVal === 'undefined' ? 'undefined' : _typeof(oldVal)) === 'object' && val[valueKey] === oldVal[valueKey]) {
1503
- return;
1504
- }
1505
- this.dispatch('ElSelect', 'setSelected');
1506
- }
1507
- }
1508
- },
1509
-
1510
- methods: {
1511
- isEqual: function isEqual(a, b) {
1512
- if (!this.isObject) {
1513
- return a === b;
1514
- } else {
1515
- var valueKey = this.select.valueKey;
1516
- return Object(util_["getValueByPath"])(a, valueKey) === Object(util_["getValueByPath"])(b, valueKey);
1517
- }
1518
- },
1519
- contains: function contains() {
1520
- var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1521
- var target = arguments[1];
1522
-
1523
- if (!this.isObject) {
1524
- return arr && arr.indexOf(target) > -1;
1525
- } else {
1526
- var valueKey = this.select.valueKey;
1527
- return arr && arr.some(function (item) {
1528
- return Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(target, valueKey);
1529
- });
1530
- }
1531
- },
1532
- handleGroupDisabled: function handleGroupDisabled(val) {
1533
- this.groupDisabled = val;
1534
- },
1535
- hoverItem: function hoverItem() {
1536
- if (!this.disabled && !this.groupDisabled) {
1537
- this.select.hoverIndex = this.select.options.indexOf(this);
1538
- }
1539
- },
1540
- selectOptionClick: function selectOptionClick() {
1541
- if (this.disabled !== true && this.groupDisabled !== true) {
1542
- this.dispatch('ElSelect', 'handleOptionClick', [this, true]);
1543
- }
1544
- },
1545
- queryChange: function queryChange(query) {
1546
- this.visible = new RegExp(Object(util_["escapeRegexpString"])(query), 'i').test(this.currentLabel) || this.created;
1547
- if (!this.visible) {
1548
- this.select.filteredOptionsCount--;
1549
- }
1550
- }
1551
- },
1552
-
1553
- created: function created() {
1554
- this.select.options.push(this);
1555
- this.select.cachedOptions.push(this);
1556
- this.select.optionsCount++;
1557
- this.select.filteredOptionsCount++;
1558
-
1559
- this.$on('queryChange', this.queryChange);
1560
- this.$on('handleGroupDisabled', this.handleGroupDisabled);
1561
- },
1562
- beforeDestroy: function beforeDestroy() {
1563
- var _select2 = this.select,
1564
- selected = _select2.selected,
1565
- multiple = _select2.multiple;
1566
-
1567
- var selectedOptions = multiple ? selected : [selected];
1568
- var index = this.select.cachedOptions.indexOf(this);
1569
- var selectedIndex = selectedOptions.indexOf(this);
1570
-
1571
- // if option is not selected, remove it from cache
1572
- if (index > -1 && selectedIndex < 0) {
1573
- this.select.cachedOptions.splice(index, 1);
1574
- }
1575
- this.select.onOptionDestroy(this.select.options.indexOf(this));
1576
- }
1577
- });
1578
- // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=script&lang=js
1579
- /* harmony default export */ var src_optionvue_type_script_lang_js = (optionvue_type_script_lang_js);
1580
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1581
- var componentNormalizer = __webpack_require__(0);
1582
-
1583
- // CONCATENATED MODULE: ./packages/select/src/option.vue
1584
-
1585
-
1586
-
1587
-
1588
-
1589
- /* normalize component */
1590
-
1591
- var component = Object(componentNormalizer["a" /* default */])(
1592
- src_optionvue_type_script_lang_js,
1593
- render,
1594
- staticRenderFns,
1595
- false,
1596
- null,
1597
- null,
1598
- null
1599
-
1600
- )
1601
-
1602
- /* harmony default export */ var src_option = __webpack_exports__["a"] = (component.exports);
1603
-
1604
- /***/ }),
1605
- /* 26 */
1606
- /***/ (function(module, exports) {
1607
-
1608
- module.exports = require("element-ui/lib/utils/scroll-into-view");
1609
-
1610
- /***/ }),
1611
- /* 27 */,
1612
- /* 28 */,
1613
- /* 29 */,
1614
- /* 30 */
1615
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1616
-
1617
- "use strict";
1618
- // ESM COMPAT FLAG
1619
- __webpack_require__.r(__webpack_exports__);
1620
-
1621
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tag/src/tag.vue?vue&type=script&lang=js
1622
-
1623
- /* harmony default export */ var tagvue_type_script_lang_js = ({
1624
- name: 'ElTag',
1625
- props: {
1626
- text: String,
1627
- closable: Boolean,
1628
- type: String,
1629
- hit: Boolean,
1630
- disableTransitions: Boolean,
1631
- color: String,
1632
- size: String,
1633
- effect: {
1634
- type: String,
1635
- default: 'light',
1636
- validator: function validator(val) {
1637
- return ['dark', 'light', 'plain'].indexOf(val) !== -1;
1638
- }
1639
- }
1640
- },
1641
- methods: {
1642
- handleClose: function handleClose(event) {
1643
- event.stopPropagation();
1644
- this.$emit('close', event);
1645
- },
1646
- handleClick: function handleClick(event) {
1647
- this.$emit('click', event);
1648
- }
1649
- },
1650
- computed: {
1651
- tagSize: function tagSize() {
1652
- return this.size || (this.$ELEMENT || {}).size;
1653
- }
1654
- },
1655
- render: function render(h) {
1656
- var type = this.type,
1657
- tagSize = this.tagSize,
1658
- hit = this.hit,
1659
- effect = this.effect;
1660
-
1661
- var classes = ['el-tag', type ? 'el-tag--' + type : '', tagSize ? 'el-tag--' + tagSize : '', effect ? 'el-tag--' + effect : '', hit && 'is-hit'];
1662
- var tagEl = h(
1663
- 'span',
1664
- {
1665
- 'class': classes,
1666
- style: { backgroundColor: this.color },
1667
- on: {
1668
- 'click': this.handleClick
1669
- }
1670
- },
1671
- [this.$slots.default, this.closable && h('i', { 'class': 'el-tag__close el-icon-close', on: {
1672
- 'click': this.handleClose
1673
- }
1674
- })]
1675
- );
1676
-
1677
- return this.disableTransitions ? tagEl : h(
1678
- 'transition',
1679
- {
1680
- attrs: { name: 'el-zoom-in-center' }
1681
- },
1682
- [tagEl]
1683
- );
1684
- }
1685
- });
1686
- // CONCATENATED MODULE: ./packages/tag/src/tag.vue?vue&type=script&lang=js
1687
- /* harmony default export */ var src_tagvue_type_script_lang_js = (tagvue_type_script_lang_js);
1688
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1689
- var componentNormalizer = __webpack_require__(0);
1690
-
1691
- // CONCATENATED MODULE: ./packages/tag/src/tag.vue
1692
- var render, staticRenderFns
1693
-
1694
-
1695
-
1696
-
1697
- /* normalize component */
1698
-
1699
- var component = Object(componentNormalizer["a" /* default */])(
1700
- src_tagvue_type_script_lang_js,
1701
- render,
1702
- staticRenderFns,
1703
- false,
1704
- null,
1705
- null,
1706
- null
1707
-
1708
- )
1709
-
1710
- /* harmony default export */ var tag = (component.exports);
1711
- // CONCATENATED MODULE: ./packages/tag/index.js
1712
-
1713
-
1714
- /* istanbul ignore next */
1715
- tag.install = function (Vue) {
1716
- Vue.component(tag.name, tag);
1717
- };
1718
-
1719
- /* harmony default export */ var packages_tag = __webpack_exports__["default"] = (tag);
1720
-
1721
- /***/ }),
1722
- /* 31 */,
1723
- /* 32 */,
1724
- /* 33 */,
1725
- /* 34 */,
1726
- /* 35 */,
1727
- /* 36 */,
1728
- /* 37 */,
1729
- /* 38 */,
1730
- /* 39 */,
1731
- /* 40 */,
1732
- /* 41 */,
1733
- /* 42 */,
1734
- /* 43 */,
1735
- /* 44 */,
1736
- /* 45 */
1737
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1738
-
1739
- "use strict";
1740
- __webpack_require__.r(__webpack_exports__);
1741
- /* harmony import */ var _select_src_option__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
1742
-
1743
-
1744
- /* istanbul ignore next */
1745
- _select_src_option__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].install = function (Vue) {
1746
- Vue.component(_select_src_option__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].name, _select_src_option__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
1747
- };
1748
-
1749
- /* harmony default export */ __webpack_exports__["default"] = (_select_src_option__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
1750
-
1751
- /***/ }),
1752
- /* 46 */,
1753
- /* 47 */,
1754
- /* 48 */
1755
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1756
-
1757
- "use strict";
1758
- // ESM COMPAT FLAG
1759
- __webpack_require__.r(__webpack_exports__);
1760
-
1761
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=template&id=0f48f6e9
1762
- var render = function () {
1763
- var _vm = this
1764
- var _h = _vm.$createElement
1765
- var _c = _vm._self._c || _h
1766
- return _c(
1767
- "div",
1768
- {
1769
- directives: [
1770
- {
1771
- name: "clickoutside",
1772
- rawName: "v-clickoutside",
1773
- value: _vm.handleClose,
1774
- expression: "handleClose",
1775
- },
1776
- ],
1777
- staticClass: "el-select",
1778
- class: [_vm.selectSize ? "el-select--" + _vm.selectSize : ""],
1779
- on: {
1780
- click: function ($event) {
1781
- $event.stopPropagation()
1782
- return _vm.toggleMenu($event)
1783
- },
1784
- },
1785
- },
1786
- [
1787
- _vm.multiple
1788
- ? _c(
1789
- "div",
1790
- {
1791
- ref: "tags",
1792
- staticClass: "el-select__tags",
1793
- style: { "max-width": _vm.inputWidth - 32 + "px", width: "100%" },
1794
- },
1795
- [
1796
- _vm.collapseTags && _vm.selected.length
1797
- ? _c(
1798
- "span",
1799
- [
1800
- _c(
1801
- "el-tag",
1802
- {
1803
- attrs: {
1804
- closable: !_vm.selectDisabled,
1805
- size: _vm.collapseTagSize,
1806
- hit: _vm.selected[0].hitState,
1807
- type: "info",
1808
- "disable-transitions": "",
1809
- },
1810
- on: {
1811
- close: function ($event) {
1812
- _vm.deleteTag($event, _vm.selected[0])
1813
- },
1814
- },
1815
- },
1816
- [
1817
- _c("span", { staticClass: "el-select__tags-text" }, [
1818
- _vm._v(_vm._s(_vm.selected[0].currentLabel)),
1819
- ]),
1820
- ]
1821
- ),
1822
- _vm.selected.length > 1
1823
- ? _c(
1824
- "el-tag",
1825
- {
1826
- attrs: {
1827
- closable: false,
1828
- size: _vm.collapseTagSize,
1829
- type: "info",
1830
- "disable-transitions": "",
1831
- },
1832
- },
1833
- [
1834
- _c(
1835
- "span",
1836
- { staticClass: "el-select__tags-text" },
1837
- [_vm._v("+ " + _vm._s(_vm.selected.length - 1))]
1838
- ),
1839
- ]
1840
- )
1841
- : _vm._e(),
1842
- ],
1843
- 1
1844
- )
1845
- : _vm._e(),
1846
- !_vm.collapseTags
1847
- ? _c(
1848
- "transition-group",
1849
- { on: { "after-leave": _vm.resetInputHeight } },
1850
- _vm._l(_vm.selected, function (item) {
1851
- return _c(
1852
- "el-tag",
1853
- {
1854
- key: _vm.getValueKey(item),
1855
- attrs: {
1856
- closable: !_vm.selectDisabled,
1857
- size: _vm.collapseTagSize,
1858
- hit: item.hitState,
1859
- type: "info",
1860
- "disable-transitions": "",
1861
- },
1862
- on: {
1863
- close: function ($event) {
1864
- _vm.deleteTag($event, item)
1865
- },
1866
- },
1867
- },
1868
- [
1869
- _c("span", { staticClass: "el-select__tags-text" }, [
1870
- _vm._v(_vm._s(item.currentLabel)),
1871
- ]),
1872
- ]
1873
- )
1874
- }),
1875
- 1
1876
- )
1877
- : _vm._e(),
1878
- _vm.filterable
1879
- ? _c("input", {
1880
- directives: [
1881
- {
1882
- name: "model",
1883
- rawName: "v-model",
1884
- value: _vm.query,
1885
- expression: "query",
1886
- },
1887
- ],
1888
- ref: "input",
1889
- staticClass: "el-select__input",
1890
- class: [_vm.selectSize ? "is-" + _vm.selectSize : ""],
1891
- style: {
1892
- "flex-grow": "1",
1893
- width: _vm.inputLength / (_vm.inputWidth - 32) + "%",
1894
- "max-width": _vm.inputWidth - 42 + "px",
1895
- },
1896
- attrs: {
1897
- type: "text",
1898
- disabled: _vm.selectDisabled,
1899
- autocomplete: _vm.autoComplete || _vm.autocomplete,
1900
- },
1901
- domProps: { value: _vm.query },
1902
- on: {
1903
- focus: _vm.handleFocus,
1904
- blur: function ($event) {
1905
- _vm.softFocus = false
1906
- },
1907
- keyup: _vm.managePlaceholder,
1908
- keydown: [
1909
- _vm.resetInputState,
1910
- function ($event) {
1911
- if (
1912
- !("button" in $event) &&
1913
- _vm._k($event.keyCode, "down", 40, $event.key, [
1914
- "Down",
1915
- "ArrowDown",
1916
- ])
1917
- ) {
1918
- return null
1919
- }
1920
- $event.preventDefault()
1921
- _vm.handleNavigate("next")
1922
- },
1923
- function ($event) {
1924
- if (
1925
- !("button" in $event) &&
1926
- _vm._k($event.keyCode, "up", 38, $event.key, [
1927
- "Up",
1928
- "ArrowUp",
1929
- ])
1930
- ) {
1931
- return null
1932
- }
1933
- $event.preventDefault()
1934
- _vm.handleNavigate("prev")
1935
- },
1936
- function ($event) {
1937
- if (
1938
- !("button" in $event) &&
1939
- _vm._k(
1940
- $event.keyCode,
1941
- "enter",
1942
- 13,
1943
- $event.key,
1944
- "Enter"
1945
- )
1946
- ) {
1947
- return null
1948
- }
1949
- $event.preventDefault()
1950
- return _vm.selectOption($event)
1951
- },
1952
- function ($event) {
1953
- if (
1954
- !("button" in $event) &&
1955
- _vm._k($event.keyCode, "esc", 27, $event.key, [
1956
- "Esc",
1957
- "Escape",
1958
- ])
1959
- ) {
1960
- return null
1961
- }
1962
- $event.stopPropagation()
1963
- $event.preventDefault()
1964
- _vm.visible = false
1965
- },
1966
- function ($event) {
1967
- if (
1968
- !("button" in $event) &&
1969
- _vm._k(
1970
- $event.keyCode,
1971
- "delete",
1972
- [8, 46],
1973
- $event.key,
1974
- ["Backspace", "Delete", "Del"]
1975
- )
1976
- ) {
1977
- return null
1978
- }
1979
- return _vm.deletePrevTag($event)
1980
- },
1981
- function ($event) {
1982
- if (
1983
- !("button" in $event) &&
1984
- _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
1985
- ) {
1986
- return null
1987
- }
1988
- _vm.visible = false
1989
- },
1990
- ],
1991
- compositionstart: _vm.handleComposition,
1992
- compositionupdate: _vm.handleComposition,
1993
- compositionend: _vm.handleComposition,
1994
- input: [
1995
- function ($event) {
1996
- if ($event.target.composing) {
1997
- return
1998
- }
1999
- _vm.query = $event.target.value
2000
- },
2001
- _vm.debouncedQueryChange,
2002
- ],
2003
- },
2004
- })
2005
- : _vm._e(),
2006
- ],
2007
- 1
2008
- )
2009
- : _vm._e(),
2010
- _c(
2011
- "el-input",
2012
- {
2013
- ref: "reference",
2014
- class: { "is-focus": _vm.visible },
2015
- attrs: {
2016
- type: "text",
2017
- placeholder: _vm.currentPlaceholder,
2018
- name: _vm.name,
2019
- id: _vm.id,
2020
- autocomplete: _vm.autoComplete || _vm.autocomplete,
2021
- size: _vm.selectSize,
2022
- disabled: _vm.selectDisabled,
2023
- readonly: _vm.readonly,
2024
- "validate-event": false,
2025
- tabindex: _vm.multiple && _vm.filterable ? "-1" : null,
2026
- },
2027
- on: {
2028
- focus: _vm.handleFocus,
2029
- blur: _vm.handleBlur,
2030
- input: _vm.debouncedOnInputChange,
2031
- compositionstart: _vm.handleComposition,
2032
- compositionupdate: _vm.handleComposition,
2033
- compositionend: _vm.handleComposition,
2034
- },
2035
- nativeOn: {
2036
- keydown: [
2037
- function ($event) {
2038
- if (
2039
- !("button" in $event) &&
2040
- _vm._k($event.keyCode, "down", 40, $event.key, [
2041
- "Down",
2042
- "ArrowDown",
2043
- ])
2044
- ) {
2045
- return null
2046
- }
2047
- $event.stopPropagation()
2048
- $event.preventDefault()
2049
- _vm.handleNavigate("next")
2050
- },
2051
- function ($event) {
2052
- if (
2053
- !("button" in $event) &&
2054
- _vm._k($event.keyCode, "up", 38, $event.key, [
2055
- "Up",
2056
- "ArrowUp",
2057
- ])
2058
- ) {
2059
- return null
2060
- }
2061
- $event.stopPropagation()
2062
- $event.preventDefault()
2063
- _vm.handleNavigate("prev")
2064
- },
2065
- function ($event) {
2066
- if (
2067
- !("button" in $event) &&
2068
- _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
2069
- ) {
2070
- return null
2071
- }
2072
- $event.preventDefault()
2073
- return _vm.selectOption($event)
2074
- },
2075
- function ($event) {
2076
- if (
2077
- !("button" in $event) &&
2078
- _vm._k($event.keyCode, "esc", 27, $event.key, [
2079
- "Esc",
2080
- "Escape",
2081
- ])
2082
- ) {
2083
- return null
2084
- }
2085
- $event.stopPropagation()
2086
- $event.preventDefault()
2087
- _vm.visible = false
2088
- },
2089
- function ($event) {
2090
- if (
2091
- !("button" in $event) &&
2092
- _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
2093
- ) {
2094
- return null
2095
- }
2096
- _vm.visible = false
2097
- },
2098
- ],
2099
- mouseenter: function ($event) {
2100
- _vm.inputHovering = true
2101
- },
2102
- mouseleave: function ($event) {
2103
- _vm.inputHovering = false
2104
- },
2105
- },
2106
- model: {
2107
- value: _vm.selectedLabel,
2108
- callback: function ($$v) {
2109
- _vm.selectedLabel = $$v
2110
- },
2111
- expression: "selectedLabel",
2112
- },
2113
- },
2114
- [
2115
- _vm.$slots.prefix
2116
- ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
2117
- : _vm._e(),
2118
- _c("template", { slot: "suffix" }, [
2119
- _c("i", {
2120
- directives: [
2121
- {
2122
- name: "show",
2123
- rawName: "v-show",
2124
- value: !_vm.showClose,
2125
- expression: "!showClose",
2126
- },
2127
- ],
2128
- class: [
2129
- "el-select__caret",
2130
- "el-input__icon",
2131
- "el-icon-" + _vm.iconClass,
2132
- ],
2133
- }),
2134
- _vm.showClose
2135
- ? _c("i", {
2136
- staticClass:
2137
- "el-select__caret el-input__icon el-icon-circle-close",
2138
- on: { click: _vm.handleClearClick },
2139
- })
2140
- : _vm._e(),
2141
- ]),
2142
- ],
2143
- 2
2144
- ),
2145
- _c(
2146
- "transition",
2147
- {
2148
- attrs: { name: "el-zoom-in-top" },
2149
- on: {
2150
- "before-enter": _vm.handleMenuEnter,
2151
- "after-leave": _vm.doDestroy,
2152
- },
2153
- },
2154
- [
2155
- _c(
2156
- "el-select-menu",
2157
- {
2158
- directives: [
2159
- {
2160
- name: "show",
2161
- rawName: "v-show",
2162
- value: _vm.visible && _vm.emptyText !== false,
2163
- expression: "visible && emptyText !== false",
2164
- },
2165
- ],
2166
- ref: "popper",
2167
- attrs: { "append-to-body": _vm.popperAppendToBody },
2168
- },
2169
- [
2170
- _c(
2171
- "el-scrollbar",
2172
- {
2173
- directives: [
2174
- {
2175
- name: "show",
2176
- rawName: "v-show",
2177
- value: _vm.options.length > 0 && !_vm.loading,
2178
- expression: "options.length > 0 && !loading",
2179
- },
2180
- ],
2181
- ref: "scrollbar",
2182
- class: {
2183
- "is-empty":
2184
- !_vm.allowCreate &&
2185
- _vm.query &&
2186
- _vm.filteredOptionsCount === 0,
2187
- },
2188
- attrs: {
2189
- tag: "ul",
2190
- "wrap-class": "el-select-dropdown__wrap",
2191
- "view-class": "el-select-dropdown__list",
2192
- },
2193
- },
2194
- [
2195
- _vm.showNewOption
2196
- ? _c("el-option", {
2197
- attrs: { value: _vm.query, created: "" },
2198
- })
2199
- : _vm._e(),
2200
- _vm._t("default"),
2201
- ],
2202
- 2
2203
- ),
2204
- _vm.emptyText &&
2205
- (!_vm.allowCreate ||
2206
- _vm.loading ||
2207
- (_vm.allowCreate && _vm.options.length === 0))
2208
- ? [
2209
- _vm.$slots.empty
2210
- ? _vm._t("empty")
2211
- : _c("p", { staticClass: "el-select-dropdown__empty" }, [
2212
- _vm._v(
2213
- "\n\t\t\t\t\t" +
2214
- _vm._s(_vm.emptyText) +
2215
- "\n\t\t\t\t"
2216
- ),
2217
- ]),
2218
- ]
2219
- : _vm._e(),
2220
- ],
2221
- 2
2222
- ),
2223
- ],
2224
- 1
2225
- ),
2226
- ],
2227
- 1
2228
- )
2229
- }
2230
- var staticRenderFns = []
2231
- render._withStripped = true
2232
-
2233
-
2234
- // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=0f48f6e9
2235
-
2236
- // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
2237
- var emitter_ = __webpack_require__(4);
2238
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
2239
-
2240
- // EXTERNAL MODULE: external "element-ui/lib/mixins/focus"
2241
- var focus_ = __webpack_require__(23);
2242
- var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
2243
-
2244
- // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
2245
- var locale_ = __webpack_require__(9);
2246
- var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
2247
-
2248
- // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
2249
- var packages_input = __webpack_require__(13);
2250
-
2251
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select-dropdown.vue?vue&type=template&id=278c4356
2252
- var select_dropdownvue_type_template_id_278c4356_render = function () {
2253
- var _vm = this
2254
- var _h = _vm.$createElement
2255
- var _c = _vm._self._c || _h
2256
- return _c(
2257
- "div",
2258
- {
2259
- staticClass: "el-select-dropdown el-popper",
2260
- class: [{ "is-multiple": _vm.$parent.multiple }, _vm.popperClass],
2261
- style: { minWidth: _vm.minWidth },
2262
- },
2263
- [_vm._t("default")],
2264
- 2
2265
- )
2266
- }
2267
- var select_dropdownvue_type_template_id_278c4356_staticRenderFns = []
2268
- select_dropdownvue_type_template_id_278c4356_render._withStripped = true
2269
-
2270
-
2271
- // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=template&id=278c4356
2272
-
2273
- // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
2274
- var vue_popper_ = __webpack_require__(5);
2275
- var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
2276
-
2277
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select-dropdown.vue?vue&type=script&lang=js
2278
- //
2279
- //
2280
- //
2281
- //
2282
- //
2283
- //
2284
- //
2285
- //
2286
- //
2287
-
2288
-
2289
-
2290
- /* harmony default export */ var select_dropdownvue_type_script_lang_js = ({
2291
- name: 'ElSelectDropdown',
2292
-
2293
- componentName: 'ElSelectDropdown',
2294
-
2295
- mixins: [vue_popper_default.a],
2296
-
2297
- props: {
2298
- placement: {
2299
- default: 'bottom-start'
2300
- },
2301
-
2302
- boundariesPadding: {
2303
- default: 0
2304
- },
2305
-
2306
- popperOptions: {
2307
- default: function _default() {
2308
- return {
2309
- gpuAcceleration: false
2310
- };
2311
- }
2312
- },
2313
-
2314
- visibleArrow: {
2315
- default: true
2316
- },
2317
-
2318
- appendToBody: {
2319
- type: Boolean,
2320
- default: true
2321
- }
2322
- },
2323
-
2324
- data: function data() {
2325
- return {
2326
- minWidth: ''
2327
- };
2328
- },
2329
-
2330
-
2331
- computed: {
2332
- popperClass: function popperClass() {
2333
- return this.$parent.popperClass;
2334
- }
2335
- },
2336
-
2337
- watch: {
2338
- '$parent.inputWidth': function $parentInputWidth() {
2339
- this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
2340
- }
2341
- },
2342
-
2343
- mounted: function mounted() {
2344
- var _this = this;
2345
-
2346
- this.referenceElm = this.$parent.$refs.reference.$el;
2347
- this.$parent.popperElm = this.popperElm = this.$el;
2348
- this.$on('updatePopper', function () {
2349
- if (_this.$parent.visible) _this.updatePopper();
2350
- });
2351
- this.$on('destroyPopper', this.destroyPopper);
2352
- }
2353
- });
2354
- // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=script&lang=js
2355
- /* harmony default export */ var src_select_dropdownvue_type_script_lang_js = (select_dropdownvue_type_script_lang_js);
2356
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2357
- var componentNormalizer = __webpack_require__(0);
2358
-
2359
- // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue
2360
-
2361
-
2362
-
2363
-
2364
-
2365
- /* normalize component */
2366
-
2367
- var component = Object(componentNormalizer["a" /* default */])(
2368
- src_select_dropdownvue_type_script_lang_js,
2369
- select_dropdownvue_type_template_id_278c4356_render,
2370
- select_dropdownvue_type_template_id_278c4356_staticRenderFns,
2371
- false,
2372
- null,
2373
- null,
2374
- null
2375
-
2376
- )
2377
-
2378
- /* harmony default export */ var select_dropdown = (component.exports);
2379
- // EXTERNAL MODULE: ./packages/select/src/option.vue + 4 modules
2380
- var src_option = __webpack_require__(25);
2381
-
2382
- // EXTERNAL MODULE: ./packages/tag/index.js + 3 modules
2383
- var tag = __webpack_require__(30);
2384
-
2385
- // EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
2386
- var scrollbar = __webpack_require__(18);
2387
-
2388
- // EXTERNAL MODULE: external "throttle-debounce/debounce"
2389
- var debounce_ = __webpack_require__(15);
2390
- var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
2391
-
2392
- // EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside"
2393
- var clickoutside_ = __webpack_require__(14);
2394
- var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
2395
-
2396
- // EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
2397
- var resize_event_ = __webpack_require__(10);
2398
-
2399
- // EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view"
2400
- var scroll_into_view_ = __webpack_require__(26);
2401
- var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
2402
-
2403
- // EXTERNAL MODULE: external "element-ui/lib/utils/util"
2404
- var util_ = __webpack_require__(3);
2405
-
2406
- // CONCATENATED MODULE: ./packages/select/src/navigation-mixin.js
2407
- /* harmony default export */ var navigation_mixin = ({
2408
- data: function data() {
2409
- return {
2410
- hoverOption: -1
2411
- };
2412
- },
2413
-
2414
-
2415
- computed: {
2416
- optionsAllDisabled: function optionsAllDisabled() {
2417
- return this.options.filter(function (option) {
2418
- return option.visible;
2419
- }).every(function (option) {
2420
- return option.disabled;
2421
- });
2422
- }
2423
- },
2424
-
2425
- watch: {
2426
- hoverIndex: function hoverIndex(val) {
2427
- var _this = this;
2428
-
2429
- if (typeof val === 'number' && val > -1) {
2430
- this.hoverOption = this.options[val] || {};
2431
- }
2432
- this.options.forEach(function (option) {
2433
- option.hover = _this.hoverOption === option;
2434
- });
2435
- }
2436
- },
2437
-
2438
- methods: {
2439
- navigateOptions: function navigateOptions(direction) {
2440
- var _this2 = this;
2441
-
2442
- if (!this.visible) {
2443
- this.visible = true;
2444
- return;
2445
- }
2446
- if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
2447
- if (!this.optionsAllDisabled) {
2448
- if (direction === 'next') {
2449
- this.hoverIndex++;
2450
- if (this.hoverIndex === this.options.length) {
2451
- this.hoverIndex = 0;
2452
- }
2453
- } else if (direction === 'prev') {
2454
- this.hoverIndex--;
2455
- if (this.hoverIndex < 0) {
2456
- this.hoverIndex = this.options.length - 1;
2457
- }
2458
- }
2459
- var option = this.options[this.hoverIndex];
2460
- if (option.disabled === true || option.groupDisabled === true || !option.visible) {
2461
- this.navigateOptions(direction);
2462
- }
2463
- this.$nextTick(function () {
2464
- return _this2.scrollToOption(_this2.hoverOption);
2465
- });
2466
- }
2467
- }
2468
- }
2469
- });
2470
- // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
2471
- var shared_ = __webpack_require__(11);
2472
-
2473
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=script&lang=js
2474
- //
2475
- //
2476
- //
2477
- //
2478
- //
2479
- //
2480
- //
2481
- //
2482
- //
2483
- //
2484
- //
2485
- //
2486
- //
2487
- //
2488
- //
2489
- //
2490
- //
2491
- //
2492
- //
2493
- //
2494
- //
2495
- //
2496
- //
2497
- //
2498
- //
2499
- //
2500
- //
2501
- //
2502
- //
2503
- //
2504
- //
2505
- //
2506
- //
2507
- //
2508
- //
2509
- //
2510
- //
2511
- //
2512
- //
2513
- //
2514
- //
2515
- //
2516
- //
2517
- //
2518
- //
2519
- //
2520
- //
2521
- //
2522
- //
2523
- //
2524
- //
2525
- //
2526
- //
2527
- //
2528
- //
2529
- //
2530
- //
2531
- //
2532
- //
2533
- //
2534
- //
2535
- //
2536
- //
2537
- //
2538
- //
2539
- //
2540
- //
2541
- //
2542
- //
2543
- //
2544
- //
2545
- //
2546
- //
2547
- //
2548
- //
2549
- //
2550
- //
2551
- //
2552
- //
2553
- //
2554
- //
2555
- //
2556
- //
2557
- //
2558
- //
2559
- //
2560
- //
2561
- //
2562
- //
2563
- //
2564
- //
2565
- //
2566
- //
2567
- //
2568
- //
2569
- //
2570
- //
2571
- //
2572
- //
2573
- //
2574
- //
2575
- //
2576
- //
2577
- //
2578
- //
2579
- //
2580
- //
2581
- //
2582
- //
2583
- //
2584
- //
2585
- //
2586
- //
2587
- //
2588
- //
2589
- //
2590
- //
2591
- //
2592
- //
2593
- //
2594
- //
2595
- //
2596
- //
2597
- //
2598
- //
2599
- //
2600
- //
2601
- //
2602
- //
2603
- //
2604
- //
2605
- //
2606
- //
2607
- //
2608
- //
2609
- //
2610
- //
2611
-
2612
-
2613
-
2614
-
2615
-
2616
-
2617
-
2618
-
2619
-
2620
-
2621
-
2622
-
2623
-
2624
-
2625
-
2626
-
2627
-
2628
- /* harmony default export */ var selectvue_type_script_lang_js = ({
2629
- mixins: [emitter_default.a, locale_default.a, focus_default()('reference'), navigation_mixin],
2630
-
2631
- name: 'ElSelect',
2632
-
2633
- componentName: 'ElSelect',
2634
-
2635
- inject: {
2636
- elForm: {
2637
- default: ''
2638
- },
2639
-
2640
- elFormItem: {
2641
- default: ''
2642
- }
2643
- },
2644
-
2645
- provide: function provide() {
2646
- return {
2647
- 'select': this
2648
- };
2649
- },
2650
-
2651
-
2652
- computed: {
2653
- _elFormItemSize: function _elFormItemSize() {
2654
- return (this.elFormItem || {}).elFormItemSize;
2655
- },
2656
- readonly: function readonly() {
2657
- return !this.filterable || this.multiple || !Object(util_["isIE"])() && !Object(util_["isEdge"])() && !this.visible;
2658
- },
2659
- showClose: function showClose() {
2660
- var hasValue = this.multiple ? Array.isArray(this.value) && this.value.length > 0 : this.value !== undefined && this.value !== null && this.value !== '';
2661
- var criteria = this.clearable && !this.selectDisabled && this.inputHovering && hasValue;
2662
- return criteria;
2663
- },
2664
- iconClass: function iconClass() {
2665
- return this.remote && this.filterable ? '' : this.visible ? 'arrow-up is-reverse' : 'arrow-up';
2666
- },
2667
- debounce: function debounce() {
2668
- return this.remote ? 300 : 0;
2669
- },
2670
- emptyText: function emptyText() {
2671
- if (this.loading) {
2672
- return this.loadingText || this.t('el.select.loading');
2673
- } else {
2674
- if (this.remote && this.query === '' && this.options.length === 0) return false;
2675
- if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
2676
- return this.noMatchText || this.t('el.select.noMatch');
2677
- }
2678
- if (this.options.length === 0) {
2679
- return this.noDataText || this.t('el.select.noData');
2680
- }
2681
- }
2682
- return null;
2683
- },
2684
- showNewOption: function showNewOption() {
2685
- var _this = this;
2686
-
2687
- var hasExistingOption = this.options.filter(function (option) {
2688
- return !option.created;
2689
- }).some(function (option) {
2690
- return option.currentLabel === _this.query;
2691
- });
2692
- return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
2693
- },
2694
- selectSize: function selectSize() {
2695
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
2696
- },
2697
- selectDisabled: function selectDisabled() {
2698
- return this.disabled || (this.elForm || {}).disabled;
2699
- },
2700
- collapseTagSize: function collapseTagSize() {
2701
- return ['small', 'mini'].indexOf(this.selectSize) > -1 ? 'mini' : 'small';
2702
- },
2703
- propPlaceholder: function propPlaceholder() {
2704
- return typeof this.placeholder !== 'undefined' ? this.placeholder : this.t('el.select.placeholder');
2705
- }
2706
- },
2707
-
2708
- components: {
2709
- ElInput: packages_input["default"],
2710
- ElSelectMenu: select_dropdown,
2711
- ElOption: src_option["a" /* default */],
2712
- ElTag: tag["default"],
2713
- ElScrollbar: scrollbar["default"]
2714
- },
2715
-
2716
- directives: { Clickoutside: clickoutside_default.a },
2717
-
2718
- props: {
2719
- name: String,
2720
- id: String,
2721
- value: {
2722
- required: true
2723
- },
2724
- autocomplete: {
2725
- type: String,
2726
- default: 'off'
2727
- },
2728
- /** @Deprecated in next major version */
2729
- autoComplete: {
2730
- type: String,
2731
- validator: function validator(val) {
2732
- false && false;
2733
- return true;
2734
- }
2735
- },
2736
- automaticDropdown: Boolean,
2737
- size: String,
2738
- disabled: Boolean,
2739
- clearable: Boolean,
2740
- filterable: Boolean,
2741
- allowCreate: Boolean,
2742
- loading: Boolean,
2743
- popperClass: String,
2744
- remote: Boolean,
2745
- loadingText: String,
2746
- noMatchText: String,
2747
- noDataText: String,
2748
- remoteMethod: Function,
2749
- filterMethod: Function,
2750
- multiple: Boolean,
2751
- multipleLimit: {
2752
- type: Number,
2753
- default: 0
2754
- },
2755
- placeholder: {
2756
- type: String,
2757
- required: false
2758
- },
2759
- defaultFirstOption: Boolean,
2760
- reserveKeyword: Boolean,
2761
- valueKey: {
2762
- type: String,
2763
- default: 'value'
2764
- },
2765
- collapseTags: Boolean,
2766
- popperAppendToBody: {
2767
- type: Boolean,
2768
- default: true
2769
- }
2770
- },
2771
-
2772
- data: function data() {
2773
- return {
2774
- options: [],
2775
- cachedOptions: [],
2776
- createdLabel: null,
2777
- createdSelected: false,
2778
- selected: this.multiple ? [] : {},
2779
- inputLength: 20,
2780
- inputWidth: 0,
2781
- initialInputHeight: 0,
2782
- cachedPlaceHolder: '',
2783
- optionsCount: 0,
2784
- filteredOptionsCount: 0,
2785
- visible: false,
2786
- softFocus: false,
2787
- selectedLabel: '',
2788
- hoverIndex: -1,
2789
- query: '',
2790
- previousQuery: null,
2791
- inputHovering: false,
2792
- currentPlaceholder: '',
2793
- menuVisibleOnFocus: false,
2794
- isOnComposition: false,
2795
- isSilentBlur: false
2796
- };
2797
- },
2798
-
2799
-
2800
- watch: {
2801
- selectDisabled: function selectDisabled() {
2802
- var _this2 = this;
2803
-
2804
- this.$nextTick(function () {
2805
- _this2.resetInputHeight();
2806
- });
2807
- },
2808
- propPlaceholder: function propPlaceholder(val) {
2809
- this.cachedPlaceHolder = this.currentPlaceholder = val;
2810
- },
2811
- value: function value(val, oldVal) {
2812
- if (this.multiple) {
2813
- this.resetInputHeight();
2814
- if (val && val.length > 0 || this.$refs.input && this.query !== '') {
2815
- this.currentPlaceholder = '';
2816
- } else {
2817
- this.currentPlaceholder = this.cachedPlaceHolder;
2818
- }
2819
- if (this.filterable && !this.reserveKeyword) {
2820
- this.query = '';
2821
- this.handleQueryChange(this.query);
2822
- }
2823
- }
2824
- this.setSelected();
2825
- if (this.filterable && !this.multiple) {
2826
- this.inputLength = 20;
2827
- }
2828
- if (!Object(util_["valueEquals"])(val, oldVal)) {
2829
- this.dispatch('ElFormItem', 'el.form.change', val);
2830
- }
2831
- },
2832
- visible: function visible(val) {
2833
- var _this3 = this;
2834
-
2835
- if (!val) {
2836
- this.broadcast('ElSelectDropdown', 'destroyPopper');
2837
- if (this.$refs.input) {
2838
- this.$refs.input.blur();
2839
- }
2840
- this.query = '';
2841
- this.previousQuery = null;
2842
- this.selectedLabel = '';
2843
- this.inputLength = 20;
2844
- this.menuVisibleOnFocus = false;
2845
- this.resetHoverIndex();
2846
- this.$nextTick(function () {
2847
- if (_this3.$refs.input && _this3.$refs.input.value === '' && _this3.selected.length === 0) {
2848
- _this3.currentPlaceholder = _this3.cachedPlaceHolder;
2849
- }
2850
- });
2851
- if (!this.multiple) {
2852
- if (this.selected) {
2853
- if (this.filterable && this.allowCreate && this.createdSelected && this.createdLabel) {
2854
- this.selectedLabel = this.createdLabel;
2855
- } else {
2856
- this.selectedLabel = this.selected.currentLabel;
2857
- }
2858
- if (this.filterable) this.query = this.selectedLabel;
2859
- }
2860
-
2861
- if (this.filterable) {
2862
- this.currentPlaceholder = this.cachedPlaceHolder;
2863
- }
2864
- }
2865
- } else {
2866
- this.broadcast('ElSelectDropdown', 'updatePopper');
2867
- if (this.filterable) {
2868
- this.query = this.remote ? '' : this.selectedLabel;
2869
- this.handleQueryChange(this.query);
2870
- if (this.multiple) {
2871
- this.$refs.input.focus();
2872
- } else {
2873
- if (!this.remote) {
2874
- this.broadcast('ElOption', 'queryChange', '');
2875
- this.broadcast('ElOptionGroup', 'queryChange');
2876
- }
2877
-
2878
- if (this.selectedLabel) {
2879
- this.currentPlaceholder = this.selectedLabel;
2880
- this.selectedLabel = '';
2881
- }
2882
- }
2883
- }
2884
- }
2885
- this.$emit('visible-change', val);
2886
- },
2887
- options: function options() {
2888
- var _this4 = this;
2889
-
2890
- if (this.$isServer) return;
2891
- this.$nextTick(function () {
2892
- _this4.broadcast('ElSelectDropdown', 'updatePopper');
2893
- });
2894
- if (this.multiple) {
2895
- this.resetInputHeight();
2896
- }
2897
- var inputs = this.$el.querySelectorAll('input');
2898
- if ([].indexOf.call(inputs, document.activeElement) === -1) {
2899
- this.setSelected();
2900
- }
2901
- if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
2902
- this.checkDefaultFirstOption();
2903
- }
2904
- }
2905
- },
2906
-
2907
- methods: {
2908
- handleNavigate: function handleNavigate(direction) {
2909
- if (this.isOnComposition) return;
2910
-
2911
- this.navigateOptions(direction);
2912
- },
2913
- handleComposition: function handleComposition(event) {
2914
- var _this5 = this;
2915
-
2916
- var text = event.target.value;
2917
- if (event.type === 'compositionend') {
2918
- this.isOnComposition = false;
2919
- this.$nextTick(function (_) {
2920
- return _this5.handleQueryChange(text);
2921
- });
2922
- } else {
2923
- var lastCharacter = text[text.length - 1] || '';
2924
- this.isOnComposition = !Object(shared_["isKorean"])(lastCharacter);
2925
- }
2926
- },
2927
- handleQueryChange: function handleQueryChange(val) {
2928
- var _this6 = this;
2929
-
2930
- if (this.previousQuery === val || this.isOnComposition) return;
2931
- if (this.previousQuery === null && (typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')) {
2932
- this.previousQuery = val;
2933
- return;
2934
- }
2935
- this.previousQuery = val;
2936
- this.$nextTick(function () {
2937
- if (_this6.visible) _this6.broadcast('ElSelectDropdown', 'updatePopper');
2938
- });
2939
- this.hoverIndex = -1;
2940
- if (this.multiple && this.filterable) {
2941
- this.$nextTick(function () {
2942
- var length = _this6.$refs.input.value.length * 15 + 20;
2943
- _this6.inputLength = _this6.collapseTags ? Math.min(50, length) : length;
2944
- _this6.managePlaceholder();
2945
- _this6.resetInputHeight();
2946
- });
2947
- }
2948
- if (this.remote && typeof this.remoteMethod === 'function') {
2949
- this.hoverIndex = -1;
2950
- this.remoteMethod(val);
2951
- } else if (typeof this.filterMethod === 'function') {
2952
- this.filterMethod(val);
2953
- this.broadcast('ElOptionGroup', 'queryChange');
2954
- } else {
2955
- this.filteredOptionsCount = this.optionsCount;
2956
- this.broadcast('ElOption', 'queryChange', val);
2957
- this.broadcast('ElOptionGroup', 'queryChange');
2958
- }
2959
- if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
2960
- this.checkDefaultFirstOption();
2961
- }
2962
- },
2963
- scrollToOption: function scrollToOption(option) {
2964
- var target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
2965
- if (this.$refs.popper && target) {
2966
- var menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
2967
- scroll_into_view_default()(menu, target);
2968
- }
2969
- this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
2970
- },
2971
- handleMenuEnter: function handleMenuEnter() {
2972
- var _this7 = this;
2973
-
2974
- this.$nextTick(function () {
2975
- return _this7.scrollToOption(_this7.selected);
2976
- });
2977
- },
2978
- emitChange: function emitChange(val) {
2979
- if (!Object(util_["valueEquals"])(this.value, val)) {
2980
- this.$emit('change', val);
2981
- }
2982
- },
2983
- getOption: function getOption(value) {
2984
- var option = void 0;
2985
- var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
2986
- var isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]';
2987
- var isUndefined = Object.prototype.toString.call(value).toLowerCase() === '[object undefined]';
2988
-
2989
- for (var i = this.cachedOptions.length - 1; i >= 0; i--) {
2990
- var cachedOption = this.cachedOptions[i];
2991
- var isEqual = isObject ? Object(util_["getValueByPath"])(cachedOption.value, this.valueKey) === Object(util_["getValueByPath"])(value, this.valueKey) : cachedOption.value === value;
2992
- if (isEqual) {
2993
- option = cachedOption;
2994
- break;
2995
- }
2996
- }
2997
- if (option) return option;
2998
- var label = !isObject && !isNull && !isUndefined ? String(value) : '';
2999
- var newOption = {
3000
- value: value,
3001
- currentLabel: label
3002
- };
3003
- if (this.multiple) {
3004
- newOption.hitState = false;
3005
- }
3006
- return newOption;
3007
- },
3008
- setSelected: function setSelected() {
3009
- var _this8 = this;
3010
-
3011
- if (!this.multiple) {
3012
- var option = this.getOption(this.value);
3013
- if (option.created) {
3014
- this.createdLabel = option.currentLabel;
3015
- this.createdSelected = true;
3016
- } else {
3017
- this.createdSelected = false;
3018
- }
3019
- this.selectedLabel = option.currentLabel;
3020
- this.selected = option;
3021
- if (this.filterable) this.query = this.selectedLabel;
3022
- return;
3023
- }
3024
- var result = [];
3025
- if (Array.isArray(this.value)) {
3026
- this.value.forEach(function (value) {
3027
- result.push(_this8.getOption(value));
3028
- });
3029
- }
3030
- this.selected = result;
3031
- this.$nextTick(function () {
3032
- _this8.resetInputHeight();
3033
- });
3034
- },
3035
- handleFocus: function handleFocus(event) {
3036
- if (!this.softFocus) {
3037
- if (this.automaticDropdown || this.filterable) {
3038
- if (this.filterable && !this.visible) {
3039
- this.menuVisibleOnFocus = true;
3040
- }
3041
- this.visible = true;
3042
- }
3043
- this.$emit('focus', event);
3044
- } else {
3045
- this.softFocus = false;
3046
- }
3047
- },
3048
- blur: function blur() {
3049
- this.visible = false;
3050
- this.$refs.reference.blur();
3051
- },
3052
- handleBlur: function handleBlur(event) {
3053
- var _this9 = this;
3054
-
3055
- setTimeout(function () {
3056
- if (_this9.isSilentBlur) {
3057
- _this9.isSilentBlur = false;
3058
- } else {
3059
- _this9.$emit('blur', event);
3060
- }
3061
- }, 50);
3062
- this.softFocus = false;
3063
- },
3064
- handleClearClick: function handleClearClick(event) {
3065
- this.deleteSelected(event);
3066
- },
3067
- doDestroy: function doDestroy() {
3068
- this.$refs.popper && this.$refs.popper.doDestroy();
3069
- },
3070
- handleClose: function handleClose() {
3071
- this.visible = false;
3072
- },
3073
- toggleLastOptionHitState: function toggleLastOptionHitState(hit) {
3074
- if (!Array.isArray(this.selected)) return;
3075
- var option = this.selected[this.selected.length - 1];
3076
- if (!option) return;
3077
-
3078
- if (hit === true || hit === false) {
3079
- option.hitState = hit;
3080
- return hit;
3081
- }
3082
-
3083
- option.hitState = !option.hitState;
3084
- return option.hitState;
3085
- },
3086
- deletePrevTag: function deletePrevTag(e) {
3087
- if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
3088
- var value = this.value.slice();
3089
- value.pop();
3090
- this.$emit('input', value);
3091
- this.emitChange(value);
3092
- }
3093
- },
3094
- managePlaceholder: function managePlaceholder() {
3095
- if (this.currentPlaceholder !== '') {
3096
- this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
3097
- }
3098
- },
3099
- resetInputState: function resetInputState(e) {
3100
- if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
3101
- this.inputLength = this.$refs.input.value.length * 15 + 20;
3102
- this.resetInputHeight();
3103
- },
3104
- resetInputHeight: function resetInputHeight() {
3105
- var _this10 = this;
3106
-
3107
- if (this.collapseTags && !this.filterable) return;
3108
- this.$nextTick(function () {
3109
- if (!_this10.$refs.reference) return;
3110
- var inputChildNodes = _this10.$refs.reference.$el.childNodes;
3111
- var input = [].filter.call(inputChildNodes, function (item) {
3112
- return item.tagName === 'INPUT';
3113
- })[0];
3114
- var tags = _this10.$refs.tags;
3115
- var tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
3116
- var sizeInMap = _this10.initialInputHeight || 40;
3117
- input.style.height = _this10.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tagsHeight + (tagsHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
3118
- if (_this10.visible && _this10.emptyText !== false) {
3119
- _this10.broadcast('ElSelectDropdown', 'updatePopper');
3120
- }
3121
- });
3122
- },
3123
- resetHoverIndex: function resetHoverIndex() {
3124
- var _this11 = this;
3125
-
3126
- setTimeout(function () {
3127
- if (!_this11.multiple) {
3128
- _this11.hoverIndex = _this11.options.indexOf(_this11.selected);
3129
- } else {
3130
- if (_this11.selected.length > 0) {
3131
- _this11.hoverIndex = Math.min.apply(null, _this11.selected.map(function (item) {
3132
- return _this11.options.indexOf(item);
3133
- }));
3134
- } else {
3135
- _this11.hoverIndex = -1;
3136
- }
3137
- }
3138
- }, 300);
3139
- },
3140
- handleOptionSelect: function handleOptionSelect(option, byClick) {
3141
- var _this12 = this;
3142
-
3143
- if (this.multiple) {
3144
- var value = (this.value || []).slice();
3145
- var optionIndex = this.getValueIndex(value, option.value);
3146
- if (optionIndex > -1) {
3147
- value.splice(optionIndex, 1);
3148
- } else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
3149
- value.push(option.value);
3150
- }
3151
- this.$emit('input', value);
3152
- this.emitChange(value);
3153
- if (option.created) {
3154
- this.query = '';
3155
- this.handleQueryChange('');
3156
- this.inputLength = 20;
3157
- }
3158
- if (this.filterable) this.$refs.input.focus();
3159
- } else {
3160
- this.$emit('input', option.value);
3161
- this.emitChange(option.value);
3162
- this.visible = false;
3163
- }
3164
- this.isSilentBlur = byClick;
3165
- this.setSoftFocus();
3166
- if (this.visible) return;
3167
- this.$nextTick(function () {
3168
- _this12.scrollToOption(option);
3169
- });
3170
- },
3171
- setSoftFocus: function setSoftFocus() {
3172
- this.softFocus = true;
3173
- var input = this.$refs.input || this.$refs.reference;
3174
- if (input) {
3175
- input.focus();
3176
- }
3177
- },
3178
- getValueIndex: function getValueIndex() {
3179
- var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
3180
- var value = arguments[1];
3181
-
3182
- var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
3183
- if (!isObject) {
3184
- return arr.indexOf(value);
3185
- } else {
3186
- var valueKey = this.valueKey;
3187
- var index = -1;
3188
- arr.some(function (item, i) {
3189
- if (Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(value, valueKey)) {
3190
- index = i;
3191
- return true;
3192
- }
3193
- return false;
3194
- });
3195
- return index;
3196
- }
3197
- },
3198
- toggleMenu: function toggleMenu() {
3199
- if (!this.selectDisabled) {
3200
- if (this.menuVisibleOnFocus) {
3201
- this.menuVisibleOnFocus = false;
3202
- } else {
3203
- this.visible = !this.visible;
3204
- }
3205
- if (this.visible) {
3206
- (this.$refs.input || this.$refs.reference).focus();
3207
- }
3208
- }
3209
- },
3210
- selectOption: function selectOption() {
3211
- if (!this.visible) {
3212
- this.toggleMenu();
3213
- } else {
3214
- if (this.options[this.hoverIndex]) {
3215
- this.handleOptionSelect(this.options[this.hoverIndex]);
3216
- }
3217
- }
3218
- },
3219
- deleteSelected: function deleteSelected(event) {
3220
- event.stopPropagation();
3221
- var value = this.multiple ? [] : '';
3222
- this.$emit('input', value);
3223
- this.emitChange(value);
3224
- this.visible = false;
3225
- this.$emit('clear');
3226
- },
3227
- deleteTag: function deleteTag(event, tag) {
3228
- var index = this.selected.indexOf(tag);
3229
- if (index > -1 && !this.selectDisabled) {
3230
- var value = this.value.slice();
3231
- value.splice(index, 1);
3232
- this.$emit('input', value);
3233
- this.emitChange(value);
3234
- this.$emit('remove-tag', tag.value);
3235
- }
3236
- event.stopPropagation();
3237
- },
3238
- onInputChange: function onInputChange() {
3239
- if (this.filterable && this.query !== this.selectedLabel) {
3240
- this.query = this.selectedLabel;
3241
- this.handleQueryChange(this.query);
3242
- }
3243
- },
3244
- onOptionDestroy: function onOptionDestroy(index) {
3245
- if (index > -1) {
3246
- this.optionsCount--;
3247
- this.filteredOptionsCount--;
3248
- this.options.splice(index, 1);
3249
- }
3250
- },
3251
- resetInputWidth: function resetInputWidth() {
3252
- this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
3253
- },
3254
- handleResize: function handleResize() {
3255
- this.resetInputWidth();
3256
- if (this.multiple) this.resetInputHeight();
3257
- },
3258
- checkDefaultFirstOption: function checkDefaultFirstOption() {
3259
- this.hoverIndex = -1;
3260
- // highlight the created option
3261
- var hasCreated = false;
3262
- for (var i = this.options.length - 1; i >= 0; i--) {
3263
- if (this.options[i].created) {
3264
- hasCreated = true;
3265
- this.hoverIndex = i;
3266
- break;
3267
- }
3268
- }
3269
- if (hasCreated) return;
3270
- for (var _i = 0; _i !== this.options.length; ++_i) {
3271
- var option = this.options[_i];
3272
- if (this.query) {
3273
- // highlight first options that passes the filter
3274
- if (!option.disabled && !option.groupDisabled && option.visible) {
3275
- this.hoverIndex = _i;
3276
- break;
3277
- }
3278
- } else {
3279
- // highlight currently selected option
3280
- if (option.itemSelected) {
3281
- this.hoverIndex = _i;
3282
- break;
3283
- }
3284
- }
3285
- }
3286
- },
3287
- getValueKey: function getValueKey(item) {
3288
- if (Object.prototype.toString.call(item.value).toLowerCase() !== '[object object]') {
3289
- return item.value;
3290
- } else {
3291
- return Object(util_["getValueByPath"])(item.value, this.valueKey);
3292
- }
3293
- }
3294
- },
3295
-
3296
- created: function created() {
3297
- var _this13 = this;
3298
-
3299
- this.cachedPlaceHolder = this.currentPlaceholder = this.propPlaceholder;
3300
- if (this.multiple && !Array.isArray(this.value)) {
3301
- this.$emit('input', []);
3302
- }
3303
- if (!this.multiple && Array.isArray(this.value)) {
3304
- this.$emit('input', '');
3305
- }
3306
-
3307
- this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
3308
- _this13.onInputChange();
3309
- });
3310
-
3311
- this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
3312
- _this13.handleQueryChange(e.target.value);
3313
- });
3314
-
3315
- this.$on('handleOptionClick', this.handleOptionSelect);
3316
- this.$on('setSelected', this.setSelected);
3317
- },
3318
- mounted: function mounted() {
3319
- var _this14 = this;
3320
-
3321
- if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
3322
- this.currentPlaceholder = '';
3323
- }
3324
- Object(resize_event_["addResizeListener"])(this.$el, this.handleResize);
3325
-
3326
- var reference = this.$refs.reference;
3327
- if (reference && reference.$el) {
3328
- var sizeMap = {
3329
- medium: 36,
3330
- small: 32,
3331
- mini: 28
3332
- };
3333
- var input = reference.$el.querySelector('input');
3334
- this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
3335
- }
3336
- if (this.remote && this.multiple) {
3337
- this.resetInputHeight();
3338
- }
3339
- this.$nextTick(function () {
3340
- if (reference && reference.$el) {
3341
- _this14.inputWidth = reference.$el.getBoundingClientRect().width;
3342
- }
3343
- });
3344
- this.setSelected();
3345
- },
3346
- beforeDestroy: function beforeDestroy() {
3347
- if (this.$el && this.handleResize) Object(resize_event_["removeResizeListener"])(this.$el, this.handleResize);
3348
- }
3349
- });
3350
- // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=script&lang=js
3351
- /* harmony default export */ var src_selectvue_type_script_lang_js = (selectvue_type_script_lang_js);
3352
- // CONCATENATED MODULE: ./packages/select/src/select.vue
3353
-
3354
-
3355
-
3356
-
3357
-
3358
- /* normalize component */
3359
-
3360
- var select_component = Object(componentNormalizer["a" /* default */])(
3361
- src_selectvue_type_script_lang_js,
3362
- render,
3363
- staticRenderFns,
3364
- false,
3365
- null,
3366
- null,
3367
- null
3368
-
3369
- )
3370
-
3371
- /* harmony default export */ var src_select = (select_component.exports);
3372
- // CONCATENATED MODULE: ./packages/select/index.js
3373
-
3374
-
3375
- /* istanbul ignore next */
3376
- src_select.install = function (Vue) {
3377
- Vue.component(src_select.name, src_select);
3378
- };
3379
-
3380
- /* harmony default export */ var packages_select = __webpack_exports__["default"] = (src_select);
3381
-
3382
- /***/ }),
3383
- /* 49 */,
3384
- /* 50 */,
3385
- /* 51 */,
3386
- /* 52 */,
3387
- /* 53 */,
3388
- /* 54 */,
3389
- /* 55 */,
3390
- /* 56 */,
3391
- /* 57 */,
3392
- /* 58 */,
3393
- /* 59 */,
3394
- /* 60 */,
3395
- /* 61 */,
3396
- /* 62 */,
3397
- /* 63 */,
3398
- /* 64 */,
3399
- /* 65 */,
3400
- /* 66 */,
3401
- /* 67 */,
3402
- /* 68 */,
3403
- /* 69 */,
3404
- /* 70 */,
3405
- /* 71 */,
3406
- /* 72 */,
3407
- /* 73 */
3408
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3409
-
3410
- "use strict";
3411
- // ESM COMPAT FLAG
3412
- __webpack_require__.r(__webpack_exports__);
3413
-
3414
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=template&id=82f64222
3415
- var render = function () {
3416
- var _vm = this
3417
- var _h = _vm.$createElement
3418
- var _c = _vm._self._c || _h
3419
- return _c(
3420
- "ul",
3421
- { staticClass: "el-pager", on: { click: _vm.onPagerClick } },
3422
- [
3423
- _vm.pageCount > 0
3424
- ? _c(
3425
- "li",
3426
- {
3427
- staticClass: "number",
3428
- class: { active: _vm.currentPage === 1, disabled: _vm.disabled },
3429
- },
3430
- [_vm._v("1")]
3431
- )
3432
- : _vm._e(),
3433
- _vm.showPrevMore
3434
- ? _c("li", {
3435
- staticClass: "el-icon more btn-quickprev",
3436
- class: [_vm.quickprevIconClass, { disabled: _vm.disabled }],
3437
- on: {
3438
- mouseenter: function ($event) {
3439
- _vm.onMouseenter("left")
3440
- },
3441
- mouseleave: function ($event) {
3442
- _vm.quickprevIconClass = "el-icon-more"
3443
- },
3444
- },
3445
- })
3446
- : _vm._e(),
3447
- _vm._l(_vm.pagers, function (pager) {
3448
- return _c(
3449
- "li",
3450
- {
3451
- key: pager,
3452
- staticClass: "number",
3453
- class: {
3454
- active: _vm.currentPage === pager,
3455
- disabled: _vm.disabled,
3456
- },
3457
- },
3458
- [_vm._v(_vm._s(pager))]
3459
- )
3460
- }),
3461
- _vm.showNextMore
3462
- ? _c("li", {
3463
- staticClass: "el-icon more btn-quicknext",
3464
- class: [_vm.quicknextIconClass, { disabled: _vm.disabled }],
3465
- on: {
3466
- mouseenter: function ($event) {
3467
- _vm.onMouseenter("right")
3468
- },
3469
- mouseleave: function ($event) {
3470
- _vm.quicknextIconClass = "el-icon-more"
3471
- },
3472
- },
3473
- })
3474
- : _vm._e(),
3475
- _vm.pageCount > 1
3476
- ? _c(
3477
- "li",
3478
- {
3479
- staticClass: "number",
3480
- class: {
3481
- active: _vm.currentPage === _vm.pageCount,
3482
- disabled: _vm.disabled,
3483
- },
3484
- },
3485
- [_vm._v(_vm._s(_vm.pageCount))]
3486
- )
3487
- : _vm._e(),
3488
- ],
3489
- 2
3490
- )
3491
- }
3492
- var staticRenderFns = []
3493
- render._withStripped = true
3494
-
3495
-
3496
- // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=template&id=82f64222
3497
-
3498
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=script&lang=js
3499
- //
3500
- //
3501
- //
3502
- //
3503
- //
3504
- //
3505
- //
3506
- //
3507
- //
3508
- //
3509
- //
3510
- //
3511
- //
3512
- //
3513
- //
3514
- //
3515
- //
3516
- //
3517
- //
3518
- //
3519
- //
3520
- //
3521
- //
3522
- //
3523
- //
3524
- //
3525
- //
3526
- //
3527
- //
3528
- //
3529
- //
3530
- //
3531
-
3532
- /* harmony default export */ var pagervue_type_script_lang_js = ({
3533
- name: 'ElPager',
3534
-
3535
- props: {
3536
- currentPage: Number,
3537
-
3538
- pageCount: Number,
3539
-
3540
- pagerCount: Number,
3541
-
3542
- disabled: Boolean
3543
- },
3544
-
3545
- watch: {
3546
- showPrevMore: function showPrevMore(val) {
3547
- if (!val) this.quickprevIconClass = 'el-icon-more';
3548
- },
3549
- showNextMore: function showNextMore(val) {
3550
- if (!val) this.quicknextIconClass = 'el-icon-more';
3551
- }
3552
- },
3553
-
3554
- methods: {
3555
- onPagerClick: function onPagerClick(event) {
3556
- var target = event.target;
3557
- if (target.tagName === 'UL' || this.disabled) {
3558
- return;
3559
- }
3560
-
3561
- var newPage = Number(event.target.textContent);
3562
- var pageCount = this.pageCount;
3563
- var currentPage = this.currentPage;
3564
- var pagerCountOffset = this.pagerCount - 2;
3565
-
3566
- if (target.className.indexOf('more') !== -1) {
3567
- if (target.className.indexOf('quickprev') !== -1) {
3568
- newPage = currentPage - pagerCountOffset;
3569
- } else if (target.className.indexOf('quicknext') !== -1) {
3570
- newPage = currentPage + pagerCountOffset;
3571
- }
3572
- }
3573
-
3574
- /* istanbul ignore if */
3575
- if (!isNaN(newPage)) {
3576
- if (newPage < 1) {
3577
- newPage = 1;
3578
- }
3579
-
3580
- if (newPage > pageCount) {
3581
- newPage = pageCount;
3582
- }
3583
- }
3584
-
3585
- if (newPage !== currentPage) {
3586
- this.$emit('change', newPage);
3587
- }
3588
- },
3589
- onMouseenter: function onMouseenter(direction) {
3590
- if (this.disabled) return;
3591
- if (direction === 'left') {
3592
- this.quickprevIconClass = 'el-icon-d-arrow-left';
3593
- } else {
3594
- this.quicknextIconClass = 'el-icon-d-arrow-right';
3595
- }
3596
- }
3597
- },
3598
-
3599
- computed: {
3600
- pagers: function pagers() {
3601
- var pagerCount = this.pagerCount;
3602
- var halfPagerCount = (pagerCount - 1) / 2;
3603
-
3604
- var currentPage = Number(this.currentPage);
3605
- var pageCount = Number(this.pageCount);
3606
-
3607
- var showPrevMore = false;
3608
- var showNextMore = false;
3609
-
3610
- if (pageCount > pagerCount) {
3611
- if (currentPage > pagerCount - halfPagerCount) {
3612
- showPrevMore = true;
3613
- }
3614
-
3615
- if (currentPage < pageCount - halfPagerCount) {
3616
- showNextMore = true;
3617
- }
3618
- }
3619
-
3620
- var array = [];
3621
-
3622
- if (showPrevMore && !showNextMore) {
3623
- var startPage = pageCount - (pagerCount - 2);
3624
- for (var i = startPage; i < pageCount; i++) {
3625
- array.push(i);
3626
- }
3627
- } else if (!showPrevMore && showNextMore) {
3628
- for (var _i = 2; _i < pagerCount; _i++) {
3629
- array.push(_i);
3630
- }
3631
- } else if (showPrevMore && showNextMore) {
3632
- var offset = Math.floor(pagerCount / 2) - 1;
3633
- for (var _i2 = currentPage - offset; _i2 <= currentPage + offset; _i2++) {
3634
- array.push(_i2);
3635
- }
3636
- } else {
3637
- for (var _i3 = 2; _i3 < pageCount; _i3++) {
3638
- array.push(_i3);
3639
- }
3640
- }
3641
-
3642
- this.showPrevMore = showPrevMore;
3643
- this.showNextMore = showNextMore;
3644
-
3645
- return array;
3646
- }
3647
- },
3648
-
3649
- data: function data() {
3650
- return {
3651
- current: null,
3652
- showPrevMore: false,
3653
- showNextMore: false,
3654
- quicknextIconClass: 'el-icon-more',
3655
- quickprevIconClass: 'el-icon-more'
3656
- };
3657
- }
3658
- });
3659
- // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=script&lang=js
3660
- /* harmony default export */ var src_pagervue_type_script_lang_js = (pagervue_type_script_lang_js);
3661
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
3662
- var componentNormalizer = __webpack_require__(0);
3663
-
3664
- // CONCATENATED MODULE: ./packages/pagination/src/pager.vue
3665
-
3666
-
3667
-
3668
-
3669
-
3670
- /* normalize component */
3671
-
3672
- var component = Object(componentNormalizer["a" /* default */])(
3673
- src_pagervue_type_script_lang_js,
3674
- render,
3675
- staticRenderFns,
3676
- false,
3677
- null,
3678
- null,
3679
- null
3680
-
3681
- )
3682
-
3683
- /* harmony default export */ var pager = (component.exports);
3684
- // EXTERNAL MODULE: ./packages/select/index.js + 11 modules
3685
- var packages_select = __webpack_require__(48);
3686
-
3687
- // EXTERNAL MODULE: ./packages/option/index.js
3688
- var packages_option = __webpack_require__(45);
3689
-
3690
- // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
3691
- var input = __webpack_require__(13);
3692
-
3693
- // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
3694
- var locale_ = __webpack_require__(9);
3695
- var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
3696
-
3697
- // EXTERNAL MODULE: external "element-ui/lib/utils/util"
3698
- var util_ = __webpack_require__(3);
3699
-
3700
- // CONCATENATED MODULE: ./packages/pagination/src/pagination.js
3701
-
3702
-
3703
-
3704
-
3705
-
3706
-
3707
-
3708
- /* harmony default export */ var pagination = ({
3709
- name: 'ElPagination',
3710
-
3711
- props: {
3712
- pageSize: {
3713
- type: Number,
3714
- default: 10
3715
- },
3716
-
3717
- small: Boolean,
3718
-
3719
- total: Number,
3720
-
3721
- pageCount: Number,
3722
-
3723
- pagerCount: {
3724
- type: Number,
3725
- validator: function validator(value) {
3726
- return (value | 0) === value && value > 4 && value < 22 && value % 2 === 1;
3727
- },
3728
-
3729
- default: 7
3730
- },
3731
-
3732
- currentPage: {
3733
- type: Number,
3734
- default: 1
3735
- },
3736
-
3737
- layout: {
3738
- default: 'prev, pager, next, jumper, ->, total'
3739
- },
3740
-
3741
- pageSizes: {
3742
- type: Array,
3743
- default: function _default() {
3744
- return [10, 20, 30, 40, 50, 100];
3745
- }
3746
- },
3747
-
3748
- popperClass: String,
3749
-
3750
- prevText: String,
3751
-
3752
- nextText: String,
3753
-
3754
- background: Boolean,
3755
-
3756
- disabled: Boolean,
3757
-
3758
- hideOnSinglePage: Boolean
3759
- },
3760
-
3761
- data: function data() {
3762
- return {
3763
- internalCurrentPage: 1,
3764
- internalPageSize: 0,
3765
- lastEmittedPage: -1,
3766
- userChangePageSize: false
3767
- };
3768
- },
3769
- render: function render(h) {
3770
- var layout = this.layout;
3771
- if (!layout) return null;
3772
- if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null;
3773
-
3774
- var template = h('div', { 'class': ['el-pagination', {
3775
- 'is-background': this.background,
3776
- 'el-pagination--small': this.small
3777
- }] });
3778
- var TEMPLATE_MAP = {
3779
- prev: h('prev'),
3780
- jumper: h('jumper'),
3781
- pager: h('pager', {
3782
- attrs: { currentPage: this.internalCurrentPage, pageCount: this.internalPageCount, pagerCount: this.pagerCount, disabled: this.disabled },
3783
- on: {
3784
- 'change': this.handleCurrentChange
3785
- }
3786
- }),
3787
- next: h('next'),
3788
- sizes: h('sizes', {
3789
- attrs: { pageSizes: this.pageSizes }
3790
- }),
3791
- slot: h('slot', [this.$slots.default ? this.$slots.default : '']),
3792
- total: h('total')
3793
- };
3794
- var components = layout.split(',').map(function (item) {
3795
- return item.trim();
3796
- });
3797
- var rightWrapper = h('div', { 'class': 'el-pagination__rightwrapper' });
3798
- var haveRightWrapper = false;
3799
-
3800
- template.children = template.children || [];
3801
- rightWrapper.children = rightWrapper.children || [];
3802
- components.forEach(function (compo) {
3803
- if (compo === '->') {
3804
- haveRightWrapper = true;
3805
- return;
3806
- }
3807
-
3808
- if (!haveRightWrapper) {
3809
- template.children.push(TEMPLATE_MAP[compo]);
3810
- } else {
3811
- rightWrapper.children.push(TEMPLATE_MAP[compo]);
3812
- }
3813
- });
3814
-
3815
- if (haveRightWrapper) {
3816
- template.children.unshift(rightWrapper);
3817
- }
3818
-
3819
- return template;
3820
- },
3821
-
3822
-
3823
- components: {
3824
- Prev: {
3825
- render: function render(h) {
3826
- return h(
3827
- 'button',
3828
- {
3829
- attrs: {
3830
- type: 'button',
3831
-
3832
- disabled: this.$parent.disabled || this.$parent.internalCurrentPage <= 1
3833
- },
3834
- 'class': 'btn-prev', on: {
3835
- 'click': this.$parent.prev
3836
- }
3837
- },
3838
- [this.$parent.prevText ? h('span', [this.$parent.prevText]) : h('i', { 'class': 'el-icon el-icon-arrow-left' })]
3839
- );
3840
- }
3841
- },
3842
-
3843
- Next: {
3844
- render: function render(h) {
3845
- return h(
3846
- 'button',
3847
- {
3848
- attrs: {
3849
- type: 'button',
3850
-
3851
- disabled: this.$parent.disabled || this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0
3852
- },
3853
- 'class': 'btn-next', on: {
3854
- 'click': this.$parent.next
3855
- }
3856
- },
3857
- [this.$parent.nextText ? h('span', [this.$parent.nextText]) : h('i', { 'class': 'el-icon el-icon-arrow-right' })]
3858
- );
3859
- }
3860
- },
3861
-
3862
- Sizes: {
3863
- mixins: [locale_default.a],
3864
-
3865
- props: {
3866
- pageSizes: Array
3867
- },
3868
-
3869
- watch: {
3870
- pageSizes: {
3871
- immediate: true,
3872
- handler: function handler(newVal, oldVal) {
3873
- if (Object(util_["valueEquals"])(newVal, oldVal)) return;
3874
- if (Array.isArray(newVal)) {
3875
- this.$parent.internalPageSize = newVal.indexOf(this.$parent.pageSize) > -1 ? this.$parent.pageSize : this.pageSizes[0];
3876
- }
3877
- }
3878
- }
3879
- },
3880
-
3881
- render: function render(h) {
3882
- var _this = this;
3883
-
3884
- return h(
3885
- 'span',
3886
- { 'class': 'el-pagination__sizes' },
3887
- [h(
3888
- 'el-select',
3889
- {
3890
- attrs: {
3891
- value: this.$parent.internalPageSize,
3892
- popperClass: this.$parent.popperClass || '',
3893
- size: 'mini',
3894
-
3895
- disabled: this.$parent.disabled },
3896
- on: {
3897
- 'input': this.handleChange
3898
- }
3899
- },
3900
- [this.pageSizes.map(function (item) {
3901
- return h('el-option', {
3902
- attrs: {
3903
- value: item,
3904
- label: item + _this.t('el.pagination.pagesize') }
3905
- });
3906
- })]
3907
- )]
3908
- );
3909
- },
3910
-
3911
-
3912
- components: {
3913
- ElSelect: packages_select["default"],
3914
- ElOption: packages_option["default"]
3915
- },
3916
-
3917
- methods: {
3918
- handleChange: function handleChange(val) {
3919
- if (val !== this.$parent.internalPageSize) {
3920
- this.$parent.internalPageSize = val = parseInt(val, 10);
3921
- this.$parent.userChangePageSize = true;
3922
- this.$parent.$emit('update:pageSize', val);
3923
- this.$parent.$emit('size-change', val);
3924
- }
3925
- }
3926
- }
3927
- },
3928
-
3929
- Jumper: {
3930
- mixins: [locale_default.a],
3931
-
3932
- components: { ElInput: input["default"] },
3933
-
3934
- data: function data() {
3935
- return {
3936
- userInput: null
3937
- };
3938
- },
3939
-
3940
-
3941
- watch: {
3942
- '$parent.internalCurrentPage': function $parentInternalCurrentPage() {
3943
- this.userInput = null;
3944
- }
3945
- },
3946
-
3947
- methods: {
3948
- handleKeyup: function handleKeyup(_ref) {
3949
- var keyCode = _ref.keyCode,
3950
- target = _ref.target;
3951
-
3952
- // Chrome, Safari, Firefox triggers change event on Enter
3953
- // Hack for IE: https://github.com/ElemeFE/element/issues/11710
3954
- // Drop this method when we no longer supports IE
3955
- if (keyCode === 13) {
3956
- this.handleChange(target.value);
3957
- }
3958
- },
3959
- handleInput: function handleInput(value) {
3960
- this.userInput = value;
3961
- },
3962
- handleChange: function handleChange(value) {
3963
- this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value);
3964
- this.$parent.emitChange();
3965
- this.userInput = null;
3966
- }
3967
- },
3968
-
3969
- render: function render(h) {
3970
- return h(
3971
- 'span',
3972
- { 'class': 'el-pagination__jump' },
3973
- [this.t('el.pagination.goto'), h('el-input', {
3974
- 'class': 'el-pagination__editor is-in-pagination',
3975
- attrs: { min: 1,
3976
- max: this.$parent.internalPageCount,
3977
- value: this.userInput !== null ? this.userInput : this.$parent.internalCurrentPage,
3978
- type: 'number',
3979
- disabled: this.$parent.disabled
3980
- },
3981
- nativeOn: {
3982
- 'keyup': this.handleKeyup
3983
- },
3984
- on: {
3985
- 'input': this.handleInput,
3986
- 'change': this.handleChange
3987
- }
3988
- }), this.t('el.pagination.pageClassifier')]
3989
- );
3990
- }
3991
- },
3992
-
3993
- Total: {
3994
- mixins: [locale_default.a],
3995
-
3996
- render: function render(h) {
3997
- return typeof this.$parent.total === 'number' ? h(
3998
- 'span',
3999
- { 'class': 'el-pagination__total' },
4000
- [this.t('el.pagination.total', { total: this.$parent.total })]
4001
- ) : '';
4002
- }
4003
- },
4004
-
4005
- Pager: pager
4006
- },
4007
-
4008
- methods: {
4009
- handleCurrentChange: function handleCurrentChange(val) {
4010
- this.internalCurrentPage = this.getValidCurrentPage(val);
4011
- this.userChangePageSize = true;
4012
- this.emitChange();
4013
- },
4014
- prev: function prev() {
4015
- if (this.disabled) return;
4016
- var newVal = this.internalCurrentPage - 1;
4017
- this.internalCurrentPage = this.getValidCurrentPage(newVal);
4018
- this.$emit('prev-click', this.internalCurrentPage);
4019
- this.emitChange();
4020
- },
4021
- next: function next() {
4022
- if (this.disabled) return;
4023
- var newVal = this.internalCurrentPage + 1;
4024
- this.internalCurrentPage = this.getValidCurrentPage(newVal);
4025
- this.$emit('next-click', this.internalCurrentPage);
4026
- this.emitChange();
4027
- },
4028
- getValidCurrentPage: function getValidCurrentPage(value) {
4029
- value = parseInt(value, 10);
4030
-
4031
- var havePageCount = typeof this.internalPageCount === 'number';
4032
-
4033
- var resetValue = void 0;
4034
- if (!havePageCount) {
4035
- if (isNaN(value) || value < 1) resetValue = 1;
4036
- } else {
4037
- if (value < 1) {
4038
- resetValue = 1;
4039
- } else if (value > this.internalPageCount) {
4040
- resetValue = this.internalPageCount;
4041
- }
4042
- }
4043
-
4044
- if (resetValue === undefined && isNaN(value)) {
4045
- resetValue = 1;
4046
- } else if (resetValue === 0) {
4047
- resetValue = 1;
4048
- }
4049
-
4050
- return resetValue === undefined ? value : resetValue;
4051
- },
4052
- emitChange: function emitChange() {
4053
- var _this2 = this;
4054
-
4055
- this.$nextTick(function () {
4056
- if (_this2.internalCurrentPage !== _this2.lastEmittedPage || _this2.userChangePageSize) {
4057
- _this2.$emit('current-change', _this2.internalCurrentPage);
4058
- _this2.lastEmittedPage = _this2.internalCurrentPage;
4059
- _this2.userChangePageSize = false;
4060
- }
4061
- });
4062
- }
4063
- },
4064
-
4065
- computed: {
4066
- internalPageCount: function internalPageCount() {
4067
- if (typeof this.total === 'number') {
4068
- return Math.max(1, Math.ceil(this.total / this.internalPageSize));
4069
- } else if (typeof this.pageCount === 'number') {
4070
- return Math.max(1, this.pageCount);
4071
- }
4072
- return null;
4073
- }
4074
- },
4075
-
4076
- watch: {
4077
- currentPage: {
4078
- immediate: true,
4079
- handler: function handler(val) {
4080
- this.internalCurrentPage = this.getValidCurrentPage(val);
4081
- }
4082
- },
4083
-
4084
- pageSize: {
4085
- immediate: true,
4086
- handler: function handler(val) {
4087
- this.internalPageSize = isNaN(val) ? 10 : val;
4088
- }
4089
- },
4090
-
4091
- internalCurrentPage: {
4092
- immediate: true,
4093
- handler: function handler(newVal) {
4094
- this.$emit('update:currentPage', newVal);
4095
- this.lastEmittedPage = -1;
4096
- }
4097
- },
4098
-
4099
- internalPageCount: function internalPageCount(newVal) {
4100
- /* istanbul ignore if */
4101
- var oldPage = this.internalCurrentPage;
4102
- if (newVal > 0 && oldPage === 0) {
4103
- this.internalCurrentPage = 1;
4104
- } else if (oldPage > newVal) {
4105
- this.internalCurrentPage = newVal === 0 ? 1 : newVal;
4106
- this.userChangePageSize && this.emitChange();
4107
- }
4108
- this.userChangePageSize = false;
4109
- }
4110
- }
4111
- });
4112
- // CONCATENATED MODULE: ./packages/pagination/index.js
4113
-
4114
-
4115
- /* istanbul ignore next */
4116
- pagination.install = function (Vue) {
4117
- Vue.component(pagination.name, pagination);
4118
- };
4119
-
4120
- /* harmony default export */ var packages_pagination = __webpack_exports__["default"] = (pagination);
4121
-
4122
- /***/ })
4123
- /******/ ]);