mall-components 1.0.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/README.md +128 -0
- package/build/_components-raw.css +791 -0
- package/build/_shims/antd.js +1 -0
- package/build/_shims/icons.js +1 -0
- package/build/_shims/moment.js +1 -0
- package/build/_shims/react-dom.js +1 -0
- package/build/_shims/react.js +1 -0
- package/build/adapters/DataSourceAdapter.d.ts +46 -0
- package/build/components/AdminLayout/AdminLayout.d.ts +5 -0
- package/build/components/AdminLayout/Breadcrumb.d.ts +8 -0
- package/build/components/AdminLayout/MainContent.d.ts +17 -0
- package/build/components/AdminLayout/Navbar.d.ts +10 -0
- package/build/components/AdminLayout/Sidebar.d.ts +14 -0
- package/build/components/AdminLayout/TabBar.d.ts +13 -0
- package/build/components/AdminLayout/TabPane.d.ts +4 -0
- package/build/components/AdminLayout/index.d.ts +3 -0
- package/build/components/AdminLayout/types.d.ts +42 -0
- package/build/components/CouponCard/CouponCard.d.ts +20 -0
- package/build/components/CouponCard/index.d.ts +1 -0
- package/build/components/OrderForm/OrderForm.d.ts +18 -0
- package/build/components/OrderForm/index.d.ts +1 -0
- package/build/components/OrderList/OrderList.d.ts +29 -0
- package/build/components/OrderList/index.d.ts +1 -0
- package/build/components/ProductForm/ProductForm.d.ts +18 -0
- package/build/components/ProductForm/index.d.ts +3 -0
- package/build/components/ProductList/ProductList.d.ts +47 -0
- package/build/components/ProductList/index.d.ts +3 -0
- package/build/components/PromotionCard/PromotionCard.d.ts +22 -0
- package/build/components/PromotionCard/index.d.ts +1 -0
- package/build/components/RoleCard/RoleCard.d.ts +18 -0
- package/build/components/RoleCard/index.d.ts +1 -0
- package/build/components/UserCard/UserCard.d.ts +17 -0
- package/build/components/UserCard/index.d.ts +1 -0
- package/build/entry-meta.d.ts +603 -0
- package/build/index.css +1 -0
- package/build/index.js +1 -0
- package/build/mall-components-meta.js +2563 -0
- package/build/mall-components.cdn.umd.css +1 -0
- package/build/mall-components.cdn.umd.js +8 -0
- package/build/mall-components.codesandbox.combined.js +1094 -0
- package/build/mall-components.codesandbox.css +401 -0
- package/build/mall-components.codesandbox.js +1080 -0
- package/build/mall-components.umd.css +1 -0
- package/build/mall-components.umd.js +8 -0
- package/build/meta/adminLayoutMeta.d.ts +3 -0
- package/build/meta/couponCardMeta.d.ts +128 -0
- package/build/meta/icons.d.ts +10 -0
- package/build/meta/orderFormMeta.d.ts +111 -0
- package/build/meta/orderListMeta.d.ts +170 -0
- package/build/meta/productFormMeta.d.ts +3 -0
- package/build/meta/productListMeta.d.ts +200 -0
- package/build/meta/promotionCardMeta.d.ts +129 -0
- package/build/meta/roleCardMeta.d.ts +3 -0
- package/build/meta/tabPaneMeta.d.ts +3 -0
- package/build/meta/userCardMeta.d.ts +3 -0
- package/build/meta.d.ts +605 -0
- package/build/setters/RestApiTester.d.ts +11 -0
- package/build/types/common.d.ts +17 -0
- package/build/types/marketing.d.ts +128 -0
- package/build/types/order.d.ts +174 -0
- package/build/types/permission.d.ts +101 -0
- package/build/types/product.d.ts +47 -0
- package/package.json +1 -0
- package/src/adapters/DataSourceAdapter.ts +445 -0
- package/src/components/AdminLayout/AdminLayout.scss +447 -0
- package/src/components/AdminLayout/AdminLayout.tsx +681 -0
- package/src/components/AdminLayout/Breadcrumb.tsx +60 -0
- package/src/components/AdminLayout/MainContent.tsx +54 -0
- package/src/components/AdminLayout/Navbar.tsx +76 -0
- package/src/components/AdminLayout/Sidebar.tsx +256 -0
- package/src/components/AdminLayout/TabBar.tsx +177 -0
- package/src/components/AdminLayout/TabPane.tsx +29 -0
- package/src/components/AdminLayout/index.ts +3 -0
- package/src/components/AdminLayout/types.ts +46 -0
- package/src/components/CouponCard/CouponCard.scss +55 -0
- package/src/components/CouponCard/CouponCard.tsx +687 -0
- package/src/components/CouponCard/index.ts +1 -0
- package/src/components/OrderForm/OrderForm.scss +148 -0
- package/src/components/OrderForm/OrderForm.tsx +503 -0
- package/src/components/OrderForm/index.ts +1 -0
- package/src/components/OrderList/OrderList.scss +160 -0
- package/src/components/OrderList/OrderList.tsx +885 -0
- package/src/components/OrderList/index.ts +1 -0
- package/src/components/ProductForm/ProductForm.scss +23 -0
- package/src/components/ProductForm/ProductForm.tsx +442 -0
- package/src/components/ProductForm/index.ts +3 -0
- package/src/components/ProductList/ProductList.scss +293 -0
- package/src/components/ProductList/ProductList.tsx +454 -0
- package/src/components/ProductList/index.ts +3 -0
- package/src/components/PromotionCard/PromotionCard.scss +71 -0
- package/src/components/PromotionCard/PromotionCard.tsx +579 -0
- package/src/components/PromotionCard/index.ts +1 -0
- package/src/components/RoleCard/RoleCard.scss +77 -0
- package/src/components/RoleCard/RoleCard.tsx +463 -0
- package/src/components/RoleCard/index.ts +1 -0
- package/src/components/UserCard/UserCard.scss +51 -0
- package/src/components/UserCard/UserCard.tsx +432 -0
- package/src/components/UserCard/index.ts +1 -0
- package/src/entry-components.ts +39 -0
- package/src/entry-meta.ts +23 -0
- package/src/index.scss +4 -0
- package/src/index.ts +36 -0
- package/src/index.tsx +17 -0
- package/src/meta/adminLayoutMeta.ts +154 -0
- package/src/meta/couponCardMeta.ts +287 -0
- package/src/meta/icons.ts +41 -0
- package/src/meta/orderFormMeta.ts +279 -0
- package/src/meta/orderListMeta.ts +443 -0
- package/src/meta/productFormMeta.ts +253 -0
- package/src/meta/productListMeta.ts +434 -0
- package/src/meta/promotionCardMeta.ts +276 -0
- package/src/meta/roleCardMeta.ts +142 -0
- package/src/meta/tabPaneMeta.ts +69 -0
- package/src/meta/userCardMeta.ts +128 -0
- package/src/meta.ts +25 -0
- package/src/setters/RestApiTester.tsx +219 -0
- package/src/shims/require.js +8 -0
- package/src/types/common.ts +19 -0
- package/src/types/marketing.ts +124 -0
- package/src/types/order.ts +169 -0
- package/src/types/permission.ts +102 -0
- package/src/types/product.ts +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Mall Components
|
|
2
|
+
|
|
3
|
+
电商低代码物料库 - 基于 Ant Design 的商城组件集合
|
|
4
|
+
|
|
5
|
+
## 概述
|
|
6
|
+
|
|
7
|
+
Mall Components 是为低代码平台设计的电商业务组件库,提供商品管理、订单管理、营销活动、权限管理等场景的预置组件。
|
|
8
|
+
|
|
9
|
+
## 组件列表
|
|
10
|
+
|
|
11
|
+
| 组件 | 说明 | 分类 |
|
|
12
|
+
|------|------|------|
|
|
13
|
+
| ProductList | 商品列表 | 商品管理 |
|
|
14
|
+
| ProductForm | 商品表单 | 商品管理 |
|
|
15
|
+
| OrderList | 订单列表 | 订单管理 |
|
|
16
|
+
| OrderForm | 订单表单 | 订单管理 |
|
|
17
|
+
| CouponCard | 优惠券卡片 | 营销管理 |
|
|
18
|
+
| PromotionCard | 活动卡片 | 营销管理 |
|
|
19
|
+
| UserCard | 用户卡片 | 权限管理 |
|
|
20
|
+
| RoleCard | 角色卡片 | 权限管理 |
|
|
21
|
+
|
|
22
|
+
## 目录结构
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
mall-components/
|
|
26
|
+
├── src/
|
|
27
|
+
│ ├── components/ # 组件实现
|
|
28
|
+
│ │ ├── ProductList/
|
|
29
|
+
│ │ ├── ProductForm/
|
|
30
|
+
│ │ └── ...
|
|
31
|
+
│ ├── meta/ # 组件元数据(属性面板配置)
|
|
32
|
+
│ │ ├── productListMeta.ts
|
|
33
|
+
│ │ └── icons.ts
|
|
34
|
+
│ ├── setters/ # 自定义设置器
|
|
35
|
+
│ ├── types/ # 类型定义
|
|
36
|
+
│ ├── adapters/ # 数据适配器
|
|
37
|
+
│ ├── shims/ # 运行时兼容
|
|
38
|
+
│ ├── index.ts # 组件入口
|
|
39
|
+
│ └── meta.ts # 元数据入口
|
|
40
|
+
├── scripts/
|
|
41
|
+
│ └── build.js # 构建脚本
|
|
42
|
+
├── package.json
|
|
43
|
+
├── tsconfig.json
|
|
44
|
+
└── .prettierrc.json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 快速开始
|
|
48
|
+
|
|
49
|
+
### 安装依赖
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cd packages/mall-components
|
|
53
|
+
npm install
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 开发模式
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm run dev # 监听模式,自动重新构建
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 构建
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm run build # 构建到 build/ 目录
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 代码检查
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm run lint # ESLint 检查
|
|
72
|
+
npm run lint:fix # 自动修复
|
|
73
|
+
npm run format # Prettier 格式化
|
|
74
|
+
npm run typecheck # TypeScript 类型检查
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## 技术栈
|
|
78
|
+
|
|
79
|
+
- **React** 16.14+ / 17.x / 18.x
|
|
80
|
+
- **Ant Design** 4.21+
|
|
81
|
+
- **@ant-design/icons** 4.7+
|
|
82
|
+
- **TypeScript** 5.0+
|
|
83
|
+
- **ESBuild** - 打包工具
|
|
84
|
+
- **Sass** - 样式预处理
|
|
85
|
+
|
|
86
|
+
## 集成方式
|
|
87
|
+
|
|
88
|
+
### UMD 方式(推荐)
|
|
89
|
+
|
|
90
|
+
组件库通过 UMD 格式暴露到全局 `window.MallComponents`:
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<script src="/mall-components.umd.js"></script>
|
|
94
|
+
<script>
|
|
95
|
+
const { ProductList, OrderList } = window.MallComponents;
|
|
96
|
+
</script>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Meta 集成
|
|
100
|
+
|
|
101
|
+
元数据通过 `window.MallComponentsMeta` 暴露:
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
const { components } = window.MallComponentsMeta;
|
|
105
|
+
// 注册到低码引擎
|
|
106
|
+
material.loadIncrementalAssets({ components });
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 开发新组件
|
|
110
|
+
|
|
111
|
+
1. 在 `src/components/` 创建组件目录
|
|
112
|
+
2. 实现 React 组件(TSX + SCSS)
|
|
113
|
+
3. 在 `src/meta/` 创建对应的 meta 配置
|
|
114
|
+
4. 在 `src/index.ts` 导出组件
|
|
115
|
+
5. 在 `src/meta.ts` 导出 meta
|
|
116
|
+
6. 运行 `npm run build` 构建
|
|
117
|
+
|
|
118
|
+
## 版本规范
|
|
119
|
+
|
|
120
|
+
遵循 [语义化版本](https://semver.org/lang/zh-CN/):
|
|
121
|
+
|
|
122
|
+
- **MAJOR**: 不兼容的 API 变更
|
|
123
|
+
- **MINOR**: 向下兼容的功能新增
|
|
124
|
+
- **PATCH**: 向下兼容的问题修复
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|