Skip to content

Commit

Permalink
feat: angular 19 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafnik committed Dec 9, 2024
1 parent b8772a2 commit c3dd6c3
Show file tree
Hide file tree
Showing 30 changed files with 2,246 additions and 3,262 deletions.
3 changes: 2 additions & 1 deletion apps/dfx-bootstrap-icons-demo/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"prefix": "app",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
Expand Down
1 change: 0 additions & 1 deletion apps/dfx-bootstrap-icons-demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ import { ThemePicker } from 'playground-lib';
--bs-btn-hover-border-color: var(--bs-btn-hover-bg);
}
`,
standalone: true,
imports: [NgOptimizedImage, RouterLink, RouterOutlet, BiComponent, ThemePicker],
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'app-root',
Expand Down
1 change: 0 additions & 1 deletion apps/dfx-bootstrap-icons-demo/src/app/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ import { injectWindow } from 'dfx-helper';
transition: all 0.2s ease-in-out;
}
`,
standalone: true,
imports: [BiComponent, ReactiveFormsModule, NgClass, LoadIconComponent],
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'app-home',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { BiComponent, provideBi, withCDN, withIcons } from 'dfx-bootstrap-icons'
}
</div>
`,
standalone: true,
imports: [BiComponent],
providers: [provideBi(withCDN('https://playground.dafnik.me/bootstrap-icons/icons'))],
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
5 changes: 4 additions & 1 deletion apps/dfx-bootstrap-table-demo/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"]
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/prefer-standalone": "off"
}
},
{
"files": ["*.html"],
Expand Down
1 change: 0 additions & 1 deletion apps/dfx-bootstrap-table-demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ThemePicker } from 'playground-lib';
@Component({
selector: 'app-root',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
template: `
<div class="p-5">
<div class="d-flex gap-3 align-items-center mb-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { toSignal } from '@angular/core/rxjs-interop';
@Component({
selector: 'app-all',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [DfxTableModule, DfxSortModule, DfxPaginationModule, ReactiveFormsModule],
template: `
<h1>Everything (filtering, sorting and pagination)</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { toSignal } from '@angular/core/rxjs-interop';
@Component({
selector: 'app-filtering',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [DfxTableModule, ReactiveFormsModule],
template: `
<h1>Everything (filtering, sorting and pagination)</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Helper } from '../Helper';
@Component({
selector: 'app-all',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [DfxTableModule, DfxSortModule],
template: `
<h1>Ordering</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Helper } from '../Helper';
@Component({
selector: 'app-paginator',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [DfxTableModule, DfxPaginationModule],
template: `
<h1>Pagination</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Helper } from '../Helper';
@Component({
selector: 'app-simple',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [DfxTableModule],
template: `
<h1>Simple</h1>
Expand Down
5 changes: 4 additions & 1 deletion apps/dfx-qrcode-demo/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"]
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/prefer-standalone": "off"
}
},
{
"files": ["*.html"],
Expand Down
1 change: 0 additions & 1 deletion apps/dfx-qrcode-demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { BiComponent, copy, provideBi, withIcons } from 'dfx-bootstrap-icons';
import { ThemePicker } from 'playground-lib';

@Component({
standalone: true,
selector: 'app-root',
templateUrl: './app.component.html',
styles: [
Expand Down
3 changes: 2 additions & 1 deletion apps/playground/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"prefix": "app",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
Expand Down
3 changes: 2 additions & 1 deletion libs/dfx-bootstrap-icons/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/component-class-suffix": "off"
"@angular-eslint/component-class-suffix": "off",
"@angular-eslint/prefer-standalone": "off"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions libs/dfx-bootstrap-table/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"@angular-eslint/no-input-rename": "off",
"@angular-eslint/no-inputs-metadata-property": "off",
"@angular-eslint/no-output-rename": "off",
"@angular-eslint/no-host-metadata-property": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/ban-types": "off"
"@typescript-eslint/ban-types": "off",
"@angular-eslint/prefer-standalone": "off"
},
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { FormsModule } from '@angular/forms';
import { NgModule } from '@angular/core';

import { NgbPaginator } from './paginator';
import { NGB_PAGINATOR_INTL_PROVIDER } from './paginator-intl.service';

@NgModule({
imports: [FormsModule],
imports: [NgbPaginator],
exports: [NgbPaginator],
declarations: [NgbPaginator],
providers: [NGB_PAGINATOR_INTL_PROVIDER],
})
export class DfxPaginationModule {}
2 changes: 2 additions & 0 deletions libs/dfx-bootstrap-table/src/lib/paginator/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Subscription } from 'rxjs';

import { HasInitialized, mixinInitialized } from '../core/initialized';
import { NgbPaginatorIntl } from './paginator-intl.service';
import { FormsModule } from '@angular/forms';

export type PageEvent = {
pageIndex: number;
Expand Down Expand Up @@ -48,6 +49,7 @@ const _NgbPaginatorMixinBase = mixinInitialized(class {});
templateUrl: './paginator.html',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
imports: [FormsModule],
styles: `
.ws-nowrap {
white-space: nowrap;
Expand Down
7 changes: 4 additions & 3 deletions libs/dfx-bootstrap-table/src/lib/sort/sort-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import { NgbSort } from './sort';
import { NGB_SORT_HEADER_INTL_PROVIDER } from './sort-header-intl';
import { CommonModule } from '@angular/common';

const EXPORTED_DECLARATIONS = [NgbSort, NgbSortHeader];

@NgModule({
imports: [CommonModule],
exports: [NgbSort, NgbSortHeader],
declarations: [NgbSort, NgbSortHeader],
imports: EXPORTED_DECLARATIONS,
exports: EXPORTED_DECLARATIONS,
providers: [NGB_SORT_HEADER_INTL_PROVIDER],
})
export class DfxSortModule {}
3 changes: 0 additions & 3 deletions libs/dfx-bootstrap-table/src/lib/table/row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export class NgbRowDef<T> extends CdkRowDef<T> {}
encapsulation: ViewEncapsulation.None,
exportAs: 'ngbHeaderRow',
providers: [{ provide: CdkHeaderRow, useExisting: NgbHeaderRow }],
standalone: true,
imports: [CdkCellOutlet],
})
export class NgbHeaderRow extends CdkHeaderRow {}
Expand All @@ -99,7 +98,6 @@ export class NgbHeaderRow extends CdkHeaderRow {}
encapsulation: ViewEncapsulation.None,
exportAs: 'ngbFooterRow',
providers: [{ provide: CdkFooterRow, useExisting: NgbFooterRow }],
standalone: true,
imports: [CdkCellOutlet],
})
export class NgbFooterRow extends CdkFooterRow {}
Expand All @@ -117,7 +115,6 @@ export class NgbFooterRow extends CdkFooterRow {}
encapsulation: ViewEncapsulation.None,
exportAs: 'ngbRow',
providers: [{ provide: CdkRow, useExisting: NgbRow }],
standalone: true,
imports: [CdkCellOutlet],
})
export class NgbRow extends CdkRow {}
Expand Down
2 changes: 0 additions & 2 deletions libs/dfx-bootstrap-table/src/lib/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { _DisposeViewRepeaterStrategy, _RecycleViewRepeaterStrategy, _VIEW_REPEA
@Directive({
selector: 'ngb-table[recycleRows], table[ngb-table][recycleRows]',
providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }],
standalone: true,
})
export class NgbRecycleRows {}

