bkui-vue 0.0.1-beta.194 → 0.0.1-beta.195
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 +58 -70
- package/dist/index.umd.js +24 -24
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/popover/index.d.ts +26 -1
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.d.ts +11 -0
- package/lib/popover/props.d.ts +5 -0
- package/lib/tag-input/common.d.ts +1 -1
- package/lib/tag-input/index.d.ts +376 -24
- package/lib/tag-input/index.js +1 -1
- package/lib/tag-input/tag-input.css +23 -23
- package/lib/tag-input/tag-input.d.ts +178 -8
- package/lib/tag-input/tag-input.less +101 -101
- package/lib/tag-input/tag-input.variable.css +23 -23
- package/lib/tag-input/tag-props.d.ts +79 -0
- package/package.json +1 -1
- package/lib/styles/mixins/animate.css +0 -21
package/dist/index.esm.js
CHANGED
@@ -33,7 +33,7 @@ var __publicField = (obj, key2, value) => {
|
|
33
33
|
__defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
|
34
34
|
return value;
|
35
35
|
};
|
36
|
-
import { inject, createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, Transition, provide, createTextVNode, isVNode, withDirectives, vShow, renderSlot, Fragment, toRefs, createApp, Teleport, resolveDirective, customRef, onBeforeMount, toRef, vModelText, unref, watchEffect, onUpdated, render as render$1, onUnmounted, shallowRef, toRaw, withModifiers, TransitionGroup } from "vue";
|
36
|
+
import { inject, createVNode, h as h$1, mergeProps, defineComponent, reactive, ref, computed, watch, onMounted, onBeforeUnmount, getCurrentInstance, nextTick, Transition, provide, createTextVNode, isVNode, withDirectives, vShow, renderSlot, Fragment, toRefs, createApp, Teleport, resolveDirective, customRef, onBeforeMount, toRef, vModelText, unref, watchEffect, markRaw, onUpdated, render as render$1, onUnmounted, shallowRef, toRaw, withModifiers, TransitionGroup } from "vue";
|
37
37
|
var reset = "";
|
38
38
|
var alert = "";
|
39
39
|
var affix = "";
|
@@ -10680,6 +10680,7 @@ const EventProps$2 = {
|
|
10680
10680
|
onAfterShow: Function
|
10681
10681
|
};
|
10682
10682
|
const PopoverProps$1 = __spreadValues({
|
10683
|
+
contentCls: PropTypes.string.def(""),
|
10683
10684
|
isShow: PropTypes.bool.def(false),
|
10684
10685
|
always: PropTypes.bool.def(false),
|
10685
10686
|
disabled: PropTypes.bool.def(false),
|
@@ -10818,11 +10819,13 @@ var Component$q = defineComponent({
|
|
10818
10819
|
const handleAfterLeave = () => {
|
10819
10820
|
ctx.emit("after-leave");
|
10820
10821
|
};
|
10821
|
-
const
|
10822
|
-
const customTheme = compTheme.value.customThemes.reduce((out, cur) => __spreadValues({
|
10822
|
+
const customTheme = computed(() => compTheme.value.customThemes.reduce((out, cur) => __spreadValues({
|
10823
10823
|
[`data-${cur}-theme`]: true
|
10824
|
-
}, out), {});
|
10825
|
-
const contentClass =
|
10824
|
+
}, out), {}));
|
10825
|
+
const contentClass = computed(() => {
|
10826
|
+
const customThemeCls = compTheme.value.customThemes.join(" ");
|
10827
|
+
return `bk-popover-content ${customThemeCls} ${props2.contentCls}`.trim();
|
10828
|
+
});
|
10826
10829
|
const handleClickContent = (e) => {
|
10827
10830
|
const stopBehaviorFn = (behavior) => {
|
10828
10831
|
if (typeof e[behavior] === "function") {
|
@@ -10853,9 +10856,9 @@ var Component$q = defineComponent({
|
|
10853
10856
|
var _a2, _b2, _c;
|
10854
10857
|
return [createVNode("div", mergeProps({
|
10855
10858
|
"ref": refContent,
|
10856
|
-
"class": contentClass,
|
10859
|
+
"class": contentClass.value,
|
10857
10860
|
"style": compStyle.value
|
10858
|
-
}, customTheme, {
|
10861
|
+
}, customTheme.value, {
|
10859
10862
|
"onClick": handleClickContent
|
10860
10863
|
}), [(_c = (_b2 = (_a2 = ctx.slots).content) == null ? void 0 : _b2.call(_a2)) != null ? _c : content.value, arrow2.value && createVNode("div", {
|
10861
10864
|
"class": "arrow",
|
@@ -18884,12 +18887,12 @@ function useFlatList(props2) {
|
|
18884
18887
|
displayKey,
|
18885
18888
|
list
|
18886
18889
|
} = toRefs(props2);
|
18887
|
-
const flatList =
|
18890
|
+
const flatList = ref([]);
|
18888
18891
|
watch([useGroup, saveKey, displayKey, list], () => {
|
18889
|
-
flatList.
|
18890
|
-
let formatList = list.value;
|
18892
|
+
flatList.value = [];
|
18893
|
+
let formatList = markRaw(list.value);
|
18891
18894
|
if (useGroup.value) {
|
18892
|
-
formatList =
|
18895
|
+
formatList = formatList.reduce((formatList2, item) => {
|
18893
18896
|
let children = [];
|
18894
18897
|
if (item.children) {
|
18895
18898
|
children = item.children.map((child) => __spreadValues({
|
@@ -18902,16 +18905,8 @@ function useFlatList(props2) {
|
|
18902
18905
|
return formatList2.concat(children);
|
18903
18906
|
}, []);
|
18904
18907
|
}
|
18905
|
-
|
18906
|
-
}, { immediate: true
|
18907
|
-
function appendToTargetList(targetList) {
|
18908
|
-
const QUANTUM = 3e4;
|
18909
|
-
const len = targetList.length;
|
18910
|
-
for (let i2 = 0; i2 < len; i2 += QUANTUM) {
|
18911
|
-
const appendList = targetList.slice(i2, Math.min(i2 + QUANTUM, len));
|
18912
|
-
flatList.push(...appendList);
|
18913
|
-
}
|
18914
|
-
}
|
18908
|
+
flatList.value = formatList;
|
18909
|
+
}, { immediate: true });
|
18915
18910
|
return flatList;
|
18916
18911
|
}
|
18917
18912
|
const getCharLength = (str) => {
|
@@ -19003,7 +18998,8 @@ const tagProps = () => ({
|
|
19003
18998
|
withValidate: {
|
19004
18999
|
type: Boolean,
|
19005
19000
|
default: true
|
19006
|
-
}
|
19001
|
+
},
|
19002
|
+
popoverProps: Object
|
19007
19003
|
});
|
19008
19004
|
var TagRender = defineComponent({
|
19009
19005
|
name: "TagRender",
|
@@ -19042,7 +19038,7 @@ var Component$c = defineComponent({
|
|
19042
19038
|
isHover: false,
|
19043
19039
|
focusItemIndex: props2.allowCreate ? -1 : 0
|
19044
19040
|
});
|
19045
|
-
const popoverProps = reactive({
|
19041
|
+
const popoverProps = reactive(__spreadValues({
|
19046
19042
|
isShow: false,
|
19047
19043
|
width: 190,
|
19048
19044
|
modifiers: [{
|
@@ -19051,7 +19047,7 @@ var Component$c = defineComponent({
|
|
19051
19047
|
offset: [0, 4]
|
19052
19048
|
}
|
19053
19049
|
}]
|
19054
|
-
});
|
19050
|
+
}, props2.popoverProps));
|
19055
19051
|
const {
|
19056
19052
|
maxResult
|
19057
19053
|
} = toRefs(props2);
|
@@ -19077,7 +19073,7 @@ var Component$c = defineComponent({
|
|
19077
19073
|
active: state.isEdit,
|
19078
19074
|
disabled: props2.disabled
|
19079
19075
|
}));
|
19080
|
-
watch([() =>
|
19076
|
+
watch([() => props2.modelValue, () => props2.list], () => {
|
19081
19077
|
var _a;
|
19082
19078
|
nextTick(() => {
|
19083
19079
|
initData();
|
@@ -19212,7 +19208,7 @@ var Component$c = defineComponent({
|
|
19212
19208
|
trigger
|
19213
19209
|
} = props2;
|
19214
19210
|
listState.selectedTagList = [];
|
19215
|
-
listState.localList =
|
19211
|
+
listState.localList = formatList.value;
|
19216
19212
|
if (modelValue.length) {
|
19217
19213
|
modelValue.forEach((tag2) => {
|
19218
19214
|
const value = listState.localList.find((val) => tag2 === val[saveKey]);
|
@@ -19386,7 +19382,7 @@ var Component$c = defineComponent({
|
|
19386
19382
|
e.stopPropagation();
|
19387
19383
|
const removeList = listState.selectedTagList;
|
19388
19384
|
listState.selectedTagList = [];
|
19389
|
-
const existList = formatList.filter((item) => removeList.some((removeItem) => removeItem[props2.saveKey] === item[props2.saveKey]));
|
19385
|
+
const existList = formatList.value.filter((item) => removeList.some((removeItem) => removeItem[props2.saveKey] === item[props2.saveKey]));
|
19390
19386
|
if ((props2.allowCreate && existList.length !== 0 || !props2.allowCreate) && !isSingleSelect.value) {
|
19391
19387
|
listState.localList.push(...existList);
|
19392
19388
|
}
|
@@ -19420,7 +19416,7 @@ var Component$c = defineComponent({
|
|
19420
19416
|
swapElementPositions(tagInputItemRef.value, nodes[index - 1]);
|
19421
19417
|
listState.selectedTagList.splice(index - 1, 1);
|
19422
19418
|
focusInputTrigger();
|
19423
|
-
const isExistInit = formatList.some((item) => item === target[props2.saveKey]);
|
19419
|
+
const isExistInit = formatList.value.some((item) => item === target[props2.saveKey]);
|
19424
19420
|
if ((props2.allowCreate && isExistInit || !props2.allowCreate) && !isSingleSelect.value) {
|
19425
19421
|
listState.localList.push(target);
|
19426
19422
|
}
|
@@ -19643,7 +19639,7 @@ var Component$c = defineComponent({
|
|
19643
19639
|
};
|
19644
19640
|
const removeTag = (data2, index) => {
|
19645
19641
|
listState.selectedTagList.splice(index, 1);
|
19646
|
-
const isExistInit = formatList.some((item) => item === data2[props2.saveKey]);
|
19642
|
+
const isExistInit = formatList.value.some((item) => item === data2[props2.saveKey]);
|
19647
19643
|
if ((props2.allowCreate && isExistInit || !props2.allowCreate) && !isSingleSelect.value) {
|
19648
19644
|
listState.localList.push(data2);
|
19649
19645
|
}
|
@@ -19678,56 +19674,20 @@ var Component$c = defineComponent({
|
|
19678
19674
|
});
|
19679
19675
|
},
|
19680
19676
|
render() {
|
19681
|
-
const renderSelectorList = () => {
|
19682
|
-
if (this.useGroup) {
|
19683
|
-
return this.renderList.map((group) => createVNode("li", {
|
19684
|
-
"class": "bk-selector-group-item"
|
19685
|
-
}, [createVNode("span", {
|
19686
|
-
"class": "group-name"
|
19687
|
-
}, [group.name, createTextVNode(" ("), group.children.length, createTextVNode(")")]), createVNode("ul", {
|
19688
|
-
"class": "bk-selector-group-list-item"
|
19689
|
-
}, [group.children.map((item, index) => createVNode("li", {
|
19690
|
-
"class": ["bk-selector-list-item", {
|
19691
|
-
disabled: item.disabled
|
19692
|
-
}, this.activeClass(item, index)],
|
19693
|
-
"onClick": this.handleTagSelected.bind(this, item, "select")
|
19694
|
-
}, [createVNode(ListTagRender, {
|
19695
|
-
"node": item,
|
19696
|
-
"displayKey": this.displayKey,
|
19697
|
-
"tpl": this.tpl,
|
19698
|
-
"searchKey": this.searchKey,
|
19699
|
-
"searchKeyword": this.curInputValue
|
19700
|
-
}, null)]))])]));
|
19701
|
-
}
|
19702
|
-
return this.renderList.map((item, index) => createVNode("li", {
|
19703
|
-
"class": ["bk-selector-list-item", {
|
19704
|
-
disabled: item.disabled
|
19705
|
-
}, this.activeClass(item, index)],
|
19706
|
-
"onClick": this.handleTagSelected.bind(this, item, "select")
|
19707
|
-
}, [createVNode(ListTagRender, {
|
19708
|
-
"node": item,
|
19709
|
-
"displayKey": this.displayKey,
|
19710
|
-
"tpl": this.tpl,
|
19711
|
-
"searchKey": this.searchKey,
|
19712
|
-
"searchKeyword": this.curInputValue
|
19713
|
-
}, null)]));
|
19714
|
-
};
|
19715
19677
|
return createVNode("div", {
|
19716
19678
|
"class": "bk-tag-input",
|
19717
19679
|
"ref": "bkTagSelectorRef",
|
19718
19680
|
"onClick": this.focusInputTrigger,
|
19719
19681
|
"onMouseenter": () => this.isHover = true,
|
19720
19682
|
"onMouseleave": () => this.isHover = false
|
19721
|
-
}, [createVNode(BkPopover, {
|
19683
|
+
}, [createVNode(BkPopover, mergeProps({
|
19722
19684
|
"ref": "popoverRef",
|
19723
19685
|
"theme": "light",
|
19724
19686
|
"trigger": "manual",
|
19725
19687
|
"placement": "bottom-start",
|
19726
|
-
"
|
19727
|
-
"
|
19728
|
-
|
19729
|
-
"modifiers": this.popoverProps.modifiers
|
19730
|
-
}, {
|
19688
|
+
"content-cls": "bk-tag-input-popover-content",
|
19689
|
+
"arrow": false
|
19690
|
+
}, this.popoverProps), {
|
19731
19691
|
default: () => {
|
19732
19692
|
var _a, _b, _c;
|
19733
19693
|
return createVNode("div", {
|
@@ -19787,7 +19747,35 @@ var Component$c = defineComponent({
|
|
19787
19747
|
"max-height": `${this.contentMaxHeight}px`
|
19788
19748
|
},
|
19789
19749
|
"class": "outside-ul"
|
19790
|
-
}, [
|
19750
|
+
}, [this.renderList.map((group, index) => this.useGroup ? createVNode("li", {
|
19751
|
+
"class": "bk-selector-group-item"
|
19752
|
+
}, [createVNode("span", {
|
19753
|
+
"class": "group-name"
|
19754
|
+
}, [group.name, createTextVNode(" ("), group.children.length, createTextVNode(")")]), createVNode("ul", {
|
19755
|
+
"class": "bk-selector-group-list-item"
|
19756
|
+
}, [group.children.map((item, index2) => createVNode("li", {
|
19757
|
+
"class": ["bk-selector-list-item", {
|
19758
|
+
disabled: item.disabled
|
19759
|
+
}, this.activeClass(item, index2)],
|
19760
|
+
"onClick": this.handleTagSelected.bind(this, item, "select")
|
19761
|
+
}, [createVNode(ListTagRender, {
|
19762
|
+
"node": item,
|
19763
|
+
"displayKey": this.displayKey,
|
19764
|
+
"tpl": this.tpl,
|
19765
|
+
"searchKey": this.searchKey,
|
19766
|
+
"searchKeyword": this.curInputValue
|
19767
|
+
}, null)]))])]) : createVNode("li", {
|
19768
|
+
"class": ["bk-selector-list-item", {
|
19769
|
+
disabled: group.disabled
|
19770
|
+
}, this.activeClass(group, index)],
|
19771
|
+
"onClick": this.handleTagSelected.bind(this, group, "select")
|
19772
|
+
}, [createVNode(ListTagRender, {
|
19773
|
+
"node": group,
|
19774
|
+
"displayKey": this.displayKey,
|
19775
|
+
"tpl": this.tpl,
|
19776
|
+
"searchKey": this.searchKey,
|
19777
|
+
"searchKeyword": this.curInputValue
|
19778
|
+
}, null)])), this.isPageLoading ? createVNode("li", {
|
19791
19779
|
"class": "bk-selector-list-item loading"
|
19792
19780
|
}, [createVNode(BkLoading, {
|
19793
19781
|
"theme": "primary",
|