vft 0.0.506 → 0.0.509

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/cascader/cascader.vue2.js +203 -202
  3. package/es/components/cascader-panel/menu.vue2.js +50 -49
  4. package/es/components/clamp-toggle/clamp-toggle.vue2.js +21 -17
  5. package/es/components/color-picker/color-picker.vue2.js +134 -133
  6. package/es/components/config-provider/config-provider.vue.d.ts +2 -0
  7. package/es/components/config-provider/config-provider.vue2.js +5 -4
  8. package/es/components/config-provider/constants.d.ts +1 -0
  9. package/es/components/config-provider/constants.js +3 -2
  10. package/es/components/config-provider/hooks/use-global-config.js +33 -30
  11. package/es/components/config-provider/index.d.ts +9 -0
  12. package/es/components/config-provider/index.js +6 -5
  13. package/es/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
  14. package/es/components/date-picker/composables/use-basic-date-table.js +124 -123
  15. package/es/components/date-picker/composables/use-month-range-header.js +15 -14
  16. package/es/components/date-picker/composables/use-panel-date-range.js +24 -23
  17. package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +39 -38
  18. package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +39 -38
  19. package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +179 -178
  20. package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +225 -224
  21. package/es/components/date-time-select/date-time-select.vue2.js +39 -36
  22. package/es/components/dropdown/dropdown.vue2.js +68 -67
  23. package/es/components/empty/empty.vue2.js +39 -38
  24. package/es/components/full-screen/full-screen.vue2.js +18 -17
  25. package/es/components/image/image.vue2.js +60 -59
  26. package/es/components/image-viewer/image-viewer.vue2.js +45 -44
  27. package/es/components/index.js +161 -160
  28. package/es/components/input/index.d.ts +5 -0
  29. package/es/components/input/input.vue.d.ts +2 -0
  30. package/es/components/input/input.vue2.js +42 -41
  31. package/es/components/md-container/md-container.vue2.js +75 -74
  32. package/es/components/md-container/toc.js +37 -36
  33. package/es/components/modal/modal-footer-action.vue2.js +25 -24
  34. package/es/components/multiple-tabs/multiple-tabs.vue2.js +16 -15
  35. package/es/components/multiple-tabs/use/use-tab-dropdown.js +54 -53
  36. package/es/components/pagination/components/jumper.vue2.js +29 -28
  37. package/es/components/pagination/components/sizes.vue2.js +21 -20
  38. package/es/components/pagination/components/total.vue2.js +11 -10
  39. package/es/components/popconfirm/popconfirm.vue2.js +40 -39
  40. package/es/components/search/search.vue2.js +79 -77
  41. package/es/components/select/useSelect.js +232 -231
  42. package/es/components/super-form/super-form-action.vue2.js +41 -40
  43. package/es/components/super-form/super-form-item.vue2.js +206 -203
  44. package/es/components/super-form/use/helper.d.ts +1 -1
  45. package/es/components/super-form/use/helper.js +62 -62
  46. package/es/components/table/field.js +130 -110
  47. package/es/components/table/table.vue2.js +152 -150
  48. package/es/components/table/use/use-columns.js +29 -26
  49. package/es/components/table/use/use-data-source.js +87 -86
  50. package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +66 -65
  51. package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +134 -133
  52. package/es/components/transfer/transfer-panel.vue2.js +57 -56
  53. package/es/components/transfer/transfer.vue2.js +70 -69
  54. package/es/components/tree/tree.vue2.js +60 -59
  55. package/es/components/upload/index.d.ts +3 -3
  56. package/es/components/upload/upload-content.vue.d.ts +2 -2
  57. package/es/components/upload/upload-content.vue2.js +78 -75
  58. package/es/components/upload/upload-list.vue2.js +46 -45
  59. package/es/components/upload/upload.vue.d.ts +2 -2
  60. package/es/components/upload/upload.vue2.js +87 -85
  61. package/es/components/upload/utils.js +29 -29
  62. package/es/constants/date.d.ts +1 -1
  63. package/es/constants/date.js +9 -1
  64. package/es/hooks/use-z-index/index.js +3 -3
  65. package/es/index.d.ts +1 -0
  66. package/es/index.js +5 -1
  67. package/es/locale/index.d.js +1 -0
  68. package/es/locale/index.d.ts +26 -0
  69. package/es/locale/index.js +10 -0
  70. package/es/locale/lang/en.d.ts +183 -0
  71. package/es/locale/lang/en.js +241 -0
  72. package/es/locale/lang/zh-cn.d.ts +183 -0
  73. package/es/locale/lang/zh-cn.js +241 -0
  74. package/es/locale/lang/zh-tw.d.ts +183 -0
  75. package/es/locale/lang/zh-tw.js +241 -0
  76. package/es/locale/use-locale.d.ts +17 -0
  77. package/es/locale/use-locale.js +56 -0
  78. package/es/package.json.d.ts +1 -1
  79. package/es/package.json.js +1 -1
  80. package/lib/components/cascader/cascader.vue2.cjs +1 -1
  81. package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
  82. package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
  83. package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
  84. package/lib/components/config-provider/config-provider.vue.d.ts +2 -0
  85. package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
  86. package/lib/components/config-provider/constants.cjs +1 -1
  87. package/lib/components/config-provider/constants.d.ts +1 -0
  88. package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
  89. package/lib/components/config-provider/index.cjs +1 -1
  90. package/lib/components/config-provider/index.d.ts +9 -0
  91. package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
  92. package/lib/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
  93. package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
  94. package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
  95. package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
  96. package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
  97. package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
  98. package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
  99. package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
  100. package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
  101. package/lib/components/empty/empty.vue2.cjs +1 -1
  102. package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
  103. package/lib/components/image/image.vue2.cjs +1 -1
  104. package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
  105. package/lib/components/index.cjs +1 -1
  106. package/lib/components/input/index.d.ts +5 -0
  107. package/lib/components/input/input.vue.d.ts +2 -0
  108. package/lib/components/input/input.vue2.cjs +1 -1
  109. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  110. package/lib/components/md-container/toc.cjs +1 -1
  111. package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
  112. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  113. package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
  114. package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
  115. package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
  116. package/lib/components/pagination/components/total.vue2.cjs +1 -1
  117. package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
  118. package/lib/components/search/search.vue2.cjs +1 -1
  119. package/lib/components/select/useSelect.cjs +1 -1
  120. package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
  121. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  122. package/lib/components/super-form/use/helper.cjs +1 -1
  123. package/lib/components/super-form/use/helper.d.ts +1 -1
  124. package/lib/components/table/field.cjs +1 -1
  125. package/lib/components/table/table.vue2.cjs +1 -1
  126. package/lib/components/table/use/use-columns.cjs +1 -1
  127. package/lib/components/table/use/use-data-source.cjs +1 -1
  128. package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
  129. package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
  130. package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
  131. package/lib/components/transfer/transfer.vue2.cjs +1 -1
  132. package/lib/components/tree/tree.vue2.cjs +1 -1
  133. package/lib/components/upload/index.d.ts +3 -3
  134. package/lib/components/upload/upload-content.vue.d.ts +2 -2
  135. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  136. package/lib/components/upload/upload-list.vue2.cjs +1 -1
  137. package/lib/components/upload/upload.vue.d.ts +2 -2
  138. package/lib/components/upload/upload.vue2.cjs +1 -1
  139. package/lib/components/upload/utils.cjs +1 -1
  140. package/lib/constants/date.cjs +1 -1
  141. package/lib/constants/date.d.ts +1 -1
  142. package/lib/index.cjs +1 -1
  143. package/lib/index.d.ts +1 -0
  144. package/lib/locale/index.cjs +1 -0
  145. package/lib/locale/index.d.cjs +1 -0
  146. package/lib/locale/index.d.ts +26 -0
  147. package/lib/locale/lang/en.cjs +1 -0
  148. package/lib/locale/lang/en.d.ts +183 -0
  149. package/lib/locale/lang/zh-cn.cjs +1 -0
  150. package/lib/locale/lang/zh-cn.d.ts +183 -0
  151. package/lib/locale/lang/zh-tw.cjs +1 -0
  152. package/lib/locale/lang/zh-tw.d.ts +183 -0
  153. package/lib/locale/use-locale.cjs +1 -0
  154. package/lib/locale/use-locale.d.ts +17 -0
  155. package/lib/package.json.cjs +1 -1
  156. package/lib/package.json.d.ts +1 -1
  157. package/package.json +2 -2
  158. package/theme-style/index.css +1 -1
  159. package/theme-style/src/super-form.scss +0 -1
  160. package/theme-style/vft-super-form.css +1 -1
  161. package/web-types.json +1 -1
