lingee-ui 0.0.21 → 0.0.23
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-NLYZRYOJ.mjs → chunk-4VICYRWD.mjs} +1 -1
- package/dist/{chunk-3IO42CRF.js → chunk-B3BNV2BA.js} +1 -1
- package/dist/chunk-CHYJKCAM.mjs +1 -0
- package/dist/{chunk-5LB5DYXZ.js → chunk-CJUKQFAJ.js} +1 -1
- package/dist/{chunk-V32QRQMP.js → chunk-CQVDHCVR.js} +1 -1
- package/dist/chunk-FDENIWMP.mjs +2 -0
- package/dist/chunk-LS4LPBJT.js +2 -0
- package/dist/chunk-PEXFBRR4.mjs +2 -0
- package/dist/chunk-RNRDXECM.js +1 -0
- package/dist/chunk-RTCATZUZ.js +2 -0
- package/dist/chunk-S5TTZBPX.mjs +1 -0
- package/dist/chunk-T3QXFSH7.mjs +1 -0
- package/dist/{index-89atTLPD.d.mts → index-7pb5YOcq.d.mts} +2 -2
- package/dist/{index-89atTLPD.d.ts → index-7pb5YOcq.d.ts} +2 -2
- package/dist/index-B0J-mUew.d.mts +318 -0
- package/dist/index-Dmm11UAd.d.ts +318 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +41 -47
- package/dist/index.d.ts +41 -47
- 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/tabs/index.css +1 -1
- package/dist/tabs/index.js +1 -1
- package/dist/tabs/index.mjs +1 -1
- package/dist/toast/index.css +1 -1
- package/dist/toast/index.d.mts +30 -1
- package/dist/toast/index.d.ts +30 -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.js +1 -1
- package/dist/tooltip/index.mjs +1 -1
- package/dist/tree/index.css +1 -1
- package/dist/tree/index.d.mts +3 -229
- package/dist/tree/index.d.ts +3 -229
- package/dist/tree/index.js +1 -1
- package/dist/tree/index.mjs +1 -1
- package/package.json +1 -1
- package/skill/AGENTS-SNIPPET.md +2 -2
- package/skill/SKILL.md +3 -3
- package/skill/VERSION.json +3 -3
- package/skill/references/components/breadcrumb.md +26 -5
- package/skill/references/components/select.md +34 -4
- package/skill/references/components/tag.md +16 -7
- package/skill/references/components/toast.md +29 -1
- package/skill/references/components/tree.md +32 -2
- package/skill/references/icons.md +1 -1
- package/skill/references/setup.md +1 -1
- package/skill/references/tokens.md +2 -2
- package/dist/chunk-4QG542GX.js +0 -1
- package/dist/chunk-67CCJI3Y.mjs +0 -1
- package/dist/chunk-ARLTJ7O7.js +0 -2
- package/dist/chunk-H44VO62M.mjs +0 -1
- package/dist/chunk-IBJZAWUP.mjs +0 -1
- package/dist/chunk-JWOTGIJI.mjs +0 -2
- package/dist/chunk-KXUUVDLA.mjs +0 -1
- package/dist/chunk-P427AFIE.js +0 -1
- package/dist/chunk-QIGXWGB4.mjs +0 -2
- package/dist/chunk-U4ZQGUSG.js +0 -2
package/dist/tree/index.d.ts
CHANGED
|
@@ -1,229 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* 树节点尺寸
|
|
5
|
-
* - sm: 行高 28px
|
|
6
|
-
* - md: 行高 32px(设计稿基准)
|
|
7
|
-
* - lg: 行高 36px
|
|
8
|
-
*/
|
|
9
|
-
type TreeSize = "sm" | "md" | "lg";
|
|
10
|
-
/**
|
|
11
|
-
* 缩进引导线形态
|
|
12
|
-
* - none: 不显示引导线,仅靠缩进区分层级
|
|
13
|
-
* - line: 显示纵向引导线(设计稿默认形态)
|
|
14
|
-
*/
|
|
15
|
-
type TreeIndentGuide = "none" | "line";
|
|
16
|
-
/** 触发展开的交互方式,false 表示仅能点击箭头展开 */
|
|
17
|
-
type TreeExpandAction = false | "click" | "doubleClick";
|
|
18
|
-
/**
|
|
19
|
-
* 树节点数据
|
|
20
|
-
*
|
|
21
|
-
* 字段名可通过 fieldNames 改写,以适配后端已有的数据结构,
|
|
22
|
-
* 避免消费方为了对齐组件而额外做一次全量数据转换。
|
|
23
|
-
*/
|
|
24
|
-
interface TreeNodeData {
|
|
25
|
-
/** 节点唯一标识 */
|
|
26
|
-
key: Key;
|
|
27
|
-
/** 节点标题 */
|
|
28
|
-
title?: ReactNode;
|
|
29
|
-
/** 子节点 */
|
|
30
|
-
children?: TreeNodeData[];
|
|
31
|
-
/**
|
|
32
|
-
* 节点前置图标,覆盖 Tree 上的全局 icon。
|
|
33
|
-
* 静态值,不随展开态变化;需要区分开合请用 Tree 的 icon 函数形式
|
|
34
|
-
*/
|
|
35
|
-
icon?: ReactNode;
|
|
36
|
-
/** 是否禁用(不可选中、不可高亮) */
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
/** 是否禁用勾选框 */
|
|
39
|
-
disableCheckbox?: boolean;
|
|
40
|
-
/** 是否可勾选,checkable 开启时生效 */
|
|
41
|
-
checkable?: boolean;
|
|
42
|
-
/** 是否强制视作叶子节点(不显示展开箭头) */
|
|
43
|
-
isLeaf?: boolean;
|
|
44
|
-
/** 是否允许作为拖拽源 */
|
|
45
|
-
selectable?: boolean;
|
|
46
|
-
/** 允许透传业务字段 */
|
|
47
|
-
[key: string]: any;
|
|
48
|
-
}
|
|
49
|
-
/** 渲染回调中透出的节点状态,用于按状态切换图标 */
|
|
50
|
-
interface TreeNodeState {
|
|
51
|
-
/** 是否已展开(叶子节点恒为 false) */
|
|
52
|
-
expanded: boolean;
|
|
53
|
-
/** 是否为叶子节点 */
|
|
54
|
-
isLeaf: boolean;
|
|
55
|
-
}
|
|
56
|
-
/** 字段名映射,用于适配非标准数据结构 */
|
|
57
|
-
interface TreeFieldNames {
|
|
58
|
-
key?: string;
|
|
59
|
-
title?: string;
|
|
60
|
-
children?: string;
|
|
61
|
-
}
|
|
62
|
-
/** 勾选回调信息 */
|
|
63
|
-
interface TreeCheckInfo {
|
|
64
|
-
/** 触发勾选的节点 */
|
|
65
|
-
node: TreeNodeData;
|
|
66
|
-
/** 变更后是否勾选 */
|
|
67
|
-
checked: boolean;
|
|
68
|
-
/** 全部勾选节点 */
|
|
69
|
-
checkedNodes: TreeNodeData[];
|
|
70
|
-
/** 半勾选节点 key(checkStrictly 关闭时有值) */
|
|
71
|
-
halfCheckedKeys?: Key[];
|
|
72
|
-
}
|
|
73
|
-
/** 选中回调信息 */
|
|
74
|
-
interface TreeSelectInfo {
|
|
75
|
-
/** 触发选中的节点 */
|
|
76
|
-
node: TreeNodeData;
|
|
77
|
-
/** 变更后是否选中 */
|
|
78
|
-
selected: boolean;
|
|
79
|
-
/** 全部选中节点 */
|
|
80
|
-
selectedNodes: TreeNodeData[];
|
|
81
|
-
}
|
|
82
|
-
/** 展开回调信息 */
|
|
83
|
-
interface TreeExpandInfo {
|
|
84
|
-
/** 触发展开的节点 */
|
|
85
|
-
node: TreeNodeData;
|
|
86
|
-
/** 变更后是否展开 */
|
|
87
|
-
expanded: boolean;
|
|
88
|
-
}
|
|
89
|
-
/** 拖拽放置回调信息 */
|
|
90
|
-
interface TreeDropInfo {
|
|
91
|
-
/** 被拖拽节点 */
|
|
92
|
-
dragNode: TreeNodeData;
|
|
93
|
-
/** 放置目标节点 */
|
|
94
|
-
node: TreeNodeData;
|
|
95
|
-
/**
|
|
96
|
-
* 相对目标节点的插入位置:-1 上方、0 内部、1 下方
|
|
97
|
-
* dropToGap 为 false 时该值无意义(落在节点内部)
|
|
98
|
-
*/
|
|
99
|
-
dropPosition: number;
|
|
100
|
-
/** 是否落在节点之间的空隙(而非节点内部) */
|
|
101
|
-
dropToGap: boolean;
|
|
102
|
-
}
|
|
103
|
-
/** 拖拽落点校验参数 */
|
|
104
|
-
interface TreeAllowDropOptions {
|
|
105
|
-
dragNode: TreeNodeData;
|
|
106
|
-
dropNode: TreeNodeData;
|
|
107
|
-
dropPosition: -1 | 0 | 1;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Tree 组件 Props
|
|
111
|
-
*/
|
|
112
|
-
interface TreeProps {
|
|
113
|
-
/** 节点数据 */
|
|
114
|
-
treeData?: TreeNodeData[];
|
|
115
|
-
/** 字段名映射 */
|
|
116
|
-
fieldNames?: TreeFieldNames;
|
|
117
|
-
/** 行高尺寸 */
|
|
118
|
-
size?: TreeSize;
|
|
119
|
-
/** 展开的节点 key(受控) */
|
|
120
|
-
expandedKeys?: Key[];
|
|
121
|
-
/** 默认展开的节点 key */
|
|
122
|
-
defaultExpandedKeys?: Key[];
|
|
123
|
-
/** 默认展开全部节点 */
|
|
124
|
-
defaultExpandAll?: boolean;
|
|
125
|
-
/** 展开子节点时自动展开其父节点 */
|
|
126
|
-
autoExpandParent?: boolean;
|
|
127
|
-
/** 触发展开的交互方式 */
|
|
128
|
-
expandAction?: TreeExpandAction;
|
|
129
|
-
/** 展开状态变化回调 */
|
|
130
|
-
onExpand?: (expandedKeys: Key[], info: TreeExpandInfo) => void;
|
|
131
|
-
/** 是否可选中 */
|
|
132
|
-
selectable?: boolean;
|
|
133
|
-
/** 是否支持多选 */
|
|
134
|
-
multiple?: boolean;
|
|
135
|
-
/** 选中的节点 key(受控) */
|
|
136
|
-
selectedKeys?: Key[];
|
|
137
|
-
/** 默认选中的节点 key */
|
|
138
|
-
defaultSelectedKeys?: Key[];
|
|
139
|
-
/** 选中状态变化回调 */
|
|
140
|
-
onSelect?: (selectedKeys: Key[], info: TreeSelectInfo) => void;
|
|
141
|
-
/** 是否显示勾选框 */
|
|
142
|
-
checkable?: boolean;
|
|
143
|
-
/** 父子节点勾选状态不再联动 */
|
|
144
|
-
checkStrictly?: boolean;
|
|
145
|
-
/** 勾选的节点 key(受控) */
|
|
146
|
-
checkedKeys?: Key[] | {
|
|
147
|
-
checked: Key[];
|
|
148
|
-
halfChecked: Key[];
|
|
149
|
-
};
|
|
150
|
-
/** 默认勾选的节点 key */
|
|
151
|
-
defaultCheckedKeys?: Key[];
|
|
152
|
-
/** 勾选状态变化回调 */
|
|
153
|
-
onCheck?: (checkedKeys: Key[] | {
|
|
154
|
-
checked: Key[];
|
|
155
|
-
halfChecked: Key[];
|
|
156
|
-
}, info: TreeCheckInfo) => void;
|
|
157
|
-
/** 是否显示节点图标 */
|
|
158
|
-
showIcon?: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* 全局节点图标。
|
|
161
|
-
*
|
|
162
|
-
* 传函数时可按展开态返回不同图标(如文件夹的开 / 合两态);
|
|
163
|
-
* 节点数据上的 `icon` 字段是静态值,做不到随状态切换,
|
|
164
|
-
* 需要区分开合时应在此处以函数形式提供。
|
|
165
|
-
*/
|
|
166
|
-
icon?: ReactNode | ((node: TreeNodeData, state: TreeNodeState) => ReactNode);
|
|
167
|
-
/** 自定义展开箭头,可为函数按节点状态返回 */
|
|
168
|
-
switcherIcon?: ReactNode | ((state: TreeNodeState) => ReactNode);
|
|
169
|
-
/** 缩进引导线形态 */
|
|
170
|
-
indentGuide?: TreeIndentGuide;
|
|
171
|
-
/**
|
|
172
|
-
* 自定义单行内容
|
|
173
|
-
*
|
|
174
|
-
* 行内 hover 才出现的操作区靠它实现:操作区需 stopPropagation,
|
|
175
|
-
* 否则点击操作按钮会连带触发节点选中。
|
|
176
|
-
*/
|
|
177
|
-
titleRender?: (node: TreeNodeData) => ReactNode;
|
|
178
|
-
/** 异步加载子节点,resolve 后由消费方更新 treeData */
|
|
179
|
-
loadData?: (node: TreeNodeData) => Promise<unknown>;
|
|
180
|
-
/** 已加载完成的节点 key(受控) */
|
|
181
|
-
loadedKeys?: Key[];
|
|
182
|
-
/** 是否可拖拽排序 */
|
|
183
|
-
draggable?: boolean | ((node: TreeNodeData) => boolean);
|
|
184
|
-
/** 校验能否放置到目标位置 */
|
|
185
|
-
allowDrop?: (options: TreeAllowDropOptions) => boolean;
|
|
186
|
-
/** 拖拽放置回调 */
|
|
187
|
-
onDrop?: (info: TreeDropInfo) => void;
|
|
188
|
-
/** 可视区高度,设置后启用虚拟滚动 */
|
|
189
|
-
height?: number;
|
|
190
|
-
/** 虚拟滚动的单项高度,缺省时按 size 推导 */
|
|
191
|
-
itemHeight?: number;
|
|
192
|
-
/** 关闭虚拟滚动 */
|
|
193
|
-
virtual?: boolean;
|
|
194
|
-
/** 整体禁用 */
|
|
195
|
-
disabled?: boolean;
|
|
196
|
-
/** 加载状态,展示遮罩 */
|
|
197
|
-
loading?: boolean;
|
|
198
|
-
/** 无数据时的展示内容 */
|
|
199
|
-
empty?: ReactNode;
|
|
200
|
-
/** 节点右键回调 */
|
|
201
|
-
onRightClick?: (info: {
|
|
202
|
-
event: React.MouseEvent;
|
|
203
|
-
node: TreeNodeData;
|
|
204
|
-
}) => void;
|
|
205
|
-
/**
|
|
206
|
-
* 展开 / 折叠是否启用高度过渡动效,默认开启
|
|
207
|
-
*
|
|
208
|
-
* 虚拟滚动(设置 height)场景下底层不走动效,此项无效
|
|
209
|
-
*/
|
|
210
|
-
animated?: boolean;
|
|
211
|
-
/** 额外 className */
|
|
212
|
-
className?: string;
|
|
213
|
-
/** 行内样式 */
|
|
214
|
-
style?: CSSProperties;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Tree 树形控件
|
|
219
|
-
*
|
|
220
|
-
* 基于 @rc-component/tree 封装,仅接管视觉与常用能力;
|
|
221
|
-
* 键盘导航、虚拟滚动、父子勾选联动等由底层提供。
|
|
222
|
-
*
|
|
223
|
-
* 类名说明:容器与自定义结构走 BEM(lg-tree__xxx),
|
|
224
|
-
* 节点内部结构由底层按 prefixCls 生成单横线类名(lg-tree-treenode 等),
|
|
225
|
-
* 无法改写,故样式表中两种风格并存。
|
|
226
|
-
*/
|
|
227
|
-
declare const Tree: React__default.ForwardRefExoticComponent<TreeProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
228
|
-
|
|
229
|
-
export { Tree, type TreeAllowDropOptions, type TreeCheckInfo, type TreeDropInfo, type TreeExpandAction, type TreeExpandInfo, type TreeFieldNames, type TreeIndentGuide, type TreeNodeData, type TreeNodeState, type TreeProps, type TreeSelectInfo, type TreeSize };
|
|
1
|
+
import 'react';
|
|
2
|
+
export { e as Tree, f as TreeAllowDropOptions, g as TreeCheckInfo, h as TreeDropInfo, i as TreeExpandAction, j as TreeExpandInfo, k as TreeFieldNames, l as TreeIndentGuide, m as TreeNodeAction, n as TreeNodeData, o as TreeNodeExtra, p as TreeNodeExtraRenderContext, q as TreeNodeItemPresentation, r as TreeNodeState, s as TreeNodeTag, t as TreeProps, u as TreeSelectInfo, v as TreeSize } from '../index-Dmm11UAd.js';
|
|
3
|
+
import '../index-B5SLxsZP.js';
|
package/dist/tree/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkRTCATZUZ_js=require('../chunk-RTCATZUZ.js');require('../chunk-RNRDXECM.js'),require('../chunk-B3BNV2BA.js'),require('../chunk-LS4LPBJT.js'),require('../chunk-DCDWEVW4.js');Object.defineProperty(exports,"Tree",{enumerable:true,get:function(){return chunkRTCATZUZ_js.e}});
|
package/dist/tree/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{e as Tree}from'../chunk-FDENIWMP.mjs';import'../chunk-S5TTZBPX.mjs';import'../chunk-CHYJKCAM.mjs';import'../chunk-PEXFBRR4.mjs';import'../chunk-DN2VKVCV.mjs';
|
package/package.json
CHANGED
package/skill/AGENTS-SNIPPET.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **本文件由 `packages/lingee-ui/scripts/gen-skill.mjs` 自动生成,禁止手工编辑。**
|
|
4
4
|
> 供根 `AGENTS.md` 引用,避免手写清单随组件库迭代脱节。
|
|
5
|
-
> 组件库 `0.0.
|
|
5
|
+
> 组件库 `0.0.23` | 图标库 `1.0.22`
|
|
6
6
|
|
|
7
7
|
## 可用组件(42)
|
|
8
8
|
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
| `--lg-g-bg-color-success-translucent-subtle` | `rgba(8, 204, 80, 0.06)` | `rgba(8, 204, 80, 0.08)` |
|
|
245
245
|
| `--lg-g-bg-color-blue-translucent-subtle` | `rgba(77, 137, 255, 0.06)` | `rgba(77, 137, 255, 0.08)` |
|
|
246
246
|
| `--lg-g-bg-color-blue-translucent-muted` | `rgba(77, 137, 255, 0.12)` | `rgba(77, 137, 255, 0.28)` |
|
|
247
|
-
| `--lg-g-bg-color-table-default` | `#F9F9F9` | `#
|
|
247
|
+
| `--lg-g-bg-color-table-default` | `#F9F9F9` | `#252526` |
|
|
248
248
|
| `--lg-g-bg-color-white-bg1` | `#FFFFFF` | `rgba(255, 255, 255, 0.04)` |
|
|
249
249
|
| `--lg-g-bg-color-white-bg2` | `rgba(255, 255, 255, 0.82)` | `rgba(255, 255, 255, 0.06)` |
|
|
250
250
|
| `--lg-g-bg-color-white-bg3` | `#FFFFFF` | `rgba(255, 255, 255, 0.06)` |
|
package/skill/SKILL.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
name: lingee-ui-usage
|
|
3
3
|
description: 使用 lingee-ui 组件库与 lingee-icon 图标库开发 React 界面。当需要编写含按钮、表单、弹窗、表格、下拉、页签、图标等 UI 的 React/TypeScript 代码,或需要查询 lingee-ui 组件 API、Design Token 语义变量、可用图标名时触发。关键词:lingee-ui、lingee-icon、组件库、图标库、Design Token、语义变量、lg- 前缀、UI 组件。
|
|
4
4
|
metadata:
|
|
5
|
-
lingeeUi: "0.0.
|
|
6
|
-
lingeeIcon: "1.0.
|
|
5
|
+
lingeeUi: "0.0.23"
|
|
6
|
+
lingeeIcon: "1.0.22"
|
|
7
7
|
generatedBy: "gen-skill.mjs"
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ metadata:
|
|
|
12
12
|
Kingdee Lingee 设计体系的 React 组件库(42 个组件)与图标库(990 个图标)。
|
|
13
13
|
本技能面向**消费方项目**,只覆盖「如何用」,不含组件库内部开发约定。
|
|
14
14
|
|
|
15
|
-
- 组件库版本 `0.0.
|
|
15
|
+
- 组件库版本 `0.0.23` | 图标库版本 `1.0.22`
|
|
16
16
|
- 组件在线预览:https://kingdee.github.io/lingee-ui/
|
|
17
17
|
- 图标在线预览:https://kingdee.github.io/lingee-icon/
|
|
18
18
|
|
package/skill/VERSION.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
显示当前页面在系统层级结构中的位置,并提供返回之前层级的导航。
|
|
4
4
|
|
|
5
5
|
- 导入:`import { Breadcrumb } from "lingee-ui";`
|
|
6
|
-
- 可用类型:`BreadcrumbProps`, `BreadcrumbItem`, `BreadcrumbSize`
|
|
6
|
+
- 可用类型:`BreadcrumbProps`, `BreadcrumbItem`, `BreadcrumbSize`, `BreadcrumbOverflow`, `BreadcrumbScrollOptions`
|
|
7
7
|
|
|
8
8
|
## 最小示例
|
|
9
9
|
|
|
@@ -34,11 +34,32 @@ export default function BasicDemo() {
|
|
|
34
34
|
|
|
35
35
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
36
36
|
|------|------|------|--------|
|
|
37
|
-
| `items` |
|
|
37
|
+
| `items` | 面包屑数据,最后一项视为当前页 | `BreadcrumbItem[]` | - |
|
|
38
38
|
| `separator` | 自定义分隔符 | `ReactNode` | `md` 斜杠 / `sm` 尖括号 |
|
|
39
39
|
| `size` | 尺寸 | `"sm" \| "md"` | `"md"` |
|
|
40
|
-
| `maxItems` |
|
|
41
|
-
| `itemMaxWidth` |
|
|
40
|
+
| `maxItems` | 可见单元数上限,超出则折叠中间项;`overflow="scroll"` 下不生效 | `number` | - |
|
|
41
|
+
| `itemMaxWidth` | 单项文字最大宽度(px),超出显示省略号;`overflow="scroll"` 下不生效 | `number` | - |
|
|
42
|
+
| `overflow` | 宽度不足时的处理策略:`ellipsis` 收缩省略、`scroll` 横向滚动 | `"ellipsis" \| "scroll"` | `"ellipsis"` |
|
|
43
|
+
| `scrollOptions` | 滚动细节配置,仅 `overflow="scroll"` 生效 | `BreadcrumbScrollOptions` | - |
|
|
42
44
|
| `onBack` | 传入后显示返回箭头,点击触发 | `() => void` | - |
|
|
43
|
-
| `children` | 自定义内容(替代 items
|
|
45
|
+
| `children` | 自定义内容(替代 items,`overflow` 同样不生效) | `ReactNode` | - |
|
|
44
46
|
| `aria-label` | 导航区域的无障碍标签 | `string` | 语言包文案 |
|
|
47
|
+
|
|
48
|
+
### BreadcrumbItem
|
|
49
|
+
|
|
50
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
51
|
+
|------|------|------|--------|
|
|
52
|
+
| `key` | 唯一标识 | `string` | - |
|
|
53
|
+
| `label` | 文字内容 | `ReactNode` | - |
|
|
54
|
+
| `icon` | 前置图标 | `ReactNode` | - |
|
|
55
|
+
| `href` | 链接地址,渲染为 `<a>` 并整页导航 | `string` | - |
|
|
56
|
+
| `onClick` | 点击回调,渲染为 `<button>`;该项被折叠进下拉菜单后触发时不携带事件对象 | `(event?: MouseEvent) => void` | - |
|
|
57
|
+
| `disabled` | 禁用,不可点击也不触发回调 | `boolean` | `false` |
|
|
58
|
+
|
|
59
|
+
### BreadcrumbScrollOptions
|
|
60
|
+
|
|
61
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
62
|
+
|------|------|------|--------|
|
|
63
|
+
| `arrows` | 箭头显示策略:`true` 溢出即显示、`"hover"` 悬浮或键盘聚焦时显示、`false` 不显示 | `boolean \| "hover"` | `true` |
|
|
64
|
+
| `step` | 点击箭头单次滚动距离(px) | `number` | `200` |
|
|
65
|
+
| `fade` | 是否显示边缘渐隐 | `boolean` | `true` |
|
|
@@ -33,12 +33,12 @@ export default function BasicDemo() {
|
|
|
33
33
|
|
|
34
34
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
35
35
|
|------|------|------|--------|
|
|
36
|
-
| `options` |
|
|
36
|
+
| `options` | 选项数据,单项结构见 SelectOption | `SelectOption<T>[]` | `[]` |
|
|
37
37
|
| `value` | 当前选中值 | `T \| T[]` | - |
|
|
38
|
-
| `onChange` |
|
|
38
|
+
| `onChange` | 选中值变化回调,第二个参数为选中项(多选时为数组) | `(value: T \| T[], option: SelectOption<T> \| SelectOption<T>[]) => void` | - |
|
|
39
39
|
| `placeholder` | 占位文本 | `string` | - |
|
|
40
40
|
| `showSearch` | 是否支持搜索 | `boolean` | `false` |
|
|
41
|
-
| `filterOption` |
|
|
41
|
+
| `filterOption` | 本地过滤函数;设为 `false` 关闭本地过滤,配合 `onSearch` 远程搜索 | `false \| ((inputValue: string, option: SelectOption<T>) => boolean)` | 按 `label` 文本包含匹配,不区分大小写 |
|
|
42
42
|
| `onSearch` | 搜索回调 | `(keyword: string) => void` | - |
|
|
43
43
|
| `disabled` | 是否禁用 | `boolean` | `false` |
|
|
44
44
|
| `error` | 是否错误态 | `boolean` | `false` |
|
|
@@ -50,7 +50,37 @@ export default function BasicDemo() {
|
|
|
50
50
|
| `size` | 尺寸 | `"sm" \| "md" \| "lg"` | `"md"` |
|
|
51
51
|
| `suffixIcon` | 后缀图标 | `ReactNode` | - |
|
|
52
52
|
| `maxTagCount` | 多选模式最多显示 Tag 数 | `number` | - |
|
|
53
|
-
| `dropdown` |
|
|
53
|
+
| `dropdown` | 下拉面板配置,字段见 SelectDropdownProps | `SelectDropdownProps` | - |
|
|
54
54
|
| `defaultValue` | 非受控默认值 | `T \| T[]` | - |
|
|
55
55
|
| `onDropdownVisibleChange` | 下拉展开/收起回调 | `(open: boolean) => void` | - |
|
|
56
56
|
| `labelRender` | 自定义选中值在触发器中的渲染。用于下拉面板展示丰富内容(如头像+名字+工号)、触发器只显示简短文本的场景 | `(value: T, option?: SelectOption<T>) => ReactNode` | 渲染 `option.label` |
|
|
57
|
+
|
|
58
|
+
### SelectOption
|
|
59
|
+
|
|
60
|
+
`options` 的单项结构。`label` 为 ReactNode 时,用 `labelRender` 让触发器只显示短文本;开启搜索时须传 `filterOption` 按纯文本匹配,默认过滤会把 ReactNode 转成 `[object Object]`。
|
|
61
|
+
|
|
62
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
63
|
+
|------|------|------|--------|
|
|
64
|
+
| `value` | 选项值,同一列表内需唯一 | `T` | - |
|
|
65
|
+
| `label` | 选项内容,在下拉面板中原样渲染,支持 ReactNode | `ReactNode` | - |
|
|
66
|
+
| `textLabel` | 纯文本标签,展开搜索时作为当前值的占位文本;不传时依次取 `labelRender` 的字符串返回值、字符串 `label` | `string` | - |
|
|
67
|
+
| `disabled` | 是否禁用 | `boolean` | `false` |
|
|
68
|
+
|
|
69
|
+
### SelectDropdownProps
|
|
70
|
+
|
|
71
|
+
`dropdown` 的字段。`render` 的参数 `menu` 为默认面板内容(选项列表,或加载中 / 加载失败 / 无结果缺省态),可在其前后追加头部、底部;不放回 `menu` 即整块替换面板,但 Select 没有受控 `open`,自定义内容无法主动收起面板。
|
|
72
|
+
|
|
73
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
74
|
+
|------|------|------|--------|
|
|
75
|
+
| `render` | 自定义面板内容,返回值作为面板渲染 | `(menu: ReactNode) => ReactNode` | - |
|
|
76
|
+
| `notFoundContent` | 选项为空(含搜索无结果)时展示的内容 | `ReactNode` | 「搜索无结果」缺省态 |
|
|
77
|
+
| `width` | 面板宽度(px),`"auto"` 时按内容自适应 | `number \| "auto"` | 与触发器同宽 |
|
|
78
|
+
| `maxHeight` | 选项列表最大高度(px),同时受视口可用高度限制;`render` 追加的内容不计入 | `number` | `346` |
|
|
79
|
+
| `onScroll` | 选项列表滚动回调。⚠️ 当前绑定在不滚动的内层元素上,不会触发,暂不能用于滚动加载 | `(e: UIEvent<HTMLDivElement>) => void` | - |
|
|
80
|
+
| `className` | 下拉浮层的自定义类名 | `string` | - |
|
|
81
|
+
| `side` | 期望弹出方向,空间不足时可能自动翻转 | `"top" \| "bottom" \| "left" \| "right"` | `"bottom"` |
|
|
82
|
+
| `align` | 沿弹出方向的对齐方式 | `"start" \| "center" \| "end"` | `"start"` |
|
|
83
|
+
| `sideOffset` | 浮层与触发器的间距(px) | `number` | `4` |
|
|
84
|
+
| `alignOffset` | 沿对齐轴的偏移(px) | `number` | `0` |
|
|
85
|
+
| `collisionPadding` | 与碰撞边界的最小距离(px) | `number` | `8` |
|
|
86
|
+
| `container` | Portal 挂载容器,传 `null` 时就地渲染 | `HTMLElement \| null` | `document.body` |
|
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
用于标记和分类的小型标签元素。
|
|
4
4
|
|
|
5
5
|
- 导入:`import { Tag } from "lingee-ui";`
|
|
6
|
-
- 可用类型:`TagProps`, `TagPresetColor`, `TagSize`, `TagShape`
|
|
6
|
+
- 可用类型:`TagProps`, `TagPresetColor`, `TagSize`, `TagShape`, `TagVariant`
|
|
7
7
|
|
|
8
8
|
## 最小示例
|
|
9
9
|
|
|
10
10
|
```tsx
|
|
11
11
|
import { Tag } from "lingee-ui";
|
|
12
|
-
|
|
13
12
|
export default function BasicDemo() {
|
|
14
13
|
return (
|
|
15
14
|
<div style={{ display: "flex", gap: 8 }}>
|
|
16
|
-
<Tag>
|
|
17
|
-
<Tag
|
|
15
|
+
<Tag variant="text">Text</Tag>
|
|
16
|
+
<Tag variant="tint">Tint</Tag>
|
|
17
|
+
<Tag variant="filled">Filled</Tag>
|
|
18
|
+
<Tag variant="line">Line</Tag>
|
|
18
19
|
</div>
|
|
19
20
|
);
|
|
20
21
|
}
|
|
@@ -25,9 +26,9 @@ export default function BasicDemo() {
|
|
|
25
26
|
| 属性 | 说明 | 类型 | 默认值 |
|
|
26
27
|
|------|------|------|--------|
|
|
27
28
|
| `color` | 标签颜色 | `"info" \| "primary" \| "success" \| "warning" \| "danger" \| "amber" \| "yellow" \| "cyan" \| "purple" \| string` | `"info"` |
|
|
28
|
-
| `variant` | 视觉变体 | `"tint" \| "gradient" \| "glow"` | `"tint"` |
|
|
29
|
+
| `variant` | 视觉变体 | `"text" \| "tint" \| "filled" \| "line" \| "gradient" \| "glow"` | `"tint"` |
|
|
29
30
|
| `size` | 标签尺寸 | `"sm" \| "md" \| "lg"` | `"md"` |
|
|
30
|
-
| `shape` | 圆角形状(仅 `
|
|
31
|
+
| `shape` | 圆角形状(仅 `text` / `tint` / `filled` / `line` 生效) | `"pill" \| "rounded"` | `"pill"` |
|
|
31
32
|
| `icon` | 前缀图标 | `ReactNode` | - |
|
|
32
33
|
| `background` | 自定义背景 | `string` | - |
|
|
33
34
|
| `closable` | 是否可关闭 | `boolean` | `false` |
|
|
@@ -38,21 +39,29 @@ export default function BasicDemo() {
|
|
|
38
39
|
|
|
39
40
|
| 变体 | 圆角 | 背景 | 装饰 | 适用场景 |
|
|
40
41
|
|------|------|------|------|----------|
|
|
42
|
+
| `text` | 由 `shape` 决定 | 透明 | - | 通用标记、分类 |
|
|
41
43
|
| `tint` | 由 `shape` 决定 | 同色 8% 纯色浅底 | - | 通用标记、分类 |
|
|
44
|
+
| `filled` | 由 `shape` 决定 | 同色实底,文字反白 | - | 通用标记、分类 |
|
|
45
|
+
| `line` | 由 `shape` 决定 | 透明 | 1px 同色描边 | 通用标记、分类 |
|
|
42
46
|
| `gradient` | 8px | 同色 12% → 3% 斜向渐变 | - | 提示类徽标 |
|
|
43
47
|
| `glow` | 12px | 同色 8/12% → 28% 渐变 | 两层模糊光斑 | 等级类徽标 |
|
|
44
48
|
|
|
49
|
+
`text`、`tint`、`filled`、`line` 是同一组通用风格,区别仅在底色与描边的处理,按所需的视觉强调程度选用。
|
|
50
|
+
|
|
51
|
+
`text` / `filled` / `line` 的配色取自组件层 Token,`yellow` 无对应定义,传入时降级为 `tint`(类名与样式均按 `tint` 输出)。自定义色值不降级:`text` 文字取该色,`filled` 以该色为底、文字反白,`line` 文字与描边取该色。
|
|
52
|
+
|
|
45
53
|
`glow` 的 `purple` 使用 128.7° 斜向渐变,`yellow` / `cyan` 使用自上而下的纵向渐变。
|
|
46
54
|
|
|
47
55
|
### 样式变量
|
|
48
56
|
|
|
49
|
-
以下 CSS
|
|
57
|
+
以下 CSS 变量可在消费方覆盖,用于微调间距、图标尺寸、描边色与光斑配色:
|
|
50
58
|
|
|
51
59
|
| 变量 | 说明 | 默认值 |
|
|
52
60
|
|------|------|--------|
|
|
53
61
|
| `--_tag-gap` | 图标与文字间距 | `2px`(gradient `4px`、glow `10px`) |
|
|
54
62
|
| `--_tag-icon-size` | 图标尺寸 | `14px`(`size="lg"` 与 gradient 的 `danger` 为 `16px`) |
|
|
55
63
|
| `--_tag-font-weight` | 字重 | `400`(glow 为 `500`) |
|
|
64
|
+
| `--_tag-border-color` | 描边色(仅 line) | 按 `color` 取组件层 Token,自定义色值时与文字同色 |
|
|
56
65
|
| `--_tag-gradient-from` | 渐变起始色(gradient / glow) | 按 `color` 取同色 12%(glow 的 `purple` 为 8%) |
|
|
57
66
|
| `--_tag-gradient-to` | 渐变结束色(gradient / glow) | gradient 取同色 3%,glow 取 28% |
|
|
58
67
|
| `--_tag-glow-primary` | 底层光斑色(仅 glow) | 按 `color` 取对应装饰色 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- 导入:`import { toast } from "lingee-ui";`
|
|
6
6
|
- 按需导入:`import { toast } from "lingee-ui/toast";`
|
|
7
|
-
- 可用类型:`ToastConfig`, `ToastGlobalConfig`, `ToastType`, `HostToastLevel`
|
|
7
|
+
- 可用类型:`ToastAction`, `ToastActionCommand`, `ToastConfig`, `ToastGlobalConfig`, `ToastType`, `HostToastLevel`
|
|
8
8
|
|
|
9
9
|
## 最小示例
|
|
10
10
|
|
|
@@ -59,6 +59,34 @@ close();
|
|
|
59
59
|
| `onClose` | 关闭时回调 | `() => void` | - |
|
|
60
60
|
| `key` | 唯一标识,相同 key 会更新已有提示 | `string` | - |
|
|
61
61
|
| `className` | 自定义类名 | `string` | - |
|
|
62
|
+
| `action` | 文案末尾的操作按钮,样式固定,点击后提示关闭 | `ToastAction` | - |
|
|
63
|
+
|
|
64
|
+
### ToastAction
|
|
65
|
+
|
|
66
|
+
点击后提示关闭,只执行一个动作,先后顺序因渲染方而异:
|
|
67
|
+
|
|
68
|
+
- 本地渲染:`command` 不生效,执行 `onClick`,没有则在新窗口打开 `href`
|
|
69
|
+
- 交给客户端渲染:客户端认识的 `command` 由客户端执行,不依赖发起页存活;否则打开 `href`;最后才回传发起页执行 `onClick`,发起页已卸载则不执行
|
|
70
|
+
|
|
71
|
+
三者都不可用时不显示按钮。
|
|
72
|
+
|
|
73
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
74
|
+
|------|------|------|--------|
|
|
75
|
+
| `label` | 按钮文案(纯文本) | `string` | - |
|
|
76
|
+
| `onClick` | 点击回调 | `() => void` | - |
|
|
77
|
+
| `href` | 点击打开的链接,仅 http(s) 绝对地址,其它值(含相对路径)视为未传;站内跳转用 `onClick` | `string` | - |
|
|
78
|
+
| `command` | 宿主命令,本地渲染时须同时提供 `onClick` 或 `href` 兜底 | `ToastActionCommand` | - |
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
toast.warning({
|
|
82
|
+
content: "Feature unavailable",
|
|
83
|
+
action: {
|
|
84
|
+
label: "Contact us",
|
|
85
|
+
command: { name: "experience:open-retention" },
|
|
86
|
+
onClick: () => openContactDialog(),
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
```
|
|
62
90
|
|
|
63
91
|
### ToastGlobalConfig
|
|
64
92
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- 导入:`import { Tree } from "lingee-ui";`
|
|
6
6
|
- 按需导入:`import { Tree } from "lingee-ui/tree";`
|
|
7
|
-
- 可用类型:`TreeProps`, `TreeNodeData`, `TreeNodeState`, `TreeSize`, `TreeIndentGuide`, `TreeFieldNames`, `TreeCheckInfo`, `TreeSelectInfo`, `TreeExpandInfo`, `TreeDropInfo`, `TreeAllowDropOptions`, `TreeExpandAction`
|
|
7
|
+
- 可用类型:`TreeProps`, `TreeNodeData`, `TreeNodeState`, `TreeSize`, `TreeIndentGuide`, `TreeFieldNames`, `TreeCheckInfo`, `TreeSelectInfo`, `TreeExpandInfo`, `TreeDropInfo`, `TreeAllowDropOptions`, `TreeExpandAction`, `TreeNodeTag`, `TreeNodeAction`, `TreeNodeExtra`, `TreeNodeExtraRenderContext`, `TreeNodeItemPresentation`
|
|
8
8
|
|
|
9
9
|
## 最小示例
|
|
10
10
|
|
|
@@ -110,9 +110,39 @@ export default function BasicDemo() {
|
|
|
110
110
|
| `checkable` | 是否可勾选 | `boolean` |
|
|
111
111
|
| `isLeaf` | 是否强制视作叶子节点 | `boolean` |
|
|
112
112
|
| `selectable` | 是否可选中 | `boolean` |
|
|
113
|
+
| `className` | 节点行的额外 className | `string` |
|
|
114
|
+
| `style` | 节点行的行内样式 | `CSSProperties` |
|
|
115
|
+
| `treeItem` | 节点附加内容:状态标签、尾部内容与标准操作 | `TreeNodeItemPresentation` |
|
|
116
|
+
|
|
117
|
+
### TreeNodeItemPresentation
|
|
118
|
+
|
|
119
|
+
| 属性 | 说明 | 类型 |
|
|
120
|
+
|------|------|------|
|
|
121
|
+
| `tag` | 紧随标题的状态标签 | `TreeNodeTag` |
|
|
122
|
+
| `action` | 尾部标准图标操作,点击与拖拽不会作用到节点上,随 Tree / 节点禁用 | `TreeNodeAction` |
|
|
123
|
+
| `extra` | 额外尾部内容;回调形式接收 `{ node, disabled }` | `ReactNode \| ((context: { node, disabled }) => ReactNode)` |
|
|
124
|
+
|
|
125
|
+
### TreeNodeTag
|
|
126
|
+
|
|
127
|
+
| 属性 | 说明 | 类型 |
|
|
128
|
+
|------|------|------|
|
|
129
|
+
| `content` | 标签内容 | `ReactNode` |
|
|
130
|
+
| `color` | Tag 预设语义色,默认 `"primary"` | `TagPresetColor` |
|
|
131
|
+
|
|
132
|
+
### TreeNodeAction
|
|
133
|
+
|
|
134
|
+
| 属性 | 说明 | 类型 |
|
|
135
|
+
|------|------|------|
|
|
136
|
+
| `icon` | 图标内容 | `ReactNode` |
|
|
137
|
+
| `ariaLabel` | 无障碍名称,也是默认 Tooltip 文案 | `string` |
|
|
138
|
+
| `tooltip` | 自定义 Tooltip 文案,缺省时使用 `ariaLabel` | `string` |
|
|
139
|
+
| `disabled` | 是否禁用;Tree 或节点禁用时同样禁用 | `boolean` |
|
|
140
|
+
| `onClick` | 点击回调,参数为当前节点与按钮点击事件 | `(node, event) => void` |
|
|
113
141
|
|
|
114
142
|
## 注意事项
|
|
115
143
|
|
|
116
144
|
- 组件不持有 `treeData`,异步加载与拖拽排序均需消费方自行更新数据
|
|
117
145
|
- 节点内部结构由底层 `@rc-component/tree` 生成,类名为 `lg-tree-treenode`、`lg-tree-switcher` 等单横线形式,覆盖样式时需按此书写
|
|
118
|
-
-
|
|
146
|
+
- `title` 为函数时底层直接调用它渲染标题、不经过 `titleRender`,该节点的 `treeItem` 不生效
|
|
147
|
+
- `treeItem.extra` 中的自定义可交互内容应使用回调形式读取 `disabled`,并自行传给内部控件
|
|
148
|
+
- 虚拟滚动开启后行高必须固定,`treeItem.tag` 使用紧凑的 `Tag size="sm"`;`titleRender` 中不要渲染高度不定的内容
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 语义 Token 全表
|
|
2
2
|
|
|
3
|
-
组件库 `0.0.
|
|
3
|
+
组件库 `0.0.23`。仅列语义层(`--lg-g-*`)。
|
|
4
4
|
|
|
5
5
|
亮色与暗色**变量名完全相同**,给 `<html>` 加 `data-theme="dark"` 即自动切换,业务代码只写一次。
|
|
6
6
|
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
| `var(--lg-g-bg-color-success-translucent-subtle)` | `rgba(8, 204, 80, 0.06)` | `rgba(8, 204, 80, 0.08)` |
|
|
187
187
|
| `var(--lg-g-bg-color-blue-translucent-subtle)` | `rgba(77, 137, 255, 0.06)` | `rgba(77, 137, 255, 0.08)` |
|
|
188
188
|
| `var(--lg-g-bg-color-blue-translucent-muted)` | `rgba(77, 137, 255, 0.12)` | `rgba(77, 137, 255, 0.28)` |
|
|
189
|
-
| `var(--lg-g-bg-color-table-default)` | `#F9F9F9` | `#
|
|
189
|
+
| `var(--lg-g-bg-color-table-default)` | `#F9F9F9` | `#252526` |
|
|
190
190
|
| `var(--lg-g-bg-color-white-bg1)` | `#FFFFFF` | `rgba(255, 255, 255, 0.04)` |
|
|
191
191
|
| `var(--lg-g-bg-color-white-bg2)` | `rgba(255, 255, 255, 0.82)` | `rgba(255, 255, 255, 0.06)` |
|
|
192
192
|
| `var(--lg-g-bg-color-white-bg3)` | `#FFFFFF` | `rgba(255, 255, 255, 0.06)` |
|
package/dist/chunk-4QG542GX.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkP427AFIE_js=require('./chunk-P427AFIE.js'),chunkDCDWEVW4_js=require('./chunk-DCDWEVW4.js'),ze=require('react'),sonner=require('sonner'),lingeeIcon=require('lingee-icon'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ze__default=/*#__PURE__*/_interopDefault(ze);var ce={locale:"zh-CN",Button:{},Breadcrumb:{more:"\u66F4\u591A",back:"\u8FD4\u56DE",label:"\u9762\u5305\u5C51\u5BFC\u822A"},Select:{loading:"\u52A0\u8F7D\u4E2D",loadError:"\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",loadFailed:"\u52A0\u8F7D\u5931\u8D25",notFound:"\u641C\u7D22\u65E0\u7ED3\u679C",clear:"\u6E05\u7A7A"},Dropdown:{clear:"\u6E05\u9664",loading:"\u52A0\u8F7D\u4E2D",loadError:"\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",empty:"\u6682\u65E0\u6570\u636E"},Tabs:{scrollLeft:"\u5411\u5DE6\u6EDA\u52A8",scrollRight:"\u5411\u53F3\u6EDA\u52A8"},Carousel:{carousel:"\u8F6E\u64AD",prev:"\u4E0A\u4E00\u5F20",next:"\u4E0B\u4E00\u5F20",goToPage:"\u8DF3\u8F6C\u5230\u7B2C {page} \u5F20"},Form:{required:"{label}\u4E0D\u80FD\u4E3A\u7A7A",requiredNoLabel:"\u6B64\u9879\u4E0D\u80FD\u4E3A\u7A7A"},Tag:{close:"\u5173\u95ED"},Upload:{retry:"\u91CD\u65B0\u4E0A\u4F20",remove:"\u79FB\u9664\u6587\u4EF6",removeShort:"\u79FB\u9664",dragText:"\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216",clickUpload:"\u70B9\u51FB\u4E0A\u4F20"},ColorPicker:{placeholder:"\u8BF7\u9009\u62E9\u989C\u8272"},DatePicker:{placeholder:"\u5E74/\u6708/\u65E5",today:"\u4ECA\u5929",prevYear:"\u4E0A\u4E00\u5E74",nextYear:"\u4E0B\u4E00\u5E74",prevMonth:"\u4E0A\u4E00\u6708",nextMonth:"\u4E0B\u4E00\u6708",prevDecade:"\u4E0A\u4E00\u7EC4\u5E74\u4EFD",nextDecade:"\u4E0B\u4E00\u7EC4\u5E74\u4EFD",months:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],yearFormat:"{year}\u5E74",monthFormat:"{month}\u6708"},RangePicker:{startPlaceholder:"\u5E74/\u6708/\u65E5",endPlaceholder:"\u5E74/\u6708/\u65E5"},TimePicker:{now:"\u73B0\u5728",confirm:"\u786E\u5B9A",placeholder:"\u65F6:\u5206",placeholderFull:"\u65F6:\u5206:\u79D2"},Table:{loading:"\u52A0\u8F7D\u4E2D",empty:"\u6682\u65E0\u6570\u636E",loadError:"\u52A0\u8F7D\u5931\u8D25"},Tree:{empty:"\u6682\u65E0\u6570\u636E"},Pagination:{total:"\u5171 {total} \u6761",prevPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",itemsPerPage:"{size}\u6761/\u9875",jumpTo:"\u8DF3\u81F3",page:"\u9875"},Dialog:{close:"\u5173\u95ED"},Drawer:{close:"\u5173\u95ED"},Input:{clear:"\u6E05\u7A7A",expand:"\u5C55\u5F00\u8F93\u5165\u6846"},Alert:{close:"\u5173\u95ED"},Toast:{close:"\u5173\u95ED\u6D88\u606F"},Spin:{loading:"\u52A0\u8F7D\u4E2D"},Empty:{retry:"\u91CD\u8BD5"},InfiniteScroll:{loading:"\u52A0\u8F7D\u4E2D",noMore:"\u6CA1\u6709\u66F4\u591A\u4E86",loadFailed:"\u52A0\u8F7D\u5931\u8D25"},Sidebar:{expand:"\u5C55\u5F00",collapse:"\u6536\u8D77",loading:"\u52A0\u8F7D\u4E2D",empty:"\u6682\u65E0\u6570\u636E",loadError:"\u52A0\u8F7D\u5931\u8D25"},PersonPicker:{title:"\u9009\u62E9\u4EBA\u5458",ok:"\u786E\u5B9A",cancel:"\u53D6\u6D88",searchPlaceholder:"\u641C\u7D22\u59D3\u540D\u3001\u5DE5\u53F7",tabRecentContacts:"\u6700\u8FD1\u8054\u7CFB\u4EBA",tabRecentGroups:"\u6700\u8FD1\u7FA4\u7EC4",tabOrganization:"\u9009\u62E9\u7EC4\u7EC7",tabPerson:"\u9009\u62E9\u4EBA\u5458",selectAll:"\u5168\u9009",selectedTitle:"\u5DF2\u9009",groupPerson:"\u4EBA\u5458",groupGroup:"\u7FA4\u7EC4",groupOrg:"\u7EC4\u7EC7",remove:"\u79FB\u9664",drillDown:"\u67E5\u770B\u4E0B\u7EA7",jumpTo:"\u8DF3\u8F6C\u5230",empty:"\u6682\u65E0\u6570\u636E",searchEmpty:"\u641C\u7D22\u65E0\u7ED3\u679C",loadFailed:"\u52A0\u8F7D\u5931\u8D25",loadFailedDetail:"\u670D\u52A1\u54CD\u5E94\u5F02\u5E38\u6216\u7F51\u7EDC\u4E0D\u53EF\u7528",retry:"\u91CD\u8BD5"}},h=ce;var _=new Map,M=0;function A(){return M+=1,{id:M}}function z(e,o,t){_.set(e.id,{site:o,depth:t});}function G(e){_.delete(e.id);}function pe(){let e;for(let o of _.values())(!e||o.depth>=e.depth)&&(e=o);return e?.site}function E(){return pe()==="lingee"}var Y={dialog:{}},v=ze.createContext(Y),D=new Map,B=0;function U(){return B+=1,{id:B}}function j(e,o,t){D.set(e.id,{config:o,depth:t});}function q(e){D.delete(e.id);}function ge(){let e;for(let o of D.values())(!e||o.depth>=e.depth)&&(e=o);return e?.config??Y}function me(){return ze.useContext(v)}var Te={locale:"en-US",Button:{},Breadcrumb:{more:"More",back:"Back",label:"Breadcrumb"},Select:{loading:"Loading",loadError:"Failed to load, please retry",loadFailed:"Failed to load",notFound:"No results found",clear:"Clear"},Dropdown:{clear:"Clear",loading:"Loading",loadError:"Failed to load, please retry",empty:"No data"},Tabs:{scrollLeft:"Scroll left",scrollRight:"Scroll right"},Carousel:{carousel:"Carousel",prev:"Previous slide",next:"Next slide",goToPage:"Go to slide {page}"},Form:{required:"{label} is required",requiredNoLabel:"This field is required"},Tag:{close:"Close"},Upload:{retry:"Retry upload",remove:"Remove file",removeShort:"Remove",dragText:"Drag files here, or ",clickUpload:"click to upload"},ColorPicker:{placeholder:"Select a color"},DatePicker:{placeholder:"YYYY/MM/DD",today:"Today",prevYear:"Previous year",nextYear:"Next year",prevMonth:"Previous month",nextMonth:"Next month",prevDecade:"Previous decade",nextDecade:"Next decade",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yearFormat:"{year}",monthFormat:"{month}"},RangePicker:{startPlaceholder:"Start date",endPlaceholder:"End date"},TimePicker:{now:"Now",confirm:"OK",placeholder:"HH:mm",placeholderFull:"HH:mm:ss"},Table:{loading:"Loading",empty:"No data",loadError:"Failed to load"},Tree:{empty:"No data"},Pagination:{total:"{total} items",prevPage:"Previous page",nextPage:"Next page",itemsPerPage:"{size} / page",jumpTo:"Go to",page:""},Dialog:{close:"Close"},Drawer:{close:"Close"},Input:{clear:"Clear",expand:"Expand input"},Alert:{close:"Close"},Toast:{close:"Close message"},Spin:{loading:"Loading"},Empty:{retry:"Retry"},InfiniteScroll:{loading:"Loading",noMore:"No more items",loadFailed:"Failed to load"},Sidebar:{expand:"Expand",collapse:"Collapse",loading:"Loading",empty:"No data",loadError:"Failed to load"},PersonPicker:{title:"Select people",ok:"OK",cancel:"Cancel",searchPlaceholder:"Search by name or employee ID",tabRecentContacts:"Recent contacts",tabRecentGroups:"Recent groups",tabOrganization:"Organization",tabPerson:"People",selectAll:"Select all",selectedTitle:"Selected",groupPerson:"People",groupGroup:"Groups",groupOrg:"Departments",remove:"Remove",drillDown:"View children",jumpTo:"Jump to ",empty:"No data",searchEmpty:"No results",loadFailed:"Failed to load",loadFailedDetail:"The service is unavailable or the network is unreachable",retry:"Retry"}},xe=Te;var X=ze.createContext(h),Z=ze.createContext(void 0),J=ze.createContext(-1);function he({locale:e=h,site:o,dialog:t,children:n}){let r=ze.useContext(J)+1,a=ze.useContext(v),i=t?.zIndex,s=a.dialog.zIndex,l=ze.useMemo(()=>({dialog:{zIndex:i??s}}),[i,s]),c=ze.useRef();c.current||(c.current=A());let p=c.current,g=ze.useRef();g.current||(g.current=U());let m=g.current;z(p,o,r),j(m,l,r),ze.useEffect(()=>()=>{G(p),q(m);},[m,p]);let d=jsxRuntime.jsx(J.Provider,{value:r,children:jsxRuntime.jsx(v.Provider,{value:l,children:jsxRuntime.jsx(Z.Provider,{value:o,children:jsxRuntime.jsxs(X.Provider,{value:e,children:[n,r===0&&jsxRuntime.jsx(V,{})]})})})});return r===0?jsxRuntime.jsx(chunkP427AFIE_js.c,{children:d}):d}he.displayName="LingeeProvider";function ve(){return ze.useContext(X)}function W(e){return ve()[e]}function oo(){return ze.useContext(Z)}var _e={info:jsxRuntime.jsx(lingeeIcon.ExclamationCircleFill,{size:20}),success:jsxRuntime.jsx(lingeeIcon.CheckCircleFill,{size:20}),warning:jsxRuntime.jsx(lingeeIcon.ExclamationCircleFill1,{size:20}),error:jsxRuntime.jsx(lingeeIcon.XCircleFill,{size:20})};function $({type:e,content:o,icon:t,closable:n,className:r,onClose:a}){let i=W("Toast"),s=()=>{if(t===null)return null;let l=t!==void 0?t:_e[e];return jsxRuntime.jsx("span",{className:"lg-toast__icon",children:l})};return jsxRuntime.jsxs("div",{className:chunkDCDWEVW4_js.a("lg-toast",`lg-toast--${e}`,r),children:[s(),jsxRuntime.jsx("span",{className:"lg-toast__content",children:o}),n&&jsxRuntime.jsx("button",{className:"lg-toast__close",onClick:a,"aria-label":i.close,type:"button",children:jsxRuntime.jsx(lingeeIcon.XLg,{size:16})})]})}var ee="lingee-web-bridge",oe="1.0.0",De="host",Re="iframe",Ne="lingee-web-bridge:host-toast-show",He="lingee-web-bridge:host-toast-dismiss",Fe="lingee-web-bridge:host-toast-probe",Ie="lingee-web-bridge:host-toast-ready";function te(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let e=Date.now();return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{let t=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(o==="x"?t:t&3|8).toString(16)})}function Oe(e,o){return {_protocol:ee,_version:oe,_source:e,_nonce:te(),_traceId:"",payload:o}}function Me(e,o){if(typeof e!="object"||e===null)return false;let t=e;return t._protocol===ee&&t._version===oe&&t._source===o&&typeof t._nonce=="string"&&"payload"in t}function y(){return typeof window<"u"&&window.parent!==window}var C=false,f=new Map,Q=false;function Ae(e){if(!Me(e,De))return false;let o=e.payload;return !!o&&typeof o=="object"&&o.type===Ie}function N(e){window.parent.postMessage(Oe(Re,e),"*");}function w(){Q||!y()||(Q=true,window.addEventListener("message",e=>{e.source===window.parent&&Ae(e.data)&&(C=true);}),window.addEventListener("pagehide",()=>{!C||f.size===0||k();}),N({type:Fe}));}function H(){return w(),C}function ne(e){if(w(),!C||!e.content)return null;let o=te();N({type:Ne,toastId:o,content:e.content.slice(0,500),level:e.level,duration:e.duration,key:e.key});let t=e.duration??3e3,n=t>0?window.setTimeout(()=>f.delete(o),t+500):void 0;return f.set(o,n),o}function k(e){if(w(),!!C){if(e){let o=f.get(e);o!==void 0&&window.clearTimeout(o),f.delete(e);}else f.forEach(o=>{o!==void 0&&window.clearTimeout(o);}),f.clear();N({type:He,toastId:e});}}w();function F(){if(!(typeof window>"u"))return window.lingeeBridge}function re(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function ie(e,o={}){return !(!(y()?H():E()&&typeof F()?.showToast=="function")||re(e.content)===void 0||e.icon!==void 0||e.className!==void 0||e.closable||o.getContainer!==void 0||o.top!==void 0||o.maxCount!==void 0)}function ae(e,o,t,n={}){let r=re(o.content);if(r===void 0)return null;let a={level:e,content:r,duration:t,key:o.key};if(y()){let d=ne(a);return d?(n.onAccepted?.(),{dismiss:()=>k(d)}):null}let i=F(),s=i?.showToast;if(!s)return null;let l=null,c=null,p=false,g=false,m=()=>{p||g||c||(c=n.onFallback?.()??null);};return Promise.resolve().then(()=>s(a)).then(d=>{if(!d?.ok||!d.toastId){m();return}if(g=true,l=d.toastId,p){i?.dismissToast?.(l);return}n.onAccepted?.();}).catch(d=>{console.error("[lingee-ui] showToast failed:",d),m();}),{dismiss:()=>{if(!p){if(p=true,c){c(),c=null;return}l&&i?.dismissToast?.(l);}}}}function se(){if(y())return H()?(k(),true):false;let e=F();return !E()||typeof e?.dismissToast!="function"?false:(e.dismissToast().catch(o=>{console.error("[lingee-ui] dismissToast failed:",o);}),true)}var T={};function V(){let e=T.top??16;return jsxRuntime.jsx(sonner.Toaster,{position:"top-center",offset:e,gap:8,expand:true,closeButton:false,toastOptions:{unstyled:true,className:"lg-toast-wrapper"},style:{"--width":"560px"}})}function Be(e){let o=e[0];return typeof o=="object"&&o!==null&&!ze__default.default.isValidElement(o)?o:{content:o,duration:e[1],onClose:e[2]}}function le(e,o,t,n=()=>o.onClose?.()){let r=t===0?1/0:t,a=false,i=()=>{a||(a=true,n());},s=sonner.toast.custom(l=>jsxRuntime.jsx($,{type:e,content:o.content,icon:o.icon,closable:o.closable,className:o.className,onClose:()=>sonner.toast.dismiss(l)}),{...o.key!==void 0&&{id:o.key},duration:r,onAutoClose:i,onDismiss:i});return ()=>{sonner.toast.dismiss(s),i();}}var L=new Set;function Ye(e,o){let t=o.duration!==void 0?o.duration<0?T.duration??3e3:o.duration:T.duration??3e3;if(ie(o,T)){let n=false,r,a=()=>{},i=()=>{n||(n=true,r!==void 0&&clearTimeout(r),L.delete(a),o.onClose?.());},s=ae(e,o,t,{onAccepted:()=>{t>0&&!n&&(r=setTimeout(i,t));},onFallback:()=>le(e,{...o,onClose:void 0},t,i)});if(s)return a=()=>{n||(s.dismiss(),i());},L.add(a),a}return le(e,o,t)}function S(e){return (...o)=>{let t=Be(o);return Ye(e,t)}}var ko={info:S("info"),success:S("success"),warning:S("warning"),error:S("error"),destroy:()=>{Array.from(L).forEach(e=>e()),L.clear(),se(),sonner.toast.dismiss();},config:e=>{T={...T,...e};}};exports.a=E;exports.b=V;exports.c=ko;exports.d=h;exports.e=ge;exports.f=me;exports.g=xe;exports.h=he;exports.i=ve;exports.j=W;exports.k=oo;
|