vxe-pc-ui 3.15.24 → 3.15.26

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 (67) hide show
  1. package/es/date-panel/src/date-panel.js +63 -40
  2. package/es/date-panel/src/util.js +11 -1
  3. package/es/date-picker/src/date-picker.js +19 -12
  4. package/es/date-range-picker/src/date-range-picker.js +102 -19
  5. package/es/icon/style.css +1 -1
  6. package/es/list/src/list.js +560 -13
  7. package/es/list/src/util.js +8 -0
  8. package/es/list/style.css +10 -4
  9. package/es/list/style.min.css +1 -1
  10. package/es/style.css +1 -1
  11. package/es/style.min.css +1 -1
  12. package/es/ui/index.js +4 -1
  13. package/es/ui/src/log.js +1 -1
  14. package/es/vxe-list/style.css +10 -4
  15. package/es/vxe-list/style.min.css +1 -1
  16. package/lib/date-panel/src/date-panel.js +65 -40
  17. package/lib/date-panel/src/date-panel.min.js +1 -1
  18. package/lib/date-panel/src/util.js +14 -2
  19. package/lib/date-panel/src/util.min.js +1 -1
  20. package/lib/date-picker/src/date-picker.js +19 -12
  21. package/lib/date-picker/src/date-picker.min.js +1 -1
  22. package/lib/date-range-picker/src/date-range-picker.js +111 -18
  23. package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
  24. package/lib/icon/style/style.css +1 -1
  25. package/lib/icon/style/style.min.css +1 -1
  26. package/lib/index.umd.js +863 -87
  27. package/lib/index.umd.min.js +1 -1
  28. package/lib/list/src/list.js +605 -11
  29. package/lib/list/src/list.min.js +1 -1
  30. package/lib/list/src/util.js +14 -0
  31. package/lib/list/src/util.min.js +1 -0
  32. package/lib/list/style/style.css +10 -4
  33. package/lib/list/style/style.min.css +1 -1
  34. package/lib/style.css +1 -1
  35. package/lib/style.min.css +1 -1
  36. package/lib/ui/index.js +4 -1
  37. package/lib/ui/index.min.js +1 -1
  38. package/lib/ui/src/log.js +1 -1
  39. package/lib/ui/src/log.min.js +1 -1
  40. package/lib/vxe-list/style/style.css +10 -4
  41. package/lib/vxe-list/style/style.min.css +1 -1
  42. package/package.json +1 -1
  43. package/packages/date-panel/src/date-panel.ts +65 -40
  44. package/packages/date-panel/src/util.ts +14 -2
  45. package/packages/date-picker/src/date-picker.ts +20 -12
  46. package/packages/date-range-picker/src/date-range-picker.ts +100 -19
  47. package/packages/list/src/list.ts +588 -13
  48. package/packages/list/src/util.ts +11 -0
  49. package/packages/ui/index.ts +3 -0
  50. package/styles/components/list.scss +8 -4
  51. package/types/components/date-panel.d.ts +3 -1
  52. package/types/components/date-range-picker.d.ts +2 -2
  53. package/types/components/list.d.ts +120 -4
  54. package/types/components/tree.d.ts +3 -7
  55. package/types/ui/menus.d.ts +13 -1
  56. /package/es/icon/{iconfont.1783233735491.ttf → iconfont.1783301643461.ttf} +0 -0
  57. /package/es/icon/{iconfont.1783233735491.woff → iconfont.1783301643461.woff} +0 -0
  58. /package/es/icon/{iconfont.1783233735491.woff2 → iconfont.1783301643461.woff2} +0 -0
  59. /package/es/{iconfont.1783233735491.ttf → iconfont.1783301643461.ttf} +0 -0
  60. /package/es/{iconfont.1783233735491.woff → iconfont.1783301643461.woff} +0 -0
  61. /package/es/{iconfont.1783233735491.woff2 → iconfont.1783301643461.woff2} +0 -0
  62. /package/lib/icon/style/{iconfont.1783233735491.ttf → iconfont.1783301643461.ttf} +0 -0
  63. /package/lib/icon/style/{iconfont.1783233735491.woff → iconfont.1783301643461.woff} +0 -0
  64. /package/lib/icon/style/{iconfont.1783233735491.woff2 → iconfont.1783301643461.woff2} +0 -0
  65. /package/lib/{iconfont.1783233735491.ttf → iconfont.1783301643461.ttf} +0 -0
  66. /package/lib/{iconfont.1783233735491.woff → iconfont.1783301643461.woff} +0 -0
  67. /package/lib/{iconfont.1783233735491.woff2 → iconfont.1783301643461.woff2} +0 -0
