@donglegeyu/company-ui 2.11.0 → 2.12.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/shared-components/PageTitleActions/index.d.ts +55 -0
- package/dist/cjs/shared-components/PageTitleActions/index.js +82 -0
- package/dist/cjs/shared-components/PageTitleActions/index.scss +20 -0
- package/dist/cjs/shared-components/index.d.ts +2 -0
- package/dist/cjs/shared-components/index.js +3 -0
- package/dist/cjs/template-components/SmartListTemplate/index.d.ts +9 -1
- package/dist/cjs/template-components/SmartListTemplate/index.js +31 -26
- package/dist/cjs/template-components/SmartListTemplate/index.scss +19 -46
- package/dist/es/shared-components/PageTitleActions/index.d.ts +55 -0
- package/dist/es/shared-components/PageTitleActions/index.js +90 -0
- package/dist/es/shared-components/PageTitleActions/index.scss +20 -0
- package/dist/es/shared-components/index.d.ts +2 -0
- package/dist/es/shared-components/index.js +1 -0
- package/dist/es/template-components/SmartListTemplate/index.d.ts +9 -1
- package/dist/es/template-components/SmartListTemplate/index.js +26 -31
- package/dist/es/template-components/SmartListTemplate/index.scss +19 -46
- package/package.json +2 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PageTitleActions —— 页面标题右侧操作区
|
|
3
|
+
*
|
|
4
|
+
* 将「描述文字 + 链接 + 按钮」这类高频组合收敛为组件:
|
|
5
|
+
* 描述文字三级文本色、链接主色均已内置,业务侧无需每次手写样式描述。
|
|
6
|
+
*/
|
|
7
|
+
import { type CSSProperties, type HTMLAttributeAnchorTarget, type MouseEvent, type ReactNode } from "react";
|
|
8
|
+
import "./index.scss";
|
|
9
|
+
/** 操作区里的描述文字(三级文本色,与标题形成视觉层级) */
|
|
10
|
+
export interface PageTitleActionTextProps {
|
|
11
|
+
/** 文字内容 */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** 自定义样式(默认三级文本色,可覆盖) */
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
/** 自定义类名 */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/** 操作区里的链接(主色文字,区分于描述文字) */
|
|
19
|
+
export interface PageTitleActionLinkProps {
|
|
20
|
+
/** 链接文字 */
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/** 跳转地址;不传则仅渲染文字(配合 onClick 做站内路由跳转) */
|
|
23
|
+
href?: string;
|
|
24
|
+
/** 打开方式(如新标签页 `_blank`) */
|
|
25
|
+
target?: HTMLAttributeAnchorTarget;
|
|
26
|
+
/** 点击回调(站内路由跳转时传) */
|
|
27
|
+
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
|
|
28
|
+
/** 自定义样式(默认主色,可覆盖) */
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
/** 自定义类名 */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface PageTitleActionsProps {
|
|
34
|
+
/** 操作区内容:PageTitleActions.Text / PageTitleActions.Link / CompanyButton 等任意节点 */
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
/** 自定义样式 */
|
|
37
|
+
style?: CSSProperties;
|
|
38
|
+
/** 自定义类名 */
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/** 描述文字子组件:三级文本色 */
|
|
42
|
+
declare function ActionText({ children, style, className }: PageTitleActionTextProps): import("react").JSX.Element;
|
|
43
|
+
/** 链接子组件:主色文字;href + target 走外链(新标签页),仅 onClick 走站内路由 */
|
|
44
|
+
declare function ActionLink({ children, href, target, onClick, style, className, }: PageTitleActionLinkProps): import("react").JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* 页面标题右侧操作区。
|
|
47
|
+
* 裸字符串 / 数字子元素自动按描述文字样式(三级文本色)渲染,
|
|
48
|
+
* 免去每次手写 style 描述;Text / Link / 按钮等节点原样透出,不注入额外样式。
|
|
49
|
+
*/
|
|
50
|
+
declare function PageTitleActions({ children, style, className }: PageTitleActionsProps): import("react").JSX.Element;
|
|
51
|
+
declare const PageTitleActionsWithStatics: typeof PageTitleActions & {
|
|
52
|
+
Text: typeof ActionText;
|
|
53
|
+
Link: typeof ActionLink;
|
|
54
|
+
};
|
|
55
|
+
export default PageTitleActionsWithStatics;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/shared-components/PageTitleActions/index.tsx
|
|
20
|
+
var PageTitleActions_exports = {};
|
|
21
|
+
__export(PageTitleActions_exports, {
|
|
22
|
+
default: () => PageTitleActions_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(PageTitleActions_exports);
|
|
25
|
+
var import_index = require("./index.scss");
|
|
26
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
+
function ActionText({ children, style, className }) {
|
|
28
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `page-title-action-text${className ? ` ${className}` : ""}`, style, children });
|
|
29
|
+
}
|
|
30
|
+
function ActionLink({
|
|
31
|
+
children,
|
|
32
|
+
href,
|
|
33
|
+
target,
|
|
34
|
+
onClick,
|
|
35
|
+
style,
|
|
36
|
+
className
|
|
37
|
+
}) {
|
|
38
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
"a",
|
|
40
|
+
{
|
|
41
|
+
className: `page-title-action-link${className ? ` ${className}` : ""}`,
|
|
42
|
+
href,
|
|
43
|
+
target,
|
|
44
|
+
onClick,
|
|
45
|
+
style,
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function PageTitleActions({ children, style, className }) {
|
|
51
|
+
const childList = children === null || children === void 0 ? [] : Array.isArray(children) ? children : [children];
|
|
52
|
+
const items = [];
|
|
53
|
+
let textBuffer = [];
|
|
54
|
+
let wrappedCount = 0;
|
|
55
|
+
const flushText = () => {
|
|
56
|
+
if (textBuffer.length > 0) {
|
|
57
|
+
items.push(
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "page-title-action-text", children: textBuffer }, `text-${wrappedCount}`)
|
|
59
|
+
);
|
|
60
|
+
textBuffer = [];
|
|
61
|
+
wrappedCount += 1;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
childList.forEach((child) => {
|
|
65
|
+
if (child === null || child === void 0 || child === false || child === true) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
69
|
+
textBuffer.push(child);
|
|
70
|
+
} else {
|
|
71
|
+
flushText();
|
|
72
|
+
items.push(child);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
flushText();
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `page-title-actions-group${className ? ` ${className}` : ""}`, style, children: items });
|
|
77
|
+
}
|
|
78
|
+
var PageTitleActionsWithStatics = Object.assign(PageTitleActions, {
|
|
79
|
+
Text: ActionText,
|
|
80
|
+
Link: ActionLink
|
|
81
|
+
});
|
|
82
|
+
var PageTitleActions_default = PageTitleActionsWithStatics;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.page-title-actions-group {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.page-title-action-text {
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
font-weight: normal;
|
|
11
|
+
color: var(--color-text-tertiary);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.page-title-action-link {
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-weight: normal;
|
|
17
|
+
color: var(--color-primary);
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
}
|
|
@@ -2,6 +2,8 @@ export { default as SvgIcon } from "./SvgIcon";
|
|
|
2
2
|
export { default as ActionCell } from "./ActionCell";
|
|
3
3
|
export type { ActionButton } from "./ActionCell";
|
|
4
4
|
export { default as PageTitle } from "./PageTitle";
|
|
5
|
+
export { default as PageTitleActions } from "./PageTitleActions";
|
|
6
|
+
export type { PageTitleActionsProps, PageTitleActionTextProps, PageTitleActionLinkProps, } from "./PageTitleActions";
|
|
5
7
|
export { default as FormFooterActions } from "./FormFooterActions";
|
|
6
8
|
export { default as SectionTitle } from "./SectionTitle";
|
|
7
9
|
export { default as BaseInfoForm } from "./BaseInfoForm";
|
|
@@ -40,6 +40,7 @@ __export(shared_components_exports, {
|
|
|
40
40
|
IconGallery: () => import_IconGallery.default,
|
|
41
41
|
IconParkGallery: () => import_IconParkGallery.default,
|
|
42
42
|
PageTitle: () => import_PageTitle.default,
|
|
43
|
+
PageTitleActions: () => import_PageTitleActions.default,
|
|
43
44
|
SectionTitle: () => import_SectionTitle.default,
|
|
44
45
|
SvgIcon: () => import_SvgIcon.default,
|
|
45
46
|
ViewSwitcher: () => import_ViewSwitcher.default,
|
|
@@ -49,6 +50,7 @@ module.exports = __toCommonJS(shared_components_exports);
|
|
|
49
50
|
var import_SvgIcon = __toESM(require("./SvgIcon"));
|
|
50
51
|
var import_ActionCell = __toESM(require("./ActionCell"));
|
|
51
52
|
var import_PageTitle = __toESM(require("./PageTitle"));
|
|
53
|
+
var import_PageTitleActions = __toESM(require("./PageTitleActions"));
|
|
52
54
|
var import_FormFooterActions = __toESM(require("./FormFooterActions"));
|
|
53
55
|
var import_SectionTitle = __toESM(require("./SectionTitle"));
|
|
54
56
|
var import_BaseInfoForm = __toESM(require("./BaseInfoForm"));
|
|
@@ -74,6 +76,7 @@ var import_useIconPark = require("./IconParkGallery/useIconPark");
|
|
|
74
76
|
IconGallery,
|
|
75
77
|
IconParkGallery,
|
|
76
78
|
PageTitle,
|
|
79
|
+
PageTitleActions,
|
|
77
80
|
SectionTitle,
|
|
78
81
|
SvgIcon,
|
|
79
82
|
ViewSwitcher,
|
|
@@ -34,10 +34,18 @@ interface SmartListTemplateProps {
|
|
|
34
34
|
record: RecordType;
|
|
35
35
|
expandedRowKeys: string[];
|
|
36
36
|
}) => void;
|
|
37
|
+
/**
|
|
38
|
+
* 标题右侧操作区:渲染在视图切换器之后,与其同处标题右侧区域
|
|
39
|
+
* (内部映射到 `PageTitle.titleExtra` 的尾部,保持既有位置)。
|
|
40
|
+
* 后续版本将收敛到 `titleExtra`,新代码建议直接使用 `titleExtra`。
|
|
41
|
+
*/
|
|
37
42
|
titleActions?: ReactNode;
|
|
38
43
|
/** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
|
|
39
44
|
titleExtra?: ReactNode;
|
|
40
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* 标题栏最右侧的独立操作区:与标题解耦(如按钮组、描述+link)
|
|
47
|
+
* (内部映射到 `PageTitle.actions`)。
|
|
48
|
+
*/
|
|
41
49
|
titleRightActions?: ReactNode;
|
|
42
50
|
toolbarActions?: ReactNode;
|
|
43
51
|
toolbarRightActions?: ReactNode;
|
|
@@ -365,7 +365,7 @@ function SmartListTemplate({
|
|
|
365
365
|
}, [effectiveFilterParams, isRecordingBaseline, hasSearched, initializedFilterParams]);
|
|
366
366
|
const updateTableHeight = (0, import_react.useCallback)(() => {
|
|
367
367
|
var _a, _b, _c, _d, _e;
|
|
368
|
-
const header = ((_a = document.querySelector(".page-
|
|
368
|
+
const header = ((_a = document.querySelector(".smart-list-template .page-title")) == null ? void 0 : _a.clientHeight) || 0;
|
|
369
369
|
const filter = ((_b = document.querySelector(".filter-form")) == null ? void 0 : _b.clientHeight) || 0;
|
|
370
370
|
const toolbar = ((_c = document.querySelector(".toolbar")) == null ? void 0 : _c.clientHeight) || 0;
|
|
371
371
|
const paginationEl = ((_d = document.querySelector(".pagination")) == null ? void 0 : _d.clientHeight) || 56;
|
|
@@ -392,31 +392,36 @@ function SmartListTemplate({
|
|
|
392
392
|
};
|
|
393
393
|
}, [pagination, paginationConfig]);
|
|
394
394
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "smart-list-template", children: [
|
|
395
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
395
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
396
|
+
import_shared_components.PageTitle,
|
|
397
|
+
{
|
|
398
|
+
title,
|
|
399
|
+
titleExtra: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "sl-title-extra", children: [
|
|
400
|
+
titleExtra,
|
|
401
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "sl-title-actions", children: [
|
|
402
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sl-title-divider" }),
|
|
403
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
404
|
+
import_shared_components.ViewSwitcher,
|
|
405
|
+
{
|
|
406
|
+
viewEndpoint,
|
|
407
|
+
fields,
|
|
408
|
+
filterParams: effectiveFilterParams,
|
|
409
|
+
modified: hasModified,
|
|
410
|
+
searched: hasSearched,
|
|
411
|
+
onSchemeChange: handleViewSchemeChange,
|
|
412
|
+
onCurrentSchemeChange: setCurrentScheme,
|
|
413
|
+
onSchemesChange: setFilterSchemes,
|
|
414
|
+
onEditScheme: updateFilterParams,
|
|
415
|
+
onSaved: handleViewSaved,
|
|
416
|
+
onSaveAsOpen: handleViewSaveAsOpen
|
|
417
|
+
}
|
|
418
|
+
),
|
|
419
|
+
titleActions
|
|
420
|
+
] })
|
|
421
|
+
] }),
|
|
422
|
+
actions: titleRightActions
|
|
423
|
+
}
|
|
424
|
+
),
|
|
420
425
|
displayFilterItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
421
426
|
import_FilterForm.default,
|
|
422
427
|
{
|
|
@@ -9,55 +9,28 @@
|
|
|
9
9
|
overflow: hidden;
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
background: var(--color-bg-layout);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.page-header {
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
height: 48px;
|
|
18
|
-
padding: 0;
|
|
19
|
-
gap: 16px;
|
|
20
|
-
align-self: stretch;
|
|
21
|
-
z-index: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.page-title {
|
|
25
|
-
font-size: 16px;
|
|
26
|
-
font-weight: 600;
|
|
27
|
-
color: rgba(0, 0, 0, 0.88);
|
|
28
|
-
margin: 0;
|
|
29
|
-
line-height: 24px;
|
|
30
|
-
}
|
|
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
12
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
13
|
+
// 标题右侧区域:标题 → 分割线 → 视图切换 → titleActions
|
|
14
|
+
// PageTitle 的 .page-title-left 已有 gap:8px,此处补 8px margin-left 凑齐 16px(与 StatisticsListPage/TreeTableTemplate 一致)
|
|
15
|
+
.sl-title-extra {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: calc(var(--spacing-md, 16) * 1px);
|
|
19
|
+
margin-left: calc(var(--spacing-xs, 8) * 1px);
|
|
20
|
+
}
|
|
48
21
|
|
|
49
|
-
.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
22
|
+
.sl-title-actions {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: calc(var(--spacing-sm, 12) * 1px);
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
}
|
|
56
28
|
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
29
|
+
.sl-title-divider {
|
|
30
|
+
width: 1px;
|
|
31
|
+
height: 16px;
|
|
32
|
+
background-color: var(--color-border);
|
|
33
|
+
}
|
|
61
34
|
}
|
|
62
35
|
|
|
63
36
|
.filter-gap {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PageTitleActions —— 页面标题右侧操作区
|
|
3
|
+
*
|
|
4
|
+
* 将「描述文字 + 链接 + 按钮」这类高频组合收敛为组件:
|
|
5
|
+
* 描述文字三级文本色、链接主色均已内置,业务侧无需每次手写样式描述。
|
|
6
|
+
*/
|
|
7
|
+
import { type CSSProperties, type HTMLAttributeAnchorTarget, type MouseEvent, type ReactNode } from "react";
|
|
8
|
+
import "./index.scss";
|
|
9
|
+
/** 操作区里的描述文字(三级文本色,与标题形成视觉层级) */
|
|
10
|
+
export interface PageTitleActionTextProps {
|
|
11
|
+
/** 文字内容 */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** 自定义样式(默认三级文本色,可覆盖) */
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
/** 自定义类名 */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/** 操作区里的链接(主色文字,区分于描述文字) */
|
|
19
|
+
export interface PageTitleActionLinkProps {
|
|
20
|
+
/** 链接文字 */
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/** 跳转地址;不传则仅渲染文字(配合 onClick 做站内路由跳转) */
|
|
23
|
+
href?: string;
|
|
24
|
+
/** 打开方式(如新标签页 `_blank`) */
|
|
25
|
+
target?: HTMLAttributeAnchorTarget;
|
|
26
|
+
/** 点击回调(站内路由跳转时传) */
|
|
27
|
+
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
|
|
28
|
+
/** 自定义样式(默认主色,可覆盖) */
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
/** 自定义类名 */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface PageTitleActionsProps {
|
|
34
|
+
/** 操作区内容:PageTitleActions.Text / PageTitleActions.Link / CompanyButton 等任意节点 */
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
/** 自定义样式 */
|
|
37
|
+
style?: CSSProperties;
|
|
38
|
+
/** 自定义类名 */
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/** 描述文字子组件:三级文本色 */
|
|
42
|
+
declare function ActionText({ children, style, className }: PageTitleActionTextProps): import("react").JSX.Element;
|
|
43
|
+
/** 链接子组件:主色文字;href + target 走外链(新标签页),仅 onClick 走站内路由 */
|
|
44
|
+
declare function ActionLink({ children, href, target, onClick, style, className, }: PageTitleActionLinkProps): import("react").JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* 页面标题右侧操作区。
|
|
47
|
+
* 裸字符串 / 数字子元素自动按描述文字样式(三级文本色)渲染,
|
|
48
|
+
* 免去每次手写 style 描述;Text / Link / 按钮等节点原样透出,不注入额外样式。
|
|
49
|
+
*/
|
|
50
|
+
declare function PageTitleActions({ children, style, className }: PageTitleActionsProps): import("react").JSX.Element;
|
|
51
|
+
declare const PageTitleActionsWithStatics: typeof PageTitleActions & {
|
|
52
|
+
Text: typeof ActionText;
|
|
53
|
+
Link: typeof ActionLink;
|
|
54
|
+
};
|
|
55
|
+
export default PageTitleActionsWithStatics;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PageTitleActions —— 页面标题右侧操作区
|
|
3
|
+
*
|
|
4
|
+
* 将「描述文字 + 链接 + 按钮」这类高频组合收敛为组件:
|
|
5
|
+
* 描述文字三级文本色、链接主色均已内置,业务侧无需每次手写样式描述。
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import "./index.scss";
|
|
9
|
+
|
|
10
|
+
/** 操作区里的描述文字(三级文本色,与标题形成视觉层级) */
|
|
11
|
+
|
|
12
|
+
/** 操作区里的链接(主色文字,区分于描述文字) */
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
/** 描述文字子组件:三级文本色 */
|
|
15
|
+
function ActionText(_ref) {
|
|
16
|
+
var children = _ref.children,
|
|
17
|
+
style = _ref.style,
|
|
18
|
+
className = _ref.className;
|
|
19
|
+
return /*#__PURE__*/_jsx("span", {
|
|
20
|
+
className: "page-title-action-text".concat(className ? " ".concat(className) : ""),
|
|
21
|
+
style: style,
|
|
22
|
+
children: children
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** 链接子组件:主色文字;href + target 走外链(新标签页),仅 onClick 走站内路由 */
|
|
27
|
+
function ActionLink(_ref2) {
|
|
28
|
+
var children = _ref2.children,
|
|
29
|
+
href = _ref2.href,
|
|
30
|
+
target = _ref2.target,
|
|
31
|
+
onClick = _ref2.onClick,
|
|
32
|
+
style = _ref2.style,
|
|
33
|
+
className = _ref2.className;
|
|
34
|
+
return /*#__PURE__*/_jsx("a", {
|
|
35
|
+
className: "page-title-action-link".concat(className ? " ".concat(className) : ""),
|
|
36
|
+
href: href,
|
|
37
|
+
target: target,
|
|
38
|
+
onClick: onClick,
|
|
39
|
+
style: style,
|
|
40
|
+
children: children
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 页面标题右侧操作区。
|
|
46
|
+
* 裸字符串 / 数字子元素自动按描述文字样式(三级文本色)渲染,
|
|
47
|
+
* 免去每次手写 style 描述;Text / Link / 按钮等节点原样透出,不注入额外样式。
|
|
48
|
+
*/
|
|
49
|
+
function PageTitleActions(_ref3) {
|
|
50
|
+
var children = _ref3.children,
|
|
51
|
+
style = _ref3.style,
|
|
52
|
+
className = _ref3.className;
|
|
53
|
+
var childList = children === null || children === undefined ? [] : Array.isArray(children) ? children : [children];
|
|
54
|
+
var items = [];
|
|
55
|
+
var textBuffer = [];
|
|
56
|
+
var wrappedCount = 0;
|
|
57
|
+
var flushText = function flushText() {
|
|
58
|
+
if (textBuffer.length > 0) {
|
|
59
|
+
items.push( /*#__PURE__*/_jsx("span", {
|
|
60
|
+
className: "page-title-action-text",
|
|
61
|
+
children: textBuffer
|
|
62
|
+
}, "text-".concat(wrappedCount)));
|
|
63
|
+
textBuffer = [];
|
|
64
|
+
wrappedCount += 1;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
childList.forEach(function (child) {
|
|
68
|
+
// 空节点跳过;裸字符串/数字兜底按描述文字渲染;其余节点(Text/Link/按钮等)原样透出
|
|
69
|
+
if (child === null || child === undefined || child === false || child === true) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
73
|
+
textBuffer.push(child);
|
|
74
|
+
} else {
|
|
75
|
+
flushText();
|
|
76
|
+
items.push(child);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
flushText();
|
|
80
|
+
return /*#__PURE__*/_jsx("div", {
|
|
81
|
+
className: "page-title-actions-group".concat(className ? " ".concat(className) : ""),
|
|
82
|
+
style: style,
|
|
83
|
+
children: items
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
var PageTitleActionsWithStatics = Object.assign(PageTitleActions, {
|
|
87
|
+
Text: ActionText,
|
|
88
|
+
Link: ActionLink
|
|
89
|
+
});
|
|
90
|
+
export default PageTitleActionsWithStatics;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.page-title-actions-group {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.page-title-action-text {
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
font-weight: normal;
|
|
11
|
+
color: var(--color-text-tertiary);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.page-title-action-link {
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-weight: normal;
|
|
17
|
+
color: var(--color-primary);
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
}
|
|
@@ -2,6 +2,8 @@ export { default as SvgIcon } from "./SvgIcon";
|
|
|
2
2
|
export { default as ActionCell } from "./ActionCell";
|
|
3
3
|
export type { ActionButton } from "./ActionCell";
|
|
4
4
|
export { default as PageTitle } from "./PageTitle";
|
|
5
|
+
export { default as PageTitleActions } from "./PageTitleActions";
|
|
6
|
+
export type { PageTitleActionsProps, PageTitleActionTextProps, PageTitleActionLinkProps, } from "./PageTitleActions";
|
|
5
7
|
export { default as FormFooterActions } from "./FormFooterActions";
|
|
6
8
|
export { default as SectionTitle } from "./SectionTitle";
|
|
7
9
|
export { default as BaseInfoForm } from "./BaseInfoForm";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as SvgIcon } from "./SvgIcon";
|
|
2
2
|
export { default as ActionCell } from "./ActionCell";
|
|
3
3
|
export { default as PageTitle } from "./PageTitle";
|
|
4
|
+
export { default as PageTitleActions } from "./PageTitleActions";
|
|
4
5
|
export { default as FormFooterActions } from "./FormFooterActions";
|
|
5
6
|
export { default as SectionTitle } from "./SectionTitle";
|
|
6
7
|
export { default as BaseInfoForm } from "./BaseInfoForm";
|
|
@@ -34,10 +34,18 @@ interface SmartListTemplateProps {
|
|
|
34
34
|
record: RecordType;
|
|
35
35
|
expandedRowKeys: string[];
|
|
36
36
|
}) => void;
|
|
37
|
+
/**
|
|
38
|
+
* 标题右侧操作区:渲染在视图切换器之后,与其同处标题右侧区域
|
|
39
|
+
* (内部映射到 `PageTitle.titleExtra` 的尾部,保持既有位置)。
|
|
40
|
+
* 后续版本将收敛到 `titleExtra`,新代码建议直接使用 `titleExtra`。
|
|
41
|
+
*/
|
|
37
42
|
titleActions?: ReactNode;
|
|
38
43
|
/** 紧跟标题右侧的区域:标题的延伸/补充(如状态标签、计数) */
|
|
39
44
|
titleExtra?: ReactNode;
|
|
40
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* 标题栏最右侧的独立操作区:与标题解耦(如按钮组、描述+link)
|
|
47
|
+
* (内部映射到 `PageTitle.actions`)。
|
|
48
|
+
*/
|
|
41
49
|
titleRightActions?: ReactNode;
|
|
42
50
|
toolbarActions?: ReactNode;
|
|
43
51
|
toolbarRightActions?: ReactNode;
|
|
@@ -19,7 +19,7 @@ import { CompanyTable, CompanyButton, CompanyPagination, CompanyDropdown, Compan
|
|
|
19
19
|
import { ConfigProvider } from "antd";
|
|
20
20
|
import zhCN from "antd/locale/zh_CN";
|
|
21
21
|
import FilterForm from "../FilterForm";
|
|
22
|
-
import { SvgIcon, EllipsisText, ViewSwitcher } from "../../shared-components";
|
|
22
|
+
import { SvgIcon, EllipsisText, ViewSwitcher, PageTitle } from "../../shared-components";
|
|
23
23
|
import { createActionColumn, DENSITY_CELL_PADDING, TABLE_CELL_INLINE_PADDING } from "../../shared-components/tableActionColumn";
|
|
24
24
|
import ColumnSettingsPanel from "../ColumnSettingsPanel";
|
|
25
25
|
import "./index.scss";
|
|
@@ -425,7 +425,7 @@ export default function SmartListTemplate(_ref) {
|
|
|
425
425
|
}, [effectiveFilterParams, isRecordingBaseline, hasSearched, initializedFilterParams]);
|
|
426
426
|
var updateTableHeight = useCallback(function () {
|
|
427
427
|
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5;
|
|
428
|
-
var header = ((_document$querySelect = document.querySelector(".page-
|
|
428
|
+
var header = ((_document$querySelect = document.querySelector(".smart-list-template .page-title")) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientHeight) || 0;
|
|
429
429
|
var filter = ((_document$querySelect2 = document.querySelector(".filter-form")) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.clientHeight) || 0;
|
|
430
430
|
var toolbar = ((_document$querySelect3 = document.querySelector(".toolbar")) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.clientHeight) || 0;
|
|
431
431
|
var paginationEl = ((_document$querySelect4 = document.querySelector(".pagination")) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.clientHeight) || 56;
|
|
@@ -457,35 +457,30 @@ export default function SmartListTemplate(_ref) {
|
|
|
457
457
|
}, [pagination, paginationConfig]);
|
|
458
458
|
return /*#__PURE__*/_jsxs("div", {
|
|
459
459
|
className: "smart-list-template",
|
|
460
|
-
children: [/*#__PURE__*/
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
className: "
|
|
464
|
-
children:
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}), titleActions]
|
|
485
|
-
}), titleRightActions && /*#__PURE__*/_jsx("div", {
|
|
486
|
-
className: "page-header-right",
|
|
487
|
-
children: titleRightActions
|
|
488
|
-
})]
|
|
460
|
+
children: [/*#__PURE__*/_jsx(PageTitle, {
|
|
461
|
+
title: title,
|
|
462
|
+
titleExtra: /*#__PURE__*/_jsxs("span", {
|
|
463
|
+
className: "sl-title-extra",
|
|
464
|
+
children: [titleExtra, /*#__PURE__*/_jsxs("span", {
|
|
465
|
+
className: "sl-title-actions",
|
|
466
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
467
|
+
className: "sl-title-divider"
|
|
468
|
+
}), /*#__PURE__*/_jsx(ViewSwitcher, {
|
|
469
|
+
viewEndpoint: viewEndpoint,
|
|
470
|
+
fields: fields,
|
|
471
|
+
filterParams: effectiveFilterParams,
|
|
472
|
+
modified: hasModified,
|
|
473
|
+
searched: hasSearched,
|
|
474
|
+
onSchemeChange: handleViewSchemeChange,
|
|
475
|
+
onCurrentSchemeChange: setCurrentScheme,
|
|
476
|
+
onSchemesChange: setFilterSchemes,
|
|
477
|
+
onEditScheme: updateFilterParams,
|
|
478
|
+
onSaved: handleViewSaved,
|
|
479
|
+
onSaveAsOpen: handleViewSaveAsOpen
|
|
480
|
+
}), titleActions]
|
|
481
|
+
})]
|
|
482
|
+
}),
|
|
483
|
+
actions: titleRightActions
|
|
489
484
|
}), displayFilterItems.length > 0 && /*#__PURE__*/_jsx(FilterForm, {
|
|
490
485
|
modelValue: effectiveFilterParams,
|
|
491
486
|
items: displayFilterItems,
|
|
@@ -9,55 +9,28 @@
|
|
|
9
9
|
overflow: hidden;
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
background: var(--color-bg-layout);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.page-header {
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
height: 48px;
|
|
18
|
-
padding: 0;
|
|
19
|
-
gap: 16px;
|
|
20
|
-
align-self: stretch;
|
|
21
|
-
z-index: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.page-title {
|
|
25
|
-
font-size: 16px;
|
|
26
|
-
font-weight: 600;
|
|
27
|
-
color: rgba(0, 0, 0, 0.88);
|
|
28
|
-
margin: 0;
|
|
29
|
-
line-height: 24px;
|
|
30
|
-
}
|
|
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
12
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
13
|
+
// 标题右侧区域:标题 → 分割线 → 视图切换 → titleActions
|
|
14
|
+
// PageTitle 的 .page-title-left 已有 gap:8px,此处补 8px margin-left 凑齐 16px(与 StatisticsListPage/TreeTableTemplate 一致)
|
|
15
|
+
.sl-title-extra {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: calc(var(--spacing-md, 16) * 1px);
|
|
19
|
+
margin-left: calc(var(--spacing-xs, 8) * 1px);
|
|
20
|
+
}
|
|
48
21
|
|
|
49
|
-
.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
22
|
+
.sl-title-actions {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: calc(var(--spacing-sm, 12) * 1px);
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
}
|
|
56
28
|
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
29
|
+
.sl-title-divider {
|
|
30
|
+
width: 1px;
|
|
31
|
+
height: 16px;
|
|
32
|
+
background-color: var(--color-border);
|
|
33
|
+
}
|
|
61
34
|
}
|
|
62
35
|
|
|
63
36
|
.filter-gap {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donglegeyu/company-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/es/index.js",
|
|
6
6
|
"types": "dist/es/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"postpublish": "node scripts/postpublish.mjs",
|
|
41
41
|
"release:patch": "npm version patch && npm publish",
|
|
42
42
|
"verify:no-danger-delete": "node scripts/verify-no-danger-delete.mjs",
|
|
43
|
-
"verify:skill-examples": "node scripts/verify-skill-examples.mjs && node scripts/verify-no-danger-delete.mjs"
|
|
43
|
+
"verify:skill-examples": "node scripts/verify-llms-coverage.mjs && node scripts/verify-skill-examples.mjs && node scripts/verify-skill-facts.mjs && node scripts/verify-no-danger-delete.mjs"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"antd",
|