text: /**
   * @license
   * Copyright (c) 2018 Dominic Carretto
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://github.com/trimox/angular-mdc-web/blob/master/LICENSE
   */
  import { ChangeDetectionStrategy, Component, ContentChild, ElementRef, HostBinding, HostListener, Input, Renderer2, ViewEncapsulation, NgModule } from '@angular/core';
  import { EventRegistry } from '@angular-mdc/web/common';
  import { MdcRipple } from '@angular-mdc/web/ripple';
  import { MdcIcon } from '@angular-mdc/web/icon';
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  var MdcButton = /** @class */ (function () {
      function MdcButton(_renderer, _elementRef, _ripple) {
          this._renderer = _renderer;
          this._elementRef = _elementRef;
          this._ripple = _ripple;
          this._raised = false;
          this._primary = false;
          this._dense = false;
          this._secondary = false;
          this._unelevated = false;
          this._outlined = false;
          this._disabled = false;
          this.isHostClass = true;
      }
      Object.defineProperty(MdcButton.prototype, "raised", {
          get: /**
           * @return {?}
           */
          function () { return this._raised; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setRaised(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "primary", {
          get: /**
           * @return {?}
           */
          function () { return this._primary; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setPrimary(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "dense", {
          get: /**
           * @return {?}
           */
          function () { return this._dense; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setDense(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "secondary", {
          get: /**
           * @return {?}
           */
          function () { return this._secondary; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setSecondary(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "unelevated", {
          get: /**
           * @return {?}
           */
          function () { return this._unelevated; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setUnelevated(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "outlined", {
          get: /**
           * @return {?}
           */
          function () { return this._outlined; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setOutlined(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "icon", {
          get: /**
           * @return {?}
           */
          function () { return this._icon; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setIcon(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "disabled", {
          get: /**
           * @return {?}
           */
          function () { return this._disabled; },
          set: /**
           * @param {?} value
           * @return {?}
           */
          function (value) {
              this.setDisabled(value);
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "tabindex", {
          get: /**
           * @return {?}
           */
          function () {
              return this.disabled ? -1 : 0;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "classRaised", {
          get: /**
           * @return {?}
           */
          function () {
              return this.raised ? 'mdc-button--raised' : '';
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "classPrimary", {
          get: /**
           * @return {?}
           */
          function () {
              return this.primary ? 'mdc-button--primary' : '';
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "classSecondary", {
          get: /**
           * @return {?}
           */
          function () {
              return this.secondary ? 'mdc-button--secondary' : '';
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "classDense", {
          get: /**
           * @return {?}
           */
          function () {
              return this.dense ? 'mdc-button--dense' : '';
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "classUnelevated", {
          get: /**
           * @return {?}
           */
          function () {
              return this.unelevated ? 'mdc-button--unelevated' : '';
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MdcButton.prototype, "classOutlined", {
          get: /**
           * @return {?}
           */
          function () {
              return this.outlined ? 'mdc-button--outlined' : '';
          },
          enumerable: true,
          configurable: true
      });
      /**
       * @param {?} evt
       * @return {?}
       */
      MdcButton.prototype.onclick = /**
       * @param {?} evt
       * @return {?}
       */
      function (evt) {
          this._onClick(evt);
      };
      /**
       * @return {?}
       */
      MdcButton.prototype.ngAfterContentInit = /**
       * @return {?}
       */
      function () {
          this._ripple.attachTo(this.getHostElement());
      };
      /**
       * @return {?}
       */
      MdcButton.prototype.ngOnDestroy = /**
       * @return {?}
       */
      function () {
          this._ripple.destroy();
      };
      /**
       * @param {?} disabled
       * @return {?}
       */
      MdcButton.prototype.setDisabled = /**
       * @param {?} disabled
       * @return {?}
       */
      function (disabled) {
          this._disabled = disabled;
          if (disabled) {
              this._renderer.setAttribute(this.getHostElement(), 'disabled', 'true');
              this._renderer.setAttribute(this.getHostElement(), 'aria-disabled', 'true');
          }
          else {
              this._renderer.removeAttribute(this.getHostElement(), 'disabled');
              this._renderer.removeAttribute(this.getHostElement(), 'aria-disabled');
          }
      };
      /**
       * @param {?} raised
       * @return {?}
       */
      MdcButton.prototype.setRaised = /**
       * @param {?} raised
       * @return {?}
       */
      function (raised) {
          this._raised = raised;
      };
      /**
       * @param {?} primary
       * @return {?}
       */
      MdcButton.prototype.setPrimary = /**
       * @param {?} primary
       * @return {?}
       */
      function (primary) {
          this._primary = primary;
      };
      /**
       * @param {?} dense
       * @return {?}
       */
      MdcButton.prototype.setDense = /**
       * @param {?} dense
       * @return {?}
       */
      function (dense) {
          this._dense = dense;
      };
      /**
       * @param {?} secondary
       * @return {?}
       */
      MdcButton.prototype.setSecondary = /**
       * @param {?} secondary
       * @return {?}
       */
      function (secondary) {
          this._secondary = secondary;
      };
      /**
       * @param {?} unelevated
       * @return {?}
       */
      MdcButton.prototype.setUnelevated = /**
       * @param {?} unelevated
       * @return {?}
       */
      function (unelevated) {
          this._unelevated = unelevated;
      };
      /**
       * @param {?} outlined
       * @return {?}
       */
      MdcButton.prototype.setOutlined = /**
       * @param {?} outlined
       * @return {?}
       */
      function (outlined) {
          this._outlined = outlined;
      };
      /**
       * @param {?} icon
       * @return {?}
       */
      MdcButton.prototype.setIcon = /**
       * @param {?} icon
       * @return {?}
       */
      function (icon) {
          this._icon = icon;
          if (this.buttonIcon) {
              this._renderer.addClass(this.buttonIcon.elementRef.nativeElement, 'mdc-button__icon');
          }
          else if (icon) {
              this._renderer.addClass(this.icon, 'mdc-button__icon');
          }
      };
      /** Focuses the button. */
      /**
       * Focuses the button.
       * @return {?}
       */
      MdcButton.prototype.focus = /**
       * Focuses the button.
       * @return {?}
       */
      function () {
          this.getHostElement().focus();
      };
      /**
       * @return {?}
       */
      MdcButton.prototype.getHostElement = /**
       * @return {?}
       */
      function () {
          return this._elementRef.nativeElement;
      };
      /**
       * @param {?} event
       * @return {?}
       */
      MdcButton.prototype._onClick = /**
       * @param {?} event
       * @return {?}
       */
      function (event) {
          // A disabled button shouldn't apply any actions
          if (this.disabled) {
              event.preventDefault();
              event.stopImmediatePropagation();
          }
      };
      MdcButton.decorators = [
          { type: Component, args: [{exportAs: 'mdcButton',
                      selector: 'button[mdc-button], a[mdc-button]',
                      template: '<ng-content></ng-content>',
                      providers: [
                          MdcRipple,
                          EventRegistry
                      ],
                      encapsulation: ViewEncapsulation.None,
                      changeDetection: ChangeDetectionStrategy.OnPush
                  },] },
      ];
      /** @nocollapse */
      MdcButton.ctorParameters = function () { return [
          { type: Renderer2 },
          { type: ElementRef },
          { type: MdcRipple }
      ]; };
      MdcButton.propDecorators = {
          raised: [{ type: Input }],
          primary: [{ type: Input }],
          dense: [{ type: Input }],
          secondary: [{ type: Input }],
          unelevated: [{ type: Input }],
          outlined: [{ type: Input }],
          icon: [{ type: Input }],
          disabled: [{ type: Input }],
          tabindex: [{ type: HostBinding, args: ['tabindex',] }],
          isHostClass: [{ type: HostBinding, args: ['class.mdc-button',] }],
          classRaised: [{ type: HostBinding, args: ['class.mdc-button--raised',] }],
          classPrimary: [{ type: HostBinding, args: ['class.mdc-button--primary',] }],
          classSecondary: [{ type: HostBinding, args: ['class.mdc-button--secondary',] }],
          classDense: [{ type: HostBinding, args: ['class.mdc-button--dense',] }],
          classUnelevated: [{ type: HostBinding, args: ['class.mdc-button--unelevated',] }],
          classOutlined: [{ type: HostBinding, args: ['class.mdc-button--outlined',] }],
          onclick: [{ type: HostListener, args: ['click', ['$event'],] }],
          buttonIcon: [{ type: ContentChild, args: [MdcIcon,] }]
      };
      return MdcButton;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  var MdcButtonModule = /** @class */ (function () {
      function MdcButtonModule() {
      }
      MdcButtonModule.decorators = [
          { type: NgModule, args: [{
                      exports: [MdcButton],
                      declarations: [MdcButton]
                  },] },
      ];
      return MdcButtonModule;
  }());
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  /**
   * @fileoverview added by tsickle
   * @suppress {checkTypes} checked by tsc
   */
  
  export { MdcButtonModule, MdcButton };
  