bkui-vue 2.0.2-beta.4 → 2.0.2-beta.40
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/cli.css +1 -0
- package/dist/index.cjs.js +132 -132
- package/dist/index.esm.js +15822 -14471
- package/dist/index.umd.js +132 -132
- package/dist/style.variable.css +1 -1
- package/lib/cascader/cascader.css +26 -24
- package/lib/cascader/cascader.d.ts +12 -0
- package/lib/cascader/cascader.less +78 -76
- package/lib/cascader/cascader.variable.css +26 -24
- package/lib/cascader/index.d.ts +26 -0
- package/lib/cascader/index.js +110 -60
- package/lib/checkbox/index.js +1 -1
- package/lib/color-picker/index.js +20 -16
- package/lib/components.d.ts +1 -2
- package/lib/components.js +1 -2
- package/lib/date-picker/index.js +53 -58
- package/lib/date-picker/panel/time.d.ts +1 -1
- package/lib/date-picker/utils.d.ts +5 -17
- package/lib/directives/index.js +17 -13
- package/lib/dropdown/dropdown.d.ts +1 -0
- package/lib/dropdown/index.d.ts +3 -0
- package/lib/dropdown/index.js +11 -6
- package/lib/form/form-item.d.ts +19 -0
- package/lib/form/form.css +16 -4
- package/lib/form/form.less +24 -6
- package/lib/form/form.variable.css +16 -4
- package/lib/form/index.d.ts +13 -0
- package/lib/form/index.js +33 -25
- package/lib/image/index.js +7 -10
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -2
- package/lib/input/index.d.ts +39 -20
- package/lib/input/index.js +24 -21
- package/lib/input/input.d.ts +30 -16
- package/lib/message/index.js +1 -1
- package/lib/modal/index.js +2 -1
- package/lib/pop-confirm/index.d.ts +600 -2
- package/lib/pop-confirm/index.js +20 -8
- package/lib/pop-confirm/pop-confirm.d.ts +297 -1
- package/lib/pop-confirm/props.d.ts +146 -0
- package/lib/popover/index.js +7 -10
- package/lib/search-select/index.d.ts +21 -3
- package/lib/search-select/index.js +62 -30
- package/lib/search-select/input.d.ts +3 -0
- package/lib/search-select/search-select.d.ts +7 -1
- package/lib/search-select/selected.d.ts +6 -0
- package/lib/select/index.d.ts +19 -0
- package/lib/select/index.js +15 -16
- package/lib/select/select.d.ts +10 -0
- package/lib/sideslider/index.js +3 -1
- package/lib/slider/index.js +2 -1
- package/lib/tab/index.js +7 -10
- package/lib/table/index.js +7 -15
- package/lib/tag-input/index.d.ts +3 -0
- package/lib/tag-input/index.js +35 -24
- package/lib/tag-input/tag-input.d.ts +1 -0
- package/lib/tree/constant.d.ts +2 -0
- package/lib/tree/index.d.ts +48 -0
- package/lib/tree/index.js +209 -59
- package/lib/tree/props.d.ts +20 -0
- package/lib/tree/tree.css +46 -0
- package/lib/tree/tree.d.ts +22 -0
- package/lib/tree/tree.less +57 -2
- package/lib/tree/tree.variable.css +46 -0
- package/lib/tree/use-node-action.d.ts +2 -2
- package/package.json +1 -1
- package/dist/style.css +0 -1
- package/lib/plugin-popover/index.d.ts +0 -27
- package/lib/plugin-popover/index.js +0 -65
- package/lib/plugins/index.d.ts +0 -1
- package/lib/plugins/index.js +0 -64
package/lib/cascader/index.js
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
import "../styles/reset.css";
|
2
2
|
import "./cascader.less";
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_plugin_popover_300e25d0__ from "../plugin-popover";
|
4
3
|
import * as __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__ from "@popperjs/core";
|
5
4
|
import * as __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__ from "../loading";
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE__overflow_title_f9bafa47__ from "../overflow-title";
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
9
9
|
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
10
10
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__ from "../config-provider";
|
11
11
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
|
12
|
-
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
|
13
12
|
import "../popover/popover.less";
|
14
13
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_select_1a0d1ad7__ from "../select";
|
15
14
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_tag_d74826be__ from "../tag";
|
@@ -19,7 +18,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_checkbox_13b1cb4a__ from "../
|
|
19
18
|
import "../checkbox/checkbox.less";
|
20
19
|
/******/ var __webpack_modules__ = ({
|
21
20
|
|
22
|
-
/***/
|
21
|
+
/***/ 668:
|
23
22
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
24
23
|
|
25
24
|
|
@@ -158,10 +157,8 @@ ClickOutside.install = function (app) {
|
|
158
157
|
/* harmony default export */ const clickoutside = ((/* unused pure expression or super */ null && (ClickOutside)));
|
159
158
|
// EXTERNAL MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
160
159
|
var esm_typeof = __webpack_require__(6522);
|
161
|
-
|
162
|
-
var
|
163
|
-
var y = x => () => x
|
164
|
-
const plugin_popover_namespaceObject = x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_plugin_popover_300e25d0__["default"] });
|
160
|
+
// EXTERNAL MODULE: external "../popover"
|
161
|
+
var popover_ = __webpack_require__(563);
|
165
162
|
;// CONCATENATED MODULE: ../../packages/directives/src/ellipsis.ts
|
166
163
|
|
167
164
|
/*
|
@@ -239,7 +236,7 @@ var createInstance = function createInstance(el, binding) {
|
|
239
236
|
onContentMouseenter: handleContentEnter,
|
240
237
|
onContentMouseleave: handleContentLeave
|
241
238
|
});
|
242
|
-
instance = (0,
|
239
|
+
instance = (0,popover_.$bkPopover)(targetOptions);
|
243
240
|
}, 300);
|
244
241
|
};
|
245
242
|
var handleMouseLeave = function handleMouseLeave() {
|
@@ -326,9 +323,9 @@ var external_vue_ = __webpack_require__(6609);
|
|
326
323
|
// EXTERNAL MODULE: external "../shared"
|
327
324
|
var shared_ = __webpack_require__(9253);
|
328
325
|
;// CONCATENATED MODULE: external "@popperjs/core"
|
329
|
-
var
|
330
|
-
var
|
331
|
-
const core_namespaceObject =
|
326
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
327
|
+
var y = x => () => x
|
328
|
+
const core_namespaceObject = x({ ["createPopper"]: () => __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__.createPopper });
|
332
329
|
;// CONCATENATED MODULE: ../../packages/directives/src/tooltips.ts
|
333
330
|
|
334
331
|
|
@@ -394,9 +391,6 @@ var tooltips = {
|
|
394
391
|
hide(el);
|
395
392
|
}, 100);
|
396
393
|
});
|
397
|
-
el.addEventListener('click', function () {
|
398
|
-
hide(el);
|
399
|
-
});
|
400
394
|
popper.addEventListener('mouseleave', function () {
|
401
395
|
clearTimeout(delayTimeout);
|
402
396
|
hideTimeout = setTimeout(function () {
|
@@ -410,7 +404,7 @@ var tooltips = {
|
|
410
404
|
show(el);
|
411
405
|
clearTimeout(delayTimeout);
|
412
406
|
}, opts.delay);
|
413
|
-
} else if (popper.hasAttribute('data-show')) {
|
407
|
+
} else if (!el.contains(event.target) && popper.hasAttribute('data-show')) {
|
414
408
|
hide(el);
|
415
409
|
}
|
416
410
|
});
|
@@ -1268,6 +1262,15 @@ normalizeWheel.getEventType = function() /*string*/ {
|
|
1268
1262
|
module.exports = normalizeWheel;
|
1269
1263
|
|
1270
1264
|
|
1265
|
+
/***/ }),
|
1266
|
+
|
1267
|
+
/***/ 563:
|
1268
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
1269
|
+
|
1270
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1271
|
+
var y = x => () => x
|
1272
|
+
module.exports = x({ ["$bkPopover"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__.$bkPopover, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__["default"] });
|
1273
|
+
|
1271
1274
|
/***/ }),
|
1272
1275
|
|
1273
1276
|
/***/ 9253:
|
@@ -1540,16 +1543,14 @@ const external_vue_types_namespaceObject = x({ ["array"]: () => __WEBPACK_EXTERN
|
|
1540
1543
|
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1541
1544
|
var config_provider_y = x => () => x
|
1542
1545
|
const config_provider_namespaceObject = config_provider_x({ ["useLocale"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.useLocale, ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
|
1543
|
-
// EXTERNAL MODULE: ../../packages/directives/src/index.ts +
|
1544
|
-
var src = __webpack_require__(
|
1546
|
+
// EXTERNAL MODULE: ../../packages/directives/src/index.ts + 7 modules
|
1547
|
+
var src = __webpack_require__(668);
|
1545
1548
|
;// CONCATENATED MODULE: external "../icon"
|
1546
1549
|
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1547
1550
|
var icon_y = x => () => x
|
1548
1551
|
const icon_namespaceObject = icon_x({ ["AngleRight"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.AngleRight, ["AngleUp"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.AngleUp, ["Close"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Error, ["Spinner"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Spinner });
|
1549
|
-
|
1550
|
-
var
|
1551
|
-
var popover_y = x => () => x
|
1552
|
-
const popover_namespaceObject = popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__["default"] });
|
1552
|
+
// EXTERNAL MODULE: external "../popover"
|
1553
|
+
var popover_ = __webpack_require__(563);
|
1553
1554
|
;// CONCATENATED MODULE: external "../popover/popover.less"
|
1554
1555
|
var popover_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1555
1556
|
var popover_less_y = x => () => x
|
@@ -1637,7 +1638,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
1637
1638
|
var t = (0,config_provider_namespaceObject.useLocale)('cascader');
|
1638
1639
|
var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
|
1639
1640
|
resolveClassName = _usePrefix.resolveClassName;
|
1640
|
-
var
|
1641
|
+
var _toRefs = (0,external_vue_.toRefs)(props),
|
1642
|
+
store = _toRefs.store;
|
1641
1643
|
var menus = (0,external_vue_.reactive)({
|
1642
1644
|
list: [props.store.getNodes()]
|
1643
1645
|
});
|
@@ -1661,7 +1663,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
1661
1663
|
* @param value - 选中的值数组
|
1662
1664
|
*/
|
1663
1665
|
var updateCheckValue = function updateCheckValue(value) {
|
1664
|
-
if (value.length === 0) {
|
1666
|
+
if (!value || value.length === 0) {
|
1665
1667
|
menus.list = menus.list.slice(0, 1);
|
1666
1668
|
activePath.value = [];
|
1667
1669
|
}
|
@@ -1673,31 +1675,63 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
1673
1675
|
* @param value - 节点ID数组
|
1674
1676
|
*/
|
1675
1677
|
var expandByNodeList = function expandByNodeList(value) {
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1678
|
+
// 判断是否为初始加载
|
1679
|
+
var isInitialLoad = checkValue.value.length === 0;
|
1680
|
+
// 如果是初始加载或单选情况,按原来的逻辑处理
|
1681
|
+
if (isInitialLoad || !store.value.config.multiple) {
|
1682
|
+
var targetList = [];
|
1683
|
+
// 处理多选情况
|
1684
|
+
if (store.value.config.multiple) {
|
1685
|
+
var _iterator = _createForOfIteratorHelper(value),
|
1686
|
+
_step;
|
1687
|
+
try {
|
1688
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
1689
|
+
var subArray = _step.value;
|
1690
|
+
if (subArray.length > targetList.length) {
|
1691
|
+
targetList = subArray;
|
1692
|
+
}
|
1686
1693
|
}
|
1694
|
+
} catch (err) {
|
1695
|
+
_iterator.e(err);
|
1696
|
+
} finally {
|
1697
|
+
_iterator.f();
|
1687
1698
|
}
|
1688
|
-
}
|
1689
|
-
|
1690
|
-
|
1691
|
-
_iterator.f();
|
1699
|
+
} else {
|
1700
|
+
// 单选情况
|
1701
|
+
targetList = value;
|
1692
1702
|
}
|
1693
|
-
|
1694
|
-
targetList
|
1703
|
+
// 执行展开操作
|
1704
|
+
targetList.forEach(function (id) {
|
1705
|
+
var node = store.value.getNodeById(id);
|
1706
|
+
if (node) {
|
1707
|
+
// 只展开,不需要重复触发
|
1708
|
+
var expandNode = function expandNode(node) {
|
1709
|
+
var _node$children;
|
1710
|
+
if (!node || node !== null && node !== void 0 && node.isDisabled) return;
|
1711
|
+
var level = node.level;
|
1712
|
+
// 确保面板只更新到当前节点层级
|
1713
|
+
menus.list = menus.list.slice(0, level);
|
1714
|
+
activePath.value = activePath.value.slice(0, level - 1);
|
1715
|
+
// 如果节点有子节点,直接添加到面板
|
1716
|
+
if ((_node$children = node.children) !== null && _node$children !== void 0 && _node$children.length) {
|
1717
|
+
if (menus.list.length === level) {
|
1718
|
+
menus.list.push(node.children);
|
1719
|
+
activePath.value.push(node);
|
1720
|
+
}
|
1721
|
+
}
|
1722
|
+
};
|
1723
|
+
// 展开节点的所有父节点
|
1724
|
+
var expandParents = function expandParents(node) {
|
1725
|
+
if (node.parent) {
|
1726
|
+
expandParents(node.parent);
|
1727
|
+
}
|
1728
|
+
expandNode(node);
|
1729
|
+
};
|
1730
|
+
expandParents(node);
|
1731
|
+
}
|
1732
|
+
});
|
1695
1733
|
}
|
1696
|
-
//
|
1697
|
-
targetList.forEach(function (id) {
|
1698
|
-
var node = store.getNodeById(id);
|
1699
|
-
nodeExpandHandler(node);
|
1700
|
-
});
|
1734
|
+
// 用户交互过程中的选择由nodeExpandHandler单独处理,这里不干预
|
1701
1735
|
};
|
1702
1736
|
/** 节点选中回调
|
1703
1737
|
* 根据单选、多选配置checkValue
|
@@ -1709,7 +1743,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
1709
1743
|
}
|
1710
1744
|
if (node.config.multiple) {
|
1711
1745
|
// 如果checkAnyLevel,返回所有check的节点; 否则只check 叶子节点
|
1712
|
-
var targets = store.config.checkAnyLevel ? store.getCheckedNodes() : store.getCheckedLeafNodes();
|
1746
|
+
var targets = store.value.config.checkAnyLevel ? store.value.getCheckedNodes() : store.value.getCheckedLeafNodes();
|
1713
1747
|
checkValue.value = targets.map(function (node) {
|
1714
1748
|
return node.path;
|
1715
1749
|
}); // 如果任意级别可选,当前节点即为所选内容
|
@@ -1720,27 +1754,27 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
1720
1754
|
};
|
1721
1755
|
/** node点击展开回调 */
|
1722
1756
|
var nodeExpandHandler = function nodeExpandHandler(node) {
|
1723
|
-
var _node$
|
1757
|
+
var _node$children2;
|
1724
1758
|
if (!node || node !== null && node !== void 0 && node.isDisabled) return;
|
1725
1759
|
menus.list = menus.list.slice(0, node.level);
|
1726
1760
|
activePath.value = activePath.value.slice(0, node.level - 1);
|
1727
1761
|
/** 如果所点击的node具有children元素,则直接展开
|
1728
1762
|
* 否则判断是否开启了远程加载,进行远程加载列表
|
1729
1763
|
*/
|
1730
|
-
if ((_node$
|
1764
|
+
if ((_node$children2 = node.children) !== null && _node$children2 !== void 0 && _node$children2.length) {
|
1731
1765
|
menus.list.push(node.children);
|
1732
1766
|
activePath.value.push(node);
|
1733
1767
|
return;
|
1734
1768
|
}
|
1735
|
-
if (store.config.isRemote && !node.isLeaf) {
|
1769
|
+
if (store.value.config.isRemote && !node.isLeaf) {
|
1736
1770
|
node.loading = true;
|
1737
1771
|
var updateNodes = function updateNodes(nodeData) {
|
1738
|
-
store.appendNodes(nodeData, node || null);
|
1772
|
+
store.value.appendNodes(nodeData, node || null);
|
1739
1773
|
menus.list.push(node.children);
|
1740
1774
|
activePath.value.push(node);
|
1741
1775
|
node.loading = false;
|
1742
1776
|
};
|
1743
|
-
store.config.remoteMethod(node, updateNodes);
|
1777
|
+
store.value.config.remoteMethod(node, updateNodes);
|
1744
1778
|
}
|
1745
1779
|
};
|
1746
1780
|
/**
|
@@ -2398,6 +2432,7 @@ var Store = /*#__PURE__*/function () {
|
|
2398
2432
|
scrollWidth: shared_.PropTypes.oneOfType([shared_.PropTypes.number, shared_.PropTypes.string]).def('auto'),
|
2399
2433
|
customTextFillback: shared_.PropTypes.func,
|
2400
2434
|
customTagsFillback: shared_.PropTypes.func,
|
2435
|
+
changeEmitsNodes: shared_.PropTypes.bool.def(false),
|
2401
2436
|
collapseTags: {
|
2402
2437
|
type: Boolean,
|
2403
2438
|
"default": true
|
@@ -2421,6 +2456,8 @@ var Store = /*#__PURE__*/function () {
|
|
2421
2456
|
setHover = _useHover.setHover,
|
2422
2457
|
cancelHover = _useHover.cancelHover;
|
2423
2458
|
var store = (0,external_vue_.ref)(new src_store(props));
|
2459
|
+
// 用于处理在 removeTag 时, popOver panel 触发 clickOutside 消失的问题
|
2460
|
+
var isAlways = (0,external_vue_.ref)(false);
|
2424
2461
|
// 定义selectedText变量用于记录当前选择的值的文本
|
2425
2462
|
var selectedText = (0,external_vue_.ref)('');
|
2426
2463
|
// 定义selectedTags变量用于记录多选模式下已选的tag
|
@@ -2457,7 +2494,8 @@ var Store = /*#__PURE__*/function () {
|
|
2457
2494
|
var inputRef = (0,external_vue_.ref)(null);
|
2458
2495
|
// 用computed定义placeholder变量,用于处理props中的placeholder属性
|
2459
2496
|
var placeholder = (0,external_vue_.computed)(function () {
|
2460
|
-
|
2497
|
+
var placeholder = props.placeholder ? props.placeholder : t.value.pleaseSelect;
|
2498
|
+
return modelValue.value.length === 0 ? placeholder : '';
|
2461
2499
|
});
|
2462
2500
|
var displayText = (0,external_vue_.computed)(function () {
|
2463
2501
|
if (props.customTextFillback) {
|
@@ -2522,18 +2560,25 @@ var Store = /*#__PURE__*/function () {
|
|
2522
2560
|
};
|
2523
2561
|
// 移除tag
|
2524
2562
|
var removeTag = function removeTag(value, index, e) {
|
2563
|
+
isAlways.value = true;
|
2525
2564
|
e.stopPropagation();
|
2526
2565
|
var current = JSON.parse(JSON.stringify(value));
|
2527
2566
|
var tag = current.splice(index, 1)[0];
|
2528
2567
|
isEdit.value = true; // 删除时也在编辑态,触发overflowTagIndex的计算
|
2529
2568
|
store.value.removeTag(tag);
|
2530
2569
|
updateValue(current);
|
2531
|
-
emit('update:modelValue', store.value.getCheckedNodes()
|
2570
|
+
emit('update:modelValue', store.value.getCheckedNodes()
|
2571
|
+
// a. 开启 checkAnyLevel 后,不过滤任何节点
|
2572
|
+
// b. 关闭 checkAnyLevel 后,只返回叶子节点,避免父节点在子节点全部选中后,同时出现在 modelValue 中
|
2573
|
+
.filter(function (node) {
|
2574
|
+
return store.value.config.checkAnyLevel || node.isLeaf;
|
2575
|
+
}).map(function (node) {
|
2532
2576
|
return node.path;
|
2533
2577
|
}));
|
2534
2578
|
// 计算过后,关闭编辑状态
|
2535
2579
|
setTimeout(function () {
|
2536
2580
|
isEdit.value = isFocus.value;
|
2581
|
+
isAlways.value = false;
|
2537
2582
|
});
|
2538
2583
|
};
|
2539
2584
|
// modelValue的监听函数
|
@@ -2542,7 +2587,8 @@ var Store = /*#__PURE__*/function () {
|
|
2542
2587
|
updateValue(value);
|
2543
2588
|
// 派发相关事件
|
2544
2589
|
emit('update:modelValue', value);
|
2545
|
-
|
2590
|
+
var emitValue = props.changeEmitsNodes ? store.value.getNodeByValue(value) : value;
|
2591
|
+
oldValue !== undefined && emit('change', emitValue); // oldValue = undefined代表初始化,init不派发change事件
|
2546
2592
|
// 如果有过滤搜索,选择后,自动focus到input
|
2547
2593
|
inputRef === null || inputRef === void 0 || (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 || _inputRef$value.focus();
|
2548
2594
|
// 选择后过滤条件清除,面板初始化渲染
|
@@ -2561,10 +2607,9 @@ var Store = /*#__PURE__*/function () {
|
|
2561
2607
|
// popover激活后,focus相应事件
|
2562
2608
|
isFocus.value = val.isShow;
|
2563
2609
|
(0,external_vue_.nextTick)(function () {
|
2564
|
-
var _inputRef$value2;
|
2565
|
-
val && ((_inputRef$value2 = inputRef.value) === null || _inputRef$value2 === void 0 ? void 0 : _inputRef$value2.focus());
|
2566
2610
|
if (val.isShow) {
|
2567
|
-
var _cascaderPanel$value;
|
2611
|
+
var _inputRef$value2, _cascaderPanel$value;
|
2612
|
+
(_inputRef$value2 = inputRef.value) === null || _inputRef$value2 === void 0 || _inputRef$value2.focus();
|
2568
2613
|
(_cascaderPanel$value = cascaderPanel.value) === null || _cascaderPanel$value === void 0 || _cascaderPanel$value.scrollToSelected(); // 滚动到选中的节点
|
2569
2614
|
}
|
2570
2615
|
});
|
@@ -2647,6 +2692,7 @@ var Store = /*#__PURE__*/function () {
|
|
2647
2692
|
overflowTagIndex: overflowTagIndex,
|
2648
2693
|
isCollapse: isCollapse,
|
2649
2694
|
isFocus: isFocus,
|
2695
|
+
isAlways: isAlways,
|
2650
2696
|
store: store,
|
2651
2697
|
updateValue: updateValue,
|
2652
2698
|
selectedText: selectedText,
|
@@ -2677,7 +2723,8 @@ var Store = /*#__PURE__*/function () {
|
|
2677
2723
|
var _this = this;
|
2678
2724
|
// 定义suffixIcon函数,用于根据不同情况渲染后缀图标
|
2679
2725
|
var suffixIcon = function suffixIcon() {
|
2680
|
-
|
2726
|
+
var _this$modelValue;
|
2727
|
+
if (_this.clearable && _this.isHover && !_this.disabled && ((_this$modelValue = _this.modelValue) === null || _this$modelValue === void 0 ? void 0 : _this$modelValue.length) > 0) {
|
2681
2728
|
// 当可清空、鼠标悬浮且未禁用时,渲染清空图标
|
2682
2729
|
return (0,external_vue_.createVNode)(icon_namespaceObject.Close, {
|
2683
2730
|
"class": _this.resolveClassName('icon-clear-icon'),
|
@@ -2742,12 +2789,14 @@ var Store = /*#__PURE__*/function () {
|
|
2742
2789
|
};
|
2743
2790
|
// 定义popoverRender函数,用于渲染弹出框
|
2744
2791
|
var popoverRender = function popoverRender() {
|
2745
|
-
return (0,external_vue_.createVNode)(
|
2792
|
+
return (0,external_vue_.createVNode)(popover_["default"], {
|
2746
2793
|
"ref": "popover",
|
2747
2794
|
"class": _this.resolveClassName('cascader-popover-wrapper'),
|
2795
|
+
"always": _this.isAlways,
|
2748
2796
|
"arrow": false,
|
2749
2797
|
"boundary": "body",
|
2750
2798
|
"disabled": _this.disabled,
|
2799
|
+
"hideIgnoreReference": true,
|
2751
2800
|
"offset": 4,
|
2752
2801
|
"placement": "bottom-start",
|
2753
2802
|
"referenceCls": _this.resolveClassName('cascader-popover-reference'),
|
@@ -2776,6 +2825,7 @@ var Store = /*#__PURE__*/function () {
|
|
2776
2825
|
}, null) : textRender()]);
|
2777
2826
|
},
|
2778
2827
|
content: function content() {
|
2828
|
+
var _this$$slots$extensio, _this$$slots;
|
2779
2829
|
return (0,external_vue_.createVNode)("div", {
|
2780
2830
|
"class": _this.resolveClassName('cascader-popover')
|
2781
2831
|
}, [(0,external_vue_.createVNode)(cascader_panel, {
|
@@ -2797,7 +2847,7 @@ var Store = /*#__PURE__*/function () {
|
|
2797
2847
|
"class": _this.resolveClassName('cascader-node-name')
|
2798
2848
|
}, [scope.node.name]);
|
2799
2849
|
}
|
2800
|
-
})]);
|
2850
|
+
}), (_this$$slots$extensio = (_this$$slots = _this.$slots).extension) === null || _this$$slots$extensio === void 0 ? void 0 : _this$$slots$extensio.call(_this$$slots)]);
|
2801
2851
|
}
|
2802
2852
|
});
|
2803
2853
|
};
|
@@ -2806,7 +2856,7 @@ var Store = /*#__PURE__*/function () {
|
|
2806
2856
|
}, [this.$slots.trigger ? popoverRender() : (0,external_vue_.createVNode)("div", {
|
2807
2857
|
"ref": "bkCascaderRef",
|
2808
2858
|
"class": [this.resolveClassName('cascader'), this.extCls, {
|
2809
|
-
'is-unselected': this.modelValue.length === 0,
|
2859
|
+
'is-unselected': !this.modelValue || this.modelValue.length === 0,
|
2810
2860
|
'is-hover': this.isHover,
|
2811
2861
|
'is-filterable': this.filterable,
|
2812
2862
|
'is-focus': this.isFocus,
|
package/lib/checkbox/index.js
CHANGED
@@ -232,7 +232,7 @@ var useCheckbox = function useCheckbox() {
|
|
232
232
|
}
|
233
233
|
(0,external_vue_namespaceObject.nextTick)(function () {
|
234
234
|
// 选中状态保持同步
|
235
|
-
if (inputRef.value.checked !== isChecked.value) {
|
235
|
+
if (inputRef.value && inputRef.value.checked !== isChecked.value) {
|
236
236
|
inputRef.value.checked = isChecked.value;
|
237
237
|
}
|
238
238
|
});
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import "../styles/reset.css";
|
2
2
|
import "./color-picker.less";
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_plugin_popover_300e25d0__ from "../plugin-popover";
|
4
3
|
import * as __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__ from "@popperjs/core";
|
5
4
|
import * as __WEBPACK_EXTERNAL_MODULE__loading_4d683b23__ from "../loading";
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE__overflow_title_f9bafa47__ from "../overflow-title";
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__ from "../popover";
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__ from "../shared";
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
9
9
|
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
@@ -12,7 +12,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_date_picker_d04526d6__ from "
|
|
12
12
|
import * as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__ from "../icon";
|
13
13
|
/******/ var __webpack_modules__ = ({
|
14
14
|
|
15
|
-
/***/
|
15
|
+
/***/ 668:
|
16
16
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
17
17
|
|
18
18
|
|
@@ -151,10 +151,8 @@ ClickOutside.install = function (app) {
|
|
151
151
|
/* harmony default export */ const clickoutside = (ClickOutside);
|
152
152
|
// EXTERNAL MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
153
153
|
var esm_typeof = __webpack_require__(6522);
|
154
|
-
|
155
|
-
var
|
156
|
-
var y = x => () => x
|
157
|
-
const plugin_popover_namespaceObject = x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_plugin_popover_300e25d0__["default"] });
|
154
|
+
// EXTERNAL MODULE: external "../popover"
|
155
|
+
var popover_ = __webpack_require__(563);
|
158
156
|
;// CONCATENATED MODULE: ../../packages/directives/src/ellipsis.ts
|
159
157
|
|
160
158
|
/*
|
@@ -232,7 +230,7 @@ var createInstance = function createInstance(el, binding) {
|
|
232
230
|
onContentMouseenter: handleContentEnter,
|
233
231
|
onContentMouseleave: handleContentLeave
|
234
232
|
});
|
235
|
-
instance = (0,
|
233
|
+
instance = (0,popover_.$bkPopover)(targetOptions);
|
236
234
|
}, 300);
|
237
235
|
};
|
238
236
|
var handleMouseLeave = function handleMouseLeave() {
|
@@ -319,9 +317,9 @@ var external_vue_ = __webpack_require__(6609);
|
|
319
317
|
// EXTERNAL MODULE: external "../shared"
|
320
318
|
var shared_ = __webpack_require__(9253);
|
321
319
|
;// CONCATENATED MODULE: external "@popperjs/core"
|
322
|
-
var
|
323
|
-
var
|
324
|
-
const core_namespaceObject =
|
320
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
321
|
+
var y = x => () => x
|
322
|
+
const core_namespaceObject = x({ ["createPopper"]: () => __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__.createPopper });
|
325
323
|
;// CONCATENATED MODULE: ../../packages/directives/src/tooltips.ts
|
326
324
|
|
327
325
|
|
@@ -387,9 +385,6 @@ var tooltips = {
|
|
387
385
|
hide(el);
|
388
386
|
}, 100);
|
389
387
|
});
|
390
|
-
el.addEventListener('click', function () {
|
391
|
-
hide(el);
|
392
|
-
});
|
393
388
|
popper.addEventListener('mouseleave', function () {
|
394
389
|
clearTimeout(delayTimeout);
|
395
390
|
hideTimeout = setTimeout(function () {
|
@@ -403,7 +398,7 @@ var tooltips = {
|
|
403
398
|
show(el);
|
404
399
|
clearTimeout(delayTimeout);
|
405
400
|
}, opts.delay);
|
406
|
-
} else if (popper.hasAttribute('data-show')) {
|
401
|
+
} else if (!el.contains(event.target) && popper.hasAttribute('data-show')) {
|
407
402
|
hide(el);
|
408
403
|
}
|
409
404
|
});
|
@@ -1261,6 +1256,15 @@ normalizeWheel.getEventType = function() /*string*/ {
|
|
1261
1256
|
module.exports = normalizeWheel;
|
1262
1257
|
|
1263
1258
|
|
1259
|
+
/***/ }),
|
1260
|
+
|
1261
|
+
/***/ 563:
|
1262
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
1263
|
+
|
1264
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1265
|
+
var y = x => () => x
|
1266
|
+
module.exports = x({ ["$bkPopover"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__.$bkPopover });
|
1267
|
+
|
1264
1268
|
/***/ }),
|
1265
1269
|
|
1266
1270
|
/***/ 9253:
|
@@ -1537,8 +1541,8 @@ const config_provider_namespaceObject = config_provider_x({ ["usePrefix"]: () =>
|
|
1537
1541
|
var date_picker_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1538
1542
|
var date_picker_y = x => () => x
|
1539
1543
|
const date_picker_namespaceObject = date_picker_x({ ["PickerDropdown"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_date_picker_d04526d6__.PickerDropdown });
|
1540
|
-
// EXTERNAL MODULE: ../../packages/directives/src/index.ts +
|
1541
|
-
var src = __webpack_require__(
|
1544
|
+
// EXTERNAL MODULE: ../../packages/directives/src/index.ts + 7 modules
|
1545
|
+
var src = __webpack_require__(668);
|
1542
1546
|
;// CONCATENATED MODULE: external "../icon"
|
1543
1547
|
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1544
1548
|
var icon_y = x => () => x
|
package/lib/components.d.ts
CHANGED
@@ -32,9 +32,8 @@ export { default as Navigation } from './navigation';
|
|
32
32
|
export { default as Notify } from './notify';
|
33
33
|
export { default as OverflowTitle } from './overflow-title';
|
34
34
|
export { default as Pagination } from './pagination';
|
35
|
-
export { default as $bkPopover } from './plugin-popover';
|
36
35
|
export { default as PopConfirm } from './pop-confirm';
|
37
|
-
export { default as Popover } from './popover';
|
36
|
+
export { default as Popover, $bkPopover } from './popover';
|
38
37
|
export { default as Popover2 } from './popover2';
|
39
38
|
export { default as Process } from './process';
|
40
39
|
export { default as Progress } from './progress';
|
package/lib/components.js
CHANGED
@@ -56,9 +56,8 @@ export { default as Navigation } from './navigation';
|
|
56
56
|
export { default as Notify } from './notify';
|
57
57
|
export { default as OverflowTitle } from './overflow-title';
|
58
58
|
export { default as Pagination } from './pagination';
|
59
|
-
export { default as $bkPopover } from './plugin-popover';
|
60
59
|
export { default as PopConfirm } from './pop-confirm';
|
61
|
-
export { default as Popover } from './popover';
|
60
|
+
export { default as Popover, $bkPopover } from './popover';
|
62
61
|
export { default as Popover2 } from './popover2';
|
63
62
|
export { default as Process } from './process';
|
64
63
|
export { default as Progress } from './progress';
|