Skip to content

Commit 4b7bbbe

Browse files
authored
Add autosize virtual-scroll and popover edit to universal test app (angular#28857)
* build: add google-maps & youtube-player paths to tsconfig * test: add popover-edit to universal-app * test: add autosize virtual-scroll to universal-app
1 parent 7165a45 commit 4b7bbbe

File tree

4 files changed

+142
-97
lines changed

4 files changed

+142
-97
lines changed

src/universal-app/BUILD.bazel

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test")
22
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "npm_package_bin")
33
load("//src/cdk:config.bzl", "CDK_TARGETS")
44
load("//src/cdk-experimental:config.bzl", "CDK_EXPERIMENTAL_TARGETS")
5+
load("//src/components-examples:config.bzl", "ALL_EXAMPLES")
56
load("//src/material:config.bzl", "MATERIAL_TARGETS")
67
load("//src/material-experimental:config.bzl", "MATERIAL_EXPERIMENTAL_TARGETS")
78
load("//tools:defaults.bzl", "devmode_esbuild", "http_server", "ng_e2e_test_library", "ng_module", "protractor_web_test_suite", "sass_binary", "ts_library")
@@ -21,7 +22,7 @@ ng_module(
2122
"//src/google-maps",
2223
"//src/youtube-player",
2324
"@npm//@angular/platform-server",
24-
] + CDK_TARGETS + CDK_EXPERIMENTAL_TARGETS + MATERIAL_TARGETS + MATERIAL_EXPERIMENTAL_TARGETS,
25+
] + CDK_TARGETS + CDK_EXPERIMENTAL_TARGETS + MATERIAL_TARGETS + MATERIAL_EXPERIMENTAL_TARGETS + ALL_EXAMPLES,
2526
)
2627

