Skip to content

Commit b4c56f9

Browse files
committed
uploader-rn
1 parent e64463c commit b4c56f9

File tree

12 files changed

+116
-27
lines changed

12 files changed

+116
-27
lines changed

components/uploader/demo/basic.md

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ const UploaderExample = React.createClass({
5454
files2,
5555
});
5656
}}
57-
maxUpload={4}
5857
files={this.state.files2}
5958
/>
6059
</div>

components/uploader/index.web.tsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ import classNames from 'classnames';
55
import WingBlank from '../wing-blank';
66
import Flex from '../flex';
77
import Toast from '../toast';
8-
function noop() { }
8+
import UploaderProps from './uploaderPropTypes';
99

10-
export interface UploaderProps {
11-
prefixCls?: string;
12-
style?: React.CSSProperties;
13-
files?: Array<{}>;
14-
onChange?: Function;
15-
}
10+
function noop() { }
1611

1712
export default class Uploader extends React.Component<UploaderProps, any> {
1813
static propTypes = {

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ export { default as TextAreaItem } from './components/textarea-item/';
2323
export { default as Timeline } from './components/timeline/';
2424
export { default as Toast } from './components/toast/';
2525
export { default as TopNotice } from './components/top-notice/';
26+
export { default as Uploader } from './components/uploader/';
2627
export { default as WhiteSpace } from './components/white-space/';
2728
export { default as WingBlank } from './components/wing-blank/';

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@
5252
"rc-slider": "~3.8.0",
5353
"rc-steps": "~2.1.5",
5454
"rc-swipeout": "~1.1.1",
55-
"rc-tabs": "~5.9.2",
5655
"rc-table": "~4.4.0",
56+
"rc-tabs": "~5.9.2",
5757
"rc-tooltip": "~3.4.2",
5858
"react-hammerjs": "^0.4.6",
59+
"react-native-camera-roll-picker": "^1.1.6",
5960
"react-native-drawer-layout": "~1.0.0",
6061
"react-native-menu": "~0.20.1",
6162
"react-slick": "~0.12.2",

rn-kitchen-sink/demoList.js

+6
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ module.exports = {
152152
icon: 'https://os.alipayobjects.com/rmsportal/AraRKTSdXQbKkGv.png',
153153
module: require('../components/top-notice/demo/basic'), // 必须
154154
},
155+
{
156+
title: 'Uploader', // 必须
157+
description: 'Uploader Example',
158+
icon: 'https://os.alipayobjects.com/rmsportal/CVHyVxhFqkhZfYs.png',
159+
module: require('../components/uploader/demo/basic'), // 必须
160+
},
155161
{
156162
title: 'WhiteSpace', // 必须
157163
description: 'WhiteSpace Example',

rn-kitchen-sink/ios/antm.xcodeproj/project.pbxproj

+32
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
932801361D12865300A90AF1 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 932800F61D1285D000A90AF1 /* libReact.a */; };
2424
936A047B1D267BFB005EE7C1 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 936A047A1D267BB0005EE7C1 /* libCodePush.a */; };
2525
936A047D1D267C03005EE7C1 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 936A047C1D267C03005EE7C1 /* libz.tbd */; };
26+
93735FCF1D44E0D700B29FD8 /* libRCTCameraRoll.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 93BF62B91D44DF2400AFA3D0 /* libRCTCameraRoll.a */; };
2627
93ABB6081D2A301C00652A63 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93ABB6071D2A301C00652A63 /* HomeViewController.m */; };
2728
93ABB6211D2A3DF100652A63 /* ScanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93ABB6201D2A3DF100652A63 /* ScanViewController.m */; };
2829
93ABB6241D2A3E2600652A63 /* ResultViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93ABB6231D2A3E2600652A63 /* ResultViewController.m */; };
@@ -107,6 +108,13 @@
107108
remoteGlobalIDString = 134814201AA4EA6300B7C361;
108109
remoteInfo = CodePush;
109110
};
111+
93BF62B81D44DF2400AFA3D0 /* PBXContainerItemProxy */ = {
112+
isa = PBXContainerItemProxy;
113+
containerPortal = 93BF62B21D44DF2400AFA3D0 /* RCTCameraRoll.xcodeproj */;
114+
proxyType = 2;
115+
remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
116+
remoteInfo = RCTCameraRoll;
117+
};
110118
/* End PBXContainerItemProxy section */
111119

