@cloudbase/weda-ui 0.2.10 → 0.2.14

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 (111) hide show
  1. package/CHANGELOG.md +240 -0
  2. package/package.json +61 -40
  3. package/src/.DS_Store +0 -0
  4. package/src/configs/.DS_Store +0 -0
  5. package/src/configs/components/button.json +7 -3
  6. package/src/configs/components/form/richText.json +1 -1
  7. package/src/configs/components/form/uploader.json +29 -1
  8. package/src/configs/components/form/uploaderFile.json +158 -0
  9. package/src/configs/components/image.json +12 -3
  10. package/src/configs/components/link.json +3 -3
  11. package/src/configs/components/richtextview.json +2 -2
  12. package/src/configs/components/scrollVeiw.json +5 -5
  13. package/src/configs/components/swiper.json +6 -6
  14. package/src/configs/components/tabs.json +3 -3
  15. package/src/configs/components/text.json +39 -4
  16. package/src/configs/index.js +5 -3
  17. package/src/mp/.gitignore +10 -0
  18. package/src/mp/components/button/index.js +1 -0
  19. package/src/mp/components/button/index.wxss +8 -0
  20. package/src/mp/components/form/select/index.js +18 -0
  21. package/src/mp/components/form/uploader/index.js +26 -29
  22. package/src/mp/components/form/uploaderFile/index.js +233 -0
  23. package/src/mp/components/form/uploaderFile/index.json +9 -0
  24. package/src/mp/components/form/uploaderFile/index.wxml +46 -0
  25. package/src/mp/components/form/uploaderFile/index.wxss +105 -0
  26. package/src/mp/components/text/index.js +33 -0
  27. package/src/mp/components/text/index.wxml +1 -1
  28. package/src/mp/components/text/index.wxss +18 -0
  29. package/src/mp/index.json +1 -0
  30. package/src/mp/utils/platform.js +20 -0
  31. package/src/mp/utils/tcb.js +11 -0
  32. package/src/web/.DS_Store +0 -0
  33. package/src/web/actions/showModal/{index.jsx → index.tsx} +53 -3
  34. package/src/web/components/auth/index.js +2 -2
  35. package/src/web/components/button/index.css +9 -0
  36. package/src/web/components/button/{index.jsx → index.tsx} +27 -41
  37. package/src/web/components/container/{index.jsx → index.tsx} +6 -10
  38. package/src/web/components/drawer/index.tsx +57 -0
  39. package/src/web/components/form/checkbox/{index.jsx → index.tsx} +24 -48
  40. package/src/web/components/form/enumSelect/MultipleSelect.jsx +1 -6
  41. package/src/web/components/form/enumSelect/{NormalSelect.jsx → NormalSelect.tsx} +3 -14
  42. package/src/web/components/form/form/index.tsx +48 -0
  43. package/src/web/components/form/formcell/{index.jsx → index.tsx} +6 -13
  44. package/src/web/components/form/input/index.css +39 -0
  45. package/src/web/components/form/input/{index.jsx → index.tsx} +33 -67
  46. package/src/web/components/form/radio/{index.jsx → index.tsx} +19 -42
  47. package/src/web/components/form/{renderDecorator.jsx → renderDecorator.tsx} +1 -3
  48. package/src/web/components/form/select/{h5.jsx → h5.tsx} +18 -62
  49. package/src/web/components/form/select/{index.jsx → index.tsx} +51 -94
  50. package/src/web/components/form/select/region/{cities.js → cities.ts} +1 -1
  51. package/src/web/components/form/select/region/{index.js → index.ts} +3 -3
  52. package/src/web/components/form/select/region/{provinces.js → provinces.ts} +1 -1
  53. package/src/web/components/form/select/region/{regions.js → regions.ts} +1 -1
  54. package/src/web/components/form/select/time.jsx +2 -2
  55. package/src/web/components/form/switch/{index.jsx → index.tsx} +30 -47
  56. package/src/web/components/form/textarea/{index.jsx → index.tsx} +22 -55
  57. package/src/web/components/form/tips/{index.jsx → index.tsx} +8 -22
  58. package/src/web/components/form/types.d.ts +12 -0
  59. package/src/web/components/form/uploader/{index.jsx → index.tsx} +16 -14
  60. package/src/web/components/form/uploader/{uploader.h5.jsx → uploader.h5.tsx} +67 -57
  61. package/src/web/components/form/uploader/{uploader.pc.jsx → uploader.pc.tsx} +26 -43
  62. package/src/web/components/form/uploaderFile/fail.svg +12 -0
  63. package/src/web/components/form/uploaderFile/index.css +423 -0
  64. package/src/web/components/form/uploaderFile/index.jsx +30 -0
  65. package/src/web/components/form/uploaderFile/pending.svg +18 -0
  66. package/src/web/components/form/uploaderFile/success.svg +12 -0
  67. package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +578 -0
  68. package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +507 -0
  69. package/src/web/components/image/{image.jsx → image.tsx} +8 -21
  70. package/src/web/components/image/{index.jsx → index.tsx} +22 -37
  71. package/src/web/components/index.js +36 -1
  72. package/src/web/components/link/{index.jsx → index.tsx} +19 -36
  73. package/src/web/components/modal/{index.jsx → index.tsx} +22 -9
  74. package/src/web/components/picker/{datePicker.jsx → datePicker.tsx} +11 -12
  75. package/src/web/components/picker/{picker.jsx → picker.tsx} +7 -10
  76. package/src/web/components/picker/{timePicker.jsx → timePicker.tsx} +8 -16
  77. package/src/web/components/richText/{const.js → const.ts} +0 -0
  78. package/src/web/components/richText/index.jsx +5 -2
  79. package/src/web/components/richTextView/index.tsx +67 -0
  80. package/src/web/components/scrollView/{index.jsx → index.tsx} +18 -33
  81. package/src/web/components/slot/{index.jsx → index.tsx} +8 -9
  82. package/src/web/components/swiper/index.css +1 -1
  83. package/src/web/components/swiper/{index.jsx → index.tsx} +73 -78
  84. package/src/web/components/tabs/index.tsx +33 -0
  85. package/src/web/components/tabs/{tabs.h5.jsx → tabs.h5.tsx} +4 -33
  86. package/src/web/components/tabs/{tabs.pc.jsx → tabs.pc.tsx} +5 -39
  87. package/src/web/components/text/index.css +18 -0
  88. package/src/web/components/text/index.tsx +69 -0
  89. package/src/web/components/uploaderFileView/index.css +11 -0
  90. package/src/web/components/uploaderFileView/index.jsx +75 -0
  91. package/src/web/components/uploaderView/{index.jsx → index.tsx} +12 -15
  92. package/src/web/types.d.ts +20 -0
  93. package/src/web/utils/constant.js +2 -0
  94. package/src/web/utils/loading-fallback.tsx +2 -0
  95. package/src/web/utils/platform.js +77 -6
  96. package/src/web/utils/tcb.js +0 -8
  97. package/src/web/utils/useSetState.ts +14 -0
  98. package/src/web/utils/useSyncValue.ts +17 -0
  99. package/src/web/wedatheme/.git +1 -0
  100. package/src/web/wedatheme/.gitignore +5 -0
  101. package/src/web/wedatheme/.npmrc +1 -0
  102. package/src/web/wedatheme/package-lock.json +14335 -0
  103. package/src/configs/components/button.svg +0 -18
  104. package/src/web/components/drawer/index.jsx +0 -64
  105. package/src/web/components/form/enumSelect/hooks/index.js +0 -49
  106. package/src/web/components/form/form/index.jsx +0 -76
  107. package/src/web/components/link/test/__snapshots__/storybook.test.js.snap +0 -754
  108. package/src/web/components/richTextView/index.jsx +0 -89
  109. package/src/web/components/tabs/index.jsx +0 -10
  110. package/src/web/components/text/index.jsx +0 -71
  111. package/src/web/utils/useSyncValue.js +0 -14
