@mcistudio/unoui-vue 1.0.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 +95 -0
- package/dist/alert/Alert.vue.d.ts +67 -0
- package/dist/alert/index.d.ts +40 -0
- package/dist/alert/index.js +2 -0
- package/dist/attrs.d.ts +11 -0
- package/dist/attrs.js +16 -0
- package/dist/attrs.js.map +1 -0
- package/dist/badge/Badge.vue.d.ts +57 -0
- package/dist/badge/BadgeRibbon.vue.d.ts +34 -0
- package/dist/badge/index.d.ts +42 -0
- package/dist/badge/index.js +2 -0
- package/dist/build.d.ts +2 -0
- package/dist/button/Button.vue.d.ts +46 -0
- package/dist/button/ButtonGroup.vue.d.ts +13 -0
- package/dist/button/index.d.ts +13 -0
- package/dist/button/index.js +2 -0
- package/dist/checkbox/Checkbox.vue.d.ts +47 -0
- package/dist/checkbox/CheckboxGroup.vue.d.ts +38 -0
- package/dist/checkbox/index.d.ts +30 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/chunks/Progress-BL4KZ3HE.js +271 -0
- package/dist/chunks/Progress-BL4KZ3HE.js.map +1 -0
- package/dist/chunks/Skeleton-ohStUD4M.js +153 -0
- package/dist/chunks/Skeleton-ohStUD4M.js.map +1 -0
- package/dist/chunks/Table-DhXmuKQd.js +330 -0
- package/dist/chunks/Table-DhXmuKQd.js.map +1 -0
- package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/chunks/alert-CczW_DKs.js +190 -0
- package/dist/chunks/alert-CczW_DKs.js.map +1 -0
- package/dist/chunks/badge-BHOZeImh.js +287 -0
- package/dist/chunks/badge-BHOZeImh.js.map +1 -0
- package/dist/chunks/button-pDObrN_X.js +168 -0
- package/dist/chunks/button-pDObrN_X.js.map +1 -0
- package/dist/chunks/checkbox-9_0oR4kg.js +260 -0
- package/dist/chunks/checkbox-9_0oR4kg.js.map +1 -0
- package/dist/chunks/colorpicker-CcizUCQv.js +594 -0
- package/dist/chunks/colorpicker-CcizUCQv.js.map +1 -0
- package/dist/chunks/datepicker-Cy808x7X.js +1414 -0
- package/dist/chunks/datepicker-Cy808x7X.js.map +1 -0
- package/dist/chunks/drawer-C3JZ28Xo.js +193 -0
- package/dist/chunks/drawer-C3JZ28Xo.js.map +1 -0
- package/dist/chunks/dropdown-0l967g7D.js +329 -0
- package/dist/chunks/dropdown-0l967g7D.js.map +1 -0
- package/dist/chunks/form-Qeqkd-HH.js +642 -0
- package/dist/chunks/form-Qeqkd-HH.js.map +1 -0
- package/dist/chunks/input-BDOXVCrK.js +1281 -0
- package/dist/chunks/input-BDOXVCrK.js.map +1 -0
- package/dist/chunks/inputOtp-Dyxj9lNj.js +261 -0
- package/dist/chunks/inputOtp-Dyxj9lNj.js.map +1 -0
- package/dist/chunks/message-xPfuG0EX.js +107 -0
- package/dist/chunks/message-xPfuG0EX.js.map +1 -0
- package/dist/chunks/millercolumns-Dp3fBrq6.js +426 -0
- package/dist/chunks/millercolumns-Dp3fBrq6.js.map +1 -0
- package/dist/chunks/modal-D6l1iIvE.js +81 -0
- package/dist/chunks/modal-D6l1iIvE.js.map +1 -0
- package/dist/chunks/pagination-Bc583AQX.js +265 -0
- package/dist/chunks/pagination-Bc583AQX.js.map +1 -0
- package/dist/chunks/popconfirm-D6lUfSxG.js +343 -0
- package/dist/chunks/popconfirm-D6lUfSxG.js.map +1 -0
- package/dist/chunks/qrcode-B0t_pZna.js +1099 -0
- package/dist/chunks/qrcode-B0t_pZna.js.map +1 -0
- package/dist/chunks/radio-DnYm59xH.js +477 -0
- package/dist/chunks/radio-DnYm59xH.js.map +1 -0
- package/dist/chunks/rate-0sme__Kb.js +309 -0
- package/dist/chunks/rate-0sme__Kb.js.map +1 -0
- package/dist/chunks/select-ChTfQM5u.js +417 -0
- package/dist/chunks/select-ChTfQM5u.js.map +1 -0
- package/dist/chunks/slider-C-W5GzTP.js +724 -0
- package/dist/chunks/slider-C-W5GzTP.js.map +1 -0
- package/dist/chunks/splitter-CgfiXY65.js +524 -0
- package/dist/chunks/splitter-CgfiXY65.js.map +1 -0
- package/dist/chunks/switch-BULGbODP.js +327 -0
- package/dist/chunks/switch-BULGbODP.js.map +1 -0
- package/dist/chunks/tab-Dxfg1_To.js +663 -0
- package/dist/chunks/tab-Dxfg1_To.js.map +1 -0
- package/dist/chunks/tag-BYmNsrZC.js +167 -0
- package/dist/chunks/tag-BYmNsrZC.js.map +1 -0
- package/dist/chunks/timepicker-DsGIdcf8.js +1059 -0
- package/dist/chunks/timepicker-DsGIdcf8.js.map +1 -0
- package/dist/chunks/tooltip-DMhiAqto.js +242 -0
- package/dist/chunks/tooltip-DMhiAqto.js.map +1 -0
- package/dist/colorpicker/ColorPicker.vue.d.ts +30 -0
- package/dist/colorpicker/color.d.ts +56 -0
- package/dist/colorpicker/color.js +99 -0
- package/dist/colorpicker/color.js.map +1 -0
- package/dist/colorpicker/index.d.ts +12 -0
- package/dist/colorpicker/index.js +2 -0
- package/dist/config.d.ts +55 -0
- package/dist/config.js +260 -0
- package/dist/config.js.map +1 -0
- package/dist/datepicker/DatePicker.vue.d.ts +82 -0
- package/dist/datepicker/RangePicker.vue.d.ts +87 -0
- package/dist/datepicker/index.d.ts +59 -0
- package/dist/datepicker/index.js +2 -0
- package/dist/drawer/Drawer.vue.d.ts +86 -0
- package/dist/drawer/index.d.ts +23 -0
- package/dist/drawer/index.js +2 -0
- package/dist/dropdown/Dropdown.vue.d.ts +118 -0
- package/dist/dropdown/index.d.ts +2 -0
- package/dist/dropdown/index.js +2 -0
- package/dist/form/Form.vue.d.ts +170 -0
- package/dist/form/FormItem.vue.d.ts +83 -0
- package/dist/form/index.d.ts +176 -0
- package/dist/form/index.js +2 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +32 -0
- package/dist/input/Autocomplete.vue.d.ts +121 -0
- package/dist/input/Input.vue.d.ts +142 -0
- package/dist/input/InputI18n.vue.d.ts +80 -0
- package/dist/input/InputTag.vue.d.ts +114 -0
- package/dist/input/index.d.ts +41 -0
- package/dist/input/index.js +2 -0
- package/dist/inputOtp/InputOtp.vue.d.ts +60 -0
- package/dist/inputOtp/index.d.ts +21 -0
- package/dist/inputOtp/index.js +2 -0
- package/dist/message/MessageContainer.vue.d.ts +11 -0
- package/dist/message/index.d.ts +20 -0
- package/dist/message/index.js +2 -0
- package/dist/message/types.d.ts +25 -0
- package/dist/millercolumns/MillerColumns.vue.d.ts +88 -0
- package/dist/millercolumns/index.d.ts +39 -0
- package/dist/millercolumns/index.js +2 -0
- package/dist/modal/Modal.vue.d.ts +54 -0
- package/dist/modal/index.d.ts +2 -0
- package/dist/modal/index.js +2 -0
- package/dist/pagination/Pagination.vue.d.ts +70 -0
- package/dist/pagination/index.d.ts +12 -0
- package/dist/pagination/index.js +2 -0
- package/dist/popconfirm/Popconfirm.vue.d.ts +104 -0
- package/dist/popconfirm/index.d.ts +36 -0
- package/dist/popconfirm/index.js +2 -0
- package/dist/progress/Progress.vue.d.ts +64 -0
- package/dist/progress/index.d.ts +26 -0
- package/dist/progress/index.js +2 -0
- package/dist/qrcode/QRCode.vue.d.ts +87 -0
- package/dist/qrcode/index.d.ts +43 -0
- package/dist/qrcode/index.js +2 -0
- package/dist/qrcode/qr.d.ts +51 -0
- package/dist/qrcode/qrcodegen.d.ts +94 -0
- package/dist/radio/Radio.vue.d.ts +52 -0
- package/dist/radio/RadioGroup.vue.d.ts +44 -0
- package/dist/radio/index.d.ts +55 -0
- package/dist/radio/index.js +2 -0
- package/dist/rate/Rate.vue.d.ts +100 -0
- package/dist/rate/index.d.ts +38 -0
- package/dist/rate/index.js +2 -0
- package/dist/select/Select.vue.d.ts +129 -0
- package/dist/select/index.d.ts +33 -0
- package/dist/select/index.js +2 -0
- package/dist/skeleton/Skeleton.vue.d.ts +31 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/slider/Slider.vue.d.ts +81 -0
- package/dist/slider/index.d.ts +61 -0
- package/dist/slider/index.js +2 -0
- package/dist/splitter/Splitter.vue.d.ts +63 -0
- package/dist/splitter/SplitterPanel.vue.d.ts +53 -0
- package/dist/splitter/index.d.ts +39 -0
- package/dist/splitter/index.js +2 -0
- package/dist/style.css +2 -0
- package/dist/switch/Switch.vue.d.ts +97 -0
- package/dist/switch/index.d.ts +31 -0
- package/dist/switch/index.js +2 -0
- package/dist/tab/TabPane.vue.d.ts +32 -0
- package/dist/tab/Tabs.vue.d.ts +87 -0
- package/dist/tab/index.d.ts +78 -0
- package/dist/tab/index.js +2 -0
- package/dist/table/Table.vue.d.ts +96 -0
- package/dist/table/index.d.ts +3 -0
- package/dist/table/index.js +2 -0
- package/dist/table/types.d.ts +35 -0
- package/dist/table/types.js +0 -0
- package/dist/tag/Tag.vue.d.ts +46 -0
- package/dist/tag/index.d.ts +11 -0
- package/dist/tag/index.js +2 -0
- package/dist/timepicker/TimePicker.vue.d.ts +92 -0
- package/dist/timepicker/TimeRangePicker.vue.d.ts +90 -0
- package/dist/timepicker/index.d.ts +39 -0
- package/dist/timepicker/index.js +2 -0
- package/dist/tooltip/Tooltip.vue.d.ts +79 -0
- package/dist/tooltip/index.d.ts +14 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/uno.d.ts +32 -0
- package/dist/uno.js +83 -0
- package/dist/uno.js.map +1 -0
- package/dist/utils/DnD.d.ts +38 -0
- package/package.json +115 -0
|
@@ -0,0 +1,1414 @@
|
|
|
1
|
+
import { r as e } from "./button-pDObrN_X.js";
|
|
2
|
+
import { getUiExposeAttrs as t } from "../attrs.js";
|
|
3
|
+
import { t as n } from "./dropdown-0l967g7D.js";
|
|
4
|
+
import { cva as r } from "class-variance-authority";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as ee, createVNode as u, defineComponent as d, mergeProps as te, nextTick as ne, normalizeClass as f, openBlock as p, ref as m, renderList as h, toDisplayString as g, unref as _, useAttrs as re, watch as ie, withCtx as ae, withModifiers as oe } from "vue";
|
|
6
|
+
import { clsx as se } from "clsx";
|
|
7
|
+
import v from "dayjs";
|
|
8
|
+
import ce from "dayjs/plugin/customParseFormat";
|
|
9
|
+
//#region src/datepicker/DatePicker.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var le = ["tabindex", "aria-expanded"], y = ["title"], b = ["name", "value"], ue = { class: "flex shrink-0 items-center gap-1 pr-2 text-tertiary" }, x = { class: "select-none bg-primary text-primary" }, de = { class: "min-w-0" }, S = { class: "flex h-11 items-center justify-between gap-2 border-b border-medium px-2" }, fe = { class: "flex items-center" }, C = { class: "min-w-0 truncate text-sm font-bold text-primary" }, w = { key: 2 }, T = { class: "flex items-center" }, E = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "grid grid-cols-7 gap-1 px-3 pb-2 pt-3"
|
|
13
|
+
}, D = ["disabled", "onClick"], pe = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "grid grid-cols-3 gap-2 p-3"
|
|
16
|
+
}, me = ["disabled", "onClick"], he = {
|
|
17
|
+
key: 2,
|
|
18
|
+
class: "grid grid-cols-3 gap-2 p-3"
|
|
19
|
+
}, ge = ["disabled", "onClick"], _e = { class: "min-w-0 border-r border-medium" }, O = { class: "max-h-[254px] overflow-y-auto p-1" }, ve = ["disabled", "onClick"], k = { class: "max-h-[254px] overflow-y-auto p-1" }, A = ["disabled", "onClick"], ye = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "min-w-0"
|
|
22
|
+
}, be = { class: "max-h-[254px] overflow-y-auto p-1" }, xe = ["disabled", "onClick"], j = { class: "flex min-h-11 items-center justify-between gap-3 border-t border-medium px-3 py-2" }, Se = ["disabled"], Ce = { class: "flex min-w-0 items-center justify-end gap-2" }, we = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "min-w-0 truncate font-mono text-xs text-tertiary"
|
|
25
|
+
}, M = "YYYY-MM-DD", Te = "YYYY-MM", Ee = "YYYY", De = "HH:mm:ss", Oe = "flex size-7 items-center justify-center rounded text-tertiary transition-colors hover:bg-secondary hover:text-primary", N = /* @__PURE__ */ d({
|
|
26
|
+
inheritAttrs: !1,
|
|
27
|
+
__name: "DatePicker",
|
|
28
|
+
props: {
|
|
29
|
+
modelValue: { default: void 0 },
|
|
30
|
+
picker: { default: "date" },
|
|
31
|
+
format: { default: void 0 },
|
|
32
|
+
valueFormat: { default: void 0 },
|
|
33
|
+
placeholder: { default: void 0 },
|
|
34
|
+
size: { default: "md" },
|
|
35
|
+
disabled: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !1
|
|
38
|
+
},
|
|
39
|
+
clearable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
showTime: {
|
|
44
|
+
type: [Boolean, Object],
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
disabledDate: {
|
|
48
|
+
type: Function,
|
|
49
|
+
default: void 0
|
|
50
|
+
},
|
|
51
|
+
minDate: { default: void 0 },
|
|
52
|
+
maxDate: { default: void 0 },
|
|
53
|
+
suffixIcon: { default: "i-lucide:calendar-days" },
|
|
54
|
+
clearIcon: { default: "i-lucide:x" },
|
|
55
|
+
teleportedWidth: { default: void 0 },
|
|
56
|
+
name: { default: void 0 }
|
|
57
|
+
},
|
|
58
|
+
emits: [
|
|
59
|
+
"update:modelValue",
|
|
60
|
+
"change",
|
|
61
|
+
"clear",
|
|
62
|
+
"ok",
|
|
63
|
+
"visible-change",
|
|
64
|
+
"panel-change",
|
|
65
|
+
"focus",
|
|
66
|
+
"blur"
|
|
67
|
+
],
|
|
68
|
+
setup(r, { expose: u, emit: d }) {
|
|
69
|
+
v.extend(ce);
|
|
70
|
+
let N = r, P = d, ke = re(), F = m(!1), Ae = m(!1), I = m(null), L = m(v().startOf("month")), R = m("date"), je = m(null), Me = [
|
|
71
|
+
"一",
|
|
72
|
+
"二",
|
|
73
|
+
"三",
|
|
74
|
+
"四",
|
|
75
|
+
"五",
|
|
76
|
+
"六",
|
|
77
|
+
"日"
|
|
78
|
+
], Ne = a(() => !!N.showTime), Pe = a(() => typeof N.showTime == "object" ? N.showTime : {}), Fe = a(() => Pe.value.format || De), z = a(() => N.picker || "date"), Ie = a(() => z.value === "year" ? Ee : z.value === "month" ? Te : M), B = a(() => z.value === "date" && Ne.value), V = a(() => N.format || (B.value ? `${M} ${Fe.value}` : Ie.value)), Le = a(() => N.placeholder ? N.placeholder : B.value ? "请选择日期时间" : z.value === "year" ? "请选择年份" : z.value === "month" ? "请选择月份" : "请选择日期"), Re = a(() => Pe.value.showSecond ?? Fe.value.includes("ss")), ze = a(() => N.teleportedWidth || (B.value ? "456px" : "320px")), H = a(() => at(N.modelValue)), Be = a(() => H.value?.format(V.value) || ""), Ve = a(() => H.value?.format(N.valueFormat || V.value) || ""), He = a(() => !!H.value), Ue = a(() => N.clearable && He.value && !N.disabled), We = a(() => I.value || H.value), U = a(() => it(N.minDate)), W = a(() => it(N.maxDate)), G = a(() => I.value || H.value || v()), Ge = a(() => gt(v())), Ke = a(() => {
|
|
79
|
+
if (R.value === "year") {
|
|
80
|
+
let e = ct(L.value);
|
|
81
|
+
return `${e} - ${e + 11}`;
|
|
82
|
+
}
|
|
83
|
+
return R.value === "month" ? L.value.format("YYYY年") : L.value.format("YYYY年M月");
|
|
84
|
+
}), qe = a(() => L.value.format("YYYY年")), Je = a(() => L.value.format("M月")), Ye = a(() => se(ke.class, dt({
|
|
85
|
+
size: N.size,
|
|
86
|
+
focused: F.value || Ae.value,
|
|
87
|
+
disabled: N.disabled
|
|
88
|
+
}))), Xe = a(() => {
|
|
89
|
+
let e = st(L.value.startOf("month")), t = We.value;
|
|
90
|
+
return Array.from({ length: 42 }, (n, r) => {
|
|
91
|
+
let i = e.add(r, "day");
|
|
92
|
+
return {
|
|
93
|
+
date: i,
|
|
94
|
+
key: i.format("YYYY-MM-DD"),
|
|
95
|
+
inMonth: i.month() === L.value.month(),
|
|
96
|
+
selected: !!t?.isSame(i, "day"),
|
|
97
|
+
today: i.isSame(v(), "day"),
|
|
98
|
+
disabled: ut(i)
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
}), Ze = a(() => {
|
|
102
|
+
let e = We.value, t = v();
|
|
103
|
+
return Array.from({ length: 12 }, (n, r) => {
|
|
104
|
+
let i = L.value.month(r).startOf("month");
|
|
105
|
+
return {
|
|
106
|
+
date: i,
|
|
107
|
+
key: i.format("YYYY-MM"),
|
|
108
|
+
label: `${r + 1}月`,
|
|
109
|
+
selected: !!e?.isSame(i, "month"),
|
|
110
|
+
current: t.isSame(i, "month"),
|
|
111
|
+
disabled: q(i)
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
}), Qe = a(() => {
|
|
115
|
+
let e = We.value, t = v(), n = ct(L.value);
|
|
116
|
+
return Array.from({ length: 12 }, (r, i) => {
|
|
117
|
+
let a = L.value.year(n + i).startOf("year");
|
|
118
|
+
return {
|
|
119
|
+
date: a,
|
|
120
|
+
key: a.format("YYYY"),
|
|
121
|
+
label: a.format("YYYY"),
|
|
122
|
+
selected: !!e?.isSame(a, "year"),
|
|
123
|
+
current: t.isSame(a, "year"),
|
|
124
|
+
disabled: mt(a)
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
}), $e = a(() => K(lt(Pe.value.hourStep, 23), G.value.hour(), 23)), et = a(() => K(lt(Pe.value.minuteStep, 59), G.value.minute(), 59)), tt = a(() => K(lt(Pe.value.secondStep, 59), G.value.second(), 59));
|
|
128
|
+
ie(() => N.modelValue, () => {
|
|
129
|
+
let e = H.value;
|
|
130
|
+
F.value || (I.value = e, L.value = (e || L.value || v()).startOf("month"));
|
|
131
|
+
}, { immediate: !0 }), ie(F, (e) => {
|
|
132
|
+
P("visible-change", e), e && (I.value = H.value, L.value = (H.value || I.value || v()).startOf("month"), R.value = z.value);
|
|
133
|
+
});
|
|
134
|
+
function nt(e, t) {
|
|
135
|
+
for (let n of t) {
|
|
136
|
+
let t = v(e, n, !0);
|
|
137
|
+
if (t.isValid()) return t;
|
|
138
|
+
}
|
|
139
|
+
let n = v(e);
|
|
140
|
+
return n.isValid() ? n : null;
|
|
141
|
+
}
|
|
142
|
+
function rt() {
|
|
143
|
+
return Array.from(new Set([
|
|
144
|
+
N.valueFormat,
|
|
145
|
+
V.value,
|
|
146
|
+
N.format,
|
|
147
|
+
`${M} ${De}`,
|
|
148
|
+
`${M} HH:mm`,
|
|
149
|
+
M,
|
|
150
|
+
Te,
|
|
151
|
+
Ee,
|
|
152
|
+
"YYYY/MM/DD HH:mm:ss",
|
|
153
|
+
"YYYY/MM/DD",
|
|
154
|
+
"YYYY/MM"
|
|
155
|
+
].filter(Boolean)));
|
|
156
|
+
}
|
|
157
|
+
function it(e) {
|
|
158
|
+
if (e == null || e === "") return null;
|
|
159
|
+
if (v.isDayjs(e)) return e.isValid() ? e.millisecond(0) : null;
|
|
160
|
+
if (e instanceof Date || typeof e == "number") {
|
|
161
|
+
let t = v(e);
|
|
162
|
+
return t.isValid() ? t.millisecond(0) : null;
|
|
163
|
+
}
|
|
164
|
+
return typeof e == "string" ? nt(e, rt())?.millisecond(0) ?? null : null;
|
|
165
|
+
}
|
|
166
|
+
function at(e) {
|
|
167
|
+
return it(e);
|
|
168
|
+
}
|
|
169
|
+
function ot(e) {
|
|
170
|
+
let t = e.millisecond(0);
|
|
171
|
+
return N.valueFormat ? t.format(N.valueFormat) : v.isDayjs(N.modelValue) ? t : N.modelValue instanceof Date ? t.toDate() : typeof N.modelValue == "number" ? t.valueOf() : t.format(V.value);
|
|
172
|
+
}
|
|
173
|
+
function st(e) {
|
|
174
|
+
let t = e.day(), n = t === 0 ? 6 : t - 1;
|
|
175
|
+
return e.subtract(n, "day").startOf("day");
|
|
176
|
+
}
|
|
177
|
+
function ct(e) {
|
|
178
|
+
return Math.floor(e.year() / 12) * 12;
|
|
179
|
+
}
|
|
180
|
+
function lt(e, t) {
|
|
181
|
+
let n = Number.isFinite(e) && e && e > 0 ? Math.floor(e) : 1, r = [];
|
|
182
|
+
for (let e = 0; e <= t; e += n) r.push(e);
|
|
183
|
+
return r;
|
|
184
|
+
}
|
|
185
|
+
function K(e, t, n) {
|
|
186
|
+
let r = Math.min(n, Math.max(0, t));
|
|
187
|
+
return e.includes(r) ? e : [...e, r].sort((e, t) => e - t);
|
|
188
|
+
}
|
|
189
|
+
function ut(e) {
|
|
190
|
+
return !!(N.disabledDate?.(e) || U.value && e.isBefore(U.value, "day") || W.value && e.isAfter(W.value, "day"));
|
|
191
|
+
}
|
|
192
|
+
function q(e) {
|
|
193
|
+
let t = e.startOf("month"), n = e.endOf("month");
|
|
194
|
+
return U.value && n.isBefore(U.value, "day") || W.value && t.isAfter(W.value, "day") ? !0 : !!(N.disabledDate?.(t) && N.disabledDate?.(n));
|
|
195
|
+
}
|
|
196
|
+
function mt(e) {
|
|
197
|
+
let t = e.startOf("year"), n = e.endOf("year");
|
|
198
|
+
return U.value && n.isBefore(U.value, "day") || W.value && t.isAfter(W.value, "day") ? !0 : !!(N.disabledDate?.(t) && N.disabledDate?.(n));
|
|
199
|
+
}
|
|
200
|
+
function gt(e) {
|
|
201
|
+
return z.value === "year" ? mt(e) : z.value === "month" ? q(e) : ut(e);
|
|
202
|
+
}
|
|
203
|
+
function Y(e, t) {
|
|
204
|
+
if (!B.value) return !1;
|
|
205
|
+
let n = G.value, r = n;
|
|
206
|
+
return e === "hour" && (r = n.hour(t)), e === "minute" && (r = n.minute(t)), e === "second" && (r = n.second(t)), !!(U.value && r.isBefore(U.value) || W.value && r.isAfter(W.value));
|
|
207
|
+
}
|
|
208
|
+
function _t(e) {
|
|
209
|
+
if (z.value === "year" && mt(e) || z.value === "month" && q(e) || z.value === "date" && ut(e)) return null;
|
|
210
|
+
let t = e;
|
|
211
|
+
return z.value === "year" ? t = e.startOf("year") : z.value === "month" ? t = e.startOf("month") : B.value || (t = e.startOf("day")), B.value && (U.value && t.isBefore(U.value) && (t = U.value), W.value && t.isAfter(W.value) && (t = W.value)), t.millisecond(0);
|
|
212
|
+
}
|
|
213
|
+
function X(e, t, n = !1) {
|
|
214
|
+
let r = _t(e);
|
|
215
|
+
if (!r) return;
|
|
216
|
+
let i = ot(r), a = r.format(V.value);
|
|
217
|
+
I.value = r, L.value = r.startOf("month"), P("update:modelValue", i), P("change", i, a), n && P("ok", i, a), t && (F.value = !1);
|
|
218
|
+
}
|
|
219
|
+
function vt(e) {
|
|
220
|
+
e?.stopPropagation(), Ue.value && (I.value = null, P("update:modelValue", null), P("change", null, ""), P("clear"));
|
|
221
|
+
}
|
|
222
|
+
function yt(e) {
|
|
223
|
+
N.disabled || (F.value = e);
|
|
224
|
+
}
|
|
225
|
+
function bt() {
|
|
226
|
+
yt(!0);
|
|
227
|
+
}
|
|
228
|
+
function xt(e) {
|
|
229
|
+
N.disabled || (e.key === "Enter" || e.key === " " ? (e.preventDefault(), yt(!F.value)) : e.key === "Escape" ? F.value = !1 : e.key === "ArrowDown" && (e.preventDefault(), yt(!0)));
|
|
230
|
+
}
|
|
231
|
+
function St(e) {
|
|
232
|
+
Ae.value = !0, P("focus", e);
|
|
233
|
+
}
|
|
234
|
+
function Ct(e) {
|
|
235
|
+
Ae.value = !1, P("blur", e);
|
|
236
|
+
}
|
|
237
|
+
function wt(e) {
|
|
238
|
+
R.value === "date" && (L.value = L.value.add(e, "month"), P("panel-change", L.value));
|
|
239
|
+
}
|
|
240
|
+
function Tt(e) {
|
|
241
|
+
L.value = L.value.add(R.value === "year" ? e * 12 : e, "year"), P("panel-change", L.value);
|
|
242
|
+
}
|
|
243
|
+
function Et(e) {
|
|
244
|
+
e !== R.value && (R.value = e);
|
|
245
|
+
}
|
|
246
|
+
function Dt(e) {
|
|
247
|
+
if (ut(e)) return;
|
|
248
|
+
let t = G.value, n = e.hour(t.hour()).minute(t.minute()).second(Re.value ? t.second() : 0).millisecond(0);
|
|
249
|
+
if (B.value) {
|
|
250
|
+
I.value = _t(n);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
X(n, !0);
|
|
254
|
+
}
|
|
255
|
+
function Ot(e) {
|
|
256
|
+
if (!q(e)) {
|
|
257
|
+
if (z.value === "date") {
|
|
258
|
+
L.value = L.value.year(e.year()).month(e.month()).startOf("month"), R.value = "date", P("panel-change", L.value);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
X(e, !0);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function kt(e) {
|
|
265
|
+
if (!mt(e)) {
|
|
266
|
+
if (z.value !== "year") {
|
|
267
|
+
L.value = L.value.year(e.year()).startOf("month"), R.value = "month", P("panel-change", L.value);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
X(e, !0);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function At(e, t) {
|
|
274
|
+
if (Y(e, t)) return;
|
|
275
|
+
let n = I.value || H.value || v(), r = n;
|
|
276
|
+
e === "hour" && (r = n.hour(t)), e === "minute" && (r = n.minute(t)), e === "second" && (r = n.second(t)), I.value = _t(r) || r;
|
|
277
|
+
}
|
|
278
|
+
function jt() {
|
|
279
|
+
let e = v().millisecond(0);
|
|
280
|
+
if (B.value) {
|
|
281
|
+
I.value = _t(e), L.value = e.startOf("month");
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
X(e, !0);
|
|
285
|
+
}
|
|
286
|
+
function Mt() {
|
|
287
|
+
X(I.value || H.value || v(), !0, !0);
|
|
288
|
+
}
|
|
289
|
+
function Z(e, t) {
|
|
290
|
+
let n = G.value;
|
|
291
|
+
return e === "hour" ? n.hour() === t : e === "minute" ? n.minute() === t : n.second() === t;
|
|
292
|
+
}
|
|
293
|
+
function Nt(e) {
|
|
294
|
+
return J({
|
|
295
|
+
inMonth: e.inMonth,
|
|
296
|
+
selected: e.selected,
|
|
297
|
+
today: e.today,
|
|
298
|
+
disabled: e.disabled
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
function Q(e) {
|
|
302
|
+
return pt({
|
|
303
|
+
selected: e.selected,
|
|
304
|
+
current: e.current,
|
|
305
|
+
disabled: e.disabled,
|
|
306
|
+
muted: e.muted
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
function Pt() {
|
|
310
|
+
je.value?.focus();
|
|
311
|
+
}
|
|
312
|
+
function Ft() {
|
|
313
|
+
je.value?.blur();
|
|
314
|
+
}
|
|
315
|
+
return ie(() => [B.value, Fe.value], () => {
|
|
316
|
+
ne(() => {
|
|
317
|
+
!B.value && I.value && (I.value = _t(I.value));
|
|
318
|
+
});
|
|
319
|
+
}), u({
|
|
320
|
+
blur: Ft,
|
|
321
|
+
clear: vt,
|
|
322
|
+
focus: Pt
|
|
323
|
+
}), (a, u) => (p(), o(_(n), {
|
|
324
|
+
open: F.value,
|
|
325
|
+
"onUpdate:open": u[7] ||= (e) => F.value = e,
|
|
326
|
+
width: ze.value,
|
|
327
|
+
"min-width": ze.value,
|
|
328
|
+
"focus-on-open": !1,
|
|
329
|
+
"content-class": "ui-datepicker-dropdown"
|
|
330
|
+
}, {
|
|
331
|
+
trigger: ae(() => [l("div", te({
|
|
332
|
+
ref_key: "triggerRef",
|
|
333
|
+
ref: je
|
|
334
|
+
}, _(t)(_(ke)), {
|
|
335
|
+
class: Ye.value,
|
|
336
|
+
style: _(ke).style,
|
|
337
|
+
"data-ui-datepicker": "true",
|
|
338
|
+
tabindex: r.disabled ? void 0 : 0,
|
|
339
|
+
role: "combobox",
|
|
340
|
+
"aria-expanded": F.value,
|
|
341
|
+
"aria-haspopup": "dialog",
|
|
342
|
+
onClick: oe(bt, ["stop"]),
|
|
343
|
+
onKeydown: xt,
|
|
344
|
+
onFocus: St,
|
|
345
|
+
onBlur: Ct
|
|
346
|
+
}), [
|
|
347
|
+
l("span", {
|
|
348
|
+
class: f(_(ft)({ size: r.size })),
|
|
349
|
+
title: Be.value
|
|
350
|
+
}, [l("span", { class: f(Be.value ? "text-primary" : "text-tertiary/60") }, g(Be.value || Le.value), 3)], 10, y),
|
|
351
|
+
r.name ? (p(), c("input", {
|
|
352
|
+
key: 0,
|
|
353
|
+
type: "hidden",
|
|
354
|
+
name: r.name,
|
|
355
|
+
value: Ve.value
|
|
356
|
+
}, null, 8, b)) : s("", !0),
|
|
357
|
+
l("span", ue, [Ue.value ? (p(), c("button", {
|
|
358
|
+
key: 0,
|
|
359
|
+
type: "button",
|
|
360
|
+
"aria-label": "清空",
|
|
361
|
+
class: "flex size-4 items-center justify-center rounded-full bg-tertiary/90 text-tertiary/60 opacity-0 transition-all duration-150 hover:bg-tertiary hover:text-tertiary group-hover/ui-datepicker:opacity-100 group-focus-within/ui-datepicker:opacity-100",
|
|
362
|
+
onClick: vt
|
|
363
|
+
}, [l("span", { class: f([r.clearIcon, "size-3"]) }, null, 2)])) : s("", !0), l("span", { class: f([r.suffixIcon, "size-4"]) }, null, 2)])
|
|
364
|
+
], 16, le)]),
|
|
365
|
+
default: ae(() => [l("div", x, [l("div", { class: f(["grid", B.value ? "grid-cols-[minmax(0,1fr)_136px]" : "grid-cols-1"]) }, [l("div", de, [l("div", S, [
|
|
366
|
+
l("div", fe, [l("button", {
|
|
367
|
+
type: "button",
|
|
368
|
+
class: f(Oe),
|
|
369
|
+
"aria-label": "上一年",
|
|
370
|
+
onClick: u[0] ||= (e) => Tt(-1)
|
|
371
|
+
}, [...u[8] ||= [l("span", { class: "i-lucide:chevrons-left size-4" }, null, -1)]]), R.value === "date" ? (p(), c("button", {
|
|
372
|
+
key: 0,
|
|
373
|
+
type: "button",
|
|
374
|
+
class: f(Oe),
|
|
375
|
+
"aria-label": "上一月",
|
|
376
|
+
onClick: u[1] ||= (e) => wt(-1)
|
|
377
|
+
}, [...u[9] ||= [l("span", { class: "i-lucide:chevron-left size-4" }, null, -1)]])) : s("", !0)]),
|
|
378
|
+
l("div", C, [R.value === "date" ? (p(), c(i, { key: 0 }, [l("button", {
|
|
379
|
+
type: "button",
|
|
380
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
381
|
+
onClick: u[2] ||= (e) => Et("year")
|
|
382
|
+
}, g(qe.value), 1), l("button", {
|
|
383
|
+
type: "button",
|
|
384
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
385
|
+
onClick: u[3] ||= (e) => Et("month")
|
|
386
|
+
}, g(Je.value), 1)], 64)) : R.value === "month" ? (p(), c("button", {
|
|
387
|
+
key: 1,
|
|
388
|
+
type: "button",
|
|
389
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
390
|
+
onClick: u[4] ||= (e) => Et("year")
|
|
391
|
+
}, g(Ke.value), 1)) : (p(), c("span", w, g(Ke.value), 1))]),
|
|
392
|
+
l("div", T, [R.value === "date" ? (p(), c("button", {
|
|
393
|
+
key: 0,
|
|
394
|
+
type: "button",
|
|
395
|
+
class: f(Oe),
|
|
396
|
+
"aria-label": "下一月",
|
|
397
|
+
onClick: u[5] ||= (e) => wt(1)
|
|
398
|
+
}, [...u[10] ||= [l("span", { class: "i-lucide:chevron-right size-4" }, null, -1)]])) : s("", !0), l("button", {
|
|
399
|
+
type: "button",
|
|
400
|
+
class: f(Oe),
|
|
401
|
+
"aria-label": "下一年",
|
|
402
|
+
onClick: u[6] ||= (e) => Tt(1)
|
|
403
|
+
}, [...u[11] ||= [l("span", { class: "i-lucide:chevrons-right size-4" }, null, -1)]])])
|
|
404
|
+
]), R.value === "date" ? (p(), c("div", E, [(p(), c(i, null, h(Me, (e) => l("div", {
|
|
405
|
+
key: e,
|
|
406
|
+
class: "flex h-6 items-center justify-center text-xs font-medium text-tertiary"
|
|
407
|
+
}, g(e), 1)), 64)), (p(!0), c(i, null, h(Xe.value, (e) => (p(), c("button", {
|
|
408
|
+
key: e.key,
|
|
409
|
+
type: "button",
|
|
410
|
+
class: f(Nt(e)),
|
|
411
|
+
disabled: e.disabled,
|
|
412
|
+
onClick: (t) => Dt(e.date)
|
|
413
|
+
}, g(e.date.date()), 11, D))), 128))])) : R.value === "month" ? (p(), c("div", pe, [(p(!0), c(i, null, h(Ze.value, (e) => (p(), c("button", {
|
|
414
|
+
key: e.key,
|
|
415
|
+
type: "button",
|
|
416
|
+
class: f(Q(e)),
|
|
417
|
+
disabled: e.disabled,
|
|
418
|
+
onClick: (t) => Ot(e.date)
|
|
419
|
+
}, g(e.label), 11, me))), 128))])) : (p(), c("div", he, [(p(!0), c(i, null, h(Qe.value, (e) => (p(), c("button", {
|
|
420
|
+
key: e.key,
|
|
421
|
+
type: "button",
|
|
422
|
+
class: f(Q(e)),
|
|
423
|
+
disabled: e.disabled,
|
|
424
|
+
onClick: (t) => kt(e.date)
|
|
425
|
+
}, g(e.label), 11, ge))), 128))]))]), B.value ? (p(), c("div", {
|
|
426
|
+
key: 0,
|
|
427
|
+
class: f(["grid min-w-0 border-l border-medium", Re.value ? "grid-cols-3" : "grid-cols-2"])
|
|
428
|
+
}, [
|
|
429
|
+
l("div", _e, [u[12] ||= l("div", { class: "h-8 border-b border-medium text-center text-xs/8 text-tertiary" }, "时", -1), l("div", O, [(p(!0), c(i, null, h($e.value, (e) => (p(), c("button", {
|
|
430
|
+
key: e,
|
|
431
|
+
type: "button",
|
|
432
|
+
class: f(_(ht)({
|
|
433
|
+
selected: Z("hour", e),
|
|
434
|
+
disabled: Y("hour", e)
|
|
435
|
+
})),
|
|
436
|
+
disabled: Y("hour", e),
|
|
437
|
+
onClick: (t) => At("hour", e)
|
|
438
|
+
}, g(String(e).padStart(2, "0")), 11, ve))), 128))])]),
|
|
439
|
+
l("div", { class: f(["min-w-0", Re.value ? "border-r border-medium" : ""]) }, [u[13] ||= l("div", { class: "h-8 border-b border-medium text-center text-xs/8 text-tertiary" }, "分", -1), l("div", k, [(p(!0), c(i, null, h(et.value, (e) => (p(), c("button", {
|
|
440
|
+
key: e,
|
|
441
|
+
type: "button",
|
|
442
|
+
class: f(_(ht)({
|
|
443
|
+
selected: Z("minute", e),
|
|
444
|
+
disabled: Y("minute", e)
|
|
445
|
+
})),
|
|
446
|
+
disabled: Y("minute", e),
|
|
447
|
+
onClick: (t) => At("minute", e)
|
|
448
|
+
}, g(String(e).padStart(2, "0")), 11, A))), 128))])], 2),
|
|
449
|
+
Re.value ? (p(), c("div", ye, [u[14] ||= l("div", { class: "h-8 border-b border-medium text-center text-xs/8 text-tertiary" }, "秒", -1), l("div", be, [(p(!0), c(i, null, h(tt.value, (e) => (p(), c("button", {
|
|
450
|
+
key: e,
|
|
451
|
+
type: "button",
|
|
452
|
+
class: f(_(ht)({
|
|
453
|
+
selected: Z("second", e),
|
|
454
|
+
disabled: Y("second", e)
|
|
455
|
+
})),
|
|
456
|
+
disabled: Y("second", e),
|
|
457
|
+
onClick: (t) => At("second", e)
|
|
458
|
+
}, g(String(e).padStart(2, "0")), 11, xe))), 128))])])) : s("", !0)
|
|
459
|
+
], 2)) : s("", !0)], 2), l("div", j, [l("button", {
|
|
460
|
+
type: "button",
|
|
461
|
+
class: "text-xs text-brand-500 transition-colors hover:text-brand-600 disabled:pointer-events-none disabled:opacity-40",
|
|
462
|
+
disabled: Ge.value,
|
|
463
|
+
onClick: jt
|
|
464
|
+
}, g(B.value ? "此刻" : z.value === "year" ? "今年" : z.value === "month" ? "本月" : "今天"), 9, Se), l("div", Ce, [B.value ? (p(), c("span", we, g((I.value || H.value || _(v)()).format(V.value)), 1)) : s("", !0), B.value ? (p(), o(_(e), {
|
|
465
|
+
key: 1,
|
|
466
|
+
size: "sm",
|
|
467
|
+
onClick: Mt
|
|
468
|
+
}, {
|
|
469
|
+
default: ae(() => [...u[15] ||= [ee("确定", -1)]]),
|
|
470
|
+
_: 1
|
|
471
|
+
})) : s("", !0)])])])]),
|
|
472
|
+
_: 1
|
|
473
|
+
}, 8, [
|
|
474
|
+
"open",
|
|
475
|
+
"width",
|
|
476
|
+
"min-width"
|
|
477
|
+
]));
|
|
478
|
+
}
|
|
479
|
+
}), P = ["tabindex", "aria-expanded"], ke = ["title"], F = ["data-ui-range-picker-side-active"], Ae = ["data-ui-range-picker-side-active"], I = ["name", "value"], L = { class: "flex shrink-0 items-center gap-1 pr-2 text-tertiary" }, R = { class: "select-none bg-primary text-primary" }, je = {
|
|
480
|
+
key: 0,
|
|
481
|
+
class: "grid grid-cols-1 gap-0 sm:grid-cols-[minmax(0,1fr)_216px]"
|
|
482
|
+
}, Me = {
|
|
483
|
+
class: "min-w-0",
|
|
484
|
+
"data-ui-range-picker-panel": "active"
|
|
485
|
+
}, Ne = { class: "flex h-11 items-center justify-between gap-2 border-b border-medium px-2" }, Pe = { class: "min-w-0 truncate text-sm font-bold text-primary" }, Fe = {
|
|
486
|
+
key: 0,
|
|
487
|
+
class: "grid grid-cols-7 gap-1 px-3 pb-3 pt-3"
|
|
488
|
+
}, z = [
|
|
489
|
+
"disabled",
|
|
490
|
+
"data-ui-range-picker-date-cell",
|
|
491
|
+
"data-ui-range-picker-date-selected",
|
|
492
|
+
"data-ui-range-picker-date-in-range",
|
|
493
|
+
"onClick"
|
|
494
|
+
], Ie = {
|
|
495
|
+
key: 1,
|
|
496
|
+
class: "grid grid-cols-3 gap-2 p-3"
|
|
497
|
+
}, B = ["disabled", "onClick"], V = {
|
|
498
|
+
key: 2,
|
|
499
|
+
class: "grid grid-cols-3 gap-2 p-3"
|
|
500
|
+
}, Le = ["disabled", "onClick"], Re = { class: "flex h-11 items-center justify-center border-b border-medium text-xs font-medium text-tertiary" }, ze = ["data-ui-range-picker-time-column", "data-ui-range-picker-time-side"], H = [
|
|
501
|
+
"disabled",
|
|
502
|
+
"data-ui-range-picker-time-option",
|
|
503
|
+
"data-ui-range-picker-time-value",
|
|
504
|
+
"data-ui-range-picker-time-side",
|
|
505
|
+
"data-ui-range-picker-time-selected",
|
|
506
|
+
"onClick"
|
|
507
|
+
], Be = {
|
|
508
|
+
key: 1,
|
|
509
|
+
class: "grid grid-cols-2 gap-0"
|
|
510
|
+
}, Ve = {
|
|
511
|
+
class: "min-w-0 border-r border-medium",
|
|
512
|
+
"data-ui-range-picker-panel": "left"
|
|
513
|
+
}, He = { class: "flex h-11 items-center justify-between gap-2 border-b border-medium px-2" }, Ue = { class: "min-w-0 truncate text-sm font-bold text-primary" }, We = { key: 2 }, U = {
|
|
514
|
+
key: 0,
|
|
515
|
+
class: "grid grid-cols-7 gap-1 px-3 pb-2 pt-3"
|
|
516
|
+
}, W = [
|
|
517
|
+
"disabled",
|
|
518
|
+
"data-ui-range-picker-date-cell",
|
|
519
|
+
"data-ui-range-picker-date-selected",
|
|
520
|
+
"data-ui-range-picker-date-in-range",
|
|
521
|
+
"onClick"
|
|
522
|
+
], G = {
|
|
523
|
+
key: 1,
|
|
524
|
+
class: "grid grid-cols-3 gap-2 p-3"
|
|
525
|
+
}, Ge = ["disabled", "onClick"], Ke = {
|
|
526
|
+
key: 2,
|
|
527
|
+
class: "grid grid-cols-3 gap-2 p-3"
|
|
528
|
+
}, qe = ["disabled", "onClick"], Je = {
|
|
529
|
+
class: "min-w-0",
|
|
530
|
+
"data-ui-range-picker-panel": "right"
|
|
531
|
+
}, Ye = { class: "flex h-11 items-center justify-between gap-2 border-b border-medium px-2" }, Xe = { class: "min-w-0 truncate text-sm font-bold text-primary" }, Ze = { key: 2 }, Qe = {
|
|
532
|
+
key: 0,
|
|
533
|
+
class: "grid grid-cols-7 gap-1 px-3 pb-2 pt-3"
|
|
534
|
+
}, $e = [
|
|
535
|
+
"disabled",
|
|
536
|
+
"data-ui-range-picker-date-cell",
|
|
537
|
+
"data-ui-range-picker-date-selected",
|
|
538
|
+
"data-ui-range-picker-date-in-range",
|
|
539
|
+
"onClick"
|
|
540
|
+
], et = {
|
|
541
|
+
key: 1,
|
|
542
|
+
class: "grid grid-cols-3 gap-2 p-3"
|
|
543
|
+
}, tt = ["disabled", "onClick"], nt = {
|
|
544
|
+
key: 2,
|
|
545
|
+
class: "grid grid-cols-3 gap-2 p-3"
|
|
546
|
+
}, rt = ["disabled", "onClick"], it = {
|
|
547
|
+
key: 2,
|
|
548
|
+
class: "border-t border-medium"
|
|
549
|
+
}, at = { class: "flex min-h-12 items-center justify-end border-t border-medium px-3 py-2" }, ot = "YYYY-MM-DD", st = "YYYY-MM", ct = "YYYY", lt = "HH:mm:ss", K = "flex size-7 items-center justify-center rounded text-tertiary transition-colors hover:bg-secondary hover:text-primary", ut = /* @__PURE__ */ d({
|
|
550
|
+
inheritAttrs: !1,
|
|
551
|
+
__name: "RangePicker",
|
|
552
|
+
props: {
|
|
553
|
+
modelValue: { default: void 0 },
|
|
554
|
+
picker: { default: "date" },
|
|
555
|
+
format: { default: void 0 },
|
|
556
|
+
valueFormat: { default: void 0 },
|
|
557
|
+
placeholder: { default: void 0 },
|
|
558
|
+
separatorIcon: { default: "i-ant-design:swap-right-outlined" },
|
|
559
|
+
size: { default: "md" },
|
|
560
|
+
disabled: {
|
|
561
|
+
type: Boolean,
|
|
562
|
+
default: !1
|
|
563
|
+
},
|
|
564
|
+
clearable: {
|
|
565
|
+
type: Boolean,
|
|
566
|
+
default: !1
|
|
567
|
+
},
|
|
568
|
+
showTime: {
|
|
569
|
+
type: [Boolean, Object],
|
|
570
|
+
default: !1
|
|
571
|
+
},
|
|
572
|
+
disabledDate: {
|
|
573
|
+
type: Function,
|
|
574
|
+
default: void 0
|
|
575
|
+
},
|
|
576
|
+
minDate: { default: void 0 },
|
|
577
|
+
maxDate: { default: void 0 },
|
|
578
|
+
suffixIcon: { default: "i-lucide:calendar-range" },
|
|
579
|
+
clearIcon: { default: "i-lucide:x" },
|
|
580
|
+
teleportedWidth: { default: void 0 },
|
|
581
|
+
name: { default: void 0 }
|
|
582
|
+
},
|
|
583
|
+
emits: [
|
|
584
|
+
"update:modelValue",
|
|
585
|
+
"change",
|
|
586
|
+
"clear",
|
|
587
|
+
"ok",
|
|
588
|
+
"visible-change",
|
|
589
|
+
"calendar-change",
|
|
590
|
+
"panel-change",
|
|
591
|
+
"focus",
|
|
592
|
+
"blur"
|
|
593
|
+
],
|
|
594
|
+
setup(r, { expose: d, emit: le }) {
|
|
595
|
+
v.extend(ce);
|
|
596
|
+
let y = r, b = le, ue = re(), x = m(!1), de = m(!1), S = m("start"), fe = m(null), C = m([null, null]), w = m(v().startOf("month")), T = m(v().add(1, "month").startOf("month")), E = m("date"), D = m("date"), pe = m(null), me = [
|
|
597
|
+
"一",
|
|
598
|
+
"二",
|
|
599
|
+
"三",
|
|
600
|
+
"四",
|
|
601
|
+
"五",
|
|
602
|
+
"六",
|
|
603
|
+
"日"
|
|
604
|
+
], he = a(() => !!y.showTime), ge = a(() => typeof y.showTime == "object" ? y.showTime : {}), _e = a(() => ge.value.format || lt), O = a(() => y.picker || "date"), ve = a(() => O.value === "year" ? ct : O.value === "month" ? st : ot), k = a(() => O.value === "date" && he.value), A = a(() => y.format || (k.value ? `${ot} ${_e.value}` : ve.value)), ye = a(() => k.value ? ["开始日期时间", "结束日期时间"] : O.value === "year" ? ["开始年份", "结束年份"] : O.value === "month" ? ["开始月份", "结束月份"] : ["开始日期", "结束日期"]), be = a(() => y.placeholder || ye.value), xe = a(() => y.teleportedWidth || (O.value === "date" ? "min(640px, calc(100vw - 24px))" : "min(520px, calc(100vw - 24px))")), j = a(() => Nt(y.modelValue)), Se = a(() => C.value), Ce = a(() => Q(Se.value)), we = a(() => x.value ? C.value : j.value), M = a(() => !!(j.value[0] || j.value[1])), Te = a(() => we.value[0]?.format(A.value) || ""), Ee = a(() => we.value[1]?.format(A.value) || ""), De = a(() => [Te.value, Ee.value].filter(Boolean).join(",")), Oe = a(() => y.clearable && M.value && !y.disabled), N = a(() => ge.value.showSecond ?? _e.value.includes("ss")), ut = a(() => N.value ? [
|
|
605
|
+
"hour",
|
|
606
|
+
"minute",
|
|
607
|
+
"second"
|
|
608
|
+
] : ["hour", "minute"]), q = a(() => Z(y.minDate)), J = a(() => Z(y.maxDate)), gt = a(() => !C.value[Ut(S.value)]), Y = a(() => {
|
|
609
|
+
let [e, t] = C.value;
|
|
610
|
+
return S.value === "start" ? !!e : !!(e && t);
|
|
611
|
+
}), _t = a(() => se(ue.class, dt({
|
|
612
|
+
size: y.size,
|
|
613
|
+
focused: x.value || de.value,
|
|
614
|
+
disabled: y.disabled
|
|
615
|
+
}))), X = a(() => [w.value, T.value]), vt = a(() => zt(w.value, E.value)), yt = a(() => zt(T.value, D.value)), bt = a(() => w.value.format("YYYY年")), xt = a(() => T.value.format("YYYY年")), St = a(() => w.value.format("M月")), Ct = a(() => T.value.format("M月")), wt = a(() => nn(w.value)), Tt = a(() => nn(T.value)), Et = a(() => rn(w.value)), Dt = a(() => rn(T.value)), Ot = a(() => an(w.value)), kt = a(() => an(T.value));
|
|
616
|
+
ie(() => y.modelValue, () => {
|
|
617
|
+
let e = j.value;
|
|
618
|
+
x.value || (C.value = e, cn(e));
|
|
619
|
+
}, { immediate: !0 }), ie(x, (e) => {
|
|
620
|
+
b("visible-change", e), e && (C.value = j.value, S.value = fe.value || (j.value[0] && !j.value[1] ? "end" : "start"), fe.value = null, cn(j.value), E.value = O.value, D.value = O.value, ln(), At());
|
|
621
|
+
}), ie(S, () => {
|
|
622
|
+
x.value && (ln(), k.value && At());
|
|
623
|
+
});
|
|
624
|
+
function At() {
|
|
625
|
+
ne(() => {
|
|
626
|
+
document.querySelectorAll(".ui-datepicker-dropdown [data-ui-range-picker-time-column]").forEach((e) => {
|
|
627
|
+
let t = e.querySelector("[data-ui-range-picker-time-selected=\"true\"]");
|
|
628
|
+
t && (e.scrollTop = Math.max(0, t.offsetTop - e.clientHeight / 2 + t.offsetHeight / 2));
|
|
629
|
+
});
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
function jt(e, t) {
|
|
633
|
+
for (let n of t) {
|
|
634
|
+
let t = v(e, n, !0);
|
|
635
|
+
if (t.isValid()) return t;
|
|
636
|
+
}
|
|
637
|
+
let n = v(e);
|
|
638
|
+
return n.isValid() ? n : null;
|
|
639
|
+
}
|
|
640
|
+
function Mt() {
|
|
641
|
+
return Array.from(new Set([
|
|
642
|
+
y.valueFormat,
|
|
643
|
+
A.value,
|
|
644
|
+
y.format,
|
|
645
|
+
`${ot} ${lt}`,
|
|
646
|
+
`${ot} HH:mm`,
|
|
647
|
+
ot,
|
|
648
|
+
st,
|
|
649
|
+
ct,
|
|
650
|
+
"YYYY/MM/DD HH:mm:ss",
|
|
651
|
+
"YYYY/MM/DD",
|
|
652
|
+
"YYYY/MM"
|
|
653
|
+
].filter(Boolean)));
|
|
654
|
+
}
|
|
655
|
+
function Z(e) {
|
|
656
|
+
if (e == null || e === "") return null;
|
|
657
|
+
if (v.isDayjs(e)) return e.isValid() ? e.millisecond(0) : null;
|
|
658
|
+
if (e instanceof Date || typeof e == "number") {
|
|
659
|
+
let t = v(e);
|
|
660
|
+
return t.isValid() ? t.millisecond(0) : null;
|
|
661
|
+
}
|
|
662
|
+
return typeof e == "string" ? jt(e, Mt())?.millisecond(0) ?? null : null;
|
|
663
|
+
}
|
|
664
|
+
function Nt(e) {
|
|
665
|
+
return Array.isArray(e) ? Q([Z(e[0]), Z(e[1])]) : [null, null];
|
|
666
|
+
}
|
|
667
|
+
function Q(e) {
|
|
668
|
+
let [t, n] = e;
|
|
669
|
+
return t && n && t.isAfter(n) ? [n, t] : [t, n];
|
|
670
|
+
}
|
|
671
|
+
function Pt(e, t) {
|
|
672
|
+
let n = Bt(e);
|
|
673
|
+
return n ? y.valueFormat ? n.format(y.valueFormat) : v.isDayjs(t) ? n : t instanceof Date ? n.toDate() : typeof t == "number" ? n.valueOf() : n.format(A.value) : null;
|
|
674
|
+
}
|
|
675
|
+
function Ft(e) {
|
|
676
|
+
return Array.isArray(y.modelValue) ? y.modelValue[e] : void 0;
|
|
677
|
+
}
|
|
678
|
+
function It(e) {
|
|
679
|
+
let t = e.day(), n = t === 0 ? 6 : t - 1;
|
|
680
|
+
return e.subtract(n, "day").startOf("day");
|
|
681
|
+
}
|
|
682
|
+
function Lt(e) {
|
|
683
|
+
return Math.floor(e.year() / 12) * 12;
|
|
684
|
+
}
|
|
685
|
+
function Rt() {
|
|
686
|
+
return O.value === "year" ? "year" : O.value === "month" ? "month" : "day";
|
|
687
|
+
}
|
|
688
|
+
function zt(e, t) {
|
|
689
|
+
if (t === "year") {
|
|
690
|
+
let t = Lt(e);
|
|
691
|
+
return `${t} - ${t + 11}`;
|
|
692
|
+
}
|
|
693
|
+
return t === "month" ? e.format("YYYY年") : e.format("YYYY年M月");
|
|
694
|
+
}
|
|
695
|
+
function Bt(e) {
|
|
696
|
+
if (O.value === "year") return e.startOf("year").millisecond(0);
|
|
697
|
+
if (O.value === "month") return e.startOf("month").millisecond(0);
|
|
698
|
+
if (!k.value) return e.startOf("day").millisecond(0);
|
|
699
|
+
let t = e;
|
|
700
|
+
return q.value && t.isBefore(q.value) && (t = q.value), J.value && t.isAfter(J.value) && (t = J.value), t.millisecond(0);
|
|
701
|
+
}
|
|
702
|
+
function Vt(e, t) {
|
|
703
|
+
let n = Number.isFinite(e) && e && e > 0 ? Math.floor(e) : 1, r = [];
|
|
704
|
+
for (let e = 0; e <= t; e += n) r.push(e);
|
|
705
|
+
return r;
|
|
706
|
+
}
|
|
707
|
+
function Ht(e, t, n) {
|
|
708
|
+
let r = Math.min(n, Math.max(0, t));
|
|
709
|
+
return e.includes(r) ? e : [...e, r].sort((e, t) => e - t);
|
|
710
|
+
}
|
|
711
|
+
function Ut(e) {
|
|
712
|
+
return e === "start" ? 0 : 1;
|
|
713
|
+
}
|
|
714
|
+
function Wt(e) {
|
|
715
|
+
let t = Ut(e);
|
|
716
|
+
return C.value[t] || j.value[t] || v();
|
|
717
|
+
}
|
|
718
|
+
function Gt(e, t) {
|
|
719
|
+
let n = Wt(t);
|
|
720
|
+
return Bt(e.hour(n.hour()).minute(n.minute()).second(N.value ? n.second() : 0).millisecond(0));
|
|
721
|
+
}
|
|
722
|
+
function Kt(e, t) {
|
|
723
|
+
let n = Wt(e);
|
|
724
|
+
return t === "hour" ? n.hour() : t === "minute" ? n.minute() : n.second();
|
|
725
|
+
}
|
|
726
|
+
function qt(e, t) {
|
|
727
|
+
let n = Wt(e);
|
|
728
|
+
return t === "hour" ? Ht(Vt(ge.value.hourStep, 23), n.hour(), 23) : t === "minute" ? Ht(Vt(ge.value.minuteStep, 59), n.minute(), 59) : Ht(Vt(ge.value.secondStep, 59), n.second(), 59);
|
|
729
|
+
}
|
|
730
|
+
function Jt(e, t, n) {
|
|
731
|
+
let r = C.value[Ut(e)];
|
|
732
|
+
return r ? t === "hour" ? r.hour(n) : t === "minute" ? r.minute(n) : r.second(n) : null;
|
|
733
|
+
}
|
|
734
|
+
function Yt(e, t, n) {
|
|
735
|
+
return Kt(e, t) === n;
|
|
736
|
+
}
|
|
737
|
+
function Xt(e, t, n) {
|
|
738
|
+
let r = Jt(e, t, n);
|
|
739
|
+
if (!r || q.value && r.isBefore(q.value) || J.value && r.isAfter(J.value)) return !0;
|
|
740
|
+
let [i, a] = C.value;
|
|
741
|
+
return !!(e === "start" && a && r.isAfter(a) || e === "end" && i && r.isBefore(i));
|
|
742
|
+
}
|
|
743
|
+
function Zt(e) {
|
|
744
|
+
return !!(y.disabledDate?.(e) || q.value && e.isBefore(q.value, "day") || J.value && e.isAfter(J.value, "day"));
|
|
745
|
+
}
|
|
746
|
+
function Qt(e) {
|
|
747
|
+
let t = e.startOf("month"), n = e.endOf("month");
|
|
748
|
+
return q.value && n.isBefore(q.value, "day") || J.value && t.isAfter(J.value, "day") ? !0 : !!(y.disabledDate?.(t) && y.disabledDate?.(n));
|
|
749
|
+
}
|
|
750
|
+
function $t(e) {
|
|
751
|
+
let t = e.startOf("year"), n = e.endOf("year");
|
|
752
|
+
return q.value && n.isBefore(q.value, "day") || J.value && t.isAfter(J.value, "day") ? !0 : !!(y.disabledDate?.(t) && y.disabledDate?.(n));
|
|
753
|
+
}
|
|
754
|
+
function en(e) {
|
|
755
|
+
if (O.value === "year" && $t(e) || O.value === "month" && Qt(e) || O.value === "date" && Zt(e)) return !0;
|
|
756
|
+
let t = C.value[0];
|
|
757
|
+
return !!(S.value === "end" && t && e.isBefore(t, Rt()));
|
|
758
|
+
}
|
|
759
|
+
function tn(e) {
|
|
760
|
+
let t = Rt();
|
|
761
|
+
if (k.value) {
|
|
762
|
+
let n = !!Se.value[Ut(S.value)]?.isSame(e, t);
|
|
763
|
+
return {
|
|
764
|
+
selected: n,
|
|
765
|
+
inRange: !1,
|
|
766
|
+
rangeStart: !1,
|
|
767
|
+
rangeEnd: !1,
|
|
768
|
+
standalone: n
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
let [n, r] = Ce.value, i = !!n?.isSame(e, t), a = !!r?.isSame(e, t), o = i || a;
|
|
772
|
+
return {
|
|
773
|
+
selected: o,
|
|
774
|
+
inRange: !!(n && r && e.isAfter(n, t) && e.isBefore(r, t)),
|
|
775
|
+
rangeStart: i,
|
|
776
|
+
rangeEnd: a,
|
|
777
|
+
standalone: o && (!n || !r || n.isSame(r, t))
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
function nn(e) {
|
|
781
|
+
let t = It(e.startOf("month"));
|
|
782
|
+
return Array.from({ length: 42 }, (n, r) => {
|
|
783
|
+
let i = t.add(r, "day"), a = i.isSame(e, "month"), o = a ? tn(i) : {
|
|
784
|
+
selected: !1,
|
|
785
|
+
inRange: !1,
|
|
786
|
+
rangeStart: !1,
|
|
787
|
+
rangeEnd: !1,
|
|
788
|
+
standalone: !1
|
|
789
|
+
};
|
|
790
|
+
return {
|
|
791
|
+
date: i,
|
|
792
|
+
key: i.format("YYYY-MM-DD"),
|
|
793
|
+
inMonth: a,
|
|
794
|
+
today: i.isSame(v(), "day"),
|
|
795
|
+
disabled: en(i),
|
|
796
|
+
...o
|
|
797
|
+
};
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
function rn(e) {
|
|
801
|
+
let t = v();
|
|
802
|
+
return Array.from({ length: 12 }, (n, r) => {
|
|
803
|
+
let i = e.month(r).startOf("month"), a = tn(i);
|
|
804
|
+
return {
|
|
805
|
+
date: i,
|
|
806
|
+
key: i.format("YYYY-MM"),
|
|
807
|
+
label: `${r + 1}月`,
|
|
808
|
+
current: t.isSame(i, "month"),
|
|
809
|
+
disabled: O.value === "month" ? en(i) : Qt(i),
|
|
810
|
+
...a
|
|
811
|
+
};
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
function an(e) {
|
|
815
|
+
let t = v(), n = Lt(e);
|
|
816
|
+
return Array.from({ length: 12 }, (r, i) => {
|
|
817
|
+
let a = e.year(n + i).startOf("year"), o = tn(a);
|
|
818
|
+
return {
|
|
819
|
+
date: a,
|
|
820
|
+
key: a.format("YYYY"),
|
|
821
|
+
label: a.format("YYYY"),
|
|
822
|
+
current: t.isSame(a, "year"),
|
|
823
|
+
disabled: O.value === "year" ? en(a) : $t(a),
|
|
824
|
+
...o
|
|
825
|
+
};
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
function on(e) {
|
|
829
|
+
return se(mt({
|
|
830
|
+
inMonth: e.inMonth,
|
|
831
|
+
selected: e.selected,
|
|
832
|
+
inRange: e.inRange,
|
|
833
|
+
rangeStart: e.rangeStart,
|
|
834
|
+
rangeEnd: e.rangeEnd,
|
|
835
|
+
standalone: e.standalone,
|
|
836
|
+
today: e.today,
|
|
837
|
+
disabled: e.disabled
|
|
838
|
+
}), k.value ? "h-10 text-sm" : "");
|
|
839
|
+
}
|
|
840
|
+
function sn(e) {
|
|
841
|
+
return se(pt({
|
|
842
|
+
selected: e.selected,
|
|
843
|
+
current: e.current,
|
|
844
|
+
disabled: e.disabled,
|
|
845
|
+
muted: !1
|
|
846
|
+
}), e.inRange && !e.selected ? "bg-brand-500/10 text-brand-500" : "", e.rangeStart ? "rounded-r-sm" : "", e.rangeEnd ? "rounded-l-sm" : "");
|
|
847
|
+
}
|
|
848
|
+
function cn(e) {
|
|
849
|
+
let t = e[0] || v(), n = e[1];
|
|
850
|
+
if (O.value === "year") {
|
|
851
|
+
w.value = t.startOf("year");
|
|
852
|
+
let e = Math.max(Lt(t) + 12, Lt(n || t.add(12, "year")));
|
|
853
|
+
T.value = t.year(e).startOf("year");
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
if (O.value === "month") {
|
|
857
|
+
w.value = t.startOf("year"), T.value = (n || t.add(1, "year")).startOf("year"), T.value.isAfter(w.value, "year") || (T.value = w.value.add(1, "year"));
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
w.value = t.startOf("month"), T.value = (n || t.add(1, "month")).startOf("month"), T.value.isAfter(w.value, "month") || (T.value = w.value.add(1, "month"));
|
|
861
|
+
}
|
|
862
|
+
function ln() {
|
|
863
|
+
if (!k.value) return;
|
|
864
|
+
let e = C.value[Ut(S.value)] || C.value[0] || C.value[1];
|
|
865
|
+
e && (w.value = e.startOf("month"));
|
|
866
|
+
}
|
|
867
|
+
function un(e) {
|
|
868
|
+
return [e[0]?.format(A.value) || "", e[1]?.format(A.value) || ""];
|
|
869
|
+
}
|
|
870
|
+
function dn(e) {
|
|
871
|
+
let t = Q(e);
|
|
872
|
+
C.value = t, b("calendar-change", fn(t), un(t));
|
|
873
|
+
}
|
|
874
|
+
function fn(e) {
|
|
875
|
+
let [t, n] = Q(e);
|
|
876
|
+
return !t && !n ? null : [t ? Pt(t, Ft(0)) : null, n ? Pt(n, Ft(1)) : null];
|
|
877
|
+
}
|
|
878
|
+
function pn(e, t = !1) {
|
|
879
|
+
let n = Q(e), r = fn(n);
|
|
880
|
+
C.value = n, b("update:modelValue", r), b("change", r, un(n)), t && b("ok", r, un(n)), x.value = !1;
|
|
881
|
+
}
|
|
882
|
+
function mn(e) {
|
|
883
|
+
return e === "left" ? E.value : D.value;
|
|
884
|
+
}
|
|
885
|
+
function $(e, t) {
|
|
886
|
+
e === "left" ? E.value = t : D.value = t;
|
|
887
|
+
}
|
|
888
|
+
function hn(e) {
|
|
889
|
+
if (en(e)) return;
|
|
890
|
+
let [t, n] = C.value;
|
|
891
|
+
if (k.value) {
|
|
892
|
+
let r = Gt(e, S.value);
|
|
893
|
+
if (!r) return;
|
|
894
|
+
if (S.value === "start") {
|
|
895
|
+
dn([r, n && !r.isAfter(n) ? n : null]);
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
dn([t, t && r.isBefore(t) && r.isSame(t, "day") ? t : r]);
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
let r = Bt(e);
|
|
902
|
+
if (S.value === "start") {
|
|
903
|
+
dn([r, null]), S.value = "end";
|
|
904
|
+
return;
|
|
905
|
+
}
|
|
906
|
+
if (!t) {
|
|
907
|
+
dn([r, null]);
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
let i = [t, r];
|
|
911
|
+
dn(i), pn(i), S.value = "start";
|
|
912
|
+
}
|
|
913
|
+
function gn(e, t, n) {
|
|
914
|
+
let r = Jt(e, t, n);
|
|
915
|
+
if (!r || Xt(e, t, n)) return;
|
|
916
|
+
let i = [...C.value];
|
|
917
|
+
i[Ut(e)] = r.millisecond(0), dn(i);
|
|
918
|
+
}
|
|
919
|
+
function _n() {
|
|
920
|
+
if (Y.value) {
|
|
921
|
+
if (S.value === "start") {
|
|
922
|
+
S.value = "end";
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
pn(C.value, !0);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
function vn(e, t) {
|
|
929
|
+
if (!Qt(t)) {
|
|
930
|
+
if (O.value === "date") {
|
|
931
|
+
e === "left" ? w.value = w.value.year(t.year()).month(t.month()).startOf("month") : T.value = T.value.year(t.year()).month(t.month()).startOf("month"), $(e, "date"), b("panel-change", X.value);
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
hn(t);
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
function yn(e, t) {
|
|
938
|
+
if (!$t(t)) {
|
|
939
|
+
if (O.value !== "year") {
|
|
940
|
+
e === "left" ? w.value = w.value.year(t.year()).startOf("year") : T.value = T.value.year(t.year()).startOf("year"), $(e, "month"), b("panel-change", X.value);
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
hn(t);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
function bn(e, t) {
|
|
947
|
+
let n = mn(e), r = n === "date" ? "month" : "year", i = n === "year" ? t * 12 : t;
|
|
948
|
+
e === "left" ? (w.value = w.value.add(i, r), T.value.isAfter(w.value, r) || (T.value = w.value.add(r === "month" ? 1 : O.value === "year" ? 12 : 1, r))) : (T.value = T.value.add(i, r), T.value.isAfter(w.value, r) || (w.value = T.value.subtract(r === "month" ? 1 : O.value === "year" ? 12 : 1, r))), b("panel-change", X.value);
|
|
949
|
+
}
|
|
950
|
+
function xn(e) {
|
|
951
|
+
e?.stopPropagation(), Oe.value && (C.value = [null, null], b("update:modelValue", null), b("change", null, ["", ""]), b("clear"));
|
|
952
|
+
}
|
|
953
|
+
function Sn(e) {
|
|
954
|
+
y.disabled || (e || (fe.value = null), x.value = e);
|
|
955
|
+
}
|
|
956
|
+
function Cn() {
|
|
957
|
+
x.value || (fe.value = null), Sn(!0);
|
|
958
|
+
}
|
|
959
|
+
function wn(e) {
|
|
960
|
+
if (!y.disabled) {
|
|
961
|
+
if (x.value) {
|
|
962
|
+
S.value = e;
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
fe.value = e, Sn(!0);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
function Tn(e) {
|
|
969
|
+
y.disabled || (e.key === "Enter" || e.key === " " ? (e.preventDefault(), Sn(!x.value)) : e.key === "Escape" ? x.value = !1 : e.key === "ArrowDown" && (e.preventDefault(), Sn(!0)));
|
|
970
|
+
}
|
|
971
|
+
function En(e) {
|
|
972
|
+
de.value = !0, b("focus", e);
|
|
973
|
+
}
|
|
974
|
+
function Dn(e) {
|
|
975
|
+
de.value = !1, b("blur", e);
|
|
976
|
+
}
|
|
977
|
+
function On() {
|
|
978
|
+
pe.value?.focus();
|
|
979
|
+
}
|
|
980
|
+
function kn() {
|
|
981
|
+
pe.value?.blur();
|
|
982
|
+
}
|
|
983
|
+
return d({
|
|
984
|
+
blur: kn,
|
|
985
|
+
clear: xn,
|
|
986
|
+
focus: On
|
|
987
|
+
}), (a, d) => (p(), o(_(n), {
|
|
988
|
+
open: x.value,
|
|
989
|
+
"onUpdate:open": d[16] ||= (e) => x.value = e,
|
|
990
|
+
width: xe.value,
|
|
991
|
+
"min-width": xe.value,
|
|
992
|
+
"focus-on-open": !1,
|
|
993
|
+
"content-class": "ui-datepicker-dropdown"
|
|
994
|
+
}, {
|
|
995
|
+
trigger: ae(() => [l("div", te({
|
|
996
|
+
ref_key: "triggerRef",
|
|
997
|
+
ref: pe
|
|
998
|
+
}, _(t)(_(ue)), {
|
|
999
|
+
class: _t.value,
|
|
1000
|
+
style: _(ue).style,
|
|
1001
|
+
"data-ui-range-picker": "true",
|
|
1002
|
+
tabindex: r.disabled ? void 0 : 0,
|
|
1003
|
+
role: "combobox",
|
|
1004
|
+
"aria-expanded": x.value,
|
|
1005
|
+
"aria-haspopup": "dialog",
|
|
1006
|
+
onClick: oe(Cn, ["stop"]),
|
|
1007
|
+
onKeydown: Tn,
|
|
1008
|
+
onFocus: En,
|
|
1009
|
+
onBlur: Dn
|
|
1010
|
+
}), [
|
|
1011
|
+
l("span", {
|
|
1012
|
+
class: f([_(ft)({ size: r.size }), "flex items-center gap-2"]),
|
|
1013
|
+
title: [Te.value, Ee.value].filter(Boolean).join(" - ")
|
|
1014
|
+
}, [
|
|
1015
|
+
l("span", {
|
|
1016
|
+
class: f(["min-w-0 flex-1 cursor-pointer truncate transition-colors", [
|
|
1017
|
+
Te.value ? "text-primary" : "text-tertiary/60",
|
|
1018
|
+
k.value ? "border-b-2 py-1 text-sm" : "",
|
|
1019
|
+
k.value ? S.value === "start" ? "border-brand" : "border-transparent" : x.value && S.value === "start" ? "text-brand" : ""
|
|
1020
|
+
]]),
|
|
1021
|
+
"data-ui-range-picker-side": "start",
|
|
1022
|
+
"data-ui-range-picker-side-active": S.value === "start" ? "true" : void 0,
|
|
1023
|
+
onClick: d[0] ||= oe((e) => wn("start"), ["stop"])
|
|
1024
|
+
}, g(Te.value || be.value[0]), 11, F),
|
|
1025
|
+
l("span", { class: f([r.separatorIcon, "size-4 shrink-0 text-tertiary"]) }, null, 2),
|
|
1026
|
+
l("span", {
|
|
1027
|
+
class: f(["min-w-0 flex-1 cursor-pointer truncate transition-colors", [
|
|
1028
|
+
Ee.value ? "text-primary" : "text-tertiary/60",
|
|
1029
|
+
k.value ? "border-b-2 py-1 text-sm" : "",
|
|
1030
|
+
k.value ? S.value === "end" ? "border-brand" : "border-transparent" : x.value && S.value === "end" ? "text-brand" : ""
|
|
1031
|
+
]]),
|
|
1032
|
+
"data-ui-range-picker-side": "end",
|
|
1033
|
+
"data-ui-range-picker-side-active": S.value === "end" ? "true" : void 0,
|
|
1034
|
+
onClick: d[1] ||= oe((e) => wn("end"), ["stop"])
|
|
1035
|
+
}, g(Ee.value || be.value[1]), 11, Ae)
|
|
1036
|
+
], 10, ke),
|
|
1037
|
+
r.name ? (p(), c("input", {
|
|
1038
|
+
key: 0,
|
|
1039
|
+
type: "hidden",
|
|
1040
|
+
name: r.name,
|
|
1041
|
+
value: De.value
|
|
1042
|
+
}, null, 8, I)) : s("", !0),
|
|
1043
|
+
l("span", L, [Oe.value ? (p(), c("button", {
|
|
1044
|
+
key: 0,
|
|
1045
|
+
type: "button",
|
|
1046
|
+
"aria-label": "清空",
|
|
1047
|
+
class: "flex size-4 items-center justify-center rounded-full bg-tertiary/90 text-tertiary/60 opacity-0 transition-all duration-150 hover:bg-tertiary hover:text-tertiary group-hover/ui-datepicker:opacity-100 group-focus-within/ui-datepicker:opacity-100",
|
|
1048
|
+
onClick: xn
|
|
1049
|
+
}, [l("span", { class: f([r.clearIcon, "size-3"]) }, null, 2)])) : s("", !0), l("span", { class: f([r.suffixIcon, "size-4"]) }, null, 2)])
|
|
1050
|
+
], 16, P)]),
|
|
1051
|
+
default: ae(() => [l("div", R, [k.value ? (p(), c("div", je, [l("div", Me, [l("div", Ne, [
|
|
1052
|
+
l("button", {
|
|
1053
|
+
type: "button",
|
|
1054
|
+
class: f(K),
|
|
1055
|
+
"aria-label": "上一面板",
|
|
1056
|
+
onClick: d[2] ||= (e) => bn("left", -1)
|
|
1057
|
+
}, [...d[17] ||= [l("span", { class: "i-lucide:chevron-left size-4" }, null, -1)]]),
|
|
1058
|
+
l("div", Pe, [l("button", {
|
|
1059
|
+
type: "button",
|
|
1060
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
1061
|
+
onClick: d[3] ||= (e) => $("left", "year")
|
|
1062
|
+
}, g(bt.value), 1), l("button", {
|
|
1063
|
+
type: "button",
|
|
1064
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
1065
|
+
onClick: d[4] ||= (e) => $("left", "month")
|
|
1066
|
+
}, g(St.value), 1)]),
|
|
1067
|
+
l("button", {
|
|
1068
|
+
type: "button",
|
|
1069
|
+
class: f(K),
|
|
1070
|
+
"aria-label": "下一面板",
|
|
1071
|
+
onClick: d[5] ||= (e) => bn("left", 1)
|
|
1072
|
+
}, [...d[18] ||= [l("span", { class: "i-lucide:chevron-right size-4" }, null, -1)]])
|
|
1073
|
+
]), E.value === "date" ? (p(), c("div", Fe, [(p(), c(i, null, h(me, (e) => l("div", {
|
|
1074
|
+
key: e,
|
|
1075
|
+
class: "flex h-7 items-center justify-center text-xs font-medium text-tertiary"
|
|
1076
|
+
}, g(e), 1)), 64)), (p(!0), c(i, null, h(wt.value, (e) => (p(), c("button", {
|
|
1077
|
+
key: e.key,
|
|
1078
|
+
type: "button",
|
|
1079
|
+
class: f(on(e)),
|
|
1080
|
+
disabled: e.disabled,
|
|
1081
|
+
"data-ui-range-picker-date-cell": e.key,
|
|
1082
|
+
"data-ui-range-picker-date-selected": e.selected ? "true" : void 0,
|
|
1083
|
+
"data-ui-range-picker-date-in-range": e.inRange ? "true" : void 0,
|
|
1084
|
+
onClick: (t) => hn(e.date)
|
|
1085
|
+
}, g(e.date.date()), 11, z))), 128))])) : E.value === "month" ? (p(), c("div", Ie, [(p(!0), c(i, null, h(Et.value, (e) => (p(), c("button", {
|
|
1086
|
+
key: e.key,
|
|
1087
|
+
type: "button",
|
|
1088
|
+
class: f(sn(e)),
|
|
1089
|
+
disabled: e.disabled,
|
|
1090
|
+
onClick: (t) => vn("left", e.date)
|
|
1091
|
+
}, g(e.label), 11, B))), 128))])) : (p(), c("div", V, [(p(!0), c(i, null, h(Ot.value, (e) => (p(), c("button", {
|
|
1092
|
+
key: e.key,
|
|
1093
|
+
type: "button",
|
|
1094
|
+
class: f(sn(e)),
|
|
1095
|
+
disabled: e.disabled,
|
|
1096
|
+
onClick: (t) => yn("left", e.date)
|
|
1097
|
+
}, g(e.label), 11, Le))), 128))]))]), l("div", { class: f(["grid min-w-0 border-t border-medium sm:border-l sm:border-t-0", N.value ? "grid-cols-3" : "grid-cols-2"]) }, [(p(!0), c(i, null, h(ut.value, (e) => (p(), c("div", {
|
|
1098
|
+
key: e,
|
|
1099
|
+
class: "min-w-0 border-r border-medium last:border-r-0"
|
|
1100
|
+
}, [l("div", Re, g(e === "hour" ? "时" : e === "minute" ? "分" : "秒"), 1), l("div", {
|
|
1101
|
+
class: "max-h-64 overflow-y-auto p-2",
|
|
1102
|
+
"data-ui-range-picker-time-column": e,
|
|
1103
|
+
"data-ui-range-picker-time-side": S.value
|
|
1104
|
+
}, [(p(!0), c(i, null, h(qt(S.value, e), (t) => (p(), c("button", {
|
|
1105
|
+
key: t,
|
|
1106
|
+
type: "button",
|
|
1107
|
+
class: f(_(ht)({
|
|
1108
|
+
selected: Yt(S.value, e, t),
|
|
1109
|
+
disabled: Xt(S.value, e, t)
|
|
1110
|
+
})),
|
|
1111
|
+
disabled: gt.value || Xt(S.value, e, t),
|
|
1112
|
+
"data-ui-range-picker-time-option": e,
|
|
1113
|
+
"data-ui-range-picker-time-value": t,
|
|
1114
|
+
"data-ui-range-picker-time-side": S.value,
|
|
1115
|
+
"data-ui-range-picker-time-selected": Yt(S.value, e, t) ? "true" : void 0,
|
|
1116
|
+
onClick: (n) => gn(S.value, e, t)
|
|
1117
|
+
}, g(String(t).padStart(2, "0")), 11, H))), 128))], 8, ze)]))), 128))], 2)])) : (p(), c("div", Be, [l("div", Ve, [l("div", He, [
|
|
1118
|
+
l("button", {
|
|
1119
|
+
type: "button",
|
|
1120
|
+
class: f(K),
|
|
1121
|
+
"aria-label": "上一面板",
|
|
1122
|
+
onClick: d[6] ||= (e) => bn("left", -1)
|
|
1123
|
+
}, [...d[19] ||= [l("span", { class: "i-lucide:chevron-left size-4" }, null, -1)]]),
|
|
1124
|
+
l("div", Ue, [E.value === "date" ? (p(), c(i, { key: 0 }, [l("button", {
|
|
1125
|
+
type: "button",
|
|
1126
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
1127
|
+
onClick: d[7] ||= (e) => $("left", "year")
|
|
1128
|
+
}, g(bt.value), 1), l("button", {
|
|
1129
|
+
type: "button",
|
|
1130
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
1131
|
+
onClick: d[8] ||= (e) => $("left", "month")
|
|
1132
|
+
}, g(St.value), 1)], 64)) : E.value === "month" ? (p(), c("button", {
|
|
1133
|
+
key: 1,
|
|
1134
|
+
type: "button",
|
|
1135
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
1136
|
+
onClick: d[9] ||= (e) => $("left", "year")
|
|
1137
|
+
}, g(vt.value), 1)) : (p(), c("span", We, g(vt.value), 1))]),
|
|
1138
|
+
l("button", {
|
|
1139
|
+
type: "button",
|
|
1140
|
+
class: f(K),
|
|
1141
|
+
"aria-label": "下一面板",
|
|
1142
|
+
onClick: d[10] ||= (e) => bn("left", 1)
|
|
1143
|
+
}, [...d[20] ||= [l("span", { class: "i-lucide:chevron-right size-4" }, null, -1)]])
|
|
1144
|
+
]), E.value === "date" ? (p(), c("div", U, [(p(), c(i, null, h(me, (e) => l("div", {
|
|
1145
|
+
key: e,
|
|
1146
|
+
class: "flex h-6 items-center justify-center text-xs font-medium text-tertiary"
|
|
1147
|
+
}, g(e), 1)), 64)), (p(!0), c(i, null, h(wt.value, (e) => (p(), c("button", {
|
|
1148
|
+
key: e.key,
|
|
1149
|
+
type: "button",
|
|
1150
|
+
class: f(on(e)),
|
|
1151
|
+
disabled: e.disabled,
|
|
1152
|
+
"data-ui-range-picker-date-cell": e.key,
|
|
1153
|
+
"data-ui-range-picker-date-selected": e.selected ? "true" : void 0,
|
|
1154
|
+
"data-ui-range-picker-date-in-range": e.inRange ? "true" : void 0,
|
|
1155
|
+
onClick: (t) => hn(e.date)
|
|
1156
|
+
}, g(e.date.date()), 11, W))), 128))])) : E.value === "month" ? (p(), c("div", G, [(p(!0), c(i, null, h(Et.value, (e) => (p(), c("button", {
|
|
1157
|
+
key: e.key,
|
|
1158
|
+
type: "button",
|
|
1159
|
+
class: f(sn(e)),
|
|
1160
|
+
disabled: e.disabled,
|
|
1161
|
+
onClick: (t) => vn("left", e.date)
|
|
1162
|
+
}, g(e.label), 11, Ge))), 128))])) : (p(), c("div", Ke, [(p(!0), c(i, null, h(Ot.value, (e) => (p(), c("button", {
|
|
1163
|
+
key: e.key,
|
|
1164
|
+
type: "button",
|
|
1165
|
+
class: f(sn(e)),
|
|
1166
|
+
disabled: e.disabled,
|
|
1167
|
+
onClick: (t) => yn("left", e.date)
|
|
1168
|
+
}, g(e.label), 11, qe))), 128))]))]), l("div", Je, [l("div", Ye, [
|
|
1169
|
+
l("button", {
|
|
1170
|
+
type: "button",
|
|
1171
|
+
class: f(K),
|
|
1172
|
+
"aria-label": "上一面板",
|
|
1173
|
+
onClick: d[11] ||= (e) => bn("right", -1)
|
|
1174
|
+
}, [...d[21] ||= [l("span", { class: "i-lucide:chevron-left size-4" }, null, -1)]]),
|
|
1175
|
+
l("div", Xe, [D.value === "date" ? (p(), c(i, { key: 0 }, [l("button", {
|
|
1176
|
+
type: "button",
|
|
1177
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
1178
|
+
onClick: d[12] ||= (e) => $("right", "year")
|
|
1179
|
+
}, g(xt.value), 1), l("button", {
|
|
1180
|
+
type: "button",
|
|
1181
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
1182
|
+
onClick: d[13] ||= (e) => $("right", "month")
|
|
1183
|
+
}, g(Ct.value), 1)], 64)) : D.value === "month" ? (p(), c("button", {
|
|
1184
|
+
key: 1,
|
|
1185
|
+
type: "button",
|
|
1186
|
+
class: "rounded px-1 transition-colors hover:bg-secondary hover:text-brand",
|
|
1187
|
+
onClick: d[14] ||= (e) => $("right", "year")
|
|
1188
|
+
}, g(yt.value), 1)) : (p(), c("span", Ze, g(yt.value), 1))]),
|
|
1189
|
+
l("button", {
|
|
1190
|
+
type: "button",
|
|
1191
|
+
class: f(K),
|
|
1192
|
+
"aria-label": "下一面板",
|
|
1193
|
+
onClick: d[15] ||= (e) => bn("right", 1)
|
|
1194
|
+
}, [...d[22] ||= [l("span", { class: "i-lucide:chevron-right size-4" }, null, -1)]])
|
|
1195
|
+
]), D.value === "date" ? (p(), c("div", Qe, [(p(), c(i, null, h(me, (e) => l("div", {
|
|
1196
|
+
key: e,
|
|
1197
|
+
class: "flex h-6 items-center justify-center text-xs font-medium text-tertiary"
|
|
1198
|
+
}, g(e), 1)), 64)), (p(!0), c(i, null, h(Tt.value, (e) => (p(), c("button", {
|
|
1199
|
+
key: e.key,
|
|
1200
|
+
type: "button",
|
|
1201
|
+
class: f(on(e)),
|
|
1202
|
+
disabled: e.disabled,
|
|
1203
|
+
"data-ui-range-picker-date-cell": e.key,
|
|
1204
|
+
"data-ui-range-picker-date-selected": e.selected ? "true" : void 0,
|
|
1205
|
+
"data-ui-range-picker-date-in-range": e.inRange ? "true" : void 0,
|
|
1206
|
+
onClick: (t) => hn(e.date)
|
|
1207
|
+
}, g(e.date.date()), 11, $e))), 128))])) : D.value === "month" ? (p(), c("div", et, [(p(!0), c(i, null, h(Dt.value, (e) => (p(), c("button", {
|
|
1208
|
+
key: e.key,
|
|
1209
|
+
type: "button",
|
|
1210
|
+
class: f(sn(e)),
|
|
1211
|
+
disabled: e.disabled,
|
|
1212
|
+
onClick: (t) => vn("right", e.date)
|
|
1213
|
+
}, g(e.label), 11, tt))), 128))])) : (p(), c("div", nt, [(p(!0), c(i, null, h(kt.value, (e) => (p(), c("button", {
|
|
1214
|
+
key: e.key,
|
|
1215
|
+
type: "button",
|
|
1216
|
+
class: f(sn(e)),
|
|
1217
|
+
disabled: e.disabled,
|
|
1218
|
+
onClick: (t) => yn("right", e.date)
|
|
1219
|
+
}, g(e.label), 11, rt))), 128))]))])])), k.value ? (p(), c("div", it, [l("div", at, [u(_(e), {
|
|
1220
|
+
size: "sm",
|
|
1221
|
+
disabled: !Y.value,
|
|
1222
|
+
onClick: _n
|
|
1223
|
+
}, {
|
|
1224
|
+
default: ae(() => [...d[23] ||= [ee("确定", -1)]]),
|
|
1225
|
+
_: 1
|
|
1226
|
+
}, 8, ["disabled"])])])) : s("", !0)])]),
|
|
1227
|
+
_: 1
|
|
1228
|
+
}, 8, [
|
|
1229
|
+
"open",
|
|
1230
|
+
"width",
|
|
1231
|
+
"min-width"
|
|
1232
|
+
]));
|
|
1233
|
+
}
|
|
1234
|
+
}), q = {
|
|
1235
|
+
sm: "h-[calc(1.75rem+2px)] text-sm/5",
|
|
1236
|
+
md: "h-[calc(2rem+2px)] text-base/4",
|
|
1237
|
+
lg: "h-[calc(2.25rem+2px)] text-lg/5"
|
|
1238
|
+
}, dt = r("group/ui-datepicker relative flex w-full min-w-0 items-center overflow-hidden border bg-primary text-primary transition-colors duration-150", {
|
|
1239
|
+
variants: {
|
|
1240
|
+
size: {
|
|
1241
|
+
sm: `${q.sm} rounded-md`,
|
|
1242
|
+
md: `${q.md} rounded-md`,
|
|
1243
|
+
lg: `${q.lg} rounded-md`
|
|
1244
|
+
},
|
|
1245
|
+
focused: {
|
|
1246
|
+
true: "border-brand ring-2 ring-brand/15",
|
|
1247
|
+
false: "border-medium hover:border-brand/40"
|
|
1248
|
+
},
|
|
1249
|
+
disabled: {
|
|
1250
|
+
true: "cursor-not-allowed bg-tertiary/20 text-tertiary opacity-70 hover:border-medium",
|
|
1251
|
+
false: "cursor-pointer"
|
|
1252
|
+
}
|
|
1253
|
+
},
|
|
1254
|
+
defaultVariants: {
|
|
1255
|
+
size: "md",
|
|
1256
|
+
focused: !1,
|
|
1257
|
+
disabled: !1
|
|
1258
|
+
}
|
|
1259
|
+
}), ft = r("min-w-0 flex-1 truncate py-0", {
|
|
1260
|
+
variants: { size: {
|
|
1261
|
+
sm: "px-2 text-sm/5",
|
|
1262
|
+
md: "px-3 text-base/4",
|
|
1263
|
+
lg: "px-4 text-lg/5"
|
|
1264
|
+
} },
|
|
1265
|
+
defaultVariants: { size: "md" }
|
|
1266
|
+
}), J = r("relative flex h-8 min-w-0 items-center justify-center rounded-md border border-transparent text-sm outline-none transition-colors duration-150", {
|
|
1267
|
+
variants: {
|
|
1268
|
+
inMonth: {
|
|
1269
|
+
true: "text-primary",
|
|
1270
|
+
false: "text-tertiary/50"
|
|
1271
|
+
},
|
|
1272
|
+
selected: {
|
|
1273
|
+
true: "border-brand-500 bg-brand-500 text-brand-50 hover:bg-brand-500",
|
|
1274
|
+
false: "hover:border-brand-400 hover:bg-brand-500/10 hover:text-brand-500"
|
|
1275
|
+
},
|
|
1276
|
+
today: {
|
|
1277
|
+
true: "",
|
|
1278
|
+
false: ""
|
|
1279
|
+
},
|
|
1280
|
+
disabled: {
|
|
1281
|
+
true: "pointer-events-none cursor-not-allowed opacity-35",
|
|
1282
|
+
false: "cursor-pointer"
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
compoundVariants: [{
|
|
1286
|
+
today: !0,
|
|
1287
|
+
selected: !1,
|
|
1288
|
+
disabled: !1,
|
|
1289
|
+
class: "border-brand-400/70 text-brand-500"
|
|
1290
|
+
}, {
|
|
1291
|
+
today: !0,
|
|
1292
|
+
selected: !1,
|
|
1293
|
+
disabled: !0,
|
|
1294
|
+
class: "border-brand-400/30"
|
|
1295
|
+
}],
|
|
1296
|
+
defaultVariants: {
|
|
1297
|
+
inMonth: !0,
|
|
1298
|
+
selected: !1,
|
|
1299
|
+
today: !1,
|
|
1300
|
+
disabled: !1
|
|
1301
|
+
}
|
|
1302
|
+
}), pt = r("relative flex h-10 min-w-0 items-center justify-center rounded-md border border-transparent px-2 text-sm outline-none transition-colors duration-150", {
|
|
1303
|
+
variants: {
|
|
1304
|
+
selected: {
|
|
1305
|
+
true: "border-brand-500 bg-brand-500 text-brand-50 hover:bg-brand-500",
|
|
1306
|
+
false: "text-primary hover:border-brand-400 hover:bg-brand-500/10 hover:text-brand-500"
|
|
1307
|
+
},
|
|
1308
|
+
current: {
|
|
1309
|
+
true: "",
|
|
1310
|
+
false: ""
|
|
1311
|
+
},
|
|
1312
|
+
disabled: {
|
|
1313
|
+
true: "pointer-events-none cursor-not-allowed opacity-35",
|
|
1314
|
+
false: "cursor-pointer"
|
|
1315
|
+
},
|
|
1316
|
+
muted: {
|
|
1317
|
+
true: "text-tertiary/50",
|
|
1318
|
+
false: ""
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
compoundVariants: [{
|
|
1322
|
+
current: !0,
|
|
1323
|
+
selected: !1,
|
|
1324
|
+
disabled: !1,
|
|
1325
|
+
class: "border-brand-400/70 text-brand-500"
|
|
1326
|
+
}, {
|
|
1327
|
+
current: !0,
|
|
1328
|
+
selected: !1,
|
|
1329
|
+
disabled: !0,
|
|
1330
|
+
class: "border-brand-400/30"
|
|
1331
|
+
}],
|
|
1332
|
+
defaultVariants: {
|
|
1333
|
+
selected: !1,
|
|
1334
|
+
current: !1,
|
|
1335
|
+
disabled: !1,
|
|
1336
|
+
muted: !1
|
|
1337
|
+
}
|
|
1338
|
+
}), mt = r("relative flex h-8 min-w-0 items-center justify-center rounded-md border border-transparent text-sm outline-none transition-colors duration-150", {
|
|
1339
|
+
variants: {
|
|
1340
|
+
inMonth: {
|
|
1341
|
+
true: "text-primary",
|
|
1342
|
+
false: "text-tertiary/50"
|
|
1343
|
+
},
|
|
1344
|
+
selected: {
|
|
1345
|
+
true: "bg-brand-500 text-brand-50 hover:bg-brand-500",
|
|
1346
|
+
false: "hover:bg-brand-500/10 hover:text-brand-500"
|
|
1347
|
+
},
|
|
1348
|
+
inRange: {
|
|
1349
|
+
true: "rounded-none bg-brand-500/10 text-brand-500",
|
|
1350
|
+
false: ""
|
|
1351
|
+
},
|
|
1352
|
+
rangeStart: {
|
|
1353
|
+
true: "rounded-l-md rounded-r-none border-brand-500",
|
|
1354
|
+
false: ""
|
|
1355
|
+
},
|
|
1356
|
+
rangeEnd: {
|
|
1357
|
+
true: "rounded-l-none rounded-r-md border-brand-500",
|
|
1358
|
+
false: ""
|
|
1359
|
+
},
|
|
1360
|
+
standalone: {
|
|
1361
|
+
true: "rounded-md",
|
|
1362
|
+
false: ""
|
|
1363
|
+
},
|
|
1364
|
+
today: {
|
|
1365
|
+
true: "",
|
|
1366
|
+
false: ""
|
|
1367
|
+
},
|
|
1368
|
+
disabled: {
|
|
1369
|
+
true: "pointer-events-none cursor-not-allowed opacity-35",
|
|
1370
|
+
false: "cursor-pointer"
|
|
1371
|
+
}
|
|
1372
|
+
},
|
|
1373
|
+
compoundVariants: [{
|
|
1374
|
+
today: !0,
|
|
1375
|
+
selected: !1,
|
|
1376
|
+
inRange: !1,
|
|
1377
|
+
disabled: !1,
|
|
1378
|
+
class: "border-brand-400/70 text-brand-500"
|
|
1379
|
+
}, {
|
|
1380
|
+
today: !0,
|
|
1381
|
+
selected: !1,
|
|
1382
|
+
disabled: !0,
|
|
1383
|
+
class: "border-brand-400/30"
|
|
1384
|
+
}],
|
|
1385
|
+
defaultVariants: {
|
|
1386
|
+
inMonth: !0,
|
|
1387
|
+
selected: !1,
|
|
1388
|
+
inRange: !1,
|
|
1389
|
+
rangeStart: !1,
|
|
1390
|
+
rangeEnd: !1,
|
|
1391
|
+
standalone: !0,
|
|
1392
|
+
today: !1,
|
|
1393
|
+
disabled: !1
|
|
1394
|
+
}
|
|
1395
|
+
}), ht = r("flex h-7 w-full items-center justify-center rounded text-xs font-mono transition-colors duration-150", {
|
|
1396
|
+
variants: {
|
|
1397
|
+
selected: {
|
|
1398
|
+
true: "bg-brand-500 text-brand-50",
|
|
1399
|
+
false: "text-secondary hover:bg-brand-500/10 hover:text-brand-500"
|
|
1400
|
+
},
|
|
1401
|
+
disabled: {
|
|
1402
|
+
true: "pointer-events-none cursor-not-allowed opacity-35",
|
|
1403
|
+
false: "cursor-pointer"
|
|
1404
|
+
}
|
|
1405
|
+
},
|
|
1406
|
+
defaultVariants: {
|
|
1407
|
+
selected: !1,
|
|
1408
|
+
disabled: !1
|
|
1409
|
+
}
|
|
1410
|
+
});
|
|
1411
|
+
//#endregion
|
|
1412
|
+
export { ft as a, N as c, ht as i, pt as n, dt as o, mt as r, ut as s, J as t };
|
|
1413
|
+
|
|
1414
|
+
//# sourceMappingURL=datepicker-Cy808x7X.js.map
|