@cloudbase/weda-ui 0.2.7 → 0.2.11

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 (130) hide show
  1. package/package.json +2 -4
  2. package/src/configs/components/container.json +2 -1
  3. package/src/configs/components/form/richText.json +2 -1
  4. package/src/configs/components/form/uploader.json +4 -4
  5. package/src/configs/components/image.json +2 -1
  6. package/src/configs/components/link.json +2 -1
  7. package/src/configs/components/richtextview.json +2 -1
  8. package/src/configs/components/scrollVeiw.json +2 -1
  9. package/src/configs/components/swiper.json +2 -1
  10. package/src/configs/components/tabs.json +2 -1
  11. package/src/configs/components/text.json +2 -1
  12. package/src/configs/index.js +4 -7
  13. package/src/mp/components/form/uploader/index.js +15 -8
  14. package/src/mp/components/form/uploader/index.wxml +1 -1
  15. package/src/web/components/form/enumSelect/MultipleSelect.jsx +89 -0
  16. package/src/web/components/form/enumSelect/NormalSelect.jsx +101 -0
  17. package/src/web/components/form/enumSelect/SelectContainer.jsx +43 -0
  18. package/src/web/components/form/enumSelect/index.jsx +9 -0
  19. package/src/web/components/form/enumSelect/props/defaultProps.js +39 -0
  20. package/src/web/components/form/enumSelect/props/propsTypes.js +50 -0
  21. package/src/web/components/form/select/region/{cities.json → cities.js} +2 -2
  22. package/src/web/components/form/select/region/index.js +3 -3
  23. package/src/web/components/form/select/region/{provinces.json → provinces.js} +2 -2
  24. package/src/web/components/form/select/region/{regions.json → regions.js} +2 -2
  25. package/src/web/components/form/switch/index.jsx +1 -0
  26. package/src/web/components/form/uploader/uploader.h5.jsx +42 -16
  27. package/src/web/components/form/uploader/uploader.pc.jsx +1 -1
  28. package/src/web/components/image/image.jsx +0 -1
  29. package/src/web/components/index.js +1 -1
  30. package/src/web/components/link/test/__snapshots__/storybook.test.js.snap +754 -0
  31. package/src/web/components/modal/index.jsx +3 -2
  32. package/CHANGELOG.md +0 -240
  33. package/src/.DS_Store +0 -0
  34. package/src/configs/components/markdown.json +0 -17
  35. package/src/mp/.gitignore +0 -10
  36. package/src/mp/components/markdown/index.js +0 -27
  37. package/src/mp/components/markdown/index.json +0 -6
  38. package/src/mp/components/markdown/index.wxml +0 -1
  39. package/src/mp/components/markdown/towxml/audio-player/Audio.js +0 -99
  40. package/src/mp/components/markdown/towxml/audio-player/audio-player.js +0 -102
  41. package/src/mp/components/markdown/towxml/audio-player/audio-player.json +0 -5
  42. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxml +0 -14
  43. package/src/mp/components/markdown/towxml/audio-player/audio-player.wxss +0 -175
  44. package/src/mp/components/markdown/towxml/audio-player/loading.svg +0 -1
  45. package/src/mp/components/markdown/towxml/config.js +0 -285
  46. package/src/mp/components/markdown/towxml/decode.js +0 -26
  47. package/src/mp/components/markdown/towxml/decode.json +0 -12
  48. package/src/mp/components/markdown/towxml/decode.wxml +0 -1
  49. package/src/mp/components/markdown/towxml/decode.wxss +0 -0
  50. package/src/mp/components/markdown/towxml/img/img.js +0 -98
  51. package/src/mp/components/markdown/towxml/img/img.json +0 -3
  52. package/src/mp/components/markdown/towxml/img/img.wxml +0 -1
  53. package/src/mp/components/markdown/towxml/img/img.wxss +0 -0
  54. package/src/mp/components/markdown/towxml/index.js +0 -19
  55. package/src/mp/components/markdown/towxml/latex/latex.js +0 -53
  56. package/src/mp/components/markdown/towxml/latex/latex.json +0 -5
  57. package/src/mp/components/markdown/towxml/latex/latex.wxml +0 -1
  58. package/src/mp/components/markdown/towxml/latex/latex.wxss +0 -0
  59. package/src/mp/components/markdown/towxml/parse/highlight/highlight.js +0 -729
  60. package/src/mp/components/markdown/towxml/parse/highlight/index.js +0 -7
  61. package/src/mp/components/markdown/towxml/parse/highlight/languages/bash.js +0 -91
  62. package/src/mp/components/markdown/towxml/parse/highlight/languages/c-like.js +0 -244
  63. package/src/mp/components/markdown/towxml/parse/highlight/languages/c.js +0 -20
  64. package/src/mp/components/markdown/towxml/parse/highlight/languages/css.js +0 -138
  65. package/src/mp/components/markdown/towxml/parse/highlight/languages/dart.js +0 -135
  66. package/src/mp/components/markdown/towxml/parse/highlight/languages/go.js +0 -57
  67. package/src/mp/components/markdown/towxml/parse/highlight/languages/htmlbars.js +0 -79
  68. package/src/mp/components/markdown/towxml/parse/highlight/languages/java.js +0 -126
  69. package/src/mp/components/markdown/towxml/parse/highlight/languages/javascript.js +0 -263
  70. package/src/mp/components/markdown/towxml/parse/highlight/languages/json.js +0 -51
  71. package/src/mp/components/markdown/towxml/parse/highlight/languages/less.js +0 -177
  72. package/src/mp/components/markdown/towxml/parse/highlight/languages/nginx.js +0 -103
  73. package/src/mp/components/markdown/towxml/parse/highlight/languages/php.js +0 -152
  74. package/src/mp/components/markdown/towxml/parse/highlight/languages/python-repl.js +0 -27
  75. package/src/mp/components/markdown/towxml/parse/highlight/languages/python.js +0 -146
  76. package/src/mp/components/markdown/towxml/parse/highlight/languages/scss.js +0 -137
  77. package/src/mp/components/markdown/towxml/parse/highlight/languages/shell.js +0 -23
  78. package/src/mp/components/markdown/towxml/parse/highlight/languages/typescript.js +0 -198
  79. package/src/mp/components/markdown/towxml/parse/highlight/languages/xml.js +0 -143
  80. package/src/mp/components/markdown/towxml/parse/highlight/style/github.wxss +0 -99
  81. package/src/mp/components/markdown/towxml/parse/highlight/style/monokai.wxss +0 -70
  82. package/src/mp/components/markdown/towxml/parse/index.js +0 -106
  83. package/src/mp/components/markdown/towxml/parse/markdown/index.js +0 -53
  84. package/src/mp/components/markdown/towxml/parse/markdown/markdown.js +0 -5834
  85. package/src/mp/components/markdown/towxml/parse/markdown/plugins/emoji.js +0 -1773
  86. package/src/mp/components/markdown/towxml/parse/markdown/plugins/ins.js +0 -120
  87. package/src/mp/components/markdown/towxml/parse/markdown/plugins/latex.js +0 -193
  88. package/src/mp/components/markdown/towxml/parse/markdown/plugins/mark.js +0 -120
  89. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sub.js +0 -95
  90. package/src/mp/components/markdown/towxml/parse/markdown/plugins/sup.js +0 -95
  91. package/src/mp/components/markdown/towxml/parse/markdown/plugins/todo.js +0 -220
  92. package/src/mp/components/markdown/towxml/parse/markdown/plugins/yuml.js +0 -18
  93. package/src/mp/components/markdown/towxml/parse/parse2/Parser.js +0 -263
  94. package/src/mp/components/markdown/towxml/parse/parse2/Tokenizer.js +0 -507
  95. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/index.js +0 -104
  96. package/src/mp/components/markdown/towxml/parse/parse2/domhandler/node.js +0 -169
  97. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode.js +0 -54
  98. package/src/mp/components/markdown/towxml/parse/parse2/entities/decode_codepoint.js +0 -19
  99. package/src/mp/components/markdown/towxml/parse/parse2/entities/encode.js +0 -54
  100. package/src/mp/components/markdown/towxml/parse/parse2/entities/index.js +0 -30
  101. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/decode.js +0 -31
  102. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/entities.js +0 -2128
  103. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/legacy.js +0 -109
  104. package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/xml.js +0 -2
  105. package/src/mp/components/markdown/towxml/parse/parse2/index.js +0 -8
  106. package/src/mp/components/markdown/towxml/style/main.wxss +0 -378
  107. package/src/mp/components/markdown/towxml/style/theme/dark.wxss +0 -73
  108. package/src/mp/components/markdown/towxml/style/theme/light.wxss +0 -63
  109. package/src/mp/components/markdown/towxml/table/table.js +0 -11
  110. package/src/mp/components/markdown/towxml/table/table.json +0 -6
  111. package/src/mp/components/markdown/towxml/table/table.wxml +0 -24
  112. package/src/mp/components/markdown/towxml/table/table.wxss +0 -0
  113. package/src/mp/components/markdown/towxml/todogroup/todogroup.js +0 -19
  114. package/src/mp/components/markdown/towxml/todogroup/todogroup.json +0 -6
  115. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxml +0 -13
  116. package/src/mp/components/markdown/towxml/todogroup/todogroup.wxss +0 -3
  117. package/src/mp/components/markdown/towxml/towxml.js +0 -17
  118. package/src/mp/components/markdown/towxml/towxml.json +0 -6
  119. package/src/mp/components/markdown/towxml/towxml.wxml +0 -5
  120. package/src/mp/components/markdown/towxml/towxml.wxss +0 -8
  121. package/src/mp/components/markdown/towxml/yuml/yuml.js +0 -51
  122. package/src/mp/components/markdown/towxml/yuml/yuml.json +0 -5
  123. package/src/mp/components/markdown/towxml/yuml/yuml.wxml +0 -5
  124. package/src/mp/components/markdown/towxml/yuml/yuml.wxss +0 -0
  125. package/src/web/.DS_Store +0 -0
  126. package/src/web/components/markdown/index.jsx +0 -40
  127. package/src/web/wedatheme/.git +0 -1
  128. package/src/web/wedatheme/.gitignore +0 -5
  129. package/src/web/wedatheme/.npmrc +0 -1
  130. package/src/web/wedatheme/package-lock.json +0 -14335
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "0.2.7",
3
+ "version": "0.2.11",
4
4
  "main": "./src/index.js",
