@tolle_/tolle-ui 0.0.1-beta → 0.0.3-beta

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.
@@ -0,0 +1,82 @@
1
+ import { Injectable, Inject, PLATFORM_ID, Optional } from '@angular/core';
2
+ import { DOCUMENT, isPlatformBrowser } from '@angular/common';
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import { TOLLE_CONFIG } from './tolle-config';
5
+ import * as i0 from "@angular/core";
6
+ export class ThemeService {
7
+ document;
8
+ platformId;
9
+ config;
10
+ renderer;
11
+ isDarkSubject = new BehaviorSubject(false);
12
+ isDark$ = this.isDarkSubject.asObservable();
13
+ constructor(document, platformId, config, rendererFactory) {
14
+ this.document = document;
15
+ this.platformId = platformId;
16
+ this.config = config;
17
+ this.renderer = rendererFactory.createRenderer(null, null);
18
+ this.initializeTheme();
19
+ }
20
+ initializeTheme() {
21
+ if (!isPlatformBrowser(this.platformId))
22
+ return;
23
+ // 1. Determine Initial Mode (Dark/Light)
24
+ const savedTheme = localStorage.getItem('tolle-theme');
25
+ const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
26
+ // Priority: Saved Preference > Config Default > System Preference
27
+ const shouldBeDark = savedTheme
28
+ ? savedTheme === 'dark'
29
+ : (this.config?.darkByDefault ?? prefersDark);
30
+ if (shouldBeDark) {
31
+ this.enableDarkMode();
32
+ }
33
+ else {
34
+ this.disableDarkMode();
35
+ }
36
+ // 2. Apply Brand Config (Colors/Radius)
37
+ if (this.config) {
38
+ this.applyBrandConfig(this.config);
39
+ }
40
+ }
41
+ applyBrandConfig(config) {
42
+ const root = this.document.documentElement;
43
+ if (config.primaryColor) {
44
+ this.renderer.setStyle(root, '--primary', config.primaryColor);
45
+ }
46
+ if (config.radius) {
47
+ this.renderer.setStyle(root, '--radius', config.radius);
48
+ }
49
+ }
50
+ toggleTheme() {
51
+ const isDark = this.document.documentElement.classList.contains('dark');
52
+ isDark ? this.disableDarkMode() : this.enableDarkMode();
53
+ }
54
+ enableDarkMode() {
55
+ this.renderer.addClass(this.document.documentElement, 'dark');
56
+ localStorage.setItem('tolle-theme', 'dark');
57
+ this.isDarkSubject.next(true);
58
+ }
59
+ disableDarkMode() {
60
+ this.renderer.removeClass(this.document.documentElement, 'dark');
61
+ localStorage.setItem('tolle-theme', 'light');
62
+ this.isDarkSubject.next(false);
63
+ }
64
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThemeService, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: TOLLE_CONFIG, optional: true }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
65
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThemeService, providedIn: 'root' });
66
+ }
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThemeService, decorators: [{
68
+ type: Injectable,
69
+ args: [{ providedIn: 'root' }]
70
+ }], ctorParameters: () => [{ type: Document, decorators: [{
71
+ type: Inject,
72
+ args: [DOCUMENT]
73
+ }] }, { type: Object, decorators: [{
74
+ type: Inject,
75
+ args: [PLATFORM_ID]
76
+ }] }, { type: undefined, decorators: [{
77
+ type: Optional
78
+ }, {
79
+ type: Inject,
80
+ args: [TOLLE_CONFIG]
81
+ }] }, { type: i0.RendererFactory2 }] });
82
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlbWUuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3RvbGxlL3NyYy9saWIvdGhlbWUuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxXQUFXLEVBQUUsUU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W5kZXJlci5zZXRTdHlsZShyb290LCAnLS1wcmltYXJ5JywgY29uZmlnLnByaW1hcnlDb2xvcik7XG4gICAgfVxuICAgIGlmIChjb25maWcucmFkaXVzKSB7XG4gICAgICB0aGlzLnJlbmRlcmVyLnNldFN0eWxlKHJvb3QsICctLXJhZGl1cycsIGNvbmZpZy5yYWRpdXMpO1xuICAgIH1cbiAgfVxuXG4gIHRvZ2dsZVRoZW1lKCkge1xuICAgIGNvbnN0IGlzRGFyayA9IHRoaXMuZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmNsYXNzTGlzdC5jb250YWlucygnZGFyaycpO1xuICAgIGlzRGFyayA/IHRoaXMuZGlzYWJsZURhcmtNb2RlKCkgOiB0aGlzLmVuYWJsZURhcmtNb2RlKCk7XG4gIH1cblxuICBwcml2YXRlIGVuYWJsZURhcmtNb2RlKCkge1xuICAgIHRoaXMucmVuZGVyZXIuYWRkQ2xhc3ModGhpcy5kb2N1bWVudC5kb2N1bWVudEVsZW1lbnQsICdkYXJrJyk7XG4gICAgbG9jYWxTdG9yYWdlLnNldEl0ZW0oJ3RvbGxlLXRoZW1lJywgJ2RhcmsnKTtcbiAgICB0aGlzLmlzRGFya1N1YmplY3QubmV4dCh0cnVlKTtcbiAgfVxuXG4gIHByaXZhdGUgZGlzYWJsZURhcmtNb2RlKCkge1xuICAgIHRoaXMucmVuZGVyZXIucmVtb3ZlQ2xhc3ModGhpcy5kb2N1bWVudC5kb2N1bWVudEVsZW1lbnQsICdkYXJrJyk7XG4gICAgbG9jYWxTdG9yYWdlLnNldEl0ZW0oJ3RvbGxlLXRoZW1lJywgJ2xpZ2h0Jyk7XG4gICAgdGhpcy5pc0RhcmtTdWJqZWN0Lm5leHQoZmFsc2UpO1xuICB9XG59XG4iXX0=
@@ -1,11 +1,15 @@
1
- import { InjectionToken } from '@angular/core';
1
+ import { APP_INITIALIZER, InjectionToken } from '@angular/core';
2
+ import { ThemeService } from './theme.service';
2
3
  export const TOLLE_CONFIG = new InjectionToken('TolleConfig');
