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

Vertical tabs #1004

Merged
merged 107 commits into from
Sep 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
10f04bd
Vertical tab demo stub.
Blackbaud-AdamHickey Jul 11, 2017
7beab00
Adding basic vertical tab component.
Blackbaud-AdamHickey Jul 11, 2017
8e11023
Add menu and item components.
Blackbaud-AdamHickey Jul 11, 2017
76e2f9d
Update hover css.
Blackbaud-AdamHickey Jul 11, 2017
98c645b
Adding expand and collapse functionality.
Blackbaud-AdamHickey Jul 12, 2017
c0dc34b
Move vertical tabs under tabset.
Blackbaud-AdamHickey Jul 13, 2017
3ae9ce1
Add collapse animations.
Blackbaud-AdamHickey Jul 13, 2017
574316d
Merge branch 'master' of https://github.com/blackbaud/skyux2 into ver…
Blackbaud-AdamHickey Aug 1, 2017
f25ab14
Adding vertical height animation.
Blackbaud-AdamHickey Aug 1, 2017
73fc080
Change animation time.
Blackbaud-AdamHickey Aug 1, 2017
ef89910
Add constants for open and closed tab state.
Blackbaud-AdamHickey Aug 2, 2017
cf34ef6
Add highlighting to tab item. Fixing margins.
Blackbaud-AdamHickey Aug 2, 2017
507e742
Add outline on focus.
Blackbaud-AdamHickey Aug 2, 2017
89e5690
Show content when subgroup is selected.
Blackbaud-AdamHickey Aug 3, 2017
b7f30ac
Add left border on selected row.
Blackbaud-AdamHickey Aug 3, 2017
6cf4435
Don't inactivate tab if clicked twice.
Blackbaud-AdamHickey Aug 3, 2017
b096cdc
Open group if child item is active.
Blackbaud-AdamHickey Aug 3, 2017
627de29
Rename tab componenets. Update demo.
Blackbaud-AdamHickey Aug 3, 2017
16dd99a
Get tabs from tab service instead of dom query.
Blackbaud-AdamHickey Aug 3, 2017
b13d0d8
Add bolding to group header when sub item selected.
Blackbaud-AdamHickey Aug 7, 2017
b3af3aa
Add disabled and open inputs to group.
Blackbaud-AdamHickey Aug 7, 2017
6fb4cdf
Update documentation.
Blackbaud-AdamHickey Aug 7, 2017
a5182ef
Add media query for mobile.
Blackbaud-AdamHickey Aug 7, 2017
4be9bb9
Hide and show tabs on mobile.
Blackbaud-AdamHickey Aug 7, 2017
d0ca711
Show and hide tabs on mobile.
Blackbaud-AdamHickey Aug 7, 2017
a6d1114
Hide tabs when switching from wide to mobile.
Blackbaud-AdamHickey Aug 7, 2017
832b7aa
Tabs should take up full screen on mobile.
Blackbaud-AdamHickey Aug 7, 2017
8a66591
Remove fixed width.
Blackbaud-AdamHickey Aug 8, 2017
c660269
Add slide in animation.
Blackbaud-AdamHickey Aug 8, 2017
186a2cf
Fix lint errors.
Blackbaud-AdamHickey Aug 8, 2017
1949bb6
Use ngif to show and hide tab group.
Blackbaud-AdamHickey Aug 8, 2017
881d319
Fix lint error.
Blackbaud-AdamHickey Aug 8, 2017
f98660f
Fix switching from mobile to widescreen.
Blackbaud-AdamHickey Aug 8, 2017
1f2afba
Add test for loading vertical tab.
Blackbaud-AdamHickey Aug 9, 2017
fcf3837
Adding test for clicking tab.
Blackbaud-AdamHickey Aug 10, 2017
0d72198
Add test for closing group.
Blackbaud-AdamHickey Aug 10, 2017
9da6441
Add test for mobile.
Blackbaud-AdamHickey Aug 10, 2017
17704f3
Test for mobile.
Blackbaud-AdamHickey Aug 10, 2017
972a83f
Add test for mobile to widescreen switch.
Blackbaud-AdamHickey Aug 10, 2017
5a19a78
Add test for empty group.
Blackbaud-AdamHickey Aug 11, 2017
40a84f9
Fixing test.
Blackbaud-AdamHickey Aug 11, 2017
491a97b
Add visual tab tests.
Blackbaud-AdamHickey Aug 11, 2017
8b7596d
Fix lint warnings.
Blackbaud-AdamHickey Aug 14, 2017
d6905eb
Merge branch 'master' of https://github.com/blackbaud/skyux2 into ver…
Blackbaud-AdamHickey Aug 14, 2017
7bbb099
Changing name of test file.
Blackbaud-AdamHickey Aug 14, 2017
7cc2f88
Adding visual test.
Blackbaud-AdamHickey Aug 14, 2017
08bc38f
Update visual test.
Blackbaud-AdamHickey Aug 14, 2017
06dcd21
Add tab test.
Blackbaud-AdamHickey Aug 14, 2017
9bca2e1
Update test.
Blackbaud-AdamHickey Aug 14, 2017
82da583
Update test.
Blackbaud-AdamHickey Aug 14, 2017
7d2425c
Add browser sleep
Blackbaud-AdamHickey Aug 14, 2017
7a7d127
Add mobile tests.
Blackbaud-AdamHickey Aug 14, 2017
760de61
Remove browser sleep calls.
Blackbaud-AdamHickey Aug 14, 2017
a1c1eba
Adding window resize.
Blackbaud-AdamHickey Aug 14, 2017
2ad58d6
Subscribe to window size changes.
Blackbaud-AdamHickey Aug 15, 2017
9bcb3f8
Adding visual tests.
Blackbaud-AdamHickey Aug 15, 2017
d4610cb
Update tab styles.
Blackbaud-AdamHickey Aug 15, 2017
a8c8b1c
Use chevron component.
Blackbaud-AdamHickey Aug 15, 2017
2edf339
Add independent scrolling.
Blackbaud-AdamHickey Aug 15, 2017
4fb58bc
Use onpush changedetection.
Blackbaud-AdamHickey Aug 15, 2017
ec603a2
Fix tests.
Blackbaud-AdamHickey Aug 15, 2017
8e526ea
Fix animation bug when showing tabs.
Blackbaud-AdamHickey Aug 16, 2017
20b097f
Update padding on group so border shows evenly.
Blackbaud-AdamHickey Aug 16, 2017
2a35202
Add test for disabled group.
Blackbaud-AdamHickey Aug 16, 2017
726a523
Add test for clicking two tabs.
Blackbaud-AdamHickey Aug 16, 2017
89b59fa
Fixing animation in IE.
Blackbaud-AdamHickey Aug 16, 2017
05f85f7
style cleanup
Blackbaud-ToddRoberts Aug 18, 2017
e0ecb0a
update with new mixin
Blackbaud-ToddRoberts Aug 18, 2017
8326139
Merge branch 'master' of https://github.com/blackbaud/skyux2 into ver…
Blackbaud-AdamHickey Aug 18, 2017
5191b6c
Add extra padding for blue outline.
Blackbaud-AdamHickey Aug 18, 2017
6b94ca6
Merge
Blackbaud-AdamHickey Aug 23, 2017
403b209
Use existing slide animation.
Blackbaud-AdamHickey Aug 24, 2017
eca97f3
Merge branch 'master' of https://github.com/blackbaud/skyux2 into ver…
Blackbaud-AdamHickey Aug 28, 2017
d390a35
Rename sky-tab-group
Blackbaud-AdamHickey Aug 28, 2017
128749b
Add enter and leave transitions for animating component hidden by ngif.
Blackbaud-AdamHickey Aug 28, 2017
cce1941
Remove unnecessary div.
Blackbaud-AdamHickey Aug 28, 2017
147950b
Remove unnecessary div
Blackbaud-AdamHickey Aug 28, 2017
ff0881b
unsubscribe from observables.
Blackbaud-AdamHickey Aug 28, 2017
282a7f9
Rename click method.
Blackbaud-AdamHickey Aug 28, 2017
02175f2
Make groups and tabs tabbable.
Blackbaud-AdamHickey Aug 29, 2017
77bf128
Add outline on tab sub item when tabbing only.
Blackbaud-AdamHickey Aug 29, 2017
62903f3
Add test for tabbing.
Blackbaud-AdamHickey Aug 29, 2017
8d07612
Use display none instead of visibility.
Blackbaud-AdamHickey Aug 29, 2017
f3caf7b
Merge branch 'master' of https://github.com/blackbaud/skyux2 into ver…
Blackbaud-AdamHickey Aug 30, 2017
87651ab
Remove unused variable.
Blackbaud-AdamHickey Aug 30, 2017
d8731c5
Fix lint warnings.
Blackbaud-AdamHickey Aug 30, 2017
f5bf690
Merge branch 'master' into vertical-tabs
Blackbaud-SteveBrush Aug 30, 2017
0f6562d
Separate vertical tab documentation.
Blackbaud-AdamHickey Sep 6, 2017
e4dbe24
Merge branch 'vertical-tabs' of https://github.com/blackbaud/skyux2 i…
Blackbaud-AdamHickey Sep 6, 2017
c33acc2
Merge branch 'master' of https://github.com/blackbaud/skyux2 into ver…
Blackbaud-AdamHickey Sep 6, 2017
ff431dc
Add tab header count.
Blackbaud-AdamHickey Sep 6, 2017
4525f85
Set the animation state so the initial load is not animated.
Blackbaud-AdamHickey Sep 6, 2017
7a7d969
Add active changed event for new tab click.
Blackbaud-AdamHickey Sep 6, 2017
8b21d87
Add optional to tab properties.
Blackbaud-AdamHickey Sep 6, 2017
128a65e
Add aria-selected attribute.
Blackbaud-AdamHickey Sep 6, 2017
a0ec1bb
Add active and disabled inputs.
Blackbaud-AdamHickey Sep 7, 2017
d0e16e3
Fix expression changed error.
Blackbaud-AdamHickey Sep 7, 2017
02b9f3f
Remove tab index from chevron component. Disable tabbing on vertical …
Blackbaud-AdamHickey Sep 11, 2017
a4d5bcf
Use anchor instead of div for tab.
Blackbaud-AdamHickey Sep 11, 2017
f7c4b61
Merge branch 'master' of https://github.com/blackbaud/skyux2 into ver…
Blackbaud-AdamHickey Sep 11, 2017
c56049f
Remove unnecessary mark for changes.
Blackbaud-AdamHickey Sep 12, 2017
c02770f
Fix test.
Blackbaud-AdamHickey Sep 12, 2017
e7f9af3
Fix lint warning.
Blackbaud-AdamHickey Sep 12, 2017
8d92a5f
style tweaks + standardization
Blackbaud-ToddRoberts Sep 12, 2017
77aec8f
Update code review items.
Blackbaud-AdamHickey Sep 12, 2017
d667b19
Merge
Blackbaud-AdamHickey Sep 12, 2017
8600738
Merge branch 'master' into vertical-tabs
Blackbaud-SteveBrush Sep 13, 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
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 @@ -43,6 +43,7 @@ export class HomeComponent {
'text-highlight',
'tiles',
'toolbar',
'vertical-tabs',
'wait'
];
}
1 change: 1 addition & 0 deletions skyux-spa-visual-tests/src/app/vertical-tabs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<vertical-tabs-visual></vertical-tabs-visual>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<div id="screenshot-vertical-tabset">
<sky-vertical-tabset showTabsText='Tab list'>
<sky-vertical-tabset-group
groupHeading="Group 1"
[open]="group1Open"
[disabled]="group1Disabled"
>
<sky-vertical-tab tabHeading="Group 1 Tab 1" tabHeaderCount="5" [active]="active">
Group 1 Tab 1 content
</sky-vertical-tab>
<sky-vertical-tab tabHeading="Group 1 Tab 2">
Group 1 Tab 2 content
</sky-vertical-tab>
</sky-vertical-tabset-group>

