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

Ported fluid grid component from stache2 #957

Merged
merged 26 commits into from
Aug 16, 2017
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b876647
Initial commit
Blackbaud-JeffDye Jul 28, 2017
146e999
Undoing whitespace change
Blackbaud-JeffDye Jul 28, 2017
4c30f16
Updated visual test help text
Blackbaud-JeffDye Jul 28, 2017
f5c0b1d
last bit of text
Blackbaud-JeffDye Jul 28, 2017
5468021
Merge remote-tracking branch 'upstream/master' into fluid-grid
Blackbaud-JeffDye Jul 28, 2017
793ec43
Updated screenshot test selector
Blackbaud-JeffDye Jul 28, 2017
6dc0ad1
Updated docs, exports
Blackbaud-JeffDye Jul 28, 2017
498217c
Updating visual test screen widths
Blackbaud-JeffDye Jul 30, 2017
2525240
Newlines, accidental whitespace changes
Blackbaud-JeffDye Jul 30, 2017
3e56d6f
More whitespace...
Blackbaud-JeffDye Jul 30, 2017
9871d6d
Export component classes
Blackbaud-JeffDye Jul 31, 2017
e17253b
Caught issue with ReverseColumnOrder visual test
Blackbaud-JeffDye Jul 31, 2017
a8cd5f1
Merge remote-tracking branch 'upstream/master' into fluid-grid
Blackbaud-JeffDye Aug 1, 2017
fd9a31d
Updated docs
Blackbaud-JeffDye Aug 1, 2017
02729f1
Unused imports are unused
Blackbaud-JeffDye Aug 2, 2017
24bb453
Updating docs
Blackbaud-JeffDye Aug 2, 2017
5899762
Merge branch 'master' into fluid-grid
Blackbaud-SteveBrush Aug 2, 2017
c017df7
Merge remote-tracking branch 'upstream/master' into fluid-grid
Blackbaud-JeffDye Aug 3, 2017
84e5157
Fixed casing on the demo title, merge with master
Blackbaud-JeffDye Aug 3, 2017
268cd57
Merge branch 'fluid-grid' of https://github.com/Blackbaud-JeffDye/sky…
Blackbaud-JeffDye Aug 3, 2017
e509a85
Merge branch 'master' into fluid-grid
Blackbaud-JeffDye Aug 5, 2017
a15f5c2
Docs round 2
Blackbaud-JeffDye Aug 7, 2017
4465cc9
Merge branch 'fluid-grid' of https://github.com/Blackbaud-JeffDye/sky…
Blackbaud-JeffDye Aug 7, 2017
165459d
Missing '.'
Blackbaud-JeffDye Aug 7, 2017
5f96c39
Merge branch 'master' into fluid-grid
Blackbaud-JeffDye Aug 11, 2017
854e600
Merge branch 'master' into fluid-grid
Blackbaud-SteveBrush Aug 15, 2017
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div id="screenshot-fluid-grid">
<sky-row>
<sky-column screenSmall="4" screenMedium="3" screenLarge="2">
small 4 medium 3 large 2
</sky-column>
<sky-column screenSmall="4" screenMedium="9" screenLarge="8">
small 4 medium 9 large 8
</sky-column>
<sky-column screenSmall="4" screenMedium="12" screenLarge="2">
small 4 medium 12 large 2
</sky-column>
</sky-row>
</div>

<div id="screenshot-fluid-grid-reverse">
<sky-row [reverseColumnOrder]="true">
<sky-column screenSmall="6">
should be second/below
</sky-column>
<sky-column screenSmall="6">
should be first/on top
</sky-column>
</sky-row>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {
Component
} from '@angular/core';

