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