2728
ts_library(

src/universal-app/kitchen-sink/kitchen-sink.html

+105-69
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ <h2>Autocomplete</h2>
22

33
<mat-form-field>
44
<mat-label>Computer scientists</mat-label>
5-
<input matInput [matAutocomplete]="autocomplete">
5+
<input matInput [matAutocomplete]="autocomplete" />
66
</mat-form-field>
77

88
<mat-autocomplete #autocomplete>
@@ -49,9 +49,7 @@ <h3>Standalone</h3>
4949

5050
<h3>Card</h3>
5151

52-
<mat-card>
53-
Simple card
54-
</mat-card>
52+
<mat-card> Simple card </mat-card>
5553

5654
<mat-card>
5755
<mat-card-title>Complicated card</mat-card-title>
@@ -64,9 +62,7 @@ <h3>Card</h3>
6462
<button mat-button>LIKE</button>
6563
<button mat-button>SHARE</button>
6664
</mat-card-actions>
67-
<mat-card-footer>
68-
Hurray
69-
</mat-card-footer>
65+
<mat-card-footer> Hurray </mat-card-footer>
7066
</mat-card>
7167

7268
<h2>Checkbox</h2>
@@ -95,15 +91,21 @@ <h2>Chips</h2>
9591
<h2>Datepicker</h2>
9692

9793
<mat-form-field>
98-
<input type="text" matInput [matDatepicker]="birthday" placeholder="Birthday">
94+
<input type="text" matInput [matDatepicker]="birthday" placeholder="Birthday" />
9995
<mat-datepicker-toggle matSuffix [for]="birthday"></mat-datepicker-toggle>
10096
<mat-datepicker #birthday></mat-datepicker>
10197
</mat-form-field>
10298

10399
<h3>Disabled datepicker</h3>
104100

105101
<mat-form-field>
106-
<input type="text" disabled matInput [matDatepicker]="departureDate" placeholder="Departure date">
102+
<input
103+
type="text"
104+
disabled
105+
matInput
106+
[matDatepicker]="departureDate"
107+
placeholder="Departure date"
108+
/>
107109
<mat-datepicker-toggle matSuffix [for]="departureDate"></mat-datepicker-toggle>
108110
<mat-datepicker #departureDate></mat-datepicker>
109111
</mat-form-field>
@@ -127,18 +129,18 @@ <h2>Input</h2>
127129

128130
<mat-form-field>
129131
<mat-label>Label</mat-label>
130-
<input matInput value="Initial value">
132+
<input matInput value="Initial value" />
131133
</mat-form-field>
132134
<mat-form-field>
133-
<input matInput placeholder="Placeholder">
135+
<input matInput placeholder="Placeholder" />
134136
</mat-form-field>
135137
<mat-form-field floatLabel="always">
136138
<mat-label>Always floating</mat-label>
137-
<input matInput>
139+
<input matInput />
138140
</mat-form-field>
139141
<mat-form-field appearance="outline">
140142
<mat-label>Label</mat-label>
141-
<input matInput>
143+
<input matInput />
142144
</mat-form-field>
143145
<mat-form-field>
144146
<mat-label>Label</mat-label>
@@ -150,34 +152,34 @@ <h2>Input</h2>
150152
</mat-form-field>
151153
<mat-form-field appearance="outline">
152154
<mat-label>Label</mat-label>
153-
<input matInput value="Initial">
155+
<input matInput value="Initial" />
154156
</mat-form-field>
155157

156158
<h3>Prefix and Suffix</h3>
157159
<mat-form-field appearance="outline">
158160
<span matPrefix>+123&nbsp;</span>
159161
<mat-label>Phone Number</mat-label>
160-
<input matInput>
162+
<input matInput />
161163
</mat-form-field>
162164
<mat-form-field>
163165
<span matPrefix>+123&nbsp;</span>
164166
<mat-label>Phone Number</mat-label>
165-
<input matInput>
167+
<input matInput />
166168
</mat-form-field>
167169
<mat-form-field appearance="outline">
168170
<span matPrefix>+123&nbsp;</span>
169171
<mat-label>Phone Number</mat-label>
170-
<input matInput>
172+
<input matInput />
171173
</mat-form-field>
172174
<mat-form-field appearance="outline">
173175
<mat-icon matPrefix>calendar_today</mat-icon>
174176
<mat-label>Name</mat-label>
175-
<input matInput>
177+
<input matInput />
176178
</mat-form-field>
177179
<mat-form-field>
178180
<mat-icon matPrefix>calendar_today</mat-icon>
179181
<mat-label>Name</mat-label>
180-
<input matInput>
182+
<input matInput />
181183
</mat-form-field>
182184

183185
<h2>List</h2>
@@ -286,14 +288,14 @@ <h2>Slide-toggle</h2>
286288
<h2>Slider</h2>
287289

288290
<mat-slider>
289-
<input matSliderThumb value="60">
291+
<input matSliderThumb value="60" />
290292
</mat-slider>
291293
<mat-slider>
292-
<input matSliderThumb value="50" disabled>
294+
<input matSliderThumb value="50" disabled />
293295
</mat-slider>
294296
<mat-slider min="200" max="500" step="100" discrete showTickMarks>
295-
<input value="300" matSliderStartThumb>
296-
<input value="400" matSliderEndThumb>
297+
<input value="300" matSliderStartThumb />
298+
<input value="400" matSliderEndThumb />
297299
</mat-slider>
298300

299301
<h2>Snack bar</h2>
@@ -308,35 +310,47 @@ <h2>Tabs</h2>
308310
<mat-tab-group [selectedIndex]="1">
309311
<mat-tab label="Overview">
310312
<h3>The overview</h3>
311-
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque assumenda doloribus,
312-
rerum temporibus fugit aliquid adipisci aliquam eaque sint voluptas dolore cumque voluptatibus
313-
quam quod. Quasi adipisci officia similique in?</p>
314-
<p>Deleniti neque placeat magnam, voluptatibus eligendi illo consectetur dolore minima dolorem
313+
<p>
314+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque assumenda doloribus, rerum
315+
temporibus fugit aliquid adipisci aliquam eaque sint voluptas dolore cumque voluptatibus quam
316+
quod. Quasi adipisci officia similique in?
317+
</p>
318+
<p>
319+
Deleniti neque placeat magnam, voluptatibus eligendi illo consectetur dolore minima dolorem
315320
nemo suscipit dolorum accusantium? Numquam officia culpa itaque qui repudiandae nulla,
316-
laboriosam nihil molestiae ad aut perferendis alias amet.</p>
317-
<p>Officia esse temporibus consequatur ipsa! Veritatis alias facere amet reiciendis sint
318-
impedit atque iste doloremque dolor? Ullam, aspernatur? Alias, fuga! At dolorum odio
319-
molestiae laudantium nihil alias inventore veritatis voluptatum.</p>
321+
laboriosam nihil molestiae ad aut perferendis alias amet.
322+
</p>
323+
<p>
324+
Officia esse temporibus consequatur ipsa! Veritatis alias facere amet reiciendis sint impedit
325+
atque iste doloremque dolor? Ullam, aspernatur? Alias, fuga! At dolorum odio molestiae
326+
laudantium nihil alias inventore veritatis voluptatum.
327+
</p>
320328
<button mat-raised-button color="primary">See the overview</button>
321329
</mat-tab>
322330
<mat-tab>
323331
<ng-template mat-tab-label>API docs</ng-template>
324332
<h3>The API docs</h3>
325-
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum facere quasi natus rerum
333+
<p>
334+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum facere quasi natus rerum
326335
quae, nisi, quis, voluptate assumenda necessitatibus labore illo. Illum ipsum consequatur,
327-
excepturi aspernatur odio veritatis sint perferendis!</p>
328-
<p>Dicta ex laborum repudiandae nesciunt. Ea asperiores quo totam velit! Aliquid cum laudantium
336+
excepturi aspernatur odio veritatis sint perferendis!
337+
</p>
338+
<p>
339+
Dicta ex laborum repudiandae nesciunt. Ea asperiores quo totam velit! Aliquid cum laudantium
329340
officiis molestias, excepturi odio, autem magni dignissimos perspiciatis, amet qui! Dolorem
330-
molestiae similique necessitatibus cupiditate ipsa aspernatur?</p>
341+
molestiae similique necessitatibus cupiditate ipsa aspernatur?
342+
</p>
331343
<button mat-raised-button color="accent">See the API docs</button>
332344
</mat-tab>
333345

334346
<mat-tab>
335347
<ng-template mat-tab-label>Examples</ng-template>
336348
<h3>The examples</h3>
337-
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi animi saepe, optio sequi
349+
<p>
350+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi animi saepe, optio sequi
338351
accusantium, eos perspiciatis reprehenderit, nobis exercitationem sunt ducimus molestiae
339-
laborum inventore itaque incidunt. Neque dolorum adipisci quidem.</p>
352+
laborum inventore itaque incidunt. Neque dolorum adipisci quidem.
353+
</p>
340354
<button mat-raised-button color="warn">See the examples</button>
341355
</mat-tab>
342356
</mat-tab-group>
@@ -349,9 +363,7 @@ <h3>The examples</h3>
349363

350364
<h2>Paginator</h2>
351365

352-
<mat-paginator [length]="100"
353-
[pageSizeOptions]="[5, 10, 25, 100]"
354-
aria-label="Select page">
366+
<mat-paginator [length]="100" [pageSizeOptions]="[5, 10, 25, 100]" aria-label="Select page">
355367
</mat-paginator>
356368

357369
<h2>Toolbar</h2>
@@ -425,8 +437,8 @@ <h2>CDK Table</h2>
425437
<cdk-cell *cdkCellDef="let element">{{element.symbol}}</cdk-cell>
426438
</ng-container>
427439

428-
<cdk-header-row *cdkHeaderRowDef="tableColumns"/>
429-
<cdk-row *cdkRowDef="let row; columns: tableColumns;"/>
440+
<cdk-header-row *cdkHeaderRowDef="tableColumns" />
441+
<cdk-row *cdkRowDef="let row; columns: tableColumns;" />
430442
</cdk-table>
431443

432444
<h2>Material Table</h2>
@@ -452,8 +464,8 @@ <h2>Material Table</h2>
452464
<mat-cell *matCellDef="let element">{{element.symbol}}</mat-cell>
453465
</ng-container>
454466

455-
<mat-header-row *matHeaderRowDef="tableColumns"/>
456-
<mat-row *matRowDef="let row; columns: tableColumns;"/>
467+
<mat-header-row *matHeaderRowDef="tableColumns" />
468+
<mat-row *matRowDef="let row; columns: tableColumns;" />
457469
</mat-table>
458470

459471
<h2>Native table with sticky header and footer</h2>
@@ -541,9 +553,7 @@ <h2>Focus trap</h2>
541553

542554
<h2>Badge</h2>
543555

544-
<button mat-raised-button matBadge="99">
545-
Clicky thing
546-
</button>
556+
<button mat-raised-button matBadge="99">Clicky thing</button>
547557

548558
<h2>Drag and Drop</h2>
549559
<button cdkDrag>Drag me around</button>
@@ -561,6 +571,15 @@ <h2>Virtual scroll</h2>
561571
</div>
562572
</cdk-virtual-scroll-viewport>
563573

574+
<cdk-virtual-scroll-viewport autosize class="universal-viewport">
575+
<div
576+
*cdkVirtualFor="let size of virtualScrollData; let i = index"
577+
[style.height.px]="i % 2 == 0 ? 50 : 25"
578+
>
579+
Item #{{i}}
580+
</div>
581+
</cdk-virtual-scroll-viewport>
582+
564583
<h2>YouTube player</h2>
565584
<youtube-player videoId="dQw4w9WgXcQ"></youtube-player>
566585

@@ -569,52 +588,69 @@ <h2>Google Map</h2>
569588
<google-map height="400px" width="750px" style="position: relative">
570589
<map-marker [position]="{lat: 24, lng: 12}"></map-marker>
571590
<map-info-window>Hello</map-info-window>
572-
<map-polyline [options]="{
591+
<map-polyline
592+
[options]="{
573593
path: [{lat: 25, lng: 26}, {lat: 26, lng: 27}, {lat: 30, lng: 34}],
574594
strokeColor: 'grey',
575595
strokeOpacity: 0.8
576-
}"></map-polyline>
577-
<map-polygon [options]="{
596+
}"
597+
></map-polyline>
598+
<map-polygon
599+
[options]="{
578600
paths: [{lat: 20, lng: 21}, {lat: 22, lng: 23}, {lat: 24, lng: 25}],
579601
strokeColor: 'grey',
580602
strokeOpacity: 0.8
581-
}"></map-polygon>
582-
<map-rectangle [options]="{
603+
}"
604+
></map-polygon>
605+
<map-rectangle
606+
[options]="{
583607
bounds: {east: 30, north: 15, west: 10, south: -5},
584608
strokeColor: 'grey',
585609
strokeOpacity: 0.8
586-
}"></map-rectangle>
587-
<map-circle [options]="{
610+
}"
611+
></map-rectangle>
612+
<map-circle
613+
[options]="{
588614
center: {lat: 19, lng: 20},
589615
radius: 500000,
590616
strokeColor: 'grey',
591617
strokeOpacity: 0.8
592-
}"></map-circle>
618+
}"
619+
></map-circle>
593620
<map-ground-overlay
594621
url="https://angular.io/assets/images/logos/angular/angular.svg"
595622
[bounds]="{
596623
east: 30,
597624
north: 15,
598625
west: 10,
599626
south: -5
600-
}"></map-ground-overlay>
601-
<map-kml-layer
602-
url="https://developers.google.com/maps/documentation/javascript/examples/kml/westcampus.kml"></map-kml-layer>
603-
<map-traffic-layer></map-traffic-layer>
604-
<map-transit-layer></map-transit-layer>
605-
<map-bicycling-layer></map-bicycling-layer>
606-
<map-heatmap-layer [data]="[
627+
}"
628+
></map-ground-overlay>
629+
<map-kml-layer
630+
url="https://developers.google.com/maps/documentation/javascript/examples/kml/westcampus.kml"
631+
></map-kml-layer>
632+
<map-traffic-layer></map-traffic-layer>
633+
<map-transit-layer></map-transit-layer>
634+
<map-bicycling-layer></map-bicycling-layer>
635+
<map-heatmap-layer
636+
[data]="[
607637
{lat: 37.782, lng: -122.447},
608638
{lat: 37.782, lng: -122.445},
609639
{lat: 37.782, lng: -122.443}
610-
]"></map-heatmap-layer>
611-
612-
<map-marker-clusterer imagePath="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m">
613-
<map-marker [position]="{lat: 24, lng: 12}"></map-marker>
614-
<map-marker [position]="{lat: 12, lng: 24}"></map-marker>
615-
<map-marker [position]="{lat: 12, lng: 12}"></map-marker>
616-
</map-marker-clusterer>
640+
]"
641+
></map-heatmap-layer>
642+
643+
<map-marker-clusterer
644+
imagePath="https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m"
645+
>
646+
<map-marker [position]="{lat: 24, lng: 12}"></map-marker>
647+
<map-marker [position]="{lat: 12, lng: 24}"></map-marker>
648+
<map-marker [position]="{lat: 12, lng: 12}"></map-marker>
649+
</map-marker-clusterer>
617650
</google-map>
618651

652+
<h2>Popover edit</h2>
653+
<cdk-popover-edit-cdk-table-example></cdk-popover-edit-cdk-table-example>
654+
619655
<!-- Element used to determine when rendering is done. -->
620656
<div class="render-marker"></div>

0 commit comments

Comments
 (0)