5
5
  "module": "./src/index",
6
6
  "miniprogram": "mpdist",
@@ -45,10 +45,8 @@
45
45
  "object.fromentries": "^2.0.4",
46
46
  "prop-types": "^15.7.2",
47
47
  "react-easy-swipe": "^0.0.21",
48
- "react-markdown": "^5.0.3",
49
- "react-syntax-highlighter": "^15.4.3",
50
48
  "react-use": "^15.3.4",
51
- "tea-component": "^2.6.22",
49
+ "tea-component": "^2.7.3",
52
50
  "uuid": "8.3.2",
53
51
  "weui": "^2.4.4",
54
52
  "weui.js": "1.2.2"
@@ -41,6 +41,7 @@
41
41
  "title": "普通容器",
42
42
  "category": "布局容器",
43
43
  "description": "通用块状容器",
44
- "componentOrder": 1000
44
+ "componentOrder": 1000,
45
+ "icon": "//imgcache.qq.com/qcloud/lowcode/static/ide/left-material-icon/Container.svg"
45
46
  }
46
47
  }
@@ -113,7 +113,8 @@
113
113
  "meta": {
114
114
  "title": "富文本",
115
115
  "description": "富文本编辑器",
116
- "category": "表单"
116
+ "category": "表单",
117
+ "icon": "//main.qcloudimg.com/raw/adc8cd1b6eb93c0f890ca2322e509a6b/RichText.svg"
117
118
  },