@@ -1,190 +1,191 @@
1
- import { defineComponent as nt, useAttrs as rt, useSlots as st, ref as g, inject as ee, toRef as ut, computed as m, watch as x, createElementBlock as I, openBlock as C, normalizeClass as i, unref as o, createElementVNode as h, withDirectives as P, renderSlot as it, createCommentVNode as S, Fragment as ct, renderList as dt, toDisplayString as te, createVNode as T, vShow as N, withKeys as he, createBlock as ae, withCtx as ye, createTextVNode as ke, nextTick as z } from "vue";
1
+ import { defineComponent as rt, useAttrs as st, useSlots as ut, ref as g, inject as ae, toRef as it, computed as m, watch as A, createElementBlock as I, openBlock as C, normalizeClass as i, unref as o, createElementVNode as h, withDirectives as P, renderSlot as ct, createCommentVNode as S, Fragment as dt, renderList as vt, toDisplayString as B, createVNode as T, vShow as N, withKeys as ye, createBlock as le, withCtx as ke, createTextVNode as we, nextTick as L } from "vue";
2
2
  import w from "dayjs";
3
- import { VftButton as we } from "../../button/index.js";
4
- import { ClickOutside as vt } from "@vft/directives";
3
+ import { VftButton as be } from "../../button/index.js";
4
+ import { ClickOutside as mt } from "@vft/directives";
5
5
  import "@vueuse/core";
6
- import { isArray as A, isFunction as be } from "@vft/utils";
6
+ import { isArray as J, isFunction as Ve } from "@vft/utils";
7
7
  import "../../config-provider/hooks/use-global-config.js";
8
8
  import { EVENT_CODE as k } from "../../../constants/aria.js";
9
9
  import "lodash-es";
10
10
  import "../../form/index.js";
11
- import { useNamespace as Ve } from "../../../hooks/use-namespace/index.js";
11
+ import { useNamespace as De } from "../../../hooks/use-namespace/index.js";
12
12
  import "../../../hooks/use-model-toggle/index.js";
