From c1202b5269f08d75a0e45538737deab0552ba0bf Mon Sep 17 00:00:00 2001 From: Jam Risser Date: Mon, 2 Jul 2018 20:42:30 +0530 Subject: [PATCH] Added lib to gitignore --- .gitignore | 2 + lib/Components/Base/NativeBaseComponent.js | 78 --- lib/Components/Themes/dark.js | 98 --- lib/Components/Themes/light.js | 192 ------ lib/Components/Widgets/Badge.js | 90 --- lib/Components/Widgets/Button.js | 214 ------ lib/Components/Widgets/Card.js | 97 --- lib/Components/Widgets/CardItem.js | 344 ---------- lib/Components/Widgets/CardSwiper.js | 155 ----- lib/Components/Widgets/Checkbox.js | 81 --- lib/Components/Widgets/Container.js | 200 ------ lib/Components/Widgets/Content.js | 77 --- lib/Components/Widgets/DeckSwiper.js | 193 ------ lib/Components/Widgets/Footer.js | 105 --- lib/Components/Widgets/H1.js | 75 --- lib/Components/Widgets/H2.js | 75 --- lib/Components/Widgets/H3.js | 75 --- lib/Components/Widgets/Header.js | 241 ------- lib/Components/Widgets/Icon.js | 113 ---- lib/Components/Widgets/Input.js | 84 --- lib/Components/Widgets/InputGroup.js | 251 ------- lib/Components/Widgets/List.js | 115 ---- lib/Components/Widgets/ListItem.js | 614 ------------------ lib/Components/Widgets/Picker.ios.js | 212 ------ lib/Components/Widgets/Picker.js | 83 --- lib/Components/Widgets/ProgressBar.android.js | 70 -- lib/Components/Widgets/ProgressBar.ios.js | 50 -- lib/Components/Widgets/Radio.js | 65 -- lib/Components/Widgets/Spinner.js | 67 -- lib/Components/Widgets/Subtitle.js | 58 -- lib/Components/Widgets/Switch.js | 70 -- lib/Components/Widgets/TabBarItem.js | 71 -- lib/Components/Widgets/Tabs.js | 118 ---- lib/Components/Widgets/Text.js | 75 --- lib/Components/Widgets/Textarea.js | 105 --- lib/Components/Widgets/Thumbnail.js | 90 --- lib/Components/Widgets/Title.js | 90 --- .../Widgets/TouchableOpacityScrollable.js | 124 ---- lib/Components/Widgets/View.js | 56 -- .../vendor/react-native-drawer/index.js | 583 ----------------- .../tween/tween-functions/index.js | 250 ------- .../vendor/react-native-drawer/tweener.js | 46 -- .../react-native-easy-grid/Components/Col.js | 68 -- .../react-native-easy-grid/Components/Grid.js | 86 --- .../react-native-easy-grid/Components/Row.js | 68 -- .../Utils/computeProps.js | 35 - .../vendor/react-native-easy-grid/index.js | 21 - .../DefaultTabBar.js | 134 ---- .../react-native-scrollable-tab-view/index.js | 171 ----- lib/Utils/computeProps.js | 64 -- lib/Utils/platform.js | 13 - lib/index.js | 185 ------ 52 files changed, 2 insertions(+), 6695 deletions(-) delete mode 100644 lib/Components/Base/NativeBaseComponent.js delete mode 100644 lib/Components/Themes/dark.js delete mode 100644 lib/Components/Themes/light.js delete mode 100644 lib/Components/Widgets/Badge.js delete mode 100644 lib/Components/Widgets/Button.js delete mode 100644 lib/Components/Widgets/Card.js delete mode 100644 lib/Components/Widgets/CardItem.js delete mode 100644 lib/Components/Widgets/CardSwiper.js delete mode 100644 lib/Components/Widgets/Checkbox.js delete mode 100644 lib/Components/Widgets/Container.js delete mode 100644 lib/Components/Widgets/Content.js delete mode 100644 lib/Components/Widgets/DeckSwiper.js delete mode 100644 lib/Components/Widgets/Footer.js delete mode 100644 lib/Components/Widgets/H1.js delete mode 100644 lib/Components/Widgets/H2.js delete mode 100644 lib/Components/Widgets/H3.js delete mode 100644 lib/Components/Widgets/Header.js delete mode 100644 lib/Components/Widgets/Icon.js delete mode 100644 lib/Components/Widgets/Input.js delete mode 100644 lib/Components/Widgets/InputGroup.js delete mode 100644 lib/Components/Widgets/List.js delete mode 100644 lib/Components/Widgets/ListItem.js delete mode 100644 lib/Components/Widgets/Picker.ios.js delete mode 100644 lib/Components/Widgets/Picker.js delete mode 100644 lib/Components/Widgets/ProgressBar.android.js delete mode 100644 lib/Components/Widgets/ProgressBar.ios.js delete mode 100644 lib/Components/Widgets/Radio.js delete mode 100644 lib/Components/Widgets/Spinner.js delete mode 100644 lib/Components/Widgets/Subtitle.js delete mode 100644 lib/Components/Widgets/Switch.js delete mode 100644 lib/Components/Widgets/TabBarItem.js delete mode 100644 lib/Components/Widgets/Tabs.js delete mode 100644 lib/Components/Widgets/Text.js delete mode 100644 lib/Components/Widgets/Textarea.js delete mode 100644 lib/Components/Widgets/Thumbnail.js delete mode 100644 lib/Components/Widgets/Title.js delete mode 100644 lib/Components/Widgets/TouchableOpacityScrollable.js delete mode 100644 lib/Components/Widgets/View.js delete mode 100644 lib/Components/vendor/react-native-drawer/index.js delete mode 100644 lib/Components/vendor/react-native-drawer/tween/tween-functions/index.js delete mode 100644 lib/Components/vendor/react-native-drawer/tweener.js delete mode 100644 lib/Components/vendor/react-native-easy-grid/Components/Col.js delete mode 100644 lib/Components/vendor/react-native-easy-grid/Components/Grid.js delete mode 100644 lib/Components/vendor/react-native-easy-grid/Components/Row.js delete mode 100644 lib/Components/vendor/react-native-easy-grid/Utils/computeProps.js delete mode 100644 lib/Components/vendor/react-native-easy-grid/index.js delete mode 100755 lib/Components/vendor/react-native-scrollable-tab-view/DefaultTabBar.js delete mode 100755 lib/Components/vendor/react-native-scrollable-tab-view/index.js delete mode 100644 lib/Utils/computeProps.js delete mode 100644 lib/Utils/platform.js delete mode 100644 lib/index.js diff --git a/.gitignore b/.gitignore index 763d3c28..a455d5fe 100644 --- a/.gitignore +++ b/.gitignore @@ -131,3 +131,5 @@ captures/ ### Android Patch ### gen-external-apklibs + +/lib diff --git a/lib/Components/Base/NativeBaseComponent.js b/lib/Components/Base/NativeBaseComponent.js deleted file mode 100644 index be9f3a95..00000000 --- a/lib/Components/Base/NativeBaseComponent.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _light = require('../Themes/light'); - -var _light2 = _interopRequireDefault(_light); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var NativeBaseComponent = function (_Component) { - _inherits(NativeBaseComponent, _Component); - - function NativeBaseComponent() { - _classCallCheck(this, NativeBaseComponent); - - return _possibleConstructorReturn(this, (NativeBaseComponent.__proto__ || Object.getPrototypeOf(NativeBaseComponent)).apply(this, arguments)); - } - - _createClass(NativeBaseComponent, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - theme: this.props.theme ? this.props.theme : this.getTheme(), - foregroundColor: this.props.foregroundColor ? this.props.foregroundColor : this.getTheme().textColor - }; - } - }, { - key: 'getContextForegroundColor', - value: function getContextForegroundColor() { - return this.context.foregroundColor; - } - }, { - key: 'getTheme', - value: function getTheme() { - var theme = this.props.theme ? this.props.theme : this.context.theme || _light2.default; - if (typeof theme == 'function') { - return theme(); - } else { - return theme; - } - } - }]); - - return NativeBaseComponent; -}(_react.Component); - -NativeBaseComponent.contextTypes = { - theme: _propTypes2.default.object, - foregroundColor: _propTypes2.default.string -}; -NativeBaseComponent.propTypes = { - theme: _propTypes2.default.object, - foregroundColor: _propTypes2.default.string -}; -NativeBaseComponent.childContextTypes = { - theme: _propTypes2.default.object, - foregroundColor: _propTypes2.default.string -}; -exports.default = NativeBaseComponent; \ No newline at end of file diff --git a/lib/Components/Themes/dark.js b/lib/Components/Themes/dark.js deleted file mode 100644 index e48d19ca..00000000 --- a/lib/Components/Themes/dark.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -var _multiplier = require('multiplier'); - -var _multiplier2 = _interopRequireDefault(_multiplier); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var fontSizeBase = 15; //import Color from 'color'; - -var borderRadiusBase = 4; -var contentPadding = 10; - -module.exports = { - brandPrimary: '#428bca', - brandInfo: '#5bc0de', - brandSuccess: '#5cb85c', - brandDanger: '#d9534f', - brandWarning: '#f0ad4e', - brandSidebar: '#252932', - - inverseTextColor: '#000', - textColor: '#fff', - - fontSizeBase: 15, - - get fontSizeH1() { - return (0, _multiplier2.default)(fontSizeBase, 1.8); - }, - get fontSizeH2() { - return (0, _multiplier2.default)(fontSizeBase, 1.6); - }, - get fontSizeH3() { - return (0, _multiplier2.default)(fontSizeBase, 1.4); - }, - get btnTextSize() { - return (0, _multiplier2.default)(fontSizeBase, 1.2); - }, - - borderRadiusBase: borderRadiusBase, - - get borderRadiusLarge() { - return (0, _multiplier2.default)(fontSizeBase, 5.8); - }, - - toolbarHeight: 70, - toolbarDefaultBg: '#505052', - toolbarInverseBg: '#222', - - get btnPrimaryBg() { - return this.brandPrimary; - }, - get btnPrimaryColor() { - return this.textColor; - }, - get btnSuccessBg() { - return this.brandSuccess; - }, - get btnSuccessColor() { - return this.textColor; - }, - get btnDangerBg() { - return this.brandDanger; - }, - get btnDangerColor() { - return this.textColor; - }, - get btnInfoBg() { - return this.brandInfo; - }, - get btnInfoColor() { - return this.textColor; - }, - get btnWarningBg() { - return this.brandWarning; - }, - get btnWarningColor() { - return this.textColor; - }, - - inputColor: '#fff', - inputBorderColor: '#fff', - inputHeightBase: 40, - inputGroupMarginBottom: 10, - inputColorPlaceholder: 'rgba(256,256,256,0.8)', - inputPaddingLeft: 5, - get inputPaddingLeftIcon() { - return (0, _multiplier2.default)(this.inputPaddingLeft, 8); - }, - - dropdownBg: '#fff', - dropdownLinkColor: '#414142', - - jumbotronPadding: 30, - jumbotronBg: '#C9C9CE', - - contentPadding: contentPadding -}; \ No newline at end of file diff --git a/lib/Components/Themes/light.js b/lib/Components/Themes/light.js deleted file mode 100644 index 9eb0f5f7..00000000 --- a/lib/Components/Themes/light.js +++ /dev/null @@ -1,192 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function () { - return { - brandPrimary: '#5067FF', - brandInfo: '#5bc0de', - brandSuccess: '#5cb85c', - brandDanger: '#d9534f', - brandWarning: '#f0ad4e', - brandSidebar: '#252932', - - fontFamily: _platform2.default.OS === 'ios' ? 'HelveticaNeue' : 'inherit', - btnFontFamily: _platform2.default.OS === 'ios' ? 'HelveticaNeue' : 'inherit', - iconFamily: 'Ionicons', - - inverseTextColor: '#fff', - textColor: '#000', - - subtitleColor: '#8e8e93', - - fontSizeBase: 15, - titleFontSize: _platform2.default.OS === 'ios' ? 17 : 19, - subTitleFontSize: _platform2.default.OS === 'ios' ? 12 : 14, - - inputFontSize: 15, - inputLineHeight: 24, - - get fontSizeH1() { - return this.fontSizeBase * 1.8; - }, - get fontSizeH2() { - return this.fontSizeBase * 1.6; - }, - get fontSizeH3() { - return this.fontSizeBase * 1.4; - }, - get btnTextSize() { - return _platform2.default.OS === 'ios' ? this.fontSizeBase * 1.1 : this.fontSizeBase - 1; - }, - get btnTextSizeLarge() { - return this.fontSizeBase * 1.5; - }, - get btnTextSizeSmall() { - return this.fontSizeBase * .8; - }, - get iconSizeLarge() { - return this.iconFontSize * 1.5; - }, - get iconSizeSmall() { - return this.iconFontSize * .6; - }, - - buttonPadding: 6, - - borderRadiusBase: _platform2.default.OS === 'ios' ? 5 : 2, - - get borderRadiusLarge() { - return this.fontSizeBase * 3.8; - }, - - footerHeight: 55, - toolbarHeight: _platform2.default.OS === 'ios' ? 50 : 56, - toolbarDefaultBg: _platform2.default.OS === 'ios' ? '#F8F8F8' : '#039BE5', - toolbarInverseBg: '#222', - - iosToolbarBtnColor: '#007aff', - - toolbarTextColor: _platform2.default.OS === 'ios' ? '#000' : '#fff', - - checkboxBgColor: '#039BE5', - checkboxTickColor: '#fff', - - checkboxSize: 23, - - radioColor: '#7e7e7e', - get radioSelectedColor() { - return (0, _color2.default)(this.radioColor).darken(0.2).hexString(); - }, - - radioBtnSize: _platform2.default.OS === 'ios' ? 25 : 23, - - tabBgColor: '#F8F8F8', - tabFontSize: 15, - tabTextColor: '#039BE5', - - btnDisabledBg: '#b5b5b5', - btnDisabledClr: '#f1f1f1', - - cardDefaultBg: '#fff', - - get darkenHeader() { - return (0, _color2.default)(this.tabBgColor).darken(0.03).hexString(); - }, - get btnPrimaryBg() { - return this.brandPrimary; - }, - get btnPrimaryColor() { - return this.inverseTextColor; - }, - get btnSuccessBg() { - return this.brandSuccess; - }, - get btnSuccessColor() { - return this.inverseTextColor; - }, - get btnDangerBg() { - return this.brandDanger; - }, - get btnDangerColor() { - return this.inverseTextColor; - }, - get btnInfoBg() { - return this.brandInfo; - }, - get btnInfoColor() { - return this.inverseTextColor; - }, - get btnWarningBg() { - return this.brandWarning; - }, - get btnWarningColor() { - return this.inverseTextColor; - }, - - borderWidth: 1, - iconMargin: 7, - - get inputColor() { - return this.textColor; - }, - get inputColorPlaceholder() { - return '#575757'; - }, - inputBorderColor: '#D9D5DC', - inputSuccessBorderColor: '#2b8339', - inputErrorBorderColor: '#ed2f2f', - inputHeightBase: 40, - inputGroupMarginBottom: 10, - inputPaddingLeft: 5, - get inputPaddingLeftIcon() { - return this.inputPaddingLeft * 8; - }, - - btnLineHeight: 19, - - dropdownBg: '#000', - dropdownLinkColor: '#414142', - - jumbotronPadding: 30, - jumbotronBg: '#C9C9CE', - - contentPadding: 10, - - listBorderColor: '#ddd', - listDividerBg: '#ddd', - listItemPadding: 9, - listNoteColor: '#808080', - listNoteSize: 13, - - iconFontSize: _platform2.default.OS === 'ios' ? 30 : 28, - - badgeColor: '#fff', - badgeBg: '#ED1727', - - lineHeight: _platform2.default.OS === 'ios' ? 20 : 24, - iconLineHeight: _platform2.default.OS === 'ios' ? 37 : 30, - - toolbarIconSize: _platform2.default.OS === 'ios' ? 20 : 22, - - toolbarInputColor: '#CECDD2', - - defaultSpinnerColor: '#45D56E', - inverseSpinnerColor: '#1A191B', - - defaultProgressColor: '#E4202D', - inverseProgressColor: '#1A191B' - }; -}; - -var _color = require('color'); - -var _color2 = _interopRequireDefault(_color); - -var _platform = require('../../Utils/platform'); - -var _platform2 = _interopRequireDefault(_platform); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/lib/Components/Widgets/Badge.js b/lib/Components/Widgets/Badge.js deleted file mode 100644 index 33156f03..00000000 --- a/lib/Components/Widgets/Badge.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _Text = require('./Text'); - -var _Text2 = _interopRequireDefault(_Text); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var BadgeNB = function (_NativeBaseComponent) { - _inherits(BadgeNB, _NativeBaseComponent); - - function BadgeNB() { - _classCallCheck(this, BadgeNB); - - return _possibleConstructorReturn(this, (BadgeNB.__proto__ || Object.getPrototypeOf(BadgeNB)).apply(this, arguments)); - } - - _createClass(BadgeNB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - - backgroundColor: this.props.primary ? this.getTheme().brandPrimary : this.props.success ? this.getTheme().brandSuccess : this.props.info ? this.getTheme().brandInfo : this.props.warning ? this.getTheme().brandWarning : this.props.danger ? this.getTheme().brandDanger : this.getTheme().badgeBg, - padding: 3, - paddingHorizontal: 10, - alignSelf: 'flex-start', - borderRadius: 13.5, - height: 27 - - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.View, - this.prepareRootProps(), - _react2.default.createElement( - _Text2.default, - { style: { color: this.props.textStyle && this.props.textStyle.color ? this.props.textStyle.color : this.getTheme().badgeColor, - fontSize: this.getTheme().fontSizeBase, - lineHeight: this.getTheme().lineHeight - 1, - textAlign: 'center' } }, - this.props.children - ) - ); - } - }]); - - return BadgeNB; -}(_NativeBaseComponent3.default); - -exports.default = BadgeNB; \ No newline at end of file diff --git a/lib/Components/Widgets/Button.js b/lib/Components/Widgets/Button.js deleted file mode 100644 index 79473803..00000000 --- a/lib/Components/Widgets/Button.js +++ /dev/null @@ -1,214 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _platform = require('../../Utils/platform'); - -var _platform2 = _interopRequireDefault(_platform); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _Icon = require('./Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -var _Text = require('./Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Button = function (_NativeBaseComponent) { - _inherits(Button, _NativeBaseComponent); - - function Button() { - _classCallCheck(this, Button); - - return _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).apply(this, arguments)); - } - - _createClass(Button, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - button: { - paddingVertical: this.getTheme().buttonPadding, - paddingHorizontal: this.getTheme().buttonPadding + 2, - justifyContent: this.props.block ? 'center' : 'space-around', - flexDirection: 'row', - alignSelf: 'center', - alignItems: 'center', - backgroundColor: this.getTheme().btnPrimaryBg - //elevation: (this.props.transparent || this.props.bordered) ? 0 : 4, - //shadowColor: (this.props.transparent || this.props.bordered) ? undefined : '#000', - //shadowOffset: (this.props.transparent || this.props.bordered) ? undefined : {width: 0, height: 2}, - //shadowOpacity: (this.props.transparent || this.props.bordered) ? undefined : 0.2, - //shadowRadius: (this.props.transparent || this.props.bordered) ? undefined : 2 - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - backgroundColor: this.props.primary ? this.getTheme().btnPrimaryBg : this.props.transparent || this.props.bordered ? 'rgba(0,0,0,0)' : this.props.success ? this.getTheme().btnSuccessBg : this.props.danger ? this.getTheme().btnDangerBg : this.props.warning ? this.getTheme().btnWarningBg : this.props.info ? this.getTheme().btnInfoBg : this.props.backgroundColor ? this.props.backgroundColor : this.props.disabled ? this.getTheme().btnDisabledBg : this.getInitialStyle().button.backgroundColor, - borderRadius: this.props.rounded ? this.getTheme().borderRadiusLarge : this.getTheme().borderRadiusBase, - borderWidth: this.props.bordered ? 1 : 0, - borderColor: this.props.primary ? this.getTheme().primary : this.props.success ? this.getTheme().btnSuccessBg : this.props.danger ? this.getTheme().btnDangerBg : this.props.warning ? this.getTheme().btnWarningBg : this.props.info ? this.getTheme().btnInfoBg : this.getInitialStyle().button.backgroundColor, - height: this.props.large ? 60 : this.props.small ? 35 : 38, - alignSelf: this.props.block ? 'stretch' : 'flex-start' - }; - - var addedProps = _lodash2.default.merge(this.getInitialStyle().button, type); - - var defaultProps = { - style: addedProps - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'getTextStyle', - value: function getTextStyle() { - - var mergedStyle = {}; - var btnType = { - fontFamily: this.getTheme().btnFontFamily, - marginLeft: this.iconPresent() && !this.props.iconRight ? this.getTheme().iconMargin : 0, - marginRight: this.iconPresent() && this.props.iconRight ? this.getTheme().iconMargin : 0, - color: this.props.bordered && this.props.primary ? this.getTheme().btnPrimaryBg : this.props.bordered && this.props.success ? this.getTheme().btnSuccessBg : this.props.bordered && this.props.danger ? this.getTheme().btnDangerBg : this.props.bordered && this.props.warning ? this.getTheme().btnWarningBg : this.props.bordered && this.props.info ? this.getTheme().btnInfoBg : this.props.bordered ? this.getTheme().btnPrimaryBg : this.props.color ? this.props.color : this.props.transparent ? this.getContextForegroundColor() : this.getTheme().inverseTextColor, - - fontSize: this.props.large ? this.getTheme().btnTextSizeLarge : this.props.small ? this.getTheme().btnTextSizeSmall : this.getTheme().btnTextSize, - - lineHeight: this.props.large ? 29 : this.props.small ? 16 : this.getTheme().btnLineHeight, - - 'flex': 1, - justifyContent: 'center', - alignItems: 'center' - }; - - return _lodash2.default.merge(mergedStyle, btnType, this.props.textStyle); - } - }, { - key: 'getIconProps', - value: function getIconProps(icon) { - - var defaultStyle = { - color: this.props.bordered && this.props.primary ? this.getTheme().btnPrimaryBg : this.props.bordered && this.props.success ? this.getTheme().btnSuccessBg : this.props.bordered && this.props.danger ? this.getTheme().btnDangerBg : this.props.bordered && this.props.warning ? this.getTheme().btnWarningBg : this.props.bordered && this.props.info ? this.getTheme().btnInfoBg : this.props.bordered ? this.getTheme().btnPrimaryBg : this.props.color ? this.props.color : this.props.header ? this.getTheme().toolbarTextColor : this.props.transparent ? this.getContextForegroundColor() : this.getTheme().inverseTextColor, - - fontSize: this.props.large ? this.getTheme().iconSizeLarge : this.props.small ? this.getTheme().iconSizeSmall : this.props.inputButton ? this.getTheme().toolbarIconSize : this.getTheme().iconFontSize - 5, - lineHeight: this.props.large ? 52 : this.props.small || this.props.inputButton ? 22 : this.getTheme().iconLineHeight - 9 - }; - - var defaultProps = { - style: defaultStyle - }; - - return (0, _computeProps2.default)(icon.props, defaultProps); - } - }, { - key: 'iconPresent', - value: function iconPresent() { - var iconComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Icon2.default) iconComponentPresent = true; - }); - return iconComponentPresent; - } - }, { - key: 'renderChildren', - value: function renderChildren() { - if (typeof this.props.children == 'string') { - return _react2.default.createElement( - _Text2.default, - { style: _extends({}, this.getTextStyle(), { width: '100%', textAlign: 'center' }) }, - _platform2.default.OS === 'ios' ? this.props.children : this.props.children.toUpperCase() - ); - } else if (this.props.children.type == _Icon2.default) { - return _react2.default.cloneElement(this.props.children, this.getIconProps(this.props.children)); - } else if (Array.isArray(this.props.children)) { - var newChildren = []; - - var childrenArray = _react2.default.Children.toArray(this.props.children); - - var iconElement = []; - iconElement = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Icon2.default) { - return true; - } - }); - if (this.props.iconRight) { - newChildren.push(_react2.default.createElement( - _Text2.default, - { key: 'label', style: this.getTextStyle() }, - _platform2.default.OS === 'ios' ? childrenArray[0] : childrenArray[0].toUpperCase() - )); - newChildren.push(_react2.default.createElement( - _Text2.default, - { key: 'icon' }, - _react2.default.cloneElement(iconElement[0], this.getIconProps(iconElement[0])) - )); - } else if (this.props.iconLeft || iconElement) { - newChildren.push(_react2.default.createElement( - _Text2.default, - { key: 'icon' }, - _react2.default.cloneElement(iconElement[0], this.getIconProps(iconElement[0])) - )); - newChildren.push(_react2.default.createElement( - _Text2.default, - { key: 'label', style: this.getTextStyle() }, - _platform2.default.OS === 'ios' ? childrenArray[0] : childrenArray[0].toUpperCase() - )); - } - - return newChildren; - } else return _react2.default.cloneElement(this.props.children); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.TouchableOpacity, - this.prepareRootProps(), - this.renderChildren() - ); - } - }]); - - return Button; -}(_NativeBaseComponent3.default); - -exports.default = Button; \ No newline at end of file diff --git a/lib/Components/Widgets/Card.js b/lib/Components/Widgets/Card.js deleted file mode 100644 index 209b421e..00000000 --- a/lib/Components/Widgets/Card.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var CardNB = function (_NativeBaseComponent) { - _inherits(CardNB, _NativeBaseComponent); - - function CardNB() { - _classCallCheck(this, CardNB); - - return _possibleConstructorReturn(this, (CardNB.__proto__ || Object.getPrototypeOf(CardNB)).apply(this, arguments)); - } - - _createClass(CardNB, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - card: { - //flex: 1, - borderWidth: this.getTheme().borderWidth, - borderRadius: this.getTheme().borderRadiusBase, - borderColor: this.getTheme().listBorderColor, - //flexWrap: 'wrap', - borderBottomWidth: 0, - backgroundColor: this.props.transparent ? 'transparent' : this.getTheme().cardDefaultBg - //shadowColor: this.props.transparent ? undefined : '#000', - //shadowOffset: this.props.transparent ? undefined : {width: 0, height: 2}, - //shadowOpacity: this.props.transparent ? undefined : 0.1, - //shadowRadius: this.props.transparent ? undefined : 1.5, - //elevation: this.props.transparent ? undefined : 1 - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var defaultProps = { - style: this.getInitialStyle().card - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'renderChildren', - value: function renderChildren() { - var childrenArray = _react2.default.Children.map(this.props.children, function (child) { - return child; - }); - - return childrenArray; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.View, - this.prepareRootProps(), - this.renderChildren() - ); - } - }]); - - return CardNB; -}(_NativeBaseComponent3.default); - -exports.default = CardNB; \ No newline at end of file diff --git a/lib/Components/Widgets/CardItem.js b/lib/Components/Widgets/CardItem.js deleted file mode 100644 index 86f232cf..00000000 --- a/lib/Components/Widgets/CardItem.js +++ /dev/null @@ -1,344 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _Icon = require('./Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -var _Text = require('./Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _View = require('./View'); - -var _View2 = _interopRequireDefault(_View); - -var _Button = require('./Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _Thumbnail = require('./Thumbnail'); - -var _Thumbnail2 = _interopRequireDefault(_Thumbnail); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var CardItemNB = function (_NativeBaseComponent) { - _inherits(CardItemNB, _NativeBaseComponent); - - function CardItemNB() { - _classCallCheck(this, CardItemNB); - - return _possibleConstructorReturn(this, (CardItemNB.__proto__ || Object.getPrototypeOf(CardItemNB)).apply(this, arguments)); - } - - _createClass(CardItemNB, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - listItem: { - borderBottomWidth: this.getTheme().borderWidth, - padding: this.imagePresent() && !this.ifShowCase() ? 0 : this.getTheme().listItemPadding, - backgroundColor: this.getTheme().listBg, - justifyContent: this.buttonPresent() ? 'space-between' : 'flex-start', - flexDirection: this.thumbnailPresent() || this.iconPresent() || this.notePresent() && this.ifShowCase() ? 'row' : 'column', - borderColor: this.getTheme().listBorderColor - }, - listItemDivider: { - borderBottomWidth: this.getTheme().borderWidth, - padding: this.getTheme().listItemPadding, - backgroundColor: this.getTheme().listDividerBg, - justifyContent: this.buttonPresent() ? 'space-between' : 'flex-start', - flexDirection: 'row', - borderColor: this.getTheme().listBorderColor - }, - itemText: { - fontSize: this.ifShowCase() ? 14 : 15, - marginTop: this.ifShowCase() ? 10 : 0, - color: this.getContextForegroundColor() - }, - dividerItemText: { - fontSize: 16, - fontWeight: '500', - color: this.getContextForegroundColor() - }, - itemIcon: { - fontSize: this.getTheme().iconFontSize, - color: this.getContextForegroundColor() - }, - itemNote: { - fontSize: 15, - color: this.getTheme().listNoteColor, - fontWeight: '100', - flex: 1 - }, - itemSubNote: { - fontSize: 15, - color: '#999' - }, - thumbnail: { - alignSelf: 'center' - }, - fullImage: { - alignSelf: 'stretch', - height: this.ifShowCase() ? 120 : 300 - } - }; - } - }, { - key: 'getRightStyle', - value: function getRightStyle() { - return { - right: { - flex: 1, - paddingLeft: 10, - backgroundColor: 'transparent' - }, - right2: { - flex: 1, - flexDirection: 'row', - paddingLeft: 10, - alignItems: 'center', - justifyContent: 'space-between', - backgroundColor: 'transparent' - }, - right3: { - flex: 1, - flexDirection: 'column', - paddingLeft: 10, - justifyContent: 'flex-start', - backgroundColor: 'transparent' - } - }; - } - }, { - key: 'thumbnailPresent', - value: function thumbnailPresent() { - var thumbnailComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Thumbnail2.default) thumbnailComponentPresent = true; - }); - - return thumbnailComponentPresent; - } - }, { - key: 'imagePresent', - value: function imagePresent() { - var imagePresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _reactNative.Image) imagePresent = true; - }); - - return imagePresent; - } - }, { - key: 'iconPresent', - value: function iconPresent() { - var iconComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Icon2.default) iconComponentPresent = true; - }); - - return iconComponentPresent; - } - }, { - key: 'buttonPresent', - value: function buttonPresent() { - var buttonComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Button2.default) buttonComponentPresent = true; - }); - - return buttonComponentPresent; - } - }, { - key: 'ifShowCase', - value: function ifShowCase() { - var ifShowCase = false; - - if (this.props.cardBody) { - ifShowCase = true; - } - - return ifShowCase; - } - }, { - key: 'notePresent', - value: function notePresent() { - var notePresent = false; - - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Text2.default && child.props.note) notePresent = true; - }); - - return notePresent; - } - }, { - key: 'squareThumbs', - value: function squareThumbs() { - var squareThumbs = false; - if (this.thumbnailPresent()) { - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.props.square) squareThumbs = true; - }); - } - - return squareThumbs; - } - }, { - key: 'getChildProps', - value: function getChildProps(child) { - var defaultProps = {}; - if (child.type == _reactNative.Image && !Array.isArray(this.props.children)) { - defaultProps = { - resizeMode: 'stretch', - style: this.getInitialStyle().fullImage - }; - } else if (child.type == _Button2.default) { - defaultProps = { - small: true, - style: this.getInitialStyle().itemButton - }; - } else if (child.type == _Text2.default) { - if (this.props.header || this.props.footer) { - defaultProps = { - style: this.getInitialStyle().dividerItemText - }; - } else { - if (child.props.note && this.thumbnailPresent()) { - defaultProps = { - style: this.getInitialStyle().itemSubNote - }; - } else if (child.props.note) { - defaultProps = { - style: this.getInitialStyle().itemNote - }; - } else { - defaultProps = { - style: this.getInitialStyle().itemText - }; - } - } - } else if (child.type == _Icon2.default) { - defaultProps = { - style: this.getInitialStyle().itemIcon - }; - } else if (child.type == _Thumbnail2.default) { - defaultProps = { - style: this.getInitialStyle().thumbnail - }; - } else if (child.type == _reactNative.Image) { - defaultProps = { - style: this.getInitialStyle().fullImage - }; - } else { - defaultProps = { - //foregroundColor: this.getContextForegroundColor() - }; - } - - return (0, _computeProps2.default)(child.props, defaultProps); - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - var defaultProps = {}; - - if (this.props.header || this.props.footer) { - - defaultProps = { - style: this.getInitialStyle().listItemDivider - }; - } else { - defaultProps = { - style: this.getInitialStyle().listItem - }; - } - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'renderChildren', - value: function renderChildren() { - var _this2 = this; - - var newChildren = []; - - if (!this.thumbnailPresent() && !this.iconPresent()) { - newChildren = _react2.default.Children.map(this.props.children, function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }); - } else { - newChildren = []; - if (!Array.isArray(this.props.children)) { - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'cardItem', style: { justifyContent: 'flex-start' } }, - _react2.default.cloneElement(this.props.children, this.getChildProps(this.props.children)) - )); - } else { - - var childrenArray = _react2.default.Children.toArray(this.props.children); - newChildren.push(_react2.default.cloneElement(childrenArray[0], this.getChildProps(childrenArray[0]))); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'cardItem', style: this.notePresent() ? this.getRightStyle().right : this.squareThumbs() ? this.getRightStyle().right3 : this.getRightStyle().right2 }, - childrenArray.slice(1).map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }) - )); - } - } - - return newChildren; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _View2.default, - this.prepareRootProps(), - this.renderChildren() - ); - } - }]); - - return CardItemNB; -}(_NativeBaseComponent3.default); - -exports.default = CardItemNB; \ No newline at end of file diff --git a/lib/Components/Widgets/CardSwiper.js b/lib/Components/Widgets/CardSwiper.js deleted file mode 100644 index 1af18bb3..00000000 --- a/lib/Components/Widgets/CardSwiper.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _clamp = require('clamp'); - -var _clamp2 = _interopRequireDefault(_clamp); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _View = require('./View'); - -var _View2 = _interopRequireDefault(_View); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var SWIPE_THRESHOLD = 120; - -var CardSwiper = function (_NativeBaseComponent) { - _inherits(CardSwiper, _NativeBaseComponent); - - function CardSwiper(props) { - _classCallCheck(this, CardSwiper); - - var _this = _possibleConstructorReturn(this, (CardSwiper.__proto__ || Object.getPrototypeOf(CardSwiper)).call(this, props)); - - _this.state = { - pan: new _reactNative.Animated.ValueXY(), - enter: new _reactNative.Animated.Value(0.5) - }; - return _this; - } - - _createClass(CardSwiper, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this._animateEntrance(); - } - }, { - key: '_animateEntrance', - value: function _animateEntrance() { - _reactNative.Animated.spring(this.state.enter, { toValue: 1, friction: 8 }).start(); - } - }, { - key: 'componentWillMount', - value: function componentWillMount() { - var _this2 = this; - - this._panResponder = _reactNative.PanResponder.create({ - onMoveShouldSetResponderCapture: function onMoveShouldSetResponderCapture() { - return true; - }, - onMoveShouldSetPanResponderCapture: function onMoveShouldSetPanResponderCapture() { - return true; - }, - - onPanResponderGrant: function onPanResponderGrant(e, gestureState) { - _this2.state.pan.setOffset({ x: _this2.state.pan.x._value, y: _this2.state.pan.y._value }); - _this2.state.pan.setValue({ x: 0, y: 0 }); - }, - - onPanResponderMove: _reactNative.Animated.event([null, { dx: this.state.pan.x, dy: this.state.pan.y }]), - - onPanResponderRelease: function onPanResponderRelease(e, _ref) { - var vx = _ref.vx, - vy = _ref.vy; - - _this2.state.pan.flattenOffset(); - var velocity; - - if (vx >= 0) { - velocity = (0, _clamp2.default)(vx, 3, 5); - } else if (vx < 0) { - velocity = (0, _clamp2.default)(vx * -1, 3, 5) * -1; - } - - if (Math.abs(_this2.state.pan.x._value) > SWIPE_THRESHOLD) { - if (velocity > 0) { - _this2.props.onSwipeRight(); - } else { - _this2.props.onSwipeLeft(); - } - _reactNative.Animated.decay(_this2.state.pan, { - velocity: { x: velocity, y: vy }, - deceleration: 0.98 - }).start(_this2._resetState.bind(_this2)); - } else { - _reactNative.Animated.spring(_this2.state.pan, { - toValue: { x: 0, y: 0 }, - friction: 4 - }).start(); - } - } - }); - } - }, { - key: '_resetState', - value: function _resetState() { - this.state.pan.setValue({ x: 0, y: 0 }); - this.state.enter.setValue(0); - this._animateEntrance(); - } - }, { - key: 'render', - value: function render() { - var _state = this.state, - pan = _state.pan, - enter = _state.enter; - var _ref2 = [pan.x, pan.y], - translateX = _ref2[0], - translateY = _ref2[1]; - - - var rotate = pan.x.interpolate({ inputRange: [-300, 0, 300], outputRange: ['-30deg', '0deg', '30deg'] }); - var opacity = pan.x.interpolate({ inputRange: [-150, 0, 150], outputRange: [0.5, 1, 0.5] }); - var scale = enter; - - var animatedCardStyles = { transform: [{ translateX: translateX }, { translateY: translateY }, { rotate: rotate }, { scale: scale }], opacity: opacity }; - - return _react2.default.createElement( - _View2.default, - null, - _react2.default.createElement( - _reactNative.Animated.View, - _extends({ style: animatedCardStyles }, this._panResponder.panHandlers), - this.props.children - ) - ); - } - }]); - - return CardSwiper; -}(_NativeBaseComponent3.default); - -exports.default = CardSwiper; \ No newline at end of file diff --git a/lib/Components/Widgets/Checkbox.js b/lib/Components/Widgets/Checkbox.js deleted file mode 100644 index 8aef110c..00000000 --- a/lib/Components/Widgets/Checkbox.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _Icon = require('./Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -var _platform = require('../../Utils/platform'); - -var _platform2 = _interopRequireDefault(_platform); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var CheckBox = function (_NativeBaseComponent) { - _inherits(CheckBox, _NativeBaseComponent); - - function CheckBox() { - _classCallCheck(this, CheckBox); - - return _possibleConstructorReturn(this, (CheckBox.__proto__ || Object.getPrototypeOf(CheckBox)).apply(this, arguments)); - } - - _createClass(CheckBox, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - checkbox: { - borderRadius: _platform2.default.OS === 'ios' ? 13 : 2, - overflow: 'hidden', - width: this.getTheme().checkboxSize, - height: this.getTheme().checkboxSize, - borderWidth: _platform2.default.OS === 'ios' ? 1 : 2, - paddingLeft: _platform2.default.OS === 'ios' ? 0 : 0, - paddingBottom: _platform2.default.OS === 'ios' ? 0 : 0, - borderColor: this.getTheme().checkboxBgColor, - backgroundColor: this.props.checked ? this.getTheme().checkboxBgColor : 'transparent' - } - }; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.View, - { style: this.getInitialStyle().checkbox }, - _react2.default.createElement(_Icon2.default, { name: 'checkmark', - style: { - color: this.props.checked ? this.getTheme().checkboxTickColor : 'transparent', - marginLeft: _platform2.default.OS === 'ios' ? -4 : -5, - marginTop: _platform2.default.OS === 'ios' ? 2 : 0 - }, - size: _platform2.default.OS === 'ios' ? this.getTheme().checkboxSize / 0.8 : this.getTheme().checkboxSize / 0.8 }) - ); - } - }]); - - return CheckBox; -}(_NativeBaseComponent3.default); - -exports.default = CheckBox; \ No newline at end of file diff --git a/lib/Components/Widgets/Container.js b/lib/Components/Widgets/Container.js deleted file mode 100644 index 1b02d939..00000000 --- a/lib/Components/Widgets/Container.js +++ /dev/null @@ -1,200 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _View = require('./View'); - -var _View2 = _interopRequireDefault(_View); - -var _Header = require('./Header'); - -var _Header2 = _interopRequireDefault(_Header); - -var _Content = require('./Content'); - -var _Content2 = _interopRequireDefault(_Content); - -var _Footer = require('./Footer'); - -var _Footer2 = _interopRequireDefault(_Footer); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Container = function (_NativeBaseComponent) { - _inherits(Container, _NativeBaseComponent); - - function Container() { - _classCallCheck(this, Container); - - return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); - } - - _createClass(Container, [{ - key: 'isHeaderPresent', - value: function isHeaderPresent() { - var headerPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Header2.default) headerPresent = true; - }); - return headerPresent; - } - }, { - key: 'renderHeader', - value: function renderHeader() { - if (Array.isArray(this.props.children)) { - return _lodash2.default.find(this.props.children, function (item) { - if (item && item.type == _Header2.default) { - return true; - } - }); - } else { - if (this.props.children && this.props.children.type == _Header2.default) { - return this.props.children; - } - } - } - }, { - key: 'getBottomTabBarHeight', - value: function getBottomTabBarHeight() { - var tabBars = document.getElementsByClassName('tabbarios-tabbar-container'); - if (tabBars.length === 0) { - return 0; - } - var tabBar = tabBars[0]; - if (!(tabBar.clientWidth !== 0 && tabBar.clientHeight !== 0 && tabBar.style.opacity !== 0 && tabBar.style.visibility !== 'hidden')) { - return 0; - } - return tabBars[0].clientHeight; - } - }, { - key: 'renderContent', - value: function renderContent() { - var contentNode = null; - var defaultContentStyle = { - height: _reactNative.Dimensions.get('window').height - (this.isHeaderPresent() ? this.getTheme().toolbarHeight : 0) - this.getBottomTabBarHeight() - }; - - if (Array.isArray(this.props.children)) { - - contentNode = _lodash2.default.find(this.props.children, function (item) { - if (item && (item.type == _View2.default || item.type == _Content2.default || item.type == _reactNative.Image || item.type == _reactNative.View)) { - - return true; - } - }); - } else { - if (this.props.children && (this.props.children.type == _Content2.default || this.props.children.type == _View2.default || this.props.children.type == _reactNative.View || this.props.children.type == _reactNative.Image)) { - contentNode = this.props.children; - } - } - return _react2.default.createElement( - contentNode.type, - _extends({}, contentNode.props, { style: _lodash2.default.assign(defaultContentStyle, contentNode.props.style || {}) }), - contentNode.props.children - ); - } - }, { - key: 'renderFooter', - value: function renderFooter() { - if (Array.isArray(this.props.children)) { - return _lodash2.default.find(this.props.children, function (item) { - if (item && item.type == _Footer2.default) { - return true; - } - }); - } else { - if (this.props.children && this.props.children.type == _Footer2.default) { - return this.props.children; - } - } - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - flex: 1 - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - if (!this._delayRerendered) { - // Schedule a delayed update to wait for TabBarIOS - this._delayRerendered = true; - setTimeout(function () { - return _this2.forceUpdate(); - }.bind(this)); - return _react2.default.createElement(_reactNative.View, null); - } - return _react2.default.createElement( - _reactNative.View, - this.prepareRootProps(), - _react2.default.createElement( - _reactNative.View, - null, - this.renderHeader() - ), - _react2.default.createElement( - _reactNative.View, - { style: { - flex: 1, - paddingTop: this.isHeaderPresent() ? this.getTheme().toolbarHeight : 0 - } }, - this.renderContent() - ), - _react2.default.createElement( - _reactNative.View, - null, - this.renderFooter() - ) - ); - } - }]); - - return Container; -}(_NativeBaseComponent3.default); - -exports.default = Container; \ No newline at end of file diff --git a/lib/Components/Widgets/Content.js b/lib/Components/Widgets/Content.js deleted file mode 100644 index 4cf13043..00000000 --- a/lib/Components/Widgets/Content.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _reactNative = require('react-native'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Content = function (_NativeBaseComponent) { - _inherits(Content, _NativeBaseComponent); - - function Content() { - _classCallCheck(this, Content); - - return _possibleConstructorReturn(this, (Content.__proto__ || Object.getPrototypeOf(Content)).apply(this, arguments)); - } - - _createClass(Content, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - backgroundColor: this.props.style && this.props.style.backgroundColor || 'white', - flex: 1 - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - var contentContainerStyle = this.props.contentContainerStyle || {}; - contentContainerStyle.padding = this.props.padder ? this.getTheme().contentPadding : 0; - return _react2.default.createElement( - _reactNative.ScrollView, - _extends({}, this.prepareRootProps(), { contentContainerStyle: contentContainerStyle }), - this.props.children - ); - } - }]); - - return Content; -}(_NativeBaseComponent3.default); - -exports.default = Content; \ No newline at end of file diff --git a/lib/Components/Widgets/DeckSwiper.js b/lib/Components/Widgets/DeckSwiper.js deleted file mode 100644 index cf63147f..00000000 --- a/lib/Components/Widgets/DeckSwiper.js +++ /dev/null @@ -1,193 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _clamp = require('clamp'); - -var _clamp2 = _interopRequireDefault(_clamp); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _View = require('./View'); - -var _View2 = _interopRequireDefault(_View); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var SWIPE_THRESHOLD = 70; - -var CardSwiper = function (_NativeBaseComponent) { - _inherits(CardSwiper, _NativeBaseComponent); - - function CardSwiper(props) { - _classCallCheck(this, CardSwiper); - - var _this = _possibleConstructorReturn(this, (CardSwiper.__proto__ || Object.getPrototypeOf(CardSwiper)).call(this, props)); - - _this.state = { - pan: new _reactNative.Animated.ValueXY(), - // enter: new Animated.Value(1), - selectedItem: _this.props.dataSource[0], - selectedItem2: _this.props.dataSource[1] - }; - return _this; - } - - _createClass(CardSwiper, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this._animateEntrance(); - } - }, { - key: 'goToPrevious', - value: function goToPrevious() { - var currentPersonIdx = this.props.dataSource.indexOf(this.state.selectedItem); - var newIdx = currentPersonIdx - 1; - var newIdx2 = currentPersonIdx - 2; - - this.setState({ - selectedItem: this.props.dataSource[newIdx < 0 ? this.props.dataSource.length - 1 : newIdx], - selectedItem2: this.props.dataSource[newIdx2 < 0 ? this.props.dataSource.length - 2 : newIdx2] - }); - } - }, { - key: 'goToNext', - value: function goToNext() { - var currentPersonIdx = this.props.dataSource.indexOf(this.state.selectedItem); - var newIdx = currentPersonIdx + 1; - var newIdx2 = currentPersonIdx + 2; - - this.setState({ - selectedItem: this.props.dataSource[newIdx > this.props.dataSource.length - 1 ? 0 : newIdx], - selectedItem2: this.props.dataSource[newIdx2 > this.props.dataSource.length - 2 ? 0 : newIdx2] - }); - } - }, { - key: '_animateEntrance', - value: function _animateEntrance() { - // Animated.spring( - // this.state.enter, - // { toValue: 1, friction: 0 } - // ).start(); - } - }, { - key: 'componentWillMount', - value: function componentWillMount() { - var _this2 = this; - - this._panResponder = _reactNative.PanResponder.create({ - onMoveShouldSetResponderCapture: function onMoveShouldSetResponderCapture() { - return true; - }, - onMoveShouldSetPanResponderCapture: function onMoveShouldSetPanResponderCapture() { - return true; - }, - - onPanResponderGrant: function onPanResponderGrant(e, gestureState) { - _this2.state.pan.setOffset({ x: _this2.state.pan.x._value, y: _this2.state.pan.y._value }); - _this2.state.pan.setValue({ x: 0, y: 0 }); - }, - - onPanResponderMove: _reactNative.Animated.event([null, { dx: this.state.pan.x, dy: this.state.pan.y }]), - - onPanResponderRelease: function onPanResponderRelease(e, _ref) { - var vx = _ref.vx, - vy = _ref.vy; - - _this2.state.pan.flattenOffset(); - var velocity; - - if (vx >= 0) { - velocity = (0, _clamp2.default)(vx, 3, 5); - } else if (vx < 0) { - velocity = (0, _clamp2.default)(vx * -1, 3, 5) * -1; - } - - if (Math.abs(_this2.state.pan.x._value) > SWIPE_THRESHOLD) { - if (velocity > 0) { - _this2.props.onSwipeRight(); - _this2.goToNext(); - } else { - _this2.props.onSwipeLeft(); - _this2.goToPrevious(); - } - _reactNative.Animated.decay(_this2.state.pan, { - velocity: { x: velocity, y: vy }, - deceleration: 0.98 - }).start(_this2._resetState.bind(_this2)); - } else { - _reactNative.Animated.spring(_this2.state.pan, { - toValue: { x: 0, y: 0 }, - friction: 4 - }).start(); - } - } - }); - } - }, { - key: '_resetState', - value: function _resetState() { - this.state.pan.setValue({ x: 0, y: 0 }); - // this.state.enter.setValue(0); - // this._animateEntrance(); - } - }, { - key: 'render', - value: function render() { - var pan = this.state.pan; - var _ref2 = [pan.x, pan.y], - translateX = _ref2[0], - translateY = _ref2[1]; - - - var rotate = pan.x.interpolate({ inputRange: [-300, 0, 300], outputRange: ['-30deg', '0deg', '30deg'] }); - var opacity = pan.x.interpolate({ inputRange: [-120, 0, 120], outputRange: [0.5, 1, 0.5] }); - // let scale = enter; - - var animatedCardStyles = { transform: [{ translateX: translateX }, { translateY: translateY }, { rotate: rotate }], opacity: opacity }; - - return _react2.default.createElement( - _View2.default, - { style: this.props.style }, - this.state.selectedItem === undefined ? _react2.default.createElement(_View2.default, null) : _react2.default.createElement( - _View2.default, - null, - _react2.default.createElement( - _View2.default, - { style: { elevation: 2 } }, - this.props.renderItem(this.state.selectedItem2) - ), - _react2.default.createElement( - _reactNative.Animated.View, - _extends({ style: [animatedCardStyles, { marginTop: -416, elevation: 3 }] }, this._panResponder.panHandlers), - this.props.renderItem(this.state.selectedItem) - ) - ) - ); - } - }]); - - return CardSwiper; -}(_NativeBaseComponent3.default); - -exports.default = CardSwiper; \ No newline at end of file diff --git a/lib/Components/Widgets/Footer.js b/lib/Components/Widgets/Footer.js deleted file mode 100644 index 9c6ee5e0..00000000 --- a/lib/Components/Widgets/Footer.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Footer = function (_NativeBaseComponent) { - _inherits(Footer, _NativeBaseComponent); - - function Footer() { - _classCallCheck(this, Footer); - - return _possibleConstructorReturn(this, (Footer.__proto__ || Object.getPrototypeOf(Footer)).apply(this, arguments)); - } - - _createClass(Footer, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - navbar: { - //shadowColor: '#000', - //shadowOffset: {width: 0, height: 2}, - //shadowOpacity: 0.1, - //shadowRadius: 1.5, - flexDirection: 'row', - alignItems: 'center', - justifyContent: !Array.isArray(this.props.children) ? 'center' : 'space-between', - height: this.getTheme().footerHeight, - backgroundColor: this.getTheme().footerDefaultBg - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var defaultProps = { - style: this.getInitialStyle().navbar - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - - return _react2.default.createElement( - _reactNative.View, - this.prepareRootProps(), - !Array.isArray(this.props.children) && _react2.default.createElement( - _reactNative.View, - null, - this.props.children - ), - Array.isArray(this.props.children) && _react2.default.createElement( - _reactNative.View, - { style: { flex: 1, alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row' } }, - this.props.children[0] - ), - Array.isArray(this.props.children) && _react2.default.createElement( - _reactNative.View, - { style: { flex: 3, alignSelf: 'center' } }, - this.props.children[1] - ), - Array.isArray(this.props.children) && _react2.default.createElement( - _reactNative.View, - { style: { flex: 1, alignItems: 'center', justifyContent: 'flex-end', flexDirection: 'row' } }, - this.props.children[2] - ) - ); - } - }]); - - return Footer; -}(_NativeBaseComponent3.default); - -exports.default = Footer; \ No newline at end of file diff --git a/lib/Components/Widgets/H1.js b/lib/Components/Widgets/H1.js deleted file mode 100644 index 2720e7b6..00000000 --- a/lib/Components/Widgets/H1.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _Text = require('./Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var H1NB = function (_NativeBaseComponent) { - _inherits(H1NB, _NativeBaseComponent); - - function H1NB() { - _classCallCheck(this, H1NB); - - return _possibleConstructorReturn(this, (H1NB.__proto__ || Object.getPrototypeOf(H1NB)).apply(this, arguments)); - } - - _createClass(H1NB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - color: this.getTheme().textColor, - fontSize: this.getTheme().fontSizeH1 - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _Text2.default, - this.prepareRootProps(), - this.props.children - ); - } - }]); - - return H1NB; -}(_NativeBaseComponent3.default); - -exports.default = H1NB; \ No newline at end of file diff --git a/lib/Components/Widgets/H2.js b/lib/Components/Widgets/H2.js deleted file mode 100644 index 2bb9520f..00000000 --- a/lib/Components/Widgets/H2.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _Text = require('./Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var H2NB = function (_NativeBaseComponent) { - _inherits(H2NB, _NativeBaseComponent); - - function H2NB() { - _classCallCheck(this, H2NB); - - return _possibleConstructorReturn(this, (H2NB.__proto__ || Object.getPrototypeOf(H2NB)).apply(this, arguments)); - } - - _createClass(H2NB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - color: this.getTheme().textColor, - fontSize: this.getTheme().fontSizeH2 - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _Text2.default, - this.prepareRootProps(), - this.props.children - ); - } - }]); - - return H2NB; -}(_NativeBaseComponent3.default); - -exports.default = H2NB; \ No newline at end of file diff --git a/lib/Components/Widgets/H3.js b/lib/Components/Widgets/H3.js deleted file mode 100644 index 1ff3d47b..00000000 --- a/lib/Components/Widgets/H3.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _Text = require('./Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var H3NB = function (_NativeBaseComponent) { - _inherits(H3NB, _NativeBaseComponent); - - function H3NB() { - _classCallCheck(this, H3NB); - - return _possibleConstructorReturn(this, (H3NB.__proto__ || Object.getPrototypeOf(H3NB)).apply(this, arguments)); - } - - _createClass(H3NB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - color: this.getTheme().textColor, - fontSize: this.getTheme().fontSizeH3 - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _Text2.default, - this.prepareRootProps(), - this.props.children - ); - } - }]); - - return H3NB; -}(_NativeBaseComponent3.default); - -exports.default = H3NB; \ No newline at end of file diff --git a/lib/Components/Widgets/Header.js b/lib/Components/Widgets/Header.js deleted file mode 100644 index df5ab540..00000000 --- a/lib/Components/Widgets/Header.js +++ /dev/null @@ -1,241 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _platform = require('../../Utils/platform'); - -var _platform2 = _interopRequireDefault(_platform); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _Button = require('./Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _View = require('./View'); - -var _View2 = _interopRequireDefault(_View); - -var _Title = require('./Title'); - -var _Title2 = _interopRequireDefault(_Title); - -var _InputGroup = require('./InputGroup'); - -var _InputGroup2 = _interopRequireDefault(_InputGroup); - -var _Subtitle = require('./Subtitle'); - -var _Subtitle2 = _interopRequireDefault(_Subtitle); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Header = function (_NativeBaseComponent) { - _inherits(Header, _NativeBaseComponent); - - function Header() { - _classCallCheck(this, Header); - - return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); - } - - _createClass(Header, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - navbar: { - backgroundColor: this.getTheme().toolbarDefaultBg, - justifyContent: !Array.isArray(this.props.children) ? 'center' : 'space-between', - flexDirection: 'row', - alignItems: 'center', - paddingHorizontal: 15, - paddingTop: _platform2.default.OS === 'ios' ? 0 : 0, - //shadowColor: '#000', - //shadowOffset: {width: 0, height: 2}, - //shadowOpacity: 0.1, - //shadowRadius: 1.5, - height: this.getTheme().toolbarHeight, - //elevation: 3, - position: 'fixed', - top: 0, - width: '100%', - zIndex: 99 - }, - iosToolbarSearch: { - backgroundColor: this.getTheme().toolbarInputColor, - borderRadius: this.props.rounded ? 25 : 2, - height: 30, - borderColor: 'transparent', - flex: 1 - }, - androidToolbarSearch: { - backgroundColor: '#fff', - borderRadius: 2, - borderColor: 'transparent', - //elevation: 2, - flex: 1 - }, - toolbarButton: { - paddingHorizontal: 15 - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var defaultProps = { - style: this.getInitialStyle().navbar - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'renderChildren', - value: function renderChildren() { - if (!Array.isArray(this.props.children)) { - return this.props.children; - } else if (Array.isArray(this.props.children)) { - var newChildren = []; - var childrenArray = _react2.default.Children.toArray(this.props.children); - - var buttons = []; - buttons = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Button2.default) { - return true; - } - }); - - var title = []; - title = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Title2.default) { - return true; - } - }); - - var subtitle = []; - subtitle = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Subtitle2.default) { - return true; - } - }); - - var input = []; - input = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _InputGroup2.default) { - return true; - } - }); - - if (this.props.searchBar) { - if (_platform2.default.OS === 'ios') { - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'search', style: { flex: 1, alignSelf: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -7 } }, - _react2.default.cloneElement(input[0], { style: this.getInitialStyle().iosToolbarSearch, toolbar: true, key: 'inp' }) - )); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'searchBtn', style: { alignItems: 'center', justifyContent: 'center', flexDirection: 'row', marginRight: -14 } }, - _react2.default.cloneElement(buttons[0], { color: this.getTheme().iosToolbarBtnColor, style: this.getInitialStyle().toolbarButton }) - )); - } else { - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'search', style: { flex: 1, alignSelf: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -8, marginRight: -8 } }, - _react2.default.cloneElement(input[0], { style: this.getInitialStyle().androidToolbarSearch, atoolbar: true }) - )); - } - } else { - if (_platform2.default.OS === 'ios') { - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'title', style: { position: 'absolute', left: 0, right: 0, top: 2, bottom: 0, alignSelf: 'center', justifyContent: 'center' } }, - [title[0], subtitle[0]] - )); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'btn1', style: { alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -14 } }, - _react2.default.cloneElement(buttons[0], { color: this.getTheme().iosToolbarBtnColor, style: this.getInitialStyle().toolbarButton }) - )); - if (buttons.length > 1) { - for (var i = 1; i < buttons.length; i++) { - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'btn' + (i + 1), style: { alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginRight: -14 } }, - _react2.default.cloneElement(buttons[i], { color: this.getTheme().iosToolbarBtnColor, style: this.getInitialStyle().toolbarButton }) - )); - } - } else { - newChildren.push(_react2.default.createElement( - _Button2.default, - { key: 'fakeBtn', transparent: true, textStyle: { color: 'transparent' } }, - 'aa' - )); - } - } else { - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'btn1', style: { alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -10, marginRight: 12 } }, - _react2.default.cloneElement(buttons[0], { style: this.getInitialStyle().toolbarButton, header: true, textStyle: { color: this.getTheme().toolbarTextColor } }) - )); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'title', style: { flex: 3, alignSelf: 'stretch', justifyContent: 'center' } }, - [title[0]] - )); - for (var _i = 1; _i < buttons.length; _i++) { - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'btn' + (_i + 1), style: { alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginRight: -7 } }, - _react2.default.cloneElement(buttons[_i], { style: this.getInitialStyle().toolbarButton, header: true, textStyle: { color: this.getTheme().toolbarTextColor } }) - )); - } - } - } - return newChildren; - } - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _View2.default, - this.prepareRootProps(), - this.renderChildren() - ); - } - }]); - - return Header; -}(_NativeBaseComponent3.default); - -exports.default = Header; \ No newline at end of file diff --git a/lib/Components/Widgets/Icon.js b/lib/Components/Widgets/Icon.js deleted file mode 100644 index 92a9356e..00000000 --- a/lib/Components/Widgets/Icon.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _TabBarItem = require('./TabBarItem'); - -var _TabBarItem2 = _interopRequireDefault(_TabBarItem); - -var _light = require('../Themes/light'); - -var _light2 = _interopRequireDefault(_light); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var IconNB = function (_NativeBaseComponent) { - _inherits(IconNB, _NativeBaseComponent); - - function IconNB() { - _classCallCheck(this, IconNB); - - return _possibleConstructorReturn(this, (IconNB.__proto__ || Object.getPrototypeOf(IconNB)).apply(this, arguments)); - } - - _createClass(IconNB, [{ - key: 'setIconFamily', - value: function setIconFamily(family) { - switch (family) { - // case 'Entypo': - // this.Icon = Entypo; - // break; - case 'FontAwesome': - this.Icon = require('react-icons/lib/fa/' + this.props.name); - break; - // case 'Foundation': - // this.Icon = Foundation; - // break; - case 'MaterialIcons': - this.Icon = require('react-icons/lib/md/' + this.props.name); - break; - // case 'Octicons': - // this.Icon = Octicons; - // break; - // case 'Zocial': - // this.Icon = Zocial; - // break; - default: - case 'Ionicons': - this.Icon = require('react-icons/lib/io/' + this.props.name.replace(/^md-/, 'android-')); - break; - } - } - }, { - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - icon: { - fontSize: this.getTheme().iconFontSize, - color: this.props.color || this.getContextForegroundColor() - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - var defaultProps = { - style: this.getInitialStyle().icon - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - if (this.props.family) { - this.setIconFamily(this.props.family); - } else { - this.setIconFamily(_light2.default.iconFamily); - } - return _react2.default.createElement(this.Icon, this.prepareRootProps()); - } - }]); - - return IconNB; -}(_NativeBaseComponent3.default); - -IconNB.TabBarItem = _TabBarItem2.default; -exports.default = IconNB; \ No newline at end of file diff --git a/lib/Components/Widgets/Input.js b/lib/Components/Widgets/Input.js deleted file mode 100644 index be985b54..00000000 --- a/lib/Components/Widgets/Input.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Input = function (_NativeBaseComponent) { - _inherits(Input, _NativeBaseComponent); - - function Input() { - _classCallCheck(this, Input); - - return _possibleConstructorReturn(this, (Input.__proto__ || Object.getPrototypeOf(Input)).apply(this, arguments)); - } - - _createClass(Input, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - input: { - height: this.getTheme().inputHeightBase, - color: this.getTheme().inputColor, - paddingLeft: 5, - paddingRight: 5, - fontSize: this.getTheme().inputFontSize, - lineHeight: this.getTheme().inputLineHeight - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - var defaultProps = { - style: this.getInitialStyle().input - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - - return _react2.default.createElement( - _reactNative.View, - { style: { flex: 1 } }, - _react2.default.createElement(_reactNative.TextInput, _extends({}, this.prepareRootProps(), { placeholderTextColor: this.props.placeholderTextColor ? this.props.placeholderTextColor : this.getTheme().inputColorPlaceholder, underlineColorAndroid: 'rgba(0,0,0,0)' })) - ); - } - }]); - - return Input; -}(_NativeBaseComponent3.default); - -exports.default = Input; \ No newline at end of file diff --git a/lib/Components/Widgets/InputGroup.js b/lib/Components/Widgets/InputGroup.js deleted file mode 100644 index 815ee1d2..00000000 --- a/lib/Components/Widgets/InputGroup.js +++ /dev/null @@ -1,251 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _Icon = require('./Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -var _Button = require('./Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _Input = require('./Input'); - -var _Input2 = _interopRequireDefault(_Input); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var InputGroup = function (_NativeBaseComponent) { - _inherits(InputGroup, _NativeBaseComponent); - - function InputGroup() { - _classCallCheck(this, InputGroup); - - return _possibleConstructorReturn(this, (InputGroup.__proto__ || Object.getPrototypeOf(InputGroup)).apply(this, arguments)); - } - - _createClass(InputGroup, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - textInput: { - backgroundColor: 'transparent', - flexDirection: 'row', - borderColor: this.props.error ? this.getTheme().inputErrorBorderColor : this.props.success ? this.getTheme().inputSuccessBorderColor : this.getTheme().inputBorderColor, - paddingRight: 5, - alignItems: 'center' - }, - outerBorder: { - position: 'relative', - borderColor: 'white', - borderWidth: this.getTheme().borderWidth, - borderTopWidth: 0, - borderRightWidth: 0, - borderLeftWidth: 0 - }, - darkborder: { - borderColor: '#000' - }, - lightborder: { - borderColor: '#fff' - }, - underline: { - position: 'relative', - borderWidth: this.getTheme().borderWidth, - borderTopWidth: 0, - borderRightWidth: 0, - borderLeftWidth: 0 - }, - - bordered: { - position: 'relative', - borderWidth: this.getTheme().borderWidth - }, - - rounded: { - position: 'relative', - borderWidth: this.getTheme().borderWidth, - borderRadius: 30 - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - paddingLeft: this.props.borderType === 'rounded' && !this.props.children.type == _Icon2.default ? 15 : this.props.children.type == _Icon2.default ? this.getTheme().inputPaddingLeftIcon : 5 - }; - - var defaultStyle = this.props.borderType === 'regular' ? this.getInitialStyle().bordered : this.props.borderType === 'rounded' ? this.getInitialStyle().rounded : this.getInitialStyle().underline; - - type = _lodash2.default.merge(type, defaultStyle); - - var addedProps = _lodash2.default.merge(this.getInitialStyle().textInput, type); - - var defaultProps = { - style: addedProps, - key: 'inpGroup' - }; - - var props = (0, _computeProps2.default)(this.props, defaultProps); - - return props; - } - }, { - key: 'getIconProps', - value: function getIconProps(icon) { - - var defaultStyle = { - fontSize: this.props.toolbar || this.props.atoolbar ? this.getTheme().toolbarIconSize : 27, - alignSelf: 'center', - lineHeight: this.props.toolbar || this.props.atoolbar ? 24 : undefined, - paddingRight: 5, - marginLeft: this.props.toolbar || this.props.atoolbar ? 5 : undefined - }; - - var defaultProps = { - style: defaultStyle, - key: 'icon' - }; - - return (0, _computeProps2.default)(icon.props, defaultProps); - } - }, { - key: 'getButtonProps', - value: function getButtonProps(button) { - - var defaultStyle = { - alignSelf: 'center', - paddingRight: 5, - marginLeft: this.props.toolbar || this.props.atoolbar ? 5 : undefined, - height: this.props.toolbar ? 30 : undefined, - fontSize: this.props.toolbar ? 15 : undefined - }; - - var defaultProps = { - style: defaultStyle, - key: 'button', - inputButton: true - }; - - return (0, _computeProps2.default)(button.props, defaultProps); - } - }, { - key: 'renderChildren', - value: function renderChildren() { - - var inputProps = {}; - var newChildren = []; - var childrenArray = _react2.default.Children.toArray(this.props.children); - - var iconElement = []; - iconElement = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Icon2.default) { - return true; - } - }); - - var buttonElement = []; - - buttonElement = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Button2.default) { - return true; - } - }); - - var inp = _lodash2.default.find(childrenArray, function (item) { - if (item && item.type == _Input2.default) { - return true; - } - }); - - if (inp) { - inputProps = (0, _computeProps2.default)(this.props, inp.props); - } else { - inputProps = this.props; - } - - if (Array.isArray(this.props.children)) { - - if (this.props.iconRight) { - newChildren.push(_react2.default.createElement(_Input2.default, _extends({ editable: this.props.disabled ? false : undefined, key: 'inp' }, inputProps))); - newChildren.push(_react2.default.cloneElement(iconElement[0], this.getIconProps(iconElement[0]))); - } else if (buttonElement.length > 0) { - newChildren.push(_react2.default.cloneElement(iconElement[0], _extends({}, this.getIconProps(iconElement[0]), { - key: 'icon0' - }))); - newChildren.push(_react2.default.createElement(_Input2.default, _extends({ editable: this.props.disabled ? false : undefined, key: 'inp' }, inputProps))); - newChildren.push(_react2.default.cloneElement(buttonElement[0], _extends({}, this.getButtonProps(buttonElement[0]), { - key: 'button1' - }))); - } else { - if (iconElement.length > 1) { - newChildren.push(_react2.default.cloneElement(iconElement[0], _extends({}, this.getIconProps(iconElement[0]), { - key: 'icon0' - }))); - newChildren.push(_react2.default.createElement(_Input2.default, _extends({ editable: this.props.disabled ? false : undefined, key: 'inp' }, inputProps))); - newChildren.push(_react2.default.cloneElement(iconElement[1], _extends({}, this.getIconProps(iconElement[1]), { - key: 'icon1' - }))); - } else { - newChildren.push(_react2.default.cloneElement(iconElement[0], this.getIconProps(iconElement[0]))); - newChildren.push(_react2.default.createElement(_Input2.default, _extends({ editable: this.props.disabled ? false : undefined, key: 'inp' }, inputProps))); - } - } - } else { - newChildren.push(_react2.default.createElement(_Input2.default, _extends({ editable: this.props.disabled ? false : undefined, key: 'inp' }, inputProps))); - } - - return newChildren; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.View, - this.prepareRootProps(), - this.renderChildren() - ); - } - }]); - - return InputGroup; -}(_NativeBaseComponent3.default); - -exports.default = InputGroup; \ No newline at end of file diff --git a/lib/Components/Widgets/List.js b/lib/Components/Widgets/List.js deleted file mode 100644 index 697657b1..00000000 --- a/lib/Components/Widgets/List.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ListNB = function (_NativeBaseComponent) { - _inherits(ListNB, _NativeBaseComponent); - - function ListNB() { - _classCallCheck(this, ListNB); - - return _possibleConstructorReturn(this, (ListNB.__proto__ || Object.getPrototypeOf(ListNB)).apply(this, arguments)); - } - - _createClass(ListNB, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - list: {}, - insetList: { - borderWidth: 1, - borderColor: this.getTheme().listBorderColor, - margin: 15, - borderBottomWidth: 0 - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var defaultProps = { - style: this.props.inset ? this.getInitialStyle().insetList : this.getInitialStyle().list - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'renderChildren', - value: function renderChildren() { - - var childrenArray = _react2.default.Children.toArray(this.props.children); - - var keyIndex = 0; - - childrenArray = childrenArray.map(function (child) { - keyIndex++; - return _react2.default.cloneElement(child, _extends({}, child.props, { key: keyIndex })); - }); - - var lastElement = _lodash2.default.last(childrenArray); - - return _lodash2.default.concat(_lodash2.default.slice(childrenArray, 0, childrenArray.length - 1), lastElement); - } - }, { - key: 'render', - value: function render() { - if (this.props.dataArray && this.props.renderRow) { - var ds = new _reactNative.ListView.DataSource({ rowHasChanged: function rowHasChanged(r1, r2) { - return r1 !== r2; - } }); - var dataSource = ds.cloneWithRows(this.props.dataArray); - return _react2.default.createElement(_reactNative.ListView, _extends({}, this.prepareRootProps(), { - enableEmptySections: true, - dataSource: dataSource, - renderRow: this.props.renderRow })); - } else { - return _react2.default.createElement( - _reactNative.View, - this.prepareRootProps(), - this.renderChildren() - ); - } - } - }]); - - return ListNB; -}(_NativeBaseComponent3.default); - -exports.default = ListNB; \ No newline at end of file diff --git a/lib/Components/Widgets/ListItem.js b/lib/Components/Widgets/ListItem.js deleted file mode 100644 index 0c1fb371..00000000 --- a/lib/Components/Widgets/ListItem.js +++ /dev/null @@ -1,614 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _platform = require('../../Utils/platform'); - -var _platform2 = _interopRequireDefault(_platform); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _Icon = require('./Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -var _Text = require('./Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _View = require('./View'); - -var _View2 = _interopRequireDefault(_View); - -var _Button = require('./Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _Badge = require('./Badge'); - -var _Badge2 = _interopRequireDefault(_Badge); - -var _Thumbnail = require('./Thumbnail'); - -var _Thumbnail2 = _interopRequireDefault(_Thumbnail); - -var _Checkbox = require('./Checkbox'); - -var _Checkbox2 = _interopRequireDefault(_Checkbox); - -var _Radio = require('./Radio'); - -var _Radio2 = _interopRequireDefault(_Radio); - -var _InputGroup = require('./InputGroup'); - -var _InputGroup2 = _interopRequireDefault(_InputGroup); - -var _TouchableOpacityScrollable = require('./TouchableOpacityScrollable'); - -var _TouchableOpacityScrollable2 = _interopRequireDefault(_TouchableOpacityScrollable); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ListItemNB = function (_NativeBaseComponent) { - _inherits(ListItemNB, _NativeBaseComponent); - - function ListItemNB() { - _classCallCheck(this, ListItemNB); - - return _possibleConstructorReturn(this, (ListItemNB.__proto__ || Object.getPrototypeOf(ListItemNB)).apply(this, arguments)); - } - - _createClass(ListItemNB, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - - return { - listItem: { - borderBottomWidth: this.getTheme().borderWidth, - marginLeft: 15, - padding: this.inputPresent() ? 0 : this.getTheme().listItemPadding, - paddingLeft: 2, - justifyContent: this.props.iconRight && !this.props.iconLeft || this.props.iconRight && this.props.iconLeft ? 'space-between' : 'flex-start', - flexDirection: this.stackedPresent() ? 'column' : 'row', - alignItems: 'center', - borderColor: this.props.hideBorder ? 'transparent' : this.inputPresent() && !this.inlinePresent() ? 'transparent' : this.getTheme().listBorderColor - }, - listItemDivider: { - borderBottomWidth: this.getTheme().borderWidth, - padding: this.getTheme().listItemPadding, - backgroundColor: this.getTheme().listDividerBg, - justifyContent: this.buttonPresent() ? 'space-between' : 'flex-start', - flexDirection: 'row', - borderColor: this.getTheme().listBorderColor - }, - itemText: { - fontSize: 16, - marginLeft: this.props.iconLeft ? 10 : 0, - color: this.getContextForegroundColor() - }, - dividerItemText: { - fontSize: 16, - fontWeight: '500' - }, - itemIcon: { - fontSize: this.getTheme().iconFontSize, - color: this.getContextForegroundColor(), - lineHeight: _platform2.default.OS === 'ios' ? 34 : undefined - }, - itemNote: { - fontSize: this.getTheme().listNoteSize, - color: this.getTheme().listNoteColor, - alignSelf: 'center', - fontWeight: '100', - flex: 1, - textAlign: 'right' - }, - itemSubNote: { - fontSize: this.getTheme().listNoteSize, - color: this.getTheme().listNoteColor, - lineHeight: 16 - }, - thumbnail: { - alignSelf: 'center' - }, - fullImage: { - width: 300, - height: 300 - }, - itemButton: {} - - }; - } - }, { - key: 'getRightStyle', - value: function getRightStyle() { - return { - right: { - flex: 1, - paddingLeft: 10 - - }, - right2: { - flex: 1, - flexDirection: 'row', - paddingLeft: 10, - alignItems: 'center', - justifyContent: 'space-between' - - }, - right3: { - flex: 1, - flexDirection: 'column', - paddingLeft: 10, - alignSelf: 'flex-start' - - } - }; - } - }, { - key: 'thumbnailPresent', - value: function thumbnailPresent() { - var thumbnailComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Thumbnail2.default) thumbnailComponentPresent = true; - }); - - return thumbnailComponentPresent; - } - }, { - key: 'checkBoxPresent', - value: function checkBoxPresent() { - var checkBoxComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Checkbox2.default) checkBoxComponentPresent = true; - }); - - return checkBoxComponentPresent; - } - }, { - key: 'radioPresent', - value: function radioPresent() { - var radioComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Radio2.default) radioComponentPresent = true; - }); - - return radioComponentPresent; - } - }, { - key: 'iconPresent', - value: function iconPresent() { - var iconComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Icon2.default) iconComponentPresent = true; - }); - - return iconComponentPresent; - } - }, { - key: 'badgePresent', - value: function badgePresent() { - var badgeComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Badge2.default) badgeComponentPresent = true; - }); - - return badgeComponentPresent; - } - }, { - key: 'inputPresent', - value: function inputPresent() { - var inputComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _InputGroup2.default) inputComponentPresent = true; - }); - return inputComponentPresent; - } - }, { - key: 'buttonPresent', - value: function buttonPresent() { - var buttonComponentPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Button2.default) buttonComponentPresent = true; - }); - - return buttonComponentPresent; - } - }, { - key: 'getChildProps', - value: function getChildProps(child) { - var defaultProps = {}; - - if (child.type == _reactNative.Image && !Array.isArray(this.props.children)) { - defaultProps = { - resizeMode: 'stretch', - style: this.getInitialStyle().fullImage - }; - } else if (child.type == _Button2.default) { - defaultProps = { - small: true, - style: this.getInitialStyle().itemButton - }; - } else if (child.type == _InputGroup2.default) { - - defaultProps = { - style: { - borderColor: this.props.children.props.success ? this.getTheme().inputSuccessBorderColor : this.props.children.props.error ? this.getTheme().inputErrorBorderColor : this.getTheme().listBorderColor - } - //foregroundColor: this.getContextForegroundColor() - }; - } else if (child.type == _Text2.default) { - if (this.props.itemDivider) { - defaultProps = { - style: this.getInitialStyle().dividerItemText - }; - } else { - if (child.props.note && this.thumbnailPresent()) { - defaultProps = { - style: this.getInitialStyle().itemSubNote - }; - } else if (child.props.note) { - defaultProps = { - style: this.getInitialStyle().itemNote - }; - } else { - defaultProps = { - style: this.getInitialStyle().itemText - }; - } - } - } else if (child.type == _Icon2.default) { - defaultProps = { - style: this.getInitialStyle().itemIcon - }; - } else if (child.type == _Thumbnail2.default) { - defaultProps = { - style: this.getInitialStyle().thumbnail - }; - } else { - defaultProps = { - //foregroundColor: this.getContextForegroundColor() - }; - } - return (0, _computeProps2.default)(child.props, defaultProps); - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - var defaultProps = {}; - - if (this.props.itemDivider) { - defaultProps = { - style: this.getInitialStyle().listItemDivider - }; - } else { - defaultProps = { - style: this.getInitialStyle().listItem - }; - } - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'notePresent', - value: function notePresent() { - - var notePresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Text2.default && child.props.note) notePresent = true; - }); - return notePresent; - } - }, { - key: 'insetPresent', - value: function insetPresent() { - - var insetPresent = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _InputGroup2.default && child.props.inset) insetPresent = true; - }); - - return insetPresent; - } - }, { - key: 'inlinePresent', - value: function inlinePresent() { - var inlineComponentPresent = false; - if (this.inputPresent()) { - if (this.props.children.props.children.props && this.props.children.props.children.props.inlineLabel) { - inlineComponentPresent = true; - } else inlineComponentPresent = false; - } - return inlineComponentPresent; - } - }, { - key: 'stackedPresent', - value: function stackedPresent() { - var stackedComponentPresent = false; - if (this.inputPresent()) { - if (this.props.children.props.children.props && this.props.children.props.children.props.stackedLabel) { - stackedComponentPresent = true; - } else stackedComponentPresent = false; - } - - return stackedComponentPresent; - } - }, { - key: 'squareThumbs', - value: function squareThumbs() { - var squareThumbs = false; - if (this.thumbnailPresent()) { - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.props.square) squareThumbs = true; - }); - } - return squareThumbs; - } - }, { - key: 'renderChildren', - value: function renderChildren() { - var _this2 = this; - - var newChildren = []; - if (!Array.isArray(this.props.children) && !this.inlinePresent() && !this.stackedPresent() && !this.insetPresent()) { - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem', style: { alignSelf: 'stretch', flex: 1 } }, - _react2.default.cloneElement(this.props.children, this.getChildProps(this.props.children)) - )); - } else { - var childrenArray = _react2.default.Children.toArray(this.props.children); - var iconElement = []; - - if (this.props.iconLeft && !this.props.iconRight) { - - iconElement = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Icon2.default) { - return true; - } - }); - newChildren.push(_react2.default.cloneElement(iconElement[0], _extends({}, this.getChildProps(iconElement[0]), { key: 'listItem0' }))); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem1', style: { flexDirection: 'row', justifyContent: 'space-between', flex: 1 } }, - childrenArray.map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }) - )); - } else if (this.props.iconRight && !this.props.iconLeft) { - - iconElement = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Icon2.default) { - return true; - } - }); - - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem0' }, - childrenArray.map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }) - )); - newChildren.push(_react2.default.cloneElement(iconElement[0], _extends({}, this.getChildProps(iconElement[0]), { key: 'listItem1' }))); - } else if (this.badgePresent()) { - - var badgeElement = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Badge2.default) { - return true; - } - }); - - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem0' }, - childrenArray.map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }) - )); - newChildren.push(_react2.default.cloneElement(badgeElement[0], _extends({}, this.getChildProps(badgeElement[0]), { key: 'listItem1' }))); - } else if (this.props.iconRight && this.props.iconLeft) { - - iconElement = _lodash2.default.filter(childrenArray, function (item) { - if (item.type == _Icon2.default) { - return true; - } - }); - - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem0', style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' } }, - childrenArray.slice(0, 2).map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }) - )); - newChildren.push(_react2.default.cloneElement(iconElement[1], _extends({}, this.getChildProps(iconElement[1]), { key: 'listItem1' }))); - } else if (this.thumbnailPresent()) { - - iconElement = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Thumbnail2.default) { - return true; - } - }); - newChildren.push(_react2.default.cloneElement(iconElement[0], _extends({}, this.getChildProps(iconElement[0]), { key: 'listItem0' }))); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem1', style: { flexDirection: 'column', paddingLeft: 15, alignSelf: this.squareThumbs() ? 'flex-start' : 'center', flex: 1 } }, - childrenArray.map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }) - )); - } else if (this.checkBoxPresent()) { - - iconElement = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Checkbox2.default) { - return true; - } - }); - newChildren.push(_react2.default.cloneElement(iconElement[0], this.getChildProps(iconElement[0]))); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem1', style: { flexDirection: 'column', paddingLeft: 15, alignSelf: this.squareThumbs() ? 'flex-start' : 'center', flex: 1 } }, - childrenArray.map(function (child) { - return _react2.default.cloneElement(child, _this2.getChildProps(child)); - }) - )); - } else if (this.radioPresent()) { - - iconElement = _lodash2.default.remove(childrenArray, function (item) { - if (item.type == _Radio2.default) { - return true; - } - }); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem1', style: { flexDirection: 'column', alignSelf: this.squareThumbs() ? 'flex-start' : 'center', flex: 1 } }, - childrenArray.map(function (child) { - return _react2.default.cloneElement(child, _this2.getChildProps(child)); - }) - )); - newChildren.push(_react2.default.cloneElement(iconElement[0], this.getChildProps(iconElement[0]))); - } else if (this.inputPresent() && !this.inlinePresent() && !this.stackedPresent() && !this.insetPresent()) { - - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem0', style: { flexDirection: 'column', alignSelf: 'center', flex: 1 } }, - childrenArray.map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }) - )); - } else if (this.inlinePresent()) { - - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem0', style: { flexDirection: 'row', justifyContent: 'center', flex: 1, borderColor: this.getTheme().listBorderColor, alignItems: 'center', height: this.getTheme().inputHeightBase } }, - _react2.default.createElement( - _Text2.default, - { style: { color: this.getTheme().inputColorPlaceholder } }, - this.props.children.props.children.props.label - ) - )); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem1', style: { flexDirection: 'column', alignSelf: 'center', flex: 2.2 } }, - childrenArray.map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i, style: { borderWidth: 0 } })); - }) - )); - } else if (this.stackedPresent()) { - - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem0', style: { flexDirection: 'row', justifyContent: 'flex-start', alignSelf: 'stretch', alignItems: 'center', height: this.getTheme().inputHeightBase, paddingLeft: 10 } }, - _react2.default.createElement( - _Text2.default, - { style: { color: this.getTheme().inputColorPlaceholder, textAlign: 'left', fontSize: 15 } }, - this.props.children.props.children.props.label - ) - )); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem1', style: { flexDirection: 'row', alignSelf: 'stretch', flex: 1, padding: 0 } }, - childrenArray.map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i, style: { flex: 1 } })); - }) - )); - } else if (this.insetPresent()) { - - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem0', style: { flexDirection: 'row', alignSelf: 'stretch', flex: 1, padding: 0 } }, - childrenArray.map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }) - )); - newChildren.push(_react2.default.createElement( - _View2.default, - { key: 'listItem1', style: { flexDirection: 'row', alignSelf: 'stretch', flex: 1, padding: 0 } }, - childrenArray.map(function (child, i) { - return _react2.default.cloneElement(child, _extends({}, _this2.getChildProps(child), { key: i })); - }) - )); - } - } - - return newChildren; - } - }, { - key: 'render', - value: function render() { - var _this3 = this; - - if (this.props.menuItem) { - return _react2.default.createElement( - _View2.default, - { style: { - backgroundColor: this.isItemPressIn ? '#eee' : 'white' - } }, - _react2.default.createElement( - _TouchableOpacityScrollable2.default, - _extends({}, this.prepareRootProps(), { activeOpacity: this.props.button ? 0.2 : 1, - onPressIn: function onPressIn() { - _this3.isItemPressIn = true; - _this3.forceUpdate(); - }, - onPressOut: function onPressOut() { - _this3.isItemPressIn = false; - _this3.forceUpdate(); - } }), - this.renderChildren() - ) - ); - } else if (this.stackedPresent()) { - return _react2.default.createElement( - _View2.default, - this.prepareRootProps(), - this.renderChildren() - ); - } else { - return _react2.default.createElement( - _TouchableOpacityScrollable2.default, - _extends({}, this.prepareRootProps(), { activeOpacity: this.props.button ? 0.2 : 1 }), - this.renderChildren() - ); - } - } - }]); - - return ListItemNB; -}(_NativeBaseComponent3.default); - -exports.default = ListItemNB; \ No newline at end of file diff --git a/lib/Components/Widgets/Picker.ios.js b/lib/Components/Widgets/Picker.ios.js deleted file mode 100644 index 9e582bdf..00000000 --- a/lib/Components/Widgets/Picker.ios.js +++ /dev/null @@ -1,212 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _View = require('./View'); - -var _View2 = _interopRequireDefault(_View); - -var _Text = require('./Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _List = require('./List'); - -var _List2 = _interopRequireDefault(_List); - -var _Icon = require('./Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -var _Container = require('./Container'); - -var _Container2 = _interopRequireDefault(_Container); - -var _Content = require('./Content'); - -var _Content2 = _interopRequireDefault(_Content); - -var _ListItem = require('./ListItem'); - -var _ListItem2 = _interopRequireDefault(_ListItem); - -var _Button = require('./Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _Header = require('./Header'); - -var _Header2 = _interopRequireDefault(_Header); - -var _Title = require('./Title'); - -var _Title2 = _interopRequireDefault(_Title); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PickerNB = function (_NativeBaseComponent) { - _inherits(PickerNB, _NativeBaseComponent); - - function PickerNB(props) { - _classCallCheck(this, PickerNB); - - var _this = _possibleConstructorReturn(this, (PickerNB.__proto__ || Object.getPrototypeOf(PickerNB)).call(this, props)); - - _this.state = { - modalVisible: false, - current: _this.getSelected().props.label - }; - return _this; - } - - _createClass(PickerNB, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - picker: { - // alignItems: 'flex-end' - }, - pickerItem: {} - }; - } - }, { - key: '_setModalVisible', - value: function _setModalVisible(visible) { - this.setState({ modalVisible: visible }); - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var defaultProps = { - style: this.getInitialStyle().picker, - itemStyle: this.getInitialStyle().pickerItem - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'getSelected', - value: function getSelected() { - var _this2 = this; - - var selected = _lodash2.default.find(this.props.children, function (o) { - return o.props.value == _this2.props.selectedValue; - }); - return selected; - } - }, { - key: 'render', - value: function render() { - var _this3 = this; - - return _react2.default.createElement( - _View2.default, - null, - _react2.default.createElement( - _Button2.default, - { transparent: true, onPress: function onPress() { - _this3._setModalVisible(true); - } }, - this.state.current - ), - _react2.default.createElement( - _reactNative.Modal, - { animationType: 'slide', - transparent: false, - visible: this.state.modalVisible, - onRequestClose: function onRequestClose() { - _this3._setModalVisible(false); - } - }, - _react2.default.createElement( - _Container2.default, - null, - _react2.default.createElement( - _Header2.default, - null, - _react2.default.createElement( - _Button2.default, - { transparent: true, onPress: function onPress() { - _this3._setModalVisible(false); - } }, - 'Back' - ), - _react2.default.createElement( - _Title2.default, - null, - this.props.iosHeader - ), - _react2.default.createElement( - _Button2.default, - { transparent: true, textStyle: { color: 'transparent' } }, - 'Back' - ) - ), - _react2.default.createElement( - _Content2.default, - null, - _react2.default.createElement(_List2.default, { dataArray: this.props.children, - renderRow: function renderRow(child) { - return _react2.default.createElement( - _ListItem2.default, - { style: { paddingVertical: 10 }, iconRight: true, button: true, onPress: function onPress() { - _this3._setModalVisible(false);_this3.props.onValueChange(child.props.value);_this3.setState({ current: child.props.label }); - } }, - _react2.default.createElement( - _Text2.default, - null, - child.props.label - ), - child.props.value === _this3.props.selectedValue ? _react2.default.createElement(_Icon2.default, { name: 'ios-checkmark-outline' }) : _react2.default.createElement(_Icon2.default, { name: 'ios-checkmark-outline', style: { color: 'transparent' } }) - ); - } }) - ) - ) - ) - ); - } - }]); - - return PickerNB; -}(_NativeBaseComponent3.default); - -exports.default = PickerNB; - - -PickerNB.Item = _react2.default.createClass({ - displayName: 'Item', - - - render: function render() { - return _react2.default.createElement(_reactNative.Picker.Item, typeof this.props === "function" ? this.props() : this.props); - } -}); \ No newline at end of file diff --git a/lib/Components/Widgets/Picker.js b/lib/Components/Widgets/Picker.js deleted file mode 100644 index 235663b9..00000000 --- a/lib/Components/Widgets/Picker.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PickerNB = function (_NativeBaseComponent) { - _inherits(PickerNB, _NativeBaseComponent); - - function PickerNB() { - _classCallCheck(this, PickerNB); - - return _possibleConstructorReturn(this, (PickerNB.__proto__ || Object.getPrototypeOf(PickerNB)).apply(this, arguments)); - } - - _createClass(PickerNB, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - picker: {}, - pickerItem: {} - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var defaultProps = { - style: this.getInitialStyle().picker, - itemStyle: this.getInitialStyle().pickerItem - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.Picker, - this.prepareRootProps(), - this.props.children - ); - } - }]); - - return PickerNB; -}(_NativeBaseComponent3.default); - -exports.default = PickerNB; - - -PickerNB.Item = _react2.default.createClass({ - displayName: 'Item', - - - render: function render() { - return _react2.default.createElement(_reactNative.Picker.Item, typeof this.props === "function" ? this.props() : this.props); - } -}); \ No newline at end of file diff --git a/lib/Components/Widgets/ProgressBar.android.js b/lib/Components/Widgets/ProgressBar.android.js deleted file mode 100644 index b078893f..00000000 --- a/lib/Components/Widgets/ProgressBar.android.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _ProgressBarAndroid = require('ProgressBarAndroid'); - -var _ProgressBarAndroid2 = _interopRequireDefault(_ProgressBarAndroid); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var SpinnerNB = function (_NativeBaseComponent) { - _inherits(SpinnerNB, _NativeBaseComponent); - - function SpinnerNB() { - _classCallCheck(this, SpinnerNB); - - return _possibleConstructorReturn(this, (SpinnerNB.__proto__ || Object.getPrototypeOf(SpinnerNB)).apply(this, arguments)); - } - - _createClass(SpinnerNB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - height: 40 - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(_ProgressBarAndroid2.default, _extends({}, this.prepareRootProps(), { styleAttr: 'Horizontal', - indeterminate: false, progress: this.props.progress ? this.props.progress / 100 : 0.5, - color: this.props.color ? this.props.color : this.props.inverse ? this.getTheme().inverseProgressColor : this.getTheme().defaultProgressColor })); - } - }]); - - return SpinnerNB; -}(_NativeBaseComponent3.default); - -exports.default = SpinnerNB; \ No newline at end of file diff --git a/lib/Components/Widgets/ProgressBar.ios.js b/lib/Components/Widgets/ProgressBar.ios.js deleted file mode 100644 index bd9f9347..00000000 --- a/lib/Components/Widgets/ProgressBar.ios.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// import computeProps from '../../Utils/computeProps'; - - -var ProgressBarNB = function (_NativeBaseComponent) { - _inherits(ProgressBarNB, _NativeBaseComponent); - - function ProgressBarNB() { - _classCallCheck(this, ProgressBarNB); - - return _possibleConstructorReturn(this, (ProgressBarNB.__proto__ || Object.getPrototypeOf(ProgressBarNB)).apply(this, arguments)); - } - - _createClass(ProgressBarNB, [{ - key: 'render', - value: function render() { - return _react2.default.createElement(_reactNative.ProgressViewIOS, { progress: this.props.progress ? this.props.progress / 100 : 0.5, - progressTintColor: this.props.color ? this.props.color : this.props.inverse ? this.getTheme().inverseProgressColor : this.getTheme().defaultProgressColor }); - } - }]); - - return ProgressBarNB; -}(_NativeBaseComponent3.default); - -exports.default = ProgressBarNB; \ No newline at end of file diff --git a/lib/Components/Widgets/Radio.js b/lib/Components/Widgets/Radio.js deleted file mode 100644 index 679d723f..00000000 --- a/lib/Components/Widgets/Radio.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _Icon = require('./Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -var _platform = require('../../Utils/platform'); - -var _platform2 = _interopRequireDefault(_platform); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Radio = function (_NativeBaseComponent) { - _inherits(Radio, _NativeBaseComponent); - - function Radio() { - _classCallCheck(this, Radio); - - return _possibleConstructorReturn(this, (Radio.__proto__ || Object.getPrototypeOf(Radio)).apply(this, arguments)); - } - - _createClass(Radio, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - radio: {} - }; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.View, - null, - _platform2.default.OS === 'ios' ? _react2.default.createElement(_Icon2.default, { name: this.props.selected ? 'md-radio-button-on' : 'md-radio-button-off', style: { color: this.props.selected ? this.getTheme().radioSelectedColor : this.getTheme().radioColor, lineHeight: this.getTheme().radioBtnSize + 4, fontSize: this.getTheme().radioBtnSize } }) : _react2.default.createElement(_Icon2.default, { name: this.props.selected ? 'md-radio-button-on' : 'md-radio-button-off', style: { color: this.props.selected ? this.getTheme().radioSelectedColor : this.getTheme().radioColor, lineHeight: this.getTheme().radioBtnSize + 1, fontSize: this.getTheme().radioBtnSize } }) - ); - } - }]); - - return Radio; -}(_NativeBaseComponent3.default); - -exports.default = Radio; \ No newline at end of file diff --git a/lib/Components/Widgets/Spinner.js b/lib/Components/Widgets/Spinner.js deleted file mode 100644 index d0eef849..00000000 --- a/lib/Components/Widgets/Spinner.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var SpinnerNB = function (_NativeBaseComponent) { - _inherits(SpinnerNB, _NativeBaseComponent); - - function SpinnerNB() { - _classCallCheck(this, SpinnerNB); - - return _possibleConstructorReturn(this, (SpinnerNB.__proto__ || Object.getPrototypeOf(SpinnerNB)).apply(this, arguments)); - } - - _createClass(SpinnerNB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - height: 80 - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(_reactNative.ActivityIndicator, _extends({}, this.prepareRootProps(), { color: this.props.color ? this.props.color : this.props.inverse ? this.getTheme().inverseSpinnerColor : this.getTheme().defaultSpinnerColor, - size: this.props.size ? this.props.size : 'large' })); - } - }]); - - return SpinnerNB; -}(_NativeBaseComponent3.default); - -exports.default = SpinnerNB; \ No newline at end of file diff --git a/lib/Components/Widgets/Subtitle.js b/lib/Components/Widgets/Subtitle.js deleted file mode 100644 index 3bf16fb9..00000000 --- a/lib/Components/Widgets/Subtitle.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _platform = require('../../Utils/platform'); - -var _platform2 = _interopRequireDefault(_platform); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Subtitle = function (_NativeBaseComponent) { - _inherits(Subtitle, _NativeBaseComponent); - - function Subtitle() { - _classCallCheck(this, Subtitle); - - return _possibleConstructorReturn(this, (Subtitle.__proto__ || Object.getPrototypeOf(Subtitle)).apply(this, arguments)); - } - - _createClass(Subtitle, [{ - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.View, - null, - _react2.default.createElement( - _reactNative.Text, - { style: { color: this.getTheme().subtitleColor, fontSize: this.getTheme().subTitleFontSize, alignSelf: _platform2.default.OS === 'ios' ? 'center' : 'flex-start' } }, - this.props.children - ) - ); - } - }]); - - return Subtitle; -}(_NativeBaseComponent3.default); - -exports.default = Subtitle; \ No newline at end of file diff --git a/lib/Components/Widgets/Switch.js b/lib/Components/Widgets/Switch.js deleted file mode 100644 index e9794747..00000000 --- a/lib/Components/Widgets/Switch.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var SwitchNB = function (_NativeBaseComponent) { - _inherits(SwitchNB, _NativeBaseComponent); - - function SwitchNB() { - _classCallCheck(this, SwitchNB); - - return _possibleConstructorReturn(this, (SwitchNB.__proto__ || Object.getPrototypeOf(SwitchNB)).apply(this, arguments)); - } - - _createClass(SwitchNB, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - switch: {} - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - var defaultProps = { - style: this.getInitialStyle().switch - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(_reactNative.Switch, this.prepareRootProps()); - } - }]); - - return SwitchNB; -}(_NativeBaseComponent3.default); - -exports.default = SwitchNB; \ No newline at end of file diff --git a/lib/Components/Widgets/TabBarItem.js b/lib/Components/Widgets/TabBarItem.js deleted file mode 100644 index a0316939..00000000 --- a/lib/Components/Widgets/TabBarItem.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _Icon = require('./Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TabBarItem = function (_Component) { - _inherits(TabBarItem, _Component); - - function TabBarItem() { - _classCallCheck(this, TabBarItem); - - return _possibleConstructorReturn(this, (TabBarItem.__proto__ || Object.getPrototypeOf(TabBarItem)).apply(this, arguments)); - } - - _createClass(TabBarItem, [{ - key: 'getIconNode', - value: function getIconNode() { - return _react2.default.createElement(_Icon2.default, { name: this.props.selected && this.props.selectedIconName ? this.props.selectedIconName : this.props.iconName, - family: this.props.family, - size: this.props.iconSize || 30, - color: this.props.selected && this.props.selectedIconColor ? this.props.selectedIconColor : this.props.iconColor, - style: { - marginBottom: -2 - } }); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(_reactNative.TabBarIOS.Item, _extends({}, this.props, { - iconComponent: this.getIconNode() })); - } - }]); - - return TabBarItem; -}(_react.Component); - -TabBarItem.propTypes = { - iconName: _propTypes2.default.string.isRequired, - selectedIconName: _propTypes2.default.string, - iconSize: _propTypes2.default.number, - iconColor: _propTypes2.default.string, - selectedIconColor: _propTypes2.default.string -}; -exports.default = TabBarItem; \ No newline at end of file diff --git a/lib/Components/Widgets/Tabs.js b/lib/Components/Widgets/Tabs.js deleted file mode 100644 index 83b22e45..00000000 --- a/lib/Components/Widgets/Tabs.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _reactNativeScrollableTabView = require('./../vendor/react-native-scrollable-tab-view'); - -var _reactNativeScrollableTabView2 = _interopRequireDefault(_reactNativeScrollableTabView); - -var _View = require('./View'); - -var _View2 = _interopRequireDefault(_View); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TabNB = function (_NativeBaseComponent) { - _inherits(TabNB, _NativeBaseComponent); - - function TabNB() { - _classCallCheck(this, TabNB); - - return _possibleConstructorReturn(this, (TabNB.__proto__ || Object.getPrototypeOf(TabNB)).apply(this, arguments)); - } - - _createClass(TabNB, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - tab: { - flex: 1 - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var defaultProps = { - style: this.getInitialStyle().tab - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'renderTabBarChildren', - value: function renderTabBarChildren() { - var children = []; - _react2.default.Children.forEach(this.props.children, function (child, index) { - var ChildType = child.type; - var props = _lodash2.default.clone(child.props); - var style = _lodash2.default.clone(child.props.style || {}); - if (props.style) delete props.style; - - style.width = _reactNative.Dimensions.get('window').width; - - children.push(_react2.default.createElement( - ChildType, - _extends({}, props, { style: style, key: index }), - child.props.children - )); - }.bind(this)); - return children; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _View2.default, - { style: { - width: '100%', - overflowX: 'hidden' - } }, - _react2.default.createElement( - _reactNativeScrollableTabView2.default, - this.prepareRootProps(), - this.renderTabBarChildren() - ) - ); - } - }]); - - return TabNB; -}(_NativeBaseComponent3.default); - -exports.default = TabNB; \ No newline at end of file diff --git a/lib/Components/Widgets/Text.js b/lib/Components/Widgets/Text.js deleted file mode 100644 index 21445f12..00000000 --- a/lib/Components/Widgets/Text.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TextNB = function (_NativeBaseComponent) { - _inherits(TextNB, _NativeBaseComponent); - - function TextNB() { - _classCallCheck(this, TextNB); - - return _possibleConstructorReturn(this, (TextNB.__proto__ || Object.getPrototypeOf(TextNB)).apply(this, arguments)); - } - - _createClass(TextNB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - color: this.getContextForegroundColor(), - fontSize: this.getTheme().fontSizeBase, - lineHeight: this.getTheme().lineHeight, - fontFamily: this.getTheme().fontFamily - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.Text, - this.prepareRootProps(), - this.props.children - ); - } - }]); - - return TextNB; -}(_NativeBaseComponent3.default); - -exports.default = TextNB; \ No newline at end of file diff --git a/lib/Components/Widgets/Textarea.js b/lib/Components/Widgets/Textarea.js deleted file mode 100644 index d4c8c35f..00000000 --- a/lib/Components/Widgets/Textarea.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Textarea = function (_NativeBaseComponent) { - _inherits(Textarea, _NativeBaseComponent); - - function Textarea() { - _classCallCheck(this, Textarea); - - return _possibleConstructorReturn(this, (Textarea.__proto__ || Object.getPrototypeOf(Textarea)).apply(this, arguments)); - } - - _createClass(Textarea, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - input: { - height: this.props.rowSpan * 25, - color: this.getTheme().textColor, - paddingLeft: 5, - paddingRight: 5, - fontSize: 18 - } - }; - } - }, { - key: 'getBorderStyle', - value: function getBorderStyle() { - return { - underline: { - borderTopWidth: 0, - borderRightWidth: 0, - borderLeftWidth: 0, - marginTop: 5 - }, - - bordered: { - marginTop: 5 - }, - - rounded: { - borderRadius: 30, - marginTop: 5 - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - - var defaultProps = { - style: this.getInitialStyle().input - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - - return _react2.default.createElement( - _reactNative.View, - { style: { flex: 1 } }, - _react2.default.createElement(_reactNative.TextInput, _extends({}, this.prepareRootProps(), { multiline: true, placeholderTextColor: this.getTheme().inputColorPlaceholder, underlineColorAndroid: 'rgba(0,0,0,0)' })) - ); - } - }]); - - return Textarea; -}(_NativeBaseComponent3.default); - -exports.default = Textarea; \ No newline at end of file diff --git a/lib/Components/Widgets/Thumbnail.js b/lib/Components/Widgets/Thumbnail.js deleted file mode 100644 index f36c1a74..00000000 --- a/lib/Components/Widgets/Thumbnail.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ThumbnailNB = function (_NativeBaseComponent) { - _inherits(ThumbnailNB, _NativeBaseComponent); - - function ThumbnailNB() { - _classCallCheck(this, ThumbnailNB); - - return _possibleConstructorReturn(this, (ThumbnailNB.__proto__ || Object.getPrototypeOf(ThumbnailNB)).apply(this, arguments)); - } - - _createClass(ThumbnailNB, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - thumbnail: { - borderRadius: this.props.size ? this.props.size / 2 : 15, - width: this.props.size ? this.props.size : 30, - height: this.props.size ? this.props.size : 30, - resizeMode: this.props.contain ? 'contain' : undefined - } - }; - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - var thumbnailStyle = {}; - if (this.props.circular) { - thumbnailStyle.width = this.props.size; - thumbnailStyle.height = this.props.size; - thumbnailStyle.borderRadius = this.props.size / 2; - } else if (this.props.square) { - thumbnailStyle.width = this.props.size; - thumbnailStyle.height = this.props.size; - thumbnailStyle.borderRadius = 0; - } - - var defaultProps = { - style: _lodash2.default.merge(this.getInitialStyle().thumbnail, thumbnailStyle) - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement(_reactNative.Image, this.prepareRootProps()); - } - }]); - - return ThumbnailNB; -}(_NativeBaseComponent3.default); - -exports.default = ThumbnailNB; \ No newline at end of file diff --git a/lib/Components/Widgets/Title.js b/lib/Components/Widgets/Title.js deleted file mode 100644 index 18b05c45..00000000 --- a/lib/Components/Widgets/Title.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _platform = require('../../Utils/platform'); - -var _platform2 = _interopRequireDefault(_platform); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _Text = require('./Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _View = require('./View'); - -var _View2 = _interopRequireDefault(_View); - -var _computeProps = require('../../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Title = function (_NativeBaseComponent) { - _inherits(Title, _NativeBaseComponent); - - function Title() { - _classCallCheck(this, Title); - - return _possibleConstructorReturn(this, (Title.__proto__ || Object.getPrototypeOf(Title)).apply(this, arguments)); - } - - _createClass(Title, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - color: this.getTheme().toolbarTextColor, - fontSize: this.getTheme().titleFontSize, - fontFamily: this.getTheme().btnFontFamily, - fontWeight: _platform2.default.OS === 'ios' ? '500' : undefined, - alignSelf: _platform2.default.OS === 'ios' ? 'center' : 'flex-start' - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _View2.default, - { style: { justifyContent: 'center' } }, - _react2.default.createElement( - _Text2.default, - this.prepareRootProps(), - this.props.children - ) - ); - } - }]); - - return Title; -}(_NativeBaseComponent3.default); - -exports.default = Title; \ No newline at end of file diff --git a/lib/Components/Widgets/TouchableOpacityScrollable.js b/lib/Components/Widgets/TouchableOpacityScrollable.js deleted file mode 100644 index 44073fad..00000000 --- a/lib/Components/Widgets/TouchableOpacityScrollable.js +++ /dev/null @@ -1,124 +0,0 @@ -/* Author: @Chion82 */ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TouchableOpacityScrollable = function (_NativeBaseComponent) { - _inherits(TouchableOpacityScrollable, _NativeBaseComponent); - - function TouchableOpacityScrollable(props) { - _classCallCheck(this, TouchableOpacityScrollable); - - var _this = _possibleConstructorReturn(this, (TouchableOpacityScrollable.__proto__ || Object.getPrototypeOf(TouchableOpacityScrollable)).call(this, props)); - - _this.state = { - ignoreMouseEvent: false, - fadeAnim: new _reactNative.Animated.Value(1) - }; - return _this; - } - - _createClass(TouchableOpacityScrollable, [{ - key: 'handlePressIn', - value: function handlePressIn() { - _reactNative.Animated.timing(this.state.fadeAnim, { - toValue: this.props.activeOpacity || 0.2 - }).start(); - } - }, { - key: 'handlePressOut', - value: function handlePressOut() { - _reactNative.Animated.timing(this.state.fadeAnim, { - toValue: 1 - }).start(); - } - }, { - key: 'prepareRootProps', - value: function prepareRootProps() { - var _this2 = this; - - var props = _lodash2.default.clone(this.props); - if (props.onPress) { - props.onClick = props.onPress; - delete props.onPress; - } - - var onPressIn = props.onPressIn || function () {}; - props.onMouseDown = function (e) { - if (_this2.state.ignoreMouseEvent) return; - _this2.handlePressIn(); - return onPressIn(e); - }; - props.onTouchStart = function (e) { - _this2.setState({ - ignoreMouseEvent: true - }); - _this2.handlePressIn(); - return onPressIn(e); - }; - delete props.onPressIn; - - var onPressOut = props.onPressOut || function () {}; - props.onMouseUp = function (e) { - if (_this2.state.ignoreMouseEvent) return; - _this2.handlePressOut(); - return onPressOut(e); - }; - props.onTouchEnd = function (e) { - _this2.setState({ - ignoreMouseEvent: true - }); - _this2.handlePressOut(); - return onPressOut(e); - }; - delete props.onPressOut; - - if (props.style) delete props.style; - - return props; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.Animated.View, - _extends({}, this.prepareRootProps(), { style: _extends({}, this.props.style || {}, { - opacity: this.state.fadeAnim - }) }), - this.props.children - ); - } - }]); - - return TouchableOpacityScrollable; -}(_NativeBaseComponent3.default); - -exports.default = TouchableOpacityScrollable; \ No newline at end of file diff --git a/lib/Components/Widgets/View.js b/lib/Components/Widgets/View.js deleted file mode 100644 index c4bd417e..00000000 --- a/lib/Components/Widgets/View.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _reactNative = require('react-native'); - -var _NativeBaseComponent2 = require('../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ViewNB = function (_NativeBaseComponent) { - _inherits(ViewNB, _NativeBaseComponent); - - function ViewNB() { - _classCallCheck(this, ViewNB); - - return _possibleConstructorReturn(this, (ViewNB.__proto__ || Object.getPrototypeOf(ViewNB)).apply(this, arguments)); - } - - _createClass(ViewNB, [{ - key: 'render', - value: function render() { - return _react2.default.createElement(_reactNative.View, _extends({ style: { padding: this.props.padder ? this.getTheme().contentPadding : 0, flex: 1 } }, this.props)); - } - }]); - - return ViewNB; -}(_NativeBaseComponent3.default); - -exports.default = ViewNB; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-drawer/index.js b/lib/Components/vendor/react-native-drawer/index.js deleted file mode 100644 index 0233ae90..00000000 --- a/lib/Components/vendor/react-native-drawer/index.js +++ /dev/null @@ -1,583 +0,0 @@ -'use strict'; - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactNative = require('react-native'); - -var _tweener = require('./tweener'); - -var _tweener2 = _interopRequireDefault(_tweener); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var deviceScreen = _reactNative.Dimensions.get('window'); - -var Drawer = function (_Component) { - _inherits(Drawer, _Component); - - function Drawer(props) { - _classCallCheck(this, Drawer); - - // `this` keyword binding - No Autobinding in ES6 Classes - var _this = _possibleConstructorReturn(this, (Drawer.__proto__ || Object.getPrototypeOf(Drawer)).call(this, props)); - - _this._left = 0; - _this._prevLeft = 0; - _this._offsetOpen = 0; - _this._offsetClosed = 0; - _this._open = false; - _this._panning = false; - _this._tweenPending = false; - _this._activeTween = null; - _this._lastPress = 0; - _this._panStartTime = 0; - _this._syncAfterUpdate = false; - - _this.processShouldSet = function (e, gestureState) { - var inMask = _this.testPanResponderMask(e, gestureState); - if (inMask) { - var toggled = _this.processTapGestures(); - if (toggled) return false; - if (_this.props.captureGestures && _this.props.acceptPan) return true; - } - if (_this.props.negotiatePan) return false; - _this._panStartTime = Date.now(); - if (!inMask) return false; - if (!_this.props.acceptPan) return false; - _this.terminateActiveTween(); - return true; - }; - - _this.processTapGestures = function () { - if (_this._activeTween) return false; // disable tap gestures during tween - var minLastPressInterval = 500; - if (_this.props.acceptTap) { - _this._open ? _this.close() : _this.open(); - return true; - } - if (_this.props.tapToClose && _this._open) { - _this.close(); - return true; - } - if (_this.props.acceptDoubleTap) { - var now = new Date().getTime(); - var timeDelta = now - _this._lastPress; - _this._lastPress = now; - if (timeDelta < minLastPressInterval) { - _this._open ? _this.close() : _this.open(); - return true; - } - } - return false; - }; - - _this.terminateActiveTween = function () { - if (_this._activeTween) { - _this._activeTween.terminate(); - _this._activeTween = null; - } - }; - - _this.open = function () { - _this.props.onOpenStart && _this.props.onOpenStart(); - if (_this._activeTween) return; - _this._activeTween = (0, _tweener2.default)({ - start: _this._left, - end: _this.getOpenLeft(), - duration: _this.props.tweenDuration, - easingType: _this.props.tweenEasing, - onFrame: function onFrame(tweenValue) { - _this._left = tweenValue; - _this.updatePosition(); - }, - onEnd: function onEnd() { - _this._activeTween = null; - _this._open = true; - _this._prevLeft = _this._left; - if (_this.props.type === 'overlay') { - _this.mainOverlay.setNativeProps({ style: { width: _this.getMainWidth() } }); - } - _this.props.onOpen(); - } - }); - }; - - _this.close = function () { - _this.props.onCloseStart && _this.props.onCloseStart(); - if (_this._activeTween) return; - _this._activeTween = (0, _tweener2.default)({ - start: _this._left, - end: _this.getClosedLeft(), - easingType: _this.props.tweenEasing, - duration: _this.props.tweenDuration, - onFrame: function onFrame(tweenValue) { - _this._left = tweenValue; - _this.updatePosition(); - }, - onEnd: function onEnd() { - _this._activeTween = null; - _this._open = false; - _this._prevLeft = _this._left; - if (_this.props.type === 'overlay') _this.mainOverlay.setNativeProps({ style: { width: 0 } }); - _this.props.onClose(); - } - }); - }; - - _this.toggle = function () { - _this._open ? _this.close() : _this.open(); - }; - - _this.handleStartShouldSetPanResponderCapture = _this.handleStartShouldSetPanResponderCapture.bind(_this); - _this.handleStartShouldSetPanResponder = _this.handleStartShouldSetPanResponder.bind(_this); - _this.handleMoveShouldSetPanResponderCapture = _this.handleMoveShouldSetPanResponderCapture.bind(_this); - _this.handleMoveShouldSetPanResponder = _this.handleMoveShouldSetPanResponder.bind(_this); - _this.handlePanResponderMove = _this.handlePanResponderMove.bind(_this); - _this.handlePanResponderEnd = _this.handlePanResponderEnd.bind(_this); - _this.componentWillMount = _this.componentWillMount.bind(_this); - _this.componentWillReceiveProps = _this.componentWillReceiveProps.bind(_this); - _this.componentDidUpdate = _this.componentDidUpdate.bind(_this); - _this.updatePosition = _this.updatePosition.bind(_this); - _this.shouldOpenDrawer = _this.shouldOpenDrawer.bind(_this); - _this.testPanResponderMask = _this.testPanResponderMask.bind(_this); - _this.getMainView = _this.getMainView.bind(_this); - _this.getDrawerView = _this.getDrawerView.bind(_this); - _this.getOpenLeft = _this.getOpenLeft.bind(_this); - _this.getClosedLeft = _this.getClosedLeft.bind(_this); - _this.getMainWidth = _this.getMainWidth.bind(_this); - _this.getDrawerWidth = _this.getDrawerWidth.bind(_this); - _this.initialize = _this.initialize.bind(_this); - _this.handleSetViewport = _this.handleSetViewport.bind(_this); - _this.resync = _this.resync.bind(_this); - _this.requiresResync = _this.requiresResync.bind(_this); - - _this.propsWhomRequireUpdate = ['closedDrawerOffset', 'openDrawerOffset', 'type']; - - _this.state = { viewport: props.deviceScreen }; - return _this; - } - - _createClass(Drawer, [{ - key: 'getChildContext', - value: function getChildContext() { - return { drawer: this }; - } - }, { - key: 'componentWillMount', - value: function componentWillMount() { - this.initialize(this.props); - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (this.requiresResync(nextProps)) { - this.resync(null, nextProps); - } - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - if (this._syncAfterUpdate) { - this._syncAfterUpdate = false; - this._open ? this.open() : this.close(); - } - } - }, { - key: 'updatePosition', - value: function updatePosition() { - var mainProps = {}; - var drawerProps = {}; - var ratio = (this._left - this._offsetClosed) / (this.getOpenLeft() - this._offsetClosed); - - switch (this.props.type) { - case 'overlay': - drawerProps[this.props.side] = -this.state.viewport.width + this._offsetOpen + this._left; - mainProps[this.props.side] = this._offsetClosed; - break; - case 'static': - mainProps[this.props.side] = this._left; - drawerProps[this.props.side] = 0; - break; - case 'displace': - mainProps[this.props.side] = this._left; - drawerProps[this.props.side] = -this.state.viewport.width + this._left + this._offsetOpen; - break; - } - - if (this.props.tweenHandler) { - var propsFrag = this.props.tweenHandler(ratio, this.props.side); - mainProps = Object.assign(mainProps, propsFrag.main); - drawerProps = Object.assign(drawerProps, propsFrag.drawer); - } - this.drawer.setNativeProps({ style: drawerProps }); - this.main.setNativeProps({ style: mainProps }); - } - }, { - key: 'shouldOpenDrawer', - value: function shouldOpenDrawer(dx) { - if (this._open) return dx < this.state.viewport.width * this.props.openDrawerThreshold; - return dx > this.state.viewport.width * this.props.openDrawerThreshold; - } - }, { - key: 'handleStartShouldSetPanResponderCapture', - value: function handleStartShouldSetPanResponderCapture(e, gestureState) { - if (this.props.captureGestures) return this.processShouldSet(e, gestureState); - return false; - } - }, { - key: 'handleStartShouldSetPanResponder', - value: function handleStartShouldSetPanResponder(e, gestureState) { - if (!this.props.captureGestures) return this.processShouldSet(e, gestureState); - return false; - } - }, { - key: 'handleMoveShouldSetPanResponderCapture', - value: function handleMoveShouldSetPanResponderCapture(e, gestureState) { - if (this.props.captureGestures && this.props.negotiatePan) return this.handleMoveShouldSetPanResponder(e, gestureState); - return false; - } - }, { - key: 'handleMoveShouldSetPanResponder', - value: function handleMoveShouldSetPanResponder(e, gestureState) { - var inMask = this.testPanResponderMask(e, gestureState); - if (!inMask) return false; - if (!this.props.acceptPan) return false; - - if (!this.props.negotiatePan || this.props.disabled || !this.props.acceptPan || this._panning) return false; - var swipeToLeft = gestureState.dx < 0 ? true : false; - var swipeToRight = gestureState.dx > 0 ? true : false; - var swipeUpDown = Math.abs(gestureState.dy) >= Math.abs(gestureState.dx) ? true : false; - var swipeInCloseDirection = this.props.side === 'left' ? swipeToLeft : swipeToRight; - if (swipeUpDown || this._open && !swipeInCloseDirection || !this._open && swipeInCloseDirection) { - return false; - } - - this.terminateActiveTween(); - return true; - } - }, { - key: 'testPanResponderMask', - value: function testPanResponderMask(e, gestureState) { - if (this.props.disabled) return false; - var x0 = e.nativeEvent.pageX; - - var deltaOpen = this.props.side === 'left' ? deviceScreen.width - x0 : x0; - var deltaClose = this.props.side === 'left' ? x0 : deviceScreen.width - x0; - - var whenClosedMask = this.props.panOpenMask % 1 === 0 && this.props.panOpenMask > 1 ? this.props.panOpenMask : deviceScreen.width * this.props.panOpenMask; - var whenOpenMask = this.props.panCloseMask % 1 === 0 && this.props.panCloseMask > 1 ? this.props.panCloseMask : deviceScreen.width * this.props.panCloseMask; - if (this._open && deltaOpen > whenOpenMask) return false; - if (!this._open && deltaClose > whenClosedMask) return false; - return true; - } - }, { - key: 'handlePanResponderMove', - value: function handlePanResponderMove(e, gestureState) { - if (!this.props.acceptPan) return false; - - //Math is ugly overly verbose here, probably can be greatly cleaned up - var dx = gestureState.dx; - //Do nothing if we are panning the wrong way - if (this._open ^ dx < 0 ^ this.props.side === 'right') return false; - - var absDx = Math.abs(dx); - var moveX = gestureState.moveX; - var relMoveX = this.props.side === 'left' ? this._open ? -this.state.viewport.width + moveX : moveX : this._open ? -moveX : this.state.viewport.width - moveX; - var delta = relMoveX - dx; - var factor = absDx / Math.abs(relMoveX); - var adjustedDx = dx + delta * factor; - var left = this.props.panStartCompensation ? this._prevLeft + adjustedDx : this._prevLeft + dx; - left = Math.min(left, this.getOpenLeft()); - left = Math.max(left, this.getClosedLeft()); - this._left = left; - this.updatePosition(); - this._panning = true; - } - }, { - key: 'handlePanResponderEnd', - value: function handlePanResponderEnd(e, gestureState) { - if (Math.abs(gestureState.dx) < 50 && this._activeTween) return; - - var absRelMoveX = this.props.side === 'left' ? this._open ? this.state.viewport.width - gestureState.moveX : gestureState.moveX : this._open ? gestureState.moveX : this.state.viewport.width - gestureState.moveX; - var calcPos = this.props.relativeDrag ? Math.abs(gestureState.dx) : absRelMoveX; - - this.shouldOpenDrawer(calcPos) ? this.open() : this.close(); - - this.updatePosition(); - this._prevLeft = this._left; - this._panning = false; - } - }, { - key: 'getMainView', - value: function getMainView() { - var _this2 = this; - - return _react2.default.createElement( - _reactNative.View, - _extends({}, this.responder.panHandlers, { - key: 'main', - ref: function ref(c) { - return _this2.main = c; - }, - style: [this.stylesheet.main, { height: this.getHeight(), width: this.getMainWidth() }] - }), - this.props.children, - this.props.type === 'overlay' ? _react2.default.createElement(_reactNative.View, { - ref: function ref(c) { - return _this2.mainOverlay = c; - }, - style: styles.mainOverlay - }) : null - ); - } - }, { - key: 'getDrawerView', - value: function getDrawerView() { - var _this3 = this; - - return _react2.default.createElement( - _reactNative.View, - _extends({}, this.responder.panHandlers, { - key: 'drawer', - ref: function ref(c) { - return _this3.drawer = c; - }, - style: [this.stylesheet.drawer, { height: this.getHeight(), width: this.getDrawerWidth() }] - }), - this.props.content - ); - } - }, { - key: 'getOpenLeft', - value: function getOpenLeft() { - return this.state.viewport.width - this._offsetOpen; - } - }, { - key: 'getClosedLeft', - value: function getClosedLeft() { - return this._offsetClosed; - } - }, { - key: 'getHeight', - value: function getHeight() { - return this.state.viewport.height; - } - }, { - key: 'getMainWidth', - value: function getMainWidth() { - return this.state.viewport.width - this._offsetClosed; - } - }, { - key: 'getDrawerWidth', - value: function getDrawerWidth() { - return this.state.viewport.width - this._offsetOpen; - } - }, { - key: 'initialize', - value: function initialize(props) { - var fullWidth = this.state.viewport.width; - this._offsetClosed = props.closedDrawerOffset % 1 === 0 ? props.closedDrawerOffset : props.closedDrawerOffset * fullWidth; - this._offsetOpen = props.openDrawerOffset % 1 === 0 ? props.openDrawerOffset : props.openDrawerOffset * fullWidth; - this._prevLeft = this._left; - - var styles = { - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center' - } - }; - - styles.main = Object.assign({ - position: 'absolute', - top: 0 - }, { borderWidth: 0 }, this.props.styles.main); - - styles.drawer = Object.assign({ - position: 'absolute', - top: 0 - }, { borderWidth: 0 }, this.props.styles.drawer); - - if (props.initializeOpen === true) { - // open - this._open = true; - this._left = fullWidth - this._offsetOpen; - styles.main[this.props.side] = 0; - styles.drawer[this.props.side] = 0; - if (props.type === 'static') styles.main[this.props.side] = fullWidth - this._offsetOpen; - if (props.type === 'displace') styles.main[this.props.side] = fullWidth - this._offsetOpen; - } else { - // closed - this._open = false; - this._left = this._offsetClosed; - styles.main[this.props.side] = this._offsetClosed; - if (props.type === 'static') styles.drawer[this.props.side] = 0; - if (props.type === 'overlay') styles.drawer[this.props.side] = this._offsetClosed + this._offsetOpen - fullWidth; - if (props.type === 'displace') styles.drawer[this.props.side] = -fullWidth + this._offsetClosed + this._offsetOpen; - } - - if (this.main) { - this.drawer.setNativeProps({ style: { left: styles.drawer.left } }); - this.main.setNativeProps({ style: { left: styles.main.left } }); - } else { - this.stylesheet = _reactNative.StyleSheet.create(styles); - this.responder = _reactNative.PanResponder.create({ - onStartShouldSetPanResponder: this.handleStartShouldSetPanResponder, - onStartShouldSetPanResponderCapture: this.handleStartShouldSetPanResponderCapture, - onMoveShouldSetPanResponder: this.handleMoveShouldSetPanResponder, - onMoveShouldSetPanResponderCapture: this.handleMoveShouldSetPanResponderCapture, - onPanResponderMove: this.handlePanResponderMove, - onPanResponderRelease: this.handlePanResponderEnd - }); - } - - this.resync(null, props); - } - }, { - key: 'handleSetViewport', - value: function handleSetViewport(e) { - var viewport = e.nativeEvent.layout; - var oldViewport = this.state.viewport; - if (viewport.width === oldViewport.width && viewport.height === oldViewport.height) return; - var didRotationChange = viewport.width !== oldViewport.width; - this.resync(viewport, null, didRotationChange); - } - }, { - key: 'resync', - value: function resync(viewport, props, didRotationChange) { - if (didRotationChange) this._syncAfterUpdate = true; - viewport = viewport || this.state.viewport; - props = props || this.props; - this._offsetClosed = props.closedDrawerOffset % 1 === 0 ? props.closedDrawerOffset : props.closedDrawerOffset * viewport.width; - this._offsetOpen = props.openDrawerOffset % 1 === 0 ? props.openDrawerOffset : props.openDrawerOffset * viewport.width; - this.setState({ viewport: viewport }); - } - }, { - key: 'requiresResync', - value: function requiresResync(nextProps) { - for (var i = 0; i < this.propsWhomRequireUpdate.length; i++) { - var key = this.propsWhomRequireUpdate[i]; - if (this.props[key] !== nextProps[key]) return true; - } - } - }, { - key: 'render', - value: function render() { - var first = this.props.type === 'overlay' ? this.getMainView() : this.getDrawerView(); - var second = this.props.type === 'overlay' ? this.getDrawerView() : this.getMainView(); - - return _react2.default.createElement( - _reactNative.View, - { - key: 'drawerContainer', - onLayout: this.handleSetViewport, - style: this.stylesheet.container - }, - first, - second - ); - } - }]); - - return Drawer; -}(_react.Component); - -Drawer.tweenPresets = { - parallax: function parallax(ratio) { - var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left'; - - var drawer = _defineProperty({}, side, -150 * (1 - ratio)); - return { drawer: drawer }; - } -}; -Drawer.propTypes = { - acceptDoubleTap: _propTypes2.default.bool, - acceptPan: _propTypes2.default.bool, - acceptTap: _propTypes2.default.bool, - captureGestures: _propTypes2.default.bool, - children: _propTypes2.default.node, - closedDrawerOffset: _propTypes2.default.number, - content: _propTypes2.default.node, - deviceScreen: _propTypes2.default.object, - disabled: _propTypes2.default.bool, - initializeOpen: _propTypes2.default.bool, - negotiatePan: _propTypes2.default.bool, - onClose: _propTypes2.default.func, - onCloseStart: _propTypes2.default.func, - onOpen: _propTypes2.default.func, - onOpenStart: _propTypes2.default.func, - openDrawerOffset: _propTypes2.default.number, - openDrawerThreshold: _propTypes2.default.number, - panCloseMask: _propTypes2.default.number, - panOpenMask: _propTypes2.default.number, - panStartCompensation: _propTypes2.default.bool, - relativeDrag: _propTypes2.default.bool, - side: _propTypes2.default.oneOf(['left', 'right']), - styles: _propTypes2.default.object, - tapToClose: _propTypes2.default.bool, - tweenDuration: _propTypes2.default.number, - tweenEasing: _propTypes2.default.string, - tweenHandler: _propTypes2.default.func, - type: _propTypes2.default.oneOf(['overlay', 'static', 'displace']) -}; -Drawer.defaultProps = { - type: 'displace', - closedDrawerOffset: 0, - deviceScreen: deviceScreen, - openDrawerOffset: 0, - openDrawerThreshold: 0.25, - relativeDrag: true, - panStartCompensation: true, - panOpenMask: 0.25, - panCloseMask: 0.25, - captureGestures: false, - negotiatePan: false, - initializeOpen: false, - tweenHandler: null, - tweenDuration: 250, - tweenEasing: 'linear', - disabled: false, - acceptDoubleTap: false, - acceptTap: false, - acceptPan: true, - tapToClose: false, - styles: {}, - onOpen: function onOpen() {}, - onClose: function onClose() {}, - side: 'left' -}; -Drawer.childContextTypes = { - drawer: _propTypes2.default.any -}; - - -var styles = _reactNative.StyleSheet.create({ - mainOverlay: { - width: 0, - left: 0, - top: 0, - bottom: 0, - position: 'absolute', - backgroundColor: 'transparent' - } -}); - -module.exports = Drawer; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-drawer/tween/tween-functions/index.js b/lib/Components/vendor/react-native-drawer/tween/tween-functions/index.js deleted file mode 100644 index 8f76deea..00000000 --- a/lib/Components/vendor/react-native-drawer/tween/tween-functions/index.js +++ /dev/null @@ -1,250 +0,0 @@ -'use strict'; - -// t: current time, b: beginning value, _c: final value, d: total duration - -var tweenFunctions = { - linear: function linear(t, b, _c, d) { - var c = _c - b; - return c * t / d + b; - }, - easeInQuad: function easeInQuad(t, b, _c, d) { - var c = _c - b; - return c * (t /= d) * t + b; - }, - easeOutQuad: function easeOutQuad(t, b, _c, d) { - var c = _c - b; - return -c * (t /= d) * (t - 2) + b; - }, - easeInOutQuad: function easeInOutQuad(t, b, _c, d) { - var c = _c - b; - if ((t /= d / 2) < 1) { - return c / 2 * t * t + b; - } else { - return -c / 2 * (--t * (t - 2) - 1) + b; - } - }, - easeInCubic: function easeInCubic(t, b, _c, d) { - var c = _c - b; - return c * (t /= d) * t * t + b; - }, - easeOutCubic: function easeOutCubic(t, b, _c, d) { - var c = _c - b; - return c * ((t = t / d - 1) * t * t + 1) + b; - }, - easeInOutCubic: function easeInOutCubic(t, b, _c, d) { - var c = _c - b; - if ((t /= d / 2) < 1) { - return c / 2 * t * t * t + b; - } else { - return c / 2 * ((t -= 2) * t * t + 2) + b; - } - }, - easeInQuart: function easeInQuart(t, b, _c, d) { - var c = _c - b; - return c * (t /= d) * t * t * t + b; - }, - easeOutQuart: function easeOutQuart(t, b, _c, d) { - var c = _c - b; - return -c * ((t = t / d - 1) * t * t * t - 1) + b; - }, - easeInOutQuart: function easeInOutQuart(t, b, _c, d) { - var c = _c - b; - if ((t /= d / 2) < 1) { - return c / 2 * t * t * t * t + b; - } else { - return -c / 2 * ((t -= 2) * t * t * t - 2) + b; - } - }, - easeInQuint: function easeInQuint(t, b, _c, d) { - var c = _c - b; - return c * (t /= d) * t * t * t * t + b; - }, - easeOutQuint: function easeOutQuint(t, b, _c, d) { - var c = _c - b; - return c * ((t = t / d - 1) * t * t * t * t + 1) + b; - }, - easeInOutQuint: function easeInOutQuint(t, b, _c, d) { - var c = _c - b; - if ((t /= d / 2) < 1) { - return c / 2 * t * t * t * t * t + b; - } else { - return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; - } - }, - easeInSine: function easeInSine(t, b, _c, d) { - var c = _c - b; - return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; - }, - easeOutSine: function easeOutSine(t, b, _c, d) { - var c = _c - b; - return c * Math.sin(t / d * (Math.PI / 2)) + b; - }, - easeInOutSine: function easeInOutSine(t, b, _c, d) { - var c = _c - b; - return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; - }, - easeInExpo: function easeInExpo(t, b, _c, d) { - var c = _c - b; - return t == 0 ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; - }, - easeOutExpo: function easeOutExpo(t, b, _c, d) { - var c = _c - b; - return t == d ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; - }, - easeInOutExpo: function easeInOutExpo(t, b, _c, d) { - var c = _c - b; - if (t === 0) { - return b; - } - if (t === d) { - return b + c; - } - if ((t /= d / 2) < 1) { - return c / 2 * Math.pow(2, 10 * (t - 1)) + b; - } else { - return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; - } - }, - easeInCirc: function easeInCirc(t, b, _c, d) { - var c = _c - b; - return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; - }, - easeOutCirc: function easeOutCirc(t, b, _c, d) { - var c = _c - b; - return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; - }, - easeInOutCirc: function easeInOutCirc(t, b, _c, d) { - var c = _c - b; - if ((t /= d / 2) < 1) { - return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; - } else { - return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; - } - }, - easeInElastic: function easeInElastic(t, b, _c, d) { - var c = _c - b; - var a, p, s; - s = 1.70158; - p = 0; - a = c; - if (t === 0) { - return b; - } else if ((t /= d) === 1) { - return b + c; - } - if (!p) { - p = d * 0.3; - } - if (a < Math.abs(c)) { - a = c; - s = p / 4; - } else { - s = p / (2 * Math.PI) * Math.asin(c / a); - } - return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; - }, - easeOutElastic: function easeOutElastic(t, b, _c, d) { - var c = _c - b; - var a, p, s; - s = 1.70158; - p = 0; - a = c; - if (t === 0) { - return b; - } else if ((t /= d) === 1) { - return b + c; - } - if (!p) { - p = d * 0.3; - } - if (a < Math.abs(c)) { - a = c; - s = p / 4; - } else { - s = p / (2 * Math.PI) * Math.asin(c / a); - } - return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; - }, - easeInOutElastic: function easeInOutElastic(t, b, _c, d) { - var c = _c - b; - var a, p, s; - s = 1.70158; - p = 0; - a = c; - if (t === 0) { - return b; - } else if ((t /= d / 2) === 2) { - return b + c; - } - if (!p) { - p = d * (0.3 * 1.5); - } - if (a < Math.abs(c)) { - a = c; - s = p / 4; - } else { - s = p / (2 * Math.PI) * Math.asin(c / a); - } - if (t < 1) { - return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; - } else { - return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * 0.5 + c + b; - } - }, - easeInBack: function easeInBack(t, b, _c, d, s) { - var c = _c - b; - if (s === void 0) { - s = 1.70158; - } - return c * (t /= d) * t * ((s + 1) * t - s) + b; - }, - easeOutBack: function easeOutBack(t, b, _c, d, s) { - var c = _c - b; - if (s === void 0) { - s = 1.70158; - } - return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; - }, - easeInOutBack: function easeInOutBack(t, b, _c, d, s) { - var c = _c - b; - if (s === void 0) { - s = 1.70158; - } - if ((t /= d / 2) < 1) { - return c / 2 * (t * t * (((s *= 1.525) + 1) * t - s)) + b; - } else { - return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b; - } - }, - easeInBounce: function easeInBounce(t, b, _c, d) { - var c = _c - b; - var v; - v = tweenFunctions.easeOutBounce(d - t, 0, c, d); - return c - v + b; - }, - easeOutBounce: function easeOutBounce(t, b, _c, d) { - var c = _c - b; - if ((t /= d) < 1 / 2.75) { - return c * (7.5625 * t * t) + b; - } else if (t < 2 / 2.75) { - return c * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + b; - } else if (t < 2.5 / 2.75) { - return c * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + b; - } else { - return c * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + b; - } - }, - easeInOutBounce: function easeInOutBounce(t, b, _c, d) { - var c = _c - b; - var v; - if (t < d / 2) { - v = tweenFunctions.easeInBounce(t * 2, 0, c, d); - return v * 0.5 + b; - } else { - v = tweenFunctions.easeOutBounce(t * 2 - d, 0, c, d); - return v * 0.5 + c * 0.5 + b; - } - } -}; - -module.exports = tweenFunctions; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-drawer/tweener.js b/lib/Components/vendor/react-native-drawer/tweener.js deleted file mode 100644 index 9e6beba4..00000000 --- a/lib/Components/vendor/react-native-drawer/tweener.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -var easingTypes = require('./tween/tween-functions'); - -module.exports = function (config) { - return new Tween(config); -}; - -function Tween(config) { - this._rafLoop = this._rafLoop.bind(this); - this.terminate = this.terminate.bind(this); - - this._t0 = Date.now(); - this._config = config; - this._rafLoop(); -} - -Tween.prototype._rafLoop = function () { - if (this._break) { - return; - } - - var _config = this._config, - duration = _config.duration, - start = _config.start, - end = _config.end, - easingType = _config.easingType; - - var now = Date.now(); - var elapsed = now - this._t0; - - if (elapsed >= duration) { - this._config.onFrame(end); - this._config.onEnd(); - return; - } - - var tweenVal = easingTypes[easingType](elapsed, start, end, duration); - this._config.onFrame(tweenVal); - - requestAnimationFrame(this._rafLoop); -}; - -Tween.prototype.terminate = function () { - this._break = true; -}; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-easy-grid/Components/Col.js b/lib/Components/vendor/react-native-easy-grid/Components/Col.js deleted file mode 100644 index 87cfa508..00000000 --- a/lib/Components/vendor/react-native-easy-grid/Components/Col.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _computeProps = require('../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var ColunmNB = function (_Component) { - _inherits(ColunmNB, _Component); - - function ColunmNB() { - _classCallCheck(this, ColunmNB); - - return _possibleConstructorReturn(this, (ColunmNB.__proto__ || Object.getPrototypeOf(ColunmNB)).apply(this, arguments)); - } - - _createClass(ColunmNB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - flexDirection: 'column', - flex: this.props.size ? this.props.size : this.props.style && this.props.style.width ? 0 : 1 - }; - - var defaultProps = { - style: type - }; - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.View, - this.prepareRootProps(), - this.props.children - ); - } - }]); - - return ColunmNB; -}(_react.Component); - -exports.default = ColunmNB; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-easy-grid/Components/Grid.js b/lib/Components/vendor/react-native-easy-grid/Components/Grid.js deleted file mode 100644 index 1e34529e..00000000 --- a/lib/Components/vendor/react-native-easy-grid/Components/Grid.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _computeProps = require('../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _Col = require('./Col'); - -var _Col2 = _interopRequireDefault(_Col); - -var _Row = require('./Row'); - -var _Row2 = _interopRequireDefault(_Row); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var GridNB = function (_Component) { - _inherits(GridNB, _Component); - - function GridNB() { - _classCallCheck(this, GridNB); - - return _possibleConstructorReturn(this, (GridNB.__proto__ || Object.getPrototypeOf(GridNB)).apply(this, arguments)); - } - - _createClass(GridNB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - flex: 1, - flexDirection: this.ifRow() ? 'column' : 'row' - }; - - var defaultProps = { - style: type - }; - - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'ifRow', - value: function ifRow() { - var row = false; - _react2.default.Children.forEach(this.props.children, function (child) { - if (child.type == _Row2.default) row = true; - }); - return row; - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.View, - this.prepareRootProps(), - this.props.children - ); - } - }]); - - return GridNB; -}(_react.Component); - -exports.default = GridNB; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-easy-grid/Components/Row.js b/lib/Components/vendor/react-native-easy-grid/Components/Row.js deleted file mode 100644 index 7d26c335..00000000 --- a/lib/Components/vendor/react-native-easy-grid/Components/Row.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactNative = require('react-native'); - -var _computeProps = require('../Utils/computeProps'); - -var _computeProps2 = _interopRequireDefault(_computeProps); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var RowNB = function (_Component) { - _inherits(RowNB, _Component); - - function RowNB() { - _classCallCheck(this, RowNB); - - return _possibleConstructorReturn(this, (RowNB.__proto__ || Object.getPrototypeOf(RowNB)).apply(this, arguments)); - } - - _createClass(RowNB, [{ - key: 'prepareRootProps', - value: function prepareRootProps() { - - var type = { - flexDirection: 'row', - flex: this.props.size ? this.props.size : 1 - }; - - var defaultProps = { - style: type - }; - return (0, _computeProps2.default)(this.props, defaultProps); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _reactNative.View, - this.prepareRootProps(), - this.props.children - ); - } - }]); - - return RowNB; -}(_react.Component); - -exports.default = RowNB; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-easy-grid/Utils/computeProps.js b/lib/Components/vendor/react-native-easy-grid/Utils/computeProps.js deleted file mode 100644 index c8e1b8fe..00000000 --- a/lib/Components/vendor/react-native-easy-grid/Utils/computeProps.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var React = require('react'); - -var ReactNativePropRegistry = require('react/lib/ReactNativePropRegistry'); - -module.exports = function (incomingProps, defaultProps) { - - // External props has a higher precedence - var computedProps = {}; - - incomingProps = _.clone(incomingProps); - delete incomingProps.children; - - // console.log(defaultProps, incomingProps); - - if (incomingProps) _.merge(computedProps, defaultProps, incomingProps);else computedProps = defaultProps; - - // Pass the merged Style Object instead - if (incomingProps.style) { - - if (typeof incomingProps.style == 'number') { - var incomingPropsStyle = ReactNativePropRegistry.getByID(incomingProps.style); - computedProps.style = {}; - } else { - var incomingPropsStyle = incomingProps.style; - } - - _.merge(computedProps.style, defaultProps.style, incomingPropsStyle); - } - - // console.log("computedProps ", computedProps); - - return computedProps; -}; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-easy-grid/index.js b/lib/Components/vendor/react-native-easy-grid/index.js deleted file mode 100644 index bec8b694..00000000 --- a/lib/Components/vendor/react-native-easy-grid/index.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -var _Row = require('./Components/Row'); - -var _Row2 = _interopRequireDefault(_Row); - -var _Grid = require('./Components/Grid'); - -var _Grid2 = _interopRequireDefault(_Grid); - -var _Col = require('./Components/Col'); - -var _Col2 = _interopRequireDefault(_Col); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -module.exports = { - Row: _Row2.default, - Col: _Col2.default, - Grid: _Grid2.default -}; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-scrollable-tab-view/DefaultTabBar.js b/lib/Components/vendor/react-native-scrollable-tab-view/DefaultTabBar.js deleted file mode 100755 index c3388f0f..00000000 --- a/lib/Components/vendor/react-native-scrollable-tab-view/DefaultTabBar.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _NativeBaseComponent2 = require('../../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _Text = require('../../Widgets/Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _reactNative = require('react-native'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var deviceWidth = _reactNative.Dimensions.get('window').width; - -var DefaultTabBar = function (_NativeBaseComponent) { - _inherits(DefaultTabBar, _NativeBaseComponent); - - function DefaultTabBar() { - _classCallCheck(this, DefaultTabBar); - - return _possibleConstructorReturn(this, (DefaultTabBar.__proto__ || Object.getPrototypeOf(DefaultTabBar)).apply(this, arguments)); - } - - _createClass(DefaultTabBar, [{ - key: 'getInitialStyle', - value: function getInitialStyle() { - return { - tab: { - flex: 1, - alignItems: 'center', - justifyContent: 'center', - backgroundColor: this.getTheme().tabBgColor - }, - tabs: { - height: 45, - flexDirection: 'row', - justifyContent: 'space-around', - borderWidth: 1, - borderTopWidth: 0, - borderLeftWidth: 0, - borderRightWidth: 0, - borderBottomColor: '#ccc' - } - }; - } - }, { - key: 'renderTabOption', - value: function renderTabOption(name, page) { - var _this2 = this; - - var isTabActive = this.props.activeTab === page; - - return _react2.default.createElement( - _reactNative.TouchableHighlight, - { underlayColor: this.getTheme().darkenHeader, style: [this.getInitialStyle().tab], key: name, onPress: function onPress() { - return _this2.props.goToPage(page); - } }, - _react2.default.createElement( - _reactNative.View, - { style: { - flex: 1, - justifyContent: 'center', - alignItems: 'center' - } }, - _react2.default.createElement( - _Text2.default, - { style: { color: isTabActive ? this.getTheme().tabTextColor : this.getTheme().tabTextColor, fontWeight: isTabActive ? 'bold' : 'normal', fontSize: this.getTheme().tabFontSize } }, - name - ) - ) - ); - } - }, { - key: 'render', - value: function render() { - var _this3 = this; - - deviceWidth = _reactNative.Dimensions.get('window').width; - - var numberOfTabs = this.props.tabs.length; - var tabUnderlineStyle = { - position: 'absolute', - width: deviceWidth / numberOfTabs, - height: 4, - backgroundColor: this.getTheme().tabTextColor, - bottom: 0 - }; - - var left = this.props.scrollValue.interpolate({ - inputRange: [0, 1], outputRange: [0, deviceWidth / numberOfTabs] - }); - - return _react2.default.createElement( - _reactNative.View, - { style: this.getInitialStyle().tabs }, - this.props.tabs.map(function (tab, i) { - return _this3.renderTabOption(tab, i); - }), - _react2.default.createElement(_reactNative.Animated.View, { style: [tabUnderlineStyle, { left: left }] }) - ); - } - }]); - - return DefaultTabBar; -}(_NativeBaseComponent3.default); - -DefaultTabBar.propTypes = { - goToPage: _propTypes2.default.func, - activeTab: _propTypes2.default.number, - tabs: _propTypes2.default.array -}; -exports.default = DefaultTabBar; \ No newline at end of file diff --git a/lib/Components/vendor/react-native-scrollable-tab-view/index.js b/lib/Components/vendor/react-native-scrollable-tab-view/index.js deleted file mode 100755 index 3b888b28..00000000 --- a/lib/Components/vendor/react-native-scrollable-tab-view/index.js +++ /dev/null @@ -1,171 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || 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; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _NativeBaseComponent2 = require('../../Base/NativeBaseComponent'); - -var _NativeBaseComponent3 = _interopRequireDefault(_NativeBaseComponent2); - -var _reactNative = require('react-native'); - -var _DefaultTabBar = require('./DefaultTabBar'); - -var _DefaultTabBar2 = _interopRequireDefault(_DefaultTabBar); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var deviceWidth = _reactNative.Dimensions.get('window').width; - -var ScrollableTabView = function (_NativeBaseComponent) { - _inherits(ScrollableTabView, _NativeBaseComponent); - - function ScrollableTabView(props) { - _classCallCheck(this, ScrollableTabView); - - var _this = _possibleConstructorReturn(this, (ScrollableTabView.__proto__ || Object.getPrototypeOf(ScrollableTabView)).call(this, props)); - - var currentPage = _this.props.initialPage || 0; - _this.state = { - currentPage: currentPage, - scrollValue: new _reactNative.Animated.Value(currentPage) - }; - return _this; - } - - _createClass(ScrollableTabView, [{ - key: 'componentWillMount', - value: function componentWillMount() { - //var release = (e, gestureState) => { - // var relativeGestureDistance = gestureState.dx / deviceWidth, - // lastPageIndex = this.props.children.length - 1, - // vx = gestureState.vx, - // newPage = this.state.currentPage; - // - // if (relativeGestureDistance < -0.5 || (relativeGestureDistance < 0 && vx <= -0.5)) { - // newPage = newPage + 1; - // } else if (relativeGestureDistance > 0.5 || (relativeGestureDistance > 0 && vx >= 0.5)) { - // newPage = newPage - 1; - // } - // - // this.props.hasTouch && this.props.hasTouch(false); - // this.goToPage(Math.max(0, Math.min(newPage, this.props.children.length - 1))); - // } - - // this._panResponder = PanResponder.create({ - // // Claim responder if it's a horizontal pan - // onMoveShouldSetPanResponder: (e, gestureState) => { - // if (Math.abs(gestureState.dx) > Math.abs(gestureState.dy)) { - // if ((gestureState.moveX <= this.props.edgeHitWidth || - // gestureState.moveX >= deviceWidth - this.props.edgeHitWidth) && - // this.props.locked !== true) { - // this.props.hasTouch && this.props.hasTouch(true); - // return true; - // } - // } - // }, - // - // // Touch is released, scroll to the one that you're closest to - // onPanResponderRelease: release, - // onPanResponderTerminate: release, - // - // // Dragging, move the view with the touch - // onPanResponderMove: (e, gestureState) => { - // var dx = gestureState.dx; - // var lastPageIndex = this.props.children.length - 1; - // - // // This is awkward because when we are scrolling we are offsetting the underlying view - // // to the left (-x) - // var offsetX = dx - (this.state.currentPage * deviceWidth); - // this.state.scrollValue.setValue(-1 * offsetX / deviceWidth); - // }, - // }); - } - }, { - key: 'goToPage', - value: function goToPage(pageNumber) { - this.props.onChangeTab && this.props.onChangeTab({ - i: pageNumber, ref: this.props.children[pageNumber] - }); - - this.setState({ - currentPage: pageNumber - }); - - _reactNative.Animated.spring(this.state.scrollValue, { toValue: pageNumber, friction: this.props.springFriction, tension: this.props.springTension }).start(); - } - }, { - key: 'renderTabBar', - value: function renderTabBar(props) { - if (this.props.renderTabBar === false) { - return null; - } else if (this.props.renderTabBar) { - return _react2.default.cloneElement(this.props.renderTabBar(), props); - } else { - return _react2.default.createElement(_DefaultTabBar2.default, props); - } - } - }, { - key: 'render', - value: function render() { - - deviceWidth = _reactNative.Dimensions.get('window').width; - - var sceneContainerStyle = { - width: deviceWidth * this.props.children.length, - flex: 1, - flexDirection: 'row' - }; - - var translateX = this.state.scrollValue.interpolate({ - inputRange: [0, 1], outputRange: [0, -deviceWidth] - }); - - var tabBarProps = { - goToPage: this.goToPage.bind(this), - tabs: this.props.children.map(function (child) { - return child.props.tabLabel; - }), - activeTab: this.state.currentPage, - scrollValue: this.state.scrollValue - }; - - return _react2.default.createElement( - _reactNative.View, - { style: { flex: 1 } }, - this.props.tabBarPosition === 'top' ? this.renderTabBar(tabBarProps) : null, - _react2.default.createElement( - _reactNative.Animated.View, - { style: [sceneContainerStyle, { transform: [{ translateX: translateX }] }] }, - this.props.children - ), - this.props.tabBarPosition === 'bottom' ? this.renderTabBar(tabBarProps) : null - ); - } - }]); - - return ScrollableTabView; -}(_NativeBaseComponent3.default); - -ScrollableTabView.defaultProps = _extends({}, _NativeBaseComponent3.default.defaultProps, { - tabBarPosition: 'top', - edgeHitWidth: 30, - springTension: 50, - springFriction: 10 -}); -exports.default = ScrollableTabView; \ No newline at end of file diff --git a/lib/Utils/computeProps.js b/lib/Utils/computeProps.js deleted file mode 100644 index 92d5efe5..00000000 --- a/lib/Utils/computeProps.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; -'use_strict'; - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _ReactNativePropRegistry = require('react/lib/ReactNativePropRegistry'); - -var _ReactNativePropRegistry2 = _interopRequireDefault(_ReactNativePropRegistry); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// For compatibility with RN 0.25 -// import ReactNativePropRegistry from "react-native/Libraries/ReactNative/ReactNativePropRegistry"; -module.exports = function (incomingProps, defaultProps) { - // External props has a higher precedence - var computedProps = {}; - - incomingProps = _lodash2.default.clone(incomingProps); - delete incomingProps.children; - - var incomingPropsStyle = incomingProps.style; - delete incomingProps.style; - - // console.log(defaultProps, incomingProps); - if (incomingProps) { - if (incomingProps.refreshControl) { - _lodash2.default.assign(computedProps, defaultProps, incomingProps); - } else { - try { - _lodash2.default.merge(computedProps, defaultProps, incomingProps); - } catch (exception) { - console.log('Warning: Call stack size exceeded when merging props, falling back to shallow merge.'); - _lodash2.default.assign(computedProps, defaultProps, incomingProps); - } - } - } else computedProps = defaultProps; - // Pass the merged Style Object instead - if (incomingPropsStyle) { - - var computedPropsStyle = {}; - computedProps.style = {}; - if (Array.isArray(incomingPropsStyle)) { - _lodash2.default.forEach(incomingPropsStyle, function (style) { - if (typeof style == 'number') { - _lodash2.default.merge(computedPropsStyle, _ReactNativePropRegistry2.default.getByID(style)); - } else { - _lodash2.default.merge(computedPropsStyle, style); - } - }); - } else { - if (typeof incomingPropsStyle == 'number') { - computedPropsStyle = _ReactNativePropRegistry2.default.getByID(incomingPropsStyle); - } else { - computedPropsStyle = incomingPropsStyle; - } - } - - _lodash2.default.merge(computedProps.style, defaultProps.style, computedPropsStyle); - } - // console.log("computedProps ", computedProps); - return computedProps; -}; \ No newline at end of file diff --git a/lib/Utils/platform.js b/lib/Utils/platform.js deleted file mode 100644 index 1a21f539..00000000 --- a/lib/Utils/platform.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var Platform = { - OS: 'ios', - setOSTheme: function setOSTheme(os) { - return Platform.OS = os; - } -}; - -exports.default = Platform; \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index a4b733f7..00000000 --- a/lib/index.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -var _reactNativeDrawer = require('./Components/vendor/react-native-drawer'); - -var _reactNativeDrawer2 = _interopRequireDefault(_reactNativeDrawer); - -var _Header = require('./Components/Widgets/Header'); - -var _Header2 = _interopRequireDefault(_Header); - -var _Footer = require('./Components/Widgets/Footer'); - -var _Footer2 = _interopRequireDefault(_Footer); - -var _Title = require('./Components/Widgets/Title'); - -var _Title2 = _interopRequireDefault(_Title); - -var _Container = require('./Components/Widgets/Container'); - -var _Container2 = _interopRequireDefault(_Container); - -var _Content = require('./Components/Widgets/Content'); - -var _Content2 = _interopRequireDefault(_Content); - -var _Button = require('./Components/Widgets/Button'); - -var _Button2 = _interopRequireDefault(_Button); - -var _Text = require('./Components/Widgets/Text'); - -var _Text2 = _interopRequireDefault(_Text); - -var _Switch = require('./Components/Widgets/Switch'); - -var _Switch2 = _interopRequireDefault(_Switch); - -var _Picker = require('./Components/Widgets/Picker'); - -var _Picker2 = _interopRequireDefault(_Picker); - -var _List = require('./Components/Widgets/List'); - -var _List2 = _interopRequireDefault(_List); - -var _ListItem = require('./Components/Widgets/ListItem'); - -var _ListItem2 = _interopRequireDefault(_ListItem); - -var _CardItem = require('./Components/Widgets/CardItem'); - -var _CardItem2 = _interopRequireDefault(_CardItem); - -var _CardSwiper = require('./Components/Widgets/CardSwiper'); - -var _CardSwiper2 = _interopRequireDefault(_CardSwiper); - -var _DeckSwiper = require('./Components/Widgets/DeckSwiper'); - -var _DeckSwiper2 = _interopRequireDefault(_DeckSwiper); - -var _H = require('./Components/Widgets/H1'); - -var _H2 = _interopRequireDefault(_H); - -var _H3 = require('./Components/Widgets/H2'); - -var _H4 = _interopRequireDefault(_H3); - -var _H5 = require('./Components/Widgets/H3'); - -var _H6 = _interopRequireDefault(_H5); - -var _View = require('./Components/Widgets/View'); - -var _View2 = _interopRequireDefault(_View); - -var _Input = require('./Components/Widgets/Input'); - -var _Input2 = _interopRequireDefault(_Input); - -var _Textarea = require('./Components/Widgets/Textarea'); - -var _Textarea2 = _interopRequireDefault(_Textarea); - -var _InputGroup = require('./Components/Widgets/InputGroup'); - -var _InputGroup2 = _interopRequireDefault(_InputGroup); - -var _Icon = require('./Components/Widgets/Icon'); - -var _Icon2 = _interopRequireDefault(_Icon); - -var _Thumbnail = require('./Components/Widgets/Thumbnail'); - -var _Thumbnail2 = _interopRequireDefault(_Thumbnail); - -var _Checkbox = require('./Components/Widgets/Checkbox'); - -var _Checkbox2 = _interopRequireDefault(_Checkbox); - -var _Radio = require('./Components/Widgets/Radio'); - -var _Radio2 = _interopRequireDefault(_Radio); - -var _Card = require('./Components/Widgets/Card'); - -var _Card2 = _interopRequireDefault(_Card); - -var _Badge = require('./Components/Widgets/Badge'); - -var _Badge2 = _interopRequireDefault(_Badge); - -var _Spinner = require('./Components/Widgets/Spinner'); - -var _Spinner2 = _interopRequireDefault(_Spinner); - -var _reactNativeEasyGrid = require('./Components/vendor/react-native-easy-grid'); - -var _Tabs = require('./Components/Widgets/Tabs'); - -var _Tabs2 = _interopRequireDefault(_Tabs); - -var _TouchableOpacityScrollable = require('./Components/Widgets/TouchableOpacityScrollable'); - -var _TouchableOpacityScrollable2 = _interopRequireDefault(_TouchableOpacityScrollable); - -var _platform = require('./Utils/platform'); - -var _platform2 = _interopRequireDefault(_platform); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -//Suppress unknown prop warnings - -// import ProgressBar from './Components/Widgets/ProgressBar'; -var logFunction = console.error; -console.error = function () { - if (arguments[0]) { - var errorMessage = '' + arguments[0]; - if (errorMessage.indexOf('Warning: Unknown prop') !== -1) return; - } - logFunction.apply(console, arguments); -}; - -module.exports = { - Header: _Header2.default, - Footer: _Footer2.default, - Title: _Title2.default, - Container: _Container2.default, - Content: _Content2.default, - Button: _Button2.default, - Text: _Text2.default, - Switch: _Switch2.default, - Picker: _Picker2.default, - List: _List2.default, - ListItem: _ListItem2.default, - CardItem: _CardItem2.default, - H1: _H2.default, - H2: _H4.default, - H3: _H6.default, - View: _View2.default, - Row: _reactNativeEasyGrid.Row, - Col: _reactNativeEasyGrid.Col, - Grid: _reactNativeEasyGrid.Grid, - InputGroup: _InputGroup2.default, - Input: _Input2.default, - Textarea: _Textarea2.default, - Icon: _Icon2.default, - Thumbnail: _Thumbnail2.default, - Card: _Card2.default, - CardSwiper: _CardSwiper2.default, - DeckSwiper: _DeckSwiper2.default, - Badge: _Badge2.default, - Spinner: _Spinner2.default, - CheckBox: _Checkbox2.default, - Radio: _Radio2.default, - // ProgressBar: ProgressBar, - Drawer: _reactNativeDrawer2.default, - Tabs: _Tabs2.default, - TouchableOpacityScrollable: _TouchableOpacityScrollable2.default, - //Utils - OSTheme: _platform2.default -}; \ No newline at end of file