118
119
  "events": [
119
120
  {
@@ -8,7 +8,7 @@
8
8
  "default": ["image/*"],
9
9
  "x-category": "基础属性",
10
10
  "x-index": 6,
11
- "x-platforms": ["PCWEB"],
11
+ "x-platforms": ["WEB"],
12
12
  "items": {
13
13
  "type": "string",
14
14
  "enum": [
@@ -66,8 +66,7 @@
66
66
  "default": 10,
67
67
  "title": "单张大小(M)",
68
68
  "x-category": "基础属性",
69
- "x-index": 5,
70
- "x-platforms": ["PCWEB"]
69
+ "x-index": 5
71
70
  },
72
71
  "maxUploadCount": {
73
72
  "type": "number",
@@ -136,6 +135,7 @@
136
135
  "meta": {
137
136
  "title": "上传图片",
138
137
  "description": "上传图片组件",
139
- "category": "表单"
138
+ "category": "表单",
139
+ "icon": "//main.qcloudimg.com/raw/f781e6bc48efa1cf926fc768fceeab5e/Uploader.svg"
140
140
  }
141
141
  }
@@ -145,6 +145,7 @@
145
145
  "meta": {
146
146
  "title": "图片",
147
147
  "description": "图片组件",
148
- "category": "多媒体"
148
+ "category": "多媒体",
149
+ "icon": "//imgcache.qq.com/qcloud/lowcode/static/ide/left-material-icon/Image.svg"
149
150
  }
150
151
  }
@@ -53,7 +53,8 @@
53
53
  "title": "链接",
54
54
  "description": "",
55
55
  "category": "文本",
56
- "componentOrder": 10
56
+ "componentOrder": 10,
57
+ "icon": "//main.qcloudimg.com/raw/eb8a45dc259eb4925d89ac88be1ecdd9/Link.svg"
57
58
  },
58
59
  "events": [
59
60
  {
@@ -16,6 +16,7 @@
16
16
  "title": "富文本展示",
17
17
  "description": "富文本展示",
18
18
  "category": "文本",
19
- "componentOrder": 0
19
+ "componentOrder": 0,
20
+ "icon": "//main.qcloudimg.com/raw/9c42d779f51105715a032d139344c508/RichTextView.svg"
20
21
  }
21
22
  }
@@ -209,7 +209,8 @@
209
209
  "title": "滚动容器",
210
210
  "description": "滚动容器",
211
211
  "category": "布局容器",
212
- "componentOrder": 80
212
+ "componentOrder": 80,
213
+ "icon": "//imgcache.qq.com/qcloud/lowcode/static/ide/left-material-icon/ScrollView.svg"
213
214
  },
