@blueking/bk-user-selector 0.0.21 → 0.0.23-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/package.json +1 -1
- package/typings/components/me-tag.vue.d.ts +5 -5
- package/typings/components/multiple-selector.vue.d.ts +4 -47
- package/typings/components/selection-popover.vue.d.ts +23 -6
- package/typings/components/single-selector.vue.d.ts +4 -41
- package/typings/components/user-render.d.ts +24 -8
- package/typings/components/user-selector.vue.d.ts +4 -45
- package/typings/components/user-tag.vue.d.ts +9 -43
- package/typings/hooks/useTenantData.d.ts +2 -2
- package/typings/hooks/useUserSearch.d.ts +3 -3
- package/typings/vue2.d.ts +1 -7
- package/vue2/index.es.min.js +148 -141
- package/vue2/index.iife.min.js +2788 -2263
- package/vue2/index.umd.min.js +148 -141
- package/vue2/vue2.css +40 -52
- package/vue3/index.es.min.js +114 -105
- package/vue3/index.iife.min.js +115 -106
- package/vue3/index.umd.min.js +114 -105
- package/vue3/vue3.css +40 -52
- package/typings/components/render-tag.d.ts +0 -8
package/vue2/vue2.css
CHANGED
|
@@ -1340,141 +1340,129 @@ optgroup {
|
|
|
1340
1340
|
background-color: #f0f1f5;
|
|
1341
1341
|
color: #c4c6cc;
|
|
1342
1342
|
cursor: not-allowed;
|
|
1343
|
-
}.
|
|
1343
|
+
}.bk-user-selector-popover.bk-popover.bk-pop2-content {
|
|
1344
|
+
padding: 0;
|
|
1345
|
+
}.dropdown-content[data-v-54b68f9a] {
|
|
1344
1346
|
min-height: 40px;
|
|
1345
1347
|
max-height: 300px;
|
|
1346
1348
|
overflow-y: auto;
|
|
1347
1349
|
padding: 5px 0;
|
|
1348
1350
|
}
|
|
1349
|
-
.dropdown-content .no-data[data-v-
|
|
1351
|
+
.dropdown-content .no-data[data-v-54b68f9a] {
|
|
1350
1352
|
padding: 10px;
|
|
1351
1353
|
text-align: center;
|
|
1352
1354
|
color: #979ba5;
|
|
1353
1355
|
}
|
|
1354
|
-
.dropdown-content .user-group .group-header[data-v-
|
|
1356
|
+
.dropdown-content .user-group .group-header[data-v-54b68f9a] {
|
|
1355
1357
|
padding: 8px 12px;
|
|
1356
1358
|
color: #979ba5;
|
|
1357
1359
|
display: flex;
|
|
1358
1360
|
align-items: center;
|
|
1359
1361
|
}
|
|
1360
|
-
.dropdown-content .user-group .group-header .group-count[data-v-
|
|
1362
|
+
.dropdown-content .user-group .group-header .group-count[data-v-54b68f9a] {
|
|
1361
1363
|
margin-left: 4px;
|
|
1362
1364
|
}
|
|
1363
|
-
.dropdown-content .user-option[data-v-
|
|
1365
|
+
.dropdown-content .user-option[data-v-54b68f9a] {
|
|
1364
1366
|
padding: 8px 12px;
|
|
1365
1367
|
cursor: pointer;
|
|
1366
1368
|
display: flex;
|
|
1367
1369
|
align-items: center;
|
|
1368
1370
|
height: 32px;
|
|
1369
1371
|
}
|
|
1370
|
-
.dropdown-content .user-option[data-v-
|
|
1372
|
+
.dropdown-content .user-option[data-v-54b68f9a]:hover {
|
|
1371
1373
|
background-color: #f5f7fa;
|
|
1372
|
-
}
|
|
1373
|
-
.dropdown-content .user-option .tenant-name[data-v-a1278ff6] {
|
|
1374
|
-
color: #f59500;
|
|
1375
|
-
margin-left: 4px;
|
|
1376
|
-
padding: 0 4px;
|
|
1377
|
-
}.bk-user-selector-popover.bk-popover.bk-pop2-content {
|
|
1378
|
-
padding: 0;
|
|
1379
|
-
}.user-tag[data-v-7099192b] {
|
|
1374
|
+
}.user-tag[data-v-487799ec] {
|
|
1380
1375
|
margin-right: 4px;
|
|
1381
1376
|
margin-left: 0;
|
|
1382
1377
|
}
|
|
1383
|
-
.user-tag.draggable[data-v-
|
|
1378
|
+
.user-tag.draggable[data-v-487799ec] {
|
|
1384
1379
|
cursor: move;
|
|
1385
1380
|
}
|
|
1386
|
-
.user-tag.active[data-v-
|
|
1381
|
+
.user-tag.active[data-v-487799ec] {
|
|
1387
1382
|
background-color: #e1ecff;
|
|
1388
1383
|
border-color: #3a84ff;
|
|
1389
1384
|
}
|
|
1390
|
-
.user-tag .tag-content .user-name[data-v-
|
|
1391
|
-
white-space: nowrap;
|
|
1385
|
+
.user-tag .tag-content .user-name[data-v-487799ec] {
|
|
1392
1386
|
overflow: hidden;
|
|
1393
|
-
text-overflow: ellipsis;
|
|
1394
1387
|
font-size: 12px;
|
|
1395
|
-
|
|
1396
|
-
.user-tag .tag-content .tenant-name[data-v-7099192b] {
|
|
1397
|
-
color: #f59500;
|
|
1398
|
-
margin-left: 3px;
|
|
1388
|
+
text-overflow: ellipsis;
|
|
1399
1389
|
white-space: nowrap;
|
|
1400
|
-
|
|
1401
|
-
border-radius: 2px;
|
|
1402
|
-
}.multiple-selector[data-v-d4f489c3] {
|
|
1390
|
+
}.multiple-selector[data-v-95b69442] {
|
|
1403
1391
|
position: relative;
|
|
1404
1392
|
width: 100%;
|
|
1405
1393
|
}
|
|
1406
|
-
.multiple-selector .tags-container[data-v-
|
|
1394
|
+
.multiple-selector .tags-container[data-v-95b69442] {
|
|
1407
1395
|
min-height: 32px;
|
|
1408
|
-
border: 1px solid #dcdee5;
|
|
1409
|
-
border-radius: 2px;
|
|
1410
1396
|
padding: 1px 10px 1px 8px;
|
|
1411
|
-
transition: all 0.2s ease;
|
|
1412
1397
|
background-color: #fff;
|
|
1398
|
+
border: 1px solid #c4c6cc;
|
|
1399
|
+
border-radius: 2px;
|
|
1400
|
+
transition: all 0.2s ease;
|
|
1413
1401
|
}
|
|
1414
|
-
.multiple-selector .tags-container.focused[data-v-
|
|
1402
|
+
.multiple-selector .tags-container.focused[data-v-95b69442] {
|
|
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-95b69442] {
|
|
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-95b69442] {
|
|
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-95b69442] {
|
|
1429
1417
|
display: inline-flex;
|
|
1430
1418
|
align-items: center;
|
|
1431
1419
|
max-width: 100%;
|
|
1432
1420
|
}
|
|
1433
|
-
.multiple-selector .search-input[data-v-
|
|
1434
|
-
outline: none;
|
|
1435
|
-
border: none;
|
|
1436
|
-
height: 28px;
|
|
1421
|
+
.multiple-selector .search-input[data-v-95b69442] {
|
|
1437
1422
|
min-width: 10px;
|
|
1423
|
+
height: 28px;
|
|
1438
1424
|
background: transparent;
|
|
1425
|
+
border: none;
|
|
1426
|
+
outline: none;
|
|
1439
1427
|
}
|
|
1440
|
-
.multiple-selector .search-input[data-v-
|
|
1428
|
+
.multiple-selector .search-input[data-v-95b69442]::placeholder {
|
|
1441
1429
|
color: #c4c6cc;
|
|
1442
1430
|
}
|
|
1443
|
-
.multiple-selector .search-input.inline[data-v-
|
|
1431
|
+
.multiple-selector .search-input.inline[data-v-95b69442] {
|
|
1444
1432
|
min-width: 10px;
|
|
1445
1433
|
}
|
|
1446
|
-
.multiple-selector .search-input.last[data-v-
|
|
1434
|
+
.multiple-selector .search-input.last[data-v-95b69442], .multiple-selector .search-input.collapsed[data-v-95b69442] {
|
|
1447
1435
|
flex: 1;
|
|
1448
1436
|
min-width: 60px;
|
|
1449
|
-
}.single-selector[data-v-
|
|
1437
|
+
}.single-selector[data-v-4fec9d7c] {
|
|
1450
1438
|
position: relative;
|
|
1451
1439
|
width: 100%;
|
|
1452
1440
|
}
|
|
1453
|
-
.input-container[data-v-
|
|
1441
|
+
.input-container[data-v-4fec9d7c] {
|
|
1454
1442
|
position: relative;
|
|
1455
1443
|
display: flex;
|
|
1456
1444
|
align-items: center;
|
|
1457
1445
|
min-height: 32px;
|
|
1458
|
-
border: 1px solid #dcdee5;
|
|
1459
|
-
border-radius: 2px;
|
|
1460
1446
|
padding: 0 8px;
|
|
1461
1447
|
background-color: #fff;
|
|
1448
|
+
border: 1px solid #c4c6cc;
|
|
1449
|
+
border-radius: 2px;
|
|
1462
1450
|
}
|
|
1463
|
-
.input-container[data-v-
|
|
1451
|
+
.input-container[data-v-4fec9d7c]: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-4fec9d7c] {
|
|
1468
1456
|
flex: 1;
|
|
1469
|
-
outline: none;
|
|
1470
|
-
border: none;
|
|
1471
1457
|
height: 30px;
|
|
1472
1458
|
background: transparent;
|
|
1459
|
+
border: none;
|
|
1460
|
+
outline: none;
|
|
1473
1461
|
}
|
|
1474
|
-
.search-input[data-v-
|
|
1462
|
+
.search-input[data-v-4fec9d7c]::placeholder {
|
|
1475
1463
|
color: #c4c6cc;
|
|
1476
|
-
}.bk-user-selector[data-v-
|
|
1477
|
-
width: 100%;
|
|
1464
|
+
}.bk-user-selector[data-v-78f5783f] {
|
|
1478
1465
|
position: relative;
|
|
1466
|
+
width: 100%;
|
|
1479
1467
|
font-size: 12px;
|
|
1480
1468
|
}
|
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");
|
|
@@ -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,7 +3204,7 @@ 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,
|
|
@@ -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-487799ec"]]);
|
|
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;
|
|
@@ -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-95b69442"]]);
|
|
3816
3824
|
const _hoisted_1$1 = { class: "input-container" };
|
|
3817
3825
|
const _hoisted_2 = ["placeholder"];
|
|
3818
3826
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -3855,9 +3863,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3855
3863
|
type: "userGroup"
|
|
3856
3864
|
}));
|
|
3857
3865
|
const list = [...options.value, ...userGroup];
|
|
3858
|
-
|
|
3859
|
-
emit("change", selectedUserInfo2 || null);
|
|
3860
|
-
return selectedUserInfo2;
|
|
3866
|
+
return list.find((user) => user.id === selectedUser.value);
|
|
3861
3867
|
});
|
|
3862
3868
|
onBeforeMount(async () => {
|
|
3863
3869
|
if (typeof props.modelValue === "string" && props.modelValue) {
|
|
@@ -3932,9 +3938,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3932
3938
|
const handleClickOutside = () => {
|
|
3933
3939
|
showDropdown.value = false;
|
|
3934
3940
|
};
|
|
3935
|
-
watch(
|
|
3936
|
-
emit("
|
|
3937
|
-
});
|
|
3941
|
+
watch(selectedUserInfo, (newVal) => {
|
|
3942
|
+
emit("change", newVal || null);
|
|
3943
|
+
}, { immediate: true });
|
|
3938
3944
|
return (_ctx, _cache) => {
|
|
3939
3945
|
return withDirectives((openBlock(), createElementBlock("div", {
|
|
3940
3946
|
ref_key: "containerRef",
|
|
@@ -3949,11 +3955,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3949
3955
|
onClick: withModifiers(removeSelectedUser, ["stop"])
|
|
3950
3956
|
}, [
|
|
3951
3957
|
createVNode(UserTag, {
|
|
3958
|
+
"current-tenant-id": _ctx.tenantId,
|
|
3952
3959
|
"render-tag": _ctx.renderTag,
|
|
3953
3960
|
tenants: _ctx.tenants,
|
|
3954
3961
|
user: selectedUserInfo.value,
|
|
3955
3962
|
onClose: removeSelectedUser
|
|
3956
|
-
}, null, 8, ["render-tag", "tenants", "user"])
|
|
3963
|
+
}, null, 8, ["current-tenant-id", "render-tag", "tenants", "user"])
|
|
3957
3964
|
])) : createCommentVNode("v-if", true),
|
|
3958
3965
|
withDirectives(createElementVNode("input", {
|
|
3959
3966
|
ref_key: "inputRef",
|
|
@@ -3994,7 +4001,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3994
4001
|
};
|
|
3995
4002
|
}
|
|
3996
4003
|
});
|
|
3997
|
-
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
4004
|
+
const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-4fec9d7c"]]);
|
|
3998
4005
|
const _hoisted_1 = {
|
|
3999
4006
|
ref: "containerRef",
|
|
4000
4007
|
class: "bk-user-selector"
|
|
@@ -4067,13 +4074,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4067
4074
|
watch(selectedUser, (newVal) => {
|
|
4068
4075
|
if (!props.multiple) {
|
|
4069
4076
|
emit("update:modelValue", newVal);
|
|
4077
|
+
emit("change", newVal);
|
|
4070
4078
|
}
|
|
4071
|
-
});
|
|
4079
|
+
}, { immediate: true });
|
|
4072
4080
|
watch(
|
|
4073
4081
|
() => props.userGroup,
|
|
4074
4082
|
() => {
|
|
4075
4083
|
initSelectedUsers();
|
|
4076
|
-
}
|
|
4084
|
+
},
|
|
4085
|
+
{ immediate: true }
|
|
4077
4086
|
);
|
|
4078
4087
|
onBeforeMount(() => {
|
|
4079
4088
|
initSelectedUsers();
|
|
@@ -4134,7 +4143,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4134
4143
|
};
|
|
4135
4144
|
}
|
|
4136
4145
|
});
|
|
4137
|
-
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4146
|
+
const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-78f5783f"]]);
|
|
4138
4147
|
export {
|
|
4139
4148
|
BkUserSelector,
|
|
4140
4149
|
BkUserSelector as default
|