pv-design 1.0.18 → 1.0.20

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 CHANGED
@@ -1,29 +1,38 @@
1
- # pvmed/pv-design
2
-
3
- 柏视组件库
4
-
5
- ## 注意:
6
-
7
- 1. 确保组件的向下兼容性,不要破坏现有功能:不缩减API,不改变旧API的定义,如有必要,请提供迁移方案。
8
- 2. 保证组件增量更新。
9
- 3. 保证组件的类型声明正确性。
10
-
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
+ # pvmed/pv-design
2
+
3
+ 柏视组件库
4
+
5
+ ## 注意:
6
+
7
+ 1. 确保组件的向下兼容性,不要破坏现有功能:不缩减API,不改变旧API的定义,如有必要,请提供迁移方案。
8
+ 2. 保证组件增量更新。
9
+ 3. 保证组件的类型声明正确性。
10
+
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 发布
30
+
31
+ ### 本地调试 link
32
+ 1. 进入components目录:cd components
33
+ 2. 本地打包:npm run build
34
+ 3. 链接组件库:npm link
35
+ 4. 在其他项目中使用组件库:npm link pv-design
36
+ 5. 后续正常的使用组件库和开发即可
37
+ 6. 当组件更新时,执行:npm run build
38
+ 7. 当需要取消使用组件库时,执行:npm unlink pv-design
@@ -1,24 +1,24 @@
1
1
  import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
