vxe-table 4.2.2-beta.1 → 4.2.3
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/edit/src/hook.js +4 -2
- package/es/filter/src/hook.js +2 -1
- package/es/footer/src/footer.js +5 -5
- package/es/grid/src/grid.js +1 -1
- package/es/header/src/header.js +6 -6
- package/es/header/style.css +1 -5
- package/es/input/src/input.js +138 -33
- package/es/input/style.css +42 -13
- package/es/keyboard/src/hook.js +5 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +15 -11
- package/es/table/src/table.js +58 -48
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +1 -1
- package/helper/vetur/attributes.json +31 -19
- package/helper/vetur/tags.json +3 -0
- package/lib/edit/src/hook.js +6 -4
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/filter/src/hook.js +2 -1
- package/lib/filter/src/hook.min.js +1 -1
- package/lib/footer/src/footer.js +5 -5
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/header/src/header.js +6 -6
- package/lib/header/src/header.min.js +1 -1
- package/lib/header/style/style.css +1 -5
- package/lib/header/style/style.min.css +1 -1
- package/lib/index.umd.js +351 -125
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +180 -35
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/style/style.css +42 -13
- package/lib/input/style/style.min.css +1 -1
- package/lib/keyboard/src/hook.js +7 -1
- package/lib/keyboard/src/hook.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +15 -11
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +65 -56
- package/lib/table/src/table.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/edit/src/hook.ts +4 -2
- package/packages/filter/src/hook.ts +3 -2
- package/packages/footer/src/footer.ts +5 -5
- package/packages/grid/src/grid.ts +1 -1
- package/packages/header/src/header.ts +6 -6
- package/packages/input/src/input.ts +142 -34
- package/packages/keyboard/src/hook.ts +6 -2
- package/packages/table/src/body.ts +15 -11
- package/packages/table/src/table.ts +57 -46
- package/packages/tools/dom.ts +1 -1
- package/styles/header.scss +1 -1
- package/styles/input.scss +16 -4
- package/types/input.d.ts +11 -0
- package/types/table.d.ts +3 -1
|
@@ -772,7 +772,7 @@ export default defineComponent({
|
|
|
772
772
|
if (rest) {
|
|
773
773
|
if (isEnableConf(pagerConfig)) {
|
|
774
774
|
const total = XEUtils.get(rest, proxyProps.total || 'page.total') || 0
|
|
775
|
-
tablePage.total = total
|
|
775
|
+
tablePage.total = XEUtils.toNumber(total)
|
|
776
776
|
reactData.tableData = XEUtils.get(rest, proxyProps.result || 'result') || []
|
|
777
777
|
// 检验当前页码,不能超出当前最大页数
|
|
778
778
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1)
|
|
@@ -136,12 +136,12 @@ export default defineComponent({
|
|
|
136
136
|
const { internalData } = $xetable
|
|
137
137
|
const { elemStore } = internalData
|
|
138
138
|
const prefix = `${fixedType || 'main'}-header-`
|
|
139
|
-
elemStore[`${prefix}wrapper`] = refElem
|
|
140
|
-
elemStore[`${prefix}table`] = refHeaderTable
|
|
141
|
-
elemStore[`${prefix}colgroup`] = refHeaderColgroup
|
|
142
|
-
elemStore[`${prefix}list`] = refHeaderTHead
|
|
143
|
-
elemStore[`${prefix}xSpace`] = refHeaderXSpace
|
|
144
|
-
elemStore[`${prefix}repair`] = refHeaderBorderRepair
|
|
139
|
+
elemStore[`${prefix}wrapper`] = refElem
|
|
140
|
+
elemStore[`${prefix}table`] = refHeaderTable
|
|
141
|
+
elemStore[`${prefix}colgroup`] = refHeaderColgroup
|
|
142
|
+
elemStore[`${prefix}list`] = refHeaderTHead
|
|
143
|
+
elemStore[`${prefix}xSpace`] = refHeaderXSpace
|
|
144
|
+
elemStore[`${prefix}repair`] = refHeaderBorderRepair
|
|
145
145
|
uploadColumn()
|
|
146
146
|
})
|
|
147
147
|
})
|
|
@@ -12,8 +12,10 @@ import { VNodeStyle, VxeInputConstructor, VxeInputEmits, InputReactData, InputMe
|
|
|
12
12
|
|
|
13
13
|
interface DateYearItem {
|
|
14
14
|
date: Date;
|
|
15
|
+
isPrev: boolean;
|
|
15
16
|
isCurrent: boolean;
|
|
16
17
|
isNow: boolean;
|
|
18
|
+
isNext: boolean;
|
|
17
19
|
year: number;
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -50,7 +52,7 @@ interface DateHourMinuteSecondItem {
|
|
|
50
52
|
label: string;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
const yearSize =
|
|
55
|
+
const yearSize = 12
|
|
54
56
|
const monthSize = 20
|
|
55
57
|
const quarterSize = 8
|
|
56
58
|
|
|
@@ -71,6 +73,7 @@ export default defineComponent({
|
|
|
71
73
|
form: String as PropType<VxeInputPropTypes.Form>,
|
|
72
74
|
className: String as PropType<VxeInputPropTypes.ClassName>,
|
|
73
75
|
size: { type: String as PropType<VxeInputPropTypes.Size>, default: () => GlobalConfig.input.size || GlobalConfig.size },
|
|
76
|
+
multiple: Boolean as PropType<VxeInputPropTypes.Multiple>,
|
|
74
77
|
|
|
75
78
|
// number、integer、float
|
|
76
79
|
min: { type: [String, Number] as PropType<VxeInputPropTypes.Min>, default: null },
|
|
@@ -232,6 +235,38 @@ export default defineComponent({
|
|
|
232
235
|
return props.maxDate ? XEUtils.toStringDate(props.maxDate) : null
|
|
233
236
|
})
|
|
234
237
|
|
|
238
|
+
const computeSupportMultiples = computed(() => {
|
|
239
|
+
return ['date', 'week', 'month', 'quarter', 'year'].includes(props.type)
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
const computeDateListValue = computed(() => {
|
|
243
|
+
const { modelValue, multiple } = props
|
|
244
|
+
const isDatePickerType = computeIsDatePickerType.value
|
|
245
|
+
const dateValueFormat = computeDateValueFormat.value
|
|
246
|
+
if (multiple && modelValue && isDatePickerType) {
|
|
247
|
+
return XEUtils.toValueString(modelValue).split(',').map(item => {
|
|
248
|
+
const date = parseDate(item, dateValueFormat)
|
|
249
|
+
if (XEUtils.isValidDate(date)) {
|
|
250
|
+
return date
|
|
251
|
+
}
|
|
252
|
+
return null
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
return []
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
const computeDateMultipleValue = computed(() => {
|
|
259
|
+
const dateListValue = computeDateListValue.value
|
|
260
|
+
const dateValueFormat = computeDateValueFormat.value
|
|
261
|
+
return dateListValue.map(date => XEUtils.toDateString(date, dateValueFormat))
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
const computeDateMultipleLabel = computed(() => {
|
|
265
|
+
const dateListValue = computeDateListValue.value
|
|
266
|
+
const dateLabelFormat = computeDateLabelFormat.value
|
|
267
|
+
return dateListValue.map(date => XEUtils.toDateString(date, dateLabelFormat)).join(', ')
|
|
268
|
+
})
|
|
269
|
+
|
|
235
270
|
const computeDateValueFormat = computed(() => {
|
|
236
271
|
const { type } = props
|
|
237
272
|
return type === 'time' ? 'HH:mm:ss' : (props.valueFormat || (type === 'datetime' ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd'))
|
|
@@ -296,14 +331,17 @@ export default defineComponent({
|
|
|
296
331
|
const years: DateYearItem[] = []
|
|
297
332
|
if (selectMonth && currentDate) {
|
|
298
333
|
const currFullYear = currentDate.getFullYear()
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
334
|
+
const selectFullYear = selectMonth.getFullYear()
|
|
335
|
+
const startYearDate = new Date(selectFullYear - selectFullYear % yearSize, 0, 1)
|
|
336
|
+
for (let index = -4; index < yearSize + 4; index++) {
|
|
337
|
+
const date = XEUtils.getWhatYear(startYearDate, index, 'first')
|
|
302
338
|
const itemFullYear = date.getFullYear()
|
|
303
339
|
years.push({
|
|
304
340
|
date,
|
|
305
341
|
isCurrent: true,
|
|
342
|
+
isPrev: index < 0,
|
|
306
343
|
isNow: currFullYear === itemFullYear,
|
|
344
|
+
isNext: index >= yearSize,
|
|
307
345
|
year: itemFullYear
|
|
308
346
|
})
|
|
309
347
|
}
|
|
@@ -536,8 +574,8 @@ export default defineComponent({
|
|
|
536
574
|
})
|
|
537
575
|
|
|
538
576
|
const computeInpReadonly = computed(() => {
|
|
539
|
-
const { type, readonly, editable } = props
|
|
540
|
-
return readonly || !editable || type === 'week' || type === 'quarter'
|
|
577
|
+
const { type, readonly, editable, multiple } = props
|
|
578
|
+
return readonly || multiple || !editable || type === 'week' || type === 'quarter'
|
|
541
579
|
})
|
|
542
580
|
|
|
543
581
|
const computeInputType = computed(() => {
|
|
@@ -638,11 +676,14 @@ export default defineComponent({
|
|
|
638
676
|
|
|
639
677
|
let hidePanelTimeout: number
|
|
640
678
|
|
|
641
|
-
const hidePanel = () => {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
679
|
+
const hidePanel = (): Promise<void> => {
|
|
680
|
+
return new Promise(resolve => {
|
|
681
|
+
reactData.visiblePanel = false
|
|
682
|
+
hidePanelTimeout = window.setTimeout(() => {
|
|
683
|
+
reactData.animatVisible = false
|
|
684
|
+
resolve()
|
|
685
|
+
}, 350)
|
|
686
|
+
})
|
|
646
687
|
}
|
|
647
688
|
|
|
648
689
|
const clearValueEvent = (evnt: Event, value: VxeInputPropTypes.ModelValue) => {
|
|
@@ -711,7 +752,7 @@ export default defineComponent({
|
|
|
711
752
|
const { inputValue } = reactData
|
|
712
753
|
if (isDatePickerType) {
|
|
713
754
|
dateParseValue(inputValue)
|
|
714
|
-
reactData.inputValue = reactData.datePanelLabel
|
|
755
|
+
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel
|
|
715
756
|
}
|
|
716
757
|
}
|
|
717
758
|
|
|
@@ -744,7 +785,7 @@ export default defineComponent({
|
|
|
744
785
|
}
|
|
745
786
|
|
|
746
787
|
const dateRevert = () => {
|
|
747
|
-
reactData.inputValue = reactData.datePanelLabel
|
|
788
|
+
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel
|
|
748
789
|
}
|
|
749
790
|
|
|
750
791
|
const dateCheckMonth = (date: Date) => {
|
|
@@ -755,7 +796,7 @@ export default defineComponent({
|
|
|
755
796
|
}
|
|
756
797
|
|
|
757
798
|
const dateChange = (date: Date) => {
|
|
758
|
-
const { modelValue } = props
|
|
799
|
+
const { modelValue, multiple } = props
|
|
759
800
|
const { datetimePanelValue } = reactData
|
|
760
801
|
const isDateTimeType = computeIsDateTimeType.value
|
|
761
802
|
const dateValueFormat = computeDateValueFormat.value
|
|
@@ -770,8 +811,36 @@ export default defineComponent({
|
|
|
770
811
|
}
|
|
771
812
|
const inpVal = XEUtils.toDateString(date, dateValueFormat, { firstDay: firstDayOfWeek })
|
|
772
813
|
dateCheckMonth(date)
|
|
773
|
-
if (
|
|
774
|
-
|
|
814
|
+
if (multiple) {
|
|
815
|
+
// 如果为多选
|
|
816
|
+
const dateMultipleValue = computeDateMultipleValue.value
|
|
817
|
+
if (isDateTimeType) {
|
|
818
|
+
// 如果是datetime特殊类型
|
|
819
|
+
const dateListValue = computeDateListValue.value
|
|
820
|
+
const datetimeRest = []
|
|
821
|
+
dateListValue.forEach(item => {
|
|
822
|
+
if (item && !XEUtils.isDateSame(date, item, 'yyyyMMdd')) {
|
|
823
|
+
item.setHours(datetimePanelValue.getHours())
|
|
824
|
+
item.setMinutes(datetimePanelValue.getMinutes())
|
|
825
|
+
item.setSeconds(datetimePanelValue.getSeconds())
|
|
826
|
+
datetimeRest.push(item)
|
|
827
|
+
}
|
|
828
|
+
})
|
|
829
|
+
datetimeRest.push(date)
|
|
830
|
+
emitModel(datetimeRest.map(date => XEUtils.toDateString(date, dateValueFormat)).join(','), { type: 'update' })
|
|
831
|
+
} else {
|
|
832
|
+
// 如果是日期类型
|
|
833
|
+
if (dateMultipleValue.some(val => XEUtils.isEqual(val, inpVal))) {
|
|
834
|
+
emitModel(dateMultipleValue.filter(val => !XEUtils.isEqual(val, inpVal)).join(','), { type: 'update' })
|
|
835
|
+
} else {
|
|
836
|
+
emitModel(dateMultipleValue.concat([inpVal]).join(','), { type: 'update' })
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
} else {
|
|
840
|
+
// 如果为单选
|
|
841
|
+
if (!XEUtils.isEqual(modelValue, inpVal)) {
|
|
842
|
+
emitModel(inpVal, { type: 'update' })
|
|
843
|
+
}
|
|
775
844
|
}
|
|
776
845
|
}
|
|
777
846
|
|
|
@@ -1048,8 +1117,10 @@ export default defineComponent({
|
|
|
1048
1117
|
|
|
1049
1118
|
const dateTodayMonthEvent = (evnt: Event) => {
|
|
1050
1119
|
dateNowHandle()
|
|
1051
|
-
|
|
1052
|
-
|
|
1120
|
+
if (!props.multiple) {
|
|
1121
|
+
dateChange(reactData.currentDate)
|
|
1122
|
+
hidePanel()
|
|
1123
|
+
}
|
|
1053
1124
|
inputMethods.dispatchEvent('date-today', { type: props.type }, evnt)
|
|
1054
1125
|
}
|
|
1055
1126
|
|
|
@@ -1086,7 +1157,7 @@ export default defineComponent({
|
|
|
1086
1157
|
}
|
|
1087
1158
|
|
|
1088
1159
|
const dateSelectItem = (date: Date) => {
|
|
1089
|
-
const { type } = props
|
|
1160
|
+
const { type, multiple } = props
|
|
1090
1161
|
const { datePanelType } = reactData
|
|
1091
1162
|
if (type === 'month') {
|
|
1092
1163
|
if (datePanelType === 'year') {
|
|
@@ -1094,18 +1165,24 @@ export default defineComponent({
|
|
|
1094
1165
|
dateCheckMonth(date)
|
|
1095
1166
|
} else {
|
|
1096
1167
|
dateChange(date)
|
|
1097
|
-
|
|
1168
|
+
if (!multiple) {
|
|
1169
|
+
hidePanel()
|
|
1170
|
+
}
|
|
1098
1171
|
}
|
|
1099
1172
|
} else if (type === 'year') {
|
|
1100
1173
|
dateChange(date)
|
|
1101
|
-
|
|
1174
|
+
if (!multiple) {
|
|
1175
|
+
hidePanel()
|
|
1176
|
+
}
|
|
1102
1177
|
} else if (type === 'quarter') {
|
|
1103
1178
|
if (datePanelType === 'year') {
|
|
1104
1179
|
reactData.datePanelType = 'quarter'
|
|
1105
1180
|
dateCheckMonth(date)
|
|
1106
1181
|
} else {
|
|
1107
1182
|
dateChange(date)
|
|
1108
|
-
|
|
1183
|
+
if (!multiple) {
|
|
1184
|
+
hidePanel()
|
|
1185
|
+
}
|
|
1109
1186
|
}
|
|
1110
1187
|
} else {
|
|
1111
1188
|
if (datePanelType === 'month') {
|
|
@@ -1116,7 +1193,9 @@ export default defineComponent({
|
|
|
1116
1193
|
dateCheckMonth(date)
|
|
1117
1194
|
} else {
|
|
1118
1195
|
dateChange(date)
|
|
1119
|
-
|
|
1196
|
+
if (!multiple) {
|
|
1197
|
+
hidePanel()
|
|
1198
|
+
}
|
|
1120
1199
|
}
|
|
1121
1200
|
}
|
|
1122
1201
|
}
|
|
@@ -1201,8 +1280,11 @@ export default defineComponent({
|
|
|
1201
1280
|
}
|
|
1202
1281
|
|
|
1203
1282
|
const dateConfirmEvent = () => {
|
|
1283
|
+
const { type } = props
|
|
1204
1284
|
const dateValue = computeDateValue.value
|
|
1205
|
-
|
|
1285
|
+
if (type === 'datetime') {
|
|
1286
|
+
dateChange(dateValue || reactData.currentDate)
|
|
1287
|
+
}
|
|
1206
1288
|
hidePanel()
|
|
1207
1289
|
}
|
|
1208
1290
|
|
|
@@ -1412,8 +1494,9 @@ export default defineComponent({
|
|
|
1412
1494
|
reactData.visiblePanel = true
|
|
1413
1495
|
}, 10)
|
|
1414
1496
|
updateZindex()
|
|
1415
|
-
updatePlacement()
|
|
1497
|
+
return updatePlacement()
|
|
1416
1498
|
}
|
|
1499
|
+
return nextTick()
|
|
1417
1500
|
}
|
|
1418
1501
|
|
|
1419
1502
|
const datePickerOpenEvent = (evnt: Event) => {
|
|
@@ -1590,10 +1673,12 @@ export default defineComponent({
|
|
|
1590
1673
|
}
|
|
1591
1674
|
|
|
1592
1675
|
const renderDateDayTable = () => {
|
|
1676
|
+
const { multiple } = props
|
|
1593
1677
|
const { datePanelType, datePanelValue } = reactData
|
|
1594
1678
|
const dateValue = computeDateValue.value
|
|
1595
1679
|
const dateHeaders = computeDateHeaders.value
|
|
1596
1680
|
const dayDatas = computeDayDatas.value
|
|
1681
|
+
const dateListValue = computeDateListValue.value
|
|
1597
1682
|
const matchFormat = 'yyyyMMdd'
|
|
1598
1683
|
return [
|
|
1599
1684
|
h('table', {
|
|
@@ -1616,7 +1701,7 @@ export default defineComponent({
|
|
|
1616
1701
|
'is--now': item.isNow,
|
|
1617
1702
|
'is--next': item.isNext,
|
|
1618
1703
|
'is--disabled': isDateDisabled(item),
|
|
1619
|
-
'is--selected': XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1704
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1620
1705
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1621
1706
|
},
|
|
1622
1707
|
onClick: () => dateSelectEvent(item),
|
|
@@ -1629,10 +1714,12 @@ export default defineComponent({
|
|
|
1629
1714
|
}
|
|
1630
1715
|
|
|
1631
1716
|
const renderDateWeekTable = () => {
|
|
1717
|
+
const { multiple } = props
|
|
1632
1718
|
const { datePanelType, datePanelValue } = reactData
|
|
1633
1719
|
const dateValue = computeDateValue.value
|
|
1634
1720
|
const weekHeaders = computeWeekHeaders.value
|
|
1635
1721
|
const weekDates = computeWeekDates.value
|
|
1722
|
+
const dateListValue = computeDateListValue.value
|
|
1636
1723
|
const matchFormat = 'yyyyMMdd'
|
|
1637
1724
|
return [
|
|
1638
1725
|
h('table', {
|
|
@@ -1647,7 +1734,7 @@ export default defineComponent({
|
|
|
1647
1734
|
}))
|
|
1648
1735
|
]),
|
|
1649
1736
|
h('tbody', weekDates.map((rows) => {
|
|
1650
|
-
const isSelected = rows.some((item) => XEUtils.isDateSame(dateValue, item.date, matchFormat))
|
|
1737
|
+
const isSelected = multiple ? rows.some((item) => dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat))) : rows.some((item) => XEUtils.isDateSame(dateValue, item.date, matchFormat))
|
|
1651
1738
|
const isHover = rows.some((item) => XEUtils.isDateSame(datePanelValue, item.date, matchFormat))
|
|
1652
1739
|
return h('tr', rows.map((item) => {
|
|
1653
1740
|
return h('td', {
|
|
@@ -1671,9 +1758,11 @@ export default defineComponent({
|
|
|
1671
1758
|
}
|
|
1672
1759
|
|
|
1673
1760
|
const renderDateMonthTable = () => {
|
|
1761
|
+
const { multiple } = props
|
|
1674
1762
|
const { datePanelType, datePanelValue } = reactData
|
|
1675
1763
|
const dateValue = computeDateValue.value
|
|
1676
1764
|
const monthDatas = computeMonthDatas.value
|
|
1765
|
+
const dateListValue = computeDateListValue.value
|
|
1677
1766
|
const matchFormat = 'yyyyMM'
|
|
1678
1767
|
return [
|
|
1679
1768
|
h('table', {
|
|
@@ -1691,7 +1780,7 @@ export default defineComponent({
|
|
|
1691
1780
|
'is--now': item.isNow,
|
|
1692
1781
|
'is--next': item.isNext,
|
|
1693
1782
|
'is--disabled': isDateDisabled(item),
|
|
1694
|
-
'is--selected': XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1783
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1695
1784
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1696
1785
|
},
|
|
1697
1786
|
onClick: () => dateSelectEvent(item),
|
|
@@ -1704,9 +1793,11 @@ export default defineComponent({
|
|
|
1704
1793
|
}
|
|
1705
1794
|
|
|
1706
1795
|
const renderDateQuarterTable = () => {
|
|
1796
|
+
const { multiple } = props
|
|
1707
1797
|
const { datePanelType, datePanelValue } = reactData
|
|
1708
1798
|
const dateValue = computeDateValue.value
|
|
1709
1799
|
const quarterDatas = computeQuarterDatas.value
|
|
1800
|
+
const dateListValue = computeDateListValue.value
|
|
1710
1801
|
const matchFormat = 'yyyyq'
|
|
1711
1802
|
return [
|
|
1712
1803
|
h('table', {
|
|
@@ -1724,7 +1815,7 @@ export default defineComponent({
|
|
|
1724
1815
|
'is--now': item.isNow,
|
|
1725
1816
|
'is--next': item.isNext,
|
|
1726
1817
|
'is--disabled': isDateDisabled(item),
|
|
1727
|
-
'is--selected': XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1818
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1728
1819
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1729
1820
|
},
|
|
1730
1821
|
onClick: () => dateSelectEvent(item),
|
|
@@ -1737,9 +1828,11 @@ export default defineComponent({
|
|
|
1737
1828
|
}
|
|
1738
1829
|
|
|
1739
1830
|
const renderDateYearTable = () => {
|
|
1831
|
+
const { multiple } = props
|
|
1740
1832
|
const { datePanelType, datePanelValue } = reactData
|
|
1741
1833
|
const dateValue = computeDateValue.value
|
|
1742
1834
|
const yearDatas = computeYearDatas.value
|
|
1835
|
+
const dateListValue = computeDateListValue.value
|
|
1743
1836
|
const matchFormat = 'yyyy'
|
|
1744
1837
|
return [
|
|
1745
1838
|
h('table', {
|
|
@@ -1752,10 +1845,12 @@ export default defineComponent({
|
|
|
1752
1845
|
return h('tr', rows.map((item) => {
|
|
1753
1846
|
return h('td', {
|
|
1754
1847
|
class: {
|
|
1755
|
-
'is--
|
|
1848
|
+
'is--prev': item.isPrev,
|
|
1756
1849
|
'is--current': item.isCurrent,
|
|
1757
1850
|
'is--now': item.isNow,
|
|
1758
|
-
'is--
|
|
1851
|
+
'is--next': item.isNext,
|
|
1852
|
+
'is--disabled': isDateDisabled(item),
|
|
1853
|
+
'is--selected': multiple ? dateListValue.some(val => XEUtils.isDateSame(val, item.date, matchFormat)) : XEUtils.isDateSame(dateValue, item.date, matchFormat),
|
|
1759
1854
|
'is--hover': XEUtils.isDateSame(datePanelValue, item.date, matchFormat)
|
|
1760
1855
|
},
|
|
1761
1856
|
onClick: () => dateSelectEvent(item),
|
|
@@ -1783,6 +1878,7 @@ export default defineComponent({
|
|
|
1783
1878
|
}
|
|
1784
1879
|
|
|
1785
1880
|
const renderDatePanel = () => {
|
|
1881
|
+
const { multiple } = props
|
|
1786
1882
|
const { datePanelType } = reactData
|
|
1787
1883
|
const isDisabledPrevDateBtn = computeIsDisabledPrevDateBtn.value
|
|
1788
1884
|
const isDisabledNextDateBtn = computeIsDisabledNextDateBtn.value
|
|
@@ -1831,7 +1927,16 @@ export default defineComponent({
|
|
|
1831
1927
|
h('i', {
|
|
1832
1928
|
class: 'vxe-icon--caret-right'
|
|
1833
1929
|
})
|
|
1834
|
-
])
|
|
1930
|
+
]),
|
|
1931
|
+
multiple && computeSupportMultiples.value ? h('span', {
|
|
1932
|
+
class: 'vxe-input--date-picker-btn vxe-input--date-picker-confirm-btn'
|
|
1933
|
+
}, [
|
|
1934
|
+
h('button', {
|
|
1935
|
+
class: 'vxe-input--date-picker-confirm',
|
|
1936
|
+
type: 'button',
|
|
1937
|
+
onClick: dateConfirmEvent
|
|
1938
|
+
}, GlobalConfig.i18n('vxe.button.confirm'))
|
|
1939
|
+
]) : null
|
|
1835
1940
|
])
|
|
1836
1941
|
]),
|
|
1837
1942
|
h('div', {
|
|
@@ -2110,7 +2215,10 @@ export default defineComponent({
|
|
|
2110
2215
|
inputElem.blur()
|
|
2111
2216
|
reactData.isActivated = false
|
|
2112
2217
|
return nextTick()
|
|
2113
|
-
}
|
|
2218
|
+
},
|
|
2219
|
+
showPanel,
|
|
2220
|
+
hidePanel,
|
|
2221
|
+
updatePlacement
|
|
2114
2222
|
}
|
|
2115
2223
|
|
|
2116
2224
|
Object.assign($xeinput, inputMethods)
|
|
@@ -2138,7 +2246,7 @@ export default defineComponent({
|
|
|
2138
2246
|
const isDatePickerType = computeIsDatePickerType.value
|
|
2139
2247
|
if (isDatePickerType) {
|
|
2140
2248
|
dateParseValue(reactData.datePanelValue)
|
|
2141
|
-
reactData.inputValue = reactData.datePanelLabel
|
|
2249
|
+
reactData.inputValue = props.multiple ? computeDateMultipleLabel.value : reactData.datePanelLabel
|
|
2142
2250
|
}
|
|
2143
2251
|
})
|
|
2144
2252
|
|
|
@@ -66,8 +66,12 @@ const tableKeyboardHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
66
66
|
const { elemStore } = internalData
|
|
67
67
|
const disX = evnt.clientX
|
|
68
68
|
const disY = evnt.clientY
|
|
69
|
-
const
|
|
70
|
-
const
|
|
69
|
+
const bodyWrapperRef = elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper']
|
|
70
|
+
const bodyWrapperElem = bodyWrapperRef ? bodyWrapperRef.value : null
|
|
71
|
+
if (!bodyWrapperElem) {
|
|
72
|
+
return
|
|
73
|
+
}
|
|
74
|
+
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range') as HTMLElement
|
|
71
75
|
const domMousemove = document.onmousemove
|
|
72
76
|
const domMouseup = document.onmouseup
|
|
73
77
|
const trElem = cell.parentNode
|
|
@@ -480,8 +480,10 @@ export default defineComponent({
|
|
|
480
480
|
const bodyElem = tableBody.$el as XEBodyScrollElement
|
|
481
481
|
const leftElem = leftBody ? leftBody.$el as XEBodyScrollElement : null
|
|
482
482
|
const rightElem = rightBody ? rightBody.$el as XEBodyScrollElement : null
|
|
483
|
-
const
|
|
484
|
-
const
|
|
483
|
+
const bodyYRef = elemStore['main-body-ySpace']
|
|
484
|
+
const bodyYElem = bodyYRef ? bodyYRef.value : null
|
|
485
|
+
const bodyXRef = elemStore['main-body-xSpace']
|
|
486
|
+
const bodyXElem = bodyXRef ? bodyXRef.value : null
|
|
485
487
|
const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight
|
|
486
488
|
const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth
|
|
487
489
|
let scrollTop = scrollBodyElem.scrollTop
|
|
@@ -554,8 +556,10 @@ export default defineComponent({
|
|
|
554
556
|
const leftElem = leftBody ? leftBody.$el as HTMLDivElement : null
|
|
555
557
|
const rightElem = rightBody ? rightBody.$el as HTMLDivElement : null
|
|
556
558
|
const bodyElem = tableBody.$el as HTMLDivElement
|
|
557
|
-
const
|
|
558
|
-
const
|
|
559
|
+
const bodyYRef = elemStore['main-body-ySpace']
|
|
560
|
+
const bodyYElem = bodyYRef ? bodyYRef.value : null
|
|
561
|
+
const bodyXRef = elemStore['main-body-xSpace']
|
|
562
|
+
const bodyXElem = bodyXRef ? bodyXRef.value : null
|
|
559
563
|
const bodyHeight = scrollYLoad && bodyYElem ? bodyYElem.clientHeight : bodyElem.clientHeight
|
|
560
564
|
const bodyWidth = scrollXLoad && bodyXElem ? bodyXElem.clientWidth : bodyElem.clientWidth
|
|
561
565
|
const remainSize = isPrevWheelTop === isTopWheel ? Math.max(0, wheelYSize - wheelYTotal) : 0
|
|
@@ -649,13 +653,13 @@ export default defineComponent({
|
|
|
649
653
|
const { elemStore } = tableInternalData
|
|
650
654
|
const prefix = `${fixedType || 'main'}-body-`
|
|
651
655
|
const el = refElem.value
|
|
652
|
-
elemStore[`${prefix}wrapper`] = refElem
|
|
653
|
-
elemStore[`${prefix}table`] = refBodyTable
|
|
654
|
-
elemStore[`${prefix}colgroup`] = refBodyColgroup
|
|
655
|
-
elemStore[`${prefix}list`] = refBodyTBody
|
|
656
|
-
elemStore[`${prefix}xSpace`] = refBodyXSpace
|
|
657
|
-
elemStore[`${prefix}ySpace`] = refBodyYSpace
|
|
658
|
-
elemStore[`${prefix}emptyBlock`] = refBodyEmptyBlock
|
|
656
|
+
elemStore[`${prefix}wrapper`] = refElem
|
|
657
|
+
elemStore[`${prefix}table`] = refBodyTable
|
|
658
|
+
elemStore[`${prefix}colgroup`] = refBodyColgroup
|
|
659
|
+
elemStore[`${prefix}list`] = refBodyTBody
|
|
660
|
+
elemStore[`${prefix}xSpace`] = refBodyXSpace
|
|
661
|
+
elemStore[`${prefix}ySpace`] = refBodyYSpace
|
|
662
|
+
elemStore[`${prefix}emptyBlock`] = refBodyEmptyBlock
|
|
659
663
|
el.onscroll = scrollEvent
|
|
660
664
|
el._onscroll = scrollEvent
|
|
661
665
|
})
|