|
| 1 | +```typescript |
| 2 | +import { FsUiFrameModule } from "@fullstack-devops/ng-mat-components"; |
| 3 | +``` |
| 4 | + |
| 5 | +## References |
| 6 | + |
| 7 | +- demo: https://fullstack-devops.github.io/ng-mat-components/ui-frame |
| 8 | +- code example: |
| 9 | + [app.component.html](https://github.com/fullstack-devops/ng-mat-components/blob/main/projects/lib-workspace/src/app/app.component.html) |
| 10 | + [app.component.ts](https://github.com/fullstack-devops/ng-mat-components/blob/main/projects/lib-workspace/src/app/app.component.ts) |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Directives |
| 15 | + |
| 16 | +```bash |
| 17 | +. |
| 18 | +├── fs-ui-frame |
| 19 | +│ └── settings.json |
| 20 | +└── fs-calendar-table |
| 21 | + └── Dockerfile |
| 22 | +``` |
| 23 | + |
| 24 | +## Directives |
| 25 | + |
| 26 | +### fs-ui-frame |
| 27 | + |
| 28 | +Selector: `fs-ui-frame` |
| 29 | + |
| 30 | +#### fs-ui-frame-toolbar |
| 31 | + |
| 32 | +Parent Selector: `fs-ui-frame` |
| 33 | + |
| 34 | +Selector: `fs-ui-frame-toolbar` |
| 35 | + |
| 36 | +##### fs-ui-frame-toolbar-title |
| 37 | + |
| 38 | +Parent Selector: `fs-ui-frame-toolbar` |
| 39 | + |
| 40 | +Selector: `fs-ui-frame-toolbar-title` |
| 41 | + |
| 42 | +##### fs-ui-frame-toolbar-center |
| 43 | + |
| 44 | +Parent Selector: `fs-ui-frame-toolbar` |
| 45 | + |
| 46 | +Selector: `fs-ui-frame-toolbar-center` |
| 47 | + |
| 48 | +##### fs-ui-frame-toolbar-side |
| 49 | + |
| 50 | +Parent Selector: `fs-ui-frame-toolbar` |
| 51 | + |
| 52 | +Selector: `fs-ui-frame-toolbar-side` |
| 53 | + |
| 54 | +#### fs-ui-frame-content |
| 55 | + |
| 56 | +Parent Selector: `fs-ui-frame` |
| 57 | + |
| 58 | +Selector: `fs-ui-frame-content` |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## Examples |
| 63 | + |
| 64 | +### ui-frame in form |
| 65 | + |
| 66 | +=== "HTML" |
| 67 | + |
| 68 | + ```html |
| 69 | + <fs-ui-frame [frameConfig]="frameConfig" [navUser]="navUser" [appRoutes]="appRoutes" (event)="onEvent($event)"> |
| 70 | + <fs-ui-frame-toolbar> |
| 71 | + <fs-ui-frame-toolbar-title>Current App Title</fs-ui-frame-toolbar-title> |
| 72 | + |
| 73 | + <fs-ui-frame-toolbar-center> |
| 74 | + <button mat-icon-button> |
| 75 | + <mat-icon>help</mat-icon> |
| 76 | + </button> |
| 77 | + <button mat-icon-button matBadge="3"> |
| 78 | + <mat-icon>article</mat-icon> |
| 79 | + </button> |
| 80 | + <button mat-icon-button> |
| 81 | + <mat-icon>call</mat-icon> |
| 82 | + </button> |
| 83 | + </fs-ui-frame-toolbar-center> |
| 84 | + |
| 85 | + <fs-ui-frame-toolbar-side> |
| 86 | + <mat-form-field appearance="outline"> |
| 87 | + <input matInput placeholder="Search" type="search" /> |
| 88 | + </mat-form-field> |
| 89 | + </fs-ui-frame-toolbar-side> |
| 90 | + </fs-ui-frame-toolbar> |
| 91 | + |
| 92 | + <fs-ui-frame-content> |
| 93 | + <router-outlet></router-outlet> |
| 94 | + </fs-ui-frame-content> |
| 95 | + </fs-ui-frame> |
| 96 | + ``` |
| 97 | + |
| 98 | +=== "TS" |
| 99 | + |
| 100 | + ``` typescript |
| 101 | + import { Component, OnInit } from '@angular/core'; |
| 102 | + import { FormBuilder, FormControl, Validators } from '@angular/forms'; |
| 103 | + import { FrameConfig, |
| 104 | + FrameEvent, |
| 105 | + FrameEvents, |
| 106 | + NavUser, } from '@ite/ng-daimlertruck'; |
| 107 | + import { routes } from './app-routing.module'; |
| 108 | + |
| 109 | + @Component({ |
| 110 | + selector: 'example', |
| 111 | + templateUrl: 'example.html', |
| 112 | + styleUrls: ['example.css'], |
| 113 | + }) |
| 114 | + export class ExampleComponent implements OnInit { |
| 115 | + title = 'FS DevOps`s ng mat components'; |
| 116 | + appRoutes = routes; |
| 117 | + |
| 118 | + frameConfig: FrameConfig = { |
| 119 | + appName: 'Dummy App', |
| 120 | + // appNameShort: stringOfLength('DUMMY', 0, 6), |
| 121 | + logo: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Angular_full_color_logo.svg/1024px-Angular_full_color_logo.svg.png', |
| 122 | + }; |
| 123 | + navUser: NavUser = { |
| 124 | + profilePicture: |
| 125 | + 'https://material.angular.io/assets/img/examples/shiba1.jpg', |
| 126 | + name: 'Some User', |
| 127 | + role: 'Engineer', |
| 128 | + }; |
| 129 | + |
| 130 | + ngOnInit() { } |
| 131 | + |
| 132 | + onEvent(frameEvent: FrameEvent) { |
| 133 | + switch (frameEvent.type) { |
| 134 | + case FrameEvents.MANAGE_ACCOUNT: |
| 135 | + console.log('Manage Account called, do something...'); |
| 136 | + break; |
| 137 | + case FrameEvents.LOGOUT: |
| 138 | + console.log('Logout called, do something...'); |
| 139 | + break; |
| 140 | + default: |
| 141 | + console.error(`unknown event fetched: ${JSON.stringify(event)}`); |
| 142 | + break; |
| 143 | + } |
| 144 | + } |
| 145 | + } |
| 146 | + ``` |
| 147 | + |
| 148 | +=== "CSS" |
| 149 | + |
| 150 | + ``` css |
| 151 | + |
| 152 | + ``` |
0 commit comments