@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,98 +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
|
-
style: '',
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
w: 0,
|
|
20
|
-
h: 0,
|
|
21
|
-
},
|
|
22
|
-
styleObj: {},
|
|
23
|
-
},
|
|
24
|
-
lifetimes: {
|
|
25
|
-
attached() {
|
|
26
|
-
const _ts = this;
|
|
27
|
-
const dataAttr = this.data.data.attr;
|
|
28
|
-
|
|
29
|
-
// 将图片大小处理到对象中
|
|
30
|
-
if (dataAttr.width) {
|
|
31
|
-
_ts.data.size.w = +dataAttr.width / config.dpr;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (dataAttr.height) {
|
|
35
|
-
_ts.data.size.h = +dataAttr.height / config.dpr;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// 将样式合并到样式对象中
|
|
39
|
-
if (dataAttr.style) {
|
|
40
|
-
const re = /;\s{0,}/gi;
|
|
41
|
-
dataAttr.style = dataAttr.style.replace(re, ';');
|
|
42
|
-
dataAttr.style.split(';').forEach((item) => {
|
|
43
|
-
const itemArr = item.split(':');
|
|
44
|
-
if (/^(width|height)$/i.test(itemArr[0])) {
|
|
45
|
-
const num = parseInt(itemArr[1]) || 0;
|
|
46
|
-
let key = '';
|
|
47
|
-
// itemArr[1] = num / config.dpr + itemArr[1].replace(num,'');
|
|
48
|
-
switch (itemArr[0].toLocaleLowerCase()) {
|
|
49
|
-
case 'width':
|
|
50
|
-
key = 'w';
|
|
51
|
-
break;
|
|
52
|
-
case 'height':
|
|
53
|
-
key = 'h';
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
_ts.data.size[key] = num / config.dpr;
|
|
57
|
-
} else {
|
|
58
|
-
_ts.data.styleObj[itemArr[0]] = itemArr[1];
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// 设置公式图片
|
|
64
|
-
_ts.setData({
|
|
65
|
-
attr: {
|
|
66
|
-
src: dataAttr.src,
|
|
67
|
-
class: dataAttr.class,
|
|
68
|
-
style: _ts.setStyle(_ts.data.styleObj),
|
|
69
|
-
},
|
|
70
|
-
size: _ts.data.size,
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
methods: {
|
|
75
|
-
// 设置图片样式
|
|
76
|
-
setStyle(o) {
|
|
77
|
-
let str = ``;
|
|
78
|
-
for (const key in o) {
|
|
79
|
-
str += `${key}:${o[key]};`;
|
|
80
|
-
}
|
|
81
|
-
return str;
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
// 图片加载完成设置图片大小
|
|
85
|
-
load(e) {
|
|
86
|
-
const _ts = this;
|
|
87
|
-
|
|
88
|
-
if (!_ts.data.size.w || !_ts.data.size.h) {
|
|
89
|
-
_ts.setData({
|
|
90
|
-
size: {
|
|
91
|
-
w: e.detail.width / config.dpr,
|
|
92
|
-
h: e.detail.height / config.dpr,
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<image class="{{attr.class}}" lazy-load="true" mode="{{attr.mode || 'widthFix'}}" src="{{attr.src}}" style="{{attr.style}} width:{{size.w}}px;height:{{size.h}}px;" bindload="load"></image>
|
|
File without changes
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const md = require('./parse/markdown/index');
|
|
2
|
-
const parse = require('./parse/index');
|
|
3
|
-
|
|
4
|
-
module.exports = (str, type, option) => {
|
|
5
|
-
option = option || {};
|
|
6
|
-
let result;
|
|
7
|
-
switch (type) {
|
|
8
|
-
case 'markdown':
|
|
9
|
-
result = parse(md(str), option);
|
|
10
|
-
break;
|
|
11
|
-
case 'html':
|
|
12
|
-
result = parse(str, option);
|
|
13
|
-
break;
|
|
14
|
-
default:
|
|
15
|
-
throw new Error('Invalid type, only markdown and html are supported');
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
19
|
-
};
|
|
@@ -1,53 +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.latex.api}=${dataAttr.value}&theme=${global._theme}`,
|
|
31
|
-
class: `${dataAttr.class} ${dataAttr.class}--${dataAttr.type}`,
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
methods: {
|
|
37
|
-
load(e) {
|
|
38
|
-
const _ts = this;
|
|
39
|
-
|
|
40
|
-
// 公式图片加载完成则根据其图片大小、类型计算其显示的合适大小
|
|
41
|
-
const scale = 20;
|
|
42
|
-
const w = e.detail.width / scale;
|
|
43
|
-
const h = e.detail.height / scale;
|
|
44
|
-
|
|
45
|
-
_ts.setData({
|
|
46
|
-
size: {
|
|
47
|
-
w,
|
|
48
|
-
h,
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<image class="{{attr.class}}" lazy-load="true" src="{{attr.src}}" style="width:{{size.w}}em; height:{{size.h}}em;" bindload="load"></image>
|
|
File without changes
|