bkui-vue 3.0.8 → 3.0.9

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.
@@ -152,7 +152,9 @@ function _defineProperty(e, r, t) {
152
152
  arrow: false,
153
153
  placement: this.placement,
154
154
  isShow: this.isShow,
155
- disabled: this.disabled
155
+ disabled: this.disabled,
156
+ // 点击菜单项后收起,避免随后打开的 Dialog 被 Dropdown(更高 z-index)挡住
157
+ clickContentAutoHide: true
156
158
  };
157
159
  var popoverOptions = __WEBPACK_EXTERNAL_MODULE_lodash_merge_cf99375a_default__(basePopoverOptions, this.popoverOptions);
158
160
  return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
package/lib/index.js CHANGED
@@ -3,5 +3,5 @@ export * from './hooks';
3
3
  export { default } from './preset';
4
4
  export * from './config-provider';
5
5
  export * from './directives';
6
- export const version = "3.0.8";
6
+ export const version = "3.0.9";
7
7
  window.__bkui_vue_version__ = version;
@@ -1,6 +1,6 @@
1
1
  import "../styles/reset.css";
2
2
  import "./modal.less";
3
- import { PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, bkZIndexManager as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_bkZIndexManager__, renderDirectiveType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_renderDirectiveType__, withInstallProps as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstallProps__ } from "../shared";
3
+ import { PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, bkZIndexManager as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_bkZIndexManager__, hidePopoversOutside as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_hidePopoversOutside__, renderDirectiveType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_renderDirectiveType__, withInstallProps as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstallProps__ } from "../shared";
4
4
  import { Teleport as __WEBPACK_EXTERNAL_MODULE_vue_Teleport__, Transition as __WEBPACK_EXTERNAL_MODULE_vue_Transition__, computed as __WEBPACK_EXTERNAL_MODULE_vue_computed__, createVNode as __WEBPACK_EXTERNAL_MODULE_vue_createVNode__, defineComponent as __WEBPACK_EXTERNAL_MODULE_vue_defineComponent__, mergeProps as __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__, onBeforeUnmount as __WEBPACK_EXTERNAL_MODULE_vue_onBeforeUnmount__, onMounted as __WEBPACK_EXTERNAL_MODULE_vue_onMounted__, ref as __WEBPACK_EXTERNAL_MODULE_vue_ref__, useAttrs as __WEBPACK_EXTERNAL_MODULE_vue_useAttrs__, useSlots as __WEBPACK_EXTERNAL_MODULE_vue_useSlots__, vShow as __WEBPACK_EXTERNAL_MODULE_vue_vShow__, watch as __WEBPACK_EXTERNAL_MODULE_vue_watch__, withDirectives as __WEBPACK_EXTERNAL_MODULE_vue_withDirectives__ } from "vue";
5
5
  import { usePrefix as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__ } from "../config-provider";
6
6
  import { default as __WEBPACK_EXTERNAL_MODULE_lodash_throttle_a7b7506a_default__ } from "lodash/throttle";
@@ -339,6 +339,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
339
339
  var localShow = __WEBPACK_EXTERNAL_MODULE_vue_ref__(props.isShow);
340
340
  var zIndex = __WEBPACK_EXTERNAL_MODULE_vue_ref__(props.zIndex);
341
341
  var initRendered = __WEBPACK_EXTERNAL_MODULE_vue_ref__(false);
342
+ var showTimer;
342
343
  var _useContentResize = useContentResize(rootRef, resizeTargetRef, props),
343
344
  contentStyles = _useContentResize.contentStyles,
344
345
  isContentScroll = _useContentResize.isContentScroll;