214
215
  "isContainer": true,
215
216
  "mpOrigin": "scroll-view"
@@ -70,7 +70,8 @@
70
70
  "title": "轮播",
71
71
  "description": "轮播图组件",
72
72
  "category": "展示",
73
- "componentOrder": 80
73
+ "componentOrder": 80,
74
+ "icon": "//imgcache.qq.com/qcloud/lowcode/static/ide/left-material-icon/Swiper.svg"
74
75
  },
75
76
  "isContainer": true,
76
77
  "mpOrigin": "swiper"
@@ -70,6 +70,7 @@
70
70
  "name": "Tabs",
71
71
  "title": "选项卡",
72
72
  "description": "选项卡组件",
73
- "category": "展示"
73
+ "category": "展示",
74
+ "icon": "//qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/release/_files/static/comp/icons/Tabs.svg"
74
75
  }
75
76
  }
@@ -41,6 +41,7 @@
41
41
  "title": "文本",
42
42
  "description": "文本内容",
43
43
  "category": "文本",
44
- "componentOrder": 100
44
+ "componentOrder": 100,
45
+ "icon": "//imgcache.qq.com/qcloud/lowcode/static/ide/left-material-icon/Text.svg"
45
46
  }
46
47
  }
@@ -1,7 +1,6 @@
1
- import Button from './components/button';
2
- import Markdown from './components/markdown';
3
- import Text from './components/text';
4
- import Container from './components/container';
1
+ import Button from './components/button.json';
2
+ import Text from './components/text.json';
3
+ import Container from './components/container.json';
5
4
  import Image from './components/image.json';