@@ -1,4 +1,36 @@
1
1
  import '../wedatheme/style-package/index.css';
2
+ import loadable from '@loadable/component';
3
+ import { fallback } from '../utils/loading-fallback';
4
+
5
+ // export const Button = loadable(() => import('./button'), {fallback});
6
+ // export const Text = loadable(() => import('./text'), {fallback});
7
+ // export const Container = loadable(() => import('./container'), {fallback});
8
+ // export const Image = loadable(() => import('./image'), {fallback});
9
+ // export const Slot = loadable(() => import('./slot'), {fallback});
10
+ // export const ScrollView = loadable(() => import('./scrollView'), {fallback});
11
+ // export const Swiper = loadable(() => import('./swiper'), {fallback});
12
+ // export const Modal = loadable(() => import('./modal'), {fallback});
13
+ // export const RichText = loadable(() => import('./richText'), {fallback});
14
+ // export const RichTextView = loadable(() => import('./richTextView'), {fallback});
15
+ // export const Link = loadable(() => import('./link'), {fallback});
16
+ // export const Drawer = loadable(() => import('./drawer'), {fallback});
17
+ // export const UploaderView = loadable(() => import('./uploaderView'), {fallback});
18
+ // // picker
19
+ // export const Picker = loadable(() => import('./picker/picker'), {fallback});
20
+ // export const DatePicker = loadable(() => import('./picker/datePicker'), {fallback});
21
+ // export const TimePicker = loadable(() => import('./picker/timePicker'), {fallback});
22
+ // // form
23
+ // export const Form = loadable(() => import('./form/form'), {fallback});
24
+ // export const Input = loadable(() => import('./form/input'), {fallback});
25
+ // export const Textarea = loadable(() => import('./form/textarea'), {fallback});
26
+ // export const Checkbox = loadable(() => import('./form/checkbox'), {fallback});
27
+ // export const Radio = loadable(() => import('./form/radio'), {fallback});
28
+ // export const Switch = loadable(() => import('./form/switch'), {fallback});
29
+ // export const Select = loadable(() => import('./form/select'), {fallback});
30
+ // export const Uploader = loadable(() => import('./form/uploader'), {fallback});
31
+ // export const Tips = loadable(() => import('./form/tips'), {fallback});
32
+ // export const EnumSelect = loadable(() => import('./form/enumSelect'), {fallback});
33
+ // export const Tabs = loadable(() => import('./tabs'), {fallback});
2
34
 
