angular-dumb-lib 0.0.2 → 0.0.5
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/ng-package.json +7 -0
- package/package.json +3 -16
- package/src/lib/angular-dumb-lib.component.spec.ts +21 -0
- package/src/lib/angular-dumb-lib.component.ts +15 -0
- package/src/lib/angular-dumb-lib.module.ts +19 -0
- package/src/lib/angular-dumb-lib.service.spec.ts +16 -0
- package/src/lib/angular-dumb-lib.service.ts +9 -0
- package/src/lib/components/atoms/button/button.component.html +15 -0
- package/src/lib/components/atoms/button/button.component.scss +76 -0
- package/src/lib/components/atoms/button/button.component.ts +33 -0
- package/src/lib/components/atoms/datetime-picker/datetime-picker.component.html +7 -0
- package/src/lib/components/atoms/datetime-picker/datetime-picker.component.scss +24 -0
- package/src/lib/components/atoms/datetime-picker/datetime-picker.component.ts +59 -0
- package/src/lib/components/atoms/file-selection/file-selection.component.html +24 -0
- package/src/lib/components/atoms/file-selection/file-selection.component.scss +35 -0
- package/src/lib/components/atoms/file-selection/file-selection.component.ts +86 -0
- package/src/lib/components/atoms/input/input.component.html +28 -0
- package/src/lib/components/atoms/input/input.component.scss +64 -0
- package/src/lib/components/atoms/input/input.component.ts +57 -0
- package/src/lib/components/atoms/loading/loading.component.html +3 -0
- package/src/lib/components/atoms/loading/loading.component.scss +36 -0
- package/src/lib/components/atoms/loading/loading.component.ts +21 -0
- package/src/lib/components/atoms/selection/selection.component.html +38 -0
- package/src/lib/components/atoms/selection/selection.component.scss +65 -0
- package/src/lib/components/atoms/selection/selection.component.ts +84 -0
- package/src/lib/components/atoms/slider/slider.component.html +14 -0
- package/src/lib/components/atoms/slider/slider.component.scss +50 -0
- package/src/lib/components/atoms/slider/slider.component.ts +37 -0
- package/src/lib/components/atoms/tags/tags.component.html +25 -0
- package/src/lib/components/atoms/tags/tags.component.scss +58 -0
- package/src/lib/components/atoms/tags/tags.component.ts +62 -0
- package/src/lib/components/molecules/cards/cards.component.html +12 -0
- package/src/lib/components/molecules/cards/cards.component.scss +14 -0
- package/src/lib/components/molecules/cards/cards.component.ts +19 -0
- package/src/lib/components/molecules/content-design/content-design.component.html +14 -0
- package/src/lib/components/molecules/content-design/content-design.component.scss +68 -0
- package/src/lib/components/molecules/content-design/content-design.component.ts +32 -0
- package/src/lib/components/molecules/form/form.component.html +22 -0
- package/src/lib/components/molecules/form/form.component.scss +17 -0
- package/src/lib/components/molecules/form/form.component.ts +64 -0
- package/src/lib/components/molecules/modal/modal.component.html +16 -0
- package/src/lib/components/molecules/modal/modal.component.scss +83 -0
- package/src/lib/components/molecules/modal/modal.component.ts +48 -0
- package/src/lib/components/molecules/paginator/paginator.component.html +25 -0
- package/src/lib/components/molecules/paginator/paginator.component.scss +27 -0
- package/src/lib/components/molecules/paginator/paginator.component.ts +126 -0
- package/src/lib/components/molecules/table/table.component.html +45 -0
- package/src/lib/components/molecules/table/table.component.scss +169 -0
- package/src/lib/components/molecules/table/table.component.ts +40 -0
- package/src/lib/components/pages/footer/footer.component.html +32 -0
- package/src/lib/components/pages/footer/footer.component.scss +69 -0
- package/src/lib/components/pages/footer/footer.component.ts +16 -0
- package/src/lib/components/pages/login/login.component.html +10 -0
- package/src/lib/components/pages/login/login.component.scss +32 -0
- package/src/lib/components/pages/login/login.component.ts +32 -0
- package/src/lib/components/pages/menu/menu.component.html +18 -0
- package/src/lib/components/pages/menu/menu.component.scss +87 -0
- package/src/lib/components/pages/menu/menu.component.ts +26 -0
- package/src/lib/components/pages/version/version.component.html +3 -0
- package/src/lib/components/pages/version/version.component.scss +0 -0
- package/src/lib/components/pages/version/version.component.ts +28 -0
- package/src/lib/shared/constants/constant.ts +7 -0
- package/src/lib/shared/enums/enum.ts +68 -0
- package/src/lib/shared/interfaces/interface.ts +64 -0
- package/{public-api.d.ts → src/public-api.ts} +5 -1
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2022/angular-dumb-lib.mjs +0 -5
- package/esm2022/lib/angular-dumb-lib.component.mjs +0 -20
- package/esm2022/lib/angular-dumb-lib.module.mjs +0 -32
- package/esm2022/lib/angular-dumb-lib.service.mjs +0 -15
- package/esm2022/lib/components/atoms/button/button.component.mjs +0 -34
- package/esm2022/lib/components/atoms/input/input.component.mjs +0 -57
- package/esm2022/lib/components/molecules/content-design/content-design.component.mjs +0 -32
- package/esm2022/lib/shared/enums/enum.mjs +0 -69
- package/esm2022/lib/shared/interfaces/interface.mjs +0 -2
- package/esm2022/public-api.mjs +0 -10
- package/fesm2022/angular-dumb-lib.mjs +0 -243
- package/fesm2022/angular-dumb-lib.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/angular-dumb-lib.component.d.ts +0 -5
- package/lib/angular-dumb-lib.module.d.ts +0 -9
- package/lib/angular-dumb-lib.service.d.ts +0 -6
- package/lib/components/atoms/button/button.component.d.ts +0 -12
- package/lib/components/atoms/input/input.component.d.ts +0 -19
- package/lib/components/molecules/content-design/content-design.component.d.ts +0 -12
- package/lib/shared/enums/enum.d.ts +0 -59
- package/lib/shared/interfaces/interface.d.ts +0 -58
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component, Input, OnInit } from '@angular/core';
|
|
2
|
+
import { LoadingSize } from '../../../shared/enums/enum';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'app-loading',
|
|
7
|
+
standalone: true,
|
|
8
|
+
templateUrl: './loading.component.html',
|
|
9
|
+
styleUrls: ['./loading.component.scss'],
|
|
10
|
+
imports: [CommonModule]
|
|
11
|
+
})
|
|
12
|
+
export class LoadingComponent implements OnInit {
|
|
13
|
+
@Input() size: LoadingSize = LoadingSize.Medium;
|
|
14
|
+
|
|
15
|
+
@Input() imageSrc: string = '';
|
|
16
|
+
|
|
17
|
+
constructor() { }
|
|
18
|
+
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<div class="dropdown" *ngIf="displayType === 'dropdown'">
|
|
2
|
+
<label *ngIf="label">{{ label }}</label>
|
|
3
|
+
<select
|
|
4
|
+
(change)="onSelectChange($event)"
|
|
5
|
+
[multiple]="isMultiSelect"
|
|
6
|
+
[(ngModel)]="value">
|
|
7
|
+
<option *ngFor="let option of options"
|
|
8
|
+
[value]="option.value"
|
|
9
|
+
[selected]="isSelected(option.value)">
|
|
10
|
+
{{ option.label }}
|
|
11
|
+
</option>
|
|
12
|
+
</select>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="radio-group" *ngIf="displayType === 'radio'">
|
|
16
|
+
<label *ngIf="label">{{ label }}</label>
|
|
17
|
+
<div *ngFor="let option of options">
|
|
18
|
+
<input
|
|
19
|
+
type="radio"
|
|
20
|
+
[value]="option.value"
|
|
21
|
+
[checked]="option.value === selectedValue"
|
|
22
|
+
(change)="onSelectChange($event)"
|
|
23
|
+
name="radioGroup"/>
|
|
24
|
+
<label>{{ option.label }}</label>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="checkbox-group" *ngIf="displayType === 'checkbox'">
|
|
29
|
+
<label *ngIf="label">{{ label }}</label>
|
|
30
|
+
<div *ngFor="let option of options">
|
|
31
|
+
<input
|
|
32
|
+
type="checkbox"
|
|
33
|
+
[value]="option.value"
|
|
34
|
+
[checked]="isSelected(option.value)"
|
|
35
|
+
(change)="onMultiSelectChange($event)"/>
|
|
36
|
+
<label>{{ option.label }}</label>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* Dropdown styles */
|
|
2
|
+
.dropdown, .radio-group, .checkbox-group {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
width: 100%; // Adjust this as needed
|
|
6
|
+
min-width: 150px;
|
|
7
|
+
|
|
8
|
+
label {
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
color: #666;
|
|
11
|
+
margin-bottom: 4px;
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Select (Dropdown) styles */
|
|
17
|
+
.dropdown select {
|
|
18
|
+
width: 100%;
|
|
19
|
+
padding: 9px 8px; // Compact padding
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
color: #333;
|
|
22
|
+
background-color: #fff;
|
|
23
|
+
border: 1px solid #ccc;
|
|
24
|
+
border-radius: 4px;
|
|
25
|
+
appearance: none; // Hide default dropdown arrow in some browsers
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
transition: border-color 0.3s, box-shadow 0.3s;
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
border-color: #888;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:focus {
|
|
34
|
+
border-color: #03A9F4;
|
|
35
|
+
box-shadow: 0 0 5px rgba(3, 169, 244, 0.5);
|
|
36
|
+
outline: none;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Radio button styles */
|
|
41
|
+
.radio-group div, .checkbox-group div {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
margin-bottom: 8px; // Space between options
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.radio-group input[type="radio"],
|
|
48
|
+
.checkbox-group input[type="checkbox"] {
|
|
49
|
+
margin-right: 8px; // Space between input and label
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Radio/Checkbox label styles */
|
|
54
|
+
.radio-group label, .checkbox-group label {
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
color: #333;
|
|
57
|
+
cursor: pointer; // Ensures clicking the label checks the input
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Focus state for radio and checkbox */
|
|
61
|
+
.radio-group input[type="radio"]:focus,
|
|
62
|
+
.checkbox-group input[type="checkbox"]:focus {
|
|
63
|
+
outline: 2px solid #03A9F4; // Focus indicator
|
|
64
|
+
outline-offset: 2px;
|
|
65
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output, forwardRef } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
import { SelectionType } from '../../../shared/enums/enum';
|
|
4
|
+
import { IDropdownOption } from '../../../shared/interfaces/interface';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'app-selection',
|
|
9
|
+
templateUrl: './selection.component.html',
|
|
10
|
+
styleUrls: ['./selection.component.scss'],
|
|
11
|
+
standalone: true,
|
|
12
|
+
providers: [{
|
|
13
|
+
provide: NG_VALUE_ACCESSOR,
|
|
14
|
+
useExisting: forwardRef(() => SelectionComponent),
|
|
15
|
+
multi: true
|
|
16
|
+
}],
|
|
17
|
+
imports: [CommonModule, FormsModule]
|
|
18
|
+
})
|
|
19
|
+
export class SelectionComponent implements OnInit, ControlValueAccessor {
|
|
20
|
+
@Input() label: string = ''; // Label for the dropdown
|
|
21
|
+
@Input() options: IDropdownOption[] | undefined = []; // Array of options
|
|
22
|
+
@Input() selectedValue: any; // Pre-selected value (single selection)
|
|
23
|
+
@Input() selectedValues: any[] = []; // Pre-selected values (multi-selection)
|
|
24
|
+
@Input() isMultiSelect: boolean = false; // Enable multi-selection for dropdown
|
|
25
|
+
@Input() displayType: SelectionType = SelectionType.dropdown; // Control the display type (dropdown, radio, or checkbox)
|
|
26
|
+
|
|
27
|
+
@Output() selectedChange: EventEmitter<any> = new EventEmitter<any>(); // Event emitter for value changes
|
|
28
|
+
|
|
29
|
+
onChange: any = () => {};
|
|
30
|
+
onTouched: any = () => {};
|
|
31
|
+
|
|
32
|
+
get value() {
|
|
33
|
+
return this.selectedValue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
set value(value: any) {
|
|
37
|
+
this.selectedValue = (this.isMultiSelect === false && Array.isArray(value))? value[0] : value;
|
|
38
|
+
|
|
39
|
+
this.onChange(this.selectedValue);
|
|
40
|
+
this.onTouched();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ngOnInit(): void {
|
|
44
|
+
if (this.options && this.options.length > 0 && !this.isMultiSelect) {
|
|
45
|
+
this.selectedValue = this.options[0].value;
|
|
46
|
+
this.onChange(this.selectedValue);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
onSelectChange(event: Event) {
|
|
51
|
+
this.selectedChange.emit(this.selectedValue);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
onMultiSelectChange(event: Event) {
|
|
55
|
+
const target = event.target as HTMLInputElement;
|
|
56
|
+
const value = target.value;
|
|
57
|
+
|
|
58
|
+
if (target.checked) {
|
|
59
|
+
this.selectedValues.push(value);
|
|
60
|
+
} else {
|
|
61
|
+
this.selectedValues = this.selectedValues.filter(v => v !== value);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
this.selectedChange.emit(this.selectedValues);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
isSelected(value: any): boolean {
|
|
68
|
+
return this.isMultiSelect ? this.selectedValues.includes(value) : value === this.selectedValue;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
writeValue(value: any): void {
|
|
72
|
+
this.selectedValue = value;
|
|
73
|
+
}
|
|
74
|
+
registerOnChange(fn: any): void {
|
|
75
|
+
this.onChange = fn;
|
|
76
|
+
}
|
|
77
|
+
registerOnTouched(fn: any): void {
|
|
78
|
+
this.onTouched = fn
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
setDisabledState?(isDisabled: boolean): void {
|
|
82
|
+
// Implement if you need to handle disabled state
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="slider-container">
|
|
2
|
+
<div class="slider-wrapper">
|
|
3
|
+
<div
|
|
4
|
+
class="slide"
|
|
5
|
+
*ngFor="let image of images; let i = index"
|
|
6
|
+
[class.active]="i === currentIndex"
|
|
7
|
+
[ngStyle]="{'background-image': 'url(' + image + ')'}">
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<!-- Navigation Buttons -->
|
|
12
|
+
<button class="prev" (click)="prevSlide()">❮</button>
|
|
13
|
+
<button class="next" (click)="nextSlide()">❯</button>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.slider-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
margin: auto;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.slider-wrapper {
|
|
9
|
+
position: relative;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 400px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.slide {
|
|
15
|
+
position: absolute;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
background-size: cover;
|
|
19
|
+
background-position: center;
|
|
20
|
+
opacity: 0;
|
|
21
|
+
transition: opacity 0.5s ease-in-out;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.slide.active {
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.prev, .next {
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 50%;
|
|
31
|
+
transform: translateY(-50%);
|
|
32
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
33
|
+
color: white;
|
|
34
|
+
border: none;
|
|
35
|
+
padding: 10px;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
font-size: 18px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.prev {
|
|
41
|
+
left: 10px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.next {
|
|
45
|
+
right: 10px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.prev:hover, .next:hover {
|
|
49
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
50
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, Input, OnInit } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-slider',
|
|
6
|
+
standalone: true,
|
|
7
|
+
templateUrl: './slider.component.html',
|
|
8
|
+
styleUrls: ['./slider.component.scss'],
|
|
9
|
+
imports: [CommonModule]
|
|
10
|
+
})
|
|
11
|
+
export class SliderComponent implements OnInit {
|
|
12
|
+
@Input() images: string[] = [];
|
|
13
|
+
@Input() autoSlide: boolean = false;
|
|
14
|
+
@Input() slideInterval: number = 3000; // Time interval for auto slide
|
|
15
|
+
|
|
16
|
+
currentIndex: number = 0;
|
|
17
|
+
|
|
18
|
+
ngOnInit(): void {
|
|
19
|
+
if (this.autoSlide) {
|
|
20
|
+
this.startAutoSlide();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
startAutoSlide(): void {
|
|
25
|
+
setInterval(() => {
|
|
26
|
+
this.nextSlide();
|
|
27
|
+
}, this.slideInterval);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
prevSlide(): void {
|
|
31
|
+
this.currentIndex = this.currentIndex === 0 ? this.images.length - 1 : this.currentIndex - 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
nextSlide(): void {
|
|
35
|
+
this.currentIndex = this.currentIndex === this.images.length - 1 ? 0 : this.currentIndex + 1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<div class="tags-select-container">
|
|
2
|
+
<label for="searchTags">Search and Select Tags:</label>
|
|
3
|
+
<input
|
|
4
|
+
id="searchTags"
|
|
5
|
+
type="text"
|
|
6
|
+
[(ngModel)]="searchText"
|
|
7
|
+
(input)="filterTags()"
|
|
8
|
+
placeholder="Search tags..."
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<div *ngIf="filteredTags.length > 0">
|
|
12
|
+
<ul class="tag-list">
|
|
13
|
+
<li *ngFor="let tag of filteredTags" (click)="onTagSelectionChange(tag)">
|
|
14
|
+
{{ tag }}
|
|
15
|
+
</li>
|
|
16
|
+
</ul>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="selected-tags">
|
|
20
|
+
<button *ngFor="let tag of selectedTags" class="tag-button">
|
|
21
|
+
{{ tag }}
|
|
22
|
+
<span class="remove-tag" (click)="removeTag(tag)">x</span>
|
|
23
|
+
</button>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.tags-select-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
input[type="text"] {
|
|
7
|
+
padding: 5px;
|
|
8
|
+
border: 1px solid #ccc;
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
width: 200px;
|
|
11
|
+
margin-bottom: 10px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.tag-list {
|
|
15
|
+
list-style-type: none;
|
|
16
|
+
padding-left: 0;
|
|
17
|
+
margin: 0;
|
|
18
|
+
border: 1px solid #ccc;
|
|
19
|
+
max-height: 100px;
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.tag-list li {
|
|
24
|
+
padding: 5px;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
border-bottom: 1px solid #ddd;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.tag-list li:hover {
|
|
30
|
+
background-color: #f1f1f1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.selected-tags {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
gap: 5px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.tag-button {
|
|
40
|
+
background-color: #007bff;
|
|
41
|
+
color: white;
|
|
42
|
+
border: none;
|
|
43
|
+
border-radius: 20px;
|
|
44
|
+
padding: 5px 10px;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.tag-button .remove-tag {
|
|
51
|
+
margin-left: 8px;
|
|
52
|
+
background: none;
|
|
53
|
+
border: none;
|
|
54
|
+
font-size: 1rem;
|
|
55
|
+
font-weight: bold;
|
|
56
|
+
color: white;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, Input, forwardRef } from '@angular/core';
|
|
3
|
+
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'app-tags',
|
|
7
|
+
standalone: true,
|
|
8
|
+
templateUrl: './tags.component.html',
|
|
9
|
+
styleUrls: ['./tags.component.scss'],
|
|
10
|
+
providers: [{
|
|
11
|
+
provide: NG_VALUE_ACCESSOR,
|
|
12
|
+
useExisting: forwardRef(() => TagsComponent),
|
|
13
|
+
multi: true
|
|
14
|
+
}],
|
|
15
|
+
imports: [CommonModule, FormsModule]
|
|
16
|
+
})
|
|
17
|
+
export class TagsComponent implements ControlValueAccessor {
|
|
18
|
+
@Input() availableTags: string[] = ['abc', 'dce'];
|
|
19
|
+
filteredTags: string[] = [];
|
|
20
|
+
selectedTags: string[] = [];
|
|
21
|
+
searchText: string = '';
|
|
22
|
+
|
|
23
|
+
private onChange: any = () => {};
|
|
24
|
+
private onTouched: any = () => {};
|
|
25
|
+
|
|
26
|
+
ngOnInit() {
|
|
27
|
+
this.filteredTags = this.availableTags; // Initialize the filtered tags list
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
writeValue(value: string[]): void {
|
|
31
|
+
if (value) {
|
|
32
|
+
this.selectedTags = value;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
registerOnChange(fn: any): void {
|
|
37
|
+
this.onChange = fn;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
registerOnTouched(fn: any): void {
|
|
41
|
+
this.onTouched = fn;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onTagSelectionChange(tag: string) {
|
|
45
|
+
if (!this.selectedTags.includes(tag)) {
|
|
46
|
+
this.selectedTags = [...this.selectedTags, tag]; // Add the tag
|
|
47
|
+
this.onChange(this.selectedTags);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
removeTag(tag: string) {
|
|
52
|
+
this.selectedTags = this.selectedTags.filter(t => t !== tag); // Remove the tag
|
|
53
|
+
this.onChange(this.selectedTags);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
filterTags() {
|
|
57
|
+
this.filteredTags = this.availableTags.filter(tag =>
|
|
58
|
+
tag.toLowerCase().includes(this.searchText.toLowerCase()) &&
|
|
59
|
+
!this.selectedTags.includes(tag)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component, Input, OnInit } from '@angular/core';
|
|
2
|
+
import { IContentDesign } from '../../../shared/interfaces/interface';
|
|
3
|
+
import { ContentDesignComponent } from 'angular-dumb-lib';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-cards',
|
|
8
|
+
standalone: true,
|
|
9
|
+
templateUrl: './cards.component.html',
|
|
10
|
+
styleUrls: ['./cards.component.scss'],
|
|
11
|
+
imports: [CommonModule, ContentDesignComponent]
|
|
12
|
+
})
|
|
13
|
+
export class CardsComponent implements OnInit {
|
|
14
|
+
@Input() cardContents: IContentDesign[] = [];
|
|
15
|
+
constructor() { }
|
|
16
|
+
|
|
17
|
+
ngOnInit() {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="content-designer" [ngClass]="content.contentDirection">
|
|
2
|
+
<div *ngIf="content.coverImage" class="image">
|
|
3
|
+
<img [src]="content.coverImage" alt="Cover Image">
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<div class="content">
|
|
7
|
+
<h2>{{ content.title }}</h2>
|
|
8
|
+
<p>{{ content.content }}</p>
|
|
9
|
+
<ng-container [ngTemplateOutlet]="content.template"></ng-container>
|
|
10
|
+
<app-button *ngIf="content.button" [config] = "content.button"
|
|
11
|
+
(clickEvent)="onButtonClick()">
|
|
12
|
+
</app-button>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.content-designer {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 20px;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
align-items: center;
|
|
7
|
+
text-align: center;
|
|
8
|
+
|
|
9
|
+
img {
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
height: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.content {
|
|
15
|
+
p {
|
|
16
|
+
text-align: justify;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Common styles for left and right layouts
|
|
21
|
+
&.left,
|
|
22
|
+
&.right {
|
|
23
|
+
flex-direction: row;
|
|
24
|
+
.image,
|
|
25
|
+
.content {
|
|
26
|
+
flex: 1;
|
|
27
|
+
width: 50%;
|
|
28
|
+
padding: 0 20px;
|
|
29
|
+
}
|
|
30
|
+
.content {
|
|
31
|
+
text-align: justify;
|
|
32
|
+
}
|
|
33
|
+
.image {
|
|
34
|
+
display: flex;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Specific override for left layout
|
|
39
|
+
&.left {
|
|
40
|
+
flex-direction: row-reverse;
|
|
41
|
+
.image {
|
|
42
|
+
justify-content: end;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.right {
|
|
47
|
+
.image {
|
|
48
|
+
justify-content: start;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
// Common styles for up and down layouts
|
|
54
|
+
&.up,
|
|
55
|
+
&.down {
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
|
|
58
|
+
.image {
|
|
59
|
+
width: 100%;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Specific override for up layout
|
|
65
|
+
&.up {
|
|
66
|
+
flex-direction: column-reverse;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
2
|
+
import { IContentDesign } from '../../../shared/interfaces/interface';
|
|
3
|
+
import { ContentDirection } from '../../../shared/enums/enum';
|
|
4
|
+
import { ButtonComponent } from '../../atoms/button/button.component';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'app-content-design',
|
|
9
|
+
standalone: true,
|
|
10
|
+
templateUrl: './content-design.component.html',
|
|
11
|
+
styleUrls: ['./content-design.component.scss'],
|
|
12
|
+
imports: [CommonModule, ButtonComponent]
|
|
13
|
+
})
|
|
14
|
+
export class ContentDesignComponent implements OnInit {
|
|
15
|
+
@Input() content!: IContentDesign;
|
|
16
|
+
|
|
17
|
+
@Output() clickEvent = new EventEmitter<void>();
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
) { }
|
|
21
|
+
|
|
22
|
+
ngOnInit() {
|
|
23
|
+
this.content = {
|
|
24
|
+
contentDirection: ContentDirection.left,
|
|
25
|
+
...this.content,
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
onButtonClick() {
|
|
30
|
+
this.clickEvent.emit();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<form (ngSubmit)="onSubmit()" #form="ngForm" [formGroup]="formGroup">
|
|
2
|
+
<ng-container *ngFor="let inputConfig of inputConfigs">
|
|
3
|
+
<app-input *ngIf="checkFormConfigType(inputConfig.type) === 'textual'"
|
|
4
|
+
[formControlName]="inputConfig.name"
|
|
5
|
+
[config]="inputConfig"
|
|
6
|
+
[required]="inputConfig.required"></app-input>
|
|
7
|
+
|
|
8
|
+
<app-selection *ngIf="checkFormConfigType(inputConfig.type) === 'selection'"
|
|
9
|
+
[formControlName]="inputConfig.name"
|
|
10
|
+
[label]="inputConfig.label?? ''"
|
|
11
|
+
[options]= "inputConfig.options">
|
|
12
|
+
</app-selection>
|
|
13
|
+
|
|
14
|
+
<app-file-selection
|
|
15
|
+
[formControlName]="inputConfig.name"
|
|
16
|
+
*ngIf="checkFormConfigType(inputConfig.type) === 'file'"
|
|
17
|
+
[label]="inputConfig.name ">
|
|
18
|
+
</app-file-selection>
|
|
19
|
+
</ng-container>
|
|
20
|
+
|
|
21
|
+
<app-button [config]="buttonConfig"></app-button>
|
|
22
|
+
</form>
|