@corp-products/ui-components 3.2.9 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/fesm2022/corp-products-ui-components.mjs +1988 -0
  2. package/fesm2022/corp-products-ui-components.mjs.map +1 -0
  3. package/index.d.ts +651 -0
  4. package/package.json +36 -22
  5. package/ng-package.json +0 -7
  6. package/src/enums/date-formatter.ts +0 -21
  7. package/src/helper/date-handler.ts +0 -142
  8. package/src/lib/app-accordion/app-accordion.component.html +0 -15
  9. package/src/lib/app-accordion/app-accordion.component.scss +0 -0
  10. package/src/lib/app-accordion/app-accordion.component.spec.ts +0 -21
  11. package/src/lib/app-accordion/app-accordion.component.ts +0 -21
  12. package/src/lib/app-accordion/index.ts +0 -2
  13. package/src/lib/app-breadcrumb/app-breadcrumb.component.html +0 -7
  14. package/src/lib/app-breadcrumb/app-breadcrumb.component.scss +0 -25
  15. package/src/lib/app-breadcrumb/app-breadcrumb.component.ts +0 -140
  16. package/src/lib/app-breadcrumb/app-breadcrumb.interface.ts +0 -15
  17. package/src/lib/app-button/app-button.component.html +0 -7
  18. package/src/lib/app-button/app-button.component.scss +0 -0
  19. package/src/lib/app-button/app-button.component.ts +0 -14
  20. package/src/lib/app-button/app-button.ts +0 -15
  21. package/src/lib/app-button/index.ts +0 -2
  22. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.html +0 -22
  23. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.scss +0 -39
  24. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.spec.ts +0 -21
  25. package/src/lib/app-dropdown-menu/app-dropdown-menu.component.ts +0 -43
  26. package/src/lib/app-dropdown-menu/app-dropdown-menu.ts +0 -17
  27. package/src/lib/app-dropdown-menu/index.ts +0 -2
  28. package/src/lib/app-dropdown-menu/menu-popup.pipe.ts +0 -18
  29. package/src/lib/app-header/app-header.component.html +0 -26
  30. package/src/lib/app-header/app-header.component.scss +0 -0
  31. package/src/lib/app-header/app-header.component.ts +0 -43
  32. package/src/lib/app-side-menu/app-side-menu.component.html +0 -20
  33. package/src/lib/app-side-menu/app-side-menu.component.ts +0 -28
  34. package/src/lib/app-side-menu/routes-names.ts +0 -28
  35. package/src/lib/app-side-menu/side-menu-items.ts +0 -45
  36. package/src/lib/app-side-menu/side-menu.ts +0 -12
  37. package/src/lib/app-tabs/app-tab.interface.ts +0 -27
  38. package/src/lib/app-tabs/app-tabs.component.html +0 -37
  39. package/src/lib/app-tabs/app-tabs.component.scss +0 -103
  40. package/src/lib/app-tabs/app-tabs.component.spec.ts +0 -21
  41. package/src/lib/app-tabs/app-tabs.component.ts +0 -67
  42. package/src/lib/app-tabs/index.ts +0 -2
  43. package/src/lib/bottom-sheet/bottom-sheet.component.html +0 -18
  44. package/src/lib/bottom-sheet/bottom-sheet.component.scss +0 -31
  45. package/src/lib/bottom-sheet/bottom-sheet.component.ts +0 -26
  46. package/src/lib/confirmation-dialog/confirmation-dialog.component.html +0 -37
  47. package/src/lib/confirmation-dialog/confirmation-dialog.component.scss +0 -0
  48. package/src/lib/confirmation-dialog/confirmation-dialog.component.spec.ts +0 -22
  49. package/src/lib/confirmation-dialog/confirmation-dialog.component.ts +0 -64
  50. package/src/lib/confirmation-dialog/confirmation-dialog.interface.ts +0 -13
  51. package/src/lib/confirmation-dialog/confirmation-dialog.service.ts +0 -34
  52. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.html +0 -27
  53. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.scss +0 -22
  54. package/src/lib/dual-calender/date-picker-switcher/date-picker-switcher.component.ts +0 -64
  55. package/src/lib/dual-calender/dual-calendar.component.html +0 -31
  56. package/src/lib/dual-calender/dual-calendar.component.scss +0 -229
  57. package/src/lib/dual-calender/dual-calendar.component.ts +0 -107
  58. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.html +0 -10
  59. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.scss +0 -0
  60. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.spec.ts +0 -21
  61. package/src/lib/dual-calender/gregorian-calendar/gregorian-calendar.component.ts +0 -59
  62. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.html +0 -10
  63. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.scss +0 -0
  64. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.spec.ts +0 -21
  65. package/src/lib/dual-calender/hijri-calendar/hijri-calendar.component.ts +0 -59
  66. package/src/lib/dual-calender/services/gregorian-i18n.service.ts +0 -123
  67. package/src/lib/dual-calender/services/islamic-i18n.service.ts +0 -119
  68. package/src/lib/dual-calender/utils/date-i18n.utils.ts +0 -58
  69. package/src/lib/dynamic-form/dynamic-form.component.html +0 -86
  70. package/src/lib/dynamic-form/dynamic-form.component.scss +0 -0
  71. package/src/lib/dynamic-form/dynamic-form.component.spec.ts +0 -21
  72. package/src/lib/dynamic-form/dynamic-form.component.ts +0 -58
  73. package/src/lib/dynamic-form/dynamic-form.interface.ts +0 -94
  74. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.html +0 -32
  75. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.scss +0 -3
  76. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.component.ts +0 -82
  77. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.config.ts +0 -31
  78. package/src/lib/dynamic-side-bar-v2/dynamic-sidebar.service.ts +0 -41
  79. package/src/lib/form-components/@utils/form-utils.ts +0 -12
  80. package/src/lib/form-components/@utils/validations/error-keys.enum.ts +0 -24
  81. package/src/lib/form-components/@utils/validations/form-validation.service.ts +0 -68
  82. package/src/lib/form-components/@utils/validations/index.ts +0 -3
  83. package/src/lib/form-components/@utils/validations/validation-message.pipe.ts +0 -24
  84. package/src/lib/form-components/components/auto-complete/auto-complete.component.html +0 -35
  85. package/src/lib/form-components/components/auto-complete/auto-complete.component.scss +0 -7
  86. package/src/lib/form-components/components/auto-complete/auto-complete.component.spec.ts +0 -21
  87. package/src/lib/form-components/components/auto-complete/auto-complete.component.ts +0 -57
  88. package/src/lib/form-components/components/base-input.component.ts +0 -35
  89. package/src/lib/form-components/components/date-picker/date-picker.component.html +0 -41
  90. package/src/lib/form-components/components/date-picker/date-picker.component.scss +0 -16
  91. package/src/lib/form-components/components/date-picker/date-picker.component.spec.ts +0 -21
  92. package/src/lib/form-components/components/date-picker/date-picker.component.ts +0 -54
  93. package/src/lib/form-components/components/input/input.component.html +0 -63
  94. package/src/lib/form-components/components/input/input.component.scss +0 -41
  95. package/src/lib/form-components/components/input/input.component.spec.ts +0 -21
  96. package/src/lib/form-components/components/input/input.component.ts +0 -45
  97. package/src/lib/form-components/components/select/select.component.html +0 -111
  98. package/src/lib/form-components/components/select/select.component.scss +0 -43
  99. package/src/lib/form-components/components/select/select.component.spec.ts +0 -21
  100. package/src/lib/form-components/components/select/select.component.ts +0 -56
  101. package/src/lib/form-components/components/select-button/select-button.component.html +0 -21
  102. package/src/lib/form-components/components/select-button/select-button.component.scss +0 -0
  103. package/src/lib/form-components/components/select-button/select-button.component.spec.ts +0 -21
  104. package/src/lib/form-components/components/select-button/select-button.component.ts +0 -22
  105. package/src/lib/form-components/components/switcher/switch.component.html +0 -5
  106. package/src/lib/form-components/components/switcher/switch.component.scss +0 -0
  107. package/src/lib/form-components/components/switcher/switch.component.spec.ts +0 -21
  108. package/src/lib/form-components/components/switcher/switch.component.ts +0 -25
  109. package/src/lib/form-components/index.ts +0 -9
  110. package/src/lib/form-components/interfaces/index.ts +0 -1
  111. package/src/lib/form-components/interfaces/label-value.ts +0 -4
  112. package/src/lib/ico-moon-icon/ico-moon-icon.component.ts +0 -23
  113. package/src/lib/read-more/read-more.component.html +0 -17
  114. package/src/lib/read-more/read-more.component.scss +0 -0
  115. package/src/lib/read-more/read-more.component.spec.ts +0 -21
  116. package/src/lib/read-more/read-more.component.ts +0 -21
  117. package/src/lib/side-bar/side-bar.component.html +0 -24
  118. package/src/lib/side-bar/side-bar.component.scss +0 -22
  119. package/src/lib/side-bar/side-bar.component.spec.ts +0 -21
  120. package/src/lib/side-bar/side-bar.component.ts +0 -33
  121. package/src/lib/side-bar-dynamic/data-injector.pipe.ts +0 -15
  122. package/src/lib/side-bar-dynamic/dynamic-sidebar.service.ts +0 -116
  123. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.html +0 -42
  124. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.scss +0 -5
  125. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.spec.ts +0 -21
  126. package/src/lib/side-bar-dynamic/side-bar-dynamic.component.ts +0 -37
  127. package/src/lib/side-bar-dynamic/side-bar-utils.ts +0 -30
  128. package/src/lib/side-bar-dynamic/sidebar-config.ts +0 -48
  129. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.html +0 -20
  130. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.scss +0 -0
  131. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.spec.ts +0 -21
  132. package/src/lib/user-autocomplete-card/user-autocomplete-card.component.ts +0 -21
  133. package/src/lib/user-info/user-info.component.html +0 -10
  134. package/src/lib/user-info/user-info.component.ts +0 -11
  135. package/src/public-api.ts +0 -26
  136. package/tsconfig.lib.json +0 -18
  137. package/tsconfig.lib.prod.json +0 -11
  138. package/tsconfig.spec.json +0 -14