3
4
  export function provideTolleConfig(config) {
4
5
  return [
6
+ { provide: TOLLE_CONFIG, useValue: config },
5
7
  {
6
- provide: TOLLE_CONFIG,
7
- useValue: config
8
+ provide: APP_INITIALIZER,
9
+ useFactory: (themeService) => () => themeService, // Just force injection
10
+ deps: [ThemeService],
11
+ multi: true
8
12
  }
9
13
  ];
10
14
  }
11
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9sbGUtY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvdG9sbGUvc3JjL2xpYi90b2xsZS1jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBWSxNQUFNLGVBQWUsQ0FBQztBQVN6RCxNQUFNLENBQUMsTUFBTSxZQUFZLEdBQUcsSUFBSSxjQUFjLENBQWMsYUFBYSxDQUFDLENBQUM7QUFFM0UsTUFBTSxVQUFVLGtCQUFrQixDQUFDLE1BQW1CO0lBQ3BELE9BQU87UUFDTDtZQUNFLE9BQU8sRUFBRSxZQUFZO1lBQ3JCLFFBQVEsRUFBRSxNQUFNO1NBQ2pCO0tBQ0YsQ0FBQztBQUNKLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJbmplY3Rpb25Ub2tlbiwgUHJvdmlkZXIgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuZXhwb3J0IGludGVyZmFjZSBUb2xsZUNvbmZpZyB7XG4gIHByaW1hcnlDb2xvcj86IHN0cmluZztcbiAgcmFkaXVzPzogc3RyaW5nO1xuICBkZWZhdWx0VG9hc3REdXJhdGlvbj86IG51bWJlcjtcbiAgZGFya0J5RGVmYXVsdD86IGJvb2xlYW47XG59XG5cbmV4cG9ydCBjb25zdCBUT0xMRV9DT05GSUcgPSBuZXcgSW5qZWN0aW9uVG9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iaW1wb3J0IHtBUFBfSU5JVElBTElaRVIsIEluamVjdGlvblRva2VuLCBQcm92aWRlcn0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQge1RoZW1lU2VydmljZX0gZnJvbSAnLi90aGVtZS5zZXJ2aWNlJztcblxuZXhwb3J0IGludGVyZmFjZSBUb2xsZUNvbmZpZyB7XG4gIHByaW1hcnlDb2xvcj86IHN0cmluZztcbiAgcmFkaXVzPzogc3RyaW5nO1xuICBkZWZhdWx0VG9hc3REdXJhdGlvbj86IG51bWJlcjtcbiAgZGFya0J5RGVmYXVsdD86IGJvb2xlYW47XG59XG5cbmV4cG9ydCBjb25zdCBUT0xMRV9DT05GSUcgPSBuZXcgSW5qZWN0aW9uVG9rZW48VG9sbGVDb25maWc+KCdUb2xsZUNvbmZpZycpO1xuXG5leHBvcnQgZnVuY3Rpb24gcHJvdmlkZVRvbGxlQ29uZmlnKGNvbmZpZzogVG9sbGVDb25maWcpOiBQcm92aWRlcltdIHtcbiAgcmV0dXJuIFtcbiAgICB7IHByb3ZpZGU6IFRPTExFX0NPTkZJRywgdXNlVmFsdWU6IGNvbmZpZyB9LFxuICAgIHtcbiAgICAgIHByb3ZpZGU6IEFQUF9JTklUSUFMSVpFUixcbiAgICAgIHVzZUZhY3Rvcnk6ICh0aGVtZVNlcnZpY2U6IFRoZW1lU2VydmljZSkgPT4gKCkgPT4gdGhlbWVTZXJ2aWNlLCAvLyBKdXN0IGZvcmNlIGluamVjdGlvblxuICAgICAgZGVwczogW1RoZW1lU2VydmljZV0sXG4gICAgICBtdWx0aTogdHJ1ZVxuICAgIH1cbiAgXTtcbn1cbiJdfQ==
@@ -1,22 +1,16 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  import * as i0 from '@angular/core';
4
- import { Component, Input, forwardRef, Optional, HostListener, Injectable, ViewChild, ContentChildren, EventEmitter, Output, Directive, InjectionToken, inject, ChangeDetectorRef, ChangeDetectionStrategy, TemplateRef, Injector } from '@angular/core';
5
- import * as i1$1 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
4
+ import { Component, Input, forwardRef, Injectable, Optional, HostListener, ViewChild, ContentChildren, EventEmitter, Output, Directive, PLATFORM_ID, Inject, InjectionToken, APP_INITIALIZER, inject, ChangeDetectorRef, ChangeDetectionStrategy, TemplateRef, Injector } from '@angular/core';
5
+ import * as i1 from '@angular/common';
6
+ import { CommonModule, isPlatformBrowser, DOCUMENT } from '@angular/common';
7
7
  import { cva } from 'class-variance-authority';
