-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
23 changed files
with
1,159 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** @docs-private */ | ||
export interface MdcChipSetAdapter { | ||
hasClass: (className: string) => boolean, | ||
registerInteractionHandler: (evtType: string, handler: EventListener) => void, | ||
deregisterInteractionHandler: (evtType: string, handler: EventListener) => void, | ||
appendChip: (text: string, leadingIcon: Element, trailingIcon: Element) => Element, | ||
removeChip: (chip: any) => void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** @docs-private */ | ||
export interface MdcChipAdapter { | ||
addClass: (className: string) => void, | ||
removeClass: (className: string) => void, | ||
hasClass: (className: string) => boolean, | ||
addClassToLeadingIcon: (className: string) => void, | ||
removeClassFromLeadingIcon: (className: string) => void, | ||
eventTargetHasClass: (target: EventTarget, className: string) => boolean, | ||
registerEventHandler: (evtType: string, handler: EventListener) => void, | ||
deregisterEventHandler: (evtType: string, handler: EventListener) => void, | ||
registerTrailingIconInteractionHandler: (evtType: string, handler: EventListener) => void, | ||
deregisterTrailingIconInteractionHandler: (evtType: string, handler: EventListener) => void, | ||
notifyInteraction: () => void, | ||
notifyTrailingIconInteraction: () => void, | ||
notifyRemoval: () => void, | ||
getComputedStyleValue: (propertyName: string) => string, | ||
setStyleProperty: (propertyName: string, value: string) => void | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
site/src/app/components/directives.demo/chips.directives.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<h1>Chips</h1> | ||
<p>Chips are compact elements that allow users to enter information, select a choice, filter content, or trigger an action. | ||
</p> | ||
<blox-code-sample> | ||
<span bloxSampleTitle>Action Chips Demo</span> | ||
<blox-snippet-chips bloxSample></blox-snippet-chips> | ||
</blox-code-sample> | ||
<br/> | ||
<blox-code-sample> | ||
<span bloxSampleTitle>Choice Chips Demo</span> | ||
<blox-snippet-chips-choice bloxSample></blox-snippet-chips-choice> | ||
</blox-code-sample> | ||
<br/> | ||
<blox-code-sample> | ||
<span bloxSampleTitle>Filter Chips Demo</span> | ||
<blox-snippet-chips-filter bloxSample></blox-snippet-chips-filter> | ||
</blox-code-sample> | ||
<br/> | ||
<blox-code-sample> | ||
<span bloxSampleTitle>Input Chips Demo</span> | ||
<blox-snippet-chips-input bloxSample></blox-snippet-chips-input> | ||
</blox-code-sample> | ||
|
||
<div class="blox-docs-api">${require('@blox/material/apidocs/chips.html')}</div> |
14 changes: 14 additions & 0 deletions
14
site/src/app/components/directives.demo/chips.directives.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'blox-chips-directives', | ||
templateUrl: './chips.directives.component.html' | ||
}) | ||
export class ChipsDirectivesComponent { | ||
static DOC_SVG = require('assets/img/mdc-icons/chip.svg'); | ||
static DOC_TYPE = 'components'; | ||
static DOC_HREF = 'chips'; | ||
|
||
constructor() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
site/src/app/components/snippets/directives/snippet.chips.choice.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<fieldset class="blox-snippet snippet-skip-line"> | ||
<div mdcChipSet="choice"> | ||
<div mdcChip><div mdcChipText>Extra Small</div></div> | ||
<div mdcChip><div mdcChipText>Small</div></div> | ||
<div mdcChip><div mdcChipText>Medium</div></div> | ||
<div mdcChip><div mdcChipText>Large</div></div> | ||
<div mdcChip><div mdcChipText>Extra Large</div></div> | ||
</div> | ||
</fieldset><div class="snippet-skip-line"></div> |
22 changes: 22 additions & 0 deletions
22
site/src/app/components/snippets/directives/snippet.chips.choice.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component } from '@angular/core'; | ||
//snip:skip | ||
import { forwardRef } from '@angular/core'; | ||
import { AbstractSnippetComponent } from '../abstract.snippet.component'; | ||
//snip:endskip | ||
@Component({ | ||
//snip:skip | ||
providers: [{provide: AbstractSnippetComponent, useExisting: forwardRef(() => SnippetChipsChoiceComponent)}], | ||
//snip:endskip | ||
selector: 'blox-snippet-chips-choice', | ||
templateUrl: './snippet.chips.choice.component.html' | ||
}) | ||
export class SnippetChipsChoiceComponent/*snip:skip*/extends AbstractSnippetComponent/*snip:endskip*/ { | ||
//snip:skip | ||
constructor() { | ||
super({ | ||
'html': require('!raw-loader!./snippet.chips.choice.component.html'), | ||
'typescript': require('!raw-loader!./snippet.chips.choice.component.ts') | ||
}); | ||
} | ||
//snip:endskip | ||
} |
20 changes: 20 additions & 0 deletions
20
site/src/app/components/snippets/directives/snippet.chips.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<fieldset class="blox-snippet snippet-skip-line"> | ||
<div mdcChipSet> | ||
<div mdcChip> | ||
<i mdcChipIcon class="material-icons">wb_sunny</i> | ||
<div mdcChipText>Turn lights on</div> | ||
</div> | ||
<div mdcChip> | ||
<i mdcChipIcon class="material-icons">bookmark</i> | ||
<div mdcChipText>Bookmark</div> | ||
</div> | ||
<div mdcChip> | ||
<i mdcChipIcon class="material-icons">alarm</i> | ||
<div mdcChipText>Set alarm</div> | ||
</div> | ||
<div mdcChip> | ||
<i mdcChipIcon class="material-icons">directions</i> | ||
<div mdcChipText>Get directions</div> | ||
</div> | ||
</div> | ||
</fieldset><div class="snippet-skip-line"></div> |
22 changes: 22 additions & 0 deletions
22
site/src/app/components/snippets/directives/snippet.chips.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component } from '@angular/core'; | ||
//snip:skip | ||
import { forwardRef } from '@angular/core'; | ||
import { AbstractSnippetComponent } from '../abstract.snippet.component'; | ||
//snip:endskip | ||
@Component({ | ||
//snip:skip | ||
providers: [{provide: AbstractSnippetComponent, useExisting: forwardRef(() => SnippetChipsComponent)}], | ||
//snip:endskip | ||
selector: 'blox-snippet-chips', | ||
templateUrl: './snippet.chips.component.html' | ||
}) | ||
export class SnippetChipsComponent/*snip:skip*/extends AbstractSnippetComponent/*snip:endskip*/ { | ||
//snip:skip | ||
constructor() { | ||
super({ | ||
'html': require('!raw-loader!./snippet.chips.component.html'), | ||
'typescript': require('!raw-loader!./snippet.chips.component.ts') | ||
}); | ||
} | ||
//snip:endskip | ||
} |
20 changes: 20 additions & 0 deletions
20
site/src/app/components/snippets/directives/snippet.chips.filter.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<fieldset class="blox-snippet snippet-skip-line"> | ||
<div mdcChipSet="filter"> | ||
<div mdcChip> | ||
<i mdcChipIcon class="material-icons">message</i> | ||
<div mdcChipText>Messages</div> | ||
</div> | ||
<div mdcChip> | ||
<i mdcChipIcon class="material-icons">notification_important</i> | ||
<div mdcChipText>Notifications</div> | ||
</div> | ||
<div mdcChip> | ||
<i mdcChipIcon class="material-icons">warning</i> | ||
<div mdcChipText>Warnings</div> | ||
</div> | ||
<div mdcChip> | ||
<i mdcChipIcon class="material-icons">error</i> | ||
<div mdcChipText>Errors</div> | ||
</div> | ||
</div> | ||
</fieldset><div class="snippet-skip-line"></div> |
22 changes: 22 additions & 0 deletions
22
site/src/app/components/snippets/directives/snippet.chips.filter.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Component } from '@angular/core'; | ||
//snip:skip | ||
import { forwardRef } from '@angular/core'; | ||
import { AbstractSnippetComponent } from '../abstract.snippet.component'; | ||
//snip:endskip | ||
@Component({ | ||
//snip:skip | ||
providers: [{provide: AbstractSnippetComponent, useExisting: forwardRef(() => SnippetChipsFilterComponent)}], | ||
//snip:endskip | ||
selector: 'blox-snippet-chips-filter', | ||
templateUrl: './snippet.chips.filter.component.html' | ||
}) | ||
export class SnippetChipsFilterComponent/*snip:skip*/extends AbstractSnippetComponent/*snip:endskip*/ { | ||
//snip:skip | ||
constructor() { | ||
super({ | ||
'html': require('!raw-loader!./snippet.chips.filter.component.html'), | ||
'typescript': require('!raw-loader!./snippet.chips.filter.component.ts') | ||
}); | ||
} | ||
//snip:endskip | ||
} |
16 changes: 16 additions & 0 deletions
16
site/src/app/components/snippets/directives/snippet.chips.input.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<fieldset class="blox-snippet snippet-skip-line"> | ||
<div mdcChipSet="input"> | ||
<div *ngFor="let chip of chips; let i = index" mdcChip (remove)="removeChip(i)"> | ||
<i mdcChipIcon class="material-icons">face</i> | ||
<div mdcChipText>{{chip}}</div> | ||
<i class="material-icons" mdcChipIcon>cancel</i> | ||
</div> | ||
</div> | ||
<form (submit)="addChip()"> | ||
<div mdcTextField> | ||
<input mdcTextFieldInput type="text" name="chipInput" [(ngModel)]="newChip" autocomplete="off"/> | ||
<label mdcFloatingLabel>Add Chip</label> | ||
</div> | ||
<button type="submit" mdcButton [disabled]="!newChip">Add Chip</button> | ||
</form> | ||
</fieldset><div class="snippet-skip-line"></div> |
38 changes: 38 additions & 0 deletions
38
site/src/app/components/snippets/directives/snippet.chips.input.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Component } from '@angular/core'; | ||
//snip:skip | ||
import { forwardRef } from '@angular/core'; | ||
import { AbstractSnippetComponent } from '../abstract.snippet.component'; | ||
//snip:endskip | ||
@Component({ | ||
//snip:skip | ||
providers: [{provide: AbstractSnippetComponent, useExisting: forwardRef(() => SnippetChipsInputComponent)}], | ||
//snip:endskip | ||
selector: 'blox-snippet-chips-input', | ||
templateUrl: './snippet.chips.input.component.html' | ||
}) | ||
export class SnippetChipsInputComponent/*snip:skip*/extends AbstractSnippetComponent/*snip:endskip*/ { | ||
chips = [ 'claire', 'pete', 'anne' ]; | ||
newChip: string; | ||
|
||
//snip:skip | ||
constructor() { | ||
super({ | ||
'html': require('!raw-loader!./snippet.chips.input.component.html'), | ||
'typescript': require('!raw-loader!./snippet.chips.input.component.ts') | ||
}); | ||
} | ||
//snip:endskip | ||
|
||
addChip() { | ||
if (this.newChip) { | ||
let value = this.newChip.trim(); | ||
if (value.length) | ||
this.chips.push(value); | ||
} | ||
this.newChip = null; | ||
} | ||
|
||
removeChip(index: number) { | ||
this.chips.splice(index, 1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.