@coreui/angular-pro 5.0.0-alpha.6 → 5.0.0-alpha.8

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.
Files changed (29) hide show
  1. package/esm2022/lib/avatar/avatar.component.mjs +5 -6
  2. package/esm2022/lib/grid/row.directive.mjs +4 -4
  3. package/esm2022/lib/header/header/header.component.mjs +4 -4
  4. package/esm2022/lib/services/color-mode.service.mjs +79 -0
  5. package/esm2022/lib/services/in-memory-storage.service.mjs +33 -0
  6. package/esm2022/lib/services/local-storage.service.mjs +47 -0
  7. package/esm2022/lib/services/public_api.mjs +4 -1
  8. package/esm2022/lib/sidebar/public_api.mjs +2 -2
  9. package/esm2022/lib/sidebar/sidebar-toggler/sidebar-toggler.directive.mjs +39 -0
  10. package/esm2022/lib/sidebar/sidebar.module.mjs +6 -6
  11. package/esm2022/lib/utilities/public_api.mjs +4 -3
  12. package/esm2022/lib/utilities/shadow-on-scroll.directive.mjs +48 -0
  13. package/esm2022/lib/utilities/utilities.module.mjs +5 -29
  14. package/fesm2022/coreui-angular-pro.mjs +257 -89
  15. package/fesm2022/coreui-angular-pro.mjs.map +1 -1
  16. package/lib/avatar/avatar.component.d.ts +1 -1
  17. package/lib/services/color-mode.service.d.ts +17 -0
  18. package/lib/services/in-memory-storage.service.d.ts +13 -0
  19. package/lib/services/local-storage.service.d.ts +18 -0
  20. package/lib/services/public_api.d.ts +3 -0
  21. package/lib/sidebar/public_api.d.ts +1 -1
  22. package/lib/sidebar/sidebar-toggler/sidebar-toggler.directive.d.ts +9 -0
  23. package/lib/sidebar/sidebar.module.d.ts +2 -2
  24. package/lib/utilities/public_api.d.ts +3 -2
  25. package/lib/utilities/shadow-on-scroll.directive.d.ts +8 -0
  26. package/lib/utilities/utilities.module.d.ts +7 -6
  27. package/package.json +2 -2
  28. package/esm2022/lib/sidebar/sidebar-toggler/sidebar-toggler.component.mjs +0 -36
  29. package/lib/sidebar/sidebar-toggler/sidebar-toggler.component.d.ts +0 -8
@@ -1,14 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Input, ElementRef, inject, Renderer2, booleanAttribute, NgModule, HostBinding, Injectable, Component, EventEmitter, Output, ContentChildren, HostListener, RendererFactory2, DestroyRef, Pipe, signal, computed, numberAttribute, ViewChildren, PLATFORM_ID, Inject, ViewChild, forwardRef, Optional, ContentChild, ChangeDetectionStrategy, NgZone, effect, TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import { Directive, Input, ElementRef, inject, Renderer2, booleanAttribute, NgModule, HostBinding, Injectable, Component, EventEmitter, Output, ContentChildren, HostListener, DestroyRef, signal, effect, RendererFactory2, Pipe, computed, numberAttribute, ViewChildren, PLATFORM_ID, Inject, ViewChild, forwardRef, Optional, ContentChild, ChangeDetectionStrategy, NgZone, TemplateRef, ViewContainerRef } from '@angular/core';
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
4
4
  import * as i3 from '@angular/common';
5
- import { NgTemplateOutlet, NgIf, NgClass, DOCUMENT, NgForOf, AsyncPipe, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, isPlatformServer, CommonModule, formatDate, I18nPluralPipe, isPlatformBrowser, JsonPipe } from '@angular/common';
5
+ import { NgTemplateOutlet, NgIf, DOCUMENT, NgClass, NgForOf, AsyncPipe, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, isPlatformServer, isPlatformBrowser, CommonModule, formatDate, I18nPluralPipe, JsonPipe } from '@angular/common';
6
6
  import * as i1 from '@angular/animations';
7
7
  import { animate, animation, style, useAnimation, state, transition, trigger, query, group } from '@angular/animations';
8
- import { Subject, BehaviorSubject, Observable, fromEvent, skip, distinctUntilChanged as distinctUntilChanged$1, map as map$1, debounceTime as debounceTime$1 } from 'rxjs';
8
+ import { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';
9
+ import { fromEvent, Subject, BehaviorSubject, Observable, skip, distinctUntilChanged as distinctUntilChanged$1, map as map$1, debounceTime as debounceTime$1 } from 'rxjs';
9
10
  import * as i1$1 from '@angular/router';
10
- import { RouterModule, NavigationEnd, RouterLink } from '@angular/router';
11
- import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
11
+ import { RouterModule, NavigationEnd, ActivatedRoute, RouterLink } from '@angular/router';
12
12
  import { filter, tap, distinctUntilChanged, take, finalize, withLatestFrom, zipWith, debounceTime, map, delay, combineLatestWith } from 'rxjs/operators';
13
13
  import * as i1$2 from '@angular/cdk/a11y';
14
14
  import { FocusMonitor, A11yModule, FocusKeyManager } from '@angular/cdk/a11y';
@@ -979,6 +979,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
979
979
  }]
