@vue-ui-kit/ant 2.5.10 → 2.5.12-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.
@@ -64,8 +64,18 @@
64
64
  ): void;
65
65
  (event: 'pick', data: { row: D; field: string }): void;
66
66
  (event: 'resetQuery'): void;
67
+ (
68
+ event: 'sortChange',
69
+ value: Map<string, { direction: 'asc' | 'desc' | 'none'; timestamp: number }>,
70
+ ): void;
67
71
  }>();
68
72
 
73
+ const handleSortChange = (
74
+ sortState: Map<string, { direction: 'asc' | 'desc' | 'none'; timestamp: number }>,
75
+ ) => {
76
+ emit('sortChange', sortState);
77
+ };
78
+
69
79
  const { formConfig, pageConfig, columns, toolbarConfig, proxyConfig, config, staticConfig } =
70
80
  toRefs(props);
71
81
  const canvasTableDefaults = getCanvasTableDefaults();
@@ -82,11 +92,17 @@
82
92
  const queryFormData = ref<Partial<F>>({}) as Ref<Partial<F>>;
83
93
 
84
94
  // 只处理 config 的合并,其他属性通过 withDefaults 处理
95
+ // border / scrollbarMode / scrollbarShowDelay 为提升到组件的配置,显式传入时覆盖 config 同名字段
85
96
  const propsWithDefaults = computed(() => ({
86
97
  ...props,
87
98
  config: {
88
99
  ...canvasTableDefaults,
89
100
  ...props.config,
101
+ ...(props.border !== undefined ? { BORDER: props.border } : {}),
102
+ ...(props.scrollbarMode !== undefined ? { scrollbarMode: props.scrollbarMode } : {}),
103
+ ...(props.scrollbarShowDelay !== undefined
104
+ ? { SCROLLBAR_SHOW_DELAY: props.scrollbarShowDelay }
105
+ : {}),
90
106
  },
91
107
  }));
92
108
  const mode = computed<'list' | 'pagination' | 'bad'>(() =>
@@ -671,6 +687,7 @@
671
687
  :data="tableData"
672
688
  :loading="loading.table"
673
689
  @selection-change="handleSelectionChange"
690
+ @sort-change="handleSortChange"
674
691
  >
675
692
  <template v-for="(_, name) in $slots" #[name]="slotProps">
676
693
  <slot :name="name" v-bind="slotProps"></slot>
@@ -32,6 +32,7 @@
32
32
  const emit = defineEmits<{
33
33
  (e: 'change', value: any[]): void; // 需要默认实现change,不能动态绑定
34
34
  (e: 'selectionChange', value: T[]): void;
35
+ (e: 'sortChange', value: Map<string, { direction: 'asc' | 'desc' | 'none'; timestamp: number }>): void;
35
36
  (e: 'ready', value: EVirtTable): void;
36
37
  }>();
37
38
 
@@ -207,6 +208,9 @@
207
208
  selectedRecords.value = selection;
208
209
  emit('selectionChange', selection);
209
210
  });
211
+ eVirtTable.on('sortChange', (sortState) => {
212
+ emit('sortChange', sortState);
213
+ });
210
214
  emit('ready', eVirtTable);
211
215
  applyBorderRadius();
212
216
  themeSyncHandle = bindCanvasTableThemeSync({
@@ -268,7 +272,9 @@
268
272
  { immediate: true },
269
273
  );
270
274
  defineExpose({
271
- $table: eVirtTable,
275
+ get $table() {
276
+ return eVirtTable;
277
+ },
272
278
  selectedRecords: computed(() => selectedRecords.value),
273
279
  reloadData: () => {
274
280
  eVirtTable?.loadData(props.data);
@@ -24,10 +24,10 @@
24
24
  --evt-footer-text-color: #4e5969;
25
25
  --evt-readonly-text-color: #4e5969;
26
26
  /* 默认 14px。font 简写必须是「字重 字号 字体」;表头 bold、表体 normal */
27
- --evt-header-font: bold 14px 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI',
28
- sans-serif;
29
- --evt-body-font: normal 14px 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI',
30
- sans-serif;
27
+ --evt-header-font:
28
+ bold 14px 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
29
+ --evt-body-font:
30
+ normal 14px 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
31
31
  --evt-scroller-color: #dee0e3;
32
32
  --evt-scroller-focus-color: #bbbec4;
33
33
  --evt-edit-bg-color: #fcf6ed;