@dontdrinkandroot/ngx-material-extensions 0.5.3 → 0.6.0

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 (35) hide show
  1. package/assets/_extensions.scss +132 -0
  2. package/assets/_mixins.scss +11 -0
  3. package/assets/_theme.scss +131 -0
  4. package/assets/_utils.scss +46 -0
  5. package/{_variables.scss → assets/_variables.scss} +16 -1
  6. package/assets/fonts.scss +21 -0
  7. package/{index.scss → assets/style.scss} +2 -1
  8. package/assets/utils/_color.scss +29 -0
  9. package/assets/utils/_display.scss +37 -0
  10. package/{_utilities.scss → assets/utils/_spacing.scss} +3 -53
  11. package/esm2022/public-api.mjs +7 -4
  12. package/esm2022/src/button/fab-fixed.directive.mjs +25 -0
  13. package/esm2022/src/ddr-material-extensions.module.mjs +60 -9
  14. package/esm2022/src/filter/filter.component.mjs +3 -3
  15. package/esm2022/src/gridlist/grid-tile-lazy-image-container.directive.mjs +3 -3
  16. package/esm2022/src/gridlist/grid-tile-lazy-img.directive.mjs +3 -3
  17. package/esm2022/src/sidenav/sidenav-container.component.mjs +6 -10
  18. package/esm2022/src/sidenav/sidenav-toggle.component.mjs +3 -3
  19. package/esm2022/src/sidenav/sidenav.service.mjs +6 -13
  20. package/esm2022/src/theme/theme-config.mjs +3 -0
  21. package/esm2022/src/theme/theme-scroll.service.mjs +49 -0
  22. package/esm2022/src/toolbar/toolbar-fixed-top.directive.mjs +33 -0
  23. package/fesm2022/dontdrinkandroot-ngx-material-extensions.mjs +270 -135
  24. package/fesm2022/dontdrinkandroot-ngx-material-extensions.mjs.map +1 -1
  25. package/package.json +11 -12
  26. package/public-api.d.ts +6 -3
  27. package/src/button/fab-fixed.directive.d.ts +12 -0
  28. package/src/ddr-material-extensions.module.d.ts +17 -15
  29. package/src/sidenav/sidenav-container.component.d.ts +1 -2
  30. package/src/sidenav/sidenav.service.d.ts +1 -3
  31. package/src/theme/theme-config.d.ts +8 -0
  32. package/src/theme/theme-scroll.service.d.ts +12 -0
  33. package/src/toolbar/toolbar-fixed-top.directive.d.ts +13 -0
  34. package/_extensions.scss +0 -60
  35. package/_theme.scss +0 -42
@@ -1,83 +1,38 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, Output, Input, ViewChild, Injectable, Inject, Directive, HostBinding, ContentChildren, HostListener, NgModule } from '@angular/core';
3
- import * as i6 from '@angular/forms';
4
- import { FormControl, ReactiveFormsModule } from '@angular/forms';
5
- import { interval, BehaviorSubject, distinctUntilChanged } from 'rxjs';
6
- import { debounce, map } from 'rxjs/operators';
7
- import * as i1 from '@angular/material/card';
8
- import { MatCardModule } from '@angular/material/card';
9
- import * as i2 from '@angular/material/icon';
10
- import { MatIconModule } from '@angular/material/icon';
11
- import * as i3 from '@angular/material/input';
12
- import { MatInputModule } from '@angular/material/input';
13
- import * as i4 from '@angular/material/form-field';
14
- import { MatFormFieldModule } from '@angular/material/form-field';
15
- import * as i5 from '@angular/material/button';
16
- import { MatButtonModule } from '@angular/material/button';
17
- import * as i1$1 from '@angular/cdk/layout';
2
+ import { Injectable, Inject, Component, Directive, Input, HostBinding, ContentChildren, HostListener, ViewChild, EventEmitter, Output, InjectionToken, ENVIRONMENT_INITIALIZER, inject, NgModule } from '@angular/core';
3
+ import { toSignal } from '@angular/core/rxjs-interop';
4
+ import * as i1 from '@angular/cdk/layout';
18
5
  import { Breakpoints } from '@angular/cdk/layout';
