@donglegeyu/company-ui 1.2.23 → 1.2.25

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 (27) hide show
  1. package/dist/cjs/shared-components/PageTitle/index.d.ts +8 -1
  2. package/dist/cjs/shared-components/PageTitle/index.js +3 -1
  3. package/dist/cjs/shared-components/PageTitle/index.scss +4 -1
  4. package/dist/cjs/template-components/DetailPageTemplate/index.d.ts +4 -1
  5. package/dist/cjs/template-components/DetailPageTemplate/index.js +2 -0
  6. package/dist/cjs/template-components/FormPageTemplate/index.d.ts +4 -1
  7. package/dist/cjs/template-components/FormPageTemplate/index.js +2 -0
  8. package/dist/cjs/template-components/SmartListTemplate/index.d.ts +5 -1
  9. package/dist/cjs/template-components/SmartListTemplate/index.js +5 -1
  10. package/dist/cjs/template-components/SmartListTemplate/index.scss +17 -1
  11. package/dist/cjs/template-components/StatisticsListPage/index.d.ts +10 -1
  12. package/dist/cjs/template-components/StatisticsListPage/index.js +10 -4
  13. package/dist/cjs/template-components/StatisticsListPage/index.scss +21 -3
  14. package/dist/es/shared-components/PageTitle/index.d.ts +8 -1
  15. package/dist/es/shared-components/PageTitle/index.js +5 -3
  16. package/dist/es/shared-components/PageTitle/index.scss +4 -1
  17. package/dist/es/template-components/DetailPageTemplate/index.d.ts +4 -1
  18. package/dist/es/template-components/DetailPageTemplate/index.js +2 -0
  19. package/dist/es/template-components/FormPageTemplate/index.d.ts +4 -1
  20. package/dist/es/template-components/FormPageTemplate/index.js +2 -0
  21. package/dist/es/template-components/SmartListTemplate/index.d.ts +5 -1
  22. package/dist/es/template-components/SmartListTemplate/index.js +8 -0
  23. package/dist/es/template-components/SmartListTemplate/index.scss +17 -1
  24. package/dist/es/template-components/StatisticsListPage/index.d.ts +10 -1
  25. package/dist/es/template-components/StatisticsListPage/index.js +15 -6
  26. package/dist/es/template-components/StatisticsListPage/index.scss +21 -3
  27. package/package.json +1 -1
@@ -9,8 +9,15 @@ interface PageTitleProps {
9
9
  onBack?: () => void;
10
10
  className?: string;
11
11
  backIcon?: ReactNode;
12
+ /**
13
+ * @deprecated 请使用 titleExtra,该字段将在下个大版本移除。
14
+ * 紧跟标题右侧的补充内容,内部桥接到 titleExtra 渲染。
15
+ */
12
16
  titleSuffix?: ReactNode;
17
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如视图切换、状态标签、计数) */
18
+ titleExtra?: ReactNode;
19
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组、搜索框、描述+link) */
13
20
  actions?: ReactNode;
14
21
  }
15
- export default function PageTitle({ title, showBack, showBackText, showDivider, backText, onBack, className, backIcon, titleSuffix, actions, }: PageTitleProps): import("react/jsx-runtime").JSX.Element;
22
+ export default function PageTitle({ title, showBack, showBackText, showDivider, backText, onBack, className, backIcon, titleSuffix, titleExtra, actions, }: PageTitleProps): import("react/jsx-runtime").JSX.Element;
16
23
  export {};
@@ -35,6 +35,7 @@ function PageTitle({
35
35
  className,
36
36
  backIcon,
37
37
  titleSuffix,
38
+ titleExtra,
38
39
  actions
39
40
  }) {
40
41
  const handleBack = (0, import_react.useCallback)(() => {
@@ -44,6 +45,7 @@ function PageTitle({
44
45
  window.history.back();
45
46
  }
46
47
  }, [onBack]);
48
+ const extraNode = titleExtra ?? titleSuffix;
47
49
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `page-title${className ? ` ${className}` : ""}`, children: [
48
50
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "page-title-left", children: [
49
51
  showBack && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
@@ -54,7 +56,7 @@ function PageTitle({
54
56
  showDivider && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-title-divider" })
55
57
  ] }),
56
58
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-title-text", children: title }),
57
- titleSuffix && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-title-suffix", children: titleSuffix })
59
+ extraNode && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-title-extra", children: extraNode })
58
60
  ] }),
