@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.
- package/package.json +2 -4
- package/src/configs/components/container.json +2 -1
- package/src/configs/components/form/richText.json +2 -1
- package/src/configs/components/form/uploader.json +4 -4
- package/src/configs/components/image.json +2 -1
- package/src/configs/components/link.json +2 -1
- package/src/configs/components/richtextview.json +2 -1
- package/src/configs/components/scrollVeiw.json +2 -1
- package/src/configs/components/swiper.json +2 -1
- package/src/configs/components/tabs.json +2 -1
- package/src/configs/components/text.json +2 -1
- package/src/configs/index.js +4 -7
- package/src/mp/components/form/uploader/index.js +15 -8
- package/src/mp/components/form/uploader/index.wxml +1 -1
- package/src/web/components/form/enumSelect/MultipleSelect.jsx +89 -0
- package/src/web/components/form/enumSelect/NormalSelect.jsx +101 -0
- package/src/web/components/form/enumSelect/SelectContainer.jsx +43 -0
- package/src/web/components/form/enumSelect/index.jsx +9 -0
- package/src/web/components/form/enumSelect/props/defaultProps.js +39 -0
- package/src/web/components/form/enumSelect/props/propsTypes.js +50 -0
- package/src/web/components/form/select/region/{cities.json → cities.js} +2 -2
- package/src/web/components/form/select/region/index.js +3 -3
- package/src/web/components/form/select/region/{provinces.json → provinces.js} +2 -2
- package/src/web/components/form/select/region/{regions.json → regions.js} +2 -2
- package/src/web/components/form/switch/index.jsx +1 -0
- package/src/web/components/form/uploader/uploader.h5.jsx +42 -16
- package/src/web/components/form/uploader/uploader.pc.jsx +1 -1
- package/src/web/components/image/image.jsx +0 -1
- package/src/web/components/index.js +1 -1
- package/src/web/components/link/test/__snapshots__/storybook.test.js.snap +754 -0
- package/src/web/components/modal/index.jsx +3 -2
- package/CHANGELOG.md +0 -240
- package/src/.DS_Store +0 -0
- package/src/configs/components/markdown.json +0 -17
- package/src/mp/.gitignore +0 -10
- package/src/mp/components/markdown/index.js +0 -27
- package/src/mp/components/markdown/index.json +0 -6
- package/src/mp/components/markdown/index.wxml +0 -1
- package/src/mp/components/markdown/towxml/audio-player/Audio.js +0 -99
- package/src/mp/components/markdown/towxml/audio-player/audio-player.js +0 -102
- package/src/mp/components/markdown/towxml/audio-player/audio-player.json +0 -5
- package/src/mp/components/markdown/towxml/audio-player/audio-player.wxml +0 -14
- package/src/mp/components/markdown/towxml/audio-player/audio-player.wxss +0 -175
- package/src/mp/components/markdown/towxml/audio-player/loading.svg +0 -1
- package/src/mp/components/markdown/towxml/config.js +0 -285
- package/src/mp/components/markdown/towxml/decode.js +0 -26
- package/src/mp/components/markdown/towxml/decode.json +0 -12
- package/src/mp/components/markdown/towxml/decode.wxml +0 -1
- package/src/mp/components/markdown/towxml/decode.wxss +0 -0
- package/src/mp/components/markdown/towxml/img/img.js +0 -98
- package/src/mp/components/markdown/towxml/img/img.json +0 -3
- package/src/mp/components/markdown/towxml/img/img.wxml +0 -1
- package/src/mp/components/markdown/towxml/img/img.wxss +0 -0
- package/src/mp/components/markdown/towxml/index.js +0 -19
- package/src/mp/components/markdown/towxml/latex/latex.js +0 -53
- package/src/mp/components/markdown/towxml/latex/latex.json +0 -5
- package/src/mp/components/markdown/towxml/latex/latex.wxml +0 -1
- package/src/mp/components/markdown/towxml/latex/latex.wxss +0 -0
- package/src/mp/components/markdown/towxml/parse/highlight/highlight.js +0 -729
- package/src/mp/components/markdown/towxml/parse/highlight/index.js +0 -7
- package/src/mp/components/markdown/towxml/parse/highlight/languages/bash.js +0 -91
- package/src/mp/components/markdown/towxml/parse/highlight/languages/c-like.js +0 -244
- package/src/mp/components/markdown/towxml/parse/highlight/languages/c.js +0 -20
- package/src/mp/components/markdown/towxml/parse/highlight/languages/css.js +0 -138
- package/src/mp/components/markdown/towxml/parse/highlight/languages/dart.js +0 -135
- package/src/mp/components/markdown/towxml/parse/highlight/languages/go.js +0 -57
- package/src/mp/components/markdown/towxml/parse/highlight/languages/htmlbars.js +0 -79
- package/src/mp/components/markdown/towxml/parse/highlight/languages/java.js +0 -126
- package/src/mp/components/markdown/towxml/parse/highlight/languages/javascript.js +0 -263
- package/src/mp/components/markdown/towxml/parse/highlight/languages/json.js +0 -51
- package/src/mp/components/markdown/towxml/parse/highlight/languages/less.js +0 -177
- package/src/mp/components/markdown/towxml/parse/highlight/languages/nginx.js +0 -103
- package/src/mp/components/markdown/towxml/parse/highlight/languages/php.js +0 -152
- package/src/mp/components/markdown/towxml/parse/highlight/languages/python-repl.js +0 -27
- package/src/mp/components/markdown/towxml/parse/highlight/languages/python.js +0 -146
- package/src/mp/components/markdown/towxml/parse/highlight/languages/scss.js +0 -137
- package/src/mp/components/markdown/towxml/parse/highlight/languages/shell.js +0 -23
- package/src/mp/components/markdown/towxml/parse/highlight/languages/typescript.js +0 -198
- package/src/mp/components/markdown/towxml/parse/highlight/languages/xml.js +0 -143
- package/src/mp/components/markdown/towxml/parse/highlight/style/github.wxss +0 -99
- package/src/mp/components/markdown/towxml/parse/highlight/style/monokai.wxss +0 -70
- package/src/mp/components/markdown/towxml/parse/index.js +0 -106
- package/src/mp/components/markdown/towxml/parse/markdown/index.js +0 -53
- package/src/mp/components/markdown/towxml/parse/markdown/markdown.js +0 -5834
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/emoji.js +0 -1773
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/ins.js +0 -120
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/latex.js +0 -193
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/mark.js +0 -120
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/sub.js +0 -95
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/sup.js +0 -95
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/todo.js +0 -220
- package/src/mp/components/markdown/towxml/parse/markdown/plugins/yuml.js +0 -18
- package/src/mp/components/markdown/towxml/parse/parse2/Parser.js +0 -263
- package/src/mp/components/markdown/towxml/parse/parse2/Tokenizer.js +0 -507
- package/src/mp/components/markdown/towxml/parse/parse2/domhandler/index.js +0 -104
- package/src/mp/components/markdown/towxml/parse/parse2/domhandler/node.js +0 -169
- package/src/mp/components/markdown/towxml/parse/parse2/entities/decode.js +0 -54
- package/src/mp/components/markdown/towxml/parse/parse2/entities/decode_codepoint.js +0 -19
- package/src/mp/components/markdown/towxml/parse/parse2/entities/encode.js +0 -54
- package/src/mp/components/markdown/towxml/parse/parse2/entities/index.js +0 -30
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/decode.js +0 -31
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/entities.js +0 -2128
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/legacy.js +0 -109
- package/src/mp/components/markdown/towxml/parse/parse2/entities/maps/xml.js +0 -2
- package/src/mp/components/markdown/towxml/parse/parse2/index.js +0 -8
- package/src/mp/components/markdown/towxml/style/main.wxss +0 -378
- package/src/mp/components/markdown/towxml/style/theme/dark.wxss +0 -73
- package/src/mp/components/markdown/towxml/style/theme/light.wxss +0 -63
- package/src/mp/components/markdown/towxml/table/table.js +0 -11
- package/src/mp/components/markdown/towxml/table/table.json +0 -6
- package/src/mp/components/markdown/towxml/table/table.wxml +0 -24
- package/src/mp/components/markdown/towxml/table/table.wxss +0 -0
- package/src/mp/components/markdown/towxml/todogroup/todogroup.js +0 -19
- package/src/mp/components/markdown/towxml/todogroup/todogroup.json +0 -6
- package/src/mp/components/markdown/towxml/todogroup/todogroup.wxml +0 -13
- package/src/mp/components/markdown/towxml/todogroup/todogroup.wxss +0 -3
- package/src/mp/components/markdown/towxml/towxml.js +0 -17
- package/src/mp/components/markdown/towxml/towxml.json +0 -6
- package/src/mp/components/markdown/towxml/towxml.wxml +0 -5
- package/src/mp/components/markdown/towxml/towxml.wxss +0 -8
- package/src/mp/components/markdown/towxml/yuml/yuml.js +0 -51
- package/src/mp/components/markdown/towxml/yuml/yuml.json +0 -5
- package/src/mp/components/markdown/towxml/yuml/yuml.wxml +0 -5
- package/src/mp/components/markdown/towxml/yuml/yuml.wxss +0 -0
- package/src/web/.DS_Store +0 -0
- package/src/web/components/markdown/index.jsx +0 -40
- package/src/web/wedatheme/.git +0 -1
- package/src/web/wedatheme/.gitignore +0 -5
- package/src/web/wedatheme/.npmrc +0 -1
- 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.
|
|
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.
|
|
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"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"default": ["image/*"],
|
|
9
9
|
"x-category": "基础属性",
|
|
10
10
|
"x-index": 6,
|
|
11
|
-
"x-platforms": ["
|
|
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
|
}
|
|
@@ -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"
|
package/src/configs/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import Button from './components/button';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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="{{
|
|
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,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,7 +1,7 @@
|
|
|
1
1
|
// 暂时把地区信息打包在本地, 后续移到COS桶内
|
|
2
|
-
import provinces from './provinces.
|
|
3
|
-
import cities from './cities.
|
|
4
|
-
import regions from './regions.
|
|
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 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
|
+
];
|