@corp-products/ui-components 3.6.1 → 3.6.2

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 (146) hide show
  1. package/fesm2022/corp-products-ui-components.mjs +2267 -0
  2. package/fesm2022/corp-products-ui-components.mjs.map +1 -0
  3. package/index.d.ts +724 -0
  4. package/package.json +36 -22
  5. package/ng-package.json +0 -7
  6. package/src/enums/date-formatter.ts +0 -22
  7. package/src/helper/date-handler.ts +0 -142
  8. package/src/lib/alert-dialog/alert-dialog.component.html +0 -22
  9. package/src/lib/alert-dialog/alert-dialog.component.scss +0 -0
  10. package/src/lib/alert-dialog/alert-dialog.component.spec.ts +0 -22
  11. package/src/lib/alert-dialog/alert-dialog.component.ts +0 -44
  12. package/src/lib/alert-dialog/alert-dialog.interface.ts +0 -6
  13. package/src/lib/alert-dialog/alert-dialog.service.ts +0 -33
  14. package/src/lib/app-accordion/app-accordion.component.html +0 -15
  15. package/src/lib/app-accordion/app-accordion.component.scss +0 -0
  16. package/src/lib/app-accordion/app-accordion.component.spec.ts +0 -21
  17. package/src/lib/app-accordion/app-accordion.component.ts +0 -21
  18. package/src/lib/app-accordion/index.ts +0 -2
  19. package/src/lib/app-breadcrumb/app-breadcrumb.component.html +0 -7
  20. package/src/lib/app-breadcrumb/app-breadcrumb.component.scss +0 -25
  21. package/src/lib/app-breadcrumb/app-breadcrumb.component.ts +0 -140
  22. package/src/lib/app-breadcrumb/app-breadcrumb.interface.ts +0 -15
  23. package/src/lib/app-button/app-button.component.html +0 -7
  24. package/src/lib/app-button/app-button.component.scss +0 -0
  25. package/src/lib/app-button/app-button.component.ts +0 -14
  26. package/src/lib/app-button/app-button.ts +0 -15
  27. package/src/lib/app-button/index.ts +0 -2
  28. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.html +0 -22
  29. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.scss +0 -39
  30. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.spec.ts +0 -21
  31. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.ts +0 -43
  32. package/src/lib/app-dropdown-menu/app-dropdown-menu.ts +0 -17
  33. package/src/lib/app-dropdown-menu/index.ts +0 -2
  34. package/src/lib/app-dropdown-menu/menu-popup.pipe.ts +0 -18
  35. package/src/lib/app-header/app-header.component.html +0 -26
  36. package/src/lib/app-header/app-header.component.scss +0 -0
  37. package/src/lib/app-header/app-header.component.ts +0 -43
  38. package/src/lib/app-side-menu/app-side-menu.component.html +0 -20
  39. package/src/lib/app-side-menu/app-side-menu.component.ts +0 -28
  40. package/src/lib/app-side-menu/routes-names.ts +0 -28
  41. package/src/lib/app-side-menu/side-menu-items.ts +0 -45
  42. package/src/lib/app-side-menu/side-menu.ts +0 -12
  43. package/src/lib/app-tabs/app-tab.interface.ts +0 -27
  44. package/src/lib/app-tabs/app-tabs.component.html +0 -37
  45. package/src/lib/app-tabs/app-tabs.component.scss +0 -103
  46. package/src/lib/app-tabs/app-tabs.component.spec.ts +0 -21
  47. package/src/lib/app-tabs/app-tabs.component.ts +0 -67
  48. package/src/lib/app-tabs/index.ts +0 -2
  49. package/src/lib/bottom-sheet/bottom-sheet.component.html +0 -18
  50. package/src/lib/bottom-sheet/bottom-sheet.component.scss +0 -31
  51. package/src/lib/bottom-sheet/bottom-sheet.component.ts +0 -26
  52. package/src/lib/confirmation-dialog/confirmation-dialog.component.html +0 -37
  53. package/src/lib/confirmation-dialog/confirmation-dialog.component.scss +0 -0
  54. package/src/lib/confirmation-dialog/confirmation-dialog.component.spec.ts +0 -22
  55. package/src/lib/confirmation-dialog/confirmation-dialog.component.ts +0 -64
  56. package/src/lib/confirmation-dialog/confirmation-dialog.interface.ts +0 -13
  57. package/src/lib/confirmation-dialog/confirmation-dialog.service.ts +0 -34
  58. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.html +0 -27
  59. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.scss +0 -22
  60. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.ts +0 -64
  61. package/src/lib/dual-calender/dual-calendar.component.html +0 -32
  62. package/src/lib/dual-calender/dual-calendar.component.scss +0 -265
  63. package/src/lib/dual-calender/dual-calendar.component.ts +0 -158
  64. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.html +0 -21
  65. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.scss +0 -0
  66. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.spec.ts +0 -21
  67. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.ts +0 -65
  68. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.html +0 -10
  69. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.scss +0 -0
  70. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.spec.ts +0 -21
  71. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.ts +0 -66
  72. package/src/lib/dual-calender/services/gregorian-i18n.service.ts +0 -123
  73. package/src/lib/dual-calender/services/islamic-i18n.service.ts +0 -119
  74. package/src/lib/dual-calender/utils/date-i18n.utils.ts +0 -58
  75. package/src/lib/dynamic-form/dynamic-form.component.html +0 -84
  76. package/src/lib/dynamic-form/dynamic-form.component.scss +0 -0
  77. package/src/lib/dynamic-form/dynamic-form.component.spec.ts +0 -21
  78. package/src/lib/dynamic-form/dynamic-form.component.ts +0 -58
  79. package/src/lib/dynamic-form/dynamic-form.interface.ts +0 -96
  80. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.html +0 -32
  81. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.scss +0 -3
  82. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.ts +0 -82
  83. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.config.ts +0 -31
  84. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.service.ts +0 -41
  85. package/src/lib/form-components/@utils/form-utils.ts +0 -12
  86. package/src/lib/form-components/@utils/validations/error-keys.enum.ts +0 -25
  87. package/src/lib/form-components/@utils/validations/form-validation.service.ts +0 -68
  88. package/src/lib/form-components/@utils/validations/index.ts +0 -4
  89. package/src/lib/form-components/@utils/validations/numbers-only.validator.ts +0 -10
  90. package/src/lib/form-components/@utils/validations/validation-message.pipe.ts +0 -24
  91. package/src/lib/form-components/components/auto-complete/auto-complete.component.html +0 -35
  92. package/src/lib/form-components/components/auto-complete/auto-complete.component.scss +0 -12
  93. package/src/lib/form-components/components/auto-complete/auto-complete.component.spec.ts +0 -21
  94. package/src/lib/form-components/components/auto-complete/auto-complete.component.ts +0 -82
  95. package/src/lib/form-components/components/base-input.component.ts +0 -35
  96. package/src/lib/form-components/components/date-picker/date-picker.component.html +0 -40
  97. package/src/lib/form-components/components/date-picker/date-picker.component.scss +0 -32
  98. package/src/lib/form-components/components/date-picker/date-picker.component.spec.ts +0 -21
  99. package/src/lib/form-components/components/date-picker/date-picker.component.ts +0 -81
  100. package/src/lib/form-components/components/date-picker/date-picker.validator.ts +0 -38
  101. package/src/lib/form-components/components/input/input.component.html +0 -80
  102. package/src/lib/form-components/components/input/input.component.scss +0 -46
  103. package/src/lib/form-components/components/input/input.component.spec.ts +0 -21
  104. package/src/lib/form-components/components/input/input.component.ts +0 -56
  105. package/src/lib/form-components/components/select/select.component.html +0 -123
  106. package/src/lib/form-components/components/select/select.component.scss +0 -53
  107. package/src/lib/form-components/components/select/select.component.spec.ts +0 -21
  108. package/src/lib/form-components/components/select/select.component.ts +0 -87
  109. package/src/lib/form-components/components/select-button/select-button.component.html +0 -21
  110. package/src/lib/form-components/components/select-button/select-button.component.scss +0 -0
  111. package/src/lib/form-components/components/select-button/select-button.component.spec.ts +0 -21
  112. package/src/lib/form-components/components/select-button/select-button.component.ts +0 -22
  113. package/src/lib/form-components/components/switcher/switch.component.html +0 -5
  114. package/src/lib/form-components/components/switcher/switch.component.scss +0 -0
  115. package/src/lib/form-components/components/switcher/switch.component.spec.ts +0 -21
  116. package/src/lib/form-components/components/switcher/switch.component.ts +0 -25
  117. package/src/lib/form-components/index.ts +0 -9
  118. package/src/lib/form-components/interfaces/index.ts +0 -1
  119. package/src/lib/form-components/interfaces/label-value.ts +0 -4
  120. package/src/lib/ico-moon-icon/ico-moon-icon.component.ts +0 -23
  121. package/src/lib/read-more/read-more.component.html +0 -17
  122. package/src/lib/read-more/read-more.component.scss +0 -0
  123. package/src/lib/read-more/read-more.component.spec.ts +0 -21
  124. package/src/lib/read-more/read-more.component.ts +0 -21
  125. package/src/lib/side-bar/side-bar.component.html +0 -24
  126. package/src/lib/side-bar/side-bar.component.scss +0 -22
  127. package/src/lib/side-bar/side-bar.component.spec.ts +0 -21
  128. package/src/lib/side-bar/side-bar.component.ts +0 -33
  129. package/src/lib/side-bar-dynamic/data-injector.pipe.ts +0 -15
  130. package/src/lib/side-bar-dynamic/dynamic-sidebar.service.ts +0 -116
  131. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.html +0 -42
  132. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.scss +0 -5
  133. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.spec.ts +0 -21
  134. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.ts +0 -37
  135. package/src/lib/side-bar-dynamic/side-bar-utils.ts +0 -30
  136. package/src/lib/side-bar-dynamic/sidebar-config.ts +0 -48
  137. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.html +0 -20
  138. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.scss +0 -0
  139. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.spec.ts +0 -21
  140. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.ts +0 -21
  141. package/src/lib/user-info/user-info.component.html +0 -10
  142. package/src/lib/user-info/user-info.component.ts +0 -11
  143. package/src/public-api.ts +0 -29
  144. package/tsconfig.lib.json +0 -18
  145. package/tsconfig.lib.prod.json +0 -11
  146. package/tsconfig.spec.json +0 -14