59
61
  actions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "page-title-actions", children: actions })
60
62
  ] });
@@ -52,7 +52,10 @@
52
52
  color: #1D2129;
53
53
  }
54
54
 
55
- .page-title-suffix {
55
+ .page-title-extra {
56
+ display: flex;
57
+ align-items: center;
58
+ gap: 4px;
56
59
  font-size: 14px;
57
60
  color: rgba(0, 0, 0, 0.65);
58
61
  }
@@ -18,6 +18,9 @@ interface DetailPageTemplateProps {
18
18
  title: string;
19
19
  showBack?: boolean;
20
20
  onBack?: () => void;
21
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
22
+ titleExtra?: ReactNode;
23
+ /** 标题栏最右侧的独立操作区:与标题解耦(如编辑、删除按钮) */
21
24
  titleActions?: ReactNode;
22
25
  avatar?: ReactNode;
23
26
  primaryName?: ReactNode;
@@ -31,5 +34,5 @@ interface DetailPageTemplateProps {
31
34
  showDivider?: boolean;
32
35
  children?: ReactNode;
33
36
  }
34
- export default function DetailPageTemplate({ title, showBack, onBack, titleActions, avatar, primaryName, tags, infoFields, infoColumns, infoArea, tabs, activeTab: controlledActiveTab, onTabChange, showDivider, children, }: DetailPageTemplateProps): import("react/jsx-runtime").JSX.Element;
37
+ export default function DetailPageTemplate({ title, showBack, onBack, titleExtra, titleActions, avatar, primaryName, tags, infoFields, infoColumns, infoArea, tabs, activeTab: controlledActiveTab, onTabChange, showDivider, children, }: DetailPageTemplateProps): import("react/jsx-runtime").JSX.Element;
35
38
  export {};
@@ -41,6 +41,7 @@ function DetailPageTemplate({
41
41
  title,
42
42
  showBack = false,
43
43
  onBack,
44
+ titleExtra,
44
45
  titleActions,
45
46
  avatar,
46
47
  primaryName,
@@ -122,6 +123,7 @@ function DetailPageTemplate({
122
123
  showBack,
123
124
  onBack,
124
125
  className: "dpt-page-title",
126
+ titleExtra,
125
127
  actions: titleActions
126
128
  }
127
129
  ),
@@ -11,8 +11,11 @@ interface FormPageTemplateProps {
11
11
  footerPosition?: 'fixed' | 'static';
12
12
  onSubmit?: () => void;
13
13
  onCancel?: () => void;
14
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
15
+ titleExtra?: ReactNode;
16
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组) */
14
17
  titleActions?: ReactNode;
15
18
  children?: ReactNode;
16
19
  }
17
- export default function FormPageTemplate({ title, showBack, onBack, submitLoading, submitText, cancelText, showFooter, footerPosition, onSubmit, onCancel, titleActions, children, }: FormPageTemplateProps): import("react/jsx-runtime").JSX.Element;
20
+ export default function FormPageTemplate({ title, showBack, onBack, submitLoading, submitText, cancelText, showFooter, footerPosition, onSubmit, onCancel, titleExtra, titleActions, children, }: FormPageTemplateProps): import("react/jsx-runtime").JSX.Element;
18
21
  export {};
@@ -49,6 +49,7 @@ function FormPageTemplate({
49
49
  footerPosition = "fixed",
50
50
  onSubmit,
51
51
  onCancel,
52
+ titleExtra,
52
53
  titleActions,
53
54
  children
54
55
  }) {
@@ -78,6 +79,7 @@ function FormPageTemplate({
78
79
  showBack,
79
80
  onBack,
80
81
  className: "form-page-title",
82
+ titleExtra,
81
83
  actions: titleActions
82
84
  }
83
85
  ),
@@ -34,6 +34,10 @@ interface SmartListTemplateProps {
34
34
  expandedRowKeys: string[];
35
35
  }) => void;
36
36
  titleActions?: ReactNode;
37
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
38
+ titleExtra?: ReactNode;
39
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组、描述+link) */
40
+ titleRightActions?: ReactNode;
37
41
  toolbarActions?: ReactNode;
38
42
  toolbarRightActions?: ReactNode;
39
43
  bodyCell?: (column: Record<string, unknown>, record: RecordType) => ReactNode;
@@ -45,5 +49,5 @@ interface SmartListTemplateProps {
45
49
  size?: TableSize;
46
50
  onSizeChange?: (size: TableSize) => void;
47
51
  }
48
- export default function SmartListTemplate({ title, fields, dataSource, loading, pagination, rowSelection, rowKey, viewEndpoint, defaultExpandAll, treeConfig, filterParams, onFilterParamsChange, onSearch, onReset, onChange, onPaginationChange, onViewChange, onExpand, titleActions, toolbarActions, toolbarRightActions, bodyCell, columnFields, defaultColumnFields, onColumnSettingsChange, onColumnSettingsReset, onRefresh, size: tableSize, onSizeChange, }: SmartListTemplateProps): import("react/jsx-runtime").JSX.Element;
52
+ export default function SmartListTemplate({ title, fields, dataSource, loading, pagination, rowSelection, rowKey, viewEndpoint, defaultExpandAll, treeConfig, filterParams, onFilterParamsChange, onSearch, onReset, onChange, onPaginationChange, onViewChange, onExpand, titleActions, titleExtra, titleRightActions, toolbarActions, toolbarRightActions, bodyCell, columnFields, defaultColumnFields, onColumnSettingsChange, onColumnSettingsReset, onRefresh, size: tableSize, onSizeChange, }: SmartListTemplateProps): import("react/jsx-runtime").JSX.Element;
49
53
  export {};
@@ -73,6 +73,8 @@ function SmartListTemplate({
73
73
  onViewChange,
74
74
  onExpand,
75
75
  titleActions,
76
+ titleExtra,
77
+ titleRightActions,
76
78
  toolbarActions,
77
79
  toolbarRightActions,
78
80
  bodyCell,
@@ -703,6 +705,7 @@ function SmartListTemplate({
703
705
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "smart-list-template", children: [
704
706
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "page-header", children: [
705
707
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "page-title", children: title }),
708
+ titleExtra && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "page-title-extra", children: titleExtra }),
706
709
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "page-header-actions", children: [
707
710
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "page-header-line" }),
708
711
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -761,7 +764,8 @@ function SmartListTemplate({
761
764
  )
762
765
  ] }),
763
766
  titleActions
764
- ] })
767
+ ] }),
768
+ titleRightActions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "page-header-right", children: titleRightActions })
765
769
  ] }),
