@cloudbase/weda-ui 2.0.11 → 2.0.27
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 +39 -35
- 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 +14 -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 +44 -45
- 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 +68 -68
- 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 +89 -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/mp/components/calendar/index.js +4 -1
- package/src/mp/components/calendar/index.json +3 -2
- package/src/mp/components/calendar/index.wxml +6 -28
- package/src/mp/components/calendar/index.wxss +17 -16
- 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/chart/statisticsCard/index.wxss +7 -10
- package/src/mp/components/dataView/index.wxml +1 -13
- package/src/mp/components/form/checkbox/index.js +5 -1
- 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.js +1 -1
- 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.js +5 -1
- package/src/mp/components/form/radio/index.wxml +2 -14
- package/src/mp/components/form/select/index.js +2 -2
- 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.js +6 -0
- 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/graphicCard/index.wxss +6 -6
- package/src/mp/components/image/index.wxml +3 -21
- package/src/mp/components/listView/index.wxml +8 -33
- package/src/mp/components/listView/index.wxss +2 -2
- 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/navLayout/index.wxss +10 -10
- package/src/mp/components/navigationBar/index.json +1 -2
- package/src/mp/components/navigationBar/index.wxml +29 -146
- package/src/mp/components/navigationBar/index.wxss +10 -10
- package/src/mp/components/richText/index.wxml +1 -1
- package/src/mp/components/richText/index.wxss +7 -5
- 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/tabs/index.wxss +1 -2
- 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 +16 -6
- package/src/web/actions/showModal/index.tsx +5 -4
- package/src/web/components/calendar/index.css +99 -65
- 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/chart/statisticsCard/index.css +9 -8
- 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 +6 -17
- package/src/web/components/form/formcell/index.tsx +2 -6
- package/src/web/components/form/input/index.css +8 -4
- package/src/web/components/form/input/index.tsx +61 -53
- package/src/web/components/form/location/common/mapChoose.css +13 -11
- 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 +19 -20
- 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 +2 -2
- package/src/web/components/form/select/index.css +9 -0
- package/src/web/components/form/select/index.tsx +76 -49
- 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 +38 -25
- package/src/web/components/form/types.d.ts +10 -10
- package/src/web/components/form/uploader/index.css +10 -0
- package/src/web/components/form/uploader/uploader.h5.tsx +3 -6
- package/src/web/components/form/uploader/uploader.pc.tsx +3 -6
- package/src/web/components/form/uploaderFile/index.css +24 -23
- package/src/web/components/form/uploaderFile/index.jsx +0 -5
- package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +24 -15
- package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +21 -13
- package/src/web/components/graphicCard/index.css +6 -6
- 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/listView/index.css +8 -8
- package/src/web/components/lottery/index.css +43 -37
- package/src/web/components/lottery/index.tsx +3 -3
- package/src/web/components/modal/index.tsx +34 -34
- package/src/web/components/navLayout/index.css +25 -25
- package/src/web/components/navigationBar/index.css +26 -26
- 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.css +7 -3
- 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 +2 -3
- 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 +208 -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/platform.js +13 -0
- package/src/web/utils/useSetState.ts +6 -2
- package/src/web/weda-ui.css +23 -8
- package/src/docs/common/format.tsx +0 -112
- package/src/docs/common/tableView.css +0 -164
- package/src/docs/common/tableView.tsx +0 -273
- package/src/docs/compsdocs/chart/Bar.mdx +0 -159
- package/src/docs/compsdocs/chart/Line.mdx +0 -100
- package/src/docs/compsdocs/chart/Pie.mdx +0 -83
- package/src/docs/compsdocs/chart/_category_.json +0 -1
- package/src/docs/compsdocs/chart/statisticsCard.mdx +0 -51
- package/src/docs/compsdocs/database/DataView.mdx +0 -33
- package/src/docs/compsdocs/database/ListView.mdx +0 -33
- package/src/docs/compsdocs/database/_category_.json +0 -1
- package/src/docs/compsdocs/form/Form.mdx +0 -35
- package/src/docs/compsdocs/form/FormCheckbox.mdx +0 -35
- package/src/docs/compsdocs/form/FormDate.mdx +0 -30
- package/src/docs/compsdocs/form/FormEmail.mdx +0 -30
- package/src/docs/compsdocs/form/FormImageUploader.mdx +0 -31
- package/src/docs/compsdocs/form/FormInput.mdx +0 -30
- package/src/docs/compsdocs/form/FormLocation.mdx +0 -64
- package/src/docs/compsdocs/form/FormPhone.mdx +0 -30
- package/src/docs/compsdocs/form/FormRadio.mdx +0 -35
- package/src/docs/compsdocs/form/FormRegion.mdx +0 -30
- package/src/docs/compsdocs/form/FormSelect.mdx +0 -36
- package/src/docs/compsdocs/form/FormSwitch.mdx +0 -30
- package/src/docs/compsdocs/form/FormTextarea.mdx +0 -30
- package/src/docs/compsdocs/form/FormTime.mdx +0 -30
- package/src/docs/compsdocs/form/FormUploadFile.mdx +0 -30
- package/src/docs/compsdocs/form/FormUrl.mdx +0 -30
- package/src/docs/compsdocs/form/_category_.json +0 -1
- package/src/docs/compsdocs/grid/Card.mdx +0 -32
- package/src/docs/compsdocs/grid/Container.mdx +0 -42
- package/src/docs/compsdocs/grid/Footer.mdx +0 -31
- package/src/docs/compsdocs/grid/GridLayout.mdx +0 -32
- package/src/docs/compsdocs/grid/Header.mdx +0 -31
- package/src/docs/compsdocs/grid/Layout.mdx +0 -25
- package/src/docs/compsdocs/grid/List.mdx +0 -31
- package/src/docs/compsdocs/grid/ScrollView.mdx +0 -37
- package/src/docs/compsdocs/grid/Swiper.mdx +0 -58
- package/src/docs/compsdocs/grid/_category_.json +0 -1
- package/src/docs/compsdocs/media/Icon.mdx +0 -31
- package/src/docs/compsdocs/media/Image.mdx +0 -55
- package/src/docs/compsdocs/media/_category_.json +0 -1
- package/src/docs/compsdocs/model/ModelCreate.mdx +0 -20
- package/src/docs/compsdocs/model/ModelDetail.mdx +0 -20
- package/src/docs/compsdocs/model/ModelTable.mdx +0 -24
- package/src/docs/compsdocs/model/ModelUpdate.mdx +0 -21
- package/src/docs/compsdocs/model/PageLayout.mdx +0 -21
- package/src/docs/compsdocs/model/_category_.json +0 -1
- package/src/docs/compsdocs/navmenu/Classification.mdx +0 -38
- package/src/docs/compsdocs/navmenu/NavBar.mdx +0 -43
- package/src/docs/compsdocs/navmenu/NavLayout.mdx +0 -30
- package/src/docs/compsdocs/navmenu/TabBar.mdx +0 -43
- package/src/docs/compsdocs/navmenu/TabBarItem.mdx +0 -29
- package/src/docs/compsdocs/navmenu/_category_.json +0 -1
- package/src/docs/compsdocs/senior/Lottery.mdx +0 -48
- package/src/docs/compsdocs/senior/Modal.mdx +0 -58
- package/src/docs/compsdocs/senior/SlotMachine.mdx +0 -52
- package/src/docs/compsdocs/senior/_category_.json +0 -1
- package/src/docs/compsdocs/show/Calendar.mdx +0 -29
- package/src/docs/compsdocs/show/Divider.mdx +0 -31
- package/src/docs/compsdocs/show/GraphicCard.mdx +0 -30
- package/src/docs/compsdocs/show/Item.mdx +0 -32
- package/src/docs/compsdocs/show/ItemList.mdx +0 -47
- package/src/docs/compsdocs/show/Media.mdx +0 -25
- package/src/docs/compsdocs/show/StatusTip.mdx +0 -25
- package/src/docs/compsdocs/show/Swiper.mdx +0 -33
- package/src/docs/compsdocs/show/Tabs.mdx +0 -38
- package/src/docs/compsdocs/show/_category_.json +0 -1
- package/src/docs/compsdocs/show/button.mdx +0 -25
- package/src/docs/compsdocs/text/Link.mdx +0 -43
- package/src/docs/compsdocs/text/RichTextView.mdx +0 -36
- package/src/docs/compsdocs/text/Text.mdx +0 -31
- package/src/docs/compsdocs/text/Title.mdx +0 -32
- package/src/docs/compsdocs/text/_category_.json +0 -1
- package/src/docs/compsdocs/wxOpen/Phone.mdx +0 -60
- package/src/docs/compsdocs/wxOpen/Share.mdx +0 -46
- package/src/docs/compsdocs/wxOpen/UserInfo.mdx +0 -60
- package/src/docs/compsdocs/wxOpen/_category_.json +0 -4
|
@@ -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,4 +1,6 @@
|
|
|
1
1
|
/* mapChoose组件 */
|
|
2
|
+
|
|
3
|
+
/* em = 16px */
|
|
2
4
|
.weda-ui_map-choose {
|
|
3
5
|
width: 100%;
|
|
4
6
|
height: 100%;
|
|
@@ -35,8 +37,8 @@
|
|
|
35
37
|
padding-left: 10px;
|
|
36
38
|
padding-right: 10px;
|
|
37
39
|
color: #b4b4b4;
|
|
38
|
-
font-size:
|
|
39
|
-
line-height:
|
|
40
|
+
font-size: 1em;
|
|
41
|
+
line-height: 2em;
|
|
40
42
|
border-radius: 5px;
|
|
41
43
|
overflow: hidden;
|
|
42
44
|
white-space: nowrap;
|
|
@@ -57,9 +59,9 @@
|
|
|
57
59
|
right: 0;
|
|
58
60
|
width: 55px;
|
|
59
61
|
height: 46px;
|
|
60
|
-
line-height:
|
|
62
|
+
line-height: 2.875em;
|
|
61
63
|
text-align: center;
|
|
62
|
-
font-size:
|
|
64
|
+
font-size: 1em;
|
|
63
65
|
color: #0079ff;
|
|
64
66
|
background-color: #fff;
|
|
65
67
|
cursor: pointer;
|
|
@@ -76,8 +78,8 @@
|
|
|
76
78
|
padding-top: 6px;
|
|
77
79
|
padding-bottom: 6px;
|
|
78
80
|
border: 0;
|
|
79
|
-
font-size:
|
|
80
|
-
line-height:
|
|
81
|
+
font-size: 0.875em;
|
|
82
|
+
line-height: 1.125em;
|
|
81
83
|
background: 0 0;
|
|
82
84
|
position: relative;
|
|
83
85
|
z-index: 1;
|
|
@@ -143,11 +145,11 @@
|
|
|
143
145
|
}
|
|
144
146
|
.map-choose-warp_sugges_choosed span {
|
|
145
147
|
position: absolute;
|
|
146
|
-
right:
|
|
148
|
+
right: 1.25em;
|
|
147
149
|
top: 50%;
|
|
148
150
|
transform: translate(0, -50%);
|
|
149
|
-
width:
|
|
150
|
-
height:
|
|
151
|
+
width: 1em;
|
|
152
|
+
height: 1em;
|
|
151
153
|
display: block !important;
|
|
152
154
|
background-image: url('https://qcloudimg.tencent-cloud.cn/raw/354c15c0cb845120ac3e9c474e6737b3.png');
|
|
153
155
|
background-size: 100% 100%;
|
|
@@ -162,8 +164,8 @@
|
|
|
162
164
|
}
|
|
163
165
|
.map-choose-warp_sugges_title,
|
|
164
166
|
.map-choose-explore_title {
|
|
165
|
-
font-size:
|
|
166
|
-
line-height:
|
|
167
|
+
font-size: 0.875em;
|
|
168
|
+
line-height: 1.6875em;
|
|
167
169
|
color: #333;
|
|
168
170
|
font-weight: 400;
|
|
169
171
|
display: block;
|
|
@@ -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,
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
align-items: center;
|
|
9
9
|
padding: 16px;
|
|
10
10
|
width: 130px;
|
|
11
|
-
|
|
12
11
|
}
|
|
13
12
|
.form-location-label > span {
|
|
14
13
|
margin-right: 0.28571rem;
|
|
@@ -44,17 +43,17 @@
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.form-location-addr-title {
|
|
47
|
-
font-size:
|
|
46
|
+
font-size: 1em;
|
|
48
47
|
}
|
|
49
48
|
.form-location-addr-lat {
|
|
50
|
-
font-size:
|
|
49
|
+
font-size: 0.75em;
|
|
51
50
|
color: rgba(0, 0, 0, 0.4);
|
|
52
|
-
line-height:
|
|
51
|
+
line-height: 1.25em;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
.form-location-addr > img {
|
|
56
|
-
width:
|
|
57
|
-
height:
|
|
55
|
+
width: 1.25em;
|
|
56
|
+
height: 1.25em;
|
|
58
57
|
}
|
|
59
58
|
.form-location-addr > div {
|
|
60
59
|
margin-left: 12px;
|
|
@@ -116,8 +115,8 @@
|
|
|
116
115
|
padding-left: 10px;
|
|
117
116
|
padding-right: 10px;
|
|
118
117
|
color: #b4b4b4;
|
|
119
|
-
font-size:
|
|
120
|
-
line-height:
|
|
118
|
+
font-size: 1em;
|
|
119
|
+
line-height: 2.21428em;
|
|
121
120
|
border-radius: 5px;
|
|
122
121
|
overflow: hidden;
|
|
123
122
|
white-space: nowrap;
|
|
@@ -136,19 +135,19 @@
|
|
|
136
135
|
position: absolute;
|
|
137
136
|
top: 0;
|
|
138
137
|
right: 0;
|
|
139
|
-
width:
|
|
140
|
-
height:
|
|
141
|
-
line-height:
|
|
138
|
+
width: 3.4375em;
|
|
139
|
+
height: 2.875em;
|
|
140
|
+
line-height: 2.875em;
|
|
142
141
|
text-align: center;
|
|
143
|
-
font-size:
|
|
142
|
+
font-size: 1em;
|
|
144
143
|
color: #0079ff;
|
|
145
144
|
background-color: #fff;
|
|
146
145
|
cursor: pointer;
|
|
147
146
|
display: none;
|
|
148
147
|
}
|
|
149
148
|
.map-choose-header_search img {
|
|
150
|
-
width:
|
|
151
|
-
height:
|
|
149
|
+
width: 1em;
|
|
150
|
+
height: 1em;
|
|
152
151
|
margin-right: 4px;
|
|
153
152
|
}
|
|
154
153
|
.map-choose-header_search input {
|
|
@@ -157,8 +156,8 @@
|
|
|
157
156
|
padding-top: 6px;
|
|
158
157
|
padding-bottom: 6px;
|
|
159
158
|
border: 0;
|
|
160
|
-
font-size:
|
|
161
|
-
line-height:
|
|
159
|
+
font-size: 0.875em;
|
|
160
|
+
line-height: 1.125em;
|
|
162
161
|
background: 0 0;
|
|
163
162
|
position: relative;
|
|
164
163
|
z-index: 1;
|
|
@@ -216,8 +215,8 @@
|
|
|
216
215
|
right: 20px;
|
|
217
216
|
top: 50%;
|
|
218
217
|
transform: translate(0, -50%);
|
|
219
|
-
width:
|
|
220
|
-
height:
|
|
218
|
+
width: 1em;
|
|
219
|
+
height: 1em;
|
|
221
220
|
display: block !important;
|
|
222
221
|
background-image: url('https://qcloudimg.tencent-cloud.cn/raw/354c15c0cb845120ac3e9c474e6737b3.png');
|
|
223
222
|
background-size: 100% 100%;
|
|
@@ -232,8 +231,8 @@
|
|
|
232
231
|
}
|
|
233
232
|
.map-choose-warp_sugges_title,
|
|
234
233
|
.map-choose-explore_title {
|
|
235
|
-
font-size:
|
|
236
|
-
line-height:
|
|
234
|
+
font-size: 0.875em;
|
|
235
|
+
line-height: 1.6875em;
|
|
237
236
|
color: #333;
|
|
238
237
|
font-weight: 400;
|
|
239
238
|
display: block;
|
|
@@ -53,6 +53,7 @@ export default function LocationH5(props) {
|
|
|
53
53
|
message: '地图定位中',
|
|
54
54
|
});
|
|
55
55
|
const [location, setLocation] = useState({
|
|
56
|
+
detailedAddress: '',
|
|
56
57
|
poiname: '',
|
|
57
58
|
latlng: { lat: 39.98410411, lng: 116.307503 },
|
|
58
59
|
});
|
|
@@ -63,10 +64,12 @@ export default function LocationH5(props) {
|
|
|
63
64
|
// 重置表单时
|
|
64
65
|
const {
|
|
65
66
|
poiname,
|
|
67
|
+
detailedAddress,
|
|
66
68
|
latlng: { lat, lng },
|
|
67
69
|
} = currentLocations.current;
|
|
68
70
|
let location = {
|
|
69
71
|
poiname,
|
|
72
|
+
detailedAddress,
|
|
70
73
|
latlng: { lat, lng },
|
|
71
74
|
};
|
|
72
75
|
if (locationType === 1) {
|
|
@@ -76,6 +79,7 @@ export default function LocationH5(props) {
|
|
|
76
79
|
let res = {
|
|
77
80
|
value: {
|
|
78
81
|
address: poiname,
|
|
82
|
+
detailedAddress,
|
|
79
83
|
geopoint: {
|
|
80
84
|
coordinates: [lng, lat],
|
|
81
85
|
type: 'Point',
|
|
@@ -94,6 +98,7 @@ export default function LocationH5(props) {
|
|
|
94
98
|
lng: 116.307503,
|
|
95
99
|
},
|
|
96
100
|
poiname: '',
|
|
101
|
+
detailedAddress: '',
|
|
97
102
|
locationType,
|
|
98
103
|
};
|
|
99
104
|
switch (locationType) {
|
|
@@ -133,6 +138,7 @@ export default function LocationH5(props) {
|
|
|
133
138
|
lng: longitude,
|
|
134
139
|
},
|
|
135
140
|
poiname: poiname,
|
|
141
|
+
detailedAddress: '',
|
|
136
142
|
};
|
|
137
143
|
setLocation(loc);
|
|
138
144
|
}, [customLocation, locationType]);
|
|
@@ -161,6 +167,7 @@ export default function LocationH5(props) {
|
|
|
161
167
|
const { city, lat, lng, addr } = ipLocation;
|
|
162
168
|
let loc = {
|
|
163
169
|
poiname: city + addr,
|
|
170
|
+
detailedAddress: city + addr,
|
|
164
171
|
latlng: { lat, lng },
|
|
165
172
|
};
|
|
166
173
|
if (locationType === 1) {
|
|
@@ -175,6 +182,7 @@ export default function LocationH5(props) {
|
|
|
175
182
|
events.change({
|
|
176
183
|
value: {
|
|
177
184
|
address: city + addr,
|
|
185
|
+
detailedAddress: city + addr,
|
|
178
186
|
geopoint: {
|
|
179
187
|
coordinates: [lng, lat],
|
|
180
188
|
type: 'Point',
|
|
@@ -210,6 +218,7 @@ export default function LocationH5(props) {
|
|
|
210
218
|
});
|
|
211
219
|
setLocation({
|
|
212
220
|
poiname: '',
|
|
221
|
+
detailedAddress: '',
|
|
213
222
|
latlng: { lat: 39.98410411, lng: 116.307503 },
|
|
214
223
|
});
|
|
215
224
|
weui.alert('定位失败');
|
|
@@ -278,10 +287,11 @@ export default function LocationH5(props) {
|
|
|
278
287
|
};
|
|
279
288
|
|
|
280
289
|
const onChangeLocation = (value) => {
|
|
281
|
-
const { poiname, latlng } = value;
|
|
290
|
+
const { poiname, latlng, detailedAddress } = value;
|
|
282
291
|
let res = {
|
|
283
292
|
value: {
|
|
284
293
|
address: poiname,
|
|
294
|
+
detailedAddress,
|
|
285
295
|
geopoint: {
|
|
286
296
|
coordinates: [latlng.lng, latlng.lat],
|
|
287
297
|
type: 'Point',
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button } from 'tea-component';
|
|
3
|
-
import * as PropTypes from 'prop-types';
|
|
4
3
|
import classNames from '../../../../../utils/classnames';
|
|
5
4
|
|
|
6
5
|
const Header = ({
|
|
@@ -94,16 +93,4 @@ const Header = ({
|
|
|
94
93
|
);
|
|
95
94
|
};
|
|
96
95
|
|
|
97
|
-
Header.propTypes = {
|
|
98
|
-
onClick: PropTypes.func,
|
|
99
|
-
isEdit: PropTypes.bool,
|
|
100
|
-
info: PropTypes.object,
|
|
101
|
-
disabled: PropTypes.bool,
|
|
102
|
-
showLngLat: PropTypes.bool,
|
|
103
|
-
currentLocStatus: PropTypes.bool,
|
|
104
|
-
dataSourceStatus: PropTypes.bool,
|
|
105
|
-
locationType: PropTypes.number,
|
|
106
|
-
apiKeyStatus: PropTypes.object,
|
|
107
|
-
};
|
|
108
|
-
|
|
109
96
|
export default Header;
|
|
@@ -54,9 +54,10 @@ export default function LocationPC(props) {
|
|
|
54
54
|
const [APIKEY, setAPIKEY] = useState('');
|
|
55
55
|
|
|
56
56
|
const eventsChange = (value, noaddr) => {
|
|
57
|
-
const { poiname, latitude, longitude } = value;
|
|
57
|
+
const { poiname, detailedAddress, latitude, longitude } = value;
|
|
58
58
|
let res = {
|
|
59
59
|
address: poiname,
|
|
60
|
+
detailedAddress,
|
|
60
61
|
geopoint: {
|
|
61
62
|
coordinates: [longitude, latitude],
|
|
62
63
|
type: 'Point',
|
|
@@ -90,10 +91,12 @@ export default function LocationPC(props) {
|
|
|
90
91
|
// 重置表单时
|
|
91
92
|
const {
|
|
92
93
|
poiname,
|
|
94
|
+
detailedAddress,
|
|
93
95
|
latlng: { lat, lng },
|
|
94
96
|
} = currentLocations.current;
|
|
95
97
|
let location = {
|
|
96
98
|
poiname,
|
|
99
|
+
detailedAddress,
|
|
97
100
|
latlng: { lat, lng },
|
|
98
101
|
};
|
|
99
102
|
if (locationType === 1) {
|
|
@@ -103,7 +106,8 @@ export default function LocationPC(props) {
|
|
|
103
106
|
eventsChange({
|
|
104
107
|
latitude: lat,
|
|
105
108
|
longitude: lng,
|
|
106
|
-
poiname
|
|
109
|
+
poiname,
|
|
110
|
+
detailedAddress,
|
|
107
111
|
});
|
|
108
112
|
}
|
|
109
113
|
setLocation(location);
|
|
@@ -118,11 +122,12 @@ export default function LocationPC(props) {
|
|
|
118
122
|
setIsSelectMapVisible(true);
|
|
119
123
|
};
|
|
120
124
|
const onChangeLocation = (value) => {
|
|
121
|
-
const { poiname, latlng } = value;
|
|
125
|
+
const { poiname, latlng, detailedAddress } = value;
|
|
122
126
|
events.change &&
|
|
123
127
|
events.change({
|
|
124
128
|
value: {
|
|
125
129
|
address: poiname,
|
|
130
|
+
detailedAddress,
|
|
126
131
|
geopoint: {
|
|
127
132
|
coordinates: [latlng.lng, latlng.lat],
|
|
128
133
|
type: 'Point',
|
|
@@ -172,6 +177,7 @@ export default function LocationPC(props) {
|
|
|
172
177
|
lng: 116.307503,
|
|
173
178
|
},
|
|
174
179
|
poiname: '',
|
|
180
|
+
detailedAddress: '',
|
|
175
181
|
locationType,
|
|
176
182
|
};
|
|
177
183
|
switch (locationType) {
|
|
@@ -183,6 +189,7 @@ export default function LocationPC(props) {
|
|
|
183
189
|
lng: location.latlng.lng,
|
|
184
190
|
},
|
|
185
191
|
poiname: location.poiname,
|
|
192
|
+
detailedAddress: location.detailedAddress,
|
|
186
193
|
};
|
|
187
194
|
break;
|
|
188
195
|
case 3:
|
|
@@ -207,6 +214,7 @@ export default function LocationPC(props) {
|
|
|
207
214
|
latitude: loc.latlng.lat,
|
|
208
215
|
longitude: loc.latlng.lng,
|
|
209
216
|
poiname: loc.poiname,
|
|
217
|
+
detailedAddress: loc.detailedAddress,
|
|
210
218
|
},
|
|
211
219
|
true
|
|
212
220
|
);
|
|
@@ -220,13 +228,14 @@ export default function LocationPC(props) {
|
|
|
220
228
|
weui.alert('位置输入格式错误 请检查');
|
|
221
229
|
return;
|
|
222
230
|
}
|
|
223
|
-
let { latitude, longitude, poiname } = customLocation;
|
|
231
|
+
let { latitude, longitude, poiname, detailedAddress } = customLocation;
|
|
224
232
|
let loc = {
|
|
225
233
|
latlng: {
|
|
226
234
|
lat: latitude,
|
|
227
235
|
lng: longitude,
|
|
228
236
|
},
|
|
229
|
-
poiname
|
|
237
|
+
poiname,
|
|
238
|
+
detailedAddress,
|
|
230
239
|
};
|
|
231
240
|
setLocation(loc);
|
|
232
241
|
}, [customLocation, locationType]);
|
|
@@ -9,7 +9,7 @@ import { callWedaApi } from '../../../utils/tcb';
|
|
|
9
9
|
|
|
10
10
|
import './index.css';
|
|
11
11
|
import { renderDecorator } from '../renderDecorator';
|
|
12
|
-
import { CommonFormPropsType } from '../types';
|
|
12
|
+
import type { CommonFormPropsType } from '../types';
|
|
13
13
|
import destr from 'destr';
|
|
14
14
|
|
|
15
15
|
export default function Radio({
|
|
@@ -28,7 +28,7 @@ export default function Radio({
|
|
|
28
28
|
layout = 'horizontal',
|
|
29
29
|
disabled = false,
|
|
30
30
|
requiredFlag = false,
|
|
31
|
-
decorator
|
|
31
|
+
decorator,
|
|
32
32
|
}: PropsType) {
|
|
33
33
|
const platform = usePlatform();
|
|
34
34
|
const isH5 = platform === 'h5';
|
|
@@ -65,23 +65,25 @@ export default function Radio({
|
|
|
65
65
|
|
|
66
66
|
useEffect(() => {
|
|
67
67
|
if (format !== 'x-enum') {
|
|
68
|
-
setOption(range)
|
|
68
|
+
setOption(range);
|
|
69
69
|
}
|
|
70
70
|
}, [range]);
|
|
71
71
|
|
|
72
|
-
const fetchData = async (param:
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
const fetchData = async (param: {
|
|
73
|
+
OptNameList?: object;
|
|
74
|
+
PageIndex?: number;
|
|
75
|
+
PageSize?: number;
|
|
76
|
+
}) => {
|
|
75
77
|
let data = await callWedaApi({
|
|
76
78
|
action: 'DescribeGeneralOptionsDetailList',
|
|
77
79
|
data: param,
|
|
78
80
|
});
|
|
79
81
|
const config = destr(data?.Items?.[0]?.Config) ?? [];
|
|
80
|
-
const enumOption = config.map(item => {
|
|
82
|
+
const enumOption = config.map((item) => {
|
|
81
83
|
return {
|
|
82
84
|
label: item.value,
|
|
83
85
|
value: item.key,
|
|
84
|
-
checked: false
|
|
86
|
+
checked: false,
|
|
85
87
|
};
|
|
86
88
|
});
|
|
87
89
|
setOption(enumOption);
|
|
@@ -106,7 +108,6 @@ export default function Radio({
|
|
|
106
108
|
const hashcode = React.useMemo(() => getLocalCounter(), []);
|
|
107
109
|
let radioElement;
|
|
108
110
|
if (isH5) {
|
|
109
|
-
|
|
110
111
|
radioElement = option.map(({ label, value }, index) => {
|
|
111
112
|
const _id = `radio-${hashcode}-${index}`;
|
|
112
113
|
const _name = `radio-${hashcode}-${name}`;
|
|
@@ -137,24 +138,29 @@ export default function Radio({
|
|
|
137
138
|
});
|
|
138
139
|
} else {
|
|
139
140
|
// pc
|
|
140
|
-
radioElement = (
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
141
|
+
radioElement = (
|
|
142
|
+
<ConfigProvider classPrefix="wedatea2td">
|
|
143
|
+
<TeaRadio.Group
|
|
144
|
+
disabled={disabled}
|
|
145
|
+
value={checkedItemValue}
|
|
146
|
+
onChange={(value, { event }) => getChangeHandler(value)(event)}
|
|
147
|
+
>
|
|
148
|
+
{option.map(({ value, label }, index) => {
|
|
149
|
+
const _id = `radio-${hashcode}-${index}`;
|
|
150
|
+
return (
|
|
151
|
+
<TeaRadio key={_id} name={value} id={_id}>
|
|
152
|
+
{label}
|
|
153
|
+
</TeaRadio>
|
|
154
|
+
);
|
|
155
|
+
})}
|
|
156
|
+
</TeaRadio.Group>
|
|
157
|
+
</ConfigProvider>
|
|
158
|
+
);
|
|
156
159
|
}
|
|
157
|
-
return renderDecorator(
|
|
160
|
+
return renderDecorator(
|
|
161
|
+
radioElement,
|
|
162
|
+
decorator
|
|
163
|
+
)({
|
|
158
164
|
id,
|
|
159
165
|
className: cls,
|
|
160
166
|
style,
|