Skip to content

Commit b2c9f81

Browse files
committed
feat: migrated on new angular control flow (#DS-2872)
1 parent b4e92b4 commit b2c9f81

File tree

149 files changed

+3381
-3472
lines changed

Some content is hidden

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

149 files changed

+3381
-3472
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/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.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+
}
Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
<div class="docs-live-example__container">
2-
<div
3-
*ngIf="exampleData"
4-
class="docs-live-example__example"
5-
>
6-
<ng-template
7-
*ngIf="exampleComponentType && exampleModuleFactory"
8-
[ngComponentOutlet]="exampleComponentType"
9-
[ngComponentOutletNgModuleFactory]="exampleModuleFactory"
10-
/>
11-
</div>
2+
@if (exampleData) {
3+
<div class="docs-live-example__example">
4+
@if (exampleComponentType && exampleModuleFactory) {
5+
<ng-template
6+
[ngComponentOutlet]="exampleComponentType"
7+
[ngComponentOutletNgModuleFactory]="exampleModuleFactory"
8+
/>
9+
}
10+
</div>
11+
}
1212

1313
<div class="docs-live-example__footer">
1414
<span
1515
kbq-link
1616
pseudo
17-
[ngSwitch]="isSourceShown"
1817
(click)="toggleSourceView()"
1918
(keydown.enter)="toggleSourceView()"
2019
>
@@ -25,18 +24,17 @@
2524
</div>
2625
</div>
2726

28-
<ng-container *ngIf="exampleData; else lostExample">
29-
<kbq-code-block
30-
*ngIf="isSourceShown"
31-
[codeFiles]="this.files"
32-
[codeFiles]="files"
33-
[filled]="true"
34-
[filled]="true"
35-
[lineNumbers]="true"
36-
/>
37-
</ng-container>
38-
39-
<ng-template #lostExample>
27+
@if (exampleData) {
28+
@if (isSourceShown) {
29+
<kbq-code-block
30+
[codeFiles]="this.files"
31+
[codeFiles]="files"
32+
[filled]="true"
33+
[filled]="true"
34+
[lineNumbers]="true"
35+
/>
36+
}
37+
} @else {
4038
<div class="kbq-alert kbq-alert_error kbq-alert_dismissible kbq-markdown">
4139
<span>
4240
Oops, this code example is lost... But you can help us find it! Just send a Pull Request to this repository:
@@ -48,4 +46,4 @@
4846
</a>
4947
</span>
5048
</div>
51-
</ng-template>
49+
}

0 commit comments

Comments
 (0)