Skip to content

Commit e125d1c

Browse files
committed
Merge remote-tracking branch 'origin/alpha' into angular-fetch-data-ssr-example
2 parents 5b514b4 + 2a41a7e commit e125d1c

File tree

9 files changed

+70
-87
lines changed

9 files changed

+70
-87
lines changed

examples/angular/column-resizing-performant/src/app/app.component.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,24 @@ import {
55
signal,
66
untracked,
77
} from '@angular/core'
8+
import type { ColumnDef, ColumnResizeMode } from '@tanstack/angular-table'
89
import {
9-
FlexRenderDirective,
1010
columnResizingFeature,
1111
columnSizingFeature,
12+
FlexRenderDirective,
1213
injectTable,
1314
tableFeatures,
1415
} from '@tanstack/angular-table'
15-
import { makeData } from './makeData'
16+
import type { Person } from './makeData'
17+
import { makeData } from './makeData'
1618
import { TableResizableCell, TableResizableHeader } from './resizable-cell'
17-
import type {Person} from './makeData';
18-
import type { ColumnDef, ColumnResizeMode } from '@tanstack/angular-table'
1919

2020
const _features = tableFeatures({
2121
columnSizingFeature,
22-
columnResizingFeature
22+
columnResizingFeature,
2323
})
2424

25-
const defaultColumns: Array<
26-
ColumnDef<
27-
typeof _features,
28-
Person
29-
>
30-
> = [
25+
const defaultColumns: Array<ColumnDef<typeof _features, Person>> = [
3126
{
3227
header: 'Name',
3328
footer: (props) => props.column.id,

examples/angular/expanding/src/app/expandable-cell.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class ExpandableHeaderCell<T extends RowData> {
3232
readonly context = injectFlexRenderContext<
3333
HeaderContext<
3434
{
35-
rowExpandingFeature: typeof rowExpandingFeature,
35+
rowExpandingFeature: typeof rowExpandingFeature
3636
rowSelectionFeature: typeof rowSelectionFeature
3737
},
3838
T,
@@ -43,7 +43,7 @@ export class ExpandableHeaderCell<T extends RowData> {
4343
readonly label = input.required<string>()
4444

4545
get table() {
46-
return this.context.table;
46+
return this.context.table
4747
}
4848
}
4949

@@ -83,10 +83,16 @@ export class ExpandableHeaderCell<T extends RowData> {
8383
`,
8484
})
8585
export class ExpandableCell<T extends RowData> {
86-
readonly context = injectFlexRenderContext<CellContext<{
87-
rowExpandingFeature: typeof rowExpandingFeature,
88-
rowSelectionFeature: typeof rowSelectionFeature
89-
}, T, unknown>>()
86+
readonly context = injectFlexRenderContext<
87+
CellContext<
88+
{
89+
rowExpandingFeature: typeof rowExpandingFeature
90+
rowSelectionFeature: typeof rowSelectionFeature
91+
},
92+
T,
93+
unknown
94+
>
95+
>()
9096

9197
get row() {
9298
return this.context.row

examples/angular/remote-data/angular.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,11 @@
2525
"outputPath": "dist/remote-data",
2626
"index": "src/index.html",
2727
"browser": "src/main.ts",
28-
"polyfills": [
29-
"zone.js"
30-
],
28+
"polyfills": ["zone.js"],
3129
"tsConfig": "tsconfig.app.json",
3230
"inlineStyleLanguage": "scss",
33-
"assets": [
34-
"src/favicon.ico",
35-
"src/assets"
36-
],
37-
"styles": [
38-
"src/styles.scss"
39-
],
31+
"assets": ["src/favicon.ico", "src/assets"],
32+
"styles": ["src/styles.scss"],
4033
"scripts": []
4134
},
4235
"configurations": {
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import { mergeApplicationConfig } from '@angular/core';
2-
import { provideServerRendering } from '@angular/platform-server';
3-
import { provideServerRouting } from '@angular/ssr';
4-
import { appConfig } from './app.config';
5-
import { serverRoutes } from './app.routes.server';
6-
import type { ApplicationConfig } from '@angular/core';
1+
import { mergeApplicationConfig } from '@angular/core'
2+
import { provideServerRendering } from '@angular/platform-server'
3+
import { provideServerRouting } from '@angular/ssr'
4+
import { appConfig } from './app.config'
5+
import { serverRoutes } from './app.routes.server'
6+
import type { ApplicationConfig } from '@angular/core'
77

88
const serverConfig: ApplicationConfig = {
9-
providers: [
10-
provideServerRendering(),
11-
provideServerRouting(serverRoutes)
12-
]
13-
};
9+
providers: [provideServerRendering(), provideServerRouting(serverRoutes)],
10+
}
1411

15-
export const config = mergeApplicationConfig(appConfig, serverConfig);
12+
export const config = mergeApplicationConfig(appConfig, serverConfig)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { bootstrapApplication } from '@angular/platform-browser';
2-
import { AppComponent } from './app/app.component';
3-
import { config } from './app/app.config.server';
1+
import { bootstrapApplication } from '@angular/platform-browser'
2+
import { AppComponent } from './app/app.component'
3+
import { config } from './app/app.config.server'
44

5-
const bootstrap = () => bootstrapApplication(AppComponent, config);
5+
const bootstrap = () => bootstrapApplication(AppComponent, config)
66

7-
export default bootstrap;
7+
export default bootstrap

examples/angular/remote-data/src/server.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import {
33
createNodeRequestHandler,
44
isMainModule,
55
writeResponseToNodeResponse,
6-
} from '@angular/ssr/node';
7-
import express from 'express';
8-
import { dirname, resolve } from 'node:path';
9-
import { fileURLToPath } from 'node:url';
6+
} from '@angular/ssr/node'
7+
import express from 'express'
8+
import { dirname, resolve } from 'node:path'
9+
import { fileURLToPath } from 'node:url'
1010

11-
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
12-
const browserDistFolder = resolve(serverDistFolder, '../browser');
11+
const serverDistFolder = dirname(fileURLToPath(import.meta.url))
12+
const browserDistFolder = resolve(serverDistFolder, '../browser')
1313

14-
const app = express();
15-
const angularApp = new AngularNodeAppEngine();
14+
const app = express()
15+
const angularApp = new AngularNodeAppEngine()
1616

1717
/**
1818
* Example Express Rest API endpoints can be defined here.
@@ -35,7 +35,7 @@ app.use(
3535
index: false,
3636
redirect: false,
3737
}),
38-
);
38+
)
3939

4040
/**
4141
* Handle all other requests by rendering the Angular application.
@@ -46,21 +46,21 @@ app.use('/**', (req, res, next) => {
4646
.then((response) =>
4747
response ? writeResponseToNodeResponse(response, res) : next(),
4848
)
49-
.catch(next);
50-
});
49+
.catch(next)
50+
})
5151

5252
/**
5353
* Start the server if this module is the main entry point.
5454
* The server listens on the port defined by the `PORT` environment variable, or defaults to 4000.
5555
*/
5656
if (isMainModule(import.meta.url)) {
57-
const port = process.env['PORT'] || 4000;
57+
const port = process.env['PORT'] || 4000
5858
app.listen(port, () => {
59-
console.log(`Node Express server listening on http://localhost:${port}`);
60-
});
59+
console.log(`Node Express server listening on http://localhost:${port}`)
60+
})
6161
}
6262

