vxe-pc-ui 3.4.5 → 3.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/es/calendar/src/calendar.js +51 -21
  2. package/es/date-picker/src/date-picker.js +41 -18
  3. package/es/date-picker/style.css +36 -21
  4. package/es/date-picker/style.min.css +1 -1
  5. package/es/icon/style.css +1 -1
  6. package/es/style.css +1 -1
  7. package/es/style.min.css +1 -1
  8. package/es/ui/index.js +1 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/es/vxe-date-picker/style.css +36 -21
  11. package/es/vxe-date-picker/style.min.css +1 -1
  12. package/lib/calendar/src/calendar.js +37 -14
  13. package/lib/calendar/src/calendar.min.js +1 -1
  14. package/lib/date-picker/src/date-picker.js +32 -14
  15. package/lib/date-picker/src/date-picker.min.js +1 -1
  16. package/lib/date-picker/style/style.css +36 -21
  17. package/lib/date-picker/style/style.min.css +1 -1
  18. package/lib/icon/style/style.css +1 -1
  19. package/lib/icon/style/style.min.css +1 -1
  20. package/lib/index.umd.js +71 -30
  21. package/lib/index.umd.min.js +1 -1
  22. package/lib/style.css +1 -1
  23. package/lib/style.min.css +1 -1
  24. package/lib/ui/index.js +1 -1
  25. package/lib/ui/index.min.js +1 -1
  26. package/lib/ui/src/log.js +1 -1
  27. package/lib/ui/src/log.min.js +1 -1
  28. package/lib/vxe-date-picker/style/style.css +36 -21
  29. package/lib/vxe-date-picker/style/style.min.css +1 -1
  30. package/package.json +1 -1
  31. package/packages/calendar/src/calendar.ts +51 -20
  32. package/packages/date-picker/src/date-picker.ts +42 -18
  33. package/styles/components/date-picker.scss +25 -9
  34. package/styles/theme/base.scss +1 -1
  35. package/types/components/grid.d.ts +4 -0
  36. package/types/components/table.d.ts +50 -2
  37. /package/es/icon/{iconfont.1741263656288.ttf → iconfont.1741345280056.ttf} +0 -0
  38. /package/es/icon/{iconfont.1741263656288.woff → iconfont.1741345280056.woff} +0 -0
  39. /package/es/icon/{iconfont.1741263656288.woff2 → iconfont.1741345280056.woff2} +0 -0
  40. /package/es/{iconfont.1741263656288.ttf → iconfont.1741345280056.ttf} +0 -0
  41. /package/es/{iconfont.1741263656288.woff → iconfont.1741345280056.woff} +0 -0
  42. /package/es/{iconfont.1741263656288.woff2 → iconfont.1741345280056.woff2} +0 -0
  43. /package/lib/icon/style/{iconfont.1741263656288.ttf → iconfont.1741345280056.ttf} +0 -0
  44. /package/lib/icon/style/{iconfont.1741263656288.woff → iconfont.1741345280056.woff} +0 -0
  45. /package/lib/icon/style/{iconfont.1741263656288.woff2 → iconfont.1741345280056.woff2} +0 -0
  46. /package/lib/{iconfont.1741263656288.ttf → iconfont.1741345280056.ttf} +0 -0
  47. /package/lib/{iconfont.1741263656288.woff → iconfont.1741345280056.woff} +0 -0
  48. /package/lib/{iconfont.1741263656288.woff2 → iconfont.1741345280056.woff2} +0 -0
@@ -418,30 +418,35 @@ export default /* define-vxe-component start */ defineVxeComponent({
418
418
  }
419
419
  return years
420
420
  },
