@weitutech/by-components 1.2.0 → 1.2.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/lib/by-components.common.js +423 -259
- package/lib/by-components.umd.js +680 -516
- package/lib/by-components.umd.min.js +1 -1
- package/package.json +1 -1
package/lib/by-components.umd.js
CHANGED
|
@@ -10695,6 +10695,262 @@ exports["default"] = function (target) {
|
|
|
10695
10695
|
|
|
10696
10696
|
/***/ }),
|
|
10697
10697
|
|
|
10698
|
+
/***/ 2050:
|
|
10699
|
+
/***/ (function(module) {
|
|
10700
|
+
|
|
10701
|
+
/**
|
|
10702
|
+
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
10703
|
+
*
|
|
10704
|
+
* @providesModule UserAgent_DEPRECATED
|
|
10705
|
+
*/
|
|
10706
|
+
|
|
10707
|
+
/**
|
|
10708
|
+
* Provides entirely client-side User Agent and OS detection. You should prefer
|
|
10709
|
+
* the non-deprecated UserAgent module when possible, which exposes our
|
|
10710
|
+
* authoritative server-side PHP-based detection to the client.
|
|
10711
|
+
*
|
|
10712
|
+
* Usage is straightforward:
|
|
10713
|
+
*
|
|
10714
|
+
* if (UserAgent_DEPRECATED.ie()) {
|
|
10715
|
+
* // IE
|
|
10716
|
+
* }
|
|
10717
|
+
*
|
|
10718
|
+
* You can also do version checks:
|
|
10719
|
+
*
|
|
10720
|
+
* if (UserAgent_DEPRECATED.ie() >= 7) {
|
|
10721
|
+
* // IE7 or better
|
|
10722
|
+
* }
|
|
10723
|
+
*
|
|
10724
|
+
* The browser functions will return NaN if the browser does not match, so
|
|
10725
|
+
* you can also do version compares the other way:
|
|
10726
|
+
*
|
|
10727
|
+
* if (UserAgent_DEPRECATED.ie() < 7) {
|
|
10728
|
+
* // IE6 or worse
|
|
10729
|
+
* }
|
|
10730
|
+
*
|
|
10731
|
+
* Note that the version is a float and may include a minor version number,
|
|
10732
|
+
* so you should always use range operators to perform comparisons, not
|
|
10733
|
+
* strict equality.
|
|
10734
|
+
*
|
|
10735
|
+
* **Note:** You should **strongly** prefer capability detection to browser
|
|
10736
|
+
* version detection where it's reasonable:
|
|
10737
|
+
*
|
|
10738
|
+
* http://www.quirksmode.org/js/support.html
|
|
10739
|
+
*
|
|
10740
|
+
* Further, we have a large number of mature wrapper functions and classes
|
|
10741
|
+
* which abstract away many browser irregularities. Check the documentation,
|
|
10742
|
+
* grep for things, or ask on javascript@lists.facebook.com before writing yet
|
|
10743
|
+
* another copy of "event || window.event".
|
|
10744
|
+
*
|
|
10745
|
+
*/
|
|
10746
|
+
|
|
10747
|
+
var _populated = false;
|
|
10748
|
+
|
|
10749
|
+
// Browsers
|
|
10750
|
+
var _ie, _firefox, _opera, _webkit, _chrome;
|
|
10751
|
+
|
|
10752
|
+
// Actual IE browser for compatibility mode
|
|
10753
|
+
var _ie_real_version;
|
|
10754
|
+
|
|
10755
|
+
// Platforms
|
|
10756
|
+
var _osx, _windows, _linux, _android;
|
|
10757
|
+
|
|
10758
|
+
// Architectures
|
|
10759
|
+
var _win64;
|
|
10760
|
+
|
|
10761
|
+
// Devices
|
|
10762
|
+
var _iphone, _ipad, _native;
|
|
10763
|
+
var _mobile;
|
|
10764
|
+
function _populate() {
|
|
10765
|
+
if (_populated) {
|
|
10766
|
+
return;
|
|
10767
|
+
}
|
|
10768
|
+
_populated = true;
|
|
10769
|
+
|
|
10770
|
+
// To work around buggy JS libraries that can't handle multi-digit
|
|
10771
|
+
// version numbers, Opera 10's user agent string claims it's Opera
|
|
10772
|
+
// 9, then later includes a Version/X.Y field:
|
|
10773
|
+
//
|
|
10774
|
+
// Opera/9.80 (foo) Presto/2.2.15 Version/10.10
|
|
10775
|
+
var uas = navigator.userAgent;
|
|
10776
|
+
var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
|
|
10777
|
+
var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
|
|
10778
|
+
_iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
|
|
10779
|
+
_ipad = /\b(iP[ao]d)/.exec(uas);
|
|
10780
|
+
_android = /Android/i.exec(uas);
|
|
10781
|
+
_native = /FBAN\/\w+;/i.exec(uas);
|
|
10782
|
+
_mobile = /Mobile/i.exec(uas);
|
|
10783
|
+
|
|
10784
|
+
// Note that the IE team blog would have you believe you should be checking
|
|
10785
|
+
// for 'Win64; x64'. But MSDN then reveals that you can actually be coming
|
|
10786
|
+
// from either x64 or ia64; so ultimately, you should just check for Win64
|
|
10787
|
+
// as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit
|
|
10788
|
+
// Windows will send 'WOW64' instead.
|
|
10789
|
+
_win64 = !!/Win64/.exec(uas);
|
|
10790
|
+
if (agent) {
|
|
10791
|
+
_ie = agent[1] ? parseFloat(agent[1]) : agent[5] ? parseFloat(agent[5]) : NaN;
|
|
10792
|
+
// IE compatibility mode
|
|
10793
|
+
if (_ie && document && document.documentMode) {
|
|
10794
|
+
_ie = document.documentMode;
|
|
10795
|
+
}
|
|
10796
|
+
// grab the "true" ie version from the trident token if available
|
|
10797
|
+
var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
|
|
10798
|
+
_ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
|
|
10799
|
+
_firefox = agent[2] ? parseFloat(agent[2]) : NaN;
|
|
10800
|
+
_opera = agent[3] ? parseFloat(agent[3]) : NaN;
|
|
10801
|
+
_webkit = agent[4] ? parseFloat(agent[4]) : NaN;
|
|
10802
|
+
if (_webkit) {
|
|
10803
|
+
// We do not add the regexp to the above test, because it will always
|
|
10804
|
+
// match 'safari' only since 'AppleWebKit' appears before 'Chrome' in
|
|
10805
|
+
// the userAgent string.
|
|
10806
|
+
agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
|
|
10807
|
+
_chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
|
|
10808
|
+
} else {
|
|
10809
|
+
_chrome = NaN;
|
|
10810
|
+
}
|
|
10811
|
+
} else {
|
|
10812
|
+
_ie = _firefox = _opera = _chrome = _webkit = NaN;
|
|
10813
|
+
}
|
|
10814
|
+
if (os) {
|
|
10815
|
+
if (os[1]) {
|
|
10816
|
+
// Detect OS X version. If no version number matches, set _osx to true.
|
|
10817
|
+
// Version examples: 10, 10_6_1, 10.7
|
|
10818
|
+
// Parses version number as a float, taking only first two sets of
|
|
10819
|
+
// digits. If only one set of digits is found, returns just the major
|
|
10820
|
+
// version number.
|
|
10821
|
+
var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
|
|
10822
|
+
_osx = ver ? parseFloat(ver[1].replace('_', '.')) : true;
|
|
10823
|
+
} else {
|
|
10824
|
+
_osx = false;
|
|
10825
|
+
}
|
|
10826
|
+
_windows = !!os[2];
|
|
10827
|
+
_linux = !!os[3];
|
|
10828
|
+
} else {
|
|
10829
|
+
_osx = _windows = _linux = false;
|
|
10830
|
+
}
|
|
10831
|
+
}
|
|
10832
|
+
var UserAgent_DEPRECATED = {
|
|
10833
|
+
/**
|
|
10834
|
+
* Check if the UA is Internet Explorer.
|
|
10835
|
+
*
|
|
10836
|
+
*
|
|
10837
|
+
* @return float|NaN Version number (if match) or NaN.
|
|
10838
|
+
*/
|
|
10839
|
+
ie: function () {
|
|
10840
|
+
return _populate() || _ie;
|
|
10841
|
+
},
|
|
10842
|
+
/**
|
|
10843
|
+
* Check if we're in Internet Explorer compatibility mode.
|
|
10844
|
+
*
|
|
10845
|
+
* @return bool true if in compatibility mode, false if
|
|
10846
|
+
* not compatibility mode or not ie
|
|
10847
|
+
*/
|
|
10848
|
+
ieCompatibilityMode: function () {
|
|
10849
|
+
return _populate() || _ie_real_version > _ie;
|
|
10850
|
+
},
|
|
10851
|
+
/**
|
|
10852
|
+
* Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we
|
|
10853
|
+
* only need this because Skype can't handle 64-bit IE yet. We need to remove
|
|
10854
|
+
* this when we don't need it -- tracked by #601957.
|
|
10855
|
+
*/
|
|
10856
|
+
ie64: function () {
|
|
10857
|
+
return UserAgent_DEPRECATED.ie() && _win64;
|
|
10858
|
+
},
|
|
10859
|
+
/**
|
|
10860
|
+
* Check if the UA is Firefox.
|
|
10861
|
+
*
|
|
10862
|
+
*
|
|
10863
|
+
* @return float|NaN Version number (if match) or NaN.
|
|
10864
|
+
*/
|
|
10865
|
+
firefox: function () {
|
|
10866
|
+
return _populate() || _firefox;
|
|
10867
|
+
},
|
|
10868
|
+
/**
|
|
10869
|
+
* Check if the UA is Opera.
|
|
10870
|
+
*
|
|
10871
|
+
*
|
|
10872
|
+
* @return float|NaN Version number (if match) or NaN.
|
|
10873
|
+
*/
|
|
10874
|
+
opera: function () {
|
|
10875
|
+
return _populate() || _opera;
|
|
10876
|
+
},
|
|
10877
|
+
/**
|
|
10878
|
+
* Check if the UA is WebKit.
|
|
10879
|
+
*
|
|
10880
|
+
*
|
|
10881
|
+
* @return float|NaN Version number (if match) or NaN.
|
|
10882
|
+
*/
|
|
10883
|
+
webkit: function () {
|
|
10884
|
+
return _populate() || _webkit;
|
|
10885
|
+
},
|
|
10886
|
+
/**
|
|
10887
|
+
* For Push
|
|
10888
|
+
* WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit
|
|
10889
|
+
*/
|
|
10890
|
+
safari: function () {
|
|
10891
|
+
return UserAgent_DEPRECATED.webkit();
|
|
10892
|
+
},
|
|
10893
|
+
/**
|
|
10894
|
+
* Check if the UA is a Chrome browser.
|
|
10895
|
+
*
|
|
10896
|
+
*
|
|
10897
|
+
* @return float|NaN Version number (if match) or NaN.
|
|
10898
|
+
*/
|
|
10899
|
+
chrome: function () {
|
|
10900
|
+
return _populate() || _chrome;
|
|
10901
|
+
},
|
|
10902
|
+
/**
|
|
10903
|
+
* Check if the user is running Windows.
|
|
10904
|
+
*
|
|
10905
|
+
* @return bool `true' if the user's OS is Windows.
|
|
10906
|
+
*/
|
|
10907
|
+
windows: function () {
|
|
10908
|
+
return _populate() || _windows;
|
|
10909
|
+
},
|
|
10910
|
+
/**
|
|
10911
|
+
* Check if the user is running Mac OS X.
|
|
10912
|
+
*
|
|
10913
|
+
* @return float|bool Returns a float if a version number is detected,
|
|
10914
|
+
* otherwise true/false.
|
|
10915
|
+
*/
|
|
10916
|
+
osx: function () {
|
|
10917
|
+
return _populate() || _osx;
|
|
10918
|
+
},
|
|
10919
|
+
/**
|
|
10920
|
+
* Check if the user is running Linux.
|
|
10921
|
+
*
|
|
10922
|
+
* @return bool `true' if the user's OS is some flavor of Linux.
|
|
10923
|
+
*/
|
|
10924
|
+
linux: function () {
|
|
10925
|
+
return _populate() || _linux;
|
|
10926
|
+
},
|
|
10927
|
+
/**
|
|
10928
|
+
* Check if the user is running on an iPhone or iPod platform.
|
|
10929
|
+
*
|
|
10930
|
+
* @return bool `true' if the user is running some flavor of the
|
|
10931
|
+
* iPhone OS.
|
|
10932
|
+
*/
|
|
10933
|
+
iphone: function () {
|
|
10934
|
+
return _populate() || _iphone;
|
|
10935
|
+
},
|
|
10936
|
+
mobile: function () {
|
|
10937
|
+
return _populate() || _iphone || _ipad || _android || _mobile;
|
|
10938
|
+
},
|
|
10939
|
+
nativeApp: function () {
|
|
10940
|
+
// webviews inside of the native apps
|
|
10941
|
+
return _populate() || _native;
|
|
10942
|
+
},
|
|
10943
|
+
android: function () {
|
|
10944
|
+
return _populate() || _android;
|
|
10945
|
+
},
|
|
10946
|
+
ipad: function () {
|
|
10947
|
+
return _populate() || _ipad;
|
|
10948
|
+
}
|
|
10949
|
+
};
|
|
10950
|
+
module.exports = UserAgent_DEPRECATED;
|
|
10951
|
+
|
|
10952
|
+
/***/ }),
|
|
10953
|
+
|
|
10698
10954
|
/***/ 2063:
|
|
10699
10955
|
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
10700
10956
|
|
|
@@ -55322,7 +55578,7 @@ module.exports = true;
|
|
|
55322
55578
|
|
|
55323
55579
|
|
|
55324
55580
|
|
|
55325
|
-
var UserAgent_DEPRECATED = __webpack_require__(
|
|
55581
|
+
var UserAgent_DEPRECATED = __webpack_require__(2050);
|
|
55326
55582
|
var isEventSupported = __webpack_require__(4544);
|
|
55327
55583
|
|
|
55328
55584
|
// Reasonable defaults
|
|
@@ -71380,262 +71636,6 @@ __webpack_require__(1806);
|
|
|
71380
71636
|
|
|
71381
71637
|
/***/ }),
|
|
71382
71638
|
|
|
71383
|
-
/***/ 9669:
|
|
71384
|
-
/***/ (function(module) {
|
|
71385
|
-
|
|
71386
|
-
/**
|
|
71387
|
-
* Copyright 2004-present Facebook. All Rights Reserved.
|
|
71388
|
-
*
|
|
71389
|
-
* @providesModule UserAgent_DEPRECATED
|
|
71390
|
-
*/
|
|
71391
|
-
|
|
71392
|
-
/**
|
|
71393
|
-
* Provides entirely client-side User Agent and OS detection. You should prefer
|
|
71394
|
-
* the non-deprecated UserAgent module when possible, which exposes our
|
|
71395
|
-
* authoritative server-side PHP-based detection to the client.
|
|
71396
|
-
*
|
|
71397
|
-
* Usage is straightforward:
|
|
71398
|
-
*
|
|
71399
|
-
* if (UserAgent_DEPRECATED.ie()) {
|
|
71400
|
-
* // IE
|
|
71401
|
-
* }
|
|
71402
|
-
*
|
|
71403
|
-
* You can also do version checks:
|
|
71404
|
-
*
|
|
71405
|
-
* if (UserAgent_DEPRECATED.ie() >= 7) {
|
|
71406
|
-
* // IE7 or better
|
|
71407
|
-
* }
|
|
71408
|
-
*
|
|
71409
|
-
* The browser functions will return NaN if the browser does not match, so
|
|
71410
|
-
* you can also do version compares the other way:
|
|
71411
|
-
*
|
|
71412
|
-
* if (UserAgent_DEPRECATED.ie() < 7) {
|
|
71413
|
-
* // IE6 or worse
|
|
71414
|
-
* }
|
|
71415
|
-
*
|
|
71416
|
-
* Note that the version is a float and may include a minor version number,
|
|
71417
|
-
* so you should always use range operators to perform comparisons, not
|
|
71418
|
-
* strict equality.
|
|
71419
|
-
*
|
|
71420
|
-
* **Note:** You should **strongly** prefer capability detection to browser
|
|
71421
|
-
* version detection where it's reasonable:
|
|
71422
|
-
*
|
|
71423
|
-
* http://www.quirksmode.org/js/support.html
|
|
71424
|
-
*
|
|
71425
|
-
* Further, we have a large number of mature wrapper functions and classes
|
|
71426
|
-
* which abstract away many browser irregularities. Check the documentation,
|
|
71427
|
-
* grep for things, or ask on javascript@lists.facebook.com before writing yet
|
|
71428
|
-
* another copy of "event || window.event".
|
|
71429
|
-
*
|
|
71430
|
-
*/
|
|
71431
|
-
|
|
71432
|
-
var _populated = false;
|
|
71433
|
-
|
|
71434
|
-
// Browsers
|
|
71435
|
-
var _ie, _firefox, _opera, _webkit, _chrome;
|
|
71436
|
-
|
|
71437
|
-
// Actual IE browser for compatibility mode
|
|
71438
|
-
var _ie_real_version;
|
|
71439
|
-
|
|
71440
|
-
// Platforms
|
|
71441
|
-
var _osx, _windows, _linux, _android;
|
|
71442
|
-
|
|
71443
|
-
// Architectures
|
|
71444
|
-
var _win64;
|
|
71445
|
-
|
|
71446
|
-
// Devices
|
|
71447
|
-
var _iphone, _ipad, _native;
|
|
71448
|
-
var _mobile;
|
|
71449
|
-
function _populate() {
|
|
71450
|
-
if (_populated) {
|
|
71451
|
-
return;
|
|
71452
|
-
}
|
|
71453
|
-
_populated = true;
|
|
71454
|
-
|
|
71455
|
-
// To work around buggy JS libraries that can't handle multi-digit
|
|
71456
|
-
// version numbers, Opera 10's user agent string claims it's Opera
|
|
71457
|
-
// 9, then later includes a Version/X.Y field:
|
|
71458
|
-
//
|
|
71459
|
-
// Opera/9.80 (foo) Presto/2.2.15 Version/10.10
|
|
71460
|
-
var uas = navigator.userAgent;
|
|
71461
|
-
var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
|
|
71462
|
-
var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
|
|
71463
|
-
_iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
|
|
71464
|
-
_ipad = /\b(iP[ao]d)/.exec(uas);
|
|
71465
|
-
_android = /Android/i.exec(uas);
|
|
71466
|
-
_native = /FBAN\/\w+;/i.exec(uas);
|
|
71467
|
-
_mobile = /Mobile/i.exec(uas);
|
|
71468
|
-
|
|
71469
|
-
// Note that the IE team blog would have you believe you should be checking
|
|
71470
|
-
// for 'Win64; x64'. But MSDN then reveals that you can actually be coming
|
|
71471
|
-
// from either x64 or ia64; so ultimately, you should just check for Win64
|
|
71472
|
-
// as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit
|
|
71473
|
-
// Windows will send 'WOW64' instead.
|
|
71474
|
-
_win64 = !!/Win64/.exec(uas);
|
|
71475
|
-
if (agent) {
|
|
71476
|
-
_ie = agent[1] ? parseFloat(agent[1]) : agent[5] ? parseFloat(agent[5]) : NaN;
|
|
71477
|
-
// IE compatibility mode
|
|
71478
|
-
if (_ie && document && document.documentMode) {
|
|
71479
|
-
_ie = document.documentMode;
|
|
71480
|
-
}
|
|
71481
|
-
// grab the "true" ie version from the trident token if available
|
|
71482
|
-
var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
|
|
71483
|
-
_ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
|
|
71484
|
-
_firefox = agent[2] ? parseFloat(agent[2]) : NaN;
|
|
71485
|
-
_opera = agent[3] ? parseFloat(agent[3]) : NaN;
|
|
71486
|
-
_webkit = agent[4] ? parseFloat(agent[4]) : NaN;
|
|
71487
|
-
if (_webkit) {
|
|
71488
|
-
// We do not add the regexp to the above test, because it will always
|
|
71489
|
-
// match 'safari' only since 'AppleWebKit' appears before 'Chrome' in
|
|
71490
|
-
// the userAgent string.
|
|
71491
|
-
agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
|
|
71492
|
-
_chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
|
|
71493
|
-
} else {
|
|
71494
|
-
_chrome = NaN;
|
|
71495
|
-
}
|
|
71496
|
-
} else {
|
|
71497
|
-
_ie = _firefox = _opera = _chrome = _webkit = NaN;
|
|
71498
|
-
}
|
|
71499
|
-
if (os) {
|
|
71500
|
-
if (os[1]) {
|
|
71501
|
-
// Detect OS X version. If no version number matches, set _osx to true.
|
|
71502
|
-
// Version examples: 10, 10_6_1, 10.7
|
|
71503
|
-
// Parses version number as a float, taking only first two sets of
|
|
71504
|
-
// digits. If only one set of digits is found, returns just the major
|
|
71505
|
-
// version number.
|
|
71506
|
-
var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
|
|
71507
|
-
_osx = ver ? parseFloat(ver[1].replace('_', '.')) : true;
|
|
71508
|
-
} else {
|
|
71509
|
-
_osx = false;
|
|
71510
|
-
}
|
|
71511
|
-
_windows = !!os[2];
|
|
71512
|
-
_linux = !!os[3];
|
|
71513
|
-
} else {
|
|
71514
|
-
_osx = _windows = _linux = false;
|
|
71515
|
-
}
|
|
71516
|
-
}
|
|
71517
|
-
var UserAgent_DEPRECATED = {
|
|
71518
|
-
/**
|
|
71519
|
-
* Check if the UA is Internet Explorer.
|
|
71520
|
-
*
|
|
71521
|
-
*
|
|
71522
|
-
* @return float|NaN Version number (if match) or NaN.
|
|
71523
|
-
*/
|
|
71524
|
-
ie: function () {
|
|
71525
|
-
return _populate() || _ie;
|
|
71526
|
-
},
|
|
71527
|
-
/**
|
|
71528
|
-
* Check if we're in Internet Explorer compatibility mode.
|
|
71529
|
-
*
|
|
71530
|
-
* @return bool true if in compatibility mode, false if
|
|
71531
|
-
* not compatibility mode or not ie
|
|
71532
|
-
*/
|
|
71533
|
-
ieCompatibilityMode: function () {
|
|
71534
|
-
return _populate() || _ie_real_version > _ie;
|
|
71535
|
-
},
|
|
71536
|
-
/**
|
|
71537
|
-
* Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we
|
|
71538
|
-
* only need this because Skype can't handle 64-bit IE yet. We need to remove
|
|
71539
|
-
* this when we don't need it -- tracked by #601957.
|
|
71540
|
-
*/
|
|
71541
|
-
ie64: function () {
|
|
71542
|
-
return UserAgent_DEPRECATED.ie() && _win64;
|
|
71543
|
-
},
|
|
71544
|
-
/**
|
|
71545
|
-
* Check if the UA is Firefox.
|
|
71546
|
-
*
|
|
71547
|
-
*
|
|
71548
|
-
* @return float|NaN Version number (if match) or NaN.
|
|
71549
|
-
*/
|
|
71550
|
-
firefox: function () {
|
|
71551
|
-
return _populate() || _firefox;
|
|
71552
|
-
},
|
|
71553
|
-
/**
|
|
71554
|
-
* Check if the UA is Opera.
|
|
71555
|
-
*
|
|
71556
|
-
*
|
|
71557
|
-
* @return float|NaN Version number (if match) or NaN.
|
|
71558
|
-
*/
|
|
71559
|
-
opera: function () {
|
|
71560
|
-
return _populate() || _opera;
|
|
71561
|
-
},
|
|
71562
|
-
/**
|
|
71563
|
-
* Check if the UA is WebKit.
|
|
71564
|
-
*
|
|
71565
|
-
*
|
|
71566
|
-
* @return float|NaN Version number (if match) or NaN.
|
|
71567
|
-
*/
|
|
71568
|
-
webkit: function () {
|
|
71569
|
-
return _populate() || _webkit;
|
|
71570
|
-
},
|
|
71571
|
-
/**
|
|
71572
|
-
* For Push
|
|
71573
|
-
* WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit
|
|
71574
|
-
*/
|
|
71575
|
-
safari: function () {
|
|
71576
|
-
return UserAgent_DEPRECATED.webkit();
|
|
71577
|
-
},
|
|
71578
|
-
/**
|
|
71579
|
-
* Check if the UA is a Chrome browser.
|
|
71580
|
-
*
|
|
71581
|
-
*
|
|
71582
|
-
* @return float|NaN Version number (if match) or NaN.
|
|
71583
|
-
*/
|
|
71584
|
-
chrome: function () {
|
|
71585
|
-
return _populate() || _chrome;
|
|
71586
|
-
},
|
|
71587
|
-
/**
|
|
71588
|
-
* Check if the user is running Windows.
|
|
71589
|
-
*
|
|
71590
|
-
* @return bool `true' if the user's OS is Windows.
|
|
71591
|
-
*/
|
|
71592
|
-
windows: function () {
|
|
71593
|
-
return _populate() || _windows;
|
|
71594
|
-
},
|
|
71595
|
-
/**
|
|
71596
|
-
* Check if the user is running Mac OS X.
|
|
71597
|
-
*
|
|
71598
|
-
* @return float|bool Returns a float if a version number is detected,
|
|
71599
|
-
* otherwise true/false.
|
|
71600
|
-
*/
|
|
71601
|
-
osx: function () {
|
|
71602
|
-
return _populate() || _osx;
|
|
71603
|
-
},
|
|
71604
|
-
/**
|
|
71605
|
-
* Check if the user is running Linux.
|
|
71606
|
-
*
|
|
71607
|
-
* @return bool `true' if the user's OS is some flavor of Linux.
|
|
71608
|
-
*/
|
|
71609
|
-
linux: function () {
|
|
71610
|
-
return _populate() || _linux;
|
|
71611
|
-
},
|
|
71612
|
-
/**
|
|
71613
|
-
* Check if the user is running on an iPhone or iPod platform.
|
|
71614
|
-
*
|
|
71615
|
-
* @return bool `true' if the user is running some flavor of the
|
|
71616
|
-
* iPhone OS.
|
|
71617
|
-
*/
|
|
71618
|
-
iphone: function () {
|
|
71619
|
-
return _populate() || _iphone;
|
|
71620
|
-
},
|
|
71621
|
-
mobile: function () {
|
|
71622
|
-
return _populate() || _iphone || _ipad || _android || _mobile;
|
|
71623
|
-
},
|
|
71624
|
-
nativeApp: function () {
|
|
71625
|
-
// webviews inside of the native apps
|
|
71626
|
-
return _populate() || _native;
|
|
71627
|
-
},
|
|
71628
|
-
android: function () {
|
|
71629
|
-
return _populate() || _android;
|
|
71630
|
-
},
|
|
71631
|
-
ipad: function () {
|
|
71632
|
-
return _populate() || _ipad;
|
|
71633
|
-
}
|
|
71634
|
-
};
|
|
71635
|
-
module.exports = UserAgent_DEPRECATED;
|
|
71636
|
-
|
|
71637
|
-
/***/ }),
|
|
71638
|
-
|
|
71639
71639
|
/***/ 9720:
|
|
71640
71640
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
71641
71641
|
|
|
@@ -96025,8 +96025,8 @@ var ByCascaderPanel_component = normalizeComponent(
|
|
|
96025
96025
|
)
|
|
96026
96026
|
|
|
96027
96027
|
/* harmony default export */ var ByCascaderPanel = (ByCascaderPanel_component.exports);
|
|
96028
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/cascader-panel-pro/ByCascaderPanelPro.vue?vue&type=template&id=
|
|
96029
|
-
var
|
|
96028
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/cascader-panel-pro/ByCascaderPanelPro.vue?vue&type=template&id=37aef47d
|
|
96029
|
+
var ByCascaderPanelProvue_type_template_id_37aef47d_render = function render() {
|
|
96030
96030
|
var _vm = this,
|
|
96031
96031
|
_c = _vm._self._c;
|
|
96032
96032
|
return _c('div', {
|
|
@@ -96164,7 +96164,8 @@ var ByCascaderPanelProvue_type_template_id_4bdb9820_render = function render() {
|
|
|
96164
96164
|
},
|
|
96165
96165
|
on: {
|
|
96166
96166
|
"input": _vm.onMainPanelInput,
|
|
96167
|
-
"change": _vm.handleValueChange
|
|
96167
|
+
"change": _vm.handleValueChange,
|
|
96168
|
+
"store-ready": _vm.schedulePanelSyncFromExternalValue
|
|
96168
96169
|
}
|
|
96169
96170
|
}) : _vm._e(), _vm.searchOptions.length > 0 ? _c('VirtualCascaderPanel', {
|
|
96170
96171
|
directives: [{
|
|
@@ -96267,8 +96268,215 @@ var ByCascaderPanelProvue_type_template_id_4bdb9820_render = function render() {
|
|
|
96267
96268
|
staticClass: "empty-state"
|
|
96268
96269
|
}, [_vm._v("暂无选中项")])], 1)])])])]);
|
|
96269
96270
|
};
|
|
96270
|
-
var
|
|
96271
|
+
var ByCascaderPanelProvue_type_template_id_37aef47d_staticRenderFns = [];
|
|
96272
|
+
|
|
96273
|
+
;// ./src/components/cascader-panel-pro/cascaderStorePro.js
|
|
96274
|
+
|
|
96271
96275
|
|
|
96276
|
+
|
|
96277
|
+
|
|
96278
|
+
|
|
96279
|
+
|
|
96280
|
+
/**
|
|
96281
|
+
* 级联树扁平化存储,初始化时预计算子树叶子元数据,供 O(1) 级勾选/聚合
|
|
96282
|
+
*/
|
|
96283
|
+
|
|
96284
|
+
let nodeIdSeed = 0;
|
|
96285
|
+
function nextId() {
|
|
96286
|
+
nodeIdSeed += 1;
|
|
96287
|
+
return nodeIdSeed;
|
|
96288
|
+
}
|
|
96289
|
+
function resetCascaderStoreIdSeed() {
|
|
96290
|
+
nodeIdSeed = 0;
|
|
96291
|
+
}
|
|
96292
|
+
|
|
96293
|
+
/**
|
|
96294
|
+
* @param {Array} options
|
|
96295
|
+
* @param {Object} config - disabledField/disabledValue/disabledCheck
|
|
96296
|
+
* @param {Object} cascaderProps
|
|
96297
|
+
* @param {Object} utils - CascaderUtilsPro
|
|
96298
|
+
*/
|
|
96299
|
+
function buildCascaderStore(options, config, cascaderProps, utils) {
|
|
96300
|
+
resetCascaderStoreIdSeed();
|
|
96301
|
+
const valueKey = cascaderProps.value || 'value';
|
|
96302
|
+
const labelKey = cascaderProps.label || 'label';
|
|
96303
|
+
const childrenKey = cascaderProps.children || 'children';
|
|
96304
|
+
const disabledKey = cascaderProps.disabled || 'disabled';
|
|
96305
|
+
const nodes = [];
|
|
96306
|
+
const nodeById = new Map();
|
|
96307
|
+
const nodeByValue = new Map();
|
|
96308
|
+
const childrenByParentId = new Map();
|
|
96309
|
+
const rootIds = [];
|
|
96310
|
+
const pathByLeafValue = new Map();
|
|
96311
|
+
const allLeafValues = [];
|
|
96312
|
+
const allLeafPaths = [];
|
|
96313
|
+
const createNode = (raw, parentPath, level, parentId) => {
|
|
96314
|
+
const value = raw[valueKey];
|
|
96315
|
+
const children = raw[childrenKey];
|
|
96316
|
+
const hasChildren = Array.isArray(children) && children.length > 0;
|
|
96317
|
+
const id = nextId();
|
|
96318
|
+
const nodePath = parentId == null ? [value] : parentPath.concat(value);
|
|
96319
|
+
const node = {
|
|
96320
|
+
id,
|
|
96321
|
+
value,
|
|
96322
|
+
label: raw[labelKey],
|
|
96323
|
+
path: nodePath,
|
|
96324
|
+
level,
|
|
96325
|
+
parentId,
|
|
96326
|
+
childIds: [],
|
|
96327
|
+
isLeaf: !hasChildren,
|
|
96328
|
+
disabled: !!raw[disabledKey],
|
|
96329
|
+
raw,
|
|
96330
|
+
descendantLeafValues: [],
|
|
96331
|
+
descendantLeafCount: 0,
|
|
96332
|
+
descendantPaths: []
|
|
96333
|
+
};
|
|
96334
|
+
nodes.push(node);
|
|
96335
|
+
nodeById.set(id, node);
|
|
96336
|
+
if (!nodeByValue.has(value)) {
|
|
96337
|
+
nodeByValue.set(value, node);
|
|
96338
|
+
}
|
|
96339
|
+
if (parentId == null) {
|
|
96340
|
+
rootIds.push(id);
|
|
96341
|
+
} else {
|
|
96342
|
+
const siblings = childrenByParentId.get(parentId) || [];
|
|
96343
|
+
siblings.push(id);
|
|
96344
|
+
childrenByParentId.set(parentId, siblings);
|
|
96345
|
+
const parent = nodeById.get(parentId);
|
|
96346
|
+
if (parent) {
|
|
96347
|
+
parent.childIds.push(id);
|
|
96348
|
+
}
|
|
96349
|
+
}
|
|
96350
|
+
if (hasChildren) {
|
|
96351
|
+
children.forEach(child => {
|
|
96352
|
+
createNode(child, nodePath, level + 1, id);
|
|
96353
|
+
});
|
|
96354
|
+
} else {
|
|
96355
|
+
pathByLeafValue.set(value, nodePath);
|
|
96356
|
+
if (!node.disabled) {
|
|
96357
|
+
allLeafValues.push(value);
|
|
96358
|
+
allLeafPaths.push(nodePath);
|
|
96359
|
+
}
|
|
96360
|
+
}
|
|
96361
|
+
return node;
|
|
96362
|
+
};
|
|
96363
|
+
const walkRoots = (items, ancestorDisabled = false) => {
|
|
96364
|
+
items.forEach(item => {
|
|
96365
|
+
const isDisabled = ancestorDisabled || utils.isItemDisabled(item, config);
|
|
96366
|
+
const cloned = {
|
|
96367
|
+
...item
|
|
96368
|
+
};
|
|
96369
|
+
if (isDisabled) {
|
|
96370
|
+
cloned[disabledKey] = true;
|
|
96371
|
+
}
|
|
96372
|
+
createNode(cloned, [], 0, null);
|
|
96373
|
+
});
|
|
96374
|
+
};
|
|
96375
|
+
walkRoots(options || []);
|
|
96376
|
+
|
|
96377
|
+
// 自底向上汇总子树叶子
|
|
96378
|
+
const sorted = nodes.slice().sort((a, b) => b.level - a.level);
|
|
96379
|
+
sorted.forEach(node => {
|
|
96380
|
+
if (node.isLeaf) {
|
|
96381
|
+
node.descendantLeafValues = [node.value];
|
|
96382
|
+
node.descendantLeafCount = 1;
|
|
96383
|
+
node.descendantPaths = [node.path];
|
|
96384
|
+
return;
|
|
96385
|
+
}
|
|
96386
|
+
const leafValues = [];
|
|
96387
|
+
const leafPaths = [];
|
|
96388
|
+
node.childIds.forEach(childId => {
|
|
96389
|
+
const child = nodeById.get(childId);
|
|
96390
|
+
if (!child || child.descendantLeafCount === 0) {
|
|
96391
|
+
return;
|
|
96392
|
+
}
|
|
96393
|
+
leafValues.push(...child.descendantLeafValues);
|
|
96394
|
+
leafPaths.push(...child.descendantPaths);
|
|
96395
|
+
});
|
|
96396
|
+
node.descendantLeafValues = leafValues;
|
|
96397
|
+
node.descendantLeafCount = leafValues.length;
|
|
96398
|
+
node.descendantPaths = leafPaths;
|
|
96399
|
+
});
|
|
96400
|
+
return {
|
|
96401
|
+
nodes,
|
|
96402
|
+
nodeById,
|
|
96403
|
+
nodeByValue,
|
|
96404
|
+
childrenByParentId,
|
|
96405
|
+
rootIds,
|
|
96406
|
+
pathByLeafValue,
|
|
96407
|
+
allLeafValues,
|
|
96408
|
+
allLeafPaths,
|
|
96409
|
+
totalLeafCount: allLeafPaths.length
|
|
96410
|
+
};
|
|
96411
|
+
}
|
|
96412
|
+
function getStoreChildren(store, parentId) {
|
|
96413
|
+
if (parentId == null) {
|
|
96414
|
+
return store.rootIds.map(id => store.nodeById.get(id)).filter(Boolean);
|
|
96415
|
+
}
|
|
96416
|
+
const childIds = store.childrenByParentId.get(parentId) || [];
|
|
96417
|
+
return childIds.map(id => store.nodeById.get(id)).filter(Boolean);
|
|
96418
|
+
}
|
|
96419
|
+
function resolveStoreNodeByValue(store, value) {
|
|
96420
|
+
if (!store || value == null || value === '') {
|
|
96421
|
+
return null;
|
|
96422
|
+
}
|
|
96423
|
+
if (store.nodeByValue.has(value)) {
|
|
96424
|
+
return store.nodeByValue.get(value);
|
|
96425
|
+
}
|
|
96426
|
+
const num = Number(value);
|
|
96427
|
+
if (!Number.isNaN(num) && store.nodeByValue.has(num)) {
|
|
96428
|
+
return store.nodeByValue.get(num);
|
|
96429
|
+
}
|
|
96430
|
+
const str = String(value);
|
|
96431
|
+
if (str !== value && store.nodeByValue.has(str)) {
|
|
96432
|
+
return store.nodeByValue.get(str);
|
|
96433
|
+
}
|
|
96434
|
+
for (const [key, node] of store.nodeByValue) {
|
|
96435
|
+
if (key == value) {
|
|
96436
|
+
return node;
|
|
96437
|
+
}
|
|
96438
|
+
}
|
|
96439
|
+
return null;
|
|
96440
|
+
}
|
|
96441
|
+
function getStoreLeafPath(store, leafValue) {
|
|
96442
|
+
if (!store || leafValue == null || leafValue === '') {
|
|
96443
|
+
return null;
|
|
96444
|
+
}
|
|
96445
|
+
if (store.pathByLeafValue.has(leafValue)) {
|
|
96446
|
+
return store.pathByLeafValue.get(leafValue);
|
|
96447
|
+
}
|
|
96448
|
+
const node = resolveStoreNodeByValue(store, leafValue);
|
|
96449
|
+
if (node && node.isLeaf) {
|
|
96450
|
+
return node.path;
|
|
96451
|
+
}
|
|
96452
|
+
for (const [key, path] of store.pathByLeafValue) {
|
|
96453
|
+
if (key == leafValue) {
|
|
96454
|
+
return path;
|
|
96455
|
+
}
|
|
96456
|
+
}
|
|
96457
|
+
return null;
|
|
96458
|
+
}
|
|
96459
|
+
function storeHasLeafValue(store, leafValue) {
|
|
96460
|
+
return getStoreLeafPath(store, leafValue) != null;
|
|
96461
|
+
}
|
|
96462
|
+
function findStoreNodeByPath(store, pathValues) {
|
|
96463
|
+
if (!pathValues || pathValues.length === 0) {
|
|
96464
|
+
return null;
|
|
96465
|
+
}
|
|
96466
|
+
let node = resolveStoreNodeByValue(store, pathValues[0]);
|
|
96467
|
+
if (!node || pathValues.length === 1) {
|
|
96468
|
+
return node;
|
|
96469
|
+
}
|
|
96470
|
+
for (let i = 1; i < pathValues.length; i++) {
|
|
96471
|
+
const target = pathValues[i];
|
|
96472
|
+
const children = getStoreChildren(store, node.id);
|
|
96473
|
+
node = children.find(child => child.value == target) || null;
|
|
96474
|
+
if (!node) {
|
|
96475
|
+
return null;
|
|
96476
|
+
}
|
|
96477
|
+
}
|
|
96478
|
+
return node;
|
|
96479
|
+
}
|
|
96272
96480
|
;// ./src/components/cascader-panel-pro/cascaderUtilsPro.js
|
|
96273
96481
|
|
|
96274
96482
|
|
|
@@ -96288,6 +96496,7 @@ var ByCascaderPanelProvue_type_template_id_4bdb9820_staticRenderFns = [];
|
|
|
96288
96496
|
/**
|
|
96289
96497
|
* 级联选择器工具类(Pro 版,独立于 CascaderUtils)
|
|
96290
96498
|
*/
|
|
96499
|
+
|
|
96291
96500
|
class CascaderUtilsPro {
|
|
96292
96501
|
/**
|
|
96293
96502
|
* 估算级联节点标签文本宽度(px)
|
|
@@ -96630,14 +96839,14 @@ class CascaderUtilsPro {
|
|
|
96630
96839
|
}
|
|
96631
96840
|
const items = [];
|
|
96632
96841
|
selection.selectedLeafSet.forEach(leafValue => {
|
|
96633
|
-
const path = store
|
|
96634
|
-
const node = store
|
|
96842
|
+
const path = getStoreLeafPath(store, leafValue);
|
|
96843
|
+
const node = resolveStoreNodeByValue(store, leafValue);
|
|
96635
96844
|
if (!path || !node) {
|
|
96636
96845
|
return;
|
|
96637
96846
|
}
|
|
96638
96847
|
items.push({
|
|
96639
96848
|
...node.raw,
|
|
96640
|
-
value:
|
|
96849
|
+
value: node.value,
|
|
96641
96850
|
label: node.label,
|
|
96642
96851
|
path
|
|
96643
96852
|
});
|
|
@@ -96761,7 +96970,7 @@ class CascaderUtilsPro {
|
|
|
96761
96970
|
const items = [];
|
|
96762
96971
|
const walk = nodeId => {
|
|
96763
96972
|
const node = store.nodeById.get(nodeId);
|
|
96764
|
-
if (!node
|
|
96973
|
+
if (!node) {
|
|
96765
96974
|
return;
|
|
96766
96975
|
}
|
|
96767
96976
|
const state = selection.getCheckState(nodeId);
|
|
@@ -97009,7 +97218,7 @@ class CascaderUtilsPro {
|
|
|
97009
97218
|
const findPath = (nodes, targetValues, currentPath = []) => {
|
|
97010
97219
|
for (const option of nodes) {
|
|
97011
97220
|
const newPath = [...currentPath, option[cascaderProps.value]];
|
|
97012
|
-
if (targetValues.
|
|
97221
|
+
if (targetValues.some(target => target == option[cascaderProps.value])) {
|
|
97013
97222
|
// 如果是叶子节点(没有children属性),添加到路径中
|
|
97014
97223
|
if (!option[cascaderProps.children]) {
|
|
97015
97224
|
paths.push(newPath);
|
|
@@ -97026,8 +97235,8 @@ class CascaderUtilsPro {
|
|
|
97026
97235
|
return paths;
|
|
97027
97236
|
}
|
|
97028
97237
|
}
|
|
97029
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/cascader-panel-pro/VirtualCascaderPanel.vue?vue&type=template&id=
|
|
97030
|
-
var
|
|
97238
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/cascader-panel-pro/VirtualCascaderPanel.vue?vue&type=template&id=05f77638
|
|
97239
|
+
var VirtualCascaderPanelvue_type_template_id_05f77638_render = function render() {
|
|
97031
97240
|
var _vm = this,
|
|
97032
97241
|
_c = _vm._self._c;
|
|
97033
97242
|
return _c('div', {
|
|
@@ -97118,7 +97327,7 @@ var VirtualCascaderPanelvue_type_template_id_23086f90_render = function render()
|
|
|
97118
97327
|
})], 1);
|
|
97119
97328
|
}), 0);
|
|
97120
97329
|
};
|
|
97121
|
-
var
|
|
97330
|
+
var VirtualCascaderPanelvue_type_template_id_05f77638_staticRenderFns = [];
|
|
97122
97331
|
|
|
97123
97332
|
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"8cd600e8-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/cascader-panel-pro/VirtualList.vue?vue&type=template&id=43cb1148
|
|
97124
97333
|
var VirtualListvue_type_template_id_43cb1148_render = function render() {
|
|
@@ -97274,170 +97483,6 @@ var VirtualList_component = normalizeComponent(
|
|
|
97274
97483
|
)
|
|
97275
97484
|
|
|
97276
97485
|
/* harmony default export */ var VirtualList = (VirtualList_component.exports);
|
|
97277
|
-
;// ./src/components/cascader-panel-pro/cascaderStorePro.js
|
|
97278
|
-
|
|
97279
|
-
|
|
97280
|
-
|
|
97281
|
-
|
|
97282
|
-
|
|
97283
|
-
|
|
97284
|
-
/**
|
|
97285
|
-
* 级联树扁平化存储,初始化时预计算子树叶子元数据,供 O(1) 级勾选/聚合
|
|
97286
|
-
*/
|
|
97287
|
-
|
|
97288
|
-
let nodeIdSeed = 0;
|
|
97289
|
-
function nextId() {
|
|
97290
|
-
nodeIdSeed += 1;
|
|
97291
|
-
return nodeIdSeed;
|
|
97292
|
-
}
|
|
97293
|
-
function resetCascaderStoreIdSeed() {
|
|
97294
|
-
nodeIdSeed = 0;
|
|
97295
|
-
}
|
|
97296
|
-
|
|
97297
|
-
/**
|
|
97298
|
-
* @param {Array} options
|
|
97299
|
-
* @param {Object} config - disabledField/disabledValue/disabledCheck
|
|
97300
|
-
* @param {Object} cascaderProps
|
|
97301
|
-
* @param {Object} utils - CascaderUtilsPro
|
|
97302
|
-
*/
|
|
97303
|
-
function buildCascaderStore(options, config, cascaderProps, utils) {
|
|
97304
|
-
resetCascaderStoreIdSeed();
|
|
97305
|
-
const valueKey = cascaderProps.value || 'value';
|
|
97306
|
-
const labelKey = cascaderProps.label || 'label';
|
|
97307
|
-
const childrenKey = cascaderProps.children || 'children';
|
|
97308
|
-
const disabledKey = cascaderProps.disabled || 'disabled';
|
|
97309
|
-
const nodes = [];
|
|
97310
|
-
const nodeById = new Map();
|
|
97311
|
-
const nodeByValue = new Map();
|
|
97312
|
-
const childrenByParentId = new Map();
|
|
97313
|
-
const rootIds = [];
|
|
97314
|
-
const pathByLeafValue = new Map();
|
|
97315
|
-
const allLeafValues = [];
|
|
97316
|
-
const allLeafPaths = [];
|
|
97317
|
-
const createNode = (raw, parentPath, level, parentId) => {
|
|
97318
|
-
const value = raw[valueKey];
|
|
97319
|
-
const children = raw[childrenKey];
|
|
97320
|
-
const hasChildren = Array.isArray(children) && children.length > 0;
|
|
97321
|
-
const id = nextId();
|
|
97322
|
-
const nodePath = parentId == null ? [value] : parentPath.concat(value);
|
|
97323
|
-
const node = {
|
|
97324
|
-
id,
|
|
97325
|
-
value,
|
|
97326
|
-
label: raw[labelKey],
|
|
97327
|
-
path: nodePath,
|
|
97328
|
-
level,
|
|
97329
|
-
parentId,
|
|
97330
|
-
childIds: [],
|
|
97331
|
-
isLeaf: !hasChildren,
|
|
97332
|
-
disabled: !!raw[disabledKey],
|
|
97333
|
-
raw,
|
|
97334
|
-
descendantLeafValues: [],
|
|
97335
|
-
descendantLeafCount: 0,
|
|
97336
|
-
descendantPaths: []
|
|
97337
|
-
};
|
|
97338
|
-
nodes.push(node);
|
|
97339
|
-
nodeById.set(id, node);
|
|
97340
|
-
if (!nodeByValue.has(value)) {
|
|
97341
|
-
nodeByValue.set(value, node);
|
|
97342
|
-
}
|
|
97343
|
-
if (parentId == null) {
|
|
97344
|
-
rootIds.push(id);
|
|
97345
|
-
} else {
|
|
97346
|
-
const siblings = childrenByParentId.get(parentId) || [];
|
|
97347
|
-
siblings.push(id);
|
|
97348
|
-
childrenByParentId.set(parentId, siblings);
|
|
97349
|
-
const parent = nodeById.get(parentId);
|
|
97350
|
-
if (parent) {
|
|
97351
|
-
parent.childIds.push(id);
|
|
97352
|
-
}
|
|
97353
|
-
}
|
|
97354
|
-
if (hasChildren) {
|
|
97355
|
-
children.forEach(child => {
|
|
97356
|
-
createNode(child, nodePath, level + 1, id);
|
|
97357
|
-
});
|
|
97358
|
-
} else if (!node.disabled) {
|
|
97359
|
-
pathByLeafValue.set(value, nodePath);
|
|
97360
|
-
allLeafValues.push(value);
|
|
97361
|
-
allLeafPaths.push(nodePath);
|
|
97362
|
-
}
|
|
97363
|
-
return node;
|
|
97364
|
-
};
|
|
97365
|
-
const walkRoots = (items, ancestorDisabled = false) => {
|
|
97366
|
-
items.forEach(item => {
|
|
97367
|
-
const isDisabled = ancestorDisabled || utils.isItemDisabled(item, config);
|
|
97368
|
-
const cloned = {
|
|
97369
|
-
...item
|
|
97370
|
-
};
|
|
97371
|
-
if (isDisabled) {
|
|
97372
|
-
cloned[disabledKey] = true;
|
|
97373
|
-
}
|
|
97374
|
-
createNode(cloned, [], 0, null);
|
|
97375
|
-
});
|
|
97376
|
-
};
|
|
97377
|
-
walkRoots(options || []);
|
|
97378
|
-
|
|
97379
|
-
// 自底向上汇总子树叶子
|
|
97380
|
-
const sorted = nodes.slice().sort((a, b) => b.level - a.level);
|
|
97381
|
-
sorted.forEach(node => {
|
|
97382
|
-
if (node.isLeaf) {
|
|
97383
|
-
if (!node.disabled) {
|
|
97384
|
-
node.descendantLeafValues = [node.value];
|
|
97385
|
-
node.descendantLeafCount = 1;
|
|
97386
|
-
node.descendantPaths = [node.path];
|
|
97387
|
-
}
|
|
97388
|
-
return;
|
|
97389
|
-
}
|
|
97390
|
-
const leafValues = [];
|
|
97391
|
-
const leafPaths = [];
|
|
97392
|
-
node.childIds.forEach(childId => {
|
|
97393
|
-
const child = nodeById.get(childId);
|
|
97394
|
-
if (!child || child.descendantLeafCount === 0) {
|
|
97395
|
-
return;
|
|
97396
|
-
}
|
|
97397
|
-
leafValues.push(...child.descendantLeafValues);
|
|
97398
|
-
leafPaths.push(...child.descendantPaths);
|
|
97399
|
-
});
|
|
97400
|
-
node.descendantLeafValues = leafValues;
|
|
97401
|
-
node.descendantLeafCount = leafValues.length;
|
|
97402
|
-
node.descendantPaths = leafPaths;
|
|
97403
|
-
});
|
|
97404
|
-
return {
|
|
97405
|
-
nodes,
|
|
97406
|
-
nodeById,
|
|
97407
|
-
nodeByValue,
|
|
97408
|
-
childrenByParentId,
|
|
97409
|
-
rootIds,
|
|
97410
|
-
pathByLeafValue,
|
|
97411
|
-
allLeafValues,
|
|
97412
|
-
allLeafPaths,
|
|
97413
|
-
totalLeafCount: allLeafPaths.length
|
|
97414
|
-
};
|
|
97415
|
-
}
|
|
97416
|
-
function getStoreChildren(store, parentId) {
|
|
97417
|
-
if (parentId == null) {
|
|
97418
|
-
return store.rootIds.map(id => store.nodeById.get(id)).filter(Boolean);
|
|
97419
|
-
}
|
|
97420
|
-
const childIds = store.childrenByParentId.get(parentId) || [];
|
|
97421
|
-
return childIds.map(id => store.nodeById.get(id)).filter(Boolean);
|
|
97422
|
-
}
|
|
97423
|
-
function findStoreNodeByPath(store, pathValues) {
|
|
97424
|
-
if (!pathValues || pathValues.length === 0) {
|
|
97425
|
-
return null;
|
|
97426
|
-
}
|
|
97427
|
-
let node = store.nodeByValue.get(pathValues[0]);
|
|
97428
|
-
if (!node || pathValues.length === 1) {
|
|
97429
|
-
return node;
|
|
97430
|
-
}
|
|
97431
|
-
for (let i = 1; i < pathValues.length; i++) {
|
|
97432
|
-
const target = pathValues[i];
|
|
97433
|
-
const children = getStoreChildren(store, node.id);
|
|
97434
|
-
node = children.find(child => child.value == target) || null;
|
|
97435
|
-
if (!node) {
|
|
97436
|
-
return null;
|
|
97437
|
-
}
|
|
97438
|
-
}
|
|
97439
|
-
return node;
|
|
97440
|
-
}
|
|
97441
97486
|
;// ./src/components/cascader-panel-pro/selectionStatePro.js
|
|
97442
97487
|
|
|
97443
97488
|
|
|
@@ -97449,6 +97494,7 @@ function findStoreNodeByPath(store, pathValues) {
|
|
|
97449
97494
|
|
|
97450
97495
|
|
|
97451
97496
|
|
|
97497
|
+
|
|
97452
97498
|
const COMPACT_EMIT_THRESHOLD = 300;
|
|
97453
97499
|
|
|
97454
97500
|
class SelectionStatePro {
|
|
@@ -97613,32 +97659,40 @@ class SelectionStatePro {
|
|
|
97613
97659
|
return;
|
|
97614
97660
|
}
|
|
97615
97661
|
const leafValue = path[path.length - 1];
|
|
97616
|
-
|
|
97617
|
-
|
|
97662
|
+
const leafPath = getStoreLeafPath(this.store, leafValue);
|
|
97663
|
+
if (leafPath) {
|
|
97664
|
+
this.selectedLeafSet.add(leafPath[leafPath.length - 1]);
|
|
97618
97665
|
}
|
|
97619
97666
|
});
|
|
97620
97667
|
this._reconcileAllRoots();
|
|
97621
97668
|
}
|
|
97622
97669
|
getCheckState(nodeId) {
|
|
97623
97670
|
const node = this.store.nodeById.get(nodeId);
|
|
97624
|
-
if (!node
|
|
97671
|
+
if (!node) {
|
|
97625
97672
|
return 'disabled';
|
|
97626
97673
|
}
|
|
97674
|
+
let selectionState;
|
|
97627
97675
|
if (node.isLeaf) {
|
|
97628
|
-
|
|
97629
|
-
}
|
|
97630
|
-
|
|
97631
|
-
|
|
97632
|
-
|
|
97633
|
-
|
|
97634
|
-
|
|
97635
|
-
|
|
97636
|
-
|
|
97676
|
+
selectionState = this.selectedLeafSet.has(node.value) ? 'checked' : 'unchecked';
|
|
97677
|
+
} else {
|
|
97678
|
+
const total = node.descendantLeafCount;
|
|
97679
|
+
if (total === 0) {
|
|
97680
|
+
selectionState = 'unchecked';
|
|
97681
|
+
} else {
|
|
97682
|
+
const selected = this.subtreeSelectedCount.get(node.id) || 0;
|
|
97683
|
+
if (selected === 0) {
|
|
97684
|
+
selectionState = 'unchecked';
|
|
97685
|
+
} else if (selected >= total) {
|
|
97686
|
+
selectionState = 'checked';
|
|
97687
|
+
} else {
|
|
97688
|
+
selectionState = 'indeterminate';
|
|
97689
|
+
}
|
|
97690
|
+
}
|
|
97637
97691
|
}
|
|
97638
|
-
if (
|
|
97639
|
-
return '
|
|
97692
|
+
if (node.disabled && selectionState === 'unchecked') {
|
|
97693
|
+
return 'disabled';
|
|
97640
97694
|
}
|
|
97641
|
-
return
|
|
97695
|
+
return selectionState;
|
|
97642
97696
|
}
|
|
97643
97697
|
isChecked(nodeId) {
|
|
97644
97698
|
return this.getCheckState(nodeId) === 'checked';
|
|
@@ -97684,8 +97738,8 @@ class SelectionStatePro {
|
|
|
97684
97738
|
if (typeof val === 'string' && val.startsWith(prefix)) {
|
|
97685
97739
|
rootValue = val.substring(prefix.length);
|
|
97686
97740
|
}
|
|
97687
|
-
const node = this.store
|
|
97688
|
-
if (node && !node.isLeaf
|
|
97741
|
+
const node = resolveStoreNodeByValue(this.store, rootValue);
|
|
97742
|
+
if (node && !node.isLeaf) {
|
|
97689
97743
|
node.descendantLeafValues.forEach(v => this.selectedLeafSet.add(v));
|
|
97690
97744
|
}
|
|
97691
97745
|
});
|
|
@@ -97886,6 +97940,9 @@ class SelectionStatePro {
|
|
|
97886
97940
|
}
|
|
97887
97941
|
this.$nextTick(() => {
|
|
97888
97942
|
this.syncHorizontalOverflow();
|
|
97943
|
+
if (!this.syncValueFromParent) {
|
|
97944
|
+
this.$emit('store-ready');
|
|
97945
|
+
}
|
|
97889
97946
|
});
|
|
97890
97947
|
},
|
|
97891
97948
|
syncFromValue() {
|
|
@@ -98183,8 +98240,8 @@ class SelectionStatePro {
|
|
|
98183
98240
|
;
|
|
98184
98241
|
var VirtualCascaderPanel_component = normalizeComponent(
|
|
98185
98242
|
cascader_panel_pro_VirtualCascaderPanelvue_type_script_lang_js,
|
|
98186
|
-
|
|
98187
|
-
|
|
98243
|
+
VirtualCascaderPanelvue_type_template_id_05f77638_render,
|
|
98244
|
+
VirtualCascaderPanelvue_type_template_id_05f77638_staticRenderFns,
|
|
98188
98245
|
false,
|
|
98189
98246
|
null,
|
|
98190
98247
|
null,
|
|
@@ -98211,6 +98268,7 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
98211
98268
|
|
|
98212
98269
|
|
|
98213
98270
|
|
|
98271
|
+
|
|
98214
98272
|
/* harmony default export */ var ByCascaderPanelProvue_type_script_lang_js = ({
|
|
98215
98273
|
name: 'ByCascaderPanelPro',
|
|
98216
98274
|
components: {
|
|
@@ -98345,7 +98403,8 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
98345
98403
|
compactPanelValue: [],
|
|
98346
98404
|
// 紧凑模式下稳定的空 value 引用,避免 watch 误触发清空
|
|
98347
98405
|
searchDebounceTimer: null,
|
|
98348
|
-
searchLeafSetCache: null
|
|
98406
|
+
searchLeafSetCache: null,
|
|
98407
|
+
panelSyncTimer: null
|
|
98349
98408
|
};
|
|
98350
98409
|
},
|
|
98351
98410
|
computed: {
|
|
@@ -98505,6 +98564,7 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
98505
98564
|
clearTimeout(this.searchDebounceTimer);
|
|
98506
98565
|
this.searchDebounceTimer = null;
|
|
98507
98566
|
}
|
|
98567
|
+
this.clearPanelSyncTimer();
|
|
98508
98568
|
},
|
|
98509
98569
|
methods: {
|
|
98510
98570
|
onMainPanelInput(value) {
|
|
@@ -98517,7 +98577,7 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
98517
98577
|
this.selectedValues = value && value.length ? [value] : [];
|
|
98518
98578
|
}
|
|
98519
98579
|
},
|
|
98520
|
-
|
|
98580
|
+
refreshSelectionDisplayFromPanel() {
|
|
98521
98581
|
const panel = this.$refs.cascaderPanel;
|
|
98522
98582
|
if (!panel || !panel.store || !panel.selection) {
|
|
98523
98583
|
return;
|
|
@@ -98534,29 +98594,46 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
98534
98594
|
if (!selection.isCompactSelection()) {
|
|
98535
98595
|
this.selectedValues = selection.getCheckedPaths();
|
|
98536
98596
|
}
|
|
98597
|
+
panel.bumpSelectionView();
|
|
98598
|
+
return;
|
|
98599
|
+
}
|
|
98600
|
+
if (selection.isCompactSelection()) {
|
|
98601
|
+
this.selectedItems = this.buildSelectedItemsFromValuesLazy(panel);
|
|
98602
|
+
this.selectedCount = selection.size();
|
|
98603
|
+
this.isAllSelected = selection.size() === store.totalLeafCount;
|
|
98604
|
+
panel.bumpSelectionView();
|
|
98605
|
+
return;
|
|
98606
|
+
}
|
|
98607
|
+
this.selectedValues = selection.getCheckedPaths();
|
|
98608
|
+
this.updateSelectedItems();
|
|
98609
|
+
panel.bumpSelectionView();
|
|
98610
|
+
},
|
|
98611
|
+
applyPanelSelectionChange() {
|
|
98612
|
+
const panel = this.$refs.cascaderPanel;
|
|
98613
|
+
if (!panel || !panel.store || !panel.selection) {
|
|
98614
|
+
return;
|
|
98615
|
+
}
|
|
98616
|
+
const {
|
|
98617
|
+
store,
|
|
98618
|
+
selection
|
|
98619
|
+
} = panel;
|
|
98620
|
+
this.refreshSelectionDisplayFromPanel();
|
|
98621
|
+
if (this.aggregationMode) {
|
|
98537
98622
|
this.isInternalUpdate = true;
|
|
98538
|
-
let emitValue = CascaderUtilsPro.getAggregatedEmitValues(
|
|
98623
|
+
let emitValue = CascaderUtilsPro.getAggregatedEmitValues(this.selectedItems, this.parentNodePrefix);
|
|
98539
98624
|
if (!this.isMultiple && emitValue.length > 0) {
|
|
98540
98625
|
emitValue = emitValue[0];
|
|
98541
98626
|
}
|
|
98542
98627
|
this.$emit('input', emitValue);
|
|
98543
98628
|
this.$emit('change', this.getSelectedData());
|
|
98544
|
-
panel.bumpSelectionView();
|
|
98545
98629
|
return;
|
|
98546
98630
|
}
|
|
98547
98631
|
if (selection.isCompactSelection()) {
|
|
98548
|
-
this.selectedItems = this.buildSelectedItemsFromValuesLazy(panel);
|
|
98549
|
-
this.selectedCount = this.aggregationMode ? this.selectedItems.length : selection.size();
|
|
98550
|
-
this.isAllSelected = selection.size() === store.totalLeafCount;
|
|
98551
98632
|
this.isInternalUpdate = true;
|
|
98552
98633
|
this.$emit('input', this.currentValue);
|
|
98553
98634
|
this.$emit('change', this.getSelectedData());
|
|
98554
|
-
panel.bumpSelectionView();
|
|
98555
98635
|
return;
|
|
98556
98636
|
}
|
|
98557
|
-
this.selectedValues = selection.getCheckedPaths();
|
|
98558
|
-
this.updateSelectedItems();
|
|
98559
|
-
panel.bumpSelectionView();
|
|
98560
98637
|
this.$nextTick(() => {
|
|
98561
98638
|
this.isInternalUpdate = true;
|
|
98562
98639
|
let emitValue = this.currentValue;
|
|
@@ -98582,56 +98659,151 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
98582
98659
|
syncPanelFromExternalValue() {
|
|
98583
98660
|
const panel = this.$refs.cascaderPanel;
|
|
98584
98661
|
if (!panel || !panel.selection || !panel.store) {
|
|
98585
|
-
return;
|
|
98662
|
+
return false;
|
|
98586
98663
|
}
|
|
98587
|
-
if (!
|
|
98664
|
+
if (!this.hasExternalValue()) {
|
|
98588
98665
|
panel.clearCheckedNodes();
|
|
98589
98666
|
this.selectedItems = [];
|
|
98590
98667
|
this.selectedValues = [];
|
|
98591
|
-
return;
|
|
98668
|
+
return true;
|
|
98592
98669
|
}
|
|
98593
|
-
const paths = this.resolveExternalValueToPaths();
|
|
98594
98670
|
panel.selection.clear();
|
|
98671
|
+
this.applyExternalValueToPanelSelection(panel);
|
|
98672
|
+
panel.selection._reconcileAllRoots();
|
|
98673
|
+
panel.bumpSelectionView();
|
|
98674
|
+
this.refreshSelectionDisplayFromPanel();
|
|
98675
|
+
this.expandPanelToExternalValue(panel);
|
|
98676
|
+
return true;
|
|
98677
|
+
},
|
|
98678
|
+
hasExternalValue() {
|
|
98679
|
+
const val = this.value;
|
|
98680
|
+
if (val == null || val === '') {
|
|
98681
|
+
return false;
|
|
98682
|
+
}
|
|
98683
|
+
if (Array.isArray(val)) {
|
|
98684
|
+
return val.length > 0;
|
|
98685
|
+
}
|
|
98686
|
+
return true;
|
|
98687
|
+
},
|
|
98688
|
+
applyExternalValueToPanelSelection(panel) {
|
|
98689
|
+
const {
|
|
98690
|
+
store,
|
|
98691
|
+
selection
|
|
98692
|
+
} = panel;
|
|
98693
|
+
const paths = this.resolveExternalValueToPaths();
|
|
98595
98694
|
paths.forEach(path => {
|
|
98695
|
+
if (!Array.isArray(path) || path.length === 0) {
|
|
98696
|
+
return;
|
|
98697
|
+
}
|
|
98596
98698
|
const leafValue = path[path.length - 1];
|
|
98597
|
-
|
|
98598
|
-
|
|
98699
|
+
const leafPath = getStoreLeafPath(store, leafValue);
|
|
98700
|
+
if (leafPath) {
|
|
98701
|
+
selection.selectedLeafSet.add(leafPath[leafPath.length - 1]);
|
|
98702
|
+
}
|
|
98703
|
+
});
|
|
98704
|
+
|
|
98705
|
+
// 直接按外部 value 再补一遍,避免 paths 解析遗漏(聚合父节点、异步 options 等)
|
|
98706
|
+
this.getExternalValueList().forEach(val => {
|
|
98707
|
+
if (this.aggregationMode && CascaderUtilsPro.isParentNodeValue(val, this.parentNodePrefix)) {
|
|
98708
|
+
const actualValue = CascaderUtilsPro.extractParentNodeValue(val, this.parentNodePrefix);
|
|
98709
|
+
const node = resolveStoreNodeByValue(store, actualValue);
|
|
98710
|
+
if (node && !node.isLeaf) {
|
|
98711
|
+
node.descendantLeafValues.forEach(leaf => selection.selectedLeafSet.add(leaf));
|
|
98712
|
+
}
|
|
98713
|
+
return;
|
|
98714
|
+
}
|
|
98715
|
+
const leafPath = getStoreLeafPath(store, val);
|
|
98716
|
+
if (leafPath) {
|
|
98717
|
+
selection.selectedLeafSet.add(leafPath[leafPath.length - 1]);
|
|
98718
|
+
return;
|
|
98719
|
+
}
|
|
98720
|
+
const node = resolveStoreNodeByValue(store, val);
|
|
98721
|
+
if (node && node.isLeaf) {
|
|
98722
|
+
selection.selectedLeafSet.add(node.value);
|
|
98723
|
+
} else if (node && !node.isLeaf) {
|
|
98724
|
+
node.descendantLeafValues.forEach(leaf => selection.selectedLeafSet.add(leaf));
|
|
98725
|
+
}
|
|
98726
|
+
});
|
|
98727
|
+
},
|
|
98728
|
+
getExternalValueList() {
|
|
98729
|
+
const val = this.value;
|
|
98730
|
+
if (val == null || val === '') {
|
|
98731
|
+
return [];
|
|
98732
|
+
}
|
|
98733
|
+
if (Array.isArray(val)) {
|
|
98734
|
+
if (val.length === 0) {
|
|
98735
|
+
return [];
|
|
98736
|
+
}
|
|
98737
|
+
if (Array.isArray(val[0])) {
|
|
98738
|
+
return val.map(path => path[path.length - 1]);
|
|
98739
|
+
}
|
|
98740
|
+
return val;
|
|
98741
|
+
}
|
|
98742
|
+
return [val];
|
|
98743
|
+
},
|
|
98744
|
+
clearPanelSyncTimer() {
|
|
98745
|
+
if (this.panelSyncTimer) {
|
|
98746
|
+
clearTimeout(this.panelSyncTimer);
|
|
98747
|
+
this.panelSyncTimer = null;
|
|
98748
|
+
}
|
|
98749
|
+
},
|
|
98750
|
+
schedulePanelSyncFromExternalValue(retry = 0) {
|
|
98751
|
+
this.clearPanelSyncTimer();
|
|
98752
|
+
this.$nextTick(() => {
|
|
98753
|
+
if (!this.hasExternalValue()) {
|
|
98754
|
+
const panel = this.$refs.cascaderPanel;
|
|
98755
|
+
if (panel && panel.selection) {
|
|
98756
|
+
panel.clearCheckedNodes();
|
|
98757
|
+
}
|
|
98758
|
+
this.selectedItems = [];
|
|
98759
|
+
this.selectedValues = [];
|
|
98760
|
+
return;
|
|
98761
|
+
}
|
|
98762
|
+
const synced = this.syncPanelFromExternalValue();
|
|
98763
|
+
if (!synced && retry < 20) {
|
|
98764
|
+
this.panelSyncTimer = setTimeout(() => {
|
|
98765
|
+
this.schedulePanelSyncFromExternalValue(retry + 1);
|
|
98766
|
+
}, 50);
|
|
98599
98767
|
}
|
|
98600
98768
|
});
|
|
98601
|
-
panel.selection._reconcileAllRoots();
|
|
98602
|
-
panel.bumpSelectionView();
|
|
98603
|
-
this.applyPanelSelectionChange();
|
|
98604
|
-
this.expandPanelToExternalValue(panel);
|
|
98605
98769
|
},
|
|
98606
98770
|
resolveExternalValueToPaths() {
|
|
98607
|
-
|
|
98771
|
+
const val = this.value;
|
|
98772
|
+
if (val == null || val === '') {
|
|
98608
98773
|
return [];
|
|
98609
98774
|
}
|
|
98610
|
-
if (
|
|
98775
|
+
if (Array.isArray(val) && val.length > 0 && Array.isArray(val[0])) {
|
|
98776
|
+
return [...val];
|
|
98777
|
+
}
|
|
98778
|
+
const values = Array.isArray(val) ? val : [val];
|
|
98779
|
+
if (typeof values[0] === 'string' || typeof values[0] === 'number') {
|
|
98611
98780
|
if (this.aggregationMode) {
|
|
98612
|
-
return CascaderUtilsPro.processValuesWithParentNodes(
|
|
98781
|
+
return CascaderUtilsPro.processValuesWithParentNodes(values, this.filteredOptions, this.cascaderProps, this.parentNodePrefix);
|
|
98613
98782
|
}
|
|
98614
|
-
return this.findPathsByValues(
|
|
98783
|
+
return this.findPathsByValues(values);
|
|
98615
98784
|
}
|
|
98616
|
-
return [...
|
|
98785
|
+
return Array.isArray(val) ? [...val] : [];
|
|
98617
98786
|
},
|
|
98618
98787
|
expandPanelToExternalValue(panel) {
|
|
98619
|
-
if (!panel || !panel.store || !
|
|
98788
|
+
if (!panel || !panel.store || !this.hasExternalValue()) {
|
|
98620
98789
|
return;
|
|
98621
98790
|
}
|
|
98622
|
-
const
|
|
98791
|
+
const values = this.getExternalValueList();
|
|
98792
|
+
const firstValue = values[0];
|
|
98623
98793
|
let pathValues = [];
|
|
98624
98794
|
if (this.aggregationMode && CascaderUtilsPro.isParentNodeValue(firstValue, this.parentNodePrefix)) {
|
|
98625
98795
|
const actualValue = CascaderUtilsPro.extractParentNodeValue(firstValue, this.parentNodePrefix);
|
|
98626
|
-
const node = panel.store
|
|
98796
|
+
const node = resolveStoreNodeByValue(panel.store, actualValue);
|
|
98627
98797
|
pathValues = node ? [...node.path] : [];
|
|
98628
|
-
} else if (panel.store.pathByLeafValue.has(firstValue)) {
|
|
98629
|
-
const path = panel.store.pathByLeafValue.get(firstValue);
|
|
98630
|
-
pathValues = path ? path.slice(0, -1) : [];
|
|
98631
98798
|
} else {
|
|
98632
|
-
const
|
|
98633
|
-
if (
|
|
98634
|
-
pathValues =
|
|
98799
|
+
const leafPath = getStoreLeafPath(panel.store, firstValue);
|
|
98800
|
+
if (leafPath) {
|
|
98801
|
+
pathValues = leafPath.slice(0, -1);
|
|
98802
|
+
} else {
|
|
98803
|
+
const node = resolveStoreNodeByValue(panel.store, firstValue);
|
|
98804
|
+
if (node) {
|
|
98805
|
+
pathValues = node.isLeaf ? node.path.slice(0, -1) : [...node.path];
|
|
98806
|
+
}
|
|
98635
98807
|
}
|
|
98636
98808
|
}
|
|
98637
98809
|
if (pathValues.length > 0) {
|
|
@@ -98652,11 +98824,15 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
98652
98824
|
},
|
|
98653
98825
|
// 处理 value 值
|
|
98654
98826
|
processValue() {
|
|
98827
|
+
if (!this.hasExternalValue()) {
|
|
98828
|
+
this.selectedValues = [];
|
|
98829
|
+
this.selectedItems = [];
|
|
98830
|
+
this.schedulePanelSyncFromExternalValue();
|
|
98831
|
+
return;
|
|
98832
|
+
}
|
|
98655
98833
|
if (this.useCompactSelection && this.isMultiple) {
|
|
98656
98834
|
this.selectedValues = [];
|
|
98657
|
-
this
|
|
98658
|
-
this.syncPanelFromExternalValue();
|
|
98659
|
-
});
|
|
98835
|
+
this.schedulePanelSyncFromExternalValue();
|
|
98660
98836
|
return;
|
|
98661
98837
|
}
|
|
98662
98838
|
if (this.isMultiple) {
|
|
@@ -98698,27 +98874,14 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
98698
98874
|
this.selectedValues = [];
|
|
98699
98875
|
}
|
|
98700
98876
|
}
|
|
98701
|
-
this.
|
|
98702
|
-
|
|
98703
|
-
// 单选模式下,确保级联面板正确显示选中状态
|
|
98704
|
-
if (!this.isMultiple && this.selectedValues.length > 0) {
|
|
98705
|
-
this.$nextTick(() => {
|
|
98706
|
-
const panel = this.$refs.cascaderPanel;
|
|
98707
|
-
if (panel) {
|
|
98708
|
-
panel.syncCheckedValue();
|
|
98709
|
-
this.updateSelectedItems();
|
|
98710
|
-
}
|
|
98711
|
-
});
|
|
98712
|
-
}
|
|
98877
|
+
this.schedulePanelSyncFromExternalValue();
|
|
98713
98878
|
},
|
|
98714
98879
|
// 初始化选项数据
|
|
98715
98880
|
initOptions() {
|
|
98716
98881
|
this.filteredOptions = this.processOptions(this.options);
|
|
98717
98882
|
this.countTotalItems();
|
|
98718
|
-
if (this.
|
|
98719
|
-
this
|
|
98720
|
-
this.syncPanelFromExternalValue();
|
|
98721
|
-
});
|
|
98883
|
+
if (this.hasExternalValue()) {
|
|
98884
|
+
this.schedulePanelSyncFromExternalValue();
|
|
98722
98885
|
} else {
|
|
98723
98886
|
this.updateSelectedItems();
|
|
98724
98887
|
}
|
|
@@ -98901,23 +99064,23 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
98901
99064
|
const panel = this.$refs.cascaderPanel;
|
|
98902
99065
|
if (panel && panel.selection) {
|
|
98903
99066
|
if (item.isAggregated) {
|
|
98904
|
-
const node = panel.store
|
|
99067
|
+
const node = resolveStoreNodeByValue(panel.store, item.value);
|
|
98905
99068
|
if (node) {
|
|
98906
99069
|
panel.selection.toggleNode(node.id, false);
|
|
98907
99070
|
}
|
|
98908
99071
|
} else if (item.path && item.path.length > 0) {
|
|
98909
99072
|
const leafValue = item.path[item.path.length - 1];
|
|
98910
|
-
const leafNode = panel.store
|
|
99073
|
+
const leafNode = resolveStoreNodeByValue(panel.store, leafValue);
|
|
98911
99074
|
if (leafNode) {
|
|
98912
99075
|
panel.selection.toggleNode(leafNode.id, false);
|
|
98913
99076
|
} else {
|
|
98914
|
-
const node = panel.store
|
|
99077
|
+
const node = resolveStoreNodeByValue(panel.store, item.value);
|
|
98915
99078
|
if (node) {
|
|
98916
99079
|
panel.selection.toggleNode(node.id, false);
|
|
98917
99080
|
}
|
|
98918
99081
|
}
|
|
98919
99082
|
} else {
|
|
98920
|
-
const node = panel.store
|
|
99083
|
+
const node = resolveStoreNodeByValue(panel.store, item.value);
|
|
98921
99084
|
if (node) {
|
|
98922
99085
|
panel.selection.toggleNode(node.id, false);
|
|
98923
99086
|
}
|
|
@@ -99049,7 +99212,7 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
99049
99212
|
this.selectedValues = [];
|
|
99050
99213
|
}
|
|
99051
99214
|
}
|
|
99052
|
-
this.
|
|
99215
|
+
this.schedulePanelSyncFromExternalValue();
|
|
99053
99216
|
},
|
|
99054
99217
|
// 根据values找到对应的路径
|
|
99055
99218
|
findPathsByValues(values) {
|
|
@@ -99057,7 +99220,7 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
99057
99220
|
const findPath = (options, targetValues, currentPath = []) => {
|
|
99058
99221
|
for (const option of options) {
|
|
99059
99222
|
const newPath = [...currentPath, option[this.cascaderProps.value]];
|
|
99060
|
-
if (targetValues.
|
|
99223
|
+
if (targetValues.some(target => target == option[this.cascaderProps.value])) {
|
|
99061
99224
|
// 如果是叶子节点(没有children属性),添加到路径中
|
|
99062
99225
|
if (!option[this.cascaderProps.children]) {
|
|
99063
99226
|
paths.push(newPath);
|
|
@@ -99103,8 +99266,9 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
99103
99266
|
if (panel && panel.selection && panel.store) {
|
|
99104
99267
|
matchedPaths.forEach(path => {
|
|
99105
99268
|
const leafValue = path[path.length - 1];
|
|
99106
|
-
|
|
99107
|
-
|
|
99269
|
+
const leafPath = getStoreLeafPath(panel.store, leafValue);
|
|
99270
|
+
if (leafPath) {
|
|
99271
|
+
panel.selection.selectedLeafSet.add(leafPath[leafPath.length - 1]);
|
|
99108
99272
|
}
|
|
99109
99273
|
});
|
|
99110
99274
|
panel.selection._reconcileAllRoots();
|
|
@@ -99207,8 +99371,8 @@ var VirtualCascaderPanel_component = normalizeComponent(
|
|
|
99207
99371
|
;
|
|
99208
99372
|
var ByCascaderPanelPro_component = normalizeComponent(
|
|
99209
99373
|
cascader_panel_pro_ByCascaderPanelProvue_type_script_lang_js,
|
|
99210
|
-
|
|
99211
|
-
|
|
99374
|
+
ByCascaderPanelProvue_type_template_id_37aef47d_render,
|
|
99375
|
+
ByCascaderPanelProvue_type_template_id_37aef47d_staticRenderFns,
|
|
99212
99376
|
false,
|
|
99213
99377
|
null,
|
|
99214
99378
|
null,
|