3
35
  export { default as Button } from './button';
4
36
  export { default as Text } from './text';
@@ -13,7 +45,8 @@ export { default as RichTextView } from './richTextView';
13
45
  export { default as Link } from './link';
14
46
  export { default as Drawer } from './drawer';
15
47
  export { default as UploaderView } from './uploaderView';
16
- // picker
48
+ export { default as UploaderFileView } from './uploaderFileView';
49
+
17
50
  export { default as Picker } from './picker/picker';
18
51
  export { default as DatePicker } from './picker/datePicker';
19
52
  export { default as TimePicker } from './picker/timePicker';
@@ -26,9 +59,11 @@ export { default as Radio } from './form/radio';
26
59
  export { default as Switch } from './form/switch';
27
60
  export { default as Select } from './form/select';
28
61
  export { default as Uploader } from './form/uploader';
62
+ export { default as UploaderFile } from './form/uploaderFile';
29
63
  export { default as Tips } from './form/tips';
30
64
  export { default as Tabs } from './tabs';
31
65
  export { default as EnumSelect } from './form/enumSelect';
66
+
32
67
  // open
33
68
  // import Auth from './auth';
34
69
 
@@ -1,7 +1,23 @@
1
1
  import * as React from 'react';
2
+ import { CommonPropsType } from '../../types';
2
3
  import classNames from '../../utils/classnames';
