@donglegeyu/company-ui 1.2.28 → 1.2.30

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.
@@ -1,119 +1,27 @@
1
1
  /* 企业主题色 - 活力橙 #F95914 */
2
+ /* 注:顶部导航 / 菜单 / 侧边栏 / 下划线等样式已统一收口到 .dumirc.ts 的 styles 字段,
3
+ 本文件仅保留 CSS 变量定义与不涉及导航结构的局部样式,避免选择器权重打架。 */
2
4
  :root {
3
- --dumi-primary: #F95914;
4
- --ant-primary-color: #F95914;
5
- --ant-primary-color-hover: #E04E0E;
6
- --ant-primary-color-active: #C9450D;
5
+ --dumi-primary: #f95914;
6
+ --ant-primary-color: #f95914;
7
+ --ant-primary-color-hover: #e04e0e;
8
+ --ant-primary-color-active: #c9450d;
7
9
  --ant-primary-color-outline: rgba(249, 89, 20, 0.2);
8
- --primary-color: #F95914;
9
- --dumi-link-color: #F95914;
10
- --dumi-link-color-hover: #E04E0E;
11
- --ant-color-primary: #F95914;
12
- --ant-color-primary-hover: #E04E0E;
13
- --ant-color-primary-active: #C9450D;
10
+ --primary-color: #f95914;
11
+ --dumi-link-color: #f95914;
12
+ --dumi-link-color-hover: #e04e0e;
13
+ --ant-color-primary: #f95914;
14
+ --ant-color-primary-hover: #e04e0e;
15
+ --ant-color-primary-active: #c9450d;
14
16
  --ant-color-primary-bg: rgba(249, 89, 20, 0.1);
15
17
  --ant-color-primary-bg-hover: rgba(249, 89, 20, 0.15);
16
- --ant-color-primary-border: #F95914;
17
- --ant-color-primary-text: #F95914;
18
- }
19
-
20
- /* 顶部导航 - 未选中状态使用默认颜色 */
21
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item {
22
- color: rgba(0, 0, 0, 0.65);
23
- }
24
-
25
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item a {
26
- color: rgba(0, 0, 0, 0.65);
27
- }
28
-
29
- /* 顶部导航 - 选中状态为橙色 */
30
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item-selected {
31
- color: #F95914;
32
- border-bottom-color: #F95914;
33
- }
34
-
35
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item-selected a {
36
- color: #F95914;
37
- }
38
-
39
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item-selected::after {
40
- border-bottom: 2px solid #F95914;
41
- }
42
-
43
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item:hover {
44
- border-bottom-color: #F95914;
45
- color: rgba(0, 0, 0, 0.85);
46
- }
47
-
48
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item:hover::after {
49
- border-bottom: 2px solid #F95914;
50
- }
51
-
52
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item > a:hover {
53
- color: rgba(0, 0, 0, 0.85);
54
- }
55
-
56
- /* 默认不显示下划线 */
57
- .dumi-default-header .ant-menu-horizontal .ant-menu-item::after {
58
- border-bottom: none;
59
- border-bottom-color: transparent;
60
- }
61
-
62
- /* 只有选中和悬停时显示橙色下划线 */
63
- .dumi-default-header .ant-menu-horizontal .ant-menu-item-active::after,
64
- .dumi-default-header .ant-menu-horizontal .ant-menu-item:hover::after,
65
- .dumi-default-header .ant-menu-horizontal .ant-menu-item-selected::after {
66
- border-bottom: 2px solid #F95914;
67
- }
68
-
69
- /* 侧边栏宽度 */
70
- .dumi-default-sidebar {
71
- width: 270px !important;
72
- }
73
-
74
- /* 侧边栏导航 - 选中状态为橙色背景和文字 */
75
- .dumi-default-sidebar .ant-menu-inline .ant-menu-item-selected,
76
- .dumi-default-sidebar .ant-menu-vertical .ant-menu-item-selected {
77
- background-color: #FFF1E6;
78
- }
79
-
80
- .dumi-default-sidebar .ant-menu-item-selected,
81
- .dumi-default-sidebar .ant-menu-item-selected a {
82
- color: #F95914;
83
- }
84
-
85
- .dumi-default-sidebar .ant-menu-inline .ant-menu-item:active,
86
- .dumi-default-sidebar .ant-menu-vertical .ant-menu-item:active,
87
- .dumi-default-sidebar .ant-menu-inline .ant-menu-item:hover,
88
- .dumi-default-sidebar .ant-menu-vertical .ant-menu-item:hover {
89
- background-color: #FFF1E6;
90
- }
91
-
92
- /* 右侧锚点导航 - 选中状态为橙色 */
93
- .dumi-default-doc-layout .ant-anchor-link-title-active {
94
- color: #F95914;
95
- }
96
-
97
- .dumi-default-doc-layout .ant-anchor-link-active > .ant-anchor-link-title {
98
- color: #F95914;
99
- }
100
-
101
- .dumi-default-doc-layout .ant-anchor-ink-ball {
102
- border-color: #F95914;
103
- background-color: #F95914;
104
- }
105
-
106
- .dumi-default-doc-layout .ant-anchor-ink {
107
- background-color: #F95914;
108
- }
109
-
110
- .dumi-default-doc-layout .ant-anchor-wrapper {
111
- --ant-primary-color: #F95914;
18
+ --ant-color-primary-border: #f95914;
19
+ --ant-color-primary-text: #f95914;
112
20
  }
