generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
723 additions
and
228 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
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
47 changes: 47 additions & 0 deletions
47
projects/demo/src/app/pages/toolbar/shared/examples/1/index.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,47 @@ | ||
<form [formGroup]="group"> | ||
<tui-toolbar | ||
class="toolbar" | ||
[editor]="editorRef" | ||
[tools]="builtInTools" | ||
/> | ||
|
||
<tui-editor | ||
#header | ||
formControlName="header" | ||
class="editor" | ||
[tools]="[]" | ||
(focusIn)="editorRef = header.editor" | ||
> | ||
Header | ||
</tui-editor> | ||
|
||
<tui-editor | ||
#main | ||
formControlName="main" | ||
class="editor" | ||
[tools]="[]" | ||
(focusIn)="editorRef = main.editor" | ||
> | ||
Main | ||
</tui-editor> | ||
|
||
<tui-editor | ||
#footer | ||
formControlName="footer" | ||
class="editor" | ||
[tools]="[]" | ||
(focusIn)="editorRef = footer.editor" | ||
> | ||
Footer | ||
</tui-editor> | ||
</form> | ||
|
||
<tui-accordion [rounded]="false"> | ||
<tui-accordion-item [open]="true"> | ||
Output | ||
|
||
<ng-template tuiAccordionItemContent> | ||
<pre><code>{{group.value|json}}</code></pre> | ||
</ng-template> | ||
</tui-accordion-item> | ||
</tui-accordion> |
17 changes: 17 additions & 0 deletions
17
projects/demo/src/app/pages/toolbar/shared/examples/1/index.less
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,17 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0; | ||
} | ||
|
||
tui-toolbar.toolbar { | ||
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
background: var(--tui-base-01); | ||
} | ||
|
||
tui-editor.editor { | ||
min-height: auto; | ||
border-radius: 0; | ||
} |
49 changes: 49 additions & 0 deletions
49
projects/demo/src/app/pages/toolbar/shared/examples/1/index.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,49 @@ | ||
import {JsonPipe} from '@angular/common'; | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
Injector, | ||
ViewEncapsulation, | ||
} from '@angular/core'; | ||
import {FormControl, FormGroup, ReactiveFormsModule} from '@angular/forms'; | ||
import type {AbstractTuiEditor} from '@taiga-ui/editor'; | ||
import { | ||
TUI_EDITOR_DEFAULT_EXTENSIONS, | ||
TUI_EDITOR_DEFAULT_TOOLS, | ||
TUI_EDITOR_EXTENSIONS, | ||
TuiEditor, | ||
TuiToolbar, | ||
} from '@taiga-ui/editor'; | ||
import {TuiAccordion} from '@taiga-ui/kit'; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [JsonPipe, ReactiveFormsModule, TuiAccordion, TuiEditor, TuiToolbar], | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation: ViewEncapsulation.None, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
providers: [ | ||
{ | ||
provide: TUI_EDITOR_EXTENSIONS, | ||
deps: [Injector], | ||
useFactory: (injector: Injector) => [ | ||
...TUI_EDITOR_DEFAULT_EXTENSIONS, | ||
import('@taiga-ui/editor').then(({tuiCreateImageEditorExtension}) => | ||
tuiCreateImageEditorExtension({injector}), | ||
), | ||
], | ||
}, | ||
], | ||
}) | ||
export default class Example { | ||
public editorRef: AbstractTuiEditor | null = null; | ||
|
||
public readonly builtInTools = TUI_EDITOR_DEFAULT_TOOLS; | ||
|
||
public readonly group = new FormGroup({ | ||
header: new FormControl(''), | ||
main: new FormControl(''), | ||
footer: new FormControl(''), | ||
}); | ||
} |
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,12 @@ | ||
<tui-doc-page | ||
header="Editor" | ||
type="components" | ||
> | ||
<tui-doc-example | ||
id="shared-toolbar" | ||
heading="One toolbar for many editors" | ||
[component]="component1" | ||
[content]="example1" | ||
[fullsize]="true" | ||
/> | ||
</tui-doc-page> |
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 @@ | ||
import {ChangeDetectionStrategy, Component} from '@angular/core'; | ||
import {TuiAddonDoc} from '@taiga-ui/addon-doc'; | ||
import {TUI_EDITOR_DEFAULT_EXTENSIONS, TUI_EDITOR_EXTENSIONS} from '@taiga-ui/editor'; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [TuiAddonDoc], | ||
templateUrl: './index.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
providers: [ | ||
{ | ||
provide: TUI_EDITOR_EXTENSIONS, | ||
useValue: TUI_EDITOR_DEFAULT_EXTENSIONS, | ||
}, | ||
], | ||
}) | ||
export default class Example { | ||
protected readonly component1 = import('./examples/1'); | ||
protected readonly example1 = { | ||
TypeScript: import('./examples/1/index.ts?raw'), | ||
HTML: import('./examples/1/index.html?raw'), | ||
LESS: import('./examples/1/index.less?raw'), | ||
}; | ||
} |
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
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.