766
770
  displayFilterItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
767
771
  import_FilterForm.default,
@@ -29,6 +29,14 @@
29
29
  line-height: 24px;
30
30
  }
31
31
 
32
+ .page-title-extra {
33
+ display: flex;
34
+ align-items: center;
35
+ gap: 4px;
36
+ font-size: 14px;
37
+ color: rgba(0, 0, 0, 0.65);
38
+ }
39
+
32
40
  .page-header-actions {
33
41
  display: flex;
34
42
  align-items: center;
@@ -38,9 +46,17 @@
38
46
  flex-shrink: 0;
39
47
  }
40
48
 
49
+ .page-header-right {
50
+ display: flex;
51
+ align-items: center;
52
+ gap: 8px;
53
+ margin-left: auto;
54
+ flex-shrink: 0;
55
+ }
56
+
41
57
  .page-header-line {
42
58
  width: 1px;
43
- height: 18px;
59
+ height: 16px;
44
60
  background-color: #d9d9d9;
45
61
  }
46
62
 
@@ -43,8 +43,17 @@ export interface StatisticsColumn<T = Record<string, unknown>> {
43
43
  export interface StatisticsListPageProps<T = Record<string, unknown>> {
44
44
  /** 页面标题 */
45
45
  title?: string;
46
- /** 标题右侧自定义区域(如月份选择器、操作按钮) */
46
+ /**
47
+ * @deprecated 请使用 titleExtra,该字段将在下个大版本移除。
48
+ * 标题右侧自定义区域(如月份选择器、操作按钮),内部桥接到 titleExtra 渲染。
49
+ */
47
50
  titleSuffix?: ReactNode;
51
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如月份选择器、状态标签) */
52
+ titleExtra?: ReactNode;
53
+ /** 是否显示 titleExtra 前置分割线,标题后跟标签等强关联场景可设为 false | `true` */
54
+ showTitleExtraDivider?: boolean;
55
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组、描述+link) */
56
+ titleActions?: ReactNode;
48
57
  /** 统计卡片区配置(不传则不渲染卡片区) */
