Various experiments with JS and React and what-not.

This commit is contained in:
James Cole 2019-01-01 15:41:54 +01:00
parent 7aa5eee3aa
commit 17359c5e42
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
13 changed files with 7061 additions and 9430 deletions

31
composer.lock generated
View File

@ -591,16 +591,16 @@
}, },
{ {
"name": "doctrine/dbal", "name": "doctrine/dbal",
"version": "v2.9.1", "version": "v2.9.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/dbal.git", "url": "https://github.com/doctrine/dbal.git",
"reference": "ec74d6e300d78fbc896669c3ca57ef9719adc9c6" "reference": "22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/ec74d6e300d78fbc896669c3ca57ef9719adc9c6", "url": "https://api.github.com/repos/doctrine/dbal/zipball/22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9",
"reference": "ec74d6e300d78fbc896669c3ca57ef9719adc9c6", "reference": "22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -669,7 +669,7 @@
"php", "php",
"queryobject" "queryobject"
], ],
"time": "2018-12-14T04:51:13+00:00" "time": "2018-12-31T03:27:51+00:00"
}, },
{ {
"name": "doctrine/event-manager", "name": "doctrine/event-manager",
@ -1758,16 +1758,16 @@
}, },
{ {
"name": "league/commonmark", "name": "league/commonmark",
"version": "0.18.0", "version": "0.18.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/commonmark.git", "url": "https://github.com/thephpleague/commonmark.git",
"reference": "006af077d4b1b7eb1d9760964f9f984ba188632c" "reference": "e5029f74ba39e043ce4b3ca6c05dc719d8aafd94"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/006af077d4b1b7eb1d9760964f9f984ba188632c", "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/e5029f74ba39e043ce4b3ca6c05dc719d8aafd94",
"reference": "006af077d4b1b7eb1d9760964f9f984ba188632c", "reference": "e5029f74ba39e043ce4b3ca6c05dc719d8aafd94",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1816,14 +1816,14 @@
"role": "Lead Developer" "role": "Lead Developer"
} }
], ],
"description": "Markdown parser for PHP based on the CommonMark spec", "description": "PHP Markdown parser based on the CommonMark spec",
"homepage": "https://github.com/thephpleague/commonmark", "homepage": "https://github.com/thephpleague/commonmark",
"keywords": [ "keywords": [
"commonmark", "commonmark",
"markdown", "markdown",
"parser" "parser"
], ],
"time": "2018-09-18T13:13:55+00:00" "time": "2018-12-30T01:55:29+00:00"
}, },
{ {
"name": "league/csv", "name": "league/csv",
@ -6474,12 +6474,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git", "url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "38eddac85b7ea1891fc28aeb71c1e45fa01200ad" "reference": "5f3e0c82ada2d16fdd637b24e095888f4abac43f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/38eddac85b7ea1891fc28aeb71c1e45fa01200ad", "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/5f3e0c82ada2d16fdd637b24e095888f4abac43f",
"reference": "38eddac85b7ea1891fc28aeb71c1e45fa01200ad", "reference": "5f3e0c82ada2d16fdd637b24e095888f4abac43f",
"shasum": "" "shasum": ""
}, },
"conflict": { "conflict": {
@ -6543,6 +6543,7 @@
"la-haute-societe/tcpdf": "<6.2.22", "la-haute-societe/tcpdf": "<6.2.22",
"laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30",
"laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10",
"league/commonmark": ">=0.15.6,<0.18.1",
"magento/magento1ce": "<1.9.4", "magento/magento1ce": "<1.9.4",
"magento/magento1ee": ">=1.9,<1.14.4", "magento/magento1ee": ">=1.9,<1.14.4",
"magento/product-community-edition": ">=2,<2.2.7", "magento/product-community-edition": ">=2,<2.2.7",
@ -6668,7 +6669,7 @@
} }
], ],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
"time": "2018-12-28T16:50:10+00:00" "time": "2018-12-30T13:00:21+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",

9400
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,17 +12,21 @@
"devDependencies": { "devDependencies": {
"@babel/preset-react": "^7.0.0", "@babel/preset-react": "^7.0.0",
"axios": "^0.18", "axios": "^0.18",
"babel-preset-react": "^6.23.0", "babel-preset-react": "^6.24.1",
"bootstrap": "^4.0.0", "bootstrap": "^4.0.0",
"cross-env": "^5.1", "cross-env": "^5.1",
"jquery": "^3.2", "jquery": "^3.2",
"laravel-mix": "^4.0.7", "laravel-mix": "^4.0.7",
"lodash": "^4.17.5", "lodash": "^4.17.5",
"popper.js": "^1.12", "popper.js": "^1.12",
"react": "^16.2.0", "react": "^16.7.0",
"react-dom": "^16.2.0", "react-dom": "^16.7.0",
"resolve-url-loader": "^2.3.1", "resolve-url-loader": "^2.3.1",
"sass": "^1.15.2", "sass": "^1.15.2",
"sass-loader": "^7.1.0" "sass-loader": "^7.1.0"
},
"dependencies": {
"tabler-react": "^1.27.0",
"font-awesome": "4.7.0"
} }
} }

