yc-pro-components 0.0.76 → 0.0.77

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 (58) hide show
  1. package/es/components/index.mjs +1 -0
  2. package/es/components/yc-plus-page/index.d.ts +2 -0
  3. package/es/components/yc-plus-page/index.mjs +1 -0
  4. package/es/components/yc-plus-page/src/index.vue.d.ts +75 -0
  5. package/es/components/yc-plus-page/src/index.vue.mjs +1 -1
  6. package/es/components/yc-plus-page/src/index.vue2.mjs +90 -58
  7. package/es/components/yc-plus-page/src/type.d.ts +9 -0
  8. package/es/hooks/index.d.ts +1 -0
  9. package/es/hooks/index.mjs +1 -0
  10. package/es/hooks/useTableDragScroll.d.ts +35 -0
  11. package/es/hooks/useTableDragScroll.mjs +201 -0
  12. package/es/index.css +9 -9
  13. package/es/index.mjs +1 -0
  14. package/es/version.d.ts +1 -1
  15. package/es/version.mjs +1 -1
  16. package/es/yc-components/version.d.ts +1 -1
  17. package/index.js +290 -60
  18. package/index.min.css +1 -1
  19. package/index.min.js +12 -11
  20. package/index.min.mjs +12 -11
  21. package/index.mjs +290 -61
  22. package/lib/components/index.js +2 -0
  23. package/lib/components/yc-plus-page/index.d.ts +2 -0
  24. package/lib/components/yc-plus-page/index.js +2 -0
  25. package/lib/components/yc-plus-page/src/index.vue.d.ts +75 -0
  26. package/lib/components/yc-plus-page/src/index.vue.js +1 -1
  27. package/lib/components/yc-plus-page/src/index.vue2.js +89 -57
  28. package/lib/components/yc-plus-page/src/type.d.ts +9 -0
  29. package/lib/hooks/index.d.ts +1 -0
  30. package/lib/hooks/index.js +2 -0
  31. package/lib/hooks/useTableDragScroll.d.ts +35 -0
  32. package/lib/hooks/useTableDragScroll.js +203 -0
  33. package/lib/index.css +10 -10
  34. package/lib/index.js +2 -0
  35. package/lib/version.d.ts +1 -1
  36. package/lib/version.js +1 -1
  37. package/lib/yc-components/version.d.ts +1 -1
  38. package/locale/en.js +1 -1
  39. package/locale/en.min.js +1 -1
  40. package/locale/en.min.mjs +1 -1
  41. package/locale/en.mjs +1 -1
  42. package/locale/ja.js +1 -1
  43. package/locale/ja.min.js +1 -1
  44. package/locale/ja.min.mjs +1 -1
  45. package/locale/ja.mjs +1 -1
  46. package/locale/ko.js +1 -1
  47. package/locale/ko.min.js +1 -1
  48. package/locale/ko.min.mjs +1 -1
  49. package/locale/ko.mjs +1 -1
  50. package/locale/zh-cn.js +1 -1
  51. package/locale/zh-cn.min.js +1 -1
  52. package/locale/zh-cn.min.mjs +1 -1
  53. package/locale/zh-cn.mjs +1 -1
  54. package/locale/zh-tw.js +1 -1
  55. package/locale/zh-tw.min.js +1 -1
  56. package/locale/zh-tw.min.mjs +1 -1
  57. package/locale/zh-tw.mjs +1 -1
  58. package/package.json +1 -1
@@ -47,6 +47,7 @@ export { useVirtualScroll } from './virtual-table/src/use-virtual-scroll.mjs';
47
47
  export { DEFAULT_CDN_CONFIG, DEFAULT_YC_CONFIG, YC_CONFIG_KEY } from './yc-config-provider/src/type.mjs';
48
48
  export { useYcAuth, useYcCdn, useYcCdnUrl, useYcComponentConfig, useYcConfig, useYcPerms, useYcShowPageSearch, useYcTranslate } from './yc-config-provider/src/useYcConfig.mjs';
49
49
  export { useHeaderFilter } from './yc-plus-page/src/use-header-filter.mjs';
50
+ export { useTableDragScroll } from '../hooks/useTableDragScroll.mjs';
50
51
  export { useLocalHeaderFilter } from './yc-plus-page/src/use-local-header-filter.mjs';
51
52
  export { DEFAULT_OPERATORS, NO_VALUE_OPERATORS, OPERATOR_CATALOG, OPERATOR_LABELS } from './yc-plus-page/src/constants.mjs';