@@ -1,31 +0,0 @@
1
- .sidebar {
2
- &.show {
3
- @apply min-w-[550px];
4
- }
5
- }
6
-
7
- .band{
8
- background-color: #DFE0E6;
9
- width: 40px;
10
- height: 4px;
11
- border-radius: 24px;
12
- display: block;
13
- }
14
- .p-drawer-header , .p-drawer-footer{
15
- background-color: var(--gray-100);
16
- }
17
-
18
- .p-drawer-header{
19
- --p-drawer-header-padding: 0.75rem var(--p-overlay-modal-padding);
20
- font-weight: 500;
21
- justify-content: center;
22
- color: #090D0F;
23
- font-size: 20px;
24
- flex-direction: column;
25
-
26
- }
27
-
28
- .p-drawer-content{
29
- padding: 0px !important;
30
- margin: 0px !important;
31
- }
@@ -1,26 +0,0 @@
1
- import { NgClass, NgTemplateOutlet } from "@angular/common";
2
- import { Component, EventEmitter, Input, Output, TemplateRef, ViewEncapsulation } from "@angular/core";
3
- import { PrimeTemplate } from "primeng/api";
4
- import { Drawer } from "primeng/drawer";
5
- import { TooltipModule } from "primeng/tooltip";
6
-
7
- @Component({
8
- selector: "app-bottom-sheet",
9
- standalone: true,
10
- imports: [PrimeTemplate, Drawer, NgClass, NgTemplateOutlet, TooltipModule],
11
- templateUrl: "./bottom-sheet.component.html",
12
- styleUrl: "./bottom-sheet.component.scss",
13
- encapsulation: ViewEncapsulation.None
14
- })
15
- export class BottomSheetComponent {
16
- @Input() show = false;
17
- @Input() contentTemplate!: TemplateRef<unknown>;
18
-
19
- @Output() onHide = new EventEmitter<boolean>();
20
- @Output() onShow = new EventEmitter<boolean>();
21
-
22
- hideBottomSheet() {
23
- this.show = false;
24
- this.onHide.emit(false);
25
- }
26
- }
@@ -1,37 +0,0 @@
1
- @if (dynamicDialogConfig.data) {
2
- <div class="confirmation-dialog">
3
- <div class="dialog-wrapper">
4
- @if (dynamicDialogConfig.data) {
5
- <div class="confirmation-dialog__content my-4">
6
- @if (dynamicDialogConfig.data.dialogIcon) {
7
- <em [class]="dynamicDialogConfig.data.dialogIcon"></em>
8
- }
9
- <p class="confirmation-dialog__message text-xl mb-2">
10
- {{ dynamicDialogConfig.data.message }}
11
- </p>
12
- @if (dynamicDialogConfig.data.hint) {
13
- <p class="confirmation-dialog__hint font-normal text-base">
14
- {{ dynamicDialogConfig.data.hint }}
15
- </p>
16
- }
17
- @if (dynamicDialogConfig.data.inputForm) {
18
- <app-dynamic-form [dynamicFormData]="dialogFormData"></app-dynamic-form>
19
- }
20
- </div>
21
- }
22
- <div class="confirmation-dialog__actions flex gap-2 mt-4">
23
- <app-button [title]="dynamicDialogConfig.data?.confirmLabel || ('actions.confirm' | translate)"
24
- [disabled]="!!(dialogFormData && dialogFormData.formGroup?.invalid)" [severity]="'primary'"
25
- [id]="dynamicDialogConfig.data.confirmBtnId" [icon]="dynamicDialogConfig.data.confirmBtnIcon || ''"
26
- [label]="dynamicDialogConfig.data.confirmBtnLabel"
27
- [iconPos]="dynamicDialogConfig.data.confirmBtnPosition || 'left'" [styleClass]="'confirmation-btn'"
28
- (click)="submit()" />
29
- <app-button [title]="dynamicDialogConfig.data?.closeLabel || ('actions.cancel' | translate)"
30
- [severity]="'primary'" variant="outlined" [label]="dynamicDialogConfig.data.cancelBtnLabel"
31
- [id]="dynamicDialogConfig.data.cancelBtnId" [styleClass]="'cancel-btn confirmation-btn cancel-btn'"
32
- (click)="close()" />
33
- </div>
34
- </div>
35
-
36
- </div>
37
- }
@@ -1,22 +0,0 @@
1
- import { ComponentFixture, TestBed } from "@angular/core/testing";
2
-
3
- import { ConfirmationDialogComponent } from "./confirmation-dialog.component";
4
-
5
- describe("SharedConfirmDialogComponent", () => {
6
- let component: ConfirmationDialogComponent;
7
- let fixture: ComponentFixture<ConfirmationDialogComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [ConfirmationDialogComponent]
12
- }).compileComponents();
13
-
14
- fixture = TestBed.createComponent(ConfirmationDialogComponent);
15
- component = fixture.componentInstance;
16
- fixture.detectChanges();
17
- });
18
-
19
- it("should create", () => {
20
- expect(component).toBeTruthy();
21
- });
22
- });
@@ -1,64 +0,0 @@
1
- import { Component, inject, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
2
- import { NavigationStart, Router } from '@angular/router';
3
- import { TranslatePipe } from '@ngx-translate/core';
4
- import { AvatarModule } from 'primeng/avatar';
5
- import {
6
- DialogService,
7
- DynamicDialogConfig,
8
- DynamicDialogModule,
9
- DynamicDialogRef,
10
- DynamicDialogStyle,
11
- } from 'primeng/dynamicdialog';
12
- import { filter, Subscription } from 'rxjs';
13
- import { AppButtonComponent } from '../app-button/app-button.component';
14
- import { DynamicFormComponent } from '../dynamic-form/dynamic-form.component';
15
- import { DynamicFormData } from '../dynamic-form/dynamic-form.interface';
16
-
17
- @Component({
18
- selector: 'app-confirm-dialog',
19
- templateUrl: './confirmation-dialog.component.html',
20
- styleUrls: ['./confirmation-dialog.component.scss'],
21
- encapsulation: ViewEncapsulation.None,
22
- standalone: true,
23
- imports: [
24
- AppButtonComponent,
25
- AvatarModule,
26
- DynamicDialogModule,
27
- DynamicFormComponent,
28
- TranslatePipe,
29
- ],
30
- providers: [DialogService, DynamicDialogStyle],
31
- })
32
- export class ConfirmationDialogComponent extends DynamicDialogRef implements OnInit, OnDestroy {
33
- router = inject(Router);
34
- dialogService = inject(DialogService);
35
- dynamicDialogConfig = inject(DynamicDialogConfig);
36
- private readonly _ref = inject(DynamicDialogRef);
37
- private readonly _subscription = new Subscription();
38
- dialogFormData: DynamicFormData;
39
-
40
- ngOnDestroy(): void {
41
- this._subscription.unsubscribe();
42
- }
43
- ngOnInit() {
44
- // closing when navigating back from the browser
45
- this._subscription.add(
46
- this.router.events.pipe(filter((event) => event instanceof NavigationStart)).subscribe(() => {
47
- if (this.dynamicDialogConfig) {
48
- this._ref.close(false);
49
- }
50
- })
51
- );
52
- this.dialogFormData = this.dynamicDialogConfig.data?.inputForm;
53
- }
54
- submit() {
55
- // we should pass submitted data when using form dialog
56
- // const submitData = { submitted: true, data: this.dialogFormData?.formGroup?.value };
57
- // this._ref.close(this.dynamicDialogConfig.data.inputForm ? submitData : true);
58
- this._ref.close(true);
59
- }
60
-
61
- override close() {
62
- this._ref.close(false);
63
- }
64
- }
@@ -1,13 +0,0 @@
1
- export interface ConfirmationDialogData {
2
- header: string;
3
- message: string;
4
- confirmBtnId: string;
5
- cancelBtnId: string;
6
- cancelBtnLabel?: string;
7
- confirmBtnLabel?: string;
8
- confirmBtnIcon?: string;
9
- confirmBtnPosition?: string;
10
- hint?: string;
11
- inputForm?: any;
12
- breakpoints?: any;
13
- }
@@ -1,34 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';
3
- import { Observable, of } from 'rxjs';
4
- import { filter, map } from 'rxjs/operators';
5
- import { ConfirmationDialogComponent } from './confirmation-dialog.component';
6
- import { ConfirmationDialogData } from './confirmation-dialog.interface';
7
-
8
- @Injectable({
9
- providedIn: 'root',
10
- })
11
- export class ConfirmationDialogService {
12
- constructor(private dialogService: DialogService) { }
13
-
14
- open(data: ConfirmationDialogData): Observable<boolean> {
15
- const ref: DynamicDialogRef | null = this.dialogService.open(ConfirmationDialogComponent, {
16
- data,
17
- header: data.header,
18
- showHeader: true,
19
- width: '600px',
20
- closable: true,
21
- modal: true,
22
- styleClass: 'confirmation-dialog-wrapper',
23
- breakpoints: data.breakpoints,
24
- });
25
- if (!ref) {
26
- return of(false); // or EMPTY / throwError — depending on your logic
27
- }
28
- // Emit true/false when dialog closes
29
- return ref.onClose.pipe(
30
- filter((res) => res !== undefined),
31
- map((res) => !!res)
32
- );
33
- }
34
- }
@@ -1,27 +0,0 @@
1
- <div class="field flex flex-col gap-2 my-3 relative">
2
- <p-floatlabel [variant]="variant">
3
- <input [id]="inputId" [type]="'text-float-label'" [formControl]="control" [readonly]="true" (focus)="openCalendar(true)"
4
- (click)="openCalendar(true)" [pSize]="'small'"
5
- [class]="
6
- 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'
7
- " [disabled]="disabled" [name]="name" pInputText
8
- class="w-full"
9
- [ngClass]="{ 'p-invalid ng-dirty ng-invalid': isInvalid, 'basic-style': basicInput, 'no-style':noStyle}" />
10
- <label [for]="inputId">
11
- {{ label }}
12
- @if (required) {
13
- <span [class.text-required]="required">*</span>
14
- }
15
- </label>
16
- </p-floatlabel>
17
- @if (hint) {
18
- <small class="p-mt-1">{{ hint }}</small>
19
- }
20
- @if (isInvalid && (control.dirty || control.touched)) {
21
- <small class="p-error">
22
- @for (error of control.errors | validationErrors; track error) {
23
- {{ error }}<br>
24
- }
25
- </small>
26
- }
27
- </div>
@@ -1,22 +0,0 @@
1
- .p-datepicker-clear-icon {
2
- @apply cursor-pointer absolute top-[50%] left-[13px] -translate-y-1/2 text-[var(--p-datepicker-input-icon-color)] ml-[calc(var(--p-icon-size))] leading-none;
3
- }
4
-
5
- /* Hide default calendar inside panel */
6
-
7
- .my-custom-datepicker-panel {
8
- display: none !important;
9
- }
10
-
11
- .d-ltr {
12
- direction: ltr;
13
- }
14
-
15
-
16
- .text-required {
17
- color: red;
18
- }
19
-
20
- .p-error {
21
- color: #dc2626;
22
- }
@@ -1,64 +0,0 @@
1
- import { NgClass } from '@angular/common';
2
- import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
3
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
4
- import { TranslatePipe } from '@ngx-translate/core';
5
- import { DatePicker, DatePickerModule } from 'primeng/datepicker';
6
- import { FloatLabelModule } from 'primeng/floatlabel';
7
- import { ValidationErrorsPipe } from '../../form-components/@utils/validations/validation-message.pipe';
8
- import { BaseInputComponent } from '../../form-components/components/base-input.component';
9
- import { InputText } from 'primeng/inputtext';
10
- @Component({
11
- selector: 'stc-date-picker-switcher',
12
- standalone: true,
13
- imports: [
14
- FormsModule,
15
- ReactiveFormsModule,
16
- NgClass,
17
- InputText,
18
- DatePickerModule,
19
- ValidationErrorsPipe,
20
- TranslatePipe,
21
- FloatLabelModule,
22
- ],
23
- templateUrl: './date-picker-switcher.component.html',
24
- styleUrl: './date-picker-switcher.component.scss',
25
- encapsulation: ViewEncapsulation.None,
26
- })
27
- export class DatePickerSwitcherComponent extends BaseInputComponent implements OnChanges {
28
- @Input() type: 'text' | 'textarea' = 'text';
29
- @Input() contentType: 'text' | 'email' | 'number' = 'text';
30
- @Input() size: 'small' | 'large' = "small";
31
- @Input() prefix: string;
32
- @Input() rows = 2;
33
- @Input() cols = 20;
34
- @Input() autoResize = true;
35
- @Input() basicInput!: boolean;
36
- @Input() noStyle!: boolean;
37
- @Input() hideOptionalLabel: boolean;
38
- @Input() inputDirection: 'ltr' | 'rtl' | 'inherit' = 'inherit';
39
- @Input() variant: 'in' | 'over' | 'on' = 'over';
40
- @Input() defaultColor = '#DFE0E6'
41
- @Input() formattedDate = '';
42
- @Output() openCalender = new EventEmitter<boolean>();
43
- constructor( ) {
44
- super();
45
- }
46
- ngOnChanges(changes: SimpleChanges) {
47
- if (changes['formattedDate'] && changes['formattedDate'].currentValue) {
48
- // Update the FormControl value if parent changes the formattedDate
49
- this.control.setValue(changes['formattedDate'].currentValue, { emitEvent: false });
50
- }
51
- }
52
- override ngOnInit() {
53
- this.control.setValue(this.formattedDate);
54
- }
55
-
56
- clearButtonClick(e: any) {
57
- this.control.setValue(null);
58
- }
59
-
60
- openCalendar(isOpen: boolean) {
61
- this.openCalender.emit(isOpen)
62
-
63
- }
64
- }
@@ -1,32 +0,0 @@
1
- <div class="calender-content" #calendarContainer>
2
- @if(isDatePickerShow) {
3
- <stc-date-picker-switcher [variant]="'in'" [label]="label" id="dateId" (openCalender)="showCalender($event)"
4
- [control]="control" [formattedDate]='selectedDate' >
5
- </stc-date-picker-switcher>
6
- }
7
-
8
- <!-- calender.html -->
9
- <div [dir]="currentLang() === 'ar' ? 'rtl' : 'ltr'" class="p-2 calendar-wrapper " [@slideDown]="isShown ? 'open' : 'closed'" >
10
- <div class="header-tabs">
11
- <div class="header-label">{{'calender.calender_type' | translate}}</div>
12
- <div class="tabs">
13
- <button class="tab-button" [class.active]="mode === 'gregorian'" type="button" (click)=" mode='gregorian'">
14
- {{'calender.gregorian' | translate}}
15
- </button>
16
- <button class="tab-button" [class.active]="mode === 'hijri'" type="button" (click)=" mode='hijri'">
17
- {{'calender.hijri' | translate}}
18
- </button>
19
- </div>
20
- </div>
21
- @if(mode === 'gregorian') {
22
- <app-gregorian-calendar [model]="gregorianModel" [language]="currentLang()"
23
- (dateSelected)="onSelectGregorian($event)">
24
- </app-gregorian-calendar>
25
- }
26
-
27
- @if(mode === 'hijri') {
28
- <app-hijri-calendar [model]="hijriModel" [language]="currentLang()" (dateSelected)="onSelectHijri($event)">
29
- </app-hijri-calendar>
30
- }
31
- </div>
32
- </div>
@@ -1,265 +0,0 @@
1
- .calendar-wrapper {
2
- max-width: 375px;
3
- padding: 15px;
4
-
5
- .ngb-dp-header {
6
- .ngb-dp-arrow.ngb-dp-arrow-next {
7
- margin: 0 10px;
8
- max-width: 20px;
9
- }
10
- }
11
-
12
- .rtl {
13
- .ngb-dp-header {
14
- .ngb-dp-arrow.ngb-dp-arrow-next {
15
- inset-inline-end: -6px;
16
- transform: rotate(180deg);
17
- margin: 0 10px;
18
- max-width: 20px;
19
- }
20
-
21
- .ngb-dp-arrow.ngb-dp-arrow-prev {
22
- inset-inline-end: 22px;
23
- transform: rotate(180deg);
24
- }
25
- }
26
- }
27
-
28
- .ltr {
29
- .ngb-dp-header {
30
- .ngb-dp-arrow.ngb-dp-arrow-next {
31
- inset-inline-end: -4px;
32
- }
33
-
34
- .ngb-dp-arrow.ngb-dp-arrow-prev {
35
- inset-inline-end: 11px;
36
- }
37
- }
38
- }
39
- }
40
-
41
- .header-tabs {
42
- display: flex;
43
- justify-content: space-between;
44
- align-items: center;
45
- gap: 10px;
46
- margin-bottom: 10px;
47
- }
48
-
49
- .tabs {
50
-
51
- background: #f0f0f5;
52
- padding: 3px;
53
- border-radius: 2px;
54
- }
55
-
56
- .tab-button {
57
- flex: 1;
58
- padding: 6px 10px;
59
- font-size: 14px;
60
- background: #f0f0f5;
61
- border: none;
62
- border-radius: 6px;
63
- cursor: pointer;
64
- transition: 0.3s;
65
- }
66
-
67
- .tab-button.active {
68
- background: #dcd6f8;
69
- color: #4a3fb4;
70
- font-weight: 600;
71
- }
72
-
73
- .custom-datepicker {
74
- width: 100%;
75
- background: white;
76
- border: 1px solid #e5e5e5;
77
- border-radius: 8px;
78
- padding: 12px;
79
- }
80
-
81
- /* Calendar Header (Month + Arrows) */
82
- .custom-datepicker .ngb-dp-header {
83
- display: flex;
84
- justify-content: space-between;
85
- align-items: center;
86
- margin-bottom: 12px;
87
- max-width: 375px;
88
- }
89
-
90
- .custom-datepicker .ngb-dp-arrow-btn {
91
- background: none;
92
- border: none;
93
- cursor: pointer;
94
- padding: 4px;
95
-
96
- }
97
-
98
- /* Weekdays Row */
99
- .custom-datepicker .ngb-dp-weekdays {
100
- margin-bottom: 6px;
101
- }
102
-
103
- .custom-datepicker .ngb-dp-weekday {
104
- color: #9b9b9b;
105
- font-weight: 600;
106
- text-align: center;
107
- }
108
-
109
-
110
-
111
- /* Today style */
112
- .custom-day.today {
113
- border: 1px solid #6a41d8;
114
- border-radius: 8px;
115
- }
116
-
117
- /* Outside month */
118
- .custom-day.outside {
119
- opacity: 0.3;
120
- }
121
-
122
- /* Disabled */
123
- .custom-day.disabled {
124
- opacity: 0.2;
125
- pointer-events: none;
126
- }
127
-
128
- .calender-content {
129
- position: relative;
130
- }
131
-
132
- .calendar-wrapper {
133
- position: absolute;
134
- top: 100%;
135
- left: 0;
136
- z-index: 50;
137
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
138
- background-color: #fff;
139
- border-radius: 4px;
140
- overflow: hidden;
141
- }
142
-
143
-
144
- .ngb-datepicker {
145
- width: 100%;
146
-
147
- .ngb-dp-month {}
148
- }
149
-
150
- .custom-day {
151
- display: inline-flex;
152
- justify-content: center;
153
- align-items: center;
154
- margin: 2px;
155
- border-radius: 50%;
156
- cursor: pointer;
157
- font-weight: 500;
158
- }
159
-
160
- .custom-day.today {
161
- color: #4F008D;
162
- border: 0 !important;
163
-
164
- }
165
-
166
- .ngb-dp-day:has(.selected) {
167
- background-color: #EDE6F4 !important;
168
- border: 0 !important;
169
- color: #4F008D !important;
170
- border-radius: 2px;
171
- }
172
-
173
- .custom-day.outside {
174
- color: #ccc !important;
175
- }
176
-
177
- .custom-day.disabled {
178
- color: #aaa !important;
179
- pointer-events: none !important;
180
- }
181
-
182
- .ngb-dp-day,
183
- .ngb-dp-weekday,
184
- .ngb-dp-week-number {
185
- width: 38px !important;
186
- height: 44px !important;
187
- display: flex;
188
- margin: 5px;
189
- justify-content: center;
190
- align-items: center;
191
- }
192
-
193
- .ngb-dp-month:first-child .ngb-dp-week {
194
- padding: 0 !important;
195
- }
196
-
197
- .ngb-dp-month:last-child .ngb-dp-week {
198
- padding: 0 !important;
199
- }
200
-
201
- .ngb-dp-arrow-btn {
202
- margin-inline-end: 0 !important;
203
- outline: 0 !important;
204
- padding: 0 !important;
205
- margin: 0 !important;
206
- }
207
-
208
- .ngb-dp-header {
209
- position: relative;
210
-
211
- .ngb-dp-arrow {
212
- position: absolute;
213
-
214
- &.ngb-dp-arrow-prev {
215
- inset-inline-end: 0;
216
- }
217
-
218
- &.ngb-dp-arrow-next {
219
- inset-inline-end: 15px;
220
- }
221
-
222
- &:focus-visible,
223
- .btn:focus-visible {
224
- outline: 0 !important;
225
- }
226
- }
227
-
228
- .visually-hidden {
229
- display: none;
230
- }
231
- }
232
-
233
- .ngb-dp-navigation-select {
234
- max-width: 140px;
235
- }
236
-
237
- .ngb-dp-navigation-select {
238
- select {
239
- border: 0;
240
-
241
- &:focus-visible {
242
- outline: 0;
243
- }
244
- }
245
- }
246
-
247
- .ngb-datepicker-navigation-select>.form-select {
248
- font-size: 14px;
249
- font-weight: bold;
250
- }
251
-
252
- .ngb-dp-navigation-select,
253
- .form-select:first-child {
254
- appearance: none !important;
255
- -webkit-appearance: none;
256
- -moz-appearance: none;
257
- }
258
-
259
-
260
-
261
- .ngb-dp-navigation-chevron {
262
- font-size: 18px;
263
- border-width: .1em .1em 0 0 !important;
264
- border-color: #000;
265
- }