@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/vue2/vue2.css
CHANGED
|
@@ -797,7 +797,7 @@ optgroup {
|
|
|
797
797
|
line-height: 0;
|
|
798
798
|
cursor: pointer;
|
|
799
799
|
}
|
|
800
|
-
.me-tag[data-v-
|
|
800
|
+
.me-tag[data-v-ef4a05c4] {
|
|
801
801
|
position: absolute;
|
|
802
802
|
top: 50%;
|
|
803
803
|
right: 8px;
|
|
@@ -810,83 +810,83 @@ optgroup {
|
|
|
810
810
|
padding: 0 8px;
|
|
811
811
|
font-size: 12px;
|
|
812
812
|
color: #4d4f56;
|
|
813
|
+
white-space: nowrap;
|
|
813
814
|
cursor: pointer;
|
|
814
815
|
background-color: #e1ecff;
|
|
815
816
|
border-radius: 50%;
|
|
816
817
|
transform: translateY(-50%);
|
|
817
|
-
white-space: nowrap;
|
|
818
818
|
}
|
|
819
|
-
.me-tag[data-v-
|
|
819
|
+
.me-tag[data-v-ef4a05c4]:hover {
|
|
820
820
|
color: #3a84ff;
|
|
821
821
|
background-color: #cddffe;
|
|
822
822
|
}
|
|
823
|
-
.me-tag.disabled[data-v-
|
|
823
|
+
.me-tag.disabled[data-v-ef4a05c4] {
|
|
824
824
|
color: #c4c6cc;
|
|
825
825
|
cursor: not-allowed;
|
|
826
826
|
background-color: #f0f1f5;
|
|
827
|
-
}.dropdown-content[data-v-
|
|
827
|
+
}.dropdown-content[data-v-ee78cf72] {
|
|
828
828
|
min-height: 40px;
|
|
829
829
|
max-height: 300px;
|
|
830
830
|
padding: 5px 0;
|
|
831
831
|
overflow-y: auto;
|
|
832
832
|
}
|
|
833
|
-
.dropdown-content .no-data[data-v-
|
|
833
|
+
.dropdown-content .no-data[data-v-ee78cf72] {
|
|
834
834
|
padding: 10px;
|
|
835
835
|
color: #979ba5;
|
|
836
836
|
text-align: center;
|
|
837
837
|
}
|
|
838
|
-
.dropdown-content .user-group .group-header[data-v-
|
|
838
|
+
.dropdown-content .user-group .group-header[data-v-ee78cf72] {
|
|
839
839
|
display: flex;
|
|
840
840
|
align-items: center;
|
|
841
841
|
padding: 8px 12px;
|
|
842
842
|
color: #979ba5;
|
|
843
843
|
}
|
|
844
|
-
.dropdown-content .user-group .group-header .group-count[data-v-
|
|
844
|
+
.dropdown-content .user-group .group-header .group-count[data-v-ee78cf72] {
|
|
845
845
|
margin-left: 4px;
|
|
846
846
|
}
|
|
847
|
-
.dropdown-content .user-option[data-v-
|
|
847
|
+
.dropdown-content .user-option[data-v-ee78cf72] {
|
|
848
848
|
display: flex;
|
|
849
849
|
align-items: center;
|
|
850
850
|
height: 32px;
|
|
851
851
|
padding: 8px 12px;
|
|
852
852
|
cursor: pointer;
|
|
853
853
|
}
|
|
854
|
-
.dropdown-content .user-option[data-v-
|
|
854
|
+
.dropdown-content .user-option[data-v-ee78cf72]:hover {
|
|
855
855
|
background-color: #f5f7fa;
|
|
856
856
|
}.bk-user-selector-popover.bk-user-selector-pop2-content {
|
|
857
857
|
padding: 0;
|
|
858
|
-
}.user-tag[data-v-
|
|
858
|
+
}.user-tag[data-v-48ac8fc1] {
|
|
859
859
|
margin-right: 4px;
|
|
860
860
|
margin-left: 0;
|
|
861
861
|
}
|
|
862
|
-
.user-tag.draggable[data-v-
|
|
862
|
+
.user-tag.draggable[data-v-48ac8fc1] {
|
|
863
863
|
cursor: move;
|
|
864
864
|
}
|
|
865
|
-
.user-tag.active[data-v-
|
|
865
|
+
.user-tag.active[data-v-48ac8fc1] {
|
|
866
866
|
background-color: #e1ecff;
|
|
867
867
|
border-color: #3a84ff;
|
|
868
868
|
}
|
|
869
|
-
.user-tag.is-custom[data-v-
|
|
869
|
+
.user-tag.is-custom[data-v-48ac8fc1] {
|
|
870
870
|
color: #ea3636;
|
|
871
871
|
background-color: #feebea;
|
|
872
872
|
border-color: rgba(234, 53, 54, 0.3019607843);
|
|
873
873
|
}
|
|
874
|
-
.user-tag.is-custom[data-v-
|
|
874
|
+
.user-tag.is-custom[data-v-48ac8fc1]:hover {
|
|
875
875
|
background-color: #fedddc;
|
|
876
876
|
}
|
|
877
|
-
.user-tag .tag-content .user-name[data-v-
|
|
877
|
+
.user-tag .tag-content .user-name[data-v-48ac8fc1] {
|
|
878
878
|
overflow: hidden;
|
|
879
|
-
font-size: 12px;
|
|
880
879
|
text-overflow: ellipsis;
|
|
880
|
+
font-size: 12px;
|
|
881
881
|
white-space: nowrap;
|
|
882
|
-
}.multiple-selector[data-v-
|
|
882
|
+
}.multiple-selector[data-v-2a532f24] {
|
|
883
883
|
position: relative;
|
|
884
884
|
width: 100%;
|
|
885
885
|
}
|
|
886
|
-
.multiple-selector.is-disabled[data-v-
|
|
886
|
+
.multiple-selector.is-disabled[data-v-2a532f24] {
|
|
887
887
|
pointer-events: none;
|
|
888
888
|
}
|
|
889
|
-
.multiple-selector .tags-container[data-v-
|
|
889
|
+
.multiple-selector .tags-container[data-v-2a532f24] {
|
|
890
890
|
min-height: 32px;
|
|
891
891
|
padding: 1px 10px 1px 8px;
|
|
892
892
|
background-color: #fff;
|
|
@@ -894,51 +894,51 @@ optgroup {
|
|
|
894
894
|
border-radius: 2px;
|
|
895
895
|
transition: all 0.2s ease;
|
|
896
896
|
}
|
|
897
|
-
.multiple-selector .tags-container.focused[data-v-
|
|
897
|
+
.multiple-selector .tags-container.focused[data-v-2a532f24] {
|
|
898
898
|
border-color: #3a84ff;
|
|
899
899
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
900
900
|
}
|
|
901
|
-
.multiple-selector .tags-container.collapsed[data-v-
|
|
901
|
+
.multiple-selector .tags-container.collapsed[data-v-2a532f24] {
|
|
902
902
|
display: flex;
|
|
903
903
|
flex-wrap: wrap;
|
|
904
904
|
align-items: center;
|
|
905
905
|
}
|
|
906
|
-
.multiple-selector .tag-list[data-v-
|
|
906
|
+
.multiple-selector .tag-list[data-v-2a532f24] {
|
|
907
907
|
display: flex;
|
|
908
908
|
flex-wrap: wrap;
|
|
909
909
|
align-items: center;
|
|
910
910
|
}
|
|
911
|
-
.multiple-selector .tag-wrapper[data-v-
|
|
911
|
+
.multiple-selector .tag-wrapper[data-v-2a532f24] {
|
|
912
912
|
display: inline-flex;
|
|
913
913
|
align-items: center;
|
|
914
914
|
max-width: 100%;
|
|
915
915
|
}
|
|
916
|
-
.multiple-selector .search-input[data-v-
|
|
916
|
+
.multiple-selector .search-input[data-v-2a532f24] {
|
|
917
917
|
min-width: 10px;
|
|
918
918
|
height: 28px;
|
|
919
|
+
outline: none;
|
|
919
920
|
background: transparent;
|
|
920
921
|
border: none;
|
|
921
|
-
outline: none;
|
|
922
922
|
}
|
|
923
|
-
.multiple-selector .search-input[data-v-
|
|
923
|
+
.multiple-selector .search-input[data-v-2a532f24]::placeholder {
|
|
924
924
|
color: #c4c6cc;
|
|
925
925
|
}
|
|
926
|
-
.multiple-selector .search-input.inline[data-v-
|
|
926
|
+
.multiple-selector .search-input.inline[data-v-2a532f24] {
|
|
927
927
|
min-width: 10px;
|
|
928
928
|
}
|
|
929
|
-
.multiple-selector .search-input.last[data-v-
|
|
929
|
+
.multiple-selector .search-input.last[data-v-2a532f24], .multiple-selector .search-input.collapsed[data-v-2a532f24] {
|
|
930
930
|
flex: 1;
|
|
931
931
|
}
|
|
932
|
-
.hidden-users[data-v-
|
|
932
|
+
.hidden-users[data-v-2a532f24] {
|
|
933
933
|
padding: 6px 10px;
|
|
934
|
-
}.single-selector[data-v-
|
|
934
|
+
}.single-selector[data-v-633b6466] {
|
|
935
935
|
position: relative;
|
|
936
936
|
width: 100%;
|
|
937
937
|
}
|
|
938
|
-
.single-selector.is-disabled[data-v-
|
|
938
|
+
.single-selector.is-disabled[data-v-633b6466] {
|
|
939
939
|
pointer-events: none;
|
|
940
940
|
}
|
|
941
|
-
.input-container[data-v-
|
|
941
|
+
.input-container[data-v-633b6466] {
|
|
942
942
|
position: relative;
|
|
943
943
|
display: flex;
|
|
944
944
|
align-items: center;
|
|
@@ -948,25 +948,25 @@ optgroup {
|
|
|
948
948
|
border: 1px solid #c4c6cc;
|
|
949
949
|
border-radius: 2px;
|
|
950
950
|
}
|
|
951
|
-
.input-container[data-v-
|
|
951
|
+
.input-container[data-v-633b6466]:focus-within {
|
|
952
952
|
border-color: #3a84ff;
|
|
953
953
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
954
954
|
}
|
|
955
|
-
.search-input[data-v-
|
|
955
|
+
.search-input[data-v-633b6466] {
|
|
956
956
|
flex: 1;
|
|
957
957
|
height: 30px;
|
|
958
|
+
outline: none;
|
|
958
959
|
background: transparent;
|
|
959
960
|
border: none;
|
|
960
|
-
outline: none;
|
|
961
961
|
}
|
|
962
|
-
.search-input[data-v-
|
|
962
|
+
.search-input[data-v-633b6466]::placeholder {
|
|
963
963
|
color: #c4c6cc;
|
|
964
|
-
}.bk-user-selector[data-v-
|
|
964
|
+
}.bk-user-selector[data-v-37ff6c88] {
|
|
965
965
|
position: relative;
|
|
966
966
|
width: 100%;
|
|
967
967
|
font-size: 12px;
|
|
968
968
|
}
|
|
969
|
-
.bk-user-selector.is-disabled[data-v-
|
|
969
|
+
.bk-user-selector.is-disabled[data-v-37ff6c88] {
|
|
970
970
|
cursor: not-allowed;
|
|
971
971
|
background-color: #dcdee5;
|
|
972
972
|
}
|
package/vue3/index.es.min.js
CHANGED
|
@@ -3262,7 +3262,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
3262
3262
|
}
|
|
3263
3263
|
return target;
|
|
3264
3264
|
};
|
|
3265
|
-
const MeTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
3265
|
+
const MeTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-ef4a05c4"]]);
|
|
3266
3266
|
const UserRender = defineComponent({
|
|
3267
3267
|
name: "UserRender",
|
|
3268
3268
|
props: {
|
|
@@ -3437,22 +3437,22 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3437
3437
|
};
|
|
3438
3438
|
return (_ctx, _cache) => {
|
|
3439
3439
|
return openBlock(), createBlock(unref(Popover), {
|
|
3440
|
-
"ext-cls": "bk-user-selector-popover",
|
|
3441
3440
|
arrow: false,
|
|
3441
|
+
"ext-cls": "bk-user-selector-popover",
|
|
3442
3442
|
"is-show": __props.isShow,
|
|
3443
3443
|
offset: { mainAxis: 4, crossAxis: __props.crossAxisOffset },
|
|
3444
|
-
width: __props.containerWidth,
|
|
3445
3444
|
placement: "bottom-start",
|
|
3446
3445
|
theme: "light",
|
|
3447
3446
|
trigger: "manual",
|
|
3447
|
+
width: __props.containerWidth,
|
|
3448
3448
|
onClickoutside: handleClickOutside
|
|
3449
3449
|
}, {
|
|
3450
3450
|
content: withCtx(() => [
|
|
3451
3451
|
createVNode(unref(Loading), {
|
|
3452
3452
|
class: "dropdown-content",
|
|
3453
3453
|
loading: __props.loading,
|
|
3454
|
-
|
|
3455
|
-
|
|
3454
|
+
mode: "spin",
|
|
3455
|
+
size: "mini"
|
|
3456
3456
|
}, {
|
|
3457
3457
|
default: withCtx(() => [
|
|
3458
3458
|
__props.options.length === 0 && __props.userGroup.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
@@ -3468,8 +3468,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3468
3468
|
{ key: 1 },
|
|
3469
3469
|
renderList(groupedUsers.value, (group, groupName) => {
|
|
3470
3470
|
return openBlock(), createElementBlock("div", {
|
|
3471
|
-
|
|
3472
|
-
|
|
3471
|
+
key: groupName,
|
|
3472
|
+
class: "user-group"
|
|
3473
3473
|
}, [
|
|
3474
3474
|
Object.keys(groupedUsers.value).length > 1 || group.some((user) => user.type === "userGroup") ? (openBlock(), createElementBlock("div", {
|
|
3475
3475
|
key: 0,
|
|
@@ -3497,8 +3497,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3497
3497
|
null,
|
|
3498
3498
|
renderList(group, (user) => {
|
|
3499
3499
|
return openBlock(), createElementBlock("div", {
|
|
3500
|
-
class: "user-option",
|
|
3501
3500
|
key: user.id,
|
|
3501
|
+
class: "user-option",
|
|
3502
3502
|
onClick: withModifiers(($event) => selectUser(user), ["prevent"])
|
|
3503
3503
|
}, [
|
|
3504
3504
|
createVNode(unref(UserRender), {
|
|
@@ -3531,20 +3531,20 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3531
3531
|
};
|
|
3532
3532
|
}
|
|
3533
3533
|
});
|
|
3534
|
-
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
3534
|
+
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ee78cf72"]]);
|
|
3535
3535
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3536
3536
|
...{
|
|
3537
3537
|
name: "UserTag"
|
|
3538
3538
|
},
|
|
3539
3539
|
__name: "user-tag",
|
|
3540
3540
|
props: {
|
|
3541
|
-
|
|
3542
|
-
tenants: {},
|
|
3541
|
+
active: { type: Boolean },
|
|
3543
3542
|
currentTenantId: {},
|
|
3544
3543
|
draggable: { type: Boolean },
|
|
3545
|
-
|
|
3544
|
+
renderTag: { type: Function },
|
|
3546
3545
|
showTenant: { type: Boolean },
|
|
3547
|
-
|
|
3546
|
+
tenants: {},
|
|
3547
|
+
user: {}
|
|
3548
3548
|
},
|
|
3549
3549
|
emits: ["click", "close"],
|
|
3550
3550
|
setup(__props, { emit: __emit }) {
|
|
@@ -3577,7 +3577,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3577
3577
|
};
|
|
3578
3578
|
}
|
|
3579
3579
|
});
|
|
3580
|
-
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
3580
|
+
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-48ac8fc1"]]);
|
|
3581
3581
|
const _hoisted_1$1 = ["onClick"];
|
|
3582
3582
|
const _hoisted_2$1 = ["placeholder"];
|
|
3583
3583
|
const _hoisted_3 = { class: "hidden-users" };
|
|
@@ -3588,24 +3588,25 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3588
3588
|
},
|
|
3589
3589
|
__name: "multiple-selector",
|
|
3590
3590
|
props: {
|
|
3591
|
-
|
|
3591
|
+
freePaste: { type: Boolean, default: false },
|
|
3592
3592
|
draggable: { type: Boolean, default: false },
|
|
3593
|
+
modelValue: { default: () => [] },
|
|
3593
3594
|
selectedUsers: { default: () => [] },
|
|
3594
3595
|
tenants: { default: () => ({}) },
|
|
3596
|
+
allowCreate: { type: Boolean, default: false },
|
|
3595
3597
|
apiBaseUrl: { default: "" },
|
|
3596
|
-
tenantId: { default: "" },
|
|
3597
|
-
placeholder: { default: "" },
|
|
3598
3598
|
currentUserId: { default: "" },
|
|
3599
|
+
disabled: { type: Boolean },
|
|
3600
|
+
emptyText: { default: "" },
|
|
3601
|
+
enableMultiTenantMode: { type: Boolean },
|
|
3599
3602
|
exactSearchKey: { default: "bk_username" },
|
|
3600
|
-
|
|
3603
|
+
excludeUserIds: { default: () => [] },
|
|
3604
|
+
placeholder: { default: "" },
|
|
3605
|
+
tenantId: { default: "" },
|
|
3601
3606
|
userGroupName: { default: "" },
|
|
3602
|
-
emptyText: { default: "" },
|
|
3603
|
-
disabled: { type: Boolean },
|
|
3604
3607
|
renderListItem: {},
|
|
3605
3608
|
renderTag: {},
|
|
3606
|
-
|
|
3607
|
-
enableMultiTenantMode: { type: Boolean },
|
|
3608
|
-
allowCreate: { type: Boolean, default: false }
|
|
3609
|
+
userGroup: { default: () => [] }
|
|
3609
3610
|
},
|
|
3610
3611
|
emits: [
|
|
3611
3612
|
"update:selectedUsers",
|
|
@@ -3706,7 +3707,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3706
3707
|
});
|
|
3707
3708
|
};
|
|
3708
3709
|
const handleClickOutside = (event) => {
|
|
3709
|
-
event.stopPropagation();
|
|
3710
3710
|
const target = event.target;
|
|
3711
3711
|
const container = containerRef.value;
|
|
3712
3712
|
if ((container == null ? void 0 : container.contains(target)) || container === target) {
|
|
@@ -3808,7 +3808,37 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3808
3808
|
}
|
|
3809
3809
|
});
|
|
3810
3810
|
const updatedUsers = Array.from(userMap.values());
|
|
3811
|
-
|
|
3811
|
+
if (props.freePaste) {
|
|
3812
|
+
const pastedUsers = usersList.map((user) => ({
|
|
3813
|
+
id: user,
|
|
3814
|
+
name: user,
|
|
3815
|
+
type: "custom",
|
|
3816
|
+
tenantId: "",
|
|
3817
|
+
login_name: user
|
|
3818
|
+
}));
|
|
3819
|
+
pastedUsers.forEach((user) => {
|
|
3820
|
+
if (!updatedUsers.some((item) => item.login_name === user.login_name)) {
|
|
3821
|
+
addUser(user);
|
|
3822
|
+
}
|
|
3823
|
+
});
|
|
3824
|
+
} else {
|
|
3825
|
+
emit("update:selectedUsers", updatedUsers);
|
|
3826
|
+
}
|
|
3827
|
+
} else {
|
|
3828
|
+
if (props.freePaste) {
|
|
3829
|
+
const pastedUsers = usersList.map((user) => ({
|
|
3830
|
+
id: user,
|
|
3831
|
+
name: user,
|
|
3832
|
+
type: "custom",
|
|
3833
|
+
tenantId: "",
|
|
3834
|
+
login_name: user
|
|
3835
|
+
}));
|
|
3836
|
+
pastedUsers.forEach((user) => {
|
|
3837
|
+
if (!props.selectedUsers.some((item) => item.login_name === user.login_name)) {
|
|
3838
|
+
addUser(user);
|
|
3839
|
+
}
|
|
3840
|
+
});
|
|
3841
|
+
}
|
|
3812
3842
|
}
|
|
3813
3843
|
} catch (error) {
|
|
3814
3844
|
console.error("精准查找用户失败:", error);
|
|
@@ -3830,7 +3860,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3830
3860
|
removeUser(lastUser);
|
|
3831
3861
|
}
|
|
3832
3862
|
} else if (event.key === "Enter" && props.allowCreate) {
|
|
3833
|
-
addUser({
|
|
3863
|
+
addUser({
|
|
3864
|
+
id: searchQuery.value,
|
|
3865
|
+
name: searchQuery.value,
|
|
3866
|
+
type: "custom",
|
|
3867
|
+
tenantId: "",
|
|
3868
|
+
login_name: searchQuery.value
|
|
3869
|
+
});
|
|
3834
3870
|
}
|
|
3835
3871
|
};
|
|
3836
3872
|
const addUser = (user) => {
|
|
@@ -3954,8 +3990,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3954
3990
|
null,
|
|
3955
3991
|
renderList(_ctx.selectedUsers, (user, index) => {
|
|
3956
3992
|
return openBlock(), createElementBlock("div", {
|
|
3957
|
-
class: "tag-wrapper",
|
|
3958
3993
|
key: user.id,
|
|
3994
|
+
class: "tag-wrapper",
|
|
3959
3995
|
onClick: withModifiers(($event) => handleTagClick(index), ["stop"])
|
|
3960
3996
|
}, [
|
|
3961
3997
|
createVNode(UserTag, {
|
|
@@ -3976,8 +4012,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3976
4012
|
ref_for: true,
|
|
3977
4013
|
ref_key: "inlineInputRef",
|
|
3978
4014
|
ref: inlineInputRef,
|
|
3979
|
-
class: "search-input inline",
|
|
3980
4015
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
4016
|
+
class: "search-input inline",
|
|
3981
4017
|
onFocus: handleInputFocus,
|
|
3982
4018
|
onInput: handleInput,
|
|
3983
4019
|
onKeydown: handleKeyDown,
|
|
@@ -3999,8 +4035,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3999
4035
|
key: 0,
|
|
4000
4036
|
ref_key: "lastInputRef",
|
|
4001
4037
|
ref: lastInputRef,
|
|
4002
|
-
class: "search-input last",
|
|
4003
4038
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
4039
|
+
class: "search-input last",
|
|
4004
4040
|
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
4005
4041
|
onFocus: handleInputFocus,
|
|
4006
4042
|
onInput: handleInput,
|
|
@@ -4041,8 +4077,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4041
4077
|
null,
|
|
4042
4078
|
renderList(visibleUsers.value, (user) => {
|
|
4043
4079
|
return openBlock(), createBlock(UserTag, {
|
|
4044
|
-
"current-tenant-id": _ctx.tenantId,
|
|
4045
4080
|
key: user.id,
|
|
4081
|
+
"current-tenant-id": _ctx.tenantId,
|
|
4046
4082
|
"render-tag": _ctx.renderTag,
|
|
4047
4083
|
"show-tenant": true,
|
|
4048
4084
|
tenants: _ctx.tenants,
|
|
@@ -4097,8 +4133,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4097
4133
|
withDirectives(createElementVNode("input", {
|
|
4098
4134
|
ref_key: "collapsedInputRef",
|
|
4099
4135
|
ref: collapsedInputRef,
|
|
4100
|
-
class: "search-input collapsed",
|
|
4101
4136
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
4137
|
+
class: "search-input collapsed",
|
|
4102
4138
|
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
4103
4139
|
onFocus: handleFocus
|
|
4104
4140
|
}, null, 40, _hoisted_4), [
|
|
@@ -4129,7 +4165,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
4129
4165
|
};
|
|
4130
4166
|
}
|
|
4131
4167
|
});
|
|
4132
|
-
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
4168
|
+
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-2a532f24"]]);
|
|
4133
4169
|
const _hoisted_1 = { class: "input-container" };
|
|
4134
4170
|
const _hoisted_2 = ["placeholder"];
|
|
4135
4171
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -4140,20 +4176,21 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4140
4176
|
props: {
|
|
4141
4177
|
modelValue: { default: "" },
|
|
4142
4178
|
tenants: {},
|
|
4179
|
+
allowCreate: { type: Boolean },
|
|
4180
|
+
freePaste: { type: Boolean },
|
|
4143
4181
|
apiBaseUrl: { default: "" },
|
|
4144
|
-
tenantId: { default: "" },
|
|
4145
|
-
placeholder: { default: "" },
|
|
4146
4182
|
currentUserId: { default: "" },
|
|
4183
|
+
disabled: { type: Boolean },
|
|
4184
|
+
emptyText: { default: "" },
|
|
4185
|
+
enableMultiTenantMode: { type: Boolean },
|
|
4147
4186
|
exactSearchKey: { default: "bk_username" },
|
|
4148
|
-
|
|
4187
|
+
excludeUserIds: { default: () => [] },
|
|
4188
|
+
placeholder: { default: "" },
|
|
4189
|
+
tenantId: { default: "" },
|
|
4149
4190
|
userGroupName: { default: "" },
|
|
4150
|
-
emptyText: { default: "" },
|
|
4151
|
-
disabled: { type: Boolean },
|
|
4152
4191
|
renderListItem: {},
|
|
4153
4192
|
renderTag: {},
|
|
4154
|
-
|
|
4155
|
-
enableMultiTenantMode: { type: Boolean },
|
|
4156
|
-
allowCreate: { type: Boolean }
|
|
4193
|
+
userGroup: { default: () => [] }
|
|
4157
4194
|
},
|
|
4158
4195
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
4159
4196
|
setup(__props, { emit: __emit }) {
|
|
@@ -4283,6 +4320,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4283
4320
|
}
|
|
4284
4321
|
}
|
|
4285
4322
|
};
|
|
4323
|
+
const handlePaste = (event) => {
|
|
4324
|
+
var _a;
|
|
4325
|
+
event.preventDefault();
|
|
4326
|
+
const pastedText = ((_a = event.clipboardData) == null ? void 0 : _a.getData("text").trim()) || "";
|
|
4327
|
+
if (props.freePaste) {
|
|
4328
|
+
const customUser = { id: pastedText, name: pastedText, type: "custom", tenantId: "", login_name: pastedText };
|
|
4329
|
+
if (!options.value.some((item) => item.login_name === customUser.login_name)) {
|
|
4330
|
+
options.value.push(customUser);
|
|
4331
|
+
}
|
|
4332
|
+
addUser(customUser);
|
|
4333
|
+
}
|
|
4334
|
+
};
|
|
4286
4335
|
const addUser = (user) => {
|
|
4287
4336
|
selectedUser.value = user.id;
|
|
4288
4337
|
searchQuery.value = "";
|
|
@@ -4359,13 +4408,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4359
4408
|
withDirectives(createElementVNode("input", {
|
|
4360
4409
|
ref_key: "inputRef",
|
|
4361
4410
|
ref: inputRef,
|
|
4362
|
-
class: "search-input",
|
|
4363
4411
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
|
|
4412
|
+
class: "search-input",
|
|
4364
4413
|
placeholder: selectedUserInfo.value ? "" : _ctx.placeholder,
|
|
4365
4414
|
onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur")),
|
|
4366
4415
|
onFocus: handleInputFocus,
|
|
4367
4416
|
onInput: handleInput,
|
|
4368
|
-
onKeydown: handleKeyDown
|
|
4417
|
+
onKeydown: handleKeyDown,
|
|
4418
|
+
onPaste: handlePaste
|
|
4369
4419
|
}, null, 40, _hoisted_2), [
|
|
4370
4420
|
[vModelText, searchQuery.value]
|
|
4371
4421
|
]),
|
|
@@ -4389,30 +4439,31 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
4389
4439
|
};
|
|
4390
4440
|
}
|
|
4391
4441
|
});
|
|
4392
|
-
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
4442
|
+
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-633b6466"]]);
|
|
4393
4443
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4394
4444
|
...{
|
|
4395
4445
|
name: "BkUserSelector"
|
|
4396
4446
|
},
|
|
4397
4447
|
__name: "user-selector",
|
|
4398
4448
|
props: {
|
|
4399
|
-
modelValue: { default: "" },
|
|
4400
4449
|
draggable: { type: Boolean, default: false },
|
|
4450
|
+
modelValue: { default: "" },
|
|
4401
4451
|
multiple: { type: Boolean, default: false },
|
|
4452
|
+
allowCreate: { type: Boolean, default: false },
|
|
4453
|
+
freePaste: { type: Boolean, default: false },
|
|
4402
4454
|
apiBaseUrl: { default: "" },
|
|
4403
|
-
tenantId: { default: "" },
|
|
4404
|
-
placeholder: { default: "" },
|
|
4405
4455
|
currentUserId: { default: "" },
|
|
4456
|
+
disabled: { type: Boolean, default: false },
|
|
4457
|
+
emptyText: { default: "" },
|
|
4458
|
+
enableMultiTenantMode: { type: Boolean, default: true },
|
|
4406
4459
|
exactSearchKey: { default: "bk_username" },
|
|
4407
|
-
|
|
4460
|
+
excludeUserIds: { default: () => [] },
|
|
4461
|
+
placeholder: { default: "" },
|
|
4462
|
+
tenantId: { default: "" },
|
|
4408
4463
|
userGroupName: { default: "" },
|
|
4409
|
-
emptyText: { default: "" },
|
|
4410
|
-
disabled: { type: Boolean, default: false },
|
|
4411
4464
|
renderListItem: {},
|
|
4412
4465
|
renderTag: {},
|
|
4413
|
-
|
|
4414
|
-
enableMultiTenantMode: { type: Boolean, default: true },
|
|
4415
|
-
allowCreate: { type: Boolean, default: false }
|
|
4466
|
+
userGroup: { default: () => [] }
|
|
4416
4467
|
},
|
|
4417
4468
|
emits: ["update:modelValue", "change", "dragStart", "dragEnd", "focus", "blur"],
|
|
4418
4469
|
setup(__props, { emit: __emit }) {
|
|
@@ -4535,10 +4586,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4535
4586
|
tenants: unref(tenants),
|
|
4536
4587
|
"user-group": _ctx.userGroup,
|
|
4537
4588
|
"user-group-name": userGroupName.value,
|
|
4589
|
+
"free-paste": _ctx.freePaste,
|
|
4538
4590
|
onBlur: handleBlur,
|
|
4539
4591
|
onChange: handleUpdateUser,
|
|
4540
4592
|
onFocus: handleFocus
|
|
4541
|
-
}, 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"])) : (openBlock(), createElementBlock(
|
|
4593
|
+
}, 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"])) : (openBlock(), createElementBlock(
|
|
4542
4594
|
Fragment,
|
|
4543
4595
|
{ key: 1 },
|
|
4544
4596
|
[
|
|
@@ -4563,12 +4615,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4563
4615
|
tenants: unref(tenants),
|
|
4564
4616
|
"user-group": _ctx.userGroup,
|
|
4565
4617
|
"user-group-name": userGroupName.value,
|
|
4618
|
+
"free-paste": _ctx.freePaste,
|
|
4566
4619
|
onBlur: handleBlur,
|
|
4567
4620
|
onDragEnd: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("dragEnd", $event)),
|
|
4568
4621
|
onDragStart: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("dragStart", $event)),
|
|
4569
4622
|
onFocus: handleFocus,
|
|
4570
4623
|
"onUpdate:selectedUsers": handleUpdateSelectedUsers
|
|
4571
|
-
}, 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"])
|
|
4624
|
+
}, 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"])
|
|
4572
4625
|
],
|
|
4573
4626
|
2112
|
|
4574
4627
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
@@ -4580,7 +4633,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4580
4633
|
};
|
|
4581
4634
|
}
|
|
4582
4635
|
});
|
|
4583
|
-
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4636
|
+
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-37ff6c88"]]);
|
|
4584
4637
|
export {
|
|
4585
4638
|
BkUserSelector,
|
|
4586
4639
|
BkUserSelector as default
|