6
5
  import Link from './components/link.json';
7
6
  // import Picker from './components/picker/picker.json';
@@ -32,7 +31,6 @@ import showModal from './actions/showModal';
32
31
 
33
32
  export const components = {
34
33
  Button,
35
- Markdown,
36
34
  Text,
37
35
  Container,
38
36
  Image,
@@ -59,8 +57,7 @@ export const components = {
59
57
  RichTextView,
60
58
  Link,
61
59
  Drawer,
62
- Tabs
63
-
60
+ Tabs,
64
61
  };
65
62
 
66
63
  export const actions = {
@@ -37,6 +37,10 @@ Component({
37
37
  single: {
38
38
  type: Boolean,
39
39
  value: false
40
+ },
41
+ maxSize: {
42
+ type: Number,
43
+ value: 10
40
44
  }
41
45
  },
42
46
  data: {
@@ -93,14 +97,17 @@ Component({
93
97
  }
94
98
  },
95
99
  observers: {
96
- 'defaultValue': function(value) {
97
- if(!deepEqual(value, this.data.urls)) {
98
- this.setData({
99
- files: value.map(f => ({url: f})),
100
- urls: value
101
- });
102
- }
103
- },
100
+ // 'defaultValue': function(value) {
101
+ // if(!deepEqual(value, this.data.urls)) {
102
+ // if(!Array.isArray(value)) {
103
+ // value = [value].filter(v => v.length > 0);
104
+ // }
105
+ // this.setData({
106
+ // files: value.map(f => ({url: f})),
107
+ // urls: value
108
+ // });
109
+ // }
110
+ // },
104
111
  'maxUploadCount, single': function(maxUploadCount, single) {
105
112
  const maxCount = single ? 1 : maxUploadCount;
106
113
  this.setData({
@@ -1,6 +1,6 @@
1
1
  <mp-cells>
2
2
  <mp-cell>
3
- <mp-uploader files="{{files}}" showDelete="{{true}}" ext-class="{{layout}}" bindfail="uploadError" bindsuccess="uploadSuccess" select="{{selectFile}}" upload="{{uploadFile}}" maxCount="{{maxUploadCount}}" title="{{title}}" tips="{{tips}}" binddelete="onDelete"></mp-uploader>
3
+ <mp-uploader max-size="{{maxSize * 1024 * 1024}}" files="{{files}}" showDelete="{{true}}" ext-class="{{layout}}" bindfail="uploadError" bindsuccess="uploadSuccess" select="{{selectFile}}" upload="{{uploadFile}}" maxCount="{{maxCount}}" title="{{title}}" tips="{{tips}}" binddelete="onDelete"></mp-uploader>
4
4
  </mp-cell>
5
5
  </mp-cells>
6
6
  <!-- uploader delete 实际代码接受 showDelete
@@ -0,0 +1,89 @@
1
+ import * as React from 'react';
2
+ import { SelectMultiple } from 'tea-component';
3
+
4
+ import SelectContainer from './SelectContainer';
5
+
6
+ import { normalProps } from './props/defaultProps';
7
+ import { propTypes } from './props/propsTypes';
8
+
9
+ const MultipleSelect = ({
10
+ // 系统属性
11
+ id,
12
+ style,
13
+ className,
14
+ events,
15
+ // weda 组件属性
16
+ label,
17
+ labelVisible,
18
+ layout,
19
+ requiredFlag,
20
+ decorator,
21
+ // tea组件属性
22
+ value,
23
+ placeholder,
24
+ disabled,
25
+ onChange,
26
+ clearable,
27
+ appearance,
28
+ allOption,
29
+ matchButtonWidth,
30
+ virtual,
31
+ searchable,
32
+ size,
33
+ options,
34
+ // 业务属性
35
+ isModelApp,
36
+ }) => {
37
+ const onSelectChange = (values) => {
38
+ // @ts-ignore
39
+ events.change && events.change({ value: values });
40
+ if (onChange) {
41
+ onChange(values);
42
+ }
43
+ };
44
+
45
+ const multipleSelectProps = {
46
+ placeholder,
47
+ disabled,
48
+ clearable,
49
+ appearance,
50
+ key: id,
51
+ options,
52
+ onChange: onSelectChange,
53
+ matchButtonWidth,
54
+ searchable,
55
+ size,
56
+ defaultValue: value || [],
57
+ allOption,
58
+ staging: false,
59
+ virtual,
60
+ };
61
+
62
+ if (isModelApp) {
63
+ return <SelectMultiple {...multipleSelectProps} />;
64
+ }
65
+ return (
66
+ <SelectContainer
67
+ style={style}
68
+ className={className}
69
+ label={label}
70
+ labelVisible={labelVisible}
71
+ layout={layout}
72
+ // @ts-ignore
73
+ multiCell={false}
74
+ requiredFlag={requiredFlag}
75
+ decorator={decorator}
76
+ id={id}
77
+ >
78
+ <SelectMultiple {...multipleSelectProps} />
79
+ </SelectContainer>
80
+ );
81
+ };
82
+ MultipleSelect.propTypes = {
83
+ ...propTypes,
84
+ };
85
+ MultipleSelect.defaultProps = {
86
+ ...normalProps,
87
+ };
88
+
89
+ export default MultipleSelect;
@@ -0,0 +1,101 @@
1
+ import * as React from 'react';
2
+ import { Select } from 'tea-component';
3
+
4
+ import SelectContainer from './SelectContainer';
5
+
6
+ import { multipleProps } from './props/defaultProps';
7
+ import { propTypes } from './props/propsTypes';
8
+
9
+ const { useState, useEffect } = React;
10
+
11
+ const useValue = (value) => {
12
+ const [selectedValue, setSelectedValue] = useState('');
13
+
14
+ useEffect(() => {
15
+ setSelectedValue(value);
16
+ }, [value]);
17
+
18
+ return [selectedValue, setSelectedValue];
19
+ };
20
+
21
+ const NormalSelect = ({
22
+ // 系统属性
23
+ id,
24
+ style,
25
+ className,
26
+ events,
27
+ // weda 组件属性
28
+ label,
29
+ labelVisible,
30
+ layout,
31
+ requiredFlag,
32
+ decorator,
33
+ // tea组件属性
34
+ value,
35
+ placeholder,
36
+ disabled,
37
+ onChange,
38
+ clearable,
39
+ appearance,
40
+ matchButtonWidth,
41
+ virtual,
42
+ searchable,
43
+ size,
44
+ options,
45
+ // 业务属性
46
+ isModelApp,
47
+ }) => {
48
+ const [selectedValue, setSelectedValue] = useValue(value);
49
+
50
+ const onSelectChange = (value) => {
51
+ // @ts-ignore
52
+ setSelectedValue(value);
53
+ events.change && events.change({ value });
54
+ if (onChange) {
55
+ onChange(value || '');
56
+ }
57
+ };
58
+
59
+ const singleSelectProps = {
60
+ placeholder,
61
+ disabled,
62
+ clearable,
63
+ appearance,
64
+ key: id,
65
+ options,
66
+ onChange: onSelectChange,
67
+ value: selectedValue,
68
+ matchButtonWidth,
69
+ virtual,
70
+ searchable,
71
+ size,
72
+ };
73
+
74
+ if (isModelApp) {
75
+ return <Select {...singleSelectProps} />;
76
+ }
77
+ return (
78
+ <SelectContainer
79
+ style={style}
80
+ className={className}
81
+ label={label}
82
+ labelVisible={labelVisible}
83
+ layout={layout}
84
+ // @ts-ignore
85
+ multiCell={false}
86
+ requiredFlag={requiredFlag}
87
+ decorator={decorator}
88
+ id={id}
89
+ >
90
+ <Select {...singleSelectProps} />
91
+ </SelectContainer>
92
+ );
93
+ };
94
+ NormalSelect.propTypes = {
95
+ ...propTypes,
96
+ };
97
+ NormalSelect.defaultProps = {
98
+ ...multipleProps,
99
+ };
100
+
101
+ export default NormalSelect;
@@ -0,0 +1,43 @@
1
+ import * as React from 'react';
2
+ import classNames from '../../../utils/classnames';
3
+ import { selectContainerPropsTypes } from './props/propsTypes';
4
+ import { renderDecorator } from '../renderDecorator';
5
+
6
+ const SelectContainer = ({
7
+ style,
8
+ className,
9
+ // weda 组件属性
10
+ id,
11
+ label,
12
+ labelVisible,
13
+ layout,
14
+ requiredFlag,
15
+ decorator,
16
+ children,
17
+ }) => {
18
+ const cls = classNames({
19
+ 'weda-ui': true,
20
+ [className]: className,
21
+ });
22
+ const subCls = classNames({
23
+ 'weui-cell': true,
24
+ 'weui-cell_active': true,
25
+ 'weui-cell_form': true,
26
+ 'weui-cell_disabled': true,
27
+ });
28
+ const SelectComponent = <div className={subCls}>{children}</div>;
29
+ return renderDecorator(
30
+ SelectComponent,
31
+ decorator
32
+ )({
33
+ id,
34
+ className: cls,
35
+ style,
36
+ label: labelVisible ? label : null,
37
+ layout,
38
+ multiCell: false,
39
+ requiredFlag,
40
+ });
41
+ };
42
+ SelectContainer.propTypes = selectContainerPropsTypes;
43
+ export default SelectContainer;
@@ -0,0 +1,9 @@
1
+ import MultipleSelect from './MultipleSelect';
2
+ import NormalSelect from './NormalSelect';
3
+
4
+ const EnumSelect = NormalSelect;
5
+
6
+ // @ts-ignore
7
+ EnumSelect.MultipleSelect = MultipleSelect;
8
+
9
+ export default EnumSelect;
@@ -0,0 +1,39 @@
1
+ const commonProps = {
2
+ // 系统属性
3
+ events: {},
4
+ // weda 组件属性
5
+ label: '标题',
6
+ labelVisible: true,
7
+ layout: 'horizontal',
8
+ requiredFlag: false,
9
+ // tea组件属性
10
+ name: 'enumSelect',
11
+ placeholder: '请选择',
12
+ disabled: false,
13
+ onChange: () => {},
14
+ options: [],
15
+ clearable: true,
16
+ appearance: 'button',
17
+ matchButtonWidth: true,
18
+ virtual: true,
19
+ searchable: true,
20
+ size: 'm',
21
+ // 业务属性
22
+ enumType: '',
23
+ customEnum: [],
24
+ optionId: null,
25
+ isModelApp: false,
26
+ };
27
+ export const normalProps = {
28
+ ...commonProps,
29
+ value: '',
30
+ };
31
+ export const multipleProps = {
32
+ ...commonProps,
33
+ value: [],
34
+ allOption: {
35
+ value: 'all',
36
+ text: '全选',
37
+ tooltip: '全选',
38
+ },
39
+ };
@@ -0,0 +1,50 @@
1
+ import * as PropTypes from 'prop-types';
2
+
3
+ const commonPropsTypes = {
4
+ // 系统属性
5
+ id: PropTypes.string,
6
+ style: PropTypes.string,
7
+ className: PropTypes.string,
8
+ // weda 组件属性
9
+ label: PropTypes.string,
10
+ labelVisible: PropTypes.bool,
11
+ layout: PropTypes.string,
12
+ requiredFlag: PropTypes.bool,
13
+ };
14
+ export const propTypes = {
15
+ ...commonPropsTypes,
16
+ // 系统属性
17
+ events: PropTypes.object,
18
+ // tea组件属性
19
+ defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
20
+ name: PropTypes.string,
21
+ placeholder: PropTypes.string,
22
+ disabled: PropTypes.bool,
23
+ onChange: PropTypes.func,
24
+ options: PropTypes.array,
25
+ clearable: PropTypes.bool,
26
+ appearance: PropTypes.string,
27
+ allOption: PropTypes.object,
28
+ matchButtonWidth: PropTypes.bool,
29
+ virtual: PropTypes.bool,
30
+ searchable: PropTypes.bool,
31
+ size: PropTypes.string,
32
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
33
+ // 业务属性
34
+ enumType: PropTypes.string,
35
+ customEnum: PropTypes.array,
36
+ optionId: PropTypes.string,
37
+ isModelApp: PropTypes.bool,
38
+ };
39
+
40
+ export const formContainerPropsTypes = {
41
+ ...commonPropsTypes,
42
+ children: PropTypes.element,
43
+ decorator: PropTypes.element,
44
+ };
45
+
46
+ export const selectContainerPropsTypes = {
47
+ ...commonPropsTypes,
48
+ children: PropTypes.element,
49
+ decorator: PropTypes.element,
50
+ };
@@ -1,4 +1,4 @@
1
- [
1
+ export const cities = [
2
2
  {
3
3
  "level": 2,
4
4
  "code": "1101",
@@ -2407,4 +2407,4 @@
2407
2407
  "parent_code": "65",
2408
2408
  "en": "County-level administrative divisions directly under the Central Government"
2409
2409
  }
2410
- ]
2410
+ ];
@@ -1,7 +1,7 @@
1
1
  // 暂时把地区信息打包在本地, 后续移到COS桶内
2
- import provinces from './provinces.json';
3
- import cities from './cities.json';
4
- import regions from './regions.json';
2
+ import {provinces} from './provinces.js';
3
+ import {cities} from './cities.js';
4
+ import {regions} from './regions.js';
5
5
  import weui from '../../../../utils/weui';
6
6
 
7
7
  let tree;
@@ -1,4 +1,4 @@
1
- [
1
+ export const provinces = [
2
2
  {
3
3
  "level": 1,
4
4
  "code": "11",
@@ -237,4 +237,4 @@
237
237
  "parent_code": "",
238
238
  "en": "Taiwan"
239
239
  }
240
- ]
240
+ ];
@@ -1,4 +1,4 @@
1
- [
1
+ export const regions = [
2
2
  {
3
3
  "level": 3,
4
4
  "code": "110101",
@@ -20642,4 +20642,4 @@
20642
20642
  "parent_code": "620201",
20643
20643
  "en": "Changcheng District"
20644
20644
  }
20645
- ]
20645
+ ];
@@ -70,6 +70,7 @@ export default function Switch({
70
70
  (
71
71
  <TeaSwitch
72
72
  id={_id}
73
+ value={checked}
73
74
  disabled={disabled}
74
75
  onChange={onChange}
75
76
  />