@cloudbase/weda-ui 2.0.11 → 2.0.12
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 +1 -0
- package/package.json +5 -4
- package/src/configs/components/button.json +60 -13
- package/src/configs/components/calendar.json +3 -3
- package/src/configs/components/carousel.json +57 -47
- package/src/configs/components/chart/bar.json +4 -13
- package/src/configs/components/chart/line.json +4 -13
- package/src/configs/components/chart/pie.json +3 -10
- package/src/configs/components/chart/statisticsCard.json +1 -4
- package/src/configs/components/container.json +1 -3
- package/src/configs/components/dataView.json +7 -15
- package/src/configs/components/drawer.json +24 -6
- package/src/configs/components/form/form.json +19 -0
- package/src/configs/components/form/input.json +20 -5
- package/src/configs/components/form/location.json +51 -48
- package/src/configs/components/form/radio.json +1 -3
- package/src/configs/components/form/richText.json +14 -14
- package/src/configs/components/form/select.json +62 -82
- package/src/configs/components/form/textarea.json +6 -1
- package/src/configs/components/form/uploader.json +64 -64
- package/src/configs/components/form/uploaderFile.json +1 -2
- package/src/configs/components/graphicCard.json +43 -44
- package/src/configs/components/image.json +44 -40
- package/src/configs/components/link.json +5 -10
- package/src/configs/components/listView.json +2 -8
- package/src/configs/components/lottery.json +7 -3
- package/src/configs/components/modal.json +26 -21
- package/src/configs/components/navLayout.json +66 -67
- package/src/configs/components/navigationBar.json +4 -1
- package/src/configs/components/richtextview.json +1 -1
- package/src/configs/components/scrollVeiw.json +14 -42
- package/src/configs/components/swiper.json +9 -9
- package/src/configs/components/wedaVideo.json +86 -0
- package/src/configs/components/wxOpenApi/phone.json +7 -21
- package/src/configs/components/wxOpenApi/phoneCode.json +7 -19
- package/src/configs/components/wxOpenApi/share.json +14 -24
- package/src/configs/components/wxOpenApi/userInfo.json +9 -27
- package/src/configs/index.js +2 -0
- package/src/docs/common/format.tsx +4 -1
- package/src/docs/common/tableView.css +3 -3
- package/src/docs/common/tableView.tsx +18 -8
- package/src/docs/compsdocs/form/FormLocation.mdx +1 -1
- package/src/docs/compsdocs/form/FormSelect.mdx +0 -1
- package/src/docs/compsdocs/grid/Card.mdx +0 -1
- package/src/docs/compsdocs/grid/Container.mdx +0 -1
- package/src/docs/compsdocs/grid/GridLayout.mdx +0 -1
- package/src/docs/compsdocs/grid/ScrollView.mdx +2 -2
- package/src/docs/compsdocs/grid/Swiper.mdx +1 -2
- package/src/docs/compsdocs/media/Icon.mdx +1 -1
- package/src/docs/compsdocs/media/Image.mdx +6 -6
- package/src/docs/compsdocs/model/ModelCreate.mdx +24 -0
- package/src/docs/compsdocs/model/ModelDetail.mdx +24 -0
- package/src/docs/compsdocs/model/ModelTable.mdx +133 -1
- package/src/docs/compsdocs/model/ModelUpdate.mdx +24 -1
- package/src/docs/compsdocs/navmenu/Classification.mdx +2 -3
- package/src/docs/compsdocs/navmenu/NavBar.mdx +14 -5
- package/src/docs/compsdocs/navmenu/NavLayout.mdx +0 -1
- package/src/docs/compsdocs/navmenu/TabBar.mdx +3 -3
- package/src/docs/compsdocs/navmenu/TabBarItem.mdx +1 -1
- package/src/docs/compsdocs/senior/Lottery.mdx +3 -6
- package/src/docs/compsdocs/senior/Modal.mdx +2 -3
- package/src/docs/compsdocs/senior/SlotMachine.mdx +2 -5
- package/src/docs/compsdocs/senior/_category_.json +1 -1
- package/src/docs/compsdocs/show/GraphicCard.mdx +0 -1
- package/src/docs/compsdocs/show/Item.mdx +0 -1
- package/src/docs/compsdocs/show/ItemList.mdx +1 -0
- package/src/docs/compsdocs/show/Tabs.mdx +2 -3
- package/src/docs/compsdocs/text/Link.mdx +1 -1
- package/src/docs/compsdocs/text/RichTextView.mdx +1 -2
- package/src/docs/compsdocs/text/Text.mdx +1 -1
- package/src/docs/compsdocs/text/Title.mdx +1 -2
- package/src/docs/compsdocs/wxOpen/Phone.mdx +1 -2
- package/src/docs/compsdocs/wxOpen/Share.mdx +0 -1
- package/src/docs/compsdocs/wxOpen/UserInfo.mdx +1 -2
- package/src/mp/components/calendar/index.json +1 -1
- package/src/mp/components/calendar/index.wxml +5 -27
- package/src/mp/components/carousel/index.json +1 -1
- package/src/mp/components/carousel/index.wxml +3 -30
- package/src/mp/components/chart/bar/index.wxml +1 -6
- package/src/mp/components/chart/ec-canvas/ec-canvas.json +1 -1
- package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +2 -19
- package/src/mp/components/chart/line/index.wxml +1 -6
- package/src/mp/components/chart/pie/index.wxml +1 -6
- package/src/mp/components/chart/statisticsCard/index.wxml +1 -5
- package/src/mp/components/dataView/index.wxml +1 -13
- package/src/mp/components/form/checkbox/index.wxml +3 -18
- package/src/mp/components/form/formcell/index.wxss +5 -0
- package/src/mp/components/form/input/index.wxml +3 -16
- package/src/mp/components/form/input/index.wxss +7 -1
- package/src/mp/components/form/location/components/mapChoose/index.json +1 -1
- package/src/mp/components/form/location/components/mapChoose/index.wxml +11 -58
- package/src/mp/components/form/location/index.js +7 -1
- package/src/mp/components/form/location/index.json +1 -1
- package/src/mp/components/form/location/index.wxml +7 -43
- package/src/mp/components/form/radio/index.wxml +2 -14
- package/src/mp/components/form/select/index.wxml +3 -33
- package/src/mp/components/form/select/index.wxss +9 -0
- package/src/mp/components/form/switch/index.wxml +2 -13
- package/src/mp/components/form/textarea/index.wxml +4 -23
- package/src/mp/components/form/textarea/index.wxss +5 -0
- package/src/mp/components/form/uploader/index.wxml +2 -20
- package/src/mp/components/form/uploader/weui-uploader.json +6 -6
- package/src/mp/components/form/uploader/weui-uploader.wxml +10 -53
- package/src/mp/components/form/uploaderFile/index.wxml +14 -71
- package/src/mp/components/graphicCard/index.js +9 -11
- package/src/mp/components/graphicCard/index.wxml +6 -34
- package/src/mp/components/image/index.wxml +3 -21
- package/src/mp/components/listView/index.wxml +8 -33
- package/src/mp/components/lottery/index.wxml +7 -31
- package/src/mp/components/navLayout/index.js +9 -12
- package/src/mp/components/navLayout/index.wxml +6 -30
- package/src/mp/components/navigationBar/index.json +1 -2
- package/src/mp/components/navigationBar/index.wxml +29 -146
- package/src/mp/components/swiper/index.wxml +1 -14
- package/src/mp/components/tabs/index.json +1 -1
- package/src/mp/components/tabs/index.wxml +3 -22
- package/src/mp/components/text/index.wxml +1 -7
- package/src/mp/components/wedaVideo/index.js +86 -0
- package/src/mp/components/wedaVideo/index.json +4 -0
- package/src/mp/components/wedaVideo/index.wxml +4 -0
- package/src/mp/components/wedaVideo/index.wxss +20 -0
- package/src/mp/components/wxOpenApi/phone/index.js +1 -9
- package/src/mp/components/wxOpenApi/phone/index.wxml +1 -11
- package/src/mp/components/wxOpenApi/phoneCode/index.json +1 -1
- package/src/mp/components/wxOpenApi/phoneCode/index.wxml +1 -11
- package/src/mp/components/wxOpenApi/share/index.wxml +1 -11
- package/src/mp/components/wxOpenApi/userInfo/index.wxml +1 -10
- package/src/mp/index.json +1 -0
- package/src/mp/style/weda-ui.wxss +12 -4
- package/src/web/actions/showModal/index.tsx +5 -4
- package/src/web/components/calendar/index.css +81 -34
- package/src/web/components/chart/common/core/eChartBase.ts +55 -42
- package/src/web/components/chart/common/core/type.ts +23 -23
- package/src/web/components/chart/common/echart.css +12 -12
- package/src/web/components/chart/common/echarts.ts +3 -5
- package/src/web/components/chart/common/useChart.tsx +34 -16
- package/src/web/components/container/index.tsx +3 -4
- package/src/web/components/drawer/index.tsx +15 -4
- package/src/web/components/form/checkbox/index.tsx +32 -31
- package/src/web/components/form/enumSelect/NormalSelect.tsx +0 -2
- package/src/web/components/form/form/index.css +3 -6
- package/src/web/components/form/form/index.tsx +2 -1
- package/src/web/components/form/formcell/index.css +5 -3
- package/src/web/components/form/formcell/index.tsx +2 -6
- package/src/web/components/form/input/index.css +4 -4
- package/src/web/components/form/input/index.tsx +61 -53
- package/src/web/components/form/location/common/selectModal.jsx +2 -11
- package/src/web/components/form/location/common/useLocationInfo.js +4 -0
- package/src/web/components/form/location/components/LocationH5/index.css +0 -1
- package/src/web/components/form/location/components/LocationH5/location.h5.jsx +11 -1
- package/src/web/components/form/location/components/LocationPC/Header.jsx +0 -13
- package/src/web/components/form/location/components/LocationPC/location.PC.jsx +14 -5
- package/src/web/components/form/radio/index.tsx +32 -26
- package/src/web/components/form/renderDecorator.tsx +23 -26
- package/src/web/components/form/select/h5.tsx +1 -1
- package/src/web/components/form/select/index.css +9 -0
- package/src/web/components/form/select/index.tsx +75 -48
- package/src/web/components/form/select/region/index.ts +101 -80
- package/src/web/components/form/select/year.tsx +2 -0
- package/src/web/components/form/switch/index.tsx +40 -40
- package/src/web/components/form/textarea/index.css +4 -0
- package/src/web/components/form/textarea/index.tsx +26 -25
- package/src/web/components/form/types.d.ts +10 -10
- package/src/web/components/form/uploaderFile/index.jsx +0 -5
- package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +15 -11
- package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +14 -9
- package/src/web/components/image/image.tsx +2 -2
- package/src/web/components/image/index.css +9 -7
- package/src/web/components/image/index.tsx +28 -11
- package/src/web/components/index.js +1 -0
- package/src/web/components/link/index.tsx +12 -12
- package/src/web/components/lottery/index.css +43 -37
- package/src/web/components/lottery/index.tsx +2 -2
- package/src/web/components/modal/index.tsx +34 -34
- package/src/web/components/picker/datePicker.tsx +3 -3
- package/src/web/components/picker/picker.tsx +3 -3
- package/src/web/components/richText/index.jsx +41 -46
- package/src/web/components/richTextView/index.tsx +4 -6
- package/src/web/components/scrollView/index.tsx +2 -2
- package/src/web/components/slot/index.tsx +3 -4
- package/src/web/components/swiper/index.css +1 -1
- package/src/web/components/swiper/index.tsx +33 -15
- package/src/web/components/tabs/index.css +1 -1
- package/src/web/components/tabs/index.tsx +6 -6
- package/src/web/components/tabs/tabs.h5.tsx +17 -12
- package/src/web/components/tabs/tabs.pc.tsx +45 -34
- package/src/web/components/text/index.css +1 -1
- package/src/web/components/wedaVideo/index.css +42 -0
- package/src/web/components/wedaVideo/index.tsx +198 -0
- package/src/web/utils/constant.ts +2 -1
- package/src/web/utils/loading-fallback.tsx +2 -2
- package/src/web/utils/lodash.ts +1 -1
- package/src/web/utils/useSetState.ts +6 -2
- package/src/web/weda-ui.css +13 -0
|
@@ -1,14 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
useAsync,
|
|
3
|
+
useDeepCompareEffect,
|
|
4
|
+
useEventListener,
|
|
5
|
+
useIsMounted,
|
|
6
|
+
useMountEffect,
|
|
7
|
+
} from '@react-hookz/web';
|
|
8
|
+
import {
|
|
9
|
+
MutableRefObject,
|
|
10
|
+
RefObject,
|
|
11
|
+
useCallback,
|
|
12
|
+
useEffect,
|
|
13
|
+
useMemo,
|
|
14
|
+
useRef,
|
|
15
|
+
} from 'react';
|
|
16
|
+
import { IEchartModalBase } from './core/eChartBase';
|
|
17
|
+
import { echarts } from './echarts';
|
|
5
18
|
|
|
6
|
-
export function useChart(
|
|
19
|
+
export function useChart(
|
|
20
|
+
ref: RefObject<HTMLElement> | MutableRefObject<HTMLElement>
|
|
21
|
+
) {
|
|
7
22
|
const chartRef = useRef<echarts.ECharts>();
|
|
8
23
|
const isMounted = useIsMounted();
|
|
9
24
|
useMountEffect(() => {
|
|
10
|
-
|
|
11
|
-
if(!ref.current || !isMounted) {
|
|
25
|
+
if (!ref.current || !isMounted) {
|
|
12
26
|
return;
|
|
13
27
|
}
|
|
14
28
|
|
|
@@ -28,16 +42,19 @@ export function useChart(ref: RefObject<HTMLElement> | MutableRefObject<HTMLElem
|
|
|
28
42
|
return chartRef.current;
|
|
29
43
|
}
|
|
30
44
|
|
|
31
|
-
|
|
32
45
|
/**
|
|
33
46
|
* @deprecated The method should not be used
|
|
34
47
|
*/
|
|
35
|
-
export function useWedaChart(
|
|
48
|
+
export function useWedaChart(
|
|
49
|
+
domRef,
|
|
50
|
+
ModalClass: IEchartModalBase,
|
|
51
|
+
options: echarts.EChartsCoreOption
|
|
52
|
+
) {
|
|
36
53
|
const chart = useChart(domRef);
|
|
37
|
-
const getOptions = async() => {
|
|
54
|
+
const getOptions = async () => {
|
|
38
55
|
const chartModal = new ModalClass();
|
|
39
56
|
let finalOptions: any = await chartModal.setOptions(options);
|
|
40
|
-
if(!finalOptions) {
|
|
57
|
+
if (!finalOptions) {
|
|
41
58
|
finalOptions = chartModal.getOptions() as any;
|
|
42
59
|
}
|
|
43
60
|
return finalOptions;
|
|
@@ -50,18 +67,19 @@ export function useWedaChart(domRef, ModalClass: IEchartModalBase, options: echa
|
|
|
50
67
|
useDeepCompareEffect(() => {
|
|
51
68
|
actions.execute();
|
|
52
69
|
}, [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
70
|
+
// options 变化,包含所有配置项,包括纯前端的配置项变化都会触发setOptions里发请求,但改不动了
|
|
71
|
+
options,
|
|
72
|
+
actions,
|
|
73
|
+
]);
|
|
56
74
|
useEffect(() => {
|
|
57
|
-
if(state.status === 'success' && chart) {
|
|
75
|
+
if (state.status === 'success' && chart) {
|
|
58
76
|
console.log(ModalClass.name, options, state.result, window.location.href);
|
|
59
77
|
chart.setOption(
|
|
60
78
|
state.result,
|
|
61
79
|
true // noMerge 全刷
|
|
62
80
|
);
|
|
63
81
|
} else {
|
|
64
|
-
if(state.status === 'error') {
|
|
82
|
+
if (state.status === 'error') {
|
|
65
83
|
console.error(state.error);
|
|
66
84
|
}
|
|
67
85
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { CommonPropsType } from '../../types';
|
|
2
|
+
import type { CommonPropsType } from '../../types';
|
|
3
3
|
import classNames from '../../utils/classnames';
|
|
4
4
|
|
|
5
5
|
export default function Container({
|
|
@@ -8,7 +8,7 @@ export default function Container({
|
|
|
8
8
|
events = {},
|
|
9
9
|
className,
|
|
10
10
|
style,
|
|
11
|
-
id
|
|
11
|
+
id,
|
|
12
12
|
}: PropsType) {
|
|
13
13
|
return (
|
|
14
14
|
<div
|
|
@@ -31,5 +31,4 @@ export default function Container({
|
|
|
31
31
|
|
|
32
32
|
export interface PropsType extends CommonPropsType {
|
|
33
33
|
title?: string;
|
|
34
|
-
|
|
35
|
-
}
|
|
34
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ConfigProvider, Drawer, DrawerProps } from 'tea-component';
|
|
3
|
-
import { CommonPropsType } from '../../types';
|
|
3
|
+
import type { CommonPropsType } from '../../types';
|
|
4
4
|
|
|
5
5
|
const TeaDrawer = ({
|
|
6
6
|
size,
|
|
@@ -38,19 +38,30 @@ const TeaDrawer = ({
|
|
|
38
38
|
disableCloseIcon={disableCloseIcon}
|
|
39
39
|
outerClickClosable={outerClickClosable}
|
|
40
40
|
{...eventsList}
|
|
41
|
-
|
|
41
|
+
>
|
|
42
42
|
{childrenSlot}
|
|
43
43
|
</Drawer>
|
|
44
44
|
</ConfigProvider>
|
|
45
45
|
);
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
export interface PropsType
|
|
48
|
+
export interface PropsType
|
|
49
|
+
extends CommonPropsType,
|
|
50
|
+
Pick<
|
|
51
|
+
DrawerProps,
|
|
52
|
+
| 'size'
|
|
53
|
+
| 'title'
|
|
54
|
+
| 'showMask'
|
|
55
|
+
| 'placement'
|
|
56
|
+
| 'disableCloseIcon'
|
|
57
|
+
| 'outerClickClosable'
|
|
58
|
+
| 'subtitle'
|
|
59
|
+
> {
|
|
49
60
|
visible: boolean;
|
|
50
61
|
title?: string;
|
|
51
62
|
extraSlot?: React.ReactNode;
|
|
52
63
|
footerSlot?: React.ReactNode;
|
|
53
|
-
childrenSlot?: React.ReactNode;
|
|
64
|
+
childrenSlot?: React.ReactNode;
|
|
54
65
|
}
|
|
55
66
|
|
|
56
67
|
export default TeaDrawer;
|
|
@@ -7,7 +7,7 @@ import isObjectEqual from '../../../utils/isObjectEqual';
|
|
|
7
7
|
import fromEntries from 'object.fromentries';
|
|
8
8
|
import { usePlatform } from '../../../utils/platform';
|
|
9
9
|
import { renderDecorator } from '../renderDecorator';
|
|
10
|
-
import { CommonFormPropsType } from '../types';
|
|
10
|
+
import type { CommonFormPropsType } from '../types';
|
|
11
11
|
import { callWedaApi } from '../../../utils/tcb';
|
|
12
12
|
import destr from 'destr';
|
|
13
13
|
|
|
@@ -27,7 +27,7 @@ export default function Checkbox({
|
|
|
27
27
|
layout = 'horizontal',
|
|
28
28
|
disabled = false,
|
|
29
29
|
requiredFlag = false,
|
|
30
|
-
decorator
|
|
30
|
+
decorator,
|
|
31
31
|
}: PropsType) {
|
|
32
32
|
const cls = classNames({
|
|
33
33
|
'weda-ui': true,
|
|
@@ -46,7 +46,8 @@ export default function Checkbox({
|
|
|
46
46
|
|
|
47
47
|
const [option, setOption] = useState(range);
|
|
48
48
|
const [checkedItems, setCheckedItems] = React.useState(
|
|
49
|
-
platform === 'h5'
|
|
49
|
+
platform === 'h5'
|
|
50
|
+
? fromEntries(option.map(({ value, checked }) => [value, !!checked]))
|
|
50
51
|
: option.filter(({ checked }) => checked).map(({ value }) => value)
|
|
51
52
|
);
|
|
52
53
|
// 两次range不同时, 需要刷新checkedItems
|
|
@@ -69,23 +70,25 @@ export default function Checkbox({
|
|
|
69
70
|
|
|
70
71
|
useEffect(() => {
|
|
71
72
|
if (format !== 'x-enum') {
|
|
72
|
-
setOption(range)
|
|
73
|
+
setOption(range);
|
|
73
74
|
}
|
|
74
75
|
}, [range]);
|
|
75
76
|
|
|
76
|
-
const fetchData = async (param:
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const fetchData = async (param: {
|
|
78
|
+
OptNameList?: object;
|
|
79
|
+
PageIndex?: number;
|
|
80
|
+
PageSize?: number;
|
|
81
|
+
}) => {
|
|
79
82
|
let data = await callWedaApi({
|
|
80
83
|
action: 'DescribeGeneralOptionsDetailList',
|
|
81
84
|
data: param,
|
|
82
85
|
});
|
|
83
86
|
const config = destr(data?.Items?.[0]?.Config) ?? [];
|
|
84
|
-
const enumOption = config.map(item => {
|
|
87
|
+
const enumOption = config.map((item) => {
|
|
85
88
|
return {
|
|
86
89
|
label: item.value,
|
|
87
90
|
value: item.key,
|
|
88
|
-
checked: false
|
|
91
|
+
checked: false,
|
|
89
92
|
};
|
|
90
93
|
});
|
|
91
94
|
setOption(enumOption);
|
|
@@ -153,9 +156,8 @@ export default function Checkbox({
|
|
|
153
156
|
disabled={disabled}
|
|
154
157
|
value={Object.entries(checkedItems)
|
|
155
158
|
.filter(([, checked]) => checked)
|
|
156
|
-
.map(([value]) => value)
|
|
157
|
-
|
|
158
|
-
onChange={value => {
|
|
159
|
+
.map(([value]) => value)}
|
|
160
|
+
onChange={(value) => {
|
|
159
161
|
const newMap = option
|
|
160
162
|
.map((opt) => opt.value)
|
|
161
163
|
.reduce((acc, cur) => {
|
|
@@ -168,13 +170,11 @@ export default function Checkbox({
|
|
|
168
170
|
return acc;
|
|
169
171
|
}, {});
|
|
170
172
|
setCheckedItems(newMap);
|
|
171
|
-
events.change(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
},
|
|
177
|
-
);
|
|
173
|
+
events.change({
|
|
174
|
+
value: Object.entries(newMap)
|
|
175
|
+
.filter(([, checked]) => checked)
|
|
176
|
+
.map(([value]) => value),
|
|
177
|
+
});
|
|
178
178
|
}}
|
|
179
179
|
>
|
|
180
180
|
{option.map(({ value, label }, index) => {
|
|
@@ -189,21 +189,22 @@ export default function Checkbox({
|
|
|
189
189
|
</ConfigProvider>
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
return renderDecorator(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
192
|
+
return renderDecorator(
|
|
193
|
+
checkboxElement,
|
|
194
|
+
decorator
|
|
195
|
+
)({
|
|
196
|
+
id,
|
|
197
|
+
className: cls,
|
|
198
|
+
style,
|
|
199
|
+
label: labelVisible ? label : null,
|
|
200
|
+
layout,
|
|
201
|
+
multiCell: true,
|
|
202
|
+
requiredFlag,
|
|
203
|
+
});
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
export interface PropsType extends CommonFormPropsType {
|
|
206
|
-
range?: { label: string
|
|
207
|
+
range?: { label: string; value: any; [key: string]: any }[];
|
|
207
208
|
format?: string;
|
|
208
209
|
enumName?: string;
|
|
209
210
|
}
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
color: inherit;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
padding-left: 32px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.weda-ui.weda-form-pc, .weda-ui.gsd-h5-react-form-pc {
|
|
5
|
+
.weda-ui.weda-form-pc,
|
|
6
|
+
.weda-ui.gsd-h5-react-form-pc {
|
|
11
7
|
padding-left: 24px;
|
|
8
|
+
padding-right: 24px;
|
|
12
9
|
}
|
|
@@ -16,6 +16,7 @@ export default function Form({
|
|
|
16
16
|
// buttonSlot,
|
|
17
17
|
style,
|
|
18
18
|
id,
|
|
19
|
+
layout,
|
|
19
20
|
}) {
|
|
20
21
|
const platform = usePlatform();
|
|
21
22
|
const cls = classNames({
|
|
@@ -30,7 +31,7 @@ export default function Form({
|
|
|
30
31
|
return (
|
|
31
32
|
<ConfigProvider classPrefix="wedatea2td">
|
|
32
33
|
{/** @ts-expect-error tea form id */}
|
|
33
|
-
<TeaForm className={cls} style={style} id={id}>
|
|
34
|
+
<TeaForm layout={layout} className={cls} style={style} id={id}>
|
|
34
35
|
{contentSlot}
|
|
35
36
|
</TeaForm>
|
|
36
37
|
</ConfigProvider>
|
|
@@ -16,11 +16,16 @@
|
|
|
16
16
|
}
|
|
17
17
|
.weda-formcells.weui-flex .weda-formcells__label {
|
|
18
18
|
width: 130px;
|
|
19
|
+
padding-bottom: 16px;
|
|
19
20
|
}
|
|
20
21
|
.weui-cells__group_form .weui-cell {
|
|
21
22
|
padding: 16px 16px;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
.weda-formcells .weda-formcells__label {
|
|
26
|
+
padding-bottom: 8px;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
.weda-formcells__content.weui-flex__item .weui-cell_form {
|
|
25
30
|
padding: 0;
|
|
26
31
|
}
|
|
@@ -29,7 +34,6 @@
|
|
|
29
34
|
padding-right: 16px;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
|
|
33
37
|
/* formcell 在 form container 外部兼容 and 独立 layout 适配 */
|
|
34
38
|
|
|
35
39
|
.weda-formcells__pc.vertical .wedatea2td-form__controls,
|
|
@@ -74,7 +78,6 @@
|
|
|
74
78
|
.weda-formcells__pc .wedatea2td-form__label label,
|
|
75
79
|
.weda-formcells__pc .wedatea2td-form__label legend {
|
|
76
80
|
display: inline-block;
|
|
77
|
-
white-space: nowrap;
|
|
78
81
|
font-size: 1rem;
|
|
79
82
|
transform: translateZ(0);
|
|
80
83
|
}
|
|
@@ -92,5 +95,4 @@
|
|
|
92
95
|
}
|
|
93
96
|
/*formcell end*/
|
|
94
97
|
|
|
95
|
-
|
|
96
98
|
/* formcell 在 form container 外部兼容 */
|
|
@@ -33,12 +33,8 @@ export default function FormCell({
|
|
|
33
33
|
[layout]: layout,
|
|
34
34
|
[className]: [className],
|
|
35
35
|
})}
|
|
36
|
-
label={
|
|
37
|
-
|
|
38
|
-
{label}
|
|
39
|
-
{requiredFlag && <span className="weda-formcells__flag">*</span>}
|
|
40
|
-
</>
|
|
41
|
-
}
|
|
36
|
+
label={label}
|
|
37
|
+
required={requiredFlag}
|
|
42
38
|
>
|
|
43
39
|
{children}
|
|
44
40
|
</TeaForm.Item>
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
把weui-cell 的padding还回到input
|
|
9
9
|
*/
|
|
10
10
|
.weda-ui input.weui-input {
|
|
11
|
-
|
|
11
|
+
padding: 28px 0;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.weda-ui.weda-input .weui-flex__item .weui-cell_form {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
padding: 0;
|
|
16
|
+
padding-right: 16px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.weda-ui.weda-input .weui-cell_form {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
START
|
|
30
30
|
*/
|
|
31
31
|
.weda-ui .wedatea2td-input {
|
|
32
|
-
|
|
32
|
+
background: inherit;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* END
|
|
@@ -5,7 +5,7 @@ import { Input as TeaInput, ConfigProvider } from 'tea-component';
|
|
|
5
5
|
import { renderDecorator } from '../renderDecorator';
|
|
6
6
|
import { useSyncValue } from '../../../utils/useSyncValue';
|
|
7
7
|
import './index.css';
|
|
8
|
-
import { CommonFormPropsType } from '../types';
|
|
8
|
+
import type { CommonFormPropsType } from '../types';
|
|
9
9
|
|
|
10
10
|
export default function Input({
|
|
11
11
|
id,
|
|
@@ -80,69 +80,77 @@ export default function Input({
|
|
|
80
80
|
const onBlur = function (e) {
|
|
81
81
|
events.blur({ value: e.target.value }, { originEvent: e });
|
|
82
82
|
};
|
|
83
|
-
const fieldEl =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
className="weui-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
83
|
+
const fieldEl =
|
|
84
|
+
platform === 'h5' ? (
|
|
85
|
+
<div className={subCls}>
|
|
86
|
+
<div className="weui-cell__bd weui-flex">
|
|
87
|
+
<input
|
|
88
|
+
className="weui-input"
|
|
89
|
+
type={inputType}
|
|
90
|
+
placeholder={placeholder}
|
|
91
|
+
value={value}
|
|
92
|
+
disabled={disabled}
|
|
93
|
+
name={name}
|
|
94
|
+
autoFocus={autoFocus}
|
|
95
|
+
onChange={onChange}
|
|
96
|
+
onFocus={onFocus}
|
|
97
|
+
onBlur={onBlur}
|
|
98
|
+
onKeyDown={onKeyDown}
|
|
99
|
+
role="input"
|
|
100
|
+
/>
|
|
101
|
+
{clearable && (
|
|
102
|
+
<button
|
|
103
|
+
className="weui-btn_reset weui-btn_icon weui-btn_input-clear"
|
|
104
|
+
onMouseDown={onClear}
|
|
105
|
+
>
|
|
106
|
+
<i className="weui-icon-clear"></i>
|
|
107
|
+
</button>
|
|
108
|
+
)}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
) : (
|
|
112
|
+
<ConfigProvider classPrefix="wedatea2td">
|
|
113
|
+
<TeaInput
|
|
114
|
+
size={size}
|
|
115
|
+
type={inputType}
|
|
116
|
+
placeholder={placeholder}
|
|
117
|
+
value={value}
|
|
118
|
+
disabled={disabled}
|
|
119
|
+
name={name}
|
|
120
|
+
autoFocus={autoFocus}
|
|
121
|
+
onChange={onChange}
|
|
122
|
+
onFocus={onFocus}
|
|
123
|
+
onBlur={onBlur}
|
|
124
|
+
onKeyDown={onKeyDown}
|
|
125
|
+
/>
|
|
126
|
+
</ConfigProvider>
|
|
127
|
+
);
|
|
128
|
+
return renderDecorator(
|
|
129
|
+
fieldEl,
|
|
130
|
+
decorator
|
|
131
|
+
)({
|
|
132
|
+
id,
|
|
133
|
+
className: cls,
|
|
134
|
+
style,
|
|
135
|
+
label: labelVisible ? label : null,
|
|
136
|
+
layout,
|
|
137
|
+
multiCell: false,
|
|
138
|
+
requiredFlag,
|
|
139
|
+
size,
|
|
140
|
+
});
|
|
132
141
|
}
|
|
133
142
|
|
|
134
143
|
export interface PropsType extends CommonFormPropsType {
|
|
135
144
|
defaultValue?: string;
|
|
136
145
|
password?: boolean;
|
|
137
146
|
placeholder?: string;
|
|
138
|
-
type?:
|
|
147
|
+
type?: 'text' | 'number' | 'idcard' | 'digit';
|
|
139
148
|
maxLength?: number;
|
|
140
149
|
focus?: boolean;
|
|
141
|
-
size?:
|
|
150
|
+
size?: 's' | 'm' | 'l' | 'full';
|
|
142
151
|
clearable?: boolean;
|
|
143
152
|
}
|
|
144
153
|
|
|
145
|
-
|
|
146
154
|
function getInputType(type, password) {
|
|
147
155
|
if (password) {
|
|
148
156
|
return 'password';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Modal, Button } from 'tea-component';
|
|
3
|
-
import * as PropTypes from 'prop-types';
|
|
4
3
|
import { usePlatform } from '../../../../utils/platform';
|
|
5
4
|
import classNames from '../../../../utils/classnames';
|
|
6
5
|
import MapChoose from './mapChoose';
|
|
@@ -32,9 +31,10 @@ export default function SelectModal({
|
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
const getPosition = (value) => {
|
|
35
|
-
const { title, location } = value;
|
|
34
|
+
const { title, location, address } = value;
|
|
36
35
|
let loc = {
|
|
37
36
|
poiname: title,
|
|
37
|
+
detailedAddress: address,
|
|
38
38
|
latlng: { lat: location.lat, lng: location.lng },
|
|
39
39
|
};
|
|
40
40
|
positionRef.current = loc;
|
|
@@ -71,12 +71,3 @@ export default function SelectModal({
|
|
|
71
71
|
</Modal>
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
SelectModal.propTypes = {
|
|
76
|
-
location: PropTypes.object,
|
|
77
|
-
isSelectMapVisible: PropTypes.bool,
|
|
78
|
-
APIKEY: PropTypes.string,
|
|
79
|
-
setLocation: PropTypes.func,
|
|
80
|
-
setIsSelectMapVisible: PropTypes.func,
|
|
81
|
-
chooseLocation: PropTypes.func,
|
|
82
|
-
};
|
|
@@ -9,6 +9,7 @@ export default function useLocationInfo({
|
|
|
9
9
|
}) {
|
|
10
10
|
const [location, setLocation] = useState({
|
|
11
11
|
poiname: '',
|
|
12
|
+
detailedAddress: '',
|
|
12
13
|
latlng: { lat: 39.98410411, lng: 116.307503 },
|
|
13
14
|
});
|
|
14
15
|
const [apiKeyStatus, setApiKeyStatus] = useState({
|
|
@@ -40,6 +41,7 @@ export default function useLocationInfo({
|
|
|
40
41
|
({ city, lat, lng, addr }) => {
|
|
41
42
|
let locations = {
|
|
42
43
|
poiname: city + addr,
|
|
44
|
+
detailedAddress: city + addr,
|
|
43
45
|
latlng: { lat, lng },
|
|
44
46
|
locationType,
|
|
45
47
|
};
|
|
@@ -48,6 +50,7 @@ export default function useLocationInfo({
|
|
|
48
50
|
eventsChange(
|
|
49
51
|
{
|
|
50
52
|
poiname: city + addr,
|
|
53
|
+
detailedAddress: city + addr,
|
|
51
54
|
latitude: lat,
|
|
52
55
|
longitude: lng,
|
|
53
56
|
},
|
|
@@ -80,6 +83,7 @@ export default function useLocationInfo({
|
|
|
80
83
|
});
|
|
81
84
|
setLocation({
|
|
82
85
|
poiname: '',
|
|
86
|
+
detailedAddress: '',
|
|
83
87
|
latlng: { lat: 39.98410411, lng: 116.307503 },
|
|
84
88
|
// @ts-ignore
|
|
85
89
|
locationType,
|