@blueking/bk-user-selector 0.0.19 → 0.0.21
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 +17 -15
- package/package.json +1 -1
- package/typings/components/multiple-selector.vue.d.ts +5 -0
- package/typings/components/selection-popover.vue.d.ts +16 -0
- package/typings/components/single-selector.vue.d.ts +5 -0
- package/typings/components/user-render.d.ts +21 -0
- package/typings/components/user-selector.vue.d.ts +6 -0
- package/typings/components/user-tag.vue.d.ts +9 -0
- package/typings/types/index.d.ts +1 -0
- package/vue2/index.es.min.js +98 -64
- package/vue2/index.iife.min.js +98 -70
- package/vue2/index.umd.min.js +98 -64
- package/vue2/vue2.css +27 -46
- package/vue3/index.es.min.js +98 -64
- package/vue3/index.iife.min.js +98 -64
- package/vue3/index.umd.min.js +98 -64
- package/vue3/vue3.css +27 -46
package/vue2/vue2.css
CHANGED
|
@@ -1340,70 +1340,70 @@ 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-a1278ff6] {
|
|
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-a1278ff6] {
|
|
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-a1278ff6] {
|
|
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-a1278ff6] {
|
|
1361
1361
|
margin-left: 4px;
|
|
1362
1362
|
}
|
|
1363
|
-
.dropdown-content .user-option[data-v-
|
|
1363
|
+
.dropdown-content .user-option[data-v-a1278ff6] {
|
|
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-a1278ff6]:hover {
|
|
1371
1371
|
background-color: #f5f7fa;
|
|
1372
1372
|
}
|
|
1373
|
-
.dropdown-content .user-option .tenant-name[data-v-
|
|
1373
|
+
.dropdown-content .user-option .tenant-name[data-v-a1278ff6] {
|
|
1374
1374
|
color: #f59500;
|
|
1375
1375
|
margin-left: 4px;
|
|
1376
1376
|
padding: 0 4px;
|
|
1377
1377
|
}.bk-user-selector-popover.bk-popover.bk-pop2-content {
|
|
1378
1378
|
padding: 0;
|
|
1379
|
-
}.user-tag[data-v-
|
|
1379
|
+
}.user-tag[data-v-7099192b] {
|
|
1380
1380
|
margin-right: 4px;
|
|
1381
1381
|
margin-left: 0;
|
|
1382
1382
|
}
|
|
1383
|
-
.user-tag.draggable[data-v-
|
|
1383
|
+
.user-tag.draggable[data-v-7099192b] {
|
|
1384
1384
|
cursor: move;
|
|
1385
1385
|
}
|
|
1386
|
-
.user-tag.active[data-v-
|
|
1386
|
+
.user-tag.active[data-v-7099192b] {
|
|
1387
1387
|
background-color: #e1ecff;
|
|
1388
1388
|
border-color: #3a84ff;
|
|
1389
1389
|
}
|
|
1390
|
-
.user-tag .tag-content .user-name[data-v-
|
|
1390
|
+
.user-tag .tag-content .user-name[data-v-7099192b] {
|
|
1391
1391
|
white-space: nowrap;
|
|
1392
1392
|
overflow: hidden;
|
|
1393
1393
|
text-overflow: ellipsis;
|
|
1394
1394
|
font-size: 12px;
|
|
1395
1395
|
}
|
|
1396
|
-
.user-tag .tag-content .tenant-name[data-v-
|
|
1396
|
+
.user-tag .tag-content .tenant-name[data-v-7099192b] {
|
|
1397
1397
|
color: #f59500;
|
|
1398
1398
|
margin-left: 3px;
|
|
1399
1399
|
white-space: nowrap;
|
|
1400
1400
|
padding: 0 3px;
|
|
1401
1401
|
border-radius: 2px;
|
|
1402
|
-
}.multiple-selector[data-v-
|
|
1402
|
+
}.multiple-selector[data-v-d4f489c3] {
|
|
1403
1403
|
position: relative;
|
|
1404
1404
|
width: 100%;
|
|
1405
1405
|
}
|
|
1406
|
-
.multiple-selector .tags-container[data-v-
|
|
1406
|
+
.multiple-selector .tags-container[data-v-d4f489c3] {
|
|
1407
1407
|
min-height: 32px;
|
|
1408
1408
|
border: 1px solid #dcdee5;
|
|
1409
1409
|
border-radius: 2px;
|
|
@@ -1411,46 +1411,46 @@ optgroup {
|
|
|
1411
1411
|
transition: all 0.2s ease;
|
|
1412
1412
|
background-color: #fff;
|
|
1413
1413
|
}
|
|
1414
|
-
.multiple-selector .tags-container.focused[data-v-
|
|
1414
|
+
.multiple-selector .tags-container.focused[data-v-d4f489c3] {
|
|
1415
1415
|
border-color: #3a84ff;
|
|
1416
1416
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
1417
1417
|
}
|
|
1418
|
-
.multiple-selector .tags-container.collapsed[data-v-
|
|
1418
|
+
.multiple-selector .tags-container.collapsed[data-v-d4f489c3] {
|
|
1419
1419
|
display: flex;
|
|
1420
1420
|
flex-wrap: wrap;
|
|
1421
1421
|
align-items: center;
|
|
1422
1422
|
}
|
|
1423
|
-
.multiple-selector .tag-list[data-v-
|
|
1423
|
+
.multiple-selector .tag-list[data-v-d4f489c3] {
|
|
1424
1424
|
display: flex;
|
|
1425
1425
|
flex-wrap: wrap;
|
|
1426
1426
|
align-items: center;
|
|
1427
1427
|
}
|
|
1428
|
-
.multiple-selector .tag-wrapper[data-v-
|
|
1428
|
+
.multiple-selector .tag-wrapper[data-v-d4f489c3] {
|
|
1429
1429
|
display: inline-flex;
|
|
1430
1430
|
align-items: center;
|
|
1431
1431
|
max-width: 100%;
|
|
1432
1432
|
}
|
|
1433
|
-
.multiple-selector .search-input[data-v-
|
|
1433
|
+
.multiple-selector .search-input[data-v-d4f489c3] {
|
|
1434
1434
|
outline: none;
|
|
1435
1435
|
border: none;
|
|
1436
1436
|
height: 28px;
|
|
1437
1437
|
min-width: 10px;
|
|
1438
1438
|
background: transparent;
|
|
1439
1439
|
}
|
|
1440
|
-
.multiple-selector .search-input[data-v-
|
|
1440
|
+
.multiple-selector .search-input[data-v-d4f489c3]::placeholder {
|
|
1441
1441
|
color: #c4c6cc;
|
|
1442
1442
|
}
|
|
1443
|
-
.multiple-selector .search-input.inline[data-v-
|
|
1443
|
+
.multiple-selector .search-input.inline[data-v-d4f489c3] {
|
|
1444
1444
|
min-width: 10px;
|
|
1445
1445
|
}
|
|
1446
|
-
.multiple-selector .search-input.last[data-v-
|
|
1446
|
+
.multiple-selector .search-input.last[data-v-d4f489c3], .multiple-selector .search-input.collapsed[data-v-d4f489c3] {
|
|
1447
1447
|
flex: 1;
|
|
1448
1448
|
min-width: 60px;
|
|
1449
|
-
}.single-selector[data-v-
|
|
1449
|
+
}.single-selector[data-v-91a75bba] {
|
|
1450
1450
|
position: relative;
|
|
1451
1451
|
width: 100%;
|
|
1452
1452
|
}
|
|
1453
|
-
.input-container[data-v-
|
|
1453
|
+
.input-container[data-v-91a75bba] {
|
|
1454
1454
|
position: relative;
|
|
1455
1455
|
display: flex;
|
|
1456
1456
|
align-items: center;
|
|
@@ -1460,38 +1460,19 @@ optgroup {
|
|
|
1460
1460
|
padding: 0 8px;
|
|
1461
1461
|
background-color: #fff;
|
|
1462
1462
|
}
|
|
1463
|
-
.input-container[data-v-
|
|
1463
|
+
.input-container[data-v-91a75bba]:focus-within {
|
|
1464
1464
|
border-color: #3a84ff;
|
|
1465
1465
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
1466
1466
|
}
|
|
1467
|
-
.search-input[data-v-
|
|
1467
|
+
.search-input[data-v-91a75bba] {
|
|
1468
1468
|
flex: 1;
|
|
1469
1469
|
outline: none;
|
|
1470
1470
|
border: none;
|
|
1471
1471
|
height: 30px;
|
|
1472
1472
|
background: transparent;
|
|
1473
1473
|
}
|
|
1474
|
-
.search-input[data-v-
|
|
1474
|
+
.search-input[data-v-91a75bba]::placeholder {
|
|
1475
1475
|
color: #c4c6cc;
|
|
1476
|
-
}
|
|
1477
|
-
.selected-user[data-v-5040d42f] {
|
|
1478
|
-
display: inline-flex;
|
|
1479
|
-
align-items: center;
|
|
1480
|
-
background-color: #f0f1f5;
|
|
1481
|
-
border-radius: 2px;
|
|
1482
|
-
padding: 0 8px;
|
|
1483
|
-
margin-right: 8px;
|
|
1484
|
-
height: 24px;
|
|
1485
|
-
max-width: calc(100% - 32px);
|
|
1486
|
-
}
|
|
1487
|
-
.selected-user .tenant-name[data-v-5040d42f] {
|
|
1488
|
-
color: #f59500;
|
|
1489
|
-
margin-left: 4px;
|
|
1490
|
-
}
|
|
1491
|
-
.selected-user .close-icon[data-v-5040d42f] {
|
|
1492
|
-
margin-left: 4px;
|
|
1493
|
-
cursor: pointer;
|
|
1494
|
-
font-style: normal;
|
|
1495
1476
|
}.bk-user-selector[data-v-c23f5bc9] {
|
|
1496
1477
|
width: 100%;
|
|
1497
1478
|
position: relative;
|
package/vue3/index.es.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, onBeforeMount, defineComponent, createElementBlock, createCommentVNode, openBlock, withModifiers, normalizeClass, computed, createBlock, unref, withCtx, createVNode, createElementVNode, toDisplayString, Fragment, renderList, watch, nextTick, onMounted, withDirectives, isRef, vModelText, createTextVNode
|
|
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
2
|
import { Popover, Loading, Tag, bkTooltips, clickoutside } from "bkui-vue";
|
|
3
3
|
const getTenants = async (apiBaseUrl, tenantId) => {
|
|
4
4
|
if (!apiBaseUrl || !tenantId) {
|
|
@@ -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
|
}
|
|
@@ -3013,14 +3013,39 @@ const _export_sfc = (sfc, props) => {
|
|
|
3013
3013
|
return target;
|
|
3014
3014
|
};
|
|
3015
3015
|
const MeTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-887b7c44"]]);
|
|
3016
|
+
const UserRender = defineComponent({
|
|
3017
|
+
name: "UserRender",
|
|
3018
|
+
props: {
|
|
3019
|
+
render: {
|
|
3020
|
+
type: Function,
|
|
3021
|
+
required: true
|
|
3022
|
+
},
|
|
3023
|
+
user: {
|
|
3024
|
+
type: Object,
|
|
3025
|
+
required: true
|
|
3026
|
+
}
|
|
3027
|
+
},
|
|
3028
|
+
setup(props) {
|
|
3029
|
+
return () => {
|
|
3030
|
+
try {
|
|
3031
|
+
return props.render(h, props.user);
|
|
3032
|
+
} catch (error) {
|
|
3033
|
+
console.error("Error rendering tag:", error);
|
|
3034
|
+
return h("div", props.user.name);
|
|
3035
|
+
}
|
|
3036
|
+
};
|
|
3037
|
+
}
|
|
3038
|
+
});
|
|
3016
3039
|
const _hoisted_1$4 = {
|
|
3017
3040
|
key: 0,
|
|
3018
3041
|
class: "no-data"
|
|
3019
3042
|
};
|
|
3020
3043
|
const _hoisted_2$3 = { class: "group-name" };
|
|
3021
|
-
const _hoisted_3$
|
|
3044
|
+
const _hoisted_3$2 = { class: "group-count" };
|
|
3022
3045
|
const _hoisted_4$1 = ["onMousedown"];
|
|
3023
|
-
const _hoisted_5 = {
|
|
3046
|
+
const _hoisted_5 = { key: 0 };
|
|
3047
|
+
const _hoisted_6 = { key: 1 };
|
|
3048
|
+
const _hoisted_7 = {
|
|
3024
3049
|
key: 0,
|
|
3025
3050
|
class: "tenant-name"
|
|
3026
3051
|
};
|
|
@@ -3099,6 +3124,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3099
3124
|
emptyText: {
|
|
3100
3125
|
type: String,
|
|
3101
3126
|
default: "无匹配人员"
|
|
3127
|
+
},
|
|
3128
|
+
/**
|
|
3129
|
+
* 渲染列表项
|
|
3130
|
+
*/
|
|
3131
|
+
renderListItem: {
|
|
3132
|
+
type: Function
|
|
3102
3133
|
}
|
|
3103
3134
|
},
|
|
3104
3135
|
emits: ["select-user"],
|
|
@@ -3108,7 +3139,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3108
3139
|
const groupedUsers = computed(() => {
|
|
3109
3140
|
const groups = {};
|
|
3110
3141
|
if (Array.isArray(props.userGroup) && props.userGroup.length > 0) {
|
|
3111
|
-
groups[props.userGroupName] = props.userGroup.
|
|
3142
|
+
groups[props.userGroupName] = props.userGroup.map((group) => ({
|
|
3112
3143
|
...group,
|
|
3113
3144
|
tenantId: "",
|
|
3114
3145
|
type: "userGroup"
|
|
@@ -3148,7 +3179,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3148
3179
|
createElementVNode(
|
|
3149
3180
|
"span",
|
|
3150
3181
|
null,
|
|
3151
|
-
toDisplayString(__props.
|
|
3182
|
+
toDisplayString(__props.emptyText),
|
|
3152
3183
|
1
|
|
3153
3184
|
/* TEXT */
|
|
3154
3185
|
)
|
|
@@ -3178,7 +3209,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3178
3209
|
),
|
|
3179
3210
|
createElementVNode(
|
|
3180
3211
|
"span",
|
|
3181
|
-
_hoisted_3$
|
|
3212
|
+
_hoisted_3$2,
|
|
3182
3213
|
"(" + toDisplayString(group.length) + ")",
|
|
3183
3214
|
1
|
|
3184
3215
|
/* TEXT */
|
|
@@ -3196,7 +3227,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3196
3227
|
key: user.id,
|
|
3197
3228
|
onMousedown: withModifiers(($event) => selectUser(user), ["prevent"])
|
|
3198
3229
|
}, [
|
|
3199
|
-
|
|
3230
|
+
__props.renderListItem ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
3231
|
+
createVNode(unref(UserRender), {
|
|
3232
|
+
render: __props.renderListItem,
|
|
3233
|
+
user
|
|
3234
|
+
}, null, 8, ["render", "user"])
|
|
3235
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
3200
3236
|
createElementVNode(
|
|
3201
3237
|
"span",
|
|
3202
3238
|
null,
|
|
@@ -3206,12 +3242,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3206
3242
|
),
|
|
3207
3243
|
user.tenantId !== __props.tenantId && user.tenantId && __props.tenants[user.tenantId] ? (openBlock(), createElementBlock(
|
|
3208
3244
|
"span",
|
|
3209
|
-
|
|
3245
|
+
_hoisted_7,
|
|
3210
3246
|
"@" + toDisplayString(__props.tenants[user.tenantId]),
|
|
3211
3247
|
1
|
|
3212
3248
|
/* TEXT */
|
|
3213
3249
|
)) : createCommentVNode("v-if", true)
|
|
3214
|
-
])
|
|
3250
|
+
]))
|
|
3215
3251
|
], 40, _hoisted_4$1);
|
|
3216
3252
|
}),
|
|
3217
3253
|
128
|
|
@@ -3233,10 +3269,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3233
3269
|
};
|
|
3234
3270
|
}
|
|
3235
3271
|
});
|
|
3236
|
-
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
3237
|
-
const _hoisted_1$3 = {
|
|
3238
|
-
const _hoisted_2$2 = {
|
|
3239
|
-
|
|
3272
|
+
const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-a1278ff6"]]);
|
|
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 = {
|
|
3240
3280
|
key: 0,
|
|
3241
3281
|
class: "tenant-name"
|
|
3242
3282
|
};
|
|
@@ -3251,7 +3291,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3251
3291
|
currentTenantId: {},
|
|
3252
3292
|
draggable: { type: Boolean },
|
|
3253
3293
|
active: { type: Boolean },
|
|
3254
|
-
showTenant: { type: Boolean }
|
|
3294
|
+
showTenant: { type: Boolean },
|
|
3295
|
+
renderTag: { type: Function }
|
|
3255
3296
|
},
|
|
3256
3297
|
emits: ["click", "close"],
|
|
3257
3298
|
setup(__props, { emit: __emit }) {
|
|
@@ -3270,22 +3311,27 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3270
3311
|
onClose: handleClose
|
|
3271
3312
|
}, {
|
|
3272
3313
|
default: withCtx(() => [
|
|
3273
|
-
|
|
3314
|
+
_ctx.renderTag ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
3315
|
+
createVNode(unref(UserRender), {
|
|
3316
|
+
render: _ctx.renderTag,
|
|
3317
|
+
user: _ctx.user
|
|
3318
|
+
}, null, 8, ["render", "user"])
|
|
3319
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
3274
3320
|
createElementVNode(
|
|
3275
3321
|
"span",
|
|
3276
|
-
|
|
3322
|
+
_hoisted_3$1,
|
|
3277
3323
|
toDisplayString(_ctx.user.name),
|
|
3278
3324
|
1
|
|
3279
3325
|
/* TEXT */
|
|
3280
3326
|
),
|
|
3281
3327
|
_ctx.user.tenantId !== _ctx.currentTenantId && _ctx.user.tenantId ? (openBlock(), createElementBlock(
|
|
3282
3328
|
"span",
|
|
3283
|
-
|
|
3329
|
+
_hoisted_4,
|
|
3284
3330
|
" @" + toDisplayString(_ctx.tenants[_ctx.user.tenantId]),
|
|
3285
3331
|
1
|
|
3286
3332
|
/* TEXT */
|
|
3287
3333
|
)) : createCommentVNode("v-if", true)
|
|
3288
|
-
])
|
|
3334
|
+
]))
|
|
3289
3335
|
]),
|
|
3290
3336
|
_: 1
|
|
3291
3337
|
/* STABLE */
|
|
@@ -3293,10 +3339,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3293
3339
|
};
|
|
3294
3340
|
}
|
|
3295
3341
|
});
|
|
3296
|
-
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
3342
|
+
const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-7099192b"]]);
|
|
3297
3343
|
const _hoisted_1$2 = ["onClick"];
|
|
3298
3344
|
const _hoisted_2$1 = ["placeholder"];
|
|
3299
|
-
const _hoisted_3
|
|
3345
|
+
const _hoisted_3 = ["placeholder"];
|
|
3300
3346
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3301
3347
|
...{
|
|
3302
3348
|
name: "BkUserSelectorMultiple"
|
|
@@ -3345,6 +3391,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3345
3391
|
const options = computed(() => {
|
|
3346
3392
|
return searchResults.value.filter((user) => !props.selectedUsers.some((selectedUser) => selectedUser.id === user.id));
|
|
3347
3393
|
});
|
|
3394
|
+
const userGroupFilter = computed(() => {
|
|
3395
|
+
return props.userGroup.filter((group) => !props.selectedUsers.some((user) => user.id === group.id) && !group.hidden);
|
|
3396
|
+
});
|
|
3348
3397
|
const initSortable = () => {
|
|
3349
3398
|
if (!props.draggable || !sortableContainerRef.value) return;
|
|
3350
3399
|
if (sortableInstance.value) {
|
|
@@ -3434,7 +3483,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3434
3483
|
if (!isFocused.value) {
|
|
3435
3484
|
isFocused.value = true;
|
|
3436
3485
|
}
|
|
3437
|
-
if (searchQuery.value.length >=
|
|
3486
|
+
if (searchQuery.value.length >= 1) {
|
|
3438
3487
|
showDropdown.value = true;
|
|
3439
3488
|
}
|
|
3440
3489
|
};
|
|
@@ -3603,11 +3652,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3603
3652
|
active: index === activeTagIndex.value,
|
|
3604
3653
|
"current-tenant-id": _ctx.tenantId,
|
|
3605
3654
|
draggable: _ctx.draggable,
|
|
3655
|
+
"render-tag": _ctx.renderTag,
|
|
3606
3656
|
tenants: _ctx.tenants,
|
|
3607
3657
|
user,
|
|
3608
3658
|
onClick: ($event) => handleTagClick(index),
|
|
3609
3659
|
onClose: ($event) => removeUser(user)
|
|
3610
|
-
}, null, 8, ["active", "current-tenant-id", "draggable", "tenants", "user", "onClick", "onClose"]),
|
|
3660
|
+
}, null, 8, ["active", "current-tenant-id", "draggable", "render-tag", "tenants", "user", "onClick", "onClose"]),
|
|
3611
3661
|
createCommentVNode(" 在当前激活标签后插入输入框 "),
|
|
3612
3662
|
index === activeTagIndex.value && activeTagIndex.value !== _ctx.selectedUsers.length - 1 ? withDirectives((openBlock(), createElementBlock(
|
|
3613
3663
|
"input",
|
|
@@ -3683,12 +3733,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3683
3733
|
return openBlock(), createBlock(UserTag, {
|
|
3684
3734
|
"current-tenant-id": _ctx.tenantId,
|
|
3685
3735
|
key: user.id,
|
|
3736
|
+
"render-tag": _ctx.renderTag,
|
|
3686
3737
|
"show-tenant": true,
|
|
3687
3738
|
tenants: _ctx.tenants,
|
|
3688
3739
|
user,
|
|
3689
3740
|
onClick: handleFocus,
|
|
3690
3741
|
onClose: ($event) => removeUser(user)
|
|
3691
|
-
}, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
|
|
3742
|
+
}, null, 8, ["current-tenant-id", "render-tag", "tenants", "user", "onClose"]);
|
|
3692
3743
|
}),
|
|
3693
3744
|
128
|
|
3694
3745
|
/* KEYED_FRAGMENT */
|
|
@@ -3721,7 +3772,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3721
3772
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
|
|
3722
3773
|
placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
|
|
3723
3774
|
onFocus: handleFocus
|
|
3724
|
-
}, null, 40, _hoisted_3
|
|
3775
|
+
}, null, 40, _hoisted_3), [
|
|
3725
3776
|
[vModelText, unref(searchQuery)]
|
|
3726
3777
|
]),
|
|
3727
3778
|
createCommentVNode(' 未聚焦状态下的"我"标签 '),
|
|
@@ -3745,14 +3796,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3745
3796
|
"is-show": showDropdown.value,
|
|
3746
3797
|
loading: unref(searchLoading),
|
|
3747
3798
|
options: options.value,
|
|
3799
|
+
"render-list-item": _ctx.renderListItem,
|
|
3748
3800
|
"search-query": unref(searchQuery),
|
|
3749
3801
|
"tenant-id": _ctx.tenantId,
|
|
3750
3802
|
tenants: _ctx.tenants,
|
|
3751
|
-
"user-group":
|
|
3803
|
+
"user-group": userGroupFilter.value,
|
|
3752
3804
|
"user-group-name": _ctx.userGroupName,
|
|
3753
3805
|
onClickoutside: handleClickOutside,
|
|
3754
3806
|
onSelectUser: addUser
|
|
3755
|
-
}, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3807
|
+
}, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "render-list-item", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3756
3808
|
],
|
|
3757
3809
|
512
|
|
3758
3810
|
/* NEED_PATCH */
|
|
@@ -3760,21 +3812,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3760
3812
|
};
|
|
3761
3813
|
}
|
|
3762
3814
|
});
|
|
3763
|
-
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
3764
|
-
const _withScopeId = (n) => (pushScopeId("data-v-5040d42f"), n = n(), popScopeId(), n);
|
|
3815
|
+
const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d4f489c3"]]);
|
|
3765
3816
|
const _hoisted_1$1 = { class: "input-container" };
|
|
3766
|
-
const _hoisted_2 =
|
|
3767
|
-
key: 0,
|
|
3768
|
-
class: "tenant-name"
|
|
3769
|
-
};
|
|
3770
|
-
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
|
|
3771
|
-
"i",
|
|
3772
|
-
{ class: "close-icon" },
|
|
3773
|
-
"×",
|
|
3774
|
-
-1
|
|
3775
|
-
/* HOISTED */
|
|
3776
|
-
));
|
|
3777
|
-
const _hoisted_4 = ["placeholder"];
|
|
3817
|
+
const _hoisted_2 = ["placeholder"];
|
|
3778
3818
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3779
3819
|
...{
|
|
3780
3820
|
name: "BkUserSelectorSingle"
|
|
@@ -3805,6 +3845,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3805
3845
|
const selectedUser = ref(props.modelValue || "");
|
|
3806
3846
|
const searchQuery = ref("");
|
|
3807
3847
|
const showDropdown = ref(false);
|
|
3848
|
+
const userGroupFilter = computed(() => {
|
|
3849
|
+
return props.userGroup.filter((group) => group.id !== selectedUser.value && !group.hidden);
|
|
3850
|
+
});
|
|
3808
3851
|
const selectedUserInfo = computed(() => {
|
|
3809
3852
|
const userGroup = (props.userGroup || []).map((group) => ({
|
|
3810
3853
|
...group,
|
|
@@ -3853,7 +3896,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3853
3896
|
}
|
|
3854
3897
|
};
|
|
3855
3898
|
const fetchUsers = async (keyword = "") => {
|
|
3856
|
-
if (!keyword
|
|
3899
|
+
if (!(keyword == null ? void 0 : keyword.length)) {
|
|
3857
3900
|
options.value = [];
|
|
3858
3901
|
return;
|
|
3859
3902
|
}
|
|
@@ -3878,13 +3921,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3878
3921
|
searchQuery.value = "";
|
|
3879
3922
|
};
|
|
3880
3923
|
const handleInputFocus = () => {
|
|
3881
|
-
if (searchQuery.value.length >=
|
|
3924
|
+
if (searchQuery.value.length >= 1 || Array.isArray(props.userGroup) && props.userGroup.length > 0) {
|
|
3882
3925
|
showDropdown.value = true;
|
|
3883
3926
|
}
|
|
3884
3927
|
};
|
|
3885
3928
|
const handleInput = () => {
|
|
3886
3929
|
fetchUsers(searchQuery.value);
|
|
3887
|
-
showDropdown.value = searchQuery.value.length >=
|
|
3930
|
+
showDropdown.value = searchQuery.value.length >= 1;
|
|
3888
3931
|
};
|
|
3889
3932
|
const handleClickOutside = () => {
|
|
3890
3933
|
showDropdown.value = false;
|
|
@@ -3903,24 +3946,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3903
3946
|
createCommentVNode(" 用户标签显示 "),
|
|
3904
3947
|
selectedUserInfo.value ? (openBlock(), createElementBlock("div", {
|
|
3905
3948
|
key: 0,
|
|
3906
|
-
class: "selected-user",
|
|
3907
3949
|
onClick: withModifiers(removeSelectedUser, ["stop"])
|
|
3908
3950
|
}, [
|
|
3909
|
-
|
|
3910
|
-
"
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
),
|
|
3916
|
-
selectedUserInfo.value.tenantId !== _ctx.tenantId && selectedUserInfo.value.tenantId && _ctx.tenants[selectedUserInfo.value.tenantId] ? (openBlock(), createElementBlock(
|
|
3917
|
-
"span",
|
|
3918
|
-
_hoisted_2,
|
|
3919
|
-
"@" + toDisplayString(_ctx.tenants[selectedUserInfo.value.tenantId]),
|
|
3920
|
-
1
|
|
3921
|
-
/* TEXT */
|
|
3922
|
-
)) : createCommentVNode("v-if", true),
|
|
3923
|
-
_hoisted_3
|
|
3951
|
+
createVNode(UserTag, {
|
|
3952
|
+
"render-tag": _ctx.renderTag,
|
|
3953
|
+
tenants: _ctx.tenants,
|
|
3954
|
+
user: selectedUserInfo.value,
|
|
3955
|
+
onClose: removeSelectedUser
|
|
3956
|
+
}, null, 8, ["render-tag", "tenants", "user"])
|
|
3924
3957
|
])) : createCommentVNode("v-if", true),
|
|
3925
3958
|
withDirectives(createElementVNode("input", {
|
|
3926
3959
|
ref_key: "inputRef",
|
|
@@ -3930,7 +3963,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3930
3963
|
placeholder: selectedUserInfo.value ? "" : _ctx.placeholder,
|
|
3931
3964
|
onFocus: handleInputFocus,
|
|
3932
3965
|
onInput: handleInput
|
|
3933
|
-
}, null, 40,
|
|
3966
|
+
}, null, 40, _hoisted_2), [
|
|
3934
3967
|
[vModelText, searchQuery.value]
|
|
3935
3968
|
]),
|
|
3936
3969
|
createCommentVNode(' "我"标签 '),
|
|
@@ -3947,20 +3980,21 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3947
3980
|
"is-show": showDropdown.value,
|
|
3948
3981
|
loading: isLoading.value,
|
|
3949
3982
|
options: options.value,
|
|
3983
|
+
"render-list-item": _ctx.renderListItem,
|
|
3950
3984
|
"search-query": searchQuery.value,
|
|
3951
3985
|
"tenant-id": _ctx.tenantId,
|
|
3952
3986
|
tenants: _ctx.tenants,
|
|
3953
|
-
"user-group":
|
|
3987
|
+
"user-group": userGroupFilter.value,
|
|
3954
3988
|
"user-group-name": _ctx.userGroupName,
|
|
3955
3989
|
onSelectUser: addUser
|
|
3956
|
-
}, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3990
|
+
}, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "render-list-item", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
|
|
3957
3991
|
])), [
|
|
3958
3992
|
[unref(clickoutside), handleClickOutside]
|
|
3959
3993
|
]);
|
|
3960
3994
|
};
|
|
3961
3995
|
}
|
|
3962
3996
|
});
|
|
3963
|
-
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
3997
|
+
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-91a75bba"]]);
|
|
3964
3998
|
const _hoisted_1 = {
|
|
3965
3999
|
ref: "containerRef",
|
|
3966
4000
|
class: "bk-user-selector"
|