8
8
  import * as i2 from '@angular/forms';
9
9
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
10
10
  import { autoUpdate, computePosition, offset, flip, shift } from '@floating-ui/dom';
11
- import * as i1 from '@tolle/ui/select.service';
12
- import { Subject, Subscription } from 'rxjs';
13
- import { BadgeComponent as BadgeComponent$1 } from '@tolle/ui/badge.component';
14
- import { InputComponent as InputComponent$1 } from '@tolle/ui/input.component';
11
+ import { Subject, Subscription, BehaviorSubject } from 'rxjs';
15
12
  import { startOfWeek, startOfMonth, endOfWeek, endOfMonth, eachDayOfInterval, subMonths, subYears, addMonths, addYears, isSameMonth, setMonth, setYear, isSameDay, isToday, isBefore, startOfDay, parse, isValid, format, isWithinInterval } from 'date-fns';
16
- import { SelectComponent as SelectComponent$1, SelectItemComponent as SelectItemComponent$1 } from '@tolle/ui';
17
- import { PaginationComponent as PaginationComponent$1 } from '@tolle/ui/pagination.component';
18
- import { TolleCellDirective as TolleCellDirective$1 } from '@tolle/ui/tolle-cell.directive';
19
- import * as i1$2 from '@angular/cdk/overlay';
13
+ import * as i1$1 from '@angular/cdk/overlay';
20
14
  import { OverlayConfig } from '@angular/cdk/overlay';
