@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,158 +1,235 @@
|
|
|
1
|
-
import dayjs from
|
|
2
|
-
import Clock from
|
|
3
|
-
import { computed, defineComponent, reactive, ref, watch } from
|
|
4
|
-
import { props, hoursAmpm, hours24 } from
|
|
5
|
-
import { toNumber, getRect } from
|
|
6
|
-
import { createNamespace, call, formatElevation } from
|
|
7
|
-
import { padStart } from
|
|
8
|
-
import { getNumberTime, getIsDisableMinute, getIsDisableSecond } from
|
|
9
|
-
|
|
10
|
-
name,
|
|
11
|
-
n,
|
|
12
|
-
classes
|
|
13
|
-
} = createNamespace('time-picker');
|
|
1
|
+
import dayjs from "dayjs/esm";
|
|
2
|
+
import Clock from "./clock.mjs";
|
|
3
|
+
import { computed, defineComponent, reactive, ref, watch } from "vue";
|
|
4
|
+
import { props, hoursAmpm, hours24 } from "./props.mjs";
|
|
5
|
+
import { toNumber, getRect } from "@varlet/shared";
|
|
6
|
+
import { createNamespace, call, formatElevation } from "../utils/components.mjs";
|
|
7
|
+
import { padStart } from "../utils/shared.mjs";
|
|
8
|
+
import { getNumberTime, getIsDisableMinute, getIsDisableSecond } from "./utils.mjs";
|
|
9
|
+
const { name, n, classes } = createNamespace("time-picker");
|
|
14
10
|
import { toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, createBlock as _createBlock, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
12
|
+
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ _createElementVNode(
|
|
13
|
+
"span",
|
|
14
|
+
null,
|
|
15
|
+
":",
|
|
16
|
+
-1
|
|
17
|
+
/* HOISTED */
|
|
18
|
+
));
|
|
19
|
+
const _hoisted_2 = { key: 0 };
|
|
20
20
|
function __render__(_ctx, _cache) {
|
|
21
|
-
|
|
22
|
-
return _openBlock(), _createElementBlock(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
21
|
+
const _component_clock = _resolveComponent("clock");
|
|
22
|
+
return _openBlock(), _createElementBlock(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.formatElevation(_ctx.elevation, 2))),
|
|
26
|
+
ref: "picker"
|
|
27
|
+
},
|
|
28
|
+
[
|
|
29
|
+
_createElementVNode(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
class: _normalizeClass(_ctx.n("title")),
|
|
33
|
+
style: _normalizeStyle({ background: _ctx.headerColor || _ctx.color })
|
|
34
|
+
},
|
|
35
|
+
[
|
|
36
|
+
_createElementVNode(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
class: _normalizeClass(_ctx.n("title-time"))
|
|
40
|
+
},
|
|
41
|
+
[
|
|
42
|
+
_createElementVNode(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("title-btn"), [_ctx.type === "hour", _ctx.n("title-btn--active")])),
|
|
46
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.checkPanel("hour"))
|
|
47
|
+
},
|
|
48
|
+
_toDisplayString(_ctx.time.hour),
|
|
49
|
+
3
|
|
50
|
+
/* TEXT, CLASS */
|
|
51
|
+
),
|
|
52
|
+
_hoisted_1,
|
|
53
|
+
_createElementVNode(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("title-btn"), [_ctx.type === "minute", _ctx.n("title-btn--active")])),
|
|
57
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.checkPanel("minute"))
|
|
58
|
+
},
|
|
59
|
+
_toDisplayString(_ctx.time.minute),
|
|
60
|
+
3
|
|
61
|
+
/* TEXT, CLASS */
|
|
62
|
+
),
|
|
63
|
+
_ctx.useSeconds ? (_openBlock(), _createElementBlock("span", _hoisted_2, ":")) : _createCommentVNode("v-if", true),
|
|
64
|
+
_ctx.useSeconds ? (_openBlock(), _createElementBlock(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
key: 1,
|
|
68
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("title-btn"), [_ctx.type === "second", _ctx.n("title-btn--active")])),
|
|
69
|
+
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.checkPanel("second"))
|
|
70
|
+
},
|
|
71
|
+
_toDisplayString(_ctx.time.second),
|
|
72
|
+
3
|
|
73
|
+
/* TEXT, CLASS */
|
|
74
|
+
)) : _createCommentVNode("v-if", true)
|
|
75
|
+
],
|
|
76
|
+
2
|
|
77
|
+
/* CLASS */
|
|
78
|
+
),
|
|
79
|
+
_ctx.format === "ampm" ? (_openBlock(), _createElementBlock(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
key: 0,
|
|
83
|
+
class: _normalizeClass(_ctx.n("title-ampm"))
|
|
84
|
+
},
|
|
85
|
+
[
|
|
86
|
+
_createElementVNode(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("title-btn"), [_ctx.ampm === "am", _ctx.n("title-btn--active")])),
|
|
90
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.checkAmpm("am"))
|
|
91
|
+
},
|
|
92
|
+
"AM",
|
|
93
|
+
2
|
|
94
|
+
/* CLASS */
|
|
95
|
+
),
|
|
96
|
+
_createElementVNode(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
class: _normalizeClass(_ctx.classes(_ctx.n("title-btn"), [_ctx.ampm === "pm", _ctx.n("title-btn--active")])),
|
|
100
|
+
onClick: _cache[4] || (_cache[4] = ($event) => _ctx.checkAmpm("pm"))
|
|
101
|
+
},
|
|
102
|
+
"PM",
|
|
103
|
+
2
|
|
104
|
+
/* CLASS */
|
|
105
|
+
)
|
|
106
|
+
],
|
|
107
|
+
2
|
|
108
|
+
/* CLASS */
|
|
109
|
+
)) : _createCommentVNode("v-if", true)
|
|
110
|
+
],
|
|
111
|
+
6
|
|
112
|
+
/* CLASS, STYLE */
|
|
113
|
+
),
|
|
114
|
+
_createElementVNode(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
class: _normalizeClass(_ctx.n("body"))
|
|
118
|
+
},
|
|
119
|
+
[
|
|
120
|
+
_createElementVNode(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
class: _normalizeClass(_ctx.n("clock-container")),
|
|
124
|
+
onTouchstart: _cache[5] || (_cache[5] = (...args) => _ctx.moveHand && _ctx.moveHand(...args)),
|
|
125
|
+
onTouchmove: _cache[6] || (_cache[6] = (...args) => _ctx.moveHand && _ctx.moveHand(...args)),
|
|
126
|
+
onTouchend: _cache[7] || (_cache[7] = (...args) => _ctx.end && _ctx.end(...args)),
|
|
127
|
+
ref: "container"
|
|
128
|
+
},
|
|
129
|
+
[
|
|
130
|
+
_createVNode(_Transition, {
|
|
131
|
+
name: `${_ctx.n()}-panel-fade`
|
|
132
|
+
}, {
|
|
133
|
+
default: _withCtx(() => [
|
|
134
|
+
(_openBlock(), _createBlock(_component_clock, {
|
|
135
|
+
key: _ctx.type,
|
|
136
|
+
ref: "inner",
|
|
137
|
+
type: _ctx.type,
|
|
138
|
+
ampm: _ctx.ampm,
|
|
139
|
+
color: _ctx.color,
|
|
140
|
+
"is-inner": _ctx.isInner,
|
|
141
|
+
format: _ctx.format,
|
|
142
|
+
"allowed-time": _ctx.allowedTime,
|
|
143
|
+
rad: _ctx.getRad,
|
|
144
|
+
time: _ctx.time,
|
|
145
|
+
"prevent-next-update": _ctx.isPreventNextUpdate,
|
|
146
|
+
"use-seconds": _ctx.useSeconds,
|
|
147
|
+
max: _ctx.max,
|
|
148
|
+
min: _ctx.min,
|
|
149
|
+
onUpdate: _ctx.update,
|
|
150
|
+
onChangePreventUpdate: _ctx.changePreventUpdate
|
|
151
|
+
}, null, 8, ["type", "ampm", "color", "is-inner", "format", "allowed-time", "rad", "time", "prevent-next-update", "use-seconds", "max", "min", "onUpdate", "onChangePreventUpdate"]))
|
|
152
|
+
]),
|
|
153
|
+
_: 1
|
|
154
|
+
/* STABLE */
|
|
155
|
+
}, 8, ["name"])
|
|
156
|
+
],
|
|
157
|
+
34
|
|
158
|
+
/* CLASS, HYDRATE_EVENTS */
|
|
159
|
+
)
|
|
160
|
+
],
|
|
161
|
+
2
|
|
162
|
+
/* CLASS */
|
|
163
|
+
)
|
|
164
|
+
],
|
|
165
|
+
2
|
|
166
|
+
/* CLASS */
|
|
167
|
+
);
|
|
88
168
|
}
|
|
89
|
-
|
|
90
|
-
var __sfc__ = defineComponent({
|
|
169
|
+
const __sfc__ = defineComponent({
|
|
91
170
|
name,
|
|
92
|
-
components: {
|
|
93
|
-
Clock
|
|
94
|
-
},
|
|
171
|
+
components: { Clock },
|
|
95
172
|
props,
|
|
96
|
-
setup(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
hour:
|
|
114
|
-
minute:
|
|
115
|
-
second:
|
|
173
|
+
setup(props2) {
|
|
174
|
+
const container = ref(null);
|
|
175
|
+
const picker = ref(null);
|
|
176
|
+
const inner = ref(null);
|
|
177
|
+
const isInner = ref(false);
|
|
178
|
+
const isPreventNextUpdate = ref(false);
|
|
179
|
+
const isActualInner = ref(false);
|
|
180
|
+
const isChosenUsableHour = ref(false);
|
|
181
|
+
const isChosenUsableMinute = ref(false);
|
|
182
|
+
const isDisableHour = ref(false);
|
|
183
|
+
const isDisableMinute = ref(false);
|
|
184
|
+
const minuteRad = ref(0);
|
|
185
|
+
const secondRad = ref(0);
|
|
186
|
+
const hourRad = ref();
|
|
187
|
+
const type = ref("hour");
|
|
188
|
+
const ampm = ref("am");
|
|
189
|
+
const time = ref({
|
|
190
|
+
hour: "00",
|
|
191
|
+
minute: "00",
|
|
192
|
+
second: "00"
|
|
116
193
|
});
|
|
117
|
-
|
|
194
|
+
const center = reactive({
|
|
118
195
|
x: 0,
|
|
119
196
|
y: 0
|
|
120
197
|
});
|
|
121
|
-
|
|
198
|
+
const innerRange = reactive({
|
|
122
199
|
x: [],
|
|
123
200
|
y: []
|
|
124
201
|
});
|
|
125
|
-
|
|
126
|
-
if (type.value ===
|
|
127
|
-
|
|
202
|
+
const getRad = computed(() => {
|
|
203
|
+
if (type.value === "hour")
|
|
204
|
+
return hourRad.value;
|
|
205
|
+
if (type.value === "minute")
|
|
206
|
+
return minuteRad.value;
|
|
128
207
|
return secondRad.value;
|
|
129
208
|
});
|
|
130
|
-
watch(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
minute,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
209
|
+
watch(
|
|
210
|
+
() => props2.modelValue,
|
|
211
|
+
(value) => {
|
|
212
|
+
if (value) {
|
|
213
|
+
const { hour, minute, second } = getNumberTime(value);
|
|
214
|
+
const formatHour12 = dayjs().hour(hour).format("hh");
|
|
215
|
+
const formatHour24 = dayjs().hour(hour).format("HH");
|
|
216
|
+
const formatMinute = dayjs().minute(minute).format("mm");
|
|
217
|
+
const formatSecond = dayjs().second(second).format("ss");
|
|
218
|
+
hourRad.value = (formatHour12 === "12" ? 0 : toNumber(formatHour12)) * 30;
|
|
219
|
+
minuteRad.value = toNumber(formatMinute) * 6;
|
|
220
|
+
secondRad.value = toNumber(formatSecond) * 6;
|
|
221
|
+
time.value = getTime(value);
|
|
222
|
+
if (props2.format !== "24hr") {
|
|
223
|
+
ampm.value = padStart(`${hour}`, 2, "0") === formatHour24 && hours24.includes(formatHour24) ? "pm" : "am";
|
|
224
|
+
}
|
|
225
|
+
isInner.value = props2.format === "24hr" && hours24.includes(formatHour24);
|
|
147
226
|
}
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
immediate: true
|
|
152
|
-
});
|
|
227
|
+
},
|
|
228
|
+
{ immediate: true }
|
|
229
|
+
);
|
|
153
230
|
function update(newTime) {
|
|
154
|
-
call(
|
|
155
|
-
call(
|
|
231
|
+
call(props2["onUpdate:modelValue"], newTime);
|
|
232
|
+
call(props2.onChange, newTime);
|
|
156
233
|
}
|
|
157
234
|
function rad2deg(rad) {
|
|
158
235
|
return rad * 57.29577951308232;
|
|
@@ -162,58 +239,51 @@ var __sfc__ = defineComponent({
|
|
|
162
239
|
isDisableMinute.value = false;
|
|
163
240
|
type.value = panelType;
|
|
164
241
|
}
|
|
165
|
-
function findAvailableHour(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return realignmentHours.find((hour, index) => {
|
|
173
|
-
isPreventNextUpdate.value = index !== 0;
|
|
242
|
+
function findAvailableHour(ampm2) {
|
|
243
|
+
const { disableHour } = inner.value;
|
|
244
|
+
const index = hoursAmpm.findIndex((hour) => toNumber(hour) === toNumber(time.value.hour));
|
|
245
|
+
const hours = ampm2 === "am" ? hoursAmpm : hours24;
|
|
246
|
+
const realignmentHours = [...hours.slice(index), ...hours.slice(0, index)];
|
|
247
|
+
return realignmentHours.find((hour, index2) => {
|
|
248
|
+
isPreventNextUpdate.value = index2 !== 0;
|
|
174
249
|
return !disableHour.includes(hour);
|
|
175
250
|
});
|
|
176
251
|
}
|
|
177
252
|
function checkAmpm(ampmType) {
|
|
178
|
-
if (
|
|
253
|
+
if (props2.readonly)
|
|
254
|
+
return;
|
|
179
255
|
ampm.value = ampmType;
|
|
180
|
-
|
|
181
|
-
if (!newHour)
|
|
182
|
-
|
|
183
|
-
|
|
256
|
+
const newHour = findAvailableHour(ampmType);
|
|
257
|
+
if (!newHour)
|
|
258
|
+
return;
|
|
259
|
+
const second = props2.useSeconds ? `:${time.value.second}` : "";
|
|
260
|
+
const newTime = `${padStart(newHour, 2, "0")}:${time.value.minute}${second}`;
|
|
184
261
|
update(newTime);
|
|
185
262
|
}
|
|
186
263
|
function getInner(clientX, clientY) {
|
|
187
|
-
|
|
188
|
-
|
|
264
|
+
const xIsInRange = clientX >= innerRange.x[0] && clientX <= innerRange.x[1];
|
|
265
|
+
const yIsInRange = clientY >= innerRange.y[0] && clientY <= innerRange.y[1];
|
|
189
266
|
return xIsInRange && yIsInRange;
|
|
190
267
|
}
|
|
191
268
|
function getTime(value) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
hour,
|
|
195
|
-
minute,
|
|
196
|
-
second
|
|
197
|
-
} = getNumberTime(value);
|
|
269
|
+
const hourFormat = props2.format === "24hr" ? "HH" : "hh";
|
|
270
|
+
const { hour, minute, second } = getNumberTime(value);
|
|
198
271
|
return {
|
|
199
272
|
hour: dayjs().hour(hour).format(hourFormat),
|
|
200
|
-
minute: dayjs().minute(minute).format(
|
|
201
|
-
second: dayjs().second(second).format(
|
|
273
|
+
minute: dayjs().minute(minute).format("mm"),
|
|
274
|
+
second: dayjs().second(second).format("ss")
|
|
202
275
|
};
|
|
203
276
|
}
|
|
204
277
|
function getHourIndex(rad) {
|
|
205
|
-
|
|
278
|
+
const value = rad / 30;
|
|
206
279
|
return value >= 0 ? value : value + 12;
|
|
207
280
|
}
|
|
208
281
|
function getRangeSize() {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
var rangeXMax = center.x + innerWidth / 2 + 8;
|
|
215
|
-
var rangeYMin = center.y - innerHeight / 2 - 8;
|
|
216
|
-
var rangeYMax = center.y + innerHeight / 2 + 8;
|
|
282
|
+
const { width: innerWidth, height: innerHeight } = inner.value.getSize();
|
|
283
|
+
const rangeXMin = center.x - innerWidth / 2 - 8;
|
|
284
|
+
const rangeXMax = center.x + innerWidth / 2 + 8;
|
|
285
|
+
const rangeYMin = center.y - innerHeight / 2 - 8;
|
|
286
|
+
const rangeYMax = center.y + innerHeight / 2 + 8;
|
|
217
287
|
return {
|
|
218
288
|
rangeXMin,
|
|
219
289
|
rangeXMax,
|
|
@@ -222,104 +292,96 @@ var __sfc__ = defineComponent({
|
|
|
222
292
|
};
|
|
223
293
|
}
|
|
224
294
|
function setHourRad(clientX, clientY, roundDeg) {
|
|
225
|
-
|
|
226
|
-
disableHour
|
|
227
|
-
} = inner.value;
|
|
295
|
+
const { disableHour } = inner.value;
|
|
228
296
|
isActualInner.value = getInner(clientX, clientY);
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
297
|
+
const rad = Math.round(roundDeg / 30) * 30 + 90;
|
|
298
|
+
const index = getHourIndex(rad);
|
|
299
|
+
const anotherHour = isInner.value ? hoursAmpm[index] : hours24[index];
|
|
232
300
|
if (!disableHour.includes(anotherHour)) {
|
|
233
|
-
isInner.value =
|
|
301
|
+
isInner.value = props2.format === "24hr" ? getInner(clientX, clientY) : false;
|
|
234
302
|
}
|
|
235
|
-
if (isInner.value !== isActualInner.value)
|
|
236
|
-
|
|
303
|
+
if (isInner.value !== isActualInner.value)
|
|
304
|
+
return;
|
|
305
|
+
const newHour = isInner.value || ampm.value === "pm" ? hours24[index] : hoursAmpm[index];
|
|
237
306
|
isDisableHour.value = disableHour.includes(newHour);
|
|
238
|
-
if (isDisableHour.value)
|
|
307
|
+
if (isDisableHour.value)
|
|
308
|
+
return;
|
|
239
309
|
hourRad.value = rad;
|
|
240
310
|
isChosenUsableHour.value = true;
|
|
241
311
|
}
|
|
242
312
|
function setMinuteRad(roundDeg) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
var radToMin = rad / 6 >= 0 ? rad / 6 : rad / 6 + 60;
|
|
248
|
-
var values = {
|
|
313
|
+
const { disableHour } = inner.value;
|
|
314
|
+
const rad = Math.round(roundDeg / 6) * 6 + 90;
|
|
315
|
+
const radToMin = rad / 6 >= 0 ? rad / 6 : rad / 6 + 60;
|
|
316
|
+
const values = {
|
|
249
317
|
time: radToMin,
|
|
250
|
-
format:
|
|
318
|
+
format: props2.format,
|
|
251
319
|
ampm: ampm.value,
|
|
252
320
|
hour: time.value.hour,
|
|
253
|
-
max:
|
|
254
|
-
min:
|
|
321
|
+
max: props2.max,
|
|
322
|
+
min: props2.min,
|
|
255
323
|
disableHour,
|
|
256
|
-
allowedTime:
|
|
324
|
+
allowedTime: props2.allowedTime
|
|
257
325
|
};
|
|
258
326
|
isDisableMinute.value = getIsDisableMinute(values);
|
|
259
|
-
if (isDisableMinute.value)
|
|
327
|
+
if (isDisableMinute.value)
|
|
328
|
+
return;
|
|
260
329
|
minuteRad.value = rad;
|
|
261
330
|
isChosenUsableMinute.value = true;
|
|
262
331
|
}
|
|
263
332
|
function setSecondRad(roundDeg) {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
var radToSec = rad / 6 >= 0 ? rad / 6 : rad / 6 + 60;
|
|
269
|
-
var values = {
|
|
333
|
+
const { disableHour } = inner.value;
|
|
334
|
+
const rad = Math.round(roundDeg / 6) * 6 + 90;
|
|
335
|
+
const radToSec = rad / 6 >= 0 ? rad / 6 : rad / 6 + 60;
|
|
336
|
+
const values = {
|
|
270
337
|
time: radToSec,
|
|
271
|
-
format:
|
|
338
|
+
format: props2.format,
|
|
272
339
|
ampm: ampm.value,
|
|
273
340
|
hour: time.value.hour,
|
|
274
341
|
minute: toNumber(time.value.minute),
|
|
275
|
-
max:
|
|
276
|
-
min:
|
|
342
|
+
max: props2.max,
|
|
343
|
+
min: props2.min,
|
|
277
344
|
disableHour,
|
|
278
|
-
allowedTime:
|
|
345
|
+
allowedTime: props2.allowedTime
|
|
279
346
|
};
|
|
280
|
-
if (!getIsDisableSecond(values))
|
|
347
|
+
if (!getIsDisableSecond(values))
|
|
348
|
+
secondRad.value = rad;
|
|
281
349
|
}
|
|
282
350
|
function setCenterAndRange() {
|
|
283
|
-
|
|
284
|
-
left,
|
|
285
|
-
top,
|
|
286
|
-
width,
|
|
287
|
-
height
|
|
288
|
-
} = getRect(container.value);
|
|
351
|
+
const { left, top, width, height } = getRect(container.value);
|
|
289
352
|
center.x = left + width / 2;
|
|
290
353
|
center.y = top + height / 2;
|
|
291
|
-
if (type.value ===
|
|
292
|
-
|
|
293
|
-
rangeXMin,
|
|
294
|
-
rangeXMax,
|
|
295
|
-
rangeYMin,
|
|
296
|
-
rangeYMax
|
|
297
|
-
} = getRangeSize();
|
|
354
|
+
if (type.value === "hour" && props2.format === "24hr") {
|
|
355
|
+
const { rangeXMin, rangeXMax, rangeYMin, rangeYMax } = getRangeSize();
|
|
298
356
|
innerRange.x = [rangeXMin, rangeXMax];
|
|
299
357
|
innerRange.y = [rangeYMin, rangeYMax];
|
|
300
358
|
}
|
|
301
359
|
}
|
|
302
360
|
function moveHand(event) {
|
|
303
361
|
event.preventDefault();
|
|
304
|
-
if (
|
|
362
|
+
if (props2.readonly)
|
|
363
|
+
return;
|
|
305
364
|
setCenterAndRange();
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
365
|
+
const { clientX, clientY } = event.touches[0];
|
|
366
|
+
const x = clientX - center.x;
|
|
367
|
+
const y = clientY - center.y;
|
|
368
|
+
const roundDeg = Math.round(rad2deg(Math.atan2(y, x)));
|
|
369
|
+
if (type.value === "hour")
|
|
370
|
+
setHourRad(clientX, clientY, roundDeg);
|
|
371
|
+
else if (type.value === "minute")
|
|
372
|
+
setMinuteRad(roundDeg);
|
|
373
|
+
else
|
|
374
|
+
setSecondRad(roundDeg);
|
|
314
375
|
}
|
|
315
376
|
function end() {
|
|
316
|
-
if (
|
|
317
|
-
|
|
318
|
-
|
|
377
|
+
if (props2.readonly)
|
|
378
|
+
return;
|
|
379
|
+
if (type.value === "hour" && isChosenUsableHour.value) {
|
|
380
|
+
type.value = "minute";
|
|
319
381
|
return;
|
|
320
382
|
}
|
|
321
|
-
if (type.value ===
|
|
322
|
-
type.value =
|
|
383
|
+
if (type.value === "minute" && props2.useSeconds && isChosenUsableMinute.value) {
|
|
384
|
+
type.value = "second";
|
|
323
385
|
}
|
|
324
386
|
}
|
|
325
387
|
function changePreventUpdate() {
|
|
@@ -348,4 +410,7 @@ var __sfc__ = defineComponent({
|
|
|
348
410
|
}
|
|
349
411
|
});
|
|
350
412
|
__sfc__.render = __render__;
|
|
351
|
-
|
|
413
|
+
var stdin_default = __sfc__;
|
|
414
|
+
export {
|
|
415
|
+
stdin_default as default
|
|
416
|
+
};
|