980
980
  }] });
981
981
 
982
+ class AlignDirective {
983
+ get hostClasses() {
984
+ return {
985
+ [`align-${this.align}`]: !!this.align,
986
+ };
987
+ }
988
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AlignDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
989
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: AlignDirective, isStandalone: true, selector: "[cAlign]", inputs: { align: ["cAlign", "align"] }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 }); }
990
+ }
991
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AlignDirective, decorators: [{
992
+ type: Directive,
993
+ args: [{
994
+ selector: '[cAlign]',
995
+ standalone: true
996
+ }]
997
+ }], propDecorators: { align: [{
998
+ type: Input,
999
+ args: ['cAlign']
1000
+ }], hostClasses: [{
1001
+ type: HostBinding,
1002
+ args: ['class']
1003
+ }] } });
1004
+
982
1005
  class BgColorDirective {
983
1006
  get hostClasses() {
984
1007
  return {
@@ -1076,37 +1099,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
1076
1099
  args: ['class']
1077
1100
  }] } });
1078
1101
 
1079
- class TextColorDirective {
1080
- get hostClasses() {
1081
- const color = this.color;
1082
- return {
1083
- [`text-${color}`]: !!color
1084
- };
1085
- }
1086
- constructor() {
1087
- /**
1088
- * Set text-color of element
1089
- * @type TextColors
1090
- */
1091
- this.color = '';
1092
- }
1093
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TextColorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1094
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: TextColorDirective, isStandalone: true, selector: "[cTextColor]", inputs: { color: ["cTextColor", "color"] }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 }); }
1095
- }
1096
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TextColorDirective, decorators: [{
1097
- type: Directive,
1098
- args: [{
1099
- selector: '[cTextColor]',
1100
- standalone: true
1101
- }]
1102
- }], ctorParameters: () => [], propDecorators: { color: [{
1103
- type: Input,
1104
- args: ['cTextColor']
1105
- }], hostClasses: [{
1106
- type: HostBinding,
1107
- args: ['class']
1108
- }] } });
1109
-
1110
1102
  class RoundedDirective {
1111
1103
  constructor() {
1112
1104
  /**
@@ -1171,59 +1163,90 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
1171
1163
  args: ['class']
1172
1164
  }] } });
1173
1165
 
1174
- class AlignDirective {
1166
+ class ShadowOnScrollDirective {
1167
+ #destroyRef = inject(DestroyRef);
1168
+ #document = inject(DOCUMENT);
1169
+ #elementRef = inject(ElementRef);
1170
+ #scrolled = signal(false);
1171
+ #scrollEffect = effect(() => {
1172
+ this.#elementRef.nativeElement.classList.toggle(this.#shadowClass, this.#scrolled());
1173
+ });
1174
+ #observable;
1175
+ #shadowClass = 'shadow-sm';
1176
+ constructor() {
1177
+ this.#destroyRef.onDestroy(() => {
1178
+ this.#scrollEffect?.destroy();
1179
+ });
1180
+ }
1181
+ set cShadowOnScroll(value) {
1182
+ this.#scrolled.set(false);
1183
+ if (value) {
1184
+ this.#shadowClass = value === true ? 'shadow' : `shadow-${value}`;
1185
+ this.#observable = fromEvent(this.#document, 'scroll')
1186
+ .pipe(takeUntilDestroyed(this.#destroyRef))
1187
+ .subscribe(scrolled => {
1188
+ this.#scrolled.set(this.#document.documentElement.scrollTop > 0);
1189
+ });
1190
+ }
1191
+ else {
1192
+ this.#observable?.unsubscribe();
1193
+ }
1194
+ }
1195
+ ;
1196
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ShadowOnScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1197
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: ShadowOnScrollDirective, isStandalone: true, selector: "[cShadowOnScroll]", inputs: { cShadowOnScroll: "cShadowOnScroll" }, ngImport: i0 }); }
1198
+ }
1199
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ShadowOnScrollDirective, decorators: [{
1200
+ type: Directive,
1201
+ args: [{
1202
+ selector: '[cShadowOnScroll]',
1203
+ standalone: true
1204
+ }]
1205
+ }], ctorParameters: () => [], propDecorators: { cShadowOnScroll: [{
1206
+ type: Input
1207
+ }] } });
1208
+
1209
+ class TextColorDirective {
1175
1210
  get hostClasses() {
1211
+ const color = this.color;
1176
1212
  return {
1177
- [`align-${this.align}`]: !!this.align,
1213
+ [`text-${color}`]: !!color
1178
1214
  };
1179
1215
  }
1180
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AlignDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1181
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: AlignDirective, isStandalone: true, selector: "[cAlign]", inputs: { align: ["cAlign", "align"] }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 }); }
1216
+ constructor() {
1217
+ /**
1218
+ * Set text-color of element
1219
+ * @type TextColors
1220
+ */
1221
+ this.color = '';
1222
+ }
1223
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TextColorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1224
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: TextColorDirective, isStandalone: true, selector: "[cTextColor]", inputs: { color: ["cTextColor", "color"] }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 }); }
1182
1225
  }
