vft 0.0.511 → 0.0.514

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 (137) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/cascader/cascader.vue2.js +202 -203
  3. package/es/components/cascader-panel/menu.vue2.js +49 -50
  4. package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
  5. package/es/components/color-picker/color-picker.vue2.js +133 -134
  6. package/es/components/config-provider/config-provider.vue.d.ts +0 -2
  7. package/es/components/config-provider/config-provider.vue2.js +4 -5
  8. package/es/components/config-provider/constants.d.ts +0 -1
  9. package/es/components/config-provider/constants.js +2 -3
  10. package/es/components/config-provider/hooks/use-global-config.js +30 -33
  11. package/es/components/config-provider/index.d.ts +0 -9
  12. package/es/components/config-provider/index.js +5 -6
  13. package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
  14. package/es/components/date-picker/composables/use-month-range-header.js +14 -15
  15. package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
  16. package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
  17. package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
  18. package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
  19. package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
  20. package/es/components/date-time-select/date-time-select.vue2.js +36 -39
  21. package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
  22. package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
  23. package/es/components/dropdown/dropdown.vue.d.ts +1 -1
  24. package/es/components/dropdown/dropdown.vue2.js +67 -68
  25. package/es/components/dropdown/index.d.ts +33 -33
  26. package/es/components/empty/empty.vue2.js +38 -39
  27. package/es/components/full-screen/full-screen.vue2.js +17 -18
  28. package/es/components/image/image.vue2.js +59 -60
  29. package/es/components/image-viewer/image-viewer.vue2.js +44 -45
  30. package/es/components/index.js +97 -98
  31. package/es/components/md-container/md-container.vue2.js +74 -75
  32. package/es/components/md-container/toc.js +36 -37
  33. package/es/components/message-box/message-box.vue2.js +3 -3
  34. package/es/components/message-box/method.js +47 -48
  35. package/es/components/modal/modal-footer-action.vue2.js +24 -25
  36. package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
  37. package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
  38. package/es/components/popconfirm/popconfirm.vue2.js +39 -40
  39. package/es/components/search/search.vue2.js +50 -51
  40. package/es/components/select/useSelect.js +231 -232
  41. package/es/components/super-form/super-form-item.vue2.js +66 -66
  42. package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
  43. package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
  44. package/es/components/transfer/transfer-panel.vue2.js +56 -57
  45. package/es/components/transfer/transfer.vue2.js +69 -70
  46. package/es/components/tree/tree.vue2.js +59 -60
  47. package/es/components/upload/upload-content.vue2.js +49 -50
  48. package/es/components/upload/upload-list.vue2.js +45 -46
  49. package/es/components/upload/upload.vue2.js +99 -100
  50. package/es/hooks/use-z-index/index.js +3 -3
  51. package/es/index.d.ts +0 -1
  52. package/es/index.js +1 -5
  53. package/es/package.json.d.ts +1 -1
  54. package/es/package.json.js +1 -1
  55. package/lib/components/cascader/cascader.vue2.cjs +1 -1
  56. package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
  57. package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
  58. package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
  59. package/lib/components/config-provider/config-provider.vue.d.ts +0 -2
  60. package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
  61. package/lib/components/config-provider/constants.cjs +1 -1
  62. package/lib/components/config-provider/constants.d.ts +0 -1
  63. package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
  64. package/lib/components/config-provider/index.cjs +1 -1
  65. package/lib/components/config-provider/index.d.ts +0 -9
  66. package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
  67. package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
  68. package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
  69. package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
  70. package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
  71. package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
  72. package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
  73. package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
  74. package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
  75. package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
  76. package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
  77. package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
  78. package/lib/components/dropdown/index.d.ts +33 -33
  79. package/lib/components/empty/empty.vue2.cjs +1 -1
  80. package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
  81. package/lib/components/image/image.vue2.cjs +1 -1
  82. package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
  83. package/lib/components/index.cjs +1 -1
  84. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  85. package/lib/components/md-container/toc.cjs +1 -1
  86. package/lib/components/message-box/message-box.vue2.cjs +1 -1
  87. package/lib/components/message-box/method.cjs +1 -1
  88. package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
  89. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  90. package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
  91. package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
  92. package/lib/components/search/search.vue2.cjs +1 -1
  93. package/lib/components/select/useSelect.cjs +1 -1
  94. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  95. package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
  96. package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
  97. package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
  98. package/lib/components/transfer/transfer.vue2.cjs +1 -1
  99. package/lib/components/tree/tree.vue2.cjs +1 -1
  100. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  101. package/lib/components/upload/upload-list.vue2.cjs +1 -1
  102. package/lib/components/upload/upload.vue2.cjs +1 -1
  103. package/lib/index.cjs +1 -1
  104. package/lib/index.d.ts +0 -1
  105. package/lib/package.json.cjs +1 -1
  106. package/lib/package.json.d.ts +1 -1
  107. package/package.json +3 -3
  108. package/theme-style/index.css +1 -1
  109. package/theme-style/src/image-viewer.scss +12 -0
  110. package/theme-style/src/message-box.scss +2 -2
  111. package/theme-style/src/table.scss +6 -0
  112. package/theme-style/vft-image-viewer.css +1 -1
  113. package/theme-style/vft-message-box.css +1 -1
  114. package/theme-style/vft-table.css +1 -1
  115. package/web-types.json +1 -1
  116. package/es/locale/index.d.js +0 -1
  117. package/es/locale/index.d.ts +0 -26
  118. package/es/locale/index.js +0 -10
  119. package/es/locale/lang/en.d.ts +0 -183
  120. package/es/locale/lang/en.js +0 -241
  121. package/es/locale/lang/zh-cn.d.ts +0 -183
  122. package/es/locale/lang/zh-cn.js +0 -241
  123. package/es/locale/lang/zh-tw.d.ts +0 -183
  124. package/es/locale/lang/zh-tw.js +0 -241
  125. package/es/locale/use-locale.d.ts +0 -17
  126. package/es/locale/use-locale.js +0 -56
  127. package/lib/locale/index.cjs +0 -1
  128. package/lib/locale/index.d.cjs +0 -1
  129. package/lib/locale/index.d.ts +0 -26
  130. package/lib/locale/lang/en.cjs +0 -1
  131. package/lib/locale/lang/en.d.ts +0 -183
  132. package/lib/locale/lang/zh-cn.cjs +0 -1
  133. package/lib/locale/lang/zh-cn.d.ts +0 -183
  134. package/lib/locale/lang/zh-tw.cjs +0 -1
  135. package/lib/locale/lang/zh-tw.d.ts +0 -183
  136. package/lib/locale/use-locale.cjs +0 -1
  137. package/lib/locale/use-locale.d.ts +0 -17