@@ -0,0 +1,1988 @@
1
+ import * as i0 from '@angular/core';
2
+ import { ViewEncapsulation, Component, Input, ChangeDetectionStrategy, model, inject, Pipe, EventEmitter, Output, Injectable, HostListener, ViewChild, InjectionToken, Injector, createComponent, ViewContainerRef, ApplicationRef, EnvironmentInjector } 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, 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, FormsModule, FormControl } 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 * as i2$2 from 'primeng/selectbutton';
35
+ import { SelectButtonModule } from 'primeng/selectbutton';
36
+ import * as i2$3 from 'primeng/multiselect';
37
+ import { MultiSelectModule } from 'primeng/multiselect';
38
+ import { Select } from 'primeng/select';
39
+ import * as i1$5 from 'primeng/toggleswitch';
40
+ import { ToggleSwitchModule } from 'primeng/toggleswitch';
41
+ import * as i1$6 from '@ng-bootstrap/ng-bootstrap';
42
+ import { NgbDatepickerI18n, NgbCalendarIslamicUmalqura, NgbDatepickerModule, NgbCalendar, NgbCalendarGregorian } from '@ng-bootstrap/ng-bootstrap';
43
+ import moment from 'moment-hijri';
44
+ import { trigger, state, transition, style, animate } from '@angular/animations';
45
+ import '@angular/localize/init';
46
+ import * as i2$4 from 'primeng/accordion';
47
+ import { AccordionModule } from 'primeng/accordion';
48
+ import { DividerModule } from 'primeng/divider';
49
+ import { Breadcrumb } from 'primeng/breadcrumb';
50
+ import { filter as filter$1, map } from 'rxjs/operators';
51
+
52
+ class AppButtonComponent extends Button {
53
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
54
+ 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 });
55
+ }
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppButtonComponent, decorators: [{
57
+ type: Component,
58
+ 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>" }]
59
+ }] });
60
+
61
+ class IcoMoonIconComponent {
62
+ iconName;
63
+ iconClass;
64
+ iconPathCount = 0;
65
+ get getPathCount() {
66
+ return Array.from({ length: this.iconPathCount }, (_, i) => i + 1);
67
+ }
68
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IcoMoonIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
69
+ 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: `
70
+ <i [class]="iconName + ' ' + iconClass">
71
+ @for (path of getPathCount; track $index) {
72
+ <i [class]="iconName + ' path'+path"></i>
73
+ }
74
+ </i>
75
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
76
+ }
77
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IcoMoonIconComponent, decorators: [{
78
+ type: Component,
79
+ args: [{
80
+ selector: 'app-ico-moon-card',
81
+ standalone: true,
82
+ template: `
83
+ <i [class]="iconName + ' ' + iconClass">
84
+ @for (path of getPathCount; track $index) {
85
+ <i [class]="iconName + ' path'+path"></i>
86
+ }
87
+ </i>
88
+ `,
89
+ changeDetection: ChangeDetectionStrategy.OnPush
90
+ }]
91
+ }], propDecorators: { iconName: [{
92
+ type: Input,
93
+ args: [{ required: true }]
94
+ }], iconClass: [{
95
+ type: Input
96
+ }], iconPathCount: [{
97
+ type: Input
98
+ }] } });
99
+
100
+ class AppTabsComponent {
101
+ tabs;
102
+ tabsStyle = 'basic';
103
+ responsive = false;
104
+ twoDigitCount;
105
+ selectedTabIndex = model(0, ...(ngDevMode ? [{ debugName: "selectedTabIndex" }] : []));
106
+ activeTabIndex = 0;
107
+ router = inject(Router);
108
+ route = inject(ActivatedRoute);
109
+ ngOnInit() {
110
+ this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe(() => {
111
+ this.updateActiveTab();
112
+ });
113
+ // to be refactor
114
+ this.updateActiveTab();
115
+ }
116
+ // Updates the active tab index based on the current route
117
+ updateActiveTab() {
118
+ if (!this.tabs.isRouted)
119
+ return;
120
+ const currentUrl = this.router.url;
121
+ const matchingTabIndex = this.tabs.items.findIndex((tab) => currentUrl.includes(tab.link));
122
+ this.activeTabIndex = matchingTabIndex !== -1 ? matchingTabIndex : 0;
123
+ }
124
+ onTabChange(index) {
125
+ this.selectedTabIndex.set(index);
126
+ if (!this.tabs.isRouted)
127
+ return;
128
+ const selectedTab = this.tabs.items[index];
129
+ if (selectedTab && !selectedTab.disabled) {
130
+ this.router.navigate([selectedTab.link], { relativeTo: this.route });
131
+ }
132
+ }
133
+ getTabCount(count) {
134
+ if (!count)
135
+ return '0';
136
+ return this.twoDigitCount && count > 99 ? '99+' : count.toString();
137
+ }
138
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
139
+ 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 });
140
+ }
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppTabsComponent, decorators: [{
142
+ type: Component,
143
+ args: [{ selector: 'app-tabs', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
144
+ CommonModule,
145
+ TabsModule,
146
+ RouterLink,
147
+ RouterOutlet,
148
+ IcoMoonIconComponent,
149
+ TranslateModule,
150
+ BadgeModule,
151
+ ], 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"] }]
152
+ }], propDecorators: { tabs: [{
153
+ type: Input
154
+ }], tabsStyle: [{
155
+ type: Input
156
+ }], responsive: [{
157
+ type: Input
158
+ }], twoDigitCount: [{
159
+ type: Input
160
+ }], selectedTabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedTabIndex", required: false }] }, { type: i0.Output, args: ["selectedTabIndexChange"] }] } });
161
+
162
+ class MenuPopupTextColorPipe {
163
+ transform(color) {
164
+ switch (color) {
165
+ case 'white': return 'text-white';
166
+ case 'purple': return 'text-purple-500';
167
+ case 'green': return 'text-green-500';
168
+ default: return 'text-white';
169
+ }
170
+ }
171
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MenuPopupTextColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
172
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: MenuPopupTextColorPipe, isStandalone: true, name: "popupTextColorClass" });
173
+ }
174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MenuPopupTextColorPipe, decorators: [{
175
+ type: Pipe,
176
+ args: [{
177
+ name: 'popupTextColorClass',
178
+ standalone: true,
179
+ pure: true
180
+ }]
181
+ }] });
182
+
183
+ class AppDropdownMenuComponent {
184
+ buttonTitle;
185
+ menuItems = [];
186
+ popupMenuStyle = "purple";
187
+ buttonIcon = "font-icon-plus";
188
+ buttonClass;
189
+ buttonStyle;
190
+ buttonIconPosition = "left";
191
+ router = inject(Router);
192
+ showMenu;
193
+ ngOnInit() {
194
+ this.showMenu = this.menuItems.some((item) => {
195
+ return item.show;
196
+ });
197
+ }
198
+ onMenuItemClick(item) {
199
+ if (item.callback) {
200
+ item.callback();
201
+ }
202
+ else if (item.routerLink) {
203
+ this.router.navigate(Array.isArray(item.routerLink) ? item.routerLink : [item.routerLink], { queryParams: item.queryParams || {} });
204
+ }
205
+ }
206
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppDropdownMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
207
+ 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", buttonIconPosition: "buttonIconPosition" }, ngImport: i0, template: "@if (showMenu) {\r\n<app-button (click)=\"op.toggle($event)\" [class]=\"buttonClass\" [iconPos]=\"buttonIconPosition\" [icon]=\"buttonIcon\"\r\n [title]=\"buttonTitle\" [styleClass]=\"buttonStyle\" />\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-3 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.p-component{box-shadow:none;border-radius:3px;margin-top:13px}.p-popover.p-component:is(.purple-menu){@apply bg-primary text-white text-sm mt-2;}.p-popover.p-component:is(.purple-menu) li:not(:last-child){@apply border-b-2 border-purple-700;}.p-popover.p-component:is(.white-menu) li:not(:last-child){@apply border-b;}.p-popover.p-component:before,.p-popover.p-component:after{display:none}.p-popover.p-component .p-popover-content{width:auto;min-width:unset}.p-popover.p-component .p-popover-content ul li{@apply py-3;}.p-popover.p-component .p-popover-content ul li:hover{opacity:.7}.p-popover.p-component .p-popover-content ul li:first-child{@apply pt-0;}.p-popover.p-component .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 });
208
+ }
209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppDropdownMenuComponent, decorators: [{
210
+ type: Component,
211
+ 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 [title]=\"buttonTitle\" [styleClass]=\"buttonStyle\" />\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-3 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.p-component{box-shadow:none;border-radius:3px;margin-top:13px}.p-popover.p-component:is(.purple-menu){@apply bg-primary text-white text-sm mt-2;}.p-popover.p-component:is(.purple-menu) li:not(:last-child){@apply border-b-2 border-purple-700;}.p-popover.p-component:is(.white-menu) li:not(:last-child){@apply border-b;}.p-popover.p-component:before,.p-popover.p-component:after{display:none}.p-popover.p-component .p-popover-content{width:auto;min-width:unset}.p-popover.p-component .p-popover-content ul li{@apply py-3;}.p-popover.p-component .p-popover-content ul li:hover{opacity:.7}.p-popover.p-component .p-popover-content ul li:first-child{@apply pt-0;}.p-popover.p-component .p-popover-content ul li:last-child{@apply pb-0;}\n"] }]
212
+ }], propDecorators: { buttonTitle: [{
213
+ type: Input,
214
+ args: [{ required: true }]
215
+ }], menuItems: [{
216
+ type: Input,
217
+ args: [{ required: true }]
218
+ }], popupMenuStyle: [{
219
+ type: Input
220
+ }], buttonIcon: [{
221
+ type: Input
222
+ }], buttonClass: [{
223
+ type: Input
224
+ }], buttonStyle: [{
225
+ type: Input
226
+ }], buttonIconPosition: [{
227
+ type: Input
228
+ }] } });
229
+
230
+ class SideBarComponent {
231
+ show = false;
232
+ title;
233
+ closable = true;
234
+ dismissible = false;
235
+ closeOnEscape = false;
236
+ sidebarSize = "sm";
237
+ styleClass = "";
238
+ hide = new EventEmitter();
239
+ onShow = new EventEmitter();
240
+ contentTemplate;
241
+ footerTemplate;
242
+ position = 'left';
243
+ hideSidebar() {
244
+ this.show = false;
245
+ this.hide.emit(false);
246
+ }
247
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SideBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
248
+ 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 });
249
+ }
250
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SideBarComponent, decorators: [{
251
+ type: Component,
252
+ 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"] }]
253
+ }], propDecorators: { show: [{
254
+ type: Input
255
+ }], title: [{
256
+ type: Input
257
+ }], closable: [{
258
+ type: Input
259
+ }], dismissible: [{
260
+ type: Input
261
+ }], closeOnEscape: [{
262
+ type: Input
263
+ }], sidebarSize: [{
264
+ type: Input
265
+ }], styleClass: [{
266
+ type: Input
267
+ }], hide: [{
268
+ type: Output
269
+ }], onShow: [{
270
+ type: Output
271
+ }], contentTemplate: [{
272
+ type: Input
273
+ }], footerTemplate: [{
274
+ type: Input
275
+ }], position: [{
276
+ type: Input
277
+ }] } });
278
+
279
+ class UserInfoComponent {
280
+ profileImage;
281
+ name;
282
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
283
+ 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" });
284
+ }
285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserInfoComponent, decorators: [{
286
+ type: Component,
287
+ 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" }]
288
+ }], propDecorators: { profileImage: [{
289
+ type: Input
290
+ }], name: [{
291
+ type: Input
292
+ }] } });
293
+
294
+ class FormUtils {
295
+ static getFormControl(controlName, form) {
296
+ if (!form)
297
+ throw new Error(`Form is not initialized.`);
298
+ const formControl = form.get(controlName);
299
+ if (!formControl)
300
+ throw new Error(`There's no form control with given name. '${controlName}'`);
301
+ return formControl;
302
+ }
303
+ }
304
+
305
+ var BasicErrorKeysEnum;
306
+ (function (BasicErrorKeysEnum) {
307
+ BasicErrorKeysEnum["required"] = "REQUIRED";
308
+ BasicErrorKeysEnum["email"] = "EMAIL";
309
+ BasicErrorKeysEnum["pattern"] = "PATTERN";
310
+ BasicErrorKeysEnum["invalidArFormat"] = "INVALID_AR_FORMAT";
311
+ BasicErrorKeysEnum["invalidLink"] = "INVALID_LINK";
312
+ BasicErrorKeysEnum["endDateBeforeStartDate"] = "END_DATE_BEFORE_START_DATE";
313
+ BasicErrorKeysEnum["startDateEqualsEndDate"] = "START_DATE_EQUALS_END_DATE";
314
+ BasicErrorKeysEnum["endTimeBeforeStartTime"] = "END_TIME_BEFORE_START_TIME";
315
+ BasicErrorKeysEnum["startTimeEqualsEndTime"] = "START_TIME_EQUALS_END_TIME";
316
+ BasicErrorKeysEnum["integer"] = "INTEGER";
317
+ BasicErrorKeysEnum["positiveNumber"] = "POSITIVE_NUMBER";
318
+ BasicErrorKeysEnum["fileSelected"] = "FILE_SELECTED";
319
+ BasicErrorKeysEnum["default"] = "DEFAULT";
320
+ })(BasicErrorKeysEnum || (BasicErrorKeysEnum = {}));
321
+ var ErrorsWithValuesKeysEnum;
322
+ (function (ErrorsWithValuesKeysEnum) {
323
+ ErrorsWithValuesKeysEnum["minlength"] = "MIN_LENGTH";
324
+ ErrorsWithValuesKeysEnum["maxlength"] = "MAX_LENGTH";
325
+ ErrorsWithValuesKeysEnum["min"] = "MIN";
326
+ ErrorsWithValuesKeysEnum["max"] = "MAX";
327
+ ErrorsWithValuesKeysEnum["maxSize"] = "MAX_SIZE";
328
+ ErrorsWithValuesKeysEnum["maxFiles"] = "MAX_FILES";
329
+ ErrorsWithValuesKeysEnum["allowedTypes"] = "ALLOWED_TYPES";
330
+ })(ErrorsWithValuesKeysEnum || (ErrorsWithValuesKeysEnum = {}));
331
+
332
+ class FormValidationService {
333
+ translate = inject(TranslateService);
334
+ getTranslation(key, interpolateParams) {
335
+ return this.translate.instant(`VALIDATION.${key}`, interpolateParams);
336
+ }
337
+ getErrorMessage(errorKey, errorValue) {
338
+ if (this.isBasicErrorKey(errorKey)) {
339
+ return this.getTranslation(BasicErrorKeysEnum[errorKey]);
340
+ }
341
+ if (this.isErrorWithValueKey(errorKey)) {
342
+ return this.getErrorWithValueMessage(errorKey, errorValue);
343
+ }
344
+ return this.getTranslation(BasicErrorKeysEnum.default);
345
+ }
346
+ // Basic error keys are the keys that don't have any values to interpolate. like required, email, etc.
347
+ isBasicErrorKey(key) {
348
+ return Object.keys(BasicErrorKeysEnum).includes(key);
349
+ }
350
+ // Error keys with values are the keys that have values to interpolate. like minlength, maxlength, etc.
351
+ isErrorWithValueKey(key) {
352
+ return Object.keys(ErrorsWithValuesKeysEnum).includes(key);
353
+ }
354
+ getErrorWithValueMessage(errorKey, errorValue) {
355
+ const messages = {
356
+ minlength: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.minlength, {
357
+ requiredLength: val?.requiredLength,
358
+ actualLength: val?.actualLength,
359
+ }),
360
+ maxlength: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.maxlength, {
361
+ requiredLength: val?.requiredLength,
362
+ actualLength: val?.actualLength,
363
+ }),
364
+ min: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.min, { min: val?.min }),
365
+ max: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.max, { max: val?.max }),
366
+ maxSize: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.maxSize, { size: val?.requiredLength }),
367
+ maxFiles: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.maxFiles, { size: val?.requiredLength }),
368
+ allowedTypes: (val) => this.getTranslation(ErrorsWithValuesKeysEnum.allowedTypes, { types: val?.join(', ') }),
369
+ };
370
+ return messages[errorKey](errorValue);
371
+ }
372
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FormValidationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
373
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FormValidationService, providedIn: 'root' });
374
+ }
375
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FormValidationService, decorators: [{
376
+ type: Injectable,
377
+ args: [{
378
+ providedIn: 'root',
379
+ }]
380
+ }] });
381
+
382
+ class ValidationErrorsPipe {
383
+ formValidationService = inject(FormValidationService);
384
+ // allowed keys here to handle errors in case of cross-validators like startDate and endDate validators,
385
+ // we pass this custom key to handle the error messages only for the allowed keys
386
+ transform(errors, allowedKeys) {
387
+ if (!errors)
388
+ return [];
389
+ return Object.keys(errors)
390
+ .filter((errorKey) => !allowedKeys || allowedKeys.includes(errorKey)) // Filter errors if allowedKeys are provided
391
+ .map((errorKey) => {
392
+ return this.formValidationService.getErrorMessage(errorKey, errors[errorKey]);
393
+ });
394
+ }
395
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ValidationErrorsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
396
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: ValidationErrorsPipe, isStandalone: true, name: "validationErrors" });
397
+ }
398
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ValidationErrorsPipe, decorators: [{
399
+ type: Pipe,
400
+ args: [{
401
+ name: "validationErrors",
402
+ standalone: true,
403
+ pure: true
404
+ }]
405
+ }] });
406
+
407
+ class BaseInputComponent {
408
+ control;
409
+ name = '';
410
+ label;
411
+ placeholder = '';
412
+ inputId;
413
+ readonly = false;
414
+ disabled = false;
415
+ hint;
416
+ destroy$ = new Subject();
417
+ get required() {
418
+ return this.control.hasValidator(Validators.required);
419
+ }
420
+ get isInvalid() {
421
+ return this.control.invalid && this.control.touched;
422
+ }
423
+ ngOnInit() {
424
+ }
425
+ ngOnDestroy() {
426
+ this.destroy$.next();
427
+ this.destroy$.complete();
428
+ }
429
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BaseInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
430
+ 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 });
431
+ }
432
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BaseInputComponent, decorators: [{
433
+ type: Component,
434
+ args: [{
435
+ template: '',
436
+ }]
437
+ }], propDecorators: { control: [{
438
+ type: Input,
439
+ args: [{ required: true }]
440
+ }], name: [{
441
+ type: Input
442
+ }], label: [{
443
+ type: Input
444
+ }], placeholder: [{
445
+ type: Input
446
+ }], inputId: [{
447
+ type: Input
448
+ }], readonly: [{
449
+ type: Input
450
+ }], disabled: [{
451
+ type: Input
452
+ }], hint: [{
453
+ type: Input
454
+ }] } });
455
+
456
+ class AutoCompleteComponent extends BaseInputComponent {
457
+ selectedItemTemplate = null;
458
+ // eslint-disable-next-line @angular-eslint/no-output-on-prefix
459
+ onSearch = new EventEmitter();
460
+ selectOption = new EventEmitter();
461
+ items = [];
462
+ minLengthToSearch = 3;
463
+ delay = 300; // default value
464
+ basicInput;
465
+ typeAhead = false;
466
+ variant = 'over';
467
+ constructor() {
468
+ super();
469
+ }
470
+ search(event) {
471
+ this.onSearch.emit(event.query);
472
+ }
473
+ onSelect(event) {
474
+ this.selectOption.emit(event);
475
+ }
476
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AutoCompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
477
+ 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\">\r\n <p-auto-complete (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>", styles: [".text-required{color:red}.p-error{color:#dc2626}\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" }] });
478
+ }
479
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AutoCompleteComponent, decorators: [{
480
+ type: Component,
481
+ args: [{ selector: 'stc-auto-complete', standalone: true, imports: [
482
+ ReactiveFormsModule,
483
+ AutoComplete,
484
+ PrimeTemplate,
485
+ NgIf,
486
+ NgTemplateOutlet,
487
+ NgClass,
488
+ JsonPipe,
489
+ ValidationErrorsPipe,
490
+ TranslatePipe,
491
+ FloatLabel,
492
+ ], 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\">\r\n <p-auto-complete (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>", styles: [".text-required{color:red}.p-error{color:#dc2626}\n"] }]
493
+ }], ctorParameters: () => [], propDecorators: { selectedItemTemplate: [{
494
+ type: Input
495
+ }], onSearch: [{
496
+ type: Output
497
+ }], selectOption: [{
498
+ type: Output
499
+ }], items: [{
500
+ type: Input
501
+ }], minLengthToSearch: [{
502
+ type: Input
503
+ }], delay: [{
504
+ type: Input
505
+ }], basicInput: [{
506
+ type: Input
507
+ }], typeAhead: [{
508
+ type: Input
509
+ }], variant: [{
510
+ type: Input
511
+ }] } });
512
+
513
+ class DatePickerComponent extends BaseInputComponent {
514
+ showIcon = false;
515
+ showClear = false;
516
+ basicInput;
517
+ isTimeOnly = false;
518
+ minDate;
519
+ maxDate;
520
+ hourFormat = '12';
521
+ nowTime = new Date();
522
+ selectionMode = 'single';
523
+ onAfterClearDate = new EventEmitter();
524
+ variant = 'over';
525
+ constructor() {
526
+ super();
527
+ }
528
+ selectCurrentTime(e) {
529
+ this.control.setValue(this.nowTime);
530
+ }
531
+ clearButtonClick(e) {
532
+ this.control.setValue(null);
533
+ }
534
+ afterClearDate() {
535
+ this.control.reset();
536
+ this.onAfterClearDate.emit();
537
+ }
538
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
539
+ 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" }, outputs: { onAfterClearDate: "onAfterClearDate" }, usesInheritance: true, ngImport: i0, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n\r\n <p-floatlabel [variant]=\"variant\">\r\n <p-datepicker [selectionMode]=\"selectionMode\" [disabled]=\"disabled\" [formControl]=\"control\" [iconDisplay]=\"'input'\"\r\n [showClear]=\"showClear\" (onClear)=\"afterClearDate()\" [inputId]=\"inputId\"\r\n [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-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;}.d-ltr{direction:ltr}.text-required{color:red}.p-error{color:#dc2626}\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 });
540
+ }
541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DatePickerComponent, decorators: [{
542
+ type: Component,
543
+ args: [{ selector: 'stc-date-picker', standalone: true, imports: [
544
+ FormsModule,
545
+ DatePicker,
546
+ ReactiveFormsModule,
547
+ NgClass,
548
+ DatePickerModule,
549
+ ValidationErrorsPipe,
550
+ FloatLabelModule,
551
+ ], encapsulation: ViewEncapsulation.None, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n\r\n <p-floatlabel [variant]=\"variant\">\r\n <p-datepicker [selectionMode]=\"selectionMode\" [disabled]=\"disabled\" [formControl]=\"control\" [iconDisplay]=\"'input'\"\r\n [showClear]=\"showClear\" (onClear)=\"afterClearDate()\" [inputId]=\"inputId\"\r\n [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-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;}.d-ltr{direction:ltr}.text-required{color:red}.p-error{color:#dc2626}\n"] }]
552
+ }], ctorParameters: () => [], propDecorators: { showIcon: [{
553
+ type: Input
554
+ }], showClear: [{
555
+ type: Input
556
+ }], basicInput: [{
557
+ type: Input
558
+ }], isTimeOnly: [{
559
+ type: Input
560
+ }], minDate: [{
561
+ type: Input
562
+ }], maxDate: [{
563
+ type: Input
564
+ }], hourFormat: [{
565
+ type: Input
566
+ }], selectionMode: [{
567
+ type: Input
568
+ }], onAfterClearDate: [{
569
+ type: Output
570
+ }], variant: [{
571
+ type: Input
572
+ }] } });
573
+
574
+ class InputComponent extends BaseInputComponent {
575
+ type = 'text';
576
+ contentType = 'text';
577
+ size = "small";
578
+ prefix;
579
+ rows = 2;
580
+ cols = 20;
581
+ autoResize = true;
582
+ basicInput;
583
+ noStyle;
584
+ hideOptionalLabel;
585
+ inputDirection = 'inherit';
586
+ variant = 'over';
587
+ defaultColor = '#DFE0E6';
588
+ constructor() {
589
+ super();
590
+ }
591
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
592
+ 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", hideOptionalLabel: "hideOptionalLabel", inputDirection: "inputDirection", variant: "variant", defaultColor: "defaultColor" }, usesInheritance: true, ngImport: i0, template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n\r\n @if (!required && !hideOptionalLabel) {\r\n <span class=\"absolute top-[6px] left-0 text-[10px] text-gray-400\">{{'forms.config.optional' | translate}}</span>\r\n }\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 <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 <ng-content></ng-content>\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 @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}\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: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
593
+ }
594
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: InputComponent, decorators: [{
595
+ type: Component,
596
+ args: [{ selector: 'stc-input', standalone: true, imports: [
597
+ ReactiveFormsModule,
598
+ InputText,
599
+ Textarea,
600
+ ValidationErrorsPipe,
601
+ NgClass,
602
+ NgStyle,
603
+ TranslatePipe,
604
+ FloatLabelModule,
605
+ ], template: "<div class=\"field flex flex-col gap-2 my-3 relative\">\r\n\r\n @if (!required && !hideOptionalLabel) {\r\n <span class=\"absolute top-[6px] left-0 text-[10px] text-gray-400\">{{'forms.config.optional' | translate}}</span>\r\n }\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 <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 <ng-content></ng-content>\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 @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}\n"] }]
606
+ }], ctorParameters: () => [], propDecorators: { type: [{
607
+ type: Input
608
+ }], contentType: [{
609
+ type: Input
610
+ }], size: [{
611
+ type: Input
612
+ }], prefix: [{
613
+ type: Input
614
+ }], rows: [{
615
+ type: Input
616
+ }], cols: [{
617
+ type: Input
618
+ }], autoResize: [{
619
+ type: Input
620
+ }], basicInput: [{
621
+ type: Input
622
+ }], noStyle: [{
623
+ type: Input
624
+ }], hideOptionalLabel: [{
625
+ type: Input
626
+ }], inputDirection: [{
627
+ type: Input
628
+ }], variant: [{
629
+ type: Input
630
+ }], defaultColor: [{
631
+ type: Input
632
+ }] } });
633
+
634
+ class SelectButtonComponent extends BaseInputComponent {
635
+ onChange = new EventEmitter();
636
+ options;
637
+ title;
638
+ changeValue(e) {
639
+ this.onChange.emit(e.value);
640
+ }
641
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SelectButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
642
+ 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 }] });
643
+ }
644
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SelectButtonComponent, decorators: [{
645
+ type: Component,
646
+ 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" }]
647
+ }], propDecorators: { onChange: [{
648
+ type: Output
649
+ }], options: [{
650
+ type: Input
651
+ }], title: [{
652
+ type: Input
653
+ }] } });
654
+
655
+ class SelectComponent extends BaseInputComponent {
656
+ selectedItemTemplate = null;
657
+ optionTemplate = null;
658
+ options;
659
+ optionLabel;
660
+ checkmark = true;
661
+ showClear = false;
662
+ editable = false;
663
+ filter = false;
664
+ multiple = false;
665
+ filterBy;
666
+ size = "small";
667
+ selectedItemsLabel;
668
+ basicInput;
669
+ variant = 'over';
670
+ // eslint-disable-next-line @angular-eslint/no-output-native
671
+ change = new EventEmitter();
672
+ defaultColor = '#DFE0E6';
673
+ constructor() {
674
+ super();
675
+ }
676
+ onChange(e) {
677
+ this.change.emit(e);
678
+ }
679
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
680
+ 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", checkmark: "checkmark", showClear: "showClear", editable: "editable", filter: "filter", multiple: "multiple", filterBy: "filterBy", 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 [options]=\"options\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [showClear]=\"showClear\"\r\n class=\"w-full\"\r\n [size]=\"size\"\r\n [selectedItemsLabel]=\"selectedItemsLabel\"\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\r\n\r\n\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 <ng-template #dropdownicon>\r\n <i class=\"pi pi-map\"></i>\r\n </ng-template>\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 [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 [optionLabel]=\"optionLabel\"\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}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { 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: "pipe", type: ValidationErrorsPipe, name: "validationErrors" }], encapsulation: i0.ViewEncapsulation.None });
681
+ }
682
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SelectComponent, decorators: [{
683
+ type: Component,
684
+ args: [{ selector: 'stc-select', standalone: true, imports: [
685
+ FormsModule,
686
+ Select,
687
+ ReactiveFormsModule,
688
+ NgClass,
689
+ NgTemplateOutlet,
690
+ PrimeTemplate,
691
+ ValidationErrorsPipe,
692
+ MultiSelectModule,
693
+ FloatLabelModule,
694
+ ], 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 [options]=\"options\"\r\n [placeholder]=\"placeholder\"\r\n [readonly]=\"readonly\"\r\n [showClear]=\"showClear\"\r\n class=\"w-full\"\r\n [size]=\"size\"\r\n [selectedItemsLabel]=\"selectedItemsLabel\"\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\r\n\r\n\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 <ng-template #dropdownicon>\r\n <i class=\"pi pi-map\"></i>\r\n </ng-template>\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 [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 [optionLabel]=\"optionLabel\"\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}\n"] }]
695
+ }], ctorParameters: () => [], propDecorators: { selectedItemTemplate: [{
696
+ type: Input
697
+ }], optionTemplate: [{
698
+ type: Input
699
+ }], options: [{
700
+ type: Input
701
+ }], optionLabel: [{
702
+ type: Input
703
+ }], checkmark: [{
704
+ type: Input
705
+ }], showClear: [{
706
+ type: Input
707
+ }], editable: [{
708
+ type: Input
709
+ }], filter: [{
710
+ type: Input
711
+ }], multiple: [{
712
+ type: Input
713
+ }], filterBy: [{
714
+ type: Input
715
+ }], size: [{
716
+ type: Input
717
+ }], selectedItemsLabel: [{
718
+ type: Input
719
+ }], basicInput: [{
720
+ type: Input
721
+ }], variant: [{
722
+ type: Input
723
+ }], change: [{
724
+ type: Output
725
+ }], defaultColor: [{
726
+ type: Input
727
+ }] } });
728
+
729
+ class SwitchComponent {
730
+ label;
731
+ key;
732
+ checked = false;
733
+ onChange = new EventEmitter();
734
+ // checked: boolean = false;
735
+ sendUpdatedValue(value) {
736
+ if (value) {
737
+ this.onChange.emit(value.checked);
738
+ }
739
+ }
740
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
741
+ 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"] }] });
742
+ }
743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SwitchComponent, decorators: [{
744
+ type: Component,
745
+ 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>" }]
746
+ }], propDecorators: { label: [{
747
+ type: Input
748
+ }], key: [{
749
+ type: Input
750
+ }], checked: [{
751
+ type: Input
752
+ }], onChange: [{
753
+ type: Output
754
+ }] } });
755
+
756
+ var FormFieldTypeEnum;
757
+ (function (FormFieldTypeEnum) {
758
+ FormFieldTypeEnum["DATE_PICKER"] = "date-picker";
759
+ FormFieldTypeEnum["SELECT_BUTTON"] = "select-button";
760
+ FormFieldTypeEnum["INPUT"] = "input";
761
+ FormFieldTypeEnum["SELECT"] = "select";
762
+ FormFieldTypeEnum["SWITCH"] = "switch";
763
+ FormFieldTypeEnum["AUTO_COMPLETE"] = "auto-complete";
764
+ FormFieldTypeEnum["HIJRI_DATE_PICKER"] = "hijri-date";
765
+ })(FormFieldTypeEnum || (FormFieldTypeEnum = {}));
766
+
767
+ const WEEKDAYS = {
768
+ ar: ['ن', 'ث', 'ر', 'خ', 'ج', 'س', 'ح'],
769
+ en: ['M', 'T', 'W', 'T', 'F', 'S', 'S']
770
+ };
771
+ const MONTHS_GREGORIAN = {
772
+ ar: [
773
+ 'يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو',
774
+ 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'
775
+ ],
776
+ en: [
777
+ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
778
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
779
+ ]
780
+ };
781
+ const MONTHS_HIJRI = {
782
+ ar: [
783
+ 'محرم',
784
+ 'صفر',
785
+ 'ربيع الأول',
786
+ 'ربيع الآخر',
787
+ 'جمادى الأولى',
788
+ 'جمادى الآخرة',
789
+ 'رجب',
790
+ 'شعبان',
791
+ 'رمضان',
792
+ 'شوال',
793
+ 'ذو القعدة',
794
+ 'ذو الحجة'
795
+ ],
796
+ en: [
797
+ 'Muharram',
798
+ 'Safar',
799
+ 'Rabi Al-Awwal',
800
+ 'Rabi Al-Thani',
801
+ 'Jumada Al-Awwal',
802
+ 'Jumada Al-Thani',
803
+ 'Rajab',
804
+ 'Shaaban',
805
+ 'Ramadan',
806
+ 'Shawwal',
807
+ 'Dhul-Qi’dah',
808
+ 'Dhul-Hijjah'
809
+ ]
810
+ };
811
+ function getGregorianMonthName(lang, month) {
812
+ return MONTHS_GREGORIAN[lang][month - 1] || '';
813
+ }
814
+ function getHijriMonthName(lang, month) {
815
+ return MONTHS_HIJRI[lang][month - 1] || '';
816
+ }
817
+ function getWeekdayName(lang, weekday) {
818
+ return WEEKDAYS[lang][weekday - 1];
819
+ }
820
+
821
+ class IslamicI18n extends NgbDatepickerI18n {
822
+ getMonthShortName(month) {
823
+ return MONTHS_HIJRI.ar[month - 1];
824
+ }
825
+ getMonthFullName(month) {
826
+ return MONTHS_HIJRI.ar[month - 1];
827
+ }
828
+ getWeekdayLabel(weekday) {
829
+ return WEEKDAYS.ar[weekday - 1];
830
+ }
831
+ getWeekdayShortName(weekday) {
832
+ return WEEKDAYS.ar[weekday - 1];
833
+ }
834
+ getDayAriaLabel(date) {
835
+ return `${date.day}-${date.month}-${date.year}`;
836
+ }
837
+ getYearNumerals(year) {
838
+ return String(year);
839
+ }
840
+ getWeekNumerals(weekNumber) {
841
+ return String(weekNumber);
842
+ }
843
+ getDayNumerals(date) {
844
+ return String(date.day);
845
+ }
846
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IslamicI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
847
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IslamicI18n });
848
+ }
849
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: IslamicI18n, decorators: [{
850
+ type: Injectable
851
+ }] });
852
+ class HijriEnglishI18n extends NgbDatepickerI18n {
853
+ getMonthShortName(month) {
854
+ return MONTHS_HIJRI.en[month - 1].substring(0, 3);
855
+ }
856
+ getMonthFullName(month) {
857
+ return MONTHS_HIJRI.en[month - 1];
858
+ }
859
+ getWeekdayLabel(weekday) {
860
+ return WEEKDAYS.en[weekday - 1];
861
+ }
862
+ getWeekdayShortName(weekday) {
863
+ return WEEKDAYS.en[weekday - 1];
864
+ }
865
+ getDayAriaLabel(date) {
866
+ return `${date.day}-${date.month}-${date.year}`;
867
+ }
868
+ getYearNumerals(year) {
869
+ return String(year);
870
+ }
871
+ getWeekNumerals(weekNumber) {
872
+ return String(weekNumber);
873
+ }
874
+ getDayNumerals(date) {
875
+ return String(date.day);
876
+ }
877
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HijriEnglishI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
878
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HijriEnglishI18n });
879
+ }
880
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HijriEnglishI18n, decorators: [{
881
+ type: Injectable
882
+ }] });
883
+ class DynamicHijriI18n extends NgbDatepickerI18n {
884
+ currentLang = 'ar';
885
+ arabicI18n = new IslamicI18n();
886
+ englishI18n = new HijriEnglishI18n();
887
+ setLanguage(lang) {
888
+ this.currentLang = lang;
889
+ }
890
+ get activeI18n() {
891
+ return this.currentLang === 'ar' ? this.arabicI18n : this.englishI18n;
892
+ }
893
+ getMonthShortName(month) {
894
+ return this.activeI18n.getMonthShortName(month);
895
+ }
896
+ getMonthFullName(month) {
897
+ return this.activeI18n.getMonthFullName(month);
898
+ }
899
+ getWeekdayLabel(weekday) {
900
+ return this.activeI18n.getWeekdayLabel(weekday);
901
+ }
902
+ getWeekdayShortName(weekday) {
903
+ return this.activeI18n.getWeekdayShortName(weekday);
904
+ }
905
+ getDayAriaLabel(date) {
906
+ return this.activeI18n.getDayAriaLabel(date);
907
+ }
908
+ getYearNumerals(year) {
909
+ return this.activeI18n.getYearNumerals(year);
910
+ }
911
+ getWeekNumerals(weekNumber) {
912
+ return this.activeI18n.getWeekNumerals(weekNumber);
913
+ }
914
+ getDayNumerals(date) {
915
+ return this.activeI18n.getDayNumerals(date);
916
+ }
917
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicHijriI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
918
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicHijriI18n });
919
+ }
920
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicHijriI18n, decorators: [{
921
+ type: Injectable
922
+ }] });
923
+
924
+ class HijriCalendarComponent {
925
+ i18n;
926
+ cdr;
927
+ model;
928
+ dateSelected = new EventEmitter();
929
+ language = 'en';
930
+ startDate;
931
+ calendar = new NgbCalendarIslamicUmalqura();
932
+ constructor(i18n, cdr) {
933
+ this.i18n = i18n;
934
+ this.cdr = cdr;
935
+ }
936
+ ngOnChanges(changes) {
937
+ if (changes['model'] && changes['model'].currentValue) {
938
+ this.startDate = { ...changes['model'].currentValue };
939
+ console.log('Hijri navigating to:', this.startDate);
940
+ }
941
+ if (changes['language'] && this.i18n instanceof DynamicHijriI18n) {
942
+ this.i18n.setLanguage(this.language);
943
+ this.cdr.detectChanges(); // Force re-render to update labels
944
+ }
945
+ }
946
+ onDateChange(date) {
947
+ this.model = date;
948
+ this.startDate = { ...date };
949
+ }
950
+ isToday(date) {
951
+ const today = this.calendar.getToday();
952
+ return date.year === today.year &&
953
+ date.month === today.month &&
954
+ date.day === today.day;
955
+ }
956
+ isDisabled = () => false;
957
+ 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 });
958
+ 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: [
959
+ { provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura },
960
+ { provide: NgbDatepickerI18n, useClass: DynamicHijriI18n }
961
+ ], 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"] }] });
962
+ }
963
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: HijriCalendarComponent, decorators: [{
964
+ type: Component,
965
+ args: [{ selector: "app-hijri-calendar", standalone: true, imports: [NgbDatepickerModule, FormsModule], providers: [
966
+ { provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura },
967
+ { provide: NgbDatepickerI18n, useClass: DynamicHijriI18n }
968
+ ], 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" }]
969
+ }], ctorParameters: () => [{ type: i1$6.NgbDatepickerI18n }, { type: i0.ChangeDetectorRef }], propDecorators: { model: [{
970
+ type: Input
971
+ }], dateSelected: [{
972
+ type: Output
973
+ }], language: [{
974
+ type: Input
975
+ }] } });
976
+
977
+ class GregorianArabicI18n extends NgbDatepickerI18n {
978
+ getMonthShortName(month) {
979
+ return MONTHS_GREGORIAN.ar[month - 1];
980
+ }
981
+ getMonthFullName(month) {
982
+ return MONTHS_GREGORIAN.ar[month - 1];
983
+ }
984
+ getWeekdayLabel(weekday) {
985
+ return WEEKDAYS.ar[weekday - 1];
986
+ }
987
+ getWeekdayShortName(weekday) {
988
+ return WEEKDAYS.ar[weekday - 1];
989
+ }
990
+ getDayAriaLabel(date) {
991
+ return `${date.day}-${date.month}-${date.year}`;
992
+ }
993
+ getYearNumerals(year) {
994
+ return String(year);
995
+ }
996
+ getWeekNumerals(weekNumber) {
997
+ return String(weekNumber);
998
+ }
999
+ getDayNumerals(date) {
1000
+ return String(date.day);
1001
+ }
1002
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianArabicI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1003
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianArabicI18n });
1004
+ }
1005
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianArabicI18n, decorators: [{
1006
+ type: Injectable
1007
+ }] });
1008
+ class GregorianEnglishI18n extends NgbDatepickerI18n {
1009
+ getMonthShortName(month) {
1010
+ return MONTHS_GREGORIAN.en[month - 1].substring(0, 3);
1011
+ }
1012
+ getMonthFullName(month) {
1013
+ return MONTHS_GREGORIAN.en[month - 1];
1014
+ }
1015
+ getWeekdayLabel(weekday) {
1016
+ return WEEKDAYS.en[weekday - 1];
1017
+ }
1018
+ getWeekdayShortName(weekday) {
1019
+ return WEEKDAYS.en[weekday - 1];
1020
+ }
1021
+ getDayAriaLabel(date) {
1022
+ return `${date.day}-${date.month}-${date.year}`;
1023
+ }
1024
+ getYearNumerals(year) {
1025
+ return String(year);
1026
+ }
1027
+ getWeekNumerals(weekNumber) {
1028
+ return String(weekNumber);
1029
+ }
1030
+ getDayNumerals(date) {
1031
+ return String(date.day);
1032
+ }
1033
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianEnglishI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1034
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianEnglishI18n });
1035
+ }
1036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianEnglishI18n, decorators: [{
1037
+ type: Injectable
1038
+ }] });
1039
+ // ============ Dynamic I18N Factory ============
1040
+ class DynamicGregorianI18n extends NgbDatepickerI18n {
1041
+ currentLang = 'en';
1042
+ arabicI18n = new GregorianArabicI18n();
1043
+ englishI18n = new GregorianEnglishI18n();
1044
+ setLanguage(lang) {
1045
+ this.currentLang = lang;
1046
+ }
1047
+ get activeI18n() {
1048
+ return this.currentLang === 'ar' ? this.arabicI18n : this.englishI18n;
1049
+ }
1050
+ getMonthShortName(month) {
1051
+ return this.activeI18n.getMonthShortName(month);
1052
+ }
1053
+ getMonthFullName(month) {
1054
+ return this.activeI18n.getMonthFullName(month);
1055
+ }
1056
+ getWeekdayLabel(weekday) {
1057
+ return this.activeI18n.getWeekdayLabel(weekday);
1058
+ }
1059
+ getWeekdayShortName(weekday) {
1060
+ return this.activeI18n.getWeekdayShortName(weekday);
1061
+ }
1062
+ getDayAriaLabel(date) {
1063
+ return this.activeI18n.getDayAriaLabel(date);
1064
+ }
1065
+ getYearNumerals(year) {
1066
+ return this.activeI18n.getYearNumerals(year);
1067
+ }
1068
+ getWeekNumerals(weekNumber) {
1069
+ return this.activeI18n.getWeekNumerals(weekNumber);
1070
+ }
1071
+ getDayNumerals(date) {
1072
+ return this.activeI18n.getDayNumerals(date);
1073
+ }
1074
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicGregorianI18n, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1075
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicGregorianI18n });
1076
+ }
1077
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicGregorianI18n, decorators: [{
1078
+ type: Injectable
1079
+ }] });
1080
+
1081
+ class GregorianCalendarComponent {
1082
+ i18n;
1083
+ cdr;
1084
+ model;
1085
+ dateSelected = new EventEmitter();
1086
+ language = 'en';
1087
+ startDate;
1088
+ calendar = new NgbCalendarGregorian();
1089
+ constructor(i18n, cdr) {
1090
+ this.i18n = i18n;
1091
+ this.cdr = cdr;
1092
+ }
1093
+ ngOnChanges(changes) {
1094
+ if (changes['model'] && changes['model'].currentValue) {
1095
+ this.startDate = { ...changes['model'].currentValue };
1096
+ }
1097
+ if (changes['language'] && this.i18n instanceof DynamicGregorianI18n) {
1098
+ this.i18n.setLanguage(this.language);
1099
+ this.cdr.detectChanges();
1100
+ }
1101
+ }
1102
+ onDateChange(date) {
1103
+ this.model = date;
1104
+ this.startDate = { ...date };
1105
+ }
1106
+ isToday(date) {
1107
+ const today = this.calendar.getToday();
1108
+ return date.year === today.year &&
1109
+ date.month === today.month &&
1110
+ date.day === today.day;
1111
+ }
1112
+ isDisabled = () => false;
1113
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianCalendarComponent, deps: [{ token: i1$6.NgbDatepickerI18n }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1114
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.15", type: GregorianCalendarComponent, isStandalone: true, selector: "app-gregorian-calendar", inputs: { model: "model", language: "language" }, outputs: { dateSelected: "dateSelected" }, providers: [
1115
+ { provide: NgbCalendar, useClass: NgbCalendarGregorian },
1116
+ { provide: NgbDatepickerI18n, useClass: DynamicGregorianI18n }
1117
+ ], 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"] }] });
1118
+ }
1119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: GregorianCalendarComponent, decorators: [{
1120
+ type: Component,
1121
+ args: [{ selector: "app-gregorian-calendar", standalone: true, imports: [NgbDatepickerModule, FormsModule], providers: [
1122
+ { provide: NgbCalendar, useClass: NgbCalendarGregorian },
1123
+ { provide: NgbDatepickerI18n, useClass: DynamicGregorianI18n }
1124
+ ], 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" }]
1125
+ }], ctorParameters: () => [{ type: i1$6.NgbDatepickerI18n }, { type: i0.ChangeDetectorRef }], propDecorators: { model: [{
1126
+ type: Input
1127
+ }], dateSelected: [{
1128
+ type: Output
1129
+ }], language: [{
1130
+ type: Input
1131
+ }] } });
1132
+
1133
+ class DatePickerSwitcherComponent extends BaseInputComponent {
1134
+ type = 'text';
1135
+ contentType = 'text';
1136
+ size = "small";
1137
+ prefix;
1138
+ rows = 2;
1139
+ cols = 20;
1140
+ autoResize = true;
1141
+ basicInput;
1142
+ noStyle;
1143
+ hideOptionalLabel;
1144
+ inputDirection = 'inherit';
1145
+ variant = 'over';
1146
+ defaultColor = '#DFE0E6';
1147
+ formattedDate = '';
1148
+ openCalender = new EventEmitter();
1149
+ constructor() {
1150
+ super();
1151
+ }
1152
+ ngOnChanges(changes) {
1153
+ if (changes['formattedDate'] && changes['formattedDate'].currentValue) {
1154
+ // Update the FormControl value if parent changes the formattedDate
1155
+ this.control.setValue(changes['formattedDate'].currentValue, { emitEvent: false });
1156
+ }
1157
+ }
1158
+ ngOnInit() {
1159
+ this.control.setValue(this.formattedDate);
1160
+ }
1161
+ clearButtonClick(e) {
1162
+ this.control.setValue(null);
1163
+ }
1164
+ openCalendar(isOpen) {
1165
+ this.openCalender.emit(isOpen);
1166
+ }
1167
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DatePickerSwitcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1168
+ 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'\" style=\"direction: rtl; unicode-bidi: plaintext;\"\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 });
1169
+ }
1170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DatePickerSwitcherComponent, decorators: [{
1171
+ type: Component,
1172
+ args: [{ selector: 'stc-date-picker-switcher', standalone: true, imports: [
1173
+ FormsModule,
1174
+ ReactiveFormsModule,
1175
+ NgClass,
1176
+ InputText,
1177
+ DatePickerModule,
1178
+ ValidationErrorsPipe,
1179
+ TranslatePipe,
1180
+ FloatLabelModule,
1181
+ ], 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'\" style=\"direction: rtl; unicode-bidi: plaintext;\"\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"] }]
1182
+ }], ctorParameters: () => [], propDecorators: { type: [{
1183
+ type: Input
1184
+ }], contentType: [{
1185
+ type: Input
1186
+ }], size: [{
1187
+ type: Input
1188
+ }], prefix: [{
1189
+ type: Input
1190
+ }], rows: [{
1191
+ type: Input
1192
+ }], cols: [{
1193
+ type: Input
1194
+ }], autoResize: [{
1195
+ type: Input
1196
+ }], basicInput: [{
1197
+ type: Input
1198
+ }], noStyle: [{
1199
+ type: Input
1200
+ }], hideOptionalLabel: [{
1201
+ type: Input
1202
+ }], inputDirection: [{
1203
+ type: Input
1204
+ }], variant: [{
1205
+ type: Input
1206
+ }], defaultColor: [{
1207
+ type: Input
1208
+ }], formattedDate: [{
1209
+ type: Input
1210
+ }], openCalender: [{
1211
+ type: Output
1212
+ }] } });
1213
+
1214
+ class DualCalendarComponent {
1215
+ selectedDate = '';
1216
+ control = new FormControl({ value: null, disabled: false }, []);
1217
+ mode = 'gregorian';
1218
+ gregorianModel;
1219
+ hijriModel;
1220
+ currentLang = 'ar';
1221
+ selectButtonChange = new EventEmitter();
1222
+ isCalendarOpen = false;
1223
+ calendarContainer;
1224
+ constructor() { }
1225
+ onDocumentClick(event) {
1226
+ if (!this.calendarContainer)
1227
+ return;
1228
+ const clickedInside = this.calendarContainer.nativeElement.contains(event.target);
1229
+ if (!clickedInside) {
1230
+ this.isCalendarOpen = false;
1231
+ }
1232
+ }
1233
+ onSelectGregorian(date) {
1234
+ this.gregorianModel = date;
1235
+ const m = moment(`${date.year}-${date.month}-${date.day}`, 'YYYY-M-D');
1236
+ this.hijriModel = {
1237
+ year: +m.format('iYYYY'),
1238
+ month: +m.format('iM'),
1239
+ day: +m.format('iD')
1240
+ };
1241
+ this.selectedDate = this.formatHijri(m);
1242
+ this.isCalendarOpen = false;
1243
+ }
1244
+ onSelectHijri(date) {
1245
+ this.hijriModel = date;
1246
+ const m = moment(`${date.year}-${date.month}-${date.day}`, 'iYYYY-iM-iD');
1247
+ this.gregorianModel = {
1248
+ year: +m.format('YYYY'),
1249
+ month: +m.format('M'),
1250
+ day: +m.format('D')
1251
+ };
1252
+ this.selectedDate = this.formatHijri(m);
1253
+ this.isCalendarOpen = false;
1254
+ }
1255
+ showCalender(isOpen) {
1256
+ this.isCalendarOpen = isOpen;
1257
+ }
1258
+ formatHijri(m) {
1259
+ const hijriDay = m.format('iD');
1260
+ const hijriMonth = getHijriMonthName(this.currentLang, +m.format('iM'));
1261
+ const gregorianDay = m.format('D');
1262
+ const gregorianMonth = getGregorianMonthName(this.currentLang, +m.format('M'));
1263
+ const gregorianYear = m.format('YYYY');
1264
+ const hijriYear = m.format('iYYYY');
1265
+ return `${gregorianDay} ${gregorianMonth} ${gregorianYear} - ${hijriDay} ${hijriMonth} ${hijriYear}`;
1266
+ }
1267
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DualCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1268
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: DualCalendarComponent, isStandalone: true, selector: "app-dual-calendar", inputs: { control: "control" }, outputs: { selectButtonChange: "selectButtonChange" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, providers: [
1269
+ { provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura }
1270
+ ], viewQueries: [{ propertyName: "calendarContainer", first: true, predicate: ["calendarContainer"], descendants: true }], ngImport: i0, template: "<div class=\"calender-content \" #calendarContainer>\r\n <stc-date-picker-switcher [variant]=\"'in'\" [label]=\"'Select Date'\" id=\"dateId\" (openCalender)=\"showCalender($event)\"\r\n [control]=\"control\" [formattedDate]='selectedDate' >\r\n </stc-date-picker-switcher>\r\n\r\n <!-- calender.html -->\r\n <div dir=\"rtl\" class=\"p-2 calendar-wrapper \" [@slideDown]=\"isCalendarOpen ? 'open' : 'closed'\" >\r\n <div class=\"header-tabs\">\r\n <div class=\"header-label\">\u0646\u0648\u0639 \u0627\u0644\u062A\u0642\u0648\u064A\u0645</div>\r\n <div class=\"tabs\">\r\n <button class=\"tab-button\" [class.active]=\"mode === 'gregorian'\" (click)=\" mode='gregorian'\">\r\n \u0627\u0644\u0645\u064A\u0644\u0627\u062F\u064A\r\n </button>\r\n <button class=\"tab-button\" [class.active]=\"mode === 'hijri'\" (click)=\" mode='hijri'\">\r\n \u0647\u062C\u0631\u064A\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\r\n</div>\r\n", styles: [".calendar-wrapper{font-family:Tajawal,sans-serif;max-width:375px;padding:15px}.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;padding-top:10px}.calendar-wrapper{position:absolute;top:100%;left:0;width:100%;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}.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}\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"] }], animations: [
1271
+ trigger('slideDown', [
1272
+ state('closed', style({
1273
+ height: '0px',
1274
+ opacity: 0,
1275
+ overflow: 'hidden'
1276
+ })),
1277
+ state('open', style({
1278
+ height: '*',
1279
+ opacity: 1,
1280
+ overflow: 'hidden'
1281
+ })),
1282
+ transition('closed <=> open', [
1283
+ animate('300ms ease')
1284
+ ])
1285
+ ])
1286
+ ], encapsulation: i0.ViewEncapsulation.None });
1287
+ }
1288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DualCalendarComponent, decorators: [{
1289
+ type: Component,
1290
+ args: [{ selector: 'app-dual-calendar', animations: [
1291
+ trigger('slideDown', [
1292
+ state('closed', style({
1293
+ height: '0px',
1294
+ opacity: 0,
1295
+ overflow: 'hidden'
1296
+ })),
1297
+ state('open', style({
1298
+ height: '*',
1299
+ opacity: 1,
1300
+ overflow: 'hidden'
1301
+ })),
1302
+ transition('closed <=> open', [
1303
+ animate('300ms ease')
1304
+ ])
1305
+ ])
1306
+ ], imports: [
1307
+ NgbDatepickerModule,
1308
+ FormsModule,
1309
+ FormsModule,
1310
+ ReactiveFormsModule,
1311
+ DatePickerModule,
1312
+ FloatLabelModule,
1313
+ HijriCalendarComponent,
1314
+ DatePickerSwitcherComponent,
1315
+ GregorianCalendarComponent
1316
+ ], providers: [
1317
+ { provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura }
1318
+ ], encapsulation: ViewEncapsulation.None, template: "<div class=\"calender-content \" #calendarContainer>\r\n <stc-date-picker-switcher [variant]=\"'in'\" [label]=\"'Select Date'\" id=\"dateId\" (openCalender)=\"showCalender($event)\"\r\n [control]=\"control\" [formattedDate]='selectedDate' >\r\n </stc-date-picker-switcher>\r\n\r\n <!-- calender.html -->\r\n <div dir=\"rtl\" class=\"p-2 calendar-wrapper \" [@slideDown]=\"isCalendarOpen ? 'open' : 'closed'\" >\r\n <div class=\"header-tabs\">\r\n <div class=\"header-label\">\u0646\u0648\u0639 \u0627\u0644\u062A\u0642\u0648\u064A\u0645</div>\r\n <div class=\"tabs\">\r\n <button class=\"tab-button\" [class.active]=\"mode === 'gregorian'\" (click)=\" mode='gregorian'\">\r\n \u0627\u0644\u0645\u064A\u0644\u0627\u062F\u064A\r\n </button>\r\n <button class=\"tab-button\" [class.active]=\"mode === 'hijri'\" (click)=\" mode='hijri'\">\r\n \u0647\u062C\u0631\u064A\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\r\n</div>\r\n", styles: [".calendar-wrapper{font-family:Tajawal,sans-serif;max-width:375px;padding:15px}.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;padding-top:10px}.calendar-wrapper{position:absolute;top:100%;left:0;width:100%;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}.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}\n"] }]
1319
+ }], ctorParameters: () => [], propDecorators: { control: [{
1320
+ type: Input
1321
+ }], selectButtonChange: [{
1322
+ type: Output
1323
+ }], calendarContainer: [{
1324
+ type: ViewChild,
1325
+ args: ['calendarContainer']
1326
+ }], onDocumentClick: [{
1327
+ type: HostListener,
1328
+ args: ['document:click', ['$event']]
1329
+ }] } });
1330
+
1331
+ class DynamicFormComponent {
1332
+ dynamicFormData;
1333
+ // Generic field change outputs (optional for consumers)
1334
+ selectButtonChange = new EventEmitter();
1335
+ selectChange = new EventEmitter();
1336
+ switchChange = new EventEmitter();
1337
+ autoCompleteSearch = new EventEmitter();
1338
+ autoCompleteSelect = new EventEmitter();
1339
+ inputsNames = [];
1340
+ formGroup;
1341
+ inputsMap;
1342
+ fieldType = FormFieldTypeEnum;
1343
+ getFormControl = FormUtils.getFormControl;
1344
+ ngOnInit() {
1345
+ this.formGroup = this.dynamicFormData?.formGroup;
1346
+ this.inputsMap = this.dynamicFormData?.inputsMap;
1347
+ this.inputsNames = Object.keys(this.inputsMap || {});
1348
+ }
1349
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1350
+ 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 ?? true\"\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 <small class=\"text-sm text-gray-600 self-end\">\r\n {{ (getFormControl(inputName, formGroup).value?.length || 0) }}\r\n <span>\r\n / {{ inputsMap[inputName].maxLength}}\r\n </span>\r\n </small>\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"], 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"], outputs: ["selectButtonChange"] }, { kind: "component", type: InputComponent, selector: "stc-input", inputs: ["type", "contentType", "size", "prefix", "rows", "cols", "autoResize", "basicInput", "noStyle", "hideOptionalLabel", "inputDirection", "variant", "defaultColor"] }, { kind: "component", type: SelectComponent, selector: "stc-select", inputs: ["selectedItemTemplate", "optionTemplate", "options", "optionLabel", "checkmark", "showClear", "editable", "filter", "multiple", "filterBy", "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" }] });
1351
+ }
1352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicFormComponent, decorators: [{
1353
+ type: Component,
1354
+ args: [{ selector: 'app-dynamic-form', standalone: true, imports: [
1355
+ CommonModule,
1356
+ ReactiveFormsModule,
1357
+ DatePickerComponent,
1358
+ ValidationErrorsPipe,
1359
+ TranslateModule,
1360
+ SelectButtonComponent,
1361
+ DualCalendarComponent,
1362
+ InputComponent,
1363
+ SelectComponent,
1364
+ AutoCompleteComponent,
1365
+ SwitchComponent,
1366
+ ], 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 ?? true\"\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 <small class=\"text-sm text-gray-600 self-end\">\r\n {{ (getFormControl(inputName, formGroup).value?.length || 0) }}\r\n <span>\r\n / {{ inputsMap[inputName].maxLength}}\r\n </span>\r\n </small>\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" }]
1367
+ }], propDecorators: { dynamicFormData: [{
1368
+ type: Input,
1369
+ args: [{ required: true }]
1370
+ }], selectButtonChange: [{
1371
+ type: Output
1372
+ }], selectChange: [{
1373
+ type: Output
1374
+ }], switchChange: [{
1375
+ type: Output
1376
+ }], autoCompleteSearch: [{
1377
+ type: Output
1378
+ }], autoCompleteSelect: [{
1379
+ type: Output
1380
+ }] } });
1381
+
1382
+ class ConfirmationDialogComponent extends DynamicDialogRef {
1383
+ router = inject(Router);
1384
+ dialogService = inject(DialogService);
1385
+ dynamicDialogConfig = inject(DynamicDialogConfig);
1386
+ _ref = inject(DynamicDialogRef);
1387
+ _subscription = new Subscription();
1388
+ dialogFormData;
1389
+ ngOnDestroy() {
1390
+ this._subscription.unsubscribe();
1391
+ }
1392
+ ngOnInit() {
1393
+ // closing when navigating back from the browser
1394
+ this._subscription.add(this.router.events.pipe(filter((event) => event instanceof NavigationStart)).subscribe(() => {
1395
+ if (this.dynamicDialogConfig) {
1396
+ this._ref.close(false);
1397
+ }
1398
+ }));
1399
+ this.dialogFormData = this.dynamicDialogConfig.data?.inputForm;
1400
+ }
1401
+ submit() {
1402
+ // we should pass submitted data when using form dialog
1403
+ // const submitData = { submitted: true, data: this.dialogFormData?.formGroup?.value };
1404
+ // this._ref.close(this.dynamicDialogConfig.data.inputForm ? submitData : true);
1405
+ this._ref.close(true);
1406
+ }
1407
+ close() {
1408
+ this._ref.close(false);
1409
+ }
1410
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1411
+ 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 });
1412
+ }
1413
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogComponent, decorators: [{
1414
+ type: Component,
1415
+ args: [{ selector: 'app-confirm-dialog', encapsulation: ViewEncapsulation.None, standalone: true, imports: [
1416
+ AppButtonComponent,
1417
+ AvatarModule,
1418
+ DynamicDialogModule,
1419
+ DynamicFormComponent,
1420
+ TranslatePipe,
1421
+ ], 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}" }]
1422
+ }] });
1423
+
1424
+ class ReadMoreComponent {
1425
+ text = "";
1426
+ styleClass = "";
1427
+ maxCharacters = 100;
1428
+ isExpanded = false;
1429
+ toggleReadMore() {
1430
+ this.isExpanded = !this.isExpanded;
1431
+ }
1432
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ReadMoreComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1433
+ 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" }] });
1434
+ }
1435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ReadMoreComponent, decorators: [{
1436
+ type: Component,
1437
+ 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" }]
1438
+ }], propDecorators: { text: [{
1439
+ type: Input,
1440
+ args: [{ required: true }]
1441
+ }], styleClass: [{
1442
+ type: Input
1443
+ }], maxCharacters: [{
1444
+ type: Input
1445
+ }] } });
1446
+
1447
+ class AppAccordionComponent {
1448
+ iconName;
1449
+ iconClass;
1450
+ iconPathCount = 0;
1451
+ title;
1452
+ contentBorderTop = true;
1453
+ accordionPanelBorder = true;
1454
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1455
+ 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"] }] });
1456
+ }
1457
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppAccordionComponent, decorators: [{
1458
+ type: Component,
1459
+ 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" }]
1460
+ }], propDecorators: { iconName: [{
1461
+ type: Input
1462
+ }], iconClass: [{
1463
+ type: Input
1464
+ }], iconPathCount: [{
1465
+ type: Input
1466
+ }], title: [{
1467
+ type: Input,
1468
+ args: [{ required: true }]
1469
+ }], contentBorderTop: [{
1470
+ type: Input
1471
+ }], accordionPanelBorder: [{
1472
+ type: Input
1473
+ }] } });
1474
+
1475
+ class UserAutocompleteCardComponent {
1476
+ select = new EventEmitter();
1477
+ delete = new EventEmitter();
1478
+ userData;
1479
+ explicitRole = "";
1480
+ showDeleteAction = true;
1481
+ onDelete() {
1482
+ this.delete.emit(this.userData);
1483
+ }
1484
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserAutocompleteCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1485
+ 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 });
1486
+ }
1487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UserAutocompleteCardComponent, decorators: [{
1488
+ type: Component,
1489
+ 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" }]
1490
+ }], propDecorators: { select: [{
1491
+ type: Output
1492
+ }], delete: [{
1493
+ type: Output
1494
+ }], userData: [{
1495
+ type: Input,
1496
+ args: [{ required: true }]
1497
+ }], explicitRole: [{
1498
+ type: Input
1499
+ }], showDeleteAction: [{
1500
+ type: Input
1501
+ }] } });
1502
+
1503
+ class AppBreadcrumbComponent {
1504
+ activatedRoute;
1505
+ router;
1506
+ items;
1507
+ isShown;
1508
+ constructor(activatedRoute, router) {
1509
+ this.activatedRoute = activatedRoute;
1510
+ this.router = router;
1511
+ }
1512
+ ngOnInit() {
1513
+ if (this.items) {
1514
+ this.isShown = true;
1515
+ return;
1516
+ }
1517
+ this.router.events.pipe(filter((event) => event instanceof NavigationEnd)).subscribe((e) => {
1518
+ // remove duplicates
1519
+ this.items = this._createBreadcrumbs(this.activatedRoute.root).filter((item, index, self) => index ===
1520
+ self.findIndex((t) => t.label === item.label && t.routerLink === item.routerLink));
1521
+ this._checkHiddenBreadcrumb();
1522
+ this._checkEmpty();
1523
+ });
1524
+ }
1525
+ _checkHiddenBreadcrumb() {
1526
+ const activeBreadcrumb = this.items?.find((item) => {
1527
+ return item.routerLink === this.router.url;
1528
+ });
1529
+ this.isShown = !!activeBreadcrumb?.isShown;
1530
+ }
1531
+ _createBreadcrumbs(activatedRoute, routerLink = '', breadcrumbs = []) {
1532
+ const children = activatedRoute.children;
1533
+ if (children.length === 0) {
1534
+ return breadcrumbs;
1535
+ }
1536
+ for (const child of children) {
1537
+ const routeURL = child.snapshot.url.map((segment) => segment.path).join('/');
1538
+ if (routeURL !== '') {
1539
+ routerLink += `/${routeURL}`;
1540
+ }
1541
+ let label = child.snapshot.data['breadcrumb'];
1542
+ const notClickableBreadcrumb = !!child.snapshot.data['notClickableBreadcrumb'];
1543
+ const isShown = !!child.snapshot.data['isShown'];
1544
+ const extraBreadcrumbs = child.snapshot.data['extraBreadcrumbs'] || [];
1545
+ if (!(typeof label === 'undefined' || label === null)) {
1546
+ const data = activatedRoute.snapshot.firstChild?.data || {};
1547
+ // Resolve dynamic breadcrumb label
1548
+ if (label && label.startsWith('[') && label.endsWith(']')) {
1549
+ label = this._getRecursiveKey(data, label.slice(1, -1).split('.'));
1550
+ }
1551
+ // Resolve dynamic URL parts
1552
+ const resolveDynamicUrl = (route) => {
1553
+ return route.replace(/\[([^\]]+)]/g, (_, key) => this._getRecursiveKey(data, key.split('.')) || '');
1554
+ };
1555
+ const mainBreadcrumb = {
1556
+ label,
1557
+ routerLink,
1558
+ data,
1559
+ notClickableBreadcrumb,
1560
+ isShown,
1561
+ };
1562
+ // Process extra breadcrumbs
1563
+ const beforeBreadcrumbs = [];
1564
+ const afterBreadcrumbs = [];
1565
+ extraBreadcrumbs.forEach((extra) => {
1566
+ let extraLabel = extra.label || '';
1567
+ if (extraLabel.startsWith('[') && extraLabel.endsWith(']')) {
1568
+ extraLabel = this._getRecursiveKey(data, extraLabel.slice(1, -1).split('.'));
1569
+ }
1570
+ const extraUrl = resolveDynamicUrl(extra.routerLink || '');
1571
+ const extraBreadcrumb = { ...extra, label: extraLabel, routerLink: extraUrl };
1572
+ if (extra.position === 'before') {
1573
+ beforeBreadcrumbs.push(extraBreadcrumb);
1574
+ }
1575
+ else {
1576
+ afterBreadcrumbs.push(extraBreadcrumb);
1577
+ }
1578
+ });
1579
+ // Merge breadcrumbs
1580
+ breadcrumbs.push(...beforeBreadcrumbs, mainBreadcrumb, ...afterBreadcrumbs);
1581
+ }
1582
+ return this._createBreadcrumbs(child, routerLink, breadcrumbs);
1583
+ }
1584
+ }
1585
+ _checkEmpty() {
1586
+ if (!this.items)
1587
+ return;
1588
+ const lastBreadcrumbVisibility = this.items[this.items.length - 1].isShown;
1589
+ this.items = this.items.filter((b) => b.label !== '');
1590
+ this.items[this.items.length - 1].isShown = lastBreadcrumbVisibility;
1591
+ }
1592
+ _getRecursiveKey(obj, keys) {
1593
+ if (keys.length === 0) {
1594
+ return undefined;
1595
+ }
1596
+ const [currentKey, ...remainingKeys] = keys;
1597
+ if (currentKey in obj) {
1598
+ if (remainingKeys.length > 0) {
1599
+ return this._getRecursiveKey(obj[currentKey], remainingKeys);
1600
+ }
1601
+ return obj[currentKey];
1602
+ }
1603
+ return undefined;
1604
+ }
1605
+ 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 });
1606
+ 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 });
1607
+ }
1608
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AppBreadcrumbComponent, decorators: [{
1609
+ type: Component,
1610
+ 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"] }]
1611
+ }], ctorParameters: () => [{ type: i1$7.ActivatedRoute }, { type: i1$7.Router }], propDecorators: { items: [{
1612
+ type: Input
1613
+ }] } });
1614
+
1615
+ const SIDEBAR_DATA = new InjectionToken('SIDEBAR_DATA');
1616
+ function createCustomInjector(parentInjector, injectionToken, data) {
1617
+ return Injector.create({
1618
+ parent: parentInjector,
1619
+ providers: [
1620
+ {
1621
+ provide: injectionToken,
1622
+ useValue: data ?? null
1623
+ }
1624
+ ]
1625
+ });
1626
+ }
1627
+ ;
1628
+ var SidebarActionType;
1629
+ (function (SidebarActionType) {
1630
+ SidebarActionType["SAVE"] = "SAVE";
1631
+ SidebarActionType["SaveMore"] = "SaveMore";
1632
+ SidebarActionType["CANCEL"] = "CANCEL";
1633
+ SidebarActionType["SUBMIT"] = "SUBMIT";
1634
+ SidebarActionType["CLOSE"] = "CLOSE";
1635
+ SidebarActionType["CloseWithData"] = "CloseWithData";
1636
+ })(SidebarActionType || (SidebarActionType = {}));
1637
+
1638
+ class DataInjectorPipe {
1639
+ injector = inject(Injector);
1640
+ transform(data) {
1641
+ return createCustomInjector(this.injector, SIDEBAR_DATA, data);
1642
+ }
1643
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DataInjectorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1644
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: DataInjectorPipe, isStandalone: true, name: "dataInjector" });
1645
+ }
1646
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DataInjectorPipe, decorators: [{
1647
+ type: Pipe,
1648
+ args: [{
1649
+ name: 'dataInjector',
1650
+ standalone: true,
1651
+ pure: true
1652
+ }]
1653
+ }] });
1654
+
1655
+ class SideBarDynamicComponent {
1656
+ dynamicSidebarService = inject(DynamicSidebarService);
1657
+ parentInjector = inject(Injector);
1658
+ location = inject(Location);
1659
+ popStateListener;
1660
+ sidebarConfig = this.dynamicSidebarService.sidebarConfig;
1661
+ ngOnInit() {
1662
+ //To close a sidebar when the browser back button is pressed
1663
+ this.popStateListener = this.location.subscribe(() => {
1664
+ if (this.dynamicSidebarService.sidebarConfig.visible) {
1665
+ this.dynamicSidebarService.close();
1666
+ }
1667
+ });
1668
+ }
1669
+ ngOnDestroy() {
1670
+ // reset Sidebar token
1671
+ createCustomInjector(this.parentInjector, SIDEBAR_DATA, null);
1672
+ }
1673
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SideBarDynamicComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1674
+ 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" }] });
1675
+ }
1676
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SideBarDynamicComponent, decorators: [{
1677
+ type: Component,
1678
+ 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"] }]
1679
+ }] });
1680
+
1681
+ const SidebarConfigDefaults = {
1682
+ title: "",
1683
+ show: true,
1684
+ visible: true,
1685
+ closable: true,
1686
+ dismissible: false,
1687
+ closeOnEscape: false,
1688
+ sidebarSize: "md",
1689
+ showCancelBtn: false,
1690
+ showSaveBtn: false,
1691
+ showSaveAndMoreBtn: false,
1692
+ actions: {
1693
+ save: {},
1694
+ saveAndMore: {
1695
+ variant: "outlined"
1696
+ }
1697
+ }
1698
+ };
1699
+
1700
+ class DynamicSidebarService {
1701
+ environmentInjector;
1702
+ appRef;
1703
+ contentComponentRef = null;
1704
+ contentComponentData;
1705
+ sidebarConfig = this.getDefaultConfig();
1706
+ activeForm = null;
1707
+ componentRef = null;
1708
+ sidebarAction$ = new Subject();
1709
+ action$ = this.sidebarAction$.asObservable();
1710
+ sidebarSideEffectAction$ = new Subject();
1711
+ sideEffectAction$ = this.sidebarSideEffectAction$.asObservable();
1712
+ isOpen$ = new BehaviorSubject(false);
1713
+ isOpenObservable$ = this.isOpen$.asObservable();
1714
+ constructor(environmentInjector, appRef) {
1715
+ this.environmentInjector = environmentInjector;
1716
+ this.appRef = appRef;
1717
+ }
1718
+ // Action notifications
1719
+ notifyAction(type, payload) {
1720
+ this.sidebarAction$.next({ type, payload });
1721
+ }
1722
+ notifySideEffectAction(type, payload) {
1723
+ this.sidebarSideEffectAction$.next({ type, payload });
1724
+ }
1725
+ // Form management
1726
+ setActiveForm(control) {
1727
+ this.activeForm = control;
1728
+ }
1729
+ resetActiveForm() {
1730
+ this.activeForm = null;
1731
+ }
1732
+ isButtonDisabled() {
1733
+ if (!this.activeForm) {
1734
+ return false;
1735
+ }
1736
+ return this.activeForm.invalid || this.activeForm.untouched;
1737
+ }
1738
+ open(component, config, data) {
1739
+ // Close any existing sidebar before opening a new one
1740
+ // TODO Need to Review
1741
+ if (!component) {
1742
+ return;
1743
+ }
1744
+ this.close();
1745
+ this.contentComponentRef = component;
1746
+ this.contentComponentData = data;
1747
+ this.sidebarConfig = { ...this.getDefaultConfig(), ...config };
1748
+ this.componentRef = createComponent(SideBarDynamicComponent, {
1749
+ environmentInjector: this.environmentInjector,
1750
+ });
1751
+ // Attach the component to the Angular application
1752
+ this.appRef.attachView(this.componentRef.hostView);
1753
+ // Append the component to the DOM
1754
+ const domElem = this.componentRef.hostView.rootNodes[0];
1755
+ document.body.appendChild(domElem);
1756
+ }
1757
+ /**
1758
+ * Closes the currently open sidebar, if any.
1759
+ */
1760
+ close() {
1761
+ if (this.componentRef) {
1762
+ // Detach the view and destroy the component
1763
+ this.appRef.detachView(this.componentRef.hostView);
1764
+ this.componentRef.destroy();
1765
+ this.componentRef = null;
1766
+ // Reset content and configuration
1767
+ this.contentComponentRef = null;
1768
+ this.contentComponentData = null;
1769
+ this.sidebarConfig = this.getDefaultConfig();
1770
+ this.isOpen$.next(false);
1771
+ this.resetActiveForm();
1772
+ this.notifySideEffectAction(SidebarActionType.CLOSE);
1773
+ }
1774
+ }
1775
+ cancel() {
1776
+ this.notifyAction(SidebarActionType.CANCEL);
1777
+ }
1778
+ submit(flag = false) {
1779
+ const actionType = flag ? SidebarActionType.SaveMore : SidebarActionType.SAVE;
1780
+ this.notifyAction(actionType, { withClose: flag });
1781
+ }
1782
+ /**
1783
+ * Provides the default configuration for the sidebar.
1784
+ * @returns The default SidebarConfig object.
1785
+ */
1786
+ getDefaultConfig() {
1787
+ return {
1788
+ ...SidebarConfigDefaults,
1789
+ show: false,
1790
+ visible: false,
1791
+ closable: false,
1792
+ dismissible: true
1793
+ };
1794
+ }
1795
+ 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 });
1796
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarService, providedIn: "root" });
1797
+ }
1798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarService, decorators: [{
1799
+ type: Injectable,
1800
+ args: [{
1801
+ providedIn: "root"
1802
+ }]
1803
+ }], ctorParameters: () => [{ type: i0.EnvironmentInjector }, { type: i0.ApplicationRef }] });
1804
+
1805
+ class ConfirmationDialogService {
1806
+ dialogService;
1807
+ constructor(dialogService) {
1808
+ this.dialogService = dialogService;
1809
+ }
1810
+ open(data) {
1811
+ const ref = this.dialogService.open(ConfirmationDialogComponent, {
1812
+ data,
1813
+ header: data.header,
1814
+ showHeader: true,
1815
+ width: '600px',
1816
+ closable: true,
1817
+ modal: true,
1818
+ styleClass: 'confirmation-dialog-wrapper',
1819
+ breakpoints: data.breakpoints,
1820
+ });
1821
+ if (!ref) {
1822
+ return of(false); // or EMPTY / throwError — depending on your logic
1823
+ }
1824
+ // Emit true/false when dialog closes
1825
+ return ref.onClose.pipe(filter$1((res) => res !== undefined), map((res) => !!res));
1826
+ }
1827
+ 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 });
1828
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogService, providedIn: 'root' });
1829
+ }
1830
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ConfirmationDialogService, decorators: [{
1831
+ type: Injectable,
1832
+ args: [{
1833
+ providedIn: 'root',
1834
+ }]
1835
+ }], ctorParameters: () => [{ type: i1$8.DialogService }] });
1836
+
1837
+ class BottomSheetComponent {
1838
+ show = false;
1839
+ contentTemplate;
1840
+ onHide = new EventEmitter();
1841
+ onShow = new EventEmitter();
1842
+ hideBottomSheet() {
1843
+ this.show = false;
1844
+ this.onHide.emit(false);
1845
+ }
1846
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1847
+ 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 });
1848
+ }
1849
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BottomSheetComponent, decorators: [{
1850
+ type: Component,
1851
+ 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"] }]
1852
+ }], propDecorators: { show: [{
1853
+ type: Input
1854
+ }], contentTemplate: [{
1855
+ type: Input
1856
+ }], onHide: [{
1857
+ type: Output
1858
+ }], onShow: [{
1859
+ type: Output
1860
+ }] } });
1861
+
1862
+ class DynamicSidebarComponent {
1863
+ component;
1864
+ data;
1865
+ title = '';
1866
+ actions;
1867
+ sidebarSize = 'md';
1868
+ closable = true;
1869
+ closeOnEscape = true;
1870
+ dismissible = true;
1871
+ position = 'left';
1872
+ styleClass = '';
1873
+ disabled = false;
1874
+ closed = new EventEmitter();
1875
+ contentContainer;
1876
+ contentRef;
1877
+ show = true;
1878
+ ngAfterViewInit() {
1879
+ this.renderContent();
1880
+ }
1881
+ renderContent() {
1882
+ if (!this.component)
1883
+ return;
1884
+ this.contentContainer.clear();
1885
+ this.contentRef = this.contentContainer.createComponent(this.component);
1886
+ if (this.data)
1887
+ Object.assign(this.contentRef.instance, this.data);
1888
+ }
1889
+ handleClose() {
1890
+ if (this.contentRef.instance.close)
1891
+ this.contentRef.instance.close();
1892
+ this.closed.emit(null);
1893
+ this.destroy();
1894
+ }
1895
+ handleSubmit() {
1896
+ if (this.data.form) {
1897
+ this.data.form.markAllAsTouched();
1898
+ if (this.data.form.invalid)
1899
+ return;
1900
+ }
1901
+ if (this.contentRef.instance.submit)
1902
+ this.contentRef.instance.submit();
1903
+ }
1904
+ destroy() {
1905
+ this.contentRef?.destroy();
1906
+ }
1907
+ ngOnDestroy() {
1908
+ this.destroy();
1909
+ }
1910
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1911
+ 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" }] });
1912
+ }
1913
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarComponent, decorators: [{
1914
+ type: Component,
1915
+ 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"] }]
1916
+ }], propDecorators: { component: [{
1917
+ type: Input
1918
+ }], data: [{
1919
+ type: Input
1920
+ }], title: [{
1921
+ type: Input
1922
+ }], actions: [{
1923
+ type: Input
1924
+ }], sidebarSize: [{
1925
+ type: Input
1926
+ }], closable: [{
1927
+ type: Input
1928
+ }], closeOnEscape: [{
1929
+ type: Input
1930
+ }], dismissible: [{
1931
+ type: Input
1932
+ }], position: [{
1933
+ type: Input
1934
+ }], styleClass: [{
1935
+ type: Input
1936
+ }], disabled: [{
1937
+ type: Input
1938
+ }], closed: [{
1939
+ type: Output
1940
+ }], contentContainer: [{
1941
+ type: ViewChild,
1942
+ args: ['contentContainer', { read: ViewContainerRef }]
1943
+ }] } });
1944
+
1945
+ class DynamicSidebarV2Service {
1946
+ sidebarRef;
1947
+ appRef = inject(ApplicationRef);
1948
+ injector = inject(Injector);
1949
+ envInjector = inject(EnvironmentInjector);
1950
+ open(options) {
1951
+ this.close();
1952
+ this.sidebarRef = createComponent(DynamicSidebarComponent, {
1953
+ environmentInjector: this.envInjector,
1954
+ elementInjector: this.injector,
1955
+ });
1956
+ const instance = this.sidebarRef.instance;
1957
+ instance.title = options.title ?? '';
1958
+ instance.sidebarSize = options.size ?? 'md';
1959
+ instance.position = options.position ?? 'left';
1960
+ instance.styleClass = options.styleClass ?? '';
1961
+ instance.component = options.component;
1962
+ instance.data = options.data ?? {};
1963
+ instance.actions = options.actions;
1964
+ instance.closed.subscribe(() => this.close());
1965
+ this.appRef.attachView(this.sidebarRef.hostView);
1966
+ const domElem = this.sidebarRef.hostView.rootNodes[0];
1967
+ document.body.appendChild(domElem);
1968
+ }
1969
+ close() {
1970
+ if (this.sidebarRef) {
1971
+ this.sidebarRef.destroy();
1972
+ this.sidebarRef = undefined;
1973
+ }
1974
+ }
1975
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarV2Service, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1976
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarV2Service, providedIn: 'root' });
1977
+ }
1978
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: DynamicSidebarV2Service, decorators: [{
1979
+ type: Injectable,
1980
+ args: [{ providedIn: 'root' }]
1981
+ }] });
1982
+
1983
+ /**
1984
+ * Generated bundle index. Do not edit.
1985
+ */
1986
+
1987
+ export { AppAccordionComponent, AppBreadcrumbComponent, AppButtonComponent, AppDropdownMenuComponent, AppTabsComponent, AutoCompleteComponent, BasicErrorKeysEnum, BottomSheetComponent, ConfirmationDialogComponent, ConfirmationDialogService, DatePickerComponent, DualCalendarComponent, DynamicFormComponent, DynamicSidebarService, DynamicSidebarV2Service, ErrorsWithValuesKeysEnum, FormFieldTypeEnum, FormUtils, FormValidationService, IcoMoonIconComponent, InputComponent, ReadMoreComponent, SelectButtonComponent, SelectComponent, SideBarComponent, SidebarConfigDefaults, SwitchComponent, UserAutocompleteCardComponent, UserInfoComponent, ValidationErrorsPipe };
1988
+ //# sourceMappingURL=corp-products-ui-components.mjs.map