@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.
Files changed (235) hide show
  1. package/README.md +1 -0
  2. package/package.json +13 -5
  3. package/src/configs/components/button.json +60 -13
  4. package/src/configs/components/calendar.json +3 -3
  5. package/src/configs/components/carousel.json +57 -47
  6. package/src/configs/components/chart/bar.json +4 -13
  7. package/src/configs/components/chart/line.json +4 -13
  8. package/src/configs/components/chart/pie.json +3 -10
  9. package/src/configs/components/chart/statisticsCard.json +1 -4
  10. package/src/configs/components/container.json +1 -3
  11. package/src/configs/components/dataView.json +7 -15
  12. package/src/configs/components/drawer.json +24 -6
  13. package/src/configs/components/form/form.json +19 -0
  14. package/src/configs/components/form/input.json +20 -5
  15. package/src/configs/components/form/location.json +51 -48
  16. package/src/configs/components/form/radio.json +1 -3
  17. package/src/configs/components/form/richText.json +14 -14
  18. package/src/configs/components/form/select.json +62 -82
  19. package/src/configs/components/form/textarea.json +6 -1
  20. package/src/configs/components/form/uploader.json +64 -64
  21. package/src/configs/components/form/uploaderFile.json +1 -2
  22. package/src/configs/components/graphicCard.json +43 -44
  23. package/src/configs/components/image.json +44 -40
  24. package/src/configs/components/link.json +5 -10
  25. package/src/configs/components/listView.json +2 -8
  26. package/src/configs/components/lottery.json +7 -3
  27. package/src/configs/components/modal.json +26 -21
  28. package/src/configs/components/navLayout.json +66 -67
  29. package/src/configs/components/navigationBar.json +4 -1
  30. package/src/configs/components/richtextview.json +1 -1
  31. package/src/configs/components/scrollVeiw.json +14 -42
  32. package/src/configs/components/swiper.json +9 -9
  33. package/src/configs/components/wedaVideo.json +86 -0
  34. package/src/configs/components/wxOpenApi/phone.json +7 -21
  35. package/src/configs/components/wxOpenApi/phoneCode.json +7 -19
  36. package/src/configs/components/wxOpenApi/share.json +14 -24
  37. package/src/configs/components/wxOpenApi/userInfo.json +9 -27
  38. package/src/configs/index.js +2 -0
  39. package/src/docs/common/format.tsx +4 -1
  40. package/src/docs/common/tableView.css +3 -3
  41. package/src/docs/common/tableView.tsx +18 -8
  42. package/src/docs/compsdocs/form/FormLocation.mdx +1 -1
  43. package/src/docs/compsdocs/form/FormSelect.mdx +0 -1
  44. package/src/docs/compsdocs/grid/Card.mdx +0 -1
  45. package/src/docs/compsdocs/grid/Container.mdx +0 -1
  46. package/src/docs/compsdocs/grid/GridLayout.mdx +0 -1
  47. package/src/docs/compsdocs/grid/ScrollView.mdx +2 -2
  48. package/src/docs/compsdocs/grid/Swiper.mdx +1 -2
  49. package/src/docs/compsdocs/media/Icon.mdx +1 -1
  50. package/src/docs/compsdocs/media/Image.mdx +6 -6
  51. package/src/docs/compsdocs/model/ModelCreate.mdx +24 -0
  52. package/src/docs/compsdocs/model/ModelDetail.mdx +24 -0
  53. package/src/docs/compsdocs/model/ModelTable.mdx +133 -1
  54. package/src/docs/compsdocs/model/ModelUpdate.mdx +24 -1
  55. package/src/docs/compsdocs/navmenu/Classification.mdx +2 -3
  56. package/src/docs/compsdocs/navmenu/NavBar.mdx +14 -5
  57. package/src/docs/compsdocs/navmenu/NavLayout.mdx +0 -1
  58. package/src/docs/compsdocs/navmenu/TabBar.mdx +3 -3
  59. package/src/docs/compsdocs/navmenu/TabBarItem.mdx +1 -1
  60. package/src/docs/compsdocs/senior/Lottery.mdx +3 -6
  61. package/src/docs/compsdocs/senior/Modal.mdx +2 -3
  62. package/src/docs/compsdocs/senior/SlotMachine.mdx +2 -5
  63. package/src/docs/compsdocs/senior/_category_.json +1 -1
  64. package/src/docs/compsdocs/show/GraphicCard.mdx +0 -1
  65. package/src/docs/compsdocs/show/Item.mdx +0 -1
  66. package/src/docs/compsdocs/show/ItemList.mdx +1 -0
  67. package/src/docs/compsdocs/show/Tabs.mdx +2 -3
  68. package/src/docs/compsdocs/text/Link.mdx +1 -1
  69. package/src/docs/compsdocs/text/RichTextView.mdx +1 -2
  70. package/src/docs/compsdocs/text/Text.mdx +1 -1
  71. package/src/docs/compsdocs/text/Title.mdx +1 -2
  72. package/src/docs/compsdocs/wxOpen/Phone.mdx +1 -2
  73. package/src/docs/compsdocs/wxOpen/Share.mdx +0 -1
  74. package/src/docs/compsdocs/wxOpen/UserInfo.mdx +1 -2
  75. package/src/mp/components/button/index.js +1 -1
  76. package/src/mp/components/button/index.wxml +19 -19
  77. package/src/mp/components/calendar/index.js +64 -37
  78. package/src/mp/components/calendar/index.json +1 -1
  79. package/src/mp/components/calendar/index.wxml +4 -6
  80. package/src/mp/components/carousel/index.json +1 -1
  81. package/src/mp/components/carousel/index.wxml +2 -2
  82. package/src/mp/components/chart/bar/index.js +1 -2
  83. package/src/mp/components/chart/bar/index.wxml +1 -1
  84. package/src/mp/components/chart/common/config/bar.js +1 -1
  85. package/src/mp/components/chart/common/core/eChartBar.js +29 -34
  86. package/src/mp/components/chart/common/core/eChartBase.js +46 -32
  87. package/src/mp/components/chart/common/core/eChartLine.js +34 -40
  88. package/src/mp/components/chart/common/core/eChartPie.js +12 -9
  89. package/src/mp/components/chart/ec-canvas/ec-canvas.json +1 -1
  90. package/src/mp/components/chart/ec-canvas/wx-canvas.js +24 -22
  91. package/src/mp/components/chart/line/index.js +2 -2
  92. package/src/mp/components/chart/line/index.wxml +1 -1
  93. package/src/mp/components/chart/pie/index.js +1 -1
  94. package/src/mp/components/chart/pie/index.wxml +1 -2
  95. package/src/mp/components/dataView/index.wxml +2 -14
  96. package/src/mp/components/form/checkbox/index.js +10 -6
  97. package/src/mp/components/form/checkbox/index.wxml +13 -25
  98. package/src/mp/components/form/form/index.wxml +3 -3
  99. package/src/mp/components/form/formcell/index.wxml +9 -9
  100. package/src/mp/components/form/formcell/index.wxss +6 -1
  101. package/src/mp/components/form/input/index.js +3 -3
  102. package/src/mp/components/form/input/index.wxml +24 -31
  103. package/src/mp/components/form/input/index.wxss +9 -3
  104. package/src/mp/components/form/location/components/mapChoose/index.json +1 -1
  105. package/src/mp/components/form/location/components/mapChoose/index.wxml +6 -6
  106. package/src/mp/components/form/location/index.js +7 -1
  107. package/src/mp/components/form/location/index.json +1 -1
  108. package/src/mp/components/form/location/index.wxml +6 -10
  109. package/src/mp/components/form/radio/index.js +9 -5
  110. package/src/mp/components/form/radio/index.wxml +12 -24
  111. package/src/mp/components/form/select/index.js +156 -97
  112. package/src/mp/components/form/select/index.wxml +11 -39
  113. package/src/mp/components/form/select/index.wxss +14 -3
  114. package/src/mp/components/form/select/region/index.js +18 -12
  115. package/src/mp/components/form/switch/index.wxml +11 -18
  116. package/src/mp/components/form/textarea/index.wxml +2 -17
  117. package/src/mp/components/form/textarea/index.wxss +5 -0
  118. package/src/mp/components/form/tips/index.wxml +1 -3
  119. package/src/mp/components/form/uploader/index.js +1 -1
  120. package/src/mp/components/form/uploader/index.wxml +3 -20
  121. package/src/mp/components/form/uploader/weui-uploader.js +210 -200
  122. package/src/mp/components/form/uploader/weui-uploader.json +6 -6
  123. package/src/mp/components/form/uploader/weui-uploader.wxml +38 -38
  124. package/src/mp/components/form/uploaderFile/index.js +5 -4
  125. package/src/mp/components/form/uploaderFile/index.wxml +40 -41
  126. package/src/mp/components/graphicCard/index.js +35 -35
  127. package/src/mp/components/graphicCard/index.wxml +2 -6
  128. package/src/mp/components/image/index.wxml +9 -20
  129. package/src/mp/components/image/index.wxss +3 -1
  130. package/src/mp/components/listView/index.wxml +5 -7
  131. package/src/mp/components/lottery/index.wxml +1 -3
  132. package/src/mp/components/lottery/index.wxss +31 -25
  133. package/src/mp/components/navLayout/index.js +9 -12
  134. package/src/mp/components/navLayout/index.wxml +2 -4
  135. package/src/mp/components/navigationBar/index.json +1 -2
  136. package/src/mp/components/navigationBar/index.wxml +43 -51
  137. package/src/mp/components/swiper/index.wxml +1 -9
  138. package/src/mp/components/tabs/index.js +14 -10
  139. package/src/mp/components/tabs/index.json +1 -1
  140. package/src/mp/components/tabs/index.wxml +3 -21
  141. package/src/mp/components/text/index.wxml +1 -6
  142. package/src/mp/components/text/index.wxss +1 -1
  143. package/src/mp/components/wedaVideo/index.js +86 -0
  144. package/src/mp/components/wedaVideo/index.json +4 -0
  145. package/src/mp/components/wedaVideo/index.wxml +4 -0
  146. package/src/mp/components/wedaVideo/index.wxss +20 -0
  147. package/src/mp/components/wxOpenApi/phone/index.js +1 -9
  148. package/src/mp/components/wxOpenApi/phone/index.wxml +3 -14
  149. package/src/mp/components/wxOpenApi/phoneCode/index.json +1 -1
  150. package/src/mp/components/wxOpenApi/phoneCode/index.wxml +3 -14
  151. package/src/mp/components/wxOpenApi/share/index.wxml +3 -14
  152. package/src/mp/components/wxOpenApi/userInfo/index.wxml +3 -13
  153. package/src/mp/index.json +1 -0
  154. package/src/mp/style/weda-ui.wxss +20 -7
  155. package/src/mp/utils/deepEqual.js +37 -37
  156. package/src/mp/utils/destr.js +41 -40
  157. package/src/mp/utils/dr_square_point.js +10 -6
  158. package/src/setupTests.js +13 -13
  159. package/src/web/actions/showModal/index.tsx +5 -4
  160. package/src/web/components/button/index.tsx +44 -40
  161. package/src/web/components/calendar/index.css +81 -34
  162. package/src/web/components/carousel/index.tsx +1 -1
  163. package/src/web/components/chart/common/config/bar.js +1 -1
  164. package/src/web/components/chart/common/core/eChartBar.js +28 -34
  165. package/src/web/components/chart/common/core/eChartBase.ts +55 -42
  166. package/src/web/components/chart/common/core/eChartLine.js +34 -40
  167. package/src/web/components/chart/common/core/eChartPie.js +12 -9
  168. package/src/web/components/chart/common/core/type.ts +23 -23
  169. package/src/web/components/chart/common/echart.css +12 -12
  170. package/src/web/components/chart/common/echarts.ts +3 -5
  171. package/src/web/components/chart/common/useChart.tsx +34 -16
  172. package/src/web/components/container/index.tsx +3 -4
  173. package/src/web/components/drawer/index.tsx +15 -4
  174. package/src/web/components/form/checkbox/index.tsx +32 -31
  175. package/src/web/components/form/enumSelect/NormalSelect.tsx +0 -2
  176. package/src/web/components/form/form/index.css +3 -6
  177. package/src/web/components/form/form/index.tsx +7 -6
  178. package/src/web/components/form/formcell/index.css +10 -4
  179. package/src/web/components/form/formcell/index.tsx +3 -7
  180. package/src/web/components/form/input/index.css +4 -4
  181. package/src/web/components/form/input/index.tsx +61 -53
  182. package/src/web/components/form/location/common/selectModal.jsx +2 -11
  183. package/src/web/components/form/location/common/useLocationInfo.js +4 -0
  184. package/src/web/components/form/location/components/LocationH5/index.css +0 -1
  185. package/src/web/components/form/location/components/LocationH5/location.h5.jsx +11 -1
  186. package/src/web/components/form/location/components/LocationPC/Header.jsx +0 -13
  187. package/src/web/components/form/location/components/LocationPC/location.PC.jsx +14 -5
  188. package/src/web/components/form/radio/index.tsx +32 -26
  189. package/src/web/components/form/renderDecorator.tsx +23 -26
  190. package/src/web/components/form/select/h5.tsx +154 -103
  191. package/src/web/components/form/select/index.css +9 -3
  192. package/src/web/components/form/select/index.tsx +75 -48
  193. package/src/web/components/form/select/region/index.ts +101 -80
  194. package/src/web/components/form/select/year.tsx +2 -0
  195. package/src/web/components/form/switch/index.tsx +40 -40
  196. package/src/web/components/form/textarea/index.css +4 -0
  197. package/src/web/components/form/textarea/index.tsx +27 -26
  198. package/src/web/components/form/types.d.ts +10 -10
  199. package/src/web/components/form/uploader/uploader.h5.tsx +26 -20
  200. package/src/web/components/form/uploaderFile/index.jsx +0 -5
  201. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +15 -11
  202. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +14 -9
  203. package/src/web/components/image/image.tsx +2 -2
  204. package/src/web/components/image/index.css +9 -7
  205. package/src/web/components/image/index.tsx +29 -12
  206. package/src/web/components/index.js +1 -0
  207. package/src/web/components/link/index.tsx +13 -13
  208. package/src/web/components/lottery/index.css +43 -37
  209. package/src/web/components/lottery/index.tsx +2 -2
  210. package/src/web/components/modal/index.tsx +34 -34
  211. package/src/web/components/navLayout/index.tsx +1 -1
  212. package/src/web/components/navigationBar/index.tsx +2 -2
  213. package/src/web/components/picker/datePicker.tsx +3 -3
  214. package/src/web/components/picker/picker.tsx +3 -3
  215. package/src/web/components/picker/timePicker.tsx +1 -1
  216. package/src/web/components/richText/index.jsx +41 -46
  217. package/src/web/components/richTextView/index.tsx +4 -6
  218. package/src/web/components/scrollView/index.tsx +2 -2
  219. package/src/web/components/slot/index.tsx +3 -4
  220. package/src/web/components/swiper/index.css +1 -1
  221. package/src/web/components/swiper/index.tsx +33 -15
  222. package/src/web/components/tabs/index.css +1 -1
  223. package/src/web/components/tabs/index.tsx +6 -6
  224. package/src/web/components/tabs/tabs.h5.tsx +17 -12
  225. package/src/web/components/tabs/tabs.pc.tsx +45 -34
  226. package/src/web/components/text/index.css +1 -1
  227. package/src/web/components/text/index.tsx +13 -14
  228. package/src/web/components/wedaVideo/index.css +42 -0
  229. package/src/web/components/wedaVideo/index.tsx +198 -0
  230. package/src/web/utils/constant.ts +2 -1
  231. package/src/web/utils/isObjectEqual.js +2 -1
  232. package/src/web/utils/loading-fallback.tsx +2 -2
  233. package/src/web/utils/lodash.ts +1 -1
  234. package/src/web/utils/useSetState.ts +6 -2
  235. package/src/web/weda-ui.css +17 -0
