@varlet/ui 2.16.7 → 2.16.8-alpha.1695118057982
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/es/action-sheet/ActionSheet.mjs +97 -67
- package/es/action-sheet/index.mjs +43 -28
- package/es/action-sheet/props.mjs +39 -8
- package/es/app-bar/AppBar.mjs +129 -56
- package/es/app-bar/index.mjs +10 -5
- package/es/app-bar/props.mjs +6 -3
- package/es/avatar/Avatar.mjs +97 -87
- package/es/avatar/index.mjs +10 -5
- package/es/avatar/props.mjs +8 -5
- package/es/avatar-group/AvatarGroup.mjs +26 -20
- package/es/avatar-group/index.mjs +10 -5
- package/es/avatar-group/props.mjs +5 -2
- package/es/back-top/BackTop.mjs +71 -53
- package/es/back-top/index.mjs +10 -5
- package/es/back-top/props.mjs +6 -3
- package/es/badge/Badge.mjs +74 -46
- package/es/badge/index.mjs +10 -5
- package/es/badge/props.mjs +7 -4
- package/es/bottom-navigation/BottomNavigation.mjs +100 -97
- package/es/bottom-navigation/index.mjs +10 -5
- package/es/bottom-navigation/props.mjs +7 -4
- package/es/bottom-navigation/provide.mjs +13 -9
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +93 -74
- package/es/bottom-navigation-item/index.mjs +10 -5
- package/es/bottom-navigation-item/props.mjs +7 -4
- package/es/bottom-navigation-item/provide.mjs +14 -11
- package/es/breadcrumb/Breadcrumb.mjs +51 -36
- package/es/breadcrumb/index.mjs +10 -5
- package/es/breadcrumb/props.mjs +6 -3
- package/es/breadcrumb/provide.mjs +12 -11
- package/es/breadcrumbs/Breadcrumbs.mjs +26 -24
- package/es/breadcrumbs/index.mjs +10 -5
- package/es/breadcrumbs/props.mjs +6 -3
- package/es/breadcrumbs/provide.mjs +11 -9
- package/es/button/Button.mjs +88 -90
- package/es/button/index.mjs +10 -5
- package/es/button/props.mjs +31 -10
- package/es/button/provide.mjs +8 -9
- package/es/button-group/ButtonGroup.mjs +38 -26
- package/es/button-group/index.mjs +8 -4
- package/es/button-group/props.mjs +8 -5
- package/es/button-group/provide.mjs +9 -9
- package/es/card/Card.mjs +292 -189
- package/es/card/index.mjs +10 -5
- package/es/card/props.mjs +9 -6
- package/es/cell/Cell.mjs +96 -52
- package/es/cell/index.mjs +10 -5
- package/es/cell/props.mjs +6 -3
- package/es/checkbox/Checkbox.mjs +136 -130
- package/es/checkbox/index.mjs +10 -5
- package/es/checkbox/props.mjs +9 -6
- package/es/checkbox/provide.mjs +10 -9
- package/es/checkbox-group/CheckboxGroup.mjs +63 -96
- package/es/checkbox-group/index.mjs +10 -5
- package/es/checkbox-group/props.mjs +9 -6
- package/es/checkbox-group/provide.mjs +11 -9
- package/es/chip/Chip.mjs +66 -50
- package/es/chip/index.mjs +10 -5
- package/es/chip/props.mjs +10 -7
- package/es/col/Col.mjs +60 -55
- package/es/col/index.mjs +10 -5
- package/es/col/props.mjs +7 -4
- package/es/col/provide.mjs +8 -9
- package/es/collapse/Collapse.mjs +70 -73
- package/es/collapse/index.mjs +10 -5
- package/es/collapse/props.mjs +7 -4
- package/es/collapse/provide.mjs +11 -9
- package/es/collapse-item/CollapseItem.mjs +156 -93
- package/es/collapse-item/index.mjs +10 -5
- package/es/collapse-item/props.mjs +6 -3
- package/es/collapse-item/provide.mjs +12 -11
- package/es/context/index.mjs +9 -5
- package/es/context/lock.mjs +18 -22
- package/es/context/zIndex.mjs +19 -16
- package/es/countdown/Countdown.mjs +73 -70
- package/es/countdown/index.mjs +10 -5
- package/es/countdown/props.mjs +7 -4
- package/es/counter/Counter.mjs +169 -173
- package/es/counter/index.mjs +10 -5
- package/es/counter/props.mjs +8 -5
- package/es/counter/provide.ts +3 -0
- package/es/date-picker/DatePicker.mjs +411 -304
- package/es/date-picker/index.mjs +10 -5
- package/es/date-picker/props.mjs +71 -45
- package/es/date-picker/src/day-picker-panel.mjs +270 -208
- package/es/date-picker/src/month-picker-panel.mjs +205 -175
- package/es/date-picker/src/panel-header.mjs +101 -83
- package/es/date-picker/src/year-picker-panel.mjs +64 -54
- package/es/dialog/Dialog.mjs +171 -106
- package/es/dialog/index.mjs +49 -33
- package/es/dialog/props.mjs +39 -9
- package/es/divider/Divider.mjs +56 -51
- package/es/divider/index.mjs +10 -5
- package/es/divider/props.mjs +5 -2
- package/es/drag/Drag.mjs +126 -144
- package/es/drag/index.mjs +10 -5
- package/es/drag/props.mjs +8 -5
- package/es/ellipsis/Ellipsis.mjs +81 -50
- package/es/ellipsis/index.mjs +8 -4
- package/es/ellipsis/props.mjs +5 -2
- package/es/fab/Fab.mjs +73 -75
- package/es/fab/index.mjs +8 -4
- package/es/fab/props.mjs +14 -11
- package/es/field-decorator/FieldDecorator.mjs +215 -110
- package/es/field-decorator/props.mjs +9 -6
- package/es/form/Form.mjs +69 -79
- package/es/form/index.mjs +11 -6
- package/es/form/props.mjs +6 -3
- package/es/form/provide.mjs +35 -22
- package/es/form-details/FormDetails.mjs +81 -39
- package/es/form-details/index.mjs +10 -5
- package/es/form-details/props.mjs +7 -4
- package/es/hover/index.mjs +37 -40
- package/es/hover-overlay/HoverOverlay.mjs +18 -14
- package/es/hover-overlay/index.mjs +13 -8
- package/es/hover-overlay/props.mjs +5 -2
- package/es/icon/Icon.mjs +50 -33
- package/es/icon/index.mjs +10 -5
- package/es/icon/props.mjs +7 -4
- package/es/image/Image.mjs +76 -82
- package/es/image/index.mjs +10 -5
- package/es/image/props.mjs +7 -4
- package/es/image-preview/ImagePreview.mjs +176 -193
- package/es/image-preview/index.mjs +44 -30
- package/es/image-preview/props.mjs +34 -9
- package/es/index-anchor/IndexAnchor.mjs +45 -42
- package/es/index-anchor/index.mjs +10 -5
- package/es/index-anchor/props.mjs +5 -2
- package/es/index-anchor/provide.mjs +12 -11
- package/es/index-bar/IndexBar.mjs +130 -131
- package/es/index-bar/index.mjs +10 -5
- package/es/index-bar/props.mjs +6 -3
- package/es/index-bar/provide.mjs +11 -9
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +231 -247
- package/es/input/index.mjs +10 -5
- package/es/input/props.mjs +38 -8
- package/es/input/provide.ts +3 -0
- package/es/lazy/index.mjs +94 -87
- package/es/link/Link.mjs +39 -45
- package/es/link/index.mjs +10 -5
- package/es/link/props.mjs +8 -5
- package/es/list/List.mjs +144 -97
- package/es/list/index.mjs +10 -5
- package/es/list/props.mjs +8 -5
- package/es/list/provide.mjs +8 -9
- package/es/loading/Loading.mjs +165 -72
- package/es/loading/index.mjs +10 -5
- package/es/loading/props.mjs +7 -4
- package/es/loading-bar/LoadingBar.mjs +19 -16
- package/es/loading-bar/index.mjs +37 -30
- package/es/loading-bar/props.mjs +5 -2
- package/es/locale/en-US.mjs +76 -73
- package/es/locale/index.mjs +52 -41
- package/es/locale/zh-CN.mjs +76 -73
- package/es/menu/Menu.mjs +76 -57
- package/es/menu/index.mjs +10 -5
- package/es/menu/props.mjs +11 -8
- package/es/menu/usePopover.mjs +214 -207
- package/es/option/Option.mjs +86 -70
- package/es/option/index.mjs +10 -5
- package/es/option/props.mjs +5 -2
- package/es/option/provide.mjs +10 -11
- package/es/overlay/Overlay.mjs +29 -31
- package/es/overlay/index.mjs +10 -5
- package/es/overlay/props.mjs +7 -4
- package/es/pagination/Pagination.mjs +334 -202
- package/es/pagination/index.mjs +10 -5
- package/es/pagination/props.mjs +8 -5
- package/es/paper/Paper.mjs +43 -31
- package/es/paper/index.mjs +10 -5
- package/es/paper/props.mjs +6 -3
- package/es/picker/Picker.mjs +288 -224
- package/es/picker/index.mjs +24 -23
- package/es/picker/props.mjs +37 -7
- package/es/popup/Popup.mjs +68 -58
- package/es/popup/index.mjs +10 -5
- package/es/popup/props.mjs +9 -6
- package/es/popup/provide.mjs +12 -15
- package/es/progress/Progress.mjs +186 -114
- package/es/progress/index.mjs +10 -5
- package/es/progress/props.mjs +7 -4
- package/es/pull-refresh/PullRefresh.mjs +136 -116
- package/es/pull-refresh/index.mjs +10 -5
- package/es/pull-refresh/props.mjs +8 -5
- package/es/radio/Radio.mjs +122 -118
- package/es/radio/index.mjs +10 -5
- package/es/radio/props.mjs +8 -5
- package/es/radio/provide.mjs +8 -9
- package/es/radio-group/RadioGroup.mjs +50 -58
- package/es/radio-group/index.mjs +10 -5
- package/es/radio-group/props.mjs +10 -7
- package/es/radio-group/provide.mjs +11 -9
- package/es/rate/Rate.mjs +103 -132
- package/es/rate/index.mjs +10 -5
- package/es/rate/props.mjs +10 -7
- package/es/rate/provide.ts +3 -0
- package/es/result/Empty.mjs +21 -12
- package/es/result/Error.mjs +18 -9
- package/es/result/Info.mjs +18 -9
- package/es/result/Question.mjs +18 -9
- package/es/result/Result.mjs +102 -55
- package/es/result/Success.mjs +84 -40
- package/es/result/Warning.mjs +18 -9
- package/es/result/index.mjs +10 -5
- package/es/result/props.mjs +6 -3
- package/es/ripple/index.mjs +89 -101
- package/es/row/Row.mjs +40 -45
- package/es/row/index.mjs +10 -5
- package/es/row/props.mjs +8 -5
- package/es/row/provide.mjs +9 -9
- package/es/select/Select.mjs +308 -298
- package/es/select/index.mjs +10 -5
- package/es/select/props.mjs +40 -10
- package/es/select/provide.mjs +9 -9
- package/es/skeleton/Skeleton.mjs +182 -71
- package/es/skeleton/index.mjs +10 -5
- package/es/skeleton/props.mjs +5 -2
- package/es/slider/Slider.mjs +310 -260
- package/es/slider/index.mjs +10 -5
- package/es/slider/props.mjs +15 -11
- package/es/slider/provide.ts +3 -0
- package/es/snackbar/Snackbar.mjs +47 -34
- package/es/snackbar/core.mjs +140 -77
- package/es/snackbar/index.mjs +111 -97
- package/es/snackbar/props.mjs +35 -14
- package/es/space/Space.mjs +30 -28
- package/es/space/index.mjs +10 -5
- package/es/space/margin.mjs +22 -23
- package/es/space/props.mjs +8 -5
- package/es/step/Step.mjs +96 -74
- package/es/step/index.mjs +10 -5
- package/es/step/props.mjs +6 -3
- package/es/step/provide.mjs +10 -11
- package/es/steps/Steps.mjs +31 -30
- package/es/steps/index.mjs +10 -5
- package/es/steps/props.mjs +7 -4
- package/es/steps/provide.mjs +9 -8
- package/es/sticky/Sticky.mjs +104 -92
- package/es/sticky/index.mjs +10 -5
- package/es/sticky/props.mjs +6 -3
- package/es/style-provider/StyleProvider.mjs +19 -18
- package/es/style-provider/index.mjs +15 -11
- package/es/style-provider/props.mjs +6 -3
- package/es/swipe/Swipe.mjs +281 -268
- package/es/swipe/index.mjs +10 -5
- package/es/swipe/props.mjs +6 -3
- package/es/swipe/provide.mjs +11 -9
- package/es/swipe-item/SwipeItem.mjs +29 -29
- package/es/swipe-item/index.mjs +8 -4
- package/es/swipe-item/provide.mjs +10 -11
- package/es/switch/Switch.mjs +143 -103
- package/es/switch/index.mjs +10 -5
- package/es/switch/props.mjs +7 -4
- package/es/switch/provide.ts +3 -0
- package/es/tab/Tab.mjs +48 -61
- package/es/tab/index.mjs +10 -5
- package/es/tab/props.mjs +6 -3
- package/es/tab/provide.mjs +10 -11
- package/es/tab-item/TabItem.mjs +27 -32
- package/es/tab-item/index.mjs +10 -5
- package/es/tab-item/props.mjs +5 -2
- package/es/tab-item/provide.mjs +17 -18
- package/es/table/Table.mjs +54 -25
- package/es/table/index.mjs +10 -5
- package/es/table/props.mjs +6 -3
- package/es/tabs/Tabs.mjs +162 -134
- package/es/tabs/index.mjs +10 -5
- package/es/tabs/props.mjs +15 -12
- package/es/tabs/provide.mjs +9 -9
- package/es/tabs-items/TabsItems.mjs +61 -65
- package/es/tabs-items/index.mjs +10 -5
- package/es/tabs-items/props.mjs +7 -4
- package/es/tabs-items/provide.mjs +11 -9
- package/es/themes/dark/actionSheet.mjs +8 -5
- package/es/themes/dark/appBar.mjs +6 -3
- package/es/themes/dark/avatar.mjs +7 -4
- package/es/themes/dark/badge.mjs +6 -3
- package/es/themes/dark/bottomNavigation.mjs +7 -4
- package/es/themes/dark/bottomNavigationItem.mjs +6 -3
- package/es/themes/dark/breadcrumb.mjs +6 -3
- package/es/themes/dark/button.mjs +7 -4
- package/es/themes/dark/card.mjs +10 -7
- package/es/themes/dark/cell.mjs +7 -4
- package/es/themes/dark/checkbox.mjs +7 -4
- package/es/themes/dark/chip.mjs +7 -4
- package/es/themes/dark/collapse.mjs +8 -5
- package/es/themes/dark/countdown.mjs +6 -3
- package/es/themes/dark/datePicker.mjs +10 -7
- package/es/themes/dark/dialog.mjs +8 -5
- package/es/themes/dark/divider.mjs +7 -4
- package/es/themes/dark/fieldDecorator.mjs +7 -4
- package/es/themes/dark/index.mjs +69 -51
- package/es/themes/dark/link.mjs +6 -3
- package/es/themes/dark/menu.mjs +6 -3
- package/es/themes/dark/option.mjs +6 -3
- package/es/themes/dark/pagination.mjs +11 -8
- package/es/themes/dark/paper.mjs +6 -3
- package/es/themes/dark/picker.mjs +11 -8
- package/es/themes/dark/popup.mjs +6 -3
- package/es/themes/dark/progress.mjs +6 -3
- package/es/themes/dark/pullRefresh.mjs +6 -3
- package/es/themes/dark/radio.mjs +7 -4
- package/es/themes/dark/result.mjs +12 -9
- package/es/themes/dark/select.mjs +6 -3
- package/es/themes/dark/skeleton.mjs +11 -6
- package/es/themes/dark/steps.mjs +8 -5
- package/es/themes/dark/switch.mjs +7 -4
- package/es/themes/dark/tab.mjs +6 -3
- package/es/themes/dark/table.mjs +12 -9
- package/es/themes/dark/tabs.mjs +6 -3
- package/es/themes/dark/timePicker.mjs +9 -6
- package/es/themes/dark/uploader.mjs +10 -7
- package/es/themes/dark/watermark.mjs +6 -3
- package/es/themes/index.mjs +7 -5
- package/es/time-picker/TimePicker.mjs +297 -232
- package/es/time-picker/clock.mjs +222 -172
- package/es/time-picker/index.mjs +10 -5
- package/es/time-picker/props.mjs +14 -8
- package/es/time-picker/utils.mjs +46 -86
- package/es/tooltip/Tooltip.mjs +82 -62
- package/es/tooltip/index.mjs +10 -5
- package/es/tooltip/props.mjs +12 -9
- package/es/uploader/Uploader.mjs +315 -308
- package/es/uploader/index.mjs +10 -5
- package/es/uploader/props.mjs +10 -7
- package/es/uploader/provide.ts +3 -0
- package/es/utils/components.mjs +158 -127
- package/es/utils/elements.mjs +106 -123
- package/es/utils/logger.mjs +9 -5
- package/es/utils/shared.mjs +25 -23
- package/es/utils/test.mjs +105 -93
- package/es/varlet.esm.js +12464 -13425
- package/es/watermark/Watermark.mjs +191 -109
- package/es/watermark/index.mjs +8 -4
- package/es/watermark/props.mjs +8 -5
- package/highlight/web-types.en-US.json +3 -3
- package/highlight/web-types.zh-CN.json +2 -2
- package/lib/varlet.cjs.js +9187 -10199
- package/package.json +7 -7
- package/umd/varlet.js +4 -4
- package/es/counter/provide.mjs +0 -1
- package/es/input/provide.mjs +0 -1
- package/es/rate/provide.mjs +0 -1
- package/es/slider/provide.mjs +0 -1
- package/es/switch/provide.mjs +0 -1
- package/es/uploader/provide.mjs +0 -1
|
@@ -1,76 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import dayjs from "dayjs/esm";
|
|
18
|
+
import isSameOrBefore from "dayjs/esm/plugin/isSameOrBefore";
|
|
19
|
+
import isSameOrAfter from "dayjs/esm/plugin/isSameOrAfter";
|
|
20
|
+
import PanelHeader from "./panel-header.mjs";
|
|
21
|
+
import VarButton from "../../button/index.mjs";
|
|
22
|
+
import {
|
|
23
|
+
defineComponent,
|
|
24
|
+
ref,
|
|
25
|
+
computed,
|
|
26
|
+
watch,
|
|
27
|
+
reactive
|
|
28
|
+
} from "vue";
|
|
29
|
+
import {
|
|
30
|
+
WEEK_HEADER
|
|
31
|
+
} from "../props.mjs";
|
|
32
|
+
import { toNumber } from "@varlet/shared";
|
|
33
|
+
import { createNamespace } from "../../utils/components.mjs";
|
|
34
|
+
import { pack } from "../../locale/index.mjs";
|
|
35
|
+
import { onSmartMounted } from "@varlet/use";
|
|
13
36
|
dayjs.extend(isSameOrBefore);
|
|
14
37
|
dayjs.extend(isSameOrAfter);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
classes
|
|
18
|
-
} = createNamespace('day-picker');
|
|
19
|
-
var {
|
|
20
|
-
n: nDate
|
|
21
|
-
} = createNamespace('date-picker');
|
|
38
|
+
const { n, classes } = createNamespace("day-picker");
|
|
39
|
+
const { n: nDate } = createNamespace("date-picker");
|
|
22
40
|
import { resolveComponent as _resolveComponent, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, mergeProps as _mergeProps, withCtx as _withCtx, Transition as _Transition } from "vue";
|
|
23
41
|
function __render__(_ctx, _cache) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return _openBlock(), _createElementBlock(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
42
|
+
const _component_panel_header = _resolveComponent("panel-header");
|
|
43
|
+
const _component_var_button = _resolveComponent("var-button");
|
|
44
|
+
return _openBlock(), _createElementBlock(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
class: _normalizeClass(_ctx.n())
|
|
48
|
+
},
|
|
49
|
+
[
|
|
50
|
+
_createElementVNode(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
class: _normalizeClass(_ctx.n("content"))
|
|
54
|
+
},
|
|
55
|
+
[
|
|
56
|
+
_createVNode(_component_panel_header, {
|
|
57
|
+
ref: "headerEl",
|
|
58
|
+
type: "day",
|
|
59
|
+
date: _ctx.preview,
|
|
60
|
+
disabled: _ctx.panelBtnDisabled,
|
|
61
|
+
onCheckPanel: _ctx.clickMonth,
|
|
62
|
+
onCheckDate: _ctx.checkDate
|
|
63
|
+
}, null, 8, ["date", "disabled", "onCheckPanel", "onCheckDate"]),
|
|
64
|
+
_createVNode(_Transition, {
|
|
65
|
+
name: `${_ctx.nDate()}${_ctx.reverse ? "-reverse" : ""}-translatex`
|
|
66
|
+
}, {
|
|
67
|
+
default: _withCtx(() => [
|
|
68
|
+
(_openBlock(), _createElementBlock("div", { key: _ctx.panelKey }, [
|
|
69
|
+
_createElementVNode(
|
|
70
|
+
"ul",
|
|
71
|
+
{
|
|
72
|
+
class: _normalizeClass(_ctx.n("head"))
|
|
73
|
+
},
|
|
74
|
+
[
|
|
75
|
+
(_openBlock(true), _createElementBlock(
|
|
76
|
+
_Fragment,
|
|
77
|
+
null,
|
|
78
|
+
_renderList(_ctx.sortWeekList, (week) => {
|
|
79
|
+
return _openBlock(), _createElementBlock(
|
|
80
|
+
"li",
|
|
81
|
+
{
|
|
82
|
+
key: week.index
|
|
83
|
+
},
|
|
84
|
+
_toDisplayString(_ctx.getDayAbbr(week.index)),
|
|
85
|
+
1
|
|
86
|
+
/* TEXT */
|
|
87
|
+
);
|
|
88
|
+
}),
|
|
89
|
+
128
|
|
90
|
+
/* KEYED_FRAGMENT */
|
|
91
|
+
))
|
|
92
|
+
],
|
|
93
|
+
2
|
|
94
|
+
/* CLASS */
|
|
95
|
+
),
|
|
96
|
+
_createElementVNode(
|
|
97
|
+
"ul",
|
|
98
|
+
{
|
|
99
|
+
class: _normalizeClass(_ctx.n("body"))
|
|
100
|
+
},
|
|
101
|
+
[
|
|
102
|
+
(_openBlock(true), _createElementBlock(
|
|
103
|
+
_Fragment,
|
|
104
|
+
null,
|
|
105
|
+
_renderList(_ctx.days, (day, index) => {
|
|
106
|
+
return _openBlock(), _createElementBlock("li", { key: index }, [
|
|
107
|
+
_createVNode(_component_var_button, _mergeProps({
|
|
108
|
+
type: "primary",
|
|
109
|
+
"var-day-picker-cover": "",
|
|
110
|
+
round: "",
|
|
111
|
+
ripple: false,
|
|
112
|
+
elevation: _ctx.componentProps.buttonElevation
|
|
113
|
+
}, __spreadValues({}, _ctx.buttonProps(day)), {
|
|
114
|
+
onClick: (event) => _ctx.chooseDay(day, event)
|
|
115
|
+
}), {
|
|
116
|
+
default: _withCtx(() => [
|
|
117
|
+
_createTextVNode(
|
|
118
|
+
_toDisplayString(_ctx.filterDay(day)),
|
|
119
|
+
1
|
|
120
|
+
/* TEXT */
|
|
121
|
+
)
|
|
122
|
+
]),
|
|
123
|
+
_: 2
|
|
124
|
+
/* DYNAMIC */
|
|
125
|
+
}, 1040, ["elevation", "onClick"])
|
|
126
|
+
]);
|
|
127
|
+
}),
|
|
128
|
+
128
|
|
129
|
+
/* KEYED_FRAGMENT */
|
|
130
|
+
))
|
|
131
|
+
],
|
|
132
|
+
2
|
|
133
|
+
/* CLASS */
|
|
134
|
+
)
|
|
135
|
+
]))
|
|
136
|
+
]),
|
|
137
|
+
_: 1
|
|
138
|
+
/* STABLE */
|
|
139
|
+
}, 8, ["name"])
|
|
140
|
+
],
|
|
141
|
+
2
|
|
142
|
+
/* CLASS */
|
|
143
|
+
)
|
|
144
|
+
],
|
|
145
|
+
2
|
|
146
|
+
/* CLASS */
|
|
147
|
+
);
|
|
70
148
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
name: 'DayPickerPanel',
|
|
149
|
+
const __sfc__ = defineComponent({
|
|
150
|
+
name: "DayPickerPanel",
|
|
74
151
|
components: {
|
|
75
152
|
VarButton,
|
|
76
153
|
PanelHeader
|
|
@@ -97,197 +174,179 @@ var __sfc__ = defineComponent({
|
|
|
97
174
|
required: true
|
|
98
175
|
}
|
|
99
176
|
},
|
|
100
|
-
emits: [
|
|
101
|
-
setup(props,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
var panelKey = ref(0);
|
|
109
|
-
var headerEl = ref(null);
|
|
110
|
-
var panelBtnDisabled = reactive({
|
|
177
|
+
emits: ["check-preview", "choose-day"],
|
|
178
|
+
setup(props, { emit }) {
|
|
179
|
+
const [currentYear, currentMonth, currentDay] = props.current.split("-");
|
|
180
|
+
const days = ref([]);
|
|
181
|
+
const reverse = ref(false);
|
|
182
|
+
const panelKey = ref(0);
|
|
183
|
+
const headerEl = ref(null);
|
|
184
|
+
const panelBtnDisabled = reactive({
|
|
111
185
|
left: false,
|
|
112
186
|
right: false
|
|
113
187
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
188
|
+
const isCurrent = computed(
|
|
189
|
+
() => props.preview.previewYear === currentYear && props.preview.previewMonth.index === currentMonth
|
|
190
|
+
);
|
|
191
|
+
const isSame = computed(
|
|
192
|
+
() => {
|
|
193
|
+
var _a;
|
|
194
|
+
return props.choose.chooseYear === props.preview.previewYear && ((_a = props.choose.chooseMonth) == null ? void 0 : _a.index) === props.preview.previewMonth.index;
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
const sortWeekList = computed(() => {
|
|
198
|
+
const index = WEEK_HEADER.findIndex((week) => week.index === props.componentProps.firstDayOfWeek);
|
|
199
|
+
if (index === -1 || index === 0)
|
|
200
|
+
return WEEK_HEADER;
|
|
122
201
|
return WEEK_HEADER.slice(index).concat(WEEK_HEADER.slice(0, index));
|
|
123
202
|
});
|
|
124
|
-
|
|
125
|
-
var
|
|
126
|
-
return (
|
|
203
|
+
const getDayAbbr = (key) => {
|
|
204
|
+
var _a, _b;
|
|
205
|
+
return (_b = (_a = pack.value.datePickerWeekDict) == null ? void 0 : _a[key].abbr) != null ? _b : "";
|
|
127
206
|
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
preview: {
|
|
132
|
-
previewMonth,
|
|
133
|
-
previewYear
|
|
134
|
-
}
|
|
207
|
+
const filterDay = (day) => day > 0 ? day : "";
|
|
208
|
+
const initDate = () => {
|
|
209
|
+
const {
|
|
210
|
+
preview: { previewMonth, previewYear }
|
|
135
211
|
} = props;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
days.value = [...Array(index).fill(-1), ...Array.from(Array(monthNum + 1).keys())].filter(value => value);
|
|
212
|
+
const monthNum = dayjs(`${previewYear}-${previewMonth.index}`).daysInMonth();
|
|
213
|
+
const firstDayToWeek = dayjs(`${previewYear}-${previewMonth.index}-01`).day();
|
|
214
|
+
const index = sortWeekList.value.findIndex((week) => week.index === `${firstDayToWeek}`);
|
|
215
|
+
days.value = [...Array(index).fill(-1), ...Array.from(Array(monthNum + 1).keys())].filter((value) => value);
|
|
140
216
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
preview: {
|
|
144
|
-
|
|
145
|
-
previewMonth
|
|
146
|
-
},
|
|
147
|
-
componentProps: {
|
|
148
|
-
max,
|
|
149
|
-
min
|
|
150
|
-
}
|
|
217
|
+
const initHeader = () => {
|
|
218
|
+
const {
|
|
219
|
+
preview: { previewYear, previewMonth },
|
|
220
|
+
componentProps: { max, min }
|
|
151
221
|
} = props;
|
|
152
222
|
if (max) {
|
|
153
|
-
|
|
154
|
-
panelBtnDisabled.right = !dayjs(date).isSameOrBefore(dayjs(max),
|
|
223
|
+
const date = `${previewYear}-${toNumber(previewMonth.index) + 1}`;
|
|
224
|
+
panelBtnDisabled.right = !dayjs(date).isSameOrBefore(dayjs(max), "month");
|
|
155
225
|
}
|
|
156
226
|
if (min) {
|
|
157
|
-
|
|
158
|
-
panelBtnDisabled.left = !dayjs(
|
|
227
|
+
const date = `${previewYear}-${toNumber(previewMonth.index) - 1}`;
|
|
228
|
+
panelBtnDisabled.left = !dayjs(date).isSameOrAfter(dayjs(min), "month");
|
|
159
229
|
}
|
|
160
230
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
preview: {
|
|
164
|
-
|
|
165
|
-
previewMonth
|
|
166
|
-
},
|
|
167
|
-
componentProps: {
|
|
168
|
-
min,
|
|
169
|
-
max
|
|
170
|
-
}
|
|
231
|
+
const inRange = (day) => {
|
|
232
|
+
const {
|
|
233
|
+
preview: { previewYear, previewMonth },
|
|
234
|
+
componentProps: { min, max }
|
|
171
235
|
} = props;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
if (max)
|
|
176
|
-
|
|
236
|
+
let isBeforeMax = true;
|
|
237
|
+
let isAfterMin = true;
|
|
238
|
+
const previewDate = `${previewYear}-${previewMonth.index}-${day}`;
|
|
239
|
+
if (max)
|
|
240
|
+
isBeforeMax = dayjs(previewDate).isSameOrBefore(dayjs(max), "day");
|
|
241
|
+
if (min)
|
|
242
|
+
isAfterMin = dayjs(previewDate).isSameOrAfter(dayjs(min), "day");
|
|
177
243
|
return isBeforeMax && isAfterMin;
|
|
178
244
|
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
choose: {
|
|
182
|
-
|
|
183
|
-
chooseRangeDay
|
|
184
|
-
},
|
|
185
|
-
componentProps: {
|
|
186
|
-
range
|
|
187
|
-
}
|
|
245
|
+
const shouldChoose = (val) => {
|
|
246
|
+
const {
|
|
247
|
+
choose: { chooseDays, chooseRangeDay },
|
|
248
|
+
componentProps: { range }
|
|
188
249
|
} = props;
|
|
189
250
|
if (range) {
|
|
190
|
-
if (!chooseRangeDay.length)
|
|
191
|
-
|
|
192
|
-
|
|
251
|
+
if (!chooseRangeDay.length)
|
|
252
|
+
return false;
|
|
253
|
+
const isBeforeMax = dayjs(val).isSameOrBefore(dayjs(chooseRangeDay[1]), "day");
|
|
254
|
+
const isAfterMin = dayjs(val).isSameOrAfter(dayjs(chooseRangeDay[0]), "day");
|
|
193
255
|
return isBeforeMax && isAfterMin;
|
|
194
256
|
}
|
|
195
257
|
return chooseDays.includes(val);
|
|
196
258
|
};
|
|
197
|
-
|
|
259
|
+
const buttonProps = (day) => {
|
|
198
260
|
if (day < 0) {
|
|
199
261
|
return {
|
|
200
262
|
text: true,
|
|
201
263
|
outline: false,
|
|
202
|
-
textColor:
|
|
203
|
-
class: n(
|
|
264
|
+
textColor: "",
|
|
265
|
+
class: n("button"),
|
|
204
266
|
disabled: true
|
|
205
267
|
};
|
|
206
268
|
}
|
|
207
|
-
|
|
208
|
-
choose: {
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
preview: {
|
|
212
|
-
previewYear,
|
|
213
|
-
previewMonth
|
|
214
|
-
},
|
|
215
|
-
componentProps: {
|
|
216
|
-
allowedDates,
|
|
217
|
-
color,
|
|
218
|
-
multiple,
|
|
219
|
-
range
|
|
220
|
-
}
|
|
269
|
+
const {
|
|
270
|
+
choose: { chooseDay: chooseDay2 },
|
|
271
|
+
preview: { previewYear, previewMonth },
|
|
272
|
+
componentProps: { allowedDates, color, multiple, range }
|
|
221
273
|
} = props;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (range || multiple)
|
|
225
|
-
|
|
274
|
+
const val = `${previewYear}-${previewMonth.index}-${day}`;
|
|
275
|
+
const dayExist = () => {
|
|
276
|
+
if (range || multiple)
|
|
277
|
+
return shouldChoose(val);
|
|
278
|
+
return toNumber(chooseDay2) === day && isSame.value;
|
|
226
279
|
};
|
|
227
|
-
|
|
228
|
-
if (!inRange(day))
|
|
229
|
-
|
|
280
|
+
const computeDisabled = () => {
|
|
281
|
+
if (!inRange(day))
|
|
282
|
+
return true;
|
|
283
|
+
if (!allowedDates)
|
|
284
|
+
return false;
|
|
230
285
|
return !allowedDates(val);
|
|
231
286
|
};
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (disabled)
|
|
235
|
-
|
|
236
|
-
|
|
287
|
+
const disabled = computeDisabled();
|
|
288
|
+
const computeText = () => {
|
|
289
|
+
if (disabled)
|
|
290
|
+
return true;
|
|
291
|
+
if (range || multiple)
|
|
292
|
+
return !shouldChoose(val);
|
|
293
|
+
return !isSame.value || toNumber(chooseDay2) !== day;
|
|
237
294
|
};
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
if (
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
// 同一年但是未被选择的情况
|
|
249
|
-
if (isSame.value) return chooseDay !== currentDay;
|
|
295
|
+
const computeOutline = () => {
|
|
296
|
+
if (!(isCurrent.value && toNumber(currentDay) === day && props.componentProps.showCurrent))
|
|
297
|
+
return false;
|
|
298
|
+
if ((range || multiple || isSame.value) && disabled)
|
|
299
|
+
return true;
|
|
300
|
+
if (range || multiple)
|
|
301
|
+
return !shouldChoose(val);
|
|
302
|
+
if (isSame.value)
|
|
303
|
+
return chooseDay2 !== currentDay;
|
|
250
304
|
return true;
|
|
251
305
|
};
|
|
252
|
-
|
|
253
|
-
if (disabled)
|
|
254
|
-
|
|
255
|
-
if (
|
|
256
|
-
|
|
306
|
+
const textColorOrCover = () => {
|
|
307
|
+
if (disabled)
|
|
308
|
+
return "";
|
|
309
|
+
if (computeOutline())
|
|
310
|
+
return color != null ? color : "";
|
|
311
|
+
if (dayExist())
|
|
312
|
+
return "";
|
|
313
|
+
return `${nDate()}-color-cover`;
|
|
257
314
|
};
|
|
258
|
-
|
|
315
|
+
const isCover = textColorOrCover().startsWith(nDate());
|
|
259
316
|
return {
|
|
260
317
|
text: computeText(),
|
|
261
318
|
outline: computeOutline(),
|
|
262
|
-
textColor: isCover ?
|
|
263
|
-
[nDate()
|
|
264
|
-
class: classes(n(
|
|
319
|
+
textColor: isCover ? "" : textColorOrCover(),
|
|
320
|
+
[`${nDate()}-color-cover`]: isCover,
|
|
321
|
+
class: classes(n("button"), n("button--usable"), [disabled, n("button--disabled")]),
|
|
265
322
|
disabled
|
|
266
323
|
};
|
|
267
324
|
};
|
|
268
|
-
|
|
269
|
-
reverse.value = checkType ===
|
|
270
|
-
panelKey.value += checkType ===
|
|
271
|
-
emit(
|
|
325
|
+
const checkDate = (checkType) => {
|
|
326
|
+
reverse.value = checkType === "prev";
|
|
327
|
+
panelKey.value += checkType === "prev" ? -1 : 1;
|
|
328
|
+
emit("check-preview", "month", checkType);
|
|
272
329
|
};
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
if (buttonEl.classList.contains(n(
|
|
276
|
-
|
|
330
|
+
const chooseDay = (day, event) => {
|
|
331
|
+
const buttonEl = event.currentTarget;
|
|
332
|
+
if (buttonEl.classList.contains(n("button--disabled")))
|
|
333
|
+
return;
|
|
334
|
+
emit("choose-day", day);
|
|
277
335
|
};
|
|
278
|
-
|
|
279
|
-
// expose for internal
|
|
280
|
-
var forwardRef = checkType => {
|
|
336
|
+
const forwardRef = (checkType) => {
|
|
281
337
|
headerEl.value.checkDate(checkType);
|
|
282
338
|
};
|
|
283
339
|
onSmartMounted(() => {
|
|
284
340
|
initDate();
|
|
285
341
|
initHeader();
|
|
286
342
|
});
|
|
287
|
-
watch(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
343
|
+
watch(
|
|
344
|
+
() => props.preview,
|
|
345
|
+
() => {
|
|
346
|
+
initDate();
|
|
347
|
+
initHeader();
|
|
348
|
+
}
|
|
349
|
+
);
|
|
291
350
|
return {
|
|
292
351
|
n,
|
|
293
352
|
nDate,
|
|
@@ -307,4 +366,7 @@ var __sfc__ = defineComponent({
|
|
|
307
366
|
}
|
|
308
367
|
});
|
|
309
368
|
__sfc__.render = __render__;
|
|
310
|
-
|
|
369
|
+
var stdin_default = __sfc__;
|
|
370
|
+
export {
|
|
371
|
+
stdin_default as default
|
|
372
|
+
};
|