@angular/material 19.2.3 → 19.2.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/autocomplete/index.d.ts +12 -5
- package/autocomplete/testing/index.d.ts +2 -1
- package/badge/index.d.ts +7 -98
- package/badge/testing/index.d.ts +3 -1
- package/badge.d-49a8a74b.d.ts +98 -0
- package/bottom-sheet/index.d.ts +2 -2
- package/button/index.d.ts +10 -220
- package/button-toggle/index.d.ts +10 -257
- package/button-toggle/testing/index.d.ts +4 -1
- package/button-toggle.d-edc8acff.d.ts +257 -0
- package/card/index.d.ts +3 -2
- package/checkbox/index.d.ts +4 -3
- package/chips/index.d.ts +8 -4
- package/common-module.d-0e6515ae.d.ts +43 -0
- package/core/index.d.ts +21 -846
- package/core/testing/index.d.ts +3 -61
- package/core/tokens/m3/definitions/_md-comp-elevated-card.scss +3 -1
- package/core/tokens/m3/definitions/_md-sys-color.scss +44 -2
- package/core/tokens/m3/definitions/_md-sys-typescale.scss +20 -1
- package/date-adapter.d-c6835d41.d.ts +267 -0
- package/date-range-input-harness.d-549a9f7e.d.ts +278 -0
- package/datepicker/index.d.ts +18 -12
- package/datepicker/testing/index.d.ts +5 -277
- package/dialog/index.d.ts +12 -360
- package/dialog/testing/index.d.ts +6 -1
- package/dialog.d-7187c941.d.ts +357 -0
- package/divider/index.d.ts +3 -2
- package/divider/testing/index.d.ts +2 -14
- package/divider-harness.d-d34fede4.d.ts +14 -0
- package/error-options.d-448d9046.d.ts +17 -0
- package/expansion/index.d.ts +3 -2
- package/fesm2022/autocomplete/testing.mjs +2 -1
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +14 -3
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +2 -1
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +3 -1
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +7 -1
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +14 -481
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +3 -1
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +7 -1
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +11 -2
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/common-module-a39ee957.mjs +42 -0
- package/fesm2022/common-module-a39ee957.mjs.map +1 -0
- package/fesm2022/core/testing.mjs +3 -76
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +27 -1587
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/date-formats-b618acb8.mjs +190 -0
- package/fesm2022/date-formats-b618acb8.mjs.map +1 -0
- package/fesm2022/date-range-input-harness-ee47cdb0.mjs +467 -0
- package/fesm2022/date-range-input-harness-ee47cdb0.mjs.map +1 -0
- package/fesm2022/datepicker/testing.mjs +5 -465
- package/fesm2022/datepicker/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +23 -13
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +12 -1
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +14 -897
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs +2 -17
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider-harness-3394f29a.mjs +18 -0
- package/fesm2022/divider-harness-3394f29a.mjs.map +1 -0
- package/fesm2022/divider.mjs +3 -1
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/error-options-aca21924.mjs +29 -0
- package/fesm2022/error-options-aca21924.mjs.map +1 -0
- package/fesm2022/error-state-8f4ce1af.mjs +37 -0
- package/fesm2022/error-state-8f4ce1af.mjs.map +1 -0
- package/fesm2022/expansion.mjs +3 -1
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing/control.mjs +2 -10
- package/fesm2022/form-field/testing/control.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs +7 -4
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/form-field-50ec956f.mjs +1076 -0
- package/fesm2022/form-field-50ec956f.mjs.map +1 -0
- package/fesm2022/form-field-control-harness-af6fd278.mjs +11 -0
- package/fesm2022/form-field-control-harness-af6fd278.mjs.map +1 -0
- package/fesm2022/form-field.mjs +14 -1106
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs +1 -1
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +8 -147
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +5 -1
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon-button-655c4ed3.mjs +275 -0
- package/fesm2022/icon-button-655c4ed3.mjs.map +1 -0
- package/fesm2022/icon-module-881c6455.mjs +395 -0
- package/fesm2022/icon-module-881c6455.mjs.map +1 -0
- package/fesm2022/icon-registry-e1064d47.mjs +639 -0
- package/fesm2022/icon-registry-e1064d47.mjs.map +1 -0
- package/fesm2022/icon.mjs +11 -1024
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/index-2f2536d6.mjs +22 -0
- package/fesm2022/index-2f2536d6.mjs.map +1 -0
- package/fesm2022/index-a36e3c7c.mjs +20 -0
- package/fesm2022/index-a36e3c7c.mjs.map +1 -0
- package/fesm2022/input/testing.mjs +5 -113
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/input-harness-ed59decc.mjs +115 -0
- package/fesm2022/input-harness-ed59decc.mjs.map +1 -0
- package/fesm2022/input-value-accessor-8a79a24e.mjs +12 -0
- package/fesm2022/input-value-accessor-8a79a24e.mjs.map +1 -0
- package/fesm2022/input.mjs +14 -12
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/internal-form-field-5960ea2e.mjs +27 -0
- package/fesm2022/internal-form-field-5960ea2e.mjs.map +1 -0
- package/fesm2022/line-11b0093d.mjs +59 -0
- package/fesm2022/line-11b0093d.mjs.map +1 -0
- package/fesm2022/list/testing.mjs +1 -1
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs +8 -1
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +5 -1
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/module-0776ab9b.mjs +38 -0
- package/fesm2022/module-0776ab9b.mjs.map +1 -0
- package/fesm2022/module-087ecec3.mjs +970 -0
- package/fesm2022/module-087ecec3.mjs.map +1 -0
- package/fesm2022/module-6b33072b.mjs +218 -0
- package/fesm2022/module-6b33072b.mjs.map +1 -0
- package/fesm2022/module-b0a3e0af.mjs +1293 -0
- package/fesm2022/module-b0a3e0af.mjs.map +1 -0
- package/fesm2022/module-b3de5709.mjs +899 -0
- package/fesm2022/module-b3de5709.mjs.map +1 -0
- package/fesm2022/optgroup-harness-5e66b138.mjs +36 -0
- package/fesm2022/optgroup-harness-5e66b138.mjs.map +1 -0
- package/fesm2022/option-cb353f7a.mjs +348 -0
- package/fesm2022/option-cb353f7a.mjs.map +1 -0
- package/fesm2022/option-harness-3b7c1106.mjs +46 -0
- package/fesm2022/option-harness-3b7c1106.mjs.map +1 -0
- package/fesm2022/paginator/testing.mjs +4 -1
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +33 -7
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +3 -1
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +3 -1
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/pseudo-checkbox-4a60d45e.mjs +52 -0
- package/fesm2022/pseudo-checkbox-4a60d45e.mjs.map +1 -0
- package/fesm2022/pseudo-checkbox-module-31a58606.mjs +20 -0
- package/fesm2022/pseudo-checkbox-module-31a58606.mjs.map +1 -0
- package/fesm2022/public-api-c5ab57f5.mjs +147 -0
- package/fesm2022/public-api-c5ab57f5.mjs.map +1 -0
- package/fesm2022/radio.mjs +8 -1
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/ripple-5bdada85.mjs +639 -0
- package/fesm2022/ripple-5bdada85.mjs.map +1 -0
- package/fesm2022/ripple-loader-dabcd93d.mjs +165 -0
- package/fesm2022/ripple-loader-dabcd93d.mjs.map +1 -0
- package/fesm2022/select/testing.mjs +5 -121
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select-harness-8c55824d.mjs +123 -0
- package/fesm2022/select-harness-8c55824d.mjs.map +1 -0
- package/fesm2022/select.mjs +30 -1288
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +1 -1
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +7 -1
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +6 -1
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +10 -2
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +3 -1
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper.mjs +11 -2
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/structural-styles-326dcb39.mjs +18 -0
- package/fesm2022/structural-styles-326dcb39.mjs.map +1 -0
- package/fesm2022/table.mjs +3 -1
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs.mjs +4 -1
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker/testing.mjs +1 -1
- package/fesm2022/timepicker/testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +19 -5
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +3 -1
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +15 -968
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree.mjs +3 -1
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/index.d.ts +12 -437
- package/form-field/testing/control/index.d.ts +2 -10
- package/form-field/testing/index.d.ts +7 -5
- package/form-field-control-harness.d-2d91f25a.d.ts +10 -0
- package/form-field-control.d-eb86711c.d.ts +62 -0
- package/form-field.d-2edbc094.d.ts +367 -0
- package/grid-list/index.d.ts +5 -3
- package/icon/index.d.ts +9 -449
- package/icon/testing/index.d.ts +3 -1
- package/icon-module.d-aa3bbba0.d.ts +167 -0
- package/icon-registry.d-1dffe9de.d.ts +286 -0
- package/index.d-0536b706.d.ts +11 -0
- package/index.d-37e31cd3.d.ts +13 -0
- package/input/index.d.ts +11 -6
- package/input/testing/index.d.ts +4 -59
- package/input-harness.d-4eecd1d3.d.ts +60 -0
- package/line.d-570a2537.d.ts +25 -0
- package/list/index.d.ts +13 -19
- package/list/testing/index.d.ts +2 -2
- package/list-option-types.d-8739f903.d.ts +15 -0
- package/menu/index.d.ts +6 -3
- package/module.d-74a721b9.d.ts +326 -0
- package/module.d-ba05faa6.d.ts +448 -0
- package/module.d-c17c834e.d.ts +18 -0
- package/module.d-f490a6d4.d.ts +224 -0
- package/optgroup-harness.d-7f741f69.d.ts +31 -0
- package/option-harness.d-3d33fc9a.d.ts +34 -0
- package/option-parent.d-559ad5c5.d.ts +19 -0
- package/option.d-6f493d78.d.ts +146 -0
- package/package.json +2 -2
- package/paginator/index.d.ts +29 -201
- package/paginator/testing/index.d.ts +4 -1
- package/paginator.d-40b1766e.d.ts +199 -0
- package/palette.d-ec4a617c.d.ts +4 -0
- package/progress-bar/index.d.ts +4 -3
- package/progress-spinner/index.d.ts +7 -96
- package/progress-spinner/testing/index.d.ts +3 -1
- package/progress-spinner.d-1fc040c5.d.ts +96 -0
- package/pseudo-checkbox-module.d-3abc0461.d.ts +44 -0
- package/radio/index.d.ts +7 -3
- package/ripple-loader.d-8aac2988.d.ts +48 -0
- package/ripple.d-2fb57d04.d.ts +255 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/select/index.d.ts +24 -446
- package/select/testing/index.d.ts +5 -62
- package/select-harness.d-7441a7ac.d.ts +63 -0
- package/sidenav/index.d.ts +4 -3
- package/slide-toggle/index.d.ts +4 -3
- package/slider/index.d.ts +6 -3
- package/snack-bar/index.d.ts +8 -3
- package/sort/index.d.ts +10 -88
- package/sort/testing/index.d.ts +1 -1
- package/sort-direction.d-f4ce4649.d.ts +3 -0
- package/sort.d-c2b79a45.d.ts +87 -0
- package/stepper/index.d.ts +9 -4
- package/table/index.d.ts +11 -4
- package/tabs/index.d.ts +5 -3
- package/timepicker/index.d.ts +6 -3
- package/timepicker/testing/index.d.ts +1 -1
- package/toolbar/index.d.ts +3 -2
- package/tooltip/index.d.ts +10 -325
- package/tree/index.d.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/progress-spinner/testing/progress-spinner-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 {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {ProgressSpinnerMode} from '
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/progress-spinner/testing/progress-spinner-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 {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {ProgressSpinnerMode} from '../progress-spinner';\nimport {ProgressSpinnerHarnessFilters} from './progress-spinner-harness-filters';\n\n/** Harness for interacting with a MDC based mat-progress-spinner in tests. */\nexport class MatProgressSpinnerHarness extends ComponentHarness {\n /** The selector for the host element of a `MatProgressSpinner` instance. */\n static hostSelector = '.mat-mdc-progress-spinner';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a progress spinnner with specific\n * attributes.\n * @param options Options for filtering which progress spinner instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatProgressSpinnerHarness>(\n this: ComponentHarnessConstructor<T>,\n options: ProgressSpinnerHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n\n /** Gets the progress spinner's value. */\n async getValue(): Promise<number | null> {\n const host = await this.host();\n const ariaValue = await host.getAttribute('aria-valuenow');\n return ariaValue ? coerceNumberProperty(ariaValue) : null;\n }\n\n /** Gets the progress spinner's mode. */\n async getMode(): Promise<ProgressSpinnerMode> {\n const modeAttr = (await this.host()).getAttribute('mode');\n return (await modeAttr) as ProgressSpinnerMode;\n }\n}\n"],"names":[],"mappings":";;;AAiBA;AACM,MAAO,yBAA0B,SAAQ,gBAAgB,CAAA;;AAE7D,IAAA,OAAO,YAAY,GAAG,2BAA2B,CAAA;AAEjD;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAET,OAAA,GAAyC,EAAE,EAAA;AAE3C,QAAA,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;KAC5C;;AAGA,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QAC9B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;AAC1D,QAAA,OAAO,SAAS,GAAG,oBAAoB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAA;KAC3D;;AAGA,IAAA,MAAM,OAAO,GAAA;AACX,QAAA,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;AACzD,QAAA,QAAQ,MAAM,QAAQ,EAAwB;KAChD;;;;;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, ElementRef, ANIMATION_MODULE_TYPE, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ViewChild, NgModule } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
|
-
import { MatCommonModule } from '
|
|
4
|
+
import { M as MatCommonModule } from './common-module-a39ee957.mjs';
|
|
5
|
+
import '@angular/cdk/a11y';
|
|
6
|
+
import '@angular/cdk/bidi';
|
|
5
7
|
|
|
6
8
|
/** Injection token to be used to override the default options for `mat-progress-spinner`. */
|
|
7
9
|
const MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS = new InjectionToken('mat-progress-spinner-default-options', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-spinner.mjs","sources":["../../../../../../src/material/progress-spinner/progress-spinner.ts","../../../../../../src/material/progress-spinner/progress-spinner.html","../../../../../../src/material/progress-spinner/module.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 ChangeDetectionStrategy,\n Component,\n ElementRef,\n InjectionToken,\n Input,\n ViewChild,\n ViewEncapsulation,\n numberAttribute,\n ANIMATION_MODULE_TYPE,\n inject,\n} from '@angular/core';\nimport {ThemePalette} from '@angular/material/core';\nimport {NgTemplateOutlet} from '@angular/common';\n\n/** Possible mode for a progress spinner. */\nexport type ProgressSpinnerMode = 'determinate' | 'indeterminate';\n\n/** Default `mat-progress-spinner` options that can be overridden. */\nexport interface MatProgressSpinnerDefaultOptions {\n /**\n * Default theme color of the progress spinner. This API is supported in M2 themes only, it\n * has no effect in M3 themes. For color customization in M3, see https://material.angular.io/components/progress-spinner/styling.\n *\n * For information on applying color variants in M3, see\n * https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants\n */\n color?: ThemePalette;\n /** Diameter of the spinner. */\n diameter?: number;\n /** Width of the spinner's stroke. */\n strokeWidth?: number;\n /**\n * Whether the animations should be force to be enabled, ignoring if the current environment is\n * using NoopAnimationsModule.\n */\n _forceAnimations?: boolean;\n}\n\n/** Injection token to be used to override the default options for `mat-progress-spinner`. */\nexport const MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS =\n new InjectionToken<MatProgressSpinnerDefaultOptions>('mat-progress-spinner-default-options', {\n providedIn: 'root',\n factory: MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY,\n });\n\n/**\n * @docs-private\n * @deprecated No longer used, will be removed.\n * @breaking-change 21.0.0\n */\nexport function MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY(): MatProgressSpinnerDefaultOptions {\n return {diameter: BASE_SIZE};\n}\n\n/**\n * Base reference size of the spinner.\n */\nconst BASE_SIZE = 100;\n\n/**\n * Base reference stroke width of the spinner.\n */\nconst BASE_STROKE_WIDTH = 10;\n\n@Component({\n selector: 'mat-progress-spinner, mat-spinner',\n exportAs: 'matProgressSpinner',\n host: {\n 'role': 'progressbar',\n 'class': 'mat-mdc-progress-spinner mdc-circular-progress',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n 'tabindex': '-1',\n '[class]': '\"mat-\" + color',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[class.mdc-circular-progress--indeterminate]': 'mode === \"indeterminate\"',\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n '[style.--mdc-circular-progress-size]': 'diameter + \"px\"',\n '[style.--mdc-circular-progress-active-indicator-width]': 'diameter + \"px\"',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuemax]': '100',\n '[attr.aria-valuenow]': 'mode === \"determinate\" ? value : null',\n '[attr.mode]': 'mode',\n },\n templateUrl: 'progress-spinner.html',\n styleUrl: 'progress-spinner.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet],\n})\nexport class MatProgressSpinner {\n readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Whether the _mat-animation-noopable class should be applied, disabling animations. */\n _noopAnimations: boolean;\n\n // TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.\n /**\n * Theme color of the progress spinner. This API is supported in M2 themes only, it\n * has no effect in M3 themes. For color customization in M3, see https://material.angular.io/components/progress-spinner/styling.\n *\n * For information on applying color variants in M3, see\n * https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants\n */\n @Input()\n get color() {\n return this._color || this._defaultColor;\n }\n set color(value: string | null | undefined) {\n this._color = value;\n }\n private _color: string | null | undefined;\n private _defaultColor: ThemePalette = 'primary';\n\n /** The element of the determinate spinner. */\n @ViewChild('determinateSpinner') _determinateCircle: ElementRef<HTMLElement>;\n\n constructor(...args: unknown[]);\n\n constructor() {\n const animationMode = inject(ANIMATION_MODULE_TYPE, {optional: true});\n const defaults = inject<MatProgressSpinnerDefaultOptions>(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS);\n\n this._noopAnimations =\n animationMode === 'NoopAnimations' && !!defaults && !defaults._forceAnimations;\n this.mode =\n this._elementRef.nativeElement.nodeName.toLowerCase() === 'mat-spinner'\n ? 'indeterminate'\n : 'determinate';\n\n if (defaults) {\n if (defaults.color) {\n this.color = this._defaultColor = defaults.color;\n }\n\n if (defaults.diameter) {\n this.diameter = defaults.diameter;\n }\n\n if (defaults.strokeWidth) {\n this.strokeWidth = defaults.strokeWidth;\n }\n }\n }\n\n /**\n * Mode of the progress bar.\n *\n * Input must be one of these values: determinate, indeterminate, buffer, query, defaults to\n * 'determinate'.\n * Mirrored to mode attribute.\n */\n @Input() mode: ProgressSpinnerMode;\n\n /** Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow. */\n @Input({transform: numberAttribute})\n get value(): number {\n return this.mode === 'determinate' ? this._value : 0;\n }\n set value(v: number) {\n this._value = Math.max(0, Math.min(100, v || 0));\n }\n private _value = 0;\n\n /** The diameter of the progress spinner (will set width and height of svg). */\n @Input({transform: numberAttribute})\n get diameter(): number {\n return this._diameter;\n }\n set diameter(size: number) {\n this._diameter = size || 0;\n }\n private _diameter = BASE_SIZE;\n\n /** Stroke width of the progress spinner. */\n @Input({transform: numberAttribute})\n get strokeWidth(): number {\n return this._strokeWidth ?? this.diameter / 10;\n }\n set strokeWidth(value: number) {\n this._strokeWidth = value || 0;\n }\n private _strokeWidth: number;\n\n /** The radius of the spinner, adjusted for stroke width. */\n _circleRadius(): number {\n return (this.diameter - BASE_STROKE_WIDTH) / 2;\n }\n\n /** The view box of the spinner's svg element. */\n _viewBox() {\n const viewBox = this._circleRadius() * 2 + this.strokeWidth;\n return `0 0 ${viewBox} ${viewBox}`;\n }\n\n /** The stroke circumference of the svg circle. */\n _strokeCircumference(): number {\n return 2 * Math.PI * this._circleRadius();\n }\n\n /** The dash offset of the svg circle. */\n _strokeDashOffset() {\n if (this.mode === 'determinate') {\n return (this._strokeCircumference() * (100 - this._value)) / 100;\n }\n return null;\n }\n\n /** Stroke width of the circle in percent. */\n _circleStrokeWidth() {\n return (this.strokeWidth / this.diameter) * 100;\n }\n}\n\n/**\n * @deprecated Import Progress Spinner instead. Note that the\n * `mat-spinner` selector isn't deprecated.\n * @breaking-change 16.0.0\n */\n// tslint:disable-next-line:variable-name\nexport const MatSpinner = MatProgressSpinner;\n","<ng-template #circle>\n <svg [attr.viewBox]=\"_viewBox()\" class=\"mdc-circular-progress__indeterminate-circle-graphic\"\n xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <circle [attr.r]=\"_circleRadius()\"\n [style.stroke-dasharray.px]=\"_strokeCircumference()\"\n [style.stroke-dashoffset.px]=\"_strokeCircumference() / 2\"\n [style.stroke-width.%]=\"_circleStrokeWidth()\"\n cx=\"50%\" cy=\"50%\"/>\n </svg>\n</ng-template>\n\n<!--\n All children need to be hidden for screen readers in order to support ChromeVox.\n More context in the issue: https://github.com/angular/components/issues/22165.\n-->\n<div class=\"mdc-circular-progress__determinate-container\" aria-hidden=\"true\" #determinateSpinner>\n <svg [attr.viewBox]=\"_viewBox()\" class=\"mdc-circular-progress__determinate-circle-graphic\"\n xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <circle [attr.r]=\"_circleRadius()\"\n [style.stroke-dasharray.px]=\"_strokeCircumference()\"\n [style.stroke-dashoffset.px]=\"_strokeDashOffset()\"\n [style.stroke-width.%]=\"_circleStrokeWidth()\"\n class=\"mdc-circular-progress__determinate-circle\"\n cx=\"50%\" cy=\"50%\"/>\n </svg>\n</div>\n<!--TODO: figure out why there are 3 separate svgs-->\n<div class=\"mdc-circular-progress__indeterminate-container\" aria-hidden=\"true\">\n <div class=\"mdc-circular-progress__spinner-layer\">\n <div class=\"mdc-circular-progress__circle-clipper mdc-circular-progress__circle-left\">\n <ng-container [ngTemplateOutlet]=\"circle\"></ng-container>\n </div>\n <div class=\"mdc-circular-progress__gap-patch\">\n <ng-container [ngTemplateOutlet]=\"circle\"></ng-container>\n </div>\n <div class=\"mdc-circular-progress__circle-clipper mdc-circular-progress__circle-right\">\n <ng-container [ngTemplateOutlet]=\"circle\"></ng-container>\n </div>\n </div>\n</div>\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 {MatProgressSpinner, MatSpinner} from './progress-spinner';\n\n@NgModule({\n imports: [MatProg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A,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,YAFO,eAAe,CAAA,EAAA,CAAA,CAAA;;2FAE9C,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,UAAU,CAAC;AACzC,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,UAAU,EAAE,eAAe,CAAC;AAC3D,iBAAA,CAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"progress-spinner.mjs","sources":["../../../../../../src/material/progress-spinner/progress-spinner.ts","../../../../../../src/material/progress-spinner/progress-spinner.html","../../../../../../src/material/progress-spinner/module.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 ChangeDetectionStrategy,\n Component,\n ElementRef,\n InjectionToken,\n Input,\n ViewChild,\n ViewEncapsulation,\n numberAttribute,\n ANIMATION_MODULE_TYPE,\n inject,\n} from '@angular/core';\nimport {ThemePalette} from '../core';\nimport {NgTemplateOutlet} from '@angular/common';\n\n/** Possible mode for a progress spinner. */\nexport type ProgressSpinnerMode = 'determinate' | 'indeterminate';\n\n/** Default `mat-progress-spinner` options that can be overridden. */\nexport interface MatProgressSpinnerDefaultOptions {\n /**\n * Default theme color of the progress spinner. This API is supported in M2 themes only, it\n * has no effect in M3 themes. For color customization in M3, see https://material.angular.io/components/progress-spinner/styling.\n *\n * For information on applying color variants in M3, see\n * https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants\n */\n color?: ThemePalette;\n /** Diameter of the spinner. */\n diameter?: number;\n /** Width of the spinner's stroke. */\n strokeWidth?: number;\n /**\n * Whether the animations should be force to be enabled, ignoring if the current environment is\n * using NoopAnimationsModule.\n */\n _forceAnimations?: boolean;\n}\n\n/** Injection token to be used to override the default options for `mat-progress-spinner`. */\nexport const MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS =\n new InjectionToken<MatProgressSpinnerDefaultOptions>('mat-progress-spinner-default-options', {\n providedIn: 'root',\n factory: MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY,\n });\n\n/**\n * @docs-private\n * @deprecated No longer used, will be removed.\n * @breaking-change 21.0.0\n */\nexport function MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY(): MatProgressSpinnerDefaultOptions {\n return {diameter: BASE_SIZE};\n}\n\n/**\n * Base reference size of the spinner.\n */\nconst BASE_SIZE = 100;\n\n/**\n * Base reference stroke width of the spinner.\n */\nconst BASE_STROKE_WIDTH = 10;\n\n@Component({\n selector: 'mat-progress-spinner, mat-spinner',\n exportAs: 'matProgressSpinner',\n host: {\n 'role': 'progressbar',\n 'class': 'mat-mdc-progress-spinner mdc-circular-progress',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n 'tabindex': '-1',\n '[class]': '\"mat-\" + color',\n '[class._mat-animation-noopable]': `_noopAnimations`,\n '[class.mdc-circular-progress--indeterminate]': 'mode === \"indeterminate\"',\n '[style.width.px]': 'diameter',\n '[style.height.px]': 'diameter',\n '[style.--mdc-circular-progress-size]': 'diameter + \"px\"',\n '[style.--mdc-circular-progress-active-indicator-width]': 'diameter + \"px\"',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuemax]': '100',\n '[attr.aria-valuenow]': 'mode === \"determinate\" ? value : null',\n '[attr.mode]': 'mode',\n },\n templateUrl: 'progress-spinner.html',\n styleUrl: 'progress-spinner.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet],\n})\nexport class MatProgressSpinner {\n readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** Whether the _mat-animation-noopable class should be applied, disabling animations. */\n _noopAnimations: boolean;\n\n // TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.\n /**\n * Theme color of the progress spinner. This API is supported in M2 themes only, it\n * has no effect in M3 themes. For color customization in M3, see https://material.angular.io/components/progress-spinner/styling.\n *\n * For information on applying color variants in M3, see\n * https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants\n */\n @Input()\n get color() {\n return this._color || this._defaultColor;\n }\n set color(value: string | null | undefined) {\n this._color = value;\n }\n private _color: string | null | undefined;\n private _defaultColor: ThemePalette = 'primary';\n\n /** The element of the determinate spinner. */\n @ViewChild('determinateSpinner') _determinateCircle: ElementRef<HTMLElement>;\n\n constructor(...args: unknown[]);\n\n constructor() {\n const animationMode = inject(ANIMATION_MODULE_TYPE, {optional: true});\n const defaults = inject<MatProgressSpinnerDefaultOptions>(MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS);\n\n this._noopAnimations =\n animationMode === 'NoopAnimations' && !!defaults && !defaults._forceAnimations;\n this.mode =\n this._elementRef.nativeElement.nodeName.toLowerCase() === 'mat-spinner'\n ? 'indeterminate'\n : 'determinate';\n\n if (defaults) {\n if (defaults.color) {\n this.color = this._defaultColor = defaults.color;\n }\n\n if (defaults.diameter) {\n this.diameter = defaults.diameter;\n }\n\n if (defaults.strokeWidth) {\n this.strokeWidth = defaults.strokeWidth;\n }\n }\n }\n\n /**\n * Mode of the progress bar.\n *\n * Input must be one of these values: determinate, indeterminate, buffer, query, defaults to\n * 'determinate'.\n * Mirrored to mode attribute.\n */\n @Input() mode: ProgressSpinnerMode;\n\n /** Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow. */\n @Input({transform: numberAttribute})\n get value(): number {\n return this.mode === 'determinate' ? this._value : 0;\n }\n set value(v: number) {\n this._value = Math.max(0, Math.min(100, v || 0));\n }\n private _value = 0;\n\n /** The diameter of the progress spinner (will set width and height of svg). */\n @Input({transform: numberAttribute})\n get diameter(): number {\n return this._diameter;\n }\n set diameter(size: number) {\n this._diameter = size || 0;\n }\n private _diameter = BASE_SIZE;\n\n /** Stroke width of the progress spinner. */\n @Input({transform: numberAttribute})\n get strokeWidth(): number {\n return this._strokeWidth ?? this.diameter / 10;\n }\n set strokeWidth(value: number) {\n this._strokeWidth = value || 0;\n }\n private _strokeWidth: number;\n\n /** The radius of the spinner, adjusted for stroke width. */\n _circleRadius(): number {\n return (this.diameter - BASE_STROKE_WIDTH) / 2;\n }\n\n /** The view box of the spinner's svg element. */\n _viewBox() {\n const viewBox = this._circleRadius() * 2 + this.strokeWidth;\n return `0 0 ${viewBox} ${viewBox}`;\n }\n\n /** The stroke circumference of the svg circle. */\n _strokeCircumference(): number {\n return 2 * Math.PI * this._circleRadius();\n }\n\n /** The dash offset of the svg circle. */\n _strokeDashOffset() {\n if (this.mode === 'determinate') {\n return (this._strokeCircumference() * (100 - this._value)) / 100;\n }\n return null;\n }\n\n /** Stroke width of the circle in percent. */\n _circleStrokeWidth() {\n return (this.strokeWidth / this.diameter) * 100;\n }\n}\n\n/**\n * @deprecated Import Progress Spinner instead. Note that the\n * `mat-spinner` selector isn't deprecated.\n * @breaking-change 16.0.0\n */\n// tslint:disable-next-line:variable-name\nexport const MatSpinner = MatProgressSpinner;\n","<ng-template #circle>\n <svg [attr.viewBox]=\"_viewBox()\" class=\"mdc-circular-progress__indeterminate-circle-graphic\"\n xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <circle [attr.r]=\"_circleRadius()\"\n [style.stroke-dasharray.px]=\"_strokeCircumference()\"\n [style.stroke-dashoffset.px]=\"_strokeCircumference() / 2\"\n [style.stroke-width.%]=\"_circleStrokeWidth()\"\n cx=\"50%\" cy=\"50%\"/>\n </svg>\n</ng-template>\n\n<!--\n All children need to be hidden for screen readers in order to support ChromeVox.\n More context in the issue: https://github.com/angular/components/issues/22165.\n-->\n<div class=\"mdc-circular-progress__determinate-container\" aria-hidden=\"true\" #determinateSpinner>\n <svg [attr.viewBox]=\"_viewBox()\" class=\"mdc-circular-progress__determinate-circle-graphic\"\n xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\">\n <circle [attr.r]=\"_circleRadius()\"\n [style.stroke-dasharray.px]=\"_strokeCircumference()\"\n [style.stroke-dashoffset.px]=\"_strokeDashOffset()\"\n [style.stroke-width.%]=\"_circleStrokeWidth()\"\n class=\"mdc-circular-progress__determinate-circle\"\n cx=\"50%\" cy=\"50%\"/>\n </svg>\n</div>\n<!--TODO: figure out why there are 3 separate svgs-->\n<div class=\"mdc-circular-progress__indeterminate-container\" aria-hidden=\"true\">\n <div class=\"mdc-circular-progress__spinner-layer\">\n <div class=\"mdc-circular-progress__circle-clipper mdc-circular-progress__circle-left\">\n <ng-container [ngTemplateOutlet]=\"circle\"></ng-container>\n </div>\n <div class=\"mdc-circular-progress__gap-patch\">\n <ng-container [ngTemplateOutlet]=\"circle\"></ng-container>\n </div>\n <div class=\"mdc-circular-progress__circle-clipper mdc-circular-progress__circle-right\">\n <ng-container [ngTemplateOutlet]=\"circle\"></ng-container>\n </div>\n </div>\n</div>\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 '../core';\nimport {MatProgressSpinner, MatSpinner} from './progress-spinner';\n\n@NgModule({\n imports: [MatProgressSpinner, MatSpinner],\n exports: [MatProgressSpinner, MatSpinner, MatCommonModule],\n})\nexport class MatProgressSpinnerModule {}\n"],"names":[],"mappings":";;;;;;;AA+CA;MACa,oCAAoC,GAC/C,IAAI,cAAc,CAAmC,sCAAsC,EAAE;AAC3F,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,4CAA4C;AACtD,CAAA,EAAC;AAEJ;;;;AAIG;SACa,4CAA4C,GAAA;AAC1D,IAAA,OAAO,EAAC,QAAQ,EAAE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oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,UAAU,EAAE,eAAe,CAAC;AAC3D,iBAAA,CAAA;;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ANIMATION_MODULE_TYPE, Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Component that shows a simplified checkbox without including any kind of "real" checkbox.
|
|
6
|
+
* Meant to be used when the checkbox is purely decorative and a large number of them will be
|
|
7
|
+
* included, such as for the options in a multi-select. Uses no SVGs or complex animations.
|
|
8
|
+
* Note that theming is meant to be handled by the parent element, e.g.
|
|
9
|
+
* `mat-primary .mat-pseudo-checkbox`.
|
|
10
|
+
*
|
|
11
|
+
* Note that this component will be completely invisible to screen-reader users. This is *not*
|
|
12
|
+
* interchangeable with `<mat-checkbox>` and should *not* be used if the user would directly
|
|
13
|
+
* interact with the checkbox. The pseudo-checkbox should only be used as an implementation detail
|
|
14
|
+
* of more complex components that appropriately handle selected / checked state.
|
|
15
|
+
* @docs-private
|
|
16
|
+
*/
|
|
17
|
+
class MatPseudoCheckbox {
|
|
18
|
+
_animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
|
|
19
|
+
/** Display state of the checkbox. */
|
|
20
|
+
state = 'unchecked';
|
|
21
|
+
/** Whether the checkbox is disabled. */
|
|
22
|
+
disabled = false;
|
|
23
|
+
/**
|
|
24
|
+
* Appearance of the pseudo checkbox. Default appearance of 'full' renders a checkmark/mixedmark
|
|
25
|
+
* indicator inside a square box. 'minimal' appearance only renders the checkmark/mixedmark.
|
|
26
|
+
*/
|
|
27
|
+
appearance = 'full';
|
|
28
|
+
constructor() { }
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.0", type: MatPseudoCheckbox, isStandalone: true, selector: "mat-pseudo-checkbox", inputs: { state: "state", disabled: "disabled", appearance: "appearance" }, host: { properties: { "class.mat-pseudo-checkbox-indeterminate": "state === \"indeterminate\"", "class.mat-pseudo-checkbox-checked": "state === \"checked\"", "class.mat-pseudo-checkbox-disabled": "disabled", "class.mat-pseudo-checkbox-minimal": "appearance === \"minimal\"", "class.mat-pseudo-checkbox-full": "appearance === \"full\"", "class._mat-animation-noopable": "_animationMode === \"NoopAnimations\"" }, classAttribute: "mat-pseudo-checkbox" }, ngImport: i0, template: '', isInline: true, styles: [".mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:\"\";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-minimal-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-full-pseudo-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-full-pseudo-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-full-pseudo-checkbox-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-full-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-full-pseudo-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-full-pseudo-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
31
|
+
}
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckbox, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{ encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, selector: 'mat-pseudo-checkbox', template: '', host: {
|
|
35
|
+
'class': 'mat-pseudo-checkbox',
|
|
36
|
+
'[class.mat-pseudo-checkbox-indeterminate]': 'state === "indeterminate"',
|
|
37
|
+
'[class.mat-pseudo-checkbox-checked]': 'state === "checked"',
|
|
38
|
+
'[class.mat-pseudo-checkbox-disabled]': 'disabled',
|
|
39
|
+
'[class.mat-pseudo-checkbox-minimal]': 'appearance === "minimal"',
|
|
40
|
+
'[class.mat-pseudo-checkbox-full]': 'appearance === "full"',
|
|
41
|
+
'[class._mat-animation-noopable]': '_animationMode === "NoopAnimations"',
|
|
42
|
+
}, styles: [".mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:\"\";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-minimal-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-full-pseudo-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-full-pseudo-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-full-pseudo-checkbox-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-full-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-full-pseudo-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-full-pseudo-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}"] }]
|
|
43
|
+
}], ctorParameters: () => [], propDecorators: { state: [{
|
|
44
|
+
type: Input
|
|
45
|
+
}], disabled: [{
|
|
46
|
+
type: Input
|
|
47
|
+
}], appearance: [{
|
|
48
|
+
type: Input
|
|
49
|
+
}] } });
|
|
50
|
+
|
|
51
|
+
export { MatPseudoCheckbox as M };
|
|
52
|
+
//# sourceMappingURL=pseudo-checkbox-4a60d45e.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pseudo-checkbox-4a60d45e.mjs","sources":["../../../../../../src/material/core/selection/pseudo-checkbox/pseudo-checkbox.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 Component,\n ViewEncapsulation,\n Input,\n ChangeDetectionStrategy,\n ANIMATION_MODULE_TYPE,\n inject,\n} from '@angular/core';\n\n/**\n * Possible states for a pseudo checkbox.\n * @docs-private\n */\nexport type MatPseudoCheckboxState = 'unchecked' | 'checked' | 'indeterminate';\n\n/**\n * Component that shows a simplified checkbox without including any kind of \"real\" checkbox.\n * Meant to be used when the checkbox is purely decorative and a large number of them will be\n * included, such as for the options in a multi-select. Uses no SVGs or complex animations.\n * Note that theming is meant to be handled by the parent element, e.g.\n * `mat-primary .mat-pseudo-checkbox`.\n *\n * Note that this component will be completely invisible to screen-reader users. This is *not*\n * interchangeable with `<mat-checkbox>` and should *not* be used if the user would directly\n * interact with the checkbox. The pseudo-checkbox should only be used as an implementation detail\n * of more complex components that appropriately handle selected / checked state.\n * @docs-private\n */\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'mat-pseudo-checkbox',\n styleUrl: 'pseudo-checkbox.css',\n template: '',\n host: {\n 'class': 'mat-pseudo-checkbox',\n '[class.mat-pseudo-checkbox-indeterminate]': 'state === \"indeterminate\"',\n '[class.mat-pseudo-checkbox-checked]': 'state === \"checked\"',\n '[class.mat-pseudo-checkbox-disabled]': 'disabled',\n '[class.mat-pseudo-checkbox-minimal]': 'appearance === \"minimal\"',\n '[class.mat-pseudo-checkbox-full]': 'appearance === \"full\"',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n },\n})\nexport class MatPseudoCheckbox {\n _animationMode? = inject(ANIMATION_MODULE_TYPE, {optional: true});\n\n /** Display state of the checkbox. */\n @Input() state: MatPseudoCheckboxState = 'unchecked';\n\n /** Whether the checkbox is disabled. */\n @Input() disabled: boolean = false;\n\n /**\n * Appearance of the pseudo checkbox. Default appearance of 'full' renders a checkmark/mixedmark\n * indicator inside a square box. 'minimal' appearance only renders the checkmark/mixedmark.\n */\n @Input() appearance: 'minimal' | 'full' = 'full';\n\n constructor(...args: unknown[]);\n constructor() {}\n}\n"],"names":[],"mappings":";;;AAuBA;;;;;;;;;;;;AAYG;MAiBU,iBAAiB,CAAA;IAC5B,cAAc,GAAI,MAAM,CAAC,qBAAqB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAA;;IAGxD,KAAK,GAA2B,WAAW,CAAA;;IAG3C,QAAQ,GAAY,KAAK,CAAA;AAElC;;;AAGG;IACM,UAAU,GAAuB,MAAM,CAAA;AAGhD,IAAA,WAAA,GAAA,GAAe;uGAhBJ,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,gmBAXlB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,+xGAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAWD,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAhB7B,SAAS;oCACO,iBAAiB,CAAC,IAAI,EAAA,eAAA,EACpB,uBAAuB,CAAC,MAAM,EACrC,QAAA,EAAA,qBAAqB,EAErB,QAAA,EAAA,EAAE,EACN,IAAA,EAAA;AACJ,wBAAA,OAAO,EAAE,qBAAqB;AAC9B,wBAAA,2CAA2C,EAAE,2BAA2B;AACxE,wBAAA,qCAAqC,EAAE,qBAAqB;AAC5D,wBAAA,sCAAsC,EAAE,UAAU;AAClD,wBAAA,qCAAqC,EAAE,0BAA0B;AACjE,wBAAA,kCAAkC,EAAE,uBAAuB;AAC3D,wBAAA,iCAAiC,EAAE,qCAAqC;AACzE,qBAAA,EAAA,MAAA,EAAA,CAAA,+xGAAA,CAAA,EAAA,CAAA;wDAMQ,KAAK,EAAA,CAAA;sBAAb,KAAK;gBAGG,QAAQ,EAAA,CAAA;sBAAhB,KAAK;gBAMG,UAAU,EAAA,CAAA;sBAAlB,KAAK;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { M as MatPseudoCheckbox } from './pseudo-checkbox-4a60d45e.mjs';
|
|
4
|
+
import { M as MatCommonModule } from './common-module-a39ee957.mjs';
|
|
5
|
+
|
|
6
|
+
class MatPseudoCheckboxModule {
|
|
7
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
8
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckboxModule, imports: [MatCommonModule, MatPseudoCheckbox], exports: [MatPseudoCheckbox] });
|
|
9
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckboxModule, imports: [MatCommonModule] });
|
|
10
|
+
}
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: MatPseudoCheckboxModule, decorators: [{
|
|
12
|
+
type: NgModule,
|
|
13
|
+
args: [{
|
|
14
|
+
imports: [MatCommonModule, MatPseudoCheckbox],
|
|
15
|
+
exports: [MatPseudoCheckbox],
|
|
16
|
+
}]
|
|
17
|
+
}] });
|
|
18
|
+
|
|
19
|
+
export { MatPseudoCheckboxModule as M };
|
|
20
|
+
//# sourceMappingURL=pseudo-checkbox-module-31a58606.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pseudo-checkbox-module-31a58606.mjs","sources":["../../../../../../src/material/core/selection/pseudo-checkbox/pseudo-checkbox-module.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 {NgModule} from '@angular/core';\nimport {MatPseudoCheckbox} from './pseudo-checkbox';\nimport {MatCommonModule} from '../../common-behaviors/common-module';\n\n@NgModule({\n imports: [MatCommonModule, MatPseudoCheckbox],\n exports: [MatPseudoCheckbox],\n})\nexport class MatPseudoCheckboxModule {}\n"],"names":[],"mappings":";;;;;MAgBa,uBAAuB,CAAA;uGAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,EAHxB,OAAA,EAAA,CAAA,eAAe,EAAE,iBAAiB,aAClC,iBAAiB,CAAA,EAAA,CAAA,CAAA;AAEhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YAHxB,eAAe,CAAA,EAAA,CAAA,CAAA;;2FAGd,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,eAAe,EAAE,iBAAiB,CAAC;oBAC7C,OAAO,EAAE,CAAC,iBAAiB,CAAC;AAC7B,iBAAA,CAAA;;;;;"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class for determining, from a list of tiles, the (row, col) position of each of those tiles
|
|
3
|
+
* in the grid. This is necessary (rather than just rendering the tiles in normal document flow)
|
|
4
|
+
* because the tiles can have a rowspan.
|
|
5
|
+
*
|
|
6
|
+
* The positioning algorithm greedily places each tile as soon as it encounters a gap in the grid
|
|
7
|
+
* large enough to accommodate it so that the tiles still render in the same order in which they
|
|
8
|
+
* are given.
|
|
9
|
+
*
|
|
10
|
+
* The basis of the algorithm is the use of an array to track the already placed tiles. Each
|
|
11
|
+
* element of the array corresponds to a column, and the value indicates how many cells in that
|
|
12
|
+
* column are already occupied; zero indicates an empty cell. Moving "down" to the next row
|
|
13
|
+
* decrements each value in the tracking array (indicating that the column is one cell closer to
|
|
14
|
+
* being free).
|
|
15
|
+
*
|
|
16
|
+
* @docs-private
|
|
17
|
+
*/
|
|
18
|
+
class TileCoordinator {
|
|
19
|
+
/** Tracking array (see class description). */
|
|
20
|
+
tracker;
|
|
21
|
+
/** Index at which the search for the next gap will start. */
|
|
22
|
+
columnIndex = 0;
|
|
23
|
+
/** The current row index. */
|
|
24
|
+
rowIndex = 0;
|
|
25
|
+
/** Gets the total number of rows occupied by tiles */
|
|
26
|
+
get rowCount() {
|
|
27
|
+
return this.rowIndex + 1;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Gets the total span of rows occupied by tiles.
|
|
31
|
+
* Ex: A list with 1 row that contains a tile with rowspan 2 will have a total rowspan of 2.
|
|
32
|
+
*/
|
|
33
|
+
get rowspan() {
|
|
34
|
+
const lastRowMax = Math.max(...this.tracker);
|
|
35
|
+
// if any of the tiles has a rowspan that pushes it beyond the total row count,
|
|
36
|
+
// add the difference to the rowcount
|
|
37
|
+
return lastRowMax > 1 ? this.rowCount + lastRowMax - 1 : this.rowCount;
|
|
38
|
+
}
|
|
39
|
+
/** The computed (row, col) position of each tile (the output). */
|
|
40
|
+
positions;
|
|
41
|
+
/**
|
|
42
|
+
* Updates the tile positions.
|
|
43
|
+
* @param numColumns Amount of columns in the grid.
|
|
44
|
+
* @param tiles Tiles to be positioned.
|
|
45
|
+
*/
|
|
46
|
+
update(numColumns, tiles) {
|
|
47
|
+
this.columnIndex = 0;
|
|
48
|
+
this.rowIndex = 0;
|
|
49
|
+
this.tracker = new Array(numColumns);
|
|
50
|
+
this.tracker.fill(0, 0, this.tracker.length);
|
|
51
|
+
this.positions = tiles.map(tile => this._trackTile(tile));
|
|
52
|
+
}
|
|
53
|
+
/** Calculates the row and col position of a tile. */
|
|
54
|
+
_trackTile(tile) {
|
|
55
|
+
// Find a gap large enough for this tile.
|
|
56
|
+
const gapStartIndex = this._findMatchingGap(tile.colspan);
|
|
57
|
+
// Place tile in the resulting gap.
|
|
58
|
+
this._markTilePosition(gapStartIndex, tile);
|
|
59
|
+
// The next time we look for a gap, the search will start at columnIndex, which should be
|
|
60
|
+
// immediately after the tile that has just been placed.
|
|
61
|
+
this.columnIndex = gapStartIndex + tile.colspan;
|
|
62
|
+
return new TilePosition(this.rowIndex, gapStartIndex);
|
|
63
|
+
}
|
|
64
|
+
/** Finds the next available space large enough to fit the tile. */
|
|
65
|
+
_findMatchingGap(tileCols) {
|
|
66
|
+
if (tileCols > this.tracker.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
67
|
+
throw Error(`mat-grid-list: tile with colspan ${tileCols} is wider than ` +
|
|
68
|
+
`grid with cols="${this.tracker.length}".`);
|
|
69
|
+
}
|
|
70
|
+
// Start index is inclusive, end index is exclusive.
|
|
71
|
+
let gapStartIndex = -1;
|
|
72
|
+
let gapEndIndex = -1;
|
|
73
|
+
// Look for a gap large enough to fit the given tile. Empty spaces are marked with a zero.
|
|
74
|
+
do {
|
|
75
|
+
// If we've reached the end of the row, go to the next row.
|
|
76
|
+
if (this.columnIndex + tileCols > this.tracker.length) {
|
|
77
|
+
this._nextRow();
|
|
78
|
+
gapStartIndex = this.tracker.indexOf(0, this.columnIndex);
|
|
79
|
+
gapEndIndex = this._findGapEndIndex(gapStartIndex);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
gapStartIndex = this.tracker.indexOf(0, this.columnIndex);
|
|
83
|
+
// If there are no more empty spaces in this row at all, move on to the next row.
|
|
84
|
+
if (gapStartIndex == -1) {
|
|
85
|
+
this._nextRow();
|
|
86
|
+
gapStartIndex = this.tracker.indexOf(0, this.columnIndex);
|
|
87
|
+
gapEndIndex = this._findGapEndIndex(gapStartIndex);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
gapEndIndex = this._findGapEndIndex(gapStartIndex);
|
|
91
|
+
// If a gap large enough isn't found, we want to start looking immediately after the current
|
|
92
|
+
// gap on the next iteration.
|
|
93
|
+
this.columnIndex = gapStartIndex + 1;
|
|
94
|
+
// Continue iterating until we find a gap wide enough for this tile. Since gapEndIndex is
|
|
95
|
+
// exclusive, gapEndIndex is 0 means we didn't find a gap and should continue.
|
|
96
|
+
} while (gapEndIndex - gapStartIndex < tileCols || gapEndIndex == 0);
|
|
97
|
+
// If we still didn't manage to find a gap, ensure that the index is
|
|
98
|
+
// at least zero so the tile doesn't get pulled out of the grid.
|
|
99
|
+
return Math.max(gapStartIndex, 0);
|
|
100
|
+
}
|
|
101
|
+
/** Move "down" to the next row. */
|
|
102
|
+
_nextRow() {
|
|
103
|
+
this.columnIndex = 0;
|
|
104
|
+
this.rowIndex++;
|
|
105
|
+
// Decrement all spaces by one to reflect moving down one row.
|
|
106
|
+
for (let i = 0; i < this.tracker.length; i++) {
|
|
107
|
+
this.tracker[i] = Math.max(0, this.tracker[i] - 1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Finds the end index (exclusive) of a gap given the index from which to start looking.
|
|
112
|
+
* The gap ends when a non-zero value is found.
|
|
113
|
+
*/
|
|
114
|
+
_findGapEndIndex(gapStartIndex) {
|
|
115
|
+
for (let i = gapStartIndex + 1; i < this.tracker.length; i++) {
|
|
116
|
+
if (this.tracker[i] != 0) {
|
|
117
|
+
return i;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// The gap ends with the end of the row.
|
|
121
|
+
return this.tracker.length;
|
|
122
|
+
}
|
|
123
|
+
/** Update the tile tracker to account for the given tile in the given space. */
|
|
124
|
+
_markTilePosition(start, tile) {
|
|
125
|
+
for (let i = 0; i < tile.colspan; i++) {
|
|
126
|
+
this.tracker[start + i] = tile.rowspan;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Simple data structure for tile position (row, col).
|
|
132
|
+
* @docs-private
|
|
133
|
+
*/
|
|
134
|
+
class TilePosition {
|
|
135
|
+
row;
|
|
136
|
+
col;
|
|
137
|
+
constructor(row, col) {
|
|
138
|
+
this.row = row;
|
|
139
|
+
this.col = col;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Privately exported for the grid-list harness.
|
|
144
|
+
const ɵTileCoordinator = TileCoordinator;
|
|
145
|
+
|
|
146
|
+
export { TileCoordinator as T, ɵTileCoordinator as ɵ };
|
|
147
|
+
//# sourceMappingURL=public-api-c5ab57f5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api-c5ab57f5.mjs","sources":["../../../../../../src/material/grid-list/tile-coordinator.ts","../../../../../../src/material/grid-list/public-api.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\n/**\n * Interface describing a tile.\n * @docs-private\n */\nexport interface Tile {\n /** Amount of rows that the tile takes up. */\n rowspan: number;\n /** Amount of columns that the tile takes up. */\n colspan: number;\n}\n\n/**\n * Class for determining, from a list of tiles, the (row, col) position of each of those tiles\n * in the grid. This is necessary (rather than just rendering the tiles in normal document flow)\n * because the tiles can have a rowspan.\n *\n * The positioning algorithm greedily places each tile as soon as it encounters a gap in the grid\n * large enough to accommodate it so that the tiles still render in the same order in which they\n * are given.\n *\n * The basis of the algorithm is the use of an array to track the already placed tiles. Each\n * element of the array corresponds to a column, and the value indicates how many cells in that\n * column are already occupied; zero indicates an empty cell. Moving \"down\" to the next row\n * decrements each value in the tracking array (indicating that the column is one cell closer to\n * being free).\n *\n * @docs-private\n */\nexport class TileCoordinator {\n /** Tracking array (see class description). */\n tracker: number[];\n\n /** Index at which the search for the next gap will start. */\n columnIndex: number = 0;\n\n /** The current row index. */\n rowIndex: number = 0;\n\n /** Gets the total number of rows occupied by tiles */\n get rowCount(): number {\n return this.rowIndex + 1;\n }\n\n /**\n * Gets the total span of rows occupied by tiles.\n * Ex: A list with 1 row that contains a tile with rowspan 2 will have a total rowspan of 2.\n */\n get rowspan() {\n const lastRowMax = Math.max(...this.tracker);\n // if any of the tiles has a rowspan that pushes it beyond the total row count,\n // add the difference to the rowcount\n return lastRowMax > 1 ? this.rowCount + lastRowMax - 1 : this.rowCount;\n }\n\n /** The computed (row, col) position of each tile (the output). */\n positions: TilePosition[];\n\n /**\n * Updates the tile positions.\n * @param numColumns Amount of columns in the grid.\n * @param tiles Tiles to be positioned.\n */\n update(numColumns: number, tiles: Tile[]) {\n this.columnIndex = 0;\n this.rowIndex = 0;\n\n this.tracker = new Array(numColumns);\n this.tracker.fill(0, 0, this.tracker.length);\n this.positions = tiles.map(tile => this._trackTile(tile));\n }\n\n /** Calculates the row and col position of a tile. */\n private _trackTile(tile: Tile): TilePosition {\n // Find a gap large enough for this tile.\n const gapStartIndex = this._findMatchingGap(tile.colspan);\n\n // Place tile in the resulting gap.\n this._markTilePosition(gapStartIndex, tile);\n\n // The next time we look for a gap, the search will start at columnIndex, which should be\n // immediately after the tile that has just been placed.\n this.columnIndex = gapStartIndex + tile.colspan;\n\n return new TilePosition(this.rowIndex, gapStartIndex);\n }\n\n /** Finds the next available space large enough to fit the tile. */\n private _findMatchingGap(tileCols: number): number {\n if (tileCols > this.tracker.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error(\n `mat-grid-list: tile with colspan ${tileCols} is wider than ` +\n `grid with cols=\"${this.tracker.length}\".`,\n );\n }\n\n // Start index is inclusive, end index is exclusive.\n let gapStartIndex = -1;\n let gapEndIndex = -1;\n\n // Look for a gap large enough to fit the given tile. Empty spaces are marked with a zero.\n do {\n // If we've reached the end of the row, go to the next row.\n if (this.columnIndex + tileCols > this.tracker.length) {\n this._nextRow();\n gapStartIndex = this.tracker.indexOf(0, this.columnIndex);\n gapEndIndex = this._findGapEndIndex(gapStartIndex);\n continue;\n }\n\n gapStartIndex = this.tracker.indexOf(0, this.columnIndex);\n\n // If there are no more empty spaces in this row at all, move on to the next row.\n if (gapStartIndex == -1) {\n this._nextRow();\n gapStartIndex = this.tracker.indexOf(0, this.columnIndex);\n gapEndIndex = this._findGapEndIndex(gapStartIndex);\n continue;\n }\n\n gapEndIndex = this._findGapEndIndex(gapStartIndex);\n\n // If a gap large enough isn't found, we want to start looking immediately after the current\n // gap on the next iteration.\n this.columnIndex = gapStartIndex + 1;\n\n // Continue iterating until we find a gap wide enough for this tile. Since gapEndIndex is\n // exclusive, gapEndIndex is 0 means we didn't find a gap and should continue.\n } while (gapEndIndex - gapStartIndex < tileCols || gapEndIndex == 0);\n\n // If we still didn't manage to find a gap, ensure that the index is\n // at least zero so the tile doesn't get pulled out of the grid.\n return Math.max(gapStartIndex, 0);\n }\n\n /** Move \"down\" to the next row. */\n private _nextRow(): void {\n this.columnIndex = 0;\n this.rowIndex++;\n\n // Decrement all spaces by one to reflect moving down one row.\n for (let i = 0; i < this.tracker.length; i++) {\n this.tracker[i] = Math.max(0, this.tracker[i] - 1);\n }\n }\n\n /**\n * Finds the end index (exclusive) of a gap given the index from which to start looking.\n * The gap ends when a non-zero value is found.\n */\n private _findGapEndIndex(gapStartIndex: number): number {\n for (let i = gapStartIndex + 1; i < this.tracker.length; i++) {\n if (this.tracker[i] != 0) {\n return i;\n }\n }\n\n // The gap ends with the end of the row.\n return this.tracker.length;\n }\n\n /** Update the tile tracker to account for the given tile in the given space. */\n private _markTilePosition(start: number, tile: Tile): void {\n for (let i = 0; i < tile.colspan; i++) {\n this.tracker[start + i] = tile.rowspan;\n }\n }\n}\n\n/**\n * Simple data structure for tile position (row, col).\n * @docs-private\n */\nexport class TilePosition {\n constructor(\n public row: number,\n public col: number,\n ) {}\n}\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 */\nimport {TileCoordinator} from './tile-coordinator';\n\nexport * from './grid-list-module';\nexport * from './grid-list';\nexport * from './grid-tile';\n\n// Privately exported for the grid-list harness.\nexport const ɵTileCoordinator = TileCoordinator;\n"],"names":[],"mappings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GAAG,IAAI,CAAC,OAAO,CAAA;SACxC;KACF;AACD,CAAA;AAED;;;AAGG;MACU,YAAY,CAAA;AAEd,IAAA,GAAA,CAAA;AACA,IAAA,GAAA,CAAA;IAFT,WACS,CAAA,GAAW,EACX,GAAW,EAAA;QADX,IAAG,CAAA,GAAA,GAAH,GAAG,CAAA;QACH,IAAG,CAAA,GAAA,GAAH,GAAG,CAAA;KACT;AACJ;;AC5KD;AACO,MAAM,gBAAgB,GAAG;;;;"}
|
package/fesm2022/radio.mjs
CHANGED
|
@@ -3,8 +3,15 @@ import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { forwardRef, InjectionToken, inject, ChangeDetectorRef, EventEmitter, booleanAttribute, Directive, Output, ContentChildren, Input, ElementRef, NgZone, Renderer2, Injector, ANIMATION_MODULE_TYPE, HostAttributeToken, numberAttribute, afterNextRender, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, NgModule } from '@angular/core';
|
|
5
5
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
|
-
import { _StructuralStylesLoader, MatRipple, _MatInternalFormField, MatCommonModule, MatRippleModule } from '@angular/material/core';
|
|
7
6
|
import { _CdkPrivateStyleLoader } from '@angular/cdk/private';
|
|
7
|
+
import { _ as _StructuralStylesLoader } from './structural-styles-326dcb39.mjs';
|
|
8
|
+
import { M as MatRipple } from './ripple-5bdada85.mjs';
|
|
9
|
+
import { _ as _MatInternalFormField } from './internal-form-field-5960ea2e.mjs';
|
|
10
|
+
import { M as MatCommonModule } from './common-module-a39ee957.mjs';
|
|
11
|
+
import { M as MatRippleModule } from './index-a36e3c7c.mjs';
|
|
12
|
+
import '@angular/cdk/platform';
|
|
13
|
+
import '@angular/cdk/coercion';
|
|
14
|
+
import '@angular/cdk/bidi';
|
|
8
15
|
|
|
9
16
|
/** Change event object emitted by radio button and radio group. */
|
|
10
17
|
class MatRadioChange {
|