bkui-vue 0.0.2-modal-refactor.1 → 0.0.2-modal-refactor.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/index.cjs.js +28 -28
- package/dist/index.esm.js +5749 -6066
- package/dist/index.umd.js +28 -28
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/date-picker/use-calendar.d.ts +24 -0
- package/lib/dialog/dialog.css +10 -10
- package/lib/dialog/dialog.d.ts +2 -2
- package/lib/dialog/dialog.variable.css +10 -10
- package/lib/dialog/index.d.ts +6 -6
- package/lib/info-box/index.js +24 -13
- package/lib/info-box/info-box.css +10 -10
- package/lib/info-box/info-box.less +37 -34
- package/lib/info-box/info-box.variable.css +10 -10
- package/lib/modal/index.d.ts +6 -6
- package/lib/modal/modal.css +10 -10
- package/lib/modal/modal.d.ts +2 -2
- package/lib/modal/modal.variable.css +10 -10
- package/lib/shared/index.d.ts +0 -2
- package/lib/shared/index.js +443 -1137
- package/lib/sideslider/index.d.ts +6 -6
- package/lib/sideslider/sideslider.d.ts +2 -2
- package/package.json +1 -1
- package/lib/shared/mask-manager.d.ts +0 -89
- package/lib/shared/pop-manager.d.ts +0 -41
package/lib/shared/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
2
|
-
import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
|
3
2
|
import * as __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__ from "@popperjs/core";
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__ from "lodash/throttle";
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
5
5
|
/******/ // The require scope
|
6
6
|
/******/ var __webpack_require__ = {};
|
@@ -31,9 +31,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
31
31
|
oY: () => (/* reexport */ AlignEnum),
|
32
32
|
p3: () => (/* reexport */ BKLAYERD_INDEX_EFAULT_VALUE),
|
33
33
|
Ql: () => (/* reexport */ BKLAYERTYPE),
|
34
|
-
Eo: () => (/* reexport */ BKPopIndexManager),
|
35
34
|
mZ: () => (/* reexport */ BKPopover),
|
36
|
-
Wg: () => (/* reexport */ BkMaskManager),
|
37
35
|
_D: () => (/* reexport */ DialogTypeEnum),
|
38
36
|
dq: () => (/* reexport */ DirectionEnum),
|
39
37
|
kT: () => (/* binding */ EMPTY_OBJ),
|
@@ -60,8 +58,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
60
58
|
os: () => (/* reexport */ TriggerEnum),
|
61
59
|
WW: () => (/* reexport */ alignType),
|
62
60
|
h6: () => (/* binding */ arrayEqual),
|
63
|
-
Lx: () => (/* reexport */ bKMaskManager),
|
64
|
-
aR: () => (/* reexport */ bkPopIndexManager),
|
65
61
|
ue: () => (/* reexport */ bkZIndexManager),
|
66
62
|
kC: () => (/* reexport */ capitalize),
|
67
63
|
ao: () => (/* reexport */ checkOverflow),
|
@@ -549,6 +545,43 @@ var useForm = function useForm() {
|
|
549
545
|
var useFormItem = function useFormItem() {
|
550
546
|
return (0,external_vue_namespaceObject.inject)(formItemKey, undefined);
|
551
547
|
};
|
548
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
549
|
+
function _arrayLikeToArray(arr, len) {
|
550
|
+
if (len == null || len > arr.length) len = arr.length;
|
551
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
552
|
+
return arr2;
|
553
|
+
}
|
554
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
555
|
+
|
556
|
+
function _arrayWithoutHoles(arr) {
|
557
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
558
|
+
}
|
559
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
560
|
+
function _iterableToArray(iter) {
|
561
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
562
|
+
}
|
563
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
564
|
+
|
565
|
+
function _unsupportedIterableToArray(o, minLen) {
|
566
|
+
if (!o) return;
|
567
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
568
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
569
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
570
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
571
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
572
|
+
}
|
573
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
574
|
+
function _nonIterableSpread() {
|
575
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
576
|
+
}
|
577
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
function _toConsumableArray(arr) {
|
583
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
584
|
+
}
|
552
585
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
553
586
|
function _classCallCheck(instance, Constructor) {
|
554
587
|
if (!(instance instanceof Constructor)) {
|
@@ -609,1094 +642,105 @@ function _defineProperty(obj, key, value) {
|
|
609
642
|
}
|
610
643
|
return obj;
|
611
644
|
}
|
612
|
-
;// CONCATENATED MODULE:
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
629
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
630
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
631
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
632
|
-
*
|
633
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
634
|
-
* the Software.
|
635
|
-
*
|
636
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
637
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
638
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
639
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
640
|
-
* IN THE SOFTWARE.
|
641
|
-
*/
|
645
|
+
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
|
646
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
647
|
+
/* harmony default export */ const esm_browser_native = ({
|
648
|
+
randomUUID
|
649
|
+
});
|
650
|
+
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
|
651
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
652
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
653
|
+
// generators (like Math.random()).
|
654
|
+
let getRandomValues;
|
655
|
+
const rnds8 = new Uint8Array(16);
|
656
|
+
function rng() {
|
657
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
658
|
+
if (!getRandomValues) {
|
659
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
660
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
642
661
|
|
643
|
-
|
644
|
-
|
645
|
-
* 生成n位长度的字符串
|
646
|
-
* @param {Number} n
|
647
|
-
* @param str,默认26位字母及数字
|
648
|
-
*/
|
649
|
-
var random = function random(n) {
|
650
|
-
var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : lowerStr;
|
651
|
-
var result = '';
|
652
|
-
for (var i = 0; i < n; i++) {
|
653
|
-
result += str[parseInt((Math.random() * str.length).toString(), 10)];
|
654
|
-
}
|
655
|
-
return result;
|
656
|
-
};
|
657
|
-
/**
|
658
|
-
* 监听目标元素的Resize事件
|
659
|
-
* @param root 目标元素
|
660
|
-
* @param callbackFn 执行函数
|
661
|
-
* @param delay 延迟执行时间,默认 60
|
662
|
-
* @param immediate 是否立即执行回调函数
|
663
|
-
* @returns "{ start: () => void, stop: () => void }"
|
664
|
-
*/
|
665
|
-
var observerResize = function observerResize(root, callbackFn) {
|
666
|
-
var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
|
667
|
-
var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
668
|
-
var callFn = (0,throttle_namespaceObject["default"])(function () {
|
669
|
-
if (typeof callbackFn === 'function') {
|
670
|
-
callbackFn();
|
671
|
-
}
|
672
|
-
}, delay);
|
673
|
-
var resizeObserver = new ResizeObserver(function () {
|
674
|
-
callFn();
|
675
|
-
});
|
676
|
-
if (immediate) {
|
677
|
-
if (typeof callbackFn === 'function') {
|
678
|
-
callbackFn();
|
662
|
+
if (!getRandomValues) {
|
663
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
679
664
|
}
|
680
665
|
}
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
resizeObserver.disconnect();
|
687
|
-
resizeObserver.unobserve(root);
|
688
|
-
}
|
689
|
-
};
|
690
|
-
};
|
691
|
-
var capitalize = function capitalize(str) {
|
692
|
-
return str[0].toUpperCase() + str.slice(1);
|
693
|
-
};
|
666
|
+
|
667
|
+
return getRandomValues(rnds8);
|
668
|
+
}
|
669
|
+
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
|
670
|
+
|
694
671
|
/**
|
695
|
-
*
|
696
|
-
*
|
697
|
-
* @returns
|
672
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
673
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
698
674
|
*/
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
675
|
+
|
676
|
+
const byteToHex = [];
|
677
|
+
|
678
|
+
for (let i = 0; i < 256; ++i) {
|
679
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
680
|
+
}
|
681
|
+
|
682
|
+
function unsafeStringify(arr, offset = 0) {
|
683
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
684
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
685
|
+
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
686
|
+
}
|
687
|
+
|
688
|
+
function stringify(arr, offset = 0) {
|
689
|
+
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
|
690
|
+
// of the following:
|
691
|
+
// - One or more input array values don't map to a hex octet (leading to
|
692
|
+
// "undefined" in the uuid)
|
693
|
+
// - Invalid input values for the RFC `version` or `variant` fields
|
694
|
+
|
695
|
+
if (!validate(uuid)) {
|
696
|
+
throw TypeError('Stringified UUID is invalid');
|
697
|
+
}
|
698
|
+
|
699
|
+
return uuid;
|
700
|
+
}
|
701
|
+
|
702
|
+
/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
|
703
|
+
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
|
708
|
+
function v4(options, buf, offset) {
|
709
|
+
if (esm_browser_native.randomUUID && !buf && !options) {
|
710
|
+
return esm_browser_native.randomUUID();
|
711
|
+
}
|
712
|
+
|
713
|
+
options = options || {};
|
714
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
715
|
+
|
716
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
717
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
718
|
+
|
719
|
+
if (buf) {
|
720
|
+
offset = offset || 0;
|
721
|
+
|
722
|
+
for (let i = 0; i < 16; ++i) {
|
723
|
+
buf[offset + i] = rnds[i];
|
721
724
|
}
|
722
|
-
|
723
|
-
|
725
|
+
|
726
|
+
return buf;
|
724
727
|
}
|
725
|
-
|
728
|
+
|
729
|
+
return unsafeStringify(rnds);
|
726
730
|
}
|
727
|
-
;// CONCATENATED MODULE: ../../packages/shared/src/z-index-manager.ts
|
728
731
|
|
732
|
+
/* harmony default export */ const esm_browser_v4 = (v4);
|
733
|
+
;// CONCATENATED MODULE: external "@popperjs/core"
|
734
|
+
var core_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
735
|
+
var core_y = x => () => x
|
736
|
+
const core_namespaceObject = core_x({ ["createPopper"]: () => __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__.createPopper });
|
737
|
+
;// CONCATENATED MODULE: ../../packages/shared/src/popover.ts
|
729
738
|
|
730
739
|
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
*
|
736
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
737
|
-
*
|
738
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
739
|
-
*
|
740
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
741
|
-
*
|
742
|
-
* ---------------------------------------------------
|
743
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
744
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
745
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
746
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
747
|
-
*
|
748
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
749
|
-
* the Software.
|
750
|
-
*
|
751
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
752
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
753
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
754
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
755
|
-
* IN THE SOFTWARE.
|
756
|
-
*/
|
757
|
-
/**
|
758
|
-
* 页面框架层级
|
759
|
-
*/
|
760
|
-
var BKLAYERTYPE;
|
761
|
-
(function (BKLAYERTYPE) {
|
762
|
-
/** 网站内容的背景、拓扑的画布等 */
|
763
|
-
BKLAYERTYPE["BOTTOM"] = "bottom";
|
764
|
-
/** 页面呈现的各类内容 */
|
765
|
-
BKLAYERTYPE["CONTENT"] = "content";
|
766
|
-
/** 顶部导航、侧边导航以及用户信息等 */
|
767
|
-
BKLAYERTYPE["NAVI"] = "navi";
|
768
|
-
/** 页面需全屏操作的部分功能或编辑器的全屏模式 */
|
769
|
-
BKLAYERTYPE["FULLSCREEN"] = "fullScreen";
|
770
|
-
/** 各类功能插件 */
|
771
|
-
BKLAYERTYPE["PLUGINS"] = "plugins";
|
772
|
-
/** 各类弹窗或抽屉(非模态弹窗不考虑) */
|
773
|
-
BKLAYERTYPE["MODAL"] = "modal";
|
774
|
-
/** 各类消息提示 */
|
775
|
-
BKLAYERTYPE["MESSAGE"] = "message";
|
776
|
-
/** 各类popper提示 */
|
777
|
-
BKLAYERTYPE["POPPER"] = "popper";
|
778
|
-
})(BKLAYERTYPE || (BKLAYERTYPE = {}));
|
779
|
-
/** 定义不同分层默认值 */
|
780
|
-
var BKLAYERD_INDEX_EFAULT_VALUE = (_BKLAYERD_INDEX_EFAUL = {}, _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.BOTTOM, 0), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.CONTENT, 1), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.NAVI, 100), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.FULLSCREEN, 1000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.MODAL, 2000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.PLUGINS, 5000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.MESSAGE, 6000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.POPPER, 8000), _BKLAYERD_INDEX_EFAUL);
|
781
|
-
var BKZIndexManager = /*#__PURE__*/function () {
|
782
|
-
function BKZIndexManager() {
|
783
|
-
_classCallCheck(this, BKZIndexManager);
|
784
|
-
_defineProperty(this, "storageLayerIndexValue", {});
|
785
|
-
this.copyDefaultValue();
|
786
|
-
}
|
787
|
-
/**
|
788
|
-
*
|
789
|
-
* @param type
|
790
|
-
* @returns
|
791
|
-
*/
|
792
|
-
_createClass(BKZIndexManager, [{
|
793
|
-
key: "getNextIndex",
|
794
|
-
value: function getNextIndex(type) {
|
795
|
-
if (Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue, type)) {
|
796
|
-
this.storageLayerIndexValue[type] = this.storageLayerIndexValue[type] + 1;
|
797
|
-
return this.storageLayerIndexValue[type];
|
798
|
-
}
|
799
|
-
this.storageLayerIndexValue[BKLAYERTYPE.MODAL] = this.storageLayerIndexValue[BKLAYERTYPE.MODAL] + 1;
|
800
|
-
return this.storageLayerIndexValue[BKLAYERTYPE.MODAL];
|
801
|
-
}
|
802
|
-
/** 获取弹窗类型最新zIndex的值 */
|
803
|
-
}, {
|
804
|
-
key: "getModalNextIndex",
|
805
|
-
value: function getModalNextIndex() {
|
806
|
-
return this.getNextIndex(BKLAYERTYPE.MODAL);
|
807
|
-
}
|
808
|
-
/** 获取Message类型最新zIndex的值 */
|
809
|
-
}, {
|
810
|
-
key: "getMessageNextIndex",
|
811
|
-
value: function getMessageNextIndex() {
|
812
|
-
return this.getNextIndex(BKLAYERTYPE.MESSAGE);
|
813
|
-
}
|
814
|
-
/** 获取全屏类型最新zIndex的值 */
|
815
|
-
}, {
|
816
|
-
key: "getFullScreenNextIndex",
|
817
|
-
value: function getFullScreenNextIndex() {
|
818
|
-
return this.getNextIndex(BKLAYERTYPE.FULLSCREEN);
|
819
|
-
}
|
820
|
-
/** 获取导航类型最新zIndex的值 */
|
821
|
-
}, {
|
822
|
-
key: "getNaviNextIndex",
|
823
|
-
value: function getNaviNextIndex() {
|
824
|
-
return this.getNextIndex(BKLAYERTYPE.NAVI);
|
825
|
-
}
|
826
|
-
/** 获取导航类型最新zIndex的值 */
|
827
|
-
}, {
|
828
|
-
key: "getPopperIndex",
|
829
|
-
value: function getPopperIndex() {
|
830
|
-
return this.getNextIndex(BKLAYERTYPE.POPPER);
|
831
|
-
}
|
832
|
-
/**
|
833
|
-
* 更新自定义默认zIndex配置
|
834
|
-
* @param config 配置项
|
835
|
-
*/
|
836
|
-
}, {
|
837
|
-
key: "setDefaultZIndex",
|
838
|
-
value: function setDefaultZIndex(config) {
|
839
|
-
var _this = this;
|
840
|
-
Object.keys(config || {}).forEach(function (key) {
|
841
|
-
if (Object.prototype.hasOwnProperty.call(_this.storageLayerIndexValue.__proto__, key)) {
|
842
|
-
Object.assign(_this.storageLayerIndexValue.__proto__, _defineProperty({}, key, config[key]));
|
843
|
-
}
|
844
|
-
});
|
845
|
-
this.copyDefaultValue();
|
846
|
-
}
|
847
|
-
/**
|
848
|
-
* 重置zIndex
|
849
|
-
* @param config 配置项
|
850
|
-
*/
|
851
|
-
}, {
|
852
|
-
key: "resetZIndex",
|
853
|
-
value: function resetZIndex(config) {
|
854
|
-
var _this2 = this;
|
855
|
-
Object.keys(config || {}).forEach(function (key) {
|
856
|
-
if (Object.prototype.hasOwnProperty.call(_this2.storageLayerIndexValue, key)) {
|
857
|
-
Object.assign(_this2.storageLayerIndexValue, _defineProperty({}, key, config[key]));
|
858
|
-
}
|
859
|
-
});
|
860
|
-
}
|
861
|
-
/**
|
862
|
-
* 根据默认设置创建副本
|
863
|
-
*/
|
864
|
-
}, {
|
865
|
-
key: "copyDefaultValue",
|
866
|
-
value: function copyDefaultValue() {
|
867
|
-
var properties = Object.keys(BKLAYERD_INDEX_EFAULT_VALUE).reduce(function (props, key) {
|
868
|
-
return Object.assign(props, _defineProperty({}, key, {
|
869
|
-
value: BKLAYERD_INDEX_EFAULT_VALUE[key],
|
870
|
-
writable: true,
|
871
|
-
configurable: true
|
872
|
-
}));
|
873
|
-
}, {});
|
874
|
-
this.storageLayerIndexValue = Object.create(BKLAYERD_INDEX_EFAULT_VALUE, properties);
|
875
|
-
}
|
876
|
-
}]);
|
877
|
-
return BKZIndexManager;
|
878
|
-
}();
|
879
|
-
var bkZIndexManager = new BKZIndexManager();
|
880
|
-
;// CONCATENATED MODULE: ../../packages/shared/src/mask-manager.ts
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
885
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
886
|
-
/*
|
887
|
-
* Tencent is pleased to support the open source community by making
|
888
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
889
|
-
*
|
890
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
891
|
-
*
|
892
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
893
|
-
*
|
894
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
895
|
-
*
|
896
|
-
* ---------------------------------------------------
|
897
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
898
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
899
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
900
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
901
|
-
*
|
902
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
903
|
-
* the Software.
|
904
|
-
*
|
905
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
906
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
907
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
908
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
909
|
-
* IN THE SOFTWARE.
|
910
|
-
*/
|
911
|
-
|
912
|
-
|
913
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
914
|
-
var DEFAULT_MASK_UUID = function DEFAULT_MASK_UUID() {};
|
915
|
-
DEFAULT_MASK_UUID.prototype.def_val = "__bk_mask_".concat(random(16));
|
916
|
-
var MaskEventMap = new WeakMap();
|
917
|
-
var getMaskEvent = function getMaskEvent(mask) {
|
918
|
-
if (MaskEventMap.has(mask)) {
|
919
|
-
return MaskEventMap.get(mask);
|
920
|
-
}
|
921
|
-
return [];
|
922
|
-
};
|
923
|
-
var setMaskEvent = function setMaskEvent(mask, event, args, content, instanceId) {
|
924
|
-
var maskEvent = getMaskEvent(mask);
|
925
|
-
if (maskEvent.some(function (evet) {
|
926
|
-
return evet.instanceId === instanceId;
|
927
|
-
})) {
|
928
|
-
return;
|
929
|
-
}
|
930
|
-
maskEvent.push({
|
931
|
-
event: event,
|
932
|
-
args: args,
|
933
|
-
content: content,
|
934
|
-
instanceId: instanceId
|
935
|
-
});
|
936
|
-
MaskEventMap.set(mask, maskEvent);
|
937
|
-
};
|
938
|
-
var setMaskEventIns = function setMaskEventIns(mask, maskEvent) {
|
939
|
-
MaskEventMap.set(mask, maskEvent);
|
940
|
-
};
|
941
|
-
var MaskQueueMaker = /*#__PURE__*/function () {
|
942
|
-
function MaskQueueMaker() {
|
943
|
-
_classCallCheck(this, MaskQueueMaker);
|
944
|
-
_defineProperty(this, "timer", null);
|
945
|
-
_defineProperty(this, "store", []);
|
946
|
-
_defineProperty(this, "maskMap", new WeakMap());
|
947
|
-
}
|
948
|
-
_createClass(MaskQueueMaker, [{
|
949
|
-
key: "appendMaker",
|
950
|
-
value: function appendMaker(fn) {
|
951
|
-
this.store.push(fn);
|
952
|
-
this.executeMaker();
|
953
|
-
}
|
954
|
-
}, {
|
955
|
-
key: "pushMaskStyle",
|
956
|
-
value: function pushMaskStyle(parentNode, style) {
|
957
|
-
var value = this.getMaskMap(parentNode);
|
958
|
-
this.setMaskMap(parentNode, _objectSpread({
|
959
|
-
styles: [style]
|
960
|
-
}, value || {}));
|
961
|
-
}
|
962
|
-
}, {
|
963
|
-
key: "getMaskStyles",
|
964
|
-
value: function getMaskStyles(parentNode) {
|
965
|
-
var _this$getMaskMap;
|
966
|
-
return ((_this$getMaskMap = this.getMaskMap(parentNode)) === null || _this$getMaskMap === void 0 ? void 0 : _this$getMaskMap.styles) || [];
|
967
|
-
}
|
968
|
-
}, {
|
969
|
-
key: "setMaskId",
|
970
|
-
value: function setMaskId(parentNode, id) {
|
971
|
-
var value = this.getMaskMap(parentNode);
|
972
|
-
if (!value) {
|
973
|
-
this.setMaskMap(parentNode, _objectSpread({
|
974
|
-
id: id
|
975
|
-
}, value || {}));
|
976
|
-
} else {
|
977
|
-
Object.assign(value, {
|
978
|
-
id: id
|
979
|
-
});
|
980
|
-
this.setMaskMap(parentNode, value);
|
981
|
-
}
|
982
|
-
}
|
983
|
-
}, {
|
984
|
-
key: "getMaskId",
|
985
|
-
value: function getMaskId(parentNode) {
|
986
|
-
var _this$getMaskMap2;
|
987
|
-
return (_this$getMaskMap2 = this.getMaskMap(parentNode)) === null || _this$getMaskMap2 === void 0 ? void 0 : _this$getMaskMap2.id;
|
988
|
-
}
|
989
|
-
}, {
|
990
|
-
key: "setMaskMap",
|
991
|
-
value: function setMaskMap(key, value) {
|
992
|
-
this.maskMap.set(key, value);
|
993
|
-
}
|
994
|
-
}, {
|
995
|
-
key: "getMaskMap",
|
996
|
-
value: function getMaskMap(key) {
|
997
|
-
return this.maskMap.get(key);
|
998
|
-
}
|
999
|
-
}, {
|
1000
|
-
key: "executeMaker",
|
1001
|
-
value: function executeMaker() {
|
1002
|
-
var _this = this;
|
1003
|
-
this.timer && cancelAnimationFrame(this.timer);
|
1004
|
-
this.timer = requestAnimationFrame(function () {
|
1005
|
-
var fn = _this.store.pop();
|
1006
|
-
if (typeof fn === 'function') {
|
1007
|
-
Reflect.apply(fn, _this, []);
|
1008
|
-
_this.executeMaker();
|
1009
|
-
}
|
1010
|
-
});
|
1011
|
-
}
|
1012
|
-
}]);
|
1013
|
-
return MaskQueueMaker;
|
1014
|
-
}();
|
1015
|
-
var bkMaskMaker = new MaskQueueMaker();
|
1016
|
-
var BkMaskManager = /*#__PURE__*/function () {
|
1017
|
-
/**
|
1018
|
-
* 遮罩管理器
|
1019
|
-
*
|
1020
|
-
* @param multiInstance 是否允许多实例
|
1021
|
-
* @param maskAttrTag 遮罩DOM唯一标志,支持自定义和 auto
|
1022
|
-
*/
|
1023
|
-
function BkMaskManager(config) {
|
1024
|
-
var _this2 = this;
|
1025
|
-
_classCallCheck(this, BkMaskManager);
|
1026
|
-
/** 遮罩容器 */
|
1027
|
-
/** 遮罩备份容器,用于多个组件实例显示,遮罩只显示最后一个 **/
|
1028
|
-
/** 是否允许多个遮罩实例 */
|
1029
|
-
_defineProperty(this, "multiInstance", false);
|
1030
|
-
/** 遮罩控制器唯一标识 */
|
1031
|
-
_defineProperty(this, "uniqueMaskAttrTag", '');
|
1032
|
-
/** 设置弹出层父级组件,默认是body */
|
1033
|
-
_defineProperty(this, "parentNode", document.body);
|
1034
|
-
/** 遮罩当前显示组件实例 **/
|
1035
|
-
_defineProperty(this, "activeInstance", undefined);
|
1036
|
-
/** 记录已在使用的z-index */
|
1037
|
-
_defineProperty(this, "zIndexStore", new Map());
|
1038
|
-
/** 记录最后一个UUID */
|
1039
|
-
_defineProperty(this, "lastUUID", null);
|
1040
|
-
/** 遮罩样式 **/
|
1041
|
-
_defineProperty(this, "maskStyle", {
|
1042
|
-
position: 'fixed',
|
1043
|
-
left: 0,
|
1044
|
-
top: 0,
|
1045
|
-
bottom: 0,
|
1046
|
-
right: 0,
|
1047
|
-
display: 'none',
|
1048
|
-
'background-color': 'rgba(0,0,0,.6)'
|
1049
|
-
});
|
1050
|
-
// 用于判定是否已经初始化过当前实例
|
1051
|
-
_defineProperty(this, "isInit", false);
|
1052
|
-
_defineProperty(this, "maskAttrTag", 'auto');
|
1053
|
-
var _ref = config || {},
|
1054
|
-
_ref$multiInstance = _ref.multiInstance,
|
1055
|
-
multiInstance = _ref$multiInstance === void 0 ? false : _ref$multiInstance,
|
1056
|
-
_ref$maskAttrTag = _ref.maskAttrTag,
|
1057
|
-
maskAttrTag = _ref$maskAttrTag === void 0 ? 'auto' : _ref$maskAttrTag,
|
1058
|
-
_ref$parentNode = _ref.parentNode,
|
1059
|
-
parentNode = _ref$parentNode === void 0 ? document.body : _ref$parentNode,
|
1060
|
-
_ref$maskStyle = _ref.maskStyle,
|
1061
|
-
maskStyle = _ref$maskStyle === void 0 ? {} : _ref$maskStyle;
|
1062
|
-
this.parentNode = parentNode || document;
|
1063
|
-
this.maskAttrTag = maskAttrTag;
|
1064
|
-
this.activeInstance = undefined;
|
1065
|
-
this.multiInstance = multiInstance;
|
1066
|
-
this.uniqueMaskAttrTag = this.getMaskAttrTag(maskAttrTag);
|
1067
|
-
// 避免多个实例多处初始化,此处会做队列处理
|
1068
|
-
// 合并重复的处理请求
|
1069
|
-
// 如果当前实例初始化时,仍未执行完队列,则需要进行请求合并
|
1070
|
-
bkMaskMaker.appendMaker(function () {
|
1071
|
-
_this2.initInstance(maskStyle);
|
1072
|
-
});
|
1073
|
-
}
|
1074
|
-
_createClass(BkMaskManager, [{
|
1075
|
-
key: "setOption",
|
1076
|
-
value: function setOption(option) {
|
1077
|
-
var _ref2 = option || {},
|
1078
|
-
_ref2$parentNode = _ref2.parentNode,
|
1079
|
-
parentNode = _ref2$parentNode === void 0 ? document.body : _ref2$parentNode,
|
1080
|
-
_ref2$maskStyle = _ref2.maskStyle,
|
1081
|
-
maskStyle = _ref2$maskStyle === void 0 ? {} : _ref2$maskStyle,
|
1082
|
-
_ref2$maskAttrTag = _ref2.maskAttrTag,
|
1083
|
-
maskAttrTag = _ref2$maskAttrTag === void 0 ? this.maskAttrTag : _ref2$maskAttrTag;
|
1084
|
-
this.parentNode = parentNode || document;
|
1085
|
-
this.setMaskStyle(Object.assign({}, this.maskStyle, maskStyle));
|
1086
|
-
this.uniqueMaskAttrTag = this.getMaskAttrTag(maskAttrTag);
|
1087
|
-
}
|
1088
|
-
}, {
|
1089
|
-
key: "destroyEvent",
|
1090
|
-
value: function destroyEvent(id) {
|
1091
|
-
if (this.mask) {
|
1092
|
-
var events = getMaskEvent(this.mask) || [];
|
1093
|
-
var index = events.findIndex(function (evt) {
|
1094
|
-
return evt.instanceId === id;
|
1095
|
-
});
|
1096
|
-
if (index >= 0) {
|
1097
|
-
events.splice(index, 1);
|
1098
|
-
setMaskEventIns(this.mask, events);
|
1099
|
-
}
|
1100
|
-
}
|
1101
|
-
}
|
1102
|
-
/**
|
1103
|
-
* 显示遮罩
|
1104
|
-
* @param content 遮罩内容
|
1105
|
-
* @param zIndex z-index
|
1106
|
-
* @param showMask 是否显示遮罩
|
1107
|
-
* @param appendStyle 追加样式
|
1108
|
-
* @param transfer 是否显示将内容加入遮罩下
|
1109
|
-
*/
|
1110
|
-
}, {
|
1111
|
-
key: "show",
|
1112
|
-
value: function show(content, zIndex) {
|
1113
|
-
var showMask = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
1114
|
-
var appendStyle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
1115
|
-
var uuid = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
1116
|
-
var transfer = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
1117
|
-
var onMaskClick = arguments.length > 6 ? arguments[6] : undefined;
|
1118
|
-
var instanceId = arguments.length > 7 ? arguments[7] : undefined;
|
1119
|
-
var uid = uuid !== null && uuid !== void 0 ? uuid : random(16);
|
1120
|
-
// @ts-ignore
|
1121
|
-
var localZIndex = /-?\d+/.test("".concat(zIndex)) ? zIndex : bkZIndexManager.getModalNextIndex();
|
1122
|
-
var style = Object.assign({}, this.maskStyle, appendStyle || {});
|
1123
|
-
/**
|
1124
|
-
* 如果不显示遮罩,此处遮罩继承父级
|
1125
|
-
* 同时,如果父级弹出层有遮罩,此处不能覆盖
|
1126
|
-
*/
|
1127
|
-
if (!showMask) {
|
1128
|
-
if (this.lastUUID) {
|
1129
|
-
var preStore = this.zIndexStore.get(this.lastUUID);
|
1130
|
-
if (preStore) {
|
1131
|
-
style = preStore === null || preStore === void 0 ? void 0 : preStore.style;
|
1132
|
-
}
|
1133
|
-
}
|
1134
|
-
}
|
1135
|
-
/** 缓存当前z-index */
|
1136
|
-
this.storeMaskInsCfg({
|
1137
|
-
zIndex: localZIndex,
|
1138
|
-
style: _objectSpread({}, style),
|
1139
|
-
uuid: uid,
|
1140
|
-
preUID: this.lastUUID
|
1141
|
-
});
|
1142
|
-
Object.assign(style, {
|
1143
|
-
display: 'block',
|
1144
|
-
'z-index': "".concat(localZIndex),
|
1145
|
-
'pointer-events': 'all'
|
1146
|
-
});
|
1147
|
-
this.initInstance(style);
|
1148
|
-
if (onMaskClick) {
|
1149
|
-
this.catchClickEvent(content, onMaskClick, instanceId);
|
1150
|
-
}
|
1151
|
-
this.setMaskStyle(style);
|
1152
|
-
bkMaskMaker.pushMaskStyle(this.parentNode, _objectSpread({}, style));
|
1153
|
-
this.backupMask.style.setProperty('z-index', "".concat(localZIndex - 1));
|
1154
|
-
if (!showMask) {
|
1155
|
-
this.mask.style.setProperty('pointer-events', 'none');
|
1156
|
-
content === null || content === void 0 ? void 0 : content.style.setProperty('pointer-events', 'all');
|
1157
|
-
}
|
1158
|
-
if (content) {
|
1159
|
-
if (transfer) content.style.setProperty('z-index', "".concat(localZIndex + 1)); // 表明内容不在遮罩下,内容区z-index + 1
|
1160
|
-
this.activeInstance = content;
|
1161
|
-
this.appendContentToMask(content); // 表明内容在body下,即在遮罩下
|
1162
|
-
}
|
1163
|
-
}
|
1164
|
-
}, {
|
1165
|
-
key: "hide",
|
1166
|
-
value: function hide() {
|
1167
|
-
var transfer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
1168
|
-
var content = arguments.length > 1 ? arguments[1] : undefined;
|
1169
|
-
var uuid = arguments.length > 2 ? arguments[2] : undefined;
|
1170
|
-
var uid = uuid !== null && uuid !== void 0 ? uuid : this.lastUUID;
|
1171
|
-
if (!transfer) {
|
1172
|
-
var _this$activeInstance;
|
1173
|
-
content === null || content === void 0 ? void 0 : content.remove();
|
1174
|
-
(_this$activeInstance = this.activeInstance) === null || _this$activeInstance === void 0 ? void 0 : _this$activeInstance.remove();
|
1175
|
-
}
|
1176
|
-
this.removeClickEvent();
|
1177
|
-
this.activeInstance = undefined;
|
1178
|
-
this.popIndexStore(uid);
|
1179
|
-
var maskList = bkMaskMaker.getMaskStyles(this.parentNode);
|
1180
|
-
maskList === null || maskList === void 0 ? void 0 : maskList.pop();
|
1181
|
-
if (!(maskList !== null && maskList !== void 0 && maskList.length)) {
|
1182
|
-
this.mask.style.setProperty('display', 'none');
|
1183
|
-
} else {
|
1184
|
-
var style = maskList.slice(-1)[0];
|
1185
|
-
this.setMaskStyle(style);
|
1186
|
-
}
|
1187
|
-
}
|
1188
|
-
}, {
|
1189
|
-
key: "storeMaskInsCfg",
|
1190
|
-
value: function storeMaskInsCfg(config) {
|
1191
|
-
this.zIndexStore.set(config.uuid, config);
|
1192
|
-
this.lastUUID = config.uuid;
|
1193
|
-
return this.zIndexStore.get(config.uuid);
|
1194
|
-
}
|
1195
|
-
/**
|
1196
|
-
* 移除最后一次缓存数据
|
1197
|
-
*/
|
1198
|
-
}, {
|
1199
|
-
key: "popIndexStore",
|
1200
|
-
value: function popIndexStore(uuid) {
|
1201
|
-
if (this.zIndexStore.has(uuid)) {
|
1202
|
-
var rmIns = this.zIndexStore.get(uuid);
|
1203
|
-
this.lastUUID = rmIns.preUID;
|
1204
|
-
return this.zIndexStore["delete"](uuid);
|
1205
|
-
}
|
1206
|
-
this.lastUUID = null;
|
1207
|
-
return false;
|
1208
|
-
}
|
1209
|
-
}, {
|
1210
|
-
key: "backupActiveInstance",
|
1211
|
-
value: function backupActiveInstance() {
|
1212
|
-
if (this.activeInstance) {
|
1213
|
-
this.backupMask.append(this.activeInstance);
|
1214
|
-
}
|
1215
|
-
}
|
1216
|
-
}, {
|
1217
|
-
key: "backupContentElement",
|
1218
|
-
value: function backupContentElement(content) {
|
1219
|
-
var _this$backupMask;
|
1220
|
-
content && ((_this$backupMask = this.backupMask) === null || _this$backupMask === void 0 ? void 0 : _this$backupMask.append(content));
|
1221
|
-
}
|
1222
|
-
}, {
|
1223
|
-
key: "getActiveContentInstance",
|
1224
|
-
value: function getActiveContentInstance() {
|
1225
|
-
return this.activeInstance;
|
1226
|
-
}
|
1227
|
-
}, {
|
1228
|
-
key: "removeClickEvent",
|
1229
|
-
value: function removeClickEvent() {
|
1230
|
-
// if (this.mask) {
|
1231
|
-
// const events = getMaskEvent(this.mask);
|
1232
|
-
// if (!events.length) {
|
1233
|
-
// console.log('removeEventListener handleMaskClick');
|
1234
|
-
// this.mask.removeEventListener('click', this.handleMaskClick);
|
1235
|
-
// }
|
1236
|
-
// }
|
1237
|
-
}
|
1238
|
-
}, {
|
1239
|
-
key: "initInstance",
|
1240
|
-
value: function initInstance(maskStyle) {
|
1241
|
-
if (!this.isInit) {
|
1242
|
-
this.isInit = true;
|
1243
|
-
this.backupMask = this.getBackupMask();
|
1244
|
-
var _this$getMask = this.getMask(),
|
1245
|
-
instance = _this$getMask.instance,
|
1246
|
-
isExist = _this$getMask.isExist;
|
1247
|
-
this.mask = instance;
|
1248
|
-
!isExist && this.setMaskStyle(Object.assign({}, this.maskStyle, maskStyle));
|
1249
|
-
}
|
1250
|
-
}
|
1251
|
-
/**
|
1252
|
-
* 初始化当前遮罩管理器
|
1253
|
-
* @returns 当前遮罩容器
|
1254
|
-
*/
|
1255
|
-
}, {
|
1256
|
-
key: "getMask",
|
1257
|
-
value: function getMask() {
|
1258
|
-
var _this3 = this;
|
1259
|
-
if (this.multiInstance) {
|
1260
|
-
return {
|
1261
|
-
instance: this.createMask(),
|
1262
|
-
isExist: false
|
1263
|
-
};
|
1264
|
-
}
|
1265
|
-
var isExist = true;
|
1266
|
-
var div = this.parentNode.querySelector("[data-bk-mask-uid='".concat(this.uniqueMaskAttrTag, "']"));
|
1267
|
-
if (!div) {
|
1268
|
-
isExist = false;
|
1269
|
-
div = this.createMask();
|
1270
|
-
// 选中 sideslider content 中的内容,将光标移动到 mask 处再松开鼠标,此时也会触发 mask 的 click,因此改为 mousedown
|
1271
|
-
div.addEventListener('mousedown', function (e) {
|
1272
|
-
return _this3.handleMaskClick(e);
|
1273
|
-
}, true);
|
1274
|
-
}
|
1275
|
-
return {
|
1276
|
-
instance: div,
|
1277
|
-
isExist: isExist
|
1278
|
-
};
|
1279
|
-
}
|
1280
|
-
}, {
|
1281
|
-
key: "catchClickEvent",
|
1282
|
-
value: function catchClickEvent(content, onMaskClick, instanceId) {
|
1283
|
-
if (this.mask) {
|
1284
|
-
setMaskEvent(this.mask, onMaskClick, [], content, instanceId);
|
1285
|
-
}
|
1286
|
-
}
|
1287
|
-
}, {
|
1288
|
-
key: "handleMaskClick",
|
1289
|
-
value: function handleMaskClick(e) {
|
1290
|
-
if (e.target !== this.mask) {
|
1291
|
-
return;
|
1292
|
-
}
|
1293
|
-
var events = getMaskEvent(this.mask);
|
1294
|
-
if (events.length) {
|
1295
|
-
var event = events.slice(-1)[0].event;
|
1296
|
-
if (typeof event === 'function') {
|
1297
|
-
event(e);
|
1298
|
-
}
|
1299
|
-
}
|
1300
|
-
}
|
1301
|
-
}, {
|
1302
|
-
key: "getBackupMask",
|
1303
|
-
value: function getBackupMask() {
|
1304
|
-
var attrName = 'data-bk-backup-uid';
|
1305
|
-
var div = this.parentNode.querySelector("[".concat(attrName, "]"));
|
1306
|
-
if (!div) {
|
1307
|
-
div = this.createMask(attrName);
|
1308
|
-
}
|
1309
|
-
return div;
|
1310
|
-
}
|
1311
|
-
/**
|
1312
|
-
* 创建遮罩层DOM
|
1313
|
-
* @returns 返回DOM
|
1314
|
-
*/
|
1315
|
-
}, {
|
1316
|
-
key: "createMask",
|
1317
|
-
value: function createMask() {
|
1318
|
-
var attrName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'data-bk-mask-uid';
|
1319
|
-
var div = document.createElement('div');
|
1320
|
-
div.setAttribute(attrName, this.uniqueMaskAttrTag);
|
1321
|
-
this.parentNode.append(div);
|
1322
|
-
return div;
|
1323
|
-
}
|
1324
|
-
}, {
|
1325
|
-
key: "setMaskStyle",
|
1326
|
-
value: function setMaskStyle() {
|
1327
|
-
var _this4 = this;
|
1328
|
-
var maskStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
1329
|
-
if (this.mask) {
|
1330
|
-
Object.entries(maskStyle).forEach(function (cfg) {
|
1331
|
-
return _this4.mask.style.setProperty(cfg[0], cfg[1]);
|
1332
|
-
});
|
1333
|
-
}
|
1334
|
-
}
|
1335
|
-
/**
|
1336
|
-
* 根据输入生成唯一遮罩标识
|
1337
|
-
* @param tag 输入标识
|
1338
|
-
* @returns string 返回唯一标识
|
1339
|
-
*/
|
1340
|
-
}, {
|
1341
|
-
key: "getMaskAttrTag",
|
1342
|
-
value: function getMaskAttrTag(tag) {
|
1343
|
-
if (/^(auto|\s+)$/i.test(tag) || tag === null || tag === undefined || tag === '') {
|
1344
|
-
if (!bkMaskMaker.getMaskId(this.parentNode)) {
|
1345
|
-
bkMaskMaker.setMaskId(this.parentNode, "__bk_mask_".concat(random(16)));
|
1346
|
-
}
|
1347
|
-
return bkMaskMaker.getMaskId(this.parentNode);
|
1348
|
-
}
|
1349
|
-
return tag;
|
1350
|
-
}
|
1351
|
-
}, {
|
1352
|
-
key: "appendContentToMask",
|
1353
|
-
value: function appendContentToMask(content) {
|
1354
|
-
this.mask.append(content);
|
1355
|
-
}
|
1356
|
-
}]);
|
1357
|
-
return BkMaskManager;
|
1358
|
-
}();
|
1359
|
-
var bKMaskManager = new BkMaskManager({});
|
1360
|
-
;// CONCATENATED MODULE: ../../packages/shared/src/pop-manager.ts
|
1361
|
-
|
1362
|
-
|
1363
|
-
/*
|
1364
|
-
* Tencent is pleased to support the open source community by making
|
1365
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1366
|
-
*
|
1367
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1368
|
-
*
|
1369
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1370
|
-
*
|
1371
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1372
|
-
*
|
1373
|
-
* ---------------------------------------------------
|
1374
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1375
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1376
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1377
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1378
|
-
*
|
1379
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1380
|
-
* the Software.
|
1381
|
-
*
|
1382
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1383
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1384
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1385
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1386
|
-
* IN THE SOFTWARE.
|
1387
|
-
*/
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
var popInstanceStore = new WeakMap();
|
1393
|
-
var BKPopIndexManager = /*#__PURE__*/function () {
|
1394
|
-
/** 用来缓存弹出层实例 */
|
1395
|
-
|
1396
|
-
function BKPopIndexManager(options) {
|
1397
|
-
_classCallCheck(this, BKPopIndexManager);
|
1398
|
-
this.clickFn = undefined;
|
1399
|
-
this.uuidAttrName = 'data-bk-pop-uuid';
|
1400
|
-
this.uniqId = random(16);
|
1401
|
-
this.transfer = this.getParentNode(options === null || options === void 0 ? void 0 : options.transfer);
|
1402
|
-
this.bKMaskManagerInstance = new BkMaskManager({
|
1403
|
-
parentNode: this.getParentNode(options === null || options === void 0 ? void 0 : options.transfer),
|
1404
|
-
popInstance: this,
|
1405
|
-
onClick: this.onMaskClickFn
|
1406
|
-
});
|
1407
|
-
}
|
1408
|
-
_createClass(BKPopIndexManager, [{
|
1409
|
-
key: "popInstanceList",
|
1410
|
-
get: function get() {
|
1411
|
-
if (!popInstanceStore.has(this.transfer)) {
|
1412
|
-
popInstanceStore.set(this.transfer, []);
|
1413
|
-
}
|
1414
|
-
return popInstanceStore.get(this.transfer);
|
1415
|
-
},
|
1416
|
-
set: function set(val) {
|
1417
|
-
popInstanceStore.set(this.transfer, val);
|
1418
|
-
}
|
1419
|
-
}, {
|
1420
|
-
key: "getParentNode",
|
1421
|
-
value: function getParentNode(transfer) {
|
1422
|
-
if (typeof transfer === 'string') {
|
1423
|
-
var target = document.querySelector(transfer);
|
1424
|
-
if (target) {
|
1425
|
-
return target;
|
1426
|
-
}
|
1427
|
-
}
|
1428
|
-
if (helper_isElement(transfer)) {
|
1429
|
-
return transfer;
|
1430
|
-
}
|
1431
|
-
return document.body;
|
1432
|
-
}
|
1433
|
-
}, {
|
1434
|
-
key: "onMaskClick",
|
1435
|
-
value: function onMaskClick(callFn, target) {
|
1436
|
-
this.clickFn = {
|
1437
|
-
fn: callFn,
|
1438
|
-
target: target
|
1439
|
-
};
|
1440
|
-
}
|
1441
|
-
/**
|
1442
|
-
* 展示弹窗
|
1443
|
-
* @param content 弹窗内容
|
1444
|
-
* @param showMask 是否显示遮罩
|
1445
|
-
* @param appendStyle 追加样式
|
1446
|
-
* @param transfer 是否显示在body内(即是否显示在div#app内,默认为false)
|
1447
|
-
* @returns
|
1448
|
-
*/
|
1449
|
-
}, {
|
1450
|
-
key: "show",
|
1451
|
-
value: function show(content) {
|
1452
|
-
var showMask = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
1453
|
-
var appendStyle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
1454
|
-
var transfer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
1455
|
-
var zindex = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
|
1456
|
-
var onMaskClick = arguments.length > 5 ? arguments[5] : undefined;
|
1457
|
-
if (!content) {
|
1458
|
-
console.warn('pop show error: content is null or undefined');
|
1459
|
-
return;
|
1460
|
-
}
|
1461
|
-
var zIndex = typeof zindex === 'number' ? zindex : bkZIndexManager.getModalNextIndex();
|
1462
|
-
var uuid = random(16);
|
1463
|
-
content.setAttribute(this.uuidAttrName, uuid);
|
1464
|
-
if (this.popInstanceList.length > 0) {
|
1465
|
-
showMask && this.bKMaskManagerInstance.backupContentElement(this.popInstanceList.slice(-1)[0].content);
|
1466
|
-
}
|
1467
|
-
this.popInstanceList.push({
|
1468
|
-
uuid: uuid,
|
1469
|
-
zIndex: zIndex,
|
1470
|
-
content: content,
|
1471
|
-
showMask: showMask,
|
1472
|
-
appendStyle: appendStyle
|
1473
|
-
});
|
1474
|
-
this.bKMaskManagerInstance.show(content, zIndex, showMask, appendStyle, uuid, transfer, onMaskClick, this.uniqId);
|
1475
|
-
}
|
1476
|
-
/**
|
1477
|
-
* 销毁指定实例
|
1478
|
-
* @param content 指定实例内容
|
1479
|
-
* @param transfer
|
1480
|
-
*/
|
1481
|
-
}, {
|
1482
|
-
key: "destroy",
|
1483
|
-
value: function destroy(content) {
|
1484
|
-
var transfer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
1485
|
-
this.clickFn = undefined;
|
1486
|
-
this.hide(content, transfer);
|
1487
|
-
}
|
1488
|
-
/**
|
1489
|
-
* 关闭最后一个弹窗 如果当前还有父级弹窗,则激活父级弹窗
|
1490
|
-
* @param removeLastContent 默认:true 是否自动关闭最后一个弹窗实例 某些场景下,已经主动关闭最后一个弹窗,此处只需要处理其他逻辑
|
1491
|
-
*/
|
1492
|
-
}, {
|
1493
|
-
key: "popHide",
|
1494
|
-
value: function popHide() {
|
1495
|
-
var removeLastContent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
1496
|
-
if (this.popInstanceList.length) {
|
1497
|
-
if (removeLastContent) {
|
1498
|
-
var lastItem = this.popInstanceList.pop();
|
1499
|
-
this.bKMaskManagerInstance.popIndexStore(lastItem.uuid);
|
1500
|
-
lastItem.remove();
|
1501
|
-
}
|
1502
|
-
if (this.popInstanceList.length) {
|
1503
|
-
var activeItem = this.popInstanceList.slice(-1)[0];
|
1504
|
-
var zIndex = activeItem.zIndex,
|
1505
|
-
content = activeItem.content,
|
1506
|
-
showMask = activeItem.showMask,
|
1507
|
-
appendStyle = activeItem.appendStyle,
|
1508
|
-
uuid = activeItem.uuid;
|
1509
|
-
this.bKMaskManagerInstance.show(content, zIndex, showMask, appendStyle, uuid);
|
1510
|
-
} else {
|
1511
|
-
this.bKMaskManagerInstance.hide();
|
1512
|
-
// this.clickFn.length = 0;
|
1513
|
-
}
|
1514
|
-
}
|
1515
|
-
}
|
1516
|
-
/**
|
1517
|
-
* 关闭指定弹窗
|
1518
|
-
* @param content { HTMLElement } 关闭弹窗内容
|
1519
|
-
* **/
|
1520
|
-
}, {
|
1521
|
-
key: "hide",
|
1522
|
-
value: function hide(content) {
|
1523
|
-
var transfer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
1524
|
-
/** 检查当前实例是否存在于已缓存列表 */
|
1525
|
-
var uuid = content === null || content === void 0 ? void 0 : content.getAttribute(this.uuidAttrName);
|
1526
|
-
if (uuid) {
|
1527
|
-
var itemIndex = this.popInstanceList.findIndex(function (item) {
|
1528
|
-
return item.uuid === uuid;
|
1529
|
-
});
|
1530
|
-
if (itemIndex >= 0) {
|
1531
|
-
if (!transfer) this.popInstanceList[itemIndex].content.remove();
|
1532
|
-
this.popInstanceList.splice(itemIndex, 1);
|
1533
|
-
this.bKMaskManagerInstance.popIndexStore(uuid);
|
1534
|
-
if (!this.popInstanceList.length) {
|
1535
|
-
this.bKMaskManagerInstance.hide(transfer);
|
1536
|
-
} else {
|
1537
|
-
this.popHide(false);
|
1538
|
-
}
|
1539
|
-
}
|
1540
|
-
} else {
|
1541
|
-
content === null || content === void 0 ? void 0 : content.remove();
|
1542
|
-
}
|
1543
|
-
this.bKMaskManagerInstance.removeClickEvent();
|
1544
|
-
}
|
1545
|
-
}, {
|
1546
|
-
key: "removeLastEvent",
|
1547
|
-
value: function removeLastEvent() {
|
1548
|
-
this.bKMaskManagerInstance.destroyEvent(this.uniqId);
|
1549
|
-
}
|
1550
|
-
}, {
|
1551
|
-
key: "onMaskClickFn",
|
1552
|
-
value: function onMaskClickFn(e) {
|
1553
|
-
if (this.clickFn) {
|
1554
|
-
var fn = this.clickFn.fn;
|
1555
|
-
if (fn) {
|
1556
|
-
Reflect.apply(fn, this, [e]);
|
1557
|
-
}
|
1558
|
-
}
|
1559
|
-
}
|
1560
|
-
}]);
|
1561
|
-
return BKPopIndexManager;
|
1562
|
-
}();
|
1563
|
-
var bkPopIndexManager = new BKPopIndexManager();
|
1564
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
1565
|
-
function _arrayLikeToArray(arr, len) {
|
1566
|
-
if (len == null || len > arr.length) len = arr.length;
|
1567
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
1568
|
-
return arr2;
|
1569
|
-
}
|
1570
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
1571
|
-
|
1572
|
-
function _arrayWithoutHoles(arr) {
|
1573
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
1574
|
-
}
|
1575
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
1576
|
-
function _iterableToArray(iter) {
|
1577
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
1578
|
-
}
|
1579
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
1580
|
-
|
1581
|
-
function _unsupportedIterableToArray(o, minLen) {
|
1582
|
-
if (!o) return;
|
1583
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
1584
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
1585
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
1586
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
1587
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
1588
|
-
}
|
1589
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
1590
|
-
function _nonIterableSpread() {
|
1591
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
1592
|
-
}
|
1593
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
function _toConsumableArray(arr) {
|
1599
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
1600
|
-
}
|
1601
|
-
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/native.js
|
1602
|
-
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
1603
|
-
/* harmony default export */ const esm_browser_native = ({
|
1604
|
-
randomUUID
|
1605
|
-
});
|
1606
|
-
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
|
1607
|
-
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
1608
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
1609
|
-
// generators (like Math.random()).
|
1610
|
-
let getRandomValues;
|
1611
|
-
const rnds8 = new Uint8Array(16);
|
1612
|
-
function rng() {
|
1613
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
1614
|
-
if (!getRandomValues) {
|
1615
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
1616
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
1617
|
-
|
1618
|
-
if (!getRandomValues) {
|
1619
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
1620
|
-
}
|
1621
|
-
}
|
1622
|
-
|
1623
|
-
return getRandomValues(rnds8);
|
1624
|
-
}
|
1625
|
-
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
|
1626
|
-
|
1627
|
-
/**
|
1628
|
-
* Convert array of 16 byte values to UUID string format of the form:
|
1629
|
-
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
1630
|
-
*/
|
1631
|
-
|
1632
|
-
const byteToHex = [];
|
1633
|
-
|
1634
|
-
for (let i = 0; i < 256; ++i) {
|
1635
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
1636
|
-
}
|
1637
|
-
|
1638
|
-
function unsafeStringify(arr, offset = 0) {
|
1639
|
-
// Note: Be careful editing this code! It's been tuned for performance
|
1640
|
-
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
1641
|
-
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
1642
|
-
}
|
1643
|
-
|
1644
|
-
function stringify(arr, offset = 0) {
|
1645
|
-
const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one
|
1646
|
-
// of the following:
|
1647
|
-
// - One or more input array values don't map to a hex octet (leading to
|
1648
|
-
// "undefined" in the uuid)
|
1649
|
-
// - Invalid input values for the RFC `version` or `variant` fields
|
1650
|
-
|
1651
|
-
if (!validate(uuid)) {
|
1652
|
-
throw TypeError('Stringified UUID is invalid');
|
1653
|
-
}
|
1654
|
-
|
1655
|
-
return uuid;
|
1656
|
-
}
|
1657
|
-
|
1658
|
-
/* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
|
1659
|
-
;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
function v4(options, buf, offset) {
|
1665
|
-
if (esm_browser_native.randomUUID && !buf && !options) {
|
1666
|
-
return esm_browser_native.randomUUID();
|
1667
|
-
}
|
1668
|
-
|
1669
|
-
options = options || {};
|
1670
|
-
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
1671
|
-
|
1672
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
1673
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
1674
|
-
|
1675
|
-
if (buf) {
|
1676
|
-
offset = offset || 0;
|
1677
|
-
|
1678
|
-
for (let i = 0; i < 16; ++i) {
|
1679
|
-
buf[offset + i] = rnds[i];
|
1680
|
-
}
|
1681
|
-
|
1682
|
-
return buf;
|
1683
|
-
}
|
1684
|
-
|
1685
|
-
return unsafeStringify(rnds);
|
1686
|
-
}
|
1687
|
-
|
1688
|
-
/* harmony default export */ const esm_browser_v4 = (v4);
|
1689
|
-
;// CONCATENATED MODULE: external "@popperjs/core"
|
1690
|
-
var core_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1691
|
-
var core_y = x => () => x
|
1692
|
-
const core_namespaceObject = core_x({ ["createPopper"]: () => __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__.createPopper });
|
1693
|
-
;// CONCATENATED MODULE: ../../packages/shared/src/popover.ts
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
/*
|
740
|
+
|
741
|
+
|
742
|
+
|
743
|
+
/*
|
1700
744
|
* Tencent is pleased to support the open source community by making
|
1701
745
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1702
746
|
*
|
@@ -2091,53 +1135,168 @@ var getPopContainerId = function getPopContainerId() {
|
|
2091
1135
|
popContainer.setAttribute('data-popper-id', popContainerId);
|
2092
1136
|
document.body.append(popContainer);
|
2093
1137
|
}
|
2094
|
-
return "".concat(prefix).concat(popContainerId);
|
1138
|
+
return "".concat(prefix).concat(popContainerId);
|
1139
|
+
};
|
1140
|
+
;// CONCATENATED MODULE: ../../packages/shared/src/scrollbar-width.ts
|
1141
|
+
/*
|
1142
|
+
* Tencent is pleased to support the open source community by making
|
1143
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1144
|
+
*
|
1145
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1146
|
+
*
|
1147
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1148
|
+
*
|
1149
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1150
|
+
*
|
1151
|
+
* ---------------------------------------------------
|
1152
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1153
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1154
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1155
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1156
|
+
*
|
1157
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1158
|
+
* the Software.
|
1159
|
+
*
|
1160
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1161
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1162
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1163
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1164
|
+
* IN THE SOFTWARE.
|
1165
|
+
*/
|
1166
|
+
var scrollBarWidth;
|
1167
|
+
function scrollbarWidth() {
|
1168
|
+
if (scrollBarWidth !== undefined) return scrollBarWidth;
|
1169
|
+
var outer = document.createElement('div');
|
1170
|
+
outer.className = 'bk-scrollbar-wrap';
|
1171
|
+
outer.style.visibility = 'hidden';
|
1172
|
+
outer.style.width = '100px';
|
1173
|
+
outer.style.position = 'absolute';
|
1174
|
+
outer.style.top = '-9999px';
|
1175
|
+
document.body.appendChild(outer);
|
1176
|
+
var widthNoScroll = outer.offsetWidth;
|
1177
|
+
outer.style.overflow = 'scroll';
|
1178
|
+
var inner = document.createElement('div');
|
1179
|
+
inner.style.width = '100%';
|
1180
|
+
outer.appendChild(inner);
|
1181
|
+
var widthWithScroll = inner.offsetWidth;
|
1182
|
+
outer.parentNode.removeChild(outer);
|
1183
|
+
scrollBarWidth = widthNoScroll - widthWithScroll;
|
1184
|
+
return scrollBarWidth;
|
1185
|
+
}
|
1186
|
+
;// CONCATENATED MODULE: external "lodash/throttle"
|
1187
|
+
var throttle_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1188
|
+
var throttle_y = x => () => x
|
1189
|
+
const throttle_namespaceObject = throttle_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a__["default"] });
|
1190
|
+
;// CONCATENATED MODULE: ../../packages/shared/src/utils.ts
|
1191
|
+
/*
|
1192
|
+
* Tencent is pleased to support the open source community by making
|
1193
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1194
|
+
*
|
1195
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1196
|
+
*
|
1197
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1198
|
+
*
|
1199
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1200
|
+
*
|
1201
|
+
* ---------------------------------------------------
|
1202
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1203
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1204
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1205
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1206
|
+
*
|
1207
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1208
|
+
* the Software.
|
1209
|
+
*
|
1210
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1211
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1212
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1213
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1214
|
+
* IN THE SOFTWARE.
|
1215
|
+
*/
|
1216
|
+
|
1217
|
+
var lowerStr = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
1218
|
+
/**
|
1219
|
+
* 生成n位长度的字符串
|
1220
|
+
* @param {Number} n
|
1221
|
+
* @param str,默认26位字母及数字
|
1222
|
+
*/
|
1223
|
+
var random = function random(n) {
|
1224
|
+
var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : lowerStr;
|
1225
|
+
var result = '';
|
1226
|
+
for (var i = 0; i < n; i++) {
|
1227
|
+
result += str[parseInt((Math.random() * str.length).toString(), 10)];
|
1228
|
+
}
|
1229
|
+
return result;
|
1230
|
+
};
|
1231
|
+
/**
|
1232
|
+
* 监听目标元素的Resize事件
|
1233
|
+
* @param root 目标元素
|
1234
|
+
* @param callbackFn 执行函数
|
1235
|
+
* @param delay 延迟执行时间,默认 60
|
1236
|
+
* @param immediate 是否立即执行回调函数
|
1237
|
+
* @returns "{ start: () => void, stop: () => void }"
|
1238
|
+
*/
|
1239
|
+
var observerResize = function observerResize(root, callbackFn) {
|
1240
|
+
var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
|
1241
|
+
var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
1242
|
+
var callFn = (0,throttle_namespaceObject["default"])(function () {
|
1243
|
+
if (typeof callbackFn === 'function') {
|
1244
|
+
callbackFn();
|
1245
|
+
}
|
1246
|
+
}, delay);
|
1247
|
+
var resizeObserver = new ResizeObserver(function () {
|
1248
|
+
callFn();
|
1249
|
+
});
|
1250
|
+
if (immediate) {
|
1251
|
+
if (typeof callbackFn === 'function') {
|
1252
|
+
callbackFn();
|
1253
|
+
}
|
1254
|
+
}
|
1255
|
+
return {
|
1256
|
+
start: function start() {
|
1257
|
+
resizeObserver.observe(root);
|
1258
|
+
},
|
1259
|
+
stop: function stop() {
|
1260
|
+
resizeObserver.disconnect();
|
1261
|
+
resizeObserver.unobserve(root);
|
1262
|
+
}
|
1263
|
+
};
|
2095
1264
|
};
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
*
|
2101
|
-
*
|
2102
|
-
*
|
2103
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
2104
|
-
*
|
2105
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
2106
|
-
*
|
2107
|
-
* ---------------------------------------------------
|
2108
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
2109
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
2110
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
2111
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
2112
|
-
*
|
2113
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
2114
|
-
* the Software.
|
2115
|
-
*
|
2116
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
2117
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
2118
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
2119
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2120
|
-
* IN THE SOFTWARE.
|
1265
|
+
var capitalize = function capitalize(str) {
|
1266
|
+
return str[0].toUpperCase() + str.slice(1);
|
1267
|
+
};
|
1268
|
+
/**
|
1269
|
+
* 判断元素是否溢出容器
|
1270
|
+
* @param {*} el
|
1271
|
+
* @returns
|
2121
1272
|
*/
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
1273
|
+
function checkOverflow(el) {
|
1274
|
+
if (!el) return false;
|
1275
|
+
var createDom = function createDom(el, css) {
|
1276
|
+
var dom = document.createElement('div');
|
1277
|
+
var width = parseFloat(css.width) ? "".concat(Math.ceil(parseFloat(css.width)), "px") : css.width;
|
1278
|
+
dom.style.cssText = "\n width: ".concat(width, ";\n line-height: ").concat(css['line-height'], ";\n font-size: ").concat(css['font-size'], ";\n word-break: ").concat(css['word-break'], ";\n padding: ").concat(css.padding, ";\n ");
|
1279
|
+
dom.textContent = el.textContent;
|
1280
|
+
return dom;
|
1281
|
+
};
|
1282
|
+
var isOverflow = false;
|
1283
|
+
try {
|
1284
|
+
var css = window.getComputedStyle(el, null);
|
1285
|
+
var lineClamp = css.webkitLineClamp;
|
1286
|
+
if (lineClamp !== 'none') {
|
1287
|
+
var targetHeight = parseFloat(css.height);
|
1288
|
+
var dom = createDom(el, css);
|
1289
|
+
document.body.appendChild(dom);
|
1290
|
+
var domHeight = window.getComputedStyle(dom, null).height;
|
1291
|
+
document.body.removeChild(dom);
|
1292
|
+
isOverflow = targetHeight < parseFloat(domHeight);
|
1293
|
+
} else {
|
1294
|
+
isOverflow = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight;
|
1295
|
+
}
|
1296
|
+
} catch (e) {
|
1297
|
+
console.warn('There is an error when check element overflow state: ', e);
|
1298
|
+
}
|
1299
|
+
return isOverflow;
|
2141
1300
|
}
|
2142
1301
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
2143
1302
|
function _setPrototypeOf(o, p) {
|
@@ -2471,10 +1630,163 @@ var SelectedTypeEnum;
|
|
2471
1630
|
function SelectedType() {
|
2472
1631
|
return (0,external_vue_types_namespaceObject.toType)('selectedStyle', {}).def(SelectedTypeEnum.CHECK);
|
2473
1632
|
}
|
1633
|
+
;// CONCATENATED MODULE: ../../packages/shared/src/z-index-manager.ts
|
1634
|
+
|
1635
|
+
|
1636
|
+
|
1637
|
+
var _BKLAYERD_INDEX_EFAUL;
|
1638
|
+
/**
|
1639
|
+
* Tencent is pleased to support the open source community by making
|
1640
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1641
|
+
*
|
1642
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1643
|
+
*
|
1644
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1645
|
+
*
|
1646
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1647
|
+
*
|
1648
|
+
* ---------------------------------------------------
|
1649
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1650
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1651
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1652
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1653
|
+
*
|
1654
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1655
|
+
* the Software.
|
1656
|
+
*
|
1657
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1658
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1659
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1660
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1661
|
+
* IN THE SOFTWARE.
|
1662
|
+
*/
|
1663
|
+
/**
|
1664
|
+
* 页面框架层级
|
1665
|
+
*/
|
1666
|
+
var BKLAYERTYPE;
|
1667
|
+
(function (BKLAYERTYPE) {
|
1668
|
+
/** 网站内容的背景、拓扑的画布等 */
|
1669
|
+
BKLAYERTYPE["BOTTOM"] = "bottom";
|
1670
|
+
/** 页面呈现的各类内容 */
|
1671
|
+
BKLAYERTYPE["CONTENT"] = "content";
|
1672
|
+
/** 顶部导航、侧边导航以及用户信息等 */
|
1673
|
+
BKLAYERTYPE["NAVI"] = "navi";
|
1674
|
+
/** 页面需全屏操作的部分功能或编辑器的全屏模式 */
|
1675
|
+
BKLAYERTYPE["FULLSCREEN"] = "fullScreen";
|
1676
|
+
/** 各类功能插件 */
|
1677
|
+
BKLAYERTYPE["PLUGINS"] = "plugins";
|
1678
|
+
/** 各类弹窗或抽屉(非模态弹窗不考虑) */
|
1679
|
+
BKLAYERTYPE["MODAL"] = "modal";
|
1680
|
+
/** 各类消息提示 */
|
1681
|
+
BKLAYERTYPE["MESSAGE"] = "message";
|
1682
|
+
/** 各类popper提示 */
|
1683
|
+
BKLAYERTYPE["POPPER"] = "popper";
|
1684
|
+
})(BKLAYERTYPE || (BKLAYERTYPE = {}));
|
1685
|
+
/** 定义不同分层默认值 */
|
1686
|
+
var BKLAYERD_INDEX_EFAULT_VALUE = (_BKLAYERD_INDEX_EFAUL = {}, _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.BOTTOM, 0), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.CONTENT, 1), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.NAVI, 100), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.FULLSCREEN, 1000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.MODAL, 2000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.PLUGINS, 5000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.MESSAGE, 6000), _defineProperty(_BKLAYERD_INDEX_EFAUL, BKLAYERTYPE.POPPER, 8000), _BKLAYERD_INDEX_EFAUL);
|
1687
|
+
var BKZIndexManager = /*#__PURE__*/function () {
|
1688
|
+
function BKZIndexManager() {
|
1689
|
+
_classCallCheck(this, BKZIndexManager);
|
1690
|
+
_defineProperty(this, "storageLayerIndexValue", {});
|
1691
|
+
this.copyDefaultValue();
|
1692
|
+
}
|
1693
|
+
/**
|
1694
|
+
*
|
1695
|
+
* @param type
|
1696
|
+
* @returns
|
1697
|
+
*/
|
1698
|
+
_createClass(BKZIndexManager, [{
|
1699
|
+
key: "getNextIndex",
|
1700
|
+
value: function getNextIndex(type) {
|
1701
|
+
if (Object.prototype.hasOwnProperty.call(this.storageLayerIndexValue, type)) {
|
1702
|
+
this.storageLayerIndexValue[type] = this.storageLayerIndexValue[type] + 1;
|
1703
|
+
return this.storageLayerIndexValue[type];
|
1704
|
+
}
|
1705
|
+
this.storageLayerIndexValue[BKLAYERTYPE.MODAL] = this.storageLayerIndexValue[BKLAYERTYPE.MODAL] + 1;
|
1706
|
+
return this.storageLayerIndexValue[BKLAYERTYPE.MODAL];
|
1707
|
+
}
|
1708
|
+
/** 获取弹窗类型最新zIndex的值 */
|
1709
|
+
}, {
|
1710
|
+
key: "getModalNextIndex",
|
1711
|
+
value: function getModalNextIndex() {
|
1712
|
+
return this.getNextIndex(BKLAYERTYPE.MODAL);
|
1713
|
+
}
|
1714
|
+
/** 获取Message类型最新zIndex的值 */
|
1715
|
+
}, {
|
1716
|
+
key: "getMessageNextIndex",
|
1717
|
+
value: function getMessageNextIndex() {
|
1718
|
+
return this.getNextIndex(BKLAYERTYPE.MESSAGE);
|
1719
|
+
}
|
1720
|
+
/** 获取全屏类型最新zIndex的值 */
|
1721
|
+
}, {
|
1722
|
+
key: "getFullScreenNextIndex",
|
1723
|
+
value: function getFullScreenNextIndex() {
|
1724
|
+
return this.getNextIndex(BKLAYERTYPE.FULLSCREEN);
|
1725
|
+
}
|
1726
|
+
/** 获取导航类型最新zIndex的值 */
|
1727
|
+
}, {
|
1728
|
+
key: "getNaviNextIndex",
|
1729
|
+
value: function getNaviNextIndex() {
|
1730
|
+
return this.getNextIndex(BKLAYERTYPE.NAVI);
|
1731
|
+
}
|
1732
|
+
/** 获取导航类型最新zIndex的值 */
|
1733
|
+
}, {
|
1734
|
+
key: "getPopperIndex",
|
1735
|
+
value: function getPopperIndex() {
|
1736
|
+
return this.getNextIndex(BKLAYERTYPE.POPPER);
|
1737
|
+
}
|
1738
|
+
/**
|
1739
|
+
* 更新自定义默认zIndex配置
|
1740
|
+
* @param config 配置项
|
1741
|
+
*/
|
1742
|
+
}, {
|
1743
|
+
key: "setDefaultZIndex",
|
1744
|
+
value: function setDefaultZIndex(config) {
|
1745
|
+
var _this = this;
|
1746
|
+
Object.keys(config || {}).forEach(function (key) {
|
1747
|
+
if (Object.prototype.hasOwnProperty.call(_this.storageLayerIndexValue.__proto__, key)) {
|
1748
|
+
Object.assign(_this.storageLayerIndexValue.__proto__, _defineProperty({}, key, config[key]));
|
1749
|
+
}
|
1750
|
+
});
|
1751
|
+
this.copyDefaultValue();
|
1752
|
+
}
|
1753
|
+
/**
|
1754
|
+
* 重置zIndex
|
1755
|
+
* @param config 配置项
|
1756
|
+
*/
|
1757
|
+
}, {
|
1758
|
+
key: "resetZIndex",
|
1759
|
+
value: function resetZIndex(config) {
|
1760
|
+
var _this2 = this;
|
1761
|
+
Object.keys(config || {}).forEach(function (key) {
|
1762
|
+
if (Object.prototype.hasOwnProperty.call(_this2.storageLayerIndexValue, key)) {
|
1763
|
+
Object.assign(_this2.storageLayerIndexValue, _defineProperty({}, key, config[key]));
|
1764
|
+
}
|
1765
|
+
});
|
1766
|
+
}
|
1767
|
+
/**
|
1768
|
+
* 根据默认设置创建副本
|
1769
|
+
*/
|
1770
|
+
}, {
|
1771
|
+
key: "copyDefaultValue",
|
1772
|
+
value: function copyDefaultValue() {
|
1773
|
+
var properties = Object.keys(BKLAYERD_INDEX_EFAULT_VALUE).reduce(function (props, key) {
|
1774
|
+
return Object.assign(props, _defineProperty({}, key, {
|
1775
|
+
value: BKLAYERD_INDEX_EFAULT_VALUE[key],
|
1776
|
+
writable: true,
|
1777
|
+
configurable: true
|
1778
|
+
}));
|
1779
|
+
}, {});
|
1780
|
+
this.storageLayerIndexValue = Object.create(BKLAYERD_INDEX_EFAULT_VALUE, properties);
|
1781
|
+
}
|
1782
|
+
}]);
|
1783
|
+
return BKZIndexManager;
|
1784
|
+
}();
|
1785
|
+
var bkZIndexManager = new BKZIndexManager();
|
2474
1786
|
;// CONCATENATED MODULE: ../../packages/shared/src/mask.ts
|
2475
1787
|
|
2476
|
-
function
|
2477
|
-
function
|
1788
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
1789
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
2478
1790
|
var instanceStore = new WeakMap();
|
2479
1791
|
var activeModal;
|
2480
1792
|
var loopSetMaskStyle = function loopSetMaskStyle(modal, show) {
|
@@ -2493,7 +1805,7 @@ var showMask = function showMask(options) {
|
|
2493
1805
|
return;
|
2494
1806
|
}
|
2495
1807
|
if (!instanceStore.has(options.el)) {
|
2496
|
-
instanceStore.set(options.el,
|
1808
|
+
instanceStore.set(options.el, _objectSpread(_objectSpread({}, options), {}, {
|
2497
1809
|
referenceParent: activeModal
|
2498
1810
|
}));
|
2499
1811
|
}
|
@@ -2524,8 +1836,6 @@ var mask = {
|
|
2524
1836
|
|
2525
1837
|
|
2526
1838
|
|
2527
|
-
|
2528
|
-
|
2529
1839
|
function classes(dynamicCls) {
|
2530
1840
|
var constCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
2531
1841
|
return Object.entries(dynamicCls).filter(function (entry) {
|
@@ -2652,9 +1962,7 @@ function arrayEqual() {
|
|
2652
1962
|
var __webpack_exports__AlignEnum = __webpack_exports__.oY;
|
2653
1963
|
var __webpack_exports__BKLAYERD_INDEX_EFAULT_VALUE = __webpack_exports__.p3;
|
2654
1964
|
var __webpack_exports__BKLAYERTYPE = __webpack_exports__.Ql;
|
2655
|
-
var __webpack_exports__BKPopIndexManager = __webpack_exports__.Eo;
|
2656
1965
|
var __webpack_exports__BKPopover = __webpack_exports__.mZ;
|
2657
|
-
var __webpack_exports__BkMaskManager = __webpack_exports__.Wg;
|
2658
1966
|
var __webpack_exports__DialogTypeEnum = __webpack_exports__._D;
|
2659
1967
|
var __webpack_exports__DirectionEnum = __webpack_exports__.dq;
|
2660
1968
|
var __webpack_exports__EMPTY_OBJ = __webpack_exports__.kT;
|
@@ -2681,8 +1989,6 @@ var __webpack_exports__ThemeEnum = __webpack_exports__.bY;
|
|
2681
1989
|
var __webpack_exports__TriggerEnum = __webpack_exports__.os;
|
2682
1990
|
var __webpack_exports__alignType = __webpack_exports__.WW;
|
2683
1991
|
var __webpack_exports__arrayEqual = __webpack_exports__.h6;
|
2684
|
-
var __webpack_exports__bKMaskManager = __webpack_exports__.Lx;
|
2685
|
-
var __webpack_exports__bkPopIndexManager = __webpack_exports__.aR;
|
2686
1992
|
var __webpack_exports__bkZIndexManager = __webpack_exports__.ue;
|
2687
1993
|
var __webpack_exports__capitalize = __webpack_exports__.kC;
|
2688
1994
|
var __webpack_exports__checkOverflow = __webpack_exports__.ao;
|
@@ -2731,4 +2037,4 @@ var __webpack_exports__useFormItem = __webpack_exports__.A9;
|
|
2731
2037
|
var __webpack_exports__valueOrDefault = __webpack_exports__.Be;
|
2732
2038
|
var __webpack_exports__withInstall = __webpack_exports__.nz;
|
2733
2039
|
var __webpack_exports__withInstallProps = __webpack_exports__.B;
|
2734
|
-
export { __webpack_exports__AlignEnum as AlignEnum, __webpack_exports__BKLAYERD_INDEX_EFAULT_VALUE as BKLAYERD_INDEX_EFAULT_VALUE, __webpack_exports__BKLAYERTYPE as BKLAYERTYPE,
|
2040
|
+
export { __webpack_exports__AlignEnum as AlignEnum, __webpack_exports__BKLAYERD_INDEX_EFAULT_VALUE as BKLAYERD_INDEX_EFAULT_VALUE, __webpack_exports__BKLAYERTYPE as BKLAYERTYPE, __webpack_exports__BKPopover as BKPopover, __webpack_exports__DialogTypeEnum as DialogTypeEnum, __webpack_exports__DirectionEnum as DirectionEnum, __webpack_exports__EMPTY_OBJ as EMPTY_OBJ, __webpack_exports__InputBehaviorEnum as InputBehaviorEnum, __webpack_exports__InputBehaviorType as InputBehaviorType, __webpack_exports__LineStyleEnum as LineStyleEnum, __webpack_exports__PlacementEnum as PlacementEnum, __webpack_exports__Placements as Placements, __webpack_exports__ProgressEnum as ProgressEnum, __webpack_exports__ProgressStrokeLineCapEnum as ProgressStrokeLineCapEnum, __webpack_exports__ProgressStrokeLineCapType as ProgressStrokeLineCapType, __webpack_exports__ProgressType as ProgressType, __webpack_exports__PropTypes as PropTypes, __webpack_exports__RenderDirectiveEnum as RenderDirectiveEnum, __webpack_exports__RenderType as RenderType, __webpack_exports__SelectedType as SelectedType, __webpack_exports__SelectedTypeEnum as SelectedTypeEnum, __webpack_exports__SizeEnum as SizeEnum, __webpack_exports__SwitcherThemeEnum as SwitcherThemeEnum, __webpack_exports__SwitcherThemeType as SwitcherThemeType, __webpack_exports__TagThemeEnum as TagThemeEnum, __webpack_exports__TagThemeType as TagThemeType, __webpack_exports__ThemeEnum as ThemeEnum, __webpack_exports__TriggerEnum as TriggerEnum, __webpack_exports__alignType as alignType, __webpack_exports__arrayEqual as arrayEqual, __webpack_exports__bkZIndexManager as bkZIndexManager, __webpack_exports__capitalize as capitalize, __webpack_exports__checkOverflow as checkOverflow, __webpack_exports__classes as classes, __webpack_exports__clone as clone, __webpack_exports__debounce as debounce, __webpack_exports__dialogTypeUnion as dialogTypeUnion, __webpack_exports__directionType as directionType, __webpack_exports__elementsEqual as elementsEqual, __webpack_exports__filterProperty as filterProperty, __webpack_exports__finiteOrDefault as finiteOrDefault, __webpack_exports__formItemKey as formItemKey, __webpack_exports__formKey as formKey, __webpack_exports__getPopContainerId as getPopContainerId, __webpack_exports__hasOverflowEllipsis as hasOverflowEllipsis, __webpack_exports__isArray as isArray, __webpack_exports__isElement as isElement, __webpack_exports__isEmpty as isEmpty, __webpack_exports__isEmptyObj as isEmptyObj, __webpack_exports__isFinite as isFinite, __webpack_exports__isNullOrUndef as isNullOrUndef, __webpack_exports__isObject as isObject, __webpack_exports__lineStyleType as lineStyleType, __webpack_exports__mask as mask, __webpack_exports__maybeShowTooltip as maybeShowTooltip, __webpack_exports__merge as merge, __webpack_exports__mergeIf as mergeIf, __webpack_exports__mergerFn as mergerFn, __webpack_exports__mergerIfFn as mergerIfFn, __webpack_exports__noop as noop, __webpack_exports__observerResize as observerResize, __webpack_exports__off as off, __webpack_exports__on as on, __webpack_exports__placementType as placementType, __webpack_exports__random as random, __webpack_exports__renderDirectiveType as renderDirectiveType, __webpack_exports__renderEmptyVNode as renderEmptyVNode, __webpack_exports__renderType as renderType, __webpack_exports__resolveClassName as resolveClassName, __webpack_exports__scrollTop as scrollTop, __webpack_exports__scrollbarWidth as scrollbarWidth, __webpack_exports__stringEnum as stringEnum, __webpack_exports__triggerType as triggerType, __webpack_exports__useForm as useForm, __webpack_exports__useFormItem as useFormItem, __webpack_exports__valueOrDefault as valueOrDefault, __webpack_exports__withInstall as withInstall, __webpack_exports__withInstallProps as withInstallProps };
|