-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Upgrade dependencies - Modify code to work with Angular 4 - Move demo app into /example A few things are still broken but the app will at least compile and run.
- Loading branch information
Showing
77 changed files
with
3,005 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
.pub | ||
build | ||
pubspec.lock | ||
TODO | ||
venv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
0.0.4 | ||
===== | ||
|
||
- Rename from ng2_modular_admin to ng_modular_admin | ||
- Upgrade to Angular Dart 4.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
analyzer: | ||
strong-mode: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License | ||
|
||
Copyright (c) 2014-2016 Google, Inc. http://angular.io | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This directory contains a demo application for Modular Admin for Angular Dart. | ||
|
||
View [the demo](https://hyperiongray.github.io/ng_modular_admin/) on GitHub | ||
Pages. | ||
|
||
If you want to run this demo locally, clone the repo and run `pub serve` from | ||
this directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
analyzer: | ||
strong-mode: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:angular/angular.dart'; | ||
import 'package:angular_router/angular_router.dart'; | ||
|
||
import 'package:ng_modular_admin/ng_modular_admin.dart'; | ||
|
||
/// About component. | ||
@Component( | ||
selector: 'about', | ||
templateUrl: 'about.html', | ||
directives: const [ROUTER_DIRECTIVES, MA_DIRECTIVES] | ||
) | ||
class AboutComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<ma-card> | ||
<h2>About ng_modular_admin</h2> | ||
<p class='lead'>A port of Modular Admin to Angular Dart</p> | ||
<p class='text-danger'> | ||
ng_modular_admin is still alpha quality. Don't use it on your production | ||
project! | ||
</p> | ||
<p> | ||
This project is a port of | ||
<a href='http://modularcode.io/single-project.html'>Modular Admin HTML</a> | ||
to Angular Dart and is based on | ||
<a href='https://v4-alpha.getbootstrap.com/'>Boostrap 4</a>. The upstream | ||
project is built like a standard Bootstrap template (HTML, monolithic CSS, | ||
and some JavaScript), but this port focuses on adapting the theme to the | ||
world of <a href='http://webcomponents.org/'>web components</a>. | ||
</p> | ||
<p> | ||
The goal for <code>ng_modular_admin</code> is to make it easy to build | ||
sophisticated single page applications (SPA's) with Angular Dart by | ||
providing a library of common components along with a standard layout. | ||
</p> | ||
</ma-card> | ||
<ma-card> | ||
<h2>Web Components</h2> | ||
<p> | ||
In the web component world, GUI widgets are built as custom elements. For | ||
example, this port of Modular Admin has elements like | ||
<code><ma-side-nav></code> and <code><ma-button></code>. Web | ||
components have <em>style encapsulation</em>, which means the styles for a | ||
component are scoped only to that component. This prevents components from | ||
different vendors from interfering with each other or with your own code. | ||
</p> | ||
<p> | ||
In addition, web components may have simpler markup than plain HTML, | ||
because the author of each component can hide complexity inside the custom | ||
element. It's the HTML equivalent of providing a high-level API that | ||
abstracts over a low-level API. | ||
</p> | ||
<p> | ||
The web component movement is still small but growing. | ||
<a href='https://www.polymer-project.org/1.0/'>Google Polymer</a> and | ||
<a href='https://x-tag.readme.io/'>Microsoft X-Tag</a> are two major component | ||
systems under development, but there isn't yet a single component library | ||
that meets all of our needs, so we built <code>ng_modular_admin</code> to | ||
fill the void. | ||
</p> | ||
</ma-card> | ||
<ma-card> | ||
<h2>Getting Started</h2> | ||
<p> | ||
To use <code>ng_modular_admin</code> in your own Angular Dart project, you | ||
need to do two things: | ||
</p> | ||
<ol> | ||
<li>Add Modular Admin as a dependency in <code>pubspec.yaml</code>.</li> | ||
<li>Add the stylesheet to your <code>index.html</code>: </li> | ||
</ol> | ||
<p> | ||
The stylesheet element should look like this: | ||
</p> | ||
<pre class='code'><link rel='stylesheet' | ||
type='text/css' | ||
href='packages/ng_modular_admin/css/modular-admin.css'></pre> | ||
<p> | ||
If you're not familiar with Dart, read the | ||
<a href="https://www.dartlang.org/guides/language">Language Overview</a>. | ||
If you're not familiar with Angular Dart, read | ||
<a href="https://webdev.dartlang.org/angular">About AngularDart</a>. | ||
</p> | ||
</ma-card> | ||
<ma-card> | ||
<h2>Resources</h2> | ||
<p> | ||
For additional information, consult the following resources: | ||
</p> | ||
<ul> | ||
<li><a href='https://github.com/hyperiongray/ng_modular_admin'>Modular Admin Source Code</a></li> | ||
<li><a href='https://pub.dartlang.org/packages/ng_fontawesome'>Pub Package</a></li> | ||
</ul> | ||
</ma-card> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import 'dart:html'; | ||
|
||
import 'package:angular/angular.dart'; | ||
import 'package:angular_forms/angular_forms.dart'; | ||
import 'package:angular_router/angular_router.dart'; | ||
import 'package:ng_fontawesome/ng_fontawesome.dart'; | ||
import 'package:ng_modular_admin/ng_modular_admin.dart'; | ||
|
||
import 'package:ng_modular_admin_demo/about.dart'; | ||
import 'package:ng_modular_admin_demo/buttons.dart'; | ||
import 'package:ng_modular_admin_demo/cards.dart'; | ||
import 'package:ng_modular_admin_demo/footer.dart'; | ||
import 'package:ng_modular_admin_demo/forms.dart'; | ||
import 'package:ng_modular_admin_demo/layout.dart'; | ||
import 'package:ng_modular_admin_demo/list_group.dart'; | ||
import 'package:ng_modular_admin_demo/login.dart'; | ||
import 'package:ng_modular_admin_demo/overlay.dart'; | ||
import 'package:ng_modular_admin_demo/pagers.dart'; | ||
import 'package:ng_modular_admin_demo/side-nav.dart'; | ||
import 'package:ng_modular_admin_demo/sign-up.dart'; | ||
import 'package:ng_modular_admin_demo/tables.dart'; | ||
import 'package:ng_modular_admin_demo/tags.dart'; | ||
import 'package:ng_modular_admin_demo/themes.dart'; | ||
import 'package:ng_modular_admin_demo/toast.dart'; | ||
import 'package:ng_modular_admin_demo/top-nav.dart'; | ||
import 'package:ng_modular_admin_demo/typography.dart'; | ||
|
||
/// Top-level component for Modular Admin demo. | ||
@Component( | ||
selector: 'body', | ||
styles: const [''' | ||
ma-top-nav form { | ||
position: relative; | ||
top: -5px; | ||
} | ||
'''], | ||
templateUrl: 'body.html', | ||
directives: const [CORE_DIRECTIVES, FaIcon, formDirectives, MA_DIRECTIVES, | ||
ROUTER_DIRECTIVES], | ||
providers: const [ROUTER_PROVIDERS, MA_PROVIDERS, LayoutService, | ||
TagsService, | ||
const Provider(LocationStrategy, useClass: HashLocationStrategy), | ||
] | ||
) | ||
@RouteConfig(const [ | ||
const Route(path: '/about', name: 'About', component: AboutComponent, useAsDefault: true), | ||
const Route(path: '/buttons', name: 'Buttons', component: ButtonsComponent), | ||
const Route(path: '/cards', name: 'Cards', component: CardsComponent), | ||
const Route(path: '/footer', name: 'Footer', component: FooterComponent), | ||
const Route(path: '/forms', name: 'Forms', component: FormsComponent), | ||
const Route(path: '/layout', name: 'Layout', component: LayoutComponent), | ||
const Route(path: '/list-group', name: 'ListGroup', component: ListGroupComponent), | ||
const Route(path: '/login', name: 'Login', component: LoginComponent), | ||
const Route(path: '/overlay', name: 'Overlay', component: OverlayComponent), | ||
const Route(path: '/pagers', name: 'Pagers', component: PagersComponent), | ||
const Route(path: '/side-nav', name: 'SideNav', component: SideNavComponent), | ||
const Route(path: '/sign-up', name: 'SignUp', component: SignUpComponent), | ||
const Route(path: '/tables', name: 'Tables', component: TablesComponent), | ||
const Route(path: '/tags', name: 'Tags', component: TagsComponent), | ||
const Route(path: '/themes', name: 'Themes', component: ThemesComponent), | ||
const Route(path: '/toast', name: 'Toast', component: ToastComponent), | ||
const Route(path: '/top-nav', name: 'TopNav', component: TopNavComponent), | ||
const Route(path: '/typography', name: 'Typography', component: TypographyComponent), | ||
]) | ||
class BodyComponent { | ||
/// Application layout service. | ||
LayoutService layoutService; | ||
|
||
/// Tags (a.k.a. badges) service. | ||
TagsService tagsService; | ||
|
||
/// Toast (a.k.a. pop-up notifications) service. | ||
ToastService toastService; | ||
|
||
/// Search term. | ||
String searchTerm; | ||
|
||
/// Constructor. | ||
BodyComponent(this.layoutService, this.tagsService, this.toastService); | ||
|
||
/// Search form submit handler. | ||
void handleSubmit() { | ||
window.alert('You searched for: "$searchTerm"'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<ma-app> | ||
<ma-toast-outlet [service]='toastService'></ma-toast-outlet> | ||
<ma-top-nav *ngIf='layoutService.hasTopNav' [fixed]='layoutService.topNavIsFixed'> | ||
<form (submit)='handleSubmit()' role='search' class='float-xs-left'> | ||
<fa name='search' size='lg'></fa> | ||
<input type='search' placeholder='Search' [(ngModel)]='searchTerm'> | ||
</form> | ||
<div class='float-xs-right buttons'> | ||
<ma-button size='small' | ||
href='https://github.com/hyperiongray/ng_modular_admin'> | ||
<fa name='github'></fa> | ||
View On GitHub | ||
</ma-button> | ||
<ma-button size='small' | ||
href='https://github.com/HyperionGray/ng_modular_admin/archive/master.zip'> | ||
<fa name='cloud-download'></fa> | ||
Download ZIP | ||
</ma-button> | ||
</div> | ||
</ma-top-nav> | ||
<ma-side-nav *ngIf='layoutService.hasSideNav' [fixed]='layoutService.sideNavIsFixed'> | ||
<ma-side-nav-header> | ||
<ma-logo></ma-logo> Ng2 Mod Admin | ||
</ma-side-nav-header> | ||
<ma-side-nav-item [route]='["About"]'> | ||
<fa name='home' [fw]='true' size='lg'></fa> About | ||
<ma-tag type='primary' [pill]='true' class='float-xs-right'>{{tagsService.aboutBadge}}</ma-tag> | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Layout"]'> | ||
<fa name='th' [fw]='true' size='lg'></fa> Layout | ||
<ma-tag type='info' [pill]='true' class='float-xs-right'>{{tagsService.layoutBadge}}</ma-tag> | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Themes"]'> | ||
<fa name='paint-brush' [fw]='true' size='lg'></fa> Themes | ||
<ma-tag type='danger' [pill]='true' class='float-xs-right'>{{tagsService.themesBadge}}</ma-tag> | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Typography"]'> | ||
<fa name='font' [fw]='true' size='lg'></fa> Typography | ||
</ma-side-nav-item> | ||
<ma-side-nav-menu> | ||
<ma-side-nav-menu-header> | ||
<fa name='map-signs' [fw]='true' size='lg'></fa> Navigation | ||
</ma-side-nav-menu-header> | ||
<ma-side-nav-item [route]='["Footer"]'> | ||
Footer | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["SideNav"]'> | ||
Side Navigation | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["TopNav"]'> | ||
Top Navigation | ||
</ma-side-nav-item> | ||
</ma-side-nav-menu> | ||
<ma-side-nav-menu> | ||
<ma-side-nav-menu-header> | ||
<fa name='gears' [fw]='true' size='lg'></fa> Components | ||
</ma-side-nav-menu-header> | ||
<ma-side-nav-item [route]='["Buttons"]'> | ||
Buttons | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Cards"]'> | ||
Cards | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Forms"]'> | ||
Forms | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["ListGroup"]'> | ||
List Group | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Overlay"]'> | ||
Overlay | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Pagers"]'> | ||
Pagers | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Tables"]'> | ||
Tables | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Tags"]'> | ||
Tags | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["Toast"]'> | ||
Toast | ||
</ma-side-nav-item> | ||
</ma-side-nav-menu> | ||
<ma-side-nav-menu> | ||
<ma-side-nav-menu-header> | ||
<fa name='file-text-o' [fw]='true' size='lg'></fa> Pages | ||
</ma-side-nav-menu-header> | ||
<ma-side-nav-item [route]='["Login"]'> | ||
Log In | ||
</ma-side-nav-item> | ||
<ma-side-nav-item [route]='["SignUp"]'> | ||
Sign Up | ||
</ma-side-nav-item> | ||
</ma-side-nav-menu> | ||
</ma-side-nav> | ||
<ma-content> | ||
<router-outlet></router-outlet> | ||
</ma-content> | ||
<ma-footer *ngIf='layoutService.hasFooter' [fixed]='layoutService.footerIsFixed'> | ||
<div class='float-xs-left'> | ||
Footer content | ||
</div> | ||
<div class='float-xs-right'> | ||
More content | ||
</div> | ||
</ma-footer> | ||
</ma-app> |
Oops, something went wrong.