gcp-material-ui 0.0.4
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/.agents/skills/charts/SKILL.MD +103 -0
- package/.agents/skills/creating-common-components/SKILL.MD +121 -0
- package/.agents/skills/creating-pages/SKILL.MD +205 -0
- package/.agents/skills/sidebar/SKILL.MD +63 -0
- package/.agents/skills/workflow-graph/SKILL.MD +160 -0
- package/.dockerignore +4 -0
- package/.editorconfig +17 -0
- package/.prettierrc +12 -0
- package/Dockerfile +14 -0
- package/PUBLISH_GUIDE.md +33 -0
- package/README.md +48 -0
- package/angular.json +79 -0
- package/deploy.sh +47 -0
- package/nginx.conf +15 -0
- package/package.json +48 -0
- package/public/favicon.ico +0 -0
- package/public/google-cloud-combined.svg +1 -0
- package/publish.sh +14 -0
- package/src/_variables.scss +183 -0
- package/src/app/app.config.ts +19 -0
- package/src/app/app.html +1 -0
- package/src/app/app.routes.ts +65 -0
- package/src/app/app.scss +0 -0
- package/src/app/app.spec.ts +23 -0
- package/src/app/app.ts +12 -0
- package/src/app/auth/auth.guard.ts +7 -0
- package/src/app/auth/auth.service.ts +50 -0
- package/src/app/components/page/page.html +20 -0
- package/src/app/components/page/page.scss +41 -0
- package/src/app/components/page/page.ts +15 -0
- package/src/app/dashboard/dashboard.html +287 -0
- package/src/app/dashboard/dashboard.scss +196 -0
- package/src/app/dashboard/dashboard.ts +24 -0
- package/src/app/demo-components/buttons/buttons-demo.html +92 -0
- package/src/app/demo-components/buttons/buttons-demo.scss +38 -0
- package/src/app/demo-components/buttons/buttons-demo.ts +23 -0
- package/src/app/demo-components/card/card-demo.html +52 -0
- package/src/app/demo-components/card/card-demo.scss +47 -0
- package/src/app/demo-components/card/card-demo.ts +21 -0
- package/src/app/demo-components/charts/charts-demo.html +88 -0
- package/src/app/demo-components/charts/charts-demo.scss +50 -0
- package/src/app/demo-components/charts/charts-demo.ts +201 -0
- package/src/app/demo-components/chips/chips-demo.html +87 -0
- package/src/app/demo-components/chips/chips-demo.scss +6 -0
- package/src/app/demo-components/chips/chips-demo.ts +57 -0
- package/src/app/demo-components/code-snippet/code-snippet-demo.html +52 -0
- package/src/app/demo-components/code-snippet/code-snippet-demo.scss +20 -0
- package/src/app/demo-components/code-snippet/code-snippet-demo.ts +31 -0
- package/src/app/demo-components/dialog/dialog-demo.html +47 -0
- package/src/app/demo-components/dialog/dialog-demo.ts +90 -0
- package/src/app/demo-components/dialog/dialog-examples.ts +126 -0
- package/src/app/demo-components/expand-button/expand-button-demo.html +28 -0
- package/src/app/demo-components/expand-button/expand-button-demo.scss +45 -0
- package/src/app/demo-components/expand-button/expand-button-demo.ts +28 -0
- package/src/app/demo-components/expansion/expansion-demo.html +105 -0
- package/src/app/demo-components/expansion/expansion-demo.scss +11 -0
- package/src/app/demo-components/expansion/expansion-demo.ts +49 -0
- package/src/app/demo-components/forms/forms-demo.html +114 -0
- package/src/app/demo-components/forms/forms-demo.scss +43 -0
- package/src/app/demo-components/forms/forms-demo.ts +57 -0
- package/src/app/demo-components/message/message-demo.html +47 -0
- package/src/app/demo-components/message/message-demo.ts +33 -0
- package/src/app/demo-components/message/message.html +15 -0
- package/src/app/demo-components/message/message.scss +115 -0
- package/src/app/demo-components/message/message.ts +39 -0
- package/src/app/demo-components/sidebar/sidebar-demo.html +46 -0
- package/src/app/demo-components/sidebar/sidebar-demo.scss +47 -0
- package/src/app/demo-components/sidebar/sidebar-demo.ts +27 -0
- package/src/app/demo-components/sidebar/sidebar.html +15 -0
- package/src/app/demo-components/sidebar/sidebar.scss +25 -0
- package/src/app/demo-components/sidebar/sidebar.ts +87 -0
- package/src/app/demo-components/slide-toggle/slide-toggle-demo.html +110 -0
- package/src/app/demo-components/slide-toggle/slide-toggle-demo.scss +45 -0
- package/src/app/demo-components/slide-toggle/slide-toggle-demo.ts +39 -0
- package/src/app/demo-components/stepper/stepper-demo.html +99 -0
- package/src/app/demo-components/stepper/stepper-demo.ts +84 -0
- package/src/app/demo-components/tables/clean_tables_scss.py +16 -0
- package/src/app/demo-components/tables/tables-demo.html +64 -0
- package/src/app/demo-components/tables/tables-demo.scss +18 -0
- package/src/app/demo-components/tables/tables-demo.ts +89 -0
- package/src/app/demo-components/tabs/tabs-demo.html +168 -0
- package/src/app/demo-components/tabs/tabs-demo.scss +22 -0
- package/src/app/demo-components/tabs/tabs-demo.ts +76 -0
- package/src/app/demo-components/toolbars/toolbars-demo.html +50 -0
- package/src/app/demo-components/toolbars/toolbars-demo.scss +29 -0
- package/src/app/demo-components/toolbars/toolbars-demo.ts +25 -0
- package/src/app/demo-components/tooltip/tooltip-demo.html +80 -0
- package/src/app/demo-components/tooltip/tooltip-demo.scss +30 -0
- package/src/app/demo-components/tooltip/tooltip-demo.ts +27 -0
- package/src/app/demo-components/typography/typography-demo.html +23 -0
- package/src/app/demo-components/typography/typography-demo.scss +49 -0
- package/src/app/demo-components/typography/typography-demo.ts +72 -0
- package/src/app/demo-components/workflow-graph/workflow-graph-demo.html +25 -0
- package/src/app/demo-components/workflow-graph/workflow-graph-demo.scss +48 -0
- package/src/app/demo-components/workflow-graph/workflow-graph-demo.ts +133 -0
- package/src/app/layout/layout.html +12 -0
- package/src/app/layout/layout.scss +21 -0
- package/src/app/layout/layout.ts +19 -0
- package/src/app/layout/side-menu/side-menu.html +32 -0
- package/src/app/layout/side-menu/side-menu.scss +52 -0
- package/src/app/layout/side-menu/side-menu.ts +70 -0
- package/src/app/layout/top-action-bar/top-action-bar.html +41 -0
- package/src/app/layout/top-action-bar/top-action-bar.scss +98 -0
- package/src/app/layout/top-action-bar/top-action-bar.ts +68 -0
- package/src/app/page-templates/complex-form/complex-form.html +103 -0
- package/src/app/page-templates/complex-form/complex-form.scss +110 -0
- package/src/app/page-templates/complex-form/complex-form.ts +66 -0
- package/src/app/page-templates/firewall-add/firewall-add.html +78 -0
- package/src/app/page-templates/firewall-add/firewall-add.scss +1 -0
- package/src/app/page-templates/firewall-add/firewall-add.ts +94 -0
- package/src/app/page-templates/firewall-details/firewall-details.html +115 -0
- package/src/app/page-templates/firewall-details/firewall-details.scss +21 -0
- package/src/app/page-templates/firewall-details/firewall-details.ts +91 -0
- package/src/app/page-templates/firewall-list/firewall-list.html +99 -0
- package/src/app/page-templates/firewall-list/firewall-list.scss +21 -0
- package/src/app/page-templates/firewall-list/firewall-list.ts +85 -0
- package/src/app/page-templates/firewall.service.ts +84 -0
- package/src/app/services/project.service.ts +24 -0
- package/src/index.html +17 -0
- package/src/main.ts +6 -0
- package/src/styles.scss +739 -0
- package/start_server.sh +4 -0
- package/tsconfig.app.json +15 -0
- package/tsconfig.json +33 -0
- package/tsconfig.spec.json +15 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@use '@angular/material' as mat;
|
|
2
|
+
@use '../../../_variables' as theme;
|
|
3
|
+
|
|
4
|
+
.demo-actions {
|
|
5
|
+
display: flex;
|
|
6
|
+
gap: theme.px-to-rem(16);
|
|
7
|
+
margin-top: theme.px-to-rem(16);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.property-list {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: theme.px-to-rem(12);
|
|
14
|
+
|
|
15
|
+
.property-item {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
|
|
20
|
+
.label {
|
|
21
|
+
font-size: theme.px-to-rem(13);
|
|
22
|
+
color: theme.$grey600;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.value {
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
color: theme.$grey900;
|
|
28
|
+
font-size: theme.px-to-rem(13);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.status-active {
|
|
32
|
+
color: #1e8e3e; /* Green standing standard */
|
|
33
|
+
background-color: #e6f4ea;
|
|
34
|
+
padding: 2px 8px;
|
|
35
|
+
border-radius: 4px;
|
|
36
|
+
font-size: 11px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.metrics-placeholder {
|
|
42
|
+
p {
|
|
43
|
+
margin: theme.px-to-rem(8) 0;
|
|
44
|
+
font-size: theme.px-to-rem(13);
|
|
45
|
+
color: theme.$grey700;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
4
|
+
import { SidebarComponent } from './sidebar';
|
|
5
|
+
import { PageComponent } from '../../components/page/page';
|
|
6
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
7
|
+
import { MatCardModule } from '@angular/material/card';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-sidebar-demo',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [CommonModule, MatButtonModule, SidebarComponent, PageComponent, MatDividerModule, MatCardModule],
|
|
13
|
+
templateUrl: './sidebar-demo.html',
|
|
14
|
+
styleUrl: './sidebar-demo.scss'
|
|
15
|
+
})
|
|
16
|
+
export class SidebarDemoComponent {
|
|
17
|
+
isSidebarOpen: boolean = false;
|
|
18
|
+
isSidebarWithContentOpen: boolean = false;
|
|
19
|
+
|
|
20
|
+
toggleSidebar(): void {
|
|
21
|
+
this.isSidebarOpen = !this.isSidebarOpen;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
toggleSidebarWithContent(): void {
|
|
25
|
+
this.isSidebarWithContentOpen = !this.isSidebarWithContentOpen;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<ng-template #sidebarContent>
|
|
2
|
+
<div class="sidebar-panel" @slideInOut>
|
|
3
|
+
<mat-toolbar class="sidebar-header">
|
|
4
|
+
<span>{{title || 'Menu'}}</span>
|
|
5
|
+
<span class="spacer"></span>
|
|
6
|
+
<button mat-icon-button (click)="closeSidebar()" aria-label="Close sidebar">
|
|
7
|
+
<mat-icon>close</mat-icon>
|
|
8
|
+
</button>
|
|
9
|
+
</mat-toolbar>
|
|
10
|
+
|
|
11
|
+
<div class="sidebar-content">
|
|
12
|
+
<ng-content></ng-content>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</ng-template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use '@angular/material' as mat;
|
|
2
|
+
@use '../../../_variables' as theme;
|
|
3
|
+
|
|
4
|
+
.sidebar-panel {
|
|
5
|
+
height: 100vh;
|
|
6
|
+
width: 576px;
|
|
7
|
+
max-width: 100vw;
|
|
8
|
+
background-color: #ffffff;
|
|
9
|
+
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08); /* Soft depth shadow */
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
|
|
13
|
+
.sidebar-header {
|
|
14
|
+
.spacer {
|
|
15
|
+
flex: 1 1 auto;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.sidebar-content {
|
|
20
|
+
flex: 1;
|
|
21
|
+
overflow-y: auto;
|
|
22
|
+
padding: theme.px-to-rem(24);
|
|
23
|
+
background-color: #fafafa; /* Slightly offset body canvas tone */
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter, ViewChild, TemplateRef, ViewContainerRef, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
+
import { animate, style, transition, trigger } from '@angular/animations';
|
|
6
|
+
import { Overlay, OverlayRef, OverlayModule } from '@angular/cdk/overlay';
|
|
7
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
8
|
+
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'app-sidebar',
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [CommonModule, MatButtonModule, MatIconModule, OverlayModule, MatToolbarModule],
|
|
14
|
+
templateUrl: './sidebar.html',
|
|
15
|
+
styleUrl: './sidebar.scss',
|
|
16
|
+
animations: [
|
|
17
|
+
trigger('slideInOut', [
|
|
18
|
+
transition(':enter', [
|
|
19
|
+
style({ transform: 'translateX(100%)' }),
|
|
20
|
+
animate('300ms ease-out', style({ transform: 'translateX(0)' }))
|
|
21
|
+
]),
|
|
22
|
+
transition(':leave', [
|
|
23
|
+
animate('250ms ease-in', style({ transform: 'translateX(100%)' }))
|
|
24
|
+
])
|
|
25
|
+
])
|
|
26
|
+
]
|
|
27
|
+
})
|
|
28
|
+
export class SidebarComponent implements OnChanges, OnDestroy {
|
|
29
|
+
@Input() isOpen: boolean = false;
|
|
30
|
+
@Input() title: string = '';
|
|
31
|
+
@Output() close = new EventEmitter<void>();
|
|
32
|
+
|
|
33
|
+
@ViewChild('sidebarContent') sidebarContent!: TemplateRef<any>;
|
|
34
|
+
private overlayRef: OverlayRef | null = null;
|
|
35
|
+
|
|
36
|
+
constructor(
|
|
37
|
+
private overlay: Overlay,
|
|
38
|
+
private viewContainerRef: ViewContainerRef
|
|
39
|
+
) {}
|
|
40
|
+
|
|
41
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
42
|
+
if (changes['isOpen']) {
|
|
43
|
+
if (this.isOpen) {
|
|
44
|
+
this.openSidebarOverlay();
|
|
45
|
+
} else {
|
|
46
|
+
this.closeSidebarOverlay();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
openSidebarOverlay() {
|
|
52
|
+
if (this.overlayRef) return;
|
|
53
|
+
|
|
54
|
+
this.overlayRef = this.overlay.create({
|
|
55
|
+
hasBackdrop: true,
|
|
56
|
+
backdropClass: 'cdk-overlay-dark-backdrop',
|
|
57
|
+
positionStrategy: this.overlay.position()
|
|
58
|
+
.global()
|
|
59
|
+
.right('0')
|
|
60
|
+
.top('0')
|
|
61
|
+
.bottom('0')
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const portal = new TemplatePortal(this.sidebarContent, this.viewContainerRef);
|
|
65
|
+
this.overlayRef.attach(portal);
|
|
66
|
+
|
|
67
|
+
// Close on backdrop click
|
|
68
|
+
this.overlayRef.backdropClick().subscribe(() => {
|
|
69
|
+
this.closeSidebar();
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
closeSidebarOverlay() {
|
|
74
|
+
if (this.overlayRef) {
|
|
75
|
+
this.overlayRef.dispose();
|
|
76
|
+
this.overlayRef = null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
closeSidebar() {
|
|
81
|
+
this.close.emit();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
ngOnDestroy(): void {
|
|
85
|
+
this.closeSidebarOverlay();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<app-page title="Slide Toggle Showcase">
|
|
2
|
+
<div class="showcase-container default-container-padding">
|
|
3
|
+
|
|
4
|
+
<!-- Basic Slide Toggle -->
|
|
5
|
+
<mat-card class="showcase-card">
|
|
6
|
+
<mat-card-header>
|
|
7
|
+
<mat-card-title>Basic Slide Toggle</mat-card-title>
|
|
8
|
+
<mat-card-subtitle>Simple toggle switch</mat-card-subtitle>
|
|
9
|
+
</mat-card-header>
|
|
10
|
+
<mat-card-content class="showcase-grid">
|
|
11
|
+
<mat-slide-toggle [(ngModel)]="isChecked" (change)="onToggleChange($event)">
|
|
12
|
+
Toggle me (Checked: {{isChecked}})
|
|
13
|
+
</mat-slide-toggle>
|
|
14
|
+
</mat-card-content>
|
|
15
|
+
</mat-card>
|
|
16
|
+
|
|
17
|
+
<!-- Colors -->
|
|
18
|
+
<mat-card class="showcase-card">
|
|
19
|
+
<mat-card-header>
|
|
20
|
+
<mat-card-title>Colors</mat-card-title>
|
|
21
|
+
<mat-card-subtitle>Standard Material colors</mat-card-subtitle>
|
|
22
|
+
</mat-card-header>
|
|
23
|
+
<mat-card-content class="showcase-grid">
|
|
24
|
+
<mat-slide-toggle color="primary" [checked]="true">Primary</mat-slide-toggle>
|
|
25
|
+
<mat-slide-toggle color="accent" [checked]="true">Accent (Default)</mat-slide-toggle>
|
|
26
|
+
<mat-slide-toggle color="warn" [checked]="true">Warn</mat-slide-toggle>
|
|
27
|
+
</mat-card-content>
|
|
28
|
+
</mat-card>
|
|
29
|
+
|
|
30
|
+
<!-- Label Position -->
|
|
31
|
+
<mat-card class="showcase-card">
|
|
32
|
+
<mat-card-header>
|
|
33
|
+
<mat-card-title>Label Position</mat-card-title>
|
|
34
|
+
<mat-card-subtitle>Before or after the toggle</mat-card-subtitle>
|
|
35
|
+
</mat-card-header>
|
|
36
|
+
<mat-card-content class="showcase-grid">
|
|
37
|
+
<mat-slide-toggle labelPosition="after">Label After (Default)</mat-slide-toggle>
|
|
38
|
+
<mat-slide-toggle labelPosition="before">Label Before</mat-slide-toggle>
|
|
39
|
+
</mat-card-content>
|
|
40
|
+
</mat-card>
|
|
41
|
+
|
|
42
|
+
<!-- Form Binding (Reactive Forms) -->
|
|
43
|
+
<mat-card class="showcase-card">
|
|
44
|
+
<mat-card-header>
|
|
45
|
+
<mat-card-title>Reactive Forms</mat-card-title>
|
|
46
|
+
<mat-card-subtitle>Binding to a FormGroup</mat-card-subtitle>
|
|
47
|
+
</mat-card-header>
|
|
48
|
+
<mat-card-content class="showcase-grid">
|
|
49
|
+
<form [formGroup]="formGroup" style="display: flex; flex-direction: column; gap: 16px;">
|
|
50
|
+
<mat-slide-toggle formControlName="enableWifi">Enable Wi-Fi</mat-slide-toggle>
|
|
51
|
+
<mat-slide-toggle formControlName="acceptTerms">Accept Terms & Conditions</mat-slide-toggle>
|
|
52
|
+
|
|
53
|
+
<div class="form-status">
|
|
54
|
+
<span>Wi-Fi Enabled: {{ formGroup.get('enableWifi')?.value }}</span><br>
|
|
55
|
+
<span>Terms Accepted: {{ formGroup.get('acceptTerms')?.value }}</span>
|
|
56
|
+
</div>
|
|
57
|
+
</form>
|
|
58
|
+
</mat-card-content>
|
|
59
|
+
</mat-card>
|
|
60
|
+
|
|
61
|
+
<!-- Disabled State -->
|
|
62
|
+
<mat-card class="showcase-card">
|
|
63
|
+
<mat-card-header>
|
|
64
|
+
<mat-card-title>Disabled State</mat-card-title>
|
|
65
|
+
<mat-card-subtitle>Toggles in disabled state</mat-card-subtitle>
|
|
66
|
+
</mat-card-header>
|
|
67
|
+
<mat-card-content class="showcase-grid">
|
|
68
|
+
<mat-slide-toggle [disabled]="true">Disabled Unchecked</mat-slide-toggle>
|
|
69
|
+
<mat-slide-toggle [disabled]="true" [checked]="true">Disabled Checked</mat-slide-toggle>
|
|
70
|
+
</mat-card-content>
|
|
71
|
+
</mat-card>
|
|
72
|
+
|
|
73
|
+
<!-- Screenshot Examples -->
|
|
74
|
+
<mat-card class="showcase-card">
|
|
75
|
+
<mat-card-header>
|
|
76
|
+
<mat-card-title>Screenshot Examples</mat-card-title>
|
|
77
|
+
<mat-card-subtitle>Matching the visual reference</mat-card-subtitle>
|
|
78
|
+
</mat-card-header>
|
|
79
|
+
<mat-card-content class="showcase-grid" style="flex-direction: column; align-items: flex-start;">
|
|
80
|
+
|
|
81
|
+
<div class="example-item">
|
|
82
|
+
<mat-slide-toggle>Plain slide toggle</mat-slide-toggle>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div class="example-item">
|
|
86
|
+
<mat-slide-toggle [checked]="true">Checked slide toggle</mat-slide-toggle>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div class="example-item">
|
|
90
|
+
<mat-slide-toggle [disabled]="true">Disabled slide toggle</mat-slide-toggle>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div class="example-item">
|
|
94
|
+
<mat-slide-toggle [disabled]="true" [checked]="true">Disabled checked slide toggle</mat-slide-toggle>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div class="example-item">
|
|
98
|
+
<mat-slide-toggle>Slide toggle with a label that takes up more than one line because it is so verbose and needs lots of room</mat-slide-toggle>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div class="example-item hint-toggle">
|
|
102
|
+
<mat-slide-toggle>Slide toggle with supportive hint text</mat-slide-toggle>
|
|
103
|
+
<span class="hint-text">Here's some explanatory text that can accompany a slide toggle</span>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
</mat-card-content>
|
|
107
|
+
</mat-card>
|
|
108
|
+
|
|
109
|
+
</div>
|
|
110
|
+
</app-page>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.showcase-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 24px;
|
|
5
|
+
max-width: 1000px;
|
|
6
|
+
margin: 0 auto;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.showcase-card {
|
|
10
|
+
margin-bottom: 8px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.showcase-grid {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
gap: 16px;
|
|
17
|
+
padding: 16px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.form-status {
|
|
22
|
+
padding: 12px;
|
|
23
|
+
background-color: #f1f3f4;
|
|
24
|
+
border-radius: 4px;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
color: #3c4043;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.example-item {
|
|
30
|
+
width: 100%;
|
|
31
|
+
max-width: 600px;
|
|
32
|
+
margin-bottom: 12px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.hint-toggle {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: 4px;
|
|
39
|
+
|
|
40
|
+
.hint-text {
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
color: #5f6368;
|
|
43
|
+
padding-left: 52px; // Align with label text, skipping the toggle control
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatCardModule } from '@angular/material/card';
|
|
4
|
+
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
5
|
+
import { PageComponent } from '../../components/page/page';
|
|
6
|
+
import { FormsModule, FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-slide-toggle-demo',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [
|
|
12
|
+
CommonModule,
|
|
13
|
+
MatCardModule,
|
|
14
|
+
MatSlideToggleModule,
|
|
15
|
+
PageComponent,
|
|
16
|
+
FormsModule,
|
|
17
|
+
ReactiveFormsModule
|
|
18
|
+
],
|
|
19
|
+
templateUrl: './slide-toggle-demo.html',
|
|
20
|
+
styleUrls: ['./slide-toggle-demo.scss']
|
|
21
|
+
})
|
|
22
|
+
export class SlideToggleDemoComponent {
|
|
23
|
+
isChecked = false;
|
|
24
|
+
isDisabled = false;
|
|
25
|
+
color = 'accent';
|
|
26
|
+
|
|
27
|
+
formGroup: FormGroup;
|
|
28
|
+
|
|
29
|
+
constructor(private formBuilder: FormBuilder) {
|
|
30
|
+
this.formGroup = this.formBuilder.group({
|
|
31
|
+
enableWifi: [false],
|
|
32
|
+
acceptTerms: [false]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
onToggleChange(event: any) {
|
|
37
|
+
console.log('Toggle changed:', event.checked);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<app-page title="Stepper">
|
|
2
|
+
<div class="demo-container default-container-padding">
|
|
3
|
+
<!-- Horizontal Stepper Section -->
|
|
4
|
+
<div class="example-section">
|
|
5
|
+
<h3>Horizontal Stepper</h3>
|
|
6
|
+
<p>A stepper that displays navigation steps horizontally across the view.</p>
|
|
7
|
+
|
|
8
|
+
<mat-horizontal-stepper [linear]="true" #horizontalStepper>
|
|
9
|
+
<mat-step [stepControl]="horizontalFirstFormGroup">
|
|
10
|
+
<form [formGroup]="horizontalFirstFormGroup" class="step-content">
|
|
11
|
+
<ng-template matStepLabel>Step 1: Basic Info</ng-template>
|
|
12
|
+
<p>Please enter your name to proceed.</p>
|
|
13
|
+
<mat-form-field appearance="outline" class="full-width">
|
|
14
|
+
<mat-label>Name</mat-label>
|
|
15
|
+
<input matInput formControlName="firstCtrl" placeholder="Last name, First name" required>
|
|
16
|
+
</mat-form-field>
|
|
17
|
+
<div class="stepper-actions">
|
|
18
|
+
<button mat-flat-button color="primary" matStepperNext>Next</button>
|
|
19
|
+
</div>
|
|
20
|
+
</form>
|
|
21
|
+
</mat-step>
|
|
22
|
+
|
|
23
|
+
<mat-step [stepControl]="horizontalSecondFormGroup">
|
|
24
|
+
<form [formGroup]="horizontalSecondFormGroup" class="step-content">
|
|
25
|
+
<ng-template matStepLabel>Step 2: Address</ng-template>
|
|
26
|
+
<p>Please enter your address to proceed.</p>
|
|
27
|
+
<mat-form-field appearance="outline" class="full-width">
|
|
28
|
+
<mat-label>Address</mat-label>
|
|
29
|
+
<input matInput formControlName="secondCtrl" placeholder="Ex. 1 Main St" required>
|
|
30
|
+
</mat-form-field>
|
|
31
|
+
<div class="stepper-actions">
|
|
32
|
+
<button mat-button matStepperPrevious>Back</button>
|
|
33
|
+
<button mat-flat-button color="primary" matStepperNext>Next</button>
|
|
34
|
+
</div>
|
|
35
|
+
</form>
|
|
36
|
+
</mat-step>
|
|
37
|
+
|
|
38
|
+
<mat-step>
|
|
39
|
+
<ng-template matStepLabel>Step 3: Done</ng-template>
|
|
40
|
+
<div class="step-content">
|
|
41
|
+
<p>You are now done with the horizontal process setup triggers actions safely neat.</p>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="stepper-actions">
|
|
44
|
+
<button mat-button matStepperPrevious>Back</button>
|
|
45
|
+
<button mat-flat-button color="warn" (click)="horizontalStepper.reset()">Reset</button>
|
|
46
|
+
</div>
|
|
47
|
+
</mat-step>
|
|
48
|
+
</mat-horizontal-stepper>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<!-- Vertical Stepper Section -->
|
|
52
|
+
<div class="example-section">
|
|
53
|
+
<h3>Vertical Stepper</h3>
|
|
54
|
+
<p>A stepper that displays navigation steps vertically from top to bottom.</p>
|
|
55
|
+
|
|
56
|
+
<mat-vertical-stepper [linear]="true" #verticalStepper>
|
|
57
|
+
<mat-step [stepControl]="verticalFirstFormGroup">
|
|
58
|
+
<form [formGroup]="verticalFirstFormGroup" class="step-content">
|
|
59
|
+
<ng-template matStepLabel>Step 1: Configuration</ng-template>
|
|
60
|
+
<p>Define the task setting triggers actions safely.</p>
|
|
61
|
+
<mat-form-field appearance="outline" class="full-width">
|
|
62
|
+
<mat-label>Setting Name</mat-label>
|
|
63
|
+
<input matInput formControlName="firstCtrl" placeholder="Setting label" required>
|
|
64
|
+
</mat-form-field>
|
|
65
|
+
<div class="stepper-actions">
|
|
66
|
+
<button mat-flat-button color="accent" matStepperNext>Next</button>
|
|
67
|
+
</div>
|
|
68
|
+
</form>
|
|
69
|
+
</mat-step>
|
|
70
|
+
|
|
71
|
+
<mat-step [stepControl]="verticalSecondFormGroup">
|
|
72
|
+
<form [formGroup]="verticalSecondFormGroup" class="step-content">
|
|
73
|
+
<ng-template matStepLabel>Step 2: Deployment</ng-template>
|
|
74
|
+
<p>Enter the target deployment identifier triggers securely.</p>
|
|
75
|
+
<mat-form-field appearance="outline" class="full-width">
|
|
76
|
+
<mat-label>Target ID</mat-label>
|
|
77
|
+
<input matInput formControlName="secondCtrl" placeholder="Ex. prod-instance" required>
|
|
78
|
+
</mat-form-field>
|
|
79
|
+
<div class="stepper-actions">
|
|
80
|
+
<button mat-button matStepperPrevious>Back</button>
|
|
81
|
+
<button mat-flat-button color="accent" matStepperNext>Next</button>
|
|
82
|
+
</div>
|
|
83
|
+
</form>
|
|
84
|
+
</mat-step>
|
|
85
|
+
|
|
86
|
+
<mat-step>
|
|
87
|
+
<ng-template matStepLabel>Step 3: Success</ng-template>
|
|
88
|
+
<div class="step-content">
|
|
89
|
+
<p>Verification complete safely neat triggers anchors.</p>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="stepper-actions">
|
|
92
|
+
<button mat-button matStepperPrevious>Back</button>
|
|
93
|
+
<button mat-flat-button color="warn" (click)="verticalStepper.reset()">Reset</button>
|
|
94
|
+
</div>
|
|
95
|
+
</mat-step>
|
|
96
|
+
</mat-vertical-stepper>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</app-page>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { MatStepperModule } from '@angular/material/stepper';
|
|
5
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
6
|
+
import { MatInputModule } from '@angular/material/input';
|
|
7
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
+
import { PageComponent } from '../../components/page/page';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'app-stepper-demo',
|
|
13
|
+
standalone: true,
|
|
14
|
+
imports: [
|
|
15
|
+
CommonModule,
|
|
16
|
+
ReactiveFormsModule,
|
|
17
|
+
MatStepperModule,
|
|
18
|
+
MatFormFieldModule,
|
|
19
|
+
MatInputModule,
|
|
20
|
+
MatButtonModule,
|
|
21
|
+
MatIconModule,
|
|
22
|
+
PageComponent
|
|
23
|
+
],
|
|
24
|
+
templateUrl: './stepper-demo.html',
|
|
25
|
+
styles: [`
|
|
26
|
+
.demo-container {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
gap: 32px;
|
|
30
|
+
padding: 16px;
|
|
31
|
+
}
|
|
32
|
+
.example-section {
|
|
33
|
+
border: 1px solid var(--mat-divider-color, #e0e0e0);
|
|
34
|
+
border-radius: 8px;
|
|
35
|
+
padding: 24px;
|
|
36
|
+
background-color: #fff;
|
|
37
|
+
}
|
|
38
|
+
.example-section h3 {
|
|
39
|
+
margin-top: 0;
|
|
40
|
+
margin-bottom: 24px;
|
|
41
|
+
color: #333;
|
|
42
|
+
}
|
|
43
|
+
.step-content {
|
|
44
|
+
margin-top: 16px;
|
|
45
|
+
margin-bottom: 24px;
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: 16px;
|
|
49
|
+
max-width: 400px;
|
|
50
|
+
}
|
|
51
|
+
.stepper-actions {
|
|
52
|
+
display: flex;
|
|
53
|
+
gap: 8px;
|
|
54
|
+
}
|
|
55
|
+
.full-width {
|
|
56
|
+
width: 100%;
|
|
57
|
+
}
|
|
58
|
+
`]
|
|
59
|
+
})
|
|
60
|
+
export class StepperDemoComponent {
|
|
61
|
+
// Forms for Horizontal Stepper
|
|
62
|
+
horizontalFirstFormGroup: FormGroup;
|
|
63
|
+
horizontalSecondFormGroup: FormGroup;
|
|
64
|
+
|
|
65
|
+
// Forms for Vertical Stepper
|
|
66
|
+
verticalFirstFormGroup: FormGroup;
|
|
67
|
+
verticalSecondFormGroup: FormGroup;
|
|
68
|
+
|
|
69
|
+
constructor(private _formBuilder: FormBuilder) {
|
|
70
|
+
this.horizontalFirstFormGroup = this._formBuilder.group({
|
|
71
|
+
firstCtrl: ['', Validators.required],
|
|
72
|
+
});
|
|
73
|
+
this.horizontalSecondFormGroup = this._formBuilder.group({
|
|
74
|
+
secondCtrl: ['', Validators.required],
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
this.verticalFirstFormGroup = this._formBuilder.group({
|
|
78
|
+
firstCtrl: ['', Validators.required],
|
|
79
|
+
});
|
|
80
|
+
this.verticalSecondFormGroup = this._formBuilder.group({
|
|
81
|
+
secondCtrl: ['', Validators.required],
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
filepath = '/Users/kjthomas/Projects/prototypes/components/src/app/components/tables/tables-demo.scss'
|
|
4
|
+
|
|
5
|
+
with open(filepath, 'r') as f:
|
|
6
|
+
lines = f.readlines()
|
|
7
|
+
|
|
8
|
+
new_lines = lines[:11] # Keep .table-card
|
|
9
|
+
new_lines.append('\n')
|
|
10
|
+
new_lines.append('.mat-column-position {\n width: 80px;\n}\n')
|
|
11
|
+
new_lines.append('.mat-column-symbol {\n width: 100px;\n}\n')
|
|
12
|
+
|
|
13
|
+
with open(filepath, 'w') as f:
|
|
14
|
+
f.writelines(new_lines)
|
|
15
|
+
|
|
16
|
+
print("Cleaned tables-demo.scss successfully.")
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<app-page title="Tables Demo">
|
|
2
|
+
|
|
3
|
+
<div class="default-container-padding">
|
|
4
|
+
<h2>Sample table</h2>
|
|
5
|
+
<div class="filter-container">
|
|
6
|
+
<mat-icon>filter_list</mat-icon>
|
|
7
|
+
<span class="filter-title">Filter</span>
|
|
8
|
+
<input class="filter-input" (keyup)="applyFilter($event)" placeholder="Filter items">
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="table-container">
|
|
12
|
+
<table mat-table [dataSource]="dataSource" matSort matSortActive="position" matSortDirection="asc">
|
|
13
|
+
|
|
14
|
+
<!-- Checkbox Column -->
|
|
15
|
+
<ng-container matColumnDef="select">
|
|
16
|
+
<th mat-header-cell *matHeaderCellDef>
|
|
17
|
+
<mat-checkbox (change)="$event ? toggleAllRows() : null" [checked]="selection.hasValue() && isAllSelected()"
|
|
18
|
+
[indeterminate]="selection.hasValue() && !isAllSelected()">
|
|
19
|
+
</mat-checkbox>
|
|
20
|
+
</th>
|
|
21
|
+
<td mat-cell *matCellDef="let row">
|
|
22
|
+
<mat-checkbox (click)="$event.stopPropagation()" (change)="$event ? selection.toggle(row) : null"
|
|
23
|
+
[checked]="selection.isSelected(row)">
|
|
24
|
+
</mat-checkbox>
|
|
25
|
+
</td>
|
|
26
|
+
</ng-container>
|
|
27
|
+
|
|
28
|
+
<!-- Position Column -->
|
|
29
|
+
<ng-container matColumnDef="position">
|
|
30
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header> Id </th>
|
|
31
|
+
<td mat-cell *matCellDef="let element"> {{element.position}} </td>
|
|
32
|
+
</ng-container>
|
|
33
|
+
|
|
34
|
+
<!-- Name Column -->
|
|
35
|
+
<ng-container matColumnDef="name">
|
|
36
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header> Primary String </th>
|
|
37
|
+
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
|
|
38
|
+
</ng-container>
|
|
39
|
+
|
|
40
|
+
<!-- Weight Column -->
|
|
41
|
+
<ng-container matColumnDef="weight">
|
|
42
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header> Oddness </th>
|
|
43
|
+
<td mat-cell *matCellDef="let element"> {{element.weight}} </td>
|
|
44
|
+
</ng-container>
|
|
45
|
+
|
|
46
|
+
<!-- Symbol Column -->
|
|
47
|
+
<ng-container matColumnDef="symbol">
|
|
48
|
+
<th mat-header-cell *matHeaderCellDef mat-sort-header> Color </th>
|
|
49
|
+
<td mat-cell *matCellDef="let element"> {{element.symbol}} </td>
|
|
50
|
+
</ng-container>
|
|
51
|
+
|
|
52
|
+
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
53
|
+
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [class.selected]="selection.isSelected(row)"></tr>
|
|
54
|
+
|
|
55
|
+
<!-- Row shown when there is no matching data. -->
|
|
56
|
+
<tr class="mat-row" *matNoDataRow>
|
|
57
|
+
<td class="mat-cell" colspan="4">No data matching the filter: "{{dataSource.filter}}"</td>
|
|
58
|
+
</tr>
|
|
59
|
+
</table>
|
|
60
|
+
|
|
61
|
+
<mat-paginator [pageSizeOptions]="[5, 10, 20]" showFirstLastButtons></mat-paginator>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</app-page>
|