21
15
  import { ComponentPortal } from '@angular/cdk/portal';
22
16
 
@@ -307,6 +301,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
307
301
  type: Input
308
302
  }] } });
309
303
 
304
+ class SelectService {
305
+ // Emits the value of the clicked item
306
+ selectedValueSource = new Subject();
307
+ selectedValue$ = this.selectedValueSource.asObservable();
308
+ // Emits the label/text of the clicked item
309
+ selectedLabelSource = new Subject();
310
+ selectedLabel$ = this.selectedLabelSource.asObservable();
311
+ registerClick(value, label) {
312
+ this.selectedValueSource.next(value);
313
+ this.selectedLabelSource.next(label);
314
+ }
315
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
316
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectService });
317
+ }
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectService, decorators: [{
319
+ type: Injectable
320
+ }] });
321
+
310
322
  class SelectItemComponent {
311
323
  selectService;
312
324
  el;
@@ -333,7 +345,7 @@ class SelectItemComponent {
333
345
  }
334
346
  }
335
347
  cn = cn;
336
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectItemComponent, deps: [{ token: i1.SelectService, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
348
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectItemComponent, deps: [{ token: SelectService, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
337
349
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: SelectItemComponent, isStandalone: true, selector: "tolle-select-item", inputs: { value: "value", class: "class", selected: "selected" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: `
338
350
  <div
339
351
  *ngIf="!hidden"
@@ -348,7 +360,7 @@ class SelectItemComponent {
348
360
  </span>
349
361
  <ng-content></ng-content>
350
362
  </div>
351
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
363
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
352
364
  }
353
365
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectItemComponent, decorators: [{
354
366
  type: Component,
@@ -372,7 +384,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
372
384
  </div>
373
385
  `,
374
386
  }]
375
- }], ctorParameters: () => [{ type: i1.SelectService, decorators: [{
387
+ }], ctorParameters: () => [{ type: SelectService, decorators: [{
376
388
  type: Optional
377
389
  }] }, { type: i0.ElementRef }], propDecorators: { value: [{
378
390
  type: Input
@@ -385,24 +397,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
385
397
  args: ['click', ['$event']]
386
398
  }] } });
387
399
 
388
- class SelectService {
389
- // Emits the value of the clicked item
390
- selectedValueSource = new Subject();
391
- selectedValue$ = this.selectedValueSource.asObservable();
392
- // Emits the label/text of the clicked item
393
- selectedLabelSource = new Subject();
394
- selectedLabel$ = this.selectedLabelSource.asObservable();
395
- registerClick(value, label) {
396
- this.selectedValueSource.next(value);
397
- this.selectedLabelSource.next(label);
398
- }
399
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
400
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectService });
401
- }
402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectService, decorators: [{
403
- type: Injectable
404
- }] });
405
-
406
400
  class SelectComponent {
407
401
  selectService;
408
402
  placeholder = 'Select an option';
@@ -569,7 +563,7 @@ class SelectComponent {
569
563
  </div>
570
564
  </div>
571
565
  </div>
572
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: InputComponent, selector: "tolle-input", inputs: ["type", "placeholder", "disabled", "error", "size", "containerClass", "class"] }] });
566
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: InputComponent, selector: "tolle-input", inputs: ["type", "placeholder", "disabled", "error", "size", "containerClass", "class"] }] });
573
567
  }