@@ -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 = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
5
- const suspectConstructorRx = /"(?: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*:/;
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
- if (key === '__proto__' || key === 'constructor') {
9
- return;
10
- }
11
- return value;
10
+ if (key === '__proto__' || key === 'constructor') {
11
+ return;
12
+ }
13
+ return value;
12
14
  }
13
15
  export default function destr(val) {
14
- if (typeof val !== 'string') {
15
- return val;
16
- }
17
- const _lval = val.toLowerCase();
18
- if (_lval === 'true') {
19
- return true;
20
- }
21
- if (_lval === 'false') {
22
- return false;
23
- }
24
- if (_lval === 'null') {
25
- return null;
26
- }
27
- if (_lval === 'nan') {
28
- return NaN;
29
- }
30
- if (_lval === 'infinity') {
31
- return Infinity;
32
- }
33
- if (_lval === 'undefined') {
34
- return undefined;
35
- }
36
- if (!JsonSigRx.test(val)) {
37
- return val;
38
- }
39
- try {
40
- if (suspectProtoRx.test(val) || suspectConstructorRx.test(val)) {
41
- return JSON.parse(val, jsonParseTransform);
42
- }
43
- return JSON.parse(val);
44
- }
45
- catch (_e) {
46
- return val;
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 = 2 * Math.asin(Math.sin($distance / (2 * $r)) / Math.cos($lat * (Math.PI / 180)));
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
- 'leftTop': [$lat + $dlat, $lng - $dlng],
19
- 'leftBottom': [$lat - $dlat, $lng - $dlng],
20
- 'rightBottom': [$lat - $dlat, $lng + $dlng],
21
- 'rightTop': [$lat + $dlat, $lng + $dlng],
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("regenerator-runtime");
1
+ require('regenerator-runtime');
2
2
  Object.defineProperty(window, 'matchMedia', {
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
- });
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 { ModalShowHandle, ModalShowOptions } from 'tea-component/lib/modal/ModalShow';
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("div");
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 { Button as TeaButton, ButtonProps, ConfigProvider } from 'tea-component';
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 = ({} as Record<string, unknownFunction>),
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
- className={cls}
45
- disabled={disabled}
46
- type={formType}
47
- style={style}
48
- id={id}
49
- onClick={onClick}
48
+ className={cls}
49
+ disabled={disabled}
50
+ type={formType}
51
+ style={style}
52
+ id={id}
53
+ onClick={onClick}
50
54
  >
51
- {loading && (
52
- <span className="weui-btn_loading">
53
- <i className="weui-loading" />
54
- </span>
55
- )}
56
- {text ? text : contentSlot}
57
- </button>
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
- <ConfigProvider classPrefix="wedatea2td">
63
- <TeaButton
64
- loading={loading}
65
- onClick={onClick}
66
- disabled={disabled}
67
- htmlType={formType}
68
- type={toTeaButtonType(type)}
69
- style={style}
70
- className={cls}
71
- id={id}
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
- {text ? text : contentSlot}
74
- </TeaButton>
75
- </ConfigProvider>
76
- );
77
+ {text ? text : contentSlot}
78
+ </TeaButton>
79
+ </ConfigProvider>
80
+ );
77
81
  };
