pv-design 1.0.3 → 1.0.4
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/README.md +24 -0
- package/dist/{index-Bt1Nwa6Q.js → index-BFgI4MGM.js} +26 -25
- package/dist/index-CaVlZb4f.js +35 -0
- package/dist/pv-design.js +1 -1
- package/dist/types/pvTable/index.d.ts +2 -2
- package/dist/types/pvTabs/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/index-CZwsnp5o.js +0 -31
package/README.md
CHANGED
|
@@ -2,4 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
柏视组件库
|
|
4
4
|
|
|
5
|
+
## 注意:
|
|
6
|
+
|
|
7
|
+
1. 确保组件的向下兼容性,不要破坏现有功能:不缩减API,不改变旧API的定义,如有必要,请提供迁移方案。
|
|
8
|
+
2. 保证组件增量更新。
|
|
9
|
+
3. 保证组件的类型声明正确性。
|
|
10
|
+
|
|
5
11
|
## 介绍
|
|
12
|
+
### 技术栈说明
|
|
13
|
+
* 框架: React-ts(swc*)
|
|
14
|
+
○ 采用ts的原因是打包版本中可以继承antd-design的type定义,简化组件的类型声明,提高使用时的便利性
|
|
15
|
+
○ eslint
|
|
16
|
+
* 打包工具: Vite(ESBuild)
|
|
17
|
+
○ 快速、简单
|
|
18
|
+
* 样式: 内联or style标签
|
|
19
|
+
* API文档生成: typedoc
|
|
20
|
+
* 组件demo:HTML(需要gitlab pages的支持)或MD
|
|
21
|
+
|
|
22
|
+
### 开发流程(新增组件)
|
|
23
|
+
1. 创建组件:在 /components 目录下创建组件文件夹和文件。
|
|
24
|
+
2. 编写文档:在 /src/template 目录下为每个组件编写使用文档(目录名称与components下的一致)。
|
|
25
|
+
3. 组件命名约束:使用Pv拼接组件名,如:PvTabs
|
|
26
|
+
4. 编译组件:npm run build
|
|
27
|
+
5. 生成API文档:npm run build:doc
|
|
28
|
+
6. 生成组件文档:npm run build:template
|
|
29
|
+
7. 发布组件库:使用 npm publish 发布
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ConfigProvider as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsxs as d, jsx as b } from "react/jsx-runtime.js";
|
|
2
|
+
import { ConfigProvider as c, Table as i } from "antd";
|
|
3
|
+
const m = ({ theme: a, customRowClass: e, ...r }) => {
|
|
4
|
+
var t;
|
|
5
|
+
const n = (p, l) => {
|
|
6
|
+
const o = l % 2 === 0 ? "pv-table-even-row" : "pv-table-odd-row";
|
|
7
|
+
return e ? e(o, p, l) : o;
|
|
7
8
|
};
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
|
|
9
|
+
return /* @__PURE__ */ d(
|
|
10
|
+
c,
|
|
10
11
|
{
|
|
11
12
|
prefixCls: "pv-table",
|
|
12
13
|
theme: {
|
|
14
|
+
...a || {},
|
|
13
15
|
components: {
|
|
14
|
-
Table: {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
Table: {
|
|
17
|
+
colorBgContainer: "#18191a",
|
|
18
|
+
headerBg: "#18191a",
|
|
19
|
+
...((t = a == null ? void 0 : a.components) == null ? void 0 : t.Table) || {}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
17
22
|
},
|
|
18
23
|
children: [
|
|
19
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ b("style", { children: `
|
|
20
25
|
.pv-table-table {
|
|
21
|
-
background: #18191a !important;
|
|
22
26
|
scrollbar-color: unset !important;
|
|
23
27
|
}
|
|
24
28
|
.pv-table-table-header {
|
|
25
29
|
border-right: 16px solid #18191a !important;
|
|
26
30
|
}
|
|
27
|
-
.pv-table-table-header .pv-table-table-cell {
|
|
28
|
-
background: #18191a !important;
|
|
29
|
-
}
|
|
30
31
|
.pv-table-table-body::-webkit-scrollbar {
|
|
31
32
|
background-color: transparent;
|
|
32
33
|
height: 16px;
|
|
@@ -43,15 +44,15 @@ const s = ({ theme: o, customRowClass: a, ...e }) => {
|
|
|
43
44
|
.pv-table-body::-webkit-scrollbar-track {
|
|
44
45
|
background: transparent;
|
|
45
46
|
}
|
|
46
|
-
.pv-table-even-row
|
|
47
|
+
.pv-table-even-row {
|
|
47
48
|
background-color: #0a0a0a !important;
|
|
48
49
|
}
|
|
49
|
-
.pv-table-even-row .pv-table-table-cell-row-hover {background-color:
|
|
50
|
+
.pv-table-even-row .pv-table-table-cell-row-hover {background-color: transparent !important;}
|
|
50
51
|
|
|
51
|
-
.pv-table-odd-row
|
|
52
|
+
.pv-table-odd-row {
|
|
52
53
|
background-color: #18191a !important;
|
|
53
54
|
}
|
|
54
|
-
.pv-table-odd-row .pv-table-table-cell-row-hover {background-color:
|
|
55
|
+
.pv-table-odd-row .pv-table-table-cell-row-hover {background-color: transparent !important;}
|
|
55
56
|
|
|
56
57
|
.pv-table-even-row .pv-table-table-cell:first-child {
|
|
57
58
|
border-bottom-left-radius: 4px;
|
|
@@ -74,11 +75,11 @@ const s = ({ theme: o, customRowClass: a, ...e }) => {
|
|
|
74
75
|
padding: 5px 8px !important;
|
|
75
76
|
}
|
|
76
77
|
` }),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
78
|
+
/* @__PURE__ */ b(
|
|
79
|
+
i,
|
|
79
80
|
{
|
|
80
|
-
...
|
|
81
|
-
rowClassName:
|
|
81
|
+
...r,
|
|
82
|
+
rowClassName: r != null && r.rowClassName ? r.rowClassName : n
|
|
82
83
|
}
|
|
83
84
|
)
|
|
84
85
|
]
|
|
@@ -86,5 +87,5 @@ const s = ({ theme: o, customRowClass: a, ...e }) => {
|
|
|
86
87
|
);
|
|
87
88
|
};
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
+
m as default
|
|
90
91
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime.js";
|
|
2
|
+
import { ConfigProvider as i, Tabs as g } from "antd";
|
|
3
|
+
const b = ({ theme: r, ...n }) => {
|
|
4
|
+
var o;
|
|
5
|
+
return /* @__PURE__ */ a(
|
|
6
|
+
i,
|
|
7
|
+
{
|
|
8
|
+
theme: {
|
|
9
|
+
...r || {},
|
|
10
|
+
components: {
|
|
11
|
+
Tabs: {
|
|
12
|
+
cardBg: "rgba(255,255,255,0)",
|
|
13
|
+
colorBgContainer: "rgb(24,25,26)",
|
|
14
|
+
colorBorderSecondary: "rgba(48,48,48,0)",
|
|
15
|
+
itemSelectedColor: "#419DEE",
|
|
16
|
+
margin: 0,
|
|
17
|
+
marginSM: 0,
|
|
18
|
+
marginXS: 0,
|
|
19
|
+
marginXXS: 0,
|
|
20
|
+
...((o = r == null ? void 0 : r.components) == null ? void 0 : o.Tabs) || {}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
children: /* @__PURE__ */ a(
|
|
25
|
+
g,
|
|
26
|
+
{
|
|
27
|
+
...n
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
b as default
|
|
35
|
+
};
|
package/dist/pv-design.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { TableProps } from 'antd';
|
|
1
|
+
import type { TableProps, ThemeConfig } from 'antd';
|
|
2
2
|
/**
|
|
3
3
|
* 扩展表格属性接口
|
|
4
4
|
*/
|
|
5
5
|
export interface ExtendedTableProps extends TableProps {
|
|
6
|
-
theme?:
|
|
6
|
+
theme?: ThemeConfig;
|
|
7
7
|
customRowClass?: (currentClassName: string, record: RecordType, index: number) => string;
|
|
8
8
|
}
|
|
9
9
|
type RecordType = any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TabsProps } from 'antd';
|
|
1
|
+
import type { TabsProps, ThemeConfig } from 'antd';
|
|
2
2
|
export interface ExtendedTabsProps extends TabsProps {
|
|
3
|
-
theme?:
|
|
3
|
+
theme?: ThemeConfig;
|
|
4
4
|
}
|
|
5
5
|
declare const PvTabs: React.FC<ExtendedTabsProps>;
|
|
6
6
|
export default PvTabs;
|
package/package.json
CHANGED
package/dist/index-CZwsnp5o.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { ConfigProvider as a, Tabs as n } from "antd";
|
|
3
|
-
const t = ({ theme: o, ...e }) => /* @__PURE__ */ r(
|
|
4
|
-
a,
|
|
5
|
-
{
|
|
6
|
-
theme: {
|
|
7
|
-
components: {
|
|
8
|
-
Tabs: {
|
|
9
|
-
cardBg: "rgba(255,255,255,0)",
|
|
10
|
-
colorBgContainer: "rgb(24,25,26)",
|
|
11
|
-
colorBorderSecondary: "rgba(48,48,48,0)",
|
|
12
|
-
itemSelectedColor: "#419DEE",
|
|
13
|
-
margin: 0,
|
|
14
|
-
marginSM: 0,
|
|
15
|
-
marginXS: 0,
|
|
16
|
-
marginXXS: 0
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
...o || {}
|
|
20
|
-
},
|
|
21
|
-
children: /* @__PURE__ */ r(
|
|
22
|
-
n,
|
|
23
|
-
{
|
|
24
|
-
...e
|
|
25
|
-
}
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
export {
|
|
30
|
-
t as default
|
|
31
|
-
};
|