lingee-ui 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button/index.css +1 -1
- package/dist/button/index.d.mts +1 -1
- package/dist/button/index.d.ts +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/chunk-2EQT33RE.mjs +2 -0
- package/dist/chunk-D25GF6TL.mjs +1 -0
- package/dist/{chunk-SXHF5CXB.js → chunk-GN64U4A6.js} +1 -1
- package/dist/chunk-HBUCDYU4.mjs +2 -0
- package/dist/chunk-KY6SDUK5.mjs +1 -0
- package/dist/chunk-LBNA6G3N.js +1 -0
- package/dist/{chunk-QIMQMSJB.js → chunk-LSQ4CC7K.js} +1 -1
- package/dist/chunk-N524EGAL.mjs +1 -0
- package/dist/chunk-NK4H3KPJ.js +1 -0
- package/dist/chunk-OKHDREZ4.js +1 -0
- package/dist/{chunk-6M7ESUQX.mjs → chunk-Q4CF2U5W.mjs} +1 -1
- package/dist/chunk-SV5ZR6K5.js +2 -0
- package/dist/{chunk-7F53VFM6.mjs → chunk-U7SNZQQT.mjs} +1 -1
- package/dist/chunk-VV2IBN64.mjs +1 -0
- package/dist/chunk-Y3P3LG3L.js +2 -0
- package/dist/chunk-YSWFM6ML.js +1 -0
- package/dist/{index-7pb5YOcq.d.mts → index-89atTLPD.d.mts} +2 -2
- package/dist/{index-7pb5YOcq.d.ts → index-89atTLPD.d.ts} +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.mts +463 -25
- package/dist/index.d.ts +463 -25
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/input/index.css +1 -1
- package/dist/input/index.js +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/popover/index.css +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/tabs/index.css +1 -1
- package/dist/tabs/index.d.mts +29 -3
- package/dist/tabs/index.d.ts +29 -3
- package/dist/tabs/index.js +1 -1
- package/dist/tabs/index.mjs +1 -1
- package/dist/textarea/index.css +1 -1
- package/dist/toast/index.css +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/toast/index.mjs +1 -1
- package/dist/tokens.css +1 -1
- package/dist/tooltip/index.css +1 -1
- package/dist/tooltip/index.d.mts +7 -5
- package/dist/tooltip/index.d.ts +7 -5
- package/dist/tooltip/index.js +1 -1
- package/dist/tooltip/index.mjs +1 -1
- package/dist/tree/index.css +1 -1
- package/dist/tree/index.js +1 -1
- package/dist/tree/index.mjs +1 -1
- package/package.json +4 -1
- package/skill/AGENTS-SNIPPET.md +44 -8
- package/skill/SKILL.md +22 -14
- package/skill/VERSION.json +5 -5
- package/skill/references/components/carousel.md +93 -0
- package/skill/references/components/dialog.md +2 -2
- package/skill/references/components/dropdown.md +51 -1
- package/skill/references/components/empty.md +3 -2
- package/skill/references/components/scroll-area.md +29 -0
- package/skill/references/components/select.md +1 -0
- package/skill/references/components/sidebar.md +1 -1
- package/skill/references/components/tabs.md +16 -1
- package/skill/references/components/tooltip.md +7 -2
- package/skill/references/components/upload.md +53 -1
- package/skill/references/icons.md +7 -5
- package/skill/references/setup.md +14 -2
- package/skill/references/tokens.md +41 -6
- package/dist/chunk-C5BDJQIO.js +0 -2
- package/dist/chunk-DIXO53WK.mjs +0 -1
- package/dist/chunk-H7GT6UT4.mjs +0 -1
- package/dist/chunk-IE7TAOTL.mjs +0 -2
- package/dist/chunk-JKY43GCS.mjs +0 -1
- package/dist/chunk-M2SC5LED.js +0 -1
- package/dist/chunk-P56ABRDC.js +0 -1
- package/dist/chunk-WAYZVZQB.js +0 -1
- package/dist/chunk-XG3DE76O.mjs +0 -1
- package/dist/chunk-ZXUYGVWB.js +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as ButtonProps } from './index-
|
|
2
|
-
export { a as Button, b as ButtonShape, c as ButtonSize, d as ButtonVariant } from './index-
|
|
1
|
+
import { B as ButtonProps } from './index-89atTLPD.mjs';
|
|
2
|
+
export { a as Button, b as ButtonShape, c as ButtonSize, d as ButtonVariant } from './index-89atTLPD.mjs';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default, { ReactNode, CSSProperties, HTMLAttributes, MouseEvent, ComponentType, Key, ReactElement, UIEventHandler, Ref } from 'react';
|
|
5
5
|
import { TooltipProps } from './tooltip/index.mjs';
|
|
6
6
|
export { Tooltip, TooltipPlacement } from './tooltip/index.mjs';
|
|
7
|
-
export { TabItem, Tabs, TabsProps, TabsSize, TabsVariant } from './tabs/index.mjs';
|
|
7
|
+
export { TabItem, Tabs, TabsOverflow, TabsProps, TabsScrollOptions, TabsSize, TabsVariant } from './tabs/index.mjs';
|
|
8
8
|
import { PopoverContentProps } from './popover/index.mjs';
|
|
9
9
|
export { Popover, PopoverAnchor, PopoverAnchorProps, PopoverArrow, PopoverArrowProps, PopoverClose, PopoverCloseProps, PopoverContent, PopoverPlacement, PopoverProps, PopoverTrigger, PopoverTriggerProps } from './popover/index.mjs';
|
|
10
10
|
export { Switch, SwitchProps, SwitchSize } from './switch/index.mjs';
|
|
@@ -70,6 +70,39 @@ interface EllipsisTooltipProps extends Omit<TooltipProps, "children" | "content"
|
|
|
70
70
|
*/
|
|
71
71
|
declare const EllipsisTooltip: React__default.ForwardRefExoticComponent<EllipsisTooltipProps & React__default.RefAttributes<HTMLElement>>;
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* site 全局配置
|
|
75
|
+
*
|
|
76
|
+
* `Dialog.confirm` 等命令式 API 不在 React 树内,读不到 Provider 的 context,
|
|
77
|
+
* 因此 LingeeProvider 把 site 同步写入这个模块级变量供它们读取。
|
|
78
|
+
*
|
|
79
|
+
* site 用于开启仅特定宿主环境需要的集成能力,默认关闭,
|
|
80
|
+
* 其它项目使用组件库时行为不变。
|
|
81
|
+
*
|
|
82
|
+
* ── 为什么不是单个变量,而是一份带深度的注册表 ──
|
|
83
|
+
*
|
|
84
|
+
* Provider 可能嵌套(如文档站给个别隐藏页单独开 site,外层保持关闭),
|
|
85
|
+
* 也可能在运行时卸载(微前端子应用退出)。单变量 + 无条件覆盖会有两个问题:
|
|
86
|
+
*
|
|
87
|
+
* 1. **外层重渲染冲掉内层的值**。两层 Provider 首次渲染时内层后跑、值正确,
|
|
88
|
+
* 但外层此后任何一次重渲染(切语言、切主题)都会把它写回自己的值,
|
|
89
|
+
* 而 React 不一定跟着重渲内层。表现为代理能力时好时坏,复现条件隐蔽。
|
|
90
|
+
* 2. **卸载后值残留**。Provider 卸载了 site 还留着,后续命令式调用
|
|
91
|
+
* 仍按宿主环境走。
|
|
92
|
+
*
|
|
93
|
+
* 改为按实例注册,并记录每个实例在 React 树中的**深度**:
|
|
94
|
+
* 生效值取深度最大者,即最内层,与 context 的语义一致。
|
|
95
|
+
*
|
|
96
|
+
* 为什么用深度而非「最后注册者」:注册顺序在重渲染与卸载后会乱。
|
|
97
|
+
* 例如内层卸载后外层重渲染,Map 里外层反而成了最后一个 —— 恰好正确;
|
|
98
|
+
* 但若外层先重渲染再挂载另一个内层,顺序又反了。深度是结构属性,不受时序影响。
|
|
99
|
+
*
|
|
100
|
+
* 为什么用 Map 而非计数器:render 期的调用可能被 React 丢弃或重复执行
|
|
101
|
+
* (并发渲染、严格模式二次调用),计数会漂移;按 token 覆盖写入则天然幂等。
|
|
102
|
+
*/
|
|
103
|
+
/** 组件库运行宿主标识。lingee = 运行在 lingee 客户端 webview 内 */
|
|
104
|
+
type LingeeSite = 'lingee';
|
|
105
|
+
|
|
73
106
|
/**
|
|
74
107
|
* 中文语言包(默认语言)
|
|
75
108
|
* 按组件名为 key 组织翻译文案
|
|
@@ -84,6 +117,8 @@ declare const zhCN: {
|
|
|
84
117
|
Select: {
|
|
85
118
|
loading: string;
|
|
86
119
|
loadError: string;
|
|
120
|
+
/** 传入 onRetry 时使用:引导语由 Empty.Card 统一追加,此处不含「请重试」 */
|
|
121
|
+
loadFailed: string;
|
|
87
122
|
notFound: string;
|
|
88
123
|
clear: string;
|
|
89
124
|
};
|
|
@@ -97,6 +132,13 @@ declare const zhCN: {
|
|
|
97
132
|
scrollLeft: string;
|
|
98
133
|
scrollRight: string;
|
|
99
134
|
};
|
|
135
|
+
Carousel: {
|
|
136
|
+
carousel: string;
|
|
137
|
+
prev: string;
|
|
138
|
+
next: string;
|
|
139
|
+
/** {page} 为页码,从 1 开始 */
|
|
140
|
+
goToPage: string;
|
|
141
|
+
};
|
|
100
142
|
Form: {
|
|
101
143
|
/** {label} 为表单项名称 */
|
|
102
144
|
required: string;
|
|
@@ -172,6 +214,10 @@ declare const zhCN: {
|
|
|
172
214
|
Spin: {
|
|
173
215
|
loading: string;
|
|
174
216
|
};
|
|
217
|
+
Empty: {
|
|
218
|
+
/** 错误态传入 onRetry 后,固定追加在 description 之后的重试引导 */
|
|
219
|
+
retry: string;
|
|
220
|
+
};
|
|
175
221
|
};
|
|
176
222
|
|
|
177
223
|
/** 语言包类型,由 zh-CN 推导结构 */
|
|
@@ -179,6 +225,18 @@ type Locale = typeof zhCN;
|
|
|
179
225
|
interface LingeeProviderProps {
|
|
180
226
|
/** 语言包,默认中文 */
|
|
181
227
|
locale?: Locale;
|
|
228
|
+
/**
|
|
229
|
+
* 运行宿主标识,默认不传。
|
|
230
|
+
*
|
|
231
|
+
* 传 "lingee" 表示应用运行在 lingee 客户端 webview 内,开启宿主集成能力:
|
|
232
|
+
* `Dialog.confirm` 与设置了 `lingeeRoute` 的 `Dialog` 会改由客户端渲染,
|
|
233
|
+
* 使遮罩能覆盖客户端侧边栏(webview 内的遮罩只能盖住 webview 视口)。
|
|
234
|
+
*
|
|
235
|
+
* 不传即保持纯前端行为,其它项目接入组件库不受影响。
|
|
236
|
+
* 注意:即使传了 lingee,浏览器环境下因取不到 lingeeBridge 也会自动回退本地渲染,
|
|
237
|
+
* 因此无需按环境条件传值。
|
|
238
|
+
*/
|
|
239
|
+
site?: LingeeSite;
|
|
182
240
|
children: ReactNode;
|
|
183
241
|
}
|
|
184
242
|
|
|
@@ -196,6 +254,7 @@ declare const enUS: {
|
|
|
196
254
|
Select: {
|
|
197
255
|
loading: string;
|
|
198
256
|
loadError: string;
|
|
257
|
+
loadFailed: string;
|
|
199
258
|
notFound: string;
|
|
200
259
|
clear: string;
|
|
201
260
|
};
|
|
@@ -209,6 +268,12 @@ declare const enUS: {
|
|
|
209
268
|
scrollLeft: string;
|
|
210
269
|
scrollRight: string;
|
|
211
270
|
};
|
|
271
|
+
Carousel: {
|
|
272
|
+
carousel: string;
|
|
273
|
+
prev: string;
|
|
274
|
+
next: string;
|
|
275
|
+
goToPage: string;
|
|
276
|
+
};
|
|
212
277
|
Form: {
|
|
213
278
|
required: string;
|
|
214
279
|
requiredNoLabel: string;
|
|
@@ -282,6 +347,9 @@ declare const enUS: {
|
|
|
282
347
|
Spin: {
|
|
283
348
|
loading: string;
|
|
284
349
|
};
|
|
350
|
+
Empty: {
|
|
351
|
+
retry: string;
|
|
352
|
+
};
|
|
285
353
|
};
|
|
286
354
|
|
|
287
355
|
/**
|
|
@@ -299,7 +367,7 @@ declare const enUS: {
|
|
|
299
367
|
* </LingeeProvider>
|
|
300
368
|
* ```
|
|
301
369
|
*/
|
|
302
|
-
declare function LingeeProvider({ locale, children }: LingeeProviderProps): react_jsx_runtime.JSX.Element;
|
|
370
|
+
declare function LingeeProvider({ locale, site, children }: LingeeProviderProps): react_jsx_runtime.JSX.Element;
|
|
303
371
|
declare namespace LingeeProvider {
|
|
304
372
|
var displayName: string;
|
|
305
373
|
}
|
|
@@ -311,6 +379,10 @@ declare function useLocale(): Locale;
|
|
|
311
379
|
* 获取指定组件的语言包片段
|
|
312
380
|
*/
|
|
313
381
|
declare function useComponentLocale<K extends keyof Omit<Locale, "locale">>(componentName: K): Locale[K];
|
|
382
|
+
/**
|
|
383
|
+
* 获取当前接入方标识(React 组件内使用;命令式场景用 site-config 的 getSite)
|
|
384
|
+
*/
|
|
385
|
+
declare function useSite(): LingeeSite | undefined;
|
|
314
386
|
|
|
315
387
|
/** 预设语义色 */
|
|
316
388
|
type TagPresetColor = "primary" | "info" | "success" | "warning" | "danger" | "amber" | "yellow" | "cyan" | "purple";
|
|
@@ -354,14 +426,100 @@ declare const Tag: React__default.ForwardRefExoticComponent<TagProps & React__de
|
|
|
354
426
|
|
|
355
427
|
/** 透传给 OK/Cancel 按钮的属性子集(排除 children 和事件,由 Dialog 统一管理) */
|
|
356
428
|
type DialogButtonProps = Omit<ButtonProps, "children" | "onClick" | "htmlType">;
|
|
429
|
+
/**
|
|
430
|
+
* 宿主弹窗配置
|
|
431
|
+
*
|
|
432
|
+
* 承载容器(客户端 webview / 被嵌的 iframe)内渲染的遮罩只能覆盖容器视口,
|
|
433
|
+
* 盖不住外层的侧边栏。传入本配置后,Dialog 在这类环境中不再本地渲染,
|
|
434
|
+
* 而是请求宿主在更外层开窗、加载 `route` 指向的独立路由页,遮罩即可覆盖整个宿主视口。
|
|
435
|
+
*
|
|
436
|
+
* 三条路径的选择由组件库内部完成(见 host-modal.ts):
|
|
437
|
+
* - 被 iframe 嵌套 → postMessage 请父窗口承载(端上父窗口会再转给客户端)
|
|
438
|
+
* - 客户端 webview 顶层(需 site="lingee")→ 直连 lingeeBridge
|
|
439
|
+
* - 浏览器顶层、或宿主拒绝承载 → 本地渲染 `children`
|
|
440
|
+
*
|
|
441
|
+
* 调用方无需分支判断,但 `children` 必须写上 —— 那是回退路径的内容。
|
|
442
|
+
*
|
|
443
|
+
* 尺寸无需单独配置:宽度取 Dialog 的 `width`;`height` / `maxHeight` 是面板总高,
|
|
444
|
+
* 直接沿用本地 Dialog 的尺寸。只有显式 `contentHeight` 表示纯内容区高度,
|
|
445
|
+
* 常规模式由组件库补上宿主标题栏的 68px,headless 模式不补。
|
|
446
|
+
*/
|
|
447
|
+
interface DialogHostModal {
|
|
448
|
+
/** 应用内绝对路径,如 "/host-modal/skill-detail";宿主会拼上当前页 origin */
|
|
449
|
+
route: string;
|
|
450
|
+
/** 业务入参,经宿主内存传递,不落 URL;须可结构化克隆 */
|
|
451
|
+
params?: unknown;
|
|
452
|
+
/**
|
|
453
|
+
* 不要宿主的标题栏,头部由承载页自绘(默认 false)。
|
|
454
|
+
*
|
|
455
|
+
* 宿主标题栏只能显示一行纯文本 + 右上角关闭按钮。头部较复杂的弹窗
|
|
456
|
+
* (带图标、副标题、右侧操作、Tab 等)用它关掉,自己在承载页里画
|
|
457
|
+
* (配合 `HostModalPage` 的 `header`)。
|
|
458
|
+
*
|
|
459
|
+
* 两点后果:
|
|
460
|
+
* 1. **关闭按钮一并消失**(它长在标题栏上)。承载页必须自备关闭入口调
|
|
461
|
+
* `closeHostModal()`,否则用户只能点遮罩关闭。
|
|
462
|
+
* 2. `contentHeight` 不再叠加标题栏的 68px,内容区高度就是面板总高。
|
|
463
|
+
* `height` / `maxHeight` 无论是否 headless,始终表示面板总高。
|
|
464
|
+
*
|
|
465
|
+
* 回退路径(浏览器顶层)不受影响:那条渲染 Dialog 自己的外壳,
|
|
466
|
+
* 标题栏由 `title` / `closable` 控制。
|
|
467
|
+
*/
|
|
468
|
+
headless?: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* 纯内容区高度,优先于 Dialog 的 `height` / `maxHeight`。
|
|
471
|
+
*
|
|
472
|
+
* 宿主开窗必须在开窗前拿到确定像素值,而部分弹窗的高度是由 CSS 控制的
|
|
473
|
+
* (如 `max-height: 85vh`),组件库读不到。此时用本字段告知内容区高度即可:
|
|
474
|
+
* 有宿主标题栏时自动加 68px,headless 时直接作为面板总高。
|
|
475
|
+
*/
|
|
476
|
+
contentHeight?: number;
|
|
477
|
+
/**
|
|
478
|
+
* 点击宿主遮罩是否关闭弹窗。
|
|
479
|
+
*
|
|
480
|
+
* **三态字段**:
|
|
481
|
+
* - 不传 → 沿用宿主的既有默认值(浏览器 webui 与客户端都是「可点遮罩关闭」)
|
|
482
|
+
* - `true` / `false` → 宿主一律按此值
|
|
483
|
+
*
|
|
484
|
+
* 为什么不复用 Dialog 的 `modal`:`modal` 只作用于本地渲染的外壳,且极性相反
|
|
485
|
+
* (`modal: true` 等于「不可关」)。宿主承载时组件库整个不产出 DOM,`modal`
|
|
486
|
+
* 到不了宿主;而把它顺带映射过去,会让 `Dialog.confirm` 那些默认 `modal: true`
|
|
487
|
+
* 的存量调用点在端上突然变成「点遮罩关不掉」—— 那是行为变更,不是补能力。
|
|
488
|
+
* 因此新增独立字段,只在显式声明时生效。
|
|
489
|
+
*
|
|
490
|
+
* ⚠️ 只管遮罩点击。Esc 与宿主标题栏的关闭按钮仍能关闭弹窗;
|
|
491
|
+
* `headless` 时没有关闭按钮,此处再传 `false` 会让弹窗只剩 Esc 可退出,
|
|
492
|
+
* 承载页必须自绘关闭入口。
|
|
493
|
+
*
|
|
494
|
+
* ⚠️ 旧客户端不认识该字段,会静默忽略并保持「可点遮罩关闭」。
|
|
495
|
+
* 若用它防止表单被误关,端上灰度期内防不住。
|
|
496
|
+
*/
|
|
497
|
+
maskClosable?: boolean;
|
|
498
|
+
/**
|
|
499
|
+
* 宿主弹窗关闭时回调。
|
|
500
|
+
* @param result 承载页通过 `closeHostModal` 回传的业务结果;用户直接关窗时为 undefined
|
|
501
|
+
*/
|
|
502
|
+
onResult?: (result?: unknown) => void;
|
|
503
|
+
}
|
|
357
504
|
interface DialogProps {
|
|
358
505
|
/** 是否打开 */
|
|
359
506
|
open: boolean;
|
|
360
507
|
/** 状态变化回调(关闭时 nextOpen=false) */
|
|
361
508
|
onOpenChange: (open: boolean) => void;
|
|
509
|
+
/**
|
|
510
|
+
* 宿主弹窗配置。
|
|
511
|
+
*
|
|
512
|
+
* 传入后,在有外层容器的环境中(客户端 webview / 被 iframe 嵌套)本组件不渲染
|
|
513
|
+
* 任何 DOM,改由宿主开窗承载 `route` 路由页;浏览器顶层或宿主拒绝时自动回退
|
|
514
|
+
* 为本地渲染,`children` 照常生效。
|
|
515
|
+
*
|
|
516
|
+
* 客户端 webview 那条路径需 LingeeProvider 设置 site="lingee";
|
|
517
|
+
* iframe 那条不需要(被嵌的第三方页面拿不到该配置)。
|
|
518
|
+
*/
|
|
519
|
+
hostModal?: DialogHostModal;
|
|
362
520
|
/** 弹窗宽度,默认 460 */
|
|
363
521
|
width?: number | string;
|
|
364
|
-
/**
|
|
522
|
+
/** 弹窗面板总高,默认自适应内容 */
|
|
365
523
|
height?: number | string;
|
|
366
524
|
/** 标题(支持 ReactNode) */
|
|
367
525
|
title?: ReactNode;
|
|
@@ -395,7 +553,7 @@ interface DialogProps {
|
|
|
395
553
|
destroyOnHidden?: boolean;
|
|
396
554
|
/** 自定义 z-index */
|
|
397
555
|
zIndex?: number;
|
|
398
|
-
/**
|
|
556
|
+
/** 弹窗面板总高上限,默认 640px */
|
|
399
557
|
maxHeight?: number | string;
|
|
400
558
|
/** 开启后 body 高度跟随内容自适应,弹窗整体高度由 maxHeight 兜底上限,默认 false */
|
|
401
559
|
autoHeight?: boolean;
|
|
@@ -413,6 +571,25 @@ interface ConfirmRenderProps {
|
|
|
413
571
|
}
|
|
414
572
|
/** Dialog.confirm 命令式参数 */
|
|
415
573
|
interface DialogConfirmOptions extends Omit<DialogProps, "open" | "onOpenChange" | "children"> {
|
|
574
|
+
/**
|
|
575
|
+
* 点击遮罩是否关闭确认框(按取消结算)。
|
|
576
|
+
*
|
|
577
|
+
* **三态字段**,不传时各渲染方保持各自现状 —— 这条链路的既有默认值本就不一致:
|
|
578
|
+
*
|
|
579
|
+
* | 渲染方 | 不传时的行为 |
|
|
580
|
+
* |---|---|
|
|
581
|
+
* | 本地渲染(`modal ?? true`) | 点遮罩**不**关闭 |
|
|
582
|
+
* | 浏览器里由 webui 承载 | 点遮罩**不**关闭(同样是本地 `Dialog.confirm`) |
|
|
583
|
+
* | 客户端原生确认框 | 点遮罩关闭,按取消结算 |
|
|
584
|
+
*
|
|
585
|
+
* 没有把端上拉平到「不关闭」:那会改变所有走代理的存量确认框行为,
|
|
586
|
+
* 而 webui 侧 `Dialog.confirm` 调用点有三十余处,收益不抵回归成本。
|
|
587
|
+
* 需要两端一致时显式传值即可 —— 显式传值会**同时**约束本地渲染与宿主,
|
|
588
|
+
* 这也是它与 `modal` 分开的原因:`modal` 只影响本地外壳且极性相反。
|
|
589
|
+
*
|
|
590
|
+
* 与 `modal` 同时出现时 `modal` 优先(它是更早的本地专用参数,不破坏既有代码)。
|
|
591
|
+
*/
|
|
592
|
+
maskClosable?: boolean;
|
|
416
593
|
/** 描述文案(使用默认布局时展示) */
|
|
417
594
|
description?: ReactNode;
|
|
418
595
|
/** 标题前的图标(使用默认布局时展示) */
|
|
@@ -429,14 +606,83 @@ interface DialogConfirmOptions extends Omit<DialogProps, "open" | "onOpenChange"
|
|
|
429
606
|
*/
|
|
430
607
|
declare const Dialog$1: React__default.FC<DialogProps>;
|
|
431
608
|
|
|
432
|
-
/**
|
|
433
|
-
* 命令式确认弹窗
|
|
434
|
-
* @returns Promise<boolean> — 确认返回 true,取消返回 false
|
|
435
|
-
*/
|
|
436
609
|
declare function confirm(options: DialogConfirmOptions): Promise<boolean>;
|
|
437
610
|
/** 命令式关闭当前 confirm 弹窗(不 resolve,用于外部强制关闭兜底) */
|
|
438
611
|
declare function closeConfirm(): void;
|
|
439
612
|
|
|
613
|
+
/** 当前页面是否运行在宿主弹窗内(含端侧 webview 与浏览器 iframe 两种承载) */
|
|
614
|
+
declare function isInHostModal(): boolean;
|
|
615
|
+
/**
|
|
616
|
+
* 读取宿主传入的业务入参(同步)。
|
|
617
|
+
*
|
|
618
|
+
* 仅端侧承载可用 —— 那边是同步 IPC。浏览器 iframe 承载下必然返回 null,
|
|
619
|
+
* 需要用 `HostModalPage`(内部走异步通道)。
|
|
620
|
+
*/
|
|
621
|
+
declare function getHostModalParams<T = unknown>(): T | null;
|
|
622
|
+
/**
|
|
623
|
+
* 通知宿主内容已渲染,据此撤掉 loading 占位。
|
|
624
|
+
*
|
|
625
|
+
* 不能让宿主依赖容器的加载事件:那只表示 DOM 结构就绪,
|
|
626
|
+
* 此时 SPA 的 JS 还没执行完、React 未挂载、页面是空白的,
|
|
627
|
+
* 过早撤 loading 会露出一段白屏。
|
|
628
|
+
*/
|
|
629
|
+
declare function notifyHostModalReady(): void;
|
|
630
|
+
/** 关闭宿主弹窗并回传业务结果 */
|
|
631
|
+
declare function closeHostModal(result?: unknown): void;
|
|
632
|
+
interface HostModalPageProps<P> {
|
|
633
|
+
/**
|
|
634
|
+
* 内容渲染函数。
|
|
635
|
+
* @param params 宿主传入的业务入参
|
|
636
|
+
* @param close 回传结果并关窗
|
|
637
|
+
*/
|
|
638
|
+
children: (params: P, close: (result?: unknown) => void) => React__default.ReactNode;
|
|
639
|
+
/**
|
|
640
|
+
* 无入参时的兜底渲染(页面被直接访问、或开发期无宿主)。
|
|
641
|
+
* 不提供则渲染 null。
|
|
642
|
+
*/
|
|
643
|
+
fallback?: React__default.ReactNode;
|
|
644
|
+
/**
|
|
645
|
+
* 内容是否已就绪。
|
|
646
|
+
*
|
|
647
|
+
* 缺省 true —— 入参由宿主给出,拿到即等于内容可见。
|
|
648
|
+
* 若业务页还需等接口,传入 `!loading` 让 loading 占位保留到数据到位,
|
|
649
|
+
* 避免撤早了露出骨架或空列表。
|
|
650
|
+
*
|
|
651
|
+
* ⚠️ 注意宿主有 8 秒兜底超时,超时会切「连接失败」错误态。
|
|
652
|
+
* 接口可能慢过 8 秒的页面建议先渲染骨架并立即上报,数据到位后局部刷新。
|
|
653
|
+
*/
|
|
654
|
+
ready?: boolean;
|
|
655
|
+
/**
|
|
656
|
+
* 自绘头部内容,配合发起端的 `hostModal.headless` 使用。
|
|
657
|
+
*
|
|
658
|
+
* 发起端开了 `headless` 后宿主不再渲染标题栏与关闭按钮,头部由这里提供。
|
|
659
|
+
* 渲染函数收到 `close`,用于绘制自己的关闭按钮。
|
|
660
|
+
*
|
|
661
|
+
* 只传本属性不会让宿主去掉标题栏 —— 那由发起端的 `headless` 决定。
|
|
662
|
+
* 两处不匹配的后果:发起端开了而这里没传 → 弹窗没有任何关闭入口(只能点遮罩);
|
|
663
|
+
* 这里传了而发起端没开 → 宿主标题栏与自绘头部上下叠两层。
|
|
664
|
+
*/
|
|
665
|
+
header?: (close: (result?: unknown) => void) => React__default.ReactNode;
|
|
666
|
+
/** 附加到容器上的类名,用于控制内边距等业务样式 */
|
|
667
|
+
className?: string;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* 宿主弹窗承载页外壳。
|
|
671
|
+
*
|
|
672
|
+
* @example
|
|
673
|
+
* export default function SkillDetailModalPage() {
|
|
674
|
+
* return (
|
|
675
|
+
* <HostModalPage<{ skill: Skill }> className="my-modal" fallback={<Navigate to="/skills" replace />}>
|
|
676
|
+
* {({ skill }, close) => <SkillDetailContent skill={skill} onUse={() => close({ type: 'use' })} />}
|
|
677
|
+
* </HostModalPage>
|
|
678
|
+
* );
|
|
679
|
+
* }
|
|
680
|
+
*/
|
|
681
|
+
declare function HostModalPage<P = unknown>({ children, fallback, ready, header, className, }: HostModalPageProps<P>): react_jsx_runtime.JSX.Element | null;
|
|
682
|
+
declare namespace HostModalPage {
|
|
683
|
+
var displayName: string;
|
|
684
|
+
}
|
|
685
|
+
|
|
440
686
|
type DialogType = typeof Dialog$1 & {
|
|
441
687
|
confirm: typeof confirm;
|
|
442
688
|
closeConfirm: typeof closeConfirm;
|
|
@@ -503,8 +749,14 @@ interface SelectProps<T = string> {
|
|
|
503
749
|
onSearch?: (keyword: string) => void;
|
|
504
750
|
/** 加载中状态(远程搜索时展示 loading) */
|
|
505
751
|
loading?: boolean;
|
|
506
|
-
/**
|
|
752
|
+
/** 加载失败状态(下拉面板展示加载失败缺省) */
|
|
507
753
|
loadError?: boolean;
|
|
754
|
+
/**
|
|
755
|
+
* 加载失败后的重试回调。
|
|
756
|
+
* 传入后 loadError 缺省态可点击,并在文案后追加「重试」;
|
|
757
|
+
* 不传则为纯提示(此时 loadError 文案自带「请重试」引导)
|
|
758
|
+
*/
|
|
759
|
+
onRetry?: () => void;
|
|
508
760
|
/** 禁用 */
|
|
509
761
|
disabled?: boolean;
|
|
510
762
|
/** 错误态 */
|
|
@@ -541,6 +793,20 @@ declare const Select: <T = string>(props: SelectProps<T> & {
|
|
|
541
793
|
ref?: React__default.Ref<HTMLDivElement>;
|
|
542
794
|
}) => React__default.ReactElement | null;
|
|
543
795
|
|
|
796
|
+
/**
|
|
797
|
+
* 菜单项文本的溢出提示开关。
|
|
798
|
+
*
|
|
799
|
+
* 不传时行为与此前完全一致(文本撑开面板,不打点也不弹提示)。
|
|
800
|
+
* 传入后文本带默认最大宽度并单行截断,**仅在真正被截断时**悬浮显示完整内容,
|
|
801
|
+
* 未截断不弹(由 EllipsisTooltip 在 hover 时实时测量决定)。
|
|
802
|
+
*
|
|
803
|
+
* - `true`:取 `label` / `children` 作为提示内容。内容为 JSX 时会整块塞进浮层,
|
|
804
|
+
* 这类场景应显式传 ReactNode 指定纯文本
|
|
805
|
+
* - `ReactNode`:以其作为提示内容
|
|
806
|
+
*
|
|
807
|
+
* 最大宽度默认 240px,可通过 `--lg-dropdown-label-max-width` 覆盖。
|
|
808
|
+
*/
|
|
809
|
+
type DropdownEllipsisTooltip = boolean | ReactNode;
|
|
544
810
|
interface DropdownMenuItemData {
|
|
545
811
|
type?: "item";
|
|
546
812
|
/** 唯一标识 */
|
|
@@ -557,6 +823,8 @@ interface DropdownMenuItemData {
|
|
|
557
823
|
disabled?: boolean;
|
|
558
824
|
/** 选中回调 */
|
|
559
825
|
onSelect?: (event: Event) => void;
|
|
826
|
+
/** 文本溢出时悬浮显示完整内容,详见 DropdownEllipsisTooltip */
|
|
827
|
+
ellipsisTooltip?: DropdownEllipsisTooltip;
|
|
560
828
|
}
|
|
561
829
|
interface DropdownSeparatorData {
|
|
562
830
|
type: "separator";
|
|
@@ -680,6 +948,8 @@ interface DropdownItemProps {
|
|
|
680
948
|
selected?: boolean;
|
|
681
949
|
/** 选中回调,调用 event.preventDefault() 可阻止面板自动关闭 */
|
|
682
950
|
onSelect?: (event: Event) => void;
|
|
951
|
+
/** 文本溢出时悬浮显示完整内容,详见 DropdownEllipsisTooltip */
|
|
952
|
+
ellipsisTooltip?: DropdownEllipsisTooltip;
|
|
683
953
|
}
|
|
684
954
|
interface DropdownCheckboxItemProps {
|
|
685
955
|
/** 菜单项内容 */
|
|
@@ -694,6 +964,8 @@ interface DropdownCheckboxItemProps {
|
|
|
694
964
|
icon?: ReactNode;
|
|
695
965
|
/** 选中状态变化回调 */
|
|
696
966
|
onCheckedChange?: (checked: boolean) => void;
|
|
967
|
+
/** 文本溢出时悬浮显示完整内容,详见 DropdownEllipsisTooltip */
|
|
968
|
+
ellipsisTooltip?: DropdownEllipsisTooltip;
|
|
697
969
|
}
|
|
698
970
|
interface DropdownRadioGroupProps {
|
|
699
971
|
/** 子元素(DropdownRadioItem) */
|
|
@@ -714,6 +986,8 @@ interface DropdownRadioItemProps {
|
|
|
714
986
|
disabled?: boolean;
|
|
715
987
|
/** 前置图标 */
|
|
716
988
|
icon?: ReactNode;
|
|
989
|
+
/** 文本溢出时悬浮显示完整内容,详见 DropdownEllipsisTooltip */
|
|
990
|
+
ellipsisTooltip?: DropdownEllipsisTooltip;
|
|
717
991
|
}
|
|
718
992
|
interface DropdownLabelProps {
|
|
719
993
|
/** 标题内容 */
|
|
@@ -753,10 +1027,22 @@ interface DropdownSubTriggerProps {
|
|
|
753
1027
|
* 用于「展开时才拉取数据」这类懒加载场景
|
|
754
1028
|
*/
|
|
755
1029
|
onMouseEnter?: React__default.MouseEventHandler<HTMLDivElement>;
|
|
1030
|
+
/** 文本溢出时悬浮显示完整内容,详见 DropdownEllipsisTooltip */
|
|
1031
|
+
ellipsisTooltip?: DropdownEllipsisTooltip;
|
|
756
1032
|
}
|
|
757
1033
|
interface DropdownSubContentProps extends Pick<PopoverContentProps, "side" | "align" | "sideOffset" | "alignOffset" | "className" | "collisionPadding" | "container"> {
|
|
758
1034
|
/** 子菜单面板内容 */
|
|
759
1035
|
children: ReactNode;
|
|
1036
|
+
/**
|
|
1037
|
+
* 面板自定义样式
|
|
1038
|
+
* - maxHeight: 面板高度上限,超出时内置 ScrollArea 滚动。
|
|
1039
|
+
* 不传时仅以视口可用空间为界(子菜单承载的内容形态差异大,
|
|
1040
|
+
* 统一给固定上限会截断设计高度更大的自定义面板)
|
|
1041
|
+
* - width / minWidth 等其它 CSS 属性均可使用
|
|
1042
|
+
*/
|
|
1043
|
+
style?: CSSProperties;
|
|
1044
|
+
/** 固定在面板底部的内容(不随列表滚动),与 DropdownContent 同口径 */
|
|
1045
|
+
footer?: ReactNode;
|
|
760
1046
|
}
|
|
761
1047
|
interface DropdownButtonProps extends Omit<React__default.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
762
1048
|
/** 按钮文本内容 */
|
|
@@ -1213,22 +1499,33 @@ interface EmptyProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
|
1213
1499
|
*/
|
|
1214
1500
|
type EmptyCardStatus = "loading" | "empty" | "error";
|
|
1215
1501
|
/**
|
|
1216
|
-
*
|
|
1217
|
-
* - block:
|
|
1218
|
-
* - inline:
|
|
1502
|
+
* 密度形态。仅影响留白,图标与文字尺寸由 size 决定。
|
|
1503
|
+
* - block: 区块级占位,留白按 spacing 档位给足
|
|
1504
|
+
* - inline: 行内轻量提示(如「加载更多」),上下留白收紧、左右补 12px
|
|
1219
1505
|
*/
|
|
1220
1506
|
type EmptyCardVariant = "block" | "inline";
|
|
1221
1507
|
/** 上下留白档位 */
|
|
1222
1508
|
type EmptyCardSpacing = "none" | "normal" | "loose";
|
|
1223
|
-
interface EmptyCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onClick"> {
|
|
1509
|
+
interface EmptyCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onClick" | "size"> {
|
|
1224
1510
|
status: EmptyCardStatus;
|
|
1225
1511
|
/** 描述文案。组件不内置文案,由消费方传入 */
|
|
1226
1512
|
description: ReactNode;
|
|
1227
1513
|
/** 覆盖默认图标;传 null 则不渲染图标 */
|
|
1228
1514
|
icon?: ReactNode | null;
|
|
1515
|
+
/**
|
|
1516
|
+
* 尺寸,默认 "sm"。语义与 Empty 的 size 一致,内部直接透传:
|
|
1517
|
+
* - sm: 图标 16px + 文字 12px,横向排列(占位场景默认值)
|
|
1518
|
+
* - md: 图标 24px + 文字 14px,纵向排列
|
|
1519
|
+
* - lg: 图标 56px + 文字 16px,纵向排列
|
|
1520
|
+
*/
|
|
1521
|
+
size?: EmptySize;
|
|
1229
1522
|
variant?: EmptyCardVariant;
|
|
1230
1523
|
spacing?: EmptyCardSpacing;
|
|
1231
|
-
/**
|
|
1524
|
+
/**
|
|
1525
|
+
* 重试回调。仅 status="error" 时生效。
|
|
1526
|
+
* 传入后整体渲染为可点击按钮:带浅色底 + hover 反馈,
|
|
1527
|
+
* 并在 description 之后自动追加主题色「重试」(文案取自 locale,无需消费方拼接)
|
|
1528
|
+
*/
|
|
1232
1529
|
onRetry?: () => void;
|
|
1233
1530
|
className?: string;
|
|
1234
1531
|
style?: CSSProperties;
|
|
@@ -1237,12 +1534,11 @@ interface EmptyCardProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"
|
|
|
1237
1534
|
/**
|
|
1238
1535
|
* Empty.Card — 等高三态占位
|
|
1239
1536
|
*
|
|
1240
|
-
* 统一「加载中 / 加载结束空 /
|
|
1241
|
-
*
|
|
1242
|
-
* 避免列表或卡片区域跳动。
|
|
1537
|
+
* 统一「加载中 / 加载结束空 / 加载结束失败」三态:同一 size + spacing 档位下
|
|
1538
|
+
* 三态 min-height 一致,状态切换时容器高度不变,避免列表或卡片区域跳动。
|
|
1243
1539
|
*
|
|
1244
|
-
*
|
|
1245
|
-
*
|
|
1540
|
+
* 图标与文案的排版直接复用 Empty(size 透传),本组件只额外负责三件事:
|
|
1541
|
+
* 等高约束、重试交互、状态无障碍播报。
|
|
1246
1542
|
*/
|
|
1247
1543
|
declare const EmptyCard: React__default.ForwardRefExoticComponent<EmptyCardProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
1248
1544
|
|
|
@@ -1252,8 +1548,8 @@ declare const EmptyCard: React__default.ForwardRefExoticComponent<EmptyCardProps
|
|
|
1252
1548
|
* 用 Object.assign 而非对象字面量挂载子组件:
|
|
1253
1549
|
* 保留 EmptyRoot 的 forwardRef 类型,使 <Empty ref={...} /> 仍可直接使用。
|
|
1254
1550
|
*/
|
|
1255
|
-
declare const Empty:
|
|
1256
|
-
Card:
|
|
1551
|
+
declare const Empty: React$1.ForwardRefExoticComponent<EmptyProps & React$1.RefAttributes<HTMLDivElement>> & {
|
|
1552
|
+
Card: React$1.ForwardRefExoticComponent<EmptyCardProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1257
1553
|
};
|
|
1258
1554
|
|
|
1259
1555
|
/** 附件/截图元信息 */
|
|
@@ -2706,6 +3002,10 @@ interface FileItemActions {
|
|
|
2706
3002
|
/** 重新上传 */
|
|
2707
3003
|
retry: () => void;
|
|
2708
3004
|
}
|
|
3005
|
+
/** 上传请求方法 */
|
|
3006
|
+
type UploadMethod = "POST" | "PUT" | "PATCH" | "post" | "put" | "patch";
|
|
3007
|
+
/** beforeUpload 允许的返回值:false 阻止上传,File/Blob 替换待传文件 */
|
|
3008
|
+
type BeforeUploadReturn = boolean | void | File | Blob;
|
|
2709
3009
|
interface UploadProps {
|
|
2710
3010
|
/** 接受的文件 MIME 类型,如 "image/*,.pdf" */
|
|
2711
3011
|
accept?: string;
|
|
@@ -2717,6 +3017,11 @@ interface UploadProps {
|
|
|
2717
3017
|
multiple?: boolean;
|
|
2718
3018
|
/** 是否渲染拖拽上传区域 */
|
|
2719
3019
|
drag?: boolean;
|
|
3020
|
+
/**
|
|
3021
|
+
* 是否选择文件夹。开启后点击选择目录,拖拽时递归遍历子目录,
|
|
3022
|
+
* 并强制按 `accept` 过滤(目录内文件不经过选择器,无法靠原生 accept 拦截)。
|
|
3023
|
+
*/
|
|
3024
|
+
directory?: boolean;
|
|
2720
3025
|
/** 禁用状态 */
|
|
2721
3026
|
disabled?: boolean;
|
|
2722
3027
|
/** 受控文件列表 */
|
|
@@ -2731,6 +3036,28 @@ interface UploadProps {
|
|
|
2731
3036
|
* 由消费方在提交时自行携带。
|
|
2732
3037
|
*/
|
|
2733
3038
|
customRequest?: (options: CustomRequestOptions) => CustomRequestReturn | void;
|
|
3039
|
+
/**
|
|
3040
|
+
* 上传地址。传入即启用内置 XHR 上传(含真实进度事件),
|
|
3041
|
+
* 无需自行实现 `customRequest`。同时传入时 `customRequest` 优先。
|
|
3042
|
+
*/
|
|
3043
|
+
action?: string | ((file: File) => string | PromiseLike<string>);
|
|
3044
|
+
/** 请求方法,默认 POST。仅 `action` 模式生效 */
|
|
3045
|
+
method?: UploadMethod;
|
|
3046
|
+
/** 附加请求头。仅 `action` 模式生效 */
|
|
3047
|
+
headers?: Record<string, string>;
|
|
3048
|
+
/** 附加表单字段,可为函数按文件动态生成。仅 `action` 模式生效 */
|
|
3049
|
+
data?: Record<string, unknown> | ((file: File) => Record<string, unknown>);
|
|
3050
|
+
/** 跨域请求是否携带 cookie。仅 `action` 模式生效 */
|
|
3051
|
+
withCredentials?: boolean;
|
|
3052
|
+
/** 表单中文件字段名,默认 "file"。仅 `action` 模式生效 */
|
|
3053
|
+
name?: string;
|
|
3054
|
+
/**
|
|
3055
|
+
* 上传前钩子,在内置校验(类型/数量/大小)通过之后执行。
|
|
3056
|
+
*
|
|
3057
|
+
* 返回 `false` 或 reject 阻止该文件上传;返回 `File`/`Blob` 则用其替换
|
|
3058
|
+
* 待上传的文件,适用于压缩、转格式等场景(原始文件仍保留在 `originFile`)。
|
|
3059
|
+
*/
|
|
3060
|
+
beforeUpload?: (file: File, fileList: File[]) => BeforeUploadReturn | Promise<BeforeUploadReturn>;
|
|
2734
3061
|
/**
|
|
2735
3062
|
* 粘贴上传。开启后监听容器内的 paste 事件,
|
|
2736
3063
|
* 取剪贴板中的文件(如截图)走同一套校验与收集流程。
|
|
@@ -2767,7 +3094,10 @@ interface UploadProps {
|
|
|
2767
3094
|
|
|
2768
3095
|
/**
|
|
2769
3096
|
* Upload 上传组件
|
|
2770
|
-
*
|
|
3097
|
+
*
|
|
3098
|
+
* 内核采用 rc-upload(@rc-component/upload):原生 input、点击/键盘触发、
|
|
3099
|
+
* 拖拽落盘、文件夹递归遍历、accept 判定、XHR 请求与中止均由其承担。
|
|
3100
|
+
* 本层负责 lingee 的 UploadFile 列表语义、批量校验与 UI。
|
|
2771
3101
|
*/
|
|
2772
3102
|
declare const Upload: React__default.ForwardRefExoticComponent<UploadProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2773
3103
|
|
|
@@ -2803,6 +3133,19 @@ interface ScrollAreaProps {
|
|
|
2803
3133
|
onScroll?: UIEventHandler<HTMLDivElement>;
|
|
2804
3134
|
/** Viewport(实际滚动元素)的 ref,用于外部控制滚动位置 */
|
|
2805
3135
|
viewportRef?: Ref<HTMLDivElement>;
|
|
3136
|
+
/**
|
|
3137
|
+
* 声明「本组件是 flex/grid 容器的子项,请撑满分配到的高度」。
|
|
3138
|
+
*
|
|
3139
|
+
* 默认(false)下 viewport 通过 `height: inherit` 取高度,而 `inherit` 拿的是
|
|
3140
|
+
* 父级的**样式值**不是布局结果。当 Root 作为 flex item 被兄弟节点(如面板的
|
|
3141
|
+
* header / footer)压缩时,继承来的仍是未扣除头尾的整高,viewport 因此比 Root
|
|
3142
|
+
* 高出头尾的量,超出部分被裁掉且滚不到,列表末尾永远露不出来。
|
|
3143
|
+
*
|
|
3144
|
+
* 传 true 后 Root 转为 flex 容器、viewport 走 `flex: 1`,高度取自实际布局结果。
|
|
3145
|
+
* 代价是 Root 的 `display` 被组件占用,故不设为默认值 —— 只有确实放在
|
|
3146
|
+
* flex/grid 容器里被压缩的场景才需要开启。
|
|
3147
|
+
*/
|
|
3148
|
+
fill?: boolean;
|
|
2806
3149
|
}
|
|
2807
3150
|
interface ScrollBarProps {
|
|
2808
3151
|
/** 滚动条方向 */
|
|
@@ -2833,6 +3176,101 @@ declare const ScrollArea: React__default.ForwardRefExoticComponent<ScrollAreaPro
|
|
|
2833
3176
|
*/
|
|
2834
3177
|
declare const ScrollBar: React__default.ForwardRefExoticComponent<ScrollBarProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
2835
3178
|
|
|
3179
|
+
/** 指示器位置 */
|
|
3180
|
+
type CarouselDotsPlacement = "inside" | "outside";
|
|
3181
|
+
/**
|
|
3182
|
+
* 轮播实例 API
|
|
3183
|
+
* 刻意收窄为最小可用集合,不直接暴露 embla 类型,避免消费方类型依赖泄漏
|
|
3184
|
+
*/
|
|
3185
|
+
interface CarouselApi {
|
|
3186
|
+
/** 跳转到指定序号(0 开始),jump 为 true 时不播放过渡动画 */
|
|
3187
|
+
scrollTo: (index: number, jump?: boolean) => void;
|
|
3188
|
+
/** 上一页 */
|
|
3189
|
+
scrollPrev: () => void;
|
|
3190
|
+
/** 下一页 */
|
|
3191
|
+
scrollNext: () => void;
|
|
3192
|
+
/** 是否可向前翻页(loop 模式下恒为 true) */
|
|
3193
|
+
canScrollPrev: () => boolean;
|
|
3194
|
+
/** 是否可向后翻页(loop 模式下恒为 true) */
|
|
3195
|
+
canScrollNext: () => boolean;
|
|
3196
|
+
/** 当前选中序号 */
|
|
3197
|
+
selectedIndex: () => number;
|
|
3198
|
+
/** 总页数 */
|
|
3199
|
+
count: () => number;
|
|
3200
|
+
/** 启动自动轮播 */
|
|
3201
|
+
play: () => void;
|
|
3202
|
+
/** 暂停自动轮播 */
|
|
3203
|
+
stop: () => void;
|
|
3204
|
+
/** 重新初始化(外部改变了尺寸或结构时手动触发) */
|
|
3205
|
+
reInit: () => void;
|
|
3206
|
+
}
|
|
3207
|
+
interface CarouselProps {
|
|
3208
|
+
/** 轮播项,需为 CarouselItem */
|
|
3209
|
+
children: ReactNode;
|
|
3210
|
+
/** 自定义类名(应用于根容器) */
|
|
3211
|
+
className?: string;
|
|
3212
|
+
/** 自定义样式(应用于根容器) */
|
|
3213
|
+
style?: CSSProperties;
|
|
3214
|
+
/** 是否循环轮播 */
|
|
3215
|
+
loop?: boolean;
|
|
3216
|
+
/** 是否开启自动轮播 */
|
|
3217
|
+
autoplay?: boolean;
|
|
3218
|
+
/** 自动轮播间隔(ms),设计规范建议 3000 ~ 6000 */
|
|
3219
|
+
autoplayDelay?: number;
|
|
3220
|
+
/** 鼠标移入时暂停自动轮播,移出恢复 */
|
|
3221
|
+
stopOnMouseEnter?: boolean;
|
|
3222
|
+
/** 用户手动交互(拖拽 / 点击指示器)后彻底停止自动轮播 */
|
|
3223
|
+
stopOnInteraction?: boolean;
|
|
3224
|
+
/** 是否允许拖拽 / 滑动切换 */
|
|
3225
|
+
draggable?: boolean;
|
|
3226
|
+
/** 每屏展示的轮播项数量,多图模式下配合 gap 使用 */
|
|
3227
|
+
slidesPerView?: number;
|
|
3228
|
+
/** 轮播项之间的间距(px) */
|
|
3229
|
+
gap?: number;
|
|
3230
|
+
/** 初始选中序号(0 开始) */
|
|
3231
|
+
defaultIndex?: number;
|
|
3232
|
+
/** 是否展示圆点指示器 */
|
|
3233
|
+
dots?: boolean;
|
|
3234
|
+
/** 指示器位置:inside 浮于内容上方,outside 位于轮播下方 */
|
|
3235
|
+
dotsPlacement?: CarouselDotsPlacement;
|
|
3236
|
+
/** 指示器是否使用半透明毛玻璃胶囊底,用于内容色彩复杂的场景 */
|
|
3237
|
+
dotsGlassy?: boolean;
|
|
3238
|
+
/** 是否展示左右箭头 */
|
|
3239
|
+
arrows?: boolean;
|
|
3240
|
+
/** 选中项变化回调 */
|
|
3241
|
+
onChange?: (index: number) => void;
|
|
3242
|
+
/** 获取轮播实例,用于外部控制翻页 */
|
|
3243
|
+
apiRef?: Ref<CarouselApi>;
|
|
3244
|
+
}
|
|
3245
|
+
interface CarouselItemProps {
|
|
3246
|
+
/** 轮播项内容 */
|
|
3247
|
+
children?: ReactNode;
|
|
3248
|
+
/** 自定义类名 */
|
|
3249
|
+
className?: string;
|
|
3250
|
+
/** 自定义样式 */
|
|
3251
|
+
style?: CSSProperties;
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
/**
|
|
3255
|
+
* Carousel 轮播容器组件
|
|
3256
|
+
*
|
|
3257
|
+
* 水平方向切换,默认从右至左自动轮播,也支持拖拽与点击指示器切换。
|
|
3258
|
+
*
|
|
3259
|
+
* ```tsx
|
|
3260
|
+
* <Carousel autoplay loop>
|
|
3261
|
+
* <Carousel.Item>第一屏</Carousel.Item>
|
|
3262
|
+
* <Carousel.Item>第二屏</Carousel.Item>
|
|
3263
|
+
* </Carousel>
|
|
3264
|
+
* ```
|
|
3265
|
+
*/
|
|
3266
|
+
declare const CarouselRoot: React__default.ForwardRefExoticComponent<CarouselProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3267
|
+
/** Carousel.Item 轮播项 */
|
|
3268
|
+
declare const CarouselItem: React__default.ForwardRefExoticComponent<CarouselItemProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
3269
|
+
type CarouselComponent = typeof CarouselRoot & {
|
|
3270
|
+
Item: typeof CarouselItem;
|
|
3271
|
+
};
|
|
3272
|
+
declare const Carousel: CarouselComponent;
|
|
3273
|
+
|
|
2836
3274
|
/**
|
|
2837
3275
|
* 合并 CSS 类名,支持条件拼接
|
|
2838
3276
|
* @param inputs - 任意数量的 ClassValue 参数
|
|
@@ -2840,4 +3278,4 @@ declare const ScrollBar: React__default.ForwardRefExoticComponent<ScrollBarProps
|
|
|
2840
3278
|
*/
|
|
2841
3279
|
declare function cn(...inputs: ClassValue[]): string;
|
|
2842
3280
|
|
|
2843
|
-
export { Alert, type AlertProps, type AlertType, AvatarWithGroup as Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, ButtonProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize, ColorPicker, type ColorPickerProps, type ColorPickerSize, type CoverConfig, type CustomRequestOptions, type CustomRequestReturn, DatePicker, type DatePickerProps, type DatePickerSize, type DateRange, Dialog, type DialogConfirmOptions, type DialogProps, Divider, type DividerOrientation, type DividerProps, type DividerVariant, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, DropdownButton, type DropdownButtonProps, DropdownCheckboxItem, type DropdownCheckboxItemProps, DropdownContent, type DropdownContentProps, DropdownGroup, type DropdownGroupProps, DropdownItem, type DropdownItemData, type DropdownItemProps, DropdownLabel, type DropdownLabelData, type DropdownLabelProps, type DropdownMenuItemData, type DropdownProps, DropdownRadioGroup, type DropdownRadioGroupProps, DropdownRadioItem, type DropdownRadioItemProps, DropdownSeparator, type DropdownSeparatorData, type DropdownSeparatorProps, DropdownStatus, type DropdownStatusProps, type DropdownStatusText, type DropdownStatusType, DropdownSub, DropdownSubContent, type DropdownSubContentProps, type DropdownSubProps, DropdownSubTrigger, type DropdownSubTriggerProps, DropdownTrigger, type DropdownTriggerProps, EllipsisTooltip, type EllipsisTooltipProps, Empty, EmptyCard, type EmptyCardProps, type EmptyCardSpacing, type EmptyCardStatus, type EmptyCardVariant, type EmptyIconComponent, type EmptyProps, type EmptySize, type FeedbackAttachment, type FeedbackFileWallItem, type FeedbackHistoryDetail, type FeedbackHistoryItem, type FeedbackReply, type FeedbackSimilarItem, type FeedbackStatus, type FeedbackTabKey, type FileItemActions, Flex, type FlexGapSize, type FlexOrientation, type FlexProps, Form, type FormInstance, type FormItemProps, type FormLayout, type FormProps, Image, type ImagePreviewGroupProps, type ImageProps, type ImgInfo, LgSize, LingeeProvider, type LingeeProviderProps, type Locale, Pagination, type PaginationProps, type PaginationVariant, PopoverContentProps, type PreviewGroupType, type PreviewType, Progress, type ProgressProps, type ProgressStatus, type ProgressType, RadioGroup, type RadioGroupProps, RadioItem, type RadioItemProps, type RadioSize, RangePicker, type RangePickerProps, type RangePickerSize, type RejectReason, ScrollArea, type ScrollAreaProps, ScrollBar, type ScrollBarProps, Select, type SelectDropdownProps, type SelectMode, type SelectOption, type SelectOptionGroup, type SelectProps, type SelectSize, Sidebar, SidebarAuthImage, type SidebarAuthImageProps, type SidebarCaretPlacement, SidebarCollapsibleListItem, type SidebarCollapsibleListItemProps, SidebarCollapsibleNavItem, type SidebarCollapsibleNavItemChild, type SidebarCollapsibleNavItemProps, SidebarFeedbackAttachmentRow, type SidebarFeedbackAttachmentRowProps, SidebarFeedbackDetail, type SidebarFeedbackDetailProps, SidebarFeedbackField, type SidebarFeedbackFieldProps, SidebarFeedbackFileWall, type SidebarFeedbackFileWallProps, SidebarFeedbackHistoryItem, type SidebarFeedbackHistoryItemProps, SidebarFeedbackHistoryPanel, type SidebarFeedbackHistoryPanelProps, SidebarFeedbackModal, type SidebarFeedbackModalProps, SidebarFeedbackSimilarItem, type SidebarFeedbackSimilarItemProps, SidebarFeedbackSubmitPanel, type SidebarFeedbackSubmitPanelProps, SidebarFooter, SidebarFooterBadge, type SidebarFooterBadgeProps, SidebarFooterMenuStaticRow, type SidebarFooterMenuStaticRowProps, type SidebarFooterProps, SidebarFooterUser, type SidebarFooterUserProps, SidebarGroupHeader, type SidebarGroupHeaderProps, SidebarHeader, type SidebarHeaderProps, type SidebarIndicatorType, SidebarListItem, type SidebarListItemProps, SidebarNavItem, type SidebarNavItemProps, SidebarRoot, type SidebarRootProps, SidebarTabBar, type SidebarTabBarProps, type SidebarTabItem, SidebarUsageBar, type SidebarUsageBarProps, SidebarUsagePanel, type SidebarUsagePanelProps, SidebarUsagePanelSection, type SidebarUsagePanelSectionProps, type SidebarUsageTone, Skeleton, type SkeletonAnimation, type SkeletonProps, type SkeletonVariant, Slider, type SliderProps, type SliderSize, Spin, type SpinProps, type SpinSize, type StepItem, type StepStatus, Steps, type StepsProps, type StepsSize, type StepsTitlePlacement, Table, type TableColumnType, type TableProps, type TableRowSelection, type TableSize, type TableSorterState, Tag, type TagPresetColor, type TagProps, type TagShape, type TagSize, TimePicker, type TimePickerProps, type TimePickerSize, type TimeValue, TooltipProps, type TransformAction, type TransformType, Upload, type UploadFile, type UploadFileStatus, type UploadProps, cn, enUS, formatFileSize, useComponentLocale, useLocale, zhCN };
|
|
3281
|
+
export { Alert, type AlertProps, type AlertType, AvatarWithGroup as Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, ButtonProps, Carousel, type CarouselApi, type CarouselDotsPlacement, CarouselItem, type CarouselItemProps, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxSize, ColorPicker, type ColorPickerProps, type ColorPickerSize, type CoverConfig, type CustomRequestOptions, type CustomRequestReturn, DatePicker, type DatePickerProps, type DatePickerSize, type DateRange, Dialog, type DialogConfirmOptions, type DialogHostModal, type DialogProps, Divider, type DividerOrientation, type DividerProps, type DividerVariant, Drawer, type DrawerPlacement, type DrawerProps, Dropdown, DropdownButton, type DropdownButtonProps, DropdownCheckboxItem, type DropdownCheckboxItemProps, DropdownContent, type DropdownContentProps, type DropdownEllipsisTooltip, DropdownGroup, type DropdownGroupProps, DropdownItem, type DropdownItemData, type DropdownItemProps, DropdownLabel, type DropdownLabelData, type DropdownLabelProps, type DropdownMenuItemData, type DropdownProps, DropdownRadioGroup, type DropdownRadioGroupProps, DropdownRadioItem, type DropdownRadioItemProps, DropdownSeparator, type DropdownSeparatorData, type DropdownSeparatorProps, DropdownStatus, type DropdownStatusProps, type DropdownStatusText, type DropdownStatusType, DropdownSub, DropdownSubContent, type DropdownSubContentProps, type DropdownSubProps, DropdownSubTrigger, type DropdownSubTriggerProps, DropdownTrigger, type DropdownTriggerProps, EllipsisTooltip, type EllipsisTooltipProps, Empty, EmptyCard, type EmptyCardProps, type EmptyCardSpacing, type EmptyCardStatus, type EmptyCardVariant, type EmptyIconComponent, type EmptyProps, type EmptySize, type FeedbackAttachment, type FeedbackFileWallItem, type FeedbackHistoryDetail, type FeedbackHistoryItem, type FeedbackReply, type FeedbackSimilarItem, type FeedbackStatus, type FeedbackTabKey, type FileItemActions, Flex, type FlexGapSize, type FlexOrientation, type FlexProps, Form, type FormInstance, type FormItemProps, type FormLayout, type FormProps, HostModalPage, type HostModalPageProps, Image, type ImagePreviewGroupProps, type ImageProps, type ImgInfo, LgSize, LingeeProvider, type LingeeProviderProps, type LingeeSite, type Locale, Pagination, type PaginationProps, type PaginationVariant, PopoverContentProps, type PreviewGroupType, type PreviewType, Progress, type ProgressProps, type ProgressStatus, type ProgressType, RadioGroup, type RadioGroupProps, RadioItem, type RadioItemProps, type RadioSize, RangePicker, type RangePickerProps, type RangePickerSize, type RejectReason, ScrollArea, type ScrollAreaProps, ScrollBar, type ScrollBarProps, Select, type SelectDropdownProps, type SelectMode, type SelectOption, type SelectOptionGroup, type SelectProps, type SelectSize, Sidebar, SidebarAuthImage, type SidebarAuthImageProps, type SidebarCaretPlacement, SidebarCollapsibleListItem, type SidebarCollapsibleListItemProps, SidebarCollapsibleNavItem, type SidebarCollapsibleNavItemChild, type SidebarCollapsibleNavItemProps, SidebarFeedbackAttachmentRow, type SidebarFeedbackAttachmentRowProps, SidebarFeedbackDetail, type SidebarFeedbackDetailProps, SidebarFeedbackField, type SidebarFeedbackFieldProps, SidebarFeedbackFileWall, type SidebarFeedbackFileWallProps, SidebarFeedbackHistoryItem, type SidebarFeedbackHistoryItemProps, SidebarFeedbackHistoryPanel, type SidebarFeedbackHistoryPanelProps, SidebarFeedbackModal, type SidebarFeedbackModalProps, SidebarFeedbackSimilarItem, type SidebarFeedbackSimilarItemProps, SidebarFeedbackSubmitPanel, type SidebarFeedbackSubmitPanelProps, SidebarFooter, SidebarFooterBadge, type SidebarFooterBadgeProps, SidebarFooterMenuStaticRow, type SidebarFooterMenuStaticRowProps, type SidebarFooterProps, SidebarFooterUser, type SidebarFooterUserProps, SidebarGroupHeader, type SidebarGroupHeaderProps, SidebarHeader, type SidebarHeaderProps, type SidebarIndicatorType, SidebarListItem, type SidebarListItemProps, SidebarNavItem, type SidebarNavItemProps, SidebarRoot, type SidebarRootProps, SidebarTabBar, type SidebarTabBarProps, type SidebarTabItem, SidebarUsageBar, type SidebarUsageBarProps, SidebarUsagePanel, type SidebarUsagePanelProps, SidebarUsagePanelSection, type SidebarUsagePanelSectionProps, type SidebarUsageTone, Skeleton, type SkeletonAnimation, type SkeletonProps, type SkeletonVariant, Slider, type SliderProps, type SliderSize, Spin, type SpinProps, type SpinSize, type StepItem, type StepStatus, Steps, type StepsProps, type StepsSize, type StepsTitlePlacement, Table, type TableColumnType, type TableProps, type TableRowSelection, type TableSize, type TableSorterState, Tag, type TagPresetColor, type TagProps, type TagShape, type TagSize, TimePicker, type TimePickerProps, type TimePickerSize, type TimeValue, TooltipProps, type TransformAction, type TransformType, Upload, type UploadFile, type UploadFileStatus, type UploadProps, closeHostModal, cn, enUS, formatFileSize, getHostModalParams, isInHostModal, notifyHostModalReady, useComponentLocale, useLocale, useSite, zhCN };
|