@skyux/theme 15.0.0-alpha.0 → 15.0.0-alpha.1
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/css/themes/modern/styles.css +439 -168
- package/fesm2022/skyux-theme.mjs +53 -60
- package/fesm2022/skyux-theme.mjs.map +1 -1
- package/package.json +4 -4
- package/types/skyux-theme.d.ts +83 -85
package/fesm2022/skyux-theme.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DOCUMENT, Injectable,
|
|
2
|
+
import { inject, DOCUMENT, Injectable, ElementRef, Renderer2, Input, Directive, TemplateRef, ViewContainerRef, ChangeDetectorRef, NgModule, HostBinding, NgZone, DestroyRef, makeEnvironmentProviders, provideAppInitializer, RendererFactory2 } from '@angular/core';
|
|
3
3
|
import FontFaceObserver from 'fontfaceobserver';
|
|
4
4
|
import { take, takeUntil } from 'rxjs/operators';
|
|
5
5
|
import { ReplaySubject, Subject } from 'rxjs';
|
|
@@ -429,10 +429,10 @@ class SkyThemeBrandService {
|
|
|
429
429
|
#appendToHead(renderer, el) {
|
|
430
430
|
renderer.appendChild(this.#document.head, el);
|
|
431
431
|
}
|
|
432
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
433
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
432
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeBrandService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
433
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeBrandService, providedIn: 'root' }); }
|
|
434
434
|
}
|
|
435
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
435
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeBrandService, decorators: [{
|
|
436
436
|
type: Injectable,
|
|
437
437
|
args: [{
|
|
438
438
|
providedIn: 'root',
|
|
@@ -671,20 +671,20 @@ class SkyThemeService {
|
|
|
671
671
|
currentSetting instanceof SkyThemeSpacing) &&
|
|
672
672
|
current.theme[supportedProp].includes(currentSetting)));
|
|
673
673
|
}
|
|
674
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
675
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
674
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
675
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeService }); }
|
|
676
676
|
}
|
|
677
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
677
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeService, decorators: [{
|
|
678
678
|
type: Injectable
|
|
679
679
|
}], ctorParameters: () => [] });
|
|
680
680
|
|
|
681
681
|
class SkyAppStyleLoader {
|
|
682
|
-
|
|
683
|
-
#themeSvc;
|
|
684
|
-
constructor(themeSvc) {
|
|
682
|
+
constructor() {
|
|
685
683
|
this.isLoaded = false;
|
|
686
|
-
this.#themeSvc =
|
|
684
|
+
this.#themeSvc = inject(SkyThemeService, { optional: true });
|
|
687
685
|
}
|
|
686
|
+
static { this.LOAD_TIMEOUT = 3000; }
|
|
687
|
+
#themeSvc;
|
|
688
688
|
loadStyles() {
|
|
689
689
|
if (this.isLoaded) {
|
|
690
690
|
return Promise.resolve();
|
|
@@ -712,17 +712,15 @@ class SkyAppStyleLoader {
|
|
|
712
712
|
});
|
|
713
713
|
});
|
|
714
714
|
}
|
|
715
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
716
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
715
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyAppStyleLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
716
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyAppStyleLoader, providedIn: 'root' }); }
|
|
717
717
|
}
|
|
718
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyAppStyleLoader, decorators: [{
|
|
719
719
|
type: Injectable,
|
|
720
720
|
args: [{
|
|
721
721
|
providedIn: 'root',
|
|
722
722
|
}]
|
|
723
|
-
}]
|
|
724
|
-
type: Optional
|
|
725
|
-
}] }] });
|
|
723
|
+
}] });
|
|
726
724
|
|
|
727
725
|
/**
|
|
728
726
|
* Component to add classes conditionally based on the current theme.
|
|
@@ -765,11 +763,10 @@ class SkyThemeClassDirective {
|
|
|
765
763
|
#ngUnsubscribe = new Subject();
|
|
766
764
|
#initialClasses = [];
|
|
767
765
|
#skyThemeClassMap;
|
|
768
|
-
#ngEl;
|
|
769
|
-
#renderer;
|
|
770
|
-
constructor(
|
|
771
|
-
|
|
772
|
-
this.#renderer = renderer;
|
|
766
|
+
#ngEl = inject(ElementRef);
|
|
767
|
+
#renderer = inject(Renderer2);
|
|
768
|
+
constructor() {
|
|
769
|
+
const themeSvc = inject(SkyThemeService, { optional: true });
|
|
773
770
|
if (themeSvc) {
|
|
774
771
|
themeSvc.settingsChange
|
|
775
772
|
.pipe(takeUntil(this.#ngUnsubscribe))
|
|
@@ -822,18 +819,16 @@ class SkyThemeClassDirective {
|
|
|
822
819
|
});
|
|
823
820
|
}
|
|
824
821
|
}
|
|
825
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
826
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
822
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeClassDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
823
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: SkyThemeClassDirective, isStandalone: false, selector: "[skyThemeClass]", inputs: { class: "class", skyThemeClass: "skyThemeClass" }, ngImport: i0 }); }
|
|
827
824
|
}
|
|
828
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
825
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeClassDirective, decorators: [{
|
|
829
826
|
type: Directive,
|
|
830
827
|
args: [{
|
|
831
828
|
selector: '[skyThemeClass]',
|
|
832
829
|
standalone: false,
|
|
833
830
|
}]
|
|
834
|
-
}], ctorParameters: () => [
|
|
835
|
-
type: Optional
|
|
836
|
-
}] }], propDecorators: { class: [{
|
|
831
|
+
}], ctorParameters: () => [], propDecorators: { class: [{
|
|
837
832
|
type: Input
|
|
838
833
|
}], skyThemeClass: [{
|
|
839
834
|
type: Input
|
|
@@ -858,12 +853,12 @@ class SkyThemeIfDirective {
|
|
|
858
853
|
#currentTheme;
|
|
859
854
|
#ngUnsubscribe = new Subject();
|
|
860
855
|
#hasView = false;
|
|
861
|
-
#templateRef;
|
|
862
|
-
#viewContainer;
|
|
863
|
-
constructor(
|
|
864
|
-
|
|
865
|
-
this.#viewContainer = viewContainer;
|
|
856
|
+
#templateRef = inject((TemplateRef));
|
|
857
|
+
#viewContainer = inject(ViewContainerRef);
|
|
858
|
+
constructor() {
|
|
859
|
+
const themeSvc = inject(SkyThemeService, { optional: true });
|
|
866
860
|
if (themeSvc) {
|
|
861
|
+
const changeDetector = inject(ChangeDetectorRef);
|
|
867
862
|
themeSvc.settingsChange
|
|
868
863
|
.pipe(takeUntil(this.#ngUnsubscribe))
|
|
869
864
|
.subscribe((settingsChange) => {
|
|
@@ -893,18 +888,16 @@ class SkyThemeIfDirective {
|
|
|
893
888
|
this.#hasView = false;
|
|
894
889
|
}
|
|
895
890
|
}
|
|
896
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
897
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
891
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeIfDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
892
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: SkyThemeIfDirective, isStandalone: false, selector: "[skyThemeIf]", inputs: { skyThemeIf: "skyThemeIf" }, ngImport: i0 }); }
|
|
898
893
|
}
|
|
899
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeIfDirective, decorators: [{
|
|
900
895
|
type: Directive,
|
|
901
896
|
args: [{
|
|
902
897
|
selector: '[skyThemeIf]',
|
|
903
898
|
standalone: false,
|
|
904
899
|
}]
|
|
905
|
-
}], ctorParameters: () => [
|
|
906
|
-
type: Optional
|
|
907
|
-
}] }], propDecorators: { skyThemeIf: [{
|
|
900
|
+
}], ctorParameters: () => [], propDecorators: { skyThemeIf: [{
|
|
908
901
|
type: Input
|
|
909
902
|
}] } });
|
|
910
903
|
|
|
@@ -914,6 +907,13 @@ const defaultTheme = new SkyThemeSettings(SkyTheme.presets.default, SkyThemeMode
|
|
|
914
907
|
* to have its own theme.
|
|
915
908
|
*/
|
|
916
909
|
class SkyThemeDirective {
|
|
910
|
+
constructor() {
|
|
911
|
+
this.skyThemeOrDefault = defaultTheme;
|
|
912
|
+
this.#initialized = false;
|
|
913
|
+
this.#elRef = inject(ElementRef);
|
|
914
|
+
this.#renderer = inject(Renderer2);
|
|
915
|
+
this.#themeSvc = inject(SkyThemeService);
|
|
916
|
+
}
|
|
917
917
|
set skyTheme(value) {
|
|
918
918
|
this.skyThemeOrDefault = value || defaultTheme;
|
|
919
919
|
if (this.#initialized) {
|
|
@@ -924,13 +924,6 @@ class SkyThemeDirective {
|
|
|
924
924
|
#elRef;
|
|
925
925
|
#renderer;
|
|
926
926
|
#themeSvc;
|
|
927
|
-
constructor(elRef, renderer, themeSvc) {
|
|
928
|
-
this.skyThemeOrDefault = defaultTheme;
|
|
929
|
-
this.#initialized = false;
|
|
930
|
-
this.#elRef = elRef;
|
|
931
|
-
this.#renderer = renderer;
|
|
932
|
-
this.#themeSvc = themeSvc;
|
|
933
|
-
}
|
|
934
927
|
ngOnInit() {
|
|
935
928
|
this.#themeSvc.init(this.#elRef.nativeElement, this.#renderer, this.skyThemeOrDefault);
|
|
936
929
|
this.#initialized = true;
|
|
@@ -938,28 +931,28 @@ class SkyThemeDirective {
|
|
|
938
931
|
ngOnDestroy() {
|
|
939
932
|
this.#themeSvc.destroy();
|
|
940
933
|
}
|
|
941
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
942
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
934
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
935
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: SkyThemeDirective, isStandalone: false, selector: "[skyTheme]", inputs: { skyTheme: "skyTheme" }, providers: [SkyThemeService], ngImport: i0 }); }
|
|
943
936
|
}
|
|
944
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
937
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeDirective, decorators: [{
|
|
945
938
|
type: Directive,
|
|
946
939
|
args: [{
|
|
947
940
|
selector: '[skyTheme]',
|
|
948
941
|
providers: [SkyThemeService],
|
|
949
942
|
standalone: false,
|
|
950
943
|
}]
|
|
951
|
-
}],
|
|
944
|
+
}], propDecorators: { skyTheme: [{
|
|
952
945
|
type: Input
|
|
953
946
|
}] } });
|
|
954
947
|
|
|
955
948
|
class SkyThemeModule {
|
|
956
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
957
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.
|
|
949
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
950
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeModule, declarations: [SkyThemeClassDirective,
|
|
958
951
|
SkyThemeDirective,
|
|
959
952
|
SkyThemeIfDirective], exports: [SkyThemeClassDirective, SkyThemeDirective, SkyThemeIfDirective] }); }
|
|
960
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.
|
|
953
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeModule }); }
|
|
961
954
|
}
|
|
962
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
955
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeModule, decorators: [{
|
|
963
956
|
type: NgModule,
|
|
964
957
|
args: [{
|
|
965
958
|
declarations: [
|
|
@@ -985,10 +978,10 @@ class SkyThemeComponentClassDirective {
|
|
|
985
978
|
this.#changeDetector.markForCheck();
|
|
986
979
|
});
|
|
987
980
|
}
|
|
988
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
989
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
981
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeComponentClassDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
982
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: SkyThemeComponentClassDirective, isStandalone: true, selector: "[skyThemeClass]", host: { properties: { "class": "this.theme" } }, ngImport: i0 }); }
|
|
990
983
|
}
|
|
991
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyThemeComponentClassDirective, decorators: [{
|
|
992
985
|
type: Directive,
|
|
993
986
|
args: [{
|
|
994
987
|
selector: '[skyThemeClass]',
|
|
@@ -1142,10 +1135,10 @@ class SkyAppViewportService {
|
|
|
1142
1135
|
}
|
|
1143
1136
|
return false;
|
|
1144
1137
|
}
|
|
1145
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
1146
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
1138
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyAppViewportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1139
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyAppViewportService, providedIn: 'root' }); }
|
|
1147
1140
|
}
|
|
1148
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
1141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SkyAppViewportService, decorators: [{
|
|
1149
1142
|
type: Injectable,
|
|
1150
1143
|
args: [{
|
|
1151
1144
|
providedIn: 'root',
|