@onemrvapublic/design-system 20.5.1-develop.1 → 20.5.1-develop.3

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.
@@ -1,36 +1,90 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, TemplateRef, ContentChildren, Input, ViewChild, Component, DestroyRef, ViewContainerRef, DOCUMENT, Directive, signal, Injectable, effect, HostBinding, EventEmitter, isDevMode, Output, ContentChild, Pipe, NgModule } from '@angular/core';
3
- import { Router, RouterLink, RouterLinkActive, NavigationEnd, RouterModule } from '@angular/router';
4
- import { NgTemplateOutlet, NgClass, DOCUMENT as DOCUMENT$1, NgStyle, CommonModule } from '@angular/common';
5
- import { MatIcon, MatIconModule } from '@angular/material/icon';
6
- import { MatMenu, MatMenuTrigger, MatMenuItem, MatMenuModule } from '@angular/material/menu';
7
- import { TranslateService, TranslatePipe, TranslateModule } from '@ngx-translate/core';
2
+ import { signal, Injectable, inject, effect, HostBinding, Input, Component, ChangeDetectorRef, TemplateRef, ContentChildren, ViewChild, Pipe, DestroyRef, ViewContainerRef, DOCUMENT, Directive, EventEmitter, isDevMode, Output, ContentChild, NgModule } from '@angular/core';
8
3
  import { Subject, takeUntil, startWith, BehaviorSubject } from 'rxjs';
9
4
  import { BreakpointObserver, Breakpoints, LayoutModule } from '@angular/cdk/layout';
5
+ import { NgTemplateOutlet, NgClass, DOCUMENT as DOCUMENT$1, NgStyle, CommonModule } from '@angular/common';
10
6
  import * as i2$1 from '@angular/material/sidenav';
11
7
  import { MatDrawer, MatDrawerContainer, MatSidenavModule } from '@angular/material/sidenav';
12
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
13
- import { filter } from 'rxjs/operators';
14
- import { trigger, state, transition, style, animate } from '@angular/animations';
15
- import { MatIconButton, MatFabButton, MatButtonModule } from '@angular/material/button';
16
- import { OnemrvaMatNavigationComponent } from '@onemrvapublic/design-system/mat-navigation';
17
- import * as i1 from '@angular/material/form-field';
18
- import { MatFormFieldModule } from '@angular/material/form-field';
19
- import * as i2 from '@angular/material/select';
20
- import { MatSelectModule } from '@angular/material/select';
21
- import * as i3 from '@angular/forms';
22
- import { FormsModule } from '@angular/forms';
23
8
  import { ONEMRVA_THEME_CLASS, OnemRvaCDNService, OnemRvaSizeDirective, OnemRvaColorDirective } from '@onemrvapublic/design-system/shared';
9
+ import { Router, RouterLink, RouterLinkActive, RouterModule } from '@angular/router';
24
10
  import { MatToolbar, MatToolbarModule } from '@angular/material/toolbar';
25
11
  import { MatTabNav, MatTabLink, MatTabNavPanel, MatTabsModule } from '@angular/material/tabs';
26
12
  import { MatDivider, MatDividerModule } from '@angular/material/divider';
27
13
  import * as i1$1 from '@onemrvapublic/design-system/mat-avatar';
28
14
  import { OnemrvaMatAvatarModule } from '@onemrvapublic/design-system/mat-avatar';
15
+ import { MatMenu, MatMenuTrigger, MatMenuItem, MatMenuModule } from '@angular/material/menu';
16
+ import { MatIcon, MatIconModule } from '@angular/material/icon';
17
+ import { MatIconButton, MatFabButton, MatButtonModule } from '@angular/material/button';
29
18
  import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
30
19
  import { MatRipple } from '@angular/material/core';
20
+ import { OnemrvaMatNavigationComponent } from '@onemrvapublic/design-system/mat-navigation';
21
+ import { TranslateService, TranslatePipe, TranslateModule } from '@ngx-translate/core';
22
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
23
+ import { trigger, state, transition, style, animate } from '@angular/animations';
24
+ import * as i1 from '@angular/material/form-field';
25
+ import { MatFormFieldModule } from '@angular/material/form-field';
26
+ import * as i2 from '@angular/material/select';
27
+ import { MatSelectModule } from '@angular/material/select';
28
+ import * as i3 from '@angular/forms';
29
+ import { FormsModule } from '@angular/forms';
31
30
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
32
31
  import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
