@donglegeyu/company-ui 1.2.22 → 1.2.24

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/basic-components/CompanyTypography/index.js +16 -0
  2. package/dist/cjs/shared-components/PageTitle/index.d.ts +8 -1
  3. package/dist/cjs/shared-components/PageTitle/index.js +3 -1
  4. package/dist/cjs/shared-components/PageTitle/index.scss +4 -1
  5. package/dist/cjs/template-components/DetailPageTemplate/index.d.ts +4 -1
  6. package/dist/cjs/template-components/DetailPageTemplate/index.js +2 -0
  7. package/dist/cjs/template-components/FormPageTemplate/index.d.ts +4 -1
  8. package/dist/cjs/template-components/FormPageTemplate/index.js +2 -0
  9. package/dist/cjs/template-components/SmartListTemplate/index.d.ts +5 -1
  10. package/dist/cjs/template-components/SmartListTemplate/index.js +6 -2
  11. package/dist/cjs/template-components/SmartListTemplate/index.scss +16 -0
  12. package/dist/cjs/template-components/StatisticsListPage/index.d.ts +8 -1
  13. package/dist/cjs/template-components/StatisticsListPage/index.js +5 -2
  14. package/dist/es/basic-components/CompanyTypography/index.js +14 -1
  15. package/dist/es/shared-components/PageTitle/index.d.ts +8 -1
  16. package/dist/es/shared-components/PageTitle/index.js +5 -3
  17. package/dist/es/shared-components/PageTitle/index.scss +4 -1
  18. package/dist/es/template-components/DetailPageTemplate/index.d.ts +4 -1
  19. package/dist/es/template-components/DetailPageTemplate/index.js +2 -0
  20. package/dist/es/template-components/FormPageTemplate/index.d.ts +4 -1
  21. package/dist/es/template-components/FormPageTemplate/index.js +2 -0
  22. package/dist/es/template-components/SmartListTemplate/index.d.ts +5 -1
  23. package/dist/es/template-components/SmartListTemplate/index.js +9 -1
  24. package/dist/es/template-components/SmartListTemplate/index.scss +16 -0
  25. package/dist/es/template-components/StatisticsListPage/index.d.ts +8 -1
  26. package/dist/es/template-components/StatisticsListPage/index.js +5 -2
  27. package/package.json +1 -1
@@ -28,6 +28,22 @@ var import_jsx_runtime = require("react/jsx-runtime");
28
28
  var CompanyTypography = (props) => {
29
29
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme: import_theme.companyTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Typography, { ...props }) });
30
30
  };
31
+ var withTheme = (Comp) => {
32
+ const Wrapped = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, { theme: import_theme.companyTheme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ...props }) });
33
+ return Wrapped;
34
+ };
35
+ CompanyTypography.Link = withTheme(
36
+ import_antd.Typography.Link
37
+ );
38
+ CompanyTypography.Text = withTheme(
39
+ import_antd.Typography.Text
40
+ );
41
+ CompanyTypography.Title = withTheme(
42
+ import_antd.Typography.Title
43
+ );
44
+ CompanyTypography.Paragraph = withTheme(
45
+ import_antd.Typography.Paragraph
46
+ );
31
47
  // Annotate the CommonJS export names for ESM import in node:
