@blueking/bk-user-selector 0.0.38 → 0.0.39-beta.1
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/README.md +7 -6
- package/package.json +1 -1
- package/typings/api/user.d.ts +8 -8
- package/typings/components/multiple-selector.vue.d.ts +5 -4
- package/typings/components/selection-popover.vue.d.ts +3 -3
- package/typings/components/single-selector.vue.d.ts +3 -3
- package/typings/components/user-selector.vue.d.ts +5 -4
- package/typings/components/user-tag.vue.d.ts +20 -20
- package/typings/hooks/use-jsonp.d.ts +5 -5
- package/typings/hooks/useUserSearch.d.ts +1 -1
- package/typings/types/index.d.ts +107 -99
- package/typings/utils/common.d.ts +1 -1
- package/vue2/index.es.min.js +108 -55
- package/vue2/index.iife.min.js +109 -56
- package/vue2/index.umd.min.js +109 -56
- package/vue2/vue2.css +39 -39
- package/vue3/index.es.min.js +108 -55
- package/vue3/index.iife.min.js +109 -56
- package/vue3/index.umd.min.js +109 -56
- package/vue3/vue3.css +39 -39
package/vue3/index.umd.min.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
})(this, function(exports2, vue, bkuiVue) {
|
|
4
4
|
"use strict";
|
|
5
5
|
var __vite_style__ = document.createElement("style");
|
|
6
|
-
__vite_style__.textContent = ".me-tag[data-v-
|
|
6
|
+
__vite_style__.textContent = ".me-tag[data-v-ef4a05c4] {\n position: absolute;\n top: 50%;\n right: 8px;\n z-index: 1;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0 8px;\n font-size: 12px;\n color: #4d4f56;\n white-space: nowrap;\n cursor: pointer;\n background-color: #e1ecff;\n border-radius: 50%;\n transform: translateY(-50%);\n}\n.me-tag[data-v-ef4a05c4]:hover {\n color: #3a84ff;\n background-color: #cddffe;\n}\n.me-tag.disabled[data-v-ef4a05c4] {\n color: #c4c6cc;\n cursor: not-allowed;\n background-color: #f0f1f5;\n}.dropdown-content[data-v-ee78cf72] {\n min-height: 40px;\n max-height: 300px;\n padding: 5px 0;\n overflow-y: auto;\n}\n.dropdown-content .no-data[data-v-ee78cf72] {\n padding: 10px;\n color: #979ba5;\n text-align: center;\n}\n.dropdown-content .user-group .group-header[data-v-ee78cf72] {\n display: flex;\n align-items: center;\n padding: 8px 12px;\n color: #979ba5;\n}\n.dropdown-content .user-group .group-header .group-count[data-v-ee78cf72] {\n margin-left: 4px;\n}\n.dropdown-content .user-option[data-v-ee78cf72] {\n display: flex;\n align-items: center;\n height: 32px;\n padding: 8px 12px;\n cursor: pointer;\n}\n.dropdown-content .user-option[data-v-ee78cf72]:hover {\n background-color: #f5f7fa;\n}.bk-user-selector-popover.bk-user-selector-pop2-content {\n padding: 0;\n}.user-tag[data-v-48ac8fc1] {\n margin-right: 4px;\n margin-left: 0;\n}\n.user-tag.draggable[data-v-48ac8fc1] {\n cursor: move;\n}\n.user-tag.active[data-v-48ac8fc1] {\n background-color: #e1ecff;\n border-color: #3a84ff;\n}\n.user-tag.is-custom[data-v-48ac8fc1] {\n color: #ea3636;\n background-color: #feebea;\n border-color: rgba(234, 53, 54, 0.3019607843);\n}\n.user-tag.is-custom[data-v-48ac8fc1]:hover {\n background-color: #fedddc;\n}\n.user-tag .tag-content .user-name[data-v-48ac8fc1] {\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 12px;\n white-space: nowrap;\n}.multiple-selector[data-v-2a532f24] {\n position: relative;\n width: 100%;\n}\n.multiple-selector.is-disabled[data-v-2a532f24] {\n pointer-events: none;\n}\n.multiple-selector .tags-container[data-v-2a532f24] {\n min-height: 32px;\n padding: 1px 10px 1px 8px;\n background-color: #fff;\n border: 1px solid #c4c6cc;\n border-radius: 2px;\n transition: all 0.2s ease;\n}\n.multiple-selector .tags-container.focused[data-v-2a532f24] {\n border-color: #3a84ff;\n box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);\n}\n.multiple-selector .tags-container.collapsed[data-v-2a532f24] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n}\n.multiple-selector .tag-list[data-v-2a532f24] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n}\n.multiple-selector .tag-wrapper[data-v-2a532f24] {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n}\n.multiple-selector .search-input[data-v-2a532f24] {\n min-width: 10px;\n height: 28px;\n outline: none;\n background: transparent;\n border: none;\n}\n.multiple-selector .search-input[data-v-2a532f24]::placeholder {\n color: #c4c6cc;\n}\n.multiple-selector .search-input.inline[data-v-2a532f24] {\n min-width: 10px;\n}\n.multiple-selector .search-input.last[data-v-2a532f24], .multiple-selector .search-input.collapsed[data-v-2a532f24] {\n flex: 1;\n}\n.hidden-users[data-v-2a532f24] {\n padding: 6px 10px;\n}.single-selector[data-v-633b6466] {\n position: relative;\n width: 100%;\n}\n.single-selector.is-disabled[data-v-633b6466] {\n pointer-events: none;\n}\n.input-container[data-v-633b6466] {\n position: relative;\n display: flex;\n align-items: center;\n min-height: 32px;\n padding: 0 8px;\n background-color: #fff;\n border: 1px solid #c4c6cc;\n border-radius: 2px;\n}\n.input-container[data-v-633b6466]:focus-within {\n border-color: #3a84ff;\n box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);\n}\n.search-input[data-v-633b6466] {\n flex: 1;\n height: 30px;\n outline: none;\n background: transparent;\n border: none;\n}\n.search-input[data-v-633b6466]::placeholder {\n color: #c4c6cc;\n}.bk-user-selector[data-v-37ff6c88] {\n position: relative;\n width: 100%;\n font-size: 12px;\n}\n.bk-user-selector.is-disabled[data-v-37ff6c88] {\n cursor: not-allowed;\n background-color: #dcdee5;\n}";
|
|
7
7
|
document.head.appendChild(__vite_style__);
|
|
8
8
|
const generateCallbackName = () => {
|
|
9
9
|
const timestamp = Date.now();
|
|
@@ -3267,7 +3267,7 @@
|
|
|
3267
3267
|
}
|
|
3268
3268
|
return target;
|
|
3269
3269
|
};
|
|
3270
|
-
const MeTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
3270
|
+
const MeTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-ef4a05c4"]]);
|
|
3271
3271
|
const UserRender = vue.defineComponent({
|
|
3272
3272
|
name: "UserRender",
|
|
3273
3273
|
props: {
|
|
@@ -3442,22 +3442,22 @@
|
|
|
3442
3442
|
};
|
|
3443
3443
|
return (_ctx, _cache) => {
|
|
3444
3444
|
return vue.openBlock(), vue.createBlock(vue.unref(bkuiVue.Popover), {
|
|
3445
|
-
"ext-cls": "bk-user-selector-popover",
|
|
3446
3445
|
arrow: false,
|
|
3446
|
+
"ext-cls": "bk-user-selector-popover",
|
|
3447
3447
|
"is-show": __props.isShow,
|
|
3448
3448
|
offset: { mainAxis: 4, crossAxis: __props.crossAxisOffset },
|
|
3449
|
-
width: __props.containerWidth,
|
|
3450
3449
|
placement: "bottom-start",
|
|
3451
3450
|
theme: "light",
|
|
3452
3451
|
trigger: "manual",
|
|
3452
|
+
width: __props.containerWidth,
|
|
3453
3453
|
onClickoutside: handleClickOutside
|
|
3454
3454
|
}, {
|
|
3455
3455
|
content: vue.withCtx(() => [
|
|
3456
3456
|
vue.createVNode(vue.unref(bkuiVue.Loading), {
|
|
3457
3457
|
class: "dropdown-content",
|
|
3458
3458
|
loading: __props.loading,
|
|
3459
|
-
|
|
3460
|
-
|
|
3459
|
+
mode: "spin",
|
|
3460
|
+
size: "mini"
|
|
3461
3461
|
}, {
|
|
3462
3462
|
default: vue.withCtx(() => [
|
|
3463
3463
|
__props.options.length === 0 && __props.userGroup.length === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
|
|
@@ -3473,8 +3473,8 @@
|
|
|
3473
3473
|
{ key: 1 },
|
|
3474
3474
|
vue.renderList(groupedUsers.value, (group, groupName) => {
|
|
3475
3475
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3476
|
-
|
|
3477
|
-
|
|
3476
|
+
key: groupName,
|
|
3477
|
+
class: "user-group"
|
|
3478
3478
|
}, [
|
|
3479
3479
|
Object.keys(groupedUsers.value).length > 1 || group.some((user) => user.type === "userGroup") ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3480
3480
|
key: 0,
|
|
@@ -3502,8 +3502,8 @@
|
|
|
3502
3502
|
null,
|
|
3503
3503
|
vue.renderList(group, (user) => {
|
|
3504
3504
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3505
|
-
class: "user-option",
|
|
3506
3505
|
key: user.id,
|
|
3506
|
+
class: "user-option",
|
|
3507
3507
|
onClick: vue.withModifiers(($event) => selectUser(user), ["prevent"])
|
|
3508
3508
|
}, [
|
|
3509
3509
|
vue.createVNode(vue.unref(UserRender), {
|
|
@@ -3536,20 +3536,20 @@
|
|
|
3536
3536
|
};
|
|
3537
3537
|
}
|
|
3538
3538
|
});
|
|
3539
|
-
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
3539
|
+
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ee78cf72"]]);
|
|
3540
3540
|
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
3541
3541
|
...{
|
|
3542
3542
|
name: "UserTag"
|
|
3543
3543
|
},
|
|
3544
3544
|
__name: "user-tag",
|
|
3545
3545
|
props: {
|
|
3546
|
-
|
|
3547
|
-
tenants: {},
|
|
3546
|
+
active: { type: Boolean },
|
|
3548
3547
|
currentTenantId: {},
|
|
3549
3548
|
draggable: { type: Boolean },
|
|
3550
|
-
|
|
3549
|
+
renderTag: { type: Function },
|
|
3551
3550
|
showTenant: { type: Boolean },
|
|
3552
|
-
|
|
3551
|
+
tenants: {},
|
|
3552
|
+
user: {}
|
|
3553
3553
|
},
|
|
3554
3554
|
emits: ["click", "close"],
|
|
3555
3555
|
setup(__props, { emit: __emit }) {
|
|
@@ -3582,7 +3582,7 @@
|
|
|
3582
3582
|
};
|
|
3583
3583
|
}
|
|
3584
3584
|
});
|
|
3585
|
-
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
3585
|
+
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-48ac8fc1"]]);
|
|
3586
3586
|
const _hoisted_1$1 = ["onClick"];
|
|
3587
3587
|
const _hoisted_2$1 = ["placeholder"];
|
|
3588
3588
|
const _hoisted_3 = { class: "hidden-users" };
|
|
@@ -3593,24 +3593,25 @@
|
|
|
3593
3593
|
},
|
|
3594
3594
|
__name: "multiple-selector",
|
|
3595
3595
|
props: {
|
|
3596
|
-
|
|
3596
|
+
freePaste: { type: Boolean, default: false },
|
|
3597
3597
|
draggable: { type: Boolean, default: false },
|
|
3598
|
+
modelValue: { default: () => [] },
|
|
3598
3599
|
selectedUsers: { default: () => [] },
|
|
3599
3600
|
tenants: { default: () => ({}) },
|
|
3601
|
+
allowCreate: { type: Boolean, default: false },
|
|
3600
3602
|
apiBaseUrl: { default: "" },
|
|
3601
|
-
tenantId: { default: "" },
|
|
3602
|
-
placeholder: { default: "" },
|
|
3603
3603
|
currentUserId: { default: "" },
|
|
3604
|
+
disabled: { type: Boolean },
|
|
3605
|
+
emptyText: { default: "" },
|
|
3606
|
+
enableMultiTenantMode: { type: Boolean },
|
|
3604
3607
|
exactSearchKey: { default: "bk_username" },
|
|
3605
|
-
|
|
3608
|
+
excludeUserIds: { default: () => [] },
|
|
3609
|
+
placeholder: { default: "" },
|
|
3610
|
+
tenantId: { default: "" },
|
|
3606
3611
|
userGroupName: { default: "" },
|
|
3607
|
-
emptyText: { default: "" },
|
|
3608
|
-
disabled: { type: Boolean },
|
|
3609
3612
|
renderListItem: {},
|
|
3610
3613
|
renderTag: {},
|
|
3611
|
-
|
|
3612
|
-
enableMultiTenantMode: { type: Boolean },
|
|
3613
|
-
allowCreate: { type: Boolean, default: false }
|
|
3614
|
+
userGroup: { default: () => [] }
|
|
3614
3615
|
},
|
|
3615
3616
|
emits: [
|
|
3616
3617
|
"update:selectedUsers",
|
|
@@ -3711,7 +3712,6 @@
|
|
|
3711
3712
|
});
|
|
3712
3713
|
};
|
|
3713
3714
|
const handleClickOutside = (event) => {
|
|
3714
|
-
event.stopPropagation();
|
|
3715
3715
|
const target = event.target;
|
|
3716
3716
|
const container = containerRef.value;
|
|
3717
3717
|
if ((container == null ? void 0 : container.contains(target)) || container === target) {
|
|
@@ -3813,7 +3813,37 @@
|
|
|
3813
3813
|
}
|
|
3814
3814
|
});
|
|
3815
3815
|
const updatedUsers = Array.from(userMap.values());
|
|
3816
|
-
|
|
3816
|
+
if (props.freePaste) {
|
|
3817
|
+
const pastedUsers = usersList.map((user) => ({
|
|
3818
|
+
id: user,
|
|
3819
|
+
name: user,
|
|
3820
|
+
type: "custom",
|
|
3821
|
+
tenantId: "",
|
|
3822
|
+
login_name: user
|
|
3823
|
+
}));
|
|
3824
|
+
pastedUsers.forEach((user) => {
|
|
3825
|
+
if (!updatedUsers.some((item) => item.login_name === user.login_name)) {
|
|
3826
|
+
addUser(user);
|
|
3827
|
+
}
|
|
3828
|
+
});
|
|
3829
|
+
} else {
|
|
3830
|
+
emit("update:selectedUsers", updatedUsers);
|
|
3831
|
+
}
|
|
3832
|
+
} else {
|
|
3833
|
+
if (props.freePaste) {
|
|
3834
|
+
const pastedUsers = usersList.map((user) => ({
|
|
3835
|
+
id: user,
|
|
3836
|
+
name: user,
|
|
3837
|
+
type: "custom",
|
|
3838
|
+
tenantId: "",
|
|
3839
|
+
login_name: user
|
|
3840
|
+
}));
|
|
3841
|
+
pastedUsers.forEach((user) => {
|
|
3842
|
+
if (!props.selectedUsers.some((item) => item.login_name === user.login_name)) {
|
|
3843
|
+
addUser(user);
|
|
3844
|
+
}
|
|
3845
|
+
});
|
|
3846
|
+
}
|
|
3817
3847
|
}
|
|
3818
3848
|
} catch (error) {
|
|
3819
3849
|
console.error("精准查找用户失败:", error);
|
|
@@ -3835,7 +3865,13 @@
|
|
|
3835
3865
|
removeUser(lastUser);
|
|
3836
3866
|
}
|
|
3837
3867
|
} else if (event.key === "Enter" && props.allowCreate) {
|
|
3838
|
-
addUser({
|
|
3868
|
+
addUser({
|
|
3869
|
+
id: searchQuery.value,
|
|
3870
|
+
name: searchQuery.value,
|
|
3871
|
+
type: "custom",
|
|
3872
|
+
tenantId: "",
|
|
3873
|
+
login_name: searchQuery.value
|
|
3874
|
+
});
|
|
3839
3875
|
}
|
|
3840
3876
|
};
|
|
3841
3877
|
const addUser = (user) => {
|
|
@@ -3959,8 +3995,8 @@
|
|
|
3959
3995
|
null,
|
|
3960
3996
|
vue.renderList(_ctx.selectedUsers, (user, index) => {
|
|
3961
3997
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
3962
|
-
class: "tag-wrapper",
|
|
3963
3998
|
key: user.id,
|
|
3999
|
+
class: "tag-wrapper",
|
|
3964
4000
|
onClick: vue.withModifiers(($event) => handleTagClick(index), ["stop"])
|
|
3965
4001
|
}, [
|
|
3966
4002
|
vue.createVNode(UserTag, {
|
|
@@ -3981,8 +4017,8 @@
|
|
|
3981
4017
|
ref_for: true,
|
|
3982
4018
|
ref_key: "inlineInputRef",
|
|
3983
4019
|
ref: inlineInputRef,
|
|
3984
|
-
class: "search-input inline",
|
|
3985
4020
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
4021
|
+
class: "search-input inline",
|
|
3986
4022
|
onFocus: handleInputFocus,
|
|
3987
4023
|
onInput: handleInput,
|
|
3988
4024
|
onKeydown: handleKeyDown,
|
|
@@ -4004,8 +4040,8 @@
|
|
|
4004
4040
|
key: 0,
|
|
4005
4041
|
ref_key: "lastInputRef",
|
|
4006
4042
|
ref: lastInputRef,
|
|
4007
|
-
class: "search-input last",
|
|
4008
4043
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
4044
|
+
class: "search-input last",
|
|
4009
4045
|
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
4010
4046
|
onFocus: handleInputFocus,
|
|
4011
4047
|
onInput: handleInput,
|
|
@@ -4046,8 +4082,8 @@
|
|
|
4046
4082
|
null,
|
|
4047
4083
|
vue.renderList(visibleUsers.value, (user) => {
|
|
4048
4084
|
return vue.openBlock(), vue.createBlock(UserTag, {
|
|
4049
|
-
"current-tenant-id": _ctx.tenantId,
|
|
4050
4085
|
key: user.id,
|
|
4086
|
+
"current-tenant-id": _ctx.tenantId,
|
|
4051
4087
|
"render-tag": _ctx.renderTag,
|
|
4052
4088
|
"show-tenant": true,
|
|
4053
4089
|
tenants: _ctx.tenants,
|
|
@@ -4102,8 +4138,8 @@
|
|
|
4102
4138
|
vue.withDirectives(vue.createElementVNode("input", {
|
|
4103
4139
|
ref_key: "collapsedInputRef",
|
|
4104
4140
|
ref: collapsedInputRef,
|
|
4105
|
-
class: "search-input collapsed",
|
|
4106
4141
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
4142
|
+
class: "search-input collapsed",
|
|
4107
4143
|
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
4108
4144
|
onFocus: handleFocus
|
|
4109
4145
|
}, null, 40, _hoisted_4), [
|
|
@@ -4134,7 +4170,7 @@
|
|
|
4134
4170
|
};
|
|
4135
4171
|
}
|
|
4136
4172
|
});
|
|
4137
|
-
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
4173
|
+
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-2a532f24"]]);
|
|
4138
4174
|
const _hoisted_1 = { class: "input-container" };
|
|
4139
4175
|
const _hoisted_2 = ["placeholder"];
|
|
4140
4176
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -4145,20 +4181,21 @@
|
|
|
4145
4181
|
props: {
|
|
4146
4182
|
modelValue: { default: "" },
|
|
4147
4183
|
tenants: {},
|
|
4184
|
+
allowCreate: { type: Boolean },
|
|
4185
|
+
freePaste: { type: Boolean },
|
|
4148
4186
|
apiBaseUrl: { default: "" },
|
|
4149
|
-
tenantId: { default: "" },
|
|
4150
|
-
placeholder: { default: "" },
|
|
4151
4187
|
currentUserId: { default: "" },
|
|
4188
|
+
disabled: { type: Boolean },
|
|
4189
|
+
emptyText: { default: "" },
|
|
4190
|
+
enableMultiTenantMode: { type: Boolean },
|
|
4152
4191
|
exactSearchKey: { default: "bk_username" },
|
|
4153
|
-
|
|
4192
|
+
excludeUserIds: { default: () => [] },
|
|
4193
|
+
placeholder: { default: "" },
|
|
4194
|
+
tenantId: { default: "" },
|
|
4154
4195
|
userGroupName: { default: "" },
|
|
4155
|
-
emptyText: { default: "" },
|
|
4156
|
-
disabled: { type: Boolean },
|
|
4157
4196
|
renderListItem: {},
|
|
4158
4197
|
renderTag: {},
|
|
4159
|
-
|
|
4160
|
-
enableMultiTenantMode: { type: Boolean },
|
|
4161
|
-
allowCreate: { type: Boolean }
|
|
4198
|
+
userGroup: { default: () => [] }
|
|
4162
4199
|
},
|
|
4163
4200
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
4164
4201
|
setup(__props, { emit: __emit }) {
|
|
@@ -4288,6 +4325,18 @@
|
|
|
4288
4325
|
}
|
|
4289
4326
|
}
|
|
4290
4327
|
};
|
|
4328
|
+
const handlePaste = (event) => {
|
|
4329
|
+
var _a;
|
|
4330
|
+
event.preventDefault();
|
|
4331
|
+
const pastedText = ((_a = event.clipboardData) == null ? void 0 : _a.getData("text").trim()) || "";
|
|
4332
|
+
if (props.freePaste) {
|
|
4333
|
+
const customUser = { id: pastedText, name: pastedText, type: "custom", tenantId: "", login_name: pastedText };
|
|
4334
|
+
if (!options.value.some((item) => item.login_name === customUser.login_name)) {
|
|
4335
|
+
options.value.push(customUser);
|
|
4336
|
+
}
|
|
4337
|
+
addUser(customUser);
|
|
4338
|
+
}
|
|
4339
|
+
};
|
|
4291
4340
|
const addUser = (user) => {
|
|
4292
4341
|
selectedUser.value = user.id;
|
|
4293
4342
|
searchQuery.value = "";
|
|
@@ -4364,13 +4413,14 @@
|
|
|
4364
4413
|
vue.withDirectives(vue.createElementVNode("input", {
|
|
4365
4414
|
ref_key: "inputRef",
|
|
4366
4415
|
ref: inputRef,
|
|
4367
|
-
class: "search-input",
|
|
4368
4416
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
|
|
4417
|
+
class: "search-input",
|
|
4369
4418
|
placeholder: selectedUserInfo.value ? "" : _ctx.placeholder,
|
|
4370
4419
|
onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur")),
|
|
4371
4420
|
onFocus: handleInputFocus,
|
|
4372
4421
|
onInput: handleInput,
|
|
4373
|
-
onKeydown: handleKeyDown
|
|
4422
|
+
onKeydown: handleKeyDown,
|
|
4423
|
+
onPaste: handlePaste
|
|
4374
4424
|
}, null, 40, _hoisted_2), [
|
|
4375
4425
|
[vue.vModelText, searchQuery.value]
|
|
4376
4426
|
]),
|
|
@@ -4394,30 +4444,31 @@
|
|
|
4394
4444
|
};
|
|
4395
4445
|
}
|
|
4396
4446
|
});
|
|
4397
|
-
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
4447
|
+
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-633b6466"]]);
|
|
4398
4448
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
4399
4449
|
...{
|
|
4400
4450
|
name: "BkUserSelector"
|
|
4401
4451
|
},
|
|
4402
4452
|
__name: "user-selector",
|
|
4403
4453
|
props: {
|
|
4404
|
-
modelValue: { default: "" },
|
|
4405
4454
|
draggable: { type: Boolean, default: false },
|
|
4455
|
+
modelValue: { default: "" },
|
|
4406
4456
|
multiple: { type: Boolean, default: false },
|
|
4457
|
+
allowCreate: { type: Boolean, default: false },
|
|
4458
|
+
freePaste: { type: Boolean, default: false },
|
|
4407
4459
|
apiBaseUrl: { default: "" },
|
|
4408
|
-
tenantId: { default: "" },
|
|
4409
|
-
placeholder: { default: "" },
|
|
4410
4460
|
currentUserId: { default: "" },
|
|
4461
|
+
disabled: { type: Boolean, default: false },
|
|
4462
|
+
emptyText: { default: "" },
|
|
4463
|
+
enableMultiTenantMode: { type: Boolean, default: true },
|
|
4411
4464
|
exactSearchKey: { default: "bk_username" },
|
|
4412
|
-
|
|
4465
|
+
excludeUserIds: { default: () => [] },
|
|
4466
|
+
placeholder: { default: "" },
|
|
4467
|
+
tenantId: { default: "" },
|
|
4413
4468
|
userGroupName: { default: "" },
|
|
4414
|
-
emptyText: { default: "" },
|
|
4415
|
-
disabled: { type: Boolean, default: false },
|
|
4416
4469
|
renderListItem: {},
|
|
4417
4470
|
renderTag: {},
|
|
4418
|
-
|
|
4419
|
-
enableMultiTenantMode: { type: Boolean, default: true },
|
|
4420
|
-
allowCreate: { type: Boolean, default: false }
|
|
4471
|
+
userGroup: { default: () => [] }
|
|
4421
4472
|
},
|
|
4422
4473
|
emits: ["update:modelValue", "change", "dragStart", "dragEnd", "focus", "blur"],
|
|
4423
4474
|
setup(__props, { emit: __emit }) {
|
|
@@ -4540,10 +4591,11 @@
|
|
|
4540
4591
|
tenants: vue.unref(tenants),
|
|
4541
4592
|
"user-group": _ctx.userGroup,
|
|
4542
4593
|
"user-group-name": userGroupName.value,
|
|
4594
|
+
"free-paste": _ctx.freePaste,
|
|
4543
4595
|
onBlur: handleBlur,
|
|
4544
4596
|
onChange: handleUpdateUser,
|
|
4545
4597
|
onFocus: handleFocus
|
|
4546
|
-
}, null, 8, ["modelValue", "allow-create", "api-base-url", "current-user-id", "disabled", "empty-text", "enable-multi-tenant-mode", "exact-search-key", "exclude-user-ids", "placeholder", "render-list-item", "render-tag", "tenant-id", "tenants", "user-group", "user-group-name"])) : (vue.openBlock(), vue.createElementBlock(
|
|
4598
|
+
}, null, 8, ["modelValue", "allow-create", "api-base-url", "current-user-id", "disabled", "empty-text", "enable-multi-tenant-mode", "exact-search-key", "exclude-user-ids", "placeholder", "render-list-item", "render-tag", "tenant-id", "tenants", "user-group", "user-group-name", "free-paste"])) : (vue.openBlock(), vue.createElementBlock(
|
|
4547
4599
|
vue.Fragment,
|
|
4548
4600
|
{ key: 1 },
|
|
4549
4601
|
[
|
|
@@ -4568,12 +4620,13 @@
|
|
|
4568
4620
|
tenants: vue.unref(tenants),
|
|
4569
4621
|
"user-group": _ctx.userGroup,
|
|
4570
4622
|
"user-group-name": userGroupName.value,
|
|
4623
|
+
"free-paste": _ctx.freePaste,
|
|
4571
4624
|
onBlur: handleBlur,
|
|
4572
4625
|
onDragEnd: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("dragEnd", $event)),
|
|
4573
4626
|
onDragStart: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("dragStart", $event)),
|
|
4574
4627
|
onFocus: handleFocus,
|
|
4575
4628
|
"onUpdate:selectedUsers": handleUpdateSelectedUsers
|
|
4576
|
-
}, null, 8, ["modelValue", "allow-create", "api-base-url", "current-user-id", "disabled", "draggable", "empty-text", "enable-multi-tenant-mode", "exact-search-key", "exclude-user-ids", "placeholder", "render-list-item", "render-tag", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
4629
|
+
}, null, 8, ["modelValue", "allow-create", "api-base-url", "current-user-id", "disabled", "draggable", "empty-text", "enable-multi-tenant-mode", "exact-search-key", "exclude-user-ids", "placeholder", "render-list-item", "render-tag", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name", "free-paste"])
|
|
4577
4630
|
],
|
|
4578
4631
|
2112
|
|
4579
4632
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
@@ -4585,7 +4638,7 @@
|
|
|
4585
4638
|
};
|
|
4586
4639
|
}
|
|
4587
4640
|
});
|
|
4588
|
-
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4641
|
+
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-37ff6c88"]]);
|
|
4589
4642
|
exports2.BkUserSelector = BkUserSelector;
|
|
4590
4643
|
exports2.default = BkUserSelector;
|
|
4591
4644
|
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
package/vue3/vue3.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.me-tag[data-v-
|
|
1
|
+
.me-tag[data-v-ef4a05c4] {
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 50%;
|
|
4
4
|
right: 8px;
|
|
@@ -11,83 +11,83 @@
|
|
|
11
11
|
padding: 0 8px;
|
|
12
12
|
font-size: 12px;
|
|
13
13
|
color: #4d4f56;
|
|
14
|
+
white-space: nowrap;
|
|
14
15
|
cursor: pointer;
|
|
15
16
|
background-color: #e1ecff;
|
|
16
17
|
border-radius: 50%;
|
|
17
18
|
transform: translateY(-50%);
|
|
18
|
-
white-space: nowrap;
|
|
19
19
|
}
|
|
20
|
-
.me-tag[data-v-
|
|
20
|
+
.me-tag[data-v-ef4a05c4]:hover {
|
|
21
21
|
color: #3a84ff;
|
|
22
22
|
background-color: #cddffe;
|
|
23
23
|
}
|
|
24
|
-
.me-tag.disabled[data-v-
|
|
24
|
+
.me-tag.disabled[data-v-ef4a05c4] {
|
|
25
25
|
color: #c4c6cc;
|
|
26
26
|
cursor: not-allowed;
|
|
27
27
|
background-color: #f0f1f5;
|
|
28
|
-
}.dropdown-content[data-v-
|
|
28
|
+
}.dropdown-content[data-v-ee78cf72] {
|
|
29
29
|
min-height: 40px;
|
|
30
30
|
max-height: 300px;
|
|
31
31
|
padding: 5px 0;
|
|
32
32
|
overflow-y: auto;
|
|
33
33
|
}
|
|
34
|
-
.dropdown-content .no-data[data-v-
|
|
34
|
+
.dropdown-content .no-data[data-v-ee78cf72] {
|
|
35
35
|
padding: 10px;
|
|
36
36
|
color: #979ba5;
|
|
37
37
|
text-align: center;
|
|
38
38
|
}
|
|
39
|
-
.dropdown-content .user-group .group-header[data-v-
|
|
39
|
+
.dropdown-content .user-group .group-header[data-v-ee78cf72] {
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
padding: 8px 12px;
|
|
43
43
|
color: #979ba5;
|
|
44
44
|
}
|
|
45
|
-
.dropdown-content .user-group .group-header .group-count[data-v-
|
|
45
|
+
.dropdown-content .user-group .group-header .group-count[data-v-ee78cf72] {
|
|
46
46
|
margin-left: 4px;
|
|
47
47
|
}
|
|
48
|
-
.dropdown-content .user-option[data-v-
|
|
48
|
+
.dropdown-content .user-option[data-v-ee78cf72] {
|
|
49
49
|
display: flex;
|
|
50
50
|
align-items: center;
|
|
51
51
|
height: 32px;
|
|
52
52
|
padding: 8px 12px;
|
|
53
53
|
cursor: pointer;
|
|
54
54
|
}
|
|
55
|
-
.dropdown-content .user-option[data-v-
|
|
55
|
+
.dropdown-content .user-option[data-v-ee78cf72]:hover {
|
|
56
56
|
background-color: #f5f7fa;
|
|
57
57
|
}.bk-user-selector-popover.bk-user-selector-pop2-content {
|
|
58
58
|
padding: 0;
|
|
59
|
-
}.user-tag[data-v-
|
|
59
|
+
}.user-tag[data-v-48ac8fc1] {
|
|
60
60
|
margin-right: 4px;
|
|
61
61
|
margin-left: 0;
|
|
62
62
|
}
|
|
63
|
-
.user-tag.draggable[data-v-
|
|
63
|
+
.user-tag.draggable[data-v-48ac8fc1] {
|
|
64
64
|
cursor: move;
|
|
65
65
|
}
|
|
66
|
-
.user-tag.active[data-v-
|
|
66
|
+
.user-tag.active[data-v-48ac8fc1] {
|
|
67
67
|
background-color: #e1ecff;
|
|
68
68
|
border-color: #3a84ff;
|
|
69
69
|
}
|
|
70
|
-
.user-tag.is-custom[data-v-
|
|
70
|
+
.user-tag.is-custom[data-v-48ac8fc1] {
|
|
71
71
|
color: #ea3636;
|
|
72
72
|
background-color: #feebea;
|
|
73
73
|
border-color: rgba(234, 53, 54, 0.3019607843);
|
|
74
74
|
}
|
|
75
|
-
.user-tag.is-custom[data-v-
|
|
75
|
+
.user-tag.is-custom[data-v-48ac8fc1]:hover {
|
|
76
76
|
background-color: #fedddc;
|
|
77
77
|
}
|
|
78
|
-
.user-tag .tag-content .user-name[data-v-
|
|
78
|
+
.user-tag .tag-content .user-name[data-v-48ac8fc1] {
|
|
79
79
|
overflow: hidden;
|
|
80
|
-
font-size: 12px;
|
|
81
80
|
text-overflow: ellipsis;
|
|
81
|
+
font-size: 12px;
|
|
82
82
|
white-space: nowrap;
|
|
83
|
-
}.multiple-selector[data-v-
|
|
83
|
+
}.multiple-selector[data-v-2a532f24] {
|
|
84
84
|
position: relative;
|
|
85
85
|
width: 100%;
|
|
86
86
|
}
|
|
87
|
-
.multiple-selector.is-disabled[data-v-
|
|
87
|
+
.multiple-selector.is-disabled[data-v-2a532f24] {
|
|
88
88
|
pointer-events: none;
|
|
89
89
|
}
|
|
90
|
-
.multiple-selector .tags-container[data-v-
|
|
90
|
+
.multiple-selector .tags-container[data-v-2a532f24] {
|
|
91
91
|
min-height: 32px;
|
|
92
92
|
padding: 1px 10px 1px 8px;
|
|
93
93
|
background-color: #fff;
|
|
@@ -95,51 +95,51 @@
|
|
|
95
95
|
border-radius: 2px;
|
|
96
96
|
transition: all 0.2s ease;
|
|
97
97
|
}
|
|
98
|
-
.multiple-selector .tags-container.focused[data-v-
|
|
98
|
+
.multiple-selector .tags-container.focused[data-v-2a532f24] {
|
|
99
99
|
border-color: #3a84ff;
|
|
100
100
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
101
101
|
}
|
|
102
|
-
.multiple-selector .tags-container.collapsed[data-v-
|
|
102
|
+
.multiple-selector .tags-container.collapsed[data-v-2a532f24] {
|
|
103
103
|
display: flex;
|
|
104
104
|
flex-wrap: wrap;
|
|
105
105
|
align-items: center;
|
|
106
106
|
}
|
|
107
|
-
.multiple-selector .tag-list[data-v-
|
|
107
|
+
.multiple-selector .tag-list[data-v-2a532f24] {
|
|
108
108
|
display: flex;
|
|
109
109
|
flex-wrap: wrap;
|
|
110
110
|
align-items: center;
|
|
111
111
|
}
|
|
112
|
-
.multiple-selector .tag-wrapper[data-v-
|
|
112
|
+
.multiple-selector .tag-wrapper[data-v-2a532f24] {
|
|
113
113
|
display: inline-flex;
|
|
114
114
|
align-items: center;
|
|
115
115
|
max-width: 100%;
|
|
116
116
|
}
|
|
117
|
-
.multiple-selector .search-input[data-v-
|
|
117
|
+
.multiple-selector .search-input[data-v-2a532f24] {
|
|
118
118
|
min-width: 10px;
|
|
119
119
|
height: 28px;
|
|
120
|
+
outline: none;
|
|
120
121
|
background: transparent;
|
|
121
122
|
border: none;
|
|
122
|
-
outline: none;
|
|
123
123
|
}
|
|
124
|
-
.multiple-selector .search-input[data-v-
|
|
124
|
+
.multiple-selector .search-input[data-v-2a532f24]::placeholder {
|
|
125
125
|
color: #c4c6cc;
|
|
126
126
|
}
|
|
127
|
-
.multiple-selector .search-input.inline[data-v-
|
|
127
|
+
.multiple-selector .search-input.inline[data-v-2a532f24] {
|
|
128
128
|
min-width: 10px;
|
|
129
129
|
}
|
|
130
|
-
.multiple-selector .search-input.last[data-v-
|
|
130
|
+
.multiple-selector .search-input.last[data-v-2a532f24], .multiple-selector .search-input.collapsed[data-v-2a532f24] {
|
|
131
131
|
flex: 1;
|
|
132
132
|
}
|
|
133
|
-
.hidden-users[data-v-
|
|
133
|
+
.hidden-users[data-v-2a532f24] {
|
|
134
134
|
padding: 6px 10px;
|
|
135
|
-
}.single-selector[data-v-
|
|
135
|
+
}.single-selector[data-v-633b6466] {
|
|
136
136
|
position: relative;
|
|
137
137
|
width: 100%;
|
|
138
138
|
}
|
|
139
|
-
.single-selector.is-disabled[data-v-
|
|
139
|
+
.single-selector.is-disabled[data-v-633b6466] {
|
|
140
140
|
pointer-events: none;
|
|
141
141
|
}
|
|
142
|
-
.input-container[data-v-
|
|
142
|
+
.input-container[data-v-633b6466] {
|
|
143
143
|
position: relative;
|
|
144
144
|
display: flex;
|
|
145
145
|
align-items: center;
|
|
@@ -149,25 +149,25 @@
|
|
|
149
149
|
border: 1px solid #c4c6cc;
|
|
150
150
|
border-radius: 2px;
|
|
151
151
|
}
|
|
152
|
-
.input-container[data-v-
|
|
152
|
+
.input-container[data-v-633b6466]:focus-within {
|
|
153
153
|
border-color: #3a84ff;
|
|
154
154
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
155
155
|
}
|
|
156
|
-
.search-input[data-v-
|
|
156
|
+
.search-input[data-v-633b6466] {
|
|
157
157
|
flex: 1;
|
|
158
158
|
height: 30px;
|
|
159
|
+
outline: none;
|
|
159
160
|
background: transparent;
|
|
160
161
|
border: none;
|
|
161
|
-
outline: none;
|
|
162
162
|
}
|
|
163
|
-
.search-input[data-v-
|
|
163
|
+
.search-input[data-v-633b6466]::placeholder {
|
|
164
164
|
color: #c4c6cc;
|
|
165
|
-
}.bk-user-selector[data-v-
|
|
165
|
+
}.bk-user-selector[data-v-37ff6c88] {
|
|
166
166
|
position: relative;
|
|
167
167
|
width: 100%;
|
|
168
168
|
font-size: 12px;
|
|
169
169
|
}
|
|
170
|
-
.bk-user-selector.is-disabled[data-v-
|
|
170
|
+
.bk-user-selector.is-disabled[data-v-37ff6c88] {
|
|
171
171
|
cursor: not-allowed;
|
|
172
172
|
background-color: #dcdee5;
|
|
173
173
|
}
|