123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = Object.setPrototypeOf ||
  3. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5. return function (d, b) {
  6. extendStatics(d, b);
  7. function __() { this.constructor = d; }
  8. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9. };
  10. })();
  11. import { ContentChildren, Directive, ElementRef, Inject, Optional, Renderer, forwardRef } from '@angular/core';
  12. import { Button } from '../button/button';
  13. import { Config } from '../../config/config';
  14. import { Ion } from '../ion';
  15. import { Navbar } from './navbar';
  16. import { Toolbar } from './toolbar';
  17. /**
  18. * @hidden
  19. */
  20. var ToolbarItem = (function (_super) {
  21. __extends(ToolbarItem, _super);
  22. function ToolbarItem(config, elementRef, renderer, toolbar, navbar) {
  23. var _this = _super.call(this, config, elementRef, renderer, 'bar-buttons') || this;
  24. _this.inToolbar = !!(toolbar || navbar);
  25. return _this;
  26. }
  27. Object.defineProperty(ToolbarItem.prototype, "_buttons", {
  28. set: function (buttons) {
  29. if (this.inToolbar) {
  30. buttons.forEach(function (button) {
  31. button.setRole('bar-button');
  32. });
  33. }
  34. },
  35. enumerable: true,
  36. configurable: true
  37. });
  38. ToolbarItem.decorators = [
  39. { type: Directive, args: [{
  40. selector: 'ion-buttons,[menuToggle]'
  41. },] },
  42. ];
  43. /** @nocollapse */
  44. ToolbarItem.ctorParameters = function () { return [
  45. { type: Config, },
  46. { type: ElementRef, },
  47. { type: Renderer, },
  48. { type: Toolbar, decorators: [{ type: Optional },] },
  49. { type: Navbar, decorators: [{ type: Optional }, { type: Inject, args: [forwardRef(function () { return Navbar; }),] },] },
  50. ]; };
  51. ToolbarItem.propDecorators = {
  52. '_buttons': [{ type: ContentChildren, args: [Button,] },],
  53. };
  54. return ToolbarItem;
  55. }(Ion));
  56. export { ToolbarItem };
  57. //# sourceMappingURL=toolbar-item.js.map