1183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AlignDirective, decorators: [{
1226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TextColorDirective, decorators: [{
1184
1227
  type: Directive,
1185
1228
  args: [{
1186
- selector: '[cAlign]',
1229
+ selector: '[cTextColor]',
1187
1230
  standalone: true
1188
1231
  }]
1189
- }], propDecorators: { align: [{
1232
+ }], ctorParameters: () => [], propDecorators: { color: [{
1190
1233
  type: Input,
1191
- args: ['cAlign']
1234
+ args: ['cTextColor']
1192
1235
  }], hostClasses: [{
1193
1236
  type: HostBinding,
1194
1237
  args: ['class']
1195
1238
  }] } });
1196
1239
 
1240
+ const UTILITY_DIRECTIVES = [AlignDirective, BgColorDirective, BorderDirective, RoundedDirective, ShadowOnScrollDirective, TextColorDirective];
1197
1241
  class UtilitiesModule {
1198
1242
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UtilitiesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1199
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: UtilitiesModule, imports: [BgColorDirective,
1200
- BorderDirective,
1201
- RoundedDirective,
1202
- TextColorDirective,
1203
- AlignDirective], exports: [BgColorDirective,
1204
- BorderDirective,
1205
- RoundedDirective,
1206
- TextColorDirective,
1207
- AlignDirective] }); }
1243
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: UtilitiesModule, imports: [AlignDirective, BgColorDirective, BorderDirective, RoundedDirective, ShadowOnScrollDirective, TextColorDirective], exports: [AlignDirective, BgColorDirective, BorderDirective, RoundedDirective, ShadowOnScrollDirective, TextColorDirective] }); }
1208
1244
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UtilitiesModule }); }
1209
1245
  }
1210
1246
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UtilitiesModule, decorators: [{
1211
1247
  type: NgModule,
1212
1248
  args: [{
1213
- imports: [
1214
- BgColorDirective,
1215
- BorderDirective,
1216
- RoundedDirective,
1217
- TextColorDirective,
1218
- AlignDirective
1219
- ],
1220
- exports: [
1221
- BgColorDirective,
1222
- BorderDirective,
1223
- RoundedDirective,
1224
- TextColorDirective,
1225
- AlignDirective
1226
- ]
1249
+ imports: [...UTILITY_DIRECTIVES], exports: [...UTILITY_DIRECTIVES]
1227
1250
  }]
1228
1251
  }] });
1229
1252
 
@@ -1250,17 +1273,16 @@ class AvatarComponent {
1250
1273
  };
1251
1274
  }
1252
1275
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1253
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: AvatarComponent, isStandalone: true, selector: "c-avatar", inputs: { color: "color", shape: "shape", size: "size", src: "src", status: "status", textColor: "textColor" }, host: { properties: { "class": "this.hostClasses" } }, hostDirectives: [{ directive: TextColorDirective, inputs: ["cTextColor", "textColor"] }], ngImport: i0, template: "<ng-container>\n <ng-container *ngTemplateOutlet=\"defaultImageTemplate\"></ng-container>\n <span *ngIf=\"!!status\" [ngClass]=\"statusClass\"></span>\n</ng-container>\n\n<ng-template #defaultImageTemplate>\n <img *ngIf=\"!!src; else imageContent\" [src]=\"src\" class=\"avatar-img\" />\n <ng-template #imageContent>\n <ng-content></ng-content>\n </ng-template>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1276
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.8", type: AvatarComponent, isStandalone: true, selector: "c-avatar", inputs: { color: "color", shape: "shape", size: "size", src: "src", status: "status", textColor: "textColor" }, host: { properties: { "class": "this.hostClasses" } }, hostDirectives: [{ directive: TextColorDirective, inputs: ["cTextColor", "textColor"] }], ngImport: i0, template: "<ng-container>\n <ng-container *ngTemplateOutlet=\"defaultImageTemplate\"></ng-container>\n @if (!!status) {\n <span [ngClass]=\"statusClass\"></span>\n }\n</ng-container>\n\n<ng-template #defaultImageTemplate>\n @if (!!src) {\n <img [src]=\"src\" class=\"avatar-img\" />\n } @else {\n <ng-content></ng-content>\n }\n <ng-template #imageContent>\n <ng-content></ng-content>\n </ng-template>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
1254
1277
  }