19
- import * as i2$1 from '@angular/router';
6
+ import { BehaviorSubject, interval, fromEvent, distinctUntilChanged } from 'rxjs';
7
+ import { map, debounce } from 'rxjs/operators';
8
+ import * as i2 from '@angular/router';
20
9
  import { NavigationStart } from '@angular/router';
21
10
  import * as i2$2 from '@angular/common';
22
11
  import { DOCUMENT, CommonModule } from '@angular/common';
12
+ import * as i2$1 from '@angular/material/icon';
13
+ import { MatIconModule } from '@angular/material/icon';
14
+ import * as i3 from '@angular/material/button';
15
+ import { MatButtonModule } from '@angular/material/button';
23
16
  import * as i3$1 from '@angular/material/sidenav';
24
17
  import { MatSidenavModule } from '@angular/material/sidenav';
25
- import { toSignal } from '@angular/core/rxjs-interop';
26
18
  import { __decorate } from 'tslib';
27
19
  import { NumberUtils, StringUtils, Debounce, Limit } from '@dontdrinkandroot/ngx-extensions';
20
+ import * as i6 from '@angular/forms';
21
+ import { FormControl, ReactiveFormsModule } from '@angular/forms';
22
+ import * as i1$1 from '@angular/material/card';
23
+ import { MatCardModule } from '@angular/material/card';
24
+ import * as i3$2 from '@angular/material/input';
25
+ import { MatInputModule } from '@angular/material/input';
26
+ import * as i4 from '@angular/material/form-field';
27
+ import { MatFormFieldModule } from '@angular/material/form-field';
28
28
  import { MatToolbarModule } from '@angular/material/toolbar';
29
29
 
