├── .npmignore ├── .gitignore ├── .babelrc ├── CONTRIBUTING.md ├── package.json ├── src ├── helpers │ ├── common │ │ └── index.js │ ├── ios │ │ ├── index.js │ │ ├── colors.js │ │ ├── flattenObject.js │ │ └── callbackMapper.js │ ├── web │ │ ├── index.js │ │ └── parseParams.js │ ├── index.js │ └── android │ │ ├── index.js │ │ ├── objMap.js │ │ ├── callbackMapper.js │ │ ├── parseParams.js │ │ └── mapParams.js ├── views │ ├── View.js │ ├── Button.js │ ├── Switch.js │ ├── Calendar.js │ ├── CheckBox.js │ ├── ProgressBar.js │ ├── ListView.js │ ├── RatingBar.js │ ├── RecyclerView.js │ ├── EditText.js │ ├── TextView.js │ ├── Space.js │ ├── FrameLayout.js │ ├── TabLayout.js │ ├── ViewPager.js │ ├── ViewWidget.js │ ├── AppBarLayout.js │ ├── CoordinatorLayout.js │ ├── CollapsingToolbarLayout.js │ ├── RelativeLayout.js │ ├── index.js │ ├── HorizontalScrollView.js │ ├── ScrollView.js │ ├── LinearLayout.js │ └── ImageView.js ├── doms │ ├── index.js │ ├── web.js │ ├── ios.js │ └── android.js ├── handler.js ├── IOS │ ├── JBridgeInterface.js │ ├── AndroidInterface.js │ └── Render.js ├── WEB │ ├── AndroidInterface.js │ ├── ViewPageAdapter.js │ ├── JBridgeInterface.js │ └── Render.js ├── helper.js ├── animations.js ├── baseView.js ├── container.js ├── init.js └── Compute.js ├── index.js ├── webpack.config.js └── README.md /.npmignore: -------------------------------------------------------------------------------- 1 | app.js 2 | .babelrc 3 | webpack.config.js 4 | test/* 5 | dist/* 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/* 3 | dist/index_bundle.js 4 | dist/index_bundle.js.map 5 | npm-debug.log 6 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | presets: ["es2015", "stage-0"], 3 | plugins: [["transform-react-jsx", { "pragma": "dom"}]] 4 | } 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | 0. Fork () 4 | 1. Create feature branch (`git checkout -b feature/foo-bar`) 5 | 2. For code styling, follow [this guide](https://google.github.io/styleguide/jsguide.html). 6 | 3. Commit your changes (`git commit -am 'Add some foo bar'`) 7 | 4. Push to the branch (`git push origin feature/foo-bar`) 8 | 5. Create a new Pull Request -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@juspay/mystique", 3 | "version": "0.1.39", 4 | "description": "Javascript framework for building platform independent apps.", 5 | "main": "index.js", 6 | "dependencies": { 7 | "immu": "^2.0.1", 8 | "object-assign": "^4.1.0" 9 | }, 10 | "devDependencies": { 11 | "babel-core": "^6.9.1", 12 | "babel-loader": "^6.2.4", 13 | "babel-plugin-transform-react-jsx": "^6.8.0", 14 | "babel-preset-es2015": "^6.9.0", 15 | "babel-preset-react": "^6.5.0", 16 | "babel-preset-stage-0": "^6.5.0", 17 | "express": "^4.14.0", 18 | "webpack": "^1.13.1", 19 | "webpack-dev-server": "^1.14.0" 20 | }, 21 | "scripts": { 22 | "test": "echo \"Error: no test specified\" && exit 1", 23 | "compile": "webpack -p --progress --colors --watch", 24 | "start": "webpack-dev-server --inline --watch --hot --host 0.0.0.0 --content-base dist/" 25 | }, 26 | "repository": { 27 | "type": "git", 28 | "url": "git@github.com:juspay/mystique.git" 29 | }, 30 | "author": "JUSPAY Technologies ", 31 | "license": "AGPL", 32 | "homepage": "https://github.com/juspay/mystique" 33 | } 34 | -------------------------------------------------------------------------------- /src/helpers/common/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | module.exports = { 27 | 28 | } -------------------------------------------------------------------------------- /src/helpers/ios/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | module.exports = { 27 | parseParams : require("./parseParams"), 28 | } 29 | -------------------------------------------------------------------------------- /src/helpers/web/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | module.exports = { 27 | parseParams : require("./parseParams"), 28 | } 29 | -------------------------------------------------------------------------------- /src/helpers/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | module.exports = { 27 | android : require("./android"), 28 | ios : require("./ios"), 29 | web : require("./web"), 30 | common : require("./common") 31 | } -------------------------------------------------------------------------------- /src/helpers/android/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | module.exports = { 27 | parseParams : require("./parseParams"), 28 | mapPrams : require("./mapParams"), 29 | callbackMapper : require("./callbackMapper") 30 | } 31 | -------------------------------------------------------------------------------- /src/helpers/ios/colors.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | module.exports = [ 27 | "#83FCE8", 28 | "#89F6E4", 29 | "#8FEFDF", 30 | "#96E9DB", 31 | "#9CE3D7", 32 | "#FEE9E6", 33 | "#FEF7E7", 34 | "#FFFAE5", 35 | "#F5FAEB", 36 | "#E5FFF5" 37 | ] 38 | 39 | -------------------------------------------------------------------------------- /src/views/View.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | const objectAssign = require('object-assign'); 27 | 28 | class View { 29 | constructor(props, children) { 30 | this.props = objectAssign({}, this.props, props); 31 | this.children = children; 32 | } 33 | } 34 | 35 | module.exports = View; 36 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | module.exports = { 27 | doms : require("./src/doms"), 28 | handler : require("./src/handler"), 29 | helpers : require("./src/helpers"), 30 | views : require("./src/views"), 31 | baseView : require("./src/baseView"), 32 | init: require("./src/init"), 33 | animations: require('./src/animations') 34 | } -------------------------------------------------------------------------------- /src/helpers/android/objMap.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | var map = { 27 | 'PARAMS': { 28 | 'required': 'width, height', 29 | 'viewMethod': 'setLayoutParams,getLayoutParams' 30 | }, 31 | 'DRAWABLE': { 32 | 'ctr': 'android.graphics.drawable.GradientDrawable->new', 33 | 'required': '', 34 | 'viewMethod': 'setBackground,getBackground' 35 | } 36 | } 37 | 38 | 39 | module.exports = map; 40 | -------------------------------------------------------------------------------- /src/doms/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | const getOS = require('../helper').getOS; 27 | 28 | function run() { 29 | let OS = getOS(); 30 | 31 | let type; 32 | switch (OS) { 33 | case "IOS": 34 | type = require("./ios") 35 | break; 36 | case "WEB": 37 | type = require("./web") 38 | break; 39 | default: 40 | type = require("./android") 41 | } 42 | 43 | return type; 44 | } 45 | 46 | module.exports = run(); -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | module.exports = { 27 | devtool: "source-map", 28 | entry: ["./demo/index.js"], 29 | output: { 30 | path: __dirname + "/dist", 31 | filename: "index_bundle.js", 32 | publicPath: '/dist/', 33 | sourceMapFilename: "index_bundle.js.map" 34 | }, 35 | module: { 36 | loaders: [ 37 | {test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"}, 38 | ] 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mystique / DUI 2 | > Javascript framework for building platform independent apps. 3 | 4 | [![npm version](https://img.shields.io/npm/v/@juspay/mystique.svg?style=flat)](https://www.npmjs.com/package/@juspay/mystique) 5 | 6 | Get the SDK for: 7 | 8 | * [Android](https://github.com/juspay/dui-android) 9 | 10 | _Soon for other platforms._ 11 | 12 | ## Getting Started 13 | 14 | These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. 15 | 16 | ### Prerequisites 17 | 18 | Depending upon weather you are using it for Android or IOS or Web you may have to make "Android" or "IOS" or "Web" global variable available. This will ensure the right platform gets the necessary commands from the JS engine (Web view/browser). 19 | 20 | ### Installing 21 | Install using npm 22 | 23 | ``` 24 | npm install @juspay/mystique --save 25 | ``` 26 | 27 | ### Development 28 | 1. Install the node modules. 29 | 30 | ``` 31 | npm install 32 | ``` 33 | 34 | 2. Running the webpack dev server during development. 35 | 36 | ``` 37 | npm start 38 | ``` 39 | 40 | The server should be running on `http://localhost:8080` 41 | 42 | 43 | ### Building 44 | 45 | If you want to generate `index_bundle.js` for shipping with your android/ios application. Then you can build it with this command. 46 | 47 | ``` 48 | npm run compile 49 | ``` 50 | 51 | The files will be written to `dist` 52 | 53 | ## Examples 54 | 55 | See the example in [demo](demo). 56 | 57 | ## License 58 | 59 | This project is licensed under the AGPL License - see the [LICENSE](LICENSE) file for details. 60 | > Copyright (c) 2012-2017 [juspay.in](https://www.juspay.in) 61 | 62 | 63 | ## Contributing 64 | 65 | See the [CONTRIBUTING.md](CONTRIBUTING.md) file for details. 66 | -------------------------------------------------------------------------------- /src/helpers/ios/flattenObject.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | module.exports = function flattenObject(ob) { 27 | var toReturn = {}; 28 | for (var i in ob) { 29 | if (!ob.hasOwnProperty(i)) continue; 30 | if ((typeof ob[i]) == 'object') { 31 | var flatObject = flattenObject(ob[i]); 32 | for (var x in flatObject) { 33 | if (!flatObject.hasOwnProperty(x)) continue; 34 | toReturn[x] = flatObject[x]; 35 | } 36 | } else { 37 | toReturn[i] = ob[i]; 38 | } 39 | } 40 | 41 | return toReturn; 42 | }; -------------------------------------------------------------------------------- /src/views/Button.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | * JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | * 5 | * This file is part of JUSPAY Platform. 6 | * 7 | * JUSPAY Platform is free software: you can redistribute it and/or modify 8 | * it for only educational purposes under the terms of the GNU Affero General 9 | * Public License (GNU AGPL) as published by the Free Software Foundation, 10 | * either version 3 of the License, or (at your option) any later version. 11 | * For Enterprise/Commerical licenses, contact . 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | * be liable for all damages without limitation, which is caused by the 17 | * ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | * damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | * The end user has NO right to claim any indemnification based on its use 20 | * of Licensed Software. See the GNU Affero General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Affero General Public License 23 | * along with this program. If not, see . 24 | */ 25 | 26 | var dom = require('../doms'); 27 | var View = require('../baseView'); 28 | 29 | class Button extends View { 30 | constructor(props, children) { 31 | super(props, children); 32 | 33 | this.setIds([ 34 | 'id' 35 | ]); 36 | } 37 | 38 | render() { 39 | var params = this.props; 40 | params.__filename = params.__source.fileName + ' :ln ' + params.__source.lineNumber; 41 | 42 | return ( 43 |