vxe-pc-ui 4.20.34 → 4.20.35

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 (367) hide show
  1. package/dist/all.esm.js +45718 -45038
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +307 -1
  4. package/dist/style.mini.css +1 -1
  5. package/es/alert/src/alert.js +117 -114
  6. package/es/anchor/src/anchor-link.js +110 -107
  7. package/es/anchor/src/anchor.js +212 -209
  8. package/es/avatar/src/avatar.js +132 -129
  9. package/es/backtop/src/backtop.js +267 -264
  10. package/es/badge/src/badge.js +102 -99
  11. package/es/breadcrumb/src/breadcrumb-item.js +104 -101
  12. package/es/breadcrumb/src/breadcrumb.js +70 -67
  13. package/es/button/src/button-group.js +88 -85
  14. package/es/calendar/src/calendar.js +1371 -1368
  15. package/es/card/src/card.js +235 -232
  16. package/es/carousel/src/carousel-item.js +78 -75
  17. package/es/carousel/src/carousel.js +392 -389
  18. package/es/cascader/src/cascader.js +1667 -1664
  19. package/es/checkbox/src/button.js +198 -195
  20. package/es/checkbox/src/checkbox.js +181 -178
  21. package/es/checkbox/src/group.js +210 -207
  22. package/es/collapse/src/collapse-pane.js +98 -95
  23. package/es/collapse/src/collapse.js +340 -337
  24. package/es/color-picker/src/color-picker.js +1116 -1113
  25. package/es/components.d.ts +1 -0
  26. package/es/components.js +3 -0
  27. package/es/context-menu/src/context-menu.js +601 -598
  28. package/es/countdown/src/countdown.js +224 -221
  29. package/es/date-panel/src/date-panel.js +1905 -1902
  30. package/es/date-picker/src/date-picker.js +1537 -1534
  31. package/es/date-range-picker/src/date-range-picker.js +1412 -1409
  32. package/es/divider/src/divider.js +80 -77
  33. package/es/drawer/src/drawer.js +778 -775
  34. package/es/empty/src/empty.js +100 -97
  35. package/es/form/src/form-group.js +74 -71
  36. package/es/form/src/form-item.js +76 -73
  37. package/es/form/src/form.js +789 -786
  38. package/es/icon/src/icon.js +59 -56
  39. package/es/icon/style.css +1 -1
  40. package/es/icon/style.mini.css +1 -1
  41. package/es/icon-picker/src/icon-picker.js +719 -716
  42. package/es/image/src/group.js +130 -127
  43. package/es/image/src/image.js +243 -240
  44. package/es/image/src/preview.js +627 -624
  45. package/es/index.esm.js +2 -0
  46. package/es/index.js +2 -0
  47. package/es/input/src/input.js +2700 -2697
  48. package/es/layout-aside/src/layout-aside.js +138 -135
  49. package/es/layout-body/src/layout-body.js +145 -142
  50. package/es/layout-container/src/layout-container.js +71 -68
  51. package/es/layout-footer/src/layout-footer.js +60 -57
  52. package/es/layout-header/src/layout-header.js +58 -55
  53. package/es/link/src/link.js +131 -128
  54. package/es/list/src/list.js +2174 -2171
  55. package/es/loading/src/loading.js +141 -138
  56. package/es/mention/src/mention.js +49 -46
  57. package/es/menu/src/menu.js +799 -796
  58. package/es/modal/src/modal.js +1519 -1527
  59. package/es/notice-bar/src/notice-bar.js +168 -165
  60. package/es/number-input/src/number-input.js +1094 -1091
  61. package/es/pager/src/pager.js +767 -764
  62. package/es/password-input/src/password-input.js +431 -428
  63. package/es/print/src/page-break.js +63 -60
  64. package/es/print/src/print.js +303 -300
  65. package/es/pulldown/src/pulldown.js +403 -400
  66. package/es/radio/src/button.js +214 -211
  67. package/es/radio/src/group.js +195 -192
  68. package/es/radio/src/radio.js +194 -191
  69. package/es/rate/src/rate.js +164 -161
  70. package/es/result/src/result.js +116 -113
  71. package/es/row/src/col.js +133 -130
  72. package/es/row/src/row.js +111 -108
  73. package/es/scrollbar/src/scrollbar.js +518 -515
  74. package/es/segmented/src/segmented.js +240 -237
  75. package/es/select/src/optgroup.js +44 -41
  76. package/es/select/src/option.js +39 -36
  77. package/es/select/src/select.js +1914 -1896
  78. package/es/slider/src/slider.js +419 -416
  79. package/es/space/src/space.js +190 -187
  80. package/es/splitter/src/splitter-panel.js +146 -143
  81. package/es/splitter/src/splitter.js +917 -914
  82. package/es/step-item/index.d.ts +76 -0
  83. package/es/step-item/index.js +17 -0
  84. package/es/steps/index.d.ts +288 -34
  85. package/es/steps/src/step-info.d.ts +6 -0
  86. package/es/steps/src/step-info.js +20 -0
  87. package/es/steps/src/step-item.d.ts +14 -0
  88. package/es/steps/src/step-item.js +39 -0
  89. package/es/steps/src/steps.d.ts +68 -8
  90. package/es/steps/src/steps.js +299 -47
  91. package/es/steps/src/util.d.ts +7 -0
  92. package/es/steps/src/util.js +44 -0
  93. package/es/steps/style.css +297 -0
  94. package/es/steps/style.mini.css +1 -0
  95. package/es/style.css +307 -1
  96. package/es/style.mini.css +1 -1
  97. package/es/switch/src/switch.js +228 -225
  98. package/es/table-select/src/table-select.js +865 -862
  99. package/es/table-transfer/src/table-transfer.js +61 -58
  100. package/es/tabs/src/tab-pane.js +102 -99
  101. package/es/tabs/src/tabs.js +936 -933
  102. package/es/tag/src/tag.js +163 -160
  103. package/es/text/src/text.js +232 -229
  104. package/es/text-ellipsis/src/text-ellipsis.js +252 -249
  105. package/es/textarea/src/textarea.js +434 -431
  106. package/es/timeline/src/timeline.js +74 -36
  107. package/es/timeline/src/util.js +7 -4
  108. package/es/tip/src/tip.js +117 -114
  109. package/es/tooltip/src/tooltip.js +552 -549
  110. package/es/tour/src/tour.js +49 -46
  111. package/es/transfer/src/transfer.js +95 -92
  112. package/es/tree/src/tree.js +3379 -3376
  113. package/es/tree-select/src/tree-select.js +969 -966
  114. package/es/ui/index.js +8 -2
  115. package/es/ui/src/log.js +1 -1
  116. package/es/upload/src/upload.js +1791 -1788
  117. package/es/vxe-icon/style.css +1 -1
  118. package/es/vxe-icon/style.mini.css +1 -1
  119. package/es/vxe-steps/style.css +297 -0
  120. package/es/vxe-steps/style.mini.css +1 -0
  121. package/es/watermark/src/watermark.js +158 -155
  122. package/lib/alert/src/alert.js +117 -114
  123. package/lib/anchor/src/anchor-link.js +110 -107
  124. package/lib/anchor/src/anchor.js +212 -209
  125. package/lib/avatar/src/avatar.js +132 -129
  126. package/lib/backtop/src/backtop.js +267 -264
  127. package/lib/badge/src/badge.js +102 -99
  128. package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
  129. package/lib/breadcrumb/src/breadcrumb.js +70 -67
  130. package/lib/button/src/button-group.js +88 -85
  131. package/lib/calendar/src/calendar.js +1371 -1368
  132. package/lib/card/src/card.js +235 -232
  133. package/lib/carousel/src/carousel-item.js +78 -75
  134. package/lib/carousel/src/carousel.js +392 -389
  135. package/lib/cascader/src/cascader.js +1665 -1662
  136. package/lib/checkbox/src/button.js +198 -195
  137. package/lib/checkbox/src/checkbox.js +181 -178
  138. package/lib/checkbox/src/group.js +210 -207
  139. package/lib/collapse/src/collapse-pane.js +98 -95
  140. package/lib/collapse/src/collapse.js +340 -337
  141. package/lib/color-picker/src/color-picker.js +1116 -1113
  142. package/lib/components.js +3 -0
  143. package/lib/context-menu/src/context-menu.js +601 -598
  144. package/lib/countdown/src/countdown.js +224 -221
  145. package/lib/date-panel/src/date-panel.js +1905 -1902
  146. package/lib/date-picker/src/date-picker.js +1537 -1534
  147. package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
  148. package/lib/divider/src/divider.js +80 -77
  149. package/lib/drawer/src/drawer.js +778 -775
  150. package/lib/empty/src/empty.js +100 -97
  151. package/lib/form/src/form-group.js +74 -71
  152. package/lib/form/src/form-item.js +76 -73
  153. package/lib/form/src/form.js +789 -786
  154. package/lib/icon/src/icon.js +59 -56
  155. package/lib/icon/style/style.css +1 -1
  156. package/lib/icon/style/style.mini.css +1 -1
  157. package/lib/icon-picker/src/icon-picker.js +719 -716
  158. package/lib/image/src/group.js +130 -127
  159. package/lib/image/src/image.js +243 -240
  160. package/lib/image/src/preview.js +627 -624
  161. package/lib/index.common.js +2 -0
  162. package/lib/index.js +2 -0
  163. package/lib/index.umd.js +47411 -46732
  164. package/lib/index.umd.min.js +3 -3
  165. package/lib/input/src/input.js +2700 -2697
  166. package/lib/layout-aside/src/layout-aside.js +138 -135
  167. package/lib/layout-body/src/layout-body.js +145 -142
  168. package/lib/layout-container/src/layout-container.js +71 -68
  169. package/lib/layout-footer/src/layout-footer.js +60 -57
  170. package/lib/layout-header/src/layout-header.js +58 -55
  171. package/lib/link/src/link.js +131 -128
  172. package/lib/list/src/list.js +2173 -2170
  173. package/lib/loading/src/loading.js +141 -138
  174. package/lib/mention/src/mention.js +49 -46
  175. package/lib/menu/src/menu.js +799 -796
  176. package/lib/modal/src/modal.js +1519 -1527
  177. package/lib/notice-bar/src/notice-bar.js +168 -165
  178. package/lib/number-input/src/number-input.js +1094 -1091
  179. package/lib/pager/src/pager.js +767 -764
  180. package/lib/password-input/src/password-input.js +431 -428
  181. package/lib/print/src/page-break.js +63 -60
  182. package/lib/print/src/print.js +303 -300
  183. package/lib/pulldown/src/pulldown.js +403 -400
  184. package/lib/radio/src/button.js +214 -211
  185. package/lib/radio/src/group.js +195 -192
  186. package/lib/radio/src/radio.js +194 -191
  187. package/lib/rate/src/rate.js +164 -161
  188. package/lib/result/src/result.js +116 -113
  189. package/lib/row/src/col.js +133 -130
  190. package/lib/row/src/row.js +111 -108
  191. package/lib/scrollbar/src/scrollbar.js +518 -515
  192. package/lib/segmented/src/segmented.js +240 -237
  193. package/lib/select/src/optgroup.js +44 -41
  194. package/lib/select/src/option.js +39 -36
  195. package/lib/select/src/select.js +1915 -1897
  196. package/lib/slider/src/slider.js +419 -416
  197. package/lib/space/src/space.js +190 -187
  198. package/lib/splitter/src/splitter-panel.js +146 -143
  199. package/lib/splitter/src/splitter.js +917 -914
  200. package/lib/step-item/index.js +47 -0
  201. package/lib/steps/src/step-info.js +49 -0
  202. package/lib/steps/src/step-item.js +59 -0
  203. package/lib/steps/src/steps.js +298 -46
  204. package/lib/steps/src/util.js +74 -0
  205. package/lib/steps/style/style.css +297 -0
  206. package/lib/steps/style/style.mini.css +1 -0
  207. package/lib/style.css +307 -1
  208. package/lib/style.mini.css +1 -1
  209. package/lib/switch/src/switch.js +228 -225
  210. package/lib/table-select/src/table-select.js +865 -862
  211. package/lib/table-transfer/src/table-transfer.js +61 -58
  212. package/lib/tabs/src/tab-pane.js +102 -99
  213. package/lib/tabs/src/tabs.js +936 -933
  214. package/lib/tag/src/tag.js +163 -160
  215. package/lib/text/src/text.js +232 -229
  216. package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
  217. package/lib/textarea/src/textarea.js +434 -431
  218. package/lib/timeline/src/timeline.js +74 -36
  219. package/lib/timeline/src/util.js +7 -4
  220. package/lib/tip/src/tip.js +117 -114
  221. package/lib/tooltip/src/tooltip.js +552 -549
  222. package/lib/tour/src/tour.js +49 -46
  223. package/lib/transfer/src/transfer.js +95 -92
  224. package/lib/tree/src/tree.js +3379 -3376
  225. package/lib/tree-select/src/tree-select.js +969 -966
  226. package/lib/ui/index.js +8 -2
  227. package/lib/ui/src/log.js +1 -1
  228. package/lib/upload/src/upload.js +1788 -1785
  229. package/lib/vxe-icon/style/style.css +1 -1
  230. package/lib/vxe-icon/style/style.mini.css +1 -1
  231. package/lib/vxe-steps/style/style.css +297 -0
  232. package/lib/vxe-steps/style/style.mini.css +1 -0
  233. package/lib/watermark/src/watermark.js +158 -155
  234. package/package.json +1 -1
  235. package/packages/alert/src/alert.ts +2 -2
  236. package/packages/anchor/src/anchor-link.ts +2 -2
  237. package/packages/anchor/src/anchor.ts +2 -2
  238. package/packages/avatar/src/avatar.ts +2 -2
  239. package/packages/backtop/src/backtop.ts +2 -2
  240. package/packages/badge/src/badge.ts +2 -2
  241. package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
  242. package/packages/breadcrumb/src/breadcrumb.ts +2 -2
  243. package/packages/button/src/button-group.ts +2 -2
  244. package/packages/calendar/src/calendar.ts +2 -2
  245. package/packages/card/src/card.ts +2 -2
  246. package/packages/carousel/src/carousel-item.ts +2 -2
  247. package/packages/carousel/src/carousel.ts +2 -2
  248. package/packages/cascader/src/cascader.ts +2 -2
  249. package/packages/checkbox/src/button.ts +3 -15
  250. package/packages/checkbox/src/checkbox.ts +2 -2
  251. package/packages/checkbox/src/group.ts +2 -2
  252. package/packages/collapse/src/collapse-pane.ts +2 -2
  253. package/packages/collapse/src/collapse.ts +2 -2
  254. package/packages/color-picker/src/color-picker.ts +2 -2
  255. package/packages/components.ts +3 -0
  256. package/packages/context-menu/src/context-menu.ts +3 -16
  257. package/packages/countdown/src/countdown.ts +2 -2
  258. package/packages/date-panel/src/date-panel.ts +2 -2
  259. package/packages/date-picker/src/date-picker.ts +2 -2
  260. package/packages/date-range-picker/src/date-range-picker.ts +2 -2
  261. package/packages/divider/src/divider.ts +2 -2
  262. package/packages/drawer/src/drawer.ts +2 -2
  263. package/packages/empty/src/empty.ts +2 -2
  264. package/packages/form/src/form-group.ts +2 -2
  265. package/packages/form/src/form-item.ts +2 -2
  266. package/packages/form/src/form.ts +2 -2
  267. package/packages/icon/src/icon.ts +2 -2
  268. package/packages/icon-picker/src/icon-picker.ts +2 -2
  269. package/packages/image/src/group.ts +2 -2
  270. package/packages/image/src/image.ts +2 -2
  271. package/packages/image/src/preview.ts +3 -16
  272. package/packages/index.ts +2 -2
  273. package/packages/input/src/input.ts +2 -2
  274. package/packages/layout-aside/src/layout-aside.ts +2 -2
  275. package/packages/layout-body/src/layout-body.ts +2 -2
  276. package/packages/layout-container/src/layout-container.ts +3 -14
  277. package/packages/layout-footer/src/layout-footer.ts +2 -2
  278. package/packages/layout-header/src/layout-header.ts +2 -2
  279. package/packages/link/src/link.ts +2 -2
  280. package/packages/list/src/list.ts +2 -2
  281. package/packages/loading/src/loading.ts +2 -2
  282. package/packages/mention/src/mention.ts +2 -2
  283. package/packages/menu/src/menu.ts +2 -2
  284. package/packages/modal/src/modal.ts +5 -20
  285. package/packages/notice-bar/src/notice-bar.ts +2 -2
  286. package/packages/number-input/src/number-input.ts +3 -17
  287. package/packages/pager/src/pager.ts +2 -2
  288. package/packages/password-input/src/password-input.ts +2 -2
  289. package/packages/print/src/page-break.ts +2 -2
  290. package/packages/print/src/print.ts +2 -2
  291. package/packages/pulldown/src/pulldown.ts +2 -2
  292. package/packages/radio/src/button.ts +3 -16
  293. package/packages/radio/src/group.ts +3 -17
  294. package/packages/radio/src/radio.ts +2 -2
  295. package/packages/rate/src/rate.ts +2 -2
  296. package/packages/result/src/result.ts +2 -2
  297. package/packages/row/src/col.ts +2 -2
  298. package/packages/row/src/row.ts +2 -2
  299. package/packages/scrollbar/src/scrollbar.ts +3 -4
  300. package/packages/segmented/src/segmented.ts +2 -2
  301. package/packages/select/src/optgroup.ts +2 -2
  302. package/packages/select/src/option.ts +2 -2
  303. package/packages/select/src/select.ts +33 -19
  304. package/packages/slider/src/slider.ts +2 -2
  305. package/packages/space/src/space.ts +2 -2
  306. package/packages/splitter/src/splitter-panel.ts +2 -2
  307. package/packages/splitter/src/splitter.ts +2 -2
  308. package/packages/step-item/index.ts +16 -0
  309. package/packages/steps/src/step-info.ts +18 -0
  310. package/packages/steps/src/step-item.ts +41 -0
  311. package/packages/steps/src/steps.ts +273 -13
  312. package/packages/steps/src/util.ts +44 -0
  313. package/packages/switch/src/switch.ts +2 -2
  314. package/packages/table-select/src/table-select.ts +2 -2
  315. package/packages/table-transfer/src/table-transfer.ts +3 -15
  316. package/packages/tabs/src/tab-pane.ts +2 -2
  317. package/packages/tabs/src/tabs.ts +2 -2
  318. package/packages/tag/src/tag.ts +2 -2
  319. package/packages/text/src/text.ts +2 -2
  320. package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
  321. package/packages/textarea/src/textarea.ts +2 -2
  322. package/packages/timeline/src/timeline-info.ts +17 -17
  323. package/packages/timeline/src/timeline.ts +93 -49
  324. package/packages/timeline/src/util.ts +44 -41
  325. package/packages/tip/src/tip.ts +2 -2
  326. package/packages/tooltip/src/tooltip.ts +2 -2
  327. package/packages/tour/src/tour.ts +2 -2
  328. package/packages/transfer/src/transfer.ts +2 -2
  329. package/packages/tree/src/tree.ts +2 -2
  330. package/packages/tree-select/src/tree-select.ts +2 -2
  331. package/packages/ui/index.ts +8 -1
  332. package/packages/upload/src/upload.ts +2 -2
  333. package/packages/watermark/src/watermark.ts +2 -2
  334. package/styles/all.scss +1 -0
  335. package/styles/components/step-item.scss +0 -0
  336. package/styles/components/steps.scss +354 -0
  337. package/styles/theme/base.scss +9 -0
  338. package/types/all.d.ts +3 -0
  339. package/types/components/gantt.d.ts +1 -3
  340. package/types/components/select.d.ts +1 -13
  341. package/types/components/step-item.d.ts +72 -0
  342. package/types/components/steps.d.ts +67 -8
  343. package/types/components/table.d.ts +7 -66
  344. package/types/handles/form-design.d.ts +1 -4
  345. package/types/ui/global-config.d.ts +2 -0
  346. package/types/ui/global-icon.d.ts +7 -0
  347. /package/dist/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  348. /package/dist/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  349. /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  350. /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  351. /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  352. /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  353. /package/es/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  354. /package/es/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  355. /package/es/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  356. /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  357. /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  358. /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  359. /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  360. /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  361. /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  362. /package/lib/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  363. /package/lib/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  364. /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  365. /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  366. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  367. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
