mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 12:35:07 +00:00
new helpers.scss + size helpers + ngx-datatable styles + show toolbar by default
This commit is contained in:
parent
aa0c1d7a87
commit
5ca5400ba7
|
@ -18,7 +18,7 @@
|
||||||
// Partials
|
// Partials
|
||||||
@import "partials/reset";
|
@import "partials/reset";
|
||||||
@import "partials/normalize";
|
@import "partials/normalize";
|
||||||
@import "partials/spacing";
|
@import "partials/helpers";
|
||||||
@import "partials/global";
|
@import "partials/global";
|
||||||
@import "partials/icons";
|
@import "partials/icons";
|
||||||
@import "partials/colors";
|
@import "partials/colors";
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
// Material colors map
|
// Material colors map
|
||||||
$matColorsMap: (
|
$matColorsMap: (
|
||||||
|
primary: $primary,
|
||||||
|
accent: $accent,
|
||||||
|
warn: $warn,
|
||||||
red: $mat-red,
|
red: $mat-red,
|
||||||
pink: $mat-pink,
|
pink: $mat-pink,
|
||||||
purple: $mat-purple,
|
purple: $mat-purple,
|
||||||
|
@ -20,27 +23,17 @@ $matColorsMap: (
|
||||||
grey: $mat-grey,
|
grey: $mat-grey,
|
||||||
blue-grey: $mat-blue-grey,
|
blue-grey: $mat-blue-grey,
|
||||||
white: $mat-white,
|
white: $mat-white,
|
||||||
black: $mat-black,
|
black: $mat-black
|
||||||
primary: $primary,
|
|
||||||
accent: $accent,
|
|
||||||
warn: $warn
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Material color hues list
|
// Material color hues list
|
||||||
$matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700;
|
$matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400, A700;
|
||||||
|
|
||||||
// Color classes generator mixin
|
// Text color levels generator mixin
|
||||||
@mixin generateColorClasses($colorName, $bgColor, $fgColor, $hue) {
|
@mixin generateTextColorLevels($baseTextColor) {
|
||||||
|
|
||||||
.#{$colorName}#{$hue}-bg {
|
// If the base text color is black...
|
||||||
background-color: $bgColor !important;
|
@if (rgba(black, 1) == rgba($baseTextColor, 1)) {
|
||||||
}
|
|
||||||
|
|
||||||
.md-#{$colorName}#{$hue}-bg {
|
|
||||||
background-color: $bgColor !important;
|
|
||||||
color: $fgColor !important;
|
|
||||||
|
|
||||||
@if (rgba(black, 1) == rgba($fgColor, 1)) {
|
|
||||||
|
|
||||||
&.secondary-text,
|
&.secondary-text,
|
||||||
.secondary-text,
|
.secondary-text,
|
||||||
|
@ -63,7 +56,16 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
||||||
color: rgba(0, 0, 0, 0.12) !important;
|
color: rgba(0, 0, 0, 0.12) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
} @else {
|
}
|
||||||
|
// If the base text color is white...
|
||||||
|
@else {
|
||||||
|
|
||||||
|
&.mat-icon,
|
||||||
|
.mat-icon,
|
||||||
|
&.icon,
|
||||||
|
.icon {
|
||||||
|
color: rgba(255, 255, 255, 1) !important;
|
||||||
|
}
|
||||||
|
|
||||||
&.secondary-text,
|
&.secondary-text,
|
||||||
.secondary-text {
|
.secondary-text {
|
||||||
|
@ -82,30 +84,50 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
||||||
color: rgba(255, 255, 255, 0.12) !important;
|
color: rgba(255, 255, 255, 0.12) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Color classes generator mixin
|
||||||
|
@mixin generateColorClasses($colorName, $color, $contrastColor, $hue) {
|
||||||
|
|
||||||
|
.#{$colorName}#{$hue}-bg {
|
||||||
|
background-color: $color !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.md-#{$colorName}#{$hue}-bg {
|
||||||
|
background-color: $color !important;
|
||||||
|
color: $contrastColor !important;
|
||||||
|
|
||||||
|
// Generate text color levels
|
||||||
|
// based on current contrast color
|
||||||
|
@include generateTextColorLevels($contrastColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$colorName}#{$hue}-fg {
|
.#{$colorName}#{$hue}-fg {
|
||||||
color: $bgColor !important;
|
color: $color !important;
|
||||||
|
|
||||||
|
// Generate text color levels
|
||||||
|
// based on current color
|
||||||
|
@include generateTextColorLevels($color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$colorName}#{$hue}-border {
|
.#{$colorName}#{$hue}-border {
|
||||||
border-color: $bgColor !important;
|
border-color: $color !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$colorName}#{$hue}-border-top {
|
.#{$colorName}#{$hue}-border-top {
|
||||||
border-top-color: $bgColor !important;
|
border-top-color: $color !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$colorName}#{$hue}-border-right {
|
.#{$colorName}#{$hue}-border-right {
|
||||||
border-right-color: $bgColor !important;
|
border-right-color: $color !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$colorName}#{$hue}-border-bottom {
|
.#{$colorName}#{$hue}-border-bottom {
|
||||||
border-bottom-color: $bgColor !important;
|
border-bottom-color: $color !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$colorName}#{$hue}-border-left {
|
.#{$colorName}#{$hue}-border-left {
|
||||||
border-left-color: $bgColor !important;
|
border-left-color: $color !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,16 +136,16 @@ $matColorHues: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, A400
|
||||||
|
|
||||||
@each $hue in $matColorHues {
|
@each $hue in $matColorHues {
|
||||||
|
|
||||||
$bgColor: map-get($colorMap, $hue);
|
$color: map-get($colorMap, $hue);
|
||||||
$fgColor: map-get(map-get($colorMap, 'contrast'), $hue);
|
$contrastColor: map-get(map-get($colorMap, 'contrast'), $hue);
|
||||||
|
|
||||||
@if ($bgColor != null and $fgColor != null) {
|
@if ($color != null and $contrastColor != null) {
|
||||||
|
|
||||||
@include generateColorClasses($colorName, $bgColor, $fgColor, '-#{$hue}');
|
@include generateColorClasses($colorName, $color, $contrastColor, '-#{$hue}');
|
||||||
|
|
||||||
// Run the generator one more time for default values (500)
|
// Run the generator one more time for default values (500)
|
||||||
@if ($hue == 500) {
|
@if ($hue == 500) {
|
||||||
@include generateColorClasses($colorName, $bgColor, $fgColor, '');
|
@include generateColorClasses($colorName, $color, $contrastColor, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,54 @@
|
||||||
// Margin and Padding
|
// ######################
|
||||||
|
// SIZE HELPERS
|
||||||
|
// ######################
|
||||||
|
@each $prop, $abbrev in (height: h, width: w) {
|
||||||
|
|
||||||
|
@for $index from 0 through 128 {
|
||||||
|
$size: $index * 4;
|
||||||
|
$length: #{$size}px;
|
||||||
|
|
||||||
|
.#{$abbrev}-#{$size} {
|
||||||
|
#{$prop}: $length !important;
|
||||||
|
min-#{$prop}: $length !important;
|
||||||
|
max-#{$prop}: $length !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ######################
|
||||||
|
// SPACING HELPERS
|
||||||
|
// ######################
|
||||||
@each $prop, $abbrev in (margin: m, padding: p) {
|
@each $prop, $abbrev in (margin: m, padding: p) {
|
||||||
|
|
||||||
@for $index from 0 through 64 {
|
@for $index from 0 through 64 {
|
||||||
$size: $index *4;
|
$size: $index * 4;
|
||||||
$length: #{$size}px;
|
$length: #{$size}px;
|
||||||
|
|
||||||
.#{$abbrev}-#{$size} {
|
.#{$abbrev}-#{$size} {
|
||||||
#{$prop}: $length !important;
|
#{$prop}: $length !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$abbrev}t-#{$size} {
|
.#{$abbrev}t-#{$size} {
|
||||||
#{$prop}-top: $length !important;
|
#{$prop}-top: $length !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$abbrev}r-#{$size} {
|
.#{$abbrev}r-#{$size} {
|
||||||
#{$prop}-right: $length !important;
|
#{$prop}-right: $length !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$abbrev}b-#{$size} {
|
.#{$abbrev}b-#{$size} {
|
||||||
#{$prop}-bottom: $length !important;
|
#{$prop}-bottom: $length !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$abbrev}l-#{$size} {
|
.#{$abbrev}l-#{$size} {
|
||||||
#{$prop}-left: $length !important;
|
#{$prop}-left: $length !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$abbrev}x-#{$size} {
|
.#{$abbrev}x-#{$size} {
|
||||||
#{$prop}-right: $length !important;
|
#{$prop}-right: $length !important;
|
||||||
#{$prop}-left: $length !important;
|
#{$prop}-left: $length !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$abbrev}y-#{$size} {
|
.#{$abbrev}y-#{$size} {
|
||||||
#{$prop}-top: $length !important;
|
#{$prop}-top: $length !important;
|
||||||
#{$prop}-bottom: $length !important;
|
#{$prop}-bottom: $length !important;
|
||||||
|
@ -30,7 +56,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some special margin utils
|
// Some special margin utils for flex alignments
|
||||||
.m-auto {
|
.m-auto {
|
||||||
margin: auto !important;
|
margin: auto !important;
|
||||||
}
|
}
|
63
src/app/core/scss/partials/plugins/_ngx-datatable.scss
Normal file
63
src/app/core/scss/partials/plugins/_ngx-datatable.scss
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
.ngx-datatable {
|
||||||
|
|
||||||
|
&.material {
|
||||||
|
@include mat-elevation(4);
|
||||||
|
|
||||||
|
.empty-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
line-height: 1;
|
||||||
|
height: 56px;
|
||||||
|
padding: 0 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.datatable-header {
|
||||||
|
|
||||||
|
.datatable-header-cell {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
line-height: 1;
|
||||||
|
min-height: 48px;
|
||||||
|
padding: 0 24px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.datatable-body {
|
||||||
|
|
||||||
|
.datatable-row-left,
|
||||||
|
.datatable-row-center,
|
||||||
|
.datatable-row-right {
|
||||||
|
min-height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.datatable-row-wrapper {
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
|
||||||
|
|
||||||
|
.datatable-body-cell {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
line-height: 1;
|
||||||
|
min-height: 48px;
|
||||||
|
padding: 0 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.datatable-footer {
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
.datatable-footer-inner {
|
||||||
|
padding: 0 24px;
|
||||||
|
|
||||||
|
.page-count {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.datatable-pager {
|
||||||
|
margin: 0 0 0 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +1,2 @@
|
||||||
@import "perfect-scrollbar";
|
@import "perfect-scrollbar";
|
||||||
|
@import "ngx-datatable";
|
|
@ -1,5 +1,5 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ActivatedRoute, ActivatedRouteSnapshot, NavigationStart, Router, NavigationEnd, Route, RouterState } from '@angular/router';
|
import { NavigationStart, Router } from '@angular/router';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
|
|
||||||
import 'rxjs/add/operator/filter';
|
import 'rxjs/add/operator/filter';
|
||||||
|
@ -20,7 +20,7 @@ export class FuseLayoutService
|
||||||
// Set the default settings
|
// Set the default settings
|
||||||
this.defaultSettings = {
|
this.defaultSettings = {
|
||||||
navigation: 'left', // 'right', 'left', 'top', none
|
navigation: 'left', // 'right', 'left', 'top', none
|
||||||
toolbar : 'none', // 'above', 'below', none
|
toolbar : 'below', // 'above', 'below', none
|
||||||
footer : 'none' // 'above', 'below', none
|
footer : 'none' // 'above', 'below', none
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,31 @@
|
||||||
<ngx-datatable
|
<div id="ngx-datatable" class="page-layout simple fullwidth">
|
||||||
|
|
||||||
|
<!-- HEADER -->
|
||||||
|
<div class="header md-accent-bg p-24 h-160" fxLayout="row" fxLayoutAlign="space-between">
|
||||||
|
<div fxLayout="column" fxLayoutAlign="center start">
|
||||||
|
<div class="black-fg" fxLayout="row" fxLayoutAlign="start center">
|
||||||
|
<md-icon class="secondary-text s-16">home</md-icon>
|
||||||
|
<md-icon class="secondary-text s-16">chevron_right</md-icon>
|
||||||
|
<span class="secondary-text">Tables</span>
|
||||||
|
</div>
|
||||||
|
<div class="h2 mt-16">ngx-datatable</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div fxLayout="row" fxLayoutAlign="start center">
|
||||||
|
<a md-raised-button class="md-white-bg"
|
||||||
|
href="https://github.com/swimlane/ngx-datatable"
|
||||||
|
target="_blank">
|
||||||
|
<md-icon>link</md-icon>
|
||||||
|
<span>Reference</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- / HEADER -->
|
||||||
|
|
||||||
|
<!-- CONTENT -->
|
||||||
|
<div class="content p-24">
|
||||||
|
|
||||||
|
<ngx-datatable
|
||||||
class="material"
|
class="material"
|
||||||
[rows]="rows"
|
[rows]="rows"
|
||||||
[loadingIndicator]="loadingIndicator"
|
[loadingIndicator]="loadingIndicator"
|
||||||
|
@ -9,4 +36,9 @@
|
||||||
[rowHeight]="'auto'"
|
[rowHeight]="'auto'"
|
||||||
[reorderable]="reorderable"
|
[reorderable]="reorderable"
|
||||||
[limit]="10">
|
[limit]="10">
|
||||||
</ngx-datatable>
|
</ngx-datatable>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user