vxe-pc-ui 4.15.23 → 4.15.24
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/dist/all.esm.js +339 -198
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/cascader/src/cascader.js +1 -0
- package/es/date-panel/src/date-panel.js +35 -17
- package/es/date-panel/src/util.js +28 -1
- package/es/date-picker/src/date-picker.js +3 -1
- package/es/date-range-picker/src/date-range-picker.js +202 -122
- package/es/form/src/form.js +1 -0
- package/es/icon/style.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tooltip/src/tooltip.js +30 -18
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/cascader/src/cascader.js +1 -0
- package/lib/cascader/src/cascader.min.js +1 -1
- package/lib/date-panel/src/date-panel.js +48 -20
- package/lib/date-panel/src/date-panel.min.js +1 -1
- package/lib/date-panel/src/util.js +30 -2
- package/lib/date-panel/src/util.min.js +1 -1
- package/lib/date-picker/src/date-picker.js +3 -1
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/date-range-picker/src/date-range-picker.js +213 -134
- package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
- package/lib/form/src/form.js +1 -0
- package/lib/form/src/form.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 +329 -181
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tooltip/src/tooltip.js +29 -17
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/ui/index.js +1 -1
- 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/package.json +1 -1
- package/packages/cascader/src/cascader.ts +1 -0
- package/packages/date-panel/src/date-panel.ts +38 -18
- package/packages/date-panel/src/util.ts +29 -2
- package/packages/date-picker/src/date-picker.ts +4 -2
- package/packages/date-range-picker/src/date-range-picker.ts +201 -121
- package/packages/form/src/form.ts +1 -0
- package/packages/tooltip/src/tooltip.ts +33 -19
- package/types/components/date-panel.d.ts +14 -1
- package/types/components/date-range-picker.d.ts +5 -3
- package/types/components/tooltip.d.ts +1 -1
- /package/es/icon/{iconfont.1783073813654.ttf → iconfont.1783233742355.ttf} +0 -0
- /package/es/icon/{iconfont.1783073813654.woff → iconfont.1783233742355.woff} +0 -0
- /package/es/icon/{iconfont.1783073813654.woff2 → iconfont.1783233742355.woff2} +0 -0
- /package/es/{iconfont.1783073813654.ttf → iconfont.1783233742355.ttf} +0 -0
- /package/es/{iconfont.1783073813654.woff → iconfont.1783233742355.woff} +0 -0
- /package/es/{iconfont.1783073813654.woff2 → iconfont.1783233742355.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1783073813654.ttf → iconfont.1783233742355.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1783073813654.woff → iconfont.1783233742355.woff} +0 -0
- /package/lib/icon/style/{iconfont.1783073813654.woff2 → iconfont.1783233742355.woff2} +0 -0
- /package/lib/{iconfont.1783073813654.ttf → iconfont.1783233742355.ttf} +0 -0
- /package/lib/{iconfont.1783073813654.woff → iconfont.1783233742355.woff} +0 -0
- /package/lib/{iconfont.1783073813654.woff2 → iconfont.1783233742355.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -81,7 +81,7 @@ function checkDynamic() {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
const { log } = VxeUI;
|
|
84
|
-
const uiVersion = `ui v${"4.15.
|
|
84
|
+
const uiVersion = `ui v${"4.15.24"}`;
|
|
85
85
|
function createComponentLog(name) {
|
|
86
86
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
87
87
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -95,7 +95,7 @@ function createComponentLog(name) {
|
|
|
95
95
|
const warnLog$g = log.create('warn', uiVersion);
|
|
96
96
|
log.create('error', uiVersion);
|
|
97
97
|
|
|
98
|
-
const version = "4.15.
|
|
98
|
+
const version = "4.15.24";
|
|
99
99
|
VxeUI.uiVersion = version;
|
|
100
100
|
VxeUI.dynamicApp = dynamicApp;
|
|
101
101
|
function config(options) {
|
|
@@ -2545,6 +2545,28 @@ function deModelValue(nodeid) {
|
|
|
2545
2545
|
return nodeid ? decodeURIComponent(`${nodeid}`) : nodeid;
|
|
2546
2546
|
}
|
|
2547
2547
|
|
|
2548
|
+
function createReactData$l() {
|
|
2549
|
+
return {
|
|
2550
|
+
target: null,
|
|
2551
|
+
isUpdate: false,
|
|
2552
|
+
visible: false,
|
|
2553
|
+
tipPos: null,
|
|
2554
|
+
tipContent: '',
|
|
2555
|
+
tipActive: false,
|
|
2556
|
+
tipTarget: null,
|
|
2557
|
+
tipZindex: 0,
|
|
2558
|
+
tipStore: {
|
|
2559
|
+
style: {},
|
|
2560
|
+
placement: '',
|
|
2561
|
+
arrowStyle: {}
|
|
2562
|
+
}
|
|
2563
|
+
};
|
|
2564
|
+
}
|
|
2565
|
+
function createInternalData$k() {
|
|
2566
|
+
return {
|
|
2567
|
+
// showDelayTip: undefined
|
|
2568
|
+
};
|
|
2569
|
+
}
|
|
2548
2570
|
var VxeTooltipComponent = defineVxeComponent({
|
|
2549
2571
|
name: 'VxeTooltip',
|
|
2550
2572
|
props: {
|
|
@@ -2633,22 +2655,8 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
2633
2655
|
const { slots, emit } = context;
|
|
2634
2656
|
const xID = XEUtils.uniqueId();
|
|
2635
2657
|
const { computeSize } = useSize(props);
|
|
2636
|
-
const reactData = reactive(
|
|
2637
|
-
|
|
2638
|
-
isUpdate: false,
|
|
2639
|
-
visible: false,
|
|
2640
|
-
tipPos: null,
|
|
2641
|
-
tipContent: '',
|
|
2642
|
-
tipActive: false,
|
|
2643
|
-
tipTarget: null,
|
|
2644
|
-
tipZindex: 0,
|
|
2645
|
-
tipStore: {
|
|
2646
|
-
style: {},
|
|
2647
|
-
placement: '',
|
|
2648
|
-
arrowStyle: {}
|
|
2649
|
-
}
|
|
2650
|
-
});
|
|
2651
|
-
const internalData = {};
|
|
2658
|
+
const reactData = reactive(createReactData$l());
|
|
2659
|
+
const internalData = createInternalData$k();
|
|
2652
2660
|
const refElem = ref();
|
|
2653
2661
|
const contentWrapperfElem = ref();
|
|
2654
2662
|
const computeWrapperStyle = computed(() => {
|
|
@@ -3032,6 +3040,7 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
3032
3040
|
}
|
|
3033
3041
|
reactData.isUpdate = false;
|
|
3034
3042
|
});
|
|
3043
|
+
handleDelayFn();
|
|
3035
3044
|
onMounted(() => {
|
|
3036
3045
|
const contentWrapperfEl = contentWrapperfElem.value;
|
|
3037
3046
|
if (contentWrapperfEl) {
|
|
@@ -3090,7 +3099,10 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
3090
3099
|
}
|
|
3091
3100
|
}
|
|
3092
3101
|
});
|
|
3093
|
-
|
|
3102
|
+
onUnmounted(() => {
|
|
3103
|
+
XEUtils.assign(reactData, createReactData$l());
|
|
3104
|
+
XEUtils.assign(internalData, createInternalData$k());
|
|
3105
|
+
});
|
|
3094
3106
|
$xeTooltip.renderVN = renderVN;
|
|
3095
3107
|
return $xeTooltip;
|
|
3096
3108
|
},
|
|
@@ -3855,12 +3867,12 @@ VxeUI.component(VxeButtonComponent);
|
|
|
3855
3867
|
const Button = VxeButton;
|
|
3856
3868
|
|
|
3857
3869
|
const { errLog: errLog$h } = createComponentLog('backtop');
|
|
3858
|
-
function createInternalData$
|
|
3870
|
+
function createInternalData$j() {
|
|
3859
3871
|
return {
|
|
3860
3872
|
targetEl: null
|
|
3861
3873
|
};
|
|
3862
3874
|
}
|
|
3863
|
-
function createReactData$
|
|
3875
|
+
function createReactData$k() {
|
|
3864
3876
|
return {
|
|
3865
3877
|
showBtn: false,
|
|
3866
3878
|
backtopZindex: 0
|
|
@@ -3939,8 +3951,8 @@ var VxeBacktopComponent = defineVxeComponent({
|
|
|
3939
3951
|
const xID = XEUtils.uniqueId();
|
|
3940
3952
|
const refElem = ref();
|
|
3941
3953
|
const { computeSize } = useSize(props);
|
|
3942
|
-
const internalData = createInternalData$
|
|
3943
|
-
const reactData = reactive(createReactData$
|
|
3954
|
+
const internalData = createInternalData$j();
|
|
3955
|
+
const reactData = reactive(createReactData$k());
|
|
3944
3956
|
const refMaps = {
|
|
3945
3957
|
refElem
|
|
3946
3958
|
};
|
|
@@ -4117,8 +4129,8 @@ var VxeBacktopComponent = defineVxeComponent({
|
|
|
4117
4129
|
});
|
|
4118
4130
|
onBeforeUnmount(() => {
|
|
4119
4131
|
removeScrollEvent();
|
|
4120
|
-
XEUtils.assign(reactData, createReactData$
|
|
4121
|
-
XEUtils.assign(internalData, createInternalData$
|
|
4132
|
+
XEUtils.assign(reactData, createReactData$k());
|
|
4133
|
+
XEUtils.assign(internalData, createInternalData$j());
|
|
4122
4134
|
});
|
|
4123
4135
|
$xeBacktop.renderVN = renderVN;
|
|
4124
4136
|
return $xeBacktop;
|
|
@@ -4560,7 +4572,7 @@ function parseDateValue(val, type, options) {
|
|
|
4560
4572
|
const { valueFormat } = options;
|
|
4561
4573
|
if (val) {
|
|
4562
4574
|
if (type === 'time') {
|
|
4563
|
-
return toStringTimeDate(val);
|
|
4575
|
+
return toStringTimeDate(XEUtils.isArray(val) ? val : XEUtils.last(val));
|
|
4564
4576
|
}
|
|
4565
4577
|
if (XEUtils.isNumber(val) || /^[0-9]{10,15}$/.test(`${val}`)) {
|
|
4566
4578
|
return new Date(Number(val));
|
|
@@ -4568,6 +4580,9 @@ function parseDateValue(val, type, options) {
|
|
|
4568
4580
|
if (XEUtils.isString(val)) {
|
|
4569
4581
|
return XEUtils.toStringDate(XEUtils.last(val.split(',')), valueFormat);
|
|
4570
4582
|
}
|
|
4583
|
+
if (XEUtils.isArray(val)) {
|
|
4584
|
+
return XEUtils.toStringDate(XEUtils.last(val), valueFormat);
|
|
4585
|
+
}
|
|
4571
4586
|
return XEUtils.toStringDate(val, valueFormat);
|
|
4572
4587
|
}
|
|
4573
4588
|
return null;
|
|
@@ -4738,6 +4753,30 @@ function checkDateInputFormat(numStr, formatKey) {
|
|
|
4738
4753
|
}
|
|
4739
4754
|
return numVal;
|
|
4740
4755
|
}
|
|
4756
|
+
const getPrevMonth = (date) => {
|
|
4757
|
+
const currtYear = date.getFullYear();
|
|
4758
|
+
const currMonth = date.getMonth();
|
|
4759
|
+
if (currMonth) {
|
|
4760
|
+
date.setMonth(currMonth - 1);
|
|
4761
|
+
}
|
|
4762
|
+
else {
|
|
4763
|
+
date.setFullYear(currtYear - 1);
|
|
4764
|
+
date.setMonth(11);
|
|
4765
|
+
}
|
|
4766
|
+
return date;
|
|
4767
|
+
};
|
|
4768
|
+
const getNextMonth = (date) => {
|
|
4769
|
+
const currtYear = date.getFullYear();
|
|
4770
|
+
const currMonth = date.getMonth();
|
|
4771
|
+
if (currMonth < 11) {
|
|
4772
|
+
date.setMonth(currMonth + 1);
|
|
4773
|
+
}
|
|
4774
|
+
else {
|
|
4775
|
+
date.setFullYear(currtYear + 1);
|
|
4776
|
+
date.setMonth(0);
|
|
4777
|
+
}
|
|
4778
|
+
return date;
|
|
4779
|
+
};
|
|
4741
4780
|
|
|
4742
4781
|
const { errLog: errLog$g } = createComponentLog('calendar');
|
|
4743
4782
|
const { menus: menus$2, getConfig: getConfig$2, getI18n: getI18n$1 } = VxeUI;
|
|
@@ -6831,7 +6870,7 @@ function getRowIdByField(row, keyField) {
|
|
|
6831
6870
|
const rowKey = getRowKeyByField(row, keyField);
|
|
6832
6871
|
return enModelValue(rowKey);
|
|
6833
6872
|
}
|
|
6834
|
-
function createReactData$
|
|
6873
|
+
function createReactData$j() {
|
|
6835
6874
|
return {
|
|
6836
6875
|
scrollYLoad: false,
|
|
6837
6876
|
bodyHeight: 0,
|
|
@@ -6851,7 +6890,7 @@ function createReactData$i() {
|
|
|
6851
6890
|
dragTipText: ''
|
|
6852
6891
|
};
|
|
6853
6892
|
}
|
|
6854
|
-
function createInternalData$
|
|
6893
|
+
function createInternalData$i() {
|
|
6855
6894
|
return {
|
|
6856
6895
|
resizeObserver: undefined,
|
|
6857
6896
|
fullData: [],
|
|
@@ -6924,8 +6963,8 @@ var VxeListComponent = defineVxeComponent({
|
|
|
6924
6963
|
const xID = XEUtils.uniqueId();
|
|
6925
6964
|
const browseObj = XEUtils.browse();
|
|
6926
6965
|
const { computeSize } = useSize(props);
|
|
6927
|
-
const reactData = reactive(createReactData$
|
|
6928
|
-
const internalData = createInternalData$
|
|
6966
|
+
const reactData = reactive(createReactData$j());
|
|
6967
|
+
const internalData = createInternalData$i();
|
|
6929
6968
|
const crossListDragRowInfo = getCrossListDragRowInfo();
|
|
6930
6969
|
const refElem = ref();
|
|
6931
6970
|
const refHeaderElem = ref();
|
|
@@ -8347,8 +8386,8 @@ var VxeListComponent = defineVxeComponent({
|
|
|
8347
8386
|
resizeObserver.disconnect();
|
|
8348
8387
|
}
|
|
8349
8388
|
globalEvents.off($xeList, 'resize');
|
|
8350
|
-
XEUtils.assign(reactData, createReactData$
|
|
8351
|
-
XEUtils.assign(internalData, createInternalData$
|
|
8389
|
+
XEUtils.assign(reactData, createReactData$j());
|
|
8390
|
+
XEUtils.assign(internalData, createInternalData$i());
|
|
8352
8391
|
});
|
|
8353
8392
|
$xeList.renderVN = renderVN;
|
|
8354
8393
|
return $xeList;
|
|
@@ -11079,7 +11118,7 @@ const Input = VxeInput;
|
|
|
11079
11118
|
function getNodeUniqueId$1() {
|
|
11080
11119
|
return XEUtils.uniqueId('node_');
|
|
11081
11120
|
}
|
|
11082
|
-
function createReactData$
|
|
11121
|
+
function createReactData$i() {
|
|
11083
11122
|
return {
|
|
11084
11123
|
initialized: false,
|
|
11085
11124
|
searchValue: '',
|
|
@@ -11102,7 +11141,7 @@ function createReactData$h() {
|
|
|
11102
11141
|
lazyOptFlag: 1
|
|
11103
11142
|
};
|
|
11104
11143
|
}
|
|
11105
|
-
function createInternalData$
|
|
11144
|
+
function createInternalData$h() {
|
|
11106
11145
|
return {
|
|
11107
11146
|
// hpTimeout: undefined,
|
|
11108
11147
|
listVirtualYOpts: {
|
|
@@ -11229,8 +11268,8 @@ var VxeCascaderComponent = defineVxeComponent({
|
|
|
11229
11268
|
const refInpSearch = ref();
|
|
11230
11269
|
const refChunkWrapper = ref();
|
|
11231
11270
|
const refOptionPanel = ref();
|
|
11232
|
-
const reactData = reactive(createReactData$
|
|
11233
|
-
const internalData = createInternalData$
|
|
11271
|
+
const reactData = reactive(createReactData$i());
|
|
11272
|
+
const internalData = createInternalData$h();
|
|
11234
11273
|
const refMaps = {
|
|
11235
11274
|
refElem
|
|
11236
11275
|
};
|
|
@@ -12802,7 +12841,8 @@ var VxeCascaderComponent = defineVxeComponent({
|
|
|
12802
12841
|
globalEvents.off($xeCascader, 'mousedown');
|
|
12803
12842
|
globalEvents.off($xeCascader, 'blur');
|
|
12804
12843
|
globalEvents.off($xeCascader, 'resize');
|
|
12805
|
-
XEUtils.assign(
|
|
12844
|
+
XEUtils.assign(reactData, createReactData$i());
|
|
12845
|
+
XEUtils.assign(internalData, createInternalData$h());
|
|
12806
12846
|
});
|
|
12807
12847
|
provide('$xeCascader', $xeCascader);
|
|
12808
12848
|
$xeCascader.renderVN = renderVN;
|
|
@@ -13206,10 +13246,10 @@ dynamicApp.use(VxeCheckboxButton);
|
|
|
13206
13246
|
VxeUI.component(VxeCheckboxButtonComponent);
|
|
13207
13247
|
const CheckboxButton = VxeCheckboxButton;
|
|
13208
13248
|
|
|
13209
|
-
function createReactData$
|
|
13249
|
+
function createReactData$h() {
|
|
13210
13250
|
return {};
|
|
13211
13251
|
}
|
|
13212
|
-
function createInternalData$
|
|
13252
|
+
function createInternalData$g() {
|
|
13213
13253
|
return {
|
|
13214
13254
|
// isLoaded: false
|
|
13215
13255
|
};
|
|
@@ -13252,8 +13292,8 @@ var VxeCheckboxGroupComponent = defineVxeComponent({
|
|
|
13252
13292
|
const $xeForm = inject('$xeForm', null);
|
|
13253
13293
|
const formItemInfo = inject('xeFormItemInfo', null);
|
|
13254
13294
|
const xID = XEUtils.uniqueId();
|
|
13255
|
-
const reactData = reactive(createReactData$
|
|
13256
|
-
const internalData = createInternalData$
|
|
13295
|
+
const reactData = reactive(createReactData$h());
|
|
13296
|
+
const internalData = createInternalData$g();
|
|
13257
13297
|
const computeIsReadonly = computed(() => {
|
|
13258
13298
|
const { readonly } = props;
|
|
13259
13299
|
if (readonly === null) {
|
|
@@ -13425,8 +13465,8 @@ var VxeCheckboxGroupComponent = defineVxeComponent({
|
|
|
13425
13465
|
});
|
|
13426
13466
|
});
|
|
13427
13467
|
onUnmounted(() => {
|
|
13428
|
-
XEUtils.assign(reactData, createReactData$
|
|
13429
|
-
XEUtils.assign(internalData, createInternalData$
|
|
13468
|
+
XEUtils.assign(reactData, createReactData$h());
|
|
13469
|
+
XEUtils.assign(internalData, createInternalData$g());
|
|
13430
13470
|
});
|
|
13431
13471
|
provide('$xeCheckboxGroup', $xeCheckboxGroup);
|
|
13432
13472
|
$xeCheckboxGroup.renderVN = renderVN;
|
|
@@ -13559,7 +13599,7 @@ dynamicApp.use(VxeCol);
|
|
|
13559
13599
|
VxeUI.component(VxeColComponent);
|
|
13560
13600
|
const Col = VxeCol;
|
|
13561
13601
|
|
|
13562
|
-
function createReactData$
|
|
13602
|
+
function createReactData$g() {
|
|
13563
13603
|
return {
|
|
13564
13604
|
staticPanes: [],
|
|
13565
13605
|
cachePaneMaps: {},
|
|
@@ -13567,7 +13607,7 @@ function createReactData$f() {
|
|
|
13567
13607
|
openKeyFlag: 0
|
|
13568
13608
|
};
|
|
13569
13609
|
}
|
|
13570
|
-
function createInternalData$
|
|
13610
|
+
function createInternalData$f() {
|
|
13571
13611
|
return {
|
|
13572
13612
|
// esTime: null,
|
|
13573
13613
|
activeKeyMaps: {},
|
|
@@ -13604,8 +13644,8 @@ var VxeCollapseComponent = defineVxeComponent({
|
|
|
13604
13644
|
const xID = XEUtils.uniqueId();
|
|
13605
13645
|
const { computeSize } = useSize(props);
|
|
13606
13646
|
const refElem = ref();
|
|
13607
|
-
const reactData = reactive(createReactData$
|
|
13608
|
-
const internalData = createInternalData$
|
|
13647
|
+
const reactData = reactive(createReactData$g());
|
|
13648
|
+
const internalData = createInternalData$f();
|
|
13609
13649
|
const refMaps = {
|
|
13610
13650
|
refElem
|
|
13611
13651
|
};
|
|
@@ -13884,8 +13924,8 @@ var VxeCollapseComponent = defineVxeComponent({
|
|
|
13884
13924
|
if (esTime) {
|
|
13885
13925
|
clearTimeout(esTime);
|
|
13886
13926
|
}
|
|
13887
|
-
XEUtils.assign(reactData, createReactData$
|
|
13888
|
-
XEUtils.assign(internalData, createInternalData$
|
|
13927
|
+
XEUtils.assign(reactData, createReactData$g());
|
|
13928
|
+
XEUtils.assign(internalData, createInternalData$f());
|
|
13889
13929
|
});
|
|
13890
13930
|
provide('$xeCollapse', $xeCollapse);
|
|
13891
13931
|
$xeCollapse.renderVN = renderVN;
|
|
@@ -16270,12 +16310,12 @@ dynamicApp.use(VxeColorPicker);
|
|
|
16270
16310
|
VxeUI.component(VxeColorPickerComponent);
|
|
16271
16311
|
const ColorPicker = VxeColorPicker;
|
|
16272
16312
|
|
|
16273
|
-
function createInternalData$
|
|
16313
|
+
function createInternalData$e() {
|
|
16274
16314
|
return {
|
|
16275
16315
|
// leaveTime: null
|
|
16276
16316
|
};
|
|
16277
16317
|
}
|
|
16278
|
-
function createReactData$
|
|
16318
|
+
function createReactData$f() {
|
|
16279
16319
|
return {
|
|
16280
16320
|
visible: false,
|
|
16281
16321
|
activeOption: null,
|
|
@@ -16330,8 +16370,8 @@ var VxeContextMenuComponent = defineVxeComponent({
|
|
|
16330
16370
|
const xID = XEUtils.uniqueId();
|
|
16331
16371
|
const refElem = ref();
|
|
16332
16372
|
const { computeSize } = useSize(props);
|
|
16333
|
-
const internalData = createInternalData$
|
|
16334
|
-
const reactData = reactive(createReactData$
|
|
16373
|
+
const internalData = createInternalData$e();
|
|
16374
|
+
const reactData = reactive(createReactData$f());
|
|
16335
16375
|
const refMaps = {
|
|
16336
16376
|
refElem
|
|
16337
16377
|
};
|
|
@@ -16886,8 +16926,8 @@ var VxeContextMenuComponent = defineVxeComponent({
|
|
|
16886
16926
|
globalEvents.off($xeContextMenu, 'keydown');
|
|
16887
16927
|
globalEvents.off($xeContextMenu, 'mousedown');
|
|
16888
16928
|
globalEvents.off($xeContextMenu, 'blur');
|
|
16889
|
-
XEUtils.assign(reactData, createReactData$
|
|
16890
|
-
XEUtils.assign(internalData, createInternalData$
|
|
16929
|
+
XEUtils.assign(reactData, createReactData$f());
|
|
16930
|
+
XEUtils.assign(internalData, createInternalData$e());
|
|
16891
16931
|
});
|
|
16892
16932
|
$xeContextMenu.renderVN = renderVN;
|
|
16893
16933
|
return $xeContextMenu;
|
|
@@ -17393,7 +17433,7 @@ const Countdown = VxeCountdown;
|
|
|
17393
17433
|
var VxeDatePanelComponent = defineVxeComponent({
|
|
17394
17434
|
name: 'VxeDatePanel',
|
|
17395
17435
|
props: {
|
|
17396
|
-
modelValue: [String, Number, Date],
|
|
17436
|
+
modelValue: [String, Number, Date, Array],
|
|
17397
17437
|
type: {
|
|
17398
17438
|
type: String,
|
|
17399
17439
|
default: 'date'
|
|
@@ -17418,6 +17458,7 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
17418
17458
|
type: [String, Number, Date],
|
|
17419
17459
|
default: () => getConfig$3().datePanel.endDate
|
|
17420
17460
|
},
|
|
17461
|
+
defaultMode: String,
|
|
17421
17462
|
defaultDate: [String, Number, Date],
|
|
17422
17463
|
defaultTime: [String, Number, Date],
|
|
17423
17464
|
minDate: [String, Number, Date],
|
|
@@ -17429,6 +17470,7 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
17429
17470
|
labelFormat: String,
|
|
17430
17471
|
valueFormat: String,
|
|
17431
17472
|
timeFormat: String,
|
|
17473
|
+
valueSort: Boolean,
|
|
17432
17474
|
festivalMethod: {
|
|
17433
17475
|
type: Function,
|
|
17434
17476
|
default: () => getConfig$3().datePanel.festivalMethod
|
|
@@ -17507,10 +17549,10 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
17507
17549
|
return props.endDate ? XEUtils.toStringDate(props.endDate) : null;
|
|
17508
17550
|
});
|
|
17509
17551
|
const computeDateListValue = computed(() => {
|
|
17510
|
-
const { modelValue
|
|
17552
|
+
const { modelValue } = props;
|
|
17511
17553
|
const isDatePanelType = computeIsDatePanelType.value;
|
|
17512
17554
|
const dateValueFormat = computeDateValueFormat.value;
|
|
17513
|
-
if (
|
|
17555
|
+
if (modelValue && isDatePanelType) {
|
|
17514
17556
|
return XEUtils.toValueString(modelValue).split(',').map(item => {
|
|
17515
17557
|
const date = parseDate(item, dateValueFormat);
|
|
17516
17558
|
if (XEUtils.isValidDate(date)) {
|
|
@@ -17551,12 +17593,14 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
17551
17593
|
return handleValueFormat(type, valueFormat);
|
|
17552
17594
|
});
|
|
17553
17595
|
const computeDateValue = computed(() => {
|
|
17554
|
-
const { modelValue } = props;
|
|
17596
|
+
const { modelValue, defaultMode } = props;
|
|
17555
17597
|
const isDatePanelType = computeIsDatePanelType.value;
|
|
17556
17598
|
const dateValueFormat = computeDateValueFormat.value;
|
|
17557
17599
|
let val = null;
|
|
17558
17600
|
if (modelValue && isDatePanelType) {
|
|
17559
|
-
const
|
|
17601
|
+
const vals = XEUtils.isString(modelValue) ? modelValue.split(',') : modelValue;
|
|
17602
|
+
const currVal = defaultMode === 'last' ? XEUtils.last(vals) : XEUtils.first(vals);
|
|
17603
|
+
const date = parseDate(currVal, dateValueFormat);
|
|
17560
17604
|
if (XEUtils.isValidDate(date)) {
|
|
17561
17605
|
val = date;
|
|
17562
17606
|
}
|
|
@@ -17950,10 +17994,10 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
17950
17994
|
const parseDate = (value, format) => {
|
|
17951
17995
|
const { type, multiple } = props;
|
|
17952
17996
|
if (type === 'time') {
|
|
17953
|
-
return toStringTimeDate(value);
|
|
17997
|
+
return toStringTimeDate(XEUtils.isArray(value) ? value : XEUtils.last(value));
|
|
17954
17998
|
}
|
|
17955
17999
|
if (XEUtils.isArray(value)) {
|
|
17956
|
-
return XEUtils.toStringDate(value
|
|
18000
|
+
return XEUtils.toStringDate(XEUtils.last(value), format);
|
|
17957
18001
|
}
|
|
17958
18002
|
if (XEUtils.isString(value)) {
|
|
17959
18003
|
return XEUtils.toStringDate(multiple ? XEUtils.last(value.split(',')) : value, format);
|
|
@@ -18022,7 +18066,7 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
18022
18066
|
reactData.inputValue = value;
|
|
18023
18067
|
emit('update:modelValue', value);
|
|
18024
18068
|
};
|
|
18025
|
-
const handleChange = (value, evnt) => {
|
|
18069
|
+
const handleChange = (value, evnt, params) => {
|
|
18026
18070
|
const { type, modelValue, valueFormat } = props;
|
|
18027
18071
|
const dateValueFormat = computeDateValueFormat.value;
|
|
18028
18072
|
reactData.inputLabel = value;
|
|
@@ -18031,20 +18075,20 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
18031
18075
|
const timeNum = dateVal ? dateVal.getTime() : null;
|
|
18032
18076
|
emitModel(timeNum);
|
|
18033
18077
|
if (modelValue !== timeNum) {
|
|
18034
|
-
dispatchEvent('change', { value: timeNum }, evnt);
|
|
18078
|
+
dispatchEvent('change', { value: timeNum, currValue: params ? params.currValue : '' }, evnt);
|
|
18035
18079
|
}
|
|
18036
18080
|
}
|
|
18037
18081
|
else if (hasDateValueType(valueFormat)) {
|
|
18038
18082
|
const dateVal = parseDateValue(value, type, { valueFormat: dateValueFormat });
|
|
18039
18083
|
emitModel(dateVal);
|
|
18040
18084
|
if (modelValue && dateVal ? XEUtils.toStringDate(modelValue).getTime() !== dateVal.getTime() : modelValue !== dateVal) {
|
|
18041
|
-
dispatchEvent('change', { value: dateVal }, evnt);
|
|
18085
|
+
dispatchEvent('change', { value: dateVal, currValue: params ? params.currValue : '' }, evnt);
|
|
18042
18086
|
}
|
|
18043
18087
|
}
|
|
18044
18088
|
else {
|
|
18045
18089
|
emitModel(value);
|
|
18046
18090
|
if (XEUtils.toValueString(modelValue) !== value) {
|
|
18047
|
-
dispatchEvent('change', { value }, evnt);
|
|
18091
|
+
dispatchEvent('change', { value, currValue: params ? params.currValue : '' }, evnt);
|
|
18048
18092
|
}
|
|
18049
18093
|
}
|
|
18050
18094
|
};
|
|
@@ -18102,7 +18146,7 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
18102
18146
|
}
|
|
18103
18147
|
};
|
|
18104
18148
|
const dateChange = (date, isReload) => {
|
|
18105
|
-
const { modelValue, multiple } = props;
|
|
18149
|
+
const { modelValue, multiple, valueSort } = props;
|
|
18106
18150
|
const { datetimePanelValue } = reactData;
|
|
18107
18151
|
const isDateTimeType = computeIsDateTimeType.value;
|
|
18108
18152
|
const dateValueFormat = computeDateValueFormat.value;
|
|
@@ -18126,7 +18170,7 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
18126
18170
|
if (isDateTimeType) {
|
|
18127
18171
|
// 如果是datetime特殊类型
|
|
18128
18172
|
const dateListValue = isReload ? [] : [...computeDateListValue.value];
|
|
18129
|
-
|
|
18173
|
+
let datetimeRest = [];
|
|
18130
18174
|
const eqIndex = XEUtils.findIndexOf(dateListValue, val => XEUtils.isDateSame(date, val, 'yyyyMMdd'));
|
|
18131
18175
|
if (eqIndex === -1) {
|
|
18132
18176
|
if (overCount) {
|
|
@@ -18148,27 +18192,37 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
18148
18192
|
datetimeRest.push(item);
|
|
18149
18193
|
}
|
|
18150
18194
|
});
|
|
18151
|
-
|
|
18195
|
+
// 排序
|
|
18196
|
+
if (valueSort) {
|
|
18197
|
+
datetimeRest = datetimeRest.sort((a, b) => a.getTime() - b.getTime());
|
|
18198
|
+
}
|
|
18199
|
+
handleChange(datetimeRest.map(date => XEUtils.toDateString(date, dateValueFormat)).join(','), { type: 'update' }, { currValue: inpVal });
|
|
18152
18200
|
}
|
|
18153
18201
|
else {
|
|
18154
18202
|
const dateMultipleValue = isReload ? [] : computeDateMultipleValue.value;
|
|
18203
|
+
let dateRest = [];
|
|
18155
18204
|
// 如果是日期类型
|
|
18156
18205
|
if (dateMultipleValue.some(val => XEUtils.isEqual(val, inpVal))) {
|
|
18157
|
-
|
|
18206
|
+
dateRest = dateMultipleValue.filter(val => !XEUtils.isEqual(val, inpVal));
|
|
18158
18207
|
}
|
|
18159
18208
|
else {
|
|
18160
18209
|
if (overCount) {
|
|
18161
18210
|
// 如果超出最大多选数量
|
|
18162
18211
|
return;
|
|
18163
18212
|
}
|
|
18164
|
-
|
|
18213
|
+
dateRest = dateMultipleValue.concat([inpVal]);
|
|
18214
|
+
}
|
|
18215
|
+
// 排序
|
|
18216
|
+
if (valueSort) {
|
|
18217
|
+
dateRest = dateRest.sort();
|
|
18165
18218
|
}
|
|
18219
|
+
handleChange(dateRest.join(','), { type: 'update' }, { currValue: inpVal });
|
|
18166
18220
|
}
|
|
18167
18221
|
}
|
|
18168
18222
|
else {
|
|
18169
18223
|
// 如果为单选
|
|
18170
18224
|
if (!XEUtils.isEqual(modelValue, inpVal)) {
|
|
18171
|
-
handleChange(inpVal, { type: 'update' });
|
|
18225
|
+
handleChange(inpVal, { type: 'update' }, { currValue: inpVal });
|
|
18172
18226
|
}
|
|
18173
18227
|
}
|
|
18174
18228
|
};
|
|
@@ -18563,6 +18617,10 @@ var VxeDatePanelComponent = defineVxeComponent({
|
|
|
18563
18617
|
getModelValue() {
|
|
18564
18618
|
return reactData.inputValue;
|
|
18565
18619
|
},
|
|
18620
|
+
getViewType() {
|
|
18621
|
+
const { datePanelType } = reactData;
|
|
18622
|
+
return datePanelType;
|
|
18623
|
+
},
|
|
18566
18624
|
setPanelDate(date) {
|
|
18567
18625
|
if (date) {
|
|
18568
18626
|
dateCheckMonth(date);
|
|
@@ -19161,7 +19219,7 @@ const parseInputKayMaps = {};
|
|
|
19161
19219
|
inputMaskedKeys.forEach(key => {
|
|
19162
19220
|
parseInputKayMaps[key] = true;
|
|
19163
19221
|
});
|
|
19164
|
-
function createReactData$
|
|
19222
|
+
function createReactData$e() {
|
|
19165
19223
|
return {
|
|
19166
19224
|
initialized: false,
|
|
19167
19225
|
panelIndex: 0,
|
|
@@ -19174,7 +19232,7 @@ function createReactData$d() {
|
|
|
19174
19232
|
labelFlag: 0
|
|
19175
19233
|
};
|
|
19176
19234
|
}
|
|
19177
|
-
function createInternalData$
|
|
19235
|
+
function createInternalData$d() {
|
|
19178
19236
|
return {
|
|
19179
19237
|
// hpTimeout: undefined,
|
|
19180
19238
|
// fsTimeout: undefined,
|
|
@@ -19314,8 +19372,8 @@ var VxeDatePickerComponent = defineVxeComponent({
|
|
|
19314
19372
|
const formItemInfo = inject('xeFormItemInfo', null);
|
|
19315
19373
|
const xID = XEUtils.uniqueId();
|
|
19316
19374
|
const { computeSize } = useSize(props);
|
|
19317
|
-
const reactData = reactive(createReactData$
|
|
19318
|
-
const internalData = createInternalData$
|
|
19375
|
+
const reactData = reactive(createReactData$e());
|
|
19376
|
+
const internalData = createInternalData$d();
|
|
19319
19377
|
const refElem = ref();
|
|
19320
19378
|
const refInputTarget = ref();
|
|
19321
19379
|
const refInputPanel = ref();
|
|
@@ -20717,6 +20775,7 @@ var VxeDatePickerComponent = defineVxeComponent({
|
|
|
20717
20775
|
watch(() => props.modelValue, () => {
|
|
20718
20776
|
updateModelValue();
|
|
20719
20777
|
});
|
|
20778
|
+
updateModelValue();
|
|
20720
20779
|
nextTick(() => {
|
|
20721
20780
|
globalEvents.on($xeDatePicker, 'mousewheel', handleGlobalMousewheelEvent);
|
|
20722
20781
|
globalEvents.on($xeDatePicker, 'mousedown', handleGlobalMousedownEvent);
|
|
@@ -20741,8 +20800,9 @@ var VxeDatePickerComponent = defineVxeComponent({
|
|
|
20741
20800
|
globalEvents.off($xeDatePicker, 'keydown');
|
|
20742
20801
|
globalEvents.off($xeDatePicker, 'blur');
|
|
20743
20802
|
globalEvents.off($xeDatePicker, 'resize');
|
|
20803
|
+
XEUtils.assign(reactData, createReactData$e());
|
|
20804
|
+
XEUtils.assign(internalData, createInternalData$d());
|
|
20744
20805
|
});
|
|
20745
|
-
updateModelValue();
|
|
20746
20806
|
provide('$xeDatePicker', $xeDatePicker);
|
|
20747
20807
|
$xeDatePicker.renderVN = renderVN;
|
|
20748
20808
|
return $xeDatePicker;
|
|
@@ -20762,6 +20822,27 @@ VxeUI.component(VxeDatePickerComponent);
|
|
|
20762
20822
|
const DatePicker = VxeDatePicker;
|
|
20763
20823
|
|
|
20764
20824
|
const { errLog: errLog$d } = createComponentLog('date-range-picker');
|
|
20825
|
+
function createReactData$d() {
|
|
20826
|
+
return {
|
|
20827
|
+
initialized: false,
|
|
20828
|
+
panelIndex: 0,
|
|
20829
|
+
visiblePanel: false,
|
|
20830
|
+
isAniVisible: false,
|
|
20831
|
+
panelStyle: {},
|
|
20832
|
+
panelPlacement: '',
|
|
20833
|
+
isActivated: false,
|
|
20834
|
+
selectStValue: '',
|
|
20835
|
+
selectEdValue: '',
|
|
20836
|
+
paneStartVal: '',
|
|
20837
|
+
paneEndVal: ''
|
|
20838
|
+
};
|
|
20839
|
+
}
|
|
20840
|
+
function createInternalData$c() {
|
|
20841
|
+
return {
|
|
20842
|
+
// selectStatus: false
|
|
20843
|
+
// hpTimeout: undefined
|
|
20844
|
+
};
|
|
20845
|
+
}
|
|
20765
20846
|
var VxeDateRangePickerComponent = defineVxeComponent({
|
|
20766
20847
|
name: 'VxeDateRangePicker',
|
|
20767
20848
|
props: {
|
|
@@ -20898,21 +20979,8 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
20898
20979
|
const formItemInfo = inject('xeFormItemInfo', null);
|
|
20899
20980
|
const xID = XEUtils.uniqueId();
|
|
20900
20981
|
const { computeSize } = useSize(props);
|
|
20901
|
-
const reactData = reactive(
|
|
20902
|
-
|
|
20903
|
-
panelIndex: 0,
|
|
20904
|
-
visiblePanel: false,
|
|
20905
|
-
isAniVisible: false,
|
|
20906
|
-
panelStyle: {},
|
|
20907
|
-
panelPlacement: '',
|
|
20908
|
-
isActivated: false,
|
|
20909
|
-
startValue: '',
|
|
20910
|
-
endValue: ''
|
|
20911
|
-
});
|
|
20912
|
-
const internalData = {
|
|
20913
|
-
// selectStatus: false
|
|
20914
|
-
// hpTimeout: undefined
|
|
20915
|
-
};
|
|
20982
|
+
const reactData = reactive(createReactData$d());
|
|
20983
|
+
const internalData = createInternalData$c();
|
|
20916
20984
|
const refElem = ref();
|
|
20917
20985
|
const refInputTarget = ref();
|
|
20918
20986
|
const refInputPanel = ref();
|
|
@@ -21058,8 +21126,8 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21058
21126
|
return XEUtils.toNumber(startDay);
|
|
21059
21127
|
});
|
|
21060
21128
|
const computePanelLabelObj = computed(() => {
|
|
21061
|
-
const {
|
|
21062
|
-
const vals =
|
|
21129
|
+
const { selectStValue, selectEdValue } = reactData;
|
|
21130
|
+
const vals = selectStValue || selectEdValue ? [selectStValue || '', selectEdValue || ''] : [];
|
|
21063
21131
|
return formatRangeLabel(vals);
|
|
21064
21132
|
});
|
|
21065
21133
|
const computeInputLabel = computed(() => {
|
|
@@ -21174,13 +21242,13 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21174
21242
|
restObj = paraeUpdateModel();
|
|
21175
21243
|
}
|
|
21176
21244
|
}
|
|
21177
|
-
reactData.
|
|
21178
|
-
reactData.
|
|
21245
|
+
reactData.selectStValue = restObj.sValue;
|
|
21246
|
+
reactData.selectEdValue = restObj.eValue;
|
|
21179
21247
|
};
|
|
21180
21248
|
const triggerEvent = (evnt) => {
|
|
21181
|
-
const {
|
|
21182
|
-
const value = getRangeValue(
|
|
21183
|
-
dispatchEvent(evnt.type, { value, startValue, endValue }, evnt);
|
|
21249
|
+
const { selectStValue, selectEdValue } = reactData;
|
|
21250
|
+
const value = getRangeValue(selectStValue, selectEdValue);
|
|
21251
|
+
dispatchEvent(evnt.type, { value, startValue: selectStValue, endValue: selectEdValue }, evnt);
|
|
21184
21252
|
};
|
|
21185
21253
|
const handleChange = (sValue, eValue, evnt) => {
|
|
21186
21254
|
const { type, modelValue, valueFormat } = props;
|
|
@@ -21205,8 +21273,8 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21205
21273
|
endRest = parseDateValue(endRest, type, { valueFormat: dateValueFormat });
|
|
21206
21274
|
}
|
|
21207
21275
|
}
|
|
21208
|
-
reactData.
|
|
21209
|
-
reactData.
|
|
21276
|
+
reactData.selectStValue = startRest;
|
|
21277
|
+
reactData.selectEdValue = endRest;
|
|
21210
21278
|
const value = getRangeValue(startRest, endRest);
|
|
21211
21279
|
const isFinish = (startRest && endRest) || (!startRest && !endRest);
|
|
21212
21280
|
emit('update:modelValue', value);
|
|
@@ -21241,9 +21309,9 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21241
21309
|
const clickPrefixEvent = (evnt) => {
|
|
21242
21310
|
const isDisabled = computeIsDisabled.value;
|
|
21243
21311
|
if (!isDisabled) {
|
|
21244
|
-
const {
|
|
21245
|
-
const value = getRangeValue(
|
|
21246
|
-
dispatchEvent('prefix-click', { value, startValue, endValue }, evnt);
|
|
21312
|
+
const { selectStValue, selectEdValue } = reactData;
|
|
21313
|
+
const value = getRangeValue(selectStValue, selectEdValue);
|
|
21314
|
+
dispatchEvent('prefix-click', { value, startValue: selectStValue, endValue: selectEdValue }, evnt);
|
|
21247
21315
|
}
|
|
21248
21316
|
};
|
|
21249
21317
|
const hidePanel = () => {
|
|
@@ -21277,8 +21345,8 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21277
21345
|
}
|
|
21278
21346
|
};
|
|
21279
21347
|
const panelCellClassName = ({ date }) => {
|
|
21280
|
-
const startValue = reactData.
|
|
21281
|
-
const endValue = reactData.
|
|
21348
|
+
const startValue = reactData.selectStValue;
|
|
21349
|
+
const endValue = reactData.selectEdValue;
|
|
21282
21350
|
if (startValue && endValue) {
|
|
21283
21351
|
const currTime = date.getTime();
|
|
21284
21352
|
const startTime = XEUtils.toStringDate(startValue).getTime();
|
|
@@ -21291,18 +21359,18 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21291
21359
|
};
|
|
21292
21360
|
const handleSelectClose = () => {
|
|
21293
21361
|
const { autoClose } = props;
|
|
21294
|
-
const {
|
|
21362
|
+
const { selectStValue, selectEdValue } = reactData;
|
|
21295
21363
|
const { selectStatus } = internalData;
|
|
21296
21364
|
const isDatePickerType = computeIsDatePickerType.value;
|
|
21297
21365
|
if (autoClose) {
|
|
21298
21366
|
if (selectStatus && isDatePickerType) {
|
|
21299
|
-
if (
|
|
21367
|
+
if (selectStValue && selectEdValue) {
|
|
21300
21368
|
hidePanel();
|
|
21301
21369
|
}
|
|
21302
21370
|
}
|
|
21303
21371
|
}
|
|
21304
21372
|
else {
|
|
21305
|
-
if (
|
|
21373
|
+
if (selectStValue && selectEdValue) {
|
|
21306
21374
|
internalData.selectStatus = false;
|
|
21307
21375
|
}
|
|
21308
21376
|
}
|
|
@@ -21310,23 +21378,23 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21310
21378
|
const clickSuffixEvent = (evnt) => {
|
|
21311
21379
|
const isDisabled = computeIsDisabled.value;
|
|
21312
21380
|
if (!isDisabled) {
|
|
21313
|
-
const {
|
|
21314
|
-
const value = getRangeValue(
|
|
21315
|
-
dispatchEvent('suffix-click', { value, startValue, endValue }, evnt);
|
|
21381
|
+
const { selectStValue, selectEdValue } = reactData;
|
|
21382
|
+
const value = getRangeValue(selectStValue, selectEdValue);
|
|
21383
|
+
dispatchEvent('suffix-click', { value, startValue: selectStValue, endValue: selectEdValue }, evnt);
|
|
21316
21384
|
}
|
|
21317
21385
|
};
|
|
21318
21386
|
const blurEvent = (evnt) => {
|
|
21319
|
-
const {
|
|
21387
|
+
const { selectStValue, selectEdValue } = reactData;
|
|
21320
21388
|
const inpImmediate = computeInpImmediate.value;
|
|
21321
21389
|
const value = '';
|
|
21322
21390
|
if (!inpImmediate) {
|
|
21323
|
-
handleChange(
|
|
21391
|
+
handleChange(selectStValue, selectEdValue, evnt);
|
|
21324
21392
|
}
|
|
21325
21393
|
if (!reactData.visiblePanel) {
|
|
21326
21394
|
reactData.isActivated = false;
|
|
21327
21395
|
checkValue();
|
|
21328
21396
|
}
|
|
21329
|
-
dispatchEvent('blur', { value, startValue, endValue }, evnt);
|
|
21397
|
+
dispatchEvent('blur', { value, startValue: selectStValue, endValue: selectEdValue }, evnt);
|
|
21330
21398
|
// 自动更新校验状态
|
|
21331
21399
|
if ($xeForm && formItemInfo) {
|
|
21332
21400
|
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
@@ -21358,107 +21426,170 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21358
21426
|
};
|
|
21359
21427
|
const startPanelChangeEvent = (params) => {
|
|
21360
21428
|
const { selectStatus } = internalData;
|
|
21361
|
-
const { value, $event } = params;
|
|
21362
|
-
const
|
|
21363
|
-
|
|
21429
|
+
const { value, currValue, $event } = params;
|
|
21430
|
+
const paneVals = value ? (XEUtils.isString(value) ? value.split(',') : [value]) : [];
|
|
21431
|
+
let startValue = '';
|
|
21432
|
+
let endValue = '';
|
|
21433
|
+
if (selectStatus) {
|
|
21434
|
+
startValue = paneVals[0];
|
|
21435
|
+
if (paneVals[1]) {
|
|
21436
|
+
endValue = paneVals[1];
|
|
21437
|
+
}
|
|
21438
|
+
else {
|
|
21439
|
+
endValue = reactData.selectEdValue;
|
|
21440
|
+
}
|
|
21441
|
+
}
|
|
21442
|
+
else {
|
|
21443
|
+
startValue = currValue || XEUtils.last(paneVals);
|
|
21444
|
+
}
|
|
21445
|
+
reactData.paneEndVal = [startValue, endValue].join(',');
|
|
21446
|
+
reactData.paneStartVal = [startValue, endValue].join(',');
|
|
21447
|
+
handleChange(startValue, endValue, $event);
|
|
21364
21448
|
handleSelectClose();
|
|
21365
21449
|
if (!selectStatus) {
|
|
21366
21450
|
internalData.selectStatus = true;
|
|
21367
21451
|
}
|
|
21368
21452
|
nextTick(() => {
|
|
21369
|
-
|
|
21370
|
-
const $endDatePanel = refEndDatePanel.value;
|
|
21371
|
-
if ($startDatePanel && $endDatePanel) {
|
|
21372
|
-
const startValue = $startDatePanel.getModelValue();
|
|
21373
|
-
if (!endValue && startValue) {
|
|
21374
|
-
$endDatePanel.setPanelDate(XEUtils.toStringDate(startValue));
|
|
21375
|
-
}
|
|
21376
|
-
}
|
|
21453
|
+
handleUpdateStartPanelDate();
|
|
21377
21454
|
});
|
|
21378
21455
|
};
|
|
21379
21456
|
const endPanelChangeEvent = (params) => {
|
|
21380
21457
|
const { selectStatus } = internalData;
|
|
21381
|
-
const { value, $event } = params;
|
|
21382
|
-
const
|
|
21383
|
-
|
|
21458
|
+
const { value, currValue, $event } = params;
|
|
21459
|
+
const paneVals = value ? (XEUtils.isString(value) ? value.split(',') : [value]) : [];
|
|
21460
|
+
let startValue = '';
|
|
21461
|
+
let endValue = '';
|
|
21462
|
+
if (selectStatus) {
|
|
21463
|
+
endValue = paneVals[0];
|
|
21464
|
+
if (paneVals[1]) {
|
|
21465
|
+
startValue = paneVals[0];
|
|
21466
|
+
endValue = paneVals[1];
|
|
21467
|
+
}
|
|
21468
|
+
else {
|
|
21469
|
+
startValue = reactData.selectStValue;
|
|
21470
|
+
}
|
|
21471
|
+
}
|
|
21472
|
+
else {
|
|
21473
|
+
endValue = currValue || XEUtils.last(paneVals);
|
|
21474
|
+
}
|
|
21475
|
+
reactData.paneEndVal = [startValue, endValue].join(',');
|
|
21476
|
+
reactData.paneStartVal = [startValue, endValue].join(',');
|
|
21477
|
+
handleChange(startValue, endValue, $event);
|
|
21384
21478
|
handleSelectClose();
|
|
21385
21479
|
if (!selectStatus) {
|
|
21386
21480
|
internalData.selectStatus = true;
|
|
21387
21481
|
}
|
|
21388
21482
|
nextTick(() => {
|
|
21389
|
-
|
|
21390
|
-
|
|
21391
|
-
|
|
21392
|
-
|
|
21393
|
-
|
|
21394
|
-
|
|
21483
|
+
handleUpdateEndPanelDate();
|
|
21484
|
+
});
|
|
21485
|
+
};
|
|
21486
|
+
const handleUpdateStartPanelDate = () => {
|
|
21487
|
+
const $startDatePanel = refStartDatePanel.value;
|
|
21488
|
+
const $endDatePanel = refEndDatePanel.value;
|
|
21489
|
+
if (!$startDatePanel || !$endDatePanel) {
|
|
21490
|
+
return;
|
|
21491
|
+
}
|
|
21492
|
+
const startPanelDate = $startDatePanel.getPanelDate();
|
|
21493
|
+
const endPanelDate = $endDatePanel.getPanelDate();
|
|
21494
|
+
if (!startPanelDate || !endPanelDate) {
|
|
21495
|
+
return;
|
|
21496
|
+
}
|
|
21497
|
+
const viewType = $startDatePanel.getViewType();
|
|
21498
|
+
const startYear = startPanelDate.getFullYear();
|
|
21499
|
+
const startMonth = startPanelDate.getMonth();
|
|
21500
|
+
const endYear = endPanelDate.getFullYear();
|
|
21501
|
+
const endMonth = endPanelDate.getMonth();
|
|
21502
|
+
switch (viewType) {
|
|
21503
|
+
case 'day':
|
|
21504
|
+
case 'date':
|
|
21505
|
+
case 'week': {
|
|
21506
|
+
if (endYear <= startYear && endMonth <= startMonth) {
|
|
21507
|
+
$endDatePanel.setPanelDate(getNextMonth(startPanelDate));
|
|
21395
21508
|
}
|
|
21509
|
+
break;
|
|
21396
21510
|
}
|
|
21397
|
-
}
|
|
21511
|
+
}
|
|
21398
21512
|
};
|
|
21399
|
-
const startPanelDateBtnChangeEvent = (
|
|
21513
|
+
const startPanelDateBtnChangeEvent = () => {
|
|
21400
21514
|
const { linkedPanels } = props;
|
|
21515
|
+
const $startDatePanel = refStartDatePanel.value;
|
|
21516
|
+
const $endDatePanel = refEndDatePanel.value;
|
|
21517
|
+
if (!$startDatePanel || !$endDatePanel) {
|
|
21518
|
+
return;
|
|
21519
|
+
}
|
|
21520
|
+
const startPanelDate = $startDatePanel.getPanelDate();
|
|
21521
|
+
const endPanelDate = $endDatePanel.getPanelDate();
|
|
21522
|
+
if (!startPanelDate || !endPanelDate) {
|
|
21523
|
+
return;
|
|
21524
|
+
}
|
|
21525
|
+
const viewType = $startDatePanel.getViewType();
|
|
21401
21526
|
if (linkedPanels) {
|
|
21402
|
-
const { viewType } = params;
|
|
21403
|
-
const $startDatePanel = refStartDatePanel.value;
|
|
21404
|
-
const $endDatePanel = refEndDatePanel.value;
|
|
21405
|
-
if (!$startDatePanel || !$endDatePanel) {
|
|
21406
|
-
return;
|
|
21407
|
-
}
|
|
21408
|
-
const startPanelDate = $startDatePanel.getPanelDate();
|
|
21409
|
-
if (!startPanelDate) {
|
|
21410
|
-
return;
|
|
21411
|
-
}
|
|
21412
|
-
const endYear = startPanelDate.getFullYear();
|
|
21413
|
-
const endMonth = startPanelDate.getMonth();
|
|
21414
21527
|
switch (viewType) {
|
|
21415
21528
|
case 'day':
|
|
21416
21529
|
case 'date':
|
|
21417
21530
|
case 'week': {
|
|
21418
|
-
|
|
21419
|
-
startPanelDate.setMonth(endMonth + 1);
|
|
21420
|
-
}
|
|
21421
|
-
else {
|
|
21422
|
-
startPanelDate.setFullYear(endYear + 1);
|
|
21423
|
-
startPanelDate.setMonth(0);
|
|
21424
|
-
}
|
|
21425
|
-
$endDatePanel.setPanelDate(startPanelDate);
|
|
21531
|
+
$endDatePanel.setPanelDate(getNextMonth(startPanelDate));
|
|
21426
21532
|
break;
|
|
21427
21533
|
}
|
|
21428
21534
|
}
|
|
21429
21535
|
}
|
|
21536
|
+
else {
|
|
21537
|
+
handleUpdateStartPanelDate();
|
|
21538
|
+
}
|
|
21539
|
+
};
|
|
21540
|
+
const handleUpdateEndPanelDate = () => {
|
|
21541
|
+
const $startDatePanel = refStartDatePanel.value;
|
|
21542
|
+
const $endDatePanel = refEndDatePanel.value;
|
|
21543
|
+
if (!$startDatePanel || !$endDatePanel) {
|
|
21544
|
+
return;
|
|
21545
|
+
}
|
|
21546
|
+
const startPanelDate = $startDatePanel.getPanelDate();
|
|
21547
|
+
const endPanelDate = $endDatePanel.getPanelDate();
|
|
21548
|
+
if (!startPanelDate || !endPanelDate) {
|
|
21549
|
+
return;
|
|
21550
|
+
}
|
|
21551
|
+
const viewType = $endDatePanel.getViewType();
|
|
21552
|
+
const startYear = startPanelDate.getFullYear();
|
|
21553
|
+
const startMonth = startPanelDate.getMonth();
|
|
21554
|
+
const endYear = endPanelDate.getFullYear();
|
|
21555
|
+
const endMonth = endPanelDate.getMonth();
|
|
21556
|
+
switch (viewType) {
|
|
21557
|
+
case 'day':
|
|
21558
|
+
case 'date':
|
|
21559
|
+
case 'week': {
|
|
21560
|
+
if (startYear >= endYear && startMonth >= endMonth) {
|
|
21561
|
+
$startDatePanel.setPanelDate(getPrevMonth(endPanelDate));
|
|
21562
|
+
}
|
|
21563
|
+
break;
|
|
21564
|
+
}
|
|
21565
|
+
}
|
|
21430
21566
|
};
|
|
21431
|
-
const endPanelDateBtnChangeEvent = (
|
|
21567
|
+
const endPanelDateBtnChangeEvent = () => {
|
|
21432
21568
|
const { linkedPanels } = props;
|
|
21569
|
+
const $startDatePanel = refStartDatePanel.value;
|
|
21570
|
+
const $endDatePanel = refEndDatePanel.value;
|
|
21571
|
+
if (!$startDatePanel || !$endDatePanel) {
|
|
21572
|
+
return;
|
|
21573
|
+
}
|
|
21574
|
+
const startPanelDate = $startDatePanel.getPanelDate();
|
|
21575
|
+
const endPanelDate = $endDatePanel.getPanelDate();
|
|
21576
|
+
if (!startPanelDate || !endPanelDate) {
|
|
21577
|
+
return;
|
|
21578
|
+
}
|
|
21579
|
+
const viewType = $endDatePanel.getViewType();
|
|
21433
21580
|
if (linkedPanels) {
|
|
21434
|
-
const { viewType } = params;
|
|
21435
|
-
const $startDatePanel = refStartDatePanel.value;
|
|
21436
|
-
const $endDatePanel = refEndDatePanel.value;
|
|
21437
|
-
if (!$startDatePanel || !$endDatePanel) {
|
|
21438
|
-
return;
|
|
21439
|
-
}
|
|
21440
|
-
const endPanelDate = $endDatePanel.getPanelDate();
|
|
21441
|
-
if (!endPanelDate) {
|
|
21442
|
-
return;
|
|
21443
|
-
}
|
|
21444
|
-
const endYear = endPanelDate.getFullYear();
|
|
21445
|
-
const endMonth = endPanelDate.getMonth();
|
|
21446
21581
|
switch (viewType) {
|
|
21447
21582
|
case 'day':
|
|
21448
21583
|
case 'date':
|
|
21449
21584
|
case 'week': {
|
|
21450
|
-
|
|
21451
|
-
endPanelDate.setMonth(endMonth - 1);
|
|
21452
|
-
}
|
|
21453
|
-
else {
|
|
21454
|
-
endPanelDate.setFullYear(endYear - 1);
|
|
21455
|
-
endPanelDate.setMonth(11);
|
|
21456
|
-
}
|
|
21457
|
-
$startDatePanel.setPanelDate(endPanelDate);
|
|
21585
|
+
$startDatePanel.setPanelDate(getPrevMonth(endPanelDate));
|
|
21458
21586
|
break;
|
|
21459
21587
|
}
|
|
21460
21588
|
}
|
|
21461
21589
|
}
|
|
21590
|
+
else {
|
|
21591
|
+
handleUpdateEndPanelDate();
|
|
21592
|
+
}
|
|
21462
21593
|
};
|
|
21463
21594
|
// 全局事件
|
|
21464
21595
|
const handleGlobalMousedownEvent = (evnt) => {
|
|
@@ -21583,6 +21714,7 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21583
21714
|
reactData.isAniVisible = true;
|
|
21584
21715
|
setTimeout(() => {
|
|
21585
21716
|
reactData.visiblePanel = true;
|
|
21717
|
+
handleUpdateStartPanelDate();
|
|
21586
21718
|
updatePlacement();
|
|
21587
21719
|
}, 10);
|
|
21588
21720
|
updateZindex();
|
|
@@ -21618,8 +21750,8 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21618
21750
|
const shortcutOpts = computeShortcutOpts.value;
|
|
21619
21751
|
const { autoClose } = shortcutOpts;
|
|
21620
21752
|
const { code, clickMethod } = option;
|
|
21621
|
-
let startValue = reactData.
|
|
21622
|
-
let endValue = reactData.
|
|
21753
|
+
let startValue = reactData.selectStValue;
|
|
21754
|
+
let endValue = reactData.selectEdValue;
|
|
21623
21755
|
let value = getRangeValue(startValue, endValue);
|
|
21624
21756
|
const shortcutParams = {
|
|
21625
21757
|
$dateRangePicker: $xeDateRangePicker,
|
|
@@ -21682,8 +21814,8 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21682
21814
|
dateRangePickerMethods = {
|
|
21683
21815
|
dispatchEvent,
|
|
21684
21816
|
setModelValue(startValue, endValue) {
|
|
21685
|
-
reactData.
|
|
21686
|
-
reactData.
|
|
21817
|
+
reactData.selectStValue = startValue || '';
|
|
21818
|
+
reactData.selectEdValue = endValue || '';
|
|
21687
21819
|
const value = getRangeValue(startValue, endValue);
|
|
21688
21820
|
emit('update:modelValue', value);
|
|
21689
21821
|
},
|
|
@@ -21737,8 +21869,8 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21737
21869
|
if (popupOpts.enabled === false) {
|
|
21738
21870
|
return renderEmptyElement($xeDateRangePicker);
|
|
21739
21871
|
}
|
|
21740
|
-
const { type, separator, autoClose, showConfirmButton, showClearButton } = props;
|
|
21741
|
-
const { initialized, isAniVisible, visiblePanel, panelPlacement, panelStyle,
|
|
21872
|
+
const { type, separator, autoClose, valueFormat, showConfirmButton, showClearButton } = props;
|
|
21873
|
+
const { initialized, isAniVisible, visiblePanel, panelPlacement, panelStyle, selectStValue, selectEdValue, paneStartVal, paneEndVal } = reactData;
|
|
21742
21874
|
const vSize = computeSize.value;
|
|
21743
21875
|
const btnTransfer = computeBtnTransfer.value;
|
|
21744
21876
|
const shortcutOpts = computeShortcutOpts.value;
|
|
@@ -21815,15 +21947,18 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21815
21947
|
}, [
|
|
21816
21948
|
h(VxeDatePanel, {
|
|
21817
21949
|
ref: refStartDatePanel,
|
|
21818
|
-
modelValue:
|
|
21950
|
+
modelValue: paneStartVal,
|
|
21951
|
+
multiple: true,
|
|
21952
|
+
valueSort: true,
|
|
21953
|
+
limitCount: 3,
|
|
21954
|
+
defaultMode: 'first',
|
|
21819
21955
|
type: props.type,
|
|
21820
21956
|
className: props.className,
|
|
21821
21957
|
minDate: props.minDate,
|
|
21822
21958
|
maxDate: props.maxDate,
|
|
21823
|
-
endDate: endValue,
|
|
21824
21959
|
startDay: props.startDay,
|
|
21825
21960
|
labelFormat: props.labelFormat,
|
|
21826
|
-
valueFormat:
|
|
21961
|
+
valueFormat: valueFormat === 'date' || valueFormat === 'timestamp' ? '' : valueFormat,
|
|
21827
21962
|
timeFormat: props.timeFormat,
|
|
21828
21963
|
defaultDate: sdDate,
|
|
21829
21964
|
defaultTime: sdTime,
|
|
@@ -21839,15 +21974,18 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21839
21974
|
}),
|
|
21840
21975
|
h(VxeDatePanel, {
|
|
21841
21976
|
ref: refEndDatePanel,
|
|
21842
|
-
modelValue:
|
|
21977
|
+
modelValue: paneEndVal,
|
|
21978
|
+
multiple: true,
|
|
21979
|
+
valueSort: true,
|
|
21980
|
+
limitCount: 3,
|
|
21981
|
+
defaultMode: 'last',
|
|
21843
21982
|
type: props.type,
|
|
21844
21983
|
className: props.className,
|
|
21845
21984
|
minDate: props.minDate,
|
|
21846
21985
|
maxDate: props.maxDate,
|
|
21847
|
-
startDate: startValue,
|
|
21848
21986
|
startDay: props.startDay,
|
|
21849
21987
|
labelFormat: props.labelFormat,
|
|
21850
|
-
valueFormat:
|
|
21988
|
+
valueFormat: valueFormat === 'date' || valueFormat === 'timestamp' ? '' : valueFormat,
|
|
21851
21989
|
timeFormat: props.timeFormat,
|
|
21852
21990
|
defaultDate: edDate,
|
|
21853
21991
|
defaultTime: edTime,
|
|
@@ -21883,7 +22021,7 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21883
22021
|
showClearBtn
|
|
21884
22022
|
? h(VxeButton, {
|
|
21885
22023
|
size: 'mini',
|
|
21886
|
-
disabled: !(
|
|
22024
|
+
disabled: !(selectStValue || selectEdValue),
|
|
21887
22025
|
content: getI18n$2('vxe.button.clear'),
|
|
21888
22026
|
onClick: clearValueEvent
|
|
21889
22027
|
})
|
|
@@ -21937,13 +22075,13 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21937
22075
|
};
|
|
21938
22076
|
const renderSuffixIcon = () => {
|
|
21939
22077
|
const { suffixIcon } = props;
|
|
21940
|
-
const {
|
|
22078
|
+
const { selectStValue, selectEdValue } = reactData;
|
|
21941
22079
|
const suffixSlot = slots.suffix;
|
|
21942
22080
|
const isDisabled = computeIsDisabled.value;
|
|
21943
22081
|
const isClearable = computeIsClearable.value;
|
|
21944
22082
|
return h('div', {
|
|
21945
22083
|
class: ['vxe-date-range-picker--suffix', {
|
|
21946
|
-
'is--clear': isClearable && !isDisabled && (
|
|
22084
|
+
'is--clear': isClearable && !isDisabled && (selectStValue || selectEdValue)
|
|
21947
22085
|
}]
|
|
21948
22086
|
}, [
|
|
21949
22087
|
isClearable
|
|
@@ -21983,7 +22121,7 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
21983
22121
|
};
|
|
21984
22122
|
const renderVN = () => {
|
|
21985
22123
|
const { className, type, name, autoComplete } = props;
|
|
21986
|
-
const {
|
|
22124
|
+
const { selectStValue, selectEdValue, visiblePanel, isActivated } = reactData;
|
|
21987
22125
|
const vSize = computeSize.value;
|
|
21988
22126
|
const isDisabled = computeIsDisabled.value;
|
|
21989
22127
|
const formReadonly = computeFormReadonly.value;
|
|
@@ -22007,7 +22145,7 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
22007
22145
|
'is--visible': visiblePanel,
|
|
22008
22146
|
'is--disabled': isDisabled,
|
|
22009
22147
|
'is--active': isActivated,
|
|
22010
|
-
'show--clear': isClearable && !isDisabled && (
|
|
22148
|
+
'show--clear': isClearable && !isDisabled && (selectStValue || selectEdValue)
|
|
22011
22149
|
}],
|
|
22012
22150
|
spellcheck: false
|
|
22013
22151
|
}, [
|
|
@@ -22055,14 +22193,16 @@ var VxeDateRangePickerComponent = defineVxeComponent({
|
|
|
22055
22193
|
onDeactivated(() => {
|
|
22056
22194
|
checkValue();
|
|
22057
22195
|
});
|
|
22196
|
+
onBeforeUnmount(() => {
|
|
22197
|
+
checkValue();
|
|
22198
|
+
});
|
|
22058
22199
|
onUnmounted(() => {
|
|
22059
22200
|
globalEvents.off($xeDateRangePicker, 'mousewheel');
|
|
22060
22201
|
globalEvents.off($xeDateRangePicker, 'mousedown');
|
|
22061
22202
|
globalEvents.off($xeDateRangePicker, 'blur');
|
|
22062
22203
|
globalEvents.off($xeDateRangePicker, 'resize');
|
|
22063
|
-
|
|
22064
|
-
|
|
22065
|
-
checkValue();
|
|
22204
|
+
XEUtils.assign(reactData, createReactData$d());
|
|
22205
|
+
XEUtils.assign(internalData, createInternalData$c());
|
|
22066
22206
|
});
|
|
22067
22207
|
provide('$xeDateRangePicker', $xeDateRangePicker);
|
|
22068
22208
|
$xeDateRangePicker.renderVN = renderVN;
|
|
@@ -25068,6 +25208,7 @@ var VxeFormComponent = defineVxeComponent({
|
|
|
25068
25208
|
});
|
|
25069
25209
|
onUnmounted(() => {
|
|
25070
25210
|
globalEvents.off($xeForm, 'resize');
|
|
25211
|
+
XEUtils.assign(reactData, createReactData$c());
|
|
25071
25212
|
XEUtils.assign(internalData, createInternalData$b());
|
|
25072
25213
|
});
|
|
25073
25214
|
reactData.collapseAll = !!props.collapseStatus;
|