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

View actions upgrade #41

Merged
merged 4 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@skyux/animations": "^3.0.0",
"@skyux/forms": "^3.0.0",
"@skyux/indicators": "^3.0.0",
"@skyux/layout": "^3.0.0",
"@skyux/layout": "^3.1.0",
"@skyux/list-builder-common": "^3.0.0",
"@skyux/lists": "^3.0.0",
"@skyux/lookup": "^3.0.0",
Expand All @@ -41,8 +41,8 @@
},
"dependencies": {},
"devDependencies": {
"@blackbaud/skyux": "2.43.0",
"@blackbaud/skyux-builder": "1.32.1",
"@skyux-sdk/builder-plugin-skyux": "1.0.0-rc.6"
"@blackbaud/skyux": "2.47.0",
"@blackbaud/skyux-builder": "1.33.1",
"@skyux-sdk/builder-plugin-skyux": "1.0.0"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@
>
</sky-list-toolbar-item-renderer>
</sky-toolbar-item>
<sky-list-toolbar-view-actions>
<sky-toolbar-item>
<sky-list-toolbar-item-renderer
[template]="showSelectedTemplate"
>
</sky-list-toolbar-item-renderer>
</sky-toolbar-item>
</sky-list-toolbar-view-actions>
<sky-toolbar-view-actions>
<ng-container *ngTemplateOutlet="showSelectedTemplate"></ng-container>
</sky-toolbar-view-actions>
</sky-toolbar-section>
</sky-toolbar>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<div class="sky-list-toolbar-view-actions">
<ng-content></ng-content>
</div>
<ng-content></ng-content>
Blackbaud-AlexKingman marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
@import "~@skyux/theme/scss/mixins";

:host {
margin-left: auto;
}
display: flex;
align-items: center;

.sky-list-toolbar-view-actions {
@media (max-width: $sky-screen-sm-max) {
margin-bottom: 5px;
&::ng-deep > :not(:last-child) {
margin-right: 5px;
}
}
15 changes: 13 additions & 2 deletions src/app/public/modules/list-toolbar/list-toolbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@

<ng-content></ng-content>

<ng-content select="sky-list-toolbar-view-actions">
</ng-content>
<sky-toolbar-view-actions *ngIf="hasViewActions">
<ng-content
select="sky-list-toolbar-view-actions"
>
</ng-content>
</sky-toolbar-view-actions>
Blackbaud-AlexKingman marked this conversation as resolved.
Show resolved Hide resolved
</sky-toolbar-section>

<sky-toolbar-section *ngIf="showFilterSummary && (hasAppliedFilters | async)">
Expand Down Expand Up @@ -76,6 +80,13 @@
</sky-list-toolbar-item-renderer>
</sky-toolbar-item>
<ng-content></ng-content>

<sky-toolbar-view-actions *ngIf="hasViewActions">
<ng-content
select="sky-list-toolbar-view-actions"
>
</ng-content>
</sky-toolbar-view-actions>
</sky-toolbar-section>
</sky-toolbar>
</div>
Expand Down
28 changes: 23 additions & 5 deletions src/app/public/modules/list-toolbar/list-toolbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ import {
import {
Observable
} from 'rxjs/Observable';

import {
Subject
} from 'rxjs/Subject';

import 'rxjs/add/operator/distinctUntilChanged';

import 'rxjs/add/operator/take';

import 'rxjs/add/operator/takeUntil';

import {
Expand All @@ -31,9 +35,9 @@ import {
} from '@skyux/list-builder-common';

import {
SkyListFilterSummaryComponent,
SkyListFilterInlineComponent
} from '../list-filters';
SkySearchComponent
} from '@skyux/lookup';

import {
ListToolbarModel,
ListToolbarItemModel,
Expand All @@ -44,16 +48,23 @@ import {
ListFilterModel,
ListPagingSetPageNumberAction
} from '../list/state';

import {
SkyListFilterSummaryComponent,
SkyListFilterInlineComponent
} from '../list-filters';

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

import {
SkyListToolbarSortComponent
} from './list-toolbar-sort.component';

import {
SkySearchComponent
} from '@skyux/lookup';
SkyListToolbarViewActionsComponent
} from './list-toolbar-view-actions.component';

import {
ListToolbarConfigSetSearchEnabledAction,
Expand Down Expand Up @@ -122,6 +133,7 @@ export class SkyListToolbarComponent implements OnInit, AfterContentInit, OnDest
public hasInlineFilters: boolean;
public inlineFilterBarExpanded: boolean = false;
public hasAdditionalToolbarSection = false;
public hasViewActions = false;

public filterButtonId: string = `sky-list-toolbar-filter-button-${++nextId}`;
public listFilterInlineId: string = `sky-list-toolbar-filter-inline-${++nextId}`;
Expand All @@ -138,6 +150,9 @@ export class SkyListToolbarComponent implements OnInit, AfterContentInit, OnDest
@ContentChildren(SkyListFilterInlineComponent)
private inlineFilter: QueryList<SkyListFilterInlineComponent>;

@ContentChildren(SkyListToolbarViewActionsComponent)
private viewActions: QueryList<SkyListToolbarViewActionsComponent>;

@ViewChild('search')
private searchTemplate: TemplateRef<any>;

Expand Down Expand Up @@ -332,6 +347,9 @@ export class SkyListToolbarComponent implements OnInit, AfterContentInit, OnDest
]
);
}

// Check for view actions
this.hasViewActions = (this.viewActions.length > 0);
}

public ngOnDestroy() {
Expand Down
16 changes: 16 additions & 0 deletions src/app/visual/list-toolbar/list-toolbar-visual.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ <h2>Basic toolbar</h2>
[descending]="false">
</sky-list-toolbar-sort>
<sky-list-toolbar-view-actions>
<button
class="sky-btn"
>
<sky-icon
icon="angle-up"
>
</sky-icon>
</button>
<button
class="sky-btn"
>
<sky-icon
icon="angle-down"
>
</sky-icon>
</button>
<div
class="sky-switch-icon-group"
>
Expand Down