@cloudbase/weda-ui 0.2.15 → 1.0.21
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 +28 -15
- package/src/configs/components/calendar.json +78 -0
- package/src/configs/components/carousel.json +273 -0
- 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 +379 -0
- package/src/configs/components/container.json +7 -2
- package/src/configs/components/dataView.json +154 -0
- package/src/configs/components/form/checkbox.json +97 -5
- package/src/configs/components/form/location.json +152 -0
- package/src/configs/components/form/radio.json +96 -4
- package/src/configs/components/form/select.json +245 -11
- package/src/configs/components/form/uploaderFile.json +2 -1
- package/src/configs/components/graphicCard.json +410 -0
- package/src/configs/components/image.json +7 -2
- package/src/configs/components/link.json +20 -4
- package/src/configs/components/listView.json +277 -0
- package/src/configs/components/modal.json +37 -5
- package/src/configs/components/navLayout.json +362 -0
- 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 +6 -3
- 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 +34 -0
- package/src/mp/components/button/index.js +12 -13
- package/src/mp/components/button/index.wxml +1 -1
- package/src/mp/components/calendar/arrowright--line.svg +11 -0
- package/src/mp/components/calendar/index.js +238 -0
- package/src/mp/components/calendar/index.json +4 -0
- package/src/mp/components/calendar/index.wxml +37 -0
- package/src/mp/components/calendar/index.wxss +178 -0
- package/src/mp/components/carousel/index.js +88 -0
- package/src/mp/components/carousel/index.json +7 -0
- package/src/mp/components/carousel/index.wxml +6 -0
- 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 +253 -0
- package/src/mp/components/chart/statisticsCard/index.json +4 -0
- package/src/mp/components/chart/statisticsCard/index.wxml +9 -0
- package/src/mp/components/chart/statisticsCard/index.wxss +45 -0
- package/src/mp/components/dataView/index.js +34 -0
- package/src/mp/components/dataView/index.json +7 -0
- package/src/mp/components/dataView/index.wxml +15 -0
- package/src/mp/components/dataView/index.wxss +0 -0
- 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/input/index.js +1 -1
- package/src/mp/components/form/location/components/mapChoose/index.js +201 -0
- package/src/mp/components/form/location/components/mapChoose/index.json +4 -0
- package/src/mp/components/form/location/components/mapChoose/index.wxml +42 -0
- package/src/mp/components/form/location/components/mapChoose/index.wxss +188 -0
- package/src/mp/components/form/location/index.js +382 -0
- package/src/mp/components/form/location/index.json +6 -0
- package/src/mp/components/form/location/index.wxml +25 -0
- package/src/mp/components/form/location/index.wxss +91 -0
- package/src/mp/components/form/radio/index.js +38 -0
- package/src/mp/components/form/select/index.js +360 -40
- package/src/mp/components/form/select/index.wxml +21 -6
- package/src/mp/components/form/select/region/index.js +98 -0
- package/src/mp/components/form/textarea/index.wxml +6 -5
- package/src/mp/components/form/uploader/index.js +84 -48
- package/src/mp/components/form/uploader/index.wxml +15 -3
- package/src/mp/components/form/uploaderFile/index.js +106 -27
- package/src/mp/components/graphicCard/chevron-right.svg +3 -0
- package/src/mp/components/graphicCard/index.js +203 -0
- package/src/mp/components/graphicCard/index.json +4 -0
- package/src/mp/components/graphicCard/index.wxml +29 -0
- package/src/mp/components/graphicCard/index.wxss +157 -0
- package/src/mp/components/image/index.js +0 -1
- package/src/mp/components/listView/arrow-right-line.svg +3 -0
- package/src/mp/components/listView/index.js +285 -0
- package/src/mp/components/listView/index.json +4 -0
- package/src/mp/components/listView/index.wxml +40 -0
- package/src/mp/components/listView/index.wxss +155 -0
- package/src/mp/components/listView/more-line.svg +3 -0
- package/src/mp/components/navLayout/index.js +123 -0
- package/src/mp/components/navLayout/index.json +7 -0
- package/src/mp/components/navLayout/index.wxml +25 -0
- package/src/mp/components/navLayout/index.wxss +1193 -0
- 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/swiper/index.wxml +2 -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 +18 -2
- package/src/mp/style/weda-ui.wxss +2 -0
- package/src/mp/utils/debounce.js +133 -0
- package/src/mp/utils/destr.js +48 -0
- package/src/mp/utils/dr_square_point.js +25 -0
- package/src/mp/utils/platform.js +25 -0
- package/src/mp/utils/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js +1336 -0
- package/src/mp/utils/spark-md5.js +776 -0
- package/src/mp/utils/tcb.js +62 -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/calendar/index.css +382 -0
- package/src/web/components/calendar/index.jsx +312 -0
- package/src/web/components/calendar/util.js +90 -0
- package/src/web/components/carousel/index.css +119 -0
- package/src/web/components/carousel/index.tsx +417 -0
- 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.css +62 -0
- package/src/web/components/chart/statisticsCard/index.tsx +307 -0
- package/src/web/components/chart/statisticsCard/interface.ts +14 -0
- package/src/web/components/dataView/index.tsx +20 -0
- package/src/web/components/dataView/interface.ts +6 -0
- package/src/web/components/form/checkbox/index.tsx +55 -23
- package/src/web/components/form/location/common/mapChoose.css +178 -0
- package/src/web/components/form/location/common/mapChoose.jsx +343 -0
- package/src/web/components/form/location/common/mapView.jsx +190 -0
- package/src/web/components/form/location/common/propsConfig.js +54 -0
- package/src/web/components/form/location/common/selectModal.css +44 -0
- package/src/web/components/form/location/common/selectModal.jsx +82 -0
- package/src/web/components/form/location/common/useLocationInfo.js +100 -0
- package/src/web/components/form/location/components/LocationH5/index.css +243 -0
- package/src/web/components/form/location/components/LocationH5/location.h5.jsx +403 -0
- package/src/web/components/form/location/components/LocationPC/Header.jsx +109 -0
- package/src/web/components/form/location/components/LocationPC/index.css +44 -0
- package/src/web/components/form/location/components/LocationPC/location.PC.jsx +323 -0
- package/src/web/components/form/location/constants.js +4 -0
- package/src/web/components/form/location/index.css +0 -0
- package/src/web/components/form/location/index.jsx +25 -0
- package/src/web/components/form/radio/index.tsx +84 -53
- package/src/web/components/form/select/h5.tsx +389 -71
- package/src/web/components/form/select/index.css +10 -0
- package/src/web/components/form/select/index.tsx +404 -144
- 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/uploader/uploader.h5.tsx +19 -4
- package/src/web/components/form/uploader/uploader.pc.tsx +8 -7
- package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +132 -113
- package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +16 -11
- package/src/web/components/graphicCard/index.css +159 -0
- package/src/web/components/graphicCard/index.tsx +310 -0
- package/src/web/components/image/image.tsx +1 -2
- package/src/web/components/image/index.tsx +1 -1
- package/src/web/components/index.js +24 -2
- package/src/web/components/link/index.tsx +6 -3
- package/src/web/components/listView/arrow-right-line.svg +3 -0
- package/src/web/components/listView/index.css +143 -0
- package/src/web/components/listView/index.tsx +359 -0
- package/src/web/components/listView/interface.ts +98 -0
- package/src/web/components/modal/index.tsx +3 -1
- package/src/web/components/navLayout/index.css +332 -0
- package/src/web/components/navLayout/index.tsx +247 -0
- 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 +4 -2
- package/src/web/components/tabs/tabs.h5.tsx +50 -37
- package/src/web/components/tabs/tabs.pc.tsx +23 -10
- package/src/web/components/text/index.tsx +6 -14
- package/src/web/components/uploaderFileView/index.css +9 -9
- package/src/web/components/uploaderFileView/index.jsx +32 -23
- package/src/web/components/userInfo/index.css +0 -0
- package/src/web/components/userInfo/index.tsx +30 -0
- package/src/web/types.d.ts +15 -14
- package/src/web/utils/debounce.js +98 -0
- package/src/web/utils/platform.js +40 -0
- package/src/web/utils/tcb.js +49 -0
- package/src/web/utils/tmap.js +4 -0
- 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
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import React, { useEffect, useState, useCallback } from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
import { CommonPropsType } from '../../types';
|
|
4
|
+
import classNames from '../../utils/classnames';
|
|
5
|
+
import { Row, Col, ConfigProvider, Button, Icon, Text } from 'tea-component';
|
|
6
|
+
import { usePlatform } from '../../utils/platform';
|
|
7
|
+
import { IconFont } from 'tdesign-icons-react';
|
|
8
|
+
|
|
9
|
+
const CLASS_PREFIX = 'weda-graphic-card';
|
|
10
|
+
|
|
11
|
+
export interface IGraphicCardPropsType extends CommonPropsType {
|
|
12
|
+
/**
|
|
13
|
+
* 导航配置
|
|
14
|
+
*/
|
|
15
|
+
navOption?: Array<any>;
|
|
16
|
+
titleVisible: boolean;
|
|
17
|
+
titleColor: string;
|
|
18
|
+
titleFontWeight: string;
|
|
19
|
+
titleFontSize: number;
|
|
20
|
+
titleLineHeight: string;
|
|
21
|
+
titleMaxLines: number;
|
|
22
|
+
desColor: string;
|
|
23
|
+
desFontWeight: string;
|
|
24
|
+
desVisible: boolean;
|
|
25
|
+
desFontSize: number;
|
|
26
|
+
desLineHeight: string;
|
|
27
|
+
desMaxLines: number;
|
|
28
|
+
buttonVisible: boolean;
|
|
29
|
+
buttonText: string;
|
|
30
|
+
ColMobile: number;
|
|
31
|
+
ColPC: number;
|
|
32
|
+
percentageVisible: boolean;
|
|
33
|
+
iconWidthSize: string;
|
|
34
|
+
iconHeightSize: string;
|
|
35
|
+
textAlign?: 'start' | 'end' | 'left' | 'right' | 'center' | 'justify';
|
|
36
|
+
imageStyle: any;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default function GraphicCard({
|
|
40
|
+
navOption,
|
|
41
|
+
ColMobile,
|
|
42
|
+
ColPC,
|
|
43
|
+
percentageVisible,
|
|
44
|
+
iconWidthSize,
|
|
45
|
+
iconHeightSize,
|
|
46
|
+
titleVisible,
|
|
47
|
+
desVisible,
|
|
48
|
+
buttonVisible,
|
|
49
|
+
textAlign,
|
|
50
|
+
className,
|
|
51
|
+
titleColor,
|
|
52
|
+
titleFontWeight,
|
|
53
|
+
titleFontSize,
|
|
54
|
+
titleLineHeight,
|
|
55
|
+
titleMaxLines,
|
|
56
|
+
desColor,
|
|
57
|
+
desFontWeight,
|
|
58
|
+
desFontSize,
|
|
59
|
+
desLineHeight,
|
|
60
|
+
desMaxLines,
|
|
61
|
+
buttonText,
|
|
62
|
+
style,
|
|
63
|
+
}: IGraphicCardPropsType) {
|
|
64
|
+
const platform = usePlatform();
|
|
65
|
+
const isH5: boolean = platform === 'h5';
|
|
66
|
+
// 一个栅格的宽度
|
|
67
|
+
const [SingleGrid, setSingleGrid] = useState({ width: 10 });
|
|
68
|
+
const [colCount, setColCount] = React.useState(2);
|
|
69
|
+
const cls = classNames({
|
|
70
|
+
[CLASS_PREFIX]: true,
|
|
71
|
+
[className]: className,
|
|
72
|
+
[`${CLASS_PREFIX}-mobile`]: isH5,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const cardList = React.useMemo(() => {
|
|
76
|
+
let list = [];
|
|
77
|
+
const col = isH5 ? ColMobile : ColPC;
|
|
78
|
+
setColCount(col);
|
|
79
|
+
list.length = Math.floor(navOption.length / colCount);
|
|
80
|
+
list.forEach((item, index) => {
|
|
81
|
+
list[index] = [];
|
|
82
|
+
});
|
|
83
|
+
//debugger;
|
|
84
|
+
navOption.forEach((item, index) => {
|
|
85
|
+
const _index = Math.floor(index / colCount);
|
|
86
|
+
if (!list[_index] || list[_index].length <= 0) {
|
|
87
|
+
// 保证每个col 的数据都是有的,列入总共7个数据,那么第二行的3, 4,5数据是undefined, 占位
|
|
88
|
+
list[_index] = Array.apply(null, Array(colCount));
|
|
89
|
+
}
|
|
90
|
+
const paramObj = {};
|
|
91
|
+
if (item?.params) {
|
|
92
|
+
for (let info of item.params) {
|
|
93
|
+
paramObj[info.key] = info.value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
item.paramObj = paramObj;
|
|
97
|
+
list[_index][index - _index * colCount] = item;
|
|
98
|
+
list[_index][index - _index * colCount] = item;
|
|
99
|
+
});
|
|
100
|
+
return list;
|
|
101
|
+
}, [colCount, navOption, isH5]);
|
|
102
|
+
const elementStyle = document.createElement('body').style;
|
|
103
|
+
let vendor = (() => {
|
|
104
|
+
let transformNames = {
|
|
105
|
+
webkit: 'webkitTransform',
|
|
106
|
+
Moz: 'MozTransform',
|
|
107
|
+
O: 'OTransform',
|
|
108
|
+
ms: 'msTransform',
|
|
109
|
+
standard: 'transform',
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
for (let key in transformNames) {
|
|
113
|
+
if (elementStyle[transformNames[key]] !== undefined) {
|
|
114
|
+
return key;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return false;
|
|
119
|
+
})();
|
|
120
|
+
function prefixStyle(style) {
|
|
121
|
+
if (vendor === false) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (vendor === 'standard') {
|
|
126
|
+
return style;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return '-' + vendor + style.charAt(0).toUpperCase() + style.substr(1);
|
|
130
|
+
}
|
|
131
|
+
const boxStyle = prefixStyle('-box');
|
|
132
|
+
//标题样式
|
|
133
|
+
const titleStyle = {
|
|
134
|
+
display: `${boxStyle}`,
|
|
135
|
+
WebkitLineClamp: `${titleMaxLines ? titleMaxLines : 'inherit'}`,
|
|
136
|
+
overflow: 'hidden',
|
|
137
|
+
color: `${titleColor}`,
|
|
138
|
+
fontWeight: `${titleFontWeight}`,
|
|
139
|
+
fontSize: `${titleFontSize}` + 'px',
|
|
140
|
+
textAlign: `${textAlign}`,
|
|
141
|
+
lineHeight: `${titleLineHeight == 'auto' ? 'normal' : titleLineHeight}`,
|
|
142
|
+
} as React.CSSProperties;
|
|
143
|
+
const desStyle = {
|
|
144
|
+
display: `${boxStyle}`,
|
|
145
|
+
WebkitLineClamp: `${desMaxLines ? desMaxLines : 'inherit'}`,
|
|
146
|
+
overflow: 'hidden',
|
|
147
|
+
color: `${desColor}`,
|
|
148
|
+
fontWeight: `${desFontWeight}`,
|
|
149
|
+
fontSize: `${desFontSize}` + 'px',
|
|
150
|
+
textAlign: `${textAlign}`,
|
|
151
|
+
lineHeight: `${desLineHeight == 'auto' ? 'normal' : desLineHeight}`,
|
|
152
|
+
} as React.CSSProperties;
|
|
153
|
+
|
|
154
|
+
// 图片高度: 100% 基础下 H5: 1列 200px;2列 98px PC: 3列 220px 4列 162px
|
|
155
|
+
const imageStyle = React.useMemo(() => {
|
|
156
|
+
let width = '100%';
|
|
157
|
+
let height = platform === 'h5' ? '200' : '220';
|
|
158
|
+
if (platform === 'h5' && ColMobile === 2) {
|
|
159
|
+
height = '98';
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (platform !== 'h5' && ColPC === 4) {
|
|
163
|
+
height = '162';
|
|
164
|
+
}
|
|
165
|
+
const numReg = /^\d+$/;
|
|
166
|
+
width = numReg.test(iconWidthSize) ? iconWidthSize + 'px' : iconWidthSize;
|
|
167
|
+
height = numReg.test(iconHeightSize)
|
|
168
|
+
? iconHeightSize + 'px' //纯数字
|
|
169
|
+
: iconHeightSize.indexOf('%') == -1
|
|
170
|
+
? iconHeightSize
|
|
171
|
+
: (Number(height) * parseInt(iconHeightSize)) / 100 + 'px';
|
|
172
|
+
return { width, height };
|
|
173
|
+
}, [iconWidthSize, iconHeightSize, ColMobile, ColPC, isH5]);
|
|
174
|
+
|
|
175
|
+
const detailStyle = React.useMemo(() => {
|
|
176
|
+
let docWidth = (document.documentElement.clientWidth - 24 * 2) / 12;
|
|
177
|
+
setSingleGrid({ width: docWidth });
|
|
178
|
+
if (textAlign == 'left') {
|
|
179
|
+
return {
|
|
180
|
+
paddingRight: `${docWidth * 0.5 - docWidth * 0.1}px`,
|
|
181
|
+
paddingLeft: 0,
|
|
182
|
+
};
|
|
183
|
+
} else if (textAlign == 'right') {
|
|
184
|
+
return {
|
|
185
|
+
paddingLeft: `${docWidth * 0.5 - docWidth * 0.1}px`,
|
|
186
|
+
paddingRight: 0,
|
|
187
|
+
};
|
|
188
|
+
} else {
|
|
189
|
+
return {
|
|
190
|
+
paddingLeft: `${(docWidth * 0.5 - docWidth * 0.1) / 2}px`,
|
|
191
|
+
paddingRight: `${(docWidth * 0.5 - docWidth * 0.1) / 2}px`,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}, [textAlign, isH5]);
|
|
195
|
+
|
|
196
|
+
const tapTo = (colInfo = navOption[0]) => {
|
|
197
|
+
switch (colInfo?.tapStatus) {
|
|
198
|
+
case 'tap':
|
|
199
|
+
return null;
|
|
200
|
+
case 'inside':
|
|
201
|
+
if (colInfo.insideUrl) {
|
|
202
|
+
app.navigateTo({
|
|
203
|
+
mode: 'weDa',
|
|
204
|
+
pageId: colInfo.insideUrl,
|
|
205
|
+
params:
|
|
206
|
+
colInfo?.withParams && colInfo?.params.length > 0
|
|
207
|
+
? colInfo.paramObj
|
|
208
|
+
: null,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
break;
|
|
212
|
+
//return renderCancel();
|
|
213
|
+
case 'outer':
|
|
214
|
+
if (colInfo.newPage) {
|
|
215
|
+
colInfo.outerUrl ? window.open(colInfo.outerUrl) : false;
|
|
216
|
+
} else {
|
|
217
|
+
colInfo.outerUrl ? (window.location.href = colInfo.outerUrl) : false;
|
|
218
|
+
}
|
|
219
|
+
break;
|
|
220
|
+
default:
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
<ConfigProvider classPrefix="wedatea2td">
|
|
227
|
+
<div className={cls} data-testid="graphicCard" style={style}>
|
|
228
|
+
<div className={`${CLASS_PREFIX}__wrapper`}>
|
|
229
|
+
{cardList.map((row, rowIndex) => {
|
|
230
|
+
return (
|
|
231
|
+
<Row className={`${CLASS_PREFIX}__row`} key={rowIndex}>
|
|
232
|
+
<>
|
|
233
|
+
{row &&
|
|
234
|
+
row.map((col, colIndex) => {
|
|
235
|
+
return (
|
|
236
|
+
// 每列内容左右间距为0.1栅格列宽
|
|
237
|
+
<Col
|
|
238
|
+
style={{
|
|
239
|
+
width: `${(1 / colCount) * 100}%`,
|
|
240
|
+
padding: `0 ${SingleGrid.width * 0.1}px`,
|
|
241
|
+
cursor:
|
|
242
|
+
col?.tapStatus != 'tap' ? 'pointer' : 'auto',
|
|
243
|
+
}}
|
|
244
|
+
className={`${CLASS_PREFIX}__col ${CLASS_PREFIX}__col--${textAlign}`}
|
|
245
|
+
key={colIndex}
|
|
246
|
+
>
|
|
247
|
+
<div
|
|
248
|
+
className="wedatea2td-grid__box"
|
|
249
|
+
data-testid={`${colIndex}_click`}
|
|
250
|
+
onClick={() => tapTo(col)}
|
|
251
|
+
>
|
|
252
|
+
<div className={`${CLASS_PREFIX}__col-body`}>
|
|
253
|
+
{col && (
|
|
254
|
+
<div
|
|
255
|
+
className={`${CLASS_PREFIX}__icon`}
|
|
256
|
+
style={imageStyle}
|
|
257
|
+
>
|
|
258
|
+
<img
|
|
259
|
+
src={col?.icon}
|
|
260
|
+
className={`${CLASS_PREFIX}__img`}
|
|
261
|
+
/>
|
|
262
|
+
</div>
|
|
263
|
+
)}
|
|
264
|
+
{/* 详情右侧间距为0.5栅格列宽 */}
|
|
265
|
+
<div className={`${CLASS_PREFIX}__detail`}>
|
|
266
|
+
{titleVisible && col?.title && (
|
|
267
|
+
<div
|
|
268
|
+
className={`${CLASS_PREFIX}__title`}
|
|
269
|
+
style={titleStyle}
|
|
270
|
+
>
|
|
271
|
+
{col?.title}
|
|
272
|
+
</div>
|
|
273
|
+
)}
|
|
274
|
+
{desVisible && col?.des && (
|
|
275
|
+
<div
|
|
276
|
+
className={`${CLASS_PREFIX}__desc`}
|
|
277
|
+
style={desStyle}
|
|
278
|
+
>
|
|
279
|
+
{col?.des}
|
|
280
|
+
</div>
|
|
281
|
+
)}
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
{buttonVisible && col && (
|
|
285
|
+
<Button
|
|
286
|
+
type="link"
|
|
287
|
+
className={`${CLASS_PREFIX}__btn`}
|
|
288
|
+
>
|
|
289
|
+
<Text className={`${CLASS_PREFIX}__btn--text`}>
|
|
290
|
+
{buttonText}
|
|
291
|
+
</Text>
|
|
292
|
+
<IconFont
|
|
293
|
+
name="arrow-right"
|
|
294
|
+
className={`${CLASS_PREFIX}__btn-icon`}
|
|
295
|
+
/>
|
|
296
|
+
</Button>
|
|
297
|
+
)}
|
|
298
|
+
</div>
|
|
299
|
+
</Col>
|
|
300
|
+
);
|
|
301
|
+
})}
|
|
302
|
+
</>
|
|
303
|
+
</Row>
|
|
304
|
+
);
|
|
305
|
+
})}
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
</ConfigProvider>
|
|
309
|
+
);
|
|
310
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import * as PropTypes from 'prop-types';
|
|
3
2
|
import { ConfigProvider, ImagePreview } from 'tea-component';
|
|
4
3
|
import { usePlatform } from '../../utils/platform';
|
|
5
4
|
import { useGesture } from '@use-gesture/react';
|
|
@@ -185,4 +184,4 @@ export function ImageInner({
|
|
|
185
184
|
</ConfigProvider>
|
|
186
185
|
);
|
|
187
186
|
}
|
|
188
|
-
}
|
|
187
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@tcwd/style-wedatheme/index.css';
|
|
2
|
-
import loadable from '@loadable/component';
|
|
3
|
-
import { fallback } from '../utils/loading-fallback';
|
|
2
|
+
// import loadable from '@loadable/component';
|
|
3
|
+
// import { fallback } from '../utils/loading-fallback';
|
|
4
4
|
|
|
5
5
|
// export const Button = loadable(() => import('./button'), {fallback});
|
|
6
6
|
// export const Text = loadable(() => import('./text'), {fallback});
|
|
@@ -39,6 +39,7 @@ export { default as Image } from './image';
|
|
|
39
39
|
export { default as Slot } from './slot';
|
|
40
40
|
export { default as ScrollView } from './scrollView';
|
|
41
41
|
export { default as Swiper } from './swiper';
|
|
42
|
+
export { default as Carousel } from './carousel';
|
|
42
43
|
export { default as Modal } from './modal';
|
|
43
44
|
export { default as RichText } from './richText';
|
|
44
45
|
export { default as RichTextView } from './richTextView';
|
|
@@ -62,7 +63,28 @@ export { default as Uploader } from './form/uploader';
|
|
|
62
63
|
export { default as UploaderFile } from './form/uploaderFile';
|
|
63
64
|
export { default as Tips } from './form/tips';
|
|
64
65
|
export { default as Tabs } from './tabs';
|
|
66
|
+
|
|
67
|
+
export { default as Location } from './form/location';
|
|
68
|
+
|
|
65
69
|
export { default as EnumSelect } from './form/enumSelect';
|
|
70
|
+
export { default as Calendar } from './calendar';
|
|
71
|
+
export { default as NavLayout } from './navLayout';
|
|
72
|
+
|
|
73
|
+
// Data Contaier
|
|
74
|
+
export { default as ListView } from './listView';
|
|
75
|
+
export { default as NavigationBar } from './navigationBar';
|
|
76
|
+
export { default as Line } from './chart/line';
|
|
77
|
+
export { default as Bar } from './chart/bar';
|
|
78
|
+
export { default as Pie } from './chart/pie';
|
|
79
|
+
export { default as DataView } from './dataView';
|
|
80
|
+
|
|
81
|
+
export { default as StatisticsCard } from './chart/statisticsCard';
|
|
82
|
+
export { default as GraphicCard } from './graphicCard';
|
|
83
|
+
|
|
84
|
+
export { default as UserInfo } from './userInfo';
|
|
85
|
+
export { default as Phone } from './phone';
|
|
86
|
+
export { default as PhoneCode } from './phoneCode';
|
|
87
|
+
export { default as Share } from './share';
|
|
66
88
|
|
|
67
89
|
// open
|
|
68
90
|
// import Auth from './auth';
|
|
@@ -17,6 +17,7 @@ export interface PropsType extends CommonPropsType {
|
|
|
17
17
|
*/
|
|
18
18
|
params?: {key: string, value: string}[];
|
|
19
19
|
contentSlot?: React.ReactNode;
|
|
20
|
+
isOpenInNewWindow: boolean;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
// 所有绝对地址直接交由浏览器,新开窗口交由浏览器
|
|
@@ -28,7 +29,8 @@ export default function Link({
|
|
|
28
29
|
style,
|
|
29
30
|
className,
|
|
30
31
|
contentSlot,
|
|
31
|
-
params = [], // TODO
|
|
32
|
+
params = [], // TODO 格式定义,
|
|
33
|
+
isOpenInNewWindow = false,
|
|
32
34
|
}: PropsType) {
|
|
33
35
|
url = url.trim();
|
|
34
36
|
const cls = classNames({
|
|
@@ -91,6 +93,7 @@ export default function Link({
|
|
|
91
93
|
<a
|
|
92
94
|
style={{ ...style }}
|
|
93
95
|
className={cls}
|
|
96
|
+
target={isOpenInNewWindow ? '_blank' : '_self'}
|
|
94
97
|
href={href}
|
|
95
98
|
onClick={(e) => {
|
|
96
99
|
events.tap && events.tap({}, { originEvent: e });
|
|
@@ -107,10 +110,10 @@ export default function Link({
|
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
}}
|
|
110
|
-
rel=
|
|
113
|
+
rel='noopener noreferrer'
|
|
111
114
|
>
|
|
112
115
|
{contentSlot && <div className="weda-link-slot">{contentSlot}</div>}
|
|
113
116
|
{content}
|
|
114
117
|
</a>
|
|
115
118
|
);
|
|
116
|
-
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
.weda-list-view__containor {
|
|
2
|
+
overflow-y: auto;
|
|
3
|
+
max-height: 100%;
|
|
4
|
+
overflow-x: hidden;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.weda-list-view-card {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
margin-right: 3px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* 加载更多 */
|
|
14
|
+
.weda-list-view__containor .weda-list-view__more {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.weda-list-view__containor .weda-list-view__more .weda-list-view__bottom-load {
|
|
19
|
+
padding-top: 1px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.weda-list-view__containor .weda-list-view__more .weda-list-view__more-text {
|
|
23
|
+
padding-top: 10px;
|
|
24
|
+
padding-bottom: 14px;
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
line-height: 22px;
|
|
27
|
+
color: rgba(0, 0, 0, 0.4);
|
|
28
|
+
text-align: center;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* 加载更多 ... */
|
|
34
|
+
.weda-list-view__containor .weda-list-view__more .weda-list-view__more-symbol {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
padding-top: 20px;
|
|
39
|
+
padding-bottom: 18px;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.weda-list-view__containor .weda-list-view__more .weda-list-view__symbol-item {
|
|
44
|
+
width: 8px;
|
|
45
|
+
height: 8px;
|
|
46
|
+
background: #c4c4c4;
|
|
47
|
+
margin-left: 6px;
|
|
48
|
+
border-radius: 50%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.weda-list-view__containor
|
|
52
|
+
.weda-list-view__more
|
|
53
|
+
.weda-list-view__symbol-item:first-child {
|
|
54
|
+
width: 6px;
|
|
55
|
+
height: 6px;
|
|
56
|
+
margin-left: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* 加载更多 分页 */
|
|
60
|
+
.weda-list-view__containor .weda-list-view__more {
|
|
61
|
+
background-color: #fff;
|
|
62
|
+
}
|
|
63
|
+
.weda-list-view__containor
|
|
64
|
+
.weda-list-view__more.weda-list-view__more-bottomLoad {
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
}
|
|
67
|
+
.weda-list-view__containor
|
|
68
|
+
.weda-list-view__more
|
|
69
|
+
.weda-list-view__more-pagination {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: space-between;
|
|
73
|
+
position: relative;
|
|
74
|
+
padding: 10px 18px 12px 16px;
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.weda-list-view__containor
|
|
79
|
+
.weda-list-view__more
|
|
80
|
+
.weda-list-view__pagination-pre,
|
|
81
|
+
.weda-list-view__containor
|
|
82
|
+
.weda-list-view__more
|
|
83
|
+
.weda-list-view__pagination-next {
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
line-height: 24px;
|
|
86
|
+
color: rgba(0, 0, 0, 0.4);
|
|
87
|
+
padding: 0 24px;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.weda-list-view__containor
|
|
92
|
+
.weda-list-view__more
|
|
93
|
+
.weda-list-view__pagination-pre.active,
|
|
94
|
+
.weda-list-view__containor
|
|
95
|
+
.weda-list-view__more
|
|
96
|
+
.weda-list-view__pagination-next.active {
|
|
97
|
+
color: rgba(0, 0, 0, 0.9);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.weda-list-view__containor
|
|
101
|
+
.weda-list-view__more
|
|
102
|
+
.weda-list-view__pagination-pre::before,
|
|
103
|
+
.weda-list-view__containor
|
|
104
|
+
.weda-list-view__more
|
|
105
|
+
.weda-list-view__pagination-next::after {
|
|
106
|
+
position: absolute;
|
|
107
|
+
content: '';
|
|
108
|
+
width: 24px;
|
|
109
|
+
height: 24px;
|
|
110
|
+
top: 10px;
|
|
111
|
+
opacity: 0.2;
|
|
112
|
+
background-image: url(arrow-right-line.svg);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.weda-list-view__containor
|
|
116
|
+
.weda-list-view__more
|
|
117
|
+
.active.weda-list-view__pagination-pre::before,
|
|
118
|
+
.weda-list-view__containor
|
|
119
|
+
.weda-list-view__more
|
|
120
|
+
.active.weda-list-view__pagination-next::after {
|
|
121
|
+
opacity: 1;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.weda-list-view__containor
|
|
125
|
+
.weda-list-view__more
|
|
126
|
+
.weda-list-view__pagination-pre::before {
|
|
127
|
+
left: 16px;
|
|
128
|
+
transform: rotate(180deg);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.weda-list-view__containor
|
|
132
|
+
.weda-list-view__more
|
|
133
|
+
.weda-list-view__pagination-next::after {
|
|
134
|
+
right: 18px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.weda-list-view__containor
|
|
138
|
+
.weda-list-view__more
|
|
139
|
+
.weda-list-view__pagination-text {
|
|
140
|
+
font-size: 12px;
|
|
141
|
+
line-height: 22px;
|
|
142
|
+
color: rgba(0, 0, 0, 0.4);
|
|
143
|
+
}
|