<sky-vertical-tabset-group
class="group2"
groupHeading="Group 2"
[open]="group2Open"
[disabled]="group2Disabled"
>
<sky-vertical-tab tabHeading="Group 2 Tab 1" tabHeaderCount="6">
Group 2 Tab 1 content
</sky-vertical-tab>
<sky-vertical-tab id="group2Tab2" tabHeading="Group 2 Tab 2" tabHeaderCount="0">
Group 2 Tab 2 content
</sky-vertical-tab>
<sky-vertical-tab
tabHeading="Group 2 Tab 2 - disabled"
tabHeaderCount="0"
[disabled]="tabDisabled"
>
Group 2 Tab 3 content
</sky-vertical-tab>
</sky-vertical-tabset-group>

<sky-vertical-tabset-group
groupHeading="Group 3"
[open]="group3Open"
[disabled]="group3Disabled"
>
<sky-vertical-tab tabHeading="Group 3 Tab 1">
Group 3 Tab 1 content
</sky-vertical-tab>
<sky-vertical-tab tabHeading="Group 3 Tab 2">
Group 3 Tab 2 content
</sky-vertical-tab>
</sky-vertical-tabset-group>
</sky-vertical-tabset>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { ChangeDetectionStrategy, Component} from '@angular/core';

@Component({
selector: 'vertical-tabs-visual',
templateUrl: './vertical-tabs-visual.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class VerticalTabsVisualComponent {
public group1Open: boolean = true;
public group1Disabled: boolean = false;

public group2Open: boolean = false;
public group2Disabled: boolean = false;

public group3Open: boolean = false;
public group3Disabled: boolean = true;

public active: boolean = true;
public tabDisabled: boolean = true;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { SkyVisualTest } from '../../../config/utils/visual-test-commands';
import { element, by, browser } from 'protractor';

describe('Vertical tabSet', () => {

it('should match previous vertical tabset screenshot', () => {
return SkyVisualTest.setupTest('vertical-tabs')
.then(() => {
return SkyVisualTest.compareScreenshot({
screenshotName: 'vertical-tabset',
selector: '#screenshot-vertical-tabset'
});
});
});

it('should match previous vertical tabset screenshot after clicking tab', () => {
return SkyVisualTest.setupTest('vertical-tabs')
.then(() => {

const groupElement = element(by.css('.group2'));
browser.wait(function() { return browser.isElementPresent(groupElement); }, 8000);

// open group
groupElement.click();

browser.sleep(1000);

// click tab
element(by.id('group2Tab2')).click();

return SkyVisualTest.compareScreenshot({
screenshotName: 'vertical-tabset-clicked-tab',
selector: '#screenshot-vertical-tabset'
});
});
});

it('should match previous vertical tabset screenshot on mobile', () => {
return SkyVisualTest.setupTest('vertical-tabs', 480)
.then(() => {
return SkyVisualTest.compareScreenshot({
screenshotName: 'vertical-tabset-mobile',
selector: '#screenshot-vertical-tabset'
});
});
});

it('should match previous vertical tabset screenshot on mobile clicking show tabs', () => {
return SkyVisualTest.setupTest('vertical-tabs', 480)
.then(() => {

const showTabsButton = element(by.css('.sky-vertical-tabset-show-tabs-btn'));
browser.wait(function() { return browser.isElementPresent(showTabsButton); }, 8000);

// show tabs
showTabsButton.click();

return SkyVisualTest.compareScreenshot({
screenshotName: 'vertical-tabset-mobile-show-tabs',
selector: '#screenshot-vertical-tabset'
});
});
});

it('should match previous vertical tabset screenshot on mobile clicking tab', () => {
return SkyVisualTest.setupTest('vertical-tabs', 480)
.then(() => {

const showTabsButton = element(by.css('.sky-vertical-tabset-show-tabs-btn'));
browser.wait(function() { return browser.isElementPresent(showTabsButton); }, 8000);

// show tabs
showTabsButton.click();
browser.sleep(1000);

// open group
element(by.css('.group2')).click();
browser.sleep(1000);

// click tab
element(by.id('group2Tab2')).click();

return SkyVisualTest.compareScreenshot({
screenshotName: 'vertical-tabset-mobile-clicked-tab',
selector: '#screenshot-vertical-tabset'
});
});
});
});
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 @@ -973,6 +973,27 @@ export class SkyDemoComponentsService {
];
}
},
{
name: 'Vertical tabs',
icon: 'folder-open-o',
summary: `The vertical tabs module contains components to render a vertical tabset.`,
url: '/components/vertical-tabs',
getCodeFiles: function () {
return [
{
name: 'vertical-tabs-demo.component.html',
// tslint:disable-next-line:max-line-length
fileContents: require('!!raw-loader!./vertical-tabs/vertical-tabs-demo.component.html')
},
{
name: 'vertical-tabs-demo.component.ts',
fileContents: require('!!raw-loader!./vertical-tabs/vertical-tabs-demo.component.ts'),
componentName: 'SkyVerticalTabsDemoComponent',
bootstrapSelector: 'sky-vertical-tabs-demo'
}
];
}
},
{
name: 'Wait',
icon: 'spinner',
Expand Down
78 changes: 78 additions & 0 deletions src/app/components/vertical-tabs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<sky-demo-page title="Vertical tabs">
Copy link
Contributor

Choose a reason for hiding this comment

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

title should be pageTitle

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

<sky-demo-page-summary>
<p>
The vertical tabs module contains components to render a vertical tabset.
</p>
</sky-demo-page-summary>

<sky-demo-page-properties sectionHeading="Vertical tabset properties">
<sky-demo-page-property
propertyName="showTabsText"
isOptional="true"
>
Specifies the text to use for the show tabs button in mobile.
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 tweak the wording here to "Specifies the text to display on the show tabs button on mobile devices."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that is better.

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

<sky-demo-page-properties sectionHeading="Vertical tab properties">
<sky-demo-page-property
propertyName="active"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the property names from this point on start with "[" and end with "]"? The properties are in these brackets in the code sample, where as the showTabsText property is not. So should we include the brackets in the name? Or is there some other way that developers should know which properties need brackets and which don't?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In angular, removing the brackets indicates a string literal for the input value. If the brackets are added then it uses object binding and looks for a property on the component with that name.

[input]="propertyNameOnComponent"
input="stringLiteral"

That is angular behavior and I don't think we have to document that.

isOptional="true"
>
Indicates whether or not the tab is active on load
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete "or not" and end with a period. ... I'd also change "on load" to "when the tabset loads."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah agree.

</sky-demo-page-property>
<sky-demo-page-property
propertyName="tabHeading"
>
The text of the button that selects the tab.
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems weird to me. I see that the wording here is consistent with the wording for the corresponding property on the tabs module, but referring to this as "the button that selects the tab" seems weird. I mean, in help text, we usually refer to that as the tab. And in the next property, we refer to this as "the tab header." Similarly, in the groupHeading description, we refer to "the collapsible group of tabs," not "the collapsible group of buttons that select tabs." ... All of which is just a long way to ask, can we just say something like "The text to display on the tab." or "Specifies the tab header."? (I prefer the latter. ... Also, if we change this, I can go make the same edit to the corresponding property on the tabs module.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It definitely doesn't make sense on the vertical tabs to say button, but on the normal tab component, it actually creates buttons that are used to select the tab content.

I don't know how we feel about exposing implementation details like that in our docs. I would lean towards making your suggested change in both areas.

</sky-demo-page-property>
<sky-demo-page-property
propertyName="tabHeaderCount"
isOptional="true"
>
Displays a counter alongside the tab header.
</sky-demo-page-property>
<sky-demo-page-property
propertyName="disabled"
isOptional="true"
>
Determines whether the tab is disabled.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a Boolean? If so, "Determines" should be "Indicates" for consistency with wording elsewhere.

I'd also add "to disable" after "whether" and delete "is disabled" to use active voice.

Also, we label this property as optional, but the corresponding property on the tabs module is not labeled as optional. We need to update that property to label it as optional, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah the disabled boolean will default to false, so it should be optional.

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


<sky-demo-page-properties sectionHeading="Vertical tab group properties">
<sky-demo-page-property
propertyName="groupHeading"
>
Specifies the text to use in the heading of the collapsible group of tabs.
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 "text to use in the heading of" to "header for."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah.

</sky-demo-page-property>
<sky-demo-page-property
propertyName="disabled"
isOptional="true"
>
Boolean value that can be set to disabled expanding and collapsing a collapsible group.
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 "Boolean value that can be set" to "Indicates whether" and change "disabled" to "disable."

I'd also change "expanding and collapsing" to "the ability to open and collapse." (I assume "expand" should be "open" for consistency since the next property is open, not expand.)

Change "a" before "collapsible" to "the."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah.

</sky-demo-page-property>
<sky-demo-page-property
propertyName="open"
isOptional="true"
>
Boolean value indicating if the collapsible group is open.
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 "Boolean value indicating if" to "Indicates whether."

Also, should this have something like "when the tabset loads" at the end?

Copy link
Contributor Author

@Blackbaud-AdamHickey Blackbaud-AdamHickey Sep 13, 2017

Choose a reason for hiding this comment

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

Yeah. Although I'm not sure we need "when the tabset loads". The boolean value will update each time the group is expanded/collapsed.

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

<sky-demo-page-properties sectionHeading="Vertical tab events">
<sky-demo-page-property
propertyName="activeChange"
>
Fires when the active tab changes. Emits the index of the active tab.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the second sentence end with something like "that is based on its position when it loads"? If accurate, would that be useful? (Not really sure if that's accurate, but assuming so based on the tabIndex property in the tabs module and the fact that there isn't a way here to set the index.)

Copy link
Contributor Author

@Blackbaud-AdamHickey Blackbaud-AdamHickey Sep 13, 2017

Choose a reason for hiding this comment

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

Yeah, it is based on how it loads starting with 0.

<group>
  <tab1 index = 0>
  <tab2 index = 1>
</group>
<group>
   <tab3 index = 2>
</group>

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

<sky-demo-page-example>
<sky-vertical-tabs-demo></sky-vertical-tabs-demo>
<sky-demo-page-code demoName="Vertical tabs"></sky-demo-page-code>
</sky-demo-page-example>

</sky-demo-page>

21 changes: 21 additions & 0 deletions src/app/components/vertical-tabs/vertical-tabs-demo.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<sky-vertical-tabset
showTabsText="Tab list"
(activeChange)="tabChanged($event)"
>
<sky-vertical-tabset-group
*ngFor="let group of groups"
[groupHeading]="group.heading"
[open]="group.isOpen"
[disabled]="group.isDisabled"
>
<sky-vertical-tab
*ngFor="let tab of group.subTabs"
[active]="tab.active"
[tabHeading]="tab.tabHeading"
[tabHeaderCount]="tab.tabHeaderCount"
[disabled]="tab.disabled"
>
{{ tab.content }}
</sky-vertical-tab>
</sky-vertical-tabset-group>
</sky-vertical-tabset>
44 changes: 44 additions & 0 deletions src/app/components/vertical-tabs/vertical-tabs-demo.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Component } from '@angular/core';

@Component({
selector: 'sky-vertical-tabs-demo',
templateUrl: './vertical-tabs-demo.component.html'
})
export class SkyVerticalTabsDemoComponent {

public groups: any[];

constructor() {
this.groups = [
{
heading: 'Group 1',
isOpen: false,
isDisabled: false,
subTabs: [
{ tabHeading: 'Group 1 - Tab 1', content: 'Group 1 - Tab 1 Content'},
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor, but I'd recommend replacing the hyphens here with long dashes. So "—" instead of "-"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

{ tabHeading: 'Group 1 - Tab 2', content: 'Group 1 - Tab 2 Content', tabHeaderCount: 7}]
},
{
heading: 'Group 2',
isOpen: true,
isDisabled: false,
subTabs: [
{ tabHeading: 'Group 2 - Tab 1', content: 'Group 2 - Tab 1 Content', active: true},
{ tabHeading: 'Group 2 - Tab 2 - Disabled',
content: 'Group 2 - Tab 2 Content',
disabled: true
}]
},
{
heading: 'Disabled',
isOpen: false,
isDisabled: true,
subTabs: []
}
];
}

public tabChanged(newIndex: any) {
console.log(`new active ${newIndex}`);
}
}
7 changes: 7 additions & 0 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import { SkyTextHighlightModule } from './modules/text-highlight';
import { SkyToolbarModule } from './modules/toolbar';
import { SkyTilesModule } from './modules/tiles';
import { SkyTimepickerModule } from './modules/timepicker';
import { SkyVerticalTabsetModule } from './modules/vertical-tabset';
import { SkyWaitModule } from './modules/wait';

@NgModule({
Expand Down Expand Up @@ -95,6 +96,7 @@ import { SkyWaitModule } from './modules/wait';
SkyTilesModule,
SkyTimepickerModule,
SkyToolbarModule,
SkyVerticalTabsetModule,
SkyWaitModule,
SkyDatepickerModule
]
Expand Down Expand Up @@ -417,6 +419,11 @@ export {
SkyToolbarModule,
SkyToolbarSectionComponent
} from './modules/toolbar';
export {
SkyVerticalTabsetComponent,
SkyVerticalTabsetGroupComponent,
SkyVerticalTabComponent
} from './modules/vertical-tabset';
export {
SkyWaitComponent,
SkyWaitModule,
Expand Down
4 changes: 4 additions & 0 deletions src/locales/resources_en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,10 @@
"_description": "The close button for the timepicker modal",
"message": "Done"
},
"vertical_tabs_show_tabs_text": {
"_description": "The default text for the show tabs button in mobile",
"message": "Tab list"
},
"wizard_navigator_finish": {
"_description": "Text displayed on the next button when a wizard is ready for completion.",
"message": "Finish"
Expand Down
Loading