@donglegeyu/company-ui 1.2.34 → 1.2.37
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/cjs/shared-components/SvgIcon/icon-manifest.js +2 -0
- package/dist/cjs/shared-components/SvgIcon/icon-meta.json +14 -2
- package/dist/cjs/shared-components/SvgIcon/icons.js +70 -2
- package/dist/cjs/sidebar-config.js +1 -0
- package/dist/cjs/template-components/AdminLayoutTemplate/index.d.ts +105 -0
- package/dist/cjs/template-components/AdminLayoutTemplate/index.js +446 -0
- package/dist/cjs/template-components/AdminLayoutTemplate/index.scss +64 -0
- package/dist/cjs/template-components/CompanyMultiTabs/index.js +4 -4
- package/dist/cjs/template-components/CompanyMultiTabs/index.scss +1 -0
- package/dist/cjs/template-components/CompanySidebar/FirstSidebar.js +2 -2
- package/dist/cjs/template-components/CompanySidebar/MoreMenuDrawer.js +1 -1
- package/dist/cjs/template-components/CompanySidebar/index.js +10 -6
- package/dist/cjs/template-components/CompanySidebar/index.scss +10 -5
- package/dist/cjs/template-components/CompanySidebar/menuIconMap.d.ts +4 -0
- package/dist/cjs/template-components/CompanySidebar/menuIconMap.js +73 -0
- package/dist/cjs/template-components/SmartListTemplate/index.js +15 -8
- package/dist/cjs/template-components/index.d.ts +2 -0
- package/dist/cjs/template-components/index.js +3 -0
- package/dist/es/shared-components/SvgIcon/icon-manifest.js +8 -0
- package/dist/es/shared-components/SvgIcon/icon-meta.json +14 -2
- package/dist/es/shared-components/SvgIcon/icons.js +56 -2
- package/dist/es/sidebar-config.js +3 -0
- package/dist/es/template-components/AdminLayoutTemplate/index.d.ts +105 -0
- package/dist/es/template-components/AdminLayoutTemplate/index.js +526 -0
- package/dist/es/template-components/AdminLayoutTemplate/index.scss +64 -0
- package/dist/es/template-components/CompanyMultiTabs/index.js +4 -4
- package/dist/es/template-components/CompanyMultiTabs/index.scss +1 -0
- package/dist/es/template-components/CompanySidebar/FirstSidebar.js +2 -2
- package/dist/es/template-components/CompanySidebar/MoreMenuDrawer.js +1 -1
- package/dist/es/template-components/CompanySidebar/index.js +16 -6
- package/dist/es/template-components/CompanySidebar/index.scss +10 -5
- package/dist/es/template-components/CompanySidebar/menuIconMap.d.ts +4 -0
- package/dist/es/template-components/CompanySidebar/menuIconMap.js +106 -0
- package/dist/es/template-components/SmartListTemplate/index.js +28 -14
- package/dist/es/template-components/index.d.ts +2 -0
- package/dist/es/template-components/index.js +2 -1
- package/package.json +4 -1
|
@@ -44,6 +44,7 @@ var ICON_MANIFEST = [
|
|
|
44
44
|
{ name: "writing-fluently", label: "书写", category: "action" },
|
|
45
45
|
{ name: "more-one", label: "更多", category: "action" },
|
|
46
46
|
{ name: "more", label: "更多两点", category: "action" },
|
|
47
|
+
{ name: "more-three", label: "更多三点", category: "action" },
|
|
47
48
|
{ name: "check-one", label: "勾选", category: "action" },
|
|
48
49
|
{ name: "close", label: "关闭", category: "action" },
|
|
49
50
|
{ name: "add-one", label: "新增", category: "action" },
|
|
@@ -112,6 +113,7 @@ var ICON_MANIFEST = [
|
|
|
112
113
|
{ name: "table", label: "表格", category: "business" },
|
|
113
114
|
{ name: "box", label: "包裹", category: "business" },
|
|
114
115
|
{ name: "database-config", label: "数据配置", category: "business" },
|
|
116
|
+
{ name: "wallet", label: "钱包", category: "business" },
|
|
115
117
|
{ name: "scan-setting", label: "扫码设置", category: "business" },
|
|
116
118
|
{ name: "category-management", label: "分类管理", category: "business" },
|
|
117
119
|
{ name: "user-positioning", label: "用户定位", category: "business" },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-
|
|
3
|
-
"count":
|
|
2
|
+
"generatedAt": "2026-08-14T06:30:01.297Z",
|
|
3
|
+
"count": 61,
|
|
4
4
|
"categories": [
|
|
5
5
|
{
|
|
6
6
|
"key": "arrow",
|
|
@@ -84,6 +84,12 @@
|
|
|
84
84
|
"category": "action",
|
|
85
85
|
"viewBox": "0 0 48 48"
|
|
86
86
|
},
|
|
87
|
+
{
|
|
88
|
+
"name": "more-three",
|
|
89
|
+
"label": "更多三点",
|
|
90
|
+
"category": "action",
|
|
91
|
+
"viewBox": "0 0 48 48"
|
|
92
|
+
},
|
|
87
93
|
{
|
|
88
94
|
"name": "check-one",
|
|
89
95
|
"label": "勾选",
|
|
@@ -348,6 +354,12 @@
|
|
|
348
354
|
"category": "business",
|
|
349
355
|
"viewBox": "0 0 48 48"
|
|
350
356
|
},
|
|
357
|
+
{
|
|
358
|
+
"name": "wallet",
|
|
359
|
+
"label": "钱包",
|
|
360
|
+
"category": "business",
|
|
361
|
+
"viewBox": "0 0 48 48"
|
|
362
|
+
},
|
|
351
363
|
{
|
|
352
364
|
"name": "scan-setting",
|
|
353
365
|
"label": "扫码设置",
|
|
@@ -247,6 +247,33 @@ var iconPaths = {
|
|
|
247
247
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "36", cy: "24", r: "3", fill: "currentColor" })
|
|
248
248
|
] })
|
|
249
249
|
},
|
|
250
|
+
"more-three": {
|
|
251
|
+
name: "more-three",
|
|
252
|
+
viewBox: "0 0 48 48",
|
|
253
|
+
label: "更多三点",
|
|
254
|
+
category: "action",
|
|
255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
257
|
+
"path",
|
|
258
|
+
{
|
|
259
|
+
d: "M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",
|
|
260
|
+
fill: "none",
|
|
261
|
+
stroke: "currentColor",
|
|
262
|
+
strokeWidth: "4",
|
|
263
|
+
strokeLinejoin: "round"
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
267
|
+
"path",
|
|
268
|
+
{
|
|
269
|
+
fillRule: "evenodd",
|
|
270
|
+
clipRule: "evenodd",
|
|
271
|
+
d: "M21.5 14C21.5 15.3807 22.6193 16.5 24 16.5C25.3807 16.5 26.5 15.3807 26.5 14C26.5 12.6193 25.3807 11.5 24 11.5C22.6193 11.5 21.5 12.6193 21.5 14ZM21.5 24C21.5 25.3807 22.6193 26.5 24 26.5C25.3807 26.5 26.5 25.3807 26.5 24C26.5 22.6193 25.3807 21.5 24 21.5C22.6193 21.5 21.5 22.6193 21.5 24ZM24 36.5C22.6193 36.5 21.5 35.3807 21.5 34C21.5 32.6193 22.6193 31.5 24 31.5C25.3807 31.5 26.5 32.6193 26.5 34C26.5 35.3807 25.3807 36.5 24 36.5Z",
|
|
272
|
+
fill: "currentColor"
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
] })
|
|
276
|
+
},
|
|
250
277
|
"check-one": {
|
|
251
278
|
name: "check-one",
|
|
252
279
|
viewBox: "0 0 48 48",
|
|
@@ -792,7 +819,7 @@ var iconPaths = {
|
|
|
792
819
|
label: "图钉",
|
|
793
820
|
category: "system",
|
|
794
821
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
795
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { clipPath: "url(#icon-
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { clipPath: "url(#icon-be1174b4e0022c)", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
796
823
|
"path",
|
|
797
824
|
{
|
|
798
825
|
d: "M10.6963 17.5042C13.3347 14.8657 16.4701 14.9387 19.8781 16.8076L32.62 9.74509L31.8989 4.78683L43.2126 16.1005L38.2656 15.3907L31.1918 28.1214C32.9752 31.7589 33.1337 34.6647 30.4953 37.3032C30.4953 37.3032 26.235 33.0429 22.7171 29.525L6.44305 41.5564L18.4382 25.2461C14.9202 21.7281 10.6963 17.5042 10.6963 17.5042Z",
|
|
@@ -802,7 +829,7 @@ var iconPaths = {
|
|
|
802
829
|
strokeLinejoin: "round"
|
|
803
830
|
}
|
|
804
831
|
) }),
|
|
805
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("clipPath", { id: "icon-
|
|
832
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("clipPath", { id: "icon-be1174b4e0022c", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: "48", height: "48", fill: "currentColor" }) }) })
|
|
806
833
|
] })
|
|
807
834
|
},
|
|
808
835
|
pushpin: {
|
|
@@ -1976,6 +2003,47 @@ var iconPaths = {
|
|
|
1976
2003
|
)
|
|
1977
2004
|
] })
|
|
1978
2005
|
},
|
|
2006
|
+
wallet: {
|
|
2007
|
+
name: "wallet",
|
|
2008
|
+
viewBox: "0 0 48 48",
|
|
2009
|
+
label: "钱包",
|
|
2010
|
+
category: "business",
|
|
2011
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
2012
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2013
|
+
"path",
|
|
2014
|
+
{
|
|
2015
|
+
fillRule: "evenodd",
|
|
2016
|
+
clipRule: "evenodd",
|
|
2017
|
+
d: "M17.982 11.9689L31.7846 4L36.397 11.9889L17.982 11.9689Z",
|
|
2018
|
+
stroke: "currentColor",
|
|
2019
|
+
strokeWidth: "4",
|
|
2020
|
+
strokeLinecap: "round",
|
|
2021
|
+
strokeLinejoin: "round"
|
|
2022
|
+
}
|
|
2023
|
+
),
|
|
2024
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2025
|
+
"path",
|
|
2026
|
+
{
|
|
2027
|
+
d: "M4 14C4 12.8954 4.89543 12 6 12H42C43.1046 12 44 12.8954 44 14V42C44 43.1046 43.1046 44 42 44H6C4.89543 44 4 43.1046 4 42V14Z",
|
|
2028
|
+
fill: "none",
|
|
2029
|
+
stroke: "currentColor",
|
|
2030
|
+
strokeWidth: "4",
|
|
2031
|
+
strokeLinejoin: "round"
|
|
2032
|
+
}
|
|
2033
|
+
),
|
|
2034
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2035
|
+
"path",
|
|
2036
|
+
{
|
|
2037
|
+
d: "M35.25 33H44V23H35.25C32.3505 23 30 25.2386 30 28C30 30.7614 32.3505 33 35.25 33Z",
|
|
2038
|
+
fill: "none",
|
|
2039
|
+
stroke: "currentColor",
|
|
2040
|
+
strokeWidth: "4",
|
|
2041
|
+
strokeLinejoin: "round"
|
|
2042
|
+
}
|
|
2043
|
+
),
|
|
2044
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M44 16.5V40.5", stroke: "currentColor", strokeWidth: "4", strokeLinecap: "round" })
|
|
2045
|
+
] })
|
|
2046
|
+
},
|
|
1979
2047
|
"scan-setting": {
|
|
1980
2048
|
name: "scan-setting",
|
|
1981
2049
|
viewBox: "0 0 48 48",
|
|
@@ -136,6 +136,7 @@ var TEMPLATE_GROUPS = [
|
|
|
136
136
|
{
|
|
137
137
|
title: "页面级模板",
|
|
138
138
|
children: [
|
|
139
|
+
{ title: "布局模板 AdminLayoutTemplate", link: "/template-components/admin-layout-template" },
|
|
139
140
|
{ title: "统计列表页 StatisticsListPage", link: "/template-components/statistics-list-page" },
|
|
140
141
|
{ title: "智能列表模板 SmartListTemplate", link: "/template-components/smart-list-template" },
|
|
141
142
|
{ title: "表单页模板 FormPageTemplate", link: "/template-components/form-page-template" },
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import type { MultiTabHomeConfig, MultiTabItem } from "../CompanyMultiTabs";
|
|
3
|
+
import type { SidebarDomain, SidebarFavoriteItem, SidebarMenuItem, SidebarUserInfo } from "../CompanySidebar/types";
|
|
4
|
+
import "./index.scss";
|
|
5
|
+
/** 配置式页面项:key 与菜单/页签联动,点击菜单自动渲染对应 component */
|
|
6
|
+
export interface AdminLayoutPageItem {
|
|
7
|
+
/** 页面唯一标识,需与菜单项 key 一致 */
|
|
8
|
+
key: string;
|
|
9
|
+
/** 页签标题 */
|
|
10
|
+
label: string;
|
|
11
|
+
/** 路由路径(可选,仅透传到页签) */
|
|
12
|
+
path?: string;
|
|
13
|
+
/** 页面内容(推荐直接放业务模板组件) */
|
|
14
|
+
component?: ReactNode;
|
|
15
|
+
/** 页签是否可关闭,默认 true */
|
|
16
|
+
closable?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface AdminLayoutTemplateProps {
|
|
19
|
+
/** 根节点自定义 className */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** 根节点自定义 style(父容器无确定高度时可传 style={{ height: '100vh' }}) */
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
/** 顶部 Logo 图片地址(如 "/logo-dl.svg") */
|
|
24
|
+
logo?: string;
|
|
25
|
+
/** 品牌名称(无 Logo 时显示首字母) */
|
|
26
|
+
brandName?: string;
|
|
27
|
+
/** 当前用户信息(左下角用户卡,建议必传) */
|
|
28
|
+
userInfo?: SidebarUserInfo;
|
|
29
|
+
/** 退出登录回调 */
|
|
30
|
+
onLogout?: () => void;
|
|
31
|
+
/** 主题设置回调 */
|
|
32
|
+
onThemeSettings?: () => void;
|
|
33
|
+
/** 业务域列表(左侧导航顶部切换下拉) */
|
|
34
|
+
domains?: SidebarDomain[];
|
|
35
|
+
/** 当前业务域 id(受控;不传则组件内部管理) */
|
|
36
|
+
currentDomainId?: number | string | null;
|
|
37
|
+
/** 初始业务域 id(非受控默认值,默认取 domains 第一项) */
|
|
38
|
+
defaultDomainId?: number | string | null;
|
|
39
|
+
/** 切换业务域回调(业务侧通常在此重新拉取菜单) */
|
|
40
|
+
onDomainChange?: (domain: SidebarDomain) => void;
|
|
41
|
+
/** 业务菜单全集(树形,驱动「更多应用」抽屉 + 二级菜单) */
|
|
42
|
+
businessMenus: SidebarMenuItem[];
|
|
43
|
+
/** 一级图标菜单(默认:首页 + 收藏) */
|
|
44
|
+
firstMenus?: SidebarMenuItem[];
|
|
45
|
+
/** 一级栏底部固定菜单(默认:系统设置) */
|
|
46
|
+
systemBottomMenus?: SidebarMenuItem[];
|
|
47
|
+
/** 一级导航最多可见数量,超出进「更多应用」抽屉 */
|
|
48
|
+
visibleMenuCount?: number;
|
|
49
|
+
/** 二级菜单空状态图片地址 */
|
|
50
|
+
emptyImage?: string;
|
|
51
|
+
/** 自定义快捷导航(受控;不传则默认取 businessMenus 前 visibleMenuCount 项) */
|
|
52
|
+
customNavMenus?: SidebarMenuItem[];
|
|
53
|
+
/** 自定义导航变更回调(持久化用) */
|
|
54
|
+
onCustomNavUpdate?: (menus: SidebarMenuItem[]) => void;
|
|
55
|
+
/** 初始收藏列表 */
|
|
56
|
+
defaultFavorites?: SidebarFavoriteItem[];
|
|
57
|
+
/** 收藏变更回调(增删/排序后触发,持久化用) */
|
|
58
|
+
onFavoritesChange?: (favorites: SidebarFavoriteItem[]) => void;
|
|
59
|
+
/** 初始激活的一级业务模块 key(默认取 businessMenus 第一项) */
|
|
60
|
+
defaultActiveFirstMenu?: string;
|
|
61
|
+
/** 初始激活(高亮)的叶子菜单 key(默认取第一个叶子菜单) */
|
|
62
|
+
defaultActiveKey?: string;
|
|
63
|
+
/** 二级菜单是否默认钉住 */
|
|
64
|
+
defaultSecondSidebarFixed?: boolean;
|
|
65
|
+
/** 页签数据(受控;不传则组件内部管理,点菜单自动开页签) */
|
|
66
|
+
tabs?: MultiTabItem[];
|
|
67
|
+
/** 初始页签列表(非受控默认值) */
|
|
68
|
+
defaultTabs?: MultiTabItem[];
|
|
69
|
+
/** 当前激活页签 key(受控;不传则组件内部管理) */
|
|
70
|
+
activeTabKey?: string;
|
|
71
|
+
/** 初始激活页签 key(非受控默认值,默认取初始激活菜单) */
|
|
72
|
+
defaultActiveTabKey?: string;
|
|
73
|
+
/** 页签列表变更回调(开/关页签后触发) */
|
|
74
|
+
onTabsChange?: (tabs: MultiTabItem[]) => void;
|
|
75
|
+
/** 页签切换回调 */
|
|
76
|
+
onActiveTabChange?: (key: string, tab: MultiTabItem) => void;
|
|
77
|
+
/** 页签关闭回调 */
|
|
78
|
+
onTabClose?: (key: string, tab: MultiTabItem) => void;
|
|
79
|
+
/** 首页页签配置(如 { key: 'home', label: '首页' }) */
|
|
80
|
+
homeTab?: MultiTabHomeConfig;
|
|
81
|
+
/** 首页内容(homeTab 激活时渲染;缺省回落 children) */
|
|
82
|
+
homeContent?: ReactNode;
|
|
83
|
+
/** 页签栏右侧扩展区 */
|
|
84
|
+
tabExtra?: ReactNode;
|
|
85
|
+
/** 叶子菜单点击回调(开页签后触发,业务侧可在此做路由跳转) */
|
|
86
|
+
onMenuOpen?: (menu: SidebarMenuItem) => void;
|
|
87
|
+
/** 一级菜单切换回调 */
|
|
88
|
+
onActiveFirstMenuChange?: (key: string) => void;
|
|
89
|
+
/** 配置式页面(key 与菜单联动,点击菜单自动渲染对应 component) */
|
|
90
|
+
pages?: AdminLayoutPageItem[];
|
|
91
|
+
/** 内容兜底(pages 无匹配页签时渲染;children 模式直接放业务模板) */
|
|
92
|
+
children?: ReactNode;
|
|
93
|
+
/** 内容区自定义 className */
|
|
94
|
+
contentClassName?: string;
|
|
95
|
+
/** 内容区自定义 style(⚠️ 间距契约:禁止加 padding/margin/background) */
|
|
96
|
+
contentStyle?: CSSProperties;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 布局模板:把「CompanySidebar + CompanyMultiTabs + 内容区」整条骨架固化成一个组件。
|
|
100
|
+
*
|
|
101
|
+
* - 内部自管页签状态(点菜单自动开页签/激活,关页签自动切相邻页签)
|
|
102
|
+
* - 间距契约固化:内容区只做滚动容器(零间距),业务模板自带全部内边距与背景
|
|
103
|
+
* - 两种内容模式:pages 配置式(key 与菜单联动)或 children 兜底(直接放业务模板)
|
|
104
|
+
*/
|
|
105
|
+
export default function AdminLayoutTemplate({ className, style, logo, brandName, userInfo, onLogout, onThemeSettings, domains, currentDomainId, defaultDomainId, onDomainChange, businessMenus, firstMenus, systemBottomMenus, visibleMenuCount, emptyImage, customNavMenus, onCustomNavUpdate, defaultFavorites, onFavoritesChange, defaultActiveFirstMenu, defaultActiveKey, defaultSecondSidebarFixed, tabs, defaultTabs, activeTabKey, defaultActiveTabKey, onTabsChange, onActiveTabChange, onTabClose, homeTab, homeContent, tabExtra, onMenuOpen, onActiveFirstMenuChange, pages, children, contentClassName, contentStyle, }: AdminLayoutTemplateProps): import("react").JSX.Element;
|