@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.
Files changed (348) hide show
  1. package/es/action-sheet/ActionSheet.mjs +97 -67
  2. package/es/action-sheet/index.mjs +43 -28
  3. package/es/action-sheet/props.mjs +39 -8
  4. package/es/app-bar/AppBar.mjs +129 -56
  5. package/es/app-bar/index.mjs +10 -5
  6. package/es/app-bar/props.mjs +6 -3
  7. package/es/avatar/Avatar.mjs +97 -87
  8. package/es/avatar/index.mjs +10 -5
  9. package/es/avatar/props.mjs +8 -5
  10. package/es/avatar-group/AvatarGroup.mjs +26 -20
  11. package/es/avatar-group/index.mjs +10 -5
  12. package/es/avatar-group/props.mjs +5 -2
  13. package/es/back-top/BackTop.mjs +71 -53
  14. package/es/back-top/index.mjs +10 -5
  15. package/es/back-top/props.mjs +6 -3
  16. package/es/badge/Badge.mjs +74 -46
  17. package/es/badge/index.mjs +10 -5
  18. package/es/badge/props.mjs +7 -4
  19. package/es/bottom-navigation/BottomNavigation.mjs +100 -97
  20. package/es/bottom-navigation/index.mjs +10 -5
  21. package/es/bottom-navigation/props.mjs +7 -4
  22. package/es/bottom-navigation/provide.mjs +13 -9
  23. package/es/bottom-navigation-item/BottomNavigationItem.mjs +93 -74
  24. package/es/bottom-navigation-item/index.mjs +10 -5
  25. package/es/bottom-navigation-item/props.mjs +7 -4
  26. package/es/bottom-navigation-item/provide.mjs +14 -11
  27. package/es/breadcrumb/Breadcrumb.mjs +51 -36
  28. package/es/breadcrumb/index.mjs +10 -5
  29. package/es/breadcrumb/props.mjs +6 -3
  30. package/es/breadcrumb/provide.mjs +12 -11
  31. package/es/breadcrumbs/Breadcrumbs.mjs +26 -24
  32. package/es/breadcrumbs/index.mjs +10 -5
  33. package/es/breadcrumbs/props.mjs +6 -3
  34. package/es/breadcrumbs/provide.mjs +11 -9
  35. package/es/button/Button.mjs +88 -90
  36. package/es/button/index.mjs +10 -5
  37. package/es/button/props.mjs +31 -10
  38. package/es/button/provide.mjs +8 -9
  39. package/es/button-group/ButtonGroup.mjs +38 -26
  40. package/es/button-group/index.mjs +8 -4
  41. package/es/button-group/props.mjs +8 -5
  42. package/es/button-group/provide.mjs +9 -9
  43. package/es/card/Card.mjs +292 -189
  44. package/es/card/index.mjs +10 -5
  45. package/es/card/props.mjs +9 -6
  46. package/es/cell/Cell.mjs +96 -52
  47. package/es/cell/index.mjs +10 -5
  48. package/es/cell/props.mjs +6 -3
  49. package/es/checkbox/Checkbox.mjs +136 -130
  50. package/es/checkbox/index.mjs +10 -5
  51. package/es/checkbox/props.mjs +9 -6
  52. package/es/checkbox/provide.mjs +10 -9
  53. package/es/checkbox-group/CheckboxGroup.mjs +63 -96
  54. package/es/checkbox-group/index.mjs +10 -5
  55. package/es/checkbox-group/props.mjs +9 -6
  56. package/es/checkbox-group/provide.mjs +11 -9
  57. package/es/chip/Chip.mjs +66 -50
  58. package/es/chip/index.mjs +10 -5
  59. package/es/chip/props.mjs +10 -7
  60. package/es/col/Col.mjs +60 -55
  61. package/es/col/index.mjs +10 -5
  62. package/es/col/props.mjs +7 -4
  63. package/es/col/provide.mjs +8 -9
  64. package/es/collapse/Collapse.mjs +70 -73
  65. package/es/collapse/index.mjs +10 -5
  66. package/es/collapse/props.mjs +7 -4
  67. package/es/collapse/provide.mjs +11 -9
  68. package/es/collapse-item/CollapseItem.mjs +156 -93
  69. package/es/collapse-item/index.mjs +10 -5
  70. package/es/collapse-item/props.mjs +6 -3
  71. package/es/collapse-item/provide.mjs +12 -11
  72. package/es/context/index.mjs +9 -5
  73. package/es/context/lock.mjs +18 -22
  74. package/es/context/zIndex.mjs +19 -16
  75. package/es/countdown/Countdown.mjs +73 -70
  76. package/es/countdown/index.mjs +10 -5
  77. package/es/countdown/props.mjs +7 -4
  78. package/es/counter/Counter.mjs +169 -173
  79. package/es/counter/index.mjs +10 -5
  80. package/es/counter/props.mjs +8 -5
  81. package/es/counter/provide.ts +3 -0
  82. package/es/date-picker/DatePicker.mjs +411 -304
  83. package/es/date-picker/index.mjs +10 -5
  84. package/es/date-picker/props.mjs +71 -45
  85. package/es/date-picker/src/day-picker-panel.mjs +270 -208
  86. package/es/date-picker/src/month-picker-panel.mjs +205 -175
  87. package/es/date-picker/src/panel-header.mjs +101 -83
  88. package/es/date-picker/src/year-picker-panel.mjs +64 -54
  89. package/es/dialog/Dialog.mjs +171 -106
  90. package/es/dialog/index.mjs +49 -33
  91. package/es/dialog/props.mjs +39 -9
  92. package/es/divider/Divider.mjs +56 -51
  93. package/es/divider/index.mjs +10 -5
  94. package/es/divider/props.mjs +5 -2
  95. package/es/drag/Drag.mjs +126 -144
  96. package/es/drag/index.mjs +10 -5
  97. package/es/drag/props.mjs +8 -5
  98. package/es/ellipsis/Ellipsis.mjs +81 -50
  99. package/es/ellipsis/index.mjs +8 -4
  100. package/es/ellipsis/props.mjs +5 -2
  101. package/es/fab/Fab.mjs +73 -75
  102. package/es/fab/index.mjs +8 -4
  103. package/es/fab/props.mjs +14 -11
  104. package/es/field-decorator/FieldDecorator.mjs +215 -110
  105. package/es/field-decorator/props.mjs +9 -6
  106. package/es/form/Form.mjs +69 -79
  107. package/es/form/index.mjs +11 -6
  108. package/es/form/props.mjs +6 -3
  109. package/es/form/provide.mjs +35 -22
  110. package/es/form-details/FormDetails.mjs +81 -39
  111. package/es/form-details/index.mjs +10 -5
  112. package/es/form-details/props.mjs +7 -4
  113. package/es/hover/index.mjs +37 -40
  114. package/es/hover-overlay/HoverOverlay.mjs +18 -14
  115. package/es/hover-overlay/index.mjs +13 -8
  116. package/es/hover-overlay/props.mjs +5 -2
  117. package/es/icon/Icon.mjs +50 -33
  118. package/es/icon/index.mjs +10 -5
  119. package/es/icon/props.mjs +7 -4
  120. package/es/image/Image.mjs +76 -82
  121. package/es/image/index.mjs +10 -5
  122. package/es/image/props.mjs +7 -4
  123. package/es/image-preview/ImagePreview.mjs +176 -193
  124. package/es/image-preview/index.mjs +44 -30
  125. package/es/image-preview/props.mjs +34 -9
  126. package/es/index-anchor/IndexAnchor.mjs +45 -42
  127. package/es/index-anchor/index.mjs +10 -5
  128. package/es/index-anchor/props.mjs +5 -2
  129. package/es/index-anchor/provide.mjs +12 -11
  130. package/es/index-bar/IndexBar.mjs +130 -131
  131. package/es/index-bar/index.mjs +10 -5
  132. package/es/index-bar/props.mjs +6 -3
  133. package/es/index-bar/provide.mjs +11 -9
  134. package/es/index.bundle.mjs +1 -1
  135. package/es/index.mjs +1 -1
  136. package/es/input/Input.mjs +231 -247
  137. package/es/input/index.mjs +10 -5
  138. package/es/input/props.mjs +38 -8
  139. package/es/input/provide.ts +3 -0
  140. package/es/lazy/index.mjs +94 -87
  141. package/es/link/Link.mjs +39 -45
  142. package/es/link/index.mjs +10 -5
  143. package/es/link/props.mjs +8 -5
  144. package/es/list/List.mjs +144 -97
  145. package/es/list/index.mjs +10 -5
  146. package/es/list/props.mjs +8 -5
  147. package/es/list/provide.mjs +8 -9
  148. package/es/loading/Loading.mjs +165 -72
  149. package/es/loading/index.mjs +10 -5
  150. package/es/loading/props.mjs +7 -4
  151. package/es/loading-bar/LoadingBar.mjs +19 -16
  152. package/es/loading-bar/index.mjs +37 -30
  153. package/es/loading-bar/props.mjs +5 -2
  154. package/es/locale/en-US.mjs +76 -73
  155. package/es/locale/index.mjs +52 -41
  156. package/es/locale/zh-CN.mjs +76 -73
  157. package/es/menu/Menu.mjs +76 -57
  158. package/es/menu/index.mjs +10 -5
  159. package/es/menu/props.mjs +11 -8
  160. package/es/menu/usePopover.mjs +214 -207
  161. package/es/option/Option.mjs +86 -70
  162. package/es/option/index.mjs +10 -5
  163. package/es/option/props.mjs +5 -2
  164. package/es/option/provide.mjs +10 -11
  165. package/es/overlay/Overlay.mjs +29 -31
  166. package/es/overlay/index.mjs +10 -5
  167. package/es/overlay/props.mjs +7 -4
  168. package/es/pagination/Pagination.mjs +334 -202
  169. package/es/pagination/index.mjs +10 -5
  170. package/es/pagination/props.mjs +8 -5
  171. package/es/paper/Paper.mjs +43 -31
  172. package/es/paper/index.mjs +10 -5
  173. package/es/paper/props.mjs +6 -3
  174. package/es/picker/Picker.mjs +288 -224
  175. package/es/picker/index.mjs +24 -23
  176. package/es/picker/props.mjs +37 -7
  177. package/es/popup/Popup.mjs +68 -58
  178. package/es/popup/index.mjs +10 -5
  179. package/es/popup/props.mjs +9 -6
  180. package/es/popup/provide.mjs +12 -15
  181. package/es/progress/Progress.mjs +186 -114
  182. package/es/progress/index.mjs +10 -5
  183. package/es/progress/props.mjs +7 -4
  184. package/es/pull-refresh/PullRefresh.mjs +136 -116
  185. package/es/pull-refresh/index.mjs +10 -5
  186. package/es/pull-refresh/props.mjs +8 -5
  187. package/es/radio/Radio.mjs +122 -118
  188. package/es/radio/index.mjs +10 -5
  189. package/es/radio/props.mjs +8 -5
  190. package/es/radio/provide.mjs +8 -9
  191. package/es/radio-group/RadioGroup.mjs +50 -58
  192. package/es/radio-group/index.mjs +10 -5
  193. package/es/radio-group/props.mjs +10 -7
  194. package/es/radio-group/provide.mjs +11 -9
  195. package/es/rate/Rate.mjs +103 -132
  196. package/es/rate/index.mjs +10 -5
  197. package/es/rate/props.mjs +10 -7
  198. package/es/rate/provide.ts +3 -0
  199. package/es/result/Empty.mjs +21 -12
  200. package/es/result/Error.mjs +18 -9
  201. package/es/result/Info.mjs +18 -9
  202. package/es/result/Question.mjs +18 -9
  203. package/es/result/Result.mjs +102 -55
  204. package/es/result/Success.mjs +84 -40
  205. package/es/result/Warning.mjs +18 -9
  206. package/es/result/index.mjs +10 -5
  207. package/es/result/props.mjs +6 -3
  208. package/es/ripple/index.mjs +89 -101
  209. package/es/row/Row.mjs +40 -45
  210. package/es/row/index.mjs +10 -5
  211. package/es/row/props.mjs +8 -5
  212. package/es/row/provide.mjs +9 -9
  213. package/es/select/Select.mjs +308 -298
  214. package/es/select/index.mjs +10 -5
  215. package/es/select/props.mjs +40 -10
  216. package/es/select/provide.mjs +9 -9
  217. package/es/skeleton/Skeleton.mjs +182 -71
  218. package/es/skeleton/index.mjs +10 -5
  219. package/es/skeleton/props.mjs +5 -2
  220. package/es/slider/Slider.mjs +310 -260
  221. package/es/slider/index.mjs +10 -5
  222. package/es/slider/props.mjs +15 -11
  223. package/es/slider/provide.ts +3 -0
  224. package/es/snackbar/Snackbar.mjs +47 -34
  225. package/es/snackbar/core.mjs +140 -77
  226. package/es/snackbar/index.mjs +111 -97
  227. package/es/snackbar/props.mjs +35 -14
  228. package/es/space/Space.mjs +30 -28
  229. package/es/space/index.mjs +10 -5
  230. package/es/space/margin.mjs +22 -23
  231. package/es/space/props.mjs +8 -5
  232. package/es/step/Step.mjs +96 -74
  233. package/es/step/index.mjs +10 -5
  234. package/es/step/props.mjs +6 -3
  235. package/es/step/provide.mjs +10 -11
  236. package/es/steps/Steps.mjs +31 -30
  237. package/es/steps/index.mjs +10 -5
  238. package/es/steps/props.mjs +7 -4
  239. package/es/steps/provide.mjs +9 -8
  240. package/es/sticky/Sticky.mjs +104 -92
  241. package/es/sticky/index.mjs +10 -5
  242. package/es/sticky/props.mjs +6 -3
  243. package/es/style-provider/StyleProvider.mjs +19 -18
  244. package/es/style-provider/index.mjs +15 -11
  245. package/es/style-provider/props.mjs +6 -3
  246. package/es/swipe/Swipe.mjs +281 -268
  247. package/es/swipe/index.mjs +10 -5
  248. package/es/swipe/props.mjs +6 -3
  249. package/es/swipe/provide.mjs +11 -9
  250. package/es/swipe-item/SwipeItem.mjs +29 -29
  251. package/es/swipe-item/index.mjs +8 -4
  252. package/es/swipe-item/provide.mjs +10 -11
  253. package/es/switch/Switch.mjs +143 -103
  254. package/es/switch/index.mjs +10 -5
  255. package/es/switch/props.mjs +7 -4
  256. package/es/switch/provide.ts +3 -0
  257. package/es/tab/Tab.mjs +48 -61
  258. package/es/tab/index.mjs +10 -5
  259. package/es/tab/props.mjs +6 -3
  260. package/es/tab/provide.mjs +10 -11
  261. package/es/tab-item/TabItem.mjs +27 -32
  262. package/es/tab-item/index.mjs +10 -5
  263. package/es/tab-item/props.mjs +5 -2
  264. package/es/tab-item/provide.mjs +17 -18
  265. package/es/table/Table.mjs +54 -25
  266. package/es/table/index.mjs +10 -5
  267. package/es/table/props.mjs +6 -3
  268. package/es/tabs/Tabs.mjs +162 -134
  269. package/es/tabs/index.mjs +10 -5
  270. package/es/tabs/props.mjs +15 -12
  271. package/es/tabs/provide.mjs +9 -9
  272. package/es/tabs-items/TabsItems.mjs +61 -65
  273. package/es/tabs-items/index.mjs +10 -5
  274. package/es/tabs-items/props.mjs +7 -4
  275. package/es/tabs-items/provide.mjs +11 -9
  276. package/es/themes/dark/actionSheet.mjs +8 -5
  277. package/es/themes/dark/appBar.mjs +6 -3
  278. package/es/themes/dark/avatar.mjs +7 -4
  279. package/es/themes/dark/badge.mjs +6 -3
  280. package/es/themes/dark/bottomNavigation.mjs +7 -4
  281. package/es/themes/dark/bottomNavigationItem.mjs +6 -3
  282. package/es/themes/dark/breadcrumb.mjs +6 -3
  283. package/es/themes/dark/button.mjs +7 -4
  284. package/es/themes/dark/card.mjs +10 -7
  285. package/es/themes/dark/cell.mjs +7 -4
  286. package/es/themes/dark/checkbox.mjs +7 -4
  287. package/es/themes/dark/chip.mjs +7 -4
  288. package/es/themes/dark/collapse.mjs +8 -5
  289. package/es/themes/dark/countdown.mjs +6 -3
  290. package/es/themes/dark/datePicker.mjs +10 -7
  291. package/es/themes/dark/dialog.mjs +8 -5
  292. package/es/themes/dark/divider.mjs +7 -4
  293. package/es/themes/dark/fieldDecorator.mjs +7 -4
  294. package/es/themes/dark/index.mjs +69 -51
  295. package/es/themes/dark/link.mjs +6 -3
  296. package/es/themes/dark/menu.mjs +6 -3
  297. package/es/themes/dark/option.mjs +6 -3
  298. package/es/themes/dark/pagination.mjs +11 -8
  299. package/es/themes/dark/paper.mjs +6 -3
  300. package/es/themes/dark/picker.mjs +11 -8
  301. package/es/themes/dark/popup.mjs +6 -3
  302. package/es/themes/dark/progress.mjs +6 -3
  303. package/es/themes/dark/pullRefresh.mjs +6 -3
  304. package/es/themes/dark/radio.mjs +7 -4
  305. package/es/themes/dark/result.mjs +12 -9
  306. package/es/themes/dark/select.mjs +6 -3
  307. package/es/themes/dark/skeleton.mjs +11 -6
  308. package/es/themes/dark/steps.mjs +8 -5
  309. package/es/themes/dark/switch.mjs +7 -4
  310. package/es/themes/dark/tab.mjs +6 -3
  311. package/es/themes/dark/table.mjs +12 -9
  312. package/es/themes/dark/tabs.mjs +6 -3
  313. package/es/themes/dark/timePicker.mjs +9 -6
  314. package/es/themes/dark/uploader.mjs +10 -7
  315. package/es/themes/dark/watermark.mjs +6 -3
  316. package/es/themes/index.mjs +7 -5
  317. package/es/time-picker/TimePicker.mjs +297 -232
  318. package/es/time-picker/clock.mjs +222 -172
  319. package/es/time-picker/index.mjs +10 -5
  320. package/es/time-picker/props.mjs +14 -8
  321. package/es/time-picker/utils.mjs +46 -86
  322. package/es/tooltip/Tooltip.mjs +82 -62
  323. package/es/tooltip/index.mjs +10 -5
  324. package/es/tooltip/props.mjs +12 -9
  325. package/es/uploader/Uploader.mjs +315 -308
  326. package/es/uploader/index.mjs +10 -5
  327. package/es/uploader/props.mjs +10 -7
  328. package/es/uploader/provide.ts +3 -0
  329. package/es/utils/components.mjs +158 -127
  330. package/es/utils/elements.mjs +106 -123
  331. package/es/utils/logger.mjs +9 -5
  332. package/es/utils/shared.mjs +25 -23
  333. package/es/utils/test.mjs +105 -93
  334. package/es/varlet.esm.js +12464 -13425
  335. package/es/watermark/Watermark.mjs +191 -109
  336. package/es/watermark/index.mjs +8 -4
  337. package/es/watermark/props.mjs +8 -5
  338. package/highlight/web-types.en-US.json +3 -3
  339. package/highlight/web-types.zh-CN.json +2 -2
  340. package/lib/varlet.cjs.js +9187 -10199
  341. package/package.json +7 -7
  342. package/umd/varlet.js +4 -4
  343. package/es/counter/provide.mjs +0 -1
  344. package/es/input/provide.mjs +0 -1
  345. package/es/rate/provide.mjs +0 -1
  346. package/es/slider/provide.mjs +0 -1
  347. package/es/switch/provide.mjs +0 -1
  348. package/es/uploader/provide.mjs +0 -1
