+ This package contains all of the global styles for the Go Design. Items included
+ in this package are:
+
+
+
Color/Setting Variables
+
Various SCSS Mixins
+
Grid System
+
Form Styles
+
Type Styles
+
+
+
+
+
+
+
+
Step 1: Installation
+
+
+
+
+ Both goponents & gosheets are open source projects and can easily be installed through NPM.
+
+
+
+ Install goponents:
+
+
+
+ Install gosheets:
+
+
+
+
+
Hey, Listen!
+
+ The latest version of goponents may not always have a dependency of the
+ latest version of gosheets. To avoid problems, install goponents first and look
+ for the warning output from NPM about peer dependency requirements.
+
+
+ Alternatively, you can check for the version of @tangoe/gosheets
+ on the devDependencies object in
+ ./node_modules/@tangoe/goponents/package.json
+
+
+
+
+ After discovering the version requirements, install that version specifically:
+
+
+
+
+
+
+
+
+
Step 2: Setup
+
+
+
+
+
Goponents
+
+ For goponents, the setup will depend upon which component you need to implement.
+ To find that information, check each components' documenation for instructions.
+ Typically it involves importing the specific module for each component you use.
+
+
+ DO NOT import every component into every module. ONLY
+ import what is needed for each module.
+
+
+
+
Gosheets
+
+ To utlize all of the benefits gosheets has to offer, in the root styles.scss
+ of the project import:
+
+
+
+ Alternatively, partials can be imported individually. These can be found:
+
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/dashboard/components/getting-started/getting-started.component.spec.ts b/projects/go-style-guide/src/app/features/dashboard/components/getting-started/getting-started.component.spec.ts
new file mode 100644
index 000000000..19747738e
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/dashboard/components/getting-started/getting-started.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { GettingStartedComponent } from './getting-started.component';
+
+describe('GettingStartedComponent', () => {
+ let component: GettingStartedComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ GettingStartedComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(GettingStartedComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/projects/go-style-guide/src/app/features/dashboard/components/getting-started/getting-started.component.ts b/projects/go-style-guide/src/app/features/dashboard/components/getting-started/getting-started.component.ts
new file mode 100644
index 000000000..f809d02cb
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/dashboard/components/getting-started/getting-started.component.ts
@@ -0,0 +1,17 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'app-getting-started',
+ templateUrl: './getting-started.component.html'
+})
+export class GettingStartedComponent {
+
+ installGoponents: string = `npm install @tangoe/goponents`;
+ installGosheets: string = `npm install @tangoe/gosheets`;
+ installGosheetsVersion: string = `npm install @tangoe/gosheets@1.0.0`;
+ importGosheetsBase: string = `@import "~@tangoe/gosheets/gosheets"`;
+ importGosheetsPartials: string = `@import "~@tangoe/gosheets/base/*"`;
+
+ constructor() { }
+
+}
diff --git a/projects/go-style-guide/src/app/features/dashboard/dashboard.module.ts b/projects/go-style-guide/src/app/features/dashboard/dashboard.module.ts
new file mode 100644
index 000000000..a2c5b0c15
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/dashboard/dashboard.module.ts
@@ -0,0 +1,26 @@
+import { NgModule } from '@angular/core';
+import { HighlightModule } from 'ngx-highlightjs';
+
+// Module Imports
+import { GoCardModule } from '../../../../../go-lib/src/public_api';
+
+// Module Routes
+import { DashboardRoutesModule } from './routes/dashboard-routing.module';
+
+// Module Components
+import { DashboardComponent } from './components/dashboard/dashboard.component';
+import { GettingStartedComponent } from './components/getting-started/getting-started.component';
+
+@NgModule({
+ imports: [
+ DashboardRoutesModule,
+ GoCardModule,
+ HighlightModule
+ ],
+ declarations: [
+ DashboardComponent,
+ GettingStartedComponent
+ ]
+})
+
+export class DashboardModule { }
diff --git a/projects/go-style-guide/src/app/features/dashboard/routes/dashboard-routing.module.ts b/projects/go-style-guide/src/app/features/dashboard/routes/dashboard-routing.module.ts
new file mode 100644
index 000000000..9ed8467cb
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/dashboard/routes/dashboard-routing.module.ts
@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from '@angular/router';
+
+import { DashboardComponent } from '../components/dashboard/dashboard.component';
+import { GettingStartedComponent } from '../components/getting-started/getting-started.component';
+
+ const routes: Routes = [
+ { path: 'dashboard', component: DashboardComponent },
+ { path: 'getting-started', component: GettingStartedComponent }
+];
+
+ @NgModule({
+ imports: [
+ RouterModule.forChild(routes)
+ ],
+ exports: [
+ RouterModule
+ ]
+})
+export class DashboardRoutesModule { }
diff --git a/projects/go-style-guide/src/app/features/features.module.ts b/projects/go-style-guide/src/app/features/features.module.ts
new file mode 100644
index 000000000..533e5743f
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/features.module.ts
@@ -0,0 +1,23 @@
+import { NgModule } from '@angular/core';
+
+import { DashboardModule } from './dashboard/dashboard.module';
+import { StandardsModule } from './standards/standards.module';
+import { UiKitModule } from './ui-kit/ui-kit.module';
+
+// ====================================================================================
+// Features Module
+// ---------------------------------------------------------------------------------
+// The FeaturesModule is a location where we can include all of the feature modules
+// that our application has. A feature would be defined as a group of functionality.
+// For example, the Dashboard would be considered a feature. Activities would be
+// considered another feature.
+// ====================================================================================
+
+@NgModule({
+ imports: [
+ DashboardModule,
+ StandardsModule,
+ UiKitModule
+ ]
+})
+export class FeaturesModule { }
diff --git a/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.html b/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.html
new file mode 100644
index 000000000..f3e3d4940
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.html
@@ -0,0 +1,163 @@
+
+
{{ pageTitle }}
+
+
+
+
+
+
SASS Color Variables
+
+
+
+ All of the available sass variables for theming, branding, & other
+ UI states are available via the gosheets package.
+ If the gosheets package is installed, these can be imported in an
+ scss file with:
+ @import '~@tangoe/gosheets/base/variables';
+
+
+
+
+
+
+
+
+
Base Colors
+
+
+
+
+
+
+ #65B360
+
+
+ #FFFFFF
+
+
+ #B1B1B1
+
+
+ #313536
+
+
+ #202626
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Galaxy Blue
+
+
+
+
+
+ Galaxy Blue should be used when an action will result in a completion (ex: form submission), to indicate a positive event
+ (ex: form completion), a positive status (ex: indicator), or to show a numerical positive (ex: currency).
+
Base SASS variable: $ui-color-positive
+
+
+
+ #00838f
+
+
+ #00737D
+
+
+ #00626B
+
+
+ $ui-color-positive-gradient
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Horizon Red
+
+
+
+
+
+ Horizon Red should be used when an action will result in a negative result (ex: deletion), when
+ an event has resulted in an error (ex: failed form submission), a sense of urgency is needed (ex: alerts or warnings), or
+ numerical negative (ex: currency).
+
Base SASS variable: $ui-color-negative
+
+
+
+ #DD4C4C
+
+
+ #BA3F3F
+
+
+ #A83939
+
+
+ $ui-color-negative-gradient
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Nebula Purple
+
+
+
+
+
+ Nebula Purple should be used to present additional information (ex: notice), or when taking a neutral action (ex: data refresh).
+
Base SASS variable: $ui-color-neutral
+
+
+
+ #8A4EDE
+
+
+ #7F47CC
+
+
+ #7441BA
+
+
+ $ui-color-neutral-gradient
+
+
+
+
+
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.scss b/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.scss
new file mode 100644
index 000000000..6c4ec5dca
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.scss
@@ -0,0 +1,64 @@
+@import '../../../../../../../go-lib/src/styles/variables';
+
+$colors: (
+ base: (
+ $base-primary,
+ $base-light,
+ $base-light-secondary,
+ $base-dark,
+ $base-dark-secondary
+ ),
+ positive: (
+ $ui-color-positive,
+ $ui-color-positive-active,
+ $ui-color-positive-hover,
+ $ui-color-positive-gradient
+ ),
+ negative: (
+ $ui-color-negative,
+ $ui-color-negative-active,
+ $ui-color-negative-hover,
+ $ui-color-negative-gradient
+ ),
+ neutral: (
+ $ui-color-neutral,
+ $ui-color-neutral-active,
+ $ui-color-neutral-hover,
+ $ui-color-neutral-gradient
+ )
+);
+
+@each $name, $palette in $colors {
+ $index: 1;
+
+ #go-color-#{$name} {
+ @each $color in $palette {
+ .go-color-items__item:nth-of-type(#{$index}) {
+ background: nth($palette, $index);
+ }
+
+ $index: $index + 1;
+ }
+ }
+}
+
+.go-color-items {
+ border-radius: $global-radius;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ overflow: hidden;
+}
+
+.go-color-items__item {
+ align-items: center;
+ color: $base-light;
+ display: flex;
+ flex-grow: 1;
+ height: 150px;
+ justify-content: center;
+}
+
+.go-color-items__item--dark {
+ color: $base-dark;
+}
diff --git a/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.spec.ts b/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.spec.ts
new file mode 100644
index 000000000..65dda2b7b
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ColorsComponent } from './colors.component';
+
+describe('ColorsComponent', () => {
+ let component: ColorsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ColorsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ColorsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.ts b/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.ts
new file mode 100644
index 000000000..8ebcea01d
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/standards/components/colors/colors.component.ts
@@ -0,0 +1,79 @@
+import { Component } from '@angular/core';
+
+@Component({
+ templateUrl: './colors.component.html',
+ styleUrls: ['./colors.component.scss']
+})
+export class ColorsComponent {
+ pageTitle: string = 'Colors';
+
+ baseColors: string = `
+ $base-primary: #65B360;
+ $base-light: #FFFFFF;
+ $base-light-secondary: #B1B1B1;
+ $base-dark: #313536;
+ $base-dark-secondary: #202626;
+ `;
+
+ lightTheme: string = `
+ // Use as the app background
+ $theme-light-app-bg: #F0F0F0;
+ // Used as the base background for all components
+ $theme-light-bg: $base-light;
+ // Used when the background needs an active state
+ $theme-light-bg-active: darken($base-light, 4);
+ // Used when the background needs a hover state
+ $theme-light-bg-hover: darken($base-light, 7);
+ // Used for the font color
+ $theme-light-color: $base-dark;
+ // Used when the font color needs a hover state
+ $theme-light-color-hover: lighten($base-dark, 20);
+ // Used to apply a border to an element
+ $theme-light-border: $base-light-secondary;
+ `;
+
+ galaxyBlue: string = `
+ // Use this to apply the positive (success) state color
+ $ui-color-positive: #4EDED2;
+
+ // Used when the ui color needs an active state
+ $ui-color-positive-active: #47CCC1;
+
+ // Used when the ui color needs a hover state
+ $ui-color-positive-hover: #41BAB0;
+
+ // Use this to apply the brand color as a gradient.
+ // Should only be used as a small accent
+ $ui-color-positive-gradient: linear-gradient(to bottom, $ui-color-positive, $ui-color-positive-hover);
+ `;
+
+ horizonRed: string = `
+ // Use this to apply the negative (error) state color
+ $ui-color-negative: #DD4C4C;
+
+ // Used when the ui color needs an active state
+ $ui-color-negative-active: #BA3F3F;
+
+ // Used when the ui color needs a hover state
+ $ui-color-negative-hover: #A83939;
+
+ // Use this to apply the brand color as a gradient.
+ // Should only be used as a small accent
+ $ui-color-negative-gradient: linear-gradient(to bottom, $ui-color-negative, $ui-color-negative-hover);
+ `;
+
+ nebulaPurple: string = `
+ // Use this to apply the neutral (info) state color
+ $ui-color-neutral: #8A4EDE;
+
+ // Used when the ui color needs an active state
+ $ui-color-neutral-active: #7F47CC;
+
+ // Used when the ui color needs a hover state
+ $ui-color-neutral-hover: #7441BA;
+
+ // Use this to apply the brand color as a gradient.
+ // Should only be used as a small accent
+ $ui-color-neutral-gradient: linear-gradient(to bottom, $ui-color-neutral, $ui-color-neutral-hover);
+ `;
+}
diff --git a/projects/go-style-guide/src/app/features/standards/components/forms/forms.component.html b/projects/go-style-guide/src/app/features/standards/components/forms/forms.component.html
new file mode 100644
index 000000000..3522d7fb4
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/standards/components/forms/forms.component.html
@@ -0,0 +1,678 @@
+
+
{{ pageTitle }}
+
+
+
+
+
Basic Forms
+
+
+
+
+
+ All forms follow several simple rules.
+
+
+
+ Be sure to use an appropriate type attribute on all inputs.
+
+
+ All inputs should also have a corresponding label.
+
+
+ Outlines on inputs should never be hidden as to have better
+ visibility and accessibility.
+
+
+ Outlines should also correspond consistently with error states.
+
+
+ Hints are to be used as help text and as a way to display more
+ robust validation errors.
+
+
+ UI controls should never apply brand colors.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Form Hints
+
+
+
+
+
+ Form hints exist to help give more information about the inputs they
+ are attached to. They should be directly preceded by the input in
+ which they describe.
+
+
+ Hints have two states. The default state is established by the
+ go-hint class.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Text Input Modifiers
+
+
+
+
+
All inputs have three basic states.
+
+ The default state is established by the go-form__input
+ class on text based inputs.
+
+
+ The disabled state can be achieved by the addition of the
+ disabled attribute,
+ while the error state can be applied by the addition of the
+ go-form__input--error
+ modifier class.
+
+
+ An input with an error modifier should be followed by an error hint describing
+ why it is in such a state.
+
+
+ If there is an instance where an individual label or input
+ needs to be displayed on top of a dark background the
+ --dark modifiers
+ can be added.
+
+
+
+ .go-form__label--dark
+ - To apply the dark theme styles to a label
+
+
+ .go-form__input--dark
+ - To apply the dark theme styles to an input
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Select Box Modifiers
+
+
+
+
+
+ Similar to the input element, the default state of select boxes are established
+ by the go-form__select class.
+
+
+ The disabled state can be achieved by the addition of the
+ disabled
+ attribute, while the error state can be applied by the addition of the
+ go-form__select--error
+ modifier class.
+
+
+ A select box with an error modifier should be followed by an error hint
+ describing why it is in such a state.
+
+
+ If there is an instance where an individual label or select
+ box needs to be displayed on top of a dark background the
+ --dark modifiers
+ can be added.
+
+
+
+ .go-form__label--dark
+ - To apply the dark theme styles to a label
+
+
+ .go-form__select--dark
+ - To apply the dark theme styles to the select box
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Check Box / Radio Button Modifiers
+
+
+
+
+
+ Similar to the input element, the default state of check boxes and radio buttons
+ are established by the go-form__checkbox
+ class.
+
+
+ These types of inputs often appear in groups and should always be wrapped in a
+ fieldset element with an additional
+ legend element describing the choice
+ that is being made.
+
+
+ The disabled state can be achieved by the addition of the
+ disabled
+ attribute to the parent
+ fieldset
+ , while the error state can be applied by the addition of the
+ go-form__select--error
+ modifier class to the same element.
+
+
+ A input with an error modifier should be followed by an error hint
+ describing why it is in such a state.
+
+
+ If there is an instance where an individual label or fieldset
+ needs to be displayed on top of a dark background the
+ --dark modifiers
+ can be added.
+
+
+
+ .go-form__label--dark
+ - To apply the dark theme styles to a label
+
+
+ .go-form__fieldset--dark
+ - To apply the dark theme styles to the fieldset
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Dark Forms
+
+
+
+ Dark forms are mostly like the default forms with a few
+ alterations based on the state of the input. Labels and
+ text show up as a light color so they are legible on a
+ dark background. When the input is in a disabled state,
+ the input will darken slightly to better portray itself
+ as such.
+
+
+
Implementation
+
+ The dark form effect can be achieved in one of two ways.
+ Generally speaking we will have a whole form that we need
+ to make dark. In this case, we can simply add the
+ .go-form--dark
+ modifier class to the surrounding form element.
+
+
+ There might be cases, however, where individual inputs are
+ not contained within a form element. The dark input styles
+ can be applied to individual elements by adding the
+ --dark
+ modifier to any individual element as well. See documentation
+ above for individual examples of how to implement dark forms.
+
+
+
Example
+
+ One of the most common use cases of a dark form is when forms
+ are being displayed in the off canvas.
+
+
+ Open Off Canvas
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Advanced Form Example
+
+
+
+
+
+
+ Below is an example of all of the pieces working together.
+ This includes a good example of how to use the grid system
+ in conjunction with the form inputs to create a more robust layout.
+
+ The Flexible Box Layout Module (flexbox), makes it easier to
+ design flexible responsive layout structure without using float or
+ positioning. Using flexbox we are able to build a lightweight, percentage
+ based, grid system that suits all of our needs.
+
+
+ By default the grid will add a 2rem (32px)
+ gutter around the grid items. This helps estabilsh a more consistent
+ vertial and horizontal rhythm. This can be overridden on the column
+ to help when nesting grids (see "Nested Grid Example").
+
+
+ The nature of flexbox is flexible. For that reason the proportion of
+ the columns might differ depending on the amount of columns in the
+ container and the size of the viewport.
+ Each .go-column--xx item will
+ attempt to constrain to the designated xx
+ percentage before filling the remaining space for that row.
+
+
+
+
+
+
+
+
Basic Examples
+
+
+
4 Column (~25%)
+
+ The .go-column--25 will create
+ a column that starts at 25% of the width of the container before filling
+ the remaining space. It can be used to create a basic 4 column grid.
+
+
+ On devices that are tablet sized and smaller the 4 columns created with
+ the .go-column--25 class will
+ stretch to being 2 columns per row. Giving it more space on smaller
+ devices.
+
+
+
1 of 4
+
2 of 4
+
3 of 4
+
4 of 4
+
+
+
+
3 Column (~33%)
+
+ The .go-column--33 will create
+ a column that starts at 33% of the width of the container before filling
+ the remaining space. It can be used to create a basic 3 column grid.
+
+
+ On devices that are tablet sized and smaller the 3 columns created with
+ the .go-column--33 class will
+ stretch to being 1 column per row. Giving it more space on smaller devices.
+
+
+
1 of 3
+
2 of 3
+
3 of 3
+
+
+
+
2 Column (~50%)
+
+ The .go-column--50 will create
+ a column that starts at 50% of the width of the container before filling
+ the remaining space. It can be used to create a basic 2 column grid.
+
+
+ On devices that are tablet sized and smaller the 2 columns created with
+ the .go-column--50 class will
+ stretch to being 1 column per row. Giving it more space on smaller devices.
+
+
+
1 of 2
+
2 of 2
+
+
+
+
+
+
+
+
+
+
Offset Examples
+
+
+
~66% Column
+
+ The .go-column--66 will create
+ a column that starts at 66% of the width of the container before filling
+ the remaining space. It can be used to create an offset 2 column grid.
+
+
+ On devices that are tablet sized and smaller the 66% column created with
+ the .go-column--66 class will
+ stretch to being 1 column per row. Giving it more space on smaller devices.
+
+
+
33.33333%
+
66.66667%
+
+
+
+
~75% Column
+
+ The .go-column--75 will create
+ a column that starts at 75% of the width of the container before filling
+ the remaining space. It can be used to create an offset 2 column grid.
+
+
+ On devices that are tablet sized and smaller the 2 columns created with
+ the .go-column--75 class will
+ stretch to being 1 column per row. Giving it more space on smaller devices.
+
+
+
75%
+
25%
+
+
+
+
+
+
+
+
+
+
Advanced Example
+
+
+
Mix Columns
+
+ Below is an example of a mixed column grid. All of the columns can be contained
+ within a single .go-container element.
+
+
+
25%
+
25%
+
50%
+
66%
+
33%
+
100%
+
+
+
+
+
+
+
+
+
+
Nested Grid Example
+
+
+
+ Below is an example of a grid nested inside of another grid. All of the columns
+ can be contained within a single .go-container
+ element. Note the use of the .go-column--no-padding
+ modifier class to remove the padding added by default. This ensures that the nested
+ grid is flush with the bottom of the parent grid.
+
+
+
25%
+
+
75%
+
+
50%
+
50%
+
+
+
+
+
+
+
+
+
+
+
+
Collapsable Column
+
+
+
+ In some cases, it may be necessary for columns in the grid to collapse to the size of its content.
+ A modifier class can be added to the column to acheive this:
+
+
+
Column 1
+
Column 2
+
+
+
+
+
+
+
+
+
+
Center Alignment
+
+
+
+ In some cases, it may be necessary to align items in a container vertically centered.
+ A modifier class can be added to acheive this:
+
+ The goDesign standards detail all that goes into creating and maintaining our design system.
+ This is the foundation we build all of our components on top of. Every component is designed
+ with these standards in mind and all elements, when implemented, are expected to comply with
+ these guidelines.
+
+
+ This methodology is heavily based on Atomic Design
+ which lends itself towards thinking of our UIs as thoughtful hierarchies, discusses the qualities of
+ effective pattern libraries, and showcases techniques to transform your team's design and development workflow.
+
+ By default we apply margin to the bottom of all of the basic typograhical elements.
+ This allows us to establish a more clear vertical rhythm to enhance readibility.
+
+
+ To learn how to remove this margin see below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Removing Margin
+
+
+
+
+ The default heading margin can be removed by adding the
+ go-heading--no-margin
+ modifier class to any heading.
+
+
+ The same styles can be applied on body copy by adding the
+ body-copy--no-margin
+ modifier class to any paragraph.
+
+
+
+
+
+
+
+
+ Heading with margin
+
+
+ Heading with margin
+
+
+ Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium
+ doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
+ veritatis et quasi architecto beatae vitae dicta sunt explicabo.
+
+
+ Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
+ sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
+
+
+
+ Heading without margin
+
+
+ Heading without margin
+
+
+ Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur,
+ adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et
+ dolore magnam aliquam quaerat voluptatem.
+
+
+ Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit
+ laboriosam, nisi ut aliquid ex ea commodi consequatur?
+
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit amet repudiandae deserunt voluptas reprehenderit tempora!
+ Eveniet sunt itaque molestias obcaecati, quasi sit quod deleniti iure incidunt repellat ipsam nam dolore!
+
The Go Accordion Component should be used when multiple sets of data need to be rendered, but vertical space is a concern.
+
+
+ The go-accordion element must be accompanied by
+ go-accordion-panel children.
+ See Accordion Panel for details.
+
+
+
+
Bindings
+
+
+
+
expandAll
+
+ expandAll
+ will ensure each panel in the accordion is expanded on first render.
+ expandAll will also override
+ multiExpand and set it to true.
+
+
+
+
multiExpand
+
+ multiExpand
+ will allow for multiple panels to be expanded at any given time.
+
+
+
+
showIcons
+
+ This will enable each panel to have an icon shown to the left of the heading.
+
+
+ Note: even if the icon binding is passed to an
+ accordion-panel, it will not be displayed unless
+ showIcons is set to true.
+ This is to encourage a consistent UI. If one accordion-panel
+ has an icon, they all should.
+
+
+
+
+
+
+
+
+
+
Default
+
+
+
+
+
Code
+
+
+
+
View
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+
+
+
+
+
+
+
+
Expand All
+
+
+
+
+
Code
+
+
+
+
View
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+
+
+
+
+
+
+
+
Multiple Expansion
+
+
+
+
+
Code
+
+
+
+
View
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+
+
+
+
+
+
+
+
With Icons
+
+
+
+
+
Code
+
+
+
+
View
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/accordion-docs/accordion-docs.component.ts b/projects/go-style-guide/src/app/features/ui-kit/components/accordion-docs/accordion-docs.component.ts
new file mode 100644
index 000000000..8a6b2c1b4
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/accordion-docs/accordion-docs.component.ts
@@ -0,0 +1,82 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ templateUrl: './accordion-docs.component.html'
+})
+export class AccordionDocsComponent implements OnInit {
+
+ pageTitle: String;
+
+ defaultExample: string = `
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+ `;
+
+ expandAllExample: string = `
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+ `;
+
+ multiExpandExample: string = `
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+ `;
+
+ showIconsExample: string = `
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+ `;
+
+ componentBindings: string = `
+ @Input() expandAll: boolean = false;
+ @Input() multiExpand: boolean = false;
+ @Input() showIcons: boolean = false;
+ @Input() theme: string = 'light';
+ `;
+
+ themeOptions: string = `
+ // valid options
+ - 'light'
+ - 'dark'
+ `;
+
+ ngOnInit(): void {
+ this.pageTitle = 'Accordion';
+ }
+}
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/accordion-panel-docs/accordion-panel-docs.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/accordion-panel-docs/accordion-panel-docs.component.html
new file mode 100644
index 000000000..0116c9d9c
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/accordion-panel-docs/accordion-panel-docs.component.html
@@ -0,0 +1,99 @@
+
+
{{ pageTitle }}
+
+
+
+
+
+
+
Usage
+
+ The Go Accordion Panel should be used inside of a <go-accordion>
+ component. See Accordion for details.
+
+
+
+
Bindings
+
+
+
expanded
+
+ This will expand then panel. This is only true at at first render, depending on the Behavior
+ of the parent go-accordion it will override this.
+ Typically, you can set This binding to true
+ for the first go-accordion-panel in the accordion.
+
+
+
icon
+
+ This will set an icon for the panel, shown to the left of the heading.
+
+
+ Note: the icon will only appear if the parent go-accordion
+ has [showIcons]="true" set.
+
+
+
heading - (required)
+
+ The heading for the panel accepted as a string.
+
+
+
+
+
+
+
+
Default
+
+
+
+
+
Code
+
+
+
+
View
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+
+
+
+
+
+
+
+
With Icons
+
+
+
+
+
Code
+
+
+
+
View
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/accordion-panel-docs/accordion-panel-docs.component.spec.ts b/projects/go-style-guide/src/app/features/ui-kit/components/accordion-panel-docs/accordion-panel-docs.component.spec.ts
new file mode 100644
index 000000000..16a672fe7
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/accordion-panel-docs/accordion-panel-docs.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AccordionPanelDocsComponent } from './accordion-panel-docs.component';
+
+describe('AccordionPanelDocsComponent', () => {
+ let component: AccordionPanelDocsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ AccordionPanelDocsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AccordionPanelDocsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/accordion-panel-docs/accordion-panel-docs.component.ts b/projects/go-style-guide/src/app/features/ui-kit/components/accordion-panel-docs/accordion-panel-docs.component.ts
new file mode 100644
index 000000000..0a4c69609
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/accordion-panel-docs/accordion-panel-docs.component.ts
@@ -0,0 +1,51 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-accordion-panel-docs',
+ templateUrl: './accordion-panel-docs.component.html'
+})
+export class AccordionPanelDocsComponent implements OnInit {
+
+ pageTitle: string;
+
+ defaultExample: string = `
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+ `;
+
+ showIconsExample: string = `
+
+
+ This is some content for Test 1.
+
+
+ This is a second thing.
+
+
+ This is a third thing.
+
+
+ `;
+
+ componentBindings: string = `
+ @Input() expanded: boolean = false;
+ @Input() icon: string = null;
+ @Input() heading: string;
+ `;
+
+ constructor() { }
+
+ ngOnInit(): void {
+ this.pageTitle = 'Accordion Panel';
+ }
+
+}
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/badge-docs/badge-docs.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/badge-docs/badge-docs.component.html
new file mode 100644
index 000000000..47115c64f
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/badge-docs/badge-docs.component.html
@@ -0,0 +1,120 @@
+
+
{{ pageTitle }}
+
+
+
+
+
+
+
+
+
Usage
+
+ The <go-badge>
+ component should be used for times when we want to show a short notification
+ to a user over an icon for more information. A good example of this would be
+ the number of notifications a user has over an icon that goes to their
+ notifications.
+
+
+
+
Bindings
+
+
+
+
badgeData
+
+ This is the text or data that we want to show up inside of the badge
+
+
badgeColor
+
+ The color can be one of three things neutral,
+ positive or negative.
+ These will denote what type of badge it is whether it's a good thing, bad thing or just information. The badgeColor
+ defaults to `neutral`
+
+
+
displayData
+
+ This can be used to override whether the information inside of the badge shows up or not.
+ Setting this to false will cause the badge to just be an empty circle without displaying
+ the `badgeData`.
+
+
+
+
+
+
+
+
+
+
Basic Example
+
+ The badge uses content projection to apply itself to an inline element inside of it. You
+ can apply it to any element by wrapping the element in the go-badge
+
+ The <go-button>
+ component should be used for any instance of a button throughout
+ the app.
+
+
+
+
Bindings
+
+
+
+
buttonDisabled
+
+ Disables the button. This should be handled by the parent
+ component.
+
+
+
buttonIcon
+
+ Add an icon to the left of the text in the button. See the
+ Material Design System Icons
+ page for available icons.
+
+
+
buttonType
+
+ Changes the type attribute of the button. This attribute
+ defaults to "button" but other options are necessary when
+ doing things like submitting or resetting forms.
+
+
+
handleClick
+
+ This event fires when the button is clicked. Use this event
+ to handle the click event.
+
+
+
+
buttonVariant
+
+ The buttonVariant
+ binding controls the style of the button. This includes
+ options that allow us to implement the following
+ modifications:
+
+
+
Default: .go-button
+
Negative: .go-button--negative
+
Neutral: .go-button--neutral
+
Positive: .go-button--positive
+
+
+
isProcessing
+
+ Turns the loading state on/off. It is recommended to use this when
+ processing data that will take longer than 250ms. Examples:
+ submitting a form, sorting data, refreshing data from the
+ server, etc.
+
+
useDarkTheme
+
+ Applies a dark theme to the button component.
+ The dark button styles can be applied by setting the
+ useDarkTheme
+ binding to true.
+
+
+
+
+
+
+
+
+
+
Default Button
+
+
+
+ The default button is preferred when the action being performed
+ is of little importance. Ideally, the button itself describes
+ what it does. For example, a button to close a modal would be
+ a good use case for the default button. It isn't important or
+ informational, it is just a simple action.
+
+
+
+
+ Default
+
+
+ Disabled
+
+
+ With Icon
+
+
+
+
+
+
+
+
Negative Buttons
+
+
+
+ Negative buttons are displayed in red. Use negative buttons to designate
+ an action as being dangerous or negative. Deleting a resource
+ is a good example of when to use this button. It could also be
+ used to guide a user away from an action we don't want them to
+ take.
+
+
+
+
+ Negative
+
+
+ Disabled
+
+
+ With Icon
+
+
+
+
+
+
+
+
Neutral Buttons
+
+
+
+ Neutral buttons are displayed in purple. Use neutral buttons to designate
+ an action as being informational. Opening up a chat modal or
+ sending a user to an external resource might be a good example
+ of when to use this button. It could also be used to guide a
+ user towards an action that isn't necessarily positive, but still
+ important.
+
+
+
+
+ Neutral
+
+
+ Disabled
+
+
+ With Icon
+
+
+
+
+
+
+
+
Positive Buttons
+
+
+
+ Positive buttons are displayed in blue. Use positive buttons to
+ designate an action as being positive. Creating a resource or
+ submitting a form might be a good example of when to use this
+ button variant. It could also be used to guide a user towards
+ an action we want them to make, such as signing up for something
+
+
+
+
+ Positive
+
+
+ Disabled
+
+
+ With Icon
+
+
+
+
+
+
+
+
Button with loader
+
+
+
+ Loading buttons display the loading animation inside the
+ button. By default this is false. It is recommended to use
+ this when processing data that will take longer than 250ms.
+ Examples might include submitting a form, sorting data,
+ refreshing data from the server, etc. While in this state,
+ a button will additionally be disabled to prevent the action
+ from being taken more than once.
+
+
example.ts
+
+
example.html
+
+
View
+
+
+
+ Default Loading
+
+
+
+
+ Negative Loading
+
+
+
+
+ Neutral Loading
+
+
+
+
+ Positive Loading
+
+
+
+
+
+
+
+
+
Dark buttons
+
+
+
+
+
+ Dark buttons work all the same as the rest of the buttons,
+ the difference being that some of the colors have been tweaked
+ to allow this button to maintain an appropriate amount of
+ contrast when displayed on a dark background.
+
+
+ The dark button styles can be applied by setting the
+ useDarkTheme
+ binding to true.
+
+
+
+
+
+
+
+
+
+ Default
+
+
+
+
+ With Icon
+
+
+
+
+ Negative Loading
+
+
+
+
+ Positive Disabled
+
+
+
+
+
+
+
+
+
+
+
+
Button Groups
+
+
+
+
+
+ Sometimes it will be necessary to group buttons together. There are a set of helper
+ classes available to accomplish this.
+
+ The <go-copy>
+ component should be used for any instance where we want to provide a user
+ a way to copy information from the page by using a button.
+
+
+
+
Bindings
+
+
+
+
text
+
+ This is the text that will be copied to a users clipboard when they click the button.
+
+ As with most of the form components, the only @Input
+ required of the datepicker component is a FormControl.
+ The FormControl can be passed in via the [control]
+ attribute on the <go-datepicker> component.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
Component Label
+
+
+
+ All form components include an @Input() label: string;
+ that can be used to add a label to the input components.
+ In addition to displaying an HTML label, the text passed
+ in via the [label]
+ attribute is used to generate a unique ID to associate the
+ label with the datepicker. If no label is passed in, a generic,
+ but still unique ID will be generated.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
Component Key
+
+
+
+ As stated above the label attribute is used to generate a
+ unique ID to associate the label with the datepicker. As this might
+ not be desired, the @Input() key: string;
+ can be used to configure the ID attribute of the datepicker directly.
+ Anything passed into the component via the [key]
+ attribute will be used to both assign the ID to the datepicker and
+ associate the label with the datepicker.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
Example Output
+
+ Notice in the below example output that the key has been assigned
+ to both the id attribute on
+ the input and the for attribute
+ on the label.
+
+
+
+
+
+
+
+
+
Component Hints
+
+
+
+ Form hints exist to help give more information about the
+ inputs they are attached to. The @Input() key: Array<string>
+ can be used to pass in an array of hints to the datepicker component.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Component Errors
+
+
+
+ FormControls all have a consistent way of setting errors
+ via the setErrors() function.
+ All goponents use this API to display errors on our components, but the
+ data needs to be displayed in a specific structure.
+
+
+ By default the input type is set to "Error", however this can be
+ overrides as shown below.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Disable Component
+
+
+
+ FormControls can be either created as disable or later disabled
+ and re-enabled directly after they are created.
+
+
+
+
View
+
+
+
+
+
+
+
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
+
Component Placeholder
+
+
+
+ The datepicker components placeholder attribute can be set via
+ @Input() placeholder: string;
+ and the [placeholder] attribute.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Component Locale
+
+
+
+ The locale can be set via the
+ @Input() locale: string;
+ and the [locale] attribute.
+ By default this is set to 'en-US', but it should be used to reflect the locale
+ of the user logged in. This is important because the locale is how we decide what format
+ a date gets shown in and how we parse a date that the user types in. For example the
+ format for 'en-US' is mm/dd/yyyy while the format
+ for 'de' is dd.mm.yyyy. Regardless of locale a user
+ can always type in the date yyyy/mm/dd which is the
+ international date standard
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Component Max Date
+
+
+
+ A max date can be set via the @Input() maxDate: Date | string;
+ and the [maxDate] attribute. The max date attribute can be
+ used to restrict the date that a user can pick to a date before the max date. The date
+ can be passed in as a Date object or in the 'en-US' format which is
+ mm/dd/yyyy
+
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Component Min Date
+
+
+
+ A min date can be set via the @Input() minDate: Date | string;
+ and the [minDate] attribute. The min date attribute can be
+ used to restrict the date that a user can pick to a date after the min date. The date
+ can be passed in as a Date object or in the 'en-US' format which is
+ mm/dd/yyyy
+
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/datepicker-docs/datepicker-docs.component.ts b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/datepicker-docs/datepicker-docs.component.ts
new file mode 100644
index 000000000..6cf185c37
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/datepicker-docs/datepicker-docs.component.ts
@@ -0,0 +1,153 @@
+import { Component, OnInit } from '@angular/core';
+import { FormControl } from '@angular/forms';
+
+@Component({
+ templateUrl: './datepicker-docs.component.html'
+})
+export class DatepickerDocsComponent implements OnInit {
+ dob: FormControl = new FormControl('');
+ dob2: FormControl = new FormControl('');
+ dob3: FormControl = new FormControl('');
+ dob4: FormControl = new FormControl('');
+ dob5: FormControl = new FormControl('');
+ dob6: FormControl = new FormControl({ value: '', disabled: true });
+ dob7: FormControl = new FormControl('');
+ dob8: FormControl = new FormControl('');
+ locale: FormControl = new FormControl('');
+ max: FormControl = new FormControl('');
+ min: FormControl = new FormControl('');
+
+ hints: Array = [
+ 'Please enter your date of birth',
+ 'This is a second hint for no reason'
+ ];
+
+ basicFormControl: string = `
+ import { Component } from '@angular/core';
+ import { FormControl } from '@angular/forms';
+
+ @Component({
+ selector: 'app-name-editor',
+ templateUrl: './name-editor.component.html',
+ styleUrls: ['./name-editor.component.css']
+ })
+ export class NameEditorComponent {
+ name = new FormControl('');
+ }
+ `;
+
+ basicInputExample: string = `
+
+ `;
+
+ basicInputLabelExample: string = `
+
+ `;
+
+ basicInputKeyExample: string = `
+
+ `;
+
+ basicInputKeyExampleOutput: string = `
+
+
+ `;
+
+ basicHintsTemplate: string = `
+ hints: Array = [
+ 'Please enter your date of birth',
+ 'This is a second hint for no reason'
+ ];
+ `;
+
+ basicInputHintsExample: string = `
+
+ `;
+
+ basicErrorsTemplate: string = `
+ this.dob.setErrors([
+ {
+ message: 'This date is invalid'
+ },
+ {
+ type: 'Required',
+ message: 'This is a required input.'
+ }
+ ]);
+ `;
+
+ basicDisabledExample: string = `
+ firstDate: new FormControl({
+ value: '',
+ disabled: true
+ });
+ `;
+
+ basicDisabledExample2: string = `
+ lastDate: new FormControl('');
+
+ ngOnInit(): void {
+ this.lastDate.disable();
+ // Use this.lastDate.enable(); to re-enable the input.
+ }
+ `;
+
+ basicPlaceholderExample: string = `
+
+ `;
+
+ basicLocaleExample: string = `
+
+ `;
+
+ maxDateExample: string = `
+
+ `;
+
+ minDateExample: string = `
+
+ `;
+
+ ngOnInit(): void {
+ setTimeout((): void => {
+ this.dob5.setErrors([
+ {
+ message: 'This date is invalid'
+ },
+ {
+ type: 'Required',
+ message: 'This is a required input.'
+ }
+ ]);
+
+ this.dob7.disable();
+ }, 500);
+ }
+}
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/form-control-docs/form-control-docs.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/form-control-docs/form-control-docs.component.html
new file mode 100644
index 000000000..fec580dc1
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/form-control-docs/form-control-docs.component.html
@@ -0,0 +1,25 @@
+
+
+
Form Controls
+
+
+
+ All of the form components in goponents are built on the
+ concept of Angular's reactive forms
+ and require a FormControl.
+
+ The FormControl class is the basic building block when
+ using reactive forms. To register a single form control,
+ import the FormControl
+ class into your component and create a new instance of
+ the form control to save as a class property.
+
+ Reactive forms use an explicit and immutable approach to
+ managing the state of a form at a given point in time.
+ Each change to the form state returns a new state, which
+ maintains the integrity of the model between changes.
+ Reactive forms are built around observable streams, where
+ form inputs and values are provided as streams of input
+ values, which can be accessed synchronously.
+
+
+ Reactive forms differ from template-driven forms in distinct
+ ways. Reactive forms provide more predictability with
+ synchronous access to the data model, immutability with
+ observable operators, and change tracking through observable
+ streams. If you prefer direct access to modify data in your
+ template, template-driven forms are less explicit because they
+ rely on directives embedded in the template, along with mutable
+ data to track changes asynchronously.
+
+ As with most of the form components, the only @Input
+ required of the input component is a FormControl.
+ The FormControl can be passed in via the [control]
+ attribute on the <go-input> component.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
Component Label
+
+
+
+ All form components include an @Input() label: string;
+ that can be used to add a label to the input components.
+ In addition to displaying an HTML label, the text passed
+ in via the [label]
+ attribute is used to generate a unique ID to associate the
+ label with the input. If no label is passed in, a generic,
+ but still unique ID will be generated.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
Component Key
+
+
+
+ As stated above the label attribute is used to generate a
+ unique ID to associate the label with the input. As this might
+ not be desired, the @Input() key: string;
+ can be used to configure the ID attribute of the input directly.
+ Anything passed into the component via the [key]
+ attribute will be used to both assign the ID to the input and
+ associate the label with the input.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
Example Output
+
+ Notice in the below example output that the key has been assigned
+ to both the id attribute on
+ the input and the for attribute
+ on the label.
+
+
+
+
+
+
+
+
+
Component Hints
+
+
+
+ Form hints exist to help give more information about the
+ inputs they are attached to. The @Input() key: Array<string>
+ can be used to pass in an array of hints to the input component.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Component Errors
+
+
+
+ FormControls all have a consistent way of setting errors
+ via the setErrors() function.
+ All goponents use this API to display errors on our components, but the
+ data needs to be displayed in a specific structure.
+
+
+ By default the input type is set to "Error", however this can be
+ overridden as shown below.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Disable Component
+
+
+
+ FormControls can be either created as disable or later disabled
+ and re-enabled directly after they are created.
+
+
+
+
View
+
+
+
+
+
+
+
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
+
Component Placeholder
+
+
+
+ The input component's placeholder attribute can be set via
+ @Input() placeholder: string;
+ and the [placeholder] attribute.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Component Type
+
+
+
+ The input type can be set via the
+ @Input() inputType: string;
+ and the [inputType] attribute.
+ By default this is set to text, but it should be changed to implement
+ other basic text based input types.
+
+
+ In the example below we show how to use [inputType]
+ to build a password input.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/input-docs/input-docs.component.ts b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/input-docs/input-docs.component.ts
new file mode 100644
index 000000000..ddc1f0633
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/input-docs/input-docs.component.ts
@@ -0,0 +1,111 @@
+import { Component, OnInit } from '@angular/core';
+import { FormControl } from '@angular/forms';
+
+@Component({
+ templateUrl: './input-docs.component.html'
+})
+export class InputDocsComponent implements OnInit {
+ name: FormControl = new FormControl('');
+ name2: FormControl = new FormControl('');
+ name3: FormControl = new FormControl('');
+ name4: FormControl = new FormControl('');
+ name5: FormControl = new FormControl('');
+ name6: FormControl = new FormControl({ value: '', disabled: true });
+ name7: FormControl = new FormControl('');
+ name8: FormControl = new FormControl('');
+ password: FormControl = new FormControl('');
+
+ hints: Array = [
+ 'Please put your first and last name here',
+ 'This is a second hint for no reason'
+ ];
+
+ basicInputExample: string = `
+
+ `;
+ basicInputLabelExample: string = `
+
+ `;
+ basicInputKeyExample: string = `
+
+ `;
+ basicInputKeyExampleOutput: string = `
+
+
+ `;
+ basicHintsTemplate: string = `
+ hints: Array = [
+ 'Please put your first and last name here',
+ 'This is a second hint for no reason'
+ ];
+ `;
+ basicInputHintsExample: string = `
+
+ `;
+ basicErrorsTemplate: string = `
+ this.name.setErrors([
+ {
+ message: 'An error occurred.'
+ },
+ {
+ type: 'Required',
+ message: 'This is a required input.'
+ }
+ ]);
+ `;
+ basicDisabledExample: string = `
+ firstName: new FormControl({
+ value: '',
+ disabled: true
+ });
+ `;
+ basicDisabledExample2: string = `
+ lastName: new FormControl('');
+
+ ngOnInit(): void {
+ this.lastName.disable();
+ // Use this.lastName.enable(); to re-enable the input.
+ }
+ `;
+ basicPlaceholderExample: string = `
+
+ `;
+ basicPasswordExample: string = `
+
+ `;
+
+ ngOnInit(): void {
+ setTimeout((): void => {
+ this.name5.setErrors([
+ {
+ message: 'An error occurred.'
+ },
+ {
+ type: 'Required',
+ message: 'This is a required input.'
+ }
+ ]);
+
+ this.name7.disable();
+ }, 500);
+ }
+}
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/text-area-docs/text-area-docs.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/text-area-docs/text-area-docs.component.html
new file mode 100644
index 000000000..f56bafb8b
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/text-area-docs/text-area-docs.component.html
@@ -0,0 +1,249 @@
+
+
+
+
+
Component Control
+
+
+
+ As with most of the form components, the only @Input
+ required of the text area component is a FormControl.
+ The FormControl can be passed in via the [control]
+ attribute on the <go-text-area> component.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
Component Label
+
+
+
+ All form components include an @Input() label: string;
+ that can be used to add a label to the textarea components.
+ In addition to displaying an HTML label, the text passed
+ in via the [label]
+ attribute is used to generate a unique ID to associate the
+ label with the textarea. If no label is passed in, a generic,
+ but still unique ID will be generated.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
Component Key
+
+
+
+ As stated above the label attribute is used to generate a
+ unique ID to associate the label with the textarea. As this might
+ not be desired, the @Input() key: string;
+ can be used to configure the ID attribute of the textarea directly.
+ Anything passed into the component via the [key]
+ attribute will be used to both assign the ID to the textarea and
+ associate the label with the textarea.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
Example Output
+
+ Notice in the below example output that the key has been assigned
+ to both the id attribute on
+ the textarea and the for attribute
+ on the label.
+
+
+
+
+
+
+
+
+
Component Hints
+
+
+
+ Form hints exist to help give more information about the
+ textareas they are attached to. The @Input() key: Array<string>
+ can be used to pass in an array of hints to the textarea component.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Component Errors
+
+
+
+ FormControls all have a consistent way of setting errors
+ via the setErrors() function.
+ All goponents use this API to display errors on our components, but the
+ data needs to be displayed in a specific structure.
+
+
+ By default the error type is set to "Error", however this can be
+ overridden as shown below.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Disable Component
+
+
+
+ FormControls can be either created as disable or later disabled
+ and re-enabled directly after they are created.
+
+
+
+
View
+
+
+
+
+
+
+
+
+
+
+
Code
+
+
+
+
+
+
+
+
+
Component Placeholder
+
+
+
+ The text area component's placeholder attribute can be set via
+ @Input() placeholder: string;
+ and the [placeholder] attribute.
+
+
+
+
View
+
+
+
+
Code
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/text-area-docs/text-area-docs.component.ts b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/text-area-docs/text-area-docs.component.ts
new file mode 100644
index 000000000..6713a8875
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/text-area-docs/text-area-docs.component.ts
@@ -0,0 +1,114 @@
+import { Component, OnInit } from '@angular/core';
+import { FormControl } from '@angular/forms';
+
+@Component({
+ templateUrl: './text-area-docs.component.html'
+})
+export class TextAreaDocsComponent implements OnInit {
+ message: FormControl = new FormControl('');
+ message2: FormControl = new FormControl('');
+ message3: FormControl = new FormControl('');
+ message4: FormControl = new FormControl('');
+ message5: FormControl = new FormControl('');
+ message6: FormControl = new FormControl({ value: '', disabled: true });
+ message7: FormControl = new FormControl('');
+ message8: FormControl = new FormControl('');
+
+ hints: Array = [
+ 'Please type your message here',
+ 'This is a second hint for no reason'
+ ];
+
+ basicExample: string = `
+
+ `;
+
+ basicLabelExample: string = `
+
+ `;
+
+ basicKeyExample: string = `
+
+ `;
+
+ basicKeyExampleOutput: string = `
+
+
+ `;
+
+ basicHintsTemplate: string = `
+ hints: Array = [
+ 'Please type your message here',
+ 'This is a second hint for no reason'
+ ];
+ `;
+
+ basicHintsExample: string = `
+
+ `;
+
+ basicErrorsTemplate: string = `
+ this.message.setErrors([
+ {
+ message: 'An error occurred.'
+ },
+ {
+ type: 'Required',
+ message: 'This is a required input.'
+ }
+ ]);
+ `;
+
+ basicDisabledExample: string = `
+ message: new FormControl({
+ value: '',
+ disabled: true
+ });
+ `;
+
+ basicDisabledExample2: string = `
+ otherMessage: new FormControl('');
+
+ ngOnInit(): void {
+ this.otherMessage.disable();
+ // Use this.otherMessage.enable(); to re-enable the input.
+ }
+ `;
+
+ basicPlaceholderExample: string = `
+
+ `;
+
+ ngOnInit(): void {
+ setTimeout((): void => {
+ this.message5.setErrors([
+ {
+ message: 'An error occurred.'
+ },
+ {
+ type: 'Required',
+ message: 'This is a required input.'
+ }
+ ]);
+
+ this.message7.disable();
+ });
+ }
+}
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/form-docs.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/form-docs.component.html
new file mode 100644
index 000000000..5f465498a
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/form-docs.component.html
@@ -0,0 +1 @@
+
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/form-docs.component.ts b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/form-docs.component.ts
new file mode 100644
index 000000000..f1f18df76
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/form-docs.component.ts
@@ -0,0 +1,19 @@
+import { Component } from '@angular/core';
+
+import { NavGroup } from '../../../../../../../go-lib/src/public_api';
+
+@Component({
+ templateUrl: './form-docs.component.html'
+})
+export class FormDocsComponent {
+ menuItems: Array = [
+ {
+ routeTitle: 'Basics', subRoutes: [
+ { route: './', routeTitle: 'Overview' },
+ { route: './datepicker', routeTitle: 'Datepicker' },
+ { route: './input', routeTitle: 'Input' },
+ { route: './textarea', routeTitle: 'Text Area' }
+ ]
+ }
+ ];
+}
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/icon-docs/icon-docs.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/icon-docs/icon-docs.component.html
new file mode 100644
index 000000000..f899deefa
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/icon-docs/icon-docs.component.html
@@ -0,0 +1,149 @@
+
+
{{ pageTitle }}
+
+
+
+
+
+
+
+
+
+
+
Usage
+
+ The <go-icon>
+ component should be the only way an icon is displayed in the
+ app.
+
+
+
+
+
Bindings
+
+
+
+
icon - (required)
+
+ The icon
+ binding must be passed. This component requires the
+
+ Material Icons Font
+
+ to be included in the application. To use, just pass the name
+ of the icon to this binding.
+
+ The iconModifier
+ binding can be used to modify the state of the icon. Icons
+ come in several different states that are represented with
+ different colors:
+
+
+
+ light
+ - Displays as a light gray color. Useful when
+ icons are of little importance.
+
+
+ negative
+ - Displays as a red color. Useful when icons
+ reinforce a dangerous or destructive content or
+ actions.
+
+
+ neutral
+ - Displays as a purple color. Useful when icons
+ reinforce informational content or actions.
+
+
+ positive
+ - Displays as a blue color. Useful when icons
+ reinforce positive content or actions.
+
+
+
+
+
iconClass
+
+ The iconClass
+ binding can be used to add additional classes directly
+ on to the icon element inside of the component. This
+ becomes useful when implementing icons inside of other
+ components and especially when following the
+ BEM methodology
+ This allows us to hand off the responsibility of modifying
+ the icons to the thing that is implementing them.
+
+ `;
+
+ iconOverrideWarning: string = `
+ You most likely will never need to perform an override like the one shown below.
+ This functionality goes against the guidelines Angular sets, but we've included it just in case this is absolutely necessary.
+ If possible, apply a class directly to the element before performing this override.
+ `;
+
+ constructor() { }
+}
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/layout-docs/components/layout-example/layout-example.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/layout-docs/components/layout-example/layout-example.component.html
new file mode 100644
index 000000000..c4065b7e4
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/layout-docs/components/layout-example/layout-example.component.html
@@ -0,0 +1,31 @@
+
+
+
+
Full Example
+
+
+
+
+
+ This example shows the GoLayout, GoSideNav, GoHeader, and GoSearch components in a cohesive example.
+
+ The <go-header> component should only be used once, at the root level component.
+ It should be placed inside a <go-layout> and be given the attribute of
+ <go-layout-header>.
+ This component will render a header across the top of the application that contains an icon button to collapse the side nav, bindings
+ for a logo, a slot for the search component in the middle, and a slot for actions on the right.
+
+
+
+
+
Bindings
+
+
+
altText
+
+ This binding will output the alt text for the logo image. This is optional, but recommended.
+
+
+
logo
+
+ This binding takes the path to the logo.
+
+
+
+
+
Content Projection
+
+ In addtiion to the bindings, there are two areas used for content projection: go-header-middle
+ and go-header-right. These should be applied to the <go-search>
+ component and an <ng-container> element respectively. Check the example below for details.
+
+
+
+
+
+
+
+
+
Simple Setup
+
+
+
+
+
+ For the sake of this example, we'll be referencing the layout of this application because it's a living example of the
+ entire layout component and family. It is also being shown inside of the layout component because it's required to be inside it.
+
+ The <go-side-nav> component should only be used once, at the root level component.
+ It should be placed inside a <go-layout> and be given the attribute of
+ go-layout-nav.
+ This component will generate a set of links and accordions on the left of the application and uses the built in routing provided
+ by Angular.
+
+
+
+
+
Bindings
+
+
+
menuItems
+
+ The data passed to this binding contains the structure of the navigation. There are variations of how this
+ data could look, but it has to conform to either a NavItem or a
+ NavGroup model. These models have the following properties:
+
+
+
+
+
+
Important Notes:
+
+
+ Providing data to menuItems does not mean you no longer have
+ to define your Angular routes. You still have to do this.
+
+
+ Root level navigation elements must have an icon associated with them, but any other level underneath should not.
+
+
+ NavGroup objects will not prodive routing themselves, any routes should be defined
+ within the subRoutes array. If there are no subRoutes
+ for this object, then it should be a NavItem instead.
+
+
+ The maximum number of levels that should be nested is 2. Exceeding this number breaks the experience.
+
+
+ The full route should be provided from root.
+ (ex: ui-kit has a child of button, the route provided should be 'ui-kit/button')
+
+
+ Lastly, for security reasons, the data provided for menuItems should be generated
+ and obtained from the server. There is no functionality in place to show/hide routes within this component. Any behavior of this
+ kind should be generated by the server.
+
+
+
+
+
+
+
+
+
+
Simple Setup
+
+
+
+
+
+ For the sake of this example, we'll be referencing the layout of this application because it's a living example of the
+ entire layout component and family. It is also being shown inside of the layout component because it's required to be inside it.
+
+
+
app.module
+
+
+
app.component.html
+
+
+
app.component.ts
+
+
+
+
+
+
+
+
+
Side Nav Service
+
+
+
+
+
+ If there is an instance where the side nav needs collapsed based on some action performed in the rest of
+ the UI the GoSideNavService can be used. Note: the GoHeaderComponent
+ handles expanding/collapsing of the navigation and should be used as the primary way to do this.
+
+ The <go-layout> component should only be used once, at the root level component
+ (typically the app component). This component is used to create an application layout that includes routing, navigation, and
+ slots in the header for a logo, a search component, and actions.
+
+
+
Bindings
+
+ There are none! Instead, there are two areas used for content projection: go-layout-header
+ and go-layout-nav. These should be applied to the <go-header>
+ and <go-side-nav> components respectively. Check the simple setup example below.
+
+
+
+
+
+
+
Simple Setup
+
+
+
+ For the sake of this example, we'll be referencing the layout of this application because it's a living example of the
+ entire layout component and family.
+
+ The <go-search> component should only be used once, at the root level component.
+ It should be placed inside the <go-header> and be given the attribute of
+ go-header-middle.
+ This component acts as a search bar for the header. Upon implementation, it should act as a "global" search.
+
+
+
+
+
Bindings
+
+ There are none! Instead, to interact with this component, the GoSearchService can
+ be used.
+
+
+
+
+
GoSearchService:
+
The GoSearchService is how to interact with the GoSearchComponent. It has these available properties and methods:
+
+
+ noResultsMessage
(string)
- The message to be shown when no results are returned from the server that match the search term.
+ By default the message is: 'No Results Found'.
+
+
+ searchTerm
(Subject<string>)
- The term entered by the user to search. This is a Subject which means it can be watched
+ for changes using a subscription.
+
+
+ termLength
(number)
- Minimum number of characters to trigger a search
+
+
+ successResponse
(void method)
- Use this method when you get a response from the server that was successful, with results
+
+
+ notFoundResponse
(void method)
- Use this method when you get a response from the server that was successful, but with no results
+
+
+
+
+
+
+
+
+
+
Simple Setup
+
+
+
+
+
+ For the sake of this example, it is being shown inside of the layout and header components because it's required to be inside it.
+
+
+ Because search implementation can vary greatly between projects, what the results look like are totally dependent upon your implementation.
+ For this reason, there is not styling associated with the results section and the GoSearchComponent does not render the results.
+ Start by creating a component that will interact with the GoSearchService and render the results. In this example, the component showing this
+ is named SearchTestComponent.
+
+
+
app.module
+
+
+
app.component.html
+
+
+
search-test.component.ts
+
+
+
search-test.component.html
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/layout-docs/components/layout-search/layout-search.component.spec.ts b/projects/go-style-guide/src/app/features/ui-kit/components/layout-docs/components/layout-search/layout-search.component.spec.ts
new file mode 100644
index 000000000..c501dd60d
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/layout-docs/components/layout-search/layout-search.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { LayoutSearchComponent } from './layout-search.component';
+
+describe('LayoutSearchComponent', () => {
+ let component: LayoutSearchComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ LayoutSearchComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(LayoutSearchComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/layout-docs/components/layout-search/layout-search.component.ts b/projects/go-style-guide/src/app/features/ui-kit/components/layout-docs/components/layout-search/layout-search.component.ts
new file mode 100644
index 000000000..ff60894ac
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/layout-docs/components/layout-search/layout-search.component.ts
@@ -0,0 +1,116 @@
+import { Component } from '@angular/core';
+import { SubNavService } from 'projects/go-style-guide/src/app/shared/components/sub-nav/sub-nav.service';
+
+@Component({
+ selector: 'app-layout-search',
+ templateUrl: './layout-search.component.html'
+})
+export class LayoutSearchComponent {
+
+ basicExample_htmlLayout: string = `
+
+
+
+
+
+
+
+
+
+
+ `;
+
+ basicExample_module: string = `
+ // Required imports for the layout, header, & search:
+ import {
+ GoHeaderModule,
+ GoIconButtonModule,
+ GoLayoutModule,
+ GoSearchModule
+ } from '@tangoe/goponents';
+
+ @NgModule({
+ declarations: [
+ AppComponent
+ ],
+ imports: [
+ GoHeaderModule,
+ GoIconButtonModule,
+ GoLayoutModule,
+ GoSearchModule
+ ],
+ bootstrap: [AppComponent]
+ })
+ export class AppModule { }
+ `;
+
+ basicExample_ts: string = `
+ import { GoSearchService } from '@tangoe/goponents';
+ import { YourService } from './your.service';
+
+ @Component({
+ selector: 'app-search-test',
+ templateUrl: './search-test.component.html'
+ })
+ export class SearchTestComponent implements OnInit {
+
+ results: any[];
+
+ constructor(
+ private searchService: GoSearchService,
+ private yourService: YourService
+ ) {
+ // Do this if you need to change the minimum number of
+ // characters to trigger the search, default is 3.
+ this.searchService.termLength = 2;
+
+ // Do this if you need to set a custom message if you have
+ // no results from the service, default is 'No Results Found'
+ this.searchService.noResultsMessage = 'Custom Message Here';
+ }
+
+ ngOnInit(): void {
+ // subscribe to events of searchTerm
+ this.searchService.searchTerm.subscribe((searchTerm: string) => {
+
+ // this section is dependent upon what the data looks like,
+ // but when a new searchTerm is fired, go get data
+ this.yourService
+ .getData(searchTerm)
+ .subscribe((results: any[]) => {
+ if (results.length === 0) {
+ // if yourService did not return any results
+ this.results = null;
+ this.searchService.notFoundResponse();
+ } else {
+ // if yourService did return results
+ this.results = results;
+ this.searchService.successResponse();
+ }
+ });
+ });
+ }
+ }
+ `;
+
+ basicExample_html: string = `
+
+
+ The <go-loader> component should be used to
+ indicate the processing of data, awaiting a server request, or any other time the user may
+ need to wait on the application to do something.
+
+
+
+
Bindings
+
+
+
loaderSize
+
+ This binding determines what size of loader is generated. The available options are:
+
+
+
small
+
medium
+
large
+
+
+
loaderType
+
+ This binding determines what type of loader is generated. The available options are:
+
+
+
negative
+
neutral
+
positive
+
+
+
+
+
+
+
Basic Example
+
+
+
+ Shows a basic use case of each type and size.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Show/Hide Example
+
+
+
+
+
+ The Loader has an animation built into Angular's *ngIf
+ syntax that fades the loader in/out. To implement this, simply throw an *ngIf
+ on the <go-loader>
+
+ The <go-modal> component should be the only instance
+ of a modal in the app.
+
+
+
Setup
+
To use the modal anywhere in the app, you must first add it to the app level. This should only be done once per application.
+
+
+
+ Import the GoModalModule into app.module.ts
+
+
+
+
+
+ Add the <go-modal> element to app.component.html.
+
+
+
+
+
+
+
+
+
Using the Modal service
+
+
+
+
+
+ For this example, the component we want to render in the modal is ModalTestComponent.
+ This component lives in the UiKitModule.
+ To make use of the modal in our component:
+
+
+
+
+ In the module that imports your component, import the GoModalModule,
+ add the component that will be rendered in the modal to the entryComponents,
+ and add the GoModalService to the providers.
+
+
+
+
+
+ In the component that is telling the modal to open, import the GoModalService,
+ and the component that is being rendered inside the modal.
+
+
+
+
+
+ To open the modal, use the service to call openModal. This method takes the component type
+ (ModalTestComponent in our case), and the bindings for that component as an object.
+
+
+
+
+
+ Lastly, the button that triggers the openModal method.
+
+ The <go-off-canvas>
+ component should be the only instance of the off canvas in the app.
+
+
+
Setup
+
+ To use the off canvas anywhere in the app, you must first add
+ it to the app level. This should only be done once per application.
+
+
+
+
+ Import the GoOffCanvasModule
+ into the main app module.
+
+
+
+
+
+ Add the <go-off-canvas>
+ element to app.component.html.
+
+
+
+
+
+
+
+
+
+
+
Using the Off Canvas service
+
+
+
To make use of the off canvas in our component:
+
+
+
+ In the module that imports your component, import the
+ GoOffCanvasModule,
+ add the component that will be rendered in the off canvas to
+ the entryComponents,
+ and add the GoOffCanvasService
+ to the providers.
+
+
+
+
+
+ In the component that is telling the off canvas to open, import the
+ GoOffCanvasService, and the
+ component that is being rendered inside the off canvas.
+
+
+
+
+
+ To open the off canvas, use the service to call
+ openOffCanvas.
+ This method takes the component type (BasicTestComponent in our case),
+ and the bindings for that component as an object.
+
+
+
+
+
+
+
+ Lastly, we need something to trigger that function.
+ In our case we will use a button that triggers the
+ openOffCanvas method,
+ but it could be triggered by any event.
+
+
+
+
component.html
+
+
+
+
View
+
+ Open Off Canvas
+
+
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/off-canvas-docs/off-canvas-docs.component.ts b/projects/go-style-guide/src/app/features/ui-kit/components/off-canvas-docs/off-canvas-docs.component.ts
new file mode 100644
index 000000000..fc4fecc9d
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/off-canvas-docs/off-canvas-docs.component.ts
@@ -0,0 +1,88 @@
+import { Component } from '@angular/core';
+import { GoOffCanvasService } from '../../../../../../../go-lib/src/public_api';
+
+import { BasicTestComponent } from '../basic-test/basic-test.component';
+
+@Component({
+ selector: 'app-off-canvas-docs',
+ templateUrl: './off-canvas-docs.component.html'
+})
+export class OffCanvasDocsComponent {
+ noteMessage: string = `For this example, the component we want to render in the off canvas is "BasicTestComponent",
+ but we can follow the same pattern to render any component inside of the off canvas.`;
+
+ appModuleImport: string = `
+ import { GoOffCanvasModule } from '@tangoe/goponents';
+
+ @NgModule({
+ declarations: [AppComponent],
+ imports: [
+ GoOffCanvasModule
+ ],
+ bootstrap: [AppComponent]
+ })
+ export class AppModule { }
+ `;
+
+ uiKitExample: string = `
+ import { GoOffCanvasModule, GoOffCanvasService } from '@tangoe/goponents';
+ import { BasicTestComponent } from './components/basic-test/basic-test.component';
+
+ @NgModule({
+ imports: [
+ GoOffCanvasModule
+ ],
+ declarations: [
+ BasicTestComponent
+ ],
+ entryComponents: [
+ BasicTestComponent
+ ],
+ providers: [
+ GoOffCanvasService
+ ]
+ })
+ export class UiKitModule { }
+ `;
+
+ implementationExample: string = `
+ import { GoOffCanvasService } from '@tangoe/goponents';
+ import { BasicTestComponent } from '../basic-test/basic-test.component';
+
+ constructor(private goOffCanvasService: GoOffCanvasService) { }
+ `;
+
+ functionExample: string = `
+ openOffCanvas() : void {
+ this.goOffCanvasService.openOffCanvas({
+ component: BasicTestComponent,
+ bindings: {
+ someBinding: 'monkey'
+ }
+ });
+ }
+ `;
+
+ htmlExample: string = `
+
+ Open Off Canvas
+
+ `;
+
+ constructor(
+ private goOffCanvasService: GoOffCanvasService
+ ) { }
+
+ public openOffCanvas(): void {
+ this.goOffCanvasService.openOffCanvas({
+ component: BasicTestComponent,
+ bindings: {
+ someBinding: 'Basic Off Canvas Component'
+ }
+ });
+ }
+}
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/table-docs/components/server-integration/server-integration.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/table-docs/components/server-integration/server-integration.component.html
new file mode 100644
index 000000000..51a897922
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/table-docs/components/server-integration/server-integration.component.html
@@ -0,0 +1,105 @@
+
+
+
+
Integrating with a Server
+
+
+
+ By default the table component is setup for client side
+ data manipulation. What if there is too much data to send
+ to the front end? Implementing server-side data manipulation
+ is what is required.
+
+
(This means paging and sorting)
+
+
+
+
+
+
+
Setting it up
+
+
+
+
+
+ For server-side integration to work properly, the
+ following must be present on go-table:
+
+
+
(tableChange) - to handle the table events
+
[loadingData] - to handle the loading of the table
+
[tableConfig] - because it's required
+
+
example.html
+
+
+
+
+ There are 4 properties of the table config that are
+ important when building out server-side integration:
+
+
+
pageConfig.offset - the current place in the data set
+
pageConfig.perPage - the current number of items on each page
+
sortConfig.column - the current column that is sorted (if table is sorted)
+
sortConfig.direction - the current sort direction (if table is sorted)
+
+
example.ts
+
+
+ It is recommended to pass the entire GoTableConfig
+ to the service that is retrieving the data and map
+ the properties of the object to the corresponding
+ parameters of the endpoint that is being hit.
+
+
+ When the data is successfully returned, the properties
+ shown below must be set.
+
+
+
+
+
+
+
+
+
Important Notes
+
+
+
Total Results
+
+ For the best user experience with server-side integrations,
+ the data returned from the server should have two properties:
+
+
+
+ These properties should then be set, upon a successful response,
+ to the corresponding properties on the GoTableConfig,
+ tableData and totalCount.
+
+
[loadingData]
+
+ When server mode is enabled, this property will be set to
+ true whenever the
+ tableChange event
+ is fired. The responsibility to set it back to
+ false falls upon
+ on the parent component after data is received from the server.
+ This is to provide a consistent and helpful experience to
+ users and should not be overridden.
+
+
(tableChange)
+
+ The tableChange
+ event is emitted anytime a trigger is fired in the table
+ component. These triggers are:
+
+ Table actions are a set of icon buttons and other tools meant to perform actions on the table or the data inside of it.
+ In the table you can provide a series of components via content projection.
+
+
+
+
+
+ For the table actions to appear, you must toggle them on by using showTableActions
+
+ The <go-table> component should be used for any instance
+ of a data table throughout the app.
+
+
+
Bindings
+
+
+
loadingData
+
+ This binding can be used to apply a loading state to the table.
+ Typically, this should only be used for server-side integration while awaiting data.
+
+
tableConfig
+
+ This is a class to represent the entire table data and its configurations.
+ The only required property is tableData.
+
+
+ It has these properties:
+
+
+
tableTitle
+
+ This property adds a title above the table, this is optional.
+
+ By default, pagination is enabled. To configure the paging setup, you can pass a GoTablePageConfig class
+ to pageConfig on the GoTableConfig class.
+
+
+
+
+
offset
+
+ This property represents the number of records to offset the paging by.
+ This is set and updated internally by the table component, but it may need updated externally if you're implementing server-side paging.
+
+
+ This property determines what page sizes are available to the user. It takes an array of numbers, but has defaults.
+ It is recommended to stick with the predefined options, but if needed, pass whole numbers in increments of 5 for more options.
+
+
perPage
+
+ This property represents the current items per page. It is set and updated internally by the table component.
+
+
If you're implementing server-side paging, this is important. See Server Integration for more details.
+
+
+
+
+
+
+
+
Simple Paging
+
+ Nothing extra for client-side paging is required, it just works. To set different page sizes, the following is requried.
+
+
+
+
+
+
+
example.html
+
+
example.ts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/table-docs/components/table-pagination/table-pagination.component.ts b/projects/go-style-guide/src/app/features/ui-kit/components/table-docs/components/table-pagination/table-pagination.component.ts
new file mode 100644
index 000000000..e7ae76268
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/table-docs/components/table-pagination/table-pagination.component.ts
@@ -0,0 +1,64 @@
+import { Component } from '@angular/core';
+
+import { TableDocsService } from '../../table-docs.service';
+import { GoTableConfig, GoTablePageConfig } from 'projects/go-lib/src/public_api';
+import { SubNavService } from 'projects/go-style-guide/src/app/shared/components/sub-nav/sub-nav.service';
+
+@Component({
+ templateUrl: './table-pagination.component.html'
+})
+export class TablePaginationComponent {
+ constructor(
+ private tableDocsService: TableDocsService,
+ private subNavService: SubNavService
+ ) {
+ this.subNavService.pageTitle = 'Table Pagination';
+ }
+
+ ////////////////////////////
+
+ pageConfig: string = `
+ class GoTablePageConfig {
+ offset: number = 0;
+ pageSizes: number[] = [10, 25, 50];
+ perPage: number = 10;
+ }
+
+ /**
+ * Default values are assigned in when the class is instantiated
+ * so that there is consistency among the various tables throughout
+ * the app.
+ *
+ * We recommend not changing these.
+ **/
+ `;
+
+ tableConfig_html: string = `
+
+
+
+
+
+
+
+
+ `;
+
+ tableConfig_ts: string = `
+ tableConfig = new GoTableConfig({
+ pageConfig: new GoTablePageConfig({
+ pageSizes: [5, 10, 15],
+ perPage: 5
+ }),
+ tableData: this.data
+ });
+ `;
+
+ tableConfig: object = new GoTableConfig({
+ pageConfig: new GoTablePageConfig({
+ pageSizes: [5, 10, 15],
+ perPage: 5
+ }),
+ tableData: this.tableDocsService.generateData(25)
+ });
+}
diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/table-docs/components/table-selection/table-selection.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/table-docs/components/table-selection/table-selection.component.html
new file mode 100644
index 000000000..86c4b3c1d
--- /dev/null
+++ b/projects/go-style-guide/src/app/features/ui-kit/components/table-docs/components/table-selection/table-selection.component.html
@@ -0,0 +1,136 @@
+
+
+
+
Implementing Selection
+
+
+
+ By default, selection is disabled. To add row selection capabilities to the table, there are two properties of the GoTableConfig
+ that must be set, selectable and selectBy.
+
+
+
+
+
selectable
+
+ This property enables selection within the table. Without this enabled, selection will not be possible.
+
+
selectBy
+
+ This property determines which column will be used to keep track of row selection. It corresponds to one of the fields in the columns.
+ Typically, this should be an id, or some other unique identifier in the data set.
+
+
+
+
+
+
+
Imporant Notes
+
+
+
+ Selection is persistant. This means that if the user changes the page or sorts the data, previous selections will persist through these actions.
+ This applies to both client side and server side implementations.
+
+
+
+
+
+
+
Interacting with the Selection
+
+
+
+ There are two ways to interact with the selected items of the table.
+ By using an element reference on the table and/or using the (rowSelectionEvent) event.
+
+
+ First, you must understand how the table handle selection. See the SelectionState interface for an explanation:
+
+
+
+ In selection mode, the user is selecting individual rows. This means that these selected rows are being added to the selectedRows array.
+ In deselection mode, the user has checked the 'check all' check box and is now removing items from the selection; we call this deselection.
+ In this case, items are added to the deselectedRows array as the user unchecks them.
+
+
+ Interact with the table below to see how the selection works.
+
+
+
+
+
+
+ State
+
+
+
+
+
+
+
+
+
+
+
+
Element Reference Interaction
+
+
+
+ This approach should be used when an action is performed after a user has finished their selecting (ex. button click).
+