@goat-bravos/intern-hub-layout 1.0.5 → 1.2.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.
Files changed (64) hide show
  1. package/.editorconfig +17 -0
  2. package/.vscode/extensions.json +4 -0
  3. package/.vscode/launch.json +20 -0
  4. package/.vscode/mcp.json +9 -0
  5. package/.vscode/tasks.json +42 -0
  6. package/README.md +629 -254
  7. package/angular.json +40 -0
  8. package/ng-package.json +11 -0
  9. package/package.json +24 -16
  10. package/src/libs/layouts/header/header.component.html +58 -0
  11. package/src/libs/layouts/header/header.component.scss +108 -0
  12. package/src/libs/layouts/header/header.component.ts +70 -0
  13. package/src/libs/layouts/sidebar/sidebar.component.html +28 -0
  14. package/src/libs/layouts/sidebar/sidebar.component.scss +44 -0
  15. package/src/libs/layouts/sidebar/sidebar.component.ts +55 -0
  16. package/src/libs/shared/components/approval/approval-list/approval-list.component.html +19 -0
  17. package/src/libs/shared/components/approval/approval-list/approval-list.component.scss +24 -0
  18. package/src/libs/shared/components/approval/approval-list/approval-list.component.ts +19 -0
  19. package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.html +21 -0
  20. package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.scss +28 -0
  21. package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.ts +20 -0
  22. package/src/libs/shared/components/approval/approval-list-item/approval-list-item.model.ts +8 -0
  23. package/src/libs/shared/components/button/button-container/button-container.component.html +20 -0
  24. package/src/libs/shared/components/button/button-container/button-container.component.scss +49 -0
  25. package/src/libs/shared/components/button/button-container/button-container.component.ts +34 -0
  26. package/src/libs/shared/components/button/button-container/button-container.model.ts +58 -0
  27. package/src/libs/shared/components/button/label-button/label-button.component.html +11 -0
  28. package/src/libs/shared/components/button/label-button/label-button.component.scss +13 -0
  29. package/src/libs/shared/components/button/label-button/label-button.component.ts +18 -0
  30. package/src/libs/shared/components/functional-label/functional-label.component.html +36 -0
  31. package/src/libs/shared/components/functional-label/functional-label.component.scss +56 -0
  32. package/src/libs/shared/components/functional-label/functional-label.component.ts +141 -0
  33. package/src/libs/shared/components/icon/icon.component.html +12 -0
  34. package/src/libs/shared/components/icon/icon.component.scss +11 -0
  35. package/src/libs/shared/components/icon/icon.component.ts +61 -0
  36. package/src/libs/shared/components/input/input-calendar/input-calendar.component.html +52 -0
  37. package/src/libs/shared/components/input/input-calendar/input-calendar.component.scss +98 -0
  38. package/src/libs/shared/components/input/input-calendar/input-calendar.component.ts +126 -0
  39. package/src/libs/shared/components/input/input-label/input-label.component.html +0 -0
  40. package/src/libs/shared/components/input/input-label/input-label.component.scss +0 -0
  41. package/src/libs/shared/components/input/input-label/input-label.component.ts +0 -0
  42. package/src/libs/shared/components/input/input-stepper/input-stepper.component.html +62 -0
  43. package/src/libs/shared/components/input/input-stepper/input-stepper.component.scss +211 -0
  44. package/src/libs/shared/components/input/input-stepper/input-stepper.component.ts +73 -0
  45. package/src/libs/shared/components/input/input-text/input-text.component.html +40 -0
  46. package/src/libs/shared/components/input/input-text/input-text.component.scss +143 -0
  47. package/src/libs/shared/components/input/input-text/input-text.component.ts +63 -0
  48. package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.html +15 -0
  49. package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.scss +70 -0
  50. package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.ts +29 -0
  51. package/src/libs/shared/components/table/table-body/table-body.component.html +18 -0
  52. package/src/libs/shared/components/table/table-body/table-body.component.scss +6 -0
  53. package/src/libs/shared/components/table/table-body/table-body.component.ts +17 -0
  54. package/src/libs/shared/components/table/table-header/table-header.component.html +27 -0
  55. package/src/libs/shared/components/table/table-header/table-header.component.scss +91 -0
  56. package/src/libs/shared/components/table/table-header/table-header.component.ts +25 -0
  57. package/src/public-api.ts +34 -0
  58. package/tsconfig.json +38 -0
  59. package/tsconfig.lib.json +17 -0
  60. package/tsconfig.lib.prod.json +11 -0
  61. package/tsconfig.spec.json +15 -0
  62. package/fesm2022/goat-bravos-intern-hub-layout.mjs +0 -561
  63. package/fesm2022/goat-bravos-intern-hub-layout.mjs.map +0 -1
  64. package/types/goat-bravos-intern-hub-layout.d.ts +0 -189
