@goat-bravos/intern-hub-layout 1.2.0 → 1.2.1
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/fesm2022/goat-bravos-intern-hub-layout.mjs +826 -0
- package/fesm2022/goat-bravos-intern-hub-layout.mjs.map +1 -0
- package/package.json +16 -23
- package/types/goat-bravos-intern-hub-layout.d.ts +317 -0
- package/.editorconfig +0 -17
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/mcp.json +0 -9
- package/.vscode/tasks.json +0 -42
- package/angular.json +0 -40
- package/ng-package.json +0 -11
- package/src/libs/layouts/header/header.component.html +0 -58
- package/src/libs/layouts/header/header.component.scss +0 -108
- package/src/libs/layouts/header/header.component.ts +0 -70
- package/src/libs/layouts/sidebar/sidebar.component.html +0 -28
- package/src/libs/layouts/sidebar/sidebar.component.scss +0 -44
- package/src/libs/layouts/sidebar/sidebar.component.ts +0 -55
- package/src/libs/shared/components/approval/approval-list/approval-list.component.html +0 -19
- package/src/libs/shared/components/approval/approval-list/approval-list.component.scss +0 -24
- package/src/libs/shared/components/approval/approval-list/approval-list.component.ts +0 -19
- package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.html +0 -21
- package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.scss +0 -28
- package/src/libs/shared/components/approval/approval-list-item/approval-list-item.component.ts +0 -20
- package/src/libs/shared/components/approval/approval-list-item/approval-list-item.model.ts +0 -8
- package/src/libs/shared/components/button/button-container/button-container.component.html +0 -20
- package/src/libs/shared/components/button/button-container/button-container.component.scss +0 -49
- package/src/libs/shared/components/button/button-container/button-container.component.ts +0 -34
- package/src/libs/shared/components/button/button-container/button-container.model.ts +0 -58
- package/src/libs/shared/components/button/label-button/label-button.component.html +0 -11
- package/src/libs/shared/components/button/label-button/label-button.component.scss +0 -13
- package/src/libs/shared/components/button/label-button/label-button.component.ts +0 -18
- package/src/libs/shared/components/functional-label/functional-label.component.html +0 -36
- package/src/libs/shared/components/functional-label/functional-label.component.scss +0 -56
- package/src/libs/shared/components/functional-label/functional-label.component.ts +0 -141
- package/src/libs/shared/components/icon/icon.component.html +0 -12
- package/src/libs/shared/components/icon/icon.component.scss +0 -11
- package/src/libs/shared/components/icon/icon.component.ts +0 -61
- package/src/libs/shared/components/input/input-calendar/input-calendar.component.html +0 -52
- package/src/libs/shared/components/input/input-calendar/input-calendar.component.scss +0 -98
- package/src/libs/shared/components/input/input-calendar/input-calendar.component.ts +0 -126
- 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 +0 -62
- package/src/libs/shared/components/input/input-stepper/input-stepper.component.scss +0 -211
- package/src/libs/shared/components/input/input-stepper/input-stepper.component.ts +0 -73
- package/src/libs/shared/components/input/input-text/input-text.component.html +0 -40
- package/src/libs/shared/components/input/input-text/input-text.component.scss +0 -143
- package/src/libs/shared/components/input/input-text/input-text.component.ts +0 -63
- package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.html +0 -15
- package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.scss +0 -70
- package/src/libs/shared/components/pop-up/pop-up-confirm/pop-up-confirm.component.ts +0 -29
- package/src/libs/shared/components/table/table-body/table-body.component.html +0 -18
- package/src/libs/shared/components/table/table-body/table-body.component.scss +0 -6
- package/src/libs/shared/components/table/table-body/table-body.component.ts +0 -17
- package/src/libs/shared/components/table/table-header/table-header.component.html +0 -27
- package/src/libs/shared/components/table/table-header/table-header.component.scss +0 -91
- package/src/libs/shared/components/table/table-header/table-header.component.ts +0 -25
- package/src/public-api.ts +0 -34
- package/tsconfig.json +0 -38
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -15
|
@@ -0,0 +1,826 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Output, Input, Component, HostListener, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1$1 from '@angular/router';
|
|
6
|
+
import { RouterModule } from '@angular/router';
|
|
7
|
+
import { FormsModule } from '@angular/forms';
|
|
8
|
+
|
|
9
|
+
class IconComponent {
|
|
10
|
+
iconData;
|
|
11
|
+
icon;
|
|
12
|
+
colorIcon;
|
|
13
|
+
routerLink;
|
|
14
|
+
width = '20px';
|
|
15
|
+
height = '20px';
|
|
16
|
+
colorIconHover;
|
|
17
|
+
backgroundColorHover;
|
|
18
|
+
clicked = new EventEmitter();
|
|
19
|
+
get iconClass() {
|
|
20
|
+
if (this.iconData?.icon) {
|
|
21
|
+
return this.iconData.icon;
|
|
22
|
+
}
|
|
23
|
+
return this.icon || '';
|
|
24
|
+
}
|
|
25
|
+
get iconColor() {
|
|
26
|
+
return this.iconData?.colorIcon || this.colorIcon;
|
|
27
|
+
}
|
|
28
|
+
get iconWidth() {
|
|
29
|
+
return this.iconData?.width || this.width || '20px';
|
|
30
|
+
}
|
|
31
|
+
get iconHeight() {
|
|
32
|
+
return this.iconData?.height || this.height || '20px';
|
|
33
|
+
}
|
|
34
|
+
get iconRouterLink() {
|
|
35
|
+
return this.iconData?.routerLink || this.routerLink;
|
|
36
|
+
}
|
|
37
|
+
handleClick(event) {
|
|
38
|
+
if (!this.iconRouterLink) {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
this.clicked.emit(event);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: IconComponent, isStandalone: true, selector: "app-icon", inputs: { iconData: "iconData", icon: "icon", colorIcon: "colorIcon", routerLink: "routerLink", width: "width", height: "height", colorIconHover: "colorIconHover", backgroundColorHover: "backgroundColorHover" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<i\r\n class=\"icon\"\r\n [ngClass]=\"iconClass\"\r\n [style.color]=\"iconColor\"\r\n [style.width]=\"iconWidth\"\r\n [style.height]=\"iconHeight\"\r\n [attr.tabindex]=\"iconRouterLink ? null : 0\"\r\n [attr.role]=\"iconRouterLink ? null : 'button'\"\r\n (click)=\"handleClick($event)\"\r\n (keydown.enter)=\"handleClick($event)\"\r\n (keydown.space)=\"handleClick($event)\"\r\n></i>\r\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:1}:host .icon{transition:color .25s ease}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }] });
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: IconComponent, decorators: [{
|
|
47
|
+
type: Component,
|
|
48
|
+
args: [{ selector: 'app-icon', standalone: true, imports: [CommonModule, RouterModule], template: "<i\r\n class=\"icon\"\r\n [ngClass]=\"iconClass\"\r\n [style.color]=\"iconColor\"\r\n [style.width]=\"iconWidth\"\r\n [style.height]=\"iconHeight\"\r\n [attr.tabindex]=\"iconRouterLink ? null : 0\"\r\n [attr.role]=\"iconRouterLink ? null : 'button'\"\r\n (click)=\"handleClick($event)\"\r\n (keydown.enter)=\"handleClick($event)\"\r\n (keydown.space)=\"handleClick($event)\"\r\n></i>\r\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:1}:host .icon{transition:color .25s ease}\n"] }]
|
|
49
|
+
}], propDecorators: { iconData: [{
|
|
50
|
+
type: Input
|
|
51
|
+
}], icon: [{
|
|
52
|
+
type: Input
|
|
53
|
+
}], colorIcon: [{
|
|
54
|
+
type: Input
|
|
55
|
+
}], routerLink: [{
|
|
56
|
+
type: Input
|
|
57
|
+
}], width: [{
|
|
58
|
+
type: Input
|
|
59
|
+
}], height: [{
|
|
60
|
+
type: Input
|
|
61
|
+
}], colorIconHover: [{
|
|
62
|
+
type: Input
|
|
63
|
+
}], backgroundColorHover: [{
|
|
64
|
+
type: Input
|
|
65
|
+
}], clicked: [{
|
|
66
|
+
type: Output
|
|
67
|
+
}] } });
|
|
68
|
+
|
|
69
|
+
class HeaderComponent {
|
|
70
|
+
data = {
|
|
71
|
+
headerItems: [],
|
|
72
|
+
userName: 'Guest',
|
|
73
|
+
userIcon: 'dsi-user-01-line',
|
|
74
|
+
dropdownIcon: 'dsi-arrow-down-solid',
|
|
75
|
+
logo: 'assets/FPT-IS-Logo.png',
|
|
76
|
+
};
|
|
77
|
+
handleActionClick(item, event) {
|
|
78
|
+
if (item.method) {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
item.method();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
getIconData(icon, colorIcon, width, height) {
|
|
84
|
+
if (!icon)
|
|
85
|
+
return undefined;
|
|
86
|
+
if (typeof icon === 'string') {
|
|
87
|
+
return {
|
|
88
|
+
icon,
|
|
89
|
+
colorIcon,
|
|
90
|
+
width,
|
|
91
|
+
height,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return icon;
|
|
95
|
+
}
|
|
96
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
97
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: HeaderComponent, isStandalone: true, selector: "app-header-component", inputs: { data: "data" }, ngImport: i0, template: "<header class=\"app-header\">\r\n <div class=\"header-left\">\r\n <img\r\n class=\"logo\"\r\n [src]=\"data.logo || 'assets/FPT-IS-Logo.png'\"\r\n alt=\"Logo\"\r\n />\r\n </div>\r\n\r\n <div class=\"header-right\">\r\n @for (item of data.headerItems; track $index) {\r\n <button\r\n class=\"header-btn\"\r\n [attr.aria-label]=\"item.content\"\r\n (click)=\"handleActionClick(item, $event)\"\r\n >\r\n <app-icon\r\n [iconData]=\"\r\n getIconData(\r\n item.icon,\r\n item.colorIcon,\r\n item.width || '16px',\r\n item.height || '16px'\r\n )\r\n \"\r\n ></app-icon>\r\n @if (item.badge) {\r\n <span class=\"badge\">{{ item.badge }}</span>\r\n }\r\n </button>\r\n }\r\n\r\n <div class=\"header-user\">\r\n <button class=\"user-btn\">\r\n @if (data.userIcon) {\r\n <app-icon\r\n [iconData]=\"\r\n getIconData(data.userIcon, data.userIconColor, '16px', '16px')\r\n \"\r\n ></app-icon>\r\n }\r\n <span class=\"user-name\">{{ data.userName }}</span>\r\n @if (data.dropdownIcon) {\r\n <app-icon\r\n [iconData]=\"\r\n getIconData(\r\n data.dropdownIcon,\r\n data.dropdownIconColor,\r\n '16px',\r\n '16px'\r\n )\r\n \"\r\n ></app-icon>\r\n }\r\n </button>\r\n </div>\r\n </div>\r\n</header>\r\n", styles: [":host{width:100%;display:flex;justify-content:center}.app-header{height:70px;width:1370px;display:flex;align-items:center;justify-content:space-between;padding:16px 8px;background-color:transparent;box-sizing:border-box}.header-left{display:flex;align-items:center}.header-left .logo{height:40px;width:auto;object-fit:contain;cursor:pointer}.header-right{display:flex;align-items:center;gap:12px}.header-btn{position:relative;width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:transparent;border-radius:var(--radius-full);border:none;cursor:pointer;color:var(--brand-600);transition:all .2s ease-in-out}.header-btn:hover{background-color:var(--neutral-color-100);color:var(--primary-color)}.header-btn .badge{position:absolute;top:-4px;right:-4px;min-width:16px;height:16px;padding:16px 8px;display:flex;align-items:center;justify-content:center;background-color:var(-utility-500);color:var(--neutral-color-100);border-radius:8px;font-size:10px;font-weight:600;line-height:1}.header-user{margin-left:4px;padding-left:16px 8px}.user-btn{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 8px;background:transparent;border:none;border-radius:8px;cursor:pointer;transition:background-color .2s ease}.user-btn:hover{background-color:var(--neutral-color-100)}.user-btn .user-name{font-size:14px;font-weight:700;color:var(--brand-600);white-space:nowrap;max-width:150px;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IconComponent, selector: "app-icon", inputs: ["iconData", "icon", "colorIcon", "routerLink", "width", "height", "colorIconHover", "backgroundColorHover"], outputs: ["clicked"] }] });
|
|
98
|
+
}
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: HeaderComponent, decorators: [{
|
|
100
|
+
type: Component,
|
|
101
|
+
args: [{ selector: 'app-header-component', standalone: true, imports: [CommonModule, IconComponent], template: "<header class=\"app-header\">\r\n <div class=\"header-left\">\r\n <img\r\n class=\"logo\"\r\n [src]=\"data.logo || 'assets/FPT-IS-Logo.png'\"\r\n alt=\"Logo\"\r\n />\r\n </div>\r\n\r\n <div class=\"header-right\">\r\n @for (item of data.headerItems; track $index) {\r\n <button\r\n class=\"header-btn\"\r\n [attr.aria-label]=\"item.content\"\r\n (click)=\"handleActionClick(item, $event)\"\r\n >\r\n <app-icon\r\n [iconData]=\"\r\n getIconData(\r\n item.icon,\r\n item.colorIcon,\r\n item.width || '16px',\r\n item.height || '16px'\r\n )\r\n \"\r\n ></app-icon>\r\n @if (item.badge) {\r\n <span class=\"badge\">{{ item.badge }}</span>\r\n }\r\n </button>\r\n }\r\n\r\n <div class=\"header-user\">\r\n <button class=\"user-btn\">\r\n @if (data.userIcon) {\r\n <app-icon\r\n [iconData]=\"\r\n getIconData(data.userIcon, data.userIconColor, '16px', '16px')\r\n \"\r\n ></app-icon>\r\n }\r\n <span class=\"user-name\">{{ data.userName }}</span>\r\n @if (data.dropdownIcon) {\r\n <app-icon\r\n [iconData]=\"\r\n getIconData(\r\n data.dropdownIcon,\r\n data.dropdownIconColor,\r\n '16px',\r\n '16px'\r\n )\r\n \"\r\n ></app-icon>\r\n }\r\n </button>\r\n </div>\r\n </div>\r\n</header>\r\n", styles: [":host{width:100%;display:flex;justify-content:center}.app-header{height:70px;width:1370px;display:flex;align-items:center;justify-content:space-between;padding:16px 8px;background-color:transparent;box-sizing:border-box}.header-left{display:flex;align-items:center}.header-left .logo{height:40px;width:auto;object-fit:contain;cursor:pointer}.header-right{display:flex;align-items:center;gap:12px}.header-btn{position:relative;width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:transparent;border-radius:var(--radius-full);border:none;cursor:pointer;color:var(--brand-600);transition:all .2s ease-in-out}.header-btn:hover{background-color:var(--neutral-color-100);color:var(--primary-color)}.header-btn .badge{position:absolute;top:-4px;right:-4px;min-width:16px;height:16px;padding:16px 8px;display:flex;align-items:center;justify-content:center;background-color:var(-utility-500);color:var(--neutral-color-100);border-radius:8px;font-size:10px;font-weight:600;line-height:1}.header-user{margin-left:4px;padding-left:16px 8px}.user-btn{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 8px;background:transparent;border:none;border-radius:8px;cursor:pointer;transition:background-color .2s ease}.user-btn:hover{background-color:var(--neutral-color-100)}.user-btn .user-name{font-size:14px;font-weight:700;color:var(--brand-600);white-space:nowrap;max-width:150px;overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
102
|
+
}], propDecorators: { data: [{
|
|
103
|
+
type: Input
|
|
104
|
+
}] } });
|
|
105
|
+
|
|
106
|
+
class FunctionalLabelComponent {
|
|
107
|
+
iconLeft;
|
|
108
|
+
iconRight;
|
|
109
|
+
colorIconLeft;
|
|
110
|
+
colorIconRight;
|
|
111
|
+
widthIconLeft = '20px';
|
|
112
|
+
heightIconLeft = '20px';
|
|
113
|
+
widthIconRight = '20px';
|
|
114
|
+
heightIconRight = '20px';
|
|
115
|
+
colorIconLeftHover;
|
|
116
|
+
colorIconRightHover;
|
|
117
|
+
colorContentHover;
|
|
118
|
+
backgroundColorHover;
|
|
119
|
+
borderRadiusHover;
|
|
120
|
+
content = '';
|
|
121
|
+
colorContent;
|
|
122
|
+
widthContent = '100%';
|
|
123
|
+
heightContent = '100%';
|
|
124
|
+
backgroundColor;
|
|
125
|
+
borderRadius;
|
|
126
|
+
width;
|
|
127
|
+
height;
|
|
128
|
+
routerLink;
|
|
129
|
+
isSidebarExpanded = false;
|
|
130
|
+
clicked = new EventEmitter();
|
|
131
|
+
isHovered = false;
|
|
132
|
+
onMouseEnter() {
|
|
133
|
+
this.isHovered = true;
|
|
134
|
+
}
|
|
135
|
+
onMouseLeave() {
|
|
136
|
+
this.isHovered = false;
|
|
137
|
+
}
|
|
138
|
+
get currentBackgroundColor() {
|
|
139
|
+
return this.isHovered
|
|
140
|
+
? this.backgroundColorHover || this.backgroundColor
|
|
141
|
+
: this.backgroundColor;
|
|
142
|
+
}
|
|
143
|
+
get currentBorderRadius() {
|
|
144
|
+
return this.isHovered
|
|
145
|
+
? this.borderRadiusHover || this.borderRadius
|
|
146
|
+
: this.borderRadius;
|
|
147
|
+
}
|
|
148
|
+
get currentColorContent() {
|
|
149
|
+
return this.isHovered
|
|
150
|
+
? this.colorContentHover || this.colorContent
|
|
151
|
+
: this.colorContent;
|
|
152
|
+
}
|
|
153
|
+
get hasIconLeft() {
|
|
154
|
+
return !!this.iconLeft;
|
|
155
|
+
}
|
|
156
|
+
get hasIconRight() {
|
|
157
|
+
return !!this.iconRight;
|
|
158
|
+
}
|
|
159
|
+
// ✅ Chỉ giữ 1 iconLeftData
|
|
160
|
+
get iconLeftData() {
|
|
161
|
+
if (!this.iconLeft)
|
|
162
|
+
return undefined;
|
|
163
|
+
const color = this.isHovered || this.isSidebarExpanded
|
|
164
|
+
? this.colorIconLeftHover || this.colorIconLeft
|
|
165
|
+
: this.colorIconLeft;
|
|
166
|
+
if (typeof this.iconLeft === 'string') {
|
|
167
|
+
return {
|
|
168
|
+
icon: this.iconLeft,
|
|
169
|
+
colorIcon: color,
|
|
170
|
+
width: this.widthIconLeft,
|
|
171
|
+
height: this.heightIconLeft,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
...this.iconLeft,
|
|
176
|
+
colorIcon: color || this.iconLeft.colorIcon,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
// ✅ Chỉ giữ 1 iconRightData
|
|
180
|
+
get iconRightData() {
|
|
181
|
+
if (!this.iconRight)
|
|
182
|
+
return undefined;
|
|
183
|
+
const color = this.isHovered || this.isSidebarExpanded
|
|
184
|
+
? this.colorIconRightHover || this.colorIconRight
|
|
185
|
+
: this.colorIconRight;
|
|
186
|
+
if (typeof this.iconRight === 'string') {
|
|
187
|
+
return {
|
|
188
|
+
icon: this.iconRight,
|
|
189
|
+
colorIcon: color,
|
|
190
|
+
width: this.widthIconRight,
|
|
191
|
+
height: this.heightIconRight,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
...this.iconRight,
|
|
196
|
+
colorIcon: color || this.iconRight.colorIcon,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
handleClick(event) {
|
|
200
|
+
if (!this.routerLink) {
|
|
201
|
+
event.preventDefault();
|
|
202
|
+
this.clicked.emit(event);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: FunctionalLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
206
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: FunctionalLabelComponent, isStandalone: true, selector: "app-functional-label", inputs: { iconLeft: "iconLeft", iconRight: "iconRight", colorIconLeft: "colorIconLeft", colorIconRight: "colorIconRight", widthIconLeft: "widthIconLeft", heightIconLeft: "heightIconLeft", widthIconRight: "widthIconRight", heightIconRight: "heightIconRight", colorIconLeftHover: "colorIconLeftHover", colorIconRightHover: "colorIconRightHover", colorContentHover: "colorContentHover", backgroundColorHover: "backgroundColorHover", borderRadiusHover: "borderRadiusHover", content: "content", colorContent: "colorContent", widthContent: "widthContent", heightContent: "heightContent", backgroundColor: "backgroundColor", borderRadius: "borderRadius", width: "width", height: "height", routerLink: "routerLink", isSidebarExpanded: "isSidebarExpanded" }, outputs: { clicked: "clicked" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0, template: "<div\r\n class=\"functional-label\"\r\n (click)=\"handleClick($event)\"\r\n (keydown.enter)=\"handleClick($event)\"\r\n (keydown.space)=\"handleClick($event)\"\r\n [attr.tabindex]=\"routerLink ? null : 0\"\r\n [attr.role]=\"routerLink ? null : 'button'\"\r\n [style.background-color]=\"currentBackgroundColor\"\r\n [style.border-radius]=\"currentBorderRadius\"\r\n [style.width]=\"width\"\r\n [style.height]=\"height\"\r\n>\r\n @if (hasIconLeft && iconLeftData) {\r\n <app-icon\r\n [iconData]=\"iconLeftData\"\r\n [width]=\"widthIconLeft\"\r\n [height]=\"heightIconLeft\"\r\n [colorIconHover]=\"colorIconLeftHover\"\r\n [backgroundColorHover]=\"backgroundColorHover\"\r\n ></app-icon>\r\n }\r\n <a\r\n [routerLink]=\"routerLink\"\r\n [style.color]=\"currentColorContent\"\r\n [style.width]=\"widthContent\"\r\n [style.height]=\"heightContent\"\r\n >{{ content }}</a\r\n >\r\n @if (hasIconRight && iconRightData) {\r\n <app-icon\r\n [iconData]=\"iconRightData\"\r\n [colorIconHover]=\"colorIconRightHover\"\r\n [backgroundColorHover]=\"backgroundColorHover\"\r\n ></app-icon>\r\n }\r\n</div>\r\n", styles: [":host{display:block;width:100%}.functional-label{display:flex;align-items:center;justify-content:center;height:40px;padding:0;cursor:pointer;box-sizing:border-box;transition:all .25s ease}.functional-label app-icon{display:flex;flex-shrink:0;justify-content:center;width:44px}.functional-label a{max-width:0;opacity:0;visibility:hidden;white-space:nowrap;overflow:hidden;text-decoration:none;color:var(--neutral-color-400);transform:translate(-10px);transition:all .25s ease;display:flex;justify-content:flex-start;align-items:center}:host-context(.sidebar-wrapper:hover) .functional-label{justify-content:flex-start;padding-left:8px}:host-context(.sidebar-wrapper:hover) .functional-label a{opacity:1;visibility:visible;max-width:200px;transform:translate(0);color:var(--brand-600);flex:1;text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: IconComponent, selector: "app-icon", inputs: ["iconData", "icon", "colorIcon", "routerLink", "width", "height", "colorIconHover", "backgroundColorHover"], outputs: ["clicked"] }] });
|
|
207
|
+
}
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: FunctionalLabelComponent, decorators: [{
|
|
209
|
+
type: Component,
|
|
210
|
+
args: [{ selector: 'app-functional-label', standalone: true, imports: [CommonModule, RouterModule, IconComponent], template: "<div\r\n class=\"functional-label\"\r\n (click)=\"handleClick($event)\"\r\n (keydown.enter)=\"handleClick($event)\"\r\n (keydown.space)=\"handleClick($event)\"\r\n [attr.tabindex]=\"routerLink ? null : 0\"\r\n [attr.role]=\"routerLink ? null : 'button'\"\r\n [style.background-color]=\"currentBackgroundColor\"\r\n [style.border-radius]=\"currentBorderRadius\"\r\n [style.width]=\"width\"\r\n [style.height]=\"height\"\r\n>\r\n @if (hasIconLeft && iconLeftData) {\r\n <app-icon\r\n [iconData]=\"iconLeftData\"\r\n [width]=\"widthIconLeft\"\r\n [height]=\"heightIconLeft\"\r\n [colorIconHover]=\"colorIconLeftHover\"\r\n [backgroundColorHover]=\"backgroundColorHover\"\r\n ></app-icon>\r\n }\r\n <a\r\n [routerLink]=\"routerLink\"\r\n [style.color]=\"currentColorContent\"\r\n [style.width]=\"widthContent\"\r\n [style.height]=\"heightContent\"\r\n >{{ content }}</a\r\n >\r\n @if (hasIconRight && iconRightData) {\r\n <app-icon\r\n [iconData]=\"iconRightData\"\r\n [colorIconHover]=\"colorIconRightHover\"\r\n [backgroundColorHover]=\"backgroundColorHover\"\r\n ></app-icon>\r\n }\r\n</div>\r\n", styles: [":host{display:block;width:100%}.functional-label{display:flex;align-items:center;justify-content:center;height:40px;padding:0;cursor:pointer;box-sizing:border-box;transition:all .25s ease}.functional-label app-icon{display:flex;flex-shrink:0;justify-content:center;width:44px}.functional-label a{max-width:0;opacity:0;visibility:hidden;white-space:nowrap;overflow:hidden;text-decoration:none;color:var(--neutral-color-400);transform:translate(-10px);transition:all .25s ease;display:flex;justify-content:flex-start;align-items:center}:host-context(.sidebar-wrapper:hover) .functional-label{justify-content:flex-start;padding-left:8px}:host-context(.sidebar-wrapper:hover) .functional-label a{opacity:1;visibility:visible;max-width:200px;transform:translate(0);color:var(--brand-600);flex:1;text-align:center}\n"] }]
|
|
211
|
+
}], propDecorators: { iconLeft: [{
|
|
212
|
+
type: Input
|
|
213
|
+
}], iconRight: [{
|
|
214
|
+
type: Input
|
|
215
|
+
}], colorIconLeft: [{
|
|
216
|
+
type: Input
|
|
217
|
+
}], colorIconRight: [{
|
|
218
|
+
type: Input
|
|
219
|
+
}], widthIconLeft: [{
|
|
220
|
+
type: Input
|
|
221
|
+
}], heightIconLeft: [{
|
|
222
|
+
type: Input
|
|
223
|
+
}], widthIconRight: [{
|
|
224
|
+
type: Input
|
|
225
|
+
}], heightIconRight: [{
|
|
226
|
+
type: Input
|
|
227
|
+
}], colorIconLeftHover: [{
|
|
228
|
+
type: Input
|
|
229
|
+
}], colorIconRightHover: [{
|
|
230
|
+
type: Input
|
|
231
|
+
}], colorContentHover: [{
|
|
232
|
+
type: Input
|
|
233
|
+
}], backgroundColorHover: [{
|
|
234
|
+
type: Input
|
|
235
|
+
}], borderRadiusHover: [{
|
|
236
|
+
type: Input
|
|
237
|
+
}], content: [{
|
|
238
|
+
type: Input
|
|
239
|
+
}], colorContent: [{
|
|
240
|
+
type: Input
|
|
241
|
+
}], widthContent: [{
|
|
242
|
+
type: Input
|
|
243
|
+
}], heightContent: [{
|
|
244
|
+
type: Input
|
|
245
|
+
}], backgroundColor: [{
|
|
246
|
+
type: Input
|
|
247
|
+
}], borderRadius: [{
|
|
248
|
+
type: Input
|
|
249
|
+
}], width: [{
|
|
250
|
+
type: Input
|
|
251
|
+
}], height: [{
|
|
252
|
+
type: Input
|
|
253
|
+
}], routerLink: [{
|
|
254
|
+
type: Input
|
|
255
|
+
}], isSidebarExpanded: [{
|
|
256
|
+
type: Input
|
|
257
|
+
}], clicked: [{
|
|
258
|
+
type: Output
|
|
259
|
+
}], onMouseEnter: [{
|
|
260
|
+
type: HostListener,
|
|
261
|
+
args: ['mouseenter']
|
|
262
|
+
}], onMouseLeave: [{
|
|
263
|
+
type: HostListener,
|
|
264
|
+
args: ['mouseleave']
|
|
265
|
+
}] } });
|
|
266
|
+
|
|
267
|
+
class SidebarComponent {
|
|
268
|
+
data = { menuItems: [] };
|
|
269
|
+
isSidebarExpanded = false;
|
|
270
|
+
onMouseEnter() {
|
|
271
|
+
this.isSidebarExpanded = true;
|
|
272
|
+
}
|
|
273
|
+
onMouseLeave() {
|
|
274
|
+
this.isSidebarExpanded = false;
|
|
275
|
+
}
|
|
276
|
+
onMenuItemClick(item, event) {
|
|
277
|
+
console.log('Menu item clicked:', item, event);
|
|
278
|
+
}
|
|
279
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
280
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: SidebarComponent, isStandalone: true, selector: "app-sidebar", inputs: { data: "data" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0, template: "<div class=\"sidebar-wrapper\">\r\n <aside\r\n class=\"sidebar\"\r\n [style.background-color]=\"!isSidebarExpanded ? data.backgroundColor : null\"\r\n >\r\n @for (item of data.menuItems; track $index) {\r\n <app-functional-label\r\n class=\"sidebar-item\"\r\n [isSidebarExpanded]=\"isSidebarExpanded\"\r\n [iconLeft]=\"item.iconLeft\"\r\n [iconRight]=\"item.iconRight\"\r\n [content]=\"item.content\"\r\n [routerLink]=\"item.url\"\r\n [colorIconLeft]=\"item.colorIconLeft\"\r\n [colorIconRight]=\"item.colorIconRight\"\r\n [colorContent]=\"item.colorContent\"\r\n [backgroundColor]=\"item.backgroundColor\"\r\n [borderRadius]=\"item.borderRadius\"\r\n (clicked)=\"onMenuItemClick(item, $event)\"\r\n [colorIconLeftHover]=\"item.colorIconLeftHover\"\r\n [colorIconRightHover]=\"item.colorIconRightHover\"\r\n [backgroundColorHover]=\"item.backgroundColorHover\"\r\n [width]=\"item.width\"\r\n [height]=\"item.height\"\r\n ></app-functional-label>\r\n }\r\n </aside>\r\n</div>\r\n", styles: [":host{display:block;height:100vh}.sidebar-wrapper{width:44px;height:100vh;transition:width .3s ease;background-color:transparent}.sidebar{display:flex;flex-direction:column;gap:8px;width:44px;height:100%;padding:8px;box-sizing:border-box;border-radius:16px;overflow:hidden;transition:width .3s ease,padding .3s ease,background-color .3s ease}.sidebar a{text-decoration:none}.sidebar-wrapper:hover{width:344px}.sidebar-wrapper:hover .sidebar{width:344px;padding:16px 8px;border-radius:16px;background-color:var(--theme-neutral-light-100)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: FunctionalLabelComponent, selector: "app-functional-label", inputs: ["iconLeft", "iconRight", "colorIconLeft", "colorIconRight", "widthIconLeft", "heightIconLeft", "widthIconRight", "heightIconRight", "colorIconLeftHover", "colorIconRightHover", "colorContentHover", "backgroundColorHover", "borderRadiusHover", "content", "colorContent", "widthContent", "heightContent", "backgroundColor", "borderRadius", "width", "height", "routerLink", "isSidebarExpanded"], outputs: ["clicked"] }] });
|
|
281
|
+
}
|
|
282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SidebarComponent, decorators: [{
|
|
283
|
+
type: Component,
|
|
284
|
+
args: [{ selector: 'app-sidebar', standalone: true, imports: [CommonModule, FunctionalLabelComponent], template: "<div class=\"sidebar-wrapper\">\r\n <aside\r\n class=\"sidebar\"\r\n [style.background-color]=\"!isSidebarExpanded ? data.backgroundColor : null\"\r\n >\r\n @for (item of data.menuItems; track $index) {\r\n <app-functional-label\r\n class=\"sidebar-item\"\r\n [isSidebarExpanded]=\"isSidebarExpanded\"\r\n [iconLeft]=\"item.iconLeft\"\r\n [iconRight]=\"item.iconRight\"\r\n [content]=\"item.content\"\r\n [routerLink]=\"item.url\"\r\n [colorIconLeft]=\"item.colorIconLeft\"\r\n [colorIconRight]=\"item.colorIconRight\"\r\n [colorContent]=\"item.colorContent\"\r\n [backgroundColor]=\"item.backgroundColor\"\r\n [borderRadius]=\"item.borderRadius\"\r\n (clicked)=\"onMenuItemClick(item, $event)\"\r\n [colorIconLeftHover]=\"item.colorIconLeftHover\"\r\n [colorIconRightHover]=\"item.colorIconRightHover\"\r\n [backgroundColorHover]=\"item.backgroundColorHover\"\r\n [width]=\"item.width\"\r\n [height]=\"item.height\"\r\n ></app-functional-label>\r\n }\r\n </aside>\r\n</div>\r\n", styles: [":host{display:block;height:100vh}.sidebar-wrapper{width:44px;height:100vh;transition:width .3s ease;background-color:transparent}.sidebar{display:flex;flex-direction:column;gap:8px;width:44px;height:100%;padding:8px;box-sizing:border-box;border-radius:16px;overflow:hidden;transition:width .3s ease,padding .3s ease,background-color .3s ease}.sidebar a{text-decoration:none}.sidebar-wrapper:hover{width:344px}.sidebar-wrapper:hover .sidebar{width:344px;padding:16px 8px;border-radius:16px;background-color:var(--theme-neutral-light-100)}\n"] }]
|
|
285
|
+
}], propDecorators: { data: [{
|
|
286
|
+
type: Input
|
|
287
|
+
}], onMouseEnter: [{
|
|
288
|
+
type: HostListener,
|
|
289
|
+
args: ['mouseenter']
|
|
290
|
+
}], onMouseLeave: [{
|
|
291
|
+
type: HostListener,
|
|
292
|
+
args: ['mouseleave']
|
|
293
|
+
}] } });
|
|
294
|
+
|
|
295
|
+
const BUTTON_SIZE_MAP = {
|
|
296
|
+
xs: {
|
|
297
|
+
minWidth: '47px',
|
|
298
|
+
minHeight: '24px',
|
|
299
|
+
fontSize: 'var(--font-xs)',
|
|
300
|
+
iconSize: '14px',
|
|
301
|
+
contentWidth: '32px',
|
|
302
|
+
contentHeight: '16px',
|
|
303
|
+
},
|
|
304
|
+
sm: {
|
|
305
|
+
minWidth: '96px',
|
|
306
|
+
minHeight: '28px',
|
|
307
|
+
fontSize: 'var(--font-sm)',
|
|
308
|
+
iconSize: '16px',
|
|
309
|
+
contentWidth: '44px',
|
|
310
|
+
contentHeight: '20px',
|
|
311
|
+
},
|
|
312
|
+
md: {
|
|
313
|
+
minWidth: '116px',
|
|
314
|
+
minHeight: '36px',
|
|
315
|
+
fontSize: 'var(--font-sm)',
|
|
316
|
+
iconSize: '20px',
|
|
317
|
+
contentWidth: '52px',
|
|
318
|
+
contentHeight: '20px',
|
|
319
|
+
},
|
|
320
|
+
lg: {
|
|
321
|
+
minWidth: '120px',
|
|
322
|
+
minHeight: '44px',
|
|
323
|
+
fontSize: 'var(--font-sm)',
|
|
324
|
+
iconSize: '20px',
|
|
325
|
+
contentWidth: '52px',
|
|
326
|
+
contentHeight: '20px',
|
|
327
|
+
},
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
class ButtonContainerComponent {
|
|
331
|
+
size = 'md';
|
|
332
|
+
content = '';
|
|
333
|
+
fontSize;
|
|
334
|
+
leftIcon;
|
|
335
|
+
rightIcon;
|
|
336
|
+
color = 'var(--brand-100)';
|
|
337
|
+
backgroundColor = 'var(--utility-900)';
|
|
338
|
+
borderColor = 'var(--brand-100)';
|
|
339
|
+
buttonClick = new EventEmitter();
|
|
340
|
+
get sizeStyle() {
|
|
341
|
+
return BUTTON_SIZE_MAP[this.size];
|
|
342
|
+
}
|
|
343
|
+
handleClick() {
|
|
344
|
+
this.buttonClick.emit();
|
|
345
|
+
}
|
|
346
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ButtonContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
347
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ButtonContainerComponent, isStandalone: true, selector: "app-button-container", inputs: { size: "size", content: "content", fontSize: "fontSize", leftIcon: "leftIcon", rightIcon: "rightIcon", color: "color", backgroundColor: "backgroundColor", borderColor: "borderColor" }, outputs: { buttonClick: "buttonClick" }, ngImport: i0, template: "<button class=\"button-container\" [style.minWidth]=\"sizeStyle.minWidth\" [style.minHeight]=\"sizeStyle.minHeight\" [style.color]=\"color\"\r\n [style.backgroundColor]=\"backgroundColor\" [style.borderColor]=\"borderColor\" (click)=\"handleClick()\">\r\n \r\n @if(leftIcon){\r\n <i class=\"button-icon\" [style.width]=\"sizeStyle.iconSize\" [style.height]=\"sizeStyle.iconSize\" [style.fontSize]=\"sizeStyle.iconSize\">\r\n {{leftIcon}}\r\n </i>\r\n }\r\n\r\n <span class=\"button-content\" [style.minWidth]=\"sizeStyle.contentWidth\" [style.minHeight]=\"sizeStyle.contentHeight\" \r\n [style.fontSize]=\"fontSize || sizeStyle.fontSize\" [style.color]=\"color\">\r\n {{ content }}\r\n </span>\r\n\r\n @if(rightIcon){\r\n <i class=\"button-icon\" [style.width]=\"sizeStyle.iconSize\" [style.height]=\"sizeStyle.iconSize\" [style.fontSize]=\"sizeStyle.iconSize\" [style.color]=\"color\">\r\n {{rightIcon}}\r\n </i>\r\n }\r\n</button>", styles: [".button-container{display:flex;justify-content:center;align-items:center;gap:8px;border-radius:var(--radius-md);cursor:pointer;padding:8px 16px;border:none;font-weight:500;transition:filter .15s ease,transform .1s ease}.button-container:hover{filter:brightness(1.1)}.button-container:active{filter:brightness(.9);transform:scale(.98)}.button-container:focus{outline:2px solid var(--brand-600);outline-offset:2px}.button-content{display:flex;align-items:center;justify-content:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.button-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
348
|
+
}
|
|
349
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ButtonContainerComponent, decorators: [{
|
|
350
|
+
type: Component,
|
|
351
|
+
args: [{ selector: 'app-button-container', standalone: true, imports: [CommonModule], template: "<button class=\"button-container\" [style.minWidth]=\"sizeStyle.minWidth\" [style.minHeight]=\"sizeStyle.minHeight\" [style.color]=\"color\"\r\n [style.backgroundColor]=\"backgroundColor\" [style.borderColor]=\"borderColor\" (click)=\"handleClick()\">\r\n \r\n @if(leftIcon){\r\n <i class=\"button-icon\" [style.width]=\"sizeStyle.iconSize\" [style.height]=\"sizeStyle.iconSize\" [style.fontSize]=\"sizeStyle.iconSize\">\r\n {{leftIcon}}\r\n </i>\r\n }\r\n\r\n <span class=\"button-content\" [style.minWidth]=\"sizeStyle.contentWidth\" [style.minHeight]=\"sizeStyle.contentHeight\" \r\n [style.fontSize]=\"fontSize || sizeStyle.fontSize\" [style.color]=\"color\">\r\n {{ content }}\r\n </span>\r\n\r\n @if(rightIcon){\r\n <i class=\"button-icon\" [style.width]=\"sizeStyle.iconSize\" [style.height]=\"sizeStyle.iconSize\" [style.fontSize]=\"sizeStyle.iconSize\" [style.color]=\"color\">\r\n {{rightIcon}}\r\n </i>\r\n }\r\n</button>", styles: [".button-container{display:flex;justify-content:center;align-items:center;gap:8px;border-radius:var(--radius-md);cursor:pointer;padding:8px 16px;border:none;font-weight:500;transition:filter .15s ease,transform .1s ease}.button-container:hover{filter:brightness(1.1)}.button-container:active{filter:brightness(.9);transform:scale(.98)}.button-container:focus{outline:2px solid var(--brand-600);outline-offset:2px}.button-content{display:flex;align-items:center;justify-content:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.button-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0}\n"] }]
|
|
352
|
+
}], propDecorators: { size: [{
|
|
353
|
+
type: Input
|
|
354
|
+
}], content: [{
|
|
355
|
+
type: Input
|
|
356
|
+
}], fontSize: [{
|
|
357
|
+
type: Input
|
|
358
|
+
}], leftIcon: [{
|
|
359
|
+
type: Input
|
|
360
|
+
}], rightIcon: [{
|
|
361
|
+
type: Input
|
|
362
|
+
}], color: [{
|
|
363
|
+
type: Input
|
|
364
|
+
}], backgroundColor: [{
|
|
365
|
+
type: Input
|
|
366
|
+
}], borderColor: [{
|
|
367
|
+
type: Input
|
|
368
|
+
}], buttonClick: [{
|
|
369
|
+
type: Output
|
|
370
|
+
}] } });
|
|
371
|
+
|
|
372
|
+
class LabelButtonComponent {
|
|
373
|
+
label = '';
|
|
374
|
+
bgColor = '';
|
|
375
|
+
borderColor = '';
|
|
376
|
+
width = '100%';
|
|
377
|
+
height = '28px';
|
|
378
|
+
textColor = 'var(--neutral-100)';
|
|
379
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LabelButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
380
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: LabelButtonComponent, isStandalone: true, selector: "app-label-button", inputs: { label: "label", bgColor: "bgColor", borderColor: "borderColor", width: "width", height: "height", textColor: "textColor" }, ngImport: i0, template: "<button\n [style.background-color]=\"bgColor\"\n [style.border-color]=\"borderColor\"\n [style.color]=\"textColor\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n class=\"label-button\"\n type=\"button\"\n>\n {{ label }}\n</button>\n", styles: [".label-button{padding:16px 8px;border-radius:16px;border:1px solid var(--border-color);background-color:var(--bg-color);font-size:var(--font-xs);font-weight:var(--font-weight-medium);line-height:var(--line-height-xs);display:flex;justify-content:center;align-items:center;text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
381
|
+
}
|
|
382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: LabelButtonComponent, decorators: [{
|
|
383
|
+
type: Component,
|
|
384
|
+
args: [{ selector: 'app-label-button', standalone: true, imports: [CommonModule], template: "<button\n [style.background-color]=\"bgColor\"\n [style.border-color]=\"borderColor\"\n [style.color]=\"textColor\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n class=\"label-button\"\n type=\"button\"\n>\n {{ label }}\n</button>\n", styles: [".label-button{padding:16px 8px;border-radius:16px;border:1px solid var(--border-color);background-color:var(--bg-color);font-size:var(--font-xs);font-weight:var(--font-weight-medium);line-height:var(--line-height-xs);display:flex;justify-content:center;align-items:center;text-align:center}\n"] }]
|
|
385
|
+
}], propDecorators: { label: [{
|
|
386
|
+
type: Input
|
|
387
|
+
}], bgColor: [{
|
|
388
|
+
type: Input
|
|
389
|
+
}], borderColor: [{
|
|
390
|
+
type: Input
|
|
391
|
+
}], width: [{
|
|
392
|
+
type: Input
|
|
393
|
+
}], height: [{
|
|
394
|
+
type: Input
|
|
395
|
+
}], textColor: [{
|
|
396
|
+
type: Input
|
|
397
|
+
}] } });
|
|
398
|
+
|
|
399
|
+
class InputTextComponent {
|
|
400
|
+
headerInput = '';
|
|
401
|
+
placeholder = '';
|
|
402
|
+
readonly = false;
|
|
403
|
+
required = false;
|
|
404
|
+
width = '100%';
|
|
405
|
+
maxLength = 0; // 0 = no limit
|
|
406
|
+
showLimit = false;
|
|
407
|
+
icon = '';
|
|
408
|
+
typeInput = 'text';
|
|
409
|
+
valueChange = new EventEmitter();
|
|
410
|
+
iconClick = new EventEmitter();
|
|
411
|
+
_value = '';
|
|
412
|
+
onIconClick() {
|
|
413
|
+
this.iconClick.emit();
|
|
414
|
+
}
|
|
415
|
+
set value(val) {
|
|
416
|
+
this._value = val || '';
|
|
417
|
+
}
|
|
418
|
+
get value() {
|
|
419
|
+
return this._value;
|
|
420
|
+
}
|
|
421
|
+
get currentLength() {
|
|
422
|
+
return this._value?.length || 0;
|
|
423
|
+
}
|
|
424
|
+
get limit() {
|
|
425
|
+
if (!this.showLimit || this.maxLength <= 0)
|
|
426
|
+
return '';
|
|
427
|
+
return `${this.currentLength}/${this.maxLength}`;
|
|
428
|
+
}
|
|
429
|
+
onInput(event) {
|
|
430
|
+
const input = event.target;
|
|
431
|
+
let newValue = input.value;
|
|
432
|
+
// Enforce maxLength if set
|
|
433
|
+
if (this.maxLength > 0 && newValue.length > this.maxLength) {
|
|
434
|
+
newValue = newValue.substring(0, this.maxLength);
|
|
435
|
+
input.value = newValue;
|
|
436
|
+
}
|
|
437
|
+
this._value = newValue;
|
|
438
|
+
this.valueChange.emit(this._value);
|
|
439
|
+
}
|
|
440
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: InputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
441
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: InputTextComponent, isStandalone: true, selector: "app-input-text", inputs: { headerInput: "headerInput", placeholder: "placeholder", readonly: "readonly", required: "required", width: "width", maxLength: "maxLength", showLimit: "showLimit", icon: "icon", typeInput: "typeInput", value: "value" }, outputs: { valueChange: "valueChange", iconClick: "iconClick" }, ngImport: i0, template: "<div class=\"input-form\">\r\n <div class=\"input-form-content\">\r\n <label class=\"input-form-label\">\r\n <span class=\"label-text\" [class.hidden]=\"!headerInput\">\r\n {{ headerInput }}\r\n @if (required) {\r\n <span class=\"required-mark\">*</span>\r\n }\r\n </span>\r\n <div class=\"input-field-wrapper\">\r\n <input\r\n [type]=\"typeInput\"\r\n class=\"input-form-field\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [required]=\"required\"\r\n [style.width]=\"width\"\r\n [value]=\"value\"\r\n (input)=\"onInput($event)\"\r\n [attr.maxlength]=\"maxLength > 0 ? maxLength : null\"\r\n />\r\n @if (icon) {\r\n <button\r\n type=\"button\"\r\n class=\"input-icon-button\"\r\n [class.clickable]=\"iconClick.observed\"\r\n (click)=\"onIconClick()\"\r\n [attr.aria-label]=\"icon\"\r\n [disabled]=\"!iconClick.observed\"\r\n >\r\n <i [class]=\"icon\" class=\"input-icon\"></i>\r\n </button>\r\n }\r\n </div>\r\n </label>\r\n </div>\r\n <div class=\"limit\" [class.hidden]=\"!(maxLength > 0 && showLimit)\">\r\n <span>{{ limit }}</span>\r\n </div>\r\n</div>\r\n", styles: [".input-form{display:flex;flex-direction:column;justify-content:space-between;gap:4px}.hidden{visibility:hidden}.input-form-label{display:block;font-size:var(--font-sm);font-weight:700;color:var(--neutral-color-700)}.label-text{display:block;margin-bottom:4px;height:20px}.required-mark{color:var(--utility-600);margin-left:2px}.input-form-field{padding:8px 12px;border:1px solid var(--neutral-color-200);border-radius:var(--radius-md);font-size:var(--font-sm);color:var(--neutral-color-875);height:36px;width:100%;box-sizing:border-box;background-color:var(--neutral-color-10);transition:border-color .2s ease,box-shadow .2s ease}.input-form-field::placeholder{color:var(--neutral-color-400)}.input-form-field:focus{outline:none;border-color:var(--brand-500);box-shadow:0 0 0 2px rgba(var(--brand-500-rgb, 39, 64, 180),.15)}.input-form-field:read-only{background-color:var(--neutral-color-25);cursor:not-allowed}.input-form-field[type=password]{font-family:Verdana,sans-serif;font-size:16px;letter-spacing:3px}.input-form-field[type=password]::placeholder{font-family:inherit;font-size:var(--font-sm);letter-spacing:normal}.input-field-wrapper:has(.input-icon-button) .input-form-field{padding-right:36px}.input-field-wrapper{position:relative;display:flex;align-items:center}.input-icon-button{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:none;border:none;padding:0;margin:0;display:flex;align-items:center;justify-content:center;color:var(--neutral-color-500);transition:color .2s ease;outline:none}.input-icon-button.clickable{cursor:pointer}.input-icon-button.clickable:hover .input-icon{color:var(--brand-500)}.input-icon-button:disabled{cursor:default;pointer-events:none}.input-icon{font-size:14px!important;width:14px;height:14px;display:flex;align-items:center;justify-content:center;transition:color .2s ease}.input-icon:before{font-size:14px!important}.limit{display:flex;justify-content:flex-end}.limit span{font-size:var(--font-xs, 12px);color:var(--neutral-color-500)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }] });
|
|
442
|
+
}
|
|
443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: InputTextComponent, decorators: [{
|
|
444
|
+
type: Component,
|
|
445
|
+
args: [{ selector: 'app-input-text', standalone: true, imports: [CommonModule, FormsModule], template: "<div class=\"input-form\">\r\n <div class=\"input-form-content\">\r\n <label class=\"input-form-label\">\r\n <span class=\"label-text\" [class.hidden]=\"!headerInput\">\r\n {{ headerInput }}\r\n @if (required) {\r\n <span class=\"required-mark\">*</span>\r\n }\r\n </span>\r\n <div class=\"input-field-wrapper\">\r\n <input\r\n [type]=\"typeInput\"\r\n class=\"input-form-field\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [required]=\"required\"\r\n [style.width]=\"width\"\r\n [value]=\"value\"\r\n (input)=\"onInput($event)\"\r\n [attr.maxlength]=\"maxLength > 0 ? maxLength : null\"\r\n />\r\n @if (icon) {\r\n <button\r\n type=\"button\"\r\n class=\"input-icon-button\"\r\n [class.clickable]=\"iconClick.observed\"\r\n (click)=\"onIconClick()\"\r\n [attr.aria-label]=\"icon\"\r\n [disabled]=\"!iconClick.observed\"\r\n >\r\n <i [class]=\"icon\" class=\"input-icon\"></i>\r\n </button>\r\n }\r\n </div>\r\n </label>\r\n </div>\r\n <div class=\"limit\" [class.hidden]=\"!(maxLength > 0 && showLimit)\">\r\n <span>{{ limit }}</span>\r\n </div>\r\n</div>\r\n", styles: [".input-form{display:flex;flex-direction:column;justify-content:space-between;gap:4px}.hidden{visibility:hidden}.input-form-label{display:block;font-size:var(--font-sm);font-weight:700;color:var(--neutral-color-700)}.label-text{display:block;margin-bottom:4px;height:20px}.required-mark{color:var(--utility-600);margin-left:2px}.input-form-field{padding:8px 12px;border:1px solid var(--neutral-color-200);border-radius:var(--radius-md);font-size:var(--font-sm);color:var(--neutral-color-875);height:36px;width:100%;box-sizing:border-box;background-color:var(--neutral-color-10);transition:border-color .2s ease,box-shadow .2s ease}.input-form-field::placeholder{color:var(--neutral-color-400)}.input-form-field:focus{outline:none;border-color:var(--brand-500);box-shadow:0 0 0 2px rgba(var(--brand-500-rgb, 39, 64, 180),.15)}.input-form-field:read-only{background-color:var(--neutral-color-25);cursor:not-allowed}.input-form-field[type=password]{font-family:Verdana,sans-serif;font-size:16px;letter-spacing:3px}.input-form-field[type=password]::placeholder{font-family:inherit;font-size:var(--font-sm);letter-spacing:normal}.input-field-wrapper:has(.input-icon-button) .input-form-field{padding-right:36px}.input-field-wrapper{position:relative;display:flex;align-items:center}.input-icon-button{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:none;border:none;padding:0;margin:0;display:flex;align-items:center;justify-content:center;color:var(--neutral-color-500);transition:color .2s ease;outline:none}.input-icon-button.clickable{cursor:pointer}.input-icon-button.clickable:hover .input-icon{color:var(--brand-500)}.input-icon-button:disabled{cursor:default;pointer-events:none}.input-icon{font-size:14px!important;width:14px;height:14px;display:flex;align-items:center;justify-content:center;transition:color .2s ease}.input-icon:before{font-size:14px!important}.limit{display:flex;justify-content:flex-end}.limit span{font-size:var(--font-xs, 12px);color:var(--neutral-color-500)}\n"] }]
|
|
446
|
+
}], propDecorators: { headerInput: [{
|
|
447
|
+
type: Input
|
|
448
|
+
}], placeholder: [{
|
|
449
|
+
type: Input
|
|
450
|
+
}], readonly: [{
|
|
451
|
+
type: Input
|
|
452
|
+
}], required: [{
|
|
453
|
+
type: Input
|
|
454
|
+
}], width: [{
|
|
455
|
+
type: Input
|
|
456
|
+
}], maxLength: [{
|
|
457
|
+
type: Input
|
|
458
|
+
}], showLimit: [{
|
|
459
|
+
type: Input
|
|
460
|
+
}], icon: [{
|
|
461
|
+
type: Input
|
|
462
|
+
}], typeInput: [{
|
|
463
|
+
type: Input
|
|
464
|
+
}], valueChange: [{
|
|
465
|
+
type: Output
|
|
466
|
+
}], iconClick: [{
|
|
467
|
+
type: Output
|
|
468
|
+
}], value: [{
|
|
469
|
+
type: Input
|
|
470
|
+
}] } });
|
|
471
|
+
|
|
472
|
+
class InputStepperComponent {
|
|
473
|
+
componentId = `input-stepper-${Math.random().toString(36).substring(2, 9)}`;
|
|
474
|
+
headerInput = '';
|
|
475
|
+
placeholder = '';
|
|
476
|
+
readonly = false;
|
|
477
|
+
required = false;
|
|
478
|
+
disabled = false;
|
|
479
|
+
width = '100%';
|
|
480
|
+
min = 0;
|
|
481
|
+
max = 100;
|
|
482
|
+
error = '';
|
|
483
|
+
helperText = '';
|
|
484
|
+
step = 1;
|
|
485
|
+
state = 'default';
|
|
486
|
+
valueChange = new EventEmitter();
|
|
487
|
+
_value = 0;
|
|
488
|
+
set value(val) {
|
|
489
|
+
this._value = val || 0;
|
|
490
|
+
}
|
|
491
|
+
get value() {
|
|
492
|
+
return this._value;
|
|
493
|
+
}
|
|
494
|
+
increment() {
|
|
495
|
+
if (this.readonly || this.disabled)
|
|
496
|
+
return;
|
|
497
|
+
const newValue = this._value + this.step;
|
|
498
|
+
if (newValue <= this.max) {
|
|
499
|
+
this._value = newValue;
|
|
500
|
+
this.valueChange.emit(this._value);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
decrement() {
|
|
504
|
+
if (this.readonly || this.disabled)
|
|
505
|
+
return;
|
|
506
|
+
const newValue = this._value - this.step;
|
|
507
|
+
if (newValue >= this.min) {
|
|
508
|
+
this._value = newValue;
|
|
509
|
+
this.valueChange.emit(this._value);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
onInput(event) {
|
|
513
|
+
const input = event.target;
|
|
514
|
+
let newValue = Number.parseInt(input.value, 10);
|
|
515
|
+
if (Number.isNaN(newValue)) {
|
|
516
|
+
newValue = this.min;
|
|
517
|
+
}
|
|
518
|
+
if (newValue < this.min)
|
|
519
|
+
newValue = this.min;
|
|
520
|
+
if (newValue > this.max)
|
|
521
|
+
newValue = this.max;
|
|
522
|
+
input.value = newValue.toString();
|
|
523
|
+
this._value = newValue;
|
|
524
|
+
this.valueChange.emit(this._value);
|
|
525
|
+
}
|
|
526
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: InputStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
527
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: InputStepperComponent, isStandalone: true, selector: "app-input-stepper", inputs: { headerInput: "headerInput", placeholder: "placeholder", readonly: "readonly", required: "required", disabled: "disabled", width: "width", min: "min", max: "max", error: "error", helperText: "helperText", step: "step", state: "state", value: "value" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div\r\n class=\"input-form\"\r\n [style.width]=\"width\"\r\n [class.disabled]=\"disabled\"\r\n [class.state-negative]=\"state === 'negative'\"\r\n [class.state-positive]=\"state === 'positive'\"\r\n>\r\n <div class=\"input-form-content\">\r\n <label class=\"input-form-label\" [for]=\"componentId\">\r\n <span class=\"label-text\">\r\n {{ headerInput }}\r\n @if (required) {\r\n <span class=\"required-mark\">*</span>\r\n }\r\n </span>\r\n </label>\r\n </div>\r\n\r\n <div class=\"input-stepper-content\">\r\n <button\r\n type=\"button\"\r\n class=\"input-stepper-button\"\r\n (click)=\"decrement()\"\r\n [disabled]=\"disabled\"\r\n aria-label=\"Gi\u1EA3m gi\u00E1 tr\u1ECB\"\r\n >\r\n <span class=\"stepper-icon\">\u2212</span>\r\n </button>\r\n <input\r\n [id]=\"componentId\"\r\n type=\"text\"\r\n class=\"input-stepper-input\"\r\n placeholder=\"0\"\r\n [placeholder]=\"placeholder || '0'\"\r\n title=\"Gi\u00E1 tr\u1ECB\"\r\n [title]=\"headerInput || 'Gi\u00E1 tr\u1ECB'\"\r\n [readonly]=\"readonly\"\r\n [disabled]=\"disabled\"\r\n [required]=\"required\"\r\n [value]=\"value\"\r\n (input)=\"onInput($event)\"\r\n [attr.aria-label]=\"headerInput || 'Gi\u00E1 tr\u1ECB'\"\r\n />\r\n <button\r\n type=\"button\"\r\n class=\"input-stepper-button\"\r\n (click)=\"increment()\"\r\n [disabled]=\"disabled\"\r\n aria-label=\"T\u0103ng gi\u00E1 tr\u1ECB\"\r\n >\r\n <span class=\"stepper-icon\">+</span>\r\n </button>\r\n </div>\r\n\r\n <div class=\"input-stepper-footer\">\r\n @if (error) {\r\n <span class=\"input-stepper-error\">{{ error }}</span>\r\n } @else if (helperText) {\r\n <span class=\"input-stepper-helper\">{{ helperText }}</span>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".input-form{display:flex;flex-direction:column;gap:6px;min-width:200px}.input-form-content{display:flex}.input-form-content .input-form-label{display:block;font-size:var(--font-sm);font-weight:700;color:var(--neutral-color-700)}.input-form-content .input-form-label .label-text{display:block;margin-bottom:4px}.input-form-content .input-form-label .label-text .required-mark{color:var(--utility-600);margin-left:2px}.input-stepper-content{display:flex;align-items:center;border:1px solid var(--neutral-color-200);border-radius:var(--radius-md);overflow:hidden;background:var(--neutral-color-10);height:36px;transition:border-color .2s ease,box-shadow .2s ease}.input-stepper-content:hover{border-color:var(--neutral-color-300)}.input-stepper-content:focus-within{border-color:var(--brand-500);box-shadow:0 0 0 2px rgba(var(--brand-500-rgb, 39, 64, 180),.15)}.input-stepper-content .input-stepper-button{display:flex;align-items:center;justify-content:center;width:36px;min-width:36px;flex-shrink:0;height:100%;border:none;background:transparent;cursor:pointer;color:var(--neutral-color-500);font-size:var(--font-sm);background-color:var(--neutral-color-10);padding:8px;transition:background-color .2s ease,color .2s ease}.input-stepper-content .input-stepper-button:hover:not(:disabled){background-color:var(--neutral-color-50)}.input-stepper-content .input-stepper-button:active:not(:disabled){background-color:var(--neutral-color-100)}.input-stepper-content .input-stepper-button:disabled{color:var(--neutral-color-300);cursor:not-allowed;background-color:var(--neutral-color-50)}.input-stepper-content .input-stepper-button .stepper-icon{font-size:16px;font-weight:600;pointer-events:none;line-height:1}.input-stepper-content .input-stepper-input{flex:1;min-width:0;height:100%;border:none;text-align:center;font-size:var(--font-sm);font-weight:500;color:var(--neutral-color-875);outline:none;background:transparent;padding:0 8px}.input-stepper-content .input-stepper-input::placeholder{color:var(--neutral-color-400);font-weight:400}.input-stepper-content .input-stepper-input:read-only{cursor:default}.input-stepper-content .input-stepper-input:disabled{cursor:not-allowed;background-color:var(--neutral-color-50);color:var(--neutral-color-400)}.input-stepper-content .input-stepper-input::-webkit-outer-spin-button,.input-stepper-content .input-stepper-input::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0}.input-stepper-content .input-stepper-input[type=number]{-moz-appearance:textfield;appearance:textfield}.input-stepper-footer{min-height:18px}.input-stepper-footer .input-stepper-error{font-size:var(--font-xs, 12px);color:var(--utility-600);line-height:1.5}.input-stepper-footer .input-stepper-helper{font-size:var(--font-xs, 12px);color:var(--neutral-color-500);line-height:1.5}.input-form.disabled .input-stepper-content{background-color:var(--neutral-color-50);border-color:var(--neutral-color-200);cursor:not-allowed}.input-form.disabled .input-stepper-content:hover{border-color:var(--neutral-color-200)}.input-form.disabled .input-stepper-content .input-stepper-button{cursor:not-allowed;color:var(--neutral-color-300);background-color:var(--neutral-color-50)}.input-form.disabled .input-stepper-content .input-stepper-input{cursor:not-allowed;color:var(--neutral-color-400);background-color:var(--neutral-color-50)}.input-form.state-negative .input-stepper-content{border-color:var(--utility-600)}.input-form.state-negative .input-stepper-content:focus-within{border-color:var(--utility-600);box-shadow:0 0 0 2px #ef444426}.input-form.state-negative .input-stepper-footer .input-stepper-helper{color:var(--utility-600)}.input-form.state-positive .input-stepper-content{border-color:var(--success-500, #22c55e)}.input-form.state-positive .input-stepper-content:focus-within{border-color:var(--success-500, #22c55e);box-shadow:0 0 0 2px #22c55e26}.input-form.state-positive .input-stepper-footer .input-stepper-helper{color:var(--success-500, #22c55e)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }] });
|
|
528
|
+
}
|
|
529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: InputStepperComponent, decorators: [{
|
|
530
|
+
type: Component,
|
|
531
|
+
args: [{ selector: 'app-input-stepper', standalone: true, imports: [CommonModule, FormsModule], template: "<div\r\n class=\"input-form\"\r\n [style.width]=\"width\"\r\n [class.disabled]=\"disabled\"\r\n [class.state-negative]=\"state === 'negative'\"\r\n [class.state-positive]=\"state === 'positive'\"\r\n>\r\n <div class=\"input-form-content\">\r\n <label class=\"input-form-label\" [for]=\"componentId\">\r\n <span class=\"label-text\">\r\n {{ headerInput }}\r\n @if (required) {\r\n <span class=\"required-mark\">*</span>\r\n }\r\n </span>\r\n </label>\r\n </div>\r\n\r\n <div class=\"input-stepper-content\">\r\n <button\r\n type=\"button\"\r\n class=\"input-stepper-button\"\r\n (click)=\"decrement()\"\r\n [disabled]=\"disabled\"\r\n aria-label=\"Gi\u1EA3m gi\u00E1 tr\u1ECB\"\r\n >\r\n <span class=\"stepper-icon\">\u2212</span>\r\n </button>\r\n <input\r\n [id]=\"componentId\"\r\n type=\"text\"\r\n class=\"input-stepper-input\"\r\n placeholder=\"0\"\r\n [placeholder]=\"placeholder || '0'\"\r\n title=\"Gi\u00E1 tr\u1ECB\"\r\n [title]=\"headerInput || 'Gi\u00E1 tr\u1ECB'\"\r\n [readonly]=\"readonly\"\r\n [disabled]=\"disabled\"\r\n [required]=\"required\"\r\n [value]=\"value\"\r\n (input)=\"onInput($event)\"\r\n [attr.aria-label]=\"headerInput || 'Gi\u00E1 tr\u1ECB'\"\r\n />\r\n <button\r\n type=\"button\"\r\n class=\"input-stepper-button\"\r\n (click)=\"increment()\"\r\n [disabled]=\"disabled\"\r\n aria-label=\"T\u0103ng gi\u00E1 tr\u1ECB\"\r\n >\r\n <span class=\"stepper-icon\">+</span>\r\n </button>\r\n </div>\r\n\r\n <div class=\"input-stepper-footer\">\r\n @if (error) {\r\n <span class=\"input-stepper-error\">{{ error }}</span>\r\n } @else if (helperText) {\r\n <span class=\"input-stepper-helper\">{{ helperText }}</span>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".input-form{display:flex;flex-direction:column;gap:6px;min-width:200px}.input-form-content{display:flex}.input-form-content .input-form-label{display:block;font-size:var(--font-sm);font-weight:700;color:var(--neutral-color-700)}.input-form-content .input-form-label .label-text{display:block;margin-bottom:4px}.input-form-content .input-form-label .label-text .required-mark{color:var(--utility-600);margin-left:2px}.input-stepper-content{display:flex;align-items:center;border:1px solid var(--neutral-color-200);border-radius:var(--radius-md);overflow:hidden;background:var(--neutral-color-10);height:36px;transition:border-color .2s ease,box-shadow .2s ease}.input-stepper-content:hover{border-color:var(--neutral-color-300)}.input-stepper-content:focus-within{border-color:var(--brand-500);box-shadow:0 0 0 2px rgba(var(--brand-500-rgb, 39, 64, 180),.15)}.input-stepper-content .input-stepper-button{display:flex;align-items:center;justify-content:center;width:36px;min-width:36px;flex-shrink:0;height:100%;border:none;background:transparent;cursor:pointer;color:var(--neutral-color-500);font-size:var(--font-sm);background-color:var(--neutral-color-10);padding:8px;transition:background-color .2s ease,color .2s ease}.input-stepper-content .input-stepper-button:hover:not(:disabled){background-color:var(--neutral-color-50)}.input-stepper-content .input-stepper-button:active:not(:disabled){background-color:var(--neutral-color-100)}.input-stepper-content .input-stepper-button:disabled{color:var(--neutral-color-300);cursor:not-allowed;background-color:var(--neutral-color-50)}.input-stepper-content .input-stepper-button .stepper-icon{font-size:16px;font-weight:600;pointer-events:none;line-height:1}.input-stepper-content .input-stepper-input{flex:1;min-width:0;height:100%;border:none;text-align:center;font-size:var(--font-sm);font-weight:500;color:var(--neutral-color-875);outline:none;background:transparent;padding:0 8px}.input-stepper-content .input-stepper-input::placeholder{color:var(--neutral-color-400);font-weight:400}.input-stepper-content .input-stepper-input:read-only{cursor:default}.input-stepper-content .input-stepper-input:disabled{cursor:not-allowed;background-color:var(--neutral-color-50);color:var(--neutral-color-400)}.input-stepper-content .input-stepper-input::-webkit-outer-spin-button,.input-stepper-content .input-stepper-input::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0}.input-stepper-content .input-stepper-input[type=number]{-moz-appearance:textfield;appearance:textfield}.input-stepper-footer{min-height:18px}.input-stepper-footer .input-stepper-error{font-size:var(--font-xs, 12px);color:var(--utility-600);line-height:1.5}.input-stepper-footer .input-stepper-helper{font-size:var(--font-xs, 12px);color:var(--neutral-color-500);line-height:1.5}.input-form.disabled .input-stepper-content{background-color:var(--neutral-color-50);border-color:var(--neutral-color-200);cursor:not-allowed}.input-form.disabled .input-stepper-content:hover{border-color:var(--neutral-color-200)}.input-form.disabled .input-stepper-content .input-stepper-button{cursor:not-allowed;color:var(--neutral-color-300);background-color:var(--neutral-color-50)}.input-form.disabled .input-stepper-content .input-stepper-input{cursor:not-allowed;color:var(--neutral-color-400);background-color:var(--neutral-color-50)}.input-form.state-negative .input-stepper-content{border-color:var(--utility-600)}.input-form.state-negative .input-stepper-content:focus-within{border-color:var(--utility-600);box-shadow:0 0 0 2px #ef444426}.input-form.state-negative .input-stepper-footer .input-stepper-helper{color:var(--utility-600)}.input-form.state-positive .input-stepper-content{border-color:var(--success-500, #22c55e)}.input-form.state-positive .input-stepper-content:focus-within{border-color:var(--success-500, #22c55e);box-shadow:0 0 0 2px #22c55e26}.input-form.state-positive .input-stepper-footer .input-stepper-helper{color:var(--success-500, #22c55e)}\n"] }]
|
|
532
|
+
}], propDecorators: { headerInput: [{
|
|
533
|
+
type: Input
|
|
534
|
+
}], placeholder: [{
|
|
535
|
+
type: Input
|
|
536
|
+
}], readonly: [{
|
|
537
|
+
type: Input
|
|
538
|
+
}], required: [{
|
|
539
|
+
type: Input
|
|
540
|
+
}], disabled: [{
|
|
541
|
+
type: Input
|
|
542
|
+
}], width: [{
|
|
543
|
+
type: Input
|
|
544
|
+
}], min: [{
|
|
545
|
+
type: Input
|
|
546
|
+
}], max: [{
|
|
547
|
+
type: Input
|
|
548
|
+
}], error: [{
|
|
549
|
+
type: Input
|
|
550
|
+
}], helperText: [{
|
|
551
|
+
type: Input
|
|
552
|
+
}], step: [{
|
|
553
|
+
type: Input
|
|
554
|
+
}], state: [{
|
|
555
|
+
type: Input
|
|
556
|
+
}], valueChange: [{
|
|
557
|
+
type: Output
|
|
558
|
+
}], value: [{
|
|
559
|
+
type: Input
|
|
560
|
+
}] } });
|
|
561
|
+
|
|
562
|
+
class InputCalendarComponent {
|
|
563
|
+
headerInput = '';
|
|
564
|
+
placeholder = 'dd/mm/yyyy';
|
|
565
|
+
readonly = false;
|
|
566
|
+
required = false;
|
|
567
|
+
width = '100%';
|
|
568
|
+
valueChange = new EventEmitter();
|
|
569
|
+
hiddenDateInput;
|
|
570
|
+
displayValue = '';
|
|
571
|
+
_value = '';
|
|
572
|
+
set value(val) {
|
|
573
|
+
this._value = val;
|
|
574
|
+
this.displayValue = this.formatToDisplay(val);
|
|
575
|
+
}
|
|
576
|
+
get value() {
|
|
577
|
+
return this._value;
|
|
578
|
+
}
|
|
579
|
+
// Convert ISO format (yyyy-mm-dd) to display format (dd/mm/yyyy)
|
|
580
|
+
formatToDisplay(isoDate) {
|
|
581
|
+
if (!isoDate)
|
|
582
|
+
return '';
|
|
583
|
+
const parts = isoDate.split('-');
|
|
584
|
+
if (parts.length === 3) {
|
|
585
|
+
return `${parts[2]}/${parts[1]}/${parts[0]}`;
|
|
586
|
+
}
|
|
587
|
+
return isoDate;
|
|
588
|
+
}
|
|
589
|
+
// Validate if a date string (dd/mm/yyyy) represents a valid date
|
|
590
|
+
isValidDate(displayDate) {
|
|
591
|
+
if (!displayDate || displayDate.length !== 10)
|
|
592
|
+
return false;
|
|
593
|
+
const parts = displayDate.split('/');
|
|
594
|
+
if (parts.length !== 3)
|
|
595
|
+
return false;
|
|
596
|
+
const day = parseInt(parts[0], 10);
|
|
597
|
+
const month = parseInt(parts[1], 10);
|
|
598
|
+
const year = parseInt(parts[2], 10);
|
|
599
|
+
// Basic range validation
|
|
600
|
+
if (isNaN(day) || isNaN(month) || isNaN(year))
|
|
601
|
+
return false;
|
|
602
|
+
if (month < 1 || month > 12)
|
|
603
|
+
return false;
|
|
604
|
+
if (day < 1 || day > 31)
|
|
605
|
+
return false;
|
|
606
|
+
if (year < 1900 || year > 2100)
|
|
607
|
+
return false;
|
|
608
|
+
// Create date and verify it matches input (handles invalid dates like 31/02)
|
|
609
|
+
const date = new Date(year, month - 1, day);
|
|
610
|
+
return date.getFullYear() === year &&
|
|
611
|
+
date.getMonth() === month - 1 &&
|
|
612
|
+
date.getDate() === day;
|
|
613
|
+
}
|
|
614
|
+
// Convert display format (dd/mm/yyyy) to ISO format (yyyy-mm-dd)
|
|
615
|
+
formatToISO(displayDate) {
|
|
616
|
+
if (!displayDate)
|
|
617
|
+
return '';
|
|
618
|
+
const parts = displayDate.split('/');
|
|
619
|
+
if (parts.length === 3) {
|
|
620
|
+
return `${parts[2]}-${parts[1]}-${parts[0]}`;
|
|
621
|
+
}
|
|
622
|
+
return displayDate;
|
|
623
|
+
}
|
|
624
|
+
// Handle text input with auto-formatting
|
|
625
|
+
onDisplayInput(event) {
|
|
626
|
+
const input = event.target;
|
|
627
|
+
let value = input.value.replaceAll(/[^\d/]/g, '');
|
|
628
|
+
// Auto-insert slashes at positions 2 and 5
|
|
629
|
+
const parts = value.split('/');
|
|
630
|
+
if (parts[0] && parts[0].length >= 2 && parts.length === 1) {
|
|
631
|
+
value = parts[0].substring(0, 2) + '/' + parts[0].substring(2);
|
|
632
|
+
}
|
|
633
|
+
if (value.length >= 5 && value.split('/').length === 2 && !value.endsWith('/')) {
|
|
634
|
+
const newParts = value.split('/');
|
|
635
|
+
if (newParts[1] && newParts[1].length >= 2) {
|
|
636
|
+
value = newParts[0] + '/' + newParts[1].substring(0, 2) + '/' + newParts[1].substring(2);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
// Limit to dd/mm/yyyy format
|
|
640
|
+
if (value.length > 10) {
|
|
641
|
+
value = value.substring(0, 10);
|
|
642
|
+
}
|
|
643
|
+
this.displayValue = value;
|
|
644
|
+
// Only emit if complete and valid date
|
|
645
|
+
if (value.length === 10 && this.isValidDate(value)) {
|
|
646
|
+
const isoValue = this.formatToISO(value);
|
|
647
|
+
this._value = isoValue;
|
|
648
|
+
this.valueChange.emit(isoValue);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
// Open native date picker
|
|
652
|
+
openDatePicker() {
|
|
653
|
+
if (!this.readonly && this.hiddenDateInput) {
|
|
654
|
+
this.hiddenDateInput.nativeElement.showPicker();
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
// Handle date picker selection
|
|
658
|
+
onDatePickerChange(event) {
|
|
659
|
+
const input = event.target;
|
|
660
|
+
this._value = input.value;
|
|
661
|
+
this.displayValue = this.formatToDisplay(input.value);
|
|
662
|
+
this.valueChange.emit(this._value);
|
|
663
|
+
}
|
|
664
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: InputCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
665
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: InputCalendarComponent, isStandalone: true, selector: "app-input-calendar", inputs: { headerInput: "headerInput", placeholder: "placeholder", readonly: "readonly", required: "required", width: "width", value: "value" }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "hiddenDateInput", first: true, predicate: ["hiddenDateInput"], descendants: true }], ngImport: i0, template: "<div class=\"input-form\" [style.width]=\"width\">\r\n <label class=\"input-form-label\">\r\n <div class=\"input-form-label-header\">\r\n <span>{{ headerInput }}</span>\r\n @if (required) {\r\n <span class=\"required-mark\">*</span>\r\n }\r\n </div>\r\n <div class=\"calendar-input-wrapper\">\r\n <input\r\n type=\"text\"\r\n class=\"input-form-field\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [required]=\"required\"\r\n [value]=\"displayValue\"\r\n (input)=\"onDisplayInput($event)\"\r\n maxlength=\"10\"\r\n />\r\n <button\r\n type=\"button\"\r\n class=\"calendar-icon-btn\"\r\n (click)=\"openDatePicker()\"\r\n [disabled]=\"readonly\"\r\n >\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"16\"\r\n height=\"16\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n >\r\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"></rect>\r\n <line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"></line>\r\n <line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"></line>\r\n <line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"></line>\r\n </svg>\r\n </button>\r\n <input\r\n #hiddenDateInput\r\n type=\"date\"\r\n class=\"hidden-date-input\"\r\n [value]=\"value\"\r\n (change)=\"onDatePickerChange($event)\"\r\n />\r\n </div>\r\n </label>\r\n</div>\r\n", styles: [".input-form{display:flex;flex-direction:column;gap:6px}.input-form-label{display:block;font-size:var(--font-sm);font-weight:700;color:var(--neutral-color-700);margin-bottom:4px}.input-form-label-header{display:flex;align-items:center;margin-bottom:4px}.required-mark{color:var(--utility-600);margin-left:2px}.calendar-input-wrapper{position:relative;display:flex;align-items:center}.input-form-field{padding:8px 40px 8px 12px;border:1px solid var(--neutral-color-200);border-radius:var(--radius-md);font-size:var(--font-sm);color:var(--neutral-color-700);height:36px;width:100%;box-sizing:border-box;background-color:var(--neutral-color-10);transition:border-color .2s ease,box-shadow .2s ease}.input-form-field::placeholder{color:var(--neutral-color-400)}.input-form-field:focus{outline:none;border-color:var(--brand-500);box-shadow:0 0 0 2px #2740b426}.input-form-field:read-only{background-color:var(--neutral-color-25);cursor:not-allowed}.calendar-icon-btn{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;padding:4px;cursor:pointer;color:var(--neutral-color-500);display:flex;align-items:center;justify-content:center;border-radius:var(--radius-sm);transition:color .2s ease,background-color .2s ease}.calendar-icon-btn:hover:not(:disabled){background-color:var(--neutral-color-50)}.calendar-icon-btn:disabled{cursor:not-allowed;opacity:.5}.hidden-date-input{position:absolute;opacity:0;width:0;height:0;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }] });
|
|
666
|
+
}
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: InputCalendarComponent, decorators: [{
|
|
668
|
+
type: Component,
|
|
669
|
+
args: [{ selector: 'app-input-calendar', standalone: true, imports: [CommonModule, FormsModule], template: "<div class=\"input-form\" [style.width]=\"width\">\r\n <label class=\"input-form-label\">\r\n <div class=\"input-form-label-header\">\r\n <span>{{ headerInput }}</span>\r\n @if (required) {\r\n <span class=\"required-mark\">*</span>\r\n }\r\n </div>\r\n <div class=\"calendar-input-wrapper\">\r\n <input\r\n type=\"text\"\r\n class=\"input-form-field\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [required]=\"required\"\r\n [value]=\"displayValue\"\r\n (input)=\"onDisplayInput($event)\"\r\n maxlength=\"10\"\r\n />\r\n <button\r\n type=\"button\"\r\n class=\"calendar-icon-btn\"\r\n (click)=\"openDatePicker()\"\r\n [disabled]=\"readonly\"\r\n >\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"16\"\r\n height=\"16\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n >\r\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\"></rect>\r\n <line x1=\"16\" y1=\"2\" x2=\"16\" y2=\"6\"></line>\r\n <line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"6\"></line>\r\n <line x1=\"3\" y1=\"10\" x2=\"21\" y2=\"10\"></line>\r\n </svg>\r\n </button>\r\n <input\r\n #hiddenDateInput\r\n type=\"date\"\r\n class=\"hidden-date-input\"\r\n [value]=\"value\"\r\n (change)=\"onDatePickerChange($event)\"\r\n />\r\n </div>\r\n </label>\r\n</div>\r\n", styles: [".input-form{display:flex;flex-direction:column;gap:6px}.input-form-label{display:block;font-size:var(--font-sm);font-weight:700;color:var(--neutral-color-700);margin-bottom:4px}.input-form-label-header{display:flex;align-items:center;margin-bottom:4px}.required-mark{color:var(--utility-600);margin-left:2px}.calendar-input-wrapper{position:relative;display:flex;align-items:center}.input-form-field{padding:8px 40px 8px 12px;border:1px solid var(--neutral-color-200);border-radius:var(--radius-md);font-size:var(--font-sm);color:var(--neutral-color-700);height:36px;width:100%;box-sizing:border-box;background-color:var(--neutral-color-10);transition:border-color .2s ease,box-shadow .2s ease}.input-form-field::placeholder{color:var(--neutral-color-400)}.input-form-field:focus{outline:none;border-color:var(--brand-500);box-shadow:0 0 0 2px #2740b426}.input-form-field:read-only{background-color:var(--neutral-color-25);cursor:not-allowed}.calendar-icon-btn{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;padding:4px;cursor:pointer;color:var(--neutral-color-500);display:flex;align-items:center;justify-content:center;border-radius:var(--radius-sm);transition:color .2s ease,background-color .2s ease}.calendar-icon-btn:hover:not(:disabled){background-color:var(--neutral-color-50)}.calendar-icon-btn:disabled{cursor:not-allowed;opacity:.5}.hidden-date-input{position:absolute;opacity:0;width:0;height:0;pointer-events:none}\n"] }]
|
|
670
|
+
}], propDecorators: { headerInput: [{
|
|
671
|
+
type: Input
|
|
672
|
+
}], placeholder: [{
|
|
673
|
+
type: Input
|
|
674
|
+
}], readonly: [{
|
|
675
|
+
type: Input
|
|
676
|
+
}], required: [{
|
|
677
|
+
type: Input
|
|
678
|
+
}], width: [{
|
|
679
|
+
type: Input
|
|
680
|
+
}], valueChange: [{
|
|
681
|
+
type: Output
|
|
682
|
+
}], hiddenDateInput: [{
|
|
683
|
+
type: ViewChild,
|
|
684
|
+
args: ['hiddenDateInput']
|
|
685
|
+
}], value: [{
|
|
686
|
+
type: Input
|
|
687
|
+
}] } });
|
|
688
|
+
|
|
689
|
+
class TableHeaderComponent {
|
|
690
|
+
columns = [];
|
|
691
|
+
backgroundColor;
|
|
692
|
+
textColor = '#ffffff';
|
|
693
|
+
headerIconLeft;
|
|
694
|
+
headerIconRight;
|
|
695
|
+
fontSize = 'var(--font-xs)';
|
|
696
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TableHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
697
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: TableHeaderComponent, isStandalone: true, selector: "tr[app-table-header]", inputs: { columns: "columns", backgroundColor: "backgroundColor", textColor: ["textColor", "textColor", (value) => value || '#ffffff'], headerIconLeft: "headerIconLeft", headerIconRight: "headerIconRight", fontSize: "fontSize" }, ngImport: i0, template: "@for (col of columns; track col.key) {\r\n <th\r\n scope=\"col\"\r\n [style.width]=\"col.width\"\r\n [style.backgroundColor]=\"backgroundColor\"\r\n [style.color]=\"textColor\"\r\n >\r\n <div class=\"header-container\">\r\n <div class=\"header-content\">\r\n @if (headerIconLeft) {\r\n <div class=\"icon-left\">\r\n <i [class]=\"headerIconLeft\"></i>\r\n </div>\r\n }\r\n <div class=\"header-text\" [style.font-size]=\"fontSize\">\r\n {{ col.header }}\r\n </div>\r\n @if (headerIconRight) {\r\n <div class=\"icon-right\">\r\n <i [class]=\"headerIconRight\"></i>\r\n </div>\r\n }\r\n </div>\r\n <p class=\"divider\">|</p>\r\n </div>\r\n </th>\r\n}\r\n", styles: ["th{padding:0;vertical-align:middle;height:44px;box-sizing:border-box}th .header-content{display:flex;align-items:center;width:100%;gap:8px;border-collapse:collapse}th .header-content .header-text{font-weight:600}th .header-content .icon-left,th .header-content .icon-right{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px}th .header-content:has(.header-text:only-child){justify-content:flex-start}th .header-content:has(.icon-left),th .header-content:has(.icon-right){justify-content:space-between;background-color:var(--brand-900)}th .header-content:has(.icon-left) .header-text,th .header-content:has(.icon-right) .header-text{flex:1;text-align:center}th .header-content:has(.icon-left):not(:has(.icon-right)){justify-content:flex-start}th .header-content:has(.icon-left):not(:has(.icon-right)) .header-text{flex:1}th .header-content:has(.icon-right):not(:has(.icon-left)){justify-content:space-between}th .header-content:has(.icon-right):not(:has(.icon-left)) .header-text{flex:1}th:not(:last-child){border-right:1px solid rgba(0,0,0,.1)}.table-header{width:100%}.header-container{display:flex;align-items:center;width:100%;padding:0 8px;box-sizing:border-box;height:100%}.divider{display:flex;align-items:center;justify-content:center;height:20px;width:1px;background-color:#0000001a;margin:0 8px;color:transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
698
|
+
}
|
|
699
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TableHeaderComponent, decorators: [{
|
|
700
|
+
type: Component,
|
|
701
|
+
args: [{ selector: 'tr[app-table-header]', standalone: true, imports: [CommonModule], template: "@for (col of columns; track col.key) {\r\n <th\r\n scope=\"col\"\r\n [style.width]=\"col.width\"\r\n [style.backgroundColor]=\"backgroundColor\"\r\n [style.color]=\"textColor\"\r\n >\r\n <div class=\"header-container\">\r\n <div class=\"header-content\">\r\n @if (headerIconLeft) {\r\n <div class=\"icon-left\">\r\n <i [class]=\"headerIconLeft\"></i>\r\n </div>\r\n }\r\n <div class=\"header-text\" [style.font-size]=\"fontSize\">\r\n {{ col.header }}\r\n </div>\r\n @if (headerIconRight) {\r\n <div class=\"icon-right\">\r\n <i [class]=\"headerIconRight\"></i>\r\n </div>\r\n }\r\n </div>\r\n <p class=\"divider\">|</p>\r\n </div>\r\n </th>\r\n}\r\n", styles: ["th{padding:0;vertical-align:middle;height:44px;box-sizing:border-box}th .header-content{display:flex;align-items:center;width:100%;gap:8px;border-collapse:collapse}th .header-content .header-text{font-weight:600}th .header-content .icon-left,th .header-content .icon-right{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px}th .header-content:has(.header-text:only-child){justify-content:flex-start}th .header-content:has(.icon-left),th .header-content:has(.icon-right){justify-content:space-between;background-color:var(--brand-900)}th .header-content:has(.icon-left) .header-text,th .header-content:has(.icon-right) .header-text{flex:1;text-align:center}th .header-content:has(.icon-left):not(:has(.icon-right)){justify-content:flex-start}th .header-content:has(.icon-left):not(:has(.icon-right)) .header-text{flex:1}th .header-content:has(.icon-right):not(:has(.icon-left)){justify-content:space-between}th .header-content:has(.icon-right):not(:has(.icon-left)) .header-text{flex:1}th:not(:last-child){border-right:1px solid rgba(0,0,0,.1)}.table-header{width:100%}.header-container{display:flex;align-items:center;width:100%;padding:0 8px;box-sizing:border-box;height:100%}.divider{display:flex;align-items:center;justify-content:center;height:20px;width:1px;background-color:#0000001a;margin:0 8px;color:transparent}\n"] }]
|
|
702
|
+
}], propDecorators: { columns: [{
|
|
703
|
+
type: Input
|
|
704
|
+
}], backgroundColor: [{
|
|
705
|
+
type: Input
|
|
706
|
+
}], textColor: [{
|
|
707
|
+
type: Input,
|
|
708
|
+
args: [{ transform: (value) => value || '#ffffff' }]
|
|
709
|
+
}], headerIconLeft: [{
|
|
710
|
+
type: Input
|
|
711
|
+
}], headerIconRight: [{
|
|
712
|
+
type: Input
|
|
713
|
+
}], fontSize: [{
|
|
714
|
+
type: Input
|
|
715
|
+
}] } });
|
|
716
|
+
|
|
717
|
+
class TableBodyComponent {
|
|
718
|
+
rows = [];
|
|
719
|
+
columns = [];
|
|
720
|
+
columnTemplates = {};
|
|
721
|
+
fontSize = 'var(--font-sm)';
|
|
722
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TableBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
723
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: TableBodyComponent, isStandalone: true, selector: "[app-table-body]", inputs: { rows: "rows", columns: "columns", columnTemplates: "columnTemplates", fontSize: "fontSize" }, ngImport: i0, template: "@for (row of rows; track $index) {\r\n <tr>\r\n @for (col of columns; track col.key) {\r\n <td [style.width]=\"col.width\" [style.font-size]=\"fontSize\">\r\n @if (columnTemplates[col.key]) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n columnTemplates[col.key];\r\n context: { $implicit: row[col.key], row: row }\r\n \"\r\n ></ng-container>\r\n } @else {\r\n {{ row[col.key] }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n}\r\n", styles: ["td{padding:16px 8px;vertical-align:middle;color:var(--neutral-color-700);height:70px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
724
|
+
}
|
|
725
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: TableBodyComponent, decorators: [{
|
|
726
|
+
type: Component,
|
|
727
|
+
args: [{ selector: '[app-table-body]', standalone: true, imports: [CommonModule], template: "@for (row of rows; track $index) {\r\n <tr>\r\n @for (col of columns; track col.key) {\r\n <td [style.width]=\"col.width\" [style.font-size]=\"fontSize\">\r\n @if (columnTemplates[col.key]) {\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n columnTemplates[col.key];\r\n context: { $implicit: row[col.key], row: row }\r\n \"\r\n ></ng-container>\r\n } @else {\r\n {{ row[col.key] }}\r\n }\r\n </td>\r\n }\r\n </tr>\r\n}\r\n", styles: ["td{padding:16px 8px;vertical-align:middle;color:var(--neutral-color-700);height:70px}\n"] }]
|
|
728
|
+
}], propDecorators: { rows: [{
|
|
729
|
+
type: Input
|
|
730
|
+
}], columns: [{
|
|
731
|
+
type: Input
|
|
732
|
+
}], columnTemplates: [{
|
|
733
|
+
type: Input
|
|
734
|
+
}], fontSize: [{
|
|
735
|
+
type: Input
|
|
736
|
+
}] } });
|
|
737
|
+
|
|
738
|
+
class ApprovalListItemComponent {
|
|
739
|
+
name;
|
|
740
|
+
date;
|
|
741
|
+
rightTemplate;
|
|
742
|
+
rightContext = {};
|
|
743
|
+
get parsedDate() {
|
|
744
|
+
return new Date(this.date);
|
|
745
|
+
}
|
|
746
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApprovalListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
747
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: ApprovalListItemComponent, isStandalone: true, selector: "app-approval-list-item", inputs: { name: "name", date: "date", rightTemplate: "rightTemplate", rightContext: "rightContext" }, ngImport: i0, template: "<div class=\"approval-item\">\r\n <!-- LEFT -->\r\n <div class=\"approval-item-left\">\r\n <span class=\"approval-item-left-name\">{{ name }}</span>\r\n <span class=\"approval-item-left-date\">\r\n <span class=\"approval-item-left-date-title\">Ng\u00E0y t\u1EA1o \u0111\u01A1n:</span>\r\n {{ date | date: 'dd/MM/yyyy' }}\r\n </span>\r\n </div>\r\n\r\n <div class=\"approval-item-right\">\r\n <ng-container *ngIf=\"rightTemplate; else defaultRight\">\r\n <ng-container *ngTemplateOutlet=\"rightTemplate; context: rightContext\">\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-template #defaultRight>\r\n <span class=\"text-gray-400\">\u2014</span>\r\n </ng-template>\r\n </div>\r\n</div>", styles: [".approval-item{display:flex;justify-content:space-between;min-width:400px;height:fit-content;align-items:center;padding:16px 8px}.approval-item-left-date-title{color:var(--theme-neutral-500)}.approval-item-right p{color:var(--secondary-800);font-weight:500}.approval-item-left{display:flex;flex-direction:column;gap:8px}span,p{font-size:var(--font-sm)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
748
|
+
}
|
|
749
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApprovalListItemComponent, decorators: [{
|
|
750
|
+
type: Component,
|
|
751
|
+
args: [{ selector: 'app-approval-list-item', imports: [CommonModule], standalone: true, template: "<div class=\"approval-item\">\r\n <!-- LEFT -->\r\n <div class=\"approval-item-left\">\r\n <span class=\"approval-item-left-name\">{{ name }}</span>\r\n <span class=\"approval-item-left-date\">\r\n <span class=\"approval-item-left-date-title\">Ng\u00E0y t\u1EA1o \u0111\u01A1n:</span>\r\n {{ date | date: 'dd/MM/yyyy' }}\r\n </span>\r\n </div>\r\n\r\n <div class=\"approval-item-right\">\r\n <ng-container *ngIf=\"rightTemplate; else defaultRight\">\r\n <ng-container *ngTemplateOutlet=\"rightTemplate; context: rightContext\">\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-template #defaultRight>\r\n <span class=\"text-gray-400\">\u2014</span>\r\n </ng-template>\r\n </div>\r\n</div>", styles: [".approval-item{display:flex;justify-content:space-between;min-width:400px;height:fit-content;align-items:center;padding:16px 8px}.approval-item-left-date-title{color:var(--theme-neutral-500)}.approval-item-right p{color:var(--secondary-800);font-weight:500}.approval-item-left{display:flex;flex-direction:column;gap:8px}span,p{font-size:var(--font-sm)}\n"] }]
|
|
752
|
+
}], propDecorators: { name: [{
|
|
753
|
+
type: Input
|
|
754
|
+
}], date: [{
|
|
755
|
+
type: Input
|
|
756
|
+
}], rightTemplate: [{
|
|
757
|
+
type: Input
|
|
758
|
+
}], rightContext: [{
|
|
759
|
+
type: Input
|
|
760
|
+
}] } });
|
|
761
|
+
|
|
762
|
+
class ApprovalListComponent {
|
|
763
|
+
rows = [];
|
|
764
|
+
headerContentRight;
|
|
765
|
+
headerContentLeft;
|
|
766
|
+
width;
|
|
767
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApprovalListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
768
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: ApprovalListComponent, isStandalone: true, selector: "app-approval-list", inputs: { rows: "rows", headerContentRight: "headerContentRight", headerContentLeft: "headerContentLeft", width: "width" }, ngImport: i0, template: "<div class=\"approval-list\" [style.width]=\"width\">\r\n <div class=\"approval-list-header\">\r\n <span class=\"approval-list-header-left\">{{ headerContentLeft }}</span>\r\n <div>\r\n <p>{{ headerContentRight }}</p>\r\n </div>\r\n </div>\r\n\r\n <div class=\"approval-list-content\" [style.width]=\"width\">\r\n <app-approval-list-item\r\n *ngFor=\"let row of rows\"\r\n [name]=\"row.name\"\r\n [date]=\"row.date\"\r\n [rightTemplate]=\"row.rightTemplate\"\r\n [rightContext]=\"row.rightContext\"\r\n >\r\n </app-approval-list-item>\r\n </div>\r\n</div>\r\n", styles: [".approval-list{display:flex;flex-direction:column;background-color:var(--theme-neutral-light-100);border-radius:16px}.approval-list-header{display:flex;justify-content:space-between;align-items:center;padding:16px 8px;height:fit-content}.approval-list-header span{font-size:20px;color:var(--brand-600);font-weight:700}.approval-list-header p{font-size:var(--font-sm)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: ApprovalListItemComponent, selector: "app-approval-list-item", inputs: ["name", "date", "rightTemplate", "rightContext"] }] });
|
|
769
|
+
}
|
|
770
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApprovalListComponent, decorators: [{
|
|
771
|
+
type: Component,
|
|
772
|
+
args: [{ selector: 'app-approval-list', standalone: true, imports: [CommonModule, ApprovalListItemComponent], template: "<div class=\"approval-list\" [style.width]=\"width\">\r\n <div class=\"approval-list-header\">\r\n <span class=\"approval-list-header-left\">{{ headerContentLeft }}</span>\r\n <div>\r\n <p>{{ headerContentRight }}</p>\r\n </div>\r\n </div>\r\n\r\n <div class=\"approval-list-content\" [style.width]=\"width\">\r\n <app-approval-list-item\r\n *ngFor=\"let row of rows\"\r\n [name]=\"row.name\"\r\n [date]=\"row.date\"\r\n [rightTemplate]=\"row.rightTemplate\"\r\n [rightContext]=\"row.rightContext\"\r\n >\r\n </app-approval-list-item>\r\n </div>\r\n</div>\r\n", styles: [".approval-list{display:flex;flex-direction:column;background-color:var(--theme-neutral-light-100);border-radius:16px}.approval-list-header{display:flex;justify-content:space-between;align-items:center;padding:16px 8px;height:fit-content}.approval-list-header span{font-size:20px;color:var(--brand-600);font-weight:700}.approval-list-header p{font-size:var(--font-sm)}\n"] }]
|
|
773
|
+
}], propDecorators: { rows: [{
|
|
774
|
+
type: Input
|
|
775
|
+
}], headerContentRight: [{
|
|
776
|
+
type: Input
|
|
777
|
+
}], headerContentLeft: [{
|
|
778
|
+
type: Input
|
|
779
|
+
}], width: [{
|
|
780
|
+
type: Input
|
|
781
|
+
}] } });
|
|
782
|
+
|
|
783
|
+
class PopUpConfirmComponent {
|
|
784
|
+
imgUrl = '';
|
|
785
|
+
title = '';
|
|
786
|
+
content = '';
|
|
787
|
+
colorButton = 'var(--brand-600)';
|
|
788
|
+
confirmClick = new EventEmitter();
|
|
789
|
+
cancelClick = new EventEmitter();
|
|
790
|
+
onConfirm() {
|
|
791
|
+
this.confirmClick.emit();
|
|
792
|
+
}
|
|
793
|
+
onCancel() {
|
|
794
|
+
this.cancelClick.emit();
|
|
795
|
+
}
|
|
796
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: PopUpConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
797
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: PopUpConfirmComponent, isStandalone: true, selector: "app-pop-up-confirm", inputs: { imgUrl: "imgUrl", title: "title", content: "content", colorButton: "colorButton" }, outputs: { confirmClick: "confirmClick", cancelClick: "cancelClick" }, ngImport: i0, template: "<div class=\"pop-up-confirm-overlay\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"popup-title\">\r\n <div class=\"pop-up-confirm\">\r\n <div class=\"pop-up-confirm-content\">\r\n <img *ngIf=\"imgUrl\" [src]=\"imgUrl\" alt=\"\">\r\n <div class=\"pop-up-confirm-text\">\r\n <p class=\"pop-up-title\" id=\"popup-title\">{{title}}</p>\r\n <p class=\"pop-up-content\">{{content}}</p>\r\n </div>\r\n </div>\r\n <div class=\"pop-up-confirm-actions\">\r\n <app-button-container size=\"md\" content=\"Quay L\u1EA1i\" backgroundColor=\"var(--neutral-100)\" color=\"var(--neutral-800)\" (buttonClick)=\"onCancel()\"></app-button-container>\r\n <app-button-container size=\"md\" content=\"\u0110\u1ED3ng \u00DD\" [backgroundColor]=\"colorButton\" color=\"#fff\" (buttonClick)=\"onConfirm()\"></app-button-container>\r\n </div>\r\n </div>\r\n</div>", styles: [".pop-up-confirm-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(var(--neutral-color-875-rgb, 30, 34, 37),.5);display:flex;justify-content:center;align-items:center;z-index:1000}.pop-up-confirm{background-color:var(--neutral-color-10);border-radius:var(--radius-lg);padding:24px;min-width:320px;max-width:400px;box-shadow:0 4px 20px rgba(var(--neutral-color-875-rgb, 30, 34, 37),.15)}.pop-up-confirm-content{display:flex;gap:16px;align-items:center;justify-content:center;flex-direction:column;margin-bottom:24px;width:352px;height:172px}.pop-up-confirm-content img{width:96px;height:96px;object-fit:contain;flex-shrink:0}.pop-up-confirm-text{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px}.pop-up-title{font-size:var(--font-xl);font-weight:600;color:var(--neutral-color-875);margin:0}.pop-up-content{font-size:var(--font-sm);color:var(--neutral-color-500);margin:0}.pop-up-confirm-actions{display:flex;gap:12px;justify-content:center;align-items:center;padding:16px 8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonContainerComponent, selector: "app-button-container", inputs: ["size", "content", "fontSize", "leftIcon", "rightIcon", "color", "backgroundColor", "borderColor"], outputs: ["buttonClick"] }] });
|
|
798
|
+
}
|
|
799
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: PopUpConfirmComponent, decorators: [{
|
|
800
|
+
type: Component,
|
|
801
|
+
args: [{ selector: 'app-pop-up-confirm', standalone: true, imports: [CommonModule, ButtonContainerComponent], template: "<div class=\"pop-up-confirm-overlay\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"popup-title\">\r\n <div class=\"pop-up-confirm\">\r\n <div class=\"pop-up-confirm-content\">\r\n <img *ngIf=\"imgUrl\" [src]=\"imgUrl\" alt=\"\">\r\n <div class=\"pop-up-confirm-text\">\r\n <p class=\"pop-up-title\" id=\"popup-title\">{{title}}</p>\r\n <p class=\"pop-up-content\">{{content}}</p>\r\n </div>\r\n </div>\r\n <div class=\"pop-up-confirm-actions\">\r\n <app-button-container size=\"md\" content=\"Quay L\u1EA1i\" backgroundColor=\"var(--neutral-100)\" color=\"var(--neutral-800)\" (buttonClick)=\"onCancel()\"></app-button-container>\r\n <app-button-container size=\"md\" content=\"\u0110\u1ED3ng \u00DD\" [backgroundColor]=\"colorButton\" color=\"#fff\" (buttonClick)=\"onConfirm()\"></app-button-container>\r\n </div>\r\n </div>\r\n</div>", styles: [".pop-up-confirm-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(var(--neutral-color-875-rgb, 30, 34, 37),.5);display:flex;justify-content:center;align-items:center;z-index:1000}.pop-up-confirm{background-color:var(--neutral-color-10);border-radius:var(--radius-lg);padding:24px;min-width:320px;max-width:400px;box-shadow:0 4px 20px rgba(var(--neutral-color-875-rgb, 30, 34, 37),.15)}.pop-up-confirm-content{display:flex;gap:16px;align-items:center;justify-content:center;flex-direction:column;margin-bottom:24px;width:352px;height:172px}.pop-up-confirm-content img{width:96px;height:96px;object-fit:contain;flex-shrink:0}.pop-up-confirm-text{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px}.pop-up-title{font-size:var(--font-xl);font-weight:600;color:var(--neutral-color-875);margin:0}.pop-up-content{font-size:var(--font-sm);color:var(--neutral-color-500);margin:0}.pop-up-confirm-actions{display:flex;gap:12px;justify-content:center;align-items:center;padding:16px 8px}\n"] }]
|
|
802
|
+
}], propDecorators: { imgUrl: [{
|
|
803
|
+
type: Input
|
|
804
|
+
}], title: [{
|
|
805
|
+
type: Input
|
|
806
|
+
}], content: [{
|
|
807
|
+
type: Input
|
|
808
|
+
}], colorButton: [{
|
|
809
|
+
type: Input
|
|
810
|
+
}], confirmClick: [{
|
|
811
|
+
type: Output
|
|
812
|
+
}], cancelClick: [{
|
|
813
|
+
type: Output
|
|
814
|
+
}] } });
|
|
815
|
+
|
|
816
|
+
/*
|
|
817
|
+
* Public API Surface of intern-hub-layout
|
|
818
|
+
*/
|
|
819
|
+
// Layout components
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* Generated bundle index. Do not edit.
|
|
823
|
+
*/
|
|
824
|
+
|
|
825
|
+
export { ApprovalListComponent, ApprovalListItemComponent, BUTTON_SIZE_MAP, ButtonContainerComponent, FunctionalLabelComponent, HeaderComponent, IconComponent, InputCalendarComponent, InputStepperComponent, InputTextComponent, LabelButtonComponent, PopUpConfirmComponent, SidebarComponent, TableBodyComponent, TableHeaderComponent };
|
|
826
|
+
//# sourceMappingURL=goat-bravos-intern-hub-layout.mjs.map
|