@@ -1,116 +1,214 @@
1
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3
- import dayjs from 'dayjs/esm';
4
- import MonthPickerPanel from './src/month-picker-panel.mjs';
5
- import YearPickerPanel from './src/year-picker-panel.mjs';
6
- import DayPickerPanel from './src/day-picker-panel.mjs';
7
- import { defineComponent, ref, computed, reactive, watch } from 'vue';
8
- import { props, MONTH_LIST, WEEK_HEADER } from './props.mjs';
9
- import { isArray, toNumber, doubleRaf } from '@varlet/shared';
10
- import { createNamespace, call, formatElevation } from '../utils/components.mjs';
11
- import { padStart } from '../utils/shared.mjs';
12
- import { pack } from '../locale/index.mjs';
13
- var {
14
- name,
15
- n,
16
- classes
17
- } = createNamespace('date-picker');
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import dayjs from "dayjs/esm";
22
+ import MonthPickerPanel from "./src/month-picker-panel.mjs";
23
+ import YearPickerPanel from "./src/year-picker-panel.mjs";
24
+ import DayPickerPanel from "./src/day-picker-panel.mjs";
25
+ import { defineComponent, ref, computed, reactive, watch } from "vue";
26
+ import {
27
+ props,
28
+ MONTH_LIST,
29
+ WEEK_HEADER
30
+ } from "./props.mjs";
31
+ import { isArray, toNumber, doubleRaf } from "@varlet/shared";
32
+ import { createNamespace, call, formatElevation } from "../utils/components.mjs";
33
+ import { padStart } from "../utils/shared.mjs";
34
+ import { pack } from "../locale/index.mjs";
35
+ const { name, n, classes } = createNamespace("date-picker");
18
36
  import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeProps as _normalizeProps, mergeProps as _mergeProps, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, createBlock as _createBlock } from "vue";
