@w-run/wdesign-ui 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +208 -127
- package/dist/index.d.ts +1010 -80
- package/dist/parts/WdAffix.js +159 -0
- package/dist/parts/WdAiMessage.js +277 -0
- package/dist/parts/WdAlert.js +92 -0
- package/dist/parts/WdAnchor.js +159 -0
- package/dist/parts/WdAudioPlayer.js +1024 -0
- package/dist/parts/WdAvatar.js +6 -0
- package/dist/parts/WdAvatarGroup.js +46 -0
- package/dist/parts/WdBacktop.js +120 -0
- package/dist/parts/WdBadge.js +61 -0
- package/dist/parts/WdBento.js +40 -0
- package/dist/parts/WdBentoItem.js +43 -0
- package/dist/parts/WdBottomSheet.js +263 -0
- package/dist/parts/WdBreadcrumb.js +64 -0
- package/dist/parts/WdButton.js +94 -0
- package/dist/parts/WdCalendar.js +11 -0
- package/dist/parts/WdCard.js +113 -0
- package/dist/parts/WdCarousel.js +365 -0
- package/dist/parts/WdCascader.js +386 -0
- package/dist/parts/WdCheckbox.js +81 -0
- package/dist/parts/WdCollapse.js +135 -0
- package/dist/parts/WdColorPicker.js +592 -0
- package/dist/parts/WdCommand.js +357 -0
- package/dist/parts/WdContainer.js +37 -0
- package/dist/parts/WdCountdown.js +163 -0
- package/dist/parts/WdDanmaku.js +6 -0
- package/dist/parts/WdDatePicker.js +169 -0
- package/dist/parts/WdDateTimePicker.js +162 -0
- package/dist/parts/WdDescriptions.js +146 -0
- package/dist/parts/WdDivider.js +64 -0
- package/dist/parts/WdDrawer.js +176 -0
- package/dist/parts/WdDropdown.js +140 -0
- package/dist/parts/WdEmpty.js +79 -0
- package/dist/parts/WdExplorer.js +336 -0
- package/dist/parts/WdFileList.js +177 -0
- package/dist/parts/WdForm.js +111 -0
- package/dist/parts/WdFormItem.js +156 -0
- package/dist/parts/WdGrid.js +40 -0
- package/dist/parts/WdGroup.js +68 -0
- package/dist/parts/WdImagePreview.js +274 -0
- package/dist/parts/WdInput.js +10 -0
- package/dist/parts/WdInputNumber.js +253 -0
- package/dist/parts/WdListItem.js +60 -0
- package/dist/parts/WdLoading.js +128 -0
- package/dist/parts/WdMarkdown.js +172 -0
- package/dist/parts/WdMarquee.js +80 -0
- package/dist/parts/WdMasonry.js +40 -0
- package/dist/parts/WdMediaCard.js +302 -0
- package/dist/parts/WdMentions.js +277 -0
- package/dist/parts/WdModal.js +149 -0
- package/dist/parts/WdNav.js +311 -0
- package/dist/parts/WdNotification.js +112 -0
- package/dist/parts/WdOtp.js +107 -0
- package/dist/parts/WdPagination.js +252 -0
- package/dist/parts/WdPopconfirm.js +214 -0
- package/dist/parts/WdPopover.js +203 -0
- package/dist/parts/WdPostItem.js +84 -0
- package/dist/parts/WdProgress.js +48 -0
- package/dist/parts/WdProgressRing.js +101 -0
- package/dist/parts/WdPullRefresh.js +167 -0
- package/dist/parts/WdQRCode.js +1909 -0
- package/dist/parts/WdRadioGroup.js +95 -0
- package/dist/parts/WdRate.js +128 -0
- package/dist/parts/WdResult.js +86 -0
- package/dist/parts/WdScrollbar.js +186 -0
- package/dist/parts/WdSegmented.js +11 -0
- package/dist/parts/WdSelect.js +465 -0
- package/dist/parts/WdSkeleton.js +69 -0
- package/dist/parts/WdSlider.js +100 -0
- package/dist/parts/WdSortableList.js +291 -0
- package/dist/parts/WdSpace.js +46 -0
- package/dist/parts/WdSparkline.js +148 -0
- package/dist/parts/WdSpinner.js +6 -0
- package/dist/parts/WdSplitter.js +183 -0
- package/dist/parts/WdStatBar.js +202 -0
- package/dist/parts/WdStatistic.js +131 -0
- package/dist/parts/WdSteps.js +110 -0
- package/dist/parts/WdSwitch.js +63 -0
- package/dist/parts/WdTabBar.js +84 -0
- package/dist/parts/WdTable.js +589 -0
- package/dist/parts/WdTabs.js +219 -0
- package/dist/parts/WdTag.js +6 -0
- package/dist/parts/WdTagInput.js +181 -0
- package/dist/parts/WdTimePicker.js +12 -0
- package/dist/parts/WdTimeline.js +145 -0
- package/dist/parts/WdTooltip.js +108 -0
- package/dist/parts/WdTour.js +264 -0
- package/dist/parts/WdTransfer.js +446 -0
- package/dist/parts/WdTree.js +322 -0
- package/dist/parts/WdUpload.js +309 -0
- package/dist/parts/WdVideoPlayer.js +1006 -0
- package/dist/parts/WdVirtualList.js +169 -0
- package/dist/parts/WdWatermark.js +150 -0
- package/dist/parts/chunk-3LVE72ZK.js +361 -0
- package/dist/parts/chunk-5HYOQ52I.js +101 -0
- package/dist/parts/chunk-7M3MUL3B.js +275 -0
- package/dist/parts/chunk-AOTJ63HN.js +15 -0
- package/dist/parts/chunk-AXEF2U2A.js +41 -0
- package/dist/parts/chunk-CY3QOSFP.js +645 -0
- package/dist/parts/chunk-G7NN4A6J.js +40 -0
- package/dist/parts/chunk-HAKYCUAR.js +9 -0
- package/dist/parts/chunk-JDE4AHBR.js +160 -0
- package/dist/parts/chunk-LT3NTWIT.js +117 -0
- package/dist/parts/chunk-OGHYFT7B.js +387 -0
- package/dist/parts/chunk-Q34U2HES.js +261 -0
- package/dist/parts/chunk-RLSVPJHM.js +10 -0
- package/dist/parts/chunk-U2CDKD2T.js +30 -0
- package/dist/parts/chunk-UYUNYHZD.js +40 -0
- package/dist/parts/chunk-VUJL2HGD.js +23 -0
- package/dist/parts/chunk-WCFG5KNT.js +51 -0
- package/dist/parts/chunk-WDDAALPI.js +42 -0
- package/dist/parts/chunk-WFXLDBP2.js +149 -0
- package/dist/style/affix.css +566 -0
- package/dist/style/ai-msg.css +572 -13
- package/dist/style/alert.css +577 -5
- package/dist/style/anchor.css +630 -0
- package/dist/style/audio.css +658 -67
- package/dist/style/avatar.css +575 -12
- package/dist/style/backtop.css +625 -0
- package/dist/style/badge.css +595 -11
- package/dist/style/bento.css +763 -0
- package/dist/style/bottom-sheet.css +776 -0
- package/dist/style/breadcrumb.css +579 -4
- package/dist/style/button.css +631 -36
- package/dist/style/calendar.css +1512 -0
- package/dist/style/card.css +683 -6
- package/dist/style/carousel.css +573 -4
- package/dist/style/cascader.css +862 -0
- package/dist/style/checkbox.css +584 -7
- package/dist/style/chevron.css +543 -1
- package/dist/style/collapse.css +586 -7
- package/dist/style/colorpicker.css +876 -0
- package/dist/style/command.css +572 -13
- package/dist/style/container.css +543 -0
- package/dist/style/countdown.css +722 -0
- package/dist/style/danmaku.css +644 -0
- package/dist/style/datepicker.css +606 -128
- package/dist/style/datetime-picker.css +714 -0
- package/dist/style/descriptions.css +604 -11
- package/dist/style/divider.css +544 -2
- package/dist/style/dot.css +556 -1
- package/dist/style/drawer.css +609 -11
- package/dist/style/dropdown.css +565 -3
- package/dist/style/empty.css +624 -3
- package/dist/style/explorer.css +632 -24
- package/dist/style/file-list.css +577 -5
- package/dist/style/flip.css +600 -0
- package/dist/style/form.css +550 -8
- package/dist/style/grid.css +614 -0
- package/dist/style/group.css +560 -16
- package/dist/style/icon-btn.css +570 -4
- package/dist/style/image-preview.css +652 -8
- package/dist/style/input-number.css +680 -0
- package/dist/style/input.css +571 -8
- package/dist/style/list.css +553 -4
- package/dist/style/loading.css +667 -0
- package/dist/style/markdown.css +592 -20
- package/dist/style/marquee.css +678 -0
- package/dist/style/masonry.css +614 -0
- package/dist/style/media-card.css +1229 -0
- package/dist/style/mentions.css +690 -0
- package/dist/style/modal.css +626 -15
- package/dist/style/nav.css +1046 -0
- package/dist/style/notification.css +556 -7
- package/dist/style/otp.css +567 -7
- package/dist/style/pagination.css +571 -11
- package/dist/style/popconfirm.css +568 -10
- package/dist/style/popover.css +645 -15
- package/dist/style/post-item.css +548 -6
- package/dist/style/progress-ring.css +640 -0
- package/dist/style/progress.css +543 -1
- package/dist/style/pull-refresh.css +637 -0
- package/dist/style/qrcode.css +613 -0
- package/dist/style/radio.css +584 -5
- package/dist/style/rate.css +594 -1
- package/dist/style/result.css +546 -3
- package/dist/style/scroll-reveal.css +613 -0
- package/dist/style/scrollbar.css +644 -0
- package/dist/style/segmented-picker.css +573 -14
- package/dist/style/segmented.css +711 -7
- package/dist/style/select.css +682 -26
- package/dist/style/skeleton.css +559 -0
- package/dist/style/slider.css +565 -4
- package/dist/style/sortable.css +593 -7
- package/dist/style/space.css +543 -0
- package/dist/style/sparkline.css +606 -0
- package/dist/style/spinner.css +559 -0
- package/dist/style/splitter.css +711 -0
- package/dist/style/stat-bar.css +767 -0
- package/dist/style/statistic.css +552 -7
- package/dist/style/steps.css +633 -9
- package/dist/style/switch.css +585 -4
- package/dist/style/tab-bar.css +647 -0
- package/dist/style/table.css +886 -36
- package/dist/style/tabs.css +599 -10
- package/dist/style/tag-input.css +710 -0
- package/dist/style/tag.css +603 -18
- package/dist/style/time-picker.css +749 -0
- package/dist/style/timeline.css +575 -14
- package/dist/style/toast.css +567 -6
- package/dist/style/tooltip.css +564 -5
- package/dist/style/tour.css +683 -0
- package/dist/style/transfer.css +858 -0
- package/dist/style/tree.css +613 -16
- package/dist/style/typography.css +884 -3
- package/dist/style/upload.css +602 -13
- package/dist/style/vlist.css +543 -1
- package/dist/style/vplayer.css +799 -57
- package/dist/style/watermark.css +570 -0
- package/dist/wdesign-ui.css +18055 -7262
- package/dist/wdesign-ui.esm.js +8976 -5044
- package/package.json +99 -13
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useOverlayLayer
|
|
3
|
+
} from "./chunk-5HYOQ52I.js";
|
|
4
|
+
import {
|
|
5
|
+
WdCalendar_default
|
|
6
|
+
} from "./chunk-CY3QOSFP.js";
|
|
7
|
+
import "./chunk-WDDAALPI.js";
|
|
8
|
+
import {
|
|
9
|
+
useAnchoredPosition,
|
|
10
|
+
useDismiss
|
|
11
|
+
} from "./chunk-WFXLDBP2.js";
|
|
12
|
+
import {
|
|
13
|
+
useFormItemA11y
|
|
14
|
+
} from "./chunk-VUJL2HGD.js";
|
|
15
|
+
import "./chunk-UYUNYHZD.js";
|
|
16
|
+
import {
|
|
17
|
+
WdIcon_default
|
|
18
|
+
} from "./chunk-Q34U2HES.js";
|
|
19
|
+
|
|
20
|
+
// .lib-build/WdDatePicker.ts
|
|
21
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
22
|
+
import { unref as _unref, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, createElementVNode as _createElementVNode, mergeProps as _mergeProps, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport, createBlock as _createBlock, Fragment as _Fragment } from "vue";
|
|
23
|
+
import { nextTick, ref } from "vue";
|
|
24
|
+
var _hoisted_1 = ["disabled", "aria-expanded"];
|
|
25
|
+
var _hoisted_2 = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "wd-datepicker__value"
|
|
28
|
+
};
|
|
29
|
+
var _hoisted_3 = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "wd-datepicker__placeholder"
|
|
32
|
+
};
|
|
33
|
+
var _hoisted_4 = ["data-placement"];
|
|
34
|
+
var PANEL_WIDTH = 286;
|
|
35
|
+
var WdDatePicker_default = /* @__PURE__ */ _defineComponent({
|
|
36
|
+
...{ name: "WdDatePicker" },
|
|
37
|
+
__name: "WdDatePicker",
|
|
38
|
+
props: {
|
|
39
|
+
modelValue: { type: String, required: false, default: "" },
|
|
40
|
+
placeholder: { type: String, required: false, default: "\u9009\u62E9\u65E5\u671F" },
|
|
41
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
42
|
+
min: { type: String, required: false, default: "" },
|
|
43
|
+
max: { type: String, required: false, default: "" },
|
|
44
|
+
clearable: { type: Boolean, required: false, default: true },
|
|
45
|
+
showToday: { type: Boolean, required: false, default: true },
|
|
46
|
+
size: { type: String, required: false, default: "md" }
|
|
47
|
+
},
|
|
48
|
+
emits: ["update:modelValue", "change"],
|
|
49
|
+
setup(__props, { emit: __emit }) {
|
|
50
|
+
const formA11y = useFormItemA11y();
|
|
51
|
+
const props = __props;
|
|
52
|
+
const emit = __emit;
|
|
53
|
+
const open = ref(false);
|
|
54
|
+
const root = ref();
|
|
55
|
+
const panelEl = ref(null);
|
|
56
|
+
const calEl = ref(null);
|
|
57
|
+
useDismiss([root, panelEl], () => {
|
|
58
|
+
open.value = false;
|
|
59
|
+
}, open);
|
|
60
|
+
const { pos, actual } = useAnchoredPosition(open, root, panelEl, {
|
|
61
|
+
placement: "bottom-start",
|
|
62
|
+
gap: 8,
|
|
63
|
+
width: PANEL_WIDTH
|
|
64
|
+
});
|
|
65
|
+
useOverlayLayer(open, root, () => {
|
|
66
|
+
open.value = false;
|
|
67
|
+
return true;
|
|
68
|
+
});
|
|
69
|
+
const month = ref("");
|
|
70
|
+
function pad(n) {
|
|
71
|
+
return n < 10 ? `0${n}` : `${n}`;
|
|
72
|
+
}
|
|
73
|
+
function monthOf(key) {
|
|
74
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(key) ? key.slice(0, 7) : "";
|
|
75
|
+
}
|
|
76
|
+
function toggle() {
|
|
77
|
+
if (props.disabled) return;
|
|
78
|
+
open.value = !open.value;
|
|
79
|
+
if (!open.value) return;
|
|
80
|
+
const now = /* @__PURE__ */ new Date();
|
|
81
|
+
month.value = monthOf(props.modelValue) || `${now.getFullYear()}-${pad(now.getMonth() + 1)}`;
|
|
82
|
+
nextTick(() => calEl.value?.$el?.focus());
|
|
83
|
+
}
|
|
84
|
+
function onPick(value) {
|
|
85
|
+
emit("update:modelValue", value);
|
|
86
|
+
emit("change", value);
|
|
87
|
+
open.value = false;
|
|
88
|
+
}
|
|
89
|
+
return (_ctx, _cache) => {
|
|
90
|
+
return _openBlock(), _createElementBlock(
|
|
91
|
+
_Fragment,
|
|
92
|
+
null,
|
|
93
|
+
[
|
|
94
|
+
_createElementVNode(
|
|
95
|
+
"div",
|
|
96
|
+
_mergeProps({
|
|
97
|
+
ref_key: "root",
|
|
98
|
+
ref: root,
|
|
99
|
+
class: ["wd-datepicker", [`wd-datepicker--${__props.size}`, { "wd-datepicker--open": open.value }]]
|
|
100
|
+
}, { ..._ctx.$attrs, ..._unref(formA11y).attrs.value }),
|
|
101
|
+
[
|
|
102
|
+
_createElementVNode("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
class: "wd-datepicker__trigger",
|
|
105
|
+
disabled: __props.disabled,
|
|
106
|
+
"aria-haspopup": "dialog",
|
|
107
|
+
"aria-expanded": open.value,
|
|
108
|
+
onClick: toggle
|
|
109
|
+
}, [
|
|
110
|
+
__props.modelValue ? (_openBlock(), _createElementBlock(
|
|
111
|
+
"span",
|
|
112
|
+
_hoisted_2,
|
|
113
|
+
_toDisplayString(__props.modelValue),
|
|
114
|
+
1
|
|
115
|
+
/* TEXT */
|
|
116
|
+
)) : (_openBlock(), _createElementBlock(
|
|
117
|
+
"span",
|
|
118
|
+
_hoisted_3,
|
|
119
|
+
_toDisplayString(__props.placeholder),
|
|
120
|
+
1
|
|
121
|
+
/* TEXT */
|
|
122
|
+
)),
|
|
123
|
+
_createVNode(_unref(WdIcon_default), {
|
|
124
|
+
class: "wd-datepicker__icon",
|
|
125
|
+
name: "calendar",
|
|
126
|
+
size: 15,
|
|
127
|
+
"aria-hidden": "true"
|
|
128
|
+
})
|
|
129
|
+
], 8, _hoisted_1)
|
|
130
|
+
],
|
|
131
|
+
16
|
|
132
|
+
/* FULL_PROPS */
|
|
133
|
+
),
|
|
134
|
+
(_openBlock(), _createBlock(_Teleport, { to: "body" }, [
|
|
135
|
+
_createElementVNode("div", {
|
|
136
|
+
ref_key: "panelEl",
|
|
137
|
+
ref: panelEl,
|
|
138
|
+
class: _normalizeClass(["wd-datepicker__panel", { "is-open": open.value }]),
|
|
139
|
+
style: _normalizeStyle({ top: _unref(pos).top + "px", left: _unref(pos).left + "px" }),
|
|
140
|
+
"data-placement": _unref(actual),
|
|
141
|
+
role: "group",
|
|
142
|
+
"aria-label": "\u9009\u62E9\u65E5\u671F"
|
|
143
|
+
}, [
|
|
144
|
+
_createCommentVNode("\n \u65E5\u671F\u9762\u677F\u552F\u4E00\u5B9E\u73B0 = WdCalendar\u3002\n \u8FD9\u91CC\u53EA\u505A\u4E09\u4EF6\u4E8B\uFF1A\u4F20 min/max\u3001\u63A5 change \u5173\u9762\u677F\u3001\u628A\u300C\u4ECA\u5929/\u6E05\u7A7A\u300D\u51B3\u5B9A\u6743\u4EA4\u7ED9\u8C03\u7528\u65B9\u3002\n "),
|
|
145
|
+
_createVNode(WdCalendar_default, {
|
|
146
|
+
ref_key: "calEl",
|
|
147
|
+
ref: calEl,
|
|
148
|
+
month: month.value,
|
|
149
|
+
"onUpdate:month": _cache[0] || (_cache[0] = ($event) => month.value = $event),
|
|
150
|
+
"model-value": __props.modelValue,
|
|
151
|
+
min: __props.min,
|
|
152
|
+
max: __props.max,
|
|
153
|
+
clearable: __props.clearable,
|
|
154
|
+
"show-today": __props.showToday,
|
|
155
|
+
size: "sm",
|
|
156
|
+
onChange: onPick
|
|
157
|
+
}, null, 8, ["month", "model-value", "min", "max", "clearable", "show-today"])
|
|
158
|
+
], 14, _hoisted_4)
|
|
159
|
+
]))
|
|
160
|
+
],
|
|
161
|
+
64
|
|
162
|
+
/* STABLE_FRAGMENT */
|
|
163
|
+
);
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
export {
|
|
168
|
+
WdDatePicker_default as WdDatePicker
|
|
169
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WdTimePicker_default
|
|
3
|
+
} from "./chunk-OGHYFT7B.js";
|
|
4
|
+
import {
|
|
5
|
+
useControllable
|
|
6
|
+
} from "./chunk-G7NN4A6J.js";
|
|
7
|
+
import "./chunk-5HYOQ52I.js";
|
|
8
|
+
import {
|
|
9
|
+
WdCalendar_default
|
|
10
|
+
} from "./chunk-CY3QOSFP.js";
|
|
11
|
+
import "./chunk-WDDAALPI.js";
|
|
12
|
+
import "./chunk-WFXLDBP2.js";
|
|
13
|
+
import {
|
|
14
|
+
useFormItemA11y
|
|
15
|
+
} from "./chunk-VUJL2HGD.js";
|
|
16
|
+
import "./chunk-UYUNYHZD.js";
|
|
17
|
+
import {
|
|
18
|
+
WdIcon_default
|
|
19
|
+
} from "./chunk-Q34U2HES.js";
|
|
20
|
+
|
|
21
|
+
// .lib-build/WdDateTimePicker.ts
|
|
22
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
23
|
+
import { unref as _unref, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, createElementVNode as _createElementVNode, mergeProps as _mergeProps } from "vue";
|
|
24
|
+
import { computed } from "vue";
|
|
25
|
+
var _hoisted_1 = { class: "wd-datetime-picker__field" };
|
|
26
|
+
var _hoisted_2 = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "wd-datetime-picker__text"
|
|
29
|
+
};
|
|
30
|
+
var _hoisted_3 = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "wd-datetime-picker__placeholder"
|
|
33
|
+
};
|
|
34
|
+
var _hoisted_4 = { class: "wd-datetime-picker__row" };
|
|
35
|
+
var _hoisted_5 = { class: "wd-datetime-picker__side" };
|
|
36
|
+
var WdDateTimePicker_default = /* @__PURE__ */ _defineComponent({
|
|
37
|
+
...{ name: "WdDateTimePicker" },
|
|
38
|
+
__name: "WdDateTimePicker",
|
|
39
|
+
props: {
|
|
40
|
+
modelValue: { type: String, required: false },
|
|
41
|
+
defaultValue: { type: String, required: false, default: "" },
|
|
42
|
+
second: { type: Boolean, required: false, default: false },
|
|
43
|
+
minuteStep: { type: Number, required: false, default: 1 },
|
|
44
|
+
min: { type: String, required: false, default: "" },
|
|
45
|
+
max: { type: String, required: false, default: "" },
|
|
46
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
47
|
+
size: { type: String, required: false, default: "md" },
|
|
48
|
+
weekStart: { type: Number, required: false, default: 1 }
|
|
49
|
+
},
|
|
50
|
+
emits: ["update:modelValue", "change"],
|
|
51
|
+
setup(__props, { emit: __emit }) {
|
|
52
|
+
const formA11y = useFormItemA11y();
|
|
53
|
+
const props = __props;
|
|
54
|
+
const emit = __emit;
|
|
55
|
+
const { value, set } = useControllable({
|
|
56
|
+
modelValue: computed(() => props.modelValue),
|
|
57
|
+
defaultValue: computed(() => props.defaultValue),
|
|
58
|
+
fallback: "",
|
|
59
|
+
onChange: (v) => {
|
|
60
|
+
emit("update:modelValue", v);
|
|
61
|
+
emit("change", v);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
function split(v) {
|
|
65
|
+
const s = v.trim();
|
|
66
|
+
if (!s) return { date: "", time: "" };
|
|
67
|
+
const [d, t] = s.split(/\s+/);
|
|
68
|
+
return { date: d || "", time: t || "" };
|
|
69
|
+
}
|
|
70
|
+
const parts = computed(() => split(value.value));
|
|
71
|
+
function onDate(d) {
|
|
72
|
+
const t = parts.value.time;
|
|
73
|
+
set(t ? `${d} ${t}` : d);
|
|
74
|
+
}
|
|
75
|
+
function onTime(t) {
|
|
76
|
+
const d = parts.value.date;
|
|
77
|
+
if (!d) {
|
|
78
|
+
const now = /* @__PURE__ */ new Date();
|
|
79
|
+
const p = (n) => n < 10 ? "0" + n : String(n);
|
|
80
|
+
const today = `${now.getFullYear()}-${p(now.getMonth() + 1)}-${p(now.getDate())}`;
|
|
81
|
+
set(`${today} ${t}`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
set(`${d} ${t}`);
|
|
85
|
+
}
|
|
86
|
+
function clear() {
|
|
87
|
+
set("");
|
|
88
|
+
}
|
|
89
|
+
const display = computed(() => {
|
|
90
|
+
const { date, time } = parts.value;
|
|
91
|
+
if (!date) return "";
|
|
92
|
+
return time ? `${date} ${time}` : date;
|
|
93
|
+
});
|
|
94
|
+
return (_ctx, _cache) => {
|
|
95
|
+
return _openBlock(), _createElementBlock(
|
|
96
|
+
"div",
|
|
97
|
+
_mergeProps({
|
|
98
|
+
class: ["wd-datetime-picker", [`wd-datetime-picker--${__props.size}`, { "is-disabled": __props.disabled }]]
|
|
99
|
+
}, _unref(formA11y).attrs.value),
|
|
100
|
+
[
|
|
101
|
+
_createCommentVNode(" \u5408\u5E76\u89E6\u53D1\u5668\uFF1A\u663E\u793A\u5B8C\u6574\u503C "),
|
|
102
|
+
_createElementVNode("div", _hoisted_1, [
|
|
103
|
+
display.value ? (_openBlock(), _createElementBlock(
|
|
104
|
+
"span",
|
|
105
|
+
_hoisted_2,
|
|
106
|
+
_toDisplayString(display.value),
|
|
107
|
+
1
|
|
108
|
+
/* TEXT */
|
|
109
|
+
)) : (_openBlock(), _createElementBlock("span", _hoisted_3, "\u9009\u62E9\u65E5\u671F\u4E0E\u65F6\u95F4")),
|
|
110
|
+
display.value && !__props.disabled ? (_openBlock(), _createElementBlock("button", {
|
|
111
|
+
key: 2,
|
|
112
|
+
type: "button",
|
|
113
|
+
class: "wd-datetime-picker__clear",
|
|
114
|
+
"aria-label": "\u6E05\u7A7A",
|
|
115
|
+
onClick: clear
|
|
116
|
+
}, [
|
|
117
|
+
_createVNode(_unref(WdIcon_default), {
|
|
118
|
+
name: "close",
|
|
119
|
+
size: 12
|
|
120
|
+
})
|
|
121
|
+
])) : _createCommentVNode("v-if", true)
|
|
122
|
+
]),
|
|
123
|
+
_createCommentVNode(" \u4E24\u4E2A\u5B50\u63A7\u4EF6\u5E76\u6392\uFF1A\u65E5\u671F\u9760\u65E5\u5386\uFF0C\u65F6\u95F4\u9760\u4E09\u5217\u9762\u677F "),
|
|
124
|
+
_createElementVNode("div", _hoisted_4, [
|
|
125
|
+
_createVNode(WdCalendar_default, {
|
|
126
|
+
"model-value": parts.value.date,
|
|
127
|
+
"week-start": __props.weekStart,
|
|
128
|
+
size: __props.size,
|
|
129
|
+
clearable: false,
|
|
130
|
+
"show-today": false,
|
|
131
|
+
"onUpdate:modelValue": onDate
|
|
132
|
+
}, null, 8, ["model-value", "week-start", "size"]),
|
|
133
|
+
_createElementVNode("div", _hoisted_5, [
|
|
134
|
+
_cache[0] || (_cache[0] = _createElementVNode(
|
|
135
|
+
"div",
|
|
136
|
+
{ class: "wd-datetime-picker__side-label" },
|
|
137
|
+
"\u65F6\u95F4",
|
|
138
|
+
-1
|
|
139
|
+
/* CACHED */
|
|
140
|
+
)),
|
|
141
|
+
_createVNode(WdTimePicker_default, {
|
|
142
|
+
inline: "",
|
|
143
|
+
"model-value": parts.value.time,
|
|
144
|
+
second: __props.second,
|
|
145
|
+
"minute-step": __props.minuteStep,
|
|
146
|
+
min: __props.min,
|
|
147
|
+
max: __props.max,
|
|
148
|
+
size: __props.size,
|
|
149
|
+
"onUpdate:modelValue": onTime
|
|
150
|
+
}, null, 8, ["model-value", "second", "minute-step", "min", "max", "size"])
|
|
151
|
+
])
|
|
152
|
+
])
|
|
153
|
+
],
|
|
154
|
+
16
|
|
155
|
+
/* FULL_PROPS */
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
export {
|
|
161
|
+
WdDateTimePicker_default as WdDateTimePicker
|
|
162
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// .lib-build/WdDescriptions.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, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, renderSlot as _renderSlot, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass } from "vue";
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
var _hoisted_1 = { class: "wd-descriptions__label" };
|
|
6
|
+
var _hoisted_2 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "wd-descriptions__colon"
|
|
9
|
+
};
|
|
10
|
+
var _hoisted_3 = { class: "wd-descriptions__value" };
|
|
11
|
+
var _hoisted_4 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "wd-descriptions__hint"
|
|
14
|
+
};
|
|
15
|
+
var _hoisted_5 = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "wd-descriptions__empty"
|
|
18
|
+
};
|
|
19
|
+
var WdDescriptions_default = /* @__PURE__ */ _defineComponent({
|
|
20
|
+
...{ name: "WdDescriptions" },
|
|
21
|
+
__name: "WdDescriptions",
|
|
22
|
+
props: {
|
|
23
|
+
items: { type: Array, required: false, default: () => [] },
|
|
24
|
+
columns: { type: Number, required: false, default: 3 },
|
|
25
|
+
vertical: { type: Boolean, required: false, default: false },
|
|
26
|
+
striped: { type: Boolean, required: false, default: false },
|
|
27
|
+
colon: { type: Boolean, required: false, default: false },
|
|
28
|
+
size: { type: String, required: false, default: "md" }
|
|
29
|
+
},
|
|
30
|
+
setup(__props) {
|
|
31
|
+
const props = __props;
|
|
32
|
+
const rows = computed(() => {
|
|
33
|
+
const out = [];
|
|
34
|
+
const cols = Math.max(1, props.columns);
|
|
35
|
+
let cur = [];
|
|
36
|
+
let used = 0;
|
|
37
|
+
for (const it of props.items) {
|
|
38
|
+
const span = Math.min(it.span || 1, cols);
|
|
39
|
+
if (used + span > cols && cur.length) {
|
|
40
|
+
out.push(cur);
|
|
41
|
+
cur = [];
|
|
42
|
+
used = 0;
|
|
43
|
+
}
|
|
44
|
+
cur.push({ ...it, span });
|
|
45
|
+
used += span;
|
|
46
|
+
if (used >= cols) {
|
|
47
|
+
out.push(cur);
|
|
48
|
+
cur = [];
|
|
49
|
+
used = 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (cur.length) out.push(cur);
|
|
53
|
+
return out;
|
|
54
|
+
});
|
|
55
|
+
const styleVars = computed(() => ({ "--wd-desc-cols": String(Math.max(1, props.columns)) }));
|
|
56
|
+
return (_ctx, _cache) => {
|
|
57
|
+
return _openBlock(), _createElementBlock(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
class: _normalizeClass(["wd-descriptions", {
|
|
61
|
+
"wd-descriptions--vertical": __props.vertical,
|
|
62
|
+
"wd-descriptions--striped": __props.striped,
|
|
63
|
+
[`wd-descriptions--${__props.size}`]: true
|
|
64
|
+
}]),
|
|
65
|
+
style: _normalizeStyle(styleVars.value)
|
|
66
|
+
},
|
|
67
|
+
[
|
|
68
|
+
(_openBlock(true), _createElementBlock(
|
|
69
|
+
_Fragment,
|
|
70
|
+
null,
|
|
71
|
+
_renderList(rows.value, (row, ri) => {
|
|
72
|
+
return _openBlock(), _createElementBlock("div", {
|
|
73
|
+
key: ri,
|
|
74
|
+
class: "wd-descriptions__row"
|
|
75
|
+
}, [
|
|
76
|
+
(_openBlock(true), _createElementBlock(
|
|
77
|
+
_Fragment,
|
|
78
|
+
null,
|
|
79
|
+
_renderList(row, (item, ci) => {
|
|
80
|
+
return _openBlock(), _createElementBlock(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
key: ci,
|
|
84
|
+
class: "wd-descriptions__item",
|
|
85
|
+
style: _normalizeStyle({ "--wd-desc-span": String(item.span || 1) })
|
|
86
|
+
},
|
|
87
|
+
[
|
|
88
|
+
_createElementVNode("div", _hoisted_1, [
|
|
89
|
+
_createTextVNode(
|
|
90
|
+
_toDisplayString(item.label),
|
|
91
|
+
1
|
|
92
|
+
/* TEXT */
|
|
93
|
+
),
|
|
94
|
+
__props.colon ? (_openBlock(), _createElementBlock("span", _hoisted_2, "\uFF1A")) : _createCommentVNode("v-if", true)
|
|
95
|
+
]),
|
|
96
|
+
_createElementVNode("div", _hoisted_3, [
|
|
97
|
+
_renderSlot(_ctx.$slots, item.key || "", {
|
|
98
|
+
item,
|
|
99
|
+
value: item.value
|
|
100
|
+
}, () => [
|
|
101
|
+
_createTextVNode(
|
|
102
|
+
_toDisplayString(item.value ?? "\u2014"),
|
|
103
|
+
1
|
|
104
|
+
/* TEXT */
|
|
105
|
+
)
|
|
106
|
+
]),
|
|
107
|
+
item.hint ? (_openBlock(), _createElementBlock(
|
|
108
|
+
"span",
|
|
109
|
+
_hoisted_4,
|
|
110
|
+
_toDisplayString(item.hint),
|
|
111
|
+
1
|
|
112
|
+
/* TEXT */
|
|
113
|
+
)) : _createCommentVNode("v-if", true)
|
|
114
|
+
])
|
|
115
|
+
],
|
|
116
|
+
4
|
|
117
|
+
/* STYLE */
|
|
118
|
+
);
|
|
119
|
+
}),
|
|
120
|
+
128
|
|
121
|
+
/* KEYED_FRAGMENT */
|
|
122
|
+
))
|
|
123
|
+
]);
|
|
124
|
+
}),
|
|
125
|
+
128
|
|
126
|
+
/* KEYED_FRAGMENT */
|
|
127
|
+
)),
|
|
128
|
+
!__props.items.length ? (_openBlock(), _createElementBlock("div", _hoisted_5, [
|
|
129
|
+
_renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
130
|
+
_cache[0] || (_cache[0] = _createTextVNode(
|
|
131
|
+
"\u2014",
|
|
132
|
+
-1
|
|
133
|
+
/* CACHED */
|
|
134
|
+
))
|
|
135
|
+
])
|
|
136
|
+
])) : _createCommentVNode("v-if", true)
|
|
137
|
+
],
|
|
138
|
+
6
|
|
139
|
+
/* CLASS, STYLE */
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
export {
|
|
145
|
+
WdDescriptions_default as WdDescriptions
|
|
146
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// .lib-build/WdDivider.ts
|
|
2
|
+
import { defineComponent as _defineComponent } from "vue";
|
|
3
|
+
import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps } from "vue";
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
var _hoisted_1 = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "wd-divider__text"
|
|
8
|
+
};
|
|
9
|
+
var WdDivider_default = /* @__PURE__ */ _defineComponent({
|
|
10
|
+
...{ name: "WdDivider" },
|
|
11
|
+
__name: "WdDivider",
|
|
12
|
+
props: {
|
|
13
|
+
direction: { type: String, required: false, default: "horizontal" },
|
|
14
|
+
align: { type: String, required: false, default: "center" },
|
|
15
|
+
variant: { type: String, required: false, default: "solid" },
|
|
16
|
+
spacing: { type: Number, required: false, default: 16 }
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const isHorizontal = computed(() => props.direction === "horizontal");
|
|
21
|
+
const classes = computed(() => [
|
|
22
|
+
"wd-divider",
|
|
23
|
+
`wd-divider--${props.direction}`,
|
|
24
|
+
// ← 之前漏了这个,水平线的 ::before 规则因此从未命中
|
|
25
|
+
`wd-divider--${props.variant}`,
|
|
26
|
+
...isHorizontal.value ? [`wd-divider--${props.align}`] : []
|
|
27
|
+
]);
|
|
28
|
+
const style = computed(
|
|
29
|
+
() => isHorizontal.value ? { marginTop: `${props.spacing}px`, marginBottom: `${props.spacing}px` } : { marginLeft: `${props.spacing / 2}px`, marginRight: `${props.spacing / 2}px` }
|
|
30
|
+
);
|
|
31
|
+
return (_ctx, _cache) => {
|
|
32
|
+
return isHorizontal.value ? (_openBlock(), _createElementBlock(
|
|
33
|
+
"div",
|
|
34
|
+
_mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
35
|
+
class: classes.value,
|
|
36
|
+
style: style.value,
|
|
37
|
+
role: "separator",
|
|
38
|
+
"aria-orientation": "horizontal"
|
|
39
|
+
}),
|
|
40
|
+
[
|
|
41
|
+
_ctx.$slots.default ? (_openBlock(), _createElementBlock("span", _hoisted_1, [
|
|
42
|
+
_renderSlot(_ctx.$slots, "default")
|
|
43
|
+
])) : _createCommentVNode("v-if", true)
|
|
44
|
+
],
|
|
45
|
+
16
|
|
46
|
+
/* FULL_PROPS */
|
|
47
|
+
)) : (_openBlock(), _createElementBlock(
|
|
48
|
+
"span",
|
|
49
|
+
_mergeProps({ key: 1 }, _ctx.$attrs, {
|
|
50
|
+
class: classes.value,
|
|
51
|
+
style: style.value,
|
|
52
|
+
role: "separator",
|
|
53
|
+
"aria-orientation": "vertical"
|
|
54
|
+
}),
|
|
55
|
+
null,
|
|
56
|
+
16
|
|
57
|
+
/* FULL_PROPS */
|
|
58
|
+
));
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
WdDivider_default as WdDivider
|
|
64
|
+
};
|