@angular/cdk 19.2.13 → 19.2.15
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/_adev_assets/cdk_testing.json +7032 -1
- package/_adev_assets/cdk_testing_protractor.json +1747 -1
- package/_adev_assets/cdk_testing_selenium_webdriver.json +1801 -1
- package/_adev_assets/cdk_testing_testbed.json +1903 -1
- package/dialog/index.d.ts +17 -12
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/dialog.mjs +21 -9
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/testing.mjs +255 -52
- package/fesm2022/testing.mjs.map +1 -1
- package/{harness-environment.d-BatBdODN.d.ts → harness-environment.d-BbFzIFDE.d.ts} +362 -89
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/testing/index.d.ts +6 -2
- package/testing/selenium-webdriver/index.d.ts +1 -1
- package/testing/testbed/index.d.ts +1 -1
- package/npm_package/LICENSE +0 -21
- package/npm_package/README.md +0 -6
- package/npm_package/_adev_assets/cdk_testing.json +0 -1
- package/npm_package/_adev_assets/cdk_testing_protractor.json +0 -1
- package/npm_package/_adev_assets/cdk_testing_selenium_webdriver.json +0 -1
- package/npm_package/_adev_assets/cdk_testing_testbed.json +0 -1
- package/npm_package/_index.scss +0 -8
- package/npm_package/a11y/_index.scss +0 -60
- package/npm_package/a11y/index.d.ts +0 -550
- package/npm_package/a11y-module.d-DBHGyKoh.d.ts +0 -314
- package/npm_package/a11y-prebuilt.css +0 -1
- package/npm_package/accordion/index.d.ts +0 -90
- package/npm_package/activedescendant-key-manager.d-Bjic5obv.d.ts +0 -32
- package/npm_package/bidi/index.d.ts +0 -21
- package/npm_package/bidi-module.d-D-fEBKdS.d.ts +0 -54
- package/npm_package/clipboard/index.d.ts +0 -101
- package/npm_package/coercion/index.d.ts +0 -45
- package/npm_package/coercion/private/index.d.ts +0 -9
- package/npm_package/collections/index.d.ts +0 -99
- package/npm_package/data-source.d-Bblv7Zvh.d.ts +0 -43
- package/npm_package/dialog/index.d.ts +0 -426
- package/npm_package/drag-drop/index.d.ts +0 -1383
- package/npm_package/fesm2022/a11y-module-BYox5gpI.mjs +0 -952
- package/npm_package/fesm2022/a11y-module-BYox5gpI.mjs.map +0 -1
- package/npm_package/fesm2022/a11y.mjs +0 -539
- package/npm_package/fesm2022/a11y.mjs.map +0 -1
- package/npm_package/fesm2022/accordion.mjs +0 -210
- package/npm_package/fesm2022/accordion.mjs.map +0 -1
- package/npm_package/fesm2022/activedescendant-key-manager-DC3-fwQI.mjs +0 -16
- package/npm_package/fesm2022/activedescendant-key-manager-DC3-fwQI.mjs.map +0 -1
- package/npm_package/fesm2022/array-I1yfCXUO.mjs +0 -6
- package/npm_package/fesm2022/array-I1yfCXUO.mjs.map +0 -1
- package/npm_package/fesm2022/backwards-compatibility-DHR38MsD.mjs +0 -25
- package/npm_package/fesm2022/backwards-compatibility-DHR38MsD.mjs.map +0 -1
- package/npm_package/fesm2022/bidi.mjs +0 -80
- package/npm_package/fesm2022/bidi.mjs.map +0 -1
- package/npm_package/fesm2022/boolean-property-DaaVhX5A.mjs +0 -7
- package/npm_package/fesm2022/boolean-property-DaaVhX5A.mjs.map +0 -1
- package/npm_package/fesm2022/breakpoints-observer-CljOfYGy.mjs +0 -179
- package/npm_package/fesm2022/breakpoints-observer-CljOfYGy.mjs.map +0 -1
- package/npm_package/fesm2022/cdk.mjs +0 -7
- package/npm_package/fesm2022/cdk.mjs.map +0 -1
- package/npm_package/fesm2022/clipboard.mjs +0 -211
- package/npm_package/fesm2022/clipboard.mjs.map +0 -1
- package/npm_package/fesm2022/coercion/private.mjs +0 -15
- package/npm_package/fesm2022/coercion/private.mjs.map +0 -1
- package/npm_package/fesm2022/coercion.mjs +0 -39
- package/npm_package/fesm2022/coercion.mjs.map +0 -1
- package/npm_package/fesm2022/collections.mjs +0 -8
- package/npm_package/fesm2022/collections.mjs.map +0 -1
- package/npm_package/fesm2022/css-pixel-value-C_HEqLhI.mjs +0 -10
- package/npm_package/fesm2022/css-pixel-value-C_HEqLhI.mjs.map +0 -1
- package/npm_package/fesm2022/data-source-D34wiQZj.mjs +0 -15
- package/npm_package/fesm2022/data-source-D34wiQZj.mjs.map +0 -1
- package/npm_package/fesm2022/dialog.mjs +0 -870
- package/npm_package/fesm2022/dialog.mjs.map +0 -1
- package/npm_package/fesm2022/directionality-CBXD4hga.mjs +0 -72
- package/npm_package/fesm2022/directionality-CBXD4hga.mjs.map +0 -1
- package/npm_package/fesm2022/dispose-view-repeater-strategy-D_JReLI1.mjs +0 -44
- package/npm_package/fesm2022/dispose-view-repeater-strategy-D_JReLI1.mjs.map +0 -1
- package/npm_package/fesm2022/drag-drop.mjs +0 -4359
- package/npm_package/fesm2022/drag-drop.mjs.map +0 -1
- package/npm_package/fesm2022/element-x4z00URv.mjs +0 -29
- package/npm_package/fesm2022/element-x4z00URv.mjs.map +0 -1
- package/npm_package/fesm2022/fake-event-detection-DWOdFTFz.mjs +0 -24
- package/npm_package/fesm2022/fake-event-detection-DWOdFTFz.mjs.map +0 -1
- package/npm_package/fesm2022/focus-key-manager-C1rAQJ5z.mjs +0 -22
- package/npm_package/fesm2022/focus-key-manager-C1rAQJ5z.mjs.map +0 -1
- package/npm_package/fesm2022/focus-monitor-e2l_RpN3.mjs +0 -629
- package/npm_package/fesm2022/focus-monitor-e2l_RpN3.mjs.map +0 -1
- package/npm_package/fesm2022/id-generator-Dw_9dSDu.mjs +0 -37
- package/npm_package/fesm2022/id-generator-Dw_9dSDu.mjs.map +0 -1
- package/npm_package/fesm2022/keycodes-CpHkExLC.mjs +0 -122
- package/npm_package/fesm2022/keycodes-CpHkExLC.mjs.map +0 -1
- package/npm_package/fesm2022/keycodes.mjs +0 -15
- package/npm_package/fesm2022/keycodes.mjs.map +0 -1
- package/npm_package/fesm2022/layout.mjs +0 -43
- package/npm_package/fesm2022/layout.mjs.map +0 -1
- package/npm_package/fesm2022/list-key-manager-CyOIXo8P.mjs +0 -360
- package/npm_package/fesm2022/list-key-manager-CyOIXo8P.mjs.map +0 -1
- package/npm_package/fesm2022/listbox.mjs +0 -925
- package/npm_package/fesm2022/listbox.mjs.map +0 -1
- package/npm_package/fesm2022/menu.mjs +0 -1966
- package/npm_package/fesm2022/menu.mjs.map +0 -1
- package/npm_package/fesm2022/observers/private.mjs +0 -124
- package/npm_package/fesm2022/observers/private.mjs.map +0 -1
- package/npm_package/fesm2022/observers.mjs +0 -210
- package/npm_package/fesm2022/observers.mjs.map +0 -1
- package/npm_package/fesm2022/overlay-module-BUj0D19H.mjs +0 -3029
- package/npm_package/fesm2022/overlay-module-BUj0D19H.mjs.map +0 -1
- package/npm_package/fesm2022/overlay.mjs +0 -102
- package/npm_package/fesm2022/overlay.mjs.map +0 -1
- package/npm_package/fesm2022/passive-listeners-esHZRgIN.mjs +0 -31
- package/npm_package/fesm2022/passive-listeners-esHZRgIN.mjs.map +0 -1
- package/npm_package/fesm2022/platform-DmdVEw_C.mjs +0 -77
- package/npm_package/fesm2022/platform-DmdVEw_C.mjs.map +0 -1
- package/npm_package/fesm2022/platform.mjs +0 -74
- package/npm_package/fesm2022/platform.mjs.map +0 -1
- package/npm_package/fesm2022/portal-directives-Bw5woq8I.mjs +0 -653
- package/npm_package/fesm2022/portal-directives-Bw5woq8I.mjs.map +0 -1
- package/npm_package/fesm2022/portal.mjs +0 -29
- package/npm_package/fesm2022/portal.mjs.map +0 -1
- package/npm_package/fesm2022/private.mjs +0 -19
- package/npm_package/fesm2022/private.mjs.map +0 -1
- package/npm_package/fesm2022/recycle-view-repeater-strategy-DoWdPqVw.mjs +0 -156
- package/npm_package/fesm2022/recycle-view-repeater-strategy-DoWdPqVw.mjs.map +0 -1
- package/npm_package/fesm2022/scrolling-BkvA05C8.mjs +0 -99
- package/npm_package/fesm2022/scrolling-BkvA05C8.mjs.map +0 -1
- package/npm_package/fesm2022/scrolling.mjs +0 -1464
- package/npm_package/fesm2022/scrolling.mjs.map +0 -1
- package/npm_package/fesm2022/selection-model-CeeHVIcP.mjs +0 -226
- package/npm_package/fesm2022/selection-model-CeeHVIcP.mjs.map +0 -1
- package/npm_package/fesm2022/shadow-dom-B0oHn41l.mjs +0 -49
- package/npm_package/fesm2022/shadow-dom-B0oHn41l.mjs.map +0 -1
- package/npm_package/fesm2022/stepper.mjs +0 -614
- package/npm_package/fesm2022/stepper.mjs.map +0 -1
- package/npm_package/fesm2022/style-loader-Cu9AvjH9.mjs +0 -47
- package/npm_package/fesm2022/style-loader-Cu9AvjH9.mjs.map +0 -1
- package/npm_package/fesm2022/table.mjs +0 -2602
- package/npm_package/fesm2022/table.mjs.map +0 -1
- package/npm_package/fesm2022/test-environment-CT0XxPyp.mjs +0 -19
- package/npm_package/fesm2022/test-environment-CT0XxPyp.mjs.map +0 -1
- package/npm_package/fesm2022/testing/selenium-webdriver.mjs +0 -353
- package/npm_package/fesm2022/testing/selenium-webdriver.mjs.map +0 -1
- package/npm_package/fesm2022/testing/testbed.mjs +0 -782
- package/npm_package/fesm2022/testing/testbed.mjs.map +0 -1
- package/npm_package/fesm2022/testing.mjs +0 -698
- package/npm_package/fesm2022/testing.mjs.map +0 -1
- package/npm_package/fesm2022/text-field.mjs +0 -437
- package/npm_package/fesm2022/text-field.mjs.map +0 -1
- package/npm_package/fesm2022/tree-key-manager-KnCoIkIC.mjs +0 -360
- package/npm_package/fesm2022/tree-key-manager-KnCoIkIC.mjs.map +0 -1
- package/npm_package/fesm2022/tree.mjs +0 -1795
- package/npm_package/fesm2022/tree.mjs.map +0 -1
- package/npm_package/fesm2022/typeahead-9ZW4Dtsf.mjs +0 -88
- package/npm_package/fesm2022/typeahead-9ZW4Dtsf.mjs.map +0 -1
- package/npm_package/fesm2022/unique-selection-dispatcher-DtHZDqyJ.mjs +0 -49
- package/npm_package/fesm2022/unique-selection-dispatcher-DtHZDqyJ.mjs.map +0 -1
- package/npm_package/focus-key-manager.d-BIKDy8oD.d.ts +0 -34
- package/npm_package/focus-monitor.d-CvvJeQRc.d.ts +0 -210
- package/npm_package/harness-environment.d-BatBdODN.d.ts +0 -620
- package/npm_package/index.d.ts +0 -6
- package/npm_package/keycodes/index.d.ts +0 -129
- package/npm_package/layout/index.d.ts +0 -89
- package/npm_package/list-key-manager.d-BlK3jyRn.d.ts +0 -165
- package/npm_package/listbox/index.d.ts +0 -353
- package/npm_package/menu/index.d.ts +0 -821
- package/npm_package/number-property.d-CJVxXUcb.d.ts +0 -16
- package/npm_package/observers/index.d.ts +0 -84
- package/npm_package/observers/private/index.d.ts +0 -34
- package/npm_package/overlay/_index-deprecated.scss +0 -13
- package/npm_package/overlay/_index.scss +0 -193
- package/npm_package/overlay/index.d.ts +0 -42
- package/npm_package/overlay-module.d-B3qEQtts.d.ts +0 -791
- package/npm_package/overlay-prebuilt.css +0 -1
- package/npm_package/overlay.d-BdoMy0hX.d.ts +0 -296
- package/npm_package/package.json +0 -186
- package/npm_package/platform/index.d.ts +0 -83
- package/npm_package/platform.d-B3vREl3q.d.ts +0 -33
- package/npm_package/portal/index.d.ts +0 -86
- package/npm_package/portal-directives.d-BoG39gYN.d.ts +0 -232
- package/npm_package/private/index.d.ts +0 -13
- package/npm_package/schematics/collection.json +0 -18
- package/npm_package/schematics/index.d.ts +0 -14
- package/npm_package/schematics/index.js +0 -37
- package/npm_package/schematics/index.js.map +0 -1
- package/npm_package/schematics/migration.json +0 -15
- package/npm_package/schematics/ng-add/index.d.ts +0 -17
- package/npm_package/schematics/ng-add/index.js +0 -39
- package/npm_package/schematics/ng-add/index.js.map +0 -1
- package/npm_package/schematics/ng-add/package-config.d.ts +0 -12
- package/npm_package/schematics/ng-add/package-config.js +0 -51
- package/npm_package/schematics/ng-add/package-config.js.map +0 -1
- package/npm_package/schematics/ng-add/schema.d.ts +0 -11
- package/npm_package/schematics/ng-add/schema.js +0 -10
- package/npm_package/schematics/ng-add/schema.js.map +0 -1
- package/npm_package/schematics/ng-add/schema.json +0 -16
- package/npm_package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +0 -53
- package/npm_package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +0 -21
- package/npm_package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +0 -25
- package/npm_package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +0 -45
- package/npm_package/schematics/ng-generate/drag-drop/index.d.ts +0 -11
- package/npm_package/schematics/ng-generate/drag-drop/index.js +0 -42
- package/npm_package/schematics/ng-generate/drag-drop/index.js.map +0 -1
- package/npm_package/schematics/ng-generate/drag-drop/schema.d.ts +0 -10
- package/npm_package/schematics/ng-generate/drag-drop/schema.js +0 -10
- package/npm_package/schematics/ng-generate/drag-drop/schema.js.map +0 -1
- package/npm_package/schematics/ng-generate/drag-drop/schema.json +0 -100
- package/npm_package/schematics/ng-update/data/attribute-selectors.d.ts +0 -15
- package/npm_package/schematics/ng-update/data/attribute-selectors.js +0 -12
- package/npm_package/schematics/ng-update/data/attribute-selectors.js.map +0 -1
- package/npm_package/schematics/ng-update/data/class-names.d.ts +0 -15
- package/npm_package/schematics/ng-update/data/class-names.js +0 -12
- package/npm_package/schematics/ng-update/data/class-names.js.map +0 -1
- package/npm_package/schematics/ng-update/data/constructor-checks.d.ts +0 -15
- package/npm_package/schematics/ng-update/data/constructor-checks.js +0 -17
- package/npm_package/schematics/ng-update/data/constructor-checks.js.map +0 -1
- package/npm_package/schematics/ng-update/data/css-selectors.d.ts +0 -27
- package/npm_package/schematics/ng-update/data/css-selectors.js +0 -12
- package/npm_package/schematics/ng-update/data/css-selectors.js.map +0 -1
- package/npm_package/schematics/ng-update/data/css-tokens.d.ts +0 -27
- package/npm_package/schematics/ng-update/data/css-tokens.js +0 -12
- package/npm_package/schematics/ng-update/data/css-tokens.js.map +0 -1
- package/npm_package/schematics/ng-update/data/element-selectors.d.ts +0 -15
- package/npm_package/schematics/ng-update/data/element-selectors.js +0 -12
- package/npm_package/schematics/ng-update/data/element-selectors.js.map +0 -1
- package/npm_package/schematics/ng-update/data/index.d.ts +0 -18
- package/npm_package/schematics/ng-update/data/index.js +0 -35
- package/npm_package/schematics/ng-update/data/index.js.map +0 -1
- package/npm_package/schematics/ng-update/data/input-names.d.ts +0 -22
- package/npm_package/schematics/ng-update/data/input-names.js +0 -12
- package/npm_package/schematics/ng-update/data/input-names.js.map +0 -1
- package/npm_package/schematics/ng-update/data/method-call-checks.d.ts +0 -17
- package/npm_package/schematics/ng-update/data/method-call-checks.js +0 -12
- package/npm_package/schematics/ng-update/data/method-call-checks.js.map +0 -1
- package/npm_package/schematics/ng-update/data/output-names.d.ts +0 -22
- package/npm_package/schematics/ng-update/data/output-names.js +0 -12
- package/npm_package/schematics/ng-update/data/output-names.js.map +0 -1
- package/npm_package/schematics/ng-update/data/property-names.d.ts +0 -20
- package/npm_package/schematics/ng-update/data/property-names.js +0 -12
- package/npm_package/schematics/ng-update/data/property-names.js.map +0 -1
- package/npm_package/schematics/ng-update/data/symbol-removal.d.ts +0 -17
- package/npm_package/schematics/ng-update/data/symbol-removal.js +0 -12
- package/npm_package/schematics/ng-update/data/symbol-removal.js.map +0 -1
- package/npm_package/schematics/ng-update/devkit-file-system.d.ts +0 -30
- package/npm_package/schematics/ng-update/devkit-file-system.js +0 -83
- package/npm_package/schematics/ng-update/devkit-file-system.js.map +0 -1
- package/npm_package/schematics/ng-update/devkit-migration-rule.d.ts +0 -24
- package/npm_package/schematics/ng-update/devkit-migration-rule.js +0 -142
- package/npm_package/schematics/ng-update/devkit-migration-rule.js.map +0 -1
- package/npm_package/schematics/ng-update/devkit-migration.d.ts +0 -35
- package/npm_package/schematics/ng-update/devkit-migration.js +0 -20
- package/npm_package/schematics/ng-update/devkit-migration.js.map +0 -1
- package/npm_package/schematics/ng-update/find-stylesheets.d.ts +0 -16
- package/npm_package/schematics/ng-update/find-stylesheets.js +0 -41
- package/npm_package/schematics/ng-update/find-stylesheets.js.map +0 -1
- package/npm_package/schematics/ng-update/html-parsing/angular.d.ts +0 -15
- package/npm_package/schematics/ng-update/html-parsing/angular.js +0 -51
- package/npm_package/schematics/ng-update/html-parsing/angular.js.map +0 -1
- package/npm_package/schematics/ng-update/html-parsing/elements.d.ts +0 -24
- package/npm_package/schematics/ng-update/html-parsing/elements.js +0 -63
- package/npm_package/schematics/ng-update/html-parsing/elements.js.map +0 -1
- package/npm_package/schematics/ng-update/index.d.ts +0 -10
- package/npm_package/schematics/ng-update/index.js +0 -29
- package/npm_package/schematics/ng-update/index.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/attribute-selectors.d.ts +0 -26
- package/npm_package/schematics/ng-update/migrations/attribute-selectors.js +0 -71
- package/npm_package/schematics/ng-update/migrations/attribute-selectors.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/class-inheritance.d.ts +0 -26
- package/npm_package/schematics/ng-update/migrations/class-inheritance.js +0 -58
- package/npm_package/schematics/ng-update/migrations/class-inheritance.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/class-names.d.ts +0 -32
- package/npm_package/schematics/ng-update/migrations/class-names.js +0 -91
- package/npm_package/schematics/ng-update/migrations/class-names.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/constructor-signature.d.ts +0 -29
- package/npm_package/schematics/ng-update/migrations/constructor-signature.js +0 -139
- package/npm_package/schematics/ng-update/migrations/constructor-signature.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/css-selectors.d.ts +0 -26
- package/npm_package/schematics/ng-update/migrations/css-selectors.js +0 -75
- package/npm_package/schematics/ng-update/migrations/css-selectors.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/css-tokens.d.ts +0 -26
- package/npm_package/schematics/ng-update/migrations/css-tokens.js +0 -83
- package/npm_package/schematics/ng-update/migrations/css-tokens.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/element-selectors.d.ts +0 -26
- package/npm_package/schematics/ng-update/migrations/element-selectors.js +0 -66
- package/npm_package/schematics/ng-update/migrations/element-selectors.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/input-names.d.ts +0 -26
- package/npm_package/schematics/ng-update/migrations/input-names.js +0 -59
- package/npm_package/schematics/ng-update/migrations/input-names.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/method-call-arguments.d.ts +0 -22
- package/npm_package/schematics/ng-update/migrations/method-call-arguments.js +0 -62
- package/npm_package/schematics/ng-update/migrations/method-call-arguments.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/misc-template.d.ts +0 -18
- package/npm_package/schematics/ng-update/migrations/misc-template.js +0 -25
- package/npm_package/schematics/ng-update/migrations/misc-template.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/output-names.d.ts +0 -22
- package/npm_package/schematics/ng-update/migrations/output-names.js +0 -46
- package/npm_package/schematics/ng-update/migrations/output-names.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/property-names.d.ts +0 -22
- package/npm_package/schematics/ng-update/migrations/property-names.js +0 -60
- package/npm_package/schematics/ng-update/migrations/property-names.js.map +0 -1
- package/npm_package/schematics/ng-update/migrations/symbol-removal.d.ts +0 -18
- package/npm_package/schematics/ng-update/migrations/symbol-removal.js +0 -47
- package/npm_package/schematics/ng-update/migrations/symbol-removal.js.map +0 -1
- package/npm_package/schematics/ng-update/public-api.d.ts +0 -19
- package/npm_package/schematics/ng-update/public-api.js +0 -36
- package/npm_package/schematics/ng-update/public-api.js.map +0 -1
- package/npm_package/schematics/ng-update/typescript/base-types.d.ts +0 -10
- package/npm_package/schematics/ng-update/typescript/base-types.js +0 -23
- package/npm_package/schematics/ng-update/typescript/base-types.js.map +0 -1
- package/npm_package/schematics/ng-update/typescript/imports.d.ts +0 -18
- package/npm_package/schematics/ng-update/typescript/imports.js +0 -53
- package/npm_package/schematics/ng-update/typescript/imports.js.map +0 -1
- package/npm_package/schematics/ng-update/typescript/literal.d.ts +0 -18
- package/npm_package/schematics/ng-update/typescript/literal.js +0 -32
- package/npm_package/schematics/ng-update/typescript/literal.js.map +0 -1
- package/npm_package/schematics/ng-update/typescript/module-specifiers.d.ts +0 -16
- package/npm_package/schematics/ng-update/typescript/module-specifiers.js +0 -35
- package/npm_package/schematics/ng-update/typescript/module-specifiers.js.map +0 -1
- package/npm_package/schematics/ng-update/upgrade-data.d.ts +0 -35
- package/npm_package/schematics/ng-update/upgrade-data.js +0 -40
- package/npm_package/schematics/ng-update/upgrade-data.js.map +0 -1
- package/npm_package/schematics/package.json +0 -3
- package/npm_package/schematics/paths.d.ts +0 -11
- package/npm_package/schematics/paths.js +0 -16
- package/npm_package/schematics/paths.js.map +0 -1
- package/npm_package/schematics/update-tool/component-resource-collector.d.ts +0 -44
- package/npm_package/schematics/update-tool/component-resource-collector.js +0 -164
- package/npm_package/schematics/update-tool/component-resource-collector.js.map +0 -1
- package/npm_package/schematics/update-tool/file-system.d.ts +0 -72
- package/npm_package/schematics/update-tool/file-system.js +0 -18
- package/npm_package/schematics/update-tool/file-system.js.map +0 -1
- package/npm_package/schematics/update-tool/index.d.ts +0 -74
- package/npm_package/schematics/update-tool/index.js +0 -172
- package/npm_package/schematics/update-tool/index.js.map +0 -1
- package/npm_package/schematics/update-tool/logger.d.ts +0 -15
- package/npm_package/schematics/update-tool/logger.js +0 -18
- package/npm_package/schematics/update-tool/logger.js.map +0 -1
- package/npm_package/schematics/update-tool/migration.d.ts +0 -87
- package/npm_package/schematics/update-tool/migration.js +0 -70
- package/npm_package/schematics/update-tool/migration.js.map +0 -1
- package/npm_package/schematics/update-tool/public-api.d.ts +0 -16
- package/npm_package/schematics/update-tool/public-api.js +0 -33
- package/npm_package/schematics/update-tool/public-api.js.map +0 -1
- package/npm_package/schematics/update-tool/target-version.d.ts +0 -16
- package/npm_package/schematics/update-tool/target-version.js +0 -27
- package/npm_package/schematics/update-tool/target-version.js.map +0 -1
- package/npm_package/schematics/update-tool/update-recorder.d.ts +0 -13
- package/npm_package/schematics/update-tool/update-recorder.js +0 -10
- package/npm_package/schematics/update-tool/update-recorder.js.map +0 -1
- package/npm_package/schematics/update-tool/utils/decorators.d.ts +0 -22
- package/npm_package/schematics/update-tool/utils/decorators.js +0 -41
- package/npm_package/schematics/update-tool/utils/decorators.js.map +0 -1
- package/npm_package/schematics/update-tool/utils/diagnostics.d.ts +0 -11
- package/npm_package/schematics/update-tool/utils/diagnostics.js +0 -18
- package/npm_package/schematics/update-tool/utils/diagnostics.js.map +0 -1
- package/npm_package/schematics/update-tool/utils/functions.d.ts +0 -14
- package/npm_package/schematics/update-tool/utils/functions.js +0 -20
- package/npm_package/schematics/update-tool/utils/functions.js.map +0 -1
- package/npm_package/schematics/update-tool/utils/imports.d.ts +0 -17
- package/npm_package/schematics/update-tool/utils/imports.js +0 -110
- package/npm_package/schematics/update-tool/utils/imports.js.map +0 -1
- package/npm_package/schematics/update-tool/utils/line-mappings.d.ts +0 -21
- package/npm_package/schematics/update-tool/utils/line-mappings.js +0 -75
- package/npm_package/schematics/update-tool/utils/line-mappings.js.map +0 -1
- package/npm_package/schematics/update-tool/utils/parse-tsconfig.d.ts +0 -18
- package/npm_package/schematics/update-tool/utils/parse-tsconfig.js +0 -45
- package/npm_package/schematics/update-tool/utils/parse-tsconfig.js.map +0 -1
- package/npm_package/schematics/update-tool/utils/property-name.d.ts +0 -18
- package/npm_package/schematics/update-tool/utils/property-name.js +0 -27
- package/npm_package/schematics/update-tool/utils/property-name.js.map +0 -1
- package/npm_package/schematics/update-tool/utils/virtual-host.d.ts +0 -36
- package/npm_package/schematics/update-tool/utils/virtual-host.js +0 -71
- package/npm_package/schematics/update-tool/utils/virtual-host.js.map +0 -1
- package/npm_package/schematics/update-tool/version-changes.d.ts +0 -32
- package/npm_package/schematics/update-tool/version-changes.js +0 -38
- package/npm_package/schematics/update-tool/version-changes.js.map +0 -1
- package/npm_package/schematics/utils/ast/ng-module-imports.d.ts +0 -12
- package/npm_package/schematics/utils/ast/ng-module-imports.js +0 -82
- package/npm_package/schematics/utils/ast/ng-module-imports.js.map +0 -1
- package/npm_package/schematics/utils/ast.d.ts +0 -25
- package/npm_package/schematics/utils/ast.js +0 -79
- package/npm_package/schematics/utils/ast.js.map +0 -1
- package/npm_package/schematics/utils/build-component.d.ts +0 -20
- package/npm_package/schematics/utils/build-component.js +0 -188
- package/npm_package/schematics/utils/build-component.js.map +0 -1
- package/npm_package/schematics/utils/get-project.d.ts +0 -13
- package/npm_package/schematics/utils/get-project.js +0 -28
- package/npm_package/schematics/utils/get-project.js.map +0 -1
- package/npm_package/schematics/utils/html-manipulation.d.ts +0 -15
- package/npm_package/schematics/utils/html-manipulation.js +0 -91
- package/npm_package/schematics/utils/html-manipulation.js.map +0 -1
- package/npm_package/schematics/utils/index.d.ts +0 -19
- package/npm_package/schematics/utils/index.js +0 -36
- package/npm_package/schematics/utils/index.js.map +0 -1
- package/npm_package/schematics/utils/parse5-element.d.ts +0 -12
- package/npm_package/schematics/utils/parse5-element.js +0 -30
- package/npm_package/schematics/utils/parse5-element.js.map +0 -1
- package/npm_package/schematics/utils/project-index-file.d.ts +0 -10
- package/npm_package/schematics/utils/project-index-file.js +0 -20
- package/npm_package/schematics/utils/project-index-file.js.map +0 -1
- package/npm_package/schematics/utils/project-main-file.d.ts +0 -10
- package/npm_package/schematics/utils/project-main-file.js +0 -25
- package/npm_package/schematics/utils/project-main-file.js.map +0 -1
- package/npm_package/schematics/utils/project-style-file.d.ts +0 -13
- package/npm_package/schematics/utils/project-style-file.js +0 -42
- package/npm_package/schematics/utils/project-style-file.js.map +0 -1
- package/npm_package/schematics/utils/project-targets.d.ts +0 -14
- package/npm_package/schematics/utils/project-targets.js +0 -46
- package/npm_package/schematics/utils/project-targets.js.map +0 -1
- package/npm_package/schematics/utils/project-tsconfig-paths.d.ts +0 -14
- package/npm_package/schematics/utils/project-tsconfig-paths.js +0 -46
- package/npm_package/schematics/utils/project-tsconfig-paths.js.map +0 -1
- package/npm_package/schematics/utils/schematic-options.d.ts +0 -20
- package/npm_package/schematics/utils/schematic-options.js +0 -89
- package/npm_package/schematics/utils/schematic-options.js.map +0 -1
- package/npm_package/scrolling/index.d.ts +0 -62
- package/npm_package/scrolling-module.d-ud2XrbF8.d.ts +0 -552
- package/npm_package/selection-model.d-C_vvNGP-.d.ts +0 -117
- package/npm_package/stepper/index.d.ts +0 -228
- package/npm_package/style-loader.d-BXZfQZTF.d.ts +0 -21
- package/npm_package/table/index.d.ts +0 -1100
- package/npm_package/testing/index.d.ts +0 -94
- package/npm_package/testing/selenium-webdriver/index.d.ts +0 -150
- package/npm_package/testing/testbed/index.d.ts +0 -157
- package/npm_package/text-field/_index.scss +0 -89
- package/npm_package/text-field/index.d.ts +0 -156
- package/npm_package/text-field-prebuilt.css +0 -1
- package/npm_package/tree/index.d.ts +0 -720
- package/npm_package/tree-key-manager-strategy.d-XB6M79l-.d.ts +0 -116
- package/npm_package/unique-selection-dispatcher.d-DSFqf1MM.d.ts +0 -33
- package/npm_package/view-repeater.d-BKljR8u8.d.ts +0 -89
|
@@ -1,925 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, signal, ElementRef, booleanAttribute, Directive, Input, NgZone, ChangeDetectorRef, Renderer2, forwardRef, Output, ContentChildren, NgModule } from '@angular/core';
|
|
3
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
-
import { Subject, defer, merge } from 'rxjs';
|
|
5
|
-
import { startWith, switchMap, map, takeUntil, filter } from 'rxjs/operators';
|
|
6
|
-
import { A, S as SPACE, c as ENTER, H as HOME, E as END, U as UP_ARROW, D as DOWN_ARROW, L as LEFT_ARROW, R as RIGHT_ARROW } from './keycodes-CpHkExLC.mjs';
|
|
7
|
-
import { A as ActiveDescendantKeyManager } from './activedescendant-key-manager-DC3-fwQI.mjs';
|
|
8
|
-
import { S as SelectionModel } from './selection-model-CeeHVIcP.mjs';
|
|
9
|
-
import { _ as _IdGenerator } from './id-generator-Dw_9dSDu.mjs';
|
|
10
|
-
import { D as Directionality } from './directionality-CBXD4hga.mjs';
|
|
11
|
-
import { P as Platform } from './platform-DmdVEw_C.mjs';
|
|
12
|
-
import { hasModifierKey } from './keycodes.mjs';
|
|
13
|
-
import { c as coerceArray } from './array-I1yfCXUO.mjs';
|
|
14
|
-
import './list-key-manager-CyOIXo8P.mjs';
|
|
15
|
-
import './typeahead-9ZW4Dtsf.mjs';
|
|
16
|
-
import '@angular/common';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* An implementation of SelectionModel that internally always represents the selection as a
|
|
20
|
-
* multi-selection. This is necessary so that we can recover the full selection if the user
|
|
21
|
-
* switches the listbox from single-selection to multi-selection after initialization.
|
|
22
|
-
*
|
|
23
|
-
* This selection model may report multiple selected values, even if it is in single-selection
|
|
24
|
-
* mode. It is up to the user (CdkListbox) to check for invalid selections.
|
|
25
|
-
*/
|
|
26
|
-
class ListboxSelectionModel extends SelectionModel {
|
|
27
|
-
multiple;
|
|
28
|
-
constructor(multiple = false, initiallySelectedValues, emitChanges = true, compareWith) {
|
|
29
|
-
super(true, initiallySelectedValues, emitChanges, compareWith);
|
|
30
|
-
this.multiple = multiple;
|
|
31
|
-
}
|
|
32
|
-
isMultipleSelection() {
|
|
33
|
-
return this.multiple;
|
|
34
|
-
}
|
|
35
|
-
select(...values) {
|
|
36
|
-
// The super class is always in multi-selection mode, so we need to override the behavior if
|
|
37
|
-
// this selection model actually belongs to a single-selection listbox.
|
|
38
|
-
if (this.multiple) {
|
|
39
|
-
return super.select(...values);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return super.setSelection(...values);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/** A selectable option in a listbox. */
|
|
47
|
-
class CdkOption {
|
|
48
|
-
/** The id of the option's host element. */
|
|
49
|
-
get id() {
|
|
50
|
-
return this._id || this._generatedId;
|
|
51
|
-
}
|
|
52
|
-
set id(value) {
|
|
53
|
-
this._id = value;
|
|
54
|
-
}
|
|
55
|
-
_id;
|
|
56
|
-
_generatedId = inject(_IdGenerator).getId('cdk-option-');
|
|
57
|
-
/** The value of this option. */
|
|
58
|
-
value;
|
|
59
|
-
/**
|
|
60
|
-
* The text used to locate this item during listbox typeahead. If not specified,
|
|
61
|
-
* the `textContent` of the item will be used.
|
|
62
|
-
*/
|
|
63
|
-
typeaheadLabel;
|
|
64
|
-
/** Whether this option is disabled. */
|
|
65
|
-
get disabled() {
|
|
66
|
-
return this.listbox.disabled || this._disabled();
|
|
67
|
-
}
|
|
68
|
-
set disabled(value) {
|
|
69
|
-
this._disabled.set(value);
|
|
70
|
-
}
|
|
71
|
-
_disabled = signal(false);
|
|
72
|
-
/** The tabindex of the option when it is enabled. */
|
|
73
|
-
get enabledTabIndex() {
|
|
74
|
-
return this._enabledTabIndex() === undefined
|
|
75
|
-
? this.listbox.enabledTabIndex
|
|
76
|
-
: this._enabledTabIndex();
|
|
77
|
-
}
|
|
78
|
-
set enabledTabIndex(value) {
|
|
79
|
-
this._enabledTabIndex.set(value);
|
|
80
|
-
}
|
|
81
|
-
_enabledTabIndex = signal(undefined);
|
|
82
|
-
/** The option's host element */
|
|
83
|
-
element = inject(ElementRef).nativeElement;
|
|
84
|
-
/** The parent listbox this option belongs to. */
|
|
85
|
-
listbox = inject(CdkListbox);
|
|
86
|
-
/** Emits when the option is destroyed. */
|
|
87
|
-
destroyed = new Subject();
|
|
88
|
-
/** Emits when the option is clicked. */
|
|
89
|
-
_clicked = new Subject();
|
|
90
|
-
ngOnDestroy() {
|
|
91
|
-
this.destroyed.next();
|
|
92
|
-
this.destroyed.complete();
|
|
93
|
-
}
|
|
94
|
-
/** Whether this option is selected. */
|
|
95
|
-
isSelected() {
|
|
96
|
-
return this.listbox.isSelected(this);
|
|
97
|
-
}
|
|
98
|
-
/** Whether this option is active. */
|
|
99
|
-
isActive() {
|
|
100
|
-
return this.listbox.isActive(this);
|
|
101
|
-
}
|
|
102
|
-
/** Toggle the selected state of this option. */
|
|
103
|
-
toggle() {
|
|
104
|
-
this.listbox.toggle(this);
|
|
105
|
-
}
|
|
106
|
-
/** Select this option if it is not selected. */
|
|
107
|
-
select() {
|
|
108
|
-
this.listbox.select(this);
|
|
109
|
-
}
|
|
110
|
-
/** Deselect this option if it is selected. */
|
|
111
|
-
deselect() {
|
|
112
|
-
this.listbox.deselect(this);
|
|
113
|
-
}
|
|
114
|
-
/** Focus this option. */
|
|
115
|
-
focus() {
|
|
116
|
-
this.element.focus();
|
|
117
|
-
}
|
|
118
|
-
/** Get the label for this element which is required by the FocusableOption interface. */
|
|
119
|
-
getLabel() {
|
|
120
|
-
return (this.typeaheadLabel ?? this.element.textContent?.trim()) || '';
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* No-op implemented as a part of `Highlightable`.
|
|
124
|
-
* @docs-private
|
|
125
|
-
*/
|
|
126
|
-
setActiveStyles() {
|
|
127
|
-
// If the listbox is using `aria-activedescendant` the option won't have focus so the
|
|
128
|
-
// browser won't scroll them into view automatically so we need to do it ourselves.
|
|
129
|
-
if (this.listbox.useActiveDescendant) {
|
|
130
|
-
this.element.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* No-op implemented as a part of `Highlightable`.
|
|
135
|
-
* @docs-private
|
|
136
|
-
*/
|
|
137
|
-
setInactiveStyles() { }
|
|
138
|
-
/** Handle focus events on the option. */
|
|
139
|
-
_handleFocus() {
|
|
140
|
-
// Options can wind up getting focused in active descendant mode if the user clicks on them.
|
|
141
|
-
// In this case, we push focus back to the parent listbox to prevent an extra tab stop when
|
|
142
|
-
// the user performs a shift+tab.
|
|
143
|
-
if (this.listbox.useActiveDescendant) {
|
|
144
|
-
this.listbox._setActiveOption(this);
|
|
145
|
-
this.listbox.focus();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
/** Get the tabindex for this option. */
|
|
149
|
-
_getTabIndex() {
|
|
150
|
-
if (this.listbox.useActiveDescendant || this.disabled) {
|
|
151
|
-
return -1;
|
|
152
|
-
}
|
|
153
|
-
return this.isActive() ? this.enabledTabIndex : -1;
|
|
154
|
-
}
|
|
155
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkOption, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
156
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.6", type: CdkOption, isStandalone: true, selector: "[cdkOption]", inputs: { id: "id", value: ["cdkOption", "value"], typeaheadLabel: ["cdkOptionTypeaheadLabel", "typeaheadLabel"], disabled: ["cdkOptionDisabled", "disabled", booleanAttribute], enabledTabIndex: ["tabindex", "enabledTabIndex"] }, host: { attributes: { "role": "option" }, listeners: { "click": "_clicked.next($event)", "focus": "_handleFocus()" }, properties: { "id": "id", "attr.aria-selected": "isSelected()", "attr.tabindex": "_getTabIndex()", "attr.aria-disabled": "disabled", "class.cdk-option-active": "isActive()" }, classAttribute: "cdk-option" }, exportAs: ["cdkOption"], ngImport: i0 });
|
|
157
|
-
}
|
|
158
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkOption, decorators: [{
|
|
159
|
-
type: Directive,
|
|
160
|
-
args: [{
|
|
161
|
-
selector: '[cdkOption]',
|
|
162
|
-
exportAs: 'cdkOption',
|
|
163
|
-
host: {
|
|
164
|
-
'role': 'option',
|
|
165
|
-
'class': 'cdk-option',
|
|
166
|
-
'[id]': 'id',
|
|
167
|
-
'[attr.aria-selected]': 'isSelected()',
|
|
168
|
-
'[attr.tabindex]': '_getTabIndex()',
|
|
169
|
-
'[attr.aria-disabled]': 'disabled',
|
|
170
|
-
'[class.cdk-option-active]': 'isActive()',
|
|
171
|
-
'(click)': '_clicked.next($event)',
|
|
172
|
-
'(focus)': '_handleFocus()',
|
|
173
|
-
},
|
|
174
|
-
}]
|
|
175
|
-
}], propDecorators: { id: [{
|
|
176
|
-
type: Input
|
|
177
|
-
}], value: [{
|
|
178
|
-
type: Input,
|
|
179
|
-
args: ['cdkOption']
|
|
180
|
-
}], typeaheadLabel: [{
|
|
181
|
-
type: Input,
|
|
182
|
-
args: ['cdkOptionTypeaheadLabel']
|
|
183
|
-
}], disabled: [{
|
|
184
|
-
type: Input,
|
|
185
|
-
args: [{ alias: 'cdkOptionDisabled', transform: booleanAttribute }]
|
|
186
|
-
}], enabledTabIndex: [{
|
|
187
|
-
type: Input,
|
|
188
|
-
args: ['tabindex']
|
|
189
|
-
}] } });
|
|
190
|
-
class CdkListbox {
|
|
191
|
-
_cleanupWindowBlur;
|
|
192
|
-
/** The id of the option's host element. */
|
|
193
|
-
get id() {
|
|
194
|
-
return this._id || this._generatedId;
|
|
195
|
-
}
|
|
196
|
-
set id(value) {
|
|
197
|
-
this._id = value;
|
|
198
|
-
}
|
|
199
|
-
_id;
|
|
200
|
-
_generatedId = inject(_IdGenerator).getId('cdk-listbox-');
|
|
201
|
-
/** The tabindex to use when the listbox is enabled. */
|
|
202
|
-
get enabledTabIndex() {
|
|
203
|
-
return this._enabledTabIndex() === undefined ? 0 : this._enabledTabIndex();
|
|
204
|
-
}
|
|
205
|
-
set enabledTabIndex(value) {
|
|
206
|
-
this._enabledTabIndex.set(value);
|
|
207
|
-
}
|
|
208
|
-
_enabledTabIndex = signal(undefined);
|
|
209
|
-
/** The value selected in the listbox, represented as an array of option values. */
|
|
210
|
-
get value() {
|
|
211
|
-
return this._invalid ? [] : this.selectionModel.selected;
|
|
212
|
-
}
|
|
213
|
-
set value(value) {
|
|
214
|
-
this._setSelection(value);
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Whether the listbox allows multiple options to be selected. If the value switches from `true`
|
|
218
|
-
* to `false`, and more than one option is selected, all options are deselected.
|
|
219
|
-
*/
|
|
220
|
-
get multiple() {
|
|
221
|
-
return this.selectionModel.multiple;
|
|
222
|
-
}
|
|
223
|
-
set multiple(value) {
|
|
224
|
-
this.selectionModel.multiple = value;
|
|
225
|
-
if (this.options) {
|
|
226
|
-
this._updateInternalValue();
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
/** Whether the listbox is disabled. */
|
|
230
|
-
get disabled() {
|
|
231
|
-
return this._disabled();
|
|
232
|
-
}
|
|
233
|
-
set disabled(value) {
|
|
234
|
-
this._disabled.set(value);
|
|
235
|
-
}
|
|
236
|
-
_disabled = signal(false);
|
|
237
|
-
/** Whether the listbox will use active descendant or will move focus onto the options. */
|
|
238
|
-
get useActiveDescendant() {
|
|
239
|
-
return this._useActiveDescendant();
|
|
240
|
-
}
|
|
241
|
-
set useActiveDescendant(value) {
|
|
242
|
-
this._useActiveDescendant.set(value);
|
|
243
|
-
}
|
|
244
|
-
_useActiveDescendant = signal(false);
|
|
245
|
-
/** The orientation of the listbox. Only affects keyboard interaction, not visual layout. */
|
|
246
|
-
get orientation() {
|
|
247
|
-
return this._orientation;
|
|
248
|
-
}
|
|
249
|
-
set orientation(value) {
|
|
250
|
-
this._orientation = value === 'horizontal' ? 'horizontal' : 'vertical';
|
|
251
|
-
if (value === 'horizontal') {
|
|
252
|
-
this.listKeyManager?.withHorizontalOrientation(this._dir?.value || 'ltr');
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
this.listKeyManager?.withVerticalOrientation();
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
_orientation = 'vertical';
|
|
259
|
-
/** The function used to compare option values. */
|
|
260
|
-
get compareWith() {
|
|
261
|
-
return this.selectionModel.compareWith;
|
|
262
|
-
}
|
|
263
|
-
set compareWith(fn) {
|
|
264
|
-
this.selectionModel.compareWith = fn;
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Whether the keyboard navigation should wrap when the user presses arrow down on the last item
|
|
268
|
-
* or arrow up on the first item.
|
|
269
|
-
*/
|
|
270
|
-
get navigationWrapDisabled() {
|
|
271
|
-
return this._navigationWrapDisabled;
|
|
272
|
-
}
|
|
273
|
-
set navigationWrapDisabled(wrap) {
|
|
274
|
-
this._navigationWrapDisabled = wrap;
|
|
275
|
-
this.listKeyManager?.withWrap(!this._navigationWrapDisabled);
|
|
276
|
-
}
|
|
277
|
-
_navigationWrapDisabled = false;
|
|
278
|
-
/** Whether keyboard navigation should skip over disabled items. */
|
|
279
|
-
get navigateDisabledOptions() {
|
|
280
|
-
return this._navigateDisabledOptions;
|
|
281
|
-
}
|
|
282
|
-
set navigateDisabledOptions(skip) {
|
|
283
|
-
this._navigateDisabledOptions = skip;
|
|
284
|
-
this.listKeyManager?.skipPredicate(this._navigateDisabledOptions ? this._skipNonePredicate : this._skipDisabledPredicate);
|
|
285
|
-
}
|
|
286
|
-
_navigateDisabledOptions = false;
|
|
287
|
-
/** Emits when the selected value(s) in the listbox change. */
|
|
288
|
-
valueChange = new Subject();
|
|
289
|
-
/** The child options in this listbox. */
|
|
290
|
-
options;
|
|
291
|
-
/** The selection model used by the listbox. */
|
|
292
|
-
selectionModel = new ListboxSelectionModel();
|
|
293
|
-
/** The key manager that manages keyboard navigation for this listbox. */
|
|
294
|
-
listKeyManager;
|
|
295
|
-
/** Emits when the listbox is destroyed. */
|
|
296
|
-
destroyed = new Subject();
|
|
297
|
-
/** The host element of the listbox. */
|
|
298
|
-
element = inject(ElementRef).nativeElement;
|
|
299
|
-
/** The Angular zone. */
|
|
300
|
-
ngZone = inject(NgZone);
|
|
301
|
-
/** The change detector for this listbox. */
|
|
302
|
-
changeDetectorRef = inject(ChangeDetectorRef);
|
|
303
|
-
/** Whether the currently selected value in the selection model is invalid. */
|
|
304
|
-
_invalid = false;
|
|
305
|
-
/** The last user-triggered option. */
|
|
306
|
-
_lastTriggered = null;
|
|
307
|
-
/** Callback called when the listbox has been touched */
|
|
308
|
-
_onTouched = () => { };
|
|
309
|
-
/** Callback called when the listbox value changes */
|
|
310
|
-
_onChange = () => { };
|
|
311
|
-
/** Emits when an option has been clicked. */
|
|
312
|
-
_optionClicked = defer(() => this.options.changes.pipe(startWith(this.options), switchMap(options => merge(...options.map(option => option._clicked.pipe(map(event => ({ option, event }))))))));
|
|
313
|
-
/** The directionality of the page. */
|
|
314
|
-
_dir = inject(Directionality, { optional: true });
|
|
315
|
-
/** Whether the component is being rendered in the browser. */
|
|
316
|
-
_isBrowser = inject(Platform).isBrowser;
|
|
317
|
-
/** A predicate that skips disabled options. */
|
|
318
|
-
_skipDisabledPredicate = (option) => option.disabled;
|
|
319
|
-
/** A predicate that does not skip any options. */
|
|
320
|
-
_skipNonePredicate = () => false;
|
|
321
|
-
/** Whether the listbox currently has focus. */
|
|
322
|
-
_hasFocus = false;
|
|
323
|
-
/** A reference to the option that was active before the listbox lost focus. */
|
|
324
|
-
_previousActiveOption = null;
|
|
325
|
-
constructor() {
|
|
326
|
-
if (this._isBrowser) {
|
|
327
|
-
const renderer = inject(Renderer2);
|
|
328
|
-
this._cleanupWindowBlur = this.ngZone.runOutsideAngular(() => {
|
|
329
|
-
return renderer.listen('window', 'blur', () => {
|
|
330
|
-
if (this.element.contains(document.activeElement) && this._previousActiveOption) {
|
|
331
|
-
this._setActiveOption(this._previousActiveOption);
|
|
332
|
-
this._previousActiveOption = null;
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
ngAfterContentInit() {
|
|
339
|
-
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
340
|
-
this._verifyNoOptionValueCollisions();
|
|
341
|
-
this._verifyOptionValues();
|
|
342
|
-
}
|
|
343
|
-
this._initKeyManager();
|
|
344
|
-
// Update the internal value whenever the options or the model value changes.
|
|
345
|
-
merge(this.selectionModel.changed, this.options.changes)
|
|
346
|
-
.pipe(startWith(null), takeUntil(this.destroyed))
|
|
347
|
-
.subscribe(() => this._updateInternalValue());
|
|
348
|
-
this._optionClicked
|
|
349
|
-
.pipe(filter(({ option }) => !option.disabled), takeUntil(this.destroyed))
|
|
350
|
-
.subscribe(({ option, event }) => this._handleOptionClicked(option, event));
|
|
351
|
-
}
|
|
352
|
-
ngOnDestroy() {
|
|
353
|
-
this._cleanupWindowBlur?.();
|
|
354
|
-
this.listKeyManager?.destroy();
|
|
355
|
-
this.destroyed.next();
|
|
356
|
-
this.destroyed.complete();
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Toggle the selected state of the given option.
|
|
360
|
-
* @param option The option to toggle
|
|
361
|
-
*/
|
|
362
|
-
toggle(option) {
|
|
363
|
-
this.toggleValue(option.value);
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Toggle the selected state of the given value.
|
|
367
|
-
* @param value The value to toggle
|
|
368
|
-
*/
|
|
369
|
-
toggleValue(value) {
|
|
370
|
-
if (this._invalid) {
|
|
371
|
-
this.selectionModel.clear(false);
|
|
372
|
-
}
|
|
373
|
-
this.selectionModel.toggle(value);
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* Select the given option.
|
|
377
|
-
* @param option The option to select
|
|
378
|
-
*/
|
|
379
|
-
select(option) {
|
|
380
|
-
this.selectValue(option.value);
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Select the given value.
|
|
384
|
-
* @param value The value to select
|
|
385
|
-
*/
|
|
386
|
-
selectValue(value) {
|
|
387
|
-
if (this._invalid) {
|
|
388
|
-
this.selectionModel.clear(false);
|
|
389
|
-
}
|
|
390
|
-
this.selectionModel.select(value);
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Deselect the given option.
|
|
394
|
-
* @param option The option to deselect
|
|
395
|
-
*/
|
|
396
|
-
deselect(option) {
|
|
397
|
-
this.deselectValue(option.value);
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Deselect the given value.
|
|
401
|
-
* @param value The value to deselect
|
|
402
|
-
*/
|
|
403
|
-
deselectValue(value) {
|
|
404
|
-
if (this._invalid) {
|
|
405
|
-
this.selectionModel.clear(false);
|
|
406
|
-
}
|
|
407
|
-
this.selectionModel.deselect(value);
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* Set the selected state of all options.
|
|
411
|
-
* @param isSelected The new selected state to set
|
|
412
|
-
*/
|
|
413
|
-
setAllSelected(isSelected) {
|
|
414
|
-
if (!isSelected) {
|
|
415
|
-
this.selectionModel.clear();
|
|
416
|
-
}
|
|
417
|
-
else {
|
|
418
|
-
if (this._invalid) {
|
|
419
|
-
this.selectionModel.clear(false);
|
|
420
|
-
}
|
|
421
|
-
this.selectionModel.select(...this.options.map(option => option.value));
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Get whether the given option is selected.
|
|
426
|
-
* @param option The option to get the selected state of
|
|
427
|
-
*/
|
|
428
|
-
isSelected(option) {
|
|
429
|
-
return this.isValueSelected(option.value);
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* Get whether the given option is active.
|
|
433
|
-
* @param option The option to get the active state of
|
|
434
|
-
*/
|
|
435
|
-
isActive(option) {
|
|
436
|
-
return !!(this.listKeyManager?.activeItem === option);
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* Get whether the given value is selected.
|
|
440
|
-
* @param value The value to get the selected state of
|
|
441
|
-
*/
|
|
442
|
-
isValueSelected(value) {
|
|
443
|
-
if (this._invalid) {
|
|
444
|
-
return false;
|
|
445
|
-
}
|
|
446
|
-
return this.selectionModel.isSelected(value);
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Registers a callback to be invoked when the listbox's value changes from user input.
|
|
450
|
-
* @param fn The callback to register
|
|
451
|
-
* @docs-private
|
|
452
|
-
*/
|
|
453
|
-
registerOnChange(fn) {
|
|
454
|
-
this._onChange = fn;
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Registers a callback to be invoked when the listbox is blurred by the user.
|
|
458
|
-
* @param fn The callback to register
|
|
459
|
-
* @docs-private
|
|
460
|
-
*/
|
|
461
|
-
registerOnTouched(fn) {
|
|
462
|
-
this._onTouched = fn;
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* Sets the listbox's value.
|
|
466
|
-
* @param value The new value of the listbox
|
|
467
|
-
* @docs-private
|
|
468
|
-
*/
|
|
469
|
-
writeValue(value) {
|
|
470
|
-
this._setSelection(value);
|
|
471
|
-
this._verifyOptionValues();
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* Sets the disabled state of the listbox.
|
|
475
|
-
* @param isDisabled The new disabled state
|
|
476
|
-
* @docs-private
|
|
477
|
-
*/
|
|
478
|
-
setDisabledState(isDisabled) {
|
|
479
|
-
this.disabled = isDisabled;
|
|
480
|
-
this.changeDetectorRef.markForCheck();
|
|
481
|
-
}
|
|
482
|
-
/** Focus the listbox's host element. */
|
|
483
|
-
focus() {
|
|
484
|
-
this.element.focus();
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* Triggers the given option in response to user interaction.
|
|
488
|
-
* - In single selection mode: selects the option and deselects any other selected option.
|
|
489
|
-
* - In multi selection mode: toggles the selected state of the option.
|
|
490
|
-
* @param option The option to trigger
|
|
491
|
-
*/
|
|
492
|
-
triggerOption(option) {
|
|
493
|
-
if (option && !option.disabled) {
|
|
494
|
-
this._lastTriggered = option;
|
|
495
|
-
const changed = this.multiple
|
|
496
|
-
? this.selectionModel.toggle(option.value)
|
|
497
|
-
: this.selectionModel.select(option.value);
|
|
498
|
-
if (changed) {
|
|
499
|
-
this._onChange(this.value);
|
|
500
|
-
this.valueChange.next({
|
|
501
|
-
value: this.value,
|
|
502
|
-
listbox: this,
|
|
503
|
-
option: option,
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* Trigger the given range of options in response to user interaction.
|
|
510
|
-
* Should only be called in multi-selection mode.
|
|
511
|
-
* @param trigger The option that was triggered
|
|
512
|
-
* @param from The start index of the options to toggle
|
|
513
|
-
* @param to The end index of the options to toggle
|
|
514
|
-
* @param on Whether to toggle the option range on
|
|
515
|
-
*/
|
|
516
|
-
triggerRange(trigger, from, to, on) {
|
|
517
|
-
if (this.disabled || (trigger && trigger.disabled)) {
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
this._lastTriggered = trigger;
|
|
521
|
-
const isEqual = this.compareWith ?? Object.is;
|
|
522
|
-
const updateValues = [...this.options]
|
|
523
|
-
.slice(Math.max(0, Math.min(from, to)), Math.min(this.options.length, Math.max(from, to) + 1))
|
|
524
|
-
.filter(option => !option.disabled)
|
|
525
|
-
.map(option => option.value);
|
|
526
|
-
const selected = [...this.value];
|
|
527
|
-
for (const updateValue of updateValues) {
|
|
528
|
-
const selectedIndex = selected.findIndex(selectedValue => isEqual(selectedValue, updateValue));
|
|
529
|
-
if (on && selectedIndex === -1) {
|
|
530
|
-
selected.push(updateValue);
|
|
531
|
-
}
|
|
532
|
-
else if (!on && selectedIndex !== -1) {
|
|
533
|
-
selected.splice(selectedIndex, 1);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
let changed = this.selectionModel.setSelection(...selected);
|
|
537
|
-
if (changed) {
|
|
538
|
-
this._onChange(this.value);
|
|
539
|
-
this.valueChange.next({
|
|
540
|
-
value: this.value,
|
|
541
|
-
listbox: this,
|
|
542
|
-
option: trigger,
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Sets the given option as active.
|
|
548
|
-
* @param option The option to make active
|
|
549
|
-
*/
|
|
550
|
-
_setActiveOption(option) {
|
|
551
|
-
this.listKeyManager.setActiveItem(option);
|
|
552
|
-
}
|
|
553
|
-
/** Called when the listbox receives focus. */
|
|
554
|
-
_handleFocus() {
|
|
555
|
-
if (!this.useActiveDescendant) {
|
|
556
|
-
if (this.selectionModel.selected.length > 0) {
|
|
557
|
-
this._setNextFocusToSelectedOption();
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
this.listKeyManager.setNextItemActive();
|
|
561
|
-
}
|
|
562
|
-
this._focusActiveOption();
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
/** Called when the user presses keydown on the listbox. */
|
|
566
|
-
_handleKeydown(event) {
|
|
567
|
-
if (this.disabled) {
|
|
568
|
-
return;
|
|
569
|
-
}
|
|
570
|
-
const { keyCode } = event;
|
|
571
|
-
const previousActiveIndex = this.listKeyManager.activeItemIndex;
|
|
572
|
-
const ctrlKeys = ['ctrlKey', 'metaKey'];
|
|
573
|
-
if (this.multiple && keyCode === A && hasModifierKey(event, ...ctrlKeys)) {
|
|
574
|
-
// Toggle all options off if they're all selected, otherwise toggle them all on.
|
|
575
|
-
this.triggerRange(null, 0, this.options.length - 1, this.options.length !== this.value.length);
|
|
576
|
-
event.preventDefault();
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
if (this.multiple &&
|
|
580
|
-
(keyCode === SPACE || keyCode === ENTER) &&
|
|
581
|
-
hasModifierKey(event, 'shiftKey')) {
|
|
582
|
-
if (this.listKeyManager.activeItem && this.listKeyManager.activeItemIndex != null) {
|
|
583
|
-
this.triggerRange(this.listKeyManager.activeItem, this._getLastTriggeredIndex() ?? this.listKeyManager.activeItemIndex, this.listKeyManager.activeItemIndex, !this.listKeyManager.activeItem.isSelected());
|
|
584
|
-
}
|
|
585
|
-
event.preventDefault();
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
if (this.multiple &&
|
|
589
|
-
keyCode === HOME &&
|
|
590
|
-
hasModifierKey(event, ...ctrlKeys) &&
|
|
591
|
-
hasModifierKey(event, 'shiftKey')) {
|
|
592
|
-
const trigger = this.listKeyManager.activeItem;
|
|
593
|
-
if (trigger) {
|
|
594
|
-
const from = this.listKeyManager.activeItemIndex;
|
|
595
|
-
this.listKeyManager.setFirstItemActive();
|
|
596
|
-
this.triggerRange(trigger, from, this.listKeyManager.activeItemIndex, !trigger.isSelected());
|
|
597
|
-
}
|
|
598
|
-
event.preventDefault();
|
|
599
|
-
return;
|
|
600
|
-
}
|
|
601
|
-
if (this.multiple &&
|
|
602
|
-
keyCode === END &&
|
|
603
|
-
hasModifierKey(event, ...ctrlKeys) &&
|
|
604
|
-
hasModifierKey(event, 'shiftKey')) {
|
|
605
|
-
const trigger = this.listKeyManager.activeItem;
|
|
606
|
-
if (trigger) {
|
|
607
|
-
const from = this.listKeyManager.activeItemIndex;
|
|
608
|
-
this.listKeyManager.setLastItemActive();
|
|
609
|
-
this.triggerRange(trigger, from, this.listKeyManager.activeItemIndex, !trigger.isSelected());
|
|
610
|
-
}
|
|
611
|
-
event.preventDefault();
|
|
612
|
-
return;
|
|
613
|
-
}
|
|
614
|
-
if (keyCode === SPACE || keyCode === ENTER) {
|
|
615
|
-
this.triggerOption(this.listKeyManager.activeItem);
|
|
616
|
-
event.preventDefault();
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
const isNavKey = keyCode === UP_ARROW ||
|
|
620
|
-
keyCode === DOWN_ARROW ||
|
|
621
|
-
keyCode === LEFT_ARROW ||
|
|
622
|
-
keyCode === RIGHT_ARROW ||
|
|
623
|
-
keyCode === HOME ||
|
|
624
|
-
keyCode === END;
|
|
625
|
-
this.listKeyManager.onKeydown(event);
|
|
626
|
-
// Will select an option if shift was pressed while navigating to the option
|
|
627
|
-
if (isNavKey && event.shiftKey && previousActiveIndex !== this.listKeyManager.activeItemIndex) {
|
|
628
|
-
this.triggerOption(this.listKeyManager.activeItem);
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
/** Called when a focus moves into the listbox. */
|
|
632
|
-
_handleFocusIn() {
|
|
633
|
-
// Note that we use a `focusin` handler for this instead of the existing `focus` handler,
|
|
634
|
-
// because focus won't land on the listbox if `useActiveDescendant` is enabled.
|
|
635
|
-
this._hasFocus = true;
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* Called when the focus leaves an element in the listbox.
|
|
639
|
-
* @param event The focusout event
|
|
640
|
-
*/
|
|
641
|
-
_handleFocusOut(event) {
|
|
642
|
-
// Some browsers (e.g. Chrome and Firefox) trigger the focusout event when the user returns back to the document.
|
|
643
|
-
// To prevent losing the active option in this case, we store it in `_previousActiveOption` and restore it on the window `blur` event
|
|
644
|
-
// This ensures that the `activeItem` matches the actual focused element when the user returns to the document.
|
|
645
|
-
this._previousActiveOption = this.listKeyManager.activeItem;
|
|
646
|
-
const otherElement = event.relatedTarget;
|
|
647
|
-
if (this.element !== otherElement && !this.element.contains(otherElement)) {
|
|
648
|
-
this._onTouched();
|
|
649
|
-
this._hasFocus = false;
|
|
650
|
-
this._setNextFocusToSelectedOption();
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
/** Get the id of the active option if active descendant is being used. */
|
|
654
|
-
_getAriaActiveDescendant() {
|
|
655
|
-
return this.useActiveDescendant ? this.listKeyManager?.activeItem?.id : null;
|
|
656
|
-
}
|
|
657
|
-
/** Get the tabindex for the listbox. */
|
|
658
|
-
_getTabIndex() {
|
|
659
|
-
if (this.disabled) {
|
|
660
|
-
return -1;
|
|
661
|
-
}
|
|
662
|
-
return this.useActiveDescendant || !this.listKeyManager.activeItem ? this.enabledTabIndex : -1;
|
|
663
|
-
}
|
|
664
|
-
/** Initialize the key manager. */
|
|
665
|
-
_initKeyManager() {
|
|
666
|
-
this.listKeyManager = new ActiveDescendantKeyManager(this.options)
|
|
667
|
-
.withWrap(!this._navigationWrapDisabled)
|
|
668
|
-
.withTypeAhead()
|
|
669
|
-
.withHomeAndEnd()
|
|
670
|
-
.withAllowedModifierKeys(['shiftKey'])
|
|
671
|
-
.skipPredicate(this._navigateDisabledOptions ? this._skipNonePredicate : this._skipDisabledPredicate);
|
|
672
|
-
if (this.orientation === 'vertical') {
|
|
673
|
-
this.listKeyManager.withVerticalOrientation();
|
|
674
|
-
}
|
|
675
|
-
else {
|
|
676
|
-
this.listKeyManager.withHorizontalOrientation(this._dir?.value || 'ltr');
|
|
677
|
-
}
|
|
678
|
-
if (this.selectionModel.selected.length) {
|
|
679
|
-
Promise.resolve().then(() => this._setNextFocusToSelectedOption());
|
|
680
|
-
}
|
|
681
|
-
this.listKeyManager.change.subscribe(() => this._focusActiveOption());
|
|
682
|
-
this.options.changes.pipe(takeUntil(this.destroyed)).subscribe(() => {
|
|
683
|
-
const activeOption = this.listKeyManager.activeItem;
|
|
684
|
-
// If the active option was deleted, we need to reset
|
|
685
|
-
// the key manager so it can allow focus back in.
|
|
686
|
-
if (activeOption && !this.options.find(option => option === activeOption)) {
|
|
687
|
-
this.listKeyManager.setActiveItem(-1);
|
|
688
|
-
this.changeDetectorRef.markForCheck();
|
|
689
|
-
}
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
/** Focus the active option. */
|
|
693
|
-
_focusActiveOption() {
|
|
694
|
-
if (!this.useActiveDescendant) {
|
|
695
|
-
this.listKeyManager.activeItem?.focus();
|
|
696
|
-
}
|
|
697
|
-
this.changeDetectorRef.markForCheck();
|
|
698
|
-
}
|
|
699
|
-
/**
|
|
700
|
-
* Set the selected values.
|
|
701
|
-
* @param value The list of new selected values.
|
|
702
|
-
*/
|
|
703
|
-
_setSelection(value) {
|
|
704
|
-
if (this._invalid) {
|
|
705
|
-
this.selectionModel.clear(false);
|
|
706
|
-
}
|
|
707
|
-
this.selectionModel.setSelection(...this._coerceValue(value));
|
|
708
|
-
if (!this._hasFocus) {
|
|
709
|
-
this._setNextFocusToSelectedOption();
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
/** Sets the first selected option as first in the keyboard focus order. */
|
|
713
|
-
_setNextFocusToSelectedOption() {
|
|
714
|
-
// Null check the options since they only get defined after `ngAfterContentInit`.
|
|
715
|
-
const selected = this.options?.find(option => option.isSelected());
|
|
716
|
-
if (selected) {
|
|
717
|
-
this.listKeyManager.updateActiveItem(selected);
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
/** Update the internal value of the listbox based on the selection model. */
|
|
721
|
-
_updateInternalValue() {
|
|
722
|
-
const indexCache = new Map();
|
|
723
|
-
this.selectionModel.sort((a, b) => {
|
|
724
|
-
const aIndex = this._getIndexForValue(indexCache, a);
|
|
725
|
-
const bIndex = this._getIndexForValue(indexCache, b);
|
|
726
|
-
return aIndex - bIndex;
|
|
727
|
-
});
|
|
728
|
-
const selected = this.selectionModel.selected;
|
|
729
|
-
this._invalid =
|
|
730
|
-
(!this.multiple && selected.length > 1) || !!this._getInvalidOptionValues(selected).length;
|
|
731
|
-
this.changeDetectorRef.markForCheck();
|
|
732
|
-
}
|
|
733
|
-
/**
|
|
734
|
-
* Gets the index of the given value in the given list of options.
|
|
735
|
-
* @param cache The cache of indices found so far
|
|
736
|
-
* @param value The value to find
|
|
737
|
-
* @return The index of the value in the options list
|
|
738
|
-
*/
|
|
739
|
-
_getIndexForValue(cache, value) {
|
|
740
|
-
const isEqual = this.compareWith || Object.is;
|
|
741
|
-
if (!cache.has(value)) {
|
|
742
|
-
let index = -1;
|
|
743
|
-
for (let i = 0; i < this.options.length; i++) {
|
|
744
|
-
if (isEqual(value, this.options.get(i).value)) {
|
|
745
|
-
index = i;
|
|
746
|
-
break;
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
cache.set(value, index);
|
|
750
|
-
}
|
|
751
|
-
return cache.get(value);
|
|
752
|
-
}
|
|
753
|
-
/**
|
|
754
|
-
* Handle the user clicking an option.
|
|
755
|
-
* @param option The option that was clicked.
|
|
756
|
-
*/
|
|
757
|
-
_handleOptionClicked(option, event) {
|
|
758
|
-
event.preventDefault();
|
|
759
|
-
this.listKeyManager.setActiveItem(option);
|
|
760
|
-
if (event.shiftKey && this.multiple) {
|
|
761
|
-
this.triggerRange(option, this._getLastTriggeredIndex() ?? this.listKeyManager.activeItemIndex, this.listKeyManager.activeItemIndex, !option.isSelected());
|
|
762
|
-
}
|
|
763
|
-
else {
|
|
764
|
-
this.triggerOption(option);
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
/** Verifies that no two options represent the same value under the compareWith function. */
|
|
768
|
-
_verifyNoOptionValueCollisions() {
|
|
769
|
-
this.options.changes.pipe(startWith(this.options), takeUntil(this.destroyed)).subscribe(() => {
|
|
770
|
-
const isEqual = this.compareWith ?? Object.is;
|
|
771
|
-
for (let i = 0; i < this.options.length; i++) {
|
|
772
|
-
const option = this.options.get(i);
|
|
773
|
-
let duplicate = null;
|
|
774
|
-
for (let j = i + 1; j < this.options.length; j++) {
|
|
775
|
-
const other = this.options.get(j);
|
|
776
|
-
if (isEqual(option.value, other.value)) {
|
|
777
|
-
duplicate = other;
|
|
778
|
-
break;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
if (duplicate) {
|
|
782
|
-
// TODO(mmalerba): Link to docs about this.
|
|
783
|
-
if (this.compareWith) {
|
|
784
|
-
console.warn(`Found multiple CdkOption representing the same value under the given compareWith function`, {
|
|
785
|
-
option1: option.element,
|
|
786
|
-
option2: duplicate.element,
|
|
787
|
-
compareWith: this.compareWith,
|
|
788
|
-
});
|
|
789
|
-
}
|
|
790
|
-
else {
|
|
791
|
-
console.warn(`Found multiple CdkOption with the same value`, {
|
|
792
|
-
option1: option.element,
|
|
793
|
-
option2: duplicate.element,
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
return;
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
});
|
|
800
|
-
}
|
|
801
|
-
/** Verifies that the option values are valid. */
|
|
802
|
-
_verifyOptionValues() {
|
|
803
|
-
if (this.options && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
804
|
-
const selected = this.selectionModel.selected;
|
|
805
|
-
const invalidValues = this._getInvalidOptionValues(selected);
|
|
806
|
-
if (!this.multiple && selected.length > 1) {
|
|
807
|
-
throw Error('Listbox cannot have more than one selected value in multi-selection mode.');
|
|
808
|
-
}
|
|
809
|
-
if (invalidValues.length) {
|
|
810
|
-
throw Error('Listbox has selected values that do not match any of its options.');
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
/**
|
|
815
|
-
* Coerces a value into an array representing a listbox selection.
|
|
816
|
-
* @param value The value to coerce
|
|
817
|
-
* @return An array
|
|
818
|
-
*/
|
|
819
|
-
_coerceValue(value) {
|
|
820
|
-
return value == null ? [] : coerceArray(value);
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* Get the sublist of values that do not represent valid option values in this listbox.
|
|
824
|
-
* @param values The list of values
|
|
825
|
-
* @return The sublist of values that are not valid option values
|
|
826
|
-
*/
|
|
827
|
-
_getInvalidOptionValues(values) {
|
|
828
|
-
const isEqual = this.compareWith || Object.is;
|
|
829
|
-
const validValues = (this.options || []).map(option => option.value);
|
|
830
|
-
return values.filter(value => !validValues.some(validValue => isEqual(value, validValue)));
|
|
831
|
-
}
|
|
832
|
-
/** Get the index of the last triggered option. */
|
|
833
|
-
_getLastTriggeredIndex() {
|
|
834
|
-
const index = this.options.toArray().indexOf(this._lastTriggered);
|
|
835
|
-
return index === -1 ? null : index;
|
|
836
|
-
}
|
|
837
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkListbox, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
838
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.6", type: CdkListbox, isStandalone: true, selector: "[cdkListbox]", inputs: { id: "id", enabledTabIndex: ["tabindex", "enabledTabIndex"], value: ["cdkListboxValue", "value"], multiple: ["cdkListboxMultiple", "multiple", booleanAttribute], disabled: ["cdkListboxDisabled", "disabled", booleanAttribute], useActiveDescendant: ["cdkListboxUseActiveDescendant", "useActiveDescendant", booleanAttribute], orientation: ["cdkListboxOrientation", "orientation"], compareWith: ["cdkListboxCompareWith", "compareWith"], navigationWrapDisabled: ["cdkListboxNavigationWrapDisabled", "navigationWrapDisabled", booleanAttribute], navigateDisabledOptions: ["cdkListboxNavigatesDisabledOptions", "navigateDisabledOptions", booleanAttribute] }, outputs: { valueChange: "cdkListboxValueChange" }, host: { attributes: { "role": "listbox" }, listeners: { "focus": "_handleFocus()", "keydown": "_handleKeydown($event)", "focusout": "_handleFocusOut($event)", "focusin": "_handleFocusIn()" }, properties: { "id": "id", "attr.tabindex": "_getTabIndex()", "attr.aria-disabled": "disabled", "attr.aria-multiselectable": "multiple", "attr.aria-activedescendant": "_getAriaActiveDescendant()", "attr.aria-orientation": "orientation" }, classAttribute: "cdk-listbox" }, providers: [
|
|
839
|
-
{
|
|
840
|
-
provide: NG_VALUE_ACCESSOR,
|
|
841
|
-
useExisting: forwardRef(() => CdkListbox),
|
|
842
|
-
multi: true,
|
|
843
|
-
},
|
|
844
|
-
], queries: [{ propertyName: "options", predicate: CdkOption, descendants: true }], exportAs: ["cdkListbox"], ngImport: i0 });
|
|
845
|
-
}
|
|
846
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkListbox, decorators: [{
|
|
847
|
-
type: Directive,
|
|
848
|
-
args: [{
|
|
849
|
-
selector: '[cdkListbox]',
|
|
850
|
-
exportAs: 'cdkListbox',
|
|
851
|
-
host: {
|
|
852
|
-
'role': 'listbox',
|
|
853
|
-
'class': 'cdk-listbox',
|
|
854
|
-
'[id]': 'id',
|
|
855
|
-
'[attr.tabindex]': '_getTabIndex()',
|
|
856
|
-
'[attr.aria-disabled]': 'disabled',
|
|
857
|
-
'[attr.aria-multiselectable]': 'multiple',
|
|
858
|
-
'[attr.aria-activedescendant]': '_getAriaActiveDescendant()',
|
|
859
|
-
'[attr.aria-orientation]': 'orientation',
|
|
860
|
-
'(focus)': '_handleFocus()',
|
|
861
|
-
'(keydown)': '_handleKeydown($event)',
|
|
862
|
-
'(focusout)': '_handleFocusOut($event)',
|
|
863
|
-
'(focusin)': '_handleFocusIn()',
|
|
864
|
-
},
|
|
865
|
-
providers: [
|
|
866
|
-
{
|
|
867
|
-
provide: NG_VALUE_ACCESSOR,
|
|
868
|
-
useExisting: forwardRef(() => CdkListbox),
|
|
869
|
-
multi: true,
|
|
870
|
-
},
|
|
871
|
-
],
|
|
872
|
-
}]
|
|
873
|
-
}], ctorParameters: () => [], propDecorators: { id: [{
|
|
874
|
-
type: Input
|
|
875
|
-
}], enabledTabIndex: [{
|
|
876
|
-
type: Input,
|
|
877
|
-
args: ['tabindex']
|
|
878
|
-
}], value: [{
|
|
879
|
-
type: Input,
|
|
880
|
-
args: ['cdkListboxValue']
|
|
881
|
-
}], multiple: [{
|
|
882
|
-
type: Input,
|
|
883
|
-
args: [{ alias: 'cdkListboxMultiple', transform: booleanAttribute }]
|
|
884
|
-
}], disabled: [{
|
|
885
|
-
type: Input,
|
|
886
|
-
args: [{ alias: 'cdkListboxDisabled', transform: booleanAttribute }]
|
|
887
|
-
}], useActiveDescendant: [{
|
|
888
|
-
type: Input,
|
|
889
|
-
args: [{ alias: 'cdkListboxUseActiveDescendant', transform: booleanAttribute }]
|
|
890
|
-
}], orientation: [{
|
|
891
|
-
type: Input,
|
|
892
|
-
args: ['cdkListboxOrientation']
|
|
893
|
-
}], compareWith: [{
|
|
894
|
-
type: Input,
|
|
895
|
-
args: ['cdkListboxCompareWith']
|
|
896
|
-
}], navigationWrapDisabled: [{
|
|
897
|
-
type: Input,
|
|
898
|
-
args: [{ alias: 'cdkListboxNavigationWrapDisabled', transform: booleanAttribute }]
|
|
899
|
-
}], navigateDisabledOptions: [{
|
|
900
|
-
type: Input,
|
|
901
|
-
args: [{ alias: 'cdkListboxNavigatesDisabledOptions', transform: booleanAttribute }]
|
|
902
|
-
}], valueChange: [{
|
|
903
|
-
type: Output,
|
|
904
|
-
args: ['cdkListboxValueChange']
|
|
905
|
-
}], options: [{
|
|
906
|
-
type: ContentChildren,
|
|
907
|
-
args: [CdkOption, { descendants: true }]
|
|
908
|
-
}] } });
|
|
909
|
-
|
|
910
|
-
const EXPORTED_DECLARATIONS = [CdkListbox, CdkOption];
|
|
911
|
-
class CdkListboxModule {
|
|
912
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkListboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
913
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.6", ngImport: i0, type: CdkListboxModule, imports: [CdkListbox, CdkOption], exports: [CdkListbox, CdkOption] });
|
|
914
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkListboxModule });
|
|
915
|
-
}
|
|
916
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CdkListboxModule, decorators: [{
|
|
917
|
-
type: NgModule,
|
|
918
|
-
args: [{
|
|
919
|
-
imports: [...EXPORTED_DECLARATIONS],
|
|
920
|
-
exports: [...EXPORTED_DECLARATIONS],
|
|
921
|
-
}]
|
|
922
|
-
}] });
|
|
923
|
-
|
|
924
|
-
export { CdkListbox, CdkListboxModule, CdkOption };
|
|
925
|
-
//# sourceMappingURL=listbox.mjs.map
|