33
32
 
33
+ class OnemrvaLeftSidenavService {
34
+ constructor() {
35
+ this.originalItems = [];
36
+ this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
37
+ }
38
+ setOriginal(items) {
39
+ this.originalItems = items ?? [];
40
+ this.items.set(this.originalItems);
41
+ }
42
+ updateItems(items) {
43
+ this.items.set(items ?? []);
44
+ this.items(); // ??
45
+ }
46
+ reset() {
47
+ this.items.set(this.originalItems);
48
+ }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaLeftSidenavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
50
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaLeftSidenavService, providedIn: 'root' }); }
51
+ }
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaLeftSidenavService, decorators: [{
53
+ type: Injectable,
54
+ args: [{
55
+ providedIn: 'root',
56
+ }]
57
+ }] });
58
+
59
+ class LayoutLeftSidenavComponent {
60
+ set items(value) {
61
+ this._items = value ?? [];
62
+ this.leftSidenavService.setOriginal(this._items);
63
+ }
64
+ get items() {
65
+ return this._items;
66
+ }
67
+ constructor() {
68
+ this._items = [];
69
+ this._isHidden = false;
70
+ this.leftSidenavService = inject(OnemrvaLeftSidenavService);
71
+ effect(() => {
72
+ this._isHidden = this.leftSidenavService.items().length === 0;
73
+ });
74
+ }
75
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LayoutLeftSidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
76
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: LayoutLeftSidenavComponent, isStandalone: true, selector: "onemrva-layout-left-sidenav", inputs: { items: "items" }, host: { properties: { "class.hidden": "this._isHidden" } }, ngImport: i0, template: "@if (leftSidenavService.items().length > 0) {\n <onemrva-mat-navigation\n [items]=\"leftSidenavService.items()\"\n ></onemrva-mat-navigation>\n} @else {\n <ng-content></ng-content>\n}\n", styles: [":host{width:240px;margin-right:40px;border-right:1px solid var(--mat-sys-outline-variant)}\n"], dependencies: [{ kind: "component", type: OnemrvaMatNavigationComponent, selector: "onemrva-mat-navigation", inputs: ["items", "level", "translate"] }] }); }
77
+ }
78
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LayoutLeftSidenavComponent, decorators: [{
79
+ type: Component,
80
+ args: [{ selector: 'onemrva-layout-left-sidenav', imports: [OnemrvaMatNavigationComponent], standalone: true, template: "@if (leftSidenavService.items().length > 0) {\n <onemrva-mat-navigation\n [items]=\"leftSidenavService.items()\"\n ></onemrva-mat-navigation>\n} @else {\n <ng-content></ng-content>\n}\n", styles: [":host{width:240px;margin-right:40px;border-right:1px solid var(--mat-sys-outline-variant)}\n"] }]
81
+ }], ctorParameters: () => [], propDecorators: { items: [{
82
+ type: Input
83
+ }], _isHidden: [{
84
+ type: HostBinding,
85
+ args: ['class.hidden']
86
+ }] } });
87
+
34
88
  class LayoutSubrouteComponent {
35
89
  constructor() {
36
90
  this.cd = inject(ChangeDetectorRef);
@@ -249,6 +303,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
249
303
  args: [TemplateRef]
250
304
  }] } });
251
305
 
306
+ class StripHtmlPipe {
307
+ transform(value) {
308
+ return value.replace(/<.*?>/g, ''); // replace tags
309
+ }
310
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: StripHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
311
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.7", ngImport: i0, type: StripHtmlPipe, isStandalone: true, name: "striphtml" }); }
312
+ }
313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: StripHtmlPipe, decorators: [{
314
+ type: Pipe,
315
+ args: [{
316
+ name: 'striphtml',
317
+ standalone: true,
318
+ }]
319
+ }] });
320
+
252
321
  // Command to generate ng g d <Directive name>
253
322
  class DrawerHostDirective {
254
323
  constructor() {
@@ -329,36 +398,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
329
398
  }]
330
399
  }] });
331
400
 
