@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.
Files changed (214) hide show
  1. package/README.md +255 -2
  2. package/dist/index.d.ts +1013 -0
  3. package/dist/parts/WdAffix.js +159 -0
  4. package/dist/parts/WdAiMessage.js +277 -0
  5. package/dist/parts/WdAlert.js +92 -0
  6. package/dist/parts/WdAnchor.js +159 -0
  7. package/dist/parts/WdAudioPlayer.js +1024 -0
  8. package/dist/parts/WdAvatar.js +6 -0
  9. package/dist/parts/WdAvatarGroup.js +46 -0
  10. package/dist/parts/WdBacktop.js +120 -0
  11. package/dist/parts/WdBadge.js +61 -0
  12. package/dist/parts/WdBento.js +40 -0
  13. package/dist/parts/WdBentoItem.js +43 -0
  14. package/dist/parts/WdBottomSheet.js +263 -0
  15. package/dist/parts/WdBreadcrumb.js +64 -0
  16. package/dist/parts/WdButton.js +94 -0
  17. package/dist/parts/WdCalendar.js +11 -0
  18. package/dist/parts/WdCard.js +113 -0
  19. package/dist/parts/WdCarousel.js +365 -0
  20. package/dist/parts/WdCascader.js +386 -0
  21. package/dist/parts/WdCheckbox.js +81 -0
  22. package/dist/parts/WdCollapse.js +135 -0
  23. package/dist/parts/WdColorPicker.js +592 -0
  24. package/dist/parts/WdCommand.js +357 -0
  25. package/dist/parts/WdContainer.js +37 -0
  26. package/dist/parts/WdCountdown.js +163 -0
  27. package/dist/parts/WdDanmaku.js +6 -0
  28. package/dist/parts/WdDatePicker.js +169 -0
  29. package/dist/parts/WdDateTimePicker.js +162 -0
  30. package/dist/parts/WdDescriptions.js +146 -0
  31. package/dist/parts/WdDivider.js +64 -0
  32. package/dist/parts/WdDrawer.js +176 -0
  33. package/dist/parts/WdDropdown.js +140 -0
  34. package/dist/parts/WdEmpty.js +79 -0
  35. package/dist/parts/WdExplorer.js +336 -0
  36. package/dist/parts/WdFileList.js +177 -0
  37. package/dist/parts/WdForm.js +111 -0
  38. package/dist/parts/WdFormItem.js +156 -0
  39. package/dist/parts/WdGrid.js +40 -0
  40. package/dist/parts/WdGroup.js +68 -0
  41. package/dist/parts/WdImagePreview.js +274 -0
  42. package/dist/parts/WdInput.js +10 -0
  43. package/dist/parts/WdInputNumber.js +253 -0
  44. package/dist/parts/WdListItem.js +60 -0
  45. package/dist/parts/WdLoading.js +128 -0
  46. package/dist/parts/WdMarkdown.js +172 -0
  47. package/dist/parts/WdMarquee.js +80 -0
  48. package/dist/parts/WdMasonry.js +40 -0
  49. package/dist/parts/WdMediaCard.js +302 -0
  50. package/dist/parts/WdMentions.js +277 -0
  51. package/dist/parts/WdModal.js +149 -0
  52. package/dist/parts/WdNav.js +311 -0
  53. package/dist/parts/WdNotification.js +112 -0
  54. package/dist/parts/WdOtp.js +107 -0
  55. package/dist/parts/WdPagination.js +252 -0
  56. package/dist/parts/WdPopconfirm.js +214 -0
  57. package/dist/parts/WdPopover.js +203 -0
  58. package/dist/parts/WdPostItem.js +84 -0
  59. package/dist/parts/WdProgress.js +48 -0
  60. package/dist/parts/WdProgressRing.js +101 -0
  61. package/dist/parts/WdPullRefresh.js +167 -0
  62. package/dist/parts/WdQRCode.js +1909 -0
  63. package/dist/parts/WdRadioGroup.js +95 -0
  64. package/dist/parts/WdRate.js +128 -0
  65. package/dist/parts/WdResult.js +86 -0
  66. package/dist/parts/WdScrollbar.js +186 -0
  67. package/dist/parts/WdSegmented.js +11 -0
  68. package/dist/parts/WdSelect.js +465 -0
  69. package/dist/parts/WdSkeleton.js +69 -0
  70. package/dist/parts/WdSlider.js +100 -0
  71. package/dist/parts/WdSortableList.js +291 -0
  72. package/dist/parts/WdSpace.js +46 -0
  73. package/dist/parts/WdSparkline.js +148 -0
  74. package/dist/parts/WdSpinner.js +6 -0
  75. package/dist/parts/WdSplitter.js +183 -0
  76. package/dist/parts/WdStatBar.js +202 -0
  77. package/dist/parts/WdStatistic.js +131 -0
  78. package/dist/parts/WdSteps.js +110 -0
  79. package/dist/parts/WdSwitch.js +63 -0
  80. package/dist/parts/WdTabBar.js +84 -0
  81. package/dist/parts/WdTable.js +589 -0
  82. package/dist/parts/WdTabs.js +219 -0
  83. package/dist/parts/WdTag.js +6 -0
  84. package/dist/parts/WdTagInput.js +181 -0
  85. package/dist/parts/WdTimePicker.js +12 -0
  86. package/dist/parts/WdTimeline.js +145 -0
  87. package/dist/parts/WdTooltip.js +108 -0
  88. package/dist/parts/WdTour.js +264 -0
  89. package/dist/parts/WdTransfer.js +446 -0
  90. package/dist/parts/WdTree.js +322 -0
  91. package/dist/parts/WdUpload.js +309 -0
  92. package/dist/parts/WdVideoPlayer.js +1006 -0
  93. package/dist/parts/WdVirtualList.js +169 -0
  94. package/dist/parts/WdWatermark.js +150 -0
  95. package/dist/parts/chunk-3LVE72ZK.js +361 -0
  96. package/dist/parts/chunk-5HYOQ52I.js +101 -0
  97. package/dist/parts/chunk-7M3MUL3B.js +275 -0
  98. package/dist/parts/chunk-AOTJ63HN.js +15 -0
  99. package/dist/parts/chunk-AXEF2U2A.js +41 -0
  100. package/dist/parts/chunk-CY3QOSFP.js +645 -0
  101. package/dist/parts/chunk-G7NN4A6J.js +40 -0
  102. package/dist/parts/chunk-HAKYCUAR.js +9 -0
  103. package/dist/parts/chunk-JDE4AHBR.js +160 -0
  104. package/dist/parts/chunk-LT3NTWIT.js +117 -0
  105. package/dist/parts/chunk-OGHYFT7B.js +387 -0
  106. package/dist/parts/chunk-Q34U2HES.js +261 -0
  107. package/dist/parts/chunk-RLSVPJHM.js +10 -0
  108. package/dist/parts/chunk-U2CDKD2T.js +30 -0
  109. package/dist/parts/chunk-UYUNYHZD.js +40 -0
  110. package/dist/parts/chunk-VUJL2HGD.js +23 -0
  111. package/dist/parts/chunk-WCFG5KNT.js +51 -0
  112. package/dist/parts/chunk-WDDAALPI.js +42 -0
  113. package/dist/parts/chunk-WFXLDBP2.js +149 -0
  114. package/dist/style/affix.css +566 -0
  115. package/dist/style/ai-msg.css +746 -0
  116. package/dist/style/alert.css +636 -0
  117. package/dist/style/anchor.css +630 -0
  118. package/dist/style/audio.css +1954 -0
  119. package/dist/style/avatar.css +651 -0
  120. package/dist/style/backtop.css +625 -0
  121. package/dist/style/badge.css +632 -0
  122. package/dist/style/bento.css +763 -0
  123. package/dist/style/bottom-sheet.css +776 -0
  124. package/dist/style/breadcrumb.css +629 -0
  125. package/dist/style/button.css +829 -0
  126. package/dist/style/calendar.css +1512 -0
  127. package/dist/style/card.css +748 -0
  128. package/dist/style/carousel.css +670 -0
  129. package/dist/style/cascader.css +862 -0
  130. package/dist/style/checkbox.css +706 -0
  131. package/dist/style/chevron.css +575 -0
  132. package/dist/style/collapse.css +648 -0
  133. package/dist/style/colorpicker.css +876 -0
  134. package/dist/style/command.css +760 -0
  135. package/dist/style/container.css +550 -0
  136. package/dist/style/countdown.css +722 -0
  137. package/dist/style/danmaku.css +644 -0
  138. package/dist/style/datepicker.css +683 -0
  139. package/dist/style/datetime-picker.css +714 -0
  140. package/dist/style/descriptions.css +712 -0
  141. package/dist/style/divider.css +604 -0
  142. package/dist/style/dot.css +585 -0
  143. package/dist/style/drawer.css +743 -0
  144. package/dist/style/dropdown.css +645 -0
  145. package/dist/style/empty.css +657 -0
  146. package/dist/style/explorer.css +944 -0
  147. package/dist/style/file-list.css +664 -0
  148. package/dist/style/flip.css +600 -0
  149. package/dist/style/form.css +638 -0
  150. package/dist/style/grid.css +618 -0
  151. package/dist/style/group.css +1022 -0
  152. package/dist/style/icon-btn.css +641 -0
  153. package/dist/style/image-preview.css +725 -0
  154. package/dist/style/input-number.css +680 -0
  155. package/dist/style/input.css +682 -0
  156. package/dist/style/list.css +630 -0
  157. package/dist/style/loading.css +667 -0
  158. package/dist/style/markdown.css +884 -0
  159. package/dist/style/marquee.css +678 -0
  160. package/dist/style/masonry.css +614 -0
  161. package/dist/style/media-card.css +1229 -0
  162. package/dist/style/mentions.css +690 -0
  163. package/dist/style/modal.css +775 -0
  164. package/dist/style/nav.css +1046 -0
  165. package/dist/style/notification.css +601 -0
  166. package/dist/style/otp.css +699 -0
  167. package/dist/style/pagination.css +680 -0
  168. package/dist/style/popconfirm.css +645 -0
  169. package/dist/style/popover.css +740 -0
  170. package/dist/style/post-item.css +676 -0
  171. package/dist/style/progress-ring.css +640 -0
  172. package/dist/style/progress.css +576 -0
  173. package/dist/style/pull-refresh.css +637 -0
  174. package/dist/style/qrcode.css +613 -0
  175. package/dist/style/radio.css +705 -0
  176. package/dist/style/rate.css +637 -0
  177. package/dist/style/result.css +597 -0
  178. package/dist/style/scroll-reveal.css +613 -0
  179. package/dist/style/scrollbar.css +644 -0
  180. package/dist/style/segmented-picker.css +679 -0
  181. package/dist/style/segmented.css +894 -0
  182. package/dist/style/select.css +937 -0
  183. package/dist/style/skeleton.css +590 -0
  184. package/dist/style/slider.css +642 -0
  185. package/dist/style/sortable.css +714 -0
  186. package/dist/style/space.css +568 -0
  187. package/dist/style/sparkline.css +606 -0
  188. package/dist/style/spinner.css +586 -0
  189. package/dist/style/splitter.css +711 -0
  190. package/dist/style/stat-bar.css +767 -0
  191. package/dist/style/statistic.css +589 -0
  192. package/dist/style/steps.css +724 -0
  193. package/dist/style/switch.css +676 -0
  194. package/dist/style/tab-bar.css +647 -0
  195. package/dist/style/table.css +1229 -0
  196. package/dist/style/tabs.css +756 -0
  197. package/dist/style/tag-input.css +710 -0
  198. package/dist/style/tag.css +682 -0
  199. package/dist/style/time-picker.css +749 -0
  200. package/dist/style/timeline.css +1082 -0
  201. package/dist/style/toast.css +598 -0
  202. package/dist/style/tooltip.css +604 -0
  203. package/dist/style/tour.css +683 -0
  204. package/dist/style/transfer.css +858 -0
  205. package/dist/style/tree.css +786 -0
  206. package/dist/style/typography.css +947 -0
  207. package/dist/style/upload.css +758 -0
  208. package/dist/style/vlist.css +591 -0
  209. package/dist/style/vplayer.css +1588 -0
  210. package/dist/style/watermark.css +570 -0
  211. package/dist/wdesign-ui.css +21093 -0
  212. package/dist/wdesign-ui.esm.js +20265 -0
  213. package/package.json +134 -4
  214. package/tokens.json +385 -0
@@ -0,0 +1,6 @@
1
+ import {
2
+ WdAvatar_default
3
+ } from "./chunk-WCFG5KNT.js";
4
+ export {
5
+ WdAvatar_default as WdAvatar
6
+ };
@@ -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
+ };