@@ -362,13 +363,22 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
362
363
  }, function () {
363
364
  if (props.isShow) {
364
365
  initRendered.value = true;
365
- setTimeout(function () {
366
+ showTimer = setTimeout(function () {
367
+ showTimer = undefined;
366
368
  zIndex.value = props.zIndex || __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_bkZIndexManager__.getModalNextIndex();
367
369
  props.showMask && mask.showMask(maskRef.value);
368
370
  ctx.emit('shown');
369
371
  localShow.value = true;
372
+ // Dropdown / Popover 默认层级高于 Modal,先收起页面上未挂在当前弹窗内的弹出层
373
+ if (rootRef.value) {
374
+ __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_hidePopoversOutside__(rootRef.value);
375
+ }
370
376
  });
371
377
  } else if (initRendered.value) {
378
+ if (showTimer !== undefined) {
379
+ clearTimeout(showTimer);
380
+ showTimer = undefined;
381
+ }
372
382
  props.showMask && mask.hideMask(maskRef.value);
373
383
  ctx.emit('hidden');
374
384
  localShow.value = false;
@@ -403,6 +413,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
403
413
  addEventListener('keydown', handleEscClose);
404
414
  });
405
415
  __WEBPACK_EXTERNAL_MODULE_vue_onBeforeUnmount__(function () {
416
+ if (showTimer !== undefined) {
417
+ clearTimeout(showTimer);
418
+ showTimer = undefined;
419
+ }
406
420
  removeEventListener('keydown', handleEscClose);
407
421
  mask.destroyMask(maskRef.value);
408
422
  ctx.emit('hidden');
@@ -1,6 +1,6 @@
1
1
  import "../styles/reset.css";
2
2
  import "./popover.less";
3
- import { PlacementEnum as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PlacementEnum__, PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, RenderType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_RenderType__, bkZIndexManager as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_bkZIndexManager__, placementType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_placementType__, renderDirectiveType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_renderDirectiveType__, renderType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_renderType__, triggerType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_triggerType__, withInstall as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__ } from "../shared";
3
+ import { PlacementEnum as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PlacementEnum__, PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, RenderType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_RenderType__, bkZIndexManager as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_bkZIndexManager__, placementType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_placementType__, registerPopoverOverlay as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_registerPopoverOverlay__, renderDirectiveType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_renderDirectiveType__, renderType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_renderType__, triggerType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_triggerType__, withInstall as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__ } from "../shared";
4
4
  import { Comment as __WEBPACK_EXTERNAL_MODULE_vue_Comment__, Fragment as __WEBPACK_EXTERNAL_MODULE_vue_Fragment__, Teleport as __WEBPACK_EXTERNAL_MODULE_vue_Teleport__, Text as __WEBPACK_EXTERNAL_MODULE_vue_Text__, cloneVNode as __WEBPACK_EXTERNAL_MODULE_vue_cloneVNode__, computed as __WEBPACK_EXTERNAL_MODULE_vue_computed__, createApp as __WEBPACK_EXTERNAL_MODULE_vue_createApp__, createVNode as __WEBPACK_EXTERNAL_MODULE_vue_createVNode__, defineComponent as __WEBPACK_EXTERNAL_MODULE_vue_defineComponent__, getCurrentScope as __WEBPACK_EXTERNAL_MODULE_vue_getCurrentScope__, h as __WEBPACK_EXTERNAL_MODULE_vue_h__, isVNode as __WEBPACK_EXTERNAL_MODULE_vue_isVNode__, mergeProps as __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__, nextTick as __WEBPACK_EXTERNAL_MODULE_vue_nextTick__, onBeforeUnmount as __WEBPACK_EXTERNAL_MODULE_vue_onBeforeUnmount__, onMounted as __WEBPACK_EXTERNAL_MODULE_vue_onMounted__, onScopeDispose as __WEBPACK_EXTERNAL_MODULE_vue_onScopeDispose__, reactive as __WEBPACK_EXTERNAL_MODULE_vue_reactive__, ref as __WEBPACK_EXTERNAL_MODULE_vue_ref__, shallowReadonly as __WEBPACK_EXTERNAL_MODULE_vue_shallowReadonly__, shallowRef as __WEBPACK_EXTERNAL_MODULE_vue_shallowRef__, toRefs as __WEBPACK_EXTERNAL_MODULE_vue_toRefs__, unref as __WEBPACK_EXTERNAL_MODULE_vue_unref__, useAttrs as __WEBPACK_EXTERNAL_MODULE_vue_useAttrs__, watch as __WEBPACK_EXTERNAL_MODULE_vue_watch__ } from "vue";
5
5
  import { useGlobalConfig as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_useGlobalConfig__, usePrefix as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__ } from "../config-provider";
6
6
  import { toType as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a_toType__ } from "vue-types";
@@ -3481,7 +3481,7 @@ var EMIT_EVENTS = {
3481
3481
  }
3482
3482
  }
3483
3483
  }),
3484
- isOpen = _useDelay.isOpen,
3484
+ _isOpen = _useDelay.isOpen,
3485
3485
  show = _useDelay.show,
3486
3486
  hide = _useDelay.hide,
3487
3487
  toggle = _useDelay.toggle,
@@ -3491,11 +3491,18 @@ var EMIT_EVENTS = {
3491
3491
  var b = boundary.value;
3492
3492
  return typeof b === 'function' ? b() : b;
3493
3493
  };
3494
+ var isParentBoundary = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
3495
+ var b = resolveBoundary();
3496
+ return typeof b === 'string' && /^parent$/i.test(b);
3497
+ });
3498
+ var isTeleportDisabled = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
3499
+ return disableTeleport.value || isParentBoundary.value;
3500
+ });
3494
3501
  var floatingStrategy = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
