lingee-ui 0.0.13 → 0.0.15

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.
Files changed (65) hide show
  1. package/dist/button/index.d.mts +1 -1
  2. package/dist/button/index.d.ts +1 -1
  3. package/dist/button/index.js +1 -1
  4. package/dist/button/index.mjs +1 -1
  5. package/dist/{chunk-HYN4Y4AW.js → chunk-7I26V66U.js} +1 -1
  6. package/dist/{chunk-XOVQPZCB.js → chunk-E3NN26A5.js} +1 -1
  7. package/dist/{chunk-B6CAD73P.mjs → chunk-HOX3ZANF.mjs} +1 -1
  8. package/dist/{chunk-FRXQG2XX.mjs → chunk-JWOTGIJI.mjs} +1 -1
  9. package/dist/chunk-K3345E52.mjs +2 -0
  10. package/dist/{chunk-M37T4ADR.mjs → chunk-K7VTWIZJ.mjs} +1 -1
  11. package/dist/chunk-KXUUVDLA.mjs +1 -0
  12. package/dist/{chunk-LSZ4P7R5.js → chunk-P36XWLE4.js} +1 -1
  13. package/dist/{chunk-YSWFM6ML.js → chunk-P427AFIE.js} +1 -1
  14. package/dist/chunk-R5EGWXDT.mjs +1 -0
  15. package/dist/chunk-TVE57POC.js +1 -0
  16. package/dist/{chunk-T534AXC3.js → chunk-U4ZQGUSG.js} +2 -2
  17. package/dist/chunk-URZBMGD4.js +1 -0
  18. package/dist/chunk-VDUTBGPN.mjs +1 -0
  19. package/dist/chunk-XTBZBKJT.js +2 -0
  20. package/dist/{chunk-56AGGSSV.mjs → chunk-XWFDVFPJ.mjs} +1 -1
  21. package/dist/{index-7pb5YOcq.d.mts → index-89atTLPD.d.mts} +2 -2
  22. package/dist/{index-7pb5YOcq.d.ts → index-89atTLPD.d.ts} +2 -2
  23. package/dist/index.css +1 -1
  24. package/dist/index.d.mts +152 -6
  25. package/dist/index.d.ts +152 -6
  26. package/dist/index.js +2 -2
  27. package/dist/index.mjs +2 -2
  28. package/dist/input/index.css +1 -1
  29. package/dist/input/index.js +1 -1
  30. package/dist/input/index.mjs +1 -1
  31. package/dist/popover/index.css +1 -1
  32. package/dist/popover/index.d.mts +28 -2
  33. package/dist/popover/index.d.ts +28 -2
  34. package/dist/popover/index.js +1 -1
  35. package/dist/popover/index.mjs +1 -1
  36. package/dist/tabs/index.css +1 -1
  37. package/dist/tabs/index.js +1 -1
  38. package/dist/tabs/index.mjs +1 -1
  39. package/dist/toast/index.css +1 -1
  40. package/dist/toast/index.js +1 -1
  41. package/dist/toast/index.mjs +1 -1
  42. package/dist/tooltip/index.js +1 -1
  43. package/dist/tooltip/index.mjs +1 -1
  44. package/dist/tree/index.css +1 -1
  45. package/dist/tree/index.js +1 -1
  46. package/dist/tree/index.mjs +1 -1
  47. package/package.json +1 -1
  48. package/skill/AGENTS-SNIPPET.md +2 -2
  49. package/skill/SKILL.md +5 -5
  50. package/skill/VERSION.json +3 -3
  51. package/skill/references/components/dialog.md +40 -0
  52. package/skill/references/components/empty.md +2 -1
  53. package/skill/references/components/popover.md +16 -12
  54. package/skill/references/components/sidebar.md +43 -2
  55. package/skill/references/components/tooltip.md +1 -0
  56. package/skill/references/icons.md +3 -2
  57. package/skill/references/setup.md +1 -1
  58. package/skill/references/tokens.md +1 -1
  59. package/dist/chunk-6QCL57T5.mjs +0 -2
  60. package/dist/chunk-DHCCF3XI.mjs +0 -1
  61. package/dist/chunk-FTEVUZKX.js +0 -1
  62. package/dist/chunk-LBNA6G3N.js +0 -1
  63. package/dist/chunk-N524EGAL.mjs +0 -1
  64. package/dist/chunk-TL6FYFGR.js +0 -2
  65. package/dist/chunk-VV2IBN64.mjs +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **本文件由 `packages/lingee-ui/scripts/gen-skill.mjs` 自动生成,禁止手工编辑。**
4
4
  > 供根 `AGENTS.md` 引用,避免手写清单随组件库迭代脱节。
5
- > 组件库 `0.0.13` | 图标库 `1.0.18`
5
+ > 组件库 `0.0.15` | 图标库 `1.0.18`
6
6
 
7
7
  ## 可用组件(39)
8
8
 
@@ -32,7 +32,7 @@
32
32
  | `RangePicker` | 日期范围选择器 | 用于选择日期范围的输入组件。 |
33
33
  | `ScrollArea`、`ScrollBar` | 自定义滚动区域 | 自定义样式的滚动容器组件,提供美观的滚动条体验。 |
34
34
  | `Select` | 选择器 | 下拉选择器,支持单选、多选、搜索和远程加载。 |
35
- | `Sidebar` +26 个子组件 | 侧边栏 | 侧边栏复合组件,提供根容器、页签、导航项、分组、列表项、占位项与底栏,通过 Sidebar.xxx 组合使用。 |
35
+ | `Sidebar` +29 个子组件 | 侧边栏 | 侧边栏复合组件,提供根容器、页签、导航项、分组、列表项、占位项与底栏,通过 Sidebar.xxx 组合使用。 |
36
36
  | `Skeleton` | 骨架屏 | 在数据加载完成前通过占位图形展示页面结构,降低用户等待焦虑。 |
37
37
  | `Slider` | 数值滑块 | 滑动输入器,用于在数值区间内进行选择。 |
38
38
  | `Spin` | 加载中 | 用于页面和区域的加载中状态指示器。 |
package/skill/SKILL.md CHANGED
@@ -2,17 +2,17 @@
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.13"
5
+ lingeeUi: "0.0.15"
6
6
  lingeeIcon: "1.0.18"
7
7
  generatedBy: "gen-skill.mjs"
8
8
  ---
9
9
 
10
10
  # lingee-ui 组件库使用技能
11
11
 
12
- Kingdee Lingee 设计体系的 React 组件库(39 个组件)与图标库(969 个图标)。
12
+ Kingdee Lingee 设计体系的 React 组件库(39 个组件)与图标库(970 个图标)。
13
13
  本技能面向**消费方项目**,只覆盖「如何用」,不含组件库内部开发约定。
14
14
 
15
- - 组件库版本 `0.0.13` | 图标库版本 `1.0.18`
15
+ - 组件库版本 `0.0.15` | 图标库版本 `1.0.18`
16
16
  - 组件在线预览:https://kingdee.github.io/lingee-ui/
17
17
  - 图标在线预览:https://kingdee.github.io/lingee-icon/
18
18
 
