@goat-bravos/intern-hub-layout 1.0.1 → 1.0.3

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 (100) hide show
  1. package/dist/intern-hub-layout/README.md +267 -0
  2. package/dist/intern-hub-layout/fesm2022/goat-bravos-intern-hub-layout.mjs +561 -0
  3. package/dist/intern-hub-layout/fesm2022/goat-bravos-intern-hub-layout.mjs.map +1 -0
  4. package/dist/intern-hub-layout/types/goat-bravos-intern-hub-layout.d.ts +189 -0
  5. package/package.json +46 -33
  6. package/.editorconfig +0 -17
  7. package/.vscode/extensions.json +0 -4
  8. package/.vscode/launch.json +0 -20
  9. package/.vscode/mcp.json +0 -9
  10. package/.vscode/tasks.json +0 -42
  11. package/angular.json +0 -131
  12. package/ng-package.json +0 -6
  13. package/projects/layout-templates/README.md +0 -63
  14. package/projects/layout-templates/ng-package.json +0 -7
  15. package/projects/layout-templates/package.json +0 -12
  16. package/projects/layout-templates/src/lib/layout-templates.spec.ts +0 -23
  17. package/projects/layout-templates/src/lib/layout-templates.ts +0 -15
  18. package/projects/layout-templates/src/public-api.ts +0 -5
  19. package/projects/layout-templates/tsconfig.lib.json +0 -17
  20. package/projects/layout-templates/tsconfig.lib.prod.json +0 -11
  21. package/projects/layout-templates/tsconfig.spec.json +0 -15
  22. package/projects/ui-components/README.md +0 -63
  23. package/projects/ui-components/ng-package.json +0 -7
  24. package/projects/ui-components/package.json +0 -12
  25. package/projects/ui-components/src/lib/ui-components.spec.ts +0 -23
  26. package/projects/ui-components/src/lib/ui-components.ts +0 -15
  27. package/projects/ui-components/src/public-api.ts +0 -5
  28. package/projects/ui-components/tsconfig.lib.json +0 -17
  29. package/projects/ui-components/tsconfig.lib.prod.json +0 -11
  30. package/projects/ui-components/tsconfig.spec.json +0 -15
  31. package/public/B/341/273/231 icon message (1).svg" +0 -87
  32. package/public/B/341/273/231 icon message (2).svg" +0 -104
  33. package/public/B/341/273/231 icon message.svg" +0 -98
  34. package/public/FPT-IS-Logo.png +0 -0
  35. package/public/FPT_IS_Logo.svg +0 -12
  36. package/public/favicon.ico +0 -0
  37. package/public/federation.manifest.json +0 -8
  38. package/src/app/app.config.ts +0 -22
  39. package/src/app/app.html +0 -1
  40. package/src/app/app.routes.ts +0 -24
  41. package/src/app/app.scss +0 -0
  42. package/src/app/app.spec.ts +0 -23
  43. package/src/app/app.ts +0 -19
  44. package/src/index.html +0 -15
  45. package/src/libs/layouts/header/header.component.html +0 -27
  46. package/src/libs/layouts/header/header.component.scss +0 -96
  47. package/src/libs/layouts/header/header.component.ts +0 -13
  48. package/src/libs/layouts/main-layout/main-layout.component.html +0 -15
  49. package/src/libs/layouts/main-layout/main-layout.component.scss +0 -35
  50. package/src/libs/layouts/main-layout/main-layout.component.ts +0 -17
  51. package/src/libs/layouts/main-layout-test/main-layout-test.component.html +0 -296
  52. package/src/libs/layouts/main-layout-test/main-layout-test.component.scss +0 -94
  53. package/src/libs/layouts/main-layout-test/main-layout-test.component.ts +0 -121
  54. package/src/libs/layouts/sidebar/sidebar.component.html +0 -7
  55. package/src/libs/layouts/sidebar/sidebar.component.scss +0 -38
  56. package/src/libs/layouts/sidebar/sidebar.component.ts +0 -19
  57. package/src/libs/shared/components/approval/approval-list/approval-list.component.html +0 -19
  58. package/src/libs/shared/components/approval/approval-list/approval-list.component.scss +0 -24
  59. package/src/libs/shared/components/approval/approval-list/approval-list.component.ts +0 -19
  60. package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.html +0 -21
  61. package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.scss +0 -28
  62. package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.ts +0 -20
  63. package/src/libs/shared/components/approval/approval-list-item/approval-list-item.model.ts +0 -8
  64. package/src/libs/shared/components/button/button-container/button-container.component.html +0 -20
  65. package/src/libs/shared/components/button/button-container/button-container.component.scss +0 -49
  66. package/src/libs/shared/components/button/button-container/button-container.component.ts +0 -38
  67. package/src/libs/shared/components/button/button-container/button-container.model.ts +0 -58
  68. package/src/libs/shared/components/button/label-button/label-button.component.html +0 -11
  69. package/src/libs/shared/components/button/label-button/label-button.component.scss +0 -13
  70. package/src/libs/shared/components/button/label-button/label-button.component.ts +0 -18
  71. package/src/libs/shared/components/functional-label/functional-label.component.html +0 -4
  72. package/src/libs/shared/components/functional-label/functional-label.component.scss +0 -58
  73. package/src/libs/shared/components/functional-label/functional-label.component.ts +0 -15
  74. package/src/libs/shared/components/input/input-calendar/input-calendar.component.html +0 -52
  75. package/src/libs/shared/components/input/input-calendar/input-calendar.component.scss +0 -98
  76. package/src/libs/shared/components/input/input-calendar/input-calendar.component.ts +0 -102
  77. package/src/libs/shared/components/input/input-label/input-label.component.html +0 -0
  78. package/src/libs/shared/components/input/input-label/input-label.component.scss +0 -0
  79. package/src/libs/shared/components/input/input-label/input-label.component.ts +0 -0
  80. package/src/libs/shared/components/input/input-stepper/input-stepper.component.html +0 -62
  81. package/src/libs/shared/components/input/input-stepper/input-stepper.component.scss +0 -211
  82. package/src/libs/shared/components/input/input-stepper/input-stepper.component.ts +0 -73
  83. package/src/libs/shared/components/input/input-text/input-text.component.html +0 -40
  84. package/src/libs/shared/components/input/input-text/input-text.component.scss +0 -143
  85. package/src/libs/shared/components/input/input-text/input-text.component.ts +0 -63
  86. package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.html +0 -15
  87. package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.scss +0 -70
  88. package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.ts +0 -29
  89. package/src/libs/shared/components/table/table-body/table-body.component.html +0 -18
  90. package/src/libs/shared/components/table/table-body/table-body.component.scss +0 -6
  91. package/src/libs/shared/components/table/table-body/table-body.component.ts +0 -17
  92. package/src/libs/shared/components/table/table-header/table-header.component.html +0 -27
  93. package/src/libs/shared/components/table/table-header/table-header.component.scss +0 -91
  94. package/src/libs/shared/components/table/table-header/table-header.component.ts +0 -25
  95. package/src/main.ts +0 -6
  96. package/src/public-api.ts +0 -22
  97. package/src/styles.scss +0 -27
  98. package/tsconfig.app.json +0 -15
  99. package/tsconfig.json +0 -53
  100. package/tsconfig.spec.json +0 -15