1255
1278
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AvatarComponent, decorators: [{
1256
1279
  type: Component,
1257
1280
  args: [{ selector: 'c-avatar', standalone: true, imports: [
1258
1281
  NgTemplateOutlet,
1259
- NgClass,
1260
- NgIf
1282
+ NgClass
1261
1283
  ], hostDirectives: [{
1262
1284
  directive: TextColorDirective, inputs: ['cTextColor: textColor']
1263
- }], template: "<ng-container>\n <ng-container *ngTemplateOutlet=\"defaultImageTemplate\"></ng-container>\n <span *ngIf=\"!!status\" [ngClass]=\"statusClass\"></span>\n</ng-container>\n\n<ng-template #defaultImageTemplate>\n <img *ngIf=\"!!src; else imageContent\" [src]=\"src\" class=\"avatar-img\" />\n <ng-template #imageContent>\n <ng-content></ng-content>\n </ng-template>\n</ng-template>\n" }]
1285
+ }], template: "<ng-container>\n <ng-container *ngTemplateOutlet=\"defaultImageTemplate\"></ng-container>\n @if (!!status) {\n <span [ngClass]=\"statusClass\"></span>\n }\n</ng-container>\n\n<ng-template #defaultImageTemplate>\n @if (!!src) {\n <img [src]=\"src\" class=\"avatar-img\" />\n } @else {\n <ng-content></ng-content>\n }\n <ng-template #imageContent>\n <ng-content></ng-content>\n </ng-template>\n</ng-template>\n" }]
1264
1286
  }], ctorParameters: () => [], propDecorators: { color: [{
1265
1287
  type: Input
1266
1288
  }], shape: [{
@@ -4068,6 +4090,151 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
4068
4090
  args: [DOCUMENT]
4069
4091
  }] }, { type: i0.RendererFactory2 }] });
4070
4092
 
