cnhis-design-vue 3.1.26-beta.5 → 3.1.27-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +123 -123
  2. package/es/components/fabric-chart/index.d.ts +2 -0
  3. package/es/components/fabric-chart/src/FabricChart.js +4 -11
  4. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +2 -0
  5. package/es/components/fabric-chart/src/hooks/useCenter.d.ts +2 -0
  6. package/es/components/fabric-chart/src/hooks/useCenter.js +76 -12
  7. package/es/components/fabric-chart/src/hooks/useLeft.d.ts +1 -1
  8. package/es/components/fabric-chart/src/hooks/useLeft.js +9 -10
  9. package/es/components/iho-table/index.d.ts +6 -46
  10. package/es/components/iho-table/index.js +1 -2
  11. package/es/components/iho-table/src/IhoTable.js +31 -37
  12. package/es/components/iho-table/src/IhoTable.vue.d.ts +6 -46
  13. package/es/components/iho-table/src/components/index.d.ts +0 -1
  14. package/es/components/iho-table/src/components/index.js +0 -1
  15. package/es/components/iho-table/src/constants/index.d.ts +15 -3
  16. package/es/components/iho-table/src/constants/index.js +15 -1
  17. package/es/components/iho-table/src/hooks/index.d.ts +0 -1
  18. package/es/components/iho-table/src/hooks/index.js +1 -2
  19. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +8 -1
  20. package/es/components/iho-table/src/hooks/tapHooks/index.js +21 -5
  21. package/es/components/iho-table/src/hooks/tapHooks/useDomInsertHooks.d.ts +15 -0
  22. package/es/components/iho-table/src/hooks/tapHooks/useDomInsertHooks.js +27 -0
  23. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +67 -60
  24. package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.js +29 -1
  25. package/es/components/iho-table/src/hooks/useTableContext.d.ts +7 -5
  26. package/es/components/iho-table/src/hooks/useTableContext.js +4 -2
  27. package/es/components/iho-table/src/plugins/anchorPlugin/index.d.ts +1 -0
  28. package/es/components/iho-table/src/plugins/anchorPlugin/index.js +19 -0
  29. package/es/components/iho-table/src/plugins/anchorPlugin/tableAnchor.d.ts +2 -0
  30. package/es/components/iho-table/src/plugins/anchorPlugin/tableAnchor.js +50 -0
  31. package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.d.ts +13 -0
  32. package/es/components/iho-table/src/plugins/anchorPlugin/useAnchor.js +87 -0
  33. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +1 -4
  34. package/es/components/iho-table/src/plugins/index.js +16 -14
  35. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +3 -2
  36. package/es/components/iho-table/src/types/index.d.ts +3 -0
  37. package/es/components/iho-table/src/types/index.js +1 -1
  38. package/es/components/iho-table/src/types/pluginType.d.ts +6 -1
  39. package/es/components/iho-table/src/types/pluginType.js +3 -1
  40. package/es/components/index.css +1 -1
  41. package/es/components/index.js +1 -1
  42. package/es/components/steps-wheel/index.d.ts +1 -1
  43. package/es/components/steps-wheel/src/StepsWheel.js +38 -18
  44. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
  45. package/es/components/steps-wheel/style/index.css +1 -1
  46. package/es/components/time-line/index.d.ts +39 -11
  47. package/es/components/time-line/src/TimeLine.js +1 -1
  48. package/es/components/time-line/src/TimeLine.vue.d.ts +14 -13
  49. package/es/shared/assets/img/failure.js +1 -1
  50. package/es/shared/assets/img/icon-asc.js +1 -1
  51. package/es/shared/assets/img/icon-desc.js +1 -1
  52. package/es/shared/assets/img/no-permission.js +1 -1
  53. package/es/shared/assets/img/nodata.js +1 -1
  54. package/es/shared/assets/img/notfound.js +1 -1
  55. package/es/shared/assets/img/qr.js +1 -1
  56. package/es/shared/assets/img/success.js +1 -1
  57. package/es/shared/assets/img/video.js +1 -1
  58. package/es/shared/assets/img/video_default_cover.js +1 -1
  59. package/es/shared/assets/img/video_hover.js +1 -1
  60. package/es/shared/assets/img/video_play_hover.js +1 -1
  61. package/es/shared/assets/img/xb_big.js +1 -1
  62. package/es/shared/assets/img/xb_small.js +1 -1
  63. package/package.json +2 -2
  64. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  65. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  66. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  67. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  68. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  69. package/es/components/iho-table/src/components/ColumnAnchor.d.ts +0 -28
  70. package/es/components/iho-table/src/components/ColumnAnchor.js +0 -47
  71. package/es/components/iho-table/src/hooks/useAnchor.d.ts +0 -13
  72. package/es/components/iho-table/src/hooks/useAnchor.js +0 -66
  73. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  74. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1,185 +1,192 @@
