Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Added ability to have items on the right side of a toolbar #18

Merged
merged 10 commits into from
Apr 8, 2019
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 4 additions & 1 deletion src/app/app-extras.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {
import {
SkyAlertModule,
SkyKeyInfoModule,
SkyLabelModule
SkyLabelModule,
SkyIconModule
} from '@skyux/indicators';

@NgModule({
Expand All @@ -31,6 +32,7 @@ import {
SkyCardModule,
SkyDefinitionListModule,
SkyFluidGridModule,
SkyIconModule,
SkyKeyInfoModule,
SkyPageSummaryModule,
SkyTextExpandModule,
Expand All @@ -44,6 +46,7 @@ import {
SkyCardModule,
SkyDefinitionListModule,
SkyFluidGridModule,
SkyIconModule,
SkyKeyInfoModule,
SkyLabelModule,
SkyPageSummaryModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div
class="sky-toolbar-view-actions"
>
<ng-content></ng-content>
</div>
19 changes: 19 additions & 0 deletions src/app/public/modules/toolbar/toolbar-view-actions.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import "~@skyux/theme/scss/mixins";

:host {
margin-left: auto;
}

.sky-toolbar-view-actions {

display: flex;
align-items: center;

@media (max-width: $sky-screen-sm-max) {
margin-bottom: 5px;
}
}

.sky-toolbar-view-actions ::ng-deep > :not(:last-child) {
margin-right: 5px;
}
10 changes: 10 additions & 0 deletions src/app/public/modules/toolbar/toolbar-view-actions.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {
Component
} from '@angular/core';
Blackbaud-TrevorBurch marked this conversation as resolved.
Show resolved Hide resolved

@Component({
selector: 'sky-toolbar-view-actions',
templateUrl: './toolbar-view-actions.component.html',
styleUrls: ['./toolbar-view-actions.component.scss']
Blackbaud-TrevorBurch marked this conversation as resolved.
Show resolved Hide resolved
})
export class SkyToolbarViewActionsComponent { }
33 changes: 26 additions & 7 deletions src/app/public/modules/toolbar/toolbar.module.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
NgModule
} from '@angular/core';

import { SkyToolbarComponent } from './toolbar.component';
import { SkyToolbarItemComponent } from './toolbar-item.component';
import { SkyToolbarSectionComponent } from './toolbar-section.component';
import {
CommonModule
} from '@angular/common';

import {
SkyToolbarComponent
} from './toolbar.component';

import {
SkyToolbarItemComponent
} from './toolbar-item.component';

import {
SkyToolbarSectionComponent
} from './toolbar-section.component';

import {
SkyToolbarViewActionsComponent
} from './toolbar-view-actions.component';

@NgModule({
declarations: [
SkyToolbarComponent,
SkyToolbarItemComponent,
SkyToolbarSectionComponent
SkyToolbarSectionComponent,
SkyToolbarViewActionsComponent
],
imports: [
CommonModule
],
exports: [
SkyToolbarComponent,
SkyToolbarItemComponent,
SkyToolbarSectionComponent
SkyToolbarSectionComponent,
SkyToolbarViewActionsComponent
]
})
export class SkyToolbarModule { }
55 changes: 49 additions & 6 deletions src/app/visual/toolbar/toolbar-visual.component.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,67 @@
<div id="screenshot-toolbar">
<div
id="screenshot-toolbar"
>
<sky-toolbar>
<sky-toolbar-item>
<button class="sky-btn sky-btn-default">Button 1</button>
<button
class="sky-btn sky-btn-default"
>
Button 1
</button>
</sky-toolbar-item>
<sky-toolbar-item>
<button class="sky-btn sky-btn-default">Button 2</button>
<button
class="sky-btn sky-btn-default"
>
Button 2
</button>
</sky-toolbar-item>
<sky-toolbar-view-actions>
<button
class="sky-btn sky-btn-default"
title="Sort descending"
type="button"
>
<sky-icon
icon="angle-double-down"
>
</sky-icon>
</button>
<button
class="sky-btn sky-btn-default"
title="Sort ascending"
type="button"
>
<sky-icon
icon="angle-double-up"
>
</sky-icon>
</button>
</sky-toolbar-view-actions>
</sky-toolbar>
</div>

<div id="screenshot-toolbar-sectioned" style="margin-top: 20px;">
<div
id="screenshot-toolbar-sectioned"
style="margin-top: 20px;"
>
<sky-toolbar>
<sky-toolbar-section>
<sky-toolbar-item>
<button class="sky-btn sky-btn-default">Button 1</button>
<button
class="sky-btn sky-btn-default"
>
Button 1
</button>
</sky-toolbar-item>
</sky-toolbar-section>
<sky-toolbar-section>
<sky-toolbar-item>
<button class="sky-btn sky-btn-default">Button 2</button>
<button
class="sky-btn sky-btn-default"
>
Button 2
</button>
</sky-toolbar-item>
</sky-toolbar-section>
</sky-toolbar>
Expand Down
4 changes: 3 additions & 1 deletion src/app/visual/toolbar/toolbar-visual.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Component } from '@angular/core';
import {
Component
} from '@angular/core';

@Component({
selector: 'toolbar-visual',
Expand Down