@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,219 @@
1
+ import {
2
+ useControllable
3
+ } from "./chunk-G7NN4A6J.js";
4
+ import {
5
+ WdIcon_default
6
+ } from "./chunk-Q34U2HES.js";
7
+
8
+ // .lib-build/WdTabs.ts
9
+ import { defineComponent as _defineComponent } from "vue";
10
+ import { createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createVNode as _createVNode, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, mergeProps as _mergeProps } from "vue";
11
+ import { computed, nextTick, onMounted, ref, watch } from "vue";
12
+ var _hoisted_1 = ["aria-selected", "disabled", "tabindex", "onClick"];
13
+ var _hoisted_2 = { class: "wd-tabs__label" };
14
+ var _hoisted_3 = ["aria-label", "onClick"];
15
+ var _hoisted_4 = {
16
+ key: 0,
17
+ class: "wd-tabs__panel",
18
+ role: "tabpanel"
19
+ };
20
+ var WdTabs_default = /* @__PURE__ */ _defineComponent({
21
+ ...{ name: "WdTabs" },
22
+ __name: "WdTabs",
23
+ props: {
24
+ modelValue: { type: [String, Number], required: false },
25
+ defaultValue: { type: [String, Number], required: false, default: "" },
26
+ tabs: { type: Array, required: false, default: () => [] },
27
+ block: { type: Boolean, required: false, default: false },
28
+ closable: { type: Boolean, required: false, default: false },
29
+ addable: { type: Boolean, required: false, default: false },
30
+ scrollable: { type: Boolean, required: false, default: true }
31
+ },
32
+ emits: ["update:modelValue", "close", "add", "change"],
33
+ setup(__props, { emit: __emit }) {
34
+ const props = __props;
35
+ const emit = __emit;
36
+ const { value: active, set: setActive } = useControllable({
37
+ modelValue: computed(() => props.modelValue),
38
+ defaultValue: computed(() => props.defaultValue),
39
+ fallback: "",
40
+ onChange: (v) => emit("update:modelValue", v)
41
+ });
42
+ const animReady = ref(false);
43
+ function select(v) {
44
+ animReady.value = true;
45
+ setActive(v);
46
+ emit("change", v);
47
+ }
48
+ const items = computed(
49
+ () => props.tabs.map((t) => {
50
+ const raw = typeof t === "string" ? { label: t, value: t } : t;
51
+ const canClose = "closable" in raw ? raw.closable === true : props.closable;
52
+ return { label: raw.label, value: raw.value, closable: canClose, disabled: raw.disabled === true };
53
+ })
54
+ );
55
+ const keyboardAnchor = computed(() => {
56
+ const list = items.value;
57
+ if (list.some((t) => t.value === active.value)) return active.value;
58
+ const firstEnabled = list.find((t) => !t.disabled);
59
+ return firstEnabled ? firstEnabled.value : list[0] && list[0].value;
60
+ });
61
+ function close(t, e) {
62
+ e.stopPropagation();
63
+ emit("close", t.value);
64
+ }
65
+ function onKeydown(e) {
66
+ const list = items.value.filter((t) => !t.disabled);
67
+ if (!list.length) return;
68
+ const cur = list.findIndex((t) => t.value === active.value);
69
+ let next = -1;
70
+ if (e.key === "ArrowRight") next = (cur + 1) % list.length;
71
+ else if (e.key === "ArrowLeft") next = (cur - 1 + list.length) % list.length;
72
+ else if (e.key === "Home") next = 0;
73
+ else if (e.key === "End") next = list.length - 1;
74
+ if (next < 0) return;
75
+ e.preventDefault();
76
+ select(list[next].value);
77
+ }
78
+ const root = ref(null);
79
+ const slider = ref(null);
80
+ const sliderReady = ref(false);
81
+ function updateSlider() {
82
+ const r = root.value;
83
+ const s = slider.value;
84
+ if (!r || !s) return;
85
+ const active2 = r.querySelector(".wd-tabs__item--active");
86
+ if (!active2) {
87
+ s.style.opacity = "0";
88
+ return;
89
+ }
90
+ s.style.opacity = "1";
91
+ s.style.width = active2.offsetWidth + "px";
92
+ s.style.height = active2.offsetHeight + "px";
93
+ s.style.transform = `translate(${active2.offsetLeft - s.offsetLeft}px, ${active2.offsetTop - s.offsetTop}px)`;
94
+ }
95
+ function settleSlider() {
96
+ if (sliderReady.value) return;
97
+ slider.value?.classList.remove("is-initial");
98
+ sliderReady.value = true;
99
+ }
100
+ onMounted(async () => {
101
+ slider.value?.classList.add("is-initial");
102
+ await nextTick();
103
+ updateSlider();
104
+ requestAnimationFrame(settleSlider);
105
+ window.setTimeout(settleSlider, 60);
106
+ window.addEventListener("resize", updateSlider);
107
+ });
108
+ watch(() => active.value, () => nextTick(updateSlider));
109
+ watch(() => props.tabs, () => nextTick(updateSlider), { deep: true });
110
+ return (_ctx, _cache) => {
111
+ return _openBlock(), _createElementBlock(
112
+ _Fragment,
113
+ null,
114
+ [
115
+ _createElementVNode(
116
+ "div",
117
+ _mergeProps({
118
+ ref_key: "root",
119
+ ref: root
120
+ }, _ctx.$attrs, {
121
+ class: ["wd-tabs", {
122
+ "wd-tabs--block": __props.block,
123
+ "wd-tabs--anim-ready": animReady.value,
124
+ "wd-tabs--scrollable": __props.scrollable,
125
+ "wd-tabs--closable": items.value.some((t) => t.closable)
126
+ }],
127
+ role: "tablist",
128
+ onKeydown
129
+ }),
130
+ [
131
+ _createElementVNode(
132
+ "span",
133
+ {
134
+ ref_key: "slider",
135
+ ref: slider,
136
+ class: "wd-tabs__slider"
137
+ },
138
+ null,
139
+ 512
140
+ /* NEED_PATCH */
141
+ ),
142
+ (_openBlock(true), _createElementBlock(
143
+ _Fragment,
144
+ null,
145
+ _renderList(items.value, (t) => {
146
+ return _openBlock(), _createElementBlock("button", {
147
+ key: t.value,
148
+ type: "button",
149
+ role: "tab",
150
+ class: _normalizeClass(["wd-tabs__item", {
151
+ "wd-tabs__item--active": t.value === __props.modelValue,
152
+ "wd-tabs__item--disabled": t.disabled
153
+ }]),
154
+ "data-wd-hover": "",
155
+ "aria-selected": t.value === __props.modelValue,
156
+ disabled: t.disabled,
157
+ tabindex: t.value === keyboardAnchor.value ? 0 : -1,
158
+ onClick: ($event) => select(t.value)
159
+ }, [
160
+ _renderSlot(_ctx.$slots, "tab", {
161
+ item: t,
162
+ active: t.value === _unref(active)
163
+ }, () => [
164
+ _createElementVNode(
165
+ "span",
166
+ _hoisted_2,
167
+ _toDisplayString(t.label),
168
+ 1
169
+ /* TEXT */
170
+ )
171
+ ]),
172
+ t.closable && !t.disabled ? (_openBlock(), _createElementBlock("span", {
173
+ key: 0,
174
+ class: "wd-tabs__close",
175
+ role: "button",
176
+ "aria-label": `\u5173\u95ED ${t.label}`,
177
+ onClick: ($event) => close(t, $event)
178
+ }, [
179
+ _createVNode(_unref(WdIcon_default), {
180
+ name: "close",
181
+ size: 10
182
+ })
183
+ ], 8, _hoisted_3)) : _createCommentVNode("v-if", true)
184
+ ], 10, _hoisted_1);
185
+ }),
186
+ 128
187
+ /* KEYED_FRAGMENT */
188
+ )),
189
+ __props.addable ? (_openBlock(), _createElementBlock("button", {
190
+ key: 0,
191
+ type: "button",
192
+ class: "wd-tabs__add",
193
+ "aria-label": "\u65B0\u5EFA",
194
+ "data-wd-hover": "",
195
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("add"))
196
+ }, [
197
+ _createVNode(_unref(WdIcon_default), {
198
+ name: "plus",
199
+ size: 14
200
+ })
201
+ ])) : _createCommentVNode("v-if", true)
202
+ ],
203
+ 16
204
+ /* FULL_PROPS */
205
+ ),
206
+ _createCommentVNode(" \u5185\u5BB9\u533A\uFF1A#panel \u4F20\u4E86\u624D\u6E32\u67D3\uFF0C\u8BA9\u300C\u9875\u7B7E + \u5185\u5BB9\u300D\u80FD\u4E00\u6B21\u6210\u5957\u4F7F\u7528 "),
207
+ _ctx.$slots.panel ? (_openBlock(), _createElementBlock("div", _hoisted_4, [
208
+ _renderSlot(_ctx.$slots, "panel", { value: _unref(active) })
209
+ ])) : _createCommentVNode("v-if", true)
210
+ ],
211
+ 64
212
+ /* STABLE_FRAGMENT */
213
+ );
214
+ };
215
+ }
216
+ });
217
+ export {
218
+ WdTabs_default as WdTabs
219
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ WdTag_default
3
+ } from "./chunk-AXEF2U2A.js";
4
+ export {
5
+ WdTag_default as WdTag
6
+ };
@@ -0,0 +1,181 @@
1
+ import {
2
+ WdTag_default
3
+ } from "./chunk-AXEF2U2A.js";
4
+ import {
5
+ useFormItemA11y
6
+ } from "./chunk-VUJL2HGD.js";
7
+ import "./chunk-UYUNYHZD.js";
8
+ import {
9
+ WdIcon_default
10
+ } from "./chunk-Q34U2HES.js";
11
+
12
+ // .lib-build/WdTagInput.ts
13
+ import { defineComponent as _defineComponent } from "vue";
14
+ import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, createElementVNode as _createElementVNode } from "vue";
15
+ import { computed, nextTick, ref, useAttrs } from "vue";
16
+ var _hoisted_1 = ["aria-disabled"];
17
+ var _hoisted_2 = ["aria-label", "onClick"];
18
+ var _hoisted_3 = ["value", "placeholder", "disabled", "readonly"];
19
+ var WdTagInput_default = /* @__PURE__ */ _defineComponent({
20
+ ...{ name: "WdTagInput", inheritAttrs: false },
21
+ __name: "WdTagInput",
22
+ props: {
23
+ modelValue: { type: Array, required: false, default: () => [] },
24
+ maxlength: { type: Number, required: false, default: 20 },
25
+ max: { type: Number, required: false, default: Infinity },
26
+ allowDuplicate: { type: Boolean, required: false, default: false },
27
+ placeholder: { type: String, required: false, default: "\u56DE\u8F66\u6DFB\u52A0" },
28
+ size: { type: String, required: false, default: "md" },
29
+ disabled: { type: Boolean, required: false, default: false },
30
+ readonly: { type: Boolean, required: false, default: false },
31
+ separators: { type: Array, required: false, default: () => [",", "\uFF0C", "\u3001"] }
32
+ },
33
+ emits: ["update:modelValue", "add", "remove", "reject"],
34
+ setup(__props, { emit: __emit }) {
35
+ const props = __props;
36
+ const emit = __emit;
37
+ const formA11y = useFormItemA11y();
38
+ const attrs = useAttrs();
39
+ const draft = ref("");
40
+ const inputEl = ref(null);
41
+ const composing = ref(false);
42
+ const list = computed(() => props.modelValue ?? []);
43
+ const full = computed(() => list.value.length >= props.max);
44
+ const canEdit = computed(() => !props.disabled && !props.readonly && !full);
45
+ function commit(raw) {
46
+ const text = (raw ?? draft.value).trim();
47
+ if (!text) {
48
+ draft.value = "";
49
+ return;
50
+ }
51
+ if (!props.allowDuplicate && list.value.includes(text)) {
52
+ emit("reject", text, "duplicate");
53
+ draft.value = "";
54
+ return;
55
+ }
56
+ if (text.length > props.maxlength) {
57
+ emit("reject", text, "maxlength");
58
+ return;
59
+ }
60
+ if (full.value) {
61
+ emit("reject", text, "max");
62
+ return;
63
+ }
64
+ const next = [...list.value, text];
65
+ emit("update:modelValue", next);
66
+ emit("add", text);
67
+ draft.value = "";
68
+ }
69
+ function onKeydown(e) {
70
+ if (props.disabled || props.readonly) return;
71
+ if (composing.value || e.isComposing) return;
72
+ if (e.key === "Enter") {
73
+ e.preventDefault();
74
+ commit();
75
+ return;
76
+ }
77
+ if (props.separators.includes(e.key)) {
78
+ e.preventDefault();
79
+ commit();
80
+ return;
81
+ }
82
+ if (e.key === "Backspace" && draft.value === "" && list.value.length) {
83
+ e.preventDefault();
84
+ const last = list.value[list.value.length - 1];
85
+ emit("update:modelValue", list.value.slice(0, -1));
86
+ emit("remove", last, list.value.length - 1);
87
+ }
88
+ }
89
+ function onInput(e) {
90
+ const el = e.target;
91
+ let v = el.value;
92
+ if (v.length > props.maxlength) {
93
+ v = v.slice(0, props.maxlength);
94
+ el.value = v;
95
+ }
96
+ draft.value = v;
97
+ }
98
+ function removeAt(i) {
99
+ if (props.disabled || props.readonly) return;
100
+ const v = list.value[i];
101
+ emit("update:modelValue", list.value.filter((_, k) => k !== i));
102
+ emit("remove", v, i);
103
+ nextTick(() => inputEl.value?.focus());
104
+ }
105
+ function focusInput() {
106
+ if (canEdit.value) inputEl.value?.focus();
107
+ }
108
+ return (_ctx, _cache) => {
109
+ return _openBlock(), _createElementBlock("div", _mergeProps({
110
+ class: ["wd-tag-input", [
111
+ `wd-tag-input--${__props.size}`,
112
+ {
113
+ "wd-tag-input--disabled": __props.disabled,
114
+ "wd-tag-input--readonly": __props.readonly
115
+ }
116
+ ]],
117
+ "aria-disabled": __props.disabled || void 0
118
+ }, _unref(formA11y).attrs.value, { onClick: focusInput }), [
119
+ (_openBlock(true), _createElementBlock(
120
+ _Fragment,
121
+ null,
122
+ _renderList(list.value, (t, i) => {
123
+ return _openBlock(), _createElementBlock("span", {
124
+ key: t + i,
125
+ class: "wd-tag-input__chip"
126
+ }, [
127
+ _createVNode(WdTag_default, {
128
+ variant: "tint",
129
+ size: __props.size === "lg" ? "md" : "sm"
130
+ }, {
131
+ default: _withCtx(() => [
132
+ _createTextVNode(
133
+ _toDisplayString(t),
134
+ 1
135
+ /* TEXT */
136
+ )
137
+ ]),
138
+ _: 2
139
+ /* DYNAMIC */
140
+ }, 1032, ["size"]),
141
+ !__props.disabled && !__props.readonly ? (_openBlock(), _createElementBlock("button", {
142
+ key: 0,
143
+ type: "button",
144
+ class: "wd-tag-input__x",
145
+ "aria-label": "\u79FB\u9664 " + t,
146
+ onClick: _withModifiers(($event) => removeAt(i), ["stop"])
147
+ }, [
148
+ _createVNode(_unref(WdIcon_default), {
149
+ name: "close",
150
+ size: 10,
151
+ "aria-hidden": "true"
152
+ })
153
+ ], 8, _hoisted_2)) : _createCommentVNode("v-if", true)
154
+ ]);
155
+ }),
156
+ 128
157
+ /* KEYED_FRAGMENT */
158
+ )),
159
+ _createElementVNode("input", _mergeProps({
160
+ ref_key: "inputEl",
161
+ ref: inputEl
162
+ }, _unref(attrs), {
163
+ class: "wd-tag-input__field",
164
+ type: "text",
165
+ value: draft.value,
166
+ placeholder: list.value.length ? "" : __props.placeholder,
167
+ disabled: __props.disabled,
168
+ readonly: __props.readonly || full.value,
169
+ onInput,
170
+ onKeydown,
171
+ onCompositionstart: _cache[0] || (_cache[0] = ($event) => composing.value = true),
172
+ onCompositionend: _cache[1] || (_cache[1] = ($event) => composing.value = false),
173
+ onBlur: _cache[2] || (_cache[2] = ($event) => commit())
174
+ }), null, 16, _hoisted_3)
175
+ ], 16, _hoisted_1);
176
+ };
177
+ }
178
+ });
179
+ export {
180
+ WdTagInput_default as WdTagInput
181
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ WdTimePicker_default
3
+ } from "./chunk-OGHYFT7B.js";
4
+ import "./chunk-G7NN4A6J.js";
5
+ import "./chunk-5HYOQ52I.js";
6
+ import "./chunk-WFXLDBP2.js";
7
+ import "./chunk-VUJL2HGD.js";
8
+ import "./chunk-UYUNYHZD.js";
9
+ import "./chunk-Q34U2HES.js";
10
+ export {
11
+ WdTimePicker_default as WdTimePicker
12
+ };
@@ -0,0 +1,145 @@
1
+ import {
2
+ WdIcon_default
3
+ } from "./chunk-Q34U2HES.js";
4
+
5
+ // .lib-build/WdTimeline.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, unref as _unref, createBlock as _createBlock, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, vShow as _vShow, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle } from "vue";
8
+ import { computed, ref } from "vue";
9
+ var _hoisted_1 = ["onClick"];
10
+ var _hoisted_2 = { class: "wd-timeline__node" };
11
+ var _hoisted_3 = {
12
+ key: 1,
13
+ class: "wd-timeline__dot"
14
+ };
15
+ var _hoisted_4 = { class: "wd-timeline__body" };
16
+ var _hoisted_5 = {
17
+ key: 0,
18
+ class: "wd-timeline__period"
19
+ };
20
+ var _hoisted_6 = { class: "wd-timeline__title" };
21
+ var _hoisted_7 = {
22
+ key: 1,
23
+ class: "wd-timeline__desc"
24
+ };
25
+ var WdTimeline_default = /* @__PURE__ */ _defineComponent({
26
+ ...{ name: "WdTimeline" },
27
+ __name: "WdTimeline",
28
+ props: {
29
+ items: { type: Array, required: true },
30
+ line: { type: Boolean, required: false, default: false },
31
+ mode: { type: String, required: false, default: "vertical" },
32
+ lineStyle: { type: String, required: false, default: "solid" },
33
+ size: { type: String, required: false, default: "md" },
34
+ collapsible: { type: Boolean, required: false, default: false }
35
+ },
36
+ emits: ["item-click"],
37
+ setup(__props, { emit: __emit }) {
38
+ const props = __props;
39
+ const emit = __emit;
40
+ const expanded = ref(/* @__PURE__ */ new Set());
41
+ function toggle(i, item) {
42
+ if (!props.collapsible || !item.detail) return;
43
+ const next = new Set(expanded.value);
44
+ if (next.has(i)) next.delete(i);
45
+ else next.add(i);
46
+ expanded.value = next;
47
+ emit("item-click", item, i);
48
+ }
49
+ const resolvedLine = computed(() => {
50
+ if (props.lineStyle !== "solid") return props.lineStyle;
51
+ return props.line ? "solid" : "none";
52
+ });
53
+ const isHorizontal = computed(() => props.mode === "horizontal");
54
+ return (_ctx, _cache) => {
55
+ return _openBlock(), _createElementBlock(
56
+ "ul",
57
+ {
58
+ class: _normalizeClass(["wd-timeline", [
59
+ `wd-timeline--${__props.mode}`,
60
+ `wd-timeline--line-${resolvedLine.value}`,
61
+ `wd-timeline--${__props.size}`
62
+ ]])
63
+ },
64
+ [
65
+ (_openBlock(true), _createElementBlock(
66
+ _Fragment,
67
+ null,
68
+ _renderList(__props.items, (it, i) => {
69
+ return _openBlock(), _createElementBlock("li", {
70
+ key: i,
71
+ class: _normalizeClass(["wd-timeline__item", {
72
+ "is-active": it.active,
73
+ "is-disabled": it.disabled,
74
+ "is-clickable": __props.collapsible && it.detail,
75
+ "is-last": i === __props.items.length - 1
76
+ }]),
77
+ style: _normalizeStyle(it.color ? { "--tl-color": it.color, "--tl-text-color": it.color } : void 0),
78
+ onClick: ($event) => toggle(i, it)
79
+ }, [
80
+ _createCommentVNode(" \u8282\u70B9 "),
81
+ _createElementVNode("span", _hoisted_2, [
82
+ it.icon ? (_openBlock(), _createBlock(_unref(WdIcon_default), {
83
+ key: 0,
84
+ name: it.icon,
85
+ size: __props.size === "sm" ? 11 : 13
86
+ }, null, 8, ["name", "size"])) : (_openBlock(), _createElementBlock("span", _hoisted_3))
87
+ ]),
88
+ _createCommentVNode(" \u4E3B\u4F53 "),
89
+ _createElementVNode("div", _hoisted_4, [
90
+ it.period ? (_openBlock(), _createElementBlock(
91
+ "span",
92
+ _hoisted_5,
93
+ _toDisplayString(it.period),
94
+ 1
95
+ /* TEXT */
96
+ )) : _createCommentVNode("v-if", true),
97
+ _createElementVNode("h3", _hoisted_6, [
98
+ _createTextVNode(
99
+ _toDisplayString(it.title) + " ",
100
+ 1
101
+ /* TEXT */
102
+ ),
103
+ __props.collapsible && it.detail ? (_openBlock(), _createBlock(_unref(WdIcon_default), {
104
+ key: 0,
105
+ class: _normalizeClass(["wd-timeline__caret", { "is-open": expanded.value.has(i) }]),
106
+ name: "chevron-down",
107
+ size: 13
108
+ }, null, 8, ["class"])) : _createCommentVNode("v-if", true)
109
+ ]),
110
+ it.desc ? (_openBlock(), _createElementBlock(
111
+ "p",
112
+ _hoisted_7,
113
+ _toDisplayString(it.desc),
114
+ 1
115
+ /* TEXT */
116
+ )) : _createCommentVNode("v-if", true),
117
+ _createCommentVNode("\n \u6298\u53E0\u5185\u5BB9\u7528 v-show \u800C\u975E v-if\uFF1A\n \u5C55\u5F00/\u6536\u8D77\u662F\u9AD8\u9891\u64CD\u4F5C\uFF0C\u4FDD\u7559 DOM \u907F\u514D\u6BCF\u6B21\u91CD\u5EFA\uFF1B\n \u540C\u65F6 v-show \u4E0D\u53C2\u4E0E Transition\uFF0C\u7ED5\u5F00\u52A8\u753B\u65F6\u949F\u505C\u6446\u7684\u95EE\u9898\u3002\n "),
118
+ __props.collapsible && it.detail ? _withDirectives((_openBlock(), _createElementBlock(
119
+ "div",
120
+ {
121
+ key: 2,
122
+ class: "wd-timeline__detail"
123
+ },
124
+ _toDisplayString(it.detail),
125
+ 513
126
+ /* TEXT, NEED_PATCH */
127
+ )), [
128
+ [_vShow, expanded.value.has(i)]
129
+ ]) : _createCommentVNode("v-if", true)
130
+ ])
131
+ ], 14, _hoisted_1);
132
+ }),
133
+ 128
134
+ /* KEYED_FRAGMENT */
135
+ ))
136
+ ],
137
+ 2
138
+ /* CLASS */
139
+ );
140
+ };
141
+ }
142
+ });
143
+ export {
144
+ WdTimeline_default as WdTimeline
145
+ };
@@ -0,0 +1,108 @@
1
+ import {
2
+ nextZIndex
3
+ } from "./chunk-5HYOQ52I.js";
4
+ import {
5
+ useAnchoredPosition
6
+ } from "./chunk-WFXLDBP2.js";
7
+
8
+ // .lib-build/WdTooltip.ts
9
+ import { defineComponent as _defineComponent } from "vue";
10
+ import { renderSlot as _renderSlot, mergeProps as _mergeProps, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport, openBlock as _openBlock, createBlock as _createBlock, Fragment as _Fragment, createElementBlock as _createElementBlock } from "vue";
11
+ import { computed, onBeforeUnmount, ref, watch } from "vue";
12
+ var WdTooltip_default = /* @__PURE__ */ _defineComponent({
13
+ ...{ name: "WdTooltip" },
14
+ __name: "WdTooltip",
15
+ props: {
16
+ content: { type: String, required: false, default: "" },
17
+ placement: { type: String, required: false, default: "top" },
18
+ delay: { type: Number, required: false, default: 200 }
19
+ },
20
+ setup(__props) {
21
+ const props = __props;
22
+ const open = ref(false);
23
+ let showTimer;
24
+ function clearTimer() {
25
+ if (showTimer !== void 0) {
26
+ clearTimeout(showTimer);
27
+ showTimer = void 0;
28
+ }
29
+ }
30
+ function onHoverIn() {
31
+ clearTimer();
32
+ showTimer = window.setTimeout(() => {
33
+ open.value = true;
34
+ }, props.delay);
35
+ }
36
+ function onHoverOut() {
37
+ clearTimer();
38
+ open.value = false;
39
+ }
40
+ function onFocusIn() {
41
+ clearTimer();
42
+ open.value = true;
43
+ }
44
+ onBeforeUnmount(clearTimer);
45
+ const anchorEl = ref(null);
46
+ const panelEl = ref(null);
47
+ const { pos } = useAnchoredPosition(open, anchorEl, panelEl, {
48
+ placement: props.placement === "top" ? "top-start" : "bottom-start",
49
+ gap: 8
50
+ });
51
+ const z = ref();
52
+ const style = computed(() => ({
53
+ top: pos.value.top + "px",
54
+ left: pos.value.left + "px",
55
+ zIndex: z.value
56
+ }));
57
+ watch(open, (v) => {
58
+ if (v) z.value = nextZIndex();
59
+ });
60
+ return (_ctx, _cache) => {
61
+ return _openBlock(), _createElementBlock(
62
+ _Fragment,
63
+ null,
64
+ [
65
+ _createElementVNode(
66
+ "span",
67
+ _mergeProps({
68
+ ref_key: "anchorEl",
69
+ ref: anchorEl
70
+ }, _ctx.$attrs, {
71
+ class: "wd-tooltip",
72
+ onMouseenter: onHoverIn,
73
+ onMouseleave: onHoverOut,
74
+ onFocusin: onFocusIn,
75
+ onFocusout: onHoverOut
76
+ }),
77
+ [
78
+ _renderSlot(_ctx.$slots, "default")
79
+ ],
80
+ 16
81
+ /* FULL_PROPS */
82
+ ),
83
+ (_openBlock(), _createBlock(_Teleport, { to: "body" }, [
84
+ _createCommentVNode("\n \u663E\u9690\u7528 .is-open + display\uFF0C\u4E0D\u7528 <Transition>\uFF1A\n \u65F6\u949F\u505C\u6446\u65F6 enter-from \u4F1A\u6B8B\u7559\uFF0C\u6C14\u6CE1\u5361\u5728\u534A\u900F\u660E\u6216\u6C38\u4E0D\u6D88\u5931\u3002\n\n \u26A0\uFE0F \u4E0D\u80FD\u7528 v-show\uFF1A\u5B83\u628A `display:none` \u5199\u6210**\u5185\u8054\u6837\u5F0F**\uFF0C\n \u4F18\u5148\u7EA7\u9AD8\u4E8E `.is-open { display: block }`\uFF0C\u7ED3\u679C\u6C38\u8FDC\u663E\u793A\u4E0D\u51FA\u6765\u3002\n \u6539\u4E3A\u300C\u8282\u70B9\u5E38\u9A7B + \u53EA\u9760\u7C7B\u5207\u6362\u300D\uFF0Cdisplay \u5B8C\u5168\u4EA4\u7ED9 CSS\u3002\n "),
85
+ _createElementVNode(
86
+ "span",
87
+ {
88
+ ref_key: "panelEl",
89
+ ref: panelEl,
90
+ class: _normalizeClass(["wd-tooltip__bubble", { "is-open": open.value }]),
91
+ style: _normalizeStyle(style.value),
92
+ role: "tooltip"
93
+ },
94
+ _toDisplayString(__props.content),
95
+ 7
96
+ /* TEXT, CLASS, STYLE */
97
+ )
98
+ ]))
99
+ ],
100
+ 64
101
+ /* STABLE_FRAGMENT */
102
+ );
103
+ };
104
+ }
105
+ });
106
+ export {
107
+ WdTooltip_default as WdTooltip
108
+ };