3495
- if (disableTeleport.value) return 'absolute';
3502
+ if (isTeleportDisabled.value) return 'absolute';
3496
3503
  var b = resolveBoundary();
3497
3504
  if (typeof b === 'string') {
3498
- return b === 'body' || b === 'parent' ? 'fixed' : 'absolute';
3505
+ return /^body$/i.test(b) ? 'fixed' : 'absolute';
3499
3506
  }
3500
3507
  if (b === document.body) return 'fixed';
3501
3508
  return 'absolute';
@@ -3511,7 +3518,7 @@ var EMIT_EVENTS = {
3511
3518
  autoVisibility: autoVisibility.value,
3512
3519
  disableTransform: disableTransform.value,
3513
3520
  strategy: floatingStrategy.value,
3514
- isOpen: isOpen.value
3521
+ isOpen: _isOpen.value
3515
3522
  };
3516
3523
  });
3517
3524
  // 更新 floating-ui 定位 reference(避免 computed 缓存导致 DOM 布局变化时 reference 解析不生效)
@@ -3548,7 +3555,7 @@ var EMIT_EVENTS = {
3548
3555
  }, shouldRenderReferenceWrapper], function () {
3549
3556
  __WEBPACK_EXTERNAL_MODULE_vue_nextTick__(updateFloatingReference);
3550
3557
  });