32
48
  0 && (module.exports = {
33
49
  CompanyTypography
@@ -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,
@@ -169,7 +171,7 @@ function SmartListTemplate({
169
171
  }, [fields]);
170
172
  const displayFilterItems = (0, import_react.useMemo)(() => {
171
173
  const filteredFields = fields.filter(
172
- (field) => !nonBusinessFields.includes(field.key)
174
+ (field) => !nonBusinessFields.includes(field.key) && !field.hideInFilter
173
175
  );
174
176
  if (!currentScheme || currentScheme === "default") {
175
177
  return filteredFields.map((f) => ({
@@ -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,6 +46,14 @@
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
59
  height: 18px;
@@ -43,8 +43,15 @@ 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
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组、描述+link) */
54
+ titleActions?: ReactNode;
48
55
  /** 统计卡片区配置(不传则不渲染卡片区) */
49
56
  statisticCards?: StatisticCardConfig[];
50
57
  /** 顶部搜索框占位符 */
@@ -75,6 +75,8 @@ var StatisticsListPage = (props) => {
75
75
  const {
76
76
  title = "统计列表",
77
77
  titleSuffix,
78
+ titleExtra,
79
+ titleActions,
78
80
  statisticCards,
79
81
  searchPlaceholder = "请输入",
80
82
  searchKey = "keyword",
@@ -262,10 +264,11 @@ var StatisticsListPage = (props) => {
262
264
  import_shared_components.PageTitle,
263
265
  {
264
266
  title,
265
- titleSuffix: titleSuffix ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
267
+ titleExtra: titleExtra ?? (titleSuffix ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
266
268
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "slp-divider" }),
267
269
  titleSuffix
268
- ] }) : void 0
270
+ ] }) : void 0),
271
+ actions: titleActions
269
272
  }
270
273
  ),
271
274
  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: [
@@ -13,4 +13,17 @@ export var CompanyTypography = function CompanyTypography(props) {
13
13
  theme: companyTheme,
14
14
  children: /*#__PURE__*/_jsx(AntdTypography, _objectSpread({}, props))
15
15
  });
16
- };
16
+ };
17
+ var withTheme = function withTheme(Comp) {
18
+ var Wrapped = function Wrapped(props) {
19
+ return /*#__PURE__*/_jsx(ConfigProvider, {
20
+ theme: companyTheme,
21
+ children: /*#__PURE__*/_jsx(Comp, _objectSpread({}, props))
22
+ });
23
+ };
24
+ return Wrapped;
25
+ };
26
+ CompanyTypography.Link = withTheme(AntdTypography.Link);
27
+ CompanyTypography.Text = withTheme(AntdTypography.Text);
28
+ CompanyTypography.Title = withTheme(AntdTypography.Title);
29
+ CompanyTypography.Paragraph = withTheme(AntdTypography.Paragraph);
@@ -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,
@@ -237,7 +239,7 @@ export default function SmartListTemplate(_ref) {
237
239
  }, [fields]);
238
240
  var displayFilterItems = useMemo(function () {
239
241
  var filteredFields = fields.filter(function (field) {
240
- return !nonBusinessFields.includes(field.key);
242
+ return !nonBusinessFields.includes(field.key) && !field.hideInFilter;
241
243
  });
242
244
  if (!currentScheme || currentScheme === 'default') {
243
245
  return filteredFields.map(function (f) {
@@ -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,6 +46,14 @@
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
59
  height: 18px;
@@ -43,8 +43,15 @@ 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
+ /** 标题栏最右侧的独立操作区:与标题解耦(如按钮组、描述+link) */
54
+ titleActions?: ReactNode;
48
55
  /** 统计卡片区配置(不传则不渲染卡片区) */
49
56
  statisticCards?: StatisticCardConfig[];
50
57
  /** 顶部搜索框占位符 */
@@ -101,6 +101,8 @@ export var StatisticsListPage = function StatisticsListPage(props) {
101
101
  var _props$title = props.title,
102
102
  title = _props$title === void 0 ? '统计列表' : _props$title,
103
103
  titleSuffix = props.titleSuffix,
104
+ titleExtra = props.titleExtra,
105
+ titleActions = props.titleActions,
104
106
  statisticCards = props.statisticCards,
105
107
  _props$searchPlacehol = props.searchPlaceholder,
106
108
  searchPlaceholder = _props$searchPlacehol === void 0 ? '请输入' : _props$searchPlacehol,
@@ -388,11 +390,12 @@ export var StatisticsListPage = function StatisticsListPage(props) {
388
390
  className: "statistics-list-page".concat(className ? " ".concat(className) : ''),
389
391
  children: [/*#__PURE__*/_jsx(PageTitle, {
390
392
  title: title,
391
- titleSuffix: titleSuffix ? /*#__PURE__*/_jsxs(_Fragment, {
393
+ titleExtra: titleExtra !== null && titleExtra !== void 0 ? titleExtra : titleSuffix ? /*#__PURE__*/_jsxs(_Fragment, {
392
394
  children: [/*#__PURE__*/_jsx("span", {
393
395
  className: "slp-divider"
394
396
  }), titleSuffix]
395
- }) : undefined
397
+ }) : undefined,
398
+ actions: titleActions
396
399
  }), statisticCards && statisticCards.length > 0 && /*#__PURE__*/_jsx("div", {
397
400
  className: "slp-statistics",
398
401
  children: statisticCards.map(function (card) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donglegeyu/company-ui",
3
- "version": "1.2.22",
3
+ "version": "1.2.24",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/es/index.js",
6
6
  "types": "dist/es/index.d.ts",