6363
/**
6464
* The request handler used by the Angular CLI (dev-server and during build).
6565
*/
66-
export const reqHandler = createNodeRequestHandler(app);
66+
export const reqHandler = createNodeRequestHandler(app)

examples/angular/remote-data/tsconfig.app.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,8 @@
33
"extends": "./tsconfig.json",
44
"compilerOptions": {
55
"outDir": "./out-tsc/app",
6-
"types": [
7-
"node"
8-
]
6+
"types": ["node"]
97
},
10-
"files": [
11-
"src/main.ts",
12-
"src/main.server.ts",
13-
"src/server.ts"
14-
],
8+
"files": ["src/main.ts", "src/main.server.ts", "src/server.ts"],
159
"include": ["src/**/*.d.ts"]
1610
}

examples/angular/row-dnd/src/app/app.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const defaultColumns: Array<
2525
ColumnDef<
2626
{
2727
rowPaginationFeature: typeof rowPaginationFeature
28-
columnSizingFeature: typeof columnSizingFeature,
29-
columnVisibilityFeature: typeof columnVisibilityFeature,
28+
columnSizingFeature: typeof columnSizingFeature
29+
columnVisibilityFeature: typeof columnVisibilityFeature
3030
},
3131
Person
3232
>
@@ -79,7 +79,7 @@ export class AppComponent {
7979
_features: {
8080
rowPaginationFeature,
8181
columnSizingFeature,
82-
columnVisibilityFeature
82+
columnVisibilityFeature,
8383
},
8484
_rowModels: {
8585
paginatedRowModel: createPaginatedRowModel(),

examples/angular/sub-components/src/app/app.component.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
ChangeDetectionStrategy,
3-
Component,
4-
signal,
5-
} from '@angular/core'
1+
import { ChangeDetectionStrategy, Component, signal } from '@angular/core'
62
import {
73
FlexRenderDirective,
84
columnVisibilityFeature,
@@ -13,18 +9,20 @@ import {
139
} from '@tanstack/angular-table'
1410
import { ReactiveFormsModule } from '@angular/forms'
1511
import { JsonPipe, NgTemplateOutlet } from '@angular/common'
16-
import { makeData } from './makeData'
12+
import { makeData } from './makeData'
1713
import { ExpandableCell, ExpanderCell } from './expandable-cell'
18-
import type {Person} from './makeData';
19-
import type {
20-
ColumnDef,
21-
ExpandedState,
22-
} from '@tanstack/angular-table'
14+
import type { Person } from './makeData'
15+
import type { ColumnDef, ExpandedState } from '@tanstack/angular-table'
2316

24-
const columns: Array<ColumnDef<{
25-
rowExpandingFeature: typeof rowExpandingFeature,
26-
columnVisibilityFeature: typeof columnVisibilityFeature
27-
}, Person>> = [
17+
const columns: Array<
18+
ColumnDef<
19+
{
20+
rowExpandingFeature: typeof rowExpandingFeature
21+
columnVisibilityFeature: typeof columnVisibilityFeature
22+
},
23+
Person
24+
>
25+
> = [
2826
{
2927
header: 'Name',
3028
footer: (props) => props.column.id,
@@ -107,12 +105,12 @@ const columns: Array<ColumnDef<{
107105
})
108106
export class AppComponent {
109107
readonly data = signal<Array<Person>>(makeData(10))
110-
readonly expanded = signal<ExpandedState>({});
108+
readonly expanded = signal<ExpandedState>({})
111109

112110
tableHelper = createTableHelper({
113111
_features: {
114112
rowExpandingFeature: rowExpandingFeature,
115-
columnVisibilityFeature: columnVisibilityFeature
113+
columnVisibilityFeature: columnVisibilityFeature,
116114
},
117115
_rowModels: {
118116
expandedRowModel: createExpandedRowModel(),

0 commit comments

Comments
 (0)