112120
/* Begin PBXFileReference section */
@@ -136,6 +144,7 @@
136144
93ABB6221D2A3E2600652A63 /* ResultViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ResultViewController.h; path = antm/ResultViewController.h; sourceTree = "<group>"; };
137145
93ABB6231D2A3E2600652A63 /* ResultViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ResultViewController.m; path = antm/ResultViewController.m; sourceTree = "<group>"; };
138146
93ABB6251D2A430B00652A63 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
147+
93BF62B21D44DF2400AFA3D0 /* RCTCameraRoll.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTCameraRoll.xcodeproj; path = "../../node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj"; sourceTree = "<group>"; };
139148
/* End PBXFileReference section */
140149

141150
/* Begin PBXFrameworksBuildPhase section */
@@ -156,6 +165,7 @@
156165
932801351D12865300A90AF1 /* libRCTWebSocket.a in Frameworks */,
157166
932801361D12865300A90AF1 /* libReact.a in Frameworks */,
158167
936A047B1D267BFB005EE7C1 /* libCodePush.a in Frameworks */,
168+
93735FCF1D44E0D700B29FD8 /* libRCTCameraRoll.a in Frameworks */,
159169
);
160170
runOnlyForDeploymentPostprocessing = 0;
161171
};
@@ -184,6 +194,7 @@
184194
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
185195
isa = PBXGroup;
186196
children = (
197+
93BF62B21D44DF2400AFA3D0 /* RCTCameraRoll.xcodeproj */,
187198
936A04751D267BB0005EE7C1 /* CodePush.xcodeproj */,
188199
932800F11D1285D000A90AF1 /* React.xcodeproj */,
189200
932800F71D1285E400A90AF1 /* RCTActionSheet.xcodeproj */,
@@ -308,6 +319,14 @@
308319
name = Products;
309320
sourceTree = "<group>";
310321
};
322+
93BF62B31D44DF2400AFA3D0 /* Products */ = {
323+
isa = PBXGroup;
324+
children = (
325+
93BF62B91D44DF2400AFA3D0 /* libRCTCameraRoll.a */,
326+
);
327+
name = Products;
328+
sourceTree = "<group>";
329+
};
311330
/* End PBXGroup section */
312331

313332
/* Begin PBXNativeTarget section */
@@ -357,6 +376,10 @@
357376
ProductGroup = 932800F81D1285E400A90AF1 /* Products */;
358377
ProjectRef = 932800F71D1285E400A90AF1 /* RCTActionSheet.xcodeproj */;
359378
},
379+
{
380+
ProductGroup = 93BF62B31D44DF2400AFA3D0 /* Products */;
381+
ProjectRef = 93BF62B21D44DF2400AFA3D0 /* RCTCameraRoll.xcodeproj */;
382+
},
360383
{
361384
ProductGroup = 932800FE1D1285ED00A90AF1 /* Products */;
362385
ProjectRef = 932800FD1D1285ED00A90AF1 /* RCTGeolocation.xcodeproj */;
@@ -479,6 +502,13 @@
479502
remoteRef = 936A04791D267BB0005EE7C1 /* PBXContainerItemProxy */;
480503
sourceTree = BUILT_PRODUCTS_DIR;
481504
};
505+
93BF62B91D44DF2400AFA3D0 /* libRCTCameraRoll.a */ = {
506+
isa = PBXReferenceProxy;
507+
fileType = archive.ar;
508+
path = libRCTCameraRoll.a;
509+
remoteRef = 93BF62B81D44DF2400AFA3D0 /* PBXContainerItemProxy */;
510+
sourceTree = BUILT_PRODUCTS_DIR;
511+
};
482512
/* End PBXReferenceProxy section */
483513

