cloud-business 0.1.142 → 0.1.143

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/.babelrc ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "presets": [
3
+ "@babel/preset-env",
4
+ "@babel/preset-react"
5
+ ],
6
+ "plugins": [
7
+ ["@babel/plugin-proposal-decorators", { "legacy": true }],
8
+ "@babel/plugin-proposal-function-sent",
9
+ "@babel/plugin-proposal-export-namespace-from",
10
+ "@babel/plugin-proposal-numeric-separator",
11
+ "@babel/plugin-proposal-throw-expressions",
12
+ "@babel/plugin-syntax-dynamic-import",
13
+ ["@babel/plugin-proposal-class-properties", { "loose": true }],
14
+ [
15
+ "@babel/plugin-transform-runtime",
16
+ {
17
+ "helpers": true,
18
+ "regenerator": true
19
+ }
20
+ ]
21
+ ]
22
+ }
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/cloud-business-react.iml" filepath="$PROJECT_DIR$/.idea/cloud-business-react.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Shuyun FF2E
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # cloud-business
2
+
3
+ [![npm version](https://img.shields.io/npm/v/cloud-business.svg)](https://www.npmjs.com/package/cloud-business)
4
+ [![license](https://img.shields.io/npm/l/cloud-business.svg)](https://github.com/ShuyunFF2E/cloud-business/blob/master/LICENSE)
5
+
6
+ 数云 React 业务组件库,提供丰富的企业级业务组件,助力快速构建数据赢家相关应用。
7
+
8
+ ## 📦 安装
9
+
10
+ ```bash
11
+ npm install cloud-business
12
+ # 或
13
+ yarn add cloud-business
14
+ ```
15
+
16
+ ## 🚀 快速开始
17
+
18
+ ```jsx
19
+ import React from 'react';
20
+ import { AreaSelector, CustomerView, ShopSelector } from 'cloud-business';
21
+ import 'cloud-business/dist/index.css';
22
+
23
+ function App() {
24
+ return (
25
+ <div>
26
+ <AreaSelector />
27
+ <CustomerView />
28
+ <ShopSelector />
29
+ </div>
30
+ );
31
+ }
32
+ ```
33
+
34
+ ## 📋 组件列表
35
+
36
+ ### 基础组件
37
+ - **AreaSelector** - 地区选择器
38
+ - **AreaSelectorNew** - 新版地区选择器
39
+ - **ShopSelector** - 店铺选择器
40
+ - **ShopSelectorNew** - 新版店铺选择器
41
+ - **ShopSelectorPro** - 专业版店铺选择器
42
+
43
+ ### 客户管理
44
+ - **CustomerView** - 客户视图
45
+ - **CustomerViewNew** - 新版客户视图
46
+ - **BlackList** - 黑名单管理
47
+ - **BlackListNew** - 新版黑名单管理
48
+
49
+ ### 商品管理
50
+ - **GoodsSelectorPro** - 商品选择器
51
+ - **GoodsSelectorProNew** - 新版专业商品选择器
52
+
53
+ ### 营销工具
54
+ - **DySms** - 抖音短信组件
55
+ - **SmsEditor** - 短信编辑器
56
+ - **SuperSmsSelector** - 超级短信选择器
57
+ - **EnterpriseChatChannel** - 企业聊天渠道
58
+
59
+ ### 其他工具
60
+ - **Editor** - 富文本编辑器
61
+ - **SatisfactionSurvey** - 满意度调查
62
+ - **WelcomesPreview** - 欢迎预览
63
+ - **CcMenu** - 菜单组件
64
+ - **Keyword** - 关键词组件
65
+
66
+ ## 🛠️ 开发
67
+
68
+ ### 环境要求
69
+ - Node.js 14
70
+
71
+ ### 安装依赖
72
+ ```bash
73
+ npm install
74
+ ```
75
+
76
+ ### 开发命令
77
+ ```bash
78
+ # 启动开发服务器
79
+ npm start
80
+
81
+ # 构建项目
82
+ npm run build
83
+
84
+ # 代码检查
85
+ npm run lint
86
+
87
+ # 自动修复代码风格
88
+ npm run lint:fix
89
+
90
+ # 生成文档
91
+ npm run gen:doc
92
+
93
+ # 构建文档站点
94
+ npm run docs:build
95
+ ```
96
+
97
+ ### 项目结构
98
+ ```
99
+ src/
100
+ ├── area-selector/ # 地区选择器
101
+ ├── area-selector-new/ # 新版地区选择器
102
+ ├── black-list/ # 黑名单管理
103
+ ├── black-list-new/ # 新版黑名单管理
104
+ ├── cc-menu/ # 菜单组件
105
+ ├── customer-view/ # 客户视图
106
+ ├── customer-view-new/ # 新版客户视图
107
+ ├── dy-sms/ # 抖音短信组件
108
+ ├── editor/ # 富文本编辑器
109
+ ├── enterprise-chat-channel/ # 企业聊天渠道
110
+ ├── goods-selector-pro/ # 专业版商品选择器
111
+ ├── goods-selector-pro-new/ # 新版专业商品选择器
112
+ ├── keyword/ # 关键词组件
113
+ ├── satisfaction-survey/ # 满意度调查
114
+ ├── shop-selector/ # 店铺选择器
115
+ ├── shop-selector-new/ # 新版店铺选择器
116
+ ├── shop-selector-pro/ # 专业版店铺选择器
117
+ ├── sms-editor/ # 短信编辑器
118
+ ├── super-sms-selector/ # 超级短信选择器
119
+ ├── WelcomesPreview/ # 欢迎预览
120
+ ├── style/ # 样式文件
121
+ ├── utils/ # 工具函数
122
+ └── index.js # 主入口文件
123
+ ```
124
+
125
+ ## 📖 文档
126
+
127
+ 详细的组件文档和示例请访问:[文档站点](https://cloud-business-react.shuyun.com/)
package/assets.json ADDED
@@ -0,0 +1,132 @@
1
+ {
2
+ "name": " ",
3
+ "package": "cloud-react",
4
+ "logo": "https://brand-guide.shuyun.com/IAM/77c28a6547cd.png",
5
+ "assets": {
6
+ "atoms": [],
7
+ "examples": [
8
+ {
9
+ "type": "BLOCK",
10
+ "identifier": "basic-demo",
11
+ "dependencies": {
12
+ "react": {
13
+ "type": "NPM",
14
+ "value": "16.14.0"
15
+ },
16
+ "cloud-react": {
17
+ "type": "NPM",
18
+ "value": "0.0.98"
19
+ },
20
+ "index.jsx": {
21
+ "type": "FILE",
22
+ "value": "/**\n+ * title: cloud-bread-crumbs\n+ */\n\n\n\nimport React from 'react';\nimport { BreadCrumbs, Button } from 'cloud-react';\n\nexport default class BreadCrumbsDemo extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n size: 'default'\n };\n }\n\n onChangeSize = size => {\n this.setState({ size });\n }\n\n onClickBreadCrumbs = item => {\n console.log(item);\n };\n\n getButtonType = size => {\n return this.state.size === size ? 'primary' : 'normal';\n }\n render() {\n const { size } = this.state;\n const { onChangeSize, onClickBreadCrumbs, getButtonType } = this;\n const list = [\n {\n key: 'home',\n title: '首页'\n },\n {\n key: 'bread-crumbs',\n title: '面包屑'\n },\n {\n key: 'a3',\n title: '查看详情'\n }\n ];\n\n\t\treturn (\n\t\t\t<>\n <div className=\"basic-action\">\n <Button type={getButtonType('large')} onClick={() => {onChangeSize('large')}}>large</Button>\n <Button type={getButtonType('default')} onClick={() => {onChangeSize('default')}}>default</Button>\n <Button type={getButtonType('small')} onClick={() => {onChangeSize('small')}}>small</Button>\n <Button type=\"link\" disabled>\n current: {size}\n </Button>\n </div>\n <div>\n <BreadCrumbs list={list} size={size} onClick={onClickBreadCrumbs.bind(this)}/>\n </div>\n </>\n\t\t);\n\t}\n}"
23
+ }
24
+ }
25
+ },
26
+ {
27
+ "type": "BLOCK",
28
+ "identifier": "basic-demo",
29
+ "dependencies": {
30
+ "react": {
31
+ "type": "NPM",
32
+ "value": "16.14.0"
33
+ },
34
+ "cloud-react": {
35
+ "type": "NPM",
36
+ "value": "0.0.98"
37
+ },
38
+ "index.jsx": {
39
+ "type": "FILE",
40
+ "value": "/**\n+ * title: cloud-bread-crumbs\n+ */\n\n\n\nimport React from 'react';\nimport { BreadCrumbs, Button } from 'cloud-react';\n\nexport default class BreadCrumbsDemo extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n size: 'default'\n };\n }\n\n onChangeSize = size => {\n this.setState({ size });\n }\n\n onClickBreadCrumbs = item => {\n console.log(item);\n };\n\n getButtonType = size => {\n return this.state.size === size ? 'primary' : 'normal';\n }\n render() {\n const { size } = this.state;\n const { onChangeSize, onClickBreadCrumbs, getButtonType } = this;\n const list = [\n {\n key: 'home',\n title: '首页'\n },\n {\n key: 'bread-crumbs',\n title: '面包屑'\n },\n {\n key: 'a3',\n title: '查看详情'\n }\n ];\n\n\t\treturn (\n\t\t\t<>\n <div className=\"basic-action\">\n <Button type={getButtonType('large')} onClick={() => {onChangeSize('large')}}>large</Button>\n <Button type={getButtonType('default')} onClick={() => {onChangeSize('default')}}>default</Button>\n <Button type={getButtonType('small')} onClick={() => {onChangeSize('small')}}>small</Button>\n <Button type=\"link\" disabled>\n current: {size}\n </Button>\n </div>\n <div>\n <BreadCrumbs list={list} size={size} onClick={onClickBreadCrumbs.bind(this)}/>\n </div>\n </>\n\t\t);\n\t}\n}"
41
+ }
42
+ }
43
+ },
44
+ {
45
+ "type": "BLOCK",
46
+ "identifier": "basic-demo",
47
+ "dependencies": {
48
+ "react": {
49
+ "type": "NPM",
50
+ "value": "16.14.0"
51
+ },
52
+ "cloud-react": {
53
+ "type": "NPM",
54
+ "value": "0.0.98"
55
+ },
56
+ "index.jsx": {
57
+ "type": "FILE",
58
+ "value": "import React from 'react';\nimport { Button, InputNumber } from 'cloud-react';\n\nconst blank = '\\u00A0';\n\nexport default class ButtonDemo extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div>\n\t\t\t\t\t<Button type=\"primary\">primary</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button type=\"normal\">normal</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button type=\"dashed\">dashed</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button type=\"link\">link</Button>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n}"
59
+ }
60
+ }
61
+ },
62
+ {
63
+ "type": "BLOCK",
64
+ "identifier": "block-demo",
65
+ "dependencies": {
66
+ "react": {
67
+ "type": "NPM",
68
+ "value": "16.14.0"
69
+ },
70
+ "cloud-react": {
71
+ "type": "NPM",
72
+ "value": "0.0.98"
73
+ },
74
+ "index.jsx": {
75
+ "type": "FILE",
76
+ "value": "import React from 'react';\nimport { Button } from 'cloud-react';\n\nconst blank = '\\u00A0';\n\nexport default class ButtonDemo extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div>\n\t\t\t\t\t<Button block type=\"primary\">\n\t\t\t\t\t\tprimary\n\t\t\t\t\t</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button block type=\"normal\">\n\t\t\t\t\t\tnormal\n\t\t\t\t\t</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button block type=\"dashed\">\n\t\t\t\t\t\tdashed\n\t\t\t\t\t</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button block type=\"link\">\n\t\t\t\t\t\tlink\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n}"
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "type": "BLOCK",
82
+ "identifier": "basic-demo",
83
+ "dependencies": {
84
+ "react": {
85
+ "type": "NPM",
86
+ "value": "16.14.0"
87
+ },
88
+ "cloud-react": {
89
+ "type": "NPM",
90
+ "value": "0.0.98"
91
+ },
92
+ "index.jsx": {
93
+ "type": "FILE",
94
+ "value": "import React from 'react';\nimport { Button, InputNumber } from 'cloud-react';\n\nconst blank = '\\u00A0';\n\nexport default class ButtonDemo extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div>\n\t\t\t\t\t<Button type=\"primary\">primary</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button type=\"normal\">normal</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button type=\"dashed\">dashed</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button type=\"link\">link</Button>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n}"
95
+ }
96
+ }
97
+ },
98
+ {
99
+ "type": "BLOCK",
100
+ "identifier": "block-demo",
101
+ "dependencies": {
102
+ "react": {
103
+ "type": "NPM",
104
+ "value": "16.14.0"
105
+ },
106
+ "cloud-react": {
107
+ "type": "NPM",
108
+ "value": "0.0.98"
109
+ },
110
+ "index.jsx": {
111
+ "type": "FILE",
112
+ "value": "import React from 'react';\nimport { Button } from 'cloud-react';\n\nconst blank = '\\u00A0';\n\nexport default class ButtonDemo extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div>\n\t\t\t\t\t<Button block type=\"primary\">\n\t\t\t\t\t\tprimary\n\t\t\t\t\t</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button block type=\"normal\">\n\t\t\t\t\t\tnormal\n\t\t\t\t\t</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button block type=\"dashed\">\n\t\t\t\t\t\tdashed\n\t\t\t\t\t</Button>\n\t\t\t\t\t{blank}\n\t\t\t\t\t<Button block type=\"link\">\n\t\t\t\t\t\tlink\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n}"
113
+ }
114
+ }
115
+ },
116
+ {
117
+ "type": "BLOCK",
118
+ "identifier": "form-demo",
119
+ "dependencies": {
120
+ "cloud-react": {
121
+ "type": "NPM",
122
+ "value": "0.0.98"
123
+ },
124
+ "index.jsx": {
125
+ "type": "FILE",
126
+ "value": "import { Form, Field, Input } from 'cloud-react';\n\n// 简单场景\nfunction FormA() {\n\tconst field = Field.useField();\n\n\treturn (\n\t\t<Form field={field}>\n\t\t\t<Form.Item>\n\t\t\t\t<Input\n\t\t\t\t\t{...field.init('name', {\n\t\t\t\t\t\trules: [{ required: true, message: '用户名必须填写' }]\n\t\t\t\t\t})}\n\t\t\t\t/>\n\t\t\t</Form.Item>\n\t\t</Form>\n\t);\n}\n\n// 复杂场景,需要使用Nexus组件\nfunction FormB() {\n\tB;\n\tconst field = Field.useField();\n\n\treturn (\n\t\t<Form field={field}>\n\t\t\t<Form.Item>\n\t\t\t\t<UseNexus field={field} />\n\t\t\t</Form.Item>\n\t\t</Form>\n\t);\n}\n\nfunction UseNexus() {\n\treturn (\n\t\t<Form.Nexus>\n\t\t\t<Input\n\t\t\t\t{...field.init('firstName', {\n\t\t\t\t\trules: [{ required: true, message: '名字必须填写' }]\n\t\t\t\t})}\n\t\t\t/>\n\n\t\t\t<Input\n\t\t\t\t{...field.init('lastName', {\n\t\t\t\t\trules: [{ required: true, message: '姓氏必须填写' }]\n\t\t\t\t})}\n\t\t\t/>\n\t\t</Form.Nexus>\n\t);\n}"
127
+ }
128
+ }
129
+ }
130
+ ]
131
+ }
132
+ }