1
+ import { Func } from '../../../../../../es/shared/types';
1
2
  import { AsyncParallelHook } from '../../../../../../es/shared/utils/tapable';
2
- import { AbstractEventHooks } from '../../../../../../es/components/iho-table/src/types';
3
+ import { AbstractEventHooks, IhoTableEmitPayload, IhoTableEventNameUnion } from '../../../../../../es/components/iho-table/src/types';
3
4
  declare class EventHooks extends AbstractEventHooks {
4
5
  readonly onKeydownStart: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.KeydownStartEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
5
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
6
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
6
7
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
7
8
  readonly onKeydown: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.KeydownEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
8
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
9
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
9
10
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
10
11
  readonly onKeydownEnd: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.KeydownEndEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
11
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
12
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
12
13
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
13
14
  readonly onPaste: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.PasteEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
14
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
15
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
15
16
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
16
17
  readonly onCopy: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CopyEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
17
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
18
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
18
19
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
19
20
  readonly onCut: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CutEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
20
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
21
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
21
22
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
22
23
  readonly onCurrentChange: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CurrentChangeEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
23
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
24
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
24
25
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
25
26
  readonly onRadioChange: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.RadioChangeEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
26
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
27
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
27
28
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
28
29
  readonly onCheckboxChange: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CheckboxChangeEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
29
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
30
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
30
31
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
31
32
  readonly onCheckboxAll: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CheckboxAllEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
32
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
33
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
33
34
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
34
35
  readonly onCheckboxRangeStart: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CheckboxRangeStartEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
35
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
36
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
36
37
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
37
38
  readonly onCheckboxRangeChange: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CheckboxRangeChangeEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
38
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
39
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
39
40
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
40
41
  readonly onCheckboxRangeEnd: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CheckboxRangeEndEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
41
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
42
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
42
43
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
43
44
  readonly onCellClick: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CellClickEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
44
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
45
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
45
46
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
46
47
  readonly onCellDblclick: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CellDblclickEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
47
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
48
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
48
49
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
49
50
  readonly onCellMenu: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CellMenuEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
50
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
51
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
51
52
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
52
53
  readonly onCellMouseenter: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CellMouseenterEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
53
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
54
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
54
55
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
55
56
  readonly onCellMouseleave: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CellMouseleaveEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
56
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
57
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
57
58
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
58
59
  readonly onHeaderCellClick: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.HeaderCellClickEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
59
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
60
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
60
61
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
61
62
  readonly onHeaderCellDblclick: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.HeaderCellDblclickEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
62
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
63
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
63
64
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
64
65
  readonly onHeaderCellMenu: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.HeaderCellMenuEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
65
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
66
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
66
67
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
67
68
  readonly onFooterCellClick: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.FooterCellClickEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
68
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
69
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
69
70
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
70
71
  readonly onFooterCellDblclick: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.FooterCellDblclickEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
71
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
72
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
72
73
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
73
74
  readonly onFooterCellMenu: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.FooterCellMenuEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
74
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
75
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
75
76
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
76
77
  readonly onSortChange: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.SortChangeEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
77
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
78
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
78
79
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
79
80
  readonly onFilterChange: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.FilterChangeEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
80
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
81
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
81
82
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
82
83
  readonly onFilterVisible: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.FilterVisibleEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
83
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
84
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
84
85
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
85
86
  readonly onResizableChange: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.ResizableChangeEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
86
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
87
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
87
88
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
88
89
  readonly onToggleRowExpand: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.ToggleRowExpandEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
89
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
90
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
90
91
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
91
92
  readonly onToggleTreeExpand: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.ToggleTreeExpandEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
92
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
93
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
93
94
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
94
95
  readonly onMenuClick: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.MenuClickEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
95
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
96
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
96
97
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
97
98
  readonly onEditClosed: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.EditClosedEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
98
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
99
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
99
100
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
100
101
  readonly onEditActived: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.EditActivedEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
101
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
102
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
102
103
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
103
104
  readonly onEditDisabled: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.EditDisabledEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
104
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
105
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
105
106
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
106
107
  readonly onValidError: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.ValidErrorEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
107
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
108
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
108
109
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
109
110
  readonly onScroll: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.ScrollEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
110
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
111
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
111
112
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
112
113
  readonly onCustom: AsyncParallelHook<[import("vxe-table/types/table").VxeTableDefines.CustomEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
113
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
114
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
114
115
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
115
116
  readonly onOpenFnr: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.OpenFnrParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
116
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
117
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
117
118
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
118
119
  readonly onFnrChange: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.FnrChangeParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
119
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
120
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
120
121
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
121
122
  readonly onFnrFind: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.FnrFindParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
122
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
123
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
123
124
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
124
125
  readonly onFnrFindAll: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.FnrFindAllParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
125
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
126
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
126
127
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
127
128
  readonly onFnrReplace: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.FnrReplaceParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
128
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
129
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
129
130
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
130
131
  readonly onFnrReplaceAll: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.FnrReplaceAllParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
131
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
132
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
132
133
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
133
134
  readonly onCellAreaCopy: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaCopyParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
134
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
135
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
135
136
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
136
137
  readonly onCellAreaCut: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaCutParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
137
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
138
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
138
139
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
139
140
  readonly onCellAreaPaste: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaPasteParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
140
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
141
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
141
142
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
142
143
  readonly onCellAreaMerge: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaMergeEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
143
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
144
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
144
145
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
145
146
  readonly onClearCellAreaMerge: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.ClearCellAreaMergeEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
146
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
147
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
147
148
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
148
149
  readonly onHeaderCellAreaSelection: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.HeaderCellAreaSelectionEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
149
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
150
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
150
151
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
151
152
  readonly onCellAreaSelectionStart: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaSelectionStartEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
152
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
153
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
153
154
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
154
155
  readonly onCellAreaSelectionDrag: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaSelectionDragEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
155
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
156
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
156
157
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
157
158
  readonly onCellAreaSelectionEnd: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaSelectionEndEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
158
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
159
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
159
160
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
160
161
  readonly onCellAreaExtensionStart: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaExtensionStartEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
161
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
162
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
162
163
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
163
164
  readonly onCellAreaExtensionDrag: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaExtensionDragEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
164
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
165
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
165
166
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
166
167
  readonly onCellAreaExtensionEnd: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaExtensionEndEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
167
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
168
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
168
169
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
169
170
  readonly onCellAreaArrowsStart: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaArrowsStartEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
170
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
171
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
171
172
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
172
173
  readonly onCellAreaArrowsEnd: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.CellAreaArrowsEndEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
173
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
174
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
174
175
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
175
176
  readonly onActiveCellChangeStart: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.ActiveCellChangeStartEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
176
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
177
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
177
178
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
178
179
  readonly onActiveCellChangeEnd: AsyncParallelHook<[import("vxe-table").VxeTableProDefines.ActiveCellChangeEndEventParams, import("../../../../../../es/components/iho-table/src/types").IhoTableHandler & {
179
- $table: import("../../../../../shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
180
+ $table: import("../../../../../../es/shared/types").Nullable<import("vxe-table/types/table").VxeTableInstance>;
180
181
  }, import("../../../../../../es/components/iho-table/src/types").IhoTableConfig], import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
181
182
  }
182
183
  export declare function useEventHooks(): {
183
184
  create: () => EventHooks;
184
185
  };
186
+ export declare class IhoTableEventListener {
187
+ eventMap: Map<"toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd", Set<Func<any[], any>>>;
188
+ addEventListener<T extends IhoTableEventNameUnion>(key: T, handler: (...payload: IhoTableEmitPayload<T>) => void): void;
189
+ trigger<T extends IhoTableEventNameUnion>(key: T, payload: IhoTableEmitPayload<T>): void;
190
+ }
191
+ export declare function provideIhoTableEventListener(): IhoTableEventListener;
185
192
  export {};
@@ -8,6 +8,8 @@ import '../../../../../shared/utils/tapable/AsyncSeriesHook.js';
8
8
  import '../../../../../shared/utils/tapable/AsyncSeriesBailHook.js';
9
9
  import '../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js';
10
10
  import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
11
+ import { getCurrentInstance, onMounted, onBeforeUnmount, provide } from 'vue';
12
+ import { InjectionIhoTableEventListener } from '../../constants/index.js';
11
13
  import { AbstractEventHooks } from '../../types/pluginType.js';
12
14
 
13
15
  class EventHooks extends AbstractEventHooks {
@@ -248,5 +250,31 @@ function useEventHooks() {
248
250
  }
249
251
  return { create };
250
252
  }
253
+ class IhoTableEventListener {
254
+ constructor() {
255
+ this.eventMap = /* @__PURE__ */ new Map();
256
+ }
257
+ addEventListener(key, handler) {
258
+ if (!getCurrentInstance())
259
+ throw new Error("addEventListener can only used in setup environment!");
260
+ const eventSet = this.eventMap.get(key) || /* @__PURE__ */ new Set();
261
+ this.eventMap.set(key, eventSet);
262
+ onMounted(() => eventSet.add(handler));
263
+ onBeforeUnmount(() => eventSet.delete(handler));
264
+ }
265
+ trigger(key, payload) {
266
+ var _a;
267
+ (_a = this.eventMap.get(key)) == null ? void 0 : _a.forEach((handler) => {
268
+ handler(payload);
269
+ });
270
+ }
271
+ }
272
+ function provideIhoTableEventListener() {
273
+ if (!getCurrentInstance())
274
+ throw new Error("provideIhoTableEventListener can only used in setup environment!");
275
+ const listener = new IhoTableEventListener();
276
+ provide(InjectionIhoTableEventListener, listener);
277
+ return listener;
278
+ }
251
279
 
252
- export { useEventHooks };
280
+ export { IhoTableEventListener, provideIhoTableEventListener, useEventHooks };
@@ -1,7 +1,9 @@
1
1
  export declare function useTableContext(): {
2
- configRef: import("vue").Ref<import("../../../../shared/types").Nullable<import("../types").IhoTableConfig>> | undefined;
3
- fieldListRef: import("vue").Ref<import("../../../../shared/types").Nullable<import("../types").IhoTableFieldItem[]>> | undefined;
4
- tableHandler: import("../types").IhoTableHandler | undefined;
5
- tableEmit: (<T extends "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd">(event: T, ...args: import("../types").IhoTableEmitPayload<T>) => void) | undefined;
6
- uuid: import("vue").Ref<string> | undefined;
2
+ configRef: import("vue").Ref<import("../types").IhoTableConfig>;
3
+ fieldListRef: import("vue").Ref<import("../types").IhoTableFieldItem[]>;
4
+ tableHandler: import("../types").IhoTableHandler;
5
+ tableEmit: <T extends "toggleRowExpand" | "toggleTreeExpand" | "copy" | "scroll" | "formChange" | "settingClick" | "cut" | "paste" | "keydown" | "keydownStart" | "keydownEnd" | "currentChange" | "radioChange" | "checkboxChange" | "checkboxAll" | "checkboxRangeStart" | "checkboxRangeChange" | "checkboxRangeEnd" | "cellClick" | "cellDblclick" | "cellMenu" | "cellMouseenter" | "cellMouseleave" | "headerCellClick" | "headerCellDblclick" | "headerCellMenu" | "footerCellClick" | "footerCellDblclick" | "footerCellMenu" | "sortChange" | "filterChange" | "filterVisible" | "resizableChange" | "menuClick" | "editClosed" | "editActived" | "editDisabled" | "validError" | "custom" | "openFnr" | "fnrChange" | "fnrFind" | "fnrFindAll" | "fnrReplace" | "fnrReplaceAll" | "cellAreaCopy" | "cellAreaCut" | "cellAreaPaste" | "cellAreaMerge" | "clearCellAreaMerge" | "headerCellAreaSelection" | "cellAreaSelectionStart" | "cellAreaSelectionDrag" | "cellAreaSelectionEnd" | "cellAreaExtensionStart" | "cellAreaExtensionDrag" | "cellAreaExtensionEnd" | "cellAreaArrowsStart" | "cellAreaArrowsEnd" | "activeCellChangeStart" | "activeCellChangeEnd">(event: T, ...args: import("../types").IhoTableEmitPayload<T>) => void;
6
+ eventListener: import("./tapHooks/useEventHooks").IhoTableEventListener;
7
+ $table: import("vue").Ref<import("../../../../shared/types").UndefinedAble<import("vxe-table").VxeTableInstance>>;
8
+ uuid: import("vue").Ref<string>;
7
9
  };
@@ -1,5 +1,5 @@
1
1
  import { getCurrentInstance, inject } from 'vue';
2
- import { InjectionIhoTableConfig, InjectionIhoTableFieldList, InjectionIhoTableHandler, InjectionIhoTableUUID, InjectionIhoTableEmits } from '../constants/index.js';
2
+ import { InjectionIhoTableConfig, InjectionIhoTableFieldList, InjectionIhoTableHandler, InjectionIhoTableUUID, InjectionIhoTableEmits, InjectionIhoTableInstance, InjectionIhoTableEventListener } from '../constants/index.js';
3
3
 
4
4
  function useTableContext() {
5
5
  if (!getCurrentInstance())
@@ -9,7 +9,9 @@ function useTableContext() {
9
9
  const tableHandler = inject(InjectionIhoTableHandler);
10
10
  const uuid = inject(InjectionIhoTableUUID);
11
11
  const tableEmit = inject(InjectionIhoTableEmits);
12
- return { configRef, fieldListRef, tableHandler, tableEmit, uuid };
12
+ const $table = inject(InjectionIhoTableInstance);
13
+ const eventListener = inject(InjectionIhoTableEventListener);
14
+ return { configRef, fieldListRef, tableHandler, tableEmit, eventListener, $table, uuid };
13
15
  }
14
16
 
15
17
  export { useTableContext };
@@ -0,0 +1 @@
1
+ export declare function anchorPlugin(): import("../../../../../../es/components/iho-table").TablePlugin;
@@ -0,0 +1,19 @@
1
+ import { createVNode } from 'vue';
2
+ import '../../../index.js';
3
+ import TableAnchor from './tableAnchor.js';
4
+ import { defineTablePlugin } from '../../hooks/useTablePlugin.js';
5
+
6
+ function anchorPlugin() {
7
+ const pluginName = "anchorPlugin";
8
+ return defineTablePlugin({
9
+ name: pluginName,
10
+ apply(hooks) {
11
+ hooks.domInsertHooks.header.tap(pluginName, (nodes) => {
12
+ nodes.push(createVNode(TableAnchor, null, null));
13
+ return nodes;
14
+ });
15
+ }
16
+ });
17
+ }
18
+
19
+ export { anchorPlugin };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, () => JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
+ export default _default;
@@ -0,0 +1,50 @@
1
+ import { defineComponent, computed, createVNode, isVNode } from 'vue';
2
+ import { NTabs, NTabPane } from 'naive-ui';
3
+ import { useAnchor } from './useAnchor.js';
4
+ import { useTableContext } from '../../hooks/useTableContext.js';
5
+
6
+ function _isSlot(s) {
7
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
8
+ }
9
+ var TableAnchor = defineComponent({
10
+ name: "IhoTableAnchor",
11
+ setup() {
12
+ const {
13
+ configRef,
14
+ eventListener,
15
+ fieldListRef,
16
+ $table
17
+ } = useTableContext();
18
+ const {
19
+ updateAnchor,
20
+ onScroll,
21
+ currentAnchorList,
22
+ anchorValue
23
+ } = useAnchor(computed(() => {
24
+ var _a;
25
+ return (_a = configRef.value.anchorList) != null ? _a : [];
26
+ }), $table, fieldListRef);
27
+ function onUpdatedValue(value) {
28
+ anchorValue.value = value;
29
+ updateAnchor(value);
30
+ }
31
+ eventListener.addEventListener("scroll", onScroll);
32
+ return () => {
33
+ let _slot;
34
+ return currentAnchorList.value.length > 0 ? createVNode(NTabs, {
35
+ "type": "line",
36
+ "animated": true,
37
+ "pane-style": "padding: 0",
38
+ "value": anchorValue.value,
39
+ "onUpdate:value": onUpdatedValue
40
+ }, _isSlot(_slot = currentAnchorList.value.map((field) => createVNode(NTabPane, {
41
+ "name": field.field,
42
+ "tab": field.title
43
+ }, null))) ? _slot : {
44
+ default: () => [_slot]
45
+ }) : null;
46
+ };
47
+ }
48
+ });
49
+
50
+ export { TableAnchor as default };
@@ -0,0 +1,13 @@
1
+ import { ComputedRef, Ref } from 'vue';
2
+ import { VxeTableInstance } from 'vxe-table';
3
+ import { IhoTableFieldItem } from '../../../../../../es/components/iho-table/src/types';
4
+ export declare const useAnchor: (anchorList: ComputedRef<string[]>, $table: Ref<VxeTableInstance | undefined>, fieldListRef: Ref<IhoTableFieldItem[]>) => {
5
+ updateAnchor: (field: string) => Promise<void>;
6
+ onScroll: (params: import("vxe-table").VxeTableDefines.ScrollEventParams) => void;
7
+ currentAnchorList: Ref<{
8
+ field: string;
9
+ title: string;
10
+ left: number;
11
+ }[]>;
12
+ anchorValue: Ref<any>;
13
+ };
@@ -0,0 +1,87 @@
1
+ import { ref, watch, unref } from 'vue';
2
+ import { useThrottleFn } from '@vueuse/core';
3
+ import { cloneDeep, omit } from 'lodash-es';
4
+
5
+ function flatFieldList(fieldList, _flatFieldList) {
6
+ fieldList.forEach((field) => {
7
+ var _a;
8
+ if ((_a = field.children) == null ? void 0 : _a.length) {
9
+ const temp = cloneDeep(field);
10
+ _flatFieldList.push({
11
+ ...omit(temp, "children"),
12
+ width: 0
13
+ });
14
+ flatFieldList(field.children, _flatFieldList);
15
+ } else {
16
+ isVisible(field) && _flatFieldList.push(field);
17
+ }
18
+ });
19
+ }
20
+ function isVisible(field) {
21
+ return field.visible || !Reflect.has(field, "visible");
22
+ }
23
+ const useAnchor = (anchorList, $table, fieldListRef) => {
24
+ const currentAnchorList = ref([]);
25
+ const anchorValue = ref();
26
+ let setAnchorStatus = true;
27
+ function initAnchor() {
28
+ var _a, _b, _c;
29
+ if ((_a = unref(anchorList)) == null ? void 0 : _a.length) {
30
+ let left = 0;
31
+ const _fieldList = cloneDeep(fieldListRef.value);
32
+ const _flatFieldList = [];
33
+ flatFieldList(_fieldList, _flatFieldList);
34
+ _flatFieldList.forEach((column) => {
35
+ var _a2;
36
+ const { field = "", minWidth, width, fixed, title = "" } = column;
37
+ const colWidth = +((_a2 = minWidth != null ? minWidth : width) != null ? _a2 : 0);
38
+ if (fixed == "left") ; else {
39
+ left += colWidth;
40
+ const anchorObj = unref(anchorList).find((fieldItem) => fieldItem === field);
41
+ anchorObj && currentAnchorList.value.push({
42
+ field,
43
+ title,
44
+ left: left - colWidth
45
+ });
46
+ }
47
+ });
48
+ anchorValue.value = ((_c = (_b = currentAnchorList.value) == null ? void 0 : _b[0]) == null ? void 0 : _c.field) || "";
49
+ }
50
+ }
51
+ async function updateAnchor(field) {
52
+ var _a, _b;
53
+ setAnchorStatus = false;
54
+ const anchorObj = currentAnchorList.value.find((fieldItem) => fieldItem.field === field);
55
+ await ((_b = $table.value) == null ? void 0 : _b.scrollTo((_a = anchorObj == null ? void 0 : anchorObj.left) != null ? _a : 0));
56
+ setTimeout(() => {
57
+ setAnchorStatus = true;
58
+ });
59
+ }
60
+ function setAnchorValue({ scrollLeft }) {
61
+ if (currentAnchorList.value.length && setAnchorStatus) {
62
+ const anchorObj = currentAnchorList.value.find((fieldItem) => scrollLeft < (fieldItem == null ? void 0 : fieldItem.left));
63
+ if (anchorObj) {
64
+ anchorValue.value = anchorObj.field;
65
+ }
66
+ }
67
+ }
68
+ const anchorEvent = useThrottleFn(setAnchorValue, 800);
69
+ function onScroll(...params) {
70
+ anchorEvent(...params);
71
+ }
72
+ watch(
73
+ [fieldListRef, anchorList],
74
+ () => {
75
+ initAnchor();
76
+ },
77
+ { immediate: true, deep: true }
78
+ );
79
+ return {
80
+ updateAnchor,
81
+ onScroll,
82
+ currentAnchorList,
83
+ anchorValue
84
+ };
85
+ };
86
+
87
+ export { useAnchor };
@@ -20,10 +20,7 @@ function defaultConfigPlugin() {
20
20
  editConfig: {
21
21
  trigger: "click",
22
22
  mode: "cell",
23
- autoClear: false,
24
- activeMethod({ row }) {
25
- return !row.$__SEPARATE;
26
- }
23
+ autoClear: false
27
24
  },
28
25
  keyboardConfig: { isArrow: true, isDel: true, isEnter: true, isTab: true, isEdit: true, isChecked: true }
29
26
  },