@angular/material 17.0.3 → 17.0.5
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/LICENSE +1 -1
- package/_index.scss +1 -1
- package/button/_button-theme.scss +11 -11
- package/core/index.d.ts +6 -2
- package/core/tokens/m2/mat/_form-field.scss +50 -1
- package/core/tokens/m2/mat/_slider.scss +34 -8
- package/core/tokens/m2/mat/_tab-header.scss +6 -1
- package/core/tokens/m2/mdc/_filled-button.scss +7 -6
- package/core/tokens/m2/mdc/_outlined-button.scss +7 -7
- package/core/tokens/m2/mdc/_protected-button.scss +7 -6
- package/core/tokens/m2/mdc/_text-button.scss +7 -8
- package/esm2022/autocomplete/autocomplete-trigger.mjs +12 -4
- package/esm2022/autocomplete/autocomplete.mjs +2 -3
- package/esm2022/button/button-base.mjs +2 -1
- package/esm2022/button/button.mjs +4 -4
- package/esm2022/chips/chip-listbox.mjs +2 -3
- package/esm2022/chips/chip.mjs +2 -1
- package/esm2022/chips/tokens.mjs +8 -2
- package/esm2022/core/private/ripple-loader.mjs +27 -9
- package/esm2022/core/ripple/ripple-renderer.mjs +1 -1
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/datepicker-base.mjs +8 -2
- package/esm2022/expansion/accordion.mjs +2 -3
- package/esm2022/expansion/expansion-panel.mjs +3 -3
- package/esm2022/form-field/form-field.mjs +3 -3
- package/esm2022/list/tokens.mjs +2 -2
- package/esm2022/menu/menu-trigger.mjs +8 -2
- package/esm2022/menu/menu.mjs +2 -3
- package/esm2022/select/select.mjs +22 -16
- package/esm2022/sidenav/drawer.mjs +16 -12
- package/esm2022/sidenav/sidenav.mjs +4 -7
- package/esm2022/slider/slider-input.mjs +24 -19
- package/esm2022/slider/slider-interface.mjs +1 -1
- package/esm2022/slider/slider-thumb.mjs +9 -2
- package/esm2022/slider/slider.mjs +3 -4
- package/esm2022/snack-bar/snack-bar-container.mjs +6 -9
- package/esm2022/tabs/ink-bar.mjs +4 -4
- package/esm2022/tabs/tab-group.mjs +11 -2
- package/esm2022/tabs/tab-header.mjs +2 -2
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
- package/esm2022/tooltip/tooltip.mjs +9 -3
- package/expansion/index.d.ts +2 -2
- package/fesm2022/autocomplete.mjs +12 -5
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/button.mjs +5 -4
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/chips.mjs +8 -3
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +27 -9
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +7 -1
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/expansion.mjs +3 -4
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/list.mjs +1 -1
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +8 -3
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/select.mjs +21 -15
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +18 -17
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slider.mjs +32 -22
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +6 -8
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/tabs.mjs +17 -8
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +8 -2
- package/fesm2022/tooltip.mjs.map +1 -1
- package/form-field/_form-field-subscript.scss +1 -2
- package/form-field/_form-field-theme.scss +4 -2
- package/form-field/_mdc-text-field-density-overrides.scss +60 -0
- package/list/index.d.ts +1 -1
- package/package.json +2 -2
- package/paginator/_paginator-theme.scss +5 -4
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +5 -3
- package/schematics/ng-generate/mdc-migration/schema.json +0 -1
- package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/slider/_slider-theme.scss +10 -12
- package/slider/index.d.ts +3 -12
- package/snack-bar/index.d.ts +2 -2
- package/tabs/_tabs-common.scss +20 -1
- package/tabs/index.d.ts +6 -2
- package/form-field/_form-field-density.scss +0 -118
- package/form-field/_form-field-sizing.scss +0 -40
package/fesm2022/core.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
|
|
|
14
14
|
import { ENTER, SPACE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
15
15
|
|
|
16
16
|
/** Current version of Angular Material. */
|
|
17
|
-
const VERSION = new Version('17.0.
|
|
17
|
+
const VERSION = new Version('17.0.5');
|
|
18
18
|
|
|
19
19
|
/** @docs-private */
|
|
20
20
|
class AnimationCurves {
|
|
@@ -1723,6 +1723,8 @@ const matRippleDisabled = 'mat-ripple-loader-disabled';
|
|
|
1723
1723
|
*
|
|
1724
1724
|
* This service allows us to avoid eagerly creating & attaching MatRipples.
|
|
1725
1725
|
* It works by creating & attaching a ripple only when a component is first interacted with.
|
|
1726
|
+
*
|
|
1727
|
+
* @docs-private
|
|
1726
1728
|
*/
|
|
1727
1729
|
class MatRippleLoader {
|
|
1728
1730
|
constructor() {
|
|
@@ -1731,6 +1733,7 @@ class MatRippleLoader {
|
|
|
1731
1733
|
this._globalRippleOptions = inject(MAT_RIPPLE_GLOBAL_OPTIONS, { optional: true });
|
|
1732
1734
|
this._platform = inject(Platform);
|
|
1733
1735
|
this._ngZone = inject(NgZone);
|
|
1736
|
+
this._hosts = new Map();
|
|
1734
1737
|
/** Handles creating and attaching component internals when a component it is initially interacted with. */
|
|
1735
1738
|
this._onInteraction = (event) => {
|
|
1736
1739
|
if (!(event.target instanceof HTMLElement)) {
|
|
@@ -1740,7 +1743,7 @@ class MatRippleLoader {
|
|
|
1740
1743
|
// TODO(wagnermaciel): Consider batching these events to improve runtime performance.
|
|
1741
1744
|
const element = eventTarget.closest(`[${matRippleUninitialized}]`);
|
|
1742
1745
|
if (element) {
|
|
1743
|
-
this.
|
|
1746
|
+
this._createRipple(element);
|
|
1744
1747
|
}
|
|
1745
1748
|
};
|
|
1746
1749
|
this._ngZone.runOutsideAngular(() => {
|
|
@@ -1750,6 +1753,10 @@ class MatRippleLoader {
|
|
|
1750
1753
|
});
|
|
1751
1754
|
}
|
|
1752
1755
|
ngOnDestroy() {
|
|
1756
|
+
const hosts = this._hosts.keys();
|
|
1757
|
+
for (const host of hosts) {
|
|
1758
|
+
this.destroyRipple(host);
|
|
1759
|
+
}
|
|
1753
1760
|
for (const event of rippleInteractionEvents) {
|
|
1754
1761
|
this._document?.removeEventListener(event, this._onInteraction, eventListenerOptions);
|
|
1755
1762
|
}
|
|
@@ -1777,14 +1784,12 @@ class MatRippleLoader {
|
|
|
1777
1784
|
}
|
|
1778
1785
|
/** Returns the ripple instance for the given host element. */
|
|
1779
1786
|
getRipple(host) {
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
}
|
|
1783
|
-
return this.createRipple(host);
|
|
1787
|
+
const ripple = this._hosts.get(host);
|
|
1788
|
+
return ripple || this._createRipple(host);
|
|
1784
1789
|
}
|
|
1785
1790
|
/** Sets the disabled state on the ripple instance corresponding to the given host element. */
|
|
1786
1791
|
setDisabled(host, disabled) {
|
|
1787
|
-
const ripple = host
|
|
1792
|
+
const ripple = this._hosts.get(host);
|
|
1788
1793
|
// If the ripple has already been instantiated, just disable it.
|
|
1789
1794
|
if (ripple) {
|
|
1790
1795
|
ripple.disabled = disabled;
|
|
@@ -1800,10 +1805,14 @@ class MatRippleLoader {
|
|
|
1800
1805
|
}
|
|
1801
1806
|
}
|
|
1802
1807
|
/** Creates a MatRipple and appends it to the given element. */
|
|
1803
|
-
|
|
1808
|
+
_createRipple(host) {
|
|
1804
1809
|
if (!this._document) {
|
|
1805
1810
|
return;
|
|
1806
1811
|
}
|
|
1812
|
+
const existingRipple = this._hosts.get(host);
|
|
1813
|
+
if (existingRipple) {
|
|
1814
|
+
return existingRipple;
|
|
1815
|
+
}
|
|
1807
1816
|
// Create the ripple element.
|
|
1808
1817
|
host.querySelector('.mat-ripple')?.remove();
|
|
1809
1818
|
const rippleEl = this._document.createElement('span');
|
|
@@ -1820,7 +1829,16 @@ class MatRippleLoader {
|
|
|
1820
1829
|
}
|
|
1821
1830
|
attachRipple(host, ripple) {
|
|
1822
1831
|
host.removeAttribute(matRippleUninitialized);
|
|
1823
|
-
host
|
|
1832
|
+
this._hosts.set(host, ripple);
|
|
1833
|
+
}
|
|
1834
|
+
destroyRipple(host) {
|
|
1835
|
+
const ripple = this._hosts.get(host);
|
|
1836
|
+
if (ripple) {
|
|
1837
|
+
// Since this directive is created manually, it needs to be destroyed manually too.
|
|
1838
|
+
// tslint:disable-next-line:no-lifecycle-invocation
|
|
1839
|
+
ripple.ngOnDestroy();
|
|
1840
|
+
this._hosts.delete(host);
|
|
1841
|
+
}
|
|
1824
1842
|
}
|
|
1825
1843
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: MatRippleLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1826
1844
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: MatRippleLoader, providedIn: 'root' }); }
|