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