@corp-products/ui-components 3.2.7 → 3.2.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.
Files changed (138) hide show
  1. package/ng-package.json +7 -0
  2. package/package.json +22 -36
  3. package/src/enums/date-formatter.ts +21 -0
  4. package/src/helper/date-handler.ts +142 -0
  5. package/src/lib/app-accordion/app-accordion.component.html +15 -0
  6. package/src/lib/app-accordion/app-accordion.component.scss +0 -0
  7. package/src/lib/app-accordion/app-accordion.component.spec.ts +21 -0
  8. package/src/lib/app-accordion/app-accordion.component.ts +21 -0
  9. package/src/lib/app-accordion/index.ts +2 -0
  10. package/src/lib/app-breadcrumb/app-breadcrumb.component.html +7 -0
  11. package/src/lib/app-breadcrumb/app-breadcrumb.component.scss +25 -0
  12. package/src/lib/app-breadcrumb/app-breadcrumb.component.ts +140 -0
  13. package/src/lib/app-breadcrumb/app-breadcrumb.interface.ts +15 -0
  14. package/src/lib/app-button/app-button.component.html +7 -0
  15. package/src/lib/app-button/app-button.component.scss +0 -0
  16. package/src/lib/app-button/app-button.component.ts +14 -0
  17. package/src/lib/app-button/app-button.ts +15 -0
  18. package/src/lib/app-button/index.ts +2 -0
  19. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.html +22 -0
  20. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.scss +39 -0
  21. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.spec.ts +21 -0
  22. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.ts +43 -0
  23. package/src/lib/app-dropdown-menu/app-dropdown-menu.ts +17 -0
  24. package/src/lib/app-dropdown-menu/index.ts +2 -0
  25. package/src/lib/app-dropdown-menu/menu-popup.pipe.ts +18 -0
  26. package/src/lib/app-header/app-header.component.html +26 -0
  27. package/src/lib/app-header/app-header.component.scss +0 -0
  28. package/src/lib/app-header/app-header.component.ts +43 -0
  29. package/src/lib/app-side-menu/app-side-menu.component.html +20 -0
  30. package/src/lib/app-side-menu/app-side-menu.component.ts +28 -0
  31. package/src/lib/app-side-menu/routes-names.ts +28 -0
  32. package/src/lib/app-side-menu/side-menu-items.ts +45 -0
  33. package/src/lib/app-side-menu/side-menu.ts +12 -0
  34. package/src/lib/app-tabs/app-tab.interface.ts +27 -0
  35. package/src/lib/app-tabs/app-tabs.component.html +37 -0
  36. package/src/lib/app-tabs/app-tabs.component.scss +103 -0
  37. package/src/lib/app-tabs/app-tabs.component.spec.ts +21 -0
  38. package/src/lib/app-tabs/app-tabs.component.ts +67 -0
  39. package/src/lib/app-tabs/index.ts +2 -0
  40. package/src/lib/bottom-sheet/bottom-sheet.component.html +18 -0
  41. package/src/lib/bottom-sheet/bottom-sheet.component.scss +31 -0
  42. package/src/lib/bottom-sheet/bottom-sheet.component.ts +26 -0
  43. package/src/lib/confirmation-dialog/confirmation-dialog.component.html +37 -0
  44. package/src/lib/confirmation-dialog/confirmation-dialog.component.scss +0 -0
  45. package/src/lib/confirmation-dialog/confirmation-dialog.component.spec.ts +22 -0
  46. package/src/lib/confirmation-dialog/confirmation-dialog.component.ts +64 -0
  47. package/src/lib/confirmation-dialog/confirmation-dialog.interface.ts +13 -0
  48. package/src/lib/confirmation-dialog/confirmation-dialog.service.ts +34 -0
  49. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.html +27 -0
  50. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.scss +22 -0
  51. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.ts +64 -0
  52. package/src/lib/dual-calender/dual-calendar.component.html +31 -0
  53. package/src/lib/dual-calender/dual-calendar.component.scss +229 -0
  54. package/src/lib/dual-calender/dual-calendar.component.ts +107 -0
  55. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.html +10 -0
  56. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.scss +0 -0
  57. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.spec.ts +21 -0
  58. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.ts +59 -0
  59. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.html +10 -0
  60. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.scss +0 -0
  61. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.spec.ts +21 -0
  62. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.ts +59 -0
  63. package/src/lib/dual-calender/services/gregorian-i18n.service.ts +123 -0
  64. package/src/lib/dual-calender/services/islamic-i18n.service.ts +119 -0
  65. package/src/lib/dual-calender/utils/date-i18n.utils.ts +58 -0
  66. package/src/lib/dynamic-form/dynamic-form.component.html +86 -0
  67. package/src/lib/dynamic-form/dynamic-form.component.scss +0 -0
  68. package/src/lib/dynamic-form/dynamic-form.component.spec.ts +21 -0
  69. package/src/lib/dynamic-form/dynamic-form.component.ts +58 -0
  70. package/src/lib/dynamic-form/dynamic-form.interface.ts +94 -0
  71. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.html +32 -0
  72. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.scss +3 -0
  73. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.ts +82 -0
  74. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.config.ts +31 -0
  75. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.service.ts +41 -0
  76. package/src/lib/form-components/@utils/form-utils.ts +12 -0
  77. package/src/lib/form-components/@utils/validations/error-keys.enum.ts +24 -0
  78. package/src/lib/form-components/@utils/validations/form-validation.service.ts +68 -0
  79. package/src/lib/form-components/@utils/validations/index.ts +3 -0
  80. package/src/lib/form-components/@utils/validations/validation-message.pipe.ts +24 -0
  81. package/src/lib/form-components/components/auto-complete/auto-complete.component.html +35 -0
  82. package/src/lib/form-components/components/auto-complete/auto-complete.component.scss +7 -0
  83. package/src/lib/form-components/components/auto-complete/auto-complete.component.spec.ts +21 -0
  84. package/src/lib/form-components/components/auto-complete/auto-complete.component.ts +57 -0
  85. package/src/lib/form-components/components/base-input.component.ts +35 -0
  86. package/src/lib/form-components/components/date-picker/date-picker.component.html +41 -0
  87. package/src/lib/form-components/components/date-picker/date-picker.component.scss +16 -0
  88. package/src/lib/form-components/components/date-picker/date-picker.component.spec.ts +21 -0
  89. package/src/lib/form-components/components/date-picker/date-picker.component.ts +54 -0
  90. package/src/lib/form-components/components/input/input.component.html +63 -0
  91. package/src/lib/form-components/components/input/input.component.scss +41 -0
  92. package/src/lib/form-components/components/input/input.component.spec.ts +21 -0
  93. package/src/lib/form-components/components/input/input.component.ts +45 -0
  94. package/src/lib/form-components/components/select/select.component.html +111 -0
  95. package/src/lib/form-components/components/select/select.component.scss +43 -0
  96. package/src/lib/form-components/components/select/select.component.spec.ts +21 -0
  97. package/src/lib/form-components/components/select/select.component.ts +56 -0
  98. package/src/lib/form-components/components/select-button/select-button.component.html +21 -0
  99. package/src/lib/form-components/components/select-button/select-button.component.scss +0 -0
  100. package/src/lib/form-components/components/select-button/select-button.component.spec.ts +21 -0
  101. package/src/lib/form-components/components/select-button/select-button.component.ts +22 -0
  102. package/src/lib/form-components/components/switcher/switch.component.html +5 -0
  103. package/src/lib/form-components/components/switcher/switch.component.scss +0 -0
  104. package/src/lib/form-components/components/switcher/switch.component.spec.ts +21 -0
  105. package/src/lib/form-components/components/switcher/switch.component.ts +25 -0
  106. package/src/lib/form-components/index.ts +9 -0
  107. package/src/lib/form-components/interfaces/index.ts +1 -0
  108. package/src/lib/form-components/interfaces/label-value.ts +4 -0
  109. package/src/lib/ico-moon-icon/ico-moon-icon.component.ts +23 -0
  110. package/src/lib/read-more/read-more.component.html +17 -0
  111. package/src/lib/read-more/read-more.component.scss +0 -0
  112. package/src/lib/read-more/read-more.component.spec.ts +21 -0
  113. package/src/lib/read-more/read-more.component.ts +21 -0
  114. package/src/lib/side-bar/side-bar.component.html +24 -0
  115. package/src/lib/side-bar/side-bar.component.scss +22 -0
  116. package/src/lib/side-bar/side-bar.component.spec.ts +21 -0
  117. package/src/lib/side-bar/side-bar.component.ts +33 -0
  118. package/src/lib/side-bar-dynamic/data-injector.pipe.ts +15 -0
  119. package/src/lib/side-bar-dynamic/dynamic-sidebar.service.ts +116 -0
  120. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.html +42 -0
  121. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.scss +5 -0
  122. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.spec.ts +21 -0
  123. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.ts +37 -0
  124. package/src/lib/side-bar-dynamic/side-bar-utils.ts +30 -0
  125. package/src/lib/side-bar-dynamic/sidebar-config.ts +48 -0
  126. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.html +20 -0
  127. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.scss +0 -0
  128. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.spec.ts +21 -0
  129. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.ts +21 -0
  130. package/src/lib/user-info/user-info.component.html +10 -0
  131. package/src/lib/user-info/user-info.component.ts +11 -0
  132. package/src/public-api.ts +26 -0
  133. package/tsconfig.lib.json +18 -0
  134. package/tsconfig.lib.prod.json +11 -0
  135. package/tsconfig.spec.json +14 -0
  136. package/fesm2022/corp-products-ui-components.mjs +0 -1409
  137. package/fesm2022/corp-products-ui-components.mjs.map +0 -1
  138. package/index.d.ts +0 -623
