@w-run/wdesign-ui 1.0.0 → 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 +208 -127
- package/dist/index.d.ts +1010 -80
- 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 +572 -13
- package/dist/style/alert.css +577 -5
- package/dist/style/anchor.css +630 -0
- package/dist/style/audio.css +658 -67
- package/dist/style/avatar.css +575 -12
- package/dist/style/backtop.css +625 -0
- package/dist/style/badge.css +595 -11
- package/dist/style/bento.css +763 -0
- package/dist/style/bottom-sheet.css +776 -0
- package/dist/style/breadcrumb.css +579 -4
- package/dist/style/button.css +631 -36
- package/dist/style/calendar.css +1512 -0
- package/dist/style/card.css +683 -6
- package/dist/style/carousel.css +573 -4
- package/dist/style/cascader.css +862 -0
- package/dist/style/checkbox.css +584 -7
- package/dist/style/chevron.css +543 -1
- package/dist/style/collapse.css +586 -7
- package/dist/style/colorpicker.css +876 -0
- package/dist/style/command.css +572 -13
- package/dist/style/container.css +543 -0
- package/dist/style/countdown.css +722 -0
- package/dist/style/danmaku.css +644 -0
- package/dist/style/datepicker.css +606 -128
- package/dist/style/datetime-picker.css +714 -0
- package/dist/style/descriptions.css +604 -11
- package/dist/style/divider.css +544 -2
- package/dist/style/dot.css +556 -1
- package/dist/style/drawer.css +609 -11
- package/dist/style/dropdown.css +565 -3
- package/dist/style/empty.css +624 -3
- package/dist/style/explorer.css +632 -24
- package/dist/style/file-list.css +577 -5
- package/dist/style/flip.css +600 -0
- package/dist/style/form.css +550 -8
- package/dist/style/grid.css +614 -0
- package/dist/style/group.css +560 -16
- package/dist/style/icon-btn.css +570 -4
- package/dist/style/image-preview.css +652 -8
- package/dist/style/input-number.css +680 -0
- package/dist/style/input.css +571 -8
- package/dist/style/list.css +553 -4
- package/dist/style/loading.css +667 -0
- package/dist/style/markdown.css +592 -20
- 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 +626 -15
- package/dist/style/nav.css +1046 -0
- package/dist/style/notification.css +556 -7
- package/dist/style/otp.css +567 -7
- package/dist/style/pagination.css +571 -11
- package/dist/style/popconfirm.css +568 -10
- package/dist/style/popover.css +645 -15
- package/dist/style/post-item.css +548 -6
- package/dist/style/progress-ring.css +640 -0
- package/dist/style/progress.css +543 -1
- package/dist/style/pull-refresh.css +637 -0
- package/dist/style/qrcode.css +613 -0
- package/dist/style/radio.css +584 -5
- package/dist/style/rate.css +594 -1
- package/dist/style/result.css +546 -3
- package/dist/style/scroll-reveal.css +613 -0
- package/dist/style/scrollbar.css +644 -0
- package/dist/style/segmented-picker.css +573 -14
- package/dist/style/segmented.css +711 -7
- package/dist/style/select.css +682 -26
- package/dist/style/skeleton.css +559 -0
- package/dist/style/slider.css +565 -4
- package/dist/style/sortable.css +593 -7
- package/dist/style/space.css +543 -0
- package/dist/style/sparkline.css +606 -0
- package/dist/style/spinner.css +559 -0
- package/dist/style/splitter.css +711 -0
- package/dist/style/stat-bar.css +767 -0
- package/dist/style/statistic.css +552 -7
- package/dist/style/steps.css +633 -9
- package/dist/style/switch.css +585 -4
- package/dist/style/tab-bar.css +647 -0
- package/dist/style/table.css +886 -36
- package/dist/style/tabs.css +599 -10
- package/dist/style/tag-input.css +710 -0
- package/dist/style/tag.css +603 -18
- package/dist/style/time-picker.css +749 -0
- package/dist/style/timeline.css +575 -14
- package/dist/style/toast.css +567 -6
- package/dist/style/tooltip.css +564 -5
- package/dist/style/tour.css +683 -0
- package/dist/style/transfer.css +858 -0
- package/dist/style/tree.css +613 -16
- package/dist/style/typography.css +884 -3
- package/dist/style/upload.css +602 -13
- package/dist/style/vlist.css +543 -1
- package/dist/style/vplayer.css +799 -57
- package/dist/style/watermark.css +570 -0
- package/dist/wdesign-ui.css +18055 -7262
- package/dist/wdesign-ui.esm.js +8976 -5044
- package/package.json +99 -13
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WdAvatar_default
|
|
3
|
+
} from "./chunk-WCFG5KNT.js";
|
|
4
|
+
|
|
5
|
+
// .lib-build/WdAvatarGroup.ts
|
|
6
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
7
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode } from "vue";
|
|
8
|
+
import { computed } from "vue";
|
|
9
|
+
var _hoisted_1 = { class: "wd-avatars" };
|
|
10
|
+
var WdAvatarGroup_default = /* @__PURE__ */ _defineComponent({
|
|
11
|
+
...{ name: "WdAvatarGroup" },
|
|
12
|
+
__name: "WdAvatarGroup",
|
|
13
|
+
props: {
|
|
14
|
+
names: { type: Array, required: false, default: () => [] },
|
|
15
|
+
max: { type: Number, required: false, default: 3 }
|
|
16
|
+
},
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const shown = computed(() => props.names.slice(0, props.max));
|
|
20
|
+
const rest = computed(() => Math.max(0, props.names.length - props.max));
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return _openBlock(), _createElementBlock("span", _hoisted_1, [
|
|
23
|
+
(_openBlock(true), _createElementBlock(
|
|
24
|
+
_Fragment,
|
|
25
|
+
null,
|
|
26
|
+
_renderList(shown.value, (name, index) => {
|
|
27
|
+
return _openBlock(), _createBlock(WdAvatar_default, {
|
|
28
|
+
key: index,
|
|
29
|
+
name
|
|
30
|
+
}, null, 8, ["name"]);
|
|
31
|
+
}),
|
|
32
|
+
128
|
|
33
|
+
/* KEYED_FRAGMENT */
|
|
34
|
+
)),
|
|
35
|
+
rest.value ? (_openBlock(), _createBlock(WdAvatar_default, {
|
|
36
|
+
key: 0,
|
|
37
|
+
name: `+${rest.value}`,
|
|
38
|
+
dark: ""
|
|
39
|
+
}, null, 8, ["name"])) : _createCommentVNode("v-if", true)
|
|
40
|
+
]);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
WdAvatarGroup_default as WdAvatarGroup
|
|
46
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WdIcon_default
|
|
3
|
+
} from "./chunk-Q34U2HES.js";
|
|
4
|
+
|
|
5
|
+
// .lib-build/WdBacktop.ts
|
|
6
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
7
|
+
import { renderSlot as _renderSlot, unref as _unref, createVNode as _createVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
8
|
+
import { computed, onBeforeUnmount, onMounted, ref } from "vue";
|
|
9
|
+
var _hoisted_1 = ["aria-hidden", "tabindex"];
|
|
10
|
+
var WdBacktop_default = /* @__PURE__ */ _defineComponent({
|
|
11
|
+
...{ name: "WdBacktop" },
|
|
12
|
+
__name: "WdBacktop",
|
|
13
|
+
props: {
|
|
14
|
+
visibilityHeight: { type: Number, required: false, default: 320 },
|
|
15
|
+
right: { type: Number, required: false, default: 24 },
|
|
16
|
+
bottom: { type: Number, required: false, default: 24 },
|
|
17
|
+
duration: { type: Number, required: false, default: 420 },
|
|
18
|
+
target: { type: String, required: false, default: "" },
|
|
19
|
+
instant: { type: Boolean, required: false, default: false }
|
|
20
|
+
},
|
|
21
|
+
emits: ["click"],
|
|
22
|
+
setup(__props, { emit: __emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const emit = __emit;
|
|
25
|
+
const visible = ref(false);
|
|
26
|
+
let scrollEl = null;
|
|
27
|
+
function readScrollTop() {
|
|
28
|
+
if (scrollEl === window || scrollEl === null) {
|
|
29
|
+
return window.scrollY ?? window.pageYOffset ?? document.documentElement.scrollTop ?? 0;
|
|
30
|
+
}
|
|
31
|
+
return scrollEl.scrollTop;
|
|
32
|
+
}
|
|
33
|
+
function onScroll() {
|
|
34
|
+
visible.value = readScrollTop() > props.visibilityHeight;
|
|
35
|
+
}
|
|
36
|
+
let raf = 0;
|
|
37
|
+
function scrollToTop() {
|
|
38
|
+
const from = readScrollTop();
|
|
39
|
+
if (from <= 0) return;
|
|
40
|
+
if (props.instant) {
|
|
41
|
+
scrollTo(from > 0 ? 0 : 0, true);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const start = performance.now();
|
|
45
|
+
const dur = Math.max(1, props.duration);
|
|
46
|
+
const step = (now) => {
|
|
47
|
+
const t = Math.min(1, (now - start) / dur);
|
|
48
|
+
const eased = 1 - Math.pow(1 - t, 3);
|
|
49
|
+
scrollTo(from * (1 - eased), true);
|
|
50
|
+
if (t < 1) raf = requestAnimationFrame(step);
|
|
51
|
+
else raf = 0;
|
|
52
|
+
};
|
|
53
|
+
raf = requestAnimationFrame(step);
|
|
54
|
+
window.setTimeout(() => {
|
|
55
|
+
if (raf) {
|
|
56
|
+
cancelAnimationFrame(raf);
|
|
57
|
+
raf = 0;
|
|
58
|
+
if (readScrollTop() > 0) scrollTo(0, false);
|
|
59
|
+
}
|
|
60
|
+
}, dur + 120);
|
|
61
|
+
}
|
|
62
|
+
function scrollTo(top, smooth) {
|
|
63
|
+
if (scrollEl === window || scrollEl === null) {
|
|
64
|
+
if (smooth) window.scrollTo({ top, behavior: "auto" });
|
|
65
|
+
else window.scrollTo(0, top);
|
|
66
|
+
} else {
|
|
67
|
+
;
|
|
68
|
+
scrollEl.scrollTop = top;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function onClick(e) {
|
|
72
|
+
scrollToTop();
|
|
73
|
+
emit("click", e);
|
|
74
|
+
}
|
|
75
|
+
onMounted(() => {
|
|
76
|
+
if (props.target) {
|
|
77
|
+
scrollEl = document.querySelector(props.target);
|
|
78
|
+
if (!scrollEl) {
|
|
79
|
+
scrollEl = window;
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
scrollEl = window;
|
|
83
|
+
}
|
|
84
|
+
scrollEl.addEventListener("scroll", onScroll, { passive: true });
|
|
85
|
+
onScroll();
|
|
86
|
+
});
|
|
87
|
+
onBeforeUnmount(() => {
|
|
88
|
+
scrollEl?.removeEventListener("scroll", onScroll);
|
|
89
|
+
if (raf) {
|
|
90
|
+
cancelAnimationFrame(raf);
|
|
91
|
+
raf = 0;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const style = computed(() => ({
|
|
95
|
+
right: props.right + "px",
|
|
96
|
+
bottom: props.bottom + "px"
|
|
97
|
+
}));
|
|
98
|
+
return (_ctx, _cache) => {
|
|
99
|
+
return _openBlock(), _createElementBlock("button", {
|
|
100
|
+
type: "button",
|
|
101
|
+
class: _normalizeClass(["wd-backtop", { "is-visible": visible.value }]),
|
|
102
|
+
style: _normalizeStyle(style.value),
|
|
103
|
+
"aria-hidden": !visible.value,
|
|
104
|
+
tabindex: visible.value ? 0 : -1,
|
|
105
|
+
"aria-label": "\u56DE\u5230\u9876\u90E8",
|
|
106
|
+
onClick
|
|
107
|
+
}, [
|
|
108
|
+
_renderSlot(_ctx.$slots, "default", {}, () => [
|
|
109
|
+
_createVNode(_unref(WdIcon_default), {
|
|
110
|
+
name: "arrow-up",
|
|
111
|
+
size: 18
|
|
112
|
+
})
|
|
113
|
+
])
|
|
114
|
+
], 14, _hoisted_1);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
export {
|
|
119
|
+
WdBacktop_default as WdBacktop
|
|
120
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// .lib-build/WdBadge.ts
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass } from "vue";
|
|
4
|
+
import { computed, ref, watch } from "vue";
|
|
5
|
+
var _hoisted_1 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "wd-badge__dot"
|
|
8
|
+
};
|
|
9
|
+
var _hoisted_2 = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "wd-badge__count"
|
|
12
|
+
};
|
|
13
|
+
var WdBadge_default = /* @__PURE__ */ _defineComponent({
|
|
14
|
+
...{ name: "WdBadge" },
|
|
15
|
+
__name: "WdBadge",
|
|
16
|
+
props: {
|
|
17
|
+
value: { type: [Number, String], required: false, default: "" },
|
|
18
|
+
dot: { type: Boolean, required: false, default: false },
|
|
19
|
+
max: { type: Number, required: false, default: 99 },
|
|
20
|
+
tone: { type: String, required: false, default: "red" }
|
|
21
|
+
},
|
|
22
|
+
setup(__props) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const display = computed(() => {
|
|
25
|
+
if (typeof props.value === "number" && props.max && props.value > props.max) {
|
|
26
|
+
return `${props.max}+`;
|
|
27
|
+
}
|
|
28
|
+
return props.value;
|
|
29
|
+
});
|
|
30
|
+
const showCount = computed(
|
|
31
|
+
() => !props.dot && props.value !== "" && props.value !== void 0 && props.value !== null
|
|
32
|
+
);
|
|
33
|
+
const animReady = ref(false);
|
|
34
|
+
watch(() => props.value, () => {
|
|
35
|
+
animReady.value = true;
|
|
36
|
+
});
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return _openBlock(), _createElementBlock(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
class: _normalizeClass(["wd-badge", [__props.tone === "gray" ? "wd-badge--gray" : "", { "wd-badge--anim-ready": animReady.value }]])
|
|
42
|
+
},
|
|
43
|
+
[
|
|
44
|
+
_renderSlot(_ctx.$slots, "default"),
|
|
45
|
+
__props.dot ? (_openBlock(), _createElementBlock("span", _hoisted_1)) : showCount.value ? (_openBlock(), _createElementBlock(
|
|
46
|
+
"span",
|
|
47
|
+
_hoisted_2,
|
|
48
|
+
_toDisplayString(display.value),
|
|
49
|
+
1
|
|
50
|
+
/* TEXT */
|
|
51
|
+
)) : _createCommentVNode("v-if", true)
|
|
52
|
+
],
|
|
53
|
+
2
|
|
54
|
+
/* CLASS */
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
export {
|
|
60
|
+
WdBadge_default as WdBadge
|
|
61
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// .lib-build/WdBento.ts
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
4
|
+
import { computed, provide } from "vue";
|
|
5
|
+
var WdBento_default = /* @__PURE__ */ _defineComponent({
|
|
6
|
+
...{ name: "WdBento" },
|
|
7
|
+
__name: "WdBento",
|
|
8
|
+
props: {
|
|
9
|
+
columns: { type: Number, required: false, default: 4 },
|
|
10
|
+
gap: { type: String, required: false, default: "md" },
|
|
11
|
+
rowHeight: { type: Number, required: false, default: 140 }
|
|
12
|
+
},
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const gapPx = computed(() => ({ sm: 8, md: 16, lg: 24 })[props.gap] || 16);
|
|
16
|
+
const style = computed(() => ({
|
|
17
|
+
"--wd-bento-cols": String(props.columns),
|
|
18
|
+
"--wd-bento-gap": `${gapPx.value}px`,
|
|
19
|
+
"--wd-bento-row": `${props.rowHeight}px`
|
|
20
|
+
}));
|
|
21
|
+
provide("wd-bento", { rowHeight: props.rowHeight, gap: gapPx.value });
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return _openBlock(), _createElementBlock(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
class: "wd-bento",
|
|
27
|
+
style: _normalizeStyle(style.value)
|
|
28
|
+
},
|
|
29
|
+
[
|
|
30
|
+
_renderSlot(_ctx.$slots, "default")
|
|
31
|
+
],
|
|
32
|
+
4
|
|
33
|
+
/* STYLE */
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
WdBento_default as WdBento
|
|
40
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// .lib-build/WdBentoItem.ts
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
4
|
+
import { computed, inject } from "vue";
|
|
5
|
+
var WdBentoItem_default = /* @__PURE__ */ _defineComponent({
|
|
6
|
+
...{ name: "WdBentoItem" },
|
|
7
|
+
__name: "WdBentoItem",
|
|
8
|
+
props: {
|
|
9
|
+
colSpan: { type: Number, required: false, default: 1 },
|
|
10
|
+
rowSpan: { type: Number, required: false, default: 1 },
|
|
11
|
+
tone: { type: String, required: false, default: "tint" },
|
|
12
|
+
radius: { type: String, required: false, default: "lg" },
|
|
13
|
+
interactive: { type: Boolean, required: false, default: false }
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const bento = inject("wd-bento", null);
|
|
18
|
+
const style = computed(() => {
|
|
19
|
+
const { rowHeight, gap } = bento || { rowHeight: 140, gap: 16 };
|
|
20
|
+
return {
|
|
21
|
+
"--wd-bento-col-span": String(props.colSpan),
|
|
22
|
+
"--wd-bento-row-span": String(props.rowSpan),
|
|
23
|
+
"--wd-bento-item-h": props.rowSpan * rowHeight + (props.rowSpan - 1) * gap + "px"
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return _openBlock(), _createBlock(_resolveDynamicComponent(__props.interactive ? "button" : "div"), {
|
|
28
|
+
class: _normalizeClass(["wd-bento__item", ["wd-bento__item--" + __props.tone, "wd-bento__item--r-" + __props.radius, { "wd-bento__item--link": __props.interactive }]]),
|
|
29
|
+
style: _normalizeStyle(style.value),
|
|
30
|
+
type: __props.interactive ? "button" : void 0
|
|
31
|
+
}, {
|
|
32
|
+
default: _withCtx(() => [
|
|
33
|
+
_renderSlot(_ctx.$slots, "default")
|
|
34
|
+
]),
|
|
35
|
+
_: 3
|
|
36
|
+
/* FORWARDED */
|
|
37
|
+
}, 8, ["class", "style", "type"]);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
WdBentoItem_default as WdBentoItem
|
|
43
|
+
};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import {
|
|
2
|
+
popDuration
|
|
3
|
+
} from "./chunk-HAKYCUAR.js";
|
|
4
|
+
import {
|
|
5
|
+
useFocusTrap,
|
|
6
|
+
useScrollLock
|
|
7
|
+
} from "./chunk-LT3NTWIT.js";
|
|
8
|
+
import {
|
|
9
|
+
nextZIndex
|
|
10
|
+
} from "./chunk-5HYOQ52I.js";
|
|
11
|
+
import {
|
|
12
|
+
WdIcon_default
|
|
13
|
+
} from "./chunk-Q34U2HES.js";
|
|
14
|
+
|
|
15
|
+
// .lib-build/WdBottomSheet.ts
|
|
16
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
17
|
+
import { createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, withModifiers as _withModifiers, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, unref as _unref, createVNode as _createVNode, normalizeStyle as _normalizeStyle, vShow as _vShow, mergeProps as _mergeProps, withDirectives as _withDirectives, Teleport as _Teleport, createBlock as _createBlock } from "vue";
|
|
18
|
+
import { computed, ref, toRef, watchEffect } from "vue";
|
|
19
|
+
var _hoisted_1 = ["aria-label"];
|
|
20
|
+
var _hoisted_2 = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "wd-sheet__grabber wd-sheet__grabber--static",
|
|
23
|
+
"aria-hidden": "true"
|
|
24
|
+
};
|
|
25
|
+
var _hoisted_3 = {
|
|
26
|
+
key: 2,
|
|
27
|
+
class: "wd-sheet__head"
|
|
28
|
+
};
|
|
29
|
+
var _hoisted_4 = { class: "wd-sheet__titles" };
|
|
30
|
+
var _hoisted_5 = {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: "wd-sheet__title"
|
|
33
|
+
};
|
|
34
|
+
var _hoisted_6 = {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: "wd-sheet__desc"
|
|
37
|
+
};
|
|
38
|
+
var _hoisted_7 = {
|
|
39
|
+
key: 4,
|
|
40
|
+
class: "wd-sheet__foot"
|
|
41
|
+
};
|
|
42
|
+
var WdBottomSheet_default = /* @__PURE__ */ _defineComponent({
|
|
43
|
+
...{ name: "WdBottomSheet", inheritAttrs: false },
|
|
44
|
+
__name: "WdBottomSheet",
|
|
45
|
+
props: {
|
|
46
|
+
modelValue: { type: Boolean, required: false, default: false },
|
|
47
|
+
title: { type: String, required: false, default: "" },
|
|
48
|
+
desc: { type: String, required: false, default: "" },
|
|
49
|
+
closeOnMask: { type: Boolean, required: false, default: true },
|
|
50
|
+
maxHeight: { type: [String, Number], required: false, default: "80dvh" },
|
|
51
|
+
swipeable: { type: Boolean, required: false, default: true },
|
|
52
|
+
bodyFlush: { type: Boolean, required: false, default: false },
|
|
53
|
+
destroyOnClose: { type: Boolean, required: false, default: false },
|
|
54
|
+
closable: { type: Boolean, required: false, default: true }
|
|
55
|
+
},
|
|
56
|
+
emits: ["update:modelValue", "drag-start", "drag-end"],
|
|
57
|
+
setup(__props, { emit: __emit }) {
|
|
58
|
+
const props = __props;
|
|
59
|
+
const emit = __emit;
|
|
60
|
+
const POP_DURATION = popDuration();
|
|
61
|
+
const panel = ref(null);
|
|
62
|
+
const body = ref(null);
|
|
63
|
+
const mounted = ref(false);
|
|
64
|
+
watchEffect(() => {
|
|
65
|
+
if (props.modelValue) mounted.value = true;
|
|
66
|
+
});
|
|
67
|
+
const contentAlive = ref(false);
|
|
68
|
+
let destroyTimer = null;
|
|
69
|
+
watchEffect(() => {
|
|
70
|
+
if (props.modelValue) {
|
|
71
|
+
contentAlive.value = true;
|
|
72
|
+
if (destroyTimer) {
|
|
73
|
+
window.clearTimeout(destroyTimer);
|
|
74
|
+
destroyTimer = null;
|
|
75
|
+
}
|
|
76
|
+
} else if (props.destroyOnClose && contentAlive.value) {
|
|
77
|
+
if (destroyTimer) window.clearTimeout(destroyTimer);
|
|
78
|
+
destroyTimer = window.setTimeout(() => {
|
|
79
|
+
contentAlive.value = false;
|
|
80
|
+
}, POP_DURATION);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const openRef = toRef(props, "modelValue");
|
|
84
|
+
useScrollLock(openRef);
|
|
85
|
+
useFocusTrap(openRef, panel, () => {
|
|
86
|
+
close();
|
|
87
|
+
return true;
|
|
88
|
+
});
|
|
89
|
+
const myZ = ref(0);
|
|
90
|
+
watchEffect(() => {
|
|
91
|
+
if (props.modelValue) myZ.value = nextZIndex();
|
|
92
|
+
});
|
|
93
|
+
const maxHeightStyle = computed(
|
|
94
|
+
() => typeof props.maxHeight === "number" ? props.maxHeight + "px" : props.maxHeight
|
|
95
|
+
);
|
|
96
|
+
function close() {
|
|
97
|
+
emit("update:modelValue", false);
|
|
98
|
+
}
|
|
99
|
+
const dragging = ref(false);
|
|
100
|
+
const offset = ref(0);
|
|
101
|
+
let startY = 0;
|
|
102
|
+
let startTime = 0;
|
|
103
|
+
let panelHeight = 0;
|
|
104
|
+
function onPointerDown(e) {
|
|
105
|
+
if (!props.swipeable) return;
|
|
106
|
+
if (body.value && body.value.scrollTop > 0) return;
|
|
107
|
+
dragging.value = true;
|
|
108
|
+
startY = e.clientY;
|
|
109
|
+
startTime = Date.now();
|
|
110
|
+
panelHeight = panel.value?.offsetHeight ?? 300;
|
|
111
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
112
|
+
emit("drag-start");
|
|
113
|
+
}
|
|
114
|
+
function onPointerMove(e) {
|
|
115
|
+
if (!dragging.value) return;
|
|
116
|
+
const dy = e.clientY - startY;
|
|
117
|
+
offset.value = dy > 0 ? dy : Math.max(dy * 0.15, -12);
|
|
118
|
+
}
|
|
119
|
+
function onPointerUp() {
|
|
120
|
+
if (!dragging.value) return;
|
|
121
|
+
dragging.value = false;
|
|
122
|
+
const elapsed = Math.max(Date.now() - startTime, 1);
|
|
123
|
+
const velocity = offset.value / elapsed;
|
|
124
|
+
const farEnough = offset.value > panelHeight * 0.25;
|
|
125
|
+
const fastEnough = velocity > 0.5;
|
|
126
|
+
emit("drag-end", farEnough || fastEnough);
|
|
127
|
+
if (farEnough || fastEnough) close();
|
|
128
|
+
offset.value = 0;
|
|
129
|
+
}
|
|
130
|
+
const panelStyle = computed(() => {
|
|
131
|
+
const style = { maxHeight: maxHeightStyle.value };
|
|
132
|
+
if (offset.value !== 0) {
|
|
133
|
+
style.transform = "translate3d(0, " + offset.value + "px, 0)";
|
|
134
|
+
style.transition = "none";
|
|
135
|
+
}
|
|
136
|
+
return style;
|
|
137
|
+
});
|
|
138
|
+
const classes = computed(() => [
|
|
139
|
+
"wd-sheet",
|
|
140
|
+
props.bodyFlush ? "wd-sheet--flush" : "",
|
|
141
|
+
{ "is-open": props.modelValue, "is-dragging": dragging.value }
|
|
142
|
+
]);
|
|
143
|
+
return (_ctx, _cache) => {
|
|
144
|
+
return _openBlock(), _createBlock(_Teleport, { to: "body" }, [
|
|
145
|
+
_withDirectives(_createElementVNode("div", _mergeProps(_ctx.$attrs, {
|
|
146
|
+
class: classes.value,
|
|
147
|
+
role: "dialog",
|
|
148
|
+
"aria-modal": "true",
|
|
149
|
+
"aria-label": __props.title || void 0,
|
|
150
|
+
style: { zIndex: myZ.value }
|
|
151
|
+
}), [
|
|
152
|
+
_createElementVNode("div", {
|
|
153
|
+
class: "wd-sheet__mask",
|
|
154
|
+
onClick: _cache[0] || (_cache[0] = ($event) => __props.closeOnMask && close())
|
|
155
|
+
}),
|
|
156
|
+
_createElementVNode(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
ref_key: "panel",
|
|
160
|
+
ref: panel,
|
|
161
|
+
class: "wd-sheet__panel",
|
|
162
|
+
style: _normalizeStyle(panelStyle.value),
|
|
163
|
+
tabindex: "-1"
|
|
164
|
+
},
|
|
165
|
+
[
|
|
166
|
+
_createCommentVNode('\n \u6293\u624B\u6761\uFF1A\u89C6\u89C9\u4E0A\u544A\u8BC9\u4EBA\u300C\u8FD9\u91CC\u53EF\u4EE5\u62D6\u300D\uFF0C\u540C\u65F6\u662F\u62D6\u62FD\u70ED\u533A\u3002\n\n \u26A0\uFE0F \u523B\u610F**\u6CA1\u6709** role / tabindex\uFF1A\n \u5B83\u53EA\u662F\u4E00\u4E2A\u628A\u6307\u9488\u624B\u52BF\u53D8\u6210\u300C\u4E0B\u62C9\u5173\u95ED\u300D\u7684\u70ED\u533A\uFF0C\u672C\u8EAB\u4E0D\u662F\u63A7\u4EF6 \u2014\u2014\n \u952E\u76D8\u7528\u6237\u5173\u95ED\u5F39\u5C42\u7684\u8DEF\u5F84\u662F Esc \u548C\u53F3\u4E0A\u89D2\u5173\u95ED\u6309\u94AE\uFF0C\u4E0D\u9700\u8981\u518D\u52A0\u4E00\u6761\u3002\n \u4E4B\u524D\u8FD9\u91CC\u5199\u7684\u662F role="separator" + aria-label="\u62D6\u52A8\u5173\u95ED"\uFF0C\n \u90A3\u7B49\u4E8E\u5411\u8BFB\u5C4F\u5BA3\u544A\u300C\u8FD9\u662F\u4E2A\u53EF\u8C03\u7684\u8C03\u8282\u5668\u300D\uFF0C\u4F46\u5B83\u8FDE\u805A\u7126\u90FD\u505A\u4E0D\u5230\uFF0C\n \u5C5E\u4E8E**\u58F0\u660E\u4E86\u5374\u505A\u4E0D\u5230**\uFF0C\u6BD4\u4E0D\u58F0\u660E\u66F4\u7CDF\u3002\n '),
|
|
167
|
+
__props.swipeable ? (_openBlock(), _createElementBlock(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
key: 0,
|
|
171
|
+
class: "wd-sheet__grabber",
|
|
172
|
+
"aria-hidden": "true",
|
|
173
|
+
onPointerdown: _withModifiers(onPointerDown, ["prevent"]),
|
|
174
|
+
onPointermove: onPointerMove,
|
|
175
|
+
onPointerup: onPointerUp,
|
|
176
|
+
onPointercancel: onPointerUp
|
|
177
|
+
},
|
|
178
|
+
[..._cache[1] || (_cache[1] = [
|
|
179
|
+
_createElementVNode(
|
|
180
|
+
"span",
|
|
181
|
+
{
|
|
182
|
+
class: "wd-sheet__bar",
|
|
183
|
+
"aria-hidden": "true"
|
|
184
|
+
},
|
|
185
|
+
null,
|
|
186
|
+
-1
|
|
187
|
+
/* CACHED */
|
|
188
|
+
)
|
|
189
|
+
])],
|
|
190
|
+
32
|
|
191
|
+
/* NEED_HYDRATION */
|
|
192
|
+
)) : (_openBlock(), _createElementBlock("div", _hoisted_2, [..._cache[2] || (_cache[2] = [
|
|
193
|
+
_createElementVNode(
|
|
194
|
+
"span",
|
|
195
|
+
{ class: "wd-sheet__bar" },
|
|
196
|
+
null,
|
|
197
|
+
-1
|
|
198
|
+
/* CACHED */
|
|
199
|
+
)
|
|
200
|
+
])])),
|
|
201
|
+
__props.title || __props.desc || _ctx.$slots.header || __props.closable ? (_openBlock(), _createElementBlock("header", _hoisted_3, [
|
|
202
|
+
_renderSlot(_ctx.$slots, "header", {}, () => [
|
|
203
|
+
_createElementVNode("div", _hoisted_4, [
|
|
204
|
+
__props.title ? (_openBlock(), _createElementBlock(
|
|
205
|
+
"h2",
|
|
206
|
+
_hoisted_5,
|
|
207
|
+
_toDisplayString(__props.title),
|
|
208
|
+
1
|
|
209
|
+
/* TEXT */
|
|
210
|
+
)) : _createCommentVNode("v-if", true),
|
|
211
|
+
__props.desc ? (_openBlock(), _createElementBlock(
|
|
212
|
+
"p",
|
|
213
|
+
_hoisted_6,
|
|
214
|
+
_toDisplayString(__props.desc),
|
|
215
|
+
1
|
|
216
|
+
/* TEXT */
|
|
217
|
+
)) : _createCommentVNode("v-if", true)
|
|
218
|
+
])
|
|
219
|
+
]),
|
|
220
|
+
__props.closable ? (_openBlock(), _createElementBlock("button", {
|
|
221
|
+
key: 0,
|
|
222
|
+
type: "button",
|
|
223
|
+
class: "wd-sheet__close wd-icon-btn",
|
|
224
|
+
"aria-label": "\u5173\u95ED",
|
|
225
|
+
onClick: close
|
|
226
|
+
}, [
|
|
227
|
+
_createVNode(_unref(WdIcon_default), {
|
|
228
|
+
name: "close",
|
|
229
|
+
size: 16
|
|
230
|
+
})
|
|
231
|
+
])) : _createCommentVNode("v-if", true)
|
|
232
|
+
])) : _createCommentVNode("v-if", true),
|
|
233
|
+
contentAlive.value ? (_openBlock(), _createElementBlock(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
key: 3,
|
|
237
|
+
ref_key: "body",
|
|
238
|
+
ref: body,
|
|
239
|
+
class: "wd-sheet__body"
|
|
240
|
+
},
|
|
241
|
+
[
|
|
242
|
+
_renderSlot(_ctx.$slots, "default")
|
|
243
|
+
],
|
|
244
|
+
512
|
|
245
|
+
/* NEED_PATCH */
|
|
246
|
+
)) : _createCommentVNode("v-if", true),
|
|
247
|
+
_ctx.$slots.footer ? (_openBlock(), _createElementBlock("footer", _hoisted_7, [
|
|
248
|
+
_renderSlot(_ctx.$slots, "footer")
|
|
249
|
+
])) : _createCommentVNode("v-if", true)
|
|
250
|
+
],
|
|
251
|
+
4
|
|
252
|
+
/* STYLE */
|
|
253
|
+
)
|
|
254
|
+
], 16, _hoisted_1), [
|
|
255
|
+
[_vShow, mounted.value]
|
|
256
|
+
])
|
|
257
|
+
]);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
export {
|
|
262
|
+
WdBottomSheet_default as WdBottomSheet
|
|
263
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// .lib-build/WdBreadcrumb.ts
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode } from "vue";
|
|
4
|
+
var _hoisted_1 = {
|
|
5
|
+
class: "wd-breadcrumb",
|
|
6
|
+
"aria-label": "\u9762\u5305\u5C51"
|
|
7
|
+
};
|
|
8
|
+
var _hoisted_2 = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "wd-breadcrumb__sep"
|
|
11
|
+
};
|
|
12
|
+
var _hoisted_3 = ["onClick"];
|
|
13
|
+
var WdBreadcrumb_default = /* @__PURE__ */ _defineComponent({
|
|
14
|
+
...{ name: "WdBreadcrumb" },
|
|
15
|
+
__name: "WdBreadcrumb",
|
|
16
|
+
props: {
|
|
17
|
+
items: { type: Array, required: false, default: () => [] },
|
|
18
|
+
separator: { type: String, required: false, default: "/" }
|
|
19
|
+
},
|
|
20
|
+
emits: ["select"],
|
|
21
|
+
setup(__props, { emit: __emit }) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const emit = __emit;
|
|
24
|
+
function pick(item, index) {
|
|
25
|
+
if (index === props.items.length - 1) return;
|
|
26
|
+
emit("select", item.value ?? index, index);
|
|
27
|
+
}
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return _openBlock(), _createElementBlock("nav", _hoisted_1, [
|
|
30
|
+
(_openBlock(true), _createElementBlock(
|
|
31
|
+
_Fragment,
|
|
32
|
+
null,
|
|
33
|
+
_renderList(props.items, (item, i) => {
|
|
34
|
+
return _openBlock(), _createElementBlock(
|
|
35
|
+
_Fragment,
|
|
36
|
+
{ key: i },
|
|
37
|
+
[
|
|
38
|
+
i > 0 ? (_openBlock(), _createElementBlock(
|
|
39
|
+
"span",
|
|
40
|
+
_hoisted_2,
|
|
41
|
+
_toDisplayString(__props.separator),
|
|
42
|
+
1
|
|
43
|
+
/* TEXT */
|
|
44
|
+
)) : _createCommentVNode("v-if", true),
|
|
45
|
+
_createElementVNode("button", {
|
|
46
|
+
type: "button",
|
|
47
|
+
class: _normalizeClass(["wd-breadcrumb__item", { "wd-breadcrumb__item--current": i === props.items.length - 1 }]),
|
|
48
|
+
onClick: ($event) => pick(item, i)
|
|
49
|
+
}, _toDisplayString(item.label), 11, _hoisted_3)
|
|
50
|
+
],
|
|
51
|
+
64
|
|
52
|
+
/* STABLE_FRAGMENT */
|
|
53
|
+
);
|
|
54
|
+
}),
|
|
55
|
+
128
|
|
56
|
+
/* KEYED_FRAGMENT */
|
|
57
|
+
))
|
|
58
|
+
]);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
WdBreadcrumb_default as WdBreadcrumb
|
|
64
|
+
};
|