@corp-products/ui-components 3.6.0 → 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 (148) 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 -25
  5. package/.storybook/main.ts +0 -12
  6. package/debug-storybook.log +0 -53
  7. package/ng-package.json +0 -7
  8. package/src/enums/date-formatter.ts +0 -22
  9. package/src/helper/date-handler.ts +0 -142
  10. package/src/lib/alert-dialog/alert-dialog.component.html +0 -22
  11. package/src/lib/alert-dialog/alert-dialog.component.scss +0 -0
  12. package/src/lib/alert-dialog/alert-dialog.component.spec.ts +0 -22
  13. package/src/lib/alert-dialog/alert-dialog.component.ts +0 -44
  14. package/src/lib/alert-dialog/alert-dialog.interface.ts +0 -6
  15. package/src/lib/alert-dialog/alert-dialog.service.ts +0 -33
  16. package/src/lib/app-accordion/app-accordion.component.html +0 -15
  17. package/src/lib/app-accordion/app-accordion.component.scss +0 -0
  18. package/src/lib/app-accordion/app-accordion.component.spec.ts +0 -21
  19. package/src/lib/app-accordion/app-accordion.component.ts +0 -21
  20. package/src/lib/app-accordion/index.ts +0 -2
  21. package/src/lib/app-breadcrumb/app-breadcrumb.component.html +0 -7
  22. package/src/lib/app-breadcrumb/app-breadcrumb.component.scss +0 -25
  23. package/src/lib/app-breadcrumb/app-breadcrumb.component.ts +0 -140
  24. package/src/lib/app-breadcrumb/app-breadcrumb.interface.ts +0 -15
  25. package/src/lib/app-button/app-button.component.html +0 -7
  26. package/src/lib/app-button/app-button.component.scss +0 -0
  27. package/src/lib/app-button/app-button.component.ts +0 -14
  28. package/src/lib/app-button/app-button.ts +0 -15
  29. package/src/lib/app-button/index.ts +0 -2
  30. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.html +0 -22
  31. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.scss +0 -39
  32. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.spec.ts +0 -21
  33. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.ts +0 -43
  34. package/src/lib/app-dropdown-menu/app-dropdown-menu.ts +0 -17
  35. package/src/lib/app-dropdown-menu/index.ts +0 -2
  36. package/src/lib/app-dropdown-menu/menu-popup.pipe.ts +0 -18
  37. package/src/lib/app-header/app-header.component.html +0 -26
  38. package/src/lib/app-header/app-header.component.scss +0 -0
  39. package/src/lib/app-header/app-header.component.ts +0 -43
  40. package/src/lib/app-side-menu/app-side-menu.component.html +0 -20
  41. package/src/lib/app-side-menu/app-side-menu.component.ts +0 -28
  42. package/src/lib/app-side-menu/routes-names.ts +0 -28
  43. package/src/lib/app-side-menu/side-menu-items.ts +0 -45
  44. package/src/lib/app-side-menu/side-menu.ts +0 -12
  45. package/src/lib/app-tabs/app-tab.interface.ts +0 -27
  46. package/src/lib/app-tabs/app-tabs.component.html +0 -37
  47. package/src/lib/app-tabs/app-tabs.component.scss +0 -103
  48. package/src/lib/app-tabs/app-tabs.component.spec.ts +0 -21
  49. package/src/lib/app-tabs/app-tabs.component.ts +0 -67
  50. package/src/lib/app-tabs/index.ts +0 -2
  51. package/src/lib/bottom-sheet/bottom-sheet.component.html +0 -18
  52. package/src/lib/bottom-sheet/bottom-sheet.component.scss +0 -31
  53. package/src/lib/bottom-sheet/bottom-sheet.component.ts +0 -26
  54. package/src/lib/confirmation-dialog/confirmation-dialog.component.html +0 -37
  55. package/src/lib/confirmation-dialog/confirmation-dialog.component.scss +0 -0
  56. package/src/lib/confirmation-dialog/confirmation-dialog.component.spec.ts +0 -22
  57. package/src/lib/confirmation-dialog/confirmation-dialog.component.ts +0 -64
  58. package/src/lib/confirmation-dialog/confirmation-dialog.interface.ts +0 -13
  59. package/src/lib/confirmation-dialog/confirmation-dialog.service.ts +0 -34
  60. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.html +0 -27
  61. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.scss +0 -22
  62. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.ts +0 -64
  63. package/src/lib/dual-calender/dual-calendar.component.html +0 -30
  64. package/src/lib/dual-calender/dual-calendar.component.scss +0 -265
  65. package/src/lib/dual-calender/dual-calendar.component.ts +0 -157
  66. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.html +0 -21
  67. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.scss +0 -0
  68. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.spec.ts +0 -21
  69. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.ts +0 -65
  70. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.html +0 -10
  71. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.scss +0 -0
  72. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.spec.ts +0 -21
  73. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.ts +0 -66
  74. package/src/lib/dual-calender/services/gregorian-i18n.service.ts +0 -123
  75. package/src/lib/dual-calender/services/islamic-i18n.service.ts +0 -119
  76. package/src/lib/dual-calender/utils/date-i18n.utils.ts +0 -58
  77. package/src/lib/dynamic-form/dynamic-form.component.html +0 -84
  78. package/src/lib/dynamic-form/dynamic-form.component.scss +0 -0
  79. package/src/lib/dynamic-form/dynamic-form.component.spec.ts +0 -21
  80. package/src/lib/dynamic-form/dynamic-form.component.ts +0 -58
  81. package/src/lib/dynamic-form/dynamic-form.interface.ts +0 -96
  82. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.html +0 -32
  83. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.scss +0 -3
  84. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.ts +0 -82
  85. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.config.ts +0 -31
  86. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.service.ts +0 -41
  87. package/src/lib/form-components/@utils/form-utils.ts +0 -12
  88. package/src/lib/form-components/@utils/validations/error-keys.enum.ts +0 -25
  89. package/src/lib/form-components/@utils/validations/form-validation.service.ts +0 -68
  90. package/src/lib/form-components/@utils/validations/index.ts +0 -4
  91. package/src/lib/form-components/@utils/validations/numbers-only.validator.ts +0 -10
  92. package/src/lib/form-components/@utils/validations/validation-message.pipe.ts +0 -24
  93. package/src/lib/form-components/components/auto-complete/auto-complete.component.html +0 -35
  94. package/src/lib/form-components/components/auto-complete/auto-complete.component.scss +0 -12
  95. package/src/lib/form-components/components/auto-complete/auto-complete.component.spec.ts +0 -21
  96. package/src/lib/form-components/components/auto-complete/auto-complete.component.ts +0 -82
  97. package/src/lib/form-components/components/base-input.component.ts +0 -35
  98. package/src/lib/form-components/components/date-picker/date-picker.component.html +0 -40
  99. package/src/lib/form-components/components/date-picker/date-picker.component.scss +0 -32
  100. package/src/lib/form-components/components/date-picker/date-picker.component.spec.ts +0 -21
  101. package/src/lib/form-components/components/date-picker/date-picker.component.ts +0 -81
  102. package/src/lib/form-components/components/date-picker/date-picker.validator.ts +0 -38
  103. package/src/lib/form-components/components/input/input.component.html +0 -80
  104. package/src/lib/form-components/components/input/input.component.scss +0 -46
  105. package/src/lib/form-components/components/input/input.component.spec.ts +0 -21
  106. package/src/lib/form-components/components/input/input.component.ts +0 -56
  107. package/src/lib/form-components/components/select/select.component.html +0 -123
  108. package/src/lib/form-components/components/select/select.component.scss +0 -53
  109. package/src/lib/form-components/components/select/select.component.spec.ts +0 -21
  110. package/src/lib/form-components/components/select/select.component.ts +0 -87
  111. package/src/lib/form-components/components/select-button/select-button.component.html +0 -21
  112. package/src/lib/form-components/components/select-button/select-button.component.scss +0 -0
  113. package/src/lib/form-components/components/select-button/select-button.component.spec.ts +0 -21
  114. package/src/lib/form-components/components/select-button/select-button.component.ts +0 -22
  115. package/src/lib/form-components/components/switcher/switch.component.html +0 -5
  116. package/src/lib/form-components/components/switcher/switch.component.scss +0 -0
  117. package/src/lib/form-components/components/switcher/switch.component.spec.ts +0 -21
  118. package/src/lib/form-components/components/switcher/switch.component.ts +0 -25
  119. package/src/lib/form-components/index.ts +0 -9
  120. package/src/lib/form-components/interfaces/index.ts +0 -1
  121. package/src/lib/form-components/interfaces/label-value.ts +0 -4
  122. package/src/lib/ico-moon-icon/ico-moon-icon.component.ts +0 -23
  123. package/src/lib/read-more/read-more.component.html +0 -17
  124. package/src/lib/read-more/read-more.component.scss +0 -0
  125. package/src/lib/read-more/read-more.component.spec.ts +0 -21
  126. package/src/lib/read-more/read-more.component.ts +0 -21
  127. package/src/lib/side-bar/side-bar.component.html +0 -24
  128. package/src/lib/side-bar/side-bar.component.scss +0 -22
  129. package/src/lib/side-bar/side-bar.component.spec.ts +0 -21
  130. package/src/lib/side-bar/side-bar.component.ts +0 -33
  131. package/src/lib/side-bar-dynamic/data-injector.pipe.ts +0 -15
  132. package/src/lib/side-bar-dynamic/dynamic-sidebar.service.ts +0 -116
  133. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.html +0 -42
  134. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.scss +0 -5
  135. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.spec.ts +0 -21
  136. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.ts +0 -37
  137. package/src/lib/side-bar-dynamic/side-bar-utils.ts +0 -30
  138. package/src/lib/side-bar-dynamic/sidebar-config.ts +0 -48
  139. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.html +0 -20
  140. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.scss +0 -0
  141. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.spec.ts +0 -21
  142. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.ts +0 -21
  143. package/src/lib/user-info/user-info.component.html +0 -10
  144. package/src/lib/user-info/user-info.component.ts +0 -11
  145. package/src/public-api.ts +0 -29
  146. package/tsconfig.lib.json +0 -18
  147. package/tsconfig.lib.prod.json +0 -11
  148. package/tsconfig.spec.json +0 -14
