bkui-vue 0.0.1-beta.442 → 0.0.1-beta.444
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 +18 -18
- package/dist/index.esm.js +32 -12
- package/dist/index.umd.js +18 -18
- package/lib/search-select/index.d.ts +47 -3
- package/lib/search-select/index.js +1 -1
- package/lib/search-select/input.d.ts +2 -0
- package/lib/search-select/search-select.d.ts +17 -1
- package/lib/search-select/selected.d.ts +2 -0
- package/lib/table/components/table-column.d.ts +35 -39
- package/lib/table/index.d.ts +101 -117
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +3 -0
- package/lib/table-column/index.d.ts +101 -117
- package/lib/table-column/index.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -17422,6 +17422,7 @@ const IColumnType = {
|
|
17422
17422
|
list: PropTypes.arrayOf(PropTypes.any).def([]),
|
17423
17423
|
filterFn: PropTypes.func.def(void 0),
|
17424
17424
|
match: fullType,
|
17425
|
+
checked: PropTypes.arrayOf(PropTypes.any).def([]),
|
17425
17426
|
filterScope: sortScopeType,
|
17426
17427
|
btnSave: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]).def("\u786E\u5B9A"),
|
17427
17428
|
btnReset: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]).def("\u91CD\u7F6E")
|
@@ -19133,13 +19134,18 @@ var HeadFilter = defineComponent({
|
|
19133
19134
|
setup(props2, {
|
19134
19135
|
emit
|
19135
19136
|
}) {
|
19137
|
+
var _a, _b;
|
19136
19138
|
const t2 = useLocale("table");
|
19137
19139
|
const {
|
19138
19140
|
column
|
19139
19141
|
} = props2;
|
19142
|
+
const {
|
19143
|
+
filter
|
19144
|
+
} = toRefs(props2.column);
|
19145
|
+
const checked = ref((_b = (_a = filter.value) == null ? void 0 : _a.checked) != null ? _b : []);
|
19140
19146
|
const state = reactive({
|
19141
19147
|
isOpen: false,
|
19142
|
-
checked:
|
19148
|
+
checked: checked.value
|
19143
19149
|
});
|
19144
19150
|
const headClass = computed(() => classes({
|
19145
19151
|
[resolveClassName("table-head-action")]: true,
|
@@ -19162,21 +19168,21 @@ var HeadFilter = defineComponent({
|
|
19162
19168
|
const localData = computed(() => {
|
19163
19169
|
const {
|
19164
19170
|
list = []
|
19165
|
-
} =
|
19171
|
+
} = filter.value;
|
19166
19172
|
return list;
|
19167
19173
|
});
|
19168
19174
|
const getRegExp = (searchValue, flags = "ig") => new RegExp(`${searchValue}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), flags);
|
19169
|
-
const defaultFilterFn = (
|
19175
|
+
const defaultFilterFn = (checked2, row) => {
|
19170
19176
|
const {
|
19171
19177
|
match: match2
|
19172
|
-
} =
|
19178
|
+
} = filter.value;
|
19173
19179
|
const matchText = getRowText(row, resolvePropVal(column, "field", [column, row]), column);
|
19174
19180
|
if (match2 === "full") {
|
19175
|
-
|
19181
|
+
checked2.includes(matchText);
|
19176
19182
|
}
|
19177
|
-
return
|
19183
|
+
return checked2.some((str) => getRegExp(str, "img").test(matchText));
|
19178
19184
|
};
|
19179
|
-
const filterFn = typeof
|
19185
|
+
const filterFn = typeof filter.value.filterFn === "function" ? (checked2, row, index2, data2) => filter.value.filterFn(checked2, row, props2.column, index2, data2) : (checked2, row) => checked2.length ? defaultFilterFn(checked2, row) : true;
|
19180
19186
|
const handleBtnSaveClick = () => {
|
19181
19187
|
handleFilterChange(true);
|
19182
19188
|
emit("filterSave", [...state.checked]);
|
@@ -19187,11 +19193,12 @@ var HeadFilter = defineComponent({
|
|
19187
19193
|
disabled
|
19188
19194
|
} = resolveBtnOption(btnSave, t2.value.confirm);
|
19189
19195
|
if (disabled || btnSaveClick) {
|
19190
|
-
if (
|
19196
|
+
if (filter.value === "custom") {
|
19191
19197
|
emit("change", [...state.checked], null);
|
19192
19198
|
state.isOpen = false;
|
19193
19199
|
return;
|
19194
19200
|
}
|
19201
|
+
filter.value.checked = state.checked;
|
19195
19202
|
emit("change", [...state.checked], filterFn);
|
19196
19203
|
}
|
19197
19204
|
};
|
@@ -19213,7 +19220,7 @@ var HeadFilter = defineComponent({
|
|
19213
19220
|
const {
|
19214
19221
|
btnSave,
|
19215
19222
|
btnReset
|
19216
|
-
} =
|
19223
|
+
} = filter.value;
|
19217
19224
|
const renderSaveBtn = () => {
|
19218
19225
|
const {
|
19219
19226
|
disabled,
|
@@ -40159,6 +40166,7 @@ var SearchSelectInput = defineComponent({
|
|
40159
40166
|
showInputBefore: Boolean,
|
40160
40167
|
showCondition: Boolean,
|
40161
40168
|
clickOutside: Function,
|
40169
|
+
placeholder: String,
|
40162
40170
|
conditions: {
|
40163
40171
|
type: Array,
|
40164
40172
|
default: () => []
|
@@ -40662,7 +40670,7 @@ var SearchSelectInput = defineComponent({
|
|
40662
40670
|
"input-after": showInputAfter
|
40663
40671
|
},
|
40664
40672
|
"contenteditable": true,
|
40665
|
-
"data-placeholder": !inputInnerHtml && !this.keyword ? this.
|
40673
|
+
"data-placeholder": !inputInnerHtml && !this.keyword ? this.placeholder : "",
|
40666
40674
|
"data-tips": placeholder || "",
|
40667
40675
|
"spellcheck": "false",
|
40668
40676
|
"onFocus": this.handleInputFocus,
|
@@ -40841,6 +40849,7 @@ const SearchSelectProps = {
|
|
40841
40849
|
type: Boolean,
|
40842
40850
|
default: true
|
40843
40851
|
},
|
40852
|
+
placeholder: String,
|
40844
40853
|
getMenuList: Function,
|
40845
40854
|
validateValues: Function,
|
40846
40855
|
valueSplitCode: {
|
@@ -40865,7 +40874,7 @@ var Component$1 = defineComponent({
|
|
40865
40874
|
clickoutside: ClickOutside
|
40866
40875
|
},
|
40867
40876
|
props: SearchSelectProps,
|
40868
|
-
emits: ["update:modelValue"],
|
40877
|
+
emits: ["update:modelValue", "search"],
|
40869
40878
|
setup(props2, {
|
40870
40879
|
emit
|
40871
40880
|
}) {
|
@@ -41026,9 +41035,16 @@ var Component$1 = defineComponent({
|
|
41026
41035
|
emit("update:modelValue", list.map((item) => item.toValue()));
|
41027
41036
|
}
|
41028
41037
|
function handleInputFocus(v2) {
|
41038
|
+
var _a;
|
41029
41039
|
v2 && (overflowIndex.value = -1);
|
41040
|
+
if (v2 === false) {
|
41041
|
+
(_a = wrapRef.value.querySelector(".bk-search-select-container")) == null ? void 0 : _a.scrollTo(0, 0);
|
41042
|
+
}
|
41030
41043
|
isFocus.value = v2;
|
41031
41044
|
}
|
41045
|
+
function handleClickSearch(e) {
|
41046
|
+
emit("search", e);
|
41047
|
+
}
|
41032
41048
|
return {
|
41033
41049
|
inputRef,
|
41034
41050
|
wrapRef,
|
@@ -41047,7 +41063,9 @@ var Component$1 = defineComponent({
|
|
41047
41063
|
handleInputOutside,
|
41048
41064
|
handleAddSelected,
|
41049
41065
|
handleDeleteSelected,
|
41050
|
-
|
41066
|
+
handleClickSearch,
|
41067
|
+
localConditions,
|
41068
|
+
t: t2
|
41051
41069
|
};
|
41052
41070
|
},
|
41053
41071
|
render() {
|
@@ -41093,6 +41111,7 @@ var Component$1 = defineComponent({
|
|
41093
41111
|
"showInputBefore": !this.selectedList.length,
|
41094
41112
|
"showCondition": showCondition,
|
41095
41113
|
"conditions": this.localConditions,
|
41114
|
+
"placeholder": this.placeholder || this.t.pleaseSelect,
|
41096
41115
|
"clickOutside": this.handleInputOutside,
|
41097
41116
|
"getMenuList": this.getMenuList,
|
41098
41117
|
"validateValues": this.validateValues,
|
@@ -41106,6 +41125,7 @@ var Component$1 = defineComponent({
|
|
41106
41125
|
"class": "search-clear",
|
41107
41126
|
"onClick": this.handleClearAll
|
41108
41127
|
}, null), this.$slots.append ? this.$slots.append() : createVNode(search, {
|
41128
|
+
"onClick": this.handleClickSearch,
|
41109
41129
|
"class": `search-nextfix-icon ${this.isFocus ? "is-focus" : ""}`
|
41110
41130
|
}, null)])]), !!this.validateStr.length && createVNode("div", {
|
41111
41131
|
"class": "bk-search-select-tips"
|