@vue-ui-kit/ant 2.5.9 → 2.5.11

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.
package/dist/index.d.ts CHANGED
@@ -268,6 +268,10 @@ declare type BodyOptions = {
268
268
  data: any[];
269
269
  };
270
270
 
271
+ export declare type BorderConfigValue = boolean | BorderStyle;
272
+
273
+ export declare type BorderStyle = 'default' | 'outer' | 'inner' | 'none';
274
+
271
275
  export declare interface CanvasColumnProps<T extends Recordable = Recordable> extends Omit<Column, 'children' | 'formatter' | 'key'> {
272
276
  key?: string;
273
277
  field?: string;
@@ -419,6 +423,7 @@ declare class Cell extends BaseCell {
419
423
  userSelect: string;
420
424
  };
421
425
  drawContainer(): void;
426
+ drawHorizontalBorder(): void;
422
427
  private drawAutofillPiont;
423
428
  draw(): void;
424
429
  /**
@@ -703,7 +708,7 @@ declare class Config {
703
708
  /** 单元格字体 */
704
709
  BODY_FONT: string;
705
710
  /** 边框 */
706
- BORDER: boolean;
711
+ BORDER: BorderConfigValue;
707
712
  /** 斑马纹 */
708
713
  STRIPE: boolean;
709
714
  /** 斑马纹颜色 */
@@ -790,6 +795,10 @@ declare class Config {
790
795
  ENABLE_ZOOM_WHEEL: boolean;
791
796
  /** 滚动条轨道尺寸 */
792
797
  SCROLLER_TRACK_SIZE: number;
798
+ /** 滚动条模式,outer 为外部预留区域,inner 为覆盖在内容上 */
799
+ scrollbarMode: ScrollbarMode_2;
800
+ /** 内部滚动条悬停后显示延迟 */
801
+ SCROLLBAR_SHOW_DELAY: number;
793
802
  /** 滚动条滑块尺寸 */
794
803
  SCROLLER_SIZE: number;
795
804
  /** 滚动条滑块颜色 */
@@ -1609,6 +1618,7 @@ declare class EVirtTable {
1609
1618
  constructor(target: HTMLDivElement, options: EVirtTableOptions);
1610
1619
  private createContainer;
1611
1620
  private doDraw;
1621
+ private updateStageBorder;
1612
1622
  draw(ignoreOverlayer?: boolean): void;
1613
1623
  loadConfig(_config: ConfigType): void;
1614
1624
  loadColumns(columns: Column[]): void;
@@ -2857,6 +2867,27 @@ export declare interface PCanvasGridProps<D extends Recordable = Recordable, F e
2857
2867
  pageConfig?: PageConfig;
2858
2868
  proxyConfig?: ProxyConfig<D, F>;
2859
2869
  config?: ConfigType;
2870
+ /**
2871
+ * 表格边框样式,映射 e-virt-table `BORDER`。
2872
+ * - `true` / `'default'`:完整单元格边框
2873
+ * - `'outer'`:仅外边框
2874
+ * - `'inner'` / `false`:仅内部横线
2875
+ * - `'none'`:无边框
2876
+ * 显式传入时优先于 `config.BORDER`。
2877
+ */
2878
+ border?: BorderConfigValue;
2879
+ /**
2880
+ * 滚动条模式,映射 e-virt-table `scrollbarMode`。
2881
+ * - `'outer'`:外部预留滚动条轨道(默认)
2882
+ * - `'inner'`:覆盖在内容上,悬停表格内部后显示
2883
+ * 显式传入时优先于 `config.scrollbarMode`。
2884
+ */
2885
+ scrollbarMode?: ScrollbarMode;
2886
+ /**
2887
+ * 内部滚动条(`scrollbarMode: 'inner'`)悬停后显示延迟(ms),映射 `SCROLLBAR_SHOW_DELAY`。
2888
+ * 显式传入时优先于 `config.SCROLLBAR_SHOW_DELAY`。
2889
+ */
2890
+ scrollbarShowDelay?: number;
2860
2891
  lazyReset?: boolean;
2861
2892
  /**
2862
2893
  * 适应展示区到页面顶部的高度,通常和容器最上的y值有关(正比)
@@ -5114,6 +5145,8 @@ declare class Row {
5114
5145
  drawFixed(): void;
5115
5146
  drawContainer(): void;
5116
5147
  drawFixedContainer(): void;
5148
+ drawHorizontalBorder(): void;
5149
+ drawFixedHorizontalBorder(): void;
5117
5150
  }
5118
5151
 
5119
5152
  declare type RowMaxHeightData = {
@@ -5152,6 +5185,11 @@ declare type Rules = Rule[];
5152
5185
 
5153
5186
  declare type RuleValidator = (rule: Rule, value: any, callback: (message?: string) => void) => void;
5154
5187
 
5188
+ /** 与 e-virt-table `scrollbarMode` 对齐:`outer` 外部预留,`inner` 内部悬停显示 */
5189
+ export declare type ScrollbarMode = 'outer' | 'inner';
5190
+
5191
+ declare type ScrollbarMode_2 = 'outer' | 'inner';
5192
+
5155
5193
  declare type ScrollBehavior_2 = 'auto' | 'smooth';
5156
5194
 
5157
5195
  declare type ScrollLogicalPosition_2 = 'start' | 'center' | 'end' | 'nearest';
package/dist/style.css CHANGED
@@ -18,11 +18,16 @@
18
18
  --evt-error-tip-icon-color: var(--p-danger-color, #f5222d);
19
19
  --evt-readonly-color: var(--p-table-row-bg-color, #fff);
20
20
  --evt-scroller-track-color: var(--p-table-row-bg-color, #fff);
21
- /* Canvas 专用(白天 = storybook 默认值) */
21
+ /* Canvas 文字色:storybook 默认;业务项目请在 variables 映射 --primary-text-color 等覆盖 */
22
22
  --evt-header-text-color: #1d2129;
23
23
  --evt-body-text-color: #4e5969;
24
24
  --evt-footer-text-color: #4e5969;
25
25
  --evt-readonly-text-color: #4e5969;
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;
26
31
  --evt-scroller-color: #dee0e3;
27
32
  --evt-scroller-focus-color: #bbbec4;
28
33
  --evt-edit-bg-color: #fcf6ed;
@@ -56,6 +61,22 @@ html[theme-mode=dark],
56
61
  --evt-context-menu-item-hover-bg-color: #414243;
57
62
  }
58
63
 
64
+ /* #region EVirtTable overlayer cell */
65
+ .canvas-cell {
66
+ display: flex;
67
+ flex-direction: column;
68
+ justify-content: center;
69
+ align-items: start;
70
+ padding: 0 8px;
71
+ }
72
+
73
+ /* e-virt-table 给 .canvas-cell 写死 userSelect:none;不改单元格本身,只放开插槽后代以便框选文字 */
74
+ .canvas-cell * {
75
+ -webkit-user-select: text !important;
76
+ user-select: text !important;
77
+ }
78
+
79
+ /* #endregion */
59
80
  .p-pane {
60
81
  background-color: var(--p-theme-bg, #fff);
61
82
  padding: 16px;
@@ -415,16 +436,6 @@ html[theme-mode=dark],
415
436
  border-color: var(--p-border-light-color, #f0f0f0);
416
437
  }
417
438
 
418
- /* #endregion */
419
- /* #region EVirtTable */
420
- .canvas-cell {
421
- display: flex;
422
- flex-direction: column;
423
- justify-content: center;
424
- align-items: start;
425
- padding: 0 8px;
426
- }
427
-
428
439
  /* #endregion */
429
440
  /**/
430
441
  .p-content-align-right.ant-form-item .ant-form-item-control-input-content {
package/dist/style.scss CHANGED
@@ -405,16 +405,6 @@
405
405
  }
406
406
  /* #endregion */
407
407
 
408
- /* #region EVirtTable */
409
- .canvas-cell {
410
- display: flex;
411
- flex-direction: column;
412
- justify-content: center;
413
- align-items: start;
414
- padding: 0 8px;
415
- }
416
- /* #endregion */
417
-
418
408
  @each $align in right center {
419
409
  /**/
420
410
  .p-content-align-#{$align}.ant-form-item .ant-form-item-control-input-content {
package/package.json CHANGED
@@ -1,85 +1,85 @@
1
- {
2
- "name": "@vue-ui-kit/ant",
3
- "version": "2.5.9",
4
- "description": "Vue3 UI Kit based on Ant Design",
5
- "type": "module",
6
- "main": "./dist/cjs/index.js",
7
- "module": "./dist/es/index.js",
8
- "types": "./dist/index.d.ts",
9
- "style": "./dist/style.css",
10
- "sass": "./src/packages/styles/index.scss",
11
- "exports": {
12
- ".": {
13
- "require": "./dist/cjs/index.js",
14
- "import": "./dist/es/index.js",
15
- "types": "./dist/index.d.ts"
16
- },
17
- "./style.css": "./dist/style.css",
18
- "./style.scss": "./src/packages/styles/index.scss",
19
- "./dist/style.scss": "./src/packages/styles/index.scss",
20
- "./dist/style.css": "./dist/style.css"
21
- },
22
- "files": [
23
- "dist",
24
- "src",
25
- "README.md",
26
- "README.zh.md",
27
- "tsconfig.json"
28
- ],
29
- "scripts": {
30
- "dev": "ts-patch uninstall && vue-tsc --noEmit --skipLibCheck & vite",
31
- "typecheck": "ts-patch uninstall && vue-tsc --noEmit --skipLibCheck",
32
- "build": "ts-patch install && vite build && sass src/packages/styles/index.scss dist/style.css --no-source-map",
33
- "prepack": "rimraf dist && pnpm build",
34
- "prepare": "husky",
35
- "lint:lint-staged": "lint-staged",
36
- "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\""
37
- },
38
- "keywords": [
39
- "vue3",
40
- "ui kit",
41
- "ant design",
42
- "ant",
43
- "antdv"
44
- ],
45
- "author": {
46
- "name": "adoin",
47
- "email": "adoin@qq.com"
48
- },
49
- "dependencies": {
50
- "e-virt-table": "1.4.2",
51
- "uuid": "^11.1.1",
52
- "xe-utils": "^3.7.6"
53
- },
54
- "peerDependencies": {
55
- "@ant-design/icons-vue": ">=7.0.0",
56
- "ant-design-vue": ">=4.0.0",
57
- "vue": ">=3.2.0"
58
- },
59
- "license": "GPL",
60
- "engines": {
61
- "node": "^20.19.0 || >=22.12.0"
62
- },
63
- "devDependencies": {
64
- "@ant-design/icons-vue": ">=7.0.0",
65
- "@commitlint/cli": "^21.0.0",
66
- "@commitlint/config-conventional": "^21.0.0",
67
- "@vitejs/plugin-vue": "^6.0.5",
68
- "@vitejs/plugin-vue-jsx": "^5.1.5",
69
- "ant-design-vue": "^4.2.3",
70
- "esbuild": "^0.28.0",
71
- "husky": "^9.1.5",
72
- "lint-staged": "^15.2.9",
73
- "prettier": "^3.3.3",
74
- "rimraf": "^6.0.1",
75
- "sass": "^1.77.8",
76
- "scroll-into-view-if-needed": "^2.2.31",
77
- "ts-patch": "^3.2.1",
78
- "typescript-transform-paths": "^3.5.0",
79
- "vite": "^8.0.8",
80
- "vite-plugin-dts": "^4.5.4",
81
- "vue": "^3.5.33",
82
- "vue-tsc": "3.3.5",
83
- "vue-types": "^3.0.2"
84
- }
85
- }
1
+ {
2
+ "name": "@vue-ui-kit/ant",
3
+ "version": "2.5.11",
4
+ "description": "Vue3 UI Kit based on Ant Design",
5
+ "type": "module",
6
+ "main": "./dist/cjs/index.js",
7
+ "module": "./dist/es/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "style": "./dist/style.css",
10
+ "sass": "./src/packages/styles/index.scss",
11
+ "exports": {
12
+ ".": {
13
+ "require": "./dist/cjs/index.js",
14
+ "import": "./dist/es/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ },
17
+ "./style.css": "./dist/style.css",
18
+ "./style.scss": "./src/packages/styles/index.scss",
19
+ "./dist/style.scss": "./src/packages/styles/index.scss",
20
+ "./dist/style.css": "./dist/style.css"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "src",
25
+ "README.md",
26
+ "README.zh.md",
27
+ "tsconfig.json"
28
+ ],
29
+ "scripts": {
30
+ "dev": "ts-patch uninstall && vue-tsc --noEmit --skipLibCheck & vite",
31
+ "typecheck": "ts-patch uninstall && vue-tsc --noEmit --skipLibCheck",
32
+ "build": "ts-patch install && vite build && sass src/packages/styles/index.scss dist/style.css --no-source-map",
33
+ "prepack": "rimraf dist && pnpm build",
34
+ "prepare": "husky",
35
+ "lint:lint-staged": "lint-staged",
36
+ "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\""
37
+ },
38
+ "keywords": [
39
+ "vue3",
40
+ "ui kit",
41
+ "ant design",
42
+ "ant",
43
+ "antdv"
44
+ ],
45
+ "author": {
46
+ "name": "adoin",
47
+ "email": "adoin@qq.com"
48
+ },
49
+ "dependencies": {
50
+ "e-virt-table": "1.4.3",
51
+ "uuid": "^11.1.1",
52
+ "xe-utils": "^3.7.6"
53
+ },
54
+ "peerDependencies": {
55
+ "@ant-design/icons-vue": ">=7.0.0",
56
+ "ant-design-vue": ">=4.0.0",
57
+ "vue": ">=3.2.0"
58
+ },
59
+ "license": "GPL",
60
+ "engines": {
61
+ "node": "^20.19.0 || >=22.12.0"
62
+ },
63
+ "devDependencies": {
64
+ "@ant-design/icons-vue": ">=7.0.0",
65
+ "@commitlint/cli": "^21.0.0",
66
+ "@commitlint/config-conventional": "^21.0.0",
67
+ "@vitejs/plugin-vue": "^6.0.5",
68
+ "@vitejs/plugin-vue-jsx": "^5.1.5",
69
+ "ant-design-vue": "^4.2.3",
70
+ "esbuild": "^0.28.0",
71
+ "husky": "^9.1.5",
72
+ "lint-staged": "^15.2.9",
73
+ "prettier": "^3.3.3",
74
+ "rimraf": "^6.0.1",
75
+ "sass": "^1.77.8",
76
+ "scroll-into-view-if-needed": "^2.2.31",
77
+ "ts-patch": "^3.2.1",
78
+ "typescript-transform-paths": "^3.5.0",
79
+ "vite": "^8.0.8",
80
+ "vite-plugin-dts": "^4.5.4",
81
+ "vue": "^3.5.33",
82
+ "vue-tsc": "3.3.5",
83
+ "vue-types": "^3.0.2"
84
+ }
85
+ }
@@ -3,9 +3,13 @@ import { ButtonProps } from 'ant-design-vue/lib/button';
3
3
  import { ColProps } from 'ant-design-vue/lib/grid/Col';
4
4
  import { FormProps } from 'ant-design-vue/lib/form/Form';
5
5
  import { TableColumnType, TableProps, TooltipProps } from 'ant-design-vue';
6
- import type { ConfigType, Column as EVirtColumn } from 'e-virt-table';
6
+ import type { BorderConfigValue, ConfigType, Column as EVirtColumn } from 'e-virt-table';
7
7
  import EVirtTable from 'e-virt-table';
8
8
 
9
+ export type { BorderConfigValue, BorderStyle } from 'e-virt-table';
10
+ /** 与 e-virt-table `scrollbarMode` 对齐:`outer` 外部预留,`inner` 内部悬停显示 */
11
+ export type ScrollbarMode = 'outer' | 'inner';
12
+
9
13
  export interface CellFuncArg<D extends Recordable = Recordable> {
10
14
  row: D;
11
15
  column?: ColumnProps<D>;
@@ -421,6 +425,27 @@ export interface PCanvasGridProps<
421
425
  pageConfig?: PageConfig;
422
426
  proxyConfig?: ProxyConfig<D, F>;
423
427
  config?: ConfigType;
428
+ /**
429
+ * 表格边框样式,映射 e-virt-table `BORDER`。
430
+ * - `true` / `'default'`:完整单元格边框
431
+ * - `'outer'`:仅外边框
432
+ * - `'inner'` / `false`:仅内部横线
433
+ * - `'none'`:无边框
434
+ * 显式传入时优先于 `config.BORDER`。
435
+ */
436
+ border?: BorderConfigValue;
437
+ /**
438
+ * 滚动条模式,映射 e-virt-table `scrollbarMode`。
439
+ * - `'outer'`:外部预留滚动条轨道(默认)
440
+ * - `'inner'`:覆盖在内容上,悬停表格内部后显示
441
+ * 显式传入时优先于 `config.scrollbarMode`。
442
+ */
443
+ scrollbarMode?: ScrollbarMode;
444
+ /**
445
+ * 内部滚动条(`scrollbarMode: 'inner'`)悬停后显示延迟(ms),映射 `SCROLLBAR_SHOW_DELAY`。
446
+ * 显式传入时优先于 `config.SCROLLBAR_SHOW_DELAY`。
447
+ */
448
+ scrollbarShowDelay?: number;
424
449
  // 重置后不自动提交
425
450
  lazyReset?: boolean;
426
451
  /**
@@ -82,11 +82,17 @@
82
82
  const queryFormData = ref<Partial<F>>({}) as Ref<Partial<F>>;
83
83
 
84
84
  // 只处理 config 的合并,其他属性通过 withDefaults 处理
85
+ // border / scrollbarMode / scrollbarShowDelay 为提升到组件的配置,显式传入时覆盖 config 同名字段
85
86
  const propsWithDefaults = computed(() => ({
86
87
  ...props,
87
88
  config: {
88
89
  ...canvasTableDefaults,
89
90
  ...props.config,
91
+ ...(props.border !== undefined ? { BORDER: props.border } : {}),
92
+ ...(props.scrollbarMode !== undefined ? { scrollbarMode: props.scrollbarMode } : {}),
93
+ ...(props.scrollbarShowDelay !== undefined
94
+ ? { SCROLLBAR_SHOW_DELAY: props.scrollbarShowDelay }
95
+ : {}),
90
96
  },
91
97
  }));
92
98
  const mode = computed<'list' | 'pagination' | 'bad'>(() =>
@@ -46,8 +46,9 @@
46
46
  config: {
47
47
  AUTO_ROW_HEIGHT: true,
48
48
  DISABLED: true, // 内部写死的默认配置
49
- ...canvasTableDefaults, // 全局配置
50
- ...props.config, // 用户传入的配置
49
+ BORDER_RADIUS: 4,
50
+ ...canvasTableDefaults, // 全局配置(含 setUIKitConfig)
51
+ ...props.config, // 用户传入的配置,可覆盖默认
51
52
  },
52
53
  }));
53
54
  let eVirtTable: EVirtTable | null = null;
@@ -62,6 +63,16 @@
62
63
  const overlayerView = ref<OverlayerContainer>();
63
64
  const cacheEditorSlotColumns: Record<string, CanvasColumnProps<T>> = {};
64
65
  const cacheEditorRenders: Record<string, CellRender> = {};
66
+
67
+ /** e-virt-table CSS 写死 stage border-radius:8px,需按 config.BORDER_RADIUS 覆盖 */
68
+ const applyBorderRadius = (config = propsWithDefaults.value.config) => {
69
+ const radius = config?.BORDER_RADIUS ?? 4;
70
+ const root = eVirtTableRef.value as HTMLElement | null;
71
+ const stage = root?.querySelector?.('.e-virt-table-stage') as HTMLElement | null;
72
+ if (stage) {
73
+ stage.style.borderRadius = `${radius}px`;
74
+ }
75
+ };
65
76
  // 编辑器样式
66
77
  const editorStyle = computed(() => {
67
78
  const cell = editorCell.value;
@@ -180,7 +191,6 @@
180
191
  });
181
192
  eVirtTable.on('overlayerChange', (overlayer: OverlayerContainer) => {
182
193
  overlayerView.value = overlayer;
183
- console.log('overlayerChange', overlayer);
184
194
  });
185
195
  eVirtTable.on('startEdit', (cell) => {
186
196
  editorCell.value = cell;
@@ -198,6 +208,7 @@
198
208
  emit('selectionChange', selection);
199
209
  });
200
210
  emit('ready', eVirtTable);
211
+ applyBorderRadius();
201
212
  themeSyncHandle = bindCanvasTableThemeSync({
202
213
  getTable: () => eVirtTable,
203
214
  getConfig: () => propsWithDefaults.value.config,
@@ -236,6 +247,7 @@
236
247
  () => propsWithDefaults.value.config,
237
248
  (newValue) => {
238
249
  eVirtTable?.loadConfig(newValue);
250
+ applyBorderRadius(newValue);
239
251
  },
240
252
  { deep: true },
241
253
  );
@@ -18,11 +18,16 @@
18
18
  --evt-readonly-color: var(--p-table-row-bg-color, #fff);
19
19
  --evt-scroller-track-color: var(--p-table-row-bg-color, #fff);
20
20
 
21
- /* Canvas 专用(白天 = storybook 默认值) */
21
+ /* Canvas 文字色:storybook 默认;业务项目请在 variables 映射 --primary-text-color 等覆盖 */
22
22
  --evt-header-text-color: #1d2129;
23
23
  --evt-body-text-color: #4e5969;
24
24
  --evt-footer-text-color: #4e5969;
25
25
  --evt-readonly-text-color: #4e5969;
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;
26
31
  --evt-scroller-color: #dee0e3;
27
32
  --evt-scroller-focus-color: #bbbec4;
28
33
  --evt-edit-bg-color: #fcf6ed;
@@ -55,3 +60,19 @@ html[theme-mode='dark'],
55
60
  --evt-context-menu-text-color: #cfd3dc;
56
61
  --evt-context-menu-item-hover-bg-color: #414243;
57
62
  }
63
+
64
+ /* #region EVirtTable overlayer cell */
65
+ .canvas-cell {
66
+ display: flex;
67
+ flex-direction: column;
68
+ justify-content: center;
69
+ align-items: start;
70
+ padding: 0 8px;
71
+ }
72
+
73
+ /* e-virt-table 给 .canvas-cell 写死 userSelect:none;不改单元格本身,只放开插槽后代以便框选文字 */
74
+ .canvas-cell * {
75
+ -webkit-user-select: text !important;
76
+ user-select: text !important;
77
+ }
78
+ /* #endregion */
@@ -405,16 +405,6 @@
405
405
  }
406
406
  /* #endregion */
407
407
 
408
- /* #region EVirtTable */
409
- .canvas-cell {
410
- display: flex;
411
- flex-direction: column;
412
- justify-content: center;
413
- align-items: start;
414
- padding: 0 8px;
415
- }
416
- /* #endregion */
417
-
418
408
  @each $align in right center {
419
409
  /**/
420
410
  .p-content-align-#{$align}.ant-form-item .ant-form-item-control-input-content {
@@ -18,39 +18,38 @@ const P_TO_EVT_BRIDGE: ReadonlyArray<readonly [evt: string, p: string, fallback:
18
18
  ];
19
19
 
20
20
  /**
21
- * 消费方在 CSS 中声明的 --evt-checkbox-*(如 variables.scss 映射 --checked-color 等)。
22
- * 同步到 inline 以覆盖 e-virt-table 运行时注入的默认值。
21
+ * 消费方在 CSS 中声明的 --evt-*(如 variables.scss 映射项目色)。
22
+ * 同步到 inline 以覆盖 e-virt-table 运行时注入 / 下方 dedicated 默认值。
23
+ * 文字色勿写入 LIGHT/DARK_EVT_DEDICATED,否则会盖掉项目映射。
23
24
  */
24
- const EVT_CHECKBOX_FROM_CSS: readonly string[] = [
25
+ const EVT_OVERRIDE_FROM_CSS: readonly string[] = [
25
26
  '--evt-checkbox-color',
26
27
  '--evt-checkbox-uncheck-color',
27
28
  '--evt-checkbox-disabled-color',
28
29
  '--evt-checkbox-check-disabled-color',
30
+ '--evt-header-text-color',
31
+ '--evt-body-text-color',
32
+ '--evt-footer-text-color',
33
+ '--evt-readonly-text-color',
34
+ '--evt-editor-text-color',
35
+ '--evt-context-menu-text-color',
36
+ '--evt-header-font',
37
+ '--evt-body-font',
29
38
  ];
30
39
 
31
- /** Canvas 专用色(无 --p-* 对应项,storybook 默认值) */
40
+ /** Canvas 专用色(无 --p-* 对应项;文字色见 canvas-theme.scss / 消费方覆盖) */
32
41
  const LIGHT_EVT_DEDICATED: Readonly<Record<string, string>> = {
33
- '--evt-header-text-color': '#1d2129',
34
- '--evt-body-text-color': '#4e5969',
35
- '--evt-footer-text-color': '#4e5969',
36
- '--evt-readonly-text-color': '#4e5969',
37
42
  '--evt-scroller-color': '#dee0e3',
38
43
  '--evt-scroller-focus-color': '#bbbec4',
39
44
  '--evt-edit-bg-color': '#fcf6ed',
40
45
  '--evt-footer-bg-color': '#fafafa',
41
46
  '--evt-autofill-point-border-color': '#fff',
42
47
  '--evt-editor-bg-color': '#fff',
43
- '--evt-editor-text-color': '#333',
44
48
  '--evt-context-menu-bg-color': '#fff',
45
- '--evt-context-menu-text-color': '#333',
46
49
  '--evt-context-menu-item-hover-bg-color': '#f5f5f5',
47
50
  };
48
51
 
49
52
  const DARK_EVT_DEDICATED: Readonly<Record<string, string>> = {
50
- '--evt-header-text-color': '#a3a6ad',
51
- '--evt-body-text-color': '#cfd3dc',
52
- '--evt-footer-text-color': '#cfd3dc',
53
- '--evt-readonly-text-color': '#a3a6ad',
54
53
  '--evt-scroller-color': '#414243',
55
54
  '--evt-scroller-track-color': '#141414',
56
55
  '--evt-scroller-focus-color': '#a3a6ad',
@@ -58,9 +57,7 @@ const DARK_EVT_DEDICATED: Readonly<Record<string, string>> = {
58
57
  '--evt-footer-bg-color': '#262727',
59
58
  '--evt-autofill-point-border-color': '#a3a6ad',
60
59
  '--evt-editor-bg-color': '#434343',
61
- '--evt-editor-text-color': '#cfd3dc',
62
60
  '--evt-context-menu-bg-color': '#141414',
63
- '--evt-context-menu-text-color': '#cfd3dc',
64
61
  '--evt-context-menu-item-hover-bg-color': '#414243',
65
62
  };
66
63
 
@@ -81,16 +78,18 @@ export function syncCanvasThemeCssVars(el: HTMLElement = document.documentElemen
81
78
  const value = computed.getPropertyValue(p).trim() || fallback;
82
79
  el.style.setProperty(evt, value);
83
80
  }
84
- for (const evt of EVT_CHECKBOX_FROM_CSS) {
85
- const value = computed.getPropertyValue(evt).trim();
86
- if (value) {
87
- el.style.setProperty(evt, value);
88
- }
89
- }
90
81
  const dedicated = isDarkThemeRoot(el) ? DARK_EVT_DEDICATED : LIGHT_EVT_DEDICATED;
91
82
  for (const [evt, value] of Object.entries(dedicated)) {
92
83
  el.style.setProperty(evt, value);
93
84
  }
85
+ // 放在 dedicated 之后:消费方 CSS(如 --primary-text-color)优先
86
+ for (const evt of EVT_OVERRIDE_FROM_CSS) {
87
+ // 折叠换行/多空格:ctx.font 对含换行的 font 串可能解析失败
88
+ const value = computed.getPropertyValue(evt).trim().replace(/\s+/g, ' ');
89
+ if (value) {
90
+ el.style.setProperty(evt, value);
91
+ }
92
+ }
94
93
  }
95
94
 
96
95
  export type CanvasTableThemeHandle = {
@@ -50,6 +50,7 @@ const defaultConfig: UIKitConfig = {
50
50
  DISABLED: true,
51
51
  ENABLE_FINDER: true,
52
52
  AUTO_ROW_HEIGHT: true,
53
+ BORDER_RADIUS: 4,
53
54
  },
54
55
  icon: {},
55
56
  };