react-native-package-fast 0.1.0 → 0.1.2
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/package.json +7 -156
- package/src/module/cores/ButtonApp.js +44 -0
- package/src/module/cores/DeviceUtils.js +1 -27
- package/src/module/cores/TextApp.js +6 -103
- package/src/module/cores/Utils.js +277 -0
- package/src/module/cores/ViewApp.js +19 -0
- package/src/module/index.js +3 -1
- package/src/typescript/cores/ButtonApp.d.ts +5 -0
- package/src/typescript/cores/DeviceUtils.d.ts +4 -0
- package/src/typescript/cores/TextApp.d.ts +5 -0
- package/src/typescript/cores/Utils.d.ts +214 -0
- package/src/typescript/cores/ViewApp.d.ts +5 -0
- package/src/typescript/index.d.ts +6 -0
- package/README.md +0 -31
- package/lib/commonjs/cores/DeviceUtils.js +0 -48
- package/lib/commonjs/cores/DeviceUtils.js.map +0 -1
- package/lib/commonjs/cores/TextApp.js +0 -126
- package/lib/commonjs/cores/TextApp.js.map +0 -1
- package/lib/commonjs/index.js +0 -21
- package/lib/commonjs/index.js.map +0 -1
- package/lib/module/cores/DeviceUtils.js +0 -39
- package/lib/module/cores/DeviceUtils.js.map +0 -1
- package/lib/module/cores/TextApp.js +0 -118
- package/lib/module/cores/TextApp.js.map +0 -1
- package/lib/module/index.js +0 -4
- package/lib/module/index.js.map +0 -1
- package/lib/typescript/cores/DeviceUtils.d.ts +0 -5
- package/lib/typescript/cores/DeviceUtils.d.ts.map +0 -1
- package/lib/typescript/cores/TextApp.d.ts +0 -26
- package/lib/typescript/cores/TextApp.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -4
- package/lib/typescript/index.d.ts.map +0 -1
- package/src/cores/DeviceUtils.d.ts +0 -5
- package/src/cores/DeviceUtils.d.ts.map +0 -1
- package/src/cores/TextApp.d.ts +0 -26
- package/src/cores/TextApp.d.ts.map +0 -1
- package/src/index.d.ts +0 -4
- package/src/index.d.ts.map +0 -1
- package/src/module/cores/DeviceUtils.js.map +0 -1
- package/src/module/cores/TextApp.js.map +0 -1
- package/src/module/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,162 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-package-fast",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "test",
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
7
|
-
"types": "lib/typescript/index.d.ts",
|
|
8
|
-
"react-native": "src/index",
|
|
9
|
-
"source": "src/index",
|
|
10
|
-
"files": [
|
|
11
|
-
"src",
|
|
12
|
-
"lib",
|
|
13
|
-
"android",
|
|
14
|
-
"ios",
|
|
15
|
-
"cpp",
|
|
16
|
-
"*.podspec",
|
|
17
|
-
"!lib/typescript/example",
|
|
18
|
-
"!ios/build",
|
|
19
|
-
"!android/build",
|
|
20
|
-
"!android/gradle",
|
|
21
|
-
"!android/gradlew",
|
|
22
|
-
"!android/gradlew.bat",
|
|
23
|
-
"!android/local.properties",
|
|
24
|
-
"!**/__tests__",
|
|
25
|
-
"!**/__fixtures__",
|
|
26
|
-
"!**/__mocks__",
|
|
27
|
-
"!**/.*"
|
|
28
|
-
],
|
|
5
|
+
"main": "./src/module/index.js",
|
|
6
|
+
"types": "./src/typescript/index.d.ts",
|
|
29
7
|
"scripts": {
|
|
30
|
-
"test": "
|
|
31
|
-
"typecheck": "tsc --noEmit",
|
|
32
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
33
|
-
"prepack": "bob build",
|
|
34
|
-
"release": "release-it",
|
|
35
|
-
"example": "yarn --cwd example",
|
|
36
|
-
"bootstrap": "yarn example && yarn install",
|
|
37
|
-
"build:dev": "babel src -d dist --copy-files",
|
|
38
|
-
"build:min": "BABEL_ENV=minify babel src -d dist --out-file-extension .min.js",
|
|
39
|
-
"build": "npm run build:dev && npm run build:min",
|
|
40
|
-
"android": "react-native run-android",
|
|
41
|
-
"ios": "react-native run-ios",
|
|
42
|
-
"all": "rm -rf package-lock.json && rm -rf node_modules/ && rm -fr $TMPDIR/metro* && npm install",
|
|
43
|
-
"add:core": "npm install --save git+https://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:x-oauth-basic@github.com/dungctt101/dd-libs-core.git",
|
|
44
|
-
"move:plat": "node -e 'require(\"./build.js\").moveLibToPlatform()'",
|
|
45
|
-
"move:public": "node -e 'require(\"./build.js\").moveLibToPublic()'",
|
|
46
|
-
"remove:map": "node -e 'require(\"./build.js\").removeAllFileMap()'",
|
|
47
|
-
"up:core": "node -e 'require(\"./build.js\").removeFileBuild()' && bob build &&node -e 'require(\"./build.js\").removeAllFileMap()' && node -e 'require(\"./build.js\").moveLibToPublic()' && node -e 'require(\"./build.js\").moveLibToPlatform()'",
|
|
48
|
-
"pub": "cd ../BUILDS",
|
|
49
|
-
"test1": " cd ./src/libs/core && bash publish.sh",
|
|
50
|
-
"build:ios": "react-native bundle --platform ios --dev false --entry-file index.js --bundle-output build/output/ios/ios/main.jsbundle --assets-dest build/output/ios/ios",
|
|
51
|
-
"build:ios:dev": "yarn build:ios && node -e 'require(\"./build.js\").zipBuild()'",
|
|
52
|
-
"build:and":"react-native bundle --platform android --dev false --entry-file index.js --bundle-output build/output/android/android/main.jsbundle --assets-dest build/output/android/android",
|
|
53
|
-
"build:android:dev": "yarn build:and && node -e 'require(\"./build.js\").zipBuildAndroid()'",
|
|
54
|
-
"build:all": "yarn build:ios:dev && yarn build:android:dev",
|
|
55
|
-
"reload": "node reload.js",
|
|
56
|
-
"start": "react-native start --port 2003 --reset-cache",
|
|
57
|
-
"start:pack": "react-native webpack-start --webpackConfig webpack.config.js --port 2003",
|
|
58
|
-
"lib":"node -e 'require(\"./build.js\").preBuild()' && bob build &&node -e 'require(\"./build.js\").lastBuild()'"
|
|
8
|
+
"test": "test1"
|
|
59
9
|
},
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"android"
|
|
64
|
-
],
|
|
65
|
-
"repository": "https://github.com/",
|
|
66
|
-
"author": "dung.dang1 <tiendung221992@gmail.com> (https://github.com/)",
|
|
67
|
-
"license": "MIT",
|
|
68
|
-
"bugs": {
|
|
69
|
-
"url": "https://github.com//issues"
|
|
70
|
-
},
|
|
71
|
-
"homepage": "https://github.com/#readme",
|
|
72
|
-
"publishConfig": {
|
|
73
|
-
"registry": "https://registry.npmjs.org/"
|
|
74
|
-
},
|
|
75
|
-
"devDependencies": {
|
|
76
|
-
"@commitlint/config-conventional": "^17.0.2",
|
|
77
|
-
"@react-native-community/eslint-config": "^3.0.2",
|
|
78
|
-
"@release-it/conventional-changelog": "^5.0.0",
|
|
79
|
-
"@types/jest": "^28.1.2",
|
|
80
|
-
"@types/react": "~17.0.21",
|
|
81
|
-
"@types/react-native": "0.70.0",
|
|
82
|
-
"commitlint": "^17.0.2",
|
|
83
|
-
"del-cli": "^5.0.0",
|
|
84
|
-
"eslint": "^8.4.1",
|
|
85
|
-
"eslint-config-prettier": "^8.5.0",
|
|
86
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
87
|
-
"jest": "^28.1.1",
|
|
88
|
-
"pod-install": "^0.1.0",
|
|
89
|
-
"prettier": "^2.0.5",
|
|
90
|
-
"react": "18.2.0",
|
|
91
|
-
"react-native": "0.71.7",
|
|
92
|
-
"react-native-builder-bob": "^0.20.4",
|
|
93
|
-
"typescript": "^4.5.2"
|
|
94
|
-
},
|
|
95
|
-
"resolutions": {
|
|
96
|
-
"@types/react": "17.0.21"
|
|
97
|
-
},
|
|
98
|
-
"peerDependencies": {
|
|
99
|
-
"react": "*",
|
|
100
|
-
"react-native": "*"
|
|
101
|
-
},
|
|
102
|
-
"engines": {
|
|
103
|
-
"node": ">= 16.0.0"
|
|
104
|
-
},
|
|
105
|
-
"packageManager": "^yarn@1.22.15",
|
|
106
|
-
"jest": {
|
|
107
|
-
"preset": "react-native",
|
|
108
|
-
"modulePathIgnorePatterns": [
|
|
109
|
-
"<rootDir>/example/node_modules",
|
|
110
|
-
"<rootDir>/lib/"
|
|
111
|
-
]
|
|
112
|
-
},
|
|
113
|
-
"commitlint": {
|
|
114
|
-
"extends": [
|
|
115
|
-
"@commitlint/config-conventional"
|
|
116
|
-
]
|
|
117
|
-
},
|
|
118
|
-
"eslintConfig": {
|
|
119
|
-
"root": true,
|
|
120
|
-
"extends": [
|
|
121
|
-
"@react-native-community",
|
|
122
|
-
"prettier"
|
|
123
|
-
],
|
|
124
|
-
"rules": {
|
|
125
|
-
"prettier/prettier": [
|
|
126
|
-
"error",
|
|
127
|
-
{
|
|
128
|
-
"quoteProps": "consistent",
|
|
129
|
-
"singleQuote": true,
|
|
130
|
-
"tabWidth": 1,
|
|
131
|
-
"trailingComma": "es5",
|
|
132
|
-
"useTabs": false
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"eslintIgnore": [
|
|
138
|
-
"node_modules/",
|
|
139
|
-
"lib/"
|
|
140
|
-
],
|
|
141
|
-
"prettier": {
|
|
142
|
-
"quoteProps": "consistent",
|
|
143
|
-
"singleQuote": true,
|
|
144
|
-
"tabWidth": 1,
|
|
145
|
-
"trailingComma": "es5",
|
|
146
|
-
"useTabs": false
|
|
147
|
-
},
|
|
148
|
-
"react-native-builder-bob": {
|
|
149
|
-
"source": "sources",
|
|
150
|
-
"output": "lib",
|
|
151
|
-
"targets": [
|
|
152
|
-
"commonjs",
|
|
153
|
-
"module",
|
|
154
|
-
[
|
|
155
|
-
"typescript",
|
|
156
|
-
{
|
|
157
|
-
"project": "tsconfig.build.json"
|
|
158
|
-
}
|
|
159
|
-
]
|
|
160
|
-
]
|
|
161
|
-
}
|
|
10
|
+
"author": "dung.dang",
|
|
11
|
+
"license": "ISC"
|
|
12
|
+
|
|
162
13
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TouchableOpacity } from 'react-native';
|
|
4
|
+
import TextApp from './TextApp';
|
|
5
|
+
import { ButtonAppStyles, parseStyles } from './Utils';
|
|
6
|
+
const ButtonApp = props => {
|
|
7
|
+
const {
|
|
8
|
+
title,
|
|
9
|
+
children,
|
|
10
|
+
propsText,
|
|
11
|
+
normal,
|
|
12
|
+
disable,
|
|
13
|
+
whiteNormal
|
|
14
|
+
} = props;
|
|
15
|
+
let _propsText = propsText;
|
|
16
|
+
let styleAll = parseStyles({
|
|
17
|
+
passStyle: ['flex', 'width', 'height'],
|
|
18
|
+
styles: ButtonAppStyles,
|
|
19
|
+
props
|
|
20
|
+
});
|
|
21
|
+
if (normal || whiteNormal) {
|
|
22
|
+
_propsText = {
|
|
23
|
+
..._propsText,
|
|
24
|
+
h3: true,
|
|
25
|
+
black: true
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (disable) {
|
|
29
|
+
_propsText = {
|
|
30
|
+
..._propsText,
|
|
31
|
+
h3: true,
|
|
32
|
+
style: {
|
|
33
|
+
color: '#686868'
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({
|
|
38
|
+
disabled: disable
|
|
39
|
+
}, props, {
|
|
40
|
+
style: styleAll
|
|
41
|
+
}), /*#__PURE__*/React.createElement(TextApp, _propsText, title || children));
|
|
42
|
+
};
|
|
43
|
+
export default ButtonApp;
|
|
44
|
+
//# sourceMappingURL=ButtonApp.js.map
|
|
@@ -3,37 +3,11 @@ const {
|
|
|
3
3
|
width: widthScreen,
|
|
4
4
|
height: heightScreen
|
|
5
5
|
} = Dimensions.get('window');
|
|
6
|
-
const parseStyles = _ref => {
|
|
7
|
-
var _Object$keys;
|
|
8
|
-
let {
|
|
9
|
-
passStyle,
|
|
10
|
-
styles,
|
|
11
|
-
props
|
|
12
|
-
} = _ref;
|
|
13
|
-
let styleAll = (styles === null || styles === void 0 ? void 0 : styles.default) || {};
|
|
14
|
-
(_Object$keys = Object.keys(props)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(_item => {
|
|
15
|
-
if (passStyle !== null && passStyle !== void 0 && passStyle.includes(_item)) {
|
|
16
|
-
styleAll = {
|
|
17
|
-
...styleAll,
|
|
18
|
-
[_item]: props === null || props === void 0 ? void 0 : props[_item]
|
|
19
|
-
};
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (Object.keys(styles).includes(_item) && props !== null && props !== void 0 && props[_item]) {
|
|
23
|
-
styleAll = {
|
|
24
|
-
...styleAll,
|
|
25
|
-
...(styles === null || styles === void 0 ? void 0 : styles[_item])
|
|
26
|
-
};
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
return styleAll;
|
|
31
|
-
};
|
|
32
6
|
const RFValueHorizontal = function (fontSize) {
|
|
33
7
|
let standardScreenHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 375;
|
|
34
8
|
const heightPercent = Math.round(fontSize * widthScreen / standardScreenHeight);
|
|
35
9
|
return heightPercent > fontSize + 5 ? fontSize + 5 : heightPercent;
|
|
36
10
|
};
|
|
37
11
|
export const ScaleSize = RFValueHorizontal;
|
|
38
|
-
export { widthScreen, heightScreen
|
|
12
|
+
export { widthScreen, heightScreen };
|
|
39
13
|
//# sourceMappingURL=DeviceUtils.js.map
|
|
@@ -1,118 +1,21 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import { StyleSheet, Text } from 'react-native';
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import {
|
|
3
|
+
import { Text } from 'react-native';
|
|
4
|
+
import { parseStyles } from './Utils';
|
|
5
|
+
import { TextAppStyles } from './Utils';
|
|
5
6
|
const TextApp = props => {
|
|
6
|
-
var _newTitle$toLocaleUpp;
|
|
7
7
|
const {
|
|
8
8
|
title,
|
|
9
|
-
children
|
|
10
|
-
upper
|
|
9
|
+
children
|
|
11
10
|
} = props;
|
|
12
11
|
let styleAll = parseStyles({
|
|
13
12
|
passStyle: ['flex', 'width', 'height'],
|
|
14
|
-
styles,
|
|
13
|
+
styles: TextAppStyles,
|
|
15
14
|
props
|
|
16
15
|
});
|
|
17
|
-
//_STYLE_OTHER
|
|
18
|
-
|
|
19
|
-
const newTitle = title || children;
|
|
20
|
-
if (!newTitle && newTitle === '') return null;
|
|
21
16
|
return /*#__PURE__*/React.createElement(Text, _extends({}, props, {
|
|
22
17
|
style: styleAll
|
|
23
|
-
}),
|
|
18
|
+
}), title || children);
|
|
24
19
|
};
|
|
25
|
-
const styles = StyleSheet.create({
|
|
26
|
-
'default': {
|
|
27
|
-
fontSize: ScaleSize(14),
|
|
28
|
-
lineHeight: ScaleSize(16)
|
|
29
|
-
},
|
|
30
|
-
'black': {
|
|
31
|
-
color: '#000000'
|
|
32
|
-
},
|
|
33
|
-
'grey': {
|
|
34
|
-
color: '#00000080'
|
|
35
|
-
},
|
|
36
|
-
'white': {
|
|
37
|
-
color: '#FFFFFF'
|
|
38
|
-
},
|
|
39
|
-
'border': {
|
|
40
|
-
textShadowColor: '#FFFFFF',
|
|
41
|
-
textShadowOffset: {
|
|
42
|
-
width: ScaleSize(1),
|
|
43
|
-
height: ScaleSize(1)
|
|
44
|
-
},
|
|
45
|
-
textShadowRadius: ScaleSize(0)
|
|
46
|
-
},
|
|
47
|
-
'line': {
|
|
48
|
-
textDecorationLine: 'underline'
|
|
49
|
-
},
|
|
50
|
-
'body': {
|
|
51
|
-
marginLeft: 4,
|
|
52
|
-
fontSize: 14,
|
|
53
|
-
fontWeight: '500',
|
|
54
|
-
color: '#969696'
|
|
55
|
-
},
|
|
56
|
-
'border-bl': {
|
|
57
|
-
textShadowColor: '#000000',
|
|
58
|
-
textShadowOffset: {
|
|
59
|
-
width: ScaleSize(2),
|
|
60
|
-
height: ScaleSize(2)
|
|
61
|
-
},
|
|
62
|
-
textShadowRadius: ScaleSize(2)
|
|
63
|
-
},
|
|
64
|
-
'b1': {
|
|
65
|
-
fontSize: ScaleSize(56),
|
|
66
|
-
lineHeight: ScaleSize(58)
|
|
67
|
-
},
|
|
68
|
-
'b5': {
|
|
69
|
-
fontSize: ScaleSize(26),
|
|
70
|
-
lineHeight: ScaleSize(28)
|
|
71
|
-
},
|
|
72
|
-
'h1': {
|
|
73
|
-
fontSize: ScaleSize(20),
|
|
74
|
-
lineHeight: ScaleSize(22)
|
|
75
|
-
},
|
|
76
|
-
'h2': {
|
|
77
|
-
fontSize: ScaleSize(18),
|
|
78
|
-
lineHeight: ScaleSize(20)
|
|
79
|
-
},
|
|
80
|
-
'h3': {
|
|
81
|
-
fontSize: ScaleSize(16),
|
|
82
|
-
lineHeight: ScaleSize(18)
|
|
83
|
-
},
|
|
84
|
-
'h4': {
|
|
85
|
-
fontSize: ScaleSize(14),
|
|
86
|
-
lineHeight: ScaleSize(16)
|
|
87
|
-
},
|
|
88
|
-
'h5': {
|
|
89
|
-
fontSize: ScaleSize(12),
|
|
90
|
-
lineHeight: ScaleSize(14)
|
|
91
|
-
},
|
|
92
|
-
'h6': {
|
|
93
|
-
fontSize: ScaleSize(10),
|
|
94
|
-
lineHeight: ScaleSize(12)
|
|
95
|
-
},
|
|
96
|
-
'h7': {
|
|
97
|
-
fontSize: ScaleSize(9),
|
|
98
|
-
lineHeight: ScaleSize(11)
|
|
99
|
-
},
|
|
100
|
-
'bold': {
|
|
101
|
-
fontWeight: 'bold'
|
|
102
|
-
},
|
|
103
|
-
'thin': {
|
|
104
|
-
fontWeight: '100'
|
|
105
|
-
},
|
|
106
|
-
'medium': {
|
|
107
|
-
fontWeight: '300'
|
|
108
|
-
},
|
|
109
|
-
'center': {
|
|
110
|
-
textAlign: 'center',
|
|
111
|
-
textAlignVertical: 'center'
|
|
112
|
-
},
|
|
113
|
-
'left': {
|
|
114
|
-
textAlign: 'left'
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
20
|
export default TextApp;
|
|
118
21
|
//# sourceMappingURL=TextApp.js.map
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { ScaleSize } from './DeviceUtils';
|
|
3
|
+
const colors = {
|
|
4
|
+
orange: '#EE780C',
|
|
5
|
+
yellow: '#FEBD00',
|
|
6
|
+
grey: '#9C9C9C',
|
|
7
|
+
black: '#303030',
|
|
8
|
+
white: '#ffffff'
|
|
9
|
+
};
|
|
10
|
+
const numStyles = [{
|
|
11
|
+
key: 'padding-',
|
|
12
|
+
func: value => ({
|
|
13
|
+
padding: ScaleSize(value)
|
|
14
|
+
})
|
|
15
|
+
}, {
|
|
16
|
+
key: 'hoz-',
|
|
17
|
+
func: value => ({
|
|
18
|
+
paddingHorizontal: ScaleSize(value)
|
|
19
|
+
})
|
|
20
|
+
}, {
|
|
21
|
+
key: 'ver-',
|
|
22
|
+
func: value => ({
|
|
23
|
+
paddingVertical: ScaleSize(value)
|
|
24
|
+
})
|
|
25
|
+
}, {
|
|
26
|
+
key: 'top-',
|
|
27
|
+
func: value => ({
|
|
28
|
+
paddingTop: ScaleSize(value)
|
|
29
|
+
})
|
|
30
|
+
}, {
|
|
31
|
+
key: 'bot-',
|
|
32
|
+
func: value => ({
|
|
33
|
+
paddingBottom: ScaleSize(value)
|
|
34
|
+
})
|
|
35
|
+
}, {
|
|
36
|
+
key: 'left-',
|
|
37
|
+
func: value => ({
|
|
38
|
+
paddingLeft: ScaleSize(value)
|
|
39
|
+
})
|
|
40
|
+
}, {
|
|
41
|
+
key: 'right-',
|
|
42
|
+
func: value => ({
|
|
43
|
+
paddingRight: ScaleSize(value)
|
|
44
|
+
})
|
|
45
|
+
}, {
|
|
46
|
+
key: 'margin-',
|
|
47
|
+
func: value => ({
|
|
48
|
+
margin: ScaleSize(value)
|
|
49
|
+
})
|
|
50
|
+
}, {
|
|
51
|
+
key: 'Hoz-',
|
|
52
|
+
func: value => ({
|
|
53
|
+
marginHorizontal: ScaleSize(value)
|
|
54
|
+
})
|
|
55
|
+
}, {
|
|
56
|
+
key: 'Ver-',
|
|
57
|
+
func: value => ({
|
|
58
|
+
marginVertical: ScaleSize(value)
|
|
59
|
+
})
|
|
60
|
+
}, {
|
|
61
|
+
key: 'Top-',
|
|
62
|
+
func: value => ({
|
|
63
|
+
marginTop: ScaleSize(value)
|
|
64
|
+
})
|
|
65
|
+
}, {
|
|
66
|
+
key: 'Bot-',
|
|
67
|
+
func: value => ({
|
|
68
|
+
marginBottom: ScaleSize(value)
|
|
69
|
+
})
|
|
70
|
+
}, {
|
|
71
|
+
key: 'Left-',
|
|
72
|
+
func: value => ({
|
|
73
|
+
marginLeft: ScaleSize(value)
|
|
74
|
+
})
|
|
75
|
+
}, {
|
|
76
|
+
key: 'Right-',
|
|
77
|
+
func: value => ({
|
|
78
|
+
marginRight: ScaleSize(value)
|
|
79
|
+
})
|
|
80
|
+
}, {
|
|
81
|
+
key: 'radius-',
|
|
82
|
+
func: value => {
|
|
83
|
+
return {
|
|
84
|
+
borderRadius: ScaleSize(value)
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
key: 'ads-',
|
|
89
|
+
func: value => {
|
|
90
|
+
return {
|
|
91
|
+
position: 'absolute',
|
|
92
|
+
top: ScaleSize(value)
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
key: 'border-',
|
|
97
|
+
func: value => {
|
|
98
|
+
return {
|
|
99
|
+
borderWidth: ScaleSize(value)
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}];
|
|
103
|
+
export const parseStyles = _ref => {
|
|
104
|
+
var _Object$keys;
|
|
105
|
+
let {
|
|
106
|
+
passStyle,
|
|
107
|
+
styles,
|
|
108
|
+
props
|
|
109
|
+
} = _ref;
|
|
110
|
+
let styleAll = (styles === null || styles === void 0 ? void 0 : styles.default) || {};
|
|
111
|
+
(_Object$keys = Object.keys(props)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(_item => {
|
|
112
|
+
if (passStyle !== null && passStyle !== void 0 && passStyle.includes(_item)) {
|
|
113
|
+
styleAll = {
|
|
114
|
+
...styleAll,
|
|
115
|
+
[_item]: props === null || props === void 0 ? void 0 : props[_item]
|
|
116
|
+
};
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (Object.keys(styles).includes(_item) && props !== null && props !== void 0 && props[_item]) {
|
|
120
|
+
styleAll = {
|
|
121
|
+
...styleAll,
|
|
122
|
+
...(styles === null || styles === void 0 ? void 0 : styles[_item])
|
|
123
|
+
};
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const numFind = numStyles.find(_value => _item === null || _item === void 0 ? void 0 : _item.includes(_value === null || _value === void 0 ? void 0 : _value.key));
|
|
127
|
+
if (numFind) {
|
|
128
|
+
const num = _item === null || _item === void 0 ? void 0 : _item.replace(numFind === null || numFind === void 0 ? void 0 : numFind.key, '');
|
|
129
|
+
if (parseInt !== null && parseInt !== void 0 && parseInt(num, 10)) {
|
|
130
|
+
styleAll = {
|
|
131
|
+
...styleAll,
|
|
132
|
+
...(numFind === null || numFind === void 0 ? void 0 : numFind.func(num))
|
|
133
|
+
};
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
...styleAll,
|
|
140
|
+
...(props === null || props === void 0 ? void 0 : props.style)
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
const CommonStyles = StyleSheet.create({
|
|
144
|
+
topLeft: {
|
|
145
|
+
position: 'absolute',
|
|
146
|
+
top: 0,
|
|
147
|
+
left: 0
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
export const ViewAppStyles = StyleSheet.create({
|
|
151
|
+
...CommonStyles,
|
|
152
|
+
Black: {
|
|
153
|
+
backgroundColor: colors.black
|
|
154
|
+
},
|
|
155
|
+
Grey: {
|
|
156
|
+
backgroundColor: colors.grey
|
|
157
|
+
},
|
|
158
|
+
White: {
|
|
159
|
+
backgroundColor: colors.white
|
|
160
|
+
},
|
|
161
|
+
Yellow: {
|
|
162
|
+
backgroundColor: colors.yellow
|
|
163
|
+
},
|
|
164
|
+
row: {
|
|
165
|
+
flexDirection: 'row'
|
|
166
|
+
},
|
|
167
|
+
wrap: {
|
|
168
|
+
flexWrap: 'wrap'
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
export const TextAppStyles = StyleSheet.create({
|
|
172
|
+
...CommonStyles,
|
|
173
|
+
//size
|
|
174
|
+
h1: {
|
|
175
|
+
fontSize: ScaleSize(20),
|
|
176
|
+
lineHeight: ScaleSize(26)
|
|
177
|
+
},
|
|
178
|
+
h2: {
|
|
179
|
+
fontSize: ScaleSize(18),
|
|
180
|
+
lineHeight: ScaleSize(24)
|
|
181
|
+
},
|
|
182
|
+
h3: {
|
|
183
|
+
fontSize: ScaleSize(16),
|
|
184
|
+
lineHeight: ScaleSize(22)
|
|
185
|
+
},
|
|
186
|
+
h4: {
|
|
187
|
+
fontSize: ScaleSize(14),
|
|
188
|
+
lineHeight: ScaleSize(20)
|
|
189
|
+
},
|
|
190
|
+
h5: {
|
|
191
|
+
fontSize: ScaleSize(12),
|
|
192
|
+
lineHeight: ScaleSize(18)
|
|
193
|
+
},
|
|
194
|
+
h6: {
|
|
195
|
+
fontSize: ScaleSize(10),
|
|
196
|
+
lineHeight: ScaleSize(16)
|
|
197
|
+
},
|
|
198
|
+
h7: {
|
|
199
|
+
fontSize: ScaleSize(9),
|
|
200
|
+
lineHeight: ScaleSize(15)
|
|
201
|
+
},
|
|
202
|
+
header: {
|
|
203
|
+
fontSize: ScaleSize(24),
|
|
204
|
+
lineHeight: ScaleSize(33)
|
|
205
|
+
},
|
|
206
|
+
//color
|
|
207
|
+
black: {
|
|
208
|
+
color: colors.black
|
|
209
|
+
},
|
|
210
|
+
grey: {
|
|
211
|
+
color: colors.grey
|
|
212
|
+
},
|
|
213
|
+
yellow: {
|
|
214
|
+
color: colors.yellow
|
|
215
|
+
},
|
|
216
|
+
white: {
|
|
217
|
+
color: colors.white
|
|
218
|
+
},
|
|
219
|
+
orange: {
|
|
220
|
+
color: colors.orange
|
|
221
|
+
},
|
|
222
|
+
//weight
|
|
223
|
+
bold: {
|
|
224
|
+
fontWeight: 'bold'
|
|
225
|
+
},
|
|
226
|
+
thin: {
|
|
227
|
+
fontWeight: '100'
|
|
228
|
+
},
|
|
229
|
+
medium: {
|
|
230
|
+
fontWeight: '500'
|
|
231
|
+
},
|
|
232
|
+
//style
|
|
233
|
+
line: {
|
|
234
|
+
textDecorationLine: 'underline'
|
|
235
|
+
},
|
|
236
|
+
center: {
|
|
237
|
+
textAlign: 'center',
|
|
238
|
+
textAlignVertical: 'center'
|
|
239
|
+
},
|
|
240
|
+
left: {
|
|
241
|
+
textAlign: 'left'
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
export const ButtonAppStyles = StyleSheet.create({
|
|
245
|
+
...ViewAppStyles,
|
|
246
|
+
normal: {
|
|
247
|
+
paddingVertical: 10,
|
|
248
|
+
alignItems: 'center',
|
|
249
|
+
justifyContent: 'center',
|
|
250
|
+
backgroundColor: colors.yellow,
|
|
251
|
+
borderRadius: 5
|
|
252
|
+
},
|
|
253
|
+
yellowSmall: {
|
|
254
|
+
paddingVertical: 7,
|
|
255
|
+
alignItems: 'center',
|
|
256
|
+
justifyContent: 'center',
|
|
257
|
+
backgroundColor: colors.yellow,
|
|
258
|
+
borderRadius: 50
|
|
259
|
+
},
|
|
260
|
+
whiteNormal: {
|
|
261
|
+
paddingVertical: 10,
|
|
262
|
+
alignItems: 'center',
|
|
263
|
+
justifyContent: 'center',
|
|
264
|
+
// backgroundColor: colors.white,
|
|
265
|
+
borderWidth: 1,
|
|
266
|
+
borderColor: colors.grey,
|
|
267
|
+
borderRadius: 5
|
|
268
|
+
},
|
|
269
|
+
disable: {
|
|
270
|
+
paddingVertical: 10,
|
|
271
|
+
alignItems: 'center',
|
|
272
|
+
justifyContent: 'center',
|
|
273
|
+
backgroundColor: '#D1D1D1',
|
|
274
|
+
borderRadius: 5
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
//# sourceMappingURL=Utils.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { ViewAppStyles, parseStyles } from './Utils';
|
|
5
|
+
const ViewApp = props => {
|
|
6
|
+
const {
|
|
7
|
+
children
|
|
8
|
+
} = props;
|
|
9
|
+
let styleAll = parseStyles({
|
|
10
|
+
passStyle: ['flex', 'width', 'height'],
|
|
11
|
+
styles: ViewAppStyles,
|
|
12
|
+
props
|
|
13
|
+
});
|
|
14
|
+
return /*#__PURE__*/React.createElement(View, _extends({}, props, {
|
|
15
|
+
style: styleAll
|
|
16
|
+
}), children);
|
|
17
|
+
};
|
|
18
|
+
export default ViewApp;
|
|
19
|
+
//# sourceMappingURL=ViewApp.js.map
|
package/src/module/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import TextApp from './cores/TextApp';
|
|
2
|
+
import ViewApp from './cores/ViewApp';
|
|
3
|
+
import ButtonApp from './cores/ButtonApp';
|
|
2
4
|
import { ScaleSize } from './cores/DeviceUtils';
|
|
3
|
-
export { TextApp, ScaleSize };
|
|
5
|
+
export { TextApp, ScaleSize, ButtonApp, ViewApp };
|
|
4
6
|
//# sourceMappingURL=index.js.map
|