@reviewpush/rp-treeselect 0.0.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 (64) hide show
  1. package/README.md +172 -0
  2. package/dist/rp-treeselect.cjs.js +3656 -0
  3. package/dist/rp-treeselect.cjs.js.map +1 -0
  4. package/dist/rp-treeselect.cjs.min.js +2 -0
  5. package/dist/rp-treeselect.cjs.min.js.map +1 -0
  6. package/dist/rp-treeselect.css +947 -0
  7. package/dist/rp-treeselect.css.map +1 -0
  8. package/dist/rp-treeselect.min.css +1 -0
  9. package/dist/rp-treeselect.umd.js +4837 -0
  10. package/dist/rp-treeselect.umd.js.map +1 -0
  11. package/dist/rp-treeselect.umd.min.js +2 -0
  12. package/dist/rp-treeselect.umd.min.js.map +1 -0
  13. package/package.json +140 -0
  14. package/src/assets/checkbox-checked-disabled.png +0 -0
  15. package/src/assets/checkbox-checked-disabled@2x.png +0 -0
  16. package/src/assets/checkbox-checked-disabled@3x.png +0 -0
  17. package/src/assets/checkbox-checked.png +0 -0
  18. package/src/assets/checkbox-checked@2x.png +0 -0
  19. package/src/assets/checkbox-checked@3x.png +0 -0
  20. package/src/assets/checkbox-indeterminate-disabled.png +0 -0
  21. package/src/assets/checkbox-indeterminate-disabled@2x.png +0 -0
  22. package/src/assets/checkbox-indeterminate-disabled@3x.png +0 -0
  23. package/src/assets/checkbox-indeterminate.png +0 -0
  24. package/src/assets/checkbox-indeterminate@2x.png +0 -0
  25. package/src/assets/checkbox-indeterminate@3x.png +0 -0
  26. package/src/components/Control.vue +153 -0
  27. package/src/components/HiddenFields.vue +37 -0
  28. package/src/components/Input.vue +295 -0
  29. package/src/components/Menu.vue +313 -0
  30. package/src/components/MenuPortal.vue +179 -0
  31. package/src/components/MultiValue.vue +56 -0
  32. package/src/components/MultiValueItem.vue +45 -0
  33. package/src/components/Option.vue +300 -0
  34. package/src/components/Placeholder.vue +21 -0
  35. package/src/components/SingleValue.vue +34 -0
  36. package/src/components/Tip.vue +32 -0
  37. package/src/components/Treeselect.vue +42 -0
  38. package/src/components/icons/Arrow.vue +11 -0
  39. package/src/components/icons/Delete.vue +11 -0
  40. package/src/constants.js +50 -0
  41. package/src/index.js +14 -0
  42. package/src/mixins/treeselectMixin.js +1949 -0
  43. package/src/style.less +1147 -0
  44. package/src/utils/.eslintrc.js +6 -0
  45. package/src/utils/constant.js +1 -0
  46. package/src/utils/createMap.js +1 -0
  47. package/src/utils/debounce.js +1 -0
  48. package/src/utils/deepExtend.js +25 -0
  49. package/src/utils/find.js +6 -0
  50. package/src/utils/identity.js +1 -0
  51. package/src/utils/includes.js +3 -0
  52. package/src/utils/index.js +38 -0
  53. package/src/utils/isNaN.js +3 -0
  54. package/src/utils/isPromise.js +1 -0
  55. package/src/utils/last.js +1 -0
  56. package/src/utils/noop.js +1 -0
  57. package/src/utils/onLeftClick.js +7 -0
  58. package/src/utils/once.js +1 -0
  59. package/src/utils/quickDiff.js +9 -0
  60. package/src/utils/removeFromArray.js +4 -0
  61. package/src/utils/scrollIntoView.js +15 -0
  62. package/src/utils/setupResizeAndScrollEventListeners.js +34 -0
  63. package/src/utils/warning.js +11 -0
  64. package/src/utils/watchSize.js +67 -0
