Initial app commit
This commit is contained in:
commit
2917dc0675
11 changed files with 11506 additions and 0 deletions
9
.babelrc
Normal file
9
.babelrc
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"presets": ["@babel/preset-env", "@babel/preset-react"],
|
||||||
|
"plugins": [
|
||||||
|
[
|
||||||
|
"@babel/plugin-proposal-class-properties",
|
||||||
|
{"loose": true}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
10
.editorconfig
Normal file
10
.editorconfig
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
node_modules/
|
||||||
|
dist/
|
1
.nvmrc
Normal file
1
.nvmrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
v12.13.1
|
10
README.md
Normal file
10
README.md
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# MCF-Components-Lib
|
||||||
|
|
||||||
|
This library exports an unique method to render components using *React* and *Material-UI* through a javascript object where is placed all
|
||||||
|
the information needed.
|
||||||
|
|
||||||
|
The method is **MCF_Renderer**
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
To install the library you can get the repository or install it as a dependency.
|
10280
package-lock.json
generated
Normal file
10280
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
34
package.json
Normal file
34
package.json
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"name": "mcf-components",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Library to render component templates pre-created using React and Material-UI",
|
||||||
|
"main": "src/components.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "webpack-dev-server --mode development",
|
||||||
|
"dist": "webpack --mode production",
|
||||||
|
"test": "jest",
|
||||||
|
"test:watch": "jest --watch"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.7.5",
|
||||||
|
"@babel/preset-env": "^7.7.6",
|
||||||
|
"@babel/preset-react": "^7.7.4",
|
||||||
|
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
||||||
|
"babel-loader": "^8.0.6",
|
||||||
|
"css-loader": "^3.4.0",
|
||||||
|
"html-webpack-plugin": "^3.2.0",
|
||||||
|
"jest": "^24.9.0",
|
||||||
|
"mini-css-extract-plugin": "^0.8.1",
|
||||||
|
"style-loader": "^1.0.2",
|
||||||
|
"webpack": "^4.41.3",
|
||||||
|
"webpack-cli": "^3.3.10",
|
||||||
|
"webpack-dev-server": "^3.9.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@material-ui/core": "4.3.3",
|
||||||
|
"prop-types": "15.7.2",
|
||||||
|
"react": "^16.12.0",
|
||||||
|
"react-dom": "^16.12.0",
|
||||||
|
"react-select": "^3.0.8"
|
||||||
|
}
|
||||||
|
}
|
1078
src/components.js
Normal file
1078
src/components.js
Normal file
File diff suppressed because it is too large
Load diff
10
src/example.html
Normal file
10
src/example.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>MCF Components</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
26
src/example.js
Normal file
26
src/example.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import {renderer} from './components';
|
||||||
|
|
||||||
|
const scheme = {
|
||||||
|
type: 'card',
|
||||||
|
params: {
|
||||||
|
id: 'testContainer',
|
||||||
|
mainText: 'Test card',
|
||||||
|
secondaryText: 'Testing',
|
||||||
|
contents: [
|
||||||
|
{
|
||||||
|
type: 'list_autocomplete',
|
||||||
|
params: {
|
||||||
|
id: 'editor',
|
||||||
|
placeholder: 'Select...',
|
||||||
|
helperText: 'Config to edit',
|
||||||
|
isClearable: true,
|
||||||
|
options: ['val1', 'val2'],
|
||||||
|
onSelectListener: function () {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
renderer(scheme, '#app');
|
46
webpack.config.js
Normal file
46
webpack.config.js
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
const path = require('path');
|
||||||
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: './src/example.js',
|
||||||
|
output: {
|
||||||
|
filename: 'main.js',
|
||||||
|
path: path.resolve(__dirname, 'dist'),
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
template: './src/example.html',
|
||||||
|
filename: path.resolve(__dirname, 'dist', 'example.html'),
|
||||||
|
}),
|
||||||
|
new MiniCssExtractPlugin({
|
||||||
|
filename: '[name].css',
|
||||||
|
chunkFilename: '[id].css',
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.(js|jsx)$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: {
|
||||||
|
loader: 'babel-loader',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: MiniCssExtractPlugin.loader,
|
||||||
|
},
|
||||||
|
'css-loader',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
devServer: {
|
||||||
|
contentBase: path.join(__dirname, 'dist'),
|
||||||
|
port: 9000,
|
||||||
|
historyApiFallback: true,
|
||||||
|
},
|
||||||
|
};
|
Loading…
Reference in a new issue