19
37
  function __render__(_ctx, _cache) {
20
- var _component_year_picker_panel = _resolveComponent("year-picker-panel");
21
- var _component_month_picker_panel = _resolveComponent("month-picker-panel");
22
- var _component_day_picker_panel = _resolveComponent("day-picker-panel");
23
- return _openBlock(), _createElementBlock("div", {
24
- class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.formatElevation(_ctx.elevation, 2)))
25
- }, [_createElementVNode("div", {
26
- class: _normalizeClass(_ctx.n('title')),
27
- style: _normalizeStyle({
28
- background: _ctx.headerColor || _ctx.color
29
- })
30
- }, [_createElementVNode("div", {
31
- class: _normalizeClass(_ctx.classes(_ctx.n('title-year'), [_ctx.isYearPanel, _ctx.n('title-year--active')])),
32
- onClick: _cache[0] || (_cache[0] = $event => _ctx.clickEl('year'))
33
- }, [_renderSlot(_ctx.$slots, "year", {
34
- year: _ctx.chooseYear
35
- }, () => [_createTextVNode(_toDisplayString(_ctx.chooseYear), 1 /* TEXT */)])], 2 /* CLASS */), _createElementVNode("div", {
36
- class: _normalizeClass(_ctx.classes(_ctx.n('title-date'), [!_ctx.isYearPanel, _ctx.n('title-date--active')], [_ctx.range, _ctx.n('title-date--range')])),
37
- onClick: _cache[1] || (_cache[1] = $event => _ctx.clickEl('date'))
38
- }, [_createVNode(_Transition, {
39
- name: _ctx.multiple ? '' : "" + _ctx.n() + (_ctx.reverse ? '-reverse' : '') + "-translatey"
40
- }, {
41
- default: _withCtx(() => {
42
- var _ctx$chooseMonth, _ctx$chooseMonth2, _ctx$chooseMonth3;
43
- return [_ctx.type === 'month' ? (_openBlock(), _createElementBlock("div", {
44
- key: "" + _ctx.chooseYear + ((_ctx$chooseMonth = _ctx.chooseMonth) == null ? void 0 : _ctx$chooseMonth.index)
45
- }, [_ctx.range ? _renderSlot(_ctx.$slots, "range", {
46
- key: 0,
47
- choose: _ctx.getChoose.chooseRangeMonth
48
- }, () => [_createTextVNode(_toDisplayString(_ctx.getMonthTitle), 1 /* TEXT */)]) : _ctx.multiple ? _renderSlot(_ctx.$slots, "multiple", {
49
- key: 1,
50
- choose: _ctx.getChoose.chooseMonths
51
- }, () => [_createTextVNode(_toDisplayString(_ctx.getMonthTitle), 1 /* TEXT */)]) : _renderSlot(_ctx.$slots, "month", {
52
- key: 2,
53
- month: (_ctx$chooseMonth2 = _ctx.chooseMonth) == null ? void 0 : _ctx$chooseMonth2.index,
54
- year: _ctx.chooseYear
55
- }, () => [_createTextVNode(_toDisplayString(_ctx.getMonthTitle), 1 /* TEXT */)])])) : (_openBlock(), _createElementBlock("div", {
56
- key: "" + _ctx.chooseYear + ((_ctx$chooseMonth3 = _ctx.chooseMonth) == null ? void 0 : _ctx$chooseMonth3.index) + _ctx.chooseDay
57
- }, [_ctx.range ? _renderSlot(_ctx.$slots, "range", {
58
- key: 0,
59
- choose: _ctx.formatRange
60
- }, () => [_createTextVNode(_toDisplayString(_ctx.getDateTitle), 1 /* TEXT */)]) : _ctx.multiple ? _renderSlot(_ctx.$slots, "multiple", {
61
- key: 1,
62
- choose: _ctx.getChoose.chooseDays
63
- }, () => [_createTextVNode(_toDisplayString(_ctx.getDateTitle), 1 /* TEXT */)]) : _renderSlot(_ctx.$slots, "date", _normalizeProps(_mergeProps({
64
- key: 2
65
- }, _ctx.slotProps)), () => [_createTextVNode(_toDisplayString(_ctx.getDateTitle), 1 /* TEXT */)])]))];
66
- }),
67
-
68
- _: 3 /* FORWARDED */
69
- }, 8 /* PROPS */, ["name"])], 2 /* CLASS */)], 6 /* CLASS, STYLE */), _createElementVNode("div", {
70
- class: _normalizeClass(_ctx.n('body')),
71
- onTouchstart: _cache[2] || (_cache[2] = function () {
72
- return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
73
- }),
74
- onTouchmove: _cache[3] || (_cache[3] = function () {
75
- return _ctx.handleTouchmove && _ctx.handleTouchmove(...arguments);
76
- }),
77
- onTouchend: _cache[4] || (_cache[4] = function () {
78
- return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
79
- })
80
- }, [_createVNode(_Transition, {
81
- name: _ctx.n() + "-panel-fade"
82
- }, {
83
- default: _withCtx(() => [_ctx.getPanelType === 'year' ? (_openBlock(), _createBlock(_component_year_picker_panel, {
84
- key: 0,
85
- "component-props": _ctx.componentProps,
86
- preview: _ctx.previewYear,
87
- onChooseYear: _ctx.getChooseYear
88
- }, null, 8 /* PROPS */, ["component-props", "preview", "onChooseYear"])) : _ctx.getPanelType === 'month' ? (_openBlock(), _createBlock(_component_month_picker_panel, {
89
- key: 1,
90
- ref: "monthPanelEl",
91
- current: _ctx.currentDate,
92
- choose: _ctx.getChoose,
93
- preview: _ctx.getPreview,
94
- "click-year": () => _ctx.clickEl('year'),
95
- "component-props": _ctx.componentProps,
96
- onChooseMonth: _ctx.getChooseMonth,
97
- onCheckPreview: _ctx.checkPreview
98
- }, null, 8 /* PROPS */, ["current", "choose", "preview", "click-year", "component-props", "onChooseMonth", "onCheckPreview"])) : _ctx.getPanelType === 'date' ? (_openBlock(), _createBlock(_component_day_picker_panel, {
99
- key: 2,
100
- ref: "dayPanelEl",
101
- current: _ctx.currentDate,
102
- choose: _ctx.getChoose,
103
- preview: _ctx.getPreview,
104
- "component-props": _ctx.componentProps,
105
- "click-month": () => _ctx.clickEl('month'),
106
- onChooseDay: _ctx.getChooseDay,
107
- onCheckPreview: _ctx.checkPreview
108
- }, null, 8 /* PROPS */, ["current", "choose", "preview", "component-props", "click-month", "onChooseDay", "onCheckPreview"])) : _createCommentVNode("v-if", true)]),
109
- _: 1 /* STABLE */
110
- }, 8 /* PROPS */, ["name"])], 34 /* CLASS, HYDRATE_EVENTS */)], 2 /* CLASS */);
38
+ const _component_year_picker_panel = _resolveComponent("year-picker-panel");
39
+ const _component_month_picker_panel = _resolveComponent("month-picker-panel");
40
+ const _component_day_picker_panel = _resolveComponent("day-picker-panel");
41
+ return _openBlock(), _createElementBlock(
42
+ "div",
43
+ {
44
+ class: _normalizeClass(_ctx.classes(_ctx.n(), _ctx.formatElevation(_ctx.elevation, 2)))
45
+ },
46
+ [
47
+ _createElementVNode(
48
+ "div",
49
+ {
50
+ class: _normalizeClass(_ctx.n("title")),
51
+ style: _normalizeStyle({ background: _ctx.headerColor || _ctx.color })
52
+ },
53
+ [
54
+ _createElementVNode(
55
+ "div",
56
+ {
57
+ class: _normalizeClass(_ctx.classes(_ctx.n("title-year"), [_ctx.isYearPanel, _ctx.n("title-year--active")])),
58
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.clickEl("year"))
59
+ },
60
+ [
61
+ _renderSlot(_ctx.$slots, "year", { year: _ctx.chooseYear }, () => [
62
+ _createTextVNode(
63
+ _toDisplayString(_ctx.chooseYear),
64
+ 1
65
+ /* TEXT */
66
+ )
67
+ ])
68
+ ],
69
+ 2
70
+ /* CLASS */
71
+ ),
72
+ _createElementVNode(
73
+ "div",
74
+ {
75
+ class: _normalizeClass(_ctx.classes(_ctx.n("title-date"), [!_ctx.isYearPanel, _ctx.n("title-date--active")], [_ctx.range, _ctx.n("title-date--range")])),
76
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.clickEl("date"))
77
+ },
78
+ [
79
+ _createVNode(_Transition, {
80
+ name: _ctx.multiple ? "" : `${_ctx.n()}${_ctx.reverse ? "-reverse" : ""}-translatey`
81
+ }, {
82
+ default: _withCtx(() => {
83
+ var _a, _b, _c;
84
+ return [
85
+ _ctx.type === "month" ? (_openBlock(), _createElementBlock("div", {
86
+ key: `${_ctx.chooseYear}${(_a = _ctx.chooseMonth) == null ? void 0 : _a.index}`
87
+ }, [
88
+ _ctx.range ? _renderSlot(_ctx.$slots, "range", {
89
+ key: 0,
90
+ choose: _ctx.getChoose.chooseRangeMonth
91
+ }, () => [
92
+ _createTextVNode(
93
+ _toDisplayString(_ctx.getMonthTitle),
94
+ 1
95
+ /* TEXT */
96
+ )
97
+ ]) : _ctx.multiple ? _renderSlot(_ctx.$slots, "multiple", {
98
+ key: 1,
99
+ choose: _ctx.getChoose.chooseMonths
100
+ }, () => [
101
+ _createTextVNode(
102
+ _toDisplayString(_ctx.getMonthTitle),
103
+ 1
104
+ /* TEXT */
105
+ )
106
+ ]) : _renderSlot(_ctx.$slots, "month", {
107
+ key: 2,
108
+ month: (_b = _ctx.chooseMonth) == null ? void 0 : _b.index,
109
+ year: _ctx.chooseYear
110
+ }, () => [
111
+ _createTextVNode(
112
+ _toDisplayString(_ctx.getMonthTitle),
113
+ 1
114
+ /* TEXT */
115
+ )
116
+ ])
117
+ ])) : (_openBlock(), _createElementBlock("div", {
118
+ key: `${_ctx.chooseYear}${(_c = _ctx.chooseMonth) == null ? void 0 : _c.index}${_ctx.chooseDay}`
119
+ }, [
120
+ _ctx.range ? _renderSlot(_ctx.$slots, "range", {
121
+ key: 0,
122
+ choose: _ctx.formatRange
123
+ }, () => [
124
+ _createTextVNode(
125
+ _toDisplayString(_ctx.getDateTitle),
126
+ 1
127
+ /* TEXT */
128
+ )
129
+ ]) : _ctx.multiple ? _renderSlot(_ctx.$slots, "multiple", {
130
+ key: 1,
131
+ choose: _ctx.getChoose.chooseDays
132
+ }, () => [
133
+ _createTextVNode(
134
+ _toDisplayString(_ctx.getDateTitle),
135
+ 1
136
+ /* TEXT */
137
+ )
138
+ ]) : _renderSlot(_ctx.$slots, "date", _normalizeProps(_mergeProps({ key: 2 }, _ctx.slotProps)), () => [
139
+ _createTextVNode(
140
+ _toDisplayString(_ctx.getDateTitle),
141
+ 1
142
+ /* TEXT */
143
+ )
144
+ ])
145
+ ]))
146
+ ];
147
+ }),
148
+ _: 3
149
+ /* FORWARDED */
150
+ }, 8, ["name"])
151
+ ],
152
+ 2
153
+ /* CLASS */
154
+ )
155
+ ],
156
+ 6
157
+ /* CLASS, STYLE */
158
+ ),
159
+ _createElementVNode(
160
+ "div",
161
+ {
162
+ class: _normalizeClass(_ctx.n("body")),
163
+ onTouchstart: _cache[2] || (_cache[2] = (...args) => _ctx.handleTouchstart && _ctx.handleTouchstart(...args)),
164
+ onTouchmove: _cache[3] || (_cache[3] = (...args) => _ctx.handleTouchmove && _ctx.handleTouchmove(...args)),
165
+ onTouchend: _cache[4] || (_cache[4] = (...args) => _ctx.handleTouchend && _ctx.handleTouchend(...args))
166
+ },
167
+ [
168
+ _createVNode(_Transition, {
169
+ name: `${_ctx.n()}-panel-fade`
170
+ }, {
171
+ default: _withCtx(() => [
172
+ _ctx.getPanelType === "year" ? (_openBlock(), _createBlock(_component_year_picker_panel, {
173
+ key: 0,
174
+ "component-props": _ctx.componentProps,
175
+ preview: _ctx.previewYear,
176
+ onChooseYear: _ctx.getChooseYear
177
+ }, null, 8, ["component-props", "preview", "onChooseYear"])) : _ctx.getPanelType === "month" ? (_openBlock(), _createBlock(_component_month_picker_panel, {
178
+ key: 1,
179
+ ref: "monthPanelEl",
180
+ current: _ctx.currentDate,
181
+ choose: _ctx.getChoose,
182
+ preview: _ctx.getPreview,
183
+ "click-year": () => _ctx.clickEl("year"),
184
+ "component-props": _ctx.componentProps,
185
+ onChooseMonth: _ctx.getChooseMonth,
186
+ onCheckPreview: _ctx.checkPreview
187
+ }, null, 8, ["current", "choose", "preview", "click-year", "component-props", "onChooseMonth", "onCheckPreview"])) : _ctx.getPanelType === "date" ? (_openBlock(), _createBlock(_component_day_picker_panel, {
188
+ key: 2,
189
+ ref: "dayPanelEl",
190
+ current: _ctx.currentDate,
191
+ choose: _ctx.getChoose,
192
+ preview: _ctx.getPreview,
193
+ "component-props": _ctx.componentProps,
194
+ "click-month": () => _ctx.clickEl("month"),
195
+ onChooseDay: _ctx.getChooseDay,
196
+ onCheckPreview: _ctx.checkPreview
197
+ }, null, 8, ["current", "choose", "preview", "component-props", "click-month", "onChooseDay", "onCheckPreview"])) : _createCommentVNode("v-if", true)
198
+ ]),
199
+ _: 1
200
+ /* STABLE */
201
+ }, 8, ["name"])
202
+ ],
203
+ 34
204
+ /* CLASS, HYDRATE_EVENTS */
205
+ )
206
+ ],
207
+ 2
208
+ /* CLASS */
209
+ );
111
210
  }