574
568
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SelectComponent, decorators: [{
575
569
  type: Component,
@@ -858,7 +852,7 @@ class BadgeComponent {
858
852
  <i class="ri-close-line text-[1.1em]"></i>
859
853
  </button>
860
854
  </div>
861
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
855
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
862
856
  }
863
857
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: BadgeComponent, decorators: [{
864
858
  type: Component,
@@ -979,7 +973,7 @@ class CheckboxComponent {
979
973
  [class]="size === 'xs' ? 'text-[10px]' : 'text-[14px]'"
980
974
  ></i>
981
975
  </div>
982
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
976
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
983
977
  }
984
978
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CheckboxComponent, decorators: [{
985
979
  type: Component,
@@ -1143,12 +1137,92 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
1143
1137
  args: [{ providedIn: 'root' }]
1144
1138
  }], ctorParameters: () => [] });
1145
1139
 
1140
+ class ThemeService {
1141
+ document;
1142
+ platformId;
1143
+ config;
1144
+ renderer;
1145
+ isDarkSubject = new BehaviorSubject(false);
1146
+ isDark$ = this.isDarkSubject.asObservable();
1147
+ constructor(document, platformId, config, rendererFactory) {
1148
+ this.document = document;
1149
+ this.platformId = platformId;
1150
+ this.config = config;
1151
+ this.renderer = rendererFactory.createRenderer(null, null);
1152
+ this.initializeTheme();
1153
+ }
1154
+ initializeTheme() {
1155
+ if (!isPlatformBrowser(this.platformId))
1156
+ return;
1157
+ // 1. Determine Initial Mode (Dark/Light)
1158
+ const savedTheme = localStorage.getItem('tolle-theme');
1159
+ const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
1160
+ // Priority: Saved Preference > Config Default > System Preference
1161
+ const shouldBeDark = savedTheme
1162
+ ? savedTheme === 'dark'
1163
+ : (this.config?.darkByDefault ?? prefersDark);
1164
+ if (shouldBeDark) {
1165
+ this.enableDarkMode();
1166
+ }
1167
+ else {
1168
+ this.disableDarkMode();
1169
+ }
1170
+ // 2. Apply Brand Config (Colors/Radius)
1171
+ if (this.config) {
1172
+ this.applyBrandConfig(this.config);
1173
+ }
1174
+ }
1175
+ applyBrandConfig(config) {
1176
+ const root = this.document.documentElement;
1177
+ if (config.primaryColor) {
1178
+ this.renderer.setStyle(root, '--primary', config.primaryColor);
1179
+ }
1180
+ if (config.radius) {
1181
+ this.renderer.setStyle(root, '--radius', config.radius);
1182
+ }
1183
+ }
1184
+ toggleTheme() {
1185
+ const isDark = this.document.documentElement.classList.contains('dark');
1186
+ isDark ? this.disableDarkMode() : this.enableDarkMode();
1187
+ }
1188
+ enableDarkMode() {
1189
+ this.renderer.addClass(this.document.documentElement, 'dark');
1190
+ localStorage.setItem('tolle-theme', 'dark');
1191
+ this.isDarkSubject.next(true);
1192
+ }
1193
+ disableDarkMode() {
1194
+ this.renderer.removeClass(this.document.documentElement, 'dark');
1195
+ localStorage.setItem('tolle-theme', 'light');
1196
+ this.isDarkSubject.next(false);
1197
+ }
1198
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThemeService, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: TOLLE_CONFIG, optional: true }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
1199
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThemeService, providedIn: 'root' });
1200
+ }
1201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThemeService, decorators: [{
1202
+ type: Injectable,
1203
+ args: [{ providedIn: 'root' }]
1204
+ }], ctorParameters: () => [{ type: Document, decorators: [{
1205
+ type: Inject,
1206
+ args: [DOCUMENT]
1207
+ }] }, { type: Object, decorators: [{
1208
+ type: Inject,
1209
+ args: [PLATFORM_ID]
1210
+ }] }, { type: undefined, decorators: [{
1211
+ type: Optional
1212
+ }, {
1213
+ type: Inject,
1214
+ args: [TOLLE_CONFIG]
1215
+ }] }, { type: i0.RendererFactory2 }] });
1216
+
1146
1217
  const TOLLE_CONFIG = new InjectionToken('TolleConfig');
1147
1218
  function provideTolleConfig(config) {
1148
1219
  return [
1220
+ { provide: TOLLE_CONFIG, useValue: config },
1149
1221
  {
1150
- provide: TOLLE_CONFIG,
1151
- useValue: config
1222
+ provide: APP_INITIALIZER,
1223
+ useFactory: (themeService) => () => themeService, // Just force injection
1224
+ deps: [ThemeService],
1225
+ multi: true
1152
1226
  }
1153
1227
  ];
1154
1228
  }
