{"version":3,"file":"usitsdasdesign-dds-ng-core-theme.mjs","sources":["../../src/app/dds/core/theme/typings.ts","../../src/app/dds/core/theme/theme.directive.ts","../../src/app/dds/core/theme/theme.module.ts","../../src/app/dds/core/theme/usitsdasdesign-dds-ng-core-theme.ts"],"sourcesContent":["export enum ThemeMapEnum {\n  Size = 'sizeMap',\n  Kind = 'kindMap',\n  WidthState = 'widthStateMap',\n  Themes = 'ThemesMap',\n  ThemesType = 'ThemesTypeMap',\n  KindMarker = 'KindMarker',\n}\n\nexport type ThemeClassesMap = {\n  [key in ThemeMapEnum]?: {\n    [key: string]: string;\n  };\n};\n","import { Directive, ElementRef, Input, OnChanges, Renderer2, SimpleChanges } from '@angular/core';\nimport { ButtonKind, Kind, KindMarker, Size, SpinnerThemes, TabThemeType, Themes, WidthState } from '@usitsdasdesign/dds-ng/shared';\nimport { ThemeClassesMap, ThemeMapEnum } from './typings';\n\n@Directive({\n  selector: '[ddsTheme]',\n  standalone: true\n})\nexport class ThemeDirective implements OnChanges {\n  // Input properties to accept various theme-related values\n  @Input() public ddsTheme: ThemeClassesMap;\n  @Input() public size: Size | string;\n  @Input() public kind: Kind | ButtonKind | string;\n  @Input() public theme: Themes | SpinnerThemes | string;\n  @Input() public themeType: TabThemeType | string;\n  @Input() public width: WidthState | string;\n  @Input() public kindMarker: KindMarker | string;\n\n  // Constructor to inject Renderer2 and ElementRef\n  constructor(protected renderer: Renderer2, protected elementRef: ElementRef) { }\n\n  // Lifecycle hook to handle changes to input properties\n  ngOnChanges(changes: SimpleChanges): void {\n    // Handle changes to size property\n    if (changes.size && changes.size.currentValue) {\n      const prevValue: Size | string = changes.size.previousValue;\n      const currValue: Size | string = changes.size.currentValue;\n\n      if (this.ddsTheme[ThemeMapEnum.Size]) {\n        this.removeClass(this.ddsTheme[ThemeMapEnum.Size][prevValue]);\n        this.addClass(this.ddsTheme[ThemeMapEnum.Size][currValue]);\n      }\n    }\n\n    // Handle changes to kind property\n    if (changes.kind && changes.kind.currentValue) {\n      const prevValue: Kind | ButtonKind | string = changes.kind.previousValue;\n      const currValue: Kind | ButtonKind | string = changes.kind.currentValue;\n\n      if (this.ddsTheme[ThemeMapEnum.Kind]) {\n        this.removeClass(this.ddsTheme[ThemeMapEnum.Kind][prevValue]);\n        this.addClass(this.ddsTheme[ThemeMapEnum.Kind][currValue]);\n      }\n    }\n\n    // Handle changes to themeType property\n    if (changes.themeType && changes.themeType.currentValue) {\n      const prevValue: TabThemeType | string = changes.themeType.previousValue;\n      const currValue: TabThemeType | string = changes.themeType.currentValue;\n\n      if (this.ddsTheme[ThemeMapEnum.ThemesType]) {\n        this.removeClass(this.ddsTheme[ThemeMapEnum.ThemesType][prevValue]);\n        this.addClass(this.ddsTheme[ThemeMapEnum.ThemesType][currValue]);\n      }\n    }\n\n    // Handle changes to theme property\n    if (changes.theme && changes.theme.currentValue) {\n      const prevValue: Themes | string = changes.theme.previousValue;\n      const currValue: Themes | string = changes.theme.currentValue;\n\n      if (this.ddsTheme[ThemeMapEnum.Themes]) {\n        this.removeClass(this.ddsTheme[ThemeMapEnum.Themes][prevValue]);\n        this.addClass(this.ddsTheme[ThemeMapEnum.Themes][currValue]);\n      }\n    }\n\n    // Handle changes to width property\n    if (changes.width && changes.width.currentValue) {\n      const prevValue: WidthState | string = changes.width.previousValue;\n      const currValue: WidthState | string = changes.width.currentValue;\n\n      if (this.ddsTheme[ThemeMapEnum.WidthState]) {\n        this.removeClass(this.ddsTheme[ThemeMapEnum.WidthState][prevValue]);\n        this.addClass(this.ddsTheme[ThemeMapEnum.WidthState][currValue]);\n      }\n    }\n\n    // Handle changes to kindMarker property\n    if (changes.kindMarker && changes.kindMarker.currentValue) {\n      const prevValue: KindMarker | string = changes.kindMarker.previousValue;\n      const currValue: KindMarker | string = changes.kindMarker.currentValue;\n\n      if (this.ddsTheme[ThemeMapEnum.KindMarker]) {\n        this.removeClass(this.ddsTheme[ThemeMapEnum.KindMarker][prevValue]);\n        this.addClass(this.ddsTheme[ThemeMapEnum.KindMarker][currValue]);\n      }\n    }\n  }\n\n  // Method to add a CSS class to the element\n  protected addClass(className: string): void {\n    if (className) {\n      this.renderer.addClass(this.elementRef.nativeElement, className);\n    }\n  }\n\n  // Method to remove a CSS class from the element\n  protected removeClass(className: string): void {\n    this.renderer.removeClass(this.elementRef.nativeElement, className);\n  }\n}\n","import { NgModule } from '@angular/core';\nimport { ThemeDirective } from './theme.directive';\n\n@NgModule({\n  declarations: [],\n  imports: [ThemeDirective],\n  exports: [ThemeDirective],\n})\nexport class ThemeModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;IAAY;AAAZ,CAAA,UAAY,YAAY,EAAA;AACtB,IAAA,YAAA,CAAA,MAAA,CAAA,GAAA,SAAgB;AAChB,IAAA,YAAA,CAAA,MAAA,CAAA,GAAA,SAAgB;AAChB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,eAA4B;AAC5B,IAAA,YAAA,CAAA,QAAA,CAAA,GAAA,WAAoB;AACpB,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,eAA4B;AAC5B,IAAA,YAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AAC3B,CAAC,EAPW,YAAY,KAAZ,YAAY,GAAA,EAAA,CAAA,CAAA;;MCQX,cAAc,CAAA;;IAWzB,WAAA,CAAsB,QAAmB,EAAY,UAAsB,EAAA;QAArD,IAAA,CAAA,QAAQ,GAAR,QAAQ;QAAuB,IAAA,CAAA,UAAU,GAAV,UAAU;IAAgB;;AAG/E,IAAA,WAAW,CAAC,OAAsB,EAAA;;QAEhC,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;AAC7C,YAAA,MAAM,SAAS,GAAkB,OAAO,CAAC,IAAI,CAAC,aAAa;AAC3D,YAAA,MAAM,SAAS,GAAkB,OAAO,CAAC,IAAI,CAAC,YAAY;YAE1D,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY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