1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | import { __assign, __extends } from "tslib";
|
24 | import { MDCFoundation } from '@material/base/foundation';
|
25 | import { cssClasses, strings } from './constants';
|
26 | var MDCFormFieldFoundation = (function (_super) {
|
27 | __extends(MDCFormFieldFoundation, _super);
|
28 | function MDCFormFieldFoundation(adapter) {
|
29 | var _this = _super.call(this, __assign(__assign({}, MDCFormFieldFoundation.defaultAdapter), adapter)) || this;
|
30 | _this.click = function () {
|
31 | _this.handleClick();
|
32 | };
|
33 | return _this;
|
34 | }
|
35 | Object.defineProperty(MDCFormFieldFoundation, "cssClasses", {
|
36 | get: function () {
|
37 | return cssClasses;
|
38 | },
|
39 | enumerable: false,
|
40 | configurable: true
|
41 | });
|
42 | Object.defineProperty(MDCFormFieldFoundation, "strings", {
|
43 | get: function () {
|
44 | return strings;
|
45 | },
|
46 | enumerable: false,
|
47 | configurable: true
|
48 | });
|
49 | Object.defineProperty(MDCFormFieldFoundation, "defaultAdapter", {
|
50 | get: function () {
|
51 | return {
|
52 | activateInputRipple: function () { return undefined; },
|
53 | deactivateInputRipple: function () { return undefined; },
|
54 | deregisterInteractionHandler: function () { return undefined; },
|
55 | registerInteractionHandler: function () { return undefined; },
|
56 | };
|
57 | },
|
58 | enumerable: false,
|
59 | configurable: true
|
60 | });
|
61 | MDCFormFieldFoundation.prototype.init = function () {
|
62 | this.adapter.registerInteractionHandler('click', this.click);
|
63 | };
|
64 | MDCFormFieldFoundation.prototype.destroy = function () {
|
65 | this.adapter.deregisterInteractionHandler('click', this.click);
|
66 | };
|
67 | MDCFormFieldFoundation.prototype.handleClick = function () {
|
68 | var _this = this;
|
69 | this.adapter.activateInputRipple();
|
70 | requestAnimationFrame(function () {
|
71 | _this.adapter.deactivateInputRipple();
|
72 | });
|
73 | };
|
74 | return MDCFormFieldFoundation;
|
75 | }(MDCFoundation));
|
76 | export { MDCFormFieldFoundation };
|
77 |
|
78 | export default MDCFormFieldFoundation;
|
79 |
|
\ | No newline at end of file |