@yoka-ui/ui 1.1.4 → 1.1.5
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/@Docs-yoka/exports.generated.md +3 -3
- package/dist/es/assets/image/skills.zip +0 -0
- package/dist/es/index.less +1 -0
- package/dist/es/layout/YkContainer/index.d.ts +24 -14
- package/dist/es/layout/YkContainer/index.js +7 -41
- package/dist/es/layout/YkContainer/index.js.map +2 -2
- package/dist/es/layout/YkContainer/index.module.less +73 -0
- package/dist/lib/assets/image/skills.zip +0 -0
- package/dist/lib/index.less +1 -0
- package/dist/lib/layout/YkContainer/index.d.ts +24 -14
- package/dist/lib/layout/YkContainer/index.js +6 -39
- package/dist/lib/layout/YkContainer/index.js.map +3 -3
- package/dist/lib/layout/YkContainer/index.module.less +73 -0
- package/package.json +6 -10
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# @yoka-ui/ui 具名导出表
|
|
2
2
|
|
|
3
3
|
> **自动生成**:`pnpm run generate:yoka-llms`(源文件 `src/index.tsx`)
|
|
4
|
-
> **包版本**:`1.1.
|
|
5
|
-
> **生成时间**:`2026-06-
|
|
4
|
+
> **包版本**:`1.1.5`
|
|
5
|
+
> **生成时间**:`2026-06-05T12:32:42.007Z`
|
|
6
6
|
> 请勿手动编辑本文件;修改导出请改 `src/index.tsx` 后重新运行上述命令。
|
|
7
7
|
|
|
8
8
|
## 使用约定(给 LLM / 业务开发者)
|
|
9
9
|
|
|
10
|
-
- **包名**:`@yoka-ui/ui`(npm 公网);可选 Git 安装:`@yoka-ui/ui`: `git+http://gitlab.sh.com/web/yoka-ui.git#v1.1.
|
|
10
|
+
- **包名**:`@yoka-ui/ui`(npm 公网);可选 Git 安装:`@yoka-ui/ui`: `git+http://gitlab.sh.com/web/yoka-ui.git#v1.1.5` 等,以实际 tag 为准
|
|
11
11
|
- **导入**:仅使用下表中的**具名**导出(组件/值与 `export type` 类型),与发布产物 `dist/es/index.d.ts` 一致;勿臆造未列出符号。
|
|
12
12
|
- **全局样式(常用)**:业务入口引入一行,例如 `import '@yoka-ui/ui/dist/index.less'`(若以 README / 实际产物路径为准)。
|
|
13
13
|
- **技术栈**:React 18、Ant Design 5;复杂表单/表格优先使用库内封装(`InputTheme`、`TableTheme`、`ModCommonFilter` 等),需要原生 antd API 时查阅 [Ant Design 文档](https://ant.design) 或本仓库 `@Docs/llms.txt`(克隆源码时可用)。
|
|
Binary file
|
package/dist/es/index.less
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
@import "../../src/creative/ButtonWithProgress/index.less";
|
|
35
35
|
@import "../../src/creative/GlassSegmentedRadio/index.module.less";
|
|
36
36
|
@import "../../src/creative/SkillsWriter/index.module.less";
|
|
37
|
+
@import "../../src/layout/YkContainer/index.module.less";
|
|
37
38
|
@import "../../src/layout/YkDrawer/index.module.less";
|
|
38
39
|
@import "../../src/Themes/TableTheme/index.less";
|
|
39
40
|
@import "../../src/ui/LogicOperator/index.module.less";
|
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
export type YkContainerProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {
|
|
3
|
-
/**
|
|
3
|
+
/** 页头左侧主标题,字号18px、#3b82fe;headerLeft存在时不展示title与subTitle */
|
|
4
4
|
title?: React.ReactNode;
|
|
5
|
-
/**
|
|
5
|
+
/** 页头左侧二级副标题,与title同行、下边线对齐;headerLeft优先级更高 */
|
|
6
|
+
subTitle?: React.ReactNode;
|
|
7
|
+
/** 自定义左侧整区域,优先级 > title+subTitle */
|
|
6
8
|
headerLeft?: React.ReactNode;
|
|
7
|
-
/**
|
|
9
|
+
/** 右侧操作插槽:元素过多自动换行展示为两行及以上 */
|
|
8
10
|
headerRight?: React.ReactNode;
|
|
9
|
-
/**
|
|
11
|
+
/** 是否渲染顶部固定页头,默认true */
|
|
10
12
|
showHeader?: boolean;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* Yoka页面全局容器组件
|
|
16
|
+
* 1. 顶部sticky吸顶页头:左侧主/副标题同行下边线对齐、右侧自适应操作区(按钮过多自动换行两行)
|
|
17
|
+
* 2. 容器内部上下左右留白,子内容纵向间距10px,适配BI报表页面布局
|
|
18
|
+
* 3. 遵循项目antd/yoka-ui规范,样式使用CSS Modules Less
|
|
19
|
+
* @param title 主标题
|
|
20
|
+
* @param subTitle 二级副标题,与title同行
|
|
21
|
+
* @param headerLeft 自定义左侧全量插槽
|
|
22
|
+
* @param headerRight 右侧操作区域,内容自动换行
|
|
23
|
+
* @param showHeader 是否显示头部
|
|
16
24
|
*/
|
|
17
|
-
declare const YkContainer: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
18
|
-
/**
|
|
25
|
+
declare const YkContainer: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
26
|
+
/** 页头左侧主标题,字号18px、#3b82fe;headerLeft存在时不展示title与subTitle */
|
|
19
27
|
title?: React.ReactNode;
|
|
20
|
-
/**
|
|
28
|
+
/** 页头左侧二级副标题,与title同行、下边线对齐;headerLeft优先级更高 */
|
|
29
|
+
subTitle?: React.ReactNode;
|
|
30
|
+
/** 自定义左侧整区域,优先级 > title+subTitle */
|
|
21
31
|
headerLeft?: React.ReactNode;
|
|
22
|
-
/**
|
|
32
|
+
/** 右侧操作插槽:元素过多自动换行展示为两行及以上 */
|
|
23
33
|
headerRight?: React.ReactNode;
|
|
24
|
-
/**
|
|
34
|
+
/** 是否渲染顶部固定页头,默认true */
|
|
25
35
|
showHeader?: boolean;
|
|
26
|
-
} & React.RefAttributes<HTMLDivElement
|
|
36
|
+
} & React.RefAttributes<HTMLDivElement>>>;
|
|
27
37
|
export default YkContainer;
|
|
@@ -29,47 +29,13 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
|
|
30
30
|
// src/layout/YkContainer/index.tsx
|
|
31
31
|
import classNames from "classnames";
|
|
32
|
-
import React from "react";
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
justifyContent: "space-between",
|
|
40
|
-
gap: 12,
|
|
41
|
-
minHeight: 60,
|
|
42
|
-
padding: "10px 20px",
|
|
43
|
-
boxSizing: "border-box",
|
|
44
|
-
background: "#fff"
|
|
45
|
-
};
|
|
46
|
-
var titleStyle = {
|
|
47
|
-
margin: 0,
|
|
48
|
-
fontSize: 18,
|
|
49
|
-
fontWeight: 600,
|
|
50
|
-
lineHeight: "24px",
|
|
51
|
-
color: "#3b82fe"
|
|
52
|
-
};
|
|
53
|
-
var YkContainer = React.forwardRef(
|
|
54
|
-
(_a, ref) => {
|
|
55
|
-
var _b = _a, { className, style, children, title, headerLeft, headerRight, showHeader = true } = _b, rest = __objRest(_b, ["className", "style", "children", "title", "headerLeft", "headerRight", "showHeader"]);
|
|
56
|
-
return /* @__PURE__ */ React.createElement(
|
|
57
|
-
"div",
|
|
58
|
-
__spreadValues({
|
|
59
|
-
ref,
|
|
60
|
-
className: classNames("yoka-container", className),
|
|
61
|
-
style: __spreadValues({
|
|
62
|
-
display: "flex",
|
|
63
|
-
flexDirection: "column",
|
|
64
|
-
gap: 10,
|
|
65
|
-
padding: "0 10px 10px",
|
|
66
|
-
boxSizing: "border-box"
|
|
67
|
-
}, style)
|
|
68
|
-
}, rest),
|
|
69
|
-
showHeader ? /* @__PURE__ */ React.createElement("header", { style: headerBarStyle, className: "yoka-yk-container-header" }, /* @__PURE__ */ React.createElement("div", { style: { flex: 1, minWidth: 0, display: "flex", alignItems: "center" } }, headerLeft !== void 0 && headerLeft !== null ? headerLeft : title != null && title !== "" ? /* @__PURE__ */ React.createElement("div", { style: titleStyle }, title) : null), headerRight ? /* @__PURE__ */ React.createElement("div", { style: { flexShrink: 0, display: "flex", alignItems: "center" } }, headerRight) : null) : null,
|
|
70
|
-
children
|
|
71
|
-
);
|
|
72
|
-
}
|
|
32
|
+
import React, { forwardRef, memo } from "react";
|
|
33
|
+
import styles from "./index.module.less";
|
|
34
|
+
var YkContainer = memo(
|
|
35
|
+
forwardRef((props, ref) => {
|
|
36
|
+
const _a = props, { className, style, children, title, subTitle, headerLeft, headerRight, showHeader = true } = _a, rest = __objRest(_a, ["className", "style", "children", "title", "subTitle", "headerLeft", "headerRight", "showHeader"]);
|
|
37
|
+
return /* @__PURE__ */ React.createElement("div", __spreadValues({ ref, className: classNames("yoka-container", styles.containerWrap, className), style }, rest), showHeader && /* @__PURE__ */ React.createElement("header", { className: styles.headerBar }, /* @__PURE__ */ React.createElement("div", { className: styles.headerLeftWrap }, headerLeft != null ? headerLeft : /* @__PURE__ */ React.createElement("div", { className: styles.titleRow }, title && /* @__PURE__ */ React.createElement("div", { className: styles.mainTitle }, title), subTitle && /* @__PURE__ */ React.createElement("div", { className: styles.subTitle }, subTitle))), headerRight && /* @__PURE__ */ React.createElement("div", { className: styles.headerRightWrap }, headerRight)), /* @__PURE__ */ React.createElement("div", { className: styles.contentWrap }, children));
|
|
38
|
+
})
|
|
73
39
|
);
|
|
74
40
|
YkContainer.displayName = "YkContainer";
|
|
75
41
|
var YkContainer_default = YkContainer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/layout/YkContainer/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import classNames from 'classnames';\nimport React from 'react';\n\nexport type YkContainerProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /**
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,gBAAgB;AACvB,OAAO,
|
|
4
|
+
"sourcesContent": ["import classNames from 'classnames';\nimport React, { forwardRef, memo, ReactNode } from 'react';\nimport styles from './index.module.less';\n\nexport type YkContainerProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** 页头左侧主标题,字号18px、#3b82fe;headerLeft存在时不展示title与subTitle */\n title?: React.ReactNode;\n /** 页头左侧二级副标题,与title同行、下边线对齐;headerLeft优先级更高 */\n subTitle?: React.ReactNode;\n /** 自定义左侧整区域,优先级 > title+subTitle */\n headerLeft?: React.ReactNode;\n /** 右侧操作插槽:元素过多自动换行展示为两行及以上 */\n headerRight?: React.ReactNode;\n /** 是否渲染顶部固定页头,默认true */\n showHeader?: boolean;\n};\n\n/**\n * Yoka页面全局容器组件\n * 1. 顶部sticky吸顶页头:左侧主/副标题同行下边线对齐、右侧自适应操作区(按钮过多自动换行两行)\n * 2. 容器内部上下左右留白,子内容纵向间距10px,适配BI报表页面布局\n * 3. 遵循项目antd/yoka-ui规范,样式使用CSS Modules Less\n * @param title 主标题\n * @param subTitle 二级副标题,与title同行\n * @param headerLeft 自定义左侧全量插槽\n * @param headerRight 右侧操作区域,内容自动换行\n * @param showHeader 是否显示头部\n */\nconst YkContainer = memo(\n forwardRef<HTMLDivElement, YkContainerProps>((props, ref) => {\n const { className, style, children, title, subTitle, headerLeft, headerRight, showHeader = true, ...rest } = props;\n\n return (\n <div ref={ref} className={classNames('yoka-container', styles.containerWrap, className)} style={style} {...rest}>\n {showHeader && (\n <header className={styles.headerBar}>\n {/* 左侧标题区 */}\n <div className={styles.headerLeftWrap}>\n {headerLeft ?? (\n <div className={styles.titleRow}>\n {title && <div className={styles.mainTitle}>{title}</div>}\n {subTitle && <div className={styles.subTitle}>{subTitle}</div>}\n </div>\n )}\n </div>\n {/* 右侧操作区:核心flex-wrap:wrap 超出自动换行两行 */}\n {headerRight && <div className={styles.headerRightWrap}>{headerRight}</div>}\n </header>\n )}\n {/* 页面主体内容 */}\n <div className={styles.contentWrap}>{children}</div>\n </div>\n );\n }),\n);\n\nYkContainer.displayName = 'YkContainer';\nexport default YkContainer;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,gBAAgB;AACvB,OAAO,SAAS,YAAY,YAAuB;AACnD,OAAO,YAAY;AA0BnB,IAAM,cAAc;AAAA,EAClB,WAA6C,CAAC,OAAO,QAAQ;AAC3D,UAA6G,YAArG,aAAW,OAAO,UAAU,OAAO,UAAU,YAAY,aAAa,aAAa,KA9B/F,IA8BiH,IAAT,iBAAS,IAAT,CAA5F,aAAW,SAAO,YAAU,SAAO,YAAU,cAAY,eAAa;AAE9E,WACE,oCAAC,wBAAI,KAAU,WAAW,WAAW,kBAAkB,OAAO,eAAe,SAAS,GAAG,SAAkB,OACxG,cACC,oCAAC,YAAO,WAAW,OAAO,aAExB,oCAAC,SAAI,WAAW,OAAO,kBACpB,kCACC,oCAAC,SAAI,WAAW,OAAO,YACpB,SAAS,oCAAC,SAAI,WAAW,OAAO,aAAY,KAAM,GAClD,YAAY,oCAAC,SAAI,WAAW,OAAO,YAAW,QAAS,CAC1D,CAEJ,GAEC,eAAe,oCAAC,SAAI,WAAW,OAAO,mBAAkB,WAAY,CACvE,GAGF,oCAAC,SAAI,WAAW,OAAO,eAAc,QAAS,CAChD;AAAA,EAEJ,CAAC;AACH;AAEA,YAAY,cAAc;AAC1B,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.containerWrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
padding: 0 10px 10px;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// 顶部吸顶头部容器
|
|
10
|
+
.headerBar {
|
|
11
|
+
position: sticky;
|
|
12
|
+
top: 0;
|
|
13
|
+
z-index: 10;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
padding: 10px 20px;
|
|
18
|
+
min-height: 60px;
|
|
19
|
+
background: #fff;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
gap: 12px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 左侧标题区域
|
|
25
|
+
.headerLeftWrap {
|
|
26
|
+
flex: 1;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
|
|
29
|
+
.titleRow {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: baseline;
|
|
32
|
+
gap: 12px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.mainTitle {
|
|
36
|
+
margin: 0;
|
|
37
|
+
font-size: 18px;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
line-height: 24px;
|
|
40
|
+
color: #3b82fe;
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.subTitle {
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
line-height: 24px;
|
|
48
|
+
color: #666;
|
|
49
|
+
word-break: break-all;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 右侧操作区【关键:自动换行】
|
|
54
|
+
.headerRightWrap {
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap; // 空间不足自动换行,实现两行布局
|
|
58
|
+
justify-content: flex-end;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 8px; // 按钮横向间距
|
|
61
|
+
row-gap: 8px; // 换行后两行纵向间距
|
|
62
|
+
max-width: 55%; // 限制最大宽度,避免挤压左侧标题
|
|
63
|
+
|
|
64
|
+
// 适配antd/yoka-ui按钮、标签等组件
|
|
65
|
+
:global(.ant-btn, .yoka-btn) {
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 页面内容区
|
|
71
|
+
.contentWrap {
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
|
Binary file
|
package/dist/lib/index.less
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
@import "../../src/creative/ButtonWithProgress/index.less";
|
|
35
35
|
@import "../../src/creative/GlassSegmentedRadio/index.module.less";
|
|
36
36
|
@import "../../src/creative/SkillsWriter/index.module.less";
|
|
37
|
+
@import "../../src/layout/YkContainer/index.module.less";
|
|
37
38
|
@import "../../src/layout/YkDrawer/index.module.less";
|
|
38
39
|
@import "../../src/Themes/TableTheme/index.less";
|
|
39
40
|
@import "../../src/ui/LogicOperator/index.module.less";
|
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
export type YkContainerProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {
|
|
3
|
-
/**
|
|
3
|
+
/** 页头左侧主标题,字号18px、#3b82fe;headerLeft存在时不展示title与subTitle */
|
|
4
4
|
title?: React.ReactNode;
|
|
5
|
-
/**
|
|
5
|
+
/** 页头左侧二级副标题,与title同行、下边线对齐;headerLeft优先级更高 */
|
|
6
|
+
subTitle?: React.ReactNode;
|
|
7
|
+
/** 自定义左侧整区域,优先级 > title+subTitle */
|
|
6
8
|
headerLeft?: React.ReactNode;
|
|
7
|
-
/**
|
|
9
|
+
/** 右侧操作插槽:元素过多自动换行展示为两行及以上 */
|
|
8
10
|
headerRight?: React.ReactNode;
|
|
9
|
-
/**
|
|
11
|
+
/** 是否渲染顶部固定页头,默认true */
|
|
10
12
|
showHeader?: boolean;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* Yoka页面全局容器组件
|
|
16
|
+
* 1. 顶部sticky吸顶页头:左侧主/副标题同行下边线对齐、右侧自适应操作区(按钮过多自动换行两行)
|
|
17
|
+
* 2. 容器内部上下左右留白,子内容纵向间距10px,适配BI报表页面布局
|
|
18
|
+
* 3. 遵循项目antd/yoka-ui规范,样式使用CSS Modules Less
|
|
19
|
+
* @param title 主标题
|
|
20
|
+
* @param subTitle 二级副标题,与title同行
|
|
21
|
+
* @param headerLeft 自定义左侧全量插槽
|
|
22
|
+
* @param headerRight 右侧操作区域,内容自动换行
|
|
23
|
+
* @param showHeader 是否显示头部
|
|
16
24
|
*/
|
|
17
|
-
declare const YkContainer: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
18
|
-
/**
|
|
25
|
+
declare const YkContainer: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
26
|
+
/** 页头左侧主标题,字号18px、#3b82fe;headerLeft存在时不展示title与subTitle */
|
|
19
27
|
title?: React.ReactNode;
|
|
20
|
-
/**
|
|
28
|
+
/** 页头左侧二级副标题,与title同行、下边线对齐;headerLeft优先级更高 */
|
|
29
|
+
subTitle?: React.ReactNode;
|
|
30
|
+
/** 自定义左侧整区域,优先级 > title+subTitle */
|
|
21
31
|
headerLeft?: React.ReactNode;
|
|
22
|
-
/**
|
|
32
|
+
/** 右侧操作插槽:元素过多自动换行展示为两行及以上 */
|
|
23
33
|
headerRight?: React.ReactNode;
|
|
24
|
-
/**
|
|
34
|
+
/** 是否渲染顶部固定页头,默认true */
|
|
25
35
|
showHeader?: boolean;
|
|
26
|
-
} & React.RefAttributes<HTMLDivElement
|
|
36
|
+
} & React.RefAttributes<HTMLDivElement>>>;
|
|
27
37
|
export default YkContainer;
|
|
@@ -34,45 +34,12 @@ __export(YkContainer_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(YkContainer_exports);
|
|
35
35
|
var import_classnames = __toESM(require("classnames"));
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
justifyContent: "space-between",
|
|
44
|
-
gap: 12,
|
|
45
|
-
minHeight: 60,
|
|
46
|
-
padding: "10px 20px",
|
|
47
|
-
boxSizing: "border-box",
|
|
48
|
-
background: "#fff"
|
|
49
|
-
};
|
|
50
|
-
var titleStyle = {
|
|
51
|
-
margin: 0,
|
|
52
|
-
fontSize: 18,
|
|
53
|
-
fontWeight: 600,
|
|
54
|
-
lineHeight: "24px",
|
|
55
|
-
color: "#3b82fe"
|
|
56
|
-
};
|
|
57
|
-
var YkContainer = import_react.default.forwardRef(
|
|
58
|
-
({ className, style, children, title, headerLeft, headerRight, showHeader = true, ...rest }, ref) => /* @__PURE__ */ import_react.default.createElement(
|
|
59
|
-
"div",
|
|
60
|
-
{
|
|
61
|
-
ref,
|
|
62
|
-
className: (0, import_classnames.default)("yoka-container", className),
|
|
63
|
-
style: {
|
|
64
|
-
display: "flex",
|
|
65
|
-
flexDirection: "column",
|
|
66
|
-
gap: 10,
|
|
67
|
-
padding: "0 10px 10px",
|
|
68
|
-
boxSizing: "border-box",
|
|
69
|
-
...style
|
|
70
|
-
},
|
|
71
|
-
...rest
|
|
72
|
-
},
|
|
73
|
-
showHeader ? /* @__PURE__ */ import_react.default.createElement("header", { style: headerBarStyle, className: "yoka-yk-container-header" }, /* @__PURE__ */ import_react.default.createElement("div", { style: { flex: 1, minWidth: 0, display: "flex", alignItems: "center" } }, headerLeft !== void 0 && headerLeft !== null ? headerLeft : title != null && title !== "" ? /* @__PURE__ */ import_react.default.createElement("div", { style: titleStyle }, title) : null), headerRight ? /* @__PURE__ */ import_react.default.createElement("div", { style: { flexShrink: 0, display: "flex", alignItems: "center" } }, headerRight) : null) : null,
|
|
74
|
-
children
|
|
75
|
-
)
|
|
37
|
+
var import_index_module = __toESM(require("./index.module.less"));
|
|
38
|
+
var YkContainer = (0, import_react.memo)(
|
|
39
|
+
(0, import_react.forwardRef)((props, ref) => {
|
|
40
|
+
const { className, style, children, title, subTitle, headerLeft, headerRight, showHeader = true, ...rest } = props;
|
|
41
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { ref, className: (0, import_classnames.default)("yoka-container", import_index_module.default.containerWrap, className), style, ...rest }, showHeader && /* @__PURE__ */ import_react.default.createElement("header", { className: import_index_module.default.headerBar }, /* @__PURE__ */ import_react.default.createElement("div", { className: import_index_module.default.headerLeftWrap }, headerLeft ?? /* @__PURE__ */ import_react.default.createElement("div", { className: import_index_module.default.titleRow }, title && /* @__PURE__ */ import_react.default.createElement("div", { className: import_index_module.default.mainTitle }, title), subTitle && /* @__PURE__ */ import_react.default.createElement("div", { className: import_index_module.default.subTitle }, subTitle))), headerRight && /* @__PURE__ */ import_react.default.createElement("div", { className: import_index_module.default.headerRightWrap }, headerRight)), /* @__PURE__ */ import_react.default.createElement("div", { className: import_index_module.default.contentWrap }, children));
|
|
42
|
+
})
|
|
76
43
|
);
|
|
77
44
|
YkContainer.displayName = "YkContainer";
|
|
78
45
|
var YkContainer_default = YkContainer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/layout/YkContainer/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import classNames from 'classnames';\nimport React from 'react';\n\nexport type YkContainerProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /**
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AACvB,
|
|
6
|
-
"names": ["React", "classNames"]
|
|
4
|
+
"sourcesContent": ["import classNames from 'classnames';\nimport React, { forwardRef, memo, ReactNode } from 'react';\nimport styles from './index.module.less';\n\nexport type YkContainerProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** 页头左侧主标题,字号18px、#3b82fe;headerLeft存在时不展示title与subTitle */\n title?: React.ReactNode;\n /** 页头左侧二级副标题,与title同行、下边线对齐;headerLeft优先级更高 */\n subTitle?: React.ReactNode;\n /** 自定义左侧整区域,优先级 > title+subTitle */\n headerLeft?: React.ReactNode;\n /** 右侧操作插槽:元素过多自动换行展示为两行及以上 */\n headerRight?: React.ReactNode;\n /** 是否渲染顶部固定页头,默认true */\n showHeader?: boolean;\n};\n\n/**\n * Yoka页面全局容器组件\n * 1. 顶部sticky吸顶页头:左侧主/副标题同行下边线对齐、右侧自适应操作区(按钮过多自动换行两行)\n * 2. 容器内部上下左右留白,子内容纵向间距10px,适配BI报表页面布局\n * 3. 遵循项目antd/yoka-ui规范,样式使用CSS Modules Less\n * @param title 主标题\n * @param subTitle 二级副标题,与title同行\n * @param headerLeft 自定义左侧全量插槽\n * @param headerRight 右侧操作区域,内容自动换行\n * @param showHeader 是否显示头部\n */\nconst YkContainer = memo(\n forwardRef<HTMLDivElement, YkContainerProps>((props, ref) => {\n const { className, style, children, title, subTitle, headerLeft, headerRight, showHeader = true, ...rest } = props;\n\n return (\n <div ref={ref} className={classNames('yoka-container', styles.containerWrap, className)} style={style} {...rest}>\n {showHeader && (\n <header className={styles.headerBar}>\n {/* 左侧标题区 */}\n <div className={styles.headerLeftWrap}>\n {headerLeft ?? (\n <div className={styles.titleRow}>\n {title && <div className={styles.mainTitle}>{title}</div>}\n {subTitle && <div className={styles.subTitle}>{subTitle}</div>}\n </div>\n )}\n </div>\n {/* 右侧操作区:核心flex-wrap:wrap 超出自动换行两行 */}\n {headerRight && <div className={styles.headerRightWrap}>{headerRight}</div>}\n </header>\n )}\n {/* 页面主体内容 */}\n <div className={styles.contentWrap}>{children}</div>\n </div>\n );\n }),\n);\n\nYkContainer.displayName = 'YkContainer';\nexport default YkContainer;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AACvB,mBAAmD;AACnD,0BAAmB;AA0BnB,IAAM,kBAAc;AAAA,MAClB,yBAA6C,CAAC,OAAO,QAAQ;AAC3D,UAAM,EAAE,WAAW,OAAO,UAAU,OAAO,UAAU,YAAY,aAAa,aAAa,MAAM,GAAG,KAAK,IAAI;AAE7G,WACE,6BAAAA,QAAA,cAAC,SAAI,KAAU,eAAW,kBAAAC,SAAW,kBAAkB,oBAAAC,QAAO,eAAe,SAAS,GAAG,OAAe,GAAG,QACxG,cACC,6BAAAF,QAAA,cAAC,YAAO,WAAW,oBAAAE,QAAO,aAExB,6BAAAF,QAAA,cAAC,SAAI,WAAW,oBAAAE,QAAO,kBACpB,cACC,6BAAAF,QAAA,cAAC,SAAI,WAAW,oBAAAE,QAAO,YACpB,SAAS,6BAAAF,QAAA,cAAC,SAAI,WAAW,oBAAAE,QAAO,aAAY,KAAM,GAClD,YAAY,6BAAAF,QAAA,cAAC,SAAI,WAAW,oBAAAE,QAAO,YAAW,QAAS,CAC1D,CAEJ,GAEC,eAAe,6BAAAF,QAAA,cAAC,SAAI,WAAW,oBAAAE,QAAO,mBAAkB,WAAY,CACvE,GAGF,6BAAAF,QAAA,cAAC,SAAI,WAAW,oBAAAE,QAAO,eAAc,QAAS,CAChD;AAAA,EAEJ,CAAC;AACH;AAEA,YAAY,cAAc;AAC1B,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["React", "classNames", "styles"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.containerWrap {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
padding: 0 10px 10px;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// 顶部吸顶头部容器
|
|
10
|
+
.headerBar {
|
|
11
|
+
position: sticky;
|
|
12
|
+
top: 0;
|
|
13
|
+
z-index: 10;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
padding: 10px 20px;
|
|
18
|
+
min-height: 60px;
|
|
19
|
+
background: #fff;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
gap: 12px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 左侧标题区域
|
|
25
|
+
.headerLeftWrap {
|
|
26
|
+
flex: 1;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
|
|
29
|
+
.titleRow {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: baseline;
|
|
32
|
+
gap: 12px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.mainTitle {
|
|
36
|
+
margin: 0;
|
|
37
|
+
font-size: 18px;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
line-height: 24px;
|
|
40
|
+
color: #3b82fe;
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.subTitle {
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
line-height: 24px;
|
|
48
|
+
color: #666;
|
|
49
|
+
word-break: break-all;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 右侧操作区【关键:自动换行】
|
|
54
|
+
.headerRightWrap {
|
|
55
|
+
flex-shrink: 0;
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap; // 空间不足自动换行,实现两行布局
|
|
58
|
+
justify-content: flex-end;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 8px; // 按钮横向间距
|
|
61
|
+
row-gap: 8px; // 换行后两行纵向间距
|
|
62
|
+
max-width: 55%; // 限制最大宽度,避免挤压左侧标题
|
|
63
|
+
|
|
64
|
+
// 适配antd/yoka-ui按钮、标签等组件
|
|
65
|
+
:global(.ant-btn, .yoka-btn) {
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 页面内容区
|
|
71
|
+
.contentWrap {
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoka-ui/ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "",
|
|
@@ -102,10 +102,11 @@
|
|
|
102
102
|
"@changesets/cli": "^2.27.1",
|
|
103
103
|
"@commitlint/cli": "^20.5.0",
|
|
104
104
|
"@commitlint/config-conventional": "^20.5.0",
|
|
105
|
-
"@storybook/addon-a11y": "10.
|
|
106
|
-
"@storybook/addon-docs": "10.
|
|
105
|
+
"@storybook/addon-a11y": "10.4.1",
|
|
106
|
+
"@storybook/addon-docs": "10.4.1",
|
|
107
107
|
"@storybook/addon-webpack5-compiler-swc": "4.0.3",
|
|
108
|
-
"@storybook/react
|
|
108
|
+
"@storybook/react": "10.4.1",
|
|
109
|
+
"@storybook/react-webpack5": "10.4.1",
|
|
109
110
|
"@storybook/test-runner": "0.24.3",
|
|
110
111
|
"@testing-library/jest-dom": "^6.9.1",
|
|
111
112
|
"@testing-library/react": "^13.4.0",
|
|
@@ -128,7 +129,7 @@
|
|
|
128
129
|
"less-loader": "^12.3.2",
|
|
129
130
|
"lint-staged": "^16.2.7",
|
|
130
131
|
"rimraf": "^6.1.2",
|
|
131
|
-
"storybook": "^10.
|
|
132
|
+
"storybook": "^10.4.1",
|
|
132
133
|
"style-loader": "^4.0.0",
|
|
133
134
|
"stylelint": "^14",
|
|
134
135
|
"ts-node": "^10.9.1",
|
|
@@ -148,11 +149,6 @@
|
|
|
148
149
|
"npx @biomejs/biome check --write"
|
|
149
150
|
]
|
|
150
151
|
},
|
|
151
|
-
"pnpm": {
|
|
152
|
-
"onlyBuiltDependencies": [
|
|
153
|
-
"esbuild"
|
|
154
|
-
]
|
|
155
|
-
},
|
|
156
152
|
"publishConfig": {
|
|
157
153
|
"access": "public"
|
|
158
154
|
}
|