@@ -1,4 +1,4 @@
1
- import { defineComponent as s, watch as m, computed as d, onActivated as u, onDeactivated as h, onBeforeUnmount as g, getCurrentInstance as p, openBlock as v, createElementBlock as b, normalizeStyle as k, normalizeClass as C, unref as V, renderSlot as y } from "vue";
1
+ import { defineComponent as s, watch as m, computed as l, onActivated as u, onDeactivated as h, onBeforeUnmount as g, getCurrentInstance as p, openBlock as v, createElementBlock as b, normalizeStyle as k, normalizeClass as C, unref as V, renderSlot as y } from "vue";
2
2
  import { inBrowser as S, kebabCase as B } from "@vft/utils";
3
3
  import "@vueuse/core";
4
4
  import { provideGlobalConfig as E } from "./hooks/use-global-config.js";
@@ -22,7 +22,6 @@ const z = s({
22
22
  iconifyPrefixClass: { default: "ico-" },
23
23
  namespace: { default: "vft" },
24
24
  zIndex: {},
25
- locale: {},
26
25
  message: {},
27
26
  dialog: {},
28
27
  projectCfg: {},
@@ -41,7 +40,7 @@ const z = s({
41
40
  },
42
41
  { immediate: !0, deep: !0 }
43
42
  );
44
- const c = d(() => {
43
+ const c = l(() => {
45
44
  const e = t.theme === "dark";
46
45
  return f({
47
46
  ...t.themeVars,
@@ -68,8 +67,8 @@ const z = s({
68
67
  a[`--${t.namespace}-${B(o)}`] = e[o];
69
68
  }), a;
70
69
  }
71
- const l = p();
72
- return E(l.props), (e, a) => (v(), b("div", {
70
+ const d = p();
71
+ return E(d.props), (e, a) => (v(), b("div", {
73
72
  class: C([V(i).b(), { "vft-dark": t.theme === "dark" }]),
74
73
  style: k(c.value)
75
74
  }, [
@@ -3,5 +3,4 @@ import type { InjectionKey, Ref } from 'vue';
3
3
  import type { ConfigProviderProps } from './config-provider.vue';
4
4
  export type ConfigProviderContext = Partial<ConfigProviderProps>;
5
5
  export declare const configProviderContextKey: InjectionKey<Ref<ConfigProviderContext>>;
6
- export declare const localeContextKey: InjectionKey<Ref<any>>;
7
6
  export declare const messageConfig: MessageConfigContext;
@@ -1,6 +1,5 @@
1
- const o = Symbol(), e = Symbol("vftLocale"), t = {};
1
+ const o = Symbol(), e = {};
2
2
  export {
3
3
  o as configProviderContextKey,
4
- e as localeContextKey,
5
- t as messageConfig
4
+ e as messageConfig
6
5
  };
@@ -1,62 +1,59 @@
1
- import { keysOf as c } from "@vft/utils";
1
+ import { keysOf as f } from "@vft/utils";
2
2
  import "@vueuse/core";
3
3
  import { debugWarn as v } from "../../../utils/error.js";
4
- import { ref as g, getCurrentInstance as f, computed as t, unref as p, inject as C, provide as x } from "vue";
4
+ import { ref as g, getCurrentInstance as l, computed as i, unref as p, inject as C, provide as x } from "vue";
5
5
  import "lodash-es";
6
6
  import "../../form/index.js";
7
7
  import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
8
8
  import "../../../hooks/use-model-toggle/index.js";
9
9
  import "@popperjs/core";
10
10
  import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
11
- import { configProviderContextKey as m, localeContextKey as S } from "../constants.js";
12
- const s = g();
11
+ import { configProviderContextKey as m } from "../constants.js";
12
+ const a = g();
13
13
  function d(o, e = void 0) {
14
- const n = f() ? C(m, s) : s;
15
- return o ? t(() => n?.value?.[o] ?? e) : n;
14
+ const n = l() ? C(m, a) : a;
15
+ return o ? i(() => n?.value?.[o] ?? e) : n;
16
16
  }
17
- function D(o) {
17
+ function B(o) {
18
18
  const e = d(), n = b(
19
19
  o,
20
- t(() => e.value?.namespace || y)
21
- ), r = z(
22
- t(() => e.value?.zIndex || K)
20
+ i(() => e.value?.namespace || y)
21
+ ), t = z(
22
+ i(() => e.value?.zIndex || K)
23
23
  );
24
- return j(t(() => p(e) || {})), {
24
+ return S(i(() => p(e) || {})), {
25
25
  ns: n,
26
- zIndex: r
26
+ zIndex: t
27
27
  };
28
28
  }
29
- const j = (o, e, n = !1) => {
30
- const r = !!f(), i = r ? d() : void 0, l = e?.provide ?? (r ? x : void 0);
31
- if (!l) {
29
+ const S = (o, e, n = !1) => {
30
+ const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? x : void 0);
31
+ if (!u) {
32
32
  v(
33
33
  "provideGlobalConfig",
34
34
  "provideGlobalConfig() can only be used inside setup()."
35
35
  );
36
36
  return;
37
37
  }
38
- const a = t(() => {
39
- const u = p(o);
40
- return i?.value ? k(i.value, u) : u;
38
+ const s = i(() => {
39
+ const c = p(o);
40
+ return r?.value ? j(r.value, c) : c;
41
41
  });
42
- return l(m, a), l(
42
+ return u(m, s), u(
43
43
  I,
44
- t(() => a.value.namespace)
45
- ), l(
44
+ i(() => s.value.namespace)
45
+ ), u(
46
46
  G,
47
- t(() => a.value.zIndex)
48
- ), l(
49
- S,
50
- t(() => a.value.locale)
51
- ), (n || !s.value) && (s.value = a.value), a;
52
- }, k = (o, e) => {
53
- const n = [.../* @__PURE__ */ new Set([...c(o), ...c(e)])], r = {};
54
- for (const i of n)
55
- r[i] = e[i] !== void 0 ? e[i] : o[i];
56
- return r;
47
+ i(() => s.value.zIndex)
48
+ ), (n || !a.value) && (a.value = s.value), s;
49
+ }, j = (o, e) => {
50
+ const n = [.../* @__PURE__ */ new Set([...f(o), ...f(e)])], t = {};
51
+ for (const r of n)
52
+ t[r] = e[r] !== void 0 ? e[r] : o[r];
53
+ return t;
57
54
  };
58
55
  export {
59
- j as provideGlobalConfig,
60
- D as useGlobalComponentSettings,
56
+ S as provideGlobalConfig,
57
+ B as useGlobalComponentSettings,
61
58
  d as useGlobalConfig
62
59
  };
@@ -24,9 +24,6 @@ export declare const VftConfigProvider: import("vft/es/utils").SFCWithInstall<{
24
24
  zIndex: {
25
25
  type: import("vue").PropType<number>;
26
26
  };
27
- locale: {
28
- type: import("vue").PropType<any>;
29
- };
30
27
  message: {
31
28
  type: import("vue").PropType<import("vft/es/vft").MessageConfigContext>;
32
29
  };
@@ -77,9 +74,6 @@ export declare const VftConfigProvider: import("vft/es/utils").SFCWithInstall<{
77
74
  zIndex: {
78
75
  type: import("vue").PropType<number>;
79
76
  };
80
- locale: {
81
- type: import("vue").PropType<any>;
82
- };
83
77
  message: {
84
78
  type: import("vue").PropType<import("vft/es/vft").MessageConfigContext>;
85
79
  };
@@ -127,9 +121,6 @@ export declare const VftConfigProvider: import("vft/es/utils").SFCWithInstall<{
127
121
  zIndex: {
128
122
  type: import("vue").PropType<number>;
129
123
  };
130
- locale: {
131
- type: import("vue").PropType<any>;
132
- };
133
124
  message: {
134
125
  type: import("vue").PropType<import("vft/es/vft").MessageConfigContext>;
135
126
  };
@@ -1,20 +1,19 @@
1
1
  import "@vueuse/core";
2
2
  import "@vft/utils";
3
- import { provideGlobalConfig as g, useGlobalComponentSettings as C, useGlobalConfig as x } from "./hooks/use-global-config.js";
3
+ import { provideGlobalConfig as g, useGlobalComponentSettings as C, useGlobalConfig as d } from "./hooks/use-global-config.js";
4
4
  import "vue";
5
5
  import { withInstall as o } from "../../utils/vue/install.js";
6
6
  import "lodash-es";
7
7
  import "../form/index.js";
8
8
  import t from "./config-provider.vue2.js";
9
- import { configProviderContextKey as d, localeContextKey as b, messageConfig as u } from "./constants.js";
9
+ import { configProviderContextKey as b, messageConfig as c } from "./constants.js";
10
10
  const l = o(t);
11
11
  export {
12
12
  l as VftConfigProvider,
13
- d as configProviderContextKey,
13
+ b as configProviderContextKey,
14
14
  l as default,
15
- b as localeContextKey,
16
- u as messageConfig,
15
+ c as messageConfig,
17
16
  g as provideGlobalConfig,
18
17
  C as useGlobalComponentSettings,
19
- x as useGlobalConfig
18
+ d as useGlobalConfig
20
19
  };
@@ -1,65 +1,64 @@
1
- import { ref as k, computed as m, unref as r, watch as Z, nextTick as ee } from "vue";
2
- import A from "dayjs";
3
- import { flatten as te, isArray as ae } from "lodash-es";
1
+ import { ref as k, computed as m, unref as r, watch as Y, nextTick as Z } from "vue";
2
+ import P from "dayjs";
3
+ import { flatten as p, isArray as ee } from "lodash-es";
4
4
  import "@vueuse/core";
5
5
  import "@vft/utils";
6
6
  import { castArray as x } from "../../../utils/helper.js";
7
7
  import "../../form/index.js";
8
- import { useNamespace as se } from "../../../hooks/use-namespace/index.js";
8
+ import { useNamespace as te } from "../../../hooks/use-namespace/index.js";
9
9
  import "../../../hooks/use-model-toggle/index.js";
10
10
  import "@popperjs/core";
11
11
  import "../../../hooks/use-z-index/index.js";
12
- import E from "../../../locale/use-locale.js";
13
- import { buildPickerTable as ne } from "../utils.js";
14
- const N = (a = "") => ["normal", "today"].includes(a), be = (a, f) => {
15
- const { t: v } = E(), D = k("zh-cn"), y = k(), b = k(), g = k(), w = k(), C = k([[], [], [], [], [], []]);
12
+ import { buildPickerTable as ae } from "../utils.js";
13
+ const N = (a = "") => ["normal", "today"].includes(a), ye = (a, f) => {
14
+ const D = k("zh-cn"), y = k(), b = k(), g = k(), w = k(), C = k([[], [], [], [], [], []]);
16
15
  let o = !1;
17
- const c = a.date.$locale().weekStart || 7, S = a.date.locale("zh-cn").localeData().weekdaysShort().map((e) => e.toLowerCase()), O = m(() => c > 3 ? 7 - c : -c), R = m(() => {
16
+ const c = a.date.$locale().weekStart || 7, S = a.date.locale("zh-cn").localeData().weekdaysShort().map((e) => e.toLowerCase()), O = m(() => c > 3 ? 7 - c : -c), v = m(() => {
18
17
  const e = a.date.startOf("month");
19
18
  return e.subtract(e.day() || 7, "day");
20
- }), L = m(() => S.concat(S).slice(
19
+ }), j = m(() => S.concat(S).slice(
21
20
  c,
22
21
  c + 7
23
- )), V = m(() => te(r(M)).some((e) => e.isCurrent)), K = m(() => {
24
- const e = a.date.startOf("month"), t = e.day() || 7, s = e.daysInMonth(), n = e.subtract(1, "month").daysInMonth();
22
+ )), R = m(() => p(r(M)).some((e) => e.isCurrent)), A = m(() => {
23
+ const e = a.date.startOf("month"), t = e.day() || 7, n = e.daysInMonth(), s = e.subtract(1, "month").daysInMonth();
25
24
  return {
26
25
  startOfMonthDay: t,
27
- dateCountOfMonth: s,
28
- dateCountOfLastMonth: n
26
+ dateCountOfMonth: n,
27
+ dateCountOfLastMonth: s
29
28
  };
30
- }), F = m(() => a.selectionMode === "dates" ? x(a.parsedValue) : []), _ = (e, { count: t, rowIndex: s, columnIndex: n }) => {
31
- const { startOfMonthDay: l, dateCountOfMonth: i, dateCountOfLastMonth: u } = r(K), h = r(O);
32
- if (s >= 0 && s <= 1) {
29
+ }), K = m(() => a.selectionMode === "dates" ? x(a.parsedValue) : []), L = (e, { count: t, rowIndex: n, columnIndex: s }) => {
30
+ const { startOfMonthDay: l, dateCountOfMonth: i, dateCountOfLastMonth: u } = r(A), h = r(O);
31
+ if (n >= 0 && n <= 1) {
33
32
  const d = l + h < 0 ? 7 + l + h : l + h;
34
- if (n + s * 7 >= d)
33
+ if (s + n * 7 >= d)
35
34
  return e.text = t, !0;
36
- e.text = u - (d - n % 7) + 1 + s * 7, e.type = "prev-month";
35
+ e.text = u - (d - s % 7) + 1 + n * 7, e.type = "prev-month";
37
36
  } else
38
37
  return t <= i ? e.text = t : (e.text = t - i, e.type = "next-month"), !0;
39
38
  return !1;
40
- }, $ = (e, { columnIndex: t, rowIndex: s }, n) => {
41
- const { disabledDate: l, cellClassName: i } = a, u = r(F), h = _(e, { count: n, rowIndex: s, columnIndex: t }), d = e.dayjs.toDate();
42
- return e.selected = u.find((Y) => Y.isSame(e.dayjs, "day")), e.isSelected = !!e.selected, e.isCurrent = W(e), e.disabled = l?.(d), e.customClass = i?.(d), h;
43
- }, z = (e) => {
39
+ }, F = (e, { columnIndex: t, rowIndex: n }, s) => {
40
+ const { disabledDate: l, cellClassName: i } = a, u = r(K), h = L(e, { count: s, rowIndex: n, columnIndex: t }), d = e.dayjs.toDate();
41
+ return e.selected = u.find((X) => X.isSame(e.dayjs, "day")), e.isSelected = !!e.selected, e.isCurrent = W(e), e.disabled = l?.(d), e.customClass = i?.(d), h;
42
+ }, _ = (e) => {
44
43
  if (a.selectionMode === "week") {
45
- const [t, s] = a.showWeekNumber ? [1, 7] : [0, 6], n = j(e[t + 1]);
46
- e[t].inRange = n, e[t].start = n, e[s].inRange = n, e[s].end = n;
44
+ const [t, n] = a.showWeekNumber ? [1, 7] : [0, 6], s = I(e[t + 1]);
45
+ e[t].inRange = s, e[t].start = s, e[n].inRange = s, e[n].end = s;
47
46
  }
48
47
  }, M = m(() => {
49
- const { minDate: e, maxDate: t, rangeState: s, showWeekNumber: n } = a, l = r(O), i = r(C), u = "day";
48
+ const { minDate: e, maxDate: t, rangeState: n, showWeekNumber: s } = a, l = r(O), i = r(C), u = "day";
50
49
  let h = 1;
51
- if (ne({ row: 6, column: 7 }, i, {
50
+ if (ae({ row: 6, column: 7 }, i, {
52
51
  startDate: e,
53
- columnIndexOffset: n ? 1 : 0,
54
- nextEndDate: s.endDate || t || s.selecting && e || null,
55
- now: A().locale(r(D)).startOf(u),
52
+ columnIndexOffset: s ? 1 : 0,
53
+ nextEndDate: n.endDate || t || n.selecting && e || null,
54
+ now: P().locale(r(D)).startOf(u),
56
55
  unit: u,
57
- relativeDateGetter: (d) => r(R).add(d - l, u),
56
+ relativeDateGetter: (d) => r(v).add(d - l, u),
58
57
  setCellMetadata: (...d) => {
59
- $(...d, h) && (h += 1);
58
+ F(...d, h) && (h += 1);
60
59
  },
61
- setRowMetadata: z
62
- }), n)
60
+ setRowMetadata: _
61
+ }), s)
63
62
  for (let d = 0; d < 6; d++)
64
63
  i[d][1].dayjs && (i[d][0] = {
65
64
  type: "week",
@@ -67,54 +66,54 @@ const N = (a = "") => ["normal", "today"].includes(a), be = (a, f) => {
67
66
  });
68
67
  return i;
69
68
  });
70
- Z(
69
+ Y(
71
70
  () => a.date,
72
71
  async () => {
73
- r(y)?.contains(document.activeElement) && (await ee(), await T());
72
+ r(y)?.contains(document.activeElement) && (await Z(), await V());
74
73
  }
75
74
  );
76
- const T = async () => r(b)?.focus(), W = (e) => a.selectionMode === "date" && N(e.type) && B(e, a.parsedValue), B = (e, t) => t ? A(t).locale(r(D)).isSame(a.date.date(Number(e.text)), "day") : !1, P = (e, t) => {
77
- const s = e * 7 + (t - (a.showWeekNumber ? 1 : 0)) - r(O);
78
- return r(R).add(s, "day");
79
- }, U = (e) => {
75
+ const V = async () => r(b)?.focus(), W = (e) => a.selectionMode === "date" && N(e.type) && $(e, a.parsedValue), $ = (e, t) => t ? P(t).locale(r(D)).isSame(a.date.date(Number(e.text)), "day") : !1, T = (e, t) => {
76
+ const n = e * 7 + (t - (a.showWeekNumber ? 1 : 0)) - r(O);
77
+ return r(v).add(n, "day");
78
+ }, z = (e) => {
80
79
  if (!a.rangeState.selecting) return;
81
80
  let t = e.target;
82
81
  if (t.tagName === "SPAN" && (t = t.parentNode?.parentNode), t.tagName === "DIV" && (t = t.parentNode), t.tagName !== "TD") return;
83
- const s = t.parentNode.rowIndex - 1, n = t.cellIndex;
84
- r(M)[s][n].disabled || (s !== r(g) || n !== r(w)) && (g.value = s, w.value = n, f("changerange", {
82
+ const n = t.parentNode.rowIndex - 1, s = t.cellIndex;
83
+ r(M)[n][s].disabled || (n !== r(g) || s !== r(w)) && (g.value = n, w.value = s, f("changerange", {
85
84
  selecting: !0,
86
- endDate: P(s, n)
85
+ endDate: T(n, s)
87
86
  }));
88
- }, G = (e) => !r(V) && e?.text === 1 && e.type === "normal" || e.isCurrent, H = (e) => {
89
- o || r(V) || a.selectionMode !== "date" || I(e, !0);
90
- }, p = (e) => {
87
+ }, B = (e) => !r(R) && e?.text === 1 && e.type === "normal" || e.isCurrent, U = (e) => {
88
+ o || r(R) || a.selectionMode !== "date" || E(e, !0);
89
+ }, G = (e) => {
91
90
  e.target.closest("td") && (o = !0);
92
- }, q = (e) => {
91
+ }, H = (e) => {
93
92
  e.target.closest("td") && (o = !1);
94
- }, J = (e) => {
93
+ }, q = (e) => {
95
94
  !a.rangeState.selecting || !a.minDate ? (f("pick", { minDate: e, maxDate: null }), f("select", !0)) : (e >= a.minDate ? f("pick", { minDate: a.minDate, maxDate: e }) : f("pick", { minDate: e, maxDate: a.minDate }), f("select", !1));
96
- }, Q = (e) => {
97
- const t = e.week(), s = `${e.year()}w${t}`;
95
+ }, J = (e) => {
96
+ const t = e.week(), n = `${e.year()}w${t}`;
98
97
  f("pick", {
99
98
  year: e.year(),
100
99
  week: t,
101
- value: s,
100
+ value: n,
102
101
  date: e.startOf("week")
103
102
  });
104
- }, X = (e, t) => {
105
- const s = t ? x(a.parsedValue).filter(
106
- (n) => n?.valueOf() !== e.valueOf()
103
+ }, Q = (e, t) => {
104
+ const n = t ? x(a.parsedValue).filter(
105
+ (s) => s?.valueOf() !== e.valueOf()
107
106
  ) : x(a.parsedValue).concat([e]);
108
- f("pick", s);
109
- }, I = (e, t = !1) => {
110
- const s = e.target.closest("td");
111
- if (!s) return;
112
- const n = s.parentNode.rowIndex - 1, l = s.cellIndex, i = r(M)[n][l];
107
+ f("pick", n);
108
+ }, E = (e, t = !1) => {
109
+ const n = e.target.closest("td");
110
+ if (!n) return;
111
+ const s = n.parentNode.rowIndex - 1, l = n.cellIndex, i = r(M)[s][l];
113
112
  if (i.disabled || i.type === "week") return;
114
- const u = P(n, l);
113
+ const u = T(s, l);
115
114
  switch (a.selectionMode) {
116
115
  case "range": {
117
- J(u);
116
+ q(u);
118
117
  break;
119
118
  }
120
119
  case "date": {
@@ -122,53 +121,53 @@ const N = (a = "") => ["normal", "today"].includes(a), be = (a, f) => {
122
121
  break;
123
122
  }
124
123
  case "week": {
125
- Q(u);
124
+ J(u);
126
125
  break;
127
126
  }
128
127
  case "dates": {
129
- X(u, !!i.selected);
128
+ Q(u, !!i.selected);
130
129
  break;
131
130
  }
132
131
  }
133
- }, j = (e) => {
132
+ }, I = (e) => {
134
133
  if (a.selectionMode !== "week") return !1;
135
134
  let t = a.date.startOf("day");
136
- if (e.type === "prev-month" && (t = t.subtract(1, "month")), e.type === "next-month" && (t = t.add(1, "month")), t = t.date(Number.parseInt(e.text, 10)), a.parsedValue && !ae(a.parsedValue)) {
137
- const s = (a.parsedValue.day() - c + 7) % 7 - 1;
138
- return a.parsedValue.subtract(s, "day").isSame(t, "day");
135
+ if (e.type === "prev-month" && (t = t.subtract(1, "month")), e.type === "next-month" && (t = t.add(1, "month")), t = t.date(Number.parseInt(e.text, 10)), a.parsedValue && !ee(a.parsedValue)) {
136
+ const n = (a.parsedValue.day() - c + 7) % 7 - 1;
137
+ return a.parsedValue.subtract(n, "day").isSame(t, "day");
139
138
  }
140
139
  return !1;
141
140
  };
142
141
  return {
143
- WEEKS: L,
142
+ WEEKS: j,
144
143
  rows: M,
145
144
  tbodyRef: y,
146
145
  currentCellRef: b,
147
146
  // cellMatchesDate,
148
147
  // getDateOfCell,
149
- focus: T,
148
+ focus: V,
150
149
  isCurrent: W,
151
- isWeekActive: j,
152
- isSelectedCell: G,
153
- handlePickDate: I,
154
- handleMouseUp: q,
155
- handleMouseDown: p,
156
- handleMouseMove: U,
157
- handleFocus: H
150
+ isWeekActive: I,
151
+ isSelectedCell: B,
152
+ handlePickDate: E,
153
+ handleMouseUp: H,
154
+ handleMouseDown: G,
155
+ handleMouseMove: z,
156
+ handleFocus: U
158
157
  };
159
- }, ge = (a, {
158
+ }, ke = (a, {
160
159
  isCurrent: f,
161
- isWeekActive: v
160
+ isWeekActive: D
162
161
  }) => {
163
- const { t: D } = E(), y = se("date-table"), b = m(() => [
162
+ const y = te("date-table"), b = m(() => [
164
163
  y.b(),
165
164
  { "is-week-mode": a.selectionMode === "week" }
166
- ]), g = m(() => D("vft.datePicker.dateTableLabel")), w = (o) => {
165
+ ]), g = m(() => "使用方向键与 Enter 键可选择日期"), w = (o) => {
167
166
  const c = [];
168
167
  return N(o.type) && !o.disabled ? (c.push("available"), o.type === "today" && c.push("today")) : c.push(o.type), f(o) && c.push("current"), o.inRange && (N(o.type) || a.selectionMode === "week") && (c.push("in-range"), o.start && c.push("start-date"), o.end && c.push("end-date")), o.disabled && c.push("disabled"), o.selected && c.push("selected"), o.customClass && c.push(o.customClass), c.join(" ");
169
168
  }, C = (o) => [
170
169
  y.e("row"),
171
- { current: v(o) }
170
+ { current: D(o) }
172
171
  ];
173
172
  return {
174
173
  tableKls: b,
@@ -179,6 +178,6 @@ const N = (a = "") => ["normal", "today"].includes(a), be = (a, f) => {
179
178
  };
180
179
  };
181
180
  export {
182
- be as useBasicDateTable,
183
- ge as useBasicDateTableDOM
181
+ ye as useBasicDateTable,
182
+ ke as useBasicDateTableDOM
184
183
  };
@@ -1,30 +1,29 @@
1
1
  import { computed as a } from "vue";
2
- import Y from "../../../locale/use-locale.js";
3
- const p = ({
2
+ const b = ({
4
3
  unlinkPanels: u,
5
4
  leftDate: e,
6
5
  rightDate: r
7
6
  }) => {
8
- const { t: v } = Y(), o = () => {
7
+ const v = () => {
9
8
  e.value = e.value.subtract(1, "year"), u.value || (r.value = r.value.subtract(1, "year"));
10
- }, c = () => {
11
- u.value || (e.value = e.value.add(1, "year")), r.value = r.value.add(1, "year");
12
9
  }, l = () => {
10
+ u.value || (e.value = e.value.add(1, "year")), r.value = r.value.add(1, "year");
11
+ }, o = () => {
13
12
  e.value = e.value.add(1, "year");
14
- }, y = () => {
13
+ }, c = () => {
15
14
  r.value = r.value.subtract(1, "year");
16
- }, n = a(() => `${e.value.year()} ${v("vft.datePicker.year")}`), s = a(() => `${r.value.year()} ${v("vft.datePicker.year")}`), d = a(() => e.value.year()), t = a(() => r.value.year() === e.value.year() ? e.value.year() + 1 : r.value.year());
15
+ }, n = a(() => `${e.value.year()} 年`), y = a(() => `${r.value.year()} 年`), s = a(() => e.value.year()), d = a(() => r.value.year() === e.value.year() ? e.value.year() + 1 : r.value.year());
17
16
  return {
18
- leftPrevYear: o,
19
- rightNextYear: c,
20
- leftNextYear: l,
21
- rightPrevYear: y,
17
+ leftPrevYear: v,
18
+ rightNextYear: l,
19
+ leftNextYear: o,
20
+ rightPrevYear: c,
22
21
  leftLabel: n,
23
- rightLabel: s,
24
- leftYear: d,
25
- rightYear: t
22
+ rightLabel: y,
23
+ leftYear: s,
24
+ rightYear: d
26
25
  };
27
26
  };
28
27
  export {
29
- p as useMonthRangeHeader
28
+ b as useMonthRangeHeader
30
29
  };
@@ -1,47 +1,46 @@
1
- import { ref as i, inject as _, computed as o, nextTick as Y } from "vue";
1
+ import { ref as i, inject as O, computed as o, nextTick as Y } from "vue";
2
2
  import "../../time-picker/index.js";
3
- import j from "../../../locale/use-locale.js";
4
- import { getValidDateOfYear as x, getValidDateOfMonth as K } from "../utils.js";
5
- import { PICKER_BASE_INJECTION_KEY as N } from "../../time-picker/constants.js";
6
- const T = (R, p, c, u) => {
7
- const { t: L } = j(), l = i("date"), h = i(), s = i("date"), v = i(), $ = _(N), { disabledDate: d } = $.props, m = i("zh-cn"), P = o(() => c.value.year()), C = o(() => c.value.month()), w = o(() => u.value.year()), b = o(() => u.value.month());
8
- function y(e, a) {
9
- const n = L("vft.datePicker.year");
3
+ import { getValidDateOfYear as _, getValidDateOfMonth as j } from "../utils.js";
4
+ import { PICKER_BASE_INJECTION_KEY as x } from "../../time-picker/constants.js";
5
+ const D = (R, $, c, u) => {
6
+ const l = i("date"), h = i(), s = i("date"), v = i(), p = O(x), { disabledDate: d } = p.props, m = i("zh-cn"), w = o(() => c.value.year()), C = o(() => c.value.month()), P = o(() => u.value.year()), L = o(() => u.value.month());
7
+ function g(e, a) {
8
+ const n = "年";
10
9
  if (e.value === "year") {
11
10
  const t = Math.floor(a.value / 10) * 10;
12
11
  return n ? `${t} ${n} - ${t + 9} ${n}` : `${t} - ${t + 9}`;
13
12
  }
14
13
  return `${a.value} ${n}`;
15
14
  }
16
- function g(e) {
15
+ function y(e) {
17
16
  e?.focus();
18
17
  }
19
18
  async function k(e, a) {
20
19
  const n = e === "left" ? l : s, t = e === "left" ? h : v;
21
- n.value = a, await Y(), g(t.value);
20
+ n.value = a, await Y(), y(t.value);
22
21
  }
23
22
  async function f(e, a, n) {
24
- const t = a === "left", r = t ? c : u, E = t ? u : c, B = t ? l : s, I = t ? h : v;
23
+ const t = a === "left", r = t ? c : u, M = t ? u : c, E = t ? l : s, B = t ? h : v;
25
24
  if (e === "year") {
26
- const O = r.value.year(n);
27
- r.value = x(O, m.value, d);
25
+ const I = r.value.year(n);
26
+ r.value = _(I, m.value, d);
28
27
  }
29
- e === "month" && (r.value = K(
28
+ e === "month" && (r.value = j(
30
29
  r.value,
31
30
  r.value.year(),
32
31
  n,
33
32
  m.value,
34
33
  d
35
- )), R.unlinkPanels || (E.value = a === "left" ? r.value.add(1, "month") : r.value.subtract(1, "month")), B.value = e === "year" ? "month" : "date", await Y(), g(I.value), V(e);
34
+ )), R.unlinkPanels || (M.value = a === "left" ? r.value.add(1, "month") : r.value.subtract(1, "month")), E.value = e === "year" ? "month" : "date", await Y(), y(B.value), V(e);
36
35
  }
37
36
  function V(e) {
38
- p(
37
+ $(
39
38
  "panel-change",
40
39
  [c.value.toDate(), u.value.toDate()],
41
40
  e
42
41
  );
43
42
  }
44
- function M(e, a, n) {
43
+ function b(e, a, n) {
45
44
  const t = n ? "add" : "subtract";
46
45
  return e === "year" ? a[t](10, "year") : a[t](1, "year");
47
46
  }
@@ -50,13 +49,13 @@ const T = (R, p, c, u) => {
50
49
  rightCurrentView: s,
51
50
  leftCurrentViewRef: h,
52
51
  rightCurrentViewRef: v,
53
- leftYear: P,
54
- rightYear: w,
52
+ leftYear: w,
53
+ rightYear: P,
55
54
  leftMonth: C,
56
- rightMonth: b,
57
- leftYearLabel: o(() => y(l, P)),
55
+ rightMonth: L,
56
+ leftYearLabel: o(() => g(l, w)),
58
57
  rightYearLabel: o(
59
- () => y(s, w)
58
+ () => g(s, P)
60
59
  ),
61
60
  showLeftPicker: (e) => k("left", e),
62
61
  showRightPicker: (e) => k("right", e),
@@ -65,9 +64,9 @@ const T = (R, p, c, u) => {
65
64
  handleLeftMonthPick: (e) => f("month", "left", e),
66
65
  handleRightMonthPick: (e) => f("month", "right", e),
67
66
  handlePanelChange: V,
68
- adjustDateByView: M
67
+ adjustDateByView: b
69
68
  };
70
69
  };
71
70
  export {
72
- T as usePanelDateRange
71
+ D as usePanelDateRange
73
72
  };