@pega/angular-sdk-overrides 0.242.7 → 0.242.8
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/material-case-summary/material-case-summary.component.ts +0 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +1 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +6 -0
- package/lib/designSystemExtension/operator/operator.component.html +1 -1
- package/lib/designSystemExtension/operator/operator.component.scss +10 -2
- package/lib/designSystemExtension/operator/operator.component.ts +4 -3
- package/lib/field/currency/currency.component.ts +19 -13
- package/lib/field/date-time/date-time.component.html +0 -1
- package/lib/field/date-time/date-time.component.ts +17 -3
- package/lib/field/decimal/decimal.component.html +1 -0
- package/lib/field/decimal/decimal.component.ts +38 -15
- package/lib/field/dropdown/dropdown.component.ts +18 -3
- package/lib/field/list-view-action-buttons/list-view-action-buttons.component.html +1 -1
- package/lib/field/percentage/percentage.component.html +1 -1
- package/lib/field/percentage/percentage.component.ts +27 -17
- package/lib/field/phone/phone.component.ts +6 -13
- package/lib/field/rich-text/rich-text.component.ts +12 -3
- package/lib/field/text/text.component.ts +2 -2
- package/lib/field/text-input/text-input.component.ts +1 -1
- package/lib/field/time/time.component.html +1 -1
- package/lib/field/time/time.component.ts +21 -6
- package/lib/field/user-reference/user-reference.component.html +40 -38
- package/lib/field/user-reference/user-reference.component.ts +66 -7
- package/lib/infra/Containers/flow-container/flow-container.component.ts +7 -2
- package/lib/infra/Containers/flow-container/helpers.ts +1 -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 +0 -1
- package/lib/infra/action-buttons/action-buttons.component.html +1 -1
- package/lib/infra/assignment/assignment.component.ts +2 -4
- package/lib/infra/assignment-card/assignment-card.component.ts +4 -32
- package/lib/infra/defer-load/defer-load.component.ts +4 -1
- package/lib/infra/reference/reference.component.ts +70 -86
- package/lib/infra/root-container/root-container.component.ts +24 -17
- package/lib/template/default-form/default-form.component.ts +5 -7
- 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 +64 -41
- package/lib/template/field-group-template/utils.ts +9 -0
- package/lib/template/field-value-list/field-value-list.component.html +2 -2
- package/lib/template/field-value-list/field-value-list.component.scss +4 -0
- package/lib/template/list-view/list-view.component.html +3 -1
- package/lib/template/list-view/list-view.component.ts +1 -1
- package/lib/template/simple-table-manual/helpers.ts +18 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.html +25 -6
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +7 -3
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +62 -22
- package/lib/widget/todo/todo.component.html +0 -1
- package/lib/widget/todo/todo.component.scss +2 -0
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Component, OnInit, Input, NgZone, forwardRef, OnDestroy } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, Input, NgZone, forwardRef, OnDestroy, inject } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
4
4
|
import { interval, Subscription } from 'rxjs';
|
|
5
5
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
6
|
+
import { ServerConfigService } from '@pega/angular-sdk-components';
|
|
6
7
|
import { ProgressSpinnerService } from '@pega/angular-sdk-components';
|
|
7
8
|
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
8
9
|
import { PreviewViewContainerComponent } from '@pega/angular-sdk-components';
|
|
@@ -37,6 +38,8 @@ export class RootContainerComponent implements OnInit, OnDestroy {
|
|
|
37
38
|
@Input() displayOnlyFA$: boolean;
|
|
38
39
|
@Input() isMashup$: boolean;
|
|
39
40
|
|
|
41
|
+
scService = inject(ServerConfigService);
|
|
42
|
+
|
|
40
43
|
// For interaction with AngularPConnect
|
|
41
44
|
angularPConnectData: AngularPConnectData = {};
|
|
42
45
|
|
|
@@ -62,8 +65,6 @@ export class RootContainerComponent implements OnInit, OnDestroy {
|
|
|
62
65
|
) {}
|
|
63
66
|
|
|
64
67
|
ngOnInit(): void {
|
|
65
|
-
const myContext = 'app';
|
|
66
|
-
|
|
67
68
|
const { containers } = PCore.getStore().getState();
|
|
68
69
|
const items = Object.keys(containers).filter(item => item.includes('root'));
|
|
69
70
|
|
|
@@ -84,24 +85,11 @@ export class RootContainerComponent implements OnInit, OnDestroy {
|
|
|
84
85
|
|
|
85
86
|
this.pvConn$ = configObjPreview.getPConnect();
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
meta: {
|
|
89
|
-
type: 'ModalViewContainer',
|
|
90
|
-
config: {
|
|
91
|
-
name: 'modal'
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
options: {
|
|
95
|
-
pageReference: 'pyPortal',
|
|
96
|
-
context: myContext
|
|
97
|
-
}
|
|
98
|
-
});
|
|
88
|
+
this.configureModalContainer();
|
|
99
89
|
|
|
100
90
|
// clear out hasViewContainer
|
|
101
91
|
sessionStorage.setItem('hasViewContainer', 'false');
|
|
102
92
|
|
|
103
|
-
this.mConn$ = configObjModal.getPConnect();
|
|
104
|
-
|
|
105
93
|
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
106
94
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
107
95
|
|
|
@@ -181,6 +169,25 @@ export class RootContainerComponent implements OnInit, OnDestroy {
|
|
|
181
169
|
}
|
|
182
170
|
}
|
|
183
171
|
|
|
172
|
+
async configureModalContainer() {
|
|
173
|
+
const sdkConfig = await this.scService.getSdkConfig();
|
|
174
|
+
const showModalsInEmbedMode = sdkConfig.serverConfig.showModalsInEmbedMode;
|
|
175
|
+
|
|
176
|
+
if (!this.displayOnlyFA$ || showModalsInEmbedMode) {
|
|
177
|
+
const configObjModal = PCore.createPConnect({
|
|
178
|
+
meta: {
|
|
179
|
+
type: 'ModalViewContainer',
|
|
180
|
+
config: {
|
|
181
|
+
name: 'modal'
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
options
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
this.mConn$ = configObjModal.getPConnect();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
184
191
|
generateViewContainerForNoPortal() {
|
|
185
192
|
// bootstrap loadMashup resolves to here
|
|
186
193
|
const arChildren = this.pConn$.getChildren() as any[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Component, OnInit, Input, forwardRef
|
|
1
|
+
import { Component, OnInit, Input, forwardRef } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
|
-
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
5
4
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
5
|
+
import { ReferenceComponent } from '@pega/angular-sdk-components';
|
|
6
6
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
7
7
|
import { TemplateUtils } from '@pega/angular-sdk-components';
|
|
8
8
|
import { FormTemplateBase } from '@pega/angular-sdk-components';
|
|
@@ -31,7 +31,7 @@ interface DefaultFormProps {
|
|
|
31
31
|
standalone: true,
|
|
32
32
|
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
33
33
|
})
|
|
34
|
-
export class DefaultFormComponent extends FormTemplateBase implements OnInit
|
|
34
|
+
export class DefaultFormComponent extends FormTemplateBase implements OnInit {
|
|
35
35
|
@Input() override pConn$: typeof PConnect;
|
|
36
36
|
@Input() formGroup$: FormGroup;
|
|
37
37
|
|
|
@@ -86,10 +86,8 @@ export class DefaultFormComponent extends FormTemplateBase implements OnInit, On
|
|
|
86
86
|
// normalize them
|
|
87
87
|
const children = ReferenceComponent.normalizePConnArray(kids[0].getPConnect().getChildren());
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (areViewsChanged(this.arChildren$, visibleChildren)) {
|
|
92
|
-
this.arChildren$ = visibleChildren;
|
|
89
|
+
if (areViewsChanged(this.arChildren$, children)) {
|
|
90
|
+
this.arChildren$ = children;
|
|
93
91
|
}
|
|
94
92
|
}
|
|
95
93
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div id="field-group">
|
|
2
|
-
<h3 *ngIf="showLabel$"
|
|
2
|
+
<h3 *ngIf="showLabel$" class="field-group-template-header" style="font-weight: bold">
|
|
3
3
|
{{ label$ }}
|
|
4
4
|
</h3>
|
|
5
5
|
<div *ngIf="readonlyMode; else editable">
|
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
<ng-template #editable>
|
|
13
13
|
<div *ngIf="children && children.length > 0">
|
|
14
|
-
<div *ngFor="let
|
|
14
|
+
<div class="field-group-template-item" *ngFor="let child of children; let i = index">
|
|
15
15
|
<div class="header-div">
|
|
16
16
|
<div style="width: 80%">
|
|
17
|
-
<b>{{
|
|
17
|
+
<b>{{ child.name }}</b>
|
|
18
18
|
</div>
|
|
19
|
-
<div *ngIf="
|
|
19
|
+
<div *ngIf="allowDelete && child.allowRowDelete" style="width: 20%; text-align: right">
|
|
20
20
|
<button id="delete-button" mat-icon-button (click)="deleteFieldGroupItem(i)">
|
|
21
21
|
<img class="psdk-utility-card-action-svg-icon" src="{{ menuIconOverride$ }}" />
|
|
22
22
|
</button>
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
|
-
<div *ngIf="
|
|
27
|
-
<component-mapper name="Region" [props]="{ pConn$:
|
|
26
|
+
<div *ngIf="child.children.getPConnect().getRawMetadata().type.toLowerCase() == 'region'">
|
|
27
|
+
<component-mapper name="Region" [props]="{ pConn$: child.children.getPConnect(), formGroup$ }"></component-mapper>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
|
-
<button *ngIf="allowAddEdit !== false" mat-button color="primary" style="font-size: 16px" (click)="addFieldGroupItem()">+ Add</button>
|
|
31
30
|
</div>
|
|
31
|
+
<button *ngIf="allowAdd" mat-button color="primary" style="font-size: 16px" (click)="addFieldGroupItem()">{{ getAddBtnLabel() }}</button>
|
|
32
32
|
</ng-template>
|
|
33
33
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges } from '@angular/core';
|
|
1
|
+
import { Component, OnInit, Input, forwardRef, OnDestroy, OnChanges, AfterViewInit } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { MatButtonModule } from '@angular/material/button';
|
|
@@ -6,11 +6,14 @@ import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-c
|
|
|
6
6
|
import { buildView, getReferenceList } from '@pega/angular-sdk-components';
|
|
7
7
|
import { Utils } from '@pega/angular-sdk-components';
|
|
8
8
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
9
|
+
import { evaluateAllowRowAction } from './utils';
|
|
9
10
|
|
|
10
11
|
interface FieldGroupTemplateProps {
|
|
11
12
|
// If any, enter additional props that only exist on this component
|
|
12
13
|
label?: string;
|
|
13
|
-
|
|
14
|
+
hideLabel?: boolean;
|
|
15
|
+
allowActions?: any;
|
|
16
|
+
allowRowDelete?: any;
|
|
14
17
|
referenceList?: any[];
|
|
15
18
|
contextClass: string;
|
|
16
19
|
renderMode?: string;
|
|
@@ -19,6 +22,7 @@ interface FieldGroupTemplateProps {
|
|
|
19
22
|
displayMode?: string;
|
|
20
23
|
fieldHeader?: string;
|
|
21
24
|
allowTableEdit: boolean;
|
|
25
|
+
targetClassLabel?: string;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
@Component({
|
|
@@ -28,26 +32,27 @@ interface FieldGroupTemplateProps {
|
|
|
28
32
|
standalone: true,
|
|
29
33
|
imports: [CommonModule, MatButtonModule, forwardRef(() => ComponentMapperComponent)]
|
|
30
34
|
})
|
|
31
|
-
export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges {
|
|
35
|
+
export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
|
|
32
36
|
@Input() configProps$: FieldGroupTemplateProps;
|
|
33
37
|
@Input() pConn$: typeof PConnect;
|
|
34
38
|
@Input() formGroup$: FormGroup;
|
|
35
39
|
|
|
36
40
|
angularPConnectData: AngularPConnectData = {};
|
|
37
|
-
|
|
41
|
+
|
|
38
42
|
showLabel$?: boolean = true;
|
|
39
43
|
label$?: string;
|
|
40
44
|
readonlyMode: boolean;
|
|
41
45
|
contextClass: any;
|
|
42
|
-
referenceList: any;
|
|
43
|
-
pageReference: any;
|
|
44
46
|
heading: any;
|
|
45
47
|
children: any;
|
|
46
48
|
menuIconOverride$: any;
|
|
47
|
-
|
|
48
|
-
allowAddEdit: boolean;
|
|
49
|
+
referenceListLength: number;
|
|
49
50
|
fieldHeader: any;
|
|
50
51
|
|
|
52
|
+
allowAdd = true;
|
|
53
|
+
allowEdit = true;
|
|
54
|
+
allowDelete = true;
|
|
55
|
+
|
|
51
56
|
constructor(
|
|
52
57
|
private angularPConnect: AngularPConnectService,
|
|
53
58
|
private utils: Utils
|
|
@@ -58,9 +63,21 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
58
63
|
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
59
64
|
this.updateSelf();
|
|
60
65
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
this.menuIconOverride$ = this.utils.getImageSrc('trash', this.utils.getSDKStaticContentUrl());
|
|
67
|
+
|
|
68
|
+
const { allowActions, allowTableEdit, referenceList } = this.configProps$;
|
|
69
|
+
|
|
70
|
+
if (allowActions && Object.keys(allowActions).length > 0) {
|
|
71
|
+
this.allowAdd = allowActions.allowAdd ?? allowTableEdit ?? true;
|
|
72
|
+
this.allowEdit = allowActions.allowEdit ?? true;
|
|
73
|
+
this.allowDelete = allowActions.allowDelete ?? allowTableEdit ?? true;
|
|
74
|
+
} else {
|
|
75
|
+
this.allowAdd = allowTableEdit ?? true;
|
|
76
|
+
this.allowDelete = allowTableEdit ?? true;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (referenceList?.length === 0 && (this.allowAdd || this.allowEdit)) {
|
|
80
|
+
this.pConn$.getListActions().insert({ classID: this.contextClass }, referenceList.length);
|
|
64
81
|
}
|
|
65
82
|
}
|
|
66
83
|
|
|
@@ -85,56 +102,57 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
85
102
|
const props = changes.configProps$;
|
|
86
103
|
if (props.currentValue !== props.previousValue) {
|
|
87
104
|
this.configProps$ = props.currentValue;
|
|
105
|
+
|
|
88
106
|
if (changes?.pConn$?.currentValue) {
|
|
89
107
|
this.pConn$ = changes?.pConn$?.currentValue;
|
|
90
108
|
}
|
|
109
|
+
|
|
91
110
|
this.updateSelf();
|
|
92
111
|
}
|
|
93
112
|
}
|
|
94
113
|
}
|
|
95
114
|
|
|
115
|
+
ngAfterViewInit() {
|
|
116
|
+
const resolvedList = getReferenceList(this.pConn$);
|
|
117
|
+
// @ts-ignore - Expected 3 arguments, but got 1
|
|
118
|
+
this.pConn$.getListActions().initDefaultPageInstructions(resolvedList);
|
|
119
|
+
}
|
|
120
|
+
|
|
96
121
|
updateSelf() {
|
|
97
|
-
|
|
98
|
-
this.label$ = this.configProps$.label;
|
|
99
|
-
this.showLabel$ = this.configProps$.showLabel;
|
|
100
|
-
// label & showLabel within inheritedProps takes precedence over configProps
|
|
101
|
-
this.label$ = (this.inheritedProps$ as any).label || this.label$;
|
|
102
|
-
this.showLabel$ = (this.inheritedProps$ as any).showLabel || this.showLabel$;
|
|
122
|
+
const inheritedProps: any = this.pConn$.getInheritedProps();
|
|
103
123
|
|
|
104
|
-
|
|
124
|
+
const { label, hideLabel, allowRowDelete, referenceList, fieldHeader, renderMode, displayMode, heading, contextClass, lookForChildInConfig } =
|
|
125
|
+
this.configProps$;
|
|
126
|
+
|
|
127
|
+
// label within inheritedProps takes precedence over configProps
|
|
128
|
+
this.label$ = inheritedProps.label || label;
|
|
129
|
+
|
|
130
|
+
this.showLabel$ = referenceList?.length === 0 || !hideLabel;
|
|
105
131
|
|
|
106
|
-
const renderMode = this.configProps$.renderMode;
|
|
107
|
-
const displayMode = this.configProps$.displayMode;
|
|
108
132
|
this.readonlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY';
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
this.heading =
|
|
112
|
-
this.fieldHeader =
|
|
133
|
+
|
|
134
|
+
this.contextClass = contextClass;
|
|
135
|
+
this.heading = heading ?? 'Row';
|
|
136
|
+
this.fieldHeader = fieldHeader;
|
|
137
|
+
|
|
113
138
|
const resolvedList = getReferenceList(this.pConn$);
|
|
114
|
-
this.pageReference = `${this.pConn$.getPageReference()}${resolvedList}`;
|
|
115
139
|
this.pConn$.setReferenceList(resolvedList);
|
|
140
|
+
|
|
116
141
|
if (this.readonlyMode) {
|
|
117
142
|
this.pConn$.setInheritedProp('displayMode', 'DISPLAY_ONLY');
|
|
118
143
|
}
|
|
119
|
-
|
|
120
|
-
if (this.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (this.referenceList?.length === 0 && this.allowAddEdit !== false) {
|
|
124
|
-
this.addFieldGroupItem();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
const children: any = [];
|
|
128
|
-
this.referenceList?.forEach((item, index) => {
|
|
129
|
-
children.push({
|
|
144
|
+
|
|
145
|
+
if (this.referenceListLength != referenceList?.length) {
|
|
146
|
+
this.children = referenceList?.map((item, index) => {
|
|
147
|
+
return {
|
|
130
148
|
id: index,
|
|
131
149
|
name: this.fieldHeader === 'propertyRef' ? this.getDynamicHeader(item, index) : this.getStaticHeader(this.heading, index),
|
|
132
|
-
children: buildView(this.pConn$, index, lookForChildInConfig)
|
|
133
|
-
|
|
150
|
+
children: buildView(this.pConn$, index, lookForChildInConfig),
|
|
151
|
+
allowRowDelete: evaluateAllowRowAction(allowRowDelete, item)
|
|
152
|
+
};
|
|
134
153
|
});
|
|
135
|
-
this.children = children;
|
|
136
154
|
}
|
|
137
|
-
this.
|
|
155
|
+
this.referenceListLength = referenceList?.length || 0;
|
|
138
156
|
}
|
|
139
157
|
|
|
140
158
|
getStaticHeader = (heading, index) => {
|
|
@@ -149,10 +167,15 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
149
167
|
};
|
|
150
168
|
|
|
151
169
|
addFieldGroupItem() {
|
|
152
|
-
this.pConn$.getListActions().insert({ classID: this.contextClass }, this.
|
|
170
|
+
this.pConn$.getListActions().insert({ classID: this.contextClass }, this.referenceListLength);
|
|
153
171
|
}
|
|
154
172
|
|
|
155
173
|
deleteFieldGroupItem(index) {
|
|
156
174
|
this.pConn$.getListActions().deleteEntry(index);
|
|
157
175
|
}
|
|
176
|
+
|
|
177
|
+
getAddBtnLabel() {
|
|
178
|
+
const { targetClassLabel } = this.configProps$;
|
|
179
|
+
return targetClassLabel ? `+ Add ${targetClassLabel}` : '+ Add';
|
|
180
|
+
}
|
|
158
181
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const evaluateAllowRowAction = (allowRowDelete, rowData) => {
|
|
2
|
+
if (allowRowDelete === undefined || allowRowDelete === true) return true;
|
|
3
|
+
if (allowRowDelete.startsWith?.('@E ')) {
|
|
4
|
+
const expression = allowRowDelete.replace('@E ', '');
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
return PCore.getExpressionEngine().evaluate(expression, rowData);
|
|
7
|
+
}
|
|
8
|
+
return false;
|
|
9
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<div *ngIf="displayMode$ === 'DISPLAY_ONLY'; else STACKED_LARGE_VAL"
|
|
2
|
-
<div class="psdk-grid-label">{{ label$ }}</div>
|
|
1
|
+
<div *ngIf="displayMode$ === 'DISPLAY_ONLY'; else STACKED_LARGE_VAL" [ngClass]="label$ ? 'psdk-container-labels-left' : 'psdk-container-nolabels'">
|
|
2
|
+
<div *ngIf="label$" class="psdk-grid-label">{{ label$ }}</div>
|
|
3
3
|
<div class="psdk-val-labels-left">
|
|
4
4
|
<ng-container *ngTemplateOutlet="valueTemplate"></ng-container>
|
|
5
5
|
</div>
|
|
@@ -180,7 +180,9 @@
|
|
|
180
180
|
<tr mat-header-row *matHeaderRowDef="displayedColumns$"></tr>
|
|
181
181
|
</table>
|
|
182
182
|
</div>
|
|
183
|
-
<div class="psdk-no-records" *ngIf="repeatListData?.length === 0">
|
|
183
|
+
<div class="psdk-no-records" *ngIf="repeatListData?.length === 0">
|
|
184
|
+
{{ utils.getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.') }}
|
|
185
|
+
</div>
|
|
184
186
|
</div>
|
|
185
187
|
</div>
|
|
186
188
|
</div>
|
|
@@ -191,7 +191,7 @@ export const createMetaForTable = (fields, renderMode) => {
|
|
|
191
191
|
};
|
|
192
192
|
|
|
193
193
|
export const filterDataByDate = (item, filterObj) => {
|
|
194
|
-
let bKeep;
|
|
194
|
+
let bKeep = true;
|
|
195
195
|
let value = item[filterObj.ref] != null || item[filterObj.ref] != '' ? getSeconds(item[filterObj.ref]) : null;
|
|
196
196
|
let filterValue = filterObj.containsFilterValue != null && filterObj.containsFilterValue != '' ? getSeconds(filterObj.containsFilterValue) : null;
|
|
197
197
|
|
|
@@ -239,7 +239,7 @@ export const filterDataByDate = (item, filterObj) => {
|
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
export const filterDataByCommonFields = (item, filterObj) => {
|
|
242
|
-
let bKeep;
|
|
242
|
+
let bKeep = true;
|
|
243
243
|
const value = item[filterObj.ref].toLowerCase();
|
|
244
244
|
const filterValue = filterObj.containsFilterValue.toLowerCase();
|
|
245
245
|
|
|
@@ -294,3 +294,19 @@ export const createPConnect = (contextName, referenceList, pageReference) => {
|
|
|
294
294
|
|
|
295
295
|
return getPConnect();
|
|
296
296
|
};
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* This method evaluates whether a row action is allowed based on the provided conditions.
|
|
300
|
+
* @param {string|boolean|undefined} allowRowDelete - The condition for allowing row deletion.
|
|
301
|
+
* @param {object} rowData - The data of the row being evaluated.
|
|
302
|
+
* @returns {boolean} - Returns true if the row action is allowed, false otherwise.
|
|
303
|
+
*/
|
|
304
|
+
export const evaluateAllowRowAction = (allowRowDelete, rowData) => {
|
|
305
|
+
if (allowRowDelete === undefined || allowRowDelete === true) return true;
|
|
306
|
+
if (allowRowDelete.startsWith?.('@E ')) {
|
|
307
|
+
const expression = allowRowDelete.replace('@E ', '');
|
|
308
|
+
// @ts-ignore - Expected 3 arguments, but got 2
|
|
309
|
+
return PCore.getExpressionEngine().evaluate(expression, rowData);
|
|
310
|
+
}
|
|
311
|
+
return false;
|
|
312
|
+
};
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<h3 *ngIf="label" className="label" style="font-weight: bold">
|
|
4
4
|
{{ label }} <span class="results-count">{{ getResultsText() }}</span>
|
|
5
5
|
</h3>
|
|
6
|
-
<table *ngIf="readOnlyMode || allowEditingInModal" mat-table [dataSource]="
|
|
7
|
-
<ng-container *ngFor="let dCol of processedFields" [matColumnDef]="dCol.config.name">
|
|
6
|
+
<table *ngIf="readOnlyMode || allowEditingInModal" mat-table [dataSource]="elementsData" class="mat-elevation-z8" id="readonly-table" matSort>
|
|
7
|
+
<ng-container *ngFor="let dCol of processedFields; let i = index" [matColumnDef]="dCol.config.name">
|
|
8
8
|
<th mat-header-cell *matHeaderCellDef mat-sort-header (click)="_headerSortClick($event, dCol)" arrowPosition="before">
|
|
9
9
|
<div>{{ dCol.config.label }}</div>
|
|
10
10
|
<div class="psdk-mat-header-filter">
|
|
@@ -27,7 +27,16 @@
|
|
|
27
27
|
</mat-menu>
|
|
28
28
|
</div>
|
|
29
29
|
</th>
|
|
30
|
-
<td mat-cell *matCellDef="let element">
|
|
30
|
+
<td mat-cell *matCellDef="let element">
|
|
31
|
+
<component-mapper
|
|
32
|
+
[name]="element[i].getPConnect().getComponentName()"
|
|
33
|
+
[props]="{
|
|
34
|
+
pConn$: element[i].getPConnect(),
|
|
35
|
+
formGroup$: formGroup$
|
|
36
|
+
}"
|
|
37
|
+
errorMsg="Table wants component not yet available: {{ element[i].getPConnect().getComponentName() }}"
|
|
38
|
+
></component-mapper>
|
|
39
|
+
</td>
|
|
31
40
|
</ng-container>
|
|
32
41
|
<ng-container matColumnDef="DeleteIcon">
|
|
33
42
|
<div *ngIf="allowEditingInModal">
|
|
@@ -47,6 +56,11 @@
|
|
|
47
56
|
</ng-container>
|
|
48
57
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
49
58
|
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
59
|
+
<tr class="mat-row psdk-no-records" *matNoDataRow>
|
|
60
|
+
<td id="no-records" class="mat-cell" [attr.colspan]="displayedColumns.length">
|
|
61
|
+
{{ utils.getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.') }}
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
50
64
|
</table>
|
|
51
65
|
<table *ngIf="editableMode && !allowEditingInModal" mat-table [dataSource]="elementsData" class="mat-elevation-z8" id="editable-table">
|
|
52
66
|
<ng-container *ngFor="let dCol of fieldDefs; let i = index">
|
|
@@ -74,11 +88,16 @@
|
|
|
74
88
|
</ng-container>
|
|
75
89
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
76
90
|
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
91
|
+
<tr class="mat-row psdk-no-records" *matNoDataRow>
|
|
92
|
+
<td id="no-records" class="mat-cell" [attr.colspan]="displayedColumns.length">
|
|
93
|
+
{{ utils.getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.') }}
|
|
94
|
+
</td>
|
|
95
|
+
</tr>
|
|
77
96
|
</table>
|
|
78
|
-
<div class="psdk-no-records" id="no-records" *ngIf="editableMode && referenceList?.length === 0">No Records Found.</div>
|
|
79
|
-
<div class="psdk-no-records" id="no-records" *ngIf="readOnlyMode && rowData?.data?.length === 0">No Records Found.</div>
|
|
80
97
|
</div>
|
|
81
|
-
<button *ngIf="showAddRowButton" mat-button color="primary" style="font-size: 16px" (click)="addRecord()"
|
|
98
|
+
<button *ngIf="showAddRowButton" mat-button color="primary" style="font-size: 16px" (click)="addRecord()">
|
|
99
|
+
+ {{ localizedVal('Add', localeCategory) }}
|
|
100
|
+
</button>
|
|
82
101
|
</ng-container>
|
|
83
102
|
|
|
84
103
|
<!-- pop overs for filters-->
|
|
@@ -24,6 +24,12 @@ td.mat-mdc-cell,
|
|
|
24
24
|
td.mat-mdc-footer-cell {
|
|
25
25
|
border-right: 1px solid var(--app-neutral-light-color);
|
|
26
26
|
padding: 8px !important;
|
|
27
|
+
min-width: 10rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
::ng-deep th.mat-mdc-header-cell:last-child,
|
|
31
|
+
td.mat-mdc-cell:last-child {
|
|
32
|
+
min-width: 2rem;
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
::ng-deep .mat-mdc-button {
|
|
@@ -160,9 +166,7 @@ tr.mat-mdc-header-row {
|
|
|
160
166
|
|
|
161
167
|
.psdk-no-records {
|
|
162
168
|
height: 56px;
|
|
163
|
-
|
|
164
|
-
display: flex;
|
|
165
|
-
align-items: center;
|
|
169
|
+
text-align: center;
|
|
166
170
|
border: 1px solid var(--app-neutral-light-color);
|
|
167
171
|
border-top: none;
|
|
168
172
|
background: var(--app-form-color);
|