bkui-vue 2.0.2-beta.75 → 2.0.2-beta.77
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 +25 -25
- package/dist/index.esm.js +3618 -3610
- package/dist/index.umd.js +26 -26
- package/lib/index.js +1 -1
- package/lib/loading/index.js +12 -4
- package/lib/message/index.js +58 -24
- package/lib/message/messageConstructor.d.ts +1 -1
- package/lib/notify/index.js +40 -21
- package/lib/select/common.d.ts +0 -1
- package/lib/select/index.js +9 -32
- package/package.json +1 -1
package/lib/index.js
CHANGED
package/lib/loading/index.js
CHANGED
|
@@ -316,21 +316,29 @@ var vBkloading = {
|
|
|
316
316
|
mounted: function mounted(el, binding) {
|
|
317
317
|
if (binding.value) {
|
|
318
318
|
createInstance(el, binding);
|
|
319
|
+
if (!binding.value.loading) {
|
|
320
|
+
var _instance$vm;
|
|
321
|
+
// 只要loading不为真,就必须隐藏loading遮罩层
|
|
322
|
+
var instance = el[INSTANCE_KEY];
|
|
323
|
+
if (instance !== null && instance !== void 0 && (_instance$vm = instance.vm) !== null && _instance$vm !== void 0 && (_instance$vm = _instance$vm.$el) !== null && _instance$vm !== void 0 && (_instance$vm = _instance$vm.parentNode) !== null && _instance$vm !== void 0 && _instance$vm.style) {
|
|
324
|
+
instance.vm.$el.parentNode.style.display = 'none';
|
|
325
|
+
}
|
|
326
|
+
}
|
|
319
327
|
}
|
|
320
328
|
},
|
|
321
329
|
updated: function updated(el, binding) {
|
|
322
|
-
var _instance$
|
|
330
|
+
var _instance$vm2;
|
|
323
331
|
var instance = el[INSTANCE_KEY];
|
|
324
332
|
var value = binding.value;
|
|
325
333
|
updateOptions(value, instance.options);
|
|
326
|
-
if (instance !== null && instance !== void 0 && (_instance$
|
|
334
|
+
if (instance !== null && instance !== void 0 && (_instance$vm2 = instance.vm) !== null && _instance$vm2 !== void 0 && (_instance$vm2 = _instance$vm2.$el) !== null && _instance$vm2 !== void 0 && (_instance$vm2 = _instance$vm2.parentNode) !== null && _instance$vm2 !== void 0 && _instance$vm2.style) {
|
|
327
335
|
instance.vm.$el.parentNode.style.display = value.loading ? '' : 'none';
|
|
328
336
|
}
|
|
329
337
|
},
|
|
330
338
|
unmounted: function unmounted(el) {
|
|
331
|
-
var _instance$
|
|
339
|
+
var _instance$vm3, _instance$instance;
|
|
332
340
|
var instance = el[INSTANCE_KEY];
|
|
333
|
-
el === null || el === void 0 || el.removeChild(instance === null || instance === void 0 || (_instance$
|
|
341
|
+
el === null || el === void 0 || el.removeChild(instance === null || instance === void 0 || (_instance$vm3 = instance.vm) === null || _instance$vm3 === void 0 || (_instance$vm3 = _instance$vm3.$el) === null || _instance$vm3 === void 0 ? void 0 : _instance$vm3.parentNode);
|
|
334
342
|
instance === null || instance === void 0 || (_instance$instance = instance.instance) === null || _instance$instance === void 0 || _instance$instance.unmount();
|
|
335
343
|
el[INSTANCE_KEY] = null;
|
|
336
344
|
}
|
package/lib/message/index.js
CHANGED
|
@@ -1020,7 +1020,7 @@ function _defineProperty(obj, key, value) {
|
|
|
1020
1020
|
;// CONCATENATED MODULE: external "vue"
|
|
1021
1021
|
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1022
1022
|
var y = x => () => x
|
|
1023
|
-
const external_vue_namespaceObject = x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
|
1023
|
+
const external_vue_namespaceObject = x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
|
1024
1024
|
;// CONCATENATED MODULE: external "../shared"
|
|
1025
1025
|
var shared_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1026
1026
|
var shared_y = x => () => x
|
|
@@ -1063,6 +1063,23 @@ var instances = {
|
|
|
1063
1063
|
'bottom-right': []
|
|
1064
1064
|
};
|
|
1065
1065
|
var seed = 1;
|
|
1066
|
+
// 更新指定位置的所有 Message 实例的位置
|
|
1067
|
+
var updateModalPosition = function updateModalPosition(position, spacing) {
|
|
1068
|
+
var initialOffset = 30;
|
|
1069
|
+
var offsetTop = initialOffset;
|
|
1070
|
+
instances[position].forEach(function (vm) {
|
|
1071
|
+
if (vm.el) {
|
|
1072
|
+
// 获取当前实例的实际高度(包括详情展开后的高度)
|
|
1073
|
+
var currentHeight = vm.el.offsetHeight || 0;
|
|
1074
|
+
// 直接更新 DOM 元素的 top 样式,确保位置立即生效
|
|
1075
|
+
vm.el.style.top = "".concat(offsetTop, "px");
|
|
1076
|
+
// 同时更新 props,保持数据一致性
|
|
1077
|
+
vm.props.offsetY = offsetTop;
|
|
1078
|
+
// 然后累加当前实例的高度和间距,用于计算下一个实例的位置
|
|
1079
|
+
offsetTop += currentHeight + spacing;
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
};
|
|
1066
1083
|
var Message = function Message(constructor, options) {
|
|
1067
1084
|
var opts = options;
|
|
1068
1085
|
var position = opts.position || 'top-right';
|
|
@@ -1085,17 +1102,11 @@ var Message = function Message(constructor, options) {
|
|
|
1085
1102
|
opts = _objectSpread(_objectSpread({}, opts), {}, {
|
|
1086
1103
|
offsetX: horizontalOffset,
|
|
1087
1104
|
offsetY: verticalOffset,
|
|
1088
|
-
id: id
|
|
1105
|
+
id: id,
|
|
1106
|
+
spacing: spacing
|
|
1089
1107
|
});
|
|
1090
1108
|
var container = document.createElement('div');
|
|
1091
1109
|
var vm = (0,external_vue_namespaceObject.createVNode)(constructor, opts);
|
|
1092
|
-
// const updateModalPosition = () => {
|
|
1093
|
-
// let offsetTop = 30;
|
|
1094
|
-
// instances[position].forEach((vm) => {
|
|
1095
|
-
// offsetTop += (vm.el.offsetHeight || 0) + spacing;
|
|
1096
|
-
// vm.props.offsetY = offsetTop;
|
|
1097
|
-
// });
|
|
1098
|
-
// };
|
|
1099
1110
|
vm.props.onDestroy = function (id) {
|
|
1100
1111
|
use_message_close(id, position, spacing, userOnClose);
|
|
1101
1112
|
(0,external_vue_namespaceObject.render)(null, container);
|
|
@@ -1104,13 +1115,19 @@ var Message = function Message(constructor, options) {
|
|
|
1104
1115
|
instances[position].forEach(function (item) {
|
|
1105
1116
|
if (item.props.id !== id) {
|
|
1106
1117
|
var _item$component;
|
|
1107
|
-
|
|
1118
|
+
// 关闭其他实例的详情时,传入 shouldEmit = false 避免触发无限循环
|
|
1119
|
+
(_item$component = item.component) === null || _item$component === void 0 || (_item$component = _item$component.exposed) === null || _item$component === void 0 || _item$component.setDetailsShow(null, false, false);
|
|
1108
1120
|
}
|
|
1109
1121
|
});
|
|
1110
|
-
//
|
|
1111
|
-
//
|
|
1112
|
-
//
|
|
1113
|
-
|
|
1122
|
+
// 等待 DOM 更新完成后再更新位置
|
|
1123
|
+
// 详情展开/收起时,DOM 高度会变化,需要等待渲染完成
|
|
1124
|
+
// 由于事件已经在详情内容渲染完成后才 emit,这里只需要等待 Vue 响应式更新和浏览器布局完成
|
|
1125
|
+
var currentSpacing = spacing || 10;
|
|
1126
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
|
1127
|
+
requestAnimationFrame(function () {
|
|
1128
|
+
updateModalPosition(position, currentSpacing);
|
|
1129
|
+
});
|
|
1130
|
+
});
|
|
1114
1131
|
};
|
|
1115
1132
|
(0,external_vue_namespaceObject.render)(vm, container);
|
|
1116
1133
|
instances[position].push(vm);
|
|
@@ -1124,21 +1141,23 @@ var Message = function Message(constructor, options) {
|
|
|
1124
1141
|
};
|
|
1125
1142
|
function use_message_close(id, position, spacing, userOnClose) {
|
|
1126
1143
|
userOnClose === null || userOnClose === void 0 || userOnClose();
|
|
1127
|
-
var verticalProperty = position.startsWith('top') ? 'top' : 'bottom';
|
|
1128
1144
|
var instanceIndex = -1;
|
|
1129
1145
|
instances[position].forEach(function (item, index) {
|
|
1130
1146
|
if (item.props.id === id) {
|
|
1131
1147
|
instanceIndex = index;
|
|
1132
1148
|
}
|
|
1133
1149
|
});
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
var len = instances[position].length;
|
|
1137
|
-
for (var i = instanceIndex; i < len; i++) {
|
|
1138
|
-
var pos = parseInt(instances[position][i].el.style[verticalProperty], 10) - removeHeight - spacing;
|
|
1139
|
-
instances[position][i].component.props.offsetY = pos;
|
|
1150
|
+
if (instanceIndex === -1) {
|
|
1151
|
+
return;
|
|
1140
1152
|
}
|
|
1153
|
+
// 移除实例
|
|
1141
1154
|
instances[position].splice(instanceIndex, 1);
|
|
1155
|
+
// 重新计算所有剩余实例的位置
|
|
1156
|
+
// 使用传入的 spacing,如果没有则从第一个实例获取,或使用默认值 10
|
|
1157
|
+
var currentSpacing = spacing || (instances[position].length > 0 ? instances[position][0].props.spacing : 10) || 10;
|
|
1158
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
|
1159
|
+
updateModalPosition(position, currentSpacing);
|
|
1160
|
+
});
|
|
1142
1161
|
}
|
|
1143
1162
|
/* harmony default export */ const use_message = (Message);
|
|
1144
1163
|
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
|
@@ -1445,8 +1464,15 @@ var messageProps = {
|
|
|
1445
1464
|
return targetJson;
|
|
1446
1465
|
};
|
|
1447
1466
|
var setDetailsShow = function setDetailsShow(e, isShow) {
|
|
1467
|
+
var shouldEmit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
1448
1468
|
toolOperation.isDetailShow = isShow !== null && isShow !== void 0 ? isShow : !toolOperation.isDetailShow;
|
|
1449
1469
|
fixMesage(e, toolOperation.isDetailShow);
|
|
1470
|
+
// 用于在详情内容渲染完成后 emit 事件的回调
|
|
1471
|
+
var emitAfterRender = function emitAfterRender() {
|
|
1472
|
+
if (shouldEmit && _typeof(props.message) === 'object' && !(0,external_vue_namespaceObject.isVNode)(props.message)) {
|
|
1473
|
+
emit('detail', toolOperation.isDetailShow, props.id);
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1450
1476
|
if (toolOperation.isDetailShow && _typeof(props.message) === 'object' && !(0,external_vue_namespaceObject.isVNode)(props.message)) {
|
|
1451
1477
|
if (props.message.type === MessageContentType.JSON || !props.message.type) {
|
|
1452
1478
|
var targetJson = parseToJson(props.message.details);
|
|
@@ -1457,15 +1483,23 @@ var messageProps = {
|
|
|
1457
1483
|
refJsonContent.value.append(formatter.render());
|
|
1458
1484
|
}
|
|
1459
1485
|
copyMessage();
|
|
1486
|
+
// 详情内容渲染完成后,再 emit 事件以更新位置
|
|
1487
|
+
emitAfterRender();
|
|
1460
1488
|
});
|
|
1461
|
-
}
|
|
1462
|
-
if (props.message.type === MessageContentType.KEY_VALUE) {
|
|
1489
|
+
} else if (props.message.type === MessageContentType.KEY_VALUE) {
|
|
1463
1490
|
setTimeout(function () {
|
|
1464
1491
|
copyMessage();
|
|
1465
1492
|
copyValueItem();
|
|
1493
|
+
// 详情内容渲染完成后,再 emit 事件以更新位置
|
|
1494
|
+
emitAfterRender();
|
|
1466
1495
|
});
|
|
1496
|
+
} else {
|
|
1497
|
+
// 如果没有详情内容需要渲染,立即 emit
|
|
1498
|
+
emitAfterRender();
|
|
1467
1499
|
}
|
|
1468
|
-
|
|
1500
|
+
} else {
|
|
1501
|
+
// 收起详情时,立即 emit 事件
|
|
1502
|
+
emitAfterRender();
|
|
1469
1503
|
}
|
|
1470
1504
|
};
|
|
1471
1505
|
var fixMesage = function fixMesage(_e, isFix) {
|
|
@@ -152,7 +152,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
152
152
|
})>;
|
|
153
153
|
visible: import("vue").Ref<boolean>;
|
|
154
154
|
close: (e: Event) => void;
|
|
155
|
-
setDetailsShow: (e: MouseEvent, isShow?: boolean) => void;
|
|
155
|
+
setDetailsShow: (e: MouseEvent, isShow?: boolean, shouldEmit?: boolean) => void;
|
|
156
156
|
fixMesage: (_e: MouseEvent, isFix?: boolean) => void;
|
|
157
157
|
copyMessage: () => void;
|
|
158
158
|
parseToJson: (value: any) => any;
|
package/lib/notify/index.js
CHANGED
|
@@ -82,7 +82,7 @@ function _defineProperty(obj, key, value) {
|
|
|
82
82
|
;// CONCATENATED MODULE: external "vue"
|
|
83
83
|
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
84
84
|
var y = x => () => x
|
|
85
|
-
const external_vue_namespaceObject = x({ ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
|
85
|
+
const external_vue_namespaceObject = x({ ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
|
86
86
|
;// CONCATENATED MODULE: external "../shared"
|
|
87
87
|
var shared_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
88
88
|
var shared_y = x => () => x
|
|
@@ -125,6 +125,23 @@ var instances = {
|
|
|
125
125
|
'bottom-right': []
|
|
126
126
|
};
|
|
127
127
|
var seed = 1;
|
|
128
|
+
// 更新指定位置的所有 Message 实例的位置
|
|
129
|
+
var updateModalPosition = function updateModalPosition(position, spacing) {
|
|
130
|
+
var initialOffset = 30;
|
|
131
|
+
var offsetTop = initialOffset;
|
|
132
|
+
instances[position].forEach(function (vm) {
|
|
133
|
+
if (vm.el) {
|
|
134
|
+
// 获取当前实例的实际高度(包括详情展开后的高度)
|
|
135
|
+
var currentHeight = vm.el.offsetHeight || 0;
|
|
136
|
+
// 直接更新 DOM 元素的 top 样式,确保位置立即生效
|
|
137
|
+
vm.el.style.top = "".concat(offsetTop, "px");
|
|
138
|
+
// 同时更新 props,保持数据一致性
|
|
139
|
+
vm.props.offsetY = offsetTop;
|
|
140
|
+
// 然后累加当前实例的高度和间距,用于计算下一个实例的位置
|
|
141
|
+
offsetTop += currentHeight + spacing;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
};
|
|
128
145
|
var Message = function Message(constructor, options) {
|
|
129
146
|
var opts = options;
|
|
130
147
|
var position = opts.position || 'top-right';
|
|
@@ -147,17 +164,11 @@ var Message = function Message(constructor, options) {
|
|
|
147
164
|
opts = _objectSpread(_objectSpread({}, opts), {}, {
|
|
148
165
|
offsetX: horizontalOffset,
|
|
149
166
|
offsetY: verticalOffset,
|
|
150
|
-
id: id
|
|
167
|
+
id: id,
|
|
168
|
+
spacing: spacing
|
|
151
169
|
});
|
|
152
170
|
var container = document.createElement('div');
|
|
153
171
|
var vm = (0,external_vue_namespaceObject.createVNode)(constructor, opts);
|
|
154
|
-
// const updateModalPosition = () => {
|
|
155
|
-
// let offsetTop = 30;
|
|
156
|
-
// instances[position].forEach((vm) => {
|
|
157
|
-
// offsetTop += (vm.el.offsetHeight || 0) + spacing;
|
|
158
|
-
// vm.props.offsetY = offsetTop;
|
|
159
|
-
// });
|
|
160
|
-
// };
|
|
161
172
|
vm.props.onDestroy = function (id) {
|
|
162
173
|
use_message_close(id, position, spacing, userOnClose);
|
|
163
174
|
(0,external_vue_namespaceObject.render)(null, container);
|
|
@@ -166,13 +177,19 @@ var Message = function Message(constructor, options) {
|
|
|
166
177
|
instances[position].forEach(function (item) {
|
|
167
178
|
if (item.props.id !== id) {
|
|
168
179
|
var _item$component;
|
|
169
|
-
|
|
180
|
+
// 关闭其他实例的详情时,传入 shouldEmit = false 避免触发无限循环
|
|
181
|
+
(_item$component = item.component) === null || _item$component === void 0 || (_item$component = _item$component.exposed) === null || _item$component === void 0 || _item$component.setDetailsShow(null, false, false);
|
|
170
182
|
}
|
|
171
183
|
});
|
|
172
|
-
//
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
|
|
184
|
+
// 等待 DOM 更新完成后再更新位置
|
|
185
|
+
// 详情展开/收起时,DOM 高度会变化,需要等待渲染完成
|
|
186
|
+
// 由于事件已经在详情内容渲染完成后才 emit,这里只需要等待 Vue 响应式更新和浏览器布局完成
|
|
187
|
+
var currentSpacing = spacing || 10;
|
|
188
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
|
189
|
+
requestAnimationFrame(function () {
|
|
190
|
+
updateModalPosition(position, currentSpacing);
|
|
191
|
+
});
|
|
192
|
+
});
|
|
176
193
|
};
|
|
177
194
|
(0,external_vue_namespaceObject.render)(vm, container);
|
|
178
195
|
instances[position].push(vm);
|
|
@@ -186,21 +203,23 @@ var Message = function Message(constructor, options) {
|
|
|
186
203
|
};
|
|
187
204
|
function use_message_close(id, position, spacing, userOnClose) {
|
|
188
205
|
userOnClose === null || userOnClose === void 0 || userOnClose();
|
|
189
|
-
var verticalProperty = position.startsWith('top') ? 'top' : 'bottom';
|
|
190
206
|
var instanceIndex = -1;
|
|
191
207
|
instances[position].forEach(function (item, index) {
|
|
192
208
|
if (item.props.id === id) {
|
|
193
209
|
instanceIndex = index;
|
|
194
210
|
}
|
|
195
211
|
});
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
var len = instances[position].length;
|
|
199
|
-
for (var i = instanceIndex; i < len; i++) {
|
|
200
|
-
var pos = parseInt(instances[position][i].el.style[verticalProperty], 10) - removeHeight - spacing;
|
|
201
|
-
instances[position][i].component.props.offsetY = pos;
|
|
212
|
+
if (instanceIndex === -1) {
|
|
213
|
+
return;
|
|
202
214
|
}
|
|
215
|
+
// 移除实例
|
|
203
216
|
instances[position].splice(instanceIndex, 1);
|
|
217
|
+
// 重新计算所有剩余实例的位置
|
|
218
|
+
// 使用传入的 spacing,如果没有则从第一个实例获取,或使用默认值 10
|
|
219
|
+
var currentSpacing = spacing || (instances[position].length > 0 ? instances[position][0].props.spacing : 10) || 10;
|
|
220
|
+
(0,external_vue_namespaceObject.nextTick)(function () {
|
|
221
|
+
updateModalPosition(position, currentSpacing);
|
|
222
|
+
});
|
|
204
223
|
}
|
|
205
224
|
/* harmony default export */ const use_message = (Message);
|
|
206
225
|
;// CONCATENATED MODULE: external "vue-types"
|
package/lib/select/common.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare function useRegistry<T>(data: Ref<Map<PropertyKey, T>>): {
|
|
|
11
11
|
register: (key: string, item: T) => Map<PropertyKey, T>;
|
|
12
12
|
unregister: (key: string, item?: T) => void;
|
|
13
13
|
};
|
|
14
|
-
export declare function useDebouncedRef<T>(value: any, delay?: number): Ref<T>;
|
|
15
14
|
export declare function usePopover(config: IPopoverConfig, triggerRef: Ref<HTMLElement>): {
|
|
16
15
|
isPopoverShow: Ref<boolean>;
|
|
17
16
|
popperWidth: Ref<string | number>;
|
package/lib/select/index.js
CHANGED
|
@@ -1089,7 +1089,7 @@ var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
|
1089
1089
|
;// CONCATENATED MODULE: external "vue"
|
|
1090
1090
|
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1091
1091
|
var external_vue_y = x => () => x
|
|
1092
|
-
const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["
|
|
1092
|
+
const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["getCurrentInstance"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeMount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeMount, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["toRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRef, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["vModelText"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vModelText, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
|
1093
1093
|
;// CONCATENATED MODULE: ../../packages/select/src/common.ts
|
|
1094
1094
|
|
|
1095
1095
|
|
|
@@ -1156,32 +1156,6 @@ function useRegistry(data) {
|
|
|
1156
1156
|
unregister: unregister
|
|
1157
1157
|
};
|
|
1158
1158
|
}
|
|
1159
|
-
function useDebouncedRef(value) {
|
|
1160
|
-
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
1161
|
-
var timeout;
|
|
1162
|
-
var innerValue = value;
|
|
1163
|
-
return (0,external_vue_namespaceObject.customRef)(function (track, trigger) {
|
|
1164
|
-
return {
|
|
1165
|
-
get: function get() {
|
|
1166
|
-
track();
|
|
1167
|
-
return innerValue;
|
|
1168
|
-
},
|
|
1169
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1170
|
-
set: function set(newValue) {
|
|
1171
|
-
clearTimeout(timeout);
|
|
1172
|
-
if (newValue === undefined || newValue === '') {
|
|
1173
|
-
innerValue = newValue;
|
|
1174
|
-
trigger();
|
|
1175
|
-
} else {
|
|
1176
|
-
timeout = setTimeout(function () {
|
|
1177
|
-
innerValue = newValue;
|
|
1178
|
-
trigger();
|
|
1179
|
-
}, delay);
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
};
|
|
1183
|
-
});
|
|
1184
|
-
}
|
|
1185
1159
|
function usePopover(config, triggerRef) {
|
|
1186
1160
|
var popoverMinWidth = config.popoverMinWidth;
|
|
1187
1161
|
var observerIns = null;
|
|
@@ -1219,8 +1193,8 @@ function usePopover(config, triggerRef) {
|
|
|
1219
1193
|
};
|
|
1220
1194
|
}
|
|
1221
1195
|
function useRemoteSearch(method, callBack) {
|
|
1222
|
-
var customOptionName =
|
|
1223
|
-
var searchValue =
|
|
1196
|
+
var customOptionName = (0,external_vue_namespaceObject.ref)(''); // 自定义创建选项(自定义创建也会触发搜索)
|
|
1197
|
+
var searchValue = (0,external_vue_namespaceObject.ref)('');
|
|
1224
1198
|
var curSearchValue = (0,external_vue_namespaceObject.computed)(function () {
|
|
1225
1199
|
return searchValue.value || customOptionName.value;
|
|
1226
1200
|
});
|
|
@@ -4107,7 +4081,10 @@ function select_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { v
|
|
|
4107
4081
|
});
|
|
4108
4082
|
// 是否显示select下拉内容
|
|
4109
4083
|
var isShowSelectContent = (0,external_vue_namespaceObject.computed)(function () {
|
|
4110
|
-
|
|
4084
|
+
// 自定义内容时始终显示
|
|
4085
|
+
if (customContent.value) return true;
|
|
4086
|
+
// 加载中、无数据、无搜索结果时不显示下拉内容
|
|
4087
|
+
return !(searchLoading.value || isOptionsEmpty.value || isSearchEmpty.value);
|
|
4111
4088
|
});
|
|
4112
4089
|
// 是否显示全选
|
|
4113
4090
|
var isShowSelectAll = (0,external_vue_namespaceObject.computed)(function () {
|
|
@@ -4962,7 +4939,7 @@ function select_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { v
|
|
|
4962
4939
|
"mode": "spin",
|
|
4963
4940
|
"size": "mini",
|
|
4964
4941
|
"theme": "primary"
|
|
4965
|
-
}, null), (0,external_vue_namespaceObject.createVNode)("span", null, [_this.curContentText])]), (0,external_vue_namespaceObject.createVNode)("div", {
|
|
4942
|
+
}, null), (0,external_vue_namespaceObject.createVNode)("span", null, [_this.curContentText])]), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
|
|
4966
4943
|
"class": _this.resolveClassName('select-content')
|
|
4967
4944
|
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
|
4968
4945
|
"ref": "scrollContainerRef",
|
|
@@ -4984,7 +4961,7 @@ function select_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { v
|
|
|
4984
4961
|
"theme": "primary"
|
|
4985
4962
|
}, null), (0,external_vue_namespaceObject.createVNode)("span", null, [_this.localLoadingText])])])]), ((_this$$slots18 = _this.$slots) === null || _this$$slots18 === void 0 ? void 0 : _this$$slots18.extension) && (0,external_vue_namespaceObject.createVNode)("div", {
|
|
4986
4963
|
"class": _this.resolveClassName('select-extension')
|
|
4987
|
-
}, [(_this$$slots19 = _this.$slots) === null || _this$$slots19 === void 0 ? void 0 : _this$$slots19.extension()])])]);
|
|
4964
|
+
}, [(_this$$slots19 = _this.$slots) === null || _this$$slots19 === void 0 ? void 0 : _this$$slots19.extension()])]), [[external_vue_namespaceObject.vShow, _this.isShowSelectContent]])]);
|
|
4988
4965
|
};
|
|
4989
4966
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
|
4990
4967
|
"class": selectClass
|