112
-
113
- var __sfc__ = defineComponent({
211
+ const __sfc__ = defineComponent({
114
212
  name,
115
213
  components: {
116
214
  MonthPickerPanel,
@@ -118,38 +216,38 @@ var __sfc__ = defineComponent({
118
216
  DayPickerPanel
119
217
  },
120
218
  props,
121
- setup(props) {
122
- var currentDate = dayjs().format('YYYY-MM-D');
123
- var [currentYear, currentMonth] = currentDate.split('-');
124
- var monthDes = MONTH_LIST.find(month => month.index === currentMonth);
125
- var isYearPanel = ref(false);
126
- var isMonthPanel = ref(false);
127
- var rangeDone = ref(true);
128
- var chooseMonth = ref();
129
- var chooseYear = ref();
130
- var chooseDay = ref();
131
- var previewMonth = ref(monthDes);
132
- var previewYear = ref(currentYear);
133
- var reverse = ref(false);
134
- var chooseMonths = ref([]);
135
- var chooseDays = ref([]);
136
- var chooseRangeMonth = ref([]);
137
- var chooseRangeDay = ref([]);
138
- var monthPanelEl = ref(null);
139
- var dayPanelEl = ref(null);
140
- var componentProps = reactive({
141
- allowedDates: props.allowedDates,
142
- type: props.type,
143
- color: props.color,
144
- firstDayOfWeek: props.firstDayOfWeek,
145
- min: props.min,
146
- max: props.max,
147
- showCurrent: props.showCurrent,
148
- multiple: props.multiple,
149
- range: props.range,
150
- buttonElevation: props.buttonElevation
219
+ setup(props2) {
220
+ const currentDate = dayjs().format("YYYY-MM-D");
221
+ const [currentYear, currentMonth] = currentDate.split("-");
222
+ const monthDes = MONTH_LIST.find((month) => month.index === currentMonth);
223
+ const isYearPanel = ref(false);
224
+ const isMonthPanel = ref(false);
225
+ const rangeDone = ref(true);
226
+ const chooseMonth = ref();
227
+ const chooseYear = ref();
228
+ const chooseDay = ref();
229
+ const previewMonth = ref(monthDes);
230
+ const previewYear = ref(currentYear);
231
+ const reverse = ref(false);
232
+ const chooseMonths = ref([]);
233
+ const chooseDays = ref([]);
234
+ const chooseRangeMonth = ref([]);
235
+ const chooseRangeDay = ref([]);
236
+ const monthPanelEl = ref(null);
237
+ const dayPanelEl = ref(null);
238
+ const componentProps = reactive({
239
+ allowedDates: props2.allowedDates,
240
+ type: props2.type,
241
+ color: props2.color,
242
+ firstDayOfWeek: props2.firstDayOfWeek,
243
+ min: props2.min,
244
+ max: props2.max,
245
+ showCurrent: props2.showCurrent,
246
+ multiple: props2.multiple,
247
+ range: props2.range,
248
+ buttonElevation: props2.buttonElevation
151
249
  });
152
- var getChoose = computed(() => ({
250
+ const getChoose = computed(() => ({
153
251
  chooseMonth: chooseMonth.value,
154
252
  chooseYear: chooseYear.value,
155
253
  chooseDay: chooseDay.value,
@@ -158,188 +256,193 @@ var __sfc__ = defineComponent({
158
256
  chooseRangeMonth: chooseRangeMonth.value,
159
257
  chooseRangeDay: chooseRangeDay.value
160
258
  }));
161
- var getPreview = computed(() => ({
259
+ const getPreview = computed(() => ({
162
260
  previewMonth: previewMonth.value,
163
261
  previewYear: previewYear.value
164
262
  }));
165
- var getMonthTitle = computed(() => {
166
- var {
167
- multiple,
168
- range
169
- } = props;
263
+ const getMonthTitle = computed(() => {
264
+ var _a, _b;
265
+ const { multiple, range } = props2;
170
266
  if (range) {
171
- return chooseRangeMonth.value.length ? chooseRangeMonth.value[0] + " ~ " + chooseRangeMonth.value[1] : '';
267
+ return chooseRangeMonth.value.length ? `${chooseRangeMonth.value[0]} ~ ${chooseRangeMonth.value[1]}` : "";
172
268
  }
173
- var monthName = '';
269
+ let monthName = "";
174
270
  if (chooseMonth.value) {
175
- var _pack$value$datePicke, _pack$value$datePicke2;
176
- monthName = (_pack$value$datePicke = (_pack$value$datePicke2 = pack.value.datePickerMonthDict) == null ? void 0 : _pack$value$datePicke2[chooseMonth.value.index].name) != null ? _pack$value$datePicke : '';
271
+ monthName = (_b = (_a = pack.value.datePickerMonthDict) == null ? void 0 : _a[chooseMonth.value.index].name) != null ? _b : "";
177
272
  }
178
- return multiple ? "" + chooseMonths.value.length + pack.value.datePickerSelected : monthName;
273
+ return multiple ? `${chooseMonths.value.length}${pack.value.datePickerSelected}` : monthName;
179
274
  });
180
- var getDateTitle = computed(() => {
181
- var _pack$value$datePicke3, _pack$value$datePicke4, _pack$value$datePicke5, _pack$value$datePicke6;
182
- var {
183
- multiple,
184
- range
185
- } = props;
275
+ const getDateTitle = computed(() => {
276
+ var _a, _b, _c, _d;
277
+ const { multiple, range } = props2;
186
278
  if (range) {
187
- var formatRangeDays = chooseRangeDay.value.map(date => dayjs(date).format('YYYY-MM-DD'));
188
- return formatRangeDays.length ? formatRangeDays[0] + " ~ " + formatRangeDays[1] : '';
279
+ const formatRangeDays = chooseRangeDay.value.map((date) => dayjs(date).format("YYYY-MM-DD"));
280
+ return formatRangeDays.length ? `${formatRangeDays[0]} ~ ${formatRangeDays[1]}` : "";
189
281
  }
190
- if (multiple) return "" + chooseDays.value.length + pack.value.datePickerSelected;
191
- if (!chooseYear.value || !chooseMonth.value || !chooseDay.value) return '';
192
- var weekIndex = dayjs(chooseYear.value + "-" + chooseMonth.value.index + "-" + chooseDay.value).day();
193
- var week = WEEK_HEADER.find(value => value.index === "" + weekIndex);
194
- var weekName = (_pack$value$datePicke3 = (_pack$value$datePicke4 = pack.value.datePickerWeekDict) == null ? void 0 : _pack$value$datePicke4[week.index].name) != null ? _pack$value$datePicke3 : '';
195
- var monthName = (_pack$value$datePicke5 = (_pack$value$datePicke6 = pack.value.datePickerMonthDict) == null ? void 0 : _pack$value$datePicke6[chooseMonth.value.index].name) != null ? _pack$value$datePicke5 : '';
196
- var showDay = padStart(chooseDay.value, 2, '0');
197
- if (pack.value.lang === 'zh-CN') return chooseMonth.value.index + "-" + showDay + " " + weekName.slice(0, 3);
198
- return weekName.slice(0, 3) + ", " + monthName.slice(0, 3) + " " + chooseDay.value;
282
+ if (multiple)
283
+ return `${chooseDays.value.length}${pack.value.datePickerSelected}`;
284
+ if (!chooseYear.value || !chooseMonth.value || !chooseDay.value)
285
+ return "";
286
+ const weekIndex = dayjs(`${chooseYear.value}-${chooseMonth.value.index}-${chooseDay.value}`).day();
287
+ const week = WEEK_HEADER.find((value) => value.index === `${weekIndex}`);
288
+ const weekName = (_b = (_a = pack.value.datePickerWeekDict) == null ? void 0 : _a[week.index].name) != null ? _b : "";
289
+ const monthName = (_d = (_c = pack.value.datePickerMonthDict) == null ? void 0 : _c[chooseMonth.value.index].name) != null ? _d : "";
290
+ const showDay = padStart(chooseDay.value, 2, "0");
291
+ if (pack.value.lang === "zh-CN")
292
+ return `${chooseMonth.value.index}-${showDay} ${weekName.slice(0, 3)}`;
293
+ return `${weekName.slice(0, 3)}, ${monthName.slice(0, 3)} ${chooseDay.value}`;
199
294
  });
200
- var getPanelType = computed(() => {
201
- if (isYearPanel.value) return 'year';
202
- if (props.type === 'month' || isMonthPanel.value) return 'month';
203
- if (props.type === 'date') return 'date';
204
- return '';
295
+ const getPanelType = computed(() => {
296
+ if (isYearPanel.value)
297
+ return "year";
298
+ if (props2.type === "month" || isMonthPanel.value)
299
+ return "month";
300
+ if (props2.type === "date")
301
+ return "date";
302
+ return "";
205
303
  });
206
- var isUntouchable = computed(() => !props.touchable || ['', 'year'].includes(getPanelType.value));
207
- var slotProps = computed(() => {
208
- var _chooseMonth$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2;
209
- var weekIndex = dayjs(chooseYear.value + "-" + ((_chooseMonth$value = chooseMonth.value) == null ? void 0 : _chooseMonth$value.index) + "-" + chooseDay.value).day();
210
- var date = chooseDay.value ? padStart(chooseDay.value, 2, '0') : '';
304
+ const isUntouchable = computed(() => !props2.touchable || ["", "year"].includes(getPanelType.value));
305
+ const slotProps = computed(() => {
306
+ var _a, _b, _c, _d;
307
+ const weekIndex = dayjs(`${chooseYear.value}-${(_a = chooseMonth.value) == null ? void 0 : _a.index}-${chooseDay.value}`).day();
308
+ const date = chooseDay.value ? padStart(chooseDay.value, 2, "0") : "";
211
309
  return {
212
- week: "" + weekIndex,
213
- year: (_chooseYear$value = chooseYear.value) != null ? _chooseYear$value : '',
214
- month: (_chooseMonth$value$in = (_chooseMonth$value2 = chooseMonth.value) == null ? void 0 : _chooseMonth$value2.index) != null ? _chooseMonth$value$in : '',
310
+ week: `${weekIndex}`,
311
+ year: (_b = chooseYear.value) != null ? _b : "",
312
+ month: (_d = (_c = chooseMonth.value) == null ? void 0 : _c.index) != null ? _d : "",
215
313
  date
216
314
  };
217
315
  });
218
- var formatRange = computed(() => getChoose.value.chooseRangeDay.map(choose => dayjs(choose).format('YYYY-MM-DD')));
219
- var isSameYear = computed(() => chooseYear.value === previewYear.value);
220
- var isSameMonth = computed(() => {
221
- var _chooseMonth$value3;
222
- return ((_chooseMonth$value3 = chooseMonth.value) == null ? void 0 : _chooseMonth$value3.index) === previewMonth.value.index;
223
- });
224
- var startX = 0;
225
- var startY = 0;
226
- var checkType = '';
227
- var touchDirection;
228
- watch(() => props.modelValue, value => {
229
- if (!checkValue() || invalidFormatDate(value) || !value) return;
230
- if (props.range) {
231
- if (!isArray(value)) return;
232
- rangeDone.value = value.length !== 1;
233
- rangeInit(value, props.type);
234
- } else if (props.multiple) {
235
- if (!isArray(value)) return;
236
- multipleInit(value, props.type);
237
- } else {
238
- dateInit(value);
239
- }
240
- }, {
241
- immediate: true
316
+ const formatRange = computed(
317
+ () => getChoose.value.chooseRangeDay.map((choose) => dayjs(choose).format("YYYY-MM-DD"))
318
+ );
319
+ const isSameYear = computed(() => chooseYear.value === previewYear.value);
320
+ const isSameMonth = computed(() => {
321
+ var _a;
322
+ return ((_a = chooseMonth.value) == null ? void 0 : _a.index) === previewMonth.value.index;
242
323
  });
324
+ let startX = 0;
325
+ let startY = 0;
326
+ let checkType = "";
327
+ let touchDirection;
328
+ watch(
329
+ () => props2.modelValue,
330
+ (value) => {
331
+ if (!checkValue() || invalidFormatDate(value) || !value)
332
+ return;
333
+ if (props2.range) {
334
+ if (!isArray(value))
335
+ return;
336
+ rangeDone.value = value.length !== 1;
337
+ rangeInit(value, props2.type);
338
+ } else if (props2.multiple) {
339
+ if (!isArray(value))
340
+ return;
341
+ multipleInit(value, props2.type);
342
+ } else {
343
+ dateInit(value);
344
+ }
345
+ },
346
+ { immediate: true }
347
+ );
243
348
  watch(getPanelType, resetState);
244
349
  function clickEl(type) {
245
- if (type === 'year') isYearPanel.value = true;else if (type === 'month') isMonthPanel.value = true;else {
350
+ if (type === "year")
351
+ isYearPanel.value = true;
352
+ else if (type === "month")
353
+ isMonthPanel.value = true;
354
+ else {
246
355
  isYearPanel.value = false;
247
356
  isMonthPanel.value = false;
248
357
  }
249
358
  }
250
359
  function handleTouchstart(event) {
251
- if (isUntouchable.value) return;
252
- var {
253
- clientX,
254
- clientY
255
- } = event.touches[0];
360
+ if (isUntouchable.value)
361
+ return;
362
+ const { clientX, clientY } = event.touches[0];
256
363
  startX = clientX;
257
364
  startY = clientY;
258
365
  }
259
366
  function getDirection(x, y) {
260
- return x >= y && x > 20 ? 'x' : 'y';
367
+ return x >= y && x > 20 ? "x" : "y";
261
368
  }
262
369
  function handleTouchmove(event) {
263
- if (isUntouchable.value) return;
264
- var {
265
- clientX,
266
- clientY
267
- } = event.touches[0];
268
- var x = clientX - startX;
269
- var y = clientY - startY;
370
+ if (isUntouchable.value)
371
+ return;
372
+ const { clientX, clientY } = event.touches[0];
373
+ const x = clientX - startX;
374
+ const y = clientY - startY;
270
375
  touchDirection = getDirection(Math.abs(x), Math.abs(y));
271
- checkType = x > 0 ? 'prev' : 'next';
376
+ checkType = x > 0 ? "prev" : "next";
272
377
  }
273
378
  function handleTouchend() {
274
- return _handleTouchend.apply(this, arguments);
275
- }
276
- function _handleTouchend() {
277
- _handleTouchend = _asyncToGenerator(function* () {
278
- if (isUntouchable.value || touchDirection !== 'x') return;
279
- var componentRef = getPanelType.value === 'month' ? monthPanelEl : dayPanelEl;
379
+ return __async(this, null, function* () {
380
+ if (isUntouchable.value || touchDirection !== "x")
381
+ return;
382
+ const componentRef = getPanelType.value === "month" ? monthPanelEl : dayPanelEl;
280
383
  yield doubleRaf();
281
384
  componentRef.value.forwardRef(checkType);
282
385
  resetState();
283
386
  });
284
- return _handleTouchend.apply(this, arguments);
285
387
  }
286
388
  function updateRange(date, type) {
287
- var rangeDate = type === 'month' ? chooseRangeMonth : chooseRangeDay;
389
+ const rangeDate = type === "month" ? chooseRangeMonth : chooseRangeDay;
288
390
  rangeDate.value = rangeDone.value ? [date, date] : [rangeDate.value[0], date];
289
391
  rangeDone.value = !rangeDone.value;
290
392
  if (rangeDone.value) {
291
- var isChangeOrder = dayjs(rangeDate.value[0]).isAfter(rangeDate.value[1]);
292
- var _date = isChangeOrder ? [rangeDate.value[1], rangeDate.value[0]] : [...rangeDate.value];
293
- call(props['onUpdate:modelValue'], _date);
294
- call(props.onChange, _date);
393
+ const isChangeOrder = dayjs(rangeDate.value[0]).isAfter(rangeDate.value[1]);
394
+ const date2 = isChangeOrder ? [rangeDate.value[1], rangeDate.value[0]] : [...rangeDate.value];
395
+ call(props2["onUpdate:modelValue"], date2);
396
+ call(props2.onChange, date2);
295
397
  }
296
398
  }
297
399
  function updateMultiple(date, type) {
298
- var multipleDates = type === 'month' ? chooseMonths : chooseDays;
299
- var formatType = type === 'month' ? 'YYYY-MM' : 'YYYY-MM-DD';
300
- var formatDates = multipleDates.value.map(date => dayjs(date).format(formatType));
301
- var index = formatDates.findIndex(choose => choose === date);
302
- if (index === -1) formatDates.push(date);else formatDates.splice(index, 1);
303
- call(props['onUpdate:modelValue'], formatDates);
304
- call(props.onChange, formatDates);
400
+ const multipleDates = type === "month" ? chooseMonths : chooseDays;
401
+ const formatType = type === "month" ? "YYYY-MM" : "YYYY-MM-DD";
402
+ const formatDates = multipleDates.value.map((date2) => dayjs(date2).format(formatType));
403
+ const index = formatDates.findIndex((choose) => choose === date);
404
+ if (index === -1)
405
+ formatDates.push(date);
406
+ else
407
+ formatDates.splice(index, 1);
408
+ call(props2["onUpdate:modelValue"], formatDates);
409
+ call(props2.onChange, formatDates);
305
410
  }
306
411
  function getReverse(dateType, date) {
307
- if (!chooseYear.value || !chooseMonth.value) return false;
308
- if (!isSameYear.value) return chooseYear.value > previewYear.value;
309
- if (dateType === 'month') return date.index < chooseMonth.value.index;
412
+ if (!chooseYear.value || !chooseMonth.value)
413
+ return false;
414
+ if (!isSameYear.value)
415
+ return chooseYear.value > previewYear.value;
416
+ if (dateType === "month")
417
+ return date.index < chooseMonth.value.index;
310
418
  return isSameMonth.value ? date < toNumber(chooseDay.value) : chooseMonth.value.index > previewMonth.value.index;
311
419
  }
312
420
  function getChooseDay(day) {
313
- var {
314
- readonly,
315
- range,
316
- multiple,
317
- onChange,
318
- 'onUpdate:modelValue': updateModelValue
319
- } = props;
320
- if (day < 0 || readonly) return;
321
- reverse.value = getReverse('day', day);
322
- var date = previewYear.value + "-" + previewMonth.value.index + "-" + day;
323
- var formatDate = dayjs(date).format('YYYY-MM-DD');
324
- if (range) updateRange(formatDate, 'day');else if (multiple) updateMultiple(formatDate, 'day');else {
421
+ const { readonly, range, multiple, onChange, "onUpdate:modelValue": updateModelValue } = props2;
422
+ if (day < 0 || readonly)
423
+ return;
424
+ reverse.value = getReverse("day", day);
425
+ const date = `${previewYear.value}-${previewMonth.value.index}-${day}`;
426
+ const formatDate = dayjs(date).format("YYYY-MM-DD");
427
+ if (range)
428
+ updateRange(formatDate, "day");
429
+ else if (multiple)
430
+ updateMultiple(formatDate, "day");
431
+ else {
325
432
  call(updateModelValue, formatDate);
326
433
  call(onChange, formatDate);
327
434
  }
328
435
  }
329
436
  function getChooseMonth(month) {
330
- var {
331
- type,
332
- readonly,
333
- range,
334
- multiple,
335
- onChange,
336
- onPreview,
337
- 'onUpdate:modelValue': updateModelValue
338
- } = props;
339
- reverse.value = getReverse('month', month);
340
- if (type === 'month' && !readonly) {
341
- var date = previewYear.value + "-" + month.index;
342
- if (range) updateRange(date, 'month');else if (multiple) updateMultiple(date, 'month');else {
437
+ const { type, readonly, range, multiple, onChange, onPreview, "onUpdate:modelValue": updateModelValue } = props2;
438
+ reverse.value = getReverse("month", month);
439
+ if (type === "month" && !readonly) {
440
+ const date = `${previewYear.value}-${month.index}`;
441
+ if (range)
442
+ updateRange(date, "month");
443
+ else if (multiple)
444
+ updateMultiple(date, "month");
445
+ else {
343
446
  call(updateModelValue, date);
344
447
  call(onChange, date);
345
448
  }
@@ -350,84 +453,85 @@ var __sfc__ = defineComponent({
350
453
  isMonthPanel.value = false;
351
454
  }
352
455
  function getChooseYear(year) {
353
- previewYear.value = "" + year;
456
+ previewYear.value = `${year}`;
354
457
  isYearPanel.value = false;
355
458
  isMonthPanel.value = true;
356
- call(props.onPreview, toNumber(previewYear.value), toNumber(previewMonth.value.index));
459
+ call(props2.onPreview, toNumber(previewYear.value), toNumber(previewMonth.value.index));
357
460
  }
358
- function checkPreview(type, checkType) {
359
- var changeValue = checkType === 'prev' ? -1 : 1;
360
- if (type === 'year') {
361
- previewYear.value = "" + (toNumber(previewYear.value) + changeValue);
461
+ function checkPreview(type, checkType2) {
462
+ const changeValue = checkType2 === "prev" ? -1 : 1;
463
+ if (type === "year") {
464
+ previewYear.value = `${toNumber(previewYear.value) + changeValue}`;
362
465
  } else {
363
- var checkIndex = toNumber(previewMonth.value.index) + changeValue;
466
+ let checkIndex = toNumber(previewMonth.value.index) + changeValue;
364
467
  if (checkIndex < 1) {
365
- previewYear.value = "" + (toNumber(previewYear.value) - 1);
468
+ previewYear.value = `${toNumber(previewYear.value) - 1}`;
366
469
  checkIndex = 12;
367
470
  }
368
471
  if (checkIndex > 12) {
369
- previewYear.value = "" + (toNumber(previewYear.value) + 1);
472
+ previewYear.value = `${toNumber(previewYear.value) + 1}`;
370
473
  checkIndex = 1;
371
474
  }
372
- previewMonth.value = MONTH_LIST.find(month => toNumber(month.index) === checkIndex);
475
+ previewMonth.value = MONTH_LIST.find((month) => toNumber(month.index) === checkIndex);
373
476
  }
374
- call(props.onPreview, toNumber(previewYear.value), toNumber(previewMonth.value.index));
477
+ call(props2.onPreview, toNumber(previewYear.value), toNumber(previewMonth.value.index));
375
478
  }
376
479
  function checkValue() {
377
- if ((props.multiple || props.range) && !isArray(props.modelValue)) {
480
+ if ((props2.multiple || props2.range) && !isArray(props2.modelValue)) {
378
481
  console.error('[Varlet] DatePicker: type of prop "modelValue" should be an Array');
379
482
  return false;
380
483
  }
381
- if (!props.multiple && !props.range && isArray(props.modelValue)) {
484
+ if (!props2.multiple && !props2.range && isArray(props2.modelValue)) {
382
485
  console.error('[Varlet] DatePicker: type of prop "modelValue" should be a String');
383
486
  return false;
384
487
  }
385
488
  return true;
386
489
  }
387
490
  function invalidFormatDate(date) {
388
- if (isArray(date)) return false;
389
- if (date === 'Invalid Date') {
491
+ if (isArray(date))
492
+ return false;
493
+ if (date === "Invalid Date") {
390
494
  console.error('[Varlet] DatePicker: "modelValue" is an Invalid Date');
391
495
  return true;
392
496
  }
393
497
  return false;
394
498
  }
395
499
  function rangeInit(value, type) {
396
- var rangeDate = type === 'month' ? chooseRangeMonth : chooseRangeDay;
397
- var formatType = type === 'month' ? 'YYYY-MM' : 'YYYY-MM-D';
398
- var formatDateList = value.map(choose => dayjs(choose).format(formatType)).slice(0, 2);
399
- var isValid = rangeDate.value.some(date => invalidFormatDate(date));
400
- if (isValid) return;
500
+ const rangeDate = type === "month" ? chooseRangeMonth : chooseRangeDay;
501
+ const formatType = type === "month" ? "YYYY-MM" : "YYYY-MM-D";
502
+ const formatDateList = value.map((choose) => dayjs(choose).format(formatType)).slice(0, 2);
503
+ const isValid = rangeDate.value.some((date) => invalidFormatDate(date));
504
+ if (isValid)
505
+ return;
401
506
  rangeDate.value = formatDateList;
402
- var isChangeOrder = dayjs(rangeDate.value[0]).isAfter(rangeDate.value[1]);
507
+ const isChangeOrder = dayjs(rangeDate.value[0]).isAfter(rangeDate.value[1]);
403
508
  if (rangeDate.value.length === 2 && isChangeOrder) {
404
509
  rangeDate.value = [rangeDate.value[1], rangeDate.value[0]];
405
510
  }
406
511
  }
407
512
  function multipleInit(value, type) {
408
- var rangeDate = type === 'month' ? chooseMonths : chooseDays;
409
- var formatType = type === 'month' ? 'YYYY-MM' : 'YYYY-MM-D';
410
-
411
- // need uniq
412
- var formatDateList = Array.from(new Set(value.map(choose => dayjs(choose).format(formatType))));
413
- rangeDate.value = formatDateList.filter(date => date !== 'Invalid Date');
513
+ const rangeDate = type === "month" ? chooseMonths : chooseDays;
514
+ const formatType = type === "month" ? "YYYY-MM" : "YYYY-MM-D";
515
+ const formatDateList = Array.from(new Set(value.map((choose) => dayjs(choose).format(formatType))));
516
+ rangeDate.value = formatDateList.filter((date) => date !== "Invalid Date");
414
517
  }
415
518
  function dateInit(value) {
416
- var formatDate = dayjs(value).format('YYYY-MM-D');
417
- if (invalidFormatDate(formatDate)) return;
418
- var [yearValue, monthValue, dayValue] = formatDate.split('-');
419
- var monthDes = MONTH_LIST.find(month => month.index === monthValue);
420
- chooseMonth.value = monthDes;
519
+ const formatDate = dayjs(value).format("YYYY-MM-D");
520
+ if (invalidFormatDate(formatDate))
521
+ return;
522
+ const [yearValue, monthValue, dayValue] = formatDate.split("-");
523
+ const monthDes2 = MONTH_LIST.find((month) => month.index === monthValue);
524
+ chooseMonth.value = monthDes2;
421
525
  chooseYear.value = yearValue;
422
526
  chooseDay.value = dayValue;
423
- previewMonth.value = monthDes;
527
+ previewMonth.value = monthDes2;
424
528
  previewYear.value = yearValue;
425
529
  }
426
530
  function resetState() {
427
531
  startY = 0;
428
532
  startX = 0;
429
- checkType = '';
430
- touchDirection = undefined;
533
+ checkType = "";
534
+ touchDirection = void 0;
431
535
  }
432
536
  return {
433
537
  monthPanelEl,
@@ -463,4 +567,7 @@ var __sfc__ = defineComponent({
463
567
  }
464
568
  });
465
569
  __sfc__.render = __render__;
466
- export default __sfc__;
570
+ var stdin_default = __sfc__;
571
+ export {
572
+ stdin_default as default
573
+ };