@@ -0,0 +1,63 @@
1
+ <div class="field flex flex-col gap-2 my-3 relative">
2
+
3
+ @if (!required && !hideOptionalLabel) {
4
+ <span class="absolute top-[6px] left-0 text-[10px] text-gray-400">{{'forms.config.optional' | translate}}</span>
5
+ }
6
+
7
+ <!-- input text align will be handled according to lang when implemented -->
8
+
9
+ @switch (type) {
10
+ @case ('textarea') {
11
+ @if (label) {
12
+ <label [for]="inputId">
13
+ {{ label }}
14
+ @if (required) {
15
+ <span [class.text-required]="required">*</span>
16
+ }
17
+ </label>
18
+
19
+ <ng-content></ng-content>
20
+ }
21
+ <textarea [name]="name" [id]="inputId" [formControl]="control" [placeholder]="placeholder" [readonly]="readonly"
22
+ [disabled]="disabled" pTextarea [rows]="rows" [cols]="cols" [autoResize]="autoResize" [class]="
23
+ 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'
24
+ "
25
+ [ngClass]="{'ng-invalid ng-dirty': control.invalid && (control.dirty || control.touched), 'basic-style': basicInput, 'no-style':noStyle}">
26
+ </textarea>
27
+ }
28
+ @default {
29
+ <p-floatlabel [variant]="variant">
30
+ <!-- <input pInputText id="value2" [(ngModel)]="value2" [invalid]="!value2" autocomplete="off" /> -->
31
+ <input [id]="inputId" [type]="'text-float-label'" [formControl]="control" [readonly]="readonly" [pSize]="size"
32
+ [class]="
33
+ 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'
34
+ " [disabled]="disabled" [name]="name" pInputText [ngStyle]="{'direction': inputDirection || 'inherit'}"
35
+ class="w-full"
36
+ [ngClass]="{ 'p-invalid ng-dirty ng-invalid': isInvalid, 'basic-style': basicInput, 'no-style':noStyle}" />
37
+ <label [for]="inputId">
38
+ {{ label }}
39
+ @if (required) {
40
+ <span [class.text-required]="required">*</span>
41
+ }
42
+ </label>
43
+ </p-floatlabel>
44
+ @if (prefix) {
45
+ <span class="absolute top-[40px] font-bold text-[16px] left-[25px]">
46
+ {{ prefix }}
47
+ </span>
48
+ }
49
+
50
+
51
+ }
52
+ }
53
+ @if (hint) {
54
+ <small class="p-mt-1">{{ hint }}</small>
55
+ }
56
+ @if (isInvalid && (control.dirty || control.touched)) {
57
+ <small class="p-error">
58
+ @for (error of control.errors | validationErrors; track error) {
59
+ {{ error }}<br>
60
+ }
61
+ </small>
62
+ }
63
+ </div>
@@ -0,0 +1,41 @@
1
+ textarea {
2
+ @apply h-auto min-h-[50px] overflow-auto;
3
+ }
4
+
5
+
6
+ textarea,
7
+ .p-select, input {
8
+ border-radius: 0 ;
9
+ border-color: #DFE0E6 ;
10
+
11
+ &:enabled {
12
+ &:hover {
13
+ border-color: #DFE0E6 ;
14
+ }
15
+ }
16
+
17
+ &:not(.p-disabled).p-focus,
18
+ &:not(.p-disabled).p-focus:hover,
19
+ &:focus {
20
+ outline: #DFE0E6 ;
21
+ border-color: #DFE0E6 ;
22
+ }
23
+ }
24
+ .p-floatlabel:has(input:focus) label,
25
+ .p-floatlabel:has(input:-webkit-autofill) label,
26
+ .p-floatlabel:has(textarea:focus) label,
27
+ .p-floatlabel:has(.p-inputwrapper-focus) label {
28
+ color: #687078;
29
+
30
+ }
31
+ .p-inputtext:enabled:focus {
32
+ border-color: #DFE0E6 ;
33
+ }
34
+
35
+ .text-required {
36
+ color: red;
37
+ }
38
+
39
+ .p-error {
40
+ color: #dc2626;
41
+ }
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { InputComponent } from './input.component';
3
+
4
+ describe('InputComponent', () => {
5
+ let component: InputComponent;
6
+ let fixture: ComponentFixture<InputComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [InputComponent],
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(InputComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,45 @@
1
+ import { NgClass, NgStyle } from '@angular/common';
2
+ import { Component, Input } from '@angular/core';
3
+ import { ReactiveFormsModule } from '@angular/forms';
4
+ import { TranslatePipe } from '@ngx-translate/core';
5
+ import { FloatLabelModule } from 'primeng/floatlabel';
6
+ import { InputText } from 'primeng/inputtext';
7
+ import { Textarea } from 'primeng/textarea';
8
+ import { ValidationErrorsPipe } from '../../@utils/validations/validation-message.pipe';
9
+ import { BaseInputComponent } from '../base-input.component';
10
+ @Component({
11
+ selector: 'stc-input',
12
+ standalone: true,
13
+ imports: [
14
+ ReactiveFormsModule,
15
+ InputText,
16
+ Textarea,
17
+ ValidationErrorsPipe,
18
+ NgClass,
19
+ NgStyle,
20
+ TranslatePipe,
21
+ FloatLabelModule,
22
+ ],
23
+ templateUrl: './input.component.html',
24
+ styleUrl: './input.component.scss',
25
+ })
26
+ export class InputComponent extends BaseInputComponent {
27
+ @Input() type: 'text' | 'textarea' = 'text';
28
+ @Input() contentType: 'text' | 'email' | 'number' = 'text';
29
+ @Input() size: 'small' | 'large' = "small";
30
+ @Input() prefix: string;
31
+ @Input() rows = 2;
32
+ @Input() cols = 20;
33
+ @Input() autoResize = true;
34
+ @Input() basicInput!: boolean;
35
+ @Input() noStyle!: boolean;
36
+ @Input() hideOptionalLabel: boolean;
37
+ @Input() inputDirection: 'ltr' | 'rtl' | 'inherit' = 'inherit';
38
+ @Input() variant: 'in' | 'over' | 'on' = 'over';
39
+ @Input() defaultColor = '#DFE0E6'
40
+
41
+
42
+ constructor() {
43
+ super();
44
+ }
45
+ }
@@ -0,0 +1,111 @@
1
+ <div class="field flex flex-col gap-2 my-3 relative">
2
+
3
+ @if(multiple) {
4
+ <p-floatLabel [variant]="variant">
5
+
6
+ <p-multiselect
7
+ [disabled]="disabled"
8
+ [filterBy]="filterBy"
9
+ [filter]="filter"
10
+ [formControl]="control"
11
+ [id]="inputId"
12
+ [name]="name"
13
+ [ngClass]="{ 'p-invalid ng-dirty ng-invalid': isInvalid }"
14
+ [optionLabel]="optionLabel"
15
+ [options]="options"
16
+ [placeholder]="placeholder"
17
+ [readonly]="readonly"
18
+ [showClear]="showClear"
19
+ class="w-full"
20
+ [size]="size"
21
+ [selectedItemsLabel]="selectedItemsLabel"
22
+ [class]="
23
+ 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'
24
+ "
25
+ (onChange)="onChange($event)"
26
+ [ngClass]="{ 'basic-style': basicInput }"
27
+ >
28
+
29
+
30
+
31
+
32
+
33
+
34
+ @if(optionTemplate){
35
+ <ng-template let-item #item>
36
+ <ng-container [ngTemplateOutletContext]="{ $implicit: item }" [ngTemplateOutlet]="optionTemplate" />
37
+ </ng-template>
38
+ }
39
+
40
+
41
+ <ng-template #dropdownicon>
42
+ <i class="pi pi-map"></i>
43
+ </ng-template>
44
+
45
+
46
+ </p-multiselect>
47
+ <label [for]="inputId">
48
+ {{ label }}
49
+ @if (required) {
50
+ <span [class.text-required]="required">*</span>
51
+ }
52
+ </label>
53
+
54
+ </p-floatLabel>
55
+
56
+ } @else {
57
+ <p-floatLabel [variant]="variant">
58
+ <p-select
59
+ [checkmark]="checkmark"
60
+ [disabled]="disabled"
61
+ [editable]="editable"
62
+ [filterBy]="filterBy"
63
+ [filter]="filter"
64
+ [formControl]="control"
65
+ [id]="inputId"
66
+ [name]="name"
67
+ [ngClass]="{ 'p-invalid ng-dirty ng-invalid': isInvalid }"
68
+ [optionLabel]="optionLabel"
69
+ [options]="options"
70
+ [placeholder]="placeholder"
71
+ [readonly]="readonly"
72
+ [showClear]="showClear"
73
+ [size]="size"
74
+ class="w-full"
75
+ [class]="
76
+ 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'
77
+ "
78
+ (onChange)="onChange($event)"
79
+ [ngClass]="{ 'basic-style': basicInput }"
80
+ >
81
+
82
+ @if (optionTemplate) {
83
+ <ng-template let-item pTemplate="item">
84
+ <ng-container [ngTemplateOutletContext]="{ $implicit: item }" [ngTemplateOutlet]="optionTemplate" />
85
+ </ng-template>
86
+ }
87
+ @if (selectedItemTemplate) {
88
+ <ng-template let-item pTemplate="selectedItem">
89
+ <ng-container [ngTemplateOutletContext]="{ $implicit: item }" [ngTemplateOutlet]="selectedItemTemplate" />
90
+ </ng-template>
91
+ }
92
+ </p-select>
93
+ <label [for]="inputId">
94
+ {{ label }}
95
+ @if (required) {
96
+ <span [class.text-required]="required">*</span>
97
+ }
98
+ </label>
99
+ </p-floatLabel>
100
+ }
101
+
102
+ @if (hint) {
103
+ <small class="p-mt-1">{{ hint }}</small>
104
+ } @if (isInvalid && (control.dirty || control.touched)) {
105
+ <small class="p-error">
106
+ @for (error of control.errors | validationErrors; track error) {
107
+ {{ error }}<br />
108
+ }
109
+ </small>
110
+ }
111
+ </div>
@@ -0,0 +1,43 @@
1
+ textarea,
2
+ .p-select {
3
+ border-radius: 0;
4
+ border-color: #DFE0E6;
5
+
6
+ &:enabled {
7
+ &:hover {
8
+ border-color: #DFE0E6;
9
+ }
10
+ }
11
+
12
+ &:not(.p-disabled).p-focus,
13
+ &:not(.p-disabled).p-focus:hover,
14
+ &:focus {
15
+ outline: #DFE0E6;
16
+ border-color: #DFE0E6;
17
+ }
18
+ }
19
+ .p-floatlabel:has(input:focus) label,
20
+ .p-floatlabel:has(input:-webkit-autofill) label,
21
+ .p-floatlabel:has(textarea:focus) label,
22
+ .p-floatlabel:has(.p-inputwrapper-focus) label {
23
+ color: #687078;
24
+
25
+ }
26
+ .p-inputtext:enabled:focus {
27
+ border-color: #DFE0E6 ;
28
+ }
29
+ .p-select {
30
+ .p-select-label {
31
+ padding-block-end: 1rem !important;
32
+ padding-block-start: 1rem !important;
33
+ }
34
+ }
35
+
36
+ .text-required {
37
+ color: red;
38
+ }
39
+
40
+ .p-error {
41
+ color: #dc2626;
42
+ }
43
+
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+ import { SelectComponent } from './select.component';
3
+
4
+ describe('SelectComponent', () => {
5
+ let component: SelectComponent;
6
+ let fixture: ComponentFixture<SelectComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [SelectComponent],
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(SelectComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it('should create', () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,56 @@
1
+ import { NgClass, NgTemplateOutlet } from '@angular/common';
2
+ import { Component, EventEmitter, Input, Output, TemplateRef, ViewEncapsulation } from '@angular/core';
3
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
4
+ import { TranslatePipe } from '@ngx-translate/core';
5
+ import { PrimeTemplate } from 'primeng/api';
6
+ import { FloatLabelModule } from 'primeng/floatlabel';
7
+ import { MultiSelectModule } from 'primeng/multiselect';
8
+ import { Select, SelectChangeEvent } from 'primeng/select';
9
+ import { ValidationErrorsPipe } from '../../@utils/validations';
10
+ import { BaseInputComponent } from '../base-input.component';
11
+
12
+ @Component({
13
+ selector: 'stc-select',
14
+ standalone: true,
15
+ imports: [
16
+ FormsModule,
17
+ Select,
18
+ ReactiveFormsModule,
19
+ NgClass,
20
+ NgTemplateOutlet,
21
+ PrimeTemplate,
22
+ ValidationErrorsPipe,
23
+ MultiSelectModule,
24
+ FloatLabelModule,
25
+ ],
26
+ templateUrl: './select.component.html',
27
+ styleUrl: './select.component.scss',
28
+ encapsulation: ViewEncapsulation.None
29
+ })
30
+ export class SelectComponent extends BaseInputComponent {
31
+ @Input() selectedItemTemplate: TemplateRef<unknown> | null = null;
32
+ @Input() optionTemplate: TemplateRef<unknown> | null = null;
33
+ @Input() options: unknown[];
34
+ @Input() optionLabel!: string;
35
+ @Input() checkmark = true;
36
+ @Input() showClear = false;
37
+ @Input() editable = false;
38
+ @Input() filter = false;
39
+ @Input() multiple = false;
40
+ @Input() filterBy!: string;
41
+ @Input() size: 'small' | 'large' = "small";
42
+
43
+ @Input() selectedItemsLabel!: string;
44
+ @Input() basicInput!: boolean;
45
+ @Input() variant: 'in' | 'over' | 'on' = 'over';
46
+ // eslint-disable-next-line @angular-eslint/no-output-native
47
+ @Output() change = new EventEmitter();
48
+ @Input() defaultColor = '#DFE0E6'
49
+ constructor() {
50
+ super();
51
+ }
52
+
53
+ onChange(e: SelectChangeEvent) {
54
+ this.change.emit(e);
55
+ }
56
+ }
@@ -0,0 +1,21 @@
1
+ <div class="grid grid-cols-12 gap-x-4 gap-y-0 items-end">
2
+ <div class="col-span-12">
3
+ <div class="text-[14px] font-bold mb-1">{{ title }}</div>
4
+ <div class="grid w-100 bg-gray-100 rounded drop-shadow-basic">
5
+ <p-selectButton [disabled]="disabled"
6
+ [options]="options"
7
+ [formControl]="control"
8
+ optionLabel="label"
9
+ optionValue="value"
10
+ class="rounded"
11
+ [styleClass]="'full-width'"
12
+ (onChange)="changeValue($event)">
13
+ <ng-template let-item class="flex w-100">
14
+ <div class="col-span-4">
15
+ <span>{{ item.value }}</span>
16
+ </div>
17
+ </ng-template>
18
+ </p-selectButton>
19
+ </div>
20
+ </div>
21
+ </div>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from "@angular/core/testing";
2
+ import { SelectButtonComponent } from "./select-button.component";
3
+
4
+ describe("AppSelectButtonComponent", () => {
5
+ let component: SelectButtonComponent;
6
+ let fixture: ComponentFixture<SelectButtonComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [SelectButtonComponent]
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(SelectButtonComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it("should create", () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,22 @@
1
+ import { Component, EventEmitter, Input, Output } from "@angular/core";
2
+ import { SelectButtonChangeEvent, SelectButtonModule } from 'primeng/selectbutton';
3
+ import { BaseInputComponent } from "../base-input.component";
4
+ import { FormsModule, ReactiveFormsModule } from "@angular/forms";
5
+ import {LabelValue} from "../../interfaces";
6
+
7
+ @Component({
8
+ selector: "stc-select-button",
9
+ standalone: true,
10
+ imports: [ReactiveFormsModule, SelectButtonModule, FormsModule],
11
+ templateUrl: "./select-button.component.html",
12
+ styleUrl: "./select-button.component.scss"
13
+ })
14
+ export class SelectButtonComponent extends BaseInputComponent {
15
+ @Output() onChange: EventEmitter<any> = new EventEmitter<string>();
16
+ @Input() options: LabelValue<any>[];
17
+ @Input() title: string;
18
+
19
+ changeValue(e: SelectButtonChangeEvent) {
20
+ this.onChange.emit(e.value);
21
+ }
22
+ }
@@ -0,0 +1,5 @@
1
+ <div class="flex items-center mr-2">
2
+ <p-toggleswitch [(ngModel)]="checked" [inputId]="key" (onChange)="sendUpdatedValue($event)" class="flex">
3
+ </p-toggleswitch>
4
+ <label [for]="key" class="text-[12px] mx-2">{{label}}</label>
5
+ </div>
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from "@angular/core/testing";
2
+ import { SwitchComponent } from "./switch.component";
3
+
4
+ describe("SwitchComponent", () => {
5
+ let component: SwitchComponent;
6
+ let fixture: ComponentFixture<SwitchComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [SwitchComponent]
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(SwitchComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it("should create", () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,25 @@
1
+ import { Component, EventEmitter, Input, Output } from "@angular/core";
2
+ import { CommonModule } from "@angular/common";
3
+ import { ToggleSwitchModule } from 'primeng/toggleswitch';
4
+ import { FormsModule } from "@angular/forms";
5
+
6
+ @Component({
7
+ selector: "stc-switch",
8
+ standalone: true,
9
+ imports: [CommonModule, ToggleSwitchModule, FormsModule],
10
+ templateUrl: "./switch.component.html",
11
+ styleUrl: "./switch.component.scss"
12
+ })
13
+ export class SwitchComponent {
14
+ @Input() label: string;
15
+ @Input() key: string;
16
+ @Input() checked: boolean = false;
17
+ @Output() onChange: EventEmitter<string> = new EventEmitter<string>();
18
+ // checked: boolean = false;
19
+
20
+ sendUpdatedValue(value: any) {
21
+ if (value) {
22
+ this.onChange.emit(value.checked);
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,9 @@
1
+ export * from './@utils/form-utils';
2
+ export * from './@utils/validations';
3
+ export * from './components/auto-complete/auto-complete.component';
4
+ export * from './components/date-picker/date-picker.component';
5
+ export * from './components/input/input.component';
6
+ export * from './components/select-button/select-button.component';
7
+ export * from './components/select/select.component';
8
+ export * from './components/switcher/switch.component';
9
+ export * from './interfaces';
@@ -0,0 +1 @@
1
+ export * from "./label-value";
@@ -0,0 +1,4 @@
1
+ export interface LabelValue<T> {
2
+ label: string;
3
+ value: T | any;
4
+ }
@@ -0,0 +1,23 @@
1
+ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-ico-moon-card',
5
+ standalone: true,
6
+ template:`
7
+ <i [class]="iconName + ' ' + iconClass">
8
+ @for (path of getPathCount; track $index) {
9
+ <i [class]="iconName + ' path'+path"></i>
10
+ }
11
+ </i>
12
+ `,
13
+ changeDetection: ChangeDetectionStrategy.OnPush
14
+ })
15
+ export class IcoMoonIconComponent {
16
+ @Input({ required: true }) iconName!: string;
17
+ @Input() iconClass!: string;
18
+ @Input() iconPathCount = 0;
19
+
20
+ get getPathCount() {
21
+ return Array.from({ length: this.iconPathCount }, (_, i) => i + 1);
22
+ }
23
+ }
@@ -0,0 +1,17 @@
1
+ <p [class]="styleClass">
2
+ {{ isExpanded ? text : (text | slice : 0 : maxCharacters) }}
3
+ @if (text.length > maxCharacters && !isExpanded) {
4
+ <span>...</span>
5
+ }
6
+ @if (isExpanded) {
7
+ <span>
8
+ {{ text | slice : maxCharacters + 1 : text.length }}
9
+ </span>
10
+ }
11
+ <br>
12
+ @if (text.length > maxCharacters) {
13
+ <span class="text-primary_light cursor-pointer" (click)="toggleReadMore()">
14
+ {{ isExpanded ? ('less' | translate) : ('more' | translate) }}
15
+ </span>
16
+ }
17
+ </p>
File without changes
@@ -0,0 +1,21 @@
1
+ import { ComponentFixture, TestBed } from "@angular/core/testing";
2
+ import { ReadMoreComponent } from "./read-more.component";
3
+
4
+ describe("ReadMoreComponent", () => {
5
+ let component: ReadMoreComponent;
6
+ let fixture: ComponentFixture<ReadMoreComponent>;
7
+
8
+ beforeEach(async () => {
9
+ await TestBed.configureTestingModule({
10
+ imports: [ReadMoreComponent]
11
+ }).compileComponents();
12
+
13
+ fixture = TestBed.createComponent(ReadMoreComponent);
14
+ component = fixture.componentInstance;
15
+ fixture.detectChanges();
16
+ });
17
+
18
+ it("should create", () => {
19
+ expect(component).toBeTruthy();
20
+ });
21
+ });
@@ -0,0 +1,21 @@
1
+ import { Component, Input } from "@angular/core";
2
+ import {SlicePipe} from "@angular/common";
3
+ import { TranslateModule } from "@ngx-translate/core";
4
+
5
+ @Component({
6
+ selector: "app-read-more",
7
+ standalone: true,
8
+ imports: [TranslateModule, SlicePipe],
9
+ templateUrl: "./read-more.component.html",
10
+ styleUrl: "./read-more.component.scss"
11
+ })
12
+ export class ReadMoreComponent {
13
+ @Input({ required: true }) text = "";
14
+ @Input() styleClass = "";
15
+ @Input() maxCharacters = 100;
16
+ isExpanded = false;
17
+
18
+ toggleReadMore() {
19
+ this.isExpanded = !this.isExpanded;
20
+ }
21
+ }
@@ -0,0 +1,24 @@
1
+ <!-- TODO refactor position sidebar based on html dir-->
2
+ <p-drawer
3
+ (onHide)="hideSidebar()"
4
+ (onShow)="onShow.emit($event)"
5
+ [(visible)]="show"
6
+ [closable]="closable"
7
+ [closeOnEscape]="closeOnEscape"
8
+ [dismissible]="dismissible"
9
+ [ngClass]="{ show: show }"
10
+ [position]="'left'"
11
+ appendTo="body"
12
+ styleClass="p-drawer-{{ sidebarSize }} custom-content bg-white {{ styleClass }}">
13
+ <ng-template pTemplate="header">
14
+ <p class="truncate" [pTooltip]="title">{{ title }}</p>
15
+ </ng-template>
16
+ @if (contentTemplate) {
17
+ <ng-template pTemplate="content">
18
+ <ng-container *ngTemplateOutlet="contentTemplate"></ng-container>
19
+ </ng-template>
20
+ <ng-template pTemplate="footer">
21
+ <ng-container *ngTemplateOutlet="footerTemplate"></ng-container>
22
+ </ng-template>
23
+ }
24
+ </p-drawer>