1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 { Attribute, Directive, NgZone } from '@angular/core';
  12. import { Platform } from '../../platform/platform';
  13. import { DisplayWhen } from './display-when';
  14. /**
  15. * @name HideWhen
  16. * @description
  17. * The `hideWhen` attribute takes a string that represents a plaform or screen orientation.
  18. * The element the attribute is added to will only be hidden when that platform or screen orientation is active.
  19. *
  20. * Complements the [showWhen attribute](../ShowWhen). If the `hideWhen` attribute is used on an
  21. * element that also has the `showWhen` attribute, the element will not show if `hideWhen` evaluates
  22. * to `true` or `showWhen` evaluates to `false`. If the `hidden` attribute is also added, the element
  23. * will not show if `hidden` evaluates to `true`.
  24. *
  25. * View the [Platform API docs](../../../platform/Platform) for more information on the different
  26. * platforms you can use.
  27. *
  28. * @usage
  29. * ```html
  30. * <div hideWhen="android">
  31. * I am hidden on Android!
  32. * </div>
  33. *
  34. * <div hideWhen="ios">
  35. * I am hidden on iOS!
  36. * </div>
  37. *
  38. * <div hideWhen="android,ios">
  39. * I am hidden on Android and iOS!
  40. * </div>
  41. *
  42. * <div hideWhen="portrait">
  43. * I am hidden on Portrait!
  44. * </div>
  45. *
  46. * <div hideWhen="landscape">
  47. * I am hidden on Landscape!
  48. * </div>
  49. * ```
  50. *
  51. * @demo /docs/demos/src/hide-when/
  52. * @see {@link ../ShowWhen ShowWhen API Docs}
  53. * @see {@link ../../../platform/Platform Platform API Docs}
  54. */
  55. var HideWhen = (function (_super) {
  56. __extends(HideWhen, _super);
  57. function HideWhen(hideWhen, plt, zone) {
  58. return _super.call(this, hideWhen, plt, zone) || this;
  59. }
  60. HideWhen.decorators = [
  61. { type: Directive, args: [{
  62. selector: '[hideWhen]',
  63. host: {
  64. '[class.hidden-hide-when]': 'isMatch'
  65. }
  66. },] },
  67. ];
  68. /** @nocollapse */
  69. HideWhen.ctorParameters = function () { return [
  70. { type: undefined, decorators: [{ type: Attribute, args: ['hideWhen',] },] },
  71. { type: Platform, },
  72. { type: NgZone, },
  73. ]; };
  74. return HideWhen;
  75. }(DisplayWhen));
  76. export { HideWhen };
  77. //# sourceMappingURL=hide-when.js.map