49
58
  statisticCards?: StatisticCardConfig[];
50
59
  /** 顶部搜索框占位符 */
@@ -75,6 +75,9 @@ var StatisticsListPage = (props) => {
75
75
  const {
76
76
  title = "统计列表",
77
77
  titleSuffix,
78
+ titleExtra,
79
+ showTitleExtraDivider = true,
80
+ titleActions,
78
81
  statisticCards,
79
82
  searchPlaceholder = "请输入",
80
83
  searchKey = "keyword",
@@ -257,15 +260,18 @@ var StatisticsListPage = (props) => {
257
260
  const handleColumnSettingsClick = (0, import_react.useCallback)(() => {
258
261
  import_basic_components.CompanyMessage.info("请在业务侧通过 columns 属性控制列显示/隐藏");
259
262
  }, []);
263
+ const extraNode = titleExtra ?? titleSuffix;
264
+ const titleExtraNode = extraNode ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "slp-title-extra", children: [
265
+ showTitleExtraDivider && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "slp-divider" }),
266
+ extraNode
267
+ ] }) : void 0;
260
268
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatisticsErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `statistics-list-page${className ? ` ${className}` : ""}`, children: [
261
269
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
262
270
  import_shared_components.PageTitle,
263
271
  {
264
272
  title,
265
- titleSuffix: titleSuffix ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
266
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "slp-divider" }),
267
- titleSuffix
268
- ] }) : void 0
273
+ titleExtra: titleExtraNode,
274
+ actions: titleActions
269
275
  }
270
276
  ),
