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
@@ -73,1639 +73,1642 @@ function createInternalData() {
73
73
  laseFocusMasked: 0
74
74
  };
75
75
  }
76
- var date_picker_default = (0, import_comp.defineVxeComponent)({
77
- name: "VxeDatePicker",
78
- props: {
79
- modelValue: [String, Number, Date],
80
- immediate: {
81
- type: Boolean,
82
- default: true
83
- },
84
- name: String,
85
- type: {
86
- type: String,
87
- default: "date"
88
- },
89
- width: [Number, String],
90
- clearable: {
91
- type: Boolean,
92
- default: () => getConfig().datePicker.clearable
93
- },
94
- readonly: {
95
- type: Boolean,
96
- default: null
97
- },
98
- disabled: {
99
- type: Boolean,
100
- default: null
101
- },
102
- placeholder: String,
103
- autoComplete: {
104
- type: String,
105
- default: "off"
106
- },
107
- form: String,
108
- className: String,
109
- inputClassName: {
110
- type: String,
111
- default: () => getConfig().datePicker.inputClassName
112
- },
113
- zIndex: Number,
114
- size: {
115
- type: String,
116
- default: () => getConfig().datePicker.size || getConfig().size
117
- },
118
- multiple: Boolean,
119
- limitCount: {
120
- type: [String, Number],
121
- default: () => getConfig().datePicker.limitCount
122
- },
123
- // date、week、month、quarter、year
124
- startDate: {
125
- type: [String, Number, Date],
126
- default: () => getConfig().datePicker.startDate
127
- },
128
- endDate: {
129
- type: [String, Number, Date],
130
- default: () => getConfig().datePicker.endDate
131
- },
132
- defaultDate: [String, Number, Date],
133
- defaultTime: [String, Number, Date],
134
- minDate: [String, Number, Date],
135
- maxDate: [String, Number, Date],
136
- startDay: {
137
- type: [String, Number],
138
- default: () => getConfig().datePicker.startDay
139
- },
140
- labelFormat: String,
141
- valueFormat: String,
142
- timeFormat: String,
143
- parseInputMethod: Function,
144
- editable: {
145
- type: Boolean,
146
- default: true
147
- },
148
- festivalMethod: Function,
149
- disabledMethod: Function,
150
- // week
151
- selectDay: {
152
- type: [String, Number],
153
- default: () => getConfig().datePicker.selectDay
154
- },
155
- showClearButton: {
156
- type: Boolean,
157
- default: () => getConfig().datePicker.showClearButton
158
- },
159
- showConfirmButton: {
160
- type: Boolean,
161
- default: () => getConfig().datePicker.showConfirmButton
162
- },
163
- autoClose: {
164
- type: Boolean,
165
- default: () => getConfig().datePicker.autoClose
166
- },
167
- maskedConfig: Object,
168
- prefixIcon: String,
169
- suffixIcon: String,
170
- /**
171
- * 已废弃,请使用 popupConfig.placement
172
- * @deprecated
173
- */
174
- placement: String,
175
- /**
176
- * 已废弃,请使用 popupConfig.transfer
177
- * @deprecated
178
- */
179
- transfer: {
180
- type: Boolean,
181
- default: null
76
+ var date_picker_default = (
77
+ /* define-vxe-component start */
78
+ (0, import_comp.defineVxeComponent)({
79
+ name: "VxeDatePicker",
80
+ props: {
81
+ modelValue: [String, Number, Date],
82
+ immediate: {
83
+ type: Boolean,
84
+ default: true
85
+ },
86
+ name: String,
87
+ type: {
88
+ type: String,
89
+ default: "date"
90
+ },
91
+ width: [Number, String],
92
+ clearable: {
93
+ type: Boolean,
94
+ default: () => getConfig().datePicker.clearable
95
+ },
96
+ readonly: {
97
+ type: Boolean,
98
+ default: null
99
+ },
100
+ disabled: {
101
+ type: Boolean,
102
+ default: null
103
+ },
104
+ placeholder: String,
105
+ autoComplete: {
106
+ type: String,
107
+ default: "off"
108
+ },
109
+ form: String,
110
+ className: String,
111
+ inputClassName: {
112
+ type: String,
113
+ default: () => getConfig().datePicker.inputClassName
114
+ },
115
+ zIndex: Number,
116
+ size: {
117
+ type: String,
118
+ default: () => getConfig().datePicker.size || getConfig().size
119
+ },
120
+ multiple: Boolean,
121
+ limitCount: {
122
+ type: [String, Number],
123
+ default: () => getConfig().datePicker.limitCount
124
+ },
125
+ // date、week、month、quarter、year
126
+ startDate: {
127
+ type: [String, Number, Date],
128
+ default: () => getConfig().datePicker.startDate
129
+ },
130
+ endDate: {
131
+ type: [String, Number, Date],
132
+ default: () => getConfig().datePicker.endDate
133
+ },
134
+ defaultDate: [String, Number, Date],
135
+ defaultTime: [String, Number, Date],
136
+ minDate: [String, Number, Date],
137
+ maxDate: [String, Number, Date],
138
+ startDay: {
139
+ type: [String, Number],
140
+ default: () => getConfig().datePicker.startDay
141
+ },
142
+ labelFormat: String,
143
+ valueFormat: String,
144
+ timeFormat: String,
145
+ parseInputMethod: Function,
146
+ editable: {
147
+ type: Boolean,
148
+ default: true
149
+ },
150
+ festivalMethod: Function,
151
+ disabledMethod: Function,
152
+ // week
153
+ selectDay: {
154
+ type: [String, Number],
155
+ default: () => getConfig().datePicker.selectDay
156
+ },
157
+ showClearButton: {
158
+ type: Boolean,
159
+ default: () => getConfig().datePicker.showClearButton
160
+ },
161
+ showConfirmButton: {
162
+ type: Boolean,
163
+ default: () => getConfig().datePicker.showConfirmButton
164
+ },
165
+ autoClose: {
166
+ type: Boolean,
167
+ default: () => getConfig().datePicker.autoClose
168
+ },
169
+ maskedConfig: Object,
170
+ prefixIcon: String,
171
+ suffixIcon: String,
172
+ /**
173
+ * 已废弃,请使用 popupConfig.placement
174
+ * @deprecated
175
+ */
176
+ placement: String,
177
+ /**
178
+ * 已废弃,请使用 popupConfig.transfer
179
+ * @deprecated
180
+ */
181
+ transfer: {
182
+ type: Boolean,
183
+ default: null
184
+ },
185
+ timeConfig: Object,
186
+ popupConfig: Object,
187
+ shortcutConfig: Object,
188
+ /**
189
+ * 已废弃 startWeek,被 startDay 替换
190
+ * @deprecated
191
+ */
192
+ startWeek: Number
182
193
  },
183
- timeConfig: Object,
184
- popupConfig: Object,
185
- shortcutConfig: Object,
186
- /**
187
- * 已废弃 startWeek,被 startDay 替换
188
- * @deprecated
189
- */
190
- startWeek: Number
191
- },
192
- emits: ["update:modelValue", "input", "change", "keydown", "keyup", "click", "focus", "blur", "clear", "confirm", "prefix-click", "suffix-click", "date-prev", "date-today", "date-next", "shortcut-click"],
193
- setup(props, context) {
194
- const { slots, emit } = context;
195
- const $xeModal = (0, import_vue.inject)("$xeModal", null);
196
- const $xeDrawer = (0, import_vue.inject)("$xeDrawer", null);
197
- const $xeTable = (0, import_vue.inject)("$xeTable", null);
198
- const $xeCard = (0, import_vue.inject)("$xeCard", null);
199
- const $xeForm = (0, import_vue.inject)("$xeForm", null);
200
- const formItemInfo = (0, import_vue.inject)("xeFormItemInfo", null);
201
- const xID = import_xe_utils.default.uniqueId();
202
- const { computeSize } = useFns.useSize(props);
203
- const reactData = (0, import_vue.reactive)(createReactData());
204
- const internalData = createInternalData();
205
- const defaultFuncProps = {
206
- parseInputMethod: getConfig().datePicker.parseInputMethod,
207
- festivalMethod: getConfig().datePicker.festivalMethod,
208
- disabledMethod: getConfig().datePicker.disabledMethod
209
- };
210
- const refElem = (0, import_vue.ref)();
211
- const refInputTarget = (0, import_vue.ref)();
212
- const refInputPanel = (0, import_vue.ref)();
213
- const refPanelWrapper = (0, import_vue.ref)();
214
- const refDatePanel = (0, import_vue.ref)();
215
- const refMaps = {
216
- refElem,
217
- refInput: refInputTarget
218
- };
219
- const $xeDatePicker = {
220
- xID,
221
- props,
222
- context,
223
- reactData,
224
- internalData,
225
- getRefMaps: () => refMaps
226
- };
227
- const computeBtnTransfer = (0, import_vue.computed)(() => {
228
- const { transfer } = props;
229
- const popupOpts = computePopupOpts.value;
230
- if (import_xe_utils.default.isBoolean(popupOpts.transfer)) {
231
- return popupOpts.transfer;
232
- }
233
- if (transfer === null) {
234
- const globalTransfer = getConfig().datePicker.transfer;
235
- if (import_xe_utils.default.isBoolean(globalTransfer)) {
236
- return globalTransfer;
237
- }
238
- if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
239
- return true;
240
- }
241
- }
242
- return transfer;
243
- });
244
- const computeFormReadonly = (0, import_vue.computed)(() => {
245
- const { readonly } = props;
246
- if (readonly === null) {
247
- if ($xeForm) {
248
- return $xeForm.props.readonly;
249
- }
250
- return false;
251
- }
252
- return readonly;
253
- });
254
- const computeIsDisabled = (0, import_vue.computed)(() => {
255
- const { disabled } = props;
256
- if (disabled === null) {
257
- if ($xeForm) {
258
- return $xeForm.props.disabled;
194
+ emits: ["update:modelValue", "input", "change", "keydown", "keyup", "click", "focus", "blur", "clear", "confirm", "prefix-click", "suffix-click", "date-prev", "date-today", "date-next", "shortcut-click"],
195
+ setup(props, context) {
196
+ const { slots, emit } = context;
197
+ const $xeModal = (0, import_vue.inject)("$xeModal", null);
198
+ const $xeDrawer = (0, import_vue.inject)("$xeDrawer", null);
199
+ const $xeTable = (0, import_vue.inject)("$xeTable", null);
200
+ const $xeCard = (0, import_vue.inject)("$xeCard", null);
201
+ const $xeForm = (0, import_vue.inject)("$xeForm", null);
202
+ const formItemInfo = (0, import_vue.inject)("xeFormItemInfo", null);
203
+ const xID = import_xe_utils.default.uniqueId();
204
+ const { computeSize } = useFns.useSize(props);
205
+ const reactData = (0, import_vue.reactive)(createReactData());
206
+ const internalData = createInternalData();
207
+ const defaultFuncProps = {
208
+ parseInputMethod: getConfig().datePicker.parseInputMethod,
209
+ festivalMethod: getConfig().datePicker.festivalMethod,
210
+ disabledMethod: getConfig().datePicker.disabledMethod
211
+ };
212
+ const refElem = (0, import_vue.ref)();
213
+ const refInputTarget = (0, import_vue.ref)();
214
+ const refInputPanel = (0, import_vue.ref)();
215
+ const refPanelWrapper = (0, import_vue.ref)();
216
+ const refDatePanel = (0, import_vue.ref)();
217
+ const refMaps = {
218
+ refElem,
219
+ refInput: refInputTarget
220
+ };
221
+ const $xeDatePicker = {
222
+ xID,
223
+ props,
224
+ context,
225
+ reactData,
226
+ internalData,
227
+ getRefMaps: () => refMaps
228
+ };
229
+ const computeBtnTransfer = (0, import_vue.computed)(() => {
230
+ const { transfer } = props;
231
+ const popupOpts = computePopupOpts.value;
232
+ if (import_xe_utils.default.isBoolean(popupOpts.transfer)) {
233
+ return popupOpts.transfer;
259
234
  }
260
- return false;
261
- }
262
- return disabled;
263
- });
264
- const computeIsTimeType = (0, import_vue.computed)(() => {
265
- const { type } = props;
266
- return type === "time";
267
- });
268
- const computeIsTimeOrDateTimeType = (0, import_vue.computed)(() => {
269
- const { type } = props;
270
- const isTimeType = computeIsTimeType.value;
271
- return isTimeType || type === "datetime";
272
- });
273
- const computeIsDatePickerType = (0, import_vue.computed)(() => {
274
- const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
275
- return isTimeOrDateTimeType || ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
276
- });
277
- const computeIsClearable = (0, import_vue.computed)(() => {
278
- return props.clearable;
279
- });
280
- const computeIsDatePanelType = (0, import_vue.computed)(() => {
281
- const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
282
- return isTimeOrDateTimeType || ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
283
- });
284
- const computeDateListValue = (0, import_vue.computed)(() => {
285
- const { modelValue, type, multiple } = props;
286
- const isDatePanelType = computeIsDatePanelType.value;
287
- const dateValueFormat = computeDateValueFormat.value;
288
- if (multiple && modelValue && isDatePanelType) {
289
- return import_xe_utils.default.toValueString(modelValue).split(",").map((item) => {
290
- const date = (0, import_util.parseDateValue)(item, type, {
291
- valueFormat: dateValueFormat
292
- });
293
- if (import_xe_utils.default.isValidDate(date)) {
294
- return date;
235
+ if (transfer === null) {
236
+ const globalTransfer = getConfig().datePicker.transfer;
237
+ if (import_xe_utils.default.isBoolean(globalTransfer)) {
238
+ return globalTransfer;
295
239
  }
296
- return date;
297
- });
298
- }
299
- return [];
300
- });
301
- const computeCurrStyle = (0, import_vue.computed)(() => {
302
- const { width } = props;
303
- const stys = {};
304
- if (width) {
305
- stys.width = (0, import_dom.toCssUnit)(width);
306
- }
307
- return stys;
308
- });
309
- const computeDateStartDate = (0, import_vue.computed)(() => {
310
- return props.startDate ? import_xe_utils.default.toStringDate(props.startDate) : null;
311
- });
312
- const computeDateEndDate = (0, import_vue.computed)(() => {
313
- return props.endDate ? import_xe_utils.default.toStringDate(props.endDate) : null;
314
- });
315
- const computeLimitMaxCount = (0, import_vue.computed)(() => {
316
- return props.multiple ? import_xe_utils.default.toNumber(props.limitCount) : 0;
317
- });
318
- const computeDateMultipleValue = (0, import_vue.computed)(() => {
319
- const dateListValue = computeDateListValue.value;
320
- const dateValueFormat = computeDateValueFormat.value;
321
- return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateValueFormat));
322
- });
323
- const computeOverCount = (0, import_vue.computed)(() => {
324
- const { multiple } = props;
325
- const limitMaxCount = computeLimitMaxCount.value;
326
- const dateMultipleValue = computeDateMultipleValue.value;
327
- if (multiple && limitMaxCount) {
328
- return dateMultipleValue.length >= limitMaxCount;
329
- }
330
- return false;
331
- });
332
- const computeInputReadonly = (0, import_vue.computed)(() => {
333
- const { type, editable, multiple } = props;
334
- const formReadonly = computeFormReadonly.value;
335
- return formReadonly || multiple || !editable || type === "week" || type === "quarter";
336
- });
337
- const computeInpPlaceholder = (0, import_vue.computed)(() => {
338
- const { placeholder } = props;
339
- if (placeholder) {
340
- return (0, import_utils.getFuncText)(placeholder);
341
- }
342
- const globalPlaceholder = getConfig().datePicker.placeholder;
343
- if (globalPlaceholder) {
344
- return (0, import_utils.getFuncText)(globalPlaceholder);
345
- }
346
- return getI18n("vxe.base.pleaseSelect");
347
- });
348
- const computeInpImmediate = (0, import_vue.computed)(() => {
349
- const { immediate } = props;
350
- return immediate;
351
- });
352
- const computeTimeOpts = (0, import_vue.computed)(() => {
353
- return Object.assign({}, getConfig().datePicker.timeConfig, props.timeConfig);
354
- });
355
- const computePopupOpts = (0, import_vue.computed)(() => {
356
- return Object.assign({}, getConfig().datePicker.popupConfig, props.popupConfig);
357
- });
358
- const computeShortcutOpts = (0, import_vue.computed)(() => {
359
- return Object.assign({}, getConfig().datePicker.shortcutConfig, props.shortcutConfig);
360
- });
361
- const computeShortcutList = (0, import_vue.computed)(() => {
362
- const shortcutOpts = computeShortcutOpts.value;
363
- const { options } = shortcutOpts;
364
- if (options) {
365
- return options.map((option, index) => {
366
- return Object.assign(
367
- {
368
- name: `${option.name || option.code || index}`
369
- },
370
- option
371
- );
372
- });
373
- }
374
- return [];
375
- });
376
- const computeDateLabelFormat = (0, import_vue.computed)(() => {
377
- const { labelFormat } = props;
378
- return labelFormat || getI18n(`vxe.input.date.labelFormat.${props.type}`);
379
- });
380
- const computeDateValueFormat = (0, import_vue.computed)(() => {
381
- const { type, valueFormat } = props;
382
- return (0, import_util.handleValueFormat)(type, valueFormat);
383
- });
384
- const computeDateMaskedFormat = (0, import_vue.computed)(() => {
385
- const dateLabelFormat = computeDateLabelFormat.value;
386
- return dateLabelFormat;
387
- });
388
- const computeFirstDayOfWeek = (0, import_vue.computed)(() => {
389
- const { startDay } = props;
390
- return import_xe_utils.default.toNumber(startDay);
391
- });
392
- const computePanelLabel = (0, import_vue.computed)(() => {
393
- const { type, multiple } = props;
394
- const { inputValue } = reactData;
395
- const dateLabelFormat = computeDateLabelFormat.value;
396
- const dateValueFormat = computeDateValueFormat.value;
397
- const firstDayOfWeek = computeFirstDayOfWeek.value;
398
- const vals = inputValue ? multiple ? inputValue.split(",") : [inputValue] : [];
399
- return vals.map((val) => {
400
- const dateObj = (0, import_util.parseDateObj)(val, type, {
401
- valueFormat: dateValueFormat,
402
- labelFormat: dateLabelFormat,
403
- firstDay: firstDayOfWeek
404
- });
405
- return dateObj.label;
406
- }).join(", ");
407
- });
408
- const computeMaskedOpts = (0, import_vue.computed)(() => {
409
- return Object.assign({}, getConfig().datePicker.maskedConfig, props.maskedConfig);
410
- });
411
- const computeMaskChar = (0, import_vue.computed)(() => {
412
- const maskedOpts = computeMaskedOpts.value;
413
- const { maskPlaceholder } = maskedOpts;
414
- return (maskPlaceholder ? ("" + maskPlaceholder)[0] : "") || defaultMaskPlaceholder;
415
- });
416
- const updateModelValue = () => {
417
- const { modelValue } = props;
418
- let val = "";
419
- if (modelValue) {
420
- if (import_xe_utils.default.isNumber(modelValue) && /^[0-9]{11,15}$/.test(`${modelValue}`)) {
421
- val = new Date(modelValue);
422
- } else {
423
- val = modelValue;
424
- }
425
- }
426
- reactData.inputValue = val;
427
- };
428
- const handleInputLabel = (text, isUpdate) => {
429
- internalData.inputLabel = text;
430
- if (isUpdate) {
431
- reactData.labelFlag++;
432
- }
433
- };
434
- const triggerEvent = (evnt) => {
435
- const { inputValue } = reactData;
436
- dispatchEvent(evnt.type, { value: inputValue }, evnt);
437
- };
438
- const handleChange = (value, evnt) => {
439
- const { type, modelValue, valueFormat } = props;
440
- const dateValueFormat = computeDateValueFormat.value;
441
- reactData.inputValue = value;
442
- if ((0, import_util.hasTimestampValueType)(valueFormat)) {
443
- const dateVal = (0, import_util.parseDateValue)(value, type, { valueFormat: dateValueFormat });
444
- const timeNum = dateVal ? dateVal.getTime() : null;
445
- emitModel(timeNum);
446
- if (modelValue !== timeNum) {
447
- dispatchEvent("change", { value: timeNum }, evnt);
448
- if ($xeForm && formItemInfo) {
449
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, timeNum);
240
+ if ($xeTable || $xeModal || $xeDrawer || $xeCard || $xeForm) {
241
+ return true;
450
242
  }
451
243
  }
452
- } else if ((0, import_util.hasDateValueType)(valueFormat)) {
453
- const dateVal = (0, import_util.parseDateValue)(value, type, { valueFormat: dateValueFormat });
454
- emitModel(dateVal);
455
- if (modelValue && dateVal ? import_xe_utils.default.toStringDate(modelValue).getTime() !== dateVal.getTime() : modelValue !== dateVal) {
456
- dispatchEvent("change", { value: dateVal }, evnt);
457
- if ($xeForm && formItemInfo) {
458
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, dateVal);
244
+ return transfer;
245
+ });
246
+ const computeFormReadonly = (0, import_vue.computed)(() => {
247
+ const { readonly } = props;
248
+ if (readonly === null) {
249
+ if ($xeForm) {
250
+ return $xeForm.props.readonly;
459
251
  }
252
+ return false;
460
253
  }
461
- } else {
462
- emitModel(value);
463
- if (import_xe_utils.default.toValueString(modelValue) !== value) {
464
- dispatchEvent("change", { value }, evnt);
465
- if ($xeForm && formItemInfo) {
466
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
254
+ return readonly;
255
+ });
256
+ const computeIsDisabled = (0, import_vue.computed)(() => {
257
+ const { disabled } = props;
258
+ if (disabled === null) {
259
+ if ($xeForm) {
260
+ return $xeForm.props.disabled;
467
261
  }
262
+ return false;
468
263
  }
469
- }
470
- };
471
- const inputEvent = (evnt) => {
472
- const inputElem = evnt.target;
473
- const value = inputElem.value;
474
- handleInputLabel(value, true);
475
- dispatchEvent("input", { value }, evnt);
476
- };
477
- const changeEvent = (evnt) => {
478
- const inpImmediate = computeInpImmediate.value;
479
- if (!inpImmediate) {
480
- triggerEvent(evnt);
481
- }
482
- };
483
- const clickPrefixEvent = (evnt) => {
484
- const isDisabled = computeIsDisabled.value;
485
- if (!isDisabled) {
486
- const { inputValue } = reactData;
487
- dispatchEvent("prefix-click", { value: inputValue }, evnt);
488
- }
489
- };
490
- const hidePanel = () => {
491
- return new Promise((resolve) => {
492
- reactData.visiblePanel = false;
493
- internalData.hpTimeout = setTimeout(() => {
494
- reactData.isAniVisible = false;
495
- resolve();
496
- }, 350);
264
+ return disabled;
497
265
  });
498
- };
499
- const dateChange = (date, isReload) => {
500
- const { modelValue, multiple } = props;
501
- const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
502
- const dateValueFormat = computeDateValueFormat.value;
503
- const firstDayOfWeek = computeFirstDayOfWeek.value;
504
- if (props.type === "week") {
505
- const sWeek = import_xe_utils.default.toNumber(props.selectDay);
506
- date = import_xe_utils.default.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
507
- }
508
- const inpVal = import_xe_utils.default.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek });
509
- if (multiple) {
510
- const overCount = computeOverCount.value;
511
- if (isTimeOrDateTimeType) {
512
- const dateListValue = isReload ? [] : [...computeDateListValue.value];
513
- const datetimeRest = [];
514
- const eqIndex = import_xe_utils.default.findIndexOf(dateListValue, (val) => import_xe_utils.default.isDateSame(date, val, "yyyyMMdd"));
515
- if (eqIndex === -1) {
516
- if (overCount) {
517
- return;
266
+ const computeIsTimeType = (0, import_vue.computed)(() => {
267
+ const { type } = props;
268
+ return type === "time";
269
+ });
270
+ const computeIsTimeOrDateTimeType = (0, import_vue.computed)(() => {
271
+ const { type } = props;
272
+ const isTimeType = computeIsTimeType.value;
273
+ return isTimeType || type === "datetime";
274
+ });
275
+ const computeIsDatePickerType = (0, import_vue.computed)(() => {
276
+ const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
277
+ return isTimeOrDateTimeType || ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
278
+ });
279
+ const computeIsClearable = (0, import_vue.computed)(() => {
280
+ return props.clearable;
281
+ });
282
+ const computeIsDatePanelType = (0, import_vue.computed)(() => {
283
+ const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
284
+ return isTimeOrDateTimeType || ["date", "week", "month", "quarter", "year"].indexOf(props.type) > -1;
285
+ });
286
+ const computeDateListValue = (0, import_vue.computed)(() => {
287
+ const { modelValue, type, multiple } = props;
288
+ const isDatePanelType = computeIsDatePanelType.value;
289
+ const dateValueFormat = computeDateValueFormat.value;
290
+ if (multiple && modelValue && isDatePanelType) {
291
+ return import_xe_utils.default.toValueString(modelValue).split(",").map((item) => {
292
+ const date = (0, import_util.parseDateValue)(item, type, {
293
+ valueFormat: dateValueFormat
294
+ });
295
+ if (import_xe_utils.default.isValidDate(date)) {
296
+ return date;
518
297
  }
519
- dateListValue.push(date);
298
+ return date;
299
+ });
300
+ }
301
+ return [];
302
+ });
303
+ const computeCurrStyle = (0, import_vue.computed)(() => {
304
+ const { width } = props;
305
+ const stys = {};
306
+ if (width) {
307
+ stys.width = (0, import_dom.toCssUnit)(width);
308
+ }
309
+ return stys;
310
+ });
311
+ const computeDateStartDate = (0, import_vue.computed)(() => {
312
+ return props.startDate ? import_xe_utils.default.toStringDate(props.startDate) : null;
313
+ });
314
+ const computeDateEndDate = (0, import_vue.computed)(() => {
315
+ return props.endDate ? import_xe_utils.default.toStringDate(props.endDate) : null;
316
+ });
317
+ const computeLimitMaxCount = (0, import_vue.computed)(() => {
318
+ return props.multiple ? import_xe_utils.default.toNumber(props.limitCount) : 0;
319
+ });
320
+ const computeDateMultipleValue = (0, import_vue.computed)(() => {
321
+ const dateListValue = computeDateListValue.value;
322
+ const dateValueFormat = computeDateValueFormat.value;
323
+ return dateListValue.map((date) => import_xe_utils.default.toDateString(date, dateValueFormat));
324
+ });
325
+ const computeOverCount = (0, import_vue.computed)(() => {
326
+ const { multiple } = props;
327
+ const limitMaxCount = computeLimitMaxCount.value;
328
+ const dateMultipleValue = computeDateMultipleValue.value;
329
+ if (multiple && limitMaxCount) {
330
+ return dateMultipleValue.length >= limitMaxCount;
331
+ }
332
+ return false;
333
+ });
334
+ const computeInputReadonly = (0, import_vue.computed)(() => {
335
+ const { type, editable, multiple } = props;
336
+ const formReadonly = computeFormReadonly.value;
337
+ return formReadonly || multiple || !editable || type === "week" || type === "quarter";
338
+ });
339
+ const computeInpPlaceholder = (0, import_vue.computed)(() => {
340
+ const { placeholder } = props;
341
+ if (placeholder) {
342
+ return (0, import_utils.getFuncText)(placeholder);
343
+ }
344
+ const globalPlaceholder = getConfig().datePicker.placeholder;
345
+ if (globalPlaceholder) {
346
+ return (0, import_utils.getFuncText)(globalPlaceholder);
347
+ }
348
+ return getI18n("vxe.base.pleaseSelect");
349
+ });
350
+ const computeInpImmediate = (0, import_vue.computed)(() => {
351
+ const { immediate } = props;
352
+ return immediate;
353
+ });
354
+ const computeTimeOpts = (0, import_vue.computed)(() => {
355
+ return Object.assign({}, getConfig().datePicker.timeConfig, props.timeConfig);
356
+ });
357
+ const computePopupOpts = (0, import_vue.computed)(() => {
358
+ return Object.assign({}, getConfig().datePicker.popupConfig, props.popupConfig);
359
+ });
360
+ const computeShortcutOpts = (0, import_vue.computed)(() => {
361
+ return Object.assign({}, getConfig().datePicker.shortcutConfig, props.shortcutConfig);
362
+ });
363
+ const computeShortcutList = (0, import_vue.computed)(() => {
364
+ const shortcutOpts = computeShortcutOpts.value;
365
+ const { options } = shortcutOpts;
366
+ if (options) {
367
+ return options.map((option, index) => {
368
+ return Object.assign(
369
+ {
370
+ name: `${option.name || option.code || index}`
371
+ },
372
+ option
373
+ );
374
+ });
375
+ }
376
+ return [];
377
+ });
378
+ const computeDateLabelFormat = (0, import_vue.computed)(() => {
379
+ const { labelFormat } = props;
380
+ return labelFormat || getI18n(`vxe.input.date.labelFormat.${props.type}`);
381
+ });
382
+ const computeDateValueFormat = (0, import_vue.computed)(() => {
383
+ const { type, valueFormat } = props;
384
+ return (0, import_util.handleValueFormat)(type, valueFormat);
385
+ });
386
+ const computeDateMaskedFormat = (0, import_vue.computed)(() => {
387
+ const dateLabelFormat = computeDateLabelFormat.value;
388
+ return dateLabelFormat;
389
+ });
390
+ const computeFirstDayOfWeek = (0, import_vue.computed)(() => {
391
+ const { startDay } = props;
392
+ return import_xe_utils.default.toNumber(startDay);
393
+ });
394
+ const computePanelLabel = (0, import_vue.computed)(() => {
395
+ const { type, multiple } = props;
396
+ const { inputValue } = reactData;
397
+ const dateLabelFormat = computeDateLabelFormat.value;
398
+ const dateValueFormat = computeDateValueFormat.value;
399
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
400
+ const vals = inputValue ? multiple ? inputValue.split(",") : [inputValue] : [];
401
+ return vals.map((val) => {
402
+ const dateObj = (0, import_util.parseDateObj)(val, type, {
403
+ valueFormat: dateValueFormat,
404
+ labelFormat: dateLabelFormat,
405
+ firstDay: firstDayOfWeek
406
+ });
407
+ return dateObj.label;
408
+ }).join(", ");
409
+ });
410
+ const computeMaskedOpts = (0, import_vue.computed)(() => {
411
+ return Object.assign({}, getConfig().datePicker.maskedConfig, props.maskedConfig);
412
+ });
413
+ const computeMaskChar = (0, import_vue.computed)(() => {
414
+ const maskedOpts = computeMaskedOpts.value;
415
+ const { maskPlaceholder } = maskedOpts;
416
+ return (maskPlaceholder ? ("" + maskPlaceholder)[0] : "") || defaultMaskPlaceholder;
417
+ });
418
+ const updateModelValue = () => {
419
+ const { modelValue } = props;
420
+ let val = "";
421
+ if (modelValue) {
422
+ if (import_xe_utils.default.isNumber(modelValue) && /^[0-9]{11,15}$/.test(`${modelValue}`)) {
423
+ val = new Date(modelValue);
520
424
  } else {
521
- dateListValue.splice(eqIndex, 1);
425
+ val = modelValue;
522
426
  }
523
- dateListValue.forEach((item) => {
524
- if (item) {
525
- datetimeRest.push(item);
427
+ }
428
+ reactData.inputValue = val;
429
+ };
430
+ const handleInputLabel = (text, isUpdate) => {
431
+ internalData.inputLabel = text;
432
+ if (isUpdate) {
433
+ reactData.labelFlag++;
434
+ }
435
+ };
436
+ const triggerEvent = (evnt) => {
437
+ const { inputValue } = reactData;
438
+ dispatchEvent(evnt.type, { value: inputValue }, evnt);
439
+ };
440
+ const handleChange = (value, evnt) => {
441
+ const { type, modelValue, valueFormat } = props;
442
+ const dateValueFormat = computeDateValueFormat.value;
443
+ reactData.inputValue = value;
444
+ if ((0, import_util.hasTimestampValueType)(valueFormat)) {
445
+ const dateVal = (0, import_util.parseDateValue)(value, type, { valueFormat: dateValueFormat });
446
+ const timeNum = dateVal ? dateVal.getTime() : null;
447
+ emitModel(timeNum);
448
+ if (modelValue !== timeNum) {
449
+ dispatchEvent("change", { value: timeNum }, evnt);
450
+ if ($xeForm && formItemInfo) {
451
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, timeNum);
526
452
  }
527
- });
528
- handleChange(datetimeRest.map((date2) => import_xe_utils.default.toDateString(date2, dateValueFormat)).join(","), { type: "update" });
453
+ }
454
+ } else if ((0, import_util.hasDateValueType)(valueFormat)) {
455
+ const dateVal = (0, import_util.parseDateValue)(value, type, { valueFormat: dateValueFormat });
456
+ emitModel(dateVal);
457
+ if (modelValue && dateVal ? import_xe_utils.default.toStringDate(modelValue).getTime() !== dateVal.getTime() : modelValue !== dateVal) {
458
+ dispatchEvent("change", { value: dateVal }, evnt);
459
+ if ($xeForm && formItemInfo) {
460
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, dateVal);
461
+ }
462
+ }
529
463
  } else {
530
- const dateMultipleValue = isReload ? [] : computeDateMultipleValue.value;
531
- if (dateMultipleValue.some((val) => import_xe_utils.default.isEqual(val, inpVal))) {
532
- handleChange(dateMultipleValue.filter((val) => !import_xe_utils.default.isEqual(val, inpVal)).join(","), { type: "update" });
533
- } else {
534
- if (overCount) {
535
- return;
464
+ emitModel(value);
465
+ if (import_xe_utils.default.toValueString(modelValue) !== value) {
466
+ dispatchEvent("change", { value }, evnt);
467
+ if ($xeForm && formItemInfo) {
468
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
536
469
  }
537
- handleChange(dateMultipleValue.concat([inpVal]).join(","), { type: "update" });
538
470
  }
539
471
  }
540
- } else {
541
- if (!import_xe_utils.default.isEqual(modelValue, inpVal)) {
542
- handleChange(inpVal, { type: "update" });
543
- }
544
- }
545
- };
546
- const dateRevert = () => {
547
- const panelLabel = computePanelLabel.value;
548
- handleInputLabel(panelLabel, true);
549
- };
550
- const afterCheckValue = (inpVal) => {
551
- const { type, editable, multiple, maskedConfig } = props;
552
- const { inputLabel } = internalData;
553
- const dateLabelFormat = computeDateLabelFormat.value;
554
- const maskedOpts = computeMaskedOpts.value;
555
- const dateStartDate = computeDateStartDate.value;
556
- const dateEndDate = computeDateEndDate.value;
557
- const parseInpMethod = props.parseInputMethod || defaultFuncProps.parseInputMethod;
558
- if (!inpVal) {
559
- handleChange("", { type: "check" });
560
- return;
561
- }
562
- if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
563
- const allMaskedKeys = dateLabelFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g"));
564
- if (allMaskedKeys) {
565
- allMaskedKeys.forEach((formatKey) => {
566
- const fkIndex = dateLabelFormat.indexOf(formatKey);
567
- if (fkIndex > -1) {
568
- const valStr = inpVal.slice(fkIndex, fkIndex + formatKey.length).replace(/\D/g, "");
569
- if (!valStr) {
472
+ };
473
+ const inputEvent = (evnt) => {
474
+ const inputElem = evnt.target;
475
+ const value = inputElem.value;
476
+ handleInputLabel(value, true);
477
+ dispatchEvent("input", { value }, evnt);
478
+ };
479
+ const changeEvent = (evnt) => {
480
+ const inpImmediate = computeInpImmediate.value;
481
+ if (!inpImmediate) {
482
+ triggerEvent(evnt);
483
+ }
484
+ };
485
+ const clickPrefixEvent = (evnt) => {
486
+ const isDisabled = computeIsDisabled.value;
487
+ if (!isDisabled) {
488
+ const { inputValue } = reactData;
489
+ dispatchEvent("prefix-click", { value: inputValue }, evnt);
490
+ }
491
+ };
492
+ const hidePanel = () => {
493
+ return new Promise((resolve) => {
494
+ reactData.visiblePanel = false;
495
+ internalData.hpTimeout = setTimeout(() => {
496
+ reactData.isAniVisible = false;
497
+ resolve();
498
+ }, 350);
499
+ });
500
+ };
501
+ const dateChange = (date, isReload) => {
502
+ const { modelValue, multiple } = props;
503
+ const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
504
+ const dateValueFormat = computeDateValueFormat.value;
505
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
506
+ if (props.type === "week") {
507
+ const sWeek = import_xe_utils.default.toNumber(props.selectDay);
508
+ date = import_xe_utils.default.getWhatWeek(date, 0, sWeek, firstDayOfWeek);
509
+ }
510
+ const inpVal = import_xe_utils.default.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek });
511
+ if (multiple) {
512
+ const overCount = computeOverCount.value;
513
+ if (isTimeOrDateTimeType) {
514
+ const dateListValue = isReload ? [] : [...computeDateListValue.value];
515
+ const datetimeRest = [];
516
+ const eqIndex = import_xe_utils.default.findIndexOf(dateListValue, (val) => import_xe_utils.default.isDateSame(date, val, "yyyyMMdd"));
517
+ if (eqIndex === -1) {
518
+ if (overCount) {
570
519
  return;
571
520
  }
572
- let valNum = import_xe_utils.default.toNumber(valStr);
573
- if (!valNum && ["MM", "dd"].includes(formatKey)) {
574
- valNum = 1;
521
+ dateListValue.push(date);
522
+ } else {
523
+ dateListValue.splice(eqIndex, 1);
524
+ }
525
+ dateListValue.forEach((item) => {
526
+ if (item) {
527
+ datetimeRest.push(item);
528
+ }
529
+ });
530
+ handleChange(datetimeRest.map((date2) => import_xe_utils.default.toDateString(date2, dateValueFormat)).join(","), { type: "update" });
531
+ } else {
532
+ const dateMultipleValue = isReload ? [] : computeDateMultipleValue.value;
533
+ if (dateMultipleValue.some((val) => import_xe_utils.default.isEqual(val, inpVal))) {
534
+ handleChange(dateMultipleValue.filter((val) => !import_xe_utils.default.isEqual(val, inpVal)).join(","), { type: "update" });
535
+ } else {
536
+ if (overCount) {
537
+ return;
575
538
  }
576
- inpVal = inpVal.slice(0, fkIndex) + import_xe_utils.default.padStart((0, import_util.checkDateInputFormat)(valNum, formatKey), formatKey.length, "0") + inpVal.slice(fkIndex + formatKey.length);
539
+ handleChange(dateMultipleValue.concat([inpVal]).join(","), { type: "update" });
577
540
  }
541
+ }
542
+ } else {
543
+ if (!import_xe_utils.default.isEqual(modelValue, inpVal)) {
544
+ handleChange(inpVal, { type: "update" });
545
+ }
546
+ }
547
+ };
548
+ const dateRevert = () => {
549
+ const panelLabel = computePanelLabel.value;
550
+ handleInputLabel(panelLabel, true);
551
+ };
552
+ const afterCheckValue = (inpVal) => {
553
+ const { type, editable, multiple, maskedConfig } = props;
554
+ const { inputLabel } = internalData;
555
+ const dateLabelFormat = computeDateLabelFormat.value;
556
+ const maskedOpts = computeMaskedOpts.value;
557
+ const dateStartDate = computeDateStartDate.value;
558
+ const dateEndDate = computeDateEndDate.value;
559
+ const parseInpMethod = props.parseInputMethod || defaultFuncProps.parseInputMethod;
560
+ if (!inpVal) {
561
+ handleChange("", { type: "check" });
562
+ return;
563
+ }
564
+ if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
565
+ const allMaskedKeys = dateLabelFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g"));
566
+ if (allMaskedKeys) {
567
+ allMaskedKeys.forEach((formatKey) => {
568
+ const fkIndex = dateLabelFormat.indexOf(formatKey);
569
+ if (fkIndex > -1) {
570
+ const valStr = inpVal.slice(fkIndex, fkIndex + formatKey.length).replace(/\D/g, "");
571
+ if (!valStr) {
572
+ return;
573
+ }
574
+ let valNum = import_xe_utils.default.toNumber(valStr);
575
+ if (!valNum && ["MM", "dd"].includes(formatKey)) {
576
+ valNum = 1;
577
+ }
578
+ inpVal = inpVal.slice(0, fkIndex) + import_xe_utils.default.padStart((0, import_util.checkDateInputFormat)(valNum, formatKey), formatKey.length, "0") + inpVal.slice(fkIndex + formatKey.length);
579
+ }
580
+ });
581
+ }
582
+ }
583
+ let inpDateVal;
584
+ if (parseInpMethod) {
585
+ inpDateVal = parseInpMethod({
586
+ $datePicker: $xeDatePicker,
587
+ type,
588
+ inputValue: inpVal,
589
+ valueFormat: dateLabelFormat
590
+ }) || null;
591
+ } else {
592
+ const $datePanel = refDatePanel.value;
593
+ if ($datePanel) {
594
+ return $datePanel.checkValue(inpVal);
595
+ }
596
+ inpDateVal = (0, import_util.parseDateValue)(inpVal, type, {
597
+ valueFormat: dateLabelFormat
578
598
  });
579
599
  }
580
- }
581
- let inpDateVal;
582
- if (parseInpMethod) {
583
- inpDateVal = parseInpMethod({
584
- $datePicker: $xeDatePicker,
585
- type,
586
- inputValue: inpVal,
587
- valueFormat: dateLabelFormat
588
- }) || null;
589
- } else {
590
- const $datePanel = refDatePanel.value;
591
- if ($datePanel) {
592
- return $datePanel.checkValue(inpVal);
600
+ if (!import_xe_utils.default.isValidDate(inpDateVal)) {
601
+ dateRevert();
602
+ return;
593
603
  }
594
- inpDateVal = (0, import_util.parseDateValue)(inpVal, type, {
595
- valueFormat: dateLabelFormat
596
- });
597
- }
598
- if (!import_xe_utils.default.isValidDate(inpDateVal)) {
599
- dateRevert();
600
- return;
601
- }
602
- if (type === "time") {
603
- const timeVal = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat);
604
- if (inputLabel !== timeVal) {
605
- handleChange(inpDateVal, { type: "check" });
606
- }
607
- handleInputLabel(timeVal, true);
608
- return;
609
- }
610
- if (dateEndDate && inpDateVal > dateEndDate) {
611
- inpDateVal = dateEndDate;
612
- }
613
- if (dateStartDate && inpDateVal < dateStartDate) {
614
- inpDateVal = dateStartDate;
615
- }
616
- let isChange = false;
617
- const firstDayOfWeek = computeFirstDayOfWeek.value;
618
- if (type === "datetime") {
619
- const dateValue = reactData.inputValue;
620
- if (inpVal !== import_xe_utils.default.toDateString(dateValue, dateLabelFormat) || inpVal !== import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat)) {
604
+ if (type === "time") {
605
+ const timeVal = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat);
606
+ if (inputLabel !== timeVal) {
607
+ handleChange(inpDateVal, { type: "check" });
608
+ }
609
+ handleInputLabel(timeVal, true);
610
+ return;
611
+ }
612
+ if (dateEndDate && inpDateVal > dateEndDate) {
613
+ inpDateVal = dateEndDate;
614
+ }
615
+ if (dateStartDate && inpDateVal < dateStartDate) {
616
+ inpDateVal = dateStartDate;
617
+ }
618
+ let isChange = false;
619
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
620
+ if (type === "datetime") {
621
+ const dateValue = reactData.inputValue;
622
+ if (inpVal !== import_xe_utils.default.toDateString(dateValue, dateLabelFormat) || inpVal !== import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat)) {
623
+ isChange = true;
624
+ }
625
+ } else {
621
626
  isChange = true;
622
627
  }
623
- } else {
624
- isChange = true;
625
- }
626
- const label = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat, { firstDay: firstDayOfWeek });
627
- handleInputLabel(label, true);
628
- if (isChange) {
629
- dateChange(inpDateVal);
630
- }
631
- };
632
- const clearValueEvent = (evnt, value) => {
633
- const isDatePickerType = computeIsDatePickerType.value;
634
- if (isDatePickerType) {
635
- hidePanel();
636
- }
637
- handleChange("", evnt);
638
- dispatchEvent("clear", { value }, evnt);
639
- };
640
- const clickSuffixEvent = (evnt) => {
641
- const isDisabled = computeIsDisabled.value;
642
- if (!isDisabled) {
643
- const { inputValue } = reactData;
644
- dispatchEvent("suffix-click", { value: inputValue }, evnt);
645
- }
646
- };
647
- const checkMaskedInputValue = (numStr, chunkFormat, isFull) => {
648
- const maskedOpts = computeMaskedOpts.value;
649
- const { align } = maskedOpts;
650
- const maskChar = computeMaskChar.value;
651
- const numVal = import_xe_utils.default.toNumber(numStr);
652
- let restVal = (0, import_util.checkDateInputFormat)(numVal, chunkFormat);
653
- if (isFull) {
654
- if (!restVal && ["MM", "dd"].includes(chunkFormat)) {
655
- restVal = 1;
656
- }
657
- }
658
- let restStr = "" + restVal;
659
- if (numStr.length > restStr.length) {
660
- restStr = restStr.padStart(numStr.length, "0");
661
- }
662
- if (isFull) {
663
- return import_xe_utils.default.padStart(restStr, chunkFormat.length, "0");
664
- }
665
- return import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](restStr, chunkFormat.length, maskChar);
666
- };
667
- const handleArrowInputDate = (evnt, isUpArrow, isDwArrow, isLtArrow, isRtArrow) => {
668
- const { type, multiple } = props;
669
- if (multiple) {
670
- return;
671
- }
672
- const targetElem = refInputTarget.value;
673
- if (!targetElem) {
674
- return;
675
- }
676
- const inpValue = targetElem.value;
677
- if (!inpValue) {
678
- return;
679
- }
680
- const dateMaskedFormat = computeDateMaskedFormat.value;
681
- const dateLabelFormat = computeDateLabelFormat.value;
682
- const firstDayOfWeek = computeFirstDayOfWeek.value;
683
- const maskChar = computeMaskChar.value;
684
- const selectionStart = targetElem.selectionStart || 0;
685
- let selectKey = dateMaskedFormat[selectionStart];
686
- if (!parseInputKayMaps[selectKey]) {
687
- selectKey = dateMaskedFormat[selectionStart - 1];
688
- }
689
- const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
690
- if (!skRest) {
691
- return;
692
- }
693
- if (isUpArrow || isDwArrow) {
628
+ const label = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat, { firstDay: firstDayOfWeek });
629
+ handleInputLabel(label, true);
630
+ if (isChange) {
631
+ dateChange(inpDateVal);
632
+ }
633
+ };
634
+ const clearValueEvent = (evnt, value) => {
635
+ const isDatePickerType = computeIsDatePickerType.value;
636
+ if (isDatePickerType) {
637
+ hidePanel();
638
+ }
639
+ handleChange("", evnt);
640
+ dispatchEvent("clear", { value }, evnt);
641
+ };
642
+ const clickSuffixEvent = (evnt) => {
643
+ const isDisabled = computeIsDisabled.value;
644
+ if (!isDisabled) {
645
+ const { inputValue } = reactData;
646
+ dispatchEvent("suffix-click", { value: inputValue }, evnt);
647
+ }
648
+ };
649
+ const checkMaskedInputValue = (numStr, chunkFormat, isFull) => {
650
+ const maskedOpts = computeMaskedOpts.value;
651
+ const { align } = maskedOpts;
652
+ const maskChar = computeMaskChar.value;
653
+ const numVal = import_xe_utils.default.toNumber(numStr);
654
+ let restVal = (0, import_util.checkDateInputFormat)(numVal, chunkFormat);
655
+ if (isFull) {
656
+ if (!restVal && ["MM", "dd"].includes(chunkFormat)) {
657
+ restVal = 1;
658
+ }
659
+ }
660
+ let restStr = "" + restVal;
661
+ if (numStr.length > restStr.length) {
662
+ restStr = restStr.padStart(numStr.length, "0");
663
+ }
664
+ if (isFull) {
665
+ return import_xe_utils.default.padStart(restStr, chunkFormat.length, "0");
666
+ }
667
+ return import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](restStr, chunkFormat.length, maskChar);
668
+ };
669
+ const handleArrowInputDate = (evnt, isUpArrow, isDwArrow, isLtArrow, isRtArrow) => {
670
+ const { type, multiple } = props;
671
+ if (multiple) {
672
+ return;
673
+ }
674
+ const targetElem = refInputTarget.value;
675
+ if (!targetElem) {
676
+ return;
677
+ }
678
+ const inpValue = targetElem.value;
679
+ if (!inpValue) {
680
+ return;
681
+ }
682
+ const dateMaskedFormat = computeDateMaskedFormat.value;
683
+ const dateLabelFormat = computeDateLabelFormat.value;
684
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
685
+ const maskChar = computeMaskChar.value;
686
+ const selectionStart = targetElem.selectionStart || 0;
687
+ let selectKey = dateMaskedFormat[selectionStart];
688
+ if (!parseInputKayMaps[selectKey]) {
689
+ selectKey = dateMaskedFormat[selectionStart - 1];
690
+ }
691
+ const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
692
+ if (!skRest) {
693
+ return;
694
+ }
695
+ if (isUpArrow || isDwArrow) {
696
+ const chunkFormat = skRest[0] || "";
697
+ const chunkStartIndex = skRest.index || 0;
698
+ const chunkEndIndex = chunkStartIndex + chunkFormat.length;
699
+ const chunkValue = inpValue.slice(chunkStartIndex, chunkEndIndex);
700
+ if (parseInputKayMaps[selectKey]) {
701
+ const chunkNum = ((0, import_util.isAllSameChar)(chunkValue, maskChar) ? (0, import_util.getChunkDefaultNum)(selectKey) : import_xe_utils.default.toNumber(chunkValue)) + (isUpArrow ? 1 : -1);
702
+ const restValue = inpValue.slice(0, chunkStartIndex) + checkMaskedInputValue("" + chunkNum, chunkFormat, true) + inpValue.slice(chunkEndIndex);
703
+ evnt.preventDefault();
704
+ if (restValue.indexOf(maskChar) === -1) {
705
+ const inpDateVal = (0, import_util.parseDateValue)(restValue, type, {
706
+ valueFormat: dateLabelFormat
707
+ });
708
+ if (import_xe_utils.default.isValidDate(inpDateVal)) {
709
+ const label = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat, { firstDay: firstDayOfWeek });
710
+ targetElem.value = label;
711
+ handleInputLabel(label, false);
712
+ }
713
+ } else {
714
+ targetElem.value = restValue;
715
+ handleInputLabel(restValue, false);
716
+ }
717
+ }
718
+ targetElem.setSelectionRange(chunkStartIndex, chunkEndIndex);
719
+ } else if (isLtArrow || isRtArrow) {
720
+ const currKeyIndex = inputMaskedKeys.indexOf(selectKey);
721
+ if (currKeyIndex > -1) {
722
+ const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
723
+ const currIndex = import_xe_utils.default.findIndexOf(allMaskedKeys, (key) => selectKey === key[0]);
724
+ const targetFormatKey = isLtArrow ? allMaskedKeys[currIndex - 1] || allMaskedKeys[0] : allMaskedKeys[currIndex + 1] || allMaskedKeys[allMaskedKeys.length - 1];
725
+ const targetKey = targetFormatKey ? targetFormatKey[0] : "";
726
+ const sktRest = dateMaskedFormat.match(new RegExp(targetKey + "+"));
727
+ if (sktRest) {
728
+ evnt.preventDefault();
729
+ const mtStartIndex = sktRest.index || 0;
730
+ const mtEndIndex = mtStartIndex + sktRest[0].length;
731
+ targetElem.setSelectionRange(mtStartIndex, mtEndIndex);
732
+ }
733
+ }
734
+ }
735
+ internalData.isTriggerMasked = true;
736
+ };
737
+ const handleMaskedInputDate = (evnt) => {
738
+ const { multiple } = props;
739
+ if (multiple) {
740
+ return;
741
+ }
742
+ const targetElem = refInputTarget.value;
743
+ if (!targetElem) {
744
+ return;
745
+ }
746
+ const isControlKey = (0, import_dom.hasControlKey)(evnt);
747
+ if (isControlKey) {
748
+ return;
749
+ }
750
+ evnt.preventDefault();
751
+ const eKey = evnt.key;
752
+ const isDeleleKey = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.DELETE);
753
+ const isBackspaceKey = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.BACKSPACE);
754
+ const isNumKey = eKey >= "0" && eKey <= "9";
755
+ const numKey = isNumKey ? evnt.key : "";
756
+ if (!(isDeleleKey || isBackspaceKey || isNumKey)) {
757
+ return;
758
+ }
759
+ const { isTriggerMasked } = internalData;
760
+ const maskedOpts = computeMaskedOpts.value;
761
+ const { align } = maskedOpts;
762
+ const dateMaskedFormat = computeDateMaskedFormat.value;
763
+ const maskChar = computeMaskChar.value;
764
+ let inpValue = targetElem.value || dateMaskedFormat;
765
+ const selectionStart = targetElem.selectionStart || 0;
766
+ const selectionEnd = targetElem.selectionEnd || 0;
767
+ let selectKey = dateMaskedFormat[selectionStart];
768
+ if (!parseInputKayMaps[selectKey]) {
769
+ selectKey = dateMaskedFormat[selectionStart - 1];
770
+ }
771
+ const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
772
+ if (!skRest) {
773
+ return;
774
+ }
775
+ const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
694
776
  const chunkFormat = skRest[0] || "";
695
777
  const chunkStartIndex = skRest.index || 0;
696
778
  const chunkEndIndex = chunkStartIndex + chunkFormat.length;
697
- const chunkValue = inpValue.slice(chunkStartIndex, chunkEndIndex);
698
- if (parseInputKayMaps[selectKey]) {
699
- const chunkNum = ((0, import_util.isAllSameChar)(chunkValue, maskChar) ? (0, import_util.getChunkDefaultNum)(selectKey) : import_xe_utils.default.toNumber(chunkValue)) + (isUpArrow ? 1 : -1);
700
- const restValue = inpValue.slice(0, chunkStartIndex) + checkMaskedInputValue("" + chunkNum, chunkFormat, true) + inpValue.slice(chunkEndIndex);
701
- evnt.preventDefault();
702
- if (restValue.indexOf(maskChar) === -1) {
703
- const inpDateVal = (0, import_util.parseDateValue)(restValue, type, {
704
- valueFormat: dateLabelFormat
705
- });
706
- if (import_xe_utils.default.isValidDate(inpDateVal)) {
707
- const label = import_xe_utils.default.toDateString(inpDateVal, dateLabelFormat, { firstDay: firstDayOfWeek });
708
- targetElem.value = label;
709
- handleInputLabel(label, false);
779
+ const currKeyIndex = allMaskedKeys.indexOf(selectKey);
780
+ const isAllSelected = !selectionStart && selectionEnd === inpValue.length && allMaskedKeys.length > 1;
781
+ const isNotMasked = inpValue && inpValue.length !== dateMaskedFormat.length;
782
+ if (isAllSelected || isNotMasked) {
783
+ inpValue = dateMaskedFormat;
784
+ }
785
+ let chunkValue = isDeleleKey ? "" : inpValue.slice(chunkStartIndex, chunkEndIndex);
786
+ const chunkNums = chunkValue.match(/\d/g) || [];
787
+ const chunkNumList = isTriggerMasked && !isBackspaceKey ? [] : chunkNums.slice(0);
788
+ if (isNumKey) {
789
+ chunkNumList.push(numKey);
790
+ chunkValue = checkMaskedInputValue(chunkNumList.join(""), chunkFormat, false);
791
+ } else if (isBackspaceKey) {
792
+ chunkNumList.pop();
793
+ chunkValue = import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](chunkNumList.join(""), chunkFormat.length, maskChar);
794
+ }
795
+ let restValue = inpValue.slice(0, chunkStartIndex) + chunkValue + inpValue.slice(chunkEndIndex);
796
+ restValue = restValue.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
797
+ targetElem.value = restValue;
798
+ handleInputLabel(restValue, false);
799
+ if (isAllSelected) {
800
+ if (isBackspaceKey || isDeleleKey) {
801
+ const firstMaskedKeys = allMaskedKeys[0];
802
+ const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
803
+ if (firstSkRest) {
804
+ const firstChunkFormat = firstSkRest[0];
805
+ targetElem.setSelectionRange(0, firstChunkFormat.length);
806
+ internalData.isTriggerMasked = true;
807
+ return;
710
808
  }
711
- } else {
712
- targetElem.value = restValue;
713
- handleInputLabel(restValue, false);
809
+ }
810
+ } else {
811
+ if (isBackspaceKey && !chunkNums.length) {
812
+ for (let i = currKeyIndex - 1; i >= 0; i--) {
813
+ const prveChunkKey = allMaskedKeys[i];
814
+ const prveSkRest = dateMaskedFormat.match(new RegExp(`${prveChunkKey}+`));
815
+ if (prveSkRest) {
816
+ const prveChunkFormat = prveSkRest[0];
817
+ const prveChunkStartIndex = prveSkRest.index || 0;
818
+ const prveChunkEndIndex = prveChunkStartIndex + prveChunkFormat.length;
819
+ let prveChunkValue = restValue.slice(prveChunkStartIndex, prveChunkEndIndex);
820
+ const prveChunkNums = prveChunkValue.match(/\d/g) || [];
821
+ if (prveChunkNums.length) {
822
+ prveChunkNums.pop();
823
+ prveChunkValue = import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](prveChunkNums.join(""), prveChunkFormat.length, maskChar);
824
+ restValue = restValue.slice(0, prveChunkStartIndex) + prveChunkValue + restValue.slice(prveChunkEndIndex);
825
+ targetElem.value = restValue;
826
+ handleInputLabel(restValue, false);
827
+ targetElem.setSelectionRange(prveChunkStartIndex, prveChunkEndIndex);
828
+ return;
829
+ }
830
+ }
831
+ }
832
+ const firstMaskedKeys = allMaskedKeys[0];
833
+ const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
834
+ if (firstSkRest) {
835
+ const firstChunkFormat = firstSkRest[0];
836
+ restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
837
+ targetElem.value = restValue;
838
+ handleInputLabel(restValue, false);
839
+ targetElem.setSelectionRange(0, firstChunkFormat.length);
840
+ internalData.isTriggerMasked = true;
841
+ return;
842
+ }
843
+ return;
714
844
  }
715
845
  }
716
- targetElem.setSelectionRange(chunkStartIndex, chunkEndIndex);
717
- } else if (isLtArrow || isRtArrow) {
718
- const currKeyIndex = inputMaskedKeys.indexOf(selectKey);
719
- if (currKeyIndex > -1) {
720
- const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
721
- const currIndex = import_xe_utils.default.findIndexOf(allMaskedKeys, (key) => selectKey === key[0]);
722
- const targetFormatKey = isLtArrow ? allMaskedKeys[currIndex - 1] || allMaskedKeys[0] : allMaskedKeys[currIndex + 1] || allMaskedKeys[allMaskedKeys.length - 1];
723
- const targetKey = targetFormatKey ? targetFormatKey[0] : "";
724
- const sktRest = dateMaskedFormat.match(new RegExp(targetKey + "+"));
725
- if (sktRest) {
726
- evnt.preventDefault();
727
- const mtStartIndex = sktRest.index || 0;
728
- const mtEndIndex = mtStartIndex + sktRest[0].length;
729
- targetElem.setSelectionRange(mtStartIndex, mtEndIndex);
846
+ let maskStartIndex = skRest.index || 0;
847
+ let maskEndIndex = maskStartIndex + skRest[0].length;
848
+ if (chunkNumList.length >= chunkValue.length) {
849
+ const nextKeys = allMaskedKeys.slice(currKeyIndex + 1);
850
+ if (currKeyIndex > -1) {
851
+ const nextRest = nextKeys.length ? dateMaskedFormat.match(new RegExp(`(${nextKeys.join("|")})+`)) : null;
852
+ if (nextRest) {
853
+ maskStartIndex = nextRest.index || 0;
854
+ maskEndIndex = maskStartIndex + nextRest[0].length;
855
+ targetElem.setSelectionRange(maskStartIndex, maskEndIndex);
856
+ } else {
857
+ targetElem.setSelectionRange(maskStartIndex, maskEndIndex);
858
+ }
730
859
  }
860
+ internalData.isTriggerMasked = true;
861
+ return;
862
+ }
863
+ targetElem.setSelectionRange(maskStartIndex, maskEndIndex);
864
+ internalData.isTriggerMasked = false;
865
+ };
866
+ const handleMaskedSelectedDate = (evnt, isFocus) => {
867
+ internalData.fsTimeout = void 0;
868
+ const { type, multiple, modelValue } = props;
869
+ if (multiple) {
870
+ return;
871
+ }
872
+ if (!maskedTypes.includes(type)) {
873
+ return;
731
874
  }
732
- }
733
- internalData.isTriggerMasked = true;
734
- };
735
- const handleMaskedInputDate = (evnt) => {
736
- const { multiple } = props;
737
- if (multiple) {
738
- return;
739
- }
740
- const targetElem = refInputTarget.value;
741
- if (!targetElem) {
742
- return;
743
- }
744
- const isControlKey = (0, import_dom.hasControlKey)(evnt);
745
- if (isControlKey) {
746
- return;
747
- }
748
- evnt.preventDefault();
749
- const eKey = evnt.key;
750
- const isDeleleKey = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.DELETE);
751
- const isBackspaceKey = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.BACKSPACE);
752
- const isNumKey = eKey >= "0" && eKey <= "9";
753
- const numKey = isNumKey ? evnt.key : "";
754
- if (!(isDeleleKey || isBackspaceKey || isNumKey)) {
755
- return;
756
- }
757
- const { isTriggerMasked } = internalData;
758
- const maskedOpts = computeMaskedOpts.value;
759
- const { align } = maskedOpts;
760
- const dateMaskedFormat = computeDateMaskedFormat.value;
761
- const maskChar = computeMaskChar.value;
762
- let inpValue = targetElem.value || dateMaskedFormat;
763
- const selectionStart = targetElem.selectionStart || 0;
764
- const selectionEnd = targetElem.selectionEnd || 0;
765
- let selectKey = dateMaskedFormat[selectionStart];
766
- if (!parseInputKayMaps[selectKey]) {
767
- selectKey = dateMaskedFormat[selectionStart - 1];
768
- }
769
- const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
770
- if (!skRest) {
771
- return;
772
- }
773
- const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
774
- const chunkFormat = skRest[0] || "";
775
- const chunkStartIndex = skRest.index || 0;
776
- const chunkEndIndex = chunkStartIndex + chunkFormat.length;
777
- const currKeyIndex = allMaskedKeys.indexOf(selectKey);
778
- const isAllSelected = !selectionStart && selectionEnd === inpValue.length && allMaskedKeys.length > 1;
779
- const isNotMasked = inpValue && inpValue.length !== dateMaskedFormat.length;
780
- if (isAllSelected || isNotMasked) {
781
- inpValue = dateMaskedFormat;
782
- }
783
- let chunkValue = isDeleleKey ? "" : inpValue.slice(chunkStartIndex, chunkEndIndex);
784
- const chunkNums = chunkValue.match(/\d/g) || [];
785
- const chunkNumList = isTriggerMasked && !isBackspaceKey ? [] : chunkNums.slice(0);
786
- if (isNumKey) {
787
- chunkNumList.push(numKey);
788
- chunkValue = checkMaskedInputValue(chunkNumList.join(""), chunkFormat, false);
789
- } else if (isBackspaceKey) {
790
- chunkNumList.pop();
791
- chunkValue = import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](chunkNumList.join(""), chunkFormat.length, maskChar);
792
- }
793
- let restValue = inpValue.slice(0, chunkStartIndex) + chunkValue + inpValue.slice(chunkEndIndex);
794
- restValue = restValue.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
795
- targetElem.value = restValue;
796
- handleInputLabel(restValue, false);
797
- if (isAllSelected) {
798
- if (isBackspaceKey || isDeleleKey) {
875
+ const targetElem = refInputTarget.value;
876
+ if (!targetElem) {
877
+ return;
878
+ }
879
+ const { laseFocusMasked } = internalData;
880
+ if (laseFocusMasked && Date.now() - laseFocusMasked < 100) {
881
+ return;
882
+ }
883
+ const dateMaskedFormat = computeDateMaskedFormat.value;
884
+ const maskChar = computeMaskChar.value;
885
+ const selectionStart = targetElem.selectionStart || 0;
886
+ const selectionEnd = targetElem.selectionEnd || 0;
887
+ const inpValue = targetElem.value;
888
+ const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
889
+ if (!inpValue) {
890
+ let restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
891
+ if (isFocus && modelValue) {
892
+ const chunkNums = ("" + import_xe_utils.default.toNumber(modelValue)).match(/\d/g) || [];
893
+ let useNumIndex = 0;
894
+ restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), (txt) => chunkNums[useNumIndex++] || txt);
895
+ }
799
896
  const firstMaskedKeys = allMaskedKeys[0];
800
897
  const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
801
898
  if (firstSkRest) {
899
+ evnt.preventDefault();
802
900
  const firstChunkFormat = firstSkRest[0];
901
+ targetElem.value = restValue;
902
+ handleInputLabel(restValue, false);
803
903
  targetElem.setSelectionRange(0, firstChunkFormat.length);
804
- internalData.isTriggerMasked = true;
904
+ internalData.laseFocusMasked = Date.now();
805
905
  return;
806
906
  }
807
907
  }
808
- } else {
809
- if (isBackspaceKey && !chunkNums.length) {
810
- for (let i = currKeyIndex - 1; i >= 0; i--) {
811
- const prveChunkKey = allMaskedKeys[i];
812
- const prveSkRest = dateMaskedFormat.match(new RegExp(`${prveChunkKey}+`));
813
- if (prveSkRest) {
814
- const prveChunkFormat = prveSkRest[0];
815
- const prveChunkStartIndex = prveSkRest.index || 0;
816
- const prveChunkEndIndex = prveChunkStartIndex + prveChunkFormat.length;
817
- let prveChunkValue = restValue.slice(prveChunkStartIndex, prveChunkEndIndex);
818
- const prveChunkNums = prveChunkValue.match(/\d/g) || [];
819
- if (prveChunkNums.length) {
820
- prveChunkNums.pop();
821
- prveChunkValue = import_xe_utils.default[align === "right" ? "padStart" : "padEnd"](prveChunkNums.join(""), prveChunkFormat.length, maskChar);
822
- restValue = restValue.slice(0, prveChunkStartIndex) + prveChunkValue + restValue.slice(prveChunkEndIndex);
823
- targetElem.value = restValue;
824
- handleInputLabel(restValue, false);
825
- targetElem.setSelectionRange(prveChunkStartIndex, prveChunkEndIndex);
826
- return;
827
- }
828
- }
908
+ const isAllSelected = !selectionStart && selectionEnd === inpValue.length && allMaskedKeys.length > 1;
909
+ const isNotMasked = inpValue && inpValue.length !== dateMaskedFormat.length;
910
+ if (isAllSelected || isNotMasked) {
911
+ let restValue = "";
912
+ if (isNotMasked && inpValue) {
913
+ const chunkNums = inpValue.match(/\d/g) || [];
914
+ let useNumIndex = 0;
915
+ restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), () => chunkNums[useNumIndex++] || maskChar);
916
+ } else {
917
+ dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
829
918
  }
830
919
  const firstMaskedKeys = allMaskedKeys[0];
831
920
  const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
832
921
  if (firstSkRest) {
922
+ evnt.preventDefault();
833
923
  const firstChunkFormat = firstSkRest[0];
834
- restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
835
924
  targetElem.value = restValue;
836
925
  handleInputLabel(restValue, false);
837
926
  targetElem.setSelectionRange(0, firstChunkFormat.length);
838
- internalData.isTriggerMasked = true;
927
+ internalData.laseFocusMasked = Date.now();
839
928
  return;
840
929
  }
841
- return;
842
930
  }
843
- }
844
- let maskStartIndex = skRest.index || 0;
845
- let maskEndIndex = maskStartIndex + skRest[0].length;
846
- if (chunkNumList.length >= chunkValue.length) {
847
- const nextKeys = allMaskedKeys.slice(currKeyIndex + 1);
848
- if (currKeyIndex > -1) {
849
- const nextRest = nextKeys.length ? dateMaskedFormat.match(new RegExp(`(${nextKeys.join("|")})+`)) : null;
850
- if (nextRest) {
851
- maskStartIndex = nextRest.index || 0;
852
- maskEndIndex = maskStartIndex + nextRest[0].length;
853
- targetElem.setSelectionRange(maskStartIndex, maskEndIndex);
854
- } else {
855
- targetElem.setSelectionRange(maskStartIndex, maskEndIndex);
931
+ let selectKey = dateMaskedFormat[selectionStart];
932
+ if (!parseInputKayMaps[selectKey]) {
933
+ selectKey = dateMaskedFormat[selectionStart - 1];
934
+ }
935
+ if (selectKey) {
936
+ evnt.stopPropagation();
937
+ const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
938
+ if (skRest) {
939
+ const chunkFormat = skRest[0] || "";
940
+ const chunkStartIndex = skRest.index || 0;
941
+ const chunkEndIndex = chunkStartIndex + chunkFormat.length;
942
+ targetElem.setSelectionRange(chunkStartIndex, chunkEndIndex);
943
+ internalData.isTriggerMasked = true;
944
+ internalData.laseFocusMasked = Date.now();
856
945
  }
857
946
  }
858
- internalData.isTriggerMasked = true;
859
- return;
860
- }
861
- targetElem.setSelectionRange(maskStartIndex, maskEndIndex);
862
- internalData.isTriggerMasked = false;
863
- };
864
- const handleMaskedSelectedDate = (evnt, isFocus) => {
865
- internalData.fsTimeout = void 0;
866
- const { type, multiple, modelValue } = props;
867
- if (multiple) {
868
- return;
869
- }
870
- if (!maskedTypes.includes(type)) {
871
- return;
872
- }
873
- const targetElem = refInputTarget.value;
874
- if (!targetElem) {
875
- return;
876
- }
877
- const { laseFocusMasked } = internalData;
878
- if (laseFocusMasked && Date.now() - laseFocusMasked < 100) {
879
- return;
880
- }
881
- const dateMaskedFormat = computeDateMaskedFormat.value;
882
- const maskChar = computeMaskChar.value;
883
- const selectionStart = targetElem.selectionStart || 0;
884
- const selectionEnd = targetElem.selectionEnd || 0;
885
- const inpValue = targetElem.value;
886
- const allMaskedKeys = import_xe_utils.default.map(dateMaskedFormat.match(new RegExp(`(${inputMaskedKeys.join("|")})+`, "g")) || [], (fullKey) => fullKey[0]);
887
- if (!inpValue) {
888
- let restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
889
- if (isFocus && modelValue) {
890
- const chunkNums = ("" + import_xe_utils.default.toNumber(modelValue)).match(/\d/g) || [];
891
- let useNumIndex = 0;
892
- restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), (txt) => chunkNums[useNumIndex++] || txt);
893
- }
894
- const firstMaskedKeys = allMaskedKeys[0];
895
- const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
896
- if (firstSkRest) {
897
- evnt.preventDefault();
898
- const firstChunkFormat = firstSkRest[0];
899
- targetElem.value = restValue;
900
- handleInputLabel(restValue, false);
901
- targetElem.setSelectionRange(0, firstChunkFormat.length);
902
- internalData.laseFocusMasked = Date.now();
903
- return;
947
+ };
948
+ const blurEvent = (evnt) => {
949
+ const { inputValue } = reactData;
950
+ const inpImmediate = computeInpImmediate.value;
951
+ const value = inputValue;
952
+ if (!inpImmediate) {
953
+ handleChange(value, evnt);
904
954
  }
905
- }
906
- const isAllSelected = !selectionStart && selectionEnd === inpValue.length && allMaskedKeys.length > 1;
907
- const isNotMasked = inpValue && inpValue.length !== dateMaskedFormat.length;
908
- if (isAllSelected || isNotMasked) {
909
- let restValue = "";
910
- if (isNotMasked && inpValue) {
911
- const chunkNums = inpValue.match(/\d/g) || [];
912
- let useNumIndex = 0;
913
- restValue = dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), () => chunkNums[useNumIndex++] || maskChar);
914
- } else {
915
- dateMaskedFormat.replace(new RegExp(`(${inputMaskedKeys.join("|")})`, "g"), maskChar);
955
+ if (!reactData.visiblePanel) {
956
+ const { inputLabel } = internalData;
957
+ reactData.isActivated = false;
958
+ afterCheckValue(inputLabel);
916
959
  }
917
- const firstMaskedKeys = allMaskedKeys[0];
918
- const firstSkRest = dateMaskedFormat.match(new RegExp(`${firstMaskedKeys}+`));
919
- if (firstSkRest) {
920
- evnt.preventDefault();
921
- const firstChunkFormat = firstSkRest[0];
922
- targetElem.value = restValue;
923
- handleInputLabel(restValue, false);
924
- targetElem.setSelectionRange(0, firstChunkFormat.length);
925
- internalData.laseFocusMasked = Date.now();
926
- return;
960
+ dispatchEvent("blur", { value }, evnt);
961
+ if ($xeForm && formItemInfo) {
962
+ $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
963
+ }
964
+ };
965
+ const focusEvent = (evnt) => {
966
+ const { multiple, editable, maskedConfig } = props;
967
+ const { fsTimeout } = internalData;
968
+ const maskedOpts = computeMaskedOpts.value;
969
+ const popupOpts = computePopupOpts.value;
970
+ const { trigger } = popupOpts;
971
+ reactData.isActivated = true;
972
+ if (fsTimeout) {
973
+ clearTimeout(fsTimeout);
974
+ }
975
+ if (!trigger || trigger === "default") {
976
+ datePickerOpenEvent(evnt);
977
+ } else if (trigger === "icon") {
978
+ hidePanel();
979
+ }
980
+ if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
981
+ internalData.fsTimeout = setTimeout(() => {
982
+ handleMaskedSelectedDate(evnt, true);
983
+ }, 20);
984
+ }
985
+ triggerEvent(evnt);
986
+ };
987
+ const clickEvent = (evnt) => {
988
+ const { multiple, editable, maskedConfig } = props;
989
+ const { fsTimeout } = internalData;
990
+ const maskedOpts = computeMaskedOpts.value;
991
+ if (fsTimeout) {
992
+ clearTimeout(fsTimeout);
993
+ }
994
+ if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
995
+ internalData.fsTimeout = setTimeout(() => {
996
+ handleMaskedSelectedDate(evnt);
997
+ }, 10);
998
+ }
999
+ triggerEvent(evnt);
1000
+ };
1001
+ const keydownEvent = (evnt) => {
1002
+ const { type, editable, maskedConfig } = props;
1003
+ const { visiblePanel } = reactData;
1004
+ const maskedOpts = computeMaskedOpts.value;
1005
+ const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
1006
+ const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
1007
+ const isLtArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT);
1008
+ const isRtArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT);
1009
+ const isEnter = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ENTER);
1010
+ if (editable) {
1011
+ if (isEnter) {
1012
+ const { inputLabel } = internalData;
1013
+ if (visiblePanel) {
1014
+ hidePanel();
1015
+ }
1016
+ afterCheckValue(inputLabel);
1017
+ } else if (maskedTypes.includes(type)) {
1018
+ if ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled) {
1019
+ if (maskedOpts.isArrow && (isUpArrow || isDwArrow || isLtArrow || isRtArrow)) {
1020
+ handleArrowInputDate(evnt, isUpArrow, isDwArrow, isLtArrow, isRtArrow);
1021
+ } else if (maskedOpts.isMasked) {
1022
+ handleMaskedInputDate(evnt);
1023
+ }
1024
+ }
1025
+ }
1026
+ }
1027
+ triggerEvent(evnt);
1028
+ };
1029
+ const keyupEvent = (evnt) => {
1030
+ triggerEvent(evnt);
1031
+ };
1032
+ const confirmEvent = (evnt) => {
1033
+ const $datePanel = refDatePanel.value;
1034
+ if ($datePanel) {
1035
+ $datePanel.confirmByEvent(evnt);
927
1036
  }
928
- }
929
- let selectKey = dateMaskedFormat[selectionStart];
930
- if (!parseInputKayMaps[selectKey]) {
931
- selectKey = dateMaskedFormat[selectionStart - 1];
932
- }
933
- if (selectKey) {
934
- evnt.stopPropagation();
935
- const skRest = dateMaskedFormat.match(new RegExp(selectKey + "+"));
936
- if (skRest) {
937
- const chunkFormat = skRest[0] || "";
938
- const chunkStartIndex = skRest.index || 0;
939
- const chunkEndIndex = chunkStartIndex + chunkFormat.length;
940
- targetElem.setSelectionRange(chunkStartIndex, chunkEndIndex);
941
- internalData.isTriggerMasked = true;
942
- internalData.laseFocusMasked = Date.now();
943
- }
944
- }
945
- };
946
- const blurEvent = (evnt) => {
947
- const { inputValue } = reactData;
948
- const inpImmediate = computeInpImmediate.value;
949
- const value = inputValue;
950
- if (!inpImmediate) {
951
- handleChange(value, evnt);
952
- }
953
- if (!reactData.visiblePanel) {
954
- const { inputLabel } = internalData;
955
- reactData.isActivated = false;
956
- afterCheckValue(inputLabel);
957
- }
958
- dispatchEvent("blur", { value }, evnt);
959
- if ($xeForm && formItemInfo) {
960
- $xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
961
- }
962
- };
963
- const focusEvent = (evnt) => {
964
- const { multiple, editable, maskedConfig } = props;
965
- const { fsTimeout } = internalData;
966
- const maskedOpts = computeMaskedOpts.value;
967
- const popupOpts = computePopupOpts.value;
968
- const { trigger } = popupOpts;
969
- reactData.isActivated = true;
970
- if (fsTimeout) {
971
- clearTimeout(fsTimeout);
972
- }
973
- if (!trigger || trigger === "default") {
974
- datePickerOpenEvent(evnt);
975
- } else if (trigger === "icon") {
976
1037
  hidePanel();
977
- }
978
- if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
979
- internalData.fsTimeout = setTimeout(() => {
980
- handleMaskedSelectedDate(evnt, true);
981
- }, 20);
982
- }
983
- triggerEvent(evnt);
984
- };
985
- const clickEvent = (evnt) => {
986
- const { multiple, editable, maskedConfig } = props;
987
- const { fsTimeout } = internalData;
988
- const maskedOpts = computeMaskedOpts.value;
989
- if (fsTimeout) {
990
- clearTimeout(fsTimeout);
991
- }
992
- if (editable && !multiple && ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled)) {
993
- internalData.fsTimeout = setTimeout(() => {
994
- handleMaskedSelectedDate(evnt);
995
- }, 10);
996
- }
997
- triggerEvent(evnt);
998
- };
999
- const keydownEvent = (evnt) => {
1000
- const { type, editable, maskedConfig } = props;
1001
- const { visiblePanel } = reactData;
1002
- const maskedOpts = computeMaskedOpts.value;
1003
- const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
1004
- const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
1005
- const isLtArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT);
1006
- const isRtArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT);
1007
- const isEnter = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ENTER);
1008
- if (editable) {
1009
- if (isEnter) {
1010
- const { inputLabel } = internalData;
1011
- if (visiblePanel) {
1038
+ };
1039
+ const panelChangeEvent = (params) => {
1040
+ const { multiple, autoClose } = props;
1041
+ const { value, $event } = params;
1042
+ const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
1043
+ handleChange(value, $event);
1044
+ if (!multiple && !isTimeOrDateTimeType) {
1045
+ if (autoClose) {
1012
1046
  hidePanel();
1013
1047
  }
1014
- afterCheckValue(inputLabel);
1015
- } else if (maskedTypes.includes(type)) {
1016
- if ((0, import_utils.isEnableConf)(maskedConfig) || maskedOpts.enabled) {
1017
- if (maskedOpts.isArrow && (isUpArrow || isDwArrow || isLtArrow || isRtArrow)) {
1018
- handleArrowInputDate(evnt, isUpArrow, isDwArrow, isLtArrow, isRtArrow);
1019
- } else if (maskedOpts.isMasked) {
1020
- handleMaskedInputDate(evnt);
1048
+ }
1049
+ };
1050
+ const panelConfirmEvent = (params) => {
1051
+ dispatchEvent("confirm", params, params.$event);
1052
+ };
1053
+ const panelRevertEvent = (params) => {
1054
+ handleInputLabel(params.label, true);
1055
+ };
1056
+ const handleGlobalMousedownEvent = (evnt) => {
1057
+ const { visiblePanel, isActivated } = reactData;
1058
+ const el = refElem.value;
1059
+ const panelWrapperElem = refPanelWrapper.value;
1060
+ const isDisabled = computeIsDisabled.value;
1061
+ if (!isDisabled && isActivated) {
1062
+ const currActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag || (0, import_dom.getEventTargetNode)(evnt, panelWrapperElem).flag;
1063
+ if (currActivated !== isActivated) {
1064
+ reactData.isActivated = currActivated;
1065
+ }
1066
+ if (!currActivated) {
1067
+ if (visiblePanel) {
1068
+ hidePanel();
1069
+ const { inputLabel } = internalData;
1070
+ afterCheckValue(inputLabel);
1021
1071
  }
1022
1072
  }
1023
1073
  }
1024
- }
1025
- triggerEvent(evnt);
1026
- };
1027
- const keyupEvent = (evnt) => {
1028
- triggerEvent(evnt);
1029
- };
1030
- const confirmEvent = (evnt) => {
1031
- const $datePanel = refDatePanel.value;
1032
- if ($datePanel) {
1033
- $datePanel.confirmByEvent(evnt);
1034
- }
1035
- hidePanel();
1036
- };
1037
- const panelChangeEvent = (params) => {
1038
- const { multiple, autoClose } = props;
1039
- const { value, $event } = params;
1040
- const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
1041
- handleChange(value, $event);
1042
- if (!multiple && !isTimeOrDateTimeType) {
1043
- if (autoClose) {
1044
- hidePanel();
1045
- }
1046
- }
1047
- };
1048
- const panelConfirmEvent = (params) => {
1049
- dispatchEvent("confirm", params, params.$event);
1050
- };
1051
- const panelRevertEvent = (params) => {
1052
- handleInputLabel(params.label, true);
1053
- };
1054
- const handleGlobalMousedownEvent = (evnt) => {
1055
- const { visiblePanel, isActivated } = reactData;
1056
- const el = refElem.value;
1057
- const panelWrapperElem = refPanelWrapper.value;
1058
- const isDisabled = computeIsDisabled.value;
1059
- if (!isDisabled && isActivated) {
1060
- const currActivated = (0, import_dom.getEventTargetNode)(evnt, el).flag || (0, import_dom.getEventTargetNode)(evnt, panelWrapperElem).flag;
1061
- if (currActivated !== isActivated) {
1062
- reactData.isActivated = currActivated;
1063
- }
1064
- if (!currActivated) {
1074
+ };
1075
+ const handleGlobalKeydownEvent = (evnt) => {
1076
+ const { isActivated, visiblePanel } = reactData;
1077
+ const isDisabled = computeIsDisabled.value;
1078
+ if (!isDisabled) {
1079
+ const isTab = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.TAB);
1080
+ const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
1081
+ if (isTab) {
1082
+ if (isActivated) {
1083
+ reactData.isActivated = false;
1084
+ }
1085
+ }
1065
1086
  if (visiblePanel) {
1066
- hidePanel();
1067
- const { inputLabel } = internalData;
1068
- afterCheckValue(inputLabel);
1087
+ if (isEsc || isTab) {
1088
+ hidePanel();
1089
+ }
1069
1090
  }
1070
1091
  }
1071
- }
1072
- };
1073
- const handleGlobalKeydownEvent = (evnt) => {
1074
- const { isActivated, visiblePanel } = reactData;
1075
- const isDisabled = computeIsDisabled.value;
1076
- if (!isDisabled) {
1077
- const isTab = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.TAB);
1078
- const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
1079
- if (isTab) {
1080
- if (isActivated) {
1081
- reactData.isActivated = false;
1092
+ };
1093
+ const handleGlobalBlurEvent = () => {
1094
+ const { isActivated, visiblePanel } = reactData;
1095
+ if (visiblePanel) {
1096
+ hidePanel();
1097
+ }
1098
+ if (isActivated) {
1099
+ reactData.isActivated = false;
1100
+ }
1101
+ if (visiblePanel || isActivated) {
1102
+ afterCheckValue(internalData.inputLabel);
1103
+ const targetElem = refInputTarget.value;
1104
+ if (targetElem) {
1105
+ targetElem.blur();
1082
1106
  }
1083
1107
  }
1108
+ };
1109
+ const handleGlobalResizeEvent = () => {
1110
+ const { visiblePanel } = reactData;
1084
1111
  if (visiblePanel) {
1085
- if (isEsc || isTab) {
1086
- hidePanel();
1087
- }
1112
+ updatePlacement();
1088
1113
  }
1089
- }
1090
- };
1091
- const handleGlobalBlurEvent = () => {
1092
- const { isActivated, visiblePanel } = reactData;
1093
- if (visiblePanel) {
1094
- hidePanel();
1095
- }
1096
- if (isActivated) {
1097
- reactData.isActivated = false;
1098
- }
1099
- if (visiblePanel || isActivated) {
1100
- afterCheckValue(internalData.inputLabel);
1114
+ };
1115
+ const handleGlobalScrollEvent = () => {
1116
+ const { visiblePanel } = reactData;
1117
+ if (visiblePanel) {
1118
+ updatePlacement();
1119
+ }
1120
+ };
1121
+ const updateZindex = () => {
1122
+ const popupOpts = computePopupOpts.value;
1123
+ const customZIndex = popupOpts.zIndex || props.zIndex;
1124
+ if (customZIndex) {
1125
+ reactData.panelIndex = import_xe_utils.default.toNumber(customZIndex);
1126
+ } else if (reactData.panelIndex < (0, import_utils.getLastZIndex)()) {
1127
+ reactData.panelIndex = (0, import_utils.nextZIndex)();
1128
+ }
1129
+ };
1130
+ const updatePlacement = () => {
1131
+ const { placement } = props;
1132
+ const { panelIndex } = reactData;
1101
1133
  const targetElem = refInputTarget.value;
1102
- if (targetElem) {
1103
- targetElem.blur();
1104
- }
1105
- }
1106
- };
1107
- const handleGlobalResizeEvent = () => {
1108
- const { visiblePanel } = reactData;
1109
- if (visiblePanel) {
1110
- updatePlacement();
1111
- }
1112
- };
1113
- const handleGlobalScrollEvent = () => {
1114
- const { visiblePanel } = reactData;
1115
- if (visiblePanel) {
1116
- updatePlacement();
1117
- }
1118
- };
1119
- const updateZindex = () => {
1120
- const popupOpts = computePopupOpts.value;
1121
- const customZIndex = popupOpts.zIndex || props.zIndex;
1122
- if (customZIndex) {
1123
- reactData.panelIndex = import_xe_utils.default.toNumber(customZIndex);
1124
- } else if (reactData.panelIndex < (0, import_utils.getLastZIndex)()) {
1125
- reactData.panelIndex = (0, import_utils.nextZIndex)();
1126
- }
1127
- };
1128
- const updatePlacement = () => {
1129
- const { placement } = props;
1130
- const { panelIndex } = reactData;
1131
- const targetElem = refInputTarget.value;
1132
- const panelElem = refInputPanel.value;
1133
- if (!panelElem) {
1134
+ const panelElem = refInputPanel.value;
1135
+ if (!panelElem) {
1136
+ return (0, import_vue.nextTick)();
1137
+ }
1138
+ const btnTransfer = computeBtnTransfer.value;
1139
+ const popupOpts = computePopupOpts.value;
1140
+ const handleStyle = () => {
1141
+ const ppObj = (0, import_dom.updatePanelPlacement)(targetElem, panelElem, {
1142
+ placement: popupOpts.placement || placement,
1143
+ defaultPlacement: popupOpts.defaultPlacement,
1144
+ appendTo: popupOpts.appendTo,
1145
+ teleportTo: btnTransfer
1146
+ });
1147
+ const panelStyle = Object.assign(ppObj.style, {
1148
+ zIndex: panelIndex
1149
+ });
1150
+ reactData.panelStyle = panelStyle;
1151
+ reactData.panelPlacement = ppObj.placement;
1152
+ };
1153
+ handleStyle();
1154
+ return (0, import_vue.nextTick)().then(handleStyle);
1155
+ };
1156
+ const showPanel = () => {
1157
+ const { visiblePanel } = reactData;
1158
+ const isDisabled = computeIsDisabled.value;
1159
+ if (!isDisabled && !visiblePanel) {
1160
+ if (!reactData.initialized) {
1161
+ reactData.initialized = true;
1162
+ }
1163
+ if (internalData.hpTimeout) {
1164
+ clearTimeout(internalData.hpTimeout);
1165
+ internalData.hpTimeout = void 0;
1166
+ }
1167
+ reactData.isActivated = true;
1168
+ reactData.isAniVisible = true;
1169
+ setTimeout(() => {
1170
+ reactData.visiblePanel = true;
1171
+ updatePlacement();
1172
+ }, 10);
1173
+ updateZindex();
1174
+ return updatePlacement();
1175
+ }
1134
1176
  return (0, import_vue.nextTick)();
1135
- }
1136
- const btnTransfer = computeBtnTransfer.value;
1137
- const popupOpts = computePopupOpts.value;
1138
- const handleStyle = () => {
1139
- const ppObj = (0, import_dom.updatePanelPlacement)(targetElem, panelElem, {
1140
- placement: popupOpts.placement || placement,
1141
- defaultPlacement: popupOpts.defaultPlacement,
1142
- appendTo: popupOpts.appendTo,
1143
- teleportTo: btnTransfer
1144
- });
1145
- const panelStyle = Object.assign(ppObj.style, {
1146
- zIndex: panelIndex
1147
- });
1148
- reactData.panelStyle = panelStyle;
1149
- reactData.panelPlacement = ppObj.placement;
1150
1177
  };
1151
- handleStyle();
1152
- return (0, import_vue.nextTick)().then(handleStyle);
1153
- };
1154
- const showPanel = () => {
1155
- const { visiblePanel } = reactData;
1156
- const isDisabled = computeIsDisabled.value;
1157
- if (!isDisabled && !visiblePanel) {
1158
- if (!reactData.initialized) {
1159
- reactData.initialized = true;
1160
- }
1161
- if (internalData.hpTimeout) {
1162
- clearTimeout(internalData.hpTimeout);
1163
- internalData.hpTimeout = void 0;
1178
+ const datePickerOpenEvent = (evnt) => {
1179
+ const formReadonly = computeFormReadonly.value;
1180
+ if (!formReadonly) {
1181
+ evnt.preventDefault();
1182
+ showPanel();
1164
1183
  }
1165
- reactData.isActivated = true;
1166
- reactData.isAniVisible = true;
1167
- setTimeout(() => {
1168
- reactData.visiblePanel = true;
1169
- updatePlacement();
1170
- }, 10);
1171
- updateZindex();
1172
- return updatePlacement();
1173
- }
1174
- return (0, import_vue.nextTick)();
1175
- };
1176
- const datePickerOpenEvent = (evnt) => {
1177
- const formReadonly = computeFormReadonly.value;
1178
- if (!formReadonly) {
1179
- evnt.preventDefault();
1180
- showPanel();
1181
- }
1182
- };
1183
- const clickIconEvent = (evnt) => {
1184
- const { visiblePanel } = reactData;
1185
- const popupOpts = computePopupOpts.value;
1186
- const { trigger } = popupOpts;
1187
- if (!trigger || trigger === "default" || trigger === "icon") {
1188
- if (visiblePanel) {
1189
- hidePanel();
1190
- } else {
1191
- datePickerOpenEvent(evnt);
1184
+ };
1185
+ const clickIconEvent = (evnt) => {
1186
+ const { visiblePanel } = reactData;
1187
+ const popupOpts = computePopupOpts.value;
1188
+ const { trigger } = popupOpts;
1189
+ if (!trigger || trigger === "default" || trigger === "icon") {
1190
+ if (visiblePanel) {
1191
+ hidePanel();
1192
+ } else {
1193
+ datePickerOpenEvent(evnt);
1194
+ }
1192
1195
  }
1193
- }
1194
- };
1195
- const handleShortcutEvent = ({ option, $event }) => {
1196
- const { type } = props;
1197
- const { inputValue } = reactData;
1198
- const shortcutOpts = computeShortcutOpts.value;
1199
- const { autoClose } = shortcutOpts;
1200
- const { code, clickMethod } = option;
1201
- let value = inputValue;
1202
- const shortcutParams = {
1203
- $datePicker: $xeDatePicker,
1204
- option,
1205
- value,
1206
- code
1207
1196
  };
1208
- if (!clickMethod && code) {
1209
- const gCommandOpts = commands.get(code);
1210
- const dpCommandMethod = gCommandOpts ? gCommandOpts.datePickerCommandMethod : null;
1211
- if (dpCommandMethod) {
1212
- dpCommandMethod(shortcutParams);
1213
- } else {
1214
- const dateValueFormat = computeDateValueFormat.value;
1215
- const firstDayOfWeek = computeFirstDayOfWeek.value;
1216
- switch (code) {
1217
- case "now":
1218
- case "prev":
1219
- case "next":
1220
- case "minus":
1221
- case "plus": {
1222
- const restObj = (0, import_util.getDateByCode)(code, value, type, {
1223
- valueFormat: dateValueFormat,
1224
- firstDay: firstDayOfWeek
1225
- });
1226
- value = restObj.value;
1227
- shortcutParams.value = value;
1228
- handleChange(value, $event);
1229
- break;
1197
+ const handleShortcutEvent = ({ option, $event }) => {
1198
+ const { type } = props;
1199
+ const { inputValue } = reactData;
1200
+ const shortcutOpts = computeShortcutOpts.value;
1201
+ const { autoClose } = shortcutOpts;
1202
+ const { code, clickMethod } = option;
1203
+ let value = inputValue;
1204
+ const shortcutParams = {
1205
+ $datePicker: $xeDatePicker,
1206
+ option,
1207
+ value,
1208
+ code
1209
+ };
1210
+ if (!clickMethod && code) {
1211
+ const gCommandOpts = commands.get(code);
1212
+ const dpCommandMethod = gCommandOpts ? gCommandOpts.datePickerCommandMethod : null;
1213
+ if (dpCommandMethod) {
1214
+ dpCommandMethod(shortcutParams);
1215
+ } else {
1216
+ const dateValueFormat = computeDateValueFormat.value;
1217
+ const firstDayOfWeek = computeFirstDayOfWeek.value;
1218
+ switch (code) {
1219
+ case "now":
1220
+ case "prev":
1221
+ case "next":
1222
+ case "minus":
1223
+ case "plus": {
1224
+ const restObj = (0, import_util.getDateByCode)(code, value, type, {
1225
+ valueFormat: dateValueFormat,
1226
+ firstDay: firstDayOfWeek
1227
+ });
1228
+ value = restObj.value;
1229
+ shortcutParams.value = value;
1230
+ handleChange(value, $event);
1231
+ break;
1232
+ }
1233
+ default:
1234
+ errLog("vxe.error.notCommands", [code]);
1235
+ break;
1230
1236
  }
1231
- default:
1232
- errLog("vxe.error.notCommands", [code]);
1233
- break;
1237
+ }
1238
+ } else {
1239
+ const optClickMethod = clickMethod || shortcutOpts.clickMethod;
1240
+ if (optClickMethod) {
1241
+ optClickMethod(shortcutParams);
1234
1242
  }
1235
1243
  }
1236
- } else {
1237
- const optClickMethod = clickMethod || shortcutOpts.clickMethod;
1238
- if (optClickMethod) {
1239
- optClickMethod(shortcutParams);
1244
+ if (autoClose) {
1245
+ hidePanel();
1240
1246
  }
1241
- }
1242
- if (autoClose) {
1243
- hidePanel();
1244
- }
1245
- dispatchEvent("shortcut-click", shortcutParams, $event);
1246
- };
1247
- const dispatchEvent = (type, params, evnt) => {
1248
- emit(type, createEvent(evnt, { $datePicker: $xeDatePicker }, params));
1249
- };
1250
- const emitModel = (value) => {
1251
- emit("update:modelValue", value);
1252
- };
1253
- const datePickerMethods = {
1254
- dispatchEvent,
1255
- setModelValue(value) {
1256
- reactData.inputValue = value;
1257
- emitModel(value);
1258
- },
1259
- setModelValueByEvent(evnt, value) {
1260
- handleChange(value || "", evnt);
1261
- },
1262
- focus() {
1263
- const inputElem = refInputTarget.value;
1264
- reactData.isActivated = true;
1265
- inputElem.focus();
1266
- return (0, import_vue.nextTick)();
1267
- },
1268
- blur() {
1269
- const inputElem = refInputTarget.value;
1270
- inputElem.blur();
1271
- reactData.isActivated = false;
1272
- return (0, import_vue.nextTick)();
1273
- },
1274
- select() {
1275
- const inputElem = refInputTarget.value;
1276
- inputElem.select();
1277
- reactData.isActivated = false;
1278
- return (0, import_vue.nextTick)();
1279
- },
1280
- showPanel,
1281
- hidePanel,
1282
- updatePlacement
1283
- };
1284
- Object.assign($xeDatePicker, datePickerMethods);
1285
- const renderShortcutBtn = (pos, isVertical) => {
1286
- const shortcutOpts = computeShortcutOpts.value;
1287
- const { position, align, mode } = shortcutOpts;
1288
- const shortcutList = computeShortcutList.value;
1289
- if ((0, import_utils.isEnableConf)(shortcutOpts) && shortcutList.length && (position || "left") === pos) {
1290
- return (0, import_vue.h)(
1291
- "div",
1292
- {
1293
- class: `vxe-date-picker--layout-${pos}-wrapper`
1294
- },
1295
- [
1296
- (0, import_vue.h)(import_button_group.default, {
1297
- options: shortcutList,
1298
- mode,
1299
- align,
1300
- vertical: isVertical,
1301
- onClick: handleShortcutEvent
1302
- })
1303
- ]
1304
- );
1305
- }
1306
- return renderEmptyElement($xeDatePicker);
1307
- };
1308
- const renderPanel = () => {
1309
- const popupOpts = computePopupOpts.value;
1310
- if (popupOpts.enabled === false) {
1311
- return renderEmptyElement($xeDatePicker);
1312
- }
1313
- const { type, multiple, showClearButton, showConfirmButton } = props;
1314
- const { initialized, isAniVisible, visiblePanel, panelPlacement, panelStyle, inputValue } = reactData;
1315
- const vSize = computeSize.value;
1316
- const btnTransfer = computeBtnTransfer.value;
1317
- const shortcutOpts = computeShortcutOpts.value;
1318
- const isClearable = computeIsClearable.value;
1319
- const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
1320
- const shortcutList = computeShortcutList.value;
1321
- const timeOpts = computeTimeOpts.value;
1322
- const dateStartDate = computeDateStartDate.value;
1323
- const dateEndDate = computeDateEndDate.value;
1324
- const { appendTo } = popupOpts;
1325
- const { position } = shortcutOpts;
1326
- const headerSlot = slots.header;
1327
- const footerSlot = slots.footer;
1328
- const topSlot = slots.top;
1329
- const bottomSlot = slots.bottom;
1330
- const leftSlot = slots.left;
1331
- const rightSlot = slots.right;
1332
- const ppClassName = popupOpts.className;
1333
- const hasShortcutBtn = shortcutList.length > 0;
1334
- const showConfirmBtn = showConfirmButton === null ? isTimeOrDateTimeType || multiple : showConfirmButton;
1335
- const showClearBtn = showClearButton === null ? isClearable && showConfirmBtn && type !== "time" : showClearButton;
1336
- return (0, import_vue.h)(
1337
- import_vue.Teleport,
1338
- {
1339
- to: (0, import_dom.getPopupContainer)(appendTo),
1340
- disabled: btnTransfer ? !initialized : true
1247
+ dispatchEvent("shortcut-click", shortcutParams, $event);
1248
+ };
1249
+ const dispatchEvent = (type, params, evnt) => {
1250
+ emit(type, createEvent(evnt, { $datePicker: $xeDatePicker }, params));
1251
+ };
1252
+ const emitModel = (value) => {
1253
+ emit("update:modelValue", value);
1254
+ };
1255
+ const datePickerMethods = {
1256
+ dispatchEvent,
1257
+ setModelValue(value) {
1258
+ reactData.inputValue = value;
1259
+ emitModel(value);
1341
1260
  },
1342
- [
1343
- (0, import_vue.h)(
1344
- "div",
1345
- {
1346
- ref: refInputPanel,
1347
- class: [
1348
- "vxe-table--ignore-clear vxe-date-picker--panel",
1349
- `type--${type}`,
1350
- ppClassName ? import_xe_utils.default.isFunction(ppClassName) ? ppClassName({ $datePicker: $xeDatePicker }) : ppClassName : "",
1351
- {
1352
- [`size--${vSize}`]: vSize,
1353
- "is--transfer": btnTransfer,
1354
- "ani--leave": isAniVisible,
1355
- "ani--enter": visiblePanel,
1356
- "show--top": !!(topSlot || headerSlot || hasShortcutBtn && (position === "top" || position === "header")),
1357
- "show--bottom": !!(bottomSlot || footerSlot || hasShortcutBtn && (position === "bottom" || position === "footer")),
1358
- "show--left": !!(leftSlot || hasShortcutBtn && position === "left"),
1359
- "show--right": !!(rightSlot || hasShortcutBtn && position === "right")
1360
- }
1361
- ],
1362
- placement: panelPlacement,
1363
- style: panelStyle
1364
- },
1365
- initialized && (visiblePanel || isAniVisible) ? [
1366
- (0, import_vue.h)(
1367
- "div",
1368
- {
1369
- ref: refPanelWrapper,
1370
- class: [
1371
- "vxe-date-picker--layout-all-wrapper",
1372
- `type--${type}`,
1373
- {
1374
- [`size--${vSize}`]: vSize
1375
- }
1376
- ]
1377
- },
1378
- [
1379
- topSlot ? (0, import_vue.h)(
1380
- "div",
1381
- {
1382
- class: "vxe-date-picker--layout-top-wrapper"
1383
- },
1384
- topSlot({})
1385
- ) : renderShortcutBtn("top"),
1386
- (0, import_vue.h)(
1387
- "div",
1388
- {
1389
- class: "vxe-date-picker--layout-body-layout-wrapper"
1390
- },
1391
- [
1392
- leftSlot ? (0, import_vue.h)(
1393
- "div",
1394
- {
1395
- class: "vxe-date-picker--layout-left-wrapper"
1396
- },
1397
- leftSlot({})
1398
- ) : renderShortcutBtn("left", true),
1399
- (0, import_vue.h)(
1400
- "div",
1401
- {
1402
- class: "vxe-date-picker--layout-body-content-wrapper"
1403
- },
1404
- [
1405
- headerSlot ? (0, import_vue.h)(
1406
- "div",
1407
- {
1408
- class: "vxe-date-picker--layout-header-wrapper"
1409
- },
1410
- headerSlot({})
1411
- ) : renderShortcutBtn("header"),
1412
- (0, import_vue.h)(
1413
- "div",
1414
- {
1415
- class: "vxe-date-picker--layout-body-wrapper"
1416
- },
1417
- [
1418
- (0, import_vue.h)(import_date_panel.default, {
1419
- ref: refDatePanel,
1420
- modelValue: reactData.inputValue,
1421
- type: props.type,
1422
- className: props.className,
1423
- multiple: props.multiple,
1424
- limitCount: props.limitCount,
1425
- startDate: dateStartDate,
1426
- endDate: dateEndDate,
1427
- defaultDate: props.defaultDate,
1428
- defaultTime: props.defaultTime,
1429
- minDate: props.minDate,
1430
- maxDate: props.maxDate,
1431
- startDay: props.startDay,
1432
- labelFormat: props.labelFormat,
1433
- valueFormat: props.valueFormat,
1434
- timeFormat: props.timeFormat,
1435
- timeConfig: timeOpts,
1436
- festivalMethod: props.festivalMethod || defaultFuncProps.festivalMethod,
1437
- disabledMethod: props.disabledMethod || defaultFuncProps.disabledMethod,
1438
- selectDay: props.selectDay,
1439
- onChange: panelChangeEvent,
1440
- onConfirm: panelConfirmEvent,
1441
- onRevert: panelRevertEvent
1442
- })
1443
- ]
1444
- ),
1445
- (0, import_vue.h)(
1446
- "div",
1447
- {
1448
- class: "vxe-date-picker--layout-footer-wrapper"
1449
- },
1450
- [
1451
- (0, import_vue.h)(
1452
- "div",
1453
- {
1454
- class: "vxe-date-picker--layout-footer-custom"
1455
- },
1456
- footerSlot ? footerSlot({}) : [renderShortcutBtn("footer")]
1457
- ),
1458
- showClearBtn || showConfirmBtn ? (0, import_vue.h)(
1459
- "div",
1460
- {
1461
- class: "vxe-date-picker--layout-footer-btns"
1462
- },
1463
- [
1464
- showClearBtn ? (0, import_vue.h)(import_button.default, {
1465
- size: "mini",
1466
- disabled: inputValue === "" || import_xe_utils.default.eqNull(inputValue),
1467
- content: getI18n("vxe.button.clear"),
1468
- onClick: clearValueEvent
1469
- }) : renderEmptyElement($xeDatePicker),
1470
- showConfirmBtn ? (0, import_vue.h)(import_button.default, {
1471
- size: "mini",
1472
- status: "primary",
1473
- content: getI18n("vxe.button.confirm"),
1474
- onClick: confirmEvent
1475
- }) : renderEmptyElement($xeDatePicker)
1476
- ]
1477
- ) : renderEmptyElement($xeDatePicker)
1478
- ]
1479
- )
1480
- ]
1481
- ),
1482
- rightSlot ? (0, import_vue.h)(
1483
- "div",
1484
- {
1485
- class: "vxe-date-picker--layout-right-wrapper"
1486
- },
1487
- rightSlot({})
1488
- ) : renderShortcutBtn("right", true)
1489
- ]
1490
- ),
1491
- bottomSlot ? (0, import_vue.h)(
1492
- "div",
1493
- {
1494
- class: "vxe-date-picker--layout-bottom-wrapper"
1495
- },
1496
- bottomSlot({})
1497
- ) : renderShortcutBtn("bottom")
1498
- ]
1499
- )
1500
- ] : []
1501
- )
1502
- ]
1503
- );
1504
- };
1505
- const renderPrefixIcon = () => {
1506
- const { prefixIcon } = props;
1507
- const prefixSlot = slots.prefix;
1508
- return prefixSlot || prefixIcon ? (0, import_vue.h)(
1509
- "div",
1510
- {
1511
- class: "vxe-date-picker--prefix",
1512
- onClick: clickPrefixEvent
1261
+ setModelValueByEvent(evnt, value) {
1262
+ handleChange(value || "", evnt);
1513
1263
  },
1514
- [
1515
- (0, import_vue.h)(
1516
- "div",
1517
- {
1518
- class: "vxe-date-picker--prefix-icon"
1519
- },
1520
- prefixSlot ? (0, import_vn.getSlotVNs)(prefixSlot({})) : [
1521
- (0, import_vue.h)("i", {
1522
- class: prefixIcon
1523
- })
1524
- ]
1525
- )
1526
- ]
1527
- ) : null;
1528
- };
1529
- const renderSuffixIcon = () => {
1530
- const { suffixIcon } = props;
1531
- const { inputValue } = reactData;
1532
- const suffixSlot = slots.suffix;
1533
- const isDisabled = computeIsDisabled.value;
1534
- const isClearable = computeIsClearable.value;
1535
- return (0, import_vue.h)(
1536
- "div",
1537
- {
1538
- class: [
1539
- "vxe-date-picker--suffix",
1540
- {
1541
- "is--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
1542
- }
1543
- ]
1264
+ focus() {
1265
+ const inputElem = refInputTarget.value;
1266
+ reactData.isActivated = true;
1267
+ inputElem.focus();
1268
+ return (0, import_vue.nextTick)();
1269
+ },
1270
+ blur() {
1271
+ const inputElem = refInputTarget.value;
1272
+ inputElem.blur();
1273
+ reactData.isActivated = false;
1274
+ return (0, import_vue.nextTick)();
1275
+ },
1276
+ select() {
1277
+ const inputElem = refInputTarget.value;
1278
+ inputElem.select();
1279
+ reactData.isActivated = false;
1280
+ return (0, import_vue.nextTick)();
1544
1281
  },
1545
- [
1546
- isClearable ? (0, import_vue.h)(
1282
+ showPanel,
1283
+ hidePanel,
1284
+ updatePlacement
1285
+ };
1286
+ Object.assign($xeDatePicker, datePickerMethods);
1287
+ const renderShortcutBtn = (pos, isVertical) => {
1288
+ const shortcutOpts = computeShortcutOpts.value;
1289
+ const { position, align, mode } = shortcutOpts;
1290
+ const shortcutList = computeShortcutList.value;
1291
+ if ((0, import_utils.isEnableConf)(shortcutOpts) && shortcutList.length && (position || "left") === pos) {
1292
+ return (0, import_vue.h)(
1547
1293
  "div",
1548
1294
  {
1549
- class: "vxe-date-picker--clear-icon",
1550
- onClick: clearValueEvent
1295
+ class: `vxe-date-picker--layout-${pos}-wrapper`
1551
1296
  },
1552
1297
  [
1553
- (0, import_vue.h)("i", {
1554
- class: getIcon().INPUT_CLEAR
1298
+ (0, import_vue.h)(import_button_group.default, {
1299
+ options: shortcutList,
1300
+ mode,
1301
+ align,
1302
+ vertical: isVertical,
1303
+ onClick: handleShortcutEvent
1555
1304
  })
1556
1305
  ]
1557
- ) : renderEmptyElement($xeDatePicker),
1558
- renderExtraSuffixIcon(),
1559
- suffixSlot || suffixIcon ? (0, import_vue.h)(
1560
- "div",
1561
- {
1562
- class: "vxe-date-picker--suffix-icon",
1563
- onClick: clickSuffixEvent
1564
- },
1565
- suffixSlot ? (0, import_vn.getSlotVNs)(suffixSlot({})) : [
1566
- (0, import_vue.h)("i", {
1567
- class: suffixIcon
1568
- })
1306
+ );
1307
+ }
1308
+ return renderEmptyElement($xeDatePicker);
1309
+ };
1310
+ const renderPanel = () => {
1311
+ const popupOpts = computePopupOpts.value;
1312
+ if (popupOpts.enabled === false) {
1313
+ return renderEmptyElement($xeDatePicker);
1314
+ }
1315
+ const { type, multiple, showClearButton, showConfirmButton } = props;
1316
+ const { initialized, isAniVisible, visiblePanel, panelPlacement, panelStyle, inputValue } = reactData;
1317
+ const vSize = computeSize.value;
1318
+ const btnTransfer = computeBtnTransfer.value;
1319
+ const shortcutOpts = computeShortcutOpts.value;
1320
+ const isClearable = computeIsClearable.value;
1321
+ const isTimeOrDateTimeType = computeIsTimeOrDateTimeType.value;
1322
+ const shortcutList = computeShortcutList.value;
1323
+ const timeOpts = computeTimeOpts.value;
1324
+ const dateStartDate = computeDateStartDate.value;
1325
+ const dateEndDate = computeDateEndDate.value;
1326
+ const { appendTo } = popupOpts;
1327
+ const { position } = shortcutOpts;
1328
+ const headerSlot = slots.header;
1329
+ const footerSlot = slots.footer;
1330
+ const topSlot = slots.top;
1331
+ const bottomSlot = slots.bottom;
1332
+ const leftSlot = slots.left;
1333
+ const rightSlot = slots.right;
1334
+ const ppClassName = popupOpts.className;
1335
+ const hasShortcutBtn = shortcutList.length > 0;
1336
+ const showConfirmBtn = showConfirmButton === null ? isTimeOrDateTimeType || multiple : showConfirmButton;
1337
+ const showClearBtn = showClearButton === null ? isClearable && showConfirmBtn && type !== "time" : showClearButton;
1338
+ return (0, import_vue.h)(
1339
+ import_vue.Teleport,
1340
+ {
1341
+ to: (0, import_dom.getPopupContainer)(appendTo),
1342
+ disabled: btnTransfer ? !initialized : true
1343
+ },
1344
+ [
1345
+ (0, import_vue.h)(
1346
+ "div",
1347
+ {
1348
+ ref: refInputPanel,
1349
+ class: [
1350
+ "vxe-table--ignore-clear vxe-date-picker--panel",
1351
+ `type--${type}`,
1352
+ ppClassName ? import_xe_utils.default.isFunction(ppClassName) ? ppClassName({ $datePicker: $xeDatePicker }) : ppClassName : "",
1353
+ {
1354
+ [`size--${vSize}`]: vSize,
1355
+ "is--transfer": btnTransfer,
1356
+ "ani--leave": isAniVisible,
1357
+ "ani--enter": visiblePanel,
1358
+ "show--top": !!(topSlot || headerSlot || hasShortcutBtn && (position === "top" || position === "header")),
1359
+ "show--bottom": !!(bottomSlot || footerSlot || hasShortcutBtn && (position === "bottom" || position === "footer")),
1360
+ "show--left": !!(leftSlot || hasShortcutBtn && position === "left"),
1361
+ "show--right": !!(rightSlot || hasShortcutBtn && position === "right")
1362
+ }
1363
+ ],
1364
+ placement: panelPlacement,
1365
+ style: panelStyle
1366
+ },
1367
+ initialized && (visiblePanel || isAniVisible) ? [
1368
+ (0, import_vue.h)(
1369
+ "div",
1370
+ {
1371
+ ref: refPanelWrapper,
1372
+ class: [
1373
+ "vxe-date-picker--layout-all-wrapper",
1374
+ `type--${type}`,
1375
+ {
1376
+ [`size--${vSize}`]: vSize
1377
+ }
1378
+ ]
1379
+ },
1380
+ [
1381
+ topSlot ? (0, import_vue.h)(
1382
+ "div",
1383
+ {
1384
+ class: "vxe-date-picker--layout-top-wrapper"
1385
+ },
1386
+ topSlot({})
1387
+ ) : renderShortcutBtn("top"),
1388
+ (0, import_vue.h)(
1389
+ "div",
1390
+ {
1391
+ class: "vxe-date-picker--layout-body-layout-wrapper"
1392
+ },
1393
+ [
1394
+ leftSlot ? (0, import_vue.h)(
1395
+ "div",
1396
+ {
1397
+ class: "vxe-date-picker--layout-left-wrapper"
1398
+ },
1399
+ leftSlot({})
1400
+ ) : renderShortcutBtn("left", true),
1401
+ (0, import_vue.h)(
1402
+ "div",
1403
+ {
1404
+ class: "vxe-date-picker--layout-body-content-wrapper"
1405
+ },
1406
+ [
1407
+ headerSlot ? (0, import_vue.h)(
1408
+ "div",
1409
+ {
1410
+ class: "vxe-date-picker--layout-header-wrapper"
1411
+ },
1412
+ headerSlot({})
1413
+ ) : renderShortcutBtn("header"),
1414
+ (0, import_vue.h)(
1415
+ "div",
1416
+ {
1417
+ class: "vxe-date-picker--layout-body-wrapper"
1418
+ },
1419
+ [
1420
+ (0, import_vue.h)(import_date_panel.default, {
1421
+ ref: refDatePanel,
1422
+ modelValue: reactData.inputValue,
1423
+ type: props.type,
1424
+ className: props.className,
1425
+ multiple: props.multiple,
1426
+ limitCount: props.limitCount,
1427
+ startDate: dateStartDate,
1428
+ endDate: dateEndDate,
1429
+ defaultDate: props.defaultDate,
1430
+ defaultTime: props.defaultTime,
1431
+ minDate: props.minDate,
1432
+ maxDate: props.maxDate,
1433
+ startDay: props.startDay,
1434
+ labelFormat: props.labelFormat,
1435
+ valueFormat: props.valueFormat,
1436
+ timeFormat: props.timeFormat,
1437
+ timeConfig: timeOpts,
1438
+ festivalMethod: props.festivalMethod || defaultFuncProps.festivalMethod,
1439
+ disabledMethod: props.disabledMethod || defaultFuncProps.disabledMethod,
1440
+ selectDay: props.selectDay,
1441
+ onChange: panelChangeEvent,
1442
+ onConfirm: panelConfirmEvent,
1443
+ onRevert: panelRevertEvent
1444
+ })
1445
+ ]
1446
+ ),
1447
+ (0, import_vue.h)(
1448
+ "div",
1449
+ {
1450
+ class: "vxe-date-picker--layout-footer-wrapper"
1451
+ },
1452
+ [
1453
+ (0, import_vue.h)(
1454
+ "div",
1455
+ {
1456
+ class: "vxe-date-picker--layout-footer-custom"
1457
+ },
1458
+ footerSlot ? footerSlot({}) : [renderShortcutBtn("footer")]
1459
+ ),
1460
+ showClearBtn || showConfirmBtn ? (0, import_vue.h)(
1461
+ "div",
1462
+ {
1463
+ class: "vxe-date-picker--layout-footer-btns"
1464
+ },
1465
+ [
1466
+ showClearBtn ? (0, import_vue.h)(import_button.default, {
1467
+ size: "mini",
1468
+ disabled: inputValue === "" || import_xe_utils.default.eqNull(inputValue),
1469
+ content: getI18n("vxe.button.clear"),
1470
+ onClick: clearValueEvent
1471
+ }) : renderEmptyElement($xeDatePicker),
1472
+ showConfirmBtn ? (0, import_vue.h)(import_button.default, {
1473
+ size: "mini",
1474
+ status: "primary",
1475
+ content: getI18n("vxe.button.confirm"),
1476
+ onClick: confirmEvent
1477
+ }) : renderEmptyElement($xeDatePicker)
1478
+ ]
1479
+ ) : renderEmptyElement($xeDatePicker)
1480
+ ]
1481
+ )
1482
+ ]
1483
+ ),
1484
+ rightSlot ? (0, import_vue.h)(
1485
+ "div",
1486
+ {
1487
+ class: "vxe-date-picker--layout-right-wrapper"
1488
+ },
1489
+ rightSlot({})
1490
+ ) : renderShortcutBtn("right", true)
1491
+ ]
1492
+ ),
1493
+ bottomSlot ? (0, import_vue.h)(
1494
+ "div",
1495
+ {
1496
+ class: "vxe-date-picker--layout-bottom-wrapper"
1497
+ },
1498
+ bottomSlot({})
1499
+ ) : renderShortcutBtn("bottom")
1500
+ ]
1501
+ )
1502
+ ] : []
1503
+ )
1504
+ ]
1505
+ );
1506
+ };
1507
+ const renderPrefixIcon = () => {
1508
+ const { prefixIcon } = props;
1509
+ const prefixSlot = slots.prefix;
1510
+ return prefixSlot || prefixIcon ? (0, import_vue.h)(
1511
+ "div",
1512
+ {
1513
+ class: "vxe-date-picker--prefix",
1514
+ onClick: clickPrefixEvent
1515
+ },
1516
+ [
1517
+ (0, import_vue.h)(
1518
+ "div",
1519
+ {
1520
+ class: "vxe-date-picker--prefix-icon"
1521
+ },
1522
+ prefixSlot ? (0, import_vn.getSlotVNs)(prefixSlot({})) : [
1523
+ (0, import_vue.h)("i", {
1524
+ class: prefixIcon
1525
+ })
1526
+ ]
1527
+ )
1528
+ ]
1529
+ ) : null;
1530
+ };
1531
+ const renderSuffixIcon = () => {
1532
+ const { suffixIcon } = props;
1533
+ const { inputValue } = reactData;
1534
+ const suffixSlot = slots.suffix;
1535
+ const isDisabled = computeIsDisabled.value;
1536
+ const isClearable = computeIsClearable.value;
1537
+ return (0, import_vue.h)(
1538
+ "div",
1539
+ {
1540
+ class: [
1541
+ "vxe-date-picker--suffix",
1542
+ {
1543
+ "is--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
1544
+ }
1569
1545
  ]
1570
- ) : renderEmptyElement($xeDatePicker)
1571
- ]
1572
- );
1573
- };
1574
- const renderExtraSuffixIcon = () => {
1575
- return (0, import_vue.h)(
1576
- "div",
1577
- {
1578
- class: "vxe-date-picker--control-icon",
1579
- onClick: clickIconEvent
1580
- },
1581
- [
1582
- (0, import_vue.h)("i", {
1583
- class: ["vxe-date-picker--date-picker-icon", getIcon().DATE_PICKER_DATE]
1584
- })
1585
- ]
1586
- );
1587
- };
1588
- const renderVN = () => {
1589
- const { className, inputClassName, type, name, autoComplete } = props;
1590
- const { inputValue, visiblePanel, isActivated, labelFlag } = reactData;
1591
- const { inputLabel } = internalData;
1592
- const vSize = computeSize.value;
1593
- const isDisabled = computeIsDisabled.value;
1594
- const formReadonly = computeFormReadonly.value;
1595
- const panelLabel = computePanelLabel.value;
1596
- if (formReadonly) {
1546
+ },
1547
+ [
1548
+ isClearable ? (0, import_vue.h)(
1549
+ "div",
1550
+ {
1551
+ class: "vxe-date-picker--clear-icon",
1552
+ onClick: clearValueEvent
1553
+ },
1554
+ [
1555
+ (0, import_vue.h)("i", {
1556
+ class: getIcon().INPUT_CLEAR
1557
+ })
1558
+ ]
1559
+ ) : renderEmptyElement($xeDatePicker),
1560
+ renderExtraSuffixIcon(),
1561
+ suffixSlot || suffixIcon ? (0, import_vue.h)(
1562
+ "div",
1563
+ {
1564
+ class: "vxe-date-picker--suffix-icon",
1565
+ onClick: clickSuffixEvent
1566
+ },
1567
+ suffixSlot ? (0, import_vn.getSlotVNs)(suffixSlot({})) : [
1568
+ (0, import_vue.h)("i", {
1569
+ class: suffixIcon
1570
+ })
1571
+ ]
1572
+ ) : renderEmptyElement($xeDatePicker)
1573
+ ]
1574
+ );
1575
+ };
1576
+ const renderExtraSuffixIcon = () => {
1597
1577
  return (0, import_vue.h)(
1598
1578
  "div",
1599
1579
  {
1600
- ref: refElem,
1601
- class: ["vxe-date-picker--readonly", `type--${type}`, className]
1580
+ class: "vxe-date-picker--control-icon",
1581
+ onClick: clickIconEvent
1602
1582
  },
1603
- panelLabel
1583
+ [
1584
+ (0, import_vue.h)("i", {
1585
+ class: ["vxe-date-picker--date-picker-icon", getIcon().DATE_PICKER_DATE]
1586
+ })
1587
+ ]
1604
1588
  );
1605
- }
1606
- const currStyle = computeCurrStyle.value;
1607
- const inputReadonly = computeInputReadonly.value;
1608
- const inpPlaceholder = computeInpPlaceholder.value;
1609
- const isClearable = computeIsClearable.value;
1610
- const prefix = renderPrefixIcon();
1611
- const suffix = renderSuffixIcon();
1612
- return (0, import_vue.h)(
1613
- "div",
1614
- {
1615
- ref: refElem,
1616
- class: [
1617
- "vxe-date-picker",
1618
- `type--${type}`,
1619
- className,
1620
- {
1621
- [`size--${vSize}`]: vSize,
1622
- "is--prefix": !!prefix,
1623
- "is--suffix": !!suffix,
1624
- "is--visible": visiblePanel,
1625
- "is--disabled": isDisabled,
1626
- "is--active": isActivated,
1627
- "show--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
1628
- }
1629
- ],
1630
- style: currStyle,
1631
- spellcheck: false
1632
- },
1633
- [
1634
- prefix || renderEmptyElement($xeDatePicker),
1635
- (0, import_vue.h)(
1589
+ };
1590
+ const renderVN = () => {
1591
+ const { className, inputClassName, type, name, autoComplete } = props;
1592
+ const { inputValue, visiblePanel, isActivated, labelFlag } = reactData;
1593
+ const { inputLabel } = internalData;
1594
+ const vSize = computeSize.value;
1595
+ const isDisabled = computeIsDisabled.value;
1596
+ const formReadonly = computeFormReadonly.value;
1597
+ const panelLabel = computePanelLabel.value;
1598
+ if (formReadonly) {
1599
+ return (0, import_vue.h)(
1636
1600
  "div",
1637
1601
  {
1638
- class: "vxe-date-picker--wrapper"
1602
+ ref: refElem,
1603
+ class: ["vxe-date-picker--readonly", `type--${type}`, className]
1639
1604
  },
1640
- [
1641
- (0, import_vue.h)("input", {
1642
- ref: refInputTarget,
1643
- class: "vxe-date-picker--inner" + (inputClassName ? " " + inputClassName : ""),
1644
- value: labelFlag ? inputLabel : "",
1645
- name,
1646
- type: "text",
1647
- placeholder: inpPlaceholder,
1648
- readonly: inputReadonly,
1649
- disabled: isDisabled,
1650
- autocomplete: autoComplete,
1651
- onKeydown: keydownEvent,
1652
- onKeyup: keyupEvent,
1653
- onClick: clickEvent,
1654
- onInput: inputEvent,
1655
- onChange: changeEvent,
1656
- onFocus: focusEvent,
1657
- onBlur: blurEvent
1658
- })
1659
- ]
1660
- ),
1661
- suffix || renderEmptyElement($xeDatePicker),
1662
- // 下拉面板
1663
- renderPanel()
1664
- ]
1605
+ panelLabel
1606
+ );
1607
+ }
1608
+ const currStyle = computeCurrStyle.value;
1609
+ const inputReadonly = computeInputReadonly.value;
1610
+ const inpPlaceholder = computeInpPlaceholder.value;
1611
+ const isClearable = computeIsClearable.value;
1612
+ const prefix = renderPrefixIcon();
1613
+ const suffix = renderSuffixIcon();
1614
+ return (0, import_vue.h)(
1615
+ "div",
1616
+ {
1617
+ ref: refElem,
1618
+ class: [
1619
+ "vxe-date-picker",
1620
+ `type--${type}`,
1621
+ className,
1622
+ {
1623
+ [`size--${vSize}`]: vSize,
1624
+ "is--prefix": !!prefix,
1625
+ "is--suffix": !!suffix,
1626
+ "is--visible": visiblePanel,
1627
+ "is--disabled": isDisabled,
1628
+ "is--active": isActivated,
1629
+ "show--clear": isClearable && !isDisabled && !(inputValue === "" || import_xe_utils.default.eqNull(inputValue))
1630
+ }
1631
+ ],
1632
+ style: currStyle,
1633
+ spellcheck: false
1634
+ },
1635
+ [
1636
+ prefix || renderEmptyElement($xeDatePicker),
1637
+ (0, import_vue.h)(
1638
+ "div",
1639
+ {
1640
+ class: "vxe-date-picker--wrapper"
1641
+ },
1642
+ [
1643
+ (0, import_vue.h)("input", {
1644
+ ref: refInputTarget,
1645
+ class: "vxe-date-picker--inner" + (inputClassName ? " " + inputClassName : ""),
1646
+ value: labelFlag ? inputLabel : "",
1647
+ name,
1648
+ type: "text",
1649
+ placeholder: inpPlaceholder,
1650
+ readonly: inputReadonly,
1651
+ disabled: isDisabled,
1652
+ autocomplete: autoComplete,
1653
+ onKeydown: keydownEvent,
1654
+ onKeyup: keyupEvent,
1655
+ onClick: clickEvent,
1656
+ onInput: inputEvent,
1657
+ onChange: changeEvent,
1658
+ onFocus: focusEvent,
1659
+ onBlur: blurEvent
1660
+ })
1661
+ ]
1662
+ ),
1663
+ suffix || renderEmptyElement($xeDatePicker),
1664
+ // 下拉面板
1665
+ renderPanel()
1666
+ ]
1667
+ );
1668
+ };
1669
+ (0, import_vue.watch)(computePanelLabel, (val) => {
1670
+ handleInputLabel(val, true);
1671
+ });
1672
+ (0, import_vue.watch)(
1673
+ () => props.modelValue,
1674
+ () => {
1675
+ updateModelValue();
1676
+ }
1665
1677
  );
1666
- };
1667
- (0, import_vue.watch)(computePanelLabel, (val) => {
1668
- handleInputLabel(val, true);
1669
- });
1670
- (0, import_vue.watch)(
1671
- () => props.modelValue,
1672
- () => {
1673
- updateModelValue();
1674
- }
1675
- );
1676
- updateModelValue();
1677
- (0, import_vue.nextTick)(() => {
1678
- globalEvents.on($xeDatePicker, "mousedown", handleGlobalMousedownEvent);
1679
- globalEvents.on($xeDatePicker, "keydown", handleGlobalKeydownEvent);
1680
- globalEvents.on($xeDatePicker, "blur", handleGlobalBlurEvent);
1681
- globalEvents.on($xeDatePicker, "resize", handleGlobalResizeEvent);
1682
- globalEvents.on($xeDatePicker, "scroll", handleGlobalScrollEvent);
1683
- });
1684
- (0, import_vue.onMounted)(() => {
1685
- const { type, multiple, maskedConfig } = props;
1686
- if ((0, import_utils.isEnableConf)(maskedConfig)) {
1687
- if (multiple) {
1688
- errLog("vxe.error.notSupportProp", ["multiple", "masked-config.enabled=true", "masked-config.enabled=false"]);
1678
+ updateModelValue();
1679
+ (0, import_vue.nextTick)(() => {
1680
+ globalEvents.on($xeDatePicker, "mousedown", handleGlobalMousedownEvent);
1681
+ globalEvents.on($xeDatePicker, "keydown", handleGlobalKeydownEvent);
1682
+ globalEvents.on($xeDatePicker, "blur", handleGlobalBlurEvent);
1683
+ globalEvents.on($xeDatePicker, "resize", handleGlobalResizeEvent);
1684
+ globalEvents.on($xeDatePicker, "scroll", handleGlobalScrollEvent);
1685
+ });
1686
+ (0, import_vue.onMounted)(() => {
1687
+ const { type, multiple, maskedConfig } = props;
1688
+ if ((0, import_utils.isEnableConf)(maskedConfig)) {
1689
+ if (multiple) {
1690
+ errLog("vxe.error.notSupportProp", ["multiple", "masked-config.enabled=true", "masked-config.enabled=false"]);
1691
+ }
1692
+ if (!maskedTypes.includes(type)) {
1693
+ warnLog("vxe.error.notSupportProp", ["masked-config.enabled=true", `type=${type}`, `type=${maskedTypes.join("|")}`]);
1694
+ }
1689
1695
  }
1690
- if (!maskedTypes.includes(type)) {
1691
- warnLog("vxe.error.notSupportProp", ["masked-config.enabled=true", `type=${type}`, `type=${maskedTypes.join("|")}`]);
1692
- }
1693
- }
1694
- });
1695
- (0, import_vue.onUnmounted)(() => {
1696
- globalEvents.off($xeDatePicker, "mousedown");
1697
- globalEvents.off($xeDatePicker, "keydown");
1698
- globalEvents.off($xeDatePicker, "blur");
1699
- globalEvents.off($xeDatePicker, "resize");
1700
- globalEvents.off($xeDatePicker, "scroll");
1701
- import_xe_utils.default.assign(reactData, createReactData());
1702
- import_xe_utils.default.assign(internalData, createInternalData());
1703
- });
1704
- (0, import_vue.provide)("$xeDatePicker", $xeDatePicker);
1705
- $xeDatePicker.renderVN = renderVN;
1706
- return $xeDatePicker;
1707
- },
1708
- render() {
1709
- return this.renderVN();
1710
- }
1711
- });
1696
+ });
1697
+ (0, import_vue.onUnmounted)(() => {
1698
+ globalEvents.off($xeDatePicker, "mousedown");
1699
+ globalEvents.off($xeDatePicker, "keydown");
1700
+ globalEvents.off($xeDatePicker, "blur");
1701
+ globalEvents.off($xeDatePicker, "resize");
1702
+ globalEvents.off($xeDatePicker, "scroll");
1703
+ import_xe_utils.default.assign(reactData, createReactData());
1704
+ import_xe_utils.default.assign(internalData, createInternalData());
1705
+ });
1706
+ (0, import_vue.provide)("$xeDatePicker", $xeDatePicker);
1707
+ $xeDatePicker.renderVN = renderVN;
1708
+ return $xeDatePicker;
1709
+ },
1710
+ render() {
1711
+ return this.renderVN();
1712
+ }
1713
+ })
1714
+ );