@mdsfe/mds-ui 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/CHANGELOG.md +778 -0
  2. package/LICENSE +21 -0
  3. package/README.md +106 -0
  4. package/dist/_locale/index.js +18 -0
  5. package/dist/_locale/zh-CN.js +123 -0
  6. package/dist/_mixin/emitter.js +35 -0
  7. package/dist/_mixin/focus.js +13 -0
  8. package/dist/_mixin/locale.js +17 -0
  9. package/dist/_mixin/popper.js +192 -0
  10. package/dist/_mixin/tooltip.js +218 -0
  11. package/dist/_util/__test__/switchcase.test.js +43 -0
  12. package/dist/_util/autoprefixer.js +249 -0
  13. package/dist/_util/clickoutside.js +79 -0
  14. package/dist/_util/date.js +368 -0
  15. package/dist/_util/dateUtil.js +311 -0
  16. package/dist/_util/dom.js +240 -0
  17. package/dist/_util/getRequestAnimationFrame.js +50 -0
  18. package/dist/_util/getScroll.js +21 -0
  19. package/dist/_util/loaders/loaders.css.js +52 -0
  20. package/dist/_util/loaders/loading.js +53 -0
  21. package/dist/_util/merge.js +18 -0
  22. package/dist/_util/popper.js +1261 -0
  23. package/dist/_util/popup/index.js +232 -0
  24. package/dist/_util/popup/popup-manager.js +205 -0
  25. package/dist/_util/proptype.js +12 -0
  26. package/dist/_util/repeatClick.js +30 -0
  27. package/dist/_util/resize.js +61 -0
  28. package/dist/_util/resizeEvent.js +59 -0
  29. package/dist/_util/scrollIntoView.js +38 -0
  30. package/dist/_util/scrollbar-width.js +37 -0
  31. package/dist/_util/soda.js +54 -0
  32. package/dist/_util/switchcase.js +22 -0
  33. package/dist/_util/throttleByAnimationFrame.js +70 -0
  34. package/dist/_util/tree/node.js +412 -0
  35. package/dist/_util/tree/tree.js +410 -0
  36. package/dist/_util/util.js +166 -0
  37. package/dist/_util/vue-popper.js +213 -0
  38. package/dist/affix.js +509 -0
  39. package/dist/anchor.js +522 -0
  40. package/dist/avatar.js +437 -0
  41. package/dist/backtop.js +469 -0
  42. package/dist/badge.js +439 -0
  43. package/dist/bordershadow.js +310 -0
  44. package/dist/breadcrumb.js +434 -0
  45. package/dist/button.js +579 -0
  46. package/dist/card.js +514 -0
  47. package/dist/carousel.js +1326 -0
  48. package/dist/cascaderpanel.js +2320 -0
  49. package/dist/checkbox.js +681 -0
  50. package/dist/col.js +546 -0
  51. package/dist/collapse.js +671 -0
  52. package/dist/color.js +306 -0
  53. package/dist/datepicker.js +8089 -0
  54. package/dist/divider.js +346 -0
  55. package/dist/drawer.js +652 -0
  56. package/dist/dropdown.js +687 -0
  57. package/dist/empty.js +416 -0
  58. package/dist/font.js +306 -0
  59. package/dist/form.js +878 -0
  60. package/dist/icon.js +401 -0
  61. package/dist/index.js +1 -0
  62. package/dist/input.js +1251 -0
  63. package/dist/inputnumber.js +689 -0
  64. package/dist/layout.js +786 -0
  65. package/dist/list.js +789 -0
  66. package/dist/loading.js +430 -0
  67. package/dist/mds-ui.min.css +7 -0
  68. package/dist/mds-ui.min.js +64911 -0
  69. package/dist/menu.js +1131 -0
  70. package/dist/message.js +1016 -0
  71. package/dist/modal.js +895 -0
  72. package/dist/notification.js +818 -0
  73. package/dist/pagination.js +1213 -0
  74. package/dist/popconfirm.js +336 -0
  75. package/dist/popover.js +206 -0
  76. package/dist/progress.js +1023 -0
  77. package/dist/radio.js +760 -0
  78. package/dist/rate.js +765 -0
  79. package/dist/row.js +546 -0
  80. package/dist/select.js +4950 -0
  81. package/dist/slider.js +1411 -0
  82. package/dist/slottable.js +1414 -0
  83. package/dist/steps.js +546 -0
  84. package/dist/style/affix.css +5524 -0
  85. package/dist/style/anchor.css +5572 -0
  86. package/dist/style/avatar.css +5587 -0
  87. package/dist/style/backtop.css +34 -0
  88. package/dist/style/badge.css +5655 -0
  89. package/dist/style/bordershadow.css +5601 -0
  90. package/dist/style/breadcrumb.css +5551 -0
  91. package/dist/style/button.css +7679 -0
  92. package/dist/style/card.css +5670 -0
  93. package/dist/style/carousel.css +5731 -0
  94. package/dist/style/cascaderpanel.css +125 -0
  95. package/dist/style/checkbox.css +5700 -0
  96. package/dist/style/col.css +8121 -0
  97. package/dist/style/collapse.css +5593 -0
  98. package/dist/style/color.css +6136 -0
  99. package/dist/style/datepicker.css +5977 -0
  100. package/dist/style/divider.css +5558 -0
  101. package/dist/style/drawer.css +7979 -0
  102. package/dist/style/dropdown.css +7950 -0
  103. package/dist/style/empty.css +5563 -0
  104. package/dist/style/font.css +5559 -0
  105. package/dist/style/form.css +5662 -0
  106. package/dist/style/icon.css +5538 -0
  107. package/dist/style/input.css +6256 -0
  108. package/dist/style/inputnumber.css +5828 -0
  109. package/dist/style/layout.css +5572 -0
  110. package/dist/style/list.css +5655 -0
  111. package/dist/style/loading.css +5540 -0
  112. package/dist/style/menu.css +6183 -0
  113. package/dist/style/message.css +194 -0
  114. package/dist/style/modal.css +5637 -0
  115. package/dist/style/notification.css +5706 -0
  116. package/dist/style/pagination.css +6683 -0
  117. package/dist/style/popconfirm.css +7951 -0
  118. package/dist/style/popover.css +5727 -0
  119. package/dist/style/progress.css +5714 -0
  120. package/dist/style/radio.css +5769 -0
  121. package/dist/style/rate.css +5616 -0
  122. package/dist/style/row.css +8121 -0
  123. package/dist/style/select.css +5729 -0
  124. package/dist/style/slider.css +5594 -0
  125. package/dist/style/slottable.css +5831 -0
  126. package/dist/style/steps.css +6100 -0
  127. package/dist/style/switch.css +5624 -0
  128. package/dist/style/table.css +8392 -0
  129. package/dist/style/tabs.css +6047 -0
  130. package/dist/style/tag.css +5935 -0
  131. package/dist/style/text.css +5636 -0
  132. package/dist/style/timeline.css +5602 -0
  133. package/dist/style/timepicker.css +5904 -0
  134. package/dist/style/tooltip.css +5686 -0
  135. package/dist/style/transfer.css +101 -0
  136. package/dist/style/transition.css +1417 -0
  137. package/dist/style/tree.css +5598 -0
  138. package/dist/style/typography.css +5640 -0
  139. package/dist/style/upload.css +5834 -0
  140. package/dist/switch.js +448 -0
  141. package/dist/table.js +3809 -0
  142. package/dist/tabs.js +1273 -0
  143. package/dist/tag.js +478 -0
  144. package/dist/text.js +1100 -0
  145. package/dist/timeline.js +495 -0
  146. package/dist/timepicker.js +1567 -0
  147. package/dist/tooltip.js +179 -0
  148. package/dist/transfer.js +981 -0
  149. package/dist/transition.js +246 -0
  150. package/dist/tree.js +1866 -0
  151. package/dist/typography.js +469 -0
  152. package/dist/upload.js +1990 -0
  153. package/package.json +144 -0
