-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(components/text-editor): add inline help example for text editor (…
…#502) * feat(components/text-editor): add inline help example for text editor * Use SkyTabIndex type
- Loading branch information
1 parent
cce8c67
commit 476daca
Showing
7 changed files
with
120 additions
and
2 deletions.
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
14 changes: 14 additions & 0 deletions
14
...src/app/code-examples/text-editor/text-editor-inline-help/text-editor-demo.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,14 @@ | ||
<form novalidate [formGroup]="myForm"> | ||
<sky-input-box> | ||
<label skyId #textEditorLabel="skyId" class="sky-control-label"> | ||
Text editor demo | ||
</label> | ||
<sky-help-inline class="sky-control-help"></sky-help-inline> | ||
<sky-text-editor | ||
formControlName="myText" | ||
[attr.aria-labelledby]="textEditorLabel.id" | ||
class="sky-form-control" | ||
> | ||
</sky-text-editor> | ||
</sky-input-box> | ||
</form> |
20 changes: 20 additions & 0 deletions
20
...s/src/app/code-examples/text-editor/text-editor-inline-help/text-editor-demo.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,20 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'app-text-editor-demo', | ||
templateUrl: './text-editor-demo.component.html', | ||
}) | ||
export class TextEditorDemoComponent implements OnInit { | ||
public myForm: FormGroup; | ||
|
||
private richText = `<font style="font-size: 18px" face="Arial" color="#a25353"><b>Exclusively committed to your impact</b></font><p>Since day one, Blackbaud has been 100% focused on driving impact for social good organizations.</p><p>We equip change agents with <b>cloud software</b>, <i>services</i>, <u>expertise</u>, and <font color="#a25353">data intelligence</font> designed with unmatched insight and supported with unparalleled commitment. Every day, our <b>customers</b> achieve unmatched impact as they advance their missions.</p><ul><li><a href="#">Build a better world</a></li><li><a href="#">Explore our solutions</a></li></ul>`; | ||
|
||
constructor(private formBuilder: FormBuilder) {} | ||
|
||
public ngOnInit(): void { | ||
this.myForm = this.formBuilder.group({ | ||
myText: new FormControl(this.richText), | ||
}); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...ples/src/app/code-examples/text-editor/text-editor-inline-help/text-editor-demo.module.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,23 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { ReactiveFormsModule } from '@angular/forms'; | ||
import { SkyIdModule } from '@skyux/core'; | ||
import { SkyInputBoxModule } from '@skyux/forms'; | ||
import { SkyHelpInlineModule } from '@skyux/indicators'; | ||
import { SkyTextEditorModule } from '@skyux/text-editor'; | ||
|
||
import { TextEditorDemoComponent } from './text-editor-demo.component'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
ReactiveFormsModule, | ||
SkyInputBoxModule, | ||
SkyIdModule, | ||
SkyTextEditorModule, | ||
SkyHelpInlineModule, | ||
], | ||
declarations: [TextEditorDemoComponent], | ||
exports: [TextEditorDemoComponent], | ||
}) | ||
export class TextEditorDemoModule {} |
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,37 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
|
||
import { RichTextDisplayDemoComponent as RichTextDisplayRichTextDisplayDemoComponent } from '../code-examples/text-editor/rich-text-display/rich-text-display-demo.component'; | ||
import { RichTextDisplayDemoModule as RichTextDisplayRichTextDisplayDemoModule } from '../code-examples/text-editor/rich-text-display/rich-text-display-demo.module'; | ||
import { TextEditorDemoComponent as TextEditorInlineHelpTextEditorDemoComponent } from '../code-examples/text-editor/text-editor-inline-help/text-editor-demo.component'; | ||
import { TextEditorDemoModule as TextEditorInlineHelpTextEditorDemoModule } from '../code-examples/text-editor/text-editor-inline-help/text-editor-demo.module'; | ||
import { TextEditorDemoComponent as TextEditorTextEditorDemoComponent } from '../code-examples/text-editor/text-editor/text-editor-demo.component'; | ||
import { TextEditorDemoModule as TextEditorTextEditorDemoModule } from '../code-examples/text-editor/text-editor/text-editor-demo.module'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'rich-text-display', | ||
component: RichTextDisplayRichTextDisplayDemoComponent, | ||
}, | ||
{ path: 'text-editor', component: TextEditorTextEditorDemoComponent }, | ||
{ | ||
path: 'text-editor-inline-help', | ||
component: TextEditorInlineHelpTextEditorDemoComponent, | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class TextEditorFeatureRoutingModule {} | ||
|
||
@NgModule({ | ||
imports: [ | ||
RichTextDisplayRichTextDisplayDemoModule, | ||
TextEditorInlineHelpTextEditorDemoModule, | ||
TextEditorTextEditorDemoModule, | ||
TextEditorFeatureRoutingModule, | ||
], | ||
}) | ||
export class TextEditorFeatureModule {} |
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