bkui-vue 0.0.2-beta.89 → 0.0.2-beta.90
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 +20 -20
- package/dist/index.esm.js +534 -533
- package/dist/index.umd.js +20 -20
- package/lib/select/index.d.ts +4 -9
- package/lib/select/index.js +17 -10
- package/lib/select/select.d.ts +2 -5
- package/package.json +1 -1
package/lib/select/index.d.ts
CHANGED
@@ -42,7 +42,6 @@ declare const BkSelect: {
|
|
42
42
|
allowEmptyValues?: unknown[];
|
43
43
|
autoFocus?: boolean;
|
44
44
|
keepSearchValue?: boolean;
|
45
|
-
filterOption?: boolean | Function;
|
46
45
|
class?: unknown;
|
47
46
|
style?: unknown;
|
48
47
|
onFocus?: (...args: any[]) => any;
|
@@ -99,6 +98,7 @@ declare const BkSelect: {
|
|
99
98
|
"onScroll-end"?: (...args: any[]) => any;
|
100
99
|
"onTag-remove"?: (...args: any[]) => any;
|
101
100
|
onDeselect?: (...args: any[]) => any;
|
101
|
+
readonly filterOption?: Function;
|
102
102
|
};
|
103
103
|
$attrs: {
|
104
104
|
[x: string]: unknown;
|
@@ -401,8 +401,7 @@ declare const BkSelect: {
|
|
401
401
|
default: "checkbox" | "check";
|
402
402
|
};
|
403
403
|
filterOption: {
|
404
|
-
type:
|
405
|
-
default: boolean;
|
404
|
+
type: FunctionConstructor;
|
406
405
|
};
|
407
406
|
}>> & {
|
408
407
|
onFocus?: (...args: any[]) => any;
|
@@ -843,7 +842,6 @@ declare const BkSelect: {
|
|
843
842
|
allowEmptyValues: unknown[];
|
844
843
|
autoFocus: boolean;
|
845
844
|
keepSearchValue: boolean;
|
846
|
-
filterOption: boolean | Function;
|
847
845
|
}, {}, string, {}> & {
|
848
846
|
beforeCreate?: (() => void) | (() => void)[];
|
849
847
|
created?: (() => void) | (() => void)[];
|
@@ -1152,8 +1150,7 @@ declare const BkSelect: {
|
|
1152
1150
|
default: "checkbox" | "check";
|
1153
1151
|
};
|
1154
1152
|
filterOption: {
|
1155
|
-
type:
|
1156
|
-
default: boolean;
|
1153
|
+
type: FunctionConstructor;
|
1157
1154
|
};
|
1158
1155
|
}>> & {
|
1159
1156
|
onFocus?: (...args: any[]) => any;
|
@@ -1848,8 +1845,7 @@ declare const BkSelect: {
|
|
1848
1845
|
default: "checkbox" | "check";
|
1849
1846
|
};
|
1850
1847
|
filterOption: {
|
1851
|
-
type:
|
1852
|
-
default: boolean;
|
1848
|
+
type: FunctionConstructor;
|
1853
1849
|
};
|
1854
1850
|
}>> & {
|
1855
1851
|
onFocus?: (...args: any[]) => any;
|
@@ -2290,7 +2286,6 @@ declare const BkSelect: {
|
|
2290
2286
|
allowEmptyValues: unknown[];
|
2291
2287
|
autoFocus: boolean;
|
2292
2288
|
keepSearchValue: boolean;
|
2293
|
-
filterOption: boolean | Function;
|
2294
2289
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]> & Readonly<{
|
2295
2290
|
Option: import("vue").DefineComponent<{
|
2296
2291
|
id: {
|
package/lib/select/index.js
CHANGED
@@ -1346,8 +1346,7 @@ function select_objectSpread(target) { for (var i = 1; i < arguments.length; i++
|
|
1346
1346
|
prefix: external_shared_namespaceObject.PropTypes.string,
|
1347
1347
|
selectedStyle: (0,external_shared_namespaceObject.SelectedType)(),
|
1348
1348
|
filterOption: {
|
1349
|
-
type:
|
1350
|
-
"default": true
|
1349
|
+
type: Function
|
1351
1350
|
} // 配置当前options的过滤规则
|
1352
1351
|
},
|
1353
1352
|
|
@@ -1450,6 +1449,9 @@ function select_objectSpread(target) { for (var i = 1; i < arguments.length; i++
|
|
1450
1449
|
return pre;
|
1451
1450
|
}, {});
|
1452
1451
|
});
|
1452
|
+
(0,external_vue_namespaceObject.watch)([optionsMap, list], function () {
|
1453
|
+
handleSetSelectedData();
|
1454
|
+
});
|
1453
1455
|
(0,external_vue_namespaceObject.watch)(modelValue, function () {
|
1454
1456
|
handleSetSelectedData();
|
1455
1457
|
if (props.withValidate) {
|
@@ -1467,7 +1469,10 @@ function select_objectSpread(target) { for (var i = 1; i < arguments.length; i++
|
|
1467
1469
|
var virtualList = (0,external_vue_namespaceObject.computed)(function () {
|
1468
1470
|
return isRemoteSearch.value ? list.value : list.value.filter(function (item) {
|
1469
1471
|
var _toLowerCase;
|
1470
|
-
|
1472
|
+
if (hasFilterOptionFunc.value) {
|
1473
|
+
return !!filterOption.value(searchKey.value, item);
|
1474
|
+
}
|
1475
|
+
return (_toLowerCase = toLowerCase(String(item[displayKey.value]))) === null || _toLowerCase === void 0 ? void 0 : _toLowerCase.includes(toLowerCase(searchKey.value));
|
1471
1476
|
});
|
1472
1477
|
});
|
1473
1478
|
// select组件是否禁用
|
@@ -1514,11 +1519,9 @@ function select_objectSpread(target) { for (var i = 1; i < arguments.length; i++
|
|
1514
1519
|
return filterable.value && typeof remoteMethod.value === 'function';
|
1515
1520
|
});
|
1516
1521
|
// options过滤函数
|
1517
|
-
var
|
1518
|
-
if (typeof filterOption.value === 'function') return
|
1519
|
-
return
|
1520
|
-
return filterOption.value;
|
1521
|
-
};
|
1522
|
+
var hasFilterOptionFunc = (0,external_vue_namespaceObject.computed)(function () {
|
1523
|
+
if (filterOption.value && typeof filterOption.value === 'function') return true;
|
1524
|
+
return false;
|
1522
1525
|
});
|
1523
1526
|
// 是否显示select下拉内容
|
1524
1527
|
var isShowSelectContent = (0,external_vue_namespaceObject.computed)(function () {
|
@@ -1633,8 +1636,12 @@ function select_objectSpread(target) { for (var i = 1; i < arguments.length; i++
|
|
1633
1636
|
});
|
1634
1637
|
} else {
|
1635
1638
|
options.value.forEach(function (option) {
|
1636
|
-
|
1637
|
-
|
1639
|
+
if (hasFilterOptionFunc.value) {
|
1640
|
+
option.visible = !!filterOption.value(value, select_objectSpread(select_objectSpread({}, option.$props), option.$attrs));
|
1641
|
+
} else {
|
1642
|
+
var _toLowerCase2;
|
1643
|
+
option.visible = (_toLowerCase2 = toLowerCase(String(option.optionName))) === null || _toLowerCase2 === void 0 ? void 0 : _toLowerCase2.includes(toLowerCase(value));
|
1644
|
+
}
|
1638
1645
|
});
|
1639
1646
|
}
|
1640
1647
|
};
|
package/lib/select/select.d.ts
CHANGED
@@ -288,8 +288,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
288
288
|
default: "checkbox" | "check";
|
289
289
|
};
|
290
290
|
filterOption: {
|
291
|
-
type:
|
292
|
-
default: boolean;
|
291
|
+
type: FunctionConstructor;
|
293
292
|
};
|
294
293
|
}, {
|
295
294
|
selected: import("vue").Ref<{
|
@@ -969,8 +968,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
969
968
|
default: "checkbox" | "check";
|
970
969
|
};
|
971
970
|
filterOption: {
|
972
|
-
type:
|
973
|
-
default: boolean;
|
971
|
+
type: FunctionConstructor;
|
974
972
|
};
|
975
973
|
}>> & {
|
976
974
|
onFocus?: (...args: any[]) => any;
|
@@ -1021,6 +1019,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
1021
1019
|
allowEmptyValues: unknown[];
|
1022
1020
|
autoFocus: boolean;
|
1023
1021
|
keepSearchValue: boolean;
|
1024
|
-
filterOption: boolean | Function;
|
1025
1022
|
}, {}>;
|
1026
1023
|
export default _default;
|