@Component({
selector: 'fluid-grid-visual',
templateUrl: './fluid-grid-visual.component.html',
styles: [`
.sky-column {
background-color: #97eced;
border: 1px solid #56e0e1;
}`]
})
export class FluidGridVisualComponent { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { SkyVisualTest } from '../../../config/utils/visual-test-commands';

describe('Fluid grid', () => {

it('should display all columns on different rows when on a very small screen', () => {
return SkyVisualTest.setupTest('fluid-grid', 600)
.then(() => {
return SkyVisualTest.compareScreenshot({
screenshotName: 'fluid-grid-screensmallest-differentrows',
selector: '#screenshot-fluid-grid',
checkAccessibility: true
});
});
});

it('should display all columns evenly split on the same row when on a small screen', () => {
return SkyVisualTest.setupTest('fluid-grid', 800)
.then(() => {
return SkyVisualTest.compareScreenshot({
screenshotName: 'fluid-grid-screensmall-evenrow',
selector: '#screenshot-fluid-grid',
checkAccessibility: true
});
});
});

it('should display two on the top row and one on the bottom row when on a medium screen', () => {
return SkyVisualTest.setupTest('fluid-grid', 1100)
.then(() => {
return SkyVisualTest.compareScreenshot({
screenshotName: 'fluid-grid-screenmedium-tworows',
selector: '#screenshot-fluid-grid',
checkAccessibility: true
});
});
});

it('should display all columns distributed unevenly when on a large screen', () => {
return SkyVisualTest.setupTest('fluid-grid', 1400)
.then(() => {
return SkyVisualTest.compareScreenshot({
screenshotName: 'fluid-grid-screenlarge-unevenrow',
selector: '#screenshot-fluid-grid',
checkAccessibility: true
});
});
});

it('should reverse column order with reverseColumnOrder applied', () => {
return SkyVisualTest.setupTest('fluid-grid')
.then(() => {
return SkyVisualTest.compareScreenshot({
screenshotName: 'fluid-grid-reversecolumnorder',
selector: '#screenshot-fluid-grid-reverse',
checkAccessibility: true
});
});
});
});
1 change: 1 addition & 0 deletions skyux-spa-visual-tests/src/app/fluid-grid/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<fluid-grid-visual></fluid-grid-visual>
1 change: 1 addition & 0 deletions skyux-spa-visual-tests/src/app/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class HomeComponent {
'error',
'fileattachments',
'filter',
'fluid-grid',
'forms',
'grid',
'help-inline',
Expand Down
21 changes: 21 additions & 0 deletions src/app/components/demo-components.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,27 @@ export class SkyDemoComponentsService {
];
}
},
{
name: 'Fluid grid',
icon: 'table',
// tslint:disable-next-line
summary: `Provides a layout grid for displaying responsive content.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change this to "Provides a responsive 12-column layout to organize content for all device sizes."

url: '/components/fluid-grid',
getCodeFiles: function () {
return [
{
name: 'fluid-grid.component.html',
fileContents: require('!!raw-loader!./fluid-grid/fluid-grid-demo.component.html')
},
{
name: 'fluid-grid-demo.component.ts',
fileContents: require('!!raw-loader!./fluid-grid/fluid-grid-demo.component.ts'),
componentName: 'SkyFluidGridDemoComponent',
bootstrapSelector: 'sky-fluid-grid-demo'
}
];
}
},
{
name: 'Form',
icon: 'keyboard-o',
Expand Down
163 changes: 163 additions & 0 deletions src/app/components/fluid-grid/fluid-grid-demo.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<div class="highlight-columns">
<sky-row>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="2">
small="2"
</sky-column>
<sky-column screenSmall="2">
small="2"
</sky-column>
<sky-column screenSmall="2">
small="2"
</sky-column>
<sky-column screenSmall="2">
small="2"
</sky-column>
<sky-column screenSmall="2">
small="2"
</sky-column>
<sky-column screenSmall="2">
small="2"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="3">
small="3"
</sky-column>
<sky-column screenSmall="3">
small="3"
</sky-column>
<sky-column screenSmall="3">
small="3"
</sky-column>
<sky-column screenSmall="3">
small="3"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="4">
small="4"
</sky-column>
<sky-column screenSmall="4">
small="4"
</sky-column>
<sky-column screenSmall="4">
small="4"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="5">
small="5"
</sky-column>
<sky-column screenSmall="7">
small="7"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="6">
small="6"
</sky-column>
<sky-column screenSmall="6">
small="6"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="8">
small="8"
</sky-column>
<sky-column screenSmall="4">
small="4"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="9">
small="9"
</sky-column>
<sky-column screenSmall="3">
small="3"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="10">
small="10"
</sky-column>
<sky-column screenSmall="2">
small="2"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="11">
small="11"
</sky-column>
<sky-column screenSmall="1">
small="1"
</sky-column>
</sky-row>

<sky-row>
<sky-column screenSmall="8" screenMedium="9" screenLarge="10">
small="8" medium="9" large="10"
</sky-column>
<sky-column screenSmall="4" screenMedium="3" screenLarge="2">
small="4" medium="3" large="2"
</sky-column>
</sky-row>

<sky-row [reverseColumnOrder]="true">
<sky-column screenSmall="4">
First column
</sky-column>
<sky-column screenSmall="4">
Second column
</sky-column>
<sky-column screenSmall="4">
Third column
</sky-column>
</sky-row>
</div>
15 changes: 15 additions & 0 deletions src/app/components/fluid-grid/fluid-grid-demo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component } from '@angular/core';

@Component({
selector: 'sky-fluid-grid-demo',
templateUrl: './fluid-grid-demo.component.html',
styles: [`
.highlight-columns .sky-column {
background-color: #97eced;
border: 1px solid #56e0e1;
overflow-wrap: break-word;
}`]
})
export class SkyFluidGridDemoComponent {

}
29 changes: 29 additions & 0 deletions src/app/components/fluid-grid/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<sky-demo-page title="Fluid grid">
<sky-demo-page-summary>
The fluid grid component provides a 12-column layout to organize responsive content for all device sizes. The grid consists of <code>sky-row</code> and <code>sky-column</code> tags. Every column must be contained in a row. Each column can specify behavior for different screen sizes. On extra small screens (less than 768px) the grid displays all elements in a single column.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change this to "The fluid grid component provides a responsive 12-column layout to organize content for all device sizes. The fluid grid consists of sky-row and sky-column tags. You place column elements in row elements, and then you can specify how much of the layout to use for each column element on small, medium, and large screens. For extra small screens (less than 768px), the fluid grid automatically stacks columns vertically across the entire 12-column layout."

</sky-demo-page-summary>

<sky-demo-page-properties sectionHeading="Sky row properties">
<sky-demo-page-property propertyName="reverseColumnOrder" defaultValue="false" isOptional="true">
Indicates whether to reverse the display order for columns within this row.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change "within this" to "in the."

</sky-demo-page-property>

</sky-demo-page-properties>
<sky-demo-page-properties sectionHeading="Sky column properties">
<sky-demo-page-property propertyName="screenSmall" isOptional="true">
Specifies the number of columns (1-12) for the element to use on a small screen (768-991px).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change this to "Specifies the number of columns (1-12) to use for the element on small screens (768-991px). If you do not specify a value, the fluid grid displays the element vertically across the entire layout."

And if we need to call out the recommendation that we discussed about setting screenSmall only, we could add "To use the same value for small, medium and large screens, we recommend setting the screenSmall only." But I don't really think that's necessary.

</sky-demo-page-property>
<sky-demo-page-property propertyName="screenMedium" isOptional="true">
Specifies the number of columns (1-12) for the element to use on a medium screen (992-1199px).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change this to "Specifies the number of columns (1-12) to use for the element on medium screens (992-1199px). If you do not specify a value, the element inherits the screenSmall value."

</sky-demo-page-property>
<sky-demo-page-property propertyName="screenLarge" isOptional="true">
Specifies the number of columns (1-12) for the element to use on a large screen (greater than 1200px).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change this to "Specifies the number of columns (1-12) to use for the element on large screens (greater than 1200px). If you do not specify a value, the element inherits the screenMedium value."

</sky-demo-page-property>
</sky-demo-page-properties>

<sky-demo-page-example>
<sky-fluid-grid-demo></sky-fluid-grid-demo>
<sky-demo-page-code demoName="Fluid grid"></sky-demo-page-code>
</sky-demo-page-example>

</sky-demo-page>
7 changes: 7 additions & 0 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { SkyEmailValidationModule } from './modules/email-validation';
import { SkyErrorModule } from './modules/error';
import { SkyFileAttachmentsModule } from './modules/fileattachments';
import { SkyFilterModule } from './modules/filter';
import { SkyFluidGridModule } from './modules/fluid-grid/fluid-grid.module';
import { SkyGridModule } from './modules/grid';
import { SkyHelpInlineModule } from './modules/help-inline';
import { SkyKeyInfoModule } from './modules/key-info';
Expand Down Expand Up @@ -65,6 +66,7 @@ import { SkyWaitModule } from './modules/wait';
SkyErrorModule,
SkyFileAttachmentsModule,
SkyFilterModule,
SkyFluidGridModule,
SkyGridModule,
SkyHelpInlineModule,
SkyKeyInfoModule,
Expand Down Expand Up @@ -204,6 +206,11 @@ export {
SkyFilterSummaryComponent,
SkyFilterSummaryItemComponent
} from './modules/filter';
export {
SkyColumnComponent,
SkyFluidGridModule,
SkyRowComponent
} from './modules/fluid-grid';
export {
SkyFormat
} from './modules/format';
Expand Down
1 change: 1 addition & 0 deletions src/modules/fluid-grid/column.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<ng-content></ng-content>
21 changes: 21 additions & 0 deletions src/modules/fluid-grid/column.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@import '../../scss/_variables';
@import '../../scss/_mixins';

:host.sky-column {
padding-right: $sky-fluid-grid-gutter;
padding-left: $sky-fluid-grid-gutter;
width: 100%;
min-height: 1px;
}

@media (min-width: $sky-screen-sm-min) {
@include create_columns(sm);
}

@media (min-width: $sky-screen-md-min) {
@include create_columns(md);
}

@media (min-width: $sky-screen-lg-min) {
@include create_columns(lg);
}
Loading