@cloudbase/weda-ui 0.2.16 → 1.0.24
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/README.md +41 -169
- package/package.json +23 -11
- package/src/configs/components/calendar.json +4 -1
- package/src/configs/components/chart/bar.json +724 -0
- package/src/configs/components/chart/line.json +679 -0
- package/src/configs/components/chart/pie.json +497 -0
- package/src/configs/components/chart/statisticsCard.json +61 -13
- package/src/configs/components/container.json +7 -2
- package/src/configs/components/dataView.json +21 -6
- package/src/configs/components/form/checkbox.json +97 -5
- package/src/configs/components/form/radio.json +96 -4
- package/src/configs/components/form/select.json +245 -11
- package/src/configs/components/graphicCard.json +84 -73
- package/src/configs/components/image.json +7 -2
- package/src/configs/components/link.json +19 -3
- package/src/configs/components/listView.json +65 -18
- package/src/configs/components/lottery.json +151 -0
- package/src/configs/components/modal.json +37 -5
- package/src/configs/components/navLayout.json +87 -75
- package/src/configs/components/navigationBar.json +59 -0
- package/src/configs/components/richtextview.json +4 -1
- package/src/configs/components/scrollVeiw.json +74 -22
- package/src/configs/components/swiper.json +4 -1
- package/src/configs/components/tabs.json +51 -8
- package/src/configs/components/text.json +33 -25
- package/src/configs/components/wxOpenApi/phone.json +141 -0
- package/src/configs/components/wxOpenApi/phoneCode.json +121 -0
- package/src/configs/components/wxOpenApi/share.json +167 -0
- package/src/configs/components/wxOpenApi/userInfo.json +174 -0
- package/src/configs/index.js +20 -0
- package/src/index.js +2 -0
- package/src/mp/components/button/index.wxml +1 -2
- package/src/mp/components/chart/bar/index.js +258 -0
- package/src/mp/components/chart/bar/index.json +6 -0
- package/src/mp/components/chart/bar/index.wxml +3 -0
- package/src/mp/components/chart/bar/index.wxss +9 -0
- package/src/mp/components/chart/common/config/bar.js +50 -0
- package/src/mp/components/chart/common/config/global.js +16 -0
- package/src/mp/components/chart/common/config/line.js +48 -0
- package/src/mp/components/chart/common/config/pie.js +36 -0
- package/src/mp/components/chart/common/core/eChartBar.js +263 -0
- package/src/mp/components/chart/common/core/eChartBase.js +375 -0
- package/src/mp/components/chart/common/core/eChartLine.js +229 -0
- package/src/mp/components/chart/common/core/eChartPie.js +166 -0
- package/src/mp/components/chart/common/lib/echarts.min.js +18 -0
- package/src/mp/components/chart/ec-canvas/ec-canvas.js +277 -0
- package/src/mp/components/chart/ec-canvas/ec-canvas.json +4 -0
- package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +4 -0
- package/src/mp/components/chart/ec-canvas/ec-canvas.wxss +4 -0
- package/src/mp/components/chart/ec-canvas/wx-canvas.js +107 -0
- package/src/mp/components/chart/line/index.js +247 -0
- package/src/mp/components/chart/line/index.json +6 -0
- package/src/mp/components/chart/line/index.wxml +3 -0
- package/src/mp/components/chart/line/index.wxss +9 -0
- package/src/mp/components/chart/pie/index.js +182 -0
- package/src/mp/components/chart/pie/index.json +6 -0
- package/src/mp/components/chart/pie/index.wxml +4 -0
- package/src/mp/components/chart/pie/index.wxss +9 -0
- package/src/mp/components/chart/statisticsCard/index.js +33 -6
- package/src/mp/components/form/checkbox/index.js +41 -2
- package/src/mp/components/form/checkbox/index.wxml +1 -1
- package/src/mp/components/form/form/index.wxml +1 -2
- package/src/mp/components/form/input/index.js +1 -1
- package/src/mp/components/form/location/index.js +43 -2
- package/src/mp/components/form/radio/index.js +38 -0
- package/src/mp/components/form/select/index.js +348 -40
- package/src/mp/components/form/select/index.wxml +21 -6
- package/src/mp/components/form/select/region/index.js +101 -0
- package/src/mp/components/form/textarea/index.wxml +6 -5
- package/src/mp/components/form/uploader/index.js +76 -44
- package/src/mp/components/form/uploader/index.wxml +15 -3
- package/src/mp/components/form/uploaderFile/index.js +61 -29
- package/src/mp/components/graphicCard/index.js +26 -28
- package/src/mp/components/listView/index.js +52 -64
- package/src/mp/components/listView/index.wxml +2 -2
- package/src/mp/components/listView/index.wxss +5 -0
- package/src/mp/components/lottery/index.js +270 -0
- package/src/mp/components/lottery/index.json +4 -0
- package/src/mp/components/lottery/index.wxml +43 -0
- package/src/mp/components/lottery/index.wxss +317 -0
- package/src/mp/components/navLayout/index.js +3 -3
- package/src/mp/components/navigationBar/index.js +193 -0
- package/src/mp/components/navigationBar/index.json +6 -0
- package/src/mp/components/navigationBar/index.wxml +88 -0
- package/src/mp/components/navigationBar/index.wxss +1257 -0
- package/src/mp/components/tabs/index.js +7 -2
- package/src/mp/components/tabs/index.wxml +2 -1
- package/src/mp/components/text/index.js +0 -25
- package/src/mp/components/text/index.wxml +3 -3
- package/src/mp/components/wxOpenApi/phone/index.js +117 -0
- package/src/mp/components/wxOpenApi/phone/index.json +4 -0
- package/src/mp/components/wxOpenApi/phone/index.wxml +15 -0
- package/src/mp/components/wxOpenApi/phone/index.wxss +22 -0
- package/src/mp/components/wxOpenApi/phoneCode/index.js +89 -0
- package/src/mp/components/wxOpenApi/phoneCode/index.json +4 -0
- package/src/mp/components/wxOpenApi/phoneCode/index.wxml +15 -0
- package/src/mp/components/wxOpenApi/phoneCode/index.wxss +22 -0
- package/src/mp/components/wxOpenApi/share/index.js +117 -0
- package/src/mp/components/wxOpenApi/share/index.json +4 -0
- package/src/mp/components/wxOpenApi/share/index.wxml +15 -0
- package/src/mp/components/wxOpenApi/share/index.wxss +22 -0
- package/src/mp/components/wxOpenApi/userInfo/index.js +88 -0
- package/src/mp/components/wxOpenApi/userInfo/index.json +4 -0
- package/src/mp/components/wxOpenApi/userInfo/index.wxml +14 -0
- package/src/mp/components/wxOpenApi/userInfo/index.wxss +22 -0
- package/src/mp/index.json +10 -1
- package/src/mp/style/weda-ui.wxss +2 -0
- package/src/mp/utils/constant.js +15 -0
- package/src/mp/utils/destr.js +48 -0
- package/src/mp/utils/lodash.js +2 -0
- package/src/mp/utils/platform.js +25 -0
- package/src/mp/utils/tcb.js +44 -0
- package/src/setupTests.js +2 -1
- package/src/web/components/button/index.css +8 -1
- package/src/web/components/button/index.tsx +3 -2
- package/src/web/components/chart/bar/index.tsx +140 -0
- package/src/web/components/chart/common/config/bar.js +49 -0
- package/src/web/components/chart/common/config/global.js +16 -0
- package/src/web/components/chart/common/config/line.js +50 -0
- package/src/web/components/chart/common/config/pie.js +37 -0
- package/src/web/components/chart/common/core/eChartBar.js +265 -0
- package/src/web/components/chart/common/core/eChartBase.ts +383 -0
- package/src/web/components/chart/common/core/eChartLine.js +231 -0
- package/src/web/components/chart/common/core/eChartPie.js +170 -0
- package/src/web/components/chart/common/core/type.ts +34 -0
- package/src/web/components/chart/common/echart.css +106 -0
- package/src/web/components/chart/common/echarts.ts +33 -0
- package/src/web/components/chart/common/useChart.tsx +69 -0
- package/src/web/components/chart/line/index.tsx +136 -0
- package/src/web/components/chart/pie/index.tsx +99 -0
- package/src/web/components/chart/statisticsCard/index.tsx +29 -8
- package/src/web/components/form/checkbox/index.tsx +61 -23
- package/src/web/components/form/formcell/index.tsx +10 -5
- package/src/web/components/form/location/components/LocationH5/location.h5.jsx +3 -3
- package/src/web/components/form/location/components/LocationPC/location.PC.jsx +2 -2
- package/src/web/components/form/radio/index.tsx +90 -53
- package/src/web/components/form/select/h5.tsx +371 -72
- package/src/web/components/form/select/index.css +10 -0
- package/src/web/components/form/select/index.tsx +392 -145
- package/src/web/components/form/select/region/index.ts +122 -31
- package/src/web/components/form/select/time.jsx +90 -0
- package/src/web/components/form/select/year.tsx +170 -0
- package/src/web/components/form/tips/index.css +4 -0
- package/src/web/components/form/tips/index.tsx +4 -3
- package/src/web/components/form/uploader/uploader.h5.tsx +28 -19
- package/src/web/components/form/uploader/uploader.pc.tsx +17 -20
- package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +48 -44
- package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +28 -26
- package/src/web/components/graphicCard/index.css +1 -5
- package/src/web/components/graphicCard/index.tsx +4 -3
- package/src/web/components/image/image.tsx +1 -1
- package/src/web/components/image/index.tsx +1 -1
- package/src/web/components/index.js +13 -2
- package/src/web/components/link/index.tsx +6 -3
- package/src/web/components/listView/index.css +4 -0
- package/src/web/components/listView/index.tsx +10 -18
- package/src/web/components/lottery/index.css +327 -0
- package/src/web/components/lottery/index.tsx +567 -0
- package/src/web/components/lottery/lotteryUtil.ts +130 -0
- package/src/web/components/modal/index.tsx +3 -1
- package/src/web/components/navigationBar/chevron-right--double.svg +3 -0
- package/src/web/components/navigationBar/common.tsx +198 -0
- package/src/web/components/navigationBar/h5Menu.tsx +179 -0
- package/src/web/components/navigationBar/horizontalMenu.tsx +200 -0
- package/src/web/components/navigationBar/index.css +762 -0
- package/src/web/components/navigationBar/index.tsx +231 -0
- package/src/web/components/navigationBar/type.d.ts +111 -0
- package/src/web/components/navigationBar/verticalMenu.tsx +81 -0
- package/src/web/components/phone/index.css +0 -0
- package/src/web/components/phone/index.tsx +22 -0
- package/src/web/components/phoneCode/index.css +0 -0
- package/src/web/components/phoneCode/index.tsx +22 -0
- package/src/web/components/richTextView/index.tsx +3 -5
- package/src/web/components/share/index.css +0 -0
- package/src/web/components/share/index.tsx +38 -0
- package/src/web/components/tabs/index.tsx +2 -0
- package/src/web/components/tabs/tabs.h5.tsx +43 -33
- package/src/web/components/tabs/tabs.pc.tsx +23 -10
- package/src/web/components/text/index.tsx +6 -14
- package/src/web/components/userInfo/index.css +0 -0
- package/src/web/components/userInfo/index.tsx +30 -0
- package/src/web/utils/{constant.js → constant.ts} +17 -2
- package/src/web/utils/lodash.ts +2 -0
- package/src/web/utils/platform.js +10 -1
- package/src/web/utils/tcb.js +20 -6
- package/src/web/weda-ui.css +2 -0
- package/CHANGELOG.md +0 -240
- package/src/.DS_Store +0 -0
- package/src/configs/.DS_Store +0 -0
- package/src/mp/.gitignore +0 -10
- package/src/web/.DS_Store +0 -0
- package/src/web/components/form/select/region/cities.ts +0 -2410
- package/src/web/components/form/select/region/provinces.ts +0 -240
- package/src/web/components/form/select/region/regions.ts +0 -20645
|
@@ -1,30 +1,43 @@
|
|
|
1
|
+
import { useCustomCompareEffect, useMountEffect, useSyncedRef } from '@react-hookz/web';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { Tabs as TeaTabs, TabPanel, ConfigProvider } from 'tea-component';
|
|
3
4
|
import classNames from '../../utils/classnames';
|
|
5
|
+
import isObjectEqual from '../../utils/isObjectEqual';
|
|
4
6
|
import { useSyncValue } from '../../utils/useSyncValue';
|
|
5
7
|
import { PropsType } from './index';
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
export default function TabsPc({
|
|
9
|
-
tabs,
|
|
11
|
+
tabs = [],
|
|
10
12
|
selectedIndex,
|
|
11
13
|
events,
|
|
12
14
|
className,
|
|
13
15
|
style,
|
|
16
|
+
isMultipleSlot = true,
|
|
14
17
|
...restProps
|
|
15
18
|
}: PropsType) {
|
|
16
19
|
|
|
17
20
|
const [activeIndex, setActiveIndex] = useSyncValue(selectedIndex);
|
|
18
|
-
const _tabs =
|
|
19
|
-
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const _tabs = React.useMemo(() => {
|
|
22
|
+
return Array.isArray(tabs) && tabs.length && tabs.map((item, index) => {
|
|
23
|
+
return {
|
|
24
|
+
id: index.toString(),
|
|
25
|
+
label: item.title,
|
|
26
|
+
value: item.value
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}, [tabs]);
|
|
24
30
|
|
|
31
|
+
const eventsRef = useSyncedRef(events);
|
|
32
|
+
useCustomCompareEffect(() => {
|
|
33
|
+
eventsRef.current && eventsRef.current.change({
|
|
34
|
+
id: _tabs[activeIndex]?.id,
|
|
35
|
+
label: _tabs[activeIndex]?.label,
|
|
36
|
+
value: _tabs[activeIndex]?.value,
|
|
37
|
+
});
|
|
38
|
+
}, [activeIndex, _tabs], isObjectEqual);
|
|
25
39
|
const onActive = (e) => {
|
|
26
40
|
setActiveIndex(e.id);
|
|
27
|
-
events && events.change(e);
|
|
28
41
|
};
|
|
29
42
|
return (
|
|
30
43
|
<ConfigProvider classPrefix="wedatea2td">
|
|
@@ -40,11 +53,11 @@ export default function TabsPc({
|
|
|
40
53
|
key={item.id}
|
|
41
54
|
id={item.id}
|
|
42
55
|
>
|
|
43
|
-
{restProps[`panel${index + 1}`]}
|
|
56
|
+
{isMultipleSlot ? restProps[`panel${index + 1}`] : restProps['panel1']}
|
|
44
57
|
</TabPanel>
|
|
45
58
|
)
|
|
46
59
|
)}
|
|
47
60
|
</TeaTabs>
|
|
48
61
|
</ConfigProvider>
|
|
49
62
|
);
|
|
50
|
-
}
|
|
63
|
+
}
|
|
@@ -21,8 +21,6 @@ export default function Text({
|
|
|
21
21
|
maxLines = 2,
|
|
22
22
|
space = false,
|
|
23
23
|
userSelect = true,
|
|
24
|
-
textAlign = '',
|
|
25
|
-
textColor = '',
|
|
26
24
|
style = {},
|
|
27
25
|
className,
|
|
28
26
|
events,
|
|
@@ -42,23 +40,17 @@ export default function Text({
|
|
|
42
40
|
}
|
|
43
41
|
const levelName = level === '0' ? '' : `level_${level}`;
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 添加对齐属性
|
|
52
|
-
if (textAlign !== "") {
|
|
53
|
-
style2 = {...style2, textAlign};
|
|
54
|
-
}
|
|
43
|
+
const inlineStyle = React.useMemo(
|
|
44
|
+
() => ({ ...textStyle, ...style }),
|
|
45
|
+
[textStyle, style]
|
|
46
|
+
);
|
|
55
47
|
return (
|
|
56
48
|
<p
|
|
57
49
|
//@ts-expect-error contentEditable type def sucks
|
|
58
50
|
contentEditable={contenteditable}
|
|
59
51
|
onInput={onInput}
|
|
60
52
|
onBlur={onBlur}
|
|
61
|
-
style={
|
|
53
|
+
style={inlineStyle}
|
|
62
54
|
className={classNames('weda-text', 'weda-ui', className, levelName)}
|
|
63
55
|
id={id}
|
|
64
56
|
onClick={(e) => events.tap({}, { originEvent: e })}
|
|
@@ -66,4 +58,4 @@ export default function Text({
|
|
|
66
58
|
{text}
|
|
67
59
|
</p>
|
|
68
60
|
);
|
|
69
|
-
}
|
|
61
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Button from '../../components/button';
|
|
3
|
+
import { CommonPropsType } from '../../types';
|
|
4
|
+
|
|
5
|
+
const UserInfo = (props: PropsType) => <Button {...props} />;
|
|
6
|
+
|
|
7
|
+
export interface PropsType extends CommonPropsType {
|
|
8
|
+
/**
|
|
9
|
+
* 按钮标题
|
|
10
|
+
*/
|
|
11
|
+
text?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 按钮风格
|
|
14
|
+
*/
|
|
15
|
+
type?: 'primary' | 'warn' | 'wechat' | 'default';
|
|
16
|
+
/**
|
|
17
|
+
* 按钮大小
|
|
18
|
+
*/
|
|
19
|
+
size?: 'default' | 'mini' | 'large';
|
|
20
|
+
/**
|
|
21
|
+
* 信息用途
|
|
22
|
+
*/
|
|
23
|
+
usage?: string;
|
|
24
|
+
/**
|
|
25
|
+
* 语言
|
|
26
|
+
*/
|
|
27
|
+
language?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default UserInfo;
|
|
@@ -2,6 +2,21 @@ export const TitleType = {
|
|
|
2
2
|
LEFT: 'left',
|
|
3
3
|
TOP: 'top',
|
|
4
4
|
NONE: 'none',
|
|
5
|
-
};
|
|
5
|
+
} as const;
|
|
6
6
|
|
|
7
|
-
export const LOAD_ERR_IMG_BASE64 = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIiBmaWxsPSJub25lIj4KICA8cGF0aCBkPSJNMjUuMzIgMTYuMzU5N0MyNi4wNzY0IDE2LjM1OTcgMjYuODI1NCAxNi41MDg3IDI3LjUyNDMgMTYuNzk4MUMyOC4yMjMxIDE3LjA4NzYgMjguODU4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{
|
|
10
|
+
equal: 'eq', // 等于
|
|
11
|
+
unequal: 'neq', // 不等于
|
|
12
|
+
include: 'search', // 包含
|
|
13
|
+
exclude: '_exclude', // 不包含
|
|
14
|
+
begin_with: '_begin_with', // 开头是
|
|
15
|
+
greater: 'gt', // 大于
|
|
16
|
+
greater_or_equal: 'gte', // 大于等于
|
|
17
|
+
bigger_or_equal: 'gte', //大于等于
|
|
18
|
+
less: 'lt', // 小于
|
|
19
|
+
less_or_equal: 'lte', // 小于等于
|
|
20
|
+
in: 'in', // 多选值
|
|
21
|
+
not_in: 'nin', // 不在多选值
|
|
22
|
+
} as const;
|
|
@@ -126,9 +126,18 @@ export const isInIde = () => !!window?.app?.cloud?.IS_WEDA_IDE;
|
|
|
126
126
|
* cloudid和文件名转换
|
|
127
127
|
*/
|
|
128
128
|
export const transFileCloudidToName = (fileID) => {
|
|
129
|
-
const uuidReg = /(file-)?[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}-/;
|
|
129
|
+
const uuidReg = /(file-)?[0-9a-f]{8}((-)?[0-9a-f]{4}){3}(-)?[0-9a-f]{12}-/;
|
|
130
130
|
const lastIndex = `${fileID}`.lastIndexOf('/');
|
|
131
131
|
const name = `${fileID}`.slice(lastIndex + 1);
|
|
132
132
|
const title = name.replace(uuidReg, '');
|
|
133
133
|
return title;
|
|
134
134
|
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 判断是否是url
|
|
138
|
+
*/
|
|
139
|
+
const reg =
|
|
140
|
+
// eslint-disable-next-line no-useless-escape
|
|
141
|
+
/(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
|
|
142
|
+
|
|
143
|
+
export const isUrl = (path) => reg.test(path);
|
package/src/web/utils/tcb.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isInIde } from './platform';
|
|
1
2
|
/**
|
|
2
3
|
* 云存储/云函数相关
|
|
3
4
|
*/
|
|
@@ -55,14 +56,23 @@ export async function callDataSource(param) {
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
|
-
*
|
|
59
|
+
* 云API:获取用户自定义导航内容
|
|
60
|
+
* param
|
|
61
|
+
* WeAppId: string,
|
|
62
|
+
* EnvId: string,
|
|
63
|
+
* PublishType?: string,
|
|
59
64
|
*/
|
|
60
|
-
export async function
|
|
61
|
-
const { data, action } = param;
|
|
65
|
+
export async function getAppCustomNav() {
|
|
62
66
|
try {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
const PublishType = isInIde() ? 'preview' : '';
|
|
68
|
+
const WeAppId = window?.app?.id;
|
|
69
|
+
const res = await callWedaApi({
|
|
70
|
+
action: 'DescribeAppCustomNav',
|
|
71
|
+
serviceType: 'lowcode',
|
|
72
|
+
data: {
|
|
73
|
+
WeAppId,
|
|
74
|
+
PublishType,
|
|
75
|
+
},
|
|
66
76
|
});
|
|
67
77
|
return res;
|
|
68
78
|
} catch (error) {
|
|
@@ -70,3 +80,7 @@ export async function callWedaApi(param) {
|
|
|
70
80
|
return {};
|
|
71
81
|
}
|
|
72
82
|
}
|
|
83
|
+
|
|
84
|
+
export function callWedaApi(...args) {
|
|
85
|
+
return window.app.cloud.callWedaApi(...args);
|
|
86
|
+
}
|
package/src/web/weda-ui.css
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
> 为了更好的区分组件类型,仅在更新日志中进行如下约定:低码组件使用大驼峰命名,源码组件使用小驼峰命名。
|
|
2
|
-
|
|
3
|
-
## [1.2] - 2021-08-24
|
|
4
|
-
|
|
5
|
-
### Changed
|
|
6
|
-
|
|
7
|
-
- swiper 轮播
|
|
8
|
-
|
|
9
|
-
- 添加示例图片
|
|
10
|
-
|
|
11
|
-
## [1.1] - 2021-08-09
|
|
12
|
-
|
|
13
|
-
### Added
|
|
14
|
-
|
|
15
|
-
- text 文本
|
|
16
|
-
|
|
17
|
-
- 新增事件 `tap`
|
|
18
|
-
|
|
19
|
-
- modal 模态弹窗
|
|
20
|
-
|
|
21
|
-
- 新增组件 `modal`, web 使用 tea 样式用于 PC 样式响应式。
|
|
22
|
-
|
|
23
|
-
- showModal 显示弹窗
|
|
24
|
-
|
|
25
|
-
- 新增动作 `showModal`,用于平台方法的 PC 大屏响应式版本,小程序对齐 wx.showModal api。
|
|
26
|
-
|
|
27
|
-
- FormTextarea 表单多行输入
|
|
28
|
-
|
|
29
|
-
- 新增组件 `FormTextarea`, 用以替代被移除的 `Textarea` 组件
|
|
30
|
-
|
|
31
|
-
- link 链接
|
|
32
|
-
|
|
33
|
-
- 新增组件 `link`,可通过插槽来配置自定义内容
|
|
34
|
-
|
|
35
|
-
### Changed
|
|
36
|
-
|
|
37
|
-
- button 按钮
|
|
38
|
-
|
|
39
|
-
- 添加响应式样式,屏幕宽度大于 **1024px** 时显示为方角
|
|
40
|
-
|
|
41
|
-
- swiper 轮播
|
|
42
|
-
|
|
43
|
-
- 添加响应式样式,屏幕宽度大于 1024px 时显示为方角
|
|
44
|
-
|
|
45
|
-
- FormRadio 表单单选
|
|
46
|
-
|
|
47
|
-
- 修复多个单选组件并存导致的选中问题
|
|
48
|
-
|
|
49
|
-
- FormCheckbox 表单复选
|
|
50
|
-
|
|
51
|
-
- 修复多个复选组件并存导致的选中问题
|
|
52
|
-
|
|
53
|
-
- 所有组件:
|
|
54
|
-
- 表单组件的默认背景色,统一配置为透明
|
|
55
|
-
- 组件最外层容器统一添加 `weda-ui` 类名,组件库级别重置样式及公共样式都限制在 `weda-ui` 类名下,防止污染
|
|
56
|
-
- 规范了组件事件的触发方式
|
|
57
|
-
|
|
58
|
-
## [1.0] - 2021-06-10
|
|
59
|
-
|
|
60
|
-
### Added
|
|
61
|
-
|
|
62
|
-
- text 文本:
|
|
63
|
-
|
|
64
|
-
- 新增属性 `maxLines` 最大显示行数
|
|
65
|
-
|
|
66
|
-
- FormRegion 表单区域选择:
|
|
67
|
-
|
|
68
|
-
- 新增组件 `FormRegion`, 用以替代被移除的 `RegionPicker` 组件
|
|
69
|
-
|
|
70
|
-
### Removed
|
|
71
|
-
|
|
72
|
-
- swiper 轮播:
|
|
73
|
-
|
|
74
|
-
- 移除属性 `displayMultipleItems`, `nextMargin`, `previousMargin`, `updated`
|
|
75
|
-
- 移除 `transition` 和 `animationfinished` 事件
|
|
76
|
-
|
|
77
|
-
- text 文本:
|
|
78
|
-
|
|
79
|
-
- 移除属性 `decode` 是否解码
|
|
80
|
-
- 移除 `tap` 事件
|
|
81
|
-
|
|
82
|
-
- image 图片:
|
|
83
|
-
|
|
84
|
-
- 移除属性 `webp` 能否解析 webp 格式
|
|
85
|
-
|
|
86
|
-
- button 按钮:
|
|
87
|
-
|
|
88
|
-
- 移除属性 `plain` 镂空
|
|
89
|
-
- 移除属性 `openType` 微信开放能力的 `获取用户信息` 选项
|
|
90
|
-
|
|
91
|
-
- FormInput 表单输入:
|
|
92
|
-
|
|
93
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
94
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
95
|
-
|
|
96
|
-
- FormRadio 表单单选:
|
|
97
|
-
|
|
98
|
-
- 移除属性 `validateTrigger` 字段触发校验类型
|
|
99
|
-
- 移除属性 `validateStatus` 校验状态
|
|
100
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
101
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
102
|
-
|
|
103
|
-
- FormCheckbox 表单复选:
|
|
104
|
-
|
|
105
|
-
- 移除属性 `validateTrigger` 字段触发校验类型
|
|
106
|
-
- 移除属性 `validateStatus` 校验状态
|
|
107
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
108
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
109
|
-
|
|
110
|
-
- FormSwitch 表单开关:
|
|
111
|
-
|
|
112
|
-
- 移除属性 `type` 显示类型
|
|
113
|
-
- 移除属性 `checkedIcon` 选中图标
|
|
114
|
-
- 移除属性 `uncheckedIcon` 非选中图标
|
|
115
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
116
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
117
|
-
|
|
118
|
-
- FormDate 表单日期:
|
|
119
|
-
|
|
120
|
-
- 移除属性 `suffixType` 操作尾部样式类型
|
|
121
|
-
- 移除属性 `suffixText` 操作尾部文案
|
|
122
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
123
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
124
|
-
|
|
125
|
-
- FormTime 表单时间:
|
|
126
|
-
|
|
127
|
-
- 移除属性 `suffixType` 操作尾部样式类型
|
|
128
|
-
- 移除属性 `suffixText` 操作尾部文案
|
|
129
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
130
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
131
|
-
|
|
132
|
-
- FormSelect 表单选择:
|
|
133
|
-
|
|
134
|
-
- 移除属性 `suffixType` 操作尾部样式类型
|
|
135
|
-
- 移除属性 `suffixText` 操作尾部文案
|
|
136
|
-
- 移除属性 `validateTrigger` 字段触发校验类型
|
|
137
|
-
- 移除属性 `validateStatus` 校验状态
|
|
138
|
-
- 移除属性 `rules` 校验规则
|
|
139
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
140
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
141
|
-
|
|
142
|
-
- FormPhone 表单手机号码:
|
|
143
|
-
|
|
144
|
-
- 移除属性 `maxLength` 最大输入长度
|
|
145
|
-
- 移除属性 `rules` 校验规则
|
|
146
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
147
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
148
|
-
|
|
149
|
-
- FormEmail 表单邮件地址:
|
|
150
|
-
|
|
151
|
-
- 移除属性 `rules` 校验规则
|
|
152
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
153
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
154
|
-
|
|
155
|
-
- FormUrl 表单邮件地址:
|
|
156
|
-
|
|
157
|
-
- 移除属性 `rules` 校验规则
|
|
158
|
-
- 移除属性 `requiredFlag` 是否需要必填星号
|
|
159
|
-
- 移除属性 `underline` 是否需要底部下划线
|
|
160
|
-
|
|
161
|
-
- FormItem 表单元素:
|
|
162
|
-
|
|
163
|
-
- 移除组件
|
|
164
|
-
|
|
165
|
-
- FormCell 表单表格:
|
|
166
|
-
|
|
167
|
-
- 移除组件
|
|
168
|
-
|
|
169
|
-
- RegionPicker 地域选择:
|
|
170
|
-
|
|
171
|
-
- 移除组件
|
|
172
|
-
|
|
173
|
-
- Textarea 多行输入:
|
|
174
|
-
|
|
175
|
-
- 移除组件, 待优化后重新上架
|
|
176
|
-
|
|
177
|
-
### Changed
|
|
178
|
-
|
|
179
|
-
- image 图片:
|
|
180
|
-
|
|
181
|
-
- 默认大小由 320\*240 rpx 调整为 240\*240 rpx
|
|
182
|
-
|
|
183
|
-
- text 文本:
|
|
184
|
-
|
|
185
|
-
- 跟随小程序定义,`selectabble` 变更为 `userSelect`
|
|
186
|
-
- 样式调整:默认布局模式从 `inline` 编程 `block`
|
|
187
|
-
|
|
188
|
-
- button 按钮:
|
|
189
|
-
|
|
190
|
-
- 样式调整:从默认宽度 `100%` 调整为默认 `184px`
|
|
191
|
-
|
|
192
|
-
- Form 表单容器:
|
|
193
|
-
|
|
194
|
-
- 样式优化
|
|
195
|
-
|
|
196
|
-
- FormInput 表单输入:
|
|
197
|
-
|
|
198
|
-
- 样式优化
|
|
199
|
-
|
|
200
|
-
- FormRadio 表单单选:
|
|
201
|
-
|
|
202
|
-
- 属性 `name` 表单字段名称,默认值由 `thisIsRadioKey` 改为 `formRadio`
|
|
203
|
-
- 样式优化
|
|
204
|
-
|
|
205
|
-
- FormCheckbox 表单复选:
|
|
206
|
-
|
|
207
|
-
- 属性 `name` 表单字段名称,默认值由 `thisIsCheckboxKey` 改为 `formCheckbox`
|
|
208
|
-
- 样式优化
|
|
209
|
-
|
|
210
|
-
- FormSwitch 表单开关:
|
|
211
|
-
|
|
212
|
-
- 属性 `name` 表单字段名称,默认值由 `thisIsSelectKey` 改为 `formSwitch`
|
|
213
|
-
- 样式优化
|
|
214
|
-
|
|
215
|
-
- FormDate 表单日期:
|
|
216
|
-
|
|
217
|
-
- 属性 `name` 表单字段名称,默认值由 `thisIsDateKey` 改为 `formDate`
|
|
218
|
-
- 样式优化
|
|
219
|
-
|
|
220
|
-
- FormTime 表单时间:
|
|
221
|
-
|
|
222
|
-
- 属性 `name` 表单字段名称,默认值由 `thisIsTimeKey` 改为 `formTime`
|
|
223
|
-
- 样式优化
|
|
224
|
-
|
|
225
|
-
- FormSelect 表单选择:
|
|
226
|
-
|
|
227
|
-
- 属性 `name` 表单字段名称,默认值由 `thisIsSelectKey` 改为 `formSelect`
|
|
228
|
-
- 样式优化
|
|
229
|
-
|
|
230
|
-
- FormPhone 表单手机号码:
|
|
231
|
-
|
|
232
|
-
- 样式优化
|
|
233
|
-
|
|
234
|
-
- FormEmail 表单邮件地址:
|
|
235
|
-
|
|
236
|
-
- 样式优化
|
|
237
|
-
|
|
238
|
-
- FormUrl 表单邮件地址:
|
|
239
|
-
|
|
240
|
-
- 样式优化
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/configs/.DS_Store
DELETED
|
Binary file
|
package/src/mp/.gitignore
DELETED
package/src/web/.DS_Store
DELETED
|
Binary file
|