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