@angular/cdk 20.0.0-rc.1 → 20.0.0
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/accordion/index.d.ts +3 -1
- package/dialog/index.d.ts +2 -2
- package/drag-drop/index.d.ts +2 -2
- package/fesm2022/{a11y-module-CbrGzbQN.mjs → a11y-module-DHa4AVFz.mjs} +27 -27
- package/fesm2022/a11y-module-DHa4AVFz.mjs.map +1 -0
- package/fesm2022/a11y.mjs +19 -19
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +20 -14
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/{activedescendant-key-manager-DC3-fwQI.mjs → activedescendant-key-manager-CZAE5aFC.mjs} +2 -2
- package/fesm2022/activedescendant-key-manager-CZAE5aFC.mjs.map +1 -0
- package/fesm2022/array-I1yfCXUO.mjs.map +1 -1
- package/fesm2022/bidi.mjs +9 -9
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/{breakpoints-observer-CNqHxU7z.mjs → breakpoints-observer-QutrMj4x.mjs} +8 -8
- package/fesm2022/breakpoints-observer-QutrMj4x.mjs.map +1 -0
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +10 -10
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/coercion/private.mjs.map +1 -1
- package/fesm2022/coercion.mjs.map +1 -1
- package/fesm2022/collections.mjs +1 -1
- package/fesm2022/css-pixel-value-C_HEqLhI.mjs.map +1 -1
- package/fesm2022/data-source-D34wiQZj.mjs.map +1 -1
- package/fesm2022/dialog.mjs +18 -18
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/{directionality-E3zek-p1.mjs → directionality-CChdj3az.mjs} +4 -4
- package/fesm2022/directionality-CChdj3az.mjs.map +1 -0
- package/fesm2022/dispose-view-repeater-strategy-D_JReLI1.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +35 -35
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/element-x4z00URv.mjs.map +1 -1
- package/fesm2022/fake-event-detection-DWOdFTFz.mjs.map +1 -1
- package/fesm2022/{focus-key-manager-C1rAQJ5z.mjs → focus-key-manager-CPmlyB_c.mjs} +2 -2
- package/fesm2022/focus-key-manager-CPmlyB_c.mjs.map +1 -0
- package/fesm2022/{focus-monitor-T5ZlFpu4.mjs → focus-monitor-DLjkiju1.mjs} +11 -11
- package/fesm2022/focus-monitor-DLjkiju1.mjs.map +1 -0
- package/fesm2022/{id-generator-C27MsMu2.mjs → id-generator-LuoRZSid.mjs} +4 -4
- package/fesm2022/id-generator-LuoRZSid.mjs.map +1 -0
- package/fesm2022/keycodes-CpHkExLC.mjs.map +1 -1
- package/fesm2022/keycodes.mjs.map +1 -1
- package/fesm2022/layout.mjs +6 -6
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/{list-key-manager-CyOIXo8P.mjs → list-key-manager-C7tp3RbG.mjs} +13 -13
- package/fesm2022/list-key-manager-C7tp3RbG.mjs.map +1 -0
- package/fesm2022/listbox.mjs +15 -15
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +58 -58
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers/private.mjs +3 -3
- package/fesm2022/observers/private.mjs.map +1 -1
- package/fesm2022/observers.mjs +13 -13
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/{overlay-module-CCzhcXfK.mjs → overlay-module-Bd2UplUU.mjs} +39 -39
- package/fesm2022/overlay-module-Bd2UplUU.mjs.map +1 -0
- package/fesm2022/overlay.mjs +9 -9
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/passive-listeners-esHZRgIN.mjs.map +1 -1
- package/fesm2022/{platform-gLq1JIgc.mjs → platform-DNDzkVcI.mjs} +4 -4
- package/fesm2022/platform-DNDzkVcI.mjs.map +1 -0
- package/fesm2022/platform.mjs +5 -5
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs +16 -16
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/private.mjs +4 -4
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/recycle-view-repeater-strategy-DoWdPqVw.mjs.map +1 -1
- package/fesm2022/scrolling-BkvA05C8.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +44 -46
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/selection-model-BCgC8uEN.mjs.map +1 -1
- package/fesm2022/shadow-dom-B0oHn41l.mjs.map +1 -1
- package/fesm2022/stepper.mjs +127 -108
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/{style-loader-i2d7TEeo.mjs → style-loader-B2sGQXxD.mjs} +4 -4
- package/fesm2022/style-loader-B2sGQXxD.mjs.map +1 -0
- package/fesm2022/table.mjs +75 -75
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/test-environment-CT0XxPyp.mjs.map +1 -1
- package/fesm2022/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2022/testing/testbed.mjs.map +1 -1
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/text-field.mjs +18 -18
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree-key-manager-KnCoIkIC.mjs.map +1 -1
- package/fesm2022/tree.mjs +26 -26
- package/fesm2022/tree.mjs.map +1 -1
- package/fesm2022/typeahead-9ZW4Dtsf.mjs.map +1 -1
- package/fesm2022/{unique-selection-dispatcher-YfWmNNyz.mjs → unique-selection-dispatcher-Cewa_Eg3.mjs} +4 -4
- package/fesm2022/unique-selection-dispatcher-Cewa_Eg3.mjs.map +1 -0
- package/menu/index.d.ts +2 -2
- package/overlay/index.d.ts +4 -4
- package/{overlay-module.d-BiAhhk6g.d.ts → overlay-module.d-CVO-IcaN.d.ts} +1 -1
- package/package.json +3 -3
- package/schematics/ng-add/index.js +1 -1
- package/scrolling/index.d.ts +1 -1
- package/{scrolling-module.d-DP0Qb7T9.d.ts → scrolling-module.d-BvCGMKMo.d.ts} +2 -2
- package/stepper/index.d.ts +18 -10
- package/table/index.d.ts +1 -1
- package/fesm2022/a11y-module-CbrGzbQN.mjs.map +0 -1
- package/fesm2022/activedescendant-key-manager-DC3-fwQI.mjs.map +0 -1
- package/fesm2022/breakpoints-observer-CNqHxU7z.mjs.map +0 -1
- package/fesm2022/directionality-E3zek-p1.mjs.map +0 -1
- package/fesm2022/focus-key-manager-C1rAQJ5z.mjs.map +0 -1
- package/fesm2022/focus-monitor-T5ZlFpu4.mjs.map +0 -1
- package/fesm2022/id-generator-C27MsMu2.mjs.map +0 -1
- package/fesm2022/list-key-manager-CyOIXo8P.mjs.map +0 -1
- package/fesm2022/overlay-module-CCzhcXfK.mjs.map +0 -1
- package/fesm2022/platform-gLq1JIgc.mjs.map +0 -1
- package/fesm2022/style-loader-i2d7TEeo.mjs.map +0 -1
- package/fesm2022/unique-selection-dispatcher-YfWmNNyz.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection-model-BCgC8uEN.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/src/cdk/collections/selection-model.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 {Subject} from 'rxjs';\n\n/**\n * Class to be used to power selecting one or more options from a list.\n */\nexport class SelectionModel<T> {\n /** Currently-selected values. */\n private _selection = new Set<T>();\n\n /** Keeps track of the deselected options that haven't been emitted by the change event. */\n private _deselectedToEmit: T[] = [];\n\n /** Keeps track of the selected options that haven't been emitted by the change event. */\n private _selectedToEmit: T[] = [];\n\n /** Cache for the array value of the selected items. */\n private _selected: T[] | null;\n\n /** Selected values. */\n get selected(): T[] {\n if (!this._selected) {\n this._selected = Array.from(this._selection.values());\n }\n\n return this._selected;\n }\n\n /** Event emitted when the value has changed. */\n readonly changed = new Subject<SelectionChange<T>>();\n\n constructor(\n private _multiple = false,\n initiallySelectedValues?: T[],\n private _emitChanges = true,\n public compareWith?: (o1: T, o2: T) => boolean,\n ) {\n if (initiallySelectedValues && initiallySelectedValues.length) {\n if (_multiple) {\n initiallySelectedValues.forEach(value => this._markSelected(value));\n } else {\n this._markSelected(initiallySelectedValues[0]);\n }\n\n // Clear the array in order to avoid firing the change event for preselected values.\n this._selectedToEmit.length = 0;\n }\n }\n\n /**\n * Selects a value or an array of values.\n * @param values The values to select\n * @return Whether the selection changed as a result of this call\n */\n select(...values: T[]): boolean {\n this._verifyValueAssignment(values);\n values.forEach(value => this._markSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Deselects a value or an array of values.\n * @param values The values to deselect\n * @return Whether the selection changed as a result of this call\n */\n deselect(...values: T[]): boolean {\n this._verifyValueAssignment(values);\n values.forEach(value => this._unmarkSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Sets the selected values\n * @param values The new selected values\n * @return Whether the selection changed as a result of this call\n */\n setSelection(...values: T[]): boolean {\n this._verifyValueAssignment(values);\n const oldValues = this.selected;\n const newSelectedSet = new Set(values.map(value => this._getConcreteValue(value)));\n values.forEach(value => this._markSelected(value));\n oldValues\n .filter(value => !newSelectedSet.has(this._getConcreteValue(value, newSelectedSet)))\n .forEach(value => this._unmarkSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Toggles a value between selected and deselected.\n * @param value The value to toggle\n * @return Whether the selection changed as a result of this call\n */\n toggle(value: T): boolean {\n return this.isSelected(value) ? this.deselect(value) : this.select(value);\n }\n\n /**\n * Clears all of the selected values.\n * @param flushEvent Whether to flush the changes in an event.\n * If false, the changes to the selection will be flushed along with the next event.\n * @return Whether the selection changed as a result of this call\n */\n clear(flushEvent = true): boolean {\n this._unmarkAll();\n const changed = this._hasQueuedChanges();\n if (flushEvent) {\n this._emitChangeEvent();\n }\n return changed;\n }\n\n /**\n * Determines whether a value is selected.\n */\n isSelected(value: T): boolean {\n return this._selection.has(this._getConcreteValue(value));\n }\n\n /**\n * Determines whether the model does not have a value.\n */\n isEmpty(): boolean {\n return this._selection.size === 0;\n }\n\n /**\n * Determines whether the model has a value.\n */\n hasValue(): boolean {\n return !this.isEmpty();\n }\n\n /**\n * Sorts the selected values based on a predicate function.\n */\n sort(predicate?: (a: T, b: T) => number): void {\n if (this._multiple && this.selected) {\n this._selected!.sort(predicate);\n }\n }\n\n /**\n * Gets whether multiple values can be selected.\n */\n isMultipleSelection() {\n return this._multiple;\n }\n\n /** Emits a change event and clears the records of selected and deselected values. */\n private _emitChangeEvent() {\n // Clear the selected values so they can be re-cached.\n this._selected = null;\n\n if (this._selectedToEmit.length || this._deselectedToEmit.length) {\n this.changed.next({\n source: this,\n added: this._selectedToEmit,\n removed: this._deselectedToEmit,\n });\n\n this._deselectedToEmit = [];\n this._selectedToEmit = [];\n }\n }\n\n /** Selects a value. */\n private _markSelected(value: T) {\n value = this._getConcreteValue(value);\n if (!this.isSelected(value)) {\n if (!this._multiple) {\n this._unmarkAll();\n }\n\n if (!this.isSelected(value)) {\n this._selection.add(value);\n }\n\n if (this._emitChanges) {\n this._selectedToEmit.push(value);\n }\n }\n }\n\n /** Deselects a value. */\n private _unmarkSelected(value: T) {\n value = this._getConcreteValue(value);\n if (this.isSelected(value)) {\n this._selection.delete(value);\n\n if (this._emitChanges) {\n this._deselectedToEmit.push(value);\n }\n }\n }\n\n /** Clears out the selected values. */\n private _unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }\n\n /**\n * Verifies the value assignment and throws an error if the specified value array is\n * including multiple values while the selection model is not supporting multiple values.\n */\n private _verifyValueAssignment(values: T[]) {\n if (values.length > 1 && !this._multiple && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMultipleValuesInSingleSelectionError();\n }\n }\n\n /** Whether there are queued up change to be emitted. */\n private _hasQueuedChanges() {\n return !!(this._deselectedToEmit.length || this._selectedToEmit.length);\n }\n\n /** Returns a value that is comparable to inputValue by applying compareWith function, returns the same inputValue otherwise. */\n private _getConcreteValue(inputValue: T, selection?: Set<T>): T {\n if (!this.compareWith) {\n return inputValue;\n } else {\n selection = selection ?? this._selection;\n for (let selectedValue of selection) {\n if (this.compareWith!(inputValue, selectedValue)) {\n return selectedValue;\n }\n }\n return inputValue;\n }\n }\n}\n\n/**\n * Event emitted when the value of a MatSelectionModel has changed.\n * @docs-private\n */\nexport interface SelectionChange<T> {\n /** Model that dispatched the event. */\n source: SelectionModel<T>;\n /** Options that were added to the model. */\n added: T[];\n /** Options that were removed from the model. */\n removed: T[];\n}\n\n/**\n * Returns an error that reports that multiple values are passed into a selection model\n * with a single value.\n * @docs-private\n */\nexport function getMultipleValuesInSingleSelectionError() {\n return Error('Cannot pass multiple values into SelectionModel with single-value mode.');\n}\n"],"names":[],"mappings":";;AAUA;;AAEG;MACU,cAAc,CAAA;AA0Bf,IAAA,SAAA;AAEA,IAAA,YAAA;AACD,IAAA,WAAA;;AA3BD,IAAA,UAAU,GAAG,IAAI,GAAG,EAAK;;IAGzB,iBAAiB,GAAQ,EAAE;;IAG3B,eAAe,GAAQ,EAAE;;AAGzB,IAAA,SAAS;;AAGjB,IAAA,IAAI,QAAQ,GAAA;AACV,QAAA,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;AACnB,YAAA,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;;QAGvD,OAAO,IAAI,CAAC,SAAS;;;AAId,IAAA,OAAO,GAAG,IAAI,OAAO,EAAsB;IAEpD,WACU,CAAA,SAAA,GAAY,KAAK,EACzB,uBAA6B,EACrB,YAAe,GAAA,IAAI,EACpB,WAAuC,EAAA;QAHtC,IAAS,CAAA,SAAA,GAAT,SAAS;QAET,IAAY,CAAA,YA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/bin/src/cdk/collections/selection-model.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 {Subject} from 'rxjs';\n\n/**\n * Class to be used to power selecting one or more options from a list.\n */\nexport class SelectionModel<T> {\n /** Currently-selected values. */\n private _selection = new Set<T>();\n\n /** Keeps track of the deselected options that haven't been emitted by the change event. */\n private _deselectedToEmit: T[] = [];\n\n /** Keeps track of the selected options that haven't been emitted by the change event. */\n private _selectedToEmit: T[] = [];\n\n /** Cache for the array value of the selected items. */\n private _selected: T[] | null;\n\n /** Selected values. */\n get selected(): T[] {\n if (!this._selected) {\n this._selected = Array.from(this._selection.values());\n }\n\n return this._selected;\n }\n\n /** Event emitted when the value has changed. */\n readonly changed = new Subject<SelectionChange<T>>();\n\n constructor(\n private _multiple = false,\n initiallySelectedValues?: T[],\n private _emitChanges = true,\n public compareWith?: (o1: T, o2: T) => boolean,\n ) {\n if (initiallySelectedValues && initiallySelectedValues.length) {\n if (_multiple) {\n initiallySelectedValues.forEach(value => this._markSelected(value));\n } else {\n this._markSelected(initiallySelectedValues[0]);\n }\n\n // Clear the array in order to avoid firing the change event for preselected values.\n this._selectedToEmit.length = 0;\n }\n }\n\n /**\n * Selects a value or an array of values.\n * @param values The values to select\n * @return Whether the selection changed as a result of this call\n */\n select(...values: T[]): boolean {\n this._verifyValueAssignment(values);\n values.forEach(value => this._markSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Deselects a value or an array of values.\n * @param values The values to deselect\n * @return Whether the selection changed as a result of this call\n */\n deselect(...values: T[]): boolean {\n this._verifyValueAssignment(values);\n values.forEach(value => this._unmarkSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Sets the selected values\n * @param values The new selected values\n * @return Whether the selection changed as a result of this call\n */\n setSelection(...values: T[]): boolean {\n this._verifyValueAssignment(values);\n const oldValues = this.selected;\n const newSelectedSet = new Set(values.map(value => this._getConcreteValue(value)));\n values.forEach(value => this._markSelected(value));\n oldValues\n .filter(value => !newSelectedSet.has(this._getConcreteValue(value, newSelectedSet)))\n .forEach(value => this._unmarkSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Toggles a value between selected and deselected.\n * @param value The value to toggle\n * @return Whether the selection changed as a result of this call\n */\n toggle(value: T): boolean {\n return this.isSelected(value) ? this.deselect(value) : this.select(value);\n }\n\n /**\n * Clears all of the selected values.\n * @param flushEvent Whether to flush the changes in an event.\n * If false, the changes to the selection will be flushed along with the next event.\n * @return Whether the selection changed as a result of this call\n */\n clear(flushEvent = true): boolean {\n this._unmarkAll();\n const changed = this._hasQueuedChanges();\n if (flushEvent) {\n this._emitChangeEvent();\n }\n return changed;\n }\n\n /**\n * Determines whether a value is selected.\n */\n isSelected(value: T): boolean {\n return this._selection.has(this._getConcreteValue(value));\n }\n\n /**\n * Determines whether the model does not have a value.\n */\n isEmpty(): boolean {\n return this._selection.size === 0;\n }\n\n /**\n * Determines whether the model has a value.\n */\n hasValue(): boolean {\n return !this.isEmpty();\n }\n\n /**\n * Sorts the selected values based on a predicate function.\n */\n sort(predicate?: (a: T, b: T) => number): void {\n if (this._multiple && this.selected) {\n this._selected!.sort(predicate);\n }\n }\n\n /**\n * Gets whether multiple values can be selected.\n */\n isMultipleSelection() {\n return this._multiple;\n }\n\n /** Emits a change event and clears the records of selected and deselected values. */\n private _emitChangeEvent() {\n // Clear the selected values so they can be re-cached.\n this._selected = null;\n\n if (this._selectedToEmit.length || this._deselectedToEmit.length) {\n this.changed.next({\n source: this,\n added: this._selectedToEmit,\n removed: this._deselectedToEmit,\n });\n\n this._deselectedToEmit = [];\n this._selectedToEmit = [];\n }\n }\n\n /** Selects a value. */\n private _markSelected(value: T) {\n value = this._getConcreteValue(value);\n if (!this.isSelected(value)) {\n if (!this._multiple) {\n this._unmarkAll();\n }\n\n if (!this.isSelected(value)) {\n this._selection.add(value);\n }\n\n if (this._emitChanges) {\n this._selectedToEmit.push(value);\n }\n }\n }\n\n /** Deselects a value. */\n private _unmarkSelected(value: T) {\n value = this._getConcreteValue(value);\n if (this.isSelected(value)) {\n this._selection.delete(value);\n\n if (this._emitChanges) {\n this._deselectedToEmit.push(value);\n }\n }\n }\n\n /** Clears out the selected values. */\n private _unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }\n\n /**\n * Verifies the value assignment and throws an error if the specified value array is\n * including multiple values while the selection model is not supporting multiple values.\n */\n private _verifyValueAssignment(values: T[]) {\n if (values.length > 1 && !this._multiple && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMultipleValuesInSingleSelectionError();\n }\n }\n\n /** Whether there are queued up change to be emitted. */\n private _hasQueuedChanges() {\n return !!(this._deselectedToEmit.length || this._selectedToEmit.length);\n }\n\n /** Returns a value that is comparable to inputValue by applying compareWith function, returns the same inputValue otherwise. */\n private _getConcreteValue(inputValue: T, selection?: Set<T>): T {\n if (!this.compareWith) {\n return inputValue;\n } else {\n selection = selection ?? this._selection;\n for (let selectedValue of selection) {\n if (this.compareWith!(inputValue, selectedValue)) {\n return selectedValue;\n }\n }\n return inputValue;\n }\n }\n}\n\n/**\n * Event emitted when the value of a MatSelectionModel has changed.\n * @docs-private\n */\nexport interface SelectionChange<T> {\n /** Model that dispatched the event. */\n source: SelectionModel<T>;\n /** Options that were added to the model. */\n added: T[];\n /** Options that were removed from the model. */\n removed: T[];\n}\n\n/**\n * Returns an error that reports that multiple values are passed into a selection model\n * with a single value.\n * @docs-private\n */\nexport function getMultipleValuesInSingleSelectionError() {\n return Error('Cannot pass multiple values into SelectionModel with single-value mode.');\n}\n"],"names":[],"mappings":";;AAUA;;AAEG;MACU,cAAc,CAAA;AA0Bf,IAAA,SAAA;AAEA,IAAA,YAAA;AACD,IAAA,WAAA;;AA3BD,IAAA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BAAiB,CAAC,UAAa,EAAE,SAAkB,EAAA;AACzD,QAAA,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;AACrB,YAAA,OAAO,UAAU;;aACZ;AACL,YAAA,SAAS,GAAG,SAAS,IAAI,IAAI,CAAC,UAAU;AACxC,YAAA,KAAK,IAAI,aAAa,IAAI,SAAS,EAAE;gBACnC,IAAI,IAAI,CAAC,WAAY,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE;AAChD,oBAAA,OAAO,aAAa;;;AAGxB,YAAA,OAAO,UAAU;;;AAGtB;AAeD;;;;AAIG;SACa,uCAAuC,GAAA;AACrD,IAAA,OAAO,KAAK,CAAC,yEAAyE,CAAC;AACzF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadow-dom-B0oHn41l.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"shadow-dom-B0oHn41l.mjs","sources":["../../../../../k8-fastbuild-ST-46c76129e412/bin/src/cdk/platform/features/shadow-dom.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\nlet shadowDomIsSupported: boolean;\n\n/** Checks whether the user's browser support Shadow DOM. */\nexport function _supportsShadowDom(): boolean {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && ((head as any).createShadowRoot || head.attachShadow));\n }\n\n return shadowDomIsSupported;\n}\n\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nexport function _getShadowRoot(element: HTMLElement): ShadowRoot | null {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n // Note that this should be caught by `_supportsShadowDom`, but some\n // teams have been able to hit this code path on unsupported browsers.\n if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n\n return null;\n}\n\n/**\n * Gets the currently-focused element on the page while\n * also piercing through Shadow DOM boundaries.\n */\nexport function _getFocusedElementPierceShadowDom(): HTMLElement | null {\n let activeElement =\n typeof document !== 'undefined' && document\n ? (document.activeElement as HTMLElement | null)\n : null;\n\n while (activeElement && activeElement.shadowRoot) {\n const newActiveElement = activeElement.shadowRoot.activeElement as HTMLElement | null;\n if (newActiveElement === activeElement) {\n break;\n } else {\n activeElement = newActiveElement;\n }\n }\n\n return activeElement;\n}\n\n/** Gets the target of an event while accounting for Shadow DOM. */\nexport function _getEventTarget<T extends EventTarget>(event: Event): T | null {\n // If an event is bound outside the Shadow DOM, the `event.target` will\n // point to the shadow root so we have to use `composedPath` instead.\n return (event.composedPath ? event.composedPath()[0] : event.target) as T | null;\n}\n"],"names":[],"mappings":"AAQA,IAAI,oBAA6B;AAEjC;SACgB,kBAAkB,GAAA;AAChC,IAAA,IAAI,oBAAoB,IAAI,IAAI,EAAE;AAChC,QAAA,MAAM,IAAI,GAAG,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,CAAC,IAAI,GAAG,IAAI;AACnE,QAAA,oBAAoB,GAAG,CAAC,EAAE,IAAI,KAAM,IAAY,CAAC,gBAAgB,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;;AAG1F,IAAA,OAAO,oBAAoB;AAC7B;AAEA;AACM,SAAU,cAAc,CAAC,OAAoB,EAAA;IACjD,IAAI,kBAAkB,EAAE,EAAE;AACxB,QAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI;;;QAInE,IAAI,OAAO,UAAU,KAAK,WAAW,IAAI,UAAU,IAAI,QAAQ,YAAY,UAAU,EAAE;AACrF,YAAA,OAAO,QAAQ;;;AAInB,IAAA,OAAO,IAAI;AACb;AAEA;;;AAGG;SACa,iCAAiC,GAAA;AAC/C,IAAA,IAAI,aAAa,GACf,OAAO,QAAQ,KAAK,WAAW,IAAI;UAC9B,QAAQ,CAAC;UACV,IAAI;AAEV,IAAA,OAAO,aAAa,IAAI,aAAa,CAAC,UAAU,EAAE;AAChD,QAAA,MAAM,gBAAgB,GAAG,aAAa,CAAC,UAAU,CAAC,aAAmC;AACrF,QAAA,IAAI,gBAAgB,KAAK,aAAa,EAAE;YACtC;;aACK;YACL,aAAa,GAAG,gBAAgB;;;AAIpC,IAAA,OAAO,aAAa;AACtB;AAEA;AACM,SAAU,eAAe,CAAwB,KAAY,EAAA;;;IAGjE,QAAQ,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM;AACrE;;;;"}
|
package/fesm2022/stepper.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, Directive, TemplateRef, InjectionToken, EventEmitter, booleanAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, ContentChild, ContentChildren, ViewChild, Input, Output, ChangeDetectorRef, QueryList, numberAttribute, NgModule } from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, Directive, TemplateRef, InjectionToken, signal, EventEmitter, computed, booleanAttribute, Component, ViewEncapsulation, ChangeDetectionStrategy, ContentChild, ContentChildren, ViewChild, Input, Output, ChangeDetectorRef, QueryList, numberAttribute, NgModule } from '@angular/core';
|
|
3
3
|
import { ControlContainer } from '@angular/forms';
|
|
4
4
|
import { Subject, of } from 'rxjs';
|
|
5
5
|
import { startWith, takeUntil } from 'rxjs/operators';
|
|
6
|
-
import { D as Directionality } from './directionality-
|
|
7
|
-
import { _ as _IdGenerator } from './id-generator-
|
|
8
|
-
import { F as FocusKeyManager } from './focus-key-manager-
|
|
6
|
+
import { D as Directionality } from './directionality-CChdj3az.mjs';
|
|
7
|
+
import { _ as _IdGenerator } from './id-generator-LuoRZSid.mjs';
|
|
8
|
+
import { F as FocusKeyManager } from './focus-key-manager-CPmlyB_c.mjs';
|
|
9
9
|
import { hasModifierKey } from './keycodes.mjs';
|
|
10
10
|
import { S as SPACE, c as ENTER } from './keycodes-CpHkExLC.mjs';
|
|
11
11
|
import { c as _getFocusedElementPierceShadowDom } from './shadow-dom-B0oHn41l.mjs';
|
|
12
12
|
import { BidiModule } from './bidi.mjs';
|
|
13
|
-
import './list-key-manager-
|
|
13
|
+
import './list-key-manager-C7tp3RbG.mjs';
|
|
14
14
|
import './typeahead-9ZW4Dtsf.mjs';
|
|
15
15
|
|
|
16
16
|
class CdkStepHeader {
|
|
@@ -20,10 +20,10 @@ class CdkStepHeader {
|
|
|
20
20
|
focus() {
|
|
21
21
|
this._elementRef.nativeElement.focus();
|
|
22
22
|
}
|
|
23
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0
|
|
24
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
24
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: CdkStepHeader, isStandalone: true, selector: "[cdkStepHeader]", host: { attributes: { "role": "tab" } }, ngImport: i0 });
|
|
25
25
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepHeader, decorators: [{
|
|
27
27
|
type: Directive,
|
|
28
28
|
args: [{
|
|
29
29
|
selector: '[cdkStepHeader]',
|
|
@@ -36,10 +36,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-rc.0", ng
|
|
|
36
36
|
class CdkStepLabel {
|
|
37
37
|
template = inject(TemplateRef);
|
|
38
38
|
constructor() { }
|
|
39
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0
|
|
40
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepLabel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
40
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: CdkStepLabel, isStandalone: true, selector: "[cdkStepLabel]", ngImport: i0 });
|
|
41
41
|
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepLabel, decorators: [{
|
|
43
43
|
type: Directive,
|
|
44
44
|
args: [{
|
|
45
45
|
selector: '[cdkStepLabel]',
|
|
@@ -79,7 +79,13 @@ class CdkStep {
|
|
|
79
79
|
/** The top level abstract control of the step. */
|
|
80
80
|
stepControl;
|
|
81
81
|
/** Whether user has attempted to move away from the step. */
|
|
82
|
-
interacted
|
|
82
|
+
get interacted() {
|
|
83
|
+
return this._interacted();
|
|
84
|
+
}
|
|
85
|
+
set interacted(value) {
|
|
86
|
+
this._interacted.set(value);
|
|
87
|
+
}
|
|
88
|
+
_interacted = signal(false);
|
|
83
89
|
/** Emits when the user has attempted to move away from the step. */
|
|
84
90
|
interactedStream = new EventEmitter();
|
|
85
91
|
/** Plain text label of the step. */
|
|
@@ -94,32 +100,82 @@ class CdkStep {
|
|
|
94
100
|
*/
|
|
95
101
|
ariaLabelledby;
|
|
96
102
|
/** State of the step. */
|
|
97
|
-
state
|
|
103
|
+
get state() {
|
|
104
|
+
return this._state();
|
|
105
|
+
}
|
|
106
|
+
set state(value) {
|
|
107
|
+
this._state.set(value);
|
|
108
|
+
}
|
|
109
|
+
_state = signal(undefined);
|
|
98
110
|
/** Whether the user can return to this step once it has been marked as completed. */
|
|
99
|
-
editable
|
|
111
|
+
get editable() {
|
|
112
|
+
return this._editable();
|
|
113
|
+
}
|
|
114
|
+
set editable(value) {
|
|
115
|
+
this._editable.set(value);
|
|
116
|
+
}
|
|
117
|
+
_editable = signal(true);
|
|
100
118
|
/** Whether the completion of step is optional. */
|
|
101
119
|
optional = false;
|
|
102
120
|
/** Whether step is marked as completed. */
|
|
103
121
|
get completed() {
|
|
104
|
-
|
|
122
|
+
const override = this._completedOverride();
|
|
123
|
+
const interacted = this._interacted();
|
|
124
|
+
if (override != null) {
|
|
125
|
+
return override;
|
|
126
|
+
}
|
|
127
|
+
return interacted && (!this.stepControl || this.stepControl.valid);
|
|
105
128
|
}
|
|
106
129
|
set completed(value) {
|
|
107
|
-
this._completedOverride
|
|
108
|
-
}
|
|
109
|
-
_completedOverride = null;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
130
|
+
this._completedOverride.set(value);
|
|
131
|
+
}
|
|
132
|
+
_completedOverride = signal(null);
|
|
133
|
+
/** Current index of the step within the stepper. */
|
|
134
|
+
index = signal(-1);
|
|
135
|
+
/** Whether the step is selected. */
|
|
136
|
+
isSelected = computed(() => this._stepper.selectedIndex === this.index());
|
|
137
|
+
/** Type of indicator that should be shown for the step. */
|
|
138
|
+
indicatorType = computed(() => {
|
|
139
|
+
const selected = this.isSelected();
|
|
140
|
+
const completed = this.completed;
|
|
141
|
+
const defaultState = this._state() ?? STEP_STATE.NUMBER;
|
|
142
|
+
const editable = this._editable();
|
|
143
|
+
if (this._showError() && this.hasError && !selected) {
|
|
144
|
+
return STEP_STATE.ERROR;
|
|
145
|
+
}
|
|
146
|
+
if (this._displayDefaultIndicatorType) {
|
|
147
|
+
if (!completed || selected) {
|
|
148
|
+
return STEP_STATE.NUMBER;
|
|
149
|
+
}
|
|
150
|
+
return editable ? STEP_STATE.EDIT : STEP_STATE.DONE;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
if (completed && !selected) {
|
|
154
|
+
return STEP_STATE.DONE;
|
|
155
|
+
}
|
|
156
|
+
else if (completed && selected) {
|
|
157
|
+
return defaultState;
|
|
158
|
+
}
|
|
159
|
+
return editable && selected ? STEP_STATE.EDIT : defaultState;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
/** Whether the user can navigate to the step. */
|
|
163
|
+
isNavigable = computed(() => {
|
|
164
|
+
const isSelected = this.isSelected();
|
|
165
|
+
const isCompleted = this.completed;
|
|
166
|
+
return isCompleted || isSelected || !this._stepper.linear;
|
|
167
|
+
});
|
|
113
168
|
/** Whether step has an error. */
|
|
114
169
|
get hasError() {
|
|
115
|
-
|
|
170
|
+
const customError = this._customError();
|
|
171
|
+
return customError == null ? this._getDefaultError() : customError;
|
|
116
172
|
}
|
|
117
173
|
set hasError(value) {
|
|
118
|
-
this._customError
|
|
174
|
+
this._customError.set(value);
|
|
119
175
|
}
|
|
120
|
-
_customError = null;
|
|
176
|
+
_customError = signal(null);
|
|
121
177
|
_getDefaultError() {
|
|
122
|
-
return this.
|
|
178
|
+
return this.interacted && !!this.stepControl?.invalid;
|
|
123
179
|
}
|
|
124
180
|
constructor() {
|
|
125
181
|
const stepperOptions = inject(STEPPER_GLOBAL_OPTIONS, { optional: true });
|
|
@@ -132,12 +188,12 @@ class CdkStep {
|
|
|
132
188
|
}
|
|
133
189
|
/** Resets the step to its initial state. Note that this includes resetting form data. */
|
|
134
190
|
reset() {
|
|
135
|
-
this.
|
|
136
|
-
if (this._completedOverride != null) {
|
|
137
|
-
this._completedOverride
|
|
191
|
+
this._interacted.set(false);
|
|
192
|
+
if (this._completedOverride() != null) {
|
|
193
|
+
this._completedOverride.set(false);
|
|
138
194
|
}
|
|
139
|
-
if (this._customError != null) {
|
|
140
|
-
this._customError
|
|
195
|
+
if (this._customError() != null) {
|
|
196
|
+
this._customError.set(false);
|
|
141
197
|
}
|
|
142
198
|
if (this.stepControl) {
|
|
143
199
|
// Reset the forms since the default error state matchers will show errors on submit and we
|
|
@@ -153,8 +209,8 @@ class CdkStep {
|
|
|
153
209
|
this._stepper._stateChanged();
|
|
154
210
|
}
|
|
155
211
|
_markAsInteracted() {
|
|
156
|
-
if (!this.
|
|
157
|
-
this.
|
|
212
|
+
if (!this._interacted()) {
|
|
213
|
+
this._interacted.set(true);
|
|
158
214
|
this.interactedStream.emit(this);
|
|
159
215
|
}
|
|
160
216
|
}
|
|
@@ -162,17 +218,17 @@ class CdkStep {
|
|
|
162
218
|
_showError() {
|
|
163
219
|
// We want to show the error state either if the user opted into/out of it using the
|
|
164
220
|
// global options, or if they've explicitly set it through the `hasError` input.
|
|
165
|
-
return this._stepperOptions.showError ?? this._customError != null;
|
|
221
|
+
return this._stepperOptions.showError ?? this._customError() != null;
|
|
166
222
|
}
|
|
167
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0
|
|
168
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.0.0
|
|
223
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStep, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
224
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.0.0", type: CdkStep, isStandalone: true, selector: "cdk-step", inputs: { stepControl: "stepControl", label: "label", errorMessage: "errorMessage", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], state: "state", editable: ["editable", "editable", booleanAttribute], optional: ["optional", "optional", booleanAttribute], completed: ["completed", "completed", booleanAttribute], hasError: ["hasError", "hasError", booleanAttribute] }, outputs: { interactedStream: "interacted" }, queries: [{ propertyName: "stepLabel", first: true, predicate: CdkStepLabel, descendants: true }, { propertyName: "_childForms", predicate:
|
|
169
225
|
// Note: we look for `ControlContainer` here, because both `NgForm` and `FormGroupDirective`
|
|
170
226
|
// provides themselves as such, but we don't want to have a concrete reference to both of
|
|
171
227
|
// the directives. The type is marked as `Partial` in case we run into a class that provides
|
|
172
228
|
// itself as `ControlContainer` but doesn't have the same interface as the directives.
|
|
173
229
|
ControlContainer, descendants: true }], viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, static: true }], exportAs: ["cdkStep"], usesOnChanges: true, ngImport: i0, template: '<ng-template><ng-content/></ng-template>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
174
230
|
}
|
|
175
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0
|
|
231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStep, decorators: [{
|
|
176
232
|
type: Component,
|
|
177
233
|
args: [{
|
|
178
234
|
selector: 'cdk-step',
|
|
@@ -248,7 +304,7 @@ class CdkStepper {
|
|
|
248
304
|
linear = false;
|
|
249
305
|
/** The index of the selected step. */
|
|
250
306
|
get selectedIndex() {
|
|
251
|
-
return this._selectedIndex;
|
|
307
|
+
return this._selectedIndex();
|
|
252
308
|
}
|
|
253
309
|
set selectedIndex(index) {
|
|
254
310
|
if (this._steps) {
|
|
@@ -256,19 +312,19 @@ class CdkStepper {
|
|
|
256
312
|
if (!this._isValidIndex(index) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
257
313
|
throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');
|
|
258
314
|
}
|
|
259
|
-
if (this.
|
|
315
|
+
if (this.selectedIndex !== index) {
|
|
260
316
|
this.selected?._markAsInteracted();
|
|
261
317
|
if (!this._anyControlsInvalidOrPending(index) &&
|
|
262
|
-
(index >= this.
|
|
318
|
+
(index >= this.selectedIndex || this.steps.toArray()[index].editable)) {
|
|
263
319
|
this._updateSelectedItemIndex(index);
|
|
264
320
|
}
|
|
265
321
|
}
|
|
266
322
|
}
|
|
267
323
|
else {
|
|
268
|
-
this._selectedIndex
|
|
324
|
+
this._selectedIndex.set(index);
|
|
269
325
|
}
|
|
270
326
|
}
|
|
271
|
-
_selectedIndex = 0;
|
|
327
|
+
_selectedIndex = signal(0);
|
|
272
328
|
/** The step that is selected. */
|
|
273
329
|
get selected() {
|
|
274
330
|
return this.steps ? this.steps.toArray()[this.selectedIndex] : undefined;
|
|
@@ -300,6 +356,7 @@ class CdkStepper {
|
|
|
300
356
|
.pipe(startWith(this._steps), takeUntil(this._destroyed))
|
|
301
357
|
.subscribe((steps) => {
|
|
302
358
|
this.steps.reset(steps.filter(step => step._stepper === this));
|
|
359
|
+
this.steps.forEach((step, index) => step.index.set(index));
|
|
303
360
|
this.steps.notifyOnChanges();
|
|
304
361
|
});
|
|
305
362
|
}
|
|
@@ -336,23 +393,23 @@ class CdkStepper {
|
|
|
336
393
|
(this._dir ? this._dir.change : of())
|
|
337
394
|
.pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))
|
|
338
395
|
.subscribe(direction => this._keyManager?.withHorizontalOrientation(direction));
|
|
339
|
-
this._keyManager.updateActiveItem(this.
|
|
396
|
+
this._keyManager.updateActiveItem(this.selectedIndex);
|
|
340
397
|
// No need to `takeUntil` here, because we're the ones destroying `steps`.
|
|
341
398
|
this.steps.changes.subscribe(() => {
|
|
342
399
|
if (!this.selected) {
|
|
343
|
-
this._selectedIndex
|
|
400
|
+
this._selectedIndex.set(Math.max(this.selectedIndex - 1, 0));
|
|
344
401
|
}
|
|
345
402
|
});
|
|
346
403
|
// The logic which asserts that the selected index is within bounds doesn't run before the
|
|
347
404
|
// steps are initialized, because we don't how many steps there are yet so we may have an
|
|
348
405
|
// invalid index on init. If that's the case, auto-correct to the default so we don't throw.
|
|
349
|
-
if (!this._isValidIndex(this.
|
|
350
|
-
this._selectedIndex
|
|
406
|
+
if (!this._isValidIndex(this.selectedIndex)) {
|
|
407
|
+
this._selectedIndex.set(0);
|
|
351
408
|
}
|
|
352
409
|
// For linear step and selected index is greater than zero,
|
|
353
410
|
// set all the previous steps to interacted so that we can navigate to previous steps.
|
|
354
|
-
if (this.linear && this.
|
|
355
|
-
const visitedSteps = this.steps.toArray().slice(0, this._selectedIndex);
|
|
411
|
+
if (this.linear && this.selectedIndex > 0) {
|
|
412
|
+
const visitedSteps = this.steps.toArray().slice(0, this._selectedIndex());
|
|
356
413
|
for (const step of visitedSteps) {
|
|
357
414
|
step._markAsInteracted();
|
|
358
415
|
}
|
|
@@ -367,11 +424,11 @@ class CdkStepper {
|
|
|
367
424
|
}
|
|
368
425
|
/** Selects and focuses the next step in list. */
|
|
369
426
|
next() {
|
|
370
|
-
this.selectedIndex = Math.min(this._selectedIndex + 1, this.steps.length - 1);
|
|
427
|
+
this.selectedIndex = Math.min(this._selectedIndex() + 1, this.steps.length - 1);
|
|
371
428
|
}
|
|
372
429
|
/** Selects and focuses the previous step in list. */
|
|
373
430
|
previous() {
|
|
374
|
-
this.selectedIndex = Math.max(this._selectedIndex - 1, 0);
|
|
431
|
+
this.selectedIndex = Math.max(this._selectedIndex() - 1, 0);
|
|
375
432
|
}
|
|
376
433
|
/** Resets the stepper to its initial state. Note that this includes clearing form data. */
|
|
377
434
|
reset() {
|
|
@@ -393,7 +450,7 @@ class CdkStepper {
|
|
|
393
450
|
}
|
|
394
451
|
/** Returns position state of the step with the given index. */
|
|
395
452
|
_getAnimationDirection(index) {
|
|
396
|
-
const position = index - this._selectedIndex;
|
|
453
|
+
const position = index - this._selectedIndex();
|
|
397
454
|
if (position < 0) {
|
|
398
455
|
return this._layoutDirection() === 'rtl' ? 'next' : 'previous';
|
|
399
456
|
}
|
|
@@ -402,56 +459,18 @@ class CdkStepper {
|
|
|
402
459
|
}
|
|
403
460
|
return 'current';
|
|
404
461
|
}
|
|
405
|
-
/** Returns the type of icon to be displayed. */
|
|
406
|
-
_getIndicatorType(index, state = STEP_STATE.NUMBER) {
|
|
407
|
-
const step = this.steps.toArray()[index];
|
|
408
|
-
const isCurrentStep = this._isCurrentStep(index);
|
|
409
|
-
return step._displayDefaultIndicatorType
|
|
410
|
-
? this._getDefaultIndicatorLogic(step, isCurrentStep)
|
|
411
|
-
: this._getGuidelineLogic(step, isCurrentStep, state);
|
|
412
|
-
}
|
|
413
|
-
_getDefaultIndicatorLogic(step, isCurrentStep) {
|
|
414
|
-
if (step._showError() && step.hasError && !isCurrentStep) {
|
|
415
|
-
return STEP_STATE.ERROR;
|
|
416
|
-
}
|
|
417
|
-
else if (!step.completed || isCurrentStep) {
|
|
418
|
-
return STEP_STATE.NUMBER;
|
|
419
|
-
}
|
|
420
|
-
else {
|
|
421
|
-
return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
_getGuidelineLogic(step, isCurrentStep, state = STEP_STATE.NUMBER) {
|
|
425
|
-
if (step._showError() && step.hasError && !isCurrentStep) {
|
|
426
|
-
return STEP_STATE.ERROR;
|
|
427
|
-
}
|
|
428
|
-
else if (step.completed && !isCurrentStep) {
|
|
429
|
-
return STEP_STATE.DONE;
|
|
430
|
-
}
|
|
431
|
-
else if (step.completed && isCurrentStep) {
|
|
432
|
-
return state;
|
|
433
|
-
}
|
|
434
|
-
else if (step.editable && isCurrentStep) {
|
|
435
|
-
return STEP_STATE.EDIT;
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
return state;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
_isCurrentStep(index) {
|
|
442
|
-
return this._selectedIndex === index;
|
|
443
|
-
}
|
|
444
462
|
/** Returns the index of the currently-focused step header. */
|
|
445
463
|
_getFocusIndex() {
|
|
446
|
-
return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;
|
|
464
|
+
return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex();
|
|
447
465
|
}
|
|
448
466
|
_updateSelectedItemIndex(newIndex) {
|
|
449
467
|
const stepsArray = this.steps.toArray();
|
|
468
|
+
const selectedIndex = this._selectedIndex();
|
|
450
469
|
this.selectionChange.emit({
|
|
451
470
|
selectedIndex: newIndex,
|
|
452
|
-
previouslySelectedIndex:
|
|
471
|
+
previouslySelectedIndex: selectedIndex,
|
|
453
472
|
selectedStep: stepsArray[newIndex],
|
|
454
|
-
previouslySelectedStep: stepsArray[
|
|
473
|
+
previouslySelectedStep: stepsArray[selectedIndex],
|
|
455
474
|
});
|
|
456
475
|
// If focus is inside the stepper, move it to the next header, otherwise it may become
|
|
457
476
|
// lost when the active step content is hidden. We can't be more granular with the check
|
|
@@ -462,8 +481,8 @@ class CdkStepper {
|
|
|
462
481
|
? this._keyManager.setActiveItem(newIndex)
|
|
463
482
|
: this._keyManager.updateActiveItem(newIndex);
|
|
464
483
|
}
|
|
465
|
-
this._selectedIndex
|
|
466
|
-
this.selectedIndexChange.emit(
|
|
484
|
+
this._selectedIndex.set(newIndex);
|
|
485
|
+
this.selectedIndexChange.emit(newIndex);
|
|
467
486
|
this._stateChanged();
|
|
468
487
|
}
|
|
469
488
|
_onKeydown(event) {
|
|
@@ -490,7 +509,7 @@ class CdkStepper {
|
|
|
490
509
|
const isIncomplete = control
|
|
491
510
|
? control.invalid || control.pending || !step.interacted
|
|
492
511
|
: !step.completed;
|
|
493
|
-
return isIncomplete && !step.optional && !step._completedOverride;
|
|
512
|
+
return isIncomplete && !step.optional && !step._completedOverride();
|
|
494
513
|
});
|
|
495
514
|
}
|
|
496
515
|
return false;
|
|
@@ -508,10 +527,10 @@ class CdkStepper {
|
|
|
508
527
|
_isValidIndex(index) {
|
|
509
528
|
return index > -1 && (!this.steps || index < this.steps.length);
|
|
510
529
|
}
|
|
511
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0
|
|
512
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.0.0
|
|
530
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepper, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
531
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "20.0.0", type: CdkStepper, isStandalone: true, selector: "[cdkStepper]", inputs: { linear: ["linear", "linear", booleanAttribute], selectedIndex: ["selectedIndex", "selectedIndex", numberAttribute], selected: "selected", orientation: "orientation" }, outputs: { selectionChange: "selectionChange", selectedIndexChange: "selectedIndexChange" }, queries: [{ propertyName: "_steps", predicate: CdkStep, descendants: true }, { propertyName: "_stepHeader", predicate: CdkStepHeader, descendants: true }], exportAs: ["cdkStepper"], ngImport: i0 });
|
|
513
532
|
}
|
|
514
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0
|
|
533
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepper, decorators: [{
|
|
515
534
|
type: Directive,
|
|
516
535
|
args: [{
|
|
517
536
|
selector: '[cdkStepper]',
|
|
@@ -545,10 +564,10 @@ class CdkStepperNext {
|
|
|
545
564
|
/** Type of the next button. Defaults to "submit" if not specified. */
|
|
546
565
|
type = 'submit';
|
|
547
566
|
constructor() { }
|
|
548
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0
|
|
549
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0
|
|
567
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepperNext, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
568
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: CdkStepperNext, isStandalone: true, selector: "button[cdkStepperNext]", inputs: { type: "type" }, host: { listeners: { "click": "_stepper.next()" }, properties: { "type": "type" } }, ngImport: i0 });
|
|
550
569
|
}
|
|
551
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0
|
|
570
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepperNext, decorators: [{
|
|
552
571
|
type: Directive,
|
|
553
572
|
args: [{
|
|
554
573
|
selector: 'button[cdkStepperNext]',
|
|
@@ -566,10 +585,10 @@ class CdkStepperPrevious {
|
|
|
566
585
|
/** Type of the previous button. Defaults to "button" if not specified. */
|
|
567
586
|
type = 'button';
|
|
568
587
|
constructor() { }
|
|
569
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0
|
|
570
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0
|
|
588
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepperPrevious, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
589
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.0", type: CdkStepperPrevious, isStandalone: true, selector: "button[cdkStepperPrevious]", inputs: { type: "type" }, host: { listeners: { "click": "_stepper.previous()" }, properties: { "type": "type" } }, ngImport: i0 });
|
|
571
590
|
}
|
|
572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0
|
|
591
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepperPrevious, decorators: [{
|
|
573
592
|
type: Directive,
|
|
574
593
|
args: [{
|
|
575
594
|
selector: 'button[cdkStepperPrevious]',
|
|
@@ -583,17 +602,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-rc.0", ng
|
|
|
583
602
|
}] } });
|
|
584
603
|
|
|
585
604
|
class CdkStepperModule {
|
|
586
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0
|
|
587
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0
|
|
605
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
606
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.0", ngImport: i0, type: CdkStepperModule, imports: [BidiModule,
|
|
588
607
|
CdkStep,
|
|
589
608
|
CdkStepper,
|
|
590
609
|
CdkStepHeader,
|
|
591
610
|
CdkStepLabel,
|
|
592
611
|
CdkStepperNext,
|
|
593
612
|
CdkStepperPrevious], exports: [CdkStep, CdkStepper, CdkStepHeader, CdkStepLabel, CdkStepperNext, CdkStepperPrevious] });
|
|
594
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0
|
|
613
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepperModule, imports: [BidiModule] });
|
|
595
614
|
}
|
|
596
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0
|
|
615
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: CdkStepperModule, decorators: [{
|
|
597
616
|
type: NgModule,
|
|
598
617
|
args: [{
|
|
599
618
|
imports: [
|