6
6
* found in the LICENSE file at https://angular.dev/license
7
7
*/
8
8
9
- import { BooleanInput , coerceBooleanProperty } from '@angular/cdk/coercion' ;
10
-
11
- /** @docs -private */
12
- export type Constructor < T > = new ( ...args : any [ ] ) => T ;
13
-
14
9
/**
15
10
* Interface for a mixin to provide a directive with a function that checks if the sticky input has
16
11
* been changed since the last time the function was called. Essentially adds a dirty-check to the
@@ -27,48 +22,3 @@ export interface CanStick {
27
22
/** Resets the dirty check for cases where the sticky state has been used without checking. */
28
23
resetStickyChanged ( ) : void ;
29
24
}
30
-
31
- /** @docs -private */
32
- export type CanStickCtor = Constructor < CanStick > ;
33
-
34
- /**
35
- * Mixin to provide a directive with a function that checks if the sticky input has been
36
- * changed since the last time the function was called. Essentially adds a dirty-check to the
37
- * sticky value.
38
- * @docs -private
39
- * @deprecated Implement the `CanStick` interface instead.
40
- * @breaking -change 19.0.0
41
- */
42
- export function mixinHasStickyInput < T extends Constructor < { } > > ( base : T ) : CanStickCtor & T {
43
- return class extends base {
44
- /** Whether sticky positioning should be applied. */
45
- get sticky ( ) : boolean {
46
- return this . _sticky ;
47
- }
48
- set sticky ( v : BooleanInput ) {
49
- const prevValue = this . _sticky ;
50
- this . _sticky = coerceBooleanProperty ( v ) ;
51
- this . _hasStickyChanged = prevValue !== this . _sticky ;
52
- }
53
- _sticky : boolean = false ;
54
-
55
- /** Whether the sticky input has changed since it was last checked. */
56
- _hasStickyChanged : boolean = false ;
57
-
58
- /** Whether the sticky value has changed since this was last called. */
59
- hasStickyChanged ( ) : boolean {
60
- const hasStickyChanged = this . _hasStickyChanged ;
61
- this . _hasStickyChanged = false ;
62
- return hasStickyChanged ;
63
- }
64
-
65
- /** Resets the dirty check for cases where the sticky state has been used without checking. */
66
- resetStickyChanged ( ) {
67
- this . _hasStickyChanged = false ;
68
- }
69
-
70
- constructor ( ...args : any [ ] ) {
71
- super ( ...args ) ;
72
- }
73
- } ;
74
- }
0 commit comments