@goat-bravos/intern-hub-layout 1.0.0
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/.editorconfig +17 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/mcp.json +9 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +267 -0
- package/angular.json +131 -0
- package/ng-package.json +7 -0
- package/package.json +46 -0
- package/projects/layout-templates/README.md +63 -0
- package/projects/layout-templates/ng-package.json +7 -0
- package/projects/layout-templates/package.json +12 -0
- package/projects/layout-templates/src/lib/layout-templates.spec.ts +23 -0
- package/projects/layout-templates/src/lib/layout-templates.ts +15 -0
- package/projects/layout-templates/src/public-api.ts +5 -0
- package/projects/layout-templates/tsconfig.lib.json +17 -0
- package/projects/layout-templates/tsconfig.lib.prod.json +11 -0
- package/projects/layout-templates/tsconfig.spec.json +15 -0
- package/projects/ui-components/README.md +63 -0
- package/projects/ui-components/ng-package.json +7 -0
- package/projects/ui-components/package.json +12 -0
- package/projects/ui-components/src/lib/ui-components.spec.ts +23 -0
- package/projects/ui-components/src/lib/ui-components.ts +15 -0
- package/projects/ui-components/src/public-api.ts +5 -0
- package/projects/ui-components/tsconfig.lib.json +17 -0
- package/projects/ui-components/tsconfig.lib.prod.json +11 -0
- package/projects/ui-components/tsconfig.spec.json +15 -0
- package/public/B/341/273/231 icon message (1).svg" +87 -0
- package/public/B/341/273/231 icon message (2).svg" +104 -0
- package/public/B/341/273/231 icon message.svg" +98 -0
- package/public/FPT-IS-Logo.png +0 -0
- package/public/FPT_IS_Logo.svg +12 -0
- package/public/favicon.ico +0 -0
- package/public/federation.manifest.json +8 -0
- package/src/app/app.config.ts +22 -0
- package/src/app/app.html +1 -0
- package/src/app/app.routes.ts +24 -0
- package/src/app/app.scss +0 -0
- package/src/app/app.spec.ts +23 -0
- package/src/app/app.ts +19 -0
- package/src/index.html +15 -0
- package/src/libs/layouts/header/header.component.html +27 -0
- package/src/libs/layouts/header/header.component.scss +96 -0
- package/src/libs/layouts/header/header.component.ts +13 -0
- package/src/libs/layouts/main-layout/main-layout.component.html +15 -0
- package/src/libs/layouts/main-layout/main-layout.component.scss +35 -0
- package/src/libs/layouts/main-layout/main-layout.component.ts +17 -0
- package/src/libs/layouts/main-layout-test/main-layout-test.component.html +296 -0
- package/src/libs/layouts/main-layout-test/main-layout-test.component.scss +94 -0
- package/src/libs/layouts/main-layout-test/main-layout-test.component.ts +121 -0
- package/src/libs/layouts/sidebar/sidebar.component.html +7 -0
- package/src/libs/layouts/sidebar/sidebar.component.scss +38 -0
- package/src/libs/layouts/sidebar/sidebar.component.ts +19 -0
- package/src/libs/shared/components/approval/approval-list/approval-list.component.html +19 -0
- package/src/libs/shared/components/approval/approval-list/approval-list.component.scss +24 -0
- package/src/libs/shared/components/approval/approval-list/approval-list.component.ts +19 -0
- package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.html +21 -0
- package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.scss +28 -0
- package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.ts +20 -0
- package/src/libs/shared/components/approval/approval-list-item/approval-list-item.model.ts +8 -0
- package/src/libs/shared/components/button/button-container/button-container.component.html +20 -0
- package/src/libs/shared/components/button/button-container/button-container.component.scss +49 -0
- package/src/libs/shared/components/button/button-container/button-container.component.ts +38 -0
- package/src/libs/shared/components/button/button-container/button-container.model.ts +58 -0
- package/src/libs/shared/components/button/label-button/label-button.component.html +11 -0
- package/src/libs/shared/components/button/label-button/label-button.component.scss +13 -0
- package/src/libs/shared/components/button/label-button/label-button.component.ts +18 -0
- package/src/libs/shared/components/functional-label/functional-label.component.html +4 -0
- package/src/libs/shared/components/functional-label/functional-label.component.scss +58 -0
- package/src/libs/shared/components/functional-label/functional-label.component.ts +15 -0
- package/src/libs/shared/components/input/input-calendar/input-calendar.component.html +52 -0
- package/src/libs/shared/components/input/input-calendar/input-calendar.component.scss +98 -0
- package/src/libs/shared/components/input/input-calendar/input-calendar.component.ts +102 -0
- package/src/libs/shared/components/input/input-label/input-label.component.html +0 -0
- package/src/libs/shared/components/input/input-label/input-label.component.scss +0 -0
- package/src/libs/shared/components/input/input-label/input-label.component.ts +0 -0
- package/src/libs/shared/components/input/input-stepper/input-stepper.component.html +62 -0
- package/src/libs/shared/components/input/input-stepper/input-stepper.component.scss +211 -0
- package/src/libs/shared/components/input/input-stepper/input-stepper.component.ts +73 -0
- package/src/libs/shared/components/input/input-text/input-text.component.html +40 -0
- package/src/libs/shared/components/input/input-text/input-text.component.scss +143 -0
- package/src/libs/shared/components/input/input-text/input-text.component.ts +63 -0
- package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.html +15 -0
- package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.scss +70 -0
- package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.ts +29 -0
- package/src/libs/shared/components/table/table-body/table-body.component.html +18 -0
- package/src/libs/shared/components/table/table-body/table-body.component.scss +6 -0
- package/src/libs/shared/components/table/table-body/table-body.component.ts +17 -0
- package/src/libs/shared/components/table/table-header/table-header.component.html +27 -0
- package/src/libs/shared/components/table/table-header/table-header.component.scss +91 -0
- package/src/libs/shared/components/table/table-header/table-header.component.ts +25 -0
- package/src/main.ts +6 -0
- package/src/public-api.ts +22 -0
- package/src/styles.scss +27 -0
- package/tsconfig.app.json +15 -0
- package/tsconfig.json +53 -0
- package/tsconfig.spec.json +15 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Component, TemplateRef, ViewChild } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { RouterOutlet } from '@angular/router';
|
|
4
|
+
|
|
5
|
+
import { ApprovalListItemInterface } from '../../shared/components/approval/approval-list-item/approval-list-item.model';
|
|
6
|
+
import { ButtonContainerComponent } from '../../shared/components/button/button-container/button-container.component';
|
|
7
|
+
import { InputTextComponent } from '../../shared/components/input/input-text/input-text.component';
|
|
8
|
+
import { InputCalendarComponent } from '../../shared/components/input/input-calendar/input-calendar.component';
|
|
9
|
+
import { ApprovalListComponent } from '../../shared/components/approval/approval-list/approval-list.component';
|
|
10
|
+
import { PopUpConfirmComponent } from '../../shared/components/pop-up/pop-up-confirm/pop-up-confirm.component';
|
|
11
|
+
import { InputStepperComponent } from '../../shared/components/input/input-stepper/input-stepper.component';
|
|
12
|
+
import { TableBodyComponent } from '../../shared/components/table/table-body/table-body.component';
|
|
13
|
+
import {
|
|
14
|
+
ColumnConfig,
|
|
15
|
+
TableHeaderComponent,
|
|
16
|
+
} from '../../shared/components/table/table-header/table-header.component';
|
|
17
|
+
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'app-main-layout-test',
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [
|
|
22
|
+
CommonModule,
|
|
23
|
+
RouterOutlet,
|
|
24
|
+
ButtonContainerComponent,
|
|
25
|
+
ApprovalListComponent,
|
|
26
|
+
InputTextComponent,
|
|
27
|
+
InputCalendarComponent,
|
|
28
|
+
PopUpConfirmComponent,
|
|
29
|
+
InputStepperComponent,
|
|
30
|
+
TableBodyComponent,
|
|
31
|
+
TableHeaderComponent,
|
|
32
|
+
],
|
|
33
|
+
templateUrl: './main-layout-test.component.html',
|
|
34
|
+
styleUrls: ['./main-layout-test.component.scss'],
|
|
35
|
+
})
|
|
36
|
+
export class MainLayoutTestComponent {
|
|
37
|
+
@ViewChild('textRight', { static: true })
|
|
38
|
+
textRight!: TemplateRef<any>;
|
|
39
|
+
|
|
40
|
+
@ViewChild('buttonRight', { static: true })
|
|
41
|
+
buttonRight!: TemplateRef<any>;
|
|
42
|
+
|
|
43
|
+
// Sample data for approval list
|
|
44
|
+
approvalRows: ApprovalListItemInterface[] = [
|
|
45
|
+
{ name: 'Nguyễn Văn A', date: new Date('2026-01-15') },
|
|
46
|
+
{ name: 'Trần Thị B', date: new Date('2026-01-20') },
|
|
47
|
+
{ name: 'Lê Văn C', date: new Date('2026-01-25') },
|
|
48
|
+
{ name: 'Phạm Thị D', date: new Date('2026-01-28') },
|
|
49
|
+
];
|
|
50
|
+
tableBackgroundColor = 'var(--brand-600)';
|
|
51
|
+
|
|
52
|
+
columns: ColumnConfig[] = [
|
|
53
|
+
{ key: 'name', header: 'Tên', width: '20%' },
|
|
54
|
+
{ key: 'role', header: 'Chức vụ', width: '15%' },
|
|
55
|
+
{ key: 'status', header: 'Trạng thái', width: '15%' },
|
|
56
|
+
{ key: 'email', header: 'Email', width: '30%' },
|
|
57
|
+
{ key: 'date', header: 'Ngày', width: '20%' },
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
rows = [
|
|
61
|
+
{
|
|
62
|
+
name: 'Nguyễn Văn A',
|
|
63
|
+
role: 'Developer',
|
|
64
|
+
status: 'Active',
|
|
65
|
+
email: 'a.nguyen@example.com',
|
|
66
|
+
date: '15/01/2026',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Trần Thị B',
|
|
70
|
+
role: 'Tester',
|
|
71
|
+
status: 'Inactive',
|
|
72
|
+
email: 'b.tran@example.com',
|
|
73
|
+
date: '20/01/2026',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'Lê Văn C',
|
|
77
|
+
role: 'Manager',
|
|
78
|
+
status: 'Active',
|
|
79
|
+
email: 'c.le@example.com',
|
|
80
|
+
date: '25/01/2026',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'Phạm Thị D',
|
|
84
|
+
role: 'Designer',
|
|
85
|
+
status: 'Pending',
|
|
86
|
+
email: 'd.pham@example.com',
|
|
87
|
+
date: '28/01/2026',
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
showPopup = false;
|
|
92
|
+
|
|
93
|
+
onButtonClick(buttonName: string): void {
|
|
94
|
+
console.log(`Button clicked: ${buttonName}`);
|
|
95
|
+
this.showPopup = true;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
onPopupConfirm(): void {
|
|
99
|
+
console.log('✅ Popup confirmed!');
|
|
100
|
+
this.showPopup = false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
onPopupCancel(): void {
|
|
104
|
+
console.log('❌ Popup cancelled!');
|
|
105
|
+
this.showPopup = false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Password toggle logic demo
|
|
109
|
+
passwordType: 'text' | 'password' = 'password';
|
|
110
|
+
passwordIcon: string = 'fa-solid fa-eye-slash';
|
|
111
|
+
|
|
112
|
+
togglePassword(): void {
|
|
113
|
+
if (this.passwordType === 'password') {
|
|
114
|
+
this.passwordType = 'text';
|
|
115
|
+
this.passwordIcon = 'fa-solid fa-eye';
|
|
116
|
+
} else {
|
|
117
|
+
this.passwordType = 'password';
|
|
118
|
+
this.passwordIcon = 'fa-solid fa-eye-slash';
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Sidebar Component - System Design Format
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
height: 100%; // Đảm bảo component chiếm hết chiều cao của cha
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sidebar-wrapper {
|
|
8
|
+
width: 56px;
|
|
9
|
+
height: 100%;
|
|
10
|
+
transition: width 0.3s ease;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.sidebar {
|
|
14
|
+
width: 56px;
|
|
15
|
+
height: 100%;
|
|
16
|
+
padding: 8px;
|
|
17
|
+
box-sizing: border-box; // Giữ nguyên chiều cao khi thay đổi padding
|
|
18
|
+
|
|
19
|
+
background-color: var(--brand-600);
|
|
20
|
+
// Bo góc trên, nhưng bỏ bo góc dưới để tràn xuống
|
|
21
|
+
border-radius: 16px;
|
|
22
|
+
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
|
|
25
|
+
transition:
|
|
26
|
+
width 0.3s ease,
|
|
27
|
+
padding 0.3s ease,
|
|
28
|
+
background-color 0.3s ease;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.sidebar-wrapper:hover {
|
|
32
|
+
width: 344px;
|
|
33
|
+
.sidebar {
|
|
34
|
+
width: 344px;
|
|
35
|
+
padding: 16px;
|
|
36
|
+
background-color: var(--theme-neutral-light-100);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FunctionalLabelComponent } from '../../shared/components/functional-label/functional-label.component';
|
|
4
|
+
|
|
5
|
+
export interface SidebarItem {
|
|
6
|
+
icon: string;
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'app-sidebar',
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [CommonModule, FunctionalLabelComponent],
|
|
14
|
+
templateUrl: './sidebar.component.html',
|
|
15
|
+
styleUrls: ['./sidebar.component.scss'],
|
|
16
|
+
})
|
|
17
|
+
export class SidebarComponent {
|
|
18
|
+
@Input() menuItems: SidebarItem[] = [];
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<div class="approval-list" [style.width]="width">
|
|
2
|
+
<div class="approval-list-header">
|
|
3
|
+
<span class="approval-list-header-left">{{ headerContentRight }}</span>
|
|
4
|
+
<div>
|
|
5
|
+
<p>{{ headerContentLeft }}</p>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="approval-list-content" [style.width]="width">
|
|
10
|
+
<app-approval-list-item
|
|
11
|
+
*ngFor="let row of rows"
|
|
12
|
+
[name]="row.name"
|
|
13
|
+
[date]="row.date"
|
|
14
|
+
[rightTemplate]="row.rightTemplate"
|
|
15
|
+
[rightContext]="row.rightContext"
|
|
16
|
+
>
|
|
17
|
+
</app-approval-list-item>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.approval-list {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
background-color: var(--theme-neutral-light-100);
|
|
5
|
+
border-radius: 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.approval-list-header {
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
align-items: center;
|
|
12
|
+
padding: 16px 8px;
|
|
13
|
+
height: fit-content;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.approval-list-header span {
|
|
17
|
+
font-size: 20px;
|
|
18
|
+
color: var(--brand-600);
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.approval-list-header p {
|
|
23
|
+
font-size: var(--font-sm);
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { ApprovalListItemInterface } from '../approval-list-item/approval-list-item.model';
|
|
4
|
+
import { ApprovalListItemComponent } from '../approval-list-item/approval-list-item.component';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-approval-list',
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [CommonModule, ApprovalListItemComponent],
|
|
10
|
+
templateUrl: './approval-list.component.html',
|
|
11
|
+
styleUrls: ['./approval-list.component.scss'],
|
|
12
|
+
})
|
|
13
|
+
export class ApprovalListComponent {
|
|
14
|
+
@Input() rows: ApprovalListItemInterface[] = [];
|
|
15
|
+
|
|
16
|
+
@Input() headerContentRight!: string;
|
|
17
|
+
@Input() headerContentLeft!: string;
|
|
18
|
+
@Input() width!: string;
|
|
19
|
+
}
|
package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.html
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div class="approval-item">
|
|
2
|
+
<!-- LEFT -->
|
|
3
|
+
<div class="approval-item-left">
|
|
4
|
+
<span class="approval-item-left-name">{{ name }}</span>
|
|
5
|
+
<span class="approval-item-left-date">
|
|
6
|
+
<span class="approval-item-left-date-title">Ngày tạo đơn:</span>
|
|
7
|
+
{{ date | date: 'dd/MM/yyyy' }}
|
|
8
|
+
</span>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="approval-item-right">
|
|
12
|
+
<ng-container *ngIf="rightTemplate; else defaultRight">
|
|
13
|
+
<ng-container *ngTemplateOutlet="rightTemplate; context: rightContext">
|
|
14
|
+
</ng-container>
|
|
15
|
+
</ng-container>
|
|
16
|
+
|
|
17
|
+
<ng-template #defaultRight>
|
|
18
|
+
<span class="text-gray-400">—</span>
|
|
19
|
+
</ng-template>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.scss
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.approval-item {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
min-width: 400px;
|
|
5
|
+
height: fit-content;
|
|
6
|
+
align-items: center;
|
|
7
|
+
padding: 16px 8px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.approval-item-left-date-title {
|
|
11
|
+
color: var(--theme-neutral-500);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.approval-item-right p {
|
|
15
|
+
color: var(--secondary-800);
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.approval-item-left {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
span,
|
|
26
|
+
p {
|
|
27
|
+
font-size: var(--font-sm);
|
|
28
|
+
}
|
package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, Input, TemplateRef } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-approval-list-item',
|
|
6
|
+
templateUrl: './approval-list-item.component.html',
|
|
7
|
+
styleUrls: ['./approval-list-item.component.scss'],
|
|
8
|
+
imports: [CommonModule],
|
|
9
|
+
standalone: true
|
|
10
|
+
})
|
|
11
|
+
export class ApprovalListItemComponent {
|
|
12
|
+
@Input() name!: string;
|
|
13
|
+
@Input() date!: Date;
|
|
14
|
+
@Input() rightTemplate?: TemplateRef<any>;
|
|
15
|
+
@Input() rightContext: any = {};
|
|
16
|
+
|
|
17
|
+
get parsedDate(): Date {
|
|
18
|
+
return new Date(this.date);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<button class="button-container" [style.minWidth]="sizeStyle.minWidth" [style.minHeight]="sizeStyle.minHeight" [style.color]="color"
|
|
2
|
+
[style.backgroundColor]="backgroundColor" [style.borderColor]="borderColor" (click)="handleClick()">
|
|
3
|
+
|
|
4
|
+
@if(leftIcon){
|
|
5
|
+
<i class="button-icon" [style.width]="sizeStyle.iconSize" [style.height]="sizeStyle.iconSize" [style.fontSize]="sizeStyle.iconSize">
|
|
6
|
+
{{leftIcon}}
|
|
7
|
+
</i>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
<span class="button-content" [style.minWidth]="sizeStyle.contentWidth" [style.minHeight]="sizeStyle.contentHeight"
|
|
11
|
+
[style.fontSize]="fontSize || sizeStyle.fontSize" [style.color]="color">
|
|
12
|
+
{{ content }}
|
|
13
|
+
</span>
|
|
14
|
+
|
|
15
|
+
@if(rightIcon){
|
|
16
|
+
<i class="button-icon" [style.width]="sizeStyle.iconSize" [style.height]="sizeStyle.iconSize" [style.fontSize]="sizeStyle.iconSize" [style.color]="color">
|
|
17
|
+
{{rightIcon}}
|
|
18
|
+
</i>
|
|
19
|
+
}
|
|
20
|
+
</button>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Button Container Component - System Design Format
|
|
2
|
+
|
|
3
|
+
.button-container {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
border-radius: var(--radius-md);
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
padding: 8px 16px;
|
|
11
|
+
border: none;
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
transition:
|
|
14
|
+
filter 0.15s ease,
|
|
15
|
+
transform 0.1s ease;
|
|
16
|
+
|
|
17
|
+
// Hover: sáng hơn một chút
|
|
18
|
+
&:hover {
|
|
19
|
+
filter: brightness(1.1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Active/Pressing: tối hơn một chút
|
|
23
|
+
&:active {
|
|
24
|
+
filter: brightness(0.9);
|
|
25
|
+
transform: scale(0.98);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Focus state
|
|
29
|
+
&:focus {
|
|
30
|
+
outline: 2px solid var(--brand-600);
|
|
31
|
+
outline-offset: 2px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.button-content {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
text-overflow: ellipsis;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.button-icon {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import {
|
|
4
|
+
ButtonSize,
|
|
5
|
+
BUTTON_SIZE_MAP
|
|
6
|
+
} from './button-container.model';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-button-container',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [CommonModule],
|
|
12
|
+
templateUrl: './button-container.component.html',
|
|
13
|
+
styleUrls: ['./button-container.component.scss']
|
|
14
|
+
})
|
|
15
|
+
export class ButtonContainerComponent {
|
|
16
|
+
|
|
17
|
+
@Input() size: ButtonSize = 'md';
|
|
18
|
+
@Input() content = '';
|
|
19
|
+
|
|
20
|
+
@Input() fontSize?: string;
|
|
21
|
+
|
|
22
|
+
@Input() leftIcon?: string;
|
|
23
|
+
@Input() rightIcon?: string;
|
|
24
|
+
|
|
25
|
+
@Input() color = 'var(--brand-100)';
|
|
26
|
+
@Input() backgroundColor = 'var(--utility-900)';
|
|
27
|
+
@Input() borderColor = 'var(--brand-100)';
|
|
28
|
+
|
|
29
|
+
@Output() buttonClick = new EventEmitter<any>();
|
|
30
|
+
|
|
31
|
+
get sizeStyle() {
|
|
32
|
+
return BUTTON_SIZE_MAP[this.size];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
handleClick(): void {
|
|
36
|
+
this.buttonClick.emit();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface ButtonContainerInterface {
|
|
2
|
+
size: ButtonSize;
|
|
3
|
+
leftIcon?: string;
|
|
4
|
+
rightIcon?: string;
|
|
5
|
+
content: string;
|
|
6
|
+
event?: string;
|
|
7
|
+
fontSize?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
borderColor?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
14
|
+
|
|
15
|
+
export interface ButtonSizeConfig {
|
|
16
|
+
minWidth: string;
|
|
17
|
+
minHeight: string;
|
|
18
|
+
fontSize: string;
|
|
19
|
+
iconSize: string;
|
|
20
|
+
contentWidth: string;
|
|
21
|
+
contentHeight: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const BUTTON_SIZE_MAP: Record<ButtonSize, ButtonSizeConfig> = {
|
|
25
|
+
xs: {
|
|
26
|
+
minWidth: '47px',
|
|
27
|
+
minHeight: '24px',
|
|
28
|
+
fontSize: 'var(--font-xs)',
|
|
29
|
+
iconSize: '14px',
|
|
30
|
+
contentWidth: '32px',
|
|
31
|
+
contentHeight: '16px',
|
|
32
|
+
},
|
|
33
|
+
sm: {
|
|
34
|
+
minWidth: '96px',
|
|
35
|
+
minHeight: '28px',
|
|
36
|
+
fontSize: 'var(--font-sm)',
|
|
37
|
+
iconSize: '16px',
|
|
38
|
+
contentWidth: '44px',
|
|
39
|
+
contentHeight: '20px',
|
|
40
|
+
},
|
|
41
|
+
md: {
|
|
42
|
+
minWidth: '116px',
|
|
43
|
+
minHeight: '36px',
|
|
44
|
+
fontSize: 'var(--font-sm)',
|
|
45
|
+
iconSize: '20px',
|
|
46
|
+
contentWidth: '52px',
|
|
47
|
+
contentHeight: '20px',
|
|
48
|
+
},
|
|
49
|
+
lg: {
|
|
50
|
+
minWidth: '120px',
|
|
51
|
+
minHeight: '44px',
|
|
52
|
+
fontSize: 'var(--font-sm)',
|
|
53
|
+
iconSize: '20px',
|
|
54
|
+
contentWidth: '52px',
|
|
55
|
+
contentHeight: '20px',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.label-button {
|
|
2
|
+
padding: 16px 8px;
|
|
3
|
+
border-radius: 16px;
|
|
4
|
+
border: 1px solid var(--border-color);
|
|
5
|
+
background-color: var(--bg-color);
|
|
6
|
+
font-size: var(--font-xs);
|
|
7
|
+
font-weight: var(--font-weight-medium);
|
|
8
|
+
line-height: var(--line-height-xs);
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
text-align: center;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-label-button',
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
templateUrl: './label-button.component.html',
|
|
9
|
+
styleUrls: ['./label-button.component.scss'],
|
|
10
|
+
})
|
|
11
|
+
export class LabelButtonComponent {
|
|
12
|
+
@Input() label: string = '';
|
|
13
|
+
@Input() bgColor: string = '';
|
|
14
|
+
@Input() borderColor: string = '';
|
|
15
|
+
@Input() width: string = '100%';
|
|
16
|
+
@Input() height: string = '28px';
|
|
17
|
+
@Input() textColor: string = 'var(--neutral-100)';
|
|
18
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Functional Label Component - System Design Format
|
|
2
|
+
|
|
3
|
+
.functional-label {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
|
|
8
|
+
height: 36px;
|
|
9
|
+
gap: 0;
|
|
10
|
+
padding: 4px 8px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
|
|
13
|
+
transition:
|
|
14
|
+
gap 0.25s ease,
|
|
15
|
+
justify-content 0.25s ease;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.functional-label-icon {
|
|
19
|
+
min-width: 20px;
|
|
20
|
+
height: 20px;
|
|
21
|
+
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
align-items: center;
|
|
25
|
+
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
|
|
28
|
+
color: var(--neutral-color-200);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.functional-label a {
|
|
32
|
+
min-width: 100px;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
display: none;
|
|
35
|
+
padding: 8px;
|
|
36
|
+
|
|
37
|
+
color: var(--neutral-color-200);
|
|
38
|
+
font-size: var(--font-sm);
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
|
|
41
|
+
opacity: 0;
|
|
42
|
+
transform: translateX(-8px);
|
|
43
|
+
|
|
44
|
+
transition:
|
|
45
|
+
opacity 0.15s ease,
|
|
46
|
+
transform 0.15s ease;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host-context(.sidebar-wrapper:hover) .functional-label {
|
|
50
|
+
justify-content: flex-start;
|
|
51
|
+
gap: 12px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host-context(.sidebar-wrapper:hover) .functional-label a {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
transform: translateX(0);
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-functional-label',
|
|
6
|
+
standalone: true,
|
|
7
|
+
imports: [CommonModule],
|
|
8
|
+
templateUrl: './functional-label.component.html',
|
|
9
|
+
styleUrls: ['./functional-label.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class FunctionalLabelComponent {
|
|
12
|
+
@Input() icon?: string;
|
|
13
|
+
@Input() content: string = '';
|
|
14
|
+
|
|
15
|
+
}
|