@@ -1299,14 +1373,14 @@ class MultiSelectComponent {
1299
1373
  </div>
1300
1374
  </div>
1301
1375
  </div>
1302
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: BadgeComponent$1, selector: "tolle-badge", inputs: ["variant", "size", "removable", "class"], outputs: ["onRemove"] }, { kind: "component", type: InputComponent$1, selector: "tolle-input", inputs: ["type", "placeholder", "disabled", "error", "size", "containerClass", "class"] }] });
1376
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: BadgeComponent, selector: "tolle-badge", inputs: ["variant", "size", "removable", "class"], outputs: ["onRemove"] }, { kind: "component", type: InputComponent, selector: "tolle-input", inputs: ["type", "placeholder", "disabled", "error", "size", "containerClass", "class"] }] });
1303
1377
  }
1304
1378
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: MultiSelectComponent, decorators: [{
1305
1379
  type: Component,
1306
1380
  args: [{
1307
1381
  selector: 'tolle-multi-select',
1308
1382
  standalone: true,
1309
- imports: [CommonModule, FormsModule, BadgeComponent$1, InputComponent$1],
1383
+ imports: [CommonModule, FormsModule, BadgeComponent, InputComponent],
1310
1384
  providers: [
1311
1385
  SelectService,
1312
1386
  { provide: NG_VALUE_ACCESSOR, useExisting: MultiSelectComponent, multi: true }
@@ -1570,7 +1644,7 @@ class CalendarComponent {
1570
1644
  </button>
1571
1645
  </div>
1572
1646
  </div>
1573
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }] });
1647
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
1574
1648
  }
1575
1649
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: CalendarComponent, decorators: [{
1576
1650
  type: Component,
@@ -2000,7 +2074,7 @@ class DatePickerComponent {
2000
2074
  ></tolle-calendar>
2001
2075
  </div>
2002
2076
  </div>
2003
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MaskedInputComponent, selector: "tolle-masked-input", inputs: ["mask", "placeholder", "type", "disabled", "class", "error", "size", "returnRaw"] }, { kind: "component", type: CalendarComponent, selector: "tolle-calendar", inputs: ["class", "disablePastDates"] }] });
2077
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MaskedInputComponent, selector: "tolle-masked-input", inputs: ["mask", "placeholder", "type", "disabled", "class", "error", "size", "returnRaw"] }, { kind: "component", type: CalendarComponent, selector: "tolle-calendar", inputs: ["class", "disablePastDates"] }] });
2004
2078
  }
