bkui-vue 2.0.2-beta.71 → 2.0.2-beta.73
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 +35 -35
- package/dist/index.esm.js +7772 -7750
- package/dist/index.umd.js +34 -34
- package/lib/index.js +1 -1
- package/lib/popover/index.d.ts +0 -3
- package/lib/popover/index.js +82 -39
- package/lib/popover/popover.d.ts +0 -1
- package/lib/popover/use-popover-init.d.ts +1 -1
- package/lib/popover/use-popper-id.d.ts +3 -1
- package/lib/search-select/index.d.ts +6 -6
- package/lib/search-select/index.js +2 -6
- package/lib/search-select/input.d.ts +1 -1
- package/lib/search-select/search-select.d.ts +2 -2
- package/lib/search-select/selected.d.ts +2 -2
- package/lib/select/index.d.ts +12 -1
- package/lib/select/index.js +12 -4
- package/lib/select/optionGroup.d.ts +12 -1
- package/lib/select/type.d.ts +1 -0
- package/lib/tree/index.d.ts +23 -0
- package/lib/tree/index.js +5 -0
- package/lib/tree/props.d.ts +8 -0
- package/lib/tree/tree.d.ts +11 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
package/lib/popover/index.d.ts
CHANGED
|
@@ -168,7 +168,6 @@ declare const BkPopover: {
|
|
|
168
168
|
isRenderModeShow: import("vue").ComputedRef<boolean>;
|
|
169
169
|
transBoundary: import("vue").ComputedRef<boolean>;
|
|
170
170
|
handleClickContent: () => void;
|
|
171
|
-
handleClickOutside: (_e: MouseEvent, hideIgnoreReference?: boolean) => void;
|
|
172
171
|
updatePopover: (virtualEl?: any, props?: {}, callFn?: any) => void;
|
|
173
172
|
resetPopover: () => void;
|
|
174
173
|
hide: () => void;
|
|
@@ -561,7 +560,6 @@ declare const BkPopover: {
|
|
|
561
560
|
isRenderModeShow: import("vue").ComputedRef<boolean>;
|
|
562
561
|
transBoundary: import("vue").ComputedRef<boolean>;
|
|
563
562
|
handleClickContent: () => void;
|
|
564
|
-
handleClickOutside: (_e: MouseEvent, hideIgnoreReference?: boolean) => void;
|
|
565
563
|
updatePopover: (virtualEl?: any, props?: {}, callFn?: any) => void;
|
|
566
564
|
resetPopover: () => void;
|
|
567
565
|
hide: () => void;
|
|
@@ -780,7 +778,6 @@ declare const BkPopover: {
|
|
|
780
778
|
isRenderModeShow: import("vue").ComputedRef<boolean>;
|
|
781
779
|
transBoundary: import("vue").ComputedRef<boolean>;
|
|
782
780
|
handleClickContent: () => void;
|
|
783
|
-
handleClickOutside: (_e: MouseEvent, hideIgnoreReference?: boolean) => void;
|
|
784
781
|
updatePopover: (virtualEl?: any, props?: {}, callFn?: any) => void;
|
|
785
782
|
resetPopover: () => void;
|
|
786
783
|
hide: () => void;
|
package/lib/popover/index.js
CHANGED
|
@@ -692,7 +692,7 @@ const shared_namespaceObject = x({ ["PlacementEnum"]: () => __WEBPACK_EXTERNAL_M
|
|
|
692
692
|
;// CONCATENATED MODULE: external "vue"
|
|
693
693
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
694
694
|
var external_vue_y = x => () => x
|
|
695
|
-
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["Text"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Text, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["
|
|
695
|
+
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["Text"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Text, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
|
|
696
696
|
;// CONCATENATED MODULE: ../../packages/directives/src/clickoutside.ts
|
|
697
697
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
698
698
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -1545,7 +1545,7 @@ var EMIT_EVENT_TYPES = _defineProperty(_defineProperty(_defineProperty(_definePr
|
|
|
1545
1545
|
var refContent = (0,external_vue_namespaceObject.ref)(null);
|
|
1546
1546
|
var refTimer = (0,external_vue_namespaceObject.ref)(null);
|
|
1547
1547
|
var handleClick = function handleClick(evt) {
|
|
1548
|
-
evt.stopPropagation();
|
|
1548
|
+
// evt.stopPropagation();
|
|
1549
1549
|
emit('click', evt);
|
|
1550
1550
|
};
|
|
1551
1551
|
var resetPointerEvent = function resetPointerEvent() {
|
|
@@ -4440,10 +4440,11 @@ function use_floating_objectSpread(e) { for (var r = 1; r < arguments.length; r+
|
|
|
4440
4440
|
*/
|
|
4441
4441
|
|
|
4442
4442
|
|
|
4443
|
-
var popContainerId =
|
|
4444
|
-
var parentNodeReferId = null;
|
|
4443
|
+
var popContainerId = "id_".concat(esm_browser_v4());
|
|
4445
4444
|
/* harmony default export */ const use_popper_id = (function (props) {
|
|
4446
4445
|
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#';
|
|
4446
|
+
// 为每个 popover 实例生成独立的 parentNodeReferId,避免嵌套时 ID 冲突
|
|
4447
|
+
var parentNodeReferId = "id_".concat(esm_browser_v4());
|
|
4447
4448
|
var getPrefixId = function getPrefixId(root) {
|
|
4448
4449
|
var resolvedBoundary = null;
|
|
4449
4450
|
var resolveBoundary = function resolveBoundary(fn) {
|
|
@@ -4452,8 +4453,7 @@ var parentNodeReferId = null;
|
|
|
4452
4453
|
}
|
|
4453
4454
|
};
|
|
4454
4455
|
var resolveParentBoundary = function resolveParentBoundary() {
|
|
4455
|
-
if (/^parent$/i.test(props.boundary)) {
|
|
4456
|
-
resolvedBoundary = "".concat(prefix).concat(popContainerId);
|
|
4456
|
+
if (/^parent$/i.test(props.boundary) || !props.boundary) {
|
|
4457
4457
|
var _ref = root || {},
|
|
4458
4458
|
parentNode = _ref.parentNode;
|
|
4459
4459
|
if (parentNode !== null && parentNode !== void 0 && parentNode.parentNode) {
|
|
@@ -4463,43 +4463,62 @@ var parentNodeReferId = null;
|
|
|
4463
4463
|
}
|
|
4464
4464
|
};
|
|
4465
4465
|
var resolveCommonBoundary = function resolveCommonBoundary() {
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4466
|
+
// 如果 boundary 是字符串 'body',使用动态创建的 popContainer
|
|
4467
|
+
if (typeof props.boundary === 'string' && /^body$/i.test(props.boundary)) {
|
|
4468
|
+
resolvedBoundary = "".concat(prefix).concat(popContainerId);
|
|
4469
|
+
return;
|
|
4470
|
+
}
|
|
4471
|
+
// 如果 boundary 是 document.body 对象,使用动态创建的 popContainer
|
|
4472
|
+
if (props.boundary === document.body) {
|
|
4473
|
+
resolvedBoundary = "".concat(prefix).concat(popContainerId);
|
|
4474
|
+
return;
|
|
4475
|
+
}
|
|
4476
|
+
// 处理其他字符串选择器,直接使用
|
|
4477
|
+
if (typeof props.boundary === 'string') {
|
|
4478
|
+
resolvedBoundary = props.boundary;
|
|
4479
|
+
return;
|
|
4480
|
+
}
|
|
4481
|
+
// 处理其他 HTMLElement 对象,直接使用
|
|
4482
|
+
if (utils_isElement(props.boundary)) {
|
|
4483
|
+
resolvedBoundary = props.boundary;
|
|
4484
|
+
return;
|
|
4480
4485
|
}
|
|
4481
4486
|
};
|
|
4482
4487
|
resolveBoundary(resolveParentBoundary);
|
|
4483
4488
|
resolveBoundary(resolveCommonBoundary);
|
|
4489
|
+
// 默认降级逻辑
|
|
4484
4490
|
resolveBoundary(function () {
|
|
4485
|
-
resolvedBoundary =
|
|
4491
|
+
resolvedBoundary = "".concat(prefix).concat(popContainerId);
|
|
4486
4492
|
});
|
|
4487
4493
|
return resolvedBoundary;
|
|
4488
4494
|
};
|
|
4489
|
-
|
|
4490
|
-
|
|
4495
|
+
// 确保全局 popContainer 容器存在
|
|
4496
|
+
if (!isAvailableId("#".concat(popContainerId))) {
|
|
4491
4497
|
var popContainer = document.createElement('div');
|
|
4492
4498
|
popContainer.setAttribute('id', popContainerId);
|
|
4493
4499
|
popContainer.setAttribute('data-popper-id', popContainerId);
|
|
4494
4500
|
document.body.append(popContainer);
|
|
4495
4501
|
}
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4502
|
+
// 清理父节点上的 data-pnode-id 属性
|
|
4503
|
+
var clearParentNodeId = function clearParentNodeId(root) {
|
|
4504
|
+
if (/^parent$/i.test(props.boundary)) {
|
|
4505
|
+
var _ref2 = root || {},
|
|
4506
|
+
parentNode = _ref2.parentNode;
|
|
4507
|
+
if (parentNode !== null && parentNode !== void 0 && parentNode.parentNode) {
|
|
4508
|
+
var attr = parentNode.parentNode.getAttribute('data-pnode-id');
|
|
4509
|
+
// 只清理当前实例设置的属性
|
|
4510
|
+
if (attr === parentNodeReferId) {
|
|
4511
|
+
parentNode.parentNode.removeAttribute('data-pnode-id');
|
|
4512
|
+
}
|
|
4513
|
+
}
|
|
4514
|
+
}
|
|
4515
|
+
};
|
|
4499
4516
|
return {
|
|
4500
4517
|
popContainerId: popContainerId,
|
|
4501
4518
|
prefixId: getPrefixId(),
|
|
4502
|
-
getPrefixId: getPrefixId
|
|
4519
|
+
getPrefixId: getPrefixId,
|
|
4520
|
+
parentNodeReferId: parentNodeReferId,
|
|
4521
|
+
clearParentNodeId: clearParentNodeId
|
|
4503
4522
|
};
|
|
4504
4523
|
});
|
|
4505
4524
|
;// CONCATENATED MODULE: ../../packages/popover/src/use-popover-init.ts
|
|
@@ -4668,7 +4687,8 @@ var parentNodeReferId = null;
|
|
|
4668
4687
|
boundary.value = getPrefixId(root || elReference);
|
|
4669
4688
|
};
|
|
4670
4689
|
var _usePopperId = use_popper_id(props, '#'),
|
|
4671
|
-
getPrefixId = _usePopperId.getPrefixId
|
|
4690
|
+
getPrefixId = _usePopperId.getPrefixId,
|
|
4691
|
+
clearParentNodeId = _usePopperId.clearParentNodeId;
|
|
4672
4692
|
var setFullscreenTag = function setFullscreenTag() {
|
|
4673
4693
|
var _fullScreenTarget$val2;
|
|
4674
4694
|
fullScreenTarget === null || fullScreenTarget === void 0 || (_fullScreenTarget$val2 = fullScreenTarget.value) === null || _fullScreenTarget$val2 === void 0 || _fullScreenTarget$val2.setAttribute('data-fllsrn-id', fullscreenReferId);
|
|
@@ -4702,25 +4722,49 @@ var parentNodeReferId = null;
|
|
|
4702
4722
|
if (props.disabled) {
|
|
4703
4723
|
return;
|
|
4704
4724
|
}
|
|
4705
|
-
initPopInstance();
|
|
4706
4725
|
if (isElementFullScreen()) {
|
|
4707
4726
|
var query = "[data-fllsrn-id=".concat(fullscreenReferId, "]");
|
|
4708
4727
|
var target = getFullscreenRoot(query);
|
|
4709
4728
|
updateFullscreen(target);
|
|
4710
4729
|
}
|
|
4730
|
+
// 先更新 boundary,确保在初始化 popover 实例之前 boundary 已正确设置
|
|
4711
4731
|
updateBoundary();
|
|
4732
|
+
initPopInstance();
|
|
4712
4733
|
document.body.addEventListener('fullscreenchange', handleFullscreenChange);
|
|
4734
|
+
document.addEventListener('click', handleClickOutside);
|
|
4713
4735
|
};
|
|
4714
4736
|
var onUnmountedFn = function onUnmountedFn() {
|
|
4715
4737
|
beforeInstanceUnmount();
|
|
4738
|
+
// 清理父节点上的 data-pnode-id 属性
|
|
4739
|
+
var _resolvePopElements4 = resolvePopElements(),
|
|
4740
|
+
root = _resolvePopElements4.root;
|
|
4741
|
+
clearParentNodeId(root);
|
|
4716
4742
|
document.body.removeEventListener('fullscreenchange', handleFullscreenChange);
|
|
4743
|
+
document.removeEventListener('click', handleClickOutside);
|
|
4717
4744
|
};
|
|
4718
|
-
var
|
|
4745
|
+
var isClickInside = function isClickInside(target) {
|
|
4746
|
+
var _refContent$value$$el, _refContent$value, _refContent$value$con;
|
|
4747
|
+
return (_refContent$value$$el = (_refContent$value = refContent.value) === null || _refContent$value === void 0 || (_refContent$value = _refContent$value.$el) === null || _refContent$value === void 0 || (_refContent$value$con = _refContent$value.contains) === null || _refContent$value$con === void 0 ? void 0 : _refContent$value$con.call(_refContent$value, target)) !== null && _refContent$value$$el !== void 0 ? _refContent$value$$el : false;
|
|
4748
|
+
};
|
|
4749
|
+
/**
|
|
4750
|
+
* 处理点击外部区域的事件
|
|
4751
|
+
* @param e - 事件对象
|
|
4752
|
+
* @param hideIgnoreReference - 是否忽略隐藏参考元素
|
|
4753
|
+
* @returns
|
|
4754
|
+
*/
|
|
4755
|
+
var handleClickOutside = function handleClickOutside(e) {
|
|
4719
4756
|
var hideIgnoreReference = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
4757
|
+
var target = e.target;
|
|
4758
|
+
if (isClickInside(target)) {
|
|
4759
|
+
e.preventDefault();
|
|
4760
|
+
e.stopPropagation();
|
|
4761
|
+
e.stopImmediatePropagation();
|
|
4762
|
+
return;
|
|
4763
|
+
}
|
|
4720
4764
|
var commonFunc = function commonFunc() {
|
|
4721
4765
|
ctx.emit(EMIT_EVENTS.CLICK_OUTSIDE, {
|
|
4722
4766
|
isShow: localIsShow.value,
|
|
4723
|
-
event:
|
|
4767
|
+
event: e
|
|
4724
4768
|
});
|
|
4725
4769
|
var needExec = props.disableOutsideClick || props.always || props.disabled || props.trigger === 'manual';
|
|
4726
4770
|
if (!props.forceClickoutside && needExec) {
|
|
@@ -4730,6 +4774,11 @@ var parentNodeReferId = null;
|
|
|
4730
4774
|
hideFn();
|
|
4731
4775
|
}
|
|
4732
4776
|
};
|
|
4777
|
+
/**
|
|
4778
|
+
* 如果需要忽略隐藏参考元素,则设置一个定时器,在定时器结束后检查是否需要隐藏 popover
|
|
4779
|
+
* @param hideIgnoreReference - 是否忽略隐藏参考元素
|
|
4780
|
+
* @returns
|
|
4781
|
+
*/
|
|
4733
4782
|
if (hideIgnoreReference) {
|
|
4734
4783
|
setTimeout(function () {
|
|
4735
4784
|
if (ReferenceClickSharedState[uniqKey]) {
|
|
@@ -4833,9 +4882,7 @@ function _isSlot(s) {
|
|
|
4833
4882
|
}),
|
|
4834
4883
|
onMountedFn = _usePopoverInit.onMountedFn,
|
|
4835
4884
|
onUnmountedFn = _usePopoverInit.onUnmountedFn,
|
|
4836
|
-
handleClickOutside = _usePopoverInit.handleClickOutside,
|
|
4837
4885
|
beforeInstanceUnmount = _usePopoverInit.beforeInstanceUnmount,
|
|
4838
|
-
updateBoundary = _usePopoverInit.updateBoundary,
|
|
4839
4886
|
initPopInstance = _usePopoverInit.initPopInstance,
|
|
4840
4887
|
showFn = _usePopoverInit.showFn,
|
|
4841
4888
|
hideFn = _usePopoverInit.hideFn,
|
|
@@ -4865,7 +4912,6 @@ function _isSlot(s) {
|
|
|
4865
4912
|
initPopInstance();
|
|
4866
4913
|
}
|
|
4867
4914
|
});
|
|
4868
|
-
updateBoundary();
|
|
4869
4915
|
(0,external_vue_namespaceObject.onMounted)(onMountedFn);
|
|
4870
4916
|
(0,external_vue_namespaceObject.onBeforeUnmount)(onUnmountedFn);
|
|
4871
4917
|
var isRenderModeShow = (0,external_vue_namespaceObject.computed)(function () {
|
|
@@ -4914,7 +4960,6 @@ function _isSlot(s) {
|
|
|
4914
4960
|
isRenderModeShow: isRenderModeShow,
|
|
4915
4961
|
transBoundary: transBoundary,
|
|
4916
4962
|
handleClickContent: handleClickContent,
|
|
4917
|
-
handleClickOutside: handleClickOutside,
|
|
4918
4963
|
updatePopover: updatePopover,
|
|
4919
4964
|
resetPopover: resetPopover,
|
|
4920
4965
|
hide: hide,
|
|
@@ -4970,7 +5015,7 @@ function _isSlot(s) {
|
|
|
4970
5015
|
"to": _this.boundary
|
|
4971
5016
|
}, {
|
|
4972
5017
|
"default": function _default() {
|
|
4973
|
-
return [(0,external_vue_namespaceObject.
|
|
5018
|
+
return [(0,external_vue_namespaceObject.createVNode)(content, {
|
|
4974
5019
|
"ref": "refContent",
|
|
4975
5020
|
"width": _this.width,
|
|
4976
5021
|
"height": _this.height,
|
|
@@ -4995,9 +5040,7 @@ function _isSlot(s) {
|
|
|
4995
5040
|
}
|
|
4996
5041
|
}) : '';
|
|
4997
5042
|
}
|
|
4998
|
-
})
|
|
4999
|
-
return _this.handleClickOutside(e, _this.hideIgnoreReference);
|
|
5000
|
-
}]])];
|
|
5043
|
+
})];
|
|
5001
5044
|
}
|
|
5002
5045
|
})];
|
|
5003
5046
|
}
|
package/lib/popover/popover.d.ts
CHANGED
|
@@ -154,7 +154,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
154
154
|
isRenderModeShow: import("vue").ComputedRef<boolean>;
|
|
155
155
|
transBoundary: import("vue").ComputedRef<boolean>;
|
|
156
156
|
handleClickContent: () => void;
|
|
157
|
-
handleClickOutside: (_e: MouseEvent, hideIgnoreReference?: boolean) => void;
|
|
158
157
|
updatePopover: (virtualEl?: any, props?: {}, callFn?: any) => void;
|
|
159
158
|
resetPopover: () => void;
|
|
160
159
|
hide: () => void;
|
|
@@ -6,7 +6,7 @@ declare const _default: (props: any, ctx: any, { refReference, refContent, refAr
|
|
|
6
6
|
}) => {
|
|
7
7
|
onMountedFn: () => void;
|
|
8
8
|
onUnmountedFn: () => void;
|
|
9
|
-
handleClickOutside: (
|
|
9
|
+
handleClickOutside: (e: MouseEvent, hideIgnoreReference?: boolean) => void;
|
|
10
10
|
beforeInstanceUnmount: () => void;
|
|
11
11
|
updateBoundary: () => void;
|
|
12
12
|
initPopInstance: () => void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const _default: (props: any, prefix?: string) => {
|
|
2
|
-
popContainerId:
|
|
2
|
+
popContainerId: string;
|
|
3
3
|
prefixId: any;
|
|
4
4
|
getPrefixId: (root?: any) => any;
|
|
5
|
+
parentNodeReferId: string;
|
|
6
|
+
clearParentNodeId: (root?: any) => void;
|
|
5
7
|
};
|
|
6
8
|
export default _default;
|
|
@@ -128,7 +128,7 @@ declare const BkSearchSelect: {
|
|
|
128
128
|
}>;
|
|
129
129
|
inputKey: import("vue").Ref<string>;
|
|
130
130
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
131
|
-
handleCompositionStart: (
|
|
131
|
+
handleCompositionStart: () => void;
|
|
132
132
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
133
133
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
134
134
|
data: {
|
|
@@ -265,7 +265,7 @@ declare const BkSearchSelect: {
|
|
|
265
265
|
}>;
|
|
266
266
|
inputKey: import("vue").Ref<string>;
|
|
267
267
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
268
|
-
handleCompositionStart: (
|
|
268
|
+
handleCompositionStart: () => void;
|
|
269
269
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
270
270
|
}, {}, {}, {}, {
|
|
271
271
|
maxHeight: number;
|
|
@@ -594,7 +594,7 @@ declare const BkSearchSelect: {
|
|
|
594
594
|
}>;
|
|
595
595
|
inputKey: import("vue").Ref<string>;
|
|
596
596
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
597
|
-
handleCompositionStart: (
|
|
597
|
+
handleCompositionStart: () => void;
|
|
598
598
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
599
599
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
600
600
|
data: {
|
|
@@ -731,7 +731,7 @@ declare const BkSearchSelect: {
|
|
|
731
731
|
}>;
|
|
732
732
|
inputKey: import("vue").Ref<string>;
|
|
733
733
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
734
|
-
handleCompositionStart: (
|
|
734
|
+
handleCompositionStart: () => void;
|
|
735
735
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
736
736
|
}, {}, {}, {}, {
|
|
737
737
|
maxHeight: number;
|
|
@@ -1008,7 +1008,7 @@ declare const BkSearchSelect: {
|
|
|
1008
1008
|
}>;
|
|
1009
1009
|
inputKey: import("vue").Ref<string>;
|
|
1010
1010
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
1011
|
-
handleCompositionStart: (
|
|
1011
|
+
handleCompositionStart: () => void;
|
|
1012
1012
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
1013
1013
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
1014
1014
|
data: {
|
|
@@ -1145,7 +1145,7 @@ declare const BkSearchSelect: {
|
|
|
1145
1145
|
}>;
|
|
1146
1146
|
inputKey: import("vue").Ref<string>;
|
|
1147
1147
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
1148
|
-
handleCompositionStart: (
|
|
1148
|
+
handleCompositionStart: () => void;
|
|
1149
1149
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
1150
1150
|
}, {}, {}, {}, {
|
|
1151
1151
|
maxHeight: number;
|
|
@@ -2879,9 +2879,8 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
|
2879
2879
|
}
|
|
2880
2880
|
function documentEnterEvent(e) {
|
|
2881
2881
|
var _menuList$value2;
|
|
2882
|
-
if (!isBindEvent
|
|
2882
|
+
if (!isBindEvent) return;
|
|
2883
2883
|
e.preventDefault();
|
|
2884
|
-
console.log('documentEnterEvent', e);
|
|
2885
2884
|
var item = (_menuList$value2 = menuList.value) === null || _menuList$value2 === void 0 ? void 0 : _menuList$value2.find(function (item) {
|
|
2886
2885
|
return item.id === menuHoverId.value;
|
|
2887
2886
|
});
|
|
@@ -2997,7 +2996,6 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
|
2997
2996
|
switch (event.code) {
|
|
2998
2997
|
case 'Enter':
|
|
2999
2998
|
case 'NumpadEnter':
|
|
3000
|
-
console.log('handleInputKeyup', event);
|
|
3001
2999
|
event.preventDefault();
|
|
3002
3000
|
if (props.valueBehavior === ValueBehavior.NEED_KEY && menuList.value.some(function (item) {
|
|
3003
3001
|
return item.id === menuHoverId.value;
|
|
@@ -3681,13 +3679,11 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
|
|
|
3681
3679
|
}
|
|
3682
3680
|
function handleCompositionEnd(event) {
|
|
3683
3681
|
isComposition.value = false;
|
|
3684
|
-
console.log('handleCompositionEnd', event);
|
|
3685
3682
|
keyword.value = event.data;
|
|
3686
3683
|
handleInputChange(event);
|
|
3687
3684
|
}
|
|
3688
|
-
function handleCompositionStart(
|
|
3685
|
+
function handleCompositionStart() {
|
|
3689
3686
|
isComposition.value = true;
|
|
3690
|
-
console.log('handleCompositionStart', event);
|
|
3691
3687
|
}
|
|
3692
3688
|
// expose
|
|
3693
3689
|
expose({
|
|
@@ -86,7 +86,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
86
86
|
}>;
|
|
87
87
|
inputKey: Ref<string>;
|
|
88
88
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
89
|
-
handleCompositionStart: (
|
|
89
|
+
handleCompositionStart: () => void;
|
|
90
90
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
91
91
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], "focus" | "delete" | "add" | "selectKey", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
92
92
|
data: {
|
|
@@ -159,7 +159,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
159
159
|
}>;
|
|
160
160
|
inputKey: import("vue").Ref<string>;
|
|
161
161
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
162
|
-
handleCompositionStart: (
|
|
162
|
+
handleCompositionStart: () => void;
|
|
163
163
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
164
164
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
165
165
|
data: {
|
|
@@ -296,7 +296,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
296
296
|
}>;
|
|
297
297
|
inputKey: import("vue").Ref<string>;
|
|
298
298
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
299
|
-
handleCompositionStart: (
|
|
299
|
+
handleCompositionStart: () => void;
|
|
300
300
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
301
301
|
}, {}, {}, {}, {
|
|
302
302
|
maxHeight: number;
|
|
@@ -115,7 +115,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
115
115
|
}>;
|
|
116
116
|
inputKey: import("vue").Ref<string>;
|
|
117
117
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
118
|
-
handleCompositionStart: (
|
|
118
|
+
handleCompositionStart: () => void;
|
|
119
119
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
120
120
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
121
121
|
data: {
|
|
@@ -252,7 +252,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
252
252
|
}>;
|
|
253
253
|
inputKey: import("vue").Ref<string>;
|
|
254
254
|
handleCompositionEnd: (event: CompositionEvent) => void;
|
|
255
|
-
handleCompositionStart: (
|
|
255
|
+
handleCompositionStart: () => void;
|
|
256
256
|
handleInputCopy: (event: ClipboardEvent) => void;
|
|
257
257
|
}, {}, {}, {}, {
|
|
258
258
|
maxHeight: number;
|
package/lib/select/index.d.ts
CHANGED
|
@@ -2895,12 +2895,17 @@ declare const BkSelect: {
|
|
|
2895
2895
|
} & {
|
|
2896
2896
|
default: boolean;
|
|
2897
2897
|
};
|
|
2898
|
+
visible: import("vue-types").VueTypeValidableDef<boolean> & {
|
|
2899
|
+
default: boolean;
|
|
2900
|
+
} & {
|
|
2901
|
+
default: boolean;
|
|
2902
|
+
};
|
|
2898
2903
|
}, {
|
|
2899
2904
|
groupLabel: import("vue").ComputedRef<string>;
|
|
2905
|
+
isVisible: import("vue").ComputedRef<boolean>;
|
|
2900
2906
|
handleToggleCollapse: () => void;
|
|
2901
2907
|
resolveClassName: (cls: string) => string;
|
|
2902
2908
|
groupCollapse: import("vue").Ref<boolean>;
|
|
2903
|
-
visible: import("vue").Ref<boolean>;
|
|
2904
2909
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
2905
2910
|
label: import("vue-types").VueTypeValidableDef<string> & {
|
|
2906
2911
|
default: string;
|
|
@@ -2922,8 +2927,14 @@ declare const BkSelect: {
|
|
|
2922
2927
|
} & {
|
|
2923
2928
|
default: boolean;
|
|
2924
2929
|
};
|
|
2930
|
+
visible: import("vue-types").VueTypeValidableDef<boolean> & {
|
|
2931
|
+
default: boolean;
|
|
2932
|
+
} & {
|
|
2933
|
+
default: boolean;
|
|
2934
|
+
};
|
|
2925
2935
|
}>>, {
|
|
2926
2936
|
label: string;
|
|
2937
|
+
visible: boolean;
|
|
2927
2938
|
disabled: boolean;
|
|
2928
2939
|
collapse: boolean;
|
|
2929
2940
|
collapsible: boolean;
|
package/lib/select/index.js
CHANGED
|
@@ -1602,17 +1602,20 @@ function optionGroup_objectSpread(e) { for (var r = 1; r < arguments.length; r++
|
|
|
1602
1602
|
label: shared_namespaceObject.PropTypes.string.def(''),
|
|
1603
1603
|
disabled: shared_namespaceObject.PropTypes.bool.def(false),
|
|
1604
1604
|
collapsible: shared_namespaceObject.PropTypes.bool.def(false),
|
|
1605
|
-
collapse: shared_namespaceObject.PropTypes.bool.def(false)
|
|
1605
|
+
collapse: shared_namespaceObject.PropTypes.bool.def(false),
|
|
1606
|
+
visible: shared_namespaceObject.PropTypes.bool.def(true)
|
|
1606
1607
|
},
|
|
1607
1608
|
setup: function setup(props, _ref) {
|
|
1608
1609
|
var emit = _ref.emit;
|
|
1609
1610
|
var instance = (0,external_vue_namespaceObject.getCurrentInstance)();
|
|
1611
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1610
1612
|
var proxy = instance.proxy;
|
|
1611
1613
|
var select = (0,external_vue_namespaceObject.inject)(selectKey, null);
|
|
1612
1614
|
var states = (0,external_vue_namespaceObject.reactive)({
|
|
1613
|
-
groupCollapse: props.collapse
|
|
1614
|
-
visible:
|
|
1615
|
+
groupCollapse: props.collapse
|
|
1616
|
+
// visible: props.visible,
|
|
1615
1617
|
});
|
|
1618
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1616
1619
|
var optionsMap = (0,external_vue_namespaceObject.ref)(new Map());
|
|
1617
1620
|
var _useRegistry = useRegistry(optionsMap),
|
|
1618
1621
|
register = _useRegistry.register,
|
|
@@ -1622,6 +1625,9 @@ function optionGroup_objectSpread(e) { for (var r = 1; r < arguments.length; r++
|
|
|
1622
1625
|
return option.visible;
|
|
1623
1626
|
}).length, ")");
|
|
1624
1627
|
});
|
|
1628
|
+
var isVisible = (0,external_vue_namespaceObject.computed)(function () {
|
|
1629
|
+
return props.visible && !select.isSearchEmpty;
|
|
1630
|
+
});
|
|
1625
1631
|
var handleToggleCollapse = function handleToggleCollapse() {
|
|
1626
1632
|
if (!props.collapsible || props.disabled) return;
|
|
1627
1633
|
states.groupCollapse = !states.groupCollapse;
|
|
@@ -1642,6 +1648,7 @@ function optionGroup_objectSpread(e) { for (var r = 1; r < arguments.length; r++
|
|
|
1642
1648
|
resolveClassName = _usePrefix.resolveClassName;
|
|
1643
1649
|
return optionGroup_objectSpread(optionGroup_objectSpread({}, (0,external_vue_namespaceObject.toRefs)(states)), {}, {
|
|
1644
1650
|
groupLabel: groupLabel,
|
|
1651
|
+
isVisible: isVisible,
|
|
1645
1652
|
handleToggleCollapse: handleToggleCollapse,
|
|
1646
1653
|
resolveClassName: resolveClassName
|
|
1647
1654
|
});
|
|
@@ -1667,7 +1674,7 @@ function optionGroup_objectSpread(e) { for (var r = 1; r < arguments.length; r++
|
|
|
1667
1674
|
"class": "default-group-label-title"
|
|
1668
1675
|
}, [this.groupLabel])])]), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("ul", {
|
|
1669
1676
|
"class": this.resolveClassName('option-group-content')
|
|
1670
|
-
}, [(_this$$slots$default = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)]), [[external_vue_namespaceObject.vShow, !this.groupCollapse]])]), [[external_vue_namespaceObject.vShow, this.
|
|
1677
|
+
}, [(_this$$slots$default = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)]), [[external_vue_namespaceObject.vShow, !this.groupCollapse]])]), [[external_vue_namespaceObject.vShow, this.isVisible]]);
|
|
1671
1678
|
}
|
|
1672
1679
|
}));
|
|
1673
1680
|
;// CONCATENATED MODULE: ../../packages/directives/src/clickoutside.ts
|
|
@@ -4632,6 +4639,7 @@ function select_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { v
|
|
|
4632
4639
|
selectedStyle: selectedStyle,
|
|
4633
4640
|
curSearchValue: curSearchValue,
|
|
4634
4641
|
highlightKeyword: highlightKeyword,
|
|
4642
|
+
isSearchEmpty: isSearchEmpty,
|
|
4635
4643
|
register: register,
|
|
4636
4644
|
unregister: unregister,
|
|
4637
4645
|
registerGroup: registerGroup,
|
|
@@ -19,12 +19,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
19
19
|
} & {
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
|
+
visible: import("vue-types").VueTypeValidableDef<boolean> & {
|
|
23
|
+
default: boolean;
|
|
24
|
+
} & {
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
22
27
|
}, {
|
|
23
28
|
groupLabel: import("vue").ComputedRef<string>;
|
|
29
|
+
isVisible: import("vue").ComputedRef<boolean>;
|
|
24
30
|
handleToggleCollapse: () => void;
|
|
25
31
|
resolveClassName: (cls: string) => string;
|
|
26
32
|
groupCollapse: import("vue").Ref<boolean>;
|
|
27
|
-
visible: import("vue").Ref<boolean>;
|
|
28
33
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
34
|
label: import("vue-types").VueTypeValidableDef<string> & {
|
|
30
35
|
default: string;
|
|
@@ -46,8 +51,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
51
|
} & {
|
|
47
52
|
default: boolean;
|
|
48
53
|
};
|
|
54
|
+
visible: import("vue-types").VueTypeValidableDef<boolean> & {
|
|
55
|
+
default: boolean;
|
|
56
|
+
} & {
|
|
57
|
+
default: boolean;
|
|
58
|
+
};
|
|
49
59
|
}>>, {
|
|
50
60
|
label: string;
|
|
61
|
+
visible: boolean;
|
|
51
62
|
disabled: boolean;
|
|
52
63
|
collapse: boolean;
|
|
53
64
|
collapsible: boolean;
|
package/lib/select/type.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface ISelectContext {
|
|
|
16
16
|
selectedStyle: 'check' | 'checkbox';
|
|
17
17
|
curSearchValue: string;
|
|
18
18
|
highlightKeyword: boolean;
|
|
19
|
+
isSearchEmpty: boolean;
|
|
19
20
|
register(key: PropertyKey, option: OptionInstanceType): void;
|
|
20
21
|
unregister(key: PropertyKey, option?: OptionInstanceType): void;
|
|
21
22
|
registerGroup(key: PropertyKey, option: GroupInstanceType): void;
|