bkui-vue 2.0.1-beta.72.fix.1 → 2.0.1-beta.74
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 +45 -45
- package/dist/index.esm.js +13514 -13416
- package/dist/index.umd.js +59 -59
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/cascader/index.js +8 -6
- package/lib/color-picker/color-picker.d.ts +16 -0
- package/lib/color-picker/index.d.ts +23 -0
- package/lib/color-picker/index.js +8 -1
- package/lib/dialog/dialog.d.ts +6 -6
- package/lib/dialog/index.d.ts +12 -12
- package/lib/dialog/index.js +3 -1
- package/lib/dialog/props.d.ts +3 -3
- package/lib/index.js +1 -1
- package/lib/input/index.js +42 -521
- package/lib/input/input.css +23 -1
- package/lib/input/input.less +30 -1
- package/lib/input/input.variable.css +23 -1
- package/lib/modal/index.d.ts +13 -13
- package/lib/modal/index.js +7 -7
- package/lib/modal/modal.d.ts +5 -5
- package/lib/modal/props.mixin.d.ts +2 -2
- package/lib/plugin-popover/index.js +2 -1
- package/lib/popover/index.js +2 -1
- package/lib/resize-layout/index.js +4 -0
- package/lib/search-select/index.d.ts +60 -6
- package/lib/search-select/index.js +201 -89
- package/lib/search-select/input.d.ts +12 -2
- package/lib/search-select/menu.d.ts +12 -0
- package/lib/search-select/search-select.css +0 -1
- package/lib/search-select/search-select.d.ts +18 -4
- package/lib/search-select/search-select.less +1 -1
- package/lib/search-select/search-select.variable.css +0 -1
- package/lib/search-select/selected.d.ts +23 -0
- package/lib/select/common.d.ts +1 -1
- package/lib/select/index.d.ts +6 -0
- package/lib/select/index.js +35 -12
- package/lib/select/select.d.ts +2 -0
- package/lib/select/selectTagInput.d.ts +1 -0
- package/lib/select/type.d.ts +2 -2
- package/lib/sideslider/index.d.ts +11 -11
- package/lib/sideslider/sideslider.d.ts +5 -5
- package/lib/tab/index.d.ts +22 -0
- package/lib/tab/index.js +32 -10
- package/lib/tab/props.d.ts +10 -0
- package/lib/tab/tab-nav.d.ts +12 -2
- package/lib/tab/tab-panel.d.ts +22 -0
- package/lib/tab/tab.css +64 -0
- package/lib/tab/tab.less +91 -4
- package/lib/tab/tab.variable.css +64 -0
- package/lib/table/hooks/use-settings.d.ts +2 -0
- package/lib/table/index.js +66 -7
- package/lib/table/props.d.ts +5 -4
- package/lib/table/table.css +6 -0
- package/lib/table/table.less +14 -0
- package/lib/table/table.variable.css +6 -0
- package/lib/table/utils.d.ts +1 -0
- package/lib/tag-input/common.d.ts +1 -1
- package/lib/tag-input/index.d.ts +3 -0
- package/lib/tag-input/index.js +12 -3
- package/lib/tag-input/tag-input.css +9 -9
- package/lib/tag-input/tag-input.d.ts +3 -14
- package/lib/tag-input/tag-input.less +9 -9
- package/lib/tag-input/tag-input.variable.css +9 -9
- package/lib/upload/index.js +31 -9
- package/package.json +1 -1
@@ -493,7 +493,7 @@ const directives_namespaceObject = directives_x({ ["clickoutside"]: () => __WEBP
|
|
493
493
|
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
494
494
|
var icon_y = x => () => x
|
495
495
|
const icon_namespaceObject = icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Error, ["ExclamationCircleShape"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.ExclamationCircleShape, ["Search"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Search });
|
496
|
-
;// CONCATENATED MODULE: ../../node_modules/resize-detector/esm/index.js
|
496
|
+
;// CONCATENATED MODULE: ../../node_modules/@blueking/fork-resize-detector/esm/index.js
|
497
497
|
var raf = null;
|
498
498
|
function requestAnimationFrame (callback) {
|
499
499
|
if (!raf) {
|
@@ -559,7 +559,7 @@ function getComputedStyle (elem, prop, pseudo) {
|
|
559
559
|
}
|
560
560
|
|
561
561
|
function getRenderInfo (elem) {
|
562
|
-
if (!document.documentElement.contains(elem)) {
|
562
|
+
if (!elem || !document.documentElement.contains(elem)) {
|
563
563
|
return {
|
564
564
|
detached: true,
|
565
565
|
rendered: false
|
@@ -567,7 +567,7 @@ function getRenderInfo (elem) {
|
|
567
567
|
}
|
568
568
|
|
569
569
|
var current = elem;
|
570
|
-
while (current !== document) {
|
570
|
+
while (current && current !== document) {
|
571
571
|
if (getComputedStyle(current, 'display') === 'none') {
|
572
572
|
return {
|
573
573
|
detached: false,
|
@@ -1308,6 +1308,12 @@ var SelectedItem = /*#__PURE__*/function () {
|
|
1308
1308
|
logical: {
|
1309
1309
|
type: String,
|
1310
1310
|
"default": SearchLogical.OR
|
1311
|
+
},
|
1312
|
+
maxHeight: {
|
1313
|
+
type: Number,
|
1314
|
+
"default": function _default() {
|
1315
|
+
return 392;
|
1316
|
+
}
|
1311
1317
|
}
|
1312
1318
|
},
|
1313
1319
|
emits: ['selectItem', 'selectCondition', 'footerClick', 'update:logical'],
|
@@ -1329,6 +1335,11 @@ var SelectedItem = /*#__PURE__*/function () {
|
|
1329
1335
|
}
|
1330
1336
|
return props.footerBtns;
|
1331
1337
|
});
|
1338
|
+
var resolveContentStyles = (0,external_vue_namespaceObject.computed)(function () {
|
1339
|
+
return {
|
1340
|
+
maxHeight: "".concat(props.maxHeight, "px")
|
1341
|
+
};
|
1342
|
+
});
|
1332
1343
|
// events
|
1333
1344
|
function handleClick(item) {
|
1334
1345
|
emit('selectItem', item);
|
@@ -1398,6 +1409,7 @@ var SelectedItem = /*#__PURE__*/function () {
|
|
1398
1409
|
getSearchNode: getSearchNode,
|
1399
1410
|
localFooterBtns: localFooterBtns,
|
1400
1411
|
resolveClassName: resolveClassName,
|
1412
|
+
resolveContentStyles: resolveContentStyles,
|
1401
1413
|
t: t
|
1402
1414
|
};
|
1403
1415
|
},
|
@@ -1452,6 +1464,7 @@ var SelectedItem = /*#__PURE__*/function () {
|
|
1452
1464
|
})])]);
|
1453
1465
|
};
|
1454
1466
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1467
|
+
"style": this.resolveContentStyles,
|
1455
1468
|
"class": this.resolveClassName('search-select-menu')
|
1456
1469
|
}, [!!((_this$conditions = this.conditions) !== null && _this$conditions !== void 0 && _this$conditions.length) && (0,external_vue_namespaceObject.createVNode)("ul", {
|
1457
1470
|
"class": "menu-header"
|
@@ -1471,6 +1484,9 @@ var SelectedItem = /*#__PURE__*/function () {
|
|
1471
1484
|
|
1472
1485
|
|
1473
1486
|
|
1487
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = input_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; } } }; }
|
1488
|
+
function input_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return input_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 input_arrayLikeToArray(o, minLen); }
|
1489
|
+
function input_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
1474
1490
|
|
1475
1491
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
1476
1492
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
@@ -1532,6 +1548,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
1532
1548
|
type: String,
|
1533
1549
|
"default": SearchInputMode.DEFAULT
|
1534
1550
|
},
|
1551
|
+
maxHeight: {
|
1552
|
+
type: Number,
|
1553
|
+
"default": function _default() {
|
1554
|
+
return 392;
|
1555
|
+
}
|
1556
|
+
},
|
1535
1557
|
getMenuList: Function,
|
1536
1558
|
validateValues: Function,
|
1537
1559
|
valueBehavior: String
|
@@ -2055,7 +2077,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
2055
2077
|
function _setMenuList() {
|
2056
2078
|
_setMenuList = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee5() {
|
2057
2079
|
var _props$data, _usingItem$value$sear, _usingItem$value$valu;
|
2058
|
-
var list, _usingItem$value14, _keyword$value3, hoverItem;
|
2080
|
+
var list, _usingItem$value14, _keyword$value3, _iterator, _step, item, isMatched, _list, filterList, _iterator2, _step2, child, _list2, _filterList, _iterator3, _step3, _child, hoverItem;
|
2059
2081
|
return regenerator_default().wrap(function _callee5$(_context5) {
|
2060
2082
|
while (1) switch (_context5.prev = _context5.next) {
|
2061
2083
|
case 0:
|
@@ -2080,51 +2102,79 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
2080
2102
|
list = props.data.filter(function (item) {
|
2081
2103
|
return !item.isSelected;
|
2082
2104
|
}).slice();
|
2083
|
-
} else
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
2091
|
-
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2101
|
-
|
2102
|
-
|
2103
|
-
|
2104
|
-
|
2105
|
-
|
2106
|
-
|
2107
|
-
|
2108
|
-
|
2109
|
-
|
2110
|
-
|
2111
|
-
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2115
|
-
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2105
|
+
} else {
|
2106
|
+
_iterator = _createForOfIteratorHelper(props.data.filter(function (item) {
|
2107
|
+
return !item.isSelected;
|
2108
|
+
}));
|
2109
|
+
try {
|
2110
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
2111
|
+
item = _step.value;
|
2112
|
+
isMatched = item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
|
2113
|
+
if (isMatched) {
|
2114
|
+
list.push(item);
|
2115
|
+
filterList = [];
|
2116
|
+
_iterator2 = _createForOfIteratorHelper(item.children || []);
|
2117
|
+
try {
|
2118
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
2119
|
+
child = _step2.value;
|
2120
|
+
filterList.push(_objectSpread(_objectSpread({}, item), {}, {
|
2121
|
+
realId: item.id,
|
2122
|
+
id: (0,shared_namespaceObject.random)(10),
|
2123
|
+
value: child
|
2124
|
+
}));
|
2125
|
+
}
|
2126
|
+
} catch (err) {
|
2127
|
+
_iterator2.e(err);
|
2128
|
+
} finally {
|
2129
|
+
_iterator2.f();
|
2130
|
+
}
|
2131
|
+
if (!filterList.length && !item.onlyRecommendChildren) {
|
2132
|
+
filterList.push(_objectSpread(_objectSpread({}, item), {}, {
|
2133
|
+
realId: item.id,
|
2134
|
+
id: (0,shared_namespaceObject.random)(10),
|
2135
|
+
value: {
|
2136
|
+
id: keyword.value,
|
2137
|
+
name: keyword.value
|
2138
|
+
}
|
2139
|
+
}));
|
2140
|
+
}
|
2141
|
+
(_list = list).push.apply(_list, filterList);
|
2142
|
+
} else {
|
2143
|
+
_filterList = [];
|
2144
|
+
_iterator3 = _createForOfIteratorHelper(item.children || []);
|
2145
|
+
try {
|
2146
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
2147
|
+
_child = _step3.value;
|
2148
|
+
if (_child.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase())) {
|
2149
|
+
_filterList.push(_objectSpread(_objectSpread({}, item), {}, {
|
2150
|
+
realId: item.id,
|
2151
|
+
id: (0,shared_namespaceObject.random)(10),
|
2152
|
+
value: _child
|
2153
|
+
}));
|
2154
|
+
}
|
2155
|
+
}
|
2156
|
+
} catch (err) {
|
2157
|
+
_iterator3.e(err);
|
2158
|
+
} finally {
|
2159
|
+
_iterator3.f();
|
2160
|
+
}
|
2161
|
+
if (!_filterList.length && !item.onlyRecommendChildren) {
|
2162
|
+
_filterList.push(_objectSpread(_objectSpread({}, item), {}, {
|
2163
|
+
value: {
|
2164
|
+
id: keyword.value,
|
2165
|
+
name: keyword.value
|
2166
|
+
}
|
2167
|
+
}));
|
2168
|
+
}
|
2169
|
+
(_list2 = list).push.apply(_list2, _filterList);
|
2123
2170
|
}
|
2124
|
-
}
|
2125
|
-
|
2171
|
+
}
|
2172
|
+
} catch (err) {
|
2173
|
+
_iterator.e(err);
|
2174
|
+
} finally {
|
2175
|
+
_iterator.f();
|
2126
2176
|
}
|
2127
|
-
}
|
2177
|
+
}
|
2128
2178
|
} else if (usingItem.value.type === 'condition') {
|
2129
2179
|
list = props.conditions;
|
2130
2180
|
} else if (!((_usingItem$value$valu = usingItem.value.values) !== null && _usingItem$value$valu !== void 0 && _usingItem$value$valu.length) || usingItem.value.multiple || props.mode === SearchInputMode.EDIT) {
|
@@ -2479,6 +2529,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
2479
2529
|
"keyword": _this.keyword,
|
2480
2530
|
"list": _this.menuList,
|
2481
2531
|
"logical": (_this$usingItem4 = _this.usingItem) === null || _this$usingItem4 === void 0 ? void 0 : _this$usingItem4.logical,
|
2532
|
+
"maxHeight": _this.maxHeight,
|
2482
2533
|
"multiple": !!multiple,
|
2483
2534
|
"selected": (values === null || values === void 0 ? void 0 : values.map(function (item) {
|
2484
2535
|
return item.id;
|
@@ -2552,6 +2603,12 @@ function selected_objectSpread(e) { for (var r = 1; r < arguments.length; r++) {
|
|
2552
2603
|
type: Number,
|
2553
2604
|
"default": -1
|
2554
2605
|
},
|
2606
|
+
maxHeight: {
|
2607
|
+
type: Number,
|
2608
|
+
"default": function _default() {
|
2609
|
+
return 392;
|
2610
|
+
}
|
2611
|
+
},
|
2555
2612
|
conditions: {
|
2556
2613
|
type: Array,
|
2557
2614
|
"default": function _default() {
|
@@ -2633,6 +2690,7 @@ function selected_objectSpread(e) { for (var r = 1; r < arguments.length; r++) {
|
|
2633
2690
|
"data": _this.data,
|
2634
2691
|
"defaultUsingItem": _this.copySelectedItem(item),
|
2635
2692
|
"getMenuList": _this.getMenuList,
|
2693
|
+
"maxHeight": _this.maxHeight,
|
2636
2694
|
"mode": SearchInputMode.EDIT,
|
2637
2695
|
"showCondition": false,
|
2638
2696
|
"validateValues": _this.validateValues,
|
@@ -2668,6 +2726,9 @@ function selected_objectSpread(e) { for (var r = 1; r < arguments.length; r++) {
|
|
2668
2726
|
|
2669
2727
|
function search_select_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
2670
2728
|
function search_select_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? search_select_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : search_select_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
2729
|
+
function search_select_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = search_select_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; } } }; }
|
2730
|
+
function search_select_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return search_select_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 search_select_arrayLikeToArray(o, minLen); }
|
2731
|
+
function search_select_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
2671
2732
|
/*
|
2672
2733
|
* Tencent is pleased to support the open source community by making
|
2673
2734
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
@@ -2705,6 +2766,7 @@ function search_select_objectSpread(e) { for (var r = 1; r < arguments.length; r
|
|
2705
2766
|
var INPUT_PADDING_WIDTH = 40;
|
2706
2767
|
var SELECTED_MARGIN_RIGHT = 6;
|
2707
2768
|
var INPUT_MIN_HEIGHT = 26;
|
2769
|
+
var MENU_ITEM_MIN_HEIGHT = 32;
|
2708
2770
|
var SearchSelectProps = {
|
2709
2771
|
data: {
|
2710
2772
|
type: Array,
|
@@ -2720,7 +2782,8 @@ var SearchSelectProps = {
|
|
2720
2782
|
},
|
2721
2783
|
maxHeight: {
|
2722
2784
|
type: Number,
|
2723
|
-
|
2785
|
+
// 默认展示12条,加上列表8px的padding
|
2786
|
+
"default": MENU_ITEM_MIN_HEIGHT * 12 + 8
|
2724
2787
|
},
|
2725
2788
|
conditions: {
|
2726
2789
|
type: Array,
|
@@ -2793,13 +2856,24 @@ var SearchSelectProps = {
|
|
2793
2856
|
(0,external_vue_namespaceObject.watch)(function () {
|
2794
2857
|
return props.data;
|
2795
2858
|
}, function () {
|
2796
|
-
var _copyData$value;
|
2797
2859
|
copyData.value = JSON.parse(JSON.stringify(props.data));
|
2798
|
-
|
2799
|
-
|
2800
|
-
|
2801
|
-
|
2802
|
-
|
2860
|
+
var _iterator = search_select_createForOfIteratorHelper(copyData.value || []),
|
2861
|
+
_step;
|
2862
|
+
try {
|
2863
|
+
var _loop = function _loop() {
|
2864
|
+
var item = _step.value;
|
2865
|
+
item.isSelected = props.uniqueSelect && props.modelValue.some(function (set) {
|
2866
|
+
return set.id === item.id;
|
2867
|
+
});
|
2868
|
+
};
|
2869
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
2870
|
+
_loop();
|
2871
|
+
}
|
2872
|
+
} catch (err) {
|
2873
|
+
_iterator.e(err);
|
2874
|
+
} finally {
|
2875
|
+
_iterator.f();
|
2876
|
+
}
|
2803
2877
|
}, {
|
2804
2878
|
immediate: true
|
2805
2879
|
});
|
@@ -2808,50 +2882,84 @@ var SearchSelectProps = {
|
|
2808
2882
|
return props.modelValue;
|
2809
2883
|
}, function (v) {
|
2810
2884
|
if (!(v !== null && v !== void 0 && v.length)) {
|
2811
|
-
var _copyData$value2;
|
2812
2885
|
selectedList.value = [];
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2886
|
+
var _iterator2 = search_select_createForOfIteratorHelper(copyData.value || []),
|
2887
|
+
_step2;
|
2888
|
+
try {
|
2889
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
2890
|
+
var item = _step2.value;
|
2891
|
+
item.isSelected = false;
|
2892
|
+
}
|
2893
|
+
} catch (err) {
|
2894
|
+
_iterator2.e(err);
|
2895
|
+
} finally {
|
2896
|
+
_iterator2.f();
|
2897
|
+
}
|
2816
2898
|
return;
|
2817
2899
|
}
|
2818
2900
|
var list = [];
|
2819
|
-
|
2820
|
-
|
2821
|
-
|
2822
|
-
|
2823
|
-
|
2824
|
-
selected
|
2825
|
-
|
2826
|
-
list.push(selected);
|
2827
|
-
} else {
|
2828
|
-
var _item$values;
|
2829
|
-
var searchItem = props.data.find(function (set) {
|
2830
|
-
return set.id === item.id;
|
2901
|
+
var _iterator3 = search_select_createForOfIteratorHelper(v),
|
2902
|
+
_step3;
|
2903
|
+
try {
|
2904
|
+
var _loop2 = function _loop2() {
|
2905
|
+
var item = _step3.value;
|
2906
|
+
var selected = selectedList.value.find(function (set) {
|
2907
|
+
return set.id === item.id && set.name === item.name;
|
2831
2908
|
});
|
2832
|
-
|
2833
|
-
|
2834
|
-
|
2909
|
+
if ((selected === null || selected === void 0 ? void 0 : selected.toValueKey()) === JSON.stringify(item)) {
|
2910
|
+
selected.values = item.values || [];
|
2911
|
+
selected.logical = item.logical || SearchLogical.OR;
|
2912
|
+
list.push(selected);
|
2913
|
+
} else {
|
2914
|
+
var _item$values;
|
2915
|
+
var searchItem = props.data.find(function (set) {
|
2835
2916
|
return set.id === item.id;
|
2836
2917
|
});
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
2918
|
+
var searchType = 'default';
|
2919
|
+
if (!searchItem) {
|
2920
|
+
searchItem = props.conditions.find(function (set) {
|
2921
|
+
return set.id === item.id;
|
2922
|
+
});
|
2923
|
+
if (searchItem) {
|
2924
|
+
searchType = 'condition';
|
2925
|
+
}
|
2926
|
+
}
|
2927
|
+
if (!searchItem && !((_item$values = item.values) !== null && _item$values !== void 0 && _item$values.length)) {
|
2928
|
+
searchType = 'text';
|
2929
|
+
}
|
2930
|
+
var newSelected = new SelectedItem(searchItem || item, searchType);
|
2931
|
+
newSelected.values = item.values || [];
|
2932
|
+
newSelected.logical = item.logical || SearchLogical.OR;
|
2933
|
+
list.push(newSelected);
|
2841
2934
|
}
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
list.push(newSelected);
|
2935
|
+
};
|
2936
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
2937
|
+
_loop2();
|
2846
2938
|
}
|
2847
|
-
})
|
2939
|
+
} catch (err) {
|
2940
|
+
_iterator3.e(err);
|
2941
|
+
} finally {
|
2942
|
+
_iterator3.f();
|
2943
|
+
}
|
2848
2944
|
selectedList.value = list;
|
2849
2945
|
copyData.value = JSON.parse(JSON.stringify(props.data || []));
|
2850
|
-
copyData.value
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2946
|
+
var _iterator4 = search_select_createForOfIteratorHelper(copyData.value),
|
2947
|
+
_step4;
|
2948
|
+
try {
|
2949
|
+
var _loop3 = function _loop3() {
|
2950
|
+
var item = _step4.value;
|
2951
|
+
item.isSelected = props.uniqueSelect && !!list.some(function (set) {
|
2952
|
+
return set.id === item.id;
|
2953
|
+
});
|
2954
|
+
};
|
2955
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
2956
|
+
_loop3();
|
2957
|
+
}
|
2958
|
+
} catch (err) {
|
2959
|
+
_iterator4.e(err);
|
2960
|
+
} finally {
|
2961
|
+
_iterator4.f();
|
2962
|
+
}
|
2855
2963
|
}, {
|
2856
2964
|
immediate: true,
|
2857
2965
|
deep: true
|
@@ -2956,7 +3064,9 @@ var SearchSelectProps = {
|
|
2956
3064
|
}));
|
2957
3065
|
}
|
2958
3066
|
function handleInputFocus(v) {
|
2959
|
-
|
3067
|
+
if (v) {
|
3068
|
+
overflowIndex.value = -1;
|
3069
|
+
}
|
2960
3070
|
if (v === false) {
|
2961
3071
|
var _wrapRef$value$queryS;
|
2962
3072
|
(_wrapRef$value$queryS = wrapRef.value.querySelector(".".concat(resolveClassName('search-select-container')))) === null || _wrapRef$value$queryS === void 0 || _wrapRef$value$queryS.scrollTo(0, 0);
|
@@ -3017,13 +3127,14 @@ var SearchSelectProps = {
|
|
3017
3127
|
"class": "search-prefix"
|
3018
3128
|
}, [(_this$$slots$prepend = (_this$$slots2 = this.$slots).prepend) === null || _this$$slots$prepend === void 0 ? void 0 : _this$$slots$prepend.call(_this$$slots2)]), (0,external_vue_namespaceObject.createVNode)("div", {
|
3019
3129
|
"style": {
|
3020
|
-
|
3130
|
+
'max-height': "".concat(maxHeight, "px")
|
3021
3131
|
},
|
3022
3132
|
"class": "search-container"
|
3023
3133
|
}, [(0,external_vue_namespaceObject.createVNode)(selected, {
|
3024
3134
|
"conditions": this.localConditions,
|
3025
3135
|
"data": this.copyData,
|
3026
3136
|
"getMenuList": this.getMenuList,
|
3137
|
+
"maxHeight": this.maxHeight,
|
3027
3138
|
"overflowIndex": this.overflowIndex,
|
3028
3139
|
"selectedList": this.selectedList,
|
3029
3140
|
"validateValues": this.validateValues,
|
@@ -3038,6 +3149,7 @@ var SearchSelectProps = {
|
|
3038
3149
|
"conditions": this.localConditions,
|
3039
3150
|
"data": this.copyData,
|
3040
3151
|
"getMenuList": this.getMenuList,
|
3152
|
+
"maxHeight": this.maxHeight,
|
3041
3153
|
"placeholder": this.placeholder || this.t.pleaseSelect,
|
3042
3154
|
"showCondition": showCondition,
|
3043
3155
|
"showInputBefore": !this.selectedList.length,
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import { GetMenuListFunc, ICommonItem, IMenuFooterItem, ISearchItem, MenuSlotParams,
|
1
|
+
import { SearchInputMode, SearchLogical, ValueBehavior, SelectedItem } from './utils';
|
2
|
+
import type { GetMenuListFunc, ICommonItem, IMenuFooterItem, ISearchItem, MenuSlotParams, SearchItemType, ValidateValuesFunc } from './utils';
|
3
|
+
import type { PropType, Ref, SlotsType } from 'vue';
|
3
4
|
declare const _default: import("vue").DefineComponent<{
|
4
5
|
data: {
|
5
6
|
type: PropType<ISearchItem[]>;
|
@@ -18,6 +19,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
18
19
|
type: PropType<SearchInputMode>;
|
19
20
|
default: SearchInputMode;
|
20
21
|
};
|
22
|
+
maxHeight: {
|
23
|
+
type: NumberConstructor;
|
24
|
+
default: () => number;
|
25
|
+
};
|
21
26
|
getMenuList: PropType<GetMenuListFunc>;
|
22
27
|
validateValues: PropType<ValidateValuesFunc>;
|
23
28
|
valueBehavior: PropType<ValueBehavior>;
|
@@ -96,6 +101,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
96
101
|
type: PropType<SearchInputMode>;
|
97
102
|
default: SearchInputMode;
|
98
103
|
};
|
104
|
+
maxHeight: {
|
105
|
+
type: NumberConstructor;
|
106
|
+
default: () => number;
|
107
|
+
};
|
99
108
|
getMenuList: PropType<GetMenuListFunc>;
|
100
109
|
validateValues: PropType<ValidateValuesFunc>;
|
101
110
|
valueBehavior: PropType<ValueBehavior>;
|
@@ -105,6 +114,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
105
114
|
onAdd?: (...args: any[]) => any;
|
106
115
|
onSelectKey?: (...args: any[]) => any;
|
107
116
|
}, {
|
117
|
+
maxHeight: number;
|
108
118
|
mode: SearchInputMode;
|
109
119
|
conditions: ICommonItem[];
|
110
120
|
showInputBefore: boolean;
|
@@ -32,6 +32,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
32
32
|
type: PropType<SearchLogical>;
|
33
33
|
default: SearchLogical;
|
34
34
|
};
|
35
|
+
maxHeight: {
|
36
|
+
type: NumberConstructor;
|
37
|
+
default: () => number;
|
38
|
+
};
|
35
39
|
}, {
|
36
40
|
handleClick: (item: ICommonItem) => void;
|
37
41
|
handleClickCondition: (item: ICommonItem) => void;
|
@@ -50,6 +54,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
50
54
|
disabled: boolean;
|
51
55
|
})[]>;
|
52
56
|
resolveClassName: (cls: string) => string;
|
57
|
+
resolveContentStyles: import("vue").ComputedRef<{
|
58
|
+
maxHeight: string;
|
59
|
+
}>;
|
53
60
|
t: import("vue").ComputedRef<{
|
54
61
|
pleaseSelect: string;
|
55
62
|
loading: string;
|
@@ -92,12 +99,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
92
99
|
type: PropType<SearchLogical>;
|
93
100
|
default: SearchLogical;
|
94
101
|
};
|
102
|
+
maxHeight: {
|
103
|
+
type: NumberConstructor;
|
104
|
+
default: () => number;
|
105
|
+
};
|
95
106
|
}>> & {
|
96
107
|
onSelectItem?: (...args: any[]) => any;
|
97
108
|
onSelectCondition?: (...args: any[]) => any;
|
98
109
|
onFooterClick?: (...args: any[]) => any;
|
99
110
|
"onUpdate:logical"?: (...args: any[]) => any;
|
100
111
|
}, {
|
112
|
+
maxHeight: number;
|
101
113
|
multiple: boolean;
|
102
114
|
selected: string[];
|
103
115
|
logical: SearchLogical;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PropType, ShallowRef } from 'vue';
|
1
|
+
import { PropType, ShallowRef, VNode } from 'vue';
|
2
2
|
import { type SlotsType } from 'vue';
|
3
3
|
import { GetMenuListFunc, ICommonItem, ISearchItem, ISearchValue, MenuSlotParams, SearchItemType, SearchLogical, SelectedItem, ValidateValuesFunc, ValueBehavior } from './utils';
|
4
4
|
export declare const SearchSelectProps: {
|
@@ -87,6 +87,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
87
87
|
type: PropType<import("./utils").SearchInputMode>;
|
88
88
|
default: import("./utils").SearchInputMode;
|
89
89
|
};
|
90
|
+
maxHeight: {
|
91
|
+
type: NumberConstructor;
|
92
|
+
default: () => number;
|
93
|
+
};
|
90
94
|
getMenuList: PropType<GetMenuListFunc>;
|
91
95
|
validateValues: PropType<ValidateValuesFunc>;
|
92
96
|
valueBehavior: PropType<ValueBehavior>;
|
@@ -170,6 +174,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
170
174
|
type: PropType<import("./utils").SearchInputMode>;
|
171
175
|
default: import("./utils").SearchInputMode;
|
172
176
|
};
|
177
|
+
maxHeight: {
|
178
|
+
type: NumberConstructor;
|
179
|
+
default: () => number;
|
180
|
+
};
|
173
181
|
getMenuList: PropType<GetMenuListFunc>;
|
174
182
|
validateValues: PropType<ValidateValuesFunc>;
|
175
183
|
valueBehavior: PropType<ValueBehavior>;
|
@@ -179,6 +187,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
179
187
|
onAdd?: (...args: any[]) => any;
|
180
188
|
onSelectKey?: (...args: any[]) => any;
|
181
189
|
}, {
|
190
|
+
maxHeight: number;
|
182
191
|
mode: import("./utils").SearchInputMode;
|
183
192
|
conditions: ICommonItem[];
|
184
193
|
showInputBefore: boolean;
|
@@ -210,6 +219,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
210
219
|
type: PropType<import("./utils").SearchInputMode>;
|
211
220
|
default: import("./utils").SearchInputMode;
|
212
221
|
};
|
222
|
+
maxHeight: {
|
223
|
+
type: NumberConstructor;
|
224
|
+
default: () => number;
|
225
|
+
};
|
213
226
|
getMenuList: PropType<GetMenuListFunc>;
|
214
227
|
validateValues: PropType<ValidateValuesFunc>;
|
215
228
|
valueBehavior: PropType<ValueBehavior>;
|
@@ -276,6 +289,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
276
289
|
logical: string;
|
277
290
|
}>;
|
278
291
|
}, {}, {}, {}, {
|
292
|
+
maxHeight: number;
|
279
293
|
mode: import("./utils").SearchInputMode;
|
280
294
|
conditions: ICommonItem[];
|
281
295
|
showInputBefore: boolean;
|
@@ -455,8 +469,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
455
469
|
uniqueSelect: boolean;
|
456
470
|
}, SlotsType<{
|
457
471
|
menu: MenuSlotParams;
|
458
|
-
prepend:
|
459
|
-
append:
|
460
|
-
validate:
|
472
|
+
prepend: () => VNode;
|
473
|
+
append: () => VNode;
|
474
|
+
validate: () => VNode;
|
461
475
|
}>>;
|
462
476
|
export default _default;
|