2005
2079
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DatePickerComponent, decorators: [{
2006
2080
  type: Component,
@@ -2244,14 +2318,14 @@ class PaginationComponent {
2244
2318
  </div>
2245
2319
  </div>
2246
2320
  </div>
2247
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SelectComponent$1, selector: "tolle-select", inputs: ["placeholder", "class", "disabled", "searchable", "size"] }, { kind: "component", type: SelectItemComponent$1, selector: "tolle-select-item", inputs: ["value", "class", "selected"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2321
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SelectComponent, selector: "tolle-select", inputs: ["placeholder", "class", "disabled", "searchable", "size"] }, { kind: "component", type: SelectItemComponent, selector: "tolle-select-item", inputs: ["value", "class", "selected"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2248
2322
  }
2249
2323
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PaginationComponent, decorators: [{
2250
2324
  type: Component,
2251
2325
  args: [{
2252
2326
  selector: 'tolle-pagination',
2253
2327
  standalone: true,
2254
- imports: [CommonModule, SelectComponent$1, SelectItemComponent$1, FormsModule],
2328
+ imports: [CommonModule, FormsModule, SelectComponent, SelectItemComponent],
2255
2329
  template: `
2256
2330
  <div [class]="cn('flex items-center justify-between px-2 py-4', class)">
2257
2331
 
@@ -2345,6 +2419,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
2345
2419
  type: Output
2346
2420
  }] } });
2347
2421
 
2422
+ class TolleCellDirective {
2423
+ template;
2424
+ name; // The column key this template belongs to
2425
+ constructor(template) {
2426
+ this.template = template;
2427
+ }
2428
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TolleCellDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
2429
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: TolleCellDirective, isStandalone: true, selector: "[tolleCell]", inputs: { name: ["tolleCell", "name"] }, ngImport: i0 });
2430
+ }
2431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TolleCellDirective, decorators: [{
2432
+ type: Directive,
2433
+ args: [{
2434
+ selector: '[tolleCell]',
2435
+ standalone: true
2436
+ }]
2437
+ }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { name: [{
2438
+ type: Input,
2439
+ args: ['tolleCell']
2440
+ }] } });
2441
+
2348
2442
  class DataTableComponent {
2349
2443
  data = [];
2350
2444
  columns = [];
@@ -2460,7 +2554,7 @@ class DataTableComponent {
2460
2554
  return this.cellTemplates?.find(t => t.name === key);
2461
2555
  }
2462
2556
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2463
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: DataTableComponent, isStandalone: true, selector: "tolle-data-table", inputs: { data: "data", columns: "columns", searchable: "searchable", paginate: "paginate", pageSize: "pageSize", expandable: "expandable", size: "size", expandedTemplate: "expandedTemplate" }, queries: [{ propertyName: "cellTemplates", predicate: TolleCellDirective$1 }], usesOnChanges: true, ngImport: i0, template: `
2557
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: DataTableComponent, isStandalone: true, selector: "tolle-data-table", inputs: { data: "data", columns: "columns", searchable: "searchable", paginate: "paginate", pageSize: "pageSize", expandable: "expandable", size: "size", expandedTemplate: "expandedTemplate" }, queries: [{ propertyName: "cellTemplates", predicate: TolleCellDirective }], usesOnChanges: true, ngImport: i0, template: `
2464
2558
  <div class="space-y-4">
2465
2559
  <div *ngIf="searchable" class="flex items-center py-2">
2466
2560
  <tolle-input
@@ -2548,14 +2642,14 @@ class DataTableComponent {
2548
2642
  (onPageSizeChange)="updatePage()"
2549
2643
  ></tolle-pagination>
2550
2644
  </div>
2551
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PaginationComponent$1, selector: "tolle-pagination", inputs: ["class", "showPageLinks", "showPageOptions", "showCurrentPageInfo", "currentPageInfoTemplate", "totalRecords", "currentPageSize", "currentPage", "pageSizeOptions"], outputs: ["onPageNumberChange", "onPageSizeChange"] }, { kind: "component", type: InputComponent$1, selector: "tolle-input", inputs: ["type", "placeholder", "disabled", "error", "size", "containerClass", "class"] }] });
2645
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: PaginationComponent, selector: "tolle-pagination", inputs: ["class", "showPageLinks", "showPageOptions", "showCurrentPageInfo", "currentPageInfoTemplate", "totalRecords", "currentPageSize", "currentPage", "pageSizeOptions"], outputs: ["onPageNumberChange", "onPageSizeChange"] }, { kind: "component", type: InputComponent, selector: "tolle-input", inputs: ["type", "placeholder", "disabled", "error", "size", "containerClass", "class"] }] });
2552
2646
  }
2553
2647
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DataTableComponent, decorators: [{
2554
2648
  type: Component,
2555
2649
  args: [{
2556
2650
  selector: 'tolle-data-table',
2557
2651
  standalone: true,
2558
- imports: [CommonModule, FormsModule, PaginationComponent$1, InputComponent$1],
2652
+ imports: [CommonModule, FormsModule, PaginationComponent, InputComponent],
2559
2653
  template: `
2560
2654
  <div class="space-y-4">
2561
2655
  <div *ngIf="searchable" class="flex items-center py-2">
@@ -2662,31 +2756,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
2662
2756
  type: Input
2663
2757
  }], cellTemplates: [{
2664
2758
  type: ContentChildren,
2665
- args: [TolleCellDirective$1]
2759
+ args: [TolleCellDirective]
2666
2760
  }], expandedTemplate: [{
2667
2761
  type: Input
2668
2762
  }] } });
2669
2763
 
2670
- class TolleCellDirective {
2671
- template;
2672
- name; // The column key this template belongs to
2673
- constructor(template) {
2674
- this.template = template;
2675
- }
2676
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TolleCellDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
2677
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: TolleCellDirective, isStandalone: true, selector: "[tolleCell]", inputs: { name: ["tolleCell", "name"] }, ngImport: i0 });
2678
- }
2679
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TolleCellDirective, decorators: [{
2680
- type: Directive,
2681
- args: [{
2682
- selector: '[tolleCell]',
2683
- standalone: true
2684
- }]
2685
- }], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { name: [{
2686
- type: Input,
2687
- args: ['tolleCell']
2688
- }] } });
2689
-
2690
2764
  class AccordionItemComponent {
2691
2765
  title = '';
2692
2766
  class = '';
@@ -2723,7 +2797,7 @@ class AccordionItemComponent {
2723
2797
  <ng-content></ng-content>
2724
2798
  </div>
2725
2799
  </div>
2726
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2800
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2727
2801
  }
2728
2802
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AccordionItemComponent, decorators: [{
2729
2803
  type: Component,
@@ -2904,7 +2978,7 @@ class ModalComponent {
2904
2978
  </ng-container>
2905
2979
  </div>
2906
2980
  </div>
2907
- `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }] });
2981
+ `, isInline: true, styles: [":host{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }] });
2908
2982
  }
2909
2983
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalComponent, decorators: [{
2910
2984
  type: Component,
@@ -3010,13 +3084,13 @@ class ModalService {
3010
3084
  });
3011
3085
  return this.overlay.create(config);
3012
3086
  }
3013
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalService, deps: [{ token: i1$2.Overlay }, { token: i0.Injector }, { token: ModalStackService }], target: i0.ɵɵFactoryTarget.Injectable });
3087
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalService, deps: [{ token: i1$1.Overlay }, { token: i0.Injector }, { token: ModalStackService }], target: i0.ɵɵFactoryTarget.Injectable });
3014
3088
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalService, providedIn: 'root' });
3015
3089
  }
