@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,202 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WdIcon_default
|
|
3
|
+
} from "./chunk-Q34U2HES.js";
|
|
4
|
+
|
|
5
|
+
// .lib-build/WdStatBar.ts
|
|
6
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
7
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, unref as _unref, createVNode as _createVNode, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass } from "vue";
|
|
8
|
+
import { ref, watch, onMounted, onUnmounted } from "vue";
|
|
9
|
+
var _hoisted_1 = { class: "wd-stat-bar__value" };
|
|
10
|
+
var _hoisted_2 = { class: "wd-stat-bar__figure" };
|
|
11
|
+
var _hoisted_3 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "wd-stat-bar__affix"
|
|
14
|
+
};
|
|
15
|
+
var _hoisted_4 = { class: "wd-stat-bar__num" };
|
|
16
|
+
var _hoisted_5 = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "wd-stat-bar__affix"
|
|
19
|
+
};
|
|
20
|
+
var _hoisted_6 = { class: "wd-stat-bar__label" };
|
|
21
|
+
var WdStatBar_default = /* @__PURE__ */ _defineComponent({
|
|
22
|
+
...{ name: "WdStatBar" },
|
|
23
|
+
__name: "WdStatBar",
|
|
24
|
+
props: {
|
|
25
|
+
items: { type: Array, required: true },
|
|
26
|
+
size: { type: String, required: false, default: "md" },
|
|
27
|
+
surface: { type: Boolean, required: false, default: true },
|
|
28
|
+
countUp: { type: Boolean, required: false, default: false },
|
|
29
|
+
countDuration: { type: Number, required: false, default: 900 }
|
|
30
|
+
},
|
|
31
|
+
setup(__props) {
|
|
32
|
+
const props = __props;
|
|
33
|
+
const shown = ref(
|
|
34
|
+
(props.items || []).map((it) => typeof it.value === "number" ? 0 : 0)
|
|
35
|
+
);
|
|
36
|
+
const rootEl = ref(null);
|
|
37
|
+
let rafId = 0;
|
|
38
|
+
let io;
|
|
39
|
+
function targets() {
|
|
40
|
+
return props.items.map((it) => typeof it.value === "number" ? it.value : null);
|
|
41
|
+
}
|
|
42
|
+
function finish() {
|
|
43
|
+
shown.value = props.items.map((it) => typeof it.value === "number" ? it.value : 0);
|
|
44
|
+
}
|
|
45
|
+
function easeOut(t) {
|
|
46
|
+
return 1 - Math.pow(1 - t, 3);
|
|
47
|
+
}
|
|
48
|
+
function run() {
|
|
49
|
+
if (!props.countUp) {
|
|
50
|
+
finish();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const reduced = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
54
|
+
if (reduced) {
|
|
55
|
+
finish();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const tgt = targets();
|
|
59
|
+
const dur = Math.max(200, props.countDuration);
|
|
60
|
+
const t0 = performance.now();
|
|
61
|
+
shown.value = tgt.map(() => 0);
|
|
62
|
+
const step = (now) => {
|
|
63
|
+
const p = Math.min(1, (now - t0) / dur);
|
|
64
|
+
const k = easeOut(p);
|
|
65
|
+
shown.value = tgt.map((v) => v === null ? 0 : Math.round(v * k));
|
|
66
|
+
if (p < 1) rafId = requestAnimationFrame(step);
|
|
67
|
+
else finish();
|
|
68
|
+
};
|
|
69
|
+
rafId = requestAnimationFrame(step);
|
|
70
|
+
}
|
|
71
|
+
function stop() {
|
|
72
|
+
if (rafId) {
|
|
73
|
+
cancelAnimationFrame(rafId);
|
|
74
|
+
rafId = 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
onMounted(() => {
|
|
78
|
+
if (!props.countUp) {
|
|
79
|
+
finish();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
83
|
+
finish();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
io = new IntersectionObserver(
|
|
87
|
+
(entries) => {
|
|
88
|
+
for (const e of entries) {
|
|
89
|
+
if (e.isIntersecting) {
|
|
90
|
+
run();
|
|
91
|
+
io?.disconnect();
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{ threshold: 0.4 }
|
|
97
|
+
);
|
|
98
|
+
if (rootEl.value) io.observe(rootEl.value);
|
|
99
|
+
});
|
|
100
|
+
onUnmounted(() => {
|
|
101
|
+
stop();
|
|
102
|
+
io?.disconnect();
|
|
103
|
+
});
|
|
104
|
+
watch(() => props.items, () => {
|
|
105
|
+
finish();
|
|
106
|
+
}, { deep: true });
|
|
107
|
+
function group(n) {
|
|
108
|
+
const [int, dec] = String(Math.abs(n)).split(".");
|
|
109
|
+
const sign = n < 0 ? "-" : "";
|
|
110
|
+
const grouped = int.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
111
|
+
return sign + grouped + (dec ? "." + dec : "");
|
|
112
|
+
}
|
|
113
|
+
function display(i, v) {
|
|
114
|
+
if (typeof v !== "number") return v;
|
|
115
|
+
const cur = shown.value[i];
|
|
116
|
+
return group(cur === void 0 ? v : cur);
|
|
117
|
+
}
|
|
118
|
+
return (_ctx, _cache) => {
|
|
119
|
+
return _openBlock(), _createElementBlock(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
ref_key: "rootEl",
|
|
123
|
+
ref: rootEl,
|
|
124
|
+
class: _normalizeClass(["wd-stat-bar", [`wd-stat-bar--${__props.size}`, { "wd-stat-bar--surface": __props.surface }]])
|
|
125
|
+
},
|
|
126
|
+
[
|
|
127
|
+
(_openBlock(true), _createElementBlock(
|
|
128
|
+
_Fragment,
|
|
129
|
+
null,
|
|
130
|
+
_renderList(__props.items, (it, i) => {
|
|
131
|
+
return _openBlock(), _createElementBlock("div", {
|
|
132
|
+
key: i,
|
|
133
|
+
class: "wd-stat-bar__item"
|
|
134
|
+
}, [
|
|
135
|
+
_createElementVNode("div", _hoisted_1, [
|
|
136
|
+
_createCommentVNode("\n \u26A0\uFE0F prefix / num / suffix \u5FC5\u987B\u5305\u5728\u540C\u4E00\u4E2A\u4E0D\u53EF\u62C6\u5206\u76D2\u5B50\u91CC\u3002\n \u7B2C 189 \u8F6E\u5B9E\u6D4B\uFF1A\u4E09\u8005\u662F\u5E76\u5217 flex \u9879\uFF0C\u914D\u5408 flex-wrap: wrap \u4E4B\u540E\uFF0C\n \u7A84\u5C4F\uFF08390px\uFF09\u4E0A\u300C\xA5\u300D\u88AB\u5355\u72EC\u6324\u5230\u7B2C\u4E00\u884C\uFF0C\u300C1,284\u300D\u843D\u5230\u7B2C\u4E8C\u884C \u2014\u2014\n \u8D27\u5E01\u7B26\u53F7\u548C\u6570\u5B57\u5206\u5BB6\u4E86\uFF0C\u770B\u8D77\u6765\u50CF\u6392\u7248\u574F\u4E86\u3002\n \u5305\u4E00\u5C42\u540E\u53EA\u6709\u300C\u6574\u4E2A\u6570\u503C\u300D\u548C\u300C\u73AF\u6BD4\u80F6\u56CA\u300D\u4E4B\u95F4\u53EF\u4EE5\u6362\u884C\uFF0C\u8FD9\u624D\u662F\u5BF9\u7684\u3002\n "),
|
|
137
|
+
_createElementVNode("span", _hoisted_2, [
|
|
138
|
+
it.prefix ? (_openBlock(), _createElementBlock(
|
|
139
|
+
"span",
|
|
140
|
+
_hoisted_3,
|
|
141
|
+
_toDisplayString(it.prefix),
|
|
142
|
+
1
|
|
143
|
+
/* TEXT */
|
|
144
|
+
)) : _createCommentVNode("v-if", true),
|
|
145
|
+
_createElementVNode(
|
|
146
|
+
"span",
|
|
147
|
+
_hoisted_4,
|
|
148
|
+
_toDisplayString(display(i, it.value)),
|
|
149
|
+
1
|
|
150
|
+
/* TEXT */
|
|
151
|
+
),
|
|
152
|
+
it.suffix ? (_openBlock(), _createElementBlock(
|
|
153
|
+
"span",
|
|
154
|
+
_hoisted_5,
|
|
155
|
+
_toDisplayString(it.suffix),
|
|
156
|
+
1
|
|
157
|
+
/* TEXT */
|
|
158
|
+
)) : _createCommentVNode("v-if", true)
|
|
159
|
+
]),
|
|
160
|
+
it.trend ? (_openBlock(), _createElementBlock(
|
|
161
|
+
"span",
|
|
162
|
+
{
|
|
163
|
+
key: 0,
|
|
164
|
+
class: _normalizeClass(["wd-stat-bar__trend", `wd-stat-bar__trend--${it.dir || "up"}`])
|
|
165
|
+
},
|
|
166
|
+
[
|
|
167
|
+
_createVNode(_unref(WdIcon_default), {
|
|
168
|
+
name: it.dir === "down" ? "arrow-down-right" : "arrow-up-right",
|
|
169
|
+
size: 11
|
|
170
|
+
}, null, 8, ["name"]),
|
|
171
|
+
_createTextVNode(
|
|
172
|
+
" " + _toDisplayString(it.trend),
|
|
173
|
+
1
|
|
174
|
+
/* TEXT */
|
|
175
|
+
)
|
|
176
|
+
],
|
|
177
|
+
2
|
|
178
|
+
/* CLASS */
|
|
179
|
+
)) : _createCommentVNode("v-if", true)
|
|
180
|
+
]),
|
|
181
|
+
_createElementVNode(
|
|
182
|
+
"p",
|
|
183
|
+
_hoisted_6,
|
|
184
|
+
_toDisplayString(it.label),
|
|
185
|
+
1
|
|
186
|
+
/* TEXT */
|
|
187
|
+
)
|
|
188
|
+
]);
|
|
189
|
+
}),
|
|
190
|
+
128
|
|
191
|
+
/* KEYED_FRAGMENT */
|
|
192
|
+
))
|
|
193
|
+
],
|
|
194
|
+
2
|
|
195
|
+
/* CLASS */
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
export {
|
|
201
|
+
WdStatBar_default as WdStatBar
|
|
202
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// .lib-build/WdStatistic.ts
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, renderSlot as _renderSlot } from "vue";
|
|
4
|
+
import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";
|
|
5
|
+
var _hoisted_1 = { class: "wd-statistic" };
|
|
6
|
+
var _hoisted_2 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "wd-statistic__title"
|
|
9
|
+
};
|
|
10
|
+
var _hoisted_3 = { class: "wd-statistic__value" };
|
|
11
|
+
var _hoisted_4 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "wd-statistic__affix"
|
|
14
|
+
};
|
|
15
|
+
var _hoisted_5 = { class: "wd-statistic__num" };
|
|
16
|
+
var _hoisted_6 = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "wd-statistic__affix wd-statistic__affix--suffix"
|
|
19
|
+
};
|
|
20
|
+
var _hoisted_7 = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "wd-statistic__footer"
|
|
23
|
+
};
|
|
24
|
+
var WdStatistic_default = /* @__PURE__ */ _defineComponent({
|
|
25
|
+
...{ name: "WdStatistic" },
|
|
26
|
+
__name: "WdStatistic",
|
|
27
|
+
props: {
|
|
28
|
+
value: { type: Number, required: false, default: 0 },
|
|
29
|
+
title: { type: String, required: false, default: "" },
|
|
30
|
+
prefix: { type: String, required: false, default: "" },
|
|
31
|
+
suffix: { type: String, required: false, default: "" },
|
|
32
|
+
precision: { type: Number, required: false, default: 0 },
|
|
33
|
+
separator: { type: Boolean, required: false, default: true },
|
|
34
|
+
animated: { type: Boolean, required: false, default: true },
|
|
35
|
+
duration: { type: Number, required: false, default: 900 }
|
|
36
|
+
},
|
|
37
|
+
setup(__props) {
|
|
38
|
+
const props = __props;
|
|
39
|
+
const shown = ref(props.animated ? 0 : props.value);
|
|
40
|
+
let raf = 0;
|
|
41
|
+
let startAt = 0;
|
|
42
|
+
const from = ref(0);
|
|
43
|
+
const REDUCE = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
44
|
+
let fallback;
|
|
45
|
+
function animateTo(to) {
|
|
46
|
+
cancelAnimationFrame(raf);
|
|
47
|
+
if (fallback) window.clearTimeout(fallback);
|
|
48
|
+
if (!props.animated || REDUCE()) {
|
|
49
|
+
shown.value = to;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
from.value = shown.value;
|
|
53
|
+
startAt = 0;
|
|
54
|
+
fallback = window.setTimeout(() => {
|
|
55
|
+
cancelAnimationFrame(raf);
|
|
56
|
+
shown.value = to;
|
|
57
|
+
}, props.duration + 120);
|
|
58
|
+
const step = (ts) => {
|
|
59
|
+
if (!startAt) startAt = ts;
|
|
60
|
+
const t = Math.min(1, (ts - startAt) / props.duration);
|
|
61
|
+
const e = t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
|
|
62
|
+
shown.value = from.value + (to - from.value) * e;
|
|
63
|
+
if (t < 1) raf = requestAnimationFrame(step);
|
|
64
|
+
else {
|
|
65
|
+
shown.value = to;
|
|
66
|
+
if (fallback) {
|
|
67
|
+
window.clearTimeout(fallback);
|
|
68
|
+
fallback = void 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
raf = requestAnimationFrame(step);
|
|
73
|
+
}
|
|
74
|
+
onMounted(() => {
|
|
75
|
+
if (props.animated) animateTo(props.value);
|
|
76
|
+
else shown.value = props.value;
|
|
77
|
+
});
|
|
78
|
+
onBeforeUnmount(() => {
|
|
79
|
+
cancelAnimationFrame(raf);
|
|
80
|
+
if (fallback) window.clearTimeout(fallback);
|
|
81
|
+
});
|
|
82
|
+
watch(() => props.value, (v) => animateTo(v));
|
|
83
|
+
const text = computed(() => {
|
|
84
|
+
const fixed = Math.abs(shown.value).toFixed(props.precision);
|
|
85
|
+
let [int, dec] = fixed.split(".");
|
|
86
|
+
if (props.separator) int = int.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
87
|
+
const sign = shown.value < 0 ? "-" : "";
|
|
88
|
+
return sign + int + (dec ? "." + dec : "");
|
|
89
|
+
});
|
|
90
|
+
return (_ctx, _cache) => {
|
|
91
|
+
return _openBlock(), _createElementBlock("div", _hoisted_1, [
|
|
92
|
+
__props.title ? (_openBlock(), _createElementBlock(
|
|
93
|
+
"div",
|
|
94
|
+
_hoisted_2,
|
|
95
|
+
_toDisplayString(__props.title),
|
|
96
|
+
1
|
|
97
|
+
/* TEXT */
|
|
98
|
+
)) : _createCommentVNode("v-if", true),
|
|
99
|
+
_createElementVNode("div", _hoisted_3, [
|
|
100
|
+
__props.prefix ? (_openBlock(), _createElementBlock(
|
|
101
|
+
"span",
|
|
102
|
+
_hoisted_4,
|
|
103
|
+
_toDisplayString(__props.prefix),
|
|
104
|
+
1
|
|
105
|
+
/* TEXT */
|
|
106
|
+
)) : _createCommentVNode("v-if", true),
|
|
107
|
+
_createElementVNode(
|
|
108
|
+
"span",
|
|
109
|
+
_hoisted_5,
|
|
110
|
+
_toDisplayString(text.value),
|
|
111
|
+
1
|
|
112
|
+
/* TEXT */
|
|
113
|
+
),
|
|
114
|
+
__props.suffix ? (_openBlock(), _createElementBlock(
|
|
115
|
+
"span",
|
|
116
|
+
_hoisted_6,
|
|
117
|
+
_toDisplayString(__props.suffix),
|
|
118
|
+
1
|
|
119
|
+
/* TEXT */
|
|
120
|
+
)) : _createCommentVNode("v-if", true)
|
|
121
|
+
]),
|
|
122
|
+
_ctx.$slots.footer ? (_openBlock(), _createElementBlock("div", _hoisted_7, [
|
|
123
|
+
_renderSlot(_ctx.$slots, "footer")
|
|
124
|
+
])) : _createCommentVNode("v-if", true)
|
|
125
|
+
]);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
export {
|
|
130
|
+
WdStatistic_default as WdStatistic
|
|
131
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WdIcon_default
|
|
3
|
+
} from "./chunk-Q34U2HES.js";
|
|
4
|
+
|
|
5
|
+
// .lib-build/WdSteps.ts
|
|
6
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
7
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from "vue";
|
|
8
|
+
import { computed } from "vue";
|
|
9
|
+
var _hoisted_1 = { class: "wd-steps" };
|
|
10
|
+
var _hoisted_2 = { class: "wd-steps__dot" };
|
|
11
|
+
var _hoisted_3 = { class: "wd-steps__label" };
|
|
12
|
+
var _hoisted_4 = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "wd-steps__desc"
|
|
15
|
+
};
|
|
16
|
+
var WdSteps_default = /* @__PURE__ */ _defineComponent({
|
|
17
|
+
...{ name: "WdSteps" },
|
|
18
|
+
__name: "WdSteps",
|
|
19
|
+
props: {
|
|
20
|
+
steps: { type: Array, required: false, default: () => [] },
|
|
21
|
+
current: { type: Number, required: false, default: 0 }
|
|
22
|
+
},
|
|
23
|
+
setup(__props) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const items = computed(
|
|
26
|
+
() => props.steps.map((s) => typeof s === "string" ? { title: s, desc: "" } : { desc: "", ...s })
|
|
27
|
+
);
|
|
28
|
+
function state(i) {
|
|
29
|
+
if (i < props.current) return "finish";
|
|
30
|
+
if (i === props.current) return "process";
|
|
31
|
+
return "wait";
|
|
32
|
+
}
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return _openBlock(), _createElementBlock("div", _hoisted_1, [
|
|
35
|
+
(_openBlock(true), _createElementBlock(
|
|
36
|
+
_Fragment,
|
|
37
|
+
null,
|
|
38
|
+
_renderList(items.value, (s, i) => {
|
|
39
|
+
return _openBlock(), _createElementBlock(
|
|
40
|
+
_Fragment,
|
|
41
|
+
{ key: i },
|
|
42
|
+
[
|
|
43
|
+
_createElementVNode(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
class: _normalizeClass(["wd-steps__item", `wd-steps__item--${state(i)}`])
|
|
47
|
+
},
|
|
48
|
+
[
|
|
49
|
+
_createElementVNode("span", _hoisted_2, [
|
|
50
|
+
state(i) === "finish" ? (_openBlock(), _createBlock(_unref(WdIcon_default), {
|
|
51
|
+
key: 0,
|
|
52
|
+
name: "check",
|
|
53
|
+
size: 13
|
|
54
|
+
})) : (_openBlock(), _createElementBlock(
|
|
55
|
+
_Fragment,
|
|
56
|
+
{ key: 1 },
|
|
57
|
+
[
|
|
58
|
+
_createTextVNode(
|
|
59
|
+
_toDisplayString(i + 1),
|
|
60
|
+
1
|
|
61
|
+
/* TEXT */
|
|
62
|
+
)
|
|
63
|
+
],
|
|
64
|
+
64
|
|
65
|
+
/* STABLE_FRAGMENT */
|
|
66
|
+
))
|
|
67
|
+
]),
|
|
68
|
+
_createElementVNode("span", _hoisted_3, [
|
|
69
|
+
_createTextVNode(
|
|
70
|
+
_toDisplayString(s.title) + " ",
|
|
71
|
+
1
|
|
72
|
+
/* TEXT */
|
|
73
|
+
),
|
|
74
|
+
s.desc ? (_openBlock(), _createElementBlock(
|
|
75
|
+
"em",
|
|
76
|
+
_hoisted_4,
|
|
77
|
+
_toDisplayString(s.desc),
|
|
78
|
+
1
|
|
79
|
+
/* TEXT */
|
|
80
|
+
)) : _createCommentVNode("v-if", true)
|
|
81
|
+
])
|
|
82
|
+
],
|
|
83
|
+
2
|
|
84
|
+
/* CLASS */
|
|
85
|
+
),
|
|
86
|
+
i < items.value.length - 1 ? (_openBlock(), _createElementBlock(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
key: 0,
|
|
90
|
+
class: _normalizeClass(["wd-steps__bar", { "wd-steps__bar--done": i < __props.current }])
|
|
91
|
+
},
|
|
92
|
+
null,
|
|
93
|
+
2
|
|
94
|
+
/* CLASS */
|
|
95
|
+
)) : _createCommentVNode("v-if", true)
|
|
96
|
+
],
|
|
97
|
+
64
|
|
98
|
+
/* STABLE_FRAGMENT */
|
|
99
|
+
);
|
|
100
|
+
}),
|
|
101
|
+
128
|
|
102
|
+
/* KEYED_FRAGMENT */
|
|
103
|
+
))
|
|
104
|
+
]);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
export {
|
|
109
|
+
WdSteps_default as WdSteps
|
|
110
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useControllable
|
|
3
|
+
} from "./chunk-G7NN4A6J.js";
|
|
4
|
+
import {
|
|
5
|
+
useFormItemA11y
|
|
6
|
+
} from "./chunk-VUJL2HGD.js";
|
|
7
|
+
import "./chunk-UYUNYHZD.js";
|
|
8
|
+
|
|
9
|
+
// .lib-build/WdSwitch.ts
|
|
10
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
11
|
+
import { unref as _unref, createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
12
|
+
import { computed } from "vue";
|
|
13
|
+
var _hoisted_1 = ["aria-checked", "data-controlled", "disabled"];
|
|
14
|
+
var WdSwitch_default = /* @__PURE__ */ _defineComponent({
|
|
15
|
+
...{ name: "WdSwitch" },
|
|
16
|
+
__name: "WdSwitch",
|
|
17
|
+
props: {
|
|
18
|
+
modelValue: { type: Boolean, required: false },
|
|
19
|
+
defaultValue: { type: Boolean, required: false },
|
|
20
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
21
|
+
},
|
|
22
|
+
emits: ["update:modelValue", "change"],
|
|
23
|
+
setup(__props, { emit: __emit }) {
|
|
24
|
+
const formA11y = useFormItemA11y();
|
|
25
|
+
const props = __props;
|
|
26
|
+
const emit = __emit;
|
|
27
|
+
const { value, set, controlled } = useControllable({
|
|
28
|
+
modelValue: computed(() => props.modelValue),
|
|
29
|
+
defaultValue: computed(() => props.defaultValue),
|
|
30
|
+
fallback: false,
|
|
31
|
+
onChange: (v) => {
|
|
32
|
+
emit("update:modelValue", v);
|
|
33
|
+
emit("change", v);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
function toggle() {
|
|
37
|
+
if (!props.disabled) set(!value.value);
|
|
38
|
+
}
|
|
39
|
+
return (_ctx, _cache) => {
|
|
40
|
+
return _openBlock(), _createElementBlock("button", _mergeProps({
|
|
41
|
+
type: "button",
|
|
42
|
+
role: "switch",
|
|
43
|
+
class: ["wd-switch", { "wd-switch--off": !_unref(value) }],
|
|
44
|
+
"aria-checked": _unref(value)
|
|
45
|
+
}, _unref(formA11y).attrs.value, {
|
|
46
|
+
"data-controlled": _unref(controlled) ? "true" : "false",
|
|
47
|
+
disabled: __props.disabled,
|
|
48
|
+
onClick: toggle
|
|
49
|
+
}), [..._cache[0] || (_cache[0] = [
|
|
50
|
+
_createElementVNode(
|
|
51
|
+
"span",
|
|
52
|
+
{ class: "wd-switch__knob" },
|
|
53
|
+
null,
|
|
54
|
+
-1
|
|
55
|
+
/* CACHED */
|
|
56
|
+
)
|
|
57
|
+
])], 16, _hoisted_1);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
WdSwitch_default as WdSwitch
|
|
63
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WdSegmented_default
|
|
3
|
+
} from "./chunk-3LVE72ZK.js";
|
|
4
|
+
import "./chunk-5HYOQ52I.js";
|
|
5
|
+
import "./chunk-WFXLDBP2.js";
|
|
6
|
+
import "./chunk-VUJL2HGD.js";
|
|
7
|
+
import "./chunk-UYUNYHZD.js";
|
|
8
|
+
import {
|
|
9
|
+
WdIcon_default
|
|
10
|
+
} from "./chunk-Q34U2HES.js";
|
|
11
|
+
|
|
12
|
+
// .lib-build/WdTabBar.ts
|
|
13
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
14
|
+
import { createVNode as _createVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass } from "vue";
|
|
15
|
+
import { computed } from "vue";
|
|
16
|
+
var WdTabBar_default = /* @__PURE__ */ _defineComponent({
|
|
17
|
+
...{ name: "WdTabBar" },
|
|
18
|
+
__name: "WdTabBar",
|
|
19
|
+
props: {
|
|
20
|
+
items: { type: Array, required: true },
|
|
21
|
+
modelValue: { type: String, required: false, default: "" },
|
|
22
|
+
floating: { type: Boolean, required: false, default: true },
|
|
23
|
+
fab: { type: Boolean, required: false, default: false },
|
|
24
|
+
fabIcon: { type: String, required: false, default: "plus" },
|
|
25
|
+
iconOnly: { type: Boolean, required: false, default: false }
|
|
26
|
+
},
|
|
27
|
+
emits: ["update:modelValue", "fab"],
|
|
28
|
+
setup(__props, { emit: __emit }) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const emit = __emit;
|
|
31
|
+
const options = computed(
|
|
32
|
+
() => props.items.map((it) => ({
|
|
33
|
+
label: it.label,
|
|
34
|
+
value: it.key,
|
|
35
|
+
icon: it.icon,
|
|
36
|
+
activeIcon: it.activeIcon,
|
|
37
|
+
badge: it.badge
|
|
38
|
+
}))
|
|
39
|
+
);
|
|
40
|
+
function onSelect(v) {
|
|
41
|
+
emit("update:modelValue", String(v));
|
|
42
|
+
}
|
|
43
|
+
return (_ctx, _cache) => {
|
|
44
|
+
return _openBlock(), _createElementBlock(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
class: _normalizeClass(["wd-tab-bar", {
|
|
48
|
+
"wd-tab-bar--floating": __props.floating,
|
|
49
|
+
"wd-tab-bar--with-fab": __props.fab,
|
|
50
|
+
"wd-tab-bar--icon-only": __props.iconOnly
|
|
51
|
+
}])
|
|
52
|
+
},
|
|
53
|
+
[
|
|
54
|
+
_createVNode(WdSegmented_default, {
|
|
55
|
+
class: "wd-tab-bar__seg",
|
|
56
|
+
"model-value": __props.modelValue,
|
|
57
|
+
options: options.value,
|
|
58
|
+
layout: "stack",
|
|
59
|
+
"icon-only": __props.iconOnly,
|
|
60
|
+
block: !__props.iconOnly,
|
|
61
|
+
"onUpdate:modelValue": onSelect
|
|
62
|
+
}, null, 8, ["model-value", "options", "icon-only", "block"]),
|
|
63
|
+
__props.fab ? (_openBlock(), _createElementBlock("button", {
|
|
64
|
+
key: 0,
|
|
65
|
+
type: "button",
|
|
66
|
+
class: "wd-tab-bar__fab",
|
|
67
|
+
"aria-label": "\u65B0\u5EFA",
|
|
68
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("fab"))
|
|
69
|
+
}, [
|
|
70
|
+
_createVNode(_unref(WdIcon_default), {
|
|
71
|
+
name: __props.fabIcon,
|
|
72
|
+
size: 24
|
|
73
|
+
}, null, 8, ["name"])
|
|
74
|
+
])) : _createCommentVNode("v-if", true)
|
|
75
|
+
],
|
|
76
|
+
2
|
|
77
|
+
/* CLASS */
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
export {
|
|
83
|
+
WdTabBar_default as WdTabBar
|
|
84
|
+
};
|