{"version":3,"file":"alyle-ui-responsive.mjs","sources":["../../../lib/responsive/media.directive.ts","../../../lib/responsive/responsive.module.ts","../../../lib/responsive/media-queries.ts","../../../lib/responsive/alyle-ui-responsive.ts"],"sourcesContent":["import {\n  Directive,\n  Input,\n  OnInit,\n  OnChanges,\n  Renderer2,\n  ElementRef\n} from '@angular/core';\n\nimport { LyTheme2, ThemeVariables } from '@alyle/ui';\n\nconst MEDIA_PRIORITY = 999;\n\nconst styles = {\n  hide: {\n    display: 'none'\n  }\n};\n\n/**\n * @deprecated use `[lyDisplay]` instead.\n */\n@Directive({\n  selector: '[lyShow], [lyHide]',\n  standalone: false\n})\nexport class MediaDirective implements OnInit, OnChanges {\n  private _show: string;\n  private _showClass: string;\n  private _hide: string;\n  private _hideClass: string;\n\n  /**\n   * Styles\n   * @ignore\n   */\n  classes = this.theme.addStyleSheet(styles);\n\n  /**\n   * Shows the item when the value is resolved as true\n   */\n  @Input()\n  get lyShow(): string {\n    return this._show;\n  }\n  set lyShow(val: string) {\n    this._show = val;\n    this._showClass = this.theme.addStyle(`lyMedia-show:${val}`, (theme: ThemeVariables) =>\n    ({\n      [theme.getBreakpoint(val)]: {\n        display: 'block'\n      }\n    }),\n    this._elementRef.nativeElement,\n    this._showClass,\n    MEDIA_PRIORITY\n    );\n  }\n\n  /**\n   * Hides the item when the value is resolved as true\n   */\n  @Input()\n  set lyHide(val: string) {\n    this._hide = val;\n    this._hideClass = this.theme.addStyle(`lyMedia-hide:${val}`, (theme: ThemeVariables) =>\n    ({\n      [theme.getBreakpoint(val)]: {\n        display: 'none'\n      }\n    }),\n    this._elementRef.nativeElement,\n    this._hideClass,\n    MEDIA_PRIORITY\n    );\n  }\n\n  get lyHide(): string {\n    return this._hide;\n  }\n\n  constructor(\n    private _renderer: Renderer2,\n    private _elementRef: ElementRef,\n    private theme: LyTheme2\n  ) { }\n\n  ngOnInit() {\n    if (!this.lyHide) {\n      this._renderer.addClass(this._elementRef.nativeElement, this.classes.hide);\n    }\n  }\n\n  ngOnChanges() {\n    if (this.lyHide && this.lyShow) {\n      throw new Error(`use only \\`lyHide\\` or \\`lyShow\\` per element`);\n    }\n  }\n\n}\n","import { NgModule } from '@angular/core';\nimport { MediaDirective } from './media.directive';\nimport { LyCommonModule } from '@alyle/ui';\n\n/**\n * @deprecated use instead `[lyDisplay]` or `[lyStyle]`\n */\n@NgModule({\n  declarations: [MediaDirective],\n  exports: [MediaDirective, LyCommonModule],\n})\nexport class ResponsiveModule { }\n","export const Breakpoints = {\n  XSmall: '(max-width: 599px)',\n  Small: '(min-width: 600px) and (max-width: 959px)',\n  Medium: '(min-width: 960px) and (max-width: 1279px)',\n  Large: '(min-width: 1280px) and (max-width: 1919px)',\n  XLarge: '(min-width: 1920px)',\n\n  Handset: '(max-width: 599px) and (orientation: portrait), ' +\n           '(max-width: 959px) and (orientation: landscape)',\n  Tablet: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait), ' +\n          '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n  Web: '(min-width: 840px) and (orientation: portrait), ' +\n       '(min-width: 1280px) and (orientation: landscape)',\n\n  HandsetPortrait: '(max-width: 599px) and (orientation: portrait)',\n  TabletPortrait: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait)',\n  WebPortrait: '(min-width: 840px) and (orientation: portrait)',\n\n  HandsetLandscape: '(max-width: 959px) and (orientation: landscape)',\n  TabletLandscape: '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n  WebLandscape: '(min-width: 1280px) and (orientation: landscape)',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAWA,MAAM,cAAc,GAAG,GAAG;AAE1B,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE;AACV;CACF;AAED;;AAEG;MAKU,cAAc,CAAA;AAYzB;;AAEG;AACH,IAAA,IACI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,KA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