vft 0.0.89 → 0.0.91
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/attributes.json +1 -1
- package/es/comp-resolver.js +20 -29
- package/es/components/affix/affix.vue2.js +34 -34
- package/es/components/alert/alert.vue2.js +44 -44
- package/es/components/avatar/avatar.vue2.js +28 -28
- package/es/components/backtop/backtop.vue2.js +11 -11
- package/es/components/button/button-group.vue2.js +8 -8
- package/es/components/button/button.vue2.js +39 -39
- package/es/components/card/card.vue2.js +20 -20
- package/es/components/check-tag/check-tag.vue2.js +14 -14
- package/es/components/checkbox/checkbox-button.vue2.js +61 -61
- package/es/components/checkbox/checkbox-group.vue2.js +27 -27
- package/es/components/checkbox/checkbox.vue2.js +81 -81
- package/es/components/clamp/clamp.vue2.js +59 -59
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +25 -25
- package/es/components/col/col.vue2.js +33 -33
- package/es/components/color-picker/color-picker.vue2.js +126 -126
- package/es/components/color-picker/components/alpha-slider.vue2.js +12 -12
- package/es/components/config-provider/config-provider.vue2.js +29 -29
- package/es/components/container/aside.vue2.js +9 -9
- package/es/components/container/container.vue2.js +11 -11
- package/es/components/container/footer.vue2.js +8 -8
- package/es/components/container/header.vue2.js +9 -9
- package/es/components/context-menu/context-menu.vue2.js +29 -29
- package/es/components/date-picker/date-picker-com/basic-date-table.vue2.js +53 -53
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +19 -19
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +32 -32
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +168 -168
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +89 -89
- package/es/components/date-picker/date-picker-com/panel-month-range.vue2.js +38 -38
- package/es/components/descriptions/description-item.vue2.js +16 -16
- package/es/components/descriptions/description.vue2.js +54 -54
- package/es/components/descriptions/descriptions-row.vue2.js +24 -24
- package/es/components/dialog/dialog-content.vue2.js +30 -30
- package/es/components/dialog/dialog.vue2.js +64 -64
- package/es/components/divider/divider.vue2.js +20 -20
- package/es/components/dropdown/dropdown.vue.js +2 -127
- package/es/components/dropdown/dropdown.vue2.js +234 -181
- package/es/components/dropdown/index.js +10 -17
- package/es/components/dropdown/style/css.js +5 -0
- package/es/components/dropdown/style/index.js +5 -0
- package/es/components/dropdown/tokens.js +1 -1
- package/es/components/empty/empty.vue2.js +27 -27
- package/es/components/exception/exception.vue2.js +19 -19
- package/es/components/footer-layout/footer-layout.vue2.js +1 -1
- package/es/components/form/form-item.vue2.js +77 -77
- package/es/components/form/form.vue2.js +37 -37
- package/es/components/full-screen/full-screen.vue2.js +26 -15
- package/es/components/header-layout/header-layout.vue2.js +27 -27
- package/es/components/horizontal-menu/horizontal-menu.vue2.js +43 -43
- package/es/components/icon/icon.vue2.js +24 -24
- package/es/components/icon-text/icon-text.vue2.js +27 -27
- package/es/components/iframe-layout/iframe-layout.vue2.js +18 -18
- package/es/components/iframe-layout/iframe-page.vue2.js +11 -11
- package/es/components/image/image.vue2.js +73 -73
- package/es/components/image-viewer/image-viewer.vue2.js +109 -109
- package/es/components/index.js +145 -150
- package/es/components/input/input.vue2.js +175 -175
- package/es/components/link/link.vue2.js +27 -27
- package/es/components/list-cell/list-cell.vue2.js +8 -8
- package/es/components/logo/logo.vue2.js +27 -27
- package/es/components/md-container/md-container.vue2.js +1 -1
- package/es/components/md-vue-playground/md-vue-playground.vue2.js +16 -16
- package/es/components/menu/menu-item-group.vue2.js +15 -15
- package/es/components/menu/menu-item.vue2.js +56 -56
- package/es/components/menu/menu.vue2.js +20 -20
- package/es/components/menu/sub-menu.vue2.js +16 -16
- package/es/components/message/message.vue2.js +81 -81
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +12 -12
- package/es/components/multiple-tabs/tab-content.vue2.js +16 -16
- package/es/components/overlay/overlay.vue2.js +14 -14
- package/es/components/page-wrapper/page-wrapper.vue2.js +12 -12
- package/es/components/pagination/components/jumper.vue2.js +22 -22
- package/es/components/pagination/components/next.vue2.js +12 -12
- package/es/components/pagination/components/pager.vue2.js +75 -75
- package/es/components/pagination/components/prev.vue2.js +13 -13
- package/es/components/pagination/components/sizes.vue2.js +11 -11
- package/es/components/pagination/components/total.vue2.js +8 -8
- package/es/components/pagination/pagination.vue2.js +28 -28
- package/es/components/popconfirm/popconfirm.vue2.js +50 -50
- package/es/components/popover/popover.vue2.js +44 -44
- package/es/components/popper/arrow.vue2.js +2 -2
- package/es/components/popper/content.vue2.js +34 -34
- package/es/components/popper/popper.vue2.js +5 -5
- package/es/components/popper/trigger.vue2.js +48 -48
- package/es/components/qrcode/qrcode.vue2.js +35 -35
- package/es/components/radio/radio-button.vue2.js +28 -28
- package/es/components/radio/radio-group.vue2.js +26 -26
- package/es/components/radio/radio.vue2.js +44 -44
- package/es/components/result/result.vue2.js +10 -10
- package/es/components/router-view-content/router-view-content.vue2.js +20 -20
- package/es/components/row/row.vue2.js +19 -19
- package/es/components/scrollbar/bar.vue2.js +19 -19
- package/es/components/scrollbar/scrollbar.vue2.js +67 -67
- package/es/components/scrollbar/thumb.vue2.js +41 -41
- package/es/components/search/search.vue2.js +65 -65
- package/es/components/side-menu/side-menu.vue2.js +36 -36
- package/es/components/skeleton/skeleton-item.vue2.js +13 -13
- package/es/components/skeleton/skeleton.vue2.js +19 -19
- package/es/components/switch/switch.vue2.js +128 -128
- package/es/components/table/index.js +5 -3
- package/es/components/table/table.vue2.js +70 -70
- package/es/components/tabs/tab-bar.vue2.js +15 -15
- package/es/components/tabs/tab-nav.vue2.js +33 -33
- package/es/components/tabs/tab-pane.vue2.js +21 -21
- package/es/components/tabs/tabs.vue2.js +64 -66
- package/es/components/tag/tag.vue2.js +7 -7
- package/es/components/time-picker/common/picker.vue2.js +14 -14
- package/es/components/time-picker/time-picker-com/basic-time-spinner.vue2.js +60 -60
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +30 -30
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +57 -57
- package/es/components/time-select/time-select.vue2.js +29 -29
- package/es/components/tooltip/constants.js +1 -1
- package/es/components/tooltip/content.vue2.js +73 -73
- package/es/components/tooltip/tooltip.vue2.js +91 -91
- package/es/components/tooltip/trigger.vue2.js +33 -33
- package/es/components/verify-code/verify-code.vue2.js +25 -25
- package/es/index.js +208 -213
- package/es/package.json.js +1 -1
- package/lib/comp-resolver.cjs +1 -1
- package/lib/components/affix/affix.vue2.cjs +1 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/avatar/avatar.vue2.cjs +1 -1
- package/lib/components/backtop/backtop.vue2.cjs +1 -1
- package/lib/components/button/button-group.vue2.cjs +1 -1
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/card/card.vue2.cjs +1 -1
- package/lib/components/check-tag/check-tag.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-button.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-group.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox.vue2.cjs +1 -1
- package/lib/components/clamp/clamp.vue2.cjs +1 -1
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/col/col.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/color-picker/components/alpha-slider.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/container/aside.vue2.cjs +1 -1
- package/lib/components/container/container.vue2.cjs +1 -1
- package/lib/components/container/footer.vue2.cjs +1 -1
- package/lib/components/container/header.vue2.cjs +1 -1
- package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-date-table.vue2.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-picker/date-picker-com/panel-month-range.vue2.cjs +1 -1
- package/lib/components/descriptions/description-item.vue2.cjs +1 -1
- package/lib/components/descriptions/description.vue2.cjs +1 -1
- package/lib/components/descriptions/descriptions-row.vue2.cjs +1 -1
- package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
- package/lib/components/dialog/dialog.vue2.cjs +1 -1
- package/lib/components/divider/divider.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.cjs +1 -1
- package/lib/components/dropdown/style/css.cjs +1 -1
- package/lib/components/dropdown/style/index.cjs +1 -1
- package/lib/components/dropdown/tokens.cjs +1 -1
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/exception/exception.vue2.cjs +1 -1
- package/lib/components/footer-layout/footer-layout.vue2.cjs +1 -1
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/form/form.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
- package/lib/components/icon/icon.vue2.cjs +1 -1
- package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-page.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/input.vue2.cjs +1 -1
- package/lib/components/link/link.vue2.cjs +1 -1
- package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
- package/lib/components/logo/logo.vue2.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-vue-playground/md-vue-playground.vue2.cjs +1 -1
- package/lib/components/menu/menu-item-group.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/menu/menu.vue2.cjs +1 -1
- package/lib/components/menu/sub-menu.vue2.cjs +1 -1
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/tab-content.vue2.cjs +1 -1
- package/lib/components/overlay/overlay.vue2.cjs +1 -1
- package/lib/components/page-wrapper/page-wrapper.vue2.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/next.vue2.cjs +1 -1
- package/lib/components/pagination/components/pager.vue2.cjs +1 -1
- package/lib/components/pagination/components/prev.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/pagination/pagination.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/popover/popover.vue2.cjs +1 -1
- package/lib/components/popper/arrow.vue2.cjs +1 -1
- package/lib/components/popper/content.vue2.cjs +1 -1
- package/lib/components/popper/trigger.vue2.cjs +1 -1
- package/lib/components/qrcode/qrcode.vue2.cjs +1 -1
- package/lib/components/radio/radio-button.vue2.cjs +1 -1
- package/lib/components/radio/radio-group.vue2.cjs +1 -1
- package/lib/components/radio/radio.vue2.cjs +1 -1
- package/lib/components/result/result.vue2.cjs +1 -1
- package/lib/components/router-view-content/router-view-content.vue2.cjs +1 -1
- package/lib/components/row/row.vue2.cjs +1 -1
- package/lib/components/scrollbar/bar.vue2.cjs +1 -1
- package/lib/components/scrollbar/scrollbar.vue2.cjs +1 -1
- package/lib/components/scrollbar/thumb.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton.vue2.cjs +1 -1
- package/lib/components/switch/switch.vue2.cjs +1 -1
- package/lib/components/table/index.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/tabs/tab-bar.vue2.cjs +1 -1
- package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
- package/lib/components/tabs/tab-pane.vue2.cjs +1 -1
- package/lib/components/tabs/tabs.vue2.cjs +1 -1
- package/lib/components/tag/tag.vue2.cjs +1 -1
- package/lib/components/time-picker/common/picker.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/basic-time-spinner.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/time-select/time-select.vue2.cjs +1 -1
- package/lib/components/tooltip/constants.cjs +1 -1
- package/lib/components/tooltip/content.vue2.cjs +1 -1
- package/lib/components/tooltip/tooltip.vue2.cjs +1 -1
- package/lib/components/tooltip/trigger.vue2.cjs +1 -1
- package/lib/components/verify-code/verify-code.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/package.json +5 -5
- package/tags.json +1 -1
- package/web-types.json +1 -1
- package/theme-style/vft-back-top.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as o, computed as m, openBlock as n, createElementBlock as a, normalizeClass as i, unref as l, normalizeStyle as c, renderSlot as p } from "vue";
|
|
2
2
|
import { useNamespace as f } from "../../hooks/use-namespace/index.js";
|
|
3
3
|
import "@popperjs/core";
|
|
4
4
|
import "lodash";
|
|
@@ -9,20 +9,20 @@ import "../../utils/ns-cover.js";
|
|
|
9
9
|
const e = (
|
|
10
10
|
/* hoist-static*/
|
|
11
11
|
f("footer")
|
|
12
|
-
), h =
|
|
12
|
+
), h = o({
|
|
13
13
|
name: e.b()
|
|
14
|
-
}), S = /* @__PURE__ */
|
|
14
|
+
}), S = /* @__PURE__ */ o({
|
|
15
15
|
...h,
|
|
16
16
|
props: {
|
|
17
|
-
height:
|
|
17
|
+
height: {}
|
|
18
18
|
},
|
|
19
19
|
setup(t) {
|
|
20
|
-
const
|
|
20
|
+
const r = m(
|
|
21
21
|
() => t.height ? e.cssVarBlock({ height: u(t.height) }) : {}
|
|
22
22
|
);
|
|
23
|
-
return (s, d) => (
|
|
24
|
-
class:
|
|
25
|
-
style: c(
|
|
23
|
+
return (s, d) => (n(), a("footer", {
|
|
24
|
+
class: i(l(e).b()),
|
|
25
|
+
style: c(r.value)
|
|
26
26
|
}, [
|
|
27
27
|
p(s.$slots, "default")
|
|
28
28
|
], 6));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as o, computed as s, openBlock as a, createElementBlock as m, normalizeClass as i, unref as l, normalizeStyle as c, renderSlot as p } from "vue";
|
|
2
2
|
import { useNamespace as h } from "../../hooks/use-namespace/index.js";
|
|
3
3
|
import "@popperjs/core";
|
|
4
4
|
import "lodash";
|
|
@@ -9,22 +9,22 @@ import "../../utils/ns-cover.js";
|
|
|
9
9
|
const e = (
|
|
10
10
|
/* hoist-static*/
|
|
11
11
|
h("header")
|
|
12
|
-
), d =
|
|
12
|
+
), d = o({
|
|
13
13
|
name: e.b()
|
|
14
|
-
}), S = /* @__PURE__ */
|
|
14
|
+
}), S = /* @__PURE__ */ o({
|
|
15
15
|
...d,
|
|
16
16
|
props: {
|
|
17
|
-
height:
|
|
17
|
+
height: {}
|
|
18
18
|
},
|
|
19
19
|
setup(t) {
|
|
20
|
-
const
|
|
20
|
+
const r = s(() => t.height ? e.cssVarBlock({
|
|
21
21
|
height: u(t.height)
|
|
22
22
|
}) : {});
|
|
23
|
-
return (
|
|
24
|
-
class: i(
|
|
25
|
-
style: c(
|
|
23
|
+
return (n, f) => (a(), m("header", {
|
|
24
|
+
class: i(l(e).b()),
|
|
25
|
+
style: c(r.value)
|
|
26
26
|
}, [
|
|
27
|
-
p(
|
|
27
|
+
p(n.$slots, "default")
|
|
28
28
|
], 6));
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as f, ref as
|
|
1
|
+
import { defineComponent as f, ref as a, computed as k, openBlock as n, createBlock as d, Transition as b, withCtx as C, withDirectives as g, createElementVNode as u, normalizeStyle as z, withModifiers as M, normalizeClass as $, unref as l, createElementBlock as B, Fragment as E, renderList as S, vShow as A } from "vue";
|
|
2
2
|
import { useNamespace as F } from "../../hooks/use-namespace/index.js";
|
|
3
3
|
import "@popperjs/core";
|
|
4
4
|
import "lodash";
|
|
@@ -84,67 +84,67 @@ import "../md-vue-playground/index.js";
|
|
|
84
84
|
import "../md-code-demo/index.js";
|
|
85
85
|
import "../md-code-tabs/index.js";
|
|
86
86
|
import "../message/index.js";
|
|
87
|
-
const N = { class: "vft-sub-menu" },
|
|
87
|
+
const N = { class: "vft-sub-menu" }, v = (
|
|
88
88
|
/* hoist-static*/
|
|
89
89
|
F("context-menu")
|
|
90
90
|
), R = f({
|
|
91
|
-
name:
|
|
92
|
-
}),
|
|
91
|
+
name: v.b()
|
|
92
|
+
}), xo = /* @__PURE__ */ f({
|
|
93
93
|
...R,
|
|
94
94
|
props: {
|
|
95
|
-
axis:
|
|
96
|
-
styles:
|
|
97
|
-
width:
|
|
98
|
-
items:
|
|
95
|
+
axis: {},
|
|
96
|
+
styles: {},
|
|
97
|
+
width: {},
|
|
98
|
+
items: {}
|
|
99
99
|
},
|
|
100
|
-
setup(
|
|
101
|
-
let s =
|
|
102
|
-
const
|
|
103
|
-
const { x: t, y: o } =
|
|
100
|
+
setup(e) {
|
|
101
|
+
let s = a();
|
|
102
|
+
const x = k(() => {
|
|
103
|
+
const { x: t, y: o } = e.axis || { x: 0, y: 0 }, i = (e.items || []).length * 40, m = e.width || 0, p = document.body, w = p.clientWidth < t + m ? t - m : t, y = p.clientHeight < o + i ? o - i : o;
|
|
104
104
|
return {
|
|
105
105
|
zIndex: 3e3,
|
|
106
|
-
...
|
|
106
|
+
...e.styles,
|
|
107
107
|
position: "fixed",
|
|
108
|
-
width: `${
|
|
108
|
+
width: `${e.width}px`,
|
|
109
109
|
left: `${w + 1}px`,
|
|
110
110
|
top: `${y + 1}px`
|
|
111
111
|
};
|
|
112
112
|
});
|
|
113
|
-
let
|
|
113
|
+
let r = a(!1);
|
|
114
114
|
H(() => {
|
|
115
|
-
|
|
115
|
+
r.value = !0;
|
|
116
116
|
}, 0), I(s, () => {
|
|
117
|
-
|
|
117
|
+
r.value = !1;
|
|
118
118
|
}, {
|
|
119
119
|
listenerOptions: {
|
|
120
120
|
capture: !0
|
|
121
121
|
}
|
|
122
122
|
}), c(window, "scroll", () => {
|
|
123
|
-
|
|
123
|
+
r.value = !1;
|
|
124
124
|
}, {
|
|
125
125
|
capture: !0
|
|
126
126
|
}), c(window, "drag", () => {
|
|
127
|
-
|
|
127
|
+
r.value = !1;
|
|
128
128
|
}, {
|
|
129
129
|
capture: !0
|
|
130
130
|
});
|
|
131
131
|
function h(t) {
|
|
132
132
|
var o;
|
|
133
|
-
t != null && t.disabled || ((o = t.handler) == null || o.call(t),
|
|
133
|
+
t != null && t.disabled || ((o = t.handler) == null || o.call(t), r.value = !1);
|
|
134
134
|
}
|
|
135
|
-
return (t, o) => (
|
|
135
|
+
return (t, o) => (n(), d(b, { name: "vft-zoom-in-top" }, {
|
|
136
136
|
default: C(() => [
|
|
137
|
-
g(
|
|
137
|
+
g(u("div", {
|
|
138
138
|
ref_key: "contextMenuRef",
|
|
139
139
|
ref: s,
|
|
140
|
-
style: z(
|
|
140
|
+
style: z(x.value),
|
|
141
141
|
onClick: o[0] || (o[0] = M(() => {
|
|
142
142
|
}, ["stop"])),
|
|
143
|
-
class: $([
|
|
143
|
+
class: $([l(v).b(), "vft-menu"])
|
|
144
144
|
}, [
|
|
145
|
-
|
|
146
|
-
(
|
|
147
|
-
onClick: (
|
|
145
|
+
u("div", N, [
|
|
146
|
+
(n(!0), B(E, null, S(t.items, (i, m) => (n(), d(l(L), {
|
|
147
|
+
onClick: (p) => h(i),
|
|
148
148
|
index: m + i.text,
|
|
149
149
|
title: i.text,
|
|
150
150
|
divider: i.divider,
|
|
@@ -155,7 +155,7 @@ const N = { class: "vft-sub-menu" }, x = (
|
|
|
155
155
|
}, null, 8, ["onClick", "index", "title", "divider", "disabled", "icon"]))), 128))
|
|
156
156
|
])
|
|
157
157
|
], 6), [
|
|
158
|
-
[A,
|
|
158
|
+
[A, l(r)]
|
|
159
159
|
])
|
|
160
160
|
]),
|
|
161
161
|
_: 1
|
|
@@ -163,5 +163,5 @@ const N = { class: "vft-sub-menu" }, x = (
|
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
165
|
export {
|
|
166
|
-
|
|
166
|
+
xo as default
|
|
167
167
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ne, ref as y, computed as
|
|
1
|
+
import { defineComponent as ne, ref as y, computed as p, unref as m, watch as oe, nextTick as re, openBlock as l, createElementBlock as f, normalizeClass as M, withModifiers as ue, createElementVNode as $, createCommentVNode as ie, Fragment as C, renderList as O, toDisplayString as ce, createVNode as de } from "vue";
|
|
2
2
|
import j from "dayjs";
|
|
3
3
|
import { flatten as le } from "lodash";
|
|
4
4
|
import { useNamespace as fe } from "../../../hooks/use-namespace/index.js";
|
|
@@ -8,42 +8,42 @@ import "@vueuse/core";
|
|
|
8
8
|
import "@vft/utils";
|
|
9
9
|
import "../../../utils/ns-cover.js";
|
|
10
10
|
import { basicDateTableProps as pe } from "../props/basic-date-table.js";
|
|
11
|
-
import { castArray as
|
|
11
|
+
import { castArray as x, buildPickerTable as me } from "../utils.js";
|
|
12
12
|
import he from "./basic-cell-render.js";
|
|
13
13
|
const ye = ["onMousedown"], De = {
|
|
14
14
|
key: 0,
|
|
15
15
|
scope: "col"
|
|
16
|
-
}, ke = ["aria-label"],
|
|
16
|
+
}, ke = ["aria-label"], ve = ["aria-current", "aria-selected", "tabindex"], Re = /* @__PURE__ */ ne({
|
|
17
17
|
__name: "basic-date-table",
|
|
18
18
|
props: pe,
|
|
19
19
|
emits: ["changerange", "pick", "select"],
|
|
20
20
|
setup(L, { expose: z, emit: d }) {
|
|
21
|
-
const a = L,
|
|
22
|
-
let
|
|
23
|
-
const h = a.date.$locale().weekStart || 7, R = a.date.locale("en").localeData().weekdaysShort().map((e) => e.toLowerCase()),
|
|
21
|
+
const a = L, N = fe("date-table"), _ = y("zh-cn"), S = y(), k = y(), V = y(), E = y(), B = y([[], [], [], [], [], []]);
|
|
22
|
+
let v = !1;
|
|
23
|
+
const h = a.date.$locale().weekStart || 7, R = a.date.locale("en").localeData().weekdaysShort().map((e) => e.toLowerCase()), g = p(() => h > 3 ? 7 - h : -h), b = p(() => {
|
|
24
24
|
const e = a.date.startOf("month");
|
|
25
25
|
return e.subtract(e.day() || 7, "day");
|
|
26
|
-
}), U =
|
|
26
|
+
}), U = p(() => R.concat(R).slice(
|
|
27
27
|
h,
|
|
28
28
|
h + 7
|
|
29
|
-
)), W =
|
|
29
|
+
)), W = p(() => le(D.value).some((e) => e.isCurrent)), G = p(() => {
|
|
30
30
|
const e = a.date.startOf("month"), t = e.day() || 7, s = e.daysInMonth(), n = e.subtract(1, "month").daysInMonth();
|
|
31
31
|
return {
|
|
32
32
|
startOfMonthDay: t,
|
|
33
33
|
dateCountOfMonth: s,
|
|
34
34
|
dateCountOfLastMonth: n
|
|
35
35
|
};
|
|
36
|
-
}), K =
|
|
36
|
+
}), K = p(() => a.selectionMode === "dates" ? x(a.parsedValue) : []), q = (e, {
|
|
37
37
|
count: t,
|
|
38
38
|
rowIndex: s,
|
|
39
39
|
columnIndex: n
|
|
40
40
|
}) => {
|
|
41
|
-
const { startOfMonthDay:
|
|
41
|
+
const { startOfMonthDay: o, dateCountOfMonth: i, dateCountOfLastMonth: r } = m(G), c = m(g);
|
|
42
42
|
if (s >= 0 && s <= 1) {
|
|
43
|
-
const u =
|
|
43
|
+
const u = o + c < 0 ? 7 + o + c : o + c;
|
|
44
44
|
if (n + s * 7 >= u)
|
|
45
45
|
return e.text = t, !0;
|
|
46
|
-
e.text =
|
|
46
|
+
e.text = r - (u - n % 7) + 1 + s * 7, e.type = "prev-month";
|
|
47
47
|
} else
|
|
48
48
|
return t <= i ? e.text = t : (e.text = t - i, e.type = "next-month"), !0;
|
|
49
49
|
return !1;
|
|
@@ -51,42 +51,42 @@ const ye = ["onMousedown"], De = {
|
|
|
51
51
|
columnIndex: t,
|
|
52
52
|
rowIndex: s
|
|
53
53
|
}, n) => {
|
|
54
|
-
const { disabledDate:
|
|
55
|
-
return e.selected =
|
|
54
|
+
const { disabledDate: o, cellClassName: i } = a, r = m(K), c = q(e, { count: n, rowIndex: s, columnIndex: t }), u = e.dayjs.toDate();
|
|
55
|
+
return e.selected = r.find(
|
|
56
56
|
(se) => se.valueOf() === e.dayjs.valueOf()
|
|
57
|
-
), e.isSelected = !!e.selected, e.isCurrent = A(e), e.disabled =
|
|
57
|
+
), e.isSelected = !!e.selected, e.isCurrent = A(e), e.disabled = o == null ? void 0 : o(u), e.customClass = i == null ? void 0 : i(u), c;
|
|
58
58
|
}, J = (e) => {
|
|
59
59
|
if (a.selectionMode === "week") {
|
|
60
60
|
const [t, s] = a.showWeekNumber ? [1, 7] : [0, 6], n = F(e[t + 1]);
|
|
61
61
|
e[t].inRange = n, e[t].start = n, e[s].inRange = n, e[s].end = n;
|
|
62
62
|
}
|
|
63
|
-
}, D =
|
|
64
|
-
const { minDate: e, maxDate: t, rangeState: s, showWeekNumber: n } = a,
|
|
63
|
+
}, D = p(() => {
|
|
64
|
+
const { minDate: e, maxDate: t, rangeState: s, showWeekNumber: n } = a, o = g.value, i = B.value, r = "day";
|
|
65
65
|
let c = 1;
|
|
66
66
|
if (n)
|
|
67
67
|
for (let u = 0; u < 6; u++)
|
|
68
68
|
i[u][0] || (i[u][0] = {
|
|
69
69
|
type: "week",
|
|
70
|
-
text: b.value.add(u * 7 + 1,
|
|
70
|
+
text: b.value.add(u * 7 + 1, r).week()
|
|
71
71
|
});
|
|
72
72
|
return me({ row: 6, column: 7 }, i, {
|
|
73
73
|
startDate: e,
|
|
74
74
|
columnIndexOffset: n ? 1 : 0,
|
|
75
75
|
nextEndDate: s.endDate || t || s.selecting && e || null,
|
|
76
|
-
now: j().locale(
|
|
77
|
-
unit:
|
|
78
|
-
relativeDateGetter: (u) => b.value.add(u -
|
|
76
|
+
now: j().locale(m(_)).startOf(r),
|
|
77
|
+
unit: r,
|
|
78
|
+
relativeDateGetter: (u) => b.value.add(u - o, r),
|
|
79
79
|
setCellMetadata: (...u) => {
|
|
80
80
|
H(...u, c) && (c += 1);
|
|
81
81
|
},
|
|
82
82
|
setRowMetadata: J
|
|
83
83
|
}), i;
|
|
84
84
|
});
|
|
85
|
-
|
|
85
|
+
oe(
|
|
86
86
|
() => a.date,
|
|
87
87
|
async () => {
|
|
88
88
|
var e, t;
|
|
89
|
-
(e = S.value) != null && e.contains(document.activeElement) && (await
|
|
89
|
+
(e = S.value) != null && e.contains(document.activeElement) && (await re(), (t = k.value) == null || t.focus());
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
const Q = async () => {
|
|
@@ -96,14 +96,14 @@ const ye = ["onMousedown"], De = {
|
|
|
96
96
|
const t = [];
|
|
97
97
|
return w(e.type) && !e.disabled ? (t.push("available"), e.type === "today" && t.push("today")) : t.push(e.type), A(e) && t.push("current"), e.inRange && (w(e.type) || a.selectionMode === "week") && (t.push("in-range"), e.start && t.push("start-date"), e.end && t.push("end-date")), e.disabled && t.push("disabled"), e.selected && t.push("selected"), e.customClass && t.push(e.customClass), t.join(" ");
|
|
98
98
|
}, I = (e, t) => {
|
|
99
|
-
const s = e * 7 + (t - (a.showWeekNumber ? 1 : 0)) -
|
|
99
|
+
const s = e * 7 + (t - (a.showWeekNumber ? 1 : 0)) - g.value;
|
|
100
100
|
return b.value.add(s, "day");
|
|
101
101
|
}, Z = (e) => {
|
|
102
|
-
var
|
|
102
|
+
var o;
|
|
103
103
|
if (!a.rangeState.selecting)
|
|
104
104
|
return;
|
|
105
105
|
let t = e.target;
|
|
106
|
-
if (t.tagName === "SPAN" && (t = (
|
|
106
|
+
if (t.tagName === "SPAN" && (t = (o = t.parentNode) == null ? void 0 : o.parentNode), t.tagName === "DIV" && (t = t.parentNode), t.tagName !== "TD")
|
|
107
107
|
return;
|
|
108
108
|
const s = t.parentNode.rowIndex - 1, n = t.cellIndex;
|
|
109
109
|
D.value[s][n].disabled || (s !== V.value || n !== E.value) && (V.value = s, E.value = n, d("changerange", {
|
|
@@ -111,35 +111,35 @@ const ye = ["onMousedown"], De = {
|
|
|
111
111
|
endDate: I(s, n)
|
|
112
112
|
}));
|
|
113
113
|
}, T = (e) => !W.value && (e == null ? void 0 : e.text) === 1 && e.type === "normal" || e.isCurrent, ee = (e) => {
|
|
114
|
-
|
|
114
|
+
v || W.value || a.selectionMode !== "date" || P(e, !0);
|
|
115
115
|
}, te = (e) => {
|
|
116
|
-
e.target.closest("td") && (
|
|
116
|
+
e.target.closest("td") && (v = !0);
|
|
117
117
|
}, ae = (e) => {
|
|
118
|
-
e.target.closest("td") && (
|
|
118
|
+
e.target.closest("td") && (v = !1);
|
|
119
119
|
}, P = (e, t = !1) => {
|
|
120
120
|
const s = e.target.closest("td");
|
|
121
121
|
if (!s)
|
|
122
122
|
return;
|
|
123
|
-
const n = s.parentNode.rowIndex - 1,
|
|
123
|
+
const n = s.parentNode.rowIndex - 1, o = s.cellIndex, i = D.value[n][o];
|
|
124
124
|
if (i.disabled || i.type === "week")
|
|
125
125
|
return;
|
|
126
|
-
const
|
|
126
|
+
const r = I(n, o);
|
|
127
127
|
if (a.selectionMode === "range")
|
|
128
|
-
!a.rangeState.selecting || !a.minDate ? (d("pick", { minDate:
|
|
128
|
+
!a.rangeState.selecting || !a.minDate ? (d("pick", { minDate: r, maxDate: null }), d("select", !0)) : (r >= a.minDate ? d("pick", { minDate: a.minDate, maxDate: r }) : d("pick", { minDate: r, maxDate: a.minDate }), d("select", !1));
|
|
129
129
|
else if (a.selectionMode === "date")
|
|
130
|
-
d("pick",
|
|
130
|
+
d("pick", r, t);
|
|
131
131
|
else if (a.selectionMode === "week") {
|
|
132
|
-
const c =
|
|
132
|
+
const c = r.week(), u = `${r.year()}w${c}`;
|
|
133
133
|
d("pick", {
|
|
134
|
-
year:
|
|
134
|
+
year: r.year(),
|
|
135
135
|
week: c,
|
|
136
136
|
value: u,
|
|
137
|
-
date:
|
|
137
|
+
date: r.startOf("week")
|
|
138
138
|
});
|
|
139
139
|
} else if (a.selectionMode === "dates") {
|
|
140
|
-
const c = i.selected ?
|
|
141
|
-
(u) => (u == null ? void 0 : u.valueOf()) !==
|
|
142
|
-
) :
|
|
140
|
+
const c = i.selected ? x(a.parsedValue).filter(
|
|
141
|
+
(u) => (u == null ? void 0 : u.valueOf()) !== r.valueOf()
|
|
142
|
+
) : x(a.parsedValue).concat([r]);
|
|
143
143
|
d("pick", c);
|
|
144
144
|
}
|
|
145
145
|
}, F = (e) => {
|
|
@@ -157,12 +157,12 @@ const ye = ["onMousedown"], De = {
|
|
|
157
157
|
* @description focus on current cell
|
|
158
158
|
*/
|
|
159
159
|
focus: Q
|
|
160
|
-
}), (e, t) => (
|
|
160
|
+
}), (e, t) => (l(), f("table", {
|
|
161
161
|
role: "grid",
|
|
162
162
|
"aria-label": "使用方向鍵與 Enter 鍵以選擇日期",
|
|
163
163
|
cellspacing: "0",
|
|
164
164
|
cellpadding: "0",
|
|
165
|
-
class: M([
|
|
165
|
+
class: M([m(N).b(), { "is-week-mode": e.selectionMode === "week" }]),
|
|
166
166
|
onClick: P,
|
|
167
167
|
onMousemove: Z,
|
|
168
168
|
onMousedown: ue(te, ["prevent"]),
|
|
@@ -173,29 +173,29 @@ const ye = ["onMousedown"], De = {
|
|
|
173
173
|
ref: S
|
|
174
174
|
}, [
|
|
175
175
|
$("tr", null, [
|
|
176
|
-
e.showWeekNumber ? (
|
|
177
|
-
(
|
|
176
|
+
e.showWeekNumber ? (l(), f("th", De, "周")) : ie("", !0),
|
|
177
|
+
(l(!0), f(C, null, O(U.value, (s, n) => (l(), f("th", {
|
|
178
178
|
key: n,
|
|
179
179
|
scope: "col",
|
|
180
180
|
"aria-label": "星期" + s
|
|
181
181
|
}, ce(s), 9, ke))), 128))
|
|
182
182
|
]),
|
|
183
|
-
(
|
|
183
|
+
(l(!0), f(C, null, O(D.value, (s, n) => (l(), f("tr", {
|
|
184
184
|
key: n,
|
|
185
|
-
class: M([
|
|
185
|
+
class: M([m(N).e("row"), { current: F(s[1]) }])
|
|
186
186
|
}, [
|
|
187
|
-
(
|
|
187
|
+
(l(!0), f(C, null, O(s, (o, i) => (l(), f("td", {
|
|
188
188
|
key: `${n}.${i}`,
|
|
189
189
|
ref_for: !0,
|
|
190
|
-
ref: (
|
|
191
|
-
class: M(Y(
|
|
192
|
-
"aria-current":
|
|
193
|
-
"aria-selected":
|
|
194
|
-
tabindex: T(
|
|
190
|
+
ref: (r) => T(o) && (k.value = r),
|
|
191
|
+
class: M(Y(o)),
|
|
192
|
+
"aria-current": o.isCurrent ? "date" : void 0,
|
|
193
|
+
"aria-selected": o.isCurrent,
|
|
194
|
+
tabindex: T(o) ? 0 : -1,
|
|
195
195
|
onFocus: ee
|
|
196
196
|
}, [
|
|
197
|
-
de(
|
|
198
|
-
], 42,
|
|
197
|
+
de(m(he), { cell: o }, null, 8, ["cell"])
|
|
198
|
+
], 42, ve))), 128))
|
|
199
199
|
], 2))), 128))
|
|
200
200
|
], 512)
|
|
201
201
|
], 42, ye));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as P, ref as f, computed as j, watch as Y, nextTick as $, openBlock as u, createElementBlock as p, normalizeClass as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as P, ref as f, computed as j, watch as Y, nextTick as $, openBlock as u, createElementBlock as p, normalizeClass as C, unref as N, createElementVNode as g, Fragment as O, renderList as M, withKeys as I, withModifiers as R, toDisplayString as q } from "vue";
|
|
2
|
+
import b from "dayjs";
|
|
3
3
|
import { useNamespace as G } from "../../../hooks/use-namespace/index.js";
|
|
4
4
|
import "@popperjs/core";
|
|
5
5
|
import "lodash";
|
|
@@ -18,9 +18,9 @@ const W = ["aria-selected", "tabindex", "onKeydown"], X = { class: "cell" }, pe
|
|
|
18
18
|
emits: ["changerange", "pick", "select"],
|
|
19
19
|
setup(A, { expose: E, emit: d }) {
|
|
20
20
|
const e = A, B = (a, t, o) => {
|
|
21
|
-
const r =
|
|
21
|
+
const r = b().locale(o).startOf("month").month(t).year(a), n = r.daysInMonth();
|
|
22
22
|
return U(n).map((s) => r.add(s, "day").toDate());
|
|
23
|
-
}, K = G("month-table"),
|
|
23
|
+
}, K = G("month-table"), x = f("zh-cn"), v = f(), h = f();
|
|
24
24
|
f(
|
|
25
25
|
e.date.locale("en").localeData().monthsShort().map((a) => a.toLowerCase())
|
|
26
26
|
);
|
|
@@ -28,9 +28,9 @@ const W = ["aria-selected", "tabindex", "onKeydown"], X = { class: "cell" }, pe
|
|
|
28
28
|
[],
|
|
29
29
|
[],
|
|
30
30
|
[]
|
|
31
|
-
]),
|
|
31
|
+
]), w = f(), S = f(), k = j(() => {
|
|
32
32
|
var o, r;
|
|
33
|
-
const a = V.value, t =
|
|
33
|
+
const a = V.value, t = b().locale(x.value).startOf("month");
|
|
34
34
|
for (let n = 0; n < 3; n++) {
|
|
35
35
|
const s = a[n];
|
|
36
36
|
for (let i = 0; i < 4; i++) {
|
|
@@ -45,8 +45,8 @@ const W = ["aria-selected", "tabindex", "onKeydown"], X = { class: "cell" }, pe
|
|
|
45
45
|
disabled: !1
|
|
46
46
|
});
|
|
47
47
|
c.type = "normal";
|
|
48
|
-
const
|
|
49
|
-
c.inRange = !!(e.minDate && l.isSameOrAfter(e.minDate, "month") && m && l.isSameOrBefore(m, "month")) || !!(e.minDate && l.isSameOrBefore(e.minDate, "month") && m && l.isSameOrAfter(m, "month")), (o = e.minDate) != null && o.isSameOrAfter(m) ? (c.start = !!(m && l.isSame(m, "month")), c.end = e.minDate && l.isSame(e.minDate, "month")) : (c.start = !!(e.minDate && l.isSame(e.minDate, "month")), c.end = !!(m && l.isSame(m, "month"))), t.isSame(l) && (c.type = "today"), c.text =
|
|
48
|
+
const _ = n * 4 + i, l = e.date.startOf("year").month(_), m = e.rangeState.endDate || e.maxDate || e.rangeState.selecting && e.minDate || null;
|
|
49
|
+
c.inRange = !!(e.minDate && l.isSameOrAfter(e.minDate, "month") && m && l.isSameOrBefore(m, "month")) || !!(e.minDate && l.isSameOrBefore(e.minDate, "month") && m && l.isSameOrAfter(m, "month")), (o = e.minDate) != null && o.isSameOrAfter(m) ? (c.start = !!(m && l.isSame(m, "month")), c.end = e.minDate && l.isSame(e.minDate, "month")) : (c.start = !!(e.minDate && l.isSame(e.minDate, "month")), c.end = !!(m && l.isSame(m, "month"))), t.isSame(l) && (c.type = "today"), c.text = _, c.disabled = ((r = e.disabledDate) == null ? void 0 : r.call(e, l.toDate())) || !1;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return a;
|
|
@@ -55,8 +55,8 @@ const W = ["aria-selected", "tabindex", "onKeydown"], X = { class: "cell" }, pe
|
|
|
55
55
|
(a = h.value) == null || a.focus();
|
|
56
56
|
}, F = (a) => {
|
|
57
57
|
const t = {}, o = e.date.year(), r = /* @__PURE__ */ new Date(), n = a.text;
|
|
58
|
-
return t.disabled = e.disabledDate ? B(o, n,
|
|
59
|
-
(s) =>
|
|
58
|
+
return t.disabled = e.disabledDate ? B(o, n, x.value).every(e.disabledDate) : !1, t.current = T(e.parsedValue).findIndex(
|
|
59
|
+
(s) => b.isDayjs(s) && s.year() === o && s.month() === n
|
|
60
60
|
) >= 0, t.today = r.getFullYear() === o && r.getMonth() === n, a.inRange && (t["in-range"] = !0, a.start && (t["start-date"] = !0), a.end && (t["end-date"] = !0)), t;
|
|
61
61
|
}, D = (a) => {
|
|
62
62
|
const t = e.date.year(), o = a.text;
|
|
@@ -71,7 +71,7 @@ const W = ["aria-selected", "tabindex", "onKeydown"], X = { class: "cell" }, pe
|
|
|
71
71
|
if (t.tagName === "A" && (t = (n = t.parentNode) == null ? void 0 : n.parentNode), t.tagName === "DIV" && (t = t.parentNode), t.tagName !== "TD")
|
|
72
72
|
return;
|
|
73
73
|
const o = t.parentNode.rowIndex, r = t.cellIndex;
|
|
74
|
-
|
|
74
|
+
k.value[o][r].disabled || (o !== w.value || r !== S.value) && (w.value = o, S.value = r, d("changerange", {
|
|
75
75
|
selecting: !0,
|
|
76
76
|
endDate: e.date.startOf("year").month(o * 4 + r)
|
|
77
77
|
}));
|
|
@@ -89,7 +89,7 @@ const W = ["aria-selected", "tabindex", "onKeydown"], X = { class: "cell" }, pe
|
|
|
89
89
|
() => e.date,
|
|
90
90
|
async () => {
|
|
91
91
|
var a, t;
|
|
92
|
-
(a =
|
|
92
|
+
(a = v.value) != null && a.contains(document.activeElement) && (await $(), (t = h.value) == null || t.focus());
|
|
93
93
|
}
|
|
94
94
|
), E({
|
|
95
95
|
/**
|
|
@@ -99,20 +99,20 @@ const W = ["aria-selected", "tabindex", "onKeydown"], X = { class: "cell" }, pe
|
|
|
99
99
|
}), (a, t) => (u(), p("table", {
|
|
100
100
|
role: "grid",
|
|
101
101
|
"aria-label": "使用方向鍵與 Enter 鍵以選擇月份",
|
|
102
|
-
class: N(
|
|
102
|
+
class: C(N(K).b()),
|
|
103
103
|
onClick: y,
|
|
104
104
|
onMousemove: L
|
|
105
105
|
}, [
|
|
106
|
-
|
|
106
|
+
g("tbody", {
|
|
107
107
|
ref_key: "tbodyRef",
|
|
108
|
-
ref:
|
|
108
|
+
ref: v
|
|
109
109
|
}, [
|
|
110
|
-
(u(!0), p(O, null, M(
|
|
110
|
+
(u(!0), p(O, null, M(k.value, (o, r) => (u(), p("tr", { key: r }, [
|
|
111
111
|
(u(!0), p(O, null, M(o, (n, s) => (u(), p("td", {
|
|
112
112
|
key: s,
|
|
113
113
|
ref_for: !0,
|
|
114
114
|
ref: (i) => D(n) && (h.value = i),
|
|
115
|
-
class:
|
|
115
|
+
class: C(F(n)),
|
|
116
116
|
"aria-selected": `${D(n)}`,
|
|
117
117
|
tabindex: D(n) ? 0 : -1,
|
|
118
118
|
onKeydown: [
|
|
@@ -120,8 +120,8 @@ const W = ["aria-selected", "tabindex", "onKeydown"], X = { class: "cell" }, pe
|
|
|
120
120
|
I(R(y, ["prevent", "stop"]), ["enter"])
|
|
121
121
|
]
|
|
122
122
|
}, [
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
g("div", null, [
|
|
124
|
+
g("span", X, q(N(Q)["month" + (n.text + 1)]), 1)
|
|
125
125
|
])
|
|
126
126
|
], 42, W))), 128))
|
|
127
127
|
]))), 128))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { castArray as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as N, ref as f, computed as R, watch as S, nextTick as z, openBlock as l, createElementBlock as c, normalizeClass as _, unref as A, createElementVNode as p, Fragment as m, renderList as k, withKeys as g, withModifiers as h, toDisplayString as B } from "vue";
|
|
2
|
+
import { castArray as x } from "../utils.js";
|
|
3
|
+
import C from "dayjs";
|
|
4
4
|
import { useNamespace as M } from "../../../hooks/use-namespace/index.js";
|
|
5
5
|
import "@popperjs/core";
|
|
6
6
|
import "lodash";
|
|
@@ -11,67 +11,67 @@ import "../../../utils/ns-cover.js";
|
|
|
11
11
|
import "../../time-picker/index.js";
|
|
12
12
|
import { basicYearTableProps as F } from "../props/basic-year-table.js";
|
|
13
13
|
import { rangeArr as L } from "../../time-picker/utils.js";
|
|
14
|
-
const P = ["aria-selected", "tabindex", "onKeydown"], $ = { class: "cell" }, q = { key: 1 }, oe = /* @__PURE__ */
|
|
14
|
+
const P = ["aria-selected", "tabindex", "onKeydown"], $ = { class: "cell" }, q = { key: 1 }, oe = /* @__PURE__ */ N({
|
|
15
15
|
__name: "basic-year-table",
|
|
16
16
|
props: F,
|
|
17
17
|
emits: ["pick"],
|
|
18
|
-
setup(
|
|
19
|
-
const n =
|
|
20
|
-
const r =
|
|
21
|
-
return L(
|
|
22
|
-
},
|
|
18
|
+
setup(D, { expose: w, emit: T }) {
|
|
19
|
+
const n = D, Y = (e, t) => {
|
|
20
|
+
const r = C(String(e)).locale(t).startOf("year"), v = r.endOf("year").dayOfYear();
|
|
21
|
+
return L(v).map((o) => r.add(o, "day").toDate());
|
|
22
|
+
}, E = M("year-table"), y = f("zh-cn"), b = f(), d = f(), s = R(() => Math.floor(n.date.year() / 10) * 10), K = () => {
|
|
23
23
|
var e;
|
|
24
|
-
(e =
|
|
25
|
-
},
|
|
26
|
-
const t = {}, r =
|
|
27
|
-
return t.disabled = n.disabledDate ?
|
|
28
|
-
},
|
|
24
|
+
(e = d.value) == null || e.focus();
|
|
25
|
+
}, O = (e) => {
|
|
26
|
+
const t = {}, r = C().locale(y.value);
|
|
27
|
+
return t.disabled = n.disabledDate ? Y(e, y.value).every(n.disabledDate) : !1, t.current = x(n.parsedValue).findIndex((a) => a.year() === e) >= 0, t.today = r.year() === e, t;
|
|
28
|
+
}, i = (e) => e === s.value && n.date.year() < s.value && n.date.year() > s.value + 9 || x(n.date).findIndex((t) => t.year() === e) >= 0, u = (e) => {
|
|
29
29
|
const r = e.target.closest("td");
|
|
30
30
|
if (r && r.textContent) {
|
|
31
31
|
if (V(r, "disabled"))
|
|
32
32
|
return;
|
|
33
33
|
const a = r.textContent || r.innerText;
|
|
34
|
-
|
|
34
|
+
T("pick", Number(a));
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
return
|
|
37
|
+
return S(
|
|
38
38
|
() => n.date,
|
|
39
39
|
async () => {
|
|
40
40
|
var e, t;
|
|
41
|
-
(e =
|
|
41
|
+
(e = b.value) != null && e.contains(document.activeElement) && (await z(), (t = d.value) == null || t.focus());
|
|
42
42
|
}
|
|
43
|
-
),
|
|
43
|
+
), w({
|
|
44
44
|
/**
|
|
45
45
|
* @description focus on the current cell
|
|
46
46
|
*/
|
|
47
|
-
focus:
|
|
47
|
+
focus: K
|
|
48
48
|
}), (e, t) => (l(), c("table", {
|
|
49
49
|
role: "grid",
|
|
50
50
|
"aria-label": "使用方向鍵與 Enter 鍵以選擇年份",
|
|
51
|
-
class:
|
|
52
|
-
onClick:
|
|
51
|
+
class: _(A(E).b()),
|
|
52
|
+
onClick: u
|
|
53
53
|
}, [
|
|
54
|
-
|
|
54
|
+
p("tbody", {
|
|
55
55
|
ref_key: "tbodyRef",
|
|
56
|
-
ref:
|
|
56
|
+
ref: b
|
|
57
57
|
}, [
|
|
58
|
-
(l(), c(
|
|
59
|
-
(l(), c(
|
|
58
|
+
(l(), c(m, null, k(3, (r, a) => p("tr", { key: a }, [
|
|
59
|
+
(l(), c(m, null, k(4, (v, o) => (l(), c(m, {
|
|
60
60
|
key: a + "_" + o
|
|
61
61
|
}, [
|
|
62
62
|
a * 4 + o < 10 ? (l(), c("td", {
|
|
63
63
|
key: 0,
|
|
64
64
|
ref_for: !0,
|
|
65
|
-
ref: (
|
|
66
|
-
class:
|
|
67
|
-
"aria-selected": `${
|
|
68
|
-
tabindex:
|
|
65
|
+
ref: (I) => i(s.value + a * 4 + o) && (d.value = I),
|
|
66
|
+
class: _(["available", O(s.value + a * 4 + o)]),
|
|
67
|
+
"aria-selected": `${i(s.value + a * 4 + o)}`,
|
|
68
|
+
tabindex: i(s.value + a * 4 + o) ? 0 : -1,
|
|
69
69
|
onKeydown: [
|
|
70
|
-
h(
|
|
71
|
-
h(
|
|
70
|
+
g(h(u, ["prevent", "stop"]), ["space"]),
|
|
71
|
+
g(h(u, ["prevent", "stop"]), ["enter"])
|
|
72
72
|
]
|
|
73
73
|
}, [
|
|
74
|
-
|
|
74
|
+
p("span", $, B(s.value + a * 4 + o), 1)
|
|
75
75
|
], 42, P)) : (l(), c("td", q))
|
|
76
76
|
], 64))), 64))
|
|
77
77
|
])), 64))
|