@@ -80,7 +80,7 @@ createRoot(el).render(
80
80
  | `RangePicker` | 日期范围选择器 | 用于选择日期范围的输入组件。 | `range-picker.md` | — |
81
81
  | `ScrollArea`、`ScrollBar` | 自定义滚动区域 | 自定义样式的滚动容器组件,提供美观的滚动条体验。 | `scroll-area.md` | — |
82
82
  | `Select` | 选择器 | 下拉选择器,支持单选、多选、搜索和远程加载。 | `select.md` | — |
83
- | `Sidebar` +26 个子组件 | 侧边栏 | 侧边栏复合组件,提供根容器、页签、导航项、分组、列表项、占位项与底栏,通过 Sidebar.xxx 组合使用。 | `sidebar.md` | — |
83
+ | `Sidebar` +29 个子组件 | 侧边栏 | 侧边栏复合组件,提供根容器、页签、导航项、分组、列表项、占位项与底栏,通过 Sidebar.xxx 组合使用。 | `sidebar.md` | — |
84
84
  | `Skeleton` | 骨架屏 | 在数据加载完成前通过占位图形展示页面结构,降低用户等待焦虑。 | `skeleton.md` | — |
85
85
  | `Slider` | 数值滑块 | 滑动输入器,用于在数值区间内进行选择。 | `slider.md` | — |
86
86
  | `Spin` | 加载中 | 用于页面和区域的加载中状态指示器。 | `spin.md` | — |
@@ -134,7 +134,7 @@ import { Search, Trash } from "lingee-icon";
134
134
  图标默认 `size="1em"`、`color="currentColor"`,即随父级字号与文字颜色走,
135
135
  所以**优先用 CSS 控制颜色**而不是传 `color` prop。
136
136
 
137
- 完整 Props 见 `references/setup.md`,969 个图标的名称与中文语义索引见 `references/icons.md`。
137
+ 完整 Props 见 `references/setup.md`,970 个图标的名称与中文语义索引见 `references/icons.md`。
138
138
  选图标时必须从索引中查找,**不要凭猜测写图标名**,也不要从 `@ant-design/icons`、`lucide-react` 等其他库引入。
139
139
 
140
140
  ## 颜色:优先用语义 Token
@@ -1,7 +1,7 @@
1
1
  {
2
- "lingeeUi": "0.0.13",
2
+ "lingeeUi": "0.0.15",
3
3
  "lingeeIcon": "1.0.18",
4
4
  "componentCount": 39,
5
- "iconCount": 969,
6
- "sourceHash": "f2163ad2531e869c"
5
+ "iconCount": 970,
6
+ "sourceHash": "7ab51f1cba415811"
7
7
  }
@@ -49,6 +49,9 @@ export default function BasicDemo() {
49
49
  | `title` | 标题 | `ReactNode` | - |
50
50
  | `description` | 描述文本 | `ReactNode` | - |
51
51
  | `width` | 宽度 | `number` | `460` |
52
+ | `height` | 面板总高 | `number \| string` | 自适应内容 |
53
+ | `maxHeight` | 面板总高上限,仅 `autoHeight` 时生效 | `number \| string` | `640` |
54
+ | `autoHeight` | body 高度跟随内容,面板上限改由 `maxHeight` 给出 | `boolean` | `false` |
52
55
  | `closable` | 是否显示关闭按钮 | `boolean` | `true` |
53
56
  | `okText` | 确认按钮文本 | `string` | - |
54
57
  | `cancelText` | 取消按钮文本 | `string` | - |
@@ -77,6 +80,43 @@ export default function BasicDemo() {
77
80
 
78
81
  需要精确关闭某一个弹窗时,不要依赖这个全局 API,改由调用方自己控制触发时机。
79
82
 
83
+ ### HostModalPage
84
+
85
+ 宿主弹窗的承载页外壳,与 `Dialog` 的 `hostModal` 配对使用。负责取参、上报就绪、回传结果与关窗。
86
+
87
+ | 属性 | 说明 | 类型 | 默认值 |
88
+ |------|------|------|--------|
89
+ | `children` | 内容渲染函数,收到入参与 `close` | `(params, close) => ReactNode` | - |
90
+ | `fallback` | 无入参时的兜底(页面被直接访问) | `ReactNode` | `null` |
91
+ | `ready` | 内容是否就绪,`false` 时保留宿主 loading 占位 | `boolean` | `true` |
92
+ | `header` | 自绘头部,配合发起端 `hostModal.headless` | `(close) => ReactNode` | - |
93
+ | `closable` | 是否渲染内置关闭按钮(面板右上角) | `boolean` | 发起端开 `headless` 且未传 `header` 时 `true`,否则 `false` |
94
+ | `className` | 容器类名,用于控制内边距等业务样式 | `string` | - |
95
+
96
+ `closable` 存在的原因:发起端开 `headless` 后宿主不再提供关闭入口,而设计稿常把关闭按钮画在内容区右上角、并不需要一整个自绘头部。内置按钮复用 `.lg-dialog__close` 取样式,因此同一份内容组件在本地 `Dialog` 与宿主承载两种形态下按钮位置一致,业务侧不必写两套。
97
+
98
+ 默认值按「宿主有没有提供关闭入口」自动判定,业务通常无需传值:
99
+
100
+ - 发起端开了 `headless` → 宿主不画标题栏与关闭按钮,本组件补上;
101
+ - 发起端未开 `headless` → 宿主标题栏自带关闭按钮,不再叠加;
102
+ - 传了 `header` → 自绘头部通常已含关闭入口,同样不叠加,确有需要可显式传 `true`。
103
+
104
+ `headless` 状态由发起端经承载页路由的内部 query 参数传来(`Dialog` 的 `hostModal.headless` 自动挂上)。两条承载通道的取参协议只回业务入参、不带外壳信息,承载页无从自行判断,故走 URL 捎带。该参数属实现细节,业务不应读写。
105
+
106
+ 按钮在承载页内为 `fixed` 定位 —— 承载页容器自身可滚动,`absolute` 会让按钮随内容滚出视口,而承载页的视口就是弹窗面板,`fixed` 与「面板右上角」等价。
107
+
108
+ 按钮在承载页内为 `fixed` 定位 —— 承载页容器自身可滚动,`absolute` 会让按钮随内容滚出视口,而承载页的视口就是弹窗面板,`fixed` 与「面板右上角」等价。
109
+
110
+ ### 面板高度与视口
111
+
112
+ `height` 与 `maxHeight` 都是**面板总高**(含 68px 标题栏),不是内容区高度。
113
+
114
+ 面板始终不会超出视口:无论 `height` / `maxHeight` 给到多大,实际高度都会被 `min(上限, 100dvh - 32px)` 压回,超出部分由 body 内部滚动消化。因此浏览器窗口拉小后,标题栏与关闭按钮不会被挤到视口外。
115
+
116
+ 这道兜底**不能靠内联样式绕过**。若通过 `style={{ maxHeight }}` 自行设限,内联优先级会盖掉它,面板重新可能溢出视口 —— 需要更小的上限时请用 `maxHeight` 配合 `autoHeight`,不要写内联 `max-height`。
117
+
118
+ `autoHeight` 的 `maxHeight` 经 CSS 变量 `--lg-dialog-max-height` 传递,正是为了让样式表仍能与视口取 `min`。
119
+
80
120
  ### 宿主代理的兜底超时
81
121
 
82
122
  在客户端 webview 或被 iframe 嵌套的环境中,确认框会交由宿主渲染。若宿主受理后未回传结果(页面跳转、iframe 被卸载等),该次调用会在 5 分钟后按取消结算并放行队列,避免后续所有确认框失效。正常人工操作不会命中该超时。
@@ -3,7 +3,7 @@
3
3
  当目标区域无数据时展示的空状态占位图,引导用户进行下一步操作。
4
4
 
5
5
  - 导入:`import { Empty, EmptyCard } from "lingee-ui";`
6
- - 可用类型:`EmptyProps`, `EmptySize`, `EmptyIconComponent`, `EmptyCardProps`, `EmptyCardStatus`, `EmptyCardVariant`, `EmptyCardSpacing`
6
+ - 可用类型:`EmptyProps`, `EmptySize`, `EmptyIconComponent`, `EmptyCardProps`, `EmptyCardStatus`, `EmptyCardVariant`, `EmptyCardSpacing`, `EmptyCardAlign`
7
7
 
8
8
  ## 最小示例
9
9
 
@@ -37,6 +37,7 @@ export default function BasicDemo() {
37
37
  | `size` | 尺寸,语义同 `Empty`,透传给内部 `Empty` | `"sm" \| "md" \| "lg"` | `"sm"` |
38
38
  | `variant` | 留白密度:`block` 区块级 / `inline` 行内轻量 | `"block" \| "inline"` | `"block"` |
39
39
  | `spacing` | 留白档位。`loose` 为顶部大留白(列表级空态) | `"none" \| "normal" \| "loose"` | `"normal"` |
40
+ | `align` | 水平对齐。`start` 用于列表内嵌占位,与上方列表项同一阅读起点;只管对齐不含缩进,需要缩进时由消费方在外层补 `padding` | `"center" \| "start"` | `"center"` |
40
41
  | `onRetry` | 重试回调。仅 `status="error"` 生效,传入后整体可点击,并自动追加主题色「重试」 | `() => void` | - |
41
42
  | `className` | 自定义类名 | `string` | - |
42
43
  | `style` | 自定义内联样式 | `CSSProperties` | - |
@@ -4,7 +4,7 @@
4
4
 
5
5
  - 导入:`import { Popover, PopoverTrigger, PopoverAnchor, PopoverContent, PopoverArrow, PopoverClose } from "lingee-ui";`
6
6
  - 按需导入:`import { Popover } from "lingee-ui/popover";`
7
- - 可用类型:`PopoverProps`, `PopoverTriggerProps`, `PopoverAnchorProps`, `PopoverContentProps`, `PopoverArrowProps`, `PopoverCloseProps`, `PopoverPlacement`
7
+ - 可用类型:`PopoverTriggerAction`, `PopoverProps`, `PopoverTriggerProps`, `PopoverAnchorProps`, `PopoverContentProps`, `PopoverArrowProps`, `PopoverCloseProps`, `PopoverPlacement`
8
8
 
9
9
  ## 最小示例
10
10
 
@@ -29,17 +29,21 @@ export default function BasicDemo() {
29
29
 
30
30
  ### Popover
31
31
 
32
- | 属性 | 说明 | 类型 | 默认值 |
33
- |------|------|------|--------|
34
- | `open` | 受控打开状态 | `boolean` | - |
35
- | `onOpenChange` | 打开状态变化回调 | `(open: boolean) => void` | - |
36
- | `modal` | 是否为模态模式 | `boolean` | `false` |
37
- | `children` | 子元素(Trigger + Content) | `ReactNode` | - |
32
+ | 属性 | 说明 | 类型 | 默认值 |
33
+ | ----------------- | -------------------------------------------- | ------------------------- | --------- |
34
+ | `open` | 受控打开状态 | `boolean` | - |
35
+ | `defaultOpen` | 非受控默认打开状态 | `boolean` | - |
36
+ | `onOpenChange` | 打开状态变化回调 | `(open: boolean) => void` | - |
37
+ | `modal` | 是否为模态模式 | `boolean` | `false` |
38
+ | `trigger` | 打开方式 | `"click" \| "hover"` | `"click"` |
39
+ | `mouseEnterDelay` | `trigger="hover"` 时指针进入后延迟打开(ms) | `number` | `100` |
40
+ | `mouseLeaveDelay` | `trigger="hover"` 时指针离开后延迟关闭(ms) | `number` | `100` |
41
+ | `children` | 子元素(Trigger + Content) | `ReactNode` | - |
38
42
 
39
43
  ### PopoverContent
40
44
 
41
- | 属性 | 说明 | 类型 | 默认值 |
42
- |------|------|------|--------|
43
- | `side` | 弹出方向 | `"top" \| "bottom" \| "left" \| "right"` | `"bottom"` |
44
- | `align` | 对齐方式 | `"start" \| "center" \| "end"` | `"center"` |
45
- | `sideOffset` | 弹出层与触发器的间距 | `number` | `4` |
45
+ | 属性 | 说明 | 类型 | 默认值 |
46
+ | ------------ | -------------------- | ---------------------------------------- | ---------- |
47
+ | `side` | 弹出方向 | `"top" \| "bottom" \| "left" \| "right"` | `"bottom"` |
48
+ | `align` | 对齐方式 | `"start" \| "center" \| "end"` | `"center"` |
49
+ | `sideOffset` | 弹出层与触发器的间距 | `number` | `4` |
@@ -2,8 +2,8 @@
2
2
 
3
3
  侧边栏复合组件,提供根容器、页签、导航项、分组、列表项、占位项与底栏,通过 Sidebar.xxx 组合使用。
4
4
 
5
- - 导入:`import { Sidebar, SidebarRoot, SidebarHeader, SidebarTabBar, SidebarNavItem, SidebarCollapsibleNavItem, SidebarGroupHeader, SidebarListItem, SidebarCollapsibleListItem, SidebarFooter, SidebarFooterUser, SidebarFooterMenuStaticRow, SidebarFooterBadge, SidebarUsageBar, SidebarUsagePanel, SidebarUsagePanelSection, SidebarFeedbackModal, SidebarFeedbackSubmitPanel, SidebarFeedbackField, SidebarFeedbackFileWall, SidebarFeedbackHistoryPanel, SidebarFeedbackHistoryItem, SidebarFeedbackDetail, SidebarFeedbackAttachmentRow, SidebarFeedbackSimilarItem, SidebarAuthImage, formatFileSize } from "lingee-ui";`
6
- - 可用类型:`FeedbackAttachment`, `FeedbackStatus`, `FeedbackHistoryItem`, `FeedbackReply`, `FeedbackSimilarItem`, `FeedbackHistoryDetail`, `FeedbackTabKey`, `FeedbackFileWallItem`, `SidebarFeedbackModalProps`, `SidebarFeedbackSubmitPanelProps`, `SidebarFeedbackFieldProps`, `SidebarFeedbackFileWallProps`, `SidebarFeedbackHistoryPanelProps`, `SidebarFeedbackHistoryItemProps`, `SidebarFeedbackDetailProps`, `SidebarFeedbackAttachmentRowProps`, `SidebarFeedbackSimilarItemProps`, `SidebarAuthImageProps`, `SidebarRootProps`, `SidebarHeaderProps`, `SidebarTabBarProps`, `SidebarTabItem`, `SidebarNavItemProps`, `SidebarCollapsibleNavItemProps`, `SidebarCollapsibleNavItemChild`, `SidebarGroupHeaderProps`, `SidebarListItemProps`, `SidebarIndicatorType`, `SidebarCollapsibleListItemProps`, `SidebarCaretPlacement`, `SidebarFooterProps`, `SidebarFooterUserProps`, `SidebarFooterMenuStaticRowProps`, `SidebarFooterBadgeProps`, `SidebarUsageBarProps`, `SidebarUsageTone`, `SidebarUsagePanelProps`, `SidebarUsagePanelSectionProps`
5
+ - 导入:`import { Sidebar, SidebarRoot, SidebarHeader, SidebarStickyHeader, SidebarTabBar, SidebarNavItem, SidebarCollapsibleNavItem, SidebarGroupHeader, SidebarListItem, SidebarCollapsibleListItem, SidebarFolderNode, SidebarFolderSection, SidebarFooter, SidebarFooterUser, SidebarFooterMenuStaticRow, SidebarFooterBadge, SidebarUsageBar, SidebarUsagePanel, SidebarUsagePanelSection, SidebarFeedbackModal, SidebarFeedbackSubmitPanel, SidebarFeedbackField, SidebarFeedbackFileWall, SidebarFeedbackHistoryPanel, SidebarFeedbackHistoryItem, SidebarFeedbackDetail, SidebarFeedbackAttachmentRow, SidebarFeedbackSimilarItem, SidebarAuthImage, formatFileSize } from "lingee-ui";`
6
+ - 可用类型:`FeedbackAttachment`, `FeedbackStatus`, `FeedbackHistoryItem`, `FeedbackReply`, `FeedbackSimilarItem`, `FeedbackHistoryDetail`, `FeedbackTabKey`, `FeedbackFileWallItem`, `SidebarFeedbackModalProps`, `SidebarFeedbackSubmitPanelProps`, `SidebarFeedbackFieldProps`, `SidebarFeedbackFileWallProps`, `SidebarFeedbackHistoryPanelProps`, `SidebarFeedbackHistoryItemProps`, `SidebarFeedbackDetailProps`, `SidebarFeedbackAttachmentRowProps`, `SidebarFeedbackSimilarItemProps`, `SidebarAuthImageProps`, `SidebarRootProps`, `SidebarHeaderProps`, `SidebarStickyHeaderProps`, `SidebarTabBarProps`, `SidebarTabItem`, `SidebarNavItemProps`, `SidebarCollapsibleNavItemProps`, `SidebarCollapsibleNavItemChild`, `SidebarCaretTone`, `SidebarGroupHeaderProps`, `SidebarListItemProps`, `SidebarIndicatorType`, `SidebarCollapsibleListItemProps`, `SidebarCaretPlacement`, `SidebarFolderNodeProps`, `SidebarFolderSectionProps`, `SidebarFolderStatus`, `SidebarFolderStatusText`, `SidebarFooterProps`, `SidebarFooterUserProps`, `SidebarFooterMenuStaticRowProps`, `SidebarFooterBadgeProps`, `SidebarUsageBarProps`, `SidebarUsageTone`, `SidebarUsagePanelProps`, `SidebarUsagePanelSectionProps`
7
7
 
8
8
  ## 最小示例
9
9
 
@@ -73,6 +73,15 @@ export default function BasicDemo() {
73
73
  |------|------|------|--------|
74
74
  | `children` | 内容 | `ReactNode` | - |
75
75
 
76
+ ### Sidebar.StickyHeader
77
+
78
+ 继承原生 `div` 属性。必须作为滚动容器的直接子元素,才能相对该容器吸顶。
79
+
80
+ | 属性 | 说明 | 类型 | 默认值 |
81
+ |------|------|------|--------|
82
+ | `children` | 占满剩余宽度的主内容 | `ReactNode` | - |
83
+ | `actions` | 固定在右侧的操作区 | `ReactNode` | - |
84
+
76
85
  ### Sidebar.TabBar
77
86
 
78
87
  | 属性 | 说明 | 类型 | 默认值 |
@@ -103,6 +112,7 @@ export default function BasicDemo() {
103
112
  | `icon` | 左侧图标 | `ReactNode` | - |
104
113
  | `label` | 分组标题 | `ReactNode` | - |
105
114
  | `active` | 头部高亮。内部与子项 active 互斥 | `boolean` | `false` |
115
+ | `caretTone` | 箭头视觉层级。`muted` 叠加弱化透明度,`default` 保留语义色完整不透明度 | `"muted" \| "default"` | `"muted"` |
106
116
  | `open` | 受控展开态 | `boolean` | - |
107
117
  | `defaultOpen` | 非受控初始展开态 | `boolean` | `false` |
108
118
  | `onOpenChange` | 展开态变化回调 | `(next: boolean) => void` | - |
@@ -150,6 +160,37 @@ export default function BasicDemo() {
150
160
  | `children` | 展开区内容 | `ReactNode` | - |
151
161
  | `expandLabel` / `collapseLabel` | 无障碍标签 | `string` | - |
152
162
 
163
+ ### Sidebar.FolderSection
164
+
165
+ | 属性 | 说明 | 类型 | 默认值 |
166
+ |------|------|------|--------|
167
+ | `title` | 区块标题 | `ReactNode` | - |
168
+ | `expanded` | 展开态。收起时连占位一起不渲染 | `boolean` | `true` |
169
+ | `onToggle` | 切换回调 | `() => void` | - |
170
+ | `status` | 取数状态 | `"loading" \| "empty" \| "error" \| "ready"` | `"ready"` |
171
+ | `statusText` | 覆盖三态文案,未传字段回退 locale | `Partial<{ loading, empty, error }>` | - |
172
+ | `onRetry` | 重试回调,仅 `status="error"` 时生效 | `() => void` | - |
173
+ | `actions` | 标题行右侧操作区插槽 | `ReactNode` | - |
174
+ | `actionsVisible` | 操作区常显 | `boolean` | `false` |
175
+ | `children` | 文件夹列表,仅 `status="ready"` 且展开时渲染 | `ReactNode` | - |
176
+
177
+ ### Sidebar.FolderNode
178
+
179
+ | 属性 | 说明 | 类型 | 默认值 |
180
+ |------|------|------|--------|
181
+ | `name` | 文件夹名称 | `ReactNode` | - |
182
+ | `icon` | 覆盖左侧图标。缺省时内置文件夹图标并随展开态切换 | `ReactNode` | - |
183
+ | `expanded` | 展开态 | `boolean` | `false` |
184
+ | `onToggle` | 切换回调 | `() => void` | - |
185
+ | `status` | 展开区取数状态 | `"loading" \| "empty" \| "error" \| "ready"` | `"ready"` |
186
+ | `statusText` | 覆盖三态文案,未传字段回退 locale | `Partial<{ loading, empty, error }>` | - |
187
+ | `onRetry` | 重试回调,仅 `status="error"` 时生效 | `() => void` | - |
188
+ | `actions` | 头部操作区插槽 | `ReactNode` | - |
189
+ | `actionsVisible` | 操作区常显。菜单打开时置 `true` | `boolean` | `false` |
190
+ | `active` | 头部高亮 | `boolean` | `false` |
191
+ | `children` | 展开区内容,仅 `status="ready"` 时渲染 | `ReactNode` | - |
192
+ | `expandLabel` / `collapseLabel` | 无障碍标签,缺省回退 locale | `string` | - |
193
+
153
194
  ### Sidebar.Footer
154
195
 
155
196
  继承 `Sidebar.FooterUser` 的全部属性(不传 `children` 时透传给内建用户区),另有:
@@ -31,6 +31,7 @@ export default function BasicDemo() {
31
31
  | `sideOffset` | 箭头尖端与触发元素的间距(px) | `number` | `4` |
32
32
  | `maxWidth` | 浮层最大宽度(px),覆盖档位默认宽度 | `number` | 按档位取 240 / 240 / 320 / 500 |
33
33
  | `scrollable` | 内容超出限高时滚动(单行档不生效) | `boolean` | `true` |
34
+
34
35
  | `children` | 触发元素 | `ReactNode` | - |
35
36
 
36
37
  :::tip
@@ -12,9 +12,9 @@ import { Search } from "lingee-icon";
12
12
 
13
13
  ---
14
14
 
15
- 969 个图标,27 个分类。图标名为 PascalCase,可直接作为 React 组件名或 SVG Sprite `<use href="#IconName">` 的引用 ID。
15
+ 970 个图标,27 个分类。图标名为 PascalCase,可直接作为 React 组件名或 SVG Sprite `<use href="#IconName">` 的引用 ID。
16
16
 
17
- ## 通用类(49
17
+ ## 通用类(50
18
18
 
19
19
  | 图标名 | 语义/用途 |
20
20
  |--------|----------|
@@ -24,6 +24,7 @@ import { Search } from "lingee-icon";
24
24
  | BasicSettings | 设置 |
25
25
  | BellSlash | 通知关闭 |
26
26
  | Catalog2 | 目录/分类 |
27
+ | CircleDashed | 虚线圆圈 — 待处理/占位 |
27
28
  | CircleDots | 更多操作(圆形) |
28
29
  | Discover | 发现/探索(指南针) |
29
30
  | Dislike | 踩(选中) |
@@ -1,6 +1,6 @@
1
1
  # 接入指南
2
2
 
3
- 组件库 `0.0.13` | 图标库 `1.0.18`
3
+ 组件库 `0.0.15` | 图标库 `1.0.18`
4
4
 
5
5
  ## 安装
6
6
 
@@ -1,6 +1,6 @@
1
1
  # 语义 Token 全表
2
2
 
3
- 组件库 `0.0.13`。仅列语义层(`--lg-g-*`)。
3
+ 组件库 `0.0.15`。仅列语义层(`--lg-g-*`)。
4
4
 
5
5
  亮色与暗色**变量名完全相同**,给 `<html>` 加 `data-theme="dark"` 即自动切换,业务代码只写一次。
6
6
 
@@ -1,2 +0,0 @@
1
- import {j}from'./chunk-DHCCF3XI.mjs';import {a}from'./chunk-DN2VKVCV.mjs';import ke,{useEffect,useMemo,useCallback}from'react';import Pe from'@rc-component/tree';import {DocumentLibrary,ChevronDown,Inbox,ExclamationCircle,LoaderCircle}from'lingee-icon';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var A=ke.forwardRef(({className:e,size:r="md",spinning:o=true,children:n,tip:a$1,...c},p)=>{let s=j("Spin"),i=n!=null,g=jsx("div",{className:"lg-spin__indicator"});return i?jsxs("div",{ref:p,className:a("lg-spin","lg-spin--nested",e),...c,children:[jsx("div",{className:a("lg-spin__content",o&&"lg-spin__content--loading"),children:n}),o&&jsxs("div",{className:"lg-spin__overlay",role:"status","aria-label":a$1||s.loading,children:[jsx("div",{className:a("lg-spin",`lg-spin--${r}`),children:g}),a$1&&jsx("span",{className:"lg-spin__tip",children:a$1})]})]}):jsx("div",{ref:p,className:a("lg-spin",`lg-spin--${r}`,!o&&"lg-spin--paused",e),role:"status","aria-label":a$1||s.loading,...c,children:g})});A.displayName="Spin";var Z="lg-empty-gradient",U=`url(#${Z})`,X=0,D=null;function Te(){if(X++>0||typeof document>"u")return;let e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.overflow="hidden",e.innerHTML=`<defs><linearGradient id="${Z}" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse"><stop style="stop-color: var(--__lg-empty-gradient-from)"/><stop offset="1" style="stop-color: var(--__lg-empty-gradient-to)"/></linearGradient></defs>`,document.body.appendChild(e),D=e;}function Ce(){--X>0||D&&(D.remove(),D=null);}var M={lg:56,md:24,sm:16};function De(e){return typeof e=="function"||typeof e=="object"&&e!==null&&"render"in e&&typeof e.render=="function"}var w=ke.forwardRef(({size:e="md",icon:r,description:o,className:n,style:a$1,...c},p)=>{useEffect(()=>(Te(),Ce),[]);let s=M[e],i;return r?De(r)?i=jsx(r,{size:s,fill:U}):i=r:i=jsx(DocumentLibrary,{size:s,fill:U}),jsxs("div",{ref:p,className:a("lg-empty",`lg-empty--${e}`,n),style:a$1,...c,children:[jsx("span",{className:"lg-empty__icon",children:i}),jsx("span",{className:"lg-empty__text",children:o})]})});w.displayName="Empty";function Ae(e,r){switch(e){case "loading":return jsx(LoaderCircle,{size:r,spin:true});case "error":return jsx(ExclamationCircle,{size:r});default:return jsx(Inbox,{size:r})}}var K=ke.forwardRef(({status:e,description:r,icon:o,size:n="sm",variant:a$1="block",spacing:c="normal",onRetry:p,className:s,style:i,...g},_)=>{let R=j("Empty"),I=o===null?null:o??Ae(e,M[n]),y=e==="error"&&typeof p=="function",E=a("lg-empty-card",`lg-empty-card--${n}`,`lg-empty-card--${a$1}`,`lg-empty-card--${e}`,`lg-empty-card--spacing-${c}`,y&&"lg-empty-card--retryable",s),N=y?jsxs(Fragment,{children:[r,jsx("span",{className:"lg-empty-card__retry",children:R.retry})]}):r,b=jsx(w,{size:n,icon:I??jsx(Fragment,{}),description:N,className:"lg-empty-card__body"});return y?jsx("button",{ref:_,type:"button",className:E,style:i,onClick:p,...g,children:b}):jsx("div",{ref:_,className:E,style:i,role:e==="empty"?void 0:"status","aria-live":e==="empty"?void 0:"polite",...g,children:b})});K.displayName="Empty.Card";var J=Object.assign(w,{Card:K});var Ge={sm:30,md:34,lg:38},P=()=>({height:0,opacity:0}),W=e=>{let r=Array.from(e.children);return r.length===0?0:r.reduce((o,n)=>{let a=parseFloat(getComputedStyle(n).marginTop)||0;return o+n.getBoundingClientRect().height+a},0)},Q=e=>({height:W(e),opacity:1}),$e={motionName:"lg-tree-motion",motionDeadline:300,onAppearStart:P,onAppearActive:Q,onEnterStart:P,onEnterActive:Q,onLeaveStart:e=>({height:W(e),opacity:1}),onLeaveActive:P},je=ke.forwardRef((e,r)=>{let{treeData:o,fieldNames:n,size:a$1="md",expandedKeys:c,defaultExpandedKeys:p,defaultExpandAll:s,autoExpandParent:i,expandAction:g="click",onExpand:_,selectable:R=true,multiple:I=false,selectedKeys:y,defaultSelectedKeys:E,onSelect:N,checkable:b=false,checkStrictly:Y=false,checkedKeys:H,defaultCheckedKeys:ee,onCheck:G,showIcon:te=false,icon:x,switcherIcon:v,indentGuide:re="line",titleRender:oe,loadData:ne,loadedKeys:$,draggable:T=false,allowDrop:L,onDrop:j$1,height:ae,itemHeight:ie,virtual:le,disabled:B=false,loading:O=false,empty:de,onRightClick:ce,animated:pe=true,className:se,style:ge}=e,me=j("Tree"),ye=useMemo(()=>{if(x)return typeof x!="function"?x:t=>x(t.data,{expanded:!!t.expanded,isLeaf:!!t.isLeaf})},[x]),fe=useMemo(()=>v!==void 0?typeof v!="function"?v:t=>v({expanded:!!t.expanded,isLeaf:!!t.isLeaf}):t=>t.isLeaf?null:jsx(ChevronDown,{className:"lg-tree__switcher-icon",size:16,"aria-hidden":true}),[v]),he=useMemo(()=>{if(T)return {icon:false,nodeDraggable:typeof T=="function"?t=>T(t):void 0}},[T]),ue=useCallback((t,l)=>{_?.(t,{node:l.node,expanded:l.expanded});},[_]),_e=useCallback((t,l)=>{N?.(t,{node:l.node,selected:l.selected,selectedNodes:l.selectedNodes});},[N]),be=useCallback((t,l)=>{G?.(t,{node:l.node,checked:l.checked,checkedNodes:l.checkedNodes,halfCheckedKeys:l.halfCheckedKeys});},[G]),xe=useCallback(t=>{j$1?.({dragNode:t.dragNode,node:t.node,dropPosition:t.dropPosition,dropToGap:t.dropToGap});},[j$1]),F=useMemo(()=>{if(L)return t=>L({dragNode:t.dragNode,dropNode:t.dropNode,dropPosition:t.dropPosition})},[L]),ve=!o||o.length===0,f={};return c!==void 0&&(f.expandedKeys=c),y!==void 0&&(f.selectedKeys=y),H!==void 0&&(f.checkedKeys=H),$!==void 0&&(f.loadedKeys=$),F!==void 0&&(f.allowDrop=F),jsxs("div",{ref:r,className:a("lg-tree",`lg-tree--${a$1}`,`lg-tree--guide-${re}`,b&&"lg-tree--checkable",B&&"lg-tree--disabled",O&&"lg-tree--loading",se),style:ge,children:[O&&jsx("div",{className:"lg-tree__loading-mask",children:jsx(A,{size:"md"})}),ve?jsx("div",{className:"lg-tree__empty",children:de??jsx(J,{size:"sm",description:me.empty})}):jsx(Pe,{prefixCls:"lg-tree",treeData:o,fieldNames:n,defaultExpandedKeys:p,defaultExpandAll:s,autoExpandParent:i,expandAction:g,onExpand:ue,selectable:R,multiple:I,defaultSelectedKeys:E,onSelect:_e,checkable:b,checkStrictly:Y,defaultCheckedKeys:ee,onCheck:be,showIcon:te,icon:ye,switcherIcon:fe,titleRender:oe,loadData:ne,draggable:he,onDrop:xe,height:ae,itemHeight:ie??Ge[a$1],virtual:le,disabled:B,onRightClick:ce,motion:pe?$e:void 0,...f})]})});je.displayName="Tree";
2
- export{K as a,J as b,A as c,je as d};
@@ -1 +0,0 @@
1
- import {c}from'./chunk-VV2IBN64.mjs';import {a}from'./chunk-DN2VKVCV.mjs';import ze,{createContext,useContext,useMemo,useRef,useEffect}from'react';import {Toaster,toast}from'sonner';import {XCircleFill,ExclamationCircleFill1,CheckCircleFill,ExclamationCircleFill,XLg}from'lingee-icon';import {jsx,jsxs}from'react/jsx-runtime';var ce={locale:"zh-CN",Button:{},Breadcrumb:{more:"\u66F4\u591A",back:"\u8FD4\u56DE"},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:{empty:"\u6682\u65E0\u6570\u636E"},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"}},v=ce;var L=new Map,F=0;function A(){return F+=1,{id:F}}function z(e,o,t){L.set(e.id,{site:o,depth:t});}function Y(e){L.delete(e.id);}function ue(){let e;for(let o of L.values())(!e||o.depth>=e.depth)&&(e=o);return e?.site}function E(){return ue()==="lingee"}var U={dialog:{}},h=createContext(U),D=new Map,B=0;function G(){return B+=1,{id:B}}function q(e,o,t){D.set(e.id,{config:o,depth:t});}function j(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??U}function me(){return useContext(h)}var Te={locale:"en-US",Button:{},Breadcrumb:{more:"More",back:"Back"},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:{empty:"No data"},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"}},xe=Te;var V=createContext(v),Z=createContext(void 0),X=createContext(-1);function ve({locale:e=v,site:o,dialog:t,children:n}){let r=useContext(X)+1,s=useContext(h),i=t?.zIndex,a=s.dialog.zIndex,l=useMemo(()=>({dialog:{zIndex:i??a}}),[i,a]),c$1=useRef();c$1.current||(c$1.current=A());let u=c$1.current,g=useRef();g.current||(g.current=G());let m=g.current;z(u,o,r),q(m,l,r),useEffect(()=>()=>{Y(u),j(m);},[m,u]);let d=jsx(X.Provider,{value:r,children:jsx(h.Provider,{value:l,children:jsx(Z.Provider,{value:o,children:jsxs(V.Provider,{value:e,children:[n,r===0&&jsx(J,{})]})})})});return r===0?jsx(c,{children:d}):d}ve.displayName="LingeeProvider";function he(){return useContext(V)}function W(e){return he()[e]}function oo(){return useContext(Z)}var Le={info:jsx(ExclamationCircleFill,{size:20}),success:jsx(CheckCircleFill,{size:20}),warning:jsx(ExclamationCircleFill1,{size:20}),error:jsx(XCircleFill,{size:20})};function $({type:e,content:o,icon:t,closable:n,className:r,onClose:s}){let i=W("Toast"),a$1=()=>{if(t===null)return null;let l=t!==void 0?t:Le[e];return jsx("span",{className:"lg-toast__icon",children:l})};return jsxs("div",{className:a("lg-toast",`lg-toast--${e}`,r),children:[a$1(),jsx("span",{className:"lg-toast__content",children:o}),n&&jsx("button",{className:"lg-toast__close",onClick:s,"aria-label":i.close,type:"button",children:jsx(XLg,{size:16})})]})}var ee="lingee-web-bridge",oe="1.0.0",De="host",Ne="iframe",Re="lingee-web-bridge:host-toast-show",He="lingee-web-bridge:host-toast-dismiss",Ie="lingee-web-bridge:host-toast-probe",Me="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 Fe(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(!Fe(e,De))return false;let o=e.payload;return !!o&&typeof o=="object"&&o.type===Me}function R(e){window.parent.postMessage(Oe(Ne,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();}),R({type:Ie}));}function H(){return w(),C}function ne(e){if(w(),!C||!e.content)return null;let o=te();R({type:Re,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();R({type:He,toastId:e});}}w();function I(){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 I()?.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 se(e,o,t,n={}){let r=re(o.content);if(r===void 0)return null;let s={level:e,content:r,duration:t,key:o.key};if(y()){let d=ne(s);return d?(n.onAccepted?.(),{dismiss:()=>k(d)}):null}let i=I(),a=i?.showToast;if(!a)return null;let l=null,c=null,u=false,g=false,m=()=>{u||g||c||(c=n.onFallback?.()??null);};return Promise.resolve().then(()=>a(s)).then(d=>{if(!d?.ok||!d.toastId){m();return}if(g=true,l=d.toastId,u){i?.dismissToast?.(l);return}n.onAccepted?.();}).catch(d=>{console.error("[lingee-ui] showToast failed:",d),m();}),{dismiss:()=>{if(!u){if(u=true,c){c(),c=null;return}l&&i?.dismissToast?.(l);}}}}function ae(){if(y())return H()?(k(),true):false;let e=I();return !E()||typeof e?.dismissToast!="function"?false:(e.dismissToast().catch(o=>{console.error("[lingee-ui] dismissToast failed:",o);}),true)}var T={};function J(){let e=T.top??16;return jsx(Toaster,{position:"top-center",offset:e,gap:8,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.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,s=false,i=()=>{s||(s=true,n());},a=toast.custom(l=>jsx($,{type:e,content:o.content,icon:o.icon,closable:o.closable,className:o.className,onClose:()=>toast.dismiss(l)}),{...o.key!==void 0&&{id:o.key},duration:r,onAutoClose:i,onDismiss:i});return ()=>{toast.dismiss(a),i();}}var _=new Set;function Ue(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,s=()=>{},i=()=>{n||(n=true,r!==void 0&&clearTimeout(r),_.delete(s),o.onClose?.());},a=se(e,o,t,{onAccepted:()=>{t>0&&!n&&(r=setTimeout(i,t));},onFallback:()=>le(e,{...o,onClose:void 0},t,i)});if(a)return s=()=>{n||(a.dismiss(),i());},_.add(s),s}return le(e,o,t)}function S(e){return (...o)=>{let t=Be(o);return Ue(e,t)}}var ko={info:S("info"),success:S("success"),warning:S("warning"),error:S("error"),destroy:()=>{Array.from(_).forEach(e=>e()),_.clear(),ae(),toast.dismiss();},config:e=>{T={...T,...e};}};export{E as a,J as b,ko as c,v as d,ge as e,me as f,xe as g,ve as h,he as i,W as j,oo as k};
@@ -1 +0,0 @@
1
- 'use strict';var chunkYSWFM6ML_js=require('./chunk-YSWFM6ML.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"},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:{empty:"\u6682\u65E0\u6570\u636E"},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"}},v=ce;var L=new Map,F=0;function A(){return F+=1,{id:F}}function z(e,o,t){L.set(e.id,{site:o,depth:t});}function Y(e){L.delete(e.id);}function ue(){let e;for(let o of L.values())(!e||o.depth>=e.depth)&&(e=o);return e?.site}function E(){return ue()==="lingee"}var U={dialog:{}},h=ze.createContext(U),D=new Map,B=0;function G(){return B+=1,{id:B}}function q(e,o,t){D.set(e.id,{config:o,depth:t});}function j(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??U}function me(){return ze.useContext(h)}var Te={locale:"en-US",Button:{},Breadcrumb:{more:"More",back:"Back"},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:{empty:"No data"},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"}},xe=Te;var V=ze.createContext(v),Z=ze.createContext(void 0),X=ze.createContext(-1);function ve({locale:e=v,site:o,dialog:t,children:n}){let r=ze.useContext(X)+1,s=ze.useContext(h),i=t?.zIndex,a=s.dialog.zIndex,l=ze.useMemo(()=>({dialog:{zIndex:i??a}}),[i,a]),c=ze.useRef();c.current||(c.current=A());let u=c.current,g=ze.useRef();g.current||(g.current=G());let m=g.current;z(u,o,r),q(m,l,r),ze.useEffect(()=>()=>{Y(u),j(m);},[m,u]);let d=jsxRuntime.jsx(X.Provider,{value:r,children:jsxRuntime.jsx(h.Provider,{value:l,children:jsxRuntime.jsx(Z.Provider,{value:o,children:jsxRuntime.jsxs(V.Provider,{value:e,children:[n,r===0&&jsxRuntime.jsx(J,{})]})})})});return r===0?jsxRuntime.jsx(chunkYSWFM6ML_js.c,{children:d}):d}ve.displayName="LingeeProvider";function he(){return ze.useContext(V)}function W(e){return he()[e]}function oo(){return ze.useContext(Z)}var Le={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:s}){let i=W("Toast"),a=()=>{if(t===null)return null;let l=t!==void 0?t:Le[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:[a(),jsxRuntime.jsx("span",{className:"lg-toast__content",children:o}),n&&jsxRuntime.jsx("button",{className:"lg-toast__close",onClick:s,"aria-label":i.close,type:"button",children:jsxRuntime.jsx(lingeeIcon.XLg,{size:16})})]})}var ee="lingee-web-bridge",oe="1.0.0",De="host",Ne="iframe",Re="lingee-web-bridge:host-toast-show",He="lingee-web-bridge:host-toast-dismiss",Ie="lingee-web-bridge:host-toast-probe",Me="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 Fe(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(!Fe(e,De))return false;let o=e.payload;return !!o&&typeof o=="object"&&o.type===Me}function R(e){window.parent.postMessage(Oe(Ne,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();}),R({type:Ie}));}function H(){return w(),C}function ne(e){if(w(),!C||!e.content)return null;let o=te();R({type:Re,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();R({type:He,toastId:e});}}w();function I(){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 I()?.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 se(e,o,t,n={}){let r=re(o.content);if(r===void 0)return null;let s={level:e,content:r,duration:t,key:o.key};if(y()){let d=ne(s);return d?(n.onAccepted?.(),{dismiss:()=>k(d)}):null}let i=I(),a=i?.showToast;if(!a)return null;let l=null,c=null,u=false,g=false,m=()=>{u||g||c||(c=n.onFallback?.()??null);};return Promise.resolve().then(()=>a(s)).then(d=>{if(!d?.ok||!d.toastId){m();return}if(g=true,l=d.toastId,u){i?.dismissToast?.(l);return}n.onAccepted?.();}).catch(d=>{console.error("[lingee-ui] showToast failed:",d),m();}),{dismiss:()=>{if(!u){if(u=true,c){c(),c=null;return}l&&i?.dismissToast?.(l);}}}}function ae(){if(y())return H()?(k(),true):false;let e=I();return !E()||typeof e?.dismissToast!="function"?false:(e.dismissToast().catch(o=>{console.error("[lingee-ui] dismissToast failed:",o);}),true)}var T={};function J(){let e=T.top??16;return jsxRuntime.jsx(sonner.Toaster,{position:"top-center",offset:e,gap:8,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,s=false,i=()=>{s||(s=true,n());},a=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(a),i();}}var _=new Set;function Ue(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,s=()=>{},i=()=>{n||(n=true,r!==void 0&&clearTimeout(r),_.delete(s),o.onClose?.());},a=se(e,o,t,{onAccepted:()=>{t>0&&!n&&(r=setTimeout(i,t));},onFallback:()=>le(e,{...o,onClose:void 0},t,i)});if(a)return s=()=>{n||(a.dismiss(),i());},_.add(s),s}return le(e,o,t)}function S(e){return (...o)=>{let t=Be(o);return Ue(e,t)}}var ko={info:S("info"),success:S("success"),warning:S("warning"),error:S("error"),destroy:()=>{Array.from(_).forEach(e=>e()),_.clear(),ae(),sonner.toast.dismiss();},config:e=>{T={...T,...e};}};exports.a=E;exports.b=J;exports.c=ko;exports.d=v;exports.e=ge;exports.f=me;exports.g=xe;exports.h=ve;exports.i=he;exports.j=W;exports.k=oo;
@@ -1 +0,0 @@
1
- 'use strict';var chunkDCDWEVW4_js=require('./chunk-DCDWEVW4.js'),i=require('react'),o=require('@radix-ui/react-popover'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var i__default=/*#__PURE__*/_interopDefault(i);var o__namespace=/*#__PURE__*/_interopNamespace(o);function R({children:r,open:e,defaultOpen:t,onOpenChange:a,modal:n=false}){return jsxRuntime.jsx(o__namespace.Root,{open:e,defaultOpen:t,onOpenChange:a,modal:n,children:r})}R.displayName="Popover";var w=i__default.default.forwardRef(({children:r,asChild:e=true,...t},a)=>jsxRuntime.jsx(o__namespace.Trigger,{ref:a,asChild:e,...t,children:r}));w.displayName="PopoverTrigger";var C=i__default.default.forwardRef(({children:r,asChild:e=true,...t},a)=>jsxRuntime.jsx(o__namespace.Anchor,{ref:a,asChild:e,...t,children:r}));C.displayName="PopoverAnchor";var A=i__default.default.forwardRef(({children:r,className:e,side:t="bottom",align:a="center",sideOffset:n=4,alignOffset:v=0,container:l,collisionPadding:P=8,onEscapeKeyDown:m,onPointerDownOutside:f,onFocusOutside:c,onInteractOutside:g,onOpenAutoFocus:u,onCloseAutoFocus:x,...y},h)=>{let d=jsxRuntime.jsx(o__namespace.Content,{ref:h,className:chunkDCDWEVW4_js.a("lg-popover",e),side:t,align:a,sideOffset:n,alignOffset:v,collisionPadding:P,onEscapeKeyDown:m,onPointerDownOutside:f,onFocusOutside:c,onInteractOutside:g,onOpenAutoFocus:u,onCloseAutoFocus:x,...y,children:r});return l===null?d:jsxRuntime.jsx(o__namespace.Portal,{container:l,children:d})});A.displayName="PopoverContent";var b=i__default.default.forwardRef(({className:r,width:e=10,height:t=5,...a},n)=>jsxRuntime.jsx(o__namespace.Arrow,{ref:n,className:chunkDCDWEVW4_js.a("lg-popover__arrow",r),width:e,height:t,...a}));b.displayName="PopoverArrow";var T=i__default.default.forwardRef(({children:r,asChild:e=true,...t},a)=>jsxRuntime.jsx(o__namespace.Close,{ref:a,asChild:e,...t,children:r}));T.displayName="PopoverClose";exports.a=R;exports.b=w;exports.c=C;exports.d=A;exports.e=b;exports.f=T;
@@ -1 +0,0 @@
1
- import {a}from'./chunk-DN2VKVCV.mjs';import i from'react';import*as o from'@radix-ui/react-popover';import {jsx}from'react/jsx-runtime';function R({children:r,open:e,defaultOpen:t,onOpenChange:a,modal:n=false}){return jsx(o.Root,{open:e,defaultOpen:t,onOpenChange:a,modal:n,children:r})}R.displayName="Popover";var w=i.forwardRef(({children:r,asChild:e=true,...t},a)=>jsx(o.Trigger,{ref:a,asChild:e,...t,children:r}));w.displayName="PopoverTrigger";var C=i.forwardRef(({children:r,asChild:e=true,...t},a)=>jsx(o.Anchor,{ref:a,asChild:e,...t,children:r}));C.displayName="PopoverAnchor";var A=i.forwardRef(({children:r,className:e,side:t="bottom",align:a$1="center",sideOffset:n=4,alignOffset:v=0,container:l,collisionPadding:P=8,onEscapeKeyDown:m,onPointerDownOutside:f,onFocusOutside:c,onInteractOutside:g,onOpenAutoFocus:u,onCloseAutoFocus:x,...y},h)=>{let d=jsx(o.Content,{ref:h,className:a("lg-popover",e),side:t,align:a$1,sideOffset:n,alignOffset:v,collisionPadding:P,onEscapeKeyDown:m,onPointerDownOutside:f,onFocusOutside:c,onInteractOutside:g,onOpenAutoFocus:u,onCloseAutoFocus:x,...y,children:r});return l===null?d:jsx(o.Portal,{container:l,children:d})});A.displayName="PopoverContent";var b=i.forwardRef(({className:r,width:e=10,height:t=5,...a$1},n)=>jsx(o.Arrow,{ref:n,className:a("lg-popover__arrow",r),width:e,height:t,...a$1}));b.displayName="PopoverArrow";var T=i.forwardRef(({children:r,asChild:e=true,...t},a)=>jsx(o.Close,{ref:a,asChild:e,...t,children:r}));T.displayName="PopoverClose";export{R as a,w as b,C as c,A as d,b as e,T as f};
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkFTEVUZKX_js=require('./chunk-FTEVUZKX.js'),chunkDCDWEVW4_js=require('./chunk-DCDWEVW4.js'),ke=require('react'),Pe=require('@rc-component/tree'),lingeeIcon=require('lingee-icon'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ke__default=/*#__PURE__*/_interopDefault(ke);var Pe__default=/*#__PURE__*/_interopDefault(Pe);var A=ke__default.default.forwardRef(({className:e,size:r="md",spinning:o=true,children:n,tip:a,...c},p)=>{let s=chunkFTEVUZKX_js.j("Spin"),i=n!=null,g=jsxRuntime.jsx("div",{className:"lg-spin__indicator"});return i?jsxRuntime.jsxs("div",{ref:p,className:chunkDCDWEVW4_js.a("lg-spin","lg-spin--nested",e),...c,children:[jsxRuntime.jsx("div",{className:chunkDCDWEVW4_js.a("lg-spin__content",o&&"lg-spin__content--loading"),children:n}),o&&jsxRuntime.jsxs("div",{className:"lg-spin__overlay",role:"status","aria-label":a||s.loading,children:[jsxRuntime.jsx("div",{className:chunkDCDWEVW4_js.a("lg-spin",`lg-spin--${r}`),children:g}),a&&jsxRuntime.jsx("span",{className:"lg-spin__tip",children:a})]})]}):jsxRuntime.jsx("div",{ref:p,className:chunkDCDWEVW4_js.a("lg-spin",`lg-spin--${r}`,!o&&"lg-spin--paused",e),role:"status","aria-label":a||s.loading,...c,children:g})});A.displayName="Spin";var Z="lg-empty-gradient",U=`url(#${Z})`,X=0,D=null;function Te(){if(X++>0||typeof document>"u")return;let e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.overflow="hidden",e.innerHTML=`<defs><linearGradient id="${Z}" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse"><stop style="stop-color: var(--__lg-empty-gradient-from)"/><stop offset="1" style="stop-color: var(--__lg-empty-gradient-to)"/></linearGradient></defs>`,document.body.appendChild(e),D=e;}function Ce(){--X>0||D&&(D.remove(),D=null);}var M={lg:56,md:24,sm:16};function De(e){return typeof e=="function"||typeof e=="object"&&e!==null&&"render"in e&&typeof e.render=="function"}var w=ke__default.default.forwardRef(({size:e="md",icon:r,description:o,className:n,style:a,...c},p)=>{ke.useEffect(()=>(Te(),Ce),[]);let s=M[e],i;return r?De(r)?i=jsxRuntime.jsx(r,{size:s,fill:U}):i=r:i=jsxRuntime.jsx(lingeeIcon.DocumentLibrary,{size:s,fill:U}),jsxRuntime.jsxs("div",{ref:p,className:chunkDCDWEVW4_js.a("lg-empty",`lg-empty--${e}`,n),style:a,...c,children:[jsxRuntime.jsx("span",{className:"lg-empty__icon",children:i}),jsxRuntime.jsx("span",{className:"lg-empty__text",children:o})]})});w.displayName="Empty";function Ae(e,r){switch(e){case "loading":return jsxRuntime.jsx(lingeeIcon.LoaderCircle,{size:r,spin:true});case "error":return jsxRuntime.jsx(lingeeIcon.ExclamationCircle,{size:r});default:return jsxRuntime.jsx(lingeeIcon.Inbox,{size:r})}}var K=ke__default.default.forwardRef(({status:e,description:r,icon:o,size:n="sm",variant:a="block",spacing:c="normal",onRetry:p,className:s,style:i,...g},_)=>{let R=chunkFTEVUZKX_js.j("Empty"),I=o===null?null:o??Ae(e,M[n]),y=e==="error"&&typeof p=="function",E=chunkDCDWEVW4_js.a("lg-empty-card",`lg-empty-card--${n}`,`lg-empty-card--${a}`,`lg-empty-card--${e}`,`lg-empty-card--spacing-${c}`,y&&"lg-empty-card--retryable",s),N=y?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r,jsxRuntime.jsx("span",{className:"lg-empty-card__retry",children:R.retry})]}):r,b=jsxRuntime.jsx(w,{size:n,icon:I??jsxRuntime.jsx(jsxRuntime.Fragment,{}),description:N,className:"lg-empty-card__body"});return y?jsxRuntime.jsx("button",{ref:_,type:"button",className:E,style:i,onClick:p,...g,children:b}):jsxRuntime.jsx("div",{ref:_,className:E,style:i,role:e==="empty"?void 0:"status","aria-live":e==="empty"?void 0:"polite",...g,children:b})});K.displayName="Empty.Card";var J=Object.assign(w,{Card:K});var Ge={sm:30,md:34,lg:38},P=()=>({height:0,opacity:0}),W=e=>{let r=Array.from(e.children);return r.length===0?0:r.reduce((o,n)=>{let a=parseFloat(getComputedStyle(n).marginTop)||0;return o+n.getBoundingClientRect().height+a},0)},Q=e=>({height:W(e),opacity:1}),$e={motionName:"lg-tree-motion",motionDeadline:300,onAppearStart:P,onAppearActive:Q,onEnterStart:P,onEnterActive:Q,onLeaveStart:e=>({height:W(e),opacity:1}),onLeaveActive:P},je=ke__default.default.forwardRef((e,r)=>{let{treeData:o,fieldNames:n,size:a="md",expandedKeys:c,defaultExpandedKeys:p,defaultExpandAll:s,autoExpandParent:i,expandAction:g="click",onExpand:_,selectable:R=true,multiple:I=false,selectedKeys:y,defaultSelectedKeys:E,onSelect:N,checkable:b=false,checkStrictly:Y=false,checkedKeys:H,defaultCheckedKeys:ee,onCheck:G,showIcon:te=false,icon:x,switcherIcon:v,indentGuide:re="line",titleRender:oe,loadData:ne,loadedKeys:$,draggable:T=false,allowDrop:L,onDrop:j,height:ae,itemHeight:ie,virtual:le,disabled:B=false,loading:O=false,empty:de,onRightClick:ce,animated:pe=true,className:se,style:ge}=e,me=chunkFTEVUZKX_js.j("Tree"),ye=ke.useMemo(()=>{if(x)return typeof x!="function"?x:t=>x(t.data,{expanded:!!t.expanded,isLeaf:!!t.isLeaf})},[x]),fe=ke.useMemo(()=>v!==void 0?typeof v!="function"?v:t=>v({expanded:!!t.expanded,isLeaf:!!t.isLeaf}):t=>t.isLeaf?null:jsxRuntime.jsx(lingeeIcon.ChevronDown,{className:"lg-tree__switcher-icon",size:16,"aria-hidden":true}),[v]),he=ke.useMemo(()=>{if(T)return {icon:false,nodeDraggable:typeof T=="function"?t=>T(t):void 0}},[T]),ue=ke.useCallback((t,l)=>{_?.(t,{node:l.node,expanded:l.expanded});},[_]),_e=ke.useCallback((t,l)=>{N?.(t,{node:l.node,selected:l.selected,selectedNodes:l.selectedNodes});},[N]),be=ke.useCallback((t,l)=>{G?.(t,{node:l.node,checked:l.checked,checkedNodes:l.checkedNodes,halfCheckedKeys:l.halfCheckedKeys});},[G]),xe=ke.useCallback(t=>{j?.({dragNode:t.dragNode,node:t.node,dropPosition:t.dropPosition,dropToGap:t.dropToGap});},[j]),F=ke.useMemo(()=>{if(L)return t=>L({dragNode:t.dragNode,dropNode:t.dropNode,dropPosition:t.dropPosition})},[L]),ve=!o||o.length===0,f={};return c!==void 0&&(f.expandedKeys=c),y!==void 0&&(f.selectedKeys=y),H!==void 0&&(f.checkedKeys=H),$!==void 0&&(f.loadedKeys=$),F!==void 0&&(f.allowDrop=F),jsxRuntime.jsxs("div",{ref:r,className:chunkDCDWEVW4_js.a("lg-tree",`lg-tree--${a}`,`lg-tree--guide-${re}`,b&&"lg-tree--checkable",B&&"lg-tree--disabled",O&&"lg-tree--loading",se),style:ge,children:[O&&jsxRuntime.jsx("div",{className:"lg-tree__loading-mask",children:jsxRuntime.jsx(A,{size:"md"})}),ve?jsxRuntime.jsx("div",{className:"lg-tree__empty",children:de??jsxRuntime.jsx(J,{size:"sm",description:me.empty})}):jsxRuntime.jsx(Pe__default.default,{prefixCls:"lg-tree",treeData:o,fieldNames:n,defaultExpandedKeys:p,defaultExpandAll:s,autoExpandParent:i,expandAction:g,onExpand:ue,selectable:R,multiple:I,defaultSelectedKeys:E,onSelect:_e,checkable:b,checkStrictly:Y,defaultCheckedKeys:ee,onCheck:be,showIcon:te,icon:ye,switcherIcon:fe,titleRender:oe,loadData:ne,draggable:he,onDrop:xe,height:ae,itemHeight:ie??Ge[a],virtual:le,disabled:B,onRightClick:ce,motion:pe?$e:void 0,...f})]})});je.displayName="Tree";
2
- exports.a=K;exports.b=J;exports.c=A;exports.d=je;
@@ -1 +0,0 @@
1
- import {createContext,useContext}from'react';import*as e from'@radix-ui/react-tooltip';import {jsx}from'react/jsx-runtime';var a=200,d=150,r=createContext(false);function T(){return useContext(r)}function p({children:t}){return jsx(r.Provider,{value:true,children:jsx(e.Provider,{delayDuration:a,skipDelayDuration:d,children:t})})}p.displayName="TooltipProvider";export{a,T as b,p as c};