30
- class FilterComponent {
31
- constructor() {
32
- this.formControl = new FormControl();
33
- this.onFilterChanged = new EventEmitter();
34
- this.bouncePeriod = 500;
35
- }
36
- /**
37
- * @override
38
- */
39
- ngOnInit() {
40
- this.valueChangesSubscription = this.formControl.valueChanges
41
- .pipe(debounce(() => interval(this.bouncePeriod)))
42
- .subscribe((value => this.onFilterChanged.emit(value)));
43
- }
44
- /**
45
- * @override
46
- */
47
- ngOnDestroy() {
48
- this.valueChangesSubscription.unsubscribe();
49
- }
50
- /**
51
- * @override
52
- */
53
- ngAfterContentInit() {
54
- this.inputElement.nativeElement.focus();
55
- }
56
- clear() {
57
- this.formControl.setValue(null);
58
- this.onFilterChanged.emit(undefined);
59
- }
60
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
61
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.9", type: FilterComponent, selector: "ddr-filter", inputs: { bouncePeriod: "bouncePeriod" }, outputs: { onFilterChanged: "onFilterChanged" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<mat-card appearance=\"outlined\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input matInput type=\"text\" [formControl]=\"formControl\" #input />\n <button mat-icon-button matSuffix (click)=\"clear()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n</mat-card>\n", dependencies: [{ kind: "component", type: i1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
62
- }
63
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: FilterComponent, decorators: [{
64
- type: Component,
65
- args: [{ selector: 'ddr-filter', template: "<mat-card appearance=\"outlined\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input matInput type=\"text\" [formControl]=\"formControl\" #input />\n <button mat-icon-button matSuffix (click)=\"clear()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n</mat-card>\n" }]
66
- }], propDecorators: { onFilterChanged: [{
67
- type: Output
68
- }], bouncePeriod: [{
69
- type: Input
70
- }], inputElement: [{
71
- type: ViewChild,
72
- args: ['input', { static: true }]
73
- }] } });
74
-
75
30
  class SidenavService {
76
31
  constructor(breakpointObserver, router, document) {
77
32
  this.breakpointObserver = breakpointObserver;
78
33
  this.router = router;
79
34
  this.document = document;
80
- this.stayOpenOnLargeScreen = false;
35
+ this.stayOpenOnLargeScreen = true;
81
36
  this.largeBreakpoints = [
82
37
  Breakpoints.Medium,
83
38
  Breakpoints.Large,
@@ -96,13 +51,6 @@ class SidenavService {
96
51
  setSidenav(sidenav) {
97
52
  this.sidenav = sidenav;
98
53
  }
99
- setSidenavContent(sidenavContent) {
100
- this.sidenavContent = sidenavContent;
101
- this.sidenavContent.elementScrolled().pipe(map(() => this.sidenavContent.measureScrollOffset('top') > 0), distinctUntilChanged()).subscribe(scrolled => {
102
- this.document.body.classList.toggle('scrolled', scrolled);
103
- this.sidenavContentScrolled$.next(scrolled);
104
- });
105
- }
106
54
  getStayOpenOnLargeScreen() {
107
55
  return this.stayOpenOnLargeScreen;
108
56
  }
@@ -135,61 +83,19 @@ class SidenavService {
135
83
  watchContentScrolled() {
136
84
  return this.sidenavContentScrolled$.asObservable();
137
85
  }
138
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: SidenavService, deps: [{ token: i1$1.BreakpointObserver }, { token: i2$1.Router }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
139
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: SidenavService, providedIn: 'root' }); }
86
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavService, deps: [{ token: i1.BreakpointObserver }, { token: i2.Router }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
87
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavService, providedIn: 'root' }); }
140
88
  }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: SidenavService, decorators: [{
89
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavService, decorators: [{
142
90
  type: Injectable,
143
91
  args: [{
144
92
  providedIn: 'root'
145
93
  }]
146
- }], ctorParameters: () => [{ type: i1$1.BreakpointObserver }, { type: i2$1.Router }, { type: Document, decorators: [{
94
+ }], ctorParameters: () => [{ type: i1.BreakpointObserver }, { type: i2.Router }, { type: Document, decorators: [{
147
95
  type: Inject,
148
96
  args: [DOCUMENT]
149
97
  }] }] });
150
98
 
151
- class SidenavContainerComponent {
152
- constructor(sidenavService) {
153
- this.sidenavService = sidenavService;
154
- this.stayOpenOnLargeScreen = false;
155
- this.mode$ = this.sidenavService.getModeObservable();
156
- this.opened$ = this.sidenavService.getOpenedObservable();
157
- }
158
- /**
159
- * @override
160
- */
161
- ngOnChanges(changes) {
162
- this.sidenavService.setStayOpenOnLargeScreen(changes['stayOpenOnLargeScreen'].currentValue);
163
- }
164
- /**
165
- * @override
166
- */
167
- ngOnInit() {
168
- this.sidenavService.setSidenav(this.sidenav);
169
- this.sidenavService.setSidenavContent(this.sidenavContent);
170
- }
171
- /**
172
- * @override
173
- */
174
- ngOnDestroy() {
175
- this.scrollSubscription.unsubscribe();
176
- }
177
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: SidenavContainerComponent, deps: [{ token: SidenavService }], target: i0.ɵɵFactoryTarget.Component }); }
178
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.9", type: SidenavContainerComponent, selector: "ddr-mat-sidenav-container", inputs: { stayOpenOnLargeScreen: "stayOpenOnLargeScreen" }, viewQueries: [{ propertyName: "sidenav", first: true, predicate: ["sidenav"], descendants: true, static: true }, { propertyName: "sidenavContent", first: true, predicate: ["sidenavContent"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<mat-sidenav-container [ngClass]=\"(mode$|async)\">\n <mat-sidenav\n #sidenav\n [mode]=\"(mode$|async) ?? 'over'\"\n [opened]=\"(opened$|async)\">\n <ng-content select=\"[slot=mat-sidenav]\"></ng-content>\n </mat-sidenav>\n <mat-sidenav-content #sidenavContent>\n <ng-content select=\"[slot=mat-sidenav-content]\"></ng-content>\n </mat-sidenav-content>\n</mat-sidenav-container>\n", dependencies: [{ kind: "directive", type: i2$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3$1.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i3$1.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i3$1.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "pipe", type: i2$2.AsyncPipe, name: "async" }] }); }
179
- }
180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: SidenavContainerComponent, decorators: [{
181
- type: Component,
182
- args: [{ selector: 'ddr-mat-sidenav-container', template: "<mat-sidenav-container [ngClass]=\"(mode$|async)\">\n <mat-sidenav\n #sidenav\n [mode]=\"(mode$|async) ?? 'over'\"\n [opened]=\"(opened$|async)\">\n <ng-content select=\"[slot=mat-sidenav]\"></ng-content>\n </mat-sidenav>\n <mat-sidenav-content #sidenavContent>\n <ng-content select=\"[slot=mat-sidenav-content]\"></ng-content>\n </mat-sidenav-content>\n</mat-sidenav-container>\n" }]
183
- }], ctorParameters: () => [{ type: SidenavService }], propDecorators: { sidenav: [{
184
- type: ViewChild,
185
- args: ['sidenav', { static: true }]
186
- }], sidenavContent: [{
187
- type: ViewChild,
188
- args: ['sidenavContent', { static: true }]
189
- }], stayOpenOnLargeScreen: [{
190
- type: Input
191
- }] } });
192
-
193
99
  class SidenavToggleComponent {
194
100
  constructor(sidenavService) {
195
101
  this.sidenavService = sidenavService;
@@ -198,13 +104,13 @@ class SidenavToggleComponent {
198
104
  toggleSidenav() {
199
105
  this.sidenavService.toggle();
200
106
  }
201
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: SidenavToggleComponent, deps: [{ token: SidenavService }], target: i0.ɵɵFactoryTarget.Component }); }
202
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.9", type: SidenavToggleComponent, selector: "ddr-mat-sidenav-toggle", host: { properties: { "style.display": "visible() ? \"block\" : \"none\"" } }, ngImport: i0, template: `
107
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavToggleComponent, deps: [{ token: SidenavService }], target: i0.ɵɵFactoryTarget.Component }); }
108
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.1", type: SidenavToggleComponent, selector: "ddr-mat-sidenav-toggle", host: { properties: { "style.display": "visible() ? \"block\" : \"none\"" } }, ngImport: i0, template: `
203
109
  <button mat-icon-button (click)="toggleSidenav()">
