@vue-ui-kit/ant 2.5.8 → 2.5.10

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/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,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-ui-kit/ant",
3
- "version": "2.5.8",
3
+ "version": "2.5.10",
4
4
  "description": "Vue3 UI Kit based on Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -108,8 +108,9 @@
108
108
  }
109
109
  : false,
110
110
  );
111
+ // 必须用 .value:模板里 pageConfig?.pageSizes 会因可选链绕过 Ref 解包,读到 undefined
111
112
  const pageSizeOptions = computed(() =>
112
- (pageConfig.value?.pageSizes ?? [10, 20, 50, 100, 200]).map(String),
113
+ (pageConfig.value?.pageSizes ?? [10, 20, 50, 100]).map(String),
113
114
  );
114
115
 
115
116
  const fc = computed(() => omit({ labelCol: defaultLabelCol, ...formConfig.value }, ['items']));
@@ -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
  };