52
53
  export { default as ReSelectV2, default as YcSelectV2 } from './yc-select-v2/src/index.vue.mjs';
@@ -4,6 +4,8 @@ import { DefineComponent } from 'vue';
4
4
  export type { YcPlusPageProps, FieldCatalogItem, FieldCatalog, OperatorOption, HeaderFilterConfig, ColumnHeaderFilterConfig, HeaderFilterPayload, HeaderFilterResetPayload, FilterItem, HeaderFiltersState, OrderByItem, RequestResponse } from './src/type';
5
5
  export { useHeaderFilter } from './src/use-header-filter';
6
6
  export type { UseHeaderFilterOptions, UseHeaderFilterReturn } from './src/use-header-filter';
7
+ export type { UseTableDragScrollOptions, UseTableDragScrollReturn, TableLikeRef } from '../../hooks/useTableDragScroll';
8
+ export { useTableDragScroll } from '../../hooks/useTableDragScroll';
7
9
  export { useLocalHeaderFilter } from './src/use-local-header-filter';
8
10
  export type { LocalFilterColumnConfig, UseLocalHeaderFilterOptions, UseLocalHeaderFilterReturn } from './src/use-local-header-filter';
9
11
  export { OPERATOR_CATALOG, OPERATOR_LABELS, NO_VALUE_OPERATORS, DEFAULT_OPERATORS } from './src/constants';
@@ -1,6 +1,7 @@
1
1
  import YcPlusPageComponent from './src/index.vue.mjs';
2
2
  import YcTableHeaderFilterCellComponent from './src/header-filter-cell.vue.mjs';
3
3
  export { useHeaderFilter } from './src/use-header-filter.mjs';
4
+ export { useTableDragScroll } from '../../hooks/useTableDragScroll.mjs';
4
5
  export { useLocalHeaderFilter } from './src/use-local-header-filter.mjs';
5
6
  export { DEFAULT_OPERATORS, NO_VALUE_OPERATORS, OPERATOR_CATALOG, OPERATOR_LABELS } from './src/constants.mjs';
6
7
 
@@ -8,6 +8,7 @@ import { RequestResponse, HeaderFilterConfig, HeaderFilterPayload, HeaderFilterR
8
8
  import { FieldValues, OmitTypes, CascaderProps, FormItemValueType, FieldValueType } from 'yc-pro-components/es/types/form';
9
9
  import { PlusSearchSelfProps } from 'yc-pro-components/es/components/search';
10
10
  import { PageInfo, PlusColumn, PropsItemType, OptionsType, RenderTypes, OptionsRow } from 'yc-pro-components/es/types/plus';
11
+ import { UseTableDragScrollOptions } from 'yc-pro-components/es/hooks/useTableDragScroll';
11
12
  import { nextTick, DefineComponent, Ref, ComponentInternalInstance, CSSProperties, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, PropType, Slot, ComponentPublicInstance, ComponentOptionsBase, Component, ComponentOptionsMixin, DebuggerEvent, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, ComputedRef, ShallowRef, PublicProps } from 'vue';
12
13
 
13
14
  /**
@@ -69,6 +70,14 @@ interface Props {
69
70
  * @description 不传时使用 YcConfigProvider 的 components.plusPage.columnSettingsText,再缺省为「字段管理」
70
71
  */
71
72
  columnSettingsText?: string;
73
+ /**
74
+ * 是否启用表格横向拖拽滚动
75
+ * - true: 使用默认配置启用
76
+ * - 对象: 自定义配置(resizeAreaWidth / scrollContainerSelector 等)
77
+ * - false / 不传: 关闭(默认)
78
+ * @default false
79
+ */
80
+ dragScroll?: boolean | UseTableDragScrollOptions;
72
81
  }
73
82
  declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
74
83
  isCard: boolean;
@@ -85,6 +94,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
85
94
  columnCacheKey: undefined;
86
95
  disableColumnCache: boolean;
87
96
  columnSettingsText: undefined;
