clr-lift 1.7.1 → 1.7.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/esm2022/lib/components/alert/alert.component.mjs +3 -3
- package/esm2022/lib/components/theme-toggle/index.mjs +3 -1
- package/esm2022/lib/components/theme-toggle/theme-toggle.component.mjs +6 -15
- package/esm2022/lib/components/theme-toggle/theme.service.mjs +29 -0
- package/esm2022/lib/components/theme-toggle/theme.type.mjs +2 -0
- package/fesm2022/clr-lift.mjs +34 -17
- package/fesm2022/clr-lift.mjs.map +1 -1
- package/lib/components/theme-toggle/index.d.ts +2 -0
- package/lib/components/theme-toggle/theme-toggle.component.d.ts +5 -6
- package/lib/components/theme-toggle/theme.service.d.ts +10 -0
- package/lib/components/theme-toggle/theme.type.d.ts +1 -0
- package/package.json +1 -1
|
@@ -12,10 +12,10 @@ export class AlertComponent {
|
|
|
12
12
|
this.content = input('');
|
|
13
13
|
}
|
|
14
14
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: AlertComponent, isStandalone: true, selector: "cll-alert", inputs: { alertType: { classPropertyName: "alertType", publicName: "alertType", isSignal: true, isRequired: false, transformFunction: null }, isSmall: { classPropertyName: "isSmall", publicName: "isSmall", isSignal: true, isRequired: false, transformFunction: null }, isLightweight: { classPropertyName: "isLightweight", publicName: "isLightweight", isSignal: true, isRequired: false, transformFunction: null }, isAppLevel: { classPropertyName: "isAppLevel", publicName: "isAppLevel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<clr-alert\n [clrAlertType]=\"alertType()\"\n [clrAlertSizeSmall]=\"isSmall()\"\n [clrAlertAppLevel]=\"isAppLevel()\"\n [clrAlertLightweight]=\"isLightweight()\"\n>\n <clr-alert-item>\n @if (error()) {\n <span class=\"alert-text\" role=\"alert\">{{ error()?.error
|
|
15
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: AlertComponent, isStandalone: true, selector: "cll-alert", inputs: { alertType: { classPropertyName: "alertType", publicName: "alertType", isSignal: true, isRequired: false, transformFunction: null }, isSmall: { classPropertyName: "isSmall", publicName: "isSmall", isSignal: true, isRequired: false, transformFunction: null }, isLightweight: { classPropertyName: "isLightweight", publicName: "isLightweight", isSignal: true, isRequired: false, transformFunction: null }, isAppLevel: { classPropertyName: "isAppLevel", publicName: "isAppLevel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<clr-alert\n [clrAlertType]=\"alertType()\"\n [clrAlertSizeSmall]=\"isSmall()\"\n [clrAlertAppLevel]=\"isAppLevel()\"\n [clrAlertLightweight]=\"isLightweight()\"\n>\n <clr-alert-item>\n @if (error()) {\n <span class=\"alert-text\" role=\"alert\">{{ error()?.error?.message || error()?.message }}</span>\n }\n @if (content()) {\n <span class=\"alert-text\" role=\"alert\" [innerHTML]=\"content()\"></span>\n }\n\n @if (!error() && !content()) {\n <span class=\"alert-text\" role=\"alert\">\n <ng-content></ng-content>\n </span>\n }\n </clr-alert-item>\n</clr-alert>\n", styles: [":host{display:block}:host .alert-text{word-break:break-all}\n"], dependencies: [{ kind: "ngmodule", type: ClarityModule }, { kind: "component", type: i1.ClrAlert, selector: "clr-alert", inputs: ["clrAlertSizeSmall", "clrAlertClosable", "clrAlertAppLevel", "clrCloseButtonAriaLabel", "clrAlertLightweight", "clrAlertType", "clrAlertIcon", "clrAlertClosed"], outputs: ["clrAlertClosedChange"] }, { kind: "component", type: i1.ClrAlertItem, selector: "clr-alert-item" }, { kind: "directive", type: i1.ClrAlertText, selector: ".alert-text" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
16
16
|
}
|
|
17
17
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: AlertComponent, decorators: [{
|
|
18
18
|
type: Component,
|
|
19
|
-
args: [{ selector: 'cll-alert', standalone: true, imports: [ClarityModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<clr-alert\n [clrAlertType]=\"alertType()\"\n [clrAlertSizeSmall]=\"isSmall()\"\n [clrAlertAppLevel]=\"isAppLevel()\"\n [clrAlertLightweight]=\"isLightweight()\"\n>\n <clr-alert-item>\n @if (error()) {\n <span class=\"alert-text\" role=\"alert\">{{ error()?.error
|
|
19
|
+
args: [{ selector: 'cll-alert', standalone: true, imports: [ClarityModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<clr-alert\n [clrAlertType]=\"alertType()\"\n [clrAlertSizeSmall]=\"isSmall()\"\n [clrAlertAppLevel]=\"isAppLevel()\"\n [clrAlertLightweight]=\"isLightweight()\"\n>\n <clr-alert-item>\n @if (error()) {\n <span class=\"alert-text\" role=\"alert\">{{ error()?.error?.message || error()?.message }}</span>\n }\n @if (content()) {\n <span class=\"alert-text\" role=\"alert\" [innerHTML]=\"content()\"></span>\n }\n\n @if (!error() && !content()) {\n <span class=\"alert-text\" role=\"alert\">\n <ng-content></ng-content>\n </span>\n }\n </clr-alert-item>\n</clr-alert>\n", styles: [":host{display:block}:host .alert-text{word-break:break-all}\n"] }]
|
|
20
20
|
}] });
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4v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nQtaXRlbT5cbiAgICBAaWYgKGVycm9yKCkpIHtcbiAgICAgIDxzcGFuIGNsYXNzPVwiYWxlcnQtdGV4dFwiIHJvbGU9XCJhbGVydFwiPnt7IGVycm9yKCk/LmVycm9yPy5tZXNzYWdlIHx8IGVycm9yKCk/Lm1lc3NhZ2UgfX08L3NwYW4+XG4gICAgfVxuICAgIEBpZiAoY29udGVudCgpKSB7XG4gICAgICA8c3BhbiBjbGFzcz1cImFsZXJ0LXRleHRcIiByb2xlPVwiYWxlcnRcIiBbaW5uZXJIVE1MXT1cImNvbnRlbnQoKVwiPjwvc3Bhbj5cbiAgICB9XG5cbiAgICBAaWYgKCFlcnJvcigpICYmICFjb250ZW50KCkpIHtcbiAgICAgIDxzcGFuIGNsYXNzPVwiYWxlcnQtdGV4dFwiIHJvbGU9XCJhbGVydFwiPlxuICAgICAgICA8bmctY29udGVudD48L25nLWNvbnRlbnQ+XG4gICAgICA8L3NwYW4+XG4gICAgfVxuICA8L2Nsci1hbGVydC1pdGVtPlxuPC9jbHItYWxlcnQ+XG4iXX0=
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export * from './theme.service';
|
|
2
|
+
export * from './theme.type';
|
|
1
3
|
export * from './theme-toggle.component';
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jbHItbGlmdC9zcmMvbGliL2NvbXBvbmVudHMvdGhlbWUtdG9nZ2xlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYywwQkFBMEIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vdGhlbWUuc2VydmljZSc7XG5leHBvcnQgKiBmcm9tICcuL3RoZW1lLnR5cGUnO1xuZXhwb3J0ICogZnJvbSAnLi90aGVtZS10b2dnbGUuY29tcG9uZW50JztcbiJdfQ==
|
|
@@ -2,6 +2,7 @@ import { Component, computed, inject, input, output, signal } from '@angular/cor
|
|
|
2
2
|
import { ClarityIcons, moonIcon, sunIcon } from '@cds/core/icon';
|
|
3
3
|
import { ClarityModule } from '@clr/angular';
|
|
4
4
|
import { TranslationService } from '../../services/translation.service';
|
|
5
|
+
import { ThemeService } from './theme.service';
|
|
5
6
|
import { themeToggleTranslations } from './theme-toggle.l10n';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
import * as i1 from "@clr/angular";
|
|
@@ -10,10 +11,11 @@ ClarityIcons.addIcons(sunIcon);
|
|
|
10
11
|
export class ThemeToggleComponent {
|
|
11
12
|
constructor() {
|
|
12
13
|
this.translationService = inject(TranslationService);
|
|
14
|
+
this.themeService = inject(ThemeService);
|
|
13
15
|
this.lang = input('');
|
|
14
16
|
this.changeTheme = output();
|
|
15
17
|
this.hovering = signal(false);
|
|
16
|
-
this.theme =
|
|
18
|
+
this.theme = this.themeService.theme;
|
|
17
19
|
this.themeDisplayName = computed(() => {
|
|
18
20
|
return this.translationService.translate(this.theme() === 'light' ? 'theme-toggle.dark' : 'theme-toggle.light', this.lang());
|
|
19
21
|
});
|
|
@@ -27,23 +29,12 @@ export class ThemeToggleComponent {
|
|
|
27
29
|
}
|
|
28
30
|
toggleTheme() {
|
|
29
31
|
const newTheme = this.theme() === 'light' ? 'dark' : 'light';
|
|
30
|
-
this.setTheme(newTheme);
|
|
32
|
+
this.themeService.setTheme(newTheme);
|
|
33
|
+
this.changeTheme.emit(newTheme);
|
|
31
34
|
}
|
|
32
35
|
setHovering(value) {
|
|
33
36
|
this.hovering.set(value);
|
|
34
37
|
}
|
|
35
|
-
setTheme(newTheme) {
|
|
36
|
-
this.theme.set(newTheme);
|
|
37
|
-
localStorage['cds-theme'] = newTheme;
|
|
38
|
-
document.body.setAttribute('cds-theme', newTheme);
|
|
39
|
-
this.changeTheme.emit(newTheme);
|
|
40
|
-
}
|
|
41
|
-
ngOnInit() {
|
|
42
|
-
const themeInUsing = localStorage['cds-theme'];
|
|
43
|
-
if (themeInUsing) {
|
|
44
|
-
this.setTheme(themeInUsing);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
38
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ThemeToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
48
39
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.2", type: ThemeToggleComponent, isStandalone: true, selector: "cll-theme-toggle", inputs: { lang: { classPropertyName: "lang", publicName: "lang", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeTheme: "changeTheme" }, ngImport: i0, template: "<button\n cds-layout=\"m:none\"\n class=\"btn btn-link nav-link\"\n [attr.aria-label]=\"ariaLabel()\"\n (click)=\"toggleTheme()\"\n (mouseenter)=\"setHovering(true)\"\n (mouseleave)=\"setHovering(false)\"\n>\n <cds-icon\n size=\"md\"\n class=\"theme-toggle\"\n [attr.shape]=\"iconShape()\"\n [attr.inverse]=\"hovering()\"\n [attr.solid]=\"hovering()\"\n />\n {{ themeDisplayName() }}\n</button>\n", styles: [":host{display:flex;align-items:center}:host cds-icon.theme-toggle,:host button:hover cds-icon.theme-toggle{color:#e3eaed}\n"], dependencies: [{ kind: "ngmodule", type: ClarityModule }, { kind: "directive", type: i1.CdsIconCustomTag, selector: "cds-icon" }] }); }
|
|
49
40
|
}
|
|
@@ -51,4 +42,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
51
42
|
type: Component,
|
|
52
43
|
args: [{ selector: 'cll-theme-toggle', standalone: true, imports: [ClarityModule], template: "<button\n cds-layout=\"m:none\"\n class=\"btn btn-link nav-link\"\n [attr.aria-label]=\"ariaLabel()\"\n (click)=\"toggleTheme()\"\n (mouseenter)=\"setHovering(true)\"\n (mouseleave)=\"setHovering(false)\"\n>\n <cds-icon\n size=\"md\"\n class=\"theme-toggle\"\n [attr.shape]=\"iconShape()\"\n [attr.inverse]=\"hovering()\"\n [attr.solid]=\"hovering()\"\n />\n {{ themeDisplayName() }}\n</button>\n", styles: [":host{display:flex;align-items:center}:host cds-icon.theme-toggle,:host button:hover cds-icon.theme-toggle{color:#e3eaed}\n"] }]
|
|
53
44
|
}], ctorParameters: () => [] });
|
|
54
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlbWUtdG9nZ2xlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nsci1saWZ0L3NyYy9saWIvY29tcG9uZW50cy90aGVtZS10b2dnbGUvdGhlbWUtdG9nZ2xlLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nsci1saWZ0L3NyYy9saWIvY29tcG9uZW50cy90aGVtZS10b2dnbGUvdGhlbWUtdG9nZ2xlLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUUsUUFBUSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUNqRixPQUFPLEVBQUMsWUFBWSxFQUFFLFFBQVEsRUFBRSxPQUFPLEVBQUMsTUFBTSxnQkFBZ0IsQ0FBQztBQUMvRCxPQUFPLEVBQUMsYUFBYSxFQUFDLE1BQU0sY0FBYyxDQUFDO0FBRTNDL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N0IG5ld1RoZW1lID0gdGhpcy50aGVtZSgpID09PSAnbGlnaHQnID8gJ2RhcmsnIDogJ2xpZ2h0JztcbiAgICB0aGlzLnRoZW1lU2VydmljZS5zZXRUaGVtZShuZXdUaGVtZSk7XG4gICAgdGhpcy5jaGFuZ2VUaGVtZS5lbWl0KG5ld1RoZW1lKTtcbiAgfVxuXG4gIHNldEhvdmVyaW5nKHZhbHVlOiBib29sZWFuKSB7XG4gICAgdGhpcy5ob3ZlcmluZy5zZXQodmFsdWUpO1xuICB9XG59XG4iLCI8YnV0dG9uXG4gIGNkcy1sYXlvdXQ9XCJtOm5vbmVcIlxuICBjbGFzcz1cImJ0biBidG4tbGluayBuYXYtbGlua1wiXG4gIFthdHRyLmFyaWEtbGFiZWxdPVwiYXJpYUxhYmVsKClcIlxuICAoY2xpY2spPVwidG9nZ2xlVGhlbWUoKVwiXG4gIChtb3VzZWVudGVyKT1cInNldEhvdmVyaW5nKHRydWUpXCJcbiAgKG1vdXNlbGVhdmUpPVwic2V0SG92ZXJpbmcoZmFsc2UpXCJcbj5cbiAgPGNkcy1pY29uXG4gICAgc2l6ZT1cIm1kXCJcbiAgICBjbGFzcz1cInRoZW1lLXRvZ2dsZVwiXG4gICAgW2F0dHIuc2hhcGVdPVwiaWNvblNoYXBlKClcIlxuICAgIFthdHRyLmludmVyc2VdPVwiaG92ZXJpbmcoKVwiXG4gICAgW2F0dHIuc29saWRdPVwiaG92ZXJpbmcoKVwiXG4gIC8+XG4gIHt7IHRoZW1lRGlzcGxheU5hbWUoKSB9fVxuPC9idXR0b24+XG4iXX0=
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Injectable, signal } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export class ThemeService {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.theme = signal('light');
|
|
6
|
+
this.initTheme();
|
|
7
|
+
}
|
|
8
|
+
setTheme(newTheme) {
|
|
9
|
+
this.theme.set(newTheme);
|
|
10
|
+
localStorage['cds-theme'] = newTheme;
|
|
11
|
+
document.body.setAttribute('cds-theme', newTheme);
|
|
12
|
+
}
|
|
13
|
+
initTheme() {
|
|
14
|
+
const themeInUse = localStorage['cds-theme'];
|
|
15
|
+
if (themeInUse) {
|
|
16
|
+
this.theme.set(themeInUse);
|
|
17
|
+
document.body.setAttribute('cds-theme', themeInUse);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
21
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
|
|
22
|
+
}
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ThemeService, decorators: [{
|
|
24
|
+
type: Injectable,
|
|
25
|
+
args: [{
|
|
26
|
+
providedIn: 'root',
|
|
27
|
+
}]
|
|
28
|
+
}], ctorParameters: () => [] });
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlbWUuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nsci1saWZ0L3NyYy9saWIvY29tcG9uZW50cy90aGVtZS10b2dnbGUvdGhlbWUuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsVUFBVSxFQUFFLE1BQU0sRUFBQyxNQUFNLGVBQWUsQ0FBQzs7QUFPakQsTUFBTSxPQUFPLFlBQVk7SUFHdkI7UUFGQSxVQUFLLEdBQUcsTUFBTSxDQUFlLE9BQU8sQ0FBQyxDQUFDO1FBR3BDLElBQUksQ0FB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xuXG4gIHNldFRoZW1lKG5ld1RoZW1lOiBDbGFyaXR5VGhlbWUpIHtcbiAgICB0aGlzLnRoZW1lLnNldChuZXdUaGVtZSk7XG4gICAgbG9jYWxTdG9yYWdlWydjZHMtdGhlbWUnXSA9IG5ld1RoZW1lO1xuICAgIGRvY3VtZW50LmJvZHkuc2V0QXR0cmlidXRlKCdjZHMtdGhlbWUnLCBuZXdUaGVtZSk7XG4gIH1cblxuICBwcml2YXRlIGluaXRUaGVtZSgpIHtcbiAgICBjb25zdCB0aGVtZUluVXNlID0gbG9jYWxTdG9yYWdlWydjZHMtdGhlbWUnXTtcblxuICAgIGlmICh0aGVtZUluVXNlKSB7XG4gICAgICB0aGlzLnRoZW1lLnNldCh0aGVtZUluVXNlKTtcbiAgICAgIGRvY3VtZW50LmJvZHkuc2V0QXR0cmlidXRlKCdjZHMtdGhlbWUnLCB0aGVtZUluVXNlKTtcbiAgICB9XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlbWUudHlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Nsci1saWZ0L3NyYy9saWIvY29tcG9uZW50cy90aGVtZS10b2dnbGUvdGhlbWUudHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgQ2xhcml0eVRoZW1lID0gJ2xpZ2h0JyB8ICdkYXJrJztcbiJdfQ==
|
package/fesm2022/clr-lift.mjs
CHANGED
|
@@ -26,11 +26,11 @@ class AlertComponent {
|
|
|
26
26
|
this.content = input('');
|
|
27
27
|
}
|
|
28
28
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: AlertComponent, isStandalone: true, selector: "cll-alert", inputs: { alertType: { classPropertyName: "alertType", publicName: "alertType", isSignal: true, isRequired: false, transformFunction: null }, isSmall: { classPropertyName: "isSmall", publicName: "isSmall", isSignal: true, isRequired: false, transformFunction: null }, isLightweight: { classPropertyName: "isLightweight", publicName: "isLightweight", isSignal: true, isRequired: false, transformFunction: null }, isAppLevel: { classPropertyName: "isAppLevel", publicName: "isAppLevel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<clr-alert\n [clrAlertType]=\"alertType()\"\n [clrAlertSizeSmall]=\"isSmall()\"\n [clrAlertAppLevel]=\"isAppLevel()\"\n [clrAlertLightweight]=\"isLightweight()\"\n>\n <clr-alert-item>\n @if (error()) {\n <span class=\"alert-text\" role=\"alert\">{{ error()?.error
|
|
29
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: AlertComponent, isStandalone: true, selector: "cll-alert", inputs: { alertType: { classPropertyName: "alertType", publicName: "alertType", isSignal: true, isRequired: false, transformFunction: null }, isSmall: { classPropertyName: "isSmall", publicName: "isSmall", isSignal: true, isRequired: false, transformFunction: null }, isLightweight: { classPropertyName: "isLightweight", publicName: "isLightweight", isSignal: true, isRequired: false, transformFunction: null }, isAppLevel: { classPropertyName: "isAppLevel", publicName: "isAppLevel", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<clr-alert\n [clrAlertType]=\"alertType()\"\n [clrAlertSizeSmall]=\"isSmall()\"\n [clrAlertAppLevel]=\"isAppLevel()\"\n [clrAlertLightweight]=\"isLightweight()\"\n>\n <clr-alert-item>\n @if (error()) {\n <span class=\"alert-text\" role=\"alert\">{{ error()?.error?.message || error()?.message }}</span>\n }\n @if (content()) {\n <span class=\"alert-text\" role=\"alert\" [innerHTML]=\"content()\"></span>\n }\n\n @if (!error() && !content()) {\n <span class=\"alert-text\" role=\"alert\">\n <ng-content></ng-content>\n </span>\n }\n </clr-alert-item>\n</clr-alert>\n", styles: [":host{display:block}:host .alert-text{word-break:break-all}\n"], dependencies: [{ kind: "ngmodule", type: ClarityModule }, { kind: "component", type: i1.ClrAlert, selector: "clr-alert", inputs: ["clrAlertSizeSmall", "clrAlertClosable", "clrAlertAppLevel", "clrCloseButtonAriaLabel", "clrAlertLightweight", "clrAlertType", "clrAlertIcon", "clrAlertClosed"], outputs: ["clrAlertClosedChange"] }, { kind: "component", type: i1.ClrAlertItem, selector: "clr-alert-item" }, { kind: "directive", type: i1.ClrAlertText, selector: ".alert-text" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
30
30
|
}
|
|
31
31
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: AlertComponent, decorators: [{
|
|
32
32
|
type: Component,
|
|
33
|
-
args: [{ selector: 'cll-alert', standalone: true, imports: [ClarityModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<clr-alert\n [clrAlertType]=\"alertType()\"\n [clrAlertSizeSmall]=\"isSmall()\"\n [clrAlertAppLevel]=\"isAppLevel()\"\n [clrAlertLightweight]=\"isLightweight()\"\n>\n <clr-alert-item>\n @if (error()) {\n <span class=\"alert-text\" role=\"alert\">{{ error()?.error
|
|
33
|
+
args: [{ selector: 'cll-alert', standalone: true, imports: [ClarityModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<clr-alert\n [clrAlertType]=\"alertType()\"\n [clrAlertSizeSmall]=\"isSmall()\"\n [clrAlertAppLevel]=\"isAppLevel()\"\n [clrAlertLightweight]=\"isLightweight()\"\n>\n <clr-alert-item>\n @if (error()) {\n <span class=\"alert-text\" role=\"alert\">{{ error()?.error?.message || error()?.message }}</span>\n }\n @if (content()) {\n <span class=\"alert-text\" role=\"alert\" [innerHTML]=\"content()\"></span>\n }\n\n @if (!error() && !content()) {\n <span class=\"alert-text\" role=\"alert\">\n <ng-content></ng-content>\n </span>\n }\n </clr-alert-item>\n</clr-alert>\n", styles: [":host{display:block}:host .alert-text{word-break:break-all}\n"] }]
|
|
34
34
|
}] });
|
|
35
35
|
|
|
36
36
|
class AlertService {
|
|
@@ -1261,6 +1261,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImpor
|
|
|
1261
1261
|
args: [{ selector: 'cll-status-indicator', standalone: true, imports: [CommonModule, ClarityModule, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span [ngSwitch]=\"iconStatus()\" class=\"status-container\">\n <cds-icon\n *ngSwitchCase=\"'success'\"\n shape=\"success-standard\"\n status=\"success\"\n [attr.size]=\"iconSize()\"\n [attr.aria-label]=\"'status-indicator.success' | translate\"\n />\n <cds-icon\n *ngSwitchCase=\"'error'\"\n shape=\"error-standard\"\n status=\"danger\"\n [attr.size]=\"iconSize()\"\n [attr.aria-label]=\"'status-indicator.error' | translate\"\n />\n <cds-icon\n *ngSwitchCase=\"'pending'\"\n shape=\"sync\"\n status=\"info\"\n [attr.size]=\"iconSize()\"\n [attr.aria-label]=\"'status-indicator.pending' | translate\"\n />\n <cds-icon\n *ngSwitchCase=\"'warning'\"\n shape=\"warning-standard\"\n status=\"warning\"\n [attr.size]=\"iconSize()\"\n [attr.aria-label]=\"'status-indicator.warning' | translate\"\n />\n <cds-icon\n *ngSwitchCase=\"'inactive'\"\n shape=\"disconnect\"\n status=\"danger\"\n [attr.size]=\"iconSize()\"\n [attr.aria-label]=\"'status-indicator.inactive' | translate\"\n />\n <cds-icon\n *ngSwitchDefault\n shape=\"unknown-status\"\n [attr.size]=\"iconSize()\"\n [attr.aria-label]=\"'status-indicator.unknown' | translate\"\n />\n\n <ng-content></ng-content>\n</span>\n", styles: [".status-container{display:inline-flex;gap:.5rem;align-items:center}\n"] }]
|
|
1262
1262
|
}], ctorParameters: () => [] });
|
|
1263
1263
|
|
|
1264
|
+
class ThemeService {
|
|
1265
|
+
constructor() {
|
|
1266
|
+
this.theme = signal('light');
|
|
1267
|
+
this.initTheme();
|
|
1268
|
+
}
|
|
1269
|
+
setTheme(newTheme) {
|
|
1270
|
+
this.theme.set(newTheme);
|
|
1271
|
+
localStorage['cds-theme'] = newTheme;
|
|
1272
|
+
document.body.setAttribute('cds-theme', newTheme);
|
|
1273
|
+
}
|
|
1274
|
+
initTheme() {
|
|
1275
|
+
const themeInUse = localStorage['cds-theme'];
|
|
1276
|
+
if (themeInUse) {
|
|
1277
|
+
this.theme.set(themeInUse);
|
|
1278
|
+
document.body.setAttribute('cds-theme', themeInUse);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1282
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ThemeService, providedIn: 'root' }); }
|
|
1283
|
+
}
|
|
1284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ThemeService, decorators: [{
|
|
1285
|
+
type: Injectable,
|
|
1286
|
+
args: [{
|
|
1287
|
+
providedIn: 'root',
|
|
1288
|
+
}]
|
|
1289
|
+
}], ctorParameters: () => [] });
|
|
1290
|
+
|
|
1264
1291
|
const themeToggleTranslations = {
|
|
1265
1292
|
en: {
|
|
1266
1293
|
dark: 'Dark',
|
|
@@ -1335,10 +1362,11 @@ ClarityIcons.addIcons(sunIcon);
|
|
|
1335
1362
|
class ThemeToggleComponent {
|
|
1336
1363
|
constructor() {
|
|
1337
1364
|
this.translationService = inject(TranslationService);
|
|
1365
|
+
this.themeService = inject(ThemeService);
|
|
1338
1366
|
this.lang = input('');
|
|
1339
1367
|
this.changeTheme = output();
|
|
1340
1368
|
this.hovering = signal(false);
|
|
1341
|
-
this.theme =
|
|
1369
|
+
this.theme = this.themeService.theme;
|
|
1342
1370
|
this.themeDisplayName = computed(() => {
|
|
1343
1371
|
return this.translationService.translate(this.theme() === 'light' ? 'theme-toggle.dark' : 'theme-toggle.light', this.lang());
|
|
1344
1372
|
});
|
|
@@ -1352,23 +1380,12 @@ class ThemeToggleComponent {
|
|
|
1352
1380
|
}
|
|
1353
1381
|
toggleTheme() {
|
|
1354
1382
|
const newTheme = this.theme() === 'light' ? 'dark' : 'light';
|
|
1355
|
-
this.setTheme(newTheme);
|
|
1383
|
+
this.themeService.setTheme(newTheme);
|
|
1384
|
+
this.changeTheme.emit(newTheme);
|
|
1356
1385
|
}
|
|
1357
1386
|
setHovering(value) {
|
|
1358
1387
|
this.hovering.set(value);
|
|
1359
1388
|
}
|
|
1360
|
-
setTheme(newTheme) {
|
|
1361
|
-
this.theme.set(newTheme);
|
|
1362
|
-
localStorage['cds-theme'] = newTheme;
|
|
1363
|
-
document.body.setAttribute('cds-theme', newTheme);
|
|
1364
|
-
this.changeTheme.emit(newTheme);
|
|
1365
|
-
}
|
|
1366
|
-
ngOnInit() {
|
|
1367
|
-
const themeInUsing = localStorage['cds-theme'];
|
|
1368
|
-
if (themeInUsing) {
|
|
1369
|
-
this.setTheme(themeInUsing);
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
1389
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: ThemeToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1373
1390
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.2", type: ThemeToggleComponent, isStandalone: true, selector: "cll-theme-toggle", inputs: { lang: { classPropertyName: "lang", publicName: "lang", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeTheme: "changeTheme" }, ngImport: i0, template: "<button\n cds-layout=\"m:none\"\n class=\"btn btn-link nav-link\"\n [attr.aria-label]=\"ariaLabel()\"\n (click)=\"toggleTheme()\"\n (mouseenter)=\"setHovering(true)\"\n (mouseleave)=\"setHovering(false)\"\n>\n <cds-icon\n size=\"md\"\n class=\"theme-toggle\"\n [attr.shape]=\"iconShape()\"\n [attr.inverse]=\"hovering()\"\n [attr.solid]=\"hovering()\"\n />\n {{ themeDisplayName() }}\n</button>\n", styles: [":host{display:flex;align-items:center}:host cds-icon.theme-toggle,:host button:hover cds-icon.theme-toggle{color:#e3eaed}\n"], dependencies: [{ kind: "ngmodule", type: ClarityModule }, { kind: "directive", type: i1.CdsIconCustomTag, selector: "cds-icon" }] }); }
|
|
1374
1391
|
}
|
|
@@ -3053,5 +3070,5 @@ function extractFilterInfo(state) {
|
|
|
3053
3070
|
* Generated bundle index. Do not edit.
|
|
3054
3071
|
*/
|
|
3055
3072
|
|
|
3056
|
-
export { AlertComponent, AlertContainerComponent, AlertService, CalloutComponent, CertificateSignpostComponent, FileReaderComponent, KeyValueInputsComponent, PageContainerComponent, SpinnerComponent, StatusIndicatorComponent, ThemeToggleComponent, TimelineBaseComponent, TimelineWizardComponent, TimelineWizardService, ToastComponent, ToastContainerComponent, ToastService, TooltipComponent, TooltipDirective, TooltipModule, certificateValidator, convertToHttpParams, dgState };
|
|
3073
|
+
export { AlertComponent, AlertContainerComponent, AlertService, CalloutComponent, CertificateSignpostComponent, FileReaderComponent, KeyValueInputsComponent, PageContainerComponent, SpinnerComponent, StatusIndicatorComponent, ThemeService, ThemeToggleComponent, TimelineBaseComponent, TimelineWizardComponent, TimelineWizardService, ToastComponent, ToastContainerComponent, ToastService, TooltipComponent, TooltipDirective, TooltipModule, certificateValidator, convertToHttpParams, dgState };
|
|
3057
3074
|
//# sourceMappingURL=clr-lift.mjs.map
|