@@ -0,0 +1,2267 @@
1
+ import * as i0 from '@angular/core';
2
+ import { ViewEncapsulation, Component, Input, ChangeDetectionStrategy, model, inject, Pipe, EventEmitter, Output, Injectable, Renderer2, ChangeDetectorRef, signal, effect, HostListener, ViewChild, InjectionToken, Injector, createComponent, ViewContainerRef, ApplicationRef, EnvironmentInjector, DestroyRef } from '@angular/core';
3
+ import * as i1 from 'primeng/button';
4
+ import { Button, ButtonModule, ButtonStyle } from 'primeng/button';
5
+ import * as i1$1 from '@angular/common';
6
+ import { CommonModule, NgClass, NgTemplateOutlet, NgIf, JsonPipe, formatDate, NgStyle, SlicePipe, Location, NgComponentOutlet } from '@angular/common';
7
+ import * as i2 from 'primeng/tabs';
8
+ import { TabsModule } from 'primeng/tabs';
9
+ import * as i1$2 from '@ngx-translate/core';
10
+ import { TranslateModule, TranslateService, TranslatePipe } from '@ngx-translate/core';
11
+ import * as i1$7 from '@angular/router';
12
+ import { Router, ActivatedRoute, NavigationEnd, RouterLink, RouterOutlet, NavigationStart, RouterModule } from '@angular/router';
13
+ import { filter, Subject, Subscription, BehaviorSubject, of } from 'rxjs';
14
+ import * as i3 from 'primeng/badge';
15
+ import { BadgeModule } from 'primeng/badge';
16
+ import { Popover } from 'primeng/popover';
17
+ import * as i2$1 from 'primeng/api';
18
+ import { PrimeTemplate } from 'primeng/api';
19
+ import * as i1$9 from 'primeng/drawer';
20
+ import { Drawer, DrawerModule } from 'primeng/drawer';
21
+ import * as i1$3 from 'primeng/tooltip';
22
+ import { TooltipModule } from 'primeng/tooltip';
23
+ import { AvatarModule } from 'primeng/avatar';
24
+ import * as i1$8 from 'primeng/dynamicdialog';
25
+ import { DynamicDialogRef, DialogService, DynamicDialogConfig, DynamicDialogModule, DynamicDialogStyle } from 'primeng/dynamicdialog';
26
+ import * as i1$4 from '@angular/forms';
27
+ import { Validators, ReactiveFormsModule, FormControl, FormsModule } from '@angular/forms';
28
+ import { AutoComplete } from 'primeng/autocomplete';
29
+ import * as i3$1 from 'primeng/floatlabel';
30
+ import { FloatLabel, FloatLabelModule } from 'primeng/floatlabel';
31
+ import { DatePicker, DatePickerModule } from 'primeng/datepicker';
32
+ import { InputText } from 'primeng/inputtext';
33
+ import { Textarea } from 'primeng/textarea';
34
+ import { IconField } from 'primeng/iconfield';
35
+ import { InputIcon } from 'primeng/inputicon';
36
+ import * as i2$2 from 'primeng/selectbutton';
37
+ import { SelectButtonModule } from 'primeng/selectbutton';
38
+ import * as i2$3 from 'primeng/multiselect';
39
+ import { MultiSelectModule } from 'primeng/multiselect';
40
+ import { Select } from 'primeng/select';
41
+ import * as i4 from 'primeng/checkbox';
42
+ import { CheckboxModule } from 'primeng/checkbox';
43
+ import * as i1$5 from 'primeng/toggleswitch';
44
+ import { ToggleSwitchModule } from 'primeng/toggleswitch';
45
+ import * as i1$6 from '@ng-bootstrap/ng-bootstrap';
46
+ import { NgbDatepickerI18n, NgbCalendarIslamicUmalqura, NgbDatepickerModule, NgbCalendar, NgbCalendarGregorian, NgbDate } from '@ng-bootstrap/ng-bootstrap';
47
+ import { trigger, state, transition, style, animate } from '@angular/animations';
48
+ import '@angular/localize/init';
49
+ import * as i2$4 from 'primeng/accordion';
50
+ import { AccordionModule } from 'primeng/accordion';
51
+ import { DividerModule } from 'primeng/divider';
52
+ import { Breadcrumb } from 'primeng/breadcrumb';
53
+ import { filter as filter$1, map } from 'rxjs/operators';
54
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
55
+
56
+ class AppButtonComponent extends Button {
57
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
58
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: AppButtonComponent, isStandalone: true, selector: "app-button", providers: [ButtonStyle], usesInheritance: true, ngImport: i0, template: "<p-button (onFocus)=\"onFocus.emit()\" (onBlur)=\"onBlur.emit()\" (onClick)=\"onClick.emit()\" [size]=\"size\"\r\n [loadingIcon]=\"loadingIcon\" [disabled]=\"disabled\" [iconPos]=\"iconPos\" [icon]=\"icon\" [label]=\"label\"\r\n [rounded]=\"rounded\" [severity]=\"severity\" [styleClass]=\"styleClass\" [text]=\"text\" [variant]=\"variant\"\r\n [loading]=\"loading\" [autofocus]=\"autofocus\" [link]=\"link\" [plain]=\"plain\" [raised]=\"raised\"\r\n [loadingIcon]=\"loadingIcon\" [style]=\"style\" [outlined]=\"outlined\">\r\n <ng-content></ng-content>\r\n</p-button>", styles: [""], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i1.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }], encapsulation: i0.ViewEncapsulation.None });
59
+ }
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppButtonComponent, decorators: [{
61
+ type: Component,
62
+ args: [{ imports: [ButtonModule], selector: 'app-button', standalone: true, encapsulation: ViewEncapsulation.None, providers: [ButtonStyle], template: "<p-button (onFocus)=\"onFocus.emit()\" (onBlur)=\"onBlur.emit()\" (onClick)=\"onClick.emit()\" [size]=\"size\"\r\n [loadingIcon]=\"loadingIcon\" [disabled]=\"disabled\" [iconPos]=\"iconPos\" [icon]=\"icon\" [label]=\"label\"\r\n [rounded]=\"rounded\" [severity]=\"severity\" [styleClass]=\"styleClass\" [text]=\"text\" [variant]=\"variant\"\r\n [loading]=\"loading\" [autofocus]=\"autofocus\" [link]=\"link\" [plain]=\"plain\" [raised]=\"raised\"\r\n [loadingIcon]=\"loadingIcon\" [style]=\"style\" [outlined]=\"outlined\">\r\n <ng-content></ng-content>\r\n</p-button>" }]
63
+ }] });
64
+
65
+ class IcoMoonIconComponent {
66
+ iconName;
67
+ iconClass;
68
+ iconPathCount = 0;
69
+ get getPathCount() {
70
+ return Array.from({ length: this.iconPathCount }, (_, i) => i + 1);
71
+ }
72
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IcoMoonIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
73
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: IcoMoonIconComponent, isStandalone: true, selector: "app-ico-moon-card", inputs: { iconName: "iconName", iconClass: "iconClass", iconPathCount: "iconPathCount" }, ngImport: i0, template: `
74
+ <i [class]="iconName + ' ' + iconClass">
75
+ @for (path of getPathCount; track $index) {
76
+ <i [class]="iconName + ' path'+path"></i>
77
+ }
78
+ </i>
79
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
80
+ }
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IcoMoonIconComponent, decorators: [{
82
+ type: Component,
83
+ args: [{
84
+ selector: 'app-ico-moon-card',
85
+ standalone: true,
86
+ template: `
87
+ <i [class]="iconName + ' ' + iconClass">
88
+ @for (path of getPathCount; track $index) {
89
+ <i [class]="iconName + ' path'+path"></i>
90
+ }
91
+ </i>
92
+ `,
93
+ changeDetection: ChangeDetectionStrategy.OnPush
94
+ }]
95
+ }], propDecorators: { iconName: [{
96
+ type: Input,
97
+ args: [{ required: true }]
98
+ }], iconClass: [{
99
+ type: Input
100
+ }], iconPathCount: [{
101
+ type: Input
102
+ }] } });
103
+
104
+ class AppTabsComponent {
105
+ tabs;
106
+ tabsStyle = 'basic';
107
+ responsive = false;
108
+ twoDigitCount;
109
+ selectedTabIndex = model(0, ...(ngDevMode ? [{ debugName: "selectedTabIndex" }] : []));
110
+ activeTabIndex = 0;
111
+ router = inject(Router);
112
+ route = inject(ActivatedRoute);
113
+ ngOnInit() {
114
+ this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
115
+ this.updateActiveTab();
116
+ });
117
+ // to be refactor
118
+ this.updateActiveTab();
119
+ }
120
+ // Updates the active tab index based on the current route
121
+ updateActiveTab() {
122
+ if (!this.tabs.isRouted)
123
+ return;
124
+ const currentUrl = this.router.url;
125
+ const matchingTabIndex = this.tabs.items.findIndex((tab) => currentUrl.includes(tab.link));
126
+ this.activeTabIndex = matchingTabIndex !== -1 ? matchingTabIndex : 0;
127
+ }
128
+ onTabChange(index) {
129
+ this.selectedTabIndex.set(index);
130
+ if (!this.tabs.isRouted)
131
+ return;
132
+ const selectedTab = this.tabs.items[index];
133
+ if (selectedTab && !selectedTab.disabled) {
134
+ this.router.navigate([selectedTab.link], { relativeTo: this.route });
135
+ }
136
+ }
137
+ getTabCount(count) {
138
+ if (!count)
139
+ return '0';
140
+ return this.twoDigitCount && count > 99 ? '99+' : count.toString();
141
+ }
142
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
143
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AppTabsComponent, isStandalone: true, selector: "app-tabs", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: false, isRequired: false, transformFunction: null }, tabsStyle: { classPropertyName: "tabsStyle", publicName: "tabsStyle", isSignal: false, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: false, isRequired: false, transformFunction: null }, twoDigitCount: { classPropertyName: "twoDigitCount", publicName: "twoDigitCount", isSignal: false, isRequired: false, transformFunction: null }, selectedTabIndex: { classPropertyName: "selectedTabIndex", publicName: "selectedTabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedTabIndex: "selectedTabIndexChange" }, ngImport: i0, template: "@if (tabs && tabs.items.length) {\r\n<div [class]=\"tabsStyle + (responsive ? ' full-width' : '') + ' tabs-container'\">\r\n <p-tabs [value]=\"selectedTabIndex() || activeTabIndex\" scrollable>\r\n <p-tablist>\r\n\r\n @for (tab of tabs.items; let i = $index; track i) {\r\n <p-tab [value]=\"i\" [routerLink]=\"tabs.isRouted ? $any(tab).link : null\" [disabled]=\"tab.disabled\"\r\n (click)=\"onTabChange(i)\">\r\n @if (tab.iconName) {\r\n <app-ico-moon-card [iconClass]=\"'text-[17px]'\" [iconName]=\"tab.iconName\"\r\n [iconPathCount]=\"tab.iconPathCount || 0\" />\r\n }\r\n <span>{{ tab.title | translate }}\r\n @if (tab.count || tab.count === 0) {\r\n <p-badge [value]=\"getTabCount(tab.count)\" severity=\"secondary\" />\r\n }\r\n </span>\r\n </p-tab>\r\n }\r\n\r\n </p-tablist>\r\n\r\n <p-tabpanels>\r\n @if (tabs.isRouted) {\r\n <router-outlet></router-outlet>\r\n } @else {\r\n @for (tab of tabs.items; let i = $index; track i) {\r\n <p-tabpanel [value]=\"i\">\r\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplate\"></ng-container>\r\n </p-tabpanel>\r\n }\r\n }\r\n\r\n </p-tabpanels>\r\n </p-tabs>\r\n</div>\r\n}", styles: [".tabs-container.full-width .p-tabs .p-tablist-tab-list .p-tab{@apply flex-grow flex justify-center max-w-[50%];}.tabs-container .p-tabs .p-tablist-tab-list{@apply relative;}.tabs-container .p-tabs .p-tablist-tab-list:after{@apply content-[\"\"] w-full h-[3px] bg-purple-800/5 absolute bottom-0 right-0 z-[1];}.tabs-container .p-tabs .p-tablist-tab-list .p-tab{@apply text-sm text-gray-400 font-normal text-[16px] border-b-[4px] border-transparent z-[2];}.tabs-container .p-tabs .p-tablist-tab-list .p-tab:not(.p-tab-active) app-ico-moon-card{@apply grayscale;}.tabs-container .p-tabs .p-tablist-active-bar{@apply hidden;}.tabs-container .p-tabs .p-tabpanels.p-component{@apply mt-5 rounded-lg;}.tabs-container.basic .p-tabs .p-tablist-tab-list{@apply bg-transparent;}.tabs-container.basic .p-tabs .p-tablist-tab-list .p-tab.p-tab-active{@apply text-primary border-primary;}.tabs-container.primary_light .p-tabs .p-tablist-tab-list .p-tab{@apply rounded-t-lg text-[14px];}.tabs-container.primary_light .p-tabs .p-tablist-tab-list .p-tab.p-tab-active{@apply bg-purple-800/5 font-semibold text-primary border-primary;}.tabs-container.primary .p-tabs .p-tablist-tab-list:after{@apply bg-purple-800/5;}.tabs-container.primary .p-tabs .p-tablist-tab-list .p-tab{@apply rounded-t-lg text-[14px];}.tabs-container.primary .p-tabs .p-tablist-tab-list .p-tab.p-tab-active{@apply bg-primary font-semibold text-white border-secondary;}[dir=rtl] .p-tabs .p-tablist .p-iconwrapper{@apply rotate-180deg;}[dir=rtl] .p-tabs .p-tablist .p-tablist-next-button{@apply right-auto left-0;}[dir=rtl] .p-tabs .p-tablist .p-tablist-prev-button{@apply right-0 left-auto;}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i2.Tabs, selector: "p-tabs", inputs: ["value", "scrollable", "lazy", "selectOnFocus", "showNavigators", "tabindex"], outputs: ["valueChange"] }, { kind: "component", type: i2.TabPanels, selector: "p-tabpanels" }, { kind: "component", type: i2.TabPanel, selector: "p-tabpanel", inputs: ["lazy", "value"], outputs: ["valueChange"] }, { kind: "component", type: i2.TabList, selector: "p-tablist" }, { kind: "component", type: i2.Tab, selector: "p-tab", inputs: ["value", "disabled"], outputs: ["valueChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: IcoMoonIconComponent, selector: "app-ico-moon-card", inputs: ["iconName", "iconClass", "iconPathCount"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: BadgeModule }, { kind: "component", type: i3.Badge, selector: "p-badge", inputs: ["styleClass", "badgeSize", "size", "severity", "value", "badgeDisabled"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
144
+ }
145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppTabsComponent, decorators: [{
146
+ type: Component,
147
+ args: [{ selector: 'app-tabs', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
148
+ CommonModule,
149
+ TabsModule,
150
+ RouterLink,
151
+ RouterOutlet,
152
+ IcoMoonIconComponent,
153
+ TranslateModule,
154
+ BadgeModule,
155
+ ], template: "@if (tabs && tabs.items.length) {\r\n<div [class]=\"tabsStyle + (responsive ? ' full-width' : '') + ' tabs-container'\">\r\n <p-tabs [value]=\"selectedTabIndex() || activeTabIndex\" scrollable>\r\n <p-tablist>\r\n\r\n @for (tab of tabs.items; let i = $index; track i) {\r\n <p-tab [value]=\"i\" [routerLink]=\"tabs.isRouted ? $any(tab).link : null\" [disabled]=\"tab.disabled\"\r\n (click)=\"onTabChange(i)\">\r\n @if (tab.iconName) {\r\n <app-ico-moon-card [iconClass]=\"'text-[17px]'\" [iconName]=\"tab.iconName\"\r\n [iconPathCount]=\"tab.iconPathCount || 0\" />\r\n }\r\n <span>{{ tab.title | translate }}\r\n @if (tab.count || tab.count === 0) {\r\n <p-badge [value]=\"getTabCount(tab.count)\" severity=\"secondary\" />\r\n }\r\n </span>\r\n </p-tab>\r\n }\r\n\r\n </p-tablist>\r\n\r\n <p-tabpanels>\r\n @if (tabs.isRouted) {\r\n <router-outlet></router-outlet>\r\n } @else {\r\n @for (tab of tabs.items; let i = $index; track i) {\r\n <p-tabpanel [value]=\"i\">\r\n <ng-container [ngTemplateOutlet]=\"tab.contentTemplate\"></ng-container>\r\n </p-tabpanel>\r\n }\r\n }\r\n\r\n </p-tabpanels>\r\n </p-tabs>\r\n</div>\r\n}", styles: [".tabs-container.full-width .p-tabs .p-tablist-tab-list .p-tab{@apply flex-grow flex justify-center max-w-[50%];}.tabs-container .p-tabs .p-tablist-tab-list{@apply relative;}.tabs-container .p-tabs .p-tablist-tab-list:after{@apply content-[\"\"] w-full h-[3px] bg-purple-800/5 absolute bottom-0 right-0 z-[1];}.tabs-container .p-tabs .p-tablist-tab-list .p-tab{@apply text-sm text-gray-400 font-normal text-[16px] border-b-[4px] border-transparent z-[2];}.tabs-container .p-tabs .p-tablist-tab-list .p-tab:not(.p-tab-active) app-ico-moon-card{@apply grayscale;}.tabs-container .p-tabs .p-tablist-active-bar{@apply hidden;}.tabs-container .p-tabs .p-tabpanels.p-component{@apply mt-5 rounded-lg;}.tabs-container.basic .p-tabs .p-tablist-tab-list{@apply bg-transparent;}.tabs-container.basic .p-tabs .p-tablist-tab-list .p-tab.p-tab-active{@apply text-primary border-primary;}.tabs-container.primary_light .p-tabs .p-tablist-tab-list .p-tab{@apply rounded-t-lg text-[14px];}.tabs-container.primary_light .p-tabs .p-tablist-tab-list .p-tab.p-tab-active{@apply bg-purple-800/5 font-semibold text-primary border-primary;}.tabs-container.primary .p-tabs .p-tablist-tab-list:after{@apply bg-purple-800/5;}.tabs-container.primary .p-tabs .p-tablist-tab-list .p-tab{@apply rounded-t-lg text-[14px];}.tabs-container.primary .p-tabs .p-tablist-tab-list .p-tab.p-tab-active{@apply bg-primary font-semibold text-white border-secondary;}[dir=rtl] .p-tabs .p-tablist .p-iconwrapper{@apply rotate-180deg;}[dir=rtl] .p-tabs .p-tablist .p-tablist-next-button{@apply right-auto left-0;}[dir=rtl] .p-tabs .p-tablist .p-tablist-prev-button{@apply right-0 left-auto;}\n"] }]
156
+ }], propDecorators: { tabs: [{
157
+ type: Input
158
+ }], tabsStyle: [{
159
+ type: Input
160
+ }], responsive: [{
161
+ type: Input
162
+ }], twoDigitCount: [{
163
+ type: Input
164
+ }], selectedTabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedTabIndex", required: false }] }, { type: i0.Output, args: ["selectedTabIndexChange"] }] } });
165
+
166
+ class MenuPopupTextColorPipe {
167
+ transform(color) {
168
+ switch (color) {
169
+ case 'white': return 'text-white';
170
+ case 'purple': return 'text-purple-500';
171
+ case 'green': return 'text-green-500';
172
+ default: return 'text-white';
173
+ }
174
+ }
175
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MenuPopupTextColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
176
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: MenuPopupTextColorPipe, isStandalone: true, name: "popupTextColorClass" });
177
+ }
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MenuPopupTextColorPipe, decorators: [{
179
+ type: Pipe,
180
+ args: [{
181
+ name: 'popupTextColorClass',
182
+ standalone: true,
183
+ pure: true
184
+ }]
185
+ }] });
186
+
187
+ class AppDropdownMenuComponent {
188
+ buttonTitle;
189
+ menuItems = [];
190
+ popupMenuStyle = "purple";
191
+ buttonIcon = "font-icon-plus";
192
+ buttonClass;
193
+ buttonStyle;
194
+ buttonSeverity;
195
+ buttonIconPosition = "left";
196
+ router = inject(Router);
197
+ showMenu;
198
+ ngOnInit() {
199
+ this.showMenu = this.menuItems.some((item) => {
200
+ return item.show;
201
+ });
202
+ }
203
+ onMenuItemClick(item) {
204
+ if (item.callback) {
205
+ item.callback();
206
+ }
207
+ else if (item.routerLink) {
208
+ this.router.navigate(Array.isArray(item.routerLink) ? item.routerLink : [item.routerLink], { queryParams: item.queryParams || {} });
209
+ }
210
+ }
211
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppDropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
212
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AppDropdownMenuComponent, isStandalone: true, selector: "app-dropdown-menu", inputs: { buttonTitle: "buttonTitle", menuItems: "menuItems", popupMenuStyle: "popupMenuStyle", buttonIcon: "buttonIcon", buttonClass: "buttonClass", buttonStyle: "buttonStyle", buttonSeverity: "buttonSeverity", buttonIconPosition: "buttonIconPosition" }, ngImport: i0, template: "@if (showMenu) {\r\n<app-button (click)=\"op.toggle($event)\" [class]=\"buttonClass\" [iconPos]=\"buttonIconPosition\" [icon]=\"buttonIcon\"\r\n [label]=\"buttonTitle\" [styleClass]=\"buttonStyle\" [severity]=\"buttonSeverity\" />\r\n}\r\n<p-popover #op [styleClass]=\"popupMenuStyle === 'white' ? 'white-menu' : 'purple-menu'\">\r\n <div class=\"flex flex-col gap-4 text-sm md:text-xs\">\r\n <ul>\r\n @for (item of menuItems; track $index) {\r\n @if (item.show) {\r\n <li [ngClass]=\"{'flex-row-reverse': item.iconPosition === 'right'}\"\r\n [class]=\"'flex justify-between min-w-[130px] gap-1 items-center cursor-pointer text-sm ' + (item.textColor | popupTextColorClass)\"\r\n (click)=\"onMenuItemClick(item)\">\r\n {{ item.title | translate }}\r\n @if (item.icon) {\r\n <i [class]=\"item.icon\"></i>\r\n }\r\n </li>\r\n }\r\n }\r\n </ul>\r\n </div>\r\n</p-popover>", styles: [".p-popover{box-shadow:none;border-radius:3px;margin-top:13px}.p-popover:is(.purple-menu){@apply bg-primary text-white text-sm mt-2;}.p-popover:is(.purple-menu) li:not(:last-child){@apply border-b-2 border-purple-700;}.p-popover:is(.white-menu) li:not(:last-child){@apply border-b;}.p-popover:before,.p-popover:after{display:none}.p-popover .p-popover-content{width:auto;min-width:unset}.p-popover .p-popover-content ul li{@apply py-3;}.p-popover .p-popover-content ul li:hover{opacity:.7}.p-popover .p-popover-content ul li:first-child{@apply pt-0;}.p-popover .p-popover-content ul li:last-child{@apply pb-0;}\n"], dependencies: [{ kind: "component", type: AppButtonComponent, selector: "app-button" }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: MenuPopupTextColorPipe, name: "popupTextColorClass" }], encapsulation: i0.ViewEncapsulation.None });
213
+ }
214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppDropdownMenuComponent, decorators: [{
215
+ type: Component,
216
+ args: [{ selector: "app-dropdown-menu", standalone: true, imports: [AppButtonComponent, Popover, TranslateModule, NgClass, MenuPopupTextColorPipe], encapsulation: ViewEncapsulation.None, template: "@if (showMenu) {\r\n<app-button (click)=\"op.toggle($event)\" [class]=\"buttonClass\" [iconPos]=\"buttonIconPosition\" [icon]=\"buttonIcon\"\r\n [label]=\"buttonTitle\" [styleClass]=\"buttonStyle\" [severity]=\"buttonSeverity\" />\r\n}\r\n<p-popover #op [styleClass]=\"popupMenuStyle === 'white' ? 'white-menu' : 'purple-menu'\">\r\n <div class=\"flex flex-col gap-4 text-sm md:text-xs\">\r\n <ul>\r\n @for (item of menuItems; track $index) {\r\n @if (item.show) {\r\n <li [ngClass]=\"{'flex-row-reverse': item.iconPosition === 'right'}\"\r\n [class]=\"'flex justify-between min-w-[130px] gap-1 items-center cursor-pointer text-sm ' + (item.textColor | popupTextColorClass)\"\r\n (click)=\"onMenuItemClick(item)\">\r\n {{ item.title | translate }}\r\n @if (item.icon) {\r\n <i [class]=\"item.icon\"></i>\r\n }\r\n </li>\r\n }\r\n }\r\n </ul>\r\n </div>\r\n</p-popover>", styles: [".p-popover{box-shadow:none;border-radius:3px;margin-top:13px}.p-popover:is(.purple-menu){@apply bg-primary text-white text-sm mt-2;}.p-popover:is(.purple-menu) li:not(:last-child){@apply border-b-2 border-purple-700;}.p-popover:is(.white-menu) li:not(:last-child){@apply border-b;}.p-popover:before,.p-popover:after{display:none}.p-popover .p-popover-content{width:auto;min-width:unset}.p-popover .p-popover-content ul li{@apply py-3;}.p-popover .p-popover-content ul li:hover{opacity:.7}.p-popover .p-popover-content ul li:first-child{@apply pt-0;}.p-popover .p-popover-content ul li:last-child{@apply pb-0;}\n"] }]
217
+ }], propDecorators: { buttonTitle: [{
218
+ type: Input,
219
+ args: [{ required: true }]
220
+ }], menuItems: [{
221
+ type: Input,
222
+ args: [{ required: true }]
223
+ }], popupMenuStyle: [{
224
+ type: Input
225
+ }], buttonIcon: [{
226
+ type: Input
227
+ }], buttonClass: [{
228
+ type: Input
229
+ }], buttonStyle: [{
230
+ type: Input
231
+ }], buttonSeverity: [{
232
+ type: Input
233
+ }], buttonIconPosition: [{
234
+ type: Input
235
+ }] } });
236
+
237
+ class SideBarComponent {
238
+ show = false;
239
+ title;
240
+ closable = true;
241
+ dismissible = false;
242
+ closeOnEscape = false;
243
+ sidebarSize = "sm";
244
+ styleClass = "";
245
+ hide = new EventEmitter();
246
+ onShow = new EventEmitter();
247
+ contentTemplate;
248
+ footerTemplate;
249
+ position = 'left';
250
+ hideSidebar() {
251
+ this.show = false;
252
+ this.hide.emit(false);
253
+ }
254
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SideBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
255
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: SideBarComponent, isStandalone: true, selector: "app-side-bar", inputs: { show: "show", title: "title", closable: "closable", dismissible: "dismissible", closeOnEscape: "closeOnEscape", sidebarSize: "sidebarSize", styleClass: "styleClass", contentTemplate: "contentTemplate", footerTemplate: "footerTemplate", position: "position" }, outputs: { hide: "hide", onShow: "onShow" }, ngImport: i0, template: "<!-- TODO refactor position sidebar based on html dir-->\r\n<p-drawer\r\n (onHide)=\"hideSidebar()\"\r\n (onShow)=\"onShow.emit($event)\"\r\n [(visible)]=\"show\"\r\n [closable]=\"closable\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n [dismissible]=\"dismissible\"\r\n [ngClass]=\"{ show: show }\"\r\n [position]=\"'left'\"\r\n appendTo=\"body\"\r\n styleClass=\"p-drawer-{{ sidebarSize }} custom-content bg-white {{ styleClass }}\">\r\n <ng-template pTemplate=\"header\">\r\n <p class=\"truncate\" [pTooltip]=\"title\">{{ title }}</p>\r\n </ng-template>\r\n @if (contentTemplate) {\r\n <ng-template pTemplate=\"content\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\">\r\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\r\n </ng-template>\r\n }\r\n</p-drawer>\r\n", styles: [".sidebar.show{@apply min-w-[550px];}.p-drawer-header,.p-drawer-footer{background-color:var(--gray-100)}.p-drawer-header{--p-drawer-header-padding: .75rem var(--p-overlay-modal-padding);font-weight:500}.p-drawer-footer{--p-drawer-footer-padding: .75rem var(--p-overlay-modal-padding)}.p-drawer-content{padding-top:var(--p-overlay-modal-padding)!important}\n"], dependencies: [{ kind: "directive", type: PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: Drawer, selector: "p-drawer", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip"] }], encapsulation: i0.ViewEncapsulation.None });
256
+ }
257
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SideBarComponent, decorators: [{
258
+ type: Component,
259
+ args: [{ selector: "app-side-bar", standalone: true, imports: [PrimeTemplate, Drawer, NgClass, NgTemplateOutlet, TooltipModule], encapsulation: ViewEncapsulation.None, template: "<!-- TODO refactor position sidebar based on html dir-->\r\n<p-drawer\r\n (onHide)=\"hideSidebar()\"\r\n (onShow)=\"onShow.emit($event)\"\r\n [(visible)]=\"show\"\r\n [closable]=\"closable\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n [dismissible]=\"dismissible\"\r\n [ngClass]=\"{ show: show }\"\r\n [position]=\"'left'\"\r\n appendTo=\"body\"\r\n styleClass=\"p-drawer-{{ sidebarSize }} custom-content bg-white {{ styleClass }}\">\r\n <ng-template pTemplate=\"header\">\r\n <p class=\"truncate\" [pTooltip]=\"title\">{{ title }}</p>\r\n </ng-template>\r\n @if (contentTemplate) {\r\n <ng-template pTemplate=\"content\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\">\r\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\r\n </ng-template>\r\n }\r\n</p-drawer>\r\n", styles: [".sidebar.show{@apply min-w-[550px];}.p-drawer-header,.p-drawer-footer{background-color:var(--gray-100)}.p-drawer-header{--p-drawer-header-padding: .75rem var(--p-overlay-modal-padding);font-weight:500}.p-drawer-footer{--p-drawer-footer-padding: .75rem var(--p-overlay-modal-padding)}.p-drawer-content{padding-top:var(--p-overlay-modal-padding)!important}\n"] }]
260
+ }], propDecorators: { show: [{
261
+ type: Input
262
+ }], title: [{
263
+ type: Input
264
+ }], closable: [{
265
+ type: Input
266
+ }], dismissible: [{
267
+ type: Input
268
+ }], closeOnEscape: [{
269
+ type: Input
270
+ }], sidebarSize: [{
271
+ type: Input
272
+ }], styleClass: [{
273
+ type: Input
274
+ }], hide: [{
275
+ type: Output
276
+ }], onShow: [{
277
+ type: Output
278
+ }], contentTemplate: [{
279
+ type: Input
280
+ }], footerTemplate: [{
281
+ type: Input
282
+ }], position: [{
283
+ type: Input
284
+ }] } });
285
+
286
+ class UserInfoComponent {
287
+ profileImage;
288
+ name;
289
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
290
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: UserInfoComponent, isStandalone: true, selector: "user-info", inputs: { profileImage: "profileImage", name: "name" }, ngImport: i0, template: "<div class=\"flex items-center gap-2\">\r\n <img\r\n [alt]=\"name\"\r\n [src]=\"profileImage\"\r\n class=\"rounded-full object-cover w-[24px] h-[24px]\"\r\n height=\"24\"\r\n width=\"24\"\r\n />\r\n <p class=\"text-[14px]\">{{ name }}</p>\r\n</div>\r\n" });
291
+ }
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserInfoComponent, decorators: [{
293
+ type: Component,
294
+ args: [{ selector: "user-info", standalone: true, template: "<div class=\"flex items-center gap-2\">\r\n <img\r\n [alt]=\"name\"\r\n [src]=\"profileImage\"\r\n class=\"rounded-full object-cover w-[24px] h-[24px]\"\r\n height=\"24\"\r\n width=\"24\"\r\n />\r\n <p class=\"text-[14px]\">{{ name }}</p>\r\n</div>\r\n" }]
295
+ }], propDecorators: { profileImage: [{
296
+ type: Input
297
+ }], name: [{
298
+ type: Input
299
+ }] } });
300
+
301
+ class FormUtils {
302
+ static getFormControl(controlName, form) {
303
+ if (!form)
304
+ throw new Error(`Form is not initialized.`);
305
+ const formControl = form.get(controlName);
306
+ if (!formControl)
307
+ throw new Error(`There's no form control with given name. '${controlName}'`);
308
+ return formControl;
309
+ }
310
+ }
311
+
312
+ var BasicErrorKeysEnum;
313
+ (function (BasicErrorKeysEnum) {
314
+ BasicErrorKeysEnum["required"] = "REQUIRED";
315
+ BasicErrorKeysEnum["email"] = "EMAIL";
316
+ BasicErrorKeysEnum["pattern"] = "PATTERN";
317
+ BasicErrorKeysEnum["invalidArFormat"] = "INVALID_AR_FORMAT";
318
+ BasicErrorKeysEnum["invalidLink"] = "INVALID_LINK";
319
+ BasicErrorKeysEnum["endDateBeforeStartDate"] = "END_DATE_BEFORE_START_DATE";
320
+ BasicErrorKeysEnum["startDateEqualsEndDate"] = "START_DATE_EQUALS_END_DATE";
321
+ BasicErrorKeysEnum["endTimeBeforeStartTime"] = "END_TIME_BEFORE_START_TIME";
322
+ BasicErrorKeysEnum["startTimeEqualsEndTime"] = "START_TIME_EQUALS_END_TIME";
323
+ BasicErrorKeysEnum["integer"] = "INTEGER";
324
+ BasicErrorKeysEnum["positiveNumber"] = "POSITIVE_NUMBER";
325
+ BasicErrorKeysEnum["fileSelected"] = "FILE_SELECTED";
326
+ BasicErrorKeysEnum["default"] = "DEFAULT";
327
+ BasicErrorKeysEnum["numbersOnly"] = "NUMBERS_ONLY";
328
+ })(BasicErrorKeysEnum || (BasicErrorKeysEnum = {}));
329
+ var ErrorsWithValuesKeysEnum;
330
+ (function (ErrorsWithValuesKeysEnum) {
331
+ ErrorsWithValuesKeysEnum["minlength"] = "MIN_LENGTH";
332
+ ErrorsWithValuesKeysEnum["maxlength"] = "MAX_LENGTH";
333
+ ErrorsWithValuesKeysEnum["min"] = "MIN";
334
+ ErrorsWithValuesKeysEnum["max"] = "MAX";
335
+ ErrorsWithValuesKeysEnum["maxSize"] = "MAX_SIZE";
336
+ ErrorsWithValuesKeysEnum["maxFiles"] = "MAX_FILES";
337
+ ErrorsWithValuesKeysEnum["allowedTypes"] = "ALLOWED_TYPES";
338
+ })(ErrorsWithValuesKeysEnum || (ErrorsWithValuesKeysEnum = {}));
339
+
340
+ class FormValidationService {
341
+ translate = inject(TranslateService);
342
+ getTranslation(key, interpolateParams) {
343
+ return this.translate.instant(`VALIDATION.${key}`, interpolateParams);
344
+ }
345
+ getErrorMessage(errorKey, errorValue) {
346
+ if (this.isBasicErrorKey(errorKey)) {
347
+ return this.getTranslation(BasicErrorKeysEnum[errorKey]);
348
+ }
349
+ if (this.isErrorWithValueKey(errorKey)) {
350
+ return this.getErrorWithValueMessage(errorKey, errorValue);
351
+ }
352
+ return this.getTranslation(BasicErrorKeysEnum.default);
353
+ }
354
+ // Basic error keys are the keys that don't have any values to interpolate. like required, email, etc.
355
+ isBasicErrorKey(key) {
356
+ return Object.keys(BasicErrorKeysEnum).includes(key);
357
+ }
358
+ // Error keys with values are the keys that have values to interpolate. like minlength, maxlength, etc.
359
+ isErrorWithValueKey(key) {
360
+ return Object.keys(ErrorsWithValuesKeysEnum).includes(key);
361
+ }
362
+ getErrorWithValueMessage(errorKey, errorValue) {
363
+ const messages = {
364
+ minlength: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.minlength, {
365
+ requiredLength: val?.requiredLength,
366
+ actualLength: val?.actualLength,
367
+ }),
368
+ maxlength: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.maxlength, {
369
+ requiredLength: val?.requiredLength,
370
+ actualLength: val?.actualLength,
371
+ }),
372
+ min: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.min, { min: val?.min }),
373
+ max: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.max, { max: val?.max }),
374
+ maxSize: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.maxSize, { size: val?.requiredLength }),
375
+ maxFiles: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.maxFiles, { size: val?.requiredLength }),
376
+ allowedTypes: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.allowedTypes, { types: val?.join(', ') }),
377
+ };
378
+ return messages[errorKey](errorValue);
379
+ }
380
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FormValidationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
381
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FormValidationService, providedIn: 'root' });
382
+ }
383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FormValidationService, decorators: [{
384
+ type: Injectable,
385
+ args: [{
386
+ providedIn: 'root',
387
+ }]
388
+ }] });
389
+
390
+ class ValidationErrorsPipe {
391
+ formValidationService = inject(FormValidationService);
392
+ // allowed keys here to handle errors in case of cross-validators like startDate and endDate validators,
393
+ // we pass this custom key to handle the error messages only for the allowed keys
394
+ transform(errors, allowedKeys) {
395
+ if (!errors)
396
+ return [];
397
+ return Object.keys(errors)
398
+ .filter((errorKey) => !allowedKeys || allowedKeys.includes(errorKey)) // Filter errors if allowedKeys are provided
399
+ .map((errorKey) => {
400
+ return this.formValidationService.getErrorMessage(errorKey, errors[errorKey]);
401
+ });
402
+ }
403
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ValidationErrorsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
404
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: ValidationErrorsPipe, isStandalone: true, name: "validationErrors" });
405
+ }
406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ValidationErrorsPipe, decorators: [{
407
+ type: Pipe,
408
+ args: [{
409
+ name: "validationErrors",
410
+ standalone: true,
411
+ pure: true
412
+ }]
413
+ }] });
414
+
415
+ function numbersOnlyValidator(control) {
416
+ const value = control.value;
417
+ if (value === null || value === undefined || value === '') {
418
+ return null;
419
+ }
420
+ const isNumbersOnly = /^[0-9]+$/.test(value);
421
+ return isNumbersOnly ? null : { numbersOnly: true };
422
+ }
423
+
424
+ class BaseInputComponent {
425
+ control;
426
+ name = '';
427
+ label;
428
+ placeholder = '';
429
+ inputId;
430
+ readonly = false;
431
+ disabled = false;
432
+ hint;
433
+ destroy$ = new Subject();
434
+ get required() {
435
+ return this.control.hasValidator(Validators.required);
436
+ }
437
+ get isInvalid() {
438
+ return this.control.invalid && this.control.touched;
439
+ }
440
+ ngOnInit() {
441
+ }
442
+ ngOnDestroy() {
443
+ this.destroy$.next();
444
+ this.destroy$.complete();
445
+ }
446
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BaseInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
447
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: BaseInputComponent, isStandalone: true, selector: "ng-component", inputs: { control: "control", name: "name", label: "label", placeholder: "placeholder", inputId: "inputId", readonly: "readonly", disabled: "disabled", hint: "hint" }, ngImport: i0, template: '', isInline: true });
448
+ }
449
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BaseInputComponent, decorators: [{
450
+ type: Component,
451
+ args: [{
452
+ template: '',
453
+ }]
454
+ }], propDecorators: { control: [{
455
+ type: Input,
456
+ args: [{ required: true }]
457
+ }], name: [{
458
+ type: Input
459
+ }], label: [{
460
+ type: Input
461
+ }], placeholder: [{
462
+ type: Input
463
+ }], inputId: [{
464
+ type: Input
465
+ }], readonly: [{
466
+ type: Input
467
+ }], disabled: [{
468
+ type: Input
469
+ }], hint: [{
470
+ type: Input
471
+ }] } });
472
+
473
+ class AutoCompleteComponent extends BaseInputComponent {
474
+ selectedItemTemplate = null;
475
+ // eslint-disable-next-line @angular-eslint/no-output-on-prefix
476
+ onSearch = new EventEmitter();
477
+ selectOption = new EventEmitter();
478
+ items = [];
479
+ minLengthToSearch = 3;
480
+ delay = 300; // default value
481
+ basicInput;
482
+ typeAhead = false;
483
+ variant = 'over';
484
+ constructor() {
485
+ super();
486
+ }
487
+ search(event) {
488
+ this.onSearch.emit(event.query);
489
+ }
490
+ onSelect(event) {
491
+ this.selectOption.emit(event);
492
+ }
493
+ onKeyDown(event) {
494
+ if (!['Enter', 'Tab', ' '].includes(event.key))
495
+ return;
496
+ event.preventDefault();
497
+ const input = event.target;
498
+ this.addValueFromInput(input);
499
+ }
500
+ onBlur(event) {
501
+ const input = event.target;
502
+ this.addValueFromInput(input);
503
+ }
504
+ addValueFromInput(input) {
505
+ const value = input.value?.trim();
506
+ if (!value)
507
+ return;
508
+ const current = this.control.value ?? [];
509
+ if (!current.includes(value)) {
510
+ this.control.setValue([...current, value]);
511
+ this.control.markAsDirty();
512
+ }
513
+ input.value = '';
514
+ }
515
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AutoCompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
516
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AutoCompleteComponent, isStandalone: true, selector: "stc-auto-complete", inputs: { selectedItemTemplate: "selectedItemTemplate", items: "items", minLengthToSearch: "minLengthToSearch", delay: "delay", basicInput: "basicInput", typeAhead: "typeAhead", variant: "variant" }, outputs: { onSearch: "onSearch", selectOption: "selectOption" }, usesInheritance: true, ngImport: i0, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n @if (!required) {\r\n <span class=\"absolute top-[6px] left-0 text-[10px] text-gray-400\">{{'forms.config.optional' | translate}}</span>\r\n }\r\n <p-floatlabel [variant]=\"variant\" class=\"autoComplete\">\r\n <p-auto-complete (keydown)=\"onKeyDown($event)\" (onBlur)=\"onBlur($event)\" (completeMethod)=\"search($event)\" (onSelect)=\"onSelect($event)\" [delay]=\"delay\"\r\n [disabled]=\"disabled\" [formControl]=\"control\" [id]=\"inputId\" fluid [typeahead]=\"typeAhead\"\r\n [inputStyleClass]=\"'reset-default-styles w-full' + (basicInput ? ' basic-style': ' ')\"\r\n [minLength]=\"minLengthToSearch\" [name]=\"name\" [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid}\"\r\n [placeholder]=\"placeholder\" [styleClass]=\"'w-full'\" multiple [suggestions]=\"items\">\r\n <ng-template let-item pTemplate=\"item\">\r\n @if (selectedItemTemplate) {\r\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: item }\" [ngTemplateOutlet]=\"selectedItemTemplate\" />\r\n }\r\n </ng-template>\r\n </p-auto-complete>\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"isInvalid\">*</span>\r\n }\r\n </label>\r\n </p-floatlabel>\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n }\r\n @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br>\r\n }\r\n </small>\r\n }\r\n\r\n</div>\r\n", styles: [".text-required{color:red}.p-error{color:#dc2626}.autoComplete .p-floatlabel-in{height:auto!important}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "minQueryLength", "delay", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "addOnTab", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "addOnBlur", "separator", "appendTo"], outputs: ["completeMethod", "onSelect", "onUnselect", "onAdd", "onFocus", "onBlur", "onDropdownClick", "onClear", "onInputKeydown", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "directive", type: PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
517
+ }
518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AutoCompleteComponent, decorators: [{
519
+ type: Component,
520
+ args: [{ selector: 'stc-auto-complete', standalone: true, imports: [
521
+ ReactiveFormsModule,
522
+ AutoComplete,
523
+ PrimeTemplate,
524
+ NgIf,
525
+ NgTemplateOutlet,
526
+ NgClass,
527
+ JsonPipe,
528
+ ValidationErrorsPipe,
529
+ TranslatePipe,
530
+ FloatLabel,
531
+ ], encapsulation: ViewEncapsulation.None, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n @if (!required) {\r\n <span class=\"absolute top-[6px] left-0 text-[10px] text-gray-400\">{{'forms.config.optional' | translate}}</span>\r\n }\r\n <p-floatlabel [variant]=\"variant\" class=\"autoComplete\">\r\n <p-auto-complete (keydown)=\"onKeyDown($event)\" (onBlur)=\"onBlur($event)\" (completeMethod)=\"search($event)\" (onSelect)=\"onSelect($event)\" [delay]=\"delay\"\r\n [disabled]=\"disabled\" [formControl]=\"control\" [id]=\"inputId\" fluid [typeahead]=\"typeAhead\"\r\n [inputStyleClass]=\"'reset-default-styles w-full' + (basicInput ? ' basic-style': ' ')\"\r\n [minLength]=\"minLengthToSearch\" [name]=\"name\" [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid}\"\r\n [placeholder]=\"placeholder\" [styleClass]=\"'w-full'\" multiple [suggestions]=\"items\">\r\n <ng-template let-item pTemplate=\"item\">\r\n @if (selectedItemTemplate) {\r\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: item }\" [ngTemplateOutlet]=\"selectedItemTemplate\" />\r\n }\r\n </ng-template>\r\n </p-auto-complete>\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"isInvalid\">*</span>\r\n }\r\n </label>\r\n </p-floatlabel>\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n }\r\n @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br>\r\n }\r\n </small>\r\n }\r\n\r\n</div>\r\n", styles: [".text-required{color:red}.p-error{color:#dc2626}.autoComplete .p-floatlabel-in{height:auto!important}\n"] }]
532
+ }], ctorParameters: () => [], propDecorators: { selectedItemTemplate: [{
533
+ type: Input
534
+ }], onSearch: [{
535
+ type: Output
536
+ }], selectOption: [{
537
+ type: Output
538
+ }], items: [{
539
+ type: Input
540
+ }], minLengthToSearch: [{
541
+ type: Input
542
+ }], delay: [{
543
+ type: Input
544
+ }], basicInput: [{
545
+ type: Input
546
+ }], typeAhead: [{
547
+ type: Input
548
+ }], variant: [{
549
+ type: Input
550
+ }] } });
551
+
552
+ class DatePickerComponent extends BaseInputComponent {
553
+ showIcon = false;
554
+ showClear = false;
555
+ basicInput;
556
+ isTimeOnly = false;
557
+ minDate;
558
+ maxDate;
559
+ hourFormat = '12';
560
+ nowTime = new Date();
561
+ selectionMode = 'single';
562
+ onAfterClearDate = new EventEmitter();
563
+ variant = 'over';
564
+ withoutTime = false;
565
+ innerControl = new FormControl(null);
566
+ constructor() {
567
+ super();
568
+ }
569
+ ngOnInit() {
570
+ if (typeof this.control?.value === 'string') {
571
+ const date = new Date(this.control.value);
572
+ if (date) {
573
+ this.innerControl.setValue(date, { emitEvent: false });
574
+ }
575
+ }
576
+ this.control.valueChanges.subscribe((value) => {
577
+ if (!value)
578
+ this.innerControl.reset();
579
+ });
580
+ }
581
+ selectCurrentTime(e) {
582
+ if (this.withoutTime) {
583
+ const d = new Date();
584
+ this.control.setValue(d.toISOString().split('T')[0]);
585
+ return;
586
+ }
587
+ this.control.setValue(this.nowTime);
588
+ }
589
+ clearButtonClick(e) {
590
+ this.control.setValue(null);
591
+ }
592
+ afterClearDate() {
593
+ this.control.reset();
594
+ this.onAfterClearDate.emit();
595
+ }
596
+ onDateChange(value) {
597
+ if (!this.withoutTime || !value)
598
+ return;
599
+ const dateOnly = value instanceof Date ? formatDate(value, 'yyyy-MM-dd', 'en-US') : value;
600
+ this.control.setValue(dateOnly, { emitEvent: true });
601
+ }
602
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
603
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DatePickerComponent, isStandalone: true, selector: "stc-date-picker", inputs: { showIcon: "showIcon", showClear: "showClear", basicInput: "basicInput", isTimeOnly: "isTimeOnly", minDate: "minDate", maxDate: "maxDate", hourFormat: "hourFormat", selectionMode: "selectionMode", variant: "variant", withoutTime: "withoutTime" }, outputs: { onAfterClearDate: "onAfterClearDate" }, usesInheritance: true, ngImport: i0, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n <p-floatlabel [variant]=\"variant\">\r\n <p-datepicker [selectionMode]=\"selectionMode\" [disabled]=\"disabled\" [formControl]=\"innerControl\"\r\n (onSelect)=\"onDateChange($event)\" [iconDisplay]=\"'input'\" [showClear]=\"showClear\" (onClear)=\"afterClearDate()\"\r\n [inputId]=\"inputId\" [inputStyleClass]=\"'reset-default-styles ' + (basicInput ? 'basic-style' : '')\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid }\" [placeholder]=\"placeholder\" [showIcon]=\"showIcon\"\r\n [class]=\"'w-full'\" appendTo=\"body\" [timeOnly]=\"isTimeOnly\" [hourFormat]=\"hourFormat\" [minDate]=\"minDate\"\r\n [maxDate]=\"maxDate\" panelStyleClass=\"d-ltr\">\r\n @if (isTimeOnly) {\r\n <ng-template #inputicon let-clickCallBack=\"clickCallBack\">\r\n <i class=\"text-[18px] font-icon-time-clock\" (click)=\"clickCallBack($event)\"></i>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"p-datepicker-buttonbar\">\r\n <button pButton type=\"button\" class=\"p-button-text\" (click)=\"selectCurrentTime($event)\">\u0627\u0644\u0627\u0646\r\n </button>\r\n <button pButton type=\"button\" class=\"p-button-text\" (click)=\"clearButtonClick($event)\"> \u0627\u0644\u063A\u0627\u0621</button>\r\n </div>\r\n </ng-template>\r\n }\r\n </p-datepicker>\r\n\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n </p-floatlabel>\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n }\r\n @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br>\r\n }\r\n </small>\r\n }\r\n</div>", styles: [".p-datepicker{@apply relative;}.p-datepicker-clear-icon{@apply cursor-pointer absolute top-[50%] left-[13px] text-[var(--p-datepicker-input-icon-color)] ml-[calc(var(--p-icon-size))] leading-none;}.d-ltr{direction:ltr}.text-required{color:red}.p-error{color:#dc2626}stc-date-picker.w-full,stc-date-picker.w-full .field,stc-date-picker.w-full .p-floatlabel,stc-date-picker.w-full .p-datepicker,stc-date-picker.w-full .p-inputtext{@apply w-full;}stc-date-picker.w-full .p-datepicker{@apply block;}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "component", type: DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3$1.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }], encapsulation: i0.ViewEncapsulation.None });
604
+ }
605
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DatePickerComponent, decorators: [{
606
+ type: Component,
607
+ args: [{ selector: 'stc-date-picker', standalone: true, imports: [
608
+ FormsModule,
609
+ DatePicker,
610
+ ReactiveFormsModule,
611
+ NgClass,
612
+ DatePickerModule,
613
+ ValidationErrorsPipe,
614
+ FloatLabelModule,
615
+ ], encapsulation: ViewEncapsulation.None, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n <p-floatlabel [variant]=\"variant\">\r\n <p-datepicker [selectionMode]=\"selectionMode\" [disabled]=\"disabled\" [formControl]=\"innerControl\"\r\n (onSelect)=\"onDateChange($event)\" [iconDisplay]=\"'input'\" [showClear]=\"showClear\" (onClear)=\"afterClearDate()\"\r\n [inputId]=\"inputId\" [inputStyleClass]=\"'reset-default-styles ' + (basicInput ? 'basic-style' : '')\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid }\" [placeholder]=\"placeholder\" [showIcon]=\"showIcon\"\r\n [class]=\"'w-full'\" appendTo=\"body\" [timeOnly]=\"isTimeOnly\" [hourFormat]=\"hourFormat\" [minDate]=\"minDate\"\r\n [maxDate]=\"maxDate\" panelStyleClass=\"d-ltr\">\r\n @if (isTimeOnly) {\r\n <ng-template #inputicon let-clickCallBack=\"clickCallBack\">\r\n <i class=\"text-[18px] font-icon-time-clock\" (click)=\"clickCallBack($event)\"></i>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"p-datepicker-buttonbar\">\r\n <button pButton type=\"button\" class=\"p-button-text\" (click)=\"selectCurrentTime($event)\">\u0627\u0644\u0627\u0646\r\n </button>\r\n <button pButton type=\"button\" class=\"p-button-text\" (click)=\"clearButtonClick($event)\"> \u0627\u0644\u063A\u0627\u0621</button>\r\n </div>\r\n </ng-template>\r\n }\r\n </p-datepicker>\r\n\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n </p-floatlabel>\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n }\r\n @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br>\r\n }\r\n </small>\r\n }\r\n</div>", styles: [".p-datepicker{@apply relative;}.p-datepicker-clear-icon{@apply cursor-pointer absolute top-[50%] left-[13px] text-[var(--p-datepicker-input-icon-color)] ml-[calc(var(--p-icon-size))] leading-none;}.d-ltr{direction:ltr}.text-required{color:red}.p-error{color:#dc2626}stc-date-picker.w-full,stc-date-picker.w-full .field,stc-date-picker.w-full .p-floatlabel,stc-date-picker.w-full .p-datepicker,stc-date-picker.w-full .p-inputtext{@apply w-full;}stc-date-picker.w-full .p-datepicker{@apply block;}\n"] }]
616
+ }], ctorParameters: () => [], propDecorators: { showIcon: [{
617
+ type: Input
618
+ }], showClear: [{
619
+ type: Input
620
+ }], basicInput: [{
621
+ type: Input
622
+ }], isTimeOnly: [{
623
+ type: Input
624
+ }], minDate: [{
625
+ type: Input
626
+ }], maxDate: [{
627
+ type: Input
628
+ }], hourFormat: [{
629
+ type: Input
630
+ }], selectionMode: [{
631
+ type: Input
632
+ }], onAfterClearDate: [{
633
+ type: Output
634
+ }], variant: [{
635
+ type: Input
636
+ }], withoutTime: [{
637
+ type: Input
638
+ }] } });
639
+
640
+ class InputComponent extends BaseInputComponent {
641
+ type = 'text';
642
+ contentType = 'text';
643
+ size = "small";
644
+ prefix;
645
+ rows = 2;
646
+ cols = 20;
647
+ autoResize = false;
648
+ basicInput;
649
+ noStyle;
650
+ canClear;
651
+ hideOptionalLabel;
652
+ inputDirection = 'inherit';
653
+ variant = 'over';
654
+ defaultColor = '#DFE0E6';
655
+ iconClass;
656
+ iconPosition = 'left';
657
+ constructor() {
658
+ super();
659
+ }
660
+ clearInput() {
661
+ this.control.reset();
662
+ }
663
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
664
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: InputComponent, isStandalone: true, selector: "stc-input", inputs: { type: "type", contentType: "contentType", size: "size", prefix: "prefix", rows: "rows", cols: "cols", autoResize: "autoResize", basicInput: "basicInput", noStyle: "noStyle", canClear: "canClear", hideOptionalLabel: "hideOptionalLabel", inputDirection: "inputDirection", variant: "variant", defaultColor: "defaultColor", iconClass: "iconClass", iconPosition: "iconPosition" }, usesInheritance: true, ngImport: i0, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n\r\n <!-- input text align will be handled according to lang when implemented -->\r\n\r\n @switch (type) {\r\n @case ('textarea') {\r\n @if (label) {\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n <!-- @else if (!hideOptionalLabel) {\r\n <span span class=\"optional-label\">{{'forms.config.optional' | translate}}</span>\r\n } -->\r\n </label>\r\n <ng-content></ng-content>\r\n </div>\r\n }\r\n <textarea [name]=\"name\" [id]=\"inputId\" [formControl]=\"control\" [placeholder]=\"placeholder\" [readonly]=\"readonly\"\r\n [disabled]=\"disabled\" pTextarea [rows]=\"rows\" [cols]=\"cols\" [autoResize]=\"autoResize\" [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \"\r\n [ngClass]=\"{'ng-invalid ng-dirty': control.invalid && (control.dirty || control.touched), 'basic-style': basicInput, 'no-style':noStyle}\">\r\n </textarea>\r\n }\r\n @case ('withIcon') {\r\n <p-iconfield class=\"filter-input\">\r\n <p-inputicon>\r\n <i [class]=\"iconClass\"></i>\r\n </p-inputicon>\r\n <input pInputText [id]=\"inputId\" type=\"text\" [placeholder]=\"placeholder\" [formControl]=\"control\" [readonly]=\"readonly\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid, 'basic-style': basicInput, 'no-style':noStyle}\" />\r\n @if (canClear && control.value) {\r\n <p-inputIcon (click)=\"clearInput()\">\r\n <i class=\"pi pi-times cursor-pointer text-sm text-gray-400 hover:text-gray-600\"></i>\r\n </p-inputIcon>\r\n }\r\n\r\n </p-iconfield>\r\n }\r\n @default {\r\n <p-floatlabel [variant]=\"variant\">\r\n <!-- <input pInputText id=\"value2\" [(ngModel)]=\"value2\" [invalid]=\"!value2\" autocomplete=\"off\" /> -->\r\n <input [id]=\"inputId\" [type]=\"'text-float-label'\" [formControl]=\"control\" [readonly]=\"readonly\" [pSize]=\"size\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \" [disabled]=\"disabled\" [name]=\"name\" pInputText [ngStyle]=\"{'direction': inputDirection || 'inherit'}\"\r\n class=\"w-full\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid, 'basic-style': basicInput, 'no-style':noStyle}\" />\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n </p-floatlabel>\r\n @if (prefix) {\r\n <span class=\"absolute top-[40px] font-bold text-[16px] left-[25px]\">\r\n {{ prefix }}\r\n </span>\r\n }\r\n\r\n\r\n }\r\n }\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n }\r\n @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br>\r\n }\r\n </small>\r\n }\r\n</div>", styles: ["textarea{@apply h-auto min-h-[50px] overflow-auto;}textarea,.p-select,input{border-radius:0;border-color:#dfe0e6}textarea:enabled:hover,.p-select:enabled:hover,input:enabled:hover{border-color:#dfe0e6}textarea:not(.p-disabled).p-focus,textarea:not(.p-disabled).p-focus:hover,textarea:focus,.p-select:not(.p-disabled).p-focus,.p-select:not(.p-disabled).p-focus:hover,.p-select:focus,input:not(.p-disabled).p-focus,input:not(.p-disabled).p-focus:hover,input:focus{outline:#DFE0E6;border-color:#dfe0e6}.p-floatlabel:has(input:focus) label,.p-floatlabel:has(input:-webkit-autofill) label,.p-floatlabel:has(textarea:focus) label,.p-floatlabel:has(.p-inputwrapper-focus) label{color:#687078}.p-inputtext:enabled:focus{border-color:#dfe0e6}.text-required{color:red}.p-error{color:#dc2626}.optional-label{@apply text-[10px] text-gray-400;margin-inline-start:4px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pSize", "variant", "fluid", "invalid"] }, { kind: "directive", type: Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3$1.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "component", type: InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "component", type: IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }] });
665
+ }
666
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: InputComponent, decorators: [{
667
+ type: Component,
668
+ args: [{ selector: 'stc-input', standalone: true, imports: [
669
+ ReactiveFormsModule,
670
+ InputText,
671
+ Textarea,
672
+ ValidationErrorsPipe,
673
+ NgClass,
674
+ NgStyle,
675
+ TranslatePipe,
676
+ FloatLabelModule,
677
+ InputIcon,
678
+ IconField,
679
+ ], template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n\r\n <!-- input text align will be handled according to lang when implemented -->\r\n\r\n @switch (type) {\r\n @case ('textarea') {\r\n @if (label) {\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n <!-- @else if (!hideOptionalLabel) {\r\n <span span class=\"optional-label\">{{'forms.config.optional' | translate}}</span>\r\n } -->\r\n </label>\r\n <ng-content></ng-content>\r\n </div>\r\n }\r\n <textarea [name]=\"name\" [id]=\"inputId\" [formControl]=\"control\" [placeholder]=\"placeholder\" [readonly]=\"readonly\"\r\n [disabled]=\"disabled\" pTextarea [rows]=\"rows\" [cols]=\"cols\" [autoResize]=\"autoResize\" [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \"\r\n [ngClass]=\"{'ng-invalid ng-dirty': control.invalid && (control.dirty || control.touched), 'basic-style': basicInput, 'no-style':noStyle}\">\r\n </textarea>\r\n }\r\n @case ('withIcon') {\r\n <p-iconfield class=\"filter-input\">\r\n <p-inputicon>\r\n <i [class]=\"iconClass\"></i>\r\n </p-inputicon>\r\n <input pInputText [id]=\"inputId\" type=\"text\" [placeholder]=\"placeholder\" [formControl]=\"control\" [readonly]=\"readonly\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid, 'basic-style': basicInput, 'no-style':noStyle}\" />\r\n @if (canClear && control.value) {\r\n <p-inputIcon (click)=\"clearInput()\">\r\n <i class=\"pi pi-times cursor-pointer text-sm text-gray-400 hover:text-gray-600\"></i>\r\n </p-inputIcon>\r\n }\r\n\r\n </p-iconfield>\r\n }\r\n @default {\r\n <p-floatlabel [variant]=\"variant\">\r\n <!-- <input pInputText id=\"value2\" [(ngModel)]=\"value2\" [invalid]=\"!value2\" autocomplete=\"off\" /> -->\r\n <input [id]=\"inputId\" [type]=\"'text-float-label'\" [formControl]=\"control\" [readonly]=\"readonly\" [pSize]=\"size\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \" [disabled]=\"disabled\" [name]=\"name\" pInputText [ngStyle]=\"{'direction': inputDirection || 'inherit'}\"\r\n class=\"w-full\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid, 'basic-style': basicInput, 'no-style':noStyle}\" />\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n </p-floatlabel>\r\n @if (prefix) {\r\n <span class=\"absolute top-[40px] font-bold text-[16px] left-[25px]\">\r\n {{ prefix }}\r\n </span>\r\n }\r\n\r\n\r\n }\r\n }\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n }\r\n @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br>\r\n }\r\n </small>\r\n }\r\n</div>", styles: ["textarea{@apply h-auto min-h-[50px] overflow-auto;}textarea,.p-select,input{border-radius:0;border-color:#dfe0e6}textarea:enabled:hover,.p-select:enabled:hover,input:enabled:hover{border-color:#dfe0e6}textarea:not(.p-disabled).p-focus,textarea:not(.p-disabled).p-focus:hover,textarea:focus,.p-select:not(.p-disabled).p-focus,.p-select:not(.p-disabled).p-focus:hover,.p-select:focus,input:not(.p-disabled).p-focus,input:not(.p-disabled).p-focus:hover,input:focus{outline:#DFE0E6;border-color:#dfe0e6}.p-floatlabel:has(input:focus) label,.p-floatlabel:has(input:-webkit-autofill) label,.p-floatlabel:has(textarea:focus) label,.p-floatlabel:has(.p-inputwrapper-focus) label{color:#687078}.p-inputtext:enabled:focus{border-color:#dfe0e6}.text-required{color:red}.p-error{color:#dc2626}.optional-label{@apply text-[10px] text-gray-400;margin-inline-start:4px}\n"] }]
680
+ }], ctorParameters: () => [], propDecorators: { type: [{
681
+ type: Input
682
+ }], contentType: [{
683
+ type: Input
684
+ }], size: [{
685
+ type: Input
686
+ }], prefix: [{
687
+ type: Input
688
+ }], rows: [{
689
+ type: Input
690
+ }], cols: [{
691
+ type: Input
692
+ }], autoResize: [{
693
+ type: Input
694
+ }], basicInput: [{
695
+ type: Input
696
+ }], noStyle: [{
697
+ type: Input
698
+ }], canClear: [{
699
+ type: Input
700
+ }], hideOptionalLabel: [{
701
+ type: Input
702
+ }], inputDirection: [{
703
+ type: Input
704
+ }], variant: [{
705
+ type: Input
706
+ }], defaultColor: [{
707
+ type: Input
708
+ }], iconClass: [{
709
+ type: Input
710
+ }], iconPosition: [{
711
+ type: Input
712
+ }] } });
713
+
714
+ class SelectButtonComponent extends BaseInputComponent {
715
+ onChange = new EventEmitter();
716
+ options;
717
+ title;
718
+ changeValue(e) {
719
+ this.onChange.emit(e.value);
720
+ }
721
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SelectButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
722
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: SelectButtonComponent, isStandalone: true, selector: "stc-select-button", inputs: { options: "options", title: "title" }, outputs: { onChange: "onChange" }, usesInheritance: true, ngImport: i0, template: "<div class=\"grid grid-cols-12 gap-x-4 gap-y-0 items-end\">\r\n <div class=\"col-span-12\">\r\n <div class=\"text-[14px] font-bold mb-1\">{{ title }}</div>\r\n <div class=\"grid w-100 bg-gray-100 rounded drop-shadow-basic\">\r\n <p-selectButton [disabled]=\"disabled\"\r\n [options]=\"options\"\r\n [formControl]=\"control\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n class=\"rounded\"\r\n [styleClass]=\"'full-width'\"\r\n (onChange)=\"changeValue($event)\">\r\n <ng-template let-item class=\"flex w-100\">\r\n <div class=\"col-span-4\">\r\n <span>{{ item.value }}</span>\r\n </div>\r\n </ng-template>\r\n </p-selectButton>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: SelectButtonModule }, { kind: "component", type: i2$2.SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "styleClass", "ariaLabelledBy", "dataKey", "autofocus", "size", "fluid"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: FormsModule }] });
723
+ }
724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SelectButtonComponent, decorators: [{
725
+ type: Component,
726
+ args: [{ selector: "stc-select-button", standalone: true, imports: [ReactiveFormsModule, SelectButtonModule, FormsModule], template: "<div class=\"grid grid-cols-12 gap-x-4 gap-y-0 items-end\">\r\n <div class=\"col-span-12\">\r\n <div class=\"text-[14px] font-bold mb-1\">{{ title }}</div>\r\n <div class=\"grid w-100 bg-gray-100 rounded drop-shadow-basic\">\r\n <p-selectButton [disabled]=\"disabled\"\r\n [options]=\"options\"\r\n [formControl]=\"control\"\r\n optionLabel=\"label\"\r\n optionValue=\"value\"\r\n class=\"rounded\"\r\n [styleClass]=\"'full-width'\"\r\n (onChange)=\"changeValue($event)\">\r\n <ng-template let-item class=\"flex w-100\">\r\n <div class=\"col-span-4\">\r\n <span>{{ item.value }}</span>\r\n </div>\r\n </ng-template>\r\n </p-selectButton>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
727
+ }], propDecorators: { onChange: [{
728
+ type: Output
729
+ }], options: [{
730
+ type: Input
731
+ }], title: [{
732
+ type: Input
733
+ }] } });
734
+
735
+ class SelectComponent extends BaseInputComponent {
736
+ selectedItemTemplate = null;
737
+ optionTemplate = null;
738
+ options = [];
739
+ optionLabel;
740
+ optionValue;
741
+ emptyMessage;
742
+ checkmark = true;
743
+ showClear = false;
744
+ editable = false;
745
+ filter = false;
746
+ multiple = false;
747
+ filterBy;
748
+ selectAllLabel;
749
+ dataKey;
750
+ size = 'small';
751
+ selectedItemsLabel;
752
+ basicInput;
753
+ variant = 'over';
754
+ // eslint-disable-next-line @angular-eslint/no-output-native
755
+ change = new EventEmitter();
756
+ defaultColor = '#DFE0E6';
757
+ allSelectd = false;
758
+ constructor() {
759
+ super();
760
+ }
761
+ toggleAll(event) {
762
+ if (!event.checked) {
763
+ this.control.setValue([]);
764
+ return;
765
+ }
766
+ const values = this.optionValue
767
+ ? this.options.map((o) => o[this.optionValue])
768
+ : this.options;
769
+ this.control.setValue([...values]);
770
+ }
771
+ onMultiSelectClear() {
772
+ this.allSelectd = false;
773
+ }
774
+ onChange(e) {
775
+ this.change.emit(e);
776
+ }
777
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
778
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: SelectComponent, isStandalone: true, selector: "stc-select", inputs: { selectedItemTemplate: "selectedItemTemplate", optionTemplate: "optionTemplate", options: "options", optionLabel: "optionLabel", optionValue: "optionValue", emptyMessage: "emptyMessage", checkmark: "checkmark", showClear: "showClear", editable: "editable", filter: "filter", multiple: "multiple", filterBy: "filterBy", selectAllLabel: "selectAllLabel", dataKey: "dataKey", size: "size", selectedItemsLabel: "selectedItemsLabel", basicInput: "basicInput", variant: "variant", defaultColor: "defaultColor" }, outputs: { change: "change" }, usesInheritance: true, ngImport: i0, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n\r\n @if(multiple) {\r\n <p-floatLabel [variant]=\"variant\">\r\n\r\n <p-multiselect\r\n [disabled]=\"disabled\"\r\n [filterBy]=\"filterBy\"\r\n [filter]=\"filter\"\r\n [formControl]=\"control\"\r\n [id]=\"inputId\"\r\n [name]=\"name\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid }\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n [options]=\"options\"\r\n [showToggleAll]=\"false\"\r\n [placeholder]=\"placeholder\"\r\n [emptyMessage]=\"emptyMessage || ('shared.no_results_found'|translate)\"\r\n [readonly]=\"readonly\"\r\n [showClear]=\"showClear\"\r\n (onClear)=\"onMultiSelectClear()\"\r\n class=\"w-full\"\r\n [size]=\"size\"\r\n [selectedItemsLabel]=\"selectedItemsLabel || ('shared.Items_Selected'| translate: {count: '{0}'})\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \"\r\n (onChange)=\"onChange($event)\"\r\n [ngClass]=\"{ 'basic-style': basicInput }\"\r\n >\r\n\r\n @if (selectAllLabel) {\r\n <ng-template #filter>\r\n <p-checkbox\r\n binary=\"true\"\r\n [(ngModel)]=\"allSelectd\"\r\n (onChange)=\"toggleAll($event)\"\r\n inputId=\"toggleAll\">\r\n </p-checkbox>\r\n <span>{{selectAllLabel}}</span>\r\n </ng-template>\r\n }\r\n\r\n @if(optionTemplate){\r\n <ng-template let-item #item>\r\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: item }\" [ngTemplateOutlet]=\"optionTemplate\" />\r\n </ng-template>\r\n }\r\n\r\n\r\n\r\n\r\n\r\n </p-multiselect>\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n\r\n </p-floatLabel>\r\n\r\n } @else {\r\n <p-floatLabel [variant]=\"variant\">\r\n <p-select\r\n [dataKey]=\"dataKey\"\r\n [checkmark]=\"checkmark\"\r\n [disabled]=\"disabled\"\r\n [editable]=\"editable\"\r\n [filterBy]=\"filterBy\"\r\n [filter]=\"filter\"\r\n [formControl]=\"control\"\r\n [id]=\"inputId\"\r\n [name]=\"name\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid }\"\r\n [emptyMessage]=\"emptyMessage || ('shared.no_results_found'|translate)\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n [options]=\"options\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [showClear]=\"showClear\"\r\n [size]=\"size\"\r\n class=\"w-full\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \"\r\n (onChange)=\"onChange($event)\"\r\n [ngClass]=\"{ 'basic-style': basicInput }\"\r\n >\r\n\r\n @if (optionTemplate) {\r\n <ng-template let-item pTemplate=\"item\">\r\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: item }\" [ngTemplateOutlet]=\"optionTemplate\" />\r\n </ng-template>\r\n }\r\n @if (selectedItemTemplate) {\r\n <ng-template let-item pTemplate=\"selectedItem\">\r\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: item }\" [ngTemplateOutlet]=\"selectedItemTemplate\" />\r\n </ng-template>\r\n }\r\n </p-select>\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n </p-floatLabel>\r\n }\r\n\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n } @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br />\r\n }\r\n </small>\r\n }\r\n</div>\r\n", styles: ["textarea,.p-select{border-radius:0;border-color:#dfe0e6}textarea:enabled:hover,.p-select:enabled:hover{border-color:#dfe0e6}textarea:not(.p-disabled).p-focus,textarea:not(.p-disabled).p-focus:hover,textarea:focus,.p-select:not(.p-disabled).p-focus,.p-select:not(.p-disabled).p-focus:hover,.p-select:focus{outline:#DFE0E6;border-color:#dfe0e6}.p-floatlabel:has(input:focus) label,.p-floatlabel:has(input:-webkit-autofill) label,.p-floatlabel:has(textarea:focus) label,.p-floatlabel:has(.p-inputwrapper-focus) label{color:#687078}.p-inputtext:enabled:focus{border-color:#dfe0e6}.p-select .p-select-label{padding-block-end:1rem!important;padding-block-start:1rem!important}.text-required{color:red}.p-error{color:#dc2626}.edit-search .p-select-label{padding:1rem 1rem 1rem 2.2rem!important}.edit-search .p-floatlabel>label{padding-inline-start:25px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i2$3.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3$1.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["hostName", "value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
779
+ }
780
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SelectComponent, decorators: [{
781
+ type: Component,
782
+ args: [{ selector: 'stc-select', standalone: true, imports: [
783
+ FormsModule,
784
+ Select,
785
+ ReactiveFormsModule,
786
+ NgClass,
787
+ NgTemplateOutlet,
788
+ PrimeTemplate,
789
+ ValidationErrorsPipe,
790
+ MultiSelectModule,
791
+ FloatLabelModule,
792
+ TranslatePipe,
793
+ CheckboxModule,
794
+ ], encapsulation: ViewEncapsulation.None, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n\r\n @if(multiple) {\r\n <p-floatLabel [variant]=\"variant\">\r\n\r\n <p-multiselect\r\n [disabled]=\"disabled\"\r\n [filterBy]=\"filterBy\"\r\n [filter]=\"filter\"\r\n [formControl]=\"control\"\r\n [id]=\"inputId\"\r\n [name]=\"name\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid }\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n [options]=\"options\"\r\n [showToggleAll]=\"false\"\r\n [placeholder]=\"placeholder\"\r\n [emptyMessage]=\"emptyMessage || ('shared.no_results_found'|translate)\"\r\n [readonly]=\"readonly\"\r\n [showClear]=\"showClear\"\r\n (onClear)=\"onMultiSelectClear()\"\r\n class=\"w-full\"\r\n [size]=\"size\"\r\n [selectedItemsLabel]=\"selectedItemsLabel || ('shared.Items_Selected'| translate: {count: '{0}'})\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \"\r\n (onChange)=\"onChange($event)\"\r\n [ngClass]=\"{ 'basic-style': basicInput }\"\r\n >\r\n\r\n @if (selectAllLabel) {\r\n <ng-template #filter>\r\n <p-checkbox\r\n binary=\"true\"\r\n [(ngModel)]=\"allSelectd\"\r\n (onChange)=\"toggleAll($event)\"\r\n inputId=\"toggleAll\">\r\n </p-checkbox>\r\n <span>{{selectAllLabel}}</span>\r\n </ng-template>\r\n }\r\n\r\n @if(optionTemplate){\r\n <ng-template let-item #item>\r\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: item }\" [ngTemplateOutlet]=\"optionTemplate\" />\r\n </ng-template>\r\n }\r\n\r\n\r\n\r\n\r\n\r\n </p-multiselect>\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n\r\n </p-floatLabel>\r\n\r\n } @else {\r\n <p-floatLabel [variant]=\"variant\">\r\n <p-select\r\n [dataKey]=\"dataKey\"\r\n [checkmark]=\"checkmark\"\r\n [disabled]=\"disabled\"\r\n [editable]=\"editable\"\r\n [filterBy]=\"filterBy\"\r\n [filter]=\"filter\"\r\n [formControl]=\"control\"\r\n [id]=\"inputId\"\r\n [name]=\"name\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid }\"\r\n [emptyMessage]=\"emptyMessage || ('shared.no_results_found'|translate)\"\r\n [optionLabel]=\"optionLabel\"\r\n [optionValue]=\"optionValue\"\r\n [options]=\"options\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [showClear]=\"showClear\"\r\n [size]=\"size\"\r\n class=\"w-full\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \"\r\n (onChange)=\"onChange($event)\"\r\n [ngClass]=\"{ 'basic-style': basicInput }\"\r\n >\r\n\r\n @if (optionTemplate) {\r\n <ng-template let-item pTemplate=\"item\">\r\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: item }\" [ngTemplateOutlet]=\"optionTemplate\" />\r\n </ng-template>\r\n }\r\n @if (selectedItemTemplate) {\r\n <ng-template let-item pTemplate=\"selectedItem\">\r\n <ng-container [ngTemplateOutletContext]=\"{ $implicit: item }\" [ngTemplateOutlet]=\"selectedItemTemplate\" />\r\n </ng-template>\r\n }\r\n </p-select>\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n </p-floatLabel>\r\n }\r\n\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n } @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br />\r\n }\r\n </small>\r\n }\r\n</div>\r\n", styles: ["textarea,.p-select{border-radius:0;border-color:#dfe0e6}textarea:enabled:hover,.p-select:enabled:hover{border-color:#dfe0e6}textarea:not(.p-disabled).p-focus,textarea:not(.p-disabled).p-focus:hover,textarea:focus,.p-select:not(.p-disabled).p-focus,.p-select:not(.p-disabled).p-focus:hover,.p-select:focus{outline:#DFE0E6;border-color:#dfe0e6}.p-floatlabel:has(input:focus) label,.p-floatlabel:has(input:-webkit-autofill) label,.p-floatlabel:has(textarea:focus) label,.p-floatlabel:has(.p-inputwrapper-focus) label{color:#687078}.p-inputtext:enabled:focus{border-color:#dfe0e6}.p-select .p-select-label{padding-block-end:1rem!important;padding-block-start:1rem!important}.text-required{color:red}.p-error{color:#dc2626}.edit-search .p-select-label{padding:1rem 1rem 1rem 2.2rem!important}.edit-search .p-floatlabel>label{padding-inline-start:25px}\n"] }]
795
+ }], ctorParameters: () => [], propDecorators: { selectedItemTemplate: [{
796
+ type: Input
797
+ }], optionTemplate: [{
798
+ type: Input
799
+ }], options: [{
800
+ type: Input
801
+ }], optionLabel: [{
802
+ type: Input
803
+ }], optionValue: [{
804
+ type: Input
805
+ }], emptyMessage: [{
806
+ type: Input
807
+ }], checkmark: [{
808
+ type: Input
809
+ }], showClear: [{
810
+ type: Input
811
+ }], editable: [{
812
+ type: Input
813
+ }], filter: [{
814
+ type: Input
815
+ }], multiple: [{
816
+ type: Input
817
+ }], filterBy: [{
818
+ type: Input
819
+ }], selectAllLabel: [{
820
+ type: Input
821
+ }], dataKey: [{
822
+ type: Input
823
+ }], size: [{
824
+ type: Input
825
+ }], selectedItemsLabel: [{
826
+ type: Input
827
+ }], basicInput: [{
828
+ type: Input
829
+ }], variant: [{
830
+ type: Input
831
+ }], change: [{
832
+ type: Output
833
+ }], defaultColor: [{
834
+ type: Input
835
+ }] } });
836
+
837
+ class SwitchComponent {
838
+ label;
839
+ key;
840
+ checked = false;
841
+ onChange = new EventEmitter();
842
+ // checked: boolean = false;
843
+ sendUpdatedValue(value) {
844
+ if (value) {
845
+ this.onChange.emit(value.checked);
846
+ }
847
+ }
848
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
849
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: SwitchComponent, isStandalone: true, selector: "stc-switch", inputs: { label: "label", key: "key", checked: "checked" }, outputs: { onChange: "onChange" }, ngImport: i0, template: "<div class=\"flex items-center mr-2\">\r\n <p-toggleswitch [(ngModel)]=\"checked\" [inputId]=\"key\" (onChange)=\"sendUpdatedValue($event)\" class=\"flex\">\r\n </p-toggleswitch>\r\n <label [for]=\"key\" class=\"text-[12px] mx-2\">{{label}}</label>\r\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ToggleSwitchModule }, { kind: "component", type: i1$5.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
850
+ }
851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SwitchComponent, decorators: [{
852
+ type: Component,
853
+ args: [{ selector: "stc-switch", standalone: true, imports: [CommonModule, ToggleSwitchModule, FormsModule], template: "<div class=\"flex items-center mr-2\">\r\n <p-toggleswitch [(ngModel)]=\"checked\" [inputId]=\"key\" (onChange)=\"sendUpdatedValue($event)\" class=\"flex\">\r\n </p-toggleswitch>\r\n <label [for]=\"key\" class=\"text-[12px] mx-2\">{{label}}</label>\r\n</div>" }]
854
+ }], propDecorators: { label: [{
855
+ type: Input
856
+ }], key: [{
857
+ type: Input
858
+ }], checked: [{
859
+ type: Input
860
+ }], onChange: [{
861
+ type: Output
862
+ }] } });
863
+
864
+ var FormFieldTypeEnum;
865
+ (function (FormFieldTypeEnum) {
866
+ FormFieldTypeEnum["DATE_PICKER"] = "date-picker";
867
+ FormFieldTypeEnum["SELECT_BUTTON"] = "select-button";
868
+ FormFieldTypeEnum["INPUT"] = "input";
869
+ FormFieldTypeEnum["SELECT"] = "select";
870
+ FormFieldTypeEnum["SWITCH"] = "switch";
871
+ FormFieldTypeEnum["AUTO_COMPLETE"] = "auto-complete";
872
+ FormFieldTypeEnum["HIJRI_DATE_PICKER"] = "hijri-date";
873
+ })(FormFieldTypeEnum || (FormFieldTypeEnum = {}));
874
+
875
+ const WEEKDAYS = {
876
+ ar: ['ن', 'ث', 'ر', 'خ', 'ج', 'س', 'ح'],
877
+ en: ['M', 'T', 'W', 'T', 'F', 'S', 'S']
878
+ };
879
+ const MONTHS_GREGORIAN = {
880
+ ar: [
881
+ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو',
882
+ 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'
883
+ ],
884
+ en: [
885
+ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
886
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
887
+ ]
888
+ };
889
+ const MONTHS_HIJRI = {
890
+ ar: [
891
+ 'محرم',
892
+ 'صفر',
893
+ 'ربيع الأول',
894
+ 'ربيع الآخر',
895
+ 'جمادى الأولى',
896
+ 'جمادى الآخرة',
897
+ 'رجب',
898
+ 'شعبان',
899
+ 'رمضان',
900
+ 'شوال',
901
+ 'ذو القعدة',
902
+ 'ذو الحجة'
903
+ ],
904
+ en: [
905
+ 'Muharram',
906
+ 'Safar',
907
+ 'Rabi Al-Awwal',
908
+ 'Rabi Al-Thani',
909
+ 'Jumada Al-Awwal',
910
+ 'Jumada Al-Thani',
911
+ 'Rajab',
912
+ 'Shaaban',
913
+ 'Ramadan',
914
+ 'Shawwal',
915
+ 'Dhul-Qi’dah',
916
+ 'Dhul-Hijjah'
917
+ ]
918
+ };
919
+ function getGregorianMonthName(lang, month) {
920
+ return MONTHS_GREGORIAN[lang][month - 1] || '';
921
+ }
922
+ function getHijriMonthName(lang, month) {
923
+ return MONTHS_HIJRI[lang][month - 1] || '';
924
+ }
925
+ function getWeekdayName(lang, weekday) {
926
+ return WEEKDAYS[lang][weekday - 1];
927
+ }
928
+
929
+ class IslamicI18n extends NgbDatepickerI18n {
930
+ getMonthShortName(month) {
931
+ return MONTHS_HIJRI.ar[month - 1];
932
+ }
933
+ getMonthFullName(month) {
934
+ return MONTHS_HIJRI.ar[month - 1];
935
+ }
936
+ getWeekdayLabel(weekday) {
937
+ return WEEKDAYS.ar[weekday - 1];
938
+ }
939
+ getWeekdayShortName(weekday) {
940
+ return WEEKDAYS.ar[weekday - 1];
941
+ }
942
+ getDayAriaLabel(date) {
943
+ return `${date.day}-${date.month}-${date.year}`;
944
+ }
945
+ getYearNumerals(year) {
946
+ return String(year);
947
+ }
948
+ getWeekNumerals(weekNumber) {
949
+ return String(weekNumber);
950
+ }
951
+ getDayNumerals(date) {
952
+ return String(date.day);
953
+ }
954
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IslamicI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
955
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IslamicI18n });
956
+ }
957
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IslamicI18n, decorators: [{
958
+ type: Injectable
959
+ }] });
960
+ class HijriEnglishI18n extends NgbDatepickerI18n {
961
+ getMonthShortName(month) {
962
+ return MONTHS_HIJRI.en[month - 1].substring(0, 3);
963
+ }
964
+ getMonthFullName(month) {
965
+ return MONTHS_HIJRI.en[month - 1];
966
+ }
967
+ getWeekdayLabel(weekday) {
968
+ return WEEKDAYS.en[weekday - 1];
969
+ }
970
+ getWeekdayShortName(weekday) {
971
+ return WEEKDAYS.en[weekday - 1];
972
+ }
973
+ getDayAriaLabel(date) {
974
+ return `${date.day}-${date.month}-${date.year}`;
975
+ }
976
+ getYearNumerals(year) {
977
+ return String(year);
978
+ }
979
+ getWeekNumerals(weekNumber) {
980
+ return String(weekNumber);
981
+ }
982
+ getDayNumerals(date) {
983
+ return String(date.day);
984
+ }
985
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HijriEnglishI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
986
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HijriEnglishI18n });
987
+ }
988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HijriEnglishI18n, decorators: [{
989
+ type: Injectable
990
+ }] });
991
+ class DynamicHijriI18n extends NgbDatepickerI18n {
992
+ currentLang = 'ar';
993
+ arabicI18n = new IslamicI18n();
994
+ englishI18n = new HijriEnglishI18n();
995
+ setLanguage(lang) {
996
+ this.currentLang = lang;
997
+ }
998
+ get activeI18n() {
999
+ return this.currentLang === 'ar' ? this.arabicI18n : this.englishI18n;
1000
+ }
1001
+ getMonthShortName(month) {
1002
+ return this.activeI18n.getMonthShortName(month);
1003
+ }
1004
+ getMonthFullName(month) {
1005
+ return this.activeI18n.getMonthFullName(month);
1006
+ }
1007
+ getWeekdayLabel(weekday) {
1008
+ return this.activeI18n.getWeekdayLabel(weekday);
1009
+ }
1010
+ getWeekdayShortName(weekday) {
1011
+ return this.activeI18n.getWeekdayShortName(weekday);
1012
+ }
1013
+ getDayAriaLabel(date) {
1014
+ return this.activeI18n.getDayAriaLabel(date);
1015
+ }
1016
+ getYearNumerals(year) {
1017
+ return this.activeI18n.getYearNumerals(year);
1018
+ }
1019
+ getWeekNumerals(weekNumber) {
1020
+ return this.activeI18n.getWeekNumerals(weekNumber);
1021
+ }
1022
+ getDayNumerals(date) {
1023
+ return this.activeI18n.getDayNumerals(date);
1024
+ }
1025
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicHijriI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1026
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicHijriI18n });
1027
+ }
1028
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicHijriI18n, decorators: [{
1029
+ type: Injectable
1030
+ }] });
1031
+
1032
+ class HijriCalendarComponent {
1033
+ i18n;
1034
+ cdr;
1035
+ model;
1036
+ dateSelected = new EventEmitter();
1037
+ language = 'en';
1038
+ renderer = inject(Renderer2);
1039
+ startDate;
1040
+ calendar = new NgbCalendarIslamicUmalqura();
1041
+ constructor(i18n, cdr) {
1042
+ this.i18n = i18n;
1043
+ this.cdr = cdr;
1044
+ }
1045
+ ngOnChanges(changes) {
1046
+ if (changes['model'] && changes['model'].currentValue) {
1047
+ this.startDate = { ...changes['model'].currentValue };
1048
+ console.log('Hijri navigating to:', this.startDate);
1049
+ }
1050
+ if (changes['language'] && this.i18n instanceof DynamicHijriI18n) {
1051
+ this.i18n.setLanguage(this.language);
1052
+ this.cdr.detectChanges(); // Force re-render to update labels
1053
+ }
1054
+ }
1055
+ ngAfterViewInit() {
1056
+ const buttons = document.querySelectorAll('.ngb-dp-arrow-btn');
1057
+ buttons.forEach(btn => {
1058
+ this.renderer.removeAttribute(btn, 'title');
1059
+ });
1060
+ }
1061
+ onDateChange(date) {
1062
+ this.model = date;
1063
+ this.startDate = { ...date };
1064
+ }
1065
+ isToday(date) {
1066
+ const today = this.calendar.getToday();
1067
+ return date.year === today.year &&
1068
+ date.month === today.month &&
1069
+ date.day === today.day;
1070
+ }
1071
+ isDisabled = () => false;
1072
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HijriCalendarComponent, deps: [{ token: i1$6.NgbDatepickerI18n }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1073
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: HijriCalendarComponent, isStandalone: true, selector: "app-hijri-calendar", inputs: { model: "model", language: "language" }, outputs: { dateSelected: "dateSelected" }, providers: [
1074
+ { provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura },
1075
+ { provide: NgbDatepickerI18n, useClass: DynamicHijriI18n }
1076
+ ], usesOnChanges: true, ngImport: i0, template: "<ngb-datepicker #dp [class.rtl]=\"language === 'ar'\" [class.ltr]=\"language === 'en'\" [ngModel]=\"model\"\r\n [startDate]=\"startDate\" (ngModelChange)=\"onDateChange($event)\" (dateSelect)=\"dateSelected.emit($event)\"\r\n [dayTemplate]=\"dayTemplate\" [markDisabled]=\"isDisabled\">\r\n</ngb-datepicker>\r\n<ng-template #dayTemplate let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\">\r\n <span class=\"custom-day\" [class.today]=\"isToday(date)\" [class.selected]=\"selected\"\r\n [class.outside]=\"date.month !== currentMonth\" [class.disabled]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "component", type: i1$6.NgbDatepicker, selector: "ngb-datepicker", inputs: ["contentTemplate", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "maxDate", "minDate", "navigation", "outsideDays", "showWeekNumbers", "startDate", "weekdays"], outputs: ["navigate", "dateSelect"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1077
+ }
1078
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HijriCalendarComponent, decorators: [{
1079
+ type: Component,
1080
+ args: [{ selector: "app-hijri-calendar", standalone: true, imports: [NgbDatepickerModule, FormsModule], providers: [
1081
+ { provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura },
1082
+ { provide: NgbDatepickerI18n, useClass: DynamicHijriI18n }
1083
+ ], template: "<ngb-datepicker #dp [class.rtl]=\"language === 'ar'\" [class.ltr]=\"language === 'en'\" [ngModel]=\"model\"\r\n [startDate]=\"startDate\" (ngModelChange)=\"onDateChange($event)\" (dateSelect)=\"dateSelected.emit($event)\"\r\n [dayTemplate]=\"dayTemplate\" [markDisabled]=\"isDisabled\">\r\n</ngb-datepicker>\r\n<ng-template #dayTemplate let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\">\r\n <span class=\"custom-day\" [class.today]=\"isToday(date)\" [class.selected]=\"selected\"\r\n [class.outside]=\"date.month !== currentMonth\" [class.disabled]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n</ng-template>\r\n" }]
1084
+ }], ctorParameters: () => [{ type: i1$6.NgbDatepickerI18n }, { type: i0.ChangeDetectorRef }], propDecorators: { model: [{
1085
+ type: Input
1086
+ }], dateSelected: [{
1087
+ type: Output
1088
+ }], language: [{
1089
+ type: Input
1090
+ }] } });
1091
+
1092
+ class GregorianArabicI18n extends NgbDatepickerI18n {
1093
+ getMonthShortName(month) {
1094
+ return MONTHS_GREGORIAN.ar[month - 1];
1095
+ }
1096
+ getMonthFullName(month) {
1097
+ return MONTHS_GREGORIAN.ar[month - 1];
1098
+ }
1099
+ getWeekdayLabel(weekday) {
1100
+ return WEEKDAYS.ar[weekday - 1];
1101
+ }
1102
+ getWeekdayShortName(weekday) {
1103
+ return WEEKDAYS.ar[weekday - 1];
1104
+ }
1105
+ getDayAriaLabel(date) {
1106
+ return `${date.day}-${date.month}-${date.year}`;
1107
+ }
1108
+ getYearNumerals(year) {
1109
+ return String(year);
1110
+ }
1111
+ getWeekNumerals(weekNumber) {
1112
+ return String(weekNumber);
1113
+ }
1114
+ getDayNumerals(date) {
1115
+ return String(date.day);
1116
+ }
1117
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianArabicI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1118
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianArabicI18n });
1119
+ }
1120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianArabicI18n, decorators: [{
1121
+ type: Injectable
1122
+ }] });
1123
+ class GregorianEnglishI18n extends NgbDatepickerI18n {
1124
+ getMonthShortName(month) {
1125
+ return MONTHS_GREGORIAN.en[month - 1].substring(0, 3);
1126
+ }
1127
+ getMonthFullName(month) {
1128
+ return MONTHS_GREGORIAN.en[month - 1];
1129
+ }
1130
+ getWeekdayLabel(weekday) {
1131
+ return WEEKDAYS.en[weekday - 1];
1132
+ }
1133
+ getWeekdayShortName(weekday) {
1134
+ return WEEKDAYS.en[weekday - 1];
1135
+ }
1136
+ getDayAriaLabel(date) {
1137
+ return `${date.day}-${date.month}-${date.year}`;
1138
+ }
1139
+ getYearNumerals(year) {
1140
+ return String(year);
1141
+ }
1142
+ getWeekNumerals(weekNumber) {
1143
+ return String(weekNumber);
1144
+ }
1145
+ getDayNumerals(date) {
1146
+ return String(date.day);
1147
+ }
1148
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianEnglishI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1149
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianEnglishI18n });
1150
+ }
1151
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianEnglishI18n, decorators: [{
1152
+ type: Injectable
1153
+ }] });
1154
+ // ============ Dynamic I18N Factory ============
1155
+ class DynamicGregorianI18n extends NgbDatepickerI18n {
1156
+ currentLang = 'en';
1157
+ arabicI18n = new GregorianArabicI18n();
1158
+ englishI18n = new GregorianEnglishI18n();
1159
+ setLanguage(lang) {
1160
+ this.currentLang = lang;
1161
+ }
1162
+ get activeI18n() {
1163
+ return this.currentLang === 'ar' ? this.arabicI18n : this.englishI18n;
1164
+ }
1165
+ getMonthShortName(month) {
1166
+ return this.activeI18n.getMonthShortName(month);
1167
+ }
1168
+ getMonthFullName(month) {
1169
+ return this.activeI18n.getMonthFullName(month);
1170
+ }
1171
+ getWeekdayLabel(weekday) {
1172
+ return this.activeI18n.getWeekdayLabel(weekday);
1173
+ }
1174
+ getWeekdayShortName(weekday) {
1175
+ return this.activeI18n.getWeekdayShortName(weekday);
1176
+ }
1177
+ getDayAriaLabel(date) {
1178
+ return this.activeI18n.getDayAriaLabel(date);
1179
+ }
1180
+ getYearNumerals(year) {
1181
+ return this.activeI18n.getYearNumerals(year);
1182
+ }
1183
+ getWeekNumerals(weekNumber) {
1184
+ return this.activeI18n.getWeekNumerals(weekNumber);
1185
+ }
1186
+ getDayNumerals(date) {
1187
+ return this.activeI18n.getDayNumerals(date);
1188
+ }
1189
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicGregorianI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1190
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicGregorianI18n });
1191
+ }
1192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicGregorianI18n, decorators: [{
1193
+ type: Injectable
1194
+ }] });
1195
+
1196
+ class GregorianCalendarComponent {
1197
+ model;
1198
+ dateSelected = new EventEmitter();
1199
+ renderer = inject(Renderer2);
1200
+ language = 'en';
1201
+ startDate;
1202
+ calendar = new NgbCalendarGregorian();
1203
+ i18n = inject(NgbDatepickerI18n);
1204
+ cdr = inject(ChangeDetectorRef);
1205
+ calendarKey = 0;
1206
+ ngOnChanges(changes) {
1207
+ if (changes['model'] && changes['model'].currentValue) {
1208
+ this.startDate = { ...changes['model'].currentValue };
1209
+ }
1210
+ if (changes['language'] && this.i18n instanceof DynamicGregorianI18n) {
1211
+ this.i18n.setLanguage(this.language);
1212
+ this.calendarKey++; // Increment to force recreation
1213
+ }
1214
+ }
1215
+ ngAfterViewInit() {
1216
+ const buttons = document.querySelectorAll('.ngb-dp-arrow-btn');
1217
+ buttons.forEach(btn => {
1218
+ this.renderer.removeAttribute(btn, 'title');
1219
+ });
1220
+ }
1221
+ onDateChange(date) {
1222
+ this.model = date;
1223
+ this.startDate = { ...date };
1224
+ }
1225
+ isToday(date) {
1226
+ const today = this.calendar.getToday();
1227
+ return date.year === today.year &&
1228
+ date.month === today.month &&
1229
+ date.day === today.day;
1230
+ }
1231
+ isDisabled = () => false;
1232
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1233
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: GregorianCalendarComponent, isStandalone: true, selector: "app-gregorian-calendar", inputs: { model: "model", language: "language" }, outputs: { dateSelected: "dateSelected" }, providers: [
1234
+ { provide: NgbCalendar, useClass: NgbCalendarGregorian },
1235
+ { provide: NgbDatepickerI18n, useClass: DynamicGregorianI18n }
1236
+ ], usesOnChanges: true, ngImport: i0, template: "@for(item of [calendarKey]; track item) {\r\n <ngb-datepicker #dp\r\n [class.rtl]=\"language === 'ar'\"\r\n [class.ltr]=\"language === 'en'\"\r\n [ngModel]=\"model\"\r\n [startDate]=\"startDate\"\r\n (ngModelChange)=\"onDateChange($event)\"\r\n (dateSelect)=\"dateSelected.emit($event)\"\r\n [dayTemplate]=\"dayTemplate\"\r\n [markDisabled]=\"isDisabled\">\r\n </ngb-datepicker>\r\n <ng-template #dayTemplate let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\">\r\n <span class=\"custom-day\"\r\n [class.today]=\"isToday(date)\"\r\n [class.selected]=\"selected\"\r\n [class.outside]=\"date.month !== currentMonth\"\r\n [class.disabled]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n}\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "component", type: i1$6.NgbDatepicker, selector: "ngb-datepicker", inputs: ["contentTemplate", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "maxDate", "minDate", "navigation", "outsideDays", "showWeekNumbers", "startDate", "weekdays"], outputs: ["navigate", "dateSelect"], exportAs: ["ngbDatepicker"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], encapsulation: i0.ViewEncapsulation.None });
1237
+ }
1238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianCalendarComponent, decorators: [{
1239
+ type: Component,
1240
+ args: [{ selector: "app-gregorian-calendar", standalone: true, imports: [NgbDatepickerModule, FormsModule], providers: [
1241
+ { provide: NgbCalendar, useClass: NgbCalendarGregorian },
1242
+ { provide: NgbDatepickerI18n, useClass: DynamicGregorianI18n }
1243
+ ], encapsulation: ViewEncapsulation.None, template: "@for(item of [calendarKey]; track item) {\r\n <ngb-datepicker #dp\r\n [class.rtl]=\"language === 'ar'\"\r\n [class.ltr]=\"language === 'en'\"\r\n [ngModel]=\"model\"\r\n [startDate]=\"startDate\"\r\n (ngModelChange)=\"onDateChange($event)\"\r\n (dateSelect)=\"dateSelected.emit($event)\"\r\n [dayTemplate]=\"dayTemplate\"\r\n [markDisabled]=\"isDisabled\">\r\n </ngb-datepicker>\r\n <ng-template #dayTemplate let-date let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\">\r\n <span class=\"custom-day\"\r\n [class.today]=\"isToday(date)\"\r\n [class.selected]=\"selected\"\r\n [class.outside]=\"date.month !== currentMonth\"\r\n [class.disabled]=\"disabled\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n}\r\n" }]
1244
+ }], propDecorators: { model: [{
1245
+ type: Input
1246
+ }], dateSelected: [{
1247
+ type: Output
1248
+ }], language: [{
1249
+ type: Input
1250
+ }] } });
1251
+
1252
+ class DatePickerSwitcherComponent extends BaseInputComponent {
1253
+ type = 'text';
1254
+ contentType = 'text';
1255
+ size = "small";
1256
+ prefix;
1257
+ rows = 2;
1258
+ cols = 20;
1259
+ autoResize = true;
1260
+ basicInput;
1261
+ noStyle;
1262
+ hideOptionalLabel;
1263
+ inputDirection = 'inherit';
1264
+ variant = 'over';
1265
+ defaultColor = '#DFE0E6';
1266
+ formattedDate = '';
1267
+ openCalender = new EventEmitter();
1268
+ constructor() {
1269
+ super();
1270
+ }
1271
+ ngOnChanges(changes) {
1272
+ if (changes['formattedDate'] && changes['formattedDate'].currentValue) {
1273
+ // Update the FormControl value if parent changes the formattedDate
1274
+ this.control.setValue(changes['formattedDate'].currentValue, { emitEvent: false });
1275
+ }
1276
+ }
1277
+ ngOnInit() {
1278
+ this.control.setValue(this.formattedDate);
1279
+ }
1280
+ clearButtonClick(e) {
1281
+ this.control.setValue(null);
1282
+ }
1283
+ openCalendar(isOpen) {
1284
+ this.openCalender.emit(isOpen);
1285
+ }
1286
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DatePickerSwitcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1287
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DatePickerSwitcherComponent, isStandalone: true, selector: "stc-date-picker-switcher", inputs: { type: "type", contentType: "contentType", size: "size", prefix: "prefix", rows: "rows", cols: "cols", autoResize: "autoResize", basicInput: "basicInput", noStyle: "noStyle", hideOptionalLabel: "hideOptionalLabel", inputDirection: "inputDirection", variant: "variant", defaultColor: "defaultColor", formattedDate: "formattedDate" }, outputs: { openCalender: "openCalender" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n <p-floatlabel [variant]=\"variant\">\r\n <input [id]=\"inputId\" [type]=\"'text-float-label'\" [formControl]=\"control\" [readonly]=\"true\" (focus)=\"openCalendar(true)\"\r\n (click)=\"openCalendar(true)\" [pSize]=\"'small'\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \" [disabled]=\"disabled\" [name]=\"name\" pInputText\r\n class=\"w-full\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid, 'basic-style': basicInput, 'no-style':noStyle}\" />\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n </p-floatlabel>\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n }\r\n @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br>\r\n }\r\n </small>\r\n }\r\n</div>\r\n", styles: [".p-datepicker-clear-icon{@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;}.my-custom-datepicker-panel{display:none!important}.d-ltr{direction:ltr}.text-required{color:red}.p-error{color:#dc2626}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i3$1.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }], encapsulation: i0.ViewEncapsulation.None });
1288
+ }
1289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DatePickerSwitcherComponent, decorators: [{
1290
+ type: Component,
1291
+ args: [{ selector: 'stc-date-picker-switcher', standalone: true, imports: [
1292
+ FormsModule,
1293
+ ReactiveFormsModule,
1294
+ NgClass,
1295
+ InputText,
1296
+ DatePickerModule,
1297
+ ValidationErrorsPipe,
1298
+ TranslatePipe,
1299
+ FloatLabelModule,
1300
+ ], encapsulation: ViewEncapsulation.None, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n <p-floatlabel [variant]=\"variant\">\r\n <input [id]=\"inputId\" [type]=\"'text-float-label'\" [formControl]=\"control\" [readonly]=\"true\" (focus)=\"openCalendar(true)\"\r\n (click)=\"openCalendar(true)\" [pSize]=\"'small'\"\r\n [class]=\"\r\n 'w-full border border-[' + defaultColor + '] rounded-none focus:outline-[' + defaultColor + '] focus:border-[' + defaultColor + '] hover:border-[' + defaultColor + '] disabled:opacity-50'\r\n \" [disabled]=\"disabled\" [name]=\"name\" pInputText\r\n class=\"w-full\"\r\n [ngClass]=\"{ 'p-invalid ng-dirty ng-invalid': isInvalid, 'basic-style': basicInput, 'no-style':noStyle}\" />\r\n <label [for]=\"inputId\">\r\n {{ label }}\r\n @if (required) {\r\n <span [class.text-required]=\"required\">*</span>\r\n }\r\n </label>\r\n </p-floatlabel>\r\n @if (hint) {\r\n <small class=\"p-mt-1\">{{ hint }}</small>\r\n }\r\n @if (isInvalid && (control.dirty || control.touched)) {\r\n <small class=\"p-error\">\r\n @for (error of control.errors | validationErrors; track error) {\r\n {{ error }}<br>\r\n }\r\n </small>\r\n }\r\n</div>\r\n", styles: [".p-datepicker-clear-icon{@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;}.my-custom-datepicker-panel{display:none!important}.d-ltr{direction:ltr}.text-required{color:red}.p-error{color:#dc2626}\n"] }]
1301
+ }], ctorParameters: () => [], propDecorators: { type: [{
1302
+ type: Input
1303
+ }], contentType: [{
1304
+ type: Input
1305
+ }], size: [{
1306
+ type: Input
1307
+ }], prefix: [{
1308
+ type: Input
1309
+ }], rows: [{
1310
+ type: Input
1311
+ }], cols: [{
1312
+ type: Input
1313
+ }], autoResize: [{
1314
+ type: Input
1315
+ }], basicInput: [{
1316
+ type: Input
1317
+ }], noStyle: [{
1318
+ type: Input
1319
+ }], hideOptionalLabel: [{
1320
+ type: Input
1321
+ }], inputDirection: [{
1322
+ type: Input
1323
+ }], variant: [{
1324
+ type: Input
1325
+ }], defaultColor: [{
1326
+ type: Input
1327
+ }], formattedDate: [{
1328
+ type: Input
1329
+ }], openCalender: [{
1330
+ type: Output
1331
+ }] } });
1332
+
1333
+ var DateFormats;
1334
+ (function (DateFormats) {
1335
+ DateFormats["DATE_ONLY"] = "yyyy-MM-dd";
1336
+ DateFormats["DATE_UTC"] = "yyyy-MM-dd'T'HH:mm:ss'Z'";
1337
+ DateFormats["DATE_TIME_FULL"] = "dd MMMM yyyy - hh:mm a";
1338
+ DateFormats["DATE_TIME_SEMI"] = "yyyy/MM/dd - hh:mm a";
1339
+ DateFormats["DATE"] = "dd MMMM yyyy";
1340
+ DateFormats["DATE_TWO"] = "yyyy/MM/dd";
1341
+ DateFormats["DAY_ONLY"] = "cccc";
1342
+ DateFormats["TIME_ONLY"] = "hh:mm";
1343
+ DateFormats["AM_PM"] = "a";
1344
+ DateFormats["TIME"] = "hh:mm a";
1345
+ DateFormats["YEAR"] = "yyyy";
1346
+ DateFormats["MONTH"] = "MM";
1347
+ DateFormats["DAY"] = "dd";
1348
+ })(DateFormats || (DateFormats = {}));
1349
+ var TimeFormats;
1350
+ (function (TimeFormats) {
1351
+ TimeFormats["HOURS12Format"] = "hh";
1352
+ TimeFormats["HOURS24Format"] = "HH";
1353
+ TimeFormats["MINUTES"] = "mm";
1354
+ TimeFormats["SECONDS"] = "ss";
1355
+ })(TimeFormats || (TimeFormats = {}));
1356
+
1357
+ class DualCalendarComponent {
1358
+ selectedDate = '';
1359
+ control = new FormControl({ value: null, disabled: false }, []);
1360
+ label = '';
1361
+ name = '';
1362
+ withTime = true;
1363
+ isDatePickerShow = true;
1364
+ mode = 'gregorian';
1365
+ gregorianModel;
1366
+ hijriModel;
1367
+ currentLang = signal('ar', ...(ngDevMode ? [{ debugName: "currentLang" }] : []));
1368
+ gregorianUTC = new EventEmitter();
1369
+ gregorianUTCValue = '';
1370
+ isShown = false;
1371
+ calendarContainer;
1372
+ hijriCal = new NgbCalendarIslamicUmalqura();
1373
+ constructor() {
1374
+ effect(() => {
1375
+ this.currentLang(); // 👈 track signal
1376
+ this.setDate(this.gregorianUTCValue);
1377
+ });
1378
+ }
1379
+ ngOnInit() {
1380
+ this.setDate(this.control?.value);
1381
+ }
1382
+ setDate(value) {
1383
+ if (!value)
1384
+ return;
1385
+ const jsDate = new Date(value);
1386
+ if (isNaN(jsDate.getTime()))
1387
+ return;
1388
+ const ngbDate = {
1389
+ year: jsDate.getFullYear(),
1390
+ month: jsDate.getMonth() + 1,
1391
+ day: jsDate.getDate()
1392
+ };
1393
+ // 🔥 Reuse existing logic
1394
+ this.onSelectGregorian(ngbDate);
1395
+ }
1396
+ onDocumentClick(event) {
1397
+ if (!this.calendarContainer)
1398
+ return;
1399
+ const clickedInside = this.calendarContainer.nativeElement.contains(event.target);
1400
+ if (!clickedInside) {
1401
+ this.isShown = false;
1402
+ }
1403
+ }
1404
+ structToNgbDate(d) {
1405
+ return new NgbDate(d.year, d.month, d.day);
1406
+ }
1407
+ onSelectGregorian(date) {
1408
+ this.gregorianModel = date;
1409
+ // Convert to NgbDate
1410
+ const jsDate = new Date(date.year, date.month - 1, date.day);
1411
+ // fromGregorian expects NgbDate or JS Date (depending on version)
1412
+ const hijri = this.hijriCal.fromGregorian(jsDate);
1413
+ const isoUTC = jsDate.toISOString();
1414
+ this.gregorianUTCValue = this.withTime ? isoUTC : formatDate(jsDate, DateFormats.DATE_ONLY, 'en');
1415
+ this.gregorianUTC.emit(this.gregorianUTCValue);
1416
+ this.hijriModel = {
1417
+ year: hijri.year,
1418
+ month: hijri.month,
1419
+ day: hijri.day
1420
+ }; // datepicker
1421
+ this.selectedDate = this.formatHijri(this.structToNgbDate(this.hijriModel)); //input
1422
+ this.isShown = false;
1423
+ }
1424
+ onSelectHijri(date) {
1425
+ this.hijriModel = date;
1426
+ const ngbDate = this.structToNgbDate(date);
1427
+ const greg = this.hijriCal.toGregorian(ngbDate);
1428
+ const isoUTC = greg.toISOString();
1429
+ this.gregorianModel = {
1430
+ year: greg.getFullYear(),
1431
+ month: greg.getMonth() + 1,
1432
+ day: greg.getDate()
1433
+ };
1434
+ const jsDate = new Date(this.gregorianModel.year, this.gregorianModel.month - 1, this.gregorianModel.day);
1435
+ this.gregorianUTCValue = this.withTime ? isoUTC : formatDate(jsDate, DateFormats.DATE_ONLY, 'en');
1436
+ this.gregorianUTC.emit(this.gregorianUTCValue);
1437
+ this.selectedDate = this.formatHijri(ngbDate);
1438
+ this.isShown = false;
1439
+ }
1440
+ showCalender(isOpen) {
1441
+ this.isShown = isOpen;
1442
+ }
1443
+ formatHijri(h) {
1444
+ const hijriDay = h.day;
1445
+ const hijriMonth = getHijriMonthName(this.currentLang(), h.month);
1446
+ const hijriYear = h.year;
1447
+ const greg = this.hijriCal.toGregorian(h);
1448
+ const gregorianDay = greg.getDate();
1449
+ const gregorianMonth = getGregorianMonthName(this.currentLang(), greg.getMonth() + 1);
1450
+ const gregorianYear = greg.getFullYear();
1451
+ return `${gregorianDay} ${gregorianMonth} ${gregorianYear} - ${hijriDay} ${hijriMonth} ${hijriYear}`;
1452
+ }
1453
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DualCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1454
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DualCalendarComponent, isStandalone: true, selector: "app-dual-calendar", inputs: { control: "control", label: "label", name: "name", withTime: "withTime", isDatePickerShow: "isDatePickerShow", currentLang: "currentLang", isShown: "isShown" }, outputs: { gregorianUTC: "gregorianUTC" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, providers: [
1455
+ { provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura }
1456
+ ], viewQueries: [{ propertyName: "calendarContainer", first: true, predicate: ["calendarContainer"], descendants: true }], ngImport: i0, template: "<div class=\"calender-content\" #calendarContainer>\r\n @if(isDatePickerShow) {\r\n <stc-date-picker-switcher [variant]=\"'in'\" [label]=\"label\" id=\"dateId\" (openCalender)=\"showCalender($event)\"\r\n [control]=\"control\" [formattedDate]='selectedDate' >\r\n </stc-date-picker-switcher>\r\n }\r\n\r\n <!-- calender.html -->\r\n <div [dir]=\"currentLang() === 'ar' ? 'rtl' : 'ltr'\" class=\"p-2 calendar-wrapper \" [@slideDown]=\"isShown ? 'open' : 'closed'\" >\r\n <div class=\"header-tabs\">\r\n <div class=\"header-label\">{{'calender.calender_type' | translate}}</div>\r\n <div class=\"tabs\">\r\n <button class=\"tab-button\" [class.active]=\"mode === 'gregorian'\" type=\"button\" (click)=\" mode='gregorian'\">\r\n {{'calender.gregorian' | translate}}\r\n </button>\r\n <button class=\"tab-button\" [class.active]=\"mode === 'hijri'\" type=\"button\" (click)=\" mode='hijri'\">\r\n {{'calender.hijri' | translate}}\r\n </button>\r\n </div>\r\n </div>\r\n @if(mode === 'gregorian') {\r\n <app-gregorian-calendar [model]=\"gregorianModel\" [language]=\"currentLang()\"\r\n (dateSelected)=\"onSelectGregorian($event)\">\r\n </app-gregorian-calendar>\r\n }\r\n\r\n @if(mode === 'hijri') {\r\n <app-hijri-calendar [model]=\"hijriModel\" [language]=\"currentLang()\" (dateSelected)=\"onSelectHijri($event)\">\r\n </app-hijri-calendar>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".calendar-wrapper{max-width:375px;padding:15px}.calendar-wrapper .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{margin:0 10px;max-width:20px}.calendar-wrapper .rtl .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{inset-inline-end:-6px;transform:rotate(180deg);margin:0 10px;max-width:20px}.calendar-wrapper .rtl .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-prev{inset-inline-end:22px;transform:rotate(180deg)}.calendar-wrapper .ltr .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{inset-inline-end:-4px}.calendar-wrapper .ltr .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-prev{inset-inline-end:11px}.header-tabs{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.tabs{background:#f0f0f5;padding:3px;border-radius:2px}.tab-button{flex:1;padding:6px 10px;font-size:14px;background:#f0f0f5;border:none;border-radius:6px;cursor:pointer;transition:.3s}.tab-button.active{background:#dcd6f8;color:#4a3fb4;font-weight:600}.custom-datepicker{width:100%;background:#fff;border:1px solid #e5e5e5;border-radius:8px;padding:12px}.custom-datepicker .ngb-dp-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;max-width:375px}.custom-datepicker .ngb-dp-arrow-btn{background:none;border:none;cursor:pointer;padding:4px}.custom-datepicker .ngb-dp-weekdays{margin-bottom:6px}.custom-datepicker .ngb-dp-weekday{color:#9b9b9b;font-weight:600;text-align:center}.custom-day.today{border:1px solid #6a41d8;border-radius:8px}.custom-day.outside{opacity:.3}.custom-day.disabled{opacity:.2;pointer-events:none}.calender-content{position:relative}.calendar-wrapper{position:absolute;top:100%;left:0;z-index:50;box-shadow:0 2px 8px #00000026;background-color:#fff;border-radius:4px;overflow:hidden}.ngb-datepicker{width:100%}.custom-day{display:inline-flex;justify-content:center;align-items:center;margin:2px;border-radius:50%;cursor:pointer;font-weight:500}.custom-day.today{color:#4f008d;border:0!important}.ngb-dp-day:has(.selected){background-color:#ede6f4!important;border:0!important;color:#4f008d!important;border-radius:2px}.custom-day.outside{color:#ccc!important}.custom-day.disabled{color:#aaa!important;pointer-events:none!important}.ngb-dp-day,.ngb-dp-weekday,.ngb-dp-week-number{width:38px!important;height:44px!important;display:flex;margin:5px;justify-content:center;align-items:center}.ngb-dp-month:first-child .ngb-dp-week{padding:0!important}.ngb-dp-month:last-child .ngb-dp-week{padding:0!important}.ngb-dp-arrow-btn{margin-inline-end:0!important;outline:0!important;padding:0!important;margin:0!important}.ngb-dp-header{position:relative}.ngb-dp-header .ngb-dp-arrow{position:absolute}.ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-prev{inset-inline-end:0}.ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{inset-inline-end:15px}.ngb-dp-header .ngb-dp-arrow:focus-visible,.ngb-dp-header .ngb-dp-arrow .btn:focus-visible{outline:0!important}.ngb-dp-header .visually-hidden{display:none}.ngb-dp-navigation-select{max-width:140px}.ngb-dp-navigation-select select{border:0}.ngb-dp-navigation-select select:focus-visible{outline:0}.ngb-datepicker-navigation-select>.form-select{font-size:14px;font-weight:700}.ngb-dp-navigation-select,.form-select:first-child{appearance:none!important;-webkit-appearance:none;-moz-appearance:none}.ngb-dp-navigation-chevron{font-size:18px;border-width:.1em .1em 0 0!important;border-color:#000}\n"], dependencies: [{ kind: "ngmodule", type: NgbDatepickerModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: DatePickerModule }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: HijriCalendarComponent, selector: "app-hijri-calendar", inputs: ["model", "language"], outputs: ["dateSelected"] }, { kind: "component", type: DatePickerSwitcherComponent, selector: "stc-date-picker-switcher", inputs: ["type", "contentType", "size", "prefix", "rows", "cols", "autoResize", "basicInput", "noStyle", "hideOptionalLabel", "inputDirection", "variant", "defaultColor", "formattedDate"], outputs: ["openCalender"] }, { kind: "component", type: GregorianCalendarComponent, selector: "app-gregorian-calendar", inputs: ["model", "language"], outputs: ["dateSelected"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], animations: [
1457
+ trigger('slideDown', [
1458
+ state('closed', style({
1459
+ height: '0px',
1460
+ opacity: 0,
1461
+ overflow: 'hidden'
1462
+ })),
1463
+ state('open', style({
1464
+ height: '*',
1465
+ opacity: 1,
1466
+ overflow: 'hidden'
1467
+ })),
1468
+ transition('closed <=> open', [
1469
+ animate('300ms ease')
1470
+ ])
1471
+ ])
1472
+ ], encapsulation: i0.ViewEncapsulation.None });
1473
+ }
1474
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DualCalendarComponent, decorators: [{
1475
+ type: Component,
1476
+ args: [{ selector: 'app-dual-calendar', animations: [
1477
+ trigger('slideDown', [
1478
+ state('closed', style({
1479
+ height: '0px',
1480
+ opacity: 0,
1481
+ overflow: 'hidden'
1482
+ })),
1483
+ state('open', style({
1484
+ height: '*',
1485
+ opacity: 1,
1486
+ overflow: 'hidden'
1487
+ })),
1488
+ transition('closed <=> open', [
1489
+ animate('300ms ease')
1490
+ ])
1491
+ ])
1492
+ ], imports: [
1493
+ NgbDatepickerModule,
1494
+ FormsModule,
1495
+ FormsModule,
1496
+ ReactiveFormsModule,
1497
+ DatePickerModule,
1498
+ FloatLabelModule,
1499
+ HijriCalendarComponent,
1500
+ DatePickerSwitcherComponent,
1501
+ TranslatePipe,
1502
+ GregorianCalendarComponent
1503
+ ], providers: [
1504
+ { provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura }
1505
+ ], encapsulation: ViewEncapsulation.None, template: "<div class=\"calender-content\" #calendarContainer>\r\n @if(isDatePickerShow) {\r\n <stc-date-picker-switcher [variant]=\"'in'\" [label]=\"label\" id=\"dateId\" (openCalender)=\"showCalender($event)\"\r\n [control]=\"control\" [formattedDate]='selectedDate' >\r\n </stc-date-picker-switcher>\r\n }\r\n\r\n <!-- calender.html -->\r\n <div [dir]=\"currentLang() === 'ar' ? 'rtl' : 'ltr'\" class=\"p-2 calendar-wrapper \" [@slideDown]=\"isShown ? 'open' : 'closed'\" >\r\n <div class=\"header-tabs\">\r\n <div class=\"header-label\">{{'calender.calender_type' | translate}}</div>\r\n <div class=\"tabs\">\r\n <button class=\"tab-button\" [class.active]=\"mode === 'gregorian'\" type=\"button\" (click)=\" mode='gregorian'\">\r\n {{'calender.gregorian' | translate}}\r\n </button>\r\n <button class=\"tab-button\" [class.active]=\"mode === 'hijri'\" type=\"button\" (click)=\" mode='hijri'\">\r\n {{'calender.hijri' | translate}}\r\n </button>\r\n </div>\r\n </div>\r\n @if(mode === 'gregorian') {\r\n <app-gregorian-calendar [model]=\"gregorianModel\" [language]=\"currentLang()\"\r\n (dateSelected)=\"onSelectGregorian($event)\">\r\n </app-gregorian-calendar>\r\n }\r\n\r\n @if(mode === 'hijri') {\r\n <app-hijri-calendar [model]=\"hijriModel\" [language]=\"currentLang()\" (dateSelected)=\"onSelectHijri($event)\">\r\n </app-hijri-calendar>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".calendar-wrapper{max-width:375px;padding:15px}.calendar-wrapper .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{margin:0 10px;max-width:20px}.calendar-wrapper .rtl .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{inset-inline-end:-6px;transform:rotate(180deg);margin:0 10px;max-width:20px}.calendar-wrapper .rtl .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-prev{inset-inline-end:22px;transform:rotate(180deg)}.calendar-wrapper .ltr .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{inset-inline-end:-4px}.calendar-wrapper .ltr .ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-prev{inset-inline-end:11px}.header-tabs{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.tabs{background:#f0f0f5;padding:3px;border-radius:2px}.tab-button{flex:1;padding:6px 10px;font-size:14px;background:#f0f0f5;border:none;border-radius:6px;cursor:pointer;transition:.3s}.tab-button.active{background:#dcd6f8;color:#4a3fb4;font-weight:600}.custom-datepicker{width:100%;background:#fff;border:1px solid #e5e5e5;border-radius:8px;padding:12px}.custom-datepicker .ngb-dp-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;max-width:375px}.custom-datepicker .ngb-dp-arrow-btn{background:none;border:none;cursor:pointer;padding:4px}.custom-datepicker .ngb-dp-weekdays{margin-bottom:6px}.custom-datepicker .ngb-dp-weekday{color:#9b9b9b;font-weight:600;text-align:center}.custom-day.today{border:1px solid #6a41d8;border-radius:8px}.custom-day.outside{opacity:.3}.custom-day.disabled{opacity:.2;pointer-events:none}.calender-content{position:relative}.calendar-wrapper{position:absolute;top:100%;left:0;z-index:50;box-shadow:0 2px 8px #00000026;background-color:#fff;border-radius:4px;overflow:hidden}.ngb-datepicker{width:100%}.custom-day{display:inline-flex;justify-content:center;align-items:center;margin:2px;border-radius:50%;cursor:pointer;font-weight:500}.custom-day.today{color:#4f008d;border:0!important}.ngb-dp-day:has(.selected){background-color:#ede6f4!important;border:0!important;color:#4f008d!important;border-radius:2px}.custom-day.outside{color:#ccc!important}.custom-day.disabled{color:#aaa!important;pointer-events:none!important}.ngb-dp-day,.ngb-dp-weekday,.ngb-dp-week-number{width:38px!important;height:44px!important;display:flex;margin:5px;justify-content:center;align-items:center}.ngb-dp-month:first-child .ngb-dp-week{padding:0!important}.ngb-dp-month:last-child .ngb-dp-week{padding:0!important}.ngb-dp-arrow-btn{margin-inline-end:0!important;outline:0!important;padding:0!important;margin:0!important}.ngb-dp-header{position:relative}.ngb-dp-header .ngb-dp-arrow{position:absolute}.ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-prev{inset-inline-end:0}.ngb-dp-header .ngb-dp-arrow.ngb-dp-arrow-next{inset-inline-end:15px}.ngb-dp-header .ngb-dp-arrow:focus-visible,.ngb-dp-header .ngb-dp-arrow .btn:focus-visible{outline:0!important}.ngb-dp-header .visually-hidden{display:none}.ngb-dp-navigation-select{max-width:140px}.ngb-dp-navigation-select select{border:0}.ngb-dp-navigation-select select:focus-visible{outline:0}.ngb-datepicker-navigation-select>.form-select{font-size:14px;font-weight:700}.ngb-dp-navigation-select,.form-select:first-child{appearance:none!important;-webkit-appearance:none;-moz-appearance:none}.ngb-dp-navigation-chevron{font-size:18px;border-width:.1em .1em 0 0!important;border-color:#000}\n"] }]
1506
+ }], ctorParameters: () => [], propDecorators: { control: [{
1507
+ type: Input
1508
+ }], label: [{
1509
+ type: Input
1510
+ }], name: [{
1511
+ type: Input
1512
+ }], withTime: [{
1513
+ type: Input
1514
+ }], isDatePickerShow: [{
1515
+ type: Input
1516
+ }], currentLang: [{
1517
+ type: Input
1518
+ }], gregorianUTC: [{
1519
+ type: Output
1520
+ }], isShown: [{
1521
+ type: Input
1522
+ }], calendarContainer: [{
1523
+ type: ViewChild,
1524
+ args: ['calendarContainer']
1525
+ }], onDocumentClick: [{
1526
+ type: HostListener,
1527
+ args: ['document:click', ['$event']]
1528
+ }] } });
1529
+
1530
+ class DynamicFormComponent {
1531
+ dynamicFormData;
1532
+ // Generic field change outputs (optional for consumers)
1533
+ selectButtonChange = new EventEmitter();
1534
+ selectChange = new EventEmitter();
1535
+ switchChange = new EventEmitter();
1536
+ autoCompleteSearch = new EventEmitter();
1537
+ autoCompleteSelect = new EventEmitter();
1538
+ inputsNames = [];
1539
+ formGroup;
1540
+ inputsMap;
1541
+ fieldType = FormFieldTypeEnum;
1542
+ getFormControl = FormUtils.getFormControl;
1543
+ ngOnInit() {
1544
+ this.formGroup = this.dynamicFormData?.formGroup;
1545
+ this.inputsMap = this.dynamicFormData?.inputsMap;
1546
+ this.inputsNames = Object.keys(this.inputsMap || {});
1547
+ }
1548
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1549
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DynamicFormComponent, isStandalone: true, selector: "app-dynamic-form", inputs: { dynamicFormData: "dynamicFormData" }, outputs: { selectButtonChange: "selectButtonChange", selectChange: "selectChange", switchChange: "switchChange", autoCompleteSearch: "autoCompleteSearch", autoCompleteSelect: "autoCompleteSelect" }, ngImport: i0, template: "<form [formGroup]=\"formGroup\" class=\"dynamic-form\">\r\n <div class=\"grid grid-cols-12 gap-x-2\">\r\n @for (inputName of inputsNames; track $index) {\r\n <div [ngClass]=\"inputsMap[inputName].rowSize\">\r\n @switch (inputsMap[inputName].fieldType) {\r\n @case (fieldType.HIJRI_DATE_PICKER) {\r\n <app-dual-calendar [control]=\"getFormControl(inputName, formGroup)\" ></app-dual-calendar>\r\n }\r\n\r\n @case (fieldType.DATE_PICKER) {\r\n <stc-date-picker [minDate]=\"inputsMap[inputName]?.dateRange?.min\" [maxDate]=\"inputsMap[inputName]?.dateRange?.max\"\r\n [id]=\"inputsMap[inputName].inputId\" [control]=\"getFormControl(inputName, formGroup)\" [name]=\"inputName\"\r\n [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [variant]=\"inputsMap[inputName].variant || 'over'\"\r\n [showIcon]=\"inputsMap[inputName].showIcon !== false\" [isTimeOnly]=\"inputsMap[inputName].isTimeOnly || false\" />\r\n }\r\n @case (fieldType.SELECT_BUTTON) {\r\n <stc-select-button [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\"\r\n [options]=\"inputsMap[inputName].selectButtonOptions || []\"\r\n (onChange)=\"selectButtonChange.emit({ name: inputName, value: $event })\" />\r\n }\r\n @case (fieldType.INPUT) {\r\n <stc-input [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\" [name]=\"inputName\"\r\n [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [type]=\"inputsMap[inputName].inputType || 'text'\"\r\n [contentType]=\"inputsMap[inputName].contentType || 'text'\" [rows]=\"inputsMap[inputName].rows || 2\"\r\n [cols]=\"inputsMap[inputName].cols || 20\" [autoResize]=\"inputsMap[inputName].autoResize ?? false\"\r\n [prefix]=\"inputsMap[inputName].prefix || ''\" [size]=\"inputsMap[inputName].size || 'small'\"\r\n [variant]=\"inputsMap[inputName].variant || 'over'\">\r\n @if(inputsMap[inputName].maxLength){\r\n <span class=\"text-xs text-gray-700\">\r\n {{ (getFormControl(inputName, formGroup).value?.length || 0) }}\r\n <span> / {{ inputsMap[inputName].maxLength}}</span>\r\n </span>\r\n }\r\n </stc-input>\r\n }\r\n @case (fieldType.SELECT) {\r\n <stc-select [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [options]=\"inputsMap[inputName].selectOptions || []\"\r\n [optionLabel]=\"inputsMap[inputName].optionLabel || 'label'\" [filter]=\"inputsMap[inputName].filter || false\"\r\n [multiple]=\"inputsMap[inputName].multiple || false\" [showClear]=\"inputsMap[inputName].showClear || false\"\r\n [checkmark]=\"inputsMap[inputName].checkmark ?? true\" [filterBy]=\"inputsMap[inputName].filterBy || ''\"\r\n [selectedItemsLabel]=\"inputsMap[inputName].selectedItemsLabel || ''\"\r\n [size]=\"inputsMap[inputName].size || 'small'\" [variant]=\"inputsMap[inputName].variant || 'over'\"\r\n (change)=\"selectChange.emit({ name: inputName, event: $event })\"/>\r\n }\r\n @case (fieldType.SWITCH) {\r\n <stc-switch [label]=\"inputsMap[inputName].label\" [key]=\"inputName\"\r\n [checked]=\"getFormControl(inputName, formGroup).value\"\r\n (onChange)=\"getFormControl(inputName, formGroup).setValue(typeof $event === 'string' ? ($event === 'true') : $event); switchChange.emit({ name: inputName, value: (typeof $event === 'string' ? ($event === 'true') : $event) })\" />\r\n }\r\n @case (fieldType.AUTO_COMPLETE) {\r\n <stc-auto-complete [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [items]=\"inputsMap[inputName].autoCompleteItems || []\"\r\n [minLengthToSearch]=\"inputsMap[inputName].minLengthToSearch || 2\" [delay]=\"inputsMap[inputName].delay || 300\"\r\n (onSearch)=\"autoCompleteSearch.emit({ name: inputName, query: $event })\"\r\n (selectOption)=\"autoCompleteSelect.emit({ name: inputName, event: $event })\"\r\n [variant]=\"inputsMap[inputName].variant || 'over'\" />\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n <div class=\"col-span-12\">\r\n <small class=\"p-error text-red-700\">\r\n @for (error of formGroup.errors | validationErrors: dynamicFormData.formValidationErrorsKeys;\r\n track error) {\r\n {{ error }}\r\n }\r\n </small>\r\n </div>\r\n</form>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: DatePickerComponent, selector: "stc-date-picker", inputs: ["showIcon", "showClear", "basicInput", "isTimeOnly", "minDate", "maxDate", "hourFormat", "selectionMode", "variant", "withoutTime"], outputs: ["onAfterClearDate"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: SelectButtonComponent, selector: "stc-select-button", inputs: ["options", "title"], outputs: ["onChange"] }, { kind: "component", type: DualCalendarComponent, selector: "app-dual-calendar", inputs: ["control", "label", "name", "withTime", "isDatePickerShow", "currentLang", "isShown"], outputs: ["gregorianUTC"] }, { kind: "component", type: InputComponent, selector: "stc-input", inputs: ["type", "contentType", "size", "prefix", "rows", "cols", "autoResize", "basicInput", "noStyle", "canClear", "hideOptionalLabel", "inputDirection", "variant", "defaultColor", "iconClass", "iconPosition"] }, { kind: "component", type: SelectComponent, selector: "stc-select", inputs: ["selectedItemTemplate", "optionTemplate", "options", "optionLabel", "optionValue", "emptyMessage", "checkmark", "showClear", "editable", "filter", "multiple", "filterBy", "selectAllLabel", "dataKey", "size", "selectedItemsLabel", "basicInput", "variant", "defaultColor"], outputs: ["change"] }, { kind: "component", type: AutoCompleteComponent, selector: "stc-auto-complete", inputs: ["selectedItemTemplate", "items", "minLengthToSearch", "delay", "basicInput", "typeAhead", "variant"], outputs: ["onSearch", "selectOption"] }, { kind: "component", type: SwitchComponent, selector: "stc-switch", inputs: ["label", "key", "checked"], outputs: ["onChange"] }, { kind: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }] });
1550
+ }
1551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicFormComponent, decorators: [{
1552
+ type: Component,
1553
+ args: [{ selector: 'app-dynamic-form', standalone: true, imports: [
1554
+ CommonModule,
1555
+ ReactiveFormsModule,
1556
+ DatePickerComponent,
1557
+ ValidationErrorsPipe,
1558
+ TranslateModule,
1559
+ SelectButtonComponent,
1560
+ DualCalendarComponent,
1561
+ InputComponent,
1562
+ SelectComponent,
1563
+ AutoCompleteComponent,
1564
+ SwitchComponent,
1565
+ ], template: "<form [formGroup]=\"formGroup\" class=\"dynamic-form\">\r\n <div class=\"grid grid-cols-12 gap-x-2\">\r\n @for (inputName of inputsNames; track $index) {\r\n <div [ngClass]=\"inputsMap[inputName].rowSize\">\r\n @switch (inputsMap[inputName].fieldType) {\r\n @case (fieldType.HIJRI_DATE_PICKER) {\r\n <app-dual-calendar [control]=\"getFormControl(inputName, formGroup)\" ></app-dual-calendar>\r\n }\r\n\r\n @case (fieldType.DATE_PICKER) {\r\n <stc-date-picker [minDate]=\"inputsMap[inputName]?.dateRange?.min\" [maxDate]=\"inputsMap[inputName]?.dateRange?.max\"\r\n [id]=\"inputsMap[inputName].inputId\" [control]=\"getFormControl(inputName, formGroup)\" [name]=\"inputName\"\r\n [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [variant]=\"inputsMap[inputName].variant || 'over'\"\r\n [showIcon]=\"inputsMap[inputName].showIcon !== false\" [isTimeOnly]=\"inputsMap[inputName].isTimeOnly || false\" />\r\n }\r\n @case (fieldType.SELECT_BUTTON) {\r\n <stc-select-button [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\"\r\n [options]=\"inputsMap[inputName].selectButtonOptions || []\"\r\n (onChange)=\"selectButtonChange.emit({ name: inputName, value: $event })\" />\r\n }\r\n @case (fieldType.INPUT) {\r\n <stc-input [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\" [name]=\"inputName\"\r\n [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [type]=\"inputsMap[inputName].inputType || 'text'\"\r\n [contentType]=\"inputsMap[inputName].contentType || 'text'\" [rows]=\"inputsMap[inputName].rows || 2\"\r\n [cols]=\"inputsMap[inputName].cols || 20\" [autoResize]=\"inputsMap[inputName].autoResize ?? false\"\r\n [prefix]=\"inputsMap[inputName].prefix || ''\" [size]=\"inputsMap[inputName].size || 'small'\"\r\n [variant]=\"inputsMap[inputName].variant || 'over'\">\r\n @if(inputsMap[inputName].maxLength){\r\n <span class=\"text-xs text-gray-700\">\r\n {{ (getFormControl(inputName, formGroup).value?.length || 0) }}\r\n <span> / {{ inputsMap[inputName].maxLength}}</span>\r\n </span>\r\n }\r\n </stc-input>\r\n }\r\n @case (fieldType.SELECT) {\r\n <stc-select [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [options]=\"inputsMap[inputName].selectOptions || []\"\r\n [optionLabel]=\"inputsMap[inputName].optionLabel || 'label'\" [filter]=\"inputsMap[inputName].filter || false\"\r\n [multiple]=\"inputsMap[inputName].multiple || false\" [showClear]=\"inputsMap[inputName].showClear || false\"\r\n [checkmark]=\"inputsMap[inputName].checkmark ?? true\" [filterBy]=\"inputsMap[inputName].filterBy || ''\"\r\n [selectedItemsLabel]=\"inputsMap[inputName].selectedItemsLabel || ''\"\r\n [size]=\"inputsMap[inputName].size || 'small'\" [variant]=\"inputsMap[inputName].variant || 'over'\"\r\n (change)=\"selectChange.emit({ name: inputName, event: $event })\"/>\r\n }\r\n @case (fieldType.SWITCH) {\r\n <stc-switch [label]=\"inputsMap[inputName].label\" [key]=\"inputName\"\r\n [checked]=\"getFormControl(inputName, formGroup).value\"\r\n (onChange)=\"getFormControl(inputName, formGroup).setValue(typeof $event === 'string' ? ($event === 'true') : $event); switchChange.emit({ name: inputName, value: (typeof $event === 'string' ? ($event === 'true') : $event) })\" />\r\n }\r\n @case (fieldType.AUTO_COMPLETE) {\r\n <stc-auto-complete [control]=\"getFormControl(inputName, formGroup)\" [id]=\"inputsMap[inputName].inputId\"\r\n [name]=\"inputName\" [label]=\"inputsMap[inputName].label\" [placeholder]=\"inputsMap[inputName].placeholder || ''\"\r\n [hint]=\"inputsMap[inputName].hint\"\r\n [readonly]=\"inputsMap[inputName].readonly || dynamicFormData.isReadOnlyForm || false\"\r\n [disabled]=\"inputsMap[inputName].disabled || false\" [items]=\"inputsMap[inputName].autoCompleteItems || []\"\r\n [minLengthToSearch]=\"inputsMap[inputName].minLengthToSearch || 2\" [delay]=\"inputsMap[inputName].delay || 300\"\r\n (onSearch)=\"autoCompleteSearch.emit({ name: inputName, query: $event })\"\r\n (selectOption)=\"autoCompleteSelect.emit({ name: inputName, event: $event })\"\r\n [variant]=\"inputsMap[inputName].variant || 'over'\" />\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n <div class=\"col-span-12\">\r\n <small class=\"p-error text-red-700\">\r\n @for (error of formGroup.errors | validationErrors: dynamicFormData.formValidationErrorsKeys;\r\n track error) {\r\n {{ error }}\r\n }\r\n </small>\r\n </div>\r\n</form>\r\n" }]
1566
+ }], propDecorators: { dynamicFormData: [{
1567
+ type: Input,
1568
+ args: [{ required: true }]
1569
+ }], selectButtonChange: [{
1570
+ type: Output
1571
+ }], selectChange: [{
1572
+ type: Output
1573
+ }], switchChange: [{
1574
+ type: Output
1575
+ }], autoCompleteSearch: [{
1576
+ type: Output
1577
+ }], autoCompleteSelect: [{
1578
+ type: Output
1579
+ }] } });
1580
+
1581
+ class ConfirmationDialogComponent extends DynamicDialogRef {
1582
+ router = inject(Router);
1583
+ dialogService = inject(DialogService);
1584
+ dynamicDialogConfig = inject(DynamicDialogConfig);
1585
+ _ref = inject(DynamicDialogRef);
1586
+ _subscription = new Subscription();
1587
+ dialogFormData;
1588
+ ngOnDestroy() {
1589
+ this._subscription.unsubscribe();
1590
+ }
1591
+ ngOnInit() {
1592
+ // closing when navigating back from the browser
1593
+ this._subscription.add(this.router.events.pipe(filter((event) => event instanceof NavigationStart)).subscribe(() => {
1594
+ if (this.dynamicDialogConfig) {
1595
+ this._ref.close(false);
1596
+ }
1597
+ }));
1598
+ this.dialogFormData = this.dynamicDialogConfig.data?.inputForm;
1599
+ }
1600
+ submit() {
1601
+ // we should pass submitted data when using form dialog
1602
+ // const submitData = { submitted: true, data: this.dialogFormData?.formGroup?.value };
1603
+ // this._ref.close(this.dynamicDialogConfig.data.inputForm ? submitData : true);
1604
+ this._ref.close(true);
1605
+ }
1606
+ close() {
1607
+ this._ref.close(false);
1608
+ }
1609
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1610
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ConfirmationDialogComponent, isStandalone: true, selector: "app-confirm-dialog", providers: [DialogService, DynamicDialogStyle], usesInheritance: true, ngImport: i0, template: "@if (dynamicDialogConfig.data) {\r\n<div class=\"confirmation-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"confirmation-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"confirmation-dialog__message text-xl mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n @if (dynamicDialogConfig.data.hint) {\r\n <p class=\"confirmation-dialog__hint font-normal text-base\">\r\n {{ dynamicDialogConfig.data.hint }}\r\n </p>\r\n }\r\n @if (dynamicDialogConfig.data.inputForm) {\r\n <app-dynamic-form [dynamicFormData]=\"dialogFormData\"></app-dynamic-form>\r\n }\r\n </div>\r\n }\r\n <div class=\"confirmation-dialog__actions flex gap-2 mt-4\">\r\n <app-button [title]=\"dynamicDialogConfig.data?.confirmLabel || ('actions.confirm' | translate)\"\r\n [disabled]=\"!!(dialogFormData && dialogFormData.formGroup?.invalid)\" [severity]=\"'primary'\"\r\n [id]=\"dynamicDialogConfig.data.confirmBtnId\" [icon]=\"dynamicDialogConfig.data.confirmBtnIcon || ''\"\r\n [label]=\"dynamicDialogConfig.data.confirmBtnLabel\"\r\n [iconPos]=\"dynamicDialogConfig.data.confirmBtnPosition || 'left'\" [styleClass]=\"'confirmation-btn'\"\r\n (click)=\"submit()\" />\r\n <app-button [title]=\"dynamicDialogConfig.data?.closeLabel || ('actions.cancel' | translate)\"\r\n [severity]=\"'primary'\" variant=\"outlined\" [label]=\"dynamicDialogConfig.data.cancelBtnLabel\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId\" [styleClass]=\"'cancel-btn confirmation-btn cancel-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n\r\n</div>\r\n}", styles: [""], dependencies: [{ kind: "component", type: AppButtonComponent, selector: "app-button" }, { kind: "ngmodule", type: AvatarModule }, { kind: "ngmodule", type: DynamicDialogModule }, { kind: "component", type: DynamicFormComponent, selector: "app-dynamic-form", inputs: ["dynamicFormData"], outputs: ["selectButtonChange", "selectChange", "switchChange", "autoCompleteSearch", "autoCompleteSelect"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
1611
+ }
1612
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogComponent, decorators: [{
1613
+ type: Component,
1614
+ args: [{ selector: 'app-confirm-dialog', encapsulation: ViewEncapsulation.None, standalone: true, imports: [
1615
+ AppButtonComponent,
1616
+ AvatarModule,
1617
+ DynamicDialogModule,
1618
+ DynamicFormComponent,
1619
+ TranslatePipe,
1620
+ ], providers: [DialogService, DynamicDialogStyle], template: "@if (dynamicDialogConfig.data) {\r\n<div class=\"confirmation-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"confirmation-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"confirmation-dialog__message text-xl mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n @if (dynamicDialogConfig.data.hint) {\r\n <p class=\"confirmation-dialog__hint font-normal text-base\">\r\n {{ dynamicDialogConfig.data.hint }}\r\n </p>\r\n }\r\n @if (dynamicDialogConfig.data.inputForm) {\r\n <app-dynamic-form [dynamicFormData]=\"dialogFormData\"></app-dynamic-form>\r\n }\r\n </div>\r\n }\r\n <div class=\"confirmation-dialog__actions flex gap-2 mt-4\">\r\n <app-button [title]=\"dynamicDialogConfig.data?.confirmLabel || ('actions.confirm' | translate)\"\r\n [disabled]=\"!!(dialogFormData && dialogFormData.formGroup?.invalid)\" [severity]=\"'primary'\"\r\n [id]=\"dynamicDialogConfig.data.confirmBtnId\" [icon]=\"dynamicDialogConfig.data.confirmBtnIcon || ''\"\r\n [label]=\"dynamicDialogConfig.data.confirmBtnLabel\"\r\n [iconPos]=\"dynamicDialogConfig.data.confirmBtnPosition || 'left'\" [styleClass]=\"'confirmation-btn'\"\r\n (click)=\"submit()\" />\r\n <app-button [title]=\"dynamicDialogConfig.data?.closeLabel || ('actions.cancel' | translate)\"\r\n [severity]=\"'primary'\" variant=\"outlined\" [label]=\"dynamicDialogConfig.data.cancelBtnLabel\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId\" [styleClass]=\"'cancel-btn confirmation-btn cancel-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n\r\n</div>\r\n}" }]
1621
+ }] });
1622
+
1623
+ class ReadMoreComponent {
1624
+ text = "";
1625
+ styleClass = "";
1626
+ maxCharacters = 100;
1627
+ isExpanded = false;
1628
+ toggleReadMore() {
1629
+ this.isExpanded = !this.isExpanded;
1630
+ }
1631
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ReadMoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1632
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ReadMoreComponent, isStandalone: true, selector: "app-read-more", inputs: { text: "text", styleClass: "styleClass", maxCharacters: "maxCharacters" }, ngImport: i0, template: "<p [class]=\"styleClass\">\r\n {{ isExpanded ? text : (text | slice : 0 : maxCharacters) }}\r\n @if (text.length > maxCharacters && !isExpanded) {\r\n <span>...</span>\r\n }\r\n @if (isExpanded) {\r\n <span>\r\n {{ text | slice : maxCharacters + 1 : text.length }}\r\n </span>\r\n }\r\n <br>\r\n @if (text.length > maxCharacters) {\r\n <span class=\"text-primary_light cursor-pointer\" (click)=\"toggleReadMore()\">\r\n {{ isExpanded ? ('less' | translate) : ('more' | translate) }}\r\n </span>\r\n }\r\n</p>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "pipe", type: SlicePipe, name: "slice" }] });
1633
+ }
1634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ReadMoreComponent, decorators: [{
1635
+ type: Component,
1636
+ args: [{ selector: "app-read-more", standalone: true, imports: [TranslateModule, SlicePipe], template: "<p [class]=\"styleClass\">\r\n {{ isExpanded ? text : (text | slice : 0 : maxCharacters) }}\r\n @if (text.length > maxCharacters && !isExpanded) {\r\n <span>...</span>\r\n }\r\n @if (isExpanded) {\r\n <span>\r\n {{ text | slice : maxCharacters + 1 : text.length }}\r\n </span>\r\n }\r\n <br>\r\n @if (text.length > maxCharacters) {\r\n <span class=\"text-primary_light cursor-pointer\" (click)=\"toggleReadMore()\">\r\n {{ isExpanded ? ('less' | translate) : ('more' | translate) }}\r\n </span>\r\n }\r\n</p>\r\n" }]
1637
+ }], propDecorators: { text: [{
1638
+ type: Input,
1639
+ args: [{ required: true }]
1640
+ }], styleClass: [{
1641
+ type: Input
1642
+ }], maxCharacters: [{
1643
+ type: Input
1644
+ }] } });
1645
+
1646
+ class AppAccordionComponent {
1647
+ iconName;
1648
+ iconClass;
1649
+ iconPathCount = 0;
1650
+ title;
1651
+ contentBorderTop = true;
1652
+ accordionPanelBorder = true;
1653
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1654
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: AppAccordionComponent, isStandalone: true, selector: "app-accordion", inputs: { iconName: "iconName", iconClass: "iconClass", iconPathCount: "iconPathCount", title: "title", contentBorderTop: "contentBorderTop", accordionPanelBorder: "accordionPanelBorder" }, ngImport: i0, template: "<p-accordion value=\"0\">\r\n <p-accordion-panel value=\"0\" [class.!border-0]=\"!accordionPanelBorder\">\r\n <p-accordion-header>\r\n <span class=\"flex items-center gap-2 w-full\">\r\n <app-ico-moon-card [iconClass]=\"'text-[24px] text-secondary'\" [iconName]=\"'font-icon-'+iconName\" />\r\n <span class=\"font-bold whitespace-nowrap\">{{title}}</span>\r\n </span>\r\n </p-accordion-header>\r\n <p-accordion-content>\r\n <div [ngClass]=\"{'border-t-2 border-gray-light pt-2': contentBorderTop, }\">\r\n <ng-content></ng-content>\r\n </div>\r\n </p-accordion-content>\r\n </p-accordion-panel>\r\n</p-accordion>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: DividerModule }, { kind: "ngmodule", type: AccordionModule }, { kind: "component", type: i2$4.Accordion, selector: "p-accordion", inputs: ["value", "multiple", "styleClass", "expandIcon", "collapseIcon", "selectOnFocus", "transitionOptions"], outputs: ["valueChange", "onClose", "onOpen"] }, { kind: "component", type: i2$4.AccordionPanel, selector: "p-accordion-panel, p-accordionpanel", inputs: ["value", "disabled"], outputs: ["valueChange"] }, { kind: "component", type: i2$4.AccordionHeader, selector: "p-accordion-header, p-accordionheader" }, { kind: "component", type: i2$4.AccordionContent, selector: "p-accordion-content, p-accordioncontent" }, { kind: "component", type: IcoMoonIconComponent, selector: "app-ico-moon-card", inputs: ["iconName", "iconClass", "iconPathCount"] }] });
1655
+ }
1656
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppAccordionComponent, decorators: [{
1657
+ type: Component,
1658
+ args: [{ selector: "app-accordion", standalone: true, imports: [CommonModule, DividerModule, AccordionModule, IcoMoonIconComponent], template: "<p-accordion value=\"0\">\r\n <p-accordion-panel value=\"0\" [class.!border-0]=\"!accordionPanelBorder\">\r\n <p-accordion-header>\r\n <span class=\"flex items-center gap-2 w-full\">\r\n <app-ico-moon-card [iconClass]=\"'text-[24px] text-secondary'\" [iconName]=\"'font-icon-'+iconName\" />\r\n <span class=\"font-bold whitespace-nowrap\">{{title}}</span>\r\n </span>\r\n </p-accordion-header>\r\n <p-accordion-content>\r\n <div [ngClass]=\"{'border-t-2 border-gray-light pt-2': contentBorderTop, }\">\r\n <ng-content></ng-content>\r\n </div>\r\n </p-accordion-content>\r\n </p-accordion-panel>\r\n</p-accordion>\r\n" }]
1659
+ }], propDecorators: { iconName: [{
1660
+ type: Input
1661
+ }], iconClass: [{
1662
+ type: Input
1663
+ }], iconPathCount: [{
1664
+ type: Input
1665
+ }], title: [{
1666
+ type: Input,
1667
+ args: [{ required: true }]
1668
+ }], contentBorderTop: [{
1669
+ type: Input
1670
+ }], accordionPanelBorder: [{
1671
+ type: Input
1672
+ }] } });
1673
+
1674
+ class UserAutocompleteCardComponent {
1675
+ select = new EventEmitter();
1676
+ delete = new EventEmitter();
1677
+ userData;
1678
+ explicitRole = "";
1679
+ showDeleteAction = true;
1680
+ onDelete() {
1681
+ this.delete.emit(this.userData);
1682
+ }
1683
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserAutocompleteCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1684
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: UserAutocompleteCardComponent, isStandalone: true, selector: "app-user-autocomplete-card", inputs: { userData: "userData", explicitRole: "explicitRole", showDeleteAction: "showDeleteAction" }, outputs: { select: "select", delete: "delete" }, ngImport: i0, template: "<div class=\"flex gap-2 items-center justify-between p-4 rounded mb-4 border border-dotted border-gray-300 bg-gray-100\">\r\n <div class=\"flex gap-4 items-center\">\r\n <img [alt]=\"userData.name\" [src]=\"userData.profileImage\" class=\"rounded-full object-cover w-[48px] h-[48px]\" />\r\n <div class=\"flex flex-col justify-end\">\r\n <h4 class=\"font-bold text-[12px] text-gray-800 truncate max-w-[135px] dir-ltr\">\r\n {{ userData.name }}\r\n </h4>\r\n <p class=\"text-[12px] text-gray-700\">{{ explicitRole ? explicitRole : userData.position.name }}</p>\r\n </div>\r\n </div>\r\n <div class=\"flex-1 flex flex-col items-end\">\r\n <p class=\"text-[12px] text-purple-700 truncate max-w-[90px] dir-ltr\">{{ userData.email }}</p>\r\n <p class=\"text-[12px] text-gray-600 dir-ltr\">{{ userData.contact.mobile }}</p>\r\n </div>\r\n @if (showDeleteAction){\r\n <div class=\"flex gap-1 flex-nowrap\">\r\n <app-button (clickEmitter)=\"onDelete()\" [rounded]=\"true\" [size]=\"'large'\" [text]=\"true\" icon=\"font-icon-trash\"/>\r\n </div>\r\n }\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "component", type: AppButtonComponent, selector: "app-button" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1685
+ }
1686
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserAutocompleteCardComponent, decorators: [{
1687
+ type: Component,
1688
+ args: [{ selector: "app-user-autocomplete-card", standalone: true, imports: [AppButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex gap-2 items-center justify-between p-4 rounded mb-4 border border-dotted border-gray-300 bg-gray-100\">\r\n <div class=\"flex gap-4 items-center\">\r\n <img [alt]=\"userData.name\" [src]=\"userData.profileImage\" class=\"rounded-full object-cover w-[48px] h-[48px]\" />\r\n <div class=\"flex flex-col justify-end\">\r\n <h4 class=\"font-bold text-[12px] text-gray-800 truncate max-w-[135px] dir-ltr\">\r\n {{ userData.name }}\r\n </h4>\r\n <p class=\"text-[12px] text-gray-700\">{{ explicitRole ? explicitRole : userData.position.name }}</p>\r\n </div>\r\n </div>\r\n <div class=\"flex-1 flex flex-col items-end\">\r\n <p class=\"text-[12px] text-purple-700 truncate max-w-[90px] dir-ltr\">{{ userData.email }}</p>\r\n <p class=\"text-[12px] text-gray-600 dir-ltr\">{{ userData.contact.mobile }}</p>\r\n </div>\r\n @if (showDeleteAction){\r\n <div class=\"flex gap-1 flex-nowrap\">\r\n <app-button (clickEmitter)=\"onDelete()\" [rounded]=\"true\" [size]=\"'large'\" [text]=\"true\" icon=\"font-icon-trash\"/>\r\n </div>\r\n }\r\n</div>\r\n" }]
1689
+ }], propDecorators: { select: [{
1690
+ type: Output
1691
+ }], delete: [{
1692
+ type: Output
1693
+ }], userData: [{
1694
+ type: Input,
1695
+ args: [{ required: true }]
1696
+ }], explicitRole: [{
1697
+ type: Input
1698
+ }], showDeleteAction: [{
1699
+ type: Input
1700
+ }] } });
1701
+
1702
+ class AppBreadcrumbComponent {
1703
+ activatedRoute;
1704
+ router;
1705
+ items;
1706
+ isShown;
1707
+ constructor(activatedRoute, router) {
1708
+ this.activatedRoute = activatedRoute;
1709
+ this.router = router;
1710
+ }
1711
+ ngOnInit() {
1712
+ if (this.items) {
1713
+ this.isShown = true;
1714
+ return;
1715
+ }
1716
+ this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe((e) => {
1717
+ // remove duplicates
1718
+ this.items = this._createBreadcrumbs(this.activatedRoute.root).filter((item, index, self) => index ===
1719
+ self.findIndex((t) => t.label === item.label && t.routerLink === item.routerLink));
1720
+ this._checkHiddenBreadcrumb();
1721
+ this._checkEmpty();
1722
+ });
1723
+ }
1724
+ _checkHiddenBreadcrumb() {
1725
+ const activeBreadcrumb = this.items?.find((item) => {
1726
+ return item.routerLink === this.router.url;
1727
+ });
1728
+ this.isShown = !!activeBreadcrumb?.isShown;
1729
+ }
1730
+ _createBreadcrumbs(activatedRoute, routerLink = '', breadcrumbs = []) {
1731
+ const children = activatedRoute.children;
1732
+ if (children.length === 0) {
1733
+ return breadcrumbs;
1734
+ }
1735
+ for (const child of children) {
1736
+ const routeURL = child.snapshot.url.map((segment) => segment.path).join('/');
1737
+ if (routeURL !== '') {
1738
+ routerLink += `/${routeURL}`;
1739
+ }
1740
+ let label = child.snapshot.data['breadcrumb'];
1741
+ const notClickableBreadcrumb = !!child.snapshot.data['notClickableBreadcrumb'];
1742
+ const isShown = !!child.snapshot.data['isShown'];
1743
+ const extraBreadcrumbs = child.snapshot.data['extraBreadcrumbs'] || [];
1744
+ if (!(typeof label === 'undefined' || label === null)) {
1745
+ const data = activatedRoute.snapshot.firstChild?.data || {};
1746
+ // Resolve dynamic breadcrumb label
1747
+ if (label && label.startsWith('[') && label.endsWith(']')) {
1748
+ label = this._getRecursiveKey(data, label.slice(1, -1).split('.'));
1749
+ }
1750
+ // Resolve dynamic URL parts
1751
+ const resolveDynamicUrl = (route) => {
1752
+ return route.replace(/\[([^\]]+)]/g, (_, key) => this._getRecursiveKey(data, key.split('.')) || '');
1753
+ };
1754
+ const mainBreadcrumb = {
1755
+ label,
1756
+ routerLink,
1757
+ data,
1758
+ notClickableBreadcrumb,
1759
+ isShown,
1760
+ };
1761
+ // Process extra breadcrumbs
1762
+ const beforeBreadcrumbs = [];
1763
+ const afterBreadcrumbs = [];
1764
+ extraBreadcrumbs.forEach((extra) => {
1765
+ let extraLabel = extra.label || '';
1766
+ if (extraLabel.startsWith('[') && extraLabel.endsWith(']')) {
1767
+ extraLabel = this._getRecursiveKey(data, extraLabel.slice(1, -1).split('.'));
1768
+ }
1769
+ const extraUrl = resolveDynamicUrl(extra.routerLink || '');
1770
+ const extraBreadcrumb = { ...extra, label: extraLabel, routerLink: extraUrl };
1771
+ if (extra.position === 'before') {
1772
+ beforeBreadcrumbs.push(extraBreadcrumb);
1773
+ }
1774
+ else {
1775
+ afterBreadcrumbs.push(extraBreadcrumb);
1776
+ }
1777
+ });
1778
+ // Merge breadcrumbs
1779
+ breadcrumbs.push(...beforeBreadcrumbs, mainBreadcrumb, ...afterBreadcrumbs);
1780
+ }
1781
+ return this._createBreadcrumbs(child, routerLink, breadcrumbs);
1782
+ }
1783
+ }
1784
+ _checkEmpty() {
1785
+ if (!this.items)
1786
+ return;
1787
+ const lastBreadcrumbVisibility = this.items[this.items.length - 1].isShown;
1788
+ this.items = this.items.filter((b) => b.label !== '');
1789
+ this.items[this.items.length - 1].isShown = lastBreadcrumbVisibility;
1790
+ }
1791
+ _getRecursiveKey(obj, keys) {
1792
+ if (keys.length === 0) {
1793
+ return undefined;
1794
+ }
1795
+ const [currentKey, ...remainingKeys] = keys;
1796
+ if (currentKey in obj) {
1797
+ if (remainingKeys.length > 0) {
1798
+ return this._getRecursiveKey(obj[currentKey], remainingKeys);
1799
+ }
1800
+ return obj[currentKey];
1801
+ }
1802
+ return undefined;
1803
+ }
1804
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppBreadcrumbComponent, deps: [{ token: i1$7.ActivatedRoute }, { token: i1$7.Router }], target: i0.ɵɵFactoryTarget.Component });
1805
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AppBreadcrumbComponent, isStandalone: true, selector: "app-breadcrumb", inputs: { items: "items" }, ngImport: i0, template: "@if(isShown) {\r\n<nav class=\"flex gap-x-3 text-[12px] w-full items-center mb-5\">\r\n <div class=\"card flex justify-center\">\r\n <p-breadcrumb [model]=\"items\"></p-breadcrumb>\r\n </div>\r\n</nav>\r\n}\r\n", styles: [".p-breadcrumb-list li:first-child a{@apply text-secondary;}.p-breadcrumb-list .p-breadcrumb-separator{transform:scale(.7);display:none}.p-breadcrumb-item:not(:last-of-type) .p-breadcrumb-item-link{padding:0 4px}.p-breadcrumb-item:not(:last-of-type) .p-breadcrumb-item-label{@apply text-light_red relative;}.p-breadcrumb-item:not(:last-of-type) .p-breadcrumb-item-label:hover{@apply text-light_red;}.p-breadcrumb-item:not(:last-of-type) .p-breadcrumb-item-label:before{content:\"/\";@apply inline-block absolute text-gray-900;inset-inline-end:-9px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: Breadcrumb, selector: "p-breadcrumb", inputs: ["model", "style", "styleClass", "home", "homeAriaLabel"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: RouterModule }], encapsulation: i0.ViewEncapsulation.None });
1806
+ }
1807
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppBreadcrumbComponent, decorators: [{
1808
+ type: Component,
1809
+ args: [{ selector: 'app-breadcrumb', standalone: true, imports: [CommonModule, Breadcrumb, RouterModule], encapsulation: ViewEncapsulation.None, template: "@if(isShown) {\r\n<nav class=\"flex gap-x-3 text-[12px] w-full items-center mb-5\">\r\n <div class=\"card flex justify-center\">\r\n <p-breadcrumb [model]=\"items\"></p-breadcrumb>\r\n </div>\r\n</nav>\r\n}\r\n", styles: [".p-breadcrumb-list li:first-child a{@apply text-secondary;}.p-breadcrumb-list .p-breadcrumb-separator{transform:scale(.7);display:none}.p-breadcrumb-item:not(:last-of-type) .p-breadcrumb-item-link{padding:0 4px}.p-breadcrumb-item:not(:last-of-type) .p-breadcrumb-item-label{@apply text-light_red relative;}.p-breadcrumb-item:not(:last-of-type) .p-breadcrumb-item-label:hover{@apply text-light_red;}.p-breadcrumb-item:not(:last-of-type) .p-breadcrumb-item-label:before{content:\"/\";@apply inline-block absolute text-gray-900;inset-inline-end:-9px}\n"] }]
1810
+ }], ctorParameters: () => [{ type: i1$7.ActivatedRoute }, { type: i1$7.Router }], propDecorators: { items: [{
1811
+ type: Input
1812
+ }] } });
1813
+
1814
+ const SIDEBAR_DATA = new InjectionToken('SIDEBAR_DATA');
1815
+ function createCustomInjector(parentInjector, injectionToken, data) {
1816
+ return Injector.create({
1817
+ parent: parentInjector,
1818
+ providers: [
1819
+ {
1820
+ provide: injectionToken,
1821
+ useValue: data ?? null
1822
+ }
1823
+ ]
1824
+ });
1825
+ }
1826
+ ;
1827
+ var SidebarActionType;
1828
+ (function (SidebarActionType) {
1829
+ SidebarActionType["SAVE"] = "SAVE";
1830
+ SidebarActionType["SaveMore"] = "SaveMore";
1831
+ SidebarActionType["CANCEL"] = "CANCEL";
1832
+ SidebarActionType["SUBMIT"] = "SUBMIT";
1833
+ SidebarActionType["CLOSE"] = "CLOSE";
1834
+ SidebarActionType["CloseWithData"] = "CloseWithData";
1835
+ })(SidebarActionType || (SidebarActionType = {}));
1836
+
1837
+ class DataInjectorPipe {
1838
+ injector = inject(Injector);
1839
+ transform(data) {
1840
+ return createCustomInjector(this.injector, SIDEBAR_DATA, data);
1841
+ }
1842
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DataInjectorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1843
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: DataInjectorPipe, isStandalone: true, name: "dataInjector" });
1844
+ }
1845
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DataInjectorPipe, decorators: [{
1846
+ type: Pipe,
1847
+ args: [{
1848
+ name: 'dataInjector',
1849
+ standalone: true,
1850
+ pure: true
1851
+ }]
1852
+ }] });
1853
+
1854
+ class SideBarDynamicComponent {
1855
+ dynamicSidebarService = inject(DynamicSidebarService);
1856
+ parentInjector = inject(Injector);
1857
+ location = inject(Location);
1858
+ popStateListener;
1859
+ sidebarConfig = this.dynamicSidebarService.sidebarConfig;
1860
+ ngOnInit() {
1861
+ //To close a sidebar when the browser back button is pressed
1862
+ this.popStateListener = this.location.subscribe(() => {
1863
+ if (this.dynamicSidebarService.sidebarConfig.visible) {
1864
+ this.dynamicSidebarService.close();
1865
+ }
1866
+ });
1867
+ }
1868
+ ngOnDestroy() {
1869
+ // reset Sidebar token
1870
+ createCustomInjector(this.parentInjector, SIDEBAR_DATA, null);
1871
+ }
1872
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SideBarDynamicComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1873
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: SideBarDynamicComponent, isStandalone: true, selector: "app-side-bar-dynamic", ngImport: i0, template: "<p-drawer (onHide)=\"dynamicSidebarService.close()\" [(visible)]=\"sidebarConfig.visible\"\r\n [closable]=\"sidebarConfig.closable\" [closeOnEscape]=\"sidebarConfig.closeOnEscape\"\r\n [dismissible]=\"sidebarConfig.dismissible\" [ngClass]=\"{ show: sidebarConfig.show }\" [position]=\"'left'\" appendTo=\"body\"\r\n id=\"main-drawer\"\r\n styleClass=\"p-drawer-{{ sidebarConfig.sidebarSize }} custom-content bg-white {{ sidebarConfig.styleClass }}\">\r\n <ng-template pTemplate=\"header\">{{ sidebarConfig.title }}</ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <ng-container [ngComponentOutletInjector]=\"dynamicSidebarService.contentComponentData | dataInjector\"\r\n [ngComponentOutlet]=\"dynamicSidebarService.contentComponentRef\"></ng-container>\r\n </ng-template>\r\n @if (sidebarConfig.showSaveBtn || sidebarConfig.showSaveAndMoreBtn || sidebarConfig.showCancelBtn) {\r\n <ng-template pTemplate=\"footer\">\r\n <section class=\"flex justify-between bg-gray-200 py-4\" id=\"sidebar-footer\">\r\n <div class=\"flex gap-2\">\r\n @if (sidebarConfig.showSaveBtn) {\r\n <app-button (clickEmitter)=\"dynamicSidebarService.submit(true)\"\r\n [disabled]=\"dynamicSidebarService.isButtonDisabled()\"\r\n [icon]=\"sidebarConfig!.actions!.save!.icon || 'font-icon-plus'\"\r\n [iconPos]=\"sidebarConfig!.actions!.save!.iconPos || 'right'\"\r\n [styleClass]=\"sidebarConfig!.actions!.save!.style || 'danger'\"\r\n [title]=\"sidebarConfig!.actions!.save!.title || ('actions.save' | translate)\"\r\n [variant]=\"sidebarConfig!.actions!.save!.variant\" />\r\n }\r\n @if (sidebarConfig.showSaveAndMoreBtn) {\r\n <app-button (clickEmitter)=\"dynamicSidebarService.submit()\"\r\n [disabled]=\"dynamicSidebarService.isButtonDisabled()\"\r\n [icon]=\"sidebarConfig!.actions!.saveAndMore!.icon || 'font-icon-plus'\"\r\n [iconPos]=\"sidebarConfig!.actions!.saveAndMore!.iconPos || 'right'\"\r\n [styleClass]=\"sidebarConfig!.actions!.saveAndMore!.style || 'danger'\"\r\n [title]=\"sidebarConfig!.actions!.saveAndMore!.title || ('actions.save_and_and_more' | translate)\"\r\n [variant]=\"sidebarConfig!.actions!.saveAndMore!.variant\" />\r\n\r\n }\r\n </div>\r\n @if (sidebarConfig.showCancelBtn) {\r\n <app-button (clickEmitter)=\"dynamicSidebarService.cancel()\" [styleClass]=\"'secondary'\"\r\n [title]=\"'actions.cancel' | translate\" />\r\n }\r\n </section>\r\n </ng-template>\r\n }\r\n</p-drawer>", styles: [".sidebar.show{min-width:550px}\n"], dependencies: [{ kind: "component", type: Drawer, selector: "p-drawer", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: AppButtonComponent, selector: "app-button" }, { kind: "pipe", type: DataInjectorPipe, name: "dataInjector" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
1874
+ }
1875
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SideBarDynamicComponent, decorators: [{
1876
+ type: Component,
1877
+ args: [{ selector: "app-side-bar-dynamic", standalone: true, imports: [Drawer, NgClass, NgComponentOutlet, PrimeTemplate, DataInjectorPipe, AppButtonComponent, TranslatePipe], template: "<p-drawer (onHide)=\"dynamicSidebarService.close()\" [(visible)]=\"sidebarConfig.visible\"\r\n [closable]=\"sidebarConfig.closable\" [closeOnEscape]=\"sidebarConfig.closeOnEscape\"\r\n [dismissible]=\"sidebarConfig.dismissible\" [ngClass]=\"{ show: sidebarConfig.show }\" [position]=\"'left'\" appendTo=\"body\"\r\n id=\"main-drawer\"\r\n styleClass=\"p-drawer-{{ sidebarConfig.sidebarSize }} custom-content bg-white {{ sidebarConfig.styleClass }}\">\r\n <ng-template pTemplate=\"header\">{{ sidebarConfig.title }}</ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <ng-container [ngComponentOutletInjector]=\"dynamicSidebarService.contentComponentData | dataInjector\"\r\n [ngComponentOutlet]=\"dynamicSidebarService.contentComponentRef\"></ng-container>\r\n </ng-template>\r\n @if (sidebarConfig.showSaveBtn || sidebarConfig.showSaveAndMoreBtn || sidebarConfig.showCancelBtn) {\r\n <ng-template pTemplate=\"footer\">\r\n <section class=\"flex justify-between bg-gray-200 py-4\" id=\"sidebar-footer\">\r\n <div class=\"flex gap-2\">\r\n @if (sidebarConfig.showSaveBtn) {\r\n <app-button (clickEmitter)=\"dynamicSidebarService.submit(true)\"\r\n [disabled]=\"dynamicSidebarService.isButtonDisabled()\"\r\n [icon]=\"sidebarConfig!.actions!.save!.icon || 'font-icon-plus'\"\r\n [iconPos]=\"sidebarConfig!.actions!.save!.iconPos || 'right'\"\r\n [styleClass]=\"sidebarConfig!.actions!.save!.style || 'danger'\"\r\n [title]=\"sidebarConfig!.actions!.save!.title || ('actions.save' | translate)\"\r\n [variant]=\"sidebarConfig!.actions!.save!.variant\" />\r\n }\r\n @if (sidebarConfig.showSaveAndMoreBtn) {\r\n <app-button (clickEmitter)=\"dynamicSidebarService.submit()\"\r\n [disabled]=\"dynamicSidebarService.isButtonDisabled()\"\r\n [icon]=\"sidebarConfig!.actions!.saveAndMore!.icon || 'font-icon-plus'\"\r\n [iconPos]=\"sidebarConfig!.actions!.saveAndMore!.iconPos || 'right'\"\r\n [styleClass]=\"sidebarConfig!.actions!.saveAndMore!.style || 'danger'\"\r\n [title]=\"sidebarConfig!.actions!.saveAndMore!.title || ('actions.save_and_and_more' | translate)\"\r\n [variant]=\"sidebarConfig!.actions!.saveAndMore!.variant\" />\r\n\r\n }\r\n </div>\r\n @if (sidebarConfig.showCancelBtn) {\r\n <app-button (clickEmitter)=\"dynamicSidebarService.cancel()\" [styleClass]=\"'secondary'\"\r\n [title]=\"'actions.cancel' | translate\" />\r\n }\r\n </section>\r\n </ng-template>\r\n }\r\n</p-drawer>", styles: [".sidebar.show{min-width:550px}\n"] }]
1878
+ }] });
1879
+
1880
+ const SidebarConfigDefaults = {
1881
+ title: "",
1882
+ show: true,
1883
+ visible: true,
1884
+ closable: true,
1885
+ dismissible: false,
1886
+ closeOnEscape: false,
1887
+ sidebarSize: "md",
1888
+ showCancelBtn: false,
1889
+ showSaveBtn: false,
1890
+ showSaveAndMoreBtn: false,
1891
+ actions: {
1892
+ save: {},
1893
+ saveAndMore: {
1894
+ variant: "outlined"
1895
+ }
1896
+ }
1897
+ };
1898
+
1899
+ class DynamicSidebarService {
1900
+ environmentInjector;
1901
+ appRef;
1902
+ contentComponentRef = null;
1903
+ contentComponentData;
1904
+ sidebarConfig = this.getDefaultConfig();
1905
+ activeForm = null;
1906
+ componentRef = null;
1907
+ sidebarAction$ = new Subject();
1908
+ action$ = this.sidebarAction$.asObservable();
1909
+ sidebarSideEffectAction$ = new Subject();
1910
+ sideEffectAction$ = this.sidebarSideEffectAction$.asObservable();
1911
+ isOpen$ = new BehaviorSubject(false);
1912
+ isOpenObservable$ = this.isOpen$.asObservable();
1913
+ constructor(environmentInjector, appRef) {
1914
+ this.environmentInjector = environmentInjector;
1915
+ this.appRef = appRef;
1916
+ }
1917
+ // Action notifications
1918
+ notifyAction(type, payload) {
1919
+ this.sidebarAction$.next({ type, payload });
1920
+ }
1921
+ notifySideEffectAction(type, payload) {
1922
+ this.sidebarSideEffectAction$.next({ type, payload });
1923
+ }
1924
+ // Form management
1925
+ setActiveForm(control) {
1926
+ this.activeForm = control;
1927
+ }
1928
+ resetActiveForm() {
1929
+ this.activeForm = null;
1930
+ }
1931
+ isButtonDisabled() {
1932
+ if (!this.activeForm) {
1933
+ return false;
1934
+ }
1935
+ return this.activeForm.invalid || this.activeForm.untouched;
1936
+ }
1937
+ open(component, config, data) {
1938
+ // Close any existing sidebar before opening a new one
1939
+ // TODO Need to Review
1940
+ if (!component) {
1941
+ return;
1942
+ }
1943
+ this.close();
1944
+ this.contentComponentRef = component;
1945
+ this.contentComponentData = data;
1946
+ this.sidebarConfig = { ...this.getDefaultConfig(), ...config };
1947
+ this.componentRef = createComponent(SideBarDynamicComponent, {
1948
+ environmentInjector: this.environmentInjector,
1949
+ });
1950
+ // Attach the component to the Angular application
1951
+ this.appRef.attachView(this.componentRef.hostView);
1952
+ // Append the component to the DOM
1953
+ const domElem = this.componentRef.hostView.rootNodes[0];
1954
+ document.body.appendChild(domElem);
1955
+ }
1956
+ /**
1957
+ * Closes the currently open sidebar, if any.
1958
+ */
1959
+ close() {
1960
+ if (this.componentRef) {
1961
+ // Detach the view and destroy the component
1962
+ this.appRef.detachView(this.componentRef.hostView);
1963
+ this.componentRef.destroy();
1964
+ this.componentRef = null;
1965
+ // Reset content and configuration
1966
+ this.contentComponentRef = null;
1967
+ this.contentComponentData = null;
1968
+ this.sidebarConfig = this.getDefaultConfig();
1969
+ this.isOpen$.next(false);
1970
+ this.resetActiveForm();
1971
+ this.notifySideEffectAction(SidebarActionType.CLOSE);
1972
+ }
1973
+ }
1974
+ cancel() {
1975
+ this.notifyAction(SidebarActionType.CANCEL);
1976
+ }
1977
+ submit(flag = false) {
1978
+ const actionType = flag ? SidebarActionType.SaveMore : SidebarActionType.SAVE;
1979
+ this.notifyAction(actionType, { withClose: flag });
1980
+ }
1981
+ /**
1982
+ * Provides the default configuration for the sidebar.
1983
+ * @returns The default SidebarConfig object.
1984
+ */
1985
+ getDefaultConfig() {
1986
+ return {
1987
+ ...SidebarConfigDefaults,
1988
+ show: false,
1989
+ visible: false,
1990
+ closable: false,
1991
+ dismissible: true
1992
+ };
1993
+ }
1994
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarService, deps: [{ token: i0.EnvironmentInjector }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
1995
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarService, providedIn: "root" });
1996
+ }
1997
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarService, decorators: [{
1998
+ type: Injectable,
1999
+ args: [{
2000
+ providedIn: "root"
2001
+ }]
2002
+ }], ctorParameters: () => [{ type: i0.EnvironmentInjector }, { type: i0.ApplicationRef }] });
2003
+
2004
+ class ConfirmationDialogService {
2005
+ dialogService;
2006
+ constructor(dialogService) {
2007
+ this.dialogService = dialogService;
2008
+ }
2009
+ open(data) {
2010
+ const ref = this.dialogService.open(ConfirmationDialogComponent, {
2011
+ data,
2012
+ header: data.header,
2013
+ showHeader: true,
2014
+ width: '600px',
2015
+ closable: true,
2016
+ modal: true,
2017
+ styleClass: 'confirmation-dialog-wrapper',
2018
+ breakpoints: data.breakpoints,
2019
+ });
2020
+ if (!ref) {
2021
+ return of(false); // or EMPTY / throwError — depending on your logic
2022
+ }
2023
+ // Emit true/false when dialog closes
2024
+ return ref.onClose.pipe(filter$1((res) => res !== undefined), map((res) => !!res));
2025
+ }
2026
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogService, deps: [{ token: i1$8.DialogService }], target: i0.ɵɵFactoryTarget.Injectable });
2027
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogService, providedIn: 'root' });
2028
+ }
2029
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogService, decorators: [{
2030
+ type: Injectable,
2031
+ args: [{
2032
+ providedIn: 'root',
2033
+ }]
2034
+ }], ctorParameters: () => [{ type: i1$8.DialogService }] });
2035
+
2036
+ class BottomSheetComponent {
2037
+ show = false;
2038
+ contentTemplate;
2039
+ onHide = new EventEmitter();
2040
+ onShow = new EventEmitter();
2041
+ hideBottomSheet() {
2042
+ this.show = false;
2043
+ this.onHide.emit(false);
2044
+ }
2045
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2046
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: BottomSheetComponent, isStandalone: true, selector: "app-bottom-sheet", inputs: { show: "show", contentTemplate: "contentTemplate" }, outputs: { onHide: "onHide", onShow: "onShow" }, ngImport: i0, template: "<p-drawer\r\n (onHide)=\"hideBottomSheet()\"\r\n (onShow)=\"onShow.emit($event)\"\r\n [(visible)]=\"show\"\r\n [closable]=\"false\"\r\n [ngClass]=\"{ show: show }\"\r\n [position]=\"'bottom'\"\r\n appendTo=\"body\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"band\"></div>\r\n </ng-template>\r\n @if (contentTemplate) {\r\n <ng-template pTemplate=\"content\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n </ng-template>\r\n }\r\n</p-drawer>\r\n", styles: [".sidebar.show{@apply min-w-[550px];}.band{background-color:#dfe0e6;width:40px;height:4px;border-radius:24px;display:block}.p-drawer-header,.p-drawer-footer{background-color:var(--gray-100)}.p-drawer-header{--p-drawer-header-padding: .75rem var(--p-overlay-modal-padding);font-weight:500;justify-content:center;color:#090d0f;font-size:20px;flex-direction:column}.p-drawer-content{padding:0!important;margin:0!important}\n"], dependencies: [{ kind: "directive", type: PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: Drawer, selector: "p-drawer", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TooltipModule }], encapsulation: i0.ViewEncapsulation.None });
2047
+ }
2048
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BottomSheetComponent, decorators: [{
2049
+ type: Component,
2050
+ args: [{ selector: "app-bottom-sheet", standalone: true, imports: [PrimeTemplate, Drawer, NgClass, NgTemplateOutlet, TooltipModule], encapsulation: ViewEncapsulation.None, template: "<p-drawer\r\n (onHide)=\"hideBottomSheet()\"\r\n (onShow)=\"onShow.emit($event)\"\r\n [(visible)]=\"show\"\r\n [closable]=\"false\"\r\n [ngClass]=\"{ show: show }\"\r\n [position]=\"'bottom'\"\r\n appendTo=\"body\"\r\n >\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"band\"></div>\r\n </ng-template>\r\n @if (contentTemplate) {\r\n <ng-template pTemplate=\"content\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n </ng-template>\r\n }\r\n</p-drawer>\r\n", styles: [".sidebar.show{@apply min-w-[550px];}.band{background-color:#dfe0e6;width:40px;height:4px;border-radius:24px;display:block}.p-drawer-header,.p-drawer-footer{background-color:var(--gray-100)}.p-drawer-header{--p-drawer-header-padding: .75rem var(--p-overlay-modal-padding);font-weight:500;justify-content:center;color:#090d0f;font-size:20px;flex-direction:column}.p-drawer-content{padding:0!important;margin:0!important}\n"] }]
2051
+ }], propDecorators: { show: [{
2052
+ type: Input
2053
+ }], contentTemplate: [{
2054
+ type: Input
2055
+ }], onHide: [{
2056
+ type: Output
2057
+ }], onShow: [{
2058
+ type: Output
2059
+ }] } });
2060
+
2061
+ class DynamicSidebarComponent {
2062
+ component;
2063
+ data;
2064
+ title = '';
2065
+ actions;
2066
+ sidebarSize = 'md';
2067
+ closable = true;
2068
+ closeOnEscape = true;
2069
+ dismissible = true;
2070
+ position = 'left';
2071
+ styleClass = '';
2072
+ disabled = false;
2073
+ closed = new EventEmitter();
2074
+ contentContainer;
2075
+ contentRef;
2076
+ show = true;
2077
+ ngAfterViewInit() {
2078
+ this.renderContent();
2079
+ }
2080
+ renderContent() {
2081
+ if (!this.component)
2082
+ return;
2083
+ this.contentContainer.clear();
2084
+ this.contentRef = this.contentContainer.createComponent(this.component);
2085
+ if (this.data)
2086
+ Object.assign(this.contentRef.instance, this.data);
2087
+ }
2088
+ handleClose() {
2089
+ if (this.contentRef.instance.close)
2090
+ this.contentRef.instance.close();
2091
+ this.closed.emit(null);
2092
+ this.destroy();
2093
+ }
2094
+ handleSubmit() {
2095
+ if (this.data.form) {
2096
+ this.data.form.markAllAsTouched();
2097
+ if (this.data.form.invalid)
2098
+ return;
2099
+ }
2100
+ if (this.contentRef.instance.submit)
2101
+ this.contentRef.instance.submit();
2102
+ }
2103
+ destroy() {
2104
+ this.contentRef?.destroy();
2105
+ }
2106
+ ngOnDestroy() {
2107
+ this.destroy();
2108
+ }
2109
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2110
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: DynamicSidebarComponent, isStandalone: true, selector: "app-dynamic-sidebar", inputs: { component: "component", data: "data", title: "title", actions: "actions", sidebarSize: "sidebarSize", closable: "closable", closeOnEscape: "closeOnEscape", dismissible: "dismissible", position: "position", styleClass: "styleClass", disabled: "disabled" }, outputs: { closed: "closed" }, viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<p-drawer\r\n [(visible)]=\"show\"\r\n [position]=\"position\"\r\n appendTo=\"body\"\r\n [closable]=\"closable\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n [dismissible]=\"dismissible\"\r\n (onHide)=\"handleClose()\"\r\n [position]=\"'left'\"\r\n [styleClass]=\"'p-drawer-' + sidebarSize + ' custom-content bg-white ' + styleClass\">\r\n <ng-template pTemplate=\"header\">\r\n <p class=\"truncate\" [pTooltip]=\"title\">{{ title }}</p>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <ng-template #contentContainer></ng-template>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"flex gap-4 mt-4\">\r\n <div class=\"flex-auto\">\r\n <app-button (click)=\"handleSubmit()\"\r\n [icon]=\"actions?.save?.icon\"\r\n [iconPos]=\"actions?.save?.iconPos || 'right'\"\r\n [styleClass]=\"(actions?.save?.style || 'danger') + ' w-full'\"\r\n [label]=\"actions?.save?.title || ('actions.submit' | translate)\"\r\n [variant]=\"actions?.save?.variant\"\r\n />\r\n </div>\r\n <app-button (click)=\"handleClose()\" severity=\"danger\" variant=\"outlined\"\r\n [label]=\"actions?.cancel?.title || ('actions.cancel' | translate)\" />\r\n </div>\r\n </ng-template>\r\n</p-drawer>\r\n", styles: [".flex-auto{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: DrawerModule }, { kind: "component", type: i1$9.Drawer, selector: "p-drawer", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "closeButtonProps", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen", "header", "maskStyle", "closable"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1$3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip"] }, { kind: "component", type: AppButtonComponent, selector: "app-button" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
2111
+ }
2112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarComponent, decorators: [{
2113
+ type: Component,
2114
+ args: [{ selector: "app-dynamic-sidebar", standalone: true, imports: [CommonModule, TranslatePipe, DrawerModule, TooltipModule, AppButtonComponent], template: "<p-drawer\r\n [(visible)]=\"show\"\r\n [position]=\"position\"\r\n appendTo=\"body\"\r\n [closable]=\"closable\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n [dismissible]=\"dismissible\"\r\n (onHide)=\"handleClose()\"\r\n [position]=\"'left'\"\r\n [styleClass]=\"'p-drawer-' + sidebarSize + ' custom-content bg-white ' + styleClass\">\r\n <ng-template pTemplate=\"header\">\r\n <p class=\"truncate\" [pTooltip]=\"title\">{{ title }}</p>\r\n </ng-template>\r\n <ng-template pTemplate=\"content\">\r\n <ng-template #contentContainer></ng-template>\r\n </ng-template>\r\n <ng-template pTemplate=\"footer\">\r\n <div class=\"flex gap-4 mt-4\">\r\n <div class=\"flex-auto\">\r\n <app-button (click)=\"handleSubmit()\"\r\n [icon]=\"actions?.save?.icon\"\r\n [iconPos]=\"actions?.save?.iconPos || 'right'\"\r\n [styleClass]=\"(actions?.save?.style || 'danger') + ' w-full'\"\r\n [label]=\"actions?.save?.title || ('actions.submit' | translate)\"\r\n [variant]=\"actions?.save?.variant\"\r\n />\r\n </div>\r\n <app-button (click)=\"handleClose()\" severity=\"danger\" variant=\"outlined\"\r\n [label]=\"actions?.cancel?.title || ('actions.cancel' | translate)\" />\r\n </div>\r\n </ng-template>\r\n</p-drawer>\r\n", styles: [".flex-auto{flex:1 1 auto}\n"] }]
2115
+ }], propDecorators: { component: [{
2116
+ type: Input
2117
+ }], data: [{
2118
+ type: Input
2119
+ }], title: [{
2120
+ type: Input
2121
+ }], actions: [{
2122
+ type: Input
2123
+ }], sidebarSize: [{
2124
+ type: Input
2125
+ }], closable: [{
2126
+ type: Input
2127
+ }], closeOnEscape: [{
2128
+ type: Input
2129
+ }], dismissible: [{
2130
+ type: Input
2131
+ }], position: [{
2132
+ type: Input
2133
+ }], styleClass: [{
2134
+ type: Input
2135
+ }], disabled: [{
2136
+ type: Input
2137
+ }], closed: [{
2138
+ type: Output
2139
+ }], contentContainer: [{
2140
+ type: ViewChild,
2141
+ args: ['contentContainer', { read: ViewContainerRef }]
2142
+ }] } });
2143
+
2144
+ class DynamicSidebarV2Service {
2145
+ sidebarRef;
2146
+ appRef = inject(ApplicationRef);
2147
+ injector = inject(Injector);
2148
+ envInjector = inject(EnvironmentInjector);
2149
+ open(options) {
2150
+ this.close();
2151
+ this.sidebarRef = createComponent(DynamicSidebarComponent, {
2152
+ environmentInjector: this.envInjector,
2153
+ elementInjector: this.injector,
2154
+ });
2155
+ const instance = this.sidebarRef.instance;
2156
+ instance.title = options.title ?? '';
2157
+ instance.sidebarSize = options.size ?? 'md';
2158
+ instance.position = options.position ?? 'left';
2159
+ instance.styleClass = options.styleClass ?? '';
2160
+ instance.component = options.component;
2161
+ instance.data = options.data ?? {};
2162
+ instance.actions = options.actions;
2163
+ instance.closed.subscribe(() => this.close());
2164
+ this.appRef.attachView(this.sidebarRef.hostView);
2165
+ const domElem = this.sidebarRef.hostView.rootNodes[0];
2166
+ document.body.appendChild(domElem);
2167
+ }
2168
+ close() {
2169
+ if (this.sidebarRef) {
2170
+ this.sidebarRef.destroy();
2171
+ this.sidebarRef = undefined;
2172
+ }
2173
+ }
2174
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarV2Service, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2175
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarV2Service, providedIn: 'root' });
2176
+ }
2177
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarV2Service, decorators: [{
2178
+ type: Injectable,
2179
+ args: [{ providedIn: 'root' }]
2180
+ }] });
2181
+
2182
+ class AlertDialogComponent extends DynamicDialogRef {
2183
+ router = inject(Router);
2184
+ dynamicDialogConfig = inject(DynamicDialogConfig);
2185
+ _destroyRef = inject(DestroyRef);
2186
+ _ref = inject(DynamicDialogRef);
2187
+ ngOnInit() {
2188
+ this.router.events.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
2189
+ if (this.dynamicDialogConfig) {
2190
+ this._ref.close(false);
2191
+ }
2192
+ });
2193
+ }
2194
+ close() {
2195
+ this._ref.close(false);
2196
+ }
2197
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AlertDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2198
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AlertDialogComponent, isStandalone: true, selector: "app-alert-dialog", providers: [DynamicDialogStyle], usesInheritance: true, ngImport: i0, template: "@if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"alert-dialog__message mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n </div>\r\n }\r\n <div class=\"alert-dialog__actions flex gap-2 mt-4\">\r\n <app-button [severity]=\"'primary'\" variant=\"outlined\"\r\n [label]=\"dynamicDialogConfig.data.cancelBtnLabel??('actions.close' | translate)\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId??'button_close_alert'\" [styleClass]=\"'cancel-btn alert-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n", styles: [""], dependencies: [{ kind: "component", type: AppButtonComponent, selector: "app-button" }, { kind: "ngmodule", type: AvatarModule }, { kind: "ngmodule", type: DynamicDialogModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None });
2199
+ }
2200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AlertDialogComponent, decorators: [{
2201
+ type: Component,
2202
+ args: [{ selector: 'app-alert-dialog', encapsulation: ViewEncapsulation.None, standalone: true, imports: [
2203
+ AppButtonComponent,
2204
+ AvatarModule,
2205
+ DynamicDialogModule,
2206
+ TranslatePipe,
2207
+ ], providers: [DynamicDialogStyle], template: "@if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog\">\r\n <div class=\"dialog-wrapper\">\r\n @if (dynamicDialogConfig.data) {\r\n <div class=\"alert-dialog__content my-4\">\r\n @if (dynamicDialogConfig.data.dialogIcon) {\r\n <em [class]=\"dynamicDialogConfig.data.dialogIcon\"></em>\r\n }\r\n <p class=\"alert-dialog__message mb-2\">\r\n {{ dynamicDialogConfig.data.message }}\r\n </p>\r\n </div>\r\n }\r\n <div class=\"alert-dialog__actions flex gap-2 mt-4\">\r\n <app-button [severity]=\"'primary'\" variant=\"outlined\"\r\n [label]=\"dynamicDialogConfig.data.cancelBtnLabel??('actions.close' | translate)\"\r\n [id]=\"dynamicDialogConfig.data.cancelBtnId??'button_close_alert'\" [styleClass]=\"'cancel-btn alert-btn'\"\r\n (click)=\"close()\" />\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n" }]
2208
+ }] });
2209
+
2210
+ class AlertDialogService {
2211
+ dialogService = inject(DialogService);
2212
+ open(data) {
2213
+ const ref = this.dialogService.open(AlertDialogComponent, {
2214
+ data,
2215
+ header: data.header,
2216
+ showHeader: true,
2217
+ width: '600px',
2218
+ closable: true,
2219
+ modal: true,
2220
+ styleClass: 'alert-dialog-wrapper',
2221
+ });
2222
+ if (!ref) {
2223
+ return of(false); // or EMPTY / throwError — depending on your logic
2224
+ }
2225
+ // Emit true/false when dialog closes
2226
+ return ref.onClose.pipe(filter$1((res) => res !== undefined), map((res) => !!res));
2227
+ }
2228
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AlertDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2229
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AlertDialogService, providedIn: 'root' });
2230
+ }
2231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AlertDialogService, decorators: [{
2232
+ type: Injectable,
2233
+ args: [{
2234
+ providedIn: 'root',
2235
+ }]
2236
+ }] });
2237
+
2238
+ const dateRangeValidator = (fromKey, toKey) => (control) => {
2239
+ const fromControl = control.get?.(fromKey);
2240
+ const toControl = control.get?.(toKey);
2241
+ if (!fromControl?.value || !toControl?.value) {
2242
+ return null;
2243
+ }
2244
+ const from = new Date(fromControl.value);
2245
+ const to = new Date(toControl.value);
2246
+ from.setHours(0, 0, 0, 0);
2247
+ to.setHours(0, 0, 0, 0);
2248
+ return from > to ? { invalidDateRange: true } : null;
2249
+ };
2250
+ const notFutureDateValidator = (dateKey) => (control) => {
2251
+ const dateControl = control.get?.(dateKey);
2252
+ if (!dateControl?.value) {
2253
+ return null;
2254
+ }
2255
+ const valueDate = new Date(dateControl.value);
2256
+ valueDate.setHours(0, 0, 0, 0);
2257
+ const today = new Date();
2258
+ today.setHours(0, 0, 0, 0);
2259
+ return valueDate > today ? { futureDate: true } : null;
2260
+ };
2261
+
2262
+ /**
2263
+ * Generated bundle index. Do not edit.
2264
+ */
2265
+
2266
+ export { AlertDialogComponent, AlertDialogService, AppAccordionComponent, AppBreadcrumbComponent, AppButtonComponent, AppDropdownMenuComponent, AppTabsComponent, AutoCompleteComponent, BasicErrorKeysEnum, BottomSheetComponent, ConfirmationDialogComponent, ConfirmationDialogService, DatePickerComponent, DualCalendarComponent, DynamicFormComponent, DynamicSidebarService, DynamicSidebarV2Service, ErrorsWithValuesKeysEnum, FormFieldTypeEnum, FormUtils, FormValidationService, IcoMoonIconComponent, InputComponent, MONTHS_GREGORIAN, MONTHS_HIJRI, ReadMoreComponent, SelectButtonComponent, SelectComponent, SideBarComponent, SidebarConfigDefaults, SwitchComponent, UserAutocompleteCardComponent, UserInfoComponent, ValidationErrorsPipe, WEEKDAYS, dateRangeValidator, getGregorianMonthName, getHijriMonthName, getWeekdayName, notFutureDateValidator, numbersOnlyValidator };
2267
+ //# sourceMappingURL=corp-products-ui-components.mjs.map