@cloudbase/weda-ui 0.2.6 → 0.2.10
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 +3 -4
- package/src/configs/components/container.json +2 -1
- package/src/configs/components/form/input.json +6 -0
- package/src/configs/components/form/richText.json +2 -1
- package/src/configs/components/form/uploader.json +4 -5
- 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 +31 -86
- package/src/configs/components/text.json +2 -1
- package/src/configs/index.js +4 -7
- package/src/mp/components/form/input/index.js +5 -1
- package/src/mp/components/form/input/index.wxml +2 -1
- package/src/mp/components/form/select/index.js +2 -2
- package/src/mp/components/form/textarea/index.wxml +1 -0
- package/src/mp/components/form/uploader/index.js +48 -14
- package/src/mp/components/form/uploader/index.wxml +9 -2
- package/src/mp/components/image/index.js +57 -8
- package/src/mp/components/image/index.json +4 -1
- package/src/mp/components/image/index.wxml +4 -2
- package/src/mp/components/image/index.wxss +14 -0
- package/src/mp/components/richText/index.wxml +1 -1
- package/src/mp/components/tabs/index.js +14 -1
- package/src/mp/utils/deepEqual.js +42 -0
- package/src/web/components/form/enumSelect/MultipleSelect.jsx +94 -0
- package/src/web/components/form/enumSelect/NormalSelect.jsx +105 -0
- package/src/web/components/form/enumSelect/SelectContainer.jsx +43 -0
- package/src/web/components/form/enumSelect/hooks/index.js +49 -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/input/index.jsx +14 -10
- package/src/web/components/form/radio/index.jsx +1 -1
- package/src/web/components/form/select/h5.jsx +1 -1
- 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/index.css +15 -0
- package/src/web/components/form/uploader/index.jsx +2 -2
- package/src/web/components/form/uploader/uploader.h5.jsx +237 -0
- package/src/web/components/form/uploader/{uploaderPc.jsx → uploader.pc.jsx} +69 -59
- package/src/web/components/image/image.jsx +79 -5
- package/src/web/components/image/index.css +17 -0
- package/src/web/components/image/index.jsx +1 -0
- 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/src/web/components/richTextView/index.css +0 -10
- package/src/web/components/richTextView/index.jsx +1 -12
- package/src/web/components/tabs/index.jsx +3 -3
- package/src/web/components/tabs/{tabsH5.jsx → tabs.h5.jsx} +9 -47
- package/src/web/components/tabs/{tabsPc.jsx → tabs.pc.jsx} +13 -47
- package/src/web/components/uploaderView/index.jsx +1 -1
- package/src/web/utils/tcb.js +8 -0
- 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/form/uploader/uploaderH5.jsx +0 -208
- 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
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<checkbox-group wx:if="{{data.tag === 'todogroup'}}" class="{{data.attr.class}}" bindchange="_change">
|
|
2
|
-
<block wx:if="{{data.child}}" wx:for="{{data.child}}" wx:for-item="item" wx:key="i">
|
|
3
|
-
<label wx:if="{{item.tag}}" class="{{item.attr.class}}">
|
|
4
|
-
<block wx:if="{{item.child}}" wx:for="{{item.child}}" wx:for-item="item" wx:key="i">
|
|
5
|
-
<!--解析选择框-->
|
|
6
|
-
<checkbox wx:if="{{item.tag === 'checkbox'}}" class="{{item.attr.class}}" value="{{item.attr.value}}" data-_e="{{item}}" checked="{{item.attr.checked}}" disabled="{{item.attr.disabled}}"/>
|
|
7
|
-
|
|
8
|
-
<!--解析文字-->
|
|
9
|
-
<decode wx:if="{{item.child}}" nodes="{{item}}"/>
|
|
10
|
-
</block>
|
|
11
|
-
</label>
|
|
12
|
-
</block>
|
|
13
|
-
</checkbox-group>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const config = require('../config');
|
|
2
|
-
Component({
|
|
3
|
-
options: {
|
|
4
|
-
styleIsolation: 'shared',
|
|
5
|
-
},
|
|
6
|
-
properties: {
|
|
7
|
-
data: {
|
|
8
|
-
type: Object,
|
|
9
|
-
value: {},
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
data: {
|
|
13
|
-
attr: {
|
|
14
|
-
src: '',
|
|
15
|
-
class: '',
|
|
16
|
-
},
|
|
17
|
-
size: {
|
|
18
|
-
w: 0,
|
|
19
|
-
h: 0,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
lifetimes: {
|
|
23
|
-
attached() {
|
|
24
|
-
const _ts = this;
|
|
25
|
-
const dataAttr = this.data.data.attr;
|
|
26
|
-
|
|
27
|
-
// 设置公式图片
|
|
28
|
-
_ts.setData({
|
|
29
|
-
attr: {
|
|
30
|
-
src: `${config.yuml.api}=${dataAttr.value}&theme=${global._theme}`,
|
|
31
|
-
class: `${dataAttr.class}`,
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
methods: {
|
|
37
|
-
load(e) {
|
|
38
|
-
const _ts = this;
|
|
39
|
-
// 公式图片加载完成则根据其图片大小、类型计算其显示的合适大小
|
|
40
|
-
const scale = 20;
|
|
41
|
-
const w = e.detail.width / scale;
|
|
42
|
-
const h = e.detail.height / scale;
|
|
43
|
-
_ts.setData({
|
|
44
|
-
size: {
|
|
45
|
-
w,
|
|
46
|
-
h,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
});
|
|
File without changes
|
package/src/web/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import * as PropTypes from 'prop-types';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import weui from '../../../utils/weui';
|
|
4
|
-
import classNames from '../../../utils/classnames';
|
|
5
|
-
import { getCloudInstance } from '../../../utils/tcb';
|
|
6
|
-
import { useGetSet } from 'react-use';
|
|
7
|
-
import getLocalCounter from '../../../utils/getLocalCounter';
|
|
8
|
-
import isObjectEqual from '../../../utils/isObjectEqual';
|
|
9
|
-
|
|
10
|
-
const uploadPath = 'weda-uploader';
|
|
11
|
-
/**
|
|
12
|
-
* H5端
|
|
13
|
-
*/
|
|
14
|
-
export function UploaderH5({
|
|
15
|
-
title,
|
|
16
|
-
maxUploadCount,
|
|
17
|
-
className,
|
|
18
|
-
id,
|
|
19
|
-
events,
|
|
20
|
-
layout,
|
|
21
|
-
defaultValue,
|
|
22
|
-
single = false,
|
|
23
|
-
onChange,
|
|
24
|
-
style,
|
|
25
|
-
}) {
|
|
26
|
-
const cls = classNames({
|
|
27
|
-
'weda-ui': true,
|
|
28
|
-
'weui-cells': true,
|
|
29
|
-
'weui-cells_form': true,
|
|
30
|
-
[className]: className,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const hashcode = React.useMemo(() => getLocalCounter(), []); // 固定id
|
|
34
|
-
const uploaderId = `${id}-${hashcode}`;
|
|
35
|
-
const [fileIDList, setfileIDList] = React.useState([]);
|
|
36
|
-
React.useEffect(() => {
|
|
37
|
-
if(defaultValue === undefined || Array.isArray(defaultValue) && defaultValue.length === 0) {
|
|
38
|
-
const root = document.getElementById(uploaderId);
|
|
39
|
-
if(root) {
|
|
40
|
-
const el = root.querySelector('#uploaderFiles');
|
|
41
|
-
if(el) {
|
|
42
|
-
el.innerHTML = '';
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, [defaultValue]);
|
|
47
|
-
const prevValueRef = React.useRef(defaultValue);
|
|
48
|
-
|
|
49
|
-
const finalMaxImgCount = React.useMemo(() => {
|
|
50
|
-
if(single) return 1;
|
|
51
|
-
return maxUploadCount;
|
|
52
|
-
}, [single, maxUploadCount]);
|
|
53
|
-
|
|
54
|
-
React.useEffect(() => {
|
|
55
|
-
if(!isObjectEqual(prevValueRef.current, defaultValue, true)) {
|
|
56
|
-
let initialValue = []
|
|
57
|
-
.concat(defaultValue ?? [])
|
|
58
|
-
.filter((d) => typeof d === 'string' && d !== '');
|
|
59
|
-
if (single) {
|
|
60
|
-
initialValue = initialValue[0] ? [initialValue[0]] : [];
|
|
61
|
-
}
|
|
62
|
-
setfileIDList(initialValue);
|
|
63
|
-
setUploadConut(initialValue.length);
|
|
64
|
-
prevValueRef.current = defaultValue;
|
|
65
|
-
}
|
|
66
|
-
}, [defaultValue, maxUploadCount, single]);
|
|
67
|
-
|
|
68
|
-
const [uploadCount, setUploadConut] = useGetSet(0);
|
|
69
|
-
React.useEffect(() => {
|
|
70
|
-
events.change && events.change({ value: fileIDList });
|
|
71
|
-
if (single) {
|
|
72
|
-
const file = fileIDList[0] || '';
|
|
73
|
-
file && onChange && onChange(file);
|
|
74
|
-
} else {
|
|
75
|
-
onChange && onChange(fileIDList);
|
|
76
|
-
}
|
|
77
|
-
}, [fileIDList]);
|
|
78
|
-
React.useEffect(() => {
|
|
79
|
-
const opts = {
|
|
80
|
-
url: 'http://localhost:8081',
|
|
81
|
-
auto: true,
|
|
82
|
-
type: 'file',
|
|
83
|
-
fileVal: 'fileVal',
|
|
84
|
-
compress: {
|
|
85
|
-
width: 1600,
|
|
86
|
-
height: 1600,
|
|
87
|
-
quality: 0.8,
|
|
88
|
-
},
|
|
89
|
-
onBeforeQueued: function (files) {
|
|
90
|
-
// `this` 是轮询到的文件, `files` 是所有文件
|
|
91
|
-
|
|
92
|
-
if (
|
|
93
|
-
['image/jpg', 'image/jpeg', 'image/png', 'image/gif'].indexOf(
|
|
94
|
-
this.type
|
|
95
|
-
) < 0
|
|
96
|
-
) {
|
|
97
|
-
weui.alert('请上传图片');
|
|
98
|
-
return false; // 阻止文件添加
|
|
99
|
-
}
|
|
100
|
-
if (this.size > 10 * 1024 * 1024) {
|
|
101
|
-
weui.alert('请上传不超过10M的图片');
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (files.length > finalMaxImgCount) {
|
|
106
|
-
// 防止一下子选择过多文件
|
|
107
|
-
weui.alert(`最多只能上传${finalMaxImgCount}张图片,请重新选择`);
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
if (uploadCount() + 1 > finalMaxImgCount) {
|
|
111
|
-
weui.alert(`最多只能上传${finalMaxImgCount}张图片`);
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
setUploadConut(c => c + 1);
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
onQueued: function () {
|
|
119
|
-
|
|
120
|
-
const file = this;
|
|
121
|
-
getCloudInstance().then(async (tcb) => {
|
|
122
|
-
try {
|
|
123
|
-
const fileType = file.type.split('/')?.[1];
|
|
124
|
-
const cloudPath = `${uploadPath}/uploader-${Date.now()}.${fileType}`;
|
|
125
|
-
const { fileID } = await tcb.uploadFile({
|
|
126
|
-
cloudPath,
|
|
127
|
-
filePath: file,
|
|
128
|
-
});
|
|
129
|
-
fileID && setfileIDList((list) => [...list, fileID]);
|
|
130
|
-
fileID && events.success && events.success({ value: fileID, file });
|
|
131
|
-
const r = opts.onSuccess(file, );
|
|
132
|
-
if(!r) {
|
|
133
|
-
|
|
134
|
-
const $el = document.querySelector(`#${uploaderId}`);
|
|
135
|
-
const $file = $el.querySelector(`[data-id="${file.id}"]`);
|
|
136
|
-
$file.classList.remove('weui-uploader__file_status');
|
|
137
|
-
$file.querySelector('.weui-uploader__file-content').remove();
|
|
138
|
-
}
|
|
139
|
-
} catch (err) {
|
|
140
|
-
opts.onError(err);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
onBeforeSend: function () {
|
|
145
|
-
// $.extend(data, { test: 1 }); // 可以扩展此对象来控制上传参数
|
|
146
|
-
// $.extend(headers, { Origin: 'http://127.0.0.1' }); // 可以扩展此对象来控制上传头部
|
|
147
|
-
|
|
148
|
-
return false; // 阻止文件上传
|
|
149
|
-
},
|
|
150
|
-
onProgress: function () {
|
|
151
|
-
// console.log(this, percent);
|
|
152
|
-
// return true; // 阻止默认行为,不使用默认的进度显示
|
|
153
|
-
},
|
|
154
|
-
onSuccess: function (ret) {
|
|
155
|
-
events.success && events.success(ret);
|
|
156
|
-
return false;
|
|
157
|
-
},
|
|
158
|
-
onError: function (err) {
|
|
159
|
-
events.error && events.error(err);
|
|
160
|
-
return false;
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
weui.uploader(`#${uploaderId}`, opts);
|
|
164
|
-
}, []);
|
|
165
|
-
|
|
166
|
-
return (
|
|
167
|
-
<div className={cls} id={uploaderId} style={style}>
|
|
168
|
-
<div className="weui-cell">
|
|
169
|
-
<div className="weui-cell__bd">
|
|
170
|
-
<div className={classNames("weui-uploader", layout)}>
|
|
171
|
-
<div className={classNames("weui-uploader__hd", layout)}>
|
|
172
|
-
<p className="weui-uploader__title">{title}</p>
|
|
173
|
-
<div className="weui-uploader__info">
|
|
174
|
-
<span id="uploadCount">{uploadCount()}</span>
|
|
175
|
-
{`/${finalMaxImgCount}`}
|
|
176
|
-
</div>
|
|
177
|
-
</div>
|
|
178
|
-
<div className="weui-uploader__bd">
|
|
179
|
-
<ul className="weui-uploader__files" id="uploaderFiles"></ul>
|
|
180
|
-
<div className="weui-uploader__input-box">
|
|
181
|
-
<input
|
|
182
|
-
id="uploaderInput"
|
|
183
|
-
className="weui-uploader__input"
|
|
184
|
-
type="file"
|
|
185
|
-
accept="image/*"
|
|
186
|
-
multiple
|
|
187
|
-
/>
|
|
188
|
-
</div>
|
|
189
|
-
</div>
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
UploaderH5.propTypes = {
|
|
198
|
-
id: PropTypes.string,
|
|
199
|
-
title: PropTypes.string,
|
|
200
|
-
className: PropTypes.string, // 传入类
|
|
201
|
-
maxUploadCount: PropTypes.number, // 【上传图片最大数量】
|
|
202
|
-
events: PropTypes.objectOf(PropTypes.func), // 事件
|
|
203
|
-
style: PropTypes.object,
|
|
204
|
-
layout: PropTypes.oneOf(['horizontal', 'vertical']),
|
|
205
|
-
defaultValue: PropTypes.oneOfType([PropTypes.array, PropTypes.string]), // 初始值,该参数需配合 formily 使用
|
|
206
|
-
single: PropTypes.bool, // 单张上传还是多张上传,对应 onChange 参数为字符串还是字符串数组,value 在处理过程统一转为字符串数组
|
|
207
|
-
onChange: PropTypes.objectOf(PropTypes.func), // 值变化,该参数需配合 formily 使用
|
|
208
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/display-name */
|
|
2
|
-
/* eslint-disable react/prop-types */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import RawMarkdown from 'react-markdown';
|
|
5
|
-
import { Prism } from 'react-syntax-highlighter';
|
|
6
|
-
|
|
7
|
-
import * as PropTypes from 'prop-types';
|
|
8
|
-
import classNames from '../../utils/classnames';
|
|
9
|
-
|
|
10
|
-
const renderers = {
|
|
11
|
-
code: ({ language, value = '' }) => (
|
|
12
|
-
<Prism language={language}>{value}</Prism>
|
|
13
|
-
),
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default function Markdown({ source = '', className = '', ...props }) {
|
|
17
|
-
const { contenteditable, onInput, onBlur, style, id } = props;
|
|
18
|
-
return (
|
|
19
|
-
<div
|
|
20
|
-
className={classNames({
|
|
21
|
-
'weda-ui': true,
|
|
22
|
-
[className]: className,
|
|
23
|
-
})}
|
|
24
|
-
id={id}
|
|
25
|
-
style={style}
|
|
26
|
-
contentEditable={contenteditable}
|
|
27
|
-
onInput={onInput}
|
|
28
|
-
onBlur={onBlur}
|
|
29
|
-
>
|
|
30
|
-
<RawMarkdown source={source} renderers={renderers} />
|
|
31
|
-
</div>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
Markdown.propTypes = {
|
|
36
|
-
/**
|
|
37
|
-
* markdown 文本内容
|
|
38
|
-
*/
|
|
39
|
-
source: PropTypes.string,
|
|
40
|
-
};
|
package/src/web/wedatheme/.git
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
gitdir: ../../../.git/modules/src/web/wedatheme
|
package/src/web/wedatheme/.npmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
registry=https://mirrors.tencent.com/npm/
|