foundation.js 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. * @license
  3. * Copyright 2016 Google Inc.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6. * of this software and associated documentation files (the "Software"), to deal
  7. * in the Software without restriction, including without limitation the rights
  8. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the Software is
  10. * furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in
  13. * all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. * THE SOFTWARE.
  22. */
  23. /** MDC Foundation */
  24. var MDCFoundation = /** @class */ (function () {
  25. function MDCFoundation(adapter) {
  26. if (adapter === void 0) { adapter = {}; }
  27. this.adapter = adapter;
  28. }
  29. Object.defineProperty(MDCFoundation, "cssClasses", {
  30. get: function () {
  31. // Classes extending MDCFoundation should implement this method to return an
  32. // object which exports every CSS class the foundation class needs as a
  33. // property. e.g. {ACTIVE: 'mdc-component--active'}
  34. return {};
  35. },
  36. enumerable: false,
  37. configurable: true
  38. });
  39. Object.defineProperty(MDCFoundation, "strings", {
  40. get: function () {
  41. // Classes extending MDCFoundation should implement this method to return an
  42. // object which exports all semantic strings as constants. e.g. {ARIA_ROLE:
  43. // 'tablist'}
  44. return {};
  45. },
  46. enumerable: false,
  47. configurable: true
  48. });
  49. Object.defineProperty(MDCFoundation, "numbers", {
  50. get: function () {
  51. // Classes extending MDCFoundation should implement this method to return an
  52. // object which exports all of its semantic numbers as constants.
  53. // e.g. {ANIMATION_DELAY_MS: 350}
  54. return {};
  55. },
  56. enumerable: false,
  57. configurable: true
  58. });
  59. Object.defineProperty(MDCFoundation, "defaultAdapter", {
  60. get: function () {
  61. // Classes extending MDCFoundation may choose to implement this getter in
  62. // order to provide a convenient way of viewing the necessary methods of an
  63. // adapter. In the future, this could also be used for adapter validation.
  64. return {};
  65. },
  66. enumerable: false,
  67. configurable: true
  68. });
  69. MDCFoundation.prototype.init = function () {
  70. // Subclasses should override this method to perform initialization routines
  71. // (registering events, etc.)
  72. };
  73. MDCFoundation.prototype.destroy = function () {
  74. // Subclasses should override this method to perform de-initialization
  75. // routines (de-registering events, etc.)
  76. };
  77. return MDCFoundation;
  78. }());
  79. export { MDCFoundation };
  80. // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
  81. export default MDCFoundation;
  82. //# sourceMappingURL=foundation.js.map