@arsedizioni/ars-utils 18.2.277 → 18.2.279
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/clipper.common/common/services/clipper.service.d.ts +1 -1
- package/clipper.ui/documents.d.ts +2 -1
- package/clipper.ui/ui/browser-dialog/browser-dialog.component.d.ts +2 -1
- package/clipper.ui/ui/document/document.component.d.ts +2 -1
- package/clipper.ui/ui/search-result-manager/search-result-manager.d.ts +1 -0
- package/core/services/theme.service.d.ts +9 -0
- package/esm2022/clipper.common/common/definitions.mjs +2 -2
- package/esm2022/clipper.common/common/services/clipper.service.mjs +2 -2
- package/esm2022/clipper.ui/documents.mjs +1 -1
- package/esm2022/clipper.ui/ui/browser-dialog/browser-dialog.component.mjs +1 -1
- package/esm2022/clipper.ui/ui/document/document.component.mjs +1 -1
- package/esm2022/clipper.ui/ui/search-result-manager/search-result-manager.mjs +4 -3
- package/esm2022/core/services/theme.service.mjs +14 -5
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +2 -2
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +3 -2
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.mjs +13 -4
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/package.json +12 -12
|
@@ -1937,14 +1937,14 @@ class ThemeService {
|
|
|
1937
1937
|
/**
|
|
1938
1938
|
* The current theme is "System default"
|
|
1939
1939
|
*/
|
|
1940
|
-
this.auto = computed(() => this.theme() === '
|
|
1940
|
+
this.auto = computed(() => this.theme() === 'auto');
|
|
1941
1941
|
/**
|
|
1942
1942
|
* Configuration schema about the icon, the text and the toggle() sequence
|
|
1943
1943
|
*/
|
|
1944
1944
|
this.themeInfo = {
|
|
1945
|
-
['
|
|
1945
|
+
['auto']: { icon: 'contrast', name: 'Impostazione predefinita di sistema', next: 'light', tooltip: 'Passa a tema chiaro', },
|
|
1946
1946
|
['light']: { icon: 'light_mode', name: 'Tema chiaro', next: 'dark', tooltip: 'Passa a tema scuro', },
|
|
1947
|
-
['dark']: { icon: 'dark_mode', name: 'Tema scuro', next: '
|
|
1947
|
+
['dark']: { icon: 'dark_mode', name: 'Tema scuro', next: 'auto', tooltip: 'Passa a tema predefinito di sistema', },
|
|
1948
1948
|
};
|
|
1949
1949
|
/**
|
|
1950
1950
|
* Icon of the current theme (mat-icon code)
|
|
@@ -1980,7 +1980,7 @@ class ThemeService {
|
|
|
1980
1980
|
* Set the new theme
|
|
1981
1981
|
* @param theme the new theme
|
|
1982
1982
|
*/
|
|
1983
|
-
setTheme(theme = '
|
|
1983
|
+
setTheme(theme = 'auto') {
|
|
1984
1984
|
this.renderer.removeClass(document.body, 'light');
|
|
1985
1985
|
this.renderer.removeClass(document.body, 'dark');
|
|
1986
1986
|
this.theme.set(theme);
|
|
@@ -1995,6 +1995,15 @@ class ThemeService {
|
|
|
1995
1995
|
toggleTheme() {
|
|
1996
1996
|
this.setTheme(this.themeInfo[this.theme()].next);
|
|
1997
1997
|
}
|
|
1998
|
+
/**
|
|
1999
|
+
* Get current active theme
|
|
2000
|
+
* @returns the current theme
|
|
2001
|
+
*/
|
|
2002
|
+
getTheme() {
|
|
2003
|
+
return (this.auto()
|
|
2004
|
+
? (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
|
|
2005
|
+
: this.theme());
|
|
2006
|
+
}
|
|
1998
2007
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1999
2008
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: ThemeService, providedIn: "root" }); }
|
|
2000
2009
|
}
|