UNPKG

rax-touchable

Version:

Touchable component for Rax.

1 lines 16.2 kB
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///mod) { try { mod = require(\\\"rax\\\") } catch(e) {} }return mod;})()\"","webpack:///./packages/universal-env/lib/index.js","webpack:///./components/rax-touchable/src/index.js","webpack:///./components/rax-view/lib/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","mod","require","e","_typeof","obj","_typeof2","iterator","constructor","default","isReactNative","isWeex","isNode","isWeb","navigator","appCodeName","product","process","versions","node","callNative","WXEnvironment","platform","__fbBatchedBridgeConfig","_default","_rax","_raxView","_interopRequireDefault","Touchable","Component","props","this","nativeProps","_objectSpread","style","styles","initial","onClick","onPress","createElement","cursor","_universalEnv","_extends","assign","target","arguments","length","source","apply","_defineProperties","descriptor","configurable","writable","_possibleConstructorReturn","self","ReferenceError","_assertThisInitialized","_getPrototypeOf","setPrototypeOf","getPrototypeOf","__proto__","_setPrototypeOf","_defineProperty","View","_Component","instance","Constructor","TypeError","_classCallCheck","subClass","superClass","_inherits","protoProps","staticProps","_createClass","styleProps","ownKeys","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","forEach","border","position","boxSizing","display","flexDirection","alignContent","flexShrink"],"mappings":"gVACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA0DA,OArDAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAA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3F,GAAOsE,EAAgBlB,EAAQpD,EAAKuD,EAAOvD,MAAa,OAAOoD,EAwC/bX,IAAkBE,EAAOC,QAASN,EAAMI,OAEzD,OAAO,EAAIT,EAAKc,eAAe,MAAOG,KAAaZ,GACjDI,MAAOyC,SAMRZ,EA3BT,GA8BAD,EAAgBC,EAAM,gBAEtB,IAAI5B,GACFC,SACEgD,OAAQ,gBACRC,SAAU,WACVC,UAAW,aACXC,QAAS,OACTC,cAAe,SACfC,aAAc,aACdC,WAAY,IAGZlE,EAAWuC,EACfhG,EAAQ0C,QAAUe,EAClBxD,EAAOD,QAAUA,EAAO","file":"touchable.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","module.exports = (function(){ var mod;if (!mod) { try { mod = require(\"rax\") } catch(e) {} }return mod;})();","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.isReactNative = exports.isWeex = exports.isNode = exports.isWeb = void 0;\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n// https://www.w3.org/TR/html5/webappapis.html#dom-navigator-appcodename\nvar isWeb = (typeof navigator === \"undefined\" ? \"undefined\" : _typeof(navigator)) === 'object' && (navigator.appCodeName === 'Mozilla' || navigator.product === 'Gecko');\nexports.isWeb = isWeb;\nvar isNode = typeof process !== 'undefined' && !!(process.versions && process.versions.node);\nexports.isNode = isNode;\nvar isWeex = typeof callNative === 'function' || (typeof WXEnvironment === \"undefined\" ? \"undefined\" : _typeof(WXEnvironment)) === 'object' && WXEnvironment.platform !== 'Web';\nexports.isWeex = isWeex;\nvar isReactNative = typeof __fbBatchedBridgeConfig !== 'undefined';\nexports.isReactNative = isReactNative;\nexports[\"default\"] = module.exports;\nvar _default = module.exports;\nexports.default = _default;","import {createElement, Component} from 'rax';\nimport {isWeex} from 'universal-env';\nimport View from 'rax-view';\n\nclass Touchable extends Component {\n static propTypes = {};\n\n render() {\n let props = this.props;\n let nativeProps = {\n ...props,\n style: {\n ...styles.initial,\n ...props.style\n },\n onClick: props.onPress\n };\n\n delete nativeProps.onPress;\n\n return <View {...nativeProps} />;\n }\n}\n\nconst styles = {\n initial: {\n cursor: 'pointer'\n }\n};\n\nexport default Touchable;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rax = require(\"rax\");\n\nvar _universalEnv = require(\"universal-env\");\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _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; }; return _extends.apply(this, arguments); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _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); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _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; }\n\nvar View =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(View, _Component);\n\n function View() {\n _classCallCheck(this, View);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(View).apply(this, arguments));\n }\n\n _createClass(View, [{\n key: \"render\",\n value: function render() {\n var props = this.props;\n\n if (_universalEnv.isWeex) {\n // TODO: do not pass object value in props\n return (0, _rax.createElement)(\"div\", props);\n } else {\n var styleProps = _objectSpread({}, styles.initial, props.style);\n\n return (0, _rax.createElement)(\"div\", _extends({}, props, {\n style: styleProps\n }));\n }\n }\n }]);\n\n return View;\n}(_rax.Component);\n\n_defineProperty(View, \"propTypes\", {});\n\nvar styles = {\n initial: {\n border: '0 solid black',\n position: 'relative',\n boxSizing: 'border-box',\n display: 'flex',\n flexDirection: 'column',\n alignContent: 'flex-start',\n flexShrink: 0\n }\n};\nvar _default = View;\nexports.default = _default;\nmodule.exports = exports[\"default\"];"],"sourceRoot":""}