3016
3090
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ModalService, decorators: [{
3017
3091
  type: Injectable,
3018
3092
  args: [{ providedIn: 'root' }]
3019
- }], ctorParameters: () => [{ type: i1$2.Overlay }, { type: i0.Injector }, { type: ModalStackService }] });
3093
+ }], ctorParameters: () => [{ type: i1$1.Overlay }, { type: i0.Injector }, { type: ModalStackService }] });
3020
3094
 
3021
3095
  class Modal {
3022
3096
  /** The content to display (String, Component, or Template) */
@@ -3266,7 +3340,7 @@ class RangeCalendarComponent {
3266
3340
  </button>
3267
3341
  </div>
3268
3342
  </div>
3269
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }] });
3343
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
3270
3344
  }
3271
3345
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: RangeCalendarComponent, decorators: [{
3272
3346
  type: Component,
@@ -3474,14 +3548,14 @@ class DateRangePickerComponent {
3474
3548
  ></tolle-range-calendar>
3475
3549
  </div>
3476
3550
  </div>
3477
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: RangeCalendarComponent, selector: "tolle-range-calendar", inputs: ["class", "disablePastDates"], outputs: ["rangeSelect"] }, { kind: "component", type: InputComponent$1, selector: "tolle-input", inputs: ["type", "placeholder", "disabled", "error", "size", "containerClass", "class"] }] });
3551
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: RangeCalendarComponent, selector: "tolle-range-calendar", inputs: ["class", "disablePastDates"], outputs: ["rangeSelect"] }, { kind: "component", type: InputComponent, selector: "tolle-input", inputs: ["type", "placeholder", "disabled", "error", "size", "containerClass", "class"] }] });
3478
3552
  }
3479
3553
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DateRangePickerComponent, decorators: [{
3480
3554
  type: Component,
3481
3555
  args: [{
3482
3556
  selector: 'tolle-date-range-picker',
3483
3557
  standalone: true,
3484
- imports: [CommonModule, FormsModule, RangeCalendarComponent, InputComponent$1],
3558
+ imports: [CommonModule, FormsModule, RangeCalendarComponent, InputComponent],
3485
3559
  providers: [
3486
3560
  {
3487
3561
  provide: NG_VALUE_ACCESSOR,