@mpxjs/webpack-plugin 2.10.16-beta.10 → 2.10.16-beta.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/lib/runtime/components/react/dist/mpx-input.d.ts.map +1 -1
- package/lib/runtime/components/react/dist/mpx-input.jsx +3 -1
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts +10 -0
- package/lib/runtime/components/react/dist/mpx-swiper.d.ts.map +1 -1
- package/lib/runtime/components/react/dist/mpx-swiper.jsx +26 -16
- package/lib/runtime/components/react/mpx-input.tsx +6 -1
- package/lib/runtime/components/react/mpx-swiper.tsx +41 -15
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mpx-input.d.ts","sourceRoot":"","sources":["../mpx-input.tsx"],"names":[],"mappings":";AAwCA,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,mCAAmC,EACnC,SAAS,EACT,iCAAiC,EACjC,uBAAuB,EAEvB,+BAA+B,EAEhC,MAAM,cAAc,CAAA;AAIrB,OAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAIvD,KAAK,UAAU,GAAG,IAAI,CACpB,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EAClD,iBAAiB,GACjB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,sBAAsB,GACtB,yBAAyB,GACzB,wBAAwB,CAC3B,CAAA;AAED,KAAK,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;AAElD,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAA;AAExE,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CA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AC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,2BAA2B,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;IACtF,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;IAClF,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;IACjF,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,+BAA+B,GAAG,0BAA0B,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;IACzH,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,iCAAiC,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;CACvG;AAED,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,oBAAoB,CAAC,mCAAmC,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;CACpG;AAED,KAAK,eAAe,GAAG,UAAU,GAAG,iBAAiB,CAAA;AASrD,QAAA,MAAM,KAAK,mJA6YT,CAAA;AAIF,eAAe,KAAK,CAAA"}
|
|
@@ -82,7 +82,9 @@ const Input = forwardRef((props, ref) => {
|
|
|
82
82
|
const [contentHeight, setContentHeight] = useState(0);
|
|
83
83
|
const [selection, setSelection] = useState({ start: -1, end: tmpValue.current.length });
|
|
84
84
|
const styleObj = extendObject({ padding: 0, backgroundColor: '#fff' }, style, multiline && autoHeight
|
|
85
|
-
? { height: 'auto',
|
|
85
|
+
? extendObject({ height: 'auto' }, style?.minHeight
|
|
86
|
+
? { minHeight: style?.minHeight } // 用户设置了 minHeight 才会透传
|
|
87
|
+
: {})
|
|
86
88
|
: {});
|
|
87
89
|
const { hasPositionFixed, hasSelfPercent, normalStyle, setWidth, setHeight } = useTransformStyle(styleObj, { enableVar, externalVarContext, parentFontSize, parentWidth, parentHeight });
|
|
88
90
|
const nodeRef = useRef(null);
|
|
@@ -5,6 +5,11 @@ import { GestureHandler } from './utils';
|
|
|
5
5
|
/**
|
|
6
6
|
* ✔ indicator-dots
|
|
7
7
|
* ✔ indicator-color
|
|
8
|
+
* ✔ indicator-width
|
|
9
|
+
* ✔ indicator-height
|
|
10
|
+
* ✔ indicator-radius
|
|
11
|
+
* ✔ indicator-spacing
|
|
12
|
+
* ✔ indicator-margin
|
|
8
13
|
* ✔ indicator-active-color
|
|
9
14
|
* ✔ autoplay
|
|
10
15
|
* ✔ current
|
|
@@ -29,6 +34,11 @@ interface SwiperProps {
|
|
|
29
34
|
scale?: boolean;
|
|
30
35
|
'indicator-dots'?: boolean;
|
|
31
36
|
'indicator-color'?: string;
|
|
37
|
+
'indicator-width'?: number;
|
|
38
|
+
'indicator-height'?: number;
|
|
39
|
+
'indicator-spacing'?: number;
|
|
40
|
+
'indicator-radius'?: number;
|
|
41
|
+
'indicator-margin'?: number;
|
|
32
42
|
'indicator-active-color'?: string;
|
|
33
43
|
vertical?: boolean;
|
|
34
44
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mpx-swiper.d.ts","sourceRoot":"","sources":["../mpx-swiper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAqB,MAAM,cAAc,CAAA;AAI5E,OAAO,KAAK,EAAE,EAAsC,SAAS,EAAwC,MAAM,OAAO,CAAA;AAElH,OAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,EAAoF,cAAc,EAAmC,MAAM,SAAS,CAAA;AAG3J
|
|
1
|
+
{"version":3,"file":"mpx-swiper.d.ts","sourceRoot":"","sources":["../mpx-swiper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE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C,EAAE,MAAM,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5C,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAA;IAClC,uBAAuB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAA;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,UAAU,CAAC,GAAG,OAAO,KAAK,IAAI,CAAA;CACzE;AA0DD,QAAA,MAAM,aAAa,mGA2wBjB,CAAA;AAGF,eAAe,aAAa,CAAA"}
|
|
@@ -13,23 +13,23 @@ import Portal from './mpx-portal';
|
|
|
13
13
|
const styles = {
|
|
14
14
|
pagination_x: {
|
|
15
15
|
position: 'absolute',
|
|
16
|
-
bottom:
|
|
16
|
+
bottom: 0,
|
|
17
17
|
left: 0,
|
|
18
18
|
right: 0,
|
|
19
19
|
flexDirection: 'row',
|
|
20
20
|
flex: 1,
|
|
21
21
|
justifyContent: 'center',
|
|
22
|
-
alignItems: '
|
|
22
|
+
alignItems: 'flex-end'
|
|
23
23
|
},
|
|
24
24
|
pagination_y: {
|
|
25
25
|
position: 'absolute',
|
|
26
|
-
right:
|
|
26
|
+
right: 0,
|
|
27
27
|
top: 0,
|
|
28
28
|
bottom: 0,
|
|
29
29
|
flexDirection: 'column',
|
|
30
30
|
flex: 1,
|
|
31
31
|
justifyContent: 'center',
|
|
32
|
-
alignItems: '
|
|
32
|
+
alignItems: 'flex-end'
|
|
33
33
|
},
|
|
34
34
|
pagerWrapperx: {
|
|
35
35
|
position: 'absolute',
|
|
@@ -49,16 +49,6 @@ const styles = {
|
|
|
49
49
|
justifyContent: 'flex-start'
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
const dotCommonStyle = {
|
|
53
|
-
width: 8,
|
|
54
|
-
height: 8,
|
|
55
|
-
borderRadius: 4,
|
|
56
|
-
marginLeft: 3,
|
|
57
|
-
marginRight: 3,
|
|
58
|
-
marginTop: 3,
|
|
59
|
-
marginBottom: 3,
|
|
60
|
-
zIndex: 98
|
|
61
|
-
};
|
|
62
52
|
const activeDotStyle = {
|
|
63
53
|
zIndex: 99
|
|
64
54
|
};
|
|
@@ -71,7 +61,17 @@ const easeMap = {
|
|
|
71
61
|
easeInOutCubic: Easing.inOut(Easing.cubic)
|
|
72
62
|
};
|
|
73
63
|
const SwiperWrapper = forwardRef((props, ref) => {
|
|
74
|
-
const { 'indicator-dots': showPagination, 'indicator-color': dotColor = 'rgba(0, 0, 0, .3)', 'indicator-active-color': activeDotColor = '#000000', 'enable-var': enableVar = false, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'external-var-context': externalVarContext, 'simultaneous-handlers': originSimultaneousHandlers = [], 'wait-for': waitFor = [], style = {}, autoplay = false, circular = false, disableGesture = false, current: propCurrent, bindchange } = props;
|
|
64
|
+
const { 'indicator-dots': showPagination, 'indicator-color': dotColor = 'rgba(0, 0, 0, .3)', 'indicator-width': dotWidth = 8, 'indicator-height': dotHeight = 8, 'indicator-radius': dotRadius = 4, 'indicator-spacing': dotSpacing = 4, 'indicator-margin': paginationMargin = 10, 'indicator-active-color': activeDotColor = '#000000', 'enable-var': enableVar = false, 'parent-font-size': parentFontSize, 'parent-width': parentWidth, 'parent-height': parentHeight, 'external-var-context': externalVarContext, 'simultaneous-handlers': originSimultaneousHandlers = [], 'wait-for': waitFor = [], style = {}, autoplay = false, circular = false, disableGesture = false, current: propCurrent, bindchange } = props;
|
|
65
|
+
const dotCommonStyle = {
|
|
66
|
+
width: dotWidth,
|
|
67
|
+
height: dotHeight,
|
|
68
|
+
borderRadius: dotRadius,
|
|
69
|
+
marginLeft: dotSpacing,
|
|
70
|
+
marginRight: dotSpacing,
|
|
71
|
+
marginTop: dotSpacing,
|
|
72
|
+
marginBottom: dotSpacing,
|
|
73
|
+
zIndex: 98
|
|
74
|
+
};
|
|
75
75
|
const easeingFunc = props['easing-function'] || 'default';
|
|
76
76
|
const easeDuration = props.duration || 500;
|
|
77
77
|
const horizontal = props.vertical !== undefined ? !props.vertical : true;
|
|
@@ -193,7 +193,17 @@ const SwiperWrapper = forwardRef((props, ref) => {
|
|
|
193
193
|
for (let i = 0; i < children.length; i++) {
|
|
194
194
|
dots.push(<View style={[dotCommonStyle, { backgroundColor: unActionColor }]} key={i}></View>);
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
let paginationStyle = styles['pagination_' + dir];
|
|
197
|
+
if (paginationMargin) {
|
|
198
|
+
paginationStyle = {
|
|
199
|
+
...paginationStyle,
|
|
200
|
+
marginBottom: paginationMargin,
|
|
201
|
+
marginLeft: paginationMargin,
|
|
202
|
+
marginRight: paginationMargin,
|
|
203
|
+
marginTop: paginationMargin
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
return (<View pointerEvents="none" style={paginationStyle}>
|
|
197
207
|
<View style={[styles['pagerWrapper' + dir]]}>
|
|
198
208
|
<Animated.View style={[
|
|
199
209
|
dotCommonStyle,
|
|
@@ -200,7 +200,12 @@ const Input = forwardRef<HandlerRef<TextInput, FinalInputProps>, FinalInputProps
|
|
|
200
200
|
{ padding: 0, backgroundColor: '#fff' },
|
|
201
201
|
style,
|
|
202
202
|
multiline && autoHeight
|
|
203
|
-
?
|
|
203
|
+
? extendObject(
|
|
204
|
+
{ height: 'auto' },
|
|
205
|
+
(style as any)?.minHeight
|
|
206
|
+
? { minHeight: (style as any)?.minHeight } // 用户设置了 minHeight 才会透传
|
|
207
|
+
: {}
|
|
208
|
+
)
|
|
204
209
|
: {}
|
|
205
210
|
)
|
|
206
211
|
|
|
@@ -11,6 +11,11 @@ import Portal from './mpx-portal'
|
|
|
11
11
|
/**
|
|
12
12
|
* ✔ indicator-dots
|
|
13
13
|
* ✔ indicator-color
|
|
14
|
+
* ✔ indicator-width
|
|
15
|
+
* ✔ indicator-height
|
|
16
|
+
* ✔ indicator-radius
|
|
17
|
+
* ✔ indicator-spacing
|
|
18
|
+
* ✔ indicator-margin
|
|
14
19
|
* ✔ indicator-active-color
|
|
15
20
|
* ✔ autoplay
|
|
16
21
|
* ✔ current
|
|
@@ -46,6 +51,11 @@ interface SwiperProps {
|
|
|
46
51
|
scale?: boolean
|
|
47
52
|
'indicator-dots'?: boolean
|
|
48
53
|
'indicator-color'?: string
|
|
54
|
+
'indicator-width'?: number
|
|
55
|
+
'indicator-height'?: number
|
|
56
|
+
'indicator-spacing'?: number
|
|
57
|
+
'indicator-radius'?: number
|
|
58
|
+
'indicator-margin'?: number
|
|
49
59
|
'indicator-active-color'?: string
|
|
50
60
|
vertical?: boolean
|
|
51
61
|
style: {
|
|
@@ -72,23 +82,23 @@ interface SwiperProps {
|
|
|
72
82
|
const styles: { [key: string]: Object } = {
|
|
73
83
|
pagination_x: {
|
|
74
84
|
position: 'absolute',
|
|
75
|
-
bottom:
|
|
85
|
+
bottom: 0,
|
|
76
86
|
left: 0,
|
|
77
87
|
right: 0,
|
|
78
88
|
flexDirection: 'row',
|
|
79
89
|
flex: 1,
|
|
80
90
|
justifyContent: 'center',
|
|
81
|
-
alignItems: '
|
|
91
|
+
alignItems: 'flex-end'
|
|
82
92
|
},
|
|
83
93
|
pagination_y: {
|
|
84
94
|
position: 'absolute',
|
|
85
|
-
right:
|
|
95
|
+
right: 0,
|
|
86
96
|
top: 0,
|
|
87
97
|
bottom: 0,
|
|
88
98
|
flexDirection: 'column',
|
|
89
99
|
flex: 1,
|
|
90
100
|
justifyContent: 'center',
|
|
91
|
-
alignItems: '
|
|
101
|
+
alignItems: 'flex-end'
|
|
92
102
|
},
|
|
93
103
|
pagerWrapperx: {
|
|
94
104
|
position: 'absolute',
|
|
@@ -109,16 +119,6 @@ const styles: { [key: string]: Object } = {
|
|
|
109
119
|
}
|
|
110
120
|
}
|
|
111
121
|
|
|
112
|
-
const dotCommonStyle = {
|
|
113
|
-
width: 8,
|
|
114
|
-
height: 8,
|
|
115
|
-
borderRadius: 4,
|
|
116
|
-
marginLeft: 3,
|
|
117
|
-
marginRight: 3,
|
|
118
|
-
marginTop: 3,
|
|
119
|
-
marginBottom: 3,
|
|
120
|
-
zIndex: 98
|
|
121
|
-
}
|
|
122
122
|
const activeDotStyle = {
|
|
123
123
|
zIndex: 99
|
|
124
124
|
}
|
|
@@ -136,6 +136,11 @@ const SwiperWrapper = forwardRef<HandlerRef<View, SwiperProps>, SwiperProps>((pr
|
|
|
136
136
|
const {
|
|
137
137
|
'indicator-dots': showPagination,
|
|
138
138
|
'indicator-color': dotColor = 'rgba(0, 0, 0, .3)',
|
|
139
|
+
'indicator-width': dotWidth = 8,
|
|
140
|
+
'indicator-height': dotHeight = 8,
|
|
141
|
+
'indicator-radius': dotRadius = 4,
|
|
142
|
+
'indicator-spacing': dotSpacing = 4,
|
|
143
|
+
'indicator-margin': paginationMargin = 10,
|
|
139
144
|
'indicator-active-color': activeDotColor = '#000000',
|
|
140
145
|
'enable-var': enableVar = false,
|
|
141
146
|
'parent-font-size': parentFontSize,
|
|
@@ -151,6 +156,17 @@ const SwiperWrapper = forwardRef<HandlerRef<View, SwiperProps>, SwiperProps>((pr
|
|
|
151
156
|
current: propCurrent,
|
|
152
157
|
bindchange
|
|
153
158
|
} = props
|
|
159
|
+
|
|
160
|
+
const dotCommonStyle = {
|
|
161
|
+
width: dotWidth,
|
|
162
|
+
height: dotHeight,
|
|
163
|
+
borderRadius: dotRadius,
|
|
164
|
+
marginLeft: dotSpacing,
|
|
165
|
+
marginRight: dotSpacing,
|
|
166
|
+
marginTop: dotSpacing,
|
|
167
|
+
marginBottom: dotSpacing,
|
|
168
|
+
zIndex: 98
|
|
169
|
+
}
|
|
154
170
|
const easeingFunc = props['easing-function'] || 'default'
|
|
155
171
|
const easeDuration = props.duration || 500
|
|
156
172
|
const horizontal = props.vertical !== undefined ? !props.vertical : true
|
|
@@ -294,8 +310,18 @@ const SwiperWrapper = forwardRef<HandlerRef<View, SwiperProps>, SwiperProps>((pr
|
|
|
294
310
|
for (let i = 0; i < children.length; i++) {
|
|
295
311
|
dots.push(<View style={[dotCommonStyle, { backgroundColor: unActionColor }]} key={i}></View>)
|
|
296
312
|
}
|
|
313
|
+
let paginationStyle = styles['pagination_' + dir]
|
|
314
|
+
if (paginationMargin) {
|
|
315
|
+
paginationStyle = {
|
|
316
|
+
...paginationStyle,
|
|
317
|
+
marginBottom: paginationMargin,
|
|
318
|
+
marginLeft: paginationMargin,
|
|
319
|
+
marginRight: paginationMargin,
|
|
320
|
+
marginTop: paginationMargin
|
|
321
|
+
}
|
|
322
|
+
}
|
|
297
323
|
return (
|
|
298
|
-
<View pointerEvents="none" style={
|
|
324
|
+
<View pointerEvents="none" style={paginationStyle}>
|
|
299
325
|
<View style={[styles['pagerWrapper' + dir]]}>
|
|
300
326
|
<Animated.View style={[
|
|
301
327
|
dotCommonStyle,
|