- import { ConfigProvider as i, Modal as l } from "antd";
3
- const x = ({ theme: o, LeftContent: r, RightContent: d, ...p }) => {
4
- var n;
5
- const e = {
2
+ import { ConfigProvider as p, Modal as e } from "antd";
3
+ const c = ({ theme: o, LeftContent: i, RightContent: n, ...d }) => {
4
+ var r;
5
+ const l = {
6
6
  titleColor: "rgba(204,204,204,0.85)",
7
- ...((n = o == null ? void 0 : o.components) == null ? void 0 : n.Modal) || {}
7
+ ...((r = o == null ? void 0 : o.components) == null ? void 0 : r.Modal) || {}
8
8
  };
9
9
  return /* @__PURE__ */ a(
10
- i,
10
+ p,
11
11
  {
12
- prefixCls: "pv-modal",
12
+ prefixCls: "pv-third-modal",
13
13
  theme: {
14
14
  ...o || {},
15
15
  components: {
16
- Modal: e
16
+ Modal: l
17
17
  }
18
18
  },
19
19
  children: [
20
20
  /* @__PURE__ */ t("style", { children: `
21
- .pv-modal-modal-content {
21
+ .pv-third-modal-body .pv-third-modal-modal-content {
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
  padding: 20px 28px !important;
@@ -29,28 +29,28 @@ const x = ({ theme: o, LeftContent: r, RightContent: d, ...p }) => {
29
29
  width: 780px !important;
30
30
  background-color: #252526 !important;
31
31
  }
32
- .pv-modal-modal-title {
32
+ .pv-third-modal-body .pv-third-modal-modal-title {
33
33
  text-align: center;
34
34
  height: 24px;
35
35
  line-height: 24px !important;
36
36
  }
37
- .pv-modal-modal-close-icon {
37
+ .pv-third-modal-body .pv-third-modal-modal-close-icon {
38
38
  color: rgba(204, 204, 204, 0.85) !important;
39
39
  }
40
- .pv-modal-modal-close {
40
+ .pv-third-modal-body .pv-third-modal-modal-close {
41
41
  top: 17px !important;
42
42
  right: 20px !important;
43
43
  }
44
- .pv-modal-modal-header {
44
+ .pv-third-modal-body .pv-third-modal-modal-header {
45
45
  margin-bottom: 20px !important;
46
46
  background-color: transparent !important;
47
47
  }
48
- .pv-modal-modal-body {
48
+ .pv-third-modal-body .pv-third-modal-modal-body {
49
49
  display: flex;
50
50
  flex: 1;
51
51
  overflow: hidden;
52
52
  }
53
- .pv-modal-content-container {
53
+ .pv-third-modal-content-container {
54
54
  display: flex;
55
55
  flex: 1;
56
56
  justify-content: space-between;
@@ -59,21 +59,21 @@ const x = ({ theme: o, LeftContent: r, RightContent: d, ...p }) => {
59
59
  border-radius: 8px;
60
60
  width: 100%;
61
61
  }
62
- .pv-modal-content-left {
62
+ .pv-third-modal-content-left {
63
63
  border-right: 1px dashed #4F4F4F;
64
64
  }
65
- .pv-modal-content-right {
65
+ .pv-third-modal-content-right {
66
66
  }
67
- .pv-modal-content-box {
67
+ .pv-third-modal-content-box {
68
68
  width: 50% ;
69
69
  flex: 1;
70
70
  box-sizing: border-box;
71
71
  height: 100%;
72
72
  }
73
- .pv-modal-modal-footer {
73
+ .pv-third-modal-body .pv-third-modal-modal-footer {
74
74
  margin-top: 20px !important;
75
75
  }
76
- .pv-modal-modal-footer{
76
+ .pv-third-modal-body .pv-third-modal-modal-footer{
77
77
  button:nth-of-type(1) {
78
78
  background: transparent;
79
79
  }
@@ -83,17 +83,19 @@ const x = ({ theme: o, LeftContent: r, RightContent: d, ...p }) => {
83
83
  color: #d9d9d9 !important;
84
84
  }
85
85
  button {
86
- font-size: 13px;
86
+ font-size: 12px;
87
87
  }
88
88
  }
89
89
  ` }),
90
90
  /* @__PURE__ */ t(
91
- l,
91
+ e,
92
92
  {
93
- ...p,
94
- children: /* @__PURE__ */ a("div", { className: "pv-modal-content-container", children: [
95
- /* @__PURE__ */ t("div", { className: "pv-modal-content-left pv-modal-content-box", children: r }),
96
- /* @__PURE__ */ t("div", { className: "pv-modal-content-right pv-modal-content-box", children: d })
93
+ width: 780,
94
+ ...d,
95
+ className: [d.className, "pv-third-modal-body"].join(" "),
96
+ children: /* @__PURE__ */ a("div", { className: "pv-third-modal-content-container", children: [
97
+ /* @__PURE__ */ t("div", { className: "pv-third-modal-content-left pv-third-modal-content-box", children: i }),
98
+ /* @__PURE__ */ t("div", { className: "pv-third-modal-content-right pv-third-modal-content-box", children: n })
97
99
  ] })
98
100
  }
99
101
  )
@@ -102,5 +104,5 @@ const x = ({ theme: o, LeftContent: r, RightContent: d, ...p }) => {
102
104
  );
103
105
  };
104
106
  export {
105
- x as default
107
+ c as default
106
108
  };
package/dist/pv-design.js CHANGED
@@ -1,8 +1,210 @@
1
- import { lazy as o } from "react";
2
- const r = o(() => import("./index-C5hvxSxS.js")), i = o(() => import("./index-Dyq3zBZo.js")), m = o(() => import("./index-FYoViA-E.js")), p = o(() => import("./index-CUPEuKJs.js"));
1
+ import { lazy as d } from "react";
2
+ import { jsxs as m, jsx as a } from "react/jsx-runtime";
3
+ import { ConfigProvider as s, Modal as b } from "antd";
4
+ const v = ({ theme: o, ...t }) => {
5
+ var e;
6
+ const n = {
7
+ titleColor: "rgba(204,204,204,0.85)",
8
+ ...((e = o == null ? void 0 : o.components) == null ? void 0 : e.Modal) || {}
9
+ };
10
+ return /* @__PURE__ */ m(
11
+ s,
12
+ {
13
+ prefixCls: "pv-base-modal-third",
14
+ theme: {
15
+ ...o || {},
16
+ components: {
17
+ Modal: n
18
+ }
19
+ },
20
+ children: [
21
+ /* @__PURE__ */ a("style", { children: `
22
+ .pv-base-modal-third-body .pv-base-modal-third-modal-content {
23
+ display: flex;
24
+ flex-direction: column;
25
+ padding: 20px 28px !important;
26
+ border-radius: 12px !important;
27
+ box-shadow: 0px 8px 48px 0px rgba(0,0,0,0.4) !important;
28
+ min-height: 580px !important;
29
+ max-height: 682px !important;
30
+ width: 780px !important;
31
+ background-color: #252526 !important;
32
+ }
33
+ .pv-base-modal-third-body .pv-base-modal-third-modal-title {
34
+ text-align: center;
35
+ height: 24px;
36
+ line-height: 24px !important;
37
+ }
38
+ .pv-base-modal-third-body .pv-base-modal-third-modal-close-icon {
39
+ color: rgba(204, 204, 204, 0.85) !important;
40
+ }
41
+ .pv-base-modal-third-body .pv-base-modal-third-modal-close {
42
+ top: 17px !important;
43
+ right: 20px !important;
44
+ }
45
+ .pv-base-modal-third-body .pv-base-modal-third-modal-header {
46
+ margin-bottom: 20px !important;
47
+ background-color: transparent !important;
48
+ }
49
+ .pv-base-modal-third-body .pv-base-modal-third-modal-body {
50
+ display: flex;
51
+ flex: 1;
52
+ overflow: hidden;
53
+ }
54
+ .pv-base-modal-third-body .pv-base-modal-third-modal-footer {
55
+ margin-top: 20px !important;
56
+ }
57
+ .pv-base-modal-third-body .pv-base-modal-third-modal-footer{
58
+ button:nth-of-type(1) {
59
+ background: transparent;
60
+ }
61
+ button:nth-of-type(1):hover {
62
+ background-color: transparent !important;
63
+ border: 1px solid #4B4A4A !important;
64
+ color: #d9d9d9 !important;
65
+ }
66
+ button {
67
+ font-size: 12px;
68
+ }
69
+ }
70
+ ` }),
71
+ /* @__PURE__ */ a(
72
+ b,
73
+ {
74
+ width: 780,
75
+ ...t,
76
+ className: [t.className, "pv-base-modal-third-body"].join(" ")
77
+ }
78
+ )
79
+ ]
80
+ }
81
+ );
82
+ }, p = ({ theme: o, ...t }) => {
83
+ var e;
84
+ const n = {
85
+ titleColor: "rgba(204,204,204,0.85)",
86
+ ...((e = o == null ? void 0 : o.components) == null ? void 0 : e.Modal) || {}
87
+ };
88
+ return /* @__PURE__ */ m(
89
+ s,
90
+ {
91
+ prefixCls: "pv-base-modal-default",
92
+ theme: {
93
+ ...o || {},
94
+ components: {
95
+ Modal: n
96
+ }
97
+ },
98
+ children: [
99
+ /* @__PURE__ */ a("style", { children: `
100
+ .pv-base-modal-default-body .pv-base-modal-default-modal-content {
101
+ display: flex;
102
+ flex-direction: column;
103
+ padding: 20px 28px !important;
104
+ border-radius: 12px !important;
105
+ box-shadow: 0px 8px 48px 0px rgba(0,0,0,0.4) !important;
106
+ background-color: #252526 !important;
107
+ }
108
+ .pv-base-modal-default-body .pv-base-modal-default-modal-title {
109
+ text-align: center;
110
+ height: 24px;
111
+ line-height: 24px !important;
112
+ }
113
+ .pv-base-modal-default-body .pv-base-modal-default-modal-close-icon {
114
+ color: rgba(204, 204, 204, 0.85) !important;
115
+ }
116
+ .pv-base-modal-default-body .pv-base-modal-default-modal-close {
117
+ top: 17px !important;
118
+ right: 20px !important;
119
+ }
120
+ .pv-base-modal-default-body .pv-base-modal-default-modal-header {
121
+ margin-bottom: 20px !important;
122
+ background-color: transparent !important;
123
+ }
124
+ .pv-base-modal-default-body .pv-base-modal-default-modal-body {
125
+ display: flex;
126
+ flex: 1;
127
+ overflow: hidden;
128
+ }
129
+ .pv-base-modal-default-body .pv-base-modal-default-modal-footer {
130
+ margin-top: 20px !important;
131
+ }
132
+ .pv-base-modal-default-body .pv-base-modal-default-modal-footer{
133
+ button:nth-of-type(1) {
134
+ background: transparent;
135
+ }
136
+ button:nth-of-type(1):hover {
137
+ background-color: transparent !important;
138
+ border: 1px solid #4B4A4A !important;
139
+ color: #d9d9d9 !important;
140
+ }
141
+ button {
142
+ font-size: 12px;
143
+ }
144
+ }
145
+ ` }),
146
+ /* @__PURE__ */ a(
147
+ b,
148
+ {
149
+ ...t,
150
+ className: [t.className, "pv-base-modal-default-body"].join(" ")
151
+ }
152
+ )
153
+ ]
154
+ }
155
+ );
156
+ };
157
+ var c = /* @__PURE__ */ ((o) => (o[o.default = 0] = "default", o[o.third = 3] = "third", o))(c || {});
158
+ const y = {
159
+ default: 0,
160
+ third: 3
161
+ }, g = ({ modalType: o, ...t }) => {
162
+ switch (o) {
163
+ case 0:
164
+ return /* @__PURE__ */ a(p, { ...t });
165
+ case 3:
166
+ return /* @__PURE__ */ a(v, { ...t });
167
+ default:
168
+ return /* @__PURE__ */ a(p, { ...t });
169
+ }
170
+ }, _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
171
+ __proto__: null,
172
+ ModalType: c,
173
+ ModalTypeMap: y,
174
+ default: g
175
+ }, Symbol.toStringTag, { value: "Module" })), B = "index-module__iconButton__Y5V-H", r = {
176
+ iconButton: B,
177
+ "iconButton-primary": "index-module__iconButton-primary__NAYmJ",
178
+ "iconButton-danger": "index-module__iconButton-danger__8mavX",
179
+ "iconButton-disable": "index-module__iconButton-disable__F-gC-",
180
+ "iconButton-block": "index-module__iconButton-block__yXYYN"
181
+ }, l = {
182
+ primary: "primary",
183
+ danger: "danger"
184
+ }, M = ({ children: o, onClick: t, className: n, size: e = 12, disable: i = !1, type: u = l.primary, block: f = !1 }) => {
185
+ const x = () => {
186
+ switch (u) {
187
+ case l.primary:
188
+ return r["iconButton-primary"];
189
+ case l.danger:
190
+ return r["iconButton-danger"];
191
+ }
192
+ }, h = () => {
193
+ i || t == null || t();
194
+ };
195
+ return /* @__PURE__ */ a("span", { className: [r.iconButton, n, i && r["iconButton-disable"], x(), f && r["iconButton-block"]].join(" "), onClick: h, style: { fontSize: `${e}px` }, children: o });
196
+ }, j = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
197
+ __proto__: null,
198
+ IconButtonType: l,
199
+ default: M
200
+ }, Symbol.toStringTag, { value: "Module" })), N = d(() => import("./index-C5hvxSxS.js")), z = d(() => import("./index-Dyq3zBZo.js")), A = d(() => import("./index-FYoViA-E.js")), C = d(() => import("./index-CaYRL7KG.js")), S = d(() => Promise.resolve().then(() => _)), T = d(() => Promise.resolve().then(() => j));
3
201
  export {
4
- m as PvModal,
5
- i as PvTable,
6
- r as PvTabs,
7
- p as ThirdModal
202
+ S as BaseModal,
203
+ T as IconButton,
204
+ l as IconButtonType,
205
+ y as ModalTypeMap,
206
+ A as PvModal,
207
+ z as PvTable,
208
+ N as PvTabs,
209
+ C as ThirdModal
8
210
  };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .index-module__iconButton__Y5V-H{color:#9d9d9d;cursor:pointer}.index-module__iconButton__Y5V-H.index-module__iconButton-primary__NAYmJ:hover{color:#2777e5}.index-module__iconButton__Y5V-H.index-module__iconButton-danger__8mavX:hover{color:#dc4446}.index-module__iconButton__Y5V-H.index-module__iconButton-disable__F-gC-{color:#4f4f4f!important;cursor:not-allowed}.index-module__iconButton__Y5V-H.index-module__iconButton-disable__F-gC-:hover{color:#4f4f4f!important}.index-module__iconButton__Y5V-H.index-module__iconButton-block__yXYYN{display:block}
@@ -0,0 +1,7 @@
1
+ import type { ModalProps, ThemeConfig } from 'antd';
2
+ import React from 'react';
3
+ export interface ExtendedModalProps extends ModalProps {
4
+ theme?: ThemeConfig;
5
+ }
6
+ declare const DefaultModal: React.FC<ExtendedModalProps>;
7
+ export default DefaultModal;
@@ -0,0 +1,16 @@
1
+ import type { ModalProps, ThemeConfig } from 'antd';
2
+ import React from 'react';
3
+ export declare enum ModalType {
4
+ 'default' = 0,
5
+ 'third' = 3
6
+ }
7
+ export declare const ModalTypeMap: {
8
+ default: number;
9
+ third: number;
10
+ };
11
+ export interface ExtendedModalProps extends ModalProps {
12
+ theme?: ThemeConfig;
13
+ modalType: ModalType;
14
+ }
15
+ declare const BaseModal: React.FC<ExtendedModalProps>;
16
+ export default BaseModal;
@@ -0,0 +1,7 @@
1
+ import type { ModalProps, ThemeConfig } from 'antd';
2
+ import React from 'react';
3
+ export interface ExtendedModalProps extends ModalProps {
4
+ theme?: ThemeConfig;
5
+ }
6
+ declare const ThreeModal: React.FC<ExtendedModalProps>;
7
+ export default ThreeModal;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export declare const IconButtonType: {
3
+ primary: string;
4
+ danger: string;
5
+ };
6
+ export type IconButtonTypes = typeof IconButtonType[keyof typeof IconButtonType];
7
+ export interface IconButtonProps {
8
+ onClick?: () => void;
9
+ className?: string;
10
+ size?: number;
11
+ disable?: boolean;
12
+ type: IconButtonTypes;
13
+ block?: boolean;
14
+ children: React.ReactNode;
15
+ }
16
+ declare const IconButton: ({ children, onClick, className, size, disable, type, block }: IconButtonProps) => React.JSX.Element;
17
+ export default IconButton;
@@ -1,5 +1,9 @@
1
+ import { ModalTypeMap } from "./baseModal";
2
+ import { IconButtonType } from "./iconButton";
1
3
  declare const PvTabs: import("react").LazyExoticComponent<import("react").FC<import("./pvTabs").ExtendedTabsProps>>;
2
4
  declare const PvTable: import("react").LazyExoticComponent<import("react").FC<import("./pvTable").ExtendedTableProps>>;
3
5
  declare const PvModal: import("react").LazyExoticComponent<import("react").FC<import("./pvModal").ExtendedModalProps>>;
4
6
  declare const ThirdModal: import("react").LazyExoticComponent<import("react").FC<import("./thirdModal").ExtendedModalProps>>;
5
- export { PvTabs, PvTable, PvModal, ThirdModal };
7
+ declare const BaseModal: import("react").LazyExoticComponent<import("react").FC<import("./baseModal").ExtendedModalProps>>;
8
+ declare const IconButton: import("react").LazyExoticComponent<({ children, onClick, className, size, disable, type, block }: import("./iconButton").IconButtonProps) => import("react").JSX.Element>;
9
+ export { PvTabs, PvTable, PvModal, ThirdModal, BaseModal, ModalTypeMap, IconButton, IconButtonType, };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
package/package.json CHANGED
@@ -1,47 +1,21 @@
1
1
  {
2
2
  "name": "pv-design",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "pvmed ui design",
5
5
  "type": "module",
6
6
  "main": "./dist/pv-design.js",
7
7
  "types": "./dist/types/index.d.ts",
8
8
  "scripts": {
9
- "start": "vite --port 1122",
10
- "build": "vite build --config vite.config.ts && tsc --jsx react --project tsconfig.types.json",
11
- "build:template": "storybook build -o home",
9
+ "build": "npm run clean && vite build --config vite.config.ts && tsc --jsx react --project tsconfig.types.json",
12
10
  "build:doc": "typedoc",
13
11
  "doc:view": "http-serve docs -p 80",
14
12
  "lint": "eslint .",
15
- "storybook": "storybook dev -p 6006"
13
+ "clean": "if exist dist rd /s /q dist"
16
14
  },
17
15
  "repository": {
18
16
  "type": "git",
19
17
  "url": "ssh://git@192.168.18.221:12225/pvmed-prd/icp/pv-design.git"
20
18
  },
21
- "devDependencies": {
22
- "@eslint/js": "^9.9.0",
23
- "@storybook/addon-docs": "^9.0.11",
24
- "@storybook/addon-onboarding": "^9.0.11",
25
- "@storybook/react-vite": "^9.0.11",
26
- "@types/node": "^22.7.4",
27
- "@types/react": "^18.3.3",
28
- "@types/react-dom": "^18.3.0",
29
- "@vitejs/plugin-react-swc": "^3.5.0",
30
- "antd": "^5.21.1",
31
- "eslint": "^9.9.0",
32
- "eslint-plugin-react-hooks": "^5.1.0-rc.0",
33
- "eslint-plugin-react-refresh": "^0.4.9",
34
- "eslint-plugin-storybook": "^9.0.11",
35
- "globals": "^15.9.0",
36
- "path": "^0.12.7",
37
- "react": "^18.3.1",
38
- "react-dom": "^18.3.1",
39
- "storybook": "^9.0.11",
40
- "typedoc": "^0.26.7",
41
- "typescript": "^5.5.3",
42
- "typescript-eslint": "^8.0.1",
43
- "vite": "^5.4.1"
44
- },
45
19
  "peerDependencies": {
46
20
  "antd": "^5.0.0",
47
21
  "react": ">16.8.0"
@@ -57,5 +31,8 @@
57
31
  "files": [
58
32
  "dist",
59
33
  "README.md"
60
- ]
34
+ ],
35
+ "devDependencies": {
36
+ "vite-plugin-css-injected-by-js": "^3.5.2"
37
+ }
61
38
  }