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.
- package/dist/index.css +1 -1
- package/es/components/cascader/cascader.vue2.js +202 -203
- package/es/components/cascader-panel/menu.vue2.js +49 -50
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
- package/es/components/color-picker/color-picker.vue2.js +133 -134
- package/es/components/config-provider/config-provider.vue.d.ts +0 -2
- package/es/components/config-provider/config-provider.vue2.js +4 -5
- package/es/components/config-provider/constants.d.ts +0 -1
- package/es/components/config-provider/constants.js +2 -3
- package/es/components/config-provider/hooks/use-global-config.js +30 -33
- package/es/components/config-provider/index.d.ts +0 -9
- package/es/components/config-provider/index.js +5 -6
- package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
- package/es/components/date-picker/composables/use-month-range-header.js +14 -15
- package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
- package/es/components/date-time-select/date-time-select.vue2.js +36 -39
- package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue2.js +67 -68
- package/es/components/dropdown/index.d.ts +33 -33
- package/es/components/empty/empty.vue2.js +38 -39
- package/es/components/full-screen/full-screen.vue2.js +17 -18
- package/es/components/image/image.vue2.js +59 -60
- package/es/components/image-viewer/image-viewer.vue2.js +44 -45
- package/es/components/index.js +97 -98
- package/es/components/md-container/md-container.vue2.js +74 -75
- package/es/components/md-container/toc.js +36 -37
- package/es/components/message-box/message-box.vue2.js +3 -3
- package/es/components/message-box/method.js +47 -48
- package/es/components/modal/modal-footer-action.vue2.js +24 -25
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
- package/es/components/popconfirm/popconfirm.vue2.js +39 -40
- package/es/components/search/search.vue2.js +50 -51
- package/es/components/select/useSelect.js +231 -232
- package/es/components/super-form/super-form-item.vue2.js +66 -66
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
- package/es/components/transfer/transfer-panel.vue2.js +56 -57
- package/es/components/transfer/transfer.vue2.js +69 -70
- package/es/components/tree/tree.vue2.js +59 -60
- package/es/components/upload/upload-content.vue2.js +49 -50
- package/es/components/upload/upload-list.vue2.js +45 -46
- package/es/components/upload/upload.vue2.js +99 -100
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -5
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue.d.ts +0 -2
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/config-provider/constants.cjs +1 -1
- package/lib/components/config-provider/constants.d.ts +0 -1
- package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
- package/lib/components/config-provider/index.cjs +1 -1
- package/lib/components/config-provider/index.d.ts +0 -9
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.d.ts +33 -33
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/message-box/message-box.vue2.cjs +1 -1
- package/lib/components/message-box/method.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
- package/lib/components/transfer/transfer.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +3 -3
- package/theme-style/index.css +1 -1
- package/theme-style/src/image-viewer.scss +12 -0
- package/theme-style/src/message-box.scss +2 -2
- package/theme-style/src/table.scss +6 -0
- package/theme-style/vft-image-viewer.css +1 -1
- package/theme-style/vft-message-box.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
- package/es/locale/index.d.js +0 -1
- package/es/locale/index.d.ts +0 -26
- package/es/locale/index.js +0 -10
- package/es/locale/lang/en.d.ts +0 -183
- package/es/locale/lang/en.js +0 -241
- package/es/locale/lang/zh-cn.d.ts +0 -183
- package/es/locale/lang/zh-cn.js +0 -241
- package/es/locale/lang/zh-tw.d.ts +0 -183
- package/es/locale/lang/zh-tw.js +0 -241
- package/es/locale/use-locale.d.ts +0 -17
- package/es/locale/use-locale.js +0 -56
- package/lib/locale/index.cjs +0 -1
- package/lib/locale/index.d.cjs +0 -1
- package/lib/locale/index.d.ts +0 -26
- package/lib/locale/lang/en.cjs +0 -1
- package/lib/locale/lang/en.d.ts +0 -183
- package/lib/locale/lang/zh-cn.cjs +0 -1
- package/lib/locale/lang/zh-cn.d.ts +0 -183
- package/lib/locale/lang/zh-tw.cjs +0 -1
- package/lib/locale/lang/zh-tw.d.ts +0 -183
- package/lib/locale/use-locale.cjs +0 -1
- package/lib/locale/use-locale.d.ts +0 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as s, watch as m, computed as
|
|
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 =
|
|
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
|
|
72
|
-
return E(
|
|
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,62 +1,59 @@
|
|
|
1
|
-
import { keysOf as
|
|
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
|
|
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
|
|
12
|
-
const
|
|
11
|
+
import { configProviderContextKey as m } from "../constants.js";
|
|
12
|
+
const a = g();
|
|
13
13
|
function d(o, e = void 0) {
|
|
14
|
-
const n =
|
|
15
|
-
return o ?
|
|
14
|
+
const n = l() ? C(m, a) : a;
|
|
15
|
+
return o ? i(() => n?.value?.[o] ?? e) : n;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function B(o) {
|
|
18
18
|
const e = d(), n = b(
|
|
19
19
|
o,
|
|
20
|
-
|
|
21
|
-
),
|
|
22
|
-
|
|
20
|
+
i(() => e.value?.namespace || y)
|
|
21
|
+
), t = z(
|
|
22
|
+
i(() => e.value?.zIndex || K)
|
|
23
23
|
);
|
|
24
|
-
return
|
|
24
|
+
return S(i(() => p(e) || {})), {
|
|
25
25
|
ns: n,
|
|
26
|
-
zIndex:
|
|
26
|
+
zIndex: t
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
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
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
const s = i(() => {
|
|
39
|
+
const c = p(o);
|
|
40
|
+
return r?.value ? j(r.value, c) : c;
|
|
41
41
|
});
|
|
42
|
-
return
|
|
42
|
+
return u(m, s), u(
|
|
43
43
|
I,
|
|
44
|
-
|
|
45
|
-
),
|
|
44
|
+
i(() => s.value.namespace)
|
|
45
|
+
), u(
|
|
46
46
|
G,
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
60
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
13
|
+
b as configProviderContextKey,
|
|
14
14
|
l as default,
|
|
15
|
-
|
|
16
|
-
u as messageConfig,
|
|
15
|
+
c as messageConfig,
|
|
17
16
|
g as provideGlobalConfig,
|
|
18
17
|
C as useGlobalComponentSettings,
|
|
19
|
-
|
|
18
|
+
d as useGlobalConfig
|
|
20
19
|
};
|
|
@@ -1,65 +1,64 @@
|
|
|
1
|
-
import { ref as k, computed as m, unref as r, watch as
|
|
2
|
-
import
|
|
3
|
-
import { flatten as
|
|
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
|
|
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
|
|
13
|
-
|
|
14
|
-
const
|
|
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),
|
|
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
|
-
}),
|
|
19
|
+
}), j = m(() => S.concat(S).slice(
|
|
21
20
|
c,
|
|
22
21
|
c + 7
|
|
23
|
-
)),
|
|
24
|
-
const e = a.date.startOf("month"), t = e.day() || 7,
|
|
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:
|
|
28
|
-
dateCountOfLastMonth:
|
|
26
|
+
dateCountOfMonth: n,
|
|
27
|
+
dateCountOfLastMonth: s
|
|
29
28
|
};
|
|
30
|
-
}),
|
|
31
|
-
const { startOfMonthDay: l, dateCountOfMonth: i, dateCountOfLastMonth: u } = r(
|
|
32
|
-
if (
|
|
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 (
|
|
33
|
+
if (s + n * 7 >= d)
|
|
35
34
|
return e.text = t, !0;
|
|
36
|
-
e.text = u - (d -
|
|
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
|
-
},
|
|
41
|
-
const { disabledDate: l, cellClassName: i } = a, u = r(
|
|
42
|
-
return e.selected = u.find((
|
|
43
|
-
},
|
|
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,
|
|
46
|
-
e[t].inRange =
|
|
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:
|
|
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 (
|
|
50
|
+
if (ae({ row: 6, column: 7 }, i, {
|
|
52
51
|
startDate: e,
|
|
53
|
-
columnIndexOffset:
|
|
54
|
-
nextEndDate:
|
|
55
|
-
now:
|
|
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(
|
|
56
|
+
relativeDateGetter: (d) => r(v).add(d - l, u),
|
|
58
57
|
setCellMetadata: (...d) => {
|
|
59
|
-
|
|
58
|
+
F(...d, h) && (h += 1);
|
|
60
59
|
},
|
|
61
|
-
setRowMetadata:
|
|
62
|
-
}),
|
|
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
|
-
|
|
69
|
+
Y(
|
|
71
70
|
() => a.date,
|
|
72
71
|
async () => {
|
|
73
|
-
r(y)?.contains(document.activeElement) && (await
|
|
72
|
+
r(y)?.contains(document.activeElement) && (await Z(), await V());
|
|
74
73
|
}
|
|
75
74
|
);
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
return r(
|
|
79
|
-
},
|
|
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
|
|
84
|
-
r(M)[
|
|
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:
|
|
85
|
+
endDate: T(n, s)
|
|
87
86
|
}));
|
|
88
|
-
},
|
|
89
|
-
o || r(
|
|
90
|
-
},
|
|
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
|
-
},
|
|
91
|
+
}, H = (e) => {
|
|
93
92
|
e.target.closest("td") && (o = !1);
|
|
94
|
-
},
|
|
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
|
-
},
|
|
97
|
-
const t = e.week(),
|
|
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:
|
|
100
|
+
value: n,
|
|
102
101
|
date: e.startOf("week")
|
|
103
102
|
});
|
|
104
|
-
},
|
|
105
|
-
const
|
|
106
|
-
(
|
|
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",
|
|
109
|
-
},
|
|
110
|
-
const
|
|
111
|
-
if (!
|
|
112
|
-
const
|
|
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 =
|
|
113
|
+
const u = T(s, l);
|
|
115
114
|
switch (a.selectionMode) {
|
|
116
115
|
case "range": {
|
|
117
|
-
|
|
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
|
-
|
|
124
|
+
J(u);
|
|
126
125
|
break;
|
|
127
126
|
}
|
|
128
127
|
case "dates": {
|
|
129
|
-
|
|
128
|
+
Q(u, !!i.selected);
|
|
130
129
|
break;
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
|
-
},
|
|
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 && !
|
|
137
|
-
const
|
|
138
|
-
return a.parsedValue.subtract(
|
|
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:
|
|
142
|
+
WEEKS: j,
|
|
144
143
|
rows: M,
|
|
145
144
|
tbodyRef: y,
|
|
146
145
|
currentCellRef: b,
|
|
147
146
|
// cellMatchesDate,
|
|
148
147
|
// getDateOfCell,
|
|
149
|
-
focus:
|
|
148
|
+
focus: V,
|
|
150
149
|
isCurrent: W,
|
|
151
|
-
isWeekActive:
|
|
152
|
-
isSelectedCell:
|
|
153
|
-
handlePickDate:
|
|
154
|
-
handleMouseUp:
|
|
155
|
-
handleMouseDown:
|
|
156
|
-
handleMouseMove:
|
|
157
|
-
handleFocus:
|
|
150
|
+
isWeekActive: I,
|
|
151
|
+
isSelectedCell: B,
|
|
152
|
+
handlePickDate: E,
|
|
153
|
+
handleMouseUp: H,
|
|
154
|
+
handleMouseDown: G,
|
|
155
|
+
handleMouseMove: z,
|
|
156
|
+
handleFocus: U
|
|
158
157
|
};
|
|
159
|
-
},
|
|
158
|
+
}, ke = (a, {
|
|
160
159
|
isCurrent: f,
|
|
161
|
-
isWeekActive:
|
|
160
|
+
isWeekActive: D
|
|
162
161
|
}) => {
|
|
163
|
-
const
|
|
162
|
+
const y = te("date-table"), b = m(() => [
|
|
164
163
|
y.b(),
|
|
165
164
|
{ "is-week-mode": a.selectionMode === "week" }
|
|
166
|
-
]), g = m(() =>
|
|
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:
|
|
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
|
-
|
|
183
|
-
|
|
181
|
+
ye as useBasicDateTable,
|
|
182
|
+
ke as useBasicDateTableDOM
|
|
184
183
|
};
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { computed as a } from "vue";
|
|
2
|
-
|
|
3
|
-
const p = ({
|
|
2
|
+
const b = ({
|
|
4
3
|
unlinkPanels: u,
|
|
5
4
|
leftDate: e,
|
|
6
5
|
rightDate: r
|
|
7
6
|
}) => {
|
|
8
|
-
const
|
|
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
|
-
},
|
|
13
|
+
}, c = () => {
|
|
15
14
|
r.value = r.value.subtract(1, "year");
|
|
16
|
-
}, n = a(() => `${e.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:
|
|
19
|
-
rightNextYear:
|
|
20
|
-
leftNextYear:
|
|
21
|
-
rightPrevYear:
|
|
17
|
+
leftPrevYear: v,
|
|
18
|
+
rightNextYear: l,
|
|
19
|
+
leftNextYear: o,
|
|
20
|
+
rightPrevYear: c,
|
|
22
21
|
leftLabel: n,
|
|
23
|
-
rightLabel:
|
|
24
|
-
leftYear:
|
|
25
|
-
rightYear:
|
|
22
|
+
rightLabel: y,
|
|
23
|
+
leftYear: s,
|
|
24
|
+
rightYear: d
|
|
26
25
|
};
|
|
27
26
|
};
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
b as useMonthRangeHeader
|
|
30
29
|
};
|
|
@@ -1,47 +1,46 @@
|
|
|
1
|
-
import { ref as i, inject as
|
|
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 "
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
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(),
|
|
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,
|
|
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
|
|
27
|
-
r.value =
|
|
25
|
+
const I = r.value.year(n);
|
|
26
|
+
r.value = _(I, m.value, d);
|
|
28
27
|
}
|
|
29
|
-
e === "month" && (r.value =
|
|
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 || (
|
|
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
|
-
|
|
37
|
+
$(
|
|
39
38
|
"panel-change",
|
|
40
39
|
[c.value.toDate(), u.value.toDate()],
|
|
41
40
|
e
|
|
42
41
|
);
|
|
43
42
|
}
|
|
44
|
-
function
|
|
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:
|
|
54
|
-
rightYear:
|
|
52
|
+
leftYear: w,
|
|
53
|
+
rightYear: P,
|
|
55
54
|
leftMonth: C,
|
|
56
|
-
rightMonth:
|
|
57
|
-
leftYearLabel: o(() =>
|
|
55
|
+
rightMonth: L,
|
|
56
|
+
leftYearLabel: o(() => g(l, w)),
|
|
58
57
|
rightYearLabel: o(
|
|
59
|
-
() =>
|
|
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:
|
|
67
|
+
adjustDateByView: b
|
|
69
68
|
};
|
|
70
69
|
};
|
|
71
70
|
export {
|
|
72
|
-
|
|
71
|
+
D as usePanelDateRange
|
|
73
72
|
};
|