angular-dumb-lib 0.0.6 → 0.0.9
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/esm2022/angular-dumb-lib.mjs +5 -0
- package/esm2022/lib/angular-dumb-lib.component.mjs +20 -0
- package/esm2022/lib/angular-dumb-lib.module.mjs +22 -0
- package/esm2022/lib/angular-dumb-lib.service.mjs +15 -0
- package/esm2022/lib/components/atoms/button/button.component.mjs +34 -0
- package/esm2022/lib/components/atoms/datetime-picker/datetime-picker.component.mjs +58 -0
- package/esm2022/lib/components/atoms/file-selection/file-selection.component.mjs +85 -0
- package/esm2022/lib/components/atoms/input/input.component.mjs +57 -0
- package/esm2022/lib/components/atoms/loading/loading.component.mjs +25 -0
- package/esm2022/lib/components/atoms/selection/selection.component.mjs +92 -0
- package/esm2022/lib/components/atoms/slider/slider.component.mjs +42 -0
- package/esm2022/lib/components/atoms/tags/tags.component.mjs +62 -0
- package/esm2022/lib/components/molecules/cards/cards.component.mjs +22 -0
- package/esm2022/lib/components/molecules/content-design/content-design.component.mjs +32 -0
- package/esm2022/lib/components/molecules/form/form.component.mjs +71 -0
- package/esm2022/lib/components/molecules/modal/modal.component.mjs +45 -0
- package/esm2022/lib/components/molecules/paginator/paginator.component.mjs +118 -0
- package/esm2022/lib/components/molecules/table/table.component.mjs +51 -0
- package/esm2022/lib/components/pages/footer/footer.component.mjs +15 -0
- package/esm2022/lib/components/pages/login/login.component.mjs +31 -0
- package/esm2022/lib/components/pages/menu/menu.component.mjs +31 -0
- package/esm2022/lib/components/pages/version/version.component.mjs +26 -0
- package/esm2022/lib/shared/constants/constant.mjs +6 -0
- package/esm2022/lib/shared/enums/enum.mjs +69 -0
- package/esm2022/lib/shared/interfaces/interface.mjs +2 -0
- package/esm2022/public-api.mjs +25 -0
- package/fesm2022/angular-dumb-lib.mjs +915 -0
- package/fesm2022/angular-dumb-lib.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/angular-dumb-lib.component.d.ts +5 -0
- package/lib/angular-dumb-lib.module.d.ts +7 -0
- package/lib/angular-dumb-lib.service.d.ts +6 -0
- package/lib/components/atoms/button/button.component.d.ts +12 -0
- package/lib/components/atoms/datetime-picker/datetime-picker.component.d.ts +17 -0
- package/lib/components/atoms/file-selection/file-selection.component.d.ts +25 -0
- package/lib/components/atoms/input/input.component.d.ts +19 -0
- package/lib/components/atoms/loading/loading.component.d.ts +11 -0
- package/lib/components/atoms/selection/selection.component.d.ts +28 -0
- package/lib/components/atoms/slider/slider.component.d.ts +14 -0
- package/lib/components/atoms/tags/tags.component.d.ts +19 -0
- package/lib/components/molecules/cards/cards.component.d.ts +10 -0
- package/lib/components/molecules/content-design/content-design.component.d.ts +12 -0
- package/lib/components/molecules/form/form.component.d.ts +23 -0
- package/lib/components/molecules/modal/modal.component.d.ts +17 -0
- package/lib/components/molecules/paginator/paginator.component.d.ts +29 -0
- package/lib/components/molecules/table/table.component.d.ts +20 -0
- package/lib/components/pages/footer/footer.component.d.ts +8 -0
- package/lib/components/pages/login/login.component.d.ts +11 -0
- package/lib/components/pages/menu/menu.component.d.ts +14 -0
- package/lib/components/pages/version/version.component.d.ts +10 -0
- package/lib/shared/constants/constant.d.ts +3 -0
- package/lib/shared/enums/enum.d.ts +59 -0
- package/lib/shared/interfaces/interface.d.ts +58 -0
- package/package.json +16 -3
- package/public-api.d.ts +21 -0
- package/ng-package.json +0 -7
- package/src/lib/angular-dumb-lib.component.spec.ts +0 -21
- package/src/lib/angular-dumb-lib.component.ts +0 -15
- package/src/lib/angular-dumb-lib.module.ts +0 -19
- package/src/lib/angular-dumb-lib.service.spec.ts +0 -16
- package/src/lib/angular-dumb-lib.service.ts +0 -9
- package/src/lib/components/atoms/button/button.component.html +0 -15
- package/src/lib/components/atoms/button/button.component.scss +0 -76
- package/src/lib/components/atoms/button/button.component.ts +0 -33
- package/src/lib/components/atoms/datetime-picker/datetime-picker.component.html +0 -7
- package/src/lib/components/atoms/datetime-picker/datetime-picker.component.scss +0 -24
- package/src/lib/components/atoms/datetime-picker/datetime-picker.component.ts +0 -59
- package/src/lib/components/atoms/file-selection/file-selection.component.html +0 -24
- package/src/lib/components/atoms/file-selection/file-selection.component.scss +0 -35
- package/src/lib/components/atoms/file-selection/file-selection.component.ts +0 -86
- package/src/lib/components/atoms/input/input.component.html +0 -28
- package/src/lib/components/atoms/input/input.component.scss +0 -64
- package/src/lib/components/atoms/input/input.component.ts +0 -57
- package/src/lib/components/atoms/loading/loading.component.html +0 -3
- package/src/lib/components/atoms/loading/loading.component.scss +0 -36
- package/src/lib/components/atoms/loading/loading.component.ts +0 -21
- package/src/lib/components/atoms/selection/selection.component.html +0 -38
- package/src/lib/components/atoms/selection/selection.component.scss +0 -65
- package/src/lib/components/atoms/selection/selection.component.ts +0 -84
- package/src/lib/components/atoms/slider/slider.component.html +0 -14
- package/src/lib/components/atoms/slider/slider.component.scss +0 -50
- package/src/lib/components/atoms/slider/slider.component.ts +0 -37
- package/src/lib/components/atoms/tags/tags.component.html +0 -25
- package/src/lib/components/atoms/tags/tags.component.scss +0 -58
- package/src/lib/components/atoms/tags/tags.component.ts +0 -62
- package/src/lib/components/molecules/cards/cards.component.html +0 -12
- package/src/lib/components/molecules/cards/cards.component.scss +0 -14
- package/src/lib/components/molecules/cards/cards.component.ts +0 -19
- package/src/lib/components/molecules/content-design/content-design.component.html +0 -14
- package/src/lib/components/molecules/content-design/content-design.component.scss +0 -68
- package/src/lib/components/molecules/content-design/content-design.component.ts +0 -32
- package/src/lib/components/molecules/form/form.component.html +0 -22
- package/src/lib/components/molecules/form/form.component.scss +0 -17
- package/src/lib/components/molecules/form/form.component.ts +0 -64
- package/src/lib/components/molecules/modal/modal.component.html +0 -16
- package/src/lib/components/molecules/modal/modal.component.scss +0 -83
- package/src/lib/components/molecules/modal/modal.component.ts +0 -48
- package/src/lib/components/molecules/paginator/paginator.component.html +0 -25
- package/src/lib/components/molecules/paginator/paginator.component.scss +0 -27
- package/src/lib/components/molecules/paginator/paginator.component.ts +0 -126
- package/src/lib/components/molecules/table/table.component.html +0 -45
- package/src/lib/components/molecules/table/table.component.scss +0 -169
- package/src/lib/components/molecules/table/table.component.ts +0 -40
- package/src/lib/components/pages/footer/footer.component.html +0 -32
- package/src/lib/components/pages/footer/footer.component.scss +0 -69
- package/src/lib/components/pages/footer/footer.component.ts +0 -16
- package/src/lib/components/pages/login/login.component.html +0 -10
- package/src/lib/components/pages/login/login.component.scss +0 -32
- package/src/lib/components/pages/login/login.component.ts +0 -32
- package/src/lib/components/pages/menu/menu.component.html +0 -18
- package/src/lib/components/pages/menu/menu.component.scss +0 -87
- package/src/lib/components/pages/menu/menu.component.ts +0 -26
- package/src/lib/components/pages/version/version.component.html +0 -3
- package/src/lib/components/pages/version/version.component.scss +0 -0
- package/src/lib/components/pages/version/version.component.ts +0 -28
- package/src/lib/shared/constants/constant.ts +0 -7
- package/src/lib/shared/enums/enum.ts +0 -68
- package/src/lib/shared/interfaces/interface.ts +0 -64
- package/src/public-api.ts +0 -10
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export declare enum DesignType {
|
|
2
|
+
normal = "normal",
|
|
3
|
+
contrast = "contrast"
|
|
4
|
+
}
|
|
5
|
+
export declare enum ButtonType {
|
|
6
|
+
submit = "submit",
|
|
7
|
+
button = "button"
|
|
8
|
+
}
|
|
9
|
+
export declare enum InputGroupType {
|
|
10
|
+
textual = "textual",
|
|
11
|
+
datetime = "datetime",
|
|
12
|
+
selection = "selection",
|
|
13
|
+
file = "file"
|
|
14
|
+
}
|
|
15
|
+
export declare enum InputDirection {
|
|
16
|
+
horizontal = "horizontal",
|
|
17
|
+
vertical = "vertical"
|
|
18
|
+
}
|
|
19
|
+
export declare enum InputType {
|
|
20
|
+
image = "image",
|
|
21
|
+
text = "text",
|
|
22
|
+
richText = "richText",
|
|
23
|
+
password = "password",
|
|
24
|
+
email = "email",
|
|
25
|
+
url = "url",
|
|
26
|
+
tel = "tel",
|
|
27
|
+
search = "search",
|
|
28
|
+
number = "number",
|
|
29
|
+
range = "range",
|
|
30
|
+
hidden = "hidden",
|
|
31
|
+
textarea = "textarea",
|
|
32
|
+
datetime = "datetime",
|
|
33
|
+
checkbox = "checkbox",
|
|
34
|
+
radio = "radio",
|
|
35
|
+
select = "select",
|
|
36
|
+
file = "file"
|
|
37
|
+
}
|
|
38
|
+
export declare enum ContentDirection {
|
|
39
|
+
left = "left",
|
|
40
|
+
right = "right",
|
|
41
|
+
up = "up",
|
|
42
|
+
down = "down"
|
|
43
|
+
}
|
|
44
|
+
export declare enum SelectionType {
|
|
45
|
+
dropdown = "dropdown",
|
|
46
|
+
radio = "radio",
|
|
47
|
+
checkbox = "checkbox"
|
|
48
|
+
}
|
|
49
|
+
export declare enum LoadingSize {
|
|
50
|
+
Xbig = "xbig",
|
|
51
|
+
Big = "big",
|
|
52
|
+
Medium = "medium",
|
|
53
|
+
Small = "small",
|
|
54
|
+
Xsmall = "xsmall"
|
|
55
|
+
}
|
|
56
|
+
export declare enum MenuDirection {
|
|
57
|
+
vertical = "vertical",
|
|
58
|
+
horizontal = "horizontal"
|
|
59
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TemplateRef } from "@angular/core";
|
|
2
|
+
import { ButtonType, ContentDirection, DesignType, InputDirection, InputType } from "../enums/enum";
|
|
3
|
+
export interface IButtonConfig {
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
isActive?: boolean;
|
|
6
|
+
designType?: DesignType;
|
|
7
|
+
label?: string;
|
|
8
|
+
iconValue?: string;
|
|
9
|
+
type?: ButtonType;
|
|
10
|
+
action?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface IInputConfig {
|
|
13
|
+
required: boolean;
|
|
14
|
+
label?: string;
|
|
15
|
+
name: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
type?: InputType;
|
|
18
|
+
direction?: InputDirection;
|
|
19
|
+
isValid?: boolean;
|
|
20
|
+
options?: IDropdownOption[];
|
|
21
|
+
}
|
|
22
|
+
export interface IContentDesign {
|
|
23
|
+
name?: string;
|
|
24
|
+
coverImage?: string;
|
|
25
|
+
issuedDate?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
contentDirection?: ContentDirection;
|
|
28
|
+
content?: string;
|
|
29
|
+
template: TemplateRef<unknown> | null;
|
|
30
|
+
button?: IButtonConfig;
|
|
31
|
+
}
|
|
32
|
+
export interface IDropdownOption {
|
|
33
|
+
label: string;
|
|
34
|
+
value: any;
|
|
35
|
+
}
|
|
36
|
+
export interface IMenuItem {
|
|
37
|
+
label: string;
|
|
38
|
+
route: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IModalEvent {
|
|
41
|
+
isDialog: boolean;
|
|
42
|
+
isModalVisible: boolean;
|
|
43
|
+
template: TemplateRef<unknown> | null;
|
|
44
|
+
title: string;
|
|
45
|
+
params?: {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
onOk?: () => void;
|
|
49
|
+
onCancel?: () => void;
|
|
50
|
+
}
|
|
51
|
+
export interface IPaginator {
|
|
52
|
+
itemsPerPage: number;
|
|
53
|
+
selectedPage: number;
|
|
54
|
+
}
|
|
55
|
+
export interface IDataColumnConfig {
|
|
56
|
+
field: string;
|
|
57
|
+
name: string;
|
|
58
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-dumb-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^16.0.0",
|
|
6
6
|
"@angular/core": "^16.0.0"
|
|
@@ -8,5 +8,18 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"tslib": "^2.3.0"
|
|
10
10
|
},
|
|
11
|
-
"sideEffects": false
|
|
12
|
-
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/angular-dumb-lib.mjs",
|
|
13
|
+
"typings": "index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./index.d.ts",
|
|
20
|
+
"esm2022": "./esm2022/angular-dumb-lib.mjs",
|
|
21
|
+
"esm": "./esm2022/angular-dumb-lib.mjs",
|
|
22
|
+
"default": "./fesm2022/angular-dumb-lib.mjs"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './lib/angular-dumb-lib.service';
|
|
2
|
+
export * from './lib/angular-dumb-lib.component';
|
|
3
|
+
export * from './lib/angular-dumb-lib.module';
|
|
4
|
+
export * from './lib/components/atoms/button/button.component';
|
|
5
|
+
export * from './lib/components/atoms/datetime-picker/datetime-picker.component';
|
|
6
|
+
export * from './lib/components/atoms/file-selection/file-selection.component';
|
|
7
|
+
export * from './lib/components/atoms/input/input.component';
|
|
8
|
+
export * from './lib/components/atoms/loading/loading.component';
|
|
9
|
+
export * from './lib/components/atoms/selection/selection.component';
|
|
10
|
+
export * from './lib/components/atoms/slider/slider.component';
|
|
11
|
+
export * from './lib/components/atoms/tags/tags.component';
|
|
12
|
+
export * from './lib/components/molecules/cards/cards.component';
|
|
13
|
+
export * from './lib/components/molecules/content-design/content-design.component';
|
|
14
|
+
export * from './lib/components/molecules/form/form.component';
|
|
15
|
+
export * from './lib/components/molecules/modal/modal.component';
|
|
16
|
+
export * from './lib/components/molecules/paginator/paginator.component';
|
|
17
|
+
export * from './lib/components/molecules/table/table.component';
|
|
18
|
+
export * from './lib/components/pages/footer/footer.component';
|
|
19
|
+
export * from './lib/components/pages/login/login.component';
|
|
20
|
+
export * from './lib/components/pages/menu/menu.component';
|
|
21
|
+
export * from './lib/components/pages/version/version.component';
|
package/ng-package.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { AngularDumbLibComponent } from './angular-dumb-lib.component';
|
|
4
|
-
|
|
5
|
-
describe('AngularDumbLibComponent', () => {
|
|
6
|
-
let component: AngularDumbLibComponent;
|
|
7
|
-
let fixture: ComponentFixture<AngularDumbLibComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
TestBed.configureTestingModule({
|
|
11
|
-
declarations: [AngularDumbLibComponent]
|
|
12
|
-
});
|
|
13
|
-
fixture = TestBed.createComponent(AngularDumbLibComponent);
|
|
14
|
-
component = fixture.componentInstance;
|
|
15
|
-
fixture.detectChanges();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should create', () => {
|
|
19
|
-
expect(component).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { AngularDumbLibComponent } from './angular-dumb-lib.component';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
|
|
6
|
-
@NgModule({
|
|
7
|
-
declarations: [
|
|
8
|
-
AngularDumbLibComponent,
|
|
9
|
-
],
|
|
10
|
-
imports: [
|
|
11
|
-
CommonModule,
|
|
12
|
-
FormsModule,
|
|
13
|
-
ReactiveFormsModule,
|
|
14
|
-
],
|
|
15
|
-
exports: [
|
|
16
|
-
AngularDumbLibComponent,
|
|
17
|
-
]
|
|
18
|
-
})
|
|
19
|
-
export class AngularDumbLibModule { }
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { AngularDumbLibService } from './angular-dumb-lib.service';
|
|
4
|
-
|
|
5
|
-
describe('AngularDumbLibService', () => {
|
|
6
|
-
let service: AngularDumbLibService;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
TestBed.configureTestingModule({});
|
|
10
|
-
service = TestBed.inject(AngularDumbLibService);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should be created', () => {
|
|
14
|
-
expect(service).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<button
|
|
2
|
-
type="{{config.type}}"
|
|
3
|
-
class="btn btn-primary"
|
|
4
|
-
[disabled]="config.isDisabled"
|
|
5
|
-
[ngClass]="{'active': config.isActive,
|
|
6
|
-
'normal': config.designType === 'normal',
|
|
7
|
-
'contrast': config.designType === 'contrast'}"
|
|
8
|
-
(click)="onButtonClick()">
|
|
9
|
-
<div class="button-content">
|
|
10
|
-
<ng-container *ngIf="config.iconValue">
|
|
11
|
-
<i class="material-icons" data-toggle="tooltip" title="Delete">{{config.iconValue}}</i>
|
|
12
|
-
</ng-container>
|
|
13
|
-
<span>{{ config.label }}</span>
|
|
14
|
-
</div>
|
|
15
|
-
</button>
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Normal Button Variables
|
|
2
|
-
$normal-bg-color: #007BFF; // Primary blue for normal button background
|
|
3
|
-
$normal-text-color: #FFFFFF; // White text for normal button
|
|
4
|
-
$normal-border-color: #007BFF; // Same as background for border
|
|
5
|
-
$normal-hover-bg-color: #0056D2; // Slightly darker blue for hover state
|
|
6
|
-
$normal-hover-text-color: #FFFFFF; // Keeping white text for hover state
|
|
7
|
-
|
|
8
|
-
// Contrast Button Variables
|
|
9
|
-
$contrast-bg-color: #F9F9F9; // Off-white for contrast button background
|
|
10
|
-
$contrast-text-color: #007BFF; // Dark gray for contrast button text
|
|
11
|
-
$contrast-border-color: #4A90E2; // Dark blue for contrast button border
|
|
12
|
-
$contrast-hover-bg-color: #E6F0FA; // Light blue-gray for hover background
|
|
13
|
-
$contrast-hover-text-color: #1A1A1A; // Dark gray for hover text color
|
|
14
|
-
|
|
15
|
-
$disabled-bg-color: #cccccc;
|
|
16
|
-
$disabled-text-color: #666666;
|
|
17
|
-
|
|
18
|
-
$active-bg-color: #003d99;
|
|
19
|
-
|
|
20
|
-
// Base Button Styles
|
|
21
|
-
button.btn.btn-primary {
|
|
22
|
-
padding: 0.5rem 1rem;
|
|
23
|
-
border: none;
|
|
24
|
-
border-radius: 0.25rem;
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
height: 3rem;
|
|
27
|
-
|
|
28
|
-
// Button Content Alignment
|
|
29
|
-
.button-content {
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: row;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
align-items: center;
|
|
34
|
-
height: 100%;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Disabled State (Shared between normal and contrast)
|
|
38
|
-
&:disabled {
|
|
39
|
-
background-color: $disabled-bg-color !important;
|
|
40
|
-
color: $disabled-text-color !important;
|
|
41
|
-
cursor: not-allowed !important;
|
|
42
|
-
border-color: $disabled-text-color !important; // You can remove this if not needed for normal design
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Normal Design
|
|
46
|
-
&.normal {
|
|
47
|
-
background-color: $normal-bg-color;
|
|
48
|
-
color: $normal-text-color;
|
|
49
|
-
|
|
50
|
-
&:hover:not(:disabled) {
|
|
51
|
-
background-color: $normal-hover-bg-color;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Contrast Design
|
|
56
|
-
&.contrast {
|
|
57
|
-
color: $contrast-text-color;
|
|
58
|
-
border: 1px solid $contrast-border-color;
|
|
59
|
-
|
|
60
|
-
&:hover:not(:disabled) {
|
|
61
|
-
background-color: $contrast-hover-bg-color;
|
|
62
|
-
color: $contrast-hover-text-color;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Active State (Applies to both designs)
|
|
67
|
-
&.active {
|
|
68
|
-
background-color: $active-bg-color;
|
|
69
|
-
color: $normal-text-color;
|
|
70
|
-
|
|
71
|
-
&:hover:not(:disabled) {
|
|
72
|
-
background-color: $normal-hover-bg-color;
|
|
73
|
-
color: $normal-text-color;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
2
|
-
import { ButtonType, DesignType } from '../../../shared/enums/enum';
|
|
3
|
-
import { IButtonConfig } from '../../../shared/interfaces/interface';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-button',
|
|
8
|
-
standalone: true,
|
|
9
|
-
templateUrl: './button.component.html',
|
|
10
|
-
styleUrls: ['./button.component.scss'],
|
|
11
|
-
imports: [CommonModule]
|
|
12
|
-
})
|
|
13
|
-
export class ButtonComponent implements OnInit {
|
|
14
|
-
@Input() config!: IButtonConfig;
|
|
15
|
-
|
|
16
|
-
@Output() clickEvent = new EventEmitter<void>();
|
|
17
|
-
|
|
18
|
-
constructor() { }
|
|
19
|
-
|
|
20
|
-
ngOnInit() {
|
|
21
|
-
this.config = {
|
|
22
|
-
isDisabled: false,
|
|
23
|
-
isActive: false,
|
|
24
|
-
designType: DesignType.normal,
|
|
25
|
-
type: ButtonType.submit,
|
|
26
|
-
...this.config,
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
onButtonClick() {
|
|
31
|
-
this.clickEvent.emit();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<div class="datetime-picker-container">
|
|
2
|
-
<label for="date">Datetime:</label>
|
|
3
|
-
<div class="inputs-container">
|
|
4
|
-
<input id="date" type="date" [(ngModel)]="selectedDate" (ngModelChange)="onDateChange($event)" (blur)="onTouched()">
|
|
5
|
-
<input id="time" type="time" [(ngModel)]="selectedTime" (ngModelChange)="onTimeChange($event)" (blur)="onTouched()">
|
|
6
|
-
</div>
|
|
7
|
-
</div>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.datetime-picker-container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
margin-bottom: 1rem;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.datetime-picker-container label {
|
|
8
|
-
margin-bottom: 0.5rem;
|
|
9
|
-
font-weight: bold;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.inputs-container {
|
|
13
|
-
display: flex;
|
|
14
|
-
gap: 1rem;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.inputs-container input[type="date"],
|
|
18
|
-
.inputs-container input[type="time"] {
|
|
19
|
-
padding: 0.5rem;
|
|
20
|
-
font-size: 1rem;
|
|
21
|
-
border: 1px solid #ccc;
|
|
22
|
-
border-radius: 4px;
|
|
23
|
-
width: 150px;
|
|
24
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Component, forwardRef } from '@angular/core';
|
|
2
|
-
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'app-datetime-picker',
|
|
6
|
-
standalone: true,
|
|
7
|
-
templateUrl: './datetime-picker.component.html',
|
|
8
|
-
styleUrls: ['./datetime-picker.component.scss'],
|
|
9
|
-
providers: [{
|
|
10
|
-
provide: NG_VALUE_ACCESSOR,
|
|
11
|
-
useExisting: forwardRef(() => DatetimePickerComponent),
|
|
12
|
-
multi: true
|
|
13
|
-
}],
|
|
14
|
-
imports: [FormsModule]
|
|
15
|
-
})
|
|
16
|
-
export class DatetimePickerComponent implements ControlValueAccessor {
|
|
17
|
-
selectedDate: string | null = null;
|
|
18
|
-
selectedTime: string | null = null;
|
|
19
|
-
|
|
20
|
-
public onChange: any = () => {};
|
|
21
|
-
public onTouched: any = () => {};
|
|
22
|
-
|
|
23
|
-
writeValue(value: any): void {
|
|
24
|
-
if (value) {
|
|
25
|
-
const date = new Date(value);
|
|
26
|
-
this.selectedDate = date.toISOString().split('T')[0]; // Extract the date part (YYYY-MM-DD)
|
|
27
|
-
this.selectedTime = date.toTimeString().split(' ')[0]; // Extract the time part (HH:mm:ss)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
registerOnChange(fn: any): void {
|
|
32
|
-
this.onChange = fn;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
registerOnTouched(fn: any): void {
|
|
36
|
-
this.onTouched = fn;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
setDisabledState?(isDisabled: boolean): void {
|
|
40
|
-
// Handle disabled state
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
onDateChange(event: any) {
|
|
44
|
-
this.selectedDate = event.target.value;
|
|
45
|
-
this.emitChange();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
onTimeChange(event: any) {
|
|
49
|
-
this.selectedTime = event.target.value;
|
|
50
|
-
this.emitChange();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
private emitChange() {
|
|
54
|
-
if (this.selectedDate && this.selectedTime) {
|
|
55
|
-
const dateTime = `${this.selectedDate}T${this.selectedTime}`;
|
|
56
|
-
this.onChange(new Date(dateTime));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<div class="file-selector">
|
|
2
|
-
<label *ngIf="label">{{ label }}</label>
|
|
3
|
-
<input
|
|
4
|
-
id="fileInput"
|
|
5
|
-
type="file"
|
|
6
|
-
(change)="onFileSelected($event)"
|
|
7
|
-
accept="image/*"
|
|
8
|
-
class="hidden-file-input">
|
|
9
|
-
<div class="file-selection">
|
|
10
|
-
<!-- Custom button to trigger file input -->
|
|
11
|
-
<app-button [config]="config"
|
|
12
|
-
class="custom-file-button"
|
|
13
|
-
(clickEvent)="triggerFileInput()">
|
|
14
|
-
Select Image
|
|
15
|
-
</app-button>
|
|
16
|
-
<div *ngIf="fileName" class="file-name">
|
|
17
|
-
{{ fileName }}
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div *ngIf="imageUrl">
|
|
22
|
-
<img [src]="imageUrl" alt="Selected Image" class="preview-image"/>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
.file-selector {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: flex-start;
|
|
5
|
-
|
|
6
|
-
label {
|
|
7
|
-
font-size: 14px;
|
|
8
|
-
color: #666;
|
|
9
|
-
margin-bottom: 8px;
|
|
10
|
-
font-weight: bold;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
input[type="file"] {
|
|
14
|
-
margin-bottom: 16px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.preview-image {
|
|
18
|
-
max-width: 150px; // Adjust the image preview size as needed
|
|
19
|
-
max-height: 150px;
|
|
20
|
-
border: 1px solid #ccc;
|
|
21
|
-
margin-top: 8px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.hidden-file-input {
|
|
25
|
-
opacity: 0;
|
|
26
|
-
position: absolute;
|
|
27
|
-
z-index: -1; /* Keeps it off the screen, but functional */
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.file-selection {
|
|
31
|
-
display: flex;
|
|
32
|
-
align-items: center;
|
|
33
|
-
gap: 10px;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, Input, OnInit, forwardRef } from '@angular/core';
|
|
3
|
-
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
-
import { ButtonComponent } from 'angular-dumb-lib';
|
|
5
|
-
import { IButtonConfig } from 'dist/angular-dumb-lib/lib/shared/interfaces/interface';
|
|
6
|
-
import { ButtonType } from '../../../shared/enums/enum';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'app-file-selection',
|
|
10
|
-
standalone: true,
|
|
11
|
-
templateUrl: './file-selection.component.html',
|
|
12
|
-
styleUrls: ['./file-selection.component.scss'],
|
|
13
|
-
providers: [{
|
|
14
|
-
provide: NG_VALUE_ACCESSOR,
|
|
15
|
-
useExisting: forwardRef(() => FileSelectionComponent),
|
|
16
|
-
multi: true
|
|
17
|
-
}],
|
|
18
|
-
imports: [CommonModule, ButtonComponent]
|
|
19
|
-
})
|
|
20
|
-
export class FileSelectionComponent implements OnInit, ControlValueAccessor {
|
|
21
|
-
@Input() label!: string; // Label for the file selector
|
|
22
|
-
@Input() chooseFileLabel!: string;
|
|
23
|
-
@Input() imageUrl: string | ArrayBuffer | null = null; // Allow imageUrl to be passed externally
|
|
24
|
-
@Input() fileName: string | null = null; // Allow fileName to be passed externally
|
|
25
|
-
|
|
26
|
-
config!: IButtonConfig;
|
|
27
|
-
|
|
28
|
-
onChange: any = () => {};
|
|
29
|
-
onTouched: any = () => {};
|
|
30
|
-
private _value: any = undefined;
|
|
31
|
-
|
|
32
|
-
get value() {
|
|
33
|
-
return this._value;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
set value(value: any) {
|
|
37
|
-
this._value = value;
|
|
38
|
-
this.onChange(this._value);
|
|
39
|
-
this.onTouched();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
ngOnInit(): void {
|
|
43
|
-
this.config = {
|
|
44
|
-
type: ButtonType.button,
|
|
45
|
-
label: this.chooseFileLabel
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
onFileSelected(event: Event) {
|
|
50
|
-
const input = event.target as HTMLInputElement;
|
|
51
|
-
|
|
52
|
-
if (input.files && input.files.length > 0) {
|
|
53
|
-
const file = input.files[0];
|
|
54
|
-
|
|
55
|
-
// Store the file name to display it in the UI
|
|
56
|
-
this.fileName = file.name;
|
|
57
|
-
this.value = file;
|
|
58
|
-
|
|
59
|
-
// Generate image preview URL if it's an image
|
|
60
|
-
const reader = new FileReader();
|
|
61
|
-
reader.onload = (e: any) => {
|
|
62
|
-
this.imageUrl = e.target.result; // Set image URL for preview
|
|
63
|
-
};
|
|
64
|
-
reader.readAsDataURL(file);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
triggerFileInput() {
|
|
69
|
-
const fileInput = document.getElementById('fileInput') as HTMLInputElement;
|
|
70
|
-
fileInput.click(); // Programmatically click the hidden file input
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
writeValue(value: any): void {
|
|
74
|
-
this._value = value;
|
|
75
|
-
}
|
|
76
|
-
registerOnChange(fn: any): void {
|
|
77
|
-
this.onChange = fn;
|
|
78
|
-
}
|
|
79
|
-
registerOnTouched(fn: any): void {
|
|
80
|
-
this.onTouched = fn;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
setDisabledState?(isDisabled: boolean): void {
|
|
84
|
-
// Implement if you need to handle disabled state
|
|
85
|
-
}
|
|
86
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<div class="input-item" [ngClass]="config.direction">
|
|
2
|
-
<label *ngIf="config.label">
|
|
3
|
-
{{ config.label }}
|
|
4
|
-
<span *ngIf="config.required" class="required-indicator">*</span>
|
|
5
|
-
</label>
|
|
6
|
-
|
|
7
|
-
<div class="input-container">
|
|
8
|
-
<input *ngIf="config.type !== 'textarea' && config.type !== 'richText' && config.type !== 'image'"
|
|
9
|
-
[type]="config.type"
|
|
10
|
-
[name]="config.name"
|
|
11
|
-
[required]="config.required"
|
|
12
|
-
[(ngModel)]="value"
|
|
13
|
-
[placeholder] = "config.placeholder"
|
|
14
|
-
[ngClass]="{'input-error': !config.isValid}">
|
|
15
|
-
<textarea *ngIf="config.type === 'textarea'"
|
|
16
|
-
[name]="config.name"
|
|
17
|
-
[required]="config.required"
|
|
18
|
-
[(ngModel)]="value"
|
|
19
|
-
[placeholder] = "config.placeholder"
|
|
20
|
-
[ngClass]="{'input-error': !config.isValid}">
|
|
21
|
-
</textarea>
|
|
22
|
-
<i *ngIf="!config.isValid" class="material-icons warning-icon">error</i>
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<div *ngIf="config.type === 'image'">
|
|
26
|
-
<img *ngIf="value" [src]="value" alt="Selected Image" class="preview-image"/>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|