View File

@ -1,4 +1,4 @@
{ {
"/js/app.js": "/js/app.js", "/v2/assets/js/app.js": "/v2/assets/js/app.js",
"/css/app.css": "/css/app.css" "/v2/assets/css/app.css": "/v2/assets/css/app.css"
} }

25
resources/js/app.js vendored
View File

@ -1,4 +1,24 @@
/*
* app.js
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
/** /**
* First we will load all of this project's JavaScript dependencies which * First we will load all of this project's JavaScript dependencies which
* includes React and other helpers. It's a great starting point while * includes React and other helpers. It's a great starting point while
@ -13,4 +33,7 @@ require('./bootstrap');
* or customize the JavaScript scaffolding to fit your unique needs. * or customize the JavaScript scaffolding to fit your unique needs.
*/ */
require('./components/Example'); require('./components/Main');
require('./components/TopMenu');

View File

@ -1,4 +1,24 @@
/*
* bootstrap.js
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
window._ = require('lodash'); window._ = require('lodash');
/** /**
@ -43,9 +63,6 @@ if (token) {
* for events that are broadcast by Laravel. Echo and event broadcasting * for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications. * allows your team to easily build robust real-time web applications.
*/ */
// import Echo from 'laravel-echo'
// window.Pusher = require('pusher-js'); // window.Pusher = require('pusher-js');
// window.Echo = new Echo({ // window.Echo = new Echo({

View File

@ -1,3 +1,23 @@
/*
* Example.js
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';

63
resources/js/components/Main.js vendored Normal file
View File

@ -0,0 +1,63 @@
/*
* Main.js
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import "tabler-react/dist/Tabler.css";
import { Card, Button } from "tabler-react";
class MyCard extends Component {
render() {
return (
<Card>
<Card.Header>
<Card.Title>Card Title</Card.Title>
</Card.Header>
<Card.Body>
<Button color="primary">A Button</Button>
</Card.Body>
</Card>
);
}
}
/* An example React component */
class Main extends Component {
render() {
return (
<div>
<h3>All Products</h3>
</div>
);
}
}
export default Main;
/* The if statement is required so as to Render the component on pages that have a div with an ID of "root";
*/
if (document.getElementById('root')) {
ReactDOM.render(<Main />, document.getElementById('root'));
}
if (document.getElementById('root')) {
ReactDOM.render(<MyCard />, document.getElementById('myCard'));
}

49
resources/js/components/TopMenu.js vendored Normal file
View File

@ -0,0 +1,49 @@
/*
* TopMenu.js
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { Component } from 'react';
import ReactDOM from "react-dom";
import {Nav} from "tabler-react";
class TopMenu extends Component {
render() {
return (
<Nav className="nav nav-tabs border-0 flex-column flex-lg-row">
<Nav.Item active hasSubNav value="Dashboard" icon="zap">
<Nav.SubItem value="Sub Item 1" />
<Nav.SubItem>Sub Item 2</Nav.SubItem>
<Nav.SubItem icon="globe">Sub Item 3</Nav.SubItem>
</Nav.Item>
<Nav.Item to="http://www.example.com">Page Two</Nav.Item>
<Nav.Item value="Page Three" />
<Nav.Item active icon="user">
Page Four
</Nav.Item>
</Nav>
);
}
}
if (document.getElementById('TopMenu')) {
ReactDOM.render(<TopMenu />, document.getElementById('TopMenu'));
}

View File

@ -1,3 +1,23 @@
/*!
* _variables.scss
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
// Body // Body
$body-bg: #f8fafc; $body-bg: #f8fafc;

View File

@ -1,3 +1,23 @@
/*!
* app.scss
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
// Fonts // Fonts
@import url('https://fonts.googleapis.com/css?family=Nunito'); @import url('https://fonts.googleapis.com/css?family=Nunito');
@ -8,7 +28,6 @@
// Bootstrap // Bootstrap
@import '~bootstrap/scss/bootstrap'; @import '~bootstrap/scss/bootstrap';
.navbar-laravel { // Font awesome.
background-color: #fff; // @import "node_modules/font-awesome/scss/font-awesome";
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); @import "~font-awesome/scss/font-awesome";
}

4
webpack.mix.js vendored
View File

@ -11,5 +11,5 @@ const mix = require('laravel-mix');
| |
*/ */
mix.react('resources/js/app.js', 'public/js') mix.react('resources/js/app.js', 'public/v2/assets/js')
.sass('resources/sass/app.scss', 'public/css'); .sass('resources/sass/app.scss', 'public/v2/assets/css');

6815
yarn.lock Normal file

File diff suppressed because it is too large Load Diff