@corp-products/ui-components 3.2.9 → 3.3.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.
Files changed (138) hide show
  1. package/fesm2022/corp-products-ui-components.mjs +1999 -0
  2. package/fesm2022/corp-products-ui-components.mjs.map +1 -0
  3. package/index.d.ts +653 -0
  4. package/package.json +36 -22
  5. package/ng-package.json +0 -7
  6. package/src/enums/date-formatter.ts +0 -21
  7. package/src/helper/date-handler.ts +0 -142
  8. package/src/lib/app-accordion/app-accordion.component.html +0 -15
  9. package/src/lib/app-accordion/app-accordion.component.scss +0 -0
  10. package/src/lib/app-accordion/app-accordion.component.spec.ts +0 -21
  11. package/src/lib/app-accordion/app-accordion.component.ts +0 -21
  12. package/src/lib/app-accordion/index.ts +0 -2
  13. package/src/lib/app-breadcrumb/app-breadcrumb.component.html +0 -7
  14. package/src/lib/app-breadcrumb/app-breadcrumb.component.scss +0 -25
  15. package/src/lib/app-breadcrumb/app-breadcrumb.component.ts +0 -140
  16. package/src/lib/app-breadcrumb/app-breadcrumb.interface.ts +0 -15
  17. package/src/lib/app-button/app-button.component.html +0 -7
  18. package/src/lib/app-button/app-button.component.scss +0 -0
  19. package/src/lib/app-button/app-button.component.ts +0 -14
  20. package/src/lib/app-button/app-button.ts +0 -15
  21. package/src/lib/app-button/index.ts +0 -2
  22. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.html +0 -22
  23. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.scss +0 -39
  24. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.spec.ts +0 -21
  25. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.ts +0 -43
  26. package/src/lib/app-dropdown-menu/app-dropdown-menu.ts +0 -17
  27. package/src/lib/app-dropdown-menu/index.ts +0 -2
  28. package/src/lib/app-dropdown-menu/menu-popup.pipe.ts +0 -18
  29. package/src/lib/app-header/app-header.component.html +0 -26
  30. package/src/lib/app-header/app-header.component.scss +0 -0
  31. package/src/lib/app-header/app-header.component.ts +0 -43
  32. package/src/lib/app-side-menu/app-side-menu.component.html +0 -20
  33. package/src/lib/app-side-menu/app-side-menu.component.ts +0 -28
  34. package/src/lib/app-side-menu/routes-names.ts +0 -28
  35. package/src/lib/app-side-menu/side-menu-items.ts +0 -45
  36. package/src/lib/app-side-menu/side-menu.ts +0 -12
  37. package/src/lib/app-tabs/app-tab.interface.ts +0 -27
  38. package/src/lib/app-tabs/app-tabs.component.html +0 -37
  39. package/src/lib/app-tabs/app-tabs.component.scss +0 -103
  40. package/src/lib/app-tabs/app-tabs.component.spec.ts +0 -21
  41. package/src/lib/app-tabs/app-tabs.component.ts +0 -67
  42. package/src/lib/app-tabs/index.ts +0 -2
  43. package/src/lib/bottom-sheet/bottom-sheet.component.html +0 -18
  44. package/src/lib/bottom-sheet/bottom-sheet.component.scss +0 -31
  45. package/src/lib/bottom-sheet/bottom-sheet.component.ts +0 -26
  46. package/src/lib/confirmation-dialog/confirmation-dialog.component.html +0 -37
  47. package/src/lib/confirmation-dialog/confirmation-dialog.component.scss +0 -0
  48. package/src/lib/confirmation-dialog/confirmation-dialog.component.spec.ts +0 -22
  49. package/src/lib/confirmation-dialog/confirmation-dialog.component.ts +0 -64
  50. package/src/lib/confirmation-dialog/confirmation-dialog.interface.ts +0 -13
  51. package/src/lib/confirmation-dialog/confirmation-dialog.service.ts +0 -34
  52. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.html +0 -27
  53. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.scss +0 -22
  54. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.ts +0 -64
  55. package/src/lib/dual-calender/dual-calendar.component.html +0 -31
  56. package/src/lib/dual-calender/dual-calendar.component.scss +0 -229
  57. package/src/lib/dual-calender/dual-calendar.component.ts +0 -107
  58. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.html +0 -10
  59. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.scss +0 -0
  60. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.spec.ts +0 -21
  61. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.ts +0 -59
  62. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.html +0 -10
  63. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.scss +0 -0
  64. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.spec.ts +0 -21
  65. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.ts +0 -59
  66. package/src/lib/dual-calender/services/gregorian-i18n.service.ts +0 -123
  67. package/src/lib/dual-calender/services/islamic-i18n.service.ts +0 -119
  68. package/src/lib/dual-calender/utils/date-i18n.utils.ts +0 -58
  69. package/src/lib/dynamic-form/dynamic-form.component.html +0 -86
  70. package/src/lib/dynamic-form/dynamic-form.component.scss +0 -0
  71. package/src/lib/dynamic-form/dynamic-form.component.spec.ts +0 -21
  72. package/src/lib/dynamic-form/dynamic-form.component.ts +0 -58
  73. package/src/lib/dynamic-form/dynamic-form.interface.ts +0 -94
  74. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.html +0 -32
  75. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.scss +0 -3
  76. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.ts +0 -82
  77. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.config.ts +0 -31
  78. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.service.ts +0 -41
  79. package/src/lib/form-components/@utils/form-utils.ts +0 -12
  80. package/src/lib/form-components/@utils/validations/error-keys.enum.ts +0 -24
  81. package/src/lib/form-components/@utils/validations/form-validation.service.ts +0 -68
  82. package/src/lib/form-components/@utils/validations/index.ts +0 -3
  83. package/src/lib/form-components/@utils/validations/validation-message.pipe.ts +0 -24
  84. package/src/lib/form-components/components/auto-complete/auto-complete.component.html +0 -35
  85. package/src/lib/form-components/components/auto-complete/auto-complete.component.scss +0 -7
  86. package/src/lib/form-components/components/auto-complete/auto-complete.component.spec.ts +0 -21
  87. package/src/lib/form-components/components/auto-complete/auto-complete.component.ts +0 -57
  88. package/src/lib/form-components/components/base-input.component.ts +0 -35
  89. package/src/lib/form-components/components/date-picker/date-picker.component.html +0 -41
  90. package/src/lib/form-components/components/date-picker/date-picker.component.scss +0 -16
  91. package/src/lib/form-components/components/date-picker/date-picker.component.spec.ts +0 -21
  92. package/src/lib/form-components/components/date-picker/date-picker.component.ts +0 -54
  93. package/src/lib/form-components/components/input/input.component.html +0 -63
  94. package/src/lib/form-components/components/input/input.component.scss +0 -41
  95. package/src/lib/form-components/components/input/input.component.spec.ts +0 -21
  96. package/src/lib/form-components/components/input/input.component.ts +0 -45
  97. package/src/lib/form-components/components/select/select.component.html +0 -111
  98. package/src/lib/form-components/components/select/select.component.scss +0 -43
  99. package/src/lib/form-components/components/select/select.component.spec.ts +0 -21
  100. package/src/lib/form-components/components/select/select.component.ts +0 -56
  101. package/src/lib/form-components/components/select-button/select-button.component.html +0 -21
  102. package/src/lib/form-components/components/select-button/select-button.component.scss +0 -0
  103. package/src/lib/form-components/components/select-button/select-button.component.spec.ts +0 -21
  104. package/src/lib/form-components/components/select-button/select-button.component.ts +0 -22
  105. package/src/lib/form-components/components/switcher/switch.component.html +0 -5
  106. package/src/lib/form-components/components/switcher/switch.component.scss +0 -0
  107. package/src/lib/form-components/components/switcher/switch.component.spec.ts +0 -21
  108. package/src/lib/form-components/components/switcher/switch.component.ts +0 -25
  109. package/src/lib/form-components/index.ts +0 -9
  110. package/src/lib/form-components/interfaces/index.ts +0 -1
  111. package/src/lib/form-components/interfaces/label-value.ts +0 -4
  112. package/src/lib/ico-moon-icon/ico-moon-icon.component.ts +0 -23
  113. package/src/lib/read-more/read-more.component.html +0 -17
  114. package/src/lib/read-more/read-more.component.scss +0 -0
  115. package/src/lib/read-more/read-more.component.spec.ts +0 -21
  116. package/src/lib/read-more/read-more.component.ts +0 -21
  117. package/src/lib/side-bar/side-bar.component.html +0 -24
  118. package/src/lib/side-bar/side-bar.component.scss +0 -22
  119. package/src/lib/side-bar/side-bar.component.spec.ts +0 -21
  120. package/src/lib/side-bar/side-bar.component.ts +0 -33
  121. package/src/lib/side-bar-dynamic/data-injector.pipe.ts +0 -15
  122. package/src/lib/side-bar-dynamic/dynamic-sidebar.service.ts +0 -116
  123. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.html +0 -42
  124. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.scss +0 -5
  125. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.spec.ts +0 -21
  126. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.ts +0 -37
  127. package/src/lib/side-bar-dynamic/side-bar-utils.ts +0 -30
  128. package/src/lib/side-bar-dynamic/sidebar-config.ts +0 -48
  129. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.html +0 -20
  130. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.scss +0 -0
  131. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.spec.ts +0 -21
  132. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.ts +0 -21
  133. package/src/lib/user-info/user-info.component.html +0 -10
  134. package/src/lib/user-info/user-info.component.ts +0 -11
  135. package/src/public-api.ts +0 -26
  136. package/tsconfig.lib.json +0 -18
  137. package/tsconfig.lib.prod.json +0 -11
  138. package/tsconfig.spec.json +0 -14
@@ -1,63 +0,0 @@
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>
@@ -1,41 +0,0 @@
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
- }
@@ -1,21 +0,0 @@
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
- });
@@ -1,45 +0,0 @@
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
- }
@@ -1,111 +0,0 @@
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>
@@ -1,43 +0,0 @@
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
-
@@ -1,21 +0,0 @@
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
- });
@@ -1,56 +0,0 @@
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
- }
@@ -1,21 +0,0 @@
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>
@@ -1,21 +0,0 @@
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
- });
@@ -1,22 +0,0 @@
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
- }
@@ -1,5 +0,0 @@
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>
@@ -1,21 +0,0 @@
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
- });
@@ -1,25 +0,0 @@
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
- }
@@ -1,9 +0,0 @@
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';
@@ -1 +0,0 @@
1
- export * from "./label-value";
@@ -1,4 +0,0 @@
1
- export interface LabelValue<T> {
2
- label: string;
3
- value: T | any;
4
- }
@@ -1,23 +0,0 @@
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
- }
@@ -1,17 +0,0 @@
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
@@ -1,21 +0,0 @@
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
- });
@@ -1,21 +0,0 @@
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
- }
@@ -1,24 +0,0 @@
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>