bk-magic-vue 2.5.7 → 2.5.8-beta.2
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.
- package/dist/bk-magic-vue.css +6 -6
- package/dist/bk-magic-vue.js +1740 -1670
- package/dist/bk-magic-vue.min.css +1 -1
- package/dist/bk-magic-vue.min.css.gz +0 -0
- package/dist/bk-magic-vue.min.css.map +1 -1
- package/dist/bk-magic-vue.min.js +1 -1
- package/dist/bk-magic-vue.min.js.gz +0 -0
- package/dist/bk-magic-vue.min.js.map +1 -1
- package/lib/big-tree.js +144 -140
- package/lib/cascade.js +60 -52
- package/lib/checkbox.js +42 -49
- package/lib/date-picker.js +93 -31
- package/lib/dialog.js +100 -94
- package/lib/directives/overflow-tips.js +18 -3
- package/lib/directives/tooltips.js +18 -3
- package/lib/form-item.js +92 -86
- package/lib/icon.js +17 -2
- package/lib/image-viewer.js +15 -0
- package/lib/image.js +15 -0
- package/lib/info-box.js +120 -116
- package/lib/message.js +15 -0
- package/lib/navigation-menu.js +29 -36
- package/lib/notify.js +17 -2
- package/lib/option-group.js +42 -49
- package/lib/option.js +42 -49
- package/lib/pagination.js +78 -72
- package/lib/popconfirm.js +18 -3
- package/lib/popover.js +18 -3
- package/lib/resize-layout.js +15 -0
- package/lib/row.js +17 -2
- package/lib/search-select.js +317 -319
- package/lib/select.js +78 -72
- package/lib/sideslider.js +24 -31
- package/lib/slider.js +16 -1
- package/lib/steps.js +47 -56
- package/lib/tab.js +82 -91
- package/lib/table-column.js +72 -68
- package/lib/table-setting-content.js +42 -49
- package/lib/table.js +100 -96
- package/lib/tag-input.js +53 -42
- package/lib/time-picker.js +44 -26
- package/lib/timeline.js +17 -2
- package/lib/transfer.js +18 -3
- package/lib/tree.js +27 -24
- package/lib/ui/bk-magic-vue.css +6 -6
- package/lib/ui/bk-magic-vue.min.css +1 -1
- package/lib/ui/bk-magic-vue.min.css.gz +0 -0
- package/lib/ui/bk-magic-vue.min.css.map +1 -1
- package/lib/ui/form.css +6 -6
- package/lib/ui/form.min.css +1 -1
- package/lib/ui/form.min.css.map +1 -1
- package/lib/upload.js +69 -61
- package/lib/utils/tippy.js +16 -1
- package/lib/version-detail.js +191 -191
- package/lib/virtual-render.js +17 -2
- package/package.json +1 -1
package/dist/bk-magic-vue.js
CHANGED
|
@@ -7,6 +7,33 @@
|
|
|
7
7
|
Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue;
|
|
8
8
|
path = path && path.hasOwnProperty('default') ? path['default'] : path;
|
|
9
9
|
|
|
10
|
+
function _iterableToArrayLimit(arr, i) {
|
|
11
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
12
|
+
if (null != _i) {
|
|
13
|
+
var _s,
|
|
14
|
+
_e,
|
|
15
|
+
_x,
|
|
16
|
+
_r,
|
|
17
|
+
_arr = [],
|
|
18
|
+
_n = !0,
|
|
19
|
+
_d = !1;
|
|
20
|
+
try {
|
|
21
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
22
|
+
if (Object(_i) !== _i) return;
|
|
23
|
+
_n = !1;
|
|
24
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
_d = !0, _e = err;
|
|
27
|
+
} finally {
|
|
28
|
+
try {
|
|
29
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
30
|
+
} finally {
|
|
31
|
+
if (_d) throw _e;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return _arr;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
10
37
|
function _regeneratorRuntime() {
|
|
11
38
|
_regeneratorRuntime = function () {
|
|
12
39
|
return exports;
|
|
@@ -142,14 +169,9 @@
|
|
|
142
169
|
};
|
|
143
170
|
}
|
|
144
171
|
function maybeInvokeDelegate(delegate, context) {
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
149
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
150
|
-
}
|
|
151
|
-
return ContinueSentinel;
|
|
152
|
-
}
|
|
172
|
+
var methodName = context.method,
|
|
173
|
+
method = delegate.iterator[methodName];
|
|
174
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
153
175
|
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
154
176
|
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
155
177
|
var info = record.arg;
|
|
@@ -363,7 +385,7 @@
|
|
|
363
385
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
364
386
|
descriptor.configurable = true;
|
|
365
387
|
if ("value" in descriptor) descriptor.writable = true;
|
|
366
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
388
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
367
389
|
}
|
|
368
390
|
}
|
|
369
391
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
@@ -375,6 +397,7 @@
|
|
|
375
397
|
return Constructor;
|
|
376
398
|
}
|
|
377
399
|
function _defineProperty(obj, key, value) {
|
|
400
|
+
key = _toPropertyKey(key);
|
|
378
401
|
if (key in obj) {
|
|
379
402
|
Object.defineProperty(obj, key, {
|
|
380
403
|
value: value,
|
|
@@ -464,30 +487,6 @@
|
|
|
464
487
|
function _iterableToArray(iter) {
|
|
465
488
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
466
489
|
}
|
|
467
|
-
function _iterableToArrayLimit(arr, i) {
|
|
468
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
469
|
-
if (_i == null) return;
|
|
470
|
-
var _arr = [];
|
|
471
|
-
var _n = true;
|
|
472
|
-
var _d = false;
|
|
473
|
-
var _s, _e;
|
|
474
|
-
try {
|
|
475
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
476
|
-
_arr.push(_s.value);
|
|
477
|
-
if (i && _arr.length === i) break;
|
|
478
|
-
}
|
|
479
|
-
} catch (err) {
|
|
480
|
-
_d = true;
|
|
481
|
-
_e = err;
|
|
482
|
-
} finally {
|
|
483
|
-
try {
|
|
484
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
485
|
-
} finally {
|
|
486
|
-
if (_d) throw _e;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
return _arr;
|
|
490
|
-
}
|
|
491
490
|
function _unsupportedIterableToArray(o, minLen) {
|
|
492
491
|
if (!o) return;
|
|
493
492
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -558,6 +557,20 @@
|
|
|
558
557
|
}
|
|
559
558
|
};
|
|
560
559
|
}
|
|
560
|
+
function _toPrimitive(input, hint) {
|
|
561
|
+
if (typeof input !== "object" || input === null) return input;
|
|
562
|
+
var prim = input[Symbol.toPrimitive];
|
|
563
|
+
if (prim !== undefined) {
|
|
564
|
+
var res = prim.call(input, hint || "default");
|
|
565
|
+
if (typeof res !== "object") return res;
|
|
566
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
567
|
+
}
|
|
568
|
+
return (hint === "string" ? String : Number)(input);
|
|
569
|
+
}
|
|
570
|
+
function _toPropertyKey(arg) {
|
|
571
|
+
var key = _toPrimitive(arg, "string");
|
|
572
|
+
return typeof key === "symbol" ? key : String(key);
|
|
573
|
+
}
|
|
561
574
|
|
|
562
575
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
563
576
|
|
|
@@ -641,7 +654,7 @@
|
|
|
641
654
|
return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
|
|
642
655
|
});
|
|
643
656
|
|
|
644
|
-
var _toPrimitive = function (it, S) {
|
|
657
|
+
var _toPrimitive$1 = function (it, S) {
|
|
645
658
|
if (!_isObject(it)) return it;
|
|
646
659
|
var fn, val;
|
|
647
660
|
if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
|
|
@@ -653,7 +666,7 @@
|
|
|
653
666
|
var dP = Object.defineProperty;
|
|
654
667
|
var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
|
|
655
668
|
_anObject(O);
|
|
656
|
-
P = _toPrimitive(P, true);
|
|
669
|
+
P = _toPrimitive$1(P, true);
|
|
657
670
|
_anObject(Attributes);
|
|
658
671
|
if (_ie8DomDefine) try {
|
|
659
672
|
return dP(O, P, Attributes);
|
|
@@ -2743,47 +2756,45 @@
|
|
|
2743
2756
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
2744
2757
|
var shouldChange, oldValue, newValue, groupValue;
|
|
2745
2758
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2746
|
-
while (1) {
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
return _context.stop();
|
|
2786
|
-
}
|
|
2759
|
+
while (1) switch (_context.prev = _context.next) {
|
|
2760
|
+
case 0:
|
|
2761
|
+
if (!_this.disabled) {
|
|
2762
|
+
_context.next = 2;
|
|
2763
|
+
break;
|
|
2764
|
+
}
|
|
2765
|
+
return _context.abrupt("return", false);
|
|
2766
|
+
case 2:
|
|
2767
|
+
if (!(typeof _this.beforeChange === 'function')) {
|
|
2768
|
+
_context.next = 8;
|
|
2769
|
+
break;
|
|
2770
|
+
}
|
|
2771
|
+
_context.next = 5;
|
|
2772
|
+
return _this.beforeChange();
|
|
2773
|
+
case 5:
|
|
2774
|
+
shouldChange = _context.sent;
|
|
2775
|
+
if (!(shouldChange === false)) {
|
|
2776
|
+
_context.next = 8;
|
|
2777
|
+
break;
|
|
2778
|
+
}
|
|
2779
|
+
return _context.abrupt("return");
|
|
2780
|
+
case 8:
|
|
2781
|
+
oldValue = _this.localValue;
|
|
2782
|
+
if (_this.indeterminate) {
|
|
2783
|
+
newValue = _this.localTrueValue;
|
|
2784
|
+
} else {
|
|
2785
|
+
newValue = oldValue === _this.localTrueValue ? _this.falseValue : _this.localTrueValue;
|
|
2786
|
+
}
|
|
2787
|
+
_this.localValue = newValue;
|
|
2788
|
+
_this.$emit('input', newValue, _this.localTrueValue);
|
|
2789
|
+
_this.$emit('change', newValue, oldValue, _this.localTrueValue);
|
|
2790
|
+
_this.dispatch('bk-form-item', 'form-change');
|
|
2791
|
+
if (_this.parent) {
|
|
2792
|
+
groupValue = _this.localTrueValue === undefined ? newValue : _this.localTrueValue;
|
|
2793
|
+
_this.parent.handleChange(_this.selected, groupValue);
|
|
2794
|
+
}
|
|
2795
|
+
case 15:
|
|
2796
|
+
case "end":
|
|
2797
|
+
return _context.stop();
|
|
2787
2798
|
}
|
|
2788
2799
|
}, _callee);
|
|
2789
2800
|
}))();
|
|
@@ -4665,261 +4676,277 @@
|
|
|
4665
4676
|
staticRenderFns: __vue_staticRenderFns__$d
|
|
4666
4677
|
}, __vue_inject_styles__$d, __vue_script__$d, __vue_scope_id__$d, __vue_is_functional_template__$d, __vue_module_identifier__$d, false, undefined, undefined, undefined);
|
|
4667
4678
|
|
|
4668
|
-
var tinycolor = createCommonjsModule(function (module) {
|
|
4669
|
-
(function(
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4679
|
+
var tinycolor = createCommonjsModule(function (module, exports) {
|
|
4680
|
+
(function (global, factory) {
|
|
4681
|
+
module.exports = factory() ;
|
|
4682
|
+
})(commonjsGlobal, (function () { function _typeof(obj) {
|
|
4683
|
+
"@babel/helpers - typeof";
|
|
4684
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
4685
|
+
return typeof obj;
|
|
4686
|
+
} : function (obj) {
|
|
4687
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
4688
|
+
}, _typeof(obj);
|
|
4689
|
+
}
|
|
4690
|
+
var trimLeft = /^\s+/;
|
|
4691
|
+
var trimRight = /\s+$/;
|
|
4692
|
+
function tinycolor(color, opts) {
|
|
4693
|
+
color = color ? color : "";
|
|
4694
|
+
opts = opts || {};
|
|
4680
4695
|
if (color instanceof tinycolor) {
|
|
4681
|
-
|
|
4696
|
+
return color;
|
|
4682
4697
|
}
|
|
4683
4698
|
if (!(this instanceof tinycolor)) {
|
|
4684
|
-
|
|
4699
|
+
return new tinycolor(color, opts);
|
|
4685
4700
|
}
|
|
4686
4701
|
var rgb = inputToRGB(color);
|
|
4687
|
-
this._originalInput = color,
|
|
4688
|
-
this._r = rgb.r,
|
|
4689
|
-
this._g = rgb.g,
|
|
4690
|
-
this._b = rgb.b,
|
|
4691
|
-
this._a = rgb.a,
|
|
4692
|
-
this._roundA = mathRound(100*this._a) / 100,
|
|
4693
|
-
this._format = opts.format || rgb.format;
|
|
4702
|
+
this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
|
|
4694
4703
|
this._gradientType = opts.gradientType;
|
|
4695
|
-
if (this._r < 1)
|
|
4696
|
-
if (this._g < 1)
|
|
4697
|
-
if (this._b < 1)
|
|
4704
|
+
if (this._r < 1) this._r = Math.round(this._r);
|
|
4705
|
+
if (this._g < 1) this._g = Math.round(this._g);
|
|
4706
|
+
if (this._b < 1) this._b = Math.round(this._b);
|
|
4698
4707
|
this._ok = rgb.ok;
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
return this.getBrightness() < 128;
|
|
4708
|
+
}
|
|
4709
|
+
tinycolor.prototype = {
|
|
4710
|
+
isDark: function isDark() {
|
|
4711
|
+
return this.getBrightness() < 128;
|
|
4704
4712
|
},
|
|
4705
|
-
isLight: function() {
|
|
4706
|
-
|
|
4713
|
+
isLight: function isLight() {
|
|
4714
|
+
return !this.isDark();
|
|
4707
4715
|
},
|
|
4708
|
-
isValid: function() {
|
|
4709
|
-
|
|
4716
|
+
isValid: function isValid() {
|
|
4717
|
+
return this._ok;
|
|
4710
4718
|
},
|
|
4711
|
-
getOriginalInput: function() {
|
|
4719
|
+
getOriginalInput: function getOriginalInput() {
|
|
4712
4720
|
return this._originalInput;
|
|
4713
4721
|
},
|
|
4714
|
-
getFormat: function() {
|
|
4715
|
-
|
|
4716
|
-
},
|
|
4717
|
-
getAlpha: function() {
|
|
4718
|
-
|
|
4719
|
-
},
|
|
4720
|
-
getBrightness: function() {
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
},
|
|
4724
|
-
getLuminance: function() {
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
},
|
|
4735
|
-
setAlpha: function(value) {
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4722
|
+
getFormat: function getFormat() {
|
|
4723
|
+
return this._format;
|
|
4724
|
+
},
|
|
4725
|
+
getAlpha: function getAlpha() {
|
|
4726
|
+
return this._a;
|
|
4727
|
+
},
|
|
4728
|
+
getBrightness: function getBrightness() {
|
|
4729
|
+
var rgb = this.toRgb();
|
|
4730
|
+
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
|
|
4731
|
+
},
|
|
4732
|
+
getLuminance: function getLuminance() {
|
|
4733
|
+
var rgb = this.toRgb();
|
|
4734
|
+
var RsRGB, GsRGB, BsRGB, R, G, B;
|
|
4735
|
+
RsRGB = rgb.r / 255;
|
|
4736
|
+
GsRGB = rgb.g / 255;
|
|
4737
|
+
BsRGB = rgb.b / 255;
|
|
4738
|
+
if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
|
|
4739
|
+
if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
|
|
4740
|
+
if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
|
|
4741
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
4742
|
+
},
|
|
4743
|
+
setAlpha: function setAlpha(value) {
|
|
4744
|
+
this._a = boundAlpha(value);
|
|
4745
|
+
this._roundA = Math.round(100 * this._a) / 100;
|
|
4746
|
+
return this;
|
|
4747
|
+
},
|
|
4748
|
+
toHsv: function toHsv() {
|
|
4749
|
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
|
4750
|
+
return {
|
|
4751
|
+
h: hsv.h * 360,
|
|
4752
|
+
s: hsv.s,
|
|
4753
|
+
v: hsv.v,
|
|
4754
|
+
a: this._a
|
|
4755
|
+
};
|
|
4739
4756
|
},
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4757
|
+
toHsvString: function toHsvString() {
|
|
4758
|
+
var hsv = rgbToHsv(this._r, this._g, this._b);
|
|
4759
|
+
var h = Math.round(hsv.h * 360),
|
|
4760
|
+
s = Math.round(hsv.s * 100),
|
|
4761
|
+
v = Math.round(hsv.v * 100);
|
|
4762
|
+
return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
|
|
4743
4763
|
},
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4764
|
+
toHsl: function toHsl() {
|
|
4765
|
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
|
4766
|
+
return {
|
|
4767
|
+
h: hsl.h * 360,
|
|
4768
|
+
s: hsl.s,
|
|
4769
|
+
l: hsl.l,
|
|
4770
|
+
a: this._a
|
|
4771
|
+
};
|
|
4750
4772
|
},
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4773
|
+
toHslString: function toHslString() {
|
|
4774
|
+
var hsl = rgbToHsl(this._r, this._g, this._b);
|
|
4775
|
+
var h = Math.round(hsl.h * 360),
|
|
4776
|
+
s = Math.round(hsl.s * 100),
|
|
4777
|
+
l = Math.round(hsl.l * 100);
|
|
4778
|
+
return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
|
|
4754
4779
|
},
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
|
|
4758
|
-
return (this._a == 1) ?
|
|
4759
|
-
"hsl(" + h + ", " + s + "%, " + l + "%)" :
|
|
4760
|
-
"hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
|
|
4780
|
+
toHex: function toHex(allow3Char) {
|
|
4781
|
+
return rgbToHex(this._r, this._g, this._b, allow3Char);
|
|
4761
4782
|
},
|
|
4762
|
-
|
|
4763
|
-
|
|
4783
|
+
toHexString: function toHexString(allow3Char) {
|
|
4784
|
+
return "#" + this.toHex(allow3Char);
|
|
4764
4785
|
},
|
|
4765
|
-
|
|
4766
|
-
|
|
4786
|
+
toHex8: function toHex8(allow4Char) {
|
|
4787
|
+
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
|
|
4767
4788
|
},
|
|
4768
|
-
|
|
4769
|
-
|
|
4789
|
+
toHex8String: function toHex8String(allow4Char) {
|
|
4790
|
+
return "#" + this.toHex8(allow4Char);
|
|
4770
4791
|
},
|
|
4771
|
-
|
|
4772
|
-
|
|
4792
|
+
toRgb: function toRgb() {
|
|
4793
|
+
return {
|
|
4794
|
+
r: Math.round(this._r),
|
|
4795
|
+
g: Math.round(this._g),
|
|
4796
|
+
b: Math.round(this._b),
|
|
4797
|
+
a: this._a
|
|
4798
|
+
};
|
|
4773
4799
|
},
|
|
4774
|
-
|
|
4775
|
-
|
|
4800
|
+
toRgbString: function toRgbString() {
|
|
4801
|
+
return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
|
|
4776
4802
|
},
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4803
|
+
toPercentageRgb: function toPercentageRgb() {
|
|
4804
|
+
return {
|
|
4805
|
+
r: Math.round(bound01(this._r, 255) * 100) + "%",
|
|
4806
|
+
g: Math.round(bound01(this._g, 255) * 100) + "%",
|
|
4807
|
+
b: Math.round(bound01(this._b, 255) * 100) + "%",
|
|
4808
|
+
a: this._a
|
|
4809
|
+
};
|
|
4781
4810
|
},
|
|
4782
|
-
|
|
4783
|
-
|
|
4811
|
+
toPercentageRgbString: function toPercentageRgbString() {
|
|
4812
|
+
return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
|
4784
4813
|
},
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4814
|
+
toName: function toName() {
|
|
4815
|
+
if (this._a === 0) {
|
|
4816
|
+
return "transparent";
|
|
4817
|
+
}
|
|
4818
|
+
if (this._a < 1) {
|
|
4819
|
+
return false;
|
|
4820
|
+
}
|
|
4821
|
+
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
|
|
4789
4822
|
},
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
toString: function(format) {
|
|
4810
|
-
var formatSet = !!format;
|
|
4811
|
-
format = format || this._format;
|
|
4812
|
-
var formattedString = false;
|
|
4813
|
-
var hasAlpha = this._a < 1 && this._a >= 0;
|
|
4814
|
-
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
|
|
4815
|
-
if (needsAlphaFormat) {
|
|
4816
|
-
if (format === "name" && this._a === 0) {
|
|
4817
|
-
return this.toName();
|
|
4818
|
-
}
|
|
4819
|
-
return this.toRgbString();
|
|
4820
|
-
}
|
|
4821
|
-
if (format === "rgb") {
|
|
4822
|
-
formattedString = this.toRgbString();
|
|
4823
|
-
}
|
|
4824
|
-
if (format === "prgb") {
|
|
4825
|
-
formattedString = this.toPercentageRgbString();
|
|
4826
|
-
}
|
|
4827
|
-
if (format === "hex" || format === "hex6") {
|
|
4828
|
-
formattedString = this.toHexString();
|
|
4829
|
-
}
|
|
4830
|
-
if (format === "hex3") {
|
|
4831
|
-
formattedString = this.toHexString(true);
|
|
4832
|
-
}
|
|
4833
|
-
if (format === "hex4") {
|
|
4834
|
-
formattedString = this.toHex8String(true);
|
|
4835
|
-
}
|
|
4836
|
-
if (format === "hex8") {
|
|
4837
|
-
formattedString = this.toHex8String();
|
|
4838
|
-
}
|
|
4839
|
-
if (format === "name") {
|
|
4840
|
-
formattedString = this.toName();
|
|
4841
|
-
}
|
|
4842
|
-
if (format === "hsl") {
|
|
4843
|
-
formattedString = this.toHslString();
|
|
4844
|
-
}
|
|
4845
|
-
if (format === "hsv") {
|
|
4846
|
-
formattedString = this.toHsvString();
|
|
4823
|
+
toFilter: function toFilter(secondColor) {
|
|
4824
|
+
var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
|
|
4825
|
+
var secondHex8String = hex8String;
|
|
4826
|
+
var gradientType = this._gradientType ? "GradientType = 1, " : "";
|
|
4827
|
+
if (secondColor) {
|
|
4828
|
+
var s = tinycolor(secondColor);
|
|
4829
|
+
secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
|
|
4830
|
+
}
|
|
4831
|
+
return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
|
|
4832
|
+
},
|
|
4833
|
+
toString: function toString(format) {
|
|
4834
|
+
var formatSet = !!format;
|
|
4835
|
+
format = format || this._format;
|
|
4836
|
+
var formattedString = false;
|
|
4837
|
+
var hasAlpha = this._a < 1 && this._a >= 0;
|
|
4838
|
+
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
|
|
4839
|
+
if (needsAlphaFormat) {
|
|
4840
|
+
if (format === "name" && this._a === 0) {
|
|
4841
|
+
return this.toName();
|
|
4847
4842
|
}
|
|
4848
|
-
return
|
|
4843
|
+
return this.toRgbString();
|
|
4844
|
+
}
|
|
4845
|
+
if (format === "rgb") {
|
|
4846
|
+
formattedString = this.toRgbString();
|
|
4847
|
+
}
|
|
4848
|
+
if (format === "prgb") {
|
|
4849
|
+
formattedString = this.toPercentageRgbString();
|
|
4850
|
+
}
|
|
4851
|
+
if (format === "hex" || format === "hex6") {
|
|
4852
|
+
formattedString = this.toHexString();
|
|
4853
|
+
}
|
|
4854
|
+
if (format === "hex3") {
|
|
4855
|
+
formattedString = this.toHexString(true);
|
|
4856
|
+
}
|
|
4857
|
+
if (format === "hex4") {
|
|
4858
|
+
formattedString = this.toHex8String(true);
|
|
4859
|
+
}
|
|
4860
|
+
if (format === "hex8") {
|
|
4861
|
+
formattedString = this.toHex8String();
|
|
4862
|
+
}
|
|
4863
|
+
if (format === "name") {
|
|
4864
|
+
formattedString = this.toName();
|
|
4865
|
+
}
|
|
4866
|
+
if (format === "hsl") {
|
|
4867
|
+
formattedString = this.toHslString();
|
|
4868
|
+
}
|
|
4869
|
+
if (format === "hsv") {
|
|
4870
|
+
formattedString = this.toHsvString();
|
|
4871
|
+
}
|
|
4872
|
+
return formattedString || this.toHexString();
|
|
4849
4873
|
},
|
|
4850
|
-
clone: function() {
|
|
4851
|
-
|
|
4874
|
+
clone: function clone() {
|
|
4875
|
+
return tinycolor(this.toString());
|
|
4852
4876
|
},
|
|
4853
|
-
_applyModification: function(fn, args) {
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4877
|
+
_applyModification: function _applyModification(fn, args) {
|
|
4878
|
+
var color = fn.apply(null, [this].concat([].slice.call(args)));
|
|
4879
|
+
this._r = color._r;
|
|
4880
|
+
this._g = color._g;
|
|
4881
|
+
this._b = color._b;
|
|
4882
|
+
this.setAlpha(color._a);
|
|
4883
|
+
return this;
|
|
4860
4884
|
},
|
|
4861
|
-
lighten: function() {
|
|
4862
|
-
|
|
4885
|
+
lighten: function lighten() {
|
|
4886
|
+
return this._applyModification(_lighten, arguments);
|
|
4863
4887
|
},
|
|
4864
|
-
brighten: function() {
|
|
4865
|
-
|
|
4888
|
+
brighten: function brighten() {
|
|
4889
|
+
return this._applyModification(_brighten, arguments);
|
|
4866
4890
|
},
|
|
4867
|
-
darken: function() {
|
|
4868
|
-
|
|
4891
|
+
darken: function darken() {
|
|
4892
|
+
return this._applyModification(_darken, arguments);
|
|
4869
4893
|
},
|
|
4870
|
-
desaturate: function() {
|
|
4871
|
-
|
|
4894
|
+
desaturate: function desaturate() {
|
|
4895
|
+
return this._applyModification(_desaturate, arguments);
|
|
4872
4896
|
},
|
|
4873
|
-
saturate: function() {
|
|
4874
|
-
|
|
4897
|
+
saturate: function saturate() {
|
|
4898
|
+
return this._applyModification(_saturate, arguments);
|
|
4875
4899
|
},
|
|
4876
|
-
greyscale: function() {
|
|
4877
|
-
|
|
4900
|
+
greyscale: function greyscale() {
|
|
4901
|
+
return this._applyModification(_greyscale, arguments);
|
|
4878
4902
|
},
|
|
4879
|
-
spin: function() {
|
|
4880
|
-
|
|
4903
|
+
spin: function spin() {
|
|
4904
|
+
return this._applyModification(_spin, arguments);
|
|
4881
4905
|
},
|
|
4882
|
-
_applyCombination: function(fn, args) {
|
|
4883
|
-
|
|
4906
|
+
_applyCombination: function _applyCombination(fn, args) {
|
|
4907
|
+
return fn.apply(null, [this].concat([].slice.call(args)));
|
|
4884
4908
|
},
|
|
4885
|
-
analogous: function() {
|
|
4886
|
-
|
|
4909
|
+
analogous: function analogous() {
|
|
4910
|
+
return this._applyCombination(_analogous, arguments);
|
|
4887
4911
|
},
|
|
4888
|
-
complement: function() {
|
|
4889
|
-
|
|
4912
|
+
complement: function complement() {
|
|
4913
|
+
return this._applyCombination(_complement, arguments);
|
|
4890
4914
|
},
|
|
4891
|
-
monochromatic: function() {
|
|
4892
|
-
|
|
4915
|
+
monochromatic: function monochromatic() {
|
|
4916
|
+
return this._applyCombination(_monochromatic, arguments);
|
|
4893
4917
|
},
|
|
4894
|
-
splitcomplement: function() {
|
|
4895
|
-
|
|
4918
|
+
splitcomplement: function splitcomplement() {
|
|
4919
|
+
return this._applyCombination(_splitcomplement, arguments);
|
|
4896
4920
|
},
|
|
4897
|
-
triad: function() {
|
|
4898
|
-
|
|
4921
|
+
triad: function triad() {
|
|
4922
|
+
return this._applyCombination(polyad, [3]);
|
|
4899
4923
|
},
|
|
4900
|
-
tetrad: function() {
|
|
4901
|
-
|
|
4924
|
+
tetrad: function tetrad() {
|
|
4925
|
+
return this._applyCombination(polyad, [4]);
|
|
4902
4926
|
}
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
if (
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
}
|
|
4915
|
-
}
|
|
4927
|
+
};
|
|
4928
|
+
tinycolor.fromRatio = function (color, opts) {
|
|
4929
|
+
if (_typeof(color) == "object") {
|
|
4930
|
+
var newColor = {};
|
|
4931
|
+
for (var i in color) {
|
|
4932
|
+
if (color.hasOwnProperty(i)) {
|
|
4933
|
+
if (i === "a") {
|
|
4934
|
+
newColor[i] = color[i];
|
|
4935
|
+
} else {
|
|
4936
|
+
newColor[i] = convertToPercentage(color[i]);
|
|
4937
|
+
}
|
|
4916
4938
|
}
|
|
4917
|
-
|
|
4939
|
+
}
|
|
4940
|
+
color = newColor;
|
|
4918
4941
|
}
|
|
4919
4942
|
return tinycolor(color, opts);
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
var rgb = {
|
|
4943
|
+
};
|
|
4944
|
+
function inputToRGB(color) {
|
|
4945
|
+
var rgb = {
|
|
4946
|
+
r: 0,
|
|
4947
|
+
g: 0,
|
|
4948
|
+
b: 0
|
|
4949
|
+
};
|
|
4923
4950
|
var a = 1;
|
|
4924
4951
|
var s = null;
|
|
4925
4952
|
var v = null;
|
|
@@ -4927,338 +4954,362 @@
|
|
|
4927
4954
|
var ok = false;
|
|
4928
4955
|
var format = false;
|
|
4929
4956
|
if (typeof color == "string") {
|
|
4930
|
-
|
|
4931
|
-
}
|
|
4932
|
-
if (
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
a = color.a;
|
|
4954
|
-
}
|
|
4957
|
+
color = stringInputToObject(color);
|
|
4958
|
+
}
|
|
4959
|
+
if (_typeof(color) == "object") {
|
|
4960
|
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
4961
|
+
rgb = rgbToRgb(color.r, color.g, color.b);
|
|
4962
|
+
ok = true;
|
|
4963
|
+
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
|
|
4964
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
|
4965
|
+
s = convertToPercentage(color.s);
|
|
4966
|
+
v = convertToPercentage(color.v);
|
|
4967
|
+
rgb = hsvToRgb(color.h, s, v);
|
|
4968
|
+
ok = true;
|
|
4969
|
+
format = "hsv";
|
|
4970
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
|
4971
|
+
s = convertToPercentage(color.s);
|
|
4972
|
+
l = convertToPercentage(color.l);
|
|
4973
|
+
rgb = hslToRgb(color.h, s, l);
|
|
4974
|
+
ok = true;
|
|
4975
|
+
format = "hsl";
|
|
4976
|
+
}
|
|
4977
|
+
if (color.hasOwnProperty("a")) {
|
|
4978
|
+
a = color.a;
|
|
4979
|
+
}
|
|
4955
4980
|
}
|
|
4956
4981
|
a = boundAlpha(a);
|
|
4957
4982
|
return {
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4983
|
+
ok: ok,
|
|
4984
|
+
format: color.format || format,
|
|
4985
|
+
r: Math.min(255, Math.max(rgb.r, 0)),
|
|
4986
|
+
g: Math.min(255, Math.max(rgb.g, 0)),
|
|
4987
|
+
b: Math.min(255, Math.max(rgb.b, 0)),
|
|
4988
|
+
a: a
|
|
4964
4989
|
};
|
|
4965
|
-
|
|
4966
|
-
|
|
4990
|
+
}
|
|
4991
|
+
function rgbToRgb(r, g, b) {
|
|
4967
4992
|
return {
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4993
|
+
r: bound01(r, 255) * 255,
|
|
4994
|
+
g: bound01(g, 255) * 255,
|
|
4995
|
+
b: bound01(b, 255) * 255
|
|
4971
4996
|
};
|
|
4972
|
-
|
|
4973
|
-
|
|
4997
|
+
}
|
|
4998
|
+
function rgbToHsl(r, g, b) {
|
|
4974
4999
|
r = bound01(r, 255);
|
|
4975
5000
|
g = bound01(g, 255);
|
|
4976
5001
|
b = bound01(b, 255);
|
|
4977
|
-
var max =
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
5002
|
+
var max = Math.max(r, g, b),
|
|
5003
|
+
min = Math.min(r, g, b);
|
|
5004
|
+
var h,
|
|
5005
|
+
s,
|
|
5006
|
+
l = (max + min) / 2;
|
|
5007
|
+
if (max == min) {
|
|
5008
|
+
h = s = 0;
|
|
5009
|
+
} else {
|
|
5010
|
+
var d = max - min;
|
|
5011
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
5012
|
+
switch (max) {
|
|
5013
|
+
case r:
|
|
5014
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
5015
|
+
break;
|
|
5016
|
+
case g:
|
|
5017
|
+
h = (b - r) / d + 2;
|
|
5018
|
+
break;
|
|
5019
|
+
case b:
|
|
5020
|
+
h = (r - g) / d + 4;
|
|
5021
|
+
break;
|
|
5022
|
+
}
|
|
5023
|
+
h /= 6;
|
|
4991
5024
|
}
|
|
4992
|
-
return {
|
|
4993
|
-
|
|
4994
|
-
|
|
5025
|
+
return {
|
|
5026
|
+
h: h,
|
|
5027
|
+
s: s,
|
|
5028
|
+
l: l
|
|
5029
|
+
};
|
|
5030
|
+
}
|
|
5031
|
+
function hslToRgb(h, s, l) {
|
|
4995
5032
|
var r, g, b;
|
|
4996
5033
|
h = bound01(h, 360);
|
|
4997
5034
|
s = bound01(s, 100);
|
|
4998
5035
|
l = bound01(l, 100);
|
|
4999
5036
|
function hue2rgb(p, q, t) {
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
}
|
|
5007
|
-
if(s === 0) {
|
|
5008
|
-
|
|
5009
|
-
}
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
b = hue2rgb(p, q, h - 1/3);
|
|
5037
|
+
if (t < 0) t += 1;
|
|
5038
|
+
if (t > 1) t -= 1;
|
|
5039
|
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
5040
|
+
if (t < 1 / 2) return q;
|
|
5041
|
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
5042
|
+
return p;
|
|
5043
|
+
}
|
|
5044
|
+
if (s === 0) {
|
|
5045
|
+
r = g = b = l;
|
|
5046
|
+
} else {
|
|
5047
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
5048
|
+
var p = 2 * l - q;
|
|
5049
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
5050
|
+
g = hue2rgb(p, q, h);
|
|
5051
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
5016
5052
|
}
|
|
5017
|
-
return {
|
|
5018
|
-
|
|
5019
|
-
|
|
5053
|
+
return {
|
|
5054
|
+
r: r * 255,
|
|
5055
|
+
g: g * 255,
|
|
5056
|
+
b: b * 255
|
|
5057
|
+
};
|
|
5058
|
+
}
|
|
5059
|
+
function rgbToHsv(r, g, b) {
|
|
5020
5060
|
r = bound01(r, 255);
|
|
5021
5061
|
g = bound01(g, 255);
|
|
5022
5062
|
b = bound01(b, 255);
|
|
5023
|
-
var max =
|
|
5024
|
-
|
|
5063
|
+
var max = Math.max(r, g, b),
|
|
5064
|
+
min = Math.min(r, g, b);
|
|
5065
|
+
var h,
|
|
5066
|
+
s,
|
|
5067
|
+
v = max;
|
|
5025
5068
|
var d = max - min;
|
|
5026
5069
|
s = max === 0 ? 0 : d / max;
|
|
5027
|
-
if(max == min) {
|
|
5028
|
-
|
|
5029
|
-
}
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5070
|
+
if (max == min) {
|
|
5071
|
+
h = 0;
|
|
5072
|
+
} else {
|
|
5073
|
+
switch (max) {
|
|
5074
|
+
case r:
|
|
5075
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
5076
|
+
break;
|
|
5077
|
+
case g:
|
|
5078
|
+
h = (b - r) / d + 2;
|
|
5079
|
+
break;
|
|
5080
|
+
case b:
|
|
5081
|
+
h = (r - g) / d + 4;
|
|
5082
|
+
break;
|
|
5083
|
+
}
|
|
5084
|
+
h /= 6;
|
|
5037
5085
|
}
|
|
5038
|
-
return {
|
|
5039
|
-
|
|
5040
|
-
|
|
5086
|
+
return {
|
|
5087
|
+
h: h,
|
|
5088
|
+
s: s,
|
|
5089
|
+
v: v
|
|
5090
|
+
};
|
|
5091
|
+
}
|
|
5092
|
+
function hsvToRgb(h, s, v) {
|
|
5041
5093
|
h = bound01(h, 360) * 6;
|
|
5042
5094
|
s = bound01(s, 100);
|
|
5043
5095
|
v = bound01(v, 100);
|
|
5044
5096
|
var i = Math.floor(h),
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
return {
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
];
|
|
5097
|
+
f = h - i,
|
|
5098
|
+
p = v * (1 - s),
|
|
5099
|
+
q = v * (1 - f * s),
|
|
5100
|
+
t = v * (1 - (1 - f) * s),
|
|
5101
|
+
mod = i % 6,
|
|
5102
|
+
r = [v, q, p, p, t, v][mod],
|
|
5103
|
+
g = [t, v, v, q, p, p][mod],
|
|
5104
|
+
b = [p, p, t, v, v, q][mod];
|
|
5105
|
+
return {
|
|
5106
|
+
r: r * 255,
|
|
5107
|
+
g: g * 255,
|
|
5108
|
+
b: b * 255
|
|
5109
|
+
};
|
|
5110
|
+
}
|
|
5111
|
+
function rgbToHex(r, g, b, allow3Char) {
|
|
5112
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
5061
5113
|
if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
|
|
5062
|
-
|
|
5114
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
|
|
5063
5115
|
}
|
|
5064
5116
|
return hex.join("");
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
var hex = [
|
|
5068
|
-
pad2(mathRound(r).toString(16)),
|
|
5069
|
-
pad2(mathRound(g).toString(16)),
|
|
5070
|
-
pad2(mathRound(b).toString(16)),
|
|
5071
|
-
pad2(convertDecimalToHex(a))
|
|
5072
|
-
];
|
|
5117
|
+
}
|
|
5118
|
+
function rgbaToHex(r, g, b, a, allow4Char) {
|
|
5119
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
|
|
5073
5120
|
if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
|
|
5074
|
-
|
|
5121
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
|
|
5075
5122
|
}
|
|
5076
5123
|
return hex.join("");
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
var hex = [
|
|
5080
|
-
pad2(convertDecimalToHex(a)),
|
|
5081
|
-
pad2(mathRound(r).toString(16)),
|
|
5082
|
-
pad2(mathRound(g).toString(16)),
|
|
5083
|
-
pad2(mathRound(b).toString(16))
|
|
5084
|
-
];
|
|
5124
|
+
}
|
|
5125
|
+
function rgbaToArgbHex(r, g, b, a) {
|
|
5126
|
+
var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
5085
5127
|
return hex.join("");
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
if (!color1 || !color2)
|
|
5128
|
+
}
|
|
5129
|
+
tinycolor.equals = function (color1, color2) {
|
|
5130
|
+
if (!color1 || !color2) return false;
|
|
5089
5131
|
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
|
|
5090
|
-
|
|
5091
|
-
|
|
5132
|
+
};
|
|
5133
|
+
tinycolor.random = function () {
|
|
5092
5134
|
return tinycolor.fromRatio({
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5135
|
+
r: Math.random(),
|
|
5136
|
+
g: Math.random(),
|
|
5137
|
+
b: Math.random()
|
|
5096
5138
|
});
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
amount =
|
|
5139
|
+
};
|
|
5140
|
+
function _desaturate(color, amount) {
|
|
5141
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
5100
5142
|
var hsl = tinycolor(color).toHsl();
|
|
5101
5143
|
hsl.s -= amount / 100;
|
|
5102
5144
|
hsl.s = clamp01(hsl.s);
|
|
5103
5145
|
return tinycolor(hsl);
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
amount =
|
|
5146
|
+
}
|
|
5147
|
+
function _saturate(color, amount) {
|
|
5148
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
5107
5149
|
var hsl = tinycolor(color).toHsl();
|
|
5108
5150
|
hsl.s += amount / 100;
|
|
5109
5151
|
hsl.s = clamp01(hsl.s);
|
|
5110
5152
|
return tinycolor(hsl);
|
|
5111
|
-
|
|
5112
|
-
|
|
5153
|
+
}
|
|
5154
|
+
function _greyscale(color) {
|
|
5113
5155
|
return tinycolor(color).desaturate(100);
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
amount =
|
|
5156
|
+
}
|
|
5157
|
+
function _lighten(color, amount) {
|
|
5158
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
5117
5159
|
var hsl = tinycolor(color).toHsl();
|
|
5118
5160
|
hsl.l += amount / 100;
|
|
5119
5161
|
hsl.l = clamp01(hsl.l);
|
|
5120
5162
|
return tinycolor(hsl);
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
amount =
|
|
5163
|
+
}
|
|
5164
|
+
function _brighten(color, amount) {
|
|
5165
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
5124
5166
|
var rgb = tinycolor(color).toRgb();
|
|
5125
|
-
rgb.r =
|
|
5126
|
-
rgb.g =
|
|
5127
|
-
rgb.b =
|
|
5167
|
+
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
|
|
5168
|
+
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
|
|
5169
|
+
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
|
|
5128
5170
|
return tinycolor(rgb);
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
amount =
|
|
5171
|
+
}
|
|
5172
|
+
function _darken(color, amount) {
|
|
5173
|
+
amount = amount === 0 ? 0 : amount || 10;
|
|
5132
5174
|
var hsl = tinycolor(color).toHsl();
|
|
5133
5175
|
hsl.l -= amount / 100;
|
|
5134
5176
|
hsl.l = clamp01(hsl.l);
|
|
5135
5177
|
return tinycolor(hsl);
|
|
5136
|
-
|
|
5137
|
-
|
|
5178
|
+
}
|
|
5179
|
+
function _spin(color, amount) {
|
|
5138
5180
|
var hsl = tinycolor(color).toHsl();
|
|
5139
5181
|
var hue = (hsl.h + amount) % 360;
|
|
5140
5182
|
hsl.h = hue < 0 ? 360 + hue : hue;
|
|
5141
5183
|
return tinycolor(hsl);
|
|
5142
|
-
|
|
5143
|
-
|
|
5184
|
+
}
|
|
5185
|
+
function _complement(color) {
|
|
5144
5186
|
var hsl = tinycolor(color).toHsl();
|
|
5145
5187
|
hsl.h = (hsl.h + 180) % 360;
|
|
5146
5188
|
return tinycolor(hsl);
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
tinycolor(color),
|
|
5153
|
-
tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
|
|
5154
|
-
tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
|
|
5155
|
-
];
|
|
5156
|
-
}
|
|
5157
|
-
function tetrad(color) {
|
|
5189
|
+
}
|
|
5190
|
+
function polyad(color, number) {
|
|
5191
|
+
if (isNaN(number) || number <= 0) {
|
|
5192
|
+
throw new Error("Argument to polyad must be a positive number");
|
|
5193
|
+
}
|
|
5158
5194
|
var hsl = tinycolor(color).toHsl();
|
|
5159
|
-
var
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5195
|
+
var result = [tinycolor(color)];
|
|
5196
|
+
var step = 360 / number;
|
|
5197
|
+
for (var i = 1; i < number; i++) {
|
|
5198
|
+
result.push(tinycolor({
|
|
5199
|
+
h: (hsl.h + i * step) % 360,
|
|
5200
|
+
s: hsl.s,
|
|
5201
|
+
l: hsl.l
|
|
5202
|
+
}));
|
|
5203
|
+
}
|
|
5204
|
+
return result;
|
|
5205
|
+
}
|
|
5206
|
+
function _splitcomplement(color) {
|
|
5168
5207
|
var hsl = tinycolor(color).toHsl();
|
|
5169
5208
|
var h = hsl.h;
|
|
5170
|
-
return [
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5209
|
+
return [tinycolor(color), tinycolor({
|
|
5210
|
+
h: (h + 72) % 360,
|
|
5211
|
+
s: hsl.s,
|
|
5212
|
+
l: hsl.l
|
|
5213
|
+
}), tinycolor({
|
|
5214
|
+
h: (h + 216) % 360,
|
|
5215
|
+
s: hsl.s,
|
|
5216
|
+
l: hsl.l
|
|
5217
|
+
})];
|
|
5218
|
+
}
|
|
5219
|
+
function _analogous(color, results, slices) {
|
|
5177
5220
|
results = results || 6;
|
|
5178
5221
|
slices = slices || 30;
|
|
5179
5222
|
var hsl = tinycolor(color).toHsl();
|
|
5180
5223
|
var part = 360 / slices;
|
|
5181
5224
|
var ret = [tinycolor(color)];
|
|
5182
|
-
for (hsl.h = (
|
|
5183
|
-
|
|
5184
|
-
|
|
5225
|
+
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
|
|
5226
|
+
hsl.h = (hsl.h + part) % 360;
|
|
5227
|
+
ret.push(tinycolor(hsl));
|
|
5185
5228
|
}
|
|
5186
5229
|
return ret;
|
|
5187
|
-
|
|
5188
|
-
|
|
5230
|
+
}
|
|
5231
|
+
function _monochromatic(color, results) {
|
|
5189
5232
|
results = results || 6;
|
|
5190
5233
|
var hsv = tinycolor(color).toHsv();
|
|
5191
|
-
var h = hsv.h,
|
|
5234
|
+
var h = hsv.h,
|
|
5235
|
+
s = hsv.s,
|
|
5236
|
+
v = hsv.v;
|
|
5192
5237
|
var ret = [];
|
|
5193
5238
|
var modification = 1 / results;
|
|
5194
5239
|
while (results--) {
|
|
5195
|
-
|
|
5196
|
-
|
|
5240
|
+
ret.push(tinycolor({
|
|
5241
|
+
h: h,
|
|
5242
|
+
s: s,
|
|
5243
|
+
v: v
|
|
5244
|
+
}));
|
|
5245
|
+
v = (v + modification) % 1;
|
|
5197
5246
|
}
|
|
5198
5247
|
return ret;
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
amount =
|
|
5248
|
+
}
|
|
5249
|
+
tinycolor.mix = function (color1, color2, amount) {
|
|
5250
|
+
amount = amount === 0 ? 0 : amount || 50;
|
|
5202
5251
|
var rgb1 = tinycolor(color1).toRgb();
|
|
5203
5252
|
var rgb2 = tinycolor(color2).toRgb();
|
|
5204
5253
|
var p = amount / 100;
|
|
5205
5254
|
var rgba = {
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5255
|
+
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
5256
|
+
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
5257
|
+
b: (rgb2.b - rgb1.b) * p + rgb1.b,
|
|
5258
|
+
a: (rgb2.a - rgb1.a) * p + rgb1.a
|
|
5210
5259
|
};
|
|
5211
5260
|
return tinycolor(rgba);
|
|
5212
|
-
|
|
5213
|
-
|
|
5261
|
+
};
|
|
5262
|
+
tinycolor.readability = function (color1, color2) {
|
|
5214
5263
|
var c1 = tinycolor(color1);
|
|
5215
5264
|
var c2 = tinycolor(color2);
|
|
5216
|
-
return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
|
|
5217
|
-
|
|
5218
|
-
|
|
5265
|
+
return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
|
|
5266
|
+
};
|
|
5267
|
+
tinycolor.isReadable = function (color1, color2, wcag2) {
|
|
5219
5268
|
var readability = tinycolor.readability(color1, color2);
|
|
5220
5269
|
var wcag2Parms, out;
|
|
5221
5270
|
out = false;
|
|
5222
5271
|
wcag2Parms = validateWCAG2Parms(wcag2);
|
|
5223
5272
|
switch (wcag2Parms.level + wcag2Parms.size) {
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5273
|
+
case "AAsmall":
|
|
5274
|
+
case "AAAlarge":
|
|
5275
|
+
out = readability >= 4.5;
|
|
5276
|
+
break;
|
|
5277
|
+
case "AAlarge":
|
|
5278
|
+
out = readability >= 3;
|
|
5279
|
+
break;
|
|
5280
|
+
case "AAAsmall":
|
|
5281
|
+
out = readability >= 7;
|
|
5282
|
+
break;
|
|
5234
5283
|
}
|
|
5235
5284
|
return out;
|
|
5236
|
-
|
|
5237
|
-
|
|
5285
|
+
};
|
|
5286
|
+
tinycolor.mostReadable = function (baseColor, colorList, args) {
|
|
5238
5287
|
var bestColor = null;
|
|
5239
5288
|
var bestScore = 0;
|
|
5240
5289
|
var readability;
|
|
5241
|
-
var includeFallbackColors, level, size
|
|
5290
|
+
var includeFallbackColors, level, size;
|
|
5242
5291
|
args = args || {};
|
|
5243
|
-
includeFallbackColors = args.includeFallbackColors
|
|
5292
|
+
includeFallbackColors = args.includeFallbackColors;
|
|
5244
5293
|
level = args.level;
|
|
5245
5294
|
size = args.size;
|
|
5246
|
-
for (var i= 0; i < colorList.length
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
}
|
|
5253
|
-
if (tinycolor.isReadable(baseColor, bestColor, {
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5295
|
+
for (var i = 0; i < colorList.length; i++) {
|
|
5296
|
+
readability = tinycolor.readability(baseColor, colorList[i]);
|
|
5297
|
+
if (readability > bestScore) {
|
|
5298
|
+
bestScore = readability;
|
|
5299
|
+
bestColor = tinycolor(colorList[i]);
|
|
5300
|
+
}
|
|
5301
|
+
}
|
|
5302
|
+
if (tinycolor.isReadable(baseColor, bestColor, {
|
|
5303
|
+
level: level,
|
|
5304
|
+
size: size
|
|
5305
|
+
}) || !includeFallbackColors) {
|
|
5306
|
+
return bestColor;
|
|
5307
|
+
} else {
|
|
5308
|
+
args.includeFallbackColors = false;
|
|
5309
|
+
return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
|
|
5259
5310
|
}
|
|
5260
|
-
|
|
5261
|
-
|
|
5311
|
+
};
|
|
5312
|
+
var names = tinycolor.names = {
|
|
5262
5313
|
aliceblue: "f0f8ff",
|
|
5263
5314
|
antiquewhite: "faebd7",
|
|
5264
5315
|
aqua: "0ff",
|
|
@@ -5408,171 +5459,204 @@
|
|
|
5408
5459
|
whitesmoke: "f5f5f5",
|
|
5409
5460
|
yellow: "ff0",
|
|
5410
5461
|
yellowgreen: "9acd32"
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
var flipped = {
|
|
5462
|
+
};
|
|
5463
|
+
var hexNames = tinycolor.hexNames = flip(names);
|
|
5464
|
+
function flip(o) {
|
|
5465
|
+
var flipped = {};
|
|
5415
5466
|
for (var i in o) {
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5467
|
+
if (o.hasOwnProperty(i)) {
|
|
5468
|
+
flipped[o[i]] = i;
|
|
5469
|
+
}
|
|
5419
5470
|
}
|
|
5420
5471
|
return flipped;
|
|
5421
|
-
|
|
5422
|
-
|
|
5472
|
+
}
|
|
5473
|
+
function boundAlpha(a) {
|
|
5423
5474
|
a = parseFloat(a);
|
|
5424
5475
|
if (isNaN(a) || a < 0 || a > 1) {
|
|
5425
|
-
|
|
5476
|
+
a = 1;
|
|
5426
5477
|
}
|
|
5427
5478
|
return a;
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
if (isOnePointZero(n))
|
|
5479
|
+
}
|
|
5480
|
+
function bound01(n, max) {
|
|
5481
|
+
if (isOnePointZero(n)) n = "100%";
|
|
5431
5482
|
var processPercent = isPercentage(n);
|
|
5432
|
-
n =
|
|
5483
|
+
n = Math.min(max, Math.max(0, parseFloat(n)));
|
|
5433
5484
|
if (processPercent) {
|
|
5434
|
-
|
|
5485
|
+
n = parseInt(n * max, 10) / 100;
|
|
5435
5486
|
}
|
|
5436
|
-
if (
|
|
5437
|
-
|
|
5487
|
+
if (Math.abs(n - max) < 0.000001) {
|
|
5488
|
+
return 1;
|
|
5438
5489
|
}
|
|
5439
|
-
return
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
return
|
|
5443
|
-
|
|
5444
|
-
|
|
5490
|
+
return n % max / parseFloat(max);
|
|
5491
|
+
}
|
|
5492
|
+
function clamp01(val) {
|
|
5493
|
+
return Math.min(1, Math.max(0, val));
|
|
5494
|
+
}
|
|
5495
|
+
function parseIntFromHex(val) {
|
|
5445
5496
|
return parseInt(val, 16);
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
return typeof n == "string" && n.indexOf(
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
return typeof n === "string" && n.indexOf(
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
return c.length == 1 ?
|
|
5455
|
-
|
|
5456
|
-
|
|
5497
|
+
}
|
|
5498
|
+
function isOnePointZero(n) {
|
|
5499
|
+
return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
|
|
5500
|
+
}
|
|
5501
|
+
function isPercentage(n) {
|
|
5502
|
+
return typeof n === "string" && n.indexOf("%") != -1;
|
|
5503
|
+
}
|
|
5504
|
+
function pad2(c) {
|
|
5505
|
+
return c.length == 1 ? "0" + c : "" + c;
|
|
5506
|
+
}
|
|
5507
|
+
function convertToPercentage(n) {
|
|
5457
5508
|
if (n <= 1) {
|
|
5458
|
-
|
|
5509
|
+
n = n * 100 + "%";
|
|
5459
5510
|
}
|
|
5460
5511
|
return n;
|
|
5461
|
-
|
|
5462
|
-
|
|
5512
|
+
}
|
|
5513
|
+
function convertDecimalToHex(d) {
|
|
5463
5514
|
return Math.round(parseFloat(d) * 255).toString(16);
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
return
|
|
5467
|
-
|
|
5468
|
-
|
|
5515
|
+
}
|
|
5516
|
+
function convertHexToDecimal(h) {
|
|
5517
|
+
return parseIntFromHex(h) / 255;
|
|
5518
|
+
}
|
|
5519
|
+
var matchers = function () {
|
|
5469
5520
|
var CSS_INTEGER = "[-\\+]?\\d+%?";
|
|
5470
5521
|
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
|
|
5471
5522
|
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
|
|
5472
5523
|
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
5473
5524
|
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
5474
5525
|
return {
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5526
|
+
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
5527
|
+
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
|
|
5528
|
+
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
|
|
5529
|
+
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
|
|
5530
|
+
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
|
|
5531
|
+
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
|
|
5532
|
+
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
|
|
5533
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
5534
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
5535
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
5536
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
5486
5537
|
};
|
|
5487
|
-
|
|
5488
|
-
|
|
5538
|
+
}();
|
|
5539
|
+
function isValidCSSUnit(color) {
|
|
5489
5540
|
return !!matchers.CSS_UNIT.exec(color);
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
color = color.replace(trimLeft,
|
|
5541
|
+
}
|
|
5542
|
+
function stringInputToObject(color) {
|
|
5543
|
+
color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
|
|
5493
5544
|
var named = false;
|
|
5494
5545
|
if (names[color]) {
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
}
|
|
5498
|
-
|
|
5499
|
-
|
|
5546
|
+
color = names[color];
|
|
5547
|
+
named = true;
|
|
5548
|
+
} else if (color == "transparent") {
|
|
5549
|
+
return {
|
|
5550
|
+
r: 0,
|
|
5551
|
+
g: 0,
|
|
5552
|
+
b: 0,
|
|
5553
|
+
a: 0,
|
|
5554
|
+
format: "name"
|
|
5555
|
+
};
|
|
5500
5556
|
}
|
|
5501
5557
|
var match;
|
|
5502
|
-
if (
|
|
5503
|
-
|
|
5558
|
+
if (match = matchers.rgb.exec(color)) {
|
|
5559
|
+
return {
|
|
5560
|
+
r: match[1],
|
|
5561
|
+
g: match[2],
|
|
5562
|
+
b: match[3]
|
|
5563
|
+
};
|
|
5504
5564
|
}
|
|
5505
|
-
if (
|
|
5506
|
-
|
|
5565
|
+
if (match = matchers.rgba.exec(color)) {
|
|
5566
|
+
return {
|
|
5567
|
+
r: match[1],
|
|
5568
|
+
g: match[2],
|
|
5569
|
+
b: match[3],
|
|
5570
|
+
a: match[4]
|
|
5571
|
+
};
|
|
5507
5572
|
}
|
|
5508
|
-
if (
|
|
5509
|
-
|
|
5573
|
+
if (match = matchers.hsl.exec(color)) {
|
|
5574
|
+
return {
|
|
5575
|
+
h: match[1],
|
|
5576
|
+
s: match[2],
|
|
5577
|
+
l: match[3]
|
|
5578
|
+
};
|
|
5510
5579
|
}
|
|
5511
|
-
if (
|
|
5512
|
-
|
|
5580
|
+
if (match = matchers.hsla.exec(color)) {
|
|
5581
|
+
return {
|
|
5582
|
+
h: match[1],
|
|
5583
|
+
s: match[2],
|
|
5584
|
+
l: match[3],
|
|
5585
|
+
a: match[4]
|
|
5586
|
+
};
|
|
5513
5587
|
}
|
|
5514
|
-
if (
|
|
5515
|
-
|
|
5588
|
+
if (match = matchers.hsv.exec(color)) {
|
|
5589
|
+
return {
|
|
5590
|
+
h: match[1],
|
|
5591
|
+
s: match[2],
|
|
5592
|
+
v: match[3]
|
|
5593
|
+
};
|
|
5516
5594
|
}
|
|
5517
|
-
if (
|
|
5518
|
-
|
|
5595
|
+
if (match = matchers.hsva.exec(color)) {
|
|
5596
|
+
return {
|
|
5597
|
+
h: match[1],
|
|
5598
|
+
s: match[2],
|
|
5599
|
+
v: match[3],
|
|
5600
|
+
a: match[4]
|
|
5601
|
+
};
|
|
5519
5602
|
}
|
|
5520
|
-
if (
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5603
|
+
if (match = matchers.hex8.exec(color)) {
|
|
5604
|
+
return {
|
|
5605
|
+
r: parseIntFromHex(match[1]),
|
|
5606
|
+
g: parseIntFromHex(match[2]),
|
|
5607
|
+
b: parseIntFromHex(match[3]),
|
|
5608
|
+
a: convertHexToDecimal(match[4]),
|
|
5609
|
+
format: named ? "name" : "hex8"
|
|
5610
|
+
};
|
|
5528
5611
|
}
|
|
5529
|
-
if (
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5612
|
+
if (match = matchers.hex6.exec(color)) {
|
|
5613
|
+
return {
|
|
5614
|
+
r: parseIntFromHex(match[1]),
|
|
5615
|
+
g: parseIntFromHex(match[2]),
|
|
5616
|
+
b: parseIntFromHex(match[3]),
|
|
5617
|
+
format: named ? "name" : "hex"
|
|
5618
|
+
};
|
|
5536
5619
|
}
|
|
5537
|
-
if (
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5620
|
+
if (match = matchers.hex4.exec(color)) {
|
|
5621
|
+
return {
|
|
5622
|
+
r: parseIntFromHex(match[1] + "" + match[1]),
|
|
5623
|
+
g: parseIntFromHex(match[2] + "" + match[2]),
|
|
5624
|
+
b: parseIntFromHex(match[3] + "" + match[3]),
|
|
5625
|
+
a: convertHexToDecimal(match[4] + "" + match[4]),
|
|
5626
|
+
format: named ? "name" : "hex8"
|
|
5627
|
+
};
|
|
5545
5628
|
}
|
|
5546
|
-
if (
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5629
|
+
if (match = matchers.hex3.exec(color)) {
|
|
5630
|
+
return {
|
|
5631
|
+
r: parseIntFromHex(match[1] + "" + match[1]),
|
|
5632
|
+
g: parseIntFromHex(match[2] + "" + match[2]),
|
|
5633
|
+
b: parseIntFromHex(match[3] + "" + match[3]),
|
|
5634
|
+
format: named ? "name" : "hex"
|
|
5635
|
+
};
|
|
5553
5636
|
}
|
|
5554
5637
|
return false;
|
|
5555
|
-
|
|
5556
|
-
|
|
5638
|
+
}
|
|
5639
|
+
function validateWCAG2Parms(parms) {
|
|
5557
5640
|
var level, size;
|
|
5558
|
-
parms = parms || {
|
|
5641
|
+
parms = parms || {
|
|
5642
|
+
level: "AA",
|
|
5643
|
+
size: "small"
|
|
5644
|
+
};
|
|
5559
5645
|
level = (parms.level || "AA").toUpperCase();
|
|
5560
5646
|
size = (parms.size || "small").toLowerCase();
|
|
5561
5647
|
if (level !== "AA" && level !== "AAA") {
|
|
5562
|
-
|
|
5648
|
+
level = "AA";
|
|
5563
5649
|
}
|
|
5564
5650
|
if (size !== "small" && size !== "large") {
|
|
5565
|
-
|
|
5651
|
+
size = "small";
|
|
5566
5652
|
}
|
|
5567
|
-
return {
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
}
|
|
5575
|
-
})(Math);
|
|
5653
|
+
return {
|
|
5654
|
+
level: level,
|
|
5655
|
+
size: size
|
|
5656
|
+
};
|
|
5657
|
+
}
|
|
5658
|
+
return tinycolor;
|
|
5659
|
+
}));
|
|
5576
5660
|
});
|
|
5577
5661
|
|
|
5578
5662
|
function formatColor(colorParam) {
|
|
@@ -9052,7 +9136,7 @@
|
|
|
9052
9136
|
var gOPD = Object.getOwnPropertyDescriptor;
|
|
9053
9137
|
var f$6 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) {
|
|
9054
9138
|
O = _toIobject(O);
|
|
9055
|
-
P = _toPrimitive(P, true);
|
|
9139
|
+
P = _toPrimitive$1(P, true);
|
|
9056
9140
|
if (_ie8DomDefine) try {
|
|
9057
9141
|
return gOPD(O, P);
|
|
9058
9142
|
} catch (e) { }
|
|
@@ -9103,7 +9187,7 @@
|
|
|
9103
9187
|
var $defineProperty = function defineProperty(it, key, D) {
|
|
9104
9188
|
if (it === ObjectProto$1) $defineProperty(OPSymbols, key, D);
|
|
9105
9189
|
_anObject(it);
|
|
9106
|
-
key = _toPrimitive(key, true);
|
|
9190
|
+
key = _toPrimitive$1(key, true);
|
|
9107
9191
|
_anObject(D);
|
|
9108
9192
|
if (_has(AllSymbols, key)) {
|
|
9109
9193
|
if (!D.enumerable) {
|
|
@@ -9128,13 +9212,13 @@
|
|
|
9128
9212
|
return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P);
|
|
9129
9213
|
};
|
|
9130
9214
|
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
|
|
9131
|
-
var E = isEnum$1.call(this, key = _toPrimitive(key, true));
|
|
9215
|
+
var E = isEnum$1.call(this, key = _toPrimitive$1(key, true));
|
|
9132
9216
|
if (this === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false;
|
|
9133
9217
|
return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
|
|
9134
9218
|
};
|
|
9135
9219
|
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
|
|
9136
9220
|
it = _toIobject(it);
|
|
9137
|
-
key = _toPrimitive(key, true);
|
|
9221
|
+
key = _toPrimitive$1(key, true);
|
|
9138
9222
|
if (it === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return;
|
|
9139
9223
|
var D = gOPD$1(it, key);
|
|
9140
9224
|
if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
|
|
@@ -9508,6 +9592,12 @@
|
|
|
9508
9592
|
|
|
9509
9593
|
var script$l = {
|
|
9510
9594
|
mixins: [mixin$1, locale.mixin],
|
|
9595
|
+
props: {
|
|
9596
|
+
realPickerType: {
|
|
9597
|
+
type: String,
|
|
9598
|
+
default: ''
|
|
9599
|
+
}
|
|
9600
|
+
},
|
|
9511
9601
|
data: function data() {
|
|
9512
9602
|
return {};
|
|
9513
9603
|
},
|
|
@@ -9523,6 +9613,7 @@
|
|
|
9523
9613
|
return translatedDays.splice(0, 7 - 0).concat(translatedDays.splice(0, 0));
|
|
9524
9614
|
},
|
|
9525
9615
|
cells: function cells() {
|
|
9616
|
+
var _this = this;
|
|
9526
9617
|
var tableYear = this.tableDate.getFullYear();
|
|
9527
9618
|
var tableMonth = this.tableDate.getMonth();
|
|
9528
9619
|
var today = clearHours(new Date());
|
|
@@ -9547,7 +9638,8 @@
|
|
|
9547
9638
|
disabled: cell.date && disabledTestFn && disabledTestFn(new Date(time)),
|
|
9548
9639
|
range: dateIsInCurrentMonth && isRange && isInRange(time, rangeStart, rangeEnd),
|
|
9549
9640
|
start: dateIsInCurrentMonth && isRange && time === minDay,
|
|
9550
|
-
end: dateIsInCurrentMonth && isRange && time === maxDay
|
|
9641
|
+
end: dateIsInCurrentMonth && isRange && time === maxDay,
|
|
9642
|
+
pickerType: _this.realPickerType
|
|
9551
9643
|
});
|
|
9552
9644
|
}).cells.slice(0);
|
|
9553
9645
|
}
|
|
@@ -9620,6 +9712,12 @@
|
|
|
9620
9712
|
|
|
9621
9713
|
var script$m = {
|
|
9622
9714
|
mixins: [mixin$1],
|
|
9715
|
+
props: {
|
|
9716
|
+
realPickerType: {
|
|
9717
|
+
type: String,
|
|
9718
|
+
default: ''
|
|
9719
|
+
}
|
|
9720
|
+
},
|
|
9623
9721
|
computed: {
|
|
9624
9722
|
startYear: function startYear() {
|
|
9625
9723
|
return Math.floor(this.tableDate.getFullYear() / 10) * 10;
|
|
@@ -9642,18 +9740,25 @@
|
|
|
9642
9740
|
var day = clearHours(cell.date);
|
|
9643
9741
|
cell.selected = selectedDays.includes(day);
|
|
9644
9742
|
cell.focused = day === focusedDate;
|
|
9743
|
+
cell.pickerType = this.realPickerType;
|
|
9645
9744
|
cells.push(cell);
|
|
9646
9745
|
}
|
|
9647
9746
|
return cells;
|
|
9648
9747
|
}
|
|
9649
9748
|
},
|
|
9650
9749
|
methods: {
|
|
9750
|
+
getExternalCellClass: function getExternalCellClass(cell) {
|
|
9751
|
+
if (typeof this.cellClass === 'function') {
|
|
9752
|
+
return this.cellClass(cell);
|
|
9753
|
+
}
|
|
9754
|
+
return '';
|
|
9755
|
+
},
|
|
9651
9756
|
getCellCls: function getCellCls(cell) {
|
|
9652
9757
|
return ['bk-date-picker-cells-cell', {
|
|
9653
9758
|
'bk-date-picker-cells-cell-selected': cell.selected,
|
|
9654
9759
|
'bk-date-picker-cells-cell-disabled': cell.disabled,
|
|
9655
9760
|
'bk-date-picker-cells-cell-range': cell.range && !cell.start && !cell.end
|
|
9656
|
-
}];
|
|
9761
|
+
}, this.getExternalCellClass(cell)];
|
|
9657
9762
|
}
|
|
9658
9763
|
}
|
|
9659
9764
|
};
|
|
@@ -9706,6 +9811,12 @@
|
|
|
9706
9811
|
|
|
9707
9812
|
var script$n = {
|
|
9708
9813
|
mixins: [mixin$1],
|
|
9814
|
+
props: {
|
|
9815
|
+
realPickerType: {
|
|
9816
|
+
type: String,
|
|
9817
|
+
default: ''
|
|
9818
|
+
}
|
|
9819
|
+
},
|
|
9709
9820
|
computed: {
|
|
9710
9821
|
cells: function cells() {
|
|
9711
9822
|
var cells = [];
|
|
@@ -9727,15 +9838,22 @@
|
|
|
9727
9838
|
cell.disabled = typeof this.disabledDate === 'function' && this.disabledDate(cell.date) && this.selectionMode === 'month';
|
|
9728
9839
|
cell.selected = selectedDays.includes(day);
|
|
9729
9840
|
cell.focused = day === focusedDate;
|
|
9841
|
+
cell.pickerType = this.realPickerType;
|
|
9730
9842
|
cells.push(cell);
|
|
9731
9843
|
}
|
|
9732
9844
|
return cells;
|
|
9733
9845
|
}
|
|
9734
9846
|
},
|
|
9735
9847
|
methods: {
|
|
9848
|
+
getExternalCellClass: function getExternalCellClass(cell) {
|
|
9849
|
+
if (typeof this.cellClass === 'function') {
|
|
9850
|
+
return this.cellClass(cell);
|
|
9851
|
+
}
|
|
9852
|
+
return '';
|
|
9853
|
+
},
|
|
9736
9854
|
getCellCls: function getCellCls(cell) {
|
|
9737
9855
|
var _ref;
|
|
9738
|
-
return ["bk-date-picker-cells-cell", (_ref = {}, _defineProperty(_ref, "bk-date-picker-cells-cell-selected", cell.selected), _defineProperty(_ref, "bk-date-picker-cells-cell-disabled", cell.disabled), _defineProperty(_ref, "bk-date-picker-cells-cell-range", cell.range && !cell.start && !cell.end), _ref)];
|
|
9856
|
+
return ["bk-date-picker-cells-cell", (_ref = {}, _defineProperty(_ref, "bk-date-picker-cells-cell-selected", cell.selected), _defineProperty(_ref, "bk-date-picker-cells-cell-disabled", cell.disabled), _defineProperty(_ref, "bk-date-picker-cells-cell-range", cell.range && !cell.start && !cell.end), _ref), this.getExternalCellClass(cell)];
|
|
9739
9857
|
},
|
|
9740
9858
|
tCell: function tCell(nr) {
|
|
9741
9859
|
return String(nr).length > 1 ? nr : "0".concat(nr);
|
|
@@ -10951,7 +11069,8 @@
|
|
|
10951
11069
|
currentView: selectionMode || 'date',
|
|
10952
11070
|
pickerTable: this.getTableType(selectionMode),
|
|
10953
11071
|
dates: dates,
|
|
10954
|
-
panelDate: this.startDate || dates[0] || new Date()
|
|
11072
|
+
panelDate: this.startDate || dates[0] || new Date(),
|
|
11073
|
+
realPickerType: this.getRealPickerType(selectionMode)
|
|
10955
11074
|
};
|
|
10956
11075
|
},
|
|
10957
11076
|
computed: {
|
|
@@ -10969,6 +11088,7 @@
|
|
|
10969
11088
|
var handler = function handler(type) {
|
|
10970
11089
|
return function () {
|
|
10971
11090
|
_this.pickerTable = _this.getTableType(type);
|
|
11091
|
+
_this.realPickerType = _this.getRealPickerType(type);
|
|
10972
11092
|
};
|
|
10973
11093
|
};
|
|
10974
11094
|
return {
|
|
@@ -11002,6 +11122,7 @@
|
|
|
11002
11122
|
selectionMode: function selectionMode(type) {
|
|
11003
11123
|
this.currentView = type;
|
|
11004
11124
|
this.pickerTable = this.getTableType(type);
|
|
11125
|
+
this.realPickerType = this.getRealPickerType(type);
|
|
11005
11126
|
},
|
|
11006
11127
|
focusedDate: function focusedDate(date) {
|
|
11007
11128
|
var isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear();
|
|
@@ -11017,6 +11138,7 @@
|
|
|
11017
11138
|
reset: function reset() {
|
|
11018
11139
|
this.currentView = this.selectionMode;
|
|
11019
11140
|
this.pickerTable = this.getTableType(this.currentView);
|
|
11141
|
+
this.realPickerType = this.getRealPickerType(this.currentView);
|
|
11020
11142
|
},
|
|
11021
11143
|
changeYear: function changeYear(dir) {
|
|
11022
11144
|
if (this.selectionMode === 'year' || this.pickerTable === 'year-table') {
|
|
@@ -11028,6 +11150,9 @@
|
|
|
11028
11150
|
getTableType: function getTableType(currentView) {
|
|
11029
11151
|
return currentView.match(/^time/) ? 'time-picker' : "".concat(currentView, "-table");
|
|
11030
11152
|
},
|
|
11153
|
+
getRealPickerType: function getRealPickerType(currentView) {
|
|
11154
|
+
return currentView.match(/^time/) ? 'time-picker' : "".concat(currentView);
|
|
11155
|
+
},
|
|
11031
11156
|
changeMonth: function changeMonth(dir) {
|
|
11032
11157
|
this.panelDate = siblingMonth(this.panelDate, dir);
|
|
11033
11158
|
},
|
|
@@ -11035,8 +11160,10 @@
|
|
|
11035
11160
|
this.panelDate = value;
|
|
11036
11161
|
if (this.pickerTable === 'year-table') {
|
|
11037
11162
|
this.pickerTable = 'month-table';
|
|
11163
|
+
this.realPickerType = 'month';
|
|
11038
11164
|
} else {
|
|
11039
11165
|
this.pickerTable = this.getTableType(this.currentView);
|
|
11166
|
+
this.realPickerType = this.getRealPickerType(this.currentView);
|
|
11040
11167
|
}
|
|
11041
11168
|
},
|
|
11042
11169
|
handlePick: function handlePick(value, type) {
|
|
@@ -11158,7 +11285,8 @@
|
|
|
11158
11285
|
"selection-mode": _vm.selectionMode,
|
|
11159
11286
|
"disabled-date": _vm.disabledDate,
|
|
11160
11287
|
"focused-date": _vm.focusedDate,
|
|
11161
|
-
"cell-class": _vm.cellClass
|
|
11288
|
+
"cell-class": _vm.cellClass,
|
|
11289
|
+
"real-picker-type": _vm.realPickerType
|
|
11162
11290
|
},
|
|
11163
11291
|
on: {
|
|
11164
11292
|
"pick": _vm.panelPickerHandlers,
|
|
@@ -12903,44 +13031,42 @@
|
|
|
12903
13031
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
12904
13032
|
var shouldClose;
|
|
12905
13033
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
12906
|
-
while (1) {
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12914
|
-
|
|
12915
|
-
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
_context.next = 17;
|
|
12921
|
-
break;
|
|
12922
|
-
}
|
|
12923
|
-
_this2.visible = false;
|
|
12924
|
-
typeof _this2.onClose === 'function' && _this2.onClose();
|
|
12925
|
-
_this2.$emit('input', false);
|
|
12926
|
-
_this2.$emit('cancel');
|
|
12927
|
-
_context.t0 = type;
|
|
12928
|
-
_context.next = _context.t0 === 'cancel' ? 13 : _context.t0 === 'close' ? 15 : 17;
|
|
13034
|
+
while (1) switch (_context.prev = _context.next) {
|
|
13035
|
+
case 0:
|
|
13036
|
+
shouldClose = true;
|
|
13037
|
+
if (!(typeof _this2.beforeClose === 'function')) {
|
|
13038
|
+
_context.next = 5;
|
|
13039
|
+
break;
|
|
13040
|
+
}
|
|
13041
|
+
_context.next = 4;
|
|
13042
|
+
return _this2.beforeClose();
|
|
13043
|
+
case 4:
|
|
13044
|
+
shouldClose = _context.sent;
|
|
13045
|
+
case 5:
|
|
13046
|
+
if (!shouldClose) {
|
|
13047
|
+
_context.next = 17;
|
|
12929
13048
|
break;
|
|
12930
|
-
|
|
13049
|
+
}
|
|
13050
|
+
_this2.visible = false;
|
|
13051
|
+
typeof _this2.onClose === 'function' && _this2.onClose();
|
|
13052
|
+
_this2.$emit('input', false);
|
|
13053
|
+
_this2.$emit('cancel');
|
|
13054
|
+
_context.t0 = type;
|
|
13055
|
+
_context.next = _context.t0 === 'cancel' ? 13 : _context.t0 === 'close' ? 15 : 17;
|
|
13056
|
+
break;
|
|
13057
|
+
case 13:
|
|
13058
|
+
typeof _this2.cancelFn === 'function' && _this2.cancelFn(_this2);
|
|
13059
|
+
return _context.abrupt("break", 17);
|
|
13060
|
+
case 15:
|
|
13061
|
+
if (_this2.closeFn) {
|
|
13062
|
+
typeof _this2.closeFn === 'function' && _this2.closeFn(_this2);
|
|
13063
|
+
} else {
|
|
12931
13064
|
typeof _this2.cancelFn === 'function' && _this2.cancelFn(_this2);
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
typeof _this2.cancelFn === 'function' && _this2.cancelFn(_this2);
|
|
12938
|
-
}
|
|
12939
|
-
return _context.abrupt("break", 17);
|
|
12940
|
-
case 17:
|
|
12941
|
-
case "end":
|
|
12942
|
-
return _context.stop();
|
|
12943
|
-
}
|
|
13065
|
+
}
|
|
13066
|
+
return _context.abrupt("break", 17);
|
|
13067
|
+
case 17:
|
|
13068
|
+
case "end":
|
|
13069
|
+
return _context.stop();
|
|
12944
13070
|
}
|
|
12945
13071
|
}, _callee);
|
|
12946
13072
|
}))();
|
|
@@ -12961,57 +13087,55 @@
|
|
|
12961
13087
|
this.$emit('confirm');
|
|
12962
13088
|
this.$nextTick( _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() {
|
|
12963
13089
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
12964
|
-
while (1) {
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
_context2.next = 4;
|
|
12969
|
-
break;
|
|
12970
|
-
}
|
|
12971
|
-
_this3.buttonLoading = true;
|
|
12972
|
-
_context2.next = 24;
|
|
12973
|
-
break;
|
|
12974
|
-
case 4:
|
|
12975
|
-
if (!(typeof _this3.confirmFn === 'function')) {
|
|
12976
|
-
_context2.next = 23;
|
|
12977
|
-
break;
|
|
12978
|
-
}
|
|
12979
|
-
if (!_this3.confirmLoading) {
|
|
12980
|
-
_context2.next = 20;
|
|
12981
|
-
break;
|
|
12982
|
-
}
|
|
12983
|
-
_context2.prev = 6;
|
|
12984
|
-
_this3.buttonLoading = true;
|
|
12985
|
-
_context2.next = 10;
|
|
12986
|
-
return _this3.confirmFn(_this3);
|
|
12987
|
-
case 10:
|
|
12988
|
-
_context2.next = 15;
|
|
13090
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
13091
|
+
case 0:
|
|
13092
|
+
if (!_this3.loading) {
|
|
13093
|
+
_context2.next = 4;
|
|
12989
13094
|
break;
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
|
|
12996
|
-
|
|
12997
|
-
return _context2.finish(15);
|
|
12998
|
-
case 18:
|
|
12999
|
-
_context2.next = 21;
|
|
13095
|
+
}
|
|
13096
|
+
_this3.buttonLoading = true;
|
|
13097
|
+
_context2.next = 24;
|
|
13098
|
+
break;
|
|
13099
|
+
case 4:
|
|
13100
|
+
if (!(typeof _this3.confirmFn === 'function')) {
|
|
13101
|
+
_context2.next = 23;
|
|
13000
13102
|
break;
|
|
13001
|
-
|
|
13002
|
-
|
|
13003
|
-
|
|
13004
|
-
_context2.next = 24;
|
|
13103
|
+
}
|
|
13104
|
+
if (!_this3.confirmLoading) {
|
|
13105
|
+
_context2.next = 20;
|
|
13005
13106
|
break;
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13107
|
+
}
|
|
13108
|
+
_context2.prev = 6;
|
|
13109
|
+
_this3.buttonLoading = true;
|
|
13110
|
+
_context2.next = 10;
|
|
13111
|
+
return _this3.confirmFn(_this3);
|
|
13112
|
+
case 10:
|
|
13113
|
+
_context2.next = 15;
|
|
13114
|
+
break;
|
|
13115
|
+
case 12:
|
|
13116
|
+
_context2.prev = 12;
|
|
13117
|
+
_context2.t0 = _context2["catch"](6);
|
|
13118
|
+
console.warn(_context2.t0);
|
|
13119
|
+
case 15:
|
|
13120
|
+
_context2.prev = 15;
|
|
13121
|
+
_this3.buttonLoading = false;
|
|
13122
|
+
return _context2.finish(15);
|
|
13123
|
+
case 18:
|
|
13124
|
+
_context2.next = 21;
|
|
13125
|
+
break;
|
|
13126
|
+
case 20:
|
|
13127
|
+
_this3.confirmFn(_this3);
|
|
13128
|
+
case 21:
|
|
13129
|
+
_context2.next = 24;
|
|
13130
|
+
break;
|
|
13131
|
+
case 23:
|
|
13132
|
+
if (_this3.autoClose) {
|
|
13133
|
+
_this3.visible = false;
|
|
13134
|
+
_this3.$emit('input', false);
|
|
13135
|
+
}
|
|
13136
|
+
case 24:
|
|
13137
|
+
case "end":
|
|
13138
|
+
return _context2.stop();
|
|
13015
13139
|
}
|
|
13016
13140
|
}, _callee2, null, [[6, 12, 15, 18]]);
|
|
13017
13141
|
})));
|
|
@@ -28664,60 +28788,58 @@
|
|
|
28664
28788
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
28665
28789
|
var result;
|
|
28666
28790
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28667
|
-
while (1) {
|
|
28668
|
-
|
|
28669
|
-
|
|
28670
|
-
|
|
28671
|
-
|
|
28672
|
-
|
|
28673
|
-
|
|
28674
|
-
|
|
28675
|
-
|
|
28676
|
-
|
|
28677
|
-
|
|
28678
|
-
|
|
28679
|
-
|
|
28680
|
-
|
|
28681
|
-
|
|
28682
|
-
|
|
28683
|
-
|
|
28684
|
-
|
|
28685
|
-
|
|
28686
|
-
|
|
28687
|
-
|
|
28688
|
-
|
|
28689
|
-
|
|
28690
|
-
|
|
28691
|
-
|
|
28692
|
-
|
|
28693
|
-
|
|
28694
|
-
|
|
28695
|
-
|
|
28696
|
-
|
|
28697
|
-
|
|
28698
|
-
|
|
28699
|
-
|
|
28700
|
-
|
|
28701
|
-
|
|
28702
|
-
|
|
28703
|
-
|
|
28704
|
-
|
|
28705
|
-
|
|
28706
|
-
|
|
28707
|
-
|
|
28708
|
-
|
|
28709
|
-
|
|
28710
|
-
|
|
28711
|
-
|
|
28712
|
-
|
|
28713
|
-
|
|
28714
|
-
|
|
28715
|
-
|
|
28716
|
-
|
|
28717
|
-
|
|
28718
|
-
|
|
28719
|
-
return _context.stop();
|
|
28720
|
-
}
|
|
28791
|
+
while (1) switch (_context.prev = _context.next) {
|
|
28792
|
+
case 0:
|
|
28793
|
+
if (!(rule.required && isEmpty(model))) {
|
|
28794
|
+
_context.next = 2;
|
|
28795
|
+
break;
|
|
28796
|
+
}
|
|
28797
|
+
return _context.abrupt("return", false);
|
|
28798
|
+
case 2:
|
|
28799
|
+
if (!(rule.regex && !rule.regex.test(model))) {
|
|
28800
|
+
_context.next = 4;
|
|
28801
|
+
break;
|
|
28802
|
+
}
|
|
28803
|
+
return _context.abrupt("return", false);
|
|
28804
|
+
case 4:
|
|
28805
|
+
if (!(rule.min && isString(model) && model.length < rule.min)) {
|
|
28806
|
+
_context.next = 6;
|
|
28807
|
+
break;
|
|
28808
|
+
}
|
|
28809
|
+
return _context.abrupt("return", false);
|
|
28810
|
+
case 6:
|
|
28811
|
+
if (!(rule.max && isString(model) && model.length > rule.max)) {
|
|
28812
|
+
_context.next = 8;
|
|
28813
|
+
break;
|
|
28814
|
+
}
|
|
28815
|
+
return _context.abrupt("return", false);
|
|
28816
|
+
case 8:
|
|
28817
|
+
if (!(rule.min && isNumber(model) && model < rule.min)) {
|
|
28818
|
+
_context.next = 10;
|
|
28819
|
+
break;
|
|
28820
|
+
}
|
|
28821
|
+
return _context.abrupt("return", false);
|
|
28822
|
+
case 10:
|
|
28823
|
+
if (!(rule.max && isNumber(model) && model > rule.max)) {
|
|
28824
|
+
_context.next = 12;
|
|
28825
|
+
break;
|
|
28826
|
+
}
|
|
28827
|
+
return _context.abrupt("return", false);
|
|
28828
|
+
case 12:
|
|
28829
|
+
if (!(rule.validator && typeof rule.validator === 'function')) {
|
|
28830
|
+
_context.next = 17;
|
|
28831
|
+
break;
|
|
28832
|
+
}
|
|
28833
|
+
_context.next = 15;
|
|
28834
|
+
return rule.validator(model);
|
|
28835
|
+
case 15:
|
|
28836
|
+
result = _context.sent;
|
|
28837
|
+
return _context.abrupt("return", result);
|
|
28838
|
+
case 17:
|
|
28839
|
+
return _context.abrupt("return", true);
|
|
28840
|
+
case 18:
|
|
28841
|
+
case "end":
|
|
28842
|
+
return _context.stop();
|
|
28721
28843
|
}
|
|
28722
28844
|
}, _callee);
|
|
28723
28845
|
}))();
|
|
@@ -28755,30 +28877,28 @@
|
|
|
28755
28877
|
var _ref = _asyncToGenerator( _regeneratorRuntime().mark(function _callee2(resolve, reject) {
|
|
28756
28878
|
var curRule, result;
|
|
28757
28879
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
28758
|
-
while (1) {
|
|
28759
|
-
|
|
28760
|
-
|
|
28761
|
-
|
|
28762
|
-
|
|
28763
|
-
|
|
28764
|
-
|
|
28765
|
-
|
|
28766
|
-
|
|
28767
|
-
|
|
28768
|
-
|
|
28769
|
-
} else {
|
|
28770
|
-
reject(curRule);
|
|
28771
|
-
}
|
|
28772
|
-
_context2.next = 11;
|
|
28773
|
-
break;
|
|
28774
|
-
case 8:
|
|
28775
|
-
_context2.prev = 8;
|
|
28776
|
-
_context2.t0 = _context2["catch"](1);
|
|
28880
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
28881
|
+
case 0:
|
|
28882
|
+
curRule = rule;
|
|
28883
|
+
_context2.prev = 1;
|
|
28884
|
+
_context2.next = 4;
|
|
28885
|
+
return self.checkRule(curRule, model);
|
|
28886
|
+
case 4:
|
|
28887
|
+
result = _context2.sent;
|
|
28888
|
+
if (result) {
|
|
28889
|
+
resolve(curRule);
|
|
28890
|
+
} else {
|
|
28777
28891
|
reject(curRule);
|
|
28778
|
-
|
|
28779
|
-
|
|
28780
|
-
|
|
28781
|
-
|
|
28892
|
+
}
|
|
28893
|
+
_context2.next = 11;
|
|
28894
|
+
break;
|
|
28895
|
+
case 8:
|
|
28896
|
+
_context2.prev = 8;
|
|
28897
|
+
_context2.t0 = _context2["catch"](1);
|
|
28898
|
+
reject(curRule);
|
|
28899
|
+
case 11:
|
|
28900
|
+
case "end":
|
|
28901
|
+
return _context2.stop();
|
|
28782
28902
|
}
|
|
28783
28903
|
}, _callee2, null, [[1, 8]]);
|
|
28784
28904
|
}));
|
|
@@ -29018,26 +29138,24 @@
|
|
|
29018
29138
|
instance.confirmFn = opts.confirmFn && typeof opts.confirmFn === 'function' ? _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
29019
29139
|
var res;
|
|
29020
29140
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
29021
|
-
while (1) {
|
|
29022
|
-
|
|
29023
|
-
|
|
29024
|
-
|
|
29025
|
-
|
|
29026
|
-
|
|
29027
|
-
|
|
29028
|
-
|
|
29029
|
-
|
|
29030
|
-
|
|
29031
|
-
|
|
29032
|
-
|
|
29033
|
-
|
|
29034
|
-
|
|
29035
|
-
|
|
29036
|
-
|
|
29037
|
-
|
|
29038
|
-
|
|
29039
|
-
return _context.stop();
|
|
29040
|
-
}
|
|
29141
|
+
while (1) switch (_context.prev = _context.next) {
|
|
29142
|
+
case 0:
|
|
29143
|
+
instance.closeIcon = false;
|
|
29144
|
+
_context.next = 3;
|
|
29145
|
+
return opts.confirmFn(instance);
|
|
29146
|
+
case 3:
|
|
29147
|
+
res = _context.sent;
|
|
29148
|
+
instance.closeIcon = opts.closeIcon !== false;
|
|
29149
|
+
if (!(!res && typeof res !== 'undefined')) {
|
|
29150
|
+
_context.next = 7;
|
|
29151
|
+
break;
|
|
29152
|
+
}
|
|
29153
|
+
return _context.abrupt("return");
|
|
29154
|
+
case 7:
|
|
29155
|
+
Info.close(id);
|
|
29156
|
+
case 8:
|
|
29157
|
+
case "end":
|
|
29158
|
+
return _context.stop();
|
|
29041
29159
|
}
|
|
29042
29160
|
}, _callee);
|
|
29043
29161
|
})) : function () {
|
|
@@ -29076,7 +29194,7 @@
|
|
|
29076
29194
|
};
|
|
29077
29195
|
Info.close = function (id, optsClose) {
|
|
29078
29196
|
var len = instancesList.length;
|
|
29079
|
-
var _loop = function _loop(
|
|
29197
|
+
var _loop = function _loop() {
|
|
29080
29198
|
var targetInstance = instancesList[index];
|
|
29081
29199
|
if (id === targetInstance.id) {
|
|
29082
29200
|
targetInstance.value = false;
|
|
@@ -29091,7 +29209,7 @@
|
|
|
29091
29209
|
}
|
|
29092
29210
|
};
|
|
29093
29211
|
for (var index = 0; index < len; index++) {
|
|
29094
|
-
var _ret = _loop(
|
|
29212
|
+
var _ret = _loop();
|
|
29095
29213
|
if (_ret === "break") break;
|
|
29096
29214
|
}
|
|
29097
29215
|
};
|
|
@@ -33835,28 +33953,26 @@
|
|
|
33835
33953
|
var _this11 = this;
|
|
33836
33954
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
33837
33955
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33838
|
-
while (1) {
|
|
33839
|
-
|
|
33840
|
-
|
|
33841
|
-
|
|
33842
|
-
|
|
33843
|
-
|
|
33844
|
-
|
|
33845
|
-
|
|
33846
|
-
|
|
33847
|
-
|
|
33848
|
-
|
|
33849
|
-
|
|
33850
|
-
|
|
33851
|
-
|
|
33852
|
-
|
|
33853
|
-
|
|
33854
|
-
|
|
33855
|
-
|
|
33856
|
-
|
|
33857
|
-
|
|
33858
|
-
return _context.stop();
|
|
33859
|
-
}
|
|
33956
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33957
|
+
case 0:
|
|
33958
|
+
_context.prev = 0;
|
|
33959
|
+
_this11.searchLoading = true;
|
|
33960
|
+
_context.next = 4;
|
|
33961
|
+
return _this11.remoteMethod(_this11.searchValue);
|
|
33962
|
+
case 4:
|
|
33963
|
+
_context.next = 9;
|
|
33964
|
+
break;
|
|
33965
|
+
case 6:
|
|
33966
|
+
_context.prev = 6;
|
|
33967
|
+
_context.t0 = _context["catch"](0);
|
|
33968
|
+
console.error(_context.t0);
|
|
33969
|
+
case 9:
|
|
33970
|
+
_context.prev = 9;
|
|
33971
|
+
_this11.searchLoading = false;
|
|
33972
|
+
return _context.finish(9);
|
|
33973
|
+
case 12:
|
|
33974
|
+
case "end":
|
|
33975
|
+
return _context.stop();
|
|
33860
33976
|
}
|
|
33861
33977
|
}, _callee, null, [[0, 6, 9, 12]]);
|
|
33862
33978
|
}))();
|
|
@@ -36539,29 +36655,27 @@
|
|
|
36539
36655
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
36540
36656
|
var shouldClose;
|
|
36541
36657
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
36542
|
-
while (1) {
|
|
36543
|
-
|
|
36544
|
-
|
|
36545
|
-
|
|
36546
|
-
|
|
36547
|
-
|
|
36548
|
-
|
|
36549
|
-
|
|
36550
|
-
|
|
36551
|
-
|
|
36552
|
-
|
|
36553
|
-
|
|
36554
|
-
|
|
36555
|
-
|
|
36556
|
-
|
|
36557
|
-
|
|
36558
|
-
|
|
36559
|
-
|
|
36560
|
-
|
|
36561
|
-
|
|
36562
|
-
|
|
36563
|
-
return _context.stop();
|
|
36564
|
-
}
|
|
36658
|
+
while (1) switch (_context.prev = _context.next) {
|
|
36659
|
+
case 0:
|
|
36660
|
+
shouldClose = true;
|
|
36661
|
+
if (!(typeof _this2.beforeClose === 'function')) {
|
|
36662
|
+
_context.next = 5;
|
|
36663
|
+
break;
|
|
36664
|
+
}
|
|
36665
|
+
_context.next = 4;
|
|
36666
|
+
return _this2.beforeClose();
|
|
36667
|
+
case 4:
|
|
36668
|
+
shouldClose = _context.sent;
|
|
36669
|
+
case 5:
|
|
36670
|
+
if (shouldClose) {
|
|
36671
|
+
_this2.$emit('update:isShow', false);
|
|
36672
|
+
setTimeout(function () {
|
|
36673
|
+
_this2.$emit('animation-end');
|
|
36674
|
+
}, 250);
|
|
36675
|
+
}
|
|
36676
|
+
case 6:
|
|
36677
|
+
case "end":
|
|
36678
|
+
return _context.stop();
|
|
36565
36679
|
}
|
|
36566
36680
|
}, _callee);
|
|
36567
36681
|
}))();
|
|
@@ -37602,56 +37716,52 @@
|
|
|
37602
37716
|
var _this = this;
|
|
37603
37717
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() {
|
|
37604
37718
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
37605
|
-
while (1) {
|
|
37606
|
-
|
|
37607
|
-
|
|
37608
|
-
|
|
37609
|
-
|
|
37610
|
-
|
|
37611
|
-
|
|
37612
|
-
|
|
37613
|
-
if (!(typeof _this.beforeChange === 'function')) {
|
|
37614
|
-
_context2.next = 5;
|
|
37615
|
-
break;
|
|
37616
|
-
}
|
|
37719
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
37720
|
+
case 0:
|
|
37721
|
+
_context2.prev = 0;
|
|
37722
|
+
if (!(_this.controllable && index !== _this.curStep)) {
|
|
37723
|
+
_context2.next = 7;
|
|
37724
|
+
break;
|
|
37725
|
+
}
|
|
37726
|
+
if (!(typeof _this.beforeChange === 'function')) {
|
|
37617
37727
|
_context2.next = 5;
|
|
37618
|
-
return new promise$1( function () {
|
|
37619
|
-
var _ref = _asyncToGenerator( _regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
37620
|
-
var confirmed;
|
|
37621
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37622
|
-
while (1) {
|
|
37623
|
-
switch (_context.prev = _context.next) {
|
|
37624
|
-
case 0:
|
|
37625
|
-
_context.next = 2;
|
|
37626
|
-
return _this.beforeChange(index);
|
|
37627
|
-
case 2:
|
|
37628
|
-
confirmed = _context.sent;
|
|
37629
|
-
confirmed ? resolve(confirmed) : reject(confirmed);
|
|
37630
|
-
case 4:
|
|
37631
|
-
case "end":
|
|
37632
|
-
return _context.stop();
|
|
37633
|
-
}
|
|
37634
|
-
}
|
|
37635
|
-
}, _callee);
|
|
37636
|
-
}));
|
|
37637
|
-
return function (_x, _x2) {
|
|
37638
|
-
return _ref.apply(this, arguments);
|
|
37639
|
-
};
|
|
37640
|
-
}());
|
|
37641
|
-
case 5:
|
|
37642
|
-
_this.$emit('update:curStep', index);
|
|
37643
|
-
_this.$emit('step-changed', index);
|
|
37644
|
-
case 7:
|
|
37645
|
-
_context2.next = 12;
|
|
37646
37728
|
break;
|
|
37647
|
-
|
|
37648
|
-
|
|
37649
|
-
|
|
37650
|
-
|
|
37651
|
-
|
|
37652
|
-
|
|
37653
|
-
|
|
37654
|
-
|
|
37729
|
+
}
|
|
37730
|
+
_context2.next = 5;
|
|
37731
|
+
return new promise$1( function () {
|
|
37732
|
+
var _ref = _asyncToGenerator( _regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
37733
|
+
var confirmed;
|
|
37734
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37735
|
+
while (1) switch (_context.prev = _context.next) {
|
|
37736
|
+
case 0:
|
|
37737
|
+
_context.next = 2;
|
|
37738
|
+
return _this.beforeChange(index);
|
|
37739
|
+
case 2:
|
|
37740
|
+
confirmed = _context.sent;
|
|
37741
|
+
confirmed ? resolve(confirmed) : reject(confirmed);
|
|
37742
|
+
case 4:
|
|
37743
|
+
case "end":
|
|
37744
|
+
return _context.stop();
|
|
37745
|
+
}
|
|
37746
|
+
}, _callee);
|
|
37747
|
+
}));
|
|
37748
|
+
return function (_x, _x2) {
|
|
37749
|
+
return _ref.apply(this, arguments);
|
|
37750
|
+
};
|
|
37751
|
+
}());
|
|
37752
|
+
case 5:
|
|
37753
|
+
_this.$emit('update:curStep', index);
|
|
37754
|
+
_this.$emit('step-changed', index);
|
|
37755
|
+
case 7:
|
|
37756
|
+
_context2.next = 12;
|
|
37757
|
+
break;
|
|
37758
|
+
case 9:
|
|
37759
|
+
_context2.prev = 9;
|
|
37760
|
+
_context2.t0 = _context2["catch"](0);
|
|
37761
|
+
console.warn(_context2.t0);
|
|
37762
|
+
case 12:
|
|
37763
|
+
case "end":
|
|
37764
|
+
return _context2.stop();
|
|
37655
37765
|
}
|
|
37656
37766
|
}, _callee2, null, [[0, 9]]);
|
|
37657
37767
|
}))();
|
|
@@ -38269,93 +38379,89 @@
|
|
|
38269
38379
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() {
|
|
38270
38380
|
var toggleStatus, shouldToggle;
|
|
38271
38381
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
38272
|
-
while (1) {
|
|
38273
|
-
|
|
38274
|
-
|
|
38275
|
-
|
|
38276
|
-
|
|
38277
|
-
|
|
38278
|
-
|
|
38279
|
-
|
|
38280
|
-
|
|
38281
|
-
|
|
38282
|
-
|
|
38283
|
-
|
|
38284
|
-
|
|
38285
|
-
|
|
38286
|
-
|
|
38287
|
-
if (toggleStatus.rejector) {
|
|
38288
|
-
toggleStatus.rejector(false);
|
|
38289
|
-
}
|
|
38290
|
-
return _context2.abrupt("return", false);
|
|
38291
|
-
case 7:
|
|
38292
|
-
if (!(typeof _this3.beforeToggle === 'function')) {
|
|
38293
|
-
_context2.next = 29;
|
|
38294
|
-
break;
|
|
38295
|
-
}
|
|
38296
|
-
if (!toggleStatus.previousPanel) {
|
|
38297
|
-
_context2.next = 14;
|
|
38298
|
-
break;
|
|
38299
|
-
}
|
|
38300
|
-
if (!(toggleStatus.previousPanel === panel)) {
|
|
38301
|
-
_context2.next = 13;
|
|
38302
|
-
break;
|
|
38303
|
-
}
|
|
38304
|
-
return _context2.abrupt("return", false);
|
|
38305
|
-
case 13:
|
|
38382
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
38383
|
+
case 0:
|
|
38384
|
+
if (!panel.disabled) {
|
|
38385
|
+
_context2.next = 2;
|
|
38386
|
+
break;
|
|
38387
|
+
}
|
|
38388
|
+
return _context2.abrupt("return", false);
|
|
38389
|
+
case 2:
|
|
38390
|
+
_this3.handleClearHoverTimer();
|
|
38391
|
+
toggleStatus = _this3.promise.toggle;
|
|
38392
|
+
if (!(panel.name === _this3.localActive)) {
|
|
38393
|
+
_context2.next = 7;
|
|
38394
|
+
break;
|
|
38395
|
+
}
|
|
38396
|
+
if (toggleStatus.rejector) {
|
|
38306
38397
|
toggleStatus.rejector(false);
|
|
38307
|
-
|
|
38308
|
-
|
|
38309
|
-
|
|
38310
|
-
|
|
38311
|
-
|
|
38312
|
-
var confirmed;
|
|
38313
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
38314
|
-
while (1) {
|
|
38315
|
-
switch (_context.prev = _context.next) {
|
|
38316
|
-
case 0:
|
|
38317
|
-
toggleStatus.previousPanel = panel;
|
|
38318
|
-
toggleStatus.rejector = reject;
|
|
38319
|
-
_context.next = 4;
|
|
38320
|
-
return _this3.beforeToggle(panel.name, panel);
|
|
38321
|
-
case 4:
|
|
38322
|
-
confirmed = _context.sent;
|
|
38323
|
-
confirmed ? resolve(confirmed) : reject(confirmed);
|
|
38324
|
-
case 6:
|
|
38325
|
-
case "end":
|
|
38326
|
-
return _context.stop();
|
|
38327
|
-
}
|
|
38328
|
-
}
|
|
38329
|
-
}, _callee);
|
|
38330
|
-
}));
|
|
38331
|
-
return function (_x, _x2) {
|
|
38332
|
-
return _ref.apply(this, arguments);
|
|
38333
|
-
};
|
|
38334
|
-
}());
|
|
38335
|
-
case 17:
|
|
38336
|
-
shouldToggle = _context2.sent;
|
|
38337
|
-
if (shouldToggle) {
|
|
38338
|
-
_this3.localActive = panel.name;
|
|
38339
|
-
}
|
|
38340
|
-
_context2.next = 24;
|
|
38398
|
+
}
|
|
38399
|
+
return _context2.abrupt("return", false);
|
|
38400
|
+
case 7:
|
|
38401
|
+
if (!(typeof _this3.beforeToggle === 'function')) {
|
|
38402
|
+
_context2.next = 29;
|
|
38341
38403
|
break;
|
|
38342
|
-
|
|
38343
|
-
|
|
38344
|
-
_context2.
|
|
38345
|
-
console.warn('Previous tab toggle canceled');
|
|
38346
|
-
case 24:
|
|
38347
|
-
_context2.prev = 24;
|
|
38348
|
-
_this3.clearToggleStatus();
|
|
38349
|
-
return _context2.finish(24);
|
|
38350
|
-
case 27:
|
|
38351
|
-
_context2.next = 30;
|
|
38404
|
+
}
|
|
38405
|
+
if (!toggleStatus.previousPanel) {
|
|
38406
|
+
_context2.next = 14;
|
|
38352
38407
|
break;
|
|
38353
|
-
|
|
38408
|
+
}
|
|
38409
|
+
if (!(toggleStatus.previousPanel === panel)) {
|
|
38410
|
+
_context2.next = 13;
|
|
38411
|
+
break;
|
|
38412
|
+
}
|
|
38413
|
+
return _context2.abrupt("return", false);
|
|
38414
|
+
case 13:
|
|
38415
|
+
toggleStatus.rejector(false);
|
|
38416
|
+
case 14:
|
|
38417
|
+
_context2.prev = 14;
|
|
38418
|
+
_context2.next = 17;
|
|
38419
|
+
return new promise$1( function () {
|
|
38420
|
+
var _ref = _asyncToGenerator( _regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
38421
|
+
var confirmed;
|
|
38422
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
38423
|
+
while (1) switch (_context.prev = _context.next) {
|
|
38424
|
+
case 0:
|
|
38425
|
+
toggleStatus.previousPanel = panel;
|
|
38426
|
+
toggleStatus.rejector = reject;
|
|
38427
|
+
_context.next = 4;
|
|
38428
|
+
return _this3.beforeToggle(panel.name, panel);
|
|
38429
|
+
case 4:
|
|
38430
|
+
confirmed = _context.sent;
|
|
38431
|
+
confirmed ? resolve(confirmed) : reject(confirmed);
|
|
38432
|
+
case 6:
|
|
38433
|
+
case "end":
|
|
38434
|
+
return _context.stop();
|
|
38435
|
+
}
|
|
38436
|
+
}, _callee);
|
|
38437
|
+
}));
|
|
38438
|
+
return function (_x, _x2) {
|
|
38439
|
+
return _ref.apply(this, arguments);
|
|
38440
|
+
};
|
|
38441
|
+
}());
|
|
38442
|
+
case 17:
|
|
38443
|
+
shouldToggle = _context2.sent;
|
|
38444
|
+
if (shouldToggle) {
|
|
38354
38445
|
_this3.localActive = panel.name;
|
|
38355
|
-
|
|
38356
|
-
|
|
38357
|
-
|
|
38358
|
-
|
|
38446
|
+
}
|
|
38447
|
+
_context2.next = 24;
|
|
38448
|
+
break;
|
|
38449
|
+
case 21:
|
|
38450
|
+
_context2.prev = 21;
|
|
38451
|
+
_context2.t0 = _context2["catch"](14);
|
|
38452
|
+
console.warn('Previous tab toggle canceled');
|
|
38453
|
+
case 24:
|
|
38454
|
+
_context2.prev = 24;
|
|
38455
|
+
_this3.clearToggleStatus();
|
|
38456
|
+
return _context2.finish(24);
|
|
38457
|
+
case 27:
|
|
38458
|
+
_context2.next = 30;
|
|
38459
|
+
break;
|
|
38460
|
+
case 29:
|
|
38461
|
+
_this3.localActive = panel.name;
|
|
38462
|
+
case 30:
|
|
38463
|
+
case "end":
|
|
38464
|
+
return _context2.stop();
|
|
38359
38465
|
}
|
|
38360
38466
|
}, _callee2, null, [[14, 21, 24, 27]]);
|
|
38361
38467
|
}))();
|
|
@@ -39308,19 +39414,17 @@
|
|
|
39308
39414
|
setTimeout( _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
39309
39415
|
var result;
|
|
39310
39416
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39311
|
-
while (1) {
|
|
39312
|
-
|
|
39313
|
-
|
|
39314
|
-
|
|
39315
|
-
|
|
39316
|
-
|
|
39317
|
-
|
|
39318
|
-
|
|
39319
|
-
|
|
39320
|
-
|
|
39321
|
-
|
|
39322
|
-
return _context.stop();
|
|
39323
|
-
}
|
|
39417
|
+
while (1) switch (_context.prev = _context.next) {
|
|
39418
|
+
case 0:
|
|
39419
|
+
promise = null;
|
|
39420
|
+
_context.next = 3;
|
|
39421
|
+
return handler.apply(void 0, _toConsumableArray(_arguments));
|
|
39422
|
+
case 3:
|
|
39423
|
+
result = _context.sent;
|
|
39424
|
+
resolve(result);
|
|
39425
|
+
case 5:
|
|
39426
|
+
case "end":
|
|
39427
|
+
return _context.stop();
|
|
39324
39428
|
}
|
|
39325
39429
|
}, _callee);
|
|
39326
39430
|
})), 0);
|
|
@@ -41005,30 +41109,28 @@
|
|
|
41005
41109
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
41006
41110
|
var row, event, column, result;
|
|
41007
41111
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41008
|
-
while (1) {
|
|
41009
|
-
|
|
41010
|
-
|
|
41011
|
-
|
|
41012
|
-
|
|
41013
|
-
|
|
41014
|
-
|
|
41015
|
-
|
|
41016
|
-
|
|
41017
|
-
|
|
41018
|
-
|
|
41019
|
-
|
|
41020
|
-
|
|
41021
|
-
|
|
41022
|
-
|
|
41023
|
-
|
|
41024
|
-
|
|
41025
|
-
|
|
41026
|
-
|
|
41027
|
-
|
|
41028
|
-
|
|
41029
|
-
|
|
41030
|
-
return _context.stop();
|
|
41031
|
-
}
|
|
41112
|
+
while (1) switch (_context.prev = _context.next) {
|
|
41113
|
+
case 0:
|
|
41114
|
+
row = data.row, event = data.event, column = data.column;
|
|
41115
|
+
event.stopPropagation();
|
|
41116
|
+
if (!(typeof column.beforeExpandChange === 'function')) {
|
|
41117
|
+
_context.next = 8;
|
|
41118
|
+
break;
|
|
41119
|
+
}
|
|
41120
|
+
_context.next = 5;
|
|
41121
|
+
return column.beforeExpandChange(data);
|
|
41122
|
+
case 5:
|
|
41123
|
+
result = _context.sent;
|
|
41124
|
+
if (result) {
|
|
41125
|
+
_context.next = 8;
|
|
41126
|
+
break;
|
|
41127
|
+
}
|
|
41128
|
+
return _context.abrupt("return", false);
|
|
41129
|
+
case 8:
|
|
41130
|
+
_this3.store.toggleRowExpansion(row);
|
|
41131
|
+
case 9:
|
|
41132
|
+
case "end":
|
|
41133
|
+
return _context.stop();
|
|
41032
41134
|
}
|
|
41033
41135
|
}, _callee);
|
|
41034
41136
|
}))();
|
|
@@ -42990,27 +43092,25 @@
|
|
|
42990
43092
|
var _click = _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
42991
43093
|
var result;
|
|
42992
43094
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
42993
|
-
while (1) {
|
|
42994
|
-
|
|
42995
|
-
|
|
42996
|
-
|
|
42997
|
-
|
|
42998
|
-
|
|
42999
|
-
|
|
43000
|
-
|
|
43001
|
-
|
|
43002
|
-
|
|
43003
|
-
|
|
43004
|
-
|
|
43005
|
-
|
|
43006
|
-
|
|
43007
|
-
|
|
43008
|
-
|
|
43009
|
-
|
|
43010
|
-
|
|
43011
|
-
|
|
43012
|
-
return _context.stop();
|
|
43013
|
-
}
|
|
43095
|
+
while (1) switch (_context.prev = _context.next) {
|
|
43096
|
+
case 0:
|
|
43097
|
+
_context.next = 2;
|
|
43098
|
+
return column.beforeSelectAllChange(_this.isAllSelected, {
|
|
43099
|
+
column: column,
|
|
43100
|
+
store: store
|
|
43101
|
+
});
|
|
43102
|
+
case 2:
|
|
43103
|
+
result = _context.sent;
|
|
43104
|
+
if (!(result === false)) {
|
|
43105
|
+
_context.next = 5;
|
|
43106
|
+
break;
|
|
43107
|
+
}
|
|
43108
|
+
return _context.abrupt("return");
|
|
43109
|
+
case 5:
|
|
43110
|
+
_this.toggleAllSelection();
|
|
43111
|
+
case 6:
|
|
43112
|
+
case "end":
|
|
43113
|
+
return _context.stop();
|
|
43014
43114
|
}
|
|
43015
43115
|
}, _callee);
|
|
43016
43116
|
}));
|
|
@@ -43046,30 +43146,28 @@
|
|
|
43046
43146
|
var _click2 = _asyncToGenerator( _regeneratorRuntime().mark(function _callee2(event) {
|
|
43047
43147
|
var result;
|
|
43048
43148
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
43049
|
-
while (1) {
|
|
43050
|
-
|
|
43051
|
-
|
|
43052
|
-
|
|
43053
|
-
|
|
43054
|
-
|
|
43055
|
-
|
|
43056
|
-
|
|
43057
|
-
|
|
43058
|
-
|
|
43059
|
-
|
|
43060
|
-
|
|
43061
|
-
|
|
43062
|
-
|
|
43063
|
-
|
|
43064
|
-
|
|
43065
|
-
|
|
43066
|
-
|
|
43067
|
-
|
|
43068
|
-
|
|
43069
|
-
|
|
43070
|
-
|
|
43071
|
-
return _context2.stop();
|
|
43072
|
-
}
|
|
43149
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
43150
|
+
case 0:
|
|
43151
|
+
event.stopPropagation();
|
|
43152
|
+
if (!disabled) {
|
|
43153
|
+
_context2.next = 3;
|
|
43154
|
+
break;
|
|
43155
|
+
}
|
|
43156
|
+
return _context2.abrupt("return");
|
|
43157
|
+
case 3:
|
|
43158
|
+
_context2.next = 5;
|
|
43159
|
+
return column.beforeSelectChange(store.isSelected(row), {
|
|
43160
|
+
row: row,
|
|
43161
|
+
column: column,
|
|
43162
|
+
store: store,
|
|
43163
|
+
$index: $index
|
|
43164
|
+
});
|
|
43165
|
+
case 5:
|
|
43166
|
+
result = _context2.sent;
|
|
43167
|
+
result !== false && store.commit('rowSelectedChanged', row);
|
|
43168
|
+
case 7:
|
|
43169
|
+
case "end":
|
|
43170
|
+
return _context2.stop();
|
|
43073
43171
|
}
|
|
43074
43172
|
}, _callee2);
|
|
43075
43173
|
}));
|
|
@@ -44491,15 +44589,13 @@
|
|
|
44491
44589
|
this.showScrollLoading = true;
|
|
44492
44590
|
setTimeout( _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
44493
44591
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
44494
|
-
while (1) {
|
|
44495
|
-
|
|
44496
|
-
|
|
44497
|
-
|
|
44498
|
-
|
|
44499
|
-
|
|
44500
|
-
|
|
44501
|
-
return _context.stop();
|
|
44502
|
-
}
|
|
44592
|
+
while (1) switch (_context.prev = _context.next) {
|
|
44593
|
+
case 0:
|
|
44594
|
+
_context.next = 2;
|
|
44595
|
+
return _this4.pageChange(curPage);
|
|
44596
|
+
case 2:
|
|
44597
|
+
case "end":
|
|
44598
|
+
return _context.stop();
|
|
44503
44599
|
}
|
|
44504
44600
|
}, _callee);
|
|
44505
44601
|
})), 500);
|
|
@@ -47494,59 +47590,57 @@
|
|
|
47494
47590
|
var _ref = _asyncToGenerator( _regeneratorRuntime().mark(function _callee(options) {
|
|
47495
47591
|
var chunkSize, file, blockCount, hash, progressList;
|
|
47496
47592
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
47497
|
-
while (1) {
|
|
47498
|
-
|
|
47499
|
-
|
|
47500
|
-
|
|
47501
|
-
|
|
47502
|
-
|
|
47503
|
-
|
|
47504
|
-
|
|
47505
|
-
|
|
47506
|
-
|
|
47507
|
-
|
|
47508
|
-
|
|
47509
|
-
|
|
47510
|
-
|
|
47511
|
-
|
|
47512
|
-
|
|
47513
|
-
|
|
47514
|
-
|
|
47515
|
-
|
|
47516
|
-
|
|
47517
|
-
|
|
47518
|
-
|
|
47519
|
-
|
|
47520
|
-
|
|
47521
|
-
|
|
47522
|
-
|
|
47523
|
-
|
|
47524
|
-
|
|
47525
|
-
|
|
47526
|
-
|
|
47527
|
-
|
|
47528
|
-
|
|
47529
|
-
|
|
47530
|
-
req.
|
|
47531
|
-
|
|
47532
|
-
|
|
47533
|
-
|
|
47534
|
-
|
|
47535
|
-
|
|
47536
|
-
|
|
47537
|
-
|
|
47538
|
-
options.onSuccess(reponseText, options.fileObj);
|
|
47539
|
-
}
|
|
47540
|
-
options.onDone(options.fileObj);
|
|
47593
|
+
while (1) switch (_context.prev = _context.next) {
|
|
47594
|
+
case 0:
|
|
47595
|
+
chunkSize = options.chunkSize * 1024 * 1024;
|
|
47596
|
+
file = options.fileObj.origin;
|
|
47597
|
+
if (file) {
|
|
47598
|
+
_context.next = 5;
|
|
47599
|
+
break;
|
|
47600
|
+
}
|
|
47601
|
+
_this.$bkMessage({
|
|
47602
|
+
theme: 'warning',
|
|
47603
|
+
message: '没有获取到文件',
|
|
47604
|
+
offsetY: 80
|
|
47605
|
+
});
|
|
47606
|
+
return _context.abrupt("return");
|
|
47607
|
+
case 5:
|
|
47608
|
+
blockCount = Math.ceil(file.size / chunkSize);
|
|
47609
|
+
_context.next = 8;
|
|
47610
|
+
return hashFile(file, chunkSize);
|
|
47611
|
+
case 8:
|
|
47612
|
+
hash = _context.sent;
|
|
47613
|
+
progressList = [];
|
|
47614
|
+
sliceUpload(options, file, blockCount, hash, progressList, chunkSize);
|
|
47615
|
+
_context.next = 13;
|
|
47616
|
+
return promise$1.all(progressList).then(function () {
|
|
47617
|
+
var data = {
|
|
47618
|
+
size: file.size,
|
|
47619
|
+
name: file.name,
|
|
47620
|
+
total: blockCount,
|
|
47621
|
+
hash: hash
|
|
47622
|
+
};
|
|
47623
|
+
var req = new XMLHttpRequest();
|
|
47624
|
+
req.open(options.method, options.mergeUrl, true);
|
|
47625
|
+
req.onreadystatechange = function () {
|
|
47626
|
+
if (req.readyState === 4) {
|
|
47627
|
+
var reponseText = parseResponse(req.responseText || req.response);
|
|
47628
|
+
if (req.status < 200 || req.status >= 300) {
|
|
47629
|
+
options.fileObj.progress = 100 + '%';
|
|
47630
|
+
options.fileObj.errorMsg = reponseText.message || _t('bk.uploadFile.uploadFailed');
|
|
47631
|
+
options.onError(options.fileObj, options.fileList, req.response);
|
|
47632
|
+
} else {
|
|
47633
|
+
options.onSuccess(reponseText, options.fileObj);
|
|
47541
47634
|
}
|
|
47542
|
-
|
|
47543
|
-
|
|
47544
|
-
|
|
47545
|
-
|
|
47546
|
-
|
|
47547
|
-
|
|
47548
|
-
|
|
47549
|
-
|
|
47635
|
+
options.onDone(options.fileObj);
|
|
47636
|
+
}
|
|
47637
|
+
};
|
|
47638
|
+
req.setRequestHeader('Content-type', 'application/JSON');
|
|
47639
|
+
req.send(stringify$1(data));
|
|
47640
|
+
});
|
|
47641
|
+
case 13:
|
|
47642
|
+
case "end":
|
|
47643
|
+
return _context.stop();
|
|
47550
47644
|
}
|
|
47551
47645
|
}, _callee);
|
|
47552
47646
|
}));
|
|
@@ -51758,53 +51852,51 @@
|
|
|
51758
51852
|
var _this3 = this;
|
|
51759
51853
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
51760
51854
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
51761
|
-
while (1) {
|
|
51762
|
-
|
|
51763
|
-
|
|
51764
|
-
|
|
51765
|
-
|
|
51766
|
-
|
|
51767
|
-
|
|
51768
|
-
|
|
51769
|
-
|
|
51770
|
-
|
|
51771
|
-
|
|
51772
|
-
|
|
51773
|
-
if (!_context.t0) {
|
|
51774
|
-
_context.next = 9;
|
|
51775
|
-
break;
|
|
51776
|
-
}
|
|
51855
|
+
while (1) switch (_context.prev = _context.next) {
|
|
51856
|
+
case 0:
|
|
51857
|
+
_this3.dialog.show = v;
|
|
51858
|
+
if (!v) {
|
|
51859
|
+
_context.next = 20;
|
|
51860
|
+
break;
|
|
51861
|
+
}
|
|
51862
|
+
_this3.dialog.width = window.innerWidth >= 1920 ? 1110 : 850;
|
|
51863
|
+
_this3.dialog.height = window.innerWidth >= 1920 ? 640 : 520;
|
|
51864
|
+
_this3.loading = true;
|
|
51865
|
+
_context.t0 = !_this3.versionList.length && typeof _this3.getVersionList === 'function';
|
|
51866
|
+
if (!_context.t0) {
|
|
51777
51867
|
_context.next = 9;
|
|
51778
|
-
return _this3.getVersionList();
|
|
51779
|
-
case 9:
|
|
51780
|
-
if (!_this3.versionList.length) {
|
|
51781
|
-
_context.next = 19;
|
|
51782
|
-
break;
|
|
51783
|
-
}
|
|
51784
|
-
case 10:
|
|
51785
|
-
if (!(!_this3.finished && _this3.dialog.height - 40 > _this3.versionList.length * 55)) {
|
|
51786
|
-
_context.next = 17;
|
|
51787
|
-
break;
|
|
51788
|
-
}
|
|
51789
|
-
_context.t1 = typeof _this3.getVersionList === 'function';
|
|
51790
|
-
if (!_context.t1) {
|
|
51791
|
-
_context.next = 15;
|
|
51792
|
-
break;
|
|
51793
|
-
}
|
|
51794
|
-
_context.next = 15;
|
|
51795
|
-
return _this3.getVersionList();
|
|
51796
|
-
case 15:
|
|
51797
|
-
_context.next = 10;
|
|
51798
51868
|
break;
|
|
51799
|
-
|
|
51869
|
+
}
|
|
51870
|
+
_context.next = 9;
|
|
51871
|
+
return _this3.getVersionList();
|
|
51872
|
+
case 9:
|
|
51873
|
+
if (!_this3.versionList.length) {
|
|
51800
51874
|
_context.next = 19;
|
|
51801
|
-
|
|
51802
|
-
|
|
51803
|
-
|
|
51804
|
-
|
|
51805
|
-
|
|
51806
|
-
|
|
51807
|
-
|
|
51875
|
+
break;
|
|
51876
|
+
}
|
|
51877
|
+
case 10:
|
|
51878
|
+
if (!(!_this3.finished && _this3.dialog.height - 40 > _this3.versionList.length * 55)) {
|
|
51879
|
+
_context.next = 17;
|
|
51880
|
+
break;
|
|
51881
|
+
}
|
|
51882
|
+
_context.t1 = typeof _this3.getVersionList === 'function';
|
|
51883
|
+
if (!_context.t1) {
|
|
51884
|
+
_context.next = 15;
|
|
51885
|
+
break;
|
|
51886
|
+
}
|
|
51887
|
+
_context.next = 15;
|
|
51888
|
+
return _this3.getVersionList();
|
|
51889
|
+
case 15:
|
|
51890
|
+
_context.next = 10;
|
|
51891
|
+
break;
|
|
51892
|
+
case 17:
|
|
51893
|
+
_context.next = 19;
|
|
51894
|
+
return _this3.handleItemClick(_this3.defaultActiveIndex);
|
|
51895
|
+
case 19:
|
|
51896
|
+
_this3.loading = false;
|
|
51897
|
+
case 20:
|
|
51898
|
+
case "end":
|
|
51899
|
+
return _context.stop();
|
|
51808
51900
|
}
|
|
51809
51901
|
}, _callee);
|
|
51810
51902
|
}))();
|
|
@@ -51814,39 +51906,37 @@
|
|
|
51814
51906
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() {
|
|
51815
51907
|
var el, scrollHeight, scrollTop, clientHeight;
|
|
51816
51908
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
51817
|
-
while (1) {
|
|
51818
|
-
|
|
51819
|
-
|
|
51820
|
-
|
|
51821
|
-
|
|
51822
|
-
|
|
51823
|
-
|
|
51824
|
-
|
|
51825
|
-
|
|
51826
|
-
|
|
51827
|
-
|
|
51828
|
-
|
|
51829
|
-
|
|
51830
|
-
|
|
51831
|
-
if (!_context2.t0) {
|
|
51832
|
-
_context2.next = 11;
|
|
51833
|
-
break;
|
|
51834
|
-
}
|
|
51909
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
51910
|
+
case 0:
|
|
51911
|
+
el = _this4.$refs.leftList;
|
|
51912
|
+
scrollHeight = el.scrollHeight;
|
|
51913
|
+
scrollTop = el.scrollTop;
|
|
51914
|
+
clientHeight = el.clientHeight;
|
|
51915
|
+
if (!(!_this4.finished && clientHeight + scrollTop >= scrollHeight && !_this4.scroll)) {
|
|
51916
|
+
_context2.next = 16;
|
|
51917
|
+
break;
|
|
51918
|
+
}
|
|
51919
|
+
_this4.left.scroll = true;
|
|
51920
|
+
_this4.left.loading = true;
|
|
51921
|
+
_context2.t0 = typeof _this4.getVersionList === 'function';
|
|
51922
|
+
if (!_context2.t0) {
|
|
51835
51923
|
_context2.next = 11;
|
|
51836
|
-
|
|
51837
|
-
|
|
51838
|
-
|
|
51839
|
-
|
|
51840
|
-
|
|
51841
|
-
|
|
51842
|
-
|
|
51843
|
-
|
|
51844
|
-
|
|
51845
|
-
|
|
51846
|
-
|
|
51847
|
-
|
|
51848
|
-
|
|
51849
|
-
|
|
51924
|
+
break;
|
|
51925
|
+
}
|
|
51926
|
+
_context2.next = 11;
|
|
51927
|
+
return _this4.getVersionList().catch(function (_) {
|
|
51928
|
+
return false;
|
|
51929
|
+
});
|
|
51930
|
+
case 11:
|
|
51931
|
+
_context2.next = 13;
|
|
51932
|
+
return _this4.$nextTick();
|
|
51933
|
+
case 13:
|
|
51934
|
+
el.scrollTo(0, scrollTop - 100);
|
|
51935
|
+
_this4.left.loading = false;
|
|
51936
|
+
_this4.left.scroll = false;
|
|
51937
|
+
case 16:
|
|
51938
|
+
case "end":
|
|
51939
|
+
return _context2.stop();
|
|
51850
51940
|
}
|
|
51851
51941
|
}, _callee2);
|
|
51852
51942
|
}))();
|
|
@@ -51856,27 +51946,25 @@
|
|
|
51856
51946
|
var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
51857
51947
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee3() {
|
|
51858
51948
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
51859
|
-
while (1) {
|
|
51860
|
-
|
|
51861
|
-
|
|
51862
|
-
|
|
51863
|
-
|
|
51864
|
-
|
|
51865
|
-
if (!_context3.t0) {
|
|
51866
|
-
_context3.next = 6;
|
|
51867
|
-
break;
|
|
51868
|
-
}
|
|
51949
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
51950
|
+
case 0:
|
|
51951
|
+
_this5.active = v;
|
|
51952
|
+
_this5.loading = true;
|
|
51953
|
+
_context3.t0 = typeof _this5.getVersionDetail === 'function';
|
|
51954
|
+
if (!_context3.t0) {
|
|
51869
51955
|
_context3.next = 6;
|
|
51870
|
-
|
|
51871
|
-
|
|
51872
|
-
|
|
51873
|
-
|
|
51874
|
-
|
|
51875
|
-
|
|
51876
|
-
|
|
51877
|
-
|
|
51878
|
-
|
|
51879
|
-
|
|
51956
|
+
break;
|
|
51957
|
+
}
|
|
51958
|
+
_context3.next = 6;
|
|
51959
|
+
return _this5.getVersionDetail(_this5.versionList[v]).catch(function (_) {
|
|
51960
|
+
return false;
|
|
51961
|
+
});
|
|
51962
|
+
case 6:
|
|
51963
|
+
_this5.loading = false;
|
|
51964
|
+
_this5.$emit('selected', v, _this5.versionList[v]);
|
|
51965
|
+
case 8:
|
|
51966
|
+
case "end":
|
|
51967
|
+
return _context3.stop();
|
|
51880
51968
|
}
|
|
51881
51969
|
}, _callee3);
|
|
51882
51970
|
}))();
|
|
@@ -52758,61 +52846,59 @@
|
|
|
52758
52846
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
52759
52847
|
var include, list, filter;
|
|
52760
52848
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
52761
|
-
while (1) {
|
|
52762
|
-
|
|
52763
|
-
|
|
52764
|
-
|
|
52765
|
-
|
|
52766
|
-
|
|
52767
|
-
_context.next = 16;
|
|
52768
|
-
break;
|
|
52769
|
-
}
|
|
52770
|
-
filter = text.replace(_this5.curItem[_this5.displayKey] + _this5.explainCode, '');
|
|
52771
|
-
if (!(_this5.curItem.remote && typeof _this5.remoteMethod === 'function')) {
|
|
52772
|
-
_context.next = 12;
|
|
52773
|
-
break;
|
|
52774
|
-
}
|
|
52775
|
-
_this5.menuChildInstance.loading = true;
|
|
52776
|
-
_context.next = 8;
|
|
52777
|
-
return _this5.remoteMethod(filter, _this5.curItem, _this5.menu.active).finally(function () {
|
|
52778
|
-
_this5.menuChildInstance.loading = false;
|
|
52779
|
-
});
|
|
52780
|
-
case 8:
|
|
52781
|
-
list = _context.sent;
|
|
52782
|
-
if (list && list.length) {
|
|
52783
|
-
_this5.showChildMenu(list, filter, !!list.length);
|
|
52784
|
-
} else {
|
|
52785
|
-
_this5.hidePopper();
|
|
52786
|
-
}
|
|
52787
|
-
_context.next = 14;
|
|
52849
|
+
while (1) switch (_context.prev = _context.next) {
|
|
52850
|
+
case 0:
|
|
52851
|
+
include = _this5.input.value.includes(_this5.explainCode);
|
|
52852
|
+
list = [];
|
|
52853
|
+
if (!(include && _this5.menuChildInstance)) {
|
|
52854
|
+
_context.next = 16;
|
|
52788
52855
|
break;
|
|
52789
|
-
|
|
52790
|
-
|
|
52856
|
+
}
|
|
52857
|
+
filter = text.replace(_this5.curItem[_this5.displayKey] + _this5.explainCode, '');
|
|
52858
|
+
if (!(_this5.curItem.remote && typeof _this5.remoteMethod === 'function')) {
|
|
52859
|
+
_context.next = 12;
|
|
52860
|
+
break;
|
|
52861
|
+
}
|
|
52862
|
+
_this5.menuChildInstance.loading = true;
|
|
52863
|
+
_context.next = 8;
|
|
52864
|
+
return _this5.remoteMethod(filter, _this5.curItem, _this5.menu.active).finally(function () {
|
|
52865
|
+
_this5.menuChildInstance.loading = false;
|
|
52866
|
+
});
|
|
52867
|
+
case 8:
|
|
52868
|
+
list = _context.sent;
|
|
52869
|
+
if (list && list.length) {
|
|
52870
|
+
_this5.showChildMenu(list, filter, !!list.length);
|
|
52871
|
+
} else {
|
|
52872
|
+
_this5.hidePopper();
|
|
52873
|
+
}
|
|
52874
|
+
_context.next = 14;
|
|
52875
|
+
break;
|
|
52876
|
+
case 12:
|
|
52877
|
+
list = _this5.handleFilter(filter);
|
|
52878
|
+
if (list && list.length) {
|
|
52879
|
+
_this5.showChildMenu(list, filter, !!list.length);
|
|
52880
|
+
} else {
|
|
52881
|
+
_this5.hidePopper();
|
|
52882
|
+
}
|
|
52883
|
+
case 14:
|
|
52884
|
+
_context.next = 17;
|
|
52885
|
+
break;
|
|
52886
|
+
case 16:
|
|
52887
|
+
if (!include && _this5.menuInstance) {
|
|
52888
|
+
list = _this5.handleFilter(text);
|
|
52791
52889
|
if (list && list.length) {
|
|
52792
|
-
_this5.
|
|
52890
|
+
_this5.menuInstance.filter = text;
|
|
52891
|
+
_this5.menuInstance.list = list;
|
|
52892
|
+
_this5.showPopper(_this5.menuInstance.$el);
|
|
52793
52893
|
} else {
|
|
52794
|
-
_this5.
|
|
52795
|
-
|
|
52796
|
-
case 14:
|
|
52797
|
-
_context.next = 17;
|
|
52798
|
-
break;
|
|
52799
|
-
case 16:
|
|
52800
|
-
if (!include && _this5.menuInstance) {
|
|
52801
|
-
list = _this5.handleFilter(text);
|
|
52802
|
-
if (list && list.length) {
|
|
52803
|
-
_this5.menuInstance.filter = text;
|
|
52804
|
-
_this5.menuInstance.list = list;
|
|
52805
|
-
_this5.showPopper(_this5.menuInstance.$el);
|
|
52806
|
-
} else {
|
|
52807
|
-
if (_this5.$refs.input.innerText) {
|
|
52808
|
-
_this5.hidePopper();
|
|
52809
|
-
}
|
|
52894
|
+
if (_this5.$refs.input.innerText) {
|
|
52895
|
+
_this5.hidePopper();
|
|
52810
52896
|
}
|
|
52811
52897
|
}
|
|
52812
|
-
|
|
52813
|
-
|
|
52814
|
-
|
|
52815
|
-
|
|
52898
|
+
}
|
|
52899
|
+
case 17:
|
|
52900
|
+
case "end":
|
|
52901
|
+
return _context.stop();
|
|
52816
52902
|
}
|
|
52817
52903
|
}, _callee);
|
|
52818
52904
|
}))();
|
|
@@ -52962,76 +53048,74 @@
|
|
|
52962
53048
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() {
|
|
52963
53049
|
var isChild, isRemote, list;
|
|
52964
53050
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
52965
|
-
while (1) {
|
|
52966
|
-
|
|
52967
|
-
|
|
52968
|
-
|
|
52969
|
-
|
|
52970
|
-
_context2.next = 14;
|
|
52971
|
-
break;
|
|
52972
|
-
}
|
|
52973
|
-
_this9.$refs.input.blur();
|
|
52974
|
-
if (!_this9.menuChildInstance || _this9.menuChildInstance.multiable || _this9.menuChildInstance.multiable !== _this9.curItem.multiable) {
|
|
52975
|
-
_this9.initChildMenu();
|
|
52976
|
-
}
|
|
52977
|
-
_this9.menuChildInstance.isChildCondition = isCondition;
|
|
52978
|
-
_this9.menuChildInstance.error = '';
|
|
52979
|
-
_this9.menuChildInstance.loading = false;
|
|
52980
|
-
_this9.menuChildInstance.checked = _this9.menu.checked;
|
|
52981
|
-
_this9.showPopper(_this9.menuChildInstance.$el);
|
|
52982
|
-
_this9.menu.child = false;
|
|
52983
|
-
_this9.menuChildInstance.list = item.conditions;
|
|
52984
|
-
setTimeout(function () {
|
|
52985
|
-
_this9.$refs.input.focus();
|
|
52986
|
-
}, 20);
|
|
52987
|
-
_context2.next = 37;
|
|
53051
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
53052
|
+
case 0:
|
|
53053
|
+
isChild = item.children && item.children.length;
|
|
53054
|
+
if (!isCondition) {
|
|
53055
|
+
_context2.next = 14;
|
|
52988
53056
|
break;
|
|
52989
|
-
|
|
52990
|
-
|
|
52991
|
-
|
|
52992
|
-
|
|
52993
|
-
|
|
52994
|
-
|
|
52995
|
-
|
|
52996
|
-
|
|
52997
|
-
|
|
52998
|
-
|
|
52999
|
-
|
|
53000
|
-
|
|
53001
|
-
|
|
53002
|
-
_this9.
|
|
53003
|
-
|
|
53004
|
-
|
|
53005
|
-
|
|
53006
|
-
|
|
53007
|
-
|
|
53008
|
-
|
|
53009
|
-
_context2.next =
|
|
53010
|
-
return _this9.remoteMethod(_this9.input.value, item, index).finally(function () {
|
|
53011
|
-
_this9.menuChildInstance.loading = false;
|
|
53012
|
-
});
|
|
53013
|
-
case 27:
|
|
53014
|
-
list = _context2.sent;
|
|
53015
|
-
_this9.menuChildInstance.list = list;
|
|
53016
|
-
_context2.next = 32;
|
|
53057
|
+
}
|
|
53058
|
+
_this9.$refs.input.blur();
|
|
53059
|
+
if (!_this9.menuChildInstance || _this9.menuChildInstance.multiable || _this9.menuChildInstance.multiable !== _this9.curItem.multiable) {
|
|
53060
|
+
_this9.initChildMenu();
|
|
53061
|
+
}
|
|
53062
|
+
_this9.menuChildInstance.isChildCondition = isCondition;
|
|
53063
|
+
_this9.menuChildInstance.error = '';
|
|
53064
|
+
_this9.menuChildInstance.loading = false;
|
|
53065
|
+
_this9.menuChildInstance.checked = _this9.menu.checked;
|
|
53066
|
+
_this9.showPopper(_this9.menuChildInstance.$el);
|
|
53067
|
+
_this9.menu.child = false;
|
|
53068
|
+
_this9.menuChildInstance.list = item.conditions;
|
|
53069
|
+
setTimeout(function () {
|
|
53070
|
+
_this9.$refs.input.focus();
|
|
53071
|
+
}, 20);
|
|
53072
|
+
_context2.next = 37;
|
|
53073
|
+
break;
|
|
53074
|
+
case 14:
|
|
53075
|
+
isRemote = _this9.curItem.remote && typeof _this9.remoteMethod === 'function';
|
|
53076
|
+
if (!(isChild || isRemote)) {
|
|
53077
|
+
_context2.next = 35;
|
|
53017
53078
|
break;
|
|
53018
|
-
|
|
53019
|
-
|
|
53020
|
-
|
|
53021
|
-
|
|
53022
|
-
|
|
53023
|
-
|
|
53024
|
-
|
|
53079
|
+
}
|
|
53080
|
+
_this9.$refs.input.blur();
|
|
53081
|
+
if (!_this9.menuChildInstance || _this9.menuChildInstance.multiable || _this9.menuChildInstance.multiable !== _this9.curItem.multiable) {
|
|
53082
|
+
_this9.initChildMenu();
|
|
53083
|
+
}
|
|
53084
|
+
_this9.menuChildInstance.isChildCondition = isCondition;
|
|
53085
|
+
_this9.menuChildInstance.error = '';
|
|
53086
|
+
_this9.menuChildInstance.loading = isRemote;
|
|
53087
|
+
_this9.menuChildInstance.checked = _this9.menu.checked;
|
|
53088
|
+
_this9.showPopper(_this9.menuChildInstance.$el);
|
|
53089
|
+
_this9.menu.child = true;
|
|
53090
|
+
if (!isRemote) {
|
|
53091
|
+
_context2.next = 31;
|
|
53025
53092
|
break;
|
|
53026
|
-
|
|
53027
|
-
|
|
53028
|
-
|
|
53029
|
-
|
|
53030
|
-
|
|
53031
|
-
|
|
53032
|
-
|
|
53033
|
-
|
|
53034
|
-
|
|
53093
|
+
}
|
|
53094
|
+
_context2.next = 27;
|
|
53095
|
+
return _this9.remoteMethod(_this9.input.value, item, index).finally(function () {
|
|
53096
|
+
_this9.menuChildInstance.loading = false;
|
|
53097
|
+
});
|
|
53098
|
+
case 27:
|
|
53099
|
+
list = _context2.sent;
|
|
53100
|
+
_this9.menuChildInstance.list = list;
|
|
53101
|
+
_context2.next = 32;
|
|
53102
|
+
break;
|
|
53103
|
+
case 31:
|
|
53104
|
+
_this9.menuChildInstance.list = item.children;
|
|
53105
|
+
case 32:
|
|
53106
|
+
setTimeout(function () {
|
|
53107
|
+
_this9.$refs.input.focus();
|
|
53108
|
+
}, 20);
|
|
53109
|
+
_context2.next = 37;
|
|
53110
|
+
break;
|
|
53111
|
+
case 35:
|
|
53112
|
+
_this9.hidePopper();
|
|
53113
|
+
setTimeout(function () {
|
|
53114
|
+
_this9.handleInputFocus();
|
|
53115
|
+
}, 20);
|
|
53116
|
+
case 37:
|
|
53117
|
+
case "end":
|
|
53118
|
+
return _context2.stop();
|
|
53035
53119
|
}
|
|
53036
53120
|
}, _callee2);
|
|
53037
53121
|
}))();
|
|
@@ -53166,48 +53250,46 @@
|
|
|
53166
53250
|
var needEmitKeyEnter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
53167
53251
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee3() {
|
|
53168
53252
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
53169
|
-
while (1) {
|
|
53170
|
-
|
|
53171
|
-
|
|
53172
|
-
|
|
53173
|
-
|
|
53174
|
-
|
|
53175
|
-
|
|
53176
|
-
|
|
53177
|
-
|
|
53178
|
-
|
|
53179
|
-
|
|
53253
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
53254
|
+
case 0:
|
|
53255
|
+
_context3.next = 2;
|
|
53256
|
+
return new promise$1(function (resolve) {
|
|
53257
|
+
if (!_this12.input.value) {
|
|
53258
|
+
resolve();
|
|
53259
|
+
} else if (_this12.input.value === _this12.curItem[_this12.displayKey] + _this12.explainCode) {
|
|
53260
|
+
e.preventDefault();
|
|
53261
|
+
if (!_this12.menuChildInstance) {
|
|
53262
|
+
_this12.initChildMenu();
|
|
53263
|
+
}
|
|
53264
|
+
_this12.menuChildInstance.error = _this12.defaultEmptyText;
|
|
53265
|
+
_this12.$nextTick(function (_) {
|
|
53266
|
+
_this12.showPopper(_this12.menuChildInstance.$el);
|
|
53267
|
+
});
|
|
53268
|
+
_this12.handleInputFocus();
|
|
53269
|
+
resolve();
|
|
53270
|
+
} else {
|
|
53271
|
+
e.preventDefault();
|
|
53272
|
+
setTimeout(function () {
|
|
53273
|
+
if (_this12.menu.id !== null) {
|
|
53274
|
+
var _this12$handleEnter;
|
|
53275
|
+
var val = _this12.input.value.replace(_this12.curItem[_this12.displayKey] + _this12.explainCode, '');
|
|
53276
|
+
if (keys$1(_this12.menu.childCondition).length) {
|
|
53277
|
+
val = val.replace(_this12.menu.childCondition[_this12.displayKey], '');
|
|
53278
|
+
}
|
|
53279
|
+
_this12.handleEnter(_this12.input.value, (_this12$handleEnter = {}, _defineProperty(_this12$handleEnter, _this12.primaryKey, val), _defineProperty(_this12$handleEnter, _this12.displayKey, val), _this12$handleEnter), true, needShowPopover);
|
|
53280
|
+
} else {
|
|
53281
|
+
var _this12$handleEnter2;
|
|
53282
|
+
_this12.handleEnter(_this12.input.value, (_this12$handleEnter2 = {}, _defineProperty(_this12$handleEnter2, _this12.primaryKey, _this12.input.value), _defineProperty(_this12$handleEnter2, _this12.displayKey, _this12.input.value), _this12$handleEnter2), false, needShowPopover);
|
|
53180
53283
|
}
|
|
53181
|
-
_this12.menuChildInstance.error = _this12.defaultEmptyText;
|
|
53182
|
-
_this12.$nextTick(function (_) {
|
|
53183
|
-
_this12.showPopper(_this12.menuChildInstance.$el);
|
|
53184
|
-
});
|
|
53185
|
-
_this12.handleInputFocus();
|
|
53186
53284
|
resolve();
|
|
53187
|
-
}
|
|
53188
|
-
|
|
53189
|
-
|
|
53190
|
-
|
|
53191
|
-
|
|
53192
|
-
|
|
53193
|
-
|
|
53194
|
-
|
|
53195
|
-
}
|
|
53196
|
-
_this12.handleEnter(_this12.input.value, (_this12$handleEnter = {}, _defineProperty(_this12$handleEnter, _this12.primaryKey, val), _defineProperty(_this12$handleEnter, _this12.displayKey, val), _this12$handleEnter), true, needShowPopover);
|
|
53197
|
-
} else {
|
|
53198
|
-
var _this12$handleEnter2;
|
|
53199
|
-
_this12.handleEnter(_this12.input.value, (_this12$handleEnter2 = {}, _defineProperty(_this12$handleEnter2, _this12.primaryKey, _this12.input.value), _defineProperty(_this12$handleEnter2, _this12.displayKey, _this12.input.value), _this12$handleEnter2), false, needShowPopover);
|
|
53200
|
-
}
|
|
53201
|
-
resolve();
|
|
53202
|
-
}, 10);
|
|
53203
|
-
}
|
|
53204
|
-
});
|
|
53205
|
-
case 2:
|
|
53206
|
-
needEmitKeyEnter && _this12.$emit('key-enter', e);
|
|
53207
|
-
case 3:
|
|
53208
|
-
case "end":
|
|
53209
|
-
return _context3.stop();
|
|
53210
|
-
}
|
|
53285
|
+
}, 10);
|
|
53286
|
+
}
|
|
53287
|
+
});
|
|
53288
|
+
case 2:
|
|
53289
|
+
needEmitKeyEnter && _this12.$emit('key-enter', e);
|
|
53290
|
+
case 3:
|
|
53291
|
+
case "end":
|
|
53292
|
+
return _context3.stop();
|
|
53211
53293
|
}
|
|
53212
53294
|
}, _callee3);
|
|
53213
53295
|
}))();
|
|
@@ -53217,41 +53299,39 @@
|
|
|
53217
53299
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee4() {
|
|
53218
53300
|
var validate, selection;
|
|
53219
53301
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
53220
|
-
while (1) {
|
|
53221
|
-
|
|
53222
|
-
|
|
53223
|
-
|
|
53224
|
-
|
|
53225
|
-
_context4.next = 8;
|
|
53226
|
-
break;
|
|
53227
|
-
}
|
|
53228
|
-
_context4.next = 4;
|
|
53229
|
-
return _this13.curItem.validate(_toConsumableArray(valList), _this13.curItem);
|
|
53230
|
-
case 4:
|
|
53231
|
-
validate = _context4.sent;
|
|
53232
|
-
if (typeof validate === 'string') {
|
|
53233
|
-
_this13.validateStr = validate;
|
|
53234
|
-
validate = false;
|
|
53235
|
-
} else {
|
|
53236
|
-
validate && (_this13.validateStr = '');
|
|
53237
|
-
}
|
|
53238
|
-
_context4.next = 9;
|
|
53302
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
53303
|
+
case 0:
|
|
53304
|
+
validate = true;
|
|
53305
|
+
if (!(_this13.curItem && _this13.curItem.validate && typeof _this13.curItem.validate === 'function')) {
|
|
53306
|
+
_context4.next = 8;
|
|
53239
53307
|
break;
|
|
53240
|
-
|
|
53241
|
-
|
|
53242
|
-
|
|
53243
|
-
|
|
53244
|
-
|
|
53245
|
-
|
|
53246
|
-
|
|
53247
|
-
|
|
53248
|
-
|
|
53308
|
+
}
|
|
53309
|
+
_context4.next = 4;
|
|
53310
|
+
return _this13.curItem.validate(_toConsumableArray(valList), _this13.curItem);
|
|
53311
|
+
case 4:
|
|
53312
|
+
validate = _context4.sent;
|
|
53313
|
+
if (typeof validate === 'string') {
|
|
53314
|
+
_this13.validateStr = validate;
|
|
53315
|
+
validate = false;
|
|
53316
|
+
} else {
|
|
53317
|
+
validate && (_this13.validateStr = '');
|
|
53318
|
+
}
|
|
53319
|
+
_context4.next = 9;
|
|
53320
|
+
break;
|
|
53321
|
+
case 8:
|
|
53322
|
+
_this13.validateStr = '';
|
|
53323
|
+
case 9:
|
|
53324
|
+
if (!validate) {
|
|
53325
|
+
selection = window.getSelection();
|
|
53326
|
+
if (selection.focusOffset === 0) {
|
|
53327
|
+
selection.selectAllChildren(_this13.$refs.input);
|
|
53328
|
+
selection.collapseToEnd();
|
|
53249
53329
|
}
|
|
53250
|
-
|
|
53251
|
-
|
|
53252
|
-
|
|
53253
|
-
|
|
53254
|
-
|
|
53330
|
+
}
|
|
53331
|
+
return _context4.abrupt("return", validate);
|
|
53332
|
+
case 11:
|
|
53333
|
+
case "end":
|
|
53334
|
+
return _context4.stop();
|
|
53255
53335
|
}
|
|
53256
53336
|
}, _callee4);
|
|
53257
53337
|
}))();
|
|
@@ -53263,87 +53343,85 @@
|
|
|
53263
53343
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee5() {
|
|
53264
53344
|
var values, data, validate, _validate;
|
|
53265
53345
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
53266
|
-
while (1) {
|
|
53267
|
-
|
|
53268
|
-
|
|
53269
|
-
|
|
53270
|
-
_context5.next = 19;
|
|
53271
|
-
break;
|
|
53272
|
-
}
|
|
53273
|
-
if (!(_this14.input.value === _this14.defaultCondition[_this14.displayKey])) {
|
|
53274
|
-
_context5.next = 5;
|
|
53275
|
-
break;
|
|
53276
|
-
}
|
|
53277
|
-
_this14.chip.list.push(_this14.defaultCondition);
|
|
53278
|
-
_context5.next = 17;
|
|
53346
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
53347
|
+
case 0:
|
|
53348
|
+
if (!child) {
|
|
53349
|
+
_context5.next = 19;
|
|
53279
53350
|
break;
|
|
53280
|
-
|
|
53281
|
-
|
|
53282
|
-
|
|
53283
|
-
values = values$1(_this14.menu.checked);
|
|
53284
|
-
} else {
|
|
53285
|
-
values.push(item);
|
|
53286
|
-
}
|
|
53287
|
-
data = _extends({}, _this14.curItem, {
|
|
53288
|
-
values: values
|
|
53289
|
-
});
|
|
53290
|
-
if (keys$1(_this14.menu.childCondition).length) {
|
|
53291
|
-
data['condition'] = _this14.menu.childCondition;
|
|
53292
|
-
}
|
|
53293
|
-
if (data.children) {
|
|
53294
|
-
delete data.children;
|
|
53295
|
-
}
|
|
53296
|
-
if (data.conditions) {
|
|
53297
|
-
delete data.conditions;
|
|
53298
|
-
}
|
|
53299
|
-
_context5.next = 13;
|
|
53300
|
-
return _this14.handleValidate(values);
|
|
53301
|
-
case 13:
|
|
53302
|
-
validate = _context5.sent;
|
|
53303
|
-
if (validate) {
|
|
53304
|
-
_context5.next = 16;
|
|
53305
|
-
break;
|
|
53306
|
-
}
|
|
53307
|
-
return _context5.abrupt("return");
|
|
53308
|
-
case 16:
|
|
53309
|
-
_this14.chip.list.push(data);
|
|
53310
|
-
case 17:
|
|
53311
|
-
_context5.next = 25;
|
|
53351
|
+
}
|
|
53352
|
+
if (!(_this14.input.value === _this14.defaultCondition[_this14.displayKey])) {
|
|
53353
|
+
_context5.next = 5;
|
|
53312
53354
|
break;
|
|
53313
|
-
|
|
53314
|
-
|
|
53315
|
-
|
|
53316
|
-
|
|
53317
|
-
|
|
53318
|
-
|
|
53319
|
-
|
|
53320
|
-
|
|
53321
|
-
|
|
53322
|
-
|
|
53323
|
-
|
|
53324
|
-
|
|
53325
|
-
|
|
53326
|
-
|
|
53327
|
-
|
|
53328
|
-
_this14.menu.
|
|
53329
|
-
|
|
53330
|
-
|
|
53331
|
-
|
|
53332
|
-
|
|
53333
|
-
|
|
53334
|
-
|
|
53335
|
-
|
|
53336
|
-
|
|
53337
|
-
|
|
53338
|
-
|
|
53339
|
-
|
|
53340
|
-
|
|
53341
|
-
|
|
53342
|
-
|
|
53343
|
-
|
|
53344
|
-
|
|
53345
|
-
|
|
53346
|
-
|
|
53355
|
+
}
|
|
53356
|
+
_this14.chip.list.push(_this14.defaultCondition);
|
|
53357
|
+
_context5.next = 17;
|
|
53358
|
+
break;
|
|
53359
|
+
case 5:
|
|
53360
|
+
values = [];
|
|
53361
|
+
if (keys$1(_this14.menu.checked).length) {
|
|
53362
|
+
values = values$1(_this14.menu.checked);
|
|
53363
|
+
} else {
|
|
53364
|
+
values.push(item);
|
|
53365
|
+
}
|
|
53366
|
+
data = _extends({}, _this14.curItem, {
|
|
53367
|
+
values: values
|
|
53368
|
+
});
|
|
53369
|
+
if (keys$1(_this14.menu.childCondition).length) {
|
|
53370
|
+
data['condition'] = _this14.menu.childCondition;
|
|
53371
|
+
}
|
|
53372
|
+
if (data.children) {
|
|
53373
|
+
delete data.children;
|
|
53374
|
+
}
|
|
53375
|
+
if (data.conditions) {
|
|
53376
|
+
delete data.conditions;
|
|
53377
|
+
}
|
|
53378
|
+
_context5.next = 13;
|
|
53379
|
+
return _this14.handleValidate(values);
|
|
53380
|
+
case 13:
|
|
53381
|
+
validate = _context5.sent;
|
|
53382
|
+
if (validate) {
|
|
53383
|
+
_context5.next = 16;
|
|
53384
|
+
break;
|
|
53385
|
+
}
|
|
53386
|
+
return _context5.abrupt("return");
|
|
53387
|
+
case 16:
|
|
53388
|
+
_this14.chip.list.push(data);
|
|
53389
|
+
case 17:
|
|
53390
|
+
_context5.next = 25;
|
|
53391
|
+
break;
|
|
53392
|
+
case 19:
|
|
53393
|
+
_context5.next = 21;
|
|
53394
|
+
return _this14.handleValidate([item]);
|
|
53395
|
+
case 21:
|
|
53396
|
+
_validate = _context5.sent;
|
|
53397
|
+
if (_validate) {
|
|
53398
|
+
_context5.next = 24;
|
|
53399
|
+
break;
|
|
53400
|
+
}
|
|
53401
|
+
return _context5.abrupt("return");
|
|
53402
|
+
case 24:
|
|
53403
|
+
_this14.chip.list.push(item);
|
|
53404
|
+
case 25:
|
|
53405
|
+
_this14.menu.checked = {};
|
|
53406
|
+
_this14.menu.active = -1;
|
|
53407
|
+
_this14.menu.id = null;
|
|
53408
|
+
_this14.input.value = '';
|
|
53409
|
+
_this14.menu.childCondition = {};
|
|
53410
|
+
_this14.updateInput();
|
|
53411
|
+
if (_this14.menuInstance) {
|
|
53412
|
+
_this14.menuInstance.filter = '';
|
|
53413
|
+
}
|
|
53414
|
+
if (needShowPopover) {
|
|
53415
|
+
_this14.$nextTick(function (_) {
|
|
53416
|
+
return _this14.showMenu(_this14.showPopoverTagChange);
|
|
53417
|
+
});
|
|
53418
|
+
_this14.$refs.input.focus();
|
|
53419
|
+
}
|
|
53420
|
+
_this14.$emit('change', _this14.chip.list);
|
|
53421
|
+
_this14.dispatch('bk-form-item', 'form-change');
|
|
53422
|
+
case 35:
|
|
53423
|
+
case "end":
|
|
53424
|
+
return _context5.stop();
|
|
53347
53425
|
}
|
|
53348
53426
|
}, _callee5);
|
|
53349
53427
|
}))();
|
|
@@ -53832,44 +53910,42 @@
|
|
|
53832
53910
|
this.tree.$nextTick( _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
53833
53911
|
var _yield$_this2$tree$la, _yield$_this2$tree$la2, leaf, _yield$_this2$tree$la3, data, newNodes;
|
|
53834
53912
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53835
|
-
while (1) {
|
|
53836
|
-
|
|
53837
|
-
|
|
53838
|
-
|
|
53839
|
-
_context.next = 21;
|
|
53840
|
-
break;
|
|
53841
|
-
}
|
|
53842
|
-
_this2.setState('loading', true);
|
|
53843
|
-
_this2.setState('lazy', false);
|
|
53844
|
-
_context.prev = 3;
|
|
53845
|
-
_context.next = 6;
|
|
53846
|
-
return _this2.tree.lazyMethod(_this2);
|
|
53847
|
-
case 6:
|
|
53848
|
-
_yield$_this2$tree$la = _context.sent;
|
|
53849
|
-
_yield$_this2$tree$la2 = _yield$_this2$tree$la.leaf;
|
|
53850
|
-
leaf = _yield$_this2$tree$la2 === void 0 ? [] : _yield$_this2$tree$la2;
|
|
53851
|
-
_yield$_this2$tree$la3 = _yield$_this2$tree$la.data;
|
|
53852
|
-
data = _yield$_this2$tree$la3 === void 0 ? [] : _yield$_this2$tree$la3;
|
|
53853
|
-
newNodes = _this2.tree.addNode(data, _this2.id);
|
|
53854
|
-
newNodes.forEach(function (node) {
|
|
53855
|
-
if (leaf.includes(node.id)) {
|
|
53856
|
-
node.setState('lazy', false);
|
|
53857
|
-
}
|
|
53858
|
-
});
|
|
53859
|
-
_context.next = 18;
|
|
53913
|
+
while (1) switch (_context.prev = _context.next) {
|
|
53914
|
+
case 0:
|
|
53915
|
+
if (!(expanded && _this2.lazy)) {
|
|
53916
|
+
_context.next = 21;
|
|
53860
53917
|
break;
|
|
53861
|
-
|
|
53862
|
-
|
|
53863
|
-
|
|
53864
|
-
|
|
53865
|
-
|
|
53866
|
-
|
|
53867
|
-
|
|
53868
|
-
|
|
53869
|
-
|
|
53870
|
-
|
|
53871
|
-
|
|
53872
|
-
|
|
53918
|
+
}
|
|
53919
|
+
_this2.setState('loading', true);
|
|
53920
|
+
_this2.setState('lazy', false);
|
|
53921
|
+
_context.prev = 3;
|
|
53922
|
+
_context.next = 6;
|
|
53923
|
+
return _this2.tree.lazyMethod(_this2);
|
|
53924
|
+
case 6:
|
|
53925
|
+
_yield$_this2$tree$la = _context.sent;
|
|
53926
|
+
_yield$_this2$tree$la2 = _yield$_this2$tree$la.leaf;
|
|
53927
|
+
leaf = _yield$_this2$tree$la2 === void 0 ? [] : _yield$_this2$tree$la2;
|
|
53928
|
+
_yield$_this2$tree$la3 = _yield$_this2$tree$la.data;
|
|
53929
|
+
data = _yield$_this2$tree$la3 === void 0 ? [] : _yield$_this2$tree$la3;
|
|
53930
|
+
newNodes = _this2.tree.addNode(data, _this2.id);
|
|
53931
|
+
newNodes.forEach(function (node) {
|
|
53932
|
+
if (leaf.includes(node.id)) {
|
|
53933
|
+
node.setState('lazy', false);
|
|
53934
|
+
}
|
|
53935
|
+
});
|
|
53936
|
+
_context.next = 18;
|
|
53937
|
+
break;
|
|
53938
|
+
case 15:
|
|
53939
|
+
_context.prev = 15;
|
|
53940
|
+
_context.t0 = _context["catch"](3);
|
|
53941
|
+
console.error(_context.t0);
|
|
53942
|
+
case 18:
|
|
53943
|
+
_context.prev = 18;
|
|
53944
|
+
_this2.setState('loading', false);
|
|
53945
|
+
return _context.finish(18);
|
|
53946
|
+
case 21:
|
|
53947
|
+
case "end":
|
|
53948
|
+
return _context.stop();
|
|
53873
53949
|
}
|
|
53874
53950
|
}, _callee, null, [[3, 15, 18, 21]]);
|
|
53875
53951
|
})));
|
|
@@ -54488,49 +54564,47 @@
|
|
|
54488
54564
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
54489
54565
|
var mergeOptions, node, response;
|
|
54490
54566
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
54491
|
-
while (1) {
|
|
54492
|
-
|
|
54493
|
-
|
|
54494
|
-
|
|
54495
|
-
|
|
54496
|
-
_context.next = 3;
|
|
54497
|
-
break;
|
|
54498
|
-
}
|
|
54499
|
-
return _context.abrupt("return", false);
|
|
54500
|
-
case 3:
|
|
54501
|
-
mergeOptions = _objectSpread({
|
|
54502
|
-
emitEvent: false,
|
|
54503
|
-
beforeSelect: true
|
|
54504
|
-
}, options);
|
|
54505
|
-
node = _this8.getNodeById(nodeId);
|
|
54506
|
-
if (!(mergeOptions.beforeSelect && typeof _this8.beforeSelect === 'function')) {
|
|
54507
|
-
_context.next = 11;
|
|
54508
|
-
break;
|
|
54509
|
-
}
|
|
54510
|
-
_context.next = 8;
|
|
54511
|
-
return _this8.beforeSelect(node);
|
|
54512
|
-
case 8:
|
|
54513
|
-
response = _context.sent;
|
|
54514
|
-
if (response) {
|
|
54515
|
-
_context.next = 11;
|
|
54516
|
-
break;
|
|
54517
|
-
}
|
|
54518
|
-
return _context.abrupt("return", false);
|
|
54519
|
-
case 11:
|
|
54520
|
-
_this8.selected = nodeId;
|
|
54521
|
-
if (mergeOptions.emitEvent) {
|
|
54522
|
-
_this8.$emit('select-change', node);
|
|
54523
|
-
}
|
|
54524
|
-
_context.next = 18;
|
|
54567
|
+
while (1) switch (_context.prev = _context.next) {
|
|
54568
|
+
case 0:
|
|
54569
|
+
_context.prev = 0;
|
|
54570
|
+
if (!(!_this8.selectable || nodeId === _this8.selected)) {
|
|
54571
|
+
_context.next = 3;
|
|
54525
54572
|
break;
|
|
54526
|
-
|
|
54527
|
-
|
|
54528
|
-
|
|
54529
|
-
|
|
54530
|
-
|
|
54531
|
-
|
|
54532
|
-
|
|
54533
|
-
|
|
54573
|
+
}
|
|
54574
|
+
return _context.abrupt("return", false);
|
|
54575
|
+
case 3:
|
|
54576
|
+
mergeOptions = _objectSpread({
|
|
54577
|
+
emitEvent: false,
|
|
54578
|
+
beforeSelect: true
|
|
54579
|
+
}, options);
|
|
54580
|
+
node = _this8.getNodeById(nodeId);
|
|
54581
|
+
if (!(mergeOptions.beforeSelect && typeof _this8.beforeSelect === 'function')) {
|
|
54582
|
+
_context.next = 11;
|
|
54583
|
+
break;
|
|
54584
|
+
}
|
|
54585
|
+
_context.next = 8;
|
|
54586
|
+
return _this8.beforeSelect(node);
|
|
54587
|
+
case 8:
|
|
54588
|
+
response = _context.sent;
|
|
54589
|
+
if (response) {
|
|
54590
|
+
_context.next = 11;
|
|
54591
|
+
break;
|
|
54592
|
+
}
|
|
54593
|
+
return _context.abrupt("return", false);
|
|
54594
|
+
case 11:
|
|
54595
|
+
_this8.selected = nodeId;
|
|
54596
|
+
if (mergeOptions.emitEvent) {
|
|
54597
|
+
_this8.$emit('select-change', node);
|
|
54598
|
+
}
|
|
54599
|
+
_context.next = 18;
|
|
54600
|
+
break;
|
|
54601
|
+
case 15:
|
|
54602
|
+
_context.prev = 15;
|
|
54603
|
+
_context.t0 = _context["catch"](0);
|
|
54604
|
+
console.warn(_context.t0.message);
|
|
54605
|
+
case 18:
|
|
54606
|
+
case "end":
|
|
54607
|
+
return _context.stop();
|
|
54534
54608
|
}
|
|
54535
54609
|
}, _callee, null, [[0, 15]]);
|
|
54536
54610
|
}))();
|
|
@@ -54557,57 +54631,55 @@
|
|
|
54557
54631
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() {
|
|
54558
54632
|
var isMultiple, ids, mergeOptions, nodes, response;
|
|
54559
54633
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
54560
|
-
while (1) {
|
|
54561
|
-
|
|
54562
|
-
|
|
54563
|
-
|
|
54564
|
-
|
|
54565
|
-
|
|
54566
|
-
|
|
54567
|
-
_context2.next = 14;
|
|
54568
|
-
break;
|
|
54569
|
-
}
|
|
54570
|
-
mergeOptions = _objectSpread({
|
|
54571
|
-
emitEvent: false,
|
|
54572
|
-
beforeCheck: true,
|
|
54573
|
-
checked: true
|
|
54574
|
-
}, options);
|
|
54575
|
-
nodes = ids.map(function (id) {
|
|
54576
|
-
return _this9.getNodeById(id);
|
|
54577
|
-
});
|
|
54578
|
-
if (!(mergeOptions.beforeCheck && typeof _this9.beforeCheck === 'function')) {
|
|
54579
|
-
_context2.next = 12;
|
|
54580
|
-
break;
|
|
54581
|
-
}
|
|
54582
|
-
_context2.next = 9;
|
|
54583
|
-
return _this9.beforeCheck(nodes.length > 1 ? nodes : nodes[0], mergeOptions.checked);
|
|
54584
|
-
case 9:
|
|
54585
|
-
response = _context2.sent;
|
|
54586
|
-
if (response) {
|
|
54587
|
-
_context2.next = 12;
|
|
54588
|
-
break;
|
|
54589
|
-
}
|
|
54590
|
-
return _context2.abrupt("return", false);
|
|
54591
|
-
case 12:
|
|
54592
|
-
nodes.forEach(function (node) {
|
|
54593
|
-
node.checked = mergeOptions.checked;
|
|
54594
|
-
});
|
|
54595
|
-
if (mergeOptions.emitEvent) {
|
|
54596
|
-
setTimeout(function () {
|
|
54597
|
-
_this9.$emit('check-change', _this9.checked, isMultiple ? nodes : nodes[0]);
|
|
54598
|
-
}, 0);
|
|
54599
|
-
}
|
|
54600
|
-
case 14:
|
|
54601
|
-
_context2.next = 19;
|
|
54634
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
54635
|
+
case 0:
|
|
54636
|
+
_context2.prev = 0;
|
|
54637
|
+
isMultiple = isArray$1(nodeId);
|
|
54638
|
+
ids = isMultiple ? nodeId : [nodeId];
|
|
54639
|
+
if (!ids.length) {
|
|
54640
|
+
_context2.next = 14;
|
|
54602
54641
|
break;
|
|
54603
|
-
|
|
54604
|
-
|
|
54605
|
-
|
|
54606
|
-
|
|
54607
|
-
|
|
54608
|
-
|
|
54609
|
-
|
|
54610
|
-
|
|
54642
|
+
}
|
|
54643
|
+
mergeOptions = _objectSpread({
|
|
54644
|
+
emitEvent: false,
|
|
54645
|
+
beforeCheck: true,
|
|
54646
|
+
checked: true
|
|
54647
|
+
}, options);
|
|
54648
|
+
nodes = ids.map(function (id) {
|
|
54649
|
+
return _this9.getNodeById(id);
|
|
54650
|
+
});
|
|
54651
|
+
if (!(mergeOptions.beforeCheck && typeof _this9.beforeCheck === 'function')) {
|
|
54652
|
+
_context2.next = 12;
|
|
54653
|
+
break;
|
|
54654
|
+
}
|
|
54655
|
+
_context2.next = 9;
|
|
54656
|
+
return _this9.beforeCheck(nodes.length > 1 ? nodes : nodes[0], mergeOptions.checked);
|
|
54657
|
+
case 9:
|
|
54658
|
+
response = _context2.sent;
|
|
54659
|
+
if (response) {
|
|
54660
|
+
_context2.next = 12;
|
|
54661
|
+
break;
|
|
54662
|
+
}
|
|
54663
|
+
return _context2.abrupt("return", false);
|
|
54664
|
+
case 12:
|
|
54665
|
+
nodes.forEach(function (node) {
|
|
54666
|
+
node.checked = mergeOptions.checked;
|
|
54667
|
+
});
|
|
54668
|
+
if (mergeOptions.emitEvent) {
|
|
54669
|
+
setTimeout(function () {
|
|
54670
|
+
_this9.$emit('check-change', _this9.checked, isMultiple ? nodes : nodes[0]);
|
|
54671
|
+
}, 0);
|
|
54672
|
+
}
|
|
54673
|
+
case 14:
|
|
54674
|
+
_context2.next = 19;
|
|
54675
|
+
break;
|
|
54676
|
+
case 16:
|
|
54677
|
+
_context2.prev = 16;
|
|
54678
|
+
_context2.t0 = _context2["catch"](0);
|
|
54679
|
+
console.warn(_context2.t0.message);
|
|
54680
|
+
case 19:
|
|
54681
|
+
case "end":
|
|
54682
|
+
return _context2.stop();
|
|
54611
54683
|
}
|
|
54612
54684
|
}, _callee2, null, [[0, 16]]);
|
|
54613
54685
|
}))();
|
|
@@ -55464,36 +55536,34 @@
|
|
|
55464
55536
|
return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
|
|
55465
55537
|
var canChange, id;
|
|
55466
55538
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
55467
|
-
while (1) {
|
|
55468
|
-
|
|
55469
|
-
|
|
55470
|
-
|
|
55471
|
-
|
|
55472
|
-
|
|
55473
|
-
|
|
55474
|
-
|
|
55475
|
-
|
|
55476
|
-
|
|
55477
|
-
|
|
55478
|
-
|
|
55479
|
-
|
|
55480
|
-
|
|
55481
|
-
|
|
55482
|
-
|
|
55483
|
-
|
|
55484
|
-
|
|
55485
|
-
if (id) {
|
|
55486
|
-
_this3.item = item;
|
|
55487
|
-
_this3.activeId = id;
|
|
55488
|
-
}
|
|
55489
|
-
_this3.$emit('select', _this3.activeId, _extends({}, item.$props, item.$attrs));
|
|
55490
|
-
} else if (_this3.activeId === item.id) {
|
|
55539
|
+
while (1) switch (_context.prev = _context.next) {
|
|
55540
|
+
case 0:
|
|
55541
|
+
canChange = false;
|
|
55542
|
+
_context.prev = 1;
|
|
55543
|
+
_context.next = 4;
|
|
55544
|
+
return _this3.beforeNavChange(item.id, _this3.activeId, _extends({}, item.$props, item.$attrs));
|
|
55545
|
+
case 4:
|
|
55546
|
+
canChange = _context.sent;
|
|
55547
|
+
_context.next = 10;
|
|
55548
|
+
break;
|
|
55549
|
+
case 7:
|
|
55550
|
+
_context.prev = 7;
|
|
55551
|
+
_context.t0 = _context["catch"](1);
|
|
55552
|
+
canChange = typeof _context.t0 === 'boolean' ? _context.t0 : false;
|
|
55553
|
+
case 10:
|
|
55554
|
+
if (canChange) {
|
|
55555
|
+
id = item.id;
|
|
55556
|
+
if (id) {
|
|
55491
55557
|
_this3.item = item;
|
|
55558
|
+
_this3.activeId = id;
|
|
55492
55559
|
}
|
|
55493
|
-
|
|
55494
|
-
|
|
55495
|
-
|
|
55496
|
-
|
|
55560
|
+
_this3.$emit('select', _this3.activeId, _extends({}, item.$props, item.$attrs));
|
|
55561
|
+
} else if (_this3.activeId === item.id) {
|
|
55562
|
+
_this3.item = item;
|
|
55563
|
+
}
|
|
55564
|
+
case 11:
|
|
55565
|
+
case "end":
|
|
55566
|
+
return _context.stop();
|
|
55497
55567
|
}
|
|
55498
55568
|
}, _callee, null, [[1, 7]]);
|
|
55499
55569
|
}))();
|
|
@@ -57100,7 +57170,7 @@
|
|
|
57100
57170
|
isArray$1(item) && valueList.push(item.length);
|
|
57101
57171
|
});
|
|
57102
57172
|
var value = Math.max.apply(Math, valueList);
|
|
57103
|
-
var _loop = function _loop(
|
|
57173
|
+
var _loop = function _loop() {
|
|
57104
57174
|
var checkInfo = function checkInfo(arr) {
|
|
57105
57175
|
arr.forEach(function (arrItem) {
|
|
57106
57176
|
if (arrItem.children && arrItem.children.length) {
|
|
@@ -57117,7 +57187,7 @@
|
|
|
57117
57187
|
checkInfo(_this8.cascadeList);
|
|
57118
57188
|
};
|
|
57119
57189
|
for (var i = 0; i <= value; i++) {
|
|
57120
|
-
_loop(
|
|
57190
|
+
_loop();
|
|
57121
57191
|
}
|
|
57122
57192
|
}
|
|
57123
57193
|
},
|