@angular/material 19.0.0-next.4 → 19.0.0-next.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/autocomplete/index.d.ts +5 -15
- package/badge/index.d.ts +3 -7
- package/bottom-sheet/index.d.ts +5 -15
- package/button/index.d.ts +20 -24
- package/button-toggle/index.d.ts +5 -8
- package/card/index.d.ts +2 -2
- package/checkbox/index.d.ts +4 -6
- package/chips/index.d.ts +13 -24
- package/core/index.d.ts +14 -19
- package/datepicker/index.d.ts +44 -70
- package/dialog/index.d.ts +10 -34
- package/dialog/testing/index.d.ts +1 -1
- package/expansion/index.d.ts +9 -13
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +32 -62
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +12 -19
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +17 -32
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +18 -34
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +44 -113
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/card.mjs +5 -9
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +14 -24
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +61 -112
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +31 -66
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +130 -266
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +3 -3
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +27 -85
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion/testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +32 -67
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing/control.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +42 -62
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +16 -23
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +11 -20
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/input.mjs +23 -47
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs +59 -98
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/material.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +51 -99
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +12 -19
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +8 -14
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +21 -34
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select.mjs +26 -58
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav/testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +50 -70
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +13 -21
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +49 -57
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +30 -43
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +18 -37
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper/testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +30 -42
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table/testing.mjs.map +1 -1
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +87 -142
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar/testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +8 -12
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip/testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +45 -59
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree/testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +13 -40
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/index.d.ts +10 -24
- package/grid-list/index.d.ts +6 -8
- package/icon/index.d.ts +2 -2
- package/input/index.d.ts +3 -7
- package/list/index.d.ts +10 -14
- package/menu/index.d.ts +15 -49
- package/package.json +2 -2
- package/progress-bar/index.d.ts +3 -5
- package/progress-spinner/index.d.ts +2 -2
- package/radio/index.d.ts +5 -8
- package/schematics/ng-add/fonts/material-fonts.d.ts +1 -1
- package/schematics/ng-add/fonts/material-fonts.js +2 -2
- package/schematics/ng-add/fonts/material-fonts.mjs +2 -2
- package/schematics/ng-add/index.d.ts +1 -1
- package/schematics/ng-add/index.js +3 -3
- package/schematics/ng-add/index.mjs +3 -3
- package/schematics/ng-add/package-config.d.ts +1 -1
- package/schematics/ng-add/package-config.js +2 -2
- package/schematics/ng-add/package-config.mjs +2 -2
- package/schematics/ng-add/schema.d.ts +1 -1
- package/schematics/ng-add/schema.js +2 -2
- package/schematics/ng-add/schema.mjs +2 -2
- package/schematics/ng-add/setup-project.d.ts +1 -1
- package/schematics/ng-add/setup-project.js +3 -3
- package/schematics/ng-add/setup-project.mjs +3 -3
- package/schematics/ng-add/theming/create-custom-theme.d.ts +1 -1
- package/schematics/ng-add/theming/create-custom-theme.js +2 -2
- package/schematics/ng-add/theming/create-custom-theme.mjs +2 -2
- package/schematics/ng-add/theming/theming.d.ts +1 -1
- package/schematics/ng-add/theming/theming.js +2 -2
- package/schematics/ng-add/theming/theming.mjs +2 -2
- package/schematics/ng-generate/address-form/index.d.ts +1 -1
- package/schematics/ng-generate/address-form/index.js +2 -2
- package/schematics/ng-generate/address-form/index.mjs +2 -2
- package/schematics/ng-generate/address-form/schema.d.ts +1 -1
- package/schematics/ng-generate/address-form/schema.js +2 -2
- package/schematics/ng-generate/address-form/schema.mjs +2 -2
- package/schematics/ng-generate/dashboard/index.d.ts +1 -1
- package/schematics/ng-generate/dashboard/index.js +2 -2
- package/schematics/ng-generate/dashboard/index.mjs +2 -2
- package/schematics/ng-generate/dashboard/schema.d.ts +1 -1
- package/schematics/ng-generate/dashboard/schema.js +2 -2
- package/schematics/ng-generate/dashboard/schema.mjs +2 -2
- package/schematics/ng-generate/m3-theme/index_bundled.js +1 -1
- package/schematics/ng-generate/m3-theme/index_bundled.js.map +1 -1
- package/schematics/ng-generate/navigation/index.d.ts +1 -1
- package/schematics/ng-generate/navigation/index.js +2 -2
- package/schematics/ng-generate/navigation/index.mjs +2 -2
- package/schematics/ng-generate/navigation/schema.d.ts +1 -1
- package/schematics/ng-generate/navigation/schema.js +2 -2
- package/schematics/ng-generate/navigation/schema.mjs +2 -2
- package/schematics/ng-generate/table/index.d.ts +1 -1
- package/schematics/ng-generate/table/index.js +2 -2
- package/schematics/ng-generate/table/index.mjs +2 -2
- package/schematics/ng-generate/table/schema.d.ts +1 -1
- package/schematics/ng-generate/table/schema.js +2 -2
- package/schematics/ng-generate/table/schema.mjs +2 -2
- package/schematics/ng-generate/tree/index.d.ts +1 -1
- package/schematics/ng-generate/tree/index.js +2 -2
- package/schematics/ng-generate/tree/index.mjs +2 -2
- package/schematics/ng-generate/tree/schema.d.ts +1 -1
- package/schematics/ng-generate/tree/schema.js +2 -2
- package/schematics/ng-generate/tree/schema.mjs +2 -2
- package/schematics/ng-update/index_bundled.js +1 -1
- package/schematics/ng-update/index_bundled.js.map +1 -1
- package/select/index.d.ts +4 -14
- package/sidenav/index.d.ts +7 -17
- package/slide-toggle/index.d.ts +2 -2
- package/slider/index.d.ts +8 -8
- package/snack-bar/index.d.ts +6 -22
- package/sort/index.d.ts +4 -20
- package/stepper/index.d.ts +6 -13
- package/tabs/index.d.ts +21 -32
- package/toolbar/index.d.ts +3 -4
- package/tooltip/index.d.ts +5 -12
- package/tree/index.d.ts +5 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/toolbar/testing/toolbar-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/toolbar/testing/toolbar-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ContentContainerComponentHarness, HarnessPredicate, parallel} from '@angular/cdk/testing';\nimport {ToolbarHarnessFilters} from './toolbar-harness-filters';\n\n/** Selectors for different sections of the mat-toolbar that contain user content. */\nexport enum MatToolbarSection {\n ROW = '.mat-toolbar-row',\n}\n\n/** Harness for interacting with a standard mat-toolbar in tests. */\nexport class MatToolbarHarness extends ContentContainerComponentHarness<MatToolbarSection> {\n static hostSelector = '.mat-toolbar';\n\n private _getRows = this.locatorForAll(MatToolbarSection.ROW);\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatToolbarHarness` that meets\n * certain criteria.\n * @param options Options for filtering which card instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(options: ToolbarHarnessFilters = {}): HarnessPredicate<MatToolbarHarness> {\n return new HarnessPredicate(MatToolbarHarness, options).addOption(\n 'text',\n options.text,\n (harness, text) => HarnessPredicate.stringMatches(harness._getText(), text),\n );\n }\n\n /** Whether the toolbar has multiple rows. */\n async hasMultipleRows(): Promise<boolean> {\n return (await this.host()).hasClass('mat-toolbar-multiple-rows');\n }\n\n /** Gets all of the toolbar's content as text. */\n private async _getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Gets the text of each row in the toolbar. */\n async getRowsAsText(): Promise<string[]> {\n const rows = await this._getRows();\n return parallel(() => (rows.length ? rows.map(r => r.text()) : [this._getText()]));\n }\n}\n"],"names":[],"mappings":";;AAWA;IACY,kBAEX;AAFD,CAAA,UAAY,iBAAiB,EAAA;AAC3B,IAAA,iBAAA,CAAA,KAAA,CAAA,GAAA,kBAAwB,CAAA;AAC1B,CAAC,EAFW,iBAAiB,KAAjB,iBAAiB,GAE5B,EAAA,CAAA,CAAA,CAAA;AAED;AACM,MAAO,iBAAkB,SAAQ,gCAAmD,CAAA;AAA1F,IAAA,WAAA,GAAA;;QAGU,IAAQ,CAAA,QAAA,GAAG,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;KA+B9D;aAjCQ,IAAY,CAAA,YAAA,GAAG,cAAH,CAAkB,EAAA;AAIrC;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAAiC,EAAE,EAAA;AAC7C,QAAA,OAAO,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,SAAS,CAC/D,MAAM,EACN,OAAO,CAAC,IAAI,EACZ,CAAC,OAAO,EAAE,IAAI,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAC5E,CAAC;KACH;;AAGD,IAAA,MAAM,eAAe,GAAA;AACnB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,2BAA2B,CAAC,CAAC;KAClE;;AAGO,IAAA,MAAM,QAAQ,GAAA;QACpB,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;KACnC;;AAGD,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;AACnC,QAAA,OAAO,QAAQ,CAAC,OAAO,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;KACpF;;;;;"}
|
package/fesm2022/toolbar.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Component, ChangeDetectionStrategy, ViewEncapsulation,
|
|
2
|
+
import { Directive, inject, ElementRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ContentChildren, NgModule } from '@angular/core';
|
|
3
3
|
import { MatCommonModule } from '@angular/material/core';
|
|
4
|
-
import
|
|
4
|
+
import { Platform } from '@angular/cdk/platform';
|
|
5
5
|
import { DOCUMENT } from '@angular/common';
|
|
6
6
|
|
|
7
7
|
class MatToolbarRow {
|
|
@@ -18,11 +18,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.3",
|
|
|
18
18
|
}]
|
|
19
19
|
}] });
|
|
20
20
|
class MatToolbar {
|
|
21
|
-
constructor(
|
|
22
|
-
this._elementRef =
|
|
23
|
-
this._platform =
|
|
24
|
-
|
|
25
|
-
this._document = document;
|
|
21
|
+
constructor() {
|
|
22
|
+
this._elementRef = inject(ElementRef);
|
|
23
|
+
this._platform = inject(Platform);
|
|
24
|
+
this._document = inject(DOCUMENT);
|
|
26
25
|
}
|
|
27
26
|
ngAfterViewInit() {
|
|
28
27
|
if (this._platform.isBrowser) {
|
|
@@ -46,7 +45,7 @@ class MatToolbar {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: MatToolbar, deps: [
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: MatToolbar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
50
49
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.3", type: MatToolbar, isStandalone: true, selector: "mat-toolbar", inputs: { color: "color" }, host: { properties: { "class": "color ? \"mat-\" + color : \"\"", "class.mat-toolbar-multiple-rows": "_toolbarRows.length > 0", "class.mat-toolbar-single-row": "_toolbarRows.length === 0" }, classAttribute: "mat-toolbar" }, queries: [{ propertyName: "_toolbarRows", predicate: MatToolbarRow, descendants: true }], exportAs: ["matToolbar"], ngImport: i0, template: "<ng-content></ng-content>\n<ng-content select=\"mat-toolbar-row\"></ng-content>\n", styles: [".mat-toolbar{background:var(--mat-toolbar-container-background-color, var(--mat-app-surface));color:var(--mat-toolbar-container-text-color, var(--mat-app-on-surface))}.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:var(--mat-toolbar-title-text-font, var(--mat-app-title-large-font));font-size:var(--mat-toolbar-title-text-size, var(--mat-app-title-large-size));line-height:var(--mat-toolbar-title-text-line-height, var(--mat-app-title-large-line-height));font-weight:var(--mat-toolbar-title-text-weight, var(--mat-app-title-large-weight));letter-spacing:var(--mat-toolbar-title-text-tracking, var(--mat-app-title-large-tracking));margin:0}@media(forced-colors: active){.mat-toolbar{outline:solid 1px}}.mat-toolbar .mat-form-field-underline,.mat-toolbar .mat-form-field-ripple,.mat-toolbar .mat-focused .mat-form-field-ripple{background-color:currentColor}.mat-toolbar .mat-form-field-label,.mat-toolbar .mat-focused .mat-form-field-label,.mat-toolbar .mat-select-value,.mat-toolbar .mat-select-arrow,.mat-toolbar .mat-form-field.mat-focused .mat-select-arrow{color:inherit}.mat-toolbar .mat-input-element{caret-color:currentColor}.mat-toolbar .mat-mdc-button-base.mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-app-on-surface));--mdc-outlined-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-app-on-surface))}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap;height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-row,.mat-toolbar-single-row{height:var(--mat-toolbar-mobile-height, 56px)}}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%;min-height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:var(--mat-toolbar-mobile-height, 56px)}}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
51
50
|
}
|
|
52
51
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: MatToolbar, decorators: [{
|
|
@@ -57,10 +56,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.3",
|
|
|
57
56
|
'[class.mat-toolbar-multiple-rows]': '_toolbarRows.length > 0',
|
|
58
57
|
'[class.mat-toolbar-single-row]': '_toolbarRows.length === 0',
|
|
59
58
|
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, template: "<ng-content></ng-content>\n<ng-content select=\"mat-toolbar-row\"></ng-content>\n", styles: [".mat-toolbar{background:var(--mat-toolbar-container-background-color, var(--mat-app-surface));color:var(--mat-toolbar-container-text-color, var(--mat-app-on-surface))}.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:var(--mat-toolbar-title-text-font, var(--mat-app-title-large-font));font-size:var(--mat-toolbar-title-text-size, var(--mat-app-title-large-size));line-height:var(--mat-toolbar-title-text-line-height, var(--mat-app-title-large-line-height));font-weight:var(--mat-toolbar-title-text-weight, var(--mat-app-title-large-weight));letter-spacing:var(--mat-toolbar-title-text-tracking, var(--mat-app-title-large-tracking));margin:0}@media(forced-colors: active){.mat-toolbar{outline:solid 1px}}.mat-toolbar .mat-form-field-underline,.mat-toolbar .mat-form-field-ripple,.mat-toolbar .mat-focused .mat-form-field-ripple{background-color:currentColor}.mat-toolbar .mat-form-field-label,.mat-toolbar .mat-focused .mat-form-field-label,.mat-toolbar .mat-select-value,.mat-toolbar .mat-select-arrow,.mat-toolbar .mat-form-field.mat-focused .mat-select-arrow{color:inherit}.mat-toolbar .mat-input-element{caret-color:currentColor}.mat-toolbar .mat-mdc-button-base.mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-app-on-surface));--mdc-outlined-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-app-on-surface))}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap;height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-row,.mat-toolbar-single-row{height:var(--mat-toolbar-mobile-height, 56px)}}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%;min-height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:var(--mat-toolbar-mobile-height, 56px)}}"] }]
|
|
60
|
-
}], ctorParameters: () => [
|
|
61
|
-
type: Inject,
|
|
62
|
-
args: [DOCUMENT]
|
|
63
|
-
}] }], propDecorators: { color: [{
|
|
59
|
+
}], ctorParameters: () => [], propDecorators: { color: [{
|
|
64
60
|
type: Input
|
|
65
61
|
}], _toolbarRows: [{
|
|
66
62
|
type: ContentChildren,
|
package/fesm2022/toolbar.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.mjs","sources":["../../../../../../src/material/toolbar/toolbar.ts","../../../../../../src/material/toolbar/toolbar.html","../../../../../../src/material/toolbar/toolbar-module.ts","../../../../../../src/material/toolbar/toolbar_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.
|
|
1
|
+
{"version":3,"file":"toolbar.mjs","sources":["../../../../../../src/material/toolbar/toolbar.ts","../../../../../../src/material/toolbar/toolbar.html","../../../../../../src/material/toolbar/toolbar-module.ts","../../../../../../src/material/toolbar/toolbar_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n Input,\n QueryList,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\n\n@Directive({\n selector: 'mat-toolbar-row',\n exportAs: 'matToolbarRow',\n host: {'class': 'mat-toolbar-row'},\n standalone: true,\n})\nexport class MatToolbarRow {}\n\n@Component({\n selector: 'mat-toolbar',\n exportAs: 'matToolbar',\n templateUrl: 'toolbar.html',\n styleUrl: 'toolbar.css',\n host: {\n 'class': 'mat-toolbar',\n '[class]': 'color ? \"mat-\" + color : \"\"',\n '[class.mat-toolbar-multiple-rows]': '_toolbarRows.length > 0',\n '[class.mat-toolbar-single-row]': '_toolbarRows.length === 0',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n})\nexport class MatToolbar implements AfterViewInit {\n protected _elementRef = inject(ElementRef);\n private _platform = inject(Platform);\n private _document = inject(DOCUMENT);\n\n // TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.\n /**\n * Theme color of the toolbar. This API is supported in M2 themes only, it has\n * no effect in M3 themes.\n *\n * For information on applying color variants in M3, see\n * https://material.angular.io/guide/theming#using-component-color-variants.\n */\n @Input() color?: string | null;\n\n /** Reference to all toolbar row elements that have been projected. */\n @ContentChildren(MatToolbarRow, {descendants: true}) _toolbarRows: QueryList<MatToolbarRow>;\n\n constructor(...args: unknown[]);\n constructor() {}\n\n ngAfterViewInit() {\n if (this._platform.isBrowser) {\n this._checkToolbarMixedModes();\n this._toolbarRows.changes.subscribe(() => this._checkToolbarMixedModes());\n }\n }\n\n /**\n * Throws an exception when developers are attempting to combine the different toolbar row modes.\n */\n private _checkToolbarMixedModes() {\n if (this._toolbarRows.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n // Check if there are any other DOM nodes that can display content but aren't inside of\n // a <mat-toolbar-row> element.\n const isCombinedUsage = Array.from<HTMLElement>(this._elementRef.nativeElement.childNodes)\n .filter(node => !(node.classList && node.classList.contains('mat-toolbar-row')))\n .filter(node => node.nodeType !== (this._document ? this._document.COMMENT_NODE : 8))\n .some(node => !!(node.textContent && node.textContent.trim()));\n\n if (isCombinedUsage) {\n throwToolbarMixedModesError();\n }\n }\n }\n}\n\n/**\n * Throws an exception when attempting to combine the different toolbar row modes.\n * @docs-private\n */\nexport function throwToolbarMixedModesError() {\n throw Error(\n 'MatToolbar: Attempting to combine different toolbar modes. ' +\n 'Either specify multiple `<mat-toolbar-row>` elements explicitly or just place content ' +\n 'inside of a `<mat-toolbar>` for a single row.',\n );\n}\n","<ng-content></ng-content>\n<ng-content select=\"mat-toolbar-row\"></ng-content>\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatToolbar, MatToolbarRow} from './toolbar';\n\n@NgModule({\n imports: [MatCommonModule, MatToolbar, MatToolbarRow],\n exports: [MatToolbar, MatToolbarRow, MatCommonModule],\n})\nexport class MatToolbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/tooltip/testing/tooltip-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/tooltip/testing/tooltip-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {TooltipHarnessFilters} from './tooltip-harness-filters';\n\n/** Harness for interacting with a mat-tooltip in tests. */\nexport class MatTooltipHarness extends ComponentHarness {\n static hostSelector = '.mat-mdc-tooltip-trigger';\n\n private _optionalPanel = this.documentRootLocatorFactory().locatorForOptional('.mat-mdc-tooltip');\n private _hiddenClass = 'mat-mdc-tooltip-hide';\n private _disabledClass = 'mat-mdc-tooltip-disabled';\n private _showAnimationName = 'mat-mdc-tooltip-show';\n private _hideAnimationName = 'mat-mdc-tooltip-hide';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a tooltip trigger with specific\n * attributes.\n * @param options Options for narrowing the search.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatTooltipHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TooltipHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n\n /** Shows the tooltip. */\n async show(): Promise<void> {\n const host = await this.host();\n\n // We need to dispatch both `touchstart` and a hover event, because the tooltip binds\n // different events depending on the device. The `changedTouches` is there in case the\n // element has ripples.\n await host.dispatchEvent('touchstart', {changedTouches: []});\n await host.hover();\n const panel = await this._optionalPanel();\n await panel?.dispatchEvent('animationend', {animationName: this._showAnimationName});\n }\n\n /** Hides the tooltip. */\n async hide(): Promise<void> {\n const host = await this.host();\n\n // We need to dispatch both `touchstart` and a hover event, because\n // the tooltip binds different events depending on the device.\n await host.dispatchEvent('touchend');\n await host.mouseAway();\n const panel = await this._optionalPanel();\n await panel?.dispatchEvent('animationend', {animationName: this._hideAnimationName});\n }\n\n /** Gets whether the tooltip is open. */\n async isOpen(): Promise<boolean> {\n const panel = await this._optionalPanel();\n return !!panel && !(await panel.hasClass(this._hiddenClass));\n }\n\n /** Gets whether the tooltip is disabled */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return host.hasClass(this._disabledClass);\n }\n\n /** Gets a promise for the tooltip panel's text. */\n async getTooltipText(): Promise<string> {\n const panel = await this._optionalPanel();\n return panel ? panel.text() : '';\n }\n}\n"],"names":[],"mappings":";;AAeA;AACM,MAAO,iBAAkB,SAAQ,gBAAgB,CAAA;AAAvD,IAAA,WAAA,GAAA;;QAGU,IAAc,CAAA,cAAA,GAAG,IAAI,CAAC,0BAA0B,EAAE,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;QAC1F,IAAY,CAAA,YAAA,GAAG,sBAAsB,CAAC;QACtC,IAAc,CAAA,cAAA,GAAG,0BAA0B,CAAC;QAC5C,IAAkB,CAAA,kBAAA,GAAG,sBAAsB,CAAC;QAC5C,IAAkB,CAAA,kBAAA,GAAG,sBAAsB,CAAC;KAyDrD;aA/DQ,IAAY,CAAA,YAAA,GAAG,0BAAH,CAA8B,EAAA;AAQjD;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAET,OAAA,GAAiC,EAAE,EAAA;AAEnC,QAAA,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KAC5C;;AAGD,IAAA,MAAM,IAAI,GAAA;AACR,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;;;;AAK/B,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,EAAC,cAAc,EAAE,EAAE,EAAC,CAAC,CAAC;AAC7D,QAAA,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;AACnB,QAAA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;AAC1C,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,cAAc,EAAE,EAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAC,CAAC,CAAC;KACtF;;AAGD,IAAA,MAAM,IAAI,GAAA;AACR,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;;;AAI/B,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;AACrC,QAAA,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;AACvB,QAAA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;AAC1C,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,cAAc,EAAE,EAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,EAAC,CAAC,CAAC;KACtF;;AAGD,IAAA,MAAM,MAAM,GAAA;AACV,QAAA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;AAC1C,QAAA,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;KAC9D;;AAGD,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KAC3C;;AAGD,IAAA,MAAM,cAAc,GAAA;AAClB,QAAA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;AAC1C,QAAA,OAAO,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;KAClC;;;;;"}
|
package/fesm2022/tooltip.mjs
CHANGED
|
@@ -2,15 +2,12 @@ import { takeUntil } from 'rxjs/operators';
|
|
|
2
2
|
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
3
3
|
import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { InjectionToken, inject,
|
|
5
|
+
import { InjectionToken, inject, ElementRef, ViewContainerRef, NgZone, Injector, afterNextRender, Directive, Input, ChangeDetectorRef, ANIMATION_MODULE_TYPE, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
|
|
6
6
|
import { DOCUMENT, NgClass, CommonModule } from '@angular/common';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import * as i4 from '@angular/cdk/bidi';
|
|
12
|
-
import * as i1 from '@angular/cdk/overlay';
|
|
13
|
-
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
7
|
+
import { normalizePassiveListenerOptions, Platform } from '@angular/cdk/platform';
|
|
8
|
+
import { AriaDescriber, FocusMonitor, A11yModule } from '@angular/cdk/a11y';
|
|
9
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
10
|
+
import { Overlay, ScrollDispatcher, OverlayModule } from '@angular/cdk/overlay';
|
|
14
11
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
15
12
|
import { Subject } from 'rxjs';
|
|
16
13
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
@@ -169,20 +166,24 @@ class MatTooltip {
|
|
|
169
166
|
this._setTooltipClass(this._tooltipClass);
|
|
170
167
|
}
|
|
171
168
|
}
|
|
172
|
-
constructor(
|
|
173
|
-
this._overlay =
|
|
174
|
-
this._elementRef =
|
|
175
|
-
this._scrollDispatcher =
|
|
176
|
-
this._viewContainerRef =
|
|
177
|
-
this._ngZone =
|
|
178
|
-
this._platform =
|
|
179
|
-
this._ariaDescriber =
|
|
180
|
-
this._focusMonitor =
|
|
181
|
-
this._dir =
|
|
182
|
-
this.
|
|
169
|
+
constructor() {
|
|
170
|
+
this._overlay = inject(Overlay);
|
|
171
|
+
this._elementRef = inject(ElementRef);
|
|
172
|
+
this._scrollDispatcher = inject(ScrollDispatcher);
|
|
173
|
+
this._viewContainerRef = inject(ViewContainerRef);
|
|
174
|
+
this._ngZone = inject(NgZone);
|
|
175
|
+
this._platform = inject(Platform);
|
|
176
|
+
this._ariaDescriber = inject(AriaDescriber);
|
|
177
|
+
this._focusMonitor = inject(FocusMonitor);
|
|
178
|
+
this._dir = inject(Directionality);
|
|
179
|
+
this._injector = inject(Injector);
|
|
180
|
+
this._defaultOptions = inject(MAT_TOOLTIP_DEFAULT_OPTIONS, {
|
|
181
|
+
optional: true,
|
|
182
|
+
});
|
|
183
183
|
this._position = 'below';
|
|
184
184
|
this._positionAtOrigin = false;
|
|
185
185
|
this._disabled = false;
|
|
186
|
+
this._scrollStrategy = inject(MAT_TOOLTIP_SCROLL_STRATEGY);
|
|
186
187
|
this._viewInitialized = false;
|
|
187
188
|
this._pointerExitEventsInitialized = false;
|
|
188
189
|
this._tooltipComponent = TooltipComponent;
|
|
@@ -206,30 +207,30 @@ class MatTooltip {
|
|
|
206
207
|
this._message = '';
|
|
207
208
|
/** Manually-bound passive event listeners. */
|
|
208
209
|
this._passiveListeners = [];
|
|
210
|
+
/** Reference to the current document. */
|
|
211
|
+
this._document = inject(DOCUMENT);
|
|
209
212
|
/** Timer started at the last `touchstart` event. */
|
|
210
213
|
this._touchstartTimeout = null;
|
|
211
214
|
/** Emits when the component is destroyed. */
|
|
212
215
|
this._destroyed = new Subject();
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (_defaultOptions.position) {
|
|
220
|
-
this.position = _defaultOptions.position;
|
|
216
|
+
const defaultOptions = this._defaultOptions;
|
|
217
|
+
if (defaultOptions) {
|
|
218
|
+
this._showDelay = defaultOptions.showDelay;
|
|
219
|
+
this._hideDelay = defaultOptions.hideDelay;
|
|
220
|
+
if (defaultOptions.position) {
|
|
221
|
+
this.position = defaultOptions.position;
|
|
221
222
|
}
|
|
222
|
-
if (
|
|
223
|
-
this.positionAtOrigin =
|
|
223
|
+
if (defaultOptions.positionAtOrigin) {
|
|
224
|
+
this.positionAtOrigin = defaultOptions.positionAtOrigin;
|
|
224
225
|
}
|
|
225
|
-
if (
|
|
226
|
-
this.touchGestures =
|
|
226
|
+
if (defaultOptions.touchGestures) {
|
|
227
|
+
this.touchGestures = defaultOptions.touchGestures;
|
|
227
228
|
}
|
|
228
|
-
if (
|
|
229
|
-
this.tooltipClass =
|
|
229
|
+
if (defaultOptions.tooltipClass) {
|
|
230
|
+
this.tooltipClass = defaultOptions.tooltipClass;
|
|
230
231
|
}
|
|
231
232
|
}
|
|
232
|
-
_dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
233
|
+
this._dir.change.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
233
234
|
if (this._overlayRef) {
|
|
234
235
|
this._updatePosition(this._overlayRef);
|
|
235
236
|
}
|
|
@@ -586,7 +587,7 @@ class MatTooltip {
|
|
|
586
587
|
this._touchstartTimeout = setTimeout(() => {
|
|
587
588
|
this._touchstartTimeout = null;
|
|
588
589
|
this.show(undefined, origin);
|
|
589
|
-
}, this._defaultOptions
|
|
590
|
+
}, this._defaultOptions?.touchLongPressShowDelay ?? DEFAULT_LONGPRESS_DELAY);
|
|
590
591
|
},
|
|
591
592
|
]);
|
|
592
593
|
}
|
|
@@ -615,7 +616,7 @@ class MatTooltip {
|
|
|
615
616
|
if (this._touchstartTimeout) {
|
|
616
617
|
clearTimeout(this._touchstartTimeout);
|
|
617
618
|
}
|
|
618
|
-
this.hide(this._defaultOptions
|
|
619
|
+
this.hide(this._defaultOptions?.touchendHideDelay);
|
|
619
620
|
};
|
|
620
621
|
exitListeners.push(['touchend', touchendListener], ['touchcancel', touchendListener]);
|
|
621
622
|
}
|
|
@@ -688,7 +689,7 @@ class MatTooltip {
|
|
|
688
689
|
});
|
|
689
690
|
});
|
|
690
691
|
}
|
|
691
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: MatTooltip, deps: [
|
|
692
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: MatTooltip, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
692
693
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.3", type: MatTooltip, isStandalone: true, selector: "[matTooltip]", inputs: { position: ["matTooltipPosition", "position"], positionAtOrigin: ["matTooltipPositionAtOrigin", "positionAtOrigin"], disabled: ["matTooltipDisabled", "disabled"], showDelay: ["matTooltipShowDelay", "showDelay"], hideDelay: ["matTooltipHideDelay", "hideDelay"], touchGestures: ["matTooltipTouchGestures", "touchGestures"], message: ["matTooltip", "message"], tooltipClass: ["matTooltipClass", "tooltipClass"] }, host: { properties: { "class.mat-mdc-tooltip-disabled": "disabled" }, classAttribute: "mat-mdc-tooltip-trigger" }, exportAs: ["matTooltip"], ngImport: i0 }); }
|
|
693
694
|
}
|
|
694
695
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: MatTooltip, decorators: [{
|
|
@@ -702,18 +703,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.3",
|
|
|
702
703
|
},
|
|
703
704
|
standalone: true,
|
|
704
705
|
}]
|
|
705
|
-
}], ctorParameters: () => [
|
|
706
|
-
type: Inject,
|
|
707
|
-
args: [MAT_TOOLTIP_SCROLL_STRATEGY]
|
|
708
|
-
}] }, { type: i4.Directionality }, { type: undefined, decorators: [{
|
|
709
|
-
type: Optional
|
|
710
|
-
}, {
|
|
711
|
-
type: Inject,
|
|
712
|
-
args: [MAT_TOOLTIP_DEFAULT_OPTIONS]
|
|
713
|
-
}] }, { type: undefined, decorators: [{
|
|
714
|
-
type: Inject,
|
|
715
|
-
args: [DOCUMENT]
|
|
716
|
-
}] }], propDecorators: { position: [{
|
|
706
|
+
}], ctorParameters: () => [], propDecorators: { position: [{
|
|
717
707
|
type: Input,
|
|
718
708
|
args: ['matTooltipPosition']
|
|
719
709
|
}], positionAtOrigin: [{
|
|
@@ -743,9 +733,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.3",
|
|
|
743
733
|
* @docs-private
|
|
744
734
|
*/
|
|
745
735
|
class TooltipComponent {
|
|
746
|
-
constructor(
|
|
747
|
-
this._changeDetectorRef =
|
|
748
|
-
this._elementRef =
|
|
736
|
+
constructor() {
|
|
737
|
+
this._changeDetectorRef = inject(ChangeDetectorRef);
|
|
738
|
+
this._elementRef = inject(ElementRef);
|
|
749
739
|
/* Whether the tooltip text overflows to multiple lines */
|
|
750
740
|
this._isMultiline = false;
|
|
751
741
|
/** Whether interactions on the page should close the tooltip */
|
|
@@ -758,6 +748,7 @@ class TooltipComponent {
|
|
|
758
748
|
this._showAnimation = 'mat-mdc-tooltip-show';
|
|
759
749
|
/** Name of the hide animation and the class that toggles it. */
|
|
760
750
|
this._hideAnimation = 'mat-mdc-tooltip-hide';
|
|
751
|
+
const animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
|
|
761
752
|
this._animationsDisabled = animationMode === 'NoopAnimations';
|
|
762
753
|
}
|
|
763
754
|
/**
|
|
@@ -900,7 +891,7 @@ class TooltipComponent {
|
|
|
900
891
|
this._finalizeAnimation(isVisible);
|
|
901
892
|
}
|
|
902
893
|
}
|
|
903
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: TooltipComponent, deps: [
|
|
894
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
904
895
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.3", type: TooltipComponent, isStandalone: true, selector: "mat-tooltip-component", host: { attributes: { "aria-hidden": "true" }, listeners: { "mouseleave": "_handleMouseLeave($event)" } }, viewQueries: [{ propertyName: "_tooltip", first: true, predicate: ["tooltip"], descendants: true, static: true }], ngImport: i0, template: "<div\n #tooltip\n class=\"mdc-tooltip mat-mdc-tooltip\"\n [ngClass]=\"tooltipClass\"\n (animationend)=\"_handleAnimationEnd($event)\"\n [class.mdc-tooltip--multiline]=\"_isMultiline\">\n <div class=\"mat-mdc-tooltip-surface mdc-tooltip__surface\">{{message}}</div>\n</div>\n", styles: [".mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:\"\";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mdc-plain-tooltip-container-color, var(--mat-app-inverse-surface));color:var(--mdc-plain-tooltip-supporting-text-color, var(--mat-app-inverse-on-surface));border-radius:var(--mdc-plain-tooltip-container-shape, var(--mat-app-corner-extra-small));font-family:var(--mdc-plain-tooltip-supporting-text-font, var(--mat-app-body-small-font));font-size:var(--mdc-plain-tooltip-supporting-text-size, var(--mat-app-body-small-size));font-weight:var(--mdc-plain-tooltip-supporting-text-weight, var(--mat-app-body-small-weight));line-height:var(--mdc-plain-tooltip-supporting-text-line-height, var(--mat-app-body-small-line-height));letter-spacing:var(--mdc-plain-tooltip-supporting-text-tracking, var(--mat-app-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
905
896
|
}
|
|
906
897
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
@@ -909,12 +900,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.3",
|
|
|
909
900
|
'(mouseleave)': '_handleMouseLeave($event)',
|
|
910
901
|
'aria-hidden': 'true',
|
|
911
902
|
}, standalone: true, imports: [NgClass], template: "<div\n #tooltip\n class=\"mdc-tooltip mat-mdc-tooltip\"\n [ngClass]=\"tooltipClass\"\n (animationend)=\"_handleAnimationEnd($event)\"\n [class.mdc-tooltip--multiline]=\"_isMultiline\">\n <div class=\"mat-mdc-tooltip-surface mdc-tooltip__surface\">{{message}}</div>\n</div>\n", styles: [".mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:\"\";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mdc-plain-tooltip-container-color, var(--mat-app-inverse-surface));color:var(--mdc-plain-tooltip-supporting-text-color, var(--mat-app-inverse-on-surface));border-radius:var(--mdc-plain-tooltip-container-shape, var(--mat-app-corner-extra-small));font-family:var(--mdc-plain-tooltip-supporting-text-font, var(--mat-app-body-small-font));font-size:var(--mdc-plain-tooltip-supporting-text-size, var(--mat-app-body-small-size));font-weight:var(--mdc-plain-tooltip-supporting-text-weight, var(--mat-app-body-small-weight));line-height:var(--mdc-plain-tooltip-supporting-text-line-height, var(--mat-app-body-small-line-height));letter-spacing:var(--mdc-plain-tooltip-supporting-text-tracking, var(--mat-app-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:\"\";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}"] }]
|
|
912
|
-
}], ctorParameters: () => [
|
|
913
|
-
type: Optional
|
|
914
|
-
}, {
|
|
915
|
-
type: Inject,
|
|
916
|
-
args: [ANIMATION_MODULE_TYPE]
|
|
917
|
-
}] }], propDecorators: { _tooltip: [{
|
|
903
|
+
}], ctorParameters: () => [], propDecorators: { _tooltip: [{
|
|
918
904
|
type: ViewChild,
|
|
919
905
|
args: ['tooltip', {
|
|
920
906
|
// Use a static query here since we interact directly with
|