13
13
  import "@popperjs/core";
14
14
  import "../../../hooks/use-z-index/index.js";
15
- import { VftInput as De } from "../../input/index.js";
15
+ import { VftInput as ge } from "../../input/index.js";
16
16
  import "../../time-picker/index.js";
17
- import { VftIcon as L } from "../../icon/index.js";
17
+ import { VftIcon as W } from "../../icon/index.js";
18
18
  import "../../tooltip/index.js";
19
- import { panelDatePickProps as mt } from "../props/panel-date-pick.js";
20
- import { getValidDateOfMonth as ge, getValidDateOfYear as Ce, correctlyParseUserInput as Te } from "../utils.js";
21
- import { ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY as ft } from "../constants.js";
22
- import pt from "./basic-date-table.vue2.js";
23
- import ht from "./basic-month-table.vue2.js";
24
- import yt from "./basic-year-table.vue2.js";
25
- import { PICKER_BASE_INJECTION_KEY as kt } from "../../time-picker/constants.js";
26
- import { TOOLTIP_INJECTION_KEY as wt } from "../../tooltip/constants.js";
27
- import { extractTimeFormat as bt, extractDateFormat as Vt } from "../../time-picker/utils.js";
28
- import Dt from "../../time-picker/time-picker-com/panel-time-pick.vue2.js";
29
- const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
19
+ import { panelDatePickProps as ft } from "../props/panel-date-pick.js";
20
+ import { getValidDateOfMonth as Ce, getValidDateOfYear as Te, correctlyParseUserInput as Pe } from "../utils.js";
21
+ import { ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY as pt } from "../constants.js";
22
+ import ht from "./basic-date-table.vue2.js";
23
+ import yt from "./basic-month-table.vue2.js";
24
+ import kt from "./basic-year-table.vue2.js";
25
+ import { useLocale as wt } from "../../../locale/use-locale.js";
26
+ import { PICKER_BASE_INJECTION_KEY as bt } from "../../time-picker/constants.js";
27
+ import { TOOLTIP_INJECTION_KEY as Vt } from "../../tooltip/constants.js";
28
+ import { extractTimeFormat as Dt, extractDateFormat as gt } from "../../time-picker/utils.js";
29
+ import Ct from "../../time-picker/time-picker-com/panel-time-pick.vue2.js";
30
+ const Tt = ["onClick"], ta = /* @__PURE__ */ rt({
30
31
  __name: "panel-date-pick",
31
- props: mt,
32
+ props: ft,
32
33
  emits: ["pick", "set-picker-option", "panel-change"],
33
- setup(Pe, { emit: Fe }) {
34
- const n = Pe, b = Fe, $e = (e, t, l) => !0, f = Ve("picker-panel"), V = Ve("date-picker"), Ie = rt(), Ne = st(), d = g("zh-cn"), le = ee(kt), oe = ee(
35
- ft
36
- ), Ee = ee(wt), { shortcuts: ne, disabledDate: c, cellClassName: Me, defaultTime: J } = le.props, E = ut(le.props, "defaultValue"), _ = g(), a = g(w().locale(d.value)), W = g(!1);
37
- let H = !1;
38
- const re = m(() => w(J).locale(d.value)), Oe = m(() => a.value.month()), se = m(() => a.value.year()), ue = g([]), F = g(null), $ = g(null), q = (e) => ue.value.length > 0 ? $e(e, ue.value, n.format || "HH:mm:ss") : !0, ie = (e) => J && !fe.value && !W.value && !H ? re.value.year(e.year()).month(e.month()).date(e.date()) : M.value ? e.millisecond(0) : e.startOf("day"), v = (e, ...t) => {
34
+ setup(Fe, { emit: $e }) {
35
+ const n = Fe, b = $e, Ie = (e, t, l) => !0, f = De("picker-panel"), V = De("date-picker"), Ne = st(), Ee = ut(), { t: E } = wt(), d = g("zh-cn"), oe = ae(bt), ne = ae(
36
+ pt
37
+ ), Me = ae(Vt), { shortcuts: re, disabledDate: c, cellClassName: Oe, defaultTime: H } = oe.props, M = it(oe.props, "defaultValue"), U = g(), a = g(w().locale(d.value)), q = g(!1);
38
+ let G = !1;
39
+ const se = m(() => w(H).locale(d.value)), Ye = m(() => a.value.month()), ue = m(() => a.value.year()), ie = g([]), F = g(null), $ = g(null), Q = (e) => ie.value.length > 0 ? Ie(e, ie.value, n.format || "HH:mm:ss") : !0, ce = (e) => H && !pe.value && !q.value && !G ? se.value.year(e.year()).month(e.month()).date(e.date()) : O.value ? e.millisecond(0) : e.startOf("day"), v = (e, ...t) => {
39
40
  if (!e)
40
41
  b("pick", e, ...t);
41
- else if (A(e)) {
42
- const l = e.map(ie);
42
+ else if (J(e)) {
43
+ const l = e.map(ce);
43
44
  b("pick", l, ...t);
44
45
  } else
45
- b("pick", ie(e), ...t);
46
- F.value = null, $.value = null, W.value = !1, H = !1;
47
- }, Ye = async (e, t) => {
46
+ b("pick", ce(e), ...t);
47
+ F.value = null, $.value = null, q.value = !1, G = !1;
48
+ }, _e = async (e, t) => {
48
49
  if (u.value === "date") {
49
50
  e = e;
50
51
  let l = n.parsedValue ? n.parsedValue.year(e.year()).month(e.month()).date(e.date()) : e;
51
- q(l), a.value = l, v(l, M.value || t), n.type === "datetime" && (await z(), Y());
52
+ Q(l), a.value = l, v(l, O.value || t), n.type === "datetime" && (await L(), _());
52
53
  } else u.value === "week" ? v(e.date) : u.value === "dates" && v(e, !0);
53
- }, ce = (e) => {
54
- const t = e ? "add" : "subtract";
55
- a.value = a.value[t](1, "month"), U("month");
56
54
  }, de = (e) => {
55
+ const t = e ? "add" : "subtract";
56
+ a.value = a.value[t](1, "month"), z("month");
57
+ }, ve = (e) => {
57
58
  const t = a.value, l = e ? "add" : "subtract";
58
- a.value = s.value === "year" ? t[l](10, "year") : t[l](1, "year"), U("year");
59
+ a.value = s.value === "year" ? t[l](10, "year") : t[l](1, "year"), z("year");
59
60
  }, s = g("date"), Re = m(() => {
60
- const e = "";
61
+ const e = E("year");
61
62
  if (s.value === "year") {
62
- const t = Math.floor(se.value / 10) * 10;
63
- return `${t} ${e} - ${t + 9} ${e}`;
63
+ const t = Math.floor(ue.value / 10) * 10;
64
+ return e ? `${t} ${e} - ${t + 9} ${e}` : `${t} - ${t + 9}`;
64
65
  }
65
- return `${se.value} ${e}`;
66
+ return `${ue.value} ${e}`;
66
67
  }), Ke = (e) => {
67
- const t = be(e.value) ? e.value() : e.value;
68
+ const t = Ve(e.value) ? e.value() : e.value;
68
69
  if (t) {
69
- H = !0, v(w(t).locale(d.value));
70
+ G = !0, v(w(t).locale(d.value));
70
71
  return;
71
72
  }
72
73
  e.onClick && e.onClick({
73
- attrs: Ie,
74
- slots: Ne,
74
+ attrs: Ne,
75
+ slots: Ee,
75
76
  emit: b
76
77
  });
77
78
  }, u = m(() => {
78
79
  const { type: e } = n;
79
80
  return ["week", "month", "months", "year", "years", "dates"].includes(e) ? e : "date";
80
- }), G = m(() => u.value === "dates" || u.value === "months" || u.value === "years"), Se = m(() => u.value === "date" ? s.value : u.value), ve = m(() => !!ne.length), _e = async (e, t) => {
81
- u.value === "month" ? (a.value = ge(
81
+ }), X = m(() => u.value === "dates" || u.value === "months" || u.value === "years"), Se = m(() => u.value === "date" ? s.value : u.value), me = m(() => !!re.length), Be = async (e, t) => {
82
+ u.value === "month" ? (a.value = Ce(
82
83
  a.value,
83
84
  a.value.year(),
84
85
  e,
85
86
  d.value,
86
87
  c
87
- ), v(a.value, !1)) : u.value === "months" ? v(e, t ?? !0) : (a.value = ge(
88
+ ), v(a.value, !1)) : u.value === "months" ? v(e, t ?? !0) : (a.value = Ce(
88
89
  a.value,
89
90
  a.value.year(),
90
91
  e,
91
92
  d.value,
92
93
  c
93
- ), s.value = "date", ["month", "year", "date", "week"].includes(u.value) && (v(a.value, !0), await z(), Y())), U("month");
94
- }, Be = async (e, t) => {
94
+ ), s.value = "date", ["month", "year", "date", "week"].includes(u.value) && (v(a.value, !0), await L(), _())), z("month");
95
+ }, Ue = async (e, t) => {
95
96
  if (u.value === "year") {
96
97
  const l = a.value.startOf("year").year(e);
97
- a.value = Ce(l, d.value, c), v(a.value, !1);
98
+ a.value = Te(l, d.value, c), v(a.value, !1);
98
99
  } else if (u.value === "years")
99
100
  v(e, t ?? !0);
100
101
  else {
101
102
  const l = a.value.year(e);
102
- a.value = Ce(l, d.value, c), s.value = "month", ["month", "year", "date", "week"].includes(u.value) && (v(a.value, !0), await z(), Y());
103
+ a.value = Te(l, d.value, c), s.value = "month", ["month", "year", "date", "week"].includes(u.value) && (v(a.value, !0), await L(), _());
103
104
  }
104
- U("year");
105
- }, B = async (e) => {
106
- s.value = e, await z(), Y();
107
- }, M = m(
105
+ z("year");
106
+ }, x = async (e) => {
107
+ s.value = e, await L(), _();
108
+ }, O = m(
108
109
  () => n.type === "datetime" || n.type === "datetimerange"
109
- ), Ue = m(() => {
110
- const e = M.value || u.value === "dates", t = u.value === "years", l = u.value === "months", p = s.value === "date", y = s.value === "year", R = s.value === "month";
110
+ ), xe = m(() => {
111
+ const e = O.value || u.value === "dates", t = u.value === "years", l = u.value === "months", p = s.value === "date", y = s.value === "year", R = s.value === "month";
111
112
  return e && p || t && y || l && R;
112
- }), xe = m(() => c ? n.parsedValue ? A(n.parsedValue) ? c(n.parsedValue[0].toDate()) : c(n.parsedValue.toDate()) : !0 : !1), ze = () => {
113
- if (G.value)
113
+ }), ze = m(() => c ? n.parsedValue ? J(n.parsedValue) ? c(n.parsedValue[0].toDate()) : c(n.parsedValue.toDate()) : !0 : !1), Ae = () => {
114
+ if (X.value)
114
115
  v(n.parsedValue);
115
116
  else {
116
117
  let e = n.parsedValue;
117
118
  if (!e) {
118
- const t = w(J).locale(d.value), l = Z();
119
+ const t = w(H).locale(d.value), l = ee();
119
120
  e = t.year(l.year()).month(l.month()).date(l.date());
120
121
  }
121
122
  a.value = e, v(e);
122
123
  }
123
- }, Ae = m(() => c ? c(w().locale(d.value).toDate()) : !1), Le = () => {
124
+ }, Le = m(() => c ? c(w().locale(d.value).toDate()) : !1), Je = () => {
124
125
  const t = w().locale(d.value).toDate();
125
- W.value = !0, (!c || !c(t)) && q(t) && (a.value = w().locale(d.value), v(a.value));
126
- }, Q = m(() => n.timeFormat || bt(n.format)), me = m(() => n.dateFormat || Vt(n.format)), fe = m(() => {
126
+ q.value = !0, (!c || !c(t)) && Q(t) && (a.value = w().locale(d.value), v(a.value));
127
+ }, Z = m(() => n.timeFormat || Dt(n.format)), fe = m(() => n.dateFormat || gt(n.format)), pe = m(() => {
127
128
  if ($.value) return $.value;
128
- if (!(!n.parsedValue && !E.value))
129
+ if (!(!n.parsedValue && !M.value))
129
130
  return (n.parsedValue || a.value).format(
130
- Q.value
131
+ Z.value
131
132
  );
132
- }), Je = m(() => {
133
+ }), We = m(() => {
133
134
  if (F.value) return F.value;
134
- if (!(!n.parsedValue && !E.value))
135
+ if (!(!n.parsedValue && !M.value))
135
136
  return (n.parsedValue || a.value).format(
136
- me.value
137
+ fe.value
137
138
  );
138
- }), O = g(!1), We = () => {
139
- O.value = !0;
140
- }, He = () => {
141
- O.value = !1;
142
- }, X = (e) => ({
139
+ }), Y = g(!1), He = () => {
140
+ Y.value = !0;
141
+ }, qe = () => {
142
+ Y.value = !1;
143
+ }, j = (e) => ({
143
144
  hour: e.hour(),
144
145
  minute: e.minute(),
145
146
  second: e.second(),
146
147
  year: e.year(),
147
148
  month: e.month(),
148
149
  date: e.date()
149
- }), qe = (e, t, l) => {
150
- const { hour: p, minute: y, second: R } = X(e), j = n.parsedValue ? n.parsedValue.hour(p).minute(y).second(R) : e;
151
- a.value = j, v(a.value, !0), l || (O.value = t);
152
- }, Ge = (e) => {
153
- const t = w(e, Q.value).locale(d.value);
154
- if (t.isValid() && q(t)) {
155
- const { year: l, month: p, date: y } = X(a.value);
156
- a.value = t.year(l).month(p).date(y), $.value = null, O.value = !1, v(a.value, !0);
157
- }
150
+ }), Ge = (e, t, l) => {
151
+ const { hour: p, minute: y, second: R } = j(e), te = n.parsedValue ? n.parsedValue.hour(p).minute(y).second(R) : e;
152
+ a.value = te, v(a.value, !0), l || (Y.value = t);
158
153
  }, Qe = (e) => {
159
- const t = Te(
154
+ const t = w(e, Z.value).locale(d.value);
155
+ if (t.isValid() && Q(t)) {
156
+ const { year: l, month: p, date: y } = j(a.value);
157
+ a.value = t.year(l).month(p).date(y), $.value = null, Y.value = !1, v(a.value, !0);
158
+ }
159
+ }, Xe = (e) => {
160
+ const t = Pe(
160
161
  e,
161
- me.value,
162
+ fe.value,
162
163
  d.value,
163
- oe
164
+ ne
164
165
  );
165
166
  if (t.isValid()) {
166
167
  if (c && c(t.toDate()))
167
168
  return;
168
- const { hour: l, minute: p, second: y } = X(a.value);
169
+ const { hour: l, minute: p, second: y } = j(a.value);
169
170
  a.value = t.hour(l).minute(p).second(y), F.value = null, v(a.value, !0);
170
171
  }
171
- }, Xe = (e) => w.isDayjs(e) && e.isValid() && (c ? !c(e.toDate()) : !0), Ze = (e) => A(e) ? e.map((t) => t.format(n.format)) : e.format(n.format), je = (e) => Te(
172
+ }, Ze = (e) => w.isDayjs(e) && e.isValid() && (c ? !c(e.toDate()) : !0), je = (e) => J(e) ? e.map((t) => t.format(n.format)) : e.format(n.format), et = (e) => Pe(
172
173
  e,
173
174
  n.format,
174
175
  d.value,
175
- oe
176
- ), Z = () => {
177
- const e = w(E.value).locale(d.value);
178
- if (!E.value) {
179
- const t = re.value;
176
+ ne
177
+ ), ee = () => {
178
+ const e = w(M.value).locale(d.value);
179
+ if (!M.value) {
180
+ const t = se.value;
180
181
  return w().hour(t.hour()).minute(t.minute()).second(t.second()).locale(d.value);
181
182
  }
182
183
  return e;
183
- }, Y = () => {
184
- ["week", "month", "year", "date"].includes(u.value) && _.value?.focus();
185
- }, et = () => {
186
- Y(), u.value === "week" && pe(k.down);
187
- }, tt = (e) => {
184
+ }, _ = () => {
185
+ ["week", "month", "year", "date"].includes(u.value) && U.value?.focus();
186
+ }, tt = () => {
187
+ _(), u.value === "week" && he(k.down);
188
+ }, at = (e) => {
188
189
  const { code: t } = e;
189
190
  [
190
191
  k.up,
@@ -195,11 +196,11 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
195
196
  k.end,
196
197
  k.pageUp,
197
198
  k.pageDown
198
- ].includes(t) && (pe(t), e.stopPropagation(), e.preventDefault()), [k.enter, k.space, k.numpadEnter].includes(
199
+ ].includes(t) && (he(t), e.stopPropagation(), e.preventDefault()), [k.enter, k.space, k.numpadEnter].includes(
199
200
  t
200
201
  ) && F.value === null && $.value === null && (e.preventDefault(), v(a.value, !1));
201
- }, pe = (e) => {
202
- const { up: t, down: l, left: p, right: y, home: R, end: j, pageUp: at, pageDown: lt } = k, ot = {
202
+ }, he = (e) => {
203
+ const { up: t, down: l, left: p, right: y, home: R, end: te, pageUp: lt, pageDown: ot } = k, nt = {
203
204
  year: {
204
205
  [t]: -4,
205
206
  [l]: 4,
@@ -227,25 +228,25 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
227
228
  [p]: -1,
228
229
  [y]: 1,
229
230
  [R]: (r) => -r.getDay(),
230
- [j]: (r) => -r.getDay() + 6,
231
- [at]: (r) => -new Date(r.getFullYear(), r.getMonth(), 0).getDate(),
232
- [lt]: (r) => new Date(r.getFullYear(), r.getMonth() + 1, 0).getDate(),
231
+ [te]: (r) => -r.getDay() + 6,
232
+ [lt]: (r) => -new Date(r.getFullYear(), r.getMonth(), 0).getDate(),
233
+ [ot]: (r) => new Date(r.getFullYear(), r.getMonth() + 1, 0).getDate(),
233
234
  offset: (r, D) => r.setDate(r.getDate() + D)
234
235
  }
235
236
  }, K = a.value.toDate();
236
237
  for (; Math.abs(a.value.diff(K, "year", !0)) < 1; ) {
237
- const r = ot[Se.value];
238
+ const r = nt[Se.value];
238
239
  if (!r) return;
239
240
  if (r.offset(
240
241
  K,
241
- be(r[e]) ? r[e](K) : r[e] ?? 0
242
+ Ve(r[e]) ? r[e](K) : r[e] ?? 0
242
243
  ), c && c(K))
243
244
  break;
244
245
  const D = w(K).locale(d.value);
245
246
  a.value = D, b("pick", D, !0);
246
247
  break;
247
248
  }
248
- }, U = (e) => {
249
+ }, z = (e) => {
249
250
  b(
250
251
  "panel-change",
251
252
  a.value.toDate(),
@@ -253,7 +254,7 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
253
254
  s.value
254
255
  );
255
256
  };
256
- return x(
257
+ return A(
257
258
  () => u.value,
258
259
  (e) => {
259
260
  if (["month", "year"].includes(e)) {
@@ -269,93 +270,93 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
269
270
  s.value = "date";
270
271
  },
271
272
  { immediate: !0 }
272
- ), x(
273
+ ), A(
273
274
  () => s.value,
274
275
  () => {
275
- Ee?.updatePopper();
276
+ Me?.updatePopper();
276
277
  }
277
- ), x(
278
- () => E.value,
278
+ ), A(
279
+ () => M.value,
279
280
  (e) => {
280
- e && (a.value = Z());
281
+ e && (a.value = ee());
281
282
  },
282
283
  { immediate: !0 }
283
- ), x(
284
+ ), A(
284
285
  () => n.parsedValue,
285
286
  (e) => {
286
287
  if (e) {
287
- if (G.value || A(e)) return;
288
+ if (X.value || J(e)) return;
288
289
  a.value = e;
289
290
  } else
290
- a.value = Z();
291
+ a.value = ee();
291
292
  },
292
293
  { immediate: !0 }
293
- ), b("set-picker-option", ["isValidValue", Xe]), b("set-picker-option", ["formatToString", Ze]), b("set-picker-option", ["parseUserInput", je]), b("set-picker-option", ["handleFocusPicker", et]), (e, t) => (C(), I("div", {
294
+ ), b("set-picker-option", ["isValidValue", Ze]), b("set-picker-option", ["formatToString", je]), b("set-picker-option", ["parseUserInput", et]), b("set-picker-option", ["handleFocusPicker", tt]), (e, t) => (C(), I("div", {
294
295
  class: i([
295
296
  o(f).b(),
296
297
  o(V).b(),
297
298
  {
298
- "has-sidebar": e.$slots.sidebar || ve.value,
299
- "has-time": M.value
299
+ "has-sidebar": e.$slots.sidebar || me.value,
300
+ "has-time": O.value
300
301
  }
301
302
  ])
302
303
  }, [
303
304
  h("div", {
304
305
  class: i(o(f).e("body-wrapper"))
305
306
  }, [
306
- it(e.$slots, "sidebar", {
307
+ ct(e.$slots, "sidebar", {
307
308
  class: i(o(f).e("sidebar"))
308
309
  }),
309
- ve.value ? (C(), I("div", {
310
+ me.value ? (C(), I("div", {
310
311
  key: 0,
311
312
  class: i(o(f).e("sidebar"))
312
313
  }, [
313
- (C(!0), I(ct, null, dt(o(ne), (l, p) => (C(), I("button", {
314
+ (C(!0), I(dt, null, vt(o(re), (l, p) => (C(), I("button", {
314
315
  key: p,
315
316
  type: "button",
316
317
  class: i(o(f).e("shortcut")),
317
318
  onClick: (y) => Ke(l)
318
- }, te(l.text), 11, gt))), 128))
319
+ }, B(l.text), 11, Tt))), 128))
319
320
  ], 2)) : S("", !0),
320
321
  h("div", {
321
322
  class: i(o(f).e("body"))
322
323
  }, [
323
- M.value ? (C(), I("div", {
324
+ O.value ? (C(), I("div", {
324
325
  key: 0,
325
326
  class: i(o(V).e("time-header"))
326
327
  }, [
327
328
  h("span", {
328
329
  class: i(o(V).e("editor-wrap"))
329
330
  }, [
330
- T(o(De), {
331
- placeholder: "选择日期",
332
- "model-value": Je.value,
331
+ T(o(ge), {
332
+ placeholder: o(E)("selectDate"),
333
+ "model-value": We.value,
333
334
  size: "small",
334
335
  "validate-event": !1,
335
336
  onInput: t[0] || (t[0] = (l) => F.value = l),
336
- onChange: Qe
337
- }, null, 8, ["model-value"])
337
+ onChange: Xe
338
+ }, null, 8, ["placeholder", "model-value"])
338
339
  ], 2),
339
340
  P((C(), I("span", {
340
341
  class: i(o(V).e("editor-wrap"))
341
342
  }, [
342
- T(o(De), {
343
- placeholder: "选择时间",
344
- "model-value": fe.value,
343
+ T(o(ge), {
344
+ placeholder: o(E)("selectTime"),
345
+ "model-value": pe.value,
345
346
  size: "small",
346
347
  "validate-event": !1,
347
- onFocus: We,
348
+ onFocus: He,
348
349
  onInput: t[1] || (t[1] = (l) => $.value = l),
349
- onChange: Ge
350
- }, null, 8, ["model-value"]),
351
- T(o(Dt), {
352
- visible: O.value,
353
- format: Q.value,
350
+ onChange: Qe
351
+ }, null, 8, ["placeholder", "model-value"]),
352
+ T(o(Ct), {
353
+ visible: Y.value,
354
+ format: Z.value,
354
355
  "parsed-value": a.value,
355
- onPick: qe
356
+ onPick: Ge
356
357
  }, null, 8, ["visible", "format", "parsed-value"])
357
358
  ], 2)), [
358
- [o(vt), He]
359
+ [o(mt), qe]
359
360
  ])
360
361
  ], 2)) : S("", !0),
361
362
  P(h("div", {
@@ -370,16 +371,16 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
370
371
  h("button", {
371
372
  type: "button",
372
373
  class: i(["d-arrow-left", o(f).e("icon-btn")]),
373
- onClick: t[2] || (t[2] = (l) => de(!1))
374
+ onClick: t[2] || (t[2] = (l) => ve(!1))
374
375
  }, [
375
- T(o(L), { icon: "icon-d-arrow-left" })
376
+ T(o(W), { icon: "icon-d-arrow-left" })
376
377
  ], 2),
377
378
  P(h("button", {
378
379
  type: "button",
379
380
  class: i([o(f).e("icon-btn"), "arrow-left"]),
380
- onClick: t[3] || (t[3] = (l) => ce(!1))
381
+ onClick: t[3] || (t[3] = (l) => de(!1))
381
382
  }, [
382
- T(o(L), { icon: "icon-arrow-left" })
383
+ T(o(W), { icon: "icon-arrow-left" })
383
384
  ], 2), [
384
385
  [N, s.value === "date"]
385
386
  ])
@@ -389,9 +390,9 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
389
390
  class: i(o(V).e("header-label")),
390
391
  "aria-live": "polite",
391
392
  tabindex: "0",
392
- onKeydown: t[4] || (t[4] = he((l) => B("year"), ["enter"])),
393
- onClick: t[5] || (t[5] = (l) => B("year"))
394
- }, te(Re.value), 35),
393
+ onKeydown: t[4] || (t[4] = ye((l) => x("year"), ["enter"])),
394
+ onClick: t[5] || (t[5] = (l) => x("year"))
395
+ }, B(Re.value), 35),
395
396
  P(h("span", {
396
397
  role: "button",
397
398
  "aria-live": "polite",
@@ -400,9 +401,9 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
400
401
  o(V).e("header-label"),
401
402
  { active: s.value === "month" }
402
403
  ]),
403
- onKeydown: t[6] || (t[6] = he((l) => B("month"), ["enter"])),
404
- onClick: t[7] || (t[7] = (l) => B("month"))
405
- }, te(Oe.value + 1), 35), [
404
+ onKeydown: t[6] || (t[6] = ye((l) => x("month"), ["enter"])),
405
+ onClick: t[7] || (t[7] = (l) => x("month"))
406
+ }, B(Ye.value + 1), 35), [
406
407
  [N, s.value === "date"]
407
408
  ]),
408
409
  h("span", {
@@ -411,18 +412,18 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
411
412
  P(h("button", {
412
413
  type: "button",
413
414
  class: i([o(f).e("icon-btn"), "arrow-right"]),
414
- onClick: t[8] || (t[8] = (l) => ce(!0))
415
+ onClick: t[8] || (t[8] = (l) => de(!0))
415
416
  }, [
416
- T(o(L), { icon: "icon-arrow-right" })
417
+ T(o(W), { icon: "icon-arrow-right" })
417
418
  ], 2), [
418
419
  [N, s.value === "date"]
419
420
  ]),
420
421
  h("button", {
421
422
  type: "button",
422
423
  class: i([o(f).e("icon-btn"), "d-arrow-right"]),
423
- onClick: t[9] || (t[9] = (l) => de(!0))
424
+ onClick: t[9] || (t[9] = (l) => ve(!0))
424
425
  }, [
425
- T(o(L), { icon: "icon-d-arrow-right" })
426
+ T(o(W), { icon: "icon-d-arrow-right" })
426
427
  ], 2)
427
428
  ], 2)
428
429
  ], 2), [
@@ -430,39 +431,39 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
430
431
  ]),
431
432
  h("div", {
432
433
  class: i(o(f).e("content")),
433
- onKeydown: tt
434
+ onKeydown: at
434
435
  }, [
435
- s.value === "date" ? (C(), ae(pt, {
436
+ s.value === "date" ? (C(), le(ht, {
436
437
  key: 0,
437
438
  ref_key: "currentViewRef",
438
- ref: _,
439
+ ref: U,
439
440
  "selection-mode": u.value,
440
441
  date: a.value,
441
442
  "parsed-value": e.parsedValue,
442
443
  "disabled-date": o(c),
443
- "cell-class-name": o(Me),
444
+ "cell-class-name": o(Oe),
444
445
  "show-week-number": e.showWeekNumber,
445
- onPick: Ye
446
+ onPick: _e
446
447
  }, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "cell-class-name", "show-week-number"])) : S("", !0),
447
- s.value === "year" ? (C(), ae(yt, {
448
+ s.value === "year" ? (C(), le(kt, {
448
449
  key: 1,
449
450
  ref_key: "currentViewRef",
450
- ref: _,
451
+ ref: U,
451
452
  "selection-mode": u.value,
452
453
  date: a.value,
453
454
  "disabled-date": o(c),
454
455
  "parsed-value": e.parsedValue,
455
- onPick: Be
456
+ onPick: Ue
456
457
  }, null, 8, ["selection-mode", "date", "disabled-date", "parsed-value"])) : S("", !0),
457
- s.value === "month" ? (C(), ae(ht, {
458
+ s.value === "month" ? (C(), le(yt, {
458
459
  key: 2,
459
460
  ref_key: "currentViewRef",
460
- ref: _,
461
+ ref: U,
461
462
  "selection-mode": u.value,
462
463
  date: a.value,
463
464
  "parsed-value": e.parsedValue,
464
465
  "disabled-date": o(c),
465
- onPick: _e
466
+ onPick: Be
466
467
  }, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date"])) : S("", !0)
467
468
  ], 34)
468
469
  ], 2)
@@ -470,38 +471,38 @@ const gt = ["onClick"], Zt = /* @__PURE__ */ nt({
470
471
  P(h("div", {
471
472
  class: i(o(f).e("footer"))
472
473
  }, [
473
- P(T(o(we), {
474
+ P(T(o(be), {
474
475
  text: "",
475
476
  size: "small",
476
477
  class: i(o(f).e("link-btn")),
477
- disabled: Ae.value,
478
- onClick: Le
478
+ disabled: Le.value,
479
+ onClick: Je
479
480
  }, {
480
- default: ye(() => [...t[10] || (t[10] = [
481
- ke(" 现在 ", -1)
482
- ])]),
481
+ default: ke(() => [
482
+ we(B(o(E)("now")), 1)
483
+ ]),
483
484
  _: 1
484
485
  }, 8, ["class", "disabled"]), [
485
- [N, !G.value && e.showNow]
486
+ [N, !X.value && e.showNow]
486
487
  ]),
487
- T(o(we), {
488
+ T(o(be), {
488
489
  plain: "",
489
490
  size: "small",
490
491
  class: i(o(f).e("link-btn")),
491
- disabled: xe.value,
492
- onClick: ze
492
+ disabled: ze.value,
493
+ onClick: Ae
493
494
  }, {
494
- default: ye(() => [...t[11] || (t[11] = [
495
- ke(" 确认 ", -1)
496
- ])]),
495
+ default: ke(() => [
496
+ we(B(o(E)("confirm")), 1)
497
+ ]),
497
498
  _: 1
498
499
  }, 8, ["class", "disabled"])
499
500
  ], 2), [
500
- [N, Ue.value]
501
+ [N, xe.value]
501
502
  ])
502
503
  ], 2));
503
504
  }
504
505
  });
505
506
  export {
506
- Zt as default
507
+ ta as default
507
508
  };