97
+ dragScroll: boolean;
88
98
  }>, {
89
99
  plusPageRef: Ref<({
90
100
  $: ComponentInternalInstance;
@@ -1201,6 +1211,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
1201
1211
  } & RecordType>>;
1202
1212
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
1203
1213
  [key: string]: any;
1214
+ /**
1215
+ * 使用表头筛选 Hook
1216
+ * 使用 getter 函数传递 props 以保持响应性
1217
+ */
1204
1218
  style?: CSSProperties | undefined;
1205
1219
  }>;
1206
1220
  readonly fieldProps: PropsItemType<Partial<{
@@ -1309,6 +1323,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
1309
1323
  } & RecordType>>;
1310
1324
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
1311
1325
  [key: string]: any;
1326
+ /**
1327
+ * 使用表头筛选 Hook
1328
+ * 使用 getter 函数传递 props 以保持响应性
1329
+ */
1312
1330
  style?: CSSProperties | undefined;
1313
1331
  }>;
1314
1332
  readonly fieldProps: PropsItemType<Partial<{
@@ -2105,6 +2123,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
2105
2123
  } & RecordType>>;
2106
2124
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
2107
2125
  [key: string]: any;
2126
+ /**
2127
+ * 使用表头筛选 Hook
2128
+ * 使用 getter 函数传递 props 以保持响应性
2129
+ */
2108
2130
  style?: CSSProperties | undefined;
2109
2131
  }>;
2110
2132
  readonly fieldProps: PropsItemType<Partial<{
@@ -2213,6 +2235,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
2213
2235
  } & RecordType>>;
2214
2236
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
2215
2237
  [key: string]: any;
2238
+ /**
2239
+ * 使用表头筛选 Hook
2240
+ * 使用 getter 函数传递 props 以保持响应性
2241
+ */
2216
2242
  style?: CSSProperties | undefined;
2217
2243
  }>;
2218
2244
  readonly fieldProps: PropsItemType<Partial<{
@@ -2339,6 +2365,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
2339
2365
  } & RecordType>>;
2340
2366
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
2341
2367
  [key: string]: any;
2368
+ /**
2369
+ * 使用表头筛选 Hook
2370
+ * 使用 getter 函数传递 props 以保持响应性
2371
+ */
2342
2372
  style?: CSSProperties | undefined;
2343
2373
  }>;