Expand Down Expand Up @@ -84,7 +83,6 @@ export class NgbRecycleRows {}
// tslint:disable-next-line:validate-decorators
changeDetection: ChangeDetectionStrategy.Default,
imports: [HeaderRowOutlet, DataRowOutlet, NoDataRowOutlet, FooterRowOutlet],
standalone: true,
})
export class NgbTable<T> extends CdkTable<T> {
/** Overrides the need to add position: sticky on every sticky cell element in `CdkTable`. */
Expand Down
1 change: 0 additions & 1 deletion libs/dfx-bootstrap-table/src/lib/table/text-column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import { NgbCell, NgbCellDef, NgbColumnDef, NgbHeaderCell, NgbHeaderCellDef } fr
// an ExpressionChangedAfterItHasBeenCheckedError).
// tslint:disable-next-line:validate-decorators
changeDetection: ChangeDetectionStrategy.Default,
standalone: true,
imports: [NgbColumnDef, NgbHeaderCellDef, NgbHeaderCell, NgbCellDef, NgbCell],
})
export class NgbTextColumn<T> extends CdkTextColumn<T> {}
3 changes: 2 additions & 1 deletion libs/dfx-helper/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"@angular-eslint/directive-class-suffix": "off",
"@angular-eslint/component-class-suffix": "off",
"@angular-eslint/no-input-rename": "off",
"@angular-eslint/no-inputs-metadata-property": "off"
"@angular-eslint/no-inputs-metadata-property": "off",
"@angular-eslint/prefer-standalone": "off"
},
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"]
},
Expand Down
3 changes: 2 additions & 1 deletion libs/dfx-openapi/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"prefix": "lib",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
Expand Down
5 changes: 4 additions & 1 deletion libs/dfx-qrcode/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"]
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/prefer-standalone": "off"
}
},
{
"files": ["*.html"],
Expand Down
5 changes: 4 additions & 1 deletion libs/playground-lib/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"overrides": [
{
"files": ["*.ts"],
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"]
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/prefer-standalone": "off"
}
},
{
"files": ["*.html"],
Expand Down
1 change: 0 additions & 1 deletion libs/playground-lib/src/lib/theme-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ interface Theme {
}
`,
selector: 'theme-picker',
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ReactiveFormsModule, BiComponent],
providers: [provideBi(withCDN('https://playground.dafnik.me/bootstrap-icons/icons'), withColor('#0000FF'))],
Expand Down
Loading

0 comments on commit c3dd6c3

Please sign in to comment.