484514
/* Begin PBXResourcesBuildPhase section */
@@ -547,6 +577,7 @@
547577
);
548578
PRODUCT_BUNDLE_IDENTIFIER = com.mybank.ios.RNPlayground;
549579
PRODUCT_NAME = antm;
580+
PROVISIONING_PROFILE = "a8097e9a-687b-42ee-9af9-826171343137";
550581
};
551582
name = Debug;
552583
};
@@ -575,6 +606,7 @@
575606
);
576607
PRODUCT_BUNDLE_IDENTIFIER = com.mybank.ios.RNPlayground;
577608
PRODUCT_NAME = antm;
609+
PROVISIONING_PROFILE = "a8097e9a-687b-42ee-9af9-826171343137";
578610
};
579611
name = Release;
580612
};

typings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"globalDependencies": {
3-
"react": "registry:dt/react#0.14.0+20160630100702",
3+
"react": "registry:dt/react#0.14.0+20160720060442",
44
"react-dom": "registry:dt/react-dom#0.14.0+20160412154040",
5-
"react-native": "registry:dt/react-native#0.27.0+20160619030006"
5+
"react-native": "registry:dt/react-native#0.29.0+20160724063008"
66
}
77
}

typings/globals/react-dom/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ declare module "react-dom" {
6767
declare module "react-dom/server" {
6868
import DOMServer = __React.__DOMServer;
6969
export = DOMServer;
70-
}
70+
}

typings/globals/react-native/index.d.ts

+61-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Generated by typings
2-
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5a3d3f6fbdca6de33271dae7e4b4a56b0fe9ffe0/react-native/react-native.d.ts
2+
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/da7c99c73bcdeb64c1238d537740825efdc24b89/react-native/react-native.d.ts
33
import React = __React;
44

55
//react-native "extends" react
@@ -1722,6 +1722,41 @@ declare namespace __React {
17221722
}
17231723

17241724

1725+
/**
1726+
* @see https://facebook.github.io/react-native/docs/activityindicator.html#props
1727+
*/
1728+
export interface ActivityIndicatorProperties extends React.Props<ActivityIndicatorStatic> {
1729+
1730+
/**
1731+
* Whether to show the indicator (true, the default) or hide it (false).
1732+
*/
1733+
animating?: boolean
1734+
1735+
/**
1736+
* The foreground color of the spinner (default is gray).
1737+
*/
1738+
color?: string
1739+
1740+
/**
1741+
* Whether the indicator should hide when not animating (true by default).
1742+
*/
1743+
hidesWhenStopped?: boolean
1744+
1745+
/**
1746+
* Size of the indicator.
1747+
* Small has a height of 20, large has a height of 36.
1748+
*
1749+
* enum('small', 'large')
1750+
*/
1751+
size?: 'small' | 'large'
1752+
1753+
style?: ViewStyle
1754+
}
1755+
1756+
export interface ActivityIndicatorStatic extends React.ComponentClass<ActivityIndicatorProperties> {
1757+
}
1758+
1759+
17251760
/**
17261761
* @see https://facebook.github.io/react-native/docs/activityindicatorios.html#props
17271762
*/
@@ -1753,11 +1788,14 @@ declare namespace __React {
17531788
*
17541789
* enum('small', 'large')
17551790
*/
1756-
size?: string
1791+
size?: 'small' | 'large'
17571792

17581793
style?: ViewStyle
17591794
}
17601795

1796+
/**
1797+
* @Deprecated since version 0.28.0
1798+
*/
17611799
export interface ActivityIndicatorIOSStatic extends React.ComponentClass<ActivityIndicatorIOSProperties> {
17621800
}
17631801