@@ -42,1442 +42,1445 @@ var import_button = __toESM(require("../../button"));
42
42
  var import_xe_utils = __toESM(require("xe-utils"));
43
43
  const { errLog } = (0, import_log.createComponentLog)("calendar");
44
44
  const { createEvent, useFns, renderEmptyElement, menus, getConfig, getI18n } = import_core.VxeUI;
45
- var calendar_default = (0, import_comp.defineVxeComponent)({
46
- name: "VxeCalendar",
47
- props: {
48
- modelValue: [String, Number, Date],
49
- type: {
50
- type: String,
51
- default: "date"
52
- },
53
- className: String,
54
- size: {
55
- type: String,
56
- default: () => getConfig().calendar.size || getConfig().size
57
- },
58
- multiple: Boolean,
59
- width: [String, Number],
60
- height: [String, Number],
61
- // date、week、month、quarter、year
62
- minDate: {
63
- type: [String, Number, Date],
64
- default: () => getConfig().calendar.minDate
65
- },
66
- maxDate: {
67
- type: [String, Number, Date],
68
- default: () => getConfig().calendar.maxDate
69
- },
70
- startDay: {
71
- type: [String, Number],
72
- default: () => getConfig().calendar.startDay
73
- },
74
- labelFormat: String,
75
- valueFormat: String,
76
- festivalMethod: Function,
77
- disabledMethod: Function,
78
- cellStyle: [Object, Function],
79
- menuConfig: Object,
80
- // week
81
- selectDay: {
82
- type: [String, Number],
83
- default: () => getConfig().calendar.selectDay
84
- }
85
- },
86
- emits: ["update:modelValue", "change", "cell-click", "date-prev", "date-today", "date-next", "view-change", "cell-menu", "menu-click"],
87
- setup(props, context) {
88
- const { emit } = context;
89
- const xID = import_xe_utils.default.uniqueId();
90
- const { computeSize } = useFns.useSize(props);
91
- const reactData = (0, import_vue.reactive)({
92
- selectValue: props.modelValue,
93
- inputValue: props.modelValue,
94
- datePanelValue: null,
95
- datePanelLabel: "",
96
- datePanelType: "day",
97
- selectMonth: null,
98
- currentDate: null
99
- });
100
- const internalData = {
101
- yearSize: 12,
102
- monthSize: 20,
103
- quarterSize: 8
104
- };
105
- const defaultFuncProps = {
106
- festivalMethod: getConfig().calendar.festivalMethod,
107
- disabledMethod: getConfig().calendar.disabledMethod
108
- };
109
- const refElem = (0, import_vue.ref)();
110
- const refMaps = {
111
- refElem
112
- };
113
- const $xeCalendar = {
114
- xID,
115
- props,
116
- context,
117
- reactData,
118
- internalData,
119
- getRefMaps: () => refMaps
120
- };
121
- const computeCalendarStyle = (0, import_vue.computed)(() => {
122
- const { height, width } = props;
123
- const stys = {};
124
- if (width) {
125
- stys.width = (0, import_dom.toCssUnit)(width);
126
- }
127
- if (height) {
128
- stys.height = (0, import_dom.toCssUnit)(height);
45
+ var calendar_default = (
46
+ /* define-vxe-component start */
47
+ (0, import_comp.defineVxeComponent)({
48
+ name: "VxeCalendar",
49
+ props: {
50
+ modelValue: [String, Number, Date],
51
+ type: {
52
+ type: String,
53
+ default: "date"
54
+ },
55
+ className: String,
56
+ size: {
57
+ type: String,
58
+ default: () => getConfig().calendar.size || getConfig().size
59
+ },
60
+ multiple: Boolean,
61
+ width: [String, Number],
62
+ height: [String, Number],
63
+ // date、week、month、quarter、year
64
+ minDate: {
65
+ type: [String, Number, Date],
66
+ default: () => getConfig().calendar.minDate
67
+ },
68
+ maxDate: {
69
+ type: [String, Number, Date],
70
+ default: () => getConfig().calendar.maxDate
71
+ },
72
+ startDay: {
73
+ type: [String, Number],
74
+ default: () => getConfig().calendar.startDay
75
+ },
76
+ labelFormat: String,
77
+ valueFormat: String,
78
+ festivalMethod: Function,
79
+ disabledMethod: Function,
80
+ cellStyle: [Object, Function],
81
+ menuConfig: Object,
82
+ // week
83
+ selectDay: {
84
+ type: [String, Number],
85
+ default: () => getConfig().calendar.selectDay
129
86
  }
130
- return stys;
131
- });
132
- const computeIsDisabled = (0, import_vue.computed)(() => {
133
- return false;
134
- });
135
- const computeIsCalendarType = (0, import_vue.computed)(() => {
136
- return ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
137
- });
138
- const computeDateStartTime = (0, import_vue.computed)(() => {
139
- return props.minDate ? import_xe_utils.default.toStringDate(props.minDate) : null;
140
- });
141
- const computeDateEndTime = (0, import_vue.computed)(() => {
142
- return props.maxDate ? import_xe_utils.default.toStringDate(props.maxDate) : null;
143
- });
144
- const computeSupportMultiples = (0, import_vue.computed)(() => {
145
- return ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
146
- });
147
- const computeMenuOpts = (0, import_vue.computed)(() => {
148
- return Object.assign({}, getConfig().calendar.menuConfig, props.menuConfig);
149
- });
150
- const computeDateListValue = (0, import_vue.computed)(() => {
151
- const { multiple } = props;
152
- const { selectValue } = reactData;
153
- const isCalendarType = computeIsCalendarType.value;
154
- const dateValueFormat = computeDateValueFormat.value;
155
- if (multiple && selectValue && isCalendarType) {
156
- return import_xe_utils.default.toValueString(selectValue).split(",").map((item) => {
157
- const date = parseDate(item, dateValueFormat);
87
+ },
88
+ emits: ["update:modelValue", "change", "cell-click", "date-prev", "date-today", "date-next", "view-change", "cell-menu", "menu-click"],
89
+ setup(props, context) {
90
+ const { emit } = context;
91
+ const xID = import_xe_utils.default.uniqueId();
92
+ const { computeSize } = useFns.useSize(props);
93
+ const reactData = (0, import_vue.reactive)({
94
+ selectValue: props.modelValue,
95
+ inputValue: props.modelValue,
96
+ datePanelValue: null,
97
+ datePanelLabel: "",
98
+ datePanelType: "day",
99
+ selectMonth: null,
100
+ currentDate: null
101
+ });
102
+ const internalData = {
103
+ yearSize: 12,
104
+ monthSize: 20,
105
+ quarterSize: 8
106
+ };
107
+ const defaultFuncProps = {
108
+ festivalMethod: getConfig().calendar.festivalMethod,
109
+ disabledMethod: getConfig().calendar.disabledMethod
110
+ };
111
+ const refElem = (0, import_vue.ref)();
112
+ const refMaps = {
113
+ refElem
114
+ };
115
+ const $xeCalendar = {
116
+ xID,
117
+ props,
118
+ context,
119
+ reactData,
120
+ internalData,
121
+ getRefMaps: () => refMaps
122
+ };
123
+ const computeCalendarStyle = (0, import_vue.computed)(() => {
124
+ const { height, width } = props;
125
+ const stys = {};
126
+ if (width) {
127
+ stys.width = (0, import_dom.toCssUnit)(width);
128
+ }
129
+ if (height) {
130
+ stys.height = (0, import_dom.toCssUnit)(height);
131
+ }
132
+ return stys;
133
+ });
134
+ const computeIsDisabled = (0, import_vue.computed)(() => {
135
+ return false;
136
+ });
137
+ const computeIsCalendarType = (0, import_vue.computed)(() => {
138
+ return ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
139
+ });
140
+ const computeDateStartTime = (0, import_vue.computed)(() => {
141
+ return props.minDate ? import_xe_utils.default.toStringDate(props.minDate) : null;
142
+ });
143
+ const computeDateEndTime = (0, import_vue.computed)(() => {
144
+ return props.maxDate ? import_xe_utils.default.toStringDate(props.maxDate) : null;
145
+ });
146
+ const computeSupportMultiples = (0, import_vue.computed)(() => {
147
+ return ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
148
+ });
149
+ const computeMenuOpts = (0, import_vue.computed)(() => {
150
+ return Object.assign({}, getConfig().calendar.menuConfig, props.menuConfig);
151
+ });
152
+ const computeDateListValue = (0, import_vue.computed)(() => {
153
+ const { multiple } = props;
154
+ const { selectValue } = reactData;
155
+ const isCalendarType = computeIsCalendarType.value;
156
+ const dateValueFormat = computeDateValueFormat.value;
157
+ if (multiple && selectValue && isCalendarType) {
158
+ return import_xe_utils.default.toValueString(selectValue).split(",").map((item) => {
159
+ const date = parseDate(item, dateValueFormat);
160
+ if (import_xe_utils.default.isValidDate(date)) {
161
+ return date;
162
+ }
163
+ return null;
164
+ });
165
+ }
166
+ return [];
167
+ });
168
+ const computeDateMultipleValue = (0, import_vue.computed)(() => {
169
+ const dateListValue = computeDateListValue.value;
170
+ const dateValueFormat = computeDateValueFormat.value;
171
+ return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateValueFormat));
172
+ });
173
+ const computeDateMultipleLabel = (0, import_vue.computed)(() => {
174
+ const dateListValue = computeDateListValue.value;
175
+ const dateLabelFormat = computeDateLabelFormat.value;
176
+ return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateLabelFormat)).join(", ");
177
+ });
178
+ const computeDateValueFormat = (0, import_vue.computed)(() => {
179
+ const { valueFormat } = props;
180
+ if (valueFormat) {
181
+ return valueFormat;
182
+ }
183
+ return "yyyy-MM-dd";
184
+ });
185
+ const computeDateValue = (0, import_vue.computed)(() => {
186
+ const { selectValue } = reactData;
187
+ const isCalendarType = computeIsCalendarType.value;
188
+ const dateValueFormat = computeDateValueFormat.value;
189
+ let val = null;
190
+ if (selectValue && isCalendarType) {
191
+ const date = parseDate(selectValue, dateValueFormat);
158
192
  if (import_xe_utils.default.isValidDate(date)) {
159
- return date;
193
+ val = date;
160
194
  }
161
- return null;
162
- });
163
- }
164
- return [];
165
- });
166
- const computeDateMultipleValue = (0, import_vue.computed)(() => {
167
- const dateListValue = computeDateListValue.value;
168
- const dateValueFormat = computeDateValueFormat.value;
169
- return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateValueFormat));
170
- });
171
- const computeDateMultipleLabel = (0, import_vue.computed)(() => {
172
- const dateListValue = computeDateListValue.value;
173
- const dateLabelFormat = computeDateLabelFormat.value;
174
- return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateLabelFormat)).join(", ");
175
- });
176
- const computeDateValueFormat = (0, import_vue.computed)(() => {
177
- const { valueFormat } = props;
178
- if (valueFormat) {
179
- return valueFormat;
180
- }
181
- return "yyyy-MM-dd";
182
- });
183
- const computeDateValue = (0, import_vue.computed)(() => {
184
- const { selectValue } = reactData;
185
- const isCalendarType = computeIsCalendarType.value;
186
- const dateValueFormat = computeDateValueFormat.value;
187
- let val = null;
188
- if (selectValue && isCalendarType) {
189
- const date = parseDate(selectValue, dateValueFormat);
190
- if (import_xe_utils.default.isValidDate(date)) {
191
- val = date;
192
195
  }
193
- }
194
- return val;
195
- });
196
- const computeIsDisabledPrevDateBtn = (0, import_vue.computed)(() => {
197
- const dateStartTime = computeDateStartTime.value;
198
- const { selectMonth } = reactData;
199
- if (selectMonth && dateStartTime) {
200
- return selectMonth <= dateStartTime;
201
- }
202
- return false;
203
- });
204
- const computeIsDisabledNextDateBtn = (0, import_vue.computed)(() => {
205
- const dateEndTime = computeDateEndTime.value;
206
- const { selectMonth } = reactData;
207
- if (selectMonth && dateEndTime) {
208
- return selectMonth >= dateEndTime;
209
- }
210
- return false;
211
- });
212
- const computeDateHMSTime = (0, import_vue.computed)(() => {
213
- const dateValue = computeDateValue.value;
214
- return dateValue ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1e3 : 0;
215
- });
216
- const computeDateLabelFormat = (0, import_vue.computed)(() => {
217
- const { labelFormat } = props;
218
- const isCalendarType = computeIsCalendarType.value;
219
- const dateValueFormat = computeDateValueFormat.value;
220
- if (isCalendarType) {
221
- return labelFormat || dateValueFormat || getI18n(`vxe.input.date.labelFormat.${props.type}`);
222
- }
223
- return null;
224
- });
225
- const computeYearList = (0, import_vue.computed)(() => {
226
- const { selectMonth, currentDate } = reactData;
227
- const { yearSize } = internalData;
228
- const years = [];
229
- if (selectMonth && currentDate) {
230
- const currFullYear = currentDate.getFullYear();
231
- const selectFullYear = selectMonth.getFullYear();
232
- const startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1);
233
- for (let index = -4; index < yearSize + 4; index++) {
234
- const date = import_xe_utils.default.getWhatYear(startYearDate, index, "first");
235
- const itemFullYear = date.getFullYear();
236
- years.push({
237
- date,
238
- isCurrent: true,
239
- isPrev: index < 0,
240
- isNow: currFullYear === itemFullYear,
241
- isNext: index >= yearSize,
242
- year: itemFullYear
243
- });
196
+ return val;
197
+ });
198
+ const computeIsDisabledPrevDateBtn = (0, import_vue.computed)(() => {
199
+ const dateStartTime = computeDateStartTime.value;
200
+ const { selectMonth } = reactData;
201
+ if (selectMonth && dateStartTime) {
202
+ return selectMonth <= dateStartTime;
244
203
  }
245
- }
246
- return years;
247
- });
248
- const computeSelectDatePanelObj = (0, import_vue.computed)(() => {
249
- const isCalendarType = computeIsCalendarType.value;
250
- let y = "";
251
- let m = "";
252
- if (isCalendarType) {
253
- const { datePanelType, selectMonth } = reactData;
254
- const yearList = computeYearList.value;
255
- let year = "";
256
- let month;
257
- if (selectMonth) {
258
- year = selectMonth.getFullYear();
259
- month = selectMonth.getMonth() + 1;
204
+ return false;
205
+ });
206
+ const computeIsDisabledNextDateBtn = (0, import_vue.computed)(() => {
207
+ const dateEndTime = computeDateEndTime.value;
208
+ const { selectMonth } = reactData;
209
+ if (selectMonth && dateEndTime) {
210
+ return selectMonth >= dateEndTime;
260
211
  }
261
- if (datePanelType === "quarter" || datePanelType === "month") {
262
- y = `${year}`;
263
- } else if (datePanelType === "year") {
264
- y = yearList.length ? `${yearList[0].year} - ${yearList[yearList.length - 1].year}` : "";
265
- } else {
266
- y = `${year}`;
267
- m = month ? getI18n("vxe.calendar.monthLabel", [month]) : "-";
212
+ return false;
213
+ });
214
+ const computeDateHMSTime = (0, import_vue.computed)(() => {
215
+ const dateValue = computeDateValue.value;
216
+ return dateValue ? (dateValue.getHours() * 3600 + dateValue.getMinutes() * 60 + dateValue.getSeconds()) * 1e3 : 0;
217
+ });
218
+ const computeDateLabelFormat = (0, import_vue.computed)(() => {
219
+ const { labelFormat } = props;
220
+ const isCalendarType = computeIsCalendarType.value;
221
+ const dateValueFormat = computeDateValueFormat.value;
222
+ if (isCalendarType) {
223
+ return labelFormat || dateValueFormat || getI18n(`vxe.input.date.labelFormat.${props.type}`);
268
224
  }
269
- }
270
- return {
271
- y: getI18n("vxe.calendar.yearLabel", [y]),
272
- m
273
- };
274
- });
275
- const computeFirstDayOfWeek = (0, import_vue.computed)(() => {
276
- const { startDay } = props;
277
- return import_xe_utils.default.toNumber(startDay);
278
- });
279
- const computeWeekDatas = (0, import_vue.computed)(() => {
280
- const weeks = [];
281
- const isCalendarType = computeIsCalendarType.value;
282
- if (isCalendarType) {
283
- let sWeek = computeFirstDayOfWeek.value;
284
- weeks.push(sWeek);
285
- for (let index = 0; index < 6; index++) {
286
- if (sWeek >= 6) {
287
- sWeek = 0;
225
+ return null;
226
+ });
227
+ const computeYearList = (0, import_vue.computed)(() => {
228
+ const { selectMonth, currentDate } = reactData;
229
+ const { yearSize } = internalData;
230
+ const years = [];
231
+ if (selectMonth && currentDate) {
232
+ const currFullYear = currentDate.getFullYear();
233
+ const selectFullYear = selectMonth.getFullYear();
234
+ const startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1);
235
+ for (let index = -4; index < yearSize + 4; index++) {
236
+ const date = import_xe_utils.default.getWhatYear(startYearDate, index, "first");
237
+ const itemFullYear = date.getFullYear();
238
+ years.push({
239
+ date,
240
+ isCurrent: true,
241
+ isPrev: index < 0,
242
+ isNow: currFullYear === itemFullYear,
243
+ isNext: index >= yearSize,
244
+ year: itemFullYear
245
+ });
246
+ }
247
+ }
248
+ return years;
249
+ });
250
+ const computeSelectDatePanelObj = (0, import_vue.computed)(() => {
251
+ const isCalendarType = computeIsCalendarType.value;
252
+ let y = "";
253
+ let m = "";
254
+ if (isCalendarType) {
255
+ const { datePanelType, selectMonth } = reactData;
256
+ const yearList = computeYearList.value;
257
+ let year = "";
258
+ let month;
259
+ if (selectMonth) {
260
+ year = selectMonth.getFullYear();
261
+ month = selectMonth.getMonth() + 1;
262
+ }
263
+ if (datePanelType === "quarter" || datePanelType === "month") {
264
+ y = `${year}`;
265
+ } else if (datePanelType === "year") {
266
+ y = yearList.length ? `${yearList[0].year} - ${yearList[yearList.length - 1].year}` : "";
288
267
  } else {
289
- sWeek++;
268
+ y = `${year}`;
269
+ m = month ? getI18n("vxe.calendar.monthLabel", [month]) : "-";
290
270
  }
271
+ }
272
+ return {
273
+ y: getI18n("vxe.calendar.yearLabel", [y]),
274
+ m
275
+ };
276
+ });
277
+ const computeFirstDayOfWeek = (0, import_vue.computed)(() => {
278
+ const { startDay } = props;
279
+ return import_xe_utils.default.toNumber(startDay);
280
+ });
281
+ const computeWeekDatas = (0, import_vue.computed)(() => {
282
+ const weeks = [];
283
+ const isCalendarType = computeIsCalendarType.value;
284
+ if (isCalendarType) {
285
+ let sWeek = computeFirstDayOfWeek.value;
291
286
  weeks.push(sWeek);
287
+ for (let index = 0; index < 6; index++) {
288
+ if (sWeek >= 6) {
289
+ sWeek = 0;
290
+ } else {
291
+ sWeek++;
292
+ }
293
+ weeks.push(sWeek);
294
+ }
292
295
  }
293
- }
294
- return weeks;
295
- });
296
- const computeDateHeaders = (0, import_vue.computed)(() => {
297
- const isCalendarType = computeIsCalendarType.value;
298
- if (isCalendarType) {
299
- const weekDatas = computeWeekDatas.value;
300
- return weekDatas.map((day) => {
301
- return {
302
- value: day,
303
- label: getI18n(`vxe.input.date.weeks.w${day}`)
304
- };
305
- });
306
- }
307
- return [];
308
- });
309
- const computeWeekHeaders = (0, import_vue.computed)(() => {
310
- const isCalendarType = computeIsCalendarType.value;
311
- if (isCalendarType) {
312
- const dateHeaders = computeDateHeaders.value;
313
- return [{ label: getI18n("vxe.input.date.weeks.w") }].concat(dateHeaders);
314
- }
315
- return [];
316
- });
317
- const computeYearDatas = (0, import_vue.computed)(() => {
318
- const yearList = computeYearList.value;
319
- return import_xe_utils.default.chunk(yearList, 4);
320
- });
321
- const computeQuarterList = (0, import_vue.computed)(() => {
322
- const { selectMonth, currentDate } = reactData;
323
- const { quarterSize } = internalData;
324
- const quarters = [];
325
- if (selectMonth && currentDate) {
326
- const currFullYear = currentDate.getFullYear();
327
- const currQuarter = (0, import_util.getDateQuarter)(currentDate);
328
- const firstYear = import_xe_utils.default.getWhatYear(selectMonth, 0, "first");
329
- const selFullYear = firstYear.getFullYear();
330
- for (let index = -2; index < quarterSize - 2; index++) {
331
- const date = import_xe_utils.default.getWhatQuarter(firstYear, index);
332
- const itemFullYear = date.getFullYear();
333
- const itemQuarter = (0, import_util.getDateQuarter)(date);
334
- const isPrev = itemFullYear < selFullYear;
335
- quarters.push({
336
- date,
337
- isPrev,
338
- isCurrent: itemFullYear === selFullYear,
339
- isNow: itemFullYear === currFullYear && itemQuarter === currQuarter,
340
- isNext: !isPrev && itemFullYear > selFullYear,
341
- quarter: itemQuarter
296
+ return weeks;
297
+ });
298
+ const computeDateHeaders = (0, import_vue.computed)(() => {
299
+ const isCalendarType = computeIsCalendarType.value;
300
+ if (isCalendarType) {
301
+ const weekDatas = computeWeekDatas.value;
302
+ return weekDatas.map((day) => {
303
+ return {
304
+ value: day,
305
+ label: getI18n(`vxe.input.date.weeks.w${day}`)
306
+ };
342
307
  });
343
308
  }
344
- }
345
- return quarters;
346
- });
347
- const computeQuarterDatas = (0, import_vue.computed)(() => {
348
- const quarterList = computeQuarterList.value;
349
- return import_xe_utils.default.chunk(quarterList, 2);
350
- });
351
- const computeMonthList = (0, import_vue.computed)(() => {
352
- const { selectMonth, currentDate } = reactData;
353
- const { monthSize } = internalData;
354
- const months = [];
355
- if (selectMonth && currentDate) {
356
- const currFullYear = currentDate.getFullYear();
357
- const currMonth = currentDate.getMonth();
358
- const selFullYear = import_xe_utils.default.getWhatYear(selectMonth, 0, "first").getFullYear();
359
- for (let index = -4; index < monthSize - 4; index++) {
360
- const date = import_xe_utils.default.getWhatYear(selectMonth, 0, index);
361
- const itemFullYear = date.getFullYear();
362
- const itemMonth = date.getMonth();
363
- const isPrev = itemFullYear < selFullYear;
364
- months.push({
365
- date,
366
- isPrev,
367
- isCurrent: itemFullYear === selFullYear,
368
- isNow: itemFullYear === currFullYear && itemMonth === currMonth,
369
- isNext: !isPrev && itemFullYear > selFullYear,
370
- month: itemMonth
371
- });
309
+ return [];
310
+ });
311
+ const computeWeekHeaders = (0, import_vue.computed)(() => {
312
+ const isCalendarType = computeIsCalendarType.value;
313
+ if (isCalendarType) {
314
+ const dateHeaders = computeDateHeaders.value;
315
+ return [{ label: getI18n("vxe.input.date.weeks.w") }].concat(dateHeaders);
372
316
  }
373
- }
374
- return months;
375
- });
376
- const computeMonthDatas = (0, import_vue.computed)(() => {
377
- const monthList = computeMonthList.value;
378
- return import_xe_utils.default.chunk(monthList, 4);
379
- });
380
- const computeDayList = (0, import_vue.computed)(() => {
381
- const { selectMonth, currentDate } = reactData;
382
- const days = [];
383
- if (selectMonth && currentDate) {
384
- const dateHMSTime = computeDateHMSTime.value;
385
- const weekDatas = computeWeekDatas.value;
386
- const currFullYear = currentDate.getFullYear();
387
- const currMonth = currentDate.getMonth();
388
- const currDate = currentDate.getDate();
389
- const selFullYear = selectMonth.getFullYear();
390
- const selMonth = selectMonth.getMonth();
391
- const selDay = selectMonth.getDay();
392
- const prevOffsetDate = -weekDatas.indexOf(selDay);
393
- const startDayDate = new Date(import_xe_utils.default.getWhatDay(selectMonth, prevOffsetDate).getTime() + dateHMSTime);
394
- for (let index = 0; index < 42; index++) {
395
- const date = import_xe_utils.default.getWhatDay(startDayDate, index);
396
- const itemFullYear = date.getFullYear();
397
- const itemMonth = date.getMonth();
398
- const itemDate = date.getDate();
399
- const isPrev = date < selectMonth;
400
- days.push({
401
- date,
402
- isPrev,
403
- isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
404
- isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
405
- isNext: !isPrev && selMonth !== itemMonth,
406
- label: itemDate
407
- });
317
+ return [];
318
+ });
319
+ const computeYearDatas = (0, import_vue.computed)(() => {
320
+ const yearList = computeYearList.value;
321
+ return import_xe_utils.default.chunk(yearList, 4);
322
+ });
323
+ const computeQuarterList = (0, import_vue.computed)(() => {
324
+ const { selectMonth, currentDate } = reactData;
325
+ const { quarterSize } = internalData;
326
+ const quarters = [];
327
+ if (selectMonth && currentDate) {
328
+ const currFullYear = currentDate.getFullYear();
329
+ const currQuarter = (0, import_util.getDateQuarter)(currentDate);
330
+ const firstYear = import_xe_utils.default.getWhatYear(selectMonth, 0, "first");
331
+ const selFullYear = firstYear.getFullYear();
332
+ for (let index = -2; index < quarterSize - 2; index++) {
333
+ const date = import_xe_utils.default.getWhatQuarter(firstYear, index);
334
+ const itemFullYear = date.getFullYear();
335
+ const itemQuarter = (0, import_util.getDateQuarter)(date);
336
+ const isPrev = itemFullYear < selFullYear;
337
+ quarters.push({
338
+ date,
339
+ isPrev,
340
+ isCurrent: itemFullYear === selFullYear,
341
+ isNow: itemFullYear === currFullYear && itemQuarter === currQuarter,
342
+ isNext: !isPrev && itemFullYear > selFullYear,
343
+ quarter: itemQuarter
344
+ });
345
+ }
408
346
  }
409
- }
410
- return days;
411
- });
412
- const computeDayDatas = (0, import_vue.computed)(() => {
413
- const dayList = computeDayList.value;
414
- return import_xe_utils.default.chunk(dayList, 7);
415
- });
416
- const computeWeekDates = (0, import_vue.computed)(() => {
417
- const dayDatas = computeDayDatas.value;
418
- const firstDayOfWeek = computeFirstDayOfWeek.value;
419
- return dayDatas.map((list) => {
420
- const firstItem = list[0];
421
- const item = {
422
- date: firstItem.date,
423
- isWeekNumber: true,
424
- isPrev: false,
425
- isCurrent: false,
426
- isNow: false,
427
- isNext: false,
428
- label: import_xe_utils.default.getYearWeek(firstItem.date, firstDayOfWeek)
429
- };
430
- return [item].concat(list);
347
+ return quarters;
431
348
  });
432
- });
433
- const parseDate = (value, format) => {
434
- return import_xe_utils.default.toStringDate(value, format);
435
- };
436
- const handleChange = (value, evnt) => {
437
- reactData.inputValue = value;
438
- emit("update:modelValue", value);
439
- if (import_xe_utils.default.toValueString(props.modelValue) !== value) {
440
- dispatchEvent("change", { value }, evnt);
441
- }
442
- };
443
- const dateParseValue = (value) => {
444
- const { type } = props;
445
- const dateLabelFormat = computeDateLabelFormat.value;
446
- const dateValueFormat = computeDateValueFormat.value;
447
- const firstDayOfWeek = computeFirstDayOfWeek.value;
448
- let dValue = null;
449
- let dLabel = "";
450
- if (value) {
451
- dValue = parseDate(value, dateValueFormat);
452
- }
453
- if (import_xe_utils.default.isValidDate(dValue)) {
454
- dLabel = import_xe_utils.default.toDateString(dValue, dateLabelFormat, { firstDay: firstDayOfWeek });
455
- if (dateLabelFormat && type === "week") {
456
- const firstWeekDate = import_xe_utils.default.getWhatWeek(dValue, 0, firstDayOfWeek, firstDayOfWeek);
457
- if (firstWeekDate.getFullYear() < dValue.getFullYear()) {
458
- const yyIndex = dateLabelFormat.indexOf("yyyy");
459
- if (yyIndex > -1) {
460
- const yyNum = Number(dLabel.substring(yyIndex, yyIndex + 4));
461
- if (yyNum && !isNaN(yyNum)) {
462
- dLabel = dLabel.replace(`${yyNum}`, `${yyNum - 1}`);
349
+ const computeQuarterDatas = (0, import_vue.computed)(() => {
350
+ const quarterList = computeQuarterList.value;
351
+ return import_xe_utils.default.chunk(quarterList, 2);
352
+ });
353
+ const computeMonthList = (0, import_vue.computed)(() => {
354
+ const { selectMonth, currentDate } = reactData;
355
+ const { monthSize } = internalData;
356
+ const months = [];
357
+ if (selectMonth && currentDate) {
358
+ const currFullYear = currentDate.getFullYear();
359
+ const currMonth = currentDate.getMonth();
360
+ const selFullYear = import_xe_utils.default.getWhatYear(selectMonth, 0, "first").getFullYear();
361
+ for (let index = -4; index < monthSize - 4; index++) {
362
+ const date = import_xe_utils.default.getWhatYear(selectMonth, 0, index);
363
+ const itemFullYear = date.getFullYear();
364
+ const itemMonth = date.getMonth();
365
+ const isPrev = itemFullYear < selFullYear;
366
+ months.push({
367
+ date,
368
+ isPrev,
369
+ isCurrent: itemFullYear === selFullYear,
370
+ isNow: itemFullYear === currFullYear && itemMonth === currMonth,
371
+ isNext: !isPrev && itemFullYear > selFullYear,
372
+ month: itemMonth
373
+ });
374
+ }
375
+ }
376
+ return months;
377
+ });
378
+ const computeMonthDatas = (0, import_vue.computed)(() => {
379
+ const monthList = computeMonthList.value;
380
+ return import_xe_utils.default.chunk(monthList, 4);
381
+ });
382
+ const computeDayList = (0, import_vue.computed)(() => {
383
+ const { selectMonth, currentDate } = reactData;
384
+ const days = [];
385
+ if (selectMonth && currentDate) {
386
+ const dateHMSTime = computeDateHMSTime.value;
387
+ const weekDatas = computeWeekDatas.value;
388
+ const currFullYear = currentDate.getFullYear();
389
+ const currMonth = currentDate.getMonth();
390
+ const currDate = currentDate.getDate();
391
+ const selFullYear = selectMonth.getFullYear();
392
+ const selMonth = selectMonth.getMonth();
393
+ const selDay = selectMonth.getDay();
394
+ const prevOffsetDate = -weekDatas.indexOf(selDay);
395
+ const startDayDate = new Date(import_xe_utils.default.getWhatDay(selectMonth, prevOffsetDate).getTime() + dateHMSTime);
396
+ for (let index = 0; index < 42; index++) {
397
+ const date = import_xe_utils.default.getWhatDay(startDayDate, index);
398
+ const itemFullYear = date.getFullYear();
399
+ const itemMonth = date.getMonth();
400
+ const itemDate = date.getDate();
401
+ const isPrev = date < selectMonth;
402
+ days.push({
403
+ date,
404
+ isPrev,
405
+ isCurrent: itemFullYear === selFullYear && itemMonth === selMonth,
406
+ isNow: itemFullYear === currFullYear && itemMonth === currMonth && itemDate === currDate,
407
+ isNext: !isPrev && selMonth !== itemMonth,
408
+ label: itemDate
409
+ });
410
+ }
411
+ }
412
+ return days;
413
+ });
414
+ const computeDayDatas = (0, import_vue.computed)(() => {
415
+ const dayList = computeDayList.value;
416
+ return import_xe_utils.default.chunk(dayList, 7);
417
+ });
418
+ const computeWeekDates = (0, import_vue.computed)(() => {
419
+ const dayDatas = computeDayDatas.value;
420
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
421
+ return dayDatas.map((list) => {
422
+ const firstItem = list[0];
423
+ const item = {
424
+ date: firstItem.date,
425
+ isWeekNumber: true,
426
+ isPrev: false,
427
+ isCurrent: false,
428
+ isNow: false,
429
+ isNext: false,
430
+ label: import_xe_utils.default.getYearWeek(firstItem.date, firstDayOfWeek)
431
+ };
432
+ return [item].concat(list);
433
+ });
434
+ });
435
+ const parseDate = (value, format) => {
436
+ return import_xe_utils.default.toStringDate(value, format);
437
+ };
438
+ const handleChange = (value, evnt) => {
439
+ reactData.inputValue = value;
440
+ emit("update:modelValue", value);
441
+ if (import_xe_utils.default.toValueString(props.modelValue) !== value) {
442
+ dispatchEvent("change", { value }, evnt);
443
+ }
444
+ };
445
+ const dateParseValue = (value) => {
446
+ const { type } = props;
447
+ const dateLabelFormat = computeDateLabelFormat.value;
448
+ const dateValueFormat = computeDateValueFormat.value;
449
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
450
+ let dValue = null;
451
+ let dLabel = "";
452
+ if (value) {
453
+ dValue = parseDate(value, dateValueFormat);
454
+ }
455
+ if (import_xe_utils.default.isValidDate(dValue)) {
456
+ dLabel = import_xe_utils.default.toDateString(dValue, dateLabelFormat, { firstDay: firstDayOfWeek });
457
+ if (dateLabelFormat && type === "week") {
458
+ const firstWeekDate = import_xe_utils.default.getWhatWeek(dValue, 0, firstDayOfWeek, firstDayOfWeek);
459
+ if (firstWeekDate.getFullYear() < dValue.getFullYear()) {
460
+ const yyIndex = dateLabelFormat.indexOf("yyyy");
461
+ if (yyIndex > -1) {
462
+ const yyNum = Number(dLabel.substring(yyIndex, yyIndex + 4));
463
+ if (yyNum && !isNaN(yyNum)) {
464
+ dLabel = dLabel.replace(`${yyNum}`, `${yyNum - 1}`);
465
+ }
463
466
  }
464
467
  }
465
468
  }
466
- }
467
- } else {
468
- dValue = null;
469
- }
470
- reactData.datePanelValue = dValue;
471
- reactData.datePanelLabel = dLabel;
472
- };
473
- const changeValue = () => {
474
- const isCalendarType = computeIsCalendarType.value;
475
- const { inputValue } = reactData;
476
- if (isCalendarType) {
477
- dateParseValue(inputValue);
478
- reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
479
- }
480
- };
481
- const initValue = () => {
482
- const isCalendarType = computeIsCalendarType.value;
483
- if (isCalendarType) {
484
- changeValue();
485
- }
486
- };
487
- const dateCheckMonth = (date) => {
488
- const month = import_xe_utils.default.getWhatMonth(date, 0, "first");
489
- if (!import_xe_utils.default.isEqual(month, reactData.selectMonth)) {
490
- reactData.selectMonth = month;
491
- }
492
- };
493
- const dateChange = (date) => {
494
- const { modelValue, multiple } = props;
495
- const dateValueFormat = computeDateValueFormat.value;
496
- const firstDayOfWeek = computeFirstDayOfWeek.value;
497
- if (props.type === "week") {
498
- const sWeek = import_xe_utils.default.toNumber(props.selectDay);
499
- date = import_xe_utils.default.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
500
- }
501
- const inpVal = import_xe_utils.default.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek });
502
- dateCheckMonth(date);
503
- reactData.selectValue = date;
504
- if (multiple) {
505
- const dateMultipleValue = computeDateMultipleValue.value;
506
- if (dateMultipleValue.some((val) => import_xe_utils.default.isEqual(val, inpVal))) {
507
- handleChange(dateMultipleValue.filter((val) => !import_xe_utils.default.isEqual(val, inpVal)).join(","), { type: "update" });
508
469
  } else {
509
- handleChange(dateMultipleValue.concat([inpVal]).join(","), { type: "update" });
470
+ dValue = null;
510
471
  }
511
- } else {
512
- if (!import_xe_utils.default.isEqual(modelValue, inpVal)) {
513
- handleChange(inpVal, { type: "update" });
472
+ reactData.datePanelValue = dValue;
473
+ reactData.datePanelLabel = dLabel;
474
+ };
475
+ const changeValue = () => {
476
+ const isCalendarType = computeIsCalendarType.value;
477
+ const { inputValue } = reactData;
478
+ if (isCalendarType) {
479
+ dateParseValue(inputValue);
480
+ reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
514
481
  }
515
- }
516
- };
517
- const dateMonthHandle = (date, offsetMonth) => {
518
- reactData.selectMonth = import_xe_utils.default.getWhatMonth(date, offsetMonth, "first");
519
- };
520
- const dateNowHandle = () => {
521
- const currentDate = import_xe_utils.default.getWhatDay(Date.now(), 0, "first");
522
- reactData.currentDate = currentDate;
523
- dateMonthHandle(currentDate, 0);
524
- };
525
- const dateToggleYearTypeEvent = () => {
526
- reactData.datePanelType = "year";
527
- };
528
- const dateToggleMonthTypeEvent = (evnt) => {
529
- let { datePanelType } = reactData;
530
- if (datePanelType === "month" || datePanelType === "quarter") {
531
- datePanelType = "year";
532
- } else {
533
- datePanelType = "month";
534
- }
535
- reactData.datePanelType = datePanelType;
536
- changeViewEvent(evnt);
537
- };
538
- const datePrevEvent = (evnt) => {
539
- const { type } = props;
540
- const { datePanelType, selectMonth } = reactData;
541
- const { yearSize } = internalData;
542
- const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
543
- if (!isDisabledPrevDateBtn) {
544
- if (type === "year") {
545
- reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
546
- } else if (type === "month" || type === "quarter") {
547
- if (datePanelType === "year") {
548
- reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
482
+ };
483
+ const initValue = () => {
484
+ const isCalendarType = computeIsCalendarType.value;
485
+ if (isCalendarType) {
486
+ changeValue();
487
+ }
488
+ };
489
+ const dateCheckMonth = (date) => {
490
+ const month = import_xe_utils.default.getWhatMonth(date, 0, "first");
491
+ if (!import_xe_utils.default.isEqual(month, reactData.selectMonth)) {
492
+ reactData.selectMonth = month;
493
+ }
494
+ };
495
+ const dateChange = (date) => {
496
+ const { modelValue, multiple } = props;
497
+ const dateValueFormat = computeDateValueFormat.value;
498
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
499
+ if (props.type === "week") {
500
+ const sWeek = import_xe_utils.default.toNumber(props.selectDay);
501
+ date = import_xe_utils.default.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
502
+ }
503
+ const inpVal = import_xe_utils.default.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek });
504
+ dateCheckMonth(date);
505
+ reactData.selectValue = date;
506
+ if (multiple) {
507
+ const dateMultipleValue = computeDateMultipleValue.value;
508
+ if (dateMultipleValue.some((val) => import_xe_utils.default.isEqual(val, inpVal))) {
509
+ handleChange(dateMultipleValue.filter((val) => !import_xe_utils.default.isEqual(val, inpVal)).join(","), { type: "update" });
549
510
  } else {
550
- reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, -1, "first");
511
+ handleChange(dateMultipleValue.concat([inpVal]).join(","), { type: "update" });
551
512
  }
552
513
  } else {
553
- if (datePanelType === "year") {
514
+ if (!import_xe_utils.default.isEqual(modelValue, inpVal)) {
515
+ handleChange(inpVal, { type: "update" });
516
+ }
517
+ }
518
+ };
519
+ const dateMonthHandle = (date, offsetMonth) => {
520
+ reactData.selectMonth = import_xe_utils.default.getWhatMonth(date, offsetMonth, "first");
521
+ };
522
+ const dateNowHandle = () => {
523
+ const currentDate = import_xe_utils.default.getWhatDay(Date.now(), 0, "first");
524
+ reactData.currentDate = currentDate;
525
+ dateMonthHandle(currentDate, 0);
526
+ };
527
+ const dateToggleYearTypeEvent = () => {
528
+ reactData.datePanelType = "year";
529
+ };
530
+ const dateToggleMonthTypeEvent = (evnt) => {
531
+ let { datePanelType } = reactData;
532
+ if (datePanelType === "month" || datePanelType === "quarter") {
533
+ datePanelType = "year";
534
+ } else {
535
+ datePanelType = "month";
536
+ }
537
+ reactData.datePanelType = datePanelType;
538
+ changeViewEvent(evnt);
539
+ };
540
+ const datePrevEvent = (evnt) => {
541
+ const { type } = props;
542
+ const { datePanelType, selectMonth } = reactData;
543
+ const { yearSize } = internalData;
544
+ const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
545
+ if (!isDisabledPrevDateBtn) {
546
+ if (type === "year") {
554
547
  reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
555
- } else if (datePanelType === "month") {
556
- reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, -1, "first");
548
+ } else if (type === "month" || type === "quarter") {
549
+ if (datePanelType === "year") {
550
+ reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
551
+ } else {
552
+ reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, -1, "first");
553
+ }
557
554
  } else {
558
- reactData.selectMonth = import_xe_utils.default.getWhatMonth(selectMonth, -1, "first");
555
+ if (datePanelType === "year") {
556
+ reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, -yearSize, "first");
557
+ } else if (datePanelType === "month") {
558
+ reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, -1, "first");
559
+ } else {
560
+ reactData.selectMonth = import_xe_utils.default.getWhatMonth(selectMonth, -1, "first");
561
+ }
559
562
  }
563
+ dispatchEvent("date-prev", { type }, evnt);
564
+ changeViewEvent(evnt);
560
565
  }
561
- dispatchEvent("date-prev", { type }, evnt);
566
+ };
567
+ const dateTodayMonthEvent = (evnt) => {
568
+ dateNowHandle();
569
+ if (!props.multiple) {
570
+ dateChange(reactData.currentDate);
571
+ }
572
+ dispatchEvent("date-today", { type: props.type }, evnt);
562
573
  changeViewEvent(evnt);
563
- }
564
- };
565
- const dateTodayMonthEvent = (evnt) => {
566
- dateNowHandle();
567
- if (!props.multiple) {
568
- dateChange(reactData.currentDate);
569
- }
570
- dispatchEvent("date-today", { type: props.type }, evnt);
571
- changeViewEvent(evnt);
572
- };
573
- const dateNextEvent = (evnt) => {
574
- const { type } = props;
575
- const { datePanelType, selectMonth } = reactData;
576
- const { yearSize } = internalData;
577
- const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
578
- if (!isDisabledNextDateBtn) {
579
- if (type === "year") {
580
- reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, yearSize, "first");
581
- } else if (type === "month" || type === "quarter") {
582
- if (datePanelType === "year") {
574
+ };
575
+ const dateNextEvent = (evnt) => {
576
+ const { type } = props;
577
+ const { datePanelType, selectMonth } = reactData;
578
+ const { yearSize } = internalData;
579
+ const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
580
+ if (!isDisabledNextDateBtn) {
581
+ if (type === "year") {
583
582
  reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, yearSize, "first");
583
+ } else if (type === "month" || type === "quarter") {
584
+ if (datePanelType === "year") {
585
+ reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, yearSize, "first");
586
+ } else {
587
+ reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, 1, "first");
588
+ }
584
589
  } else {
585
- reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, 1, "first");
590
+ if (datePanelType === "year") {
591
+ reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, yearSize, "first");
592
+ } else if (datePanelType === "month") {
593
+ reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, 1, "first");
594
+ } else {
595
+ reactData.selectMonth = import_xe_utils.default.getWhatMonth(selectMonth, 1, "first");
596
+ }
586
597
  }
587
- } else {
598
+ dispatchEvent("date-next", { type }, evnt);
599
+ changeViewEvent(evnt);
600
+ }
601
+ };
602
+ const isDateDisabled = (item) => {
603
+ const disbMethod = props.disabledMethod || defaultFuncProps.disabledMethod;
604
+ const { datePanelType } = reactData;
605
+ return disbMethod && disbMethod({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar });
606
+ };
607
+ const changeViewEvent = (evnt) => {
608
+ const { datePanelType } = reactData;
609
+ const yearDatas = computeYearDatas.value;
610
+ const quarterDatas = computeQuarterDatas.value;
611
+ const monthDatas = computeMonthDatas.value;
612
+ const weekDates = computeWeekDates.value;
613
+ const dayDatas = computeDayDatas.value;
614
+ const viewDates = [];
615
+ let dataList = [];
616
+ switch (datePanelType) {
617
+ case "year":
618
+ dataList = yearDatas;
619
+ break;
620
+ case "quarter":
621
+ dataList = quarterDatas;
622
+ break;
623
+ case "month":
624
+ dataList = monthDatas;
625
+ break;
626
+ case "week":
627
+ dataList = weekDates;
628
+ break;
629
+ case "day":
630
+ dataList = dayDatas;
631
+ break;
632
+ }
633
+ dataList.forEach((rows) => {
634
+ rows.forEach((item) => {
635
+ viewDates.push(item.date);
636
+ });
637
+ });
638
+ dispatchEvent("view-change", { viewType: datePanelType, viewDates }, evnt);
639
+ };
640
+ const dateSelectItem = (date) => {
641
+ const { type } = props;
642
+ const { datePanelType } = reactData;
643
+ if (type === "month") {
588
644
  if (datePanelType === "year") {
589
- reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, yearSize, "first");
590
- } else if (datePanelType === "month") {
591
- reactData.selectMonth = import_xe_utils.default.getWhatYear(selectMonth, 1, "first");
645
+ reactData.datePanelType = "month";
646
+ dateCheckMonth(date);
647
+ changeViewEvent(null);
592
648
  } else {
593
- reactData.selectMonth = import_xe_utils.default.getWhatMonth(selectMonth, 1, "first");
649
+ dateChange(date);
594
650
  }
595
- }
596
- dispatchEvent("date-next", { type }, evnt);
597
- changeViewEvent(evnt);
598
- }
599
- };
600
- const isDateDisabled = (item) => {
601
- const disbMethod = props.disabledMethod || defaultFuncProps.disabledMethod;
602
- const { datePanelType } = reactData;
603
- return disbMethod && disbMethod({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar });
604
- };
605
- const changeViewEvent = (evnt) => {
606
- const { datePanelType } = reactData;
607
- const yearDatas = computeYearDatas.value;
608
- const quarterDatas = computeQuarterDatas.value;
609
- const monthDatas = computeMonthDatas.value;
610
- const weekDates = computeWeekDates.value;
611
- const dayDatas = computeDayDatas.value;
612
- const viewDates = [];
613
- let dataList = [];
614
- switch (datePanelType) {
615
- case "year":
616
- dataList = yearDatas;
617
- break;
618
- case "quarter":
619
- dataList = quarterDatas;
620
- break;
621
- case "month":
622
- dataList = monthDatas;
623
- break;
624
- case "week":
625
- dataList = weekDates;
626
- break;
627
- case "day":
628
- dataList = dayDatas;
629
- break;
630
- }
631
- dataList.forEach((rows) => {
632
- rows.forEach((item) => {
633
- viewDates.push(item.date);
634
- });
635
- });
636
- dispatchEvent("view-change", { viewType: datePanelType, viewDates }, evnt);
637
- };
638
- const dateSelectItem = (date) => {
639
- const { type } = props;
640
- const { datePanelType } = reactData;
641
- if (type === "month") {
642
- if (datePanelType === "year") {
643
- reactData.datePanelType = "month";
644
- dateCheckMonth(date);
645
- changeViewEvent(null);
646
- } else {
651
+ } else if (type === "year") {
647
652
  dateChange(date);
648
- }
649
- } else if (type === "year") {
650
- dateChange(date);
651
- } else if (type === "quarter") {
652
- if (datePanelType === "year") {
653
- reactData.datePanelType = "quarter";
654
- dateCheckMonth(date);
655
- changeViewEvent(null);
656
- } else {
657
- dateChange(date);
658
- }
659
- } else {
660
- if (datePanelType === "month") {
661
- reactData.datePanelType = type === "week" ? type : "day";
662
- dateCheckMonth(date);
663
- changeViewEvent(null);
664
- } else if (datePanelType === "year") {
665
- reactData.datePanelType = "month";
666
- dateCheckMonth(date);
667
- changeViewEvent(null);
653
+ } else if (type === "quarter") {
654
+ if (datePanelType === "year") {
655
+ reactData.datePanelType = "quarter";
656
+ dateCheckMonth(date);
657
+ changeViewEvent(null);
658
+ } else {
659
+ dateChange(date);
660
+ }
668
661
  } else {
669
- dateChange(date);
662
+ if (datePanelType === "month") {
663
+ reactData.datePanelType = type === "week" ? type : "day";
664
+ dateCheckMonth(date);
665
+ changeViewEvent(null);
666
+ } else if (datePanelType === "year") {
667
+ reactData.datePanelType = "month";
668
+ dateCheckMonth(date);
669
+ changeViewEvent(null);
670
+ } else {
671
+ dateChange(date);
672
+ }
670
673
  }
671
- }
672
- };
673
- const dateClickEvent = (evnt, item) => {
674
- const { type } = props;
675
- const { datePanelType } = reactData;
676
- const { date } = item;
677
- if (!isDateDisabled(item)) {
678
- dateSelectItem(date);
679
- dispatchEvent("cell-click", { date, type, viewType: datePanelType }, evnt);
680
- }
681
- };
682
- const datContextmenuEvent = (evnt, item) => {
683
- const { type } = props;
684
- const { datePanelType } = reactData;
685
- const { menuConfig } = props;
686
- const menuOpts = computeMenuOpts.value;
687
- if (menuConfig ? (0, import_utils.isEnableConf)(menuOpts) : menuOpts.enabled) {
688
- const { options, visibleMethod } = menuOpts;
674
+ };
675
+ const dateClickEvent = (evnt, item) => {
676
+ const { type } = props;
677
+ const { datePanelType } = reactData;
689
678
  const { date } = item;
690
- if (!visibleMethod || visibleMethod({ $calendar: $xeCalendar, options, date, type, viewType: datePanelType })) {
691
- if (import_core.VxeUI.contextMenu) {
692
- import_core.VxeUI.contextMenu.openByEvent(evnt, {
693
- options,
694
- events: {
695
- optionClick(eventParams) {
696
- const { option } = eventParams;
697
- const gMenuOpts = menus.get(option.code);
698
- const cmMethod = gMenuOpts ? gMenuOpts.calendarMenuMethod : null;
699
- const params = { menu: option, date, type, viewType: datePanelType, $event: evnt, $calendar: $xeCalendar };
700
- if (cmMethod) {
701
- cmMethod(params, evnt);
679
+ if (!isDateDisabled(item)) {
680
+ dateSelectItem(date);
681
+ dispatchEvent("cell-click", { date, type, viewType: datePanelType }, evnt);
682
+ }
683
+ };
684
+ const datContextmenuEvent = (evnt, item) => {
685
+ const { type } = props;
686
+ const { datePanelType } = reactData;
687
+ const { menuConfig } = props;
688
+ const menuOpts = computeMenuOpts.value;
689
+ if (menuConfig ? (0, import_utils.isEnableConf)(menuOpts) : menuOpts.enabled) {
690
+ const { options, visibleMethod } = menuOpts;
691
+ const { date } = item;
692
+ if (!visibleMethod || visibleMethod({ $calendar: $xeCalendar, options, date, type, viewType: datePanelType })) {
693
+ if (import_core.VxeUI.contextMenu) {
694
+ import_core.VxeUI.contextMenu.openByEvent(evnt, {
695
+ options,
696
+ events: {
697
+ optionClick(eventParams) {
698
+ const { option } = eventParams;
699
+ const gMenuOpts = menus.get(option.code);
700
+ const cmMethod = gMenuOpts ? gMenuOpts.calendarMenuMethod : null;
701
+ const params = { menu: option, date, type, viewType: datePanelType, $event: evnt, $calendar: $xeCalendar };
702
+ if (cmMethod) {
703
+ cmMethod(params, evnt);
704
+ }
705
+ dispatchEvent("menu-click", params, eventParams.$event);
702
706
  }
703
- dispatchEvent("menu-click", params, eventParams.$event);
704
707
  }
705
- }
706
- });
708
+ });
709
+ }
707
710
  }
708
711
  }
709
- }
710
- dispatchEvent("cell-menu", { date: item.date, type, viewType: datePanelType }, evnt);
711
- };
712
- const dateMoveDay = (offsetDay) => {
713
- if (!isDateDisabled({ date: offsetDay })) {
714
- const dayList = computeDayList.value;
715
- if (!dayList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetDay, "yyyyMMdd"))) {
716
- dateCheckMonth(offsetDay);
712
+ dispatchEvent("cell-menu", { date: item.date, type, viewType: datePanelType }, evnt);
713
+ };
714
+ const dateMoveDay = (offsetDay) => {
715
+ if (!isDateDisabled({ date: offsetDay })) {
716
+ const dayList = computeDayList.value;
717
+ if (!dayList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetDay, "yyyyMMdd"))) {
718
+ dateCheckMonth(offsetDay);
719
+ }
720
+ dateParseValue(offsetDay);
717
721
  }
718
- dateParseValue(offsetDay);
719
- }
720
- };
721
- const dateMoveYear = (offsetYear) => {
722
- if (!isDateDisabled({ date: offsetYear })) {
723
- const yearList = computeYearList.value;
724
- if (!yearList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetYear, "yyyy"))) {
725
- dateCheckMonth(offsetYear);
722
+ };
723
+ const dateMoveYear = (offsetYear) => {
724
+ if (!isDateDisabled({ date: offsetYear })) {
725
+ const yearList = computeYearList.value;
726
+ if (!yearList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetYear, "yyyy"))) {
727
+ dateCheckMonth(offsetYear);
728
+ }
729
+ dateParseValue(offsetYear);
726
730
  }
727
- dateParseValue(offsetYear);
728
- }
729
- };
730
- const dateMoveQuarter = (offsetQuarter) => {
731
- if (!isDateDisabled({ date: offsetQuarter })) {
732
- const quarterList = computeQuarterList.value;
733
- if (!quarterList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetQuarter, "yyyyq"))) {
734
- dateCheckMonth(offsetQuarter);
731
+ };
732
+ const dateMoveQuarter = (offsetQuarter) => {
733
+ if (!isDateDisabled({ date: offsetQuarter })) {
734
+ const quarterList = computeQuarterList.value;
735
+ if (!quarterList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetQuarter, "yyyyq"))) {
736
+ dateCheckMonth(offsetQuarter);
737
+ }
738
+ dateParseValue(offsetQuarter);
735
739
  }
736
- dateParseValue(offsetQuarter);
737
- }
738
- };
739
- const dateMoveMonth = (offsetMonth) => {
740
- if (!isDateDisabled({ date: offsetMonth })) {
741
- const monthList = computeMonthList.value;
742
- if (!monthList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetMonth, "yyyyMM"))) {
743
- dateCheckMonth(offsetMonth);
740
+ };
741
+ const dateMoveMonth = (offsetMonth) => {
742
+ if (!isDateDisabled({ date: offsetMonth })) {
743
+ const monthList = computeMonthList.value;
744
+ if (!monthList.some((item) => import_xe_utils.default.isDateSame(item.date, offsetMonth, "yyyyMM"))) {
745
+ dateCheckMonth(offsetMonth);
746
+ }
747
+ dateParseValue(offsetMonth);
744
748
  }
745
- dateParseValue(offsetMonth);
746
- }
747
- };
748
- const dateMouseenterEvent = (item) => {
749
- if (!isDateDisabled(item)) {
750
- const { datePanelType } = reactData;
751
- if (datePanelType === "month") {
752
- dateMoveMonth(item.date);
753
- } else if (datePanelType === "quarter") {
754
- dateMoveQuarter(item.date);
755
- } else if (datePanelType === "year") {
756
- dateMoveYear(item.date);
749
+ };
750
+ const dateMouseenterEvent = (item) => {
751
+ if (!isDateDisabled(item)) {
752
+ const { datePanelType } = reactData;
753
+ if (datePanelType === "month") {
754
+ dateMoveMonth(item.date);
755
+ } else if (datePanelType === "quarter") {
756
+ dateMoveQuarter(item.date);
757
+ } else if (datePanelType === "year") {
758
+ dateMoveYear(item.date);
759
+ } else {
760
+ dateMoveDay(item.date);
761
+ }
762
+ }
763
+ };
764
+ const dateMouseleaveEvent = () => {
765
+ reactData.datePanelValue = null;
766
+ };
767
+ const dateConfirmEvent = () => {
768
+ };
769
+ const dateOpenPanel = () => {
770
+ const { type } = props;
771
+ const dateValue = computeDateValue.value;
772
+ if (["year", "quarter", "month", "week"].indexOf(type) > -1) {
773
+ reactData.datePanelType = type;
757
774
  } else {
758
- dateMoveDay(item.date);
775
+ reactData.datePanelType = "day";
759
776
  }
760
- }
761
- };
762
- const dateMouseleaveEvent = () => {
763
- reactData.datePanelValue = null;
764
- };
765
- const dateConfirmEvent = () => {
766
- };
767
- const dateOpenPanel = () => {
768
- const { type } = props;
769
- const dateValue = computeDateValue.value;
770
- if (["year", "quarter", "month", "week"].indexOf(type) > -1) {
771
- reactData.datePanelType = type;
772
- } else {
773
- reactData.datePanelType = "day";
774
- }
775
- reactData.currentDate = import_xe_utils.default.getWhatDay(Date.now(), 0, "first");
776
- if (dateValue) {
777
- dateMonthHandle(dateValue, 0);
778
- dateParseValue(dateValue);
779
- } else {
780
- dateNowHandle();
781
- }
782
- };
783
- const renderDateLabel = (item, label) => {
784
- const flMethod = props.festivalMethod || defaultFuncProps.festivalMethod;
785
- if (flMethod) {
786
- const { datePanelType } = reactData;
787
- const festivalRest = flMethod({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar });
788
- const festivalItem = festivalRest ? import_xe_utils.default.isString(festivalRest) ? { label: festivalRest } : festivalRest : {};
789
- const extraItem = festivalItem.extra ? import_xe_utils.default.isString(festivalItem.extra) ? { label: festivalItem.extra } : festivalItem.extra : null;
790
- const labels = [
791
- (0, import_vue.h)(
792
- "span",
793
- {
794
- class: [
795
- "vxe-calendar--label",
796
- {
797
- "is-notice": festivalItem.notice
798
- }
799
- ]
800
- },
801
- extraItem && extraItem.label ? [
802
- (0, import_vue.h)(
803
- "span",
804
- {
805
- class: "vxe-calendar--label--number"
806
- },
807
- `${label || ""}`
808
- ),
809
- (0, import_vue.h)(
810
- "span",
811
- {
812
- class: ["vxe-calendar--label--extra", extraItem.important ? "is-important" : "", extraItem.className],
813
- style: extraItem.style
814
- },
815
- import_xe_utils.default.toValueString(extraItem.label)
816
- )
817
- ] : [`${label || ""}`]
818
- )
819
- ];
820
- const festivalLabel = festivalItem.label;
821
- if (festivalLabel) {
822
- const festivalLabels = import_xe_utils.default.toValueString(festivalLabel).split(",");
823
- labels.push(
777
+ reactData.currentDate = import_xe_utils.default.getWhatDay(Date.now(), 0, "first");
778
+ if (dateValue) {
779
+ dateMonthHandle(dateValue, 0);
780
+ dateParseValue(dateValue);
781
+ } else {
782
+ dateNowHandle();
783
+ }
784
+ };
785
+ const renderDateLabel = (item, label) => {
786
+ const flMethod = props.festivalMethod || defaultFuncProps.festivalMethod;
787
+ if (flMethod) {
788
+ const { datePanelType } = reactData;
789
+ const festivalRest = flMethod({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar });
790
+ const festivalItem = festivalRest ? import_xe_utils.default.isString(festivalRest) ? { label: festivalRest } : festivalRest : {};
791
+ const extraItem = festivalItem.extra ? import_xe_utils.default.isString(festivalItem.extra) ? { label: festivalItem.extra } : festivalItem.extra : null;
792
+ const labels = [
824
793
  (0, import_vue.h)(
825
794
  "span",
826
795
  {
827
- class: ["vxe-calendar--festival", festivalItem.important ? "is-important" : "", festivalItem.className],
828
- style: festivalItem.style
829
- },
830
- [
831
- festivalLabels.length > 1 ? (0, import_vue.h)(
832
- "span",
796
+ class: [
797
+ "vxe-calendar--label",
833
798
  {
834
- class: ["vxe-calendar--festival--overlap", `overlap--${festivalLabels.length}`]
835
- },
836
- festivalLabels.map((label2) => (0, import_vue.h)("span", label2.substring(0, 3)))
837
- ) : (0, import_vue.h)(
838
- "span",
839
- {
840
- class: "vxe-calendar--festival--label"
841
- },
842
- festivalLabels[0].substring(0, 3)
843
- )
844
- ]
845
- )
846
- );
847
- }
848
- return labels;
849
- }
850
- return `${label || ""}`;
851
- };
852
- const renderDateDayTable = () => {
853
- const { multiple, cellStyle } = props;
854
- const { datePanelType, datePanelValue } = reactData;
855
- const dateValue = computeDateValue.value;
856
- const dateHeaders = computeDateHeaders.value;
857
- const dayDatas = computeDayDatas.value;
858
- const dateListValue = computeDateListValue.value;
859
- const matchFormat = "yyyyMMdd";
860
- return [
861
- (0, import_vue.h)(
862
- "div",
863
- {
864
- class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
865
- },
866
- [
867
- (0, import_vue.h)(
868
- "div",
869
- {
870
- class: "vxe-calendar--view-header",
871
- style: {
872
- height: `${100 / (dayDatas.length + 1)}%`
873
- }
799
+ "is-notice": festivalItem.notice
800
+ }
801
+ ]
874
802
  },
875
- [
803
+ extraItem && extraItem.label ? [
876
804
  (0, import_vue.h)(
877
- "div",
878
- {
879
- class: "vxe-calendar--view-row"
880
- },
881
- dateHeaders.map((item) => {
882
- return (0, import_vue.h)(
883
- "div",
884
- {
885
- class: "vxe-calendar--view-item",
886
- style: {
887
- width: `${100 / dateHeaders.length}%`
888
- }
889
- },
890
- [
891
- (0, import_vue.h)(
892
- "div",
893
- {
894
- class: "vxe-calendar--view-item-inner"
895
- },
896
- [
897
- (0, import_vue.h)(
898
- "div",
899
- {
900
- class: "vxe-calendar--view-item-label"
901
- },
902
- item.label
903
- )
904
- ]
905
- )
906
- ]
907
- );
908
- })
909
- )
910
- ]
911
- ),
912
- (0, import_vue.h)(
913
- "div",
914
- {
915
- class: "vxe-calendar--view-body"
916
- },
917
- dayDatas.map((rows) => {
918
- return (0, import_vue.h)(
919
- "div",
805
+ "span",
920
806
  {
921
- class: "vxe-calendar--view-row",
922
- style: {
923
- height: `${100 / dayDatas.length}%`
924
- }
807
+ class: "vxe-calendar--label--number"
925
808
  },
926
- rows.map((item) => {
927
- const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
928
- return (0, import_vue.h)(
929
- "div",
930
- {
931
- class: [
932
- "vxe-calendar--view-item",
933
- {
934
- "is--prev": item.isPrev,
935
- "is--current": item.isCurrent,
936
- "is--now": item.isNow,
937
- "is--next": item.isNext,
938
- "is--disabled": isDateDisabled(item),
939
- "is--selected": isSelected,
940
- "is--hover": import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
941
- }
942
- ],
943
- style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
944
- width: `${100 / rows.length}%`
945
- }),
946
- onClick: (evnt) => dateClickEvent(evnt, item),
947
- onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
948
- onMouseenter: () => dateMouseenterEvent(item),
949
- onMouseleave: dateMouseleaveEvent
950
- },
951
- [
952
- (0, import_vue.h)(
953
- "div",
954
- {
955
- class: "vxe-calendar--view-item-inner"
956
- },
957
- renderDateLabel(item, item.label)
958
- )
959
- ]
960
- );
961
- })
962
- );
963
- })
964
- )
965
- ]
966
- )
967
- ];
968
- };
969
- const renderDateWeekTable = () => {
970
- const { multiple, cellStyle } = props;
971
- const { datePanelType, datePanelValue } = reactData;
972
- const dateValue = computeDateValue.value;
973
- const weekHeaders = computeWeekHeaders.value;
974
- const weekDates = computeWeekDates.value;
975
- const dateListValue = computeDateListValue.value;
976
- const matchFormat = "yyyyMMdd";
977
- return [
978
- (0, import_vue.h)(
979
- "div",
980
- {
981
- class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
982
- },
983
- [
984
- (0, import_vue.h)(
985
- "div",
986
- {
987
- class: "vxe-calendar--view-header",
988
- style: {
989
- height: `${100 / (weekDates.length + 1)}%`
990
- }
991
- },
992
- [
809
+ `${label || ""}`
810
+ ),
993
811
  (0, import_vue.h)(
994
- "div",
812
+ "span",
995
813
  {
996
- class: "vxe-calendar--view-row"
814
+ class: ["vxe-calendar--label--extra", extraItem.important ? "is-important" : "", extraItem.className],
815
+ style: extraItem.style
997
816
  },
998
- weekHeaders.map((item, rIndex) => {
999
- return (0, import_vue.h)(
1000
- "div",
1001
- {
1002
- class: "vxe-calendar--view-item",
1003
- style: {
1004
- width: `${rIndex ? 13 : 9}%`
1005
- }
1006
- },
1007
- [
1008
- (0, import_vue.h)(
1009
- "div",
1010
- {
1011
- class: "vxe-calendar--view-item-inner"
1012
- },
1013
- [
1014
- (0, import_vue.h)(
1015
- "div",
1016
- {
1017
- class: "vxe-calendar--view-item-label"
1018
- },
1019
- item.label
1020
- )
1021
- ]
1022
- )
1023
- ]
1024
- );
1025
- })
817
+ import_xe_utils.default.toValueString(extraItem.label)
1026
818
  )
1027
- ]
1028
- ),
1029
- (0, import_vue.h)(
1030
- "div",
1031
- {
1032
- class: "vxe-calendar--view-body"
1033
- },
1034
- weekDates.map((rows) => {
1035
- const isSelected = multiple ? rows.some((item) => dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat))) : rows.some((item) => import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat));
1036
- const isHover = rows.some((item) => import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat));
1037
- const isNowWeek = rows.some((item) => item.isNow);
1038
- return (0, import_vue.h)(
1039
- "div",
1040
- {
1041
- class: "vxe-calendar--view-row",
1042
- style: {
1043
- height: `${100 / weekDates.length}%`
1044
- }
1045
- },
1046
- rows.map((item, rIndex) => {
1047
- return (0, import_vue.h)(
1048
- "div",
1049
- {
1050
- class: [
1051
- "vxe-calendar--view-item",
1052
- {
1053
- "is--prev": item.isPrev,
1054
- "is--current": item.isCurrent,
1055
- "is--now": rIndex ? item.isNow : isNowWeek,
1056
- "is--next": item.isNext,
1057
- "is--disabled": isDateDisabled(item),
1058
- "is--selected": isSelected,
1059
- "is--hover": isHover
1060
- }
1061
- ],
1062
- style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
1063
- width: `${rIndex ? 13 : 9}%`
1064
- }),
1065
- onClick: (evnt) => dateClickEvent(evnt, item),
1066
- onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
1067
- onMouseenter: () => dateMouseenterEvent(item),
1068
- onMouseleave: dateMouseleaveEvent
1069
- },
1070
- [
1071
- (0, import_vue.h)(
1072
- "div",
1073
- {
1074
- class: "vxe-calendar--view-item-inner"
1075
- },
1076
- renderDateLabel(item, item.label)
1077
- )
1078
- ]
1079
- );
1080
- })
1081
- );
1082
- })
1083
- )
1084
- ]
1085
- )
1086
- ];
1087
- };
1088
- const renderDateMonthTable = () => {
1089
- const { multiple, cellStyle } = props;
1090
- const { datePanelType, datePanelValue } = reactData;
1091
- const dateValue = computeDateValue.value;
1092
- const monthDatas = computeMonthDatas.value;
1093
- const dateListValue = computeDateListValue.value;
1094
- const matchFormat = "yyyyMM";
1095
- return [
1096
- (0, import_vue.h)(
1097
- "div",
1098
- {
1099
- class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
1100
- },
1101
- [
1102
- (0, import_vue.h)(
1103
- "div",
1104
- {
1105
- class: "vxe-calendar--view-body"
1106
- },
1107
- monthDatas.map((rows) => {
1108
- return (0, import_vue.h)(
1109
- "div",
1110
- {
1111
- class: "vxe-calendar--view-row",
1112
- style: {
1113
- height: `${100 / monthDatas.length}%`
1114
- }
1115
- },
1116
- rows.map((item) => {
1117
- const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
1118
- return (0, import_vue.h)(
1119
- "div",
1120
- {
1121
- class: [
1122
- "vxe-calendar--view-item",
1123
- {
1124
- "is--prev": item.isPrev,
1125
- "is--current": item.isCurrent,
1126
- "is--now": item.isNow,
1127
- "is--next": item.isNext,
1128
- "is--disabled": isDateDisabled(item),
1129
- "is--selected": isSelected,
1130
- "is--hover": import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
1131
- }
1132
- ],
1133
- style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
1134
- width: `${100 / rows.length}%`
1135
- }),
1136
- onClick: (evnt) => dateClickEvent(evnt, item),
1137
- onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
1138
- onMouseenter: () => dateMouseenterEvent(item),
1139
- onMouseleave: dateMouseleaveEvent
1140
- },
1141
- [
1142
- (0, import_vue.h)(
1143
- "div",
1144
- {
1145
- class: "vxe-calendar--view-item-inner"
1146
- },
1147
- renderDateLabel(item, getI18n(`vxe.input.date.months.m${item.month}`))
1148
- )
1149
- ]
1150
- );
1151
- })
1152
- );
1153
- })
819
+ ] : [`${label || ""}`]
1154
820
  )
1155
- ]
1156
- )
1157
- ];
1158
- };
1159
- const renderDateQuarterTable = () => {
1160
- const { multiple, cellStyle } = props;
1161
- const { datePanelType, datePanelValue } = reactData;
1162
- const dateValue = computeDateValue.value;
1163
- const quarterDatas = computeQuarterDatas.value;
1164
- const dateListValue = computeDateListValue.value;
1165
- const matchFormat = "yyyyq";
1166
- return [
1167
- (0, import_vue.h)(
1168
- "div",
1169
- {
1170
- class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
1171
- },
1172
- [
1173
- (0, import_vue.h)(
1174
- "div",
1175
- {
1176
- class: "vxe-calendar--view-body"
1177
- },
1178
- quarterDatas.map((rows) => {
1179
- return (0, import_vue.h)(
1180
- "div",
1181
- {
1182
- class: "vxe-calendar--view-row",
1183
- style: {
1184
- height: `${100 / quarterDatas.length}%`
1185
- }
1186
- },
1187
- rows.map((item) => {
1188
- const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
1189
- return (0, import_vue.h)(
1190
- "div",
1191
- {
1192
- class: [
1193
- "vxe-calendar--view-item",
1194
- {
1195
- "is--prev": item.isPrev,
1196
- "is--current": item.isCurrent,
1197
- "is--now": item.isNow,
1198
- "is--next": item.isNext,
1199
- "is--disabled": isDateDisabled(item),
1200
- "is--selected": isSelected,
1201
- "is--hover": import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
821
+ ];
822
+ const festivalLabel = festivalItem.label;
823
+ if (festivalLabel) {
824
+ const festivalLabels = import_xe_utils.default.toValueString(festivalLabel).split(",");
825
+ labels.push(
826
+ (0, import_vue.h)(
827
+ "span",
828
+ {
829
+ class: ["vxe-calendar--festival", festivalItem.important ? "is-important" : "", festivalItem.className],
830
+ style: festivalItem.style
831
+ },
832
+ [
833
+ festivalLabels.length > 1 ? (0, import_vue.h)(
834
+ "span",
835
+ {
836
+ class: ["vxe-calendar--festival--overlap", `overlap--${festivalLabels.length}`]
837
+ },
838
+ festivalLabels.map((label2) => (0, import_vue.h)("span", label2.substring(0, 3)))
839
+ ) : (0, import_vue.h)(
840
+ "span",
841
+ {
842
+ class: "vxe-calendar--festival--label"
843
+ },
844
+ festivalLabels[0].substring(0, 3)
845
+ )
846
+ ]
847
+ )
848
+ );
849
+ }
850
+ return labels;
851
+ }
852
+ return `${label || ""}`;
853
+ };
854
+ const renderDateDayTable = () => {
855
+ const { multiple, cellStyle } = props;
856
+ const { datePanelType, datePanelValue } = reactData;
857
+ const dateValue = computeDateValue.value;
858
+ const dateHeaders = computeDateHeaders.value;
859
+ const dayDatas = computeDayDatas.value;
860
+ const dateListValue = computeDateListValue.value;
861
+ const matchFormat = "yyyyMMdd";
862
+ return [
863
+ (0, import_vue.h)(
864
+ "div",
865
+ {
866
+ class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
867
+ },
868
+ [
869
+ (0, import_vue.h)(
870
+ "div",
871
+ {
872
+ class: "vxe-calendar--view-header",
873
+ style: {
874
+ height: `${100 / (dayDatas.length + 1)}%`
875
+ }
876
+ },
877
+ [
878
+ (0, import_vue.h)(
879
+ "div",
880
+ {
881
+ class: "vxe-calendar--view-row"
882
+ },
883
+ dateHeaders.map((item) => {
884
+ return (0, import_vue.h)(
885
+ "div",
886
+ {
887
+ class: "vxe-calendar--view-item",
888
+ style: {
889
+ width: `${100 / dateHeaders.length}%`
1202
890
  }
1203
- ],
1204
- style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
1205
- width: `${100 / rows.length}%`
1206
- }),
1207
- onClick: (evnt) => dateClickEvent(evnt, item),
1208
- onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
1209
- onMouseenter: () => dateMouseenterEvent(item),
1210
- onMouseleave: dateMouseleaveEvent
1211
- },
1212
- [
1213
- (0, import_vue.h)(
1214
- "div",
1215
- {
1216
- class: "vxe-calendar--view-item-inner"
1217
- },
1218
- renderDateLabel(item, getI18n(`vxe.input.date.quarters.q${item.quarter}`))
1219
- )
1220
- ]
1221
- );
1222
- })
1223
- );
1224
- })
1225
- )
1226
- ]
1227
- )
1228
- ];
1229
- };
1230
- const renderDateYearTable = () => {
1231
- const { multiple, cellStyle } = props;
1232
- const { datePanelType, datePanelValue } = reactData;
1233
- const dateValue = computeDateValue.value;
1234
- const yearDatas = computeYearDatas.value;
1235
- const dateListValue = computeDateListValue.value;
1236
- const matchFormat = "yyyy";
1237
- return [
1238
- (0, import_vue.h)(
1239
- "div",
1240
- {
1241
- class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
1242
- },
1243
- [
1244
- (0, import_vue.h)(
1245
- "div",
1246
- {
1247
- class: "vxe-calendar--view-body"
1248
- },
1249
- yearDatas.map((rows) => {
1250
- return (0, import_vue.h)(
1251
- "div",
1252
- {
1253
- class: "vxe-calendar--view-row",
1254
- style: {
1255
- height: `${100 / yearDatas.length}%`
1256
- }
1257
- },
1258
- rows.map((item) => {
1259
- const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
1260
- return (0, import_vue.h)(
1261
- "div",
1262
- {
1263
- class: [
1264
- "vxe-calendar--view-item",
1265
- {
1266
- "is--prev": item.isPrev,
1267
- "is--current": item.isCurrent,
1268
- "is--now": item.isNow,
1269
- "is--next": item.isNext,
1270
- "is--disabled": isDateDisabled(item),
1271
- "is--selected": isSelected,
1272
- "is--hover": import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
891
+ },
892
+ [
893
+ (0, import_vue.h)(
894
+ "div",
895
+ {
896
+ class: "vxe-calendar--view-item-inner"
897
+ },
898
+ [
899
+ (0, import_vue.h)(
900
+ "div",
901
+ {
902
+ class: "vxe-calendar--view-item-label"
903
+ },
904
+ item.label
905
+ )
906
+ ]
907
+ )
908
+ ]
909
+ );
910
+ })
911
+ )
912
+ ]
913
+ ),
914
+ (0, import_vue.h)(
915
+ "div",
916
+ {
917
+ class: "vxe-calendar--view-body"
918
+ },
919
+ dayDatas.map((rows) => {
920
+ return (0, import_vue.h)(
921
+ "div",
922
+ {
923
+ class: "vxe-calendar--view-row",
924
+ style: {
925
+ height: `${100 / dayDatas.length}%`
926
+ }
927
+ },
928
+ rows.map((item) => {
929
+ const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
930
+ return (0, import_vue.h)(
931
+ "div",
932
+ {
933
+ class: [
934
+ "vxe-calendar--view-item",
935
+ {
936
+ "is--prev": item.isPrev,
937
+ "is--current": item.isCurrent,
938
+ "is--now": item.isNow,
939
+ "is--next": item.isNext,
940
+ "is--disabled": isDateDisabled(item),
941
+ "is--selected": isSelected,
942
+ "is--hover": import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
943
+ }
944
+ ],
945
+ style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
946
+ width: `${100 / rows.length}%`
947
+ }),
948
+ onClick: (evnt) => dateClickEvent(evnt, item),
949
+ onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
950
+ onMouseenter: () => dateMouseenterEvent(item),
951
+ onMouseleave: dateMouseleaveEvent
952
+ },
953
+ [
954
+ (0, import_vue.h)(
955
+ "div",
956
+ {
957
+ class: "vxe-calendar--view-item-inner"
958
+ },
959
+ renderDateLabel(item, item.label)
960
+ )
961
+ ]
962
+ );
963
+ })
964
+ );
965
+ })
966
+ )
967
+ ]
968
+ )
969
+ ];
970
+ };
971
+ const renderDateWeekTable = () => {
972
+ const { multiple, cellStyle } = props;
973
+ const { datePanelType, datePanelValue } = reactData;
974
+ const dateValue = computeDateValue.value;
975
+ const weekHeaders = computeWeekHeaders.value;
976
+ const weekDates = computeWeekDates.value;
977
+ const dateListValue = computeDateListValue.value;
978
+ const matchFormat = "yyyyMMdd";
979
+ return [
980
+ (0, import_vue.h)(
981
+ "div",
982
+ {
983
+ class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
984
+ },
985
+ [
986
+ (0, import_vue.h)(
987
+ "div",
988
+ {
989
+ class: "vxe-calendar--view-header",
990
+ style: {
991
+ height: `${100 / (weekDates.length + 1)}%`
992
+ }
993
+ },
994
+ [
995
+ (0, import_vue.h)(
996
+ "div",
997
+ {
998
+ class: "vxe-calendar--view-row"
999
+ },
1000
+ weekHeaders.map((item, rIndex) => {
1001
+ return (0, import_vue.h)(
1002
+ "div",
1003
+ {
1004
+ class: "vxe-calendar--view-item",
1005
+ style: {
1006
+ width: `${rIndex ? 13 : 9}%`
1273
1007
  }
1274
- ],
1275
- style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
1276
- width: `${100 / rows.length}%`
1277
- }),
1278
- onClick: (evnt) => dateClickEvent(evnt, item),
1279
- onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
1280
- onMouseenter: () => dateMouseenterEvent(item),
1281
- onMouseleave: dateMouseleaveEvent
1282
- },
1283
- [
1284
- (0, import_vue.h)(
1285
- "div",
1286
- {
1287
- class: "vxe-calendar--view-item-inner"
1288
- },
1289
- renderDateLabel(item, item.year)
1290
- )
1291
- ]
1292
- );
1293
- })
1294
- );
1295
- })
1296
- )
1297
- ]
1298
- )
1299
- ];
1300
- };
1301
- const renderDateTable = () => {
1302
- const { datePanelType } = reactData;
1303
- switch (datePanelType) {
1304
- case "week":
1305
- return renderDateWeekTable();
1306
- case "month":
1307
- return renderDateMonthTable();
1308
- case "quarter":
1309
- return renderDateQuarterTable();
1310
- case "year":
1311
- return renderDateYearTable();
1312
- }
1313
- return renderDateDayTable();
1314
- };
1315
- const renderDatePanel = () => {
1316
- const { multiple } = props;
1317
- const { datePanelType } = reactData;
1318
- const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
1319
- const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
1320
- const selectDatePanelObj = computeSelectDatePanelObj.value;
1321
- return [
1322
- (0, import_vue.h)(
1008
+ },
1009
+ [
1010
+ (0, import_vue.h)(
1011
+ "div",
1012
+ {
1013
+ class: "vxe-calendar--view-item-inner"
1014
+ },
1015
+ [
1016
+ (0, import_vue.h)(
1017
+ "div",
1018
+ {
1019
+ class: "vxe-calendar--view-item-label"
1020
+ },
1021
+ item.label
1022
+ )
1023
+ ]
1024
+ )
1025
+ ]
1026
+ );
1027
+ })
1028
+ )
1029
+ ]
1030
+ ),
1031
+ (0, import_vue.h)(
1032
+ "div",
1033
+ {
1034
+ class: "vxe-calendar--view-body"
1035
+ },
1036
+ weekDates.map((rows) => {
1037
+ const isSelected = multiple ? rows.some((item) => dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat))) : rows.some((item) => import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat));
1038
+ const isHover = rows.some((item) => import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat));
1039
+ const isNowWeek = rows.some((item) => item.isNow);
1040
+ return (0, import_vue.h)(
1041
+ "div",
1042
+ {
1043
+ class: "vxe-calendar--view-row",
1044
+ style: {
1045
+ height: `${100 / weekDates.length}%`
1046
+ }
1047
+ },
1048
+ rows.map((item, rIndex) => {
1049
+ return (0, import_vue.h)(
1050
+ "div",
1051
+ {
1052
+ class: [
1053
+ "vxe-calendar--view-item",
1054
+ {
1055
+ "is--prev": item.isPrev,
1056
+ "is--current": item.isCurrent,
1057
+ "is--now": rIndex ? item.isNow : isNowWeek,
1058
+ "is--next": item.isNext,
1059
+ "is--disabled": isDateDisabled(item),
1060
+ "is--selected": isSelected,
1061
+ "is--hover": isHover
1062
+ }
1063
+ ],
1064
+ style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
1065
+ width: `${rIndex ? 13 : 9}%`
1066
+ }),
1067
+ onClick: (evnt) => dateClickEvent(evnt, item),
1068
+ onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
1069
+ onMouseenter: () => dateMouseenterEvent(item),
1070
+ onMouseleave: dateMouseleaveEvent
1071
+ },
1072
+ [
1073
+ (0, import_vue.h)(
1074
+ "div",
1075
+ {
1076
+ class: "vxe-calendar--view-item-inner"
1077
+ },
1078
+ renderDateLabel(item, item.label)
1079
+ )
1080
+ ]
1081
+ );
1082
+ })
1083
+ );
1084
+ })
1085
+ )
1086
+ ]
1087
+ )
1088
+ ];
1089
+ };
1090
+ const renderDateMonthTable = () => {
1091
+ const { multiple, cellStyle } = props;
1092
+ const { datePanelType, datePanelValue } = reactData;
1093
+ const dateValue = computeDateValue.value;
1094
+ const monthDatas = computeMonthDatas.value;
1095
+ const dateListValue = computeDateListValue.value;
1096
+ const matchFormat = "yyyyMM";
1097
+ return [
1098
+ (0, import_vue.h)(
1099
+ "div",
1100
+ {
1101
+ class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
1102
+ },
1103
+ [
1104
+ (0, import_vue.h)(
1105
+ "div",
1106
+ {
1107
+ class: "vxe-calendar--view-body"
1108
+ },
1109
+ monthDatas.map((rows) => {
1110
+ return (0, import_vue.h)(
1111
+ "div",
1112
+ {
1113
+ class: "vxe-calendar--view-row",
1114
+ style: {
1115
+ height: `${100 / monthDatas.length}%`
1116
+ }
1117
+ },
1118
+ rows.map((item) => {
1119
+ const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
1120
+ return (0, import_vue.h)(
1121
+ "div",
1122
+ {
1123
+ class: [
1124
+ "vxe-calendar--view-item",
1125
+ {
1126
+ "is--prev": item.isPrev,
1127
+ "is--current": item.isCurrent,
1128
+ "is--now": item.isNow,
1129
+ "is--next": item.isNext,
1130
+ "is--disabled": isDateDisabled(item),
1131
+ "is--selected": isSelected,
1132
+ "is--hover": import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
1133
+ }
1134
+ ],
1135
+ style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
1136
+ width: `${100 / rows.length}%`
1137
+ }),
1138
+ onClick: (evnt) => dateClickEvent(evnt, item),
1139
+ onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
1140
+ onMouseenter: () => dateMouseenterEvent(item),
1141
+ onMouseleave: dateMouseleaveEvent
1142
+ },
1143
+ [
1144
+ (0, import_vue.h)(
1145
+ "div",
1146
+ {
1147
+ class: "vxe-calendar--view-item-inner"
1148
+ },
1149
+ renderDateLabel(item, getI18n(`vxe.input.date.months.m${item.month}`))
1150
+ )
1151
+ ]
1152
+ );
1153
+ })
1154
+ );
1155
+ })
1156
+ )
1157
+ ]
1158
+ )
1159
+ ];
1160
+ };
1161
+ const renderDateQuarterTable = () => {
1162
+ const { multiple, cellStyle } = props;
1163
+ const { datePanelType, datePanelValue } = reactData;
1164
+ const dateValue = computeDateValue.value;
1165
+ const quarterDatas = computeQuarterDatas.value;
1166
+ const dateListValue = computeDateListValue.value;
1167
+ const matchFormat = "yyyyq";
1168
+ return [
1169
+ (0, import_vue.h)(
1170
+ "div",
1171
+ {
1172
+ class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
1173
+ },
1174
+ [
1175
+ (0, import_vue.h)(
1176
+ "div",
1177
+ {
1178
+ class: "vxe-calendar--view-body"
1179
+ },
1180
+ quarterDatas.map((rows) => {
1181
+ return (0, import_vue.h)(
1182
+ "div",
1183
+ {
1184
+ class: "vxe-calendar--view-row",
1185
+ style: {
1186
+ height: `${100 / quarterDatas.length}%`
1187
+ }
1188
+ },
1189
+ rows.map((item) => {
1190
+ const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
1191
+ return (0, import_vue.h)(
1192
+ "div",
1193
+ {
1194
+ class: [
1195
+ "vxe-calendar--view-item",
1196
+ {
1197
+ "is--prev": item.isPrev,
1198
+ "is--current": item.isCurrent,
1199
+ "is--now": item.isNow,
1200
+ "is--next": item.isNext,
1201
+ "is--disabled": isDateDisabled(item),
1202
+ "is--selected": isSelected,
1203
+ "is--hover": import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
1204
+ }
1205
+ ],
1206
+ style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
1207
+ width: `${100 / rows.length}%`
1208
+ }),
1209
+ onClick: (evnt) => dateClickEvent(evnt, item),
1210
+ onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
1211
+ onMouseenter: () => dateMouseenterEvent(item),
1212
+ onMouseleave: dateMouseleaveEvent
1213
+ },
1214
+ [
1215
+ (0, import_vue.h)(
1216
+ "div",
1217
+ {
1218
+ class: "vxe-calendar--view-item-inner"
1219
+ },
1220
+ renderDateLabel(item, getI18n(`vxe.input.date.quarters.q${item.quarter}`))
1221
+ )
1222
+ ]
1223
+ );
1224
+ })
1225
+ );
1226
+ })
1227
+ )
1228
+ ]
1229
+ )
1230
+ ];
1231
+ };
1232
+ const renderDateYearTable = () => {
1233
+ const { multiple, cellStyle } = props;
1234
+ const { datePanelType, datePanelValue } = reactData;
1235
+ const dateValue = computeDateValue.value;
1236
+ const yearDatas = computeYearDatas.value;
1237
+ const dateListValue = computeDateListValue.value;
1238
+ const matchFormat = "yyyy";
1239
+ return [
1240
+ (0, import_vue.h)(
1241
+ "div",
1242
+ {
1243
+ class: ["vxe-calendar--view-wrapper", `type--${datePanelType}`]
1244
+ },
1245
+ [
1246
+ (0, import_vue.h)(
1247
+ "div",
1248
+ {
1249
+ class: "vxe-calendar--view-body"
1250
+ },
1251
+ yearDatas.map((rows) => {
1252
+ return (0, import_vue.h)(
1253
+ "div",
1254
+ {
1255
+ class: "vxe-calendar--view-row",
1256
+ style: {
1257
+ height: `${100 / yearDatas.length}%`
1258
+ }
1259
+ },
1260
+ rows.map((item) => {
1261
+ const isSelected = multiple ? dateListValue.some((val) => import_xe_utils.default.isDateSame(val, item.date, matchFormat)) : import_xe_utils.default.isDateSame(dateValue, item.date, matchFormat);
1262
+ return (0, import_vue.h)(
1263
+ "div",
1264
+ {
1265
+ class: [
1266
+ "vxe-calendar--view-item",
1267
+ {
1268
+ "is--prev": item.isPrev,
1269
+ "is--current": item.isCurrent,
1270
+ "is--now": item.isNow,
1271
+ "is--next": item.isNext,
1272
+ "is--disabled": isDateDisabled(item),
1273
+ "is--selected": isSelected,
1274
+ "is--hover": import_xe_utils.default.isDateSame(datePanelValue, item.date, matchFormat)
1275
+ }
1276
+ ],
1277
+ style: Object.assign({}, import_xe_utils.default.isFunction(cellStyle) ? cellStyle({ type: datePanelType, viewType: datePanelType, date: item.date, $calendar: $xeCalendar }) : cellStyle, {
1278
+ width: `${100 / rows.length}%`
1279
+ }),
1280
+ onClick: (evnt) => dateClickEvent(evnt, item),
1281
+ onContextmenu: (evnt) => datContextmenuEvent(evnt, item),
1282
+ onMouseenter: () => dateMouseenterEvent(item),
1283
+ onMouseleave: dateMouseleaveEvent
1284
+ },
1285
+ [
1286
+ (0, import_vue.h)(
1287
+ "div",
1288
+ {
1289
+ class: "vxe-calendar--view-item-inner"
1290
+ },
1291
+ renderDateLabel(item, item.year)
1292
+ )
1293
+ ]
1294
+ );
1295
+ })
1296
+ );
1297
+ })
1298
+ )
1299
+ ]
1300
+ )
1301
+ ];
1302
+ };
1303
+ const renderDateTable = () => {
1304
+ const { datePanelType } = reactData;
1305
+ switch (datePanelType) {
1306
+ case "week":
1307
+ return renderDateWeekTable();
1308
+ case "month":
1309
+ return renderDateMonthTable();
1310
+ case "quarter":
1311
+ return renderDateQuarterTable();
1312
+ case "year":
1313
+ return renderDateYearTable();
1314
+ }
1315
+ return renderDateDayTable();
1316
+ };
1317
+ const renderDatePanel = () => {
1318
+ const { multiple } = props;
1319
+ const { datePanelType } = reactData;
1320
+ const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
1321
+ const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
1322
+ const selectDatePanelObj = computeSelectDatePanelObj.value;
1323
+ return [
1324
+ (0, import_vue.h)(
1325
+ "div",
1326
+ {
1327
+ class: "vxe-calendar--header"
1328
+ },
1329
+ [
1330
+ (0, import_vue.h)(
1331
+ "div",
1332
+ {
1333
+ class: "vxe-calendar--type-wrapper"
1334
+ },
1335
+ [
1336
+ datePanelType === "year" ? (0, import_vue.h)(import_button.default, {
1337
+ class: "vxe-calendar--date-picker-label",
1338
+ disabled: datePanelType === "year",
1339
+ content: selectDatePanelObj.y
1340
+ }) : (0, import_vue.h)(
1341
+ "span",
1342
+ {
1343
+ class: "vxe-calendar--date-picker-btns"
1344
+ },
1345
+ [
1346
+ (0, import_vue.h)(import_button.default, {
1347
+ class: "vxe-calendar--date-picker-btn",
1348
+ content: selectDatePanelObj.y,
1349
+ onClick: dateToggleYearTypeEvent
1350
+ }),
1351
+ selectDatePanelObj.m ? (0, import_vue.h)(import_button.default, {
1352
+ class: "vxe-calendar--date-picker-btn",
1353
+ content: selectDatePanelObj.m,
1354
+ onClick: dateToggleMonthTypeEvent
1355
+ }) : renderEmptyElement($xeCalendar)
1356
+ ]
1357
+ )
1358
+ ]
1359
+ ),
1360
+ (0, import_vue.h)(
1361
+ "div",
1362
+ {
1363
+ class: "vxe-calendar--btn-wrapper"
1364
+ },
1365
+ [
1366
+ (0, import_vue.h)(import_button.default, {
1367
+ disabled: isDisabledPrevDateBtn,
1368
+ icon: "vxe-icon-caret-left",
1369
+ onClick: datePrevEvent
1370
+ }),
1371
+ (0, import_vue.h)(import_button.default, {
1372
+ icon: "vxe-icon-dot",
1373
+ onClick: dateTodayMonthEvent
1374
+ }),
1375
+ (0, import_vue.h)(import_button.default, {
1376
+ disabled: isDisabledNextDateBtn,
1377
+ icon: "vxe-icon-caret-right",
1378
+ onClick: dateNextEvent
1379
+ }),
1380
+ multiple && computeSupportMultiples.value ? (0, import_vue.h)(
1381
+ "span",
1382
+ {
1383
+ class: "vxe-calendar--btn vxe-calendar--confirm-btn"
1384
+ },
1385
+ [
1386
+ (0, import_vue.h)(
1387
+ "button",
1388
+ {
1389
+ class: "vxe-calendar--confirm",
1390
+ type: "button",
1391
+ onClick: dateConfirmEvent
1392
+ },
1393
+ getI18n("vxe.button.confirm")
1394
+ )
1395
+ ]
1396
+ ) : null
1397
+ ]
1398
+ )
1399
+ ]
1400
+ ),
1401
+ (0, import_vue.h)(
1402
+ "div",
1403
+ {
1404
+ class: "vxe-calendar--body"
1405
+ },
1406
+ renderDateTable()
1407
+ )
1408
+ ];
1409
+ };
1410
+ const dispatchEvent = (type, params, evnt) => {
1411
+ emit(type, createEvent(evnt, { $input: $xeCalendar }, params));
1412
+ };
1413
+ const calendarMethods = {
1414
+ dispatchEvent
1415
+ };
1416
+ Object.assign($xeCalendar, calendarMethods);
1417
+ const renderVN = () => {
1418
+ const { className, type } = props;
1419
+ const vSize = computeSize.value;
1420
+ const isDisabled = computeIsDisabled.value;
1421
+ const calendarStyle = computeCalendarStyle.value;
1422
+ return (0, import_vue.h)(
1323
1423
  "div",
1324
1424
  {
1325
- class: "vxe-calendar--header"
1326
- },
1327
- [
1328
- (0, import_vue.h)(
1329
- "div",
1425
+ ref: refElem,
1426
+ class: [
1427
+ "vxe-calendar",
1428
+ `type--${type}`,
1429
+ className,
1330
1430
  {
1331
- class: "vxe-calendar--type-wrapper"
1332
- },
1333
- [
1334
- datePanelType === "year" ? (0, import_vue.h)(import_button.default, {
1335
- class: "vxe-calendar--date-picker-label",
1336
- disabled: datePanelType === "year",
1337
- content: selectDatePanelObj.y
1338
- }) : (0, import_vue.h)(
1339
- "span",
1340
- {
1341
- class: "vxe-calendar--date-picker-btns"
1342
- },
1343
- [
1344
- (0, import_vue.h)(import_button.default, {
1345
- class: "vxe-calendar--date-picker-btn",
1346
- content: selectDatePanelObj.y,
1347
- onClick: dateToggleYearTypeEvent
1348
- }),
1349
- selectDatePanelObj.m ? (0, import_vue.h)(import_button.default, {
1350
- class: "vxe-calendar--date-picker-btn",
1351
- content: selectDatePanelObj.m,
1352
- onClick: dateToggleMonthTypeEvent
1353
- }) : renderEmptyElement($xeCalendar)
1354
- ]
1355
- )
1356
- ]
1357
- ),
1358
- (0, import_vue.h)(
1359
- "div",
1360
- {
1361
- class: "vxe-calendar--btn-wrapper"
1362
- },
1363
- [
1364
- (0, import_vue.h)(import_button.default, {
1365
- disabled: isDisabledPrevDateBtn,
1366
- icon: "vxe-icon-caret-left",
1367
- onClick: datePrevEvent
1368
- }),
1369
- (0, import_vue.h)(import_button.default, {
1370
- icon: "vxe-icon-dot",
1371
- onClick: dateTodayMonthEvent
1372
- }),
1373
- (0, import_vue.h)(import_button.default, {
1374
- disabled: isDisabledNextDateBtn,
1375
- icon: "vxe-icon-caret-right",
1376
- onClick: dateNextEvent
1377
- }),
1378
- multiple && computeSupportMultiples.value ? (0, import_vue.h)(
1379
- "span",
1380
- {
1381
- class: "vxe-calendar--btn vxe-calendar--confirm-btn"
1382
- },
1383
- [
1384
- (0, import_vue.h)(
1385
- "button",
1386
- {
1387
- class: "vxe-calendar--confirm",
1388
- type: "button",
1389
- onClick: dateConfirmEvent
1390
- },
1391
- getI18n("vxe.button.confirm")
1392
- )
1393
- ]
1394
- ) : null
1395
- ]
1396
- )
1397
- ]
1398
- ),
1399
- (0, import_vue.h)(
1400
- "div",
1401
- {
1402
- class: "vxe-calendar--body"
1431
+ [`size--${vSize}`]: vSize,
1432
+ "is--disabled": isDisabled
1433
+ }
1434
+ ],
1435
+ style: calendarStyle
1403
1436
  },
1404
- renderDateTable()
1405
- )
1406
- ];
1407
- };
1408
- const dispatchEvent = (type, params, evnt) => {
1409
- emit(type, createEvent(evnt, { $input: $xeCalendar }, params));
1410
- };
1411
- const calendarMethods = {
1412
- dispatchEvent
1413
- };
1414
- Object.assign($xeCalendar, calendarMethods);
1415
- const renderVN = () => {
1416
- const { className, type } = props;
1417
- const vSize = computeSize.value;
1418
- const isDisabled = computeIsDisabled.value;
1419
- const calendarStyle = computeCalendarStyle.value;
1420
- return (0, import_vue.h)(
1421
- "div",
1422
- {
1423
- ref: refElem,
1424
- class: [
1425
- "vxe-calendar",
1426
- `type--${type}`,
1427
- className,
1428
- {
1429
- [`size--${vSize}`]: vSize,
1430
- "is--disabled": isDisabled
1431
- }
1432
- ],
1433
- style: calendarStyle
1434
- },
1435
- [renderDatePanel()]
1437
+ [renderDatePanel()]
1438
+ );
1439
+ };
1440
+ $xeCalendar.renderVN = renderVN;
1441
+ (0, import_vue.watch)(
1442
+ () => props.modelValue,
1443
+ (val) => {
1444
+ reactData.inputValue = val;
1445
+ changeValue();
1446
+ }
1436
1447
  );
