cy-element-ui 1.1.11 → 1.1.13

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 (170) hide show
  1. package/README.md +59 -3
  2. package/lib/alert.js +420 -0
  3. package/lib/aside.js +277 -0
  4. package/lib/autocomplete.js +952 -0
  5. package/lib/avatar.js +363 -0
  6. package/lib/backtop.js +404 -0
  7. package/lib/badge.js +334 -0
  8. package/lib/breadcrumb-item.js +322 -0
  9. package/lib/breadcrumb.js +293 -0
  10. package/lib/button-group.js +262 -0
  11. package/lib/button.js +357 -0
  12. package/lib/calendar.js +933 -0
  13. package/lib/card.js +297 -0
  14. package/lib/carousel-item.js +434 -0
  15. package/lib/carousel.js +707 -0
  16. package/lib/cascader-panel.js +1558 -0
  17. package/lib/cascader.js +1439 -0
  18. package/lib/checkbox-button.js +583 -0
  19. package/lib/checkbox-group.js +313 -0
  20. package/lib/checkbox.js +627 -0
  21. package/lib/col.js +177 -0
  22. package/lib/collapse-item.js +497 -0
  23. package/lib/collapse.js +329 -0
  24. package/lib/color-picker.js +1943 -0
  25. package/lib/container.js +288 -0
  26. package/lib/date-picker.js +6340 -0
  27. package/lib/descriptions-item.js +140 -0
  28. package/lib/descriptions.js +457 -0
  29. package/lib/dialog.js +598 -0
  30. package/lib/directives/mousewheel.js +26 -0
  31. package/lib/directives/repeat-click.js +33 -0
  32. package/lib/divider.js +313 -0
  33. package/lib/drawer.js +592 -0
  34. package/lib/dropdown-item.js +316 -0
  35. package/lib/dropdown-menu.js +351 -0
  36. package/lib/dropdown.js +643 -0
  37. package/lib/empty.js +730 -0
  38. package/lib/footer.js +277 -0
  39. package/lib/form-item.js +826 -0
  40. package/lib/form.js +466 -0
  41. package/lib/header.js +277 -0
  42. package/lib/icon.js +265 -0
  43. package/lib/image.js +1138 -0
  44. package/lib/index.js +1 -1
  45. package/lib/infinite-scroll.js +301 -0
  46. package/lib/input-number.js +757 -0
  47. package/lib/input.js +998 -0
  48. package/lib/link.js +332 -0
  49. package/lib/loading.js +631 -0
  50. package/lib/locale/format.js +56 -0
  51. package/lib/locale/index.js +63 -0
  52. package/lib/locale/lang/en.js +126 -0
  53. package/lib/locale/lang/zh-CN.js +126 -0
  54. package/lib/locale/lang/zh-TW.js +126 -0
  55. package/lib/main.js +264 -0
  56. package/lib/menu-item-group.js +308 -0
  57. package/lib/menu-item.js +491 -0
  58. package/lib/menu.js +865 -0
  59. package/lib/message-box.js +1192 -0
  60. package/lib/message.js +548 -0
  61. package/lib/mixins/emitter.js +36 -0
  62. package/lib/mixins/focus.js +15 -0
  63. package/lib/mixins/locale.js +17 -0
  64. package/lib/mixins/migrating.js +69 -0
  65. package/lib/notification.js +615 -0
  66. package/lib/option-group.js +344 -0
  67. package/lib/option.js +474 -0
  68. package/lib/page-header.js +319 -0
  69. package/lib/pagination.js +950 -0
  70. package/lib/popconfirm.js +457 -0
  71. package/lib/popover.js +617 -0
  72. package/lib/progress.js +595 -0
  73. package/lib/radio-button.js +463 -0
  74. package/lib/radio-group.js +391 -0
  75. package/lib/radio.js +497 -0
  76. package/lib/rate.js +670 -0
  77. package/lib/result.js +578 -0
  78. package/lib/row.js +149 -0
  79. package/lib/scrollbar.js +423 -0
  80. package/lib/select.js +2167 -0
  81. package/lib/selectDisplayInput.js +367 -0
  82. package/lib/skeleton-item.js +342 -0
  83. package/lib/skeleton.js +372 -0
  84. package/lib/slider.js +1199 -0
  85. package/lib/spinner.js +301 -0
  86. package/lib/statistic.js +533 -0
  87. package/lib/step.js +522 -0
  88. package/lib/steps.js +342 -0
  89. package/lib/subTitle.js +295 -0
  90. package/lib/submenu.js +701 -0
  91. package/lib/switch.js +554 -0
  92. package/lib/tab-pane.js +332 -0
  93. package/lib/tabDialog.js +1184 -0
  94. package/lib/table-column.js +952 -0
  95. package/lib/table.js +5015 -0
  96. package/lib/tabs.js +920 -0
  97. package/lib/tag.js +304 -0
  98. package/lib/theme-chalk/base.css +1 -1
  99. package/lib/theme-chalk/index.css +1 -2
  100. package/lib/theme-chalk/selectDisplayInput.css +1 -0
  101. package/lib/theme-chalk/subTitle.css +1 -0
  102. package/lib/theme-chalk/tabDialog.css +1 -0
  103. package/lib/theme-chalk/treeSelect.css +1 -0
  104. package/lib/time-picker.js +2967 -0
  105. package/lib/time-select.js +1765 -0
  106. package/lib/timeline-item.js +371 -0
  107. package/lib/timeline.js +275 -0
  108. package/lib/tooltip.js +425 -0
  109. package/lib/transfer.js +1102 -0
  110. package/lib/transitions/collapse-transition.js +91 -0
  111. package/lib/tree.js +2263 -0
  112. package/lib/treeSelect.js +4430 -0
  113. package/lib/umd/locale/en.js +142 -0
  114. package/lib/umd/locale/zh-CN.js +142 -0
  115. package/lib/umd/locale/zh-TW.js +142 -0
  116. package/lib/upload.js +1390 -0
  117. package/lib/utils/after-leave.js +35 -0
  118. package/lib/utils/aria-dialog.js +104 -0
  119. package/lib/utils/aria-utils.js +126 -0
  120. package/lib/utils/clickoutside.js +79 -0
  121. package/lib/utils/date-util.js +310 -0
  122. package/lib/utils/date.js +369 -0
  123. package/lib/utils/dom.js +234 -0
  124. package/lib/utils/lodash.js +9421 -0
  125. package/lib/utils/menu/aria-menubar.js +24 -0
  126. package/lib/utils/menu/aria-menuitem.js +62 -0
  127. package/lib/utils/menu/aria-submenu.js +69 -0
  128. package/lib/utils/merge.js +21 -0
  129. package/lib/utils/popper.js +1261 -0
  130. package/lib/utils/popup/index.js +233 -0
  131. package/lib/utils/popup/popup-manager.js +205 -0
  132. package/lib/utils/resize-event.js +59 -0
  133. package/lib/utils/scroll-into-view.js +38 -0
  134. package/lib/utils/scrollbar-width.js +39 -0
  135. package/lib/utils/shared.js +12 -0
  136. package/lib/utils/types.js +52 -0
  137. package/lib/utils/util.js +272 -0
  138. package/lib/utils/vdom.js +13 -0
  139. package/lib/utils/vue-popper.js +202 -0
  140. package/package.json +3 -3
  141. package/packages/selectDisplayInput/index.js +8 -0
  142. package/packages/selectDisplayInput/src/main.vue +75 -0
  143. package/packages/theme-chalk/gulpfile.js +1 -1
  144. package/packages/{theme-cy/src → theme-chalk/src/cy}/index.scss +1 -0
  145. package/packages/theme-chalk/src/cy/selectDisplayInput.scss +76 -0
  146. package/packages/theme-chalk/src/index.scss +2 -3
  147. package/packages/treeSelect/src/main.vue +7 -3
  148. package/src/index.js +7 -4
  149. package/lib/theme-cy/base.css +0 -1
  150. package/lib/theme-cy/index.css +0 -1
  151. package/lib/theme-cy/subTitle.css +0 -1
  152. package/lib/theme-cy/tabDialog.css +0 -1
  153. package/lib/theme-cy/treeSelect.css +0 -1
  154. package/packages/theme-chalk/src/tabDialog.scss +0 -0
  155. package/packages/theme-chalk/src/treeSelect.scss +0 -0
  156. package/packages/theme-cy/gulpfile.js +0 -19
  157. package/packages/theme-cy/lib/base.css +0 -1
  158. package/packages/theme-cy/lib/element.css +0 -1
  159. package/packages/theme-cy/lib/index.css +0 -1
  160. package/packages/theme-cy/lib/subTitle.css +0 -1
  161. package/packages/theme-cy/lib/tabDialog.css +0 -1
  162. package/packages/theme-cy/lib/treeSelect.css +0 -1
  163. package/packages/theme-cy/package.json +0 -9
  164. /package/lib/{theme-cy → theme-chalk}/element.css +0 -0
  165. /package/packages/{theme-cy/src → theme-chalk/src/cy}/base.scss +0 -0
  166. /package/packages/{theme-cy/src → theme-chalk/src/cy}/element.scss +0 -0
  167. /package/packages/{theme-cy/src → theme-chalk/src/cy}/subTitle.scss +0 -0
  168. /package/packages/{theme-cy/src → theme-chalk/src/cy}/tabDialog.scss +0 -0
  169. /package/packages/{theme-cy/src → theme-chalk/src/cy}/treeSelect.scss +0 -0
  170. /package/packages/theme-chalk/src/{subTitle.scss → selectDisplayInput.scss} +0 -0
