@apexhub/apex-ui-react-source 1.2.1 → 1.2.2
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/bin/apex-ui-react-source.mjs +0 -0
- package/dist/files/AGENTS.md +1 -1
- package/dist/files/_assets/table-empty.url.ts +1 -1
- package/dist/files/alert/Alert.tsx +2 -2
- package/dist/files/alert/alert.css +1 -0
- package/dist/files/alert/llm.txt +3 -3
- package/dist/files/alert/tokens.txt +1 -1
- package/dist/files/apex-provider/llm.txt +3 -2
- package/dist/files/auto-complete/llm.txt +1 -1
- package/dist/files/auto-complete/tokens.txt +1 -1
- package/dist/files/avatar/Avatar.tsx +1 -1
- package/dist/files/avatar/avatar.css +12 -1
- package/dist/files/avatar/llm.txt +1 -1
- package/dist/files/avatar/tokens.txt +1 -1
- package/dist/files/breadcrumb/Breadcrumb.tsx +17 -10
- package/dist/files/breadcrumb/breadcrumb.css +20 -10
- package/dist/files/breadcrumb/interface.ts +4 -4
- package/dist/files/breadcrumb/llm.txt +8 -8
- package/dist/files/breadcrumb/tokens.txt +46 -96
- package/dist/files/breadcrumb/variants.ts +6 -0
- package/dist/files/button/Button.tsx +25 -8
- package/dist/files/button/button.css +20 -2
- package/dist/files/button/interface.ts +7 -4
- package/dist/files/button/llm.txt +16 -8
- package/dist/files/button/tokens.txt +1 -1
- package/dist/files/button/variants.ts +8 -0
- package/dist/files/card/Card.tsx +8 -1
- package/dist/files/card/card-states.stories.css +42 -0
- package/dist/files/card/card.css +6 -1
- package/dist/files/card/interface.ts +3 -0
- package/dist/files/card/llm.txt +24 -1
- package/dist/files/card/tokens.txt +3 -1
- package/dist/files/cascader/cascader-data.ts +29 -8
- package/dist/files/cascader/cascader.css +45 -11
- package/dist/files/cascader/llm.txt +25 -6
- package/dist/files/cascader/tokens.txt +15 -7
- package/dist/files/cascader/variants.ts +1 -1
- package/dist/files/checkbox/Checkbox.tsx +26 -10
- package/dist/files/checkbox/checkbox.css +64 -22
- package/dist/files/checkbox/llm.txt +24 -13
- package/dist/files/checkbox/tokens.txt +10 -2
- package/dist/files/clear/clear.css +5 -2
- package/dist/files/collapse/llm.txt +1 -1
- package/dist/files/collapse/tokens.txt +1 -1
- package/dist/files/date-picker/RangePicker.tsx +5 -5
- package/dist/files/date-picker/Trigger.tsx +5 -5
- package/dist/files/date-picker/date-picker.css +53 -23
- package/dist/files/date-picker/llm.txt +7 -3
- package/dist/files/date-picker/tokens.txt +10 -10
- package/dist/files/divider/llm.txt +1 -1
- package/dist/files/divider/tokens.txt +1 -1
- package/dist/files/drawer/drawer.css +1 -0
- package/dist/files/drawer/llm.txt +2 -2
- package/dist/files/drawer/tokens.txt +2 -2
- package/dist/files/dropdown/llm.txt +1 -1
- package/dist/files/dropdown/tokens.txt +1 -1
- package/dist/files/form/form.css +10 -0
- package/dist/files/form/llm.txt +1 -1
- package/dist/files/form/tokens.txt +3 -1
- package/dist/files/grid/llm.txt +9 -9
- package/dist/files/image/ImagePreview.tsx +7 -6
- package/dist/files/image/image.css +0 -10
- package/dist/files/image/llm.txt +2 -2
- package/dist/files/image/tokens.txt +1 -1
- package/dist/files/input/input.css +14 -14
- package/dist/files/input/llm.txt +4 -2
- package/dist/files/input/tokens.txt +4 -4
- package/dist/files/input-number/InputNumber.tsx +2 -0
- package/dist/files/input-number/input-number.css +13 -1
- package/dist/files/input-number/llm.txt +8 -3
- package/dist/files/input-number/tokens.txt +4 -4
- package/dist/files/layout/llm.txt +1 -1
- package/dist/files/layout/tokens.txt +1 -1
- package/dist/files/llms.txt +18 -11
- package/dist/files/menu/Menu.tsx +5 -1
- package/dist/files/menu/llm.txt +19 -12
- package/dist/files/menu/menu.css +41 -15
- package/dist/files/menu/menu.figma.stories.css +39 -0
- package/dist/files/menu/tokens.txt +21 -8
- package/dist/files/message/llm.txt +1 -1
- package/dist/files/message/tokens.txt +1 -1
- package/dist/files/modal/Modal.tsx +1 -2
- package/dist/files/modal/interface.ts +1 -1
- package/dist/files/modal/llm.txt +9 -9
- package/dist/files/modal/tokens.txt +1 -1
- package/dist/files/notification/llm.txt +1 -1
- package/dist/files/notification/tokens.txt +1 -1
- package/dist/files/pagination/PageButton.tsx +2 -0
- package/dist/files/pagination/Pagination.tsx +149 -170
- package/dist/files/pagination/interface.ts +2 -2
- package/dist/files/pagination/llm.txt +18 -9
- package/dist/files/pagination/pagination.css +56 -17
- package/dist/files/pagination/tokens.txt +6 -4
- package/dist/files/popover/Popover.tsx +11 -3
- package/dist/files/popover/llm.txt +3 -3
- package/dist/files/popover/popover.css +30 -18
- package/dist/files/popover/popover.stories.css +6 -0
- package/dist/files/popover/tokens.txt +4 -14
- package/dist/files/progress/llm.txt +4 -4
- package/dist/files/progress/tokens.txt +1 -1
- package/dist/files/radio/llm.txt +38 -1
- package/dist/files/radio/radio.css +51 -14
- package/dist/files/radio/tokens.txt +11 -6
- package/dist/files/rate/llm.txt +1 -1
- package/dist/files/rate/tokens.txt +1 -1
- package/dist/files/select/llm.txt +8 -7
- package/dist/files/select/select.css +30 -16
- package/dist/files/select/tokens.txt +4 -4
- package/dist/files/skeleton/llm.txt +1 -1
- package/dist/files/skeleton/tokens.txt +1 -1
- package/dist/files/spin/llm.txt +1 -1
- package/dist/files/spin/tokens.txt +1 -1
- package/dist/files/steps/llm.txt +1 -1
- package/dist/files/steps/tokens.txt +1 -1
- package/dist/files/switch/llm.txt +1 -1
- package/dist/files/switch/tokens.txt +1 -1
- package/dist/files/table/constants.ts +2 -2
- package/dist/files/table/hooks/useRowSelection.tsx +3 -3
- package/dist/files/table/interface.ts +7 -7
- package/dist/files/table/llm.txt +16 -13
- package/dist/files/table/parts/TablePagination.tsx +8 -0
- package/dist/files/table/table.css +27 -10
- package/dist/files/table/tokenScopes.ts +2 -2
- package/dist/files/table/tokens.txt +2 -2
- package/dist/files/tabs/Tabs.tsx +1 -2
- package/dist/files/tabs/llm.txt +1 -1
- package/dist/files/tabs/tabs.css +3 -3
- package/dist/files/tabs/tokens.txt +1 -1
- package/dist/files/tag/interface.ts +2 -2
- package/dist/files/tag/llm.txt +7 -8
- package/dist/files/tag/tag.css +1 -1
- package/dist/files/tag/tokens.txt +1 -2
- package/dist/files/tag/variants.ts +12 -2
- package/dist/files/theme/aliases.css +1 -1
- package/dist/files/theme/component-tokens.css +7 -7
- package/dist/files/theme/primitives.css +1 -1
- package/dist/files/tooltip/Tooltip.tsx +2 -2
- package/dist/files/tooltip/llm.txt +1 -1
- package/dist/files/tooltip/tokens.txt +1 -1
- package/dist/files/tooltip/tooltip.css +2 -3
- package/dist/files/tree/Tree.tsx +8 -38
- package/dist/files/tree/llm.txt +11 -15
- package/dist/files/tree/tokens.txt +1 -3
- package/dist/files/tree/tree-data.ts +30 -2
- package/dist/files/tree/tree.css +17 -3
- package/dist/files/tree/variants.ts +4 -2
- package/dist/files/tree-select/llm.txt +32 -22
- package/dist/files/tree-select/tokens.txt +7 -6
- package/dist/files/tree-select/tree-select-data.ts +2 -1
- package/dist/files/tree-select/tree-select.css +61 -8
- package/dist/files/typography/llm.txt +1 -1
- package/dist/files/typography/tokens.txt +1 -1
- package/dist/files/upload/llm.txt +4 -2
- package/dist/files/upload/tokens.txt +5 -1
- package/dist/files/upload/upload.css +54 -11
- package/dist/manifest.json +155 -153
- package/package.json +24 -10
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Select:选项来自预设列表,需要从其中选择一个或多个值时。
|
|
4
4
|
|
|
5
|
-
版本:`1.2.
|
|
5
|
+
版本:`1.2.2`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`Select`。
|
|
8
8
|
|
|
@@ -386,7 +386,7 @@ type MaxTagCount = number | 'responsive'
|
|
|
386
386
|
|
|
387
387
|
### 尺寸
|
|
388
388
|
|
|
389
|
-
支持 `large
|
|
389
|
+
支持 `large`、`medium`(默认)、`small` 三种尺寸。示例选中值并开启清除:large/medium 的下拉箭头为 16px,small 为 14px,清除按钮均为 14px。
|
|
390
390
|
|
|
391
391
|
```tsx
|
|
392
392
|
import { Select } from '@/components/apex/select'
|
|
@@ -398,9 +398,9 @@ const options = [
|
|
|
398
398
|
|
|
399
399
|
export default () => (
|
|
400
400
|
<div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
401
|
-
<Select size="large"
|
|
402
|
-
<Select size="medium"
|
|
403
|
-
<Select size="small"
|
|
401
|
+
<Select size="large" defaultValue="react" allowClear options={options} />
|
|
402
|
+
<Select size="medium" defaultValue="react" allowClear options={options} />
|
|
403
|
+
<Select size="small" defaultValue="react" allowClear options={options} />
|
|
404
404
|
</div>
|
|
405
405
|
)
|
|
406
406
|
```
|
|
@@ -427,7 +427,7 @@ export default () => (
|
|
|
427
427
|
|
|
428
428
|
### 只读
|
|
429
429
|
|
|
430
|
-
`readOnly`
|
|
430
|
+
`readOnly` 不可打开下拉、不可改值;视觉使用禁用配色,但仍可聚焦。示例包含空值、单选和多选。
|
|
431
431
|
|
|
432
432
|
```tsx
|
|
433
433
|
import { Select } from '@/components/apex/select'
|
|
@@ -440,6 +440,7 @@ const options = [
|
|
|
440
440
|
|
|
441
441
|
export default () => (
|
|
442
442
|
<div style={{ display: 'flex', gap: 12, alignItems: 'center', flexWrap: 'wrap' }}>
|
|
443
|
+
<Select readOnly placeholder="只读空值" options={options} style={{ minWidth: 160 }} />
|
|
443
444
|
<Select readOnly defaultValue="a" options={options} />
|
|
444
445
|
<Select
|
|
445
446
|
mode="multiple"
|
|
@@ -825,4 +826,4 @@ export default () => (
|
|
|
825
826
|
|
|
826
827
|
### `readOnly` 和 `disabled` 有什么区别?
|
|
827
828
|
|
|
828
|
-
`disabled`
|
|
829
|
+
`disabled` 不可交互;`readOnly` 同样使用禁用配色且不可打开下拉或改值,但保留可聚焦语义,适合表单只读场景。
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
pointer-events: auto;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
/*
|
|
79
|
+
/* 只读保持 disabled 视觉,但保留可聚焦语义。 */
|
|
80
80
|
.apex-select__selector[data-readonly]:not([data-disabled]) .apex-input__inner,
|
|
81
81
|
.apex-select__selector[data-readonly]:not([data-disabled]):hover .apex-input__inner,
|
|
82
82
|
.apex-select__selector[data-readonly]:not([data-disabled]):focus-within .apex-input__inner {
|
|
83
|
-
background-color: var(--input-fill-
|
|
84
|
-
border-color: var(--input-stroke-
|
|
85
|
-
color: var(--input-text-filled-
|
|
83
|
+
background-color: var(--input-fill-disabled);
|
|
84
|
+
border-color: var(--input-stroke-disabled);
|
|
85
|
+
color: var(--input-text-filled-disabled);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
/* status 优先于 default / hover / 展开 / focus(与 Input 一致:error 态始终 error 描边) */
|
|
@@ -109,12 +109,7 @@
|
|
|
109
109
|
color: inherit;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
.apex-select__selector:not([data-disabled]):not([data-state='open']):not(:focus-within):not(
|
|
113
|
-
[data-status='error']
|
|
114
|
-
):not([data-status='loading'])
|
|
115
|
-
.apex-select__selection[data-selected]:not([data-disabled])
|
|
116
|
-
.apex-typography__content,
|
|
117
|
-
.apex-select__selector[data-readonly]:not([data-disabled]):not([data-state='open']):not(
|
|
112
|
+
.apex-select__selector:not([data-disabled]):not([data-readonly]):not([data-state='open']):not(:focus-within):not(
|
|
118
113
|
[data-status='error']
|
|
119
114
|
):not([data-status='loading'])
|
|
120
115
|
.apex-select__selection[data-selected]:not([data-disabled])
|
|
@@ -266,6 +261,17 @@
|
|
|
266
261
|
color: var(--input-text-placeholder-disabled);
|
|
267
262
|
}
|
|
268
263
|
|
|
264
|
+
.apex-select__selector.apex-input[data-readonly]:not([data-disabled]) .apex-select__placeholder,
|
|
265
|
+
.apex-select__selector.apex-input[data-readonly]:not([data-disabled]) .apex-select__search::placeholder {
|
|
266
|
+
color: var(--input-text-placeholder-disabled);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.apex-select__selector:is([data-disabled], [data-readonly])
|
|
270
|
+
.apex-select__selection[data-selected]
|
|
271
|
+
.apex-typography__content {
|
|
272
|
+
color: var(--input-text-filled-disabled);
|
|
273
|
+
}
|
|
274
|
+
|
|
269
275
|
/* ── Prefix / Suffix / Clear ────────────────────────────────────────────── */
|
|
270
276
|
|
|
271
277
|
.apex-select__prefix,
|
|
@@ -312,19 +318,27 @@
|
|
|
312
318
|
color: var(--input-icon-disabled);
|
|
313
319
|
}
|
|
314
320
|
|
|
321
|
+
.apex-select__selector.apex-input[data-readonly]:not([data-disabled]) .apex-select__prefix,
|
|
322
|
+
.apex-select__selector.apex-input[data-readonly]:not([data-disabled]) .apex-select__suffix {
|
|
323
|
+
color: var(--input-icon-disabled);
|
|
324
|
+
}
|
|
325
|
+
|
|
315
326
|
/* 默认 caret-down:展开时 180° 旋转(动画作用于 wrapper,配合 GPU 合成层) */
|
|
316
327
|
.apex-select__suffix {
|
|
317
328
|
transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
|
|
318
329
|
}
|
|
319
330
|
|
|
320
|
-
/* C8: 默认 caret SVG 的 display 收敛到 CSS,避免 Select.tsx 写 inline style
|
|
331
|
+
/* C8: 默认 caret SVG 的 display 收敛到 CSS,避免 Select.tsx 写 inline style。
|
|
332
|
+
尺寸显式锚到 --input-icon-icon(md/lg 16px、sm 14px):BEM 类是 __suffix 而非
|
|
333
|
+
input.css 的 .apex-input__suffix,拿不到那边的 svg 尺寸规则,否则 svg 的
|
|
334
|
+
width="1em" 会跟随继承字号渲染成 14px,比设计稿小 2px。
|
|
335
|
+
注意 Clear Button 走 --clear-size-size(恒 14px),与此处不同轨。 */
|
|
336
|
+
.apex-select__prefix svg,
|
|
321
337
|
.apex-select__suffix svg {
|
|
322
338
|
display: block;
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
.apex-select__suffix svg[data-disabled] {
|
|
327
|
-
color:white !important;
|
|
339
|
+
flex-shrink: 0;
|
|
340
|
+
width: var(--input-icon-icon);
|
|
341
|
+
height: var(--input-icon-icon);
|
|
328
342
|
}
|
|
329
343
|
|
|
330
344
|
.apex-select__selector.apex-input[data-state='open'] .apex-select__suffix {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Select Token 明细
|
|
2
2
|
|
|
3
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照)。
|
|
4
4
|
|
|
5
5
|
按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
|
|
6
6
|
|
|
@@ -140,10 +140,10 @@
|
|
|
140
140
|
| `--input-stroke-stroke` | `border-width`、`padding-block` | `var(--apex-border-1)` | `.apex-input.apex-sm-input` |
|
|
141
141
|
| `--input-text-filled-default` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-default-input` |
|
|
142
142
|
| `--input-text-filled-default` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-elevated-input` |
|
|
143
|
-
| `--input-text-filled-disabled` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-
|
|
143
|
+
| `--input-text-filled-disabled` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-disabled)` | `.apex-input.apex-default-input` |
|
|
144
144
|
| `--input-text-filled-disabled` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-disabled)` | `.apex-input.apex-elevated-input` |
|
|
145
|
-
| `--input-text-filled-error` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-
|
|
146
|
-
| `--input-text-filled-error` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-
|
|
145
|
+
| `--input-text-filled-error` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-default-input` |
|
|
146
|
+
| `--input-text-filled-error` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-elevated-input` |
|
|
147
147
|
| `--input-text-filled-focused` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-default-input` |
|
|
148
148
|
| `--input-text-filled-focused` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-elevated-input` |
|
|
149
149
|
| `--input-text-filled-hover` | `-webkit-text-fill-color`、`caret-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-input.apex-default-input` |
|
package/dist/files/spin/llm.txt
CHANGED
package/dist/files/steps/llm.txt
CHANGED
|
@@ -68,8 +68,8 @@ function SelectionCell({
|
|
|
68
68
|
* 渲染使用 Apex `Checkbox`(半选、disabled 内建);radio 模式暂用原生 `<input type="radio">` 兜底,
|
|
69
69
|
* 待 `Apex Radio` 落地后内部替换,外部 API 不变。
|
|
70
70
|
*
|
|
71
|
-
* `showIndex
|
|
72
|
-
* 行 hover / 已选 / `:focus-within`
|
|
71
|
+
* `showIndex: true` 时序号与选择控件合并同一列:默认显示序号,
|
|
72
|
+
* 行 hover / 已选 / `:focus-within` 时切换为选择控件。默认直接显示选择控件。
|
|
73
73
|
*/
|
|
74
74
|
export function useRowSelection<RecordType>({
|
|
75
75
|
rowSelection,
|
|
@@ -165,7 +165,7 @@ export function useRowSelection<RecordType>({
|
|
|
165
165
|
const selectionColumn = React.useMemo<TableColumn<RecordType> | null>(() => {
|
|
166
166
|
if (!enabled || !rowSelection) return null
|
|
167
167
|
|
|
168
|
-
const showIndex = rowSelection.showIndex
|
|
168
|
+
const showIndex = rowSelection.showIndex === true
|
|
169
169
|
const columnWidth = rowSelection.columnWidth ?? (showIndex ? 48 : 40)
|
|
170
170
|
const type = rowSelection.type ?? 'checkbox'
|
|
171
171
|
const hideSelectAll = rowSelection.hideSelectAll ?? false
|
|
@@ -18,8 +18,8 @@ export type TableEllipsisConfig = boolean | TypographyEllipsisConfig
|
|
|
18
18
|
/**
|
|
19
19
|
* 行选择配置。受控 / 非受控双轨;变化时同步触发 `onChange`。
|
|
20
20
|
*
|
|
21
|
-
* 开启后注入单列 `__apex_selection__
|
|
22
|
-
* 设 `showIndex:
|
|
21
|
+
* 开启后注入单列 `__apex_selection__`,默认始终显示 checkbox / radio;
|
|
22
|
+
* 设 `showIndex: true` 才将序号与选择列合并(行 hover / 已选 / 焦点时切换为选择控件)。
|
|
23
23
|
*/
|
|
24
24
|
export interface TableRowSelection<RecordType = Record<string, unknown>> {
|
|
25
25
|
/**
|
|
@@ -45,9 +45,9 @@ export interface TableRowSelection<RecordType = Record<string, unknown>> {
|
|
|
45
45
|
*/
|
|
46
46
|
hideSelectAll?: boolean
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* 是否将序号与选择列合并:启用后默认显示序号,行 hover / 已选 / 键盘焦点时切换为选择控件。
|
|
49
49
|
* 序号按当前页连续编号(分页时为全局序号:`(current - 1) * pageSize + index + 1`)。
|
|
50
|
-
* @default
|
|
50
|
+
* @default false
|
|
51
51
|
*/
|
|
52
52
|
showIndex?: boolean
|
|
53
53
|
/** 固定选择列方向;须配合 `scroll.x` 与数字 `columnWidth` 使用 */
|
|
@@ -323,13 +323,13 @@ export interface TableProps<RecordType = Record<string, unknown>>
|
|
|
323
323
|
rowKey?: RowKey<RecordType>
|
|
324
324
|
/**
|
|
325
325
|
* 加载态;普通表格用 3 行骨架占位,`scroll.y` / `flexHeight` 场景按表体可用高度自动填满。
|
|
326
|
-
* 骨架行高跟随 `size`(`--table-size-height-content` + block padding,视觉
|
|
326
|
+
* 骨架行高跟随 `size`(`--table-size-height-content` + block padding,视觉 32/40/40),加载时替换数据行。
|
|
327
327
|
* @default false
|
|
328
328
|
*/
|
|
329
329
|
loading?: boolean
|
|
330
330
|
/**
|
|
331
|
-
* 尺寸;`small`
|
|
332
|
-
* 单元格内容区最小高度为 `--table-size-height-content`,加上 `--table-spacing-padding-y` 后视觉下限
|
|
331
|
+
* 尺寸;`small` 使用 block-md token,`medium` / `large` 使用 block-la token。
|
|
332
|
+
* 单元格内容区最小高度为 `--table-size-height-content`,加上 `--table-spacing-padding-y` 后视觉下限 32/40/40。
|
|
333
333
|
* 表体可继续被内容撑高,不锁死行高。
|
|
334
334
|
* 字号全 size 一致:表头 `text-*-body`(14/20),内容 `text-*-caption`(12/18)。
|
|
335
335
|
* 非 `ellipsis` 纯文本列可多行撑高;`ellipsis` 纯文本列保持单行截断。
|
package/dist/files/table/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Table:需要以行列形式展示、浏览结构化数据(列表、台账、报表)时。
|
|
4
4
|
|
|
5
|
-
版本:`1.2.
|
|
5
|
+
版本:`1.2.2`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`Table`、`TableSummary`。
|
|
8
8
|
|
|
@@ -52,8 +52,8 @@ export default () => <Table columns={columns} data={data} />
|
|
|
52
52
|
| columns | 列定义 | `TableColumn<RecordType>[]` | 否 | `[]` |
|
|
53
53
|
| data | 数据;空数组渲染空态 | `RecordType[]` | 否 | `[]` |
|
|
54
54
|
| rowKey | 行键,映射到 TanStack `getRowId` | `RowKey<RecordType>` | 否 | `'key'` |
|
|
55
|
-
| loading | 加载态;普通表格用 3 行骨架占位,`scroll.y` / `flexHeight` 场景按表体可用高度自动填满。<br>骨架行高跟随 `size`(`--table-size-height-content` + block padding,视觉
|
|
56
|
-
| size | 尺寸;`small`
|
|
55
|
+
| loading | 加载态;普通表格用 3 行骨架占位,`scroll.y` / `flexHeight` 场景按表体可用高度自动填满。<br>骨架行高跟随 `size`(`--table-size-height-content` + block padding,视觉 32/40/40),加载时替换数据行。 | `boolean` | 否 | `false` |
|
|
56
|
+
| size | 尺寸;`small` 使用 block-md token,`medium` / `large` 使用 block-la token。<br>单元格内容区最小高度为 `--table-size-height-content`,加上 `--table-spacing-padding-y` 后视觉下限 32/40/40。<br>表体可继续被内容撑高,不锁死行高。<br>字号全 size 一致:表头 `text-*-body`(14/20),内容 `text-*-caption`(12/18)。<br>非 `ellipsis` 纯文本列可多行撑高;`ellipsis` 纯文本列保持单行截断。<br>- `small` — 紧凑<br>- `medium` — 标准<br>- `large` — 宽松(默认) | `"small" \| "medium" \| "large"` | 否 | `'large'` |
|
|
57
57
|
| showHeader | 是否渲染 `<thead>` | `boolean` | 否 | `true` |
|
|
58
58
|
| rowClassName | 行 className | `string \| ((record: RecordType, index: number) => string)` | 否 | — |
|
|
59
59
|
| onRow | 行原生属性透传 | `(record: RecordType, index: number) => React.HTMLAttributes<HTMLTableRowElement>` | 否 | — |
|
|
@@ -94,7 +94,7 @@ type TableEllipsisConfig = boolean | TypographyEllipsisConfig
|
|
|
94
94
|
| defaultSelectedRowKeys | 非受控初始已选 row key 数组 | `Key[]` | 否 | `[]` |
|
|
95
95
|
| columnWidth | 选择列宽 | `number \| string` | 否 | `48(`showIndex` 为 true)/ 40(`showIndex` 为 false)` |
|
|
96
96
|
| hideSelectAll | 是否隐藏全选 checkbox(仅 `checkbox` 模式) | `boolean` | 否 | `false` |
|
|
97
|
-
| showIndex |
|
|
97
|
+
| showIndex | 是否将序号与选择列合并:启用后默认显示序号,行 hover / 已选 / 键盘焦点时切换为选择控件。<br>序号按当前页连续编号(分页时为全局序号:`(current - 1) * pageSize + index + 1`)。 | `boolean` | 否 | `false` |
|
|
98
98
|
| fixed | 固定选择列方向;须配合 `scroll.x` 与数字 `columnWidth` 使用 | `"left" \| "right"` | 否 | — |
|
|
99
99
|
| onChange | 选中变化回调 | `(selectedRowKeys: Key[], selectedRows: RecordType[]) => void` | 否 | — |
|
|
100
100
|
| getCheckboxProps | 单行禁用配置 | `(record: RecordType) => { disabled?: boolean }` | 否 | — |
|
|
@@ -262,7 +262,7 @@ type RowKey<RecordType> = string | keyof RecordType | ((record: RecordType, inde
|
|
|
262
262
|
|
|
263
263
|
### 尺寸
|
|
264
264
|
|
|
265
|
-
通过 `size`
|
|
265
|
+
通过 `size` 切换密度:表头和表体行高下限为 `small`(32px)/ `medium`(40px)/ `large`(40px,默认);表体可由多行内容继续撑高。字号在各档保持一致:表头 14px、内容 12px。
|
|
266
266
|
|
|
267
267
|
```tsx
|
|
268
268
|
import { Table } from '@/components/apex/table'
|
|
@@ -345,7 +345,7 @@ export default () => (
|
|
|
345
345
|
|
|
346
346
|
### 分页
|
|
347
347
|
|
|
348
|
-
通过 `pagination` 配置分页;设为 `false`
|
|
348
|
+
通过 `pagination` 配置分页;设为 `false` 可关闭分页区。两端均支持页码导航、`showSizeChanger` 和 `showTotal`。React Table 会在页码控件左侧单独渲染总数文案。Vue 版还支持 `showQuickJumper`;React 版仅保留该旧参数以兼容调用方,当前不渲染快速跳转。
|
|
349
349
|
|
|
350
350
|
```tsx
|
|
351
351
|
import { Table } from '@/components/apex/table'
|
|
@@ -367,7 +367,11 @@ export default () => (
|
|
|
367
367
|
<Table
|
|
368
368
|
columns={columns}
|
|
369
369
|
data={data}
|
|
370
|
-
pagination={{
|
|
370
|
+
pagination={{
|
|
371
|
+
defaultPageSize: 10,
|
|
372
|
+
showSizeChanger: true,
|
|
373
|
+
showTotal: (total, range) => `共 ${total} 条,当前 ${range[0]}-${range[1]}`,
|
|
374
|
+
}}
|
|
371
375
|
/>
|
|
372
376
|
)
|
|
373
377
|
```
|
|
@@ -441,7 +445,7 @@ export default () => (
|
|
|
441
445
|
|
|
442
446
|
### 行选择
|
|
443
447
|
|
|
444
|
-
配置 `rowSelection`
|
|
448
|
+
配置 `rowSelection` 开启多选或单选列,选择控件默认常显,点击即可选中。需要在同一列复用序号时显式设置 `showIndex: true`,鼠标悬停当前行(或已选 / 键盘焦点)时切换为选择控件;分页开启时序号为全局连续编号。
|
|
445
449
|
|
|
446
450
|
```tsx
|
|
447
451
|
import { Table } from '@/components/apex/table'
|
|
@@ -480,7 +484,7 @@ export default () => {
|
|
|
480
484
|
|
|
481
485
|
`rowSelection.fixed` 可将选择列固定在左侧或右侧;须配合 `scroll.x` 与数字 `columnWidth` 使用。与 `column.fixed: 'left'` 叠加时,选择列始终在最左并参与偏移计算。
|
|
482
486
|
|
|
483
|
-
|
|
487
|
+
本例使用默认配置,复选框始终显示,无需悬停行。
|
|
484
488
|
|
|
485
489
|
```tsx
|
|
486
490
|
import { Button } from '@/components/apex/button'
|
|
@@ -533,7 +537,6 @@ export default () => {
|
|
|
533
537
|
pagination={false}
|
|
534
538
|
rowSelection={{
|
|
535
539
|
fixed: 'left',
|
|
536
|
-
showIndex: false,
|
|
537
540
|
columnWidth: 48,
|
|
538
541
|
selectedRowKeys: selectedKeys,
|
|
539
542
|
onChange: (keys) => setSelectedKeys(keys),
|
|
@@ -701,7 +704,7 @@ import { Tag } from '@/components/apex/tag'
|
|
|
701
704
|
type ProductRecord = {
|
|
702
705
|
key: string
|
|
703
706
|
name: string
|
|
704
|
-
tags: Array<{ label: string; color: 'brand' | 'success' | 'warning' | 'error' | '
|
|
707
|
+
tags: Array<{ label: string; color: 'brand' | 'success' | 'warning' | 'error' | 'grey' }>
|
|
705
708
|
}
|
|
706
709
|
|
|
707
710
|
const LONG_TAG_LABELS = {
|
|
@@ -726,7 +729,7 @@ const data: ProductRecord[] = [
|
|
|
726
729
|
tags: [
|
|
727
730
|
{ label: LONG_TAG_LABELS.region, color: 'brand' },
|
|
728
731
|
{ label: '季度复盘待办:整理本月续约风险清单并同步客户成功经理', color: 'warning' },
|
|
729
|
-
{ label: LONG_TAG_LABELS.category, color: '
|
|
732
|
+
{ label: LONG_TAG_LABELS.category, color: 'grey' },
|
|
730
733
|
],
|
|
731
734
|
},
|
|
732
735
|
{
|
|
@@ -1027,7 +1030,7 @@ export default () => (
|
|
|
1027
1030
|
|
|
1028
1031
|
## DOM 结构
|
|
1029
1032
|
|
|
1030
|
-
源码声明的静态 `data-slot`:`table-element`、`table-scroll-shell`、`table-scroll`、`table-empty-fixed`、`table-summary-wrap`、`table-element-summary`、`table-container`、`table`、`table-header-wrap`、`table-element-header`、`table-expand-trigger`、`table-selection-cell`、`table-selection-index`、`table-selection-all`、`table-selection-radio`、`table-selection-checkbox`、`table-virtual-spacer`、`table-expanded-row`、`table-expanded-cell`、`table-tbody`、`table-cell-head`、`table-cell`、`table-col`、`table-row-empty`、`table-cell-empty`、`table-empty-image`、`table-thead`、`table-row`、`table-pagination`、`table-scrollbar`、`table-scrollbar-track-y`、`table-scrollbar-thumb-y`、`table-scrollbar-track-x`、`table-scrollbar-thumb-x`、`table-skeleton-row`、`table-skeleton-cell`、`table-summary`、`table-summary-row`、`table-summary-cell`。具体节点随模式和状态出现,不表示固定嵌套顺序。
|
|
1033
|
+
源码声明的静态 `data-slot`:`table-element`、`table-scroll-shell`、`table-scroll`、`table-empty-fixed`、`table-summary-wrap`、`table-element-summary`、`table-container`、`table`、`table-header-wrap`、`table-element-header`、`table-expand-trigger`、`table-selection-cell`、`table-selection-index`、`table-selection-all`、`table-selection-radio`、`table-selection-checkbox`、`table-virtual-spacer`、`table-expanded-row`、`table-expanded-cell`、`table-tbody`、`table-cell-head`、`table-cell`、`table-col`、`table-row-empty`、`table-cell-empty`、`table-empty-image`、`table-thead`、`table-row`、`table-pagination`、`table-pagination-total`、`table-scrollbar`、`table-scrollbar-track-y`、`table-scrollbar-thumb-y`、`table-scrollbar-track-x`、`table-scrollbar-thumb-x`、`table-skeleton-row`、`table-skeleton-cell`、`table-summary`、`table-summary-row`、`table-summary-cell`。具体节点随模式和状态出现,不表示固定嵌套顺序。
|
|
1031
1034
|
|
|
1032
1035
|
## 样式定制
|
|
1033
1036
|
|
|
@@ -25,12 +25,20 @@ export function TablePagination({
|
|
|
25
25
|
state,
|
|
26
26
|
onPageChange,
|
|
27
27
|
onPageSizeChange,
|
|
28
|
+
showTotal,
|
|
28
29
|
...rest
|
|
29
30
|
}: TablePaginationProps): React.ReactElement {
|
|
30
31
|
const { current, pageSize, total } = state
|
|
32
|
+
const start = total === 0 ? 0 : Math.min((current - 1) * pageSize + 1, total)
|
|
33
|
+
const end = Math.min(current * pageSize, total)
|
|
31
34
|
|
|
32
35
|
return (
|
|
33
36
|
<div data-slot="table-pagination" className="apex-table__pagination">
|
|
37
|
+
{showTotal ? (
|
|
38
|
+
<span data-slot="table-pagination-total" className="apex-table__pagination-total">
|
|
39
|
+
{showTotal(total, [start, end])}
|
|
40
|
+
</span>
|
|
41
|
+
) : null}
|
|
34
42
|
<Pagination
|
|
35
43
|
current={current}
|
|
36
44
|
pageSize={pageSize}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
line-height: var(--apex-fontheight-18);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
/* height-content 是内容区最小高度;加上 block 上下 padding 后行高下限为
|
|
15
|
+
/* height-content 是内容区最小高度;加上 block 上下 padding 后行高下限为 32/40/40 */
|
|
16
16
|
.apex-table.apex-block-md-table,
|
|
17
17
|
.apex-table.apex-block-la-table {
|
|
18
18
|
--table-row-min-height: calc(
|
|
@@ -409,12 +409,22 @@
|
|
|
409
409
|
|
|
410
410
|
.apex-table__empty-image {
|
|
411
411
|
display: block;
|
|
412
|
-
width: var(--table-empty-image-width,
|
|
413
|
-
height: var(--table-empty-image-height,
|
|
412
|
+
width: var(--table-empty-image-width, 215px);
|
|
413
|
+
height: var(--table-empty-image-height, 144px);
|
|
414
414
|
flex-shrink: 0;
|
|
415
415
|
line-height: 0;
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
+
.apex-table--medium .apex-table__empty-image {
|
|
419
|
+
width: var(--table-empty-image-width, 161px);
|
|
420
|
+
height: var(--table-empty-image-height, 108px);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.apex-table--small .apex-table__empty-image {
|
|
424
|
+
width: var(--table-empty-image-width, 108px);
|
|
425
|
+
height: var(--table-empty-image-height, 72px);
|
|
426
|
+
}
|
|
427
|
+
|
|
418
428
|
.apex-table__empty-image svg,
|
|
419
429
|
.apex-table__empty-image img {
|
|
420
430
|
display: block;
|
|
@@ -579,7 +589,7 @@
|
|
|
579
589
|
.apex-table__cell {
|
|
580
590
|
position: relative;
|
|
581
591
|
box-sizing: border-box;
|
|
582
|
-
/*
|
|
592
|
+
/* table-cell 的 min-height 不参与表格行高计算,使用 height 保持内容可继续撑高 */
|
|
583
593
|
padding: var(--table-spacing-padding-y) var(--table-spacing-padding-x);
|
|
584
594
|
border-right: var(--table-stroke-stroke) solid var(--table-stroke-container-default);
|
|
585
595
|
border-bottom: var(--table-stroke-stroke) solid var(--table-stroke-container-default);
|
|
@@ -591,7 +601,7 @@
|
|
|
591
601
|
}
|
|
592
602
|
|
|
593
603
|
.apex-table__cell:not(.apex-table__cell--head):not(.apex-table__cell--empty) {
|
|
594
|
-
|
|
604
|
+
height: var(--table-row-min-height);
|
|
595
605
|
}
|
|
596
606
|
|
|
597
607
|
/* 去掉表格最右列的外侧右边框(替代 `:last-child`)。
|
|
@@ -687,7 +697,13 @@
|
|
|
687
697
|
justify-content: center;
|
|
688
698
|
}
|
|
689
699
|
|
|
690
|
-
/*
|
|
700
|
+
/* Table selection controls use the compact 16px glyph from the design. */
|
|
701
|
+
.apex-table__cell--selection .apex-checkbox__control {
|
|
702
|
+
width: var(--apex-size-16);
|
|
703
|
+
height: var(--apex-size-16);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/* showIndex=true 时序号 + 选择控件合并列:默认显示序号,行 hover / 已选 / 焦点时切换为控件 */
|
|
691
707
|
.apex-table__selection-cell {
|
|
692
708
|
position: relative;
|
|
693
709
|
display: inline-flex;
|
|
@@ -757,10 +773,11 @@
|
|
|
757
773
|
padding: var(--apex-spacing-16, 16px) 0;
|
|
758
774
|
}
|
|
759
775
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
776
|
+
.apex-table__pagination-total {
|
|
777
|
+
flex: 0 0 auto;
|
|
778
|
+
color: var(--table-text-content-disabled);
|
|
779
|
+
font-size: var(--apex-fontsize-12);
|
|
780
|
+
line-height: var(--apex-fontheight-18);
|
|
764
781
|
}
|
|
765
782
|
|
|
766
783
|
/* 展开列 / 树形缩进 */
|
|
@@ -9,13 +9,13 @@ type TableSize = NonNullable<TableProps['size']>
|
|
|
9
9
|
*/
|
|
10
10
|
export const TABLE_BLOCK_SCOPE_CLASS: Record<TableSize, string> = {
|
|
11
11
|
small: 'apex-block-md-table',
|
|
12
|
-
medium: 'apex-block-
|
|
12
|
+
medium: 'apex-block-la-table',
|
|
13
13
|
large: 'apex-block-la-table',
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const TABLE_LINE_SCOPE_CLASS: Record<TableSize, string> = {
|
|
17
17
|
small: 'apex-line-md-table',
|
|
18
|
-
medium: 'apex-line-
|
|
18
|
+
medium: 'apex-line-la-table',
|
|
19
19
|
large: 'apex-line-la-table',
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Table Token 明细
|
|
2
2
|
|
|
3
|
-
包:`@apexhub/apex-ui-react`;版本:`1.2.
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.2.2`(当前源码快照)。
|
|
4
4
|
|
|
5
5
|
按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
|
|
6
6
|
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
| `--table-fill-container-default` | `background` | `var(--apex-fill-neutral-secondary)` | `.apex-table.apex-default-table` |
|
|
65
65
|
| `--table-fill-content-default` | `background` | `var(--apex-fill-neutral-secondary)` | `.apex-table.apex-default-table` |
|
|
66
66
|
| `--table-fill-content-disabled` | `background` | `var(--apex-fill-neutral-primary)` | `.apex-table.apex-default-table` |
|
|
67
|
-
| `--table-fill-content-hover` | `background` | `
|
|
67
|
+
| `--table-fill-content-hover` | `background` | `color-mix(in srgb, var(--apex-fill-neutral-tertiary) 80%, transparent)` | `.apex-table.apex-default-table` |
|
|
68
68
|
| `--table-fill-content-selected` | `background` | `var(--apex-fill-neutral-quaternary)` | `.apex-table.apex-default-table` |
|
|
69
69
|
| `--table-fill-header-default` | `background` | `var(--apex-fill-neutral-tertiary)` | `.apex-table.apex-default-table` |
|
|
70
70
|
| `--table-icon-content-default` | `color` | `var(--apex-icon-neutral-secondary)` | `.apex-table.apex-default-table` |
|
package/dist/files/tabs/Tabs.tsx
CHANGED
|
@@ -46,7 +46,6 @@ export const Tabs: FC<TabsProps> = ({
|
|
|
46
46
|
|
|
47
47
|
const isTextType = type === 'text'
|
|
48
48
|
const isCapsuleType = type === 'capsule' || type === 'capsule-number'
|
|
49
|
-
const showDivider = isTextType || isCapsuleType
|
|
50
49
|
const triggerClassName = isTextType
|
|
51
50
|
? 'apex-tabs__trigger'
|
|
52
51
|
: isCapsuleType
|
|
@@ -110,7 +109,7 @@ export const Tabs: FC<TabsProps> = ({
|
|
|
110
109
|
) : (
|
|
111
110
|
trigger
|
|
112
111
|
)}
|
|
113
|
-
{
|
|
112
|
+
{isTextType && index < items.length - 1 ? (
|
|
114
113
|
<Divider type="secondary" orientation="vertical" className="apex-tabs__divider" />
|
|
115
114
|
) : null}
|
|
116
115
|
</Fragment>
|
package/dist/files/tabs/llm.txt
CHANGED
package/dist/files/tabs/tabs.css
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
/* text 形态:项间分隔线,标签紧凑排布 */
|
|
32
32
|
.apex-text-tab .apex-tabs__list {
|
|
33
|
-
gap: var(--tab-spacing-gap);
|
|
33
|
+
gap: var(--apex-spacing-4, var(--tab-spacing-gap));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/* ── 指示条基线(仅 line 形态)──────────────────────────
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
.apex-line-horizontal-tab .apex-tabs__list::after {
|
|
49
49
|
left: 0;
|
|
50
50
|
right: 0;
|
|
51
|
-
bottom: calc(-1 * var(--tab-spacing-gap-button-line));
|
|
51
|
+
bottom: calc(-1 * var(--apex-spacing-2, var(--tab-spacing-gap-button-line)));
|
|
52
52
|
height: var(--tab-stroke-default);
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
left: 0;
|
|
146
146
|
right: 0;
|
|
147
147
|
bottom: calc(
|
|
148
|
-
-1 * var(--tab-spacing-gap-button-line) + (var(--tab-stroke-default) - var(--tab-stroke-selected)) / 2
|
|
148
|
+
-1 * var(--apex-spacing-2, var(--tab-spacing-gap-button-line)) + (var(--tab-stroke-default) - var(--tab-stroke-selected)) / 2
|
|
149
149
|
);
|
|
150
150
|
height: var(--tab-stroke-selected);
|
|
151
151
|
border-radius: 10px;
|