@blueking/bk-user-selector 0.0.20 → 0.0.22
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/package.json +1 -1
- package/typings/components/selection-popover.vue.d.ts +18 -1
- package/typings/components/user-render.d.ts +22 -6
- package/typings/components/user-tag.vue.d.ts +2 -2
- package/vue2/index.es.min.js +111 -102
- package/vue2/index.iife.min.js +112 -103
- package/vue2/index.umd.min.js +112 -103
- package/vue2/vue2.css +27 -39
- package/vue3/index.es.min.js +111 -102
- package/vue3/index.iife.min.js +112 -103
- package/vue3/index.umd.min.js +111 -102
- package/vue3/vue3.css +27 -39
package/vue2/vue2.css
CHANGED
|
@@ -1340,138 +1340,126 @@ optgroup {
|
|
|
1340
1340
|
background-color: #f0f1f5;
|
|
1341
1341
|
color: #c4c6cc;
|
|
1342
1342
|
cursor: not-allowed;
|
|
1343
|
-
}.dropdown-content[data-v-
|
|
1343
|
+
}.dropdown-content[data-v-54b68f9a] {
|
|
1344
1344
|
min-height: 40px;
|
|
1345
1345
|
max-height: 300px;
|
|
1346
1346
|
overflow-y: auto;
|
|
1347
1347
|
padding: 5px 0;
|
|
1348
1348
|
}
|
|
1349
|
-
.dropdown-content .no-data[data-v-
|
|
1349
|
+
.dropdown-content .no-data[data-v-54b68f9a] {
|
|
1350
1350
|
padding: 10px;
|
|
1351
1351
|
text-align: center;
|
|
1352
1352
|
color: #979ba5;
|
|
1353
1353
|
}
|
|
1354
|
-
.dropdown-content .user-group .group-header[data-v-
|
|
1354
|
+
.dropdown-content .user-group .group-header[data-v-54b68f9a] {
|
|
1355
1355
|
padding: 8px 12px;
|
|
1356
1356
|
color: #979ba5;
|
|
1357
1357
|
display: flex;
|
|
1358
1358
|
align-items: center;
|
|
1359
1359
|
}
|
|
1360
|
-
.dropdown-content .user-group .group-header .group-count[data-v-
|
|
1360
|
+
.dropdown-content .user-group .group-header .group-count[data-v-54b68f9a] {
|
|
1361
1361
|
margin-left: 4px;
|
|
1362
1362
|
}
|
|
1363
|
-
.dropdown-content .user-option[data-v-
|
|
1363
|
+
.dropdown-content .user-option[data-v-54b68f9a] {
|
|
1364
1364
|
padding: 8px 12px;
|
|
1365
1365
|
cursor: pointer;
|
|
1366
1366
|
display: flex;
|
|
1367
1367
|
align-items: center;
|
|
1368
1368
|
height: 32px;
|
|
1369
1369
|
}
|
|
1370
|
-
.dropdown-content .user-option[data-v-
|
|
1370
|
+
.dropdown-content .user-option[data-v-54b68f9a]:hover {
|
|
1371
1371
|
background-color: #f5f7fa;
|
|
1372
|
-
}
|
|
1373
|
-
.dropdown-content .user-option .tenant-name[data-v-a24bd074] {
|
|
1374
|
-
color: #f59500;
|
|
1375
|
-
margin-left: 4px;
|
|
1376
|
-
padding: 0 4px;
|
|
1377
1372
|
}.bk-user-selector-popover.bk-popover.bk-pop2-content {
|
|
1378
1373
|
padding: 0;
|
|
1379
|
-
}.user-tag[data-v-
|
|
1374
|
+
}.user-tag[data-v-655f7a5a] {
|
|
1380
1375
|
margin-right: 4px;
|
|
1381
1376
|
margin-left: 0;
|
|
1382
1377
|
}
|
|
1383
|
-
.user-tag.draggable[data-v-
|
|
1378
|
+
.user-tag.draggable[data-v-655f7a5a] {
|
|
1384
1379
|
cursor: move;
|
|
1385
1380
|
}
|
|
1386
|
-
.user-tag.active[data-v-
|
|
1381
|
+
.user-tag.active[data-v-655f7a5a] {
|
|
1387
1382
|
background-color: #e1ecff;
|
|
1388
1383
|
border-color: #3a84ff;
|
|
1389
1384
|
}
|
|
1390
|
-
.user-tag .tag-content .user-name[data-v-
|
|
1385
|
+
.user-tag .tag-content .user-name[data-v-655f7a5a] {
|
|
1391
1386
|
white-space: nowrap;
|
|
1392
1387
|
overflow: hidden;
|
|
1393
1388
|
text-overflow: ellipsis;
|
|
1394
1389
|
font-size: 12px;
|
|
1395
|
-
}
|
|
1396
|
-
.user-tag .tag-content .tenant-name[data-v-7099192b] {
|
|
1397
|
-
color: #f59500;
|
|
1398
|
-
margin-left: 3px;
|
|
1399
|
-
white-space: nowrap;
|
|
1400
|
-
padding: 0 3px;
|
|
1401
|
-
border-radius: 2px;
|
|
1402
|
-
}.multiple-selector[data-v-5e95d86c] {
|
|
1390
|
+
}.multiple-selector[data-v-d9743f6d] {
|
|
1403
1391
|
position: relative;
|
|
1404
1392
|
width: 100%;
|
|
1405
1393
|
}
|
|
1406
|
-
.multiple-selector .tags-container[data-v-
|
|
1394
|
+
.multiple-selector .tags-container[data-v-d9743f6d] {
|
|
1407
1395
|
min-height: 32px;
|
|
1408
|
-
border: 1px solid #
|
|
1396
|
+
border: 1px solid #c4c6cc;
|
|
1409
1397
|
border-radius: 2px;
|
|
1410
1398
|
padding: 1px 10px 1px 8px;
|
|
1411
1399
|
transition: all 0.2s ease;
|
|
1412
1400
|
background-color: #fff;
|
|
1413
1401
|
}
|
|
1414
|
-
.multiple-selector .tags-container.focused[data-v-
|
|
1402
|
+
.multiple-selector .tags-container.focused[data-v-d9743f6d] {
|
|
1415
1403
|
border-color: #3a84ff;
|
|
1416
1404
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
1417
1405
|
}
|
|
1418
|
-
.multiple-selector .tags-container.collapsed[data-v-
|
|
1406
|
+
.multiple-selector .tags-container.collapsed[data-v-d9743f6d] {
|
|
1419
1407
|
display: flex;
|
|
1420
1408
|
flex-wrap: wrap;
|
|
1421
1409
|
align-items: center;
|
|
1422
1410
|
}
|
|
1423
|
-
.multiple-selector .tag-list[data-v-
|
|
1411
|
+
.multiple-selector .tag-list[data-v-d9743f6d] {
|
|
1424
1412
|
display: flex;
|
|
1425
1413
|
flex-wrap: wrap;
|
|
1426
1414
|
align-items: center;
|
|
1427
1415
|
}
|
|
1428
|
-
.multiple-selector .tag-wrapper[data-v-
|
|
1416
|
+
.multiple-selector .tag-wrapper[data-v-d9743f6d] {
|
|
1429
1417
|
display: inline-flex;
|
|
1430
1418
|
align-items: center;
|
|
1431
1419
|
max-width: 100%;
|
|
1432
1420
|
}
|
|
1433
|
-
.multiple-selector .search-input[data-v-
|
|
1421
|
+
.multiple-selector .search-input[data-v-d9743f6d] {
|
|
1434
1422
|
outline: none;
|
|
1435
1423
|
border: none;
|
|
1436
1424
|
height: 28px;
|
|
1437
1425
|
min-width: 10px;
|
|
1438
1426
|
background: transparent;
|
|
1439
1427
|
}
|
|
1440
|
-
.multiple-selector .search-input[data-v-
|
|
1428
|
+
.multiple-selector .search-input[data-v-d9743f6d]::placeholder {
|
|
1441
1429
|
color: #c4c6cc;
|
|
1442
1430
|
}
|
|
1443
|
-
.multiple-selector .search-input.inline[data-v-
|
|
1431
|
+
.multiple-selector .search-input.inline[data-v-d9743f6d] {
|
|
1444
1432
|
min-width: 10px;
|
|
1445
1433
|
}
|
|
1446
|
-
.multiple-selector .search-input.last[data-v-
|
|
1434
|
+
.multiple-selector .search-input.last[data-v-d9743f6d], .multiple-selector .search-input.collapsed[data-v-d9743f6d] {
|
|
1447
1435
|
flex: 1;
|
|
1448
1436
|
min-width: 60px;
|
|
1449
|
-
}.single-selector[data-v-
|
|
1437
|
+
}.single-selector[data-v-b20a7499] {
|
|
1450
1438
|
position: relative;
|
|
1451
1439
|
width: 100%;
|
|
1452
1440
|
}
|
|
1453
|
-
.input-container[data-v-
|
|
1441
|
+
.input-container[data-v-b20a7499] {
|
|
1454
1442
|
position: relative;
|
|
1455
1443
|
display: flex;
|
|
1456
1444
|
align-items: center;
|
|
1457
1445
|
min-height: 32px;
|
|
1458
|
-
border: 1px solid #
|
|
1446
|
+
border: 1px solid #c4c6cc;
|
|
1459
1447
|
border-radius: 2px;
|
|
1460
1448
|
padding: 0 8px;
|
|
1461
1449
|
background-color: #fff;
|
|
1462
1450
|
}
|
|
1463
|
-
.input-container[data-v-
|
|
1451
|
+
.input-container[data-v-b20a7499]:focus-within {
|
|
1464
1452
|
border-color: #3a84ff;
|
|
1465
1453
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
1466
1454
|
}
|
|
1467
|
-
.search-input[data-v-
|
|
1455
|
+
.search-input[data-v-b20a7499] {
|
|
1468
1456
|
flex: 1;
|
|
1469
1457
|
outline: none;
|
|
1470
1458
|
border: none;
|
|
1471
1459
|
height: 30px;
|
|
1472
1460
|
background: transparent;
|
|
1473
1461
|
}
|
|
1474
|
-
.search-input[data-v-
|
|
1462
|
+
.search-input[data-v-b20a7499]::placeholder {
|
|
1475
1463
|
color: #c4c6cc;
|
|
1476
1464
|
}.bk-user-selector[data-v-c23f5bc9] {
|
|
1477
1465
|
width: 100%;
|
package/vue3/index.es.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, onBeforeMount, defineComponent, createElementBlock, createCommentVNode, openBlock, withModifiers, normalizeClass, h, computed, createBlock, unref, withCtx, createVNode, createElementVNode, toDisplayString, Fragment, renderList, watch, nextTick, onMounted, withDirectives, isRef, vModelText, createTextVNode } from "vue";
|
|
2
|
-
import { Popover, Loading, Tag,
|
|
2
|
+
import { Popover, Loading, Tag, clickoutside } from "bkui-vue";
|
|
3
3
|
const getTenants = async (apiBaseUrl, tenantId) => {
|
|
4
4
|
if (!apiBaseUrl || !tenantId) {
|
|
5
5
|
console.warn("获取租户信息需要提供有效的apiBaseUrl和租户ID");
|
|
@@ -2924,7 +2924,7 @@ const useUserSearch = (apiBaseUrl, tenantId) => {
|
|
|
2924
2924
|
const loading = ref(false);
|
|
2925
2925
|
const searchQuery = ref("");
|
|
2926
2926
|
const performSearch = async (keyword) => {
|
|
2927
|
-
if (!keyword
|
|
2927
|
+
if (!(keyword == null ? void 0 : keyword.length)) {
|
|
2928
2928
|
searchResults.value = [];
|
|
2929
2929
|
return;
|
|
2930
2930
|
}
|
|
@@ -3016,39 +3016,56 @@ const MeTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-88
|
|
|
3016
3016
|
const UserRender = defineComponent({
|
|
3017
3017
|
name: "UserRender",
|
|
3018
3018
|
props: {
|
|
3019
|
-
|
|
3020
|
-
type:
|
|
3019
|
+
user: {
|
|
3020
|
+
type: Object,
|
|
3021
3021
|
required: true
|
|
3022
3022
|
},
|
|
3023
|
-
|
|
3023
|
+
tenantId: {
|
|
3024
|
+
type: String,
|
|
3025
|
+
required: true
|
|
3026
|
+
},
|
|
3027
|
+
tenants: {
|
|
3024
3028
|
type: Object,
|
|
3025
3029
|
required: true
|
|
3030
|
+
},
|
|
3031
|
+
render: {
|
|
3032
|
+
type: Function,
|
|
3033
|
+
required: false
|
|
3026
3034
|
}
|
|
3027
3035
|
},
|
|
3028
3036
|
setup(props) {
|
|
3037
|
+
const defaultRender = (h2, props2) => {
|
|
3038
|
+
return h2("div", [
|
|
3039
|
+
h2("span", props2.user.name),
|
|
3040
|
+
props2.user.tenantId !== props2.tenantId && props2.user.tenantId ? h2(
|
|
3041
|
+
"span",
|
|
3042
|
+
{
|
|
3043
|
+
style: {
|
|
3044
|
+
color: "#f59500",
|
|
3045
|
+
marginLeft: "4px"
|
|
3046
|
+
}
|
|
3047
|
+
},
|
|
3048
|
+
`@${props2.tenants[props2.user.tenantId] || props2.user.tenantId}`
|
|
3049
|
+
) : null
|
|
3050
|
+
]);
|
|
3051
|
+
};
|
|
3029
3052
|
return () => {
|
|
3030
3053
|
try {
|
|
3031
|
-
return props.render(h, props.user);
|
|
3054
|
+
return props.render ? props.render(h, props.user) : defaultRender(h, props);
|
|
3032
3055
|
} catch (error) {
|
|
3033
3056
|
console.error("Error rendering tag:", error);
|
|
3034
|
-
return h
|
|
3057
|
+
return defaultRender(h, props);
|
|
3035
3058
|
}
|
|
3036
3059
|
};
|
|
3037
3060
|
}
|
|
3038
3061
|
});
|
|
3039
|
-
const _hoisted_1$
|
|
3062
|
+
const _hoisted_1$3 = {
|
|
3040
3063
|
key: 0,
|
|
3041
3064
|
class: "no-data"
|
|
3042
3065
|
};
|
|
3043
|
-
const _hoisted_2$
|
|
3044
|
-
const _hoisted_3$
|
|
3045
|
-
const _hoisted_4
|
|
3046
|
-
const _hoisted_5 = { key: 0 };
|
|
3047
|
-
const _hoisted_6 = { key: 1 };
|
|
3048
|
-
const _hoisted_7 = {
|
|
3049
|
-
key: 0,
|
|
3050
|
-
class: "tenant-name"
|
|
3051
|
-
};
|
|
3066
|
+
const _hoisted_2$2 = { class: "group-name" };
|
|
3067
|
+
const _hoisted_3$1 = { class: "group-count" };
|
|
3068
|
+
const _hoisted_4 = ["onMousedown"];
|
|
3052
3069
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
3053
3070
|
...{
|
|
3054
3071
|
name: "SelectionPopover"
|
|
@@ -3069,6 +3086,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3069
3086
|
type: [Number, String],
|
|
3070
3087
|
default: "auto"
|
|
3071
3088
|
},
|
|
3089
|
+
/**
|
|
3090
|
+
* popover crossAxis 偏移量
|
|
3091
|
+
*/
|
|
3092
|
+
crossAxisOffset: {
|
|
3093
|
+
type: Number,
|
|
3094
|
+
default: 0
|
|
3095
|
+
},
|
|
3072
3096
|
/**
|
|
3073
3097
|
* 是否加载中
|
|
3074
3098
|
*/
|
|
@@ -3132,7 +3156,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3132
3156
|
type: Function
|
|
3133
3157
|
}
|
|
3134
3158
|
},
|
|
3135
|
-
emits: ["select-user"],
|
|
3159
|
+
emits: ["select-user", "click-outside"],
|
|
3136
3160
|
setup(__props, { emit: __emit }) {
|
|
3137
3161
|
const props = __props;
|
|
3138
3162
|
const emit = __emit;
|
|
@@ -3157,15 +3181,20 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3157
3181
|
const selectUser = (user) => {
|
|
3158
3182
|
emit("select-user", user);
|
|
3159
3183
|
};
|
|
3184
|
+
const handleClickOutside = ({ event }) => {
|
|
3185
|
+
emit("click-outside", event);
|
|
3186
|
+
};
|
|
3160
3187
|
return (_ctx, _cache) => {
|
|
3161
3188
|
return openBlock(), createBlock(unref(Popover), {
|
|
3162
3189
|
"ext-cls": "bk-user-selector-popover",
|
|
3163
3190
|
arrow: false,
|
|
3164
3191
|
"is-show": __props.isShow,
|
|
3192
|
+
offset: { mainAxis: 4, crossAxis: __props.crossAxisOffset },
|
|
3165
3193
|
width: __props.containerWidth,
|
|
3166
3194
|
placement: "bottom-start",
|
|
3167
3195
|
theme: "light",
|
|
3168
|
-
trigger: "manual"
|
|
3196
|
+
trigger: "manual",
|
|
3197
|
+
onClickoutside: handleClickOutside
|
|
3169
3198
|
}, {
|
|
3170
3199
|
content: withCtx(() => [
|
|
3171
3200
|
createVNode(unref(Loading), {
|
|
@@ -3175,11 +3204,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3175
3204
|
mode: "spin"
|
|
3176
3205
|
}, {
|
|
3177
3206
|
default: withCtx(() => [
|
|
3178
|
-
__props.options.length === 0 && __props.userGroup.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
3207
|
+
__props.options.length === 0 && __props.userGroup.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
3179
3208
|
createElementVNode(
|
|
3180
3209
|
"span",
|
|
3181
3210
|
null,
|
|
3182
|
-
toDisplayString(__props.
|
|
3211
|
+
toDisplayString(__props.emptyText),
|
|
3183
3212
|
1
|
|
3184
3213
|
/* TEXT */
|
|
3185
3214
|
)
|
|
@@ -3202,14 +3231,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3202
3231
|
[
|
|
3203
3232
|
createElementVNode(
|
|
3204
3233
|
"span",
|
|
3205
|
-
_hoisted_2$
|
|
3234
|
+
_hoisted_2$2,
|
|
3206
3235
|
toDisplayString(groupName),
|
|
3207
3236
|
1
|
|
3208
3237
|
/* TEXT */
|
|
3209
3238
|
),
|
|
3210
3239
|
createElementVNode(
|
|
3211
3240
|
"span",
|
|
3212
|
-
_hoisted_3$
|
|
3241
|
+
_hoisted_3$1,
|
|
3213
3242
|
"(" + toDisplayString(group.length) + ")",
|
|
3214
3243
|
1
|
|
3215
3244
|
/* TEXT */
|
|
@@ -3227,28 +3256,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3227
3256
|
key: user.id,
|
|
3228
3257
|
onMousedown: withModifiers(($event) => selectUser(user), ["prevent"])
|
|
3229
3258
|
}, [
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
"span",
|
|
3238
|
-
null,
|
|
3239
|
-
toDisplayString(user.name),
|
|
3240
|
-
1
|
|
3241
|
-
/* TEXT */
|
|
3242
|
-
),
|
|
3243
|
-
user.tenantId !== __props.tenantId && user.tenantId && __props.tenants[user.tenantId] ? (openBlock(), createElementBlock(
|
|
3244
|
-
"span",
|
|
3245
|
-
_hoisted_7,
|
|
3246
|
-
"@" + toDisplayString(__props.tenants[user.tenantId]),
|
|
3247
|
-
1
|
|
3248
|
-
/* TEXT */
|
|
3249
|
-
)) : createCommentVNode("v-if", true)
|
|
3250
|
-
]))
|
|
3251
|
-
], 40, _hoisted_4$1);
|
|
3259
|
+
createVNode(unref(UserRender), {
|
|
3260
|
+
render: __props.renderListItem,
|
|
3261
|
+
"tenant-id": __props.tenantId,
|
|
3262
|
+
tenants: __props.tenants,
|
|
3263
|
+
user
|
|
3264
|
+
}, null, 8, ["render", "tenant-id", "tenants", "user"])
|
|
3265
|
+
], 40, _hoisted_4);
|
|
3252
3266
|
}),
|
|
3253
3267
|
128
|
|
3254
3268
|
/* KEYED_FRAGMENT */
|
|
@@ -3265,21 +3279,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3265
3279
|
]),
|
|
3266
3280
|
_: 1
|
|
3267
3281
|
/* STABLE */
|
|
3268
|
-
}, 8, ["is-show", "width"]);
|
|
3282
|
+
}, 8, ["is-show", "offset", "width"]);
|
|
3269
3283
|
};
|
|
3270
3284
|
}
|
|
3271
3285
|
});
|
|
3272
|
-
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
3273
|
-
const _hoisted_1$3 = { key: 0 };
|
|
3274
|
-
const _hoisted_2$2 = {
|
|
3275
|
-
key: 1,
|
|
3276
|
-
class: "tag-content"
|
|
3277
|
-
};
|
|
3278
|
-
const _hoisted_3$1 = { class: "user-name" };
|
|
3279
|
-
const _hoisted_4 = {
|
|
3280
|
-
key: 0,
|
|
3281
|
-
class: "tenant-name"
|
|
3282
|
-
};
|
|
3286
|
+
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-54b68f9a"]]);
|
|
3283
3287
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3284
3288
|
...{
|
|
3285
3289
|
name: "UserTag"
|
|
@@ -3311,27 +3315,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3311
3315
|
onClose: handleClose
|
|
3312
3316
|
}, {
|
|
3313
3317
|
default: withCtx(() => [
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
createElementVNode(
|
|
3321
|
-
"span",
|
|
3322
|
-
_hoisted_3$1,
|
|
3323
|
-
toDisplayString(_ctx.user.name),
|
|
3324
|
-
1
|
|
3325
|
-
/* TEXT */
|
|
3326
|
-
),
|
|
3327
|
-
_ctx.user.tenantId !== _ctx.currentTenantId && _ctx.user.tenantId ? (openBlock(), createElementBlock(
|
|
3328
|
-
"span",
|
|
3329
|
-
_hoisted_4,
|
|
3330
|
-
" @" + toDisplayString(_ctx.tenants[_ctx.user.tenantId]),
|
|
3331
|
-
1
|
|
3332
|
-
/* TEXT */
|
|
3333
|
-
)) : createCommentVNode("v-if", true)
|
|
3334
|
-
]))
|
|
3318
|
+
createVNode(unref(UserRender), {
|
|
3319
|
+
render: _ctx.renderTag,
|
|
3320
|
+
"tenant-id": _ctx.currentTenantId,
|
|
3321
|
+
tenants: _ctx.tenants,
|
|
3322
|
+
user: _ctx.user
|
|
3323
|
+
}, null, 8, ["render", "tenant-id", "tenants", "user"])
|
|
3335
3324
|
]),
|
|
3336
3325
|
_: 1
|
|
3337
3326
|
/* STABLE */
|
|
@@ -3339,7 +3328,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3339
3328
|
};
|
|
3340
3329
|
}
|
|
3341
3330
|
});
|
|
3342
|
-
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
3331
|
+
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-655f7a5a"]]);
|
|
3343
3332
|
const _hoisted_1$2 = ["onClick"];
|
|
3344
3333
|
const _hoisted_2$1 = ["placeholder"];
|
|
3345
3334
|
const _hoisted_3 = ["placeholder"];
|
|
@@ -3443,7 +3432,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3443
3432
|
}
|
|
3444
3433
|
});
|
|
3445
3434
|
};
|
|
3446
|
-
const handleClickOutside = (
|
|
3435
|
+
const handleClickOutside = (event) => {
|
|
3447
3436
|
event.stopPropagation();
|
|
3448
3437
|
const target = event.target;
|
|
3449
3438
|
const container = containerRef.value;
|
|
@@ -3483,7 +3472,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3483
3472
|
if (!isFocused.value) {
|
|
3484
3473
|
isFocused.value = true;
|
|
3485
3474
|
}
|
|
3486
|
-
if (searchQuery.value.length >=
|
|
3475
|
+
if (searchQuery.value.length >= 1) {
|
|
3487
3476
|
showDropdown.value = true;
|
|
3488
3477
|
}
|
|
3489
3478
|
};
|
|
@@ -3578,6 +3567,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3578
3567
|
});
|
|
3579
3568
|
}
|
|
3580
3569
|
};
|
|
3570
|
+
const crossAxisOffset = ref(0);
|
|
3581
3571
|
watch(
|
|
3582
3572
|
() => props.selectedUsers,
|
|
3583
3573
|
() => {
|
|
@@ -3745,25 +3735,42 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3745
3735
|
/* KEYED_FRAGMENT */
|
|
3746
3736
|
)),
|
|
3747
3737
|
createCommentVNode(" 显示折叠标签数量 "),
|
|
3748
|
-
hiddenCount.value > 0 ?
|
|
3738
|
+
hiddenCount.value > 0 ? (openBlock(), createBlock(unref(Popover), {
|
|
3749
3739
|
key: 0,
|
|
3750
|
-
|
|
3740
|
+
placement: "top"
|
|
3751
3741
|
}, {
|
|
3742
|
+
content: withCtx(() => [
|
|
3743
|
+
(openBlock(true), createElementBlock(
|
|
3744
|
+
Fragment,
|
|
3745
|
+
null,
|
|
3746
|
+
renderList(_ctx.selectedUsers.slice(visibleUsers.value.length), (user) => {
|
|
3747
|
+
return openBlock(), createBlock(unref(UserRender), {
|
|
3748
|
+
key: user.id,
|
|
3749
|
+
"tenant-id": _ctx.tenantId,
|
|
3750
|
+
tenants: _ctx.tenants,
|
|
3751
|
+
user
|
|
3752
|
+
}, null, 8, ["tenant-id", "tenants", "user"]);
|
|
3753
|
+
}),
|
|
3754
|
+
128
|
|
3755
|
+
/* KEYED_FRAGMENT */
|
|
3756
|
+
))
|
|
3757
|
+
]),
|
|
3752
3758
|
default: withCtx(() => [
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3759
|
+
createVNode(unref(Tag), null, {
|
|
3760
|
+
default: withCtx(() => [
|
|
3761
|
+
createTextVNode(
|
|
3762
|
+
" +" + toDisplayString(hiddenCount.value),
|
|
3763
|
+
1
|
|
3764
|
+
/* TEXT */
|
|
3765
|
+
)
|
|
3766
|
+
]),
|
|
3767
|
+
_: 1
|
|
3768
|
+
/* STABLE */
|
|
3769
|
+
})
|
|
3758
3770
|
]),
|
|
3759
3771
|
_: 1
|
|
3760
3772
|
/* STABLE */
|
|
3761
|
-
})),
|
|
3762
|
-
[unref(bkTooltips), {
|
|
3763
|
-
content: _ctx.selectedUsers.slice(visibleUsers.value.length).map((user) => user.display_name).join(","),
|
|
3764
|
-
placement: "top"
|
|
3765
|
-
}]
|
|
3766
|
-
]) : createCommentVNode("v-if", true),
|
|
3773
|
+
})) : createCommentVNode("v-if", true),
|
|
3767
3774
|
createCommentVNode(" 搜索输入框 "),
|
|
3768
3775
|
withDirectives(createElementVNode("input", {
|
|
3769
3776
|
ref_key: "collapsedInputRef",
|
|
@@ -3792,6 +3799,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3792
3799
|
createCommentVNode(" 下拉选项列表 "),
|
|
3793
3800
|
createVNode(SelectionPopover, {
|
|
3794
3801
|
"container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
|
|
3802
|
+
"cross-axis-offset": crossAxisOffset.value,
|
|
3795
3803
|
"empty-text": _ctx.emptyText,
|
|
3796
3804
|
"is-show": showDropdown.value,
|
|
3797
3805
|
loading: unref(searchLoading),
|
|
@@ -3802,9 +3810,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3802
3810
|
tenants: _ctx.tenants,
|
|
3803
3811
|
"user-group": userGroupFilter.value,
|
|
3804
3812
|
"user-group-name": _ctx.userGroupName,
|
|
3805
|
-
|
|
3813
|
+
onClickOutside: handleClickOutside,
|
|
3806
3814
|
onSelectUser: addUser
|
|
3807
|
-
}, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "render-list-item", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3815
|
+
}, null, 8, ["container-width", "cross-axis-offset", "empty-text", "is-show", "loading", "options", "render-list-item", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3808
3816
|
],
|
|
3809
3817
|
512
|
|
3810
3818
|
/* NEED_PATCH */
|
|
@@ -3812,7 +3820,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3812
3820
|
};
|
|
3813
3821
|
}
|
|
3814
3822
|
});
|
|
3815
|
-
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
3823
|
+
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d9743f6d"]]);
|
|
3816
3824
|
const _hoisted_1$1 = { class: "input-container" };
|
|
3817
3825
|
const _hoisted_2 = ["placeholder"];
|
|
3818
3826
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -3896,7 +3904,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3896
3904
|
}
|
|
3897
3905
|
};
|
|
3898
3906
|
const fetchUsers = async (keyword = "") => {
|
|
3899
|
-
if (!keyword
|
|
3907
|
+
if (!(keyword == null ? void 0 : keyword.length)) {
|
|
3900
3908
|
options.value = [];
|
|
3901
3909
|
return;
|
|
3902
3910
|
}
|
|
@@ -3921,13 +3929,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3921
3929
|
searchQuery.value = "";
|
|
3922
3930
|
};
|
|
3923
3931
|
const handleInputFocus = () => {
|
|
3924
|
-
if (searchQuery.value.length >=
|
|
3932
|
+
if (searchQuery.value.length >= 1 || Array.isArray(props.userGroup) && props.userGroup.length > 0) {
|
|
3925
3933
|
showDropdown.value = true;
|
|
3926
3934
|
}
|
|
3927
3935
|
};
|
|
3928
3936
|
const handleInput = () => {
|
|
3929
3937
|
fetchUsers(searchQuery.value);
|
|
3930
|
-
showDropdown.value = searchQuery.value.length >=
|
|
3938
|
+
showDropdown.value = searchQuery.value.length >= 1;
|
|
3931
3939
|
};
|
|
3932
3940
|
const handleClickOutside = () => {
|
|
3933
3941
|
showDropdown.value = false;
|
|
@@ -3949,11 +3957,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3949
3957
|
onClick: withModifiers(removeSelectedUser, ["stop"])
|
|
3950
3958
|
}, [
|
|
3951
3959
|
createVNode(UserTag, {
|
|
3960
|
+
"current-tenant-id": _ctx.tenantId,
|
|
3952
3961
|
"render-tag": _ctx.renderTag,
|
|
3953
3962
|
tenants: _ctx.tenants,
|
|
3954
3963
|
user: selectedUserInfo.value,
|
|
3955
3964
|
onClose: removeSelectedUser
|
|
3956
|
-
}, null, 8, ["render-tag", "tenants", "user"])
|
|
3965
|
+
}, null, 8, ["current-tenant-id", "render-tag", "tenants", "user"])
|
|
3957
3966
|
])) : createCommentVNode("v-if", true),
|
|
3958
3967
|
withDirectives(createElementVNode("input", {
|
|
3959
3968
|
ref_key: "inputRef",
|
|
@@ -3994,7 +4003,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3994
4003
|
};
|
|
3995
4004
|
}
|
|
3996
4005
|
});
|
|
3997
|
-
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
4006
|
+
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b20a7499"]]);
|
|
3998
4007
|
const _hoisted_1 = {
|
|
3999
4008
|
ref: "containerRef",
|
|
4000
4009
|
class: "bk-user-selector"
|