@w-run/wdesign-ui 0.0.0-stage → 1.1.0
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 +255 -2
- package/dist/index.d.ts +1013 -0
- package/dist/parts/WdAffix.js +159 -0
- package/dist/parts/WdAiMessage.js +277 -0
- package/dist/parts/WdAlert.js +92 -0
- package/dist/parts/WdAnchor.js +159 -0
- package/dist/parts/WdAudioPlayer.js +1024 -0
- package/dist/parts/WdAvatar.js +6 -0
- package/dist/parts/WdAvatarGroup.js +46 -0
- package/dist/parts/WdBacktop.js +120 -0
- package/dist/parts/WdBadge.js +61 -0
- package/dist/parts/WdBento.js +40 -0
- package/dist/parts/WdBentoItem.js +43 -0
- package/dist/parts/WdBottomSheet.js +263 -0
- package/dist/parts/WdBreadcrumb.js +64 -0
- package/dist/parts/WdButton.js +94 -0
- package/dist/parts/WdCalendar.js +11 -0
- package/dist/parts/WdCard.js +113 -0
- package/dist/parts/WdCarousel.js +365 -0
- package/dist/parts/WdCascader.js +386 -0
- package/dist/parts/WdCheckbox.js +81 -0
- package/dist/parts/WdCollapse.js +135 -0
- package/dist/parts/WdColorPicker.js +592 -0
- package/dist/parts/WdCommand.js +357 -0
- package/dist/parts/WdContainer.js +37 -0
- package/dist/parts/WdCountdown.js +163 -0
- package/dist/parts/WdDanmaku.js +6 -0
- package/dist/parts/WdDatePicker.js +169 -0
- package/dist/parts/WdDateTimePicker.js +162 -0
- package/dist/parts/WdDescriptions.js +146 -0
- package/dist/parts/WdDivider.js +64 -0
- package/dist/parts/WdDrawer.js +176 -0
- package/dist/parts/WdDropdown.js +140 -0
- package/dist/parts/WdEmpty.js +79 -0
- package/dist/parts/WdExplorer.js +336 -0
- package/dist/parts/WdFileList.js +177 -0
- package/dist/parts/WdForm.js +111 -0
- package/dist/parts/WdFormItem.js +156 -0
- package/dist/parts/WdGrid.js +40 -0
- package/dist/parts/WdGroup.js +68 -0
- package/dist/parts/WdImagePreview.js +274 -0
- package/dist/parts/WdInput.js +10 -0
- package/dist/parts/WdInputNumber.js +253 -0
- package/dist/parts/WdListItem.js +60 -0
- package/dist/parts/WdLoading.js +128 -0
- package/dist/parts/WdMarkdown.js +172 -0
- package/dist/parts/WdMarquee.js +80 -0
- package/dist/parts/WdMasonry.js +40 -0
- package/dist/parts/WdMediaCard.js +302 -0
- package/dist/parts/WdMentions.js +277 -0
- package/dist/parts/WdModal.js +149 -0
- package/dist/parts/WdNav.js +311 -0
- package/dist/parts/WdNotification.js +112 -0
- package/dist/parts/WdOtp.js +107 -0
- package/dist/parts/WdPagination.js +252 -0
- package/dist/parts/WdPopconfirm.js +214 -0
- package/dist/parts/WdPopover.js +203 -0
- package/dist/parts/WdPostItem.js +84 -0
- package/dist/parts/WdProgress.js +48 -0
- package/dist/parts/WdProgressRing.js +101 -0
- package/dist/parts/WdPullRefresh.js +167 -0
- package/dist/parts/WdQRCode.js +1909 -0
- package/dist/parts/WdRadioGroup.js +95 -0
- package/dist/parts/WdRate.js +128 -0
- package/dist/parts/WdResult.js +86 -0
- package/dist/parts/WdScrollbar.js +186 -0
- package/dist/parts/WdSegmented.js +11 -0
- package/dist/parts/WdSelect.js +465 -0
- package/dist/parts/WdSkeleton.js +69 -0
- package/dist/parts/WdSlider.js +100 -0
- package/dist/parts/WdSortableList.js +291 -0
- package/dist/parts/WdSpace.js +46 -0
- package/dist/parts/WdSparkline.js +148 -0
- package/dist/parts/WdSpinner.js +6 -0
- package/dist/parts/WdSplitter.js +183 -0
- package/dist/parts/WdStatBar.js +202 -0
- package/dist/parts/WdStatistic.js +131 -0
- package/dist/parts/WdSteps.js +110 -0
- package/dist/parts/WdSwitch.js +63 -0
- package/dist/parts/WdTabBar.js +84 -0
- package/dist/parts/WdTable.js +589 -0
- package/dist/parts/WdTabs.js +219 -0
- package/dist/parts/WdTag.js +6 -0
- package/dist/parts/WdTagInput.js +181 -0
- package/dist/parts/WdTimePicker.js +12 -0
- package/dist/parts/WdTimeline.js +145 -0
- package/dist/parts/WdTooltip.js +108 -0
- package/dist/parts/WdTour.js +264 -0
- package/dist/parts/WdTransfer.js +446 -0
- package/dist/parts/WdTree.js +322 -0
- package/dist/parts/WdUpload.js +309 -0
- package/dist/parts/WdVideoPlayer.js +1006 -0
- package/dist/parts/WdVirtualList.js +169 -0
- package/dist/parts/WdWatermark.js +150 -0
- package/dist/parts/chunk-3LVE72ZK.js +361 -0
- package/dist/parts/chunk-5HYOQ52I.js +101 -0
- package/dist/parts/chunk-7M3MUL3B.js +275 -0
- package/dist/parts/chunk-AOTJ63HN.js +15 -0
- package/dist/parts/chunk-AXEF2U2A.js +41 -0
- package/dist/parts/chunk-CY3QOSFP.js +645 -0
- package/dist/parts/chunk-G7NN4A6J.js +40 -0
- package/dist/parts/chunk-HAKYCUAR.js +9 -0
- package/dist/parts/chunk-JDE4AHBR.js +160 -0
- package/dist/parts/chunk-LT3NTWIT.js +117 -0
- package/dist/parts/chunk-OGHYFT7B.js +387 -0
- package/dist/parts/chunk-Q34U2HES.js +261 -0
- package/dist/parts/chunk-RLSVPJHM.js +10 -0
- package/dist/parts/chunk-U2CDKD2T.js +30 -0
- package/dist/parts/chunk-UYUNYHZD.js +40 -0
- package/dist/parts/chunk-VUJL2HGD.js +23 -0
- package/dist/parts/chunk-WCFG5KNT.js +51 -0
- package/dist/parts/chunk-WDDAALPI.js +42 -0
- package/dist/parts/chunk-WFXLDBP2.js +149 -0
- package/dist/style/affix.css +566 -0
- package/dist/style/ai-msg.css +746 -0
- package/dist/style/alert.css +636 -0
- package/dist/style/anchor.css +630 -0
- package/dist/style/audio.css +1954 -0
- package/dist/style/avatar.css +651 -0
- package/dist/style/backtop.css +625 -0
- package/dist/style/badge.css +632 -0
- package/dist/style/bento.css +763 -0
- package/dist/style/bottom-sheet.css +776 -0
- package/dist/style/breadcrumb.css +629 -0
- package/dist/style/button.css +829 -0
- package/dist/style/calendar.css +1512 -0
- package/dist/style/card.css +748 -0
- package/dist/style/carousel.css +670 -0
- package/dist/style/cascader.css +862 -0
- package/dist/style/checkbox.css +706 -0
- package/dist/style/chevron.css +575 -0
- package/dist/style/collapse.css +648 -0
- package/dist/style/colorpicker.css +876 -0
- package/dist/style/command.css +760 -0
- package/dist/style/container.css +550 -0
- package/dist/style/countdown.css +722 -0
- package/dist/style/danmaku.css +644 -0
- package/dist/style/datepicker.css +683 -0
- package/dist/style/datetime-picker.css +714 -0
- package/dist/style/descriptions.css +712 -0
- package/dist/style/divider.css +604 -0
- package/dist/style/dot.css +585 -0
- package/dist/style/drawer.css +743 -0
- package/dist/style/dropdown.css +645 -0
- package/dist/style/empty.css +657 -0
- package/dist/style/explorer.css +944 -0
- package/dist/style/file-list.css +664 -0
- package/dist/style/flip.css +600 -0
- package/dist/style/form.css +638 -0
- package/dist/style/grid.css +618 -0
- package/dist/style/group.css +1022 -0
- package/dist/style/icon-btn.css +641 -0
- package/dist/style/image-preview.css +725 -0
- package/dist/style/input-number.css +680 -0
- package/dist/style/input.css +682 -0
- package/dist/style/list.css +630 -0
- package/dist/style/loading.css +667 -0
- package/dist/style/markdown.css +884 -0
- package/dist/style/marquee.css +678 -0
- package/dist/style/masonry.css +614 -0
- package/dist/style/media-card.css +1229 -0
- package/dist/style/mentions.css +690 -0
- package/dist/style/modal.css +775 -0
- package/dist/style/nav.css +1046 -0
- package/dist/style/notification.css +601 -0
- package/dist/style/otp.css +699 -0
- package/dist/style/pagination.css +680 -0
- package/dist/style/popconfirm.css +645 -0
- package/dist/style/popover.css +740 -0
- package/dist/style/post-item.css +676 -0
- package/dist/style/progress-ring.css +640 -0
- package/dist/style/progress.css +576 -0
- package/dist/style/pull-refresh.css +637 -0
- package/dist/style/qrcode.css +613 -0
- package/dist/style/radio.css +705 -0
- package/dist/style/rate.css +637 -0
- package/dist/style/result.css +597 -0
- package/dist/style/scroll-reveal.css +613 -0
- package/dist/style/scrollbar.css +644 -0
- package/dist/style/segmented-picker.css +679 -0
- package/dist/style/segmented.css +894 -0
- package/dist/style/select.css +937 -0
- package/dist/style/skeleton.css +590 -0
- package/dist/style/slider.css +642 -0
- package/dist/style/sortable.css +714 -0
- package/dist/style/space.css +568 -0
- package/dist/style/sparkline.css +606 -0
- package/dist/style/spinner.css +586 -0
- package/dist/style/splitter.css +711 -0
- package/dist/style/stat-bar.css +767 -0
- package/dist/style/statistic.css +589 -0
- package/dist/style/steps.css +724 -0
- package/dist/style/switch.css +676 -0
- package/dist/style/tab-bar.css +647 -0
- package/dist/style/table.css +1229 -0
- package/dist/style/tabs.css +756 -0
- package/dist/style/tag-input.css +710 -0
- package/dist/style/tag.css +682 -0
- package/dist/style/time-picker.css +749 -0
- package/dist/style/timeline.css +1082 -0
- package/dist/style/toast.css +598 -0
- package/dist/style/tooltip.css +604 -0
- package/dist/style/tour.css +683 -0
- package/dist/style/transfer.css +858 -0
- package/dist/style/tree.css +786 -0
- package/dist/style/typography.css +947 -0
- package/dist/style/upload.css +758 -0
- package/dist/style/vlist.css +591 -0
- package/dist/style/vplayer.css +1588 -0
- package/dist/style/watermark.css +570 -0
- package/dist/wdesign-ui.css +21093 -0
- package/dist/wdesign-ui.esm.js +20265 -0
- package/package.json +134 -4
- package/tokens.json +385 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// .lib-build/WdMasonry.ts
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
var WdMasonry_default = /* @__PURE__ */ _defineComponent({
|
|
6
|
+
...{ name: "WdMasonry" },
|
|
7
|
+
__name: "WdMasonry",
|
|
8
|
+
props: {
|
|
9
|
+
columns: { type: [Number, String], required: false, default: "auto" },
|
|
10
|
+
gap: { type: String, required: false, default: "md" },
|
|
11
|
+
minColumn: { type: Number, required: false, default: 240 }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const isAuto = computed(() => props.columns === "auto");
|
|
16
|
+
const gapValue = computed(() => ({ sm: 8, md: 16, lg: 24 })[props.gap] || 16);
|
|
17
|
+
const styleVars = computed(() => ({
|
|
18
|
+
"--wd-masonry-count": isAuto.value ? "auto" : String(props.columns),
|
|
19
|
+
"--wd-masonry-min": `${props.minColumn}px`,
|
|
20
|
+
"--wd-masonry-gap": `${gapValue.value}px`
|
|
21
|
+
}));
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return _openBlock(), _createElementBlock(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
class: _normalizeClass(["wd-masonry", { "wd-masonry--auto": isAuto.value }]),
|
|
27
|
+
style: _normalizeStyle(styleVars.value)
|
|
28
|
+
},
|
|
29
|
+
[
|
|
30
|
+
_renderSlot(_ctx.$slots, "default")
|
|
31
|
+
],
|
|
32
|
+
6
|
|
33
|
+
/* CLASS, STYLE */
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
WdMasonry_default as WdMasonry
|
|
40
|
+
};
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WdIcon_default
|
|
3
|
+
} from "./chunk-Q34U2HES.js";
|
|
4
|
+
|
|
5
|
+
// .lib-build/WdMediaCard.ts
|
|
6
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
7
|
+
import { createCommentVNode as _createCommentVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, createVNode as _createVNode, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, renderList as _renderList, Fragment as _Fragment } from "vue";
|
|
8
|
+
import { computed, ref, useSlots, watch } from "vue";
|
|
9
|
+
var _hoisted_1 = ["src", "alt"];
|
|
10
|
+
var _hoisted_2 = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "wd-media-card__scrim",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
};
|
|
15
|
+
var _hoisted_3 = ["aria-label"];
|
|
16
|
+
var _hoisted_4 = {
|
|
17
|
+
key: 3,
|
|
18
|
+
class: "wd-media-card__top"
|
|
19
|
+
};
|
|
20
|
+
var _hoisted_5 = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "wd-media-card__badge"
|
|
23
|
+
};
|
|
24
|
+
var _hoisted_6 = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "wd-media-card__tools"
|
|
27
|
+
};
|
|
28
|
+
var _hoisted_7 = {
|
|
29
|
+
key: 4,
|
|
30
|
+
class: "wd-media-card__duration"
|
|
31
|
+
};
|
|
32
|
+
var _hoisted_8 = {
|
|
33
|
+
key: 1,
|
|
34
|
+
class: "wd-media-card__body"
|
|
35
|
+
};
|
|
36
|
+
var _hoisted_9 = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "wd-media-card__title"
|
|
39
|
+
};
|
|
40
|
+
var _hoisted_10 = {
|
|
41
|
+
key: 1,
|
|
42
|
+
class: "wd-media-card__subtitle"
|
|
43
|
+
};
|
|
44
|
+
var _hoisted_11 = {
|
|
45
|
+
key: 1,
|
|
46
|
+
class: "wd-media-card__stats"
|
|
47
|
+
};
|
|
48
|
+
var _hoisted_12 = { class: "wd-media-card__stat-value" };
|
|
49
|
+
var _hoisted_13 = { class: "wd-media-card__stat-label" };
|
|
50
|
+
var _hoisted_14 = { class: "wd-media-card__expand-inner" };
|
|
51
|
+
var _hoisted_15 = {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: "wd-media-card__text"
|
|
54
|
+
};
|
|
55
|
+
var _hoisted_16 = {
|
|
56
|
+
key: 4,
|
|
57
|
+
class: "wd-media-card__foot"
|
|
58
|
+
};
|
|
59
|
+
var _hoisted_17 = ["aria-expanded", "aria-label"];
|
|
60
|
+
var WdMediaCard_default = /* @__PURE__ */ _defineComponent({
|
|
61
|
+
...{ name: "WdMediaCard" },
|
|
62
|
+
__name: "WdMediaCard",
|
|
63
|
+
props: {
|
|
64
|
+
src: { type: String, required: false, default: "" },
|
|
65
|
+
alt: { type: String, required: false, default: "" },
|
|
66
|
+
title: { type: String, required: false, default: "" },
|
|
67
|
+
subtitle: { type: String, required: false, default: "" },
|
|
68
|
+
badge: { type: String, required: false, default: "" },
|
|
69
|
+
duration: { type: String, required: false },
|
|
70
|
+
stats: { type: Array, required: false, default: () => [] },
|
|
71
|
+
body: { type: String, required: false, default: "" },
|
|
72
|
+
action: { type: String, required: false, default: "" },
|
|
73
|
+
layout: { type: String, required: false, default: "overlay" },
|
|
74
|
+
mediaMode: { type: String, required: false, default: "cover" },
|
|
75
|
+
collapsible: { type: Boolean, required: false, default: false },
|
|
76
|
+
defaultOpen: { type: Boolean, required: false, default: true },
|
|
77
|
+
ratio: { type: String, required: false, default: "4 / 3" },
|
|
78
|
+
radius: { type: String, required: false, default: "xl" }
|
|
79
|
+
},
|
|
80
|
+
emits: ["action", "update:open"],
|
|
81
|
+
setup(__props, { emit: __emit }) {
|
|
82
|
+
const props = __props;
|
|
83
|
+
const slots = useSlots();
|
|
84
|
+
const emit = __emit;
|
|
85
|
+
const open = ref(props.defaultOpen);
|
|
86
|
+
const imgFailed = ref(false);
|
|
87
|
+
watch(
|
|
88
|
+
() => props.src,
|
|
89
|
+
() => {
|
|
90
|
+
imgFailed.value = false;
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
function toggle() {
|
|
94
|
+
open.value = !open.value;
|
|
95
|
+
emit("update:open", open.value);
|
|
96
|
+
}
|
|
97
|
+
const isOverlay = computed(() => props.layout === "overlay");
|
|
98
|
+
const canCollapse = computed(() => props.collapsible && (!!props.body || !!slots.default));
|
|
99
|
+
const hasTextOnMedia = computed(() => isOverlay.value && !!(props.title || props.subtitle || props.badge));
|
|
100
|
+
return (_ctx, _cache) => {
|
|
101
|
+
return _openBlock(), _createElementBlock(
|
|
102
|
+
"article",
|
|
103
|
+
{
|
|
104
|
+
class: _normalizeClass(["wd-media-card", [
|
|
105
|
+
`wd-media-card--${__props.layout}`,
|
|
106
|
+
`wd-media-card--media-${__props.mediaMode}`,
|
|
107
|
+
`wd-media-card--r-${__props.radius}`,
|
|
108
|
+
{
|
|
109
|
+
"is-open": open.value,
|
|
110
|
+
"is-collapsible": __props.collapsible,
|
|
111
|
+
"has-media": !!__props.src,
|
|
112
|
+
"is-img-failed": imgFailed.value
|
|
113
|
+
}
|
|
114
|
+
]])
|
|
115
|
+
},
|
|
116
|
+
[
|
|
117
|
+
_createCommentVNode(" ===== \u5A92\u4F53\u5C42 ===== "),
|
|
118
|
+
__props.src ? (_openBlock(), _createElementBlock(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
key: 0,
|
|
122
|
+
class: _normalizeClass(["wd-media-card__media", { "has-text": hasTextOnMedia.value && !imgFailed.value }]),
|
|
123
|
+
style: _normalizeStyle({ aspectRatio: __props.ratio })
|
|
124
|
+
},
|
|
125
|
+
[
|
|
126
|
+
!imgFailed.value ? (_openBlock(), _createElementBlock("img", {
|
|
127
|
+
key: 0,
|
|
128
|
+
src: __props.src,
|
|
129
|
+
alt: __props.alt || __props.title,
|
|
130
|
+
class: "wd-media-card__img",
|
|
131
|
+
loading: "lazy",
|
|
132
|
+
onError: _cache[0] || (_cache[0] = ($event) => imgFailed.value = true)
|
|
133
|
+
}, null, 40, _hoisted_1)) : _createCommentVNode("v-if", true),
|
|
134
|
+
_createCommentVNode("\n \u6E10\u53D8\u538B\u6697\uFF1A\u4FDD\u8BC1\u538B\u5728\u56FE\u4E0A\u7684\u6587\u5B57\u53EF\u8BFB\u3002\n **\u56FE\u6302\u4E86\u5C31\u4E0D\u8981\u8FD9\u5C42** \u2014\u2014 \u6CA1\u6709\u56FE\u53EF\u538B\uFF0C\u5B83\u53EA\u4F1A\u628A\u300C\u56FE\u6CA1\u4E86\u300D\u4F2A\u88C5\u6210\u300C\u8BBE\u8BA1\u597D\u7684\u7070\u5E95\u300D\u3002\n "),
|
|
135
|
+
!imgFailed.value ? (_openBlock(), _createElementBlock("div", _hoisted_2)) : _createCommentVNode("v-if", true),
|
|
136
|
+
_createCommentVNode(" \u56FE\u6302\u4E86\uFF1A\u7ED9\u4E00\u53E5\u660E\u786E\u7684\u8BDD\uFF0C\u522B\u8BA9\u7528\u6237\u4EE5\u4E3A\u672C\u6765\u5C31\u8FD9\u6837 "),
|
|
137
|
+
imgFailed.value ? (_openBlock(), _createElementBlock("div", {
|
|
138
|
+
key: 2,
|
|
139
|
+
class: "wd-media-card__fallen",
|
|
140
|
+
role: "img",
|
|
141
|
+
"aria-label": `${__props.alt || __props.title || "\u56FE\u7247"}\u52A0\u8F7D\u5931\u8D25`
|
|
142
|
+
}, [
|
|
143
|
+
_createVNode(_unref(WdIcon_default), {
|
|
144
|
+
name: "image",
|
|
145
|
+
size: 26
|
|
146
|
+
}),
|
|
147
|
+
_cache[2] || (_cache[2] = _createElementVNode(
|
|
148
|
+
"span",
|
|
149
|
+
null,
|
|
150
|
+
"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25",
|
|
151
|
+
-1
|
|
152
|
+
/* CACHED */
|
|
153
|
+
))
|
|
154
|
+
], 8, _hoisted_3)) : _createCommentVNode("v-if", true),
|
|
155
|
+
_createCommentVNode(" \u9876\u90E8\u89D2\u6807\u4E0E\u63D2\u69FD\uFF08\u6536\u85CF / \u5B9A\u4F4D\u7B49\u64CD\u4F5C\uFF09 "),
|
|
156
|
+
_createCommentVNode("\n \u26A0\uFE0F \u6BCF\u4E2A\u53EF\u9009\u533A\u5757\u90FD\u8981\u8FDE**\u5BB9\u5668\u4E00\u8D77** v-if\uFF0C\n \u4E0D\u80FD\u53EA\u5224\u65AD\u5185\u90E8\u6587\u672C \u2014\u2014 \u7A7A div \u4ECD\u4F1A\u5403\u6389 padding \u4E0E flex \u95F4\u8DDD\u3002\n "),
|
|
157
|
+
__props.badge || _ctx.$slots.tools ? (_openBlock(), _createElementBlock("div", _hoisted_4, [
|
|
158
|
+
__props.badge ? (_openBlock(), _createElementBlock(
|
|
159
|
+
"span",
|
|
160
|
+
_hoisted_5,
|
|
161
|
+
_toDisplayString(__props.badge),
|
|
162
|
+
1
|
|
163
|
+
/* TEXT */
|
|
164
|
+
)) : _createCommentVNode("v-if", true),
|
|
165
|
+
_ctx.$slots.tools ? (_openBlock(), _createElementBlock("div", _hoisted_6, [
|
|
166
|
+
_renderSlot(_ctx.$slots, "tools")
|
|
167
|
+
])) : _createCommentVNode("v-if", true)
|
|
168
|
+
])) : _createCommentVNode("v-if", true),
|
|
169
|
+
_createCommentVNode(" \u53F3\u4E0B\u89D2\u65F6\u957F\uFF1A\u538B\u5728\u56FE\u4E0A\uFF0C\u7528\u6BDB\u73BB\u7483\u5C0F\u80F6\u56CA\uFF08\u89C6\u9891\u7AD9\u901A\u884C\u505A\u6CD5\uFF09 "),
|
|
170
|
+
__props.duration ? (_openBlock(), _createElementBlock(
|
|
171
|
+
"span",
|
|
172
|
+
_hoisted_7,
|
|
173
|
+
_toDisplayString(__props.duration),
|
|
174
|
+
1
|
|
175
|
+
/* TEXT */
|
|
176
|
+
)) : _createCommentVNode("v-if", true),
|
|
177
|
+
_createCommentVNode("\n \u26A0\uFE0F overlay \u7684\u6807\u9898**\u4E0D\u5728\u8FD9\u91CC** \u2014\u2014 \u5B83\u7531 body \u7EDF\u4E00\u6E32\u67D3\u3002\n \u5426\u5219\u4F1A\u51FA\u73B0\u4E24\u4EFD\u6807\u9898\uFF08\u5A92\u4F53\u5C42\u91CC\u7684 + body \u91CC\u7684\uFF09\u3002\n \u5A92\u4F53\u5C42\u53EA\u8D1F\u8D23\u56FE\u7247\u3001scrim\u3001\u89D2\u6807\u548C\u5DE5\u5177\u6309\u94AE\u3002\n ")
|
|
178
|
+
],
|
|
179
|
+
6
|
|
180
|
+
/* CLASS, STYLE */
|
|
181
|
+
)) : _createCommentVNode("v-if", true),
|
|
182
|
+
_createCommentVNode("\n \u5185\u5BB9\u5C42\uFF1A\u53EA\u6709\u5728**\u786E\u5B9E\u6709\u5185\u5BB9**\u65F6\u624D\u6E32\u67D3\u3002\n \u9010\u4E00\u5217\u51FA\u6240\u6709\u53EF\u80FD\u7684\u5185\u5BB9\u6765\u6E90\uFF0C\u4EFB\u4E00\u5B58\u5728\u5C31\u6E32\u67D3\uFF1A\n \xB7 \u6807\u9898/\u526F\u6807\u9898\uFF08\u4EC5 stacked\uFF0Coverlay \u7684\u6807\u9898\u5728\u5A92\u4F53\u5C42\u91CC\uFF09\n \xB7 headline-extra \u63D2\u69FD\n \xB7 \u6570\u636E\u6761\n \xB7 \u6B63\u6587 / \u9ED8\u8BA4\u63D2\u69FD\n \xB7 CTA \u6309\u94AE\n \xB7 \u6298\u53E0\u7BAD\u5934\n \u26A0\uFE0F \u4E0D\u80FD\u5199\u6210 `!isOverlay || ...` \u2014\u2014\n stacked \u4E14\u6240\u6709\u5185\u5BB9\u90FD\u4E3A\u7A7A\u65F6\uFF0C\u90A3\u4E2A `!isOverlay` \u4F1A\u8BA9\u7A7A\u5BB9\u5668\u7167\u6837\u6E32\u67D3\u3002\n "),
|
|
183
|
+
__props.title || __props.subtitle || _ctx.$slots["headline-extra"] || __props.stats.length || __props.body || _ctx.$slots.default || __props.action || __props.collapsible ? (_openBlock(), _createElementBlock("div", _hoisted_8, [
|
|
184
|
+
_createCommentVNode(" \u6807\u9898\uFF1Aoverlay \u548C stacked \u90FD\u5728\u8FD9\u91CC\u6E32\u67D3\uFF08\u4F4D\u7F6E\u7531 CSS \u51B3\u5B9A\uFF09 "),
|
|
185
|
+
__props.title || __props.subtitle || _ctx.$slots["headline-extra"] ? (_openBlock(), _createElementBlock(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
key: 0,
|
|
189
|
+
class: _normalizeClass(["wd-media-card__headline wd-media-card__headline--static", { "wd-media-card__headline--overlay": isOverlay.value }])
|
|
190
|
+
},
|
|
191
|
+
[
|
|
192
|
+
__props.title ? (_openBlock(), _createElementBlock(
|
|
193
|
+
"h3",
|
|
194
|
+
_hoisted_9,
|
|
195
|
+
_toDisplayString(__props.title),
|
|
196
|
+
1
|
|
197
|
+
/* TEXT */
|
|
198
|
+
)) : _createCommentVNode("v-if", true),
|
|
199
|
+
__props.subtitle ? (_openBlock(), _createElementBlock(
|
|
200
|
+
"p",
|
|
201
|
+
_hoisted_10,
|
|
202
|
+
_toDisplayString(__props.subtitle),
|
|
203
|
+
1
|
|
204
|
+
/* TEXT */
|
|
205
|
+
)) : _createCommentVNode("v-if", true),
|
|
206
|
+
_renderSlot(_ctx.$slots, "headline-extra")
|
|
207
|
+
],
|
|
208
|
+
2
|
|
209
|
+
/* CLASS */
|
|
210
|
+
)) : _createCommentVNode("v-if", true),
|
|
211
|
+
_createCommentVNode(" \u6570\u636E\u6761\uFF1A\u9876\u90E8\u7EC6\u5206\u9694\u7EBF + \u7B49\u5206 "),
|
|
212
|
+
__props.stats.length ? (_openBlock(), _createElementBlock("dl", _hoisted_11, [
|
|
213
|
+
(_openBlock(true), _createElementBlock(
|
|
214
|
+
_Fragment,
|
|
215
|
+
null,
|
|
216
|
+
_renderList(__props.stats, (s, i) => {
|
|
217
|
+
return _openBlock(), _createElementBlock("div", {
|
|
218
|
+
key: i,
|
|
219
|
+
class: "wd-media-card__stat"
|
|
220
|
+
}, [
|
|
221
|
+
_createElementVNode(
|
|
222
|
+
"dt",
|
|
223
|
+
_hoisted_12,
|
|
224
|
+
_toDisplayString(s.value),
|
|
225
|
+
1
|
|
226
|
+
/* TEXT */
|
|
227
|
+
),
|
|
228
|
+
_createElementVNode(
|
|
229
|
+
"dd",
|
|
230
|
+
_hoisted_13,
|
|
231
|
+
_toDisplayString(s.label),
|
|
232
|
+
1
|
|
233
|
+
/* TEXT */
|
|
234
|
+
)
|
|
235
|
+
]);
|
|
236
|
+
}),
|
|
237
|
+
128
|
|
238
|
+
/* KEYED_FRAGMENT */
|
|
239
|
+
))
|
|
240
|
+
])) : _createCommentVNode("v-if", true),
|
|
241
|
+
_createCommentVNode('\n \u53EF\u5C55\u5F00\u533A\u57DF\uFF1A\u6B63\u6587 + \u63D2\u69FD\u3002\n \u6298\u53E0\u52A8\u753B\u6CBF\u7528 WdCollapse \u7684 `grid-template-rows: 0fr \u2192 1fr` \u2014\u2014\n \u8FD9\u662F\u76EE\u524D\u552F\u4E00**\u4E0D\u4F9D\u8D56\u56FA\u5B9A\u9AD8\u5EA6**\u7684\u7EAF CSS \u6298\u53E0\u65B9\u6848\uFF1A\n \xB7 max-height \u9700\u8981\u731C\u4E00\u4E2A\u8DB3\u591F\u5927\u7684\u503C\uFF0C\u77ED\u5185\u5BB9\u4F1A"\u8DF3"\n \xB7 height \u9700\u8981 JS \u6D4B\u91CF\n 0fr/1fr \u7531\u5185\u5BB9\u81EA\u7136\u6491\u5F00\uFF0C\u4EFB\u610F\u957F\u5EA6\u7684\u6B63\u6587\u90FD\u5E73\u6ED1\u3002\n '),
|
|
242
|
+
__props.body || _ctx.$slots.default ? (_openBlock(), _createElementBlock(
|
|
243
|
+
"div",
|
|
244
|
+
{
|
|
245
|
+
key: 2,
|
|
246
|
+
class: _normalizeClass(["wd-media-card__expand", { "is-open": !__props.collapsible || open.value }])
|
|
247
|
+
},
|
|
248
|
+
[
|
|
249
|
+
_createElementVNode("div", _hoisted_14, [
|
|
250
|
+
__props.body ? (_openBlock(), _createElementBlock(
|
|
251
|
+
"p",
|
|
252
|
+
_hoisted_15,
|
|
253
|
+
_toDisplayString(__props.body),
|
|
254
|
+
1
|
|
255
|
+
/* TEXT */
|
|
256
|
+
)) : _createCommentVNode("v-if", true),
|
|
257
|
+
_renderSlot(_ctx.$slots, "default")
|
|
258
|
+
])
|
|
259
|
+
],
|
|
260
|
+
2
|
|
261
|
+
/* CLASS */
|
|
262
|
+
)) : _createCommentVNode("v-if", true),
|
|
263
|
+
_createCommentVNode(" \u4E3B\u6309\u94AE\uFF1A\u5360\u6EE1\u6574\u884C "),
|
|
264
|
+
__props.action ? (_openBlock(), _createElementBlock(
|
|
265
|
+
"button",
|
|
266
|
+
{
|
|
267
|
+
key: 3,
|
|
268
|
+
type: "button",
|
|
269
|
+
class: "wd-media-card__cta",
|
|
270
|
+
onClick: _cache[1] || (_cache[1] = ($event) => emit("action"))
|
|
271
|
+
},
|
|
272
|
+
_toDisplayString(__props.action),
|
|
273
|
+
1
|
|
274
|
+
/* TEXT */
|
|
275
|
+
)) : _createCommentVNode("v-if", true),
|
|
276
|
+
_createCommentVNode('\n \u6298\u53E0\u7BAD\u5934\uFF1A**\u72EC\u7ACB\u6210\u884C\u3001\u5E95\u90E8\u5C45\u4E2D**\uFF08\u53C2\u8003\u56FE\u7684\u505A\u6CD5\uFF09\u3002\n \u26A0\uFE0F \u4E4B\u524D\u548C CTA \u5E76\u6392\u6324\u5728\u53F3\u4FA7 \u2014\u2014 \u90A3\u662F"\u5DE5\u5177\u680F"\u7684\u5E03\u5C40\uFF0C\n \u800C\u5C55\u5F00/\u6536\u8D77\u662F\u5361\u7247\u7684**\u5168\u5C40\u52A8\u4F5C**\uFF0C\u5E94\u8BE5\u72EC\u7ACB\u3001\u5C45\u4E2D\u3001\u6613\u70B9\u3002\n '),
|
|
277
|
+
_createCommentVNode("\n \u6298\u53E0\u7BAD\u5934\uFF1A\u53EA\u5728**\u771F\u7684\u6709\u5185\u5BB9\u53EF\u5C55\u5F00**\u65F6\u663E\u793A\u3002\n \u53EA\u6709\u6807\u9898/\u6570\u636E\u6761\u3001\u6CA1\u6709\u6B63\u6587\u7684\u5361\u7247\u4E0D\u8BE5\u6709\u7BAD\u5934 \u2014\u2014 \u70B9\u4E86\u4EC0\u4E48\u90FD\u4E0D\u4F1A\u53D1\u751F\u3002\n "),
|
|
278
|
+
canCollapse.value ? (_openBlock(), _createElementBlock("div", _hoisted_16, [
|
|
279
|
+
_createElementVNode("button", {
|
|
280
|
+
type: "button",
|
|
281
|
+
class: "wd-media-card__toggle",
|
|
282
|
+
"aria-expanded": open.value,
|
|
283
|
+
"aria-label": open.value ? "\u6536\u8D77" : "\u5C55\u5F00",
|
|
284
|
+
onClick: toggle
|
|
285
|
+
}, [
|
|
286
|
+
_createVNode(_unref(WdIcon_default), {
|
|
287
|
+
name: open.value ? "chevron-up" : "chevron-down",
|
|
288
|
+
size: 18
|
|
289
|
+
}, null, 8, ["name"])
|
|
290
|
+
], 8, _hoisted_17)
|
|
291
|
+
])) : _createCommentVNode("v-if", true)
|
|
292
|
+
])) : _createCommentVNode("v-if", true)
|
|
293
|
+
],
|
|
294
|
+
2
|
|
295
|
+
/* CLASS */
|
|
296
|
+
);
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
export {
|
|
301
|
+
WdMediaCard_default as WdMediaCard
|
|
302
|
+
};
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import {
|
|
2
|
+
uid
|
|
3
|
+
} from "./chunk-RLSVPJHM.js";
|
|
4
|
+
import {
|
|
5
|
+
useComposition
|
|
6
|
+
} from "./chunk-U2CDKD2T.js";
|
|
7
|
+
import {
|
|
8
|
+
useOverlayLayer
|
|
9
|
+
} from "./chunk-5HYOQ52I.js";
|
|
10
|
+
import {
|
|
11
|
+
useAnchoredPosition,
|
|
12
|
+
useDismiss
|
|
13
|
+
} from "./chunk-WFXLDBP2.js";
|
|
14
|
+
import {
|
|
15
|
+
useFormItemA11y
|
|
16
|
+
} from "./chunk-VUJL2HGD.js";
|
|
17
|
+
import "./chunk-UYUNYHZD.js";
|
|
18
|
+
|
|
19
|
+
// .lib-build/WdMentions.ts
|
|
20
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
21
|
+
import { unref as _unref, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport, createBlock as _createBlock, mergeProps as _mergeProps } from "vue";
|
|
22
|
+
import { computed, nextTick, ref, watch } from "vue";
|
|
23
|
+
var _hoisted_1 = ["aria-expanded", "aria-controls", "value", "rows", "placeholder", "disabled"];
|
|
24
|
+
var _hoisted_2 = ["id"];
|
|
25
|
+
var _hoisted_3 = ["aria-selected", "onClick", "onMouseenter"];
|
|
26
|
+
var _hoisted_4 = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "wd-mentions__avatar"
|
|
29
|
+
};
|
|
30
|
+
var _hoisted_5 = ["src", "alt"];
|
|
31
|
+
var _hoisted_6 = {
|
|
32
|
+
key: 1,
|
|
33
|
+
class: "wd-mentions__avatar wd-mentions__avatar--text"
|
|
34
|
+
};
|
|
35
|
+
var _hoisted_7 = { class: "wd-mentions__label" };
|
|
36
|
+
var _hoisted_8 = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "wd-mentions__desc"
|
|
39
|
+
};
|
|
40
|
+
var _hoisted_9 = {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: "wd-mentions__count"
|
|
43
|
+
};
|
|
44
|
+
var WdMentions_default = /* @__PURE__ */ _defineComponent({
|
|
45
|
+
...{ name: "WdMentions" },
|
|
46
|
+
__name: "WdMentions",
|
|
47
|
+
props: {
|
|
48
|
+
modelValue: { type: String, required: false, default: void 0 },
|
|
49
|
+
defaultValue: { type: String, required: false, default: "" },
|
|
50
|
+
users: { type: Array, required: false, default: () => [] },
|
|
51
|
+
placeholder: { type: String, required: false, default: "\u8F93\u5165 @ \u63D0\u53CA\u6210\u5458" },
|
|
52
|
+
rows: { type: Number, required: false, default: 3 },
|
|
53
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
54
|
+
trigger: { type: String, required: false, default: "@" },
|
|
55
|
+
maxOptions: { type: Number, required: false, default: 8 }
|
|
56
|
+
},
|
|
57
|
+
emits: ["update:modelValue", "change", "select"],
|
|
58
|
+
setup(__props, { emit: __emit }) {
|
|
59
|
+
const formA11y = useFormItemA11y();
|
|
60
|
+
const listboxId = uid("wd-mentions-listbox");
|
|
61
|
+
const props = __props;
|
|
62
|
+
const emit = __emit;
|
|
63
|
+
const inner = ref(props.defaultValue);
|
|
64
|
+
const isControlled = computed(() => props.modelValue !== void 0);
|
|
65
|
+
const text = computed(() => isControlled.value ? props.modelValue : inner.value);
|
|
66
|
+
const ta = ref(null);
|
|
67
|
+
const rootEl = ref(null);
|
|
68
|
+
const panelEl = ref(null);
|
|
69
|
+
const activeQuery = ref(null);
|
|
70
|
+
function detectMention(value) {
|
|
71
|
+
const el = ta.value;
|
|
72
|
+
if (!el) return;
|
|
73
|
+
const pos2 = el.selectionStart ?? 0;
|
|
74
|
+
const before = (value ?? text.value).slice(0, pos2);
|
|
75
|
+
const at = before.lastIndexOf(props.trigger);
|
|
76
|
+
if (at < 0) {
|
|
77
|
+
activeQuery.value = null;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const frag = before.slice(at + props.trigger.length);
|
|
81
|
+
if (/\s/.test(frag) || frag.length > 20) {
|
|
82
|
+
activeQuery.value = null;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
activeQuery.value = { start: at, query: frag };
|
|
86
|
+
}
|
|
87
|
+
const filtered = computed(() => {
|
|
88
|
+
const q = activeQuery.value?.query ?? "";
|
|
89
|
+
const list = props.users.filter((u) => !u.disabled);
|
|
90
|
+
if (!q) return list.slice(0, props.maxOptions);
|
|
91
|
+
const lower = q.toLowerCase();
|
|
92
|
+
return list.filter((u) => u.label.toLowerCase().includes(lower) || (u.desc ?? "").toLowerCase().includes(lower)).slice(0, props.maxOptions);
|
|
93
|
+
});
|
|
94
|
+
const open = computed(() => activeQuery.value !== null && filtered.value.length > 0);
|
|
95
|
+
const { pos } = useAnchoredPosition(open, rootEl, panelEl, {
|
|
96
|
+
placement: "bottom-start",
|
|
97
|
+
gap: 6
|
|
98
|
+
});
|
|
99
|
+
const panelStyle = computed(() => ({
|
|
100
|
+
top: pos.value.top + "px",
|
|
101
|
+
left: pos.value.left + "px"
|
|
102
|
+
}));
|
|
103
|
+
const activeIndex = ref(0);
|
|
104
|
+
watch(filtered, () => {
|
|
105
|
+
activeIndex.value = 0;
|
|
106
|
+
});
|
|
107
|
+
function pick(user) {
|
|
108
|
+
const a = activeQuery.value;
|
|
109
|
+
const el = ta.value;
|
|
110
|
+
if (!a || !el) return;
|
|
111
|
+
const insert = props.trigger + (user.value ?? user.label);
|
|
112
|
+
const live = el.value;
|
|
113
|
+
const pos2 = el.selectionStart ?? live.length;
|
|
114
|
+
const before = live.slice(0, a.start);
|
|
115
|
+
const after = live.slice(pos2);
|
|
116
|
+
const next = before + insert + " " + after;
|
|
117
|
+
setText(next);
|
|
118
|
+
emit("select", user);
|
|
119
|
+
activeQuery.value = null;
|
|
120
|
+
nextTick(() => {
|
|
121
|
+
const caret = (before + insert + " ").length;
|
|
122
|
+
el.focus();
|
|
123
|
+
el.setSelectionRange(caret, caret);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function setText(v) {
|
|
127
|
+
if (!isControlled.value) inner.value = v;
|
|
128
|
+
emit("update:modelValue", v);
|
|
129
|
+
emit("change", v);
|
|
130
|
+
}
|
|
131
|
+
const { onCompositionStart, onCompositionEnd, shouldSkip } = useComposition();
|
|
132
|
+
function onInput(e) {
|
|
133
|
+
if (shouldSkip(e)) return;
|
|
134
|
+
const v = e.target.value;
|
|
135
|
+
if (!isControlled.value) inner.value = v;
|
|
136
|
+
emit("update:modelValue", v);
|
|
137
|
+
emit("change", v);
|
|
138
|
+
detectMention(v);
|
|
139
|
+
}
|
|
140
|
+
function onCompositionFlush() {
|
|
141
|
+
detectMention(ta.value?.value ?? "");
|
|
142
|
+
}
|
|
143
|
+
function onKeydown(e) {
|
|
144
|
+
if (shouldSkip(e)) return;
|
|
145
|
+
if (!open.value) return;
|
|
146
|
+
if (e.key === "ArrowDown") {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
activeIndex.value = (activeIndex.value + 1) % filtered.value.length;
|
|
149
|
+
} else if (e.key === "ArrowUp") {
|
|
150
|
+
e.preventDefault();
|
|
151
|
+
activeIndex.value = (activeIndex.value - 1 + filtered.value.length) % filtered.value.length;
|
|
152
|
+
} else if (e.key === "Enter" || e.key === "Tab") {
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
pick(filtered.value[activeIndex.value]);
|
|
155
|
+
} else if (e.key === "Escape") {
|
|
156
|
+
e.preventDefault();
|
|
157
|
+
activeQuery.value = null;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function onBlur() {
|
|
161
|
+
window.setTimeout(() => {
|
|
162
|
+
activeQuery.value = null;
|
|
163
|
+
}, 140);
|
|
164
|
+
}
|
|
165
|
+
useDismiss([rootEl, panelEl], () => {
|
|
166
|
+
activeQuery.value = null;
|
|
167
|
+
}, open);
|
|
168
|
+
useOverlayLayer(open, panelEl, () => {
|
|
169
|
+
activeQuery.value = null;
|
|
170
|
+
return true;
|
|
171
|
+
});
|
|
172
|
+
const charCount = computed(() => text.value.length);
|
|
173
|
+
return (_ctx, _cache) => {
|
|
174
|
+
return _openBlock(), _createElementBlock(
|
|
175
|
+
"div",
|
|
176
|
+
_mergeProps({
|
|
177
|
+
ref_key: "rootEl",
|
|
178
|
+
ref: rootEl,
|
|
179
|
+
class: ["wd-mentions", { "is-disabled": __props.disabled }]
|
|
180
|
+
}, _unref(formA11y).attrs.value),
|
|
181
|
+
[
|
|
182
|
+
_createElementVNode("textarea", {
|
|
183
|
+
ref_key: "ta",
|
|
184
|
+
ref: ta,
|
|
185
|
+
class: "wd-mentions__input",
|
|
186
|
+
role: "combobox",
|
|
187
|
+
"aria-autocomplete": "list",
|
|
188
|
+
"aria-expanded": open.value,
|
|
189
|
+
"aria-controls": _unref(listboxId),
|
|
190
|
+
value: text.value,
|
|
191
|
+
rows: __props.rows,
|
|
192
|
+
placeholder: __props.placeholder,
|
|
193
|
+
disabled: __props.disabled,
|
|
194
|
+
onInput,
|
|
195
|
+
onKeydown,
|
|
196
|
+
onCompositionstart: _cache[0] || (_cache[0] = //@ts-ignore
|
|
197
|
+
(...args) => _unref(onCompositionStart) && _unref(onCompositionStart)(...args)),
|
|
198
|
+
onCompositionend: _cache[1] || (_cache[1] = ($event) => _unref(onCompositionEnd)($event, onCompositionFlush)),
|
|
199
|
+
onBlur,
|
|
200
|
+
onClick: detectMention
|
|
201
|
+
}, null, 40, _hoisted_1),
|
|
202
|
+
_createCommentVNode('\n \u26A0\uFE0F \u5FC5\u987B Teleport \u5230 body\u3002\n `useAnchoredPosition` \u8FD4\u56DE\u7684\u662F**\u6587\u6863\u5750\u6807**\uFF08rect + scroll\uFF09\uFF0C\u9762\u677F\u5374\u662F `position: absolute`\uFF1A\n \u53EA\u8981\u7956\u5148\u6709 `position: relative`\uFF08\u5361\u7247\u3001\u8868\u683C\u5355\u5143\u683C\u90FD\u662F\uFF09\uFF0C\u5750\u6807\u5C31\u4F1A\u518D\u53E0\u52A0\u4E00\u6B21\u7956\u5148\u504F\u79FB \u2014\u2014\n \u9762\u677F\u76F4\u63A5\u98DE\u5230\u53F3\u4E0B\u89D2\u51E0\u767E\u50CF\u7D20\u5916\uFF08\u7528\u6237\u5B9E\u6D4B"\u5F39\u51FA\u5C42\u4E0D\u77E5\u9053\u98DE\u54EA\u53BB\u4E86"\uFF09\u3002\n \u5176\u4ED6\u6D6E\u5C42\uFF08select / dropdown / popover / datepicker\uFF09\u65E9\u5C31 Teleport \u4E86\uFF0C\u53EA\u6709\u8FD9\u91CC\u6F0F\u4E86\u3002\n '),
|
|
203
|
+
(_openBlock(), _createBlock(_Teleport, { to: "body" }, [
|
|
204
|
+
open.value ? (_openBlock(), _createElementBlock("div", {
|
|
205
|
+
key: 0,
|
|
206
|
+
id: _unref(listboxId),
|
|
207
|
+
ref_key: "panelEl",
|
|
208
|
+
ref: panelEl,
|
|
209
|
+
class: "wd-mentions__panel",
|
|
210
|
+
style: _normalizeStyle(panelStyle.value),
|
|
211
|
+
role: "listbox"
|
|
212
|
+
}, [
|
|
213
|
+
(_openBlock(true), _createElementBlock(
|
|
214
|
+
_Fragment,
|
|
215
|
+
null,
|
|
216
|
+
_renderList(filtered.value, (u, i) => {
|
|
217
|
+
return _openBlock(), _createElementBlock("button", {
|
|
218
|
+
key: u.id,
|
|
219
|
+
type: "button",
|
|
220
|
+
class: _normalizeClass(["wd-mentions__option", { "is-active": i === activeIndex.value }]),
|
|
221
|
+
role: "option",
|
|
222
|
+
"aria-selected": i === activeIndex.value,
|
|
223
|
+
onMousedown: _cache[2] || (_cache[2] = _withModifiers(() => {
|
|
224
|
+
}, ["prevent"])),
|
|
225
|
+
onClick: ($event) => pick(u),
|
|
226
|
+
onMouseenter: ($event) => activeIndex.value = i
|
|
227
|
+
}, [
|
|
228
|
+
u.avatar ? (_openBlock(), _createElementBlock("span", _hoisted_4, [
|
|
229
|
+
_createElementVNode("img", {
|
|
230
|
+
src: u.avatar,
|
|
231
|
+
alt: u.label
|
|
232
|
+
}, null, 8, _hoisted_5)
|
|
233
|
+
])) : (_openBlock(), _createElementBlock(
|
|
234
|
+
"span",
|
|
235
|
+
_hoisted_6,
|
|
236
|
+
_toDisplayString(u.label.slice(0, 1)),
|
|
237
|
+
1
|
|
238
|
+
/* TEXT */
|
|
239
|
+
)),
|
|
240
|
+
_createElementVNode("span", _hoisted_7, [
|
|
241
|
+
_createTextVNode(
|
|
242
|
+
_toDisplayString(u.label) + " ",
|
|
243
|
+
1
|
|
244
|
+
/* TEXT */
|
|
245
|
+
),
|
|
246
|
+
u.desc ? (_openBlock(), _createElementBlock(
|
|
247
|
+
"span",
|
|
248
|
+
_hoisted_8,
|
|
249
|
+
_toDisplayString(u.desc),
|
|
250
|
+
1
|
|
251
|
+
/* TEXT */
|
|
252
|
+
)) : _createCommentVNode("v-if", true)
|
|
253
|
+
])
|
|
254
|
+
], 42, _hoisted_3);
|
|
255
|
+
}),
|
|
256
|
+
128
|
|
257
|
+
/* KEYED_FRAGMENT */
|
|
258
|
+
))
|
|
259
|
+
], 12, _hoisted_2)) : _createCommentVNode("v-if", true)
|
|
260
|
+
])),
|
|
261
|
+
charCount.value ? (_openBlock(), _createElementBlock(
|
|
262
|
+
"span",
|
|
263
|
+
_hoisted_9,
|
|
264
|
+
_toDisplayString(charCount.value),
|
|
265
|
+
1
|
|
266
|
+
/* TEXT */
|
|
267
|
+
)) : _createCommentVNode("v-if", true)
|
|
268
|
+
],
|
|
269
|
+
16
|
|
270
|
+
/* FULL_PROPS */
|
|
271
|
+
);
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
export {
|
|
276
|
+
WdMentions_default as WdMentions
|
|
277
|
+
};
|