Skip to content

Commit d8e3b90

Browse files
authored
feat: migrated on new angular control flow (#DS-2872) (koobiq#284)
1 parent 3a05349 commit d8e3b90

File tree

279 files changed

+3653
-3874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+3653
-3874
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ const config = {
9999
'@angular-eslint/template/click-events-have-key-events': 0,
100100
'@angular-eslint/template/interactive-supports-focus': 0,
101101
'@angular-eslint/template/label-has-associated-control': 0,
102-
'@angular-eslint/template/prefer-self-closing-tags': 1
102+
'@angular-eslint/template/prefer-self-closing-tags': 1,
103+
'@angular-eslint/template/prefer-control-flow': 1
103104
}
104105
},
105106
{
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
<div
2-
*ngFor="let anchor of anchors"
3-
class="docs-anchors__element docs-anchors__element_{{ anchor.level }}"
4-
[ngClass]="{ 'docs-anchors__element_active': anchor.active }"
5-
>
6-
<a
7-
class="docs-anchors__link"
8-
[fragment]="anchor.href"
9-
[routerLink]="this.pathName"
10-
(click)="scrollIntoView(anchor)"
1+
@for (anchor of anchors; track anchor) {
2+
<div
3+
class="docs-anchors__element docs-anchors__element_{{ anchor.level }}"
4+
[ngClass]="{ 'docs-anchors__element_active': anchor.active }"
115
>
12-
{{ anchor.name }}
13-
</a>
14-
</div>
6+
<a
7+
class="docs-anchors__link"
8+
[fragment]="anchor.href"
9+
[routerLink]="this.pathName"
10+
(click)="scrollIntoView(anchor)"
11+
>
12+
{{ anchor.name }}
13+
</a>
14+
</div>
15+
}

apps/docs/src/app/components/anchors/anchors.module.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { CommonModule } from '@angular/common';
1+
import { NgClass } from '@angular/common';
22
import { NgModule } from '@angular/core';
33
import { RouterModule } from '@angular/router';
44
import { AnchorsComponent } from './anchors.component';
55
import { HeaderDirective } from './header.directive';
66

77
@NgModule({
8-
imports: [CommonModule, RouterModule],
8+
imports: [
9+
RouterModule,
10+
NgClass
11+
],
912
exports: [AnchorsComponent, HeaderDirective],
1013
declarations: [AnchorsComponent, HeaderDirective]
1114
})

apps/docs/src/app/components/component-viewer/component-example.template.html

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
<div
2-
*ngIf="documentLost"
3-
class="layout-margin-top-xl kbq-alert kbq-alert_error kbq-alert_dismissible"
4-
>
5-
<span>
6-
Oops, {{ componentDocItem.id }} component seems to be lost... But you can help us find it! Just send a Pull
7-
Request to this repository:
8-
<a
9-
href="#"
10-
class="kbq-markdown__a"
11-
>
12-
Koobiq
13-
</a>
14-
</span>
15-
</div>
1+
@if (documentLost) {
2+
<div class="layout-margin-top-xl kbq-alert kbq-alert_error kbq-alert_dismissible">
3+
<span>
4+
Oops, {{ componentDocItem.id }} component seems to be lost... But you can help us find it! Just send a Pull
5+
Request to this repository:
6+
<a
7+
href="#"
8+
class="kbq-markdown__a"
9+
>
10+
Koobiq
11+
</a>
12+
</span>
13+
</div>
14+
}
1615

17-
<doc-example-viewer
18-
*ngIf="!documentLost"
19-
[documentUrl]="docItemUrl"
20-
(contentRendered)="scrollToSelectedContentSection()"
21-
(contentRenderFailed)="showDocumentLostAlert()"
22-
/>
16+
@if (!documentLost) {
17+
<doc-example-viewer
18+
[documentUrl]="docItemUrl"
19+
(contentRendered)="scrollToSelectedContentSection()"
20+
(contentRenderFailed)="showDocumentLostAlert()"
21+
/>
22+
}
2323

2424
<div class="sticky-wrapper">
2525
<docs-anchors [headerSelectors]="'.docs-header-link'" />

apps/docs/src/app/components/component-viewer/component-overview.template.html

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
<div
2-
*ngIf="documentLost"
3-
class="layout-margin-top-xl kbq-alert kbq-alert_error kbq-alert_dismissible"
4-
>
5-
<span>
6-
Oops, {{ componentDocItem.id }} component seems to be lost... But you can help us find it! Just send a Pull
7-
Request to this repository:
8-
<a
9-
href="#"
10-
class="kbq-markdown__a"
11-
>
12-
Koobiq
13-
</a>
14-
</span>
15-
</div>
1+
@if (documentLost) {
2+
<div class="layout-margin-top-xl kbq-alert kbq-alert_error kbq-alert_dismissible">
3+
<span>
4+
Oops, {{ componentDocItem.id }} component seems to be lost... But you can help us find it! Just send a Pull
5+
Request to this repository:
6+
<a
7+
href="#"
8+
class="kbq-markdown__a"
9+
>
10+
Koobiq
11+
</a>
12+
</span>
13+
</div>
14+
}
1615

17-
<docs-live-example
18-
*ngIf="!documentLost"
19-
[documentUrl]="docItemUrl"
20-
(contentRendered)="scrollToSelectedContentSection()"
21-
(contentRenderFailed)="showDocumentLostAlert()"
22-
/>
16+
@if (!documentLost) {
17+
<docs-live-example
18+
[documentUrl]="docItemUrl"
19+
(contentRendered)="scrollToSelectedContentSection()"
20+
(contentRenderFailed)="showDocumentLostAlert()"
21+
/>
22+
}
2323

2424
<div class="sticky-wrapper">
2525
<docs-anchors [headerSelectors]="'.docs-header-link'" />

apps/docs/src/app/components/component-viewer/component-viewer.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { CommonModule } from '@angular/common';
21
import { NgModule } from '@angular/core';
32
import { RouterModule } from '@angular/router';
43
import { KbqButtonModule } from '@koobiq/components/button';
@@ -38,7 +37,6 @@ import {
3837
RouterModule,
3938
DocsLiveExampleModule,
4039
DocExampleViewerModule,
41-
CommonModule,
4240
SidenavModule,
4341
NavbarModule,
4442
KbqIconModule,

apps/docs/src/app/components/component-viewer/component-viewer.template.html

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,35 @@
1313
{{ docItem.name }}
1414
</div>
1515
<div class="docs-component-navbar layout-row layout-padding-top-s">
16-
<nav
17-
*ngIf="!docItem.isGuide"
18-
kbq-tab-nav-bar
19-
>
20-
<a
21-
kbq-tab-link
22-
routerLinkActive="kbq-selected"
23-
[routerLink]="'overview'"
24-
>
25-
Обзор
26-
</a>
27-
<a
28-
*ngIf="docItem.hasApi"
29-
kbq-tab-link
30-
routerLinkActive="kbq-selected"
31-
[routerLink]="'api'"
32-
>
33-
API
34-
</a>
35-
<a
36-
*ngIf="docItem.hasExamples"
37-
kbq-tab-link
38-
routerLinkActive="kbq-selected"
39-
[routerLink]="'examples'"
40-
>
41-
Примеры
42-
</a>
43-
</nav>
44-
<!-- на будущее-->
45-
<!-- <div class="docs-component-navbar__links">-->
46-
<!-- <button kbq-button [kbqStyle]="'transparent'" [color]="'theme'">-->
47-
<!-- <i kbq-icon="pt-icons-file-code_16"></i>-->
48-
<!-- Исходный код-->
49-
<!-- </button>-->
50-
<!---->
51-
<!-- <button kbq-button [kbqStyle]="'transparent'" [color]="'theme'">-->
52-
<!-- <i kbq-icon="pt-icons-file-code_16"></i>-->
53-
<!-- Изменить страницу-->
54-
<!-- </button>-->
55-
<!-- </div>-->
16+
@if (!docItem.isGuide) {
17+
<nav kbq-tab-nav-bar>
18+
<a
19+
kbq-tab-link
20+
routerLinkActive="kbq-selected"
21+
[routerLink]="'overview'"
22+
>
23+
Обзор
24+
</a>
25+
@if (docItem.hasApi) {
26+
<a
27+
kbq-tab-link
28+
routerLinkActive="kbq-selected"
29+
[routerLink]="'api'"
30+
>
31+
API
32+
</a>
33+
}
34+
@if (docItem.hasExamples) {
35+
<a
36+
kbq-tab-link
37+
routerLinkActive="kbq-selected"
38+
[routerLink]="'examples'"
39+
>
40+
Примеры
41+
</a>
42+
}
43+
</nav>
44+
}
5645
</div>
5746
</div>
5847

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
<span
2-
*ngIf="isLabelSuccessVisible"
3-
disabled
4-
kbq-link
5-
pseudo
6-
>
7-
<i class="mc mc-check_16"></i>
8-
<span class="kbq-link__text">{{ successLabelText }}</span>
9-
</span>
1+
@if (isLabelSuccessVisible) {
2+
<span
3+
disabled
4+
kbq-link
5+
pseudo
6+
>
7+
<i class="mc mc-check_16"></i>
8+
<span class="kbq-link__text">{{ successLabelText }}</span>
9+
</span>
10+
}
1011

11-
<span
12-
*ngIf="!isLabelSuccessVisible"
13-
kbq-link
14-
pseudo
15-
>
16-
<i
17-
class="mc kbq-copy_16"
18-
(click)="copyContent()"
19-
></i>
20-
</span>
12+
@if (!isLabelSuccessVisible) {
13+
<span
14+
kbq-link
15+
pseudo
16+
>
17+
<i
18+
class="mc kbq-copy_16"
19+
(click)="copyContent()"
20+
></i>
21+
</span>
22+
}

apps/docs/src/app/components/copy-button/copy-button.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Clipboard } from '@angular/cdk/clipboard';
2-
import { CommonModule } from '@angular/common';
32
import {
43
ChangeDetectionStrategy,
54
ChangeDetectorRef,
@@ -50,7 +49,7 @@ export class CopyButton {
5049
}
5150

5251
@NgModule({
53-
imports: [CommonModule, KbqIconModule, KbqLinkModule],
52+
imports: [KbqIconModule, KbqLinkModule],
5453
exports: [CopyButton],
5554
declarations: [CopyButton]
5655
})

apps/docs/src/app/components/doc-example-viewer/doc-example-viewer-module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { PortalModule } from '@angular/cdk/portal';
2-
import { CommonModule } from '@angular/common';
32
import { NgModule } from '@angular/core';
43
import { KbqButtonModule } from '@koobiq/components/button';
54
import { KbqLinkModule } from '@koobiq/components/link';
@@ -12,7 +11,6 @@ import { DocExampleViewer } from './doc-example-viewer';
1211
// ExampleViewer is included in the DocViewerModule because they have a circular dependency.
1312
@NgModule({
1413
imports: [
15-
CommonModule,
1614
KbqButtonModule,
1715
KbqTabsModule,
1816
KbqLinkModule,

0 commit comments

Comments
 (0)