@onemrvapublic/design-system 20.5.1-develop.1 → 20.5.1-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/onemrvapublic-design-system-layout.mjs +91 -91
- package/fesm2022/onemrvapublic-design-system-layout.mjs.map +1 -1
- package/fesm2022/onemrvapublic-design-system.mjs +94 -94
- package/fesm2022/onemrvapublic-design-system.mjs.map +1 -1
- package/index.d.ts +24 -24
- package/layout/index.d.ts +24 -24
- package/package.json +24 -24
|
@@ -1,36 +1,95 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
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, inject, Injectable, 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, NavigationEnd, 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 { filter } from 'rxjs/operators';
|
|
22
|
+
import { TranslateService, TranslatePipe, TranslateModule } from '@ngx-translate/core';
|
|
23
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
24
|
+
import { trigger, state, transition, style, animate } from '@angular/animations';
|
|
25
|
+
import * as i1 from '@angular/material/form-field';
|
|
26
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
27
|
+
import * as i2 from '@angular/material/select';
|
|
28
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
29
|
+
import * as i3 from '@angular/forms';
|
|
30
|
+
import { FormsModule } from '@angular/forms';
|
|
31
31
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
32
32
|
import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
|
|
33
33
|
|
|
34
|
+
class OnemrvaLeftSidenavService {
|
|
35
|
+
constructor() {
|
|
36
|
+
this.originalItems = [];
|
|
37
|
+
this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
38
|
+
this.router = inject(Router);
|
|
39
|
+
this.router.events
|
|
40
|
+
.pipe(filter((e) => e instanceof NavigationEnd))
|
|
41
|
+
.subscribe(() => this.reset());
|
|
42
|
+
}
|
|
43
|
+
setOriginal(items) {
|
|
44
|
+
this.originalItems = items ?? [];
|
|
45
|
+
this.items.set(this.originalItems);
|
|
46
|
+
}
|
|
47
|
+
updateItems(items) {
|
|
48
|
+
this.items.set(items ?? []);
|
|
49
|
+
this.items(); // ??
|
|
50
|
+
}
|
|
51
|
+
reset() {
|
|
52
|
+
this.items.set(this.originalItems);
|
|
53
|
+
}
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaLeftSidenavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
55
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaLeftSidenavService, providedIn: 'root' }); }
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: OnemrvaLeftSidenavService, decorators: [{
|
|
58
|
+
type: Injectable,
|
|
59
|
+
args: [{
|
|
60
|
+
providedIn: 'root',
|
|
61
|
+
}]
|
|
62
|
+
}], ctorParameters: () => [] });
|
|
63
|
+
|
|
64
|
+
class LayoutLeftSidenavComponent {
|
|
65
|
+
set items(value) {
|
|
66
|
+
this._items = value ?? [];
|
|
67
|
+
this.leftSidenavService.setOriginal(this._items);
|
|
68
|
+
}
|
|
69
|
+
get items() {
|
|
70
|
+
return this._items;
|
|
71
|
+
}
|
|
72
|
+
constructor() {
|
|
73
|
+
this._items = [];
|
|
74
|
+
this._isHidden = false;
|
|
75
|
+
this.leftSidenavService = inject(OnemrvaLeftSidenavService);
|
|
76
|
+
effect(() => {
|
|
77
|
+
this._isHidden = this.leftSidenavService.items().length === 0;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LayoutLeftSidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
81
|
+
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"] }] }); }
|
|
82
|
+
}
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: LayoutLeftSidenavComponent, decorators: [{
|
|
84
|
+
type: Component,
|
|
85
|
+
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"] }]
|
|
86
|
+
}], ctorParameters: () => [], propDecorators: { items: [{
|
|
87
|
+
type: Input
|
|
88
|
+
}], _isHidden: [{
|
|
89
|
+
type: HostBinding,
|
|
90
|
+
args: ['class.hidden']
|
|
91
|
+
}] } });
|
|
92
|
+
|
|
34
93
|
class LayoutSubrouteComponent {
|
|
35
94
|
constructor() {
|
|
36
95
|
this.cd = inject(ChangeDetectorRef);
|
|
@@ -249,6 +308,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
|
|
|
249
308
|
args: [TemplateRef]
|
|
250
309
|
}] } });
|
|
251
310
|
|
|
311
|
+
class StripHtmlPipe {
|
|
312
|
+
transform(value) {
|
|
313
|
+
return value.replace(/<.*?>/g, ''); // replace tags
|
|
314
|
+
}
|
|
315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: StripHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
316
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.7", ngImport: i0, type: StripHtmlPipe, isStandalone: true, name: "striphtml" }); }
|
|
317
|
+
}
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImport: i0, type: StripHtmlPipe, decorators: [{
|
|
319
|
+
type: Pipe,
|
|
320
|
+
args: [{
|
|
321
|
+
name: 'striphtml',
|
|
322
|
+
standalone: true,
|
|
323
|
+
}]
|
|
324
|
+
}] });
|
|
325
|
+
|
|
252
326
|
// Command to generate ng g d <Directive name>
|
|
253
327
|
class DrawerHostDirective {
|
|
254
328
|
constructor() {
|
|
@@ -329,36 +403,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
|
|
|
329
403
|
}]
|
|
330
404
|
}] });
|
|
331
405
|
|
|
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
406
|
class LayoutSidenavComponent {
|
|
363
407
|
constructor() {
|
|
364
408
|
this.languages = [];
|
|
@@ -484,35 +528,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.7", ngImpor
|
|
|
484
528
|
args: [TemplateRef]
|
|
485
529
|
}] } });
|
|
486
530
|
|
|
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
531
|
class LayoutComponent {
|
|
517
532
|
toggleTheme(newTheme) {
|
|
518
533
|
this.activeTheme.set(newTheme);
|
|
@@ -781,21 +796,6 @@ const layoutComponents = [
|
|
|
781
796
|
LayoutLeftSidenavComponent,
|
|
782
797
|
];
|
|
783
798
|
|
|
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
799
|
function CoerceBooleanInput(defaultValue) {
|
|
800
800
|
return (target, propertyKey) => {
|
|
801
801
|
Object.defineProperty(target, propertyKey, {
|