@donglegeyu/company-ui 2.0.0 → 2.2.0
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/template-components/AdminLayoutTemplate/index.d.ts +5 -1
- package/dist/cjs/template-components/AdminLayoutTemplate/index.js +30 -1
- package/dist/cjs/template-components/CompanyMultiTabs/index.d.ts +14 -0
- package/dist/cjs/template-components/CompanyMultiTabs/index.js +100 -0
- package/dist/cjs/template-components/CompanyMultiTabs/index.scss +125 -0
- package/dist/cjs/template-components/CompanySidebar/MoreMenuDrawer.d.ts +1 -1
- package/dist/cjs/template-components/CompanySidebar/MoreMenuDrawer.js +158 -78
- package/dist/cjs/template-components/CompanySidebar/index.js +2 -3
- package/dist/cjs/template-components/CompanySidebar/index.scss +48 -0
- package/dist/cjs/template-components/DrawerDetailTemplate/index.d.ts +20 -7
- package/dist/cjs/template-components/DrawerDetailTemplate/index.js +28 -20
- package/dist/cjs/template-components/DrawerDetailTemplate/index.scss +50 -0
- package/dist/cjs/template-components/index.d.ts +2 -2
- package/dist/es/template-components/AdminLayoutTemplate/index.d.ts +5 -1
- package/dist/es/template-components/AdminLayoutTemplate/index.js +45 -7
- package/dist/es/template-components/CompanyMultiTabs/index.d.ts +14 -0
- package/dist/es/template-components/CompanyMultiTabs/index.js +134 -3
- package/dist/es/template-components/CompanyMultiTabs/index.scss +125 -0
- package/dist/es/template-components/CompanySidebar/MoreMenuDrawer.d.ts +1 -1
- package/dist/es/template-components/CompanySidebar/MoreMenuDrawer.js +237 -105
- package/dist/es/template-components/CompanySidebar/index.js +3 -3
- package/dist/es/template-components/CompanySidebar/index.scss +48 -0
- package/dist/es/template-components/DrawerDetailTemplate/index.d.ts +20 -7
- package/dist/es/template-components/DrawerDetailTemplate/index.js +48 -25
- package/dist/es/template-components/DrawerDetailTemplate/index.scss +50 -0
- package/dist/es/template-components/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["open", "onClose", "title", "width", "maskClosable", "headerContent", "description", "tabs", "activeTabKey", "defaultActiveTabKey", "onTabChange", "children", "footer", "classNames", "styles"];
|
|
2
|
+
var _excluded = ["open", "onClose", "title", "name", "tags", "titleActions", "fields", "width", "maskClosable", "headerContent", "description", "tabs", "activeTabKey", "defaultActiveTabKey", "onTabChange", "children", "footer", "classNames", "styles"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -14,14 +14,20 @@ import { companyTheme } from "../../theme";
|
|
|
14
14
|
import "./index.scss";
|
|
15
15
|
|
|
16
16
|
/** 详情抽屉内容区的 Tab 项 */
|
|
17
|
+
|
|
18
|
+
/** 顶部核心区的关键字段行(label + value 纯文字行,对齐设计稿) */
|
|
17
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
21
|
var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
|
|
20
22
|
var open = _ref.open,
|
|
21
23
|
onClose = _ref.onClose,
|
|
22
24
|
title = _ref.title,
|
|
25
|
+
name = _ref.name,
|
|
26
|
+
tags = _ref.tags,
|
|
27
|
+
titleActions = _ref.titleActions,
|
|
28
|
+
fields = _ref.fields,
|
|
23
29
|
_ref$width = _ref.width,
|
|
24
|
-
width = _ref$width === void 0 ?
|
|
30
|
+
width = _ref$width === void 0 ? 440 : _ref$width,
|
|
25
31
|
_ref$maskClosable = _ref.maskClosable,
|
|
26
32
|
maskClosable = _ref$maskClosable === void 0 ? true : _ref$maskClosable,
|
|
27
33
|
headerContent = _ref.headerContent,
|
|
@@ -40,7 +46,8 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
|
|
|
40
46
|
var isPresent = function isPresent(value) {
|
|
41
47
|
return value !== undefined && value !== null;
|
|
42
48
|
};
|
|
43
|
-
var
|
|
49
|
+
var hasStructuredHeader = isPresent(name) || isPresent(tags) || isPresent(titleActions) || fields && fields.length > 0;
|
|
50
|
+
var hasHeader = hasStructuredHeader || isPresent(headerContent) || isPresent(description);
|
|
44
51
|
|
|
45
52
|
// classNames 支持对象/函数两种形式:统一走函数形式,确保 body 固定类不被覆盖
|
|
46
53
|
var mergedClassNames = function mergedClassNames(info) {
|
|
@@ -52,18 +59,44 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
|
|
|
52
59
|
var bodyNode = /*#__PURE__*/_jsxs("div", {
|
|
53
60
|
className: "drawer-detail-template",
|
|
54
61
|
ref: ref,
|
|
55
|
-
children: [hasHeader ? /*#__PURE__*/
|
|
62
|
+
children: [hasHeader ? /*#__PURE__*/_jsx("div", {
|
|
56
63
|
className: "drawer-detail-template__header",
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
children: [headerContent, isPresent(description) ? /*#__PURE__*/_jsx("div", {
|
|
61
|
-
className: "drawer-detail-template__description",
|
|
64
|
+
children: headerContent !== null && headerContent !== void 0 ? headerContent : /*#__PURE__*/_jsxs("div", {
|
|
65
|
+
className: "drawer-detail-template__header-inner",
|
|
62
66
|
style: {
|
|
63
|
-
|
|
67
|
+
padding: "".concat(token.paddingMD, "px ").concat(token.paddingLG, "px")
|
|
64
68
|
},
|
|
65
|
-
children:
|
|
66
|
-
|
|
69
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
70
|
+
className: "drawer-detail-template__name-row",
|
|
71
|
+
children: [isPresent(name) ? /*#__PURE__*/_jsx("span", {
|
|
72
|
+
className: "drawer-detail-template__name",
|
|
73
|
+
children: name
|
|
74
|
+
}) : null, tags, /*#__PURE__*/_jsx("span", {
|
|
75
|
+
className: "drawer-detail-template__name-spacer"
|
|
76
|
+
}), isPresent(titleActions) ? /*#__PURE__*/_jsx("div", {
|
|
77
|
+
className: "drawer-detail-template__title-actions",
|
|
78
|
+
children: titleActions
|
|
79
|
+
}) : null]
|
|
80
|
+
}), fields && fields.length > 0 ? /*#__PURE__*/_jsx("div", {
|
|
81
|
+
className: "drawer-detail-template__fields",
|
|
82
|
+
children: fields.map(function (field, index) {
|
|
83
|
+
var _field$value;
|
|
84
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
85
|
+
className: "drawer-detail-template__field",
|
|
86
|
+
children: [/*#__PURE__*/_jsxs("span", {
|
|
87
|
+
className: "drawer-detail-template__field-label",
|
|
88
|
+
children: [field.label, "\uFF1A"]
|
|
89
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
90
|
+
className: "drawer-detail-template__field-value",
|
|
91
|
+
children: (_field$value = field.value) !== null && _field$value !== void 0 ? _field$value : "--"
|
|
92
|
+
})]
|
|
93
|
+
}, index);
|
|
94
|
+
})
|
|
95
|
+
}) : null, isPresent(description) ? /*#__PURE__*/_jsx("div", {
|
|
96
|
+
className: "drawer-detail-template__description",
|
|
97
|
+
children: description
|
|
98
|
+
}) : null]
|
|
99
|
+
})
|
|
67
100
|
}) : null, /*#__PURE__*/_jsx("div", {
|
|
68
101
|
className: "drawer-detail-template__content",
|
|
69
102
|
children: tabs && tabs.length > 0 ? /*#__PURE__*/_jsx(CompanyTabs, {
|
|
@@ -75,20 +108,10 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
|
|
|
75
108
|
return {
|
|
76
109
|
key: tab.key,
|
|
77
110
|
label: tab.label,
|
|
78
|
-
children:
|
|
79
|
-
style: {
|
|
80
|
-
padding: token.paddingLG
|
|
81
|
-
},
|
|
82
|
-
children: tab.content
|
|
83
|
-
})
|
|
111
|
+
children: tab.content
|
|
84
112
|
};
|
|
85
113
|
})
|
|
86
|
-
}) :
|
|
87
|
-
style: {
|
|
88
|
-
padding: token.paddingLG
|
|
89
|
-
},
|
|
90
|
-
children: children
|
|
91
|
-
})
|
|
114
|
+
}) : children
|
|
92
115
|
})]
|
|
93
116
|
});
|
|
94
117
|
return /*#__PURE__*/_jsx(ConfigProvider, {
|
|
@@ -96,7 +119,7 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
|
|
|
96
119
|
children: /*#__PURE__*/_jsx(CompanyDrawer, _objectSpread(_objectSpread({
|
|
97
120
|
open: open,
|
|
98
121
|
title: title,
|
|
99
|
-
|
|
122
|
+
size: width,
|
|
100
123
|
onClose: onClose,
|
|
101
124
|
maskClosable: maskClosable,
|
|
102
125
|
footer: footer !== null && footer !== void 0 ? footer : null,
|
|
@@ -19,7 +19,57 @@
|
|
|
19
19
|
background: var(--color-bg-container);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
// 大标题行:24px/600 大标题 + 状态 Tag + 弹性占位 + 操作按钮
|
|
23
|
+
&__name-row {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 8px;
|
|
27
|
+
margin-bottom: 12px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__name {
|
|
31
|
+
font-size: 24px;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
line-height: 32px;
|
|
34
|
+
color: rgba(0, 0, 0, 0.88);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__name-spacer {
|
|
38
|
+
flex: 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&__title-actions {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
gap: 8px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 关键字段行:label 45% 灰 + value 88% 黑,行间 gap 4px(对齐设计稿)
|
|
48
|
+
&__fields {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 4px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__field {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: baseline;
|
|
57
|
+
line-height: 22px;
|
|
58
|
+
font-size: 14px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&__field-label {
|
|
62
|
+
color: rgba(0, 0, 0, 0.45);
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&__field-value {
|
|
67
|
+
color: rgba(0, 0, 0, 0.88);
|
|
68
|
+
word-break: break-all;
|
|
69
|
+
}
|
|
70
|
+
|
|
22
71
|
&__description {
|
|
72
|
+
margin-top: 12px;
|
|
23
73
|
color: var(--color-text-tertiary);
|
|
24
74
|
}
|
|
25
75
|
|
|
@@ -7,14 +7,14 @@ export { default as FormPageTemplate } from "./FormPageTemplate";
|
|
|
7
7
|
export { default as DrawerFormTemplate } from "./DrawerFormTemplate";
|
|
8
8
|
export type { DrawerFormTemplateProps } from "./DrawerFormTemplate";
|
|
9
9
|
export { default as DrawerDetailTemplate } from "./DrawerDetailTemplate";
|
|
10
|
-
export type { DrawerDetailTemplateProps, DrawerDetailTab } from "./DrawerDetailTemplate";
|
|
10
|
+
export type { DrawerDetailTemplateProps, DrawerDetailTab, DrawerDetailField, } from "./DrawerDetailTemplate";
|
|
11
11
|
export { default as DetailPageTemplate } from "./DetailPageTemplate";
|
|
12
12
|
export type { DetailFieldItem, DetailTagItem, DetailTabItem } from "./DetailPageTemplate";
|
|
13
13
|
export { default as IconSelect } from "./IconSelect";
|
|
14
14
|
export { default as CompanySidebar } from "./CompanySidebar";
|
|
15
15
|
export type { SidebarMenuItem, SidebarDomain, SidebarUserInfo, SidebarFavoriteItem, SidebarTabItem, } from "./CompanySidebar/types";
|
|
16
16
|
export { CompanyMultiTabs } from "./CompanyMultiTabs";
|
|
17
|
-
export type { MultiTabItem, MultiTabHomeConfig, CompanyMultiTabsProps } from "./CompanyMultiTabs";
|
|
17
|
+
export type { MultiTabItem, MultiTabHomeConfig, MultiTabSearchOption, CompanyMultiTabsProps, } from "./CompanyMultiTabs";
|
|
18
18
|
export { default as AdminLayoutTemplate } from "./AdminLayoutTemplate";
|
|
19
19
|
export type { AdminLayoutTemplateProps, AdminLayoutPageItem } from "./AdminLayoutTemplate";
|
|
20
20
|
export { default as AiAssistantDock } from "./AiAssistantDock";
|