@cloudbase/weda-ui 2.0.9 → 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 +13 -5
- 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/button/index.js +1 -1
- package/src/mp/components/button/index.wxml +19 -19
- package/src/mp/components/calendar/index.js +64 -37
- package/src/mp/components/calendar/index.json +1 -1
- package/src/mp/components/calendar/index.wxml +4 -6
- package/src/mp/components/carousel/index.json +1 -1
- package/src/mp/components/carousel/index.wxml +2 -2
- package/src/mp/components/chart/bar/index.js +1 -2
- package/src/mp/components/chart/bar/index.wxml +1 -1
- package/src/mp/components/chart/common/config/bar.js +1 -1
- package/src/mp/components/chart/common/core/eChartBar.js +29 -34
- package/src/mp/components/chart/common/core/eChartBase.js +46 -32
- package/src/mp/components/chart/common/core/eChartLine.js +34 -40
- package/src/mp/components/chart/common/core/eChartPie.js +12 -9
- package/src/mp/components/chart/ec-canvas/ec-canvas.json +1 -1
- package/src/mp/components/chart/ec-canvas/wx-canvas.js +24 -22
- package/src/mp/components/chart/line/index.js +2 -2
- package/src/mp/components/chart/line/index.wxml +1 -1
- package/src/mp/components/chart/pie/index.js +1 -1
- package/src/mp/components/chart/pie/index.wxml +1 -2
- package/src/mp/components/dataView/index.wxml +2 -14
- package/src/mp/components/form/checkbox/index.js +10 -6
- package/src/mp/components/form/checkbox/index.wxml +13 -25
- package/src/mp/components/form/form/index.wxml +3 -3
- package/src/mp/components/form/formcell/index.wxml +9 -9
- package/src/mp/components/form/formcell/index.wxss +6 -1
- package/src/mp/components/form/input/index.js +3 -3
- package/src/mp/components/form/input/index.wxml +24 -31
- package/src/mp/components/form/input/index.wxss +9 -3
- package/src/mp/components/form/location/components/mapChoose/index.json +1 -1
- package/src/mp/components/form/location/components/mapChoose/index.wxml +6 -6
- 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 +6 -10
- package/src/mp/components/form/radio/index.js +9 -5
- package/src/mp/components/form/radio/index.wxml +12 -24
- package/src/mp/components/form/select/index.js +156 -97
- package/src/mp/components/form/select/index.wxml +11 -39
- package/src/mp/components/form/select/index.wxss +14 -3
- package/src/mp/components/form/select/region/index.js +18 -12
- package/src/mp/components/form/switch/index.wxml +11 -18
- package/src/mp/components/form/textarea/index.wxml +2 -17
- package/src/mp/components/form/textarea/index.wxss +5 -0
- package/src/mp/components/form/tips/index.wxml +1 -3
- package/src/mp/components/form/uploader/index.js +1 -1
- package/src/mp/components/form/uploader/index.wxml +3 -20
- package/src/mp/components/form/uploader/weui-uploader.js +210 -200
- package/src/mp/components/form/uploader/weui-uploader.json +6 -6
- package/src/mp/components/form/uploader/weui-uploader.wxml +38 -38
- package/src/mp/components/form/uploaderFile/index.js +5 -4
- package/src/mp/components/form/uploaderFile/index.wxml +40 -41
- package/src/mp/components/graphicCard/index.js +35 -35
- package/src/mp/components/graphicCard/index.wxml +2 -6
- package/src/mp/components/image/index.wxml +9 -20
- package/src/mp/components/image/index.wxss +3 -1
- package/src/mp/components/listView/index.wxml +5 -7
- package/src/mp/components/lottery/index.wxml +1 -3
- package/src/mp/components/lottery/index.wxss +31 -25
- package/src/mp/components/navLayout/index.js +9 -12
- package/src/mp/components/navLayout/index.wxml +2 -4
- package/src/mp/components/navigationBar/index.json +1 -2
- package/src/mp/components/navigationBar/index.wxml +43 -51
- package/src/mp/components/swiper/index.wxml +1 -9
- package/src/mp/components/tabs/index.js +14 -10
- package/src/mp/components/tabs/index.json +1 -1
- package/src/mp/components/tabs/index.wxml +3 -21
- package/src/mp/components/text/index.wxml +1 -6
- package/src/mp/components/text/index.wxss +1 -1
- 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 +3 -14
- package/src/mp/components/wxOpenApi/phoneCode/index.json +1 -1
- package/src/mp/components/wxOpenApi/phoneCode/index.wxml +3 -14
- package/src/mp/components/wxOpenApi/share/index.wxml +3 -14
- package/src/mp/components/wxOpenApi/userInfo/index.wxml +3 -13
- package/src/mp/index.json +1 -0
- package/src/mp/style/weda-ui.wxss +20 -7
- package/src/mp/utils/deepEqual.js +37 -37
- package/src/mp/utils/destr.js +41 -40
- package/src/mp/utils/dr_square_point.js +10 -6
- package/src/setupTests.js +13 -13
- package/src/web/actions/showModal/index.tsx +5 -4
- package/src/web/components/button/index.tsx +44 -40
- package/src/web/components/calendar/index.css +81 -34
- package/src/web/components/carousel/index.tsx +1 -1
- package/src/web/components/chart/common/config/bar.js +1 -1
- package/src/web/components/chart/common/core/eChartBar.js +28 -34
- package/src/web/components/chart/common/core/eChartBase.ts +55 -42
- package/src/web/components/chart/common/core/eChartLine.js +34 -40
- package/src/web/components/chart/common/core/eChartPie.js +12 -9
- 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 +7 -6
- package/src/web/components/form/formcell/index.css +10 -4
- package/src/web/components/form/formcell/index.tsx +3 -7
- 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 +154 -103
- package/src/web/components/form/select/index.css +9 -3
- 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 +27 -26
- package/src/web/components/form/types.d.ts +10 -10
- package/src/web/components/form/uploader/uploader.h5.tsx +26 -20
- 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 +29 -12
- package/src/web/components/index.js +1 -0
- package/src/web/components/link/index.tsx +13 -13
- 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/navLayout/index.tsx +1 -1
- package/src/web/components/navigationBar/index.tsx +2 -2
- package/src/web/components/picker/datePicker.tsx +3 -3
- package/src/web/components/picker/picker.tsx +3 -3
- package/src/web/components/picker/timePicker.tsx +1 -1
- 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/text/index.tsx +13 -14
- 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/isObjectEqual.js +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 +17 -0
package/src/mp/utils/destr.js
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
// https://github.com/unjs/destr/blob/2f6612533dd798d2ff5786274f2244558f86d09c/src/index.ts
|
|
2
2
|
// https://github.com/fastify/secure-json-parse
|
|
3
3
|
// https://github.com/hapijs/bourne
|
|
4
|
-
const suspectProtoRx =
|
|
5
|
-
|
|
4
|
+
const suspectProtoRx =
|
|
5
|
+
/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
|
|
6
|
+
const suspectConstructorRx =
|
|
7
|
+
/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
6
8
|
const JsonSigRx = /^["{[]|^-?[0-9][0-9.]{0,14}$/;
|
|
7
9
|
function jsonParseTransform(key, value) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
if (key === '__proto__' || key === 'constructor') {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
12
14
|
}
|
|
13
15
|
export default function destr(val) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
16
|
+
if (typeof val !== 'string') {
|
|
17
|
+
return val;
|
|
18
|
+
}
|
|
19
|
+
const _lval = val.toLowerCase();
|
|
20
|
+
if (_lval === 'true') {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
if (_lval === 'false') {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (_lval === 'null') {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
if (_lval === 'nan') {
|
|
30
|
+
return NaN;
|
|
31
|
+
}
|
|
32
|
+
if (_lval === 'infinity') {
|
|
33
|
+
return Infinity;
|
|
34
|
+
}
|
|
35
|
+
if (_lval === 'undefined') {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
if (!JsonSigRx.test(val)) {
|
|
39
|
+
return val;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
if (suspectProtoRx.test(val) || suspectConstructorRx.test(val)) {
|
|
43
|
+
return JSON.parse(val, jsonParseTransform);
|
|
44
|
+
}
|
|
45
|
+
return JSON.parse(val);
|
|
46
|
+
} catch (_e) {
|
|
47
|
+
return val;
|
|
48
|
+
}
|
|
48
49
|
}
|
|
@@ -10,16 +10,20 @@
|
|
|
10
10
|
function dr_square_point($lng, $lat, $distance = 0.5) {
|
|
11
11
|
$distance = $distance ? $distance : 1;
|
|
12
12
|
let $r = 6371; //地球半径,平均半径为6371km
|
|
13
|
-
let $dlng =
|
|
13
|
+
let $dlng =
|
|
14
|
+
2 *
|
|
15
|
+
Math.asin(
|
|
16
|
+
Math.sin($distance / (2 * $r)) / Math.cos($lat * (Math.PI / 180))
|
|
17
|
+
);
|
|
14
18
|
$dlng = $dlng * (180 / Math.PI);
|
|
15
19
|
let $dlat = $distance / $r;
|
|
16
20
|
$dlat = $dlat * (180 / Math.PI);
|
|
17
21
|
return {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
leftTop: [$lat + $dlat, $lng - $dlng],
|
|
23
|
+
leftBottom: [$lat - $dlat, $lng - $dlng],
|
|
24
|
+
rightBottom: [$lat - $dlat, $lng + $dlng],
|
|
25
|
+
rightTop: [$lat + $dlat, $lng + $dlng],
|
|
22
26
|
};
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
export default dr_square_point;
|
|
29
|
+
export default dr_square_point;
|
package/src/setupTests.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
require(
|
|
1
|
+
require('regenerator-runtime');
|
|
2
2
|
Object.defineProperty(window, 'matchMedia', {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
writable: true,
|
|
4
|
+
value: jest.fn().mockImplementation((query) => ({
|
|
5
|
+
matches: false,
|
|
6
|
+
media: query,
|
|
7
|
+
onchange: null,
|
|
8
|
+
addListener: jest.fn(), // Deprecated
|
|
9
|
+
removeListener: jest.fn(), // Deprecated
|
|
10
|
+
addEventListener: jest.fn(),
|
|
11
|
+
removeEventListener: jest.fn(),
|
|
12
|
+
dispatchEvent: jest.fn(),
|
|
13
|
+
})),
|
|
14
|
+
});
|
|
@@ -2,8 +2,10 @@ import * as ReactDOM from 'react-dom';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { forwardRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
4
4
|
import { Modal, Button, Text, ModalProps, ConfigProvider } from 'tea-component';
|
|
5
|
-
import type {
|
|
6
|
-
|
|
5
|
+
import type {
|
|
6
|
+
ModalShowHandle,
|
|
7
|
+
ModalShowOptions,
|
|
8
|
+
} from 'tea-component/lib/modal/ModalShow';
|
|
7
9
|
|
|
8
10
|
interface ModalShowInstance {
|
|
9
11
|
setVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -26,9 +28,8 @@ const ModalShow = forwardRef(function ModalShow(
|
|
|
26
28
|
return <Modal {...props} visible={visible} />;
|
|
27
29
|
});
|
|
28
30
|
|
|
29
|
-
|
|
30
31
|
function show(options: ModalShowOptions): ModalShowHandle {
|
|
31
|
-
const el = document.createElement(
|
|
32
|
+
const el = document.createElement('div');
|
|
32
33
|
|
|
33
34
|
const instanceRef = React.createRef<ModalShowInstance>();
|
|
34
35
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Button as TeaButton,
|
|
4
|
+
ButtonProps,
|
|
5
|
+
ConfigProvider,
|
|
6
|
+
} from 'tea-component';
|
|
3
7
|
import classNames from '../../utils/classnames';
|
|
4
8
|
import { usePlatform } from '../../utils/platform';
|
|
5
|
-
import { CommonPropsType, unknownFunction } from '../../types';
|
|
9
|
+
import type { CommonPropsType, unknownFunction } from '../../types';
|
|
6
10
|
|
|
7
11
|
import './index.css';
|
|
8
12
|
|
|
@@ -15,7 +19,7 @@ const Button = ({
|
|
|
15
19
|
formType,
|
|
16
20
|
loading,
|
|
17
21
|
disabled,
|
|
18
|
-
events =
|
|
22
|
+
events = {} as Record<string, unknownFunction>,
|
|
19
23
|
className,
|
|
20
24
|
style,
|
|
21
25
|
id,
|
|
@@ -38,48 +42,48 @@ const Button = ({
|
|
|
38
42
|
});
|
|
39
43
|
const onClick = (e) => events.tap({}, { originEvent: e });
|
|
40
44
|
|
|
41
|
-
if(platform === 'h5') {
|
|
45
|
+
if (platform === 'h5') {
|
|
42
46
|
return (
|
|
43
47
|
<button
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
className={cls}
|
|
49
|
+
disabled={disabled}
|
|
50
|
+
type={formType}
|
|
51
|
+
style={style}
|
|
52
|
+
id={id}
|
|
53
|
+
onClick={onClick}
|
|
50
54
|
>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
55
|
+
{loading && (
|
|
56
|
+
<span className="weui-btn_loading">
|
|
57
|
+
<i className="weui-loading" />
|
|
58
|
+
</span>
|
|
59
|
+
)}
|
|
60
|
+
{text ? text : contentSlot}
|
|
61
|
+
</button>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
60
64
|
|
|
61
|
-
return (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
return (
|
|
66
|
+
<ConfigProvider classPrefix="wedatea2td">
|
|
67
|
+
<TeaButton
|
|
68
|
+
loading={loading}
|
|
69
|
+
onClick={onClick}
|
|
70
|
+
disabled={disabled}
|
|
71
|
+
htmlType={formType}
|
|
72
|
+
type={toTeaButtonType(type)}
|
|
73
|
+
style={style}
|
|
74
|
+
className={cls}
|
|
75
|
+
id={id}
|
|
72
76
|
>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
);
|
|
77
|
+
{text ? text : contentSlot}
|
|
78
|
+
</TeaButton>
|
|
79
|
+
</ConfigProvider>
|
|
80
|
+
);
|
|
77
81
|
};
|
|
78
82
|
|
|
79
|
-
function toTeaButtonType(type: PropsType['type']
|
|
80
|
-
if(type === 'primary') return type;
|
|
81
|
-
if(type === 'warn') return 'error';
|
|
82
|
-
if(type === 'default') return 'primary';
|
|
83
|
+
function toTeaButtonType(type: PropsType['type']): ButtonProps['type'] {
|
|
84
|
+
if (type === 'primary') return type;
|
|
85
|
+
if (type === 'warn') return 'error';
|
|
86
|
+
if (type === 'default') return 'primary';
|
|
83
87
|
return 'primary';
|
|
84
88
|
}
|
|
85
89
|
|
|
@@ -95,7 +99,7 @@ export interface PropsType extends CommonPropsType {
|
|
|
95
99
|
/**
|
|
96
100
|
* 大小
|
|
97
101
|
*/
|
|
98
|
-
size?:
|
|
102
|
+
size?: 'default' | 'mini' | 'large';
|
|
99
103
|
/**
|
|
100
104
|
* 是否禁用
|
|
101
105
|
*/
|
|
@@ -108,7 +112,7 @@ export interface PropsType extends CommonPropsType {
|
|
|
108
112
|
/**
|
|
109
113
|
* 用于 form 类型
|
|
110
114
|
*/
|
|
111
|
-
formType?:
|
|
115
|
+
formType?: 'button' | 'submit' | 'reset';
|
|
112
116
|
contentSlot?: string;
|
|
113
117
|
}
|
|
114
118
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/* weda_calendar */
|
|
2
2
|
|
|
3
3
|
/* pc 日历样式 start */
|
|
4
4
|
.weda-calendar.weda-calendar-pc {
|
|
5
|
-
background: #
|
|
6
|
-
border: 0.5px solid #
|
|
5
|
+
background: #ffffff;
|
|
6
|
+
border: 0.5px solid #dcdcdc;
|
|
7
7
|
box-sizing: border-box;
|
|
8
|
-
box-shadow: 0px 3px 14px 2px rgba(0, 0, 0, 0.05),
|
|
8
|
+
box-shadow: 0px 3px 14px 2px rgba(0, 0, 0, 0.05),
|
|
9
|
+
0px 8px 10px 1px rgba(0, 0, 0, 0.06), 0px 5px 5px -3px rgba(0, 0, 0, 0.1);
|
|
9
10
|
border-radius: 3px;
|
|
10
11
|
min-width: 560px;
|
|
11
12
|
}
|
|
@@ -45,24 +46,33 @@
|
|
|
45
46
|
margin-right: 0;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
.weda-calendar-pc
|
|
49
|
+
.weda-calendar-pc
|
|
50
|
+
.weda-calendar__control-section
|
|
51
|
+
.weda-calendar__control-section-cell {
|
|
49
52
|
height: 100%;
|
|
50
53
|
margin-right: 8px;
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
.weda-calendar-pc
|
|
56
|
+
.weda-calendar-pc
|
|
57
|
+
.weda-calendar__control-section
|
|
58
|
+
.weda-calendar__control-section-cell:last-child {
|
|
54
59
|
margin-right: 0;
|
|
55
60
|
}
|
|
56
61
|
|
|
57
|
-
.weda-calendar-pc
|
|
58
|
-
|
|
62
|
+
.weda-calendar-pc
|
|
63
|
+
.weda-calendar__control-section
|
|
64
|
+
.tea-dropdown
|
|
65
|
+
.tea-dropdown__header {
|
|
66
|
+
background: #e7e7e7;
|
|
59
67
|
border-radius: 3px;
|
|
60
68
|
padding: 5px 32px 5px 12px;
|
|
61
69
|
height: 32px;
|
|
62
|
-
|
|
63
70
|
}
|
|
64
71
|
|
|
65
|
-
.weda-calendar-pc
|
|
72
|
+
.weda-calendar-pc
|
|
73
|
+
.weda-calendar__control-section
|
|
74
|
+
.tea-dropdown
|
|
75
|
+
.tea-dropdown__value {
|
|
66
76
|
font-size: 14px;
|
|
67
77
|
line-height: 22px;
|
|
68
78
|
}
|
|
@@ -124,7 +134,9 @@
|
|
|
124
134
|
}
|
|
125
135
|
|
|
126
136
|
.weda-calendar .weda-calendar__table .weda-calendar__table-head-cell:last-child,
|
|
127
|
-
.weda-calendar
|
|
137
|
+
.weda-calendar
|
|
138
|
+
.weda-calendar__table
|
|
139
|
+
.weda-calendar__table-body-cell:last-child {
|
|
128
140
|
margin-right: 0;
|
|
129
141
|
}
|
|
130
142
|
|
|
@@ -136,7 +148,7 @@
|
|
|
136
148
|
flex: 1;
|
|
137
149
|
-webkit-box-flex: 1;
|
|
138
150
|
-ms-flex: 1;
|
|
139
|
-
border-top: 1px solid #
|
|
151
|
+
border-top: 1px solid #e7e7e7;
|
|
140
152
|
padding: 0;
|
|
141
153
|
height: 87.4px;
|
|
142
154
|
display: flex;
|
|
@@ -156,18 +168,24 @@
|
|
|
156
168
|
color: rgba(0, 0, 0, 0.26);
|
|
157
169
|
}
|
|
158
170
|
|
|
159
|
-
.weda-calendar
|
|
160
|
-
.weda-
|
|
171
|
+
.weda-calendar
|
|
172
|
+
.weda-calendar__table
|
|
173
|
+
.weda-calendar__table-body-cell.is-disabled,
|
|
174
|
+
.weda-calendar
|
|
175
|
+
.weda-calendar__table
|
|
176
|
+
.weda-calendar__table-body-cell.is-invalid {
|
|
161
177
|
cursor: not-allowed;
|
|
162
178
|
}
|
|
163
179
|
|
|
164
|
-
.weda-calendar
|
|
165
|
-
|
|
180
|
+
.weda-calendar
|
|
181
|
+
.weda-calendar__table
|
|
182
|
+
.weda-calendar__table-body-cell.is-invalid {
|
|
183
|
+
background: #f3f3f3;
|
|
166
184
|
}
|
|
167
185
|
|
|
168
186
|
.weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-now {
|
|
169
|
-
border-top-color: #
|
|
170
|
-
background: #
|
|
187
|
+
border-top-color: #0052d9;
|
|
188
|
+
background: #ecf2fe;
|
|
171
189
|
}
|
|
172
190
|
|
|
173
191
|
.weda-calendar .weda-calendar__table .weda-calendar__table-body-cell-value {
|
|
@@ -179,11 +197,17 @@
|
|
|
179
197
|
position: relative;
|
|
180
198
|
}
|
|
181
199
|
|
|
182
|
-
.weda-calendar
|
|
200
|
+
.weda-calendar
|
|
201
|
+
.weda-calendar__table
|
|
202
|
+
.weda-calendar__table-body-cell.is-disabled
|
|
203
|
+
.weda-calendar__table-body-cell-value {
|
|
183
204
|
color: rgba(0, 0, 0, 0.26);
|
|
184
205
|
}
|
|
185
206
|
|
|
186
|
-
.weda-calendar
|
|
207
|
+
.weda-calendar
|
|
208
|
+
.weda-calendar__table
|
|
209
|
+
.weda-calendar__table-body-cell
|
|
210
|
+
.weda-calendar__table-body-cell-marked {
|
|
187
211
|
position: absolute;
|
|
188
212
|
width: 6px;
|
|
189
213
|
height: 6px;
|
|
@@ -198,7 +222,7 @@
|
|
|
198
222
|
/* h5 日历样式 start */
|
|
199
223
|
|
|
200
224
|
.weda-calendar.weda-calendar-h5 {
|
|
201
|
-
background: #
|
|
225
|
+
background: #ffffff;
|
|
202
226
|
width: 100%;
|
|
203
227
|
opacity: 0.9;
|
|
204
228
|
}
|
|
@@ -222,18 +246,22 @@
|
|
|
222
246
|
background-position: center;
|
|
223
247
|
}
|
|
224
248
|
|
|
225
|
-
.weda-calendar__control_h5
|
|
226
|
-
.weda-
|
|
249
|
+
.weda-calendar__control_h5
|
|
250
|
+
.weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line,
|
|
251
|
+
.weda-calendar__control_h5
|
|
252
|
+
.weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
|
|
227
253
|
position: absolute;
|
|
228
254
|
top: 17px;
|
|
229
255
|
width: 20px;
|
|
230
256
|
height: 20px;
|
|
231
257
|
}
|
|
232
258
|
|
|
233
|
-
.weda-calendar__control_h5
|
|
259
|
+
.weda-calendar__control_h5
|
|
260
|
+
.weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line {
|
|
234
261
|
left: 16px;
|
|
235
262
|
}
|
|
236
|
-
.weda-calendar__control_h5
|
|
263
|
+
.weda-calendar__control_h5
|
|
264
|
+
.weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
|
|
237
265
|
right: 16px;
|
|
238
266
|
}
|
|
239
267
|
|
|
@@ -336,7 +364,9 @@
|
|
|
336
364
|
background: transparent;
|
|
337
365
|
}
|
|
338
366
|
|
|
339
|
-
.weda-calendar-h5
|
|
367
|
+
.weda-calendar-h5
|
|
368
|
+
.weda-calendar__table-body
|
|
369
|
+
.weda-calendar__table-body-cell-value {
|
|
340
370
|
font-size: 14px;
|
|
341
371
|
text-align: center;
|
|
342
372
|
border-radius: 50%;
|
|
@@ -346,37 +376,54 @@
|
|
|
346
376
|
box-sizing: border-box;
|
|
347
377
|
}
|
|
348
378
|
|
|
349
|
-
.weda-calendar-h5
|
|
379
|
+
.weda-calendar-h5
|
|
380
|
+
.weda-calendar__table
|
|
381
|
+
.weda-calendar__table-body-cell.is-now
|
|
382
|
+
.weda-calendar__table-body-cell-value {
|
|
350
383
|
color: #fff;
|
|
351
384
|
}
|
|
352
385
|
|
|
353
|
-
.weda-calendar-h5
|
|
386
|
+
.weda-calendar-h5
|
|
387
|
+
.weda-calendar__table
|
|
388
|
+
.weda-calendar__table-body-cell.is-now
|
|
389
|
+
.weda-calendar__table-body-cell-bg {
|
|
354
390
|
position: absolute;
|
|
355
391
|
width: 24px;
|
|
356
392
|
height: 24px;
|
|
357
|
-
background: #
|
|
393
|
+
background: #0052d9;
|
|
358
394
|
border-radius: 100%;
|
|
359
395
|
left: calc(50% - 12px);
|
|
360
396
|
top: calc(50% - 12px);
|
|
361
397
|
z-index: -1;
|
|
362
398
|
}
|
|
363
399
|
|
|
364
|
-
.weda-calendar-h5
|
|
400
|
+
.weda-calendar-h5
|
|
401
|
+
.weda-calendar__table
|
|
402
|
+
.weda-calendar__table-body-cell
|
|
403
|
+
.weda-calendar__table-body-cell-marked {
|
|
365
404
|
width: 4px;
|
|
366
405
|
height: 4px;
|
|
367
406
|
top: calc(50% + 14px);
|
|
368
407
|
}
|
|
369
408
|
|
|
370
|
-
.weda-calendar-h5
|
|
409
|
+
.weda-calendar-h5
|
|
410
|
+
.weda-calendar__table
|
|
411
|
+
.weda-calendar__table-body-cell.is-disabled
|
|
412
|
+
.weda-calendar__table-body-cell-value {
|
|
371
413
|
color: rgba(0, 0, 0, 0.6);
|
|
372
414
|
}
|
|
373
415
|
|
|
374
|
-
.weda-calendar-h5
|
|
416
|
+
.weda-calendar-h5
|
|
417
|
+
.weda-calendar__table
|
|
418
|
+
.weda-calendar__table-body-cell.is-invalid {
|
|
375
419
|
background: transparent;
|
|
376
420
|
}
|
|
377
421
|
|
|
378
|
-
.weda-calendar-h5
|
|
422
|
+
.weda-calendar-h5
|
|
423
|
+
.weda-calendar__table
|
|
424
|
+
.weda-calendar__table-body-cell.is-invalid
|
|
425
|
+
.weda-calendar__table-body-cell-value {
|
|
379
426
|
color: #c5c5c5;
|
|
380
427
|
}
|
|
381
428
|
|
|
382
|
-
/* h5 日历样式 end */
|
|
429
|
+
/* h5 日历样式 end */
|