foundation.js 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /**
  2. * @license
  3. * Copyright 2018 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. import { __assign, __extends } from "tslib";
  24. import { MDCFoundation } from '@material/base/foundation';
  25. import { cssClasses, numbers, strings } from './constants';
  26. /** MDC Top App Bar Base Foundation */
  27. var MDCTopAppBarBaseFoundation = /** @class */ (function (_super) {
  28. __extends(MDCTopAppBarBaseFoundation, _super);
  29. /* istanbul ignore next: optional argument is not a branch statement */
  30. function MDCTopAppBarBaseFoundation(adapter) {
  31. return _super.call(this, __assign(__assign({}, MDCTopAppBarBaseFoundation.defaultAdapter), adapter)) || this;
  32. }
  33. Object.defineProperty(MDCTopAppBarBaseFoundation, "strings", {
  34. get: function () {
  35. return strings;
  36. },
  37. enumerable: false,
  38. configurable: true
  39. });
  40. Object.defineProperty(MDCTopAppBarBaseFoundation, "cssClasses", {
  41. get: function () {
  42. return cssClasses;
  43. },
  44. enumerable: false,
  45. configurable: true
  46. });
  47. Object.defineProperty(MDCTopAppBarBaseFoundation, "numbers", {
  48. get: function () {
  49. return numbers;
  50. },
  51. enumerable: false,
  52. configurable: true
  53. });
  54. Object.defineProperty(MDCTopAppBarBaseFoundation, "defaultAdapter", {
  55. /**
  56. * See {@link MDCTopAppBarAdapter} for typing information on parameters and
  57. * return types.
  58. */
  59. get: function () {
  60. // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
  61. return {
  62. addClass: function () { return undefined; },
  63. removeClass: function () { return undefined; },
  64. hasClass: function () { return false; },
  65. setStyle: function () { return undefined; },
  66. getTopAppBarHeight: function () { return 0; },
  67. notifyNavigationIconClicked: function () { return undefined; },
  68. getViewportScrollY: function () { return 0; },
  69. getTotalActionItems: function () { return 0; },
  70. };
  71. // tslint:enable:object-literal-sort-keys
  72. },
  73. enumerable: false,
  74. configurable: true
  75. });
  76. /** Other variants of TopAppBar foundation overrides this method */
  77. MDCTopAppBarBaseFoundation.prototype.handleTargetScroll = function () { }; // tslint:disable-line:no-empty
  78. /** Other variants of TopAppBar foundation overrides this method */
  79. MDCTopAppBarBaseFoundation.prototype.handleWindowResize = function () { }; // tslint:disable-line:no-empty
  80. MDCTopAppBarBaseFoundation.prototype.handleNavigationClick = function () {
  81. this.adapter.notifyNavigationIconClicked();
  82. };
  83. return MDCTopAppBarBaseFoundation;
  84. }(MDCFoundation));
  85. export { MDCTopAppBarBaseFoundation };
  86. // tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
  87. export default MDCTopAppBarBaseFoundation;
  88. //# sourceMappingURL=foundation.js.map