@@ -0,0 +1,63 @@
1
+ import { Component, Input, Output, EventEmitter } from "@angular/core";
2
+ import { CommonModule } from "@angular/common";
3
+ import { FormsModule } from "@angular/forms";
4
+
5
+ @Component({
6
+ selector: 'app-input-text',
7
+ standalone: true,
8
+ imports: [CommonModule, FormsModule],
9
+ templateUrl: './input-text.component.html',
10
+ styleUrls: ['./input-text.component.scss'],
11
+ })
12
+ export class InputTextComponent {
13
+ @Input() headerInput: string = '';
14
+ @Input() placeholder: string = '';
15
+ @Input() readonly: boolean = false;
16
+ @Input() required: boolean = false;
17
+ @Input() width: string = '100%';
18
+ @Input() maxLength: number = 0; // 0 = no limit
19
+ @Input() showLimit: boolean = false;
20
+ @Input() icon: string = '';
21
+ @Input() typeInput: string = 'text';
22
+
23
+ @Output() valueChange = new EventEmitter<string>();
24
+ @Output() iconClick = new EventEmitter<void>();
25
+
26
+ private _value: string = '';
27
+
28
+ onIconClick(): void {
29
+ this.iconClick.emit();
30
+ }
31
+
32
+ @Input()
33
+ set value(val: string) {
34
+ this._value = val || '';
35
+ }
36
+
37
+ get value(): string {
38
+ return this._value;
39
+ }
40
+
41
+ get currentLength(): number {
42
+ return this._value?.length || 0;
43
+ }
44
+
45
+ get limit(): string {
46
+ if (!this.showLimit || this.maxLength <= 0) return '';
47
+ return `${this.currentLength}/${this.maxLength}`;
48
+ }
49
+
50
+ onInput(event: Event): void {
51
+ const input = event.target as HTMLInputElement;
52
+ let newValue = input.value;
53
+
54
+ // Enforce maxLength if set
55
+ if (this.maxLength > 0 && newValue.length > this.maxLength) {
56
+ newValue = newValue.substring(0, this.maxLength);
57
+ input.value = newValue;
58
+ }
59
+
60
+ this._value = newValue;
61
+ this.valueChange.emit(this._value);
62
+ }
63
+ }
@@ -0,0 +1,15 @@
1
+ <div class="pop-up-confirm-overlay" role="dialog" aria-modal="true" aria-labelledby="popup-title">
2
+ <div class="pop-up-confirm">
3
+ <div class="pop-up-confirm-content">
4
+ <img *ngIf="imgUrl" [src]="imgUrl" alt="">
5
+ <div class="pop-up-confirm-text">
6
+ <p class="pop-up-title" id="popup-title">{{title}}</p>
7
+ <p class="pop-up-content">{{content}}</p>
8
+ </div>
9
+ </div>
10
+ <div class="pop-up-confirm-actions">
11
+ <app-button-container size="md" content="Quay Lại" backgroundColor="var(--neutral-100)" color="var(--neutral-800)" (buttonClick)="onCancel()"></app-button-container>
12
+ <app-button-container size="md" content="Đồng Ý" [backgroundColor]="colorButton" color="#fff" (buttonClick)="onConfirm()"></app-button-container>
13
+ </div>
14
+ </div>
15
+ </div>
@@ -0,0 +1,70 @@
1
+ // Pop-up Confirm Component - System Design Format
2
+
3
+ .pop-up-confirm-overlay {
4
+ position: fixed;
5
+ top: 0;
6
+ left: 0;
7
+ width: 100%;
8
+ height: 100%;
9
+ background-color: rgba(var(--neutral-color-875-rgb, 30, 34, 37), 0.5);
10
+ display: flex;
11
+ justify-content: center;
12
+ align-items: center;
13
+ z-index: 1000;
14
+ }
15
+
16
+ .pop-up-confirm {
17
+ background-color: var(--neutral-color-10);
18
+ border-radius: var(--radius-lg);
19
+ padding: 24px;
20
+ min-width: 320px;
21
+ max-width: 400px;
22
+ box-shadow: 0 4px 20px rgba(var(--neutral-color-875-rgb, 30, 34, 37), 0.15);
23
+ }
24
+
25
+ .pop-up-confirm-content {
26
+ display: flex;
27
+ gap: 16px;
28
+ align-items: center;
29
+ justify-content: center;
30
+ flex-direction: column;
31
+ margin-bottom: 24px;
32
+ width: 352px;
33
+ height: 172px;
34
+
35
+ img {
36
+ width: 96px;
37
+ height: 96px;
38
+ object-fit: contain;
39
+ flex-shrink: 0;
40
+ }
41
+ }
42
+
43
+ .pop-up-confirm-text {
44
+ display: flex;
45
+ flex-direction: column;
46
+ justify-content: center;
47
+ align-items: center;
48
+ gap: 8px;
49
+ }
50
+
51
+ .pop-up-title {
52
+ font-size: var(--font-xl);
53
+ font-weight: 600;
54
+ color: var(--neutral-color-875);
55
+ margin: 0;
56
+ }
57
+
58
+ .pop-up-content {
59
+ font-size: var(--font-sm);
60
+ color: var(--neutral-color-500);
61
+ margin: 0;
62
+ }
63
+
64
+ .pop-up-confirm-actions {
65
+ display: flex;
66
+ gap: 12px;
67
+ justify-content: center;
68
+ align-items: center;
69
+ padding: 16px 8px;
70
+ }
@@ -0,0 +1,29 @@
1
+ import { Component, Input, Output, EventEmitter } from "@angular/core";
2
+ import { CommonModule } from "@angular/common";
3
+ import { ButtonContainerComponent } from "../../button/button-container/button-container.component";
4
+
5
+ @Component({
6
+ selector: 'app-pop-up-confirm',
7
+ standalone: true,
8
+ imports: [CommonModule, ButtonContainerComponent],
9
+ templateUrl: './pop-up-confirm.component.html',
10
+ styleUrls: ['./pop-up-confirm.component.scss'],
11
+ })
12
+ export class PopUpConfirmComponent {
13
+
14
+ @Input() imgUrl: string = '';
15
+ @Input() title: string = '';
16
+ @Input() content: string = '';
17
+ @Input() colorButton: string = 'var(--brand-600)';
18
+
19
+ @Output() confirmClick = new EventEmitter<void>();
20
+ @Output() cancelClick = new EventEmitter<void>();
21
+
22
+ onConfirm(): void {
23
+ this.confirmClick.emit();
24
+ }
25
+
26
+ onCancel(): void {
27
+ this.cancelClick.emit();
28
+ }
29
+ }
@@ -0,0 +1,18 @@
1
+ @for (row of rows; track $index) {
2
+ <tr>
3
+ @for (col of columns; track col.key) {
4
+ <td [style.width]="col.width" [style.font-size]="fontSize">
5
+ @if (columnTemplates[col.key]) {
6
+ <ng-container
7
+ *ngTemplateOutlet="
8
+ columnTemplates[col.key];
9
+ context: { $implicit: row[col.key], row: row }
10
+ "
11
+ ></ng-container>
12
+ } @else {
13
+ {{ row[col.key] }}
14
+ }
15
+ </td>
16
+ }
17
+ </tr>
18
+ }
@@ -0,0 +1,6 @@
1
+ td {
2
+ padding: 16px 8px;
3
+ vertical-align: middle;
4
+ color: var(--neutral-color-700);
5
+ height: 70px;
6
+ }
@@ -0,0 +1,17 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { Component, Input, TemplateRef } from '@angular/core';
3
+ import { ColumnConfig } from '../table-header/table-header.component';
4
+
5
+ @Component({
6
+ selector: '[app-table-body]', // ✅ Attribute selector
7
+ standalone: true,
8
+ imports: [CommonModule],
9
+ templateUrl: './table-body.component.html',
10
+ styleUrl: './table-body.component.scss',
11
+ })
12
+ export class TableBodyComponent {
13
+ @Input() rows: any[] = [];
14
+ @Input() columns: ColumnConfig[] = [];
15
+ @Input() columnTemplates: { [key: string]: TemplateRef<any> } = {};
16
+ @Input() fontSize: string = 'var(--font-sm)';
17
+ }
@@ -0,0 +1,27 @@
1
+ @for (col of columns; track col.key) {
2
+ <th
3
+ scope="col"
4
+ [style.width]="col.width"
5
+ [style.backgroundColor]="backgroundColor"
6
+ [style.color]="textColor"
7
+ >
8
+ <div class="header-container">
9
+ <div class="header-content">
10
+ @if (headerIconLeft) {
11
+ <div class="icon-left">
12
+ <i [class]="headerIconLeft"></i>
13
+ </div>
14
+ }
15
+ <div class="header-text" [style.font-size]="fontSize">
16
+ {{ col.header }}
17
+ </div>
18
+ @if (headerIconRight) {
19
+ <div class="icon-right">
20
+ <i [class]="headerIconRight"></i>
21
+ </div>
22
+ }
23
+ </div>
24
+ <p class="divider">|</p>
25
+ </div>
26
+ </th>
27
+ }
@@ -0,0 +1,91 @@
1
+ th {
2
+ padding: 0;
3
+ vertical-align: middle;
4
+ height: 44px;
5
+ box-sizing: border-box;
6
+
7
+ .header-content {
8
+ display: flex;
9
+ align-items: center;
10
+ width: 100%;
11
+ gap: 8px;
12
+ border-collapse: collapse;
13
+
14
+ .header-text {
15
+ font-weight: 600;
16
+ }
17
+
18
+ .icon-left,
19
+ .icon-right {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ flex-shrink: 0;
24
+ width: 20px;
25
+ height: 20px;
26
+ }
27
+
28
+ // Khi chỉ có text (không có icons)
29
+ &:has(.header-text:only-child) {
30
+ justify-content: flex-start;
31
+ }
32
+
33
+ // Khi có icons
34
+ &:has(.icon-left),
35
+ &:has(.icon-right) {
36
+ justify-content: space-between;
37
+ background-color: var(--brand-900);
38
+ .header-text {
39
+ flex: 1;
40
+ text-align: center;
41
+ }
42
+ }
43
+
44
+ // Khi chỉ có icon bên trái
45
+ &:has(.icon-left):not(:has(.icon-right)) {
46
+ justify-content: flex-start;
47
+
48
+ .header-text {
49
+ flex: 1;
50
+ }
51
+ }
52
+
53
+ // Khi chỉ có icon bên phải
54
+ &:has(.icon-right):not(:has(.icon-left)) {
55
+ justify-content: space-between;
56
+
57
+ .header-text {
58
+ flex: 1;
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ /* Separator line between columns */
65
+ th:not(:last-child) {
66
+ border-right: 1px solid rgba(0, 0, 0, 0.1);
67
+ }
68
+
69
+ .table-header {
70
+ width: 100%;
71
+ }
72
+
73
+ .header-container {
74
+ display: flex;
75
+ align-items: center;
76
+ width: 100%;
77
+ padding: 0 8px;
78
+ box-sizing: border-box;
79
+ height: 100%;
80
+ }
81
+
82
+ .divider {
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ height: 20px;
87
+ width: 1px;
88
+ background-color: rgba(0, 0, 0, 0.1);
89
+ margin: 0 8px;
90
+ color: transparent; /* Text content '|' hidden or style it */
91
+ }
@@ -0,0 +1,25 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ export interface ColumnConfig {
5
+ header: string;
6
+ key: string;
7
+ width: string;
8
+ }
9
+
10
+ @Component({
11
+ selector: 'tr[app-table-header]',
12
+ standalone: true,
13
+ imports: [CommonModule],
14
+ templateUrl: './table-header.component.html',
15
+ styleUrl: './table-header.component.scss',
16
+ })
17
+ export class TableHeaderComponent {
18
+ @Input() columns: ColumnConfig[] = [];
19
+ @Input() backgroundColor?: string;
20
+ @Input({ transform: (value: string | undefined) => value || '#ffffff' })
21
+ textColor: string = '#ffffff';
22
+ @Input() headerIconLeft?: string;
23
+ @Input() headerIconRight?: string;
24
+ @Input() fontSize: string = 'var(--font-xs)';
25
+ }
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Public API Surface of intern-hub-layout
3
+ */
4
+
5
+ // Layout components
6
+ export * from './libs/layouts/header/header.component';
7
+ export * from './libs/layouts/sidebar/sidebar.component';
8
+
9
+ // Shared components - Icons
10
+ export * from './libs/shared/components/icon/icon.component';
11
+ export * from './libs/shared/components/functional-label/functional-label.component';
12
+
13
+ // Shared components - Buttons
14
+ export * from './libs/shared/components/button/button-container/button-container.component';
15
+ export * from './libs/shared/components/button/button-container/button-container.model';
16
+ export * from './libs/shared/components/button/label-button/label-button.component';
17
+
18
+ // Shared components - Inputs
19
+ export * from './libs/shared/components/input/input-text/input-text.component';
20
+ export * from './libs/shared/components/input/input-stepper/input-stepper.component';
21
+ export * from './libs/shared/components/input/input-calendar/input-calendar.component';
22
+
23
+ // Shared components - Table
24
+ export * from './libs/shared/components/table/table-header/table-header.component';
25
+ export * from './libs/shared/components/table/table-body/table-body.component';
26
+
27
+ // Shared components - Approval
28
+ export * from './libs/shared/components/approval/approval-list/approval-list.component';
29
+ export * from './libs/shared/components/approval/approval-list-item/approval-list-item.component';
30
+ export * from './libs/shared/components/approval/approval-list-item/approval-list-item.model';
31
+
32
+ // Shared components - Pop-ups
33
+ export * from './libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component';
34
+
package/tsconfig.json ADDED
@@ -0,0 +1,38 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "compileOnSave": false,
5
+ "compilerOptions": {
6
+ "strict": true,
7
+ "noImplicitOverride": true,
8
+ "noPropertyAccessFromIndexSignature": true,
9
+ "noImplicitReturns": true,
10
+ "noFallthroughCasesInSwitch": true,
11
+ "skipLibCheck": true,
12
+ "isolatedModules": true,
13
+ "experimentalDecorators": true,
14
+ "importHelpers": true,
15
+ "target": "ES2022",
16
+ "module": "preserve",
17
+ "paths": {
18
+ "@goat-bravos/intern-hub-layout": [
19
+ "./dist/intern-hub-layout"
20
+ ]
21
+ }
22
+ },
23
+ "angularCompilerOptions": {
24
+ "enableI18nLegacyMessageIdFormat": false,
25
+ "strictInjectionParameters": true,
26
+ "strictInputAccessModifiers": true,
27
+ "strictTemplates": true
28
+ },
29
+ "files": [],
30
+ "references": [
31
+ {
32
+ "path": "./tsconfig.lib.json"
33
+ },
34
+ {
35
+ "path": "./tsconfig.spec.json"
36
+ }
37
+ ]
38
+ }
@@ -0,0 +1,17 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "./tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "./out-tsc/lib",
7
+ "declaration": true,
8
+ "declarationMap": true,
9
+ "inlineSources": true,
10
+ "types": []
11
+ },
12
+ "exclude": [
13
+ "src/**/*.spec.ts",
14
+ "src/app/**/*",
15
+ "src/main.ts"
16
+ ]
17
+ }
@@ -0,0 +1,11 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "./tsconfig.lib.json",
5
+ "compilerOptions": {
6
+ "declarationMap": false
7
+ },
8
+ "angularCompilerOptions": {
9
+ "compilationMode": "partial"
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "./tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "./out-tsc/spec",
7
+ "types": [
8
+ "vitest/globals"
9
+ ]
10
+ },
11
+ "include": [
12
+ "src/**/*.d.ts",
13
+ "src/**/*.spec.ts"
14
+ ]
15
+ }