@@ -0,0 +1,4430 @@
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 = 131);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ 0:
91
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
+
93
+ "use strict";
94
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
95
+ /* globals __VUE_SSR_CONTEXT__ */
96
+
97
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
98
+ // This module is a runtime utility for cleaner component module output and will
99
+ // be included in the final webpack user bundle.
100
+
101
+ function normalizeComponent(
102
+ scriptExports,
103
+ render,
104
+ staticRenderFns,
105
+ functionalTemplate,
106
+ injectStyles,
107
+ scopeId,
108
+ moduleIdentifier /* server only */,
109
+ shadowMode /* vue-cli only */
110
+ ) {
111
+ // Vue.extend constructor export interop
112
+ var options =
113
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
114
+
115
+ // render functions
116
+ if (render) {
117
+ options.render = render
118
+ options.staticRenderFns = staticRenderFns
119
+ options._compiled = true
120
+ }
121
+
122
+ // functional template
123
+ if (functionalTemplate) {
124
+ options.functional = true
125
+ }
126
+
127
+ // scopedId
128
+ if (scopeId) {
129
+ options._scopeId = 'data-v-' + scopeId
130
+ }
131
+
132
+ var hook
133
+ if (moduleIdentifier) {
134
+ // server build
135
+ hook = function (context) {
136
+ // 2.3 injection
137
+ context =
138
+ context || // cached call
139
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
140
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
141
+ // 2.2 with runInNewContext: true
142
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
143
+ context = __VUE_SSR_CONTEXT__
144
+ }
145
+ // inject component styles
146
+ if (injectStyles) {
147
+ injectStyles.call(this, context)
148
+ }
149
+ // register component module identifier for async chunk inferrence
150
+ if (context && context._registeredComponents) {
151
+ context._registeredComponents.add(moduleIdentifier)
152
+ }
153
+ }
154
+ // used by ssr in case component is cached and beforeCreate
155
+ // never gets called
156
+ options._ssrRegister = hook
157
+ } else if (injectStyles) {
158
+ hook = shadowMode
159
+ ? function () {
160
+ injectStyles.call(
161
+ this,
162
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
163
+ )
164
+ }
165
+ : injectStyles
166
+ }
167
+
168
+ if (hook) {
169
+ if (options.functional) {
170
+ // for template-only hot-reload because in that case the render fn doesn't
171
+ // go through the normalizer
172
+ options._injectStyles = hook
173
+ // register for functional component in vue file
174
+ var originalRender = options.render
175
+ options.render = function renderWithStyleInjection(h, context) {
176
+ hook.call(context)
177
+ return originalRender(h, context)
178
+ }
179
+ } else {
180
+ // inject component registration as beforeCreate hook
181
+ var existing = options.beforeCreate
182
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
183
+ }
184
+ }
185
+
186
+ return {
187
+ exports: scriptExports,
188
+ options: options
189
+ }
190
+ }
191
+
192
+
193
+ /***/ }),
194
+
195
+ /***/ 10:
196
+ /***/ (function(module, exports) {
197
+
198
+ module.exports = require("element-ui/lib/mixins/migrating");
199
+
200
+ /***/ }),
201
+
202
+ /***/ 131:
203
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
204
+
205
+ "use strict";
206
+ // ESM COMPAT FLAG
207
+ __webpack_require__.r(__webpack_exports__);
208
+
209
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/treeSelect/src/main.vue?vue&type=template&id=51b519e4
210
+ var render = function () {
211
+ var _vm = this
212
+ var _h = _vm.$createElement
213
+ var _c = _vm._self._c || _h
214
+ return _c(
215
+ "div",
216
+ { staticClass: "cy-tree-select" },
217
+ [
218
+ _c(
219
+ "el-popover",
220
+ {
221
+ attrs: {
222
+ placement: "bottom-start",
223
+ width: "300",
224
+ trigger: "click",
225
+ "popper-class": _vm.popperClass,
226
+ },
227
+ on: {
228
+ show: function ($event) {
229
+ _vm.popoverOpen = true
230
+ },
231
+ hide: function ($event) {
232
+ _vm.popoverOpen = false
233
+ },
234
+ },
235
+ model: {
236
+ value: _vm.popoverOpen,
237
+ callback: function ($$v) {
238
+ _vm.popoverOpen = $$v
239
+ },
240
+ expression: "popoverOpen",
241
+ },
242
+ },
243
+ [
244
+ _c("div", { staticClass: "cy-tree-select-select-con" }, [
245
+ _vm.filterable
246
+ ? _c(
247
+ "div",
248
+ { staticClass: "cy-tree-select-select-con-s" },
249
+ [
250
+ _c("el-input", {
251
+ attrs: {
252
+ placeholder: "搜索",
253
+ "prefix-icon": "el-icon-search",
254
+ clearable: "",
255
+ size: "small",
256
+ },
257
+ model: {
258
+ value: _vm.filterText,
259
+ callback: function ($$v) {
260
+ _vm.filterText = $$v
261
+ },
262
+ expression: "filterText",
263
+ },
264
+ }),
265
+ ],
266
+ 1
267
+ )
268
+ : _vm._e(),
269
+ _vm.showCheckStrictly
270
+ ? _c(
271
+ "div",
272
+ { staticClass: "cy-tree-select-select-con-t" },
273
+ [
274
+ _c(
275
+ "el-checkbox",
276
+ {
277
+ model: {
278
+ value: _vm.isCheckStrictly,
279
+ callback: function ($$v) {
280
+ _vm.isCheckStrictly = $$v
281
+ },
282
+ expression: "isCheckStrictly",
283
+ },
284
+ },
285
+ [_vm._v("父子节点联动")]
286
+ ),
287
+ ],
288
+ 1
289
+ )
290
+ : _vm._e(),
291
+ _c(
292
+ "div",
293
+ { staticClass: "cy-tree-select-select-con-c" },
294
+ [
295
+ _c("el-tree", {
296
+ ref: "tree",
297
+ attrs: {
298
+ data: _vm.treeOptions,
299
+ "show-checkbox": _vm.multiple,
300
+ "node-key": _vm.defaultOptions.id,
301
+ "check-strictly": !_vm.isCheckStrictly,
302
+ props: _vm.defaultOptions,
303
+ "expand-on-click-node": false,
304
+ "default-expand-all": _vm.defaultExpandAll,
305
+ "filter-node-method": _vm.filterNode,
306
+ },
307
+ on: { check: _vm.treeCheck, "node-click": _vm.treeClick },
308
+ }),
309
+ ],
310
+ 1
311
+ ),
312
+ ]),
313
+ _c(
314
+ "div",
315
+ {
316
+ staticClass: "cy-tree-select-select",
317
+ class: _vm.size,
318
+ style: _vm.vStyle,
319
+ attrs: { slot: "reference" },
320
+ slot: "reference",
321
+ },
322
+ [
323
+ _c("div", { staticClass: "cy-tree-select-select-v" }, [
324
+ _vm.checkedArr.length < 1
325
+ ? _c(
326
+ "span",
327
+ { staticClass: "cy-tree-select-select-v-placeholder" },
328
+ [_vm._v(_vm._s(_vm.placeholder))]
329
+ )
330
+ : _c("span", [
331
+ _vm._v(
332
+ _vm._s(
333
+ _vm.checkedArr
334
+ .map(function (item) {
335
+ return item[_vm.defaultOptions.label]
336
+ })
337
+ .join()
338
+ )
339
+ ),
340
+ ]),
341
+ ]),
342
+ _c(
343
+ "div",
344
+ {
345
+ staticClass: "cy-tree-select-select-v-icon",
346
+ on: {
347
+ mouseenter: function ($event) {
348
+ _vm.isClearIcon = true
349
+ },
350
+ mouseleave: function ($event) {
351
+ _vm.isClearIcon = false
352
+ },
353
+ },
354
+ },
355
+ [
356
+ _vm.isClearIcon && _vm.clearable
357
+ ? _c("i", {
358
+ staticClass: "el-icon-circle-close",
359
+ on: {
360
+ click: function ($event) {
361
+ $event.stopPropagation()
362
+ return _vm.handleClear($event)
363
+ },
364
+ },
365
+ })
366
+ : _c("i", {
367
+ staticClass:
368
+ "el-icon-arrow-down cy-tree-select-select-v-arrow",
369
+ class: {
370
+ "cy-tree-select-select-v-arrow-show": _vm.popoverOpen,
371
+ },
372
+ }),
373
+ ]
374
+ ),
375
+ ]
376
+ ),
377
+ ]
378
+ ),
379
+ ],
380
+ 1
381
+ )
382
+ }
383
+ var staticRenderFns = []
384
+ render._withStripped = true
385
+
386
+
387
+ // CONCATENATED MODULE: ./packages/treeSelect/src/main.vue?vue&type=template&id=51b519e4
388
+
389
+ // EXTERNAL MODULE: ./packages/checkbox/index.js + 5 modules
390
+ var packages_checkbox = __webpack_require__(46);
391
+
392
+ // EXTERNAL MODULE: ./packages/popover/index.js + 6 modules
393
+ var popover = __webpack_require__(44);
394
+
395
+ // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
396
+ var input = __webpack_require__(43);
397
+
398
+ // EXTERNAL MODULE: ./packages/tree/index.js + 13 modules
399
+ var tree = __webpack_require__(42);
400
+
401
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/treeSelect/src/main.vue?vue&type=script&lang=js
402
+ //
403
+ //
404
+ //
405
+ //
406
+ //
407
+ //
408
+ //
409
+ //
410
+ //
411
+ //
412
+ //
413
+ //
414
+ //
415
+ //
416
+ //
417
+ //
418
+ //
419
+ //
420
+ //
421
+ //
422
+ //
423
+ //
424
+ //
425
+ //
426
+ //
427
+ //
428
+ //
429
+ //
430
+ //
431
+ //
432
+ //
433
+ //
434
+ //
435
+ //
436
+ //
437
+ //
438
+ //
439
+ //
440
+ //
441
+ //
442
+ //
443
+ //
444
+ //
445
+ //
446
+ //
447
+ //
448
+ //
449
+ //
450
+ //
451
+
452
+
453
+
454
+
455
+
456
+
457
+ /* harmony default export */ var mainvue_type_script_lang_js = ({
458
+ name: 'CyTreeSelect',
459
+ components: {
460
+ ElCheckbox: packages_checkbox["default"],
461
+ ElPopover: popover["default"],
462
+ ElInput: input["default"],
463
+ ElTree: tree["default"]
464
+ },
465
+ model: {
466
+ prop: 'value',
467
+ event: 'change'
468
+ },
469
+ props: {
470
+ value: {
471
+ type: [String, Number, Array],
472
+ default: ''
473
+ },
474
+
475
+ options: {
476
+ type: Array,
477
+ default: []
478
+ },
479
+
480
+ placeholder: {
481
+ type: String,
482
+ default: ''
483
+ },
484
+
485
+ size: {
486
+ type: String
487
+ },
488
+
489
+ filterable: {
490
+ type: Boolean,
491
+ default: false
492
+ },
493
+
494
+ showCheckStrictly: {
495
+ type: Boolean,
496
+ default: true
497
+ },
498
+
499
+ checkStrictly: {
500
+ type: Boolean,
501
+ default: true
502
+ },
503
+
504
+ clearable: {
505
+ type: Boolean,
506
+ default: false
507
+ },
508
+
509
+ multiple: {
510
+ type: Boolean,
511
+ default: false
512
+ },
513
+
514
+ defaultOptions: {
515
+ type: Object,
516
+ default: function _default() {
517
+ return {
518
+ children: 'children',
519
+ label: 'label',
520
+ id: 'id'
521
+ };
522
+ }
523
+ },
524
+
525
+ vStyle: {
526
+ type: [Array, String, Object],
527
+ default: ''
528
+ },
529
+
530
+ popperClass: {
531
+ type: String,
532
+ default: ''
533
+ },
534
+
535
+ defaultExpandAll: {
536
+ type: Boolean,
537
+ default: false
538
+ }
539
+ },
540
+ data: function data() {
541
+ return {
542
+ isCheckStrictly: true,
543
+ popoverOpen: false,
544
+ isClearIcon: false,
545
+
546
+ treeOptions: [],
547
+ treeArr: [],
548
+ filterText: '',
549
+ matchedNodeIds: []
550
+ };
551
+ },
552
+
553
+ computed: {
554
+ checkedArr: function checkedArr() {
555
+ var _this = this;
556
+
557
+ if (this.multiple) {
558
+ var arr = [];
559
+ this.value && this.value.forEach(function (id) {
560
+ var cItem = _this.treeArr.filter(function (tItem) {
561
+ return tItem[_this.defaultOptions.id] === id;
562
+ })[0];
563
+ if (cItem) arr.push(cItem);
564
+ });
565
+ return arr;
566
+ } else {
567
+ var cItem = this.treeArr.filter(function (tItem) {
568
+ return tItem[_this.defaultOptions.id] === Number(_this.value);
569
+ })[0];
570
+ return cItem ? [cItem] : [];
571
+ }
572
+ }
573
+ },
574
+ watch: {
575
+ checkStrictly: {
576
+ immediate: true,
577
+ handler: function handler() {
578
+ this.isCheckStrictly = this.checkStrictly;
579
+ }
580
+ },
581
+
582
+ value: {
583
+ immediate: true,
584
+ deep: true,
585
+ handler: function handler() {
586
+ var _this2 = this;
587
+
588
+ this.$nextTick(function () {
589
+ _this2.init();
590
+ });
591
+ }
592
+ },
593
+
594
+ options: {
595
+ deep: true,
596
+ immediate: true,
597
+ handler: function handler() {
598
+ this.treeOptions = this.options;
599
+ this.treeArr = this.turnFormatTreeData([], this.treeOptions, 0);
600
+ }
601
+ },
602
+
603
+ filterText: function filterText(val) {
604
+ var _this3 = this;
605
+
606
+ if (val) {
607
+ this.matchedNodeIds = this.findMatchedNodes(val, this.treeOptions);
608
+ this.$refs.tree.filter(val);
609
+ this.$nextTick(function () {
610
+ _this3.expandMatchedNodes();
611
+ });
612
+ } else {
613
+ this.matchedNodeIds = [];
614
+ this.$refs.tree.filter(val);
615
+ }
616
+ }
617
+ },
618
+ created: function created() {},
619
+
620
+ methods: {
621
+ filterNode: function filterNode(value, data) {
622
+ if (!value) return true;
623
+ return this.matchedNodeIds.includes(data[this.defaultOptions.id]);
624
+ },
625
+ findMatchedNodes: function findMatchedNodes(value, nodes) {
626
+ var _this4 = this;
627
+
628
+ var parentMatched = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
629
+
630
+ var matchedIds = [];
631
+
632
+ nodes.forEach(function (node) {
633
+ var currentNodeMatched = node[_this4.defaultOptions.label].indexOf(value) !== -1;
634
+ var shouldShow = currentNodeMatched || parentMatched;
635
+
636
+ if (shouldShow) {
637
+ matchedIds.push(node[_this4.defaultOptions.id]);
638
+ }
639
+
640
+ if (node[_this4.defaultOptions.children] && node[_this4.defaultOptions.children].length > 0) {
641
+ var childIds = _this4.findMatchedNodes(value, node[_this4.defaultOptions.children], shouldShow);
642
+ matchedIds = matchedIds.concat(childIds);
643
+ }
644
+ });
645
+
646
+ return matchedIds;
647
+ },
648
+ expandMatchedNodes: function expandMatchedNodes() {
649
+ var _this5 = this;
650
+
651
+ this.matchedNodeIds.forEach(function (nodeId) {
652
+ var treeNode = _this5.$refs.tree.store.nodesMap[nodeId];
653
+ if (treeNode) {
654
+ treeNode.expand();
655
+ }
656
+ });
657
+ },
658
+ init: function init() {
659
+ var _this6 = this;
660
+
661
+ var arr = [];
662
+ if (this.multiple) {
663
+ arr = this.value ? this.value : [];
664
+ } else {
665
+ arr = this.value ? [this.value] : [];
666
+ }
667
+ this.$nextTick(function () {
668
+ _this6.$refs.tree.setCheckedKeys(arr);
669
+ });
670
+ },
671
+ treeCheck: function treeCheck(value, _ref) {
672
+ var _this7 = this;
673
+
674
+ var checkedKeys = _ref.checkedKeys,
675
+ checkedNodes = _ref.checkedNodes;
676
+
677
+ var arr = [];
678
+ arr = checkedNodes;
679
+ var idArr = arr.map(function (item) {
680
+ return item[_this7.defaultOptions.id];
681
+ });
682
+ this.$emit('change', this.multiple ? idArr : idArr[0], this.multiple ? arr : arr[0]);
683
+ },
684
+ treeClick: function treeClick(value, node, event) {
685
+ if (this.multiple) return;
686
+
687
+ this.$emit('change', value.id, value);
688
+ this.popoverOpen = false;
689
+ },
690
+ handleClear: function handleClear() {
691
+ this.$emit('change', this.multiple ? [] : '', this.multiple ? [] : null);
692
+ this.$refs.tree.setCheckedKeys([]);
693
+ },
694
+ turnFormatTreeData: function turnFormatTreeData(arr, data, pId) {
695
+ var _this8 = this;
696
+
697
+ data.forEach(function (item) {
698
+ var cItem = JSON.parse(JSON.stringify(item));
699
+ delete cItem[_this8.defaultOptions.children];
700
+ cItem.pId = pId;
701
+ arr.push(cItem);
702
+
703
+ if (item[_this8.defaultOptions.children] && item[_this8.defaultOptions.children].length > 0) {
704
+ _this8.turnFormatTreeData(arr, item[_this8.defaultOptions.children], item[_this8.defaultOptions.id]);
705
+ }
706
+ });
707
+ return arr;
708
+ }
709
+ }
710
+ });
711
+ // CONCATENATED MODULE: ./packages/treeSelect/src/main.vue?vue&type=script&lang=js
712
+ /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
713
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
714
+ var componentNormalizer = __webpack_require__(0);
715
+
716
+ // CONCATENATED MODULE: ./packages/treeSelect/src/main.vue
717
+
718
+
719
+
720
+
721
+
722
+ /* normalize component */
723
+
724
+ var component = Object(componentNormalizer["a" /* default */])(
725
+ src_mainvue_type_script_lang_js,
726
+ render,
727
+ staticRenderFns,
728
+ false,
729
+ null,
730
+ null,
731
+ null
732
+
733
+ )
734
+
735
+ /* harmony default export */ var main = (component.exports);
736
+ // CONCATENATED MODULE: ./packages/treeSelect/index.js
737
+
738
+
739
+ main.install = function (Vue) {
740
+ Vue.component(main.name, main);
741
+ };
742
+
743
+ /* harmony default export */ var treeSelect = __webpack_exports__["default"] = (main);
744
+
745
+ /***/ }),
746
+
747
+ /***/ 14:
748
+ /***/ (function(module, exports) {
749
+
750
+ module.exports = require("element-ui/lib/checkbox");
751
+
752
+ /***/ }),
753
+
754
+ /***/ 19:
755
+ /***/ (function(module, exports) {
756
+
757
+ module.exports = require("element-ui/lib/locale");
758
+
759
+ /***/ }),
760
+
761
+ /***/ 2:
762
+ /***/ (function(module, exports) {
763
+
764
+ module.exports = require("element-ui/lib/utils/dom");
765
+
766
+ /***/ }),
767
+
768
+ /***/ 21:
769
+ /***/ (function(module, exports) {
770
+
771
+ module.exports = require("element-ui/lib/utils/shared");
772
+
773
+ /***/ }),
774
+
775
+ /***/ 23:
776
+ /***/ (function(module, exports) {
777
+
778
+ module.exports = require("element-ui/lib/transitions/collapse-transition");
779
+
780
+ /***/ }),
781
+
782
+ /***/ 3:
783
+ /***/ (function(module, exports) {
784
+
785
+ module.exports = require("element-ui/lib/utils/util");
786
+
787
+ /***/ }),
788
+
789
+ /***/ 4:
790
+ /***/ (function(module, exports) {
791
+
792
+ module.exports = require("element-ui/lib/mixins/emitter");
793
+
794
+ /***/ }),
795
+
796
+ /***/ 42:
797
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
798
+
799
+ "use strict";
800
+ // ESM COMPAT FLAG
801
+ __webpack_require__.r(__webpack_exports__);
802
+
803
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree.vue?vue&type=template&id=5814ec4e
804
+ var render = function () {
805
+ var _vm = this
806
+ var _h = _vm.$createElement
807
+ var _c = _vm._self._c || _h
808
+ return _c(
809
+ "div",
810
+ {
811
+ staticClass: "el-tree",
812
+ class: {
813
+ "el-tree--highlight-current": _vm.highlightCurrent,
814
+ "is-dragging": !!_vm.dragState.draggingNode,
815
+ "is-drop-not-allow": !_vm.dragState.allowDrop,
816
+ "is-drop-inner": _vm.dragState.dropType === "inner",
817
+ },
818
+ attrs: { role: "tree" },
819
+ },
820
+ [
821
+ _vm._l(_vm.root.childNodes, function (child) {
822
+ return _c("el-tree-node", {
823
+ key: _vm.getNodeKey(child),
824
+ attrs: {
825
+ node: child,
826
+ props: _vm.props,
827
+ "render-after-expand": _vm.renderAfterExpand,
828
+ "show-checkbox": _vm.showCheckbox,
829
+ "render-content": _vm.renderContent,
830
+ },
831
+ on: { "node-expand": _vm.handleNodeExpand },
832
+ })
833
+ }),
834
+ _vm.isEmpty
835
+ ? _c("div", { staticClass: "el-tree__empty-block" }, [
836
+ _c("span", { staticClass: "el-tree__empty-text" }, [
837
+ _vm._v(_vm._s(_vm.emptyText)),
838
+ ]),
839
+ ])
840
+ : _vm._e(),
841
+ _c("div", {
842
+ directives: [
843
+ {
844
+ name: "show",
845
+ rawName: "v-show",
846
+ value: _vm.dragState.showDropIndicator,
847
+ expression: "dragState.showDropIndicator",
848
+ },
849
+ ],
850
+ ref: "dropIndicator",
851
+ staticClass: "el-tree__drop-indicator",
852
+ }),
853
+ ],
854
+ 2
855
+ )
856
+ }
857
+ var staticRenderFns = []
858
+ render._withStripped = true
859
+
860
+
861
+ // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=template&id=5814ec4e
862
+
863
+ // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
864
+ var merge_ = __webpack_require__(9);
865
+ var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
866
+
867
+ // CONCATENATED MODULE: ./packages/tree/src/model/util.js
868
+ var NODE_KEY = '$treeNodeId';
869
+
870
+ var markNodeData = function markNodeData(node, data) {
871
+ if (!data || data[NODE_KEY]) return;
872
+ Object.defineProperty(data, NODE_KEY, {
873
+ value: node.id,
874
+ enumerable: false,
875
+ configurable: false,
876
+ writable: false
877
+ });
878
+ };
879
+
880
+ var util_getNodeKey = function getNodeKey(key, data) {
881
+ if (!key) return data[NODE_KEY];
882
+ return data[key];
883
+ };
884
+
885
+ var findNearestComponent = function findNearestComponent(element, componentName) {
886
+ var target = element;
887
+ while (target && target.tagName !== 'BODY') {
888
+ if (target.__vue__ && target.__vue__.$options.name === componentName) {
889
+ return target.__vue__;
890
+ }
891
+ target = target.parentNode;
892
+ }
893
+ return null;
894
+ };
895
+ // EXTERNAL MODULE: external "element-ui/lib/utils/util"
896
+ var util_ = __webpack_require__(3);
897
+
898
+ // CONCATENATED MODULE: ./packages/tree/src/model/node.js
899
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
900
+
901
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
902
+
903
+
904
+
905
+
906
+
907
+ var getChildState = function getChildState(node) {
908
+ var all = true;
909
+ var none = true;
910
+ var allWithoutDisable = true;
911
+ for (var i = 0, j = node.length; i < j; i++) {
912
+ var n = node[i];
913
+ if (n.checked !== true || n.indeterminate) {
914
+ all = false;
915
+ if (!n.disabled) {
916
+ allWithoutDisable = false;
917
+ }
918
+ }
919
+ if (n.checked !== false || n.indeterminate) {
920
+ none = false;
921
+ }
922
+ }
923
+
924
+ return { all: all, none: none, allWithoutDisable: allWithoutDisable, half: !all && !none };
925
+ };
926
+
927
+ var reInitChecked = function reInitChecked(node) {
928
+ if (node.childNodes.length === 0 || node.loading) return;
929
+
930
+ var _getChildState = getChildState(node.childNodes),
931
+ all = _getChildState.all,
932
+ none = _getChildState.none,
933
+ half = _getChildState.half;
934
+
935
+ if (all) {
936
+ node.checked = true;
937
+ node.indeterminate = false;
938
+ } else if (half) {
939
+ node.checked = false;
940
+ node.indeterminate = true;
941
+ } else if (none) {
942
+ node.checked = false;
943
+ node.indeterminate = false;
944
+ }
945
+
946
+ var parent = node.parent;
947
+ if (!parent || parent.level === 0) return;
948
+
949
+ if (!node.store.checkStrictly) {
950
+ reInitChecked(parent);
951
+ }
952
+ };
953
+
954
+ var getPropertyFromData = function getPropertyFromData(node, prop) {
955
+ var props = node.store.props;
956
+ var data = node.data || {};
957
+ var config = props[prop];
958
+
959
+ if (typeof config === 'function') {
960
+ return config(data, node);
961
+ } else if (typeof config === 'string') {
962
+ return data[config];
963
+ } else if (typeof config === 'undefined') {
964
+ var dataProp = data[prop];
965
+ return dataProp === undefined ? '' : dataProp;
966
+ }
967
+ };
968
+
969
+ var nodeIdSeed = 0;
970
+
971
+ var node_Node = function () {
972
+ function Node(options) {
973
+ _classCallCheck(this, Node);
974
+
975
+ this.id = nodeIdSeed++;
976
+ this.text = null;
977
+ this.checked = false;
978
+ this.indeterminate = false;
979
+ this.data = null;
980
+ this.expanded = false;
981
+ this.parent = null;
982
+ this.visible = true;
983
+ this.isCurrent = false;
984
+
985
+ for (var name in options) {
986
+ if (options.hasOwnProperty(name)) {
987
+ this[name] = options[name];
988
+ }
989
+ }
990
+
991
+ // internal
992
+ this.level = 0;
993
+ this.loaded = false;
994
+ this.childNodes = [];
995
+ this.loading = false;
996
+
997
+ if (this.parent) {
998
+ this.level = this.parent.level + 1;
999
+ }
1000
+
1001
+ var store = this.store;
1002
+ if (!store) {
1003
+ throw new Error('[Node]store is required!');
1004
+ }
1005
+ store.registerNode(this);
1006
+
1007
+ var props = store.props;
1008
+ if (props && typeof props.isLeaf !== 'undefined') {
1009
+ var isLeaf = getPropertyFromData(this, 'isLeaf');
1010
+ if (typeof isLeaf === 'boolean') {
1011
+ this.isLeafByUser = isLeaf;
1012
+ }
1013
+ }
1014
+
1015
+ if (store.lazy !== true && this.data) {
1016
+ this.setData(this.data);
1017
+
1018
+ if (store.defaultExpandAll) {
1019
+ this.expanded = true;
1020
+ }
1021
+ } else if (this.level > 0 && store.lazy && store.defaultExpandAll) {
1022
+ this.expand();
1023
+ }
1024
+ if (!Array.isArray(this.data)) {
1025
+ markNodeData(this, this.data);
1026
+ }
1027
+ if (!this.data) return;
1028
+ var defaultExpandedKeys = store.defaultExpandedKeys;
1029
+ var key = store.key;
1030
+ if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) {
1031
+ this.expand(null, store.autoExpandParent);
1032
+ }
1033
+
1034
+ if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) {
1035
+ store.currentNode = this;
1036
+ store.currentNode.isCurrent = true;
1037
+ }
1038
+
1039
+ if (store.lazy) {
1040
+ store._initDefaultCheckedNode(this);
1041
+ }
1042
+
1043
+ this.updateLeafState();
1044
+ }
1045
+
1046
+ Node.prototype.setData = function setData(data) {
1047
+ if (!Array.isArray(data)) {
1048
+ markNodeData(this, data);
1049
+ }
1050
+
1051
+ this.data = data;
1052
+ this.childNodes = [];
1053
+
1054
+ var children = void 0;
1055
+ if (this.level === 0 && this.data instanceof Array) {
1056
+ children = this.data;
1057
+ } else {
1058
+ children = getPropertyFromData(this, 'children') || [];
1059
+ }
1060
+
1061
+ for (var i = 0, j = children.length; i < j; i++) {
1062
+ this.insertChild({ data: children[i] });
1063
+ }
1064
+ };
1065
+
1066
+ Node.prototype.contains = function contains(target) {
1067
+ var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1068
+
1069
+ var walk = function walk(parent) {
1070
+ var children = parent.childNodes || [];
1071
+ var result = false;
1072
+ for (var i = 0, j = children.length; i < j; i++) {
1073
+ var child = children[i];
1074
+ if (child === target || deep && walk(child)) {
1075
+ result = true;
1076
+ break;
1077
+ }
1078
+ }
1079
+ return result;
1080
+ };
1081
+
1082
+ return walk(this);
1083
+ };
1084
+
1085
+ Node.prototype.remove = function remove() {
1086
+ var parent = this.parent;
1087
+ if (parent) {
1088
+ parent.removeChild(this);
1089
+ }
1090
+ };
1091
+
1092
+ Node.prototype.insertChild = function insertChild(child, index, batch) {
1093
+ if (!child) throw new Error('insertChild error: child is required.');
1094
+
1095
+ if (!(child instanceof Node)) {
1096
+ if (!batch) {
1097
+ var children = this.getChildren(true) || [];
1098
+ if (children.indexOf(child.data) === -1) {
1099
+ if (typeof index === 'undefined' || index < 0) {
1100
+ children.push(child.data);
1101
+ } else {
1102
+ children.splice(index, 0, child.data);
1103
+ }
1104
+ }
1105
+ }
1106
+ merge_default()(child, {
1107
+ parent: this,
1108
+ store: this.store
1109
+ });
1110
+ child = new Node(child);
1111
+ }
1112
+
1113
+ child.level = this.level + 1;
1114
+
1115
+ if (typeof index === 'undefined' || index < 0) {
1116
+ this.childNodes.push(child);
1117
+ } else {
1118
+ this.childNodes.splice(index, 0, child);
1119
+ }
1120
+
1121
+ this.updateLeafState();
1122
+ };
1123
+
1124
+ Node.prototype.insertBefore = function insertBefore(child, ref) {
1125
+ var index = void 0;
1126
+ if (ref) {
1127
+ index = this.childNodes.indexOf(ref);
1128
+ }
1129
+ this.insertChild(child, index);
1130
+ };
1131
+
1132
+ Node.prototype.insertAfter = function insertAfter(child, ref) {
1133
+ var index = void 0;
1134
+ if (ref) {
1135
+ index = this.childNodes.indexOf(ref);
1136
+ if (index !== -1) index += 1;
1137
+ }
1138
+ this.insertChild(child, index);
1139
+ };
1140
+
1141
+ Node.prototype.removeChild = function removeChild(child) {
1142
+ var children = this.getChildren() || [];
1143
+ var dataIndex = children.indexOf(child.data);
1144
+ if (dataIndex > -1) {
1145
+ children.splice(dataIndex, 1);
1146
+ }
1147
+
1148
+ var index = this.childNodes.indexOf(child);
1149
+
1150
+ if (index > -1) {
1151
+ this.store && this.store.deregisterNode(child);
1152
+ child.parent = null;
1153
+ this.childNodes.splice(index, 1);
1154
+ }
1155
+
1156
+ this.updateLeafState();
1157
+ };
1158
+
1159
+ Node.prototype.removeChildByData = function removeChildByData(data) {
1160
+ var targetNode = null;
1161
+
1162
+ for (var i = 0; i < this.childNodes.length; i++) {
1163
+ if (this.childNodes[i].data === data) {
1164
+ targetNode = this.childNodes[i];
1165
+ break;
1166
+ }
1167
+ }
1168
+
1169
+ if (targetNode) {
1170
+ this.removeChild(targetNode);
1171
+ }
1172
+ };
1173
+
1174
+ Node.prototype.expand = function expand(callback, expandParent) {
1175
+ var _this = this;
1176
+
1177
+ var done = function done() {
1178
+ if (expandParent) {
1179
+ var parent = _this.parent;
1180
+ while (parent.level > 0) {
1181
+ parent.expanded = true;
1182
+ parent = parent.parent;
1183
+ }
1184
+ }
1185
+ _this.expanded = true;
1186
+ if (callback) callback();
1187
+ };
1188
+
1189
+ if (this.shouldLoadData()) {
1190
+ this.loadData(function (data) {
1191
+ if (data instanceof Array) {
1192
+ if (_this.checked) {
1193
+ _this.setChecked(true, true);
1194
+ } else if (!_this.store.checkStrictly) {
1195
+ reInitChecked(_this);
1196
+ }
1197
+ done();
1198
+ }
1199
+ });
1200
+ } else {
1201
+ done();
1202
+ }
1203
+ };
1204
+
1205
+ Node.prototype.doCreateChildren = function doCreateChildren(array) {
1206
+ var _this2 = this;
1207
+
1208
+ var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1209
+
1210
+ array.forEach(function (item) {
1211
+ _this2.insertChild(merge_default()({ data: item }, defaultProps), undefined, true);
1212
+ });
1213
+ };
1214
+
1215
+ Node.prototype.collapse = function collapse() {
1216
+ this.expanded = false;
1217
+ };
1218
+
1219
+ Node.prototype.shouldLoadData = function shouldLoadData() {
1220
+ return this.store.lazy === true && this.store.load && !this.loaded;
1221
+ };
1222
+
1223
+ Node.prototype.updateLeafState = function updateLeafState() {
1224
+ if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') {
1225
+ this.isLeaf = this.isLeafByUser;
1226
+ return;
1227
+ }
1228
+ var childNodes = this.childNodes;
1229
+ if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
1230
+ this.isLeaf = !childNodes || childNodes.length === 0;
1231
+ return;
1232
+ }
1233
+ this.isLeaf = false;
1234
+ };
1235
+
1236
+ Node.prototype.setChecked = function setChecked(value, deep, recursion, passValue) {
1237
+ var _this3 = this;
1238
+
1239
+ this.indeterminate = value === 'half';
1240
+ this.checked = value === true;
1241
+
1242
+ if (this.store.checkStrictly) return;
1243
+
1244
+ if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
1245
+ var _getChildState2 = getChildState(this.childNodes),
1246
+ all = _getChildState2.all,
1247
+ allWithoutDisable = _getChildState2.allWithoutDisable;
1248
+
1249
+ if (!this.isLeaf && !all && allWithoutDisable) {
1250
+ this.checked = false;
1251
+ value = false;
1252
+ }
1253
+
1254
+ var handleDescendants = function handleDescendants() {
1255
+ if (deep) {
1256
+ var childNodes = _this3.childNodes;
1257
+ for (var i = 0, j = childNodes.length; i < j; i++) {
1258
+ var child = childNodes[i];
1259
+ passValue = passValue || value !== false;
1260
+ var isCheck = child.disabled ? child.checked : passValue;
1261
+ child.setChecked(isCheck, deep, true, passValue);
1262
+ }
1263
+
1264
+ var _getChildState3 = getChildState(childNodes),
1265
+ half = _getChildState3.half,
1266
+ _all = _getChildState3.all;
1267
+
1268
+ if (!_all) {
1269
+ _this3.checked = _all;
1270
+ _this3.indeterminate = half;
1271
+ }
1272
+ }
1273
+ };
1274
+
1275
+ if (this.shouldLoadData()) {
1276
+ // Only work on lazy load data.
1277
+ this.loadData(function () {
1278
+ handleDescendants();
1279
+ reInitChecked(_this3);
1280
+ }, {
1281
+ checked: value !== false
1282
+ });
1283
+ return;
1284
+ } else {
1285
+ handleDescendants();
1286
+ }
1287
+ }
1288
+
1289
+ var parent = this.parent;
1290
+ if (!parent || parent.level === 0) return;
1291
+
1292
+ if (!recursion) {
1293
+ reInitChecked(parent);
1294
+ }
1295
+ };
1296
+
1297
+ Node.prototype.getChildren = function getChildren() {
1298
+ var forceInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1299
+ // this is data
1300
+ if (this.level === 0) return this.data;
1301
+ var data = this.data;
1302
+ if (!data) return null;
1303
+
1304
+ var props = this.store.props;
1305
+ var children = 'children';
1306
+ if (props) {
1307
+ children = props.children || 'children';
1308
+ }
1309
+
1310
+ if (data[children] === undefined) {
1311
+ data[children] = null;
1312
+ }
1313
+
1314
+ if (forceInit && !data[children]) {
1315
+ data[children] = [];
1316
+ }
1317
+
1318
+ return data[children];
1319
+ };
1320
+
1321
+ Node.prototype.updateChildren = function updateChildren() {
1322
+ var _this4 = this;
1323
+
1324
+ var newData = this.getChildren() || [];
1325
+ var oldData = this.childNodes.map(function (node) {
1326
+ return node.data;
1327
+ });
1328
+
1329
+ var newDataMap = {};
1330
+ var newNodes = [];
1331
+
1332
+ newData.forEach(function (item, index) {
1333
+ var key = item[NODE_KEY];
1334
+ var isNodeExists = !!key && Object(util_["arrayFindIndex"])(oldData, function (data) {
1335
+ return data[NODE_KEY] === key;
1336
+ }) >= 0;
1337
+ if (isNodeExists) {
1338
+ newDataMap[key] = { index: index, data: item };
1339
+ } else {
1340
+ newNodes.push({ index: index, data: item });
1341
+ }
1342
+ });
1343
+
1344
+ if (!this.store.lazy) {
1345
+ oldData.forEach(function (item) {
1346
+ if (!newDataMap[item[NODE_KEY]]) _this4.removeChildByData(item);
1347
+ });
1348
+ }
1349
+
1350
+ newNodes.forEach(function (_ref) {
1351
+ var index = _ref.index,
1352
+ data = _ref.data;
1353
+
1354
+ _this4.insertChild({ data: data }, index);
1355
+ });
1356
+
1357
+ this.updateLeafState();
1358
+ };
1359
+
1360
+ Node.prototype.loadData = function loadData(callback) {
1361
+ var _this5 = this;
1362
+
1363
+ var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1364
+
1365
+ if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
1366
+ this.loading = true;
1367
+
1368
+ var resolve = function resolve(children) {
1369
+ _this5.childNodes = [];
1370
+
1371
+ _this5.doCreateChildren(children, defaultProps);
1372
+ _this5.loaded = true;
1373
+ _this5.loading = false;
1374
+ _this5.updateLeafState();
1375
+ if (callback) {
1376
+ callback.call(_this5, children);
1377
+ }
1378
+ };
1379
+
1380
+ this.store.load(this, resolve);
1381
+ } else {
1382
+ if (callback) {
1383
+ callback.call(this);
1384
+ }
1385
+ }
1386
+ };
1387
+
1388
+ _createClass(Node, [{
1389
+ key: 'label',
1390
+ get: function get() {
1391
+ return getPropertyFromData(this, 'label');
1392
+ }
1393
+ }, {
1394
+ key: 'key',
1395
+ get: function get() {
1396
+ var nodeKey = this.store.key;
1397
+ if (this.data) return this.data[nodeKey];
1398
+ return null;
1399
+ }
1400
+ }, {
1401
+ key: 'disabled',
1402
+ get: function get() {
1403
+ return getPropertyFromData(this, 'disabled');
1404
+ }
1405
+ }, {
1406
+ key: 'nextSibling',
1407
+ get: function get() {
1408
+ var parent = this.parent;
1409
+ if (parent) {
1410
+ var index = parent.childNodes.indexOf(this);
1411
+ if (index > -1) {
1412
+ return parent.childNodes[index + 1];
1413
+ }
1414
+ }
1415
+ return null;
1416
+ }
1417
+ }, {
1418
+ key: 'previousSibling',
1419
+ get: function get() {
1420
+ var parent = this.parent;
1421
+ if (parent) {
1422
+ var index = parent.childNodes.indexOf(this);
1423
+ if (index > -1) {
1424
+ return index > 0 ? parent.childNodes[index - 1] : null;
1425
+ }
1426
+ }
1427
+ return null;
1428
+ }
1429
+ }]);
1430
+
1431
+ return Node;
1432
+ }();
1433
+
1434
+ /* harmony default export */ var model_node = (node_Node);
1435
+ // CONCATENATED MODULE: ./packages/tree/src/model/tree-store.js
1436
+ 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; };
1437
+
1438
+ function tree_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1439
+
1440
+
1441
+
1442
+
1443
+ var tree_store_TreeStore = function () {
1444
+ function TreeStore(options) {
1445
+ var _this = this;
1446
+
1447
+ tree_store_classCallCheck(this, TreeStore);
1448
+
1449
+ this.currentNode = null;
1450
+ this.currentNodeKey = null;
1451
+
1452
+ for (var option in options) {
1453
+ if (options.hasOwnProperty(option)) {
1454
+ this[option] = options[option];
1455
+ }
1456
+ }
1457
+
1458
+ this.nodesMap = {};
1459
+
1460
+ this.root = new model_node({
1461
+ data: this.data,
1462
+ store: this
1463
+ });
1464
+
1465
+ if (this.lazy && this.load) {
1466
+ var loadFn = this.load;
1467
+ loadFn(this.root, function (data) {
1468
+ _this.root.doCreateChildren(data);
1469
+ _this._initDefaultCheckedNodes();
1470
+ });
1471
+ } else {
1472
+ this._initDefaultCheckedNodes();
1473
+ }
1474
+ }
1475
+
1476
+ TreeStore.prototype.filter = function filter(value) {
1477
+ var filterNodeMethod = this.filterNodeMethod;
1478
+ var lazy = this.lazy;
1479
+ var traverse = function traverse(node) {
1480
+ var childNodes = node.root ? node.root.childNodes : node.childNodes;
1481
+
1482
+ childNodes.forEach(function (child) {
1483
+ child.visible = filterNodeMethod.call(child, value, child.data, child);
1484
+
1485
+ traverse(child);
1486
+ });
1487
+
1488
+ if (!node.visible && childNodes.length) {
1489
+ var allHidden = true;
1490
+ allHidden = !childNodes.some(function (child) {
1491
+ return child.visible;
1492
+ });
1493
+
1494
+ if (node.root) {
1495
+ node.root.visible = allHidden === false;
1496
+ } else {
1497
+ node.visible = allHidden === false;
1498
+ }
1499
+ }
1500
+ if (!value) return;
1501
+
1502
+ if (node.visible && !node.isLeaf && !lazy) node.expand();
1503
+ };
1504
+
1505
+ traverse(this);
1506
+ };
1507
+
1508
+ TreeStore.prototype.setData = function setData(newVal) {
1509
+ var instanceChanged = newVal !== this.root.data;
1510
+ if (instanceChanged) {
1511
+ this.root.setData(newVal);
1512
+ this._initDefaultCheckedNodes();
1513
+ } else {
1514
+ this.root.updateChildren();
1515
+ }
1516
+ };
1517
+
1518
+ TreeStore.prototype.getNode = function getNode(data) {
1519
+ if (data instanceof model_node) return data;
1520
+ var key = (typeof data === 'undefined' ? 'undefined' : _typeof(data)) !== 'object' ? data : util_getNodeKey(this.key, data);
1521
+ return this.nodesMap[key] || null;
1522
+ };
1523
+
1524
+ TreeStore.prototype.insertBefore = function insertBefore(data, refData) {
1525
+ var refNode = this.getNode(refData);
1526
+ refNode.parent.insertBefore({ data: data }, refNode);
1527
+ };
1528
+
1529
+ TreeStore.prototype.insertAfter = function insertAfter(data, refData) {
1530
+ var refNode = this.getNode(refData);
1531
+ refNode.parent.insertAfter({ data: data }, refNode);
1532
+ };
1533
+
1534
+ TreeStore.prototype.remove = function remove(data) {
1535
+ var node = this.getNode(data);
1536
+
1537
+ if (node && node.parent) {
1538
+ if (node === this.currentNode) {
1539
+ this.currentNode = null;
1540
+ }
1541
+ node.parent.removeChild(node);
1542
+ }
1543
+ };
1544
+
1545
+ TreeStore.prototype.append = function append(data, parentData) {
1546
+ var parentNode = parentData ? this.getNode(parentData) : this.root;
1547
+
1548
+ if (parentNode) {
1549
+ parentNode.insertChild({ data: data });
1550
+ }
1551
+ };
1552
+
1553
+ TreeStore.prototype._initDefaultCheckedNodes = function _initDefaultCheckedNodes() {
1554
+ var _this2 = this;
1555
+
1556
+ var defaultCheckedKeys = this.defaultCheckedKeys || [];
1557
+ var nodesMap = this.nodesMap;
1558
+
1559
+ defaultCheckedKeys.forEach(function (checkedKey) {
1560
+ var node = nodesMap[checkedKey];
1561
+
1562
+ if (node) {
1563
+ node.setChecked(true, !_this2.checkStrictly);
1564
+ }
1565
+ });
1566
+ };
1567
+
1568
+ TreeStore.prototype._initDefaultCheckedNode = function _initDefaultCheckedNode(node) {
1569
+ var defaultCheckedKeys = this.defaultCheckedKeys || [];
1570
+
1571
+ if (defaultCheckedKeys.indexOf(node.key) !== -1) {
1572
+ node.setChecked(true, !this.checkStrictly);
1573
+ }
1574
+ };
1575
+
1576
+ TreeStore.prototype.setDefaultCheckedKey = function setDefaultCheckedKey(newVal) {
1577
+ if (newVal !== this.defaultCheckedKeys) {
1578
+ this.defaultCheckedKeys = newVal;
1579
+ this._initDefaultCheckedNodes();
1580
+ }
1581
+ };
1582
+
1583
+ TreeStore.prototype.registerNode = function registerNode(node) {
1584
+ var key = this.key;
1585
+ if (!key || !node || !node.data) return;
1586
+
1587
+ var nodeKey = node.key;
1588
+ if (nodeKey !== undefined) this.nodesMap[node.key] = node;
1589
+ };
1590
+
1591
+ TreeStore.prototype.deregisterNode = function deregisterNode(node) {
1592
+ var _this3 = this;
1593
+
1594
+ var key = this.key;
1595
+ if (!key || !node || !node.data) return;
1596
+
1597
+ node.childNodes.forEach(function (child) {
1598
+ _this3.deregisterNode(child);
1599
+ });
1600
+
1601
+ delete this.nodesMap[node.key];
1602
+ };
1603
+
1604
+ TreeStore.prototype.getCheckedNodes = function getCheckedNodes() {
1605
+ var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1606
+ var includeHalfChecked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1607
+
1608
+ var checkedNodes = [];
1609
+ var traverse = function traverse(node) {
1610
+ var childNodes = node.root ? node.root.childNodes : node.childNodes;
1611
+
1612
+ childNodes.forEach(function (child) {
1613
+ if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) {
1614
+ checkedNodes.push(child.data);
1615
+ }
1616
+
1617
+ traverse(child);
1618
+ });
1619
+ };
1620
+
1621
+ traverse(this);
1622
+
1623
+ return checkedNodes;
1624
+ };
1625
+
1626
+ TreeStore.prototype.getCheckedKeys = function getCheckedKeys() {
1627
+ var _this4 = this;
1628
+
1629
+ var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1630
+
1631
+ return this.getCheckedNodes(leafOnly).map(function (data) {
1632
+ return (data || {})[_this4.key];
1633
+ });
1634
+ };
1635
+
1636
+ TreeStore.prototype.getHalfCheckedNodes = function getHalfCheckedNodes() {
1637
+ var nodes = [];
1638
+ var traverse = function traverse(node) {
1639
+ var childNodes = node.root ? node.root.childNodes : node.childNodes;
1640
+
1641
+ childNodes.forEach(function (child) {
1642
+ if (child.indeterminate) {
1643
+ nodes.push(child.data);
1644
+ }
1645
+
1646
+ traverse(child);
1647
+ });
1648
+ };
1649
+
1650
+ traverse(this);
1651
+
1652
+ return nodes;
1653
+ };
1654
+
1655
+ TreeStore.prototype.getHalfCheckedKeys = function getHalfCheckedKeys() {
1656
+ var _this5 = this;
1657
+
1658
+ return this.getHalfCheckedNodes().map(function (data) {
1659
+ return (data || {})[_this5.key];
1660
+ });
1661
+ };
1662
+
1663
+ TreeStore.prototype._getAllNodes = function _getAllNodes() {
1664
+ var allNodes = [];
1665
+ var nodesMap = this.nodesMap;
1666
+ for (var nodeKey in nodesMap) {
1667
+ if (nodesMap.hasOwnProperty(nodeKey)) {
1668
+ allNodes.push(nodesMap[nodeKey]);
1669
+ }
1670
+ }
1671
+
1672
+ return allNodes;
1673
+ };
1674
+
1675
+ TreeStore.prototype.updateChildren = function updateChildren(key, data) {
1676
+ var node = this.nodesMap[key];
1677
+ if (!node) return;
1678
+ var childNodes = node.childNodes;
1679
+ for (var i = childNodes.length - 1; i >= 0; i--) {
1680
+ var child = childNodes[i];
1681
+ this.remove(child.data);
1682
+ }
1683
+ for (var _i = 0, j = data.length; _i < j; _i++) {
1684
+ var _child = data[_i];
1685
+ this.append(_child, node.data);
1686
+ }
1687
+ };
1688
+
1689
+ TreeStore.prototype._setCheckedKeys = function _setCheckedKeys(key) {
1690
+ var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1691
+ var checkedKeys = arguments[2];
1692
+
1693
+ var allNodes = this._getAllNodes().sort(function (a, b) {
1694
+ return b.level - a.level;
1695
+ });
1696
+ var cache = Object.create(null);
1697
+ var keys = Object.keys(checkedKeys);
1698
+ allNodes.forEach(function (node) {
1699
+ return node.setChecked(false, false);
1700
+ });
1701
+ for (var i = 0, j = allNodes.length; i < j; i++) {
1702
+ var node = allNodes[i];
1703
+ var nodeKey = node.data[key].toString();
1704
+ var checked = keys.indexOf(nodeKey) > -1;
1705
+ if (!checked) {
1706
+ if (node.checked && !cache[nodeKey]) {
1707
+ node.setChecked(false, false);
1708
+ }
1709
+ continue;
1710
+ }
1711
+
1712
+ var parent = node.parent;
1713
+ while (parent && parent.level > 0) {
1714
+ cache[parent.data[key]] = true;
1715
+ parent = parent.parent;
1716
+ }
1717
+
1718
+ if (node.isLeaf || this.checkStrictly) {
1719
+ node.setChecked(true, false);
1720
+ continue;
1721
+ }
1722
+ node.setChecked(true, true);
1723
+
1724
+ if (leafOnly) {
1725
+ (function () {
1726
+ node.setChecked(false, false);
1727
+ var traverse = function traverse(node) {
1728
+ var childNodes = node.childNodes;
1729
+ childNodes.forEach(function (child) {
1730
+ if (!child.isLeaf) {
1731
+ child.setChecked(false, false);
1732
+ }
1733
+ traverse(child);
1734
+ });
1735
+ };
1736
+ traverse(node);
1737
+ })();
1738
+ }
1739
+ }
1740
+ };
1741
+
1742
+ TreeStore.prototype.setCheckedNodes = function setCheckedNodes(array) {
1743
+ var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1744
+
1745
+ var key = this.key;
1746
+ var checkedKeys = {};
1747
+ array.forEach(function (item) {
1748
+ checkedKeys[(item || {})[key]] = true;
1749
+ });
1750
+
1751
+ this._setCheckedKeys(key, leafOnly, checkedKeys);
1752
+ };
1753
+
1754
+ TreeStore.prototype.setCheckedKeys = function setCheckedKeys(keys) {
1755
+ var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1756
+
1757
+ this.defaultCheckedKeys = keys;
1758
+ var key = this.key;
1759
+ var checkedKeys = {};
1760
+ keys.forEach(function (key) {
1761
+ checkedKeys[key] = true;
1762
+ });
1763
+
1764
+ this._setCheckedKeys(key, leafOnly, checkedKeys);
1765
+ };
1766
+
1767
+ TreeStore.prototype.setDefaultExpandedKeys = function setDefaultExpandedKeys(keys) {
1768
+ var _this6 = this;
1769
+
1770
+ keys = keys || [];
1771
+ this.defaultExpandedKeys = keys;
1772
+
1773
+ keys.forEach(function (key) {
1774
+ var node = _this6.getNode(key);
1775
+ if (node) node.expand(null, _this6.autoExpandParent);
1776
+ });
1777
+ };
1778
+
1779
+ TreeStore.prototype.setChecked = function setChecked(data, checked, deep) {
1780
+ var node = this.getNode(data);
1781
+
1782
+ if (node) {
1783
+ node.setChecked(!!checked, deep);
1784
+ }
1785
+ };
1786
+
1787
+ TreeStore.prototype.getCurrentNode = function getCurrentNode() {
1788
+ return this.currentNode;
1789
+ };
1790
+
1791
+ TreeStore.prototype.setCurrentNode = function setCurrentNode(currentNode) {
1792
+ var prevCurrentNode = this.currentNode;
1793
+ if (prevCurrentNode) {
1794
+ prevCurrentNode.isCurrent = false;
1795
+ }
1796
+ this.currentNode = currentNode;
1797
+ this.currentNode.isCurrent = true;
1798
+ };
1799
+
1800
+ TreeStore.prototype.setUserCurrentNode = function setUserCurrentNode(node) {
1801
+ var key = node[this.key];
1802
+ var currNode = this.nodesMap[key];
1803
+ this.setCurrentNode(currNode);
1804
+ };
1805
+
1806
+ TreeStore.prototype.setCurrentNodeKey = function setCurrentNodeKey(key) {
1807
+ if (key === null || key === undefined) {
1808
+ this.currentNode && (this.currentNode.isCurrent = false);
1809
+ this.currentNode = null;
1810
+ return;
1811
+ }
1812
+ var node = this.getNode(key);
1813
+ if (node) {
1814
+ this.setCurrentNode(node);
1815
+ }
1816
+ };
1817
+
1818
+ return TreeStore;
1819
+ }();
1820
+
1821
+ /* harmony default export */ var tree_store = (tree_store_TreeStore);
1822
+ ;
1823
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree-node.vue?vue&type=template&id=3869abb7
1824
+ var tree_nodevue_type_template_id_3869abb7_render = function () {
1825
+ var this$1 = this
1826
+ var _vm = this
1827
+ var _h = _vm.$createElement
1828
+ var _c = _vm._self._c || _h
1829
+ return _c(
1830
+ "div",
1831
+ {
1832
+ directives: [
1833
+ {
1834
+ name: "show",
1835
+ rawName: "v-show",
1836
+ value: _vm.node.visible,
1837
+ expression: "node.visible",
1838
+ },
1839
+ ],
1840
+ ref: "node",
1841
+ staticClass: "el-tree-node",
1842
+ class: {
1843
+ "is-expanded": _vm.expanded,
1844
+ "is-current": _vm.node.isCurrent,
1845
+ "is-hidden": !_vm.node.visible,
1846
+ "is-focusable": !_vm.node.disabled,
1847
+ "is-checked": !_vm.node.disabled && _vm.node.checked,
1848
+ },
1849
+ attrs: {
1850
+ role: "treeitem",
1851
+ tabindex: "-1",
1852
+ "aria-expanded": _vm.expanded,
1853
+ "aria-disabled": _vm.node.disabled,
1854
+ "aria-checked": _vm.node.checked,
1855
+ draggable: _vm.tree.draggable,
1856
+ },
1857
+ on: {
1858
+ click: function ($event) {
1859
+ $event.stopPropagation()
1860
+ return _vm.handleClick($event)
1861
+ },
1862
+ contextmenu: function ($event) {
1863
+ return this$1.handleContextMenu($event)
1864
+ },
1865
+ dragstart: function ($event) {
1866
+ $event.stopPropagation()
1867
+ return _vm.handleDragStart($event)
1868
+ },
1869
+ dragover: function ($event) {
1870
+ $event.stopPropagation()
1871
+ return _vm.handleDragOver($event)
1872
+ },
1873
+ dragend: function ($event) {
1874
+ $event.stopPropagation()
1875
+ return _vm.handleDragEnd($event)
1876
+ },
1877
+ drop: function ($event) {
1878
+ $event.stopPropagation()
1879
+ return _vm.handleDrop($event)
1880
+ },
1881
+ },
1882
+ },
1883
+ [
1884
+ _c(
1885
+ "div",
1886
+ {
1887
+ staticClass: "el-tree-node__content",
1888
+ style: {
1889
+ "padding-left": (_vm.node.level - 1) * _vm.tree.indent + "px",
1890
+ },
1891
+ },
1892
+ [
1893
+ _c("span", {
1894
+ class: [
1895
+ {
1896
+ "is-leaf": _vm.node.isLeaf,
1897
+ expanded: !_vm.node.isLeaf && _vm.expanded,
1898
+ },
1899
+ "el-tree-node__expand-icon",
1900
+ _vm.tree.iconClass ? _vm.tree.iconClass : "el-icon-caret-right",
1901
+ ],
1902
+ on: {
1903
+ click: function ($event) {
1904
+ $event.stopPropagation()
1905
+ return _vm.handleExpandIconClick($event)
1906
+ },
1907
+ },
1908
+ }),
1909
+ _vm.showCheckbox
1910
+ ? _c("el-checkbox", {
1911
+ attrs: {
1912
+ indeterminate: _vm.node.indeterminate,
1913
+ disabled: !!_vm.node.disabled,
1914
+ },
1915
+ on: { change: _vm.handleCheckChange },
1916
+ nativeOn: {
1917
+ click: function ($event) {
1918
+ $event.stopPropagation()
1919
+ },
1920
+ },
1921
+ model: {
1922
+ value: _vm.node.checked,
1923
+ callback: function ($$v) {
1924
+ _vm.$set(_vm.node, "checked", $$v)
1925
+ },
1926
+ expression: "node.checked",
1927
+ },
1928
+ })
1929
+ : _vm._e(),
1930
+ _vm.node.loading
1931
+ ? _c("span", {
1932
+ staticClass: "el-tree-node__loading-icon el-icon-loading",
1933
+ })
1934
+ : _vm._e(),
1935
+ _c("node-content", { attrs: { node: _vm.node } }),
1936
+ ],
1937
+ 1
1938
+ ),
1939
+ _c("el-collapse-transition", [
1940
+ !_vm.renderAfterExpand || _vm.childNodeRendered
1941
+ ? _c(
1942
+ "div",
1943
+ {
1944
+ directives: [
1945
+ {
1946
+ name: "show",
1947
+ rawName: "v-show",
1948
+ value: _vm.expanded,
1949
+ expression: "expanded",
1950
+ },
1951
+ ],
1952
+ staticClass: "el-tree-node__children",
1953
+ attrs: { role: "group", "aria-expanded": _vm.expanded },
1954
+ },
1955
+ _vm._l(_vm.node.childNodes, function (child) {
1956
+ return _c("el-tree-node", {
1957
+ key: _vm.getNodeKey(child),
1958
+ attrs: {
1959
+ "render-content": _vm.renderContent,
1960
+ "render-after-expand": _vm.renderAfterExpand,
1961
+ "show-checkbox": _vm.showCheckbox,
1962
+ node: child,
1963
+ },
1964
+ on: { "node-expand": _vm.handleChildNodeExpand },
1965
+ })
1966
+ }),
1967
+ 1
1968
+ )
1969
+ : _vm._e(),
1970
+ ]),
1971
+ ],
1972
+ 1
1973
+ )
1974
+ }
1975
+ var tree_nodevue_type_template_id_3869abb7_staticRenderFns = []
1976
+ tree_nodevue_type_template_id_3869abb7_render._withStripped = true
1977
+
1978
+
1979
+ // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=template&id=3869abb7
1980
+
1981
+ // EXTERNAL MODULE: external "element-ui/lib/transitions/collapse-transition"
1982
+ var collapse_transition_ = __webpack_require__(23);
1983
+ var collapse_transition_default = /*#__PURE__*/__webpack_require__.n(collapse_transition_);
1984
+
1985
+ // EXTERNAL MODULE: external "element-ui/lib/checkbox"
1986
+ var checkbox_ = __webpack_require__(14);
1987
+ var checkbox_default = /*#__PURE__*/__webpack_require__.n(checkbox_);
1988
+
1989
+ // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
1990
+ var emitter_ = __webpack_require__(4);
1991
+ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
1992
+
1993
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree-node.vue?vue&type=script&lang=js
1994
+ //
1995
+ //
1996
+ //
1997
+ //
1998
+ //
1999
+ //
2000
+ //
2001
+ //
2002
+ //
2003
+ //
2004
+ //
2005
+ //
2006
+ //
2007
+ //
2008
+ //
2009
+ //
2010
+ //
2011
+ //
2012
+ //
2013
+ //
2014
+ //
2015
+ //
2016
+ //
2017
+ //
2018
+ //
2019
+ //
2020
+ //
2021
+ //
2022
+ //
2023
+ //
2024
+ //
2025
+ //
2026
+ //
2027
+ //
2028
+ //
2029
+ //
2030
+ //
2031
+ //
2032
+ //
2033
+ //
2034
+ //
2035
+ //
2036
+ //
2037
+ //
2038
+ //
2039
+ //
2040
+ //
2041
+ //
2042
+ //
2043
+ //
2044
+ //
2045
+ //
2046
+ //
2047
+ //
2048
+ //
2049
+ //
2050
+ //
2051
+ //
2052
+ //
2053
+ //
2054
+ //
2055
+ //
2056
+ //
2057
+ //
2058
+ //
2059
+ //
2060
+ //
2061
+ //
2062
+ //
2063
+ //
2064
+ //
2065
+ //
2066
+ //
2067
+
2068
+
2069
+
2070
+
2071
+
2072
+
2073
+ /* harmony default export */ var tree_nodevue_type_script_lang_js = ({
2074
+ name: 'ElTreeNode',
2075
+
2076
+ componentName: 'ElTreeNode',
2077
+
2078
+ mixins: [emitter_default.a],
2079
+
2080
+ props: {
2081
+ node: {
2082
+ default: function _default() {
2083
+ return {};
2084
+ }
2085
+ },
2086
+ props: {},
2087
+ renderContent: Function,
2088
+ renderAfterExpand: {
2089
+ type: Boolean,
2090
+ default: true
2091
+ },
2092
+ showCheckbox: {
2093
+ type: Boolean,
2094
+ default: false
2095
+ }
2096
+ },
2097
+
2098
+ components: {
2099
+ ElCollapseTransition: collapse_transition_default.a,
2100
+ ElCheckbox: checkbox_default.a,
2101
+ NodeContent: {
2102
+ props: {
2103
+ node: {
2104
+ required: true
2105
+ }
2106
+ },
2107
+ render: function render(h) {
2108
+ var parent = this.$parent;
2109
+ var tree = parent.tree;
2110
+ var node = this.node;
2111
+ var data = node.data,
2112
+ store = node.store;
2113
+
2114
+ return parent.renderContent ? parent.renderContent.call(parent._renderProxy, h, { _self: tree.$vnode.context, node: node, data: data, store: store }) : tree.$scopedSlots.default ? tree.$scopedSlots.default({ node: node, data: data }) : h(
2115
+ 'span',
2116
+ { 'class': 'el-tree-node__label' },
2117
+ [node.label]
2118
+ );
2119
+ }
2120
+ }
2121
+ },
2122
+
2123
+ data: function data() {
2124
+ return {
2125
+ tree: null,
2126
+ expanded: false,
2127
+ childNodeRendered: false,
2128
+ oldChecked: null,
2129
+ oldIndeterminate: null
2130
+ };
2131
+ },
2132
+
2133
+
2134
+ watch: {
2135
+ 'node.indeterminate': function nodeIndeterminate(val) {
2136
+ this.handleSelectChange(this.node.checked, val);
2137
+ },
2138
+ 'node.checked': function nodeChecked(val) {
2139
+ this.handleSelectChange(val, this.node.indeterminate);
2140
+ },
2141
+ 'node.expanded': function nodeExpanded(val) {
2142
+ var _this = this;
2143
+
2144
+ this.$nextTick(function () {
2145
+ return _this.expanded = val;
2146
+ });
2147
+ if (val) {
2148
+ this.childNodeRendered = true;
2149
+ }
2150
+ }
2151
+ },
2152
+
2153
+ methods: {
2154
+ getNodeKey: function getNodeKey(node) {
2155
+ return util_getNodeKey(this.tree.nodeKey, node.data);
2156
+ },
2157
+ handleSelectChange: function handleSelectChange(checked, indeterminate) {
2158
+ if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) {
2159
+ this.tree.$emit('check-change', this.node.data, checked, indeterminate);
2160
+ }
2161
+ this.oldChecked = checked;
2162
+ this.indeterminate = indeterminate;
2163
+ },
2164
+ handleClick: function handleClick() {
2165
+ var store = this.tree.store;
2166
+ store.setCurrentNode(this.node);
2167
+ this.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode);
2168
+ this.tree.currentNode = this;
2169
+ if (this.tree.expandOnClickNode) {
2170
+ this.handleExpandIconClick();
2171
+ }
2172
+ if (this.tree.checkOnClickNode && !this.node.disabled) {
2173
+ this.handleCheckChange(null, {
2174
+ target: { checked: !this.node.checked }
2175
+ });
2176
+ }
2177
+ this.tree.$emit('node-click', this.node.data, this.node, this);
2178
+ },
2179
+ handleContextMenu: function handleContextMenu(event) {
2180
+ if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) {
2181
+ event.stopPropagation();
2182
+ event.preventDefault();
2183
+ }
2184
+ this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this);
2185
+ },
2186
+ handleExpandIconClick: function handleExpandIconClick() {
2187
+ if (this.node.isLeaf) return;
2188
+ if (this.expanded) {
2189
+ this.tree.$emit('node-collapse', this.node.data, this.node, this);
2190
+ this.node.collapse();
2191
+ } else {
2192
+ this.node.expand();
2193
+ this.$emit('node-expand', this.node.data, this.node, this);
2194
+ }
2195
+ },
2196
+ handleCheckChange: function handleCheckChange(value, ev) {
2197
+ var _this2 = this;
2198
+
2199
+ this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
2200
+ this.$nextTick(function () {
2201
+ var store = _this2.tree.store;
2202
+ _this2.tree.$emit('check', _this2.node.data, {
2203
+ checkedNodes: store.getCheckedNodes(),
2204
+ checkedKeys: store.getCheckedKeys(),
2205
+ halfCheckedNodes: store.getHalfCheckedNodes(),
2206
+ halfCheckedKeys: store.getHalfCheckedKeys()
2207
+ });
2208
+ });
2209
+ },
2210
+ handleChildNodeExpand: function handleChildNodeExpand(nodeData, node, instance) {
2211
+ this.broadcast('ElTreeNode', 'tree-node-expand', node);
2212
+ this.tree.$emit('node-expand', nodeData, node, instance);
2213
+ },
2214
+ handleDragStart: function handleDragStart(event) {
2215
+ if (!this.tree.draggable) return;
2216
+ this.tree.$emit('tree-node-drag-start', event, this);
2217
+ },
2218
+ handleDragOver: function handleDragOver(event) {
2219
+ if (!this.tree.draggable) return;
2220
+ this.tree.$emit('tree-node-drag-over', event, this);
2221
+ event.preventDefault();
2222
+ },
2223
+ handleDrop: function handleDrop(event) {
2224
+ event.preventDefault();
2225
+ },
2226
+ handleDragEnd: function handleDragEnd(event) {
2227
+ if (!this.tree.draggable) return;
2228
+ this.tree.$emit('tree-node-drag-end', event, this);
2229
+ }
2230
+ },
2231
+
2232
+ created: function created() {
2233
+ var _this3 = this;
2234
+
2235
+ var parent = this.$parent;
2236
+
2237
+ if (parent.isTree) {
2238
+ this.tree = parent;
2239
+ } else {
2240
+ this.tree = parent.tree;
2241
+ }
2242
+
2243
+ var tree = this.tree;
2244
+ if (!tree) {
2245
+ console.warn('Can not find node\'s tree.');
2246
+ }
2247
+
2248
+ var props = tree.props || {};
2249
+ var childrenKey = props['children'] || 'children';
2250
+
2251
+ this.$watch('node.data.' + childrenKey, function () {
2252
+ _this3.node.updateChildren();
2253
+ });
2254
+
2255
+ if (this.node.expanded) {
2256
+ this.expanded = true;
2257
+ this.childNodeRendered = true;
2258
+ }
2259
+
2260
+ if (this.tree.accordion) {
2261
+ this.$on('tree-node-expand', function (node) {
2262
+ if (_this3.node !== node) {
2263
+ _this3.node.collapse();
2264
+ }
2265
+ });
2266
+ }
2267
+ }
2268
+ });
2269
+ // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=script&lang=js
2270
+ /* harmony default export */ var src_tree_nodevue_type_script_lang_js = (tree_nodevue_type_script_lang_js);
2271
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2272
+ var componentNormalizer = __webpack_require__(0);
2273
+
2274
+ // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue
2275
+
2276
+
2277
+
2278
+
2279
+
2280
+ /* normalize component */
2281
+
2282
+ var component = Object(componentNormalizer["a" /* default */])(
2283
+ src_tree_nodevue_type_script_lang_js,
2284
+ tree_nodevue_type_template_id_3869abb7_render,
2285
+ tree_nodevue_type_template_id_3869abb7_staticRenderFns,
2286
+ false,
2287
+ null,
2288
+ null,
2289
+ null
2290
+
2291
+ )
2292
+
2293
+ /* harmony default export */ var tree_node = (component.exports);
2294
+ // EXTERNAL MODULE: external "element-ui/lib/locale"
2295
+ var locale_ = __webpack_require__(19);
2296
+
2297
+ // EXTERNAL MODULE: external "element-ui/lib/utils/dom"
2298
+ var dom_ = __webpack_require__(2);
2299
+
2300
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree.vue?vue&type=script&lang=js
2301
+ //
2302
+ //
2303
+ //
2304
+ //
2305
+ //
2306
+ //
2307
+ //
2308
+ //
2309
+ //
2310
+ //
2311
+ //
2312
+ //
2313
+ //
2314
+ //
2315
+ //
2316
+ //
2317
+ //
2318
+ //
2319
+ //
2320
+ //
2321
+ //
2322
+ //
2323
+ //
2324
+ //
2325
+ //
2326
+ //
2327
+ //
2328
+ //
2329
+ //
2330
+ //
2331
+ //
2332
+ //
2333
+
2334
+
2335
+
2336
+
2337
+
2338
+
2339
+
2340
+
2341
+ /* harmony default export */ var treevue_type_script_lang_js = ({
2342
+ name: 'ElTree',
2343
+
2344
+ mixins: [emitter_default.a],
2345
+
2346
+ components: {
2347
+ ElTreeNode: tree_node
2348
+ },
2349
+
2350
+ data: function data() {
2351
+ return {
2352
+ store: null,
2353
+ root: null,
2354
+ currentNode: null,
2355
+ treeItems: null,
2356
+ checkboxItems: [],
2357
+ dragState: {
2358
+ showDropIndicator: false,
2359
+ draggingNode: null,
2360
+ dropNode: null,
2361
+ allowDrop: true
2362
+ }
2363
+ };
2364
+ },
2365
+
2366
+
2367
+ props: {
2368
+ data: {
2369
+ type: Array
2370
+ },
2371
+ emptyText: {
2372
+ type: String,
2373
+ default: function _default() {
2374
+ return Object(locale_["t"])('el.tree.emptyText');
2375
+ }
2376
+ },
2377
+ renderAfterExpand: {
2378
+ type: Boolean,
2379
+ default: true
2380
+ },
2381
+ nodeKey: String,
2382
+ checkStrictly: Boolean,
2383
+ defaultExpandAll: Boolean,
2384
+ expandOnClickNode: {
2385
+ type: Boolean,
2386
+ default: true
2387
+ },
2388
+ checkOnClickNode: Boolean,
2389
+ checkDescendants: {
2390
+ type: Boolean,
2391
+ default: false
2392
+ },
2393
+ autoExpandParent: {
2394
+ type: Boolean,
2395
+ default: true
2396
+ },
2397
+ defaultCheckedKeys: Array,
2398
+ defaultExpandedKeys: Array,
2399
+ currentNodeKey: [String, Number],
2400
+ renderContent: Function,
2401
+ showCheckbox: {
2402
+ type: Boolean,
2403
+ default: false
2404
+ },
2405
+ draggable: {
2406
+ type: Boolean,
2407
+ default: false
2408
+ },
2409
+ allowDrag: Function,
2410
+ allowDrop: Function,
2411
+ props: {
2412
+ default: function _default() {
2413
+ return {
2414
+ children: 'children',
2415
+ label: 'label',
2416
+ disabled: 'disabled'
2417
+ };
2418
+ }
2419
+ },
2420
+ lazy: {
2421
+ type: Boolean,
2422
+ default: false
2423
+ },
2424
+ highlightCurrent: Boolean,
2425
+ load: Function,
2426
+ filterNodeMethod: Function,
2427
+ accordion: Boolean,
2428
+ indent: {
2429
+ type: Number,
2430
+ default: 18
2431
+ },
2432
+ iconClass: String
2433
+ },
2434
+
2435
+ computed: {
2436
+ children: {
2437
+ set: function set(value) {
2438
+ this.data = value;
2439
+ },
2440
+ get: function get() {
2441
+ return this.data;
2442
+ }
2443
+ },
2444
+
2445
+ treeItemArray: function treeItemArray() {
2446
+ return Array.prototype.slice.call(this.treeItems);
2447
+ },
2448
+ isEmpty: function isEmpty() {
2449
+ var childNodes = this.root.childNodes;
2450
+
2451
+ return !childNodes || childNodes.length === 0 || childNodes.every(function (_ref) {
2452
+ var visible = _ref.visible;
2453
+ return !visible;
2454
+ });
2455
+ }
2456
+ },
2457
+
2458
+ watch: {
2459
+ defaultCheckedKeys: function defaultCheckedKeys(newVal) {
2460
+ this.store.setDefaultCheckedKey(newVal);
2461
+ },
2462
+ defaultExpandedKeys: function defaultExpandedKeys(newVal) {
2463
+ this.store.defaultExpandedKeys = newVal;
2464
+ this.store.setDefaultExpandedKeys(newVal);
2465
+ },
2466
+ data: function data(newVal) {
2467
+ this.store.setData(newVal);
2468
+ },
2469
+ checkboxItems: function checkboxItems(val) {
2470
+ Array.prototype.forEach.call(val, function (checkbox) {
2471
+ checkbox.setAttribute('tabindex', -1);
2472
+ });
2473
+ },
2474
+ checkStrictly: function checkStrictly(newVal) {
2475
+ this.store.checkStrictly = newVal;
2476
+ }
2477
+ },
2478
+
2479
+ methods: {
2480
+ filter: function filter(value) {
2481
+ if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter');
2482
+ this.store.filter(value);
2483
+ },
2484
+ getNodeKey: function getNodeKey(node) {
2485
+ return util_getNodeKey(this.nodeKey, node.data);
2486
+ },
2487
+ getNodePath: function getNodePath(data) {
2488
+ if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getNodePath');
2489
+ var node = this.store.getNode(data);
2490
+ if (!node) return [];
2491
+ var path = [node.data];
2492
+ var parent = node.parent;
2493
+ while (parent && parent !== this.root) {
2494
+ path.push(parent.data);
2495
+ parent = parent.parent;
2496
+ }
2497
+ return path.reverse();
2498
+ },
2499
+ getCheckedNodes: function getCheckedNodes(leafOnly, includeHalfChecked) {
2500
+ return this.store.getCheckedNodes(leafOnly, includeHalfChecked);
2501
+ },
2502
+ getCheckedKeys: function getCheckedKeys(leafOnly) {
2503
+ return this.store.getCheckedKeys(leafOnly);
2504
+ },
2505
+ getCurrentNode: function getCurrentNode() {
2506
+ var currentNode = this.store.getCurrentNode();
2507
+ return currentNode ? currentNode.data : null;
2508
+ },
2509
+ getCurrentKey: function getCurrentKey() {
2510
+ if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getCurrentKey');
2511
+ var currentNode = this.getCurrentNode();
2512
+ return currentNode ? currentNode[this.nodeKey] : null;
2513
+ },
2514
+ setCheckedNodes: function setCheckedNodes(nodes, leafOnly) {
2515
+ if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedNodes');
2516
+ this.store.setCheckedNodes(nodes, leafOnly);
2517
+ },
2518
+ setCheckedKeys: function setCheckedKeys(keys, leafOnly) {
2519
+ if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedKeys');
2520
+ this.store.setCheckedKeys(keys, leafOnly);
2521
+ },
2522
+ setChecked: function setChecked(data, checked, deep) {
2523
+ this.store.setChecked(data, checked, deep);
2524
+ },
2525
+ getHalfCheckedNodes: function getHalfCheckedNodes() {
2526
+ return this.store.getHalfCheckedNodes();
2527
+ },
2528
+ getHalfCheckedKeys: function getHalfCheckedKeys() {
2529
+ return this.store.getHalfCheckedKeys();
2530
+ },
2531
+ setCurrentNode: function setCurrentNode(node) {
2532
+ if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentNode');
2533
+ this.store.setUserCurrentNode(node);
2534
+ },
2535
+ setCurrentKey: function setCurrentKey(key) {
2536
+ if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentKey');
2537
+ this.store.setCurrentNodeKey(key);
2538
+ },
2539
+ getNode: function getNode(data) {
2540
+ return this.store.getNode(data);
2541
+ },
2542
+ remove: function remove(data) {
2543
+ this.store.remove(data);
2544
+ },
2545
+ append: function append(data, parentNode) {
2546
+ this.store.append(data, parentNode);
2547
+ },
2548
+ insertBefore: function insertBefore(data, refNode) {
2549
+ this.store.insertBefore(data, refNode);
2550
+ },
2551
+ insertAfter: function insertAfter(data, refNode) {
2552
+ this.store.insertAfter(data, refNode);
2553
+ },
2554
+ handleNodeExpand: function handleNodeExpand(nodeData, node, instance) {
2555
+ this.broadcast('ElTreeNode', 'tree-node-expand', node);
2556
+ this.$emit('node-expand', nodeData, node, instance);
2557
+ },
2558
+ updateKeyChildren: function updateKeyChildren(key, data) {
2559
+ if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in updateKeyChild');
2560
+ this.store.updateChildren(key, data);
2561
+ },
2562
+ initTabIndex: function initTabIndex() {
2563
+ this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
2564
+ this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
2565
+ var checkedItem = this.$el.querySelectorAll('.is-checked[role=treeitem]');
2566
+ if (checkedItem.length) {
2567
+ checkedItem[0].setAttribute('tabindex', 0);
2568
+ return;
2569
+ }
2570
+ this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0);
2571
+ },
2572
+ handleKeydown: function handleKeydown(ev) {
2573
+ var currentItem = ev.target;
2574
+ if (currentItem.className.indexOf('el-tree-node') === -1) return;
2575
+ var keyCode = ev.keyCode;
2576
+ this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
2577
+ var currentIndex = this.treeItemArray.indexOf(currentItem);
2578
+ var nextIndex = void 0;
2579
+ if ([38, 40].indexOf(keyCode) > -1) {
2580
+ // up、down
2581
+ ev.preventDefault();
2582
+ if (keyCode === 38) {
2583
+ // up
2584
+ nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
2585
+ } else {
2586
+ nextIndex = currentIndex < this.treeItemArray.length - 1 ? currentIndex + 1 : 0;
2587
+ }
2588
+ this.treeItemArray[nextIndex].focus(); // 选中
2589
+ }
2590
+ if ([37, 39].indexOf(keyCode) > -1) {
2591
+ // left、right 展开
2592
+ ev.preventDefault();
2593
+ currentItem.click(); // 选中
2594
+ }
2595
+ var hasInput = currentItem.querySelector('[type="checkbox"]');
2596
+ if ([13, 32].indexOf(keyCode) > -1 && hasInput) {
2597
+ // space enter选中checkbox
2598
+ ev.preventDefault();
2599
+ hasInput.click();
2600
+ }
2601
+ }
2602
+ },
2603
+
2604
+ created: function created() {
2605
+ var _this = this;
2606
+
2607
+ this.isTree = true;
2608
+
2609
+ this.store = new tree_store({
2610
+ key: this.nodeKey,
2611
+ data: this.data,
2612
+ lazy: this.lazy,
2613
+ props: this.props,
2614
+ load: this.load,
2615
+ currentNodeKey: this.currentNodeKey,
2616
+ checkStrictly: this.checkStrictly,
2617
+ checkDescendants: this.checkDescendants,
2618
+ defaultCheckedKeys: this.defaultCheckedKeys,
2619
+ defaultExpandedKeys: this.defaultExpandedKeys,
2620
+ autoExpandParent: this.autoExpandParent,
2621
+ defaultExpandAll: this.defaultExpandAll,
2622
+ filterNodeMethod: this.filterNodeMethod
2623
+ });
2624
+
2625
+ this.root = this.store.root;
2626
+
2627
+ var dragState = this.dragState;
2628
+ this.$on('tree-node-drag-start', function (event, treeNode) {
2629
+ if (typeof _this.allowDrag === 'function' && !_this.allowDrag(treeNode.node)) {
2630
+ event.preventDefault();
2631
+ return false;
2632
+ }
2633
+ event.dataTransfer.effectAllowed = 'move';
2634
+
2635
+ // wrap in try catch to address IE's error when first param is 'text/plain'
2636
+ try {
2637
+ // setData is required for draggable to work in FireFox
2638
+ // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox
2639
+ event.dataTransfer.setData('text/plain', '');
2640
+ } catch (e) {}
2641
+ dragState.draggingNode = treeNode;
2642
+ _this.$emit('node-drag-start', treeNode.node, event);
2643
+ });
2644
+
2645
+ this.$on('tree-node-drag-over', function (event, treeNode) {
2646
+ var dropNode = findNearestComponent(event.target, 'ElTreeNode');
2647
+ var oldDropNode = dragState.dropNode;
2648
+ if (oldDropNode && oldDropNode !== dropNode) {
2649
+ Object(dom_["removeClass"])(oldDropNode.$el, 'is-drop-inner');
2650
+ }
2651
+ var draggingNode = dragState.draggingNode;
2652
+ if (!draggingNode || !dropNode) return;
2653
+
2654
+ var dropPrev = true;
2655
+ var dropInner = true;
2656
+ var dropNext = true;
2657
+ var userAllowDropInner = true;
2658
+ if (typeof _this.allowDrop === 'function') {
2659
+ dropPrev = _this.allowDrop(draggingNode.node, dropNode.node, 'prev');
2660
+ userAllowDropInner = dropInner = _this.allowDrop(draggingNode.node, dropNode.node, 'inner');
2661
+ dropNext = _this.allowDrop(draggingNode.node, dropNode.node, 'next');
2662
+ }
2663
+ event.dataTransfer.dropEffect = dropInner ? 'move' : 'none';
2664
+ if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
2665
+ if (oldDropNode) {
2666
+ _this.$emit('node-drag-leave', draggingNode.node, oldDropNode.node, event);
2667
+ }
2668
+ _this.$emit('node-drag-enter', draggingNode.node, dropNode.node, event);
2669
+ }
2670
+
2671
+ if (dropPrev || dropInner || dropNext) {
2672
+ dragState.dropNode = dropNode;
2673
+ }
2674
+
2675
+ if (dropNode.node.nextSibling === draggingNode.node) {
2676
+ dropNext = false;
2677
+ }
2678
+ if (dropNode.node.previousSibling === draggingNode.node) {
2679
+ dropPrev = false;
2680
+ }
2681
+ if (dropNode.node.contains(draggingNode.node, false)) {
2682
+ dropInner = false;
2683
+ }
2684
+ if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
2685
+ dropPrev = false;
2686
+ dropInner = false;
2687
+ dropNext = false;
2688
+ }
2689
+
2690
+ var targetPosition = dropNode.$el.getBoundingClientRect();
2691
+ var treePosition = _this.$el.getBoundingClientRect();
2692
+
2693
+ var dropType = void 0;
2694
+ var prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : -1;
2695
+ var nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : 1;
2696
+
2697
+ var indicatorTop = -9999;
2698
+ var distance = event.clientY - targetPosition.top;
2699
+ if (distance < targetPosition.height * prevPercent) {
2700
+ dropType = 'before';
2701
+ } else if (distance > targetPosition.height * nextPercent) {
2702
+ dropType = 'after';
2703
+ } else if (dropInner) {
2704
+ dropType = 'inner';
2705
+ } else {
2706
+ dropType = 'none';
2707
+ }
2708
+
2709
+ var iconPosition = dropNode.$el.querySelector('.el-tree-node__expand-icon').getBoundingClientRect();
2710
+ var dropIndicator = _this.$refs.dropIndicator;
2711
+ if (dropType === 'before') {
2712
+ indicatorTop = iconPosition.top - treePosition.top;
2713
+ } else if (dropType === 'after') {
2714
+ indicatorTop = iconPosition.bottom - treePosition.top;
2715
+ }
2716
+ dropIndicator.style.top = indicatorTop + 'px';
2717
+ dropIndicator.style.left = iconPosition.right - treePosition.left + 'px';
2718
+
2719
+ if (dropType === 'inner') {
2720
+ Object(dom_["addClass"])(dropNode.$el, 'is-drop-inner');
2721
+ } else {
2722
+ Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
2723
+ }
2724
+
2725
+ dragState.showDropIndicator = dropType === 'before' || dropType === 'after';
2726
+ dragState.allowDrop = dragState.showDropIndicator || userAllowDropInner;
2727
+ dragState.dropType = dropType;
2728
+ _this.$emit('node-drag-over', draggingNode.node, dropNode.node, event);
2729
+ });
2730
+
2731
+ this.$on('tree-node-drag-end', function (event) {
2732
+ var draggingNode = dragState.draggingNode,
2733
+ dropType = dragState.dropType,
2734
+ dropNode = dragState.dropNode;
2735
+
2736
+ event.preventDefault();
2737
+ event.dataTransfer.dropEffect = 'move';
2738
+
2739
+ if (draggingNode && dropNode) {
2740
+ var draggingNodeCopy = { data: draggingNode.node.data };
2741
+ if (dropType !== 'none') {
2742
+ draggingNode.node.remove();
2743
+ }
2744
+ if (dropType === 'before') {
2745
+ dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node);
2746
+ } else if (dropType === 'after') {
2747
+ dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node);
2748
+ } else if (dropType === 'inner') {
2749
+ dropNode.node.insertChild(draggingNodeCopy);
2750
+ }
2751
+ if (dropType !== 'none') {
2752
+ _this.store.registerNode(draggingNodeCopy);
2753
+ }
2754
+
2755
+ Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
2756
+
2757
+ _this.$emit('node-drag-end', draggingNode.node, dropNode.node, dropType, event);
2758
+ if (dropType !== 'none') {
2759
+ _this.$emit('node-drop', draggingNode.node, dropNode.node, dropType, event);
2760
+ }
2761
+ }
2762
+ if (draggingNode && !dropNode) {
2763
+ _this.$emit('node-drag-end', draggingNode.node, null, dropType, event);
2764
+ }
2765
+
2766
+ dragState.showDropIndicator = false;
2767
+ dragState.draggingNode = null;
2768
+ dragState.dropNode = null;
2769
+ dragState.allowDrop = true;
2770
+ });
2771
+ },
2772
+ mounted: function mounted() {
2773
+ this.initTabIndex();
2774
+ this.$el.addEventListener('keydown', this.handleKeydown);
2775
+ },
2776
+ updated: function updated() {
2777
+ this.treeItems = this.$el.querySelectorAll('[role=treeitem]');
2778
+ this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
2779
+ }
2780
+ });
2781
+ // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=script&lang=js
2782
+ /* harmony default export */ var src_treevue_type_script_lang_js = (treevue_type_script_lang_js);
2783
+ // CONCATENATED MODULE: ./packages/tree/src/tree.vue
2784
+
2785
+
2786
+
2787
+
2788
+
2789
+ /* normalize component */
2790
+
2791
+ var tree_component = Object(componentNormalizer["a" /* default */])(
2792
+ src_treevue_type_script_lang_js,
2793
+ render,
2794
+ staticRenderFns,
2795
+ false,
2796
+ null,
2797
+ null,
2798
+ null
2799
+
2800
+ )
2801
+
2802
+ /* harmony default export */ var tree = (tree_component.exports);
2803
+ // CONCATENATED MODULE: ./packages/tree/index.js
2804
+
2805
+
2806
+ /* istanbul ignore next */
2807
+ tree.install = function (Vue) {
2808
+ Vue.component(tree.name, tree);
2809
+ };
2810
+
2811
+ /* harmony default export */ var packages_tree = __webpack_exports__["default"] = (tree);
2812
+
2813
+ /***/ }),
2814
+
2815
+ /***/ 43:
2816
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2817
+
2818
+ "use strict";
2819
+ // ESM COMPAT FLAG
2820
+ __webpack_require__.r(__webpack_exports__);
2821
+
2822
+ // 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=e4c971fa
2823
+ var render = function () {
2824
+ var _vm = this
2825
+ var _h = _vm.$createElement
2826
+ var _c = _vm._self._c || _h
2827
+ return _c(
2828
+ "div",
2829
+ {
2830
+ class: [
2831
+ _vm.type === "textarea" ? "el-textarea" : "el-input",
2832
+ _vm.inputSize ? "el-input--" + _vm.inputSize : "",
2833
+ {
2834
+ "is-disabled": _vm.inputDisabled,
2835
+ "is-exceed": _vm.inputExceed,
2836
+ "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
2837
+ "el-input-group--append": _vm.$slots.append,
2838
+ "el-input-group--prepend": _vm.$slots.prepend,
2839
+ "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
2840
+ "el-input--suffix":
2841
+ _vm.$slots.suffix ||
2842
+ _vm.suffixIcon ||
2843
+ _vm.clearable ||
2844
+ _vm.showPassword,
2845
+ },
2846
+ ],
2847
+ on: {
2848
+ mouseenter: function ($event) {
2849
+ _vm.hovering = true
2850
+ },
2851
+ mouseleave: function ($event) {
2852
+ _vm.hovering = false
2853
+ },
2854
+ },
2855
+ },
2856
+ [
2857
+ _vm.type !== "textarea"
2858
+ ? [
2859
+ _vm.$slots.prepend
2860
+ ? _c(
2861
+ "div",
2862
+ { staticClass: "el-input-group__prepend" },
2863
+ [_vm._t("prepend")],
2864
+ 2
2865
+ )
2866
+ : _vm._e(),
2867
+ _vm.type !== "textarea"
2868
+ ? _c(
2869
+ "input",
2870
+ _vm._b(
2871
+ {
2872
+ ref: "input",
2873
+ staticClass: "el-input__inner",
2874
+ attrs: {
2875
+ tabindex: _vm.tabindex,
2876
+ type: _vm.showPassword
2877
+ ? _vm.passwordVisible
2878
+ ? "text"
2879
+ : "password"
2880
+ : _vm.type,
2881
+ disabled: _vm.inputDisabled,
2882
+ readonly: _vm.readonly,
2883
+ autocomplete: _vm.autoComplete || _vm.autocomplete,
2884
+ "aria-label": _vm.label,
2885
+ },
2886
+ on: {
2887
+ compositionstart: _vm.handleCompositionStart,
2888
+ compositionupdate: _vm.handleCompositionUpdate,
2889
+ compositionend: _vm.handleCompositionEnd,
2890
+ input: _vm.handleInput,
2891
+ focus: _vm.handleFocus,
2892
+ blur: _vm.handleBlur,
2893
+ change: _vm.handleChange,
2894
+ },
2895
+ },
2896
+ "input",
2897
+ _vm.$attrs,
2898
+ false
2899
+ )
2900
+ )
2901
+ : _vm._e(),
2902
+ _vm.$slots.prefix || _vm.prefixIcon
2903
+ ? _c(
2904
+ "span",
2905
+ { staticClass: "el-input__prefix" },
2906
+ [
2907
+ _vm._t("prefix"),
2908
+ _vm.prefixIcon
2909
+ ? _c("i", {
2910
+ staticClass: "el-input__icon",
2911
+ class: _vm.prefixIcon,
2912
+ })
2913
+ : _vm._e(),
2914
+ ],
2915
+ 2
2916
+ )
2917
+ : _vm._e(),
2918
+ _vm.getSuffixVisible()
2919
+ ? _c("span", { staticClass: "el-input__suffix" }, [
2920
+ _c(
2921
+ "span",
2922
+ { staticClass: "el-input__suffix-inner" },
2923
+ [
2924
+ !_vm.showClear ||
2925
+ !_vm.showPwdVisible ||
2926
+ !_vm.isWordLimitVisible
2927
+ ? [
2928
+ _vm._t("suffix"),
2929
+ _vm.suffixIcon
2930
+ ? _c("i", {
2931
+ staticClass: "el-input__icon",
2932
+ class: _vm.suffixIcon,
2933
+ })
2934
+ : _vm._e(),
2935
+ ]
2936
+ : _vm._e(),
2937
+ _vm.showClear
2938
+ ? _c("i", {
2939
+ staticClass:
2940
+ "el-input__icon el-icon-circle-close el-input__clear",
2941
+ on: {
2942
+ mousedown: function ($event) {
2943
+ $event.preventDefault()
2944
+ },
2945
+ click: _vm.clear,
2946
+ },
2947
+ })
2948
+ : _vm._e(),
2949
+ _vm.showPwdVisible
2950
+ ? _c("i", {
2951
+ staticClass:
2952
+ "el-input__icon el-icon-view el-input__clear",
2953
+ on: { click: _vm.handlePasswordVisible },
2954
+ })
2955
+ : _vm._e(),
2956
+ _vm.isWordLimitVisible
2957
+ ? _c("span", { staticClass: "el-input__count" }, [
2958
+ _c(
2959
+ "span",
2960
+ { staticClass: "el-input__count-inner" },
2961
+ [
2962
+ _vm._v(
2963
+ "\n " +
2964
+ _vm._s(_vm.textLength) +
2965
+ "/" +
2966
+ _vm._s(_vm.upperLimit) +
2967
+ "\n "
2968
+ ),
2969
+ ]
2970
+ ),
2971
+ ])
2972
+ : _vm._e(),
2973
+ ],
2974
+ 2
2975
+ ),
2976
+ _vm.validateState
2977
+ ? _c("i", {
2978
+ staticClass: "el-input__icon",
2979
+ class: ["el-input__validateIcon", _vm.validateIcon],
2980
+ })
2981
+ : _vm._e(),
2982
+ ])
2983
+ : _vm._e(),
2984
+ _vm.$slots.append
2985
+ ? _c(
2986
+ "div",
2987
+ { staticClass: "el-input-group__append" },
2988
+ [_vm._t("append")],
2989
+ 2
2990
+ )
2991
+ : _vm._e(),
2992
+ ]
2993
+ : _c(
2994
+ "textarea",
2995
+ _vm._b(
2996
+ {
2997
+ ref: "textarea",
2998
+ staticClass: "el-textarea__inner",
2999
+ style: _vm.textareaStyle,
3000
+ attrs: {
3001
+ tabindex: _vm.tabindex,
3002
+ disabled: _vm.inputDisabled,
3003
+ readonly: _vm.readonly,
3004
+ autocomplete: _vm.autoComplete || _vm.autocomplete,
3005
+ "aria-label": _vm.label,
3006
+ },
3007
+ on: {
3008
+ compositionstart: _vm.handleCompositionStart,
3009
+ compositionupdate: _vm.handleCompositionUpdate,
3010
+ compositionend: _vm.handleCompositionEnd,
3011
+ input: _vm.handleInput,
3012
+ focus: _vm.handleFocus,
3013
+ blur: _vm.handleBlur,
3014
+ change: _vm.handleChange,
3015
+ },
3016
+ },
3017
+ "textarea",
3018
+ _vm.$attrs,
3019
+ false
3020
+ )
3021
+ ),
3022
+ _vm.isWordLimitVisible && _vm.type === "textarea"
3023
+ ? _c("span", { staticClass: "el-input__count" }, [
3024
+ _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit)),
3025
+ ])
3026
+ : _vm._e(),
3027
+ ],
3028
+ 2
3029
+ )
3030
+ }
3031
+ var staticRenderFns = []
3032
+ render._withStripped = true
3033
+
3034
+
3035
+ // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=e4c971fa
3036
+
3037
+ // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
3038
+ var emitter_ = __webpack_require__(4);
3039
+ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
3040
+
3041
+ // EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"
3042
+ var migrating_ = __webpack_require__(10);
3043
+ var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
3044
+
3045
+ // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
3046
+ var hiddenTextarea = void 0;
3047
+
3048
+ 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';
3049
+
3050
+ 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'];
3051
+
3052
+ function calculateNodeStyling(targetElement) {
3053
+ var style = window.getComputedStyle(targetElement);
3054
+
3055
+ var boxSizing = style.getPropertyValue('box-sizing');
3056
+
3057
+ var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
3058
+
3059
+ var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
3060
+
3061
+ var contextStyle = CONTEXT_STYLE.map(function (name) {
3062
+ return name + ':' + style.getPropertyValue(name);
3063
+ }).join(';');
3064
+
3065
+ return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
3066
+ }
3067
+
3068
+ function calcTextareaHeight(targetElement) {
3069
+ var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
3070
+ var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3071
+
3072
+ if (!hiddenTextarea) {
3073
+ hiddenTextarea = document.createElement('textarea');
3074
+ document.body.appendChild(hiddenTextarea);
3075
+ }
3076
+
3077
+ var _calculateNodeStyling = calculateNodeStyling(targetElement),
3078
+ paddingSize = _calculateNodeStyling.paddingSize,
3079
+ borderSize = _calculateNodeStyling.borderSize,
3080
+ boxSizing = _calculateNodeStyling.boxSizing,
3081
+ contextStyle = _calculateNodeStyling.contextStyle;
3082
+
3083
+ hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
3084
+ hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
3085
+
3086
+ var height = hiddenTextarea.scrollHeight;
3087
+ var result = {};
3088
+
3089
+ if (boxSizing === 'border-box') {
3090
+ height = height + borderSize;
3091
+ } else if (boxSizing === 'content-box') {
3092
+ height = height - paddingSize;
3093
+ }
3094
+
3095
+ hiddenTextarea.value = '';
3096
+ var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
3097
+
3098
+ if (minRows !== null) {
3099
+ var minHeight = singleRowHeight * minRows;
3100
+ if (boxSizing === 'border-box') {
3101
+ minHeight = minHeight + paddingSize + borderSize;
3102
+ }
3103
+ height = Math.max(minHeight, height);
3104
+ result.minHeight = minHeight + 'px';
3105
+ }
3106
+ if (maxRows !== null) {
3107
+ var maxHeight = singleRowHeight * maxRows;
3108
+ if (boxSizing === 'border-box') {
3109
+ maxHeight = maxHeight + paddingSize + borderSize;
3110
+ }
3111
+ height = Math.min(maxHeight, height);
3112
+ }
3113
+ result.height = height + 'px';
3114
+ hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
3115
+ hiddenTextarea = null;
3116
+ return result;
3117
+ };
3118
+ // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
3119
+ var merge_ = __webpack_require__(9);
3120
+ var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
3121
+
3122
+ // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
3123
+ var shared_ = __webpack_require__(21);
3124
+
3125
+ // 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
3126
+ //
3127
+ //
3128
+ //
3129
+ //
3130
+ //
3131
+ //
3132
+ //
3133
+ //
3134
+ //
3135
+ //
3136
+ //
3137
+ //
3138
+ //
3139
+ //
3140
+ //
3141
+ //
3142
+ //
3143
+ //
3144
+ //
3145
+ //
3146
+ //
3147
+ //
3148
+ //
3149
+ //
3150
+ //
3151
+ //
3152
+ //
3153
+ //
3154
+ //
3155
+ //
3156
+ //
3157
+ //
3158
+ //
3159
+ //
3160
+ //
3161
+ //
3162
+ //
3163
+ //
3164
+ //
3165
+ //
3166
+ //
3167
+ //
3168
+ //
3169
+ //
3170
+ //
3171
+ //
3172
+ //
3173
+ //
3174
+ //
3175
+ //
3176
+ //
3177
+ //
3178
+ //
3179
+ //
3180
+ //
3181
+ //
3182
+ //
3183
+ //
3184
+ //
3185
+ //
3186
+ //
3187
+ //
3188
+ //
3189
+ //
3190
+ //
3191
+ //
3192
+ //
3193
+ //
3194
+ //
3195
+ //
3196
+ //
3197
+ //
3198
+ //
3199
+ //
3200
+ //
3201
+ //
3202
+ //
3203
+ //
3204
+ //
3205
+ //
3206
+ //
3207
+ //
3208
+ //
3209
+ //
3210
+ //
3211
+ //
3212
+ //
3213
+ //
3214
+ //
3215
+ //
3216
+ //
3217
+ //
3218
+ //
3219
+ //
3220
+ //
3221
+ //
3222
+ //
3223
+ //
3224
+ //
3225
+ //
3226
+ //
3227
+ //
3228
+ //
3229
+ //
3230
+ //
3231
+ //
3232
+ //
3233
+ //
3234
+ //
3235
+
3236
+
3237
+
3238
+
3239
+
3240
+
3241
+
3242
+ /* harmony default export */ var inputvue_type_script_lang_js = ({
3243
+ name: 'ElInput',
3244
+
3245
+ componentName: 'ElInput',
3246
+
3247
+ mixins: [emitter_default.a, migrating_default.a],
3248
+
3249
+ inheritAttrs: false,
3250
+
3251
+ inject: {
3252
+ elForm: {
3253
+ default: ''
3254
+ },
3255
+ elFormItem: {
3256
+ default: ''
3257
+ }
3258
+ },
3259
+
3260
+ data: function data() {
3261
+ return {
3262
+ textareaCalcStyle: {},
3263
+ hovering: false,
3264
+ focused: false,
3265
+ isComposing: false,
3266
+ passwordVisible: false
3267
+ };
3268
+ },
3269
+
3270
+
3271
+ props: {
3272
+ value: [String, Number],
3273
+ size: String,
3274
+ resize: String,
3275
+ form: String,
3276
+ disabled: Boolean,
3277
+ readonly: Boolean,
3278
+ type: {
3279
+ type: String,
3280
+ default: 'text'
3281
+ },
3282
+ autosize: {
3283
+ type: [Boolean, Object],
3284
+ default: false
3285
+ },
3286
+ autocomplete: {
3287
+ type: String,
3288
+ default: 'off'
3289
+ },
3290
+ /** @Deprecated in next major version */
3291
+ autoComplete: {
3292
+ type: String,
3293
+ validator: function validator(val) {
3294
+ false && false;
3295
+ return true;
3296
+ }
3297
+ },
3298
+ validateEvent: {
3299
+ type: Boolean,
3300
+ default: true
3301
+ },
3302
+ suffixIcon: String,
3303
+ prefixIcon: String,
3304
+ label: String,
3305
+ clearable: {
3306
+ type: Boolean,
3307
+ default: false
3308
+ },
3309
+ showPassword: {
3310
+ type: Boolean,
3311
+ default: false
3312
+ },
3313
+ showWordLimit: {
3314
+ type: Boolean,
3315
+ default: false
3316
+ },
3317
+ tabindex: String
3318
+ },
3319
+
3320
+ computed: {
3321
+ _elFormItemSize: function _elFormItemSize() {
3322
+ return (this.elFormItem || {}).elFormItemSize;
3323
+ },
3324
+ validateState: function validateState() {
3325
+ return this.elFormItem ? this.elFormItem.validateState : '';
3326
+ },
3327
+ needStatusIcon: function needStatusIcon() {
3328
+ return this.elForm ? this.elForm.statusIcon : false;
3329
+ },
3330
+ validateIcon: function validateIcon() {
3331
+ return {
3332
+ validating: 'el-icon-loading',
3333
+ success: 'el-icon-circle-check',
3334
+ error: 'el-icon-circle-close'
3335
+ }[this.validateState];
3336
+ },
3337
+ textareaStyle: function textareaStyle() {
3338
+ return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
3339
+ },
3340
+ inputSize: function inputSize() {
3341
+ return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
3342
+ },
3343
+ inputDisabled: function inputDisabled() {
3344
+ return this.disabled || (this.elForm || {}).disabled;
3345
+ },
3346
+ nativeInputValue: function nativeInputValue() {
3347
+ return this.value === null || this.value === undefined ? '' : String(this.value);
3348
+ },
3349
+ showClear: function showClear() {
3350
+ return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
3351
+ },
3352
+ showPwdVisible: function showPwdVisible() {
3353
+ return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
3354
+ },
3355
+ isWordLimitVisible: function isWordLimitVisible() {
3356
+ return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
3357
+ },
3358
+ upperLimit: function upperLimit() {
3359
+ return this.$attrs.maxlength;
3360
+ },
3361
+ textLength: function textLength() {
3362
+ if (typeof this.value === 'number') {
3363
+ return String(this.value).length;
3364
+ }
3365
+
3366
+ return (this.value || '').length;
3367
+ },
3368
+ inputExceed: function inputExceed() {
3369
+ // show exceed style if length of initial value greater then maxlength
3370
+ return this.isWordLimitVisible && this.textLength > this.upperLimit;
3371
+ }
3372
+ },
3373
+
3374
+ watch: {
3375
+ value: function value(val) {
3376
+ this.$nextTick(this.resizeTextarea);
3377
+ if (this.validateEvent) {
3378
+ this.dispatch('ElFormItem', 'el.form.change', [val]);
3379
+ }
3380
+ },
3381
+
3382
+ // native input value is set explicitly
3383
+ // do not use v-model / :value in template
3384
+ // see: https://github.com/ElemeFE/element/issues/14521
3385
+ nativeInputValue: function nativeInputValue() {
3386
+ this.setNativeInputValue();
3387
+ },
3388
+
3389
+ // when change between <input> and <textarea>,
3390
+ // update DOM dependent value and styles
3391
+ // https://github.com/ElemeFE/element/issues/14857
3392
+ type: function type() {
3393
+ var _this = this;
3394
+
3395
+ this.$nextTick(function () {
3396
+ _this.setNativeInputValue();
3397
+ _this.resizeTextarea();
3398
+ _this.updateIconOffset();
3399
+ });
3400
+ }
3401
+ },
3402
+
3403
+ methods: {
3404
+ focus: function focus() {
3405
+ this.getInput().focus();
3406
+ },
3407
+ blur: function blur() {
3408
+ this.getInput().blur();
3409
+ },
3410
+ getMigratingConfig: function getMigratingConfig() {
3411
+ return {
3412
+ props: {
3413
+ 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
3414
+ 'on-icon-click': 'on-icon-click is removed.'
3415
+ },
3416
+ events: {
3417
+ 'click': 'click is removed.'
3418
+ }
3419
+ };
3420
+ },
3421
+ handleBlur: function handleBlur(event) {
3422
+ this.focused = false;
3423
+ this.$emit('blur', event);
3424
+ if (this.validateEvent) {
3425
+ this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
3426
+ }
3427
+ },
3428
+ select: function select() {
3429
+ this.getInput().select();
3430
+ },
3431
+ resizeTextarea: function resizeTextarea() {
3432
+ if (this.$isServer) return;
3433
+ var autosize = this.autosize,
3434
+ type = this.type;
3435
+
3436
+ if (type !== 'textarea') return;
3437
+ if (!autosize) {
3438
+ this.textareaCalcStyle = {
3439
+ minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
3440
+ };
3441
+ return;
3442
+ }
3443
+ var minRows = autosize.minRows;
3444
+ var maxRows = autosize.maxRows;
3445
+
3446
+ this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
3447
+ },
3448
+ setNativeInputValue: function setNativeInputValue() {
3449
+ var input = this.getInput();
3450
+ if (!input) return;
3451
+ if (input.value === this.nativeInputValue) return;
3452
+ input.value = this.nativeInputValue;
3453
+ },
3454
+ handleFocus: function handleFocus(event) {
3455
+ this.focused = true;
3456
+ this.$emit('focus', event);
3457
+ },
3458
+ handleCompositionStart: function handleCompositionStart(event) {
3459
+ this.$emit('compositionstart', event);
3460
+ this.isComposing = true;
3461
+ },
3462
+ handleCompositionUpdate: function handleCompositionUpdate(event) {
3463
+ this.$emit('compositionupdate', event);
3464
+ var text = event.target.value;
3465
+ var lastCharacter = text[text.length - 1] || '';
3466
+ this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
3467
+ },
3468
+ handleCompositionEnd: function handleCompositionEnd(event) {
3469
+ this.$emit('compositionend', event);
3470
+ if (this.isComposing) {
3471
+ this.isComposing = false;
3472
+ this.handleInput(event);
3473
+ }
3474
+ },
3475
+ handleInput: function handleInput(event) {
3476
+ // should not emit input during composition
3477
+ // see: https://github.com/ElemeFE/element/issues/10516
3478
+ if (this.isComposing) return;
3479
+
3480
+ // hack for https://github.com/ElemeFE/element/issues/8548
3481
+ // should remove the following line when we don't support IE
3482
+ if (event.target.value === this.nativeInputValue) return;
3483
+
3484
+ this.$emit('input', event.target.value);
3485
+
3486
+ // ensure native input value is controlled
3487
+ // see: https://github.com/ElemeFE/element/issues/12850
3488
+ this.$nextTick(this.setNativeInputValue);
3489
+ },
3490
+ handleChange: function handleChange(event) {
3491
+ this.$emit('change', event.target.value);
3492
+ },
3493
+ calcIconOffset: function calcIconOffset(place) {
3494
+ var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
3495
+ if (!elList.length) return;
3496
+ var el = null;
3497
+ for (var i = 0; i < elList.length; i++) {
3498
+ if (elList[i].parentNode === this.$el) {
3499
+ el = elList[i];
3500
+ break;
3501
+ }
3502
+ }
3503
+ if (!el) return;
3504
+ var pendantMap = {
3505
+ suffix: 'append',
3506
+ prefix: 'prepend'
3507
+ };
3508
+
3509
+ var pendant = pendantMap[place];
3510
+ if (this.$slots[pendant]) {
3511
+ el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
3512
+ } else {
3513
+ el.removeAttribute('style');
3514
+ }
3515
+ },
3516
+ updateIconOffset: function updateIconOffset() {
3517
+ this.calcIconOffset('prefix');
3518
+ this.calcIconOffset('suffix');
3519
+ },
3520
+ clear: function clear() {
3521
+ this.$emit('input', '');
3522
+ this.$emit('change', '');
3523
+ this.$emit('clear');
3524
+ },
3525
+ handlePasswordVisible: function handlePasswordVisible() {
3526
+ var _this2 = this;
3527
+
3528
+ this.passwordVisible = !this.passwordVisible;
3529
+ this.$nextTick(function () {
3530
+ _this2.focus();
3531
+ });
3532
+ },
3533
+ getInput: function getInput() {
3534
+ return this.$refs.input || this.$refs.textarea;
3535
+ },
3536
+ getSuffixVisible: function getSuffixVisible() {
3537
+ return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
3538
+ }
3539
+ },
3540
+
3541
+ created: function created() {
3542
+ this.$on('inputSelect', this.select);
3543
+ },
3544
+ mounted: function mounted() {
3545
+ this.setNativeInputValue();
3546
+ this.resizeTextarea();
3547
+ this.updateIconOffset();
3548
+ },
3549
+ updated: function updated() {
3550
+ this.$nextTick(this.updateIconOffset);
3551
+ }
3552
+ });
3553
+ // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js
3554
+ /* harmony default export */ var src_inputvue_type_script_lang_js = (inputvue_type_script_lang_js);
3555
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
3556
+ var componentNormalizer = __webpack_require__(0);
3557
+
3558
+ // CONCATENATED MODULE: ./packages/input/src/input.vue
3559
+
3560
+
3561
+
3562
+
3563
+
3564
+ /* normalize component */
3565
+
3566
+ var component = Object(componentNormalizer["a" /* default */])(
3567
+ src_inputvue_type_script_lang_js,
3568
+ render,
3569
+ staticRenderFns,
3570
+ false,
3571
+ null,
3572
+ null,
3573
+ null
3574
+
3575
+ )
3576
+
3577
+ /* harmony default export */ var input = (component.exports);
3578
+ // CONCATENATED MODULE: ./packages/input/index.js
3579
+
3580
+
3581
+ /* istanbul ignore next */
3582
+ input.install = function (Vue) {
3583
+ Vue.component(input.name, input);
3584
+ };
3585
+
3586
+ /* harmony default export */ var packages_input = __webpack_exports__["default"] = (input);
3587
+
3588
+ /***/ }),
3589
+
3590
+ /***/ 44:
3591
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3592
+
3593
+ "use strict";
3594
+ // ESM COMPAT FLAG
3595
+ __webpack_require__.r(__webpack_exports__);
3596
+
3597
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/popover/src/main.vue?vue&type=template&id=55a1ff9d
3598
+ var render = function () {
3599
+ var _vm = this
3600
+ var _h = _vm.$createElement
3601
+ var _c = _vm._self._c || _h
3602
+ return _c(
3603
+ "span",
3604
+ [
3605
+ _c(
3606
+ "transition",
3607
+ {
3608
+ attrs: { name: _vm.transition },
3609
+ on: {
3610
+ "after-enter": _vm.handleAfterEnter,
3611
+ "after-leave": _vm.handleAfterLeave,
3612
+ },
3613
+ },
3614
+ [
3615
+ _c(
3616
+ "div",
3617
+ {
3618
+ directives: [
3619
+ {
3620
+ name: "show",
3621
+ rawName: "v-show",
3622
+ value: !_vm.disabled && _vm.showPopper,
3623
+ expression: "!disabled && showPopper",
3624
+ },
3625
+ ],
3626
+ ref: "popper",
3627
+ staticClass: "el-popover el-popper",
3628
+ class: [_vm.popperClass, _vm.content && "el-popover--plain"],
3629
+ style: { width: _vm.width + "px" },
3630
+ attrs: {
3631
+ role: "tooltip",
3632
+ id: _vm.tooltipId,
3633
+ "aria-hidden":
3634
+ _vm.disabled || !_vm.showPopper ? "true" : "false",
3635
+ },
3636
+ },
3637
+ [
3638
+ _vm.title
3639
+ ? _c("div", {
3640
+ staticClass: "el-popover__title",
3641
+ domProps: { textContent: _vm._s(_vm.title) },
3642
+ })
3643
+ : _vm._e(),
3644
+ _vm._t("default", [_vm._v(_vm._s(_vm.content))]),
3645
+ ],
3646
+ 2
3647
+ ),
3648
+ ]
3649
+ ),
3650
+ _c(
3651
+ "span",
3652
+ { ref: "wrapper", staticClass: "el-popover__reference-wrapper" },
3653
+ [_vm._t("reference")],
3654
+ 2
3655
+ ),
3656
+ ],
3657
+ 1
3658
+ )
3659
+ }
3660
+ var staticRenderFns = []
3661
+ render._withStripped = true
3662
+
3663
+
3664
+ // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=template&id=55a1ff9d
3665
+
3666
+ // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
3667
+ var vue_popper_ = __webpack_require__(5);
3668
+ var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
3669
+
3670
+ // EXTERNAL MODULE: external "element-ui/lib/utils/dom"
3671
+ var dom_ = __webpack_require__(2);
3672
+
3673
+ // EXTERNAL MODULE: external "element-ui/lib/utils/util"
3674
+ var util_ = __webpack_require__(3);
3675
+
3676
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/popover/src/main.vue?vue&type=script&lang=js
3677
+ //
3678
+ //
3679
+ //
3680
+ //
3681
+ //
3682
+ //
3683
+ //
3684
+ //
3685
+ //
3686
+ //
3687
+ //
3688
+ //
3689
+ //
3690
+ //
3691
+ //
3692
+ //
3693
+ //
3694
+ //
3695
+ //
3696
+ //
3697
+ //
3698
+ //
3699
+ //
3700
+ //
3701
+ //
3702
+
3703
+
3704
+
3705
+
3706
+
3707
+
3708
+ /* harmony default export */ var mainvue_type_script_lang_js = ({
3709
+ name: 'ElPopover',
3710
+
3711
+ mixins: [vue_popper_default.a],
3712
+
3713
+ props: {
3714
+ trigger: {
3715
+ type: String,
3716
+ default: 'click',
3717
+ validator: function validator(value) {
3718
+ return ['click', 'focus', 'hover', 'manual'].indexOf(value) > -1;
3719
+ }
3720
+ },
3721
+ openDelay: {
3722
+ type: Number,
3723
+ default: 0
3724
+ },
3725
+ closeDelay: {
3726
+ type: Number,
3727
+ default: 200
3728
+ },
3729
+ title: String,
3730
+ disabled: Boolean,
3731
+ content: String,
3732
+ reference: {},
3733
+ popperClass: String,
3734
+ width: {},
3735
+ visibleArrow: {
3736
+ default: true
3737
+ },
3738
+ arrowOffset: {
3739
+ type: Number,
3740
+ default: 0
3741
+ },
3742
+ transition: {
3743
+ type: String,
3744
+ default: 'fade-in-linear'
3745
+ },
3746
+ tabindex: {
3747
+ type: Number,
3748
+ default: 0
3749
+ }
3750
+ },
3751
+
3752
+ computed: {
3753
+ tooltipId: function tooltipId() {
3754
+ return 'el-popover-' + Object(util_["generateId"])();
3755
+ }
3756
+ },
3757
+ watch: {
3758
+ showPopper: function showPopper(val) {
3759
+ if (this.disabled) {
3760
+ return;
3761
+ }
3762
+ val ? this.$emit('show') : this.$emit('hide');
3763
+ }
3764
+ },
3765
+
3766
+ mounted: function mounted() {
3767
+ var _this = this;
3768
+
3769
+ var reference = this.referenceElm = this.reference || this.$refs.reference;
3770
+ var popper = this.popper || this.$refs.popper;
3771
+
3772
+ if (!reference && this.$refs.wrapper.children) {
3773
+ reference = this.referenceElm = this.$refs.wrapper.children[0];
3774
+ }
3775
+ // 可访问性
3776
+ if (reference) {
3777
+ Object(dom_["addClass"])(reference, 'el-popover__reference');
3778
+ reference.setAttribute('aria-describedby', this.tooltipId);
3779
+ reference.setAttribute('tabindex', this.tabindex); // tab序列
3780
+ popper.setAttribute('tabindex', 0);
3781
+
3782
+ if (this.trigger !== 'click') {
3783
+ Object(dom_["on"])(reference, 'focusin', function () {
3784
+ _this.handleFocus();
3785
+ var instance = reference.__vue__;
3786
+ if (instance && typeof instance.focus === 'function') {
3787
+ instance.focus();
3788
+ }
3789
+ });
3790
+ Object(dom_["on"])(popper, 'focusin', this.handleFocus);
3791
+ Object(dom_["on"])(reference, 'focusout', this.handleBlur);
3792
+ Object(dom_["on"])(popper, 'focusout', this.handleBlur);
3793
+ }
3794
+ Object(dom_["on"])(reference, 'keydown', this.handleKeydown);
3795
+ Object(dom_["on"])(reference, 'click', this.handleClick);
3796
+ }
3797
+ if (this.trigger === 'click') {
3798
+ Object(dom_["on"])(reference, 'click', this.doToggle);
3799
+ Object(dom_["on"])(document, 'click', this.handleDocumentClick);
3800
+ } else if (this.trigger === 'hover') {
3801
+ Object(dom_["on"])(reference, 'mouseenter', this.handleMouseEnter);
3802
+ Object(dom_["on"])(popper, 'mouseenter', this.handleMouseEnter);
3803
+ Object(dom_["on"])(reference, 'mouseleave', this.handleMouseLeave);
3804
+ Object(dom_["on"])(popper, 'mouseleave', this.handleMouseLeave);
3805
+ } else if (this.trigger === 'focus') {
3806
+ if (this.tabindex < 0) {
3807
+ console.warn('[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key');
3808
+ }
3809
+ if (reference.querySelector('input, textarea')) {
3810
+ Object(dom_["on"])(reference, 'focusin', this.doShow);
3811
+ Object(dom_["on"])(reference, 'focusout', this.doClose);
3812
+ } else {
3813
+ Object(dom_["on"])(reference, 'mousedown', this.doShow);
3814
+ Object(dom_["on"])(reference, 'mouseup', this.doClose);
3815
+ }
3816
+ }
3817
+ },
3818
+ beforeDestroy: function beforeDestroy() {
3819
+ this.cleanup();
3820
+ },
3821
+ deactivated: function deactivated() {
3822
+ this.cleanup();
3823
+ },
3824
+
3825
+
3826
+ methods: {
3827
+ doToggle: function doToggle() {
3828
+ this.showPopper = !this.showPopper;
3829
+ },
3830
+ doShow: function doShow() {
3831
+ this.showPopper = true;
3832
+ },
3833
+ doClose: function doClose() {
3834
+ this.showPopper = false;
3835
+ },
3836
+ handleFocus: function handleFocus() {
3837
+ Object(dom_["addClass"])(this.referenceElm, 'focusing');
3838
+ if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = true;
3839
+ },
3840
+ handleClick: function handleClick() {
3841
+ Object(dom_["removeClass"])(this.referenceElm, 'focusing');
3842
+ },
3843
+ handleBlur: function handleBlur() {
3844
+ Object(dom_["removeClass"])(this.referenceElm, 'focusing');
3845
+ if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = false;
3846
+ },
3847
+ handleMouseEnter: function handleMouseEnter() {
3848
+ var _this2 = this;
3849
+
3850
+ clearTimeout(this._timer);
3851
+ if (this.openDelay) {
3852
+ this._timer = setTimeout(function () {
3853
+ _this2.showPopper = true;
3854
+ }, this.openDelay);
3855
+ } else {
3856
+ this.showPopper = true;
3857
+ }
3858
+ },
3859
+ handleKeydown: function handleKeydown(ev) {
3860
+ if (ev.keyCode === 27 && this.trigger !== 'manual') {
3861
+ // esc
3862
+ this.doClose();
3863
+ }
3864
+ },
3865
+ handleMouseLeave: function handleMouseLeave() {
3866
+ var _this3 = this;
3867
+
3868
+ clearTimeout(this._timer);
3869
+ if (this.closeDelay) {
3870
+ this._timer = setTimeout(function () {
3871
+ _this3.showPopper = false;
3872
+ }, this.closeDelay);
3873
+ } else {
3874
+ this.showPopper = false;
3875
+ }
3876
+ },
3877
+ handleDocumentClick: function handleDocumentClick(e) {
3878
+ var reference = this.reference || this.$refs.reference;
3879
+ var popper = this.popper || this.$refs.popper;
3880
+
3881
+ if (!reference && this.$refs.wrapper.children) {
3882
+ reference = this.referenceElm = this.$refs.wrapper.children[0];
3883
+ }
3884
+ if (!this.$el || !reference || this.$el.contains(e.target) || reference.contains(e.target) || !popper || popper.contains(e.target)) return;
3885
+ this.showPopper = false;
3886
+ },
3887
+ handleAfterEnter: function handleAfterEnter() {
3888
+ this.$emit('after-enter');
3889
+ },
3890
+ handleAfterLeave: function handleAfterLeave() {
3891
+ this.$emit('after-leave');
3892
+ this.doDestroy();
3893
+ },
3894
+ cleanup: function cleanup() {
3895
+ if (this.openDelay || this.closeDelay) {
3896
+ clearTimeout(this._timer);
3897
+ }
3898
+ }
3899
+ },
3900
+
3901
+ destroyed: function destroyed() {
3902
+ var reference = this.reference;
3903
+
3904
+ Object(dom_["off"])(reference, 'click', this.doToggle);
3905
+ Object(dom_["off"])(reference, 'mouseup', this.doClose);
3906
+ Object(dom_["off"])(reference, 'mousedown', this.doShow);
3907
+ Object(dom_["off"])(reference, 'focusin', this.doShow);
3908
+ Object(dom_["off"])(reference, 'focusout', this.doClose);
3909
+ Object(dom_["off"])(reference, 'mousedown', this.doShow);
3910
+ Object(dom_["off"])(reference, 'mouseup', this.doClose);
3911
+ Object(dom_["off"])(reference, 'mouseleave', this.handleMouseLeave);
3912
+ Object(dom_["off"])(reference, 'mouseenter', this.handleMouseEnter);
3913
+ Object(dom_["off"])(document, 'click', this.handleDocumentClick);
3914
+ }
3915
+ });
3916
+ // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=script&lang=js
3917
+ /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
3918
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
3919
+ var componentNormalizer = __webpack_require__(0);
3920
+
3921
+ // CONCATENATED MODULE: ./packages/popover/src/main.vue
3922
+
3923
+
3924
+
3925
+
3926
+
3927
+ /* normalize component */
3928
+
3929
+ var component = Object(componentNormalizer["a" /* default */])(
3930
+ src_mainvue_type_script_lang_js,
3931
+ render,
3932
+ staticRenderFns,
3933
+ false,
3934
+ null,
3935
+ null,
3936
+ null
3937
+
3938
+ )
3939
+
3940
+ /* harmony default export */ var main = (component.exports);
3941
+ // CONCATENATED MODULE: ./packages/popover/src/directive.js
3942
+ var getReference = function getReference(el, binding, vnode) {
3943
+ var _ref = binding.expression ? binding.value : binding.arg;
3944
+ var popper = vnode.context.$refs[_ref];
3945
+ if (popper) {
3946
+ if (Array.isArray(popper)) {
3947
+ popper[0].$refs.reference = el;
3948
+ } else {
3949
+ popper.$refs.reference = el;
3950
+ }
3951
+ }
3952
+ };
3953
+
3954
+ /* harmony default export */ var directive = ({
3955
+ bind: function bind(el, binding, vnode) {
3956
+ getReference(el, binding, vnode);
3957
+ },
3958
+ inserted: function inserted(el, binding, vnode) {
3959
+ getReference(el, binding, vnode);
3960
+ }
3961
+ });
3962
+ // EXTERNAL MODULE: external "vue"
3963
+ var external_vue_ = __webpack_require__(6);
3964
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
3965
+
3966
+ // CONCATENATED MODULE: ./packages/popover/index.js
3967
+
3968
+
3969
+
3970
+
3971
+ external_vue_default.a.directive('popover', directive);
3972
+
3973
+ /* istanbul ignore next */
3974
+ main.install = function (Vue) {
3975
+ Vue.directive('popover', directive);
3976
+ Vue.component(main.name, main);
3977
+ };
3978
+ main.directive = directive;
3979
+
3980
+ /* harmony default export */ var popover = __webpack_exports__["default"] = (main);
3981
+
3982
+ /***/ }),
3983
+
3984
+ /***/ 46:
3985
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3986
+
3987
+ "use strict";
3988
+ // ESM COMPAT FLAG
3989
+ __webpack_require__.r(__webpack_exports__);
3990
+
3991
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox.vue?vue&type=template&id=08c28cac
3992
+ var render = function () {
3993
+ var _vm = this
3994
+ var _h = _vm.$createElement
3995
+ var _c = _vm._self._c || _h
3996
+ return _c(
3997
+ "label",
3998
+ {
3999
+ staticClass: "el-checkbox",
4000
+ class: [
4001
+ _vm.border && _vm.checkboxSize
4002
+ ? "el-checkbox--" + _vm.checkboxSize
4003
+ : "",
4004
+ { "is-disabled": _vm.isDisabled },
4005
+ { "is-bordered": _vm.border },
4006
+ { "is-checked": _vm.isChecked },
4007
+ ],
4008
+ attrs: { id: _vm.id },
4009
+ },
4010
+ [
4011
+ _c(
4012
+ "span",
4013
+ {
4014
+ staticClass: "el-checkbox__input",
4015
+ class: {
4016
+ "is-disabled": _vm.isDisabled,
4017
+ "is-checked": _vm.isChecked,
4018
+ "is-indeterminate": _vm.indeterminate,
4019
+ "is-focus": _vm.focus,
4020
+ },
4021
+ attrs: {
4022
+ tabindex: _vm.indeterminate ? 0 : false,
4023
+ role: _vm.indeterminate ? "checkbox" : false,
4024
+ "aria-checked": _vm.indeterminate ? "mixed" : false,
4025
+ },
4026
+ },
4027
+ [
4028
+ _c("span", { staticClass: "el-checkbox__inner" }),
4029
+ _vm.trueLabel || _vm.falseLabel
4030
+ ? _c("input", {
4031
+ directives: [
4032
+ {
4033
+ name: "model",
4034
+ rawName: "v-model",
4035
+ value: _vm.model,
4036
+ expression: "model",
4037
+ },
4038
+ ],
4039
+ staticClass: "el-checkbox__original",
4040
+ attrs: {
4041
+ type: "checkbox",
4042
+ "aria-hidden": _vm.indeterminate ? "true" : "false",
4043
+ name: _vm.name,
4044
+ disabled: _vm.isDisabled,
4045
+ "true-value": _vm.trueLabel,
4046
+ "false-value": _vm.falseLabel,
4047
+ },
4048
+ domProps: {
4049
+ checked: Array.isArray(_vm.model)
4050
+ ? _vm._i(_vm.model, null) > -1
4051
+ : _vm._q(_vm.model, _vm.trueLabel),
4052
+ },
4053
+ on: {
4054
+ change: [
4055
+ function ($event) {
4056
+ var $$a = _vm.model,
4057
+ $$el = $event.target,
4058
+ $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
4059
+ if (Array.isArray($$a)) {
4060
+ var $$v = null,
4061
+ $$i = _vm._i($$a, $$v)
4062
+ if ($$el.checked) {
4063
+ $$i < 0 && (_vm.model = $$a.concat([$$v]))
4064
+ } else {
4065
+ $$i > -1 &&
4066
+ (_vm.model = $$a
4067
+ .slice(0, $$i)
4068
+ .concat($$a.slice($$i + 1)))
4069
+ }
4070
+ } else {
4071
+ _vm.model = $$c
4072
+ }
4073
+ },
4074
+ _vm.handleChange,
4075
+ ],
4076
+ focus: function ($event) {
4077
+ _vm.focus = true
4078
+ },
4079
+ blur: function ($event) {
4080
+ _vm.focus = false
4081
+ },
4082
+ },
4083
+ })
4084
+ : _c("input", {
4085
+ directives: [
4086
+ {
4087
+ name: "model",
4088
+ rawName: "v-model",
4089
+ value: _vm.model,
4090
+ expression: "model",
4091
+ },
4092
+ ],
4093
+ staticClass: "el-checkbox__original",
4094
+ attrs: {
4095
+ type: "checkbox",
4096
+ "aria-hidden": _vm.indeterminate ? "true" : "false",
4097
+ disabled: _vm.isDisabled,
4098
+ name: _vm.name,
4099
+ },
4100
+ domProps: {
4101
+ value: _vm.label,
4102
+ checked: Array.isArray(_vm.model)
4103
+ ? _vm._i(_vm.model, _vm.label) > -1
4104
+ : _vm.model,
4105
+ },
4106
+ on: {
4107
+ change: [
4108
+ function ($event) {
4109
+ var $$a = _vm.model,
4110
+ $$el = $event.target,
4111
+ $$c = $$el.checked ? true : false
4112
+ if (Array.isArray($$a)) {
4113
+ var $$v = _vm.label,
4114
+ $$i = _vm._i($$a, $$v)
4115
+ if ($$el.checked) {
4116
+ $$i < 0 && (_vm.model = $$a.concat([$$v]))
4117
+ } else {
4118
+ $$i > -1 &&
4119
+ (_vm.model = $$a
4120
+ .slice(0, $$i)
4121
+ .concat($$a.slice($$i + 1)))
4122
+ }
4123
+ } else {
4124
+ _vm.model = $$c
4125
+ }
4126
+ },
4127
+ _vm.handleChange,
4128
+ ],
4129
+ focus: function ($event) {
4130
+ _vm.focus = true
4131
+ },
4132
+ blur: function ($event) {
4133
+ _vm.focus = false
4134
+ },
4135
+ },
4136
+ }),
4137
+ ]
4138
+ ),
4139
+ _vm.$slots.default || _vm.label
4140
+ ? _c(
4141
+ "span",
4142
+ { staticClass: "el-checkbox__label" },
4143
+ [
4144
+ _vm._t("default"),
4145
+ !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e(),
4146
+ ],
4147
+ 2
4148
+ )
4149
+ : _vm._e(),
4150
+ ]
4151
+ )
4152
+ }
4153
+ var staticRenderFns = []
4154
+ render._withStripped = true
4155
+
4156
+
4157
+ // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=template&id=08c28cac
4158
+
4159
+ // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
4160
+ var emitter_ = __webpack_require__(4);
4161
+ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
4162
+
4163
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js
4164
+ //
4165
+ //
4166
+ //
4167
+ //
4168
+ //
4169
+ //
4170
+ //
4171
+ //
4172
+ //
4173
+ //
4174
+ //
4175
+ //
4176
+ //
4177
+ //
4178
+ //
4179
+ //
4180
+ //
4181
+ //
4182
+ //
4183
+ //
4184
+ //
4185
+ //
4186
+ //
4187
+ //
4188
+ //
4189
+ //
4190
+ //
4191
+ //
4192
+ //
4193
+ //
4194
+ //
4195
+ //
4196
+ //
4197
+ //
4198
+ //
4199
+ //
4200
+ //
4201
+ //
4202
+ //
4203
+ //
4204
+ //
4205
+ //
4206
+ //
4207
+ //
4208
+ //
4209
+ //
4210
+ //
4211
+ //
4212
+ //
4213
+ //
4214
+ //
4215
+ //
4216
+ //
4217
+ //
4218
+ //
4219
+
4220
+
4221
+
4222
+ /* harmony default export */ var checkboxvue_type_script_lang_js = ({
4223
+ name: 'ElCheckbox',
4224
+
4225
+ mixins: [emitter_default.a],
4226
+
4227
+ inject: {
4228
+ elForm: {
4229
+ default: ''
4230
+ },
4231
+ elFormItem: {
4232
+ default: ''
4233
+ }
4234
+ },
4235
+
4236
+ componentName: 'ElCheckbox',
4237
+
4238
+ data: function data() {
4239
+ return {
4240
+ selfModel: false,
4241
+ focus: false,
4242
+ isLimitExceeded: false
4243
+ };
4244
+ },
4245
+
4246
+
4247
+ computed: {
4248
+ model: {
4249
+ get: function get() {
4250
+ return this.isGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
4251
+ },
4252
+ set: function set(val) {
4253
+ if (this.isGroup) {
4254
+ this.isLimitExceeded = false;
4255
+ this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
4256
+
4257
+ this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
4258
+
4259
+ this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
4260
+ } else {
4261
+ this.$emit('input', val);
4262
+ this.selfModel = val;
4263
+ }
4264
+ }
4265
+ },
4266
+
4267
+ isChecked: function isChecked() {
4268
+ if ({}.toString.call(this.model) === '[object Boolean]') {
4269
+ return this.model;
4270
+ } else if (Array.isArray(this.model)) {
4271
+ return this.model.indexOf(this.label) > -1;
4272
+ } else if (this.model !== null && this.model !== undefined) {
4273
+ return this.model === this.trueLabel;
4274
+ }
4275
+ },
4276
+ isGroup: function isGroup() {
4277
+ var parent = this.$parent;
4278
+ while (parent) {
4279
+ if (parent.$options.componentName !== 'ElCheckboxGroup') {
4280
+ parent = parent.$parent;
4281
+ } else {
4282
+ this._checkboxGroup = parent;
4283
+ return true;
4284
+ }
4285
+ }
4286
+ return false;
4287
+ },
4288
+ store: function store() {
4289
+ return this._checkboxGroup ? this._checkboxGroup.value : this.value;
4290
+ },
4291
+
4292
+
4293
+ /* used to make the isDisabled judgment under max/min props */
4294
+ isLimitDisabled: function isLimitDisabled() {
4295
+ var _checkboxGroup = this._checkboxGroup,
4296
+ max = _checkboxGroup.max,
4297
+ min = _checkboxGroup.min;
4298
+
4299
+ return !!(max || min) && this.model.length >= max && !this.isChecked || this.model.length <= min && this.isChecked;
4300
+ },
4301
+ isDisabled: function isDisabled() {
4302
+ return this.isGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled || this.isLimitDisabled : this.disabled || (this.elForm || {}).disabled;
4303
+ },
4304
+ _elFormItemSize: function _elFormItemSize() {
4305
+ return (this.elFormItem || {}).elFormItemSize;
4306
+ },
4307
+ checkboxSize: function checkboxSize() {
4308
+ var temCheckboxSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
4309
+ return this.isGroup ? this._checkboxGroup.checkboxGroupSize || temCheckboxSize : temCheckboxSize;
4310
+ }
4311
+ },
4312
+
4313
+ props: {
4314
+ value: {},
4315
+ label: {},
4316
+ indeterminate: Boolean,
4317
+ disabled: Boolean,
4318
+ checked: Boolean,
4319
+ name: String,
4320
+ trueLabel: [String, Number],
4321
+ falseLabel: [String, Number],
4322
+ id: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
4323
+ controls: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
4324
+ border: Boolean,
4325
+ size: String
4326
+ },
4327
+
4328
+ methods: {
4329
+ addToStore: function addToStore() {
4330
+ if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
4331
+ this.model.push(this.label);
4332
+ } else {
4333
+ this.model = this.trueLabel || true;
4334
+ }
4335
+ },
4336
+ handleChange: function handleChange(ev) {
4337
+ var _this = this;
4338
+
4339
+ if (this.isLimitExceeded) return;
4340
+ var value = void 0;
4341
+ if (ev.target.checked) {
4342
+ value = this.trueLabel === undefined ? true : this.trueLabel;
4343
+ } else {
4344
+ value = this.falseLabel === undefined ? false : this.falseLabel;
4345
+ }
4346
+ this.$emit('change', value, ev);
4347
+ this.$nextTick(function () {
4348
+ if (_this.isGroup) {
4349
+ _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
4350
+ }
4351
+ });
4352
+ }
4353
+ },
4354
+
4355
+ created: function created() {
4356
+ this.checked && this.addToStore();
4357
+ },
4358
+ mounted: function mounted() {
4359
+ // 为indeterminate元素 添加aria-controls 属性
4360
+ if (this.indeterminate) {
4361
+ this.$el.setAttribute('aria-controls', this.controls);
4362
+ }
4363
+ },
4364
+
4365
+
4366
+ watch: {
4367
+ value: function value(_value) {
4368
+ this.dispatch('ElFormItem', 'el.form.change', _value);
4369
+ }
4370
+ }
4371
+ });
4372
+ // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js
4373
+ /* harmony default export */ var src_checkboxvue_type_script_lang_js = (checkboxvue_type_script_lang_js);
4374
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
4375
+ var componentNormalizer = __webpack_require__(0);
4376
+
4377
+ // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue
4378
+
4379
+
4380
+
4381
+
4382
+
4383
+ /* normalize component */
4384
+
4385
+ var component = Object(componentNormalizer["a" /* default */])(
4386
+ src_checkboxvue_type_script_lang_js,
4387
+ render,
4388
+ staticRenderFns,
4389
+ false,
4390
+ null,
4391
+ null,
4392
+ null
4393
+
4394
+ )
4395
+
4396
+ /* harmony default export */ var src_checkbox = (component.exports);
4397
+ // CONCATENATED MODULE: ./packages/checkbox/index.js
4398
+
4399
+
4400
+ /* istanbul ignore next */
4401
+ src_checkbox.install = function (Vue) {
4402
+ Vue.component(src_checkbox.name, src_checkbox);
4403
+ };
4404
+
4405
+ /* harmony default export */ var packages_checkbox = __webpack_exports__["default"] = (src_checkbox);
4406
+
4407
+ /***/ }),
4408
+
4409
+ /***/ 5:
4410
+ /***/ (function(module, exports) {
4411
+
4412
+ module.exports = require("element-ui/lib/utils/vue-popper");
4413
+
4414
+ /***/ }),
4415
+
4416
+ /***/ 6:
4417
+ /***/ (function(module, exports) {
4418
+
4419
+ module.exports = require("vue");
4420
+
4421
+ /***/ }),
4422
+
4423
+ /***/ 9:
4424
+ /***/ (function(module, exports) {
4425
+
4426
+ module.exports = require("element-ui/lib/utils/merge");
4427
+
4428
+ /***/ })
4429
+
4430
+ /******/ });