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.
- package/fesm2022/dasar-ui.mjs +16 -5
- package/fesm2022/dasar-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/dasar-ui.d.ts +7 -1
package/fesm2022/dasar-ui.mjs
CHANGED
|
@@ -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(
|
|
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
|
-
|
|
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
|
|
1080
|
+
const ownMode = this.ownMode();
|
|
1070
1081
|
const hostElement = this.el.nativeElement;
|
|
1071
|
-
this.activeMode.set(
|
|
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);
|