source: trip-planner-front/node_modules/@angular/cdk/esm2015/table/can-stick.js@ 59329aa

Last change on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 5.9 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { coerceBooleanProperty } from '@angular/cdk/coercion';
9/**
10 * Mixin to provide a directive with a function that checks if the sticky input has been
11 * changed since the last time the function was called. Essentially adds a dirty-check to the
12 * sticky value.
13 * @docs-private
14 */
15export function mixinHasStickyInput(base) {
16 return class extends base {
17 constructor(...args) {
18 super(...args);
19 this._sticky = false;
20 /** Whether the sticky input has changed since it was last checked. */
21 this._hasStickyChanged = false;
22 }
23 /** Whether sticky positioning should be applied. */
24 get sticky() { return this._sticky; }
25 set sticky(v) {
26 const prevValue = this._sticky;
27 this._sticky = coerceBooleanProperty(v);
28 this._hasStickyChanged = prevValue !== this._sticky;
29 }
30 /** Whether the sticky value has changed since this was last called. */
31 hasStickyChanged() {
32 const hasStickyChanged = this._hasStickyChanged;
33 this._hasStickyChanged = false;
34 return hasStickyChanged;
35 }
36 /** Resets the dirty check for cases where the sticky state has been used without checking. */
37 resetStickyChanged() {
38 this._hasStickyChanged = false;
39 }
40 };
41}
42//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FuLXN0aWNrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2Nkay90YWJsZS9jYW4tc3RpY2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLHFCQUFxQixFQUFDLE1BQU0sdUJBQXVCLENBQUM7QUE0QjVEOzs7OztHQUtHO0FBQ0gsTUFBTSxVQUFVLG1CQUFtQixDQUE0QixJ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