1437
- };
1438
- $xeCalendar.renderVN = renderVN;
1439
- (0, import_vue.watch)(
1440
- () => props.modelValue,
1441
- (val) => {
1442
- reactData.inputValue = val;
1443
- changeValue();
1444
- }
1445
- );
1446
- (0, import_vue.watch)(
1447
- () => props.type,
1448
- () => {
1449
- Object.assign(reactData, {
1450
- selectValue: null,
1451
- inputValue: null,
1452
- datePanelValue: null,
1453
- datePanelLabel: "",
1454
- datePanelType: "day",
1455
- selectMonth: null,
1456
- currentDate: null
1457
- });
1458
- initValue();
1448
+ (0, import_vue.watch)(
1449
+ () => props.type,
1450
+ () => {
1451
+ Object.assign(reactData, {
1452
+ selectValue: null,
1453
+ inputValue: null,
1454
+ datePanelValue: null,
1455
+ datePanelLabel: "",
1456
+ datePanelType: "day",
1457
+ selectMonth: null,
1458
+ currentDate: null
1459
+ });
1460
+ initValue();
1461
+ dateOpenPanel();
1462
+ }
1463
+ );
1464
+ (0, import_vue.watch)(computeDateLabelFormat, () => {
1465
+ const isCalendarType = computeIsCalendarType.value;
1466
+ if (isCalendarType) {
1467
+ dateParseValue(reactData.datePanelValue);
1468
+ reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
1469
+ }
1470
+ });
1471
+ (0, import_vue.onMounted)(() => {
1472
+ const { menuConfig } = props;
1473
+ const VxeUIContextMenu = import_core.VxeUI.getComponent("VxeContextMenu");
1474
+ if (menuConfig && !VxeUIContextMenu) {
1475
+ errLog("vxe.error.reqComp", ["vxe-context-menu"]);
1476
+ }
1459
1477
  dateOpenPanel();
1460
- }
1461
- );
1462
- (0, import_vue.watch)(computeDateLabelFormat, () => {
1463
- const isCalendarType = computeIsCalendarType.value;
1464
- if (isCalendarType) {
1465
- dateParseValue(reactData.datePanelValue);
1466
- reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
1467
- }
1468
- });
1469
- (0, import_vue.onMounted)(() => {
1470
- const { menuConfig } = props;
1471
- const VxeUIContextMenu = import_core.VxeUI.getComponent("VxeContextMenu");
1472
- if (menuConfig && !VxeUIContextMenu) {
1473
- errLog("vxe.error.reqComp", ["vxe-context-menu"]);
1474
- }
1475
- dateOpenPanel();
1476
- });
1477
- initValue();
1478
- return $xeCalendar;
1479
- },
1480
- render() {
1481
- return this.renderVN();
1482
- }
1483
- });
1478
+ });
1479
+ initValue();
1480
+ return $xeCalendar;
1481
+ },
1482
+ render() {
1483
+ return this.renderVN();
1484
+ }
1485
+ })
1486
+ );