@@ -0,0 +1,2320 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("./icon"), require("vue"), require("./checkbox"), require("./_util/merge"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["./icon", "vue", "./checkbox", "./_util/merge"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("./icon"), require("vue"), require("./checkbox"), require("./_util/merge")) : factory(root["./icon"], root["Vue"], root["./checkbox"], root["./_util/merge"]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(window, function(__WEBPACK_EXTERNAL_MODULE__4__, __WEBPACK_EXTERNAL_MODULE__5__, __WEBPACK_EXTERNAL_MODULE__28__, __WEBPACK_EXTERNAL_MODULE__43__) {
11
+ return /******/ (function(modules) { // webpackBootstrap
12
+ /******/ // The module cache
13
+ /******/ var installedModules = {};
14
+ /******/
15
+ /******/ // The require function
16
+ /******/ function __webpack_require__(moduleId) {
17
+ /******/
18
+ /******/ // Check if module is in cache
19
+ /******/ if(installedModules[moduleId]) {
20
+ /******/ return installedModules[moduleId].exports;
21
+ /******/ }
22
+ /******/ // Create a new module (and put it into the cache)
23
+ /******/ var module = installedModules[moduleId] = {
24
+ /******/ i: moduleId,
25
+ /******/ l: false,
26
+ /******/ exports: {}
27
+ /******/ };
28
+ /******/
29
+ /******/ // Execute the module function
30
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
+ /******/
32
+ /******/ // Flag the module as loaded
33
+ /******/ module.l = true;
34
+ /******/
35
+ /******/ // Return the exports of the module
36
+ /******/ return module.exports;
37
+ /******/ }
38
+ /******/
39
+ /******/
40
+ /******/ // expose the modules object (__webpack_modules__)
41
+ /******/ __webpack_require__.m = modules;
42
+ /******/
43
+ /******/ // expose the module cache
44
+ /******/ __webpack_require__.c = installedModules;
45
+ /******/
46
+ /******/ // define getter function for harmony exports
47
+ /******/ __webpack_require__.d = function(exports, name, getter) {
48
+ /******/ if(!__webpack_require__.o(exports, name)) {
49
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
+ /******/ }
51
+ /******/ };
52
+ /******/
53
+ /******/ // define __esModule on exports
54
+ /******/ __webpack_require__.r = function(exports) {
55
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
+ /******/ }
58
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
+ /******/ };
60
+ /******/
61
+ /******/ // create a fake namespace object
62
+ /******/ // mode & 1: value is a module id, require it
63
+ /******/ // mode & 2: merge all properties of value into the ns
64
+ /******/ // mode & 4: return value when already ns object
65
+ /******/ // mode & 8|1: behave like require
66
+ /******/ __webpack_require__.t = function(value, mode) {
67
+ /******/ if(mode & 1) value = __webpack_require__(value);
68
+ /******/ if(mode & 8) return value;
69
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
+ /******/ var ns = Object.create(null);
71
+ /******/ __webpack_require__.r(ns);
72
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
+ /******/ return ns;
75
+ /******/ };
76
+ /******/
77
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
78
+ /******/ __webpack_require__.n = function(module) {
79
+ /******/ var getter = module && module.__esModule ?
80
+ /******/ function getDefault() { return module['default']; } :
81
+ /******/ function getModuleExports() { return module; };
82
+ /******/ __webpack_require__.d(getter, 'a', getter);
83
+ /******/ return getter;
84
+ /******/ };
85
+ /******/
86
+ /******/ // Object.prototype.hasOwnProperty.call
87
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
+ /******/
89
+ /******/ // __webpack_public_path__
90
+ /******/ __webpack_require__.p = "/dist/";
91
+ /******/
92
+ /******/
93
+ /******/ // Load entry module and return exports
94
+ /******/ return __webpack_require__(__webpack_require__.s = 94);
95
+ /******/ })
96
+ /************************************************************************/
97
+ /******/ ({
98
+
99
+ /***/ 0:
100
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
101
+
102
+ "use strict";
103
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
104
+ /* globals __VUE_SSR_CONTEXT__ */
105
+
106
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
107
+ // This module is a runtime utility for cleaner component module output and will
108
+ // be included in the final webpack user bundle.
109
+
110
+ function normalizeComponent (
111
+ scriptExports,
112
+ render,
113
+ staticRenderFns,
114
+ functionalTemplate,
115
+ injectStyles,
116
+ scopeId,
117
+ moduleIdentifier, /* server only */
118
+ shadowMode /* vue-cli only */
119
+ ) {
120
+ // Vue.extend constructor export interop
121
+ var options = typeof scriptExports === 'function'
122
+ ? scriptExports.options
123
+ : scriptExports
124
+
125
+ // render functions
126
+ if (render) {
127
+ options.render = render
128
+ options.staticRenderFns = staticRenderFns
129
+ options._compiled = true
130
+ }
131
+
132
+ // functional template
133
+ if (functionalTemplate) {
134
+ options.functional = true
135
+ }
136
+
137
+ // scopedId
138
+ if (scopeId) {
139
+ options._scopeId = 'data-v-' + scopeId
140
+ }
141
+
142
+ var hook
143
+ if (moduleIdentifier) { // server build
144
+ hook = function (context) {
145
+ // 2.3 injection
146
+ context =
147
+ context || // cached call
148
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
149
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
150
+ // 2.2 with runInNewContext: true
151
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
152
+ context = __VUE_SSR_CONTEXT__
153
+ }
154
+ // inject component styles
155
+ if (injectStyles) {
156
+ injectStyles.call(this, context)
157
+ }
158
+ // register component module identifier for async chunk inferrence
159
+ if (context && context._registeredComponents) {
160
+ context._registeredComponents.add(moduleIdentifier)
161
+ }
162
+ }
163
+ // used by ssr in case component is cached and beforeCreate
164
+ // never gets called
165
+ options._ssrRegister = hook
166
+ } else if (injectStyles) {
167
+ hook = shadowMode
168
+ ? function () {
169
+ injectStyles.call(
170
+ this,
171
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
172
+ )
173
+ }
174
+ : injectStyles
175
+ }
176
+
177
+ if (hook) {
178
+ if (options.functional) {
179
+ // for template-only hot-reload because in that case the render fn doesn't
180
+ // go through the normalizer
181
+ options._injectStyles = hook
182
+ // register for functional component in vue file
183
+ var originalRender = options.render
184
+ options.render = function renderWithStyleInjection (h, context) {
185
+ hook.call(context)
186
+ return originalRender(h, context)
187
+ }
188
+ } else {
189
+ // inject component registration as beforeCreate hook
190
+ var existing = options.beforeCreate
191
+ options.beforeCreate = existing
192
+ ? [].concat(existing, hook)
193
+ : [hook]
194
+ }
195
+ }
196
+
197
+ return {
198
+ exports: scriptExports,
199
+ options: options
200
+ }
201
+ }
202
+
203
+
204
+ /***/ }),
205
+
206
+ /***/ 1:
207
+ /***/ (function(module, exports) {
208
+
209
+ module.exports = require("babel-runtime/helpers/defineProperty");
210
+
211
+ /***/ }),
212
+
213
+ /***/ 11:
214
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
215
+
216
+ "use strict";
217
+ /* unused harmony export noop */
218
+ /* unused harmony export getOffsetLeft */
219
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getValueByPath; });
220
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return valueEquals; });
221
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return arrayFindIndex; });
222
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayFind; });
223
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return coerceTruthyValueToArray; });
224
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return isIE; });
225
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isEdge; });
226
+ /* unused harmony export isFirefox */
227
+ /* unused harmony export assert */
228
+ /* unused harmony export escapeRegexpString */
229
+ /* unused harmony export getOffsetWidth */
230
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isFunction; });
231
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
232
+ /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
233
+
234
+ var noop = function noop() {};
235
+
236
+ var getScroll = function getScroll(w, top) {
237
+ var ret = top ? w.pageYOffset : w.pageXOffset;
238
+ var method = top ? 'scrollTop' : 'scrollLeft';
239
+ if (typeof ret !== 'number') {
240
+ var d = w.document;
241
+ // ie6,7,8 standard mode
242
+ ret = d.documentElement[method];
243
+ if (typeof ret !== 'number') {
244
+ // quirks mode
245
+ ret = d.body[method];
246
+ }
247
+ }
248
+ return ret;
249
+ };
250
+
251
+ var getClientPosition = function getClientPosition(elem) {
252
+ var box = void 0;
253
+ var x = void 0;
254
+ var y = void 0;
255
+ var doc = elem.ownerDocument;
256
+ var body = doc.body;
257
+ var docElem = doc && doc.documentElement;
258
+ box = elem.getBoundingClientRect();
259
+ x = box.left;
260
+ y = box.top;
261
+ x -= docElem.clientLeft || body.clientLeft || 0;
262
+ y -= docElem.clientTop || body.clientTop || 0;
263
+ return {
264
+ left: x,
265
+ top: y
266
+ };
267
+ };
268
+
269
+ var getOffsetLeft = function getOffsetLeft(el) {
270
+ var pos = getClientPosition(el);
271
+ var doc = el.ownerDocument;
272
+ var w = doc.defaultView || doc.parentWindow;
273
+ pos.left += getScroll(w);
274
+ return pos.left;
275
+ };
276
+ /**
277
+ * 获取对象深层级的对象,避免循环
278
+ * @export
279
+ * @param {*} sourceObj 源对象 {a:{b:{d:1}}}
280
+ * @param {*} pathName path组成的数组 例如:'a.b.c'
281
+ * @param {*} defaultValue 如果没有值默认的值 []
282
+ */
283
+ function getValueByPath(sourceObj, pathName, defaultValue) {
284
+ var getValue = function getValue(sourceObj, pathNameArray) {
285
+ var key = pathNameArray.shift();
286
+ var value = sourceObj[key];
287
+ if (value === undefined || value === null) {
288
+ return defaultValue;
289
+ } else if (pathNameArray.length === 0) {
290
+ return value;
291
+ } else if (pathNameArray.length > 0) {
292
+ return getValue(value, pathNameArray);
293
+ }
294
+ };
295
+ var pathNameArray = pathName.split('.');
296
+ return getValue(sourceObj, pathNameArray);
297
+ }
298
+ /**
299
+ *
300
+ * 判断两个数是否相等
301
+ * @param {*} a
302
+ * @param {*} b
303
+ * @returns
304
+ */
305
+ var valueEquals = function valueEquals(a, b) {
306
+ // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
307
+ if (a === b) return true;
308
+ if (!(a instanceof Array)) return false;
309
+ if (!(b instanceof Array)) return false;
310
+ if (a.length !== b.length) return false;
311
+ for (var i = 0; i !== a.length; ++i) {
312
+ if (a[i] !== b[i]) return false;
313
+ }
314
+ return true;
315
+ };
316
+ // TODO: use native Array.find, Array.findIndex when IE support is dropped
317
+ var arrayFindIndex = function arrayFindIndex(arr, pred) {
318
+ for (var i = 0; i !== arr.length; ++i) {
319
+ if (pred(arr[i])) {
320
+ return i;
321
+ }
322
+ }
323
+ return -1;
324
+ };
325
+
326
+ var arrayFind = function arrayFind(arr, pred) {
327
+ var idx = arrayFindIndex(arr, pred);
328
+ return idx !== -1 ? arr[idx] : undefined;
329
+ };
330
+
331
+ // coerce truthy value to array
332
+ var coerceTruthyValueToArray = function coerceTruthyValueToArray(val) {
333
+ if (Array.isArray(val)) {
334
+ return val;
335
+ } else if (val) {
336
+ return [val];
337
+ } else {
338
+ return [];
339
+ }
340
+ };
341
+
342
+ var isIE = function isIE() {
343
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
344
+ };
345
+
346
+ var isEdge = function isEdge() {
347
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
348
+ };
349
+
350
+ var isFirefox = function isFirefox() {
351
+ return !vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
352
+ };
353
+
354
+ var assert = function assert(condition, msg) {
355
+ if (!condition) throw new Error('[mds-ui] ' + msg);
356
+ };
357
+ /**
358
+ *
359
+ * 特殊字符转译
360
+ * @param {string} [value='']
361
+ */
362
+ var escapeRegexpString = function escapeRegexpString() {
363
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
364
+ return String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
365
+ };
366
+ /**
367
+ * Get element offset width
368
+ * @param {*} node HTMLDOMElemment
369
+ * @return {Number} width
370
+ */
371
+ /**
372
+ * Get element offset width
373
+ * @param {*} node HTMLDOMElemment
374
+ * @return {Number} width
375
+ */
376
+ var getOffsetWidth = function getOffsetWidth(node) {
377
+ return node ? node.offsetWidth : 0;
378
+ };
379
+
380
+ /** 判断是否为函数
381
+ * @param {*} functionToCheck
382
+ * @returns
383
+ */
384
+ var isFunction = function isFunction(functionToCheck) {
385
+ var getType = {};
386
+ return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
387
+ };
388
+
389
+ /***/ }),
390
+
391
+ /***/ 19:
392
+ /***/ (function(module, exports) {
393
+
394
+ module.exports = require("babel-runtime/helpers/extends");
395
+
396
+ /***/ }),
397
+
398
+ /***/ 20:
399
+ /***/ (function(module, exports) {
400
+
401
+ module.exports = require("babel-runtime/core-js/get-iterator");
402
+
403
+ /***/ }),
404
+
405
+ /***/ 24:
406
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
407
+
408
+ "use strict";
409
+
410
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/scroll-bar/scroll-bar.vue?vue&type=template&id=2fbcec38&
411
+ var render = function () {
412
+ var _vm = this
413
+ var _h = _vm.$createElement
414
+ var _c = _vm._self._c || _h
415
+ return _c(
416
+ "ul",
417
+ { ref: "wrap", class: _vm.classes, attrs: { role: "mds-scroll-bar" } },
418
+ [_vm._t("default")],
419
+ 2
420
+ )
421
+ }
422
+ var staticRenderFns = []
423
+ render._withStripped = true
424
+
425
+
426
+ // CONCATENATED MODULE: ./components/scroll-bar/scroll-bar.vue?vue&type=template&id=2fbcec38&
427
+
428
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/scroll-bar/scroll-bar.vue?vue&type=script&lang=js&
429
+ //
430
+ //
431
+ //
432
+ //
433
+ //
434
+ //
435
+ //
436
+ //
437
+ //
438
+
439
+ /* harmony default export */ var scroll_barvue_type_script_lang_js_ = ({
440
+ name: 'mdsScrollBar',
441
+ props: {
442
+ prefixCls: {
443
+ type: String,
444
+ default: 'mds-scroll-bar'
445
+ }
446
+ },
447
+ data: function data() {
448
+ return {};
449
+ },
450
+
451
+ computed: {
452
+ classes: function classes() {
453
+ var prefixCls = this.prefixCls;
454
+ return ['' + prefixCls, prefixCls + '-root'];
455
+ },
456
+ wrap: function wrap() {
457
+ return this.$refs.wrap;
458
+ }
459
+ },
460
+ methods: {},
461
+ created: function created() {}
462
+ });
463
+ // CONCATENATED MODULE: ./components/scroll-bar/scroll-bar.vue?vue&type=script&lang=js&
464
+ /* harmony default export */ var scroll_bar_scroll_barvue_type_script_lang_js_ = (scroll_barvue_type_script_lang_js_);
465
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
466
+ var componentNormalizer = __webpack_require__(0);
467
+
468
+ // CONCATENATED MODULE: ./components/scroll-bar/scroll-bar.vue
469
+
470
+
471
+
472
+
473
+
474
+ /* normalize component */
475
+
476
+ var component = Object(componentNormalizer["a" /* default */])(
477
+ scroll_bar_scroll_barvue_type_script_lang_js_,
478
+ render,
479
+ staticRenderFns,
480
+ false,
481
+ null,
482
+ null,
483
+ null
484
+
485
+ )
486
+
487
+ /* hot reload */
488
+ if (false) { var api; }
489
+ component.options.__file = "components/scroll-bar/scroll-bar.vue"
490
+ /* harmony default export */ var scroll_bar = (component.exports);
491
+ // CONCATENATED MODULE: ./components/scroll-bar/index.js
492
+
493
+
494
+ /* harmony default export */ var components_scroll_bar = __webpack_exports__["a"] = (scroll_bar);
495
+
496
+ /***/ }),
497
+
498
+ /***/ 255:
499
+ /***/ (function(module, exports) {
500
+
501
+ // removed by extract-text-webpack-plugin
502
+
503
+ /***/ }),
504
+
505
+ /***/ 257:
506
+ /***/ (function(module, exports) {
507
+
508
+ // removed by extract-text-webpack-plugin
509
+
510
+ /***/ }),
511
+
512
+ /***/ 26:
513
+ /***/ (function(module, exports) {
514
+
515
+ module.exports = require("babel-runtime/helpers/classCallCheck");
516
+
517
+ /***/ }),
518
+
519
+ /***/ 27:
520
+ /***/ (function(module, exports) {
521
+
522
+ module.exports = require("babel-runtime/helpers/createClass");
523
+
524
+ /***/ }),
525
+
526
+ /***/ 28:
527
+ /***/ (function(module, exports) {
528
+
529
+ module.exports = __WEBPACK_EXTERNAL_MODULE__28__;
530
+
531
+ /***/ }),
532
+
533
+ /***/ 4:
534
+ /***/ (function(module, exports) {
535
+
536
+ module.exports = __WEBPACK_EXTERNAL_MODULE__4__;
537
+
538
+ /***/ }),
539
+
540
+ /***/ 40:
541
+ /***/ (function(module, exports) {
542
+
543
+ module.exports = require("babel-runtime/core-js/map");
544
+
545
+ /***/ }),
546
+
547
+ /***/ 43:
548
+ /***/ (function(module, exports) {
549
+
550
+ module.exports = __WEBPACK_EXTERNAL_MODULE__43__;
551
+
552
+ /***/ }),
553
+
554
+ /***/ 5:
555
+ /***/ (function(module, exports) {
556
+
557
+ module.exports = __WEBPACK_EXTERNAL_MODULE__5__;
558
+
559
+ /***/ }),
560
+
561
+ /***/ 8:
562
+ /***/ (function(module, exports) {
563
+
564
+ module.exports = require("babel-runtime/helpers/typeof");
565
+
566
+ /***/ }),
567
+
568
+ /***/ 94:
569
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
570
+
571
+ "use strict";
572
+ // ESM COMPAT FLAG
573
+ __webpack_require__.r(__webpack_exports__);
574
+
575
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/cascaderpanel/panel.vue?vue&type=template&id=1352ea60&
576
+ var render = function () {
577
+ var _vm = this
578
+ var _h = _vm.$createElement
579
+ var _c = _vm._self._c || _h
580
+ return _c(
581
+ "div",
582
+ {
583
+ ref: "panel",
584
+ class: ["mds-cascader-panel", _vm.size, _vm.border && "is-bordered"],
585
+ style: {
586
+ "max-height": _vm.maxHeight,
587
+ },
588
+ },
589
+ _vm._l(_vm.expandedPanels, function (panel, index) {
590
+ return _c(
591
+ "div",
592
+ { key: index, staticClass: "mds-cascader-panel-level" },
593
+ [
594
+ panel && panel.length
595
+ ? [
596
+ _c(
597
+ "mds-scroll-bar",
598
+ _vm._l(panel, function (node) {
599
+ return _c("mds-cascader-option", {
600
+ key: node.key,
601
+ attrs: {
602
+ expandTrigger: _vm.expandTrigger,
603
+ checkStrictly: _vm.checkStrictly,
604
+ node: node,
605
+ },
606
+ on: {
607
+ "choose-node": _vm.chooseNode,
608
+ "change-multi-node": _vm.changeMultiNode,
609
+ "change-single-strict-node": _vm.changeSingleStrictNode,
610
+ },
611
+ })
612
+ }),
613
+ 1
614
+ ),
615
+ ]
616
+ : [_vm._m(0, true)],
617
+ ],
618
+ 2
619
+ )
620
+ }),
621
+ 0
622
+ )
623
+ }
624
+ var staticRenderFns = [
625
+ function () {
626
+ var _vm = this
627
+ var _h = _vm.$createElement
628
+ var _c = _vm._self._c || _h
629
+ return _c("div", { staticClass: "mds-cascader-panel-empty-wrapper" }, [
630
+ _c("div", { staticClass: "mds-cascader-panel-empty-text" }, [
631
+ _vm._v("暂无数据"),
632
+ ]),
633
+ ])
634
+ },
635
+ ]
636
+ render._withStripped = true
637
+
638
+
639
+ // CONCATENATED MODULE: ./components/cascaderpanel/panel.vue?vue&type=template&id=1352ea60&
640
+
641
+ // EXTERNAL MODULE: external "babel-runtime/helpers/extends"
642
+ var extends_ = __webpack_require__(19);
643
+ var extends_default = /*#__PURE__*/__webpack_require__.n(extends_);
644
+
645
+ // EXTERNAL MODULE: ./components/scroll-bar/index.js + 5 modules
646
+ var scroll_bar = __webpack_require__(24);
647
+
648
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./components/cascaderpanel/option.vue?vue&type=template&id=48d0e24e&
649
+ var optionvue_type_template_id_48d0e24e_render = function () {
650
+ var _vm = this
651
+ var _h = _vm.$createElement
652
+ var _c = _vm._self._c || _h
653
+ return _c(
654
+ "li",
655
+ {
656
+ class: _vm.classes,
657
+ on: {
658
+ mouseenter: function ($event) {
659
+ $event.stopPropagation()
660
+ return _vm.handleHover($event)
661
+ },
662
+ click: function ($event) {
663
+ $event.stopPropagation()
664
+ return _vm.handleClick($event)
665
+ },
666
+ },
667
+ },
668
+ [
669
+ _vm.multiple && _vm.rendering
670
+ ? _c("mds-checkbox", {
671
+ key: _vm.node.key,
672
+ staticClass: "mds-cascader-option-checkbox",
673
+ attrs: {
674
+ disabled: _vm.node.disabled,
675
+ checked: _vm.node.check,
676
+ indeterminate: _vm.node.indeterminate,
677
+ },
678
+ on: { change: _vm.handleMultiChange },
679
+ })
680
+ : _vm._e(),
681
+ _vm.isSingleStrict
682
+ ? _c("mds-radio", {
683
+ attrs: { disabled: _vm.node.disabled, value: true },
684
+ on: { change: _vm.handleSingleStrictChange },
685
+ model: {
686
+ value: _vm.node.selected,
687
+ callback: function ($$v) {
688
+ _vm.$set(_vm.node, "selected", $$v)
689
+ },
690
+ expression: "node.selected",
691
+ },
692
+ })
693
+ : _vm._e(),
694
+ _c(
695
+ "div",
696
+ { ref: "optionNode", class: "mds-cascader-option-label" },
697
+ [
698
+ _c("span", [_vm._v(_vm._s(_vm.node.label))]),
699
+ !_vm.node.isLeaf && !_vm.node.loading
700
+ ? _c("mds-icon", { attrs: { type: "line-caret-right" } })
701
+ : _vm._e(),
702
+ _vm.node.loading
703
+ ? _c("mds-icon", { attrs: { type: "line-sync", spin: "" } })
704
+ : _vm._e(),
705
+ ],
706
+ 1
707
+ ),
708
+ ],
709
+ 1
710
+ )
711
+ }
712
+ var optionvue_type_template_id_48d0e24e_staticRenderFns = []
713
+ optionvue_type_template_id_48d0e24e_render._withStripped = true
714
+
715
+
716
+ // CONCATENATED MODULE: ./components/cascaderpanel/option.vue?vue&type=template&id=48d0e24e&
717
+
718
+ // EXTERNAL MODULE: external "babel-runtime/helpers/defineProperty"
719
+ var defineProperty_ = __webpack_require__(1);
720
+ var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
721
+
722
+ // EXTERNAL MODULE: external "./icon"
723
+ var external_icon_ = __webpack_require__(4);
724
+ var external_icon_default = /*#__PURE__*/__webpack_require__.n(external_icon_);
725
+
726
+ // EXTERNAL MODULE: external "./checkbox"
727
+ var external_checkbox_ = __webpack_require__(28);
728
+ var external_checkbox_default = /*#__PURE__*/__webpack_require__.n(external_checkbox_);
729
+
730
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/cascaderpanel/option.vue?vue&type=script&lang=js&
731
+
732
+ //
733
+ //
734
+ //
735
+ //
736
+ //
737
+ //
738
+ //
739
+ //
740
+ //
741
+ //
742
+ //
743
+ //
744
+ //
745
+ //
746
+ //
747
+ //
748
+ //
749
+ //
750
+ //
751
+ //
752
+ //
753
+ //
754
+ //
755
+ //
756
+ //
757
+ //
758
+ //
759
+
760
+
761
+
762
+
763
+
764
+ /* harmony default export */ var optionvue_type_script_lang_js_ = ({
765
+ name: 'MdsCascaderOption',
766
+ components: {
767
+ MdsScrollBar: scroll_bar["a" /* default */],
768
+ MdsIcon: external_icon_default.a,
769
+ MdsCheckbox: external_checkbox_default.a
770
+ },
771
+ props: {
772
+ node: Object,
773
+ expandTrigger: String,
774
+ checkStrictly: Boolean
775
+ },
776
+ data: function data() {
777
+ return {
778
+ rendering: true
779
+ };
780
+ },
781
+
782
+ computed: {
783
+ hoverFlag: function hoverFlag() {
784
+ return this.expandTrigger === 'hover';
785
+ },
786
+ classes: function classes() {
787
+ var _ref;
788
+
789
+ var size = this.size,
790
+ active = this.active,
791
+ multiActive = this.multiActive;
792
+
793
+ return _ref = {}, defineProperty_default()(_ref, 'mds-cascader-option', true), defineProperty_default()(_ref, 'mds-cascader-option-' + size, true), defineProperty_default()(_ref, 'mds-cascader-option-active', active), defineProperty_default()(_ref, 'mds-cascader-option-multi-active', multiActive), defineProperty_default()(_ref, 'mds-cascader-option-disabled', this.node.disabled), _ref;
794
+ },
795
+ tree: function tree() {
796
+ return this.node.tree.$vue;
797
+ },
798
+ panel: function panel() {
799
+ return this.tree.$refs.panel;
800
+ },
801
+ size: function size() {
802
+ return this.tree.size;
803
+ },
804
+ multiple: function multiple() {
805
+ return this.tree.multiple;
806
+ },
807
+ active: function active() {
808
+ return !this.multiple && (this.node.selected || this.node.isExpanded);
809
+ },
810
+ multiActive: function multiActive() {
811
+ return this.multiple && (this.node.checked || this.node.isExpanded);
812
+ },
813
+ isSingleStrict: function isSingleStrict() {
814
+ return !this.multiple && this.checkStrictly;
815
+ },
816
+ isMultiStrict: function isMultiStrict() {
817
+ return this.multiple && this.checkStrictly;
818
+ }
819
+ },
820
+ methods: {
821
+ handleHover: function handleHover() {
822
+ if (!this.hoverFlag) {
823
+ return;
824
+ }
825
+ if (this.node.isLeaf) {
826
+ return;
827
+ }
828
+ this.handleClick();
829
+ },
830
+
831
+ // 点击选项文字区时的动作
832
+ handleClick: function handleClick() {
833
+ if (this.node.disabled) {
834
+ return;
835
+ }
836
+ this.$emit('choose-node', this.node);
837
+ },
838
+
839
+ // 选择多选框时的动作
840
+ handleMultiChange: function handleMultiChange() {
841
+ var _this = this;
842
+
843
+ if (this.node.disabled) {
844
+ return;
845
+ }
846
+
847
+ if (this.multiple && this.node.indeterminate) {
848
+ this.handleIndeterminate();
849
+ } else {
850
+ this.node.check = !this.node.check;
851
+ }
852
+ // 解决多选时全选不更新视图的问题
853
+ this.rendering = false;
854
+ this.$nextTick(function () {
855
+ _this.rendering = true;
856
+ });
857
+ this.$emit('change-multi-node', this.node);
858
+ },
859
+
860
+ // 处理多选时点击indeterminate态时的动作
861
+ handleIndeterminate: function handleIndeterminate() {
862
+ var activeChildNodes = this.node.childNodes.filter(function (node) {
863
+ return !node.disabled;
864
+ });
865
+ if (activeChildNodes.every(function (node) {
866
+ return node.checked;
867
+ })) {
868
+ this.node.check = false;
869
+ } else {
870
+ this.node.check = true;
871
+ }
872
+ },
873
+
874
+ // 选择单选框时的动作
875
+ handleSingleStrictChange: function handleSingleStrictChange(checkflag) {
876
+ var _this2 = this;
877
+
878
+ this.node.tree.nodesMap.forEach(function (node) {
879
+ if (node.key !== _this2.node.key) {
880
+ node.selected = false;
881
+ }
882
+ });
883
+ console.log(checkflag);
884
+ this.$emit('change-single-strict-node', this.node);
885
+ }
886
+ }
887
+ });
888
+ // CONCATENATED MODULE: ./components/cascaderpanel/option.vue?vue&type=script&lang=js&
889
+ /* harmony default export */ var cascaderpanel_optionvue_type_script_lang_js_ = (optionvue_type_script_lang_js_);
890
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
891
+ var componentNormalizer = __webpack_require__(0);
892
+
893
+ // CONCATENATED MODULE: ./components/cascaderpanel/option.vue
894
+
895
+
896
+
897
+
898
+
899
+ /* normalize component */
900
+
901
+ var component = Object(componentNormalizer["a" /* default */])(
902
+ cascaderpanel_optionvue_type_script_lang_js_,
903
+ optionvue_type_template_id_48d0e24e_render,
904
+ optionvue_type_template_id_48d0e24e_staticRenderFns,
905
+ false,
906
+ null,
907
+ null,
908
+ null
909
+
910
+ )
911
+
912
+ /* hot reload */
913
+ if (false) { var api; }
914
+ component.options.__file = "components/cascaderpanel/option.vue"
915
+ /* harmony default export */ var cascaderpanel_option = (component.exports);
916
+ // EXTERNAL MODULE: external "babel-runtime/core-js/get-iterator"
917
+ var get_iterator_ = __webpack_require__(20);
918
+ var get_iterator_default = /*#__PURE__*/__webpack_require__.n(get_iterator_);
919
+
920
+ // EXTERNAL MODULE: external "babel-runtime/core-js/map"
921
+ var map_ = __webpack_require__(40);
922
+ var map_default = /*#__PURE__*/__webpack_require__.n(map_);
923
+
924
+ // EXTERNAL MODULE: external "babel-runtime/helpers/typeof"
925
+ var typeof_ = __webpack_require__(8);
926
+ var typeof_default = /*#__PURE__*/__webpack_require__.n(typeof_);
927
+
928
+ // EXTERNAL MODULE: external "babel-runtime/helpers/classCallCheck"
929
+ var classCallCheck_ = __webpack_require__(26);
930
+ var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck_);
931
+
932
+ // EXTERNAL MODULE: external "babel-runtime/helpers/createClass"
933
+ var createClass_ = __webpack_require__(27);
934
+ var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass_);
935
+
936
+ // CONCATENATED MODULE: ./components/cascaderpanel/modal/cas-node.js
937
+
938
+
939
+ var defaultId = 0;
940
+
941
+ var cas_node_Node = function () {
942
+ function Node(options) {
943
+ classCallCheck_default()(this, Node);
944
+
945
+ this.id = defaultId++;
946
+ this.checked = false;
947
+ this.indeterminate = false;
948
+ this.data = null;
949
+ this.expanded = false;
950
+ this.parent = null;
951
+ this.isLeaf = false;
952
+
953
+ // 是否显示,用于搜索
954
+ this.visible = true;
955
+
956
+ for (var name in options) {
957
+ if (options.hasOwnProperty(name)) {
958
+ this[name] = options[name];
959
+ }
960
+ }
961
+
962
+ this.level = 0;
963
+ // 是否被选中
964
+ this.selected = false;
965
+ // 是否已经加载完毕,用于懒加载
966
+ this.loaded = false;
967
+ // 是否是加载中状态,用于懒加载
968
+ this.loading = false;
969
+ this.childNodes = [];
970
+ this.parent ? this.level = this.parent.level + 1 : this.level = 0;
971
+ this.update();
972
+ }
973
+
974
+ createClass_default()(Node, [{
975
+ key: 'update',
976
+ value: function update() {
977
+ var _this = this;
978
+
979
+ if (!this.data) {
980
+ this.handleIsLeaf();
981
+ return;
982
+ }
983
+ var data = this.data;
984
+ var prop = this.tree.prop;
985
+
986
+ // 生成_nodeId
987
+ // 非根节点添加到nodesMap中
988
+ this.fillNodesMap();
989
+
990
+ // 生成childNodes
991
+ var children = void 0;
992
+ // 根节点的情况把整个data作为children
993
+ if (Array.isArray(data) && this.level === 0) {
994
+ children = data;
995
+ this.id = 'root';
996
+ } else if (data.hasOwnProperty(prop.children)) {
997
+ children = data[prop.children];
998
+ } else {
999
+ if (!this.tree.load) this.isLeaf = true;
1000
+ }
1001
+
1002
+ if (Array.isArray(children) && children.length > 0) {
1003
+ children.forEach(function (data) {
1004
+ _this.appendChild(data);
1005
+ });
1006
+ } else {
1007
+ if (!this.tree.load) this.isLeaf = true;
1008
+ }
1009
+ this.handleIsLeaf();
1010
+ }
1011
+ }, {
1012
+ key: 'handleIsLeaf',
1013
+ value: function handleIsLeaf() {
1014
+ // 懒加载且未加载的情况
1015
+ if (this.tree.load && !this.loaded) {
1016
+ this.isLeaf = this.getTrueData('isLeaf');
1017
+ }
1018
+ // 非懒加载或懒加载但已加载的情况
1019
+ if (!this.tree.load || this.tree.load && this.loaded) {
1020
+ var childNodes = this.childNodes;
1021
+ this.isLeaf = !childNodes || childNodes.length === 0;
1022
+ }
1023
+ }
1024
+ }, {
1025
+ key: 'fillNodesMap',
1026
+ value: function fillNodesMap() {
1027
+ var key = this.key;
1028
+ if (!key && this.level !== 0) {
1029
+ throw new Error('必须指定节点的key');
1030
+ }
1031
+ if (key) {
1032
+ // 处理初始选中的节点
1033
+ this.handleSelectedKey(key);
1034
+ if (this.tree.nodesMap.get(key)) {
1035
+ throw new Error('节点的key不能重复');
1036
+ }
1037
+ this.tree.nodesMap.set(key, this);
1038
+ }
1039
+ }
1040
+ }, {
1041
+ key: 'handleSelectedKey',
1042
+ value: function handleSelectedKey(key) {
1043
+ this.selected = false;
1044
+ if (this.tree.selectedKey === key) {
1045
+ this.selected = true;
1046
+ }
1047
+ }
1048
+ }, {
1049
+ key: 'appendChild',
1050
+ value: function appendChild(data, index) {
1051
+ var child = new Node({
1052
+ parent: this,
1053
+ data: data,
1054
+ tree: this.tree
1055
+ });
1056
+ if (index) {
1057
+ this.childNodes.splice(index, 0, child);
1058
+ } else {
1059
+ this.childNodes.push(child);
1060
+ }
1061
+ }
1062
+ }, {
1063
+ key: 'getTrueData',
1064
+ value: function getTrueData(prop) {
1065
+ var props = this.tree.prop[prop];
1066
+ var data = this.data;
1067
+ if (!data) return;
1068
+ if (data.hasOwnProperty(props)) {
1069
+ return data[props];
1070
+ } else if (data.hasOwnProperty(prop)) {
1071
+ return data[prop];
1072
+ } else {
1073
+ return null;
1074
+ }
1075
+ }
1076
+ }, {
1077
+ key: 'loadNode',
1078
+ value: function loadNode() {
1079
+ var _this2 = this;
1080
+
1081
+ var node = this;
1082
+ if (node.loaded || node.loading || node.childNodes.length > 0) {
1083
+ return;
1084
+ }
1085
+ node.loading = true;
1086
+ node.tree.load(node.data, function (data) {
1087
+ if (!Array.isArray(data)) throw new Error('传入子元素必须是数组');
1088
+ data.forEach(function (data) {
1089
+ node.appendChild(data);
1090
+ });
1091
+ node.loading = false;
1092
+ node.loaded = true;
1093
+ node.check = false;
1094
+ node.expanded = true;
1095
+ _this2.handleIsLeaf();
1096
+ });
1097
+ }
1098
+ }, {
1099
+ key: 'getPath',
1100
+ value: function getPath(nodeFlag) {
1101
+ var arr = [];
1102
+ var n = 0;
1103
+ var node = this;
1104
+ while (node.level > n) {
1105
+ arr.push(nodeFlag ? node : node.data);
1106
+ node = node.parent;
1107
+ }
1108
+ return arr;
1109
+ }
1110
+ }, {
1111
+ key: 'handleCheckChange',
1112
+ value: function handleCheckChange() {
1113
+ var checked = this.checked;
1114
+ this.childNodes.forEach(function (node) {
1115
+ if (!node.disabled) {
1116
+ node.check = checked;
1117
+ }
1118
+ });
1119
+ if (this.parent) {
1120
+ this.parent.handleChildCheckChange();
1121
+ }
1122
+ }
1123
+ }, {
1124
+ key: 'handleChildCheckChange',
1125
+ value: function handleChildCheckChange() {
1126
+ if (Array.isArray(this.data) || this.level === 0) {
1127
+ return;
1128
+ }
1129
+ if (this.childNodes.length === this.checkedChildNodes.length && this.childNodes.length !== 0) {
1130
+ this.checked = true;
1131
+ this.indeterminate = false;
1132
+ } else if (this.checkedChildNodes.length > 0) {
1133
+ this.checked = false;
1134
+ this.indeterminate = true;
1135
+ } else {
1136
+ this.checked = false;
1137
+ this.indeterminate = false;
1138
+ for (var i = 0; i < this.childNodes.length; i++) {
1139
+ if (this.childNodes[i].indeterminate) {
1140
+ this.indeterminate = true;
1141
+ break;
1142
+ }
1143
+ }
1144
+ }
1145
+ this.parent.handleChildCheckChange();
1146
+ }
1147
+ }, {
1148
+ key: 'after',
1149
+ value: function after(node) {
1150
+ var oldIndex = node.index;
1151
+ node.parent.childNodes.splice(oldIndex, 1);
1152
+ node.parent.handleChildCheckChange();
1153
+ if (node.parent.childNodes.length === 0) {
1154
+ node.parent.isLeaf = true;
1155
+ }
1156
+ node.parent = this.parent;
1157
+ node.level = this.level;
1158
+ this.parent.childNodes.splice(this.index + 1, 0, node);
1159
+ this.handleChildCheckChange();
1160
+ }
1161
+ }, {
1162
+ key: 'first',
1163
+ value: function first(node) {
1164
+ var oldIndex = node.index;
1165
+ node.parent.childNodes.splice(oldIndex, 1);
1166
+ node.parent.handleChildCheckChange();
1167
+ if (node.parent.childNodes.length === 0) {
1168
+ node.parent.isLeaf = true;
1169
+ }
1170
+ this.isLeaf = false;
1171
+ node.parent = this;
1172
+ node.level = this.level + 1;
1173
+ this.childNodes.splice(0, 0, node);
1174
+ this.handleChildCheckChange();
1175
+ }
1176
+ }, {
1177
+ key: 'append',
1178
+ value: function append(node) {
1179
+ var oldIndex = node.index;
1180
+ node.parent.childNodes.splice(oldIndex, 1);
1181
+ node.parent.handleChildCheckChange();
1182
+ if (node.parent.childNodes.length === 0) {
1183
+ node.parent.isLeaf = true;
1184
+ }
1185
+ this.isLeaf = false;
1186
+ node.parent = this;
1187
+ node.level = this.level + 1;
1188
+ this.childNodes.push(node);
1189
+ this.handleChildCheckChange();
1190
+ }
1191
+ }, {
1192
+ key: 'moveNode',
1193
+ value: function moveNode(node, index) {
1194
+ var oldIndex = node.index;
1195
+ node.parent.childNodes.splice(oldIndex, 1);
1196
+ node.parent.handleChildCheckChange();
1197
+ if (node.parent.childNodes.length === 0) {
1198
+ node.parent.isLeaf = true;
1199
+ }
1200
+ this.isLeaf = false;
1201
+ node.parent = this;
1202
+ node.level = this.level + 1;
1203
+ if (index !== null) {
1204
+ this.childNodes.splice(index, 0, node);
1205
+ } else {
1206
+ this.childNodes.push(node);
1207
+ }
1208
+ this.handleChildCheckChange();
1209
+ }
1210
+ }, {
1211
+ key: 'remove',
1212
+ value: function remove() {
1213
+ var node = this;
1214
+ var index = node.index;
1215
+ node.parent.childNodes.splice(index, 1);
1216
+ node.parent.handleChildCheckChange();
1217
+ node.tree.nodesMap.delete(node.id);
1218
+ node = null;
1219
+ }
1220
+ }, {
1221
+ key: 'label',
1222
+ get: function get() {
1223
+ return this.getTrueData('label');
1224
+ }
1225
+ }, {
1226
+ key: 'key',
1227
+ get: function get() {
1228
+ return this.getTrueData('key');
1229
+ }
1230
+ }, {
1231
+ key: 'disabled',
1232
+ get: function get() {
1233
+ return this.getTrueData('disabled');
1234
+ }
1235
+ }, {
1236
+ key: 'check',
1237
+ get: function get() {
1238
+ return this.checked;
1239
+ },
1240
+ set: function set(val) {
1241
+ this.checked = val;
1242
+ this.handleCheckChange();
1243
+ }
1244
+ }, {
1245
+ key: 'siblingsNodes',
1246
+ get: function get() {
1247
+ var arr = [];
1248
+ var currentNode = this;
1249
+ this.parent.childNodes.forEach(function (node) {
1250
+ if (node.id !== currentNode.id) {
1251
+ arr.push(node);
1252
+ }
1253
+ });
1254
+ return arr;
1255
+ }
1256
+ }, {
1257
+ key: 'checkedChildNodes',
1258
+ get: function get() {
1259
+ var arr = [];
1260
+ this.childNodes.forEach(function (node) {
1261
+ if (node.checked) arr.push(node);
1262
+ });
1263
+ return arr;
1264
+ }
1265
+ }, {
1266
+ key: 'indeterminateChildNodes',
1267
+ get: function get() {
1268
+ var arr = [];
1269
+ this.childNodes.forEach(function (node) {
1270
+ if (node.checked || node.indeterminate) arr.push(node);
1271
+ });
1272
+ return arr;
1273
+ }
1274
+ }, {
1275
+ key: 'isExpanded',
1276
+ get: function get() {
1277
+ return this.expanded;
1278
+ },
1279
+ set: function set(value) {
1280
+ this.expanded = value;
1281
+ }
1282
+ }, {
1283
+ key: 'index',
1284
+ get: function get() {
1285
+ return this.parent.childNodes.indexOf(this);
1286
+ }
1287
+ }]);
1288
+
1289
+ return Node;
1290
+ }();
1291
+
1292
+
1293
+ // CONCATENATED MODULE: ./components/cascaderpanel/modal/cas-tree.js
1294
+
1295
+
1296
+
1297
+
1298
+
1299
+
1300
+
1301
+ var cas_tree_Tree = function () {
1302
+ function Tree(options) {
1303
+ var _this = this;
1304
+
1305
+ classCallCheck_default()(this, Tree);
1306
+
1307
+ for (var name in options) {
1308
+ if (options.hasOwnProperty(name)) {
1309
+ this[name] = options[name];
1310
+ }
1311
+ }
1312
+ if (!this.prop || typeof_default()(this.prop) !== 'object') {
1313
+ this.prop = {
1314
+ label: 'label',
1315
+ key: 'key',
1316
+ isLeaf: 'isLeaf',
1317
+ disabled: 'disabled',
1318
+ children: 'children'
1319
+ };
1320
+ }
1321
+
1322
+ this.nodesMap = new map_default.a();
1323
+ this.root = new cas_node_Node({
1324
+ data: this.data,
1325
+ tree: this
1326
+ });
1327
+
1328
+ // 根据load函数渲染根节点
1329
+ if (this.load) {
1330
+ this.load(this.root, function (arr) {
1331
+ if (!Array.isArray(arr)) {
1332
+ throw new Error('传入子元素必须是数组');
1333
+ }
1334
+ arr.forEach(function (item) {
1335
+ _this.root.appendChild(item);
1336
+ });
1337
+ });
1338
+ }
1339
+ }
1340
+
1341
+ createClass_default()(Tree, [{
1342
+ key: 'setData',
1343
+ value: function setData(newVal) {
1344
+ var dataChange = newVal !== this.root.data;
1345
+ if (dataChange) {
1346
+ this.nodesMap = new map_default.a();
1347
+ this.root = new cas_node_Node({
1348
+ data: newVal,
1349
+ tree: this
1350
+ });
1351
+ }
1352
+ }
1353
+ }, {
1354
+ key: 'handleSelectedChange',
1355
+ value: function handleSelectedChange(key) {
1356
+ var selectedNode = this.nodesMap.get(key);
1357
+ if (!selectedNode.selected) {
1358
+ this.nodesMap.forEach(function (node, nodeKey) {
1359
+ node.selected = false;
1360
+ if (nodeKey === key) {
1361
+ node.selected = true;
1362
+ }
1363
+ });
1364
+ this.$tree.$emit('node-selected-change', selectedNode.data, selectedNode, selectedNode.getPath(), selectedNode.getPath(true));
1365
+ }
1366
+ }
1367
+ }, {
1368
+ key: 'handleDefaultCheckedKeys',
1369
+ value: function handleDefaultCheckedKeys() {
1370
+ var _this2 = this;
1371
+
1372
+ // 处理defaultCheckedKeys
1373
+ if (this.defaultCheckedKeys) {
1374
+ this.defaultCheckedKeys.forEach(function (item) {
1375
+ _this2.nodesMap.get(item).check = true;
1376
+ });
1377
+ }
1378
+ }
1379
+ }, {
1380
+ key: 'search',
1381
+ value: function search(value) {
1382
+ var _this3 = this;
1383
+
1384
+ var recursionChildren = function recursionChildren(node) {
1385
+ var childNodes = node.root ? node.root.childNodes : node.childNodes;
1386
+ childNodes.forEach(function (item) {
1387
+ item.visible = _this3.searchNodeMethod.call(item, value, item.data, item);
1388
+ recursionChildren(item);
1389
+ });
1390
+
1391
+ // 子节点有匹配项的情况父节点需要显示
1392
+ if (!node.visible && childNodes.length) {
1393
+ var hiddenAllChildren = void 0;
1394
+ hiddenAllChildren = !childNodes.some(function (child) {
1395
+ return child.visible;
1396
+ });
1397
+ if (!node.root) {
1398
+ node.visible = !hiddenAllChildren;
1399
+ } else {
1400
+ node.root.visible = false;
1401
+ }
1402
+ }
1403
+
1404
+ // 节点显示的情况下展开所有子节点
1405
+ if (node.visible && !node.isLeaf && !_this3.load) {
1406
+ node.changeExpanded(true);
1407
+ }
1408
+ };
1409
+ recursionChildren(this);
1410
+ }
1411
+ }, {
1412
+ key: 'getCheckedNodes',
1413
+ value: function getCheckedNodes(leafOnly) {
1414
+ var result = [];
1415
+ if (leafOnly) {
1416
+ this.nodesMap.forEach(function (item) {
1417
+ if (item.checked && !item.data.children) {
1418
+ result.push(item.data);
1419
+ }
1420
+ });
1421
+ } else {
1422
+ this.nodesMap.forEach(function (item) {
1423
+ if (item.checked) {
1424
+ result.push(item.data);
1425
+ }
1426
+ });
1427
+ }
1428
+ return result;
1429
+ }
1430
+ }, {
1431
+ key: 'getCheckedKeys',
1432
+ value: function getCheckedKeys(leafOnly) {
1433
+ var result = [];
1434
+ if (leafOnly) {
1435
+ this.nodesMap.forEach(function (item) {
1436
+ if (item.checked && !item.data.children) {
1437
+ result.push(item.key);
1438
+ }
1439
+ });
1440
+ } else {
1441
+ this.nodesMap.forEach(function (item) {
1442
+ if (item.checked) {
1443
+ result.push(item.key);
1444
+ }
1445
+ });
1446
+ }
1447
+ return result;
1448
+ }
1449
+ }, {
1450
+ key: 'setCheckedKeys',
1451
+ value: function setCheckedKeys(checkArr) {
1452
+ var _this4 = this;
1453
+
1454
+ if (!Array.isArray(checkArr)) {
1455
+ throw new Error('需要输入一个key数组');
1456
+ }
1457
+ checkArr.forEach(function (item) {
1458
+ _this4.nodesMap.get(item).check = true;
1459
+ });
1460
+ }
1461
+ }, {
1462
+ key: 'setChecked',
1463
+ value: function setChecked(key, checkState) {
1464
+ var node = this.nodesMap.get(key);
1465
+ if (!node) {
1466
+ throw new Error('请输入正确的key');
1467
+ }
1468
+ node.check = checkState;
1469
+ }
1470
+ }, {
1471
+ key: 'getHalfCheckedNodes',
1472
+ value: function getHalfCheckedNodes() {
1473
+ var result = [];
1474
+ this.nodesMap.forEach(function (item) {
1475
+ if (item.indeterminate) {
1476
+ result.push(item.data);
1477
+ }
1478
+ });
1479
+ return result;
1480
+ }
1481
+ }, {
1482
+ key: 'getHalfCheckedKeys',
1483
+ value: function getHalfCheckedKeys() {
1484
+ var result = [];
1485
+ this.nodesMap.forEach(function (item) {
1486
+ if (item.indeterminate) {
1487
+ result.push(item.data.key);
1488
+ }
1489
+ });
1490
+ return result;
1491
+ }
1492
+ }, {
1493
+ key: 'getCurrentKey',
1494
+ value: function getCurrentKey() {
1495
+ var _iteratorNormalCompletion = true;
1496
+ var _didIteratorError = false;
1497
+ var _iteratorError = undefined;
1498
+
1499
+ try {
1500
+ for (var _iterator = get_iterator_default()(this.nodesMap.values()), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1501
+ var item = _step.value;
1502
+
1503
+ if (item.selected) {
1504
+ return item.data.key;
1505
+ }
1506
+ }
1507
+ } catch (err) {
1508
+ _didIteratorError = true;
1509
+ _iteratorError = err;
1510
+ } finally {
1511
+ try {
1512
+ if (!_iteratorNormalCompletion && _iterator.return) {
1513
+ _iterator.return();
1514
+ }
1515
+ } finally {
1516
+ if (_didIteratorError) {
1517
+ throw _iteratorError;
1518
+ }
1519
+ }
1520
+ }
1521
+
1522
+ return null;
1523
+ }
1524
+ }, {
1525
+ key: 'getCurrentNode',
1526
+ value: function getCurrentNode() {
1527
+ var _iteratorNormalCompletion2 = true;
1528
+ var _didIteratorError2 = false;
1529
+ var _iteratorError2 = undefined;
1530
+
1531
+ try {
1532
+ for (var _iterator2 = get_iterator_default()(this.nodesMap.values()), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
1533
+ var item = _step2.value;
1534
+
1535
+ if (item.selected) {
1536
+ return item.data;
1537
+ }
1538
+ }
1539
+ } catch (err) {
1540
+ _didIteratorError2 = true;
1541
+ _iteratorError2 = err;
1542
+ } finally {
1543
+ try {
1544
+ if (!_iteratorNormalCompletion2 && _iterator2.return) {
1545
+ _iterator2.return();
1546
+ }
1547
+ } finally {
1548
+ if (_didIteratorError2) {
1549
+ throw _iteratorError2;
1550
+ }
1551
+ }
1552
+ }
1553
+
1554
+ return null;
1555
+ }
1556
+ }, {
1557
+ key: 'setCurrentKey',
1558
+ value: function setCurrentKey(key) {
1559
+ if (key) {
1560
+ this.handleSelectedChange(key);
1561
+ } else {
1562
+ this.nodesMap.forEach(function (node) {
1563
+ node.selected = false;
1564
+ });
1565
+ }
1566
+ }
1567
+ }, {
1568
+ key: 'getNode',
1569
+ value: function getNode(key) {
1570
+ var node = this.nodesMap.get(key);
1571
+ if (node) {
1572
+ return node;
1573
+ }
1574
+ return null;
1575
+ }
1576
+ }, {
1577
+ key: 'getCheckNode',
1578
+ value: function getCheckNode(nodeFlag) {
1579
+ var arr = [];
1580
+ this.nodesMap.forEach(function (item) {
1581
+ if (item.checked) {
1582
+ nodeFlag ? arr.push(item) : arr.push(item.data);
1583
+ }
1584
+ });
1585
+ return arr;
1586
+ }
1587
+ }, {
1588
+ key: 'getCheckNodeKey',
1589
+ value: function getCheckNodeKey() {
1590
+ var arr = [];
1591
+ this.getCheckNode(true).forEach(function (node) {
1592
+ arr.push(node.key);
1593
+ });
1594
+ return arr;
1595
+ }
1596
+ }, {
1597
+ key: 'getIndeterminateNode',
1598
+ value: function getIndeterminateNode(nodeFlag) {
1599
+ var arr = [];
1600
+ this.nodesMap.forEach(function (item) {
1601
+ if (item.indeterminate) {
1602
+ nodeFlag ? arr.push(item) : arr.push(item.data);
1603
+ }
1604
+ });
1605
+ return arr;
1606
+ }
1607
+ }, {
1608
+ key: 'getIndeterminateNodeKey',
1609
+ value: function getIndeterminateNodeKey() {
1610
+ var arr = [];
1611
+ this.getIndeterminateNode(true).forEach(function (node) {
1612
+ arr.push(node.key);
1613
+ });
1614
+ return arr;
1615
+ }
1616
+ }, {
1617
+ key: 'setCheckNode',
1618
+ value: function setCheckNode(keys) {
1619
+ var bor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1620
+
1621
+ var nodesMap = this.nodesMap;
1622
+
1623
+ if (Array.isArray(keys)) {
1624
+ keys.forEach(function (item) {
1625
+ var node = nodesMap.get(item);
1626
+ if (node) node.check = bor;
1627
+ });
1628
+ } else {
1629
+ var node = nodesMap.get(keys);
1630
+ if (node) nodesMap.get(keys).check = bor;
1631
+ }
1632
+ }
1633
+ }, {
1634
+ key: 'getCheckNodeTree',
1635
+ value: function getCheckNodeTree() {
1636
+ var _this5 = this;
1637
+
1638
+ var root = this.root;
1639
+
1640
+ if (Array.isArray(root.data)) {
1641
+ var newTree = [];
1642
+ root.indeterminateChildNodes.forEach(function (item) {
1643
+ newTree.push(copyNode(item, _this5));
1644
+ });
1645
+ return newTree;
1646
+ } else {
1647
+ return copyNode(root, this);
1648
+ }
1649
+ }
1650
+ }, {
1651
+ key: 'clearCheckNode',
1652
+ value: function clearCheckNode() {
1653
+ this.nodesMap.forEach(function (item) {
1654
+ item.checked = false;
1655
+ item.indeterminate = false;
1656
+ });
1657
+ }
1658
+ }, {
1659
+ key: 'clearSelectedNode',
1660
+ value: function clearSelectedNode() {
1661
+ this.nodesMap.forEach(function (item) {
1662
+ item.selected = false;
1663
+ });
1664
+ }
1665
+ }, {
1666
+ key: 'clearExpandNode',
1667
+ value: function clearExpandNode() {
1668
+ this.nodesMap.forEach(function (item) {
1669
+ item.isExpanded = false;
1670
+ });
1671
+ }
1672
+ }, {
1673
+ key: 'appendNodes',
1674
+ value: function appendNodes(key, nodes) {
1675
+ var parent = this.nodesMap.get(key);
1676
+ if (!parent) {
1677
+ return;
1678
+ }
1679
+ if (Array.isArray(nodes)) {
1680
+ if ((typeof nodes === 'undefined' ? 'undefined' : typeof_default()(nodes)) === 'object') {
1681
+ nodes.forEach(function (item) {
1682
+ parent.appendChild(item);
1683
+ });
1684
+ }
1685
+ } else if ((typeof nodes === 'undefined' ? 'undefined' : typeof_default()(nodes)) === 'object') {
1686
+ parent.appendChild(nodes);
1687
+ }
1688
+ }
1689
+ }, {
1690
+ key: 'delectNodeByKey',
1691
+ value: function delectNodeByKey(keys) {
1692
+ var _this6 = this;
1693
+
1694
+ if (Array.isArray(keys)) {
1695
+ keys.forEach(function (item) {
1696
+ var node = _this6.nodesMap.get(item);
1697
+ if (node) node.remove();
1698
+ });
1699
+ } else {
1700
+ var node = this.nodesMap.get(keys);
1701
+ node.remove();
1702
+ }
1703
+ }
1704
+ }]);
1705
+
1706
+ return Tree;
1707
+ }();
1708
+
1709
+
1710
+
1711
+
1712
+ var copyData = function copyData(data, tree) {
1713
+ var newData = {};
1714
+ for (var key in data) {
1715
+ if (data.hasOwnProperty(key) && key !== tree.prop.children) {
1716
+ newData[key] = data[key];
1717
+ }
1718
+ }
1719
+ return newData;
1720
+ };
1721
+ var copyNode = function copyNode(node, tree) {
1722
+ var newData = copyData(node.data, tree);
1723
+ if (node.isLeaf) {
1724
+ return newData;
1725
+ }
1726
+ newData[tree.prop.children] = [];
1727
+ node.indeterminateChildNodes.forEach(function (item) {
1728
+ newData[tree.prop.children].push(copyNode(item, tree));
1729
+ });
1730
+ return newData;
1731
+ };
1732
+ // EXTERNAL MODULE: external "./_util/merge"
1733
+ var merge_ = __webpack_require__(43);
1734
+ var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
1735
+
1736
+ // EXTERNAL MODULE: ./components/_util/util.js
1737
+ var util = __webpack_require__(11);
1738
+
1739
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./components/cascaderpanel/panel.vue?vue&type=script&lang=js&
1740
+
1741
+ //
1742
+ //
1743
+ //
1744
+ //
1745
+ //
1746
+ //
1747
+ //
1748
+ //
1749
+ //
1750
+ //
1751
+ //
1752
+ //
1753
+ //
1754
+ //
1755
+ //
1756
+ //
1757
+ //
1758
+ //
1759
+ //
1760
+ //
1761
+ //
1762
+ //
1763
+ //
1764
+ //
1765
+ //
1766
+ //
1767
+ //
1768
+ //
1769
+ //
1770
+ //
1771
+ //
1772
+ //
1773
+ //
1774
+ //
1775
+ //
1776
+ //
1777
+
1778
+
1779
+
1780
+
1781
+
1782
+
1783
+
1784
+ var DefaultProps = {
1785
+ key: 'key',
1786
+ label: 'label',
1787
+ children: 'children',
1788
+ leaf: 'leaf',
1789
+ disabled: 'disabled'
1790
+ };
1791
+
1792
+ /* harmony default export */ var panelvue_type_script_lang_js_ = ({
1793
+ name: 'MdsCascaderPanel',
1794
+ componentName: 'MdsCascaderPanel',
1795
+ components: {
1796
+ MdsCascaderOption: cascaderpanel_option,
1797
+ MdsScrollBar: scroll_bar["a" /* default */]
1798
+ },
1799
+ data: function data() {
1800
+ return {
1801
+ tree: null,
1802
+ root: null,
1803
+ expandedPanels: []
1804
+ };
1805
+ },
1806
+
1807
+ props: {
1808
+ value: {},
1809
+ options: {
1810
+ type: [Array, Object]
1811
+ },
1812
+ expandTrigger: String,
1813
+ emitPath: {
1814
+ type: Boolean,
1815
+ default: true
1816
+ },
1817
+ loadData: Function,
1818
+ prop: {
1819
+ default: function _default() {
1820
+ return {
1821
+ label: 'label',
1822
+ key: 'key',
1823
+ isLeaf: 'isLeaf',
1824
+ disabled: 'disabled',
1825
+ children: 'children'
1826
+ };
1827
+ }
1828
+ },
1829
+ size: {
1830
+ type: String,
1831
+ default: 'medium'
1832
+ },
1833
+ border: {
1834
+ type: Boolean,
1835
+ default: true
1836
+ },
1837
+ showAllLevels: {
1838
+ type: Boolean,
1839
+ default: true
1840
+ },
1841
+ multiple: Boolean,
1842
+ filterable: Boolean,
1843
+ separator: String,
1844
+ maxHeight: {
1845
+ type: String,
1846
+ default: 'fit-content'
1847
+ },
1848
+ checkStrictly: Boolean
1849
+ },
1850
+ computed: {
1851
+ isLazy: function isLazy() {
1852
+ return Object(util["f" /* isFunction */])(this.loadData);
1853
+ },
1854
+ config: function config() {
1855
+ return merge_default()(extends_default()({}, DefaultProps), this.prop || {});
1856
+ },
1857
+ label: function label() {
1858
+ return this.prop && this.prop.label ? this.prop.label : 'label';
1859
+ },
1860
+ key: function key() {
1861
+ return this.prop && this.prop.key ? this.prop.key : 'key';
1862
+ },
1863
+ isSingleStrict: function isSingleStrict() {
1864
+ return !this.multiple && this.checkStrictly;
1865
+ },
1866
+ isMultiStrict: function isMultiStrict() {
1867
+ return this.multiple && this.checkStrictly;
1868
+ },
1869
+ isCascader: function isCascader() {
1870
+ var parent = this.$parent;
1871
+ while (parent) {
1872
+ if (parent.$options.name !== 'MdsCascader') {
1873
+ parent = parent.$parent;
1874
+ } else {
1875
+ this.parent = parent;
1876
+ return true;
1877
+ }
1878
+ }
1879
+ return false;
1880
+ }
1881
+ },
1882
+ watch: {
1883
+ options: {
1884
+ handler: function handler() {
1885
+ this.initTree();
1886
+ },
1887
+
1888
+ deep: true
1889
+ }
1890
+ },
1891
+ methods: {
1892
+ /**
1893
+ * 初始化面板数据
1894
+ */
1895
+ initTree: function initTree() {
1896
+ if (this.isLazy && this.options) {
1897
+ throw new Error('不支持同时传入 loadData 和 options 属性');
1898
+ }
1899
+
1900
+ this.tree = new cas_tree_Tree({
1901
+ $vue: this,
1902
+ prop: this.config,
1903
+ data: this.options,
1904
+ load: this.loadData,
1905
+ isLazy: this.isLazy
1906
+ });
1907
+
1908
+ this.root = this.tree.root;
1909
+ this.expandedPanels = [this.root.childNodes];
1910
+ if (this.filterable) {
1911
+ this.initfilterOptions();
1912
+ }
1913
+ },
1914
+
1915
+ /**
1916
+ * 面板选中某项后的动作
1917
+ */
1918
+ chooseNode: function chooseNode(node) {
1919
+ if (!this.handleUnChange(node)) {
1920
+ return;
1921
+ }
1922
+ var path = node.getPath(true).reverse();
1923
+ var data = node.data;
1924
+
1925
+ // 单选不关联
1926
+ if (this.isSingleStrict) {
1927
+ node.tree.clearExpandNode();
1928
+ if (!node.isLeaf) {
1929
+ this.emitExpandChange(path, data);
1930
+ }
1931
+ this.expandNode(node);
1932
+ return;
1933
+ }
1934
+
1935
+ // 清空选中项和展开项,重新计算
1936
+ node.tree.clearSelectedNode();
1937
+ node.tree.clearExpandNode();
1938
+
1939
+ if (!this.multiple) {
1940
+ if (node.isLeaf) {
1941
+ node.selected = true;
1942
+ this.emitChange(path, data);
1943
+ } else {
1944
+ this.emitExpandChange(path, data);
1945
+ }
1946
+ this.expandNode(node);
1947
+ } else {
1948
+ if (!node.isLeaf) {
1949
+ this.emitExpandChange(path, data);
1950
+ this.expandNode(node);
1951
+ }
1952
+ }
1953
+ },
1954
+
1955
+ // 处理未改变的情况
1956
+ handleUnChange: function handleUnChange(node) {
1957
+ // 非多选
1958
+ if (!this.multiple) {
1959
+ if (node.isLeaf) {
1960
+ // 叶子节点已经选中不触发change事件
1961
+ if (node.selected) {
1962
+ return false;
1963
+ }
1964
+ } else {
1965
+ // 非叶子节点已经展开,且为倒数第二级则不触发展开事件
1966
+ if (node.isExpanded && node.childNodes.length && node.childNodes[0].isLeaf) {
1967
+ return false;
1968
+ }
1969
+ }
1970
+ return true;
1971
+ }
1972
+ // 多选
1973
+ if (this.multiple) {
1974
+ // 叶子节点不触发事件
1975
+ if (node.isLeaf) {
1976
+ return false;
1977
+ } else {
1978
+ // 非叶子节点已经展开,且为倒数第二级则不触发展开事件
1979
+ }
1980
+ if (node.isExpanded && node.childNodes.length && node.childNodes[0].isLeaf) {
1981
+ return false;
1982
+ }
1983
+ return true;
1984
+ }
1985
+ },
1986
+
1987
+ /**
1988
+ * 多选选中某项后的动作
1989
+ */
1990
+ changeMultiNode: function changeMultiNode(node) {
1991
+ var _this2 = this;
1992
+
1993
+ var multiTags = [];
1994
+ node.tree.nodesMap.forEach(function (item) {
1995
+ if (item.checked && item.isLeaf) {
1996
+ multiTags.push(item);
1997
+ }
1998
+ });
1999
+ var multiPath = [];
2000
+ var multiData = [];
2001
+ multiTags.forEach(function (node) {
2002
+ var path = void 0;
2003
+ if (_this2.emitPath) {
2004
+ path = node.getPath().reverse().map(function (item) {
2005
+ return item[_this2.key];
2006
+ });
2007
+ } else {
2008
+ path = node.key;
2009
+ }
2010
+ multiPath.push(path);
2011
+ multiData.push(node.data);
2012
+ });
2013
+ if (this.isCascader) {
2014
+ this.$emit('set-multi-tags', multiTags, multiPath, multiData);
2015
+ } else {
2016
+ this.$emit('change', multiPath, multiData);
2017
+ }
2018
+ },
2019
+
2020
+ /**
2021
+ * 单选框改变后的动作
2022
+ */
2023
+ changeSingleStrictNode: function changeSingleStrictNode(node) {
2024
+ var path = node.getPath(true).reverse();
2025
+ var data = node.data;
2026
+ this.emitChange(path, data);
2027
+ },
2028
+
2029
+ /**
2030
+ * 弹射change事件
2031
+ */
2032
+ emitChange: function emitChange(path, data) {
2033
+ if (this.isCascader) {
2034
+ this.$emit('change', path, data);
2035
+ } else {
2036
+ var emitPath = this.emitPath ? path.map(function (item) {
2037
+ return item.key;
2038
+ }) : path.map(function (item) {
2039
+ return item.key;
2040
+ })[path.length - 1];
2041
+ this.$emit('change', emitPath, data);
2042
+ }
2043
+ },
2044
+
2045
+ /**
2046
+ * 控制展开下级面板
2047
+ */
2048
+ expandNode: function expandNode(node) {
2049
+ if (this.isLazy) {
2050
+ this.lazyLoad(node);
2051
+ } else {
2052
+ this.panelLoad(node);
2053
+ }
2054
+ },
2055
+
2056
+
2057
+ /**
2058
+ * 非懒加载展开面板
2059
+ */
2060
+ panelLoad: function panelLoad(node) {
2061
+ var path = node.getPath(true).reverse();
2062
+ var panels = [];
2063
+ var levelList = [node.tree.root.childNodes];
2064
+ var i = 0;
2065
+ while (levelList.length > 0) {
2066
+ var tempList = levelList.shift();
2067
+ panels.push(tempList);
2068
+ tempList.find(function (item) {
2069
+ if (path[i] && item.key === path[i].key && !item.isLeaf) {
2070
+ item.isExpanded = true;
2071
+ levelList.push(item.childNodes);
2072
+ return true;
2073
+ }
2074
+ });
2075
+ i++;
2076
+ }
2077
+ this.expandedPanels = panels;
2078
+ },
2079
+
2080
+ /**
2081
+ * 懒加载数据
2082
+ */
2083
+ lazyLoad: function lazyLoad(node) {
2084
+ var _this3 = this;
2085
+
2086
+ var path = node.getPath(true).reverse();
2087
+ var panels = [];
2088
+ var levelList = [node.tree.root.childNodes];
2089
+ var i = 0;
2090
+ while (levelList.length > 0) {
2091
+ var tempList = levelList.shift();
2092
+ panels.push(tempList);
2093
+ tempList.find(function (item) {
2094
+ if (path[i] && item.key === path[i].key && !item.isLeaf) {
2095
+ item.isExpanded = true;
2096
+ if (!item.loaded) {
2097
+ // 当前点击节点走懒加载
2098
+ item.loading = true;
2099
+ var _this = _this3;
2100
+ _this3.loadData(node, function (data) {
2101
+ if (!Array.isArray(data)) {
2102
+ throw new Error('传入子元素必须是数组');
2103
+ }
2104
+ data.forEach(function (data) {
2105
+ node.appendChild(data);
2106
+ });
2107
+ node.loading = false;
2108
+ node.loaded = true;
2109
+ node.check = false;
2110
+ node.handleIsLeaf();
2111
+ panels.push(node.childNodes);
2112
+ _this.expandedPanels = panels;
2113
+ });
2114
+ } else {
2115
+ levelList.push(item.childNodes);
2116
+ return true;
2117
+ }
2118
+ }
2119
+ });
2120
+ i++;
2121
+ }
2122
+ this.expandedPanels = panels;
2123
+ console.log(this.expandedPanels);
2124
+ },
2125
+
2126
+ /**
2127
+ * 弹射expandchange事件
2128
+ */
2129
+ emitExpandChange: function emitExpandChange(path, data) {
2130
+ if (this.isCascader) {
2131
+ this.$emit('expand-change', path, data);
2132
+ } else {
2133
+ this.$emit('expand-change', path.map(function (item) {
2134
+ return item.key;
2135
+ }), data);
2136
+ }
2137
+ },
2138
+
2139
+ /**
2140
+ * 初始化展开数据
2141
+ */
2142
+ setDefaultExpand: function setDefaultExpand() {
2143
+ var _this4 = this;
2144
+
2145
+ if (!this.value || !this.value.length) return;
2146
+ var targetKey = Array.isArray(this.value) ? this.value[this.value.length - 1] : this.value;
2147
+ var node = this.tree.nodesMap.get(targetKey);
2148
+ if (!node) {
2149
+ this.$emit('clearInput');
2150
+ return;
2151
+ }
2152
+ var path = this.getDefaultPath(node);
2153
+ var tempPath = path.map(function (item) {
2154
+ if (item.key === targetKey) {
2155
+ _this4.expandNode(item);
2156
+ item.selected = true;
2157
+ }
2158
+ return item;
2159
+ });
2160
+ if (this.isCascader) {
2161
+ this.$emit('change', tempPath, node, true);
2162
+ }
2163
+ },
2164
+
2165
+ /**
2166
+ * 初始化多选展开数据
2167
+ */
2168
+ setMultiDefaultExpand: function setMultiDefaultExpand() {
2169
+ var tempTags = Array.isArray(this.value) ? this.value : [this.value];
2170
+ var tempMaps = {};
2171
+ tempTags.forEach(function (item) {
2172
+ tempMaps[item] = true;
2173
+ });
2174
+ var multiTags = [];
2175
+ var nodeMap = this.tree.nodesMap;
2176
+ nodeMap.forEach(function (node) {
2177
+ if (tempMaps[node.key] && node.isLeaf) {
2178
+ node.check = true;
2179
+ multiTags.push(node);
2180
+ }
2181
+ });
2182
+ this.$emit('set-multi-tags', multiTags);
2183
+ },
2184
+
2185
+ /**
2186
+ * 获取初始路径
2187
+ */
2188
+ getDefaultPath: function getDefaultPath(node) {
2189
+ var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
2190
+
2191
+ if (!node.data) return path;
2192
+ path.unshift(node);
2193
+ if (node.parent && node.level > 1) {
2194
+ return this.getDefaultPath(node.parent, path);
2195
+ } else {
2196
+ return path;
2197
+ }
2198
+ },
2199
+
2200
+ /**
2201
+ * 重置面板
2202
+ */
2203
+ resetPanel: function resetPanel() {
2204
+ this.tree.clearSelectedNode();
2205
+ this.tree.clearExpandNode();
2206
+ this.expandedPanels = [this.root.childNodes];
2207
+ },
2208
+
2209
+ /**
2210
+ * 初始化搜索面板
2211
+ */
2212
+ initfilterOptions: function initfilterOptions() {
2213
+ var leafQueue = this.flatNodes([], this.root.childNodes);
2214
+ leafQueue = this.setFilterLabel(leafQueue);
2215
+ this.$emit('init-filter-options', leafQueue);
2216
+ },
2217
+ flatNodes: function flatNodes(res, data) {
2218
+ var _this5 = this;
2219
+
2220
+ data.forEach(function (node) {
2221
+ if (node.isLeaf) {
2222
+ res.push(node);
2223
+ } else {
2224
+ _this5.flatNodes(res, node.childNodes);
2225
+ }
2226
+ });
2227
+ return res;
2228
+ },
2229
+
2230
+ /**
2231
+ * 设定筛选项的名称
2232
+ */
2233
+ setFilterLabel: function setFilterLabel(data) {
2234
+ var _this6 = this;
2235
+
2236
+ var label = void 0;
2237
+ var disabledArr = [];
2238
+ var concatLabel = function concatLabel(node) {
2239
+ if (node.level > 1) {
2240
+ label = node.parent.label + _this6.separator + label;
2241
+ disabledArr.push(!!node.disabled);
2242
+ concatLabel(node.parent);
2243
+ }
2244
+ };
2245
+
2246
+ data.forEach(function (node) {
2247
+ label = node.label;
2248
+ disabledArr = [];
2249
+ concatLabel(node);
2250
+ if (_this6.showAllLevels) {
2251
+ node.filterLabel = label;
2252
+ } else {
2253
+ node.filterLabel = node.label;
2254
+ }
2255
+ node.filterDisabled = disabledArr.some(function (item) {
2256
+ return item;
2257
+ });
2258
+ });
2259
+ return data;
2260
+ }
2261
+ },
2262
+ created: function created() {
2263
+ this.initTree();
2264
+ },
2265
+ mounted: function mounted() {
2266
+ if (this.multiple) {
2267
+ this.setMultiDefaultExpand();
2268
+ return;
2269
+ }
2270
+ this.setDefaultExpand();
2271
+ }
2272
+ });
2273
+ // CONCATENATED MODULE: ./components/cascaderpanel/panel.vue?vue&type=script&lang=js&
2274
+ /* harmony default export */ var cascaderpanel_panelvue_type_script_lang_js_ = (panelvue_type_script_lang_js_);
2275
+ // CONCATENATED MODULE: ./components/cascaderpanel/panel.vue
2276
+
2277
+
2278
+
2279
+
2280
+
2281
+ /* normalize component */
2282
+
2283
+ var panel_component = Object(componentNormalizer["a" /* default */])(
2284
+ cascaderpanel_panelvue_type_script_lang_js_,
2285
+ render,
2286
+ staticRenderFns,
2287
+ false,
2288
+ null,
2289
+ null,
2290
+ null
2291
+
2292
+ )
2293
+
2294
+ /* hot reload */
2295
+ if (false) { var panel_api; }
2296
+ panel_component.options.__file = "components/cascaderpanel/panel.vue"
2297
+ /* harmony default export */ var panel = (panel_component.exports);
2298
+ // EXTERNAL MODULE: ./components/cascaderpanel/style/transition.less
2299
+ var transition = __webpack_require__(255);
2300
+
2301
+ // EXTERNAL MODULE: ./components/cascaderpanel/style/index.less
2302
+ var style = __webpack_require__(257);
2303
+
2304
+ // CONCATENATED MODULE: ./components/cascaderpanel/style/index.js
2305
+
2306
+
2307
+ // CONCATENATED MODULE: ./components/cascaderpanel/index.js
2308
+
2309
+
2310
+
2311
+ /* istanbul ignore next */
2312
+ panel.install = function (Vue) {
2313
+ Vue.component(panel.name, panel);
2314
+ };
2315
+ /* harmony default export */ var cascaderpanel = __webpack_exports__["default"] = (panel);
2316
+
2317
+ /***/ })
2318
+
2319
+ /******/ });
2320
+ });