3551
- __WEBPACK_EXTERNAL_MODULE_vue_watch__(isOpen, function (val) {
3558
+ __WEBPACK_EXTERNAL_MODULE_vue_watch__(_isOpen, function (val) {
3552
3559
  if (val) {
3553
3560
  __WEBPACK_EXTERNAL_MODULE_vue_nextTick__(updateFloatingReference);
3554
3561
  }
@@ -3565,7 +3572,7 @@ var EMIT_EVENTS = {
3565
3572
  disabled: disabled.value,
3566
3573
  always: always.value,
3567
3574
  hideIgnoreReference: hideIgnoreReference.value,
3568
- isOpen: isOpen.value
3575
+ isOpen: _isOpen.value
3569
3576
  };
3570
3577
  });
3571
3578
  var _useTrigger = useTrigger(triggerProps, {
@@ -3652,7 +3659,7 @@ var EMIT_EVENTS = {
3652
3659
  if (!(t instanceof HTMLElement)) return;
3653
3660
  if (isTargetInSelfOrChildren(t)) return;
3654
3661
  stopHoverTrack();
3655
- if (isOpen.value) {
3662
+ if (_isOpen.value) {
3656
3663
  hide();
3657
3664
  }
3658
3665
  };
@@ -3697,6 +3704,25 @@ var EMIT_EVENTS = {
3697
3704
  }
3698
3705
  return String(val);
3699
3706
  };
3707
+ // 打开时固定 z-index,避免 computed 重复递增把已展开的 Dropdown 再次抬到 Dialog 之上
3708
+ var localZIndex = __WEBPACK_EXTERNAL_MODULE_vue_ref__(undefined);
3709
+ var assignZIndex = function assignZIndex() {
3710
+ var _zIndex$value;
3711
+ localZIndex.value = (_zIndex$value = zIndex.value) !== null && _zIndex$value !== void 0 ? _zIndex$value : __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_bkZIndexManager__.getPopperIndex();
3712
+ };
3713
+ __WEBPACK_EXTERNAL_MODULE_vue_watch__(_isOpen, function (val) {
3714
+ if (val) {
3715
+ assignZIndex();
3716
+ }
3717
+ }, {
3718
+ immediate: true,
3719
+ flush: 'sync'
3720
+ });
3721
+ __WEBPACK_EXTERNAL_MODULE_vue_watch__(zIndex, function (val) {
3722
+ if (_isOpen.value && val !== undefined) {
3723
+ localZIndex.value = val;
3724
+ }
3725
+ });
3700
3726
  // 内容样式
3701
3727
  var contentStyles = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
3702
3728
  var styles = popover_objectSpread(popover_objectSpread({}, floatingStyles.value), {}, {
@@ -3706,12 +3732,11 @@ var EMIT_EVENTS = {
3706
3732
  maxHeight: maxHeight.value !== 'auto' ? resolvePixelValue(maxHeight.value) : undefined
3707
3733
  });
3708
3734
  // 设置 z-index
3709
- if (isOpen.value) {
3710
- var _zIndex$value;
3711
- styles.zIndex = (_zIndex$value = zIndex.value) !== null && _zIndex$value !== void 0 ? _zIndex$value : __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_bkZIndexManager__.getPopperIndex();
3735
+ if (_isOpen.value) {
3736
+ styles.zIndex = localZIndex.value;
3712
3737
  }
3713
3738
  // 隐藏时设置 display: none
3714
- if (!isOpen.value && renderDirective.value === 'show') {
3739
+ if (!_isOpen.value && renderDirective.value === 'show') {
3715
3740
  styles.display = 'none';
3716
3741
  }
3717
3742
  return styles;
@@ -3732,7 +3757,7 @@ var EMIT_EVENTS = {
3732
3757
  var _parseTheme = parseTheme(theme.value),
3733
3758
  extraClasses = _parseTheme.extraClasses;
3734
3759
  var classes = [resolveClassName('popover'), resolveClassName('pop2-content'), extCls.value].concat(_toConsumableArray(extraClasses));
3735
- if (!isOpen.value) {
3760
+ if (!_isOpen.value) {
3736
3761
  classes.push('hidden');
3737
3762
  }
3738
3763
  return classes.filter(Boolean);
@@ -3805,7 +3830,7 @@ var EMIT_EVENTS = {
3805
3830
  }
3806
3831
  // 触发 clickoutside 事件(让调用者决定如何处理)
3807
3832
  emit(EMIT_EVENTS.CLICK_OUTSIDE, {
3808
- isShow: isOpen.value,
3833
+ isShow: _isOpen.value,
3809
3834
  event: event
3810
3835
  });
3811
3836
  // 决定是否自动隐藏 popover
@@ -3818,7 +3843,7 @@ var EMIT_EVENTS = {
3818
3843
  return;
3819
3844
  }
3820
3845
  // 隐藏 popover
3821
- if (isOpen.value) {
3846
+ if (_isOpen.value) {
3822
3847
  hide();
3823
3848
  }
3824
3849
  };
@@ -3831,7 +3856,7 @@ var EMIT_EVENTS = {
3831
3856
  // 处理 componentEventDelay
3832
3857
  var contentPointerEvents = __WEBPACK_EXTERNAL_MODULE_vue_ref__('auto');
3833
3858
  var eventDelayTimer;
3834
- __WEBPACK_EXTERNAL_MODULE_vue_watch__(isOpen, function (newVal) {
3859
+ __WEBPACK_EXTERNAL_MODULE_vue_watch__(_isOpen, function (newVal) {
3835
3860
  if (newVal && componentEventDelay.value > 0) {
3836
3861
  contentPointerEvents.value = 'none';
3837
3862
  eventDelayTimer = setTimeout(function () {
@@ -3856,7 +3881,7 @@ var EMIT_EVENTS = {
3856
3881
  if (renderType.value === __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_RenderType__.AUTO) {
3857
3882
  return true;
3858
3883
  }
3859
- return isOpen.value;
3884
+ return _isOpen.value;
3860
3885
  });
3861
3886
  var unbindCustomReferenceEvents = [];
3862
3887
  var clearCustomReferenceEvents = function clearCustomReferenceEvents() {
@@ -3900,6 +3925,29 @@ var EMIT_EVENTS = {
3900
3925
  });
3901
3926
  }
3902
3927
  });
3928
+ var unregisterPopoverOverlay = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_registerPopoverOverlay__({
3929
+ hide: function hide() {
3930
+ if (always.value) {
3931
+ return;
3932
+ }
3933
+ clearTimers();
3934
+ if (_isOpen.value) {
3935
+ _isOpen.value = false;
3936
+ }
3937
+ },
3938
+ isOpen: function isOpen() {
3939
+ return _isOpen.value;
3940
+ },
3941
+ isAlways: function isAlways() {
3942
+ return always.value;
3943
+ },
3944
+ getReferenceEl: function getReferenceEl() {
3945
+ return getActualReferenceElement() || resolveDefaultReferenceElement() || resolveReferenceRefElement(referenceWrapperRef.value);
3946
+ },
3947
+ getFloatingEl: function getFloatingEl() {
3948
+ return floatingRef.value;
3949
+ }
3950
+ });
3903
3951
  // 卸载时清理
3904
3952
  __WEBPACK_EXTERNAL_MODULE_vue_onBeforeUnmount__(function () {
3905
3953
  document.removeEventListener('click', handleClickOutside, true);
@@ -3910,6 +3958,7 @@ var EMIT_EVENTS = {
3910
3958
  clearTimeout(eventDelayTimer);
3911
3959
  }
3912
3960
  bkPopoverRegistry["delete"](popoverId);
3961
+ unregisterPopoverOverlay();
3913
3962
  stopHoverTrack();
3914
3963
  });
3915
3964
  // 注册到全局表(用于父子弹层交互判定)
@@ -3941,7 +3990,7 @@ var EMIT_EVENTS = {
3941
3990
  };
3942
3991
  var resetPopover = function resetPopover() {
3943
3992
  clearTimers();
3944
- isOpen.value = false;
3993
+ _isOpen.value = false;
3945
3994
  __WEBPACK_EXTERNAL_MODULE_vue_nextTick__(function () {
3946
3995
  update();
3947
3996
  });
@@ -3953,13 +4002,13 @@ var EMIT_EVENTS = {
3953
4002
  resetPopover: resetPopover,
3954
4003
  stopHide: stopHide,
3955
4004
  handleClickOutside: handleClickOutside,
3956
- isOpen: isOpen,
3957
- localIsShow: isOpen // 兼容旧 API
4005
+ isOpen: _isOpen,
4006
+ localIsShow: _isOpen // 兼容旧 API
3958
4007
  });
3959
4008
  var teleportTo = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
3960
4009
  var boundaryVal = resolveBoundary();
3961
4010
  if (typeof boundaryVal === 'string') {
3962
- if (boundaryVal === 'body' || boundaryVal === 'parent') {
4011
+ if (/^body$/i.test(boundaryVal) || isParentBoundary.value) {
3963
4012
  return 'body';
3964
4013
  }
3965
4014
  try {
@@ -3996,7 +4045,7 @@ var EMIT_EVENTS = {
3996
4045
  }, [(_slots$arrow = slots.arrow) === null || _slots$arrow === void 0 ? void 0 : _slots$arrow.call(slots)]), (_slots$content = (_slots$content2 = slots.content) === null || _slots$content2 === void 0 ? void 0 : _slots$content2.call(slots)) !== null && _slots$content !== void 0 ? _slots$content : renderContent()]) : null;
3997
4046
  var renderTeleport = function renderTeleport() {
3998
4047
  return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_vue_Teleport__, {
3999
- "disabled": disableTeleport.value,
4048
+ "disabled": isTeleportDisabled.value,
4000
4049
  "to": teleportTo.value
4001
4050
  }, _isSlot(floatingNode) ? floatingNode : {
4002
4051
  "default": function _default() {
@@ -30,6 +30,7 @@ export * from './helper';
30
30
  export * from './hooks/use-form';
31
31
  export * from './hooks/use-form-item';
32
32
  export * from './popover';
33
+ export * from './popover-overlay';
33
34
  export * from './scrollbar-width';
34
35
  export * from './token';
35
36
  export * from './utils';
@@ -1102,6 +1102,75 @@ var getPopContainerId = function getPopContainerId() {
1102
1102
  }
1103
1103
  return "".concat(prefix).concat(popContainerId);
1104
1104
  };
1105
+ ;// ../../packages/shared/src/popover-overlay.ts
1106
+ /**
1107
+ * Tencent is pleased to support the open source community by making
1108
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
1109
+ *
1110
+ * Copyright (C) 2025 Tencent. All rights reserved.
1111
+ *
1112
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
1113
+ *
1114
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
1115
+ *
1116
+ * ---------------------------------------------------
1117
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
1118
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
1119
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
1120
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1121
+ *
1122
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
1123
+ * the Software.
1124
+ *
1125
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
1126
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1127
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
1128
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
1129
+ * IN THE SOFTWARE.
1130
+ */
1131
+ var popoverOverlayInstances = new Set();
1132
+ /**
1133
+ * 注册 Popover / Dropdown 等弹出层,供 Modal 打开时收起页面上无关的弹层。
1134
+ */
1135
+ var registerPopoverOverlay = function registerPopoverOverlay(instance) {
1136
+ popoverOverlayInstances.add(instance);
1137
+ return function () {
1138
+ popoverOverlayInstances["delete"](instance);
1139
+ };
1140
+ };
1141
+ var isInsideContainer = function isInsideContainer(instance, container) {
1142
+ var referenceEl = instance.getReferenceEl();
1143
+ if (referenceEl && container.contains(referenceEl)) {
1144
+ return true;
1145
+ }
1146
+ var floatingEl = instance.getFloatingEl();
1147
+ return !!(floatingEl && container.contains(floatingEl));
1148
+ };
1149
+ /**
1150
+ * 收起不在指定容器内的弹出层。
1151
+ *
1152
+ * Popover 默认 z-index(~8000)高于 Dialog/Modal(~2000),
1153
+ * 页面上已展开的 Dropdown 会盖住后打开的 Dialog。
1154
+ * Dialog 内的 Select / DatePicker 等弹层(reference 在容器内)需要保留。
1155
+ */
1156
+ var hidePopoversOutside = function hidePopoversOutside(container) {
1157
+ if (!container) {
1158
+ return;
1159
+ }
1160
+ popoverOverlayInstances.forEach(function (instance) {
1161
+ var _instance$isAlways;
1162
+ if ((_instance$isAlways = instance.isAlways) !== null && _instance$isAlways !== void 0 && _instance$isAlways.call(instance)) {
1163
+ return;
1164
+ }
1165
+ if (!instance.isOpen()) {
1166
+ return;
1167
+ }
1168
+ if (isInsideContainer(instance, container)) {
1169
+ return;
1170
+ }
1171
+ instance.hide();
1172
+ });
1173
+ };
1105
1174
  ;// ../../packages/shared/src/scrollbar-width.ts
1106
1175
  /*
1107
1176
  * Tencent is pleased to support the open source community by making
@@ -1817,6 +1886,7 @@ var bkZIndexManager = new BKZIndexManager();
1817
1886
 
1818
1887
 
1819
1888
 
1889
+
1820
1890
  function classes(dynamicCls) {
1821
1891
  var constCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1822
1892
  return Object.entries(dynamicCls).filter(function (entry) {
@@ -1939,4 +2009,4 @@ function arrayEqual() {
1939
2009
  }
1940
2010
  return true;
1941
2011
  }
1942
- export { AlignEnum, BKLAYERD_INDEX_EFAULT_VALUE, BKLAYERTYPE, BKPopover, DialogTypeEnum, DirectionEnum, EMPTY_OBJ, InputBehaviorEnum, InputBehaviorType, LineStyleEnum, PlacementEnum, Placements, ProgressEnum, ProgressStrokeLineCapEnum, ProgressStrokeLineCapType, ProgressType, PropTypes, RenderDirectiveEnum, RenderType, SelectedType, SelectedTypeEnum, SizeEnum, SwitcherThemeEnum, SwitcherThemeType, TagThemeEnum, TagThemeType, ThemeEnum, TimelineNodeTypeEnum, TriggerEnum, alignType, arrayEqual, bkZIndexManager, capitalize, checkOverflow, classes, clone, debounce, dialogTypeUnion, directionType, elementsEqual, filterProperty, finiteOrDefault, formItemKey, formKey, _getFullscreenRoot as getFullscreenRoot, getPopContainerId, hasOverflowEllipsis, isArray, helper_isElement as isElement, isEmpty, isEmptyObj, isNumberFinite as isFinite, isFullScreenContainsElement, isFunction, isNullOrUndef, isObject, isPromise, isString, isSymbol, lineStyleType, maybeShowTooltip, merge, mergeIf, mergerFn, mergerIfFn, noop, observerResize, off, on, placementType, random, renderDirectiveType, renderEmptyVNode, renderType, resolveClassName, scrollTop, scrollbarWidth, stringEnum, throttle, triggerType, useForm, useFormItem, valueOrDefault, withInstall, withInstallProps };
2012
+ export { AlignEnum, BKLAYERD_INDEX_EFAULT_VALUE, BKLAYERTYPE, BKPopover, DialogTypeEnum, DirectionEnum, EMPTY_OBJ, InputBehaviorEnum, InputBehaviorType, LineStyleEnum, PlacementEnum, Placements, ProgressEnum, ProgressStrokeLineCapEnum, ProgressStrokeLineCapType, ProgressType, PropTypes, RenderDirectiveEnum, RenderType, SelectedType, SelectedTypeEnum, SizeEnum, SwitcherThemeEnum, SwitcherThemeType, TagThemeEnum, TagThemeType, ThemeEnum, TimelineNodeTypeEnum, TriggerEnum, alignType, arrayEqual, bkZIndexManager, capitalize, checkOverflow, classes, clone, debounce, dialogTypeUnion, directionType, elementsEqual, filterProperty, finiteOrDefault, formItemKey, formKey, _getFullscreenRoot as getFullscreenRoot, getPopContainerId, hasOverflowEllipsis, hidePopoversOutside, isArray, helper_isElement as isElement, isEmpty, isEmptyObj, isNumberFinite as isFinite, isFullScreenContainsElement, isFunction, isNullOrUndef, isObject, isPromise, isString, isSymbol, lineStyleType, maybeShowTooltip, merge, mergeIf, mergerFn, mergerIfFn, noop, observerResize, off, on, placementType, random, registerPopoverOverlay, renderDirectiveType, renderEmptyVNode, renderType, resolveClassName, scrollTop, scrollbarWidth, stringEnum, throttle, triggerType, useForm, useFormItem, valueOrDefault, withInstall, withInstallProps };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Tencent is pleased to support the open source community by making
3
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
4
+ *
5
+ * Copyright (C) 2025 Tencent. All rights reserved.
6
+ *
7
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
8
+ *
9
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
10
+ *
11
+ * ---------------------------------------------------
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
14
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
15
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
18
+ * the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
21
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
23
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24
+ * IN THE SOFTWARE.
25
+ */
26
+ export type PopoverOverlayInstance = {
27
+ hide: () => void;
28
+ isOpen: () => boolean;
29
+ isAlways?: () => boolean;
30
+ getReferenceEl: () => HTMLElement | null;
31
+ getFloatingEl: () => HTMLElement | null;
32
+ };
33
+ /**
34
+ * 注册 Popover / Dropdown 等弹出层,供 Modal 打开时收起页面上无关的弹层。
35
+ */
36
+ export declare const registerPopoverOverlay: (instance: PopoverOverlayInstance) => () => void;
37
+ /**
38
+ * 收起不在指定容器内的弹出层。
39
+ *
40
+ * Popover 默认 z-index(~8000)高于 Dialog/Modal(~2000),
41
+ * 页面上已展开的 Dropdown 会盖住后打开的 Dialog。
42
+ * Dialog 内的 Select / DatePicker 等弹层(reference 在容器内)需要保留。
43
+ */
44
+ export declare const hidePopoversOutside: (container?: HTMLElement | null) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "3.0.8",
3
+ "version": "3.0.9",
4
4
  "workspaces": [
5
5
  "packages/**",
6
6
  "scripts/cli",