2344
2374
  readonly fieldProps: PropsItemType<Partial<{
@@ -2451,6 +2481,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
2451
2481
  columns: PlusColumn[];
2452
2482
  headerCellStyle: Partial< CSSProperties> | Partial<(data: {
2453
2483
  row: any[];
2484
+ /** 分页配置 */
2454
2485
  rowIndex: number;
2455
2486
  column: TableColumnCtx<any[]>;
2456
2487
  columnIndex: number;
@@ -2498,6 +2529,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
2498
2529
  readonly columns: PlusColumn[];
2499
2530
  readonly headerCellStyle: Partial< CSSProperties> | Partial<(data: {
2500
2531
  row: any[];
2532
+ /** 分页配置 */
2501
2533
  rowIndex: number;
2502
2534
  column: TableColumnCtx<any[]>;
2503
2535
  columnIndex: number;
@@ -2568,6 +2600,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
2568
2600
  headerCellStyle: {
2569
2601
  type: PropType<Partial< CSSProperties> | Partial<(data: {
2570
2602
  row: any[];
2603
+ /** 分页配置 */
2571
2604
  rowIndex: number;
2572
2605
  column: TableColumnCtx<any[]>;
2573
2606
  columnIndex: number;
@@ -2731,6 +2764,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
2731
2764
  headerCellStyle: {
2732
2765
  type: PropType<Partial< CSSProperties> | Partial<(data: {
2733
2766
  row: any[];
2767
+ /** 分页配置 */
2734
2768
  rowIndex: number;
2735
2769
  column: TableColumnCtx<any[]>;
2736
2770
  columnIndex: number;
@@ -2885,6 +2919,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
2885
2919
  columns: PlusColumn[];
2886
2920
  headerCellStyle: Partial< CSSProperties> | Partial<(data: {
2887
2921
  row: any[];
2922
+ /** 分页配置 */
2888
2923
  rowIndex: number;
2889
2924
  column: TableColumnCtx<any[]>;
2890
2925
  columnIndex: number;
@@ -2962,6 +2997,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
2962
2997
  headerCellStyle: {
2963
2998
  type: PropType<Partial< CSSProperties> | Partial<(data: {
2964
2999
  row: any[];
3000
+ /** 分页配置 */
2965
3001
  rowIndex: number;
2966
3002
  column: TableColumnCtx<any[]>;
2967
3003
  columnIndex: number;
@@ -4652,6 +4688,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
4652
4688
  } & RecordType>>;
4653
4689
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
4654
4690
  [key: string]: any;
4691
+ /**
4692
+ * 使用表头筛选 Hook
4693
+ * 使用 getter 函数传递 props 以保持响应性
4694
+ */
4655
4695
  style?: CSSProperties | undefined;
4656
4696
  }>;
4657
4697
  readonly fieldProps: PropsItemType<Partial<{
@@ -4760,6 +4800,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
4760
4800
  } & RecordType>>;
4761
4801
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
4762
4802
  [key: string]: any;
4803
+ /**
4804
+ * 使用表头筛选 Hook
4805
+ * 使用 getter 函数传递 props 以保持响应性
4806
+ */
4763
4807
  style?: CSSProperties | undefined;
4764
4808
  }>;
4765
4809
  readonly fieldProps: PropsItemType<Partial<{
@@ -5556,6 +5600,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
5556
5600
  } & RecordType>>;
5557
5601
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
5558
5602
  [key: string]: any;
5603
+ /**
5604
+ * 使用表头筛选 Hook
5605
+ * 使用 getter 函数传递 props 以保持响应性
5606
+ */
5559
5607
  style?: CSSProperties | undefined;
5560
5608
  }>;
5561
5609
  readonly fieldProps: PropsItemType<Partial<{
@@ -5664,6 +5712,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
5664
5712
  } & RecordType>>;
5665
5713
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
5666
5714
  [key: string]: any;
5715
+ /**
5716
+ * 使用表头筛选 Hook
5717
+ * 使用 getter 函数传递 props 以保持响应性
5718
+ */
5667
5719
  style?: CSSProperties | undefined;
5668
5720
  }>;
5669
5721
  readonly fieldProps: PropsItemType<Partial<{
@@ -5790,6 +5842,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
5790
5842
  } & RecordType>>;
5791
5843
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
5792
5844
  [key: string]: any;
5845
+ /**
5846
+ * 使用表头筛选 Hook
5847
+ * 使用 getter 函数传递 props 以保持响应性
5848
+ */
5793
5849
  style?: CSSProperties | undefined;
5794
5850
  }>;
5795
5851
  readonly fieldProps: PropsItemType<Partial<{
@@ -5902,6 +5958,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
5902
5958
  columns: PlusColumn[];
5903
5959
  headerCellStyle: Partial< CSSProperties> | Partial<(data: {
5904
5960
  row: any[];
5961
+ /** 分页配置 */
5905
5962
  rowIndex: number;
5906
5963
  column: TableColumnCtx<any[]>;
5907
5964
  columnIndex: number;
@@ -5949,6 +6006,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
5949
6006
  readonly columns: PlusColumn[];
5950
6007
  readonly headerCellStyle: Partial< CSSProperties> | Partial<(data: {
5951
6008
  row: any[];
6009
+ /** 分页配置 */
5952
6010
  rowIndex: number;
5953
6011
  column: TableColumnCtx<any[]>;
5954
6012
  columnIndex: number;
@@ -6019,6 +6077,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
6019
6077
  headerCellStyle: {
6020
6078
  type: PropType<Partial< CSSProperties> | Partial<(data: {
6021
6079
  row: any[];
6080
+ /** 分页配置 */
6022
6081
  rowIndex: number;
6023
6082
  column: TableColumnCtx<any[]>;
6024
6083
  columnIndex: number;
@@ -6182,6 +6241,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
6182
6241
  headerCellStyle: {
6183
6242
  type: PropType<Partial< CSSProperties> | Partial<(data: {
6184
6243
  row: any[];
6244
+ /** 分页配置 */
6185
6245
  rowIndex: number;
6186
6246
  column: TableColumnCtx<any[]>;
6187
6247
  columnIndex: number;
@@ -6336,6 +6396,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
6336
6396
  columns: PlusColumn[];
6337
6397
  headerCellStyle: Partial< CSSProperties> | Partial<(data: {
6338
6398
  row: any[];
6399
+ /** 分页配置 */
6339
6400
  rowIndex: number;
6340
6401
  column: TableColumnCtx<any[]>;
6341
6402
  columnIndex: number;
@@ -6413,6 +6474,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
6413
6474
  headerCellStyle: {
6414
6475
  type: PropType<Partial< CSSProperties> | Partial<(data: {
6415
6476
  row: any[];
6477
+ /** 分页配置 */
6416
6478
  rowIndex: number;
6417
6479
  column: TableColumnCtx<any[]>;
6418
6480
  columnIndex: number;
@@ -7140,6 +7202,10 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
7140
7202
  } & RecordType>>;
7141
7203
  readonly formItemProps: PropsItemType< Mutable<FormItemProps> & {
7142
7204
  [key: string]: any;
7205
+ /**
7206
+ * 使用表头筛选 Hook
7207
+ * 使用 getter 函数传递 props 以保持响应性
7208
+ */
7143
7209
  style?: CSSProperties | undefined;
7144
7210
  }>;
7145
7211
  readonly fieldProps: PropsItemType<Partial<{
@@ -7270,6 +7336,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
7270
7336
  columns: PlusColumn[];
7271
7337
  headerCellStyle: Partial< CSSProperties> | Partial<(data: {
7272
7338
  row: any[];
7339
+ /** 分页配置 */
7273
7340
  rowIndex: number;
7274
7341
  column: TableColumnCtx<any[]>;
7275
7342
  columnIndex: number;
@@ -7317,6 +7384,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
7317
7384
  readonly columns: PlusColumn[];
7318
7385
  readonly headerCellStyle: Partial< CSSProperties> | Partial<(data: {
7319
7386
  row: any[];
7387
+ /** 分页配置 */
7320
7388
  rowIndex: number;
7321
7389
  column: TableColumnCtx<any[]>;
7322
7390
  columnIndex: number;
@@ -7387,6 +7455,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
7387
7455
  headerCellStyle: {
7388
7456
  type: PropType<Partial< CSSProperties> | Partial<(data: {
7389
7457
  row: any[];
7458
+ /** 分页配置 */
7390
7459
  rowIndex: number;
7391
7460
  column: TableColumnCtx<any[]>;
7392
7461
  columnIndex: number;
@@ -7550,6 +7619,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
7550
7619
  headerCellStyle: {
7551
7620
  type: PropType<Partial< CSSProperties> | Partial<(data: {
7552
7621
  row: any[];
7622
+ /** 分页配置 */
7553
7623
  rowIndex: number;
7554
7624
  column: TableColumnCtx<any[]>;
7555
7625
  columnIndex: number;
@@ -7704,6 +7774,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
7704
7774
  columns: PlusColumn[];
7705
7775
  headerCellStyle: Partial< CSSProperties> | Partial<(data: {
7706
7776
  row: any[];
7777
+ /** 分页配置 */
7707
7778
  rowIndex: number;
7708
7779
  column: TableColumnCtx<any[]>;
7709
7780
  columnIndex: number;
@@ -7781,6 +7852,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
7781
7852
  headerCellStyle: {
7782
7853
  type: PropType<Partial< CSSProperties> | Partial<(data: {
7783
7854
  row: any[];
7855
+ /** 分页配置 */
7784
7856
  rowIndex: number;
7785
7857
  column: TableColumnCtx<any[]>;
7786
7858
  columnIndex: number;
@@ -7961,6 +8033,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
7961
8033
  resetAllHeaderFilters: (defaults?: {
7962
8034
  field: string;
7963
8035
  op: string;
8036
+ /** 表格卡片属性配置 */
7964
8037
  value?: string | undefined;
7965
8038
  }[] | undefined) => void;
7966
8039
  getList: () => Promise<void> | undefined;
@@ -7997,6 +8070,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
7997
8070
  columnCacheKey: undefined;
7998
8071
  disableColumnCache: boolean;
7999
8072
  columnSettingsText: undefined;
8073
+ dragScroll: boolean;
8000
8074
  }>>> & {
8001
8075
  "onHeader-filter-confirm"?: ((payload: HeaderFilterPayload) => any) | undefined;
8002
8076
  "onHeader-filter-reset"?: ((payload: HeaderFilterResetPayload) => any) | undefined;
@@ -8011,6 +8085,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
8011
8085
  hideColumnSettingsIcon: boolean;
8012
8086
  columnCacheKey: string;
8013
8087
  disableColumnCache: boolean;
8088
+ dragScroll: boolean | UseTableDragScrollOptions;
8014
8089
  }, {}>, Partial<Record<NonNullable<string | number>, (_: any) => any>> & {
8015
8090
  "column-settings-icon"?(_: {}): any;
8016
8091
  default?(_: {}): any;
@@ -1,6 +1,6 @@
1
1
  import _sfc_main from './index.vue2.mjs';
2
2
  import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
3
3
 
4
- var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-73380467"], ["__file", "index.vue"]]);
4
+ var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3ce473db"], ["__file", "index.vue"]]);
5
5
 
6
6
  export { YcPlusPageComponent as default };
@@ -1,7 +1,8 @@
1
- import { defineComponent, ref, computed, useSlots, h, watch, onMounted, nextTick, onUnmounted, openBlock, createElementBlock, normalizeClass, createVNode, unref, mergeProps, createSlots, withCtx, renderSlot, createElementVNode, toDisplayString, renderList, normalizeProps, createCommentVNode } from 'vue';
1
+ import { defineComponent, ref, computed, useSlots, h, watch, onMounted, nextTick, onUnmounted, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, unref, createVNode, mergeProps, createSlots, withCtx, renderSlot, toDisplayString, renderList, normalizeProps } from 'vue';
2
2
  import { merge } from 'lodash-es';
3
3
  import { PlusPage } from '../../page/index.mjs';
4
4
  import YcSvgIcon from '../../yc-svg-icon/src/index.vue.mjs';
5
+ import { useTableDragScroll } from '../../../hooks/useTableDragScroll.mjs';
5
6
  import { useHeaderFilter } from './use-header-filter.mjs';
6
7
  import YcTableHeaderFilterCellComponent from './header-filter-cell.vue.mjs';
7
8
  import { useYcShowPageSearch, useYcCdnUrl, useYcComponentConfig } from '../../yc-config-provider/src/useYcConfig.mjs';
@@ -35,7 +36,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
35
36
  hideHeaderFilter: { type: Boolean, default: true },
36
37
  columnCacheKey: { default: void 0 },
37
38
  disableColumnCache: { type: Boolean, default: false },
38
- columnSettingsText: { default: void 0 }
39
+ columnSettingsText: { default: void 0 },
40
+ dragScroll: { type: [Boolean, Object], default: false }
39
41
  },
40
42
  emits: ["header-filter-confirm", "header-filter-reset"],
41
43
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -46,6 +48,21 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
46
48
  const plusPageConfig = useYcComponentConfig("plusPage");
47
49
  const plusPageRef = ref();
48
50
  const rootRef = ref();
51
+ const dragScrollWrapperRef = ref(null);
52
+ const dragScrollEnabled = computed(() => props.dragScroll !== false && props.dragScroll != null);
53
+ const dragScrollOptions = computed(() => {
54
+ const value = props.dragScroll;
55
+ if (value && typeof value === "object") return value;
56
+ return {};
57
+ });
58
+ const { onMouseDown: onDragScrollMouseDown } = useTableDragScroll(
59
+ dragScrollWrapperRef,
60
+ void 0,
61
+ {
62
+ ...dragScrollOptions.value,
63
+ enabled: dragScrollEnabled
64
+ }
65
+ );
49
66
  const plusTableInstance = computed(() => {
50
67
  var _a;
51
68
  return (_a = plusPageRef.value) == null ? void 0 : _a.plusTableInstance;
@@ -463,6 +480,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
463
480
  void resolvedColumnSettingsText.value;
464
481
  void hasRequest.value;
465
482
  void showDefaultColumnSettingsIcon.value;
483
+ void dragScrollEnabled.value;
466
484
  __expose({
467
485
  plusPageRef,
468
486
  plusTableInstance,
@@ -520,62 +538,76 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
520
538
  class: normalizeClass(["yc-plus-page", { "yc-plus-page--borderless": isBorderless.value }])
521
539
  },
522
540
  [
523
- createVNode(unref(PlusPage), mergeProps({
524
- ref_key: "plusPageRef",
525
- ref: plusPageRef
526
- }, { ...props, ..._ctx.$attrs }, {
527
- columns: enhancedColumns.value,
528
- "is-card": _ctx.isCard,
529
- request: wrappedRequest.value,
530
- search: mergedSearch.value,
531
- "search-card-props": mergedSearchCardProps.value,
532
- "table-card-props": mergedTableCardProps.value,
533
- table: mergedTable.value,
534
- pagination: mergedPagination.value,
535
- "default-page-info": { page: 1, pageSize: DEFAULT_PAGE_SIZE },
536
- onFilterTableHeader: handleFilterTableHeader,
537
- onHeaderDragend: handleHeaderDragend
538
- }), createSlots({
539
- default: withCtx(() => [
540
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
541
- ]),
542
- _: 2
543
- /* DYNAMIC */
544
- }, [
545
- _ctx.$slots["column-settings-icon"] ? {
546
- name: "column-settings-icon",
547
- fn: withCtx(() => [
548
- renderSlot(_ctx.$slots, "column-settings-icon", {}, void 0, true)
549
- ]),
550
- key: "0"
551
- } : showDefaultColumnSettingsIcon.value ? {
552
- name: "column-settings-icon",
553
- fn: withCtx(() => [
554
- createElementVNode("div", { class: "column-settings-wrapper" }, [
555
- createVNode(unref(YcSvgIcon), {
556
- src: fieldSettingIconUrl.value,
557
- size: 16
558
- }, null, 8, ["src"]),
559
- createElementVNode(
560
- "span",
561
- { class: "column-settings-text" },
562
- toDisplayString(resolvedColumnSettingsText.value),
563
- 1
564
- /* TEXT */
565
- )
566
- ])
567
- ]),
568
- key: "1"
569
- } : void 0,
570
- renderList(_ctx.$slots, (_, name) => {
571
- return {
572
- name,
573
- fn: withCtx((slotProps) => [
574
- name !== "column-settings-icon" && name !== "default" ? renderSlot(_ctx.$slots, name, normalizeProps(mergeProps({ key: 0 }, slotProps)), void 0, true) : createCommentVNode("v-if", true)
575
- ])
576
- };
577
- })
578
- ]), 1040, ["columns", "is-card", "request", "search", "search-card-props", "table-card-props", "table", "pagination", "default-page-info"])
541
+ createCommentVNode(" \u62D6\u62FD\u6EDA\u52A8\u5305\u88F9\u5C42\uFF1AdragScroll \u542F\u7528\u65F6\u4ECB\u5165\uFF0C\u4F46\u59CB\u7EC8\u4FDD\u7559 ref\uFF0C\n \u4EE5\u4FDD\u8BC1 mousedown \u900F\u4F20 + hook \u5185\u90E8 DOM \u67E5\u8BE2\u6B63\u5E38 "),
542
+ createElementVNode(
543
+ "div",
544
+ {
545
+ ref_key: "dragScrollWrapperRef",
546
+ ref: dragScrollWrapperRef,
547
+ class: normalizeClass(["yc-plus-page__drag-wrapper", { "yc-plus-page__drag-wrapper--enabled": dragScrollEnabled.value }]),
548
+ onMousedown: _cache[0] || (_cache[0] = ($event) => dragScrollEnabled.value ? unref(onDragScrollMouseDown)($event) : void 0)
549
+ },
550
+ [
551
+ createVNode(unref(PlusPage), mergeProps({
552
+ ref_key: "plusPageRef",
553
+ ref: plusPageRef
554
+ }, { ...props, ..._ctx.$attrs }, {
555
+ columns: enhancedColumns.value,
556
+ "is-card": _ctx.isCard,
557
+ request: wrappedRequest.value,
558
+ search: mergedSearch.value,
559
+ "search-card-props": mergedSearchCardProps.value,
560
+ "table-card-props": mergedTableCardProps.value,
561
+ table: mergedTable.value,
562
+ pagination: mergedPagination.value,
563
+ "default-page-info": { page: 1, pageSize: DEFAULT_PAGE_SIZE },
564
+ onFilterTableHeader: handleFilterTableHeader,
565
+ onHeaderDragend: handleHeaderDragend
566
+ }), createSlots({
567
+ default: withCtx(() => [
568
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
569
+ ]),
570
+ _: 2
571
+ /* DYNAMIC */
572
+ }, [
573
+ _ctx.$slots["column-settings-icon"] ? {
574
+ name: "column-settings-icon",
575
+ fn: withCtx(() => [
576
+ renderSlot(_ctx.$slots, "column-settings-icon", {}, void 0, true)
577
+ ]),
578
+ key: "0"
579
+ } : showDefaultColumnSettingsIcon.value ? {
580
+ name: "column-settings-icon",
581
+ fn: withCtx(() => [
582
+ createElementVNode("div", { class: "column-settings-wrapper" }, [
583
+ createVNode(unref(YcSvgIcon), {
584
+ src: fieldSettingIconUrl.value,
585
+ size: 16
586
+ }, null, 8, ["src"]),
587
+ createElementVNode(
588
+ "span",
589
+ { class: "column-settings-text" },
590
+ toDisplayString(resolvedColumnSettingsText.value),
591
+ 1
592
+ /* TEXT */
593
+ )
594
+ ])
595
+ ]),
596
+ key: "1"
597
+ } : void 0,
598
+ renderList(_ctx.$slots, (_, name) => {
599
+ return {
600
+ name,
601
+ fn: withCtx((slotProps) => [
602
+ name !== "column-settings-icon" && name !== "default" ? renderSlot(_ctx.$slots, name, normalizeProps(mergeProps({ key: 0 }, slotProps)), void 0, true) : createCommentVNode("v-if", true)
603
+ ])
604
+ };
605
+ })
606
+ ]), 1040, ["columns", "is-card", "request", "search", "search-card-props", "table-card-props", "table", "pagination", "default-page-info"])
607
+ ],
608
+ 34
609
+ /* CLASS, NEED_HYDRATION */
610
+ )
579
611
  ],
580
612
  2
581
613
  /* CLASS */
@@ -1,3 +1,4 @@
1
+ import { UseTableDragScrollOptions } from 'yc-pro-components/es/hooks/useTableDragScroll';
1
2
  import { PlusPageProps } from 'yc-pro-components/es/components/page';
2
3
  import { FieldValues } from 'yc-pro-components/es/types/form';
3
4
  import { PlusColumn, PageInfo } from 'yc-pro-components/es/types/plus';
@@ -178,6 +179,14 @@ export interface YcPlusPageProps extends /* @vue-ignore */ Omit<Partial<PlusPage
178
179
  * @default true(默认隐藏)
179
180
  */
180
181
  hideHeaderFilter?: boolean;
182
+ /**
183
+ * 是否启用表格横向拖拽滚动
184
+ * - true: 使用默认配置启用
185
+ * - 对象: 自定义 useTableDragScroll 配置(resizeAreaWidth / scrollContainerSelector 等)
186
+ * - false / 不传: 关闭(默认)
187
+ * @default false
188
+ */
189
+ dragScroll?: boolean | UseTableDragScrollOptions;
181
190
  }
182
191
  /**
183
192
  * 列设置缓存数据
@@ -7,3 +7,4 @@ export * from './useSortableDrag';
7
7
  export * from './usePlusFormReset';
8
8
  export * from './useSelectWithPagination';
9
9
  export * from './useDictInjection';
10
+ export * from './useTableDragScroll';
@@ -7,3 +7,4 @@ export { useSortableDrag } from './useSortableDrag.mjs';
7
7
  export { usePlusFormClearValidate, usePlusFormFullReset, usePlusFormReset } from './usePlusFormReset.mjs';
8
8
  export { useSelectWithPagination } from './useSelectWithPagination.mjs';
9
9
  export { useDictInjection } from './useDictInjection.mjs';
10
+ export { useTableDragScroll } from './useTableDragScroll.mjs';
@@ -0,0 +1,35 @@
1
+ import { Ref } from 'vue';
2
+
3
+ /** Element Plus 表格 ref 形状(只用到 $el) */
4
+ export interface TableLikeRef {
5
+ $el?: HTMLElement;
6
+ }
7
+ /** useTableDragScroll 配置项 */
8
+ export interface UseTableDragScrollOptions {
9
+ /** 是否启用,默认 true */
10
+ enabled?: Ref<boolean> | boolean;
11
+ /** resize 检测区域宽度(px),默认 12 */
12
+ resizeAreaWidth?: number;
13
+ /** 列宽 resize 时高亮边框颜色,默认 var(--theme-color) */
14
+ resizeBorderColor?: string;
15
+ /** 滚动容器选择器,默认 .el-scrollbar__wrap */
16
+ scrollContainerSelector?: string;
17
+ }
18
+ /** useTableDragScroll 返回值 */
19
+ export interface UseTableDragScrollReturn {
20
+ /** 绑定到外层 wrapper 的 mousedown 处理函数 */
21
+ onMouseDown: (e: MouseEvent) => void;
22
+ /** 是否处于拖拽中 */
23
+ isDragging: Ref<boolean>;
24
+ /** 是否处于列宽 resize 中 */
25
+ isResizing: Ref<boolean>;
26
+ /** 手动刷新内部 scroll 容器(异步渲染时可用) */
27
+ refreshScrollContainer: () => void;
28
+ }
29
+ /**
30
+ * 表格横向拖拽滚动 Hook
31
+ * @param wrapperRef 外层包裹元素 ref(绑定 mousedown)
32
+ * @param tableRef 可选:Element Plus el-table 的 ref;不传时在 wrapper 内查找 .el-table
33
+ * @param options 可选配置
34
+ */
35
+ export declare function useTableDragScroll(wrapperRef: Ref<HTMLElement | null | undefined>, tableRef?: Ref<TableLikeRef | null | undefined>, options?: UseTableDragScrollOptions): UseTableDragScrollReturn;