@angular/cdk 21.1.0-next.2 → 21.1.0-next.3
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/fesm2022/_a11y-module-chunk.mjs +7 -9
- package/fesm2022/_a11y-module-chunk.mjs.map +1 -1
- package/fesm2022/_focus-monitor-chunk.mjs +2 -4
- package/fesm2022/_focus-monitor-chunk.mjs.map +1 -1
- package/fesm2022/_list-key-manager-chunk.mjs +1 -1
- package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_overlay-module-chunk.mjs +13 -13
- package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
- package/fesm2022/_selection-model-chunk.mjs +1 -1
- package/fesm2022/_selection-model-chunk.mjs.map +1 -1
- package/fesm2022/bidi.mjs +1 -1
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +1 -1
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/dialog.mjs +2 -2
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +17 -17
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/listbox.mjs +1 -1
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +6 -9
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/portal.mjs +4 -4
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +8 -5
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +3 -3
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/testing-testbed.mjs +7 -1
- package/fesm2022/testing-testbed.mjs.map +1 -1
- package/fesm2022/testing.mjs +10 -13
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/text-field.mjs +1 -1
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs +8 -12
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/types/_harness-environment-chunk.d.ts +0 -2
- package/types/_overlay-module-chunk.d.ts +1 -1
- package/types/menu.d.ts +1 -3
- package/types/testing-testbed.d.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_selection-model-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/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":["SelectionModel","_multiple","_emitChanges","compareWith","_selection","Set","_deselectedToEmit","_selectedToEmit","_selected","selected","Array","from","values","changed","Subject","constructor","initiallySelectedValues","length","forEach","value","_markSelected","select","_verifyValueAssignment","_hasQueuedChanges","_emitChangeEvent","deselect","_unmarkSelected","setSelection","oldValues","newSelectedSet","map","_getConcreteValue","filter","has","toggle","isSelected","clear","flushEvent","_unmarkAll","isEmpty","size","hasValue","sort","predicate","isMultipleSelection","next","source","added","removed","add","push","delete","ngDevMode","getMultipleValuesInSingleSelectionError","inputValue","selection","selectedValue","Error"],"mappings":";;MAaaA,cAAc,CAAA;EA0BfC,SAAA;EAEAC,YAAA;EACDC,WAAA;AA3BDC,EAAAA,UAAU,GAAG,IAAIC,GAAG,EAAK;AAGzBC,EAAAA,iBAAiB,GAAQ,EAAE;AAG3BC,EAAAA,eAAe,GAAQ,EAAE;EAGzBC,SAAS;EAGjB,IAAIC,QAAQA,GAAA;AACV,IAAA,IAAI,CAAC,IAAI,CAACD,SAAS,EAAE;AACnB,MAAA,IAAI,CAACA,SAAS,GAAGE,KAAK,CAACC,IAAI,CAAC,IAAI,CAACP,UAAU,CAACQ,MAAM,EAAE,CAAC;AACvD;IAEA,OAAO,IAAI,CAACJ,SAAS;AACvB;AAGSK,EAAAA,OAAO,GAAG,IAAIC,OAAO,EAAsB;AAEpDC,EAAAA,WACUA,CAAAd,SAAA,GAAY,KAAK,EACzBe,uBAA6B,EACrBd,YAAe,GAAA,IAAI,EACpBC,WAAuC,EAAA;IAHtC,IAAS,CAAAF,SAAA,GAATA,SAAS;IAET,IAAY,CAAAC,YAAA,GAAZA,Y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BeD,uCAAuCA,GAAA;EACrD,OAAOI,KAAK,CAAC,yEAAyE,CAAC;AACzF;;;;"}
|
|
1
|
+
{"version":3,"file":"_selection-model-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/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 = 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":["SelectionModel","_multiple","_emitChanges","compareWith","_selection","Set","_deselectedToEmit","_selectedToEmit","_selected","selected","Array","from","values","changed","Subject","constructor","initiallySelectedValues","length","forEach","value","_markSelected","select","_verifyValueAssignment","_hasQueuedChanges","_emitChangeEvent","deselect","_unmarkSelected","setSelection","oldValues","newSelectedSet","map","_getConcreteValue","filter","has","toggle","isSelected","clear","flushEvent","_unmarkAll","isEmpty","size","hasValue","sort","predicate","isMultipleSelection","next","source","added","removed","add","push","delete","ngDevMode","getMultipleValuesInSingleSelectionError","inputValue","selection","selectedValue","Error"],"mappings":";;MAaaA,cAAc,CAAA;EA0BfC,SAAA;EAEAC,YAAA;EACDC,WAAA;AA3BDC,EAAAA,UAAU,GAAG,IAAIC,GAAG,EAAK;AAGzBC,EAAAA,iBAAiB,GAAQ,EAAE;AAG3BC,EAAAA,eAAe,GAAQ,EAAE;AAGzBC,EAAAA,SAAS,GAAe,IAAI;EAGpC,IAAIC,QAAQA,GAAA;AACV,IAAA,IAAI,CAAC,IAAI,CAACD,SAAS,EAAE;AACnB,MAAA,IAAI,CAACA,SAAS,GAAGE,KAAK,CAACC,IAAI,CAAC,IAAI,CAACP,UAAU,CAACQ,MAAM,EAAE,CAAC;AACvD;IAEA,OAAO,IAAI,CAACJ,SAAS;AACvB;AAGSK,EAAAA,OAAO,GAAG,IAAIC,OAAO,EAAsB;AAEpDC,EAAAA,WACUA,CAAAd,SAAA,GAAY,KAAK,EACzBe,uBAA6B,EACrBd,YAAe,GAAA,IAAI,EACpBC,WAAuC,EAAA;IAHtC,IAAS,CAAAF,SAAA,GAATA,SAAS;IAET,IAAY,CAAAC,YAAA,GAAZA,YAAY;IACb,IAAW,CAAAC,WAAA,GAAXA,WAAW;AAElB,IAAA,IAAIa,uBAAuB,IAAIA,uBAAuB,CAACC,MAAM,EAAE;AAC7D,MAAA,IAAIhB,SAAS,EAAE;QACbe,uBAAuB,CAACE,O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
-
{"version":3,"file":"bidi.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/bidi/dir.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/bidi/bidi-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n AfterContentInit,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n signal,\n} from '@angular/core';\n\nimport {Direction, Directionality, _resolveDirectionality} from './directionality';\n\n/**\n * Directive to listen for changes of direction of part of the DOM.\n *\n * Provides itself as Directionality such that descendant directives only need to ever inject\n * Directionality to get the closest direction.\n */\n@Directive({\n selector: '[dir]',\n providers: [{provide: Directionality, useExisting: Dir}],\n host: {'[attr.dir]': '_rawDir'},\n exportAs: 'dir',\n})\nexport class Dir implements Directionality, AfterContentInit, OnDestroy {\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Direction as passed in by the consumer. */\n _rawDir: string;\n\n /** Event emitted when the direction changes. */\n @Output('dirChange') readonly change = new EventEmitter<Direction>();\n\n /** @docs-private */\n @Input()\n get dir(): Direction {\n return this.valueSignal();\n }\n set dir(value: Direction | 'auto') {\n const previousValue = this.valueSignal();\n\n // Note: `_resolveDirectionality` resolves the language based on the browser's language,\n // whereas the browser does it based on the content of the element. Since doing so based\n // on the content can be expensive, for now we're doing the simpler matching.\n this.valueSignal.set(_resolveDirectionality(value));\n this._rawDir = value;\n\n if (previousValue !== this.valueSignal() && this._isInitialized) {\n this.change.emit(this.valueSignal());\n }\n }\n\n /** Current layout direction of the element. */\n get value(): Direction {\n return this.dir;\n }\n\n readonly valueSignal = signal<Direction>('ltr');\n\n /** Initialize once default value has been set. */\n ngAfterContentInit() {\n this._isInitialized = true;\n }\n\n ngOnDestroy() {\n this.change.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {Dir} from './dir';\n\n@NgModule({\n imports: [Dir],\n exports: [Dir],\n})\nexport class BidiModule {}\n"],"names":["Dir","_isInitialized","_rawDir","change","EventEmitter","dir","valueSignal","value","previousValue","set","_resolveDirectionality","emit","signal","ngAfterContentInit","ngOnDestroy","complete","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","outputs","host","properties","providers","provide","Directionality","useExisting","exportAs","ngImport","decorators","args","Output","Input","BidiModule","NgModule","imports","exports"],"mappings":";;;;;MAgCaA,GAAG,CAAA;AAENC,EAAAA,cAAc,GAAY,KAAK;
|
|
1
|
+
{"version":3,"file":"bidi.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/bidi/dir.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/bidi/bidi-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n AfterContentInit,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n signal,\n} from '@angular/core';\n\nimport {Direction, Directionality, _resolveDirectionality} from './directionality';\n\n/**\n * Directive to listen for changes of direction of part of the DOM.\n *\n * Provides itself as Directionality such that descendant directives only need to ever inject\n * Directionality to get the closest direction.\n */\n@Directive({\n selector: '[dir]',\n providers: [{provide: Directionality, useExisting: Dir}],\n host: {'[attr.dir]': '_rawDir'},\n exportAs: 'dir',\n})\nexport class Dir implements Directionality, AfterContentInit, OnDestroy {\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Direction as passed in by the consumer. */\n _rawDir: string = '';\n\n /** Event emitted when the direction changes. */\n @Output('dirChange') readonly change = new EventEmitter<Direction>();\n\n /** @docs-private */\n @Input()\n get dir(): Direction {\n return this.valueSignal();\n }\n set dir(value: Direction | 'auto') {\n const previousValue = this.valueSignal();\n\n // Note: `_resolveDirectionality` resolves the language based on the browser's language,\n // whereas the browser does it based on the content of the element. Since doing so based\n // on the content can be expensive, for now we're doing the simpler matching.\n this.valueSignal.set(_resolveDirectionality(value));\n this._rawDir = value;\n\n if (previousValue !== this.valueSignal() && this._isInitialized) {\n this.change.emit(this.valueSignal());\n }\n }\n\n /** Current layout direction of the element. */\n get value(): Direction {\n return this.dir;\n }\n\n readonly valueSignal = signal<Direction>('ltr');\n\n /** Initialize once default value has been set. */\n ngAfterContentInit() {\n this._isInitialized = true;\n }\n\n ngOnDestroy() {\n this.change.complete();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {Dir} from './dir';\n\n@NgModule({\n imports: [Dir],\n exports: [Dir],\n})\nexport class BidiModule {}\n"],"names":["Dir","_isInitialized","_rawDir","change","EventEmitter","dir","valueSignal","value","previousValue","set","_resolveDirectionality","emit","signal","ngAfterContentInit","ngOnDestroy","complete","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","outputs","host","properties","providers","provide","Directionality","useExisting","exportAs","ngImport","decorators","args","Output","Input","BidiModule","NgModule","imports","exports"],"mappings":";;;;;MAgCaA,GAAG,CAAA;AAENC,EAAAA,cAAc,GAAY,KAAK;AAGvCC,EAAAA,OAAO,GAAW,EAAE;AAGUC,EAAAA,MAAM,GAAG,IAAIC,YAAY,EAAa;EAGpE,IACIC,GAAGA,GAAA;AACL,IAAA,OAAO,IAAI,CAACC,WAAW,EAAE;AAC3B;EACA,IAAID,GAAGA,CAACE,KAAyB,EAAA;AAC/B,IAAA,MAAMC,aAAa,GAAG,IAAI,CAACF,WAAW,EAAE;IAKxC,IAAI,CAACA,WAAW,CAACG,GAAG,C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,QAAQ,EAAE,OAAO;AACjBK,MAAAA,SAAS,EAAE,CAAC;AAACC,QAAAA,OAAO,EAAEC,cAAc;AAAEC,QAAAA,WAAW,EAAK9B;AAAA,OAAC,CAAC;AACxDyB,MAAAA,IAAI,EAAE;AAAC,QAAA,YAAY,EAAE;OAAU;AAC/BM,MAAAA,QAAQ,EAAE;KACX;;;;YASEI,MAAM;aAAC,WAAW;;;YAGlBC;;;;;MC5BUC,UAAU,CAAA;;;;;UAAVA,UAAU;AAAArB,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAmB;AAAA,GAAA,CAAA;;;;;UAAVD,UAAU;IAAAE,OAAA,EAAA,CAHXvC,GAAG,CAAA;IAAAwC,OAAA,EAAA,CACHxC,GAAG;AAAA,GAAA,CAAA;;;;;UAEFqC;AAAU,GAAA,CAAA;;;;;;QAAVA,UAAU;AAAAJ,EAAAA,UAAA,EAAA,CAAA;UAJtBK,QAAQ;AAACJ,IAAAA,IAAA,EAAA,CAAA;MACRK,OAAO,EAAE,CAACvC,GAAG,CAAC;MACdwC,OAAO,EAAE,CAACxC,GAAG;KACd;;;;;;"}
|
package/fesm2022/cdk.mjs
CHANGED
package/fesm2022/cdk.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/version.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 {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('21.1.0-next.
|
|
1
|
+
{"version":3,"file":"cdk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/version.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 {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('21.1.0-next.3');\n"],"names":["VERSION","Version"],"mappings":";;MAWaA,OAAO,GAAG,IAAIC,OAAO,CAAC,mBAAmB;;;;"}
|
package/fesm2022/clipboard.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboard.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/clipboard/pending-copy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/clipboard/clipboard.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/clipboard/copy-to-clipboard.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/clipboard/clipboard-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * A pending copy-to-clipboard operation.\n *\n * The implementation of copying text to the clipboard modifies the DOM and\n * forces a re-layout. This re-layout can take too long if the string is large,\n * causing the execCommand('copy') to happen too long after the user clicked.\n * This results in the browser refusing to copy. This object lets the\n * re-layout happen in a separate tick from copying by providing a copy function\n * that can be called later.\n *\n * Destroy must be called when no longer in use, regardless of whether `copy` is\n * called.\n */\nexport class PendingCopy {\n private _textarea: HTMLTextAreaElement | undefined;\n\n constructor(\n text: string,\n private readonly _document: Document,\n ) {\n const textarea = (this._textarea = this._document.createElement('textarea'));\n const styles = textarea.style;\n\n // Hide the element for display and accessibility. Set a fixed position so the page layout\n // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea\n // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.\n styles.position = 'fixed';\n styles.top = styles.opacity = '0';\n styles.left = '-999em';\n textarea.setAttribute('aria-hidden', 'true');\n textarea.value = text;\n // Making the textarea `readonly` prevents the screen from jumping on iOS Safari (see #25169).\n textarea.readOnly = true;\n // The element needs to be inserted into the fullscreen container, if the page\n // is in fullscreen mode, otherwise the browser won't execute the copy command.\n (this._document.fullscreenElement || this._document.body).appendChild(textarea);\n }\n\n /** Finishes copying the text. */\n copy(): boolean {\n const textarea = this._textarea;\n let successful = false;\n\n try {\n // Older browsers could throw if copy is not supported.\n if (textarea) {\n const currentFocus = this._document.activeElement as HTMLOrSVGElement | null;\n\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n\n if (currentFocus) {\n currentFocus.focus();\n }\n }\n } catch {\n // Discard error.\n // Initial setting of {@code successful} will represent failure here.\n }\n\n return successful;\n }\n\n /** Cleans up DOM changes used to perform the copy operation. */\n destroy() {\n const textarea = this._textarea;\n\n if (textarea) {\n textarea.remove();\n this._textarea = undefined;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, inject, DOCUMENT} from '@angular/core';\nimport {PendingCopy} from './pending-copy';\n\n/**\n * A service for copying text to the clipboard.\n */\n@Injectable({providedIn: 'root'})\nexport class Clipboard {\n private readonly _document = inject(DOCUMENT);\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /**\n * Copies the provided text into the user's clipboard.\n *\n * @param text The string to copy.\n * @returns Whether the operation was successful.\n */\n copy(text: string): boolean {\n const pendingCopy = this.beginCopy(text);\n const successful = pendingCopy.copy();\n pendingCopy.destroy();\n\n return successful;\n }\n\n /**\n * Prepares a string to be copied later. This is useful for large strings\n * which take too long to successfully render and be copied in the same tick.\n *\n * The caller must call `destroy` on the returned `PendingCopy`.\n *\n * @param text The string to copy.\n * @returns the pending copy operation.\n */\n beginCopy(text: string): PendingCopy {\n return new PendingCopy(text, this._document);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Directive,\n EventEmitter,\n Input,\n Output,\n NgZone,\n InjectionToken,\n OnDestroy,\n inject,\n} from '@angular/core';\nimport {Clipboard} from './clipboard';\nimport {PendingCopy} from './pending-copy';\n\n/** Object that can be used to configure the default options for `CdkCopyToClipboard`. */\nexport interface CdkCopyToClipboardConfig {\n /** Default number of attempts to make when copying text to the clipboard. */\n attempts?: number;\n}\n\n/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */\nexport const CDK_COPY_TO_CLIPBOARD_CONFIG = new InjectionToken<CdkCopyToClipboardConfig>(\n 'CDK_COPY_TO_CLIPBOARD_CONFIG',\n);\n\n/**\n * Provides behavior for a button that when clicked copies content into user's\n * clipboard.\n */\n@Directive({\n selector: '[cdkCopyToClipboard]',\n host: {\n '(click)': 'copy()',\n },\n})\nexport class CdkCopyToClipboard implements OnDestroy {\n private _clipboard = inject(Clipboard);\n private _ngZone = inject(NgZone);\n\n /** Content to be copied. */\n @Input('cdkCopyToClipboard') text: string = '';\n\n /**\n * How many times to attempt to copy the text. This may be necessary for longer text, because\n * the browser needs time to fill an intermediate textarea element and copy the content.\n */\n @Input('cdkCopyToClipboardAttempts') attempts: number = 1;\n\n /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n */\n @Output('cdkCopyToClipboardCopied') readonly copied = new EventEmitter<boolean>();\n\n /** Copies that are currently being attempted. */\n private _pending = new Set<PendingCopy>();\n\n /** Whether the directive has been destroyed. */\n private _destroyed: boolean;\n\n /** Timeout for the current copy attempt. */\n private _currentTimeout: any;\n\n constructor(...args: unknown[]);\n\n constructor() {\n const config = inject(CDK_COPY_TO_CLIPBOARD_CONFIG, {optional: true});\n\n if (config && config.attempts != null) {\n this.attempts = config.attempts;\n }\n }\n\n /** Copies the current text to the clipboard. */\n copy(attempts: number = this.attempts): void {\n if (attempts > 1) {\n let remainingAttempts = attempts;\n const pending = this._clipboard.beginCopy(this.text);\n this._pending.add(pending);\n\n const attempt = () => {\n const successful = pending.copy();\n if (!successful && --remainingAttempts && !this._destroyed) {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));\n } else {\n this._currentTimeout = null;\n this._pending.delete(pending);\n pending.destroy();\n this.copied.emit(successful);\n }\n };\n attempt();\n } else {\n this.copied.emit(this._clipboard.copy(this.text));\n }\n }\n\n ngOnDestroy() {\n if (this._currentTimeout) {\n clearTimeout(this._currentTimeout);\n }\n\n this._pending.forEach(copy => copy.destroy());\n this._pending.clear();\n this._destroyed = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\n\nimport {CdkCopyToClipboard} from './copy-to-clipboard';\n\n@NgModule({\n imports: [CdkCopyToClipboard],\n exports: [CdkCopyToClipboard],\n})\nexport class ClipboardModule {}\n"],"names":["PendingCopy","_document","_textarea","constructor","text","textarea","createElement","styles","style","position","top","opacity","left","setAttribute","value","readOnly","fullscreenElement","body","appendChild","copy","successful","currentFocus","activeElement","select","setSelectionRange","length","execCommand","focus","destroy","remove","undefined","Clipboard","inject","DOCUMENT","pendingCopy","beginCopy","deps","target","i0","ɵɵFactoryTarget","Injectable","ɵprov","ɵɵngDeclareInjectable","minVersion","version","ngImport","type","decorators","providedIn","CDK_COPY_TO_CLIPBOARD_CONFIG","InjectionToken","CdkCopyToClipboard","_clipboard","_ngZone","NgZone","attempts","copied","EventEmitter","_pending","Set","_destroyed","_currentTimeout","config","optional","remainingAttempts","pending","add","attempt","runOutsideAngular","setTimeout","delete","emit","ngOnDestroy","clearTimeout","forEach","clear","Directive","isStandalone","selector","inputs","outputs","host","listeners","args","Input","Output","ClipboardModule","NgModule","imports","exports"],"mappings":";;;MAq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O,IAAAA,IAAA,EAAA,CAAA;AACTL,MAAAA,QAAQ,EAAE,sBAAsB;AAChCG,MAAAA,IAAI,EAAE;AACJ,QAAA,SAAS,EAAE;AACZ;KACF;;;;;YAMEG,KAAK;aAAC,oBAAoB;;;YAM1BA,KAAK;aAAC,4BAA4B;;;YAMlCC,MAAM;aAAC,0BAA0B;;;;;MC3CvBC,eAAe,CAAA;;;;;UAAfA,eAAe;AAAAlD,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAgD;AAAA,GAAA,CAAA;;;;;UAAfD,eAAe;IAAAE,OAAA,EAAA,CAHhBrC,kBAAkB,CAAA;IAAAsC,OAAA,EAAA,CAClBtC,kBAAkB;AAAA,GAAA,CAAA;;;;;UAEjBmC;AAAe,GAAA,CAAA;;;;;;QAAfA,eAAe;AAAAvC,EAAAA,UAAA,EAAA,CAAA;UAJ3BwC,QAAQ;AAACJ,IAAAA,IAAA,EAAA,CAAA;MACRK,OAAO,EAAE,CAACrC,kBAAkB,CAAC;MAC7BsC,OAAO,EAAE,CAACtC,kBAAkB;KAC7B;;;;;;"}
|
|
1
|
+
{"version":3,"file":"clipboard.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/clipboard/pending-copy.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/clipboard/clipboard.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/clipboard/copy-to-clipboard.ts","../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk/clipboard/clipboard-module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * A pending copy-to-clipboard operation.\n *\n * The implementation of copying text to the clipboard modifies the DOM and\n * forces a re-layout. This re-layout can take too long if the string is large,\n * causing the execCommand('copy') to happen too long after the user clicked.\n * This results in the browser refusing to copy. This object lets the\n * re-layout happen in a separate tick from copying by providing a copy function\n * that can be called later.\n *\n * Destroy must be called when no longer in use, regardless of whether `copy` is\n * called.\n */\nexport class PendingCopy {\n private _textarea: HTMLTextAreaElement | undefined;\n\n constructor(\n text: string,\n private readonly _document: Document,\n ) {\n const textarea = (this._textarea = this._document.createElement('textarea'));\n const styles = textarea.style;\n\n // Hide the element for display and accessibility. Set a fixed position so the page layout\n // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea\n // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.\n styles.position = 'fixed';\n styles.top = styles.opacity = '0';\n styles.left = '-999em';\n textarea.setAttribute('aria-hidden', 'true');\n textarea.value = text;\n // Making the textarea `readonly` prevents the screen from jumping on iOS Safari (see #25169).\n textarea.readOnly = true;\n // The element needs to be inserted into the fullscreen container, if the page\n // is in fullscreen mode, otherwise the browser won't execute the copy command.\n (this._document.fullscreenElement || this._document.body).appendChild(textarea);\n }\n\n /** Finishes copying the text. */\n copy(): boolean {\n const textarea = this._textarea;\n let successful = false;\n\n try {\n // Older browsers could throw if copy is not supported.\n if (textarea) {\n const currentFocus = this._document.activeElement as HTMLOrSVGElement | null;\n\n textarea.select();\n textarea.setSelectionRange(0, textarea.value.length);\n successful = this._document.execCommand('copy');\n\n if (currentFocus) {\n currentFocus.focus();\n }\n }\n } catch {\n // Discard error.\n // Initial setting of {@code successful} will represent failure here.\n }\n\n return successful;\n }\n\n /** Cleans up DOM changes used to perform the copy operation. */\n destroy() {\n const textarea = this._textarea;\n\n if (textarea) {\n textarea.remove();\n this._textarea = undefined;\n }\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injectable, inject, DOCUMENT} from '@angular/core';\nimport {PendingCopy} from './pending-copy';\n\n/**\n * A service for copying text to the clipboard.\n */\n@Injectable({providedIn: 'root'})\nexport class Clipboard {\n private readonly _document = inject(DOCUMENT);\n\n constructor(...args: unknown[]);\n constructor() {}\n\n /**\n * Copies the provided text into the user's clipboard.\n *\n * @param text The string to copy.\n * @returns Whether the operation was successful.\n */\n copy(text: string): boolean {\n const pendingCopy = this.beginCopy(text);\n const successful = pendingCopy.copy();\n pendingCopy.destroy();\n\n return successful;\n }\n\n /**\n * Prepares a string to be copied later. This is useful for large strings\n * which take too long to successfully render and be copied in the same tick.\n *\n * The caller must call `destroy` on the returned `PendingCopy`.\n *\n * @param text The string to copy.\n * @returns the pending copy operation.\n */\n beginCopy(text: string): PendingCopy {\n return new PendingCopy(text, this._document);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n Directive,\n EventEmitter,\n Input,\n Output,\n NgZone,\n InjectionToken,\n OnDestroy,\n inject,\n} from '@angular/core';\nimport {Clipboard} from './clipboard';\nimport {PendingCopy} from './pending-copy';\n\n/** Object that can be used to configure the default options for `CdkCopyToClipboard`. */\nexport interface CdkCopyToClipboardConfig {\n /** Default number of attempts to make when copying text to the clipboard. */\n attempts?: number;\n}\n\n/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */\nexport const CDK_COPY_TO_CLIPBOARD_CONFIG = new InjectionToken<CdkCopyToClipboardConfig>(\n 'CDK_COPY_TO_CLIPBOARD_CONFIG',\n);\n\n/**\n * Provides behavior for a button that when clicked copies content into user's\n * clipboard.\n */\n@Directive({\n selector: '[cdkCopyToClipboard]',\n host: {\n '(click)': 'copy()',\n },\n})\nexport class CdkCopyToClipboard implements OnDestroy {\n private _clipboard = inject(Clipboard);\n private _ngZone = inject(NgZone);\n\n /** Content to be copied. */\n @Input('cdkCopyToClipboard') text: string = '';\n\n /**\n * How many times to attempt to copy the text. This may be necessary for longer text, because\n * the browser needs time to fill an intermediate textarea element and copy the content.\n */\n @Input('cdkCopyToClipboardAttempts') attempts: number = 1;\n\n /**\n * Emits when some text is copied to the clipboard. The\n * emitted value indicates whether copying was successful.\n */\n @Output('cdkCopyToClipboardCopied') readonly copied = new EventEmitter<boolean>();\n\n /** Copies that are currently being attempted. */\n private _pending = new Set<PendingCopy>();\n\n /** Whether the directive has been destroyed. */\n private _destroyed = false;\n\n /** Timeout for the current copy attempt. */\n private _currentTimeout: any;\n\n constructor(...args: unknown[]);\n\n constructor() {\n const config = inject(CDK_COPY_TO_CLIPBOARD_CONFIG, {optional: true});\n\n if (config && config.attempts != null) {\n this.attempts = config.attempts;\n }\n }\n\n /** Copies the current text to the clipboard. */\n copy(attempts: number = this.attempts): void {\n if (attempts > 1) {\n let remainingAttempts = attempts;\n const pending = this._clipboard.beginCopy(this.text);\n this._pending.add(pending);\n\n const attempt = () => {\n const successful = pending.copy();\n if (!successful && --remainingAttempts && !this._destroyed) {\n // We use 1 for the timeout since it's more predictable when flushing in unit tests.\n this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));\n } else {\n this._currentTimeout = null;\n this._pending.delete(pending);\n pending.destroy();\n this.copied.emit(successful);\n }\n };\n attempt();\n } else {\n this.copied.emit(this._clipboard.copy(this.text));\n }\n }\n\n ngOnDestroy() {\n if (this._currentTimeout) {\n clearTimeout(this._currentTimeout);\n }\n\n this._pending.forEach(copy => copy.destroy());\n this._pending.clear();\n this._destroyed = true;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\n\nimport {CdkCopyToClipboard} from './copy-to-clipboard';\n\n@NgModule({\n imports: [CdkCopyToClipboard],\n exports: [CdkCopyToClipboard],\n})\nexport class ClipboardModule {}\n"],"names":["PendingCopy","_document","_textarea","constructor","text","textarea","createElement","styles","style","position","top","opacity","left","setAttribute","value","readOnly","fullscreenElement","body","appendChild","copy","successful","currentFocus","activeElement","select","setSelectionRange","length","execCommand","focus","destroy","remove","undefined","Clipboard","inject","DOCUMENT","pendingCopy","beginCopy","deps","target","i0","ɵɵFactoryTarget","Injectable","ɵprov","ɵɵngDeclareInjectable","minVersion","version","ngImport","type","decorators","providedIn","CDK_COPY_TO_CLIPBOARD_CONFIG","InjectionToken","CdkCopyToClipboard","_clipboard","_ngZone","NgZone","attempts","copied","EventEmitter","_pending","Set","_destroyed","_currentTimeout","config","optional","remainingAttempts","pending","add","attempt","runOutsideAngular","setTimeout","delete","emit","ngOnDestroy","clearTimeout","forEach","clear","Directive","isStandalone","selector","inputs","outputs","host","listeners","args","Input","Output","ClipboardModule","NgModule","imports","exports"],"mappings":";;;MAqBaA,WAAW,CAAA;EAKHC,SAAA;EAJXC,SAAS;AAEjBC,EAAAA,WACEA,CAAAC,IAAY,EACKH,SAAmB,EAAA;IAAnB,IAAS,CAAAA,SAAA,GAATA,SAAS;AAE1B,IAAA,MAAMI,QAAQ,GAAI,IAAI,CAACH,SAAS,GAAG,IAAI,CAACD,SAAS,CAACK,aAAa,CAAC,UAAU,CAAE;AAC5E,IAAA,MAAMC,MAAM,GAAGF,QAAQ,CAACG,KAAK;IAK7BD,MAAM,CAACE,QAAQ,GAAG,OAAO;AACzBF,IAAAA,MAAM,CAACG,GAAG,GAAGH,MAAM,CAACI,OAAO,GAAG,GAAG;IACjCJ,MAAM,CAACK,IAAI,GAAG,QAAQ;AACtBP,IAAAA,QAAQ,CAACQ,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC;IAC5CR,QAAQ,CAACS,KAAK,GAAGV,IAAI;IAErBC,QAAQ,CAACU,QAAQ,GAAG,IAAI;AAGxB,IAAA,CAAC,IAAI,CAACd,SAAS,CAACe,iBAAiB,IAAI,IAAI,CAACf,SAAS,CAACgB,IAAI,EAAEC,WAAW,CAACb,QAAQ,CAAC;AACjF;AAGAc,EAAAA,IAAIA,GAAA;AACF,IAAA,MAAMd,QAAQ,GAAG,IAAI,CAACH,S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