@@ -3107,11 +3145,16 @@ declare namespace __React {
31073145

31083146
// see /NavigatorSceneConfigs.js
31093147
export interface SceneConfigs {
3110-
FloatFromBottom: SceneConfig;
3111-
FloatFromRight: SceneConfig;
31123148
PushFromRight: SceneConfig;
3149+
FloatFromRight: SceneConfig;
31133150
FloatFromLeft: SceneConfig;
3151+
FloatFromBottom: SceneConfig;
3152+
FloatFromBottomAndroid: SceneConfig;
3153+
FadeAndroid: SceneConfig;
31143154
HorizontalSwipeJump: SceneConfig;
3155+
HorizontalSwipeJumpFromRight: SceneConfig;
3156+
VerticalUpSwipeJump: SceneConfig;
3157+
VerticalDownSwipeJump: SceneConfig;
31153158
}
31163159

31173160
export interface Route {
@@ -3141,10 +3184,14 @@ declare namespace __React {
31413184
export interface NavigatorProperties extends React.Props<Navigator> {
31423185
/**
31433186
* Optional function that allows configuration about scene animations and gestures.
3144-
* Will be invoked with the route and should return a scene configuration object
3187+
* Will be invoked with `route` and `routeStack` parameters, where `route`
3188+
* corresponds to the current scene being rendered by the `Navigator` and
3189+
* `routeStack` is the set of currently mounted routes that the navigator
3190+
* could transition to. The function should return a scene configuration object.
31453191
* @param route
3192+
* @param routeStack
31463193
*/
3147-
configureScene?: ( route: Route ) => SceneConfig
3194+
configureScene?: ( route: Route, routeStack: Route[] ) => SceneConfig
31483195
/**
31493196
* Specify a route to start on.
31503197
* A route is an object that the navigator will use to identify each scene to render.
@@ -3509,6 +3556,11 @@ declare namespace __React {
35093556
* A Boolean value that indicates whether the tab bar is translucent
35103557
*/
35113558
translucent?: boolean
3559+
3560+
/**
3561+
* Color of text on unselected tabs
3562+
*/
3563+
unselectedTintColor?: string
35123564
}
35133565

35143566
export interface TabBarIOSStatic extends React.ComponentClass<TabBarIOSProperties> {
@@ -5557,6 +5609,8 @@ declare namespace __React {
55575609

55585610
// export var AppRegistry: AppRegistryStatic;
55595611

5612+
export var ActivityIndicator: ActivityIndicatorStatic
5613+
export type ActivityIndicator = ActivityIndicatorStatic
55605614

55615615
export var ActivityIndicatorIOS: ActivityIndicatorIOSStatic
55625616
export type ActivityIndicatorIOS = ActivityIndicatorIOSStatic
@@ -5808,4 +5862,4 @@ declare module "react-native" {
58085862

58095863
declare var global: __React.GlobalStatic
58105864

5811-
declare function require( name: string ): any
5865+
declare function require( name: string ): any
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"resolution": "main",
33
"tree": {
4-
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5a3d3f6fbdca6de33271dae7e4b4a56b0fe9ffe0/react-native/react-native.d.ts",
5-
"raw": "registry:dt/react-native#0.27.0+20160619030006",
6-
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5a3d3f6fbdca6de33271dae7e4b4a56b0fe9ffe0/react-native/react-native.d.ts"
4+
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/da7c99c73bcdeb64c1238d537740825efdc24b89/react-native/react-native.d.ts",
5+
"raw": "registry:dt/react-native#0.29.0+20160724063008",
6+
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/da7c99c73bcdeb64c1238d537740825efdc24b89/react-native/react-native.d.ts"
77
}
88
}

typings/globals/react/index.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Generated by typings
2-
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/402097684899fb9ff125e85638cc14499bb6e0a3/react/react.d.ts
2+
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/03cd162da057a9cbf653119982e12233ae2b90a6/react/react.d.ts
33
declare namespace __React {
44

55
//
@@ -2497,6 +2497,7 @@ declare namespace JSX {
24972497
image: React.SVGProps;
24982498
line: React.SVGProps;
24992499
linearGradient: React.SVGProps;
2500+
marker: React.SVGProps;
25002501
mask: React.SVGProps;
25012502
path: React.SVGProps;
25022503
pattern: React.SVGProps;
@@ -2510,4 +2511,4 @@ declare namespace JSX {
25102511
tspan: React.SVGProps;
25112512
use: React.SVGProps;
25122513
}
2513-
}
2514+
}

typings/globals/react/typings.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"resolution": "main",
33
"tree": {
4-
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/402097684899fb9ff125e85638cc14499bb6e0a3/react/react.d.ts",
5-
"raw": "registry:dt/react#0.14.0+20160630100702",
6-
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/402097684899fb9ff125e85638cc14499bb6e0a3/react/react.d.ts"
4+
"src": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/03cd162da057a9cbf653119982e12233ae2b90a6/react/react.d.ts",
5+
"raw": "registry:dt/react#0.14.0+20160720060442",
6+
"typings": "https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/03cd162da057a9cbf653119982e12233ae2b90a6/react/react.d.ts"
77
}
88
}

0 commit comments

Comments
 (0)