4093
+ class InMemoryStorageService {
4094
+ #storage = new Map();
4095
+ constructor() { }
4096
+ setItem(key, data) {
4097
+ this.#storage.set(key, JSON.stringify(data));
4098
+ }
4099
+ getItem(key) {
4100
+ return this.#storage.has(key) ? JSON.parse(this.#storage.get(key) ?? 'null') : undefined;
4101
+ }
4102
+ removeItem(key) {
4103
+ this.#storage.delete(key);
4104
+ }
4105
+ clear() {
4106
+ this.#storage.clear();
4107
+ }
4108
+ get length() {
4109
+ return this.#storage.size;
4110
+ }
4111
+ key(index) {
4112
+ return Array.from(this.#storage.keys())[index];
4113
+ }
4114
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: InMemoryStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4115
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: InMemoryStorageService, providedIn: 'root' }); }
4116
+ }
4117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: InMemoryStorageService, decorators: [{
4118
+ type: Injectable,
4119
+ args: [{
4120
+ providedIn: 'root'
4121
+ }]
4122
+ }], ctorParameters: () => [] });
4123
+
4124
+ class LocalStorageService {
4125
+ constructor(platformId, document) {
4126
+ this.platformId = platformId;
4127
+ this.document = document;
4128
+ this.#data$ = new BehaviorSubject(null);
4129
+ this.data$ = this.#data$.asObservable();
4130
+ this.localStorage = isPlatformBrowser(this.platformId) && this.document.defaultView ? this.document.defaultView?.localStorage : new InMemoryStorageService();
4131
+ }
4132
+ #data$;
4133
+ setItem(key, data) {
4134
+ this.localStorage.setItem(key, JSON.stringify(data));
4135
+ this.#data$.next({ key, data });
4136
+ }
4137
+ getItem(key) {
4138
+ const data = JSON.parse(this.localStorage.getItem(key) ?? 'null');
4139
+ this.#data$.next({ key, data });
4140
+ return data;
4141
+ }
4142
+ removeItem(key) {
4143
+ this.localStorage.removeItem(key);
4144
+ this.#data$.next({ key, data: null });
4145
+ }
4146
+ clear() {
4147
+ this.localStorage.clear();
4148
+ this.#data$.next(null);
4149
+ }
4150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LocalStorageService, deps: [{ token: PLATFORM_ID }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
4151
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LocalStorageService, providedIn: 'root' }); }
4152
+ }
4153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LocalStorageService, decorators: [{
4154
+ type: Injectable,
4155
+ args: [{
4156
+ providedIn: 'root'
4157
+ }]
4158
+ }], ctorParameters: () => [{ type: Object, decorators: [{
4159
+ type: Inject,
4160
+ args: [PLATFORM_ID]
4161
+ }] }, { type: Document, decorators: [{
4162
+ type: Inject,
4163
+ args: [DOCUMENT]
4164
+ }] }] });
4165
+
4166
+ class ColorModeService {
4167
+ #destroyRef;
4168
+ #document;
4169
+ #window;
4170
+ #activatedRoute;
4171
+ #localStorage;
4172
+ constructor() {
4173
+ this.#destroyRef = inject(DestroyRef);
4174
+ this.#document = inject(DOCUMENT);
4175
+ this.#window = this.#document.defaultView;
4176
+ this.#activatedRoute = inject(ActivatedRoute);
4177
+ this.#localStorage = inject(LocalStorageService);
4178
+ this.eventName = signal('ColorSchemeChange');
4179
+ this.localStorageItemName = signal('coreui-angular-color-scheme');
4180
+ this.localStorageItemName$ = toObservable(this.localStorageItemName);
4181
+ this.colorMode = signal('light');
4182
+ this.colorModeEffect = effect(() => {
4183
+ if (this.colorMode()) {
4184
+ this.setStoredTheme(this.localStorageItemName(), this.colorMode());
4185
+ this.setTheme(this.colorMode());
4186
+ }
4187
+ });
4188
+ this.#activatedRoute.queryParams
4189
+ .pipe(takeUntilDestroyed(this.#destroyRef), tap(params => {
4190
+ const theme = params['theme']?.match(/^[A-Za-z0-9\s]+/)[0];
4191
+ if (theme) {
4192
+ this.colorMode.set(theme);
4193
+ }
4194
+ }))
4195
+ .subscribe();
4196
+ this.localStorageItemName$
4197
+ .pipe(takeUntilDestroyed(this.#destroyRef), tap(params => {
4198
+ this.colorMode.set(this.getPreferredColorScheme(params));
4199
+ }))
4200
+ .subscribe();
4201
+ }
4202
+ getStoredTheme(localStorageItemName) {
4203
+ return this.#localStorage.getItem(localStorageItemName);
4204
+ }
4205
+ setStoredTheme(localStorageItemName, colorMode) {
4206
+ return this.#localStorage.setItem(localStorageItemName, colorMode);
4207
+ }
4208
+ getPreferredColorScheme(localStorageItemName) {
4209
+ if (this.#window === undefined) {
4210
+ return 'light';
4211
+ }
4212
+ const storedTheme = this.getStoredTheme(localStorageItemName);
4213
+ if (storedTheme) {
4214
+ return storedTheme;
4215
+ }
4216
+ return this.#window?.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
4217
+ }
4218
+ ;
4219
+ setTheme(colorMode) {
4220
+ this.#document.documentElement.dataset['coreuiTheme'] =
4221
+ colorMode === 'auto' && this.#document.defaultView?.matchMedia('(prefers-color-scheme: dark)').matches
4222
+ ? 'dark'
4223
+ : colorMode;
4224
+ const event = new Event(this.eventName());
4225
+ this.#document.documentElement.dispatchEvent(event);
4226
+ }
4227
+ ;
4228
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ColorModeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4229
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ColorModeService, providedIn: 'root' }); }
4230
+ }
4231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ColorModeService, decorators: [{
4232
+ type: Injectable,
4233
+ args: [{
4234
+ providedIn: 'root'
4235
+ }]
4236
+ }], ctorParameters: () => [] });
4237
+
4071
4238
  class CarouselService {
4072
4239
  constructor() {
4073
4240
  this.carouselIndex = new BehaviorSubject({});
@@ -8592,14 +8759,14 @@ class RowDirective {
8592
8759
  const cols = this.xs;
8593
8760
  const classes = {
8594
8761
  row: true,
8595
- [`row-cols-${cols}`]: !!cols,
8762
+ [`row-cols-${cols}`]: !!cols
8596
8763
  };
8597
8764
  Object.keys(BreakpointInfix).forEach(breakpoint => {
8598
8765
  // @ts-ignore
8599
8766
  const value = this[breakpoint];
8600
8767
  if ((typeof value === 'number') || (typeof value === 'string')) {
8601
- const infix = breakpoint === 'xs' ? '' : breakpoint;
8602
- classes[`row-cols-${infix}-${value}`] = !!value;
8768
+ const infix = breakpoint === 'xs' ? '' : `-${breakpoint}`;
8769
+ classes[`row-cols${infix}-${value}`] = !!value;
8603
8770
  }
8604
8771
  });
8605
8772
  return classes;
@@ -8759,11 +8926,11 @@ class HeaderComponent {
8759
8926
  };
8760
8927
  }
8761
8928
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8762
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: HeaderComponent, isStandalone: true, selector: "c-header, [c-header]", inputs: { container: "container", position: "position", role: "role" }, host: { properties: { "attr.role": "this.role", "class": "this.getClasses" } }, ngImport: i0, template: "<div [ngClass]=\"headerClasses\" *ngIf=\"!!container; else elseBlock\">\n <ng-content></ng-content>\n</div>\n<ng-template #elseBlock>\n <ng-content></ng-content>\n</ng-template>\n\n\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
8929
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.8", type: HeaderComponent, isStandalone: true, selector: "c-header, [c-header]", inputs: { container: "container", position: "position", role: "role" }, host: { properties: { "attr.role": "this.role", "class": "this.getClasses" } }, ngImport: i0, template: "@if (!!container) {\n <div [ngClass]=\"headerClasses\">\n <ng-content />\n </div>\n} @else {\n <ng-content />\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
8763
8930
  }
8764
8931
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: HeaderComponent, decorators: [{
8765
8932
  type: Component,
8766
- args: [{ selector: 'c-header, [c-header]', standalone: true, imports: [NgClass, NgIf], template: "<div [ngClass]=\"headerClasses\" *ngIf=\"!!container; else elseBlock\">\n <ng-content></ng-content>\n</div>\n<ng-template #elseBlock>\n <ng-content></ng-content>\n</ng-template>\n\n\n" }]
8933
+ args: [{ selector: 'c-header, [c-header]', standalone: true, imports: [NgClass], template: "@if (!!container) {\n <div [ngClass]=\"headerClasses\">\n <ng-content />\n </div>\n} @else {\n <ng-content />\n}\n" }]
8767
8934
  }], propDecorators: { container: [{
8768
8935
  type: Input
8769
8936
  }], position: [{
@@ -13550,7 +13717,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
13550
13717
  args: ['click', ['$event']]
13551
13718
  }] } });