3
4
  import './index.css';
4
- import * as PropTypes from 'prop-types';
5
+
6
+ export interface PropsType extends CommonPropsType {
7
+ /**
8
+ * 内容
9
+ */
10
+ content?: string;
11
+ /**
12
+ * 链接地址
13
+ */
14
+ url?: string;
15
+ /**
16
+ * 参数
17
+ */
18
+ params?: {key: string, value: string}[];
19
+ contentSlot?: React.ReactNode;
20
+ }
5
21
 
6
22
  // 所有绝对地址直接交由浏览器,新开窗口交由浏览器
7
23
  // 当前窗口相对地址交给平台
@@ -13,7 +29,7 @@ export default function Link({
13
29
  className,
14
30
  contentSlot,
15
31
  params = [], // TODO 格式定义
16
- }) {
32
+ }: PropsType) {
17
33
  url = url.trim();
18
34
  const cls = classNames({
19
35
  'weda-link': true,
@@ -97,37 +113,4 @@ export default function Link({
97
113
  {content}
98
114
  </a>
99
115
  );
100
- }
101
-
102
- Link.propTypes = {
103
- // 系统属性
104
- /**
105
- * 类名
106
- */
107
- className: PropTypes.string,
108
- /**
109
- * 事件
110
- */
111
- events: PropTypes.objectOf(PropTypes.func),
112
- /**
113
- * 内联样式
114
- */
115
- style: PropTypes.object,
116
- // 组件属性
117
- /**
118
- * 内容
119
- */
120
- content: PropTypes.string,
121
- /**
122
- * 链接地址
123
- */
124
- url: PropTypes.string,
125
- /**
126
- * 参数
127
- */
128
- params: PropTypes.array,
129
-
130
- contentSlot: PropTypes.any,
131
- };
132
-
133
- Link.defaultProps = {};
116
+ }
@@ -1,8 +1,19 @@
1
1
  import * as React from 'react';
2
- import { Modal, Button } from 'tea-component';
2
+ import { Modal, Button, ModalProps, ConfigProvider } from 'tea-component';
3
+ import { unknownFunction } from '../../types';
3
4
  import classNames from '../../utils/classnames';
4
5
 
5
- export default function WeDaModal(_props) {
6
+ export interface PropTypes extends ModalProps {
7
+ content: string,
8
+ customButton: React.ReactNode,
9
+ customContent: React.ReactNode,
10
+ isDefaultButton: boolean,
11
+ emit?: unknownFunction,
12
+ events: Record<string, unknownFunction>,
13
+
14
+ }
15
+
16
+ export default function WeDaModal(_props: PropTypes) {
6
17
  const {
7
18
  className,
8
19
  content,
@@ -16,6 +27,7 @@ export default function WeDaModal(_props) {
16
27
  } = _props;
17
28
 
18
29
  return (
30
+ <ConfigProvider classPrefix="wedatea2td">
19
31
  <Modal
20
32
  className={classNames('weda-ui', 'lcap-modal', 'container', className)}
21
33
  visible={visible}
@@ -23,23 +35,24 @@ export default function WeDaModal(_props) {
23
35
  emit('close', {});
24
36
  }}
25
37
  {...props}
26
- >
38
+ >
27
39
  <Modal.Body>{content ? content : customContent}</Modal.Body>
28
40
  <Modal.Footer>
29
41
  {isDefaultButton ? (
30
42
  <Button
31
- type="primary"
32
- onClick={() => {
33
- emit('confirm', {});
34
- // events.confirm();
35
- }}
43
+ type="primary"
44
+ onClick={() => {
45
+ emit('confirm', {});
46
+ // events.confirm();
47
+ }}
36
48
  >
37
49
  确定
38
50
  </Button>
39
51
  ) : (
40
52
  customButton
41
- )}
53
+ )}
42
54
  </Modal.Footer>
43
55
  </Modal>
56
+ </ConfigProvider>
44
57
  );
45
58
  }
@@ -1,10 +1,18 @@
1
1
  import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
2
  import weui from '../../utils/weui';
4
3
 
5
4
  import classNames from '../../utils/classnames';
5
+ import { CommonPropsType } from '../../types';
6
6
 
7
- export default function DatePicker(props) {
7
+ export interface PropsType extends CommonPropsType {
8
+ start: string;
9
+ end: string;
10
+ defaultValue: string;
11
+ title: string;
12
+ children?: React.ReactNode|undefined
13
+ }
14
+
15
+ export default function DatePicker(props: PropsType) {
8
16
  const { start, end, defaultValue, title, children, className } = props;
9
17
  const click = function () {
10
18
  let fixedDefaultValue = undefined;
@@ -37,13 +45,4 @@ export default function DatePicker(props) {
37
45
  {children}
38
46
  </div>
39
47
  );
40
- }
41
-
42
- DatePicker.propTypes = {
43
- start: PropTypes.string,
44
- end: PropTypes.string,
45
- defaultValue: PropTypes.string,
46
- title: PropTypes.string,
47
- children: PropTypes.any,
48
- className: PropTypes.string,
49
- };
48
+ }
@@ -1,10 +1,13 @@
1
1
  import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
2
  import weui from '../../utils/weui';
4
-
5
3
  import classNames from '../../utils/classnames';
4
+ import { CommonPropsType } from '../../types';
5
+
6
+ export interface PropsType extends CommonPropsType {
7
+ title?: string
8
+ }
6
9
 
7
- export default function Picker(props) {
10
+ export default function Picker(props: PropsType) {
8
11
  const { title, children, className } = props;
9
12
  const click = function () {
10
13
  weui.picker(
@@ -53,10 +56,4 @@ export default function Picker(props) {
53
56
  {children}
54
57
  </div>
55
58
  );
56
- }
57
-
58
- Picker.propTypes = {
59
- title: PropTypes.string,
60
- children: PropTypes.any,
61
- className: PropTypes.string,
62
- };
59
+ }
@@ -1,11 +1,15 @@
1
1
  import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
2
  import weui from '../../utils/weui';
4
3
 
5
4
  import classNames from '../../utils/classnames';
5
+ import { CommonPropsType } from '../../types';
6
6
 
7
- export default function TimePicker(props) {
8
- const { title, defaultValue, children, className } = props;
7
+ export interface PropsType extends CommonPropsType {
8
+ defaultValue?: string;
9
+ title?: string;
10
+ }
11
+ export default function TimePicker(props: PropsType) {
12
+ const { title = '时间', defaultValue = '', children, className } = props;
9
13
 
10
14
  const click = function () {
11
15
  const hour = [];
@@ -49,16 +53,4 @@ export default function TimePicker(props) {
49
53
  {children}
50
54
  </div>
51
55
  );
52
- }
53
-
54
- TimePicker.propTypes = {
55
- title: PropTypes.string,
56
- defaultValue: PropTypes.string,
57
- children: PropTypes.any,
58
- className: PropTypes.string,
59
- };
60
-
61
- TimePicker.defaultProps = {
62
- title: '时间',
63
- defaultValue: '',
64
- };
56
+ }
@@ -1,10 +1,11 @@
1
+ // @ts-ignore
1
2
  import React, { useEffect, useState } from 'react';
2
3
  import BraftEditor from 'braft-editor';
3
- import { useSetState } from 'react-use';
4
+ import { useSetState } from '../../utils/useSetState';
4
5
  import * as PropsTypes from 'prop-types';
5
6
  import { ContentUtils } from 'braft-utils';
6
7
  import classNames from '../../utils/classnames';
7
- import FormCell from '../form/formcell';
8
+
8
9
  import { getCloudInstance, getTempFileURL } from '../../utils/tcb';
9
10
  import {
10
11
  message,
@@ -149,6 +150,7 @@ export default function RichText({
149
150
  }
150
151
  }}
151
152
  excludeControls={['media', 'fullscreen']}
153
+ /** @ts-ignore */
152
154
  extendControls={extendControls}
153
155
  handleKeyCommand={(command, editState) => {
154
156
  const newState = ContentUtils.handleKeyCommand(
@@ -194,6 +196,7 @@ export const CustomUploader = (props) => {
194
196
  const getBase64 = (file) => {
195
197
  const reader = new FileReader();
196
198
  reader.onloadend = () => {
199
+ // @ts-ignore
197
200
  setState({ previewImg: reader.result });
198
201
  };
199
202
  reader.readAsDataURL(file);
@@ -0,0 +1,67 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import classNames from '../../utils/classnames';
3
+ import { getTempFileURL } from '../../utils/tcb';
4
+ import './index.css';
5
+ import { LOAD_ERR_IMG_BASE64 } from '../../utils/constant';
6
+ import { CommonPropsType } from '../../types';
7
+
8
+ export interface PropsType extends CommonPropsType {
9
+ value: string
10
+ }
11
+
12
+ export default function RichTextView({
13
+ value = '',
14
+ className,
15
+ style,
16
+ id
17
+ }: PropsType) {
18
+ let parseValue = value;
19
+ try {
20
+ parseValue = JSON.parse(value);
21
+ } catch (e) {}
22
+ const cls = classNames({
23
+ 'weda-ui': true,
24
+ 'weda-RichTextView': true,
25
+ [className]: className,
26
+ });
27
+ const [displayValue, setDisplayValue] = useState('');
28
+ const regex = new RegExp(/<img [^>]*src=\\*"([^"]*?)\\*"/g);
29
+ const iferror = `javascript:this.width='80';this.src='${LOAD_ERR_IMG_BASE64}';this.onerror=null`;
30
+
31
+ let tempValue = parseValue
32
+ .toString()
33
+ .replace(/<img /g, `<img onerror=${iferror} style="max-width:100%" `);
34
+
35
+ const getSrc = async (img) => {
36
+ const url = img.replace(regex, '$1');
37
+ if (img.includes('cloud://')) {
38
+ const newURL = await getTempFileURL(url);
39
+ if (newURL) {
40
+ tempValue = tempValue.replace(new RegExp(url, 'g'), newURL);
41
+ setDisplayValue(tempValue);
42
+ }
43
+ }
44
+ };
45
+
46
+ useEffect(() => {
47
+ setDisplayValue(tempValue);
48
+ try {
49
+ const imgs = parseValue.match(regex);
50
+ if (imgs && imgs.length > 0) {
51
+ imgs.forEach((img) => {
52
+ getSrc(img);
53
+ });
54
+ }
55
+ } catch (e) {}
56
+ }, [value]);
57
+
58
+ return (
59
+ displayValue && (
60
+ <div className={cls} style={style}
61
+ id={id}
62
+ >
63
+ <div dangerouslySetInnerHTML={{ __html: displayValue }}></div>
64
+ </div>
65
+ )
66
+ );
67
+ }
@@ -1,12 +1,22 @@
1
1
  import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
-
2
+ import { CommonPropsType } from '../../types';
4
3
  import classNames from '../../utils/classnames';
5
4
 
5
+ export interface PropsType extends CommonPropsType {
6
+ scrollX?: boolean;
7
+ scrollY?: boolean;
8
+ scrollTop?: number;
9
+ scrollLeft?: number;
10
+ scrollIntoView?: string;
11
+ upperThreshold?: number;
12
+ lowerThreshold?: number;
13
+ domRef?: any;
14
+ }
15
+
6
16
  export default function ScrollView({
7
17
  id,
8
- scrollY,
9
- scrollX,
18
+ scrollX = false,
19
+ scrollY = true,
10
20
  style,
11
21
  scrollTop,
12
22
  scrollLeft,
@@ -23,7 +33,7 @@ export default function ScrollView({
23
33
  const [scrollLeftPos, setScrollLeftPos] = React.useState(0);
24
34
  const [scrollTopPos, setScrollTopPos] = React.useState(0);
25
35
 
26
- const scrollViewRef = domRef || React.useRef(null);
36
+ const scrollViewRef = domRef || React.useRef<HTMLElement>(null);
27
37
 
28
38
  const handleOnScroll = function (e) {
29
39
  const detail = {
@@ -35,7 +45,6 @@ export default function ScrollView({
35
45
  const deltaY = scrollY ? e.target.scrollTop - scrollTopPos : 0;
36
46
  const deltaX = scrollX ? e.target.scrollLeft - scrollLeftPos : 0;
37
47
  let delta;
38
- // console.log(">>>>", deltaY, deltaX,e.target.scrollLeft,e.target.scrollTop)
39
48
  // 横向滚动
40
49
  if (Math.abs(deltaX) > Math.abs(deltaY)) {
41
50
  delta = deltaX;
@@ -101,8 +110,8 @@ export default function ScrollView({
101
110
  React.useEffect(() => {
102
111
  if (scrollIntoView) {
103
112
  const children = scrollViewRef.current.children;
104
- const item = Array.from(children).find(
105
- (item) => item && item.id === scrollIntoView
113
+ const item: any = Array.from(children).find(
114
+ (item: any) => item && item.id === scrollIntoView
106
115
  );
107
116
  scrollY && (scrollViewRef.current.scrollTop = item.offsetTop);
108
117
  scrollX && (scrollViewRef.current.scrollLeft = item.offsetLeft);
@@ -136,28 +145,4 @@ export default function ScrollView({
136
145
  {children}
137
146
  </div>
138
147
  );
139
- }
140
-
141
- ScrollView.propTypes = {
142
- scrollX: PropTypes.bool,
143
- scrollY: PropTypes.bool,
144
- scrollTop: PropTypes.number,
145
- scrollLeft: PropTypes.number,
146
- scrollIntoView: PropTypes.string,
147
- upperThreshold: PropTypes.number,
148
- lowerThreshold: PropTypes.number,
149
- domRef: PropTypes.any,
150
- children: PropTypes.any,
151
- id: PropTypes.string,
152
- className: PropTypes.string,
153
- style: PropTypes.string,
154
- events: PropTypes.objectOf(PropTypes.func),
155
- };
156
-
157
- ScrollView.defaultProps = {
158
- scrollX: false,
159
- scrollY: true,
160
- upperThreshold: 50,
161
- lowerThreshold: 50,
162
- events: {},
163
- };
148
+ }
@@ -1,7 +1,12 @@
1
1
  import * as React from 'react';
2
- import * as PropTypes from 'prop-types';
3
2
 
4
- export default function Slot({ compositeParent, name, className }) {
3
+ export interface PropsType {
4
+ className?: string,
5
+ name: string,
6
+ compositeParent: any
7
+
8
+ }
9
+ export default function Slot({ compositeParent, name, className }: PropsType) {
5
10
  if (!compositeParent) {
6
11
  console.warn('Slot组件只能用于实现复合组件');
7
12
  // 兼容编辑器点击,可选中 Slot 组件
@@ -12,10 +17,4 @@ export default function Slot({ compositeParent, name, className }) {
12
17
  );
13
18
  }
14
19
  return compositeParent.props.data[name] || null;
15
- }
16
-
17
- Slot.propTypes = {
18
- className: PropTypes.string,
19
- name: PropTypes.string,
20
- compositeParent: PropTypes.any,
21
- };
20
+ }
@@ -35,7 +35,7 @@
35
35
  height: 100%;
36
36
  }
37
37
 
38
- .g-swiper-item > * {
38
+ .g-swiper-item > div > * {
39
39
  width: 100%;
40
40
  height: auto;
41
41
  max-width: 100%;