@apexhub/apex-ui-react-source 1.3.1 → 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/llm.txt +1 -1
- 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 +96 -96
- package/package.json +3 -3
- package/template/index.html +5 -0
package/dist/files/spin/llm.txt
CHANGED
package/dist/files/steps/llm.txt
CHANGED
package/dist/files/table/llm.txt
CHANGED
package/dist/files/tabs/llm.txt
CHANGED
package/dist/files/tag/llm.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* ==========================================================================
|
|
2
2
|
Apex UI Design Tokens — Auto-generated
|
|
3
|
-
Generated at 2026-
|
|
3
|
+
Generated at 2026-12-01 02:28:57 from tokens — aliases layer (foundation, 卡片 Demo / 单选状态)
|
|
4
4
|
DO NOT EDIT MANUALLY. Run `apex-ui theme` / `apex-ui build` to regenerate.
|
|
5
5
|
========================================================================== */
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* ==========================================================================
|
|
2
2
|
Apex UI Component Tokens — Auto-generated (scoped)
|
|
3
|
-
Generated at 2026-
|
|
3
|
+
Generated at 2026-12-01 02:28:57 from tokens — component layer (component, component usage)
|
|
4
4
|
DO NOT EDIT MANUALLY. Run `apex-ui theme` / `apex-ui build` to regenerate.
|
|
5
5
|
========================================================================== */
|
|
6
6
|
|
|
@@ -1233,7 +1233,7 @@
|
|
|
1233
1233
|
--menu-button-stroke-stroke: var(--apex-border-1);
|
|
1234
1234
|
}
|
|
1235
1235
|
&.apex-primary-menu-button {
|
|
1236
|
-
--menu-button-fill-active: var(--apex-fill-neutral-
|
|
1236
|
+
--menu-button-fill-active: var(--apex-fill-neutral-tertiary);
|
|
1237
1237
|
--menu-button-fill-default: var(--apex-fill-neutral-secondary);
|
|
1238
1238
|
--menu-button-fill-disabled: var(--apex-fill-neutral-primary);
|
|
1239
1239
|
--menu-button-fill-hover: var(--apex-fill-neutral-tertiary);
|
|
@@ -1250,7 +1250,7 @@
|
|
|
1250
1250
|
--menu-button-spacing-gap: var(--apex-spacing-4);
|
|
1251
1251
|
--menu-button-spacing-height: var(--apex-size-24);
|
|
1252
1252
|
--menu-button-spacing-padding-x: var(--apex-spacing-12);
|
|
1253
|
-
--menu-button-stroke-active: var(--apex-stroke-neutral-
|
|
1253
|
+
--menu-button-stroke-active: var(--apex-stroke-neutral-tertiary);
|
|
1254
1254
|
--menu-button-stroke-default: var(--apex-stroke-neutral-secondary);
|
|
1255
1255
|
--menu-button-stroke-disabled: var(--apex-stroke-neutral-primary);
|
|
1256
1256
|
--menu-button-stroke-hover: var(--apex-stroke-neutral-tertiary);
|
|
@@ -1271,7 +1271,7 @@
|
|
|
1271
1271
|
--menu-button-fill-disabled: var(--apex-fill-neutral-primary);
|
|
1272
1272
|
--menu-button-fill-hover: var(--apex-fill-neutral-tertiary);
|
|
1273
1273
|
--menu-button-fill-loading: var(--apex-fill-neutral-tertiary);
|
|
1274
|
-
--menu-button-fill-selected: var(--apex-fill-brand-
|
|
1274
|
+
--menu-button-fill-selected: var(--apex-fill-brand-alpha-secondary);
|
|
1275
1275
|
--menu-button-icon-active: var(--apex-icon-neutral-primary);
|
|
1276
1276
|
--menu-button-icon-default: var(--apex-icon-neutral-secondary);
|
|
1277
1277
|
--menu-button-icon-disabled: var(--apex-icon-neutral-disabled);
|
|
@@ -1295,7 +1295,7 @@
|
|
|
1295
1295
|
--menu-button-text-disabled: var(--apex-text-neutral-disabled);
|
|
1296
1296
|
--menu-button-text-hover: var(--apex-text-neutral-primary);
|
|
1297
1297
|
--menu-button-text-loading: var(--apex-text-neutral-disabled);
|
|
1298
|
-
--menu-button-text-selected: var(--apex-text-
|
|
1298
|
+
--menu-button-text-selected: var(--apex-text-brand-primary);
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
1301
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* ==========================================================================
|
|
2
2
|
Apex UI Design Tokens — Auto-generated
|
|
3
|
-
Generated at 2026-
|
|
3
|
+
Generated at 2026-12-01 02:28:57 from tokens — primitives layer (palette, base value)
|
|
4
4
|
DO NOT EDIT MANUALLY. Run `apex-ui theme` / `apex-ui build` to regenerate.
|
|
5
5
|
========================================================================== */
|
|
6
6
|
|
|
@@ -39,6 +39,43 @@ function isIntrinsicElement(element: React.ReactElement): boolean {
|
|
|
39
39
|
return typeof element.type === 'string'
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
type TriggerEventHandler = (event: React.SyntheticEvent<HTMLElement>) => void
|
|
43
|
+
|
|
44
|
+
const EVENT_PROP = /^on[A-Z]/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Tooltip 作为 Popover / Dropdown 等浮层的触发元素时,外层会把 ref、aria-* 和事件处理函数
|
|
48
|
+
* 克隆到 Tooltip 上。它们属于触发节点,要转发给真正的触发元素;其余属性仍落在根节点上。
|
|
49
|
+
*/
|
|
50
|
+
function splitOuterTriggerProps(rest: Record<string, unknown>) {
|
|
51
|
+
const { ref, ...attrs } = rest as Record<string, unknown> & { ref?: React.Ref<HTMLElement> }
|
|
52
|
+
const handlers: Record<string, TriggerEventHandler | undefined> = {}
|
|
53
|
+
const aria: Record<string, unknown> = {}
|
|
54
|
+
const root: Record<string, unknown> = {}
|
|
55
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
56
|
+
if (EVENT_PROP.test(key)) handlers[key] = value as TriggerEventHandler | undefined
|
|
57
|
+
else if (key.startsWith('aria-')) aria[key] = value
|
|
58
|
+
else root[key] = value
|
|
59
|
+
}
|
|
60
|
+
return { ref, handlers, aria, root }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** 同名事件先调外层(或子元素自身)的,再调内部的;内部处理遵守 preventDefault / stopPropagation。 */
|
|
64
|
+
function composeHandlerMaps(
|
|
65
|
+
first: Record<string, unknown>,
|
|
66
|
+
second: Record<string, unknown>,
|
|
67
|
+
): Record<string, TriggerEventHandler | undefined> {
|
|
68
|
+
const merged: Record<string, TriggerEventHandler | undefined> = {}
|
|
69
|
+
for (const key of new Set([...Object.keys(first), ...Object.keys(second)])) {
|
|
70
|
+
if (!EVENT_PROP.test(key)) continue
|
|
71
|
+
merged[key] = composeEventHandler(
|
|
72
|
+
first[key] as TriggerEventHandler | undefined,
|
|
73
|
+
second[key] as TriggerEventHandler | undefined,
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
return merged
|
|
77
|
+
}
|
|
78
|
+
|
|
42
79
|
/**
|
|
43
80
|
* Tooltip — antd 风格扁平 API(Headless 锚点浮层 + Floating UI)
|
|
44
81
|
*/
|
|
@@ -211,35 +248,22 @@ export const Tooltip: React.FC<TooltipProps> = ({
|
|
|
211
248
|
[setOpenState],
|
|
212
249
|
)
|
|
213
250
|
|
|
214
|
-
const mergeTriggerChild = (
|
|
215
|
-
extra: React.DOMAttributes<HTMLElement> & { ref?: React.Ref<HTMLElement> },
|
|
216
|
-
) => {
|
|
251
|
+
const mergeTriggerChild = (extra: Record<string, unknown> & { ref?: React.Ref<HTMLElement> }) => {
|
|
217
252
|
if (!React.isValidElement(triggerChild)) return triggerChild
|
|
218
253
|
const { ref: extraRef, ...restExtra } = extra
|
|
219
254
|
const childRef = getElementRef<HTMLElement>(triggerChild)
|
|
220
255
|
return React.cloneElement(triggerChild, {
|
|
221
256
|
...restExtra,
|
|
257
|
+
...composeHandlerMaps(triggerChildProps as Record<string, unknown>, restExtra),
|
|
222
258
|
'data-slot': 'tooltip-trigger',
|
|
223
259
|
'aria-describedby': open ? tooltipId : undefined,
|
|
224
260
|
ref: composeRefs(extraRef, childRef),
|
|
225
|
-
onClick: composeEventHandler(triggerChildProps.onClick, restExtra.onClick),
|
|
226
|
-
onContextMenu: composeEventHandler(triggerChildProps.onContextMenu, restExtra.onContextMenu),
|
|
227
|
-
onFocus: composeEventHandler(triggerChildProps.onFocus, restExtra.onFocus),
|
|
228
|
-
onBlur: composeEventHandler(triggerChildProps.onBlur, restExtra.onBlur),
|
|
229
|
-
onMouseEnter: composeEventHandler(triggerChildProps.onMouseEnter, restExtra.onMouseEnter),
|
|
230
|
-
onMouseLeave: composeEventHandler(triggerChildProps.onMouseLeave, restExtra.onMouseLeave),
|
|
231
|
-
onPointerEnter: composeEventHandler(
|
|
232
|
-
triggerChildProps.onPointerEnter,
|
|
233
|
-
restExtra.onPointerEnter,
|
|
234
|
-
),
|
|
235
|
-
onPointerLeave: composeEventHandler(
|
|
236
|
-
triggerChildProps.onPointerLeave,
|
|
237
|
-
restExtra.onPointerLeave,
|
|
238
|
-
),
|
|
239
261
|
} as Record<string, unknown>)
|
|
240
262
|
}
|
|
241
263
|
|
|
242
|
-
const
|
|
264
|
+
const outer = splitOuterTriggerProps(rootRest)
|
|
265
|
+
|
|
266
|
+
const triggerHandlers = composeHandlerMaps(outer.handlers, {
|
|
243
267
|
onClick: hasClick ? handleTriggerClick : undefined,
|
|
244
268
|
onContextMenu: hasContextMenu ? handleContextMenu : undefined,
|
|
245
269
|
onFocus: hasFocus ? handleFocus : undefined,
|
|
@@ -248,7 +272,7 @@ export const Tooltip: React.FC<TooltipProps> = ({
|
|
|
248
272
|
onMouseLeave: hasHover ? scheduleHoverClose : undefined,
|
|
249
273
|
onPointerEnter: hasHover ? scheduleHoverOpen : undefined,
|
|
250
274
|
onPointerLeave: hasHover ? scheduleHoverClose : undefined,
|
|
251
|
-
}
|
|
275
|
+
})
|
|
252
276
|
|
|
253
277
|
const overlay = useAnchoredOverlay({
|
|
254
278
|
open: open && hasContent,
|
|
@@ -268,18 +292,24 @@ export const Tooltip: React.FC<TooltipProps> = ({
|
|
|
268
292
|
referenceRef.current = node
|
|
269
293
|
}, [])
|
|
270
294
|
|
|
295
|
+
const referenceRefs = composeRefs(setReferenceRef, outer.ref)
|
|
296
|
+
const hasOuterAria = Object.keys(outer.aria).length > 0
|
|
297
|
+
|
|
298
|
+
// 组件子元素包一层 span 接事件和定位;外层给的 aria-* 交给组件本身,让读屏读到真正的按钮
|
|
271
299
|
const mergedTriggerChild = shouldWrapTrigger ? (
|
|
272
300
|
<span
|
|
273
|
-
ref={
|
|
301
|
+
ref={referenceRefs}
|
|
274
302
|
data-slot="tooltip-trigger"
|
|
275
303
|
aria-describedby={open ? tooltipId : undefined}
|
|
276
304
|
className="apex-tooltip__trigger-wrap"
|
|
277
305
|
{...triggerHandlers}
|
|
278
306
|
>
|
|
279
|
-
{children
|
|
307
|
+
{hasOuterAria && React.isValidElement(children)
|
|
308
|
+
? React.cloneElement(children, outer.aria)
|
|
309
|
+
: children}
|
|
280
310
|
</span>
|
|
281
311
|
) : (
|
|
282
|
-
mergeTriggerChild({ ...triggerHandlers, ref:
|
|
312
|
+
mergeTriggerChild({ ...triggerHandlers, ...outer.aria, ref: referenceRefs })
|
|
283
313
|
)
|
|
284
314
|
|
|
285
315
|
// hover 时也必须 pointer-events:auto:否则鼠标无法进入浮层,
|
|
@@ -297,11 +327,17 @@ export const Tooltip: React.FC<TooltipProps> = ({
|
|
|
297
327
|
const mountContent = open || !destroyOnHidden
|
|
298
328
|
|
|
299
329
|
if (!hasContent) {
|
|
300
|
-
|
|
330
|
+
// 没有提示内容时不渲染浮层,但外层给触发元素的 ref、aria 和事件照样转发
|
|
331
|
+
if (!React.isValidElement(children)) return <>{children}</>
|
|
332
|
+
return React.cloneElement(children, {
|
|
333
|
+
...outer.aria,
|
|
334
|
+
...composeHandlerMaps(children.props as Record<string, unknown>, outer.handlers),
|
|
335
|
+
ref: composeRefs(outer.ref, getElementRef<HTMLElement>(children)),
|
|
336
|
+
} as Record<string, unknown>)
|
|
301
337
|
}
|
|
302
338
|
|
|
303
339
|
return (
|
|
304
|
-
<div data-slot="tooltip" style={{ display: 'contents' }} {...
|
|
340
|
+
<div data-slot="tooltip" style={{ display: 'contents' }} {...outer.root}>
|
|
305
341
|
{mergedTriggerChild}
|
|
306
342
|
{mountContent ? (
|
|
307
343
|
<AnchoredOverlayContent
|
package/dist/files/tree/llm.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Upload:需要将本地文件上传到服务端,并展示上传进度与结果列表时。
|
|
4
4
|
|
|
5
|
-
版本:`1.3.
|
|
5
|
+
版本:`1.3.2`。组件源码在本目录,属于当前项目。
|
|
6
6
|
|
|
7
7
|
公开导出:`canPreviewFile`、`configureUploadLimits`、`formatFileSize`、`getFileExtension`、`getFileFormatIconName`、`getFileKind`、`getFilePreviewKind`、`getFilePreviewUrl`、`getUploadLimits`、`isDocumentFile`、`isImageFile`、`resetUploadLimits`、`UPLOAD_DEFAULT_MAX_COUNT`、`UPLOAD_DEFAULT_MAX_FILE_SIZE`、`UPLOAD_LIST_IGNORE`、`Upload`。
|
|
8
8
|
|
|
@@ -702,6 +702,31 @@ v1 列表 uploading 态使用圆形 Spin 指示进度,不提供 antd 线型 `p
|
|
|
702
702
|
|
|
703
703
|
文件不会出现在上传列表中,也不会触发上传。可返回字符串 `'LIST_IGNORE'`,或从包中导入常量 `UPLOAD_LIST_IGNORE`(值同为 `'LIST_IGNORE'`)。
|
|
704
704
|
|
|
705
|
+
### 在 `Form` 里怎么用 Upload?
|
|
706
|
+
|
|
707
|
+
Upload 的值是 `fileList`,`onChange` 回调的参数是 `{ file, fileList }` 对象,和输入框“`value` + `onChange(值)`”的约定不同。放进 `Form.Item` 时要配两个属性,让表单直接存文件列表:
|
|
708
|
+
|
|
709
|
+
```tsx
|
|
710
|
+
<Form.Item
|
|
711
|
+
name="files"
|
|
712
|
+
label="附件"
|
|
713
|
+
initialValue={[]}
|
|
714
|
+
valuePropName="fileList"
|
|
715
|
+
getValueFromEvent={(info) => info.fileList}
|
|
716
|
+
rules={[{ required: true, message: '请上传附件' }]}
|
|
717
|
+
>
|
|
718
|
+
<Upload beforeUpload={() => false}>
|
|
719
|
+
<Button>选择文件</Button>
|
|
720
|
+
</Upload>
|
|
721
|
+
</Form.Item>
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
- `valuePropName="fileList"`:表单值通过 Upload 的 `fileList` 传入,Upload 变成受控组件。
|
|
725
|
+
- `getValueFromEvent`:从 `onChange` 的参数里取出 `fileList` 存进表单。
|
|
726
|
+
- `initialValue={[]}`:`resetFields()` 时恢复成空列表;不给的话,重置后值为 `undefined`,Upload 退回非受控,已选文件不会清空。
|
|
727
|
+
|
|
728
|
+
这样 `onFinish` 拿到的 `files` 就是 `UploadFile[]`,`required` 在列表为空时报错。不配这两个属性时,表单存的是整个 `{ file, fileList }` 对象,重置也清不掉列表。`beforeUpload` 返回 `false` 表示只选文件、提交表单时再自己上传;要选完立刻上传,就配 `action` 或 `customRequest`。
|
|
729
|
+
|
|
705
730
|
### Upload 能预览 PDF 或 Office 文件吗?
|
|
706
731
|
|
|
707
732
|
不能。默认预览仅对图片生效(通过 `Image.PreviewGroup`)。非图片文件需使用 `onPreview` 回调自行实现,例如在新窗口打开文件 URL 或调用第三方文档预览服务。
|