332
- class OnemrvaLeftSidenavService {
333
- constructor() {
334
- this.originalItems = [];
335
- this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
336
- this.router = inject(Router);
337
- this.router.events
338
- .pipe(filter((e) => e instanceof NavigationEnd))
339
- .subscribe(() => this.reset());
340
- }
341
- setOriginal(items) {
342
- this.originalItems = items ?? [];
343
- this.items.set(this.originalItems);
344
- }
345
- updateItems(items) {
346
- this.items.set(items ?? []);
347
- this.items(); // ??
348
- }
349
- reset() {
350
- this.items.set(this.originalItems);
351
- }
352
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaLeftSidenavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
353
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaLeftSidenavService, providedIn: 'root' }); }
354
- }
355
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaLeftSidenavService, decorators: [{
356
- type: Injectable,
357
- args: [{
358
- providedIn: 'root',
359
- }]
360
- }], ctorParameters: () => [] });
361
-
362
401
  class LayoutSidenavComponent {
363
402
  constructor() {
364
403
  this.languages = [];
@@ -484,35 +523,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
484
523
  args: [TemplateRef]
485
524
  }] } });
486
525
 
487
- class LayoutLeftSidenavComponent {
488
- set items(value) {
489
- this._items = value ?? [];
490
- this.leftSidenavService.setOriginal(this._items);
491
- }
492
- get items() {
493
- return this._items;
494
- }
495
- constructor() {
496
- this._items = [];
497
- this._isHidden = false;
498
- this.leftSidenavService = inject(OnemrvaLeftSidenavService);
499
- effect(() => {
500
- this._isHidden = this.leftSidenavService.items().length === 0;
501
- });
502
- }
503
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LayoutLeftSidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
504
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.7", type: LayoutLeftSidenavComponent, isStandalone: true, selector: "onemrva-layout-left-sidenav", inputs: { items: "items" }, host: { properties: { "class.hidden": "this._isHidden" } }, ngImport: i0, template: "@if (leftSidenavService.items().length > 0) {\n <onemrva-mat-navigation\n [items]=\"leftSidenavService.items()\"\n ></onemrva-mat-navigation>\n} @else {\n <ng-content></ng-content>\n}\n", styles: [":host{width:240px;margin-right:40px;border-right:1px solid var(--mat-sys-outline-variant)}\n"], dependencies: [{ kind: "component", type: OnemrvaMatNavigationComponent, selector: "onemrva-mat-navigation", inputs: ["items", "level", "translate"] }] }); }
505
- }
506
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LayoutLeftSidenavComponent, decorators: [{
507
- type: Component,
508
- args: [{ selector: 'onemrva-layout-left-sidenav', imports: [OnemrvaMatNavigationComponent], standalone: true, template: "@if (leftSidenavService.items().length > 0) {\n <onemrva-mat-navigation\n [items]=\"leftSidenavService.items()\"\n ></onemrva-mat-navigation>\n} @else {\n <ng-content></ng-content>\n}\n", styles: [":host{width:240px;margin-right:40px;border-right:1px solid var(--mat-sys-outline-variant)}\n"] }]
509
- }], ctorParameters: () => [], propDecorators: { items: [{
510
- type: Input
511
- }], _isHidden: [{
512
- type: HostBinding,
513
- args: ['class.hidden']
514
- }] } });
515
-
516
526
  class LayoutComponent {
517
527
  toggleTheme(newTheme) {
518
528
  this.activeTheme.set(newTheme);
@@ -781,21 +791,6 @@ const layoutComponents = [
781
791
  LayoutLeftSidenavComponent,
782
792
  ];
783
793
 
784
- class StripHtmlPipe {
785
- transform(value) {
786
- return value.replace(/<.*?>/g, ''); // replace tags
787
- }
788
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: StripHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
789
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.7", ngImport: i0, type: StripHtmlPipe, isStandalone: true, name: "striphtml" }); }
790
- }
791
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: StripHtmlPipe, decorators: [{
792
- type: Pipe,
793
- args: [{
794
- name: 'striphtml',
795
- standalone: true,
796
- }]
797
- }] });
798
-
799
794
  function CoerceBooleanInput(defaultValue) {
800
795
  return (target, propertyKey) => {
801
796
  Object.defineProperty(target, propertyKey, {