@pega/angular-sdk-overrides 0.24.9 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/designSystemExtension/alert/alert.component.scss +3 -3
- package/lib/designSystemExtension/alert/alert.component.ts +0 -1
- package/lib/designSystemExtension/alert-banner/alert-banner.component.ts +1 -2
- package/lib/designSystemExtension/banner/banner.component.scss +12 -2
- package/lib/designSystemExtension/banner/banner.component.ts +0 -1
- package/lib/designSystemExtension/case-create-stage/case-create-stage.component.ts +1 -2
- package/lib/designSystemExtension/field-group/field-group.component.ts +0 -1
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.html +6 -3
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.scss +7 -35
- package/lib/designSystemExtension/material-case-summary/material-case-summary.component.ts +0 -2
- package/lib/designSystemExtension/material-details/material-details.component.scss +0 -5
- package/lib/designSystemExtension/material-details/material-details.component.ts +0 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +4 -4
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.scss +4 -3
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +10 -2
- package/lib/designSystemExtension/material-summary-item/material-summary-item.component.scss +2 -17
- package/lib/designSystemExtension/material-summary-item/material-summary-item.component.ts +0 -1
- package/lib/designSystemExtension/material-summary-list/material-summary-list.component.ts +0 -1
- package/lib/designSystemExtension/material-utility/material-utility.component.scss +1 -2
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.scss +1 -1
- package/lib/designSystemExtension/material-vertical-tabs/material-vertical-tabs.component.ts +0 -1
- package/lib/designSystemExtension/operator/operator.component.html +2 -2
- package/lib/designSystemExtension/operator/operator.component.scss +13 -12
- package/lib/designSystemExtension/operator/operator.component.ts +5 -6
- package/lib/designSystemExtension/pulse/pulse.component.scss +2 -2
- package/lib/designSystemExtension/pulse/pulse.component.ts +7 -8
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +0 -1
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +0 -1
- package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.scss +16 -8
- package/lib/designSystemExtension/wss-quick-create/wss-quick-create.component.ts +0 -1
- package/lib/field/auto-complete/auto-complete.component.html +0 -2
- package/lib/field/auto-complete/auto-complete.component.ts +56 -178
- package/lib/field/cancel-alert/cancel-alert.component.html +8 -12
- package/lib/field/cancel-alert/cancel-alert.component.scss +2 -3
- package/lib/field/cancel-alert/cancel-alert.component.ts +24 -37
- package/lib/field/check-box/check-box.component.html +17 -6
- package/lib/field/check-box/check-box.component.scss +0 -1
- package/lib/field/check-box/check-box.component.ts +32 -157
- package/lib/field/currency/currency.component.html +4 -4
- package/lib/field/currency/currency.component.ts +65 -175
- package/lib/field/date/date.component.html +4 -8
- package/lib/field/date/date.component.ts +39 -177
- package/lib/field/date-time/date-time.component.html +3 -4
- package/lib/field/date-time/date-time.component.ts +46 -146
- package/lib/field/decimal/decimal.component.html +4 -3
- package/lib/field/decimal/decimal.component.ts +66 -166
- package/lib/field/dropdown/dropdown.component.html +1 -0
- package/lib/field/dropdown/dropdown.component.ts +158 -153
- package/lib/field/email/email.component.ts +28 -148
- package/lib/field/field.base.ts +149 -0
- package/lib/field/group/group.component.ts +9 -7
- package/lib/field/integer/integer.component.ts +30 -152
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.ts +3 -3
- package/lib/field/location/config-ext.json +8 -0
- package/lib/field/location/location.component.html +45 -0
- package/lib/field/location/location.component.scss +18 -0
- package/lib/field/location/location.component.spec.ts +22 -0
- package/lib/field/location/location.component.ts +385 -0
- package/lib/field/multiselect/multiselect.component.ts +56 -151
- package/lib/field/multiselect/utils.ts +55 -47
- package/lib/field/object-reference/object-reference.component.html +17 -0
- package/lib/field/object-reference/object-reference.component.scss +0 -0
- package/lib/field/object-reference/object-reference.component.spec.ts +22 -0
- package/lib/field/object-reference/object-reference.component.ts +237 -0
- package/lib/field/percentage/percentage.component.html +3 -3
- package/lib/field/percentage/percentage.component.ts +68 -161
- package/lib/field/phone/config-ext.json +1 -1
- package/lib/field/phone/phone.component.html +9 -6
- package/lib/field/phone/phone.component.scss +9 -0
- package/lib/field/phone/phone.component.ts +48 -159
- package/lib/field/radio-buttons/radio-buttons.component.html +17 -12
- package/lib/field/radio-buttons/radio-buttons.component.scss +4 -2
- package/lib/field/radio-buttons/radio-buttons.component.ts +39 -162
- package/lib/field/rich-text/rich-text.component.ts +32 -93
- package/lib/field/scalar-list/scalar-list.component.ts +20 -77
- package/lib/field/selectable-card/selectable-card.component.html +70 -0
- package/lib/field/selectable-card/selectable-card.component.scss +11 -0
- package/lib/field/selectable-card/selectable-card.component.spec.ts +22 -0
- package/lib/field/selectable-card/selectable-card.component.ts +219 -0
- package/lib/field/semantic-link/semantic-link.component.html +4 -8
- package/lib/field/semantic-link/semantic-link.component.scss +0 -13
- package/lib/field/semantic-link/semantic-link.component.ts +165 -6
- package/lib/field/text/text.component.scss +0 -1
- package/lib/field/text/text.component.ts +8 -5
- package/lib/field/text-area/text-area.component.html +4 -1
- package/lib/field/text-area/text-area.component.ts +30 -148
- package/lib/field/text-content/text-content.component.ts +0 -1
- package/lib/field/text-input/text-input.component.ts +28 -150
- package/lib/field/time/time.component.html +2 -2
- package/lib/field/time/time.component.ts +39 -145
- package/lib/field/url/url.component.ts +28 -149
- package/lib/field/user-reference/user-reference.component.html +40 -46
- package/lib/field/user-reference/user-reference.component.scss +0 -1
- package/lib/field/user-reference/user-reference.component.ts +110 -21
- package/lib/infra/Containers/flow-container/flow-container.component.html +1 -1
- package/lib/infra/Containers/flow-container/flow-container.component.ts +29 -54
- package/lib/infra/Containers/flow-container/helpers.ts +2 -2
- package/lib/infra/Containers/hybrid-view-container/hybrid-view-container.component.ts +0 -1
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.html +1 -11
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +6 -19
- package/lib/infra/Containers/preview-view-container/preview-view-container.component.ts +1 -1
- package/lib/infra/Containers/view-container/helper.ts +55 -0
- package/lib/infra/Containers/view-container/view-container.component.ts +6 -19
- package/lib/infra/action-buttons/action-buttons.component.html +13 -8
- package/lib/infra/action-buttons/action-buttons.component.scss +23 -0
- package/lib/infra/action-buttons/action-buttons.component.ts +1 -3
- package/lib/infra/assignment/assignment.component.html +1 -1
- package/lib/infra/assignment/assignment.component.ts +90 -47
- package/lib/infra/assignment-card/assignment-card.component.html +2 -2
- package/lib/infra/assignment-card/assignment-card.component.scss +0 -4
- package/lib/infra/assignment-card/assignment-card.component.ts +21 -5
- package/lib/infra/dashboard-filter/dashboard-filter.component.ts +0 -1
- package/lib/infra/defer-load/defer-load.component.html +6 -2
- package/lib/infra/defer-load/defer-load.component.ts +24 -16
- package/lib/infra/error-boundary/error-boundary.component.ts +0 -1
- package/lib/infra/multi-step/multi-step.component.scss +1 -21
- package/lib/infra/multi-step/multi-step.component.ts +0 -1
- package/lib/infra/navbar/navbar.component.html +25 -28
- package/lib/infra/navbar/navbar.component.scss +16 -4
- package/lib/infra/navbar/navbar.component.ts +11 -9
- package/lib/infra/reference/reference.component.ts +77 -90
- package/lib/infra/region/region.component.ts +0 -1
- package/lib/infra/root-container/root-container.component.html +2 -15
- package/lib/infra/root-container/root-container.component.scss +0 -1
- package/lib/infra/root-container/root-container.component.ts +28 -35
- package/lib/infra/stages/stages.component.html +2 -2
- package/lib/infra/stages/stages.component.scss +9 -37
- package/lib/infra/stages/stages.component.ts +4 -3
- package/lib/infra/view/view.component.html +7 -20
- package/lib/infra/view/view.component.ts +20 -5
- package/lib/template/advanced-search/advanced-search.component.html +12 -0
- package/lib/template/advanced-search/advanced-search.component.scss +0 -0
- package/lib/template/advanced-search/advanced-search.component.spec.ts +0 -0
- package/lib/template/advanced-search/advanced-search.component.ts +112 -0
- package/lib/template/advanced-search/advanced-search.service.ts +27 -0
- package/lib/template/advanced-search/search-group/persist-utils.ts +56 -0
- package/lib/template/advanced-search/search-groups/search-groups.component.html +32 -0
- package/lib/template/advanced-search/search-groups/search-groups.component.scss +0 -0
- package/lib/template/advanced-search/search-groups/search-groups.component.spec.ts +0 -0
- package/lib/template/advanced-search/search-groups/search-groups.component.ts +294 -0
- package/lib/template/advanced-search/search-groups/utils.ts +29 -0
- package/lib/template/app-shell/app-shell.component.html +4 -1
- package/lib/template/app-shell/app-shell.component.scss +0 -3
- package/lib/template/app-shell/app-shell.component.ts +66 -10
- package/lib/template/banner-page/banner-page.component.ts +0 -1
- package/lib/template/base/details-template-base.ts +67 -0
- package/lib/template/base/form-template-base.ts +16 -0
- package/lib/template/case-summary/case-summary.component.scss +0 -2
- package/lib/template/case-summary/case-summary.component.ts +7 -23
- package/lib/template/case-view/case-view.component.html +7 -7
- package/lib/template/case-view/case-view.component.scss +18 -10
- package/lib/template/case-view/case-view.component.ts +9 -15
- package/lib/template/confirmation/confirmation.component.html +1 -1
- package/lib/template/confirmation/confirmation.component.ts +1 -2
- package/lib/template/data-reference/data-reference-advanced-search.service.ts +16 -0
- package/lib/template/data-reference/data-reference.component.html +11 -8
- package/lib/template/data-reference/data-reference.component.ts +377 -148
- package/lib/template/data-reference/search-form/search-form.component.html +39 -0
- package/lib/template/data-reference/search-form/search-form.component.scss +11 -0
- package/lib/template/data-reference/search-form/search-form.component.spec.ts +0 -0
- package/lib/template/data-reference/search-form/search-form.component.ts +167 -0
- package/lib/template/data-reference/search-form/tabsData.ts +160 -0
- package/lib/template/data-reference/utils.ts +92 -0
- package/lib/template/default-form/default-form.component.html +0 -4
- package/lib/template/default-form/default-form.component.ts +50 -26
- package/lib/template/default-page/default-page.component.html +34 -0
- package/lib/template/default-page/default-page.component.scss +31 -0
- package/lib/template/default-page/default-page.component.spec.ts +24 -0
- package/lib/template/default-page/default-page.component.ts +64 -0
- package/lib/template/details/details.component.ts +7 -42
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +6 -40
- package/lib/template/details-one-column/details-one-column.component.ts +7 -43
- package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
- package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -38
- package/lib/template/details-three-column/details-three-column.component.ts +7 -44
- package/lib/template/details-two-column/details-two-column.component.ts +8 -45
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +7 -43
- package/lib/template/dynamic-tabs/dynamic-tabs.component.html +3 -0
- package/lib/template/dynamic-tabs/dynamic-tabs.component.ts +8 -4
- package/lib/template/field-group-list/field-group-list.component.scss +0 -1
- package/lib/template/field-group-list/field-group-list.component.ts +0 -1
- package/lib/template/field-group-template/field-group-template.component.html +7 -7
- package/lib/template/field-group-template/field-group-template.component.scss +8 -0
- package/lib/template/field-group-template/field-group-template.component.ts +68 -48
- package/lib/template/field-value-list/field-value-list.component.html +2 -2
- package/lib/template/field-value-list/field-value-list.component.scss +6 -1
- package/lib/template/field-value-list/field-value-list.component.ts +0 -1
- package/lib/template/inline-dashboard/inline-dashboard.component.ts +0 -1
- package/lib/template/inline-dashboard-page/inline-dashboard-page.component.ts +2 -3
- package/lib/template/list-page/list-page.component.ts +0 -1
- package/lib/template/list-view/list-view.component.html +14 -4
- package/lib/template/list-view/list-view.component.scss +30 -19
- package/lib/template/list-view/list-view.component.ts +179 -95
- package/lib/template/list-view/listViewHelpers.ts +4 -10
- package/lib/template/list-view/utils.ts +27 -7
- package/lib/template/multi-reference-readonly/multi-reference-readonly.component.ts +0 -1
- package/lib/template/narrow-wide-form/narrow-wide-form.component.ts +1 -2
- package/lib/template/object-page/object-page.component.html +1 -0
- package/lib/template/object-page/object-page.component.scss +0 -0
- package/lib/template/object-page/object-page.component.spec.ts +22 -0
- package/lib/template/object-page/object-page.component.ts +14 -0
- package/lib/template/one-column/one-column.component.ts +4 -4
- package/lib/template/one-column-page/one-column-page.component.ts +0 -1
- package/lib/template/one-column-tab/one-column-tab.component.scss +1 -1
- package/lib/template/one-column-tab/one-column-tab.component.ts +1 -2
- package/lib/template/page/page.component.ts +1 -2
- package/lib/template/promoted-filters/promoted-filters.component.ts +1 -2
- package/lib/template/repeating-structures/repeating-structures.component.ts +1 -3
- package/lib/template/self-service-case-view/self-service-case-view.component.html +80 -0
- package/lib/template/self-service-case-view/self-service-case-view.component.scss +124 -0
- package/lib/template/self-service-case-view/self-service-case-view.component.spec.ts +24 -0
- package/lib/template/self-service-case-view/self-service-case-view.component.ts +216 -0
- package/lib/template/simple-table/simple-table.component.ts +0 -2
- package/lib/template/simple-table-manual/helpers.ts +127 -11
- package/lib/template/simple-table-manual/simple-table-manual.component.html +27 -8
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +16 -17
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +118 -58
- package/lib/template/simple-table-select/simple-table-select.component.ts +3 -4
- package/lib/template/single-reference-readonly/single-reference-readonly.component.html +4 -1
- package/lib/template/single-reference-readonly/single-reference-readonly.component.scss +21 -0
- package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +104 -4
- package/lib/template/sub-tabs/sub-tabs.component.ts +0 -1
- package/lib/template/three-column/three-column.component.ts +4 -4
- package/lib/template/three-column-page/three-column-page.component.ts +0 -1
- package/lib/template/two-column/two-column.component.ts +4 -4
- package/lib/template/two-column-page/two-column-page.component.ts +0 -1
- package/lib/template/two-column-tab/two-column-tab.component.ts +1 -2
- package/lib/template/utils.ts +58 -0
- package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +4 -4
- package/lib/template/wide-narrow-page/wide-narrow-page.component.ts +1 -2
- package/lib/template/wss-nav-bar/wss-nav-bar.component.html +5 -4
- package/lib/template/wss-nav-bar/wss-nav-bar.component.scss +2 -8
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +3 -11
- package/lib/widget/app-announcement/app-announcement.component.html +1 -2
- package/lib/widget/app-announcement/app-announcement.component.scss +2 -2
- package/lib/widget/app-announcement/app-announcement.component.ts +0 -1
- package/lib/widget/attachment/Attachment.types.ts +92 -0
- package/lib/widget/attachment/AttachmentUtils.ts +287 -0
- package/lib/widget/attachment/attachment.component.html +3 -3
- package/lib/widget/attachment/attachment.component.scss +2 -5
- package/lib/widget/attachment/attachment.component.ts +256 -259
- package/lib/widget/case-history/case-history.component.ts +0 -1
- package/lib/widget/feed-container/feed-container.component.scss +3 -9
- package/lib/widget/feed-container/feed-container.component.ts +9 -12
- package/lib/widget/file-utility/file-utility.component.html +3 -3
- package/lib/widget/file-utility/file-utility.component.scss +5 -16
- package/lib/widget/file-utility/file-utility.component.ts +2 -6
- package/lib/widget/list-utility/list-utility.component.scss +3 -5
- package/lib/widget/list-utility/list-utility.component.ts +0 -1
- package/lib/widget/quick-create/quick-create.component.ts +0 -1
- package/lib/widget/todo/todo.component.html +13 -11
- package/lib/widget/todo/todo.component.scss +19 -11
- package/lib/widget/todo/todo.component.ts +101 -87
- package/lib/widget/utility/utility.component.ts +0 -1
- package/package.json +1 -1
|
File without changes
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { Component, forwardRef, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
|
2
|
+
import { FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { getFirstVisibleTabId, getActiveTabId, searchtabsClick } from '@pega/angular-sdk-components';
|
|
4
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
|
+
import { MatOptionModule } from '@angular/material/core';
|
|
8
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
9
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
10
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
11
|
+
import { MatDialog, MatDialogModule, MatDialogActions, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';
|
|
12
|
+
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
13
|
+
import { getTabCountSources, getData } from './tabsData';
|
|
14
|
+
import { getFieldMeta } from '@pega/angular-sdk-components';
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'app-search-form',
|
|
18
|
+
templateUrl: './search-form.component.html',
|
|
19
|
+
styleUrls: ['./search-form.component.scss'],
|
|
20
|
+
imports: [
|
|
21
|
+
CommonModule,
|
|
22
|
+
ReactiveFormsModule,
|
|
23
|
+
MatFormFieldModule,
|
|
24
|
+
MatRadioModule,
|
|
25
|
+
MatOptionModule,
|
|
26
|
+
MatSelectModule,
|
|
27
|
+
MatTabsModule,
|
|
28
|
+
MatDialogModule,
|
|
29
|
+
MatDialogActions,
|
|
30
|
+
MatDialogContent,
|
|
31
|
+
MatDialogTitle,
|
|
32
|
+
MatButtonModule,
|
|
33
|
+
forwardRef(() => ComponentMapperComponent)
|
|
34
|
+
]
|
|
35
|
+
})
|
|
36
|
+
export class SearchFormComponent implements OnInit, OnChanges {
|
|
37
|
+
@Input() pConn$: typeof PConnect;
|
|
38
|
+
@Input() formGroup$: FormGroup;
|
|
39
|
+
@Input() searchSelectCacheKey;
|
|
40
|
+
|
|
41
|
+
configProps$: any;
|
|
42
|
+
isInitialized = false;
|
|
43
|
+
|
|
44
|
+
currentTabId: string;
|
|
45
|
+
nextTabId: string;
|
|
46
|
+
openDialog = false;
|
|
47
|
+
tabItems: any[] = [];
|
|
48
|
+
searchCategoriesComp: any;
|
|
49
|
+
propsToUse: any;
|
|
50
|
+
tabData: any = [];
|
|
51
|
+
tabCountSources: any;
|
|
52
|
+
deferLoadedTabs: any;
|
|
53
|
+
@ViewChild('dialogTemplate') dialogTemplate!: TemplateRef<any>;
|
|
54
|
+
dialogRef: any;
|
|
55
|
+
constructor(private dialog: MatDialog) {}
|
|
56
|
+
|
|
57
|
+
ngOnInit(): void {
|
|
58
|
+
this.isInitialized = true;
|
|
59
|
+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
|
|
60
|
+
this.propsToUse = { ...this.pConn$.getInheritedProps() };
|
|
61
|
+
this.deferLoadedTabs = this.pConn$.getChildren()[2];
|
|
62
|
+
const cache: any = PCore.getNavigationUtils().getComponentCache(this.searchSelectCacheKey) ?? {};
|
|
63
|
+
const { selectedCategory } = cache;
|
|
64
|
+
const firstTabId = getFirstVisibleTabId(this.deferLoadedTabs, selectedCategory);
|
|
65
|
+
this.currentTabId = getActiveTabId(this.deferLoadedTabs.getPConnect().getChildren(), firstTabId);
|
|
66
|
+
this.updateSelf();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
ngOnChanges() {
|
|
70
|
+
if (this.isInitialized) {
|
|
71
|
+
this.updateSelf();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// updateSelf
|
|
76
|
+
updateSelf(): void {
|
|
77
|
+
this.tabCountSources = getTabCountSources(this.deferLoadedTabs);
|
|
78
|
+
this.tabData = getData(this.deferLoadedTabs, this.tabCountSources, this.currentTabId, this.tabData);
|
|
79
|
+
this.tabItems = this.tabData?.filter(tab => tab.visibility()) || [];
|
|
80
|
+
this.initializeSearchCategories();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
initializeSearchCategories(): void {
|
|
84
|
+
if (this.tabItems.length >= 3) {
|
|
85
|
+
this.searchCategoriesComp = 'dropdown';
|
|
86
|
+
} else if (this.tabItems.length > 1) {
|
|
87
|
+
this.searchCategoriesComp = 'radio';
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
handleTabClick(event) {
|
|
92
|
+
const tabId = event.target.value;
|
|
93
|
+
const viewName = this.tabData
|
|
94
|
+
.find((tab: any) => tab.id === this.currentTabId)
|
|
95
|
+
?.getPConnect()
|
|
96
|
+
.getConfigProps().name;
|
|
97
|
+
|
|
98
|
+
if (this.checkIfSelectionsExist(this.pConn$)) {
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
this.nextTabId = tabId;
|
|
101
|
+
this.dialogRef = this.dialog.open(this.dialogTemplate, {
|
|
102
|
+
width: '400px'
|
|
103
|
+
});
|
|
104
|
+
} else {
|
|
105
|
+
// @ts-ignore
|
|
106
|
+
this.publishEvent({ viewName, tabId });
|
|
107
|
+
this.currentTabId = tabId;
|
|
108
|
+
this.tabData = getData(this.deferLoadedTabs, this.tabCountSources, this.currentTabId, this.tabData);
|
|
109
|
+
this.tabItems = this.tabData?.filter(tab => tab.visibility()) || [];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
clearSelectionAndSwitchTab(): void {
|
|
114
|
+
const viewName = this.tabItems
|
|
115
|
+
.find((tab: any) => tab.id === this.currentTabId)
|
|
116
|
+
.getPConnect()
|
|
117
|
+
.getConfigProps().name;
|
|
118
|
+
|
|
119
|
+
this.publishEvent({ clearSelections: true, viewName });
|
|
120
|
+
searchtabsClick(this.nextTabId, this.tabData, this.currentTabId);
|
|
121
|
+
this.onDialogClose();
|
|
122
|
+
this.currentTabId = this.nextTabId;
|
|
123
|
+
this.tabData = getData(this.deferLoadedTabs, this.tabCountSources, this.currentTabId, this.tabData);
|
|
124
|
+
this.tabItems = this.tabData?.filter(tab => tab.visibility()) || [];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
onDialogClose(): void {
|
|
128
|
+
this.dialogRef.close();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
publishEvent({ clearSelections, viewName }) {
|
|
132
|
+
const payload: any = {};
|
|
133
|
+
|
|
134
|
+
if (clearSelections) {
|
|
135
|
+
payload.clearSelections = clearSelections;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (viewName) {
|
|
139
|
+
payload.viewName = viewName;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
PCore.getPubSubUtils().publish('update-advanced-search-selections', payload);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
get activeTabPConnect() {
|
|
146
|
+
const tabData = this.tabItems.find(tab => tab.id === this.currentTabId);
|
|
147
|
+
return tabData.content?.getPConnect();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
checkIfSelectionsExist(getPConnect) {
|
|
151
|
+
const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
|
|
152
|
+
const { selectionMode, readonlyContextList, contextPage, contextClass, name } = getPConnect.getConfigProps();
|
|
153
|
+
const isMultiSelectMode = selectionMode === MULTI;
|
|
154
|
+
|
|
155
|
+
const dataRelationshipContext = contextClass && name ? name : null;
|
|
156
|
+
|
|
157
|
+
const { compositeKeys } = getFieldMeta(getPConnect, dataRelationshipContext);
|
|
158
|
+
|
|
159
|
+
let selectionsExist = false;
|
|
160
|
+
if (isMultiSelectMode) {
|
|
161
|
+
selectionsExist = readonlyContextList?.length > 0;
|
|
162
|
+
} else if (contextPage) {
|
|
163
|
+
selectionsExist = compositeKeys?.filter(key => !['', null, undefined].includes(contextPage[key]))?.length > 0;
|
|
164
|
+
}
|
|
165
|
+
return selectionsExist;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { getTabLabel } from '@pega/angular-sdk-components';
|
|
2
|
+
|
|
3
|
+
export function getTabCountSources(deferLoadedTabs) {
|
|
4
|
+
const availableTabs = deferLoadedTabs.getPConnect().getChildren() || [];
|
|
5
|
+
const viewName = deferLoadedTabs?.getPConnect()?.options?.viewName || null;
|
|
6
|
+
return availableTabs.reduce(
|
|
7
|
+
(prev, tab, index) => {
|
|
8
|
+
const config = tab.getPConnect().getConfigProps();
|
|
9
|
+
const { value: showTabCount } = config.inheritedProps?.find(item => item.prop === 'showTabCount') || {};
|
|
10
|
+
const { value } = config.inheritedProps?.find(item => item.prop === 'count') || {};
|
|
11
|
+
const tabCountSource = config.inheritedProps?.find(item => item.prop === 'tabCount');
|
|
12
|
+
const name = getTabLabel(tab.getPConnect());
|
|
13
|
+
const tabId = `${viewName}-${config.name || name}-${index}`;
|
|
14
|
+
if (showTabCount) {
|
|
15
|
+
if (tabCountSource?.value?.fields?.count) {
|
|
16
|
+
const isPrefixedByDot = tabCountSource.value.fields.count.substring(0, 1) === '.';
|
|
17
|
+
return {
|
|
18
|
+
...prev,
|
|
19
|
+
dataPageSources: [
|
|
20
|
+
...prev.dataPageSources,
|
|
21
|
+
{
|
|
22
|
+
dataPageName: tabCountSource.value.source,
|
|
23
|
+
tabId,
|
|
24
|
+
tabCountProp: isPrefixedByDot ? tabCountSource.value.fields.count.substring(1) : tabCountSource.value.fields.count,
|
|
25
|
+
dataViewParameters: tabCountSource.value?.parameters || {}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (Number.isInteger(value) && value % 1 === 0) {
|
|
31
|
+
return {
|
|
32
|
+
...prev,
|
|
33
|
+
calculatedFields: [
|
|
34
|
+
...prev.calculatedFields,
|
|
35
|
+
{
|
|
36
|
+
count: value,
|
|
37
|
+
context: tab.getPConnect().getContextName(),
|
|
38
|
+
tabId
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (value?.isDeferred) {
|
|
44
|
+
return {
|
|
45
|
+
...prev,
|
|
46
|
+
calculatedFields: [
|
|
47
|
+
...prev.calculatedFields,
|
|
48
|
+
{
|
|
49
|
+
propertyName: value.propertyName,
|
|
50
|
+
context: 'content',
|
|
51
|
+
tabId
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return prev;
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
dataPageSources: [],
|
|
61
|
+
calculatedFields: []
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function tabContent(id, index, overideTabContent, tab, data, currentTabId, template) {
|
|
67
|
+
if (id === currentTabId || template === 'HierarchicalForm') {
|
|
68
|
+
if (overideTabContent) {
|
|
69
|
+
return tab.getPConnect().getComponent();
|
|
70
|
+
}
|
|
71
|
+
if (data[index]?.content) {
|
|
72
|
+
return data[index]?.content;
|
|
73
|
+
}
|
|
74
|
+
return tab.getPConnect().getComponent();
|
|
75
|
+
}
|
|
76
|
+
if (template !== 'HierarchicalForm') {
|
|
77
|
+
return overideTabContent ? null : data[index]?.content;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function getTabsData(deferLoadedTabs, countMetadata, currentTabId, data) {
|
|
82
|
+
const availableTabs = deferLoadedTabs.getPConnect().getChildren() || [];
|
|
83
|
+
const viewName = deferLoadedTabs?.getPConnect()?.options?.viewName || null;
|
|
84
|
+
return availableTabs.map((tab, index) => {
|
|
85
|
+
const config = tab.getPConnect().getConfigProps();
|
|
86
|
+
const name = getTabLabel(tab.getPConnect());
|
|
87
|
+
const tabId = `${viewName}-${config.name || name}-${index}`;
|
|
88
|
+
const count = countMetadata.find(item => item.tabId === tabId)?.count;
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
name,
|
|
92
|
+
id: tabId,
|
|
93
|
+
getPConnect: tab.getPConnect,
|
|
94
|
+
content: tabContent(tabId, index, '', tab, data, currentTabId, ''),
|
|
95
|
+
loaded: tabId === currentTabId || Boolean(data[index]?.content),
|
|
96
|
+
visibility: () => {
|
|
97
|
+
const tabConfig = tab.getPConnect().getConfigProps();
|
|
98
|
+
const isVisible = !('visibility' in tabConfig) || tabConfig.visibility === true;
|
|
99
|
+
if (!isVisible) {
|
|
100
|
+
tab.getPConnect().removeNode();
|
|
101
|
+
}
|
|
102
|
+
return isVisible;
|
|
103
|
+
},
|
|
104
|
+
count
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function getData(deferLoadedTabs, tabCountSources, currentTabId, data) {
|
|
110
|
+
let countMetadata;
|
|
111
|
+
let tabData;
|
|
112
|
+
const pConn = deferLoadedTabs.getPConnect();
|
|
113
|
+
const { dataPageSources, calculatedFields } = tabCountSources;
|
|
114
|
+
const calculatedFieldsWithoutValue = calculatedFields.filter(item => item.propertyName);
|
|
115
|
+
if (dataPageSources.length) {
|
|
116
|
+
Promise.all(dataPageSources.map(item => PCore.getDataPageUtils().getPageDataAsync(item.dataPageName, '', item.dataViewParameters)))
|
|
117
|
+
.then(res => {
|
|
118
|
+
const temp = res.map((r, index) => ({
|
|
119
|
+
...dataPageSources[index],
|
|
120
|
+
count: r[dataPageSources[index].tabCountProp]
|
|
121
|
+
}));
|
|
122
|
+
countMetadata = temp;
|
|
123
|
+
tabData = getTabsData(deferLoadedTabs, countMetadata, currentTabId, data);
|
|
124
|
+
})
|
|
125
|
+
.catch(err => {
|
|
126
|
+
console.log(err);
|
|
127
|
+
});
|
|
128
|
+
} else if (calculatedFieldsWithoutValue.length) {
|
|
129
|
+
PCore.getViewRuleApi()
|
|
130
|
+
// @ts-ignore
|
|
131
|
+
.getCalculatedFields(
|
|
132
|
+
pConn.getCaseInfo().getKey(),
|
|
133
|
+
pConn.getCurrentView(),
|
|
134
|
+
calculatedFieldsWithoutValue.map(({ propertyName, context }) => ({
|
|
135
|
+
name: propertyName,
|
|
136
|
+
context
|
|
137
|
+
}))
|
|
138
|
+
)
|
|
139
|
+
.then(res => {
|
|
140
|
+
const values = (res?.data as any)?.caseInfo?.content || {};
|
|
141
|
+
const temp = calculatedFields.map(field => ({
|
|
142
|
+
...field,
|
|
143
|
+
count: values[field.propertyName?.substring(1)] || field.count
|
|
144
|
+
}));
|
|
145
|
+
countMetadata = temp;
|
|
146
|
+
tabData = getTabsData(deferLoadedTabs, countMetadata, currentTabId, data);
|
|
147
|
+
})
|
|
148
|
+
.catch(err => {
|
|
149
|
+
console.log(err);
|
|
150
|
+
});
|
|
151
|
+
} else {
|
|
152
|
+
countMetadata = calculatedFields.map(field => ({
|
|
153
|
+
...field,
|
|
154
|
+
count: field.count
|
|
155
|
+
}));
|
|
156
|
+
tabData = getTabsData(deferLoadedTabs, countMetadata, currentTabId, data);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return tabData;
|
|
160
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const isSelfReferencedProperty = (param, referenceProp) => {
|
|
2
|
+
const [, parentPropName] = param.split('.');
|
|
3
|
+
const referencePropParent = referenceProp?.split('.').pop();
|
|
4
|
+
return parentPropName === referencePropParent;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function getFieldMeta(getPConnect, dataRelationshipContext) {
|
|
8
|
+
const pConn = getPConnect;
|
|
9
|
+
const { selectionMode, selectionList } = pConn.getConfigProps();
|
|
10
|
+
const { MULTI } = PCore.getConstants().LIST_SELECTION_MODE;
|
|
11
|
+
|
|
12
|
+
const isMultiSelectMode = selectionMode === MULTI;
|
|
13
|
+
|
|
14
|
+
const pageReference = pConn.getPageReference();
|
|
15
|
+
let referenceProp = isMultiSelectMode ? selectionList.substring(1) : pageReference.substring(pageReference.lastIndexOf('.') + 1);
|
|
16
|
+
// Replace here to use the context name instead
|
|
17
|
+
let contextPageReference = null;
|
|
18
|
+
if (dataRelationshipContext !== null && selectionMode === 'single') {
|
|
19
|
+
referenceProp = dataRelationshipContext;
|
|
20
|
+
contextPageReference = pageReference.concat('.').concat(referenceProp);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const fieldMetadata =
|
|
24
|
+
(isMultiSelectMode ? pConn.getFieldMetadata(`${referenceProp}`) : pConn.getCurrentPageFieldMetadata(contextPageReference)) ?? {};
|
|
25
|
+
const { datasource: { parameters: fieldParameters = {} } = {} } = fieldMetadata;
|
|
26
|
+
const compositeKeys: any = [];
|
|
27
|
+
Object.values(fieldParameters).forEach((param: any) => {
|
|
28
|
+
if (isSelfReferencedProperty(param, referenceProp)) {
|
|
29
|
+
compositeKeys.push(param.substring(param.lastIndexOf('.') + 1));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return { compositeKeys, fieldMetadata };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* returns array of self-referenced properties of the datasource
|
|
38
|
+
* Ex: returns ["@P .DataRef.pyGUID", "@P .DataRef.customerID"]
|
|
39
|
+
*/
|
|
40
|
+
const getCompositeKeys = (pConnect, property) => {
|
|
41
|
+
const fieldMetadata = pConnect.getFieldMetadata(property) || {};
|
|
42
|
+
const { datasource: { parameters: fieldParameters = {} } = {} } = fieldMetadata;
|
|
43
|
+
const compositeKeys: any = [];
|
|
44
|
+
Object.values(fieldParameters).forEach(param => {
|
|
45
|
+
if (isSelfReferencedProperty(param, property)) {
|
|
46
|
+
compositeKeys.push(param);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return compositeKeys;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const getFirstChildConfig = ({
|
|
53
|
+
firstChildMeta,
|
|
54
|
+
getPConnect,
|
|
55
|
+
rawViewMetadata,
|
|
56
|
+
contextClass,
|
|
57
|
+
dataReferenceConfigToChild,
|
|
58
|
+
isCreateNewReferenceEnabled,
|
|
59
|
+
disableStartingFieldsForReference,
|
|
60
|
+
pyID
|
|
61
|
+
}) => {
|
|
62
|
+
const config = {
|
|
63
|
+
...firstChildMeta.config,
|
|
64
|
+
...dataReferenceConfigToChild
|
|
65
|
+
};
|
|
66
|
+
const compositeKeys = getCompositeKeys(getPConnect, dataReferenceConfigToChild?.dataRelationshipContext);
|
|
67
|
+
return {
|
|
68
|
+
...config,
|
|
69
|
+
viewName: getPConnect.getCurrentView(),
|
|
70
|
+
referenceList: config.referenceList ?? rawViewMetadata.config.referenceList,
|
|
71
|
+
parameters: rawViewMetadata.config.parameters,
|
|
72
|
+
localeReference: rawViewMetadata.config.localeReference,
|
|
73
|
+
contextClass: config.contextClass || rawViewMetadata?.config?.contextClass || rawViewMetadata?.config?.targetObjectClass,
|
|
74
|
+
allowAddingNewRecords: firstChildMeta.type === 'SimpleTableSelect' && isCreateNewReferenceEnabled ? true : undefined,
|
|
75
|
+
actions: firstChildMeta.type === 'SimpleTableSelect' &&
|
|
76
|
+
isCreateNewReferenceEnabled && [
|
|
77
|
+
{
|
|
78
|
+
action: 'ADD_CASE',
|
|
79
|
+
config: {
|
|
80
|
+
label: '@L Add',
|
|
81
|
+
caseType: contextClass,
|
|
82
|
+
inputFields: disableStartingFieldsForReference
|
|
83
|
+
? {}
|
|
84
|
+
: {
|
|
85
|
+
[`.pyAddCaseContextPage.${pyID}`]: `@P .${pyID}`
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
compositeKeys
|
|
91
|
+
};
|
|
92
|
+
};
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
<!-- When adding a component here, add the same component in 'region' template as well -->
|
|
2
|
-
<div *ngIf="!NO_HEADER_TEMPLATES.includes(template) && showLabel">
|
|
3
|
-
<div class="template-title-container">{{ label }}</div>
|
|
4
|
-
</div>
|
|
5
1
|
<div *ngIf="instructions" class="psdk-default-form-instruction-text">
|
|
6
2
|
<div key="instructions" id="instruction-text" [innerHTML]="instructions"></div>
|
|
7
3
|
</div>
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { Component, OnInit, Input, forwardRef } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, Input, forwardRef, OnChanges } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
|
+
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
4
5
|
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
5
6
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
6
7
|
import { TemplateUtils } from '@pega/angular-sdk-components';
|
|
8
|
+
import { FormTemplateBase } from '@pega/angular-sdk-components';
|
|
9
|
+
|
|
10
|
+
function areViewsChanged(oldViews: any[], newViews: any[]): boolean {
|
|
11
|
+
if (oldViews?.length !== newViews?.length) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return !oldViews?.every((oldView, index) => {
|
|
16
|
+
const newView = newViews[index];
|
|
17
|
+
return oldView.getPConnect().viewName === newView.getPConnect().viewName;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
7
20
|
|
|
8
21
|
interface DefaultFormProps {
|
|
9
22
|
// If any, enter additional props that only exist on this component
|
|
10
23
|
NumCols: string;
|
|
11
|
-
template: string;
|
|
12
24
|
instructions: string;
|
|
13
25
|
}
|
|
14
26
|
|
|
@@ -16,40 +28,48 @@ interface DefaultFormProps {
|
|
|
16
28
|
selector: 'app-default-form',
|
|
17
29
|
templateUrl: './default-form.component.html',
|
|
18
30
|
styleUrls: ['./default-form.component.scss'],
|
|
19
|
-
standalone: true,
|
|
20
31
|
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
21
32
|
})
|
|
22
|
-
export class DefaultFormComponent implements OnInit {
|
|
23
|
-
@Input() pConn$: typeof PConnect;
|
|
33
|
+
export class DefaultFormComponent extends FormTemplateBase implements OnInit, OnChanges {
|
|
34
|
+
@Input() override pConn$: typeof PConnect;
|
|
24
35
|
@Input() formGroup$: FormGroup;
|
|
25
36
|
|
|
37
|
+
// Used with AngularPConnect
|
|
38
|
+
override angularPConnectData: AngularPConnectData = {};
|
|
39
|
+
|
|
26
40
|
arChildren$: any[];
|
|
27
41
|
divClass$: string;
|
|
28
|
-
template: any;
|
|
29
|
-
showLabel: any;
|
|
30
|
-
label: any;
|
|
31
42
|
instructions: string;
|
|
32
43
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'NarrowWideDetails',
|
|
40
|
-
'WideNarrowDetails',
|
|
41
|
-
'Confirmation'
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
constructor(private templateUtils: TemplateUtils) {}
|
|
44
|
+
constructor(
|
|
45
|
+
private angularPConnect: AngularPConnectService,
|
|
46
|
+
private templateUtils: TemplateUtils
|
|
47
|
+
) {
|
|
48
|
+
super();
|
|
49
|
+
}
|
|
45
50
|
|
|
46
51
|
ngOnInit(): void {
|
|
52
|
+
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
53
|
+
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
54
|
+
|
|
55
|
+
this.updateSelf();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
onStateChange() {
|
|
59
|
+
this.updateSelf();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ngOnChanges(changes) {
|
|
63
|
+
const { pConn$ } = changes;
|
|
64
|
+
|
|
65
|
+
if (pConn$.previousValue && !PCore.isDeepEqual(pConn$.previousValue.getConfigProps(), pConn$.currentValue.getConfigProps())) {
|
|
66
|
+
this.updateSelf();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
updateSelf() {
|
|
47
71
|
const configProps = this.pConn$.getConfigProps() as DefaultFormProps;
|
|
48
|
-
|
|
49
|
-
const propToUse: any = { ...this.pConn$.getInheritedProps() };
|
|
50
|
-
this.showLabel = propToUse?.showLabel;
|
|
51
|
-
this.label = propToUse?.label;
|
|
52
|
-
const kids = this.pConn$.getChildren() as any[];
|
|
72
|
+
const kids = this.pConn$.getChildren();
|
|
53
73
|
this.instructions = this.templateUtils.getInstructions(this.pConn$, configProps?.instructions);
|
|
54
74
|
|
|
55
75
|
const numCols = configProps.NumCols ? configProps.NumCols : '1';
|
|
@@ -71,6 +91,10 @@ export class DefaultFormComponent implements OnInit {
|
|
|
71
91
|
// repoint children before getting templateArray
|
|
72
92
|
// Children may contain 'reference' component, so we need to
|
|
73
93
|
// normalize them
|
|
74
|
-
|
|
94
|
+
const children = ReferenceComponent.normalizePConnArray(kids[0].getPConnect().getChildren());
|
|
95
|
+
|
|
96
|
+
if (areViewsChanged(this.arChildren$, children)) {
|
|
97
|
+
this.arChildren$ = children;
|
|
98
|
+
}
|
|
75
99
|
}
|
|
76
100
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<div *ngIf="enableBanner$; else nonBannerMode">
|
|
2
|
+
<component-mapper
|
|
3
|
+
name="Banner"
|
|
4
|
+
[props]="{
|
|
5
|
+
configProps$,
|
|
6
|
+
arChildren$,
|
|
7
|
+
title: heading,
|
|
8
|
+
message,
|
|
9
|
+
backgroundImage,
|
|
10
|
+
layout$
|
|
11
|
+
}"
|
|
12
|
+
></component-mapper>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<ng-template #nonBannerMode>
|
|
16
|
+
<div>
|
|
17
|
+
<h1 *ngIf="title">{{ title }}</h1>
|
|
18
|
+
<p *ngIf="heading">{{ heading }}</p>
|
|
19
|
+
<div
|
|
20
|
+
[ngClass]="{
|
|
21
|
+
'psdk-grid-filter-1': this.layout$ === 'one-column',
|
|
22
|
+
'psdk-grid-filter-2': this.layout$ === 'two-column',
|
|
23
|
+
'psdk-grid-filter-wide-narrow': this.layout$ === 'wide-narrow',
|
|
24
|
+
'psdk-grid-filter-narrow-wide': this.layout$ === 'narrow-wide'
|
|
25
|
+
}"
|
|
26
|
+
>
|
|
27
|
+
<component-mapper
|
|
28
|
+
*ngFor="let child of arChildren$"
|
|
29
|
+
[name]="child.getPConnect().getComponentName()"
|
|
30
|
+
[props]="{ pConn$: child.getPConnect() }"
|
|
31
|
+
></component-mapper>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</ng-template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.psdk-grid-filter-1 {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
4
|
+
column-gap: calc(2 * 0.5rem);
|
|
5
|
+
row-gap: calc(2 * 0.5rem);
|
|
6
|
+
align-items: start;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.psdk-grid-filter-2 {
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
12
|
+
column-gap: calc(2 * 0.5rem);
|
|
13
|
+
row-gap: calc(2 * 0.5rem);
|
|
14
|
+
align-items: start;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.psdk-grid-filter-wide-narrow {
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-template-columns: 7fr 3fr;
|
|
20
|
+
column-gap: calc(2 * 0.5rem);
|
|
21
|
+
row-gap: calc(2 * 0.5rem);
|
|
22
|
+
align-items: start;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.psdk-grid-filter-narrow-wide {
|
|
26
|
+
display: grid;
|
|
27
|
+
grid-template-columns: 3fr 7fr;
|
|
28
|
+
column-gap: calc(2 * 0.5rem);
|
|
29
|
+
row-gap: calc(2 * 0.5rem);
|
|
30
|
+
align-items: start;
|
|
31
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { DefaultPageComponent } from './default-page.component';
|
|
4
|
+
|
|
5
|
+
describe('DefaultPageComponent', () => {
|
|
6
|
+
let component: DefaultPageComponent;
|
|
7
|
+
let fixture: ComponentFixture<DefaultPageComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(waitForAsync(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [DefaultPageComponent]
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(DefaultPageComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|