@angular/material 19.2.0-next.2 → 19.2.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bottom-sheet/index.d.ts +1 -2
- package/button/_button-base.scss +1 -1
- package/checkbox/_checkbox-common.scss +29 -16
- package/chips/index.d.ts +0 -2
- package/core/tokens/m3/definitions/_md-sys-color.scss +5 -5
- package/datepicker/index.d.ts +2 -3
- package/dialog/index.d.ts +5 -2
- package/dialog/testing/index.d.ts +1 -1
- package/expansion/index.d.ts +7 -4
- package/fesm2022/badge.mjs +3 -2
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +72 -13
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +3 -3
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +16 -16
- package/fesm2022/checkbox.mjs +2 -2
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +15 -15
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +4 -3
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +102 -21
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +1 -1
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +92 -16
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/expansion.mjs +72 -16
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field.mjs +34 -9
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/list.mjs +2 -2
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +84 -21
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/select.mjs +110 -38
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +72 -22
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +60 -15
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort.mjs +286 -43
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper.mjs +141 -31
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/tabs.mjs +128 -30
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +11 -2
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +49 -22
- package/fesm2022/tooltip.mjs.map +1 -1
- package/form-field/index.d.ts +1 -2
- package/menu/index.d.ts +4 -5
- package/package.json +2 -3
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/schematics/ng-add/index.js +2 -3
- package/schematics/ng-add/index.mjs +2 -3
- package/schematics/ng-add/schema.d.ts +0 -2
- package/schematics/ng-add/schema.js +1 -1
- package/schematics/ng-add/schema.json +0 -14
- package/schematics/ng-add/schema.mjs +1 -1
- package/schematics/ng-add/setup-project.d.ts +0 -1
- package/schematics/ng-add/setup-project.js +1 -23
- package/schematics/ng-add/setup-project.mjs +1 -23
- package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
- package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +2 -2
- package/select/index.d.ts +4 -4
- package/sidenav/index.d.ts +1 -2
- package/snack-bar/index.d.ts +1 -2
- package/sort/index.d.ts +6 -7
- package/stepper/index.d.ts +2 -3
- package/tabs/index.d.ts +1 -2
- package/timepicker/index.d.ts +6 -0
- package/tooltip/index.d.ts +1 -8
package/fesm2022/select.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Overlay, CdkOverlayOrigin, CdkConnectedOverlay, OverlayModule } from '@angular/cdk/overlay';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, inject, ChangeDetectorRef, ElementRef, Renderer2,
|
|
3
|
+
import { InjectionToken, inject, ChangeDetectorRef, ElementRef, Renderer2, ANIMATION_MODULE_TYPE, EventEmitter, HostAttributeToken, booleanAttribute, numberAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, ContentChildren, ContentChild, Input, ViewChild, Output, Directive, NgModule } from '@angular/core';
|
|
4
4
|
import { _countGroupLabelsBeforeOption, _getOptionScrollPosition, ErrorStateMatcher, _ErrorStateTracker, MAT_OPTION_PARENT_COMPONENT, MatOption, MAT_OPTGROUP, MatOptionModule, MatCommonModule } from '@angular/material/core';
|
|
5
5
|
export { MatOptgroup, MatOption } from '@angular/material/core';
|
|
6
6
|
import { MAT_FORM_FIELD, MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';
|
|
@@ -14,7 +14,6 @@ import { NgControl, Validators, NgForm, FormGroupDirective } from '@angular/form
|
|
|
14
14
|
import { Subject, defer, merge } from 'rxjs';
|
|
15
15
|
import { startWith, switchMap, filter, map, takeUntil, take } from 'rxjs/operators';
|
|
16
16
|
import { NgClass } from '@angular/common';
|
|
17
|
-
import { trigger, transition, query, animateChild, state, style, animate } from '@angular/animations';
|
|
18
17
|
|
|
19
18
|
// Note that these have been copied over verbatim from
|
|
20
19
|
// `material/select` so that we don't have to expose them publicly.
|
|
@@ -90,7 +89,6 @@ class MatSelect {
|
|
|
90
89
|
_dir = inject(Directionality, { optional: true });
|
|
91
90
|
_idGenerator = inject(_IdGenerator);
|
|
92
91
|
_renderer = inject(Renderer2);
|
|
93
|
-
_ngZone = inject(NgZone);
|
|
94
92
|
_parentFormField = inject(MAT_FORM_FIELD, { optional: true });
|
|
95
93
|
ngControl = inject(NgControl, { self: true, optional: true });
|
|
96
94
|
_liveAnnouncer = inject(LiveAnnouncer);
|
|
@@ -575,31 +573,36 @@ class MatSelect {
|
|
|
575
573
|
/** Triggers the exit animation and detaches the overlay at the end. */
|
|
576
574
|
_exitAndDetach() {
|
|
577
575
|
if (this._animationsDisabled || !this.panel) {
|
|
578
|
-
this.
|
|
576
|
+
this._detachOverlay();
|
|
579
577
|
return;
|
|
580
578
|
}
|
|
581
|
-
this.
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
if (event.animationName === '_mat-select-exit') {
|
|
591
|
-
this._cleanupDetach?.();
|
|
592
|
-
this._overlayDir.detachOverlay();
|
|
593
|
-
}
|
|
594
|
-
});
|
|
595
|
-
// Since closing the overlay depends on the animation, we have a fallback in case the panel
|
|
596
|
-
// doesn't animate. This can happen in some internal tests that do `* {animation: none}`.
|
|
597
|
-
const exitFallbackTimer = setTimeout(() => {
|
|
579
|
+
this._cleanupDetach?.();
|
|
580
|
+
this._cleanupDetach = () => {
|
|
581
|
+
cleanupEvent();
|
|
582
|
+
clearTimeout(exitFallbackTimer);
|
|
583
|
+
this._cleanupDetach = undefined;
|
|
584
|
+
};
|
|
585
|
+
const panel = this.panel.nativeElement;
|
|
586
|
+
const cleanupEvent = this._renderer.listen(panel, 'animationend', (event) => {
|
|
587
|
+
if (event.animationName === '_mat-select-exit') {
|
|
598
588
|
this._cleanupDetach?.();
|
|
599
|
-
this.
|
|
600
|
-
}
|
|
601
|
-
panel.classList.add('mat-select-panel-exit');
|
|
589
|
+
this._detachOverlay();
|
|
590
|
+
}
|
|
602
591
|
});
|
|
592
|
+
// Since closing the overlay depends on the animation, we have a fallback in case the panel
|
|
593
|
+
// doesn't animate. This can happen in some internal tests that do `* {animation: none}`.
|
|
594
|
+
const exitFallbackTimer = setTimeout(() => {
|
|
595
|
+
this._cleanupDetach?.();
|
|
596
|
+
this._detachOverlay();
|
|
597
|
+
}, 200);
|
|
598
|
+
panel.classList.add('mat-select-panel-exit');
|
|
599
|
+
}
|
|
600
|
+
/** Detaches the current overlay directive. */
|
|
601
|
+
_detachOverlay() {
|
|
602
|
+
this._overlayDir.detachOverlay();
|
|
603
|
+
// Some of the overlay detachment logic depends on change detection.
|
|
604
|
+
// Mark for check to ensure that things get picked up in a timely manner.
|
|
605
|
+
this._changeDetectorRef.markForCheck();
|
|
603
606
|
}
|
|
604
607
|
/**
|
|
605
608
|
* Sets the select's value. Part of the ControlValueAccessor interface
|
|
@@ -1285,26 +1288,95 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
1285
1288
|
* @breaking-change 21.0.0
|
|
1286
1289
|
*/
|
|
1287
1290
|
const matSelectAnimations = {
|
|
1291
|
+
// Represents
|
|
1292
|
+
// trigger('transformPanelWrap', [
|
|
1293
|
+
// transition('* => void', query('@transformPanel', [animateChild()], {optional: true})),
|
|
1294
|
+
// ])
|
|
1288
1295
|
/**
|
|
1289
1296
|
* This animation ensures the select's overlay panel animation (transformPanel) is called when
|
|
1290
1297
|
* closing the select.
|
|
1291
1298
|
* This is needed due to https://github.com/angular/angular/issues/23302
|
|
1292
1299
|
*/
|
|
1293
|
-
transformPanelWrap:
|
|
1294
|
-
|
|
1295
|
-
|
|
1300
|
+
transformPanelWrap: {
|
|
1301
|
+
type: 7,
|
|
1302
|
+
name: 'transformPanelWrap',
|
|
1303
|
+
definitions: [
|
|
1304
|
+
{
|
|
1305
|
+
type: 1,
|
|
1306
|
+
expr: '* => void',
|
|
1307
|
+
animation: {
|
|
1308
|
+
type: 11,
|
|
1309
|
+
selector: '@transformPanel',
|
|
1310
|
+
animation: [{ type: 9, options: null }],
|
|
1311
|
+
options: { optional: true },
|
|
1312
|
+
},
|
|
1313
|
+
options: null,
|
|
1314
|
+
},
|
|
1315
|
+
],
|
|
1316
|
+
options: {},
|
|
1317
|
+
},
|
|
1318
|
+
// Represents
|
|
1319
|
+
// trigger('transformPanel', [
|
|
1320
|
+
// state(
|
|
1321
|
+
// 'void',
|
|
1322
|
+
// style({
|
|
1323
|
+
// opacity: 0,
|
|
1324
|
+
// transform: 'scale(1, 0.8)',
|
|
1325
|
+
// }),
|
|
1326
|
+
// ),
|
|
1327
|
+
// transition(
|
|
1328
|
+
// 'void => showing',
|
|
1329
|
+
// animate(
|
|
1330
|
+
// '120ms cubic-bezier(0, 0, 0.2, 1)',
|
|
1331
|
+
// style({
|
|
1332
|
+
// opacity: 1,
|
|
1333
|
+
// transform: 'scale(1, 1)',
|
|
1334
|
+
// }),
|
|
1335
|
+
// ),
|
|
1336
|
+
// ),
|
|
1337
|
+
// transition('* => void', animate('100ms linear', style({opacity: 0}))),
|
|
1338
|
+
// ])
|
|
1296
1339
|
/** This animation transforms the select's overlay panel on and off the page. */
|
|
1297
|
-
transformPanel:
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1340
|
+
transformPanel: {
|
|
1341
|
+
type: 7,
|
|
1342
|
+
name: 'transformPanel',
|
|
1343
|
+
definitions: [
|
|
1344
|
+
{
|
|
1345
|
+
type: 0,
|
|
1346
|
+
name: 'void',
|
|
1347
|
+
styles: {
|
|
1348
|
+
type: 6,
|
|
1349
|
+
styles: { opacity: 0, transform: 'scale(1, 0.8)' },
|
|
1350
|
+
offset: null,
|
|
1351
|
+
},
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
type: 1,
|
|
1355
|
+
expr: 'void => showing',
|
|
1356
|
+
animation: {
|
|
1357
|
+
type: 4,
|
|
1358
|
+
styles: {
|
|
1359
|
+
type: 6,
|
|
1360
|
+
styles: { opacity: 1, transform: 'scale(1, 1)' },
|
|
1361
|
+
offset: null,
|
|
1362
|
+
},
|
|
1363
|
+
timings: '120ms cubic-bezier(0, 0, 0.2, 1)',
|
|
1364
|
+
},
|
|
1365
|
+
options: null,
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
type: 1,
|
|
1369
|
+
expr: '* => void',
|
|
1370
|
+
animation: {
|
|
1371
|
+
type: 4,
|
|
1372
|
+
styles: { type: 6, styles: { opacity: 0 }, offset: null },
|
|
1373
|
+
timings: '100ms linear',
|
|
1374
|
+
},
|
|
1375
|
+
options: null,
|
|
1376
|
+
},
|
|
1377
|
+
],
|
|
1378
|
+
options: {},
|
|
1379
|
+
},
|
|
1308
1380
|
};
|
|
1309
1381
|
|
|
1310
1382
|
/**
|