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