Skip to content

Commit

Permalink
feat(stark-ui): add show/hide functionality to tables
Browse files Browse the repository at this point in the history
  - update minimap component
  - update tests for minimap component
  - refactor column visibility property

CLOSES: #522
  • Loading branch information
carlo-nomes committed Feb 22, 2019
1 parent f4339ff commit 69b56f0
Show file tree
Hide file tree
Showing 33 changed files with 480 additions and 833 deletions.
1 change: 1 addition & 0 deletions packages/stark-ui/assets/styles/_base.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "~normalize.css/normalize.css";
@import "material-fixes";

html,
body {
Expand Down
7 changes: 7 additions & 0 deletions packages/stark-ui/assets/styles/_material-fixes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
line-height: initial;
}

// Causes checkbox trigger to take up entire width/height of menu item
.mat-menu-content div.mat-menu-item > mat-checkbox label {
margin: 0 -16px;
padding: 0 16px;
display: block;
}

// FIXME: Remove after https://github.com/angular/material2/pull/11801 is merged
// See: https://github.com/angular/material2/issues/11609
/** IE 11 fixes */
Expand Down
1 change: 1 addition & 0 deletions packages/stark-ui/assets/theming/_material-palettes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ $warning-palette: (
);

$mat-light-theme-background: $backgrounds;

$mat-light-theme-foreground: $foregrounds;

@if variable-exists(stark-accent-palette) {
Expand Down
1 change: 0 additions & 1 deletion packages/stark-ui/src/modules/minimap/components.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from "./components/minimap.component";
export * from "./components/item-properties.intf";
export * from "./components/item-visibility.intf";
129 changes: 17 additions & 112 deletions packages/stark-ui/src/modules/minimap/components/_minimap-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,134 +3,39 @@
/* ============================================================================== */
/* stark-ui: src/modules/minimap/components/minimap-theme.scss */

.compact-minimap {
& .stark-minimap-dots {
& i {
.stark-minimap {
.stark-minimap-dots {
i {
background-color: $secondary-dark-text-color;
opacity: 0.2;
}

& li.selected i {
.selected i {
opacity: 1;
}
}

& .stark-minimap-dropdown-toggle {
& .stark-minimap-dropdown-toggle-menu {
box-shadow: $elevation-4;

& mat-checkbox.mat-checked .mat-icon {
background-color: $md-accent;
}
}

& .mat-button.mat-icon-button {
& svg {
fill: #000;
}

border: 1px solid mat-color($grey-palette, 300);
background-color: $md-primary-alpha-05;
}

& mat-icon {
fill: $md-primary;
}

& .stark-minimap-dropdown-toggle-menu {
border-color: mat-color($grey-palette, 500);
box-shadow: 0 1px 2px mat-color($grey-palette, 300);
background-color: #fff;

& mat-checkbox {
&:hover {
background: $md-primary-alpha-05;
}

& ._mat-icon {
&::after {
border-color: mat-color($grey-palette, 50);
}
}

& .stark-minimap-dropdown {
& mat-checkbox.stark-minimap-column-checkbox {
&.mat-checked ._mat-icon {
background-color: $md-primary-200-alpha-38;
}
}
}
}
}
}
}

.full-minimap {
& .stark-minimap-dots {
& i {
background-color: $secondary-dark-text-color;
opacity: 0.2;
}

& li.selected i {
opacity: 1;
.stark-primary.stark-minimap {
.stark-minimap-dots {
i {
background-color: mat-color($primary-palette, 500);
}
}
}

& .stark-minimap-dropdown-toggle {
& .stark-minimap-dropdown-toggle-menu {
box-shadow: $elevation-4;

& mat-checkbox.mat-checked .mat-icon {
background-color: $md-accent;
}
}

& .mat-button.mat-icon-button {
& svg {
fill: #000;
}

border: 1px solid mat-color($grey-palette, 300);
background-color: $md-primary-alpha-05;
}

& mat-icon {
fill: $md-primary;
}

& .stark-minimap-dropdown-toggle-menu {
border-color: mat-color($grey-palette, 500);
box-shadow: 0 1px 2px mat-color($grey-palette, 300);
background-color: #fff;

& mat-checkbox {
&:hover {
background: $md-primary-alpha-05;
}

& ._mat-icon {
&::after {
border-color: mat-color($grey-palette, 50);
}
}

& .stark-minimap-dropdown {
& mat-checkbox.stark-minimap-column-checkbox {
&.mat-checked ._mat-icon {
background-color: $md-primary-200-alpha-38;
}
}
}
}
.stark-accent.stark-minimap {
.stark-minimap-dots {
i {
background-color: mat-color($accent-palette, 500);
}
}
}

.stark-table {
& .stark-minimap {
& .stark-minimap-dropdown-toggle .stark-minimap-dropdown-toggle-menu {
box-shadow: $elevation-2;
.stark-warning.stark-minimap {
.stark-minimap-dots {
i {
background-color: mat-color($warning-palette, 500);
}
}
}
Expand Down
Loading

0 comments on commit 69b56f0

Please sign in to comment.