@@ -0,0 +1,4837 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("Vue"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["Vue"], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["RpTreeselect"] = factory(require("Vue"));
8
+ else
9
+ root["RpTreeselect"] = factory(root["Vue"]);
10
+ })(window, function(__WEBPACK_EXTERNAL_MODULE__40__) {
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 = "/";
91
+ /******/
92
+ /******/
93
+ /******/ // Load entry module and return exports
94
+ /******/ return __webpack_require__(__webpack_require__.s = 42);
95
+ /******/ })
96
+ /************************************************************************/
97
+ /******/ ([
98
+ /* 0 */
99
+ /***/ (function(module, exports, __webpack_require__) {
100
+
101
+ var arrayWithHoles = __webpack_require__(1);
102
+ var iterableToArrayLimit = __webpack_require__(2);
103
+ var unsupportedIterableToArray = __webpack_require__(3);
104
+ var nonIterableRest = __webpack_require__(5);
105
+ function _slicedToArray(arr, i) {
106
+ return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
107
+ }
108
+ module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
109
+
110
+ /***/ }),
111
+ /* 1 */
112
+ /***/ (function(module, exports) {
113
+
114
+ function _arrayWithHoles(arr) {
115
+ if (Array.isArray(arr)) return arr;
116
+ }
117
+ module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
118
+
119
+ /***/ }),
120
+ /* 2 */
121
+ /***/ (function(module, exports) {
122
+
123
+ function _iterableToArrayLimit(r, l) {
124
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
125
+ if (null != t) {
126
+ var e,
127
+ n,
128
+ i,
129
+ u,
130
+ a = [],
131
+ f = !0,
132
+ o = !1;
133
+ try {
134
+ if (i = (t = t.call(r)).next, 0 === l) {
135
+ if (Object(t) !== t) return;
136
+ f = !1;
137
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
138
+ } catch (r) {
139
+ o = !0, n = r;
140
+ } finally {
141
+ try {
142
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
143
+ } finally {
144
+ if (o) throw n;
145
+ }
146
+ }
147
+ return a;
148
+ }
149
+ }
150
+ module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
151
+
152
+ /***/ }),
153
+ /* 3 */
154
+ /***/ (function(module, exports, __webpack_require__) {
155
+
156
+ var arrayLikeToArray = __webpack_require__(4);
157
+ function _unsupportedIterableToArray(o, minLen) {
158
+ if (!o) return;
159
+ if (typeof o === "string") return arrayLikeToArray(o, minLen);
160
+ var n = Object.prototype.toString.call(o).slice(8, -1);
161
+ if (n === "Object" && o.constructor) n = o.constructor.name;
162
+ if (n === "Map" || n === "Set") return Array.from(o);
163
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
164
+ }
165
+ module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
166
+
167
+ /***/ }),
168
+ /* 4 */
169
+ /***/ (function(module, exports) {
170
+
171
+ function _arrayLikeToArray(arr, len) {
172
+ if (len == null || len > arr.length) len = arr.length;
173
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
174
+ return arr2;
175
+ }
176
+ module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
177
+
178
+ /***/ }),
179
+ /* 5 */
180
+ /***/ (function(module, exports) {
181
+
182
+ function _nonIterableRest() {
183
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
184
+ }
185
+ module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
186
+
187
+ /***/ }),
188
+ /* 6 */
189
+ /***/ (function(module, exports, __webpack_require__) {
190
+
191
+ var arrayWithoutHoles = __webpack_require__(7);
192
+ var iterableToArray = __webpack_require__(8);
193
+ var unsupportedIterableToArray = __webpack_require__(3);
194
+ var nonIterableSpread = __webpack_require__(9);
195
+ function _toConsumableArray(arr) {
196
+ return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
197
+ }
198
+ module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
199
+
200
+ /***/ }),
201
+ /* 7 */
202
+ /***/ (function(module, exports, __webpack_require__) {
203
+
204
+ var arrayLikeToArray = __webpack_require__(4);
205
+ function _arrayWithoutHoles(arr) {
206
+ if (Array.isArray(arr)) return arrayLikeToArray(arr);
207
+ }
208
+ module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
209
+
210
+ /***/ }),
211
+ /* 8 */
212
+ /***/ (function(module, exports) {
213
+
214
+ function _iterableToArray(iter) {
215
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
216
+ }
217
+ module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
218
+
219
+ /***/ }),
220
+ /* 9 */
221
+ /***/ (function(module, exports) {
222
+
223
+ function _nonIterableSpread() {
224
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
225
+ }
226
+ module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
227
+
228
+ /***/ }),
229
+ /* 10 */
230
+ /***/ (function(module, exports, __webpack_require__) {
231
+
232
+ var toPropertyKey = __webpack_require__(11);
233
+ function _defineProperty(obj, key, value) {
234
+ key = toPropertyKey(key);
235
+ if (key in obj) {
236
+ Object.defineProperty(obj, key, {
237
+ value: value,
238
+ enumerable: true,
239
+ configurable: true,
240
+ writable: true
241
+ });
242
+ } else {
243
+ obj[key] = value;
244
+ }
245
+ return obj;
246
+ }
247
+ module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
248
+
249
+ /***/ }),
250
+ /* 11 */
251
+ /***/ (function(module, exports, __webpack_require__) {
252
+
253
+ var _typeof = __webpack_require__(12)["default"];
254
+ var toPrimitive = __webpack_require__(13);
255
+ function toPropertyKey(t) {
256
+ var i = toPrimitive(t, "string");
257
+ return "symbol" == _typeof(i) ? i : String(i);
258
+ }
259
+ module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
260
+
261
+ /***/ }),
262
+ /* 12 */
263
+ /***/ (function(module, exports) {
264
+
265
+ function _typeof(o) {
266
+ "@babel/helpers - typeof";
267
+
268
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
269
+ return typeof o;
270
+ } : function (o) {
271
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
272
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
273
+ }
274
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
275
+
276
+ /***/ }),
277
+ /* 13 */
278
+ /***/ (function(module, exports, __webpack_require__) {
279
+
280
+ var _typeof = __webpack_require__(12)["default"];
281
+ function toPrimitive(t, r) {
282
+ if ("object" != _typeof(t) || !t) return t;
283
+ var e = t[Symbol.toPrimitive];
284
+ if (void 0 !== e) {
285
+ var i = e.call(t, r || "default");
286
+ if ("object" != _typeof(i)) return i;
287
+ throw new TypeError("@@toPrimitive must return a primitive value.");
288
+ }
289
+ return ("string" === r ? String : Number)(t);
290
+ }
291
+ module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
292
+
293
+ /***/ }),
294
+ /* 14 */
295
+ /***/ (function(module, exports, __webpack_require__) {
296
+
297
+ "use strict";
298
+
299
+
300
+ function fuzzysearch (needle, haystack) {
301
+ var tlen = haystack.length;
302
+ var qlen = needle.length;
303
+ if (qlen > tlen) {
304
+ return false;
305
+ }
306
+ if (qlen === tlen) {
307
+ return needle === haystack;
308
+ }
309
+ outer: for (var i = 0, j = 0; i < qlen; i++) {
310
+ var nch = needle.charCodeAt(i);
311
+ while (j < tlen) {
312
+ if (haystack.charCodeAt(j++) === nch) {
313
+ continue outer;
314
+ }
315
+ }
316
+ return false;
317
+ }
318
+ return true;
319
+ }
320
+
321
+ module.exports = fuzzysearch;
322
+
323
+
324
+ /***/ }),
325
+ /* 15 */
326
+ /***/ (function(module, exports) {
327
+
328
+ /**
329
+ * This method returns `undefined`.
330
+ *
331
+ * @static
332
+ * @memberOf _
333
+ * @since 2.3.0
334
+ * @category Util
335
+ * @example
336
+ *
337
+ * _.times(2, _.noop);
338
+ * // => [undefined, undefined]
339
+ */
340
+ function noop() {
341
+ // No operation performed.
342
+ }
343
+
344
+ module.exports = noop;
345
+
346
+
347
+ /***/ }),
348
+ /* 16 */
349
+ /***/ (function(module, exports, __webpack_require__) {
350
+
351
+ var isObject = __webpack_require__(17),
352
+ now = __webpack_require__(18),
353
+ toNumber = __webpack_require__(22);
354
+
355
+ /** Error message constants. */
356
+ var FUNC_ERROR_TEXT = 'Expected a function';
357
+
358
+ /* Built-in method references for those with the same name as other `lodash` methods. */
359
+ var nativeMax = Math.max,
360
+ nativeMin = Math.min;
361
+
362
+ /**
363
+ * Creates a debounced function that delays invoking `func` until after `wait`
364
+ * milliseconds have elapsed since the last time the debounced function was
365
+ * invoked. The debounced function comes with a `cancel` method to cancel
366
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
367
+ * Provide `options` to indicate whether `func` should be invoked on the
368
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
369
+ * with the last arguments provided to the debounced function. Subsequent
370
+ * calls to the debounced function return the result of the last `func`
371
+ * invocation.
372
+ *
373
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
374
+ * invoked on the trailing edge of the timeout only if the debounced function
375
+ * is invoked more than once during the `wait` timeout.
376
+ *
377
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
378
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
379
+ *
380
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
381
+ * for details over the differences between `_.debounce` and `_.throttle`.
382
+ *
383
+ * @static
384
+ * @memberOf _
385
+ * @since 0.1.0
386
+ * @category Function
387
+ * @param {Function} func The function to debounce.
388
+ * @param {number} [wait=0] The number of milliseconds to delay.
389
+ * @param {Object} [options={}] The options object.
390
+ * @param {boolean} [options.leading=false]
391
+ * Specify invoking on the leading edge of the timeout.
392
+ * @param {number} [options.maxWait]
393
+ * The maximum time `func` is allowed to be delayed before it's invoked.
394
+ * @param {boolean} [options.trailing=true]
395
+ * Specify invoking on the trailing edge of the timeout.
396
+ * @returns {Function} Returns the new debounced function.
397
+ * @example
398
+ *
399
+ * // Avoid costly calculations while the window size is in flux.
400
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
401
+ *
402
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
403
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
404
+ * 'leading': true,
405
+ * 'trailing': false
406
+ * }));
407
+ *
408
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
409
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
410
+ * var source = new EventSource('/stream');
411
+ * jQuery(source).on('message', debounced);
412
+ *
413
+ * // Cancel the trailing debounced invocation.
414
+ * jQuery(window).on('popstate', debounced.cancel);
415
+ */
416
+ function debounce(func, wait, options) {
417
+ var lastArgs,
418
+ lastThis,
419
+ maxWait,
420
+ result,
421
+ timerId,
422
+ lastCallTime,
423
+ lastInvokeTime = 0,
424
+ leading = false,
425
+ maxing = false,
426
+ trailing = true;
427
+
428
+ if (typeof func != 'function') {
429
+ throw new TypeError(FUNC_ERROR_TEXT);
430
+ }
431
+ wait = toNumber(wait) || 0;
432
+ if (isObject(options)) {
433
+ leading = !!options.leading;
434
+ maxing = 'maxWait' in options;
435
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
436
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
437
+ }
438
+
439
+ function invokeFunc(time) {
440
+ var args = lastArgs,
441
+ thisArg = lastThis;
442
+
443
+ lastArgs = lastThis = undefined;
444
+ lastInvokeTime = time;
445
+ result = func.apply(thisArg, args);
446
+ return result;
447
+ }
448
+
449
+ function leadingEdge(time) {
450
+ // Reset any `maxWait` timer.
451
+ lastInvokeTime = time;
452
+ // Start the timer for the trailing edge.
453
+ timerId = setTimeout(timerExpired, wait);
454
+ // Invoke the leading edge.
455
+ return leading ? invokeFunc(time) : result;
456
+ }
457
+
458
+ function remainingWait(time) {
459
+ var timeSinceLastCall = time - lastCallTime,
460
+ timeSinceLastInvoke = time - lastInvokeTime,
461
+ timeWaiting = wait - timeSinceLastCall;
462
+
463
+ return maxing
464
+ ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
465
+ : timeWaiting;
466
+ }
467
+
468
+ function shouldInvoke(time) {
469
+ var timeSinceLastCall = time - lastCallTime,
470
+ timeSinceLastInvoke = time - lastInvokeTime;
471
+
472
+ // Either this is the first call, activity has stopped and we're at the
473
+ // trailing edge, the system time has gone backwards and we're treating
474
+ // it as the trailing edge, or we've hit the `maxWait` limit.
475
+ return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
476
+ (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
477
+ }
478
+
479
+ function timerExpired() {
480
+ var time = now();
481
+ if (shouldInvoke(time)) {
482
+ return trailingEdge(time);
483
+ }
484
+ // Restart the timer.
485
+ timerId = setTimeout(timerExpired, remainingWait(time));
486
+ }
487
+
488
+ function trailingEdge(time) {
489
+ timerId = undefined;
490
+
491
+ // Only invoke if we have `lastArgs` which means `func` has been
492
+ // debounced at least once.
493
+ if (trailing && lastArgs) {
494
+ return invokeFunc(time);
495
+ }
496
+ lastArgs = lastThis = undefined;
497
+ return result;
498
+ }
499
+
500
+ function cancel() {
501
+ if (timerId !== undefined) {
502
+ clearTimeout(timerId);
503
+ }
504
+ lastInvokeTime = 0;
505
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
506
+ }
507
+
508
+ function flush() {
509
+ return timerId === undefined ? result : trailingEdge(now());
510
+ }
511
+
512
+ function debounced() {
513
+ var time = now(),
514
+ isInvoking = shouldInvoke(time);
515
+
516
+ lastArgs = arguments;
517
+ lastThis = this;
518
+ lastCallTime = time;
519
+
520
+ if (isInvoking) {
521
+ if (timerId === undefined) {
522
+ return leadingEdge(lastCallTime);
523
+ }
524
+ if (maxing) {
525
+ // Handle invocations in a tight loop.
526
+ clearTimeout(timerId);
527
+ timerId = setTimeout(timerExpired, wait);
528
+ return invokeFunc(lastCallTime);
529
+ }
530
+ }
531
+ if (timerId === undefined) {
532
+ timerId = setTimeout(timerExpired, wait);
533
+ }
534
+ return result;
535
+ }
536
+ debounced.cancel = cancel;
537
+ debounced.flush = flush;
538
+ return debounced;
539
+ }
540
+
541
+ module.exports = debounce;
542
+
543
+
544
+ /***/ }),
545
+ /* 17 */
546
+ /***/ (function(module, exports) {
547
+
548
+ /**
549
+ * Checks if `value` is the
550
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
551
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
552
+ *
553
+ * @static
554
+ * @memberOf _
555
+ * @since 0.1.0
556
+ * @category Lang
557
+ * @param {*} value The value to check.
558
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
559
+ * @example
560
+ *
561
+ * _.isObject({});
562
+ * // => true
563
+ *
564
+ * _.isObject([1, 2, 3]);
565
+ * // => true
566
+ *
567
+ * _.isObject(_.noop);
568
+ * // => true
569
+ *
570
+ * _.isObject(null);
571
+ * // => false
572
+ */
573
+ function isObject(value) {
574
+ var type = typeof value;
575
+ return value != null && (type == 'object' || type == 'function');
576
+ }
577
+
578
+ module.exports = isObject;
579
+
580
+
581
+ /***/ }),
582
+ /* 18 */
583
+ /***/ (function(module, exports, __webpack_require__) {
584
+
585
+ var root = __webpack_require__(19);
586
+
587
+ /**
588
+ * Gets the timestamp of the number of milliseconds that have elapsed since
589
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
590
+ *
591
+ * @static
592
+ * @memberOf _
593
+ * @since 2.4.0
594
+ * @category Date
595
+ * @returns {number} Returns the timestamp.
596
+ * @example
597
+ *
598
+ * _.defer(function(stamp) {
599
+ * console.log(_.now() - stamp);
600
+ * }, _.now());
601
+ * // => Logs the number of milliseconds it took for the deferred invocation.
602
+ */
603
+ var now = function() {
604
+ return root.Date.now();
605
+ };
606
+
607
+ module.exports = now;
608
+
609
+
610
+ /***/ }),
611
+ /* 19 */
612
+ /***/ (function(module, exports, __webpack_require__) {
613
+
614
+ var freeGlobal = __webpack_require__(20);
615
+
616
+ /** Detect free variable `self`. */
617
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
618
+
619
+ /** Used as a reference to the global object. */
620
+ var root = freeGlobal || freeSelf || Function('return this')();
621
+
622
+ module.exports = root;
623
+
624
+
625
+ /***/ }),
626
+ /* 20 */
627
+ /***/ (function(module, exports, __webpack_require__) {
628
+
629
+ /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
630
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
631
+
632
+ module.exports = freeGlobal;
633
+
634
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(21)))
635
+
636
+ /***/ }),
637
+ /* 21 */
638
+ /***/ (function(module, exports) {
639
+
640
+ var g;
641
+
642
+ // This works in non-strict mode
643
+ g = (function() {
644
+ return this;
645
+ })();
646
+
647
+ try {
648
+ // This works if eval is allowed (see CSP)
649
+ g = g || new Function("return this")();
650
+ } catch (e) {
651
+ // This works if the window reference is available
652
+ if (typeof window === "object") g = window;
653
+ }
654
+
655
+ // g can still be undefined, but nothing to do about it...
656
+ // We return undefined, instead of nothing here, so it's
657
+ // easier to handle this case. if(!global) { ...}
658
+
659
+ module.exports = g;
660
+
661
+
662
+ /***/ }),
663
+ /* 22 */
664
+ /***/ (function(module, exports, __webpack_require__) {
665
+
666
+ var baseTrim = __webpack_require__(23),
667
+ isObject = __webpack_require__(17),
668
+ isSymbol = __webpack_require__(25);
669
+
670
+ /** Used as references for various `Number` constants. */
671
+ var NAN = 0 / 0;
672
+
673
+ /** Used to detect bad signed hexadecimal string values. */
674
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
675
+
676
+ /** Used to detect binary string values. */
677
+ var reIsBinary = /^0b[01]+$/i;
678
+
679
+ /** Used to detect octal string values. */
680
+ var reIsOctal = /^0o[0-7]+$/i;
681
+
682
+ /** Built-in method references without a dependency on `root`. */
683
+ var freeParseInt = parseInt;
684
+
685
+ /**
686
+ * Converts `value` to a number.
687
+ *
688
+ * @static
689
+ * @memberOf _
690
+ * @since 4.0.0
691
+ * @category Lang
692
+ * @param {*} value The value to process.
693
+ * @returns {number} Returns the number.
694
+ * @example
695
+ *
696
+ * _.toNumber(3.2);
697
+ * // => 3.2
698
+ *
699
+ * _.toNumber(Number.MIN_VALUE);
700
+ * // => 5e-324
701
+ *
702
+ * _.toNumber(Infinity);
703
+ * // => Infinity
704
+ *
705
+ * _.toNumber('3.2');
706
+ * // => 3.2
707
+ */
708
+ function toNumber(value) {
709
+ if (typeof value == 'number') {
710
+ return value;
711
+ }
712
+ if (isSymbol(value)) {
713
+ return NAN;
714
+ }
715
+ if (isObject(value)) {
716
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
717
+ value = isObject(other) ? (other + '') : other;
718
+ }
719
+ if (typeof value != 'string') {
720
+ return value === 0 ? value : +value;
721
+ }
722
+ value = baseTrim(value);
723
+ var isBinary = reIsBinary.test(value);
724
+ return (isBinary || reIsOctal.test(value))
725
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
726
+ : (reIsBadHex.test(value) ? NAN : +value);
727
+ }
728
+
729
+ module.exports = toNumber;
730
+
731
+
732
+ /***/ }),
733
+ /* 23 */
734
+ /***/ (function(module, exports, __webpack_require__) {
735
+
736
+ var trimmedEndIndex = __webpack_require__(24);
737
+
738
+ /** Used to match leading whitespace. */
739
+ var reTrimStart = /^\s+/;
740
+
741
+ /**
742
+ * The base implementation of `_.trim`.
743
+ *
744
+ * @private
745
+ * @param {string} string The string to trim.
746
+ * @returns {string} Returns the trimmed string.
747
+ */
748
+ function baseTrim(string) {
749
+ return string
750
+ ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
751
+ : string;
752
+ }
753
+
754
+ module.exports = baseTrim;
755
+
756
+
757
+ /***/ }),
758
+ /* 24 */
759
+ /***/ (function(module, exports) {
760
+
761
+ /** Used to match a single whitespace character. */
762
+ var reWhitespace = /\s/;
763
+
764
+ /**
765
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
766
+ * character of `string`.
767
+ *
768
+ * @private
769
+ * @param {string} string The string to inspect.
770
+ * @returns {number} Returns the index of the last non-whitespace character.
771
+ */
772
+ function trimmedEndIndex(string) {
773
+ var index = string.length;
774
+
775
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
776
+ return index;
777
+ }
778
+
779
+ module.exports = trimmedEndIndex;
780
+
781
+
782
+ /***/ }),
783
+ /* 25 */
784
+ /***/ (function(module, exports, __webpack_require__) {
785
+
786
+ var baseGetTag = __webpack_require__(26),
787
+ isObjectLike = __webpack_require__(30);
788
+
789
+ /** `Object#toString` result references. */
790
+ var symbolTag = '[object Symbol]';
791
+
792
+ /**
793
+ * Checks if `value` is classified as a `Symbol` primitive or object.
794
+ *
795
+ * @static
796
+ * @memberOf _
797
+ * @since 4.0.0
798
+ * @category Lang
799
+ * @param {*} value The value to check.
800
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
801
+ * @example
802
+ *
803
+ * _.isSymbol(Symbol.iterator);
804
+ * // => true
805
+ *
806
+ * _.isSymbol('abc');
807
+ * // => false
808
+ */
809
+ function isSymbol(value) {
810
+ return typeof value == 'symbol' ||
811
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
812
+ }
813
+
814
+ module.exports = isSymbol;
815
+
816
+
817
+ /***/ }),
818
+ /* 26 */
819
+ /***/ (function(module, exports, __webpack_require__) {
820
+
821
+ var Symbol = __webpack_require__(27),
822
+ getRawTag = __webpack_require__(28),
823
+ objectToString = __webpack_require__(29);
824
+
825
+ /** `Object#toString` result references. */
826
+ var nullTag = '[object Null]',
827
+ undefinedTag = '[object Undefined]';
828
+
829
+ /** Built-in value references. */
830
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
831
+
832
+ /**
833
+ * The base implementation of `getTag` without fallbacks for buggy environments.
834
+ *
835
+ * @private
836
+ * @param {*} value The value to query.
837
+ * @returns {string} Returns the `toStringTag`.
838
+ */
839
+ function baseGetTag(value) {
840
+ if (value == null) {
841
+ return value === undefined ? undefinedTag : nullTag;
842
+ }
843
+ return (symToStringTag && symToStringTag in Object(value))
844
+ ? getRawTag(value)
845
+ : objectToString(value);
846
+ }
847
+
848
+ module.exports = baseGetTag;
849
+
850
+
851
+ /***/ }),
852
+ /* 27 */
853
+ /***/ (function(module, exports, __webpack_require__) {
854
+
855
+ var root = __webpack_require__(19);
856
+
857
+ /** Built-in value references. */
858
+ var Symbol = root.Symbol;
859
+
860
+ module.exports = Symbol;
861
+
862
+
863
+ /***/ }),
864
+ /* 28 */
865
+ /***/ (function(module, exports, __webpack_require__) {
866
+
867
+ var Symbol = __webpack_require__(27);
868
+
869
+ /** Used for built-in method references. */
870
+ var objectProto = Object.prototype;
871
+
872
+ /** Used to check objects for own properties. */
873
+ var hasOwnProperty = objectProto.hasOwnProperty;
874
+
875
+ /**
876
+ * Used to resolve the
877
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
878
+ * of values.
879
+ */
880
+ var nativeObjectToString = objectProto.toString;
881
+
882
+ /** Built-in value references. */
883
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
884
+
885
+ /**
886
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
887
+ *
888
+ * @private
889
+ * @param {*} value The value to query.
890
+ * @returns {string} Returns the raw `toStringTag`.
891
+ */
892
+ function getRawTag(value) {
893
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
894
+ tag = value[symToStringTag];
895
+
896
+ try {
897
+ value[symToStringTag] = undefined;
898
+ var unmasked = true;
899
+ } catch (e) {}
900
+
901
+ var result = nativeObjectToString.call(value);
902
+ if (unmasked) {
903
+ if (isOwn) {
904
+ value[symToStringTag] = tag;
905
+ } else {
906
+ delete value[symToStringTag];
907
+ }
908
+ }
909
+ return result;
910
+ }
911
+
912
+ module.exports = getRawTag;
913
+
914
+
915
+ /***/ }),
916
+ /* 29 */
917
+ /***/ (function(module, exports) {
918
+
919
+ /** Used for built-in method references. */
920
+ var objectProto = Object.prototype;
921
+
922
+ /**
923
+ * Used to resolve the
924
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
925
+ * of values.
926
+ */
927
+ var nativeObjectToString = objectProto.toString;
928
+
929
+ /**
930
+ * Converts `value` to a string using `Object.prototype.toString`.
931
+ *
932
+ * @private
933
+ * @param {*} value The value to convert.
934
+ * @returns {string} Returns the converted string.
935
+ */
936
+ function objectToString(value) {
937
+ return nativeObjectToString.call(value);
938
+ }
939
+
940
+ module.exports = objectToString;
941
+
942
+
943
+ /***/ }),
944
+ /* 30 */
945
+ /***/ (function(module, exports) {
946
+
947
+ /**
948
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
949
+ * and has a `typeof` result of "object".
950
+ *
951
+ * @static
952
+ * @memberOf _
953
+ * @since 4.0.0
954
+ * @category Lang
955
+ * @param {*} value The value to check.
956
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
957
+ * @example
958
+ *
959
+ * _.isObjectLike({});
960
+ * // => true
961
+ *
962
+ * _.isObjectLike([1, 2, 3]);
963
+ * // => true
964
+ *
965
+ * _.isObjectLike(_.noop);
966
+ * // => false
967
+ *
968
+ * _.isObjectLike(null);
969
+ * // => false
970
+ */
971
+ function isObjectLike(value) {
972
+ return value != null && typeof value == 'object';
973
+ }
974
+
975
+ module.exports = isObjectLike;
976
+
977
+
978
+ /***/ }),
979
+ /* 31 */
980
+ /***/ (function(module, exports) {
981
+
982
+ module.exports = isPromise;
983
+ module.exports.default = isPromise;
984
+
985
+ function isPromise(obj) {
986
+ return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
987
+ }
988
+
989
+
990
+ /***/ }),
991
+ /* 32 */
992
+ /***/ (function(module, exports, __webpack_require__) {
993
+
994
+ var before = __webpack_require__(33);
995
+
996
+ /**
997
+ * Creates a function that is restricted to invoking `func` once. Repeat calls
998
+ * to the function return the value of the first invocation. The `func` is
999
+ * invoked with the `this` binding and arguments of the created function.
1000
+ *
1001
+ * @static
1002
+ * @memberOf _
1003
+ * @since 0.1.0
1004
+ * @category Function
1005
+ * @param {Function} func The function to restrict.
1006
+ * @returns {Function} Returns the new restricted function.
1007
+ * @example
1008
+ *
1009
+ * var initialize = _.once(createApplication);
1010
+ * initialize();
1011
+ * initialize();
1012
+ * // => `createApplication` is invoked once
1013
+ */
1014
+ function once(func) {
1015
+ return before(2, func);
1016
+ }
1017
+
1018
+ module.exports = once;
1019
+
1020
+
1021
+ /***/ }),
1022
+ /* 33 */
1023
+ /***/ (function(module, exports, __webpack_require__) {
1024
+
1025
+ var toInteger = __webpack_require__(34);
1026
+
1027
+ /** Error message constants. */
1028
+ var FUNC_ERROR_TEXT = 'Expected a function';
1029
+
1030
+ /**
1031
+ * Creates a function that invokes `func`, with the `this` binding and arguments
1032
+ * of the created function, while it's called less than `n` times. Subsequent
1033
+ * calls to the created function return the result of the last `func` invocation.
1034
+ *
1035
+ * @static
1036
+ * @memberOf _
1037
+ * @since 3.0.0
1038
+ * @category Function
1039
+ * @param {number} n The number of calls at which `func` is no longer invoked.
1040
+ * @param {Function} func The function to restrict.
1041
+ * @returns {Function} Returns the new restricted function.
1042
+ * @example
1043
+ *
1044
+ * jQuery(element).on('click', _.before(5, addContactToList));
1045
+ * // => Allows adding up to 4 contacts to the list.
1046
+ */
1047
+ function before(n, func) {
1048
+ var result;
1049
+ if (typeof func != 'function') {
1050
+ throw new TypeError(FUNC_ERROR_TEXT);
1051
+ }
1052
+ n = toInteger(n);
1053
+ return function() {
1054
+ if (--n > 0) {
1055
+ result = func.apply(this, arguments);
1056
+ }
1057
+ if (n <= 1) {
1058
+ func = undefined;
1059
+ }
1060
+ return result;
1061
+ };
1062
+ }
1063
+
1064
+ module.exports = before;
1065
+
1066
+
1067
+ /***/ }),
1068
+ /* 34 */
1069
+ /***/ (function(module, exports, __webpack_require__) {
1070
+
1071
+ var toFinite = __webpack_require__(35);
1072
+
1073
+ /**
1074
+ * Converts `value` to an integer.
1075
+ *
1076
+ * **Note:** This method is loosely based on
1077
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
1078
+ *
1079
+ * @static
1080
+ * @memberOf _
1081
+ * @since 4.0.0
1082
+ * @category Lang
1083
+ * @param {*} value The value to convert.
1084
+ * @returns {number} Returns the converted integer.
1085
+ * @example
1086
+ *
1087
+ * _.toInteger(3.2);
1088
+ * // => 3
1089
+ *
1090
+ * _.toInteger(Number.MIN_VALUE);
1091
+ * // => 0
1092
+ *
1093
+ * _.toInteger(Infinity);
1094
+ * // => 1.7976931348623157e+308
1095
+ *
1096
+ * _.toInteger('3.2');
1097
+ * // => 3
1098
+ */
1099
+ function toInteger(value) {
1100
+ var result = toFinite(value),
1101
+ remainder = result % 1;
1102
+
1103
+ return result === result ? (remainder ? result - remainder : result) : 0;
1104
+ }
1105
+
1106
+ module.exports = toInteger;
1107
+
1108
+
1109
+ /***/ }),
1110
+ /* 35 */
1111
+ /***/ (function(module, exports, __webpack_require__) {
1112
+
1113
+ var toNumber = __webpack_require__(22);
1114
+
1115
+ /** Used as references for various `Number` constants. */
1116
+ var INFINITY = 1 / 0,
1117
+ MAX_INTEGER = 1.7976931348623157e+308;
1118
+
1119
+ /**
1120
+ * Converts `value` to a finite number.
1121
+ *
1122
+ * @static
1123
+ * @memberOf _
1124
+ * @since 4.12.0
1125
+ * @category Lang
1126
+ * @param {*} value The value to convert.
1127
+ * @returns {number} Returns the converted number.
1128
+ * @example
1129
+ *
1130
+ * _.toFinite(3.2);
1131
+ * // => 3.2
1132
+ *
1133
+ * _.toFinite(Number.MIN_VALUE);
1134
+ * // => 5e-324
1135
+ *
1136
+ * _.toFinite(Infinity);
1137
+ * // => 1.7976931348623157e+308
1138
+ *
1139
+ * _.toFinite('3.2');
1140
+ * // => 3.2
1141
+ */
1142
+ function toFinite(value) {
1143
+ if (!value) {
1144
+ return value === 0 ? value : 0;
1145
+ }
1146
+ value = toNumber(value);
1147
+ if (value === INFINITY || value === -INFINITY) {
1148
+ var sign = (value < 0 ? -1 : 1);
1149
+ return sign * MAX_INTEGER;
1150
+ }
1151
+ return value === value ? value : 0;
1152
+ }
1153
+
1154
+ module.exports = toFinite;
1155
+
1156
+
1157
+ /***/ }),
1158
+ /* 36 */
1159
+ /***/ (function(module, exports) {
1160
+
1161
+ /**
1162
+ * This method returns the first argument it receives.
1163
+ *
1164
+ * @static
1165
+ * @since 0.1.0
1166
+ * @memberOf _
1167
+ * @category Util
1168
+ * @param {*} value Any value.
1169
+ * @returns {*} Returns `value`.
1170
+ * @example
1171
+ *
1172
+ * var object = { 'a': 1 };
1173
+ *
1174
+ * console.log(_.identity(object) === object);
1175
+ * // => true
1176
+ */
1177
+ function identity(value) {
1178
+ return value;
1179
+ }
1180
+
1181
+ module.exports = identity;
1182
+
1183
+
1184
+ /***/ }),
1185
+ /* 37 */
1186
+ /***/ (function(module, exports) {
1187
+
1188
+ /**
1189
+ * Creates a function that returns `value`.
1190
+ *
1191
+ * @static
1192
+ * @memberOf _
1193
+ * @since 2.4.0
1194
+ * @category Util
1195
+ * @param {*} value The value to return from the new function.
1196
+ * @returns {Function} Returns the new constant function.
1197
+ * @example
1198
+ *
1199
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
1200
+ *
1201
+ * console.log(objects);
1202
+ * // => [{ 'a': 1 }, { 'a': 1 }]
1203
+ *
1204
+ * console.log(objects[0] === objects[1]);
1205
+ * // => true
1206
+ */
1207
+ function constant(value) {
1208
+ return function() {
1209
+ return value;
1210
+ };
1211
+ }
1212
+
1213
+ module.exports = constant;
1214
+
1215
+
1216
+ /***/ }),
1217
+ /* 38 */
1218
+ /***/ (function(module, exports) {
1219
+
1220
+ /**
1221
+ * Gets the last element of `array`.
1222
+ *
1223
+ * @static
1224
+ * @memberOf _
1225
+ * @since 0.1.0
1226
+ * @category Array
1227
+ * @param {Array} array The array to query.
1228
+ * @returns {*} Returns the last element of `array`.
1229
+ * @example
1230
+ *
1231
+ * _.last([1, 2, 3]);
1232
+ * // => 3
1233
+ */
1234
+ function last(array) {
1235
+ var length = array == null ? 0 : array.length;
1236
+ return length ? array[length - 1] : undefined;
1237
+ }
1238
+
1239
+ module.exports = last;
1240
+
1241
+
1242
+ /***/ }),
1243
+ /* 39 */
1244
+ /***/ (function(module, exports) {
1245
+
1246
+ var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/
1247
+
1248
+ module.exports = function mergeJSXProps (objs) {
1249
+ return objs.reduce(function (a, b) {
1250
+ var aa, bb, key, nestedKey, temp
1251
+ for (key in b) {
1252
+ aa = a[key]
1253
+ bb = b[key]
1254
+ if (aa && nestRE.test(key)) {
1255
+ // normalize class
1256
+ if (key === 'class') {
1257
+ if (typeof aa === 'string') {
1258
+ temp = aa
1259
+ a[key] = aa = {}
1260
+ aa[temp] = true
1261
+ }
1262
+ if (typeof bb === 'string') {
1263
+ temp = bb
1264
+ b[key] = bb = {}
1265
+ bb[temp] = true
1266
+ }
1267
+ }
1268
+ if (key === 'on' || key === 'nativeOn' || key === 'hook') {
1269
+ // merge functions
1270
+ for (nestedKey in bb) {
1271
+ aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])
1272
+ }
1273
+ } else if (Array.isArray(aa)) {
1274
+ a[key] = aa.concat(bb)
1275
+ } else if (Array.isArray(bb)) {
1276
+ a[key] = [aa].concat(bb)
1277
+ } else {
1278
+ for (nestedKey in bb) {
1279
+ aa[nestedKey] = bb[nestedKey]
1280
+ }
1281
+ }
1282
+ } else {
1283
+ a[key] = b[key]
1284
+ }
1285
+ }
1286
+ return a
1287
+ }, {})
1288
+ }
1289
+
1290
+ function mergeFn (a, b) {
1291
+ return function () {
1292
+ a && a.apply(this, arguments)
1293
+ b && b.apply(this, arguments)
1294
+ }
1295
+ }
1296
+
1297
+
1298
+ /***/ }),
1299
+ /* 40 */
1300
+ /***/ (function(module, exports) {
1301
+
1302
+ module.exports = __WEBPACK_EXTERNAL_MODULE__40__;
1303
+
1304
+ /***/ }),
1305
+ /* 41 */
1306
+ /***/ (function(module, exports, __webpack_require__) {
1307
+
1308
+ // extracted by mini-css-extract-plugin
1309
+
1310
+ /***/ }),
1311
+ /* 42 */
1312
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1313
+
1314
+ "use strict";
1315
+ // ESM COMPAT FLAG
1316
+ __webpack_require__.r(__webpack_exports__);
1317
+
1318
+ // EXPORTS
1319
+ __webpack_require__.d(__webpack_exports__, "Treeselect", function() { return /* reexport */ Treeselect; });
1320
+ __webpack_require__.d(__webpack_exports__, "treeselectMixin", function() { return /* reexport */ treeselectMixin; });
1321
+ __webpack_require__.d(__webpack_exports__, "LOAD_ROOT_OPTIONS", function() { return /* reexport */ LOAD_ROOT_OPTIONS; });
1322
+ __webpack_require__.d(__webpack_exports__, "LOAD_CHILDREN_OPTIONS", function() { return /* reexport */ LOAD_CHILDREN_OPTIONS; });
1323
+ __webpack_require__.d(__webpack_exports__, "ASYNC_SEARCH", function() { return /* reexport */ ASYNC_SEARCH; });
1324
+ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return /* binding */ VERSION; });
1325
+
1326
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
1327
+ var slicedToArray = __webpack_require__(0);
1328
+ var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
1329
+
1330
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
1331
+ var toConsumableArray = __webpack_require__(6);
1332
+ var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
1333
+
1334
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
1335
+ var defineProperty = __webpack_require__(10);
1336
+ var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
1337
+
1338
+ // EXTERNAL MODULE: ./node_modules/fuzzysearch/index.js
1339
+ var fuzzysearch = __webpack_require__(14);
1340
+ var fuzzysearch_default = /*#__PURE__*/__webpack_require__.n(fuzzysearch);
1341
+
1342
+ // EXTERNAL MODULE: ./node_modules/lodash/noop.js
1343
+ var noop = __webpack_require__(15);
1344
+
1345
+ // CONCATENATED MODULE: ./src/utils/noop.js
1346
+
1347
+ // CONCATENATED MODULE: ./src/utils/warning.js
1348
+
1349
+
1350
+ var warning_warning = false ? undefined : function warning(checker, complainer) {
1351
+ if (!checker()) {
1352
+ var _console;
1353
+ var message = ['[Rp-Treeselect Warning]'].concat(complainer());
1354
+ (_console = console).error.apply(_console, toConsumableArray_default()(message));
1355
+ }
1356
+ };
1357
+ // CONCATENATED MODULE: ./src/utils/onLeftClick.js
1358
+ function onLeftClick(mouseDownHandler) {
1359
+ return function onMouseDown(evt) {
1360
+ if (evt.type === 'mousedown' && evt.button === 0) {
1361
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1362
+ args[_key - 1] = arguments[_key];
1363
+ }
1364
+ mouseDownHandler.call.apply(mouseDownHandler, [this, evt].concat(args));
1365
+ }
1366
+ };
1367
+ }
1368
+ // CONCATENATED MODULE: ./src/utils/scrollIntoView.js
1369
+ function scrollIntoView($scrollingEl, $focusedEl) {
1370
+ var scrollingReact = $scrollingEl.getBoundingClientRect();
1371
+ var focusedRect = $focusedEl.getBoundingClientRect();
1372
+ var overScroll = $focusedEl.offsetHeight / 3;
1373
+ if (focusedRect.bottom + overScroll > scrollingReact.bottom) {
1374
+ $scrollingEl.scrollTop = Math.min($focusedEl.offsetTop + $focusedEl.clientHeight - $scrollingEl.offsetHeight + overScroll, $scrollingEl.scrollHeight);
1375
+ } else if (focusedRect.top - overScroll < scrollingReact.top) {
1376
+ $scrollingEl.scrollTop = Math.max($focusedEl.offsetTop - overScroll, 0);
1377
+ }
1378
+ }
1379
+ // EXTERNAL MODULE: ./node_modules/lodash/debounce.js
1380
+ var debounce = __webpack_require__(16);
1381
+ var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce);
1382
+
1383
+ // CONCATENATED MODULE: ./src/utils/debounce.js
1384
+
1385
+ // CONCATENATED MODULE: ./node_modules/watch-size/index.es.mjs
1386
+ var index_es_index = (function (element, listener) {
1387
+ var expand = document.createElement('_');
1388
+ var shrink = expand.appendChild(document.createElement('_'));
1389
+ var expandChild = expand.appendChild(document.createElement('_'));
1390
+ var shrinkChild = shrink.appendChild(document.createElement('_'));
1391
+
1392
+ var lastWidth = void 0,
1393
+ lastHeight = void 0;
1394
+
1395
+ shrink.style.cssText = expand.style.cssText = 'height:100%;left:0;opacity:0;overflow:hidden;pointer-events:none;position:absolute;top:0;transition:0s;width:100%;z-index:-1';
1396
+ shrinkChild.style.cssText = expandChild.style.cssText = 'display:block;height:100%;transition:0s;width:100%';
1397
+ shrinkChild.style.width = shrinkChild.style.height = '200%';
1398
+
1399
+ element.appendChild(expand);
1400
+
1401
+ test();
1402
+
1403
+ return stop;
1404
+
1405
+ function test() {
1406
+ unbind();
1407
+
1408
+ var width = element.offsetWidth;
1409
+ var height = element.offsetHeight;
1410
+
1411
+ if (width !== lastWidth || height !== lastHeight) {
1412
+ lastWidth = width;
1413
+ lastHeight = height;
1414
+
1415
+ expandChild.style.width = width * 2 + 'px';
1416
+ expandChild.style.height = height * 2 + 'px';
1417
+
1418
+ expand.scrollLeft = expand.scrollWidth;
1419
+ expand.scrollTop = expand.scrollHeight;
1420
+ shrink.scrollLeft = shrink.scrollWidth;
1421
+ shrink.scrollTop = shrink.scrollHeight;
1422
+
1423
+ listener({ width: width, height: height });
1424
+ }
1425
+
1426
+ shrink.addEventListener('scroll', test);
1427
+ expand.addEventListener('scroll', test);
1428
+ }
1429
+
1430
+ function unbind() {
1431
+ shrink.removeEventListener('scroll', test);
1432
+ expand.removeEventListener('scroll', test);
1433
+ }
1434
+
1435
+ function stop() {
1436
+ unbind();
1437
+
1438
+ element.removeChild(expand);
1439
+ }
1440
+ });
1441
+
1442
+ /* harmony default export */ var index_es = (index_es_index);
1443
+
1444
+ // CONCATENATED MODULE: ./src/utils/removeFromArray.js
1445
+ function removeFromArray(arr, elem) {
1446
+ var idx = arr.indexOf(elem);
1447
+ if (idx !== -1) arr.splice(idx, 1);
1448
+ }
1449
+ // CONCATENATED MODULE: ./src/utils/watchSize.js
1450
+
1451
+
1452
+ var intervalId;
1453
+ var registered = [];
1454
+ var INTERVAL_DURATION = 100;
1455
+ function run() {
1456
+ intervalId = setInterval(function () {
1457
+ registered.forEach(test);
1458
+ }, INTERVAL_DURATION);
1459
+ }
1460
+ function stop() {
1461
+ clearInterval(intervalId);
1462
+ intervalId = null;
1463
+ }
1464
+ function test(item) {
1465
+ var $el = item.$el,
1466
+ listener = item.listener,
1467
+ lastWidth = item.lastWidth,
1468
+ lastHeight = item.lastHeight;
1469
+ var width = $el.offsetWidth;
1470
+ var height = $el.offsetHeight;
1471
+ if (lastWidth !== width || lastHeight !== height) {
1472
+ item.lastWidth = width;
1473
+ item.lastHeight = height;
1474
+ listener({
1475
+ width: width,
1476
+ height: height
1477
+ });
1478
+ }
1479
+ }
1480
+ function watchSizeForIE9($el, listener) {
1481
+ var item = {
1482
+ $el: $el,
1483
+ listener: listener,
1484
+ lastWidth: null,
1485
+ lastHeight: null
1486
+ };
1487
+ var unwatch = function unwatch() {
1488
+ removeFromArray(registered, item);
1489
+ if (!registered.length) stop();
1490
+ };
1491
+ registered.push(item);
1492
+ test(item);
1493
+ run();
1494
+ return unwatch;
1495
+ }
1496
+ function watchSize($el, listener) {
1497
+ var isIE9 = document.documentMode === 9;
1498
+ var locked = true;
1499
+ var wrappedListener = function wrappedListener() {
1500
+ return locked || listener.apply(void 0, arguments);
1501
+ };
1502
+ var implementation = isIE9 ? watchSizeForIE9 : index_es;
1503
+ var removeSizeWatcher = implementation($el, wrappedListener);
1504
+ locked = false;
1505
+ return removeSizeWatcher;
1506
+ }
1507
+ // CONCATENATED MODULE: ./src/utils/setupResizeAndScrollEventListeners.js
1508
+ function findScrollParents($el) {
1509
+ var $scrollParents = [];
1510
+ var $parent = $el.parentNode;
1511
+ while ($parent && $parent.nodeName !== 'BODY' && $parent.nodeType === document.ELEMENT_NODE) {
1512
+ if (isScrollElment($parent)) $scrollParents.push($parent);
1513
+ $parent = $parent.parentNode;
1514
+ }
1515
+ $scrollParents.push(window);
1516
+ return $scrollParents;
1517
+ }
1518
+ function isScrollElment($el) {
1519
+ var _getComputedStyle = getComputedStyle($el),
1520
+ overflow = _getComputedStyle.overflow,
1521
+ overflowX = _getComputedStyle.overflowX,
1522
+ overflowY = _getComputedStyle.overflowY;
1523
+ return /(auto|scroll|overlay)/.test(overflow + overflowY + overflowX);
1524
+ }
1525
+ function setupResizeAndScrollEventListeners($el, listener) {
1526
+ var $scrollParents = findScrollParents($el);
1527
+ window.addEventListener('resize', listener, {
1528
+ passive: true
1529
+ });
1530
+ $scrollParents.forEach(function (scrollParent) {
1531
+ scrollParent.addEventListener('scroll', listener, {
1532
+ passive: true
1533
+ });
1534
+ });
1535
+ return function removeEventListeners() {
1536
+ window.removeEventListener('resize', listener, {
1537
+ passive: true
1538
+ });
1539
+ $scrollParents.forEach(function ($scrollParent) {
1540
+ $scrollParent.removeEventListener('scroll', listener, {
1541
+ passive: true
1542
+ });
1543
+ });
1544
+ };
1545
+ }
1546
+ // CONCATENATED MODULE: ./src/utils/isNaN.js
1547
+ function isNaN_isNaN(x) {
1548
+ return x !== x;
1549
+ }
1550
+ // EXTERNAL MODULE: ./node_modules/is-promise/index.js
1551
+ var is_promise = __webpack_require__(31);
1552
+ var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise);
1553
+
1554
+ // CONCATENATED MODULE: ./src/utils/isPromise.js
1555
+
1556
+ // EXTERNAL MODULE: ./node_modules/lodash/once.js
1557
+ var once = __webpack_require__(32);
1558
+ var once_default = /*#__PURE__*/__webpack_require__.n(once);
1559
+
1560
+ // CONCATENATED MODULE: ./src/utils/once.js
1561
+
1562
+ // EXTERNAL MODULE: ./node_modules/lodash/identity.js
1563
+ var identity = __webpack_require__(36);
1564
+ var identity_default = /*#__PURE__*/__webpack_require__.n(identity);
1565
+
1566
+ // CONCATENATED MODULE: ./src/utils/identity.js
1567
+
1568
+ // EXTERNAL MODULE: ./node_modules/lodash/constant.js
1569
+ var constant = __webpack_require__(37);
1570
+ var constant_default = /*#__PURE__*/__webpack_require__.n(constant);
1571
+
1572
+ // CONCATENATED MODULE: ./src/utils/constant.js
1573
+
1574
+ // CONCATENATED MODULE: ./src/utils/createMap.js
1575
+ var createMap = function createMap() {
1576
+ return Object.create(null);
1577
+ };
1578
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
1579
+ var helpers_typeof = __webpack_require__(12);
1580
+ var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
1581
+
1582
+ // CONCATENATED MODULE: ./src/utils/deepExtend.js
1583
+
1584
+ function isPlainObject(value) {
1585
+ if (value == null || typeof_default()(value) !== 'object') return false;
1586
+ return Object.getPrototypeOf(value) === Object.prototype;
1587
+ }
1588
+ function copy(obj, key, value) {
1589
+ if (isPlainObject(value)) {
1590
+ obj[key] || (obj[key] = {});
1591
+ deepExtend(obj[key], value);
1592
+ } else {
1593
+ obj[key] = value;
1594
+ }
1595
+ }
1596
+ function deepExtend(target, source) {
1597
+ if (isPlainObject(source)) {
1598
+ var keys = Object.keys(source);
1599
+ for (var i = 0, len = keys.length; i < len; i++) {
1600
+ copy(target, keys[i], source[keys[i]]);
1601
+ }
1602
+ }
1603
+ return target;
1604
+ }
1605
+ // EXTERNAL MODULE: ./node_modules/lodash/last.js
1606
+ var lodash_last = __webpack_require__(38);
1607
+ var last_default = /*#__PURE__*/__webpack_require__.n(lodash_last);
1608
+
1609
+ // CONCATENATED MODULE: ./src/utils/last.js
1610
+
1611
+ // CONCATENATED MODULE: ./src/utils/includes.js
1612
+ function includes(arrOrStr, elem) {
1613
+ return arrOrStr.indexOf(elem) !== -1;
1614
+ }
1615
+ // CONCATENATED MODULE: ./src/utils/find.js
1616
+ function find(arr, predicate, ctx) {
1617
+ for (var i = 0, len = arr.length; i < len; i++) {
1618
+ if (predicate.call(ctx, arr[i], i, arr)) return arr[i];
1619
+ }
1620
+ return undefined;
1621
+ }
1622
+ // CONCATENATED MODULE: ./src/utils/quickDiff.js
1623
+ function quickDiff(arrA, arrB) {
1624
+ if (arrA.length !== arrB.length) return true;
1625
+ for (var i = 0; i < arrA.length; i++) {
1626
+ if (arrA[i] !== arrB[i]) return true;
1627
+ }
1628
+ return false;
1629
+ }
1630
+ // CONCATENATED MODULE: ./src/utils/index.js
1631
+
1632
+
1633
+
1634
+
1635
+
1636
+
1637
+
1638
+
1639
+
1640
+
1641
+
1642
+
1643
+
1644
+
1645
+
1646
+
1647
+
1648
+
1649
+
1650
+ // CONCATENATED MODULE: ./src/constants.js
1651
+ var NO_PARENT_NODE = null;
1652
+ var UNCHECKED = 0;
1653
+ var INDETERMINATE = 1;
1654
+ var CHECKED = 2;
1655
+ var ALL_CHILDREN = 'ALL_CHILDREN';
1656
+ var ALL_DESCENDANTS = 'ALL_DESCENDANTS';
1657
+ var LEAF_CHILDREN = 'LEAF_CHILDREN';
1658
+ var LEAF_DESCENDANTS = 'LEAF_DESCENDANTS';
1659
+ var LOAD_ROOT_OPTIONS = 'LOAD_ROOT_OPTIONS';
1660
+ var LOAD_CHILDREN_OPTIONS = 'LOAD_CHILDREN_OPTIONS';
1661
+ var ASYNC_SEARCH = 'ASYNC_SEARCH';
1662
+ var ALL = 'ALL';
1663
+ var BRANCH_PRIORITY = 'BRANCH_PRIORITY';
1664
+ var LEAF_PRIORITY = 'LEAF_PRIORITY';
1665
+ var ALL_WITH_INDETERMINATE = 'ALL_WITH_INDETERMINATE';
1666
+ var ORDER_SELECTED = 'ORDER_SELECTED';
1667
+ var LEVEL = 'LEVEL';
1668
+ var INDEX = 'INDEX';
1669
+ var KEY_CODES = {
1670
+ BACKSPACE: 8,
1671
+ ENTER: 13,
1672
+ ESCAPE: 27,
1673
+ END: 35,
1674
+ HOME: 36,
1675
+ ARROW_LEFT: 37,
1676
+ ARROW_UP: 38,
1677
+ ARROW_RIGHT: 39,
1678
+ ARROW_DOWN: 40,
1679
+ DELETE: 46
1680
+ };
1681
+ var INPUT_DEBOUNCE_DELAY = false ? undefined : 200;
1682
+ var MIN_INPUT_WIDTH = 5;
1683
+ var MENU_BUFFER = 40;
1684
+ // CONCATENATED MODULE: ./src/mixins/treeselectMixin.js
1685
+
1686
+
1687
+
1688
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1689
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { defineProperty_default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1690
+
1691
+
1692
+
1693
+ function sortValueByIndex(a, b) {
1694
+ var i = 0;
1695
+ do {
1696
+ if (a.level < i) return -1;
1697
+ if (b.level < i) return 1;
1698
+ if (a.index[i] !== b.index[i]) return a.index[i] - b.index[i];
1699
+ i++;
1700
+ } while (true);
1701
+ }
1702
+ function sortValueByLevel(a, b) {
1703
+ return a.level === b.level ? sortValueByIndex(a, b) : a.level - b.level;
1704
+ }
1705
+ function createAsyncOptionsStates() {
1706
+ return {
1707
+ isLoaded: false,
1708
+ isLoading: false,
1709
+ loadingError: ''
1710
+ };
1711
+ }
1712
+ function stringifyOptionPropValue(value) {
1713
+ if (typeof value === 'string') return value;
1714
+ if (typeof value === 'number' && !isNaN_isNaN(value)) return value + '';
1715
+ return '';
1716
+ }
1717
+ function match(enableFuzzyMatch, needle, haystack) {
1718
+ return enableFuzzyMatch ? fuzzysearch_default()(needle, haystack) : includes(haystack, needle);
1719
+ }
1720
+ function getErrorMessage(err) {
1721
+ return err.message || String(err);
1722
+ }
1723
+ var instanceId = 0;
1724
+ /* harmony default export */ var treeselectMixin = ({
1725
+ provide: function provide() {
1726
+ return {
1727
+ instance: this
1728
+ };
1729
+ },
1730
+ props: {
1731
+ allowClearingDisabled: {
1732
+ type: Boolean,
1733
+ default: false
1734
+ },
1735
+ allowSelectingDisabledDescendants: {
1736
+ type: Boolean,
1737
+ default: false
1738
+ },
1739
+ alwaysOpen: {
1740
+ type: Boolean,
1741
+ default: false
1742
+ },
1743
+ appendToBody: {
1744
+ type: Boolean,
1745
+ default: false
1746
+ },
1747
+ async: {
1748
+ type: Boolean,
1749
+ default: false
1750
+ },
1751
+ autoFocus: {
1752
+ type: Boolean,
1753
+ default: false
1754
+ },
1755
+ autoLoadRootOptions: {
1756
+ type: Boolean,
1757
+ default: true
1758
+ },
1759
+ autoDeselectAncestors: {
1760
+ type: Boolean,
1761
+ default: false
1762
+ },
1763
+ autoDeselectDescendants: {
1764
+ type: Boolean,
1765
+ default: false
1766
+ },
1767
+ autoSelectAncestors: {
1768
+ type: Boolean,
1769
+ default: false
1770
+ },
1771
+ autoSelectDescendants: {
1772
+ type: Boolean,
1773
+ default: false
1774
+ },
1775
+ backspaceRemoves: {
1776
+ type: Boolean,
1777
+ default: true
1778
+ },
1779
+ beforeClearAll: {
1780
+ type: Function,
1781
+ default: constant_default()(true)
1782
+ },
1783
+ branchNodesFirst: {
1784
+ type: Boolean,
1785
+ default: false
1786
+ },
1787
+ cacheOptions: {
1788
+ type: Boolean,
1789
+ default: true
1790
+ },
1791
+ clearable: {
1792
+ type: Boolean,
1793
+ default: true
1794
+ },
1795
+ clearAllText: {
1796
+ type: String,
1797
+ default: 'Clear all'
1798
+ },
1799
+ clearOnSelect: {
1800
+ type: Boolean,
1801
+ default: false
1802
+ },
1803
+ clearValueText: {
1804
+ type: String,
1805
+ default: 'Clear value'
1806
+ },
1807
+ closeOnSelect: {
1808
+ type: Boolean,
1809
+ default: true
1810
+ },
1811
+ defaultExpandLevel: {
1812
+ type: Number,
1813
+ default: 0
1814
+ },
1815
+ defaultOptions: {
1816
+ default: false
1817
+ },
1818
+ deleteRemoves: {
1819
+ type: Boolean,
1820
+ default: true
1821
+ },
1822
+ delimiter: {
1823
+ type: String,
1824
+ default: ','
1825
+ },
1826
+ flattenSearchResults: {
1827
+ type: Boolean,
1828
+ default: false
1829
+ },
1830
+ disableBranchNodes: {
1831
+ type: Boolean,
1832
+ default: false
1833
+ },
1834
+ disabled: {
1835
+ type: Boolean,
1836
+ default: false
1837
+ },
1838
+ disableFuzzyMatching: {
1839
+ type: Boolean,
1840
+ default: false
1841
+ },
1842
+ flat: {
1843
+ type: Boolean,
1844
+ default: false
1845
+ },
1846
+ instanceId: {
1847
+ default: function _default() {
1848
+ return "".concat(instanceId++, "$$");
1849
+ },
1850
+ type: [String, Number]
1851
+ },
1852
+ joinValues: {
1853
+ type: Boolean,
1854
+ default: false
1855
+ },
1856
+ limit: {
1857
+ type: Number,
1858
+ default: Infinity
1859
+ },
1860
+ limitText: {
1861
+ type: Function,
1862
+ default: function limitTextDefault(count) {
1863
+ return "and ".concat(count, " more");
1864
+ }
1865
+ },
1866
+ loadingText: {
1867
+ type: String,
1868
+ default: 'Loading...'
1869
+ },
1870
+ loadOptions: {
1871
+ type: Function
1872
+ },
1873
+ matchKeys: {
1874
+ type: Array,
1875
+ default: constant_default()(['label'])
1876
+ },
1877
+ maxHeight: {
1878
+ type: Number,
1879
+ default: 300
1880
+ },
1881
+ multiple: {
1882
+ type: Boolean,
1883
+ default: false
1884
+ },
1885
+ name: {
1886
+ type: String
1887
+ },
1888
+ noChildrenText: {
1889
+ type: String,
1890
+ default: 'No sub-options.'
1891
+ },
1892
+ noOptionsText: {
1893
+ type: String,
1894
+ default: 'No options available.'
1895
+ },
1896
+ noResultsText: {
1897
+ type: String,
1898
+ default: 'No results found...'
1899
+ },
1900
+ normalizer: {
1901
+ type: Function,
1902
+ default: identity_default.a
1903
+ },
1904
+ openDirection: {
1905
+ type: String,
1906
+ default: 'auto',
1907
+ validator: function validator(value) {
1908
+ var acceptableValues = ['auto', 'top', 'bottom', 'above', 'below'];
1909
+ return includes(acceptableValues, value);
1910
+ }
1911
+ },
1912
+ openOnClick: {
1913
+ type: Boolean,
1914
+ default: true
1915
+ },
1916
+ openOnFocus: {
1917
+ type: Boolean,
1918
+ default: false
1919
+ },
1920
+ options: {
1921
+ type: Array
1922
+ },
1923
+ placeholder: {
1924
+ type: String,
1925
+ default: 'Select...'
1926
+ },
1927
+ required: {
1928
+ type: Boolean,
1929
+ default: false
1930
+ },
1931
+ retryText: {
1932
+ type: String,
1933
+ default: 'Retry?'
1934
+ },
1935
+ retryTitle: {
1936
+ type: String,
1937
+ default: 'Click to retry'
1938
+ },
1939
+ searchable: {
1940
+ type: Boolean,
1941
+ default: true
1942
+ },
1943
+ searchNested: {
1944
+ type: Boolean,
1945
+ default: false
1946
+ },
1947
+ searchPromptText: {
1948
+ type: String,
1949
+ default: 'Type to search...'
1950
+ },
1951
+ showCount: {
1952
+ type: Boolean,
1953
+ default: false
1954
+ },
1955
+ showCountOf: {
1956
+ type: String,
1957
+ default: ALL_CHILDREN,
1958
+ validator: function validator(value) {
1959
+ var acceptableValues = [ALL_CHILDREN, ALL_DESCENDANTS, LEAF_CHILDREN, LEAF_DESCENDANTS];
1960
+ return includes(acceptableValues, value);
1961
+ }
1962
+ },
1963
+ showCountOnSearch: null,
1964
+ sortValueBy: {
1965
+ type: String,
1966
+ default: ORDER_SELECTED,
1967
+ validator: function validator(value) {
1968
+ var acceptableValues = [ORDER_SELECTED, LEVEL, INDEX];
1969
+ return includes(acceptableValues, value);
1970
+ }
1971
+ },
1972
+ tabIndex: {
1973
+ type: Number,
1974
+ default: 0
1975
+ },
1976
+ value: null,
1977
+ valueConsistsOf: {
1978
+ type: String,
1979
+ default: BRANCH_PRIORITY,
1980
+ validator: function validator(value) {
1981
+ var acceptableValues = [ALL, BRANCH_PRIORITY, LEAF_PRIORITY, ALL_WITH_INDETERMINATE];
1982
+ return includes(acceptableValues, value);
1983
+ }
1984
+ },
1985
+ valueFormat: {
1986
+ type: String,
1987
+ default: 'id'
1988
+ },
1989
+ zIndex: {
1990
+ type: [Number, String],
1991
+ default: 999
1992
+ }
1993
+ },
1994
+ data: function data() {
1995
+ return {
1996
+ trigger: {
1997
+ isFocused: false,
1998
+ searchQuery: ''
1999
+ },
2000
+ menu: {
2001
+ isOpen: false,
2002
+ current: null,
2003
+ lastScrollPosition: 0,
2004
+ placement: 'bottom'
2005
+ },
2006
+ forest: {
2007
+ normalizedOptions: [],
2008
+ nodeMap: createMap(),
2009
+ checkedStateMap: createMap(),
2010
+ selectedNodeIds: this.extractCheckedNodeIdsFromValue(),
2011
+ selectedNodeMap: createMap()
2012
+ },
2013
+ rootOptionsStates: createAsyncOptionsStates(),
2014
+ localSearch: {
2015
+ active: false,
2016
+ noResults: true,
2017
+ countMap: createMap()
2018
+ },
2019
+ remoteSearch: createMap()
2020
+ };
2021
+ },
2022
+ computed: {
2023
+ selectedNodes: function selectedNodes() {
2024
+ return this.forest.selectedNodeIds.map(this.getNode);
2025
+ },
2026
+ internalValue: function internalValue() {
2027
+ var _this = this;
2028
+ var internalValue;
2029
+ if (this.single || this.flat || this.disableBranchNodes || this.valueConsistsOf === ALL) {
2030
+ internalValue = this.forest.selectedNodeIds.slice();
2031
+ } else if (this.valueConsistsOf === BRANCH_PRIORITY) {
2032
+ internalValue = this.forest.selectedNodeIds.filter(function (id) {
2033
+ var node = _this.getNode(id);
2034
+ if (node.isRootNode) return true;
2035
+ return !_this.isSelected(node.parentNode);
2036
+ });
2037
+ } else if (this.valueConsistsOf === LEAF_PRIORITY) {
2038
+ internalValue = this.forest.selectedNodeIds.filter(function (id) {
2039
+ var node = _this.getNode(id);
2040
+ if (node.isLeaf) return true;
2041
+ return node.children.length === 0;
2042
+ });
2043
+ } else if (this.valueConsistsOf === ALL_WITH_INDETERMINATE) {
2044
+ var _internalValue;
2045
+ var indeterminateNodeIds = [];
2046
+ internalValue = this.forest.selectedNodeIds.slice();
2047
+ this.selectedNodes.forEach(function (selectedNode) {
2048
+ selectedNode.ancestors.forEach(function (ancestor) {
2049
+ if (includes(indeterminateNodeIds, ancestor.id)) return;
2050
+ if (includes(internalValue, ancestor.id)) return;
2051
+ indeterminateNodeIds.push(ancestor.id);
2052
+ });
2053
+ });
2054
+ (_internalValue = internalValue).push.apply(_internalValue, indeterminateNodeIds);
2055
+ }
2056
+ if (this.sortValueBy === LEVEL) {
2057
+ internalValue.sort(function (a, b) {
2058
+ return sortValueByLevel(_this.getNode(a), _this.getNode(b));
2059
+ });
2060
+ } else if (this.sortValueBy === INDEX) {
2061
+ internalValue.sort(function (a, b) {
2062
+ return sortValueByIndex(_this.getNode(a), _this.getNode(b));
2063
+ });
2064
+ }
2065
+ return internalValue;
2066
+ },
2067
+ hasValue: function hasValue() {
2068
+ return this.internalValue.length > 0;
2069
+ },
2070
+ single: function single() {
2071
+ return !this.multiple;
2072
+ },
2073
+ visibleOptionIds: function visibleOptionIds() {
2074
+ var _this2 = this;
2075
+ var visibleOptionIds = [];
2076
+ this.traverseAllNodesByIndex(function (node) {
2077
+ if (!_this2.localSearch.active || _this2.shouldOptionBeIncludedInSearchResult(node)) {
2078
+ visibleOptionIds.push(node.id);
2079
+ }
2080
+ if (node.isBranch && !_this2.shouldExpand(node)) {
2081
+ return false;
2082
+ }
2083
+ });
2084
+ return visibleOptionIds;
2085
+ },
2086
+ hasVisibleOptions: function hasVisibleOptions() {
2087
+ return this.visibleOptionIds.length !== 0;
2088
+ },
2089
+ showCountOnSearchComputed: function showCountOnSearchComputed() {
2090
+ return typeof this.showCountOnSearch === 'boolean' ? this.showCountOnSearch : this.showCount;
2091
+ },
2092
+ hasBranchNodes: function hasBranchNodes() {
2093
+ return this.forest.normalizedOptions.some(function (rootNode) {
2094
+ return rootNode.isBranch;
2095
+ });
2096
+ },
2097
+ shouldFlattenOptions: function shouldFlattenOptions() {
2098
+ return this.localSearch.active && this.flattenSearchResults;
2099
+ }
2100
+ },
2101
+ watch: {
2102
+ alwaysOpen: function alwaysOpen(newValue) {
2103
+ if (newValue) this.openMenu();else this.closeMenu();
2104
+ },
2105
+ branchNodesFirst: function branchNodesFirst() {
2106
+ this.initialize();
2107
+ },
2108
+ disabled: function disabled(newValue) {
2109
+ if (newValue && this.menu.isOpen) this.closeMenu();else if (!newValue && !this.menu.isOpen && this.alwaysOpen) this.openMenu();
2110
+ },
2111
+ flat: function flat() {
2112
+ this.initialize();
2113
+ },
2114
+ internalValue: function internalValue(newValue, oldValue) {
2115
+ var hasChanged = quickDiff(newValue, oldValue);
2116
+ if (hasChanged) this.$emit('input', this.getValue(), this.getInstanceId());
2117
+ },
2118
+ matchKeys: function matchKeys() {
2119
+ this.initialize();
2120
+ },
2121
+ multiple: function multiple(newValue) {
2122
+ if (newValue) this.buildForestState();
2123
+ },
2124
+ options: {
2125
+ handler: function handler() {
2126
+ if (this.async) return;
2127
+ this.initialize();
2128
+ this.rootOptionsStates.isLoaded = Array.isArray(this.options);
2129
+ },
2130
+ deep: true,
2131
+ immediate: true
2132
+ },
2133
+ 'trigger.searchQuery': function triggerSearchQuery() {
2134
+ if (this.async) {
2135
+ this.handleRemoteSearch();
2136
+ } else {
2137
+ this.handleLocalSearch();
2138
+ }
2139
+ this.$emit('search-change', this.trigger.searchQuery, this.getInstanceId());
2140
+ },
2141
+ value: function value() {
2142
+ var nodeIdsFromValue = this.extractCheckedNodeIdsFromValue();
2143
+ var hasChanged = quickDiff(nodeIdsFromValue, this.internalValue);
2144
+ if (hasChanged) this.fixSelectedNodeIds(nodeIdsFromValue);
2145
+ }
2146
+ },
2147
+ methods: {
2148
+ verifyProps: function verifyProps() {
2149
+ var _this3 = this;
2150
+ warning_warning(function () {
2151
+ return _this3.async ? _this3.searchable : true;
2152
+ }, function () {
2153
+ return 'For async search mode, the value of "searchable" prop must be true.';
2154
+ });
2155
+ if (this.options == null && !this.loadOptions) {
2156
+ warning_warning(function () {
2157
+ return false;
2158
+ }, function () {
2159
+ return 'Are you meant to dynamically load options? You need to use "loadOptions" prop.';
2160
+ });
2161
+ }
2162
+ if (this.flat) {
2163
+ warning_warning(function () {
2164
+ return _this3.multiple;
2165
+ }, function () {
2166
+ return 'You are using flat mode. But you forgot to add "multiple=true"?';
2167
+ });
2168
+ }
2169
+ if (!this.flat) {
2170
+ var propNames = ['autoSelectAncestors', 'autoSelectDescendants', 'autoDeselectAncestors', 'autoDeselectDescendants'];
2171
+ propNames.forEach(function (propName) {
2172
+ warning_warning(function () {
2173
+ return !_this3[propName];
2174
+ }, function () {
2175
+ return "\"".concat(propName, "\" only applies to flat mode.");
2176
+ });
2177
+ });
2178
+ }
2179
+ },
2180
+ resetFlags: function resetFlags() {
2181
+ this._blurOnSelect = false;
2182
+ },
2183
+ initialize: function initialize() {
2184
+ var options = this.async ? this.getRemoteSearchEntry().options : this.options;
2185
+ if (Array.isArray(options)) {
2186
+ var prevNodeMap = this.forest.nodeMap;
2187
+ this.forest.nodeMap = createMap();
2188
+ this.keepDataOfSelectedNodes(prevNodeMap);
2189
+ this.forest.normalizedOptions = this.normalize(NO_PARENT_NODE, options, prevNodeMap);
2190
+ this.fixSelectedNodeIds(this.internalValue);
2191
+ } else {
2192
+ this.forest.normalizedOptions = [];
2193
+ }
2194
+ },
2195
+ getInstanceId: function getInstanceId() {
2196
+ return this.instanceId == null ? this.id : this.instanceId;
2197
+ },
2198
+ getValue: function getValue() {
2199
+ var _this4 = this;
2200
+ if (this.valueFormat === 'id') {
2201
+ return this.multiple ? this.internalValue.slice() : this.internalValue[0];
2202
+ }
2203
+ var rawNodes = this.internalValue.map(function (id) {
2204
+ return _this4.getNode(id).raw;
2205
+ });
2206
+ return this.multiple ? rawNodes : rawNodes[0];
2207
+ },
2208
+ getNode: function getNode(nodeId) {
2209
+ warning_warning(function () {
2210
+ return nodeId != null;
2211
+ }, function () {
2212
+ return "Invalid node id: ".concat(nodeId);
2213
+ });
2214
+ if (nodeId == null) return null;
2215
+ return nodeId in this.forest.nodeMap ? this.forest.nodeMap[nodeId] : this.createFallbackNode(nodeId);
2216
+ },
2217
+ createFallbackNode: function createFallbackNode(id) {
2218
+ var raw = this.extractNodeFromValue(id);
2219
+ var label = this.enhancedNormalizer(raw).label || "".concat(id, " (unknown)");
2220
+ var fallbackNode = {
2221
+ id: id,
2222
+ label: label,
2223
+ ancestors: [],
2224
+ parentNode: NO_PARENT_NODE,
2225
+ isFallbackNode: true,
2226
+ isRootNode: true,
2227
+ isLeaf: true,
2228
+ isBranch: false,
2229
+ isDisabled: false,
2230
+ isNew: false,
2231
+ index: [-1],
2232
+ level: 0,
2233
+ raw: raw
2234
+ };
2235
+ return this.$set(this.forest.nodeMap, id, fallbackNode);
2236
+ },
2237
+ extractCheckedNodeIdsFromValue: function extractCheckedNodeIdsFromValue() {
2238
+ var _this5 = this;
2239
+ if (this.value == null) return [];
2240
+ if (this.valueFormat === 'id') {
2241
+ return this.multiple ? this.value.slice() : [this.value];
2242
+ }
2243
+ return (this.multiple ? this.value : [this.value]).map(function (node) {
2244
+ return _this5.enhancedNormalizer(node);
2245
+ }).map(function (node) {
2246
+ return node.id;
2247
+ });
2248
+ },
2249
+ extractNodeFromValue: function extractNodeFromValue(id) {
2250
+ var _this6 = this;
2251
+ var defaultNode = {
2252
+ id: id
2253
+ };
2254
+ if (this.valueFormat === 'id') {
2255
+ return defaultNode;
2256
+ }
2257
+ var valueArray = this.multiple ? Array.isArray(this.value) ? this.value : [] : this.value ? [this.value] : [];
2258
+ var matched = find(valueArray, function (node) {
2259
+ return node && _this6.enhancedNormalizer(node).id === id;
2260
+ });
2261
+ return matched || defaultNode;
2262
+ },
2263
+ fixSelectedNodeIds: function fixSelectedNodeIds(nodeIdListOfPrevValue) {
2264
+ var _this7 = this;
2265
+ var nextSelectedNodeIds = [];
2266
+ if (this.single || this.flat || this.disableBranchNodes || this.valueConsistsOf === ALL) {
2267
+ nextSelectedNodeIds = nodeIdListOfPrevValue;
2268
+ } else if (this.valueConsistsOf === BRANCH_PRIORITY) {
2269
+ nodeIdListOfPrevValue.forEach(function (nodeId) {
2270
+ nextSelectedNodeIds.push(nodeId);
2271
+ var node = _this7.getNode(nodeId);
2272
+ if (node.isBranch) _this7.traverseDescendantsBFS(node, function (descendant) {
2273
+ nextSelectedNodeIds.push(descendant.id);
2274
+ });
2275
+ });
2276
+ } else if (this.valueConsistsOf === LEAF_PRIORITY) {
2277
+ var map = createMap();
2278
+ var queue = nodeIdListOfPrevValue.slice();
2279
+ while (queue.length) {
2280
+ var nodeId = queue.shift();
2281
+ var node = this.getNode(nodeId);
2282
+ nextSelectedNodeIds.push(nodeId);
2283
+ if (node.isRootNode) continue;
2284
+ if (!(node.parentNode.id in map)) map[node.parentNode.id] = node.parentNode.children.length;
2285
+ if (--map[node.parentNode.id] === 0) queue.push(node.parentNode.id);
2286
+ }
2287
+ } else if (this.valueConsistsOf === ALL_WITH_INDETERMINATE) {
2288
+ var _map = createMap();
2289
+ var _queue = nodeIdListOfPrevValue.filter(function (nodeId) {
2290
+ var node = _this7.getNode(nodeId);
2291
+ return node.isLeaf || node.children.length === 0;
2292
+ });
2293
+ while (_queue.length) {
2294
+ var _nodeId = _queue.shift();
2295
+ var _node = this.getNode(_nodeId);
2296
+ nextSelectedNodeIds.push(_nodeId);
2297
+ if (_node.isRootNode) continue;
2298
+ if (!(_node.parentNode.id in _map)) _map[_node.parentNode.id] = _node.parentNode.children.length;
2299
+ if (--_map[_node.parentNode.id] === 0) _queue.push(_node.parentNode.id);
2300
+ }
2301
+ }
2302
+ var hasChanged = quickDiff(this.forest.selectedNodeIds, nextSelectedNodeIds);
2303
+ if (hasChanged) this.forest.selectedNodeIds = nextSelectedNodeIds;
2304
+ this.buildForestState();
2305
+ },
2306
+ keepDataOfSelectedNodes: function keepDataOfSelectedNodes(prevNodeMap) {
2307
+ var _this8 = this;
2308
+ this.forest.selectedNodeIds.forEach(function (id) {
2309
+ if (!prevNodeMap[id]) return;
2310
+ var node = _objectSpread(_objectSpread({}, prevNodeMap[id]), {}, {
2311
+ isFallbackNode: true
2312
+ });
2313
+ _this8.$set(_this8.forest.nodeMap, id, node);
2314
+ });
2315
+ },
2316
+ isSelected: function isSelected(node) {
2317
+ return this.forest.selectedNodeMap[node.id] === true;
2318
+ },
2319
+ traverseDescendantsBFS: function traverseDescendantsBFS(parentNode, callback) {
2320
+ if (!parentNode.isBranch) return;
2321
+ var queue = parentNode.children.slice();
2322
+ while (queue.length) {
2323
+ var currNode = queue[0];
2324
+ if (currNode.isBranch) queue.push.apply(queue, toConsumableArray_default()(currNode.children));
2325
+ callback(currNode);
2326
+ queue.shift();
2327
+ }
2328
+ },
2329
+ traverseDescendantsDFS: function traverseDescendantsDFS(parentNode, callback) {
2330
+ var _this9 = this;
2331
+ if (!parentNode.isBranch) return;
2332
+ parentNode.children.forEach(function (child) {
2333
+ _this9.traverseDescendantsDFS(child, callback);
2334
+ callback(child);
2335
+ });
2336
+ },
2337
+ traverseAllNodesDFS: function traverseAllNodesDFS(callback) {
2338
+ var _this10 = this;
2339
+ this.forest.normalizedOptions.forEach(function (rootNode) {
2340
+ _this10.traverseDescendantsDFS(rootNode, callback);
2341
+ callback(rootNode);
2342
+ });
2343
+ },
2344
+ traverseAllNodesByIndex: function traverseAllNodesByIndex(callback) {
2345
+ var walk = function walk(parentNode) {
2346
+ parentNode.children.forEach(function (child) {
2347
+ if (callback(child) !== false && child.isBranch) {
2348
+ walk(child);
2349
+ }
2350
+ });
2351
+ };
2352
+ walk({
2353
+ children: this.forest.normalizedOptions
2354
+ });
2355
+ },
2356
+ toggleClickOutsideEvent: function toggleClickOutsideEvent(enabled) {
2357
+ if (enabled) {
2358
+ document.addEventListener('mousedown', this.handleClickOutside, false);
2359
+ } else {
2360
+ document.removeEventListener('mousedown', this.handleClickOutside, false);
2361
+ }
2362
+ },
2363
+ getValueContainer: function getValueContainer() {
2364
+ return this.$refs.control.$refs['value-container'];
2365
+ },
2366
+ getInput: function getInput() {
2367
+ return this.getValueContainer().$refs.input;
2368
+ },
2369
+ focusInput: function focusInput() {
2370
+ this.getInput().focus();
2371
+ },
2372
+ blurInput: function blurInput() {
2373
+ this.getInput().blur();
2374
+ },
2375
+ handleMouseDown: onLeftClick(function handleMouseDown(evt) {
2376
+ evt.preventDefault();
2377
+ evt.stopPropagation();
2378
+ if (this.disabled) return;
2379
+ var isClickedOnValueContainer = this.getValueContainer().$el.contains(evt.target);
2380
+ if (isClickedOnValueContainer && !this.menu.isOpen && (this.openOnClick || this.trigger.isFocused)) {
2381
+ this.openMenu();
2382
+ }
2383
+ if (this._blurOnSelect) {
2384
+ this.blurInput();
2385
+ } else {
2386
+ this.focusInput();
2387
+ }
2388
+ this.resetFlags();
2389
+ }),
2390
+ handleClickOutside: function handleClickOutside(evt) {
2391
+ if (this.$refs.wrapper && !this.$refs.wrapper.contains(evt.target)) {
2392
+ this.blurInput();
2393
+ this.closeMenu();
2394
+ }
2395
+ },
2396
+ handleLocalSearch: function handleLocalSearch() {
2397
+ var _this11 = this;
2398
+ var searchQuery = this.trigger.searchQuery;
2399
+ var done = function done() {
2400
+ return _this11.resetHighlightedOptionWhenNecessary(true);
2401
+ };
2402
+ if (!searchQuery) {
2403
+ this.localSearch.active = false;
2404
+ return done();
2405
+ }
2406
+ this.localSearch.active = true;
2407
+ this.localSearch.noResults = true;
2408
+ this.traverseAllNodesDFS(function (node) {
2409
+ if (node.isBranch) {
2410
+ node.isExpandedOnSearch = false;
2411
+ node.showAllChildrenOnSearch = false;
2412
+ node.isMatched = false;
2413
+ node.hasMatchedDescendants = false;
2414
+ _this11.$set(_this11.localSearch.countMap, node.id, defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, ALL_CHILDREN, 0), ALL_DESCENDANTS, 0), LEAF_CHILDREN, 0), LEAF_DESCENDANTS, 0));
2415
+ }
2416
+ });
2417
+ var lowerCasedSearchQuery = searchQuery.trim().toLocaleLowerCase();
2418
+ var splitSearchQuery = lowerCasedSearchQuery.replace(/\s+/g, ' ').split(' ');
2419
+ this.traverseAllNodesDFS(function (node) {
2420
+ if (_this11.searchNested && splitSearchQuery.length > 1) {
2421
+ node.isMatched = splitSearchQuery.every(function (filterValue) {
2422
+ return match(false, filterValue, node.nestedSearchLabel);
2423
+ });
2424
+ } else {
2425
+ node.isMatched = _this11.matchKeys.some(function (matchKey) {
2426
+ return match(!_this11.disableFuzzyMatching, lowerCasedSearchQuery, node.lowerCased[matchKey]);
2427
+ });
2428
+ }
2429
+ if (node.isMatched) {
2430
+ _this11.localSearch.noResults = false;
2431
+ node.ancestors.forEach(function (ancestor) {
2432
+ return _this11.localSearch.countMap[ancestor.id][ALL_DESCENDANTS]++;
2433
+ });
2434
+ if (node.isLeaf) node.ancestors.forEach(function (ancestor) {
2435
+ return _this11.localSearch.countMap[ancestor.id][LEAF_DESCENDANTS]++;
2436
+ });
2437
+ if (node.parentNode !== NO_PARENT_NODE) {
2438
+ _this11.localSearch.countMap[node.parentNode.id][ALL_CHILDREN] += 1;
2439
+ if (node.isLeaf) _this11.localSearch.countMap[node.parentNode.id][LEAF_CHILDREN] += 1;
2440
+ }
2441
+ }
2442
+ if ((node.isMatched || node.isBranch && node.isExpandedOnSearch) && node.parentNode !== NO_PARENT_NODE) {
2443
+ node.parentNode.isExpandedOnSearch = true;
2444
+ node.parentNode.hasMatchedDescendants = true;
2445
+ }
2446
+ });
2447
+ done();
2448
+ },
2449
+ handleRemoteSearch: function handleRemoteSearch() {
2450
+ var _this12 = this;
2451
+ var searchQuery = this.trigger.searchQuery;
2452
+ var entry = this.getRemoteSearchEntry();
2453
+ var done = function done() {
2454
+ _this12.initialize();
2455
+ _this12.resetHighlightedOptionWhenNecessary(true);
2456
+ };
2457
+ if ((searchQuery === '' || this.cacheOptions) && entry.isLoaded) {
2458
+ return done();
2459
+ }
2460
+ this.callLoadOptionsProp({
2461
+ action: ASYNC_SEARCH,
2462
+ args: {
2463
+ searchQuery: searchQuery
2464
+ },
2465
+ isPending: function isPending() {
2466
+ return entry.isLoading;
2467
+ },
2468
+ start: function start() {
2469
+ entry.isLoading = true;
2470
+ entry.isLoaded = false;
2471
+ entry.loadingError = '';
2472
+ },
2473
+ succeed: function succeed(options) {
2474
+ entry.isLoaded = true;
2475
+ entry.options = options;
2476
+ if (_this12.trigger.searchQuery === searchQuery) done();
2477
+ },
2478
+ fail: function fail(err) {
2479
+ entry.loadingError = getErrorMessage(err);
2480
+ },
2481
+ end: function end() {
2482
+ entry.isLoading = false;
2483
+ }
2484
+ });
2485
+ },
2486
+ getRemoteSearchEntry: function getRemoteSearchEntry() {
2487
+ var _this13 = this;
2488
+ var searchQuery = this.trigger.searchQuery;
2489
+ var entry = this.remoteSearch[searchQuery] || _objectSpread(_objectSpread({}, createAsyncOptionsStates()), {}, {
2490
+ options: []
2491
+ });
2492
+ this.$watch(function () {
2493
+ return entry.options;
2494
+ }, function () {
2495
+ if (_this13.trigger.searchQuery === searchQuery) _this13.initialize();
2496
+ }, {
2497
+ deep: true
2498
+ });
2499
+ if (searchQuery === '') {
2500
+ if (Array.isArray(this.defaultOptions)) {
2501
+ entry.options = this.defaultOptions;
2502
+ entry.isLoaded = true;
2503
+ return entry;
2504
+ } else if (this.defaultOptions !== true) {
2505
+ entry.isLoaded = true;
2506
+ return entry;
2507
+ }
2508
+ }
2509
+ if (!this.remoteSearch[searchQuery]) {
2510
+ this.$set(this.remoteSearch, searchQuery, entry);
2511
+ }
2512
+ return entry;
2513
+ },
2514
+ shouldExpand: function shouldExpand(node) {
2515
+ return this.localSearch.active ? node.isExpandedOnSearch : node.isExpanded;
2516
+ },
2517
+ shouldOptionBeIncludedInSearchResult: function shouldOptionBeIncludedInSearchResult(node) {
2518
+ if (node.isMatched) return true;
2519
+ if (node.isBranch && node.hasMatchedDescendants && !this.flattenSearchResults) return true;
2520
+ if (!node.isRootNode && node.parentNode.showAllChildrenOnSearch) return true;
2521
+ return false;
2522
+ },
2523
+ shouldShowOptionInMenu: function shouldShowOptionInMenu(node) {
2524
+ if (this.localSearch.active && !this.shouldOptionBeIncludedInSearchResult(node)) {
2525
+ return false;
2526
+ }
2527
+ return true;
2528
+ },
2529
+ getControl: function getControl() {
2530
+ return this.$refs.control.$el;
2531
+ },
2532
+ getMenu: function getMenu() {
2533
+ var ref = this.appendToBody ? this.$refs.portal.portalTarget : this;
2534
+ var $menu = ref.$refs.menu.$refs.menu;
2535
+ return $menu && $menu.nodeName !== '#comment' ? $menu : null;
2536
+ },
2537
+ setCurrentHighlightedOption: function setCurrentHighlightedOption(node) {
2538
+ var _this14 = this;
2539
+ var scroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2540
+ var prev = this.menu.current;
2541
+ if (prev != null && prev in this.forest.nodeMap) {
2542
+ this.forest.nodeMap[prev].isHighlighted = false;
2543
+ }
2544
+ this.menu.current = node.id;
2545
+ node.isHighlighted = true;
2546
+ if (this.menu.isOpen && scroll) {
2547
+ var scrollToOption = function scrollToOption() {
2548
+ var $menu = _this14.getMenu();
2549
+ var $option = $menu.querySelector(".rp-treeselect__option[data-id=\"".concat(node.id, "\"]"));
2550
+ if ($option) scrollIntoView($menu, $option);
2551
+ };
2552
+ if (this.getMenu()) {
2553
+ scrollToOption();
2554
+ } else {
2555
+ this.$nextTick(scrollToOption);
2556
+ }
2557
+ }
2558
+ },
2559
+ resetHighlightedOptionWhenNecessary: function resetHighlightedOptionWhenNecessary() {
2560
+ var forceReset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2561
+ var current = this.menu.current;
2562
+ if (forceReset || current == null || !(current in this.forest.nodeMap) || !this.shouldShowOptionInMenu(this.getNode(current))) {
2563
+ this.highlightFirstOption();
2564
+ }
2565
+ },
2566
+ highlightFirstOption: function highlightFirstOption() {
2567
+ if (!this.hasVisibleOptions) return;
2568
+ var first = this.visibleOptionIds[0];
2569
+ this.setCurrentHighlightedOption(this.getNode(first));
2570
+ },
2571
+ highlightPrevOption: function highlightPrevOption() {
2572
+ if (!this.hasVisibleOptions) return;
2573
+ var prev = this.visibleOptionIds.indexOf(this.menu.current) - 1;
2574
+ if (prev === -1) return this.highlightLastOption();
2575
+ this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[prev]));
2576
+ },
2577
+ highlightNextOption: function highlightNextOption() {
2578
+ if (!this.hasVisibleOptions) return;
2579
+ var next = this.visibleOptionIds.indexOf(this.menu.current) + 1;
2580
+ if (next === this.visibleOptionIds.length) return this.highlightFirstOption();
2581
+ this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[next]));
2582
+ },
2583
+ highlightLastOption: function highlightLastOption() {
2584
+ if (!this.hasVisibleOptions) return;
2585
+ var last = last_default()(this.visibleOptionIds);
2586
+ this.setCurrentHighlightedOption(this.getNode(last));
2587
+ },
2588
+ resetSearchQuery: function resetSearchQuery() {
2589
+ this.trigger.searchQuery = '';
2590
+ },
2591
+ closeMenu: function closeMenu() {
2592
+ if (!this.menu.isOpen || !this.disabled && this.alwaysOpen) return;
2593
+ this.saveMenuScrollPosition();
2594
+ this.menu.isOpen = false;
2595
+ this.toggleClickOutsideEvent(false);
2596
+ this.resetSearchQuery();
2597
+ this.$emit('close', this.getValue(), this.getInstanceId());
2598
+ },
2599
+ openMenu: function openMenu() {
2600
+ if (this.disabled || this.menu.isOpen) return;
2601
+ this.menu.isOpen = true;
2602
+ this.$nextTick(this.resetHighlightedOptionWhenNecessary);
2603
+ this.$nextTick(this.restoreMenuScrollPosition);
2604
+ if (!this.options && !this.async) this.loadRootOptions();
2605
+ this.toggleClickOutsideEvent(true);
2606
+ this.$emit('open', this.getInstanceId());
2607
+ },
2608
+ toggleMenu: function toggleMenu() {
2609
+ if (this.menu.isOpen) {
2610
+ this.closeMenu();
2611
+ } else {
2612
+ this.openMenu();
2613
+ }
2614
+ },
2615
+ toggleExpanded: function toggleExpanded(node) {
2616
+ var nextState;
2617
+ if (this.localSearch.active) {
2618
+ nextState = node.isExpandedOnSearch = !node.isExpandedOnSearch;
2619
+ if (nextState) node.showAllChildrenOnSearch = true;
2620
+ } else {
2621
+ nextState = node.isExpanded = !node.isExpanded;
2622
+ }
2623
+ if (nextState && !node.childrenStates.isLoaded) {
2624
+ this.loadChildrenOptions(node);
2625
+ }
2626
+ },
2627
+ buildForestState: function buildForestState() {
2628
+ var _this15 = this;
2629
+ var selectedNodeMap = createMap();
2630
+ this.forest.selectedNodeIds.forEach(function (selectedNodeId) {
2631
+ selectedNodeMap[selectedNodeId] = true;
2632
+ });
2633
+ this.forest.selectedNodeMap = selectedNodeMap;
2634
+ var checkedStateMap = createMap();
2635
+ if (this.multiple) {
2636
+ this.traverseAllNodesByIndex(function (node) {
2637
+ checkedStateMap[node.id] = UNCHECKED;
2638
+ });
2639
+ this.selectedNodes.forEach(function (selectedNode) {
2640
+ checkedStateMap[selectedNode.id] = CHECKED;
2641
+ if (!_this15.flat && !_this15.disableBranchNodes) {
2642
+ selectedNode.ancestors.forEach(function (ancestorNode) {
2643
+ if (!_this15.isSelected(ancestorNode)) {
2644
+ checkedStateMap[ancestorNode.id] = INDETERMINATE;
2645
+ }
2646
+ });
2647
+ }
2648
+ });
2649
+ }
2650
+ this.forest.checkedStateMap = checkedStateMap;
2651
+ },
2652
+ enhancedNormalizer: function enhancedNormalizer(raw) {
2653
+ return _objectSpread(_objectSpread({}, raw), this.normalizer(raw, this.getInstanceId()));
2654
+ },
2655
+ normalize: function normalize(parentNode, nodes, prevNodeMap) {
2656
+ var _this16 = this;
2657
+ var normalizedOptions = nodes.map(function (node) {
2658
+ return [_this16.enhancedNormalizer(node), node];
2659
+ }).map(function (_ref, index) {
2660
+ var _ref2 = slicedToArray_default()(_ref, 2),
2661
+ node = _ref2[0],
2662
+ raw = _ref2[1];
2663
+ _this16.checkDuplication(node);
2664
+ _this16.verifyNodeShape(node);
2665
+ var id = node.id,
2666
+ label = node.label,
2667
+ children = node.children,
2668
+ isDefaultExpanded = node.isDefaultExpanded;
2669
+ var isRootNode = parentNode === NO_PARENT_NODE;
2670
+ var level = isRootNode ? 0 : parentNode.level + 1;
2671
+ var isBranch = Array.isArray(children) || children === null;
2672
+ var isLeaf = !isBranch;
2673
+ var isDisabled = !!node.isDisabled || !_this16.flat && !isRootNode && parentNode.isDisabled;
2674
+ var isNew = !!node.isNew;
2675
+ var lowerCased = _this16.matchKeys.reduce(function (prev, key) {
2676
+ return _objectSpread(_objectSpread({}, prev), {}, defineProperty_default()({}, key, stringifyOptionPropValue(node[key]).toLocaleLowerCase()));
2677
+ }, {});
2678
+ var nestedSearchLabel = isRootNode ? lowerCased.label : parentNode.nestedSearchLabel + ' ' + lowerCased.label;
2679
+ var normalized = _this16.$set(_this16.forest.nodeMap, id, createMap());
2680
+ _this16.$set(normalized, 'id', id);
2681
+ _this16.$set(normalized, 'label', label);
2682
+ _this16.$set(normalized, 'level', level);
2683
+ _this16.$set(normalized, 'ancestors', isRootNode ? [] : [parentNode].concat(parentNode.ancestors));
2684
+ _this16.$set(normalized, 'index', (isRootNode ? [] : parentNode.index).concat(index));
2685
+ _this16.$set(normalized, 'parentNode', parentNode);
2686
+ _this16.$set(normalized, 'lowerCased', lowerCased);
2687
+ _this16.$set(normalized, 'nestedSearchLabel', nestedSearchLabel);
2688
+ _this16.$set(normalized, 'isDisabled', isDisabled);
2689
+ _this16.$set(normalized, 'isNew', isNew);
2690
+ _this16.$set(normalized, 'isMatched', false);
2691
+ _this16.$set(normalized, 'isHighlighted', false);
2692
+ _this16.$set(normalized, 'isBranch', isBranch);
2693
+ _this16.$set(normalized, 'isLeaf', isLeaf);
2694
+ _this16.$set(normalized, 'isRootNode', isRootNode);
2695
+ _this16.$set(normalized, 'raw', raw);
2696
+ if (isBranch) {
2697
+ var isLoaded = Array.isArray(children);
2698
+ _this16.$set(normalized, 'childrenStates', _objectSpread(_objectSpread({}, createAsyncOptionsStates()), {}, {
2699
+ isLoaded: isLoaded
2700
+ }));
2701
+ _this16.$set(normalized, 'isExpanded', typeof isDefaultExpanded === 'boolean' ? isDefaultExpanded : level < _this16.defaultExpandLevel);
2702
+ _this16.$set(normalized, 'hasMatchedDescendants', false);
2703
+ _this16.$set(normalized, 'hasDisabledDescendants', false);
2704
+ _this16.$set(normalized, 'isExpandedOnSearch', false);
2705
+ _this16.$set(normalized, 'showAllChildrenOnSearch', false);
2706
+ _this16.$set(normalized, 'count', defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, ALL_CHILDREN, 0), ALL_DESCENDANTS, 0), LEAF_CHILDREN, 0), LEAF_DESCENDANTS, 0));
2707
+ _this16.$set(normalized, 'children', isLoaded ? _this16.normalize(normalized, children, prevNodeMap) : []);
2708
+ if (isDefaultExpanded === true) normalized.ancestors.forEach(function (ancestor) {
2709
+ ancestor.isExpanded = true;
2710
+ });
2711
+ if (!isLoaded && typeof _this16.loadOptions !== 'function') {
2712
+ warning_warning(function () {
2713
+ return false;
2714
+ }, function () {
2715
+ return 'Unloaded branch node detected. "loadOptions" prop is required to load its children.';
2716
+ });
2717
+ } else if (!isLoaded && normalized.isExpanded) {
2718
+ _this16.loadChildrenOptions(normalized);
2719
+ }
2720
+ }
2721
+ normalized.ancestors.forEach(function (ancestor) {
2722
+ return ancestor.count[ALL_DESCENDANTS]++;
2723
+ });
2724
+ if (isLeaf) normalized.ancestors.forEach(function (ancestor) {
2725
+ return ancestor.count[LEAF_DESCENDANTS]++;
2726
+ });
2727
+ if (!isRootNode) {
2728
+ parentNode.count[ALL_CHILDREN] += 1;
2729
+ if (isLeaf) parentNode.count[LEAF_CHILDREN] += 1;
2730
+ if (isDisabled) parentNode.hasDisabledDescendants = true;
2731
+ }
2732
+ if (prevNodeMap && prevNodeMap[id]) {
2733
+ var prev = prevNodeMap[id];
2734
+ normalized.isMatched = prev.isMatched;
2735
+ normalized.showAllChildrenOnSearch = prev.showAllChildrenOnSearch;
2736
+ normalized.isHighlighted = prev.isHighlighted;
2737
+ if (prev.isBranch && normalized.isBranch) {
2738
+ normalized.isExpanded = prev.isExpanded;
2739
+ normalized.isExpandedOnSearch = prev.isExpandedOnSearch;
2740
+ if (prev.childrenStates.isLoaded && !normalized.childrenStates.isLoaded) {
2741
+ normalized.isExpanded = false;
2742
+ } else {
2743
+ normalized.childrenStates = _objectSpread({}, prev.childrenStates);
2744
+ }
2745
+ }
2746
+ }
2747
+ return normalized;
2748
+ });
2749
+ if (this.branchNodesFirst) {
2750
+ var branchNodes = normalizedOptions.filter(function (option) {
2751
+ return option.isBranch;
2752
+ });
2753
+ var leafNodes = normalizedOptions.filter(function (option) {
2754
+ return option.isLeaf;
2755
+ });
2756
+ normalizedOptions = branchNodes.concat(leafNodes);
2757
+ }
2758
+ return normalizedOptions;
2759
+ },
2760
+ loadRootOptions: function loadRootOptions() {
2761
+ var _this17 = this;
2762
+ this.callLoadOptionsProp({
2763
+ action: LOAD_ROOT_OPTIONS,
2764
+ isPending: function isPending() {
2765
+ return _this17.rootOptionsStates.isLoading;
2766
+ },
2767
+ start: function start() {
2768
+ _this17.rootOptionsStates.isLoading = true;
2769
+ _this17.rootOptionsStates.loadingError = '';
2770
+ },
2771
+ succeed: function succeed() {
2772
+ _this17.rootOptionsStates.isLoaded = true;
2773
+ _this17.$nextTick(function () {
2774
+ _this17.resetHighlightedOptionWhenNecessary(true);
2775
+ });
2776
+ },
2777
+ fail: function fail(err) {
2778
+ _this17.rootOptionsStates.loadingError = getErrorMessage(err);
2779
+ },
2780
+ end: function end() {
2781
+ _this17.rootOptionsStates.isLoading = false;
2782
+ }
2783
+ });
2784
+ },
2785
+ loadChildrenOptions: function loadChildrenOptions(parentNode) {
2786
+ var _this18 = this;
2787
+ var id = parentNode.id,
2788
+ raw = parentNode.raw;
2789
+ this.callLoadOptionsProp({
2790
+ action: LOAD_CHILDREN_OPTIONS,
2791
+ args: {
2792
+ parentNode: raw
2793
+ },
2794
+ isPending: function isPending() {
2795
+ return _this18.getNode(id).childrenStates.isLoading;
2796
+ },
2797
+ start: function start() {
2798
+ _this18.getNode(id).childrenStates.isLoading = true;
2799
+ _this18.getNode(id).childrenStates.loadingError = '';
2800
+ },
2801
+ succeed: function succeed() {
2802
+ _this18.getNode(id).childrenStates.isLoaded = true;
2803
+ },
2804
+ fail: function fail(err) {
2805
+ _this18.getNode(id).childrenStates.loadingError = getErrorMessage(err);
2806
+ },
2807
+ end: function end() {
2808
+ _this18.getNode(id).childrenStates.isLoading = false;
2809
+ }
2810
+ });
2811
+ },
2812
+ callLoadOptionsProp: function callLoadOptionsProp(_ref3) {
2813
+ var action = _ref3.action,
2814
+ args = _ref3.args,
2815
+ isPending = _ref3.isPending,
2816
+ start = _ref3.start,
2817
+ succeed = _ref3.succeed,
2818
+ fail = _ref3.fail,
2819
+ end = _ref3.end;
2820
+ if (!this.loadOptions || isPending()) {
2821
+ return;
2822
+ }
2823
+ start();
2824
+ var callback = once_default()(function (err, result) {
2825
+ if (err) {
2826
+ fail(err);
2827
+ } else {
2828
+ succeed(result);
2829
+ }
2830
+ end();
2831
+ });
2832
+ var result = this.loadOptions(_objectSpread(_objectSpread({
2833
+ id: this.getInstanceId(),
2834
+ instanceId: this.getInstanceId(),
2835
+ action: action
2836
+ }, args), {}, {
2837
+ callback: callback
2838
+ }));
2839
+ if (is_promise_default()(result)) {
2840
+ result.then(function () {
2841
+ callback();
2842
+ }, function (err) {
2843
+ callback(err);
2844
+ }).catch(function (err) {
2845
+ console.error(err);
2846
+ });
2847
+ }
2848
+ },
2849
+ checkDuplication: function checkDuplication(node) {
2850
+ var _this19 = this;
2851
+ warning_warning(function () {
2852
+ return !(node.id in _this19.forest.nodeMap && !_this19.forest.nodeMap[node.id].isFallbackNode);
2853
+ }, function () {
2854
+ return "Detected duplicate presence of node id ".concat(JSON.stringify(node.id), ". ") + "Their labels are \"".concat(_this19.forest.nodeMap[node.id].label, "\" and \"").concat(node.label, "\" respectively.");
2855
+ });
2856
+ },
2857
+ verifyNodeShape: function verifyNodeShape(node) {
2858
+ warning_warning(function () {
2859
+ return !(node.children === undefined && node.isBranch === true);
2860
+ }, function () {
2861
+ return 'Are you meant to declare an unloaded branch node? ' + '`isBranch: true` is no longer supported, please use `children: null` instead.';
2862
+ });
2863
+ },
2864
+ select: function select(node) {
2865
+ if (this.disabled || node.isDisabled) {
2866
+ return;
2867
+ }
2868
+ if (this.single) {
2869
+ this.clear();
2870
+ }
2871
+ var nextState = this.multiple && !this.flat ? this.forest.checkedStateMap[node.id] === UNCHECKED : !this.isSelected(node);
2872
+ if (nextState) {
2873
+ this._selectNode(node);
2874
+ } else {
2875
+ this._deselectNode(node);
2876
+ }
2877
+ this.buildForestState();
2878
+ if (nextState) {
2879
+ this.$emit('select', node.raw, this.getInstanceId());
2880
+ } else {
2881
+ this.$emit('deselect', node.raw, this.getInstanceId());
2882
+ }
2883
+ if (this.localSearch.active && nextState && (this.single || this.clearOnSelect)) {
2884
+ this.resetSearchQuery();
2885
+ }
2886
+ if (this.single && this.closeOnSelect) {
2887
+ this.closeMenu();
2888
+ if (this.searchable) {
2889
+ this._blurOnSelect = true;
2890
+ }
2891
+ }
2892
+ },
2893
+ clear: function clear() {
2894
+ var _this20 = this;
2895
+ if (this.hasValue) {
2896
+ if (this.single || this.allowClearingDisabled) {
2897
+ this.forest.selectedNodeIds = [];
2898
+ } else {
2899
+ this.forest.selectedNodeIds = this.forest.selectedNodeIds.filter(function (nodeId) {
2900
+ return _this20.getNode(nodeId).isDisabled;
2901
+ });
2902
+ }
2903
+ this.buildForestState();
2904
+ }
2905
+ },
2906
+ _selectNode: function _selectNode(node) {
2907
+ var _this21 = this;
2908
+ if (this.single || this.disableBranchNodes) {
2909
+ return this.addValue(node);
2910
+ }
2911
+ if (this.flat) {
2912
+ this.addValue(node);
2913
+ if (this.autoSelectAncestors) {
2914
+ node.ancestors.forEach(function (ancestor) {
2915
+ if (!_this21.isSelected(ancestor) && !ancestor.isDisabled) _this21.addValue(ancestor);
2916
+ });
2917
+ } else if (this.autoSelectDescendants) {
2918
+ this.traverseDescendantsBFS(node, function (descendant) {
2919
+ if (!_this21.isSelected(descendant) && !descendant.isDisabled) _this21.addValue(descendant);
2920
+ });
2921
+ }
2922
+ return;
2923
+ }
2924
+ var isFullyChecked = node.isLeaf || (!node.hasDisabledDescendants) || (this.allowSelectingDisabledDescendants);
2925
+ if (isFullyChecked) {
2926
+ this.addValue(node);
2927
+ }
2928
+ if (node.isBranch) {
2929
+ this.traverseDescendantsBFS(node, function (descendant) {
2930
+ if (!descendant.isDisabled || _this21.allowSelectingDisabledDescendants) {
2931
+ _this21.addValue(descendant);
2932
+ }
2933
+ });
2934
+ }
2935
+ if (isFullyChecked) {
2936
+ var curr = node;
2937
+ while ((curr = curr.parentNode) !== NO_PARENT_NODE) {
2938
+ if (curr.children.every(this.isSelected)) this.addValue(curr);else break;
2939
+ }
2940
+ }
2941
+ },
2942
+ _deselectNode: function _deselectNode(node) {
2943
+ var _this22 = this;
2944
+ if (this.disableBranchNodes) {
2945
+ return this.removeValue(node);
2946
+ }
2947
+ if (this.flat) {
2948
+ this.removeValue(node);
2949
+ if (this.autoDeselectAncestors) {
2950
+ node.ancestors.forEach(function (ancestor) {
2951
+ if (_this22.isSelected(ancestor) && !ancestor.isDisabled) _this22.removeValue(ancestor);
2952
+ });
2953
+ } else if (this.autoDeselectDescendants) {
2954
+ this.traverseDescendantsBFS(node, function (descendant) {
2955
+ if (_this22.isSelected(descendant) && !descendant.isDisabled) _this22.removeValue(descendant);
2956
+ });
2957
+ }
2958
+ return;
2959
+ }
2960
+ var hasUncheckedSomeDescendants = false;
2961
+ if (node.isBranch) {
2962
+ this.traverseDescendantsDFS(node, function (descendant) {
2963
+ if (!descendant.isDisabled || _this22.allowSelectingDisabledDescendants) {
2964
+ _this22.removeValue(descendant);
2965
+ hasUncheckedSomeDescendants = true;
2966
+ }
2967
+ });
2968
+ }
2969
+ if (node.isLeaf || hasUncheckedSomeDescendants || node.children.length === 0) {
2970
+ this.removeValue(node);
2971
+ var curr = node;
2972
+ while ((curr = curr.parentNode) !== NO_PARENT_NODE) {
2973
+ if (this.isSelected(curr)) this.removeValue(curr);else break;
2974
+ }
2975
+ }
2976
+ },
2977
+ addValue: function addValue(node) {
2978
+ this.forest.selectedNodeIds.push(node.id);
2979
+ this.forest.selectedNodeMap[node.id] = true;
2980
+ },
2981
+ removeValue: function removeValue(node) {
2982
+ removeFromArray(this.forest.selectedNodeIds, node.id);
2983
+ delete this.forest.selectedNodeMap[node.id];
2984
+ },
2985
+ removeLastValue: function removeLastValue() {
2986
+ if (!this.hasValue) return;
2987
+ if (this.single) return this.clear();
2988
+ var lastValue = last_default()(this.internalValue);
2989
+ var lastSelectedNode = this.getNode(lastValue);
2990
+ this.select(lastSelectedNode);
2991
+ },
2992
+ saveMenuScrollPosition: function saveMenuScrollPosition() {
2993
+ var $menu = this.getMenu();
2994
+ if ($menu) this.menu.lastScrollPosition = $menu.scrollTop;
2995
+ },
2996
+ restoreMenuScrollPosition: function restoreMenuScrollPosition() {
2997
+ var $menu = this.getMenu();
2998
+ if ($menu) $menu.scrollTop = this.menu.lastScrollPosition;
2999
+ }
3000
+ },
3001
+ created: function created() {
3002
+ this.verifyProps();
3003
+ this.resetFlags();
3004
+ },
3005
+ mounted: function mounted() {
3006
+ if (this.autoFocus) this.focusInput();
3007
+ if (!this.options && !this.async && this.autoLoadRootOptions) this.loadRootOptions();
3008
+ if (this.alwaysOpen) this.openMenu();
3009
+ if (this.async && this.defaultOptions) this.handleRemoteSearch();
3010
+ },
3011
+ destroyed: function destroyed() {
3012
+ this.toggleClickOutsideEvent(false);
3013
+ }
3014
+ });
3015
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/HiddenFields.vue?vue&type=script&lang=js
3016
+
3017
+ function stringifyValue(value) {
3018
+ if (typeof value === 'string') return value;
3019
+ if (value != null && !isNaN_isNaN(value)) return JSON.stringify(value);
3020
+ return '';
3021
+ }
3022
+ /* harmony default export */ var HiddenFieldsvue_type_script_lang_js = ({
3023
+ name: 'rp-treeselect--hidden-fields',
3024
+ inject: ['instance'],
3025
+ functional: true,
3026
+ render: function render(_, context) {
3027
+ var h = arguments[0];
3028
+ var instance = context.injections.instance;
3029
+ if (!instance.name || instance.disabled || !instance.hasValue) return null;
3030
+ var stringifiedValues = instance.internalValue.map(stringifyValue);
3031
+ if (instance.multiple && instance.joinValues) stringifiedValues = [stringifiedValues.join(instance.delimiter)];
3032
+ return stringifiedValues.map(function (stringifiedValue, i) {
3033
+ return h("input", {
3034
+ attrs: {
3035
+ type: "hidden",
3036
+ name: instance.name
3037
+ },
3038
+ domProps: {
3039
+ "value": stringifiedValue
3040
+ },
3041
+ key: 'hidden-field-' + i
3042
+ });
3043
+ });
3044
+ }
3045
+ });
3046
+ // CONCATENATED MODULE: ./src/components/HiddenFields.vue?vue&type=script&lang=js
3047
+ /* harmony default export */ var components_HiddenFieldsvue_type_script_lang_js = (HiddenFieldsvue_type_script_lang_js);
3048
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
3049
+ /* globals __VUE_SSR_CONTEXT__ */
3050
+
3051
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
3052
+ // This module is a runtime utility for cleaner component module output and will
3053
+ // be included in the final webpack user bundle.
3054
+
3055
+ function normalizeComponent(
3056
+ scriptExports,
3057
+ render,
3058
+ staticRenderFns,
3059
+ functionalTemplate,
3060
+ injectStyles,
3061
+ scopeId,
3062
+ moduleIdentifier /* server only */,
3063
+ shadowMode /* vue-cli only */
3064
+ ) {
3065
+ // Vue.extend constructor export interop
3066
+ var options =
3067
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
3068
+
3069
+ // render functions
3070
+ if (render) {
3071
+ options.render = render
3072
+ options.staticRenderFns = staticRenderFns
3073
+ options._compiled = true
3074
+ }
3075
+
3076
+ // functional template
3077
+ if (functionalTemplate) {
3078
+ options.functional = true
3079
+ }
3080
+
3081
+ // scopedId
3082
+ if (scopeId) {
3083
+ options._scopeId = 'data-v-' + scopeId
3084
+ }
3085
+
3086
+ var hook
3087
+ if (moduleIdentifier) {
3088
+ // server build
3089
+ hook = function (context) {
3090
+ // 2.3 injection
3091
+ context =
3092
+ context || // cached call
3093
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
3094
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
3095
+ // 2.2 with runInNewContext: true
3096
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
3097
+ context = __VUE_SSR_CONTEXT__
3098
+ }
3099
+ // inject component styles
3100
+ if (injectStyles) {
3101
+ injectStyles.call(this, context)
3102
+ }
3103
+ // register component module identifier for async chunk inferrence
3104
+ if (context && context._registeredComponents) {
3105
+ context._registeredComponents.add(moduleIdentifier)
3106
+ }
3107
+ }
3108
+ // used by ssr in case component is cached and beforeCreate
3109
+ // never gets called
3110
+ options._ssrRegister = hook
3111
+ } else if (injectStyles) {
3112
+ hook = shadowMode
3113
+ ? function () {
3114
+ injectStyles.call(
3115
+ this,
3116
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
3117
+ )
3118
+ }
3119
+ : injectStyles
3120
+ }
3121
+
3122
+ if (hook) {
3123
+ if (options.functional) {
3124
+ // for template-only hot-reload because in that case the render fn doesn't
3125
+ // go through the normalizer
3126
+ options._injectStyles = hook
3127
+ // register for functional component in vue file
3128
+ var originalRender = options.render
3129
+ options.render = function renderWithStyleInjection(h, context) {
3130
+ hook.call(context)
3131
+ return originalRender(h, context)
3132
+ }
3133
+ } else {
3134
+ // inject component registration as beforeCreate hook
3135
+ var existing = options.beforeCreate
3136
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
3137
+ }
3138
+ }
3139
+
3140
+ return {
3141
+ exports: scriptExports,
3142
+ options: options
3143
+ }
3144
+ }
3145
+
3146
+ // CONCATENATED MODULE: ./src/components/HiddenFields.vue
3147
+ var HiddenFields_render, staticRenderFns
3148
+
3149
+
3150
+
3151
+
3152
+ /* normalize component */
3153
+
3154
+ var component = normalizeComponent(
3155
+ components_HiddenFieldsvue_type_script_lang_js,
3156
+ HiddenFields_render,
3157
+ staticRenderFns,
3158
+ false,
3159
+ null,
3160
+ null,
3161
+ null
3162
+
3163
+ )
3164
+
3165
+ /* hot reload */
3166
+ if (false) { var api; }
3167
+ component.options.__file = "src/components/HiddenFields.vue"
3168
+ /* harmony default export */ var HiddenFields = (component.exports);
3169
+ // EXTERNAL MODULE: ./node_modules/babel-helper-vue-jsx-merge-props/index.js
3170
+ var babel_helper_vue_jsx_merge_props = __webpack_require__(39);
3171
+ var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props);
3172
+
3173
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Input.vue?vue&type=script&lang=js
3174
+
3175
+
3176
+
3177
+ var keysThatRequireMenuBeingOpen = [KEY_CODES.ENTER, KEY_CODES.END, KEY_CODES.HOME, KEY_CODES.ARROW_LEFT, KEY_CODES.ARROW_UP, KEY_CODES.ARROW_RIGHT, KEY_CODES.ARROW_DOWN];
3178
+ /* harmony default export */ var Inputvue_type_script_lang_js = ({
3179
+ name: 'rp-treeselect--input',
3180
+ inject: ['instance'],
3181
+ data: function data() {
3182
+ return {
3183
+ inputWidth: MIN_INPUT_WIDTH,
3184
+ value: ''
3185
+ };
3186
+ },
3187
+ computed: {
3188
+ needAutoSize: function needAutoSize() {
3189
+ var instance = this.instance;
3190
+ return instance.searchable && !instance.disabled && instance.multiple;
3191
+ },
3192
+ inputStyle: function inputStyle() {
3193
+ return {
3194
+ width: this.needAutoSize ? "".concat(this.inputWidth, "px") : null
3195
+ };
3196
+ }
3197
+ },
3198
+ watch: {
3199
+ 'instance.trigger.searchQuery': function instanceTriggerSearchQuery(newValue) {
3200
+ this.value = newValue;
3201
+ },
3202
+ value: function value() {
3203
+ if (this.needAutoSize) this.$nextTick(this.updateInputWidth);
3204
+ }
3205
+ },
3206
+ created: function created() {
3207
+ this.debouncedCallback = debounce_default()(this.updateSearchQuery, INPUT_DEBOUNCE_DELAY, {
3208
+ leading: true,
3209
+ trailing: true
3210
+ });
3211
+ },
3212
+ methods: {
3213
+ clear: function clear() {
3214
+ this.onInput({
3215
+ target: {
3216
+ value: ''
3217
+ }
3218
+ });
3219
+ },
3220
+ focus: function focus() {
3221
+ var instance = this.instance;
3222
+ if (!instance.disabled) {
3223
+ this.$refs.input && this.$refs.input.focus();
3224
+ }
3225
+ },
3226
+ blur: function blur() {
3227
+ this.$refs.input && this.$refs.input.blur();
3228
+ },
3229
+ onFocus: function onFocus() {
3230
+ var instance = this.instance;
3231
+ instance.trigger.isFocused = true;
3232
+ if (instance.openOnFocus) instance.openMenu();
3233
+ },
3234
+ onBlur: function onBlur() {
3235
+ var instance = this.instance;
3236
+ var menu = instance.getMenu();
3237
+ if (menu && document.activeElement === menu) {
3238
+ return this.focus();
3239
+ }
3240
+ instance.trigger.isFocused = false;
3241
+ instance.closeMenu();
3242
+ },
3243
+ onInput: function onInput(evt) {
3244
+ var value = evt.target.value;
3245
+ this.value = value;
3246
+ if (value) {
3247
+ this.debouncedCallback();
3248
+ } else {
3249
+ this.debouncedCallback.cancel();
3250
+ this.updateSearchQuery();
3251
+ }
3252
+ },
3253
+ onKeyDown: function onKeyDown(evt) {
3254
+ var instance = this.instance;
3255
+ var key = 'which' in evt ? evt.which : evt.keyCode;
3256
+ if (evt.ctrlKey || evt.shiftKey || evt.altKey || evt.metaKey) return;
3257
+ if (!instance.menu.isOpen && includes(keysThatRequireMenuBeingOpen, key)) {
3258
+ evt.preventDefault();
3259
+ return instance.openMenu();
3260
+ }
3261
+ switch (key) {
3262
+ case KEY_CODES.BACKSPACE:
3263
+ {
3264
+ if (instance.backspaceRemoves && !this.value.length) {
3265
+ instance.removeLastValue();
3266
+ }
3267
+ break;
3268
+ }
3269
+ case KEY_CODES.ENTER:
3270
+ {
3271
+ evt.preventDefault();
3272
+ if (instance.menu.current === null) return;
3273
+ var current = instance.getNode(instance.menu.current);
3274
+ if (current.isBranch && instance.disableBranchNodes) return;
3275
+ instance.select(current);
3276
+ break;
3277
+ }
3278
+ case KEY_CODES.ESCAPE:
3279
+ {
3280
+ if (this.value.length) {
3281
+ this.clear();
3282
+ } else if (instance.menu.isOpen) {
3283
+ instance.closeMenu();
3284
+ }
3285
+ break;
3286
+ }
3287
+ case KEY_CODES.END:
3288
+ {
3289
+ evt.preventDefault();
3290
+ instance.highlightLastOption();
3291
+ break;
3292
+ }
3293
+ case KEY_CODES.HOME:
3294
+ {
3295
+ evt.preventDefault();
3296
+ instance.highlightFirstOption();
3297
+ break;
3298
+ }
3299
+ case KEY_CODES.ARROW_LEFT:
3300
+ {
3301
+ var _current = instance.getNode(instance.menu.current);
3302
+ if (_current.isBranch && instance.shouldExpand(_current)) {
3303
+ evt.preventDefault();
3304
+ instance.toggleExpanded(_current);
3305
+ } else if (!_current.isRootNode && (_current.isLeaf || _current.isBranch && !instance.shouldExpand(_current))) {
3306
+ evt.preventDefault();
3307
+ instance.setCurrentHighlightedOption(_current.parentNode);
3308
+ }
3309
+ break;
3310
+ }
3311
+ case KEY_CODES.ARROW_UP:
3312
+ {
3313
+ evt.preventDefault();
3314
+ instance.highlightPrevOption();
3315
+ break;
3316
+ }
3317
+ case KEY_CODES.ARROW_RIGHT:
3318
+ {
3319
+ var _current2 = instance.getNode(instance.menu.current);
3320
+ if (_current2.isBranch && !instance.shouldExpand(_current2)) {
3321
+ evt.preventDefault();
3322
+ instance.toggleExpanded(_current2);
3323
+ }
3324
+ break;
3325
+ }
3326
+ case KEY_CODES.ARROW_DOWN:
3327
+ {
3328
+ evt.preventDefault();
3329
+ instance.highlightNextOption();
3330
+ break;
3331
+ }
3332
+ case KEY_CODES.DELETE:
3333
+ {
3334
+ if (instance.deleteRemoves && !this.value.length) {
3335
+ instance.removeLastValue();
3336
+ }
3337
+ break;
3338
+ }
3339
+ default:
3340
+ {
3341
+ instance.openMenu();
3342
+ }
3343
+ }
3344
+ },
3345
+ onMouseDown: function onMouseDown(evt) {
3346
+ if (this.value.length) {
3347
+ evt.stopPropagation();
3348
+ }
3349
+ },
3350
+ renderInputContainer: function renderInputContainer() {
3351
+ var h = this.$createElement;
3352
+ var instance = this.instance;
3353
+ var props = {};
3354
+ var children = [];
3355
+ if (instance.searchable && !instance.disabled) {
3356
+ children.push(this.renderInput());
3357
+ if (this.needAutoSize) children.push(this.renderSizer());
3358
+ }
3359
+ if (!instance.searchable) {
3360
+ deepExtend(props, {
3361
+ on: {
3362
+ focus: this.onFocus,
3363
+ blur: this.onBlur,
3364
+ keydown: this.onKeyDown
3365
+ },
3366
+ ref: 'input'
3367
+ });
3368
+ }
3369
+ if (!instance.searchable && !instance.disabled) {
3370
+ deepExtend(props, {
3371
+ attrs: {
3372
+ tabIndex: instance.tabIndex
3373
+ }
3374
+ });
3375
+ }
3376
+ return h("div", babel_helper_vue_jsx_merge_props_default()([{
3377
+ "class": "rp-treeselect__input-container"
3378
+ }, props]), [children]);
3379
+ },
3380
+ renderInput: function renderInput() {
3381
+ var h = this.$createElement;
3382
+ var instance = this.instance;
3383
+ return h("input", {
3384
+ ref: "input",
3385
+ "class": "rp-treeselect__input",
3386
+ attrs: {
3387
+ type: "text",
3388
+ autocomplete: "off",
3389
+ tabIndex: instance.tabIndex,
3390
+ required: instance.required && !instance.hasValue
3391
+ },
3392
+ domProps: {
3393
+ "value": this.value
3394
+ },
3395
+ style: this.inputStyle,
3396
+ on: {
3397
+ "focus": this.onFocus,
3398
+ "input": this.onInput,
3399
+ "blur": this.onBlur,
3400
+ "keydown": this.onKeyDown,
3401
+ "mousedown": this.onMouseDown
3402
+ }
3403
+ });
3404
+ },
3405
+ renderSizer: function renderSizer() {
3406
+ var h = this.$createElement;
3407
+ return h("div", {
3408
+ ref: "sizer",
3409
+ "class": "rp-treeselect__sizer"
3410
+ }, [this.value]);
3411
+ },
3412
+ updateInputWidth: function updateInputWidth() {
3413
+ this.inputWidth = Math.max(MIN_INPUT_WIDTH, this.$refs.sizer.scrollWidth + 15);
3414
+ },
3415
+ updateSearchQuery: function updateSearchQuery() {
3416
+ var instance = this.instance;
3417
+ instance.trigger.searchQuery = this.value;
3418
+ }
3419
+ },
3420
+ render: function render() {
3421
+ return this.renderInputContainer();
3422
+ }
3423
+ });
3424
+ // CONCATENATED MODULE: ./src/components/Input.vue?vue&type=script&lang=js
3425
+ /* harmony default export */ var components_Inputvue_type_script_lang_js = (Inputvue_type_script_lang_js);
3426
+ // CONCATENATED MODULE: ./src/components/Input.vue
3427
+ var Input_render, Input_staticRenderFns
3428
+
3429
+
3430
+
3431
+
3432
+ /* normalize component */
3433
+
3434
+ var Input_component = normalizeComponent(
3435
+ components_Inputvue_type_script_lang_js,
3436
+ Input_render,
3437
+ Input_staticRenderFns,
3438
+ false,
3439
+ null,
3440
+ null,
3441
+ null
3442
+
3443
+ )
3444
+
3445
+ /* hot reload */
3446
+ if (false) { var Input_api; }
3447
+ Input_component.options.__file = "src/components/Input.vue"
3448
+ /* harmony default export */ var Input = (Input_component.exports);
3449
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Placeholder.vue?vue&type=script&lang=js
3450
+ /* harmony default export */ var Placeholdervue_type_script_lang_js = ({
3451
+ name: 'rp-treeselect--placeholder',
3452
+ inject: ['instance'],
3453
+ render: function render() {
3454
+ var h = arguments[0];
3455
+ var instance = this.instance;
3456
+ var placeholderClass = {
3457
+ 'rp-treeselect__placeholder': true,
3458
+ 'rp-treeselect-helper-zoom-effect-off': true,
3459
+ 'rp-treeselect-helper-hide': instance.hasValue || instance.trigger.searchQuery
3460
+ };
3461
+ return h("div", {
3462
+ "class": placeholderClass
3463
+ }, [instance.placeholder]);
3464
+ }
3465
+ });
3466
+ // CONCATENATED MODULE: ./src/components/Placeholder.vue?vue&type=script&lang=js
3467
+ /* harmony default export */ var components_Placeholdervue_type_script_lang_js = (Placeholdervue_type_script_lang_js);
3468
+ // CONCATENATED MODULE: ./src/components/Placeholder.vue
3469
+ var Placeholder_render, Placeholder_staticRenderFns
3470
+
3471
+
3472
+
3473
+
3474
+ /* normalize component */
3475
+
3476
+ var Placeholder_component = normalizeComponent(
3477
+ components_Placeholdervue_type_script_lang_js,
3478
+ Placeholder_render,
3479
+ Placeholder_staticRenderFns,
3480
+ false,
3481
+ null,
3482
+ null,
3483
+ null
3484
+
3485
+ )
3486
+
3487
+ /* hot reload */
3488
+ if (false) { var Placeholder_api; }
3489
+ Placeholder_component.options.__file = "src/components/Placeholder.vue"
3490
+ /* harmony default export */ var Placeholder = (Placeholder_component.exports);
3491
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SingleValue.vue?vue&type=script&lang=js
3492
+
3493
+
3494
+ /* harmony default export */ var SingleValuevue_type_script_lang_js = ({
3495
+ name: 'rp-treeselect--single-value',
3496
+ inject: ['instance'],
3497
+ methods: {
3498
+ renderSingleValueLabel: function renderSingleValueLabel() {
3499
+ var instance = this.instance;
3500
+ var node = instance.selectedNodes[0];
3501
+ var customValueLabelRenderer = instance.$scopedSlots['value-label'];
3502
+ return customValueLabelRenderer ? customValueLabelRenderer({
3503
+ node: node
3504
+ }) : node.label;
3505
+ }
3506
+ },
3507
+ render: function render() {
3508
+ var h = arguments[0];
3509
+ var instance = this.instance,
3510
+ renderValueContainer = this.$parent.renderValueContainer;
3511
+ var shouldShowValue = instance.hasValue && !instance.trigger.searchQuery;
3512
+ return renderValueContainer([shouldShowValue && h("div", {
3513
+ "class": "rp-treeselect__single-value"
3514
+ }, [this.renderSingleValueLabel()]), h(Placeholder), h(Input, {
3515
+ ref: "input"
3516
+ })]);
3517
+ }
3518
+ });
3519
+ // CONCATENATED MODULE: ./src/components/SingleValue.vue?vue&type=script&lang=js
3520
+ /* harmony default export */ var components_SingleValuevue_type_script_lang_js = (SingleValuevue_type_script_lang_js);
3521
+ // CONCATENATED MODULE: ./src/components/SingleValue.vue
3522
+ var SingleValue_render, SingleValue_staticRenderFns
3523
+
3524
+
3525
+
3526
+
3527
+ /* normalize component */
3528
+
3529
+ var SingleValue_component = normalizeComponent(
3530
+ components_SingleValuevue_type_script_lang_js,
3531
+ SingleValue_render,
3532
+ SingleValue_staticRenderFns,
3533
+ false,
3534
+ null,
3535
+ null,
3536
+ null
3537
+
3538
+ )
3539
+
3540
+ /* hot reload */
3541
+ if (false) { var SingleValue_api; }
3542
+ SingleValue_component.options.__file = "src/components/SingleValue.vue"
3543
+ /* harmony default export */ var SingleValue = (SingleValue_component.exports);
3544
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/components/icons/Delete.vue?vue&type=template&id=364b6320
3545
+ var Deletevue_type_template_id_364b6320_render = function render() {
3546
+ var _vm = this,
3547
+ _c = _vm._self._c
3548
+ return _c(
3549
+ "svg",
3550
+ {
3551
+ attrs: {
3552
+ xmlns: "http://www.w3.org/2000/svg",
3553
+ viewBox: "0 0 348.333 348.333",
3554
+ },
3555
+ },
3556
+ [
3557
+ _c("path", {
3558
+ attrs: {
3559
+ d: "M336.559 68.611L231.016 174.165l105.543 105.549c15.699 15.705 15.699 41.145 0 56.85-7.844 7.844-18.128 11.769-28.407 11.769-10.296 0-20.581-3.919-28.419-11.769L174.167 231.003 68.609 336.563c-7.843 7.844-18.128 11.769-28.416 11.769-10.285 0-20.563-3.919-28.413-11.769-15.699-15.698-15.699-41.139 0-56.85l105.54-105.549L11.774 68.611c-15.699-15.699-15.699-41.145 0-56.844 15.696-15.687 41.127-15.687 56.829 0l105.563 105.554L279.721 11.767c15.705-15.687 41.139-15.687 56.832 0 15.705 15.699 15.705 41.145.006 56.844z",
3560
+ },
3561
+ }),
3562
+ ]
3563
+ )
3564
+ }
3565
+ var Deletevue_type_template_id_364b6320_staticRenderFns = []
3566
+ Deletevue_type_template_id_364b6320_render._withStripped = true
3567
+
3568
+
3569
+ // CONCATENATED MODULE: ./src/components/icons/Delete.vue?vue&type=template&id=364b6320
3570
+
3571
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/icons/Delete.vue?vue&type=script&lang=js
3572
+ /* harmony default export */ var Deletevue_type_script_lang_js = ({
3573
+ name: 'rp-treeselect--x'
3574
+ });
3575
+ // CONCATENATED MODULE: ./src/components/icons/Delete.vue?vue&type=script&lang=js
3576
+ /* harmony default export */ var icons_Deletevue_type_script_lang_js = (Deletevue_type_script_lang_js);
3577
+ // CONCATENATED MODULE: ./src/components/icons/Delete.vue
3578
+
3579
+
3580
+
3581
+
3582
+
3583
+ /* normalize component */
3584
+
3585
+ var Delete_component = normalizeComponent(
3586
+ icons_Deletevue_type_script_lang_js,
3587
+ Deletevue_type_template_id_364b6320_render,
3588
+ Deletevue_type_template_id_364b6320_staticRenderFns,
3589
+ false,
3590
+ null,
3591
+ null,
3592
+ null
3593
+
3594
+ )
3595
+
3596
+ /* hot reload */
3597
+ if (false) { var Delete_api; }
3598
+ Delete_component.options.__file = "src/components/icons/Delete.vue"
3599
+ /* harmony default export */ var Delete = (Delete_component.exports);
3600
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MultiValueItem.vue?vue&type=script&lang=js
3601
+
3602
+
3603
+ /* harmony default export */ var MultiValueItemvue_type_script_lang_js = ({
3604
+ name: 'rp-treeselect--multi-value-item',
3605
+ inject: ['instance'],
3606
+ props: {
3607
+ node: {
3608
+ type: Object,
3609
+ required: true
3610
+ }
3611
+ },
3612
+ methods: {
3613
+ handleMouseDown: onLeftClick(function handleMouseDown() {
3614
+ var instance = this.instance,
3615
+ node = this.node;
3616
+ instance.select(node);
3617
+ })
3618
+ },
3619
+ render: function render() {
3620
+ var h = arguments[0];
3621
+ var instance = this.instance,
3622
+ node = this.node;
3623
+ var itemClass = {
3624
+ 'rp-treeselect__multi-value-item': true,
3625
+ 'rp-treeselect__multi-value-item-disabled': node.isDisabled,
3626
+ 'rp-treeselect__multi-value-item-new': node.isNew
3627
+ };
3628
+ var customValueLabelRenderer = instance.$scopedSlots['value-label'];
3629
+ var labelRenderer = customValueLabelRenderer ? customValueLabelRenderer({
3630
+ node: node
3631
+ }) : node.label;
3632
+ return h("div", {
3633
+ "class": "rp-treeselect__multi-value-item-container"
3634
+ }, [h("div", {
3635
+ "class": itemClass,
3636
+ on: {
3637
+ "mousedown": this.handleMouseDown
3638
+ }
3639
+ }, [h("span", {
3640
+ "class": "rp-treeselect__multi-value-label"
3641
+ }, [labelRenderer]), h("span", {
3642
+ "class": "rp-treeselect__icon rp-treeselect__value-remove"
3643
+ }, [h(Delete)])])]);
3644
+ }
3645
+ });
3646
+ // CONCATENATED MODULE: ./src/components/MultiValueItem.vue?vue&type=script&lang=js
3647
+ /* harmony default export */ var components_MultiValueItemvue_type_script_lang_js = (MultiValueItemvue_type_script_lang_js);
3648
+ // CONCATENATED MODULE: ./src/components/MultiValueItem.vue
3649
+ var MultiValueItem_render, MultiValueItem_staticRenderFns
3650
+
3651
+
3652
+
3653
+
3654
+ /* normalize component */
3655
+
3656
+ var MultiValueItem_component = normalizeComponent(
3657
+ components_MultiValueItemvue_type_script_lang_js,
3658
+ MultiValueItem_render,
3659
+ MultiValueItem_staticRenderFns,
3660
+ false,
3661
+ null,
3662
+ null,
3663
+ null
3664
+
3665
+ )
3666
+
3667
+ /* hot reload */
3668
+ if (false) { var MultiValueItem_api; }
3669
+ MultiValueItem_component.options.__file = "src/components/MultiValueItem.vue"
3670
+ /* harmony default export */ var MultiValueItem = (MultiValueItem_component.exports);
3671
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MultiValue.vue?vue&type=script&lang=js
3672
+
3673
+
3674
+
3675
+
3676
+ /* harmony default export */ var MultiValuevue_type_script_lang_js = ({
3677
+ name: 'rp-treeselect--multi-value',
3678
+ inject: ['instance'],
3679
+ methods: {
3680
+ renderMultiValueItems: function renderMultiValueItems() {
3681
+ var h = this.$createElement;
3682
+ var instance = this.instance;
3683
+ return instance.internalValue.slice(0, instance.limit).map(instance.getNode).map(function (node) {
3684
+ return h(MultiValueItem, {
3685
+ key: "multi-value-item-".concat(node.id),
3686
+ attrs: {
3687
+ node: node
3688
+ }
3689
+ });
3690
+ });
3691
+ },
3692
+ renderExceedLimitTip: function renderExceedLimitTip() {
3693
+ var h = this.$createElement;
3694
+ var instance = this.instance;
3695
+ var count = instance.internalValue.length - instance.limit;
3696
+ if (count <= 0) return null;
3697
+ return h("div", {
3698
+ "class": "rp-treeselect__limit-tip rp-treeselect-helper-zoom-effect-off",
3699
+ key: "exceed-limit-tip"
3700
+ }, [h("span", {
3701
+ "class": "rp-treeselect__limit-tip-text"
3702
+ }, [instance.limitText(count)])]);
3703
+ }
3704
+ },
3705
+ render: function render() {
3706
+ var h = arguments[0];
3707
+ var renderValueContainer = this.$parent.renderValueContainer;
3708
+ var transitionGroupProps = {
3709
+ props: {
3710
+ tag: 'div',
3711
+ name: 'rp-treeselect__multi-value-item--transition',
3712
+ appear: true
3713
+ }
3714
+ };
3715
+ return renderValueContainer(h("transition-group", babel_helper_vue_jsx_merge_props_default()([{
3716
+ "class": "rp-treeselect__multi-value"
3717
+ }, transitionGroupProps]), [this.renderMultiValueItems(), this.renderExceedLimitTip(), h(Placeholder, {
3718
+ key: "placeholder"
3719
+ }), h(Input, {
3720
+ ref: "input",
3721
+ key: "input"
3722
+ })]));
3723
+ }
3724
+ });
3725
+ // CONCATENATED MODULE: ./src/components/MultiValue.vue?vue&type=script&lang=js
3726
+ /* harmony default export */ var components_MultiValuevue_type_script_lang_js = (MultiValuevue_type_script_lang_js);
3727
+ // CONCATENATED MODULE: ./src/components/MultiValue.vue
3728
+ var MultiValue_render, MultiValue_staticRenderFns
3729
+
3730
+
3731
+
3732
+
3733
+ /* normalize component */
3734
+
3735
+ var MultiValue_component = normalizeComponent(
3736
+ components_MultiValuevue_type_script_lang_js,
3737
+ MultiValue_render,
3738
+ MultiValue_staticRenderFns,
3739
+ false,
3740
+ null,
3741
+ null,
3742
+ null
3743
+
3744
+ )
3745
+
3746
+ /* hot reload */
3747
+ if (false) { var MultiValue_api; }
3748
+ MultiValue_component.options.__file = "src/components/MultiValue.vue"
3749
+ /* harmony default export */ var MultiValue = (MultiValue_component.exports);
3750
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./src/components/icons/Arrow.vue?vue&type=template&id=11186cd4
3751
+ var Arrowvue_type_template_id_11186cd4_render = function render() {
3752
+ var _vm = this,
3753
+ _c = _vm._self._c
3754
+ return _c(
3755
+ "svg",
3756
+ {
3757
+ attrs: {
3758
+ xmlns: "http://www.w3.org/2000/svg",
3759
+ viewBox: "0 0 292.362 292.362",
3760
+ },
3761
+ },
3762
+ [
3763
+ _c("path", {
3764
+ attrs: {
3765
+ d: "M286.935 69.377c-3.614-3.617-7.898-5.424-12.848-5.424H18.274c-4.952 0-9.233 1.807-12.85 5.424C1.807 72.998 0 77.279 0 82.228c0 4.948 1.807 9.229 5.424 12.847l127.907 127.907c3.621 3.617 7.902 5.428 12.85 5.428s9.233-1.811 12.847-5.428L286.935 95.074c3.613-3.617 5.427-7.898 5.427-12.847 0-4.948-1.814-9.229-5.427-12.85z",
3766
+ },
3767
+ }),
3768
+ ]
3769
+ )
3770
+ }
3771
+ var Arrowvue_type_template_id_11186cd4_staticRenderFns = []
3772
+ Arrowvue_type_template_id_11186cd4_render._withStripped = true
3773
+
3774
+
3775
+ // CONCATENATED MODULE: ./src/components/icons/Arrow.vue?vue&type=template&id=11186cd4
3776
+
3777
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/icons/Arrow.vue?vue&type=script&lang=js
3778
+ /* harmony default export */ var Arrowvue_type_script_lang_js = ({
3779
+ name: 'rp-treeselect--arrow'
3780
+ });
3781
+ // CONCATENATED MODULE: ./src/components/icons/Arrow.vue?vue&type=script&lang=js
3782
+ /* harmony default export */ var icons_Arrowvue_type_script_lang_js = (Arrowvue_type_script_lang_js);
3783
+ // CONCATENATED MODULE: ./src/components/icons/Arrow.vue
3784
+
3785
+
3786
+
3787
+
3788
+
3789
+ /* normalize component */
3790
+
3791
+ var Arrow_component = normalizeComponent(
3792
+ icons_Arrowvue_type_script_lang_js,
3793
+ Arrowvue_type_template_id_11186cd4_render,
3794
+ Arrowvue_type_template_id_11186cd4_staticRenderFns,
3795
+ false,
3796
+ null,
3797
+ null,
3798
+ null
3799
+
3800
+ )
3801
+
3802
+ /* hot reload */
3803
+ if (false) { var Arrow_api; }
3804
+ Arrow_component.options.__file = "src/components/icons/Arrow.vue"
3805
+ /* harmony default export */ var Arrow = (Arrow_component.exports);
3806
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Control.vue?vue&type=script&lang=js
3807
+
3808
+
3809
+
3810
+
3811
+
3812
+ /* harmony default export */ var Controlvue_type_script_lang_js = ({
3813
+ name: 'rp-treeselect--control',
3814
+ inject: ['instance'],
3815
+ computed: {
3816
+ shouldShowX: function shouldShowX() {
3817
+ var instance = this.instance;
3818
+ return instance.clearable && !instance.disabled && instance.hasValue && (this.hasUndisabledValue || instance.allowClearingDisabled);
3819
+ },
3820
+ shouldShowArrow: function shouldShowArrow() {
3821
+ var instance = this.instance;
3822
+ if (!instance.alwaysOpen) return true;
3823
+ return !instance.menu.isOpen;
3824
+ },
3825
+ hasUndisabledValue: function hasUndisabledValue() {
3826
+ var instance = this.instance;
3827
+ return instance.hasValue && instance.internalValue.some(function (id) {
3828
+ return !instance.getNode(id).isDisabled;
3829
+ });
3830
+ }
3831
+ },
3832
+ methods: {
3833
+ renderX: function renderX() {
3834
+ var h = this.$createElement;
3835
+ var instance = this.instance;
3836
+ var title = instance.multiple ? instance.clearAllText : instance.clearValueText;
3837
+ if (!this.shouldShowX) return null;
3838
+ return h("div", {
3839
+ "class": "rp-treeselect__x-container",
3840
+ attrs: {
3841
+ title: title
3842
+ },
3843
+ on: {
3844
+ "mousedown": this.handleMouseDownOnX
3845
+ }
3846
+ }, [h(Delete, {
3847
+ "class": "rp-treeselect__x"
3848
+ })]);
3849
+ },
3850
+ renderArrow: function renderArrow() {
3851
+ var h = this.$createElement;
3852
+ var instance = this.instance;
3853
+ var arrowClass = {
3854
+ 'rp-treeselect__control-arrow': true,
3855
+ 'rp-treeselect__control-arrow--rotated': instance.menu.isOpen
3856
+ };
3857
+ if (!this.shouldShowArrow) return null;
3858
+ return h("div", {
3859
+ "class": "rp-treeselect__control-arrow-container",
3860
+ on: {
3861
+ "mousedown": this.handleMouseDownOnArrow
3862
+ }
3863
+ }, [h(Arrow, {
3864
+ "class": arrowClass
3865
+ })]);
3866
+ },
3867
+ handleMouseDownOnX: onLeftClick(function handleMouseDownOnX(evt) {
3868
+ evt.stopPropagation();
3869
+ evt.preventDefault();
3870
+ var instance = this.instance;
3871
+ var result = instance.beforeClearAll();
3872
+ var handler = function handler(shouldClear) {
3873
+ if (shouldClear) instance.clear();
3874
+ };
3875
+ if (is_promise_default()(result)) {
3876
+ result.then(handler);
3877
+ } else {
3878
+ setTimeout(function () {
3879
+ return handler(result);
3880
+ }, 0);
3881
+ }
3882
+ }),
3883
+ handleMouseDownOnArrow: onLeftClick(function handleMouseDownOnArrow(evt) {
3884
+ evt.preventDefault();
3885
+ evt.stopPropagation();
3886
+ var instance = this.instance;
3887
+ instance.focusInput();
3888
+ instance.toggleMenu();
3889
+ }),
3890
+ renderValueContainer: function renderValueContainer(children) {
3891
+ var h = this.$createElement;
3892
+ return h("div", {
3893
+ "class": "rp-treeselect__value-container"
3894
+ }, [children]);
3895
+ }
3896
+ },
3897
+ render: function render() {
3898
+ var h = arguments[0];
3899
+ var instance = this.instance;
3900
+ var ValueContainer = instance.single ? SingleValue : MultiValue;
3901
+ return h("div", {
3902
+ "class": "rp-treeselect__control",
3903
+ on: {
3904
+ "mousedown": instance.handleMouseDown
3905
+ }
3906
+ }, [h(ValueContainer, {
3907
+ ref: "value-container"
3908
+ }), this.renderX(), this.renderArrow()]);
3909
+ }
3910
+ });
3911
+ // CONCATENATED MODULE: ./src/components/Control.vue?vue&type=script&lang=js
3912
+ /* harmony default export */ var components_Controlvue_type_script_lang_js = (Controlvue_type_script_lang_js);
3913
+ // CONCATENATED MODULE: ./src/components/Control.vue
3914
+ var Control_render, Control_staticRenderFns
3915
+
3916
+
3917
+
3918
+
3919
+ /* normalize component */
3920
+
3921
+ var Control_component = normalizeComponent(
3922
+ components_Controlvue_type_script_lang_js,
3923
+ Control_render,
3924
+ Control_staticRenderFns,
3925
+ false,
3926
+ null,
3927
+ null,
3928
+ null
3929
+
3930
+ )
3931
+
3932
+ /* hot reload */
3933
+ if (false) { var Control_api; }
3934
+ Control_component.options.__file = "src/components/Control.vue"
3935
+ /* harmony default export */ var Control = (Control_component.exports);
3936
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Tip.vue?vue&type=script&lang=js
3937
+ /* harmony default export */ var Tipvue_type_script_lang_js = ({
3938
+ name: 'rp-treeselect--tip',
3939
+ functional: true,
3940
+ props: {
3941
+ type: {
3942
+ type: String,
3943
+ required: true
3944
+ },
3945
+ icon: {
3946
+ type: String,
3947
+ required: true
3948
+ }
3949
+ },
3950
+ render: function render(_, context) {
3951
+ var h = arguments[0];
3952
+ var props = context.props,
3953
+ children = context.children;
3954
+ return h("div", {
3955
+ "class": "rp-treeselect__tip rp-treeselect__".concat(props.type, "-tip")
3956
+ }, [h("div", {
3957
+ "class": "rp-treeselect__icon-container"
3958
+ }, [h("span", {
3959
+ "class": "rp-treeselect__icon-".concat(props.icon)
3960
+ })]), h("span", {
3961
+ "class": "rp-treeselect__tip-text rp-treeselect__".concat(props.type, "-tip-text")
3962
+ }, [children])]);
3963
+ }
3964
+ });
3965
+ // CONCATENATED MODULE: ./src/components/Tip.vue?vue&type=script&lang=js
3966
+ /* harmony default export */ var components_Tipvue_type_script_lang_js = (Tipvue_type_script_lang_js);
3967
+ // CONCATENATED MODULE: ./src/components/Tip.vue
3968
+ var Tip_render, Tip_staticRenderFns
3969
+
3970
+
3971
+
3972
+
3973
+ /* normalize component */
3974
+
3975
+ var Tip_component = normalizeComponent(
3976
+ components_Tipvue_type_script_lang_js,
3977
+ Tip_render,
3978
+ Tip_staticRenderFns,
3979
+ false,
3980
+ null,
3981
+ null,
3982
+ null
3983
+
3984
+ )
3985
+
3986
+ /* hot reload */
3987
+ if (false) { var Tip_api; }
3988
+ Tip_component.options.__file = "src/components/Tip.vue"
3989
+ /* harmony default export */ var Tip = (Tip_component.exports);
3990
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Option.vue?vue&type=script&lang=js
3991
+
3992
+
3993
+
3994
+
3995
+
3996
+ var arrowPlaceholder, checkMark, minusMark;
3997
+ var Option = {
3998
+ name: 'rp-treeselect--option',
3999
+ inject: ['instance'],
4000
+ props: {
4001
+ node: {
4002
+ type: Object,
4003
+ required: true
4004
+ }
4005
+ },
4006
+ computed: {
4007
+ shouldExpand: function shouldExpand() {
4008
+ var instance = this.instance,
4009
+ node = this.node;
4010
+ return node.isBranch && instance.shouldExpand(node);
4011
+ },
4012
+ shouldShow: function shouldShow() {
4013
+ var instance = this.instance,
4014
+ node = this.node;
4015
+ return instance.shouldShowOptionInMenu(node);
4016
+ }
4017
+ },
4018
+ methods: {
4019
+ renderOption: function renderOption() {
4020
+ var h = this.$createElement;
4021
+ var instance = this.instance,
4022
+ node = this.node;
4023
+ var optionClass = {
4024
+ 'rp-treeselect__option': true,
4025
+ 'rp-treeselect__option--disabled': node.isDisabled,
4026
+ 'rp-treeselect__option--selected': instance.isSelected(node),
4027
+ 'rp-treeselect__option--highlight': node.isHighlighted,
4028
+ 'rp-treeselect__option--matched': instance.localSearch.active && node.isMatched,
4029
+ 'rp-treeselect__option--hide': !this.shouldShow
4030
+ };
4031
+ return h("div", {
4032
+ "class": optionClass,
4033
+ on: {
4034
+ "mouseenter": this.handleMouseEnterOption
4035
+ },
4036
+ attrs: {
4037
+ "data-id": node.id
4038
+ }
4039
+ }, [this.renderArrow(), this.renderLabelContainer([this.renderCheckboxContainer([this.renderCheckbox()]), this.renderLabel()])]);
4040
+ },
4041
+ renderSubOptionsList: function renderSubOptionsList() {
4042
+ var h = this.$createElement;
4043
+ if (!this.shouldExpand) return null;
4044
+ return h("div", {
4045
+ "class": "rp-treeselect__list"
4046
+ }, [this.renderSubOptions(), this.renderNoChildrenTip(), this.renderLoadingChildrenTip(), this.renderLoadingChildrenErrorTip()]);
4047
+ },
4048
+ renderArrow: function renderArrow() {
4049
+ var h = this.$createElement;
4050
+ var instance = this.instance,
4051
+ node = this.node;
4052
+ if (instance.shouldFlattenOptions && this.shouldShow) return null;
4053
+ if (node.isBranch) {
4054
+ var transitionProps = {
4055
+ props: {
4056
+ name: 'rp-treeselect__option-arrow--prepare',
4057
+ appear: true
4058
+ }
4059
+ };
4060
+ var arrowClass = {
4061
+ 'rp-treeselect__option-arrow': true,
4062
+ 'rp-treeselect__option-arrow--rotated': this.shouldExpand
4063
+ };
4064
+ return h("div", {
4065
+ "class": "rp-treeselect__option-arrow-container",
4066
+ on: {
4067
+ "mousedown": this.handleMouseDownOnArrow
4068
+ }
4069
+ }, [h("transition", transitionProps, [h(Arrow, {
4070
+ "class": arrowClass
4071
+ })])]);
4072
+ }
4073
+ if (instance.hasBranchNodes) {
4074
+ if (!arrowPlaceholder) arrowPlaceholder = h("div", {
4075
+ "class": "rp-treeselect__option-arrow-placeholder"
4076
+ }, ["\xA0"]);
4077
+ return arrowPlaceholder;
4078
+ }
4079
+ return null;
4080
+ },
4081
+ renderLabelContainer: function renderLabelContainer(children) {
4082
+ var h = this.$createElement;
4083
+ return h("div", {
4084
+ "class": "rp-treeselect__label-container",
4085
+ on: {
4086
+ "mousedown": this.handleMouseDownOnLabelContainer
4087
+ }
4088
+ }, [children]);
4089
+ },
4090
+ renderCheckboxContainer: function renderCheckboxContainer(children) {
4091
+ var h = this.$createElement;
4092
+ var instance = this.instance,
4093
+ node = this.node;
4094
+ if (instance.single) return null;
4095
+ if (instance.disableBranchNodes && node.isBranch) return null;
4096
+ return h("div", {
4097
+ "class": "rp-treeselect__checkbox-container"
4098
+ }, [children]);
4099
+ },
4100
+ renderCheckbox: function renderCheckbox() {
4101
+ var h = this.$createElement;
4102
+ var instance = this.instance,
4103
+ node = this.node;
4104
+ var checkedState = instance.forest.checkedStateMap[node.id];
4105
+ var checkboxClass = {
4106
+ 'rp-treeselect__checkbox': true,
4107
+ 'rp-treeselect__checkbox--checked': checkedState === CHECKED,
4108
+ 'rp-treeselect__checkbox--indeterminate': checkedState === INDETERMINATE,
4109
+ 'rp-treeselect__checkbox--unchecked': checkedState === UNCHECKED,
4110
+ 'rp-treeselect__checkbox--disabled': node.isDisabled
4111
+ };
4112
+ if (!checkMark) checkMark = h("span", {
4113
+ "class": "rp-treeselect__check-mark"
4114
+ });
4115
+ if (!minusMark) minusMark = h("span", {
4116
+ "class": "rp-treeselect__minus-mark"
4117
+ });
4118
+ return h("span", {
4119
+ "class": checkboxClass
4120
+ }, [checkMark, minusMark]);
4121
+ },
4122
+ renderLabel: function renderLabel() {
4123
+ var h = this.$createElement;
4124
+ var instance = this.instance,
4125
+ node = this.node;
4126
+ var shouldShowCount = node.isBranch && (instance.localSearch.active ? instance.showCountOnSearchComputed : instance.showCount);
4127
+ var count = shouldShowCount ? instance.localSearch.active ? instance.localSearch.countMap[node.id][instance.showCountOf] : node.count[instance.showCountOf] : NaN;
4128
+ var labelClassName = 'rp-treeselect__label';
4129
+ var countClassName = 'rp-treeselect__count';
4130
+ var customLabelRenderer = instance.$scopedSlots['option-label'];
4131
+ if (customLabelRenderer) return customLabelRenderer({
4132
+ node: node,
4133
+ shouldShowCount: shouldShowCount,
4134
+ count: count,
4135
+ labelClassName: labelClassName,
4136
+ countClassName: countClassName
4137
+ });
4138
+ return h("label", {
4139
+ "class": labelClassName
4140
+ }, [node.label, shouldShowCount && h("span", {
4141
+ "class": countClassName
4142
+ }, ["(", count, ")"])]);
4143
+ },
4144
+ renderSubOptions: function renderSubOptions() {
4145
+ var h = this.$createElement;
4146
+ var node = this.node;
4147
+ if (!node.childrenStates.isLoaded) return null;
4148
+ return node.children.map(function (childNode) {
4149
+ return h(Option, {
4150
+ attrs: {
4151
+ node: childNode
4152
+ },
4153
+ key: childNode.id
4154
+ });
4155
+ });
4156
+ },
4157
+ renderNoChildrenTip: function renderNoChildrenTip() {
4158
+ var h = this.$createElement;
4159
+ var instance = this.instance,
4160
+ node = this.node;
4161
+ if (!node.childrenStates.isLoaded || node.children.length) return null;
4162
+ return h(Tip, {
4163
+ attrs: {
4164
+ type: "no-children",
4165
+ icon: "warning"
4166
+ }
4167
+ }, [instance.noChildrenText]);
4168
+ },
4169
+ renderLoadingChildrenTip: function renderLoadingChildrenTip() {
4170
+ var h = this.$createElement;
4171
+ var instance = this.instance,
4172
+ node = this.node;
4173
+ if (!node.childrenStates.isLoading) return null;
4174
+ return h(Tip, {
4175
+ attrs: {
4176
+ type: "loading",
4177
+ icon: "loader"
4178
+ }
4179
+ }, [instance.loadingText]);
4180
+ },
4181
+ renderLoadingChildrenErrorTip: function renderLoadingChildrenErrorTip() {
4182
+ var h = this.$createElement;
4183
+ var instance = this.instance,
4184
+ node = this.node;
4185
+ if (!node.childrenStates.loadingError) return null;
4186
+ return h(Tip, {
4187
+ attrs: {
4188
+ type: "error",
4189
+ icon: "error"
4190
+ }
4191
+ }, [node.childrenStates.loadingError, h("a", {
4192
+ "class": "rp-treeselect__retry",
4193
+ attrs: {
4194
+ title: instance.retryTitle
4195
+ },
4196
+ on: {
4197
+ "mousedown": this.handleMouseDownOnRetry
4198
+ }
4199
+ }, [instance.retryText])]);
4200
+ },
4201
+ handleMouseEnterOption: function handleMouseEnterOption(evt) {
4202
+ var instance = this.instance,
4203
+ node = this.node;
4204
+ if (evt.target !== evt.currentTarget) return;
4205
+ instance.setCurrentHighlightedOption(node, false);
4206
+ },
4207
+ handleMouseDownOnArrow: onLeftClick(function handleMouseDownOnOptionArrow() {
4208
+ var instance = this.instance,
4209
+ node = this.node;
4210
+ instance.toggleExpanded(node);
4211
+ }),
4212
+ handleMouseDownOnLabelContainer: onLeftClick(function handleMouseDownOnLabelContainer() {
4213
+ var instance = this.instance,
4214
+ node = this.node;
4215
+ if (node.isBranch && instance.disableBranchNodes) {
4216
+ instance.toggleExpanded(node);
4217
+ } else {
4218
+ instance.select(node);
4219
+ }
4220
+ }),
4221
+ handleMouseDownOnRetry: onLeftClick(function handleMouseDownOnRetry() {
4222
+ var instance = this.instance,
4223
+ node = this.node;
4224
+ instance.loadChildrenOptions(node);
4225
+ })
4226
+ },
4227
+ render: function render() {
4228
+ var h = arguments[0];
4229
+ var node = this.node;
4230
+ var indentLevel = this.instance.shouldFlattenOptions ? 0 : node.level;
4231
+ var listItemClass = defineProperty_default()({
4232
+ 'rp-treeselect__list-item': true
4233
+ }, "rp-treeselect__indent-level-".concat(indentLevel), true);
4234
+ var transitionProps = {
4235
+ props: {
4236
+ name: 'rp-treeselect__list--transition'
4237
+ }
4238
+ };
4239
+ return h("div", {
4240
+ "class": listItemClass
4241
+ }, [this.renderOption(), node.isBranch && h("transition", transitionProps, [this.renderSubOptionsList()])]);
4242
+ }
4243
+ };
4244
+ /* harmony default export */ var Optionvue_type_script_lang_js = (Option);
4245
+ // CONCATENATED MODULE: ./src/components/Option.vue?vue&type=script&lang=js
4246
+ /* harmony default export */ var components_Optionvue_type_script_lang_js = (Optionvue_type_script_lang_js);
4247
+ // CONCATENATED MODULE: ./src/components/Option.vue
4248
+ var Option_render, Option_staticRenderFns
4249
+
4250
+
4251
+
4252
+
4253
+ /* normalize component */
4254
+
4255
+ var Option_component = normalizeComponent(
4256
+ components_Optionvue_type_script_lang_js,
4257
+ Option_render,
4258
+ Option_staticRenderFns,
4259
+ false,
4260
+ null,
4261
+ null,
4262
+ null
4263
+
4264
+ )
4265
+
4266
+ /* hot reload */
4267
+ if (false) { var Option_api; }
4268
+ Option_component.options.__file = "src/components/Option.vue"
4269
+ /* harmony default export */ var components_Option = (Option_component.exports);
4270
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Menu.vue?vue&type=script&lang=js
4271
+
4272
+
4273
+
4274
+
4275
+ var directionMap = {
4276
+ top: 'top',
4277
+ bottom: 'bottom',
4278
+ above: 'top',
4279
+ below: 'bottom'
4280
+ };
4281
+ /* harmony default export */ var Menuvue_type_script_lang_js = ({
4282
+ name: 'rp-treeselect--menu',
4283
+ inject: ['instance'],
4284
+ computed: {
4285
+ menuStyle: function menuStyle() {
4286
+ var instance = this.instance;
4287
+ return {
4288
+ maxHeight: instance.maxHeight + 'px'
4289
+ };
4290
+ },
4291
+ menuContainerStyle: function menuContainerStyle() {
4292
+ var instance = this.instance;
4293
+ return {
4294
+ zIndex: instance.appendToBody ? null : instance.zIndex
4295
+ };
4296
+ }
4297
+ },
4298
+ watch: {
4299
+ 'instance.menu.isOpen': function instanceMenuIsOpen(newValue) {
4300
+ if (newValue) {
4301
+ this.$nextTick(this.onMenuOpen);
4302
+ } else {
4303
+ this.onMenuClose();
4304
+ }
4305
+ }
4306
+ },
4307
+ created: function created() {
4308
+ this.menuSizeWatcher = null;
4309
+ this.menuResizeAndScrollEventListeners = null;
4310
+ },
4311
+ mounted: function mounted() {
4312
+ var instance = this.instance;
4313
+ if (instance.menu.isOpen) this.$nextTick(this.onMenuOpen);
4314
+ },
4315
+ destroyed: function destroyed() {
4316
+ this.onMenuClose();
4317
+ },
4318
+ methods: {
4319
+ renderMenu: function renderMenu() {
4320
+ var h = this.$createElement;
4321
+ var instance = this.instance;
4322
+ if (!instance.menu.isOpen) return null;
4323
+ return h("div", {
4324
+ ref: "menu",
4325
+ "class": "rp-treeselect__menu",
4326
+ on: {
4327
+ "mousedown": instance.handleMouseDown
4328
+ },
4329
+ style: this.menuStyle
4330
+ }, [this.renderBeforeList(), instance.async ? this.renderAsyncSearchMenuInner() : instance.localSearch.active ? this.renderLocalSearchMenuInner() : this.renderNormalMenuInner(), this.renderAfterList()]);
4331
+ },
4332
+ renderBeforeList: function renderBeforeList() {
4333
+ var instance = this.instance;
4334
+ var beforeListRenderer = instance.$scopedSlots['before-list'];
4335
+ return beforeListRenderer ? beforeListRenderer() : null;
4336
+ },
4337
+ renderAfterList: function renderAfterList() {
4338
+ var instance = this.instance;
4339
+ var afterListRenderer = instance.$scopedSlots['after-list'];
4340
+ return afterListRenderer ? afterListRenderer() : null;
4341
+ },
4342
+ renderNormalMenuInner: function renderNormalMenuInner() {
4343
+ var instance = this.instance;
4344
+ if (instance.rootOptionsStates.isLoading) {
4345
+ return this.renderLoadingOptionsTip();
4346
+ } else if (instance.rootOptionsStates.loadingError) {
4347
+ return this.renderLoadingRootOptionsErrorTip();
4348
+ } else if (instance.rootOptionsStates.isLoaded && instance.forest.normalizedOptions.length === 0) {
4349
+ return this.renderNoAvailableOptionsTip();
4350
+ } else {
4351
+ return this.renderOptionList();
4352
+ }
4353
+ },
4354
+ renderLocalSearchMenuInner: function renderLocalSearchMenuInner() {
4355
+ var instance = this.instance;
4356
+ if (instance.rootOptionsStates.isLoading) {
4357
+ return this.renderLoadingOptionsTip();
4358
+ } else if (instance.rootOptionsStates.loadingError) {
4359
+ return this.renderLoadingRootOptionsErrorTip();
4360
+ } else if (instance.rootOptionsStates.isLoaded && instance.forest.normalizedOptions.length === 0) {
4361
+ return this.renderNoAvailableOptionsTip();
4362
+ } else if (instance.localSearch.noResults) {
4363
+ return this.renderNoResultsTip();
4364
+ } else {
4365
+ return this.renderOptionList();
4366
+ }
4367
+ },
4368
+ renderAsyncSearchMenuInner: function renderAsyncSearchMenuInner() {
4369
+ var instance = this.instance;
4370
+ var entry = instance.getRemoteSearchEntry();
4371
+ var shouldShowSearchPromptTip = instance.trigger.searchQuery === '' && !instance.defaultOptions;
4372
+ var shouldShowNoResultsTip = shouldShowSearchPromptTip ? false : entry.isLoaded && entry.options.length === 0;
4373
+ if (shouldShowSearchPromptTip) {
4374
+ return this.renderSearchPromptTip();
4375
+ } else if (entry.isLoading) {
4376
+ return this.renderLoadingOptionsTip();
4377
+ } else if (entry.loadingError) {
4378
+ return this.renderAsyncSearchLoadingErrorTip();
4379
+ } else if (shouldShowNoResultsTip) {
4380
+ return this.renderNoResultsTip();
4381
+ } else {
4382
+ return this.renderOptionList();
4383
+ }
4384
+ },
4385
+ renderOptionList: function renderOptionList() {
4386
+ var h = this.$createElement;
4387
+ var instance = this.instance;
4388
+ return h("div", {
4389
+ "class": "rp-treeselect__list"
4390
+ }, [instance.forest.normalizedOptions.map(function (rootNode) {
4391
+ return h(components_Option, {
4392
+ attrs: {
4393
+ node: rootNode
4394
+ },
4395
+ key: rootNode.id
4396
+ });
4397
+ })]);
4398
+ },
4399
+ renderSearchPromptTip: function renderSearchPromptTip() {
4400
+ var h = this.$createElement;
4401
+ var instance = this.instance;
4402
+ return h(Tip, {
4403
+ attrs: {
4404
+ type: "search-prompt",
4405
+ icon: "warning"
4406
+ }
4407
+ }, [instance.searchPromptText]);
4408
+ },
4409
+ renderLoadingOptionsTip: function renderLoadingOptionsTip() {
4410
+ var h = this.$createElement;
4411
+ var instance = this.instance;
4412
+ return h(Tip, {
4413
+ attrs: {
4414
+ type: "loading",
4415
+ icon: "loader"
4416
+ }
4417
+ }, [instance.loadingText]);
4418
+ },
4419
+ renderLoadingRootOptionsErrorTip: function renderLoadingRootOptionsErrorTip() {
4420
+ var h = this.$createElement;
4421
+ var instance = this.instance;
4422
+ return h(Tip, {
4423
+ attrs: {
4424
+ type: "error",
4425
+ icon: "error"
4426
+ }
4427
+ }, [instance.rootOptionsStates.loadingError, h("a", {
4428
+ "class": "rp-treeselect__retry",
4429
+ on: {
4430
+ "click": instance.loadRootOptions
4431
+ },
4432
+ attrs: {
4433
+ title: instance.retryTitle
4434
+ }
4435
+ }, [instance.retryText])]);
4436
+ },
4437
+ renderAsyncSearchLoadingErrorTip: function renderAsyncSearchLoadingErrorTip() {
4438
+ var h = this.$createElement;
4439
+ var instance = this.instance;
4440
+ var entry = instance.getRemoteSearchEntry();
4441
+ return h(Tip, {
4442
+ attrs: {
4443
+ type: "error",
4444
+ icon: "error"
4445
+ }
4446
+ }, [entry.loadingError, h("a", {
4447
+ "class": "rp-treeselect__retry",
4448
+ on: {
4449
+ "click": instance.handleRemoteSearch
4450
+ },
4451
+ attrs: {
4452
+ title: instance.retryTitle
4453
+ }
4454
+ }, [instance.retryText])]);
4455
+ },
4456
+ renderNoAvailableOptionsTip: function renderNoAvailableOptionsTip() {
4457
+ var h = this.$createElement;
4458
+ var instance = this.instance;
4459
+ return h(Tip, {
4460
+ attrs: {
4461
+ type: "no-options",
4462
+ icon: "warning"
4463
+ }
4464
+ }, [instance.noOptionsText]);
4465
+ },
4466
+ renderNoResultsTip: function renderNoResultsTip() {
4467
+ var h = this.$createElement;
4468
+ var instance = this.instance;
4469
+ return h(Tip, {
4470
+ attrs: {
4471
+ type: "no-results",
4472
+ icon: "warning"
4473
+ }
4474
+ }, [instance.noResultsText]);
4475
+ },
4476
+ onMenuOpen: function onMenuOpen() {
4477
+ this.adjustMenuOpenDirection();
4478
+ this.setupMenuSizeWatcher();
4479
+ this.setupMenuResizeAndScrollEventListeners();
4480
+ },
4481
+ onMenuClose: function onMenuClose() {
4482
+ this.removeMenuSizeWatcher();
4483
+ this.removeMenuResizeAndScrollEventListeners();
4484
+ },
4485
+ adjustMenuOpenDirection: function adjustMenuOpenDirection() {
4486
+ var instance = this.instance;
4487
+ if (!instance.menu.isOpen) return;
4488
+ var $menu = instance.getMenu();
4489
+ var $control = instance.getControl();
4490
+ var menuRect = $menu.getBoundingClientRect();
4491
+ var controlRect = $control.getBoundingClientRect();
4492
+ var menuHeight = menuRect.height;
4493
+ var viewportHeight = window.innerHeight;
4494
+ var spaceAbove = controlRect.top;
4495
+ var spaceBelow = window.innerHeight - controlRect.bottom;
4496
+ var isControlInViewport = controlRect.top >= 0 && controlRect.top <= viewportHeight || controlRect.top < 0 && controlRect.bottom > 0;
4497
+ var hasEnoughSpaceBelow = spaceBelow > menuHeight + MENU_BUFFER;
4498
+ var hasEnoughSpaceAbove = spaceAbove > menuHeight + MENU_BUFFER;
4499
+ if (!isControlInViewport) {
4500
+ instance.closeMenu();
4501
+ } else if (instance.openDirection !== 'auto') {
4502
+ instance.menu.placement = directionMap[instance.openDirection];
4503
+ } else if (hasEnoughSpaceBelow || !hasEnoughSpaceAbove) {
4504
+ instance.menu.placement = 'bottom';
4505
+ } else {
4506
+ instance.menu.placement = 'top';
4507
+ }
4508
+ },
4509
+ setupMenuSizeWatcher: function setupMenuSizeWatcher() {
4510
+ var instance = this.instance;
4511
+ var $menu = instance.getMenu();
4512
+ if (this.menuSizeWatcher) return;
4513
+ this.menuSizeWatcher = {
4514
+ remove: watchSize($menu, this.adjustMenuOpenDirection)
4515
+ };
4516
+ },
4517
+ setupMenuResizeAndScrollEventListeners: function setupMenuResizeAndScrollEventListeners() {
4518
+ var instance = this.instance;
4519
+ var $control = instance.getControl();
4520
+ if (this.menuResizeAndScrollEventListeners) return;
4521
+ this.menuResizeAndScrollEventListeners = {
4522
+ remove: setupResizeAndScrollEventListeners($control, this.adjustMenuOpenDirection)
4523
+ };
4524
+ },
4525
+ removeMenuSizeWatcher: function removeMenuSizeWatcher() {
4526
+ if (!this.menuSizeWatcher) return;
4527
+ this.menuSizeWatcher.remove();
4528
+ this.menuSizeWatcher = null;
4529
+ },
4530
+ removeMenuResizeAndScrollEventListeners: function removeMenuResizeAndScrollEventListeners() {
4531
+ if (!this.menuResizeAndScrollEventListeners) return;
4532
+ this.menuResizeAndScrollEventListeners.remove();
4533
+ this.menuResizeAndScrollEventListeners = null;
4534
+ }
4535
+ },
4536
+ render: function render() {
4537
+ var h = arguments[0];
4538
+ return h("div", {
4539
+ ref: "menu-container",
4540
+ "class": "rp-treeselect__menu-container",
4541
+ style: this.menuContainerStyle
4542
+ }, [h("transition", {
4543
+ attrs: {
4544
+ name: "rp-treeselect__menu--transition"
4545
+ }
4546
+ }, [this.renderMenu()])]);
4547
+ }
4548
+ });
4549
+ // CONCATENATED MODULE: ./src/components/Menu.vue?vue&type=script&lang=js
4550
+ /* harmony default export */ var components_Menuvue_type_script_lang_js = (Menuvue_type_script_lang_js);
4551
+ // CONCATENATED MODULE: ./src/components/Menu.vue
4552
+ var Menu_render, Menu_staticRenderFns
4553
+
4554
+
4555
+
4556
+
4557
+ /* normalize component */
4558
+
4559
+ var Menu_component = normalizeComponent(
4560
+ components_Menuvue_type_script_lang_js,
4561
+ Menu_render,
4562
+ Menu_staticRenderFns,
4563
+ false,
4564
+ null,
4565
+ null,
4566
+ null
4567
+
4568
+ )
4569
+
4570
+ /* hot reload */
4571
+ if (false) { var Menu_api; }
4572
+ Menu_component.options.__file = "src/components/Menu.vue"
4573
+ /* harmony default export */ var Menu = (Menu_component.exports);
4574
+ // EXTERNAL MODULE: external "Vue"
4575
+ var external_Vue_ = __webpack_require__(40);
4576
+ var external_Vue_default = /*#__PURE__*/__webpack_require__.n(external_Vue_);
4577
+
4578
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MenuPortal.vue?vue&type=script&lang=js
4579
+
4580
+ function MenuPortalvue_type_script_lang_js_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4581
+ function MenuPortalvue_type_script_lang_js_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? MenuPortalvue_type_script_lang_js_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : MenuPortalvue_type_script_lang_js_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4582
+
4583
+
4584
+
4585
+ var PortalTarget = {
4586
+ name: 'rp-treeselect--portal-target',
4587
+ inject: ['instance'],
4588
+ watch: {
4589
+ 'instance.menu.isOpen': function instanceMenuIsOpen(newValue) {
4590
+ if (newValue) {
4591
+ this.setupHandlers();
4592
+ } else {
4593
+ this.removeHandlers();
4594
+ }
4595
+ },
4596
+ 'instance.menu.placement': function instanceMenuPlacement() {
4597
+ this.updateMenuContainerOffset();
4598
+ }
4599
+ },
4600
+ created: function created() {
4601
+ this.controlResizeAndScrollEventListeners = null;
4602
+ this.controlSizeWatcher = null;
4603
+ },
4604
+ mounted: function mounted() {
4605
+ var instance = this.instance;
4606
+ if (instance.menu.isOpen) this.setupHandlers();
4607
+ },
4608
+ methods: {
4609
+ setupHandlers: function setupHandlers() {
4610
+ this.updateWidth();
4611
+ this.updateMenuContainerOffset();
4612
+ this.setupControlResizeAndScrollEventListeners();
4613
+ this.setupControlSizeWatcher();
4614
+ },
4615
+ removeHandlers: function removeHandlers() {
4616
+ this.removeControlResizeAndScrollEventListeners();
4617
+ this.removeControlSizeWatcher();
4618
+ },
4619
+ setupControlResizeAndScrollEventListeners: function setupControlResizeAndScrollEventListeners() {
4620
+ var instance = this.instance;
4621
+ var $control = instance.getControl();
4622
+ if (this.controlResizeAndScrollEventListeners) return;
4623
+ this.controlResizeAndScrollEventListeners = {
4624
+ remove: setupResizeAndScrollEventListeners($control, this.updateMenuContainerOffset)
4625
+ };
4626
+ },
4627
+ setupControlSizeWatcher: function setupControlSizeWatcher() {
4628
+ var _this = this;
4629
+ var instance = this.instance;
4630
+ var $control = instance.getControl();
4631
+ if (this.controlSizeWatcher) return;
4632
+ this.controlSizeWatcher = {
4633
+ remove: watchSize($control, function () {
4634
+ _this.updateWidth();
4635
+ _this.updateMenuContainerOffset();
4636
+ })
4637
+ };
4638
+ },
4639
+ removeControlResizeAndScrollEventListeners: function removeControlResizeAndScrollEventListeners() {
4640
+ if (!this.controlResizeAndScrollEventListeners) return;
4641
+ this.controlResizeAndScrollEventListeners.remove();
4642
+ this.controlResizeAndScrollEventListeners = null;
4643
+ },
4644
+ removeControlSizeWatcher: function removeControlSizeWatcher() {
4645
+ if (!this.controlSizeWatcher) return;
4646
+ this.controlSizeWatcher.remove();
4647
+ this.controlSizeWatcher = null;
4648
+ },
4649
+ updateWidth: function updateWidth() {
4650
+ var instance = this.instance;
4651
+ var $portalTarget = this.$el;
4652
+ var $control = instance.getControl();
4653
+ var controlRect = $control.getBoundingClientRect();
4654
+ $portalTarget.style.width = controlRect.width + 'px';
4655
+ },
4656
+ updateMenuContainerOffset: function updateMenuContainerOffset() {
4657
+ var instance = this.instance;
4658
+ var $control = instance.getControl();
4659
+ var $portalTarget = this.$el;
4660
+ var controlRect = $control.getBoundingClientRect();
4661
+ var portalTargetRect = $portalTarget.getBoundingClientRect();
4662
+ var offsetY = instance.menu.placement === 'bottom' ? controlRect.height : 0;
4663
+ var left = Math.round(controlRect.left - portalTargetRect.left) + 'px';
4664
+ var top = Math.round(controlRect.top - portalTargetRect.top + offsetY) + 'px';
4665
+ var menuContainerStyle = this.$refs.menu.$refs['menu-container'].style;
4666
+ var transformVariations = ['transform', 'webkitTransform', 'MozTransform', 'msTransform'];
4667
+ var transform = find(transformVariations, function (t) {
4668
+ return t in document.body.style;
4669
+ });
4670
+ menuContainerStyle[transform] = "translate(".concat(left, ", ").concat(top, ")");
4671
+ }
4672
+ },
4673
+ render: function render() {
4674
+ var h = arguments[0];
4675
+ var instance = this.instance;
4676
+ var portalTargetClass = ['rp-treeselect__portal-target', instance.wrapperClass];
4677
+ var portalTargetStyle = {
4678
+ zIndex: instance.zIndex
4679
+ };
4680
+ return h("div", {
4681
+ "class": portalTargetClass,
4682
+ style: portalTargetStyle,
4683
+ attrs: {
4684
+ "data-instance-id": instance.getInstanceId()
4685
+ }
4686
+ }, [h(Menu, {
4687
+ ref: "menu"
4688
+ })]);
4689
+ },
4690
+ destroyed: function destroyed() {
4691
+ this.removeHandlers();
4692
+ }
4693
+ };
4694
+ var placeholder;
4695
+ /* harmony default export */ var MenuPortalvue_type_script_lang_js = ({
4696
+ name: 'rp-treeselect--menu-portal',
4697
+ created: function created() {
4698
+ this.portalTarget = null;
4699
+ },
4700
+ mounted: function mounted() {
4701
+ this.setup();
4702
+ },
4703
+ destroyed: function destroyed() {
4704
+ this.teardown();
4705
+ },
4706
+ methods: {
4707
+ setup: function setup() {
4708
+ var el = document.createElement('div');
4709
+ document.body.appendChild(el);
4710
+ this.portalTarget = new external_Vue_default.a(MenuPortalvue_type_script_lang_js_objectSpread({
4711
+ el: el,
4712
+ parent: this
4713
+ }, PortalTarget));
4714
+ },
4715
+ teardown: function teardown() {
4716
+ document.body.removeChild(this.portalTarget.$el);
4717
+ this.portalTarget.$el.innerHTML = '';
4718
+ this.portalTarget.$destroy();
4719
+ this.portalTarget = null;
4720
+ }
4721
+ },
4722
+ render: function render() {
4723
+ var h = arguments[0];
4724
+ if (!placeholder) placeholder = h("div", {
4725
+ "class": "rp-treeselect__menu-placeholder"
4726
+ });
4727
+ return placeholder;
4728
+ }
4729
+ });
4730
+ // CONCATENATED MODULE: ./src/components/MenuPortal.vue?vue&type=script&lang=js
4731
+ /* harmony default export */ var components_MenuPortalvue_type_script_lang_js = (MenuPortalvue_type_script_lang_js);
4732
+ // CONCATENATED MODULE: ./src/components/MenuPortal.vue
4733
+ var MenuPortal_render, MenuPortal_staticRenderFns
4734
+
4735
+
4736
+
4737
+
4738
+ /* normalize component */
4739
+
4740
+ var MenuPortal_component = normalizeComponent(
4741
+ components_MenuPortalvue_type_script_lang_js,
4742
+ MenuPortal_render,
4743
+ MenuPortal_staticRenderFns,
4744
+ false,
4745
+ null,
4746
+ null,
4747
+ null
4748
+
4749
+ )
4750
+
4751
+ /* hot reload */
4752
+ if (false) { var MenuPortal_api; }
4753
+ MenuPortal_component.options.__file = "src/components/MenuPortal.vue"
4754
+ /* harmony default export */ var MenuPortal = (MenuPortal_component.exports);
4755
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Treeselect.vue?vue&type=script&lang=js
4756
+
4757
+
4758
+
4759
+
4760
+
4761
+ /* harmony default export */ var Treeselectvue_type_script_lang_js = ({
4762
+ name: 'rp-treeselect',
4763
+ mixins: [treeselectMixin],
4764
+ computed: {
4765
+ wrapperClass: function wrapperClass() {
4766
+ return {
4767
+ 'rp-treeselect': true,
4768
+ 'rp-treeselect--single': this.single,
4769
+ 'rp-treeselect--multi': this.multiple,
4770
+ 'rp-treeselect--searchable': this.searchable,
4771
+ 'rp-treeselect--disabled': this.disabled,
4772
+ 'rp-treeselect--focused': this.trigger.isFocused,
4773
+ 'rp-treeselect--has-value': this.hasValue,
4774
+ 'rp-treeselect--open': this.menu.isOpen,
4775
+ 'rp-treeselect--open-above': this.menu.placement === 'top',
4776
+ 'rp-treeselect--open-below': this.menu.placement === 'bottom',
4777
+ 'rp-treeselect--branch-nodes-disabled': this.disableBranchNodes,
4778
+ 'rp-treeselect--append-to-body': this.appendToBody,
4779
+ 'rp-treeselect--test': true
4780
+ };
4781
+ }
4782
+ },
4783
+ render: function render() {
4784
+ var h = arguments[0];
4785
+ return h("div", {
4786
+ ref: "wrapper",
4787
+ "class": this.wrapperClass
4788
+ }, [h(HiddenFields), h(Control, {
4789
+ ref: "control"
4790
+ }), this.appendToBody ? h(MenuPortal, {
4791
+ ref: "portal"
4792
+ }) : h(Menu, {
4793
+ ref: "menu"
4794
+ })]);
4795
+ }
4796
+ });
4797
+ // CONCATENATED MODULE: ./src/components/Treeselect.vue?vue&type=script&lang=js
4798
+ /* harmony default export */ var components_Treeselectvue_type_script_lang_js = (Treeselectvue_type_script_lang_js);
4799
+ // CONCATENATED MODULE: ./src/components/Treeselect.vue
4800
+ var Treeselect_render, Treeselect_staticRenderFns
4801
+
4802
+
4803
+
4804
+
4805
+ /* normalize component */
4806
+
4807
+ var Treeselect_component = normalizeComponent(
4808
+ components_Treeselectvue_type_script_lang_js,
4809
+ Treeselect_render,
4810
+ Treeselect_staticRenderFns,
4811
+ false,
4812
+ null,
4813
+ null,
4814
+ null
4815
+
4816
+ )
4817
+
4818
+ /* hot reload */
4819
+ if (false) { var Treeselect_api; }
4820
+ Treeselect_component.options.__file = "src/components/Treeselect.vue"
4821
+ /* harmony default export */ var Treeselect = (Treeselect_component.exports);
4822
+ // EXTERNAL MODULE: ./src/style.less
4823
+ var style = __webpack_require__(41);
4824
+
4825
+ // CONCATENATED MODULE: ./src/index.js
4826
+
4827
+
4828
+
4829
+ /* harmony default export */ var src = __webpack_exports__["default"] = (Treeselect);
4830
+
4831
+
4832
+ var VERSION = "0.0.0";
4833
+
4834
+ /***/ })
4835
+ /******/ ]);
4836
+ });
4837
+ //# sourceMappingURL=rp-treeselect.umd.js.map