@@ -0,0 +1,11 @@
1
+
2
+ import type { VxeListDefines } from '../../../types'
3
+
4
+ export function getItemCacheObj (item: any): VxeListDefines.RowCacheItem {
5
+ return {
6
+ item,
7
+ index: -1,
8
+ $index: -1,
9
+ _index: -1
10
+ }
11
+ }
@@ -234,6 +234,9 @@ setConfig({
234
234
  listView: {},
235
235
  list: {
236
236
  // size: null,
237
+ rowConfig: {
238
+ contentField: 'label'
239
+ },
237
240
  dragConfig: {
238
241
  showIcon: true,
239
242
  animation: true,
@@ -137,23 +137,27 @@
137
137
  flex-direction: row;
138
138
  align-items: center;
139
139
  }
140
- .vxe-list--row-drag {
140
+ .vxe-list--row-drag,
141
+ .vxe-list--row-content,
142
+ .vxe-list--row-extra {
141
143
  display: flex;
142
144
  flex-direction: row;
143
145
  align-items: center;
146
+ }
147
+ .vxe-list--row-drag {
144
148
  flex-shrink: 0;
145
149
  padding-right: var(--vxe-ui-list-current-padding);
146
150
  }
147
151
  .vxe-list--row-content {
148
- display: flex;
149
- flex-direction: row;
150
- align-items: center;
151
152
  flex-grow: 1;
152
153
  height: var(--vxe-ui-list-row-height);
153
154
  overflow: hidden;
154
155
  text-overflow: ellipsis;
155
156
  white-space: nowrap;
156
157
  }
158
+ .vxe-list--row-extra {
159
+ flex-shrink: 0;
160
+ }
157
161
 
158
162
  .vxe-list--drag-handle {
159
163
  &:not(.is--disabled) {
@@ -17,7 +17,7 @@ export interface VxeDatePanelPrivateRef extends DatePanelPrivateRef { }
17
17
 
18
18
  export namespace VxeDatePanelPropTypes {
19
19
  export type Size = VxeComponentSizeType
20
- export type ModelValue = string | number | Date | null
20
+ export type ModelValue = string | number | Date | null | (string | number | Date | null)[]
21
21
  export type ClassName = string
22
22
  export type CellClassName = string | ((params: {
23
23
  $datePanel: VxeDatePanelConstructor
@@ -115,6 +115,8 @@ export interface VxeDatePanelProps {
115
115
  }
116
116
 
117
117
  export interface DatePanelPrivateComputed {
118
+ computeSize: VxeDatePanelPropTypes.Size
119
+ computeYearList: VxeDatePanelDefines.DateYearItem[]
118
120
  }
119
121
  export interface VxeDatePanelPrivateComputed extends DatePanelPrivateComputed { }
120
122
 
@@ -196,8 +196,8 @@ export interface DateRangePickerReactData {
196
196
  isActivated: boolean
197
197
  selectStValue: any
198
198
  selectEdValue: any
199
- paneStartVal: string
200
- paneEndVal: string
199
+ paneStartVal: (string | number | Date | null)[]
200
+ paneEndVal: (string | number | Date | null)[]
201
201
  }
202
202
 
203
203
  export interface DateRangePickerInternalData {
@@ -1,4 +1,5 @@
1
1
  import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentEventParams, VxeComponentSizeType, ValueOf } from '@vxe-ui/core'
2
+ import { VxeContextMenuPropTypes, VxeContextMenuDefines } from './context-menu'
2
3
 
3
4
  /* eslint-disable @typescript-eslint/no-empty-interface,no-use-before-define,@typescript-eslint/ban-types,@typescript-eslint/no-unused-vars */
4
5
 
@@ -25,6 +26,7 @@ export namespace VxeListPropTypes {
25
26
  export type ClassName = string | ((params: { $list: VxeListConstructor }) => string)
26
27
  export type SyncResize = boolean | string | number
27
28
 
29
+ export type ShowSeq = boolean
28
30
  export type ShowRadio = boolean
29
31
  export type CheckRowKey = string | number | null
30
32
  export interface RadioConfig<D = any> {
@@ -113,6 +115,10 @@ export namespace VxeListPropTypes {
113
115
  * 触发拖拽方式
114
116
  */
115
117
  trigger?: 'default' | 'row' | '' | null
118
+ /**
119
+ * 是否允许在不同列表之间进行拖拽
120
+ */
121
+ isCrossListDrag?: boolean
116
122
  /**
117
123
  * 是否显示拖拽辅助状态显示
118
124
  */
@@ -152,6 +158,25 @@ export namespace VxeListPropTypes {
152
158
  dragEndMethod?(params: Omit<VxeListDefines.RowDragendEventParams<D>, '_index'>): Promise<boolean> | boolean
153
159
  }
154
160
 
161
+ export interface MenuConfig<D = any> {
162
+ /**
163
+ * 是否启用
164
+ */
165
+ enabled?: boolean
166
+ /**
167
+ * 菜单配置
168
+ */
169
+ options: VxeContextMenuPropTypes.Options
170
+ /**
171
+ * 该函数的返回值用来决定是否允许显示右键菜单(对于需要对菜单进行权限控制时可能会用到)
172
+ */
173
+ visibleMethod?(params: {
174
+ $list: VxeListConstructor
175
+ options: VxeContextMenuPropTypes.Options
176
+ row: D
177
+ }): boolean
178
+ }
179
+
155
180
  export interface VirtualYConfig {
156
181
  /**
157
182
  * 指定大于指定行时自动启动纵向虚拟滚动,如果为 0 则总是启用,如果为 -1 则关闭
@@ -204,6 +229,7 @@ export interface VxeListProps<D = any> {
204
229
  autoResize?: VxeListPropTypes.AutoResize
205
230
  syncResize?: VxeListPropTypes.SyncResize
206
231
  className?: VxeListPropTypes.ClassName
232
+ showSeq?: VxeListPropTypes.ShowSeq
207
233
  showRadio?: VxeListPropTypes.ShowRadio
208
234
  checkRowKey?: VxeListPropTypes.CheckRowKey
209
235
  radioConfig?: VxeListPropTypes.RadioConfig
@@ -212,6 +238,7 @@ export interface VxeListProps<D = any> {
212
238
  checkboxConfig?: VxeListPropTypes.CheckboxConfig
213
239
  rowConfig?: VxeListPropTypes.RowConfig
214
240
  dragConfig?: VxeListPropTypes.DragConfig
241
+ menuConfig?: VxeListPropTypes.MenuConfig
215
242
  virtualYConfig?: VxeListPropTypes.VirtualYConfig
216
243
 
217
244
  /**
@@ -241,14 +268,20 @@ export interface ListReactData {
241
268
  isAllChecked: boolean
242
269
  isAllIndeterminate: boolean
243
270
 
271
+ insertRowFlag: number
272
+ removeRowFlag: number
273
+
244
274
  dragRow: any
245
275
  dragTipText: string
276
+ isCrossDragRow: boolean
246
277
  }
247
278
 
248
279
  export interface ListInternalData {
249
280
  resizeObserver: ResizeObserver | undefined
250
281
  fullData: any[]
282
+ afterList: any[]
251
283
  fullKeyMaps: Record<string, any>
284
+ rowMaps: Record<string, VxeListDefines.RowCacheItem>
252
285
  lastScrollLeft: number
253
286
  lastScrollTop: number
254
287
  scrollYStore: {
@@ -261,6 +294,9 @@ export interface ListInternalData {
261
294
  currentRow: any
262
295
  selectCheckboxMaps: Record<string, any>
263
296
 
297
+ insertRowMaps: Record<string, any>
298
+ removeRowMaps: Record<string, any>
299
+
264
300
  prevDragRow?: any
265
301
  prevDragPos?: 'top' | 'bottom' | ''
266
302
  }
@@ -420,10 +456,67 @@ export interface ListMethods<D = any> {
420
456
  * 只对 show-checkbox 有效,设置所有行的选中状态
421
457
  */
422
458
  setAllCheckboxRow(checked: boolean): Promise<void>
459
+
460
+ /**
461
+ * 往列表插入临时数据,从第一个行新增一个行或多个行新数据
462
+ */
463
+ insert(records: any): Promise<{ row: D, rows: D[] }>
464
+ /**
465
+ * 往列表指定行中插入临时数据
466
+ * 如果 row 为空则从插入到顶部,如果为树结构,则插入到目标行顶部
467
+ * 如果 row 为 -1 则从插入到底部,如果为树结构,则插入到目标行底部
468
+ * 如果 row 为有效行则插入到该行的位置
469
+ */
470
+ insertAt(records: any, targetRowOrRowKey?: any | -1 | null): Promise<{ row: D, rows: D[] }>
471
+ /**
472
+ * 用于 transform 模式,与 insertAt 行为一致,区别就是会插入指定目标的到下一行
473
+ */
474
+ insertNextAt(records: any, targetRowOrRowKey?: any | -1 | null): Promise<{ row: D, rows: D[] }>
475
+ /**
476
+ * 判断行是否为新增的临时数据
477
+ */
478
+ isInsertByRow(row: any | null): boolean
479
+ /**
480
+ * 用于 transform 模式,删除指定行数据,指定 row 或 [row, ...] 删除多条数据,如果为空则删除所有数据
481
+ */
482
+ remove(rows?: any | any[]): Promise<{ row: D, rows: D[] }>
483
+ /**
484
+ * 用于 transform 模式,获取新增的临时数据
485
+ */
486
+ getInsertRecords(): D[]
487
+ /**
488
+ * 用于 transform 模式,获取已删除的数据
489
+ */
490
+ getRemoveRecords(): D[]
491
+ /**
492
+ * 判断数据是否被删除
493
+ */
494
+ isRemoveByRow(row: any | null): boolean
423
495
  }
424
496
  export interface VxeListMethods<D = any> extends ListMethods<D> { }
425
497
 
426
- export interface ListPrivateMethods<D = any> {}
498
+ export interface ListPrivateMethods<D = any> {
499
+ /**
500
+ * @private
501
+ */
502
+ handleCrossListRowDragInsertEvent(evnt: DragEvent): void
503
+ /**
504
+ * @private
505
+ */
506
+ handleCrossListRowDragCancelEvent(evnt: DragEvent): void
507
+ /**
508
+ * @private
509
+ */
510
+ handleCrossListRowDragFinishEvent(evnt: DragEvent): void
511
+ /**
512
+ * @private
513
+ */
514
+ handleCrossListRowDragoverEmptyEvent(evnt: DragEvent): void
515
+ /**
516
+ * @private
517
+ */
518
+ hideCrossListRowDropClearStatus(): void
519
+ }
427
520
  export interface VxeListPrivateMethods<D = any> extends ListPrivateMethods<D> { }
428
521
 
429
522
  export type VxeListEmits = [
@@ -438,12 +531,24 @@ export type VxeListEmits = [
438
531
  'scroll',
439
532
  'row-dragstart',
440
533
  'row-dragover',
441
- 'row-dragend'
534
+ 'row-dragend',
535
+ 'row-remove-dragend',
536
+ 'row-insert-dragend',
537
+ 'row-menu',
538
+ 'menu-click'
442
539
  ]
443
540
 
444
541
  export namespace VxeListDefines {
445
- export interface ListEventParams extends VxeComponentEventParams {
446
- $list: VxeListConstructor
542
+
543
+ export interface RowCacheItem {
544
+ item: any
545
+ index: number
546
+ $index: number
547
+ _index: number
548
+ }
549
+
550
+ export interface ListEventParams<D = any> extends VxeComponentEventParams {
551
+ $list: VxeListConstructor<D>
447
552
  }
448
553
 
449
554
  export interface RowClickParams<D = any> {
@@ -479,6 +584,12 @@ export namespace VxeListDefines {
479
584
 
480
585
  export interface ScrollParams { }
481
586
  export interface ScrollEventParams extends ListEventParams, ScrollParams { }
587
+
588
+ export interface MenuClickEventParams<D = any> extends ListEventParams<D> {
589
+ row: D
590
+ menu: VxeContextMenuDefines.MenuFirstOption | VxeContextMenuDefines.MenuChildOption
591
+ }
592
+
482
593
  }
483
594
 
484
595
  export type VxeListEventProps<D = any> = {
@@ -488,6 +599,7 @@ export type VxeListEventProps<D = any> = {
488
599
  onRowDragstart?: VxeListEvents.RowDragstart<D>
489
600
  onRowDragover?: VxeListEvents.RowDragover<D>
490
601
  onRowDragend?: VxeListEvents.RowDragend<D>
602
+ onMenuClick?: VxeListEvents.MenuClick<D>
491
603
  }
492
604
 
493
605
  export interface VxeListListeners<D = any> {
@@ -497,6 +609,7 @@ export interface VxeListListeners<D = any> {
497
609
  rowDragstart?: VxeListEvents.RowDragstart<D>
498
610
  rowDragover?: VxeListEvents.RowDragover<D>
499
611
  rowDragend?: VxeListEvents.RowDragend<D>
612
+ menuClick?: VxeListEvents.MenuClick<D>
500
613
  }
501
614
 
502
615
  export namespace VxeListEvents {
@@ -506,6 +619,7 @@ export namespace VxeListEvents {
506
619
  export type RowDragstart<D = any> = (params: VxeListDefines.RowDragstartEventParams<D>) => void
507
620
  export type RowDragover<D = any> = (params: VxeListDefines.RowDragoverEventParams<D>) => void
508
621
  export type RowDragend<D = any> = (params: VxeListDefines.RowDragendEventParams<D>) => void
622
+ export type MenuClick<D = any> = (params: VxeListDefines.MenuClickEventParams<D>) => void
509
623
  }
510
624
 
511
625
  export namespace VxeListSlotTypes {
@@ -519,6 +633,7 @@ export namespace VxeListSlotTypes {
519
633
  export interface ContentSlotParams<D = any> {
520
634
  row: D
521
635
  }
636
+ export interface ExtraSlotParams<D = any> extends ContentSlotParams<D> {}
522
637
  export interface DragSlotParams<D = any> {
523
638
  row: D
524
639
  }
@@ -529,6 +644,7 @@ export interface VxeListSlots {
529
644
  header?:(params: VxeListSlotTypes.HeaderSlotParams) => any
530
645
  footer?:(params: VxeListSlotTypes.FooterSlotParams) => any
531
646
  content?:(params: VxeListSlotTypes.ContentSlotParams) => any
647
+ extra?:(params: VxeListSlotTypes.ExtraSlotParams) => any
532
648
  tip?:(params: VxeListSlotTypes.DragSlotParams) => any
533
649
  }
534
650
 
@@ -653,7 +653,7 @@ export interface TreeMethods<D = any> {
653
653
  */
654
654
  scrollToNodeId(nodeKey: string | number | null): Promise<void>
655
655
 
656
- /**
656
+ /**
657
657
  * 手动清除滚动相关信息,还原到初始状态
658
658
  */
659
659
  clearScroll(): Promise<void>
@@ -668,15 +668,11 @@ export interface TreeMethods<D = any> {
668
668
  * 如果 node 为 -1 则从插入到底部,如果为树结构,则插入到目标节点底部
669
669
  * 如果 node 为有效节点则插入到该节点的位置,如果为树结构,则有插入到效的目标节点该节点的位置
670
670
  */
671
- insertAt(records: any, targetNodeOrNodeid?: any | -1 | null): Promise<{ node: D, nodes: D[] }>
671
+ insertAt(records: any, targetNodeOrNodeKey?: any | -1 | null): Promise<{ node: D, nodes: D[] }>
672
672
  /**
673
673
  * 用于 transform 模式,与 insertAt 节点为一致,区别就是会插入指定目标的到下一节点
674
674
  */
675
- insertNextAt(records: any, targetNodeOrNodeid?: any | -1 | null): Promise<{ node: D, nodes: D[] }>
676
- /**
677
- * 判断行是否为新增的临时数据
678
- */
679
- insertNextAt(records: any, targetNodeOrNodeid?: any | -1 | null): Promise<{ node: D, nodes: D[] }>
675
+ insertNextAt(records: any, targetNodeOrNodeKey?: any | -1 | null): Promise<{ node: D, nodes: D[] }>
680
676
  /**
681
677
  * 用于树结构,往指定节点插入子级临时数据,从子级的第一行新增一行或多行新数据
682
678
  */
@@ -1,6 +1,7 @@
1
1
  import { VxeTableConstructor, VxeTableDefines } from '../components/table'
2
2
  import { VxeGridConstructor } from '../components/grid'
3
3
  import { VxeTreeConstructor } from '../components/tree'
4
+ import { VxeListConstructor } from '../components/list'
4
5
  import { VxeCalendarConstructor } from '../components/calendar'
5
6
  import { VxeFormDesignConstructor, VxeFormDesignDefines } from '../components/form-design'
6
7
  import { VxeMenuConstructor, VxeMenuPropTypes } from '../components/menu'
@@ -19,6 +20,10 @@ declare module '@vxe-ui/core' {
19
20
  * 树 - 自定义菜单方法
20
21
  */
21
22
  treeMenuMethod?: (params: TreeMenuMethodParams, event: Event) => void
23
+ /**
24
+ * 列表 - 自定义菜单方法
25
+ */
26
+ listMenuMethod?: (params: ListMenuMethodParams, event: Event) => void
22
27
  /**
23
28
  * 日历 - 自定义菜单方法
24
29
  */
@@ -47,12 +52,19 @@ declare module '@vxe-ui/core' {
47
52
  }
48
53
 
49
54
  export interface TreeMenuMethodParams<D = any> {
50
- $tree: VxeTreeConstructor
55
+ $tree: VxeTreeConstructor<D>
51
56
  $event: MouseEvent
52
57
  node: D
53
58
  menu: VxeContextMenuDefines.MenuFirstOption | VxeContextMenuDefines.MenuChildOption
54
59
  }
55
60
 
61
+ export interface ListMenuMethodParams<D = any> {
62
+ $list: VxeListConstructor<D>
63
+ $event: MouseEvent
64
+ row: D
65
+ menu: VxeContextMenuDefines.MenuFirstOption | VxeContextMenuDefines.MenuChildOption
66
+ }
67
+
56
68
  export interface CalendarMenuMethodParams {
57
69
  $calendar: VxeCalendarConstructor
58
70
  $event: MouseEvent