204
110
  <mat-icon>menu</mat-icon>
205
- </button>`, isInline: true, dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
111
+ </button>`, isInline: true, dependencies: [{ kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] }); }
206
112
  }
207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: SidenavToggleComponent, decorators: [{
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavToggleComponent, decorators: [{
208
114
  type: Component,
209
115
  args: [{
210
116
  selector: 'ddr-mat-sidenav-toggle',
@@ -300,10 +206,10 @@ class GridTileLazyImgDirective {
300
206
  // console.log('isHidden');
301
207
  return window.getComputedStyle(nativeElement).display === 'none';
302
208
  }
303
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: GridTileLazyImgDirective, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
304
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.9", type: GridTileLazyImgDirective, selector: "[ddrGridTileLazyImg]", inputs: { src: ["ddrGridTileLazyImg", "src"], offset: "offset", objectFit: "objectFit" }, host: { properties: { "src": "this.hostSrc", "style.object-fit": "this.hostStyleObjectFit", "style.width.px": "this.hostStyleWidthPx", "style.height.px": "this.hostStyleHeightPx", "style.opacity": "this.hostStyleOpacity" } }, usesOnChanges: true, ngImport: i0 }); }
209
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: GridTileLazyImgDirective, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
210
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: GridTileLazyImgDirective, selector: "[ddrGridTileLazyImg]", inputs: { src: ["ddrGridTileLazyImg", "src"], offset: "offset", objectFit: "objectFit" }, host: { properties: { "src": "this.hostSrc", "style.object-fit": "this.hostStyleObjectFit", "style.width.px": "this.hostStyleWidthPx", "style.height.px": "this.hostStyleHeightPx", "style.opacity": "this.hostStyleOpacity" } }, usesOnChanges: true, ngImport: i0 }); }
305
211
  }
306
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: GridTileLazyImgDirective, decorators: [{
212
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: GridTileLazyImgDirective, decorators: [{
307
213
  type: Directive,
308
214
  args: [{ selector: '[ddrGridTileLazyImg]' }]
309
215
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { src: [{
@@ -357,8 +263,8 @@ class GridTileLazyImageContainerDirective {
357
263
  ngOnDestroy() {
358
264
  this.changeSubscription.unsubscribe();
359
265
  }
360
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: GridTileLazyImageContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
361
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.9", type: GridTileLazyImageContainerDirective, selector: "[ddrGridTileLazyImgContainer]", host: { listeners: { "window:resize": "windowResized($event)", "window:scroll": "windowScroll($event)" } }, queries: [{ propertyName: "lazyImages", predicate: GridTileLazyImgDirective, descendants: true }], ngImport: i0 }); }
266
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: GridTileLazyImageContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
267
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: GridTileLazyImageContainerDirective, selector: "[ddrGridTileLazyImgContainer]", host: { listeners: { "window:resize": "windowResized($event)", "window:scroll": "windowScroll($event)" } }, queries: [{ propertyName: "lazyImages", predicate: GridTileLazyImgDirective, descendants: true }], ngImport: i0 }); }
362
268
  }
363
269
  __decorate([
364
270
  Debounce()
@@ -366,7 +272,7 @@ __decorate([
366
272
  __decorate([
367
273
  Limit()
368
274
  ], GridTileLazyImageContainerDirective.prototype, "windowScroll", null);
369
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: GridTileLazyImageContainerDirective, decorators: [{
275
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: GridTileLazyImageContainerDirective, decorators: [{
370
276
  type: Directive,
371
277
  args: [{ selector: '[ddrGridTileLazyImgContainer]' }]
372
278
  }], propDecorators: { lazyImages: [{
@@ -380,13 +286,197 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImpor
380
286
  args: ['window:scroll', ['$event']]
381
287
  }] } });
382
288
 
289
+ class SidenavContainerComponent {
290
+ constructor(sidenavService) {
291
+ this.sidenavService = sidenavService;
292
+ this.stayOpenOnLargeScreen = true;
293
+ this.mode$ = this.sidenavService.getModeObservable();
294
+ this.opened$ = this.sidenavService.getOpenedObservable();
295
+ }
296
+ /**
297
+ * @override
298
+ */
299
+ ngOnChanges(changes) {
300
+ this.sidenavService.setStayOpenOnLargeScreen(changes['stayOpenOnLargeScreen'].currentValue);
301
+ }
302
+ /**
303
+ * @override
304
+ */
305
+ ngOnInit() {
306
+ this.sidenavService.setSidenav(this.sidenav);
307
+ }
308
+ /**
309
+ * @override
310
+ */
311
+ ngOnDestroy() {
312
+ this.scrollSubscription.unsubscribe();
313
+ }
314
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavContainerComponent, deps: [{ token: SidenavService }], target: i0.ɵɵFactoryTarget.Component }); }
315
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.1", type: SidenavContainerComponent, selector: "ddr-mat-sidenav-container", inputs: { stayOpenOnLargeScreen: "stayOpenOnLargeScreen" }, viewQueries: [{ propertyName: "sidenav", first: true, predicate: ["sidenav"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<mat-sidenav-container [ngClass]=\"(mode$|async)\">\n <mat-sidenav\n #sidenav\n [mode]=\"(mode$|async) ?? 'over'\"\n [opened]=\"(opened$|async)\"\n [fixedInViewport]=\"true\"\n >\n <ng-content select=\"[slot=mat-sidenav]\"></ng-content>\n </mat-sidenav>\n <mat-sidenav-content #sidenavContent>\n <ng-content select=\"[slot=mat-sidenav-content]\"></ng-content>\n </mat-sidenav-content>\n</mat-sidenav-container>\n", dependencies: [{ kind: "directive", type: i2$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3$1.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i3$1.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i3$1.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "pipe", type: i2$2.AsyncPipe, name: "async" }] }); }
316
+ }
317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: SidenavContainerComponent, decorators: [{
318
+ type: Component,
319
+ args: [{ selector: 'ddr-mat-sidenav-container', template: "<mat-sidenav-container [ngClass]=\"(mode$|async)\">\n <mat-sidenav\n #sidenav\n [mode]=\"(mode$|async) ?? 'over'\"\n [opened]=\"(opened$|async)\"\n [fixedInViewport]=\"true\"\n >\n <ng-content select=\"[slot=mat-sidenav]\"></ng-content>\n </mat-sidenav>\n <mat-sidenav-content #sidenavContent>\n <ng-content select=\"[slot=mat-sidenav-content]\"></ng-content>\n </mat-sidenav-content>\n</mat-sidenav-container>\n" }]
320
+ }], ctorParameters: () => [{ type: SidenavService }], propDecorators: { sidenav: [{
321
+ type: ViewChild,
322
+ args: ['sidenav', { static: true }]
323
+ }], stayOpenOnLargeScreen: [{
324
+ type: Input
325
+ }] } });
326
+
327
+ class FilterComponent {
328
+ constructor() {
329
+ this.formControl = new FormControl();
330
+ this.onFilterChanged = new EventEmitter();
331
+ this.bouncePeriod = 500;
332
+ }
333
+ /**
334
+ * @override
335
+ */
336
+ ngOnInit() {
337
+ this.valueChangesSubscription = this.formControl.valueChanges
338
+ .pipe(debounce(() => interval(this.bouncePeriod)))
339
+ .subscribe((value => this.onFilterChanged.emit(value)));
340
+ }
341
+ /**
342
+ * @override
343
+ */
344
+ ngOnDestroy() {
345
+ this.valueChangesSubscription.unsubscribe();
346
+ }
347
+ /**
348
+ * @override
349
+ */
350
+ ngAfterContentInit() {
351
+ this.inputElement.nativeElement.focus();
352
+ }
353
+ clear() {
354
+ this.formControl.setValue(null);
355
+ this.onFilterChanged.emit(undefined);
356
+ }
357
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
358
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.1", type: FilterComponent, selector: "ddr-filter", inputs: { bouncePeriod: "bouncePeriod" }, outputs: { onFilterChanged: "onFilterChanged" }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: "<mat-card appearance=\"outlined\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input matInput type=\"text\" [formControl]=\"formControl\" #input />\n <button mat-icon-button matSuffix (click)=\"clear()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n</mat-card>\n", dependencies: [{ kind: "component", type: i1$1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
359
+ }
360
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FilterComponent, decorators: [{
361
+ type: Component,
362
+ args: [{ selector: 'ddr-filter', template: "<mat-card appearance=\"outlined\">\n <mat-form-field appearance=\"outline\" subscriptSizing=\"dynamic\">\n <input matInput type=\"text\" [formControl]=\"formControl\" #input />\n <button mat-icon-button matSuffix (click)=\"clear()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n</mat-card>\n" }]
363
+ }], propDecorators: { onFilterChanged: [{
364
+ type: Output
365
+ }], bouncePeriod: [{
366
+ type: Input
367
+ }], inputElement: [{
368
+ type: ViewChild,
369
+ args: ['input', { static: true }]
370
+ }] } });
371
+
372
+ const DDR_MATERIAL_EXTENSIONS_THEME = new InjectionToken('DDR_MATERIAL_EXTENSIONS_THEME');
373
+
374
+ class ThemeScrollService {
375
+ constructor(document, themeConfig) {
376
+ this.document = document;
377
+ this.themeConfig = themeConfig;
378
+ }
379
+ init() {
380
+ const lightMetaElement = this.findOrCreateThemeColorMetaElement('(prefers-color-scheme: light)', this.themeConfig.themeColorLight);
381
+ const darkMetaElement = this.findOrCreateThemeColorMetaElement('(prefers-color-scheme: dark)', this.themeConfig.themeColorDark);
382
+ fromEvent(this.document, 'scroll')
383
+ .pipe(map(() => this.document.documentElement.scrollTop > 0), distinctUntilChanged()).subscribe((scrolled) => {
384
+ scrolled ? this.document.body.classList.add('ddr-mat-scrolled') : this.document.body.classList.remove('ddr-mat-scrolled');
385
+ lightMetaElement.content = scrolled ? this.themeConfig.themeColorLightScrolled : this.themeConfig.themeColorLight;
386
+ darkMetaElement.content = scrolled ? this.themeConfig.themeColorDarkScrolled : this.themeConfig.themeColorDark;
387
+ });
388
+ }
389
+ findOrCreateThemeColorMetaElement(media, content) {
390
+ let metaElement = this.document.head.querySelector(`meta[name="theme-color"][media="${media}"]`);
391
+ if (null == metaElement) {
392
+ metaElement = this.createThemeColorMetaElement(media, content);
393
+ }
394
+ return metaElement;
395
+ }
396
+ createThemeColorMetaElement(media, content) {
397
+ const metaElement = this.document.createElement('meta');
398
+ metaElement.name = 'theme-color';
399
+ metaElement.media = media;
400
+ metaElement.content = content;
401
+ this.document.head.appendChild(metaElement);
402
+ return metaElement;
403
+ }
404
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeScrollService, deps: [{ token: DOCUMENT }, { token: DDR_MATERIAL_EXTENSIONS_THEME }], target: i0.ɵɵFactoryTarget.Injectable }); }
405
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeScrollService }); }
406
+ }
407
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ThemeScrollService, decorators: [{
408
+ type: Injectable
409
+ }], ctorParameters: () => [{ type: Document, decorators: [{
410
+ type: Inject,
411
+ args: [DOCUMENT]
412
+ }] }, { type: undefined, decorators: [{
413
+ type: Inject,
414
+ args: [DDR_MATERIAL_EXTENSIONS_THEME]
415
+ }] }] });
416
+
417
+ class ToolbarFixedTopDirective {
418
+ constructor(el) {
419
+ this.el = el;
420
+ this.ddrMatToolbarFixedTop = '';
421
+ }
422
+ /**
423
+ * @override
424
+ */
425
+ ngOnInit() {
426
+ const container = document.createElement('div');
427
+ container.classList.add('ddr-mat-toolbar-fixed-top-container');
428
+ this.el.nativeElement.parentElement.insertBefore(container, this.el.nativeElement);
429
+ container.appendChild(this.el.nativeElement);
430
+ if ('' !== this.ddrMatToolbarFixedTop) {
431
+ this.ddrMatToolbarFixedTop.forEach((className) => {
432
+ container.classList.add(className);
433
+ });
434
+ }
435
+ }
436
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ToolbarFixedTopDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
437
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: ToolbarFixedTopDirective, selector: "[ddrMatToolbarFixedTop]", inputs: { ddrMatToolbarFixedTop: "ddrMatToolbarFixedTop" }, ngImport: i0 }); }
438
+ }
439
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: ToolbarFixedTopDirective, decorators: [{
440
+ type: Directive,
441
+ args: [{
442
+ selector: '[ddrMatToolbarFixedTop]'
443
+ }]
444
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { ddrMatToolbarFixedTop: [{
445
+ type: Input
446
+ }] } });
447
+
448
+ class FabFixedDirective {
449
+ constructor(el) {
450
+ this.el = el;
451
+ }
452
+ /**
453
+ * @override
454
+ */
455
+ ngOnInit() {
456
+ const container = document.createElement('div');
457
+ container.classList.add('ddr-mat-fab-fixed-container');
458
+ this.el.nativeElement.parentElement.insertBefore(container, this.el.nativeElement);
459
+ container.appendChild(this.el.nativeElement);
460
+ }
461
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FabFixedDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
462
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.1", type: FabFixedDirective, selector: "[ddrMatFabFixed]", ngImport: i0 }); }
463
+ }
464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: FabFixedDirective, decorators: [{
465
+ type: Directive,
466
+ args: [{
467
+ selector: '[ddrMatFabFixed]'
468
+ }]
469
+ }], ctorParameters: () => [{ type: i0.ElementRef }] });
470
+
383
471
  class DdrMaterialExtensionsModule {
384
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: DdrMaterialExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
385
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.9", ngImport: i0, type: DdrMaterialExtensionsModule, declarations: [FilterComponent,
472
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DdrMaterialExtensionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
473
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.1", ngImport: i0, type: DdrMaterialExtensionsModule, declarations: [FabFixedDirective,
474
+ FilterComponent,
386
475
  SidenavToggleComponent,
387
476
  GridTileLazyImageContainerDirective,
388
477
  GridTileLazyImgDirective,
389
- SidenavContainerComponent], imports: [CommonModule,
478
+ SidenavContainerComponent,
479
+ ToolbarFixedTopDirective], imports: [CommonModule,
390
480
  MatCardModule,
391
481
  MatSidenavModule,
392
482
  MatIconModule,
@@ -394,12 +484,33 @@ class DdrMaterialExtensionsModule {
394
484
  MatButtonModule,
395
485
  MatFormFieldModule,
396
486
  MatToolbarModule,
397
- ReactiveFormsModule], exports: [FilterComponent,
487
+ ReactiveFormsModule], exports: [FabFixedDirective,
488
+ FilterComponent,
398
489
  SidenavToggleComponent,
399
490
  GridTileLazyImageContainerDirective,
400
491
  GridTileLazyImgDirective,
401
- SidenavContainerComponent] }); }
402
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: DdrMaterialExtensionsModule, imports: [CommonModule,
492
+ SidenavContainerComponent,
493
+ ToolbarFixedTopDirective] }); }
494
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DdrMaterialExtensionsModule, providers: [
495
+ ThemeScrollService,
496
+ {
497
+ provide: ENVIRONMENT_INITIALIZER,
498
+ multi: true,
499
+ useValue() {
500
+ inject(ThemeScrollService).init();
501
+ }
502
+ },
503
+ {
504
+ provide: DDR_MATERIAL_EXTENSIONS_THEME,
505
+ multi: false,
506
+ useValue: {
507
+ themeColorLight: '#fdfbff',
508
+ themeColorDark: '#1a1b1f',
509
+ themeColorLightScrolled: '#efedf1',
510
+ themeColorDarkScrolled: '#1e1f23',
511
+ }
512
+ }
513
+ ], imports: [CommonModule,
403
514
  MatCardModule,
404
515
  MatSidenavModule,
405
516
  MatIconModule,
@@ -409,15 +520,17 @@ class DdrMaterialExtensionsModule {
409
520
  MatToolbarModule,
410
521
  ReactiveFormsModule] }); }