78
82
 
79
- function toTeaButtonType(type: PropsType['type'] ): ButtonProps['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?: "default" | "mini" | "large";
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?: "button" | "submit" | "reset";
115
+ formType?: 'button' | 'submit' | 'reset';
112
116
  contentSlot?: string;
113
117
  }
114
118
 
@@ -1,11 +1,12 @@
1
- /* weda_calendar */
1
+ /* weda_calendar */
2
2
 
3
3
  /* pc 日历样式 start */
4
4
  .weda-calendar.weda-calendar-pc {
5
- background: #FFFFFF;
6
- border: 0.5px solid #DCDCDC;
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), 0px 8px 10px 1px rgba(0, 0, 0, 0.06), 0px 5px 5px -3px rgba(0, 0, 0, 0.1);
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 .weda-calendar__control-section .weda-calendar__control-section-cell {
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 .weda-calendar__control-section .weda-calendar__control-section-cell:last-child {
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 .weda-calendar__control-section .tea-dropdown .tea-dropdown__header {
58
- background: #E7E7E7;
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 .weda-calendar__control-section .tea-dropdown .tea-dropdown__value {
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 .weda-calendar__table .weda-calendar__table-body-cell:last-child {
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 #E7E7E7;
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 .weda-calendar__table .weda-calendar__table-body-cell.is-disabled,
160
- .weda-calendar .weda-calendar__table .weda-calendar__table-body-cell.is-invalid {
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 .weda-calendar__table .weda-calendar__table-body-cell.is-invalid {
165
- background: #F3F3F3;
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: #0052D9;
170
- background: #ECF2FE;
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 .weda-calendar__table .weda-calendar__table-body-cell.is-disabled .weda-calendar__table-body-cell-value {
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 .weda-calendar__table .weda-calendar__table-body-cell .weda-calendar__table-body-cell-marked {
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: #FFFFFF;
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 .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line,
226
- .weda-calendar__control_h5 .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
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 .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line {
259
+ .weda-calendar__control_h5
260
+ .weda-calendar_prevMonth.wedatea2td-icon-arrowleft--line {
234
261
  left: 16px;
235
262
  }
236
- .weda-calendar__control_h5 .weda-calendar_nextMonth.wedatea2td-icon-arrowright--line {
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 .weda-calendar__table-body .weda-calendar__table-body-cell-value {
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 .weda-calendar__table .weda-calendar__table-body-cell.is-now .weda-calendar__table-body-cell-value {
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 .weda-calendar__table .weda-calendar__table-body-cell.is-now .weda-calendar__table-body-cell-bg {
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: #0052D9;
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 .weda-calendar__table .weda-calendar__table-body-cell .weda-calendar__table-body-cell-marked {
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 .weda-calendar__table .weda-calendar__table-body-cell.is-disabled .weda-calendar__table-body-cell-value {
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 .weda-calendar__table .weda-calendar__table-body-cell.is-invalid {
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 .weda-calendar__table .weda-calendar__table-body-cell.is-invalid .weda-calendar__table-body-cell-value {
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 */
@@ -9,7 +9,7 @@ import {
9
9
  } from '@react-hookz/web';
10
10
 
11
11
  import './index.css';
12
- import { CommonPropsType } from '../../types';
12
+ import type { CommonPropsType } from '../../types';
13
13
 
14
14
  import Image from '../image';
15
15
  interface imagesItem {
@@ -11,7 +11,7 @@ const getConfig = () => {
11
11
  axisTick: {
12
12
  show: true, // 刻度显示
13
13
  },
14
- inverse:false,
14
+ inverse: false,
15
15
  type: 'category',
16
16
  data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
17
17
  },