vxe-pc-ui 4.5.36 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/es/calendar/src/calendar.js +1 -1
- package/es/components.js +6 -0
- package/es/date-panel/index.js +12 -0
- package/es/date-panel/src/date-panel.js +1587 -0
- package/es/date-panel/src/util.js +191 -0
- package/es/date-panel/style.css +443 -0
- package/es/date-panel/style.min.css +1 -0
- package/es/date-picker/index.js +0 -1
- package/es/date-picker/src/date-picker.js +274 -1663
- package/es/date-picker/style.css +68 -810
- package/es/date-picker/style.min.css +1 -1
- package/es/date-range-picker/index.js +12 -0
- package/es/date-range-picker/src/date-range-picker.js +1121 -0
- package/es/date-range-picker/style.css +284 -0
- package/es/date-range-picker/style.min.css +1 -0
- package/es/form/render/index.js +69 -23
- package/es/form/style.css +3 -0
- package/es/form/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/input/src/input.js +1 -1
- package/es/language/ar-EG.js +4 -1
- package/es/language/de-DE.js +4 -1
- package/es/language/en-US.js +4 -1
- package/es/language/es-ES.js +4 -1
- package/es/language/fr-FR.d.ts +2 -0
- package/es/language/fr-FR.js +4 -1
- package/es/language/hu-HU.js +4 -1
- package/es/language/hy-AM.d.ts +2 -0
- package/es/language/hy-AM.js +4 -1
- package/es/language/id-ID.d.ts +2 -0
- package/es/language/id-ID.js +4 -1
- package/es/language/it-IT.d.ts +2 -0
- package/es/language/it-IT.js +4 -1
- package/es/language/ja-JP.js +4 -1
- package/es/language/ko-KR.js +4 -1
- package/es/language/ms-MY.d.ts +2 -0
- package/es/language/ms-MY.js +711 -0
- package/es/language/nb-NO.d.ts +2 -0
- package/es/language/nb-NO.js +4 -1
- package/es/language/pt-BR.js +4 -1
- package/es/language/ru-RU.js +4 -1
- package/es/language/th-TH.d.ts +2 -0
- package/es/language/th-TH.js +4 -1
- package/es/language/ug-CN.d.ts +2 -0
- package/es/language/ug-CN.js +4 -1
- package/es/language/uk-UA.js +4 -1
- package/es/language/uz-UZ.d.ts +2 -0
- package/es/language/uz-UZ.js +711 -0
- package/es/language/vi-VN.d.ts +2 -0
- package/es/language/vi-VN.js +4 -1
- package/es/language/zh-CHT.d.ts +2 -0
- package/es/language/zh-CHT.js +4 -1
- package/es/language/zh-CN.js +4 -1
- package/es/print/src/print.js +4 -0
- package/es/print/src/util.js +46 -3
- package/es/pulldown/style.css +15 -0
- package/es/pulldown/style.min.css +1 -1
- package/es/select/style.css +15 -0
- package/es/select/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table-select/style.css +15 -0
- package/es/table-select/style.min.css +1 -1
- package/es/tree-select/style.css +15 -0
- package/es/tree-select/style.min.css +1 -1
- package/es/ui/index.js +31 -6
- package/es/ui/src/log.js +1 -1
- package/es/vxe-date-panel/index.js +3 -0
- package/es/vxe-date-panel/style.css +443 -0
- package/es/vxe-date-panel/style.min.css +1 -0
- package/es/vxe-date-picker/style.css +68 -810
- package/es/vxe-date-picker/style.min.css +1 -1
- package/es/vxe-date-range-picker/index.js +3 -0
- package/es/vxe-date-range-picker/style.css +284 -0
- package/es/vxe-date-range-picker/style.min.css +1 -0
- package/es/vxe-form/style.css +3 -0
- package/es/vxe-form/style.min.css +1 -1
- package/es/vxe-pulldown/style.css +15 -0
- package/es/vxe-pulldown/style.min.css +1 -1
- package/es/vxe-select/style.css +15 -0
- package/es/vxe-select/style.min.css +1 -1
- package/es/vxe-table-select/style.css +15 -0
- package/es/vxe-table-select/style.min.css +1 -1
- package/es/vxe-tree-select/style.css +15 -0
- package/es/vxe-tree-select/style.min.css +1 -1
- package/lib/calendar/src/calendar.js +1 -1
- package/lib/calendar/src/calendar.min.js +1 -1
- package/lib/components.js +25 -1
- package/lib/components.min.js +1 -1
- package/lib/date-panel/index.js +19 -0
- package/lib/date-panel/index.min.js +1 -0
- package/lib/date-panel/src/date-panel.js +1667 -0
- package/lib/date-panel/src/date-panel.min.js +1 -0
- package/lib/date-panel/src/util.js +219 -0
- package/lib/date-panel/src/util.min.js +1 -0
- package/lib/date-panel/style/index.js +1 -0
- package/lib/date-panel/style/style.css +443 -0
- package/lib/date-panel/style/style.min.css +1 -0
- package/lib/date-picker/index.js +0 -1
- package/lib/date-picker/index.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +288 -1717
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/date-picker/style/style.css +68 -810
- package/lib/date-picker/style/style.min.css +1 -1
- package/lib/date-range-picker/index.js +19 -0
- package/lib/date-range-picker/index.min.js +1 -0
- package/lib/date-range-picker/src/date-range-picker.js +1194 -0
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -0
- package/lib/date-range-picker/style/index.js +1 -0
- package/lib/date-range-picker/style/style.css +284 -0
- package/lib/date-range-picker/style/style.min.css +1 -0
- package/lib/form/render/index.js +77 -23
- package/lib/form/render/index.min.js +1 -1
- package/lib/form/style/style.css +3 -0
- package/lib/form/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +3016 -1260
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +1 -1
- package/lib/input/src/input.min.js +1 -1
- package/lib/language/ar-EG.d.ts +2 -0
- package/lib/language/ar-EG.js +4 -1
- package/lib/language/ar-EG.min.js +1 -1
- package/lib/language/ar-EG.umd.js +731 -0
- package/lib/language/de-DE.d.ts +2 -0
- package/lib/language/de-DE.js +4 -1
- package/lib/language/de-DE.min.js +1 -1
- package/lib/language/de-DE.umd.js +731 -0
- package/lib/language/en-US.js +4 -1
- package/lib/language/en-US.min.js +1 -1
- package/lib/language/en-US.umd.js +4 -1
- package/lib/language/es-ES.js +4 -1
- package/lib/language/es-ES.min.js +1 -1
- package/lib/language/es-ES.umd.js +4 -1
- package/lib/language/fr-FR.d.ts +2 -0
- package/lib/language/fr-FR.js +4 -1
- package/lib/language/fr-FR.min.js +1 -1
- package/lib/language/fr-FR.umd.js +731 -0
- package/lib/language/hu-HU.js +4 -1
- package/lib/language/hu-HU.min.js +1 -1
- package/lib/language/hu-HU.umd.js +4 -1
- package/lib/language/hy-AM.d.ts +2 -0
- package/lib/language/hy-AM.js +4 -1
- package/lib/language/hy-AM.min.js +1 -1
- package/lib/language/hy-AM.umd.js +731 -0
- package/lib/language/id-ID.d.ts +2 -0
- package/lib/language/id-ID.js +4 -1
- package/lib/language/id-ID.min.js +1 -1
- package/lib/language/id-ID.umd.js +731 -0
- package/lib/language/it-IT.d.ts +2 -0
- package/lib/language/it-IT.js +4 -1
- package/lib/language/it-IT.min.js +1 -1
- package/lib/language/it-IT.umd.js +731 -0
- package/lib/language/ja-JP.js +4 -1
- package/lib/language/ja-JP.min.js +1 -1
- package/lib/language/ja-JP.umd.js +4 -1
- package/lib/language/ko-KR.js +4 -1
- package/lib/language/ko-KR.min.js +1 -1
- package/lib/language/ko-KR.umd.js +4 -1
- package/lib/language/ms-MY.d.ts +2 -0
- package/lib/language/ms-MY.js +717 -0
- package/lib/language/ms-MY.min.js +1 -0
- package/lib/language/ms-MY.umd.js +731 -0
- package/lib/language/nb-NO.d.ts +2 -0
- package/lib/language/nb-NO.js +4 -1
- package/lib/language/nb-NO.min.js +1 -1
- package/lib/language/nb-NO.umd.js +731 -0
- package/lib/language/pt-BR.js +4 -1
- package/lib/language/pt-BR.min.js +1 -1
- package/lib/language/pt-BR.umd.js +4 -1
- package/lib/language/ru-RU.js +4 -1
- package/lib/language/ru-RU.min.js +1 -1
- package/lib/language/ru-RU.umd.js +4 -1
- package/lib/language/th-TH.d.ts +2 -0
- package/lib/language/th-TH.js +4 -1
- package/lib/language/th-TH.min.js +1 -1
- package/lib/language/th-TH.umd.js +731 -0
- package/lib/language/ug-CN.d.ts +2 -0
- package/lib/language/ug-CN.js +4 -1
- package/lib/language/ug-CN.min.js +1 -1
- package/lib/language/ug-CN.umd.js +731 -0
- package/lib/language/uk-UA.js +4 -1
- package/lib/language/uk-UA.min.js +1 -1
- package/lib/language/uk-UA.umd.js +4 -1
- package/lib/language/uz-UZ.d.ts +2 -0
- package/lib/language/uz-UZ.js +717 -0
- package/lib/language/uz-UZ.min.js +1 -0
- package/lib/language/uz-UZ.umd.js +731 -0
- package/lib/language/vi-VN.d.ts +2 -0
- package/lib/language/vi-VN.js +4 -1
- package/lib/language/vi-VN.min.js +1 -1
- package/lib/language/vi-VN.umd.js +731 -0
- package/lib/language/zh-CHT.d.ts +2 -0
- package/lib/language/zh-CHT.js +4 -1
- package/lib/language/zh-CHT.min.js +1 -1
- package/lib/language/zh-CHT.umd.js +731 -0
- package/lib/language/zh-CN.js +4 -1
- package/lib/language/zh-CN.min.js +1 -1
- package/lib/language/zh-CN.umd.js +4 -1
- package/lib/language/zh-TC.min.js +1 -1
- package/lib/print/src/print.js +4 -0
- package/lib/print/src/print.min.js +1 -1
- package/lib/print/src/util.js +45 -2
- package/lib/print/src/util.min.js +1 -1
- package/lib/pulldown/style/style.css +15 -0
- package/lib/pulldown/style/style.min.css +1 -1
- package/lib/select/style/style.css +15 -0
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table-select/style/style.css +15 -0
- package/lib/table-select/style/style.min.css +1 -1
- package/lib/tree-select/style/style.css +15 -0
- package/lib/tree-select/style/style.min.css +1 -1
- package/lib/ui/index.js +31 -6
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-date-panel/index.js +22 -0
- package/lib/vxe-date-panel/index.min.js +1 -0
- package/lib/vxe-date-panel/style/index.js +1 -0
- package/lib/vxe-date-panel/style/style.css +443 -0
- package/lib/vxe-date-panel/style/style.min.css +1 -0
- package/lib/vxe-date-picker/style/style.css +68 -810
- package/lib/vxe-date-picker/style/style.min.css +1 -1
- package/lib/vxe-date-range-picker/index.js +22 -0
- package/lib/vxe-date-range-picker/index.min.js +1 -0
- package/lib/vxe-date-range-picker/style/index.js +1 -0
- package/lib/vxe-date-range-picker/style/style.css +284 -0
- package/lib/vxe-date-range-picker/style/style.min.css +1 -0
- package/lib/vxe-form/style/style.css +3 -0
- package/lib/vxe-form/style/style.min.css +1 -1
- package/lib/vxe-pulldown/style/style.css +15 -0
- package/lib/vxe-pulldown/style/style.min.css +1 -1
- package/lib/vxe-select/style/style.css +15 -0
- package/lib/vxe-select/style/style.min.css +1 -1
- package/lib/vxe-table-select/style/style.css +15 -0
- package/lib/vxe-table-select/style/style.min.css +1 -1
- package/lib/vxe-tree-select/style/style.css +15 -0
- package/lib/vxe-tree-select/style/style.min.css +1 -1
- package/package.json +4 -5
- package/packages/calendar/src/calendar.ts +10 -10
- package/packages/components.ts +6 -0
- package/packages/date-panel/index.ts +16 -0
- package/packages/date-panel/src/date-panel.ts +1654 -0
- package/packages/date-panel/src/util.ts +212 -0
- package/packages/date-picker/index.ts +0 -1
- package/packages/date-picker/src/date-picker.ts +298 -1697
- package/packages/date-range-picker/index.ts +16 -0
- package/packages/date-range-picker/src/date-range-picker.ts +1196 -0
- package/packages/form/render/index.ts +76 -22
- package/packages/input/src/input.ts +15 -15
- package/packages/language/ar-EG.ts +4 -1
- package/packages/language/de-DE.ts +4 -1
- package/packages/language/en-US.ts +4 -1
- package/packages/language/es-ES.ts +4 -1
- package/packages/language/fr-FR.ts +4 -1
- package/packages/language/hu-HU.ts +4 -1
- package/packages/language/hy-AM.ts +4 -1
- package/packages/language/id-ID.ts +4 -1
- package/packages/language/it-IT.ts +4 -1
- package/packages/language/ja-JP.ts +4 -1
- package/packages/language/ko-KR.ts +4 -1
- package/packages/language/ms-MY.ts +711 -0
- package/packages/language/nb-NO.ts +4 -1
- package/packages/language/pt-BR.ts +4 -1
- package/packages/language/ru-RU.ts +4 -1
- package/packages/language/th-TH.ts +4 -1
- package/packages/language/ug-CN.ts +4 -1
- package/packages/language/uk-UA.ts +4 -1
- package/packages/language/uz-UZ.ts +711 -0
- package/packages/language/vi-VN.ts +4 -1
- package/packages/language/zh-CHT.ts +4 -1
- package/packages/language/zh-CN.ts +4 -1
- package/packages/print/src/print.ts +4 -0
- package/packages/print/src/util.ts +47 -4
- package/packages/ui/index.ts +30 -5
- package/styles/all.scss +2 -0
- package/styles/components/date-panel.scss +491 -0
- package/styles/components/date-picker.scss +62 -652
- package/styles/components/date-range-picker.scss +284 -0
- package/styles/components/form.scss +3 -0
- package/styles/components/pulldown.scss +10 -0
- package/styles/components/select.scss +8 -0
- package/styles/components/table-select.scss +8 -0
- package/styles/components/tree-select.scss +8 -0
- package/styles/helpers/baseMixin.scss +13 -0
- package/types/all.d.ts +6 -0
- package/types/components/button-group.d.ts +1 -1
- package/types/components/column.d.ts +9 -0
- package/types/components/date-panel.d.ts +240 -0
- package/types/components/date-picker.d.ts +35 -142
- package/types/components/date-range-picker.d.ts +267 -0
- package/types/components/form-item.d.ts +4 -0
- package/types/components/print.d.ts +8 -0
- package/types/ui/commands.d.ts +28 -2
- package/types/ui/global-config.d.ts +4 -0
- package/es/date-picker/src/util.js +0 -41
- package/lib/date-picker/src/util.js +0 -46
- package/lib/date-picker/src/util.min.js +0 -1
- package/lib/language/zh-TC.umd.js +0 -23
- package/packages/date-picker/src/util.ts +0 -42
- /package/es/icon/{iconfont.1746417522210.ttf → iconfont.1746801282055.ttf} +0 -0
- /package/es/icon/{iconfont.1746417522210.woff → iconfont.1746801282055.woff} +0 -0
- /package/es/icon/{iconfont.1746417522210.woff2 → iconfont.1746801282055.woff2} +0 -0
- /package/es/{iconfont.1746417522210.ttf → iconfont.1746801282055.ttf} +0 -0
- /package/es/{iconfont.1746417522210.woff → iconfont.1746801282055.woff} +0 -0
- /package/es/{iconfont.1746417522210.woff2 → iconfont.1746801282055.woff2} +0 -0
- /package/es/language/{zh-TC.d.ts → ar-EG.d.ts} +0 -0
- /package/{lib/language/zh-TC.d.ts → es/language/de-DE.d.ts} +0 -0
- /package/lib/icon/style/{iconfont.1746417522210.ttf → iconfont.1746801282055.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1746417522210.woff → iconfont.1746801282055.woff} +0 -0
- /package/lib/icon/style/{iconfont.1746417522210.woff2 → iconfont.1746801282055.woff2} +0 -0
- /package/lib/{iconfont.1746417522210.ttf → iconfont.1746801282055.ttf} +0 -0
- /package/lib/{iconfont.1746417522210.woff → iconfont.1746801282055.woff} +0 -0
- /package/lib/{iconfont.1746417522210.woff2 → iconfont.1746801282055.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -1907,7 +1907,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1907
1907
|
CollapsePane: function() { return /* reexport */ CollapsePane; },
|
|
1908
1908
|
ColorPicker: function() { return /* reexport */ ColorPicker; },
|
|
1909
1909
|
Countdown: function() { return /* reexport */ Countdown; },
|
|
1910
|
+
DatePanel: function() { return /* reexport */ DatePanel; },
|
|
1910
1911
|
DatePicker: function() { return /* reexport */ DatePicker; },
|
|
1912
|
+
DateRangePicker: function() { return /* reexport */ DateRangePicker; },
|
|
1911
1913
|
Drawer: function() { return /* reexport */ Drawer; },
|
|
1912
1914
|
DrawerController: function() { return /* reexport */ DrawerController; },
|
|
1913
1915
|
Empty: function() { return /* reexport */ Empty; },
|
|
@@ -1993,7 +1995,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1993
1995
|
VxeColorPicker: function() { return /* reexport */ VxeColorPicker; },
|
|
1994
1996
|
VxeCore: function() { return /* reexport */ VxeCore; },
|
|
1995
1997
|
VxeCountdown: function() { return /* reexport */ VxeCountdown; },
|
|
1998
|
+
VxeDatePanel: function() { return /* reexport */ VxeDatePanel; },
|
|
1996
1999
|
VxeDatePicker: function() { return /* reexport */ VxeDatePicker; },
|
|
2000
|
+
VxeDateRangePicker: function() { return /* reexport */ VxeDateRangePicker; },
|
|
1997
2001
|
VxeDrawer: function() { return /* reexport */ VxeDrawer; },
|
|
1998
2002
|
VxeEmpty: function() { return /* reexport */ VxeEmpty; },
|
|
1999
2003
|
VxeForm: function() { return /* reexport */ VxeForm; },
|
|
@@ -2129,7 +2133,9 @@ __webpack_require__.d(components_namespaceObject, {
|
|
|
2129
2133
|
CollapsePane: function() { return CollapsePane; },
|
|
2130
2134
|
ColorPicker: function() { return ColorPicker; },
|
|
2131
2135
|
Countdown: function() { return Countdown; },
|
|
2136
|
+
DatePanel: function() { return DatePanel; },
|
|
2132
2137
|
DatePicker: function() { return DatePicker; },
|
|
2138
|
+
DateRangePicker: function() { return DateRangePicker; },
|
|
2133
2139
|
Drawer: function() { return Drawer; },
|
|
2134
2140
|
DrawerController: function() { return DrawerController; },
|
|
2135
2141
|
Empty: function() { return Empty; },
|
|
@@ -2215,7 +2221,9 @@ __webpack_require__.d(components_namespaceObject, {
|
|
|
2215
2221
|
VxeColorPicker: function() { return VxeColorPicker; },
|
|
2216
2222
|
VxeCore: function() { return VxeCore; },
|
|
2217
2223
|
VxeCountdown: function() { return VxeCountdown; },
|
|
2224
|
+
VxeDatePanel: function() { return VxeDatePanel; },
|
|
2218
2225
|
VxeDatePicker: function() { return VxeDatePicker; },
|
|
2226
|
+
VxeDateRangePicker: function() { return VxeDateRangePicker; },
|
|
2219
2227
|
VxeDrawer: function() { return VxeDrawer; },
|
|
2220
2228
|
VxeEmpty: function() { return VxeEmpty; },
|
|
2221
2229
|
VxeForm: function() { return VxeForm; },
|
|
@@ -2346,7 +2354,7 @@ if (typeof window !== 'undefined') {
|
|
|
2346
2354
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
2347
2355
|
var es_array_push = __webpack_require__(4114);
|
|
2348
2356
|
;// CONCATENATED MODULE: ./node_modules/@vxe-ui/core/es/src/core.js
|
|
2349
|
-
const coreVersion = "4.1.
|
|
2357
|
+
const coreVersion = "4.1.3";
|
|
2350
2358
|
const VxeCore = {
|
|
2351
2359
|
coreVersion,
|
|
2352
2360
|
uiVersion: '',
|
|
@@ -2917,7 +2925,7 @@ function createLog(type, name) {
|
|
|
2917
2925
|
return msg;
|
|
2918
2926
|
};
|
|
2919
2927
|
}
|
|
2920
|
-
const version = "4.1.
|
|
2928
|
+
const version = "4.1.3";
|
|
2921
2929
|
const log = {
|
|
2922
2930
|
create: createLog,
|
|
2923
2931
|
warn: createLog('warn', `v${version}`),
|
|
@@ -3694,6 +3702,9 @@ setTheme();
|
|
|
3694
3702
|
datePicker: {
|
|
3695
3703
|
yearTitle: '{0} 年'
|
|
3696
3704
|
},
|
|
3705
|
+
dateRangePicker: {
|
|
3706
|
+
pleaseRange: '请选择开始日期与结束日期'
|
|
3707
|
+
},
|
|
3697
3708
|
input: {
|
|
3698
3709
|
date: {
|
|
3699
3710
|
m1: '01 月',
|
|
@@ -3721,7 +3732,7 @@ setTheme();
|
|
|
3721
3732
|
year: 'yyyy'
|
|
3722
3733
|
},
|
|
3723
3734
|
weeks: {
|
|
3724
|
-
w: '
|
|
3735
|
+
w: '',
|
|
3725
3736
|
w0: '周日',
|
|
3726
3737
|
w1: '周一',
|
|
3727
3738
|
w2: '周二',
|
|
@@ -4202,14 +4213,14 @@ function checkDynamic() {
|
|
|
4202
4213
|
}
|
|
4203
4214
|
;// CONCATENATED MODULE: ./packages/ui/src/log.ts
|
|
4204
4215
|
|
|
4205
|
-
const log_version = `ui v${"4.
|
|
4216
|
+
const log_version = `ui v${"4.6.1"}`;
|
|
4206
4217
|
const warnLog = log.create('warn', log_version);
|
|
4207
4218
|
const errLog = log.create('error', log_version);
|
|
4208
4219
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
4209
4220
|
|
|
4210
4221
|
|
|
4211
4222
|
|
|
4212
|
-
const ui_version = "4.
|
|
4223
|
+
const ui_version = "4.6.1";
|
|
4213
4224
|
index_esm_VxeUI.uiVersion = ui_version;
|
|
4214
4225
|
index_esm_VxeUI.dynamicApp = dynamicApp;
|
|
4215
4226
|
function config(options) {
|
|
@@ -4281,22 +4292,45 @@ setConfig({
|
|
|
4281
4292
|
showColorExtractor: true,
|
|
4282
4293
|
showQuick: true
|
|
4283
4294
|
},
|
|
4284
|
-
|
|
4285
|
-
// size: null,
|
|
4286
|
-
// transfer: false
|
|
4295
|
+
datePanel: {
|
|
4287
4296
|
// parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
|
|
4288
4297
|
// labelFormat: '',
|
|
4289
4298
|
// valueFormat: '',
|
|
4290
4299
|
startDate: new Date(1900, 0, 1),
|
|
4291
4300
|
endDate: new Date(2100, 0, 1),
|
|
4292
4301
|
startDay: 1,
|
|
4302
|
+
selectDay: 1
|
|
4303
|
+
},
|
|
4304
|
+
datePicker: {
|
|
4305
|
+
// size: null,
|
|
4306
|
+
// transfer: false,
|
|
4307
|
+
shortcutConfig: {
|
|
4308
|
+
// position: 'left',
|
|
4309
|
+
align: 'left',
|
|
4310
|
+
mode: 'text',
|
|
4311
|
+
autoClose: true
|
|
4312
|
+
},
|
|
4313
|
+
startDay: 1,
|
|
4293
4314
|
selectDay: 1,
|
|
4315
|
+
autoClose: true,
|
|
4316
|
+
showClearButton: null,
|
|
4317
|
+
showConfirmButton: null
|
|
4318
|
+
},
|
|
4319
|
+
dateRangePicker: {
|
|
4320
|
+
// size: null,
|
|
4321
|
+
// transfer: false,
|
|
4294
4322
|
shortcutConfig: {
|
|
4295
4323
|
// position: 'left',
|
|
4296
4324
|
align: 'left',
|
|
4297
4325
|
mode: 'text',
|
|
4298
4326
|
autoClose: true
|
|
4299
|
-
}
|
|
4327
|
+
},
|
|
4328
|
+
startDay: 1,
|
|
4329
|
+
selectDay: 1,
|
|
4330
|
+
separator: ' ~ ',
|
|
4331
|
+
autoClose: true,
|
|
4332
|
+
showClearButton: null,
|
|
4333
|
+
showConfirmButton: null
|
|
4300
4334
|
},
|
|
4301
4335
|
drawer: {
|
|
4302
4336
|
// size: null,
|
|
@@ -4449,7 +4483,9 @@ setConfig({
|
|
|
4449
4483
|
// pageSizes: [10, 15, 20, 50, 100],
|
|
4450
4484
|
// layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
|
|
4451
4485
|
},
|
|
4452
|
-
print: {
|
|
4486
|
+
print: {
|
|
4487
|
+
pageStyle: {}
|
|
4488
|
+
},
|
|
4453
4489
|
passwordInput: {
|
|
4454
4490
|
controls: true
|
|
4455
4491
|
},
|
|
@@ -7182,7 +7218,7 @@ dynamicApp.use(VxeButtonGroup);
|
|
|
7182
7218
|
index_esm_VxeUI.component(button_group);
|
|
7183
7219
|
const ButtonGroup = VxeButtonGroup;
|
|
7184
7220
|
/* harmony default export */ var packages_button_group = (VxeButtonGroup);
|
|
7185
|
-
;// CONCATENATED MODULE: ./packages/date-
|
|
7221
|
+
;// CONCATENATED MODULE: ./packages/date-panel/src/util.ts
|
|
7186
7222
|
|
|
7187
7223
|
function toStringTimeDate(str) {
|
|
7188
7224
|
if (str) {
|
|
@@ -7221,6 +7257,173 @@ function getDateQuarter(date) {
|
|
|
7221
7257
|
}
|
|
7222
7258
|
return 4;
|
|
7223
7259
|
}
|
|
7260
|
+
const parseDateValue = (val, type, options) => {
|
|
7261
|
+
const {
|
|
7262
|
+
valueFormat
|
|
7263
|
+
} = options;
|
|
7264
|
+
if (val) {
|
|
7265
|
+
if (type === 'time') {
|
|
7266
|
+
return toStringTimeDate(val);
|
|
7267
|
+
}
|
|
7268
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val) || /^[0-9]{11,15}$/.test(`${val}`)) {
|
|
7269
|
+
return new Date(Number(val));
|
|
7270
|
+
}
|
|
7271
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val)) {
|
|
7272
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().last(val.split(',')), valueFormat);
|
|
7273
|
+
}
|
|
7274
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(val, valueFormat);
|
|
7275
|
+
}
|
|
7276
|
+
return null;
|
|
7277
|
+
};
|
|
7278
|
+
const parseDateString = (val, type, options) => {
|
|
7279
|
+
const dValue = parseDateValue(val, type, options);
|
|
7280
|
+
return dValue ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dValue, options.valueFormat) : '';
|
|
7281
|
+
};
|
|
7282
|
+
function parseDateObj(val, type, options) {
|
|
7283
|
+
const {
|
|
7284
|
+
labelFormat,
|
|
7285
|
+
firstDay
|
|
7286
|
+
} = options;
|
|
7287
|
+
let dValue = null;
|
|
7288
|
+
let dLabel = '';
|
|
7289
|
+
if (val) {
|
|
7290
|
+
dValue = parseDateValue(val, type, options);
|
|
7291
|
+
}
|
|
7292
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isValidDate(dValue)) {
|
|
7293
|
+
dLabel = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dValue, labelFormat, {
|
|
7294
|
+
firstDay
|
|
7295
|
+
});
|
|
7296
|
+
// 周选择器,由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年,例如
|
|
7297
|
+
// '2024-12-31' 'yyyy-MM-dd W' >> '2024-12-31 1'
|
|
7298
|
+
// '2025-01-01' 'yyyy-MM-dd W' >> '2025-01-01 1'
|
|
7299
|
+
if (labelFormat && type === 'week') {
|
|
7300
|
+
const weekNum = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(dValue, firstDay);
|
|
7301
|
+
const weekDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(dValue, 0, weekNum === 1 ? (6 + firstDay) % 7 : firstDay, firstDay);
|
|
7302
|
+
const weekFullYear = weekDate.getFullYear();
|
|
7303
|
+
if (weekFullYear !== dValue.getFullYear()) {
|
|
7304
|
+
const yyIndex = labelFormat.indexOf('yyyy');
|
|
7305
|
+
if (yyIndex > -1) {
|
|
7306
|
+
const yyNum = Number(dLabel.substring(yyIndex, yyIndex + 4));
|
|
7307
|
+
if (yyNum && !isNaN(yyNum)) {
|
|
7308
|
+
dLabel = dLabel.replace(`${yyNum}`, `${weekFullYear}`);
|
|
7309
|
+
}
|
|
7310
|
+
}
|
|
7311
|
+
}
|
|
7312
|
+
}
|
|
7313
|
+
} else {
|
|
7314
|
+
dValue = null;
|
|
7315
|
+
}
|
|
7316
|
+
return {
|
|
7317
|
+
label: dLabel,
|
|
7318
|
+
value: dValue
|
|
7319
|
+
};
|
|
7320
|
+
}
|
|
7321
|
+
function getDateByCode(code, val, type, options) {
|
|
7322
|
+
const {
|
|
7323
|
+
valueFormat,
|
|
7324
|
+
firstDay
|
|
7325
|
+
} = options;
|
|
7326
|
+
let dValue = null;
|
|
7327
|
+
const value = (code === 'prev' || code === 'next' ? new Date() : val ? parseDateValue(val, type, options) : null) || new Date();
|
|
7328
|
+
switch (code) {
|
|
7329
|
+
case 'prev':
|
|
7330
|
+
case 'next':
|
|
7331
|
+
case 'minus':
|
|
7332
|
+
case 'plus':
|
|
7333
|
+
{
|
|
7334
|
+
const offsetNum = code === 'plus' || code === 'next' ? 1 : -1;
|
|
7335
|
+
switch (type) {
|
|
7336
|
+
case 'date':
|
|
7337
|
+
case 'datetime':
|
|
7338
|
+
dValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(value, offsetNum);
|
|
7339
|
+
break;
|
|
7340
|
+
case 'week':
|
|
7341
|
+
dValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(value, offsetNum, firstDay, firstDay);
|
|
7342
|
+
break;
|
|
7343
|
+
case 'month':
|
|
7344
|
+
dValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(value, offsetNum);
|
|
7345
|
+
break;
|
|
7346
|
+
case 'quarter':
|
|
7347
|
+
dValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(value, offsetNum);
|
|
7348
|
+
break;
|
|
7349
|
+
case 'year':
|
|
7350
|
+
dValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(value, offsetNum);
|
|
7351
|
+
break;
|
|
7352
|
+
}
|
|
7353
|
+
break;
|
|
7354
|
+
}
|
|
7355
|
+
default:
|
|
7356
|
+
dValue = new Date();
|
|
7357
|
+
break;
|
|
7358
|
+
}
|
|
7359
|
+
return {
|
|
7360
|
+
value: dValue ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dValue, valueFormat) : ''
|
|
7361
|
+
};
|
|
7362
|
+
}
|
|
7363
|
+
const rangeDateOffsetNumMaps = {
|
|
7364
|
+
last180: -180,
|
|
7365
|
+
last90: -90,
|
|
7366
|
+
last60: -60,
|
|
7367
|
+
last30: -30,
|
|
7368
|
+
last7: -7,
|
|
7369
|
+
last3: -3,
|
|
7370
|
+
last1: -1
|
|
7371
|
+
};
|
|
7372
|
+
function getRangeDateOffsetNum(code) {
|
|
7373
|
+
return rangeDateOffsetNumMaps[code] || 0;
|
|
7374
|
+
}
|
|
7375
|
+
function getRangeDateByCode(code, val, type, options) {
|
|
7376
|
+
const {
|
|
7377
|
+
valueFormat,
|
|
7378
|
+
firstDay
|
|
7379
|
+
} = options;
|
|
7380
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(val)) {
|
|
7381
|
+
val = val.join('');
|
|
7382
|
+
}
|
|
7383
|
+
const value = (val ? parseDateValue(val, type, options) : null) || new Date();
|
|
7384
|
+
let sValue = null;
|
|
7385
|
+
const eValue = value;
|
|
7386
|
+
switch (code) {
|
|
7387
|
+
case 'last1':
|
|
7388
|
+
case 'last3':
|
|
7389
|
+
case 'last7':
|
|
7390
|
+
case 'last30':
|
|
7391
|
+
case 'last60':
|
|
7392
|
+
case 'last90':
|
|
7393
|
+
case 'last180':
|
|
7394
|
+
{
|
|
7395
|
+
const offsetNum = getRangeDateOffsetNum(code);
|
|
7396
|
+
switch (type) {
|
|
7397
|
+
case 'date':
|
|
7398
|
+
case 'datetime':
|
|
7399
|
+
sValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(value, offsetNum);
|
|
7400
|
+
break;
|
|
7401
|
+
case 'week':
|
|
7402
|
+
sValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(value, offsetNum, firstDay, firstDay);
|
|
7403
|
+
break;
|
|
7404
|
+
case 'month':
|
|
7405
|
+
sValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(value, offsetNum);
|
|
7406
|
+
break;
|
|
7407
|
+
case 'quarter':
|
|
7408
|
+
sValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(value, offsetNum);
|
|
7409
|
+
break;
|
|
7410
|
+
case 'year':
|
|
7411
|
+
sValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(value, offsetNum);
|
|
7412
|
+
break;
|
|
7413
|
+
}
|
|
7414
|
+
break;
|
|
7415
|
+
}
|
|
7416
|
+
default:
|
|
7417
|
+
sValue = new Date();
|
|
7418
|
+
break;
|
|
7419
|
+
}
|
|
7420
|
+
const startValue = sValue ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(sValue, valueFormat) : '';
|
|
7421
|
+
const endValue = eValue ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(eValue, valueFormat) : '';
|
|
7422
|
+
return {
|
|
7423
|
+
startValue,
|
|
7424
|
+
endValue
|
|
7425
|
+
};
|
|
7426
|
+
}
|
|
7224
7427
|
;// CONCATENATED MODULE: ./packages/calendar/src/calendar.ts
|
|
7225
7428
|
|
|
7226
7429
|
|
|
@@ -14399,130 +14602,73 @@ dynamicApp.use(VxeCountdown);
|
|
|
14399
14602
|
index_esm_VxeUI.component(countdown);
|
|
14400
14603
|
const Countdown = VxeCountdown;
|
|
14401
14604
|
/* harmony default export */ var packages_countdown = (VxeCountdown);
|
|
14402
|
-
;// CONCATENATED MODULE: ./packages/date-
|
|
14403
|
-
|
|
14404
|
-
|
|
14605
|
+
;// CONCATENATED MODULE: ./packages/date-panel/src/date-panel.ts
|
|
14405
14606
|
|
|
14406
14607
|
|
|
14407
14608
|
|
|
14408
14609
|
|
|
14409
14610
|
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
/* harmony default export */ var date_picker = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
14413
|
-
name: 'VxeDatePicker',
|
|
14611
|
+
/* harmony default export */ var date_panel = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
14612
|
+
name: 'VxeDatePanel',
|
|
14414
14613
|
props: {
|
|
14415
14614
|
modelValue: [String, Number, Date],
|
|
14416
|
-
immediate: {
|
|
14417
|
-
type: Boolean,
|
|
14418
|
-
default: true
|
|
14419
|
-
},
|
|
14420
|
-
name: String,
|
|
14421
14615
|
type: {
|
|
14422
14616
|
type: String,
|
|
14423
14617
|
default: 'date'
|
|
14424
14618
|
},
|
|
14425
|
-
clearable: {
|
|
14426
|
-
type: Boolean,
|
|
14427
|
-
default: () => getConfig().datePicker.clearable
|
|
14428
|
-
},
|
|
14429
|
-
readonly: {
|
|
14430
|
-
type: Boolean,
|
|
14431
|
-
default: null
|
|
14432
|
-
},
|
|
14433
|
-
disabled: {
|
|
14434
|
-
type: Boolean,
|
|
14435
|
-
default: null
|
|
14436
|
-
},
|
|
14437
|
-
placeholder: String,
|
|
14438
|
-
maxLength: [String, Number],
|
|
14439
|
-
autoComplete: {
|
|
14440
|
-
type: String,
|
|
14441
|
-
default: 'off'
|
|
14442
|
-
},
|
|
14443
|
-
align: String,
|
|
14444
|
-
form: String,
|
|
14445
14619
|
className: String,
|
|
14446
14620
|
size: {
|
|
14447
14621
|
type: String,
|
|
14448
|
-
default: () => getConfig().
|
|
14622
|
+
default: () => getConfig().datePanel.size || getConfig().size
|
|
14449
14623
|
},
|
|
14450
14624
|
multiple: Boolean,
|
|
14451
14625
|
limitCount: {
|
|
14452
14626
|
type: [String, Number],
|
|
14453
|
-
default: () => getConfig().
|
|
14627
|
+
default: () => getConfig().datePanel.limitCount
|
|
14454
14628
|
},
|
|
14455
14629
|
// date、week、month、quarter、year
|
|
14456
14630
|
startDate: {
|
|
14457
14631
|
type: [String, Number, Date],
|
|
14458
|
-
default: () => getConfig().
|
|
14632
|
+
default: () => getConfig().datePanel.startDate
|
|
14459
14633
|
},
|
|
14460
14634
|
endDate: {
|
|
14461
14635
|
type: [String, Number, Date],
|
|
14462
|
-
default: () => getConfig().
|
|
14636
|
+
default: () => getConfig().datePanel.endDate
|
|
14463
14637
|
},
|
|
14464
14638
|
minDate: [String, Number, Date],
|
|
14465
14639
|
maxDate: [String, Number, Date],
|
|
14466
14640
|
startDay: {
|
|
14467
14641
|
type: [String, Number],
|
|
14468
|
-
default: () => getConfig().
|
|
14642
|
+
default: () => getConfig().datePanel.startDay
|
|
14469
14643
|
},
|
|
14470
14644
|
labelFormat: String,
|
|
14471
14645
|
valueFormat: String,
|
|
14472
|
-
editable: {
|
|
14473
|
-
type: Boolean,
|
|
14474
|
-
default: true
|
|
14475
|
-
},
|
|
14476
14646
|
festivalMethod: {
|
|
14477
14647
|
type: Function,
|
|
14478
|
-
default: () => getConfig().
|
|
14648
|
+
default: () => getConfig().datePanel.festivalMethod
|
|
14479
14649
|
},
|
|
14480
14650
|
disabledMethod: {
|
|
14481
14651
|
type: Function,
|
|
14482
|
-
default: () => getConfig().
|
|
14652
|
+
default: () => getConfig().datePanel.disabledMethod
|
|
14483
14653
|
},
|
|
14484
14654
|
// week
|
|
14485
14655
|
selectDay: {
|
|
14486
14656
|
type: [String, Number],
|
|
14487
|
-
default: () => getConfig().
|
|
14488
|
-
}
|
|
14489
|
-
prefixIcon: String,
|
|
14490
|
-
suffixIcon: String,
|
|
14491
|
-
placement: String,
|
|
14492
|
-
transfer: {
|
|
14493
|
-
type: Boolean,
|
|
14494
|
-
default: null
|
|
14495
|
-
},
|
|
14496
|
-
shortcutConfig: Object,
|
|
14497
|
-
// 已废弃 startWeek,被 startDay 替换
|
|
14498
|
-
startWeek: Number,
|
|
14499
|
-
// 已废弃
|
|
14500
|
-
maxlength: [String, Number],
|
|
14501
|
-
// 已废弃
|
|
14502
|
-
autocomplete: String
|
|
14657
|
+
default: () => getConfig().datePanel.selectDay
|
|
14658
|
+
}
|
|
14503
14659
|
},
|
|
14504
|
-
emits: ['update:modelValue', '
|
|
14660
|
+
emits: ['update:modelValue', 'change', 'click', 'clear', 'date-prev', 'date-today', 'date-next', 'confirm'],
|
|
14505
14661
|
setup(props, context) {
|
|
14506
14662
|
const {
|
|
14507
|
-
slots,
|
|
14508
14663
|
emit
|
|
14509
14664
|
} = context;
|
|
14510
|
-
const $xeModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeModal', null);
|
|
14511
|
-
const $xeDrawer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeDrawer', null);
|
|
14512
|
-
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
|
|
14513
|
-
const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
|
|
14514
|
-
const formItemInfo = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('xeFormItemInfo', null);
|
|
14515
14665
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
14516
14666
|
const {
|
|
14517
14667
|
computeSize
|
|
14518
14668
|
} = useSize(props);
|
|
14519
14669
|
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
14520
|
-
initialized: false,
|
|
14521
|
-
panelIndex: 0,
|
|
14522
14670
|
visiblePanel: false,
|
|
14523
14671
|
isAniVisible: false,
|
|
14524
|
-
panelStyle: {},
|
|
14525
|
-
panelPlacement: '',
|
|
14526
14672
|
isActivated: false,
|
|
14527
14673
|
inputValue: '',
|
|
14528
14674
|
datetimePanelValue: null,
|
|
@@ -14539,15 +14685,12 @@ const Countdown = VxeCountdown;
|
|
|
14539
14685
|
hpTimeout: undefined
|
|
14540
14686
|
};
|
|
14541
14687
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14542
|
-
const refInputTarget = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14543
|
-
const refInputPanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14544
14688
|
const refPanelWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14545
14689
|
const refInputTimeBody = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
14546
14690
|
const refMaps = {
|
|
14547
|
-
refElem
|
|
14548
|
-
refInput: refInputTarget
|
|
14691
|
+
refElem
|
|
14549
14692
|
};
|
|
14550
|
-
const $
|
|
14693
|
+
const $xeDatePanel = {
|
|
14551
14694
|
xID,
|
|
14552
14695
|
props,
|
|
14553
14696
|
context,
|
|
@@ -14555,76 +14698,30 @@ const Countdown = VxeCountdown;
|
|
|
14555
14698
|
internalData,
|
|
14556
14699
|
getRefMaps: () => refMaps
|
|
14557
14700
|
};
|
|
14558
|
-
let datePickerMethods = {};
|
|
14559
|
-
const computeBtnTransfer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14560
|
-
const {
|
|
14561
|
-
transfer
|
|
14562
|
-
} = props;
|
|
14563
|
-
if (transfer === null) {
|
|
14564
|
-
const globalTransfer = getConfig().datePicker.transfer;
|
|
14565
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
|
|
14566
|
-
return globalTransfer;
|
|
14567
|
-
}
|
|
14568
|
-
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
14569
|
-
return true;
|
|
14570
|
-
}
|
|
14571
|
-
}
|
|
14572
|
-
return transfer;
|
|
14573
|
-
});
|
|
14574
|
-
const computeFormReadonly = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14575
|
-
const {
|
|
14576
|
-
readonly
|
|
14577
|
-
} = props;
|
|
14578
|
-
if (readonly === null) {
|
|
14579
|
-
if ($xeForm) {
|
|
14580
|
-
return $xeForm.props.readonly;
|
|
14581
|
-
}
|
|
14582
|
-
return false;
|
|
14583
|
-
}
|
|
14584
|
-
return readonly;
|
|
14585
|
-
});
|
|
14586
|
-
const computeIsDisabled = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14587
|
-
const {
|
|
14588
|
-
disabled
|
|
14589
|
-
} = props;
|
|
14590
|
-
if (disabled === null) {
|
|
14591
|
-
if ($xeForm) {
|
|
14592
|
-
return $xeForm.props.disabled;
|
|
14593
|
-
}
|
|
14594
|
-
return false;
|
|
14595
|
-
}
|
|
14596
|
-
return disabled;
|
|
14597
|
-
});
|
|
14598
14701
|
const computeIsDateTimeType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14599
14702
|
const {
|
|
14600
14703
|
type
|
|
14601
14704
|
} = props;
|
|
14602
14705
|
return type === 'time' || type === 'datetime';
|
|
14603
14706
|
});
|
|
14604
|
-
const
|
|
14707
|
+
const computeIsDatePanelType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14605
14708
|
const isDateTimeType = computeIsDateTimeType.value;
|
|
14606
14709
|
return isDateTimeType || ['date', 'week', 'month', 'quarter', 'year'].indexOf(props.type) > -1;
|
|
14607
14710
|
});
|
|
14608
|
-
const computeIsClearable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14609
|
-
return props.clearable;
|
|
14610
|
-
});
|
|
14611
14711
|
const computeDateStartTime = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14612
14712
|
return props.startDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(props.startDate) : null;
|
|
14613
14713
|
});
|
|
14614
14714
|
const computeDateEndTime = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14615
14715
|
return props.endDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(props.endDate) : null;
|
|
14616
14716
|
});
|
|
14617
|
-
const computeSupportMultiples = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14618
|
-
return ['date', 'week', 'month', 'quarter', 'year'].indexOf(props.type) > -1;
|
|
14619
|
-
});
|
|
14620
14717
|
const computeDateListValue = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14621
14718
|
const {
|
|
14622
14719
|
modelValue,
|
|
14623
14720
|
multiple
|
|
14624
14721
|
} = props;
|
|
14625
|
-
const
|
|
14722
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
14626
14723
|
const dateValueFormat = computeDateValueFormat.value;
|
|
14627
|
-
if (multiple && modelValue &&
|
|
14724
|
+
if (multiple && modelValue && isDatePanelType) {
|
|
14628
14725
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(modelValue).split(',').map(item => {
|
|
14629
14726
|
const date = parseDate(item, dateValueFormat);
|
|
14630
14727
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isValidDate(date)) {
|
|
@@ -14679,10 +14776,10 @@ const Countdown = VxeCountdown;
|
|
|
14679
14776
|
const {
|
|
14680
14777
|
modelValue
|
|
14681
14778
|
} = props;
|
|
14682
|
-
const
|
|
14779
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
14683
14780
|
const dateValueFormat = computeDateValueFormat.value;
|
|
14684
14781
|
let val = null;
|
|
14685
|
-
if (modelValue &&
|
|
14782
|
+
if (modelValue && isDatePanelType) {
|
|
14686
14783
|
const date = parseDate(modelValue, dateValueFormat);
|
|
14687
14784
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isValidDate(date)) {
|
|
14688
14785
|
val = date;
|
|
@@ -14706,7 +14803,7 @@ const Countdown = VxeCountdown;
|
|
|
14706
14803
|
selectMonth
|
|
14707
14804
|
} = reactData;
|
|
14708
14805
|
if (selectMonth && dateEndTime) {
|
|
14709
|
-
return selectMonth >= dateEndTime;
|
|
14806
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(selectMonth, 0, 'last') >= dateEndTime;
|
|
14710
14807
|
}
|
|
14711
14808
|
return false;
|
|
14712
14809
|
});
|
|
@@ -14715,8 +14812,9 @@ const Countdown = VxeCountdown;
|
|
|
14715
14812
|
datetimePanelValue
|
|
14716
14813
|
} = reactData;
|
|
14717
14814
|
const hasTimeSecond = computeHasTimeSecond.value;
|
|
14815
|
+
const hasTimeMinute = computeHasTimeMinute.value;
|
|
14718
14816
|
if (datetimePanelValue) {
|
|
14719
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(datetimePanelValue, hasTimeSecond ? 'HH:mm:ss' : 'HH:mm');
|
|
14817
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(datetimePanelValue, hasTimeMinute && hasTimeSecond ? 'HH:mm:ss' : hasTimeMinute ? 'HH:mm' : 'HH');
|
|
14720
14818
|
}
|
|
14721
14819
|
return '';
|
|
14722
14820
|
});
|
|
@@ -14729,11 +14827,11 @@ const Countdown = VxeCountdown;
|
|
|
14729
14827
|
const {
|
|
14730
14828
|
labelFormat
|
|
14731
14829
|
} = props;
|
|
14732
|
-
const
|
|
14733
|
-
if (
|
|
14830
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
14831
|
+
if (isDatePanelType) {
|
|
14734
14832
|
return labelFormat || i18n_getI18n(`vxe.input.date.labelFormat.${props.type}`);
|
|
14735
14833
|
}
|
|
14736
|
-
return
|
|
14834
|
+
return '';
|
|
14737
14835
|
});
|
|
14738
14836
|
const computeYearList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14739
14837
|
const {
|
|
@@ -14764,10 +14862,10 @@ const Countdown = VxeCountdown;
|
|
|
14764
14862
|
return years;
|
|
14765
14863
|
});
|
|
14766
14864
|
const computeSelectDatePanelObj = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14767
|
-
const
|
|
14865
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
14768
14866
|
let y = '';
|
|
14769
14867
|
let m = '';
|
|
14770
|
-
if (
|
|
14868
|
+
if (isDatePanelType) {
|
|
14771
14869
|
const {
|
|
14772
14870
|
datePanelType,
|
|
14773
14871
|
selectMonth
|
|
@@ -14795,15 +14893,14 @@ const Countdown = VxeCountdown;
|
|
|
14795
14893
|
});
|
|
14796
14894
|
const computeFirstDayOfWeek = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14797
14895
|
const {
|
|
14798
|
-
startDay
|
|
14799
|
-
startWeek
|
|
14896
|
+
startDay
|
|
14800
14897
|
} = props;
|
|
14801
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(
|
|
14898
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(startDay);
|
|
14802
14899
|
});
|
|
14803
14900
|
const computeWeekDatas = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14804
14901
|
const weeks = [];
|
|
14805
|
-
const
|
|
14806
|
-
if (
|
|
14902
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
14903
|
+
if (isDatePanelType) {
|
|
14807
14904
|
let sWeek = computeFirstDayOfWeek.value;
|
|
14808
14905
|
weeks.push(sWeek);
|
|
14809
14906
|
for (let index = 0; index < 6; index++) {
|
|
@@ -14818,8 +14915,8 @@ const Countdown = VxeCountdown;
|
|
|
14818
14915
|
return weeks;
|
|
14819
14916
|
});
|
|
14820
14917
|
const computeDateHeaders = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14821
|
-
const
|
|
14822
|
-
if (
|
|
14918
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
14919
|
+
if (isDatePanelType) {
|
|
14823
14920
|
const weekDatas = computeWeekDatas.value;
|
|
14824
14921
|
return weekDatas.map(day => {
|
|
14825
14922
|
return {
|
|
@@ -14831,8 +14928,8 @@ const Countdown = VxeCountdown;
|
|
|
14831
14928
|
return [];
|
|
14832
14929
|
});
|
|
14833
14930
|
const computeWeekHeaders = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
14834
|
-
const
|
|
14835
|
-
if (
|
|
14931
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
14932
|
+
if (isDatePanelType) {
|
|
14836
14933
|
const dateHeaders = computeDateHeaders.value;
|
|
14837
14934
|
return [{
|
|
14838
14935
|
label: i18n_getI18n('vxe.input.date.weeks.w')
|
|
@@ -15007,57 +15104,15 @@ const Countdown = VxeCountdown;
|
|
|
15007
15104
|
const minuteList = computeMinuteList.value;
|
|
15008
15105
|
return minuteList;
|
|
15009
15106
|
});
|
|
15010
|
-
const computeInputReadonly = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15011
|
-
const {
|
|
15012
|
-
type,
|
|
15013
|
-
editable,
|
|
15014
|
-
multiple
|
|
15015
|
-
} = props;
|
|
15016
|
-
const formReadonly = computeFormReadonly.value;
|
|
15017
|
-
return formReadonly || multiple || !editable || type === 'week' || type === 'quarter';
|
|
15018
|
-
});
|
|
15019
|
-
const computeDatePickerType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15020
|
-
return 'text';
|
|
15021
|
-
});
|
|
15022
|
-
const computeInpPlaceholder = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15023
|
-
const {
|
|
15024
|
-
placeholder
|
|
15025
|
-
} = props;
|
|
15026
|
-
if (placeholder) {
|
|
15027
|
-
return getFuncText(placeholder);
|
|
15028
|
-
}
|
|
15029
|
-
const globalPlaceholder = getConfig().datePicker.placeholder;
|
|
15030
|
-
if (globalPlaceholder) {
|
|
15031
|
-
return getFuncText(globalPlaceholder);
|
|
15032
|
-
}
|
|
15033
|
-
return i18n_getI18n('vxe.base.pleaseSelect');
|
|
15034
|
-
});
|
|
15035
|
-
const computeInpImmediate = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15036
|
-
const {
|
|
15037
|
-
immediate
|
|
15038
|
-
} = props;
|
|
15039
|
-
return immediate;
|
|
15040
|
-
});
|
|
15041
|
-
const computeShortcutOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
15042
|
-
return Object.assign({}, getConfig().datePicker.shortcutConfig, props.shortcutConfig);
|
|
15043
|
-
});
|
|
15044
15107
|
const updateModelValue = modelValue => {
|
|
15045
15108
|
const {
|
|
15046
|
-
|
|
15047
|
-
|
|
15048
|
-
|
|
15049
|
-
|
|
15050
|
-
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
} else {
|
|
15054
|
-
val = modelValue;
|
|
15055
|
-
}
|
|
15056
|
-
}
|
|
15057
|
-
reactData.inputValue = val;
|
|
15058
|
-
if (isActivated && visiblePanel) {
|
|
15059
|
-
dateOpenPanel();
|
|
15060
|
-
}
|
|
15109
|
+
type
|
|
15110
|
+
} = props;
|
|
15111
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
15112
|
+
reactData.inputValue = parseDateValue(modelValue, type, {
|
|
15113
|
+
valueFormat: dateValueFormat
|
|
15114
|
+
});
|
|
15115
|
+
dateOpenPanel();
|
|
15061
15116
|
};
|
|
15062
15117
|
const parseDate = (value, format) => {
|
|
15063
15118
|
const {
|
|
@@ -15075,66 +15130,71 @@ const Countdown = VxeCountdown;
|
|
|
15075
15130
|
}
|
|
15076
15131
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(value, format);
|
|
15077
15132
|
};
|
|
15078
|
-
const
|
|
15133
|
+
const dateRevert = () => {
|
|
15134
|
+
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
15135
|
+
};
|
|
15136
|
+
const afterCheckValue = inputLabel => {
|
|
15079
15137
|
const {
|
|
15080
|
-
|
|
15138
|
+
type
|
|
15139
|
+
} = props;
|
|
15140
|
+
const {
|
|
15141
|
+
inputValue,
|
|
15142
|
+
datetimePanelValue
|
|
15081
15143
|
} = reactData;
|
|
15082
|
-
|
|
15083
|
-
|
|
15084
|
-
|
|
15144
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
15145
|
+
if (inputLabel) {
|
|
15146
|
+
let inpDateVal = parseDate(inputLabel, dateLabelFormat);
|
|
15147
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isValidDate(inpDateVal)) {
|
|
15148
|
+
if (type === 'time') {
|
|
15149
|
+
inpDateVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(inpDateVal, dateLabelFormat);
|
|
15150
|
+
if (inputValue !== inpDateVal) {
|
|
15151
|
+
handleChange(inpDateVal, {
|
|
15152
|
+
type: 'check'
|
|
15153
|
+
});
|
|
15154
|
+
}
|
|
15155
|
+
reactData.inputValue = inpDateVal;
|
|
15156
|
+
} else {
|
|
15157
|
+
let isChange = false;
|
|
15158
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
15159
|
+
if (type === 'datetime') {
|
|
15160
|
+
const dateValue = computeDateValue.value;
|
|
15161
|
+
if (inputLabel !== external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateValue, dateLabelFormat) || inputLabel !== external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(inpDateVal, dateLabelFormat)) {
|
|
15162
|
+
isChange = true;
|
|
15163
|
+
if (datetimePanelValue) {
|
|
15164
|
+
datetimePanelValue.setHours(inpDateVal.getHours());
|
|
15165
|
+
datetimePanelValue.setMinutes(inpDateVal.getMinutes());
|
|
15166
|
+
datetimePanelValue.setSeconds(inpDateVal.getSeconds());
|
|
15167
|
+
}
|
|
15168
|
+
}
|
|
15169
|
+
} else {
|
|
15170
|
+
isChange = true;
|
|
15171
|
+
}
|
|
15172
|
+
reactData.inputValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(inpDateVal, dateLabelFormat, {
|
|
15173
|
+
firstDay: firstDayOfWeek
|
|
15174
|
+
});
|
|
15175
|
+
if (isChange) {
|
|
15176
|
+
dateChange(inpDateVal);
|
|
15177
|
+
}
|
|
15178
|
+
}
|
|
15179
|
+
} else {
|
|
15180
|
+
dateRevert();
|
|
15181
|
+
}
|
|
15182
|
+
} else {
|
|
15183
|
+
handleChange('', {
|
|
15184
|
+
type: 'check'
|
|
15185
|
+
});
|
|
15186
|
+
}
|
|
15085
15187
|
};
|
|
15086
15188
|
const handleChange = (value, evnt) => {
|
|
15189
|
+
const {
|
|
15190
|
+
modelValue
|
|
15191
|
+
} = props;
|
|
15087
15192
|
reactData.inputValue = value;
|
|
15088
15193
|
emit('update:modelValue', value);
|
|
15089
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(
|
|
15194
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(modelValue) !== value) {
|
|
15090
15195
|
dispatchEvent('change', {
|
|
15091
15196
|
value
|
|
15092
15197
|
}, evnt);
|
|
15093
|
-
// 自动更新校验状态
|
|
15094
|
-
if ($xeForm && formItemInfo) {
|
|
15095
|
-
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
15096
|
-
}
|
|
15097
|
-
}
|
|
15098
|
-
};
|
|
15099
|
-
const inputEvent = evnt => {
|
|
15100
|
-
const isDatePickerType = computeIsDatePickerType.value;
|
|
15101
|
-
const inpImmediate = computeInpImmediate.value;
|
|
15102
|
-
const inputElem = evnt.target;
|
|
15103
|
-
const value = inputElem.value;
|
|
15104
|
-
reactData.inputValue = value;
|
|
15105
|
-
if (!isDatePickerType) {
|
|
15106
|
-
if (inpImmediate) {
|
|
15107
|
-
handleChange(value, evnt);
|
|
15108
|
-
} else {
|
|
15109
|
-
dispatchEvent('input', {
|
|
15110
|
-
value
|
|
15111
|
-
}, evnt);
|
|
15112
|
-
}
|
|
15113
|
-
}
|
|
15114
|
-
};
|
|
15115
|
-
const changeEvent = evnt => {
|
|
15116
|
-
const inpImmediate = computeInpImmediate.value;
|
|
15117
|
-
if (!inpImmediate) {
|
|
15118
|
-
triggerEvent(evnt);
|
|
15119
|
-
}
|
|
15120
|
-
};
|
|
15121
|
-
const focusEvent = evnt => {
|
|
15122
|
-
reactData.isActivated = true;
|
|
15123
|
-
const isDatePickerType = computeIsDatePickerType.value;
|
|
15124
|
-
if (isDatePickerType) {
|
|
15125
|
-
datePickerOpenEvent(evnt);
|
|
15126
|
-
}
|
|
15127
|
-
triggerEvent(evnt);
|
|
15128
|
-
};
|
|
15129
|
-
const clickPrefixEvent = evnt => {
|
|
15130
|
-
const isDisabled = computeIsDisabled.value;
|
|
15131
|
-
if (!isDisabled) {
|
|
15132
|
-
const {
|
|
15133
|
-
inputValue
|
|
15134
|
-
} = reactData;
|
|
15135
|
-
dispatchEvent('prefix-click', {
|
|
15136
|
-
value: inputValue
|
|
15137
|
-
}, evnt);
|
|
15138
15198
|
}
|
|
15139
15199
|
};
|
|
15140
15200
|
const hidePanel = () => {
|
|
@@ -15146,75 +15206,30 @@ const Countdown = VxeCountdown;
|
|
|
15146
15206
|
}, 350);
|
|
15147
15207
|
});
|
|
15148
15208
|
};
|
|
15149
|
-
const
|
|
15150
|
-
const isDatePickerType = computeIsDatePickerType.value;
|
|
15151
|
-
if (isDatePickerType) {
|
|
15152
|
-
hidePanel();
|
|
15153
|
-
}
|
|
15154
|
-
handleChange('', evnt);
|
|
15155
|
-
dispatchEvent('clear', {
|
|
15156
|
-
value
|
|
15157
|
-
}, evnt);
|
|
15158
|
-
};
|
|
15159
|
-
const clickSuffixEvent = evnt => {
|
|
15160
|
-
const isDisabled = computeIsDisabled.value;
|
|
15161
|
-
if (!isDisabled) {
|
|
15162
|
-
const {
|
|
15163
|
-
inputValue
|
|
15164
|
-
} = reactData;
|
|
15165
|
-
dispatchEvent('suffix-click', {
|
|
15166
|
-
value: inputValue
|
|
15167
|
-
}, evnt);
|
|
15168
|
-
}
|
|
15169
|
-
};
|
|
15170
|
-
const dateParseValue = value => {
|
|
15209
|
+
const dateParseValue = val => {
|
|
15171
15210
|
const {
|
|
15172
15211
|
type
|
|
15173
15212
|
} = props;
|
|
15174
15213
|
const dateLabelFormat = computeDateLabelFormat.value;
|
|
15175
15214
|
const dateValueFormat = computeDateValueFormat.value;
|
|
15176
15215
|
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
15177
|
-
|
|
15178
|
-
|
|
15179
|
-
|
|
15180
|
-
|
|
15181
|
-
}
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
firstDay: firstDayOfWeek
|
|
15185
|
-
});
|
|
15186
|
-
// 周选择器,由于年份和第几周是冲突的行为,所以需要特殊处理,判断是否跨年,例如
|
|
15187
|
-
// '2024-12-31' 'yyyy-MM-dd W' >> '2024-12-31 1'
|
|
15188
|
-
// '2025-01-01' 'yyyy-MM-dd W' >> '2025-01-01 1'
|
|
15189
|
-
if (dateLabelFormat && type === 'week') {
|
|
15190
|
-
const weekNum = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(dValue, firstDayOfWeek);
|
|
15191
|
-
const weekDate = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(dValue, 0, weekNum === 1 ? (6 + firstDayOfWeek) % 7 : firstDayOfWeek, firstDayOfWeek);
|
|
15192
|
-
const weekFullYear = weekDate.getFullYear();
|
|
15193
|
-
if (weekFullYear !== dValue.getFullYear()) {
|
|
15194
|
-
const yyIndex = dateLabelFormat.indexOf('yyyy');
|
|
15195
|
-
if (yyIndex > -1) {
|
|
15196
|
-
const yyNum = Number(dLabel.substring(yyIndex, yyIndex + 4));
|
|
15197
|
-
if (yyNum && !isNaN(yyNum)) {
|
|
15198
|
-
dLabel = dLabel.replace(`${yyNum}`, `${weekFullYear}`);
|
|
15199
|
-
}
|
|
15200
|
-
}
|
|
15201
|
-
}
|
|
15202
|
-
}
|
|
15203
|
-
} else {
|
|
15204
|
-
dValue = null;
|
|
15205
|
-
}
|
|
15206
|
-
reactData.datePanelValue = dValue;
|
|
15207
|
-
reactData.datePanelLabel = dLabel;
|
|
15216
|
+
const dateObj = parseDateObj(val, type, {
|
|
15217
|
+
valueFormat: dateValueFormat,
|
|
15218
|
+
labelFormat: dateLabelFormat,
|
|
15219
|
+
firstDay: firstDayOfWeek
|
|
15220
|
+
});
|
|
15221
|
+
reactData.datePanelValue = dateObj.value;
|
|
15222
|
+
reactData.datePanelLabel = dateObj.label;
|
|
15208
15223
|
};
|
|
15209
15224
|
/**
|
|
15210
15225
|
* 值变化时处理
|
|
15211
15226
|
*/
|
|
15212
15227
|
const changeValue = () => {
|
|
15213
|
-
const
|
|
15228
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
15214
15229
|
const {
|
|
15215
15230
|
inputValue
|
|
15216
15231
|
} = reactData;
|
|
15217
|
-
if (
|
|
15232
|
+
if (isDatePanelType) {
|
|
15218
15233
|
dateParseValue(inputValue);
|
|
15219
15234
|
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
15220
15235
|
}
|
|
@@ -15223,15 +15238,15 @@ const Countdown = VxeCountdown;
|
|
|
15223
15238
|
* 检查初始值
|
|
15224
15239
|
*/
|
|
15225
15240
|
const initValue = () => {
|
|
15226
|
-
const
|
|
15227
|
-
|
|
15228
|
-
|
|
15241
|
+
const {
|
|
15242
|
+
modelValue
|
|
15243
|
+
} = props;
|
|
15244
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
15245
|
+
updateModelValue(modelValue);
|
|
15246
|
+
if (isDatePanelType) {
|
|
15229
15247
|
changeValue();
|
|
15230
15248
|
}
|
|
15231
15249
|
};
|
|
15232
|
-
const dateRevert = () => {
|
|
15233
|
-
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
15234
|
-
};
|
|
15235
15250
|
const dateCheckMonth = date => {
|
|
15236
15251
|
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
15237
15252
|
const weekNum = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getYearWeek(date, firstDayOfWeek);
|
|
@@ -15322,88 +15337,6 @@ const Countdown = VxeCountdown;
|
|
|
15322
15337
|
}
|
|
15323
15338
|
}
|
|
15324
15339
|
};
|
|
15325
|
-
const afterCheckValue = () => {
|
|
15326
|
-
const {
|
|
15327
|
-
type
|
|
15328
|
-
} = props;
|
|
15329
|
-
const {
|
|
15330
|
-
inputValue,
|
|
15331
|
-
datetimePanelValue
|
|
15332
|
-
} = reactData;
|
|
15333
|
-
const dateLabelFormat = computeDateLabelFormat.value;
|
|
15334
|
-
const inputReadonly = computeInputReadonly.value;
|
|
15335
|
-
if (!inputReadonly) {
|
|
15336
|
-
if (inputValue) {
|
|
15337
|
-
let inpDateVal = parseDate(inputValue, dateLabelFormat);
|
|
15338
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isValidDate(inpDateVal)) {
|
|
15339
|
-
if (type === 'time') {
|
|
15340
|
-
inpDateVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(inpDateVal, dateLabelFormat);
|
|
15341
|
-
if (inputValue !== inpDateVal) {
|
|
15342
|
-
handleChange(inpDateVal, {
|
|
15343
|
-
type: 'check'
|
|
15344
|
-
});
|
|
15345
|
-
}
|
|
15346
|
-
reactData.inputValue = inpDateVal;
|
|
15347
|
-
} else {
|
|
15348
|
-
let isChange = false;
|
|
15349
|
-
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
15350
|
-
if (type === 'datetime') {
|
|
15351
|
-
const dateValue = computeDateValue.value;
|
|
15352
|
-
if (inputValue !== external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(dateValue, dateLabelFormat) || inputValue !== external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(inpDateVal, dateLabelFormat)) {
|
|
15353
|
-
isChange = true;
|
|
15354
|
-
if (datetimePanelValue) {
|
|
15355
|
-
datetimePanelValue.setHours(inpDateVal.getHours());
|
|
15356
|
-
datetimePanelValue.setMinutes(inpDateVal.getMinutes());
|
|
15357
|
-
datetimePanelValue.setSeconds(inpDateVal.getSeconds());
|
|
15358
|
-
}
|
|
15359
|
-
}
|
|
15360
|
-
} else {
|
|
15361
|
-
isChange = true;
|
|
15362
|
-
}
|
|
15363
|
-
reactData.inputValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toDateString(inpDateVal, dateLabelFormat, {
|
|
15364
|
-
firstDay: firstDayOfWeek
|
|
15365
|
-
});
|
|
15366
|
-
if (isChange) {
|
|
15367
|
-
dateChange(inpDateVal);
|
|
15368
|
-
}
|
|
15369
|
-
}
|
|
15370
|
-
} else {
|
|
15371
|
-
dateRevert();
|
|
15372
|
-
}
|
|
15373
|
-
} else {
|
|
15374
|
-
handleChange('', {
|
|
15375
|
-
type: 'check'
|
|
15376
|
-
});
|
|
15377
|
-
}
|
|
15378
|
-
}
|
|
15379
|
-
};
|
|
15380
|
-
const blurEvent = evnt => {
|
|
15381
|
-
const {
|
|
15382
|
-
inputValue
|
|
15383
|
-
} = reactData;
|
|
15384
|
-
const inpImmediate = computeInpImmediate.value;
|
|
15385
|
-
const value = inputValue;
|
|
15386
|
-
if (!inpImmediate) {
|
|
15387
|
-
handleChange(value, evnt);
|
|
15388
|
-
}
|
|
15389
|
-
afterCheckValue();
|
|
15390
|
-
if (!reactData.visiblePanel) {
|
|
15391
|
-
reactData.isActivated = false;
|
|
15392
|
-
}
|
|
15393
|
-
dispatchEvent('blur', {
|
|
15394
|
-
value
|
|
15395
|
-
}, evnt);
|
|
15396
|
-
// 自动更新校验状态
|
|
15397
|
-
if ($xeForm && formItemInfo) {
|
|
15398
|
-
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
15399
|
-
}
|
|
15400
|
-
};
|
|
15401
|
-
const keydownEvent = evnt => {
|
|
15402
|
-
triggerEvent(evnt);
|
|
15403
|
-
};
|
|
15404
|
-
const keyupEvent = evnt => {
|
|
15405
|
-
triggerEvent(evnt);
|
|
15406
|
-
};
|
|
15407
15340
|
// 日期
|
|
15408
15341
|
const dateMonthHandle = (date, offsetMonth) => {
|
|
15409
15342
|
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
@@ -15563,7 +15496,7 @@ const Countdown = VxeCountdown;
|
|
|
15563
15496
|
type: datePanelType,
|
|
15564
15497
|
viewType: datePanelType,
|
|
15565
15498
|
date,
|
|
15566
|
-
$
|
|
15499
|
+
$datePanel: $xeDatePanel
|
|
15567
15500
|
});
|
|
15568
15501
|
}
|
|
15569
15502
|
return false;
|
|
@@ -15685,6 +15618,9 @@ const Countdown = VxeCountdown;
|
|
|
15685
15618
|
}
|
|
15686
15619
|
}
|
|
15687
15620
|
};
|
|
15621
|
+
const dateMouseleaveEvent = () => {
|
|
15622
|
+
reactData.datePanelValue = null;
|
|
15623
|
+
};
|
|
15688
15624
|
const updateTimePos = liElem => {
|
|
15689
15625
|
if (liElem) {
|
|
15690
15626
|
const height = liElem.offsetHeight;
|
|
@@ -15708,12 +15644,7 @@ const Countdown = VxeCountdown;
|
|
|
15708
15644
|
}
|
|
15709
15645
|
dateTimeChangeEvent(evnt);
|
|
15710
15646
|
};
|
|
15711
|
-
|
|
15712
|
-
// const value = ''
|
|
15713
|
-
// handleChange(value, evnt)
|
|
15714
|
-
// dispatchEvent('clear', { value }, evnt)
|
|
15715
|
-
// }
|
|
15716
|
-
const dateConfirmEvent = () => {
|
|
15647
|
+
const dateConfirmEvent = evnt => {
|
|
15717
15648
|
const {
|
|
15718
15649
|
multiple
|
|
15719
15650
|
} = props;
|
|
@@ -15755,6 +15686,7 @@ const Countdown = VxeCountdown;
|
|
|
15755
15686
|
}
|
|
15756
15687
|
}
|
|
15757
15688
|
hidePanel();
|
|
15689
|
+
dispatchEvent('confirm', {}, evnt);
|
|
15758
15690
|
};
|
|
15759
15691
|
const dateMinuteEvent = (evnt, item) => {
|
|
15760
15692
|
const {
|
|
@@ -15774,92 +15706,6 @@ const Countdown = VxeCountdown;
|
|
|
15774
15706
|
}
|
|
15775
15707
|
dateTimeChangeEvent(evnt);
|
|
15776
15708
|
};
|
|
15777
|
-
const dateOffsetEvent = evnt => {
|
|
15778
|
-
const {
|
|
15779
|
-
isActivated,
|
|
15780
|
-
datePanelValue,
|
|
15781
|
-
datePanelType
|
|
15782
|
-
} = reactData;
|
|
15783
|
-
if (isActivated) {
|
|
15784
|
-
evnt.preventDefault();
|
|
15785
|
-
const isLeftArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_LEFT);
|
|
15786
|
-
const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
|
|
15787
|
-
const isRightArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_RIGHT);
|
|
15788
|
-
const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
|
|
15789
|
-
if (datePanelType === 'year') {
|
|
15790
|
-
let offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(datePanelValue || Date.now(), 0, 'first');
|
|
15791
|
-
if (isLeftArrow) {
|
|
15792
|
-
offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(offsetYear, -1);
|
|
15793
|
-
} else if (isUpArrow) {
|
|
15794
|
-
offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(offsetYear, -4);
|
|
15795
|
-
} else if (isRightArrow) {
|
|
15796
|
-
offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(offsetYear, 1);
|
|
15797
|
-
} else if (isDwArrow) {
|
|
15798
|
-
offsetYear = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatYear(offsetYear, 4);
|
|
15799
|
-
}
|
|
15800
|
-
dateMoveYear(offsetYear);
|
|
15801
|
-
} else if (datePanelType === 'quarter') {
|
|
15802
|
-
let offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(datePanelValue || Date.now(), 0, 'first');
|
|
15803
|
-
if (isLeftArrow) {
|
|
15804
|
-
offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(offsetQuarter, -1);
|
|
15805
|
-
} else if (isUpArrow) {
|
|
15806
|
-
offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(offsetQuarter, -2);
|
|
15807
|
-
} else if (isRightArrow) {
|
|
15808
|
-
offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(offsetQuarter, 1);
|
|
15809
|
-
} else if (isDwArrow) {
|
|
15810
|
-
offsetQuarter = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatQuarter(offsetQuarter, 2);
|
|
15811
|
-
}
|
|
15812
|
-
dateMoveQuarter(offsetQuarter);
|
|
15813
|
-
} else if (datePanelType === 'month') {
|
|
15814
|
-
let offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(datePanelValue || Date.now(), 0, 'first');
|
|
15815
|
-
if (isLeftArrow) {
|
|
15816
|
-
offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(offsetMonth, -1);
|
|
15817
|
-
} else if (isUpArrow) {
|
|
15818
|
-
offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(offsetMonth, -4);
|
|
15819
|
-
} else if (isRightArrow) {
|
|
15820
|
-
offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(offsetMonth, 1);
|
|
15821
|
-
} else if (isDwArrow) {
|
|
15822
|
-
offsetMonth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatMonth(offsetMonth, 4);
|
|
15823
|
-
}
|
|
15824
|
-
dateMoveMonth(offsetMonth);
|
|
15825
|
-
} else if (datePanelType === 'week') {
|
|
15826
|
-
let offsetDay = datePanelValue || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(Date.now(), 0, 'first');
|
|
15827
|
-
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
15828
|
-
if (isUpArrow) {
|
|
15829
|
-
offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(offsetDay, -1, firstDayOfWeek);
|
|
15830
|
-
} else if (isDwArrow) {
|
|
15831
|
-
offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(offsetDay, 1, firstDayOfWeek);
|
|
15832
|
-
}
|
|
15833
|
-
dateMoveDay(offsetDay);
|
|
15834
|
-
} else {
|
|
15835
|
-
let offsetDay = datePanelValue || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(Date.now(), 0, 'first');
|
|
15836
|
-
if (isLeftArrow) {
|
|
15837
|
-
offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(offsetDay, -1);
|
|
15838
|
-
} else if (isUpArrow) {
|
|
15839
|
-
offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(offsetDay, -1, offsetDay.getDay());
|
|
15840
|
-
} else if (isRightArrow) {
|
|
15841
|
-
offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatDay(offsetDay, 1);
|
|
15842
|
-
} else if (isDwArrow) {
|
|
15843
|
-
offsetDay = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().getWhatWeek(offsetDay, 1, offsetDay.getDay());
|
|
15844
|
-
}
|
|
15845
|
-
dateMoveDay(offsetDay);
|
|
15846
|
-
}
|
|
15847
|
-
}
|
|
15848
|
-
};
|
|
15849
|
-
const datePgOffsetEvent = evnt => {
|
|
15850
|
-
const {
|
|
15851
|
-
isActivated
|
|
15852
|
-
} = reactData;
|
|
15853
|
-
if (isActivated) {
|
|
15854
|
-
const isPgUp = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.PAGE_UP);
|
|
15855
|
-
evnt.preventDefault();
|
|
15856
|
-
if (isPgUp) {
|
|
15857
|
-
datePrevEvent(evnt);
|
|
15858
|
-
} else {
|
|
15859
|
-
dateNextEvent(evnt);
|
|
15860
|
-
}
|
|
15861
|
-
}
|
|
15862
|
-
};
|
|
15863
15709
|
const dateOpenPanel = () => {
|
|
15864
15710
|
const {
|
|
15865
15711
|
type
|
|
@@ -15888,281 +15734,2433 @@ const Countdown = VxeCountdown;
|
|
|
15888
15734
|
});
|
|
15889
15735
|
}
|
|
15890
15736
|
};
|
|
15891
|
-
|
|
15892
|
-
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
reactData.panelIndex = nextZIndex();
|
|
15896
|
-
}
|
|
15737
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
15738
|
+
emit(type, createEvent(evnt, {
|
|
15739
|
+
$datePanel: $xeDatePanel
|
|
15740
|
+
}, params));
|
|
15897
15741
|
};
|
|
15898
|
-
const
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
15905
|
-
|
|
15906
|
-
const targetElem = refInputTarget.value;
|
|
15907
|
-
const panelElem = refInputPanel.value;
|
|
15908
|
-
const btnTransfer = computeBtnTransfer.value;
|
|
15909
|
-
if (targetElem && panelElem) {
|
|
15910
|
-
const targetHeight = targetElem.offsetHeight;
|
|
15911
|
-
const targetWidth = targetElem.offsetWidth;
|
|
15912
|
-
const panelHeight = panelElem.offsetHeight;
|
|
15913
|
-
const panelWidth = panelElem.offsetWidth;
|
|
15914
|
-
const marginSize = 5;
|
|
15915
|
-
const panelStyle = {
|
|
15916
|
-
zIndex: panelIndex
|
|
15917
|
-
};
|
|
15918
|
-
const {
|
|
15919
|
-
boundingTop,
|
|
15920
|
-
boundingLeft,
|
|
15921
|
-
visibleHeight,
|
|
15922
|
-
visibleWidth
|
|
15923
|
-
} = getAbsolutePos(targetElem);
|
|
15924
|
-
let panelPlacement = 'bottom';
|
|
15925
|
-
if (btnTransfer) {
|
|
15926
|
-
let left = boundingLeft;
|
|
15927
|
-
let top = boundingTop + targetHeight;
|
|
15928
|
-
if (placement === 'top') {
|
|
15929
|
-
panelPlacement = 'top';
|
|
15930
|
-
top = boundingTop - panelHeight;
|
|
15931
|
-
} else if (!placement) {
|
|
15932
|
-
// 如果下面不够放,则向上
|
|
15933
|
-
if (top + panelHeight + marginSize > visibleHeight) {
|
|
15934
|
-
panelPlacement = 'top';
|
|
15935
|
-
top = boundingTop - panelHeight;
|
|
15936
|
-
}
|
|
15937
|
-
// 如果上面不够放,则向下(优先)
|
|
15938
|
-
if (top < marginSize) {
|
|
15939
|
-
panelPlacement = 'bottom';
|
|
15940
|
-
top = boundingTop + targetHeight;
|
|
15941
|
-
}
|
|
15942
|
-
}
|
|
15943
|
-
// 如果溢出右边
|
|
15944
|
-
if (left + panelWidth + marginSize > visibleWidth) {
|
|
15945
|
-
left -= left + panelWidth + marginSize - visibleWidth;
|
|
15946
|
-
}
|
|
15947
|
-
// 如果溢出左边
|
|
15948
|
-
if (left < marginSize) {
|
|
15949
|
-
left = marginSize;
|
|
15950
|
-
}
|
|
15951
|
-
Object.assign(panelStyle, {
|
|
15952
|
-
left: `${left}px`,
|
|
15953
|
-
top: `${top}px`,
|
|
15954
|
-
minWidth: `${targetWidth}px`
|
|
15955
|
-
});
|
|
15956
|
-
} else {
|
|
15957
|
-
if (placement === 'top') {
|
|
15958
|
-
panelPlacement = 'top';
|
|
15959
|
-
panelStyle.bottom = `${targetHeight}px`;
|
|
15960
|
-
} else if (!placement) {
|
|
15961
|
-
// 如果下面不够放,则向上
|
|
15962
|
-
panelStyle.top = `${targetHeight}px`;
|
|
15963
|
-
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
15964
|
-
// 如果上面不够放,则向下(优先)
|
|
15965
|
-
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
15966
|
-
panelPlacement = 'top';
|
|
15967
|
-
panelStyle.top = '';
|
|
15968
|
-
panelStyle.bottom = `${targetHeight}px`;
|
|
15969
|
-
}
|
|
15970
|
-
}
|
|
15971
|
-
}
|
|
15972
|
-
}
|
|
15973
|
-
reactData.panelStyle = panelStyle;
|
|
15974
|
-
reactData.panelPlacement = panelPlacement;
|
|
15975
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
15742
|
+
const datePanelMethods = {
|
|
15743
|
+
dispatchEvent,
|
|
15744
|
+
getValue() {
|
|
15745
|
+
return reactData.inputValue;
|
|
15746
|
+
},
|
|
15747
|
+
setPanelDate(date) {
|
|
15748
|
+
if (date) {
|
|
15749
|
+
dateCheckMonth(date);
|
|
15976
15750
|
}
|
|
15977
|
-
}
|
|
15751
|
+
},
|
|
15752
|
+
getPanelDate() {
|
|
15753
|
+
return reactData.selectMonth;
|
|
15754
|
+
},
|
|
15755
|
+
checkValue(inputLabel) {
|
|
15756
|
+
afterCheckValue(inputLabel);
|
|
15757
|
+
},
|
|
15758
|
+
confirmByEvent(evnt) {
|
|
15759
|
+
dateConfirmEvent(evnt);
|
|
15760
|
+
}
|
|
15978
15761
|
};
|
|
15979
|
-
|
|
15762
|
+
Object.assign($xeDatePanel, datePanelMethods);
|
|
15763
|
+
const renderDateLabel = (item, label) => {
|
|
15980
15764
|
const {
|
|
15981
|
-
|
|
15982
|
-
} =
|
|
15983
|
-
const
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
15990
|
-
|
|
15991
|
-
|
|
15992
|
-
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
|
|
15765
|
+
festivalMethod
|
|
15766
|
+
} = props;
|
|
15767
|
+
const labelVNs = [];
|
|
15768
|
+
if (festivalMethod) {
|
|
15769
|
+
const {
|
|
15770
|
+
datePanelType
|
|
15771
|
+
} = reactData;
|
|
15772
|
+
const festivalRest = festivalMethod({
|
|
15773
|
+
type: datePanelType,
|
|
15774
|
+
viewType: datePanelType,
|
|
15775
|
+
date: item.date,
|
|
15776
|
+
$datePanel: $xeDatePanel
|
|
15777
|
+
});
|
|
15778
|
+
const festivalItem = festivalRest ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(festivalRest) ? {
|
|
15779
|
+
label: festivalRest
|
|
15780
|
+
} : festivalRest : {};
|
|
15781
|
+
const extraItem = festivalItem.extra ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(festivalItem.extra) ? {
|
|
15782
|
+
label: festivalItem.extra
|
|
15783
|
+
} : festivalItem.extra : null;
|
|
15784
|
+
labelVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15785
|
+
class: ['vxe-date-panel--label', {
|
|
15786
|
+
'is-notice': festivalItem.notice
|
|
15787
|
+
}]
|
|
15788
|
+
}, extraItem && extraItem.label ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', `${label}`), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15789
|
+
class: ['vxe-date-panel--label--extra', extraItem.important ? 'is-important' : '', extraItem.className],
|
|
15790
|
+
style: extraItem.style
|
|
15791
|
+
}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(extraItem.label))] : `${label}`));
|
|
15792
|
+
const festivalLabel = festivalItem.label;
|
|
15793
|
+
if (festivalLabel) {
|
|
15794
|
+
// 默认最多支持3个节日重叠
|
|
15795
|
+
const festivalLabels = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(festivalLabel).split(',');
|
|
15796
|
+
labelVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15797
|
+
class: ['vxe-date-panel--festival', festivalItem.important ? 'is-important' : '', festivalItem.className],
|
|
15798
|
+
style: festivalItem.style
|
|
15799
|
+
}, [festivalLabels.length > 1 ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15800
|
+
class: ['vxe-date-panel--festival--overlap', `overlap--${festivalLabels.length}`]
|
|
15801
|
+
}, festivalLabels.map(label => (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', label.substring(0, 3)))) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15802
|
+
class: 'vxe-date-panel--festival--label'
|
|
15803
|
+
}, festivalLabels[0].substring(0, 3))]));
|
|
15997
15804
|
}
|
|
15998
|
-
setTimeout(() => {
|
|
15999
|
-
reactData.visiblePanel = true;
|
|
16000
|
-
}, 10);
|
|
16001
|
-
updateZindex();
|
|
16002
|
-
return updatePlacement();
|
|
16003
|
-
}
|
|
16004
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
16005
|
-
};
|
|
16006
|
-
const datePickerOpenEvent = evnt => {
|
|
16007
|
-
const formReadonly = computeFormReadonly.value;
|
|
16008
|
-
if (!formReadonly) {
|
|
16009
|
-
evnt.preventDefault();
|
|
16010
|
-
showPanel();
|
|
16011
15805
|
}
|
|
15806
|
+
return labelVNs;
|
|
16012
15807
|
};
|
|
16013
|
-
const
|
|
16014
|
-
triggerEvent(evnt);
|
|
16015
|
-
};
|
|
16016
|
-
const handleShortcutEvent = ({
|
|
16017
|
-
option,
|
|
16018
|
-
$event
|
|
16019
|
-
}) => {
|
|
16020
|
-
const shortcutOpts = computeShortcutOpts.value;
|
|
15808
|
+
const renderDateDayTable = () => {
|
|
16021
15809
|
const {
|
|
16022
|
-
|
|
16023
|
-
} =
|
|
16024
|
-
const clickMethod = option.clickMethod || shortcutOpts.clickMethod;
|
|
16025
|
-
const shortcutParams = {
|
|
16026
|
-
$datePicker: $xeDatePicker,
|
|
16027
|
-
option: option
|
|
16028
|
-
};
|
|
16029
|
-
if (clickMethod) {
|
|
16030
|
-
clickMethod(shortcutParams);
|
|
16031
|
-
}
|
|
16032
|
-
if (autoClose) {
|
|
16033
|
-
hidePanel();
|
|
16034
|
-
}
|
|
16035
|
-
dispatchEvent('shortcut-click', shortcutParams, $event);
|
|
16036
|
-
};
|
|
16037
|
-
// 全局事件
|
|
16038
|
-
const handleGlobalMousedownEvent = evnt => {
|
|
15810
|
+
multiple
|
|
15811
|
+
} = props;
|
|
16039
15812
|
const {
|
|
16040
|
-
|
|
16041
|
-
|
|
15813
|
+
datePanelType,
|
|
15814
|
+
datePanelValue
|
|
16042
15815
|
} = reactData;
|
|
16043
|
-
const
|
|
16044
|
-
const
|
|
16045
|
-
const
|
|
16046
|
-
const
|
|
16047
|
-
|
|
16048
|
-
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
-
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16056
|
-
|
|
16057
|
-
|
|
15816
|
+
const dateValue = computeDateValue.value;
|
|
15817
|
+
const dateHeaders = computeDateHeaders.value;
|
|
15818
|
+
const dayDatas = computeDayDatas.value;
|
|
15819
|
+
const dateListValue = computeDateListValue.value;
|
|
15820
|
+
const overCount = computeOverCount.value;
|
|
15821
|
+
const matchFormat = 'yyyyMMdd';
|
|
15822
|
+
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15823
|
+
class: ['vxe-date-panel--view-wrapper', `type--${datePanelType}`]
|
|
15824
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15825
|
+
class: 'vxe-date-panel--view-header'
|
|
15826
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15827
|
+
class: 'vxe-date-panel--view-row'
|
|
15828
|
+
}, dateHeaders.map(item => {
|
|
15829
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15830
|
+
class: 'vxe-date-panel--view-item',
|
|
15831
|
+
style: {
|
|
15832
|
+
width: `${100 / dateHeaders.length}%`
|
|
16058
15833
|
}
|
|
16059
|
-
}
|
|
16060
|
-
|
|
15834
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15835
|
+
class: 'vxe-date-panel--view-item-inner'
|
|
15836
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15837
|
+
class: 'vxe-date-panel--view-item-label'
|
|
15838
|
+
}, item.label)])]);
|
|
15839
|
+
}))]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15840
|
+
class: 'vxe-date-panel--view-body'
|
|
15841
|
+
}, dayDatas.map(rows => {
|
|
15842
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15843
|
+
class: 'vxe-date-panel--view-row',
|
|
15844
|
+
style: {
|
|
15845
|
+
height: `${100 / dayDatas.length}%`
|
|
15846
|
+
}
|
|
15847
|
+
}, rows.map(item => {
|
|
15848
|
+
const isSelected = multiple ? dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat);
|
|
15849
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15850
|
+
class: ['vxe-date-panel--view-item', {
|
|
15851
|
+
'is--prev': item.isPrev,
|
|
15852
|
+
'is--current': item.isCurrent,
|
|
15853
|
+
'is--now': item.isNow,
|
|
15854
|
+
'is--next': item.isNext,
|
|
15855
|
+
'is--disabled': isDateDisabled(item),
|
|
15856
|
+
'is--selected': isSelected,
|
|
15857
|
+
'is--over': overCount && !isSelected,
|
|
15858
|
+
'is--hover': !overCount && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat)
|
|
15859
|
+
}],
|
|
15860
|
+
style: {
|
|
15861
|
+
width: `${100 / rows.length}%`
|
|
15862
|
+
},
|
|
15863
|
+
onClick: () => dateSelectEvent(item),
|
|
15864
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
15865
|
+
onMouseleave: dateMouseleaveEvent
|
|
15866
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15867
|
+
class: 'vxe-date-panel--view-item-inner'
|
|
15868
|
+
}, renderDateLabel(item, item.label))]);
|
|
15869
|
+
}));
|
|
15870
|
+
}))])];
|
|
16061
15871
|
};
|
|
16062
|
-
const
|
|
15872
|
+
const renderDateWeekTable = () => {
|
|
16063
15873
|
const {
|
|
16064
|
-
|
|
15874
|
+
multiple
|
|
16065
15875
|
} = props;
|
|
16066
15876
|
const {
|
|
16067
|
-
|
|
15877
|
+
datePanelType,
|
|
15878
|
+
datePanelValue
|
|
16068
15879
|
} = reactData;
|
|
16069
|
-
const
|
|
16070
|
-
const
|
|
16071
|
-
|
|
16072
|
-
|
|
16073
|
-
|
|
16074
|
-
|
|
16075
|
-
|
|
16076
|
-
|
|
16077
|
-
|
|
16078
|
-
|
|
16079
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
|
|
16086
|
-
afterCheckValue();
|
|
16087
|
-
}
|
|
16088
|
-
isActivated = false;
|
|
16089
|
-
reactData.isActivated = isActivated;
|
|
16090
|
-
} else if (operArrow) {
|
|
16091
|
-
if (isDatePickerType) {
|
|
16092
|
-
if (isActivated) {
|
|
16093
|
-
if (visiblePanel) {
|
|
16094
|
-
dateOffsetEvent(evnt);
|
|
16095
|
-
} else if (isUpArrow || isDwArrow) {
|
|
16096
|
-
datePickerOpenEvent(evnt);
|
|
16097
|
-
}
|
|
16098
|
-
}
|
|
16099
|
-
}
|
|
16100
|
-
} else if (isEnter) {
|
|
16101
|
-
if (isDatePickerType) {
|
|
16102
|
-
if (visiblePanel) {
|
|
16103
|
-
if (reactData.datePanelValue) {
|
|
16104
|
-
dateSelectItem(reactData.datePanelValue);
|
|
16105
|
-
} else {
|
|
16106
|
-
hidePanel();
|
|
16107
|
-
}
|
|
16108
|
-
} else if (isActivated) {
|
|
16109
|
-
datePickerOpenEvent(evnt);
|
|
16110
|
-
}
|
|
16111
|
-
}
|
|
16112
|
-
} else if (isPgUp || isPgDn) {
|
|
16113
|
-
if (isDatePickerType) {
|
|
16114
|
-
if (isActivated) {
|
|
16115
|
-
datePgOffsetEvent(evnt);
|
|
16116
|
-
}
|
|
16117
|
-
}
|
|
16118
|
-
}
|
|
16119
|
-
if (isTab || isEsc) {
|
|
16120
|
-
if (visiblePanel) {
|
|
16121
|
-
hidePanel();
|
|
15880
|
+
const dateValue = computeDateValue.value;
|
|
15881
|
+
const weekHeaders = computeWeekHeaders.value;
|
|
15882
|
+
const weekDates = computeWeekDates.value;
|
|
15883
|
+
const dateListValue = computeDateListValue.value;
|
|
15884
|
+
const overCount = computeOverCount.value;
|
|
15885
|
+
const matchFormat = 'yyyyMMdd';
|
|
15886
|
+
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15887
|
+
class: ['vxe-date-panel--view-wrapper', `type--${datePanelType}`]
|
|
15888
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15889
|
+
class: 'vxe-date-panel--view-header'
|
|
15890
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15891
|
+
class: 'vxe-date-panel--view-row'
|
|
15892
|
+
}, weekHeaders.map((item, rIndex) => {
|
|
15893
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15894
|
+
class: 'vxe-date-panel--view-item',
|
|
15895
|
+
style: {
|
|
15896
|
+
width: `${rIndex ? 13 : 9}%`
|
|
16122
15897
|
}
|
|
16123
|
-
}
|
|
16124
|
-
|
|
16125
|
-
|
|
15898
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15899
|
+
class: 'vxe-date-panel--view-item-inner'
|
|
15900
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15901
|
+
class: 'vxe-date-panel--view-item-label'
|
|
15902
|
+
}, item.label)])]);
|
|
15903
|
+
}))]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15904
|
+
class: 'vxe-date-panel--view-body'
|
|
15905
|
+
}, weekDates.map(rows => {
|
|
15906
|
+
const isSelected = multiple ? rows.some(item => dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat))) : rows.some(item => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat));
|
|
15907
|
+
const isHover = rows.some(item => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat));
|
|
15908
|
+
const isNowWeek = rows.some(item => item.isNow);
|
|
15909
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15910
|
+
class: 'vxe-date-panel--view-row',
|
|
15911
|
+
style: {
|
|
15912
|
+
height: `${100 / weekDates.length}%`
|
|
16126
15913
|
}
|
|
16127
|
-
}
|
|
16128
|
-
|
|
15914
|
+
}, rows.map((item, rIndex) => {
|
|
15915
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15916
|
+
class: ['vxe-date-panel--view-item', {
|
|
15917
|
+
'is--prev': item.isPrev,
|
|
15918
|
+
'is--current': item.isCurrent,
|
|
15919
|
+
'is--now': rIndex ? item.isNow : isNowWeek,
|
|
15920
|
+
'is--next': item.isNext,
|
|
15921
|
+
'is--disabled': isDateDisabled(item),
|
|
15922
|
+
'is--selected': isSelected,
|
|
15923
|
+
'is--over': overCount && !isSelected,
|
|
15924
|
+
'is--hover': !overCount && isHover
|
|
15925
|
+
}],
|
|
15926
|
+
style: {
|
|
15927
|
+
width: `${rIndex ? 13 : 9}%`
|
|
15928
|
+
},
|
|
15929
|
+
onClick: () => dateSelectEvent(item),
|
|
15930
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
15931
|
+
onMouseleave: dateMouseleaveEvent
|
|
15932
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15933
|
+
class: 'vxe-date-panel--view-item-inner'
|
|
15934
|
+
}, renderDateLabel(item, item.label))]);
|
|
15935
|
+
}));
|
|
15936
|
+
}))])];
|
|
16129
15937
|
};
|
|
16130
|
-
const
|
|
15938
|
+
const renderDateMonthTable = () => {
|
|
16131
15939
|
const {
|
|
16132
|
-
|
|
16133
|
-
} =
|
|
16134
|
-
const isDisabled = computeIsDisabled.value;
|
|
16135
|
-
if (!isDisabled) {
|
|
16136
|
-
if (visiblePanel) {
|
|
16137
|
-
const panelWrapperElem = refPanelWrapper.value;
|
|
16138
|
-
if (getEventTargetNode(evnt, panelWrapperElem).flag) {
|
|
16139
|
-
updatePlacement();
|
|
16140
|
-
} else {
|
|
16141
|
-
hidePanel();
|
|
16142
|
-
afterCheckValue();
|
|
16143
|
-
}
|
|
16144
|
-
}
|
|
16145
|
-
}
|
|
16146
|
-
};
|
|
16147
|
-
const handleGlobalBlurEvent = () => {
|
|
15940
|
+
multiple
|
|
15941
|
+
} = props;
|
|
16148
15942
|
const {
|
|
16149
|
-
|
|
16150
|
-
|
|
15943
|
+
datePanelType,
|
|
15944
|
+
datePanelValue
|
|
16151
15945
|
} = reactData;
|
|
16152
|
-
|
|
16153
|
-
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
15946
|
+
const dateValue = computeDateValue.value;
|
|
15947
|
+
const monthDatas = computeMonthDatas.value;
|
|
15948
|
+
const dateListValue = computeDateListValue.value;
|
|
15949
|
+
const overCount = computeOverCount.value;
|
|
15950
|
+
const matchFormat = 'yyyyMM';
|
|
15951
|
+
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15952
|
+
class: ['vxe-date-panel--view-wrapper', `type--${datePanelType}`]
|
|
15953
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15954
|
+
class: 'vxe-date-panel--view-body'
|
|
15955
|
+
}, monthDatas.map(rows => {
|
|
15956
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15957
|
+
class: 'vxe-date-panel--view-row',
|
|
15958
|
+
style: {
|
|
15959
|
+
height: `${100 / monthDatas.length}%`
|
|
15960
|
+
}
|
|
15961
|
+
}, rows.map(item => {
|
|
15962
|
+
const isSelected = multiple ? dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat);
|
|
15963
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15964
|
+
class: ['vxe-date-panel--view-item', {
|
|
15965
|
+
'is--prev': item.isPrev,
|
|
15966
|
+
'is--current': item.isCurrent,
|
|
15967
|
+
'is--now': item.isNow,
|
|
15968
|
+
'is--next': item.isNext,
|
|
15969
|
+
'is--disabled': isDateDisabled(item),
|
|
15970
|
+
'is--selected': isSelected,
|
|
15971
|
+
'is--over': overCount && !isSelected,
|
|
15972
|
+
'is--hover': !overCount && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat)
|
|
15973
|
+
}],
|
|
15974
|
+
style: {
|
|
15975
|
+
width: `${100 / rows.length}%`
|
|
15976
|
+
},
|
|
15977
|
+
onClick: () => dateSelectEvent(item),
|
|
15978
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
15979
|
+
onMouseleave: dateMouseleaveEvent
|
|
15980
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
15981
|
+
class: 'vxe-date-panel--view-item-inner'
|
|
15982
|
+
}, renderDateLabel(item, i18n_getI18n(`vxe.input.date.months.m${item.month}`)))]);
|
|
15983
|
+
}));
|
|
15984
|
+
}))])];
|
|
15985
|
+
};
|
|
15986
|
+
const renderDateQuarterTable = () => {
|
|
15987
|
+
const {
|
|
15988
|
+
multiple
|
|
15989
|
+
} = props;
|
|
15990
|
+
const {
|
|
15991
|
+
datePanelType,
|
|
15992
|
+
datePanelValue
|
|
15993
|
+
} = reactData;
|
|
15994
|
+
const dateValue = computeDateValue.value;
|
|
15995
|
+
const quarterDatas = computeQuarterDatas.value;
|
|
15996
|
+
const dateListValue = computeDateListValue.value;
|
|
15997
|
+
const overCount = computeOverCount.value;
|
|
15998
|
+
const matchFormat = 'yyyyq';
|
|
15999
|
+
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16000
|
+
class: ['vxe-date-panel--view-wrapper', `type--${datePanelType}`]
|
|
16001
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16002
|
+
class: 'vxe-date-panel--view-body'
|
|
16003
|
+
}, quarterDatas.map(rows => {
|
|
16004
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16005
|
+
class: 'vxe-date-panel--view-row',
|
|
16006
|
+
style: {
|
|
16007
|
+
height: `${100 / quarterDatas.length}%`
|
|
16008
|
+
}
|
|
16009
|
+
}, rows.map(item => {
|
|
16010
|
+
const isSelected = multiple ? dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat);
|
|
16011
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16012
|
+
class: ['vxe-date-panel--view-item', {
|
|
16013
|
+
'is--prev': item.isPrev,
|
|
16014
|
+
'is--current': item.isCurrent,
|
|
16015
|
+
'is--now': item.isNow,
|
|
16016
|
+
'is--next': item.isNext,
|
|
16017
|
+
'is--disabled': isDateDisabled(item),
|
|
16018
|
+
'is--selected': isSelected,
|
|
16019
|
+
'is--over': overCount && !isSelected,
|
|
16020
|
+
'is--hover': !overCount && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat)
|
|
16021
|
+
}],
|
|
16022
|
+
style: {
|
|
16023
|
+
width: `${100 / rows.length}%`
|
|
16024
|
+
},
|
|
16025
|
+
onClick: () => dateSelectEvent(item),
|
|
16026
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
16027
|
+
onMouseleave: dateMouseleaveEvent
|
|
16028
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16029
|
+
class: 'vxe-date-panel--view-item-inner'
|
|
16030
|
+
}, renderDateLabel(item, i18n_getI18n(`vxe.input.date.quarters.q${item.quarter}`)))]);
|
|
16031
|
+
}));
|
|
16032
|
+
}))])];
|
|
16033
|
+
};
|
|
16034
|
+
const renderDateYearTable = () => {
|
|
16035
|
+
const {
|
|
16036
|
+
multiple
|
|
16037
|
+
} = props;
|
|
16038
|
+
const {
|
|
16039
|
+
datePanelType,
|
|
16040
|
+
datePanelValue
|
|
16041
|
+
} = reactData;
|
|
16042
|
+
const dateValue = computeDateValue.value;
|
|
16043
|
+
const yearDatas = computeYearDatas.value;
|
|
16044
|
+
const dateListValue = computeDateListValue.value;
|
|
16045
|
+
const overCount = computeOverCount.value;
|
|
16046
|
+
const matchFormat = 'yyyy';
|
|
16047
|
+
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16048
|
+
class: ['vxe-date-panel--view-wrapper', `type--${datePanelType}`]
|
|
16049
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16050
|
+
class: 'vxe-date-panel--view-body'
|
|
16051
|
+
}, yearDatas.map(rows => {
|
|
16052
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16053
|
+
class: 'vxe-date-panel--view-row',
|
|
16054
|
+
style: {
|
|
16055
|
+
height: `${100 / yearDatas.length}%`
|
|
16056
|
+
}
|
|
16057
|
+
}, rows.map(item => {
|
|
16058
|
+
const isSelected = multiple ? dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat);
|
|
16059
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16060
|
+
class: ['vxe-date-panel--view-item', {
|
|
16061
|
+
'is--prev': item.isPrev,
|
|
16062
|
+
'is--current': item.isCurrent,
|
|
16063
|
+
'is--now': item.isNow,
|
|
16064
|
+
'is--next': item.isNext,
|
|
16065
|
+
'is--disabled': isDateDisabled(item),
|
|
16066
|
+
'is--selected': isSelected,
|
|
16067
|
+
'is--over': overCount && !isSelected,
|
|
16068
|
+
'is--hover': !overCount && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat)
|
|
16069
|
+
}],
|
|
16070
|
+
style: {
|
|
16071
|
+
width: `${100 / rows.length}%`
|
|
16072
|
+
},
|
|
16073
|
+
onClick: () => dateSelectEvent(item),
|
|
16074
|
+
onMouseenter: () => dateMouseenterEvent(item),
|
|
16075
|
+
onMouseleave: dateMouseleaveEvent
|
|
16076
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16077
|
+
class: 'vxe-date-panel--view-item-inner'
|
|
16078
|
+
}, renderDateLabel(item, item.year))]);
|
|
16079
|
+
}));
|
|
16080
|
+
}))])];
|
|
16081
|
+
};
|
|
16082
|
+
const renderDateTable = () => {
|
|
16083
|
+
const {
|
|
16084
|
+
datePanelType
|
|
16085
|
+
} = reactData;
|
|
16086
|
+
switch (datePanelType) {
|
|
16087
|
+
case 'week':
|
|
16088
|
+
return renderDateWeekTable();
|
|
16089
|
+
case 'month':
|
|
16090
|
+
return renderDateMonthTable();
|
|
16091
|
+
case 'quarter':
|
|
16092
|
+
return renderDateQuarterTable();
|
|
16093
|
+
case 'year':
|
|
16094
|
+
return renderDateYearTable();
|
|
16095
|
+
}
|
|
16096
|
+
return renderDateDayTable();
|
|
16097
|
+
};
|
|
16098
|
+
const renderDatePanel = () => {
|
|
16099
|
+
const {
|
|
16100
|
+
datePanelType
|
|
16101
|
+
} = reactData;
|
|
16102
|
+
const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
|
|
16103
|
+
const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
|
|
16104
|
+
const selectDatePanelObj = computeSelectDatePanelObj.value;
|
|
16105
|
+
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16106
|
+
class: 'vxe-date-panel--picker-header'
|
|
16107
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16108
|
+
class: 'vxe-date-panel--picker-type-wrapper'
|
|
16109
|
+
}, [datePanelType === 'year' ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16110
|
+
class: 'vxe-date-panel--picker-label'
|
|
16111
|
+
}, selectDatePanelObj.y) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16112
|
+
class: 'vxe-date-panel--picker-btns'
|
|
16113
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16114
|
+
class: 'vxe-date-panel--picker-btn',
|
|
16115
|
+
onClick: dateToggleYearTypeEvent
|
|
16116
|
+
}, selectDatePanelObj.y), selectDatePanelObj.m ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16117
|
+
class: 'vxe-date-panel--picker-btn',
|
|
16118
|
+
onClick: dateToggleMonthTypeEvent
|
|
16119
|
+
}, selectDatePanelObj.m) : renderEmptyElement($xeDatePanel)])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16120
|
+
class: 'vxe-date-panel--picker-btn-wrapper'
|
|
16121
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16122
|
+
class: ['vxe-date-panel--picker-btn vxe-date-panel--picker-prev-btn', {
|
|
16123
|
+
'is--disabled': isDisabledPrevDateBtn
|
|
16124
|
+
}],
|
|
16125
|
+
onClick: datePrevEvent
|
|
16126
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16127
|
+
class: 'vxe-icon-caret-left'
|
|
16128
|
+
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16129
|
+
class: 'vxe-date-panel--picker-btn vxe-date-panel--picker-current-btn',
|
|
16130
|
+
onClick: dateTodayMonthEvent
|
|
16131
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16132
|
+
class: 'vxe-icon-dot'
|
|
16133
|
+
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16134
|
+
class: ['vxe-date-panel--picker-btn vxe-date-panel--picker-next-btn', {
|
|
16135
|
+
'is--disabled': isDisabledNextDateBtn
|
|
16136
|
+
}],
|
|
16137
|
+
onClick: dateNextEvent
|
|
16138
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16139
|
+
class: 'vxe-icon-caret-right'
|
|
16140
|
+
})])])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16141
|
+
class: 'vxe-date-panel--picker-body'
|
|
16142
|
+
}, renderDateTable())];
|
|
16143
|
+
};
|
|
16144
|
+
const renderTimePanel = () => {
|
|
16145
|
+
const {
|
|
16146
|
+
type
|
|
16147
|
+
} = props;
|
|
16148
|
+
const {
|
|
16149
|
+
datetimePanelValue
|
|
16150
|
+
} = reactData;
|
|
16151
|
+
const dateTimeLabel = computeDateTimeLabel.value;
|
|
16152
|
+
const hourList = computeHourList.value;
|
|
16153
|
+
const hasTimeMinute = computeHasTimeMinute.value;
|
|
16154
|
+
const minuteList = computeMinuteList.value;
|
|
16155
|
+
const hasTimeSecond = computeHasTimeSecond.value;
|
|
16156
|
+
const secondList = computeSecondList.value;
|
|
16157
|
+
return [type === 'time' ? renderEmptyElement($xeDatePanel) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16158
|
+
class: 'vxe-date-panel--time-header'
|
|
16159
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16160
|
+
class: 'vxe-date-panel--time-title'
|
|
16161
|
+
}, dateTimeLabel)]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16162
|
+
ref: refInputTimeBody,
|
|
16163
|
+
class: 'vxe-date-panel--time-body'
|
|
16164
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
16165
|
+
class: 'vxe-date-panel--time-hour-list'
|
|
16166
|
+
}, hourList.map((item, index) => {
|
|
16167
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
16168
|
+
key: index,
|
|
16169
|
+
class: {
|
|
16170
|
+
'is--selected': datetimePanelValue && datetimePanelValue.getHours() === item.value
|
|
16171
|
+
},
|
|
16172
|
+
onClick: evnt => dateHourEvent(evnt, item)
|
|
16173
|
+
}, item.label);
|
|
16174
|
+
})), hasTimeMinute ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
16175
|
+
class: 'vxe-date-panel--time-minute-list'
|
|
16176
|
+
}, minuteList.map((item, index) => {
|
|
16177
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
16178
|
+
key: index,
|
|
16179
|
+
class: {
|
|
16180
|
+
'is--selected': datetimePanelValue && datetimePanelValue.getMinutes() === item.value
|
|
16181
|
+
},
|
|
16182
|
+
onClick: evnt => dateMinuteEvent(evnt, item)
|
|
16183
|
+
}, item.label);
|
|
16184
|
+
})) : renderEmptyElement($xeDatePanel), hasTimeMinute && hasTimeSecond ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
16185
|
+
class: 'vxe-date-panel--time-second-list'
|
|
16186
|
+
}, secondList.map((item, index) => {
|
|
16187
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
16188
|
+
key: index,
|
|
16189
|
+
class: {
|
|
16190
|
+
'is--selected': datetimePanelValue && datetimePanelValue.getSeconds() === item.value
|
|
16191
|
+
},
|
|
16192
|
+
onClick: evnt => dateSecondEvent(evnt, item)
|
|
16193
|
+
}, item.label);
|
|
16194
|
+
})) : renderEmptyElement($xeDatePanel)])];
|
|
16195
|
+
};
|
|
16196
|
+
const renderPickerPanel = () => {
|
|
16197
|
+
const {
|
|
16198
|
+
type
|
|
16199
|
+
} = props;
|
|
16200
|
+
if (type === 'datetime') {
|
|
16201
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16202
|
+
key: type,
|
|
16203
|
+
ref: refPanelWrapper,
|
|
16204
|
+
class: 'vxe-date-panel--time-layout-wrapper'
|
|
16205
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16206
|
+
class: 'vxe-date-panel--time-left-wrapper'
|
|
16207
|
+
}, renderDatePanel()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16208
|
+
class: 'vxe-date-panel--time-right-wrapper'
|
|
16209
|
+
}, renderTimePanel())]);
|
|
16210
|
+
} else if (type === 'time') {
|
|
16211
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16212
|
+
key: type,
|
|
16213
|
+
ref: refPanelWrapper,
|
|
16214
|
+
class: 'vxe-date-panel--wrapper'
|
|
16215
|
+
}, renderTimePanel());
|
|
16216
|
+
}
|
|
16217
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16218
|
+
key: type || 'default',
|
|
16219
|
+
ref: refPanelWrapper,
|
|
16220
|
+
class: 'vxe-date-panel--wrapper'
|
|
16221
|
+
}, renderDatePanel());
|
|
16222
|
+
};
|
|
16223
|
+
const renderVN = () => {
|
|
16224
|
+
const {
|
|
16225
|
+
type
|
|
16226
|
+
} = props;
|
|
16227
|
+
const vSize = computeSize.value;
|
|
16228
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16229
|
+
class: ['vxe-date-panel', `type--${type}`, {
|
|
16230
|
+
[`size--${vSize}`]: vSize
|
|
16231
|
+
}]
|
|
16232
|
+
}, [renderPickerPanel()]);
|
|
16233
|
+
};
|
|
16234
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, val => {
|
|
16235
|
+
updateModelValue(val);
|
|
16236
|
+
changeValue();
|
|
16237
|
+
});
|
|
16238
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.type, () => {
|
|
16239
|
+
// 切换类型是重置内置变量
|
|
16240
|
+
Object.assign(reactData, {
|
|
16241
|
+
inputValue: '',
|
|
16242
|
+
datetimePanelValue: null,
|
|
16243
|
+
datePanelValue: null,
|
|
16244
|
+
datePanelLabel: '',
|
|
16245
|
+
datePanelType: 'day',
|
|
16246
|
+
selectMonth: null,
|
|
16247
|
+
currentDate: null
|
|
16248
|
+
});
|
|
16249
|
+
initValue();
|
|
16250
|
+
});
|
|
16251
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeDateLabelFormat, () => {
|
|
16252
|
+
const isDatePanelType = computeIsDatePanelType.value;
|
|
16253
|
+
if (isDatePanelType) {
|
|
16254
|
+
dateParseValue(reactData.datePanelValue);
|
|
16255
|
+
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
16256
|
+
}
|
|
16257
|
+
});
|
|
16258
|
+
initValue();
|
|
16259
|
+
dateOpenPanel();
|
|
16260
|
+
$xeDatePanel.renderVN = renderVN;
|
|
16261
|
+
return $xeDatePanel;
|
|
16262
|
+
},
|
|
16263
|
+
render() {
|
|
16264
|
+
return this.renderVN();
|
|
16265
|
+
}
|
|
16266
|
+
}));
|
|
16267
|
+
;// CONCATENATED MODULE: ./packages/date-panel/index.ts
|
|
16268
|
+
|
|
16269
|
+
|
|
16270
|
+
|
|
16271
|
+
const VxeDatePanel = Object.assign({}, date_panel, {
|
|
16272
|
+
install(app) {
|
|
16273
|
+
app.component(date_panel.name, date_panel);
|
|
16274
|
+
}
|
|
16275
|
+
});
|
|
16276
|
+
dynamicApp.use(VxeDatePanel);
|
|
16277
|
+
index_esm_VxeUI.component(date_panel);
|
|
16278
|
+
const DatePanel = VxeDatePanel;
|
|
16279
|
+
/* harmony default export */ var packages_date_panel = (VxeDatePanel);
|
|
16280
|
+
;// CONCATENATED MODULE: ./packages/date-picker/src/date-picker.ts
|
|
16281
|
+
|
|
16282
|
+
|
|
16283
|
+
|
|
16284
|
+
|
|
16285
|
+
|
|
16286
|
+
|
|
16287
|
+
|
|
16288
|
+
|
|
16289
|
+
|
|
16290
|
+
|
|
16291
|
+
|
|
16292
|
+
/* harmony default export */ var date_picker = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
16293
|
+
name: 'VxeDatePicker',
|
|
16294
|
+
props: {
|
|
16295
|
+
modelValue: [String, Number, Date],
|
|
16296
|
+
immediate: {
|
|
16297
|
+
type: Boolean,
|
|
16298
|
+
default: true
|
|
16299
|
+
},
|
|
16300
|
+
name: String,
|
|
16301
|
+
type: {
|
|
16302
|
+
type: String,
|
|
16303
|
+
default: 'date'
|
|
16304
|
+
},
|
|
16305
|
+
clearable: {
|
|
16306
|
+
type: Boolean,
|
|
16307
|
+
default: () => getConfig().datePicker.clearable
|
|
16308
|
+
},
|
|
16309
|
+
readonly: {
|
|
16310
|
+
type: Boolean,
|
|
16311
|
+
default: null
|
|
16312
|
+
},
|
|
16313
|
+
disabled: {
|
|
16314
|
+
type: Boolean,
|
|
16315
|
+
default: null
|
|
16316
|
+
},
|
|
16317
|
+
placeholder: String,
|
|
16318
|
+
autoComplete: {
|
|
16319
|
+
type: String,
|
|
16320
|
+
default: 'off'
|
|
16321
|
+
},
|
|
16322
|
+
form: String,
|
|
16323
|
+
className: String,
|
|
16324
|
+
size: {
|
|
16325
|
+
type: String,
|
|
16326
|
+
default: () => getConfig().datePicker.size || getConfig().size
|
|
16327
|
+
},
|
|
16328
|
+
multiple: Boolean,
|
|
16329
|
+
limitCount: {
|
|
16330
|
+
type: [String, Number],
|
|
16331
|
+
default: () => getConfig().upload.limitCount
|
|
16332
|
+
},
|
|
16333
|
+
// date、week、month、quarter、year
|
|
16334
|
+
startDate: {
|
|
16335
|
+
type: [String, Number, Date],
|
|
16336
|
+
default: () => getConfig().datePicker.startDate
|
|
16337
|
+
},
|
|
16338
|
+
endDate: {
|
|
16339
|
+
type: [String, Number, Date],
|
|
16340
|
+
default: () => getConfig().datePicker.endDate
|
|
16341
|
+
},
|
|
16342
|
+
minDate: [String, Number, Date],
|
|
16343
|
+
maxDate: [String, Number, Date],
|
|
16344
|
+
startDay: {
|
|
16345
|
+
type: [String, Number],
|
|
16346
|
+
default: () => getConfig().datePicker.startDay
|
|
16347
|
+
},
|
|
16348
|
+
labelFormat: String,
|
|
16349
|
+
valueFormat: String,
|
|
16350
|
+
editable: {
|
|
16351
|
+
type: Boolean,
|
|
16352
|
+
default: true
|
|
16353
|
+
},
|
|
16354
|
+
festivalMethod: {
|
|
16355
|
+
type: Function,
|
|
16356
|
+
default: () => getConfig().datePicker.festivalMethod
|
|
16357
|
+
},
|
|
16358
|
+
disabledMethod: {
|
|
16359
|
+
type: Function,
|
|
16360
|
+
default: () => getConfig().datePicker.disabledMethod
|
|
16361
|
+
},
|
|
16362
|
+
// week
|
|
16363
|
+
selectDay: {
|
|
16364
|
+
type: [String, Number],
|
|
16365
|
+
default: () => getConfig().datePicker.selectDay
|
|
16366
|
+
},
|
|
16367
|
+
showClearButton: {
|
|
16368
|
+
type: Boolean,
|
|
16369
|
+
default: () => getConfig().datePicker.showClearButton
|
|
16370
|
+
},
|
|
16371
|
+
showConfirmButton: {
|
|
16372
|
+
type: Boolean,
|
|
16373
|
+
default: () => getConfig().datePicker.showConfirmButton
|
|
16374
|
+
},
|
|
16375
|
+
autoClose: {
|
|
16376
|
+
type: Boolean,
|
|
16377
|
+
default: () => getConfig().datePicker.autoClose
|
|
16378
|
+
},
|
|
16379
|
+
prefixIcon: String,
|
|
16380
|
+
suffixIcon: String,
|
|
16381
|
+
placement: String,
|
|
16382
|
+
transfer: {
|
|
16383
|
+
type: Boolean,
|
|
16384
|
+
default: null
|
|
16385
|
+
},
|
|
16386
|
+
shortcutConfig: Object,
|
|
16387
|
+
// 已废弃 startWeek,被 startDay 替换
|
|
16388
|
+
startWeek: Number
|
|
16389
|
+
},
|
|
16390
|
+
emits: ['update:modelValue', 'input', 'change', 'keydown', 'keyup', 'click', 'focus', 'blur', 'clear', 'prefix-click', 'suffix-click', 'date-prev', 'date-today', 'date-next', 'shortcut-click'],
|
|
16391
|
+
setup(props, context) {
|
|
16392
|
+
const {
|
|
16393
|
+
slots,
|
|
16394
|
+
emit
|
|
16395
|
+
} = context;
|
|
16396
|
+
const $xeModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeModal', null);
|
|
16397
|
+
const $xeDrawer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeDrawer', null);
|
|
16398
|
+
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
|
|
16399
|
+
const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
|
|
16400
|
+
const formItemInfo = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('xeFormItemInfo', null);
|
|
16401
|
+
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
16402
|
+
const {
|
|
16403
|
+
computeSize
|
|
16404
|
+
} = useSize(props);
|
|
16405
|
+
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
16406
|
+
initialized: false,
|
|
16407
|
+
panelIndex: 0,
|
|
16408
|
+
visiblePanel: false,
|
|
16409
|
+
isAniVisible: false,
|
|
16410
|
+
panelStyle: {},
|
|
16411
|
+
panelPlacement: '',
|
|
16412
|
+
isActivated: false,
|
|
16413
|
+
inputValue: '',
|
|
16414
|
+
inputLabel: ''
|
|
16415
|
+
});
|
|
16416
|
+
const internalData = {
|
|
16417
|
+
hpTimeout: undefined
|
|
16418
|
+
};
|
|
16419
|
+
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
16420
|
+
const refInputTarget = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
16421
|
+
const refInputPanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
16422
|
+
const refPanelWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
16423
|
+
const refDatePanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
16424
|
+
const refMaps = {
|
|
16425
|
+
refElem,
|
|
16426
|
+
refInput: refInputTarget
|
|
16427
|
+
};
|
|
16428
|
+
const $xeDatePicker = {
|
|
16429
|
+
xID,
|
|
16430
|
+
props,
|
|
16431
|
+
context,
|
|
16432
|
+
reactData,
|
|
16433
|
+
internalData,
|
|
16434
|
+
getRefMaps: () => refMaps
|
|
16435
|
+
};
|
|
16436
|
+
const computeBtnTransfer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16437
|
+
const {
|
|
16438
|
+
transfer
|
|
16439
|
+
} = props;
|
|
16440
|
+
if (transfer === null) {
|
|
16441
|
+
const globalTransfer = getConfig().datePicker.transfer;
|
|
16442
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
|
|
16443
|
+
return globalTransfer;
|
|
16444
|
+
}
|
|
16445
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
16446
|
+
return true;
|
|
16447
|
+
}
|
|
16448
|
+
}
|
|
16449
|
+
return transfer;
|
|
16450
|
+
});
|
|
16451
|
+
const computeFormReadonly = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16452
|
+
const {
|
|
16453
|
+
readonly
|
|
16454
|
+
} = props;
|
|
16455
|
+
if (readonly === null) {
|
|
16456
|
+
if ($xeForm) {
|
|
16457
|
+
return $xeForm.props.readonly;
|
|
16458
|
+
}
|
|
16459
|
+
return false;
|
|
16460
|
+
}
|
|
16461
|
+
return readonly;
|
|
16462
|
+
});
|
|
16463
|
+
const computeIsDisabled = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16464
|
+
const {
|
|
16465
|
+
disabled
|
|
16466
|
+
} = props;
|
|
16467
|
+
if (disabled === null) {
|
|
16468
|
+
if ($xeForm) {
|
|
16469
|
+
return $xeForm.props.disabled;
|
|
16470
|
+
}
|
|
16471
|
+
return false;
|
|
16472
|
+
}
|
|
16473
|
+
return disabled;
|
|
16474
|
+
});
|
|
16475
|
+
const computeIsDateTimeType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16476
|
+
const {
|
|
16477
|
+
type
|
|
16478
|
+
} = props;
|
|
16479
|
+
return type === 'time' || type === 'datetime';
|
|
16480
|
+
});
|
|
16481
|
+
const computeIsDatePickerType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16482
|
+
const isDateTimeType = computeIsDateTimeType.value;
|
|
16483
|
+
return isDateTimeType || ['date', 'week', 'month', 'quarter', 'year'].indexOf(props.type) > -1;
|
|
16484
|
+
});
|
|
16485
|
+
const computeIsClearable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16486
|
+
return props.clearable;
|
|
16487
|
+
});
|
|
16488
|
+
const computeInputReadonly = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16489
|
+
const {
|
|
16490
|
+
type,
|
|
16491
|
+
editable,
|
|
16492
|
+
multiple
|
|
16493
|
+
} = props;
|
|
16494
|
+
const formReadonly = computeFormReadonly.value;
|
|
16495
|
+
return formReadonly || multiple || !editable || type === 'week' || type === 'quarter';
|
|
16496
|
+
});
|
|
16497
|
+
const computeInpPlaceholder = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16498
|
+
const {
|
|
16499
|
+
placeholder
|
|
16500
|
+
} = props;
|
|
16501
|
+
if (placeholder) {
|
|
16502
|
+
return getFuncText(placeholder);
|
|
16503
|
+
}
|
|
16504
|
+
const globalPlaceholder = getConfig().datePicker.placeholder;
|
|
16505
|
+
if (globalPlaceholder) {
|
|
16506
|
+
return getFuncText(globalPlaceholder);
|
|
16507
|
+
}
|
|
16508
|
+
return i18n_getI18n('vxe.base.pleaseSelect');
|
|
16509
|
+
});
|
|
16510
|
+
const computeInpImmediate = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16511
|
+
const {
|
|
16512
|
+
immediate
|
|
16513
|
+
} = props;
|
|
16514
|
+
return immediate;
|
|
16515
|
+
});
|
|
16516
|
+
const computeShortcutOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16517
|
+
return Object.assign({}, getConfig().datePicker.shortcutConfig, props.shortcutConfig);
|
|
16518
|
+
});
|
|
16519
|
+
const computeShortcutList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16520
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
16521
|
+
const {
|
|
16522
|
+
options
|
|
16523
|
+
} = shortcutOpts;
|
|
16524
|
+
if (options) {
|
|
16525
|
+
return options.map((option, index) => {
|
|
16526
|
+
return Object.assign({
|
|
16527
|
+
name: `${option.name || option.code || index}`
|
|
16528
|
+
}, option);
|
|
16529
|
+
});
|
|
16530
|
+
}
|
|
16531
|
+
return [];
|
|
16532
|
+
});
|
|
16533
|
+
const computeDateLabelFormat = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16534
|
+
const {
|
|
16535
|
+
labelFormat
|
|
16536
|
+
} = props;
|
|
16537
|
+
return labelFormat || i18n_getI18n(`vxe.input.date.labelFormat.${props.type}`);
|
|
16538
|
+
});
|
|
16539
|
+
const computeDateValueFormat = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16540
|
+
const {
|
|
16541
|
+
type,
|
|
16542
|
+
valueFormat
|
|
16543
|
+
} = props;
|
|
16544
|
+
if (valueFormat) {
|
|
16545
|
+
return valueFormat;
|
|
16546
|
+
}
|
|
16547
|
+
if (type === 'time') {
|
|
16548
|
+
return 'HH:mm:ss';
|
|
16549
|
+
}
|
|
16550
|
+
if (type === 'datetime') {
|
|
16551
|
+
return 'yyyy-MM-dd HH:mm:ss';
|
|
16552
|
+
}
|
|
16553
|
+
return 'yyyy-MM-dd';
|
|
16554
|
+
});
|
|
16555
|
+
const computeFirstDayOfWeek = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16556
|
+
const {
|
|
16557
|
+
startDay
|
|
16558
|
+
} = props;
|
|
16559
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(startDay);
|
|
16560
|
+
});
|
|
16561
|
+
const computePanelLabel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
16562
|
+
const {
|
|
16563
|
+
type,
|
|
16564
|
+
multiple
|
|
16565
|
+
} = props;
|
|
16566
|
+
const {
|
|
16567
|
+
inputValue
|
|
16568
|
+
} = reactData;
|
|
16569
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
16570
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
16571
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
16572
|
+
const vals = inputValue ? multiple ? inputValue.split(',') : [inputValue] : [];
|
|
16573
|
+
return vals.map(val => {
|
|
16574
|
+
const dateObj = parseDateObj(val, type, {
|
|
16575
|
+
valueFormat: dateValueFormat,
|
|
16576
|
+
labelFormat: dateLabelFormat,
|
|
16577
|
+
firstDay: firstDayOfWeek
|
|
16578
|
+
});
|
|
16579
|
+
return dateObj.label;
|
|
16580
|
+
}).join(', ');
|
|
16581
|
+
});
|
|
16582
|
+
const updateModelValue = () => {
|
|
16583
|
+
const {
|
|
16584
|
+
modelValue
|
|
16585
|
+
} = props;
|
|
16586
|
+
let val = '';
|
|
16587
|
+
if (modelValue) {
|
|
16588
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(modelValue) && /^[0-9]{11,15}$/.test(`${modelValue}`)) {
|
|
16589
|
+
val = new Date(modelValue);
|
|
16590
|
+
} else {
|
|
16591
|
+
val = modelValue;
|
|
16592
|
+
}
|
|
16593
|
+
}
|
|
16594
|
+
reactData.inputValue = val;
|
|
16595
|
+
};
|
|
16596
|
+
const triggerEvent = evnt => {
|
|
16597
|
+
const {
|
|
16598
|
+
inputValue
|
|
16599
|
+
} = reactData;
|
|
16600
|
+
dispatchEvent(evnt.type, {
|
|
16601
|
+
value: inputValue
|
|
16602
|
+
}, evnt);
|
|
16603
|
+
};
|
|
16604
|
+
const handleChange = (value, evnt) => {
|
|
16605
|
+
const {
|
|
16606
|
+
modelValue
|
|
16607
|
+
} = props;
|
|
16608
|
+
reactData.inputValue = value;
|
|
16609
|
+
emit('update:modelValue', value);
|
|
16610
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(modelValue) !== value) {
|
|
16611
|
+
dispatchEvent('change', {
|
|
16612
|
+
value
|
|
16613
|
+
}, evnt);
|
|
16614
|
+
// 自动更新校验状态
|
|
16615
|
+
if ($xeForm && formItemInfo) {
|
|
16616
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
16617
|
+
}
|
|
16618
|
+
}
|
|
16619
|
+
};
|
|
16620
|
+
const inputEvent = evnt => {
|
|
16621
|
+
const inputElem = evnt.target;
|
|
16622
|
+
const value = inputElem.value;
|
|
16623
|
+
reactData.inputLabel = value;
|
|
16624
|
+
dispatchEvent('input', {
|
|
16625
|
+
value
|
|
16626
|
+
}, evnt);
|
|
16627
|
+
};
|
|
16628
|
+
const changeEvent = evnt => {
|
|
16629
|
+
const inpImmediate = computeInpImmediate.value;
|
|
16630
|
+
if (!inpImmediate) {
|
|
16631
|
+
triggerEvent(evnt);
|
|
16632
|
+
}
|
|
16633
|
+
};
|
|
16634
|
+
const focusEvent = evnt => {
|
|
16635
|
+
reactData.isActivated = true;
|
|
16636
|
+
const isDatePickerType = computeIsDatePickerType.value;
|
|
16637
|
+
if (isDatePickerType) {
|
|
16638
|
+
datePickerOpenEvent(evnt);
|
|
16639
|
+
}
|
|
16640
|
+
triggerEvent(evnt);
|
|
16641
|
+
};
|
|
16642
|
+
const clickPrefixEvent = evnt => {
|
|
16643
|
+
const isDisabled = computeIsDisabled.value;
|
|
16644
|
+
if (!isDisabled) {
|
|
16645
|
+
const {
|
|
16646
|
+
inputValue
|
|
16647
|
+
} = reactData;
|
|
16648
|
+
dispatchEvent('prefix-click', {
|
|
16649
|
+
value: inputValue
|
|
16650
|
+
}, evnt);
|
|
16651
|
+
}
|
|
16652
|
+
};
|
|
16653
|
+
const hidePanel = () => {
|
|
16654
|
+
return new Promise(resolve => {
|
|
16655
|
+
reactData.visiblePanel = false;
|
|
16656
|
+
internalData.hpTimeout = setTimeout(() => {
|
|
16657
|
+
reactData.isAniVisible = false;
|
|
16658
|
+
resolve();
|
|
16659
|
+
}, 350);
|
|
16660
|
+
});
|
|
16661
|
+
};
|
|
16662
|
+
const clearValueEvent = (evnt, value) => {
|
|
16663
|
+
const isDatePickerType = computeIsDatePickerType.value;
|
|
16664
|
+
if (isDatePickerType) {
|
|
16665
|
+
hidePanel();
|
|
16666
|
+
}
|
|
16667
|
+
handleChange('', evnt);
|
|
16668
|
+
dispatchEvent('clear', {
|
|
16669
|
+
value
|
|
16670
|
+
}, evnt);
|
|
16671
|
+
};
|
|
16672
|
+
const clickSuffixEvent = evnt => {
|
|
16673
|
+
const isDisabled = computeIsDisabled.value;
|
|
16674
|
+
if (!isDisabled) {
|
|
16675
|
+
const {
|
|
16676
|
+
inputValue
|
|
16677
|
+
} = reactData;
|
|
16678
|
+
dispatchEvent('suffix-click', {
|
|
16679
|
+
value: inputValue
|
|
16680
|
+
}, evnt);
|
|
16681
|
+
}
|
|
16682
|
+
};
|
|
16683
|
+
const blurEvent = evnt => {
|
|
16684
|
+
const $datePanel = refDatePanel.value;
|
|
16685
|
+
const {
|
|
16686
|
+
inputValue
|
|
16687
|
+
} = reactData;
|
|
16688
|
+
const inpImmediate = computeInpImmediate.value;
|
|
16689
|
+
const value = inputValue;
|
|
16690
|
+
if (!inpImmediate) {
|
|
16691
|
+
handleChange(value, evnt);
|
|
16692
|
+
}
|
|
16693
|
+
if (!reactData.visiblePanel) {
|
|
16694
|
+
reactData.isActivated = false;
|
|
16695
|
+
}
|
|
16696
|
+
if ($datePanel) {
|
|
16697
|
+
$datePanel.checkValue(reactData.inputLabel);
|
|
16698
|
+
}
|
|
16699
|
+
dispatchEvent('blur', {
|
|
16700
|
+
value
|
|
16701
|
+
}, evnt);
|
|
16702
|
+
// 自动更新校验状态
|
|
16703
|
+
if ($xeForm && formItemInfo) {
|
|
16704
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
16705
|
+
}
|
|
16706
|
+
};
|
|
16707
|
+
const keydownEvent = evnt => {
|
|
16708
|
+
triggerEvent(evnt);
|
|
16709
|
+
};
|
|
16710
|
+
const keyupEvent = evnt => {
|
|
16711
|
+
triggerEvent(evnt);
|
|
16712
|
+
};
|
|
16713
|
+
const confirmEvent = evnt => {
|
|
16714
|
+
const $datePanel = refDatePanel.value;
|
|
16715
|
+
if ($datePanel) {
|
|
16716
|
+
$datePanel.confirmByEvent(evnt);
|
|
16717
|
+
}
|
|
16718
|
+
hidePanel();
|
|
16719
|
+
};
|
|
16720
|
+
const panelChangeEvent = params => {
|
|
16721
|
+
const {
|
|
16722
|
+
multiple
|
|
16723
|
+
} = props;
|
|
16724
|
+
const {
|
|
16725
|
+
value,
|
|
16726
|
+
$event
|
|
16727
|
+
} = params;
|
|
16728
|
+
const isDateTimeType = computeIsDateTimeType.value;
|
|
16729
|
+
handleChange(value, $event);
|
|
16730
|
+
if (!multiple && !isDateTimeType) {
|
|
16731
|
+
hidePanel();
|
|
16732
|
+
}
|
|
16733
|
+
};
|
|
16734
|
+
// 全局事件
|
|
16735
|
+
const handleGlobalMousedownEvent = evnt => {
|
|
16736
|
+
const $datePanel = refDatePanel.value;
|
|
16737
|
+
const {
|
|
16738
|
+
visiblePanel,
|
|
16739
|
+
isActivated
|
|
16740
|
+
} = reactData;
|
|
16741
|
+
const el = refElem.value;
|
|
16742
|
+
const panelWrapperElem = refPanelWrapper.value;
|
|
16743
|
+
const isDisabled = computeIsDisabled.value;
|
|
16744
|
+
if (!isDisabled && isActivated) {
|
|
16745
|
+
reactData.isActivated = getEventTargetNode(evnt, el).flag || getEventTargetNode(evnt, panelWrapperElem).flag;
|
|
16746
|
+
if (!reactData.isActivated) {
|
|
16747
|
+
if (visiblePanel) {
|
|
16748
|
+
hidePanel();
|
|
16749
|
+
if ($datePanel) {
|
|
16750
|
+
$datePanel.checkValue(reactData.inputLabel);
|
|
16751
|
+
}
|
|
16752
|
+
}
|
|
16753
|
+
}
|
|
16754
|
+
}
|
|
16755
|
+
};
|
|
16756
|
+
const handleGlobalMousewheelEvent = evnt => {
|
|
16757
|
+
const {
|
|
16758
|
+
visiblePanel
|
|
16759
|
+
} = reactData;
|
|
16760
|
+
const isDisabled = computeIsDisabled.value;
|
|
16761
|
+
if (!isDisabled) {
|
|
16762
|
+
if (visiblePanel) {
|
|
16763
|
+
const panelWrapperElem = refPanelWrapper.value;
|
|
16764
|
+
if (getEventTargetNode(evnt, panelWrapperElem).flag) {
|
|
16765
|
+
updatePlacement();
|
|
16766
|
+
} else {
|
|
16767
|
+
hidePanel();
|
|
16768
|
+
}
|
|
16769
|
+
}
|
|
16770
|
+
}
|
|
16771
|
+
};
|
|
16772
|
+
const handleGlobalBlurEvent = () => {
|
|
16773
|
+
const $datePanel = refDatePanel.value;
|
|
16774
|
+
const {
|
|
16775
|
+
isActivated,
|
|
16776
|
+
visiblePanel
|
|
16777
|
+
} = reactData;
|
|
16778
|
+
if (visiblePanel) {
|
|
16779
|
+
hidePanel();
|
|
16780
|
+
if ($datePanel) {
|
|
16781
|
+
$datePanel.checkValue(reactData.inputLabel);
|
|
16782
|
+
}
|
|
16783
|
+
} else if (isActivated) {
|
|
16784
|
+
if ($datePanel) {
|
|
16785
|
+
$datePanel.checkValue(reactData.inputLabel);
|
|
16786
|
+
}
|
|
16787
|
+
}
|
|
16788
|
+
};
|
|
16789
|
+
// 弹出面板
|
|
16790
|
+
const updateZindex = () => {
|
|
16791
|
+
if (reactData.panelIndex < getLastZIndex()) {
|
|
16792
|
+
reactData.panelIndex = nextZIndex();
|
|
16793
|
+
}
|
|
16794
|
+
};
|
|
16795
|
+
const updatePlacement = () => {
|
|
16796
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
16797
|
+
const {
|
|
16798
|
+
placement
|
|
16799
|
+
} = props;
|
|
16800
|
+
const {
|
|
16801
|
+
panelIndex
|
|
16802
|
+
} = reactData;
|
|
16803
|
+
const targetElem = refInputTarget.value;
|
|
16804
|
+
const panelElem = refInputPanel.value;
|
|
16805
|
+
const btnTransfer = computeBtnTransfer.value;
|
|
16806
|
+
if (targetElem && panelElem) {
|
|
16807
|
+
const targetHeight = targetElem.offsetHeight;
|
|
16808
|
+
const targetWidth = targetElem.offsetWidth;
|
|
16809
|
+
const panelHeight = panelElem.offsetHeight;
|
|
16810
|
+
const panelWidth = panelElem.offsetWidth;
|
|
16811
|
+
const marginSize = 5;
|
|
16812
|
+
const panelStyle = {
|
|
16813
|
+
zIndex: panelIndex
|
|
16814
|
+
};
|
|
16815
|
+
const {
|
|
16816
|
+
boundingTop,
|
|
16817
|
+
boundingLeft,
|
|
16818
|
+
visibleHeight,
|
|
16819
|
+
visibleWidth
|
|
16820
|
+
} = getAbsolutePos(targetElem);
|
|
16821
|
+
let panelPlacement = 'bottom';
|
|
16822
|
+
if (btnTransfer) {
|
|
16823
|
+
let left = boundingLeft;
|
|
16824
|
+
let top = boundingTop + targetHeight;
|
|
16825
|
+
if (placement === 'top') {
|
|
16826
|
+
panelPlacement = 'top';
|
|
16827
|
+
top = boundingTop - panelHeight;
|
|
16828
|
+
} else if (!placement) {
|
|
16829
|
+
// 如果下面不够放,则向上
|
|
16830
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
16831
|
+
panelPlacement = 'top';
|
|
16832
|
+
top = boundingTop - panelHeight;
|
|
16833
|
+
}
|
|
16834
|
+
// 如果上面不够放,则向下(优先)
|
|
16835
|
+
if (top < marginSize) {
|
|
16836
|
+
panelPlacement = 'bottom';
|
|
16837
|
+
top = boundingTop + targetHeight;
|
|
16838
|
+
}
|
|
16839
|
+
}
|
|
16840
|
+
// 如果溢出右边
|
|
16841
|
+
if (left + panelWidth + marginSize > visibleWidth) {
|
|
16842
|
+
left -= left + panelWidth + marginSize - visibleWidth;
|
|
16843
|
+
}
|
|
16844
|
+
// 如果溢出左边
|
|
16845
|
+
if (left < marginSize) {
|
|
16846
|
+
left = marginSize;
|
|
16847
|
+
}
|
|
16848
|
+
Object.assign(panelStyle, {
|
|
16849
|
+
left: `${left}px`,
|
|
16850
|
+
top: `${top}px`,
|
|
16851
|
+
minWidth: `${targetWidth}px`
|
|
16852
|
+
});
|
|
16853
|
+
} else {
|
|
16854
|
+
if (placement === 'top') {
|
|
16855
|
+
panelPlacement = 'top';
|
|
16856
|
+
panelStyle.bottom = `${targetHeight}px`;
|
|
16857
|
+
} else if (!placement) {
|
|
16858
|
+
// 如果下面不够放,则向上
|
|
16859
|
+
panelStyle.top = `${targetHeight}px`;
|
|
16860
|
+
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
16861
|
+
// 如果上面不够放,则向下(优先)
|
|
16862
|
+
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
16863
|
+
panelPlacement = 'top';
|
|
16864
|
+
panelStyle.top = '';
|
|
16865
|
+
panelStyle.bottom = `${targetHeight}px`;
|
|
16866
|
+
}
|
|
16867
|
+
}
|
|
16868
|
+
}
|
|
16869
|
+
}
|
|
16870
|
+
reactData.panelStyle = panelStyle;
|
|
16871
|
+
reactData.panelPlacement = panelPlacement;
|
|
16872
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
16873
|
+
}
|
|
16874
|
+
});
|
|
16875
|
+
};
|
|
16876
|
+
const showPanel = () => {
|
|
16877
|
+
const {
|
|
16878
|
+
visiblePanel
|
|
16879
|
+
} = reactData;
|
|
16880
|
+
const isDisabled = computeIsDisabled.value;
|
|
16881
|
+
if (!isDisabled && !visiblePanel) {
|
|
16882
|
+
if (!reactData.initialized) {
|
|
16883
|
+
reactData.initialized = true;
|
|
16884
|
+
}
|
|
16885
|
+
if (internalData.hpTimeout) {
|
|
16886
|
+
clearTimeout(internalData.hpTimeout);
|
|
16887
|
+
internalData.hpTimeout = undefined;
|
|
16888
|
+
}
|
|
16889
|
+
reactData.isActivated = true;
|
|
16890
|
+
reactData.isAniVisible = true;
|
|
16891
|
+
setTimeout(() => {
|
|
16892
|
+
reactData.visiblePanel = true;
|
|
16893
|
+
}, 10);
|
|
16894
|
+
updateZindex();
|
|
16895
|
+
return updatePlacement();
|
|
16896
|
+
}
|
|
16897
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
16898
|
+
};
|
|
16899
|
+
const datePickerOpenEvent = evnt => {
|
|
16900
|
+
const formReadonly = computeFormReadonly.value;
|
|
16901
|
+
if (!formReadonly) {
|
|
16902
|
+
evnt.preventDefault();
|
|
16903
|
+
showPanel();
|
|
16904
|
+
}
|
|
16905
|
+
};
|
|
16906
|
+
const clickEvent = evnt => {
|
|
16907
|
+
triggerEvent(evnt);
|
|
16908
|
+
};
|
|
16909
|
+
const handleShortcutEvent = ({
|
|
16910
|
+
option,
|
|
16911
|
+
$event
|
|
16912
|
+
}) => {
|
|
16913
|
+
const {
|
|
16914
|
+
type
|
|
16915
|
+
} = props;
|
|
16916
|
+
const {
|
|
16917
|
+
inputValue
|
|
16918
|
+
} = reactData;
|
|
16919
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
16920
|
+
const {
|
|
16921
|
+
autoClose
|
|
16922
|
+
} = shortcutOpts;
|
|
16923
|
+
const {
|
|
16924
|
+
code,
|
|
16925
|
+
clickMethod
|
|
16926
|
+
} = option;
|
|
16927
|
+
let value = inputValue;
|
|
16928
|
+
const shortcutParams = {
|
|
16929
|
+
$datePicker: $xeDatePicker,
|
|
16930
|
+
option,
|
|
16931
|
+
value,
|
|
16932
|
+
code
|
|
16933
|
+
};
|
|
16934
|
+
if (!clickMethod && code) {
|
|
16935
|
+
const gCommandOpts = commands.get(code);
|
|
16936
|
+
const dpCommandMethod = gCommandOpts ? gCommandOpts.datePickerCommandMethod : null;
|
|
16937
|
+
if (dpCommandMethod) {
|
|
16938
|
+
dpCommandMethod(shortcutParams);
|
|
16939
|
+
} else {
|
|
16940
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
16941
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
16942
|
+
switch (code) {
|
|
16943
|
+
case 'now':
|
|
16944
|
+
case 'prev':
|
|
16945
|
+
case 'next':
|
|
16946
|
+
case 'minus':
|
|
16947
|
+
case 'plus':
|
|
16948
|
+
{
|
|
16949
|
+
const restObj = getDateByCode(code, value, type, {
|
|
16950
|
+
valueFormat: dateValueFormat,
|
|
16951
|
+
firstDay: firstDayOfWeek
|
|
16952
|
+
});
|
|
16953
|
+
value = restObj.value;
|
|
16954
|
+
shortcutParams.value = value;
|
|
16955
|
+
handleChange(value, $event);
|
|
16956
|
+
break;
|
|
16957
|
+
}
|
|
16958
|
+
default:
|
|
16959
|
+
errLog('vxe.error.notCommands', [code]);
|
|
16960
|
+
break;
|
|
16961
|
+
}
|
|
16962
|
+
}
|
|
16963
|
+
} else {
|
|
16964
|
+
const optClickMethod = clickMethod || shortcutOpts.clickMethod;
|
|
16965
|
+
if (optClickMethod) {
|
|
16966
|
+
optClickMethod(shortcutParams);
|
|
16967
|
+
}
|
|
16968
|
+
}
|
|
16969
|
+
if (autoClose) {
|
|
16970
|
+
hidePanel();
|
|
16971
|
+
}
|
|
16972
|
+
dispatchEvent('shortcut-click', shortcutParams, $event);
|
|
16973
|
+
};
|
|
16974
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
16975
|
+
emit(type, createEvent(evnt, {
|
|
16976
|
+
$datePicker: $xeDatePicker
|
|
16977
|
+
}, params));
|
|
16978
|
+
};
|
|
16979
|
+
const datePickerMethods = {
|
|
16980
|
+
dispatchEvent,
|
|
16981
|
+
setModelValue(value) {
|
|
16982
|
+
reactData.inputValue = value;
|
|
16983
|
+
emit('update:modelValue', value);
|
|
16984
|
+
},
|
|
16985
|
+
setModelValueByEvent(evnt, value) {
|
|
16986
|
+
handleChange(value || '', evnt);
|
|
16987
|
+
},
|
|
16988
|
+
focus() {
|
|
16989
|
+
const inputElem = refInputTarget.value;
|
|
16990
|
+
reactData.isActivated = true;
|
|
16991
|
+
inputElem.focus();
|
|
16992
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
16993
|
+
},
|
|
16994
|
+
blur() {
|
|
16995
|
+
const inputElem = refInputTarget.value;
|
|
16996
|
+
inputElem.blur();
|
|
16997
|
+
reactData.isActivated = false;
|
|
16998
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
16999
|
+
},
|
|
17000
|
+
select() {
|
|
17001
|
+
const inputElem = refInputTarget.value;
|
|
17002
|
+
inputElem.select();
|
|
17003
|
+
reactData.isActivated = false;
|
|
17004
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
17005
|
+
},
|
|
17006
|
+
showPanel,
|
|
17007
|
+
hidePanel,
|
|
17008
|
+
updatePlacement
|
|
17009
|
+
};
|
|
17010
|
+
Object.assign($xeDatePicker, datePickerMethods);
|
|
17011
|
+
const renderShortcutBtn = (pos, isVertical) => {
|
|
17012
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
17013
|
+
const {
|
|
17014
|
+
position,
|
|
17015
|
+
align,
|
|
17016
|
+
mode
|
|
17017
|
+
} = shortcutOpts;
|
|
17018
|
+
const shortcutList = computeShortcutList.value;
|
|
17019
|
+
if (isEnableConf(shortcutOpts) && shortcutList.length && (position || 'left') === pos) {
|
|
17020
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17021
|
+
class: `vxe-date-picker--layout-${pos}-wrapper`
|
|
17022
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(button_group, {
|
|
17023
|
+
options: shortcutList,
|
|
17024
|
+
mode,
|
|
17025
|
+
align,
|
|
17026
|
+
vertical: isVertical,
|
|
17027
|
+
onClick: handleShortcutEvent
|
|
17028
|
+
})]);
|
|
17029
|
+
}
|
|
17030
|
+
return renderEmptyElement($xeDatePicker);
|
|
17031
|
+
};
|
|
17032
|
+
const renderPanel = () => {
|
|
17033
|
+
const {
|
|
17034
|
+
type,
|
|
17035
|
+
multiple,
|
|
17036
|
+
showClearButton,
|
|
17037
|
+
showConfirmButton
|
|
17038
|
+
} = props;
|
|
17039
|
+
const {
|
|
17040
|
+
initialized,
|
|
17041
|
+
isAniVisible,
|
|
17042
|
+
visiblePanel,
|
|
17043
|
+
panelPlacement,
|
|
17044
|
+
panelStyle,
|
|
17045
|
+
inputValue
|
|
17046
|
+
} = reactData;
|
|
17047
|
+
const vSize = computeSize.value;
|
|
17048
|
+
const btnTransfer = computeBtnTransfer.value;
|
|
17049
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
17050
|
+
const isClearable = computeIsClearable.value;
|
|
17051
|
+
const isDateTimeType = computeIsDateTimeType.value;
|
|
17052
|
+
const shortcutList = computeShortcutList.value;
|
|
17053
|
+
const {
|
|
17054
|
+
position
|
|
17055
|
+
} = shortcutOpts;
|
|
17056
|
+
const headerSlot = slots.header;
|
|
17057
|
+
const footerSlot = slots.footer;
|
|
17058
|
+
const topSlot = slots.top;
|
|
17059
|
+
const bottomSlot = slots.bottom;
|
|
17060
|
+
const leftSlot = slots.left;
|
|
17061
|
+
const rightSlot = slots.right;
|
|
17062
|
+
const hasShortcutBtn = shortcutList.length > 0;
|
|
17063
|
+
const showConfirmBtn = showConfirmButton === null ? isDateTimeType || multiple : showConfirmButton;
|
|
17064
|
+
const showClearBtn = showClearButton === null ? isClearable && showConfirmBtn && type !== 'time' : showClearButton;
|
|
17065
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.Teleport, {
|
|
17066
|
+
to: 'body',
|
|
17067
|
+
disabled: btnTransfer ? !initialized : true
|
|
17068
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17069
|
+
ref: refInputPanel,
|
|
17070
|
+
class: ['vxe-table--ignore-clear vxe-date-picker--panel', `type--${type}`, {
|
|
17071
|
+
[`size--${vSize}`]: vSize,
|
|
17072
|
+
'is--transfer': btnTransfer,
|
|
17073
|
+
'ani--leave': isAniVisible,
|
|
17074
|
+
'ani--enter': visiblePanel,
|
|
17075
|
+
'show--top': !!(topSlot || headerSlot || hasShortcutBtn && (position === 'top' || position === 'header')),
|
|
17076
|
+
'show--bottom': !!(bottomSlot || footerSlot || hasShortcutBtn && (position === 'bottom' || position === 'footer')),
|
|
17077
|
+
'show--left': !!(leftSlot || hasShortcutBtn && position === 'left'),
|
|
17078
|
+
'show--right': !!(rightSlot || hasShortcutBtn && position === 'right')
|
|
17079
|
+
}],
|
|
17080
|
+
placement: panelPlacement,
|
|
17081
|
+
style: panelStyle
|
|
17082
|
+
}, initialized && (visiblePanel || isAniVisible) ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17083
|
+
ref: refPanelWrapper,
|
|
17084
|
+
class: ['vxe-date-picker--layout-all-wrapper', `type--${type}`, {
|
|
17085
|
+
[`size--${vSize}`]: vSize
|
|
17086
|
+
}]
|
|
17087
|
+
}, [topSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17088
|
+
class: 'vxe-date-picker--layout-top-wrapper'
|
|
17089
|
+
}, topSlot({})) : renderShortcutBtn('top'), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17090
|
+
class: 'vxe-date-picker--layout-body-layout-wrapper'
|
|
17091
|
+
}, [leftSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17092
|
+
class: 'vxe-date-picker--layout-left-wrapper'
|
|
17093
|
+
}, leftSlot({})) : renderShortcutBtn('left', true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17094
|
+
class: 'vxe-date-picker--layout-body-content-wrapper'
|
|
17095
|
+
}, [headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17096
|
+
class: 'vxe-date-picker--layout-header-wrapper'
|
|
17097
|
+
}, headerSlot({})) : renderShortcutBtn('header'), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17098
|
+
class: 'vxe-date-picker--layout-body-wrapper'
|
|
17099
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(date_panel, {
|
|
17100
|
+
ref: refDatePanel,
|
|
17101
|
+
modelValue: reactData.inputValue,
|
|
17102
|
+
type: props.type,
|
|
17103
|
+
className: props.className,
|
|
17104
|
+
multiple: props.multiple,
|
|
17105
|
+
limitCount: props.limitCount,
|
|
17106
|
+
startDate: props.startDate,
|
|
17107
|
+
endDate: props.endDate,
|
|
17108
|
+
minDate: props.minDate,
|
|
17109
|
+
maxDate: props.maxDate,
|
|
17110
|
+
startDay: props.startDay,
|
|
17111
|
+
labelFormat: props.labelFormat,
|
|
17112
|
+
valueFormat: props.valueFormat,
|
|
17113
|
+
festivalMethod: props.festivalMethod,
|
|
17114
|
+
disabledMethod: props.disabledMethod,
|
|
17115
|
+
selectDay: props.selectDay,
|
|
17116
|
+
onChange: panelChangeEvent,
|
|
17117
|
+
onDateToday: hidePanel
|
|
17118
|
+
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17119
|
+
class: 'vxe-date-picker--layout-footer-wrapper'
|
|
17120
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17121
|
+
class: 'vxe-date-picker--layout-footer-custom'
|
|
17122
|
+
}, footerSlot ? footerSlot({}) : [renderShortcutBtn('footer')]), showClearBtn || showConfirmBtn ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17123
|
+
class: 'vxe-date-picker--layout-footer-btns'
|
|
17124
|
+
}, [showClearBtn ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
17125
|
+
size: 'mini',
|
|
17126
|
+
disabled: inputValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(inputValue),
|
|
17127
|
+
content: i18n_getI18n('vxe.button.clear'),
|
|
17128
|
+
onClick: clearValueEvent
|
|
17129
|
+
}) : renderEmptyElement($xeDatePicker), showConfirmBtn ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
17130
|
+
size: 'mini',
|
|
17131
|
+
status: 'primary',
|
|
17132
|
+
content: i18n_getI18n('vxe.button.confirm'),
|
|
17133
|
+
onClick: confirmEvent
|
|
17134
|
+
}) : renderEmptyElement($xeDatePicker)]) : renderEmptyElement($xeDatePicker)])]), rightSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17135
|
+
class: 'vxe-date-picker--layout-right-wrapper'
|
|
17136
|
+
}, rightSlot({})) : renderShortcutBtn('right', true)]), bottomSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17137
|
+
class: 'vxe-date-picker--layout-bottom-wrapper'
|
|
17138
|
+
}, bottomSlot({})) : renderShortcutBtn('bottom')])] : [])]);
|
|
17139
|
+
};
|
|
17140
|
+
const renderPrefixIcon = () => {
|
|
17141
|
+
const {
|
|
17142
|
+
prefixIcon
|
|
17143
|
+
} = props;
|
|
17144
|
+
const prefixSlot = slots.prefix;
|
|
17145
|
+
return prefixSlot || prefixIcon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17146
|
+
class: 'vxe-date-picker--prefix',
|
|
17147
|
+
onClick: clickPrefixEvent
|
|
17148
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17149
|
+
class: 'vxe-date-picker--prefix-icon'
|
|
17150
|
+
}, prefixSlot ? getSlotVNs(prefixSlot({})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
17151
|
+
class: prefixIcon
|
|
17152
|
+
})])]) : null;
|
|
17153
|
+
};
|
|
17154
|
+
const renderSuffixIcon = () => {
|
|
17155
|
+
const {
|
|
17156
|
+
suffixIcon
|
|
17157
|
+
} = props;
|
|
17158
|
+
const {
|
|
17159
|
+
inputValue
|
|
17160
|
+
} = reactData;
|
|
17161
|
+
const suffixSlot = slots.suffix;
|
|
17162
|
+
const isDisabled = computeIsDisabled.value;
|
|
17163
|
+
const isClearable = computeIsClearable.value;
|
|
17164
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17165
|
+
class: ['vxe-date-picker--suffix', {
|
|
17166
|
+
'is--clear': isClearable && !isDisabled && !(inputValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(inputValue))
|
|
17167
|
+
}]
|
|
17168
|
+
}, [isClearable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17169
|
+
class: 'vxe-date-picker--clear-icon',
|
|
17170
|
+
onClick: clearValueEvent
|
|
17171
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
17172
|
+
class: getIcon().INPUT_CLEAR
|
|
17173
|
+
})]) : renderEmptyElement($xeDatePicker), renderExtraSuffixIcon(), suffixSlot || suffixIcon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17174
|
+
class: 'vxe-date-picker--suffix-icon',
|
|
17175
|
+
onClick: clickSuffixEvent
|
|
17176
|
+
}, suffixSlot ? getSlotVNs(suffixSlot({})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
17177
|
+
class: suffixIcon
|
|
17178
|
+
})]) : renderEmptyElement($xeDatePicker)]);
|
|
17179
|
+
};
|
|
17180
|
+
const renderExtraSuffixIcon = () => {
|
|
17181
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17182
|
+
class: 'vxe-date-picker--control-icon',
|
|
17183
|
+
onClick: datePickerOpenEvent
|
|
17184
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
17185
|
+
class: ['vxe-date-picker--date-picker-icon', getIcon().DATE_PICKER_DATE]
|
|
17186
|
+
})]);
|
|
17187
|
+
};
|
|
17188
|
+
const renderVN = () => {
|
|
17189
|
+
const {
|
|
17190
|
+
className,
|
|
17191
|
+
type,
|
|
17192
|
+
name,
|
|
17193
|
+
autoComplete
|
|
17194
|
+
} = props;
|
|
17195
|
+
const {
|
|
17196
|
+
inputValue,
|
|
17197
|
+
inputLabel,
|
|
17198
|
+
visiblePanel,
|
|
17199
|
+
isActivated
|
|
17200
|
+
} = reactData;
|
|
17201
|
+
const vSize = computeSize.value;
|
|
17202
|
+
const isDisabled = computeIsDisabled.value;
|
|
17203
|
+
const formReadonly = computeFormReadonly.value;
|
|
17204
|
+
const panelLabel = computePanelLabel.value;
|
|
17205
|
+
if (formReadonly) {
|
|
17206
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17207
|
+
ref: refElem,
|
|
17208
|
+
class: ['vxe-date-picker--readonly', `type--${type}`, className]
|
|
17209
|
+
}, panelLabel);
|
|
17210
|
+
}
|
|
17211
|
+
const inputReadonly = computeInputReadonly.value;
|
|
17212
|
+
const inpPlaceholder = computeInpPlaceholder.value;
|
|
17213
|
+
const isClearable = computeIsClearable.value;
|
|
17214
|
+
const prefix = renderPrefixIcon();
|
|
17215
|
+
const suffix = renderSuffixIcon();
|
|
17216
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17217
|
+
ref: refElem,
|
|
17218
|
+
class: ['vxe-date-picker', `type--${type}`, className, {
|
|
17219
|
+
[`size--${vSize}`]: vSize,
|
|
17220
|
+
'is--prefix': !!prefix,
|
|
17221
|
+
'is--suffix': !!suffix,
|
|
17222
|
+
'is--visible': visiblePanel,
|
|
17223
|
+
'is--disabled': isDisabled,
|
|
17224
|
+
'is--active': isActivated,
|
|
17225
|
+
'show--clear': isClearable && !isDisabled && !(inputValue === '' || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(inputValue))
|
|
17226
|
+
}],
|
|
17227
|
+
spellcheck: false
|
|
17228
|
+
}, [prefix || renderEmptyElement($xeDatePicker), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
17229
|
+
class: 'vxe-date-picker--wrapper'
|
|
17230
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('input', {
|
|
17231
|
+
ref: refInputTarget,
|
|
17232
|
+
class: 'vxe-date-picker--inner',
|
|
17233
|
+
value: inputLabel,
|
|
17234
|
+
name,
|
|
17235
|
+
type: 'text',
|
|
17236
|
+
placeholder: inpPlaceholder,
|
|
17237
|
+
readonly: inputReadonly,
|
|
17238
|
+
disabled: isDisabled,
|
|
17239
|
+
autocomplete: autoComplete,
|
|
17240
|
+
onKeydown: keydownEvent,
|
|
17241
|
+
onKeyup: keyupEvent,
|
|
17242
|
+
onClick: clickEvent,
|
|
17243
|
+
onInput: inputEvent,
|
|
17244
|
+
onChange: changeEvent,
|
|
17245
|
+
onFocus: focusEvent,
|
|
17246
|
+
onBlur: blurEvent
|
|
17247
|
+
})]), suffix || renderEmptyElement($xeDatePicker),
|
|
17248
|
+
// 下拉面板
|
|
17249
|
+
renderPanel()]);
|
|
17250
|
+
};
|
|
17251
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computePanelLabel, val => {
|
|
17252
|
+
reactData.inputLabel = val;
|
|
17253
|
+
});
|
|
17254
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, () => {
|
|
17255
|
+
updateModelValue();
|
|
17256
|
+
});
|
|
17257
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
17258
|
+
globalEvents.on($xeDatePicker, 'mousewheel', handleGlobalMousewheelEvent);
|
|
17259
|
+
globalEvents.on($xeDatePicker, 'mousedown', handleGlobalMousedownEvent);
|
|
17260
|
+
globalEvents.on($xeDatePicker, 'blur', handleGlobalBlurEvent);
|
|
17261
|
+
});
|
|
17262
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
|
|
17263
|
+
globalEvents.off($xeDatePicker, 'mousewheel');
|
|
17264
|
+
globalEvents.off($xeDatePicker, 'mousedown');
|
|
17265
|
+
globalEvents.off($xeDatePicker, 'blur');
|
|
17266
|
+
});
|
|
17267
|
+
updateModelValue();
|
|
17268
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeDatePicker', $xeDatePicker);
|
|
17269
|
+
$xeDatePicker.renderVN = renderVN;
|
|
17270
|
+
return $xeDatePicker;
|
|
17271
|
+
},
|
|
17272
|
+
render() {
|
|
17273
|
+
return this.renderVN();
|
|
17274
|
+
}
|
|
17275
|
+
}));
|
|
17276
|
+
;// CONCATENATED MODULE: ./packages/date-picker/index.ts
|
|
17277
|
+
|
|
17278
|
+
|
|
17279
|
+
|
|
17280
|
+
const VxeDatePicker = Object.assign({}, date_picker, {
|
|
17281
|
+
install(app) {
|
|
17282
|
+
app.component(date_picker.name, date_picker);
|
|
17283
|
+
}
|
|
17284
|
+
});
|
|
17285
|
+
dynamicApp.use(VxeDatePicker);
|
|
17286
|
+
index_esm_VxeUI.component(date_picker);
|
|
17287
|
+
const DatePicker = VxeDatePicker;
|
|
17288
|
+
/* harmony default export */ var packages_date_picker = (VxeDatePicker);
|
|
17289
|
+
;// CONCATENATED MODULE: ./packages/date-range-picker/src/date-range-picker.ts
|
|
17290
|
+
|
|
17291
|
+
|
|
17292
|
+
|
|
17293
|
+
|
|
17294
|
+
|
|
17295
|
+
|
|
17296
|
+
|
|
17297
|
+
|
|
17298
|
+
|
|
17299
|
+
|
|
17300
|
+
|
|
17301
|
+
/* harmony default export */ var date_range_picker = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
17302
|
+
name: 'VxeDateRangePicker',
|
|
17303
|
+
props: {
|
|
17304
|
+
modelValue: [String, Number, Date, Array],
|
|
17305
|
+
startValue: [String, Number, Date],
|
|
17306
|
+
endValue: [String, Number, Date],
|
|
17307
|
+
immediate: {
|
|
17308
|
+
type: Boolean,
|
|
17309
|
+
default: true
|
|
17310
|
+
},
|
|
17311
|
+
name: String,
|
|
17312
|
+
type: {
|
|
17313
|
+
type: String,
|
|
17314
|
+
default: 'date'
|
|
17315
|
+
},
|
|
17316
|
+
clearable: {
|
|
17317
|
+
type: Boolean,
|
|
17318
|
+
default: () => getConfig().dateRangePicker.clearable
|
|
17319
|
+
},
|
|
17320
|
+
readonly: {
|
|
17321
|
+
type: Boolean,
|
|
17322
|
+
default: null
|
|
17323
|
+
},
|
|
17324
|
+
disabled: {
|
|
17325
|
+
type: Boolean,
|
|
17326
|
+
default: null
|
|
17327
|
+
},
|
|
17328
|
+
placeholder: String,
|
|
17329
|
+
autoComplete: {
|
|
17330
|
+
type: String,
|
|
17331
|
+
default: 'off'
|
|
17332
|
+
},
|
|
17333
|
+
form: String,
|
|
17334
|
+
className: String,
|
|
17335
|
+
size: {
|
|
17336
|
+
type: String,
|
|
17337
|
+
default: () => getConfig().dateRangePicker.size || getConfig().size
|
|
17338
|
+
},
|
|
17339
|
+
minDate: [String, Number, Date],
|
|
17340
|
+
maxDate: [String, Number, Date],
|
|
17341
|
+
startDay: {
|
|
17342
|
+
type: [String, Number],
|
|
17343
|
+
default: () => getConfig().dateRangePicker.startDay
|
|
17344
|
+
},
|
|
17345
|
+
labelFormat: String,
|
|
17346
|
+
valueFormat: String,
|
|
17347
|
+
editable: {
|
|
17348
|
+
type: Boolean,
|
|
17349
|
+
default: true
|
|
17350
|
+
},
|
|
17351
|
+
festivalMethod: {
|
|
17352
|
+
type: Function,
|
|
17353
|
+
default: () => getConfig().dateRangePicker.festivalMethod
|
|
17354
|
+
},
|
|
17355
|
+
disabledMethod: {
|
|
17356
|
+
type: Function,
|
|
17357
|
+
default: () => getConfig().dateRangePicker.disabledMethod
|
|
17358
|
+
},
|
|
17359
|
+
separator: {
|
|
17360
|
+
type: [String, Number],
|
|
17361
|
+
default: () => getConfig().dateRangePicker.separator
|
|
17362
|
+
},
|
|
17363
|
+
// week
|
|
17364
|
+
selectDay: {
|
|
17365
|
+
type: [String, Number],
|
|
17366
|
+
default: () => getConfig().dateRangePicker.selectDay
|
|
17367
|
+
},
|
|
17368
|
+
showClearButton: {
|
|
17369
|
+
type: Boolean,
|
|
17370
|
+
default: () => getConfig().dateRangePicker.showClearButton
|
|
17371
|
+
},
|
|
17372
|
+
showConfirmButton: {
|
|
17373
|
+
type: Boolean,
|
|
17374
|
+
default: () => getConfig().dateRangePicker.showConfirmButton
|
|
17375
|
+
},
|
|
17376
|
+
autoClose: {
|
|
17377
|
+
type: Boolean,
|
|
17378
|
+
default: () => getConfig().dateRangePicker.autoClose
|
|
17379
|
+
},
|
|
17380
|
+
prefixIcon: String,
|
|
17381
|
+
suffixIcon: String,
|
|
17382
|
+
placement: String,
|
|
17383
|
+
transfer: {
|
|
17384
|
+
type: Boolean,
|
|
17385
|
+
default: null
|
|
17386
|
+
},
|
|
17387
|
+
shortcutConfig: Object
|
|
17388
|
+
},
|
|
17389
|
+
emits: ['update:modelValue', 'update:startValue', 'update:endValue', 'input', 'change', 'keydown', 'keyup', 'click', 'focus', 'blur', 'clear', 'prefix-click', 'suffix-click', 'date-prev', 'date-today', 'date-next', 'shortcut-click'],
|
|
17390
|
+
setup(props, context) {
|
|
17391
|
+
const {
|
|
17392
|
+
slots,
|
|
17393
|
+
emit
|
|
17394
|
+
} = context;
|
|
17395
|
+
const $xeModal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeModal', null);
|
|
17396
|
+
const $xeDrawer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeDrawer', null);
|
|
17397
|
+
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
|
|
17398
|
+
const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
|
|
17399
|
+
const formItemInfo = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('xeFormItemInfo', null);
|
|
17400
|
+
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
17401
|
+
const {
|
|
17402
|
+
computeSize
|
|
17403
|
+
} = useSize(props);
|
|
17404
|
+
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
17405
|
+
initialized: false,
|
|
17406
|
+
panelIndex: 0,
|
|
17407
|
+
visiblePanel: false,
|
|
17408
|
+
isAniVisible: false,
|
|
17409
|
+
panelStyle: {},
|
|
17410
|
+
panelPlacement: '',
|
|
17411
|
+
isActivated: false,
|
|
17412
|
+
startValue: '',
|
|
17413
|
+
endValue: ''
|
|
17414
|
+
});
|
|
17415
|
+
const internalData = {
|
|
17416
|
+
// selectStatus: false
|
|
17417
|
+
// hpTimeout: undefined
|
|
17418
|
+
};
|
|
17419
|
+
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
17420
|
+
const refInputTarget = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
17421
|
+
const refInputPanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
17422
|
+
const refPanelWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
17423
|
+
const refStartDatePanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
17424
|
+
const refEndDatePanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
17425
|
+
const refMaps = {
|
|
17426
|
+
refElem,
|
|
17427
|
+
refInput: refInputTarget
|
|
17428
|
+
};
|
|
17429
|
+
const $xeDateRangePicker = {
|
|
17430
|
+
xID,
|
|
17431
|
+
props,
|
|
17432
|
+
context,
|
|
17433
|
+
reactData,
|
|
17434
|
+
internalData,
|
|
17435
|
+
getRefMaps: () => refMaps
|
|
17436
|
+
};
|
|
17437
|
+
let dateRangePickerMethods = {};
|
|
17438
|
+
const computeBtnTransfer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17439
|
+
const {
|
|
17440
|
+
transfer
|
|
17441
|
+
} = props;
|
|
17442
|
+
if (transfer === null) {
|
|
17443
|
+
const globalTransfer = getConfig().dateRangePicker.transfer;
|
|
17444
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(globalTransfer)) {
|
|
17445
|
+
return globalTransfer;
|
|
17446
|
+
}
|
|
17447
|
+
if ($xeTable || $xeModal || $xeDrawer || $xeForm) {
|
|
17448
|
+
return true;
|
|
17449
|
+
}
|
|
17450
|
+
}
|
|
17451
|
+
return transfer;
|
|
17452
|
+
});
|
|
17453
|
+
const computeFormReadonly = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17454
|
+
const {
|
|
17455
|
+
readonly
|
|
17456
|
+
} = props;
|
|
17457
|
+
if (readonly === null) {
|
|
17458
|
+
if ($xeForm) {
|
|
17459
|
+
return $xeForm.props.readonly;
|
|
17460
|
+
}
|
|
17461
|
+
return false;
|
|
17462
|
+
}
|
|
17463
|
+
return readonly;
|
|
17464
|
+
});
|
|
17465
|
+
const computeIsDisabled = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17466
|
+
const {
|
|
17467
|
+
disabled
|
|
17468
|
+
} = props;
|
|
17469
|
+
if (disabled === null) {
|
|
17470
|
+
if ($xeForm) {
|
|
17471
|
+
return $xeForm.props.disabled;
|
|
17472
|
+
}
|
|
17473
|
+
return false;
|
|
17474
|
+
}
|
|
17475
|
+
return disabled;
|
|
17476
|
+
});
|
|
17477
|
+
const computeMVal = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17478
|
+
const {
|
|
17479
|
+
startValue,
|
|
17480
|
+
endValue
|
|
17481
|
+
} = props;
|
|
17482
|
+
return `${startValue || ''}${endValue || ''}`;
|
|
17483
|
+
});
|
|
17484
|
+
const computeIsDateTimeType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17485
|
+
const {
|
|
17486
|
+
type
|
|
17487
|
+
} = props;
|
|
17488
|
+
return type === 'time' || type === 'datetime';
|
|
17489
|
+
});
|
|
17490
|
+
const computeIsDatePickerType = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17491
|
+
return ['date', 'week', 'month', 'quarter', 'year'].indexOf(props.type) > -1;
|
|
17492
|
+
});
|
|
17493
|
+
const computeIsClearable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17494
|
+
return props.clearable;
|
|
17495
|
+
});
|
|
17496
|
+
const computeInpPlaceholder = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17497
|
+
const {
|
|
17498
|
+
placeholder
|
|
17499
|
+
} = props;
|
|
17500
|
+
if (placeholder) {
|
|
17501
|
+
return getFuncText(placeholder);
|
|
17502
|
+
}
|
|
17503
|
+
const globalPlaceholder = getConfig().dateRangePicker.placeholder;
|
|
17504
|
+
if (globalPlaceholder) {
|
|
17505
|
+
return getFuncText(globalPlaceholder);
|
|
17506
|
+
}
|
|
17507
|
+
return i18n_getI18n('vxe.base.pleaseSelect');
|
|
17508
|
+
});
|
|
17509
|
+
const computeInpImmediate = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17510
|
+
const {
|
|
17511
|
+
immediate
|
|
17512
|
+
} = props;
|
|
17513
|
+
return immediate;
|
|
17514
|
+
});
|
|
17515
|
+
const computeShortcutOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17516
|
+
return Object.assign({}, getConfig().dateRangePicker.shortcutConfig, props.shortcutConfig);
|
|
17517
|
+
});
|
|
17518
|
+
const computeShortcutList = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17519
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
17520
|
+
const {
|
|
17521
|
+
options
|
|
17522
|
+
} = shortcutOpts;
|
|
17523
|
+
if (options) {
|
|
17524
|
+
return options.map((option, index) => {
|
|
17525
|
+
return Object.assign({
|
|
17526
|
+
name: `${option.name || option.code || index}`
|
|
17527
|
+
}, option);
|
|
17528
|
+
});
|
|
17529
|
+
}
|
|
17530
|
+
return [];
|
|
17531
|
+
});
|
|
17532
|
+
const computeDateLabelFormat = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17533
|
+
const {
|
|
17534
|
+
labelFormat
|
|
17535
|
+
} = props;
|
|
17536
|
+
return labelFormat || i18n_getI18n(`vxe.input.date.labelFormat.${props.type}`);
|
|
17537
|
+
});
|
|
17538
|
+
const computeDateValueFormat = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17539
|
+
const {
|
|
17540
|
+
type,
|
|
17541
|
+
valueFormat
|
|
17542
|
+
} = props;
|
|
17543
|
+
if (valueFormat) {
|
|
17544
|
+
return valueFormat;
|
|
17545
|
+
}
|
|
17546
|
+
if (type === 'time') {
|
|
17547
|
+
return 'HH:mm:ss';
|
|
17548
|
+
}
|
|
17549
|
+
if (type === 'datetime') {
|
|
17550
|
+
return 'yyyy-MM-dd HH:mm:ss';
|
|
17551
|
+
}
|
|
17552
|
+
return 'yyyy-MM-dd';
|
|
17553
|
+
});
|
|
17554
|
+
const computeFirstDayOfWeek = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17555
|
+
const {
|
|
17556
|
+
startDay
|
|
17557
|
+
} = props;
|
|
17558
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(startDay);
|
|
17559
|
+
});
|
|
17560
|
+
const computePanelLabelObj = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17561
|
+
const {
|
|
17562
|
+
startValue,
|
|
17563
|
+
endValue
|
|
17564
|
+
} = reactData;
|
|
17565
|
+
const vals = startValue || endValue ? [startValue || '', endValue || ''] : [];
|
|
17566
|
+
return formatRangeLabel(vals);
|
|
17567
|
+
});
|
|
17568
|
+
const computeInputLabel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
17569
|
+
const panelLabelObj = computePanelLabelObj.value;
|
|
17570
|
+
return panelLabelObj.label;
|
|
17571
|
+
});
|
|
17572
|
+
const formatRangeLabel = vals => {
|
|
17573
|
+
const {
|
|
17574
|
+
type,
|
|
17575
|
+
separator
|
|
17576
|
+
} = props;
|
|
17577
|
+
const dateLabelFormat = computeDateLabelFormat.value;
|
|
17578
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
17579
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
17580
|
+
const startRest = vals[0] ? parseDateObj(vals[0], type, {
|
|
17581
|
+
valueFormat: dateValueFormat,
|
|
17582
|
+
labelFormat: dateLabelFormat,
|
|
17583
|
+
firstDay: firstDayOfWeek
|
|
17584
|
+
}) : null;
|
|
17585
|
+
const endRest = vals[1] ? parseDateObj(vals[1], type, {
|
|
17586
|
+
valueFormat: dateValueFormat,
|
|
17587
|
+
labelFormat: dateLabelFormat,
|
|
17588
|
+
firstDay: firstDayOfWeek
|
|
17589
|
+
}) : null;
|
|
17590
|
+
const startLabel = startRest ? startRest.label : '';
|
|
17591
|
+
const endLabel = endRest ? endRest.label : '';
|
|
17592
|
+
return {
|
|
17593
|
+
label: (startLabel || endLabel ? [startLabel, endLabel] : []).join(`${separator || ' ~ '}`),
|
|
17594
|
+
startLabel,
|
|
17595
|
+
endLabel
|
|
17596
|
+
};
|
|
17597
|
+
};
|
|
17598
|
+
const getRangeValue = (sValue, eValue) => {
|
|
17599
|
+
const {
|
|
17600
|
+
modelValue
|
|
17601
|
+
} = props;
|
|
17602
|
+
const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue);
|
|
17603
|
+
if (sValue || eValue) {
|
|
17604
|
+
const rest = [sValue || '', eValue || ''];
|
|
17605
|
+
if (isArr) {
|
|
17606
|
+
return rest;
|
|
17607
|
+
}
|
|
17608
|
+
return rest.join(',');
|
|
17609
|
+
}
|
|
17610
|
+
return isArr ? [] : '';
|
|
17611
|
+
};
|
|
17612
|
+
const paraeUpdateModel = () => {
|
|
17613
|
+
const {
|
|
17614
|
+
type,
|
|
17615
|
+
modelValue
|
|
17616
|
+
} = props;
|
|
17617
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
17618
|
+
let sValue = '';
|
|
17619
|
+
let eValue = '';
|
|
17620
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue)) {
|
|
17621
|
+
const date1 = parseDateString(modelValue[0], type, {
|
|
17622
|
+
valueFormat: dateValueFormat
|
|
17623
|
+
});
|
|
17624
|
+
const date2 = parseDateString(modelValue[1], type, {
|
|
17625
|
+
valueFormat: dateValueFormat
|
|
17626
|
+
});
|
|
17627
|
+
if (date1 || date2) {
|
|
17628
|
+
sValue = date1 || '';
|
|
17629
|
+
eValue = date2 || '';
|
|
17630
|
+
}
|
|
17631
|
+
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(modelValue)) {
|
|
17632
|
+
const strArr = modelValue.split(',');
|
|
17633
|
+
if (strArr[0] || strArr[1]) {
|
|
17634
|
+
sValue = strArr[0] || '';
|
|
17635
|
+
eValue = strArr[1] || '';
|
|
17636
|
+
}
|
|
17637
|
+
}
|
|
17638
|
+
return {
|
|
17639
|
+
sValue,
|
|
17640
|
+
eValue
|
|
17641
|
+
};
|
|
17642
|
+
};
|
|
17643
|
+
const parseUpdateData = () => {
|
|
17644
|
+
const {
|
|
17645
|
+
type,
|
|
17646
|
+
startValue,
|
|
17647
|
+
endValue
|
|
17648
|
+
} = props;
|
|
17649
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
17650
|
+
let sValue = '';
|
|
17651
|
+
let eValue = '';
|
|
17652
|
+
sValue = parseDateString(startValue, type, {
|
|
17653
|
+
valueFormat: dateValueFormat
|
|
17654
|
+
});
|
|
17655
|
+
eValue = parseDateString(endValue, type, {
|
|
17656
|
+
valueFormat: dateValueFormat
|
|
17657
|
+
});
|
|
17658
|
+
return {
|
|
17659
|
+
sValue,
|
|
17660
|
+
eValue
|
|
17661
|
+
};
|
|
17662
|
+
};
|
|
17663
|
+
const updateModelValue = isModel => {
|
|
17664
|
+
const {
|
|
17665
|
+
modelValue,
|
|
17666
|
+
startValue,
|
|
17667
|
+
endValue
|
|
17668
|
+
} = props;
|
|
17669
|
+
let restObj = {
|
|
17670
|
+
sValue: '',
|
|
17671
|
+
eValue: ''
|
|
17672
|
+
};
|
|
17673
|
+
if (isModel) {
|
|
17674
|
+
if (modelValue) {
|
|
17675
|
+
restObj = paraeUpdateModel();
|
|
17676
|
+
} else {
|
|
17677
|
+
restObj = parseUpdateData();
|
|
17678
|
+
}
|
|
17679
|
+
} else {
|
|
17680
|
+
if (startValue || endValue) {
|
|
17681
|
+
restObj = parseUpdateData();
|
|
17682
|
+
} else {
|
|
17683
|
+
restObj = paraeUpdateModel();
|
|
17684
|
+
}
|
|
17685
|
+
}
|
|
17686
|
+
reactData.startValue = restObj.sValue;
|
|
17687
|
+
reactData.endValue = restObj.eValue;
|
|
17688
|
+
};
|
|
17689
|
+
const triggerEvent = evnt => {
|
|
17690
|
+
const {
|
|
17691
|
+
startValue,
|
|
17692
|
+
endValue
|
|
17693
|
+
} = reactData;
|
|
17694
|
+
const value = getRangeValue(startValue, endValue);
|
|
17695
|
+
dispatchEvent(evnt.type, {
|
|
17696
|
+
value,
|
|
17697
|
+
startValue,
|
|
17698
|
+
endValue
|
|
17699
|
+
}, evnt);
|
|
17700
|
+
};
|
|
17701
|
+
const handleChange = (sValue, eValue, evnt) => {
|
|
17702
|
+
const {
|
|
17703
|
+
modelValue
|
|
17704
|
+
} = props;
|
|
17705
|
+
reactData.startValue = sValue;
|
|
17706
|
+
reactData.endValue = eValue;
|
|
17707
|
+
const value = getRangeValue(sValue, eValue);
|
|
17708
|
+
emit('update:modelValue', value);
|
|
17709
|
+
emit('update:startValue', sValue || '');
|
|
17710
|
+
emit('update:endValue', eValue || '');
|
|
17711
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(modelValue) !== value) {
|
|
17712
|
+
dispatchEvent('change', {
|
|
17713
|
+
value
|
|
17714
|
+
}, evnt);
|
|
17715
|
+
// 自动更新校验状态
|
|
17716
|
+
if ($xeForm && formItemInfo) {
|
|
17717
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
17718
|
+
}
|
|
17719
|
+
}
|
|
17720
|
+
};
|
|
17721
|
+
const changeEvent = evnt => {
|
|
17722
|
+
const inpImmediate = computeInpImmediate.value;
|
|
17723
|
+
if (!inpImmediate) {
|
|
17724
|
+
triggerEvent(evnt);
|
|
17725
|
+
}
|
|
17726
|
+
};
|
|
17727
|
+
const focusEvent = evnt => {
|
|
17728
|
+
reactData.isActivated = true;
|
|
17729
|
+
dateRangePickerOpenEvent(evnt);
|
|
17730
|
+
triggerEvent(evnt);
|
|
17731
|
+
};
|
|
17732
|
+
const clickPrefixEvent = evnt => {
|
|
17733
|
+
const isDisabled = computeIsDisabled.value;
|
|
17734
|
+
if (!isDisabled) {
|
|
17735
|
+
const {
|
|
17736
|
+
startValue,
|
|
17737
|
+
endValue
|
|
17738
|
+
} = reactData;
|
|
17739
|
+
const value = getRangeValue(startValue, endValue);
|
|
17740
|
+
dispatchEvent('prefix-click', {
|
|
17741
|
+
value,
|
|
17742
|
+
startValue,
|
|
17743
|
+
endValue
|
|
17744
|
+
}, evnt);
|
|
17745
|
+
}
|
|
17746
|
+
};
|
|
17747
|
+
const hidePanel = () => {
|
|
17748
|
+
return new Promise(resolve => {
|
|
17749
|
+
reactData.visiblePanel = false;
|
|
17750
|
+
internalData.hpTimeout = setTimeout(() => {
|
|
17751
|
+
reactData.isAniVisible = false;
|
|
17752
|
+
resolve();
|
|
17753
|
+
}, 350);
|
|
17754
|
+
});
|
|
17755
|
+
};
|
|
17756
|
+
const clearValueEvent = (evnt, value) => {
|
|
17757
|
+
const isDatePickerType = computeIsDatePickerType.value;
|
|
17758
|
+
if (isDatePickerType) {
|
|
17759
|
+
hidePanel();
|
|
17760
|
+
}
|
|
17761
|
+
handleChange('', '', evnt);
|
|
17762
|
+
dispatchEvent('clear', {
|
|
17763
|
+
value
|
|
17764
|
+
}, evnt);
|
|
17765
|
+
};
|
|
17766
|
+
const checkValue = () => {
|
|
17767
|
+
const $startDatePanel = refStartDatePanel.value;
|
|
17768
|
+
const $endDatePanel = refEndDatePanel.value;
|
|
17769
|
+
if ($startDatePanel && $endDatePanel) {
|
|
17770
|
+
const startValue = $startDatePanel.getValue();
|
|
17771
|
+
const endValue = $endDatePanel.getValue();
|
|
17772
|
+
if (!startValue || !endValue) {
|
|
17773
|
+
handleChange('', '', {
|
|
17774
|
+
type: 'check'
|
|
17775
|
+
});
|
|
17776
|
+
}
|
|
17777
|
+
}
|
|
17778
|
+
};
|
|
17779
|
+
const handleSelectClose = () => {
|
|
17780
|
+
const {
|
|
17781
|
+
autoClose
|
|
17782
|
+
} = props;
|
|
17783
|
+
const {
|
|
17784
|
+
startValue,
|
|
17785
|
+
endValue
|
|
17786
|
+
} = reactData;
|
|
17787
|
+
const {
|
|
17788
|
+
selectStatus
|
|
17789
|
+
} = internalData;
|
|
17790
|
+
const isDatePickerType = computeIsDatePickerType.value;
|
|
17791
|
+
if (autoClose) {
|
|
17792
|
+
if (selectStatus && isDatePickerType) {
|
|
17793
|
+
if (startValue && endValue) {
|
|
17794
|
+
hidePanel();
|
|
17795
|
+
}
|
|
17796
|
+
}
|
|
17797
|
+
} else {
|
|
17798
|
+
if (startValue && endValue) {
|
|
17799
|
+
internalData.selectStatus = false;
|
|
17800
|
+
}
|
|
17801
|
+
}
|
|
17802
|
+
};
|
|
17803
|
+
const clickSuffixEvent = evnt => {
|
|
17804
|
+
const isDisabled = computeIsDisabled.value;
|
|
17805
|
+
if (!isDisabled) {
|
|
17806
|
+
const {
|
|
17807
|
+
startValue,
|
|
17808
|
+
endValue
|
|
17809
|
+
} = reactData;
|
|
17810
|
+
const value = getRangeValue(startValue, endValue);
|
|
17811
|
+
dispatchEvent('suffix-click', {
|
|
17812
|
+
value,
|
|
17813
|
+
startValue,
|
|
17814
|
+
endValue
|
|
17815
|
+
}, evnt);
|
|
17816
|
+
}
|
|
17817
|
+
};
|
|
17818
|
+
const blurEvent = evnt => {
|
|
17819
|
+
const {
|
|
17820
|
+
startValue,
|
|
17821
|
+
endValue
|
|
17822
|
+
} = reactData;
|
|
17823
|
+
const inpImmediate = computeInpImmediate.value;
|
|
17824
|
+
const value = '';
|
|
17825
|
+
if (!inpImmediate) {
|
|
17826
|
+
handleChange(startValue, endValue, evnt);
|
|
17827
|
+
}
|
|
17828
|
+
if (!reactData.visiblePanel) {
|
|
17829
|
+
reactData.isActivated = false;
|
|
17830
|
+
}
|
|
17831
|
+
dispatchEvent('blur', {
|
|
17832
|
+
value,
|
|
17833
|
+
startValue,
|
|
17834
|
+
endValue
|
|
17835
|
+
}, evnt);
|
|
17836
|
+
// 自动更新校验状态
|
|
17837
|
+
if ($xeForm && formItemInfo) {
|
|
17838
|
+
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
17839
|
+
}
|
|
17840
|
+
};
|
|
17841
|
+
const keydownEvent = evnt => {
|
|
17842
|
+
triggerEvent(evnt);
|
|
17843
|
+
};
|
|
17844
|
+
const keyupEvent = evnt => {
|
|
17845
|
+
triggerEvent(evnt);
|
|
17846
|
+
};
|
|
17847
|
+
const confirmEvent = evnt => {
|
|
17848
|
+
const $startDatePanel = refStartDatePanel.value;
|
|
17849
|
+
const $endDatePanel = refEndDatePanel.value;
|
|
17850
|
+
if ($startDatePanel && $endDatePanel) {
|
|
17851
|
+
const startValue = $startDatePanel.getValue();
|
|
17852
|
+
const endValue = $endDatePanel.getValue();
|
|
17853
|
+
if (startValue && endValue) {
|
|
17854
|
+
$startDatePanel.confirmByEvent(evnt);
|
|
17855
|
+
$endDatePanel.confirmByEvent(evnt);
|
|
17856
|
+
} else {
|
|
17857
|
+
handleChange('', '', evnt);
|
|
17858
|
+
}
|
|
17859
|
+
}
|
|
17860
|
+
hidePanel();
|
|
17861
|
+
};
|
|
17862
|
+
const startPanelChangeEvent = params => {
|
|
17863
|
+
const {
|
|
17864
|
+
selectStatus
|
|
17865
|
+
} = internalData;
|
|
17866
|
+
const {
|
|
17867
|
+
value,
|
|
17868
|
+
$event
|
|
17869
|
+
} = params;
|
|
17870
|
+
const endValue = selectStatus ? reactData.endValue : '';
|
|
17871
|
+
handleChange(value, endValue, $event);
|
|
17872
|
+
handleSelectClose();
|
|
17873
|
+
if (!selectStatus) {
|
|
17874
|
+
internalData.selectStatus = true;
|
|
17875
|
+
}
|
|
17876
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
17877
|
+
const $startDatePanel = refStartDatePanel.value;
|
|
17878
|
+
const $endDatePanel = refEndDatePanel.value;
|
|
17879
|
+
if ($startDatePanel && $endDatePanel) {
|
|
17880
|
+
const startValue = $startDatePanel.getValue();
|
|
17881
|
+
if (!endValue && startValue) {
|
|
17882
|
+
$endDatePanel.setPanelDate(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(startValue));
|
|
17883
|
+
}
|
|
17884
|
+
}
|
|
17885
|
+
});
|
|
17886
|
+
};
|
|
17887
|
+
const endPanelChangeEvent = params => {
|
|
17888
|
+
const {
|
|
17889
|
+
selectStatus
|
|
17890
|
+
} = internalData;
|
|
17891
|
+
const {
|
|
17892
|
+
value,
|
|
17893
|
+
$event
|
|
17894
|
+
} = params;
|
|
17895
|
+
const startValue = selectStatus ? reactData.startValue : '';
|
|
17896
|
+
handleChange(startValue, value, $event);
|
|
17897
|
+
handleSelectClose();
|
|
17898
|
+
if (!selectStatus) {
|
|
17899
|
+
internalData.selectStatus = true;
|
|
17900
|
+
}
|
|
17901
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
17902
|
+
const $startDatePanel = refStartDatePanel.value;
|
|
17903
|
+
const $endDatePanel = refEndDatePanel.value;
|
|
17904
|
+
if ($startDatePanel && $endDatePanel) {
|
|
17905
|
+
const endValue = $endDatePanel.getValue();
|
|
17906
|
+
if (!startValue && endValue) {
|
|
17907
|
+
$startDatePanel.setPanelDate(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(endValue));
|
|
17908
|
+
}
|
|
17909
|
+
}
|
|
17910
|
+
});
|
|
17911
|
+
};
|
|
17912
|
+
// 全局事件
|
|
17913
|
+
const handleGlobalMousedownEvent = evnt => {
|
|
17914
|
+
const {
|
|
17915
|
+
visiblePanel,
|
|
17916
|
+
isActivated
|
|
17917
|
+
} = reactData;
|
|
17918
|
+
const el = refElem.value;
|
|
17919
|
+
const panelWrapperElem = refPanelWrapper.value;
|
|
17920
|
+
const isDisabled = computeIsDisabled.value;
|
|
17921
|
+
if (!isDisabled && isActivated) {
|
|
17922
|
+
reactData.isActivated = getEventTargetNode(evnt, el).flag || getEventTargetNode(evnt, panelWrapperElem).flag;
|
|
17923
|
+
if (!reactData.isActivated) {
|
|
17924
|
+
if (visiblePanel) {
|
|
17925
|
+
checkValue();
|
|
17926
|
+
hidePanel();
|
|
17927
|
+
}
|
|
17928
|
+
}
|
|
17929
|
+
}
|
|
17930
|
+
};
|
|
17931
|
+
const handleGlobalMousewheelEvent = evnt => {
|
|
17932
|
+
const {
|
|
17933
|
+
visiblePanel
|
|
17934
|
+
} = reactData;
|
|
17935
|
+
const isDisabled = computeIsDisabled.value;
|
|
17936
|
+
if (!isDisabled) {
|
|
17937
|
+
if (visiblePanel) {
|
|
17938
|
+
const panelWrapperElem = refPanelWrapper.value;
|
|
17939
|
+
if (getEventTargetNode(evnt, panelWrapperElem).flag) {
|
|
17940
|
+
updatePlacement();
|
|
17941
|
+
} else {
|
|
17942
|
+
hidePanel();
|
|
17943
|
+
}
|
|
17944
|
+
}
|
|
17945
|
+
}
|
|
17946
|
+
};
|
|
17947
|
+
const handleGlobalBlurEvent = () => {
|
|
17948
|
+
const {
|
|
17949
|
+
visiblePanel
|
|
17950
|
+
} = reactData;
|
|
17951
|
+
if (visiblePanel) {
|
|
17952
|
+
hidePanel();
|
|
17953
|
+
}
|
|
17954
|
+
};
|
|
17955
|
+
// 弹出面板
|
|
17956
|
+
const updateZindex = () => {
|
|
17957
|
+
if (reactData.panelIndex < getLastZIndex()) {
|
|
17958
|
+
reactData.panelIndex = nextZIndex();
|
|
17959
|
+
}
|
|
17960
|
+
};
|
|
17961
|
+
const updatePlacement = () => {
|
|
17962
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
17963
|
+
const {
|
|
17964
|
+
placement
|
|
17965
|
+
} = props;
|
|
17966
|
+
const {
|
|
17967
|
+
panelIndex
|
|
17968
|
+
} = reactData;
|
|
17969
|
+
const targetElem = refInputTarget.value;
|
|
17970
|
+
const panelElem = refInputPanel.value;
|
|
17971
|
+
const btnTransfer = computeBtnTransfer.value;
|
|
17972
|
+
if (targetElem && panelElem) {
|
|
17973
|
+
const targetHeight = targetElem.offsetHeight;
|
|
17974
|
+
const targetWidth = targetElem.offsetWidth;
|
|
17975
|
+
const panelHeight = panelElem.offsetHeight;
|
|
17976
|
+
const panelWidth = panelElem.offsetWidth;
|
|
17977
|
+
const marginSize = 5;
|
|
17978
|
+
const panelStyle = {
|
|
17979
|
+
zIndex: panelIndex
|
|
17980
|
+
};
|
|
17981
|
+
const {
|
|
17982
|
+
boundingTop,
|
|
17983
|
+
boundingLeft,
|
|
17984
|
+
visibleHeight,
|
|
17985
|
+
visibleWidth
|
|
17986
|
+
} = getAbsolutePos(targetElem);
|
|
17987
|
+
let panelPlacement = 'bottom';
|
|
17988
|
+
if (btnTransfer) {
|
|
17989
|
+
let left = boundingLeft;
|
|
17990
|
+
let top = boundingTop + targetHeight;
|
|
17991
|
+
if (placement === 'top') {
|
|
17992
|
+
panelPlacement = 'top';
|
|
17993
|
+
top = boundingTop - panelHeight;
|
|
17994
|
+
} else if (!placement) {
|
|
17995
|
+
// 如果下面不够放,则向上
|
|
17996
|
+
if (top + panelHeight + marginSize > visibleHeight) {
|
|
17997
|
+
panelPlacement = 'top';
|
|
17998
|
+
top = boundingTop - panelHeight;
|
|
17999
|
+
}
|
|
18000
|
+
// 如果上面不够放,则向下(优先)
|
|
18001
|
+
if (top < marginSize) {
|
|
18002
|
+
panelPlacement = 'bottom';
|
|
18003
|
+
top = boundingTop + targetHeight;
|
|
18004
|
+
}
|
|
18005
|
+
}
|
|
18006
|
+
// 如果溢出右边
|
|
18007
|
+
if (left + panelWidth + marginSize > visibleWidth) {
|
|
18008
|
+
left -= left + panelWidth + marginSize - visibleWidth;
|
|
18009
|
+
}
|
|
18010
|
+
// 如果溢出左边
|
|
18011
|
+
if (left < marginSize) {
|
|
18012
|
+
left = marginSize;
|
|
18013
|
+
}
|
|
18014
|
+
Object.assign(panelStyle, {
|
|
18015
|
+
left: `${left}px`,
|
|
18016
|
+
top: `${top}px`,
|
|
18017
|
+
minWidth: `${targetWidth}px`
|
|
18018
|
+
});
|
|
18019
|
+
} else {
|
|
18020
|
+
if (placement === 'top') {
|
|
18021
|
+
panelPlacement = 'top';
|
|
18022
|
+
panelStyle.bottom = `${targetHeight}px`;
|
|
18023
|
+
} else if (!placement) {
|
|
18024
|
+
// 如果下面不够放,则向上
|
|
18025
|
+
panelStyle.top = `${targetHeight}px`;
|
|
18026
|
+
if (boundingTop + targetHeight + panelHeight > visibleHeight) {
|
|
18027
|
+
// 如果上面不够放,则向下(优先)
|
|
18028
|
+
if (boundingTop - targetHeight - panelHeight > marginSize) {
|
|
18029
|
+
panelPlacement = 'top';
|
|
18030
|
+
panelStyle.top = '';
|
|
18031
|
+
panelStyle.bottom = `${targetHeight}px`;
|
|
18032
|
+
}
|
|
18033
|
+
}
|
|
18034
|
+
}
|
|
18035
|
+
}
|
|
18036
|
+
reactData.panelStyle = panelStyle;
|
|
18037
|
+
reactData.panelPlacement = panelPlacement;
|
|
18038
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
18039
|
+
}
|
|
18040
|
+
});
|
|
18041
|
+
};
|
|
18042
|
+
const showPanel = () => {
|
|
18043
|
+
const {
|
|
18044
|
+
visiblePanel
|
|
18045
|
+
} = reactData;
|
|
18046
|
+
const isDisabled = computeIsDisabled.value;
|
|
18047
|
+
if (!isDisabled && !visiblePanel) {
|
|
18048
|
+
if (!reactData.initialized) {
|
|
18049
|
+
reactData.initialized = true;
|
|
18050
|
+
}
|
|
18051
|
+
if (internalData.hpTimeout) {
|
|
18052
|
+
clearTimeout(internalData.hpTimeout);
|
|
18053
|
+
internalData.hpTimeout = undefined;
|
|
18054
|
+
}
|
|
18055
|
+
internalData.selectStatus = false;
|
|
18056
|
+
reactData.isActivated = true;
|
|
18057
|
+
reactData.isAniVisible = true;
|
|
18058
|
+
setTimeout(() => {
|
|
18059
|
+
reactData.visiblePanel = true;
|
|
18060
|
+
}, 10);
|
|
18061
|
+
updateZindex();
|
|
18062
|
+
return updatePlacement();
|
|
18063
|
+
}
|
|
18064
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
18065
|
+
};
|
|
18066
|
+
const dateRangePickerOpenEvent = evnt => {
|
|
18067
|
+
const formReadonly = computeFormReadonly.value;
|
|
18068
|
+
if (!formReadonly) {
|
|
18069
|
+
evnt.preventDefault();
|
|
18070
|
+
showPanel();
|
|
18071
|
+
}
|
|
18072
|
+
};
|
|
18073
|
+
const clickEvent = evnt => {
|
|
18074
|
+
triggerEvent(evnt);
|
|
18075
|
+
};
|
|
18076
|
+
const handleShortcutEvent = ({
|
|
18077
|
+
option,
|
|
18078
|
+
$event
|
|
18079
|
+
}) => {
|
|
18080
|
+
const {
|
|
18081
|
+
type
|
|
18082
|
+
} = props;
|
|
18083
|
+
const shortcutOpts = computeShortcutOpts.value;
|
|
18084
|
+
const {
|
|
18085
|
+
autoClose
|
|
18086
|
+
} = shortcutOpts;
|
|
18087
|
+
const {
|
|
18088
|
+
code,
|
|
18089
|
+
clickMethod
|
|
18090
|
+
} = option;
|
|
18091
|
+
let startValue = reactData.startValue;
|
|
18092
|
+
let endValue = reactData.endValue;
|
|
18093
|
+
let value = getRangeValue(startValue, endValue);
|
|
18094
|
+
const shortcutParams = {
|
|
18095
|
+
$dateRangePicker: $xeDateRangePicker,
|
|
18096
|
+
option: option,
|
|
18097
|
+
value,
|
|
18098
|
+
startValue,
|
|
18099
|
+
endValue,
|
|
18100
|
+
code
|
|
18101
|
+
};
|
|
18102
|
+
if (!clickMethod && code) {
|
|
18103
|
+
const gCommandOpts = commands.get(code);
|
|
18104
|
+
const drpCommandMethod = gCommandOpts ? gCommandOpts.dateRangePickerCommandMethod : null;
|
|
18105
|
+
if (drpCommandMethod) {
|
|
18106
|
+
drpCommandMethod(shortcutParams);
|
|
18107
|
+
} else {
|
|
18108
|
+
const dateValueFormat = computeDateValueFormat.value;
|
|
18109
|
+
const firstDayOfWeek = computeFirstDayOfWeek.value;
|
|
18110
|
+
switch (code) {
|
|
18111
|
+
case 'last1':
|
|
18112
|
+
case 'last3':
|
|
18113
|
+
case 'last7':
|
|
18114
|
+
case 'last30':
|
|
18115
|
+
case 'last60':
|
|
18116
|
+
case 'last90':
|
|
18117
|
+
case 'last180':
|
|
18118
|
+
{
|
|
18119
|
+
const restObj = getRangeDateByCode(code, value, type, {
|
|
18120
|
+
valueFormat: dateValueFormat,
|
|
18121
|
+
firstDay: firstDayOfWeek
|
|
18122
|
+
});
|
|
18123
|
+
startValue = restObj.startValue;
|
|
18124
|
+
endValue = restObj.endValue;
|
|
18125
|
+
value = getRangeValue(startValue, endValue);
|
|
18126
|
+
shortcutParams.value = value;
|
|
18127
|
+
shortcutParams.startValue = startValue;
|
|
18128
|
+
shortcutParams.endValue = endValue;
|
|
18129
|
+
handleChange(startValue, endValue, $event);
|
|
18130
|
+
break;
|
|
18131
|
+
}
|
|
18132
|
+
default:
|
|
18133
|
+
errLog('vxe.error.notCommands', [code]);
|
|
18134
|
+
break;
|
|
18135
|
+
}
|
|
18136
|
+
}
|
|
18137
|
+
} else {
|
|
18138
|
+
const optClickMethod = clickMethod || shortcutOpts.clickMethod;
|
|
18139
|
+
if (optClickMethod) {
|
|
18140
|
+
optClickMethod(shortcutParams);
|
|
18141
|
+
}
|
|
18142
|
+
}
|
|
18143
|
+
if (autoClose) {
|
|
18144
|
+
hidePanel();
|
|
18145
|
+
}
|
|
18146
|
+
dispatchEvent('shortcut-click', shortcutParams, $event);
|
|
18147
|
+
};
|
|
18148
|
+
const dispatchEvent = (type, params, evnt) => {
|
|
18149
|
+
emit(type, createEvent(evnt, {
|
|
18150
|
+
$dateRangePicker: $xeDateRangePicker
|
|
18151
|
+
}, params));
|
|
18152
|
+
};
|
|
18153
|
+
dateRangePickerMethods = {
|
|
18154
|
+
dispatchEvent,
|
|
18155
|
+
setModelValue(startValue, endValue) {
|
|
18156
|
+
reactData.startValue = startValue || '';
|
|
18157
|
+
reactData.endValue = endValue || '';
|
|
18158
|
+
const value = getRangeValue(startValue, endValue);
|
|
18159
|
+
emit('update:modelValue', value);
|
|
18160
|
+
},
|
|
18161
|
+
setModelValueByEvent(evnt, startValue, endValue) {
|
|
18162
|
+
handleChange(startValue || '', endValue || '', evnt);
|
|
18163
|
+
},
|
|
16166
18164
|
focus() {
|
|
16167
18165
|
const inputElem = refInputTarget.value;
|
|
16168
18166
|
reactData.isActivated = true;
|
|
@@ -16185,441 +18183,57 @@ const Countdown = VxeCountdown;
|
|
|
16185
18183
|
hidePanel,
|
|
16186
18184
|
updatePlacement
|
|
16187
18185
|
};
|
|
16188
|
-
Object.assign($
|
|
16189
|
-
const renderDateLabel = (item, label) => {
|
|
16190
|
-
const {
|
|
16191
|
-
festivalMethod
|
|
16192
|
-
} = props;
|
|
16193
|
-
if (festivalMethod) {
|
|
16194
|
-
const {
|
|
16195
|
-
datePanelType
|
|
16196
|
-
} = reactData;
|
|
16197
|
-
const festivalRest = festivalMethod({
|
|
16198
|
-
type: datePanelType,
|
|
16199
|
-
viewType: datePanelType,
|
|
16200
|
-
date: item.date,
|
|
16201
|
-
$datePicker: $xeDatePicker
|
|
16202
|
-
});
|
|
16203
|
-
const festivalItem = festivalRest ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(festivalRest) ? {
|
|
16204
|
-
label: festivalRest
|
|
16205
|
-
} : festivalRest : {};
|
|
16206
|
-
const extraItem = festivalItem.extra ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(festivalItem.extra) ? {
|
|
16207
|
-
label: festivalItem.extra
|
|
16208
|
-
} : festivalItem.extra : null;
|
|
16209
|
-
const labels = [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16210
|
-
class: ['vxe-date-picker--date-label', {
|
|
16211
|
-
'is-notice': festivalItem.notice
|
|
16212
|
-
}]
|
|
16213
|
-
}, extraItem && extraItem.label ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', `${label}`), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16214
|
-
class: ['vxe-date-picker--date-label--extra', extraItem.important ? 'is-important' : '', extraItem.className],
|
|
16215
|
-
style: extraItem.style
|
|
16216
|
-
}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(extraItem.label))] : `${label}`)];
|
|
16217
|
-
const festivalLabel = festivalItem.label;
|
|
16218
|
-
if (festivalLabel) {
|
|
16219
|
-
// 默认最多支持3个节日重叠
|
|
16220
|
-
const festivalLabels = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(festivalLabel).split(',');
|
|
16221
|
-
labels.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16222
|
-
class: ['vxe-date-picker--date-festival', festivalItem.important ? 'is-important' : '', festivalItem.className],
|
|
16223
|
-
style: festivalItem.style
|
|
16224
|
-
}, [festivalLabels.length > 1 ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16225
|
-
class: ['vxe-date-picker--date-festival--overlap', `overlap--${festivalLabels.length}`]
|
|
16226
|
-
}, festivalLabels.map(label => (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', label.substring(0, 3)))) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16227
|
-
class: 'vxe-date-picker--date-festival--label'
|
|
16228
|
-
}, festivalLabels[0].substring(0, 3))]));
|
|
16229
|
-
}
|
|
16230
|
-
return labels;
|
|
16231
|
-
}
|
|
16232
|
-
return label;
|
|
16233
|
-
};
|
|
16234
|
-
const renderDateDayTable = () => {
|
|
16235
|
-
const {
|
|
16236
|
-
multiple
|
|
16237
|
-
} = props;
|
|
16238
|
-
const {
|
|
16239
|
-
datePanelType,
|
|
16240
|
-
datePanelValue
|
|
16241
|
-
} = reactData;
|
|
16242
|
-
const dateValue = computeDateValue.value;
|
|
16243
|
-
const dateHeaders = computeDateHeaders.value;
|
|
16244
|
-
const dayDatas = computeDayDatas.value;
|
|
16245
|
-
const dateListValue = computeDateListValue.value;
|
|
16246
|
-
const overCount = computeOverCount.value;
|
|
16247
|
-
const matchFormat = 'yyyyMMdd';
|
|
16248
|
-
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('table', {
|
|
16249
|
-
class: `vxe-date-picker--date-${datePanelType}-view`,
|
|
16250
|
-
cellspacing: 0,
|
|
16251
|
-
cellpadding: 0,
|
|
16252
|
-
border: 0
|
|
16253
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', dateHeaders.map(item => {
|
|
16254
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', item.label);
|
|
16255
|
-
}))]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tbody', dayDatas.map(rows => {
|
|
16256
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', rows.map(item => {
|
|
16257
|
-
const isSelected = multiple ? dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat);
|
|
16258
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
16259
|
-
class: {
|
|
16260
|
-
'is--prev': item.isPrev,
|
|
16261
|
-
'is--current': item.isCurrent,
|
|
16262
|
-
'is--now': item.isNow,
|
|
16263
|
-
'is--next': item.isNext,
|
|
16264
|
-
'is--disabled': isDateDisabled(item),
|
|
16265
|
-
'is--selected': isSelected,
|
|
16266
|
-
'is--over': overCount && !isSelected,
|
|
16267
|
-
'is--hover': !overCount && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat)
|
|
16268
|
-
},
|
|
16269
|
-
onClick: () => dateSelectEvent(item),
|
|
16270
|
-
onMouseenter: () => dateMouseenterEvent(item)
|
|
16271
|
-
}, renderDateLabel(item, item.label));
|
|
16272
|
-
}));
|
|
16273
|
-
}))])];
|
|
16274
|
-
};
|
|
16275
|
-
const renderDateWeekTable = () => {
|
|
16276
|
-
const {
|
|
16277
|
-
multiple
|
|
16278
|
-
} = props;
|
|
16279
|
-
const {
|
|
16280
|
-
datePanelType,
|
|
16281
|
-
datePanelValue
|
|
16282
|
-
} = reactData;
|
|
16283
|
-
const dateValue = computeDateValue.value;
|
|
16284
|
-
const weekHeaders = computeWeekHeaders.value;
|
|
16285
|
-
const weekDates = computeWeekDates.value;
|
|
16286
|
-
const dateListValue = computeDateListValue.value;
|
|
16287
|
-
const overCount = computeOverCount.value;
|
|
16288
|
-
const matchFormat = 'yyyyMMdd';
|
|
16289
|
-
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('table', {
|
|
16290
|
-
class: `vxe-date-picker--date-${datePanelType}-view`,
|
|
16291
|
-
cellspacing: 0,
|
|
16292
|
-
cellpadding: 0,
|
|
16293
|
-
border: 0
|
|
16294
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', weekHeaders.map(item => {
|
|
16295
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', item.label);
|
|
16296
|
-
}))]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tbody', weekDates.map(rows => {
|
|
16297
|
-
const isSelected = multiple ? rows.some(item => dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat))) : rows.some(item => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat));
|
|
16298
|
-
const isHover = rows.some(item => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat));
|
|
16299
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', rows.map(item => {
|
|
16300
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
16301
|
-
class: {
|
|
16302
|
-
'is--prev': item.isPrev,
|
|
16303
|
-
'is--current': item.isCurrent,
|
|
16304
|
-
'is--now': item.isNow,
|
|
16305
|
-
'is--next': item.isNext,
|
|
16306
|
-
'is--disabled': isDateDisabled(item),
|
|
16307
|
-
'is--selected': isSelected,
|
|
16308
|
-
'is--over': overCount && !isSelected,
|
|
16309
|
-
'is--hover': !overCount && isHover
|
|
16310
|
-
},
|
|
16311
|
-
// event
|
|
16312
|
-
onClick: () => dateSelectEvent(item),
|
|
16313
|
-
onMouseenter: () => dateMouseenterEvent(item)
|
|
16314
|
-
}, renderDateLabel(item, item.label));
|
|
16315
|
-
}));
|
|
16316
|
-
}))])];
|
|
16317
|
-
};
|
|
16318
|
-
const renderDateMonthTable = () => {
|
|
16319
|
-
const {
|
|
16320
|
-
multiple
|
|
16321
|
-
} = props;
|
|
16322
|
-
const {
|
|
16323
|
-
datePanelType,
|
|
16324
|
-
datePanelValue
|
|
16325
|
-
} = reactData;
|
|
16326
|
-
const dateValue = computeDateValue.value;
|
|
16327
|
-
const monthDatas = computeMonthDatas.value;
|
|
16328
|
-
const dateListValue = computeDateListValue.value;
|
|
16329
|
-
const overCount = computeOverCount.value;
|
|
16330
|
-
const matchFormat = 'yyyyMM';
|
|
16331
|
-
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('table', {
|
|
16332
|
-
class: `vxe-date-picker--date-${datePanelType}-view`,
|
|
16333
|
-
cellspacing: 0,
|
|
16334
|
-
cellpadding: 0,
|
|
16335
|
-
border: 0
|
|
16336
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tbody', monthDatas.map(rows => {
|
|
16337
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', rows.map(item => {
|
|
16338
|
-
const isSelected = multiple ? dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat);
|
|
16339
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
16340
|
-
class: {
|
|
16341
|
-
'is--prev': item.isPrev,
|
|
16342
|
-
'is--current': item.isCurrent,
|
|
16343
|
-
'is--now': item.isNow,
|
|
16344
|
-
'is--next': item.isNext,
|
|
16345
|
-
'is--disabled': isDateDisabled(item),
|
|
16346
|
-
'is--selected': isSelected,
|
|
16347
|
-
'is--over': overCount && !isSelected,
|
|
16348
|
-
'is--hover': !overCount && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat)
|
|
16349
|
-
},
|
|
16350
|
-
onClick: () => dateSelectEvent(item),
|
|
16351
|
-
onMouseenter: () => dateMouseenterEvent(item)
|
|
16352
|
-
}, renderDateLabel(item, i18n_getI18n(`vxe.input.date.months.m${item.month}`)));
|
|
16353
|
-
}));
|
|
16354
|
-
}))])];
|
|
16355
|
-
};
|
|
16356
|
-
const renderDateQuarterTable = () => {
|
|
16357
|
-
const {
|
|
16358
|
-
multiple
|
|
16359
|
-
} = props;
|
|
16360
|
-
const {
|
|
16361
|
-
datePanelType,
|
|
16362
|
-
datePanelValue
|
|
16363
|
-
} = reactData;
|
|
16364
|
-
const dateValue = computeDateValue.value;
|
|
16365
|
-
const quarterDatas = computeQuarterDatas.value;
|
|
16366
|
-
const dateListValue = computeDateListValue.value;
|
|
16367
|
-
const overCount = computeOverCount.value;
|
|
16368
|
-
const matchFormat = 'yyyyq';
|
|
16369
|
-
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('table', {
|
|
16370
|
-
class: `vxe-date-picker--date-${datePanelType}-view`,
|
|
16371
|
-
cellspacing: 0,
|
|
16372
|
-
cellpadding: 0,
|
|
16373
|
-
border: 0
|
|
16374
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tbody', quarterDatas.map(rows => {
|
|
16375
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', rows.map(item => {
|
|
16376
|
-
const isSelected = multiple ? dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat);
|
|
16377
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
16378
|
-
class: {
|
|
16379
|
-
'is--prev': item.isPrev,
|
|
16380
|
-
'is--current': item.isCurrent,
|
|
16381
|
-
'is--now': item.isNow,
|
|
16382
|
-
'is--next': item.isNext,
|
|
16383
|
-
'is--disabled': isDateDisabled(item),
|
|
16384
|
-
'is--selected': isSelected,
|
|
16385
|
-
'is--over': overCount && !isSelected,
|
|
16386
|
-
'is--hover': !overCount && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat)
|
|
16387
|
-
},
|
|
16388
|
-
onClick: () => dateSelectEvent(item),
|
|
16389
|
-
onMouseenter: () => dateMouseenterEvent(item)
|
|
16390
|
-
}, renderDateLabel(item, i18n_getI18n(`vxe.input.date.quarters.q${item.quarter}`)));
|
|
16391
|
-
}));
|
|
16392
|
-
}))])];
|
|
16393
|
-
};
|
|
16394
|
-
const renderDateYearTable = () => {
|
|
16395
|
-
const {
|
|
16396
|
-
multiple
|
|
16397
|
-
} = props;
|
|
16398
|
-
const {
|
|
16399
|
-
datePanelType,
|
|
16400
|
-
datePanelValue
|
|
16401
|
-
} = reactData;
|
|
16402
|
-
const dateValue = computeDateValue.value;
|
|
16403
|
-
const yearDatas = computeYearDatas.value;
|
|
16404
|
-
const dateListValue = computeDateListValue.value;
|
|
16405
|
-
const overCount = computeOverCount.value;
|
|
16406
|
-
const matchFormat = 'yyyy';
|
|
16407
|
-
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('table', {
|
|
16408
|
-
class: `vxe-date-picker--date-${datePanelType}-view`,
|
|
16409
|
-
cellspacing: 0,
|
|
16410
|
-
cellpadding: 0,
|
|
16411
|
-
border: 0
|
|
16412
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tbody', yearDatas.map(rows => {
|
|
16413
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', rows.map(item => {
|
|
16414
|
-
const isSelected = multiple ? dateListValue.some(val => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(val, item.date, matchFormat)) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(dateValue, item.date, matchFormat);
|
|
16415
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
16416
|
-
class: {
|
|
16417
|
-
'is--prev': item.isPrev,
|
|
16418
|
-
'is--current': item.isCurrent,
|
|
16419
|
-
'is--now': item.isNow,
|
|
16420
|
-
'is--next': item.isNext,
|
|
16421
|
-
'is--disabled': isDateDisabled(item),
|
|
16422
|
-
'is--selected': isSelected,
|
|
16423
|
-
'is--over': overCount && !isSelected,
|
|
16424
|
-
'is--hover': !overCount && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isDateSame(datePanelValue, item.date, matchFormat)
|
|
16425
|
-
},
|
|
16426
|
-
onClick: () => dateSelectEvent(item),
|
|
16427
|
-
onMouseenter: () => dateMouseenterEvent(item)
|
|
16428
|
-
}, renderDateLabel(item, item.year));
|
|
16429
|
-
}));
|
|
16430
|
-
}))])];
|
|
16431
|
-
};
|
|
16432
|
-
const renderDateTable = () => {
|
|
16433
|
-
const {
|
|
16434
|
-
datePanelType
|
|
16435
|
-
} = reactData;
|
|
16436
|
-
switch (datePanelType) {
|
|
16437
|
-
case 'week':
|
|
16438
|
-
return renderDateWeekTable();
|
|
16439
|
-
case 'month':
|
|
16440
|
-
return renderDateMonthTable();
|
|
16441
|
-
case 'quarter':
|
|
16442
|
-
return renderDateQuarterTable();
|
|
16443
|
-
case 'year':
|
|
16444
|
-
return renderDateYearTable();
|
|
16445
|
-
}
|
|
16446
|
-
return renderDateDayTable();
|
|
16447
|
-
};
|
|
16448
|
-
const renderDatePanel = () => {
|
|
16449
|
-
const {
|
|
16450
|
-
multiple
|
|
16451
|
-
} = props;
|
|
16452
|
-
const {
|
|
16453
|
-
datePanelType
|
|
16454
|
-
} = reactData;
|
|
16455
|
-
const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value;
|
|
16456
|
-
const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value;
|
|
16457
|
-
const selectDatePanelObj = computeSelectDatePanelObj.value;
|
|
16458
|
-
const supportMultiples = computeSupportMultiples.value;
|
|
16459
|
-
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16460
|
-
class: 'vxe-date-picker--date-picker-header'
|
|
16461
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16462
|
-
class: 'vxe-date-picker--date-picker-type-wrapper'
|
|
16463
|
-
}, [datePanelType === 'year' ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16464
|
-
class: 'vxe-date-picker--date-picker-label'
|
|
16465
|
-
}, selectDatePanelObj.y) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16466
|
-
class: 'vxe-date-picker--date-picker-btns'
|
|
16467
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16468
|
-
class: 'vxe-date-picker--date-picker-btn',
|
|
16469
|
-
onClick: dateToggleYearTypeEvent
|
|
16470
|
-
}, selectDatePanelObj.y), selectDatePanelObj.m ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16471
|
-
class: 'vxe-date-picker--date-picker-btn',
|
|
16472
|
-
onClick: dateToggleMonthTypeEvent
|
|
16473
|
-
}, selectDatePanelObj.m) : renderEmptyElement($xeDatePicker)])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16474
|
-
class: 'vxe-date-picker--date-picker-btn-wrapper'
|
|
16475
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16476
|
-
class: ['vxe-date-picker--date-picker-btn vxe-date-picker--date-picker-prev-btn', {
|
|
16477
|
-
'is--disabled': isDisabledPrevDateBtn
|
|
16478
|
-
}],
|
|
16479
|
-
onClick: datePrevEvent
|
|
16480
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16481
|
-
class: 'vxe-icon-caret-left'
|
|
16482
|
-
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16483
|
-
class: 'vxe-date-picker--date-picker-btn vxe-date-picker--date-picker-current-btn',
|
|
16484
|
-
onClick: dateTodayMonthEvent
|
|
16485
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16486
|
-
class: 'vxe-icon-dot'
|
|
16487
|
-
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16488
|
-
class: ['vxe-date-picker--date-picker-btn vxe-date-picker--date-picker-next-btn', {
|
|
16489
|
-
'is--disabled': isDisabledNextDateBtn
|
|
16490
|
-
}],
|
|
16491
|
-
onClick: dateNextEvent
|
|
16492
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16493
|
-
class: 'vxe-icon-caret-right'
|
|
16494
|
-
})]), multiple && supportMultiples ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
16495
|
-
class: 'vxe-date-picker--date-picker-btn vxe-date-picker--date-picker-confirm-btn'
|
|
16496
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
|
|
16497
|
-
class: 'vxe-date-picker--date-picker-confirm',
|
|
16498
|
-
type: 'button',
|
|
16499
|
-
onClick: dateConfirmEvent
|
|
16500
|
-
}, i18n_getI18n('vxe.button.confirm'))]) : null])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16501
|
-
class: 'vxe-date-picker--date-picker-body'
|
|
16502
|
-
}, renderDateTable())];
|
|
16503
|
-
};
|
|
16504
|
-
const renderTimePanel = () => {
|
|
16505
|
-
const {
|
|
16506
|
-
datetimePanelValue
|
|
16507
|
-
} = reactData;
|
|
16508
|
-
const dateTimeLabel = computeDateTimeLabel.value;
|
|
16509
|
-
const hourList = computeHourList.value;
|
|
16510
|
-
const hasTimeMinute = computeHasTimeMinute.value;
|
|
16511
|
-
const minuteList = computeMinuteList.value;
|
|
16512
|
-
const hasTimeSecond = computeHasTimeSecond.value;
|
|
16513
|
-
const secondList = computeSecondList.value;
|
|
16514
|
-
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16515
|
-
class: 'vxe-date-picker--time-picker-header'
|
|
16516
|
-
}, [hasTimeMinute ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16517
|
-
class: 'vxe-date-picker--time-picker-title'
|
|
16518
|
-
}, dateTimeLabel) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16519
|
-
class: 'vxe-date-picker--time-picker-btn'
|
|
16520
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('button', {
|
|
16521
|
-
class: 'vxe-date-picker--time-picker-confirm',
|
|
16522
|
-
type: 'button',
|
|
16523
|
-
onClick: dateConfirmEvent
|
|
16524
|
-
}, i18n_getI18n('vxe.button.confirm'))])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16525
|
-
ref: refInputTimeBody,
|
|
16526
|
-
class: 'vxe-date-picker--time-picker-body'
|
|
16527
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
16528
|
-
class: 'vxe-date-picker--time-picker-hour-list'
|
|
16529
|
-
}, hourList.map((item, index) => {
|
|
16530
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
16531
|
-
key: index,
|
|
16532
|
-
class: {
|
|
16533
|
-
'is--selected': datetimePanelValue && datetimePanelValue.getHours() === item.value
|
|
16534
|
-
},
|
|
16535
|
-
onClick: evnt => dateHourEvent(evnt, item)
|
|
16536
|
-
}, item.label);
|
|
16537
|
-
})), hasTimeMinute ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
16538
|
-
class: 'vxe-date-picker--time-picker-minute-list'
|
|
16539
|
-
}, minuteList.map((item, index) => {
|
|
16540
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
16541
|
-
key: index,
|
|
16542
|
-
class: {
|
|
16543
|
-
'is--selected': datetimePanelValue && datetimePanelValue.getMinutes() === item.value
|
|
16544
|
-
},
|
|
16545
|
-
onClick: evnt => dateMinuteEvent(evnt, item)
|
|
16546
|
-
}, item.label);
|
|
16547
|
-
})) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), hasTimeMinute && hasTimeSecond ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('ul', {
|
|
16548
|
-
class: 'vxe-date-picker--time-picker-second-list'
|
|
16549
|
-
}, secondList.map((item, index) => {
|
|
16550
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('li', {
|
|
16551
|
-
key: index,
|
|
16552
|
-
class: {
|
|
16553
|
-
'is--selected': datetimePanelValue && datetimePanelValue.getSeconds() === item.value
|
|
16554
|
-
},
|
|
16555
|
-
onClick: evnt => dateSecondEvent(evnt, item)
|
|
16556
|
-
}, item.label);
|
|
16557
|
-
})) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])];
|
|
16558
|
-
};
|
|
18186
|
+
Object.assign($xeDateRangePicker, dateRangePickerMethods);
|
|
16559
18187
|
const renderShortcutBtn = (pos, isVertical) => {
|
|
16560
18188
|
const shortcutOpts = computeShortcutOpts.value;
|
|
16561
18189
|
const {
|
|
16562
|
-
options,
|
|
16563
18190
|
position,
|
|
16564
18191
|
align,
|
|
16565
18192
|
mode
|
|
16566
18193
|
} = shortcutOpts;
|
|
16567
|
-
|
|
18194
|
+
const shortcutList = computeShortcutList.value;
|
|
18195
|
+
if (isEnableConf(shortcutOpts) && shortcutList.length && (position || 'left') === pos) {
|
|
16568
18196
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16569
|
-
class: `vxe-date-picker--
|
|
18197
|
+
class: `vxe-date-range-picker--layout-${pos}-wrapper`
|
|
16570
18198
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(button_group, {
|
|
16571
|
-
options,
|
|
18199
|
+
options: shortcutList,
|
|
16572
18200
|
mode,
|
|
16573
18201
|
align,
|
|
16574
18202
|
vertical: isVertical,
|
|
16575
18203
|
onClick: handleShortcutEvent
|
|
16576
18204
|
})]);
|
|
16577
18205
|
}
|
|
16578
|
-
return renderEmptyElement($
|
|
16579
|
-
};
|
|
16580
|
-
const renderPickerPanel = () => {
|
|
16581
|
-
const {
|
|
16582
|
-
type
|
|
16583
|
-
} = props;
|
|
16584
|
-
if (type === 'datetime') {
|
|
16585
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16586
|
-
key: type,
|
|
16587
|
-
ref: refPanelWrapper,
|
|
16588
|
-
class: 'vxe-date-picker--panel-datetime-layout-wrapper'
|
|
16589
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16590
|
-
class: 'vxe-date-picker--panel-datetime-left-wrapper'
|
|
16591
|
-
}, renderDatePanel()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16592
|
-
class: 'vxe-date-picker--panel-datetime-right-wrapper'
|
|
16593
|
-
}, renderTimePanel())]);
|
|
16594
|
-
} else if (type === 'time') {
|
|
16595
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16596
|
-
key: type,
|
|
16597
|
-
ref: refPanelWrapper,
|
|
16598
|
-
class: 'vxe-date-picker--panel-wrapper'
|
|
16599
|
-
}, renderTimePanel());
|
|
16600
|
-
}
|
|
16601
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16602
|
-
key: type || 'default',
|
|
16603
|
-
ref: refPanelWrapper,
|
|
16604
|
-
class: 'vxe-date-picker--panel-wrapper'
|
|
16605
|
-
}, renderDatePanel());
|
|
18206
|
+
return renderEmptyElement($xeDateRangePicker);
|
|
16606
18207
|
};
|
|
16607
18208
|
const renderPanel = () => {
|
|
16608
18209
|
const {
|
|
16609
|
-
type
|
|
18210
|
+
type,
|
|
18211
|
+
separator,
|
|
18212
|
+
autoClose,
|
|
18213
|
+
showConfirmButton,
|
|
18214
|
+
showClearButton
|
|
16610
18215
|
} = props;
|
|
16611
18216
|
const {
|
|
16612
18217
|
initialized,
|
|
16613
18218
|
isAniVisible,
|
|
16614
18219
|
visiblePanel,
|
|
16615
18220
|
panelPlacement,
|
|
16616
|
-
panelStyle
|
|
18221
|
+
panelStyle,
|
|
18222
|
+
startValue,
|
|
18223
|
+
endValue
|
|
16617
18224
|
} = reactData;
|
|
16618
18225
|
const vSize = computeSize.value;
|
|
16619
18226
|
const btnTransfer = computeBtnTransfer.value;
|
|
16620
18227
|
const shortcutOpts = computeShortcutOpts.value;
|
|
18228
|
+
const isClearable = computeIsClearable.value;
|
|
18229
|
+
const panelLabelObj = computePanelLabelObj.value;
|
|
18230
|
+
const shortcutList = computeShortcutList.value;
|
|
18231
|
+
const isDateTimeType = computeIsDateTimeType.value;
|
|
18232
|
+
const {
|
|
18233
|
+
startLabel,
|
|
18234
|
+
endLabel
|
|
18235
|
+
} = panelLabelObj;
|
|
16621
18236
|
const {
|
|
16622
|
-
options,
|
|
16623
18237
|
position
|
|
16624
18238
|
} = shortcutOpts;
|
|
16625
18239
|
const headerSlot = slots.header;
|
|
@@ -16628,13 +18242,15 @@ const Countdown = VxeCountdown;
|
|
|
16628
18242
|
const bottomSlot = slots.bottom;
|
|
16629
18243
|
const leftSlot = slots.left;
|
|
16630
18244
|
const rightSlot = slots.right;
|
|
16631
|
-
const hasShortcutBtn =
|
|
18245
|
+
const hasShortcutBtn = shortcutList.length > 0;
|
|
18246
|
+
const showConfirmBtn = showConfirmButton === null ? isDateTimeType || !autoClose : showConfirmButton;
|
|
18247
|
+
const showClearBtn = showClearButton === null ? isClearable : showClearButton;
|
|
16632
18248
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.Teleport, {
|
|
16633
18249
|
to: 'body',
|
|
16634
18250
|
disabled: btnTransfer ? !initialized : true
|
|
16635
18251
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16636
18252
|
ref: refInputPanel,
|
|
16637
|
-
class: ['vxe-table--ignore-clear vxe-date-picker--panel', `type--${type}`, {
|
|
18253
|
+
class: ['vxe-table--ignore-clear vxe-date-range-picker--panel', `type--${type}`, {
|
|
16638
18254
|
[`size--${vSize}`]: vSize,
|
|
16639
18255
|
'is--transfer': btnTransfer,
|
|
16640
18256
|
'ani--leave': isAniVisible,
|
|
@@ -16647,25 +18263,74 @@ const Countdown = VxeCountdown;
|
|
|
16647
18263
|
placement: panelPlacement,
|
|
16648
18264
|
style: panelStyle
|
|
16649
18265
|
}, initialized && (visiblePanel || isAniVisible) ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16650
|
-
|
|
18266
|
+
ref: refPanelWrapper,
|
|
18267
|
+
class: ['vxe-date-range-picker--layout-all-wrapper', `type--${type}`, {
|
|
18268
|
+
[`size--${vSize}`]: vSize
|
|
18269
|
+
}]
|
|
16651
18270
|
}, [topSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16652
|
-
class: 'vxe-date-picker--
|
|
18271
|
+
class: 'vxe-date-range-picker--layout-top-wrapper'
|
|
16653
18272
|
}, topSlot({})) : renderShortcutBtn('top'), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16654
|
-
class: 'vxe-date-picker--
|
|
18273
|
+
class: 'vxe-date-range-picker--layout-body-layout-wrapper'
|
|
16655
18274
|
}, [leftSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16656
|
-
class: 'vxe-date-picker--
|
|
18275
|
+
class: 'vxe-date-range-picker--layout-left-wrapper'
|
|
16657
18276
|
}, leftSlot({})) : renderShortcutBtn('left', true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16658
|
-
class: 'vxe-date-picker--
|
|
18277
|
+
class: 'vxe-date-range-picker--layout-body-content-wrapper'
|
|
16659
18278
|
}, [headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16660
|
-
class: 'vxe-date-picker--
|
|
18279
|
+
class: 'vxe-date-range-picker--layout-header-wrapper'
|
|
16661
18280
|
}, headerSlot({})) : renderShortcutBtn('header'), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16662
|
-
class: 'vxe-date-picker--
|
|
16663
|
-
}, [
|
|
16664
|
-
|
|
16665
|
-
|
|
16666
|
-
|
|
18281
|
+
class: 'vxe-date-range-picker--layout-body-wrapper'
|
|
18282
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(date_panel, {
|
|
18283
|
+
ref: refStartDatePanel,
|
|
18284
|
+
modelValue: startValue,
|
|
18285
|
+
type: props.type,
|
|
18286
|
+
className: props.className,
|
|
18287
|
+
minDate: props.minDate,
|
|
18288
|
+
maxDate: props.maxDate,
|
|
18289
|
+
startDay: props.startDay,
|
|
18290
|
+
endDate: endValue,
|
|
18291
|
+
labelFormat: props.labelFormat,
|
|
18292
|
+
valueFormat: props.valueFormat,
|
|
18293
|
+
festivalMethod: props.festivalMethod,
|
|
18294
|
+
disabledMethod: props.disabledMethod,
|
|
18295
|
+
selectDay: props.selectDay,
|
|
18296
|
+
onChange: startPanelChangeEvent
|
|
18297
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(date_panel, {
|
|
18298
|
+
ref: refEndDatePanel,
|
|
18299
|
+
modelValue: endValue,
|
|
18300
|
+
type: props.type,
|
|
18301
|
+
className: props.className,
|
|
18302
|
+
minDate: props.minDate,
|
|
18303
|
+
maxDate: props.maxDate,
|
|
18304
|
+
startDay: props.startDay,
|
|
18305
|
+
startDate: startValue,
|
|
18306
|
+
labelFormat: props.labelFormat,
|
|
18307
|
+
valueFormat: props.valueFormat,
|
|
18308
|
+
festivalMethod: props.festivalMethod,
|
|
18309
|
+
disabledMethod: props.disabledMethod,
|
|
18310
|
+
selectDay: props.selectDay,
|
|
18311
|
+
onChange: endPanelChangeEvent
|
|
18312
|
+
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18313
|
+
class: 'vxe-date-range-picker--layout-footer-wrapper'
|
|
18314
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18315
|
+
class: 'vxe-date-range-picker--layout-footer-label'
|
|
18316
|
+
}, startLabel || endLabel ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', startLabel), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', `${separator || ''}`), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', endLabel)] : []), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18317
|
+
class: 'vxe-date-range-picker--layout-footer-custom'
|
|
18318
|
+
}, footerSlot ? footerSlot({}) : [renderShortcutBtn('footer')]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18319
|
+
class: 'vxe-date-range-picker--layout-footer-btns'
|
|
18320
|
+
}, [showClearBtn ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
18321
|
+
size: 'mini',
|
|
18322
|
+
disabled: !(startValue || endValue),
|
|
18323
|
+
content: i18n_getI18n('vxe.button.clear'),
|
|
18324
|
+
onClick: clearValueEvent
|
|
18325
|
+
}) : renderEmptyElement($xeDateRangePicker), showConfirmBtn ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
18326
|
+
size: 'mini',
|
|
18327
|
+
status: 'primary',
|
|
18328
|
+
content: i18n_getI18n('vxe.button.confirm'),
|
|
18329
|
+
onClick: confirmEvent
|
|
18330
|
+
}) : renderEmptyElement($xeDateRangePicker)])])]), rightSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18331
|
+
class: 'vxe-date-range-picker--layout-right-wrapper'
|
|
16667
18332
|
}, rightSlot({})) : renderShortcutBtn('right', true)]), bottomSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16668
|
-
class: 'vxe-date-picker--
|
|
18333
|
+
class: 'vxe-date-range-picker--layout-bottom-wrapper'
|
|
16669
18334
|
}, bottomSlot({})) : renderShortcutBtn('bottom')])] : [])]);
|
|
16670
18335
|
};
|
|
16671
18336
|
const renderPrefixIcon = () => {
|
|
@@ -16674,10 +18339,10 @@ const Countdown = VxeCountdown;
|
|
|
16674
18339
|
} = props;
|
|
16675
18340
|
const prefixSlot = slots.prefix;
|
|
16676
18341
|
return prefixSlot || prefixIcon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16677
|
-
class: 'vxe-date-picker--prefix',
|
|
18342
|
+
class: 'vxe-date-range-picker--prefix',
|
|
16678
18343
|
onClick: clickPrefixEvent
|
|
16679
18344
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16680
|
-
class: 'vxe-date-picker--prefix-icon'
|
|
18345
|
+
class: 'vxe-date-range-picker--prefix-icon'
|
|
16681
18346
|
}, prefixSlot ? getSlotVNs(prefixSlot({})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16682
18347
|
class: prefixIcon
|
|
16683
18348
|
})])]) : null;
|
|
@@ -16687,158 +18352,141 @@ const Countdown = VxeCountdown;
|
|
|
16687
18352
|
suffixIcon
|
|
16688
18353
|
} = props;
|
|
16689
18354
|
const {
|
|
16690
|
-
|
|
18355
|
+
startValue,
|
|
18356
|
+
endValue
|
|
16691
18357
|
} = reactData;
|
|
16692
18358
|
const suffixSlot = slots.suffix;
|
|
16693
18359
|
const isDisabled = computeIsDisabled.value;
|
|
16694
18360
|
const isClearable = computeIsClearable.value;
|
|
16695
18361
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16696
|
-
class: ['vxe-date-picker--suffix', {
|
|
16697
|
-
'is--clear': isClearable && !isDisabled &&
|
|
18362
|
+
class: ['vxe-date-range-picker--suffix', {
|
|
18363
|
+
'is--clear': isClearable && !isDisabled && (startValue || endValue)
|
|
16698
18364
|
}]
|
|
16699
18365
|
}, [isClearable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16700
|
-
class: 'vxe-date-picker--clear-icon',
|
|
18366
|
+
class: 'vxe-date-range-picker--clear-icon',
|
|
16701
18367
|
onClick: clearValueEvent
|
|
16702
18368
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16703
18369
|
class: getIcon().INPUT_CLEAR
|
|
16704
|
-
})]) : (
|
|
16705
|
-
class: 'vxe-date-picker--suffix-icon',
|
|
18370
|
+
})]) : renderEmptyElement($xeDateRangePicker), renderExtraSuffixIcon(), suffixSlot || suffixIcon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18371
|
+
class: 'vxe-date-range-picker--suffix-icon',
|
|
16706
18372
|
onClick: clickSuffixEvent
|
|
16707
18373
|
}, suffixSlot ? getSlotVNs(suffixSlot({})) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16708
18374
|
class: suffixIcon
|
|
16709
|
-
})]) : (
|
|
18375
|
+
})]) : renderEmptyElement($xeDateRangePicker)]);
|
|
16710
18376
|
};
|
|
16711
18377
|
const renderExtraSuffixIcon = () => {
|
|
16712
18378
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16713
|
-
class: 'vxe-date-picker--control-icon',
|
|
16714
|
-
onClick:
|
|
18379
|
+
class: 'vxe-date-range-picker--control-icon',
|
|
18380
|
+
onClick: dateRangePickerOpenEvent
|
|
16715
18381
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
16716
|
-
class: ['vxe-date-picker--date-picker-icon', getIcon().DATE_PICKER_DATE]
|
|
18382
|
+
class: ['vxe-date-range-picker--date-picker-icon', getIcon().DATE_PICKER_DATE]
|
|
16717
18383
|
})]);
|
|
16718
18384
|
};
|
|
16719
18385
|
const renderVN = () => {
|
|
16720
18386
|
const {
|
|
16721
18387
|
className,
|
|
16722
18388
|
type,
|
|
16723
|
-
align,
|
|
16724
18389
|
name,
|
|
16725
|
-
autocomplete,
|
|
16726
18390
|
autoComplete
|
|
16727
18391
|
} = props;
|
|
16728
18392
|
const {
|
|
16729
|
-
|
|
18393
|
+
startValue,
|
|
18394
|
+
endValue,
|
|
16730
18395
|
visiblePanel,
|
|
16731
18396
|
isActivated
|
|
16732
18397
|
} = reactData;
|
|
16733
18398
|
const vSize = computeSize.value;
|
|
16734
18399
|
const isDisabled = computeIsDisabled.value;
|
|
16735
18400
|
const formReadonly = computeFormReadonly.value;
|
|
18401
|
+
const inputLabel = computeInputLabel.value;
|
|
16736
18402
|
if (formReadonly) {
|
|
16737
18403
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16738
18404
|
ref: refElem,
|
|
16739
|
-
class: ['vxe-date-picker--readonly', `type--${type}`, className]
|
|
16740
|
-
},
|
|
18405
|
+
class: ['vxe-date-range-picker--readonly', `type--${type}`, className]
|
|
18406
|
+
}, inputLabel);
|
|
16741
18407
|
}
|
|
16742
|
-
const inputReadonly = computeInputReadonly.value;
|
|
16743
|
-
const inputType = computeDatePickerType.value;
|
|
16744
18408
|
const inpPlaceholder = computeInpPlaceholder.value;
|
|
16745
18409
|
const isClearable = computeIsClearable.value;
|
|
16746
18410
|
const prefix = renderPrefixIcon();
|
|
16747
18411
|
const suffix = renderSuffixIcon();
|
|
16748
18412
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
16749
18413
|
ref: refElem,
|
|
16750
|
-
class: ['vxe-date-picker', `type--${type}`, className, {
|
|
18414
|
+
class: ['vxe-date-range-picker', `type--${type}`, className, {
|
|
16751
18415
|
[`size--${vSize}`]: vSize,
|
|
16752
|
-
[`is--${align}`]: align,
|
|
16753
18416
|
'is--prefix': !!prefix,
|
|
16754
18417
|
'is--suffix': !!suffix,
|
|
16755
18418
|
'is--visible': visiblePanel,
|
|
16756
18419
|
'is--disabled': isDisabled,
|
|
16757
18420
|
'is--active': isActivated,
|
|
16758
|
-
'show--clear': isClearable && !isDisabled &&
|
|
18421
|
+
'show--clear': isClearable && !isDisabled && (startValue || endValue)
|
|
16759
18422
|
}],
|
|
16760
18423
|
spellcheck: false
|
|
16761
|
-
}, [prefix || (
|
|
16762
|
-
class: 'vxe-date-picker--wrapper'
|
|
18424
|
+
}, [prefix || renderEmptyElement($xeDateRangePicker), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
18425
|
+
class: 'vxe-date-range-picker--wrapper'
|
|
16763
18426
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('input', {
|
|
16764
18427
|
ref: refInputTarget,
|
|
16765
|
-
class: 'vxe-date-picker--inner',
|
|
16766
|
-
value:
|
|
18428
|
+
class: 'vxe-date-range-picker--inner',
|
|
18429
|
+
value: inputLabel,
|
|
16767
18430
|
name,
|
|
16768
|
-
type:
|
|
18431
|
+
type: 'text',
|
|
16769
18432
|
placeholder: inpPlaceholder,
|
|
16770
|
-
readonly:
|
|
18433
|
+
readonly: true,
|
|
16771
18434
|
disabled: isDisabled,
|
|
16772
|
-
autocomplete: autoComplete
|
|
18435
|
+
autocomplete: autoComplete,
|
|
16773
18436
|
onKeydown: keydownEvent,
|
|
16774
18437
|
onKeyup: keyupEvent,
|
|
16775
18438
|
onClick: clickEvent,
|
|
16776
|
-
onInput: inputEvent,
|
|
16777
18439
|
onChange: changeEvent,
|
|
16778
18440
|
onFocus: focusEvent,
|
|
16779
18441
|
onBlur: blurEvent
|
|
16780
|
-
})]), suffix || (
|
|
18442
|
+
})]), suffix || renderEmptyElement($xeDateRangePicker),
|
|
16781
18443
|
// 下拉面板
|
|
16782
18444
|
renderPanel()]);
|
|
16783
18445
|
};
|
|
16784
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue,
|
|
16785
|
-
updateModelValue(
|
|
16786
|
-
changeValue();
|
|
16787
|
-
});
|
|
16788
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.type, () => {
|
|
16789
|
-
// 切换类型是重置内置变量
|
|
16790
|
-
Object.assign(reactData, {
|
|
16791
|
-
inputValue: '',
|
|
16792
|
-
datetimePanelValue: null,
|
|
16793
|
-
datePanelValue: null,
|
|
16794
|
-
datePanelLabel: '',
|
|
16795
|
-
datePanelType: 'day',
|
|
16796
|
-
selectMonth: null,
|
|
16797
|
-
currentDate: null
|
|
16798
|
-
});
|
|
16799
|
-
initValue();
|
|
18446
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.modelValue, () => {
|
|
18447
|
+
updateModelValue(true);
|
|
16800
18448
|
});
|
|
16801
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(
|
|
16802
|
-
|
|
16803
|
-
if (isDatePickerType) {
|
|
16804
|
-
dateParseValue(reactData.datePanelValue);
|
|
16805
|
-
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel;
|
|
16806
|
-
}
|
|
18449
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeMVal, () => {
|
|
18450
|
+
updateModelValue(false);
|
|
16807
18451
|
});
|
|
18452
|
+
updateModelValue(true);
|
|
16808
18453
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
16809
|
-
globalEvents.on($
|
|
16810
|
-
globalEvents.on($
|
|
16811
|
-
globalEvents.on($
|
|
16812
|
-
|
|
18454
|
+
globalEvents.on($xeDateRangePicker, 'mousewheel', handleGlobalMousewheelEvent);
|
|
18455
|
+
globalEvents.on($xeDateRangePicker, 'mousedown', handleGlobalMousedownEvent);
|
|
18456
|
+
globalEvents.on($xeDateRangePicker, 'blur', handleGlobalBlurEvent);
|
|
18457
|
+
});
|
|
18458
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onDeactivated)(() => {
|
|
18459
|
+
checkValue();
|
|
16813
18460
|
});
|
|
16814
18461
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
|
|
16815
|
-
globalEvents.off($
|
|
16816
|
-
globalEvents.off($
|
|
16817
|
-
globalEvents.off($
|
|
16818
|
-
globalEvents.off($xeDatePicker, 'blur');
|
|
18462
|
+
globalEvents.off($xeDateRangePicker, 'mousewheel');
|
|
18463
|
+
globalEvents.off($xeDateRangePicker, 'mousedown');
|
|
18464
|
+
globalEvents.off($xeDateRangePicker, 'blur');
|
|
16819
18465
|
});
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
18466
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onBeforeUnmount)(() => {
|
|
18467
|
+
checkValue();
|
|
18468
|
+
});
|
|
18469
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeDateRangePicker', $xeDateRangePicker);
|
|
18470
|
+
$xeDateRangePicker.renderVN = renderVN;
|
|
18471
|
+
return $xeDateRangePicker;
|
|
16823
18472
|
},
|
|
16824
18473
|
render() {
|
|
16825
18474
|
return this.renderVN();
|
|
16826
18475
|
}
|
|
16827
18476
|
}));
|
|
16828
|
-
;// CONCATENATED MODULE: ./packages/date-picker/index.ts
|
|
18477
|
+
;// CONCATENATED MODULE: ./packages/date-range-picker/index.ts
|
|
16829
18478
|
|
|
16830
18479
|
|
|
16831
18480
|
|
|
16832
|
-
const
|
|
18481
|
+
const VxeDateRangePicker = Object.assign({}, date_range_picker, {
|
|
16833
18482
|
install(app) {
|
|
16834
|
-
app.component(
|
|
16835
|
-
app.component('VxeDateInput', date_picker);
|
|
18483
|
+
app.component(date_range_picker.name, date_range_picker);
|
|
16836
18484
|
}
|
|
16837
18485
|
});
|
|
16838
|
-
dynamicApp.use(
|
|
16839
|
-
index_esm_VxeUI.component(
|
|
16840
|
-
const
|
|
16841
|
-
/* harmony default export */ var
|
|
18486
|
+
dynamicApp.use(VxeDateRangePicker);
|
|
18487
|
+
index_esm_VxeUI.component(date_range_picker);
|
|
18488
|
+
const DateRangePicker = VxeDateRangePicker;
|
|
18489
|
+
/* harmony default export */ var packages_date_range_picker = (VxeDateRangePicker);
|
|
16842
18490
|
;// CONCATENATED MODULE: ./packages/loading/index.ts
|
|
16843
18491
|
|
|
16844
18492
|
|
|
@@ -19226,10 +20874,14 @@ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
19226
20874
|
* @param modelFunc
|
|
19227
20875
|
* @param changeFunc
|
|
19228
20876
|
*/
|
|
19229
|
-
function getComponentOns(renderOpts, params,
|
|
20877
|
+
function getComponentOns(renderOpts, params, eFns, eventOns) {
|
|
19230
20878
|
const {
|
|
19231
20879
|
events
|
|
19232
20880
|
} = renderOpts;
|
|
20881
|
+
const {
|
|
20882
|
+
model: modelFunc,
|
|
20883
|
+
change: changeFunc
|
|
20884
|
+
} = eFns || {};
|
|
19233
20885
|
const modelEvent = getModelEvent(renderOpts.name);
|
|
19234
20886
|
const changeEvent = getChangeEvent(renderOpts.name);
|
|
19235
20887
|
const ons = {};
|
|
@@ -19259,7 +20911,7 @@ function getComponentOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
19259
20911
|
}
|
|
19260
20912
|
};
|
|
19261
20913
|
}
|
|
19262
|
-
return ons;
|
|
20914
|
+
return eventOns ? Object.assign(ons, eventOns) : ons;
|
|
19263
20915
|
}
|
|
19264
20916
|
function getItemOns(renderOpts, params) {
|
|
19265
20917
|
const {
|
|
@@ -19267,12 +20919,15 @@ function getItemOns(renderOpts, params) {
|
|
|
19267
20919
|
data,
|
|
19268
20920
|
field
|
|
19269
20921
|
} = params;
|
|
19270
|
-
return getComponentOns(renderOpts, params,
|
|
19271
|
-
|
|
19272
|
-
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
|
|
20922
|
+
return getComponentOns(renderOpts, params, {
|
|
20923
|
+
model(value) {
|
|
20924
|
+
// 处理 model 值双向绑定
|
|
20925
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(data, field, value);
|
|
20926
|
+
},
|
|
20927
|
+
change(params) {
|
|
20928
|
+
// 处理 change 事件相关逻辑
|
|
20929
|
+
$form.updateStatus(params);
|
|
20930
|
+
}
|
|
19276
20931
|
});
|
|
19277
20932
|
}
|
|
19278
20933
|
function getNativeItemOns(renderOpts, params) {
|
|
@@ -19297,12 +20952,15 @@ function renderNativeOptgroup(renderOpts, params, renderOptionsMethods) {
|
|
|
19297
20952
|
} = renderOpts;
|
|
19298
20953
|
const groupOptions = optionGroupProps.options || 'options';
|
|
19299
20954
|
const groupLabel = optionGroupProps.label || 'label';
|
|
19300
|
-
|
|
19301
|
-
return
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19305
|
-
|
|
20955
|
+
if (optionGroups) {
|
|
20956
|
+
return optionGroups.map((group, gIndex) => {
|
|
20957
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('optgroup', {
|
|
20958
|
+
key: gIndex,
|
|
20959
|
+
label: group[groupLabel]
|
|
20960
|
+
}, renderOptionsMethods(group[groupOptions], renderOpts, params));
|
|
20961
|
+
});
|
|
20962
|
+
}
|
|
20963
|
+
return [];
|
|
19306
20964
|
}
|
|
19307
20965
|
/**
|
|
19308
20966
|
* 渲染表单-项
|
|
@@ -19383,15 +21041,18 @@ function renderNativeFormOptions(options, renderOpts, params) {
|
|
|
19383
21041
|
const valueProp = optionProps.value || 'value';
|
|
19384
21042
|
const disabledProp = optionProps.disabled || 'disabled';
|
|
19385
21043
|
const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(data, field);
|
|
19386
|
-
|
|
19387
|
-
return
|
|
19388
|
-
|
|
19389
|
-
|
|
19390
|
-
|
|
19391
|
-
|
|
19392
|
-
|
|
19393
|
-
|
|
19394
|
-
|
|
21044
|
+
if (options) {
|
|
21045
|
+
return options.map((item, oIndex) => {
|
|
21046
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('option', {
|
|
21047
|
+
key: oIndex,
|
|
21048
|
+
value: item[valueProp],
|
|
21049
|
+
disabled: item[disabledProp],
|
|
21050
|
+
/* eslint-disable eqeqeq */
|
|
21051
|
+
selected: item[valueProp] == cellValue
|
|
21052
|
+
}, item[labelProp]);
|
|
21053
|
+
});
|
|
21054
|
+
}
|
|
21055
|
+
return [];
|
|
19395
21056
|
}
|
|
19396
21057
|
/**
|
|
19397
21058
|
* 渲染表单-项
|
|
@@ -19508,6 +21169,50 @@ renderer.mixin({
|
|
|
19508
21169
|
formItemAutoFocus: 'input',
|
|
19509
21170
|
renderFormItemContent: defaultItemRender
|
|
19510
21171
|
},
|
|
21172
|
+
VxeDateRangePicker: {
|
|
21173
|
+
formItemAutoFocus: 'input',
|
|
21174
|
+
renderFormItemContent(renderOpts, params) {
|
|
21175
|
+
const {
|
|
21176
|
+
startField,
|
|
21177
|
+
endField
|
|
21178
|
+
} = renderOpts;
|
|
21179
|
+
const {
|
|
21180
|
+
$form,
|
|
21181
|
+
data,
|
|
21182
|
+
field
|
|
21183
|
+
} = params;
|
|
21184
|
+
const itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(data, field);
|
|
21185
|
+
const seProps = {};
|
|
21186
|
+
const seOs = {};
|
|
21187
|
+
if (startField && endField) {
|
|
21188
|
+
seProps.startValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(data, startField);
|
|
21189
|
+
seProps.endValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(data, endField);
|
|
21190
|
+
seOs['onUpdate:startValue'] = value => {
|
|
21191
|
+
if (startField) {
|
|
21192
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(data, startField, value);
|
|
21193
|
+
}
|
|
21194
|
+
};
|
|
21195
|
+
seOs['onUpdate:endValue'] = value => {
|
|
21196
|
+
if (endField) {
|
|
21197
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(data, endField, value);
|
|
21198
|
+
}
|
|
21199
|
+
};
|
|
21200
|
+
}
|
|
21201
|
+
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(getDefaultComponent(renderOpts), {
|
|
21202
|
+
...getComponentFormItemProps(renderOpts, params, itemValue, seProps),
|
|
21203
|
+
...getComponentOns(renderOpts, params, {
|
|
21204
|
+
model(value) {
|
|
21205
|
+
// 处理 model 值双向绑定
|
|
21206
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(data, field, value);
|
|
21207
|
+
},
|
|
21208
|
+
change() {
|
|
21209
|
+
// 处理 change 事件相关逻辑
|
|
21210
|
+
$form.updateStatus(params);
|
|
21211
|
+
}
|
|
21212
|
+
}, seOs)
|
|
21213
|
+
})];
|
|
21214
|
+
}
|
|
21215
|
+
},
|
|
19511
21216
|
VxeButton: {
|
|
19512
21217
|
renderFormItemContent: defaultFormItemRender
|
|
19513
21218
|
},
|
|
@@ -44278,6 +45983,7 @@ const PasswordInput = VxePasswordInput;
|
|
|
44278
45983
|
|
|
44279
45984
|
|
|
44280
45985
|
|
|
45986
|
+
|
|
44281
45987
|
const browseObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();
|
|
44282
45988
|
// 打印
|
|
44283
45989
|
let printFrame;
|
|
@@ -44312,12 +46018,54 @@ function getExportBlobByString(str, type) {
|
|
|
44312
46018
|
type: `text/${type};charset=utf-8;`
|
|
44313
46019
|
});
|
|
44314
46020
|
}
|
|
44315
|
-
const
|
|
46021
|
+
const defaultPrintMargin = 50;
|
|
46022
|
+
function parseMargin(val) {
|
|
46023
|
+
let mVal = defaultPrintMargin;
|
|
46024
|
+
let top = mVal;
|
|
46025
|
+
let bottom = mVal;
|
|
46026
|
+
let left = mVal;
|
|
46027
|
+
let right = mVal;
|
|
46028
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val)) {
|
|
46029
|
+
mVal = val;
|
|
46030
|
+
top = mVal;
|
|
46031
|
+
bottom = mVal;
|
|
46032
|
+
left = mVal;
|
|
46033
|
+
right = mVal;
|
|
46034
|
+
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(val)) {
|
|
46035
|
+
if (val.margin) {
|
|
46036
|
+
mVal = val.margin;
|
|
46037
|
+
top = mVal;
|
|
46038
|
+
bottom = mVal;
|
|
46039
|
+
left = mVal;
|
|
46040
|
+
right = mVal;
|
|
46041
|
+
}
|
|
46042
|
+
if (val.marginTop) {
|
|
46043
|
+
top = val.marginTop;
|
|
46044
|
+
}
|
|
46045
|
+
if (val.marginBottom) {
|
|
46046
|
+
bottom = val.marginBottom;
|
|
46047
|
+
}
|
|
46048
|
+
if (val.marginLeft) {
|
|
46049
|
+
left = val.marginLeft;
|
|
46050
|
+
}
|
|
46051
|
+
if (val.marginRight) {
|
|
46052
|
+
right = val.marginRight;
|
|
46053
|
+
}
|
|
46054
|
+
}
|
|
46055
|
+
return {
|
|
46056
|
+
top: toCssUnit(top),
|
|
46057
|
+
bottom: toCssUnit(bottom),
|
|
46058
|
+
left: toCssUnit(left),
|
|
46059
|
+
right: toCssUnit(right)
|
|
46060
|
+
};
|
|
46061
|
+
}
|
|
44316
46062
|
function createHtmlPage(opts, printHtml) {
|
|
44317
46063
|
const {
|
|
46064
|
+
pageStyle,
|
|
44318
46065
|
customStyle
|
|
44319
46066
|
} = opts;
|
|
44320
|
-
|
|
46067
|
+
const marginObj = parseMargin(pageStyle);
|
|
46068
|
+
return ['<!DOCTYPE html><html>', '<head>', '<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">', `<title>${opts.title || ''}</title>`, opts._pageBreaks || opts.pageBreaks && opts.pageBreaks.length ? '<style media="print">@page {size: auto;margin: 0mm;}</style>' : '', `<style>.vxe-print-slots{display: none;}.vxe-print-page-break.align--center{text-align:center;}.vxe-print-page-break.align--left{text-align:left;}.vxe-print-page-break.align--right{text-align:right;}.vxe-print-page-break--header-title{font-size:1.8em;line-height:${marginObj.top || 'normal'};text-align:center;}.vxe-print-page-break{page-break-before:always;display:flex;flex-direction:column;height:100vh;overflow:hidden;}.vxe-print-page-break--body{display:flex;flex-direction:row;flex-grow:1;overflow: hidden;}.vxe-print-page-break--left,.vxe-print-page-break--right{flex-shrink:0;height:100%;}.vxe-print-page-break--left{width:${marginObj.left};}.vxe-print-page-break--right{width:${marginObj.right};}.vxe-print-page-break--header,.vxe-print-page-break--footer{flex-shrink:0;width:100%;}.vxe-print-page-break--header{height:${marginObj.top};}.vxe-print-page-break--footer{height:${marginObj.bottom};}.vxe-print-page-break--content{flex-grow: 1;overflow: hidden;}.vxe-print-page-break--footer-page-number{line-height:${marginObj.bottom || 'normal'};text-align:center;}</style>`, '<style>.vxe-table{white-space:pre;}</style>', `<style>${defaultHtmlStyle}</style>`, customStyle ? `<style>${customStyle}</style>` : '', '</head>', '<body>', `${printHtml}`, '</body>', '</html>'].join('');
|
|
44321
46069
|
}
|
|
44322
46070
|
function handlePrint(opts, printHtml = '') {
|
|
44323
46071
|
const {
|
|
@@ -44547,6 +46295,10 @@ const PrintPageBreak = VxePrintPageBreak;
|
|
|
44547
46295
|
type: Boolean,
|
|
44548
46296
|
default: () => getConfig().print.showAllPageTitle
|
|
44549
46297
|
},
|
|
46298
|
+
pageStyle: {
|
|
46299
|
+
type: Object,
|
|
46300
|
+
default: () => getConfig().print.pageStyle
|
|
46301
|
+
},
|
|
44550
46302
|
customStyle: {
|
|
44551
46303
|
type: String,
|
|
44552
46304
|
default: () => getConfig().print.customStyle
|
|
@@ -47953,7 +49705,9 @@ const Watermark = VxeWatermark;
|
|
|
47953
49705
|
|
|
47954
49706
|
|
|
47955
49707
|
|
|
47956
|
-
|
|
49708
|
+
|
|
49709
|
+
|
|
49710
|
+
const components_components = [packages_alert, packages_anchor, packages_anchor_link, packages_avatar, packages_badge, packages_breadcrumb, packages_breadcrumb_item, packages_button, packages_button_group, packages_calendar, packages_card, packages_carousel, packages_carousel_item, packages_checkbox, checkbox_group, packages_col, packages_collapse, packages_collapse_pane, packages_color_picker, packages_countdown, packages_date_panel, packages_date_picker, packages_date_range_picker, packages_drawer, packages_empty, packages_form, packages_form_design, form_gather, packages_form_group, packages_form_item, packages_form_view, packages_icon, packages_icon_picker, packages_image, image_group, image_preview, packages_input, packages_layout_aside, packages_layout_body, packages_layout_container, packages_layout_footer, packages_layout_header, packages_link, packages_list_design, packages_list_view, packages_list, loading, packages_menu, packages_modal, packages_notice_bar, packages_number_input, packages_optgroup, packages_option, packages_pager, packages_password_input, print_page_break, packages_print, packages_pulldown, packages_radio, radio_button, radio_group, packages_rate, packages_result, packages_row, packages_select, packages_split, packages_split_pane, packages_slider, packages_steps, packages_switch, packages_tab_pane, packages_table_select, packages_tabs, packages_tag, packages_text_ellipsis, packages_text, packages_textarea, packages_tip, packages_tooltip, packages_tree, packages_tree_select, packages_upload, packages_watermark];
|
|
47957
49711
|
function install(app, options) {
|
|
47958
49712
|
setConfig(options);
|
|
47959
49713
|
components_components.forEach(component => app.use(component));
|
|
@@ -48051,6 +49805,8 @@ const readFile = readLocalFile;
|
|
|
48051
49805
|
|
|
48052
49806
|
|
|
48053
49807
|
|
|
49808
|
+
|
|
49809
|
+
|
|
48054
49810
|
|
|
48055
49811
|
|
|
48056
49812
|
|