@blueking/date-picker 0.0.46 → 0.0.48
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/dist/vue2-full.css +1 -1
- package/dist/vue2-full.es.js +1099 -1091
- package/dist/vue2-light.css +1 -1
- package/dist/vue2-light.es.js +1066 -1058
- package/dist/vue3-full.es.js +801 -793
- package/dist/vue3-light.es.js +318 -310
- package/package.json +1 -1
package/dist/vue3-light.es.js
CHANGED
|
@@ -7,8 +7,8 @@ import Ma from "dayjs/plugin/customParseFormat";
|
|
|
7
7
|
import Ha from "dayjs/plugin/localizedFormat";
|
|
8
8
|
import za from "dayjs/plugin/timezone";
|
|
9
9
|
import Ea from "dayjs/plugin/utc";
|
|
10
|
-
import { provide as La, inject as Ua, defineComponent as F, openBlock as p, createElementBlock as M, createVNode as D, unref as i, withCtx as T, Fragment as B, renderList as R, createBlock as $, createTextVNode as U, toDisplayString as
|
|
11
|
-
import
|
|
10
|
+
import { provide as La, inject as Ua, defineComponent as F, openBlock as p, createElementBlock as M, createVNode as D, unref as i, withCtx as T, Fragment as B, renderList as R, createBlock as $, createTextVNode as U, toDisplayString as k, createCommentVNode as ra, shallowRef as W, watch as la, createElementVNode as d, normalizeClass as ia, withModifiers as Sa, ref as Y, withDirectives as na, withKeys as ga, computed as G, vShow as xa, KeepAlive as Ka, resolveDynamicComponent as qa, onBeforeUnmount as Oa, normalizeStyle as Fa } from "vue";
|
|
11
|
+
import ea from "bkui-vue/lib/popover";
|
|
12
12
|
import "bkui-vue/lib/popover/popover.css";
|
|
13
13
|
import { provideGlobalConfig as Ga } from "bkui-vue/lib/config-provider";
|
|
14
14
|
import { clickoutside as oa } from "bkui-vue/lib/directives";
|
|
@@ -92,8 +92,8 @@ const te = (t) => {
|
|
|
92
92
|
"(至今)": "(so far)"
|
|
93
93
|
};
|
|
94
94
|
Object.keys(da).reduce((t, e) => (t[da[e]] = e, t), {});
|
|
95
|
-
const
|
|
96
|
-
var
|
|
95
|
+
const ua = te("blueking_language") || "zh-cn", c = (t) => ua !== "en" ? Z[t] || t : Z[t] || ne[t] || ie[t] || da[t] || t;
|
|
96
|
+
var y = /* @__PURE__ */ ((t) => (t.Date = "date", t.FUTURE = "now+", t.NATURAL = "natural", t.RECENT = "now-", t))(y || {});
|
|
97
97
|
const Va = [
|
|
98
98
|
{
|
|
99
99
|
id: "s",
|
|
@@ -185,7 +185,7 @@ const ma = [
|
|
|
185
185
|
unit: "w"
|
|
186
186
|
}
|
|
187
187
|
];
|
|
188
|
-
var
|
|
188
|
+
var sa = /* @__PURE__ */ ((t) => (t.ALL = "all", t.NOW = "now", t))(sa || {});
|
|
189
189
|
const ka = [
|
|
190
190
|
{
|
|
191
191
|
id: "all",
|
|
@@ -206,19 +206,19 @@ const ka = [
|
|
|
206
206
|
}
|
|
207
207
|
], le = [
|
|
208
208
|
{
|
|
209
|
-
id:
|
|
209
|
+
id: y.RECENT,
|
|
210
210
|
name: c("最近")
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
|
-
id:
|
|
213
|
+
id: y.FUTURE,
|
|
214
214
|
name: c("未来")
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
id:
|
|
217
|
+
id: y.NATURAL,
|
|
218
218
|
name: c("自然日期")
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
|
-
id:
|
|
221
|
+
id: y.Date,
|
|
222
222
|
name: c("日期选择")
|
|
223
223
|
}
|
|
224
224
|
], ce = "__bk_time_picker_store__", se = "__bk_time_picker_store_tab__", ue = (t = 1) => `${ce}_${t}`, _a = (t = 1) => `${se}_${t}`, oe = [
|
|
@@ -1623,18 +1623,18 @@ const ve = [
|
|
|
1623
1623
|
]
|
|
1624
1624
|
}
|
|
1625
1625
|
], be = () => {
|
|
1626
|
-
const t = h.tz.guess(), e = [], a = ve.map((
|
|
1627
|
-
label:
|
|
1628
|
-
options:
|
|
1629
|
-
const
|
|
1630
|
-
...
|
|
1631
|
-
...pe(
|
|
1626
|
+
const t = h.tz.guess(), e = [], a = ve.map((n) => ({
|
|
1627
|
+
label: n.label,
|
|
1628
|
+
options: n.options.map((r) => {
|
|
1629
|
+
const o = {
|
|
1630
|
+
...r,
|
|
1631
|
+
...pe(r.searchIndex)
|
|
1632
1632
|
};
|
|
1633
|
-
return
|
|
1634
|
-
...
|
|
1635
|
-
...
|
|
1636
|
-
label:
|
|
1637
|
-
}),
|
|
1633
|
+
return r.value === t && e.push({
|
|
1634
|
+
...r,
|
|
1635
|
+
...o,
|
|
1636
|
+
label: o.label
|
|
1637
|
+
}), o;
|
|
1638
1638
|
})
|
|
1639
1639
|
}));
|
|
1640
1640
|
return a.unshift({
|
|
@@ -1649,18 +1649,18 @@ const ve = [
|
|
|
1649
1649
|
countryCode: e[4] || "",
|
|
1650
1650
|
utc: e[2].toLocaleUpperCase()
|
|
1651
1651
|
};
|
|
1652
|
-
}, Ya = be(), Ba = (t) => Ya.reduce((e, a) => (e == null ? void 0 : e.label) === t ? e : a.options.find((
|
|
1653
|
-
class
|
|
1654
|
-
constructor(e = ["", ""], a = "YYYY-MM-DD HH:mm:ss",
|
|
1652
|
+
}, Ya = be(), Ba = (t) => Ya.reduce((e, a) => (e == null ? void 0 : e.label) === t ? e : a.options.find((n) => n.label === t), {}), ta = new RegExp(`now([+-]?\\d*)([${Q}]?)\\/?([${Q}]?)`), fe = new RegExp(`now[-](\\d+)([${Q}]{1})$`), Ae = new RegExp(`now[+](\\d+)([${Q}]{1})$`), ha = new RegExp(`now([+-]?\\d*)([${Q}]?)\\/([${Q}])$`);
|
|
1653
|
+
class aa {
|
|
1654
|
+
constructor(e = ["", ""], a = "YYYY-MM-DD HH:mm:ss", n = h.tz.guess()) {
|
|
1655
1655
|
J(this, "endDate");
|
|
1656
1656
|
J(this, "endNum");
|
|
1657
1657
|
J(this, "endUnit");
|
|
1658
1658
|
J(this, "startDate");
|
|
1659
1659
|
J(this, "startNum");
|
|
1660
1660
|
J(this, "startUnit");
|
|
1661
|
-
this.dateValue = e, this.format = a, this.timezome =
|
|
1662
|
-
const [
|
|
1663
|
-
this.startDate =
|
|
1661
|
+
this.dateValue = e, this.format = a, this.timezome = n;
|
|
1662
|
+
const [r, o] = e;
|
|
1663
|
+
this.startDate = r ? this.transformValue2Dayjs(r) : null, this.endDate = o ? this.transformValue2Dayjs(o, "end") : null;
|
|
1664
1664
|
}
|
|
1665
1665
|
dateDuration() {
|
|
1666
1666
|
if (!this.startDate || !this.endDate || !this.isValidate)
|
|
@@ -1670,82 +1670,82 @@ class ca {
|
|
|
1670
1670
|
return e % a === a - 1e3 && (e += 1e3), e;
|
|
1671
1671
|
}
|
|
1672
1672
|
toDisplayString() {
|
|
1673
|
-
var
|
|
1673
|
+
var o, _;
|
|
1674
1674
|
if (!this.startDate || !this.endDate || !this.isValidate)
|
|
1675
|
-
return ((
|
|
1676
|
-
if (this.dateMode ===
|
|
1675
|
+
return ((o = this.dateValue) == null ? void 0 : o.join(" ~ ")) || "";
|
|
1676
|
+
if (this.dateMode === y.RECENT)
|
|
1677
1677
|
return `${c("近")} ${Math.abs(this.startNum)} ${c(
|
|
1678
1678
|
Z[this.startUnit]
|
|
1679
1679
|
)}`;
|
|
1680
|
-
if (this.dateMode ===
|
|
1680
|
+
if (this.dateMode === y.FUTURE)
|
|
1681
1681
|
return `${c("未来")} ${Math.abs(this.endNum)} ${c(
|
|
1682
1682
|
Z[this.endUnit]
|
|
1683
1683
|
)}`;
|
|
1684
1684
|
const [e, a] = this.dateValue;
|
|
1685
|
-
if (this.dateMode ===
|
|
1686
|
-
const s = a !== j ? "" : c("(至今)"), l = ma.find((
|
|
1685
|
+
if (this.dateMode === y.NATURAL) {
|
|
1686
|
+
const s = a !== j ? "" : c("(至今)"), l = ma.find((u) => u.id === e);
|
|
1687
1687
|
return l ? c(l.name) + s : `${`${c("前")} ${this.startNum} ${c(
|
|
1688
1688
|
Z[this.startUnit]
|
|
1689
1689
|
)}`}${s}`;
|
|
1690
1690
|
}
|
|
1691
|
-
let
|
|
1691
|
+
let n = this.format;
|
|
1692
1692
|
if (a === j)
|
|
1693
|
-
return `${(
|
|
1694
|
-
const
|
|
1695
|
-
(s, l,
|
|
1693
|
+
return `${(_ = this.startDate) == null ? void 0 : _.format(this.format)} ~ ${c("此刻")}`;
|
|
1694
|
+
const r = ["Y", "M", "D", "H", "m", "s"].reduce(
|
|
1695
|
+
(s, l, u, x) => (u < 1 || (this.format.indexOf(l) > this.format.indexOf(x[u - 1]) ? s.push(l) : s = []), s),
|
|
1696
1696
|
["Y"]
|
|
1697
1697
|
);
|
|
1698
|
-
if (
|
|
1698
|
+
if (r.length > 1 && r.includes("D") && this.startDate.isSame(this.endDate, "year")) {
|
|
1699
1699
|
const [, s] = this.format.match(/(Y+)/);
|
|
1700
1700
|
let l = this.format.replace(s, this.startDate.format(s));
|
|
1701
|
-
if (
|
|
1702
|
-
const [,
|
|
1703
|
-
if (l = l.replace(
|
|
1704
|
-
const [,
|
|
1705
|
-
if (l = l.replace(
|
|
1701
|
+
if (n = n.replace(/Y+[-/\\\s]/, ""), this.startDate.isSame(this.endDate, "month")) {
|
|
1702
|
+
const [, u] = this.format.match(/(M+)/);
|
|
1703
|
+
if (l = l.replace(u, this.startDate.format(u)), n = n.replace(/M+[-/\\\s]/, ""), this.startDate.isSame(this.endDate, "day")) {
|
|
1704
|
+
const [, x] = this.format.match(/(d+|D+)/);
|
|
1705
|
+
if (l = l.replace(x, this.startDate.format(x)), n = n.replace(/(d|D)+[-/\\\s]/, ""), this.startDate.isSame(this.endDate, "hour")) {
|
|
1706
1706
|
const [, f] = this.format.match(/(H+|h+)/);
|
|
1707
|
-
if (l = l.replace(f, this.startDate.format(f)),
|
|
1707
|
+
if (l = l.replace(f, this.startDate.format(f)), n = n.replace(/[Hh]+[-/\\\s:]/, ""), this.startDate.isSame(this.endDate, "minute")) {
|
|
1708
1708
|
const [, z] = this.format.match(/(m+)/);
|
|
1709
|
-
l = l.replace(z, this.startDate.format(z)),
|
|
1709
|
+
l = l.replace(z, this.startDate.format(z)), n = n.replace(/m+[-/\\\s:]/, "");
|
|
1710
1710
|
}
|
|
1711
1711
|
}
|
|
1712
1712
|
}
|
|
1713
1713
|
}
|
|
1714
1714
|
return l.replace(
|
|
1715
|
-
|
|
1716
|
-
` ( ${this.startDate.format(
|
|
1715
|
+
n,
|
|
1716
|
+
` ( ${this.startDate.format(n)} ~ ${this.endDate.format(n)} )`
|
|
1717
1717
|
);
|
|
1718
1718
|
}
|
|
1719
1719
|
return `${this.startDate.format(this.format)} ~ ${this.endDate.format(this.format)}`;
|
|
1720
1720
|
}
|
|
1721
1721
|
toEmitValue() {
|
|
1722
|
-
var e, a,
|
|
1722
|
+
var e, a, n, r;
|
|
1723
1723
|
return [
|
|
1724
|
-
this.dateMode ===
|
|
1724
|
+
this.dateMode === y.Date ? [(e = this.startDate) == null ? void 0 : e.valueOf(), this.dateValue[1] === j ? j : (a = this.endDate) == null ? void 0 : a.valueOf()] : [...this.dateValue],
|
|
1725
1725
|
[
|
|
1726
1726
|
{
|
|
1727
1727
|
dayjs: this.startDate,
|
|
1728
|
-
formatText: (
|
|
1728
|
+
formatText: (n = this.startDate) == null ? void 0 : n.format(this.format)
|
|
1729
1729
|
},
|
|
1730
1730
|
{
|
|
1731
1731
|
dayjs: this.endDate,
|
|
1732
|
-
formatText: (
|
|
1732
|
+
formatText: (r = this.endDate) == null ? void 0 : r.format(this.format)
|
|
1733
1733
|
}
|
|
1734
1734
|
]
|
|
1735
1735
|
];
|
|
1736
1736
|
}
|
|
1737
1737
|
transformValue2Dayjs(e, a = "start") {
|
|
1738
|
-
const
|
|
1739
|
-
let
|
|
1740
|
-
if (typeof
|
|
1741
|
-
return h.tz(
|
|
1742
|
-
const [,
|
|
1743
|
-
return a === "start" ? (this.startNum = Math.abs(+
|
|
1738
|
+
const n = isNaN(e) ? e : +e;
|
|
1739
|
+
let r = h(n);
|
|
1740
|
+
if (typeof n == "number" || h.isDayjs(n) || r.isValid())
|
|
1741
|
+
return h.tz(r.valueOf(), this.timezome);
|
|
1742
|
+
const [, o, _, s] = n.match(ta) || [];
|
|
1743
|
+
return a === "start" ? (this.startNum = Math.abs(+o), this.startUnit = _ || s) : a === "end" && (this.endNum = Math.abs(+o), this.endUnit = _ || s), o ? r = h().add(+o, _ || s) : n === j && (r = h()), s ? (r = a === "start" ? h.tz(h(r.isValid() ? r : void 0).valueOf(), this.timezome).startOf(s) : h.tz(h(r.isValid() ? r : void 0), this.timezome).endOf(s), r) : h.tz(r.valueOf(), this.timezome);
|
|
1744
1744
|
}
|
|
1745
1745
|
updateDateValue(e, a) {
|
|
1746
1746
|
this.dateValue = e;
|
|
1747
|
-
const [
|
|
1748
|
-
a && (this.timezome = a), this.startDate =
|
|
1747
|
+
const [n, r] = e;
|
|
1748
|
+
a && (this.timezome = a), this.startDate = n ? this.transformValue2Dayjs(n) : null, this.endDate = r ? this.transformValue2Dayjs(r, "end") : null;
|
|
1749
1749
|
}
|
|
1750
1750
|
updateFormat(e) {
|
|
1751
1751
|
this.format = e;
|
|
@@ -1753,46 +1753,46 @@ class ca {
|
|
|
1753
1753
|
get dateMode() {
|
|
1754
1754
|
const [e, a] = this.dateValue;
|
|
1755
1755
|
if (typeof e == "number" || typeof a == "number" || h.isDayjs(e) || h.isDayjs(a) || h(e).isValid() || h(a).isValid())
|
|
1756
|
-
return
|
|
1756
|
+
return y.Date;
|
|
1757
1757
|
if (e === j && Ae.test(a))
|
|
1758
|
-
return
|
|
1758
|
+
return y.FUTURE;
|
|
1759
1759
|
if (a === j && fe.test(e))
|
|
1760
|
-
return
|
|
1760
|
+
return y.RECENT;
|
|
1761
1761
|
if (de[this.dateValue.join("~")])
|
|
1762
|
-
return
|
|
1762
|
+
return y.NATURAL;
|
|
1763
1763
|
if (ha.test(e) && (ha.test(a) || a === j)) {
|
|
1764
|
-
const [,
|
|
1765
|
-
if (
|
|
1766
|
-
return
|
|
1764
|
+
const [, n, r, o] = e.match(ta) || [], [, _, s, l] = a.match(ta) || [];
|
|
1765
|
+
if (o && (a === j || n && +_ == -1 && r === o && s === l && r === s))
|
|
1766
|
+
return y.NATURAL;
|
|
1767
1767
|
}
|
|
1768
|
-
return
|
|
1768
|
+
return y.Date;
|
|
1769
1769
|
}
|
|
1770
1770
|
get isValidate() {
|
|
1771
1771
|
var e, a;
|
|
1772
1772
|
return ((e = this.startDate) == null ? void 0 : e.isValid()) && ((a = this.endDate) == null ? void 0 : a.isValid());
|
|
1773
1773
|
}
|
|
1774
1774
|
get recentOrFuturedateNum() {
|
|
1775
|
-
if (this.dateMode ===
|
|
1775
|
+
if (this.dateMode === y.RECENT)
|
|
1776
1776
|
return this.startNum;
|
|
1777
|
-
if (this.dateMode ===
|
|
1777
|
+
if (this.dateMode === y.FUTURE)
|
|
1778
1778
|
return this.endNum;
|
|
1779
1779
|
}
|
|
1780
1780
|
get recentOrFuturedateUnit() {
|
|
1781
|
-
return this.dateMode ===
|
|
1781
|
+
return this.dateMode === y.RECENT ? this.startUnit : this.dateMode === y.FUTURE ? this.endUnit : "m";
|
|
1782
1782
|
}
|
|
1783
1783
|
}
|
|
1784
1784
|
const va = (t, e = "start", a) => {
|
|
1785
|
-
const
|
|
1786
|
-
let
|
|
1787
|
-
if (typeof
|
|
1788
|
-
return h.tz(
|
|
1789
|
-
const [,
|
|
1790
|
-
return
|
|
1785
|
+
const n = isNaN(t) ? t : +t;
|
|
1786
|
+
let r = h(n);
|
|
1787
|
+
if (typeof n == "number" || h.isDayjs(n) || r.isValid())
|
|
1788
|
+
return h.tz(r.valueOf(), a || h.tz.guess());
|
|
1789
|
+
const [, o, _, s] = n.match(ta) || [];
|
|
1790
|
+
return o ? r = h().add(+o, _ || s || "d") : n === j && (r = h()), s ? (r = e === "start" ? h.tz(h(r.isValid() ? r : void 0).valueOf(), a).startOf(s) : h.tz(h(r.isValid() ? r : void 0), a).endOf(s), r != null && r.isValid() ? r : void 0) : r.isValid() ? h.tz(r.valueOf(), a || h.tz.guess()) : void 0;
|
|
1791
1791
|
}, qt = (t, e) => {
|
|
1792
1792
|
if (!Array.isArray(t) || t.length < 1)
|
|
1793
1793
|
return [];
|
|
1794
|
-
const [a,
|
|
1795
|
-
return [
|
|
1794
|
+
const [a, n] = t || [], r = va(a, "start", e), o = va(n, "end", e);
|
|
1795
|
+
return [r, o];
|
|
1796
1796
|
}, ge = (t) => {
|
|
1797
1797
|
const e = localStorage.getItem(t);
|
|
1798
1798
|
let a = [];
|
|
@@ -1805,14 +1805,14 @@ const va = (t, e = "start", a) => {
|
|
|
1805
1805
|
return Array.isArray(a) || (a = []), a;
|
|
1806
1806
|
}, xe = (t, e) => {
|
|
1807
1807
|
let a = [];
|
|
1808
|
-
const
|
|
1809
|
-
if (
|
|
1808
|
+
const n = localStorage.getItem(e);
|
|
1809
|
+
if (n)
|
|
1810
1810
|
try {
|
|
1811
|
-
a = JSON.parse(
|
|
1811
|
+
a = JSON.parse(n);
|
|
1812
1812
|
} catch {
|
|
1813
1813
|
a = [];
|
|
1814
1814
|
}
|
|
1815
|
-
Array.isArray(a) || (a = []), !a.some((
|
|
1815
|
+
Array.isArray(a) || (a = []), !a.some((r) => r[0] === t[0] && r[1] === t[1]) && (a.unshift(t), localStorage.setItem(e, JSON.stringify(a.slice(0, 10))));
|
|
1816
1816
|
}, Ie = { class: "common-panel-tab" }, ya = /* @__PURE__ */ F({
|
|
1817
1817
|
__name: "common-tab",
|
|
1818
1818
|
props: {
|
|
@@ -1831,17 +1831,17 @@ const va = (t, e = "start", a) => {
|
|
|
1831
1831
|
return (e, a) => (p(), M("div", Ie, [
|
|
1832
1832
|
D(i(Ia), {
|
|
1833
1833
|
active: t.modelValue,
|
|
1834
|
-
"onUpdate:active": a[0] || (a[0] = (
|
|
1834
|
+
"onUpdate:active": a[0] || (a[0] = (n) => e.$emit("update:modelValue", n)),
|
|
1835
1835
|
type: "unborder-card"
|
|
1836
1836
|
}, {
|
|
1837
1837
|
default: T(() => [
|
|
1838
1838
|
(p(!0), M(
|
|
1839
1839
|
B,
|
|
1840
1840
|
null,
|
|
1841
|
-
R(t.panels, (
|
|
1842
|
-
key:
|
|
1843
|
-
label:
|
|
1844
|
-
name:
|
|
1841
|
+
R(t.panels, (n) => (p(), $(i(Ia).TabPanel, {
|
|
1842
|
+
key: n.id,
|
|
1843
|
+
label: n.name,
|
|
1844
|
+
name: n.id
|
|
1845
1845
|
}, null, 8, ["label", "name"]))),
|
|
1846
1846
|
128
|
|
1847
1847
|
/* KEYED_FRAGMENT */
|
|
@@ -1867,13 +1867,13 @@ const pa = /* @__PURE__ */ F({
|
|
|
1867
1867
|
D(i(ba), {
|
|
1868
1868
|
disabled: e.disabled,
|
|
1869
1869
|
outline: !0,
|
|
1870
|
-
onClick: a[0] || (a[0] = (
|
|
1870
|
+
onClick: a[0] || (a[0] = (n) => e.$emit("submit")),
|
|
1871
1871
|
class: "common-submit",
|
|
1872
1872
|
theme: "primary"
|
|
1873
1873
|
}, {
|
|
1874
1874
|
default: T(() => [
|
|
1875
1875
|
U(
|
|
1876
|
-
|
|
1876
|
+
k(i(c)("确定")),
|
|
1877
1877
|
1
|
|
1878
1878
|
/* TEXT */
|
|
1879
1879
|
)
|
|
@@ -1881,7 +1881,7 @@ const pa = /* @__PURE__ */ F({
|
|
|
1881
1881
|
_: 1
|
|
1882
1882
|
/* STABLE */
|
|
1883
1883
|
}, 8, ["disabled"]),
|
|
1884
|
-
|
|
1884
|
+
ra("v-if", !0)
|
|
1885
1885
|
],
|
|
1886
1886
|
64
|
|
1887
1887
|
/* STABLE_FRAGMENT */
|
|
@@ -1894,7 +1894,7 @@ const ke = { class: "date-panel" }, _e = { class: "date-panel-title" }, ye = { c
|
|
|
1894
1894
|
null,
|
|
1895
1895
|
-1
|
|
1896
1896
|
/* HOISTED */
|
|
1897
|
-
), Ee = { class: "date-header-right" }, Se = { class: "date-content" }, Pe = { class: "date-grid" }, Ce = ["onClick"], wa = 6,
|
|
1897
|
+
), Ee = { class: "date-header-right" }, Se = { class: "date-content" }, Pe = { class: "date-grid" }, Ce = ["onClick"], wa = 6, ca = 7, Da = /* @__PURE__ */ F({
|
|
1898
1898
|
__name: "date-panel",
|
|
1899
1899
|
props: {
|
|
1900
1900
|
format: { default: "YYYY-MM-DD HH:mm:ss" },
|
|
@@ -1904,14 +1904,14 @@ const ke = { class: "date-panel" }, _e = { class: "date-panel-title" }, ye = { c
|
|
|
1904
1904
|
},
|
|
1905
1905
|
emits: ["update:isNow", "update:modelValue"],
|
|
1906
1906
|
setup(t, { emit: e }) {
|
|
1907
|
-
const a = t,
|
|
1908
|
-
|
|
1907
|
+
const a = t, n = e, r = ua === "en" ? ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] : ["日", "一", "二", "三", "四", "五", "六"], o = W([]), _ = h(), s = W(a.modelValue || _);
|
|
1908
|
+
la(
|
|
1909
1909
|
s,
|
|
1910
1910
|
() => {
|
|
1911
1911
|
const f = s.value.startOf("month").startOf("week"), z = [];
|
|
1912
|
-
for (let E = 0; E < wa *
|
|
1912
|
+
for (let E = 0; E < wa * ca; E++)
|
|
1913
1913
|
z.push(f.add(E, "day"));
|
|
1914
|
-
|
|
1914
|
+
o.value = z;
|
|
1915
1915
|
},
|
|
1916
1916
|
{
|
|
1917
1917
|
immediate: !0
|
|
@@ -1919,15 +1919,15 @@ const ke = { class: "date-panel" }, _e = { class: "date-panel-title" }, ye = { c
|
|
|
1919
1919
|
);
|
|
1920
1920
|
const l = (f) => {
|
|
1921
1921
|
s.value = s.value.add(f, "month");
|
|
1922
|
-
},
|
|
1922
|
+
}, u = (f) => {
|
|
1923
1923
|
s.value = s.value.add(f, "year");
|
|
1924
|
-
},
|
|
1925
|
-
a.minDate && f.isBefore(a.minDate, "day") ||
|
|
1924
|
+
}, x = (f) => {
|
|
1925
|
+
a.minDate && f.isBefore(a.minDate, "day") || n("update:modelValue", f);
|
|
1926
1926
|
};
|
|
1927
1927
|
return (f, z) => (p(), M("div", ke, [
|
|
1928
1928
|
d("div", _e, [
|
|
1929
1929
|
U(
|
|
1930
|
-
|
|
1930
|
+
k(i(c)("结束时间")) + " ",
|
|
1931
1931
|
1
|
|
1932
1932
|
/* TEXT */
|
|
1933
1933
|
),
|
|
@@ -1948,7 +1948,7 @@ const ke = { class: "date-panel" }, _e = { class: "date-panel-title" }, ye = { c
|
|
|
1948
1948
|
d("div", we, [
|
|
1949
1949
|
d("div", De, [
|
|
1950
1950
|
D(i(Ja), {
|
|
1951
|
-
onClick: z[1] || (z[1] = (E) =>
|
|
1951
|
+
onClick: z[1] || (z[1] = (E) => u(-1)),
|
|
1952
1952
|
class: "hand-icon"
|
|
1953
1953
|
}),
|
|
1954
1954
|
D(i(Pa), {
|
|
@@ -1958,13 +1958,13 @@ const ke = { class: "date-panel" }, _e = { class: "date-panel-title" }, ye = { c
|
|
|
1958
1958
|
]),
|
|
1959
1959
|
d("div", Me, [
|
|
1960
1960
|
U(
|
|
1961
|
-
|
|
1961
|
+
k(s.value.year()),
|
|
1962
1962
|
1
|
|
1963
1963
|
/* TEXT */
|
|
1964
1964
|
),
|
|
1965
1965
|
ze,
|
|
1966
1966
|
U(
|
|
1967
|
-
|
|
1967
|
+
k(s.value.month() + 1),
|
|
1968
1968
|
1
|
|
1969
1969
|
/* TEXT */
|
|
1970
1970
|
)
|
|
@@ -1975,7 +1975,7 @@ const ke = { class: "date-panel" }, _e = { class: "date-panel-title" }, ye = { c
|
|
|
1975
1975
|
class: "hand-icon"
|
|
1976
1976
|
}),
|
|
1977
1977
|
D(i(Wa), {
|
|
1978
|
-
onClick: z[4] || (z[4] = (E) =>
|
|
1978
|
+
onClick: z[4] || (z[4] = (E) => u(1)),
|
|
1979
1979
|
class: "hand-icon"
|
|
1980
1980
|
})
|
|
1981
1981
|
])
|
|
@@ -1985,13 +1985,13 @@ const ke = { class: "date-panel" }, _e = { class: "date-panel-title" }, ye = { c
|
|
|
1985
1985
|
(p(!0), M(
|
|
1986
1986
|
B,
|
|
1987
1987
|
null,
|
|
1988
|
-
R(i(
|
|
1988
|
+
R(i(r), (E, V) => (p(), M(
|
|
1989
1989
|
"li",
|
|
1990
1990
|
{
|
|
1991
1991
|
key: V,
|
|
1992
1992
|
class: "date-grid-item not-click"
|
|
1993
1993
|
},
|
|
1994
|
-
|
|
1994
|
+
k(E),
|
|
1995
1995
|
1
|
|
1996
1996
|
/* TEXT */
|
|
1997
1997
|
))),
|
|
@@ -2009,17 +2009,17 @@ const ke = { class: "date-panel" }, _e = { class: "date-panel-title" }, ye = { c
|
|
|
2009
2009
|
(p(!0), M(
|
|
2010
2010
|
B,
|
|
2011
2011
|
null,
|
|
2012
|
-
R(
|
|
2013
|
-
class:
|
|
2012
|
+
R(o.value.slice((E - 1) * ca, (E - 1) * ca + ca), (V) => (p(), M("li", {
|
|
2013
|
+
class: ia([{
|
|
2014
2014
|
"is-last-month": V.isBefore(s.value, "month"),
|
|
2015
2015
|
"is-next-month": V.isAfter(s.value, "month"),
|
|
2016
|
-
"is-today": V.isSame(i(
|
|
2016
|
+
"is-today": V.isSame(i(_), "day"),
|
|
2017
2017
|
"is-disabled": f.minDate && V.isBefore(f.minDate, "day"),
|
|
2018
2018
|
"is-selected": a.modelValue && V.isSame(a.modelValue, "day")
|
|
2019
2019
|
}, "date-grid-item"]),
|
|
2020
2020
|
key: V.unix(),
|
|
2021
|
-
onClick: Sa((H) =>
|
|
2022
|
-
},
|
|
2021
|
+
onClick: Sa((H) => x(V), ["prevent"])
|
|
2022
|
+
}, k(V.date()), 11, Ce))),
|
|
2023
2023
|
128
|
|
2024
2024
|
/* KEYED_FRAGMENT */
|
|
2025
2025
|
))
|
|
@@ -2068,14 +2068,14 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2068
2068
|
emits: ["change"],
|
|
2069
2069
|
setup(t, { emit: e }) {
|
|
2070
2070
|
h.extend(Ma);
|
|
2071
|
-
const a = t,
|
|
2072
|
-
|
|
2071
|
+
const a = t, n = e, r = Y(null), o = Y(null), _ = Y(!1), s = Y(!1), l = W(), u = W(), x = Y(!1), { format: f } = Na(), z = h();
|
|
2072
|
+
la(
|
|
2073
2073
|
() => a.value,
|
|
2074
2074
|
(A) => {
|
|
2075
|
-
if (A.dateMode !==
|
|
2075
|
+
if (A.dateMode !== y.Date)
|
|
2076
2076
|
return;
|
|
2077
2077
|
const { dateValue: v, endDate: b, startDate: N } = A;
|
|
2078
|
-
!(N != null && N.isValid()) && !(b != null && b.isValid()) || (l.value = N,
|
|
2078
|
+
!(N != null && N.isValid()) && !(b != null && b.isValid()) || (l.value = N, u.value = b, x.value = v[1] === j);
|
|
2079
2079
|
},
|
|
2080
2080
|
{
|
|
2081
2081
|
immediate: !0
|
|
@@ -2084,43 +2084,43 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2084
2084
|
const E = async (A, v) => {
|
|
2085
2085
|
var fa, Aa;
|
|
2086
2086
|
const b = A.target.value.toString().trim();
|
|
2087
|
-
if (!b || v === "end" && b === j &&
|
|
2087
|
+
if (!b || v === "end" && b === j && x.value)
|
|
2088
2088
|
return;
|
|
2089
2089
|
if (b === j && v === "end") {
|
|
2090
|
-
|
|
2090
|
+
x.value || (x.value = !0, I(h()));
|
|
2091
2091
|
return;
|
|
2092
2092
|
}
|
|
2093
|
-
const N = v === "start" ? l.value :
|
|
2093
|
+
const N = v === "start" ? l.value : u.value;
|
|
2094
2094
|
let O;
|
|
2095
|
-
|
|
2095
|
+
ta.test(b) && (O = va(b, v)), O || (O = h(b)), O.isValid() && (N != null && N.isSame(O) || (v === "start" ? w(O) : (x.value = b === j, I(u ? O : O.endOf("d"))))), A.target.value = v === "start" ? ((fa = l.value) == null ? void 0 : fa.format(f.value)) || "" : ((Aa = u.value) == null ? void 0 : Aa.format(f.value)) || "";
|
|
2096
2096
|
}, V = () => {
|
|
2097
|
-
|
|
2097
|
+
_.value = !0;
|
|
2098
2098
|
}, H = () => {
|
|
2099
2099
|
s.value = !0;
|
|
2100
2100
|
}, q = (A = 32) => {
|
|
2101
|
-
setTimeout(() =>
|
|
2101
|
+
setTimeout(() => _.value = !1, A);
|
|
2102
2102
|
}, L = (A = 32) => {
|
|
2103
2103
|
setTimeout(() => s.value = !1, A);
|
|
2104
2104
|
}, w = (A) => {
|
|
2105
2105
|
var v, b;
|
|
2106
|
-
(v = l.value) != null && v.isSame(A) || (l.value = A),
|
|
2107
|
-
},
|
|
2106
|
+
(v = l.value) != null && v.isSame(A) || (l.value = A), u.value || ((b = o.value) == null || b.focus(), H()), q();
|
|
2107
|
+
}, I = (A) => {
|
|
2108
2108
|
var v, b;
|
|
2109
|
-
(v =
|
|
2109
|
+
(v = u.value) != null && v.isSame(A) || (u.value = A), l.value || ((b = r.value) == null || b.focus(), V()), L();
|
|
2110
2110
|
}, m = () => {
|
|
2111
2111
|
var A;
|
|
2112
|
-
|
|
2112
|
+
x.value = !x.value, u.value = h(), l.value ? _.value = !1 : ((A = r.value) == null || A.focus(), V()), L();
|
|
2113
2113
|
}, S = () => {
|
|
2114
|
-
l.value = void 0,
|
|
2115
|
-
},
|
|
2114
|
+
l.value = void 0, u.value = void 0, x.value = !1, q(), L();
|
|
2115
|
+
}, g = () => {
|
|
2116
2116
|
var A, v;
|
|
2117
|
-
l.value &&
|
|
2117
|
+
l.value && u.value && n("change", [
|
|
2118
2118
|
((A = l.value) == null ? void 0 : A.valueOf()) || "",
|
|
2119
|
-
|
|
2119
|
+
x.value ? j : ((v = u.value) == null ? void 0 : v.valueOf()) || ""
|
|
2120
2120
|
]);
|
|
2121
2121
|
}, C = (A) => {
|
|
2122
2122
|
var v;
|
|
2123
|
-
|
|
2123
|
+
_.value && ((v = document.querySelector(".__date-picker-popover-start__")) != null && v.contains(A.target) || q());
|
|
2124
2124
|
}, P = (A) => {
|
|
2125
2125
|
var v;
|
|
2126
2126
|
s.value && ((v = document.querySelector(".__date-picker-popover-end__")) != null && v.contains(A.target) || L());
|
|
@@ -2129,9 +2129,9 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2129
2129
|
d("div", Ve, [
|
|
2130
2130
|
d("div", je, [
|
|
2131
2131
|
Ne,
|
|
2132
|
-
D(i(
|
|
2132
|
+
D(i(ea), {
|
|
2133
2133
|
arrow: !1,
|
|
2134
|
-
"is-show":
|
|
2134
|
+
"is-show": _.value,
|
|
2135
2135
|
boundary: "parent",
|
|
2136
2136
|
"ext-cls": "__bk-date-picker-popover__ __date-picker-popover-start__",
|
|
2137
2137
|
placement: "bottom-start",
|
|
@@ -2141,7 +2141,7 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2141
2141
|
content: T(() => [
|
|
2142
2142
|
D(Da, {
|
|
2143
2143
|
format: i(f),
|
|
2144
|
-
"is-now":
|
|
2144
|
+
"is-now": x.value,
|
|
2145
2145
|
"model-value": l.value,
|
|
2146
2146
|
"onUpdate:isNow": m,
|
|
2147
2147
|
"onUpdate:modelValue": w,
|
|
@@ -2151,7 +2151,7 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2151
2151
|
default: T(() => {
|
|
2152
2152
|
var b;
|
|
2153
2153
|
return [
|
|
2154
|
-
|
|
2154
|
+
na(d("input", {
|
|
2155
2155
|
placeholder: i(c)("开始时间"),
|
|
2156
2156
|
value: (b = l.value) == null ? void 0 : b.format(i(f)),
|
|
2157
2157
|
onBlur: v[0] || (v[0] = (N) => E(N, "start")),
|
|
@@ -2159,7 +2159,7 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2159
2159
|
onKeypress: v[1] || (v[1] = ga((N) => E(N, "start"), ["enter"])),
|
|
2160
2160
|
class: "date-picker-start",
|
|
2161
2161
|
ref_key: "startInput",
|
|
2162
|
-
ref:
|
|
2162
|
+
ref: r,
|
|
2163
2163
|
spellcheck: "false"
|
|
2164
2164
|
}, null, 40, Ye), [
|
|
2165
2165
|
[i(oa), C]
|
|
@@ -2170,7 +2170,7 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2170
2170
|
/* STABLE */
|
|
2171
2171
|
}, 8, ["is-show"]),
|
|
2172
2172
|
Be,
|
|
2173
|
-
D(i(
|
|
2173
|
+
D(i(ea), {
|
|
2174
2174
|
arrow: !1,
|
|
2175
2175
|
"is-show": s.value,
|
|
2176
2176
|
boundary: "parent",
|
|
@@ -2182,26 +2182,26 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2182
2182
|
content: T(() => [
|
|
2183
2183
|
D(Da, {
|
|
2184
2184
|
format: i(f),
|
|
2185
|
-
"is-now":
|
|
2185
|
+
"is-now": x.value,
|
|
2186
2186
|
"min-date": l.value,
|
|
2187
|
-
"model-value":
|
|
2187
|
+
"model-value": u.value,
|
|
2188
2188
|
"onUpdate:isNow": m,
|
|
2189
|
-
"onUpdate:modelValue": v[4] || (v[4] = (b) =>
|
|
2189
|
+
"onUpdate:modelValue": v[4] || (v[4] = (b) => I(b.endOf("d"))),
|
|
2190
2190
|
key: "end"
|
|
2191
2191
|
}, null, 8, ["format", "is-now", "min-date", "model-value"])
|
|
2192
2192
|
]),
|
|
2193
2193
|
default: T(() => {
|
|
2194
2194
|
var b;
|
|
2195
2195
|
return [
|
|
2196
|
-
|
|
2196
|
+
na(d("input", {
|
|
2197
2197
|
placeholder: i(c)("结束时间"),
|
|
2198
|
-
value:
|
|
2198
|
+
value: x.value ? i(j) : (b = u.value) == null ? void 0 : b.format(i(f)),
|
|
2199
2199
|
onBlur: v[2] || (v[2] = (N) => E(N, "end")),
|
|
2200
2200
|
onClick: H,
|
|
2201
2201
|
onKeypress: v[3] || (v[3] = ga((N) => E(N, "end"), ["enter"])),
|
|
2202
2202
|
class: "date-picker-end",
|
|
2203
2203
|
ref_key: "endInput",
|
|
2204
|
-
ref:
|
|
2204
|
+
ref: o
|
|
2205
2205
|
}, null, 40, $e), [
|
|
2206
2206
|
[i(oa), P]
|
|
2207
2207
|
])
|
|
@@ -2210,24 +2210,24 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2210
2210
|
_: 1
|
|
2211
2211
|
/* STABLE */
|
|
2212
2212
|
}, 8, ["is-show"]),
|
|
2213
|
-
l.value ||
|
|
2213
|
+
l.value || u.value ? (p(), $(i(Za), {
|
|
2214
2214
|
key: 0,
|
|
2215
2215
|
onClick: S,
|
|
2216
2216
|
class: "date-picker-clear"
|
|
2217
|
-
})) :
|
|
2217
|
+
})) : ra("v-if", !0)
|
|
2218
2218
|
]),
|
|
2219
2219
|
D(pa, {
|
|
2220
|
-
disabled: !(l.value &&
|
|
2221
|
-
onSubmit:
|
|
2220
|
+
disabled: !(l.value && u.value),
|
|
2221
|
+
onSubmit: g
|
|
2222
2222
|
}, null, 8, ["disabled"])
|
|
2223
2223
|
]),
|
|
2224
2224
|
d("div", Re, [
|
|
2225
2225
|
U(
|
|
2226
|
-
|
|
2226
|
+
k(i(c)("支持多种时间格式自动转换")) + " ",
|
|
2227
2227
|
1
|
|
2228
2228
|
/* TEXT */
|
|
2229
2229
|
),
|
|
2230
|
-
D(i(
|
|
2230
|
+
D(i(ea), {
|
|
2231
2231
|
trigger: "click",
|
|
2232
2232
|
placement: "bottom",
|
|
2233
2233
|
theme: "light"
|
|
@@ -2237,7 +2237,7 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2237
2237
|
d(
|
|
2238
2238
|
"div",
|
|
2239
2239
|
Le,
|
|
2240
|
-
|
|
2240
|
+
k(i(c)("时间格式支持")),
|
|
2241
2241
|
1
|
|
2242
2242
|
/* TEXT */
|
|
2243
2243
|
),
|
|
@@ -2247,14 +2247,14 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2247
2247
|
d(
|
|
2248
2248
|
"th",
|
|
2249
2249
|
null,
|
|
2250
|
-
|
|
2250
|
+
k(i(c)("格式")),
|
|
2251
2251
|
1
|
|
2252
2252
|
/* TEXT */
|
|
2253
2253
|
),
|
|
2254
2254
|
d(
|
|
2255
2255
|
"th",
|
|
2256
2256
|
null,
|
|
2257
|
-
|
|
2257
|
+
k(i(c)("示例")),
|
|
2258
2258
|
1
|
|
2259
2259
|
/* TEXT */
|
|
2260
2260
|
)
|
|
@@ -2268,14 +2268,14 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2268
2268
|
d(
|
|
2269
2269
|
"td",
|
|
2270
2270
|
null,
|
|
2271
|
-
|
|
2271
|
+
k(b),
|
|
2272
2272
|
1
|
|
2273
2273
|
/* TEXT */
|
|
2274
2274
|
),
|
|
2275
2275
|
d(
|
|
2276
2276
|
"td",
|
|
2277
2277
|
null,
|
|
2278
|
-
|
|
2278
|
+
k(i(z).format(b)),
|
|
2279
2279
|
1
|
|
2280
2280
|
/* TEXT */
|
|
2281
2281
|
)
|
|
@@ -2295,7 +2295,7 @@ const Te = { class: "date-wrapper" }, Ve = { class: "date-input" }, je = { class
|
|
|
2295
2295
|
}, {
|
|
2296
2296
|
default: T(() => [
|
|
2297
2297
|
U(
|
|
2298
|
-
|
|
2298
|
+
k(i(c)("查看支持格式")),
|
|
2299
2299
|
1
|
|
2300
2300
|
/* TEXT */
|
|
2301
2301
|
)
|
|
@@ -2318,100 +2318,100 @@ const qe = { class: "natural-picker" }, Oe = ["onClick"], Fe = "__", Ge = /* @__
|
|
|
2318
2318
|
},
|
|
2319
2319
|
emits: ["change"],
|
|
2320
2320
|
setup(t, { emit: e }) {
|
|
2321
|
-
const a = e,
|
|
2322
|
-
|
|
2323
|
-
() =>
|
|
2321
|
+
const a = e, n = t, r = Y(), o = W(ma.slice()), _ = Y(ka[0].id), s = Y(""), l = Y(), u = Y(o.value[0]);
|
|
2322
|
+
la(
|
|
2323
|
+
() => n.value,
|
|
2324
2324
|
(w) => {
|
|
2325
|
-
if (!w || w.dateMode !==
|
|
2325
|
+
if (!w || w.dateMode !== y.NATURAL)
|
|
2326
2326
|
return;
|
|
2327
|
-
const [
|
|
2328
|
-
if (h.isDayjs(
|
|
2327
|
+
const [I, m] = w.dateValue;
|
|
2328
|
+
if (h.isDayjs(I) || h.isDayjs(m))
|
|
2329
2329
|
return;
|
|
2330
|
-
const { startNum: S, startUnit:
|
|
2331
|
-
|
|
2332
|
-
const C = ma.find((P) => P.id ===
|
|
2333
|
-
if (m !== j &&
|
|
2330
|
+
const { startNum: S, startUnit: g } = w;
|
|
2331
|
+
_.value = m === j ? sa.NOW : sa.ALL;
|
|
2332
|
+
const C = ma.find((P) => P.id === I && P.type === X.default);
|
|
2333
|
+
if (m !== j && I !== m && C || !C) {
|
|
2334
2334
|
const P = `${`${c("前")} ${S} ${c(
|
|
2335
|
-
Z[
|
|
2335
|
+
Z[g]
|
|
2336
2336
|
)}`}`;
|
|
2337
|
-
|
|
2338
|
-
id:
|
|
2337
|
+
o.value.unshift({
|
|
2338
|
+
id: I,
|
|
2339
2339
|
name: P,
|
|
2340
2340
|
type: X.custom
|
|
2341
|
-
}), [
|
|
2341
|
+
}), [u.value] = o.value;
|
|
2342
2342
|
return;
|
|
2343
2343
|
}
|
|
2344
|
-
C && (
|
|
2344
|
+
C && (u.value = C);
|
|
2345
2345
|
},
|
|
2346
2346
|
{
|
|
2347
2347
|
immediate: !0
|
|
2348
2348
|
}
|
|
2349
2349
|
);
|
|
2350
|
-
const
|
|
2351
|
-
const
|
|
2352
|
-
if (
|
|
2353
|
-
const [, m, S,
|
|
2354
|
-
return +m > 1 ? +m == 2 && S === "d" ? [
|
|
2350
|
+
const x = (w) => `${w.id}${Fe}${w.type}`, f = (w) => {
|
|
2351
|
+
const I = w.id;
|
|
2352
|
+
if (_.value === sa.ALL) {
|
|
2353
|
+
const [, m, S, g] = I.match(ha) || [];
|
|
2354
|
+
return +m > 1 ? +m == 2 && S === "d" ? [I, I] : [I, `now-1${S}/${g}`] : [I, I];
|
|
2355
2355
|
}
|
|
2356
|
-
return [
|
|
2356
|
+
return [I, j];
|
|
2357
2357
|
}, z = (w) => {
|
|
2358
|
-
var
|
|
2358
|
+
var I;
|
|
2359
2359
|
if (w.type === X.edit) {
|
|
2360
2360
|
l.value = "", s.value = w.id, setTimeout(() => {
|
|
2361
2361
|
var m, S;
|
|
2362
|
-
(S = (m =
|
|
2362
|
+
(S = (m = r.value) == null ? void 0 : m.inputRef) == null || S.focus();
|
|
2363
2363
|
}, 20);
|
|
2364
2364
|
return;
|
|
2365
2365
|
}
|
|
2366
|
-
|
|
2366
|
+
u.value = w, s.value = "", (I = r.value) == null || I.hidePopover();
|
|
2367
2367
|
}, E = (w) => {
|
|
2368
|
-
|
|
2369
|
-
}, V = (w,
|
|
2370
|
-
var
|
|
2368
|
+
_.value = w;
|
|
2369
|
+
}, V = (w, I) => {
|
|
2370
|
+
var g, C;
|
|
2371
2371
|
s.value = "";
|
|
2372
|
-
const m = `now-${+w}${
|
|
2372
|
+
const m = `now-${+w}${I.unit}/${I.unit}`, S = o.value.find((P) => P.id === m);
|
|
2373
2373
|
if (S) {
|
|
2374
|
-
|
|
2374
|
+
u.value = S, (g = r.value) == null || g.hidePopover();
|
|
2375
2375
|
return;
|
|
2376
2376
|
}
|
|
2377
|
-
|
|
2377
|
+
o.value.unshift({
|
|
2378
2378
|
id: m,
|
|
2379
|
-
name:
|
|
2379
|
+
name: I.name.replace("N", w.toString()),
|
|
2380
2380
|
type: X.custom
|
|
2381
|
-
}), [
|
|
2382
|
-
}, H = (w,
|
|
2381
|
+
}), [u.value] = o.value, (C = r.value) == null || C.hidePopover();
|
|
2382
|
+
}, H = (w, I) => {
|
|
2383
2383
|
const m = w.target.value;
|
|
2384
|
-
!m || !s.value || V(+m,
|
|
2385
|
-
}, q = (w,
|
|
2386
|
-
w.key !== "Enter" || !s.value || V(
|
|
2384
|
+
!m || !s.value || V(+m, I);
|
|
2385
|
+
}, q = (w, I, m) => {
|
|
2386
|
+
w.key !== "Enter" || !s.value || V(I, m);
|
|
2387
2387
|
}, L = () => {
|
|
2388
|
-
a("change", f(
|
|
2388
|
+
a("change", f(u.value));
|
|
2389
2389
|
};
|
|
2390
|
-
return (w,
|
|
2390
|
+
return (w, I) => (p(), M("div", qe, [
|
|
2391
2391
|
D(i(K), {
|
|
2392
2392
|
clearable: !1,
|
|
2393
2393
|
"input-search": !1,
|
|
2394
|
-
"model-value":
|
|
2394
|
+
"model-value": x(u.value),
|
|
2395
2395
|
"no-match-text": i(c)("无匹配数据"),
|
|
2396
2396
|
"popover-options": { boundary: "parent" },
|
|
2397
2397
|
prefix: i(c)("自然日期"),
|
|
2398
2398
|
"search-placeholder": i(c)("请输入"),
|
|
2399
2399
|
filterable: "",
|
|
2400
2400
|
ref_key: "naturalSelectRef",
|
|
2401
|
-
ref:
|
|
2401
|
+
ref: r
|
|
2402
2402
|
}, {
|
|
2403
2403
|
default: T(() => [
|
|
2404
2404
|
(p(!0), M(
|
|
2405
2405
|
B,
|
|
2406
2406
|
null,
|
|
2407
|
-
R(
|
|
2408
|
-
id:
|
|
2409
|
-
key:
|
|
2407
|
+
R(o.value, (m) => (p(), $(i(K).Option, {
|
|
2408
|
+
id: x(m),
|
|
2409
|
+
key: x(m),
|
|
2410
2410
|
name: m.name
|
|
2411
2411
|
}, {
|
|
2412
2412
|
default: T(() => [
|
|
2413
2413
|
d("div", {
|
|
2414
|
-
onClick:
|
|
2414
|
+
onClick: I[1] || (I[1] = Sa(() => {
|
|
2415
2415
|
}, ["prevent", "stop"])),
|
|
2416
2416
|
style: { width: "100%", padding: "0 12px", margin: "0 -12px" }
|
|
2417
2417
|
}, [
|
|
@@ -2424,17 +2424,17 @@ const qe = { class: "natural-picker" }, Oe = ["onClick"], Fe = "__", Ge = /* @__
|
|
|
2424
2424
|
"show-control": !1,
|
|
2425
2425
|
suffix: m.suffix,
|
|
2426
2426
|
onBlur: (S) => H(S, m),
|
|
2427
|
-
onKeypress: (S,
|
|
2427
|
+
onKeypress: (S, g) => q(g, S, m),
|
|
2428
2428
|
size: "small",
|
|
2429
2429
|
style: { width: "100%" },
|
|
2430
2430
|
type: "number",
|
|
2431
2431
|
modelValue: l.value,
|
|
2432
|
-
"onUpdate:modelValue":
|
|
2432
|
+
"onUpdate:modelValue": I[0] || (I[0] = (S) => l.value = S)
|
|
2433
2433
|
}, null, 8, ["placeholder", "prefix", "suffix", "onBlur", "onKeypress", "modelValue"])) : (p(), M("div", {
|
|
2434
2434
|
key: 1,
|
|
2435
2435
|
onClick: (S) => z(m),
|
|
2436
2436
|
style: { width: "100%" }
|
|
2437
|
-
},
|
|
2437
|
+
}, k(m.name), 9, Oe))
|
|
2438
2438
|
])
|
|
2439
2439
|
]),
|
|
2440
2440
|
_: 2
|
|
@@ -2449,7 +2449,7 @@ const qe = { class: "natural-picker" }, Oe = ["onClick"], Fe = "__", Ge = /* @__
|
|
|
2449
2449
|
}, 8, ["model-value", "no-match-text", "prefix", "search-placeholder"]),
|
|
2450
2450
|
D(i(K), {
|
|
2451
2451
|
clearable: !1,
|
|
2452
|
-
"model-value":
|
|
2452
|
+
"model-value": _.value,
|
|
2453
2453
|
"popover-options": { boundary: "parent" },
|
|
2454
2454
|
onChange: E,
|
|
2455
2455
|
class: "natural-unit"
|
|
@@ -2477,37 +2477,37 @@ const qe = { class: "natural-picker" }, Oe = ["onClick"], Fe = "__", Ge = /* @__
|
|
|
2477
2477
|
const Je = { class: "recent-picker" }, We = /* @__PURE__ */ F({
|
|
2478
2478
|
__name: "recent-picker",
|
|
2479
2479
|
props: {
|
|
2480
|
-
type: { default:
|
|
2480
|
+
type: { default: y.RECENT },
|
|
2481
2481
|
value: {}
|
|
2482
2482
|
},
|
|
2483
2483
|
emits: ["change"],
|
|
2484
2484
|
setup(t, { emit: e }) {
|
|
2485
|
-
const a = e,
|
|
2486
|
-
|
|
2487
|
-
() =>
|
|
2485
|
+
const a = e, n = t, r = Y("m"), o = Y();
|
|
2486
|
+
la(
|
|
2487
|
+
() => n.value,
|
|
2488
2488
|
(l) => {
|
|
2489
|
-
l &&
|
|
2489
|
+
l && n.type === l.dateMode && (r.value = l.recentOrFuturedateUnit, o.value = l.recentOrFuturedateNum || void 0);
|
|
2490
2490
|
},
|
|
2491
2491
|
{
|
|
2492
2492
|
immediate: !0
|
|
2493
2493
|
}
|
|
2494
2494
|
);
|
|
2495
|
-
const
|
|
2496
|
-
if (
|
|
2497
|
-
if (
|
|
2498
|
-
a("change", [j, `${
|
|
2495
|
+
const _ = G(() => !!o.value && !!r.value), s = () => {
|
|
2496
|
+
if (o.value) {
|
|
2497
|
+
if (n.type === y.FUTURE) {
|
|
2498
|
+
a("change", [j, `${y.FUTURE}${o.value}${r.value}`]);
|
|
2499
2499
|
return;
|
|
2500
2500
|
}
|
|
2501
|
-
a("change", [`${
|
|
2501
|
+
a("change", [`${y.RECENT}${o.value}${r.value}`, j]);
|
|
2502
2502
|
}
|
|
2503
2503
|
};
|
|
2504
|
-
return (l,
|
|
2504
|
+
return (l, u) => (p(), M("div", Je, [
|
|
2505
2505
|
D(i(Ta), {
|
|
2506
2506
|
placeholder: i(c)("请输入"),
|
|
2507
2507
|
prefix: l.type === "now-" ? i(c)("最近") : i(c)("将来"),
|
|
2508
2508
|
type: "number",
|
|
2509
|
-
modelValue:
|
|
2510
|
-
"onUpdate:modelValue":
|
|
2509
|
+
modelValue: o.value,
|
|
2510
|
+
"onUpdate:modelValue": u[1] || (u[1] = (x) => o.value = x)
|
|
2511
2511
|
}, {
|
|
2512
2512
|
suffix: T(() => [
|
|
2513
2513
|
D(i(K), {
|
|
@@ -2515,17 +2515,17 @@ const Je = { class: "recent-picker" }, We = /* @__PURE__ */ F({
|
|
|
2515
2515
|
"popover-options": { boundary: "parent" },
|
|
2516
2516
|
class: "recent-unit",
|
|
2517
2517
|
filterable: "",
|
|
2518
|
-
modelValue:
|
|
2519
|
-
"onUpdate:modelValue":
|
|
2518
|
+
modelValue: r.value,
|
|
2519
|
+
"onUpdate:modelValue": u[0] || (u[0] = (x) => r.value = x)
|
|
2520
2520
|
}, {
|
|
2521
2521
|
default: T(() => [
|
|
2522
2522
|
(p(!0), M(
|
|
2523
2523
|
B,
|
|
2524
2524
|
null,
|
|
2525
|
-
R(i(Va), (
|
|
2526
|
-
id:
|
|
2527
|
-
key:
|
|
2528
|
-
name:
|
|
2525
|
+
R(i(Va), (x) => (p(), $(i(K).Option, {
|
|
2526
|
+
id: x.id,
|
|
2527
|
+
key: x.id,
|
|
2528
|
+
name: x.name
|
|
2529
2529
|
}, null, 8, ["id", "name"]))),
|
|
2530
2530
|
128
|
|
2531
2531
|
/* KEYED_FRAGMENT */
|
|
@@ -2539,7 +2539,7 @@ const Je = { class: "recent-picker" }, We = /* @__PURE__ */ F({
|
|
|
2539
2539
|
/* STABLE */
|
|
2540
2540
|
}, 8, ["placeholder", "prefix", "modelValue"]),
|
|
2541
2541
|
D(pa, {
|
|
2542
|
-
disabled: !
|
|
2542
|
+
disabled: !_.value,
|
|
2543
2543
|
onSubmit: s
|
|
2544
2544
|
}, null, 8, ["disabled"])
|
|
2545
2545
|
]));
|
|
@@ -2552,17 +2552,17 @@ const Ze = { class: "option-name" }, Qe = { class: "option-country" }, Xe = { cl
|
|
|
2552
2552
|
},
|
|
2553
2553
|
emits: ["change"],
|
|
2554
2554
|
setup(t, { emit: e }) {
|
|
2555
|
-
const a = e,
|
|
2556
|
-
const
|
|
2557
|
-
a("change",
|
|
2555
|
+
const a = e, n = W(Ya), r = (o) => {
|
|
2556
|
+
const _ = Ba(o);
|
|
2557
|
+
a("change", o, _);
|
|
2558
2558
|
};
|
|
2559
|
-
return (
|
|
2559
|
+
return (o, _) => (p(), $(i(K), {
|
|
2560
2560
|
clearable: !1,
|
|
2561
|
-
"model-value":
|
|
2561
|
+
"model-value": o.value,
|
|
2562
2562
|
"no-match-text": i(c)("无匹配数据"),
|
|
2563
2563
|
placeholder: i(c)("请输入搜索(国家,城市,简称)"),
|
|
2564
2564
|
"popover-options": { "ext-cls": "__bk-date-picker-popover__" },
|
|
2565
|
-
onChange:
|
|
2565
|
+
onChange: r,
|
|
2566
2566
|
class: "timezone-picker",
|
|
2567
2567
|
filterable: "",
|
|
2568
2568
|
"input-search": ""
|
|
@@ -2571,7 +2571,7 @@ const Ze = { class: "option-name" }, Qe = { class: "option-country" }, Xe = { cl
|
|
|
2571
2571
|
(p(!0), M(
|
|
2572
2572
|
B,
|
|
2573
2573
|
null,
|
|
2574
|
-
R(
|
|
2574
|
+
R(n.value, (s) => (p(), M(
|
|
2575
2575
|
B,
|
|
2576
2576
|
null,
|
|
2577
2577
|
[
|
|
@@ -2587,30 +2587,30 @@ const Ze = { class: "option-name" }, Qe = { class: "option-country" }, Xe = { cl
|
|
|
2587
2587
|
d(
|
|
2588
2588
|
"div",
|
|
2589
2589
|
{
|
|
2590
|
-
class:
|
|
2590
|
+
class: ia({
|
|
2591
2591
|
"timezone-picker-option": !0,
|
|
2592
|
-
"is-selected": l.label ===
|
|
2592
|
+
"is-selected": l.label === o.value
|
|
2593
2593
|
})
|
|
2594
2594
|
},
|
|
2595
2595
|
[
|
|
2596
2596
|
d(
|
|
2597
2597
|
"span",
|
|
2598
2598
|
Ze,
|
|
2599
|
-
|
|
2599
|
+
k(i(c)("浏览器时间")) + " " + k(l.label),
|
|
2600
2600
|
1
|
|
2601
2601
|
/* TEXT */
|
|
2602
2602
|
),
|
|
2603
2603
|
d(
|
|
2604
2604
|
"span",
|
|
2605
2605
|
Qe,
|
|
2606
|
-
|
|
2606
|
+
k(l.country) + ", " + k(l.abbreviation),
|
|
2607
2607
|
1
|
|
2608
2608
|
/* TEXT */
|
|
2609
2609
|
),
|
|
2610
2610
|
d(
|
|
2611
2611
|
"span",
|
|
2612
2612
|
Xe,
|
|
2613
|
-
|
|
2613
|
+
k(l.utc),
|
|
2614
2614
|
1
|
|
2615
2615
|
/* TEXT */
|
|
2616
2616
|
)
|
|
@@ -2645,30 +2645,30 @@ const Ze = { class: "option-name" }, Qe = { class: "option-country" }, Xe = { cl
|
|
|
2645
2645
|
d(
|
|
2646
2646
|
"div",
|
|
2647
2647
|
{
|
|
2648
|
-
class:
|
|
2648
|
+
class: ia({
|
|
2649
2649
|
"timezone-picker-option": !0,
|
|
2650
|
-
"is-selected": l.label ===
|
|
2650
|
+
"is-selected": l.label === o.value
|
|
2651
2651
|
})
|
|
2652
2652
|
},
|
|
2653
2653
|
[
|
|
2654
2654
|
d(
|
|
2655
2655
|
"span",
|
|
2656
2656
|
at,
|
|
2657
|
-
|
|
2657
|
+
k(l.label),
|
|
2658
2658
|
1
|
|
2659
2659
|
/* TEXT */
|
|
2660
2660
|
),
|
|
2661
2661
|
d(
|
|
2662
2662
|
"span",
|
|
2663
2663
|
et,
|
|
2664
|
-
|
|
2664
|
+
k(l.country) + ", " + k(l.abbreviation),
|
|
2665
2665
|
1
|
|
2666
2666
|
/* TEXT */
|
|
2667
2667
|
),
|
|
2668
2668
|
d(
|
|
2669
2669
|
"span",
|
|
2670
2670
|
tt,
|
|
2671
|
-
|
|
2671
|
+
k(l.utc),
|
|
2672
2672
|
1
|
|
2673
2673
|
/* TEXT */
|
|
2674
2674
|
)
|
|
@@ -2686,7 +2686,7 @@ const Ze = { class: "option-name" }, Qe = { class: "option-country" }, Xe = { cl
|
|
|
2686
2686
|
]),
|
|
2687
2687
|
_: 2
|
|
2688
2688
|
/* DYNAMIC */
|
|
2689
|
-
}, 1032, ["label"])) :
|
|
2689
|
+
}, 1032, ["label"])) : ra("v-if", !0)
|
|
2690
2690
|
],
|
|
2691
2691
|
64
|
|
2692
2692
|
/* STABLE_FRAGMENT */
|
|
@@ -2716,23 +2716,23 @@ const nt = { class: "panel-wrapper" }, rt = { class: "common-date-list" }, lt =
|
|
|
2716
2716
|
},
|
|
2717
2717
|
emits: ["change", "update:timezone"],
|
|
2718
2718
|
setup(t, { emit: e }) {
|
|
2719
|
-
const a = t, { format:
|
|
2720
|
-
const m = localStorage.getItem(_a(
|
|
2721
|
-
return m ? Object.values(
|
|
2722
|
-
}), f = Y(
|
|
2723
|
-
() => (
|
|
2724
|
-
(m) => new
|
|
2719
|
+
const a = t, { format: n, storeKey: r, timezoneInfo: o, version: _ } = Na(), s = e, l = Y(!1), u = Y("common"), x = G(() => {
|
|
2720
|
+
const m = localStorage.getItem(_a(_.value));
|
|
2721
|
+
return m ? Object.values(y).includes(m) ? m : null : y.Date;
|
|
2722
|
+
}), f = Y(x.value || a.defaultDate.dateMode), z = h.tz.guess(), E = G(() => ge(r.value)), V = G(
|
|
2723
|
+
() => (u.value === "common" ? me : E.value).map(
|
|
2724
|
+
(m) => new aa(m, n.value, a.timezone)
|
|
2725
2725
|
)
|
|
2726
2726
|
), H = (m) => {
|
|
2727
2727
|
s("change", m);
|
|
2728
2728
|
}, q = () => {
|
|
2729
2729
|
switch (f.value) {
|
|
2730
|
-
case
|
|
2731
|
-
case
|
|
2730
|
+
case y.RECENT:
|
|
2731
|
+
case y.FUTURE:
|
|
2732
2732
|
return We;
|
|
2733
|
-
case
|
|
2733
|
+
case y.NATURAL:
|
|
2734
2734
|
return Ge;
|
|
2735
|
-
case
|
|
2735
|
+
case y.Date:
|
|
2736
2736
|
default:
|
|
2737
2737
|
return Ke;
|
|
2738
2738
|
}
|
|
@@ -2740,38 +2740,38 @@ const nt = { class: "panel-wrapper" }, rt = { class: "common-date-list" }, lt =
|
|
|
2740
2740
|
l.value = !l.value;
|
|
2741
2741
|
}, w = (m, S) => {
|
|
2742
2742
|
s("update:timezone", m, S);
|
|
2743
|
-
},
|
|
2744
|
-
f.value = m, localStorage.setItem(_a(
|
|
2743
|
+
}, I = (m) => {
|
|
2744
|
+
f.value = m, localStorage.setItem(_a(_.value), m);
|
|
2745
2745
|
};
|
|
2746
2746
|
return (m, S) => (p(), M("div", nt, [
|
|
2747
2747
|
D(ya, {
|
|
2748
2748
|
panels: i(re),
|
|
2749
|
-
modelValue:
|
|
2750
|
-
"onUpdate:modelValue": S[0] || (S[0] = (
|
|
2749
|
+
modelValue: u.value,
|
|
2750
|
+
"onUpdate:modelValue": S[0] || (S[0] = (g) => u.value = g)
|
|
2751
2751
|
}, null, 8, ["panels", "modelValue"]),
|
|
2752
2752
|
d("div", null, [
|
|
2753
2753
|
d("ul", rt, [
|
|
2754
2754
|
(p(!0), M(
|
|
2755
2755
|
B,
|
|
2756
2756
|
null,
|
|
2757
|
-
R(V.value, (
|
|
2757
|
+
R(V.value, (g, C) => {
|
|
2758
2758
|
var P, A, v, b, N;
|
|
2759
2759
|
return p(), M("li", {
|
|
2760
|
-
class:
|
|
2760
|
+
class: ia({
|
|
2761
2761
|
"list-item": !0,
|
|
2762
|
-
"is-recent-item":
|
|
2763
|
-
"is-selected": ((A = (P =
|
|
2762
|
+
"is-recent-item": u.value === "recent",
|
|
2763
|
+
"is-selected": ((A = (P = g.dateValue) == null ? void 0 : P.join) == null ? void 0 : A.call(P, "~")) === ((N = (b = (v = a.defaultDate) == null ? void 0 : v.dateValue) == null ? void 0 : b.join) == null ? void 0 : N.call(b, "~"))
|
|
2764
2764
|
}),
|
|
2765
2765
|
key: C,
|
|
2766
|
-
onClick: (O) => H(
|
|
2767
|
-
},
|
|
2766
|
+
onClick: (O) => H(g.dateValue)
|
|
2767
|
+
}, k(g.toDisplayString()), 11, lt);
|
|
2768
2768
|
}),
|
|
2769
2769
|
128
|
|
2770
2770
|
/* KEYED_FRAGMENT */
|
|
2771
2771
|
))
|
|
2772
2772
|
])
|
|
2773
2773
|
]),
|
|
2774
|
-
|
|
2774
|
+
na(d(
|
|
2775
2775
|
"div",
|
|
2776
2776
|
ct,
|
|
2777
2777
|
[
|
|
@@ -2783,7 +2783,7 @@ const nt = { class: "panel-wrapper" }, rt = { class: "common-date-list" }, lt =
|
|
|
2783
2783
|
d(
|
|
2784
2784
|
"div",
|
|
2785
2785
|
st,
|
|
2786
|
-
|
|
2786
|
+
k(i(c)("暂无最近使用记录")),
|
|
2787
2787
|
1
|
|
2788
2788
|
/* TEXT */
|
|
2789
2789
|
)
|
|
@@ -2796,7 +2796,7 @@ const nt = { class: "panel-wrapper" }, rt = { class: "common-date-list" }, lt =
|
|
|
2796
2796
|
D(ya, {
|
|
2797
2797
|
"model-value": f.value,
|
|
2798
2798
|
panels: i(le),
|
|
2799
|
-
"onUpdate:modelValue":
|
|
2799
|
+
"onUpdate:modelValue": I,
|
|
2800
2800
|
class: "date-pick-tab"
|
|
2801
2801
|
}, null, 8, ["model-value", "panels"]),
|
|
2802
2802
|
(p(), $(
|
|
@@ -2815,20 +2815,20 @@ const nt = { class: "panel-wrapper" }, rt = { class: "common-date-list" }, lt =
|
|
|
2815
2815
|
)),
|
|
2816
2816
|
m.needTimezone ? (p(), M("div", ut, [
|
|
2817
2817
|
U(
|
|
2818
|
-
|
|
2818
|
+
k(i(o).label === i(z) ? i(c)("浏览器时间") : "") + " ",
|
|
2819
2819
|
1
|
|
2820
2820
|
/* TEXT */
|
|
2821
2821
|
),
|
|
2822
2822
|
d("span", ot, [
|
|
2823
2823
|
U(
|
|
2824
|
-
|
|
2824
|
+
k(i(o).label) + " ",
|
|
2825
2825
|
1
|
|
2826
2826
|
/* TEXT */
|
|
2827
2827
|
),
|
|
2828
2828
|
d(
|
|
2829
2829
|
"span",
|
|
2830
2830
|
dt,
|
|
2831
|
-
|
|
2831
|
+
k(i(o).country) + ", " + k(i(o).abbreviation),
|
|
2832
2832
|
1
|
|
2833
2833
|
/* TEXT */
|
|
2834
2834
|
)
|
|
@@ -2836,7 +2836,7 @@ const nt = { class: "panel-wrapper" }, rt = { class: "common-date-list" }, lt =
|
|
|
2836
2836
|
d(
|
|
2837
2837
|
"span",
|
|
2838
2838
|
mt,
|
|
2839
|
-
|
|
2839
|
+
k(i(o).utc),
|
|
2840
2840
|
1
|
|
2841
2841
|
/* TEXT */
|
|
2842
2842
|
),
|
|
@@ -2848,7 +2848,7 @@ const nt = { class: "panel-wrapper" }, rt = { class: "common-date-list" }, lt =
|
|
|
2848
2848
|
}, {
|
|
2849
2849
|
default: T(() => [
|
|
2850
2850
|
U(
|
|
2851
|
-
|
|
2851
|
+
k(i(c)("时区设置")),
|
|
2852
2852
|
1
|
|
2853
2853
|
/* TEXT */
|
|
2854
2854
|
)
|
|
@@ -2856,8 +2856,8 @@ const nt = { class: "panel-wrapper" }, rt = { class: "common-date-list" }, lt =
|
|
|
2856
2856
|
_: 1
|
|
2857
2857
|
/* STABLE */
|
|
2858
2858
|
})
|
|
2859
|
-
])) :
|
|
2860
|
-
|
|
2859
|
+
])) : ra("v-if", !0),
|
|
2860
|
+
na(d(
|
|
2861
2861
|
"div",
|
|
2862
2862
|
ht,
|
|
2863
2863
|
[
|
|
@@ -2915,18 +2915,26 @@ const bt = /* @__PURE__ */ d(
|
|
|
2915
2915
|
emits: ["update:modelValue", "update:timezone"],
|
|
2916
2916
|
setup(t, { expose: e, emit: a }) {
|
|
2917
2917
|
h.locale({
|
|
2918
|
-
...
|
|
2918
|
+
...ua === "en" ? Qa : Xa,
|
|
2919
2919
|
weekStart: 1
|
|
2920
2920
|
}), Ga({
|
|
2921
2921
|
prefix: "bk"
|
|
2922
2922
|
});
|
|
2923
|
-
const
|
|
2924
|
-
|
|
2923
|
+
const n = t, r = a, o = Y(), _ = Y(), s = G(() => n.format), l = G(() => Ba(n.timezone || h.tz.guess())), u = W(new aa(n.modelValue, n.format, n.timezone)), x = G(() => ue(n.version)), f = Y(!1), z = Y(!1);
|
|
2924
|
+
la(
|
|
2925
|
+
() => n.modelValue,
|
|
2926
|
+
(g) => {
|
|
2927
|
+
(u == null ? void 0 : u.value.dateValue.join("~")) !== (g == null ? void 0 : g.join("~")) && (u.value = new aa(g, s.value, n.timezone));
|
|
2928
|
+
},
|
|
2929
|
+
{
|
|
2930
|
+
immediate: !0
|
|
2931
|
+
}
|
|
2932
|
+
), he({
|
|
2925
2933
|
format: s,
|
|
2926
|
-
storeKey:
|
|
2934
|
+
storeKey: x,
|
|
2927
2935
|
t: c,
|
|
2928
2936
|
timezoneInfo: l,
|
|
2929
|
-
version: G(() =>
|
|
2937
|
+
version: G(() => n.version)
|
|
2930
2938
|
}), Oa(() => {
|
|
2931
2939
|
z.value = !1, f.value = !1;
|
|
2932
2940
|
});
|
|
@@ -2936,31 +2944,31 @@ const bt = /* @__PURE__ */ d(
|
|
|
2936
2944
|
setTimeout(() => {
|
|
2937
2945
|
z.value = !1;
|
|
2938
2946
|
}, 100);
|
|
2939
|
-
}, H = (
|
|
2947
|
+
}, H = (g) => {
|
|
2940
2948
|
f.value = !1;
|
|
2941
|
-
const [C, P] =
|
|
2949
|
+
const [C, P] = g, [A, v] = n.modelValue || [];
|
|
2942
2950
|
if (C && P && C === A && P === v)
|
|
2943
2951
|
return;
|
|
2944
|
-
|
|
2945
|
-
const b =
|
|
2946
|
-
|
|
2947
|
-
}, q = (
|
|
2948
|
-
|
|
2952
|
+
u.value = new aa(g, s.value, n.timezone);
|
|
2953
|
+
const b = u.value.toEmitValue();
|
|
2954
|
+
r("update:modelValue", ...b), u.value.isValidate && xe(g, x.value);
|
|
2955
|
+
}, q = (g, C) => {
|
|
2956
|
+
u.value = new aa(n.modelValue, s.value, g), r("update:timezone", g, { ...C });
|
|
2949
2957
|
}, L = () => {
|
|
2950
2958
|
f.value = !1;
|
|
2951
|
-
}, w = (
|
|
2959
|
+
}, w = (g) => {
|
|
2952
2960
|
var b;
|
|
2953
|
-
if (((b =
|
|
2961
|
+
if (((b = u.value.dateValue) == null ? void 0 : b.length) < 2)
|
|
2954
2962
|
return;
|
|
2955
|
-
const { endDate: C, startDate: P } =
|
|
2963
|
+
const { endDate: C, startDate: P } = u.value, A = u.value.dateDuration(), v = g === "left" ? [P.subtract(A).format(s.value), C.subtract(A).format(s.value)] : [P.add(A).format(s.value), C.add(A).format(s.value)];
|
|
2956
2964
|
H(v);
|
|
2957
|
-
},
|
|
2965
|
+
}, I = () => {
|
|
2958
2966
|
w("left");
|
|
2959
2967
|
}, m = () => {
|
|
2960
2968
|
w("right");
|
|
2961
|
-
}, S = (
|
|
2969
|
+
}, S = (g) => {
|
|
2962
2970
|
f.value && (Array.from(document.querySelectorAll(".__bk-date-picker-popover__")).some(
|
|
2963
|
-
(C) => C.contains(
|
|
2971
|
+
(C) => C.contains(g.target)
|
|
2964
2972
|
) || L());
|
|
2965
2973
|
};
|
|
2966
2974
|
return e({
|
|
@@ -2970,23 +2978,23 @@ const bt = /* @__PURE__ */ d(
|
|
|
2970
2978
|
handleShowPanel: () => {
|
|
2971
2979
|
f.value = !0;
|
|
2972
2980
|
}
|
|
2973
|
-
}), (
|
|
2981
|
+
}), (g, C) => (p(), M(
|
|
2974
2982
|
"div",
|
|
2975
2983
|
{
|
|
2976
|
-
class:
|
|
2984
|
+
class: ia({
|
|
2977
2985
|
__bk_date_picker__: !0,
|
|
2978
|
-
"is-simplicity":
|
|
2979
|
-
"is-disabled":
|
|
2986
|
+
"is-simplicity": g.behavior === "simplicity",
|
|
2987
|
+
"is-disabled": g.disabled
|
|
2980
2988
|
})
|
|
2981
2989
|
},
|
|
2982
2990
|
[
|
|
2983
2991
|
d("span", {
|
|
2984
|
-
onClick:
|
|
2992
|
+
onClick: I,
|
|
2985
2993
|
class: "date-icon"
|
|
2986
2994
|
}, [
|
|
2987
2995
|
D(i(Pa), { class: "date-icon-left" })
|
|
2988
2996
|
]),
|
|
2989
|
-
D(i(
|
|
2997
|
+
D(i(ea), {
|
|
2990
2998
|
arrow: !1,
|
|
2991
2999
|
"is-show": f.value,
|
|
2992
3000
|
offset: { mainAxis: 10, crossAxis: 10, alignmentAxis: -32 },
|
|
@@ -2998,9 +3006,9 @@ const bt = /* @__PURE__ */ d(
|
|
|
2998
3006
|
}, {
|
|
2999
3007
|
content: T(() => [
|
|
3000
3008
|
D(vt, {
|
|
3001
|
-
"default-date":
|
|
3002
|
-
"need-timezone":
|
|
3003
|
-
timezone:
|
|
3009
|
+
"default-date": u.value,
|
|
3010
|
+
"need-timezone": g.needTimezone,
|
|
3011
|
+
timezone: g.timezone,
|
|
3004
3012
|
onChange: H,
|
|
3005
3013
|
"onUpdate:timezone": q
|
|
3006
3014
|
}, null, 8, ["default-date", "need-timezone", "timezone"])
|
|
@@ -3008,7 +3016,7 @@ const bt = /* @__PURE__ */ d(
|
|
|
3008
3016
|
default: T(() => {
|
|
3009
3017
|
var P;
|
|
3010
3018
|
return [
|
|
3011
|
-
|
|
3019
|
+
na((p(), M(
|
|
3012
3020
|
"span",
|
|
3013
3021
|
{
|
|
3014
3022
|
onClick: C[0] || (C[0] = (A) => f.value = !f.value),
|
|
@@ -3016,24 +3024,24 @@ const bt = /* @__PURE__ */ d(
|
|
|
3016
3024
|
onMouseleave: V,
|
|
3017
3025
|
class: "date-content",
|
|
3018
3026
|
ref_key: "dateContentRef",
|
|
3019
|
-
ref:
|
|
3027
|
+
ref: _
|
|
3020
3028
|
},
|
|
3021
3029
|
[
|
|
3022
3030
|
bt,
|
|
3023
3031
|
d(
|
|
3024
3032
|
"span",
|
|
3025
3033
|
null,
|
|
3026
|
-
|
|
3034
|
+
k(u.value.toDisplayString()),
|
|
3027
3035
|
1
|
|
3028
3036
|
/* TEXT */
|
|
3029
3037
|
),
|
|
3030
|
-
|
|
3038
|
+
g.needTimezone && l.value.label !== i(h).tz.guess() ? (p(), M(
|
|
3031
3039
|
"span",
|
|
3032
3040
|
pt,
|
|
3033
|
-
|
|
3041
|
+
k(l.value.abbreviation || ((P = l.value.utc) == null ? void 0 : P.replace("UTC", "").replace(":00", ""))),
|
|
3034
3042
|
1
|
|
3035
3043
|
/* TEXT */
|
|
3036
|
-
)) :
|
|
3044
|
+
)) : ra("v-if", !0)
|
|
3037
3045
|
],
|
|
3038
3046
|
32
|
|
3039
3047
|
/* HYDRATE_EVENTS */
|
|
@@ -3051,10 +3059,10 @@ const bt = /* @__PURE__ */ d(
|
|
|
3051
3059
|
}, [
|
|
3052
3060
|
D(i(Ca), { class: "date-icon-right" })
|
|
3053
3061
|
]),
|
|
3054
|
-
D(i(
|
|
3062
|
+
D(i(ea), {
|
|
3055
3063
|
"is-show": z.value,
|
|
3056
3064
|
offset: 12,
|
|
3057
|
-
target:
|
|
3065
|
+
target: _.value,
|
|
3058
3066
|
placement: "top",
|
|
3059
3067
|
trigger: "manual"
|
|
3060
3068
|
}, {
|
|
@@ -3064,16 +3072,16 @@ const bt = /* @__PURE__ */ d(
|
|
|
3064
3072
|
d(
|
|
3065
3073
|
"div",
|
|
3066
3074
|
{
|
|
3067
|
-
style: Fa({ maxWidth: i(
|
|
3075
|
+
style: Fa({ maxWidth: i(ua) === "en" ? "180px" : "156px" }),
|
|
3068
3076
|
class: "__date-tooltips__",
|
|
3069
3077
|
ref_key: "dateTooltipsRef",
|
|
3070
|
-
ref:
|
|
3078
|
+
ref: o
|
|
3071
3079
|
},
|
|
3072
3080
|
[
|
|
3073
3081
|
d(
|
|
3074
3082
|
"div",
|
|
3075
3083
|
null,
|
|
3076
|
-
|
|
3084
|
+
k((A = (P = u.value) == null ? void 0 : P.startDate) == null ? void 0 : A.format(s.value)),
|
|
3077
3085
|
1
|
|
3078
3086
|
/* TEXT */
|
|
3079
3087
|
),
|
|
@@ -3081,14 +3089,14 @@ const bt = /* @__PURE__ */ d(
|
|
|
3081
3089
|
d(
|
|
3082
3090
|
"div",
|
|
3083
3091
|
null,
|
|
3084
|
-
|
|
3092
|
+
k((b = (v = u.value) == null ? void 0 : v.endDate) == null ? void 0 : b.format(s.value)),
|
|
3085
3093
|
1
|
|
3086
3094
|
/* TEXT */
|
|
3087
3095
|
),
|
|
3088
3096
|
d(
|
|
3089
3097
|
"div",
|
|
3090
3098
|
ft,
|
|
3091
|
-
|
|
3099
|
+
k(l.value.label === i(h).tz.guess() ? `${i(c)("浏览器时间")} (${l.value.label})` : l.value.label),
|
|
3092
3100
|
1
|
|
3093
3101
|
/* TEXT */
|
|
3094
3102
|
)
|
|
@@ -3113,8 +3121,8 @@ h.extend(za);
|
|
|
3113
3121
|
h.extend(Ea);
|
|
3114
3122
|
export {
|
|
3115
3123
|
Ot as DatePicker,
|
|
3116
|
-
|
|
3117
|
-
|
|
3124
|
+
aa as DateRange,
|
|
3125
|
+
ta as commonDateRegexp,
|
|
3118
3126
|
Jt as dayjs,
|
|
3119
3127
|
Ot as default,
|
|
3120
3128
|
Ae as futureDateRegexp,
|