13552
13719
 
13553
- class SidebarTogglerComponent {
13720
+ class SidebarTogglerDirective {
13554
13721
  constructor() {
13555
13722
  this.role = 'button';
13556
13723
  this.sidebarTogglerClass = true;
@@ -13559,17 +13726,18 @@ class SidebarTogglerComponent {
13559
13726
  return {
13560
13727
  appearance: 'button',
13561
13728
  'align-items': 'flex-start',
13729
+ cursor: 'pointer'
13562
13730
  };
13563
13731
  }
13564
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SidebarTogglerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13565
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: SidebarTogglerComponent, isStandalone: true, selector: "c-sidebar-toggler", inputs: { role: "role" }, host: { properties: { "attr.role": "this.role", "class.sidebar-toggler": "this.sidebarTogglerClass", "style": "this.getStyles" } }, ngImport: i0, template: ``, isInline: true }); }
13732
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SidebarTogglerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
13733
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: SidebarTogglerDirective, isStandalone: true, selector: "[cSidebarToggler]", inputs: { role: "role" }, host: { properties: { "attr.role": "this.role", "class.sidebar-toggler": "this.sidebarTogglerClass", "style": "this.getStyles" } }, hostDirectives: [{ directive: SidebarToggleDirective, inputs: ["cSidebarToggle", "cSidebarToggler", "toggle", "toggle"] }], ngImport: i0 }); }
13566
13734
  }
