dasar-ui 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -929,7 +929,12 @@ var DasarThemeService = class DasarThemeService {
929
929
  renderer;
930
930
  constructor(rendererFactory) {
931
931
  this.renderer = rendererFactory.createRenderer(null, null);
932
- if (this.initialConfig) this.setGlobalTheme(this.initialConfig);
932
+ if (this.initialConfig) this.setGlobalTheme({
933
+ mode: this.initialConfig.mode ?? "light",
934
+ components: this.initialConfig.componentConfig,
935
+ tokens: this.initialConfig.tokenConfig,
936
+ colors: this.initialConfig.colorConfig
937
+ });
933
938
  }
934
939
  setGlobalTheme(config, targetElement) {
935
940
  if (!isPlatformBrowser(this.platformId)) {
@@ -1062,20 +1067,26 @@ var DasarThemeProviderComponent = class DasarThemeProviderComponent {
1062
1067
  componentConfig;
1063
1068
  tokenConfig;
1064
1069
  colorConfig;
1065
- mode = "light";
1070
+ ownMode = signal(void 0, ...ngDevMode ? [{ debugName: "ownMode" }] : /* istanbul ignore next */ []);
1071
+ set mode(value) {
1072
+ this.ownMode.set(value);
1073
+ }
1074
+ get mode() {
1075
+ return this.ownMode();
1076
+ }
1066
1077
  constructor(el) {
1067
1078
  this.el = el;
1068
1079
  if (this.parentProvider) effect(() => {
1069
- const parentMode = this.parentProvider.activeMode();
1080
+ const ownMode = this.ownMode();
1070
1081
  const hostElement = this.el.nativeElement;
1071
- this.activeMode.set(parentMode);
1082
+ this.activeMode.set(ownMode ?? this.parentProvider.activeMode());
1072
1083
  this.applyTokenConfig(hostElement);
1073
1084
  });
1074
1085
  }
1075
1086
  ngOnChanges(changes) {
1076
1087
  const hostElement = this.el.nativeElement;
1077
1088
  if (changes["mode"] && !this.parentProvider) {
1078
- this.activeMode.set(this.mode);
1089
+ this.activeMode.set(this.mode ?? "light");
1079
1090
  this.applyTokenConfig(hostElement);
1080
1091
  }
1081
1092
  if (changes["tokenConfig"]) this.applyTokenConfig(hostElement);