@chaoswise/business 0.0.1

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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +113 -0
  3. package/config/babel/antdComs.js +51 -0
  4. package/config/babel/formily.js +22 -0
  5. package/config/babel/index.js +36 -0
  6. package/config/city/citys.js +1964 -0
  7. package/config/theme/CWTheme.js +427 -0
  8. package/config/theme/chart.dark.js +394 -0
  9. package/config/theme/chart.light.js +3 -0
  10. package/config/theme/common.less +161 -0
  11. package/config/theme/dark.js +784 -0
  12. package/config/theme/dark.less +80 -0
  13. package/config/theme/default.js +717 -0
  14. package/config/theme/default.less +144 -0
  15. package/config/theme/style/color/bezierEasing.less +110 -0
  16. package/config/theme/style/color/colorPalette.less +85 -0
  17. package/config/theme/style/color/colors.less +162 -0
  18. package/config/theme/style/color/tinyColor.less +1184 -0
  19. package/config/theme/style/compact.less +4 -0
  20. package/config/theme/style/components.less +65 -0
  21. package/config/theme/style/core/base.less +10 -0
  22. package/config/theme/style/core/global.less +491 -0
  23. package/config/theme/style/core/iconfont.less +22 -0
  24. package/config/theme/style/core/index.less +5 -0
  25. package/config/theme/style/core/motion/fade.less +34 -0
  26. package/config/theme/style/core/motion/move.less +129 -0
  27. package/config/theme/style/core/motion/other.less +51 -0
  28. package/config/theme/style/core/motion/slide.less +129 -0
  29. package/config/theme/style/core/motion/zoom.less +179 -0
  30. package/config/theme/style/core/motion.less +22 -0
  31. package/config/theme/style/css.js +3 -0
  32. package/config/theme/style/dark.less +4 -0
  33. package/config/theme/style/default.css +1784 -0
  34. package/config/theme/style/default.less +4 -0
  35. package/config/theme/style/index-pure.less +2 -0
  36. package/config/theme/style/index.css +1784 -0
  37. package/config/theme/style/index.d.ts +1 -0
  38. package/config/theme/style/index.js +3 -0
  39. package/config/theme/style/index.less +3 -0
  40. package/config/theme/style/mixins/box.less +7 -0
  41. package/config/theme/style/mixins/clearfix.less +16 -0
  42. package/config/theme/style/mixins/compatibility.less +13 -0
  43. package/config/theme/style/mixins/customize.less +181 -0
  44. package/config/theme/style/mixins/iconfont.less +28 -0
  45. package/config/theme/style/mixins/index.less +14 -0
  46. package/config/theme/style/mixins/modal-mask.less +30 -0
  47. package/config/theme/style/mixins/motion.less +33 -0
  48. package/config/theme/style/mixins/operation-unit.less +16 -0
  49. package/config/theme/style/mixins/reset.less +11 -0
  50. package/config/theme/style/mixins/rounded-arrow.less +44 -0
  51. package/config/theme/style/mixins/size.less +10 -0
  52. package/config/theme/style/mixins/typography.less +58 -0
  53. package/config/theme/style/themes/compact.less +295 -0
  54. package/config/theme/style/themes/dark.less +457 -0
  55. package/config/theme/style/themes/default.less +1080 -0
  56. package/config/theme/style/themes/index.less +7 -0
  57. package/config/theme/style/themes/variable.less +1135 -0
  58. package/config/theme/style/variable.less +4 -0
  59. package/lib/PropertyControlViewer/assets/doCommon.less +79 -0
  60. package/lib/PropertyControlViewer/assets/doSelect.less +81 -0
  61. package/lib/PropertyControlViewer/assets/index.less +189 -0
  62. package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/iconfont.js +1 -0
  63. package/lib/PropertyControlViewer/components/DoAppIcon/iconData/IconJson.js +0 -0
  64. package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +127 -0
  65. package/lib/PropertyControlViewer/components/TagShowMoreList/index.less +104 -0
  66. package/lib/PropertyControlViewer/config/constants.js +84 -0
  67. package/lib/PropertyControlViewer/config/utils.js +338 -0
  68. package/lib/PropertyControlViewer/index.less +161 -0
  69. package/lib/demo.js +0 -0
  70. package/lib/index.js +1 -0
  71. package/package.json +106 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 DOCP
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,113 @@
1
+
2
+ # 项目名称
3
+ 前端公共组件库
4
+ # 一句话了解我
5
+ 基于antd3.x根据公司UIUE规范进行二次封装的前端公共组件库,用于统一公司产品风格,提高研发人员开发效率
6
+
7
+ # Features
8
+ #### 1. 包含符合UIUE的公共组件
9
+ #### 2. 支持antd全部组件,引用和使用方法参考[antd官方文档](https://3x.ant.design/docs/react/introduce-cn)
10
+ #### 3. 支持按需加载
11
+
12
+ # 分支说明
13
+ master: 主分支
14
+ develop: 开发分支
15
+ 基于develop分支开发,然后提交MR到仓库中
16
+
17
+ # [组件开发文档](./DEVELOP.md)
18
+
19
+ # 使用方法
20
+ ### 安装
21
+ ```
22
+ npm i @chaoswise/ui -S
23
+ ```
24
+ ### 常规组件使用
25
+ ```jsx
26
+ // antd组件和自定义组件全部使用按需引入形式
27
+ import { Button } from '@chaoswise/ui';
28
+
29
+ const Demo = () => {
30
+ return (
31
+ <Button type='primary'>Submit</Button>
32
+ )
33
+ }
34
+
35
+ export default Demo;
36
+ ```
37
+ ### Formily组件使用
38
+ ```jsx
39
+ // 目前已经集成以下组件和api
40
+ import { Form, FormItem, MegaLayout, FieldList, FormButtonGroup, FormPath, Reset, Submit, subscribeFields } from '@chaoswise/ui/formily';
41
+ // 如需使用formily相关其它api 从formily引入
42
+ import { formily } from '@chaoswise/ui/formily';
43
+ const { useEffect } = formily;
44
+ ```
45
+ ### 脱离公共框架使用需要配置按需引用配置
46
+ 修改babel-loader下的babel-plugin-import插件配置(脱离公共框架独立使用)
47
+ ```jsx
48
+ // 引入配置
49
+ const babelConfig = require("@chaoswise/ui/config/babel");
50
+ const formilyBabel = require("@chaoswise/ui/config/babel/formily");
51
+
52
+ // 方案1
53
+ plugins: [
54
+ [
55
+ "import",
56
+ [
57
+ babelConfig, // @chaoswise/ui 按需引入babel配置
58
+ {
59
+ libraryName: "antd",
60
+ style: true
61
+ },
62
+ formilyBabel, // @chaoswise/ui/formily 按需引入babel配置
63
+ ]
64
+ ]
65
+ ]
66
+
67
+
68
+ // 方案2
69
+ plugins: [
70
+ [
71
+ "import",
72
+ babelConfig, // @chaoswise/ui 按需引入babel配置
73
+ "chaoswise"
74
+ ],
75
+ [
76
+ "import",
77
+ {
78
+ libraryName: "antd",
79
+ style: true
80
+ },
81
+ "antd"
82
+ ],
83
+ [
84
+ "import",
85
+ formilyBabel, // @chaoswise/ui/formily 按需引入babel配置
86
+ "formily"
87
+ ],
88
+ ]
89
+ ```
90
+
91
+ ```
92
+ ```
93
+ # 注意:
94
+ 以下组件基于antd进行了二次封装,请查看相关组件文档
95
+
96
+ 组件名称 | 备注
97
+ ---|---
98
+ Pagination | 统一UE风格,api不变
99
+ Modal | 支持可拖拽
100
+ Upload | 基于antd的Upload封装,增加进度条显示,api有变化,具体见文档
101
+ ConfigProvider | 在原有基础上增加国际化切换方案
102
+ Empty | 统一UE风格,api不变
103
+ ---
104
+ 如需引用antd原生组件
105
+ ```
106
+ import Upload from '@chaoswise/ui/lib/Antd/Upload';
107
+ ```
108
+ # 其它相关文档
109
+ 1. [组件预览以及文档地址](http://10.0.1.133:8888/#/iframe/businessui)
110
+ 2. [更新日志](https://yunzhihui.feishu.cn/docs/doccnKZ3vU8U1I8v1iFX6uUaG1g)
111
+
112
+ #
113
+
@@ -0,0 +1,51 @@
1
+ /*
2
+ * @Author: your name
3
+ * @Date: 2022-02-21 16:23:43
4
+ * @LastEditTime: 2023-05-11 17:35:05
5
+ * @LastEditors: andrew.qiao andrew.qiao@cloudwise.com
6
+ * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
7
+ * @FilePath: /change_02/aops_web_commons/packages/ui/config/babel/antdComs.js
8
+ */
9
+
10
+ module.exports = [
11
+ 'Affix', 'Anchor', 'AutoComplete',
12
+ 'Avatar', 'BackTop', 'Breadcrumb',
13
+ 'Calendar', 'Card', 'Carousel', 'Col',
14
+ 'Comment', 'Descriptions',
15
+ 'Divider', 'Drawer', 'Dropdown',
16
+ 'Icon',
17
+ 'List', 'LocaleProvider', 'Layout', 'Mention',
18
+ 'Mentions', 'PageHeader', 'Transfer',
19
+ 'Popover',
20
+ 'Rate', 'Result', 'Row',
21
+ 'Skeleton', 'Spin',
22
+ 'Statistic', 'Steps', 'Switch', 'TimePicker','TreeSelect',
23
+ 'Select',
24
+ 'Typography',
25
+ 'version', 'Table', 'Tree',
26
+ ];
27
+ // 已经被覆盖的组件
28
+ /**
29
+ * Button
30
+ * ConfigProvider
31
+ * Modal
32
+ * Pagination
33
+ * Upload
34
+ * Tree
35
+ * Table
36
+ * Tabs
37
+ * Tooltip
38
+ * Popconfirm
39
+ * Radio
40
+ * Checkbox
41
+ * message
42
+ * Slider
43
+ * Input
44
+ * Progress
45
+ * Badge
46
+ * Alert
47
+ * Menu
48
+ * InputNumber
49
+ * Cascader
50
+ * notification
51
+ */
@@ -0,0 +1,22 @@
1
+ const fse = require('fs-extra');
2
+ // 项目的根目录
3
+ const projectPath = process.cwd();
4
+
5
+ const babelConfig = {
6
+ "libraryName": "@chaoswise/ui/formily",
7
+ "camel2DashComponentName": false,
8
+ "customName": name => {
9
+ return `@chaoswise/ui/lib/Formily/${name}`
10
+ },
11
+ "style": name => {
12
+ // 判断是否有样式文件
13
+ const fileTargetPath = `${projectPath}/node_modules/${name}/index.less`;
14
+ const isExist = fse.pathExistsSync(fileTargetPath);
15
+ if(!isExist) {
16
+ return false
17
+ }
18
+ return `${name}/index.less`
19
+ }
20
+ }
21
+
22
+ module.exports = babelConfig;
@@ -0,0 +1,36 @@
1
+ const fse = require('fs-extra');
2
+ // 项目的根目录
3
+ const projectPath = process.cwd();
4
+
5
+ const ANTD_COMPONENTS = require('./antdComs');
6
+
7
+ const babelConfig = {
8
+ "libraryName": "@chaoswise/ui",
9
+ "camel2DashComponentName": false,
10
+ "customName": name => {
11
+ const antdTarget = ANTD_COMPONENTS.find(item => name === item);
12
+ if(antdTarget) {
13
+ return `@chaoswise/ui/lib/Antd/${name}`
14
+ }
15
+ return `@chaoswise/ui/lib/${name}`
16
+ },
17
+ // "style": name => {
18
+ // if(name.includes('Antd')) {
19
+ // const fileTargetPath = `${projectPath}/node_modules/${name}.less`;
20
+ // const isExist = fse.pathExistsSync(fileTargetPath);
21
+ // if(!isExist) {
22
+ // return false
23
+ // }
24
+ // return `${name}.less`
25
+ // }
26
+ // // 判断是否有样式文件
27
+ // const fileTargetPath = `${projectPath}/node_modules/${name}/index.less`;
28
+ // const isExist = fse.pathExistsSync(fileTargetPath);
29
+ // if(!isExist) {
30
+ // return false
31
+ // }
32
+ // return `${name}/index.less`
33
+ // }
34
+ }
35
+
36
+ module.exports = babelConfig;