13567
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SidebarTogglerComponent, decorators: [{
13568
- type: Component,
13735
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: SidebarTogglerDirective, decorators: [{
13736
+ type: Directive,
13569
13737
  args: [{
13570
- selector: 'c-sidebar-toggler',
13571
- template: ``,
13572
- standalone: true
13738
+ selector: '[cSidebarToggler]',
13739
+ standalone: true,
13740
+ hostDirectives: [{ directive: SidebarToggleDirective, inputs: ['cSidebarToggle: cSidebarToggler', 'toggle'] }]
13573
13741
  }]
13574
13742
  }], propDecorators: { role: [{
13575
13743
  type: HostBinding,
@@ -14232,9 +14400,9 @@ class SidebarModule {
14232
14400
  SidebarNavLinkPipe,
14233
14401
  SidebarNavTitleComponent,
14234
14402
  SidebarToggleDirective,
14235
- SidebarTogglerComponent], exports: [SidebarComponent,
14403
+ SidebarTogglerDirective], exports: [SidebarComponent,
14236
14404
  SidebarToggleDirective,
14237
- SidebarTogglerComponent,
14405
+ SidebarTogglerDirective,
14238
14406
  SidebarBrandComponent,
14239
14407
  SidebarNavComponent,
14240
14408
  SidebarHeaderComponent,
@@ -14267,12 +14435,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
14267
14435
  SidebarNavLinkPipe,
14268
14436
  SidebarNavTitleComponent,
14269
14437
  SidebarToggleDirective,
14270
- SidebarTogglerComponent
14438
+ SidebarTogglerDirective
14271
14439
  ],
14272
14440
  exports: [
14273
14441
  SidebarComponent,
14274
14442
  SidebarToggleDirective,
14275
- SidebarTogglerComponent,
14443
+ SidebarTogglerDirective,
14276
14444
  SidebarBrandComponent,
14277
14445
  SidebarNavComponent,
14278
14446
  SidebarHeaderComponent,
@@ -17221,5 +17389,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
17221
17389
  * Generated bundle index. Do not edit.
17222
17390
  */
17223
17391
 
17224
- export { AccordionButtonDirective, AccordionComponent, AccordionItemComponent, AccordionModule, AlertComponent, AlertHeadingDirective, AlertLinkDirective, AlertModule, AlignDirective, AvatarComponent, AvatarModule, BackdropService, BadgeComponent, BadgeModule, BgColorDirective, BorderDirective, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbModule, BreadcrumbRouterComponent, BreadcrumbRouterService, BreakpointInfix, ButtonCloseDirective, ButtonDirective, ButtonGroupComponent, ButtonGroupModule, ButtonModule, ButtonToolbarComponent, CalendarComponent, CalendarModule, CalendarMonthComponent, CalendarNavigationComponent, CalloutComponent, CalloutModule, CardBodyComponent, CardComponent, CardFooterComponent, CardGroupComponent, CardHeaderActionsComponent, CardHeaderComponent, CardImgDirective, CardImgOverlayComponent, CardLinkDirective, CardModule, CardSubtitleDirective, CardTextDirective, CardTitleDirective, CarouselCaptionComponent, CarouselComponent, CarouselConfig, CarouselControlComponent, CarouselIndicatorsComponent, CarouselInnerComponent, CarouselItemComponent, CarouselModule, ClassToggleService, ColComponent, ColDirective, CollapseDirective, CollapseModule, ContainerComponent, DatePickerComponent, DatePickerModule, DateRangePickerComponent, DateRangePickerModule, DropdownCloseDirective, DropdownComponent, DropdownDividerDirective, DropdownHeaderDirective, DropdownItemDirective, DropdownItemPlainDirective, DropdownMenuDirective, DropdownModule, DropdownService, DropdownToggleDirective, ElementCoverComponent, ElementCoverModule, FooterComponent, FooterModule, FormCheckComponent, FormCheckInputDirective, FormCheckLabelDirective, FormControlDirective, FormDirective, FormFeedbackComponent, FormFloatingDirective, FormLabelDirective, FormModule, FormSelectDirective, FormTextDirective, GridModule, GutterDirective, HeaderBrandComponent, HeaderComponent, HeaderDividerComponent, HeaderModule, HeaderNavComponent, HeaderTextComponent, HeaderTogglerDirective, HtmlAttributesDirective, ImgDirective, ImgModule, InputGroupComponent, InputGroupTextDirective, IntersectionService, ListGroupDirective, ListGroupItemDirective, ListGroupModule, ListenersService, LoadingButtonComponent, LoadingButtonModule, ModalBodyComponent, ModalComponent, ModalContentComponent, ModalDialogComponent, ModalFooterComponent, ModalHeaderComponent, ModalModule, ModalService, ModalTitleDirective, ModalToggleDirective, MultiSelectComponent, MultiSelectModule, MultiSelectOptgroupComponent, MultiSelectOptgroupLabelComponent, MultiSelectOptionComponent, NavComponent, NavItemComponent, NavLinkDirective, NavModule, NavbarBrandDirective, NavbarComponent, NavbarModule, NavbarNavComponent, NavbarTextComponent, NavbarTogglerDirective, OffcanvasBodyComponent, OffcanvasComponent, OffcanvasHeaderComponent, OffcanvasModule, OffcanvasService, OffcanvasTitleDirective, OffcanvasToggleDirective, PageItemComponent, PageItemDirective, PageLinkDirective, PaginationComponent, PaginationModule, PlaceholderAnimationDirective, PlaceholderDirective, PlaceholderModule, PopoverComponent, PopoverDirective, PopoverModule, ProgressBarComponent, ProgressComponent, ProgressModule, RoundedDirective, RowComponent, RowDirective, SharedModule, SidebarBrandComponent, SidebarComponent, SidebarFooterComponent, SidebarHeaderComponent, SidebarModule, SidebarNavComponent, SidebarNavHelper, SidebarService, SidebarToggleDirective, SidebarTogglerComponent, SmartPaginationComponent, SmartPaginationModule, SmartTableComponent, SmartTableFilterComponent, SmartTableModule, SpinnerComponent, SpinnerModule, TabContentComponent, TabContentRefDirective, TabPaneComponent, TabService, TableActiveDirective, TableColorDirective, TableDirective, TableModule, TabsModule, TemplateIdDirective, TextColorDirective, ThemeDirective, TimePickerComponent, TimePickerModule, ToastBodyComponent, ToastCloseDirective, ToastComponent, ToastHeaderComponent, ToastModule, ToasterComponent, ToasterHostDirective, ToasterPlacement, ToasterService, TooltipComponent, TooltipDirective, TooltipModule, UtilitiesModule, WidgetModule, WidgetStatAComponent, WidgetStatBComponent, WidgetStatCComponent, WidgetStatDComponent, WidgetStatEComponent, WidgetStatFComponent };
17392
+ export { AccordionButtonDirective, AccordionComponent, AccordionItemComponent, AccordionModule, AlertComponent, AlertHeadingDirective, AlertLinkDirective, AlertModule, AlignDirective, AvatarComponent, AvatarModule, BackdropService, BadgeComponent, BadgeModule, BgColorDirective, BorderDirective, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbModule, BreadcrumbRouterComponent, BreadcrumbRouterService, BreakpointInfix, ButtonCloseDirective, ButtonDirective, ButtonGroupComponent, ButtonGroupModule, ButtonModule, ButtonToolbarComponent, CalendarComponent, CalendarModule, CalendarMonthComponent, CalendarNavigationComponent, CalloutComponent, CalloutModule, CardBodyComponent, CardComponent, CardFooterComponent, CardGroupComponent, CardHeaderActionsComponent, CardHeaderComponent, CardImgDirective, CardImgOverlayComponent, CardLinkDirective, CardModule, CardSubtitleDirective, CardTextDirective, CardTitleDirective, CarouselCaptionComponent, CarouselComponent, CarouselConfig, CarouselControlComponent, CarouselIndicatorsComponent, CarouselInnerComponent, CarouselItemComponent, CarouselModule, ClassToggleService, ColComponent, ColDirective, CollapseDirective, CollapseModule, ColorModeService, ContainerComponent, DatePickerComponent, DatePickerModule, DateRangePickerComponent, DateRangePickerModule, DropdownCloseDirective, DropdownComponent, DropdownDividerDirective, DropdownHeaderDirective, DropdownItemDirective, DropdownItemPlainDirective, DropdownMenuDirective, DropdownModule, DropdownService, DropdownToggleDirective, ElementCoverComponent, ElementCoverModule, FooterComponent, FooterModule, FormCheckComponent, FormCheckInputDirective, FormCheckLabelDirective, FormControlDirective, FormDirective, FormFeedbackComponent, FormFloatingDirective, FormLabelDirective, FormModule, FormSelectDirective, FormTextDirective, GridModule, GutterDirective, HeaderBrandComponent, HeaderComponent, HeaderDividerComponent, HeaderModule, HeaderNavComponent, HeaderTextComponent, HeaderTogglerDirective, HtmlAttributesDirective, ImgDirective, ImgModule, InMemoryStorageService, InputGroupComponent, InputGroupTextDirective, IntersectionService, ListGroupDirective, ListGroupItemDirective, ListGroupModule, ListenersService, LoadingButtonComponent, LoadingButtonModule, LocalStorageService, ModalBodyComponent, ModalComponent, ModalContentComponent, ModalDialogComponent, ModalFooterComponent, ModalHeaderComponent, ModalModule, ModalService, ModalTitleDirective, ModalToggleDirective, MultiSelectComponent, MultiSelectModule, MultiSelectOptgroupComponent, MultiSelectOptgroupLabelComponent, MultiSelectOptionComponent, NavComponent, NavItemComponent, NavLinkDirective, NavModule, NavbarBrandDirective, NavbarComponent, NavbarModule, NavbarNavComponent, NavbarTextComponent, NavbarTogglerDirective, OffcanvasBodyComponent, OffcanvasComponent, OffcanvasHeaderComponent, OffcanvasModule, OffcanvasService, OffcanvasTitleDirective, OffcanvasToggleDirective, PageItemComponent, PageItemDirective, PageLinkDirective, PaginationComponent, PaginationModule, PlaceholderAnimationDirective, PlaceholderDirective, PlaceholderModule, PopoverComponent, PopoverDirective, PopoverModule, ProgressBarComponent, ProgressComponent, ProgressModule, RoundedDirective, RowComponent, RowDirective, ShadowOnScrollDirective, SharedModule, SidebarBrandComponent, SidebarComponent, SidebarFooterComponent, SidebarHeaderComponent, SidebarModule, SidebarNavComponent, SidebarNavHelper, SidebarService, SidebarToggleDirective, SidebarTogglerDirective, SmartPaginationComponent, SmartPaginationModule, SmartTableComponent, SmartTableFilterComponent, SmartTableModule, SpinnerComponent, SpinnerModule, TabContentComponent, TabContentRefDirective, TabPaneComponent, TabService, TableActiveDirective, TableColorDirective, TableDirective, TableModule, TabsModule, TemplateIdDirective, TextColorDirective, ThemeDirective, TimePickerComponent, TimePickerModule, ToastBodyComponent, ToastCloseDirective, ToastComponent, ToastHeaderComponent, ToastModule, ToasterComponent, ToasterHostDirective, ToasterPlacement, ToasterService, TooltipComponent, TooltipDirective, TooltipModule, UtilitiesModule, WidgetModule, WidgetStatAComponent, WidgetStatBComponent, WidgetStatCComponent, WidgetStatDComponent, WidgetStatEComponent, WidgetStatFComponent };
17225
17393
  //# sourceMappingURL=coreui-angular-pro.mjs.map