@apexhub/apex-ui-react-source 1.3.0 → 1.3.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/dist/files/AGENTS.md +1 -1
- package/dist/files/alert/llm.txt +1 -1
- package/dist/files/alert/tokens.txt +1 -1
- package/dist/files/apex-provider/llm.txt +1 -1
- package/dist/files/auto-complete/llm.txt +1 -1
- package/dist/files/auto-complete/tokens.txt +1 -1
- package/dist/files/avatar/llm.txt +1 -1
- package/dist/files/avatar/tokens.txt +1 -1
- package/dist/files/breadcrumb/llm.txt +1 -1
- package/dist/files/breadcrumb/tokens.txt +1 -1
- package/dist/files/button/llm.txt +1 -1
- package/dist/files/button/tokens.txt +1 -1
- package/dist/files/card/llm.txt +1 -1
- package/dist/files/card/tokens.txt +1 -1
- package/dist/files/cascader/llm.txt +1 -1
- package/dist/files/cascader/tokens.txt +1 -1
- package/dist/files/checkbox/llm.txt +1 -1
- package/dist/files/checkbox/tokens.txt +1 -1
- package/dist/files/collapse/llm.txt +1 -1
- package/dist/files/collapse/tokens.txt +1 -1
- package/dist/files/date-picker/llm.txt +1 -1
- package/dist/files/date-picker/tokens.txt +1 -1
- package/dist/files/divider/llm.txt +1 -1
- package/dist/files/divider/tokens.txt +1 -1
- package/dist/files/drawer/llm.txt +1 -1
- package/dist/files/drawer/tokens.txt +1 -1
- package/dist/files/dropdown/llm.txt +1 -1
- package/dist/files/dropdown/tokens.txt +1 -1
- package/dist/files/form/form.css +0 -10
- package/dist/files/form/llm.txt +12 -1
- package/dist/files/form/tokens.txt +1 -3
- package/dist/files/grid/llm.txt +1 -1
- package/dist/files/image/llm.txt +1 -1
- package/dist/files/image/tokens.txt +1 -1
- package/dist/files/input/llm.txt +1 -1
- package/dist/files/input/tokens.txt +1 -1
- package/dist/files/input-number/llm.txt +1 -1
- package/dist/files/input-number/tokens.txt +1 -1
- package/dist/files/layout/llm.txt +1 -1
- package/dist/files/layout/tokens.txt +1 -1
- package/dist/files/menu/Menu.tsx +27 -11
- package/dist/files/menu/icons.tsx +4 -4
- package/dist/files/menu/interface.ts +7 -7
- package/dist/files/menu/lib.ts +11 -6
- package/dist/files/menu/llm.txt +25 -10
- package/dist/files/menu/menu.css +73 -32
- package/dist/files/menu/tokens.txt +14 -13
- package/dist/files/message/llm.txt +1 -1
- package/dist/files/message/tokens.txt +1 -1
- package/dist/files/modal/llm.txt +1 -1
- 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/Pagination.tsx +20 -2
- package/dist/files/pagination/interface.ts +1 -1
- package/dist/files/pagination/llm.txt +4 -6
- package/dist/files/pagination/tokens.txt +1 -1
- package/dist/files/popover/llm.txt +1 -1
- package/dist/files/popover/tokens.txt +1 -1
- package/dist/files/progress/llm.txt +1 -1
- package/dist/files/progress/tokens.txt +1 -1
- package/dist/files/radio/llm.txt +1 -1
- package/dist/files/radio/tokens.txt +1 -1
- package/dist/files/rate/llm.txt +1 -1
- package/dist/files/rate/tokens.txt +1 -1
- package/dist/files/select/llm.txt +1 -1
- package/dist/files/select/tokens.txt +1 -1
- 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/Table.stories.css +16 -0
- package/dist/files/table/llm.txt +1 -1
- package/dist/files/table/parts/TableCell.tsx +8 -2
- package/dist/files/table/table.css +7 -0
- package/dist/files/table/tokens.txt +1 -1
- package/dist/files/tabs/llm.txt +1 -1
- package/dist/files/tabs/tokens.txt +1 -1
- package/dist/files/tag/llm.txt +1 -1
- package/dist/files/tag/tokens.txt +1 -1
- package/dist/files/theme/aliases.css +1 -1
- package/dist/files/theme/component-tokens.css +5 -5
- package/dist/files/theme/primitives.css +1 -1
- package/dist/files/tooltip/Tooltip.tsx +60 -24
- package/dist/files/tooltip/llm.txt +1 -1
- package/dist/files/tooltip/tokens.txt +1 -1
- package/dist/files/tree/llm.txt +1 -1
- package/dist/files/tree/tokens.txt +1 -1
- package/dist/files/tree-select/llm.txt +1 -1
- package/dist/files/tree-select/tokens.txt +1 -1
- package/dist/files/typography/llm.txt +1 -1
- package/dist/files/typography/tokens.txt +1 -1
- package/dist/files/upload/llm.txt +26 -1
- package/dist/files/upload/tokens.txt +1 -1
- package/dist/manifest.json +99 -99
- package/package.json +2 -2
- package/template/index.html +5 -0
package/dist/files/menu/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Menu:侧栏持久导航,需要在图标 rail 与展开列表之间切换时。
|
|
4
4
|
|
|
5
|
-
版本:`1.3.
|
|
5
|
+
版本:`1.3.2`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`isKeySelected`、`Menu`。
|
|
8
8
|
|
|
@@ -56,6 +56,14 @@ export default () => {
|
|
|
56
56
|
- 需要内联子菜单展开、受控选中项或自定义顶栏/底栏时。
|
|
57
57
|
- 触发器旁的临时操作菜单请使用 Dropdown,不要用 Menu。
|
|
58
58
|
|
|
59
|
+
### 目录与页面
|
|
60
|
+
|
|
61
|
+
有非空 `children` 的普通菜单项是目录,点击整行或按 Enter / 空格只展开、收起,触发 `onOpenChange`;不会触发项级 `onClick`、Menu 的 `onClick` 或 `onSelect`。只有无子级的页面项进入点击、选中回调,`selectedKeys` 也应只传页面 key。
|
|
62
|
+
|
|
63
|
+
收起目录会保留当前页面选中;重新展开后仍显示原选中项。未选中目录使用默认文字和图标颜色;子页面选中后,祖先目录不保留选中背景。目录仅在悬停和按下时使用 hover / active Token,松开并移出后恢复默认状态;页面项保留带透明度的选中背景和主题色文字。目录箭头默认隐藏,悬停目录行或键盘聚焦时显示;收起向下、展开向上,颜色跟随 `menu-button-icon` 状态 Token。`type: 'group'` 是静态分组标题,不承担折叠交互。
|
|
64
|
+
|
|
65
|
+
收窄为图标时,悬停目录仍显示浮出子菜单;点击目录图标只请求展开侧栏并打开该目录,不切换页面。若目录需要总览页,请新增一个“总览”子项。
|
|
66
|
+
|
|
59
67
|
## API
|
|
60
68
|
|
|
61
69
|
仅使用类型定义支持的属性;原生属性、ref 目标和事件签名因组件而异。关联类型用于解释字段结构;只有「导出类型」中的名称可从包根导入。
|
|
@@ -65,9 +73,9 @@ export default () => {
|
|
|
65
73
|
| 属性 | 说明 | 类型 | 必填 | 默认值 |
|
|
66
74
|
| --- | --- | --- | --- | --- |
|
|
67
75
|
| items | 菜单树 | `MenuItemType[]` | 是 | — |
|
|
68
|
-
| selectable |
|
|
69
|
-
| selectedKeys |
|
|
70
|
-
| defaultSelectedKeys |
|
|
76
|
+
| selectable | 页面项是否可选中(目录始终不可选中) | `boolean` | 否 | `true` |
|
|
77
|
+
| selectedKeys | 受控:当前页面项(单选,length ≤ 1;不传目录 key) | `string[]` | 否 | — |
|
|
78
|
+
| defaultSelectedKeys | 默认选中的页面项(不传目录 key) | `string[]` | 否 | — |
|
|
71
79
|
| openKeys | 受控:内联子菜单展开 keys(menu-maximized 态) | `string[]` | 否 | — |
|
|
72
80
|
| defaultOpenKeys | 默认展开的子菜单 keys | `string[]` | 否 | — |
|
|
73
81
|
| theme | 颜色主题 | `"light" \| "dark"` | 否 | `'dark'` |
|
|
@@ -78,8 +86,8 @@ export default () => {
|
|
|
78
86
|
| inlineIndent | 内联子级缩进(px,menu-maximized 态) | `number` | 否 | `24` |
|
|
79
87
|
| classNames | 语义节点 class | `MenuClassNames` | 否 | — |
|
|
80
88
|
| styles | 语义节点内联样式 | `MenuStyles` | 否 | — |
|
|
81
|
-
| onSelect |
|
|
82
|
-
| onClick |
|
|
89
|
+
| onSelect | 页面项选中变化;目录展开/收起不触发 | `(info: MenuSelectInfo) => void` | 否 | — |
|
|
90
|
+
| onClick | 页面项点击;目录不触发 | `(info: MenuClickInfo) => void` | 否 | — |
|
|
83
91
|
| onOpenChange | 内联子菜单展开变化 | `(openKeys: string[]) => void` | 否 | — |
|
|
84
92
|
| renderChild | 自定义 **子级** menu-maximized 列表项整行渲染(`depth > 0`);<br>顶层 root 项不受影响。返回节点请绑定 `domProps` 以保留选中、展开、点击等行为。 | `MenuRenderChild` | 否 | — |
|
|
85
93
|
| ref | 根 nav ref(React 19) | `React.Ref<HTMLElement>` | 否 | — |
|
|
@@ -127,8 +135,8 @@ type MenuItemKind = 'group' | 'divider'
|
|
|
127
135
|
| loading | 加载中(不可交互,展示 loading 样式) | `boolean` | 否 | — |
|
|
128
136
|
| danger | 危险样式 | `boolean` | 否 | — |
|
|
129
137
|
| type | 分组标题或分割线 | `"group" \| "divider"` | 否 | — |
|
|
130
|
-
| children |
|
|
131
|
-
| onClick |
|
|
138
|
+
| children | 非空子级表示目录:只展开/收起,不触发点击或选中;可嵌套 | `MenuItemType[]` | 否 | — |
|
|
139
|
+
| onClick | 仅页面项点击;目录不触发 | `(info: MenuClickInfo) => void` | 否 | — |
|
|
132
140
|
|
|
133
141
|
### MenuClickInfo
|
|
134
142
|
|
|
@@ -215,7 +223,7 @@ Dropdown `menu` prop 用扁平列表
|
|
|
215
223
|
|
|
216
224
|
### 子菜单面板
|
|
217
225
|
|
|
218
|
-
侧栏 icon rail 与 Menu
|
|
226
|
+
侧栏 icon rail 与 Menu 面板组合:点击目录 rail 图标展开子菜单面板,选择页面项才改变选中,适合多应用切换场景。
|
|
219
227
|
|
|
220
228
|
```tsx
|
|
221
229
|
import { Button } from '@/components/apex/button'
|
|
@@ -281,6 +289,7 @@ const railStyle = {
|
|
|
281
289
|
|
|
282
290
|
export default () => {
|
|
283
291
|
const [selectedKeys, setSelectedKeys] = useState<string[]>([])
|
|
292
|
+
const [openKeys, setOpenKeys] = useState<string[]>([])
|
|
284
293
|
const [collapsed, setCollapsed] = useState(true)
|
|
285
294
|
|
|
286
295
|
return (
|
|
@@ -294,7 +303,11 @@ export default () => {
|
|
|
294
303
|
size="medium"
|
|
295
304
|
style={{ width: 32, height: 32, padding: 0, minWidth: 0 }}
|
|
296
305
|
onClick={() => {
|
|
297
|
-
|
|
306
|
+
if (item.children?.length) {
|
|
307
|
+
setOpenKeys((keys) => (keys.includes(item.key) ? keys : [...keys, item.key]))
|
|
308
|
+
} else {
|
|
309
|
+
setSelectedKeys([item.key])
|
|
310
|
+
}
|
|
298
311
|
if (collapsed) setCollapsed(false)
|
|
299
312
|
}}
|
|
300
313
|
>
|
|
@@ -316,6 +329,8 @@ export default () => {
|
|
|
316
329
|
<Menu
|
|
317
330
|
items={menuItems}
|
|
318
331
|
collapsed={false}
|
|
332
|
+
openKeys={openKeys}
|
|
333
|
+
onOpenChange={setOpenKeys}
|
|
319
334
|
selectedKeys={selectedKeys}
|
|
320
335
|
onSelect={({ selectedKeys: keys }) => setSelectedKeys(keys)}
|
|
321
336
|
footer={
|
package/dist/files/menu/menu.css
CHANGED
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
flex-direction: column;
|
|
29
29
|
justify-content: space-between;
|
|
30
30
|
align-items: center;
|
|
31
|
-
width: var(--menu-spacing-width-rail);
|
|
32
|
-
min-width: var(--menu-spacing-width-rail);
|
|
31
|
+
width: calc(var(--menu-spacing-width-rail) + var(--menu-spacing-padding-x));
|
|
32
|
+
min-width: calc(var(--menu-spacing-width-rail) + var(--menu-spacing-padding-x));
|
|
33
33
|
padding: var(--menu-spacing-padding-y) var(--menu-spacing-padding-x);
|
|
34
34
|
gap: var(--menu-spacing-gap-sm);
|
|
35
35
|
}
|
|
@@ -223,26 +223,32 @@
|
|
|
223
223
|
|
|
224
224
|
/* ── menu-collapsed rail ─────────────────────────────────────────────────── */
|
|
225
225
|
|
|
226
|
-
.apex-menu .apex-menu__rail {
|
|
226
|
+
.apex-menu.apex-menu--menu-collapsed .apex-menu__rail[data-slot='menu-rail'] {
|
|
227
227
|
display: flex;
|
|
228
228
|
flex: 1 1 auto;
|
|
229
229
|
flex-direction: column;
|
|
230
|
-
align-items:
|
|
231
|
-
width:
|
|
230
|
+
align-items: center;
|
|
231
|
+
width: 100%;
|
|
232
232
|
min-height: 0;
|
|
233
233
|
padding: 0;
|
|
234
234
|
margin: 0;
|
|
235
235
|
gap: var(--apex-spacing-12, var(--menu-spacing-gap-sm));
|
|
236
|
-
overflow-x:
|
|
236
|
+
overflow-x: hidden;
|
|
237
237
|
overflow-y: auto;
|
|
238
|
+
scrollbar-width: none;
|
|
238
239
|
list-style: none;
|
|
239
240
|
}
|
|
240
241
|
|
|
242
|
+
.apex-menu.apex-menu--menu-collapsed .apex-menu__rail[data-slot='menu-rail']::-webkit-scrollbar {
|
|
243
|
+
display: none;
|
|
244
|
+
}
|
|
245
|
+
|
|
241
246
|
.apex-menu .apex-menu__rail-item {
|
|
242
247
|
position: relative;
|
|
243
248
|
display: flex;
|
|
244
249
|
flex-shrink: 0;
|
|
245
|
-
justify-content:
|
|
250
|
+
justify-content: center;
|
|
251
|
+
width: 100%;
|
|
246
252
|
list-style: none;
|
|
247
253
|
}
|
|
248
254
|
|
|
@@ -260,11 +266,20 @@
|
|
|
260
266
|
}
|
|
261
267
|
|
|
262
268
|
.apex-menu .apex-menu__rail-button {
|
|
269
|
+
display: inline-flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
justify-content: center;
|
|
263
272
|
width: var(--menu-button-spacing-height);
|
|
264
273
|
height: var(--menu-button-spacing-height);
|
|
274
|
+
padding: 0;
|
|
265
275
|
border-radius: var(--menu-button-radius-radius);
|
|
266
276
|
}
|
|
267
277
|
|
|
278
|
+
/* Keep the rail hit area at 32px while using the compact 16px menu glyph. */
|
|
279
|
+
.apex-menu.apex-menu--menu-collapsed .apex-menu__rail-button.apex-icon-menu-button {
|
|
280
|
+
--menu-button-icon-icon: var(--apex-icon-16);
|
|
281
|
+
}
|
|
282
|
+
|
|
268
283
|
.apex-menu .apex-menu__collapse {
|
|
269
284
|
display: inline-flex;
|
|
270
285
|
align-items: center;
|
|
@@ -326,6 +341,7 @@
|
|
|
326
341
|
}
|
|
327
342
|
|
|
328
343
|
.apex-menu .apex-menu__row .apex-menu__label {
|
|
344
|
+
color: inherit;
|
|
329
345
|
flex: 1 1 auto;
|
|
330
346
|
min-width: 0;
|
|
331
347
|
overflow: hidden;
|
|
@@ -338,11 +354,25 @@
|
|
|
338
354
|
align-items: center;
|
|
339
355
|
justify-content: center;
|
|
340
356
|
color: var(--menu-button-icon-default);
|
|
341
|
-
|
|
357
|
+
opacity: 0;
|
|
358
|
+
transition:
|
|
359
|
+
transform 0.36s cubic-bezier(0.4, 0, 0.2, 1),
|
|
360
|
+
opacity 0.2s ease;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.apex-menu .apex-menu__row:hover:not(:disabled) .apex-menu__caret,
|
|
364
|
+
.apex-menu .apex-menu__row:focus-visible:not(:disabled) .apex-menu__caret {
|
|
365
|
+
opacity: 1;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.apex-menu .apex-menu__caret svg {
|
|
369
|
+
display: block;
|
|
370
|
+
width: var(--menu-button-icon-icon);
|
|
371
|
+
height: var(--menu-button-icon-icon);
|
|
342
372
|
}
|
|
343
373
|
|
|
344
374
|
.apex-menu .apex-menu__row[data-open] .apex-menu__caret {
|
|
345
|
-
transform: rotate(
|
|
375
|
+
transform: rotate(180deg);
|
|
346
376
|
}
|
|
347
377
|
|
|
348
378
|
/* Row states (from --menu-button-* on primary / secondary scopes) */
|
|
@@ -353,7 +383,8 @@
|
|
|
353
383
|
color: var(--menu-button-text-hover);
|
|
354
384
|
}
|
|
355
385
|
|
|
356
|
-
.apex-menu .apex-menu__row:hover:not(:disabled) .apex-menu__icon
|
|
386
|
+
.apex-menu .apex-menu__row:hover:not(:disabled) .apex-menu__icon,
|
|
387
|
+
.apex-menu .apex-menu__row:hover:not(:disabled) .apex-menu__caret {
|
|
357
388
|
color: var(--menu-button-icon-hover);
|
|
358
389
|
}
|
|
359
390
|
|
|
@@ -363,37 +394,45 @@
|
|
|
363
394
|
color: var(--menu-button-text-active);
|
|
364
395
|
}
|
|
365
396
|
|
|
366
|
-
.apex-menu .apex-menu__row
|
|
367
|
-
.apex-menu .apex-menu__row
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
.apex-menu .apex-menu__row[data-
|
|
397
|
+
.apex-menu .apex-menu__row:active:not(:disabled) .apex-menu__icon,
|
|
398
|
+
.apex-menu .apex-menu__row:active:not(:disabled) .apex-menu__caret {
|
|
399
|
+
color: var(--menu-button-icon-active);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected],
|
|
403
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected]:hover:not(:disabled),
|
|
404
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected]:active:not(:disabled),
|
|
405
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected-secondary],
|
|
406
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected-secondary]:hover:not(:disabled),
|
|
407
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded])[data-selected-secondary]:active:not(:disabled) {
|
|
372
408
|
background-color: var(--menu-button-fill-selected);
|
|
373
409
|
border-color: var(--menu-button-stroke-selected);
|
|
374
410
|
color: var(--menu-button-text-selected);
|
|
375
411
|
}
|
|
376
412
|
|
|
377
|
-
.apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]) .apex-menu__label,
|
|
378
|
-
.apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__label,
|
|
379
|
-
.apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__label {
|
|
413
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]) .apex-menu__label,
|
|
414
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__label,
|
|
415
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__label {
|
|
380
416
|
color: var(--menu-button-text-selected);
|
|
381
417
|
}
|
|
382
418
|
|
|
383
|
-
.apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]) .apex-menu__icon,
|
|
384
|
-
.apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]) .apex-menu__caret,
|
|
385
|
-
.apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__icon,
|
|
386
|
-
.apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__caret,
|
|
387
|
-
.apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__icon,
|
|
388
|
-
.apex-menu .apex-menu__row:is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__caret {
|
|
389
|
-
|
|
419
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]) .apex-menu__icon,
|
|
420
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]) .apex-menu__caret,
|
|
421
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__icon,
|
|
422
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):hover:not(:disabled) .apex-menu__caret,
|
|
423
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__icon,
|
|
424
|
+
.apex-menu .apex-menu__row:where(:not(:disabled):not([data-disabled])):not([aria-expanded]):is([data-selected], [data-selected-secondary]):active:not(:disabled) .apex-menu__caret {
|
|
425
|
+
/* The selected leaf icon follows its label, including in the secondary scope. */
|
|
426
|
+
color: var(--menu-button-text-selected);
|
|
390
427
|
}
|
|
391
428
|
|
|
392
|
-
/*
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
.apex-menu .apex-
|
|
396
|
-
|
|
429
|
+
/* Directories use only default / hover / active states; selection belongs to pages. */
|
|
430
|
+
|
|
431
|
+
/* Keep keyboard focus visible even on the selected path. */
|
|
432
|
+
.apex-menu .apex-menu__rail-button:focus-visible,
|
|
433
|
+
.apex-menu .apex-menu__row:focus-visible {
|
|
434
|
+
outline: var(--menu-stroke-stroke) solid var(--menu-button-icon-selected);
|
|
435
|
+
outline-offset: var(--menu-stroke-stroke);
|
|
397
436
|
}
|
|
398
437
|
|
|
399
438
|
.apex-menu .apex-menu__row:disabled,
|
|
@@ -404,7 +443,9 @@
|
|
|
404
443
|
}
|
|
405
444
|
|
|
406
445
|
.apex-menu .apex-menu__row:disabled .apex-menu__icon,
|
|
407
|
-
.apex-menu .apex-menu__row[data-disabled] .apex-menu__icon
|
|
446
|
+
.apex-menu .apex-menu__row[data-disabled] .apex-menu__icon,
|
|
447
|
+
.apex-menu .apex-menu__row:disabled .apex-menu__caret,
|
|
448
|
+
.apex-menu .apex-menu__row[data-disabled] .apex-menu__caret {
|
|
408
449
|
color: var(--menu-button-icon-disabled);
|
|
409
450
|
}
|
|
410
451
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Menu Token 明细
|
|
2
2
|
|
|
3
|
-
包:`@apexhub/apex-ui-react`;版本:`1.3.
|
|
3
|
+
包:`@apexhub/apex-ui-react`;版本:`1.3.2`(当前源码快照)。
|
|
4
4
|
|
|
5
5
|
按需读取:[组件用法](./llm.txt) · [主题与覆盖规则](../../llms-theme.txt)。
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
| Token | 用途(CSS 属性) | 定义值 | 定义作用域 |
|
|
12
12
|
| --- | --- | --- | --- |
|
|
13
|
-
| `--menu-button-fill-active` | `background-color` | `var(--apex-fill-neutral-
|
|
13
|
+
| `--menu-button-fill-active` | `background-color` | `var(--apex-fill-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
14
14
|
| `--menu-button-fill-active` | `background-color` | `var(--apex-fill-neutral-quaternary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
15
15
|
| `--menu-button-fill-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
16
16
|
| `--menu-button-fill-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
| `--menu-button-fill-loading` | `background-color` | `var(--apex-fill-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
22
22
|
| `--menu-button-fill-loading` | `background-color` | `var(--apex-fill-neutral-tertiary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
23
23
|
| `--menu-button-fill-selected` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
24
|
-
| `--menu-button-fill-selected` | `background-color` | `var(--apex-fill-brand-
|
|
24
|
+
| `--menu-button-fill-selected` | `background-color` | `var(--apex-fill-brand-alpha-secondary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
25
25
|
| `--menu-button-icon-active` | `color` | `var(--apex-icon-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
26
26
|
| `--menu-button-icon-active` | `color` | `var(--apex-icon-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
27
27
|
| `--menu-button-icon-default` | `color` | `var(--apex-icon-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
@@ -33,10 +33,11 @@
|
|
|
33
33
|
| `--menu-button-icon-icon` | `font-size`、`height`、`width` | `var(--apex-icon-24)` | `.apex-menu-button.apex-icon-menu-button` |
|
|
34
34
|
| `--menu-button-icon-icon` | `font-size`、`height`、`width` | `var(--apex-icon-16)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
35
35
|
| `--menu-button-icon-icon` | `font-size`、`height`、`width` | `var(--apex-icon-16)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
36
|
+
| `--menu-button-icon-icon` | `font-size`、`height`、`width` | `var(--apex-icon-16)` | `.apex-menu.apex-menu--menu-collapsed .apex-menu__rail-button.apex-icon-menu-button` |
|
|
36
37
|
| `--menu-button-icon-loading` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
37
38
|
| `--menu-button-icon-loading` | `color` | `var(--apex-icon-neutral-disabled)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
38
|
-
| `--menu-button-icon-selected` | `color` | `var(--apex-icon-brand-primary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
39
|
-
| `--menu-button-icon-selected` | `color` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
39
|
+
| `--menu-button-icon-selected` | `color`、`outline` | `var(--apex-icon-brand-primary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
40
|
+
| `--menu-button-icon-selected` | `color`、`outline` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
40
41
|
| `--menu-button-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu-button.apex-icon-menu-button` |
|
|
41
42
|
| `--menu-button-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
42
43
|
| `--menu-button-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
| `--menu-button-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu-button.apex-icon-menu-button` |
|
|
49
50
|
| `--menu-button-spacing-padding-x` | `padding` | `var(--apex-spacing-12)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
50
51
|
| `--menu-button-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
51
|
-
| `--menu-button-stroke-active` | `border-color` | `var(--apex-stroke-neutral-
|
|
52
|
+
| `--menu-button-stroke-active` | `border-color` | `var(--apex-stroke-neutral-tertiary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
52
53
|
| `--menu-button-stroke-active` | `border-color` | `var(--apex-stroke-neutral-quaternary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
53
54
|
| `--menu-button-stroke-default` | `border` | `var(--apex-stroke-neutral-secondary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
54
55
|
| `--menu-button-stroke-default` | `border` | `var(--apex-stroke-neutral-secondary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
| `--menu-button-text-hover` | `background-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
71
72
|
| `--menu-button-text-hover` | `background-color`、`color` | `var(--apex-text-neutral-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
72
73
|
| `--menu-button-text-selected` | `color` | `var(--apex-text-brand-primary)` | `.apex-menu-button.apex-primary-menu-button` |
|
|
73
|
-
| `--menu-button-text-selected` | `color` | `var(--apex-text-
|
|
74
|
+
| `--menu-button-text-selected` | `color` | `var(--apex-text-brand-primary)` | `.apex-menu-button.apex-secondary-menu-button` |
|
|
74
75
|
| `--menu-fill-container-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu-sliding-panel` |
|
|
75
76
|
| `--menu-fill-container-default` | `background-color` | `var(--apex-fill-neutral-secondary)` | `.apex-menu.apex-default-menu` |
|
|
76
77
|
| `--menu-radius-radius` | `border-radius` | `var(--apex-radius-8)` | `.apex-menu.apex-container-md-menu` |
|
|
@@ -82,9 +83,9 @@
|
|
|
82
83
|
| `--menu-spacing-gap-sm` | `gap`、`margin-block`、`margin-block-end`、`margin-inline-start`、`max-width`、`padding`、`width` | `var(--apex-spacing-4)` | `.apex-menu.apex-container-sm-menu` |
|
|
83
84
|
| `--menu-spacing-gap-sublist` | `margin-inline-start`、`max-width`、`padding-inline-start`、`width` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-md-menu` |
|
|
84
85
|
| `--menu-spacing-gap-sublist` | `margin-inline-start`、`max-width`、`padding-inline-start`、`width` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-sm-menu` |
|
|
85
|
-
| `--menu-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu-sliding-panel` |
|
|
86
|
-
| `--menu-spacing-padding-x` | `padding` | `var(--apex-spacing-8)` | `.apex-menu.apex-container-md-menu` |
|
|
87
|
-
| `--menu-spacing-padding-x` | `padding` | `var(--apex-spacing-4)` | `.apex-menu.apex-container-sm-menu` |
|
|
86
|
+
| `--menu-spacing-padding-x` | `min-width`、`padding`、`width` | `var(--apex-spacing-8)` | `.apex-menu-sliding-panel` |
|
|
87
|
+
| `--menu-spacing-padding-x` | `min-width`、`padding`、`width` | `var(--apex-spacing-8)` | `.apex-menu.apex-container-md-menu` |
|
|
88
|
+
| `--menu-spacing-padding-x` | `min-width`、`padding`、`width` | `var(--apex-spacing-4)` | `.apex-menu.apex-container-sm-menu` |
|
|
88
89
|
| `--menu-spacing-padding-y` | `padding` | `var(--apex-spacing-12)` | `.apex-menu-sliding-panel` |
|
|
89
90
|
| `--menu-spacing-padding-y` | `padding` | `var(--apex-spacing-12)` | `.apex-menu.apex-container-md-menu` |
|
|
90
91
|
| `--menu-spacing-padding-y` | `padding` | `var(--apex-spacing-8)` | `.apex-menu.apex-container-sm-menu` |
|
|
@@ -95,6 +96,6 @@
|
|
|
95
96
|
| `--menu-spacing-width-rail` | `min-width`、`width` | `var(--apex-size-56)` | `.apex-menu.apex-container-sm-menu` |
|
|
96
97
|
| `--menu-stroke-container-default` | `background-color`、`border-inline-end` | `var(--apex-stroke-neutral-tertiary)` | `.apex-menu-sliding-panel` |
|
|
97
98
|
| `--menu-stroke-container-default` | `background-color`、`border-inline-end` | `var(--apex-stroke-neutral-tertiary)` | `.apex-menu.apex-default-menu` |
|
|
98
|
-
| `--menu-stroke-stroke` | `border-inline-end`、`height`、`width` | `var(--apex-border-1)` | `.apex-menu-sliding-panel` |
|
|
99
|
-
| `--menu-stroke-stroke` | `border-inline-end`、`height`、`width` | `var(--apex-border-1)` | `.apex-menu.apex-container-md-menu` |
|
|
100
|
-
| `--menu-stroke-stroke` | `border-inline-end`、`height`、`width` | `var(--apex-border-1)` | `.apex-menu.apex-container-sm-menu` |
|
|
99
|
+
| `--menu-stroke-stroke` | `border-inline-end`、`height`、`outline`、`outline-offset`、`width` | `var(--apex-border-1)` | `.apex-menu-sliding-panel` |
|
|
100
|
+
| `--menu-stroke-stroke` | `border-inline-end`、`height`、`outline`、`outline-offset`、`width` | `var(--apex-border-1)` | `.apex-menu.apex-container-md-menu` |
|
|
101
|
+
| `--menu-stroke-stroke` | `border-inline-end`、`height`、`outline`、`outline-offset`、`width` | `var(--apex-border-1)` | `.apex-menu.apex-container-sm-menu` |
|
package/dist/files/modal/llm.txt
CHANGED
|
@@ -17,6 +17,7 @@ import { PaginationContext } from './context'
|
|
|
17
17
|
import type { PaginationProps } from './interface'
|
|
18
18
|
import { PageButton } from './PageButton'
|
|
19
19
|
import { PageSizeChanger } from './PageSizeChanger'
|
|
20
|
+
import { TotalText } from './TotalText'
|
|
20
21
|
import { useResizeObserver } from './useResizeObserver'
|
|
21
22
|
import { paginationVariants } from './variants'
|
|
22
23
|
|
|
@@ -31,6 +32,7 @@ export const Pagination: React.FC<PaginationProps> = ({
|
|
|
31
32
|
pageSizeOptions,
|
|
32
33
|
disabled = false,
|
|
33
34
|
showSizeChanger,
|
|
35
|
+
showTotal,
|
|
34
36
|
hideOnSinglePage = false,
|
|
35
37
|
itemRender,
|
|
36
38
|
responsive = false,
|
|
@@ -121,7 +123,6 @@ export const Pagination: React.FC<PaginationProps> = ({
|
|
|
121
123
|
const isPrevDisabled = disabled || safeCurrent === 1
|
|
122
124
|
const isNextDisabled = disabled || safeCurrent === totalPages
|
|
123
125
|
|
|
124
|
-
// showTotal / showQuickJumper 不在设计稿中,props 保留以兼容调用方但不渲染
|
|
125
126
|
const showSizeChangerFinal = effectiveShowSizeChanger && (!responsive || display.showSizeChanger)
|
|
126
127
|
|
|
127
128
|
const paginationNav = (
|
|
@@ -279,7 +280,24 @@ export const Pagination: React.FC<PaginationProps> = ({
|
|
|
279
280
|
)
|
|
280
281
|
|
|
281
282
|
return (
|
|
282
|
-
<PaginationContext.Provider value={contextValue}>
|
|
283
|
+
<PaginationContext.Provider value={contextValue}>
|
|
284
|
+
{showTotal ? (
|
|
285
|
+
<div
|
|
286
|
+
className={cn('apex-pagination__root', paginationVariants())}
|
|
287
|
+
{...(disabled ? { 'data-disabled': '' } : {})}
|
|
288
|
+
>
|
|
289
|
+
<TotalText
|
|
290
|
+
total={total}
|
|
291
|
+
current={safeCurrent}
|
|
292
|
+
pageSize={pageSize}
|
|
293
|
+
showTotal={showTotal}
|
|
294
|
+
/>
|
|
295
|
+
{paginationNav}
|
|
296
|
+
</div>
|
|
297
|
+
) : (
|
|
298
|
+
paginationNav
|
|
299
|
+
)}
|
|
300
|
+
</PaginationContext.Provider>
|
|
283
301
|
)
|
|
284
302
|
}
|
|
285
303
|
|
|
@@ -33,7 +33,7 @@ export interface PaginationProps {
|
|
|
33
33
|
showSizeChanger?: boolean
|
|
34
34
|
/** 兼容旧调用方;当前 React 设计不渲染快速跳转输入 */
|
|
35
35
|
showQuickJumper?: boolean
|
|
36
|
-
/**
|
|
36
|
+
/** 自定义总条数文案和当前页范围。不传时隐藏总数区域。 */
|
|
37
37
|
showTotal?: ShowTotalFn
|
|
38
38
|
/** 总页数 ≤ 1 时不渲染整个组件 @default false */
|
|
39
39
|
hideOnSinglePage?: boolean
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Pagination:数据量较大、需要分批次浏览列表或表格时。
|
|
4
4
|
|
|
5
|
-
版本:`1.3.
|
|
5
|
+
版本:`1.3.2`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`Pagination`。
|
|
8
8
|
|
|
@@ -41,7 +41,7 @@ export default () => <Pagination total={85} defaultCurrent={1} />
|
|
|
41
41
|
| disabled | 整体禁用 | `boolean` | 否 | `false` |
|
|
42
42
|
| showSizeChanger | 显示 pageSize 切换器。<br>未传 → total > 50 时自动 true;显式 false → 永远关;显式 true → 永远开 | `boolean` | 否 | — |
|
|
43
43
|
| showQuickJumper | 兼容旧调用方;当前 React 设计不渲染快速跳转输入 | `boolean` | 否 | — |
|
|
44
|
-
| showTotal |
|
|
44
|
+
| showTotal | 自定义总条数文案和当前页范围。不传时隐藏总数区域。 | `ShowTotalFn` | 否 | — |
|
|
45
45
|
| hideOnSinglePage | 总页数 ≤ 1 时不渲染整个组件 | `boolean` | 否 | `false` |
|
|
46
46
|
| itemRender | 自定义每项渲染。<br>所有可点项(prev/next/jump-prev/jump-next/page)都调用此函数。<br>业务方应用 React.cloneElement(originalElement, ...) 保留 a11y props。 | `ItemRender` | 否 | — |
|
|
47
47
|
| responsive | 开启容器宽度自适应(ResizeObserver 四档)。 | `boolean` | 否 | `false` |
|
|
@@ -157,11 +157,9 @@ export default () => {
|
|
|
157
157
|
}
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
###
|
|
160
|
+
### 显示总数
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
`showTotal` 自定义总数展示文案,接收 `(total, range) => 自定义节点`。
|
|
162
|
+
传入 `showTotal` 可自定义总数文案。回调接收 `(total, range)`,其中 `range` 是当前页的起止序号。默认隐藏总数区域。
|
|
165
163
|
|
|
166
164
|
```tsx
|
|
167
165
|
import { Pagination } from '@/components/apex/pagination'
|
package/dist/files/radio/llm.txt
CHANGED
package/dist/files/rate/llm.txt
CHANGED