271
277
  statisticCards && statisticCards.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "slp-statistics", children: statisticCards.map((card) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "statistic-card", children: [
@@ -6,8 +6,9 @@
6
6
  padding: 0 calc(var(--spacing-sm, 12) * 1px);
7
7
  background: #f5f5f5;
8
8
 
9
- // 标题区右侧槽位布局(对齐 .page-title .page-title-suffix
10
- .page-title .page-title-suffix {
9
+ // 标题区右侧槽位布局(对齐 SmartListTemplate:分割线左右间距对称 16px
10
+ // 注:PageTitle 内部 .page-title-left 已有 gap:8px,此处补 8px margin-left 凑齐 16px
11
+ .slp-title-extra {
11
12
  display: flex;
12
13
  align-items: center;
13
14
  gap: calc(var(--spacing-md, 16) * 1px);
@@ -16,10 +17,27 @@
16
17
 
17
18
  .slp-divider {
18
19
  width: 1px;
19
- height: 14px;
20
+ height: 16px;
20
21
  background: var(--color-border, rgba(5, 5, 5, 0.15));
21
22
  }
22
23
 
24
+ // 月份选择器触发按钮:伪装成纯文字,去掉按钮边距与 hover 背景
25
+ // 对齐 SmartListTemplate 的 .dropdown-text-btn 既定模式(antd Button 深度定制场景)
26
+ .slp-month-trigger.ant-btn {
27
+ padding-inline: 0 !important;
28
+ background: transparent !important;
29
+ border-color: transparent !important;
30
+ box-shadow: none !important;
31
+
32
+ &:hover,
33
+ &:focus,
34
+ &:active {
35
+ background: transparent !important;
36
+ border-color: transparent !important;
37
+ box-shadow: none !important;
38
+ }
39
+ }
40
+
23
41
  // ========== 统计卡片区 ==========
24
42
  .slp-statistics {
25
43
  display: flex;
@@ -9,8 +9,15 @@ interface PageTitleProps {
9
9
  onBack?: () => void;
10
10
  className?: string;
11
11
  backIcon?: ReactNode;
12
+ /**
13
+ * @deprecated 请使用 titleExtra,该字段将在下个大版本移除。
14
+ * 紧跟标题右侧的补充内容,内部桥接到 titleExtra 渲染。
15
+ */
12
16
  titleSuffix?: ReactNode;
17
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如视图切换、状态标签、计数) */
18
+ titleExtra?: ReactNode;
19
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组、搜索框、描述+link) */
13
20
  actions?: ReactNode;
14
21
  }
15
- export default function PageTitle({ title, showBack, showBackText, showDivider, backText, onBack, className, backIcon, titleSuffix, actions, }: PageTitleProps): import("react/jsx-runtime").JSX.Element;
22
+ export default function PageTitle({ title, showBack, showBackText, showDivider, backText, onBack, className, backIcon, titleSuffix, titleExtra, actions, }: PageTitleProps): import("react/jsx-runtime").JSX.Element;
16
23
  export {};
@@ -17,6 +17,7 @@ export default function PageTitle(_ref) {
17
17
  className = _ref.className,
18
18
  backIcon = _ref.backIcon,
19
19
  titleSuffix = _ref.titleSuffix,
20
+ titleExtra = _ref.titleExtra,
20
21
  actions = _ref.actions;
21
22
  var handleBack = useCallback(function () {
22
23
  if (onBack) {
@@ -25,6 +26,7 @@ export default function PageTitle(_ref) {
25
26
  window.history.back();
26
27
  }
27
28
  }, [onBack]);
29
+ var extraNode = titleExtra !== null && titleExtra !== void 0 ? titleExtra : titleSuffix;
28
30
  return /*#__PURE__*/_jsxs("div", {
29
31
  className: "page-title".concat(className ? " ".concat(className) : ''),
30
32
  children: [/*#__PURE__*/_jsxs("div", {
@@ -51,9 +53,9 @@ export default function PageTitle(_ref) {
51
53
  }), /*#__PURE__*/_jsx("span", {
52
54
  className: "page-title-text",
53
55
  children: title
54
- }), titleSuffix && /*#__PURE__*/_jsx("span", {
55
- className: "page-title-suffix",
56
- children: titleSuffix
56
+ }), extraNode && /*#__PURE__*/_jsx("span", {
57
+ className: "page-title-extra",
58
+ children: extraNode
57
59
  })]
58
60
  }), actions && /*#__PURE__*/_jsx("div", {
59
61
  className: "page-title-actions",
@@ -52,7 +52,10 @@
52
52
  color: #1D2129;
53
53
  }
54
54
 
55
- .page-title-suffix {
55
+ .page-title-extra {
56
+ display: flex;
57
+ align-items: center;
58
+ gap: 4px;
56
59
  font-size: 14px;
57
60
  color: rgba(0, 0, 0, 0.65);
58
61
  }
@@ -18,6 +18,9 @@ interface DetailPageTemplateProps {
18
18
  title: string;
19
19
  showBack?: boolean;
20
20
  onBack?: () => void;
21
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
22
+ titleExtra?: ReactNode;
23
+ /** 标题栏最右侧的独立操作区:与标题解耦(如编辑、删除按钮) */
21
24
  titleActions?: ReactNode;
22
25
  avatar?: ReactNode;
23
26
  primaryName?: ReactNode;
@@ -31,5 +34,5 @@ interface DetailPageTemplateProps {
31
34
  showDivider?: boolean;
32
35
  children?: ReactNode;
33
36
  }
34
- export default function DetailPageTemplate({ title, showBack, onBack, titleActions, avatar, primaryName, tags, infoFields, infoColumns, infoArea, tabs, activeTab: controlledActiveTab, onTabChange, showDivider, children, }: DetailPageTemplateProps): import("react/jsx-runtime").JSX.Element;
37
+ export default function DetailPageTemplate({ title, showBack, onBack, titleExtra, titleActions, avatar, primaryName, tags, infoFields, infoColumns, infoArea, tabs, activeTab: controlledActiveTab, onTabChange, showDivider, children, }: DetailPageTemplateProps): import("react/jsx-runtime").JSX.Element;
35
38
  export {};
@@ -16,6 +16,7 @@ export default function DetailPageTemplate(_ref) {
16
16
  _ref$showBack = _ref.showBack,
17
17
  showBack = _ref$showBack === void 0 ? false : _ref$showBack,
18
18
  onBack = _ref.onBack,
19
+ titleExtra = _ref.titleExtra,
19
20
  titleActions = _ref.titleActions,
20
21
  avatar = _ref.avatar,
21
22
  primaryName = _ref.primaryName,
@@ -100,6 +101,7 @@ export default function DetailPageTemplate(_ref) {
100
101
  showBack: showBack,
101
102
  onBack: onBack,
102
103
  className: "dpt-page-title",
104
+ titleExtra: titleExtra,
103
105
  actions: titleActions
104
106
  }), /*#__PURE__*/_jsxs("div", {
105
107
  ref: scrollRef,
@@ -11,8 +11,11 @@ interface FormPageTemplateProps {
11
11
  footerPosition?: 'fixed' | 'static';
12
12
  onSubmit?: () => void;
13
13
  onCancel?: () => void;
14
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
15
+ titleExtra?: ReactNode;
16
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组) */
14
17
  titleActions?: ReactNode;
15
18
  children?: ReactNode;
16
19
  }
17
- export default function FormPageTemplate({ title, showBack, onBack, submitLoading, submitText, cancelText, showFooter, footerPosition, onSubmit, onCancel, titleActions, children, }: FormPageTemplateProps): import("react/jsx-runtime").JSX.Element;
20
+ export default function FormPageTemplate({ title, showBack, onBack, submitLoading, submitText, cancelText, showFooter, footerPosition, onSubmit, onCancel, titleExtra, titleActions, children, }: FormPageTemplateProps): import("react/jsx-runtime").JSX.Element;
18
21
  export {};
@@ -26,6 +26,7 @@ export default function FormPageTemplate(_ref) {
26
26
  footerPosition = _ref$footerPosition === void 0 ? 'fixed' : _ref$footerPosition,
27
27
  onSubmit = _ref.onSubmit,
28
28
  onCancel = _ref.onCancel,
29
+ titleExtra = _ref.titleExtra,
29
30
  titleActions = _ref.titleActions,
30
31
  children = _ref.children;
31
32
  var _useState = useState(false),
@@ -56,6 +57,7 @@ export default function FormPageTemplate(_ref) {
56
57
  showBack: showBack,
57
58
  onBack: onBack,
58
59
  className: "form-page-title",
60
+ titleExtra: titleExtra,
59
61
  actions: titleActions
60
62
  }), /*#__PURE__*/_jsxs("div", {
61
63
  className: "form-page-container",
@@ -34,6 +34,10 @@ interface SmartListTemplateProps {
34
34
  expandedRowKeys: string[];
35
35
  }) => void;
36
36
  titleActions?: ReactNode;
37
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
38
+ titleExtra?: ReactNode;
39
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组、描述+link) */
40
+ titleRightActions?: ReactNode;
37
41
  toolbarActions?: ReactNode;
38
42
  toolbarRightActions?: ReactNode;
39
43
  bodyCell?: (column: Record<string, unknown>, record: RecordType) => ReactNode;
@@ -45,5 +49,5 @@ interface SmartListTemplateProps {
45
49
  size?: TableSize;
46
50
  onSizeChange?: (size: TableSize) => void;
47
51
  }
48
- export default function SmartListTemplate({ title, fields, dataSource, loading, pagination, rowSelection, rowKey, viewEndpoint, defaultExpandAll, treeConfig, filterParams, onFilterParamsChange, onSearch, onReset, onChange, onPaginationChange, onViewChange, onExpand, titleActions, toolbarActions, toolbarRightActions, bodyCell, columnFields, defaultColumnFields, onColumnSettingsChange, onColumnSettingsReset, onRefresh, size: tableSize, onSizeChange, }: SmartListTemplateProps): import("react/jsx-runtime").JSX.Element;
52
+ export default function SmartListTemplate({ title, fields, dataSource, loading, pagination, rowSelection, rowKey, viewEndpoint, defaultExpandAll, treeConfig, filterParams, onFilterParamsChange, onSearch, onReset, onChange, onPaginationChange, onViewChange, onExpand, titleActions, titleExtra, titleRightActions, toolbarActions, toolbarRightActions, bodyCell, columnFields, defaultColumnFields, onColumnSettingsChange, onColumnSettingsReset, onRefresh, size: tableSize, onSizeChange, }: SmartListTemplateProps): import("react/jsx-runtime").JSX.Element;
49
53
  export {};
@@ -78,6 +78,8 @@ export default function SmartListTemplate(_ref) {
78
78
  onViewChange = _ref.onViewChange,
79
79
  onExpand = _ref.onExpand,
80
80
  titleActions = _ref.titleActions,
81
+ titleExtra = _ref.titleExtra,
82
+ titleRightActions = _ref.titleRightActions,
81
83
  toolbarActions = _ref.toolbarActions,
82
84
  toolbarRightActions = _ref.toolbarRightActions,
83
85
  bodyCell = _ref.bodyCell,
@@ -945,6 +947,9 @@ export default function SmartListTemplate(_ref) {
945
947
  children: [/*#__PURE__*/_jsx("h2", {
946
948
  className: "page-title",
947
949
  children: title
950
+ }), titleExtra && /*#__PURE__*/_jsx("div", {
951
+ className: "page-title-extra",
952
+ children: titleExtra
948
953
  }), /*#__PURE__*/_jsxs("div", {
949
954
  className: "page-header-actions",
950
955
  children: [/*#__PURE__*/_jsx("div", {
@@ -989,6 +994,9 @@ export default function SmartListTemplate(_ref) {
989
994
  children: "\u53E6\u5B58\u4E3A"
990
995
  })]
991
996
  }), titleActions]
997
+ }), titleRightActions && /*#__PURE__*/_jsx("div", {
998
+ className: "page-header-right",
999
+ children: titleRightActions
992
1000
  })]
993
1001
  }), displayFilterItems.length > 0 && /*#__PURE__*/_jsx(FilterForm, {
994
1002
  modelValue: effectiveFilterParams,
@@ -29,6 +29,14 @@
29
29
  line-height: 24px;
30
30
  }
31
31
 
32
+ .page-title-extra {
33
+ display: flex;
34
+ align-items: center;
35
+ gap: 4px;
36
+ font-size: 14px;
37
+ color: rgba(0, 0, 0, 0.65);
38
+ }
39
+
32
40
  .page-header-actions {
33
41
  display: flex;
34
42
  align-items: center;
@@ -38,9 +46,17 @@
38
46
  flex-shrink: 0;
39
47
  }
40
48
 
49
+ .page-header-right {
50
+ display: flex;
51
+ align-items: center;
52
+ gap: 8px;
53
+ margin-left: auto;
54
+ flex-shrink: 0;
55
+ }
56
+
41
57
  .page-header-line {
42
58
  width: 1px;
43
- height: 18px;
59
+ height: 16px;
44
60
  background-color: #d9d9d9;
45
61
  }
46
62
 
@@ -43,8 +43,17 @@ export interface StatisticsColumn<T = Record<string, unknown>> {
43
43
  export interface StatisticsListPageProps<T = Record<string, unknown>> {
44
44
  /** 页面标题 */
45
45
  title?: string;
46
- /** 标题右侧自定义区域(如月份选择器、操作按钮) */
46
+ /**
47
+ * @deprecated 请使用 titleExtra,该字段将在下个大版本移除。
48
+ * 标题右侧自定义区域(如月份选择器、操作按钮),内部桥接到 titleExtra 渲染。
49
+ */
47
50
  titleSuffix?: ReactNode;
51
+ /** 紧跟标题右侧的区域:标题的延伸/补充(如月份选择器、状态标签) */
52
+ titleExtra?: ReactNode;
53
+ /** 是否显示 titleExtra 前置分割线,标题后跟标签等强关联场景可设为 false | `true` */
54
+ showTitleExtraDivider?: boolean;
55
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组、描述+link) */
56
+ titleActions?: ReactNode;
48
57
  /** 统计卡片区配置(不传则不渲染卡片区) */
49
58
  statisticCards?: StatisticCardConfig[];
50
59
  /** 顶部搜索框占位符 */
@@ -33,7 +33,6 @@ import { useCompanyToken } from "../../theme/useCompanyToken";
33
33
  import "./index.scss";
34
34
  import { jsx as _jsx } from "react/jsx-runtime";
35
35
  import { jsxs as _jsxs } from "react/jsx-runtime";
36
- import { Fragment as _Fragment } from "react/jsx-runtime";
37
36
  var Text = Typography.Text;
38
37
 
39
38
  // Error Boundary:防止脏数据导致整页白屏
@@ -101,6 +100,10 @@ export var StatisticsListPage = function StatisticsListPage(props) {
101
100
  var _props$title = props.title,
102
101
  title = _props$title === void 0 ? '统计列表' : _props$title,
103
102
  titleSuffix = props.titleSuffix,
103
+ titleExtra = props.titleExtra,
104
+ _props$showTitleExtra = props.showTitleExtraDivider,
105
+ showTitleExtraDivider = _props$showTitleExtra === void 0 ? true : _props$showTitleExtra,
106
+ titleActions = props.titleActions,
104
107
  statisticCards = props.statisticCards,
105
108
  _props$searchPlacehol = props.searchPlaceholder,
106
109
  searchPlaceholder = _props$searchPlacehol === void 0 ? '请输入' : _props$searchPlacehol,
@@ -383,16 +386,22 @@ export var StatisticsListPage = function StatisticsListPage(props) {
383
386
  var handleColumnSettingsClick = useCallback(function () {
384
387
  CompanyMessage.info('请在业务侧通过 columns 属性控制列显示/隐藏');
385
388
  }, []);
389
+
390
+ // 标题右侧补充区域:优先 titleExtra,兼容旧 titleSuffix,按 showTitleExtraDivider 决定是否带前置分割线
391
+ var extraNode = titleExtra !== null && titleExtra !== void 0 ? titleExtra : titleSuffix;
392
+ var titleExtraNode = extraNode ? /*#__PURE__*/_jsxs("span", {
393
+ className: "slp-title-extra",
394
+ children: [showTitleExtraDivider && /*#__PURE__*/_jsx("span", {
395
+ className: "slp-divider"
396
+ }), extraNode]
397
+ }) : undefined;
386
398
  return /*#__PURE__*/_jsx(StatisticsErrorBoundary, {
387
399
  children: /*#__PURE__*/_jsxs("div", {
388
400
  className: "statistics-list-page".concat(className ? " ".concat(className) : ''),
389
401
  children: [/*#__PURE__*/_jsx(PageTitle, {
390
402
  title: title,
391
- titleSuffix: titleSuffix ? /*#__PURE__*/_jsxs(_Fragment, {
392
- children: [/*#__PURE__*/_jsx("span", {
393
- className: "slp-divider"
394
- }), titleSuffix]
395
- }) : undefined
403
+ titleExtra: titleExtraNode,
404
+ actions: titleActions
396
405
  }), statisticCards && statisticCards.length > 0 && /*#__PURE__*/_jsx("div", {
397
406
  className: "slp-statistics",
398
407
  children: statisticCards.map(function (card) {
@@ -6,8 +6,9 @@
6
6
  padding: 0 calc(var(--spacing-sm, 12) * 1px);
7
7
  background: #f5f5f5;
8
8
 
9
- // 标题区右侧槽位布局(对齐 .page-title .page-title-suffix
10
- .page-title .page-title-suffix {
9
+ // 标题区右侧槽位布局(对齐 SmartListTemplate:分割线左右间距对称 16px
10
+ // 注:PageTitle 内部 .page-title-left 已有 gap:8px,此处补 8px margin-left 凑齐 16px
11
+ .slp-title-extra {
11
12
  display: flex;
12
13
  align-items: center;
13
14
  gap: calc(var(--spacing-md, 16) * 1px);
@@ -16,10 +17,27 @@
16
17
 
17
18
  .slp-divider {
18
19
  width: 1px;
19
- height: 14px;
20
+ height: 16px;
20
21
  background: var(--color-border, rgba(5, 5, 5, 0.15));
21
22
  }
22
23
 
24
+ // 月份选择器触发按钮:伪装成纯文字,去掉按钮边距与 hover 背景
25
+ // 对齐 SmartListTemplate 的 .dropdown-text-btn 既定模式(antd Button 深度定制场景)
26
+ .slp-month-trigger.ant-btn {
27
+ padding-inline: 0 !important;
28
+ background: transparent !important;
29
+ border-color: transparent !important;
30
+ box-shadow: none !important;
31
+
32
+ &:hover,
33
+ &:focus,
34
+ &:active {
35
+ background: transparent !important;
36
+ border-color: transparent !important;
37
+ box-shadow: none !important;
38
+ }
39
+ }
40
+
23
41
  // ========== 统计卡片区 ==========
24
42
  .slp-statistics {
25
43
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donglegeyu/company-ui",
3
- "version": "1.2.23",
3
+ "version": "1.2.25",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",