asksuite-citrus 3.15.1 → 3.15.3
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/esm2022/lib/components/accordion/extendable-panel/extendable-panel.component.mjs +2 -2
- package/esm2022/lib/components/arrow-tag/arrow-tag.component.mjs +2 -2
- package/esm2022/lib/components/autocomplete/autocomplete.component.mjs +2 -2
- package/esm2022/lib/components/avatar/avatar.component.mjs +2 -2
- package/esm2022/lib/components/box/box.component.mjs +2 -2
- package/esm2022/lib/components/button/button.component.mjs +2 -2
- package/esm2022/lib/components/character-counter/character-counter.component.mjs +2 -2
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +2 -2
- package/esm2022/lib/components/chips/chips.component.mjs +2 -2
- package/esm2022/lib/components/date-picker/date-picker-calendar/date-picker-calendar.component.mjs +2 -2
- package/esm2022/lib/components/date-picker/date-picker.component.mjs +2 -2
- package/esm2022/lib/components/dropdown-container/dropdown-container.component.mjs +2 -2
- package/esm2022/lib/components/input/input.component.mjs +2 -2
- package/esm2022/lib/components/modal/confirmation-modal/confirmation-modal.component.mjs +2 -2
- package/esm2022/lib/components/modal/modal.component.mjs +2 -2
- package/esm2022/lib/components/pagination/pagination.component.mjs +2 -2
- package/esm2022/lib/components/phone-ddi/phone-ddi.component.mjs +2 -2
- package/esm2022/lib/components/richtext-toolbox/richtext-toolbox.component.mjs +2 -2
- package/esm2022/lib/components/richtext-url-prompt/richtext-url-prompt.component.mjs +2 -2
- package/esm2022/lib/components/select/select.component.mjs +2 -2
- package/esm2022/lib/components/tab-group/tab/tab.component.mjs +2 -2
- package/esm2022/lib/components/tab-group/tab-group.component.mjs +2 -2
- package/esm2022/lib/components/table/table.component.mjs +2 -2
- package/esm2022/lib/components/toast/toast.component.mjs +2 -2
- package/esm2022/lib/services/theme/theme.service.mjs +12 -7
- package/fesm2022/asksuite-citrus.mjs +58 -54
- package/fesm2022/asksuite-citrus.mjs.map +1 -1
- package/lib/services/theme/theme.service.d.ts +8 -4
- package/package.json +1 -1
- package/styles/colors-light.scss +4 -0
@@ -1,24 +1,29 @@
|
|
1
1
|
import { Injectable } from '@angular/core';
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
2
3
|
import * as i0 from "@angular/core";
|
3
4
|
import * as i1 from "../storage/storage-util.service";
|
4
5
|
export class ThemeService {
|
5
6
|
constructor(storageUtilService) {
|
6
7
|
this.storageUtilService = storageUtilService;
|
7
|
-
this.theme = 'light';
|
8
8
|
this.themeKey = 'asksuite-theme-color';
|
9
|
-
this.theme =
|
9
|
+
this.theme$ = new BehaviorSubject('light');
|
10
|
+
const theme = this.storageUtilService.getItem(this.themeKey) || 'light';
|
11
|
+
this.theme$.next(theme);
|
10
12
|
this.saveTheme();
|
11
13
|
}
|
12
14
|
getTheme() {
|
13
|
-
return this.theme;
|
15
|
+
return this.theme$.value;
|
14
16
|
}
|
15
17
|
setTheme(theme) {
|
16
|
-
this.theme
|
18
|
+
this.theme$.next(theme);
|
17
19
|
this.saveTheme();
|
18
20
|
}
|
21
|
+
listenThemeChange() {
|
22
|
+
return this.theme$.asObservable();
|
23
|
+
}
|
19
24
|
saveTheme() {
|
20
|
-
document.body.className = this.theme;
|
21
|
-
this.storageUtilService.setItem(this.themeKey, this.theme);
|
25
|
+
document.body.className = this.theme$.value;
|
26
|
+
this.storageUtilService.setItem(this.themeKey, this.theme$.value);
|
22
27
|
}
|
23
28
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ThemeService, deps: [{ token: i1.StorageUtilService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
24
29
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
|
@@ -29,4 +34,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImpor
|
|
29
34
|
providedIn: 'root'
|
30
35
|
}]
|
31
36
|
}], ctorParameters: () => [{ type: i1.StorageUtilService }] });
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlbWUuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Fza3N1aXRlLWNpdHJ1cy9zcmMvbGliL3NlcnZpY2VzL3RoZW1lL3RoZW1lLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUzQyxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sTUFBTSxDQUFDOzs7QUFPdkMsTUFBTSxPQUFPLFlBQVk7SUFJdkIsWUFBNkIsa0JBQTZDO1FBQTdDLHVCQUFrQixHQUFsQixrQkFBa0IsQ0FBMkI7UUFIMUUsYUFBUSxHQUFHLHNCQUFzQixDQUFDO1FBQ2xDLFdBQU0sR0FBRyxJQUFJLGVBQWUsQ0FBUSxPQUFPLENBQUMsQ0FBQztRQUczQyxNQUFNLEtBQUssR0FBRyxJQUFJLENBQUMsa0JBQWtCLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsSUFBSSxPQUFPLENBQUM7UUFDeEUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDeEIsSUFBSSxDQUFDLFNBQVMsRUFBRSxDQUFDO0lBQ25CLENBQUM7SUFFRCxRQUFRO1FBQ04sT0FBTyxJQUFJLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQztJQUMzQixDQUFDO0lBRUQsUUFBUSxDQUFDLEtBQVk7UUFDbkIsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxD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