421
- computeSelectDatePanelLabel () {
421
+ computeSelectDatePanelObj () {
422
422
  const $xeDatePicker = (this as any)
423
423
  const reactData = $xeDatePicker.reactData
424
424
 
425
425
  const isDatePickerType = $xeDatePicker.computeIsDatePickerType
426
+ let y = ''
427
+ let m = ''
426
428
  if (isDatePickerType) {
427
429
  const { datePanelType, selectMonth } = reactData
428
- const yearList = $xeDatePicker.computeYearList as VxeDatePickerDefines.DateYearItem[]
430
+ const yearList = $xeDatePicker.computeYearList
429
431
  let year = ''
430
432
  let month
431
433
  if (selectMonth) {
432
434
  year = selectMonth.getFullYear()
433
435
  month = selectMonth.getMonth() + 1
434
436
  }
435
- if (datePanelType === 'quarter') {
436
- return getI18n('vxe.input.date.quarterLabel', [year])
437
- } else if (datePanelType === 'month') {
438
- return getI18n('vxe.input.date.monthLabel', [year])
437
+ if (datePanelType === 'quarter' || datePanelType === 'month') {
438
+ y = `${year}`
439
439
  } else if (datePanelType === 'year') {
440
- return yearList.length ? `${yearList[0].year} - ${yearList[yearList.length - 1].year}` : ''
440
+ y = yearList.length ? `${yearList[0].year} - ${yearList[yearList.length - 1].year}` : ''
441
+ } else {
442
+ y = `${year}`
443
+ m = month ? getI18n(`vxe.input.date.m${month}`) : '-'
441
444
  }
442
- return getI18n('vxe.input.date.dayLabel', [year, month ? getI18n(`vxe.input.date.m${month}`) : '-'])
443
445
  }
444
- return ''
446
+ return {
447
+ y,
448
+ m
449
+ }
445
450
  },
446
451
  computeFirstDayOfWeek () {
447
452
  const $xeDatePicker = this
@@ -1173,7 +1178,13 @@ export default /* define-vxe-component start */ defineVxeComponent({
1173
1178
  reactData.currentDate = currentDate
1174
1179
  $xeDatePicker.dateMonthHandle(currentDate, 0)
1175
1180
  },
1176
- dateToggleTypeEvent () {
1181
+ dateToggleYearTypeEvent () {
1182
+ const $xeDatePicker = this
1183
+ const reactData = $xeDatePicker.reactData
1184
+
1185
+ reactData.datePanelType = 'year'
1186
+ },
1187
+ dateToggleMonthTypeEvent () {
1177
1188
  const $xeDatePicker = this
1178
1189
  const reactData = $xeDatePicker.reactData
1179
1190
 
@@ -2205,7 +2216,8 @@ export default /* define-vxe-component start */ defineVxeComponent({
2205
2216
  const { datePanelType } = reactData
2206
2217
  const isDisabledPrevDateBtn = $xeDatePicker.computeIsDisabledPrevDateBtn
2207
2218
  const isDisabledNextDateBtn = $xeDatePicker.computeIsDisabledNextDateBtn
2208
- const selectDatePanelLabel = $xeDatePicker.computeSelectDatePanelLabel
2219
+ const selectDatePanelObj = $xeDatePicker.computeSelectDatePanelObj
2220
+ const supportMultiples = $xeDatePicker.computeSupportMultiples
2209
2221
  return [
2210
2222
  h('div', {
2211
2223
  class: 'vxe-date-picker--date-picker-header'
@@ -2216,13 +2228,25 @@ export default /* define-vxe-component start */ defineVxeComponent({
2216
2228
  datePanelType === 'year'
2217
2229
  ? h('span', {
2218
2230
  class: 'vxe-date-picker--date-picker-label'
2219
- }, selectDatePanelLabel)
2231
+ }, selectDatePanelObj.y)
2220
2232
  : h('span', {
2221
- class: 'vxe-date-picker--date-picker-btn',
2222
- on: {
2223
- click: $xeDatePicker.dateToggleTypeEvent
2224
- }
2225
- }, selectDatePanelLabel)
2233
+ class: 'vxe-date-picker--date-picker-btns'
2234
+ }, [
2235
+ h('span', {
2236
+ class: 'vxe-date-picker--date-picker-btn',
2237
+ on: {
2238
+ click: $xeDatePicker.dateToggleYearTypeEvent
2239
+ }
2240
+ }, selectDatePanelObj.y),
2241
+ selectDatePanelObj.m
2242
+ ? h('span', {
2243
+ class: 'vxe-date-picker--date-picker-btn',
2244
+ on: {
2245
+ click: $xeDatePicker.dateToggleMonthTypeEvent
2246
+ }
2247
+ }, selectDatePanelObj.m)
2248
+ : renderEmptyElement($xeDatePicker)
2249
+ ])
2226
2250
  ]),
2227
2251
  h('div', {
2228
2252
  class: 'vxe-date-picker--date-picker-btn-wrapper'
@@ -2261,7 +2285,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
2261
2285
  class: 'vxe-icon-caret-right'
2262
2286
  })
2263
2287
  ]),
2264
- multiple && $xeDatePicker.computeSupportMultiples
2288
+ multiple && supportMultiples
2265
2289
  ? h('span', {
2266
2290
  class: 'vxe-date-picker--date-picker-btn vxe-date-picker--date-picker-confirm-btn'
2267
2291
  }, [
@@ -325,7 +325,11 @@
325
325
  margin-right: 0.5em;
326
326
  }
327
327
  .vxe-date-picker--time-picker-btn {
328
+ display: flex;
328
329
  flex-shrink: 0;
330
+ &:active {
331
+ transform: scale(0.9);
332
+ }
329
333
  }
330
334
  .vxe-date-picker--time-picker-confirm,
331
335
  .vxe-date-picker--date-picker-confirm {
@@ -391,6 +395,7 @@
391
395
  &:not(.is--disabled) {
392
396
  cursor: pointer;
393
397
  &:hover {
398
+ color: var(--vxe-ui-font-primary-color);
394
399
  background-color: #fff;
395
400
  }
396
401
  &:active {
@@ -398,6 +403,14 @@
398
403
  }
399
404
  }
400
405
  }
406
+ .vxe-date-picker--date-picker-btns {
407
+ .vxe-date-picker--date-picker-btn {
408
+ margin-left: 0.6em;
409
+ &:first-child {
410
+ margin-left: 0;
411
+ }
412
+ }
413
+ }
401
414
  .vxe-date-picker--date-picker-body {
402
415
  border-radius: var(--vxe-ui-base-border-radius);
403
416
  border: 1px solid var(--vxe-ui-base-popup-border-color);
@@ -523,6 +536,8 @@
523
536
 
524
537
  .vxe-date-picker--date-label {
525
538
  position: relative;
539
+ font-size: 1.1em;
540
+ line-height: 1em;
526
541
  &.is-notice {
527
542
  &:before {
528
543
  content: "";
@@ -541,8 +556,8 @@
541
556
  position: absolute;
542
557
  right: 0.1em;
543
558
  top: -0.2em;
544
- font-size: 0.86em;
545
- transform: scale(0.85);
559
+ font-size: 12px;
560
+ transform: scale(0.9);
546
561
  color: var(--vxe-ui-input-date-extra-color);
547
562
  &.is-important {
548
563
  color: var(--vxe-ui-input-date-extra-important-color);
@@ -551,7 +566,8 @@
551
566
 
552
567
  .vxe-date-picker--date-festival {
553
568
  color: var(--vxe-ui-input-date-festival-color);
554
- height: 14px;
569
+ height: 1.2em;
570
+ line-height: 1.1em;
555
571
  overflow: hidden;
556
572
  &.is-important {
557
573
  color: var(--vxe-ui-input-date-festival-important-color);
@@ -559,8 +575,8 @@
559
575
  }
560
576
  .vxe-date-picker--date-festival--label {
561
577
  display: block;
562
- font-size: 0.86em;
563
- transform: scale(0.9);
578
+ font-size: 1em;
579
+ transform: scale(0.8);
564
580
  }
565
581
 
566
582
  @keyframes festivalOverlap2 {
@@ -760,6 +776,9 @@
760
776
  .vxe-date-picker--date-picker-btn-wrapper {
761
777
  .vxe-date-picker--date-picker-btn {
762
778
  margin-left: 9px - $sizeIndex;
779
+ &:active {
780
+ transform: scale(0.9);
781
+ }
763
782
  }
764
783
  .vxe-date-picker--date-picker-prev-btn,
765
784
  .vxe-date-picker--date-picker-current-btn,
@@ -771,7 +790,7 @@
771
790
  }
772
791
  .vxe-date-picker--date-picker-type-wrapper {
773
792
  .vxe-date-picker--date-picker-label,
774
- .vxe-date-picker--date-picker-btn {
793
+ .vxe-date-picker--date-picker-btns {
775
794
  padding: 0 10px - $sizeIndex;
776
795
  }
777
796
  }
@@ -831,9 +850,6 @@
831
850
  .vxe-date-picker--date-picker-confirm {
832
851
  height: 31px - $sizeIndex;
833
852
  }
834
- .vxe-date-picker--date-label {
835
- line-height: calc(list.nth($fontSizeList, $sizeIndex) + 1px);
836
- }
837
853
  }
838
854
 
839
855
  .vxe-date-picker--panel {
@@ -43,7 +43,7 @@
43
43
  /*input*/
44
44
  --vxe-ui-input-disabled-color: #dcdfe6;
45
45
  --vxe-ui-input-number-disabled-color: #e4e7ed;
46
- --vxe-ui-input-date-festival-color: #999999;
46
+ --vxe-ui-input-date-festival-color: #abaaaa;
47
47
  --vxe-ui-input-date-festival-important-color: var(--vxe-ui-font-primary-color);
48
48
  --vxe-ui-input-date-notice-background-color: #FF0000;
49
49
  --vxe-ui-input-date-picker-hover-background-color: #f2f6fc;
@@ -267,6 +267,10 @@ export interface GridReactData<D = any> {
267
267
 
268
268
  export interface GridMethods<D = any> {
269
269
  dispatchEvent(type: ValueOf<VxeGridEmits>, params: Record<string, any>, evnt: Event | null): void
270
+ /**
271
+ * 获取根元素
272
+ */
273
+ getEl(): HTMLDivElement
270
274
  /**
271
275
  * 给数据代理提交指令
272
276
  * @param code 指令编码
@@ -3335,6 +3335,10 @@ export interface TableInternalData<D = any> {
3335
3335
 
3336
3336
  export interface TableMethods<DT = any> {
3337
3337
  dispatchEvent(type: ValueOf<VxeTableEmits>, params: Record<string, any>, evnt: Event | null): void
3338
+ /**
3339
+ * 获取根元素
3340
+ */
3341
+ getEl(): HTMLDivElement
3338
3342
  /**
3339
3343
  * 手动清除表格所有条件,还原到初始状态
3340
3344
  * 对于增删改查的场景中可能会用到,比如在数据保存之后清除表格缓存
@@ -3546,6 +3550,50 @@ export interface TableMethods<DT = any> {
3546
3550
  visibleColumn: VxeTableDefines.ColumnInfo<DT>[]
3547
3551
  tableColumn: VxeTableDefines.ColumnInfo<DT>[]
3548
3552
  }
3553
+ /**
3554
+ * 移动列到指定列的位置
3555
+ * @param fieldOrColumn
3556
+ * @param targetFieldOrColumn 列对象、列字段、移动偏移量
3557
+ * @param options
3558
+ */
3559
+ moveColumnTo(fieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo, targetFieldOrColumn: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo | number, options?: {
3560
+ /**
3561
+ * 只对 row-drag-config.isCrossDrag 有效,允许跨层级移动
3562
+ */
3563
+ isCrossDrag?: boolean
3564
+ /**
3565
+ * 只对 column-drag-config.isToChildDrag 有效,移动成子级
3566
+ */
3567
+ dragToChild?: boolean
3568
+ /**
3569
+ * 移动到目标列的左边或右边位置
3570
+ */
3571
+ dragPos?: 'left' | 'right' | '' | null
3572
+ }): Promise<{
3573
+ status: boolean
3574
+ }>
3575
+ /**
3576
+ * 移动行到指定行的位置
3577
+ * @param rowidOrRow
3578
+ * @param targetRowidOrRow 行对象、行主键、移动偏移量
3579
+ * @param options
3580
+ */
3581
+ moveRowTo(rowidOrRow: any, targetRowidOrRow: any, options?: {
3582
+ /**
3583
+ * 只对 row-drag-config.isCrossDrag 有效,允许跨层级移动
3584
+ */
3585
+ isCrossDrag?: boolean
3586
+ /**
3587
+ * 只对 row-drag-config.isToChildDrag 有效,移动成子级
3588
+ */
3589
+ dragToChild?: boolean
3590
+ /**
3591
+ * 移动到目标行的上方或下方位置
3592
+ */
3593
+ dragPos?: 'top' | 'bottom' | '' | null
3594
+ }): Promise<{
3595
+ status: boolean
3596
+ }>
3549
3597
  /**
3550
3598
  * 获取表格的全量列
3551
3599
  */
@@ -4213,7 +4261,7 @@ export interface TablePrivateMethods<D = any> {
4213
4261
  triggerCellMousedownEvent(evnt: MouseEvent, params: any): void
4214
4262
  triggerCellMousedownEvent(evnt: any, params: any): void
4215
4263
  triggerCellMouseupEvent(evnt: MouseEvent): void
4216
- handleRowDragSwapEvent (evnt: DragEvent, isSyncRow: boolean | undefined, dragRow: any, prevDragRow: any, prevDragPos: '' | 'top' | 'bottom' | 'left' | 'right' | undefined, prevDragToChild: boolean | undefined): Promise<void>
4264
+ handleRowDragSwapEvent (evnt: DragEvent | null, isSyncRow: boolean | undefined, dragRow: any, prevDragRow: any, prevDragPos: '' | 'top' | 'bottom' | 'left' | 'right' | undefined, prevDragToChild: boolean | undefined): Promise<{ status: boolean }>
4217
4265
  handleRowDragDragstartEvent (evnt: DragEvent): void
4218
4266
  handleRowDragDragendEvent(evnt: DragEvent): void
4219
4267
  handleRowDragDragoverEvent(evnt: DragEvent,): void
@@ -4224,7 +4272,7 @@ export interface TablePrivateMethods<D = any> {
4224
4272
  handleCellDragMouseupEvent (evnt: MouseEvent): void
4225
4273
  handleHeaderCellDragDragstartEvent (evnt: DragEvent): void
4226
4274
  handleColDragSwapColumn(): void
4227
- handleColDragSwapEvent (evnt: DragEvent, isSyncColumn: boolean | undefined, dragCol: VxeTableDefines.ColumnInfo | null | undefined, prevDragCol: VxeTableDefines.ColumnInfo | undefined, prevDragPos: '' | 'top' | 'bottom' | 'left' | 'right' | undefined, prevDragToChild: boolean | undefined): Promise<void>
4275
+ handleColDragSwapEvent (evnt: DragEvent | null, isSyncColumn: boolean | undefined, dragCol: VxeTableDefines.ColumnInfo | null | undefined, prevDragCol: VxeTableDefines.ColumnInfo | null | undefined, prevDragPos: '' | 'top' | 'bottom' | 'left' | 'right' | undefined, prevDragToChild: boolean | undefined): Promise<{ status: boolean }>
4228
4276
  handleHeaderCellDragDragendEvent(evnt: DragEvent): void
4229
4277
  handleHeaderCellDragDragoverEvent(evnt: DragEvent,): void
4230
4278
  handleHeaderCellDragMousedownEvent (evnt: MouseEvent, params: {