@@ -0,0 +1,267 @@
1
+ # Intern Hub Layout
2
+
3
+ This library provides a standard layout and shared UI components for Intern Hub applications. It is designed to be highly configurable via Angular Routing.
4
+
5
+ ## Installation
6
+
7
+ Run the following command to install the package:
8
+
9
+ ```bash
10
+ npm install intern-hub-layout dynamic-ds
11
+ ```
12
+
13
+ _(Note: `dynamic-ds` is a required peer dependency for the design system)_
14
+
15
+ ## Setup
16
+
17
+ To enable the configurable layout pattern, you must add `withComponentInputBinding()` to your `app.config.ts`. This allows the Router to pass configuration data directly to the Layout component inputs.
18
+
19
+ **`src/app/app.config.ts`**
20
+
21
+ ```typescript
22
+ import { ApplicationConfig } from '@angular/core';
23
+ import { provideRouter, withComponentInputBinding } from '@angular/router'; // Import this
24
+ import { routes } from './app.routes';
25
+
26
+ export const appConfig: ApplicationConfig = {
27
+ providers: [
28
+ provideRouter(routes, withComponentInputBinding()), // Add this function
29
+ ],
30
+ };
31
+ ```
32
+
33
+ ## Usage
34
+
35
+ ### 1. Main Layout Configuration
36
+
37
+ You can use the `MainLayoutComponent` as a shell for your application. Define the Sidebar items directly in your route configuration using the `data` property.
38
+
39
+ **`src/app/app.routes.ts`**
40
+
41
+ ```typescript
42
+ import { Routes } from '@angular/router';
43
+ import { MainLayoutComponent } from 'intern-hub-layout'; // Import from library
44
+
45
+ export const routes: Routes = [
46
+ {
47
+ path: '',
48
+ component: MainLayoutComponent,
49
+ // Configure Sidebar Items here
50
+ data: {
51
+ sidebarItems: [
52
+ { icon: 'dsi-home-01-line', content: 'Home' },
53
+ { icon: 'dsi-map-01-line', content: 'Roadmap' },
54
+ { icon: 'dsi-file-01-line', content: 'Documents' },
55
+ ],
56
+ },
57
+ // Your application pages go here
58
+ children: [
59
+ {
60
+ path: '',
61
+ loadComponent: () => import('./home/home.component').then((m) => m.HomeComponent),
62
+ },
63
+ ],
64
+ },
65
+ ];
66
+ ```
67
+
68
+ ### 2. Using Shared Components
69
+
70
+ You can import individual components from the library.
71
+
72
+ ```typescript
73
+ import { Component } from '@angular/core';
74
+ import { ButtonContainerComponent, InputTextComponent } from 'intern-hub-layout';
75
+
76
+ @Component({
77
+ selector: 'app-example',
78
+ standalone: true,
79
+ imports: [ButtonContainerComponent, InputTextComponent],
80
+ template: `
81
+ <app-button-container content="Click Me"></app-button-container>
82
+ <app-input-text placeholder="Enter name"></app-input-text>
83
+ `,
84
+ })
85
+ export class ExampleComponent {}
86
+ ```
87
+
88
+ ## Available Components
89
+
90
+ ### Layouts
91
+
92
+ - `MainLayoutComponent`: Full application shell with Sidebar and Header.
93
+ - `SidebarComponent`: Standalone sidebar.
94
+ - `HeaderComponent`: Standalone header.
95
+
96
+ ### Shared UI
97
+
98
+ - **Buttons**: `ButtonContainerComponent`, `LabelButtonComponent`
99
+ - **Inputs**: `InputTextComponent`, `InputStepperComponent`, `InputCalendarComponent`
100
+ - **Tables**: `TableHeaderComponent`, `TableBodyComponent`
101
+ - **Other**: `ApprovalListComponent`, `PopUpConfirmComponent`
102
+
103
+ ## Author
104
+
105
+ Intern Hub Team
106
+
107
+ ## Component API Reference
108
+
109
+ ### 1. `MainLayoutComponent`
110
+
111
+ The main application shell.
112
+
113
+ - **Inputs**:
114
+ - `sidebarItems: SidebarItem[]`: List of items to display in the sidebar.
115
+
116
+ #### Interface `SidebarItem`
117
+
118
+ ```typescript
119
+ interface SidebarItem {
120
+ icon: string;
121
+ content: string;
122
+ }
123
+ ```
124
+
125
+ ---
126
+
127
+ ### 2. `ButtonContainerComponent`
128
+
129
+ A container for standard buttons.
130
+
131
+ - **Selector**: `app-button-container`
132
+ - **Inputs**:
133
+ - `size: 'xs' | 'sm' | 'md' | 'lg'`: Size of the button (default: `'md'`).
134
+ - `content: string`: Text content of the button.
135
+ - `leftIcon: string`: CSS class or content for left icon.
136
+ - `rightIcon: string`: CSS class or content for right icon.
137
+ - `color: string`: Text color (default: `var(--brand-100)`).
138
+ - `backgroundColor: string`: Background color (default: `var(--utility-900)`).
139
+ - `borderColor: string`: Border color (default: `var(--brand-100)`).
140
+ - `fontSize: string`: Custom font size.
141
+ - **Outputs**:
142
+ - `buttonClick`: Event emitted when button is clicked.
143
+
144
+ ### 3. `LabelButtonComponent`
145
+
146
+ A small button-like label.
147
+
148
+ - **Selector**: `app-label-button`
149
+ - **Inputs**:
150
+ - `label: string`: Text content.
151
+ - `bgColor: string`: Background color.
152
+ - `borderColor: string`: Border color.
153
+ - `textColor: string`: Text color.
154
+ - `width: string`: Width of the component (default: `100%`).
155
+ - `height: string`: Height of the component (default: `28px`).
156
+
157
+ ---
158
+
159
+ ### 4. `InputTextComponent`
160
+
161
+ Standard text input field.
162
+
163
+ - **Selector**: `app-input-text`
164
+ - **Inputs**:
165
+ - `headerInput: string`: Label text above the input.
166
+ - `placeholder: string`: Placeholder text.
167
+ - `value: string`: Initial value (supports binding).
168
+ - `readonly: boolean`: If true, input is read-only.
169
+ - `required: boolean`: If true, shows required asterisk.
170
+ - `width: string`: Width of the input container (default: `100%`).
171
+ - `maxLength: number`: Maximum character length.
172
+ - `showLimit: boolean`: Whether to show character count.
173
+ - `icon: string`: Icon class to display inside input.
174
+ - `typeInput: string`: Input type (e.g., `'text'`, `'password'`).
175
+ - **Outputs**:
176
+ - `valueChange`: Emits new value on input.
177
+ - `iconClick`: Emits when the icon is clicked.
178
+
179
+ ### 5. `InputStepperComponent`
180
+
181
+ Number input with increment/decrement buttons.
182
+
183
+ - **Selector**: `app-input-stepper`
184
+ - **Inputs**:
185
+ - `headerInput`: Label text.
186
+ - `value: number`: Initial value.
187
+ - `min`: Minimum value (default: 0).
188
+ - `max`: Maximum value (default: 100).
189
+ - `step`: Step value (default: 1).
190
+ - `state`: Visual state (`'default'`, `'negative'`, `'positive'`).
191
+ - `helperText`: Text displayed below the input.
192
+ - `readonly`, `required`, `disabled`, `width`.
193
+ - **Outputs**:
194
+ - `valueChange`: Emits new numeric value.
195
+
196
+ ### 6. `InputCalendarComponent`
197
+
198
+ Date picker input.
199
+
200
+ - **Selector**: `app-input-calendar`
201
+ - **Inputs**:
202
+ - `headerInput`: Label text.
203
+ - `value: string`: Date value in ISO format (`yyyy-mm-dd`).
204
+ - `placeholder`: Placeholder text (default: `'dd/mm/yyyy'`).
205
+ - `readonly`, `required`, `width`.
206
+ - **Outputs**:
207
+ - `valueChange`: Emits selected date in ISO format.
208
+
209
+ ---
210
+
211
+ ### 7. `TableHeaderComponent`
212
+
213
+ Renders table headers.
214
+
215
+ - **Selector**: `tr[app-table-header]` (Attribute on `<tr>`)
216
+ - **Inputs**:
217
+ - `columns: ColumnConfig[]`: Array of column configurations.
218
+ - `backgroundColor`: Header background color.
219
+ - `textColor`: Text color (default: white).
220
+ - `headerIconLeft`, `headerIconRight`: Icons for header cells.
221
+
222
+ #### Interface `ColumnConfig`
223
+
224
+ ```typescript
225
+ interface ColumnConfig {
226
+ header: string; // Display text
227
+ key: string; // Data key
228
+ width: string; // CSS width
229
+ }
230
+ ```
231
+
232
+ ### 8. `TableBodyComponent`
233
+
234
+ Renders table rows.
235
+
236
+ - **Selector**: `tbody[app-table-body]` (Attribute on `<tbody>`)
237
+ - **Inputs**:
238
+ - `rows: any[]`: Array of data objects.
239
+ - `columns: ColumnConfig[]`: Column configuration to map data.
240
+ - `columnTemplates`: Object mapping column keys to `TemplateRef` for custom cell rendering.
241
+
242
+ ---
243
+
244
+ ### 9. `ApprovalListComponent`
245
+
246
+ A list component showing approval items.
247
+
248
+ - **Selector**: `app-approval-list`
249
+ - **Inputs**:
250
+ - `rows: ApprovalListItemInterface[]`: List of items.
251
+ - `headerContentLeft`: Text for left header.
252
+ - `headerContentRight`: Text for right header.
253
+ - `width`: Component width.
254
+
255
+ ### 10. `PopUpConfirmComponent`
256
+
257
+ A confirmation modal.
258
+
259
+ - **Selector**: `app-pop-up-confirm`
260
+ - **Inputs**:
261
+ - `title`: Popup title.
262
+ - `content`: Message body.
263
+ - `imgUrl`: Icon/Image URL.
264
+ - `colorButton`: Color of the confirm button.
265
+ - **Outputs**:
266
+ - `confirmClick`: Emits when confirmed.
267
+ - `cancelClick`: Emits when canceled.