113
21
 
114
22
  /* dumi logo */
115
23
  .dumi-default-logo {
116
- color: #F95914;
24
+ color: #f95914;
117
25
  display: flex;
118
26
  align-items: center;
119
27
  gap: 8px;
@@ -132,8 +40,8 @@
132
40
  /* 隐藏顶部导航栏中的站点名称(Company UI)- 针对不同结构 */
133
41
  .dumi-default-header .lobe-flex > span,
134
42
  .dumi-default-header .ant-space-item span,
135
- .lobe-nav-header-title,
136
- .lobe-nav-brand-name {
43
+ .lob-nav-header-title,
44
+ .lob-nav-brand-name {
137
45
  display: none;
138
46
  }
139
47
 
@@ -145,10 +53,10 @@
145
53
  /* 页面底部导航链接 - 只修改这里的链接颜色 */
146
54
  .dumi-default-content nav a,
147
55
  .page-footer-nav a {
148
- color: #F95914;
56
+ color: #f95914;
149
57
  }
150
58
 
151
59
  .dumi-default-content nav a:hover,
152
60
  .page-footer-nav a:hover {
153
- color: #E04E0E;
61
+ color: #e04e0e;
154
62
  }
@@ -1,106 +1,17 @@
1
- // src/dumi-global.js
2
- var style = document.createElement("style");
3
- style.textContent = `
4
- :root {
5
- --dumi-primary: #F95914;
6
- --dumi-link-color: #F95914;
7
- --dumi-link-color-hover: #E04E0E;
8
- }
9
-
10
- a {
11
- color: rgba(0, 0, 0, 0.65);
12
- }
13
-
14
- .ant-menu-horizontal > .ant-menu-item {
15
- color: rgba(0, 0, 0, 0.65);
16
- }
17
-
18
- .ant-menu-horizontal > .ant-menu-item-selected,
19
- .ant-menu-horizontal > .ant-menu-item-selected a {
20
- color: #F95914;
21
- border-bottom-color: #F95914;
22
- }
23
-
24
- .ant-menu-horizontal > .ant-menu-item-selected::after {
25
- border-bottom: 2px solid #F95914;
26
- }
27
-
28
- .ant-menu-horizontal > .ant-menu-item:hover {
29
- border-bottom-color: #F95914;
30
- color: #F95914;
31
- }
32
-
33
- .ant-menu-horizontal > .ant-menu-item:hover a {
34
- color: #F95914;
35
- }
36
-
37
- .dumi-default-navbar > li > a:hover {
38
- color: #F95914;
39
- }
40
-
41
- [data-prefers-color=dark] .dumi-default-navbar > li > a:hover {
42
- color: #F95914;
43
- }
44
-
45
- .ant-menu-horizontal .ant-menu-item::after {
46
- border-bottom: none;
47
- border-bottom-color: transparent;
48
- }
49
-
50
- .dumi-default-sidebar {
51
- width: 270px;
52
- }
53
-
54
- .ant-menu-inline .ant-menu-item a {
55
- color: rgba(0, 0, 0, 0.65);
56
- }
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
57
14
 
58
- .ant-menu-inline .ant-menu-item-selected a {
59
- color: #F95914;
60
- background-color: #FFF1E6;
61
- }
62
-
63
- .ant-menu-inline .ant-menu-item:hover a {
64
- color: rgba(0, 0, 0, 0.85);
65
- }
66
-
67
- .ant-menu-inline .ant-menu-item:hover {
68
- background-color: #FFF1E6;
69
- }
70
-
71
- .ant-anchor-link-title {
72
- color: rgba(0, 0, 0, 0.65);
73
- }
74
-
75
- .ant-anchor-link-title:hover {
76
- color: rgba(0, 0, 0, 0.85);
77
- }
78
-
79
- .ant-anchor-link-title-active {
80
- color: #F95914;
81
- }
82
-
83
- .ant-anchor-link-active > .ant-anchor-link-title {
84
- color: #F95914;
85
- }
86
-
87
- .ant-anchor-ink-ball {
88
- border-color: #F95914;
89
- background-color: #F95914;
90
- }
91
-
92
- .ant-anchor-ink {
93
- background-color: #F95914;
94
- }
95
-
96
- .dumi-default-content a,
97
- .page-footer-nav a {
98
- color: #F95914;
99
- }
100
-
101
- .dumi-default-content a:hover,
102
- .page-footer-nav a:hover {
103
- color: #E04E0E;
104
- }
105
- `;
106
- document.head.appendChild(style);
15
+ // src/dumi-global.js
16
+ var dumi_global_exports = {};
17
+ module.exports = __toCommonJS(dumi_global_exports);
@@ -1,5 +1,5 @@
1
- import { type ReactNode } from 'react';
2
- import './index.scss';
1
+ import { type ReactNode } from "react";
2
+ import "./index.scss";
3
3
  interface FormPageTemplateProps {
4
4
  title: string;
5
5
  showBack?: boolean;
@@ -8,14 +8,24 @@ interface FormPageTemplateProps {
8
8
  submitText?: string;
9
9
  cancelText?: string;
10
10
  showFooter?: boolean;
11
- footerPosition?: 'fixed' | 'static';
11
+ footerPosition?: "fixed" | "static";
12
12
  onSubmit?: () => void;
13
13
  onCancel?: () => void;
14
14
  /** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
15
15
  titleExtra?: ReactNode;
16
16
  /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组) */
17
17
  titleActions?: ReactNode;
18
+ /** 内容区顶部插槽:渲染在 children 之上,跟随内容滚动(如 Steps、提示信息) */
19
+ topContent?: ReactNode;
20
+ /** 自定义底部:传了则覆盖默认的 FormFooterActions */
21
+ footer?: ReactNode;
22
+ /** 内容区是否包裹 CompanyCard,默认 true(多列表单场景);自定义内容时可设为 false */
23
+ contentWrapped?: boolean;
24
+ /** 内容区自定义 className */
25
+ contentClassName?: string;
26
+ /** 内容区自定义 style(如 contentStyle={{ padding: 0 }} 去掉默认边距) */
27
+ contentStyle?: React.CSSProperties;
18
28
  children?: ReactNode;
19
29
  }
20
- export default function FormPageTemplate({ title, showBack, onBack, submitLoading, submitText, cancelText, showFooter, footerPosition, onSubmit, onCancel, titleExtra, titleActions, children, }: FormPageTemplateProps): import("react").JSX.Element;
30
+ export default function FormPageTemplate({ title, showBack, onBack, submitLoading, submitText, cancelText, showFooter, footerPosition, onSubmit, onCancel, titleExtra, titleActions, topContent, footer, contentWrapped, contentClassName, contentStyle, children, }: FormPageTemplateProps): import("react").JSX.Element;
21
31
  export {};
@@ -51,6 +51,11 @@ function FormPageTemplate({
51
51
  onCancel,
52
52
  titleExtra,
53
53
  titleActions,
54
+ topContent,
55
+ footer,
56
+ contentWrapped = true,
57
+ contentClassName,
58
+ contentStyle,
54
59
  children
55
60
  }) {
56
61
  const [isScrolling, setIsScrolling] = (0, import_react.useState)(false);
@@ -87,11 +92,13 @@ function FormPageTemplate({
87
92
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
88
93
  "div",
89
94
  {
90
- className: `form-page-content${isScrolling ? " scrolling" : ""}`,
95
+ className: `form-page-content${isScrolling ? " scrolling" : ""}${contentClassName ? ` ${contentClassName}` : ""}`,
96
+ style: contentStyle,
91
97
  onScroll: handleScroll,
92
98
  children: [
93
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyCard, { className: "form-page-card", children }),
94
- showFooter && footerPosition === "static" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-page-footer static", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
99
+ topContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-page-top-content", children: topContent }),
100
+ contentWrapped ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyCard, { className: "form-page-card", children }) : children,
101
+ showFooter && footerPosition === "static" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-page-footer static", children: footer ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
102
  import_FormFooterActions.default,
96
103
  {
97
104
  submitLoading,
@@ -104,7 +111,7 @@ function FormPageTemplate({
104
111
  ]
105
112
  }
106
113
  ),
107
- showFooter && footerPosition === "fixed" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-page-footer fixed", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
114
+ showFooter && footerPosition === "fixed" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-page-footer fixed", children: footer ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
115
  import_FormFooterActions.default,
109
116
  {
110
117
  submitLoading,
@@ -67,6 +67,10 @@
67
67
  }
68
68
  }
69
69
 
70
+ .form-page-top-content {
71
+ margin-bottom: 16px;
72
+ }
73
+
70
74
  .form-page-footer {
71
75
  flex-shrink: 0;
72
76
 
@@ -1,119 +1,27 @@
1
1
  /* 企业主题色 - 活力橙 #F95914 */
2
+ /* 注:顶部导航 / 菜单 / 侧边栏 / 下划线等样式已统一收口到 .dumirc.ts 的 styles 字段,
3
+ 本文件仅保留 CSS 变量定义与不涉及导航结构的局部样式,避免选择器权重打架。 */
2
4
  :root {
3
- --dumi-primary: #F95914;
4
- --ant-primary-color: #F95914;
5
- --ant-primary-color-hover: #E04E0E;
6
- --ant-primary-color-active: #C9450D;
5
+ --dumi-primary: #f95914;
6
+ --ant-primary-color: #f95914;
7
+ --ant-primary-color-hover: #e04e0e;
8
+ --ant-primary-color-active: #c9450d;
7
9
  --ant-primary-color-outline: rgba(249, 89, 20, 0.2);
8
- --primary-color: #F95914;
9
- --dumi-link-color: #F95914;
10
- --dumi-link-color-hover: #E04E0E;
11
- --ant-color-primary: #F95914;
12
- --ant-color-primary-hover: #E04E0E;
13
- --ant-color-primary-active: #C9450D;
10
+ --primary-color: #f95914;
11
+ --dumi-link-color: #f95914;
12
+ --dumi-link-color-hover: #e04e0e;
13
+ --ant-color-primary: #f95914;
14
+ --ant-color-primary-hover: #e04e0e;
15
+ --ant-color-primary-active: #c9450d;
14
16
  --ant-color-primary-bg: rgba(249, 89, 20, 0.1);
15
17
  --ant-color-primary-bg-hover: rgba(249, 89, 20, 0.15);
16
- --ant-color-primary-border: #F95914;
17
- --ant-color-primary-text: #F95914;
18
- }
19
-
20
- /* 顶部导航 - 未选中状态使用默认颜色 */
21
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item {
22
- color: rgba(0, 0, 0, 0.65);
23
- }
24
-
25
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item a {
26
- color: rgba(0, 0, 0, 0.65);
27
- }
28
-
29
- /* 顶部导航 - 选中状态为橙色 */
30
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item-selected {
31
- color: #F95914;
32
- border-bottom-color: #F95914;
33
- }
34
-
35
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item-selected a {
36
- color: #F95914;
37
- }
38
-
39
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item-selected::after {
40
- border-bottom: 2px solid #F95914;
41
- }
42
-
43
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item:hover {
44
- border-bottom-color: #F95914;
45
- color: rgba(0, 0, 0, 0.85);
46
- }
47
-
48
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item:hover::after {
49
- border-bottom: 2px solid #F95914;
50
- }
51
-
52
- .dumi-default-header .ant-menu-horizontal > .ant-menu-item > a:hover {
53
- color: rgba(0, 0, 0, 0.85);
54
- }
55
-
56
- /* 默认不显示下划线 */
57
- .dumi-default-header .ant-menu-horizontal .ant-menu-item::after {
58
- border-bottom: none;
59
- border-bottom-color: transparent;
60
- }
61
-
62
- /* 只有选中和悬停时显示橙色下划线 */
63
- .dumi-default-header .ant-menu-horizontal .ant-menu-item-active::after,
64
- .dumi-default-header .ant-menu-horizontal .ant-menu-item:hover::after,
65
- .dumi-default-header .ant-menu-horizontal .ant-menu-item-selected::after {
66
- border-bottom: 2px solid #F95914;
67
- }
68
-
69
- /* 侧边栏宽度 */
70
- .dumi-default-sidebar {
71
- width: 270px !important;
72
- }
73
-
74
- /* 侧边栏导航 - 选中状态为橙色背景和文字 */
75
- .dumi-default-sidebar .ant-menu-inline .ant-menu-item-selected,
76
- .dumi-default-sidebar .ant-menu-vertical .ant-menu-item-selected {
77
- background-color: #FFF1E6;
78
- }
79
-
80
- .dumi-default-sidebar .ant-menu-item-selected,
81
- .dumi-default-sidebar .ant-menu-item-selected a {
82
- color: #F95914;
83
- }
84
-
85
- .dumi-default-sidebar .ant-menu-inline .ant-menu-item:active,
86
- .dumi-default-sidebar .ant-menu-vertical .ant-menu-item:active,
87
- .dumi-default-sidebar .ant-menu-inline .ant-menu-item:hover,
88
- .dumi-default-sidebar .ant-menu-vertical .ant-menu-item:hover {
89
- background-color: #FFF1E6;
90
- }
91
-
92
- /* 右侧锚点导航 - 选中状态为橙色 */
93
- .dumi-default-doc-layout .ant-anchor-link-title-active {
94
- color: #F95914;
95
- }
96
-
97
- .dumi-default-doc-layout .ant-anchor-link-active > .ant-anchor-link-title {
98
- color: #F95914;
99
- }
100
-
101
- .dumi-default-doc-layout .ant-anchor-ink-ball {
102
- border-color: #F95914;
103
- background-color: #F95914;
104
- }
105
-
106
- .dumi-default-doc-layout .ant-anchor-ink {
107
- background-color: #F95914;
108
- }
109
-
110
- .dumi-default-doc-layout .ant-anchor-wrapper {
111
- --ant-primary-color: #F95914;
18
+ --ant-color-primary-border: #f95914;
19
+ --ant-color-primary-text: #f95914;
112
20
  }
113
21
 
114
22
  /* dumi logo */
115
23
  .dumi-default-logo {
116
- color: #F95914;
24
+ color: #f95914;
117
25
  display: flex;
118
26
  align-items: center;
119
27
  gap: 8px;
@@ -132,8 +40,8 @@
132
40
  /* 隐藏顶部导航栏中的站点名称(Company UI)- 针对不同结构 */
133
41
  .dumi-default-header .lobe-flex > span,
134
42
  .dumi-default-header .ant-space-item span,
135
- .lobe-nav-header-title,
136
- .lobe-nav-brand-name {
43
+ .lob-nav-header-title,
44
+ .lob-nav-brand-name {
137
45
  display: none;
138
46
  }
139
47
 
@@ -145,10 +53,10 @@
145
53
  /* 页面底部导航链接 - 只修改这里的链接颜色 */
146
54
  .dumi-default-content nav a,
147
55
  .page-footer-nav a {
148
- color: #F95914;
56
+ color: #f95914;
149
57
  }
150
58
 
151
59
  .dumi-default-content nav a:hover,
152
60
  .page-footer-nav a:hover {
153
- color: #E04E0E;
61
+ color: #e04e0e;
154
62
  }
@@ -1,3 +1,4 @@
1
- var style = document.createElement('style');
2
- style.textContent = "\n:root {\n --dumi-primary: #F95914;\n --dumi-link-color: #F95914;\n --dumi-link-color-hover: #E04E0E;\n}\n\na {\n color: rgba(0, 0, 0, 0.65);\n}\n\n.ant-menu-horizontal > .ant-menu-item {\n color: rgba(0, 0, 0, 0.65);\n}\n\n.ant-menu-horizontal > .ant-menu-item-selected,\n.ant-menu-horizontal > .ant-menu-item-selected a {\n color: #F95914;\n border-bottom-color: #F95914;\n}\n\n.ant-menu-horizontal > .ant-menu-item-selected::after {\n border-bottom: 2px solid #F95914;\n}\n\n.ant-menu-horizontal > .ant-menu-item:hover {\n border-bottom-color: #F95914;\n color: #F95914;\n}\n\n.ant-menu-horizontal > .ant-menu-item:hover a {\n color: #F95914;\n}\n\n.dumi-default-navbar > li > a:hover {\n color: #F95914;\n}\n\n[data-prefers-color=dark] .dumi-default-navbar > li > a:hover {\n color: #F95914;\n}\n\n.ant-menu-horizontal .ant-menu-item::after {\n border-bottom: none;\n border-bottom-color: transparent;\n}\n\n.dumi-default-sidebar {\n width: 270px;\n}\n\n.ant-menu-inline .ant-menu-item a {\n color: rgba(0, 0, 0, 0.65);\n}\n\n.ant-menu-inline .ant-menu-item-selected a {\n color: #F95914;\n background-color: #FFF1E6;\n}\n\n.ant-menu-inline .ant-menu-item:hover a {\n color: rgba(0, 0, 0, 0.85);\n}\n\n.ant-menu-inline .ant-menu-item:hover {\n background-color: #FFF1E6;\n}\n\n.ant-anchor-link-title {\n color: rgba(0, 0, 0, 0.65);\n}\n\n.ant-anchor-link-title:hover {\n color: rgba(0, 0, 0, 0.85);\n}\n\n.ant-anchor-link-title-active {\n color: #F95914;\n}\n\n.ant-anchor-link-active > .ant-anchor-link-title {\n color: #F95914;\n}\n\n.ant-anchor-ink-ball {\n border-color: #F95914;\n background-color: #F95914;\n}\n\n.ant-anchor-ink {\n background-color: #F95914;\n}\n\n.dumi-default-content a,\n.page-footer-nav a {\n color: #F95914;\n}\n\n.dumi-default-content a:hover,\n.page-footer-nav a:hover {\n color: #E04E0E;\n}\n";
3
- document.head.appendChild(style);
1
+ // 顶部导航 / 菜单 / 侧边栏样式已统一收口到 .dumirc.ts 的 styles 字段,
2
+ // 此处不再通过运行时 JS 注入样式,避免与配置注入及全局 css 产生权重冲突。
3
+ // 如需运行时副作用(如主题切换钩子),请在下方扩展。
4
+ export {};
@@ -1,5 +1,5 @@
1
- import { type ReactNode } from 'react';
2
- import './index.scss';
1
+ import { type ReactNode } from "react";
2
+ import "./index.scss";
3
3
  interface FormPageTemplateProps {
4
4
  title: string;
5
5
  showBack?: boolean;
@@ -8,14 +8,24 @@ interface FormPageTemplateProps {
8
8
  submitText?: string;
9
9
  cancelText?: string;
10
10
  showFooter?: boolean;
11
- footerPosition?: 'fixed' | 'static';
11
+ footerPosition?: "fixed" | "static";
12
12
  onSubmit?: () => void;
13
13
  onCancel?: () => void;
14
14
  /** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
15
15
  titleExtra?: ReactNode;
16
16
  /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组) */
17
17
  titleActions?: ReactNode;
18
+ /** 内容区顶部插槽:渲染在 children 之上,跟随内容滚动(如 Steps、提示信息) */
19
+ topContent?: ReactNode;
20
+ /** 自定义底部:传了则覆盖默认的 FormFooterActions */
21
+ footer?: ReactNode;
22
+ /** 内容区是否包裹 CompanyCard,默认 true(多列表单场景);自定义内容时可设为 false */
23
+ contentWrapped?: boolean;
24
+ /** 内容区自定义 className */
25
+ contentClassName?: string;
26
+ /** 内容区自定义 style(如 contentStyle={{ padding: 0 }} 去掉默认边距) */
27
+ contentStyle?: React.CSSProperties;
18
28
  children?: ReactNode;
19
29
  }
20
- export default function FormPageTemplate({ title, showBack, onBack, submitLoading, submitText, cancelText, showFooter, footerPosition, onSubmit, onCancel, titleExtra, titleActions, children, }: FormPageTemplateProps): import("react").JSX.Element;
30
+ export default function FormPageTemplate({ title, showBack, onBack, submitLoading, submitText, cancelText, showFooter, footerPosition, onSubmit, onCancel, titleExtra, titleActions, topContent, footer, contentWrapped, contentClassName, contentStyle, children, }: FormPageTemplateProps): import("react").JSX.Element;
21
31
  export {};
@@ -4,7 +4,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { useState, useRef, useCallback } from 'react';
7
+ import { useState, useRef, useCallback } from "react";
8
8
  import { CompanyCard } from "../../basic-components";
9
9
  import PageTitle from "../../shared-components/PageTitle";
10
10
  import FormFooterActions from "../../shared-components/FormFooterActions";
@@ -23,11 +23,17 @@ export default function FormPageTemplate(_ref) {
23
23
  _ref$showFooter = _ref.showFooter,
24
24
  showFooter = _ref$showFooter === void 0 ? true : _ref$showFooter,
25
25
  _ref$footerPosition = _ref.footerPosition,
26
- footerPosition = _ref$footerPosition === void 0 ? 'fixed' : _ref$footerPosition,
26
+ footerPosition = _ref$footerPosition === void 0 ? "fixed" : _ref$footerPosition,
27
27
  onSubmit = _ref.onSubmit,
28
28
  onCancel = _ref.onCancel,
29
29
  titleExtra = _ref.titleExtra,
30
30
  titleActions = _ref.titleActions,
31
+ topContent = _ref.topContent,
32
+ footer = _ref.footer,
33
+ _ref$contentWrapped = _ref.contentWrapped,
34
+ contentWrapped = _ref$contentWrapped === void 0 ? true : _ref$contentWrapped,
35
+ contentClassName = _ref.contentClassName,
36
+ contentStyle = _ref.contentStyle,
31
37
  children = _ref.children;
32
38
  var _useState = useState(false),
33
39
  _useState2 = _slicedToArray(_useState, 2),
@@ -45,9 +51,9 @@ export default function FormPageTemplate(_ref) {
45
51
  }, 150);
46
52
  var scrollTop = target.scrollTop;
47
53
  if (scrollTop > 0) {
48
- target.classList.add('scrolled');
54
+ target.classList.add("scrolled");
49
55
  } else {
50
- target.classList.remove('scrolled');
56
+ target.classList.remove("scrolled");
51
57
  }
52
58
  }, []);
53
59
  return /*#__PURE__*/_jsxs("div", {
@@ -62,14 +68,18 @@ export default function FormPageTemplate(_ref) {
62
68
  }), /*#__PURE__*/_jsxs("div", {
63
69
  className: "form-page-container",
64
70
  children: [/*#__PURE__*/_jsxs("div", {
65
- className: "form-page-content".concat(isScrolling ? ' scrolling' : ''),
71
+ className: "form-page-content".concat(isScrolling ? " scrolling" : "").concat(contentClassName ? " ".concat(contentClassName) : ""),
72
+ style: contentStyle,
66
73
  onScroll: handleScroll,
67
- children: [/*#__PURE__*/_jsx(CompanyCard, {
74
+ children: [topContent && /*#__PURE__*/_jsx("div", {
75
+ className: "form-page-top-content",
76
+ children: topContent
77
+ }), contentWrapped ? /*#__PURE__*/_jsx(CompanyCard, {
68
78
  className: "form-page-card",
69
79
  children: children
70
- }), showFooter && footerPosition === 'static' && /*#__PURE__*/_jsx("div", {
80
+ }) : children, showFooter && footerPosition === "static" && /*#__PURE__*/_jsx("div", {
71
81
  className: "form-page-footer static",
72
- children: /*#__PURE__*/_jsx(FormFooterActions, {
82
+ children: footer !== null && footer !== void 0 ? footer : /*#__PURE__*/_jsx(FormFooterActions, {
73
83
  submitLoading: submitLoading,
74
84
  submitText: submitText,
75
85
  cancelText: cancelText,
@@ -77,9 +87,9 @@ export default function FormPageTemplate(_ref) {
77
87
  onCancel: onCancel
78
88
  })
79
89
  })]
80
- }), showFooter && footerPosition === 'fixed' && /*#__PURE__*/_jsx("div", {
90
+ }), showFooter && footerPosition === "fixed" && /*#__PURE__*/_jsx("div", {
81
91
  className: "form-page-footer fixed",
82
- children: /*#__PURE__*/_jsx(FormFooterActions, {
92
+ children: footer !== null && footer !== void 0 ? footer : /*#__PURE__*/_jsx(FormFooterActions, {
83
93
  submitLoading: submitLoading,
84
94
  submitText: submitText,
85
95
  cancelText: cancelText,
@@ -67,6 +67,10 @@
67
67
  }
68
68
  }
69
69
 
70
+ .form-page-top-content {
71
+ margin-bottom: 16px;
72
+ }
73
+
70
74
  .form-page-footer {
71
75
  flex-shrink: 0;
72
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donglegeyu/company-ui",
3
- "version": "1.2.28",
3
+ "version": "1.2.30",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",
@@ -93,7 +93,7 @@
93
93
  "prettier --write"
94
94
  ],
95
95
  "src/**/*.{css,scss}": [
96
- "stylelint --fix",
96
+ "stylelint --fix --allow-empty-input",
97
97
  "prettier --write"
98
98
  ],
99
99
  "src/**/*.{json,md}": [