411
522
  }
412
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImport: i0, type: DdrMaterialExtensionsModule, decorators: [{
523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.1", ngImport: i0, type: DdrMaterialExtensionsModule, decorators: [{
413
524
  type: NgModule,
414
525
  args: [{
415
526
  declarations: [
527
+ FabFixedDirective,
416
528
  FilterComponent,
417
529
  SidenavToggleComponent,
418
530
  GridTileLazyImageContainerDirective,
419
531
  GridTileLazyImgDirective,
420
532
  SidenavContainerComponent,
533
+ ToolbarFixedTopDirective
421
534
  ],
422
535
  imports: [
423
536
  CommonModule,
@@ -431,11 +544,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImpor
431
544
  ReactiveFormsModule
432
545
  ],
433
546
  exports: [
547
+ FabFixedDirective,
434
548
  FilterComponent,
435
549
  SidenavToggleComponent,
436
550
  GridTileLazyImageContainerDirective,
437
551
  GridTileLazyImgDirective,
438
552
  SidenavContainerComponent,
553
+ ToolbarFixedTopDirective
554
+ ],
555
+ providers: [
556
+ ThemeScrollService,
557
+ {
558
+ provide: ENVIRONMENT_INITIALIZER,
559
+ multi: true,
560
+ useValue() {
561
+ inject(ThemeScrollService).init();
562
+ }
563
+ },
564
+ {
565
+ provide: DDR_MATERIAL_EXTENSIONS_THEME,
566
+ multi: false,
567
+ useValue: {
568
+ themeColorLight: '#fdfbff',
569
+ themeColorDark: '#1a1b1f',
570
+ themeColorLightScrolled: '#efedf1',
571
+ themeColorDarkScrolled: '#1e1f23',
572
+ }
573
+ }
439
574
  ]
440
575
  }]
441
576
  }] });
@@ -448,5 +583,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.9", ngImpor
448
583
  * Generated bundle index. Do not edit.
449
584
  */
450
585
 
451
- export { DdrMaterialExtensionsModule, FilterComponent, GridTileLazyImageContainerDirective, GridTileLazyImgDirective, SidenavContainerComponent, SidenavService, SidenavToggleComponent };
586
+ export { DDR_MATERIAL_EXTENSIONS_THEME, DdrMaterialExtensionsModule, FabFixedDirective, FilterComponent, GridTileLazyImageContainerDirective, GridTileLazyImgDirective, SidenavContainerComponent, SidenavService, SidenavToggleComponent, ToolbarFixedTopDirective };
452
587
  //# sourceMappingURL=dontdrinkandroot-ngx-material-extensions.mjs.map