@pega/angular-sdk-overrides 0.25.14 → 0.26.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/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +13 -1
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.ts +25 -1
- package/lib/field/check-box/check-box.component.html +1 -1
- package/lib/field/embedded-data-multi/embedded-data-multi.component.html +3 -0
- package/lib/field/embedded-data-multi/embedded-data-multi.component.scss +0 -0
- package/lib/field/embedded-data-multi/embedded-data-multi.component.ts +173 -0
- package/lib/field/group/group.component.ts +14 -2
- package/lib/field/multiselect/multiselect.component.ts +22 -3
- package/lib/field/multiselect/utils.ts +5 -3
- package/lib/field/object-reference/object-reference.component.html +30 -15
- package/lib/field/object-reference/object-reference.component.ts +816 -94
- package/lib/field/selectable-card/selectable-card.component.html +1 -0
- package/lib/field/selectable-card/selectable-card.component.ts +31 -16
- package/lib/infra/view/view.component.ts +4 -2
- package/lib/template/base/details-template-base.ts +45 -0
- package/lib/template/data-reference/search-form/search-form.component.ts +7 -1
- package/lib/template/details/details.component.ts +1 -39
- package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +2 -4
- package/lib/template/details-one-column/details-one-column.component.ts +1 -3
- package/lib/template/details-three-column/details-three-column.component.ts +3 -5
- package/lib/template/details-two-column/details-two-column.component.ts +2 -4
- package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +2 -4
- package/lib/template/field-group-template/field-group-template.component.ts +18 -4
- package/lib/template/simple-table/simple-table.component.ts +6 -0
- package/lib/template/simple-table-manual/helpers.ts +2 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +4 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +16 -16
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
[checked]="cardContent.commonCardProps.selected"
|
|
18
18
|
[disabled]="disabled || readOnly"
|
|
19
19
|
[attr.data-test-id]="testId + ':' + cardContent.commonCardProps.label"
|
|
20
|
+
(click)="$event.stopPropagation()"
|
|
20
21
|
(change)="handleChangeMultiMode($event, cardContent.commonCardProps)"
|
|
21
22
|
(blur)="fieldOnBlur()"
|
|
22
23
|
>{{ cardContent.commonCardProps.label }}</mat-checkbox
|
|
@@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
|
|
|
3
3
|
import { MatCardModule } from '@angular/material/card';
|
|
4
4
|
import { MatRadioModule } from '@angular/material/radio';
|
|
5
5
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
6
|
-
import { deleteInstruction, insertInstruction } from '@pega/angular-sdk-components';
|
|
6
|
+
import { deleteInstruction, insertInstruction, updateNewInstructions } from '@pega/angular-sdk-components';
|
|
7
7
|
import { handleEvent } from '@pega/angular-sdk-components';
|
|
8
8
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
9
9
|
import { FieldBase } from '@pega/angular-sdk-components';
|
|
@@ -93,21 +93,9 @@ export class SelectableCardComponent extends FieldBase implements OnInit {
|
|
|
93
93
|
const imagePosition = this.configProps$.imagePosition;
|
|
94
94
|
|
|
95
95
|
// dynamic styling based on image position and readOnly option
|
|
96
|
-
|
|
97
|
-
this.cardStyle =
|
|
98
|
-
|
|
99
|
-
imageWidth = '30%';
|
|
100
|
-
if (imagePosition === 'inline-start') {
|
|
101
|
-
this.cardStyle = { display: 'flex', flexDirection: 'row', alignItems: this.readOnly ? 'center' : '' };
|
|
102
|
-
} else if (imagePosition === 'inline-end') {
|
|
103
|
-
this.cardStyle = {
|
|
104
|
-
display: 'flex',
|
|
105
|
-
flexDirection: 'row-reverse',
|
|
106
|
-
justifyContent: this.readOnly ? 'space-between' : '',
|
|
107
|
-
alignItems: this.readOnly ? 'center' : ''
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
}
|
|
96
|
+
const { imageWidth, cardStyle } = this.resolveImageLayout(imagePosition);
|
|
97
|
+
this.cardStyle = cardStyle;
|
|
98
|
+
|
|
111
99
|
if (this.type === 'radio') {
|
|
112
100
|
const stateProps = this.pConn$.getStateProps();
|
|
113
101
|
image = {
|
|
@@ -145,6 +133,12 @@ export class SelectableCardComponent extends FieldBase implements OnInit {
|
|
|
145
133
|
this.selectedvalues = this.configProps$.readonlyContextList;
|
|
146
134
|
this.showNoValue = this.readOnly && this.selectedvalues?.length === 0; // not used
|
|
147
135
|
this.primaryField = this.configProps$.primaryField;
|
|
136
|
+
|
|
137
|
+
// Set reference list so getListActions() uses the correct path on every re-render
|
|
138
|
+
if (this.selectionList && !this.readOnly) {
|
|
139
|
+
this.pConn$.setReferenceList(this.selectionList);
|
|
140
|
+
updateNewInstructions(this.pConn$, this.selectionList);
|
|
141
|
+
}
|
|
148
142
|
}
|
|
149
143
|
|
|
150
144
|
this.commonProps = { hideFieldLabels, datasource, additionalProps, image, recordKey, cardLabel, radioBtnValue: this.radioBtnValue ?? '' };
|
|
@@ -182,6 +176,27 @@ export class SelectableCardComponent extends FieldBase implements OnInit {
|
|
|
182
176
|
});
|
|
183
177
|
}
|
|
184
178
|
|
|
179
|
+
private resolveImageLayout(imagePosition: string | undefined): { imageWidth: string; cardStyle: object } {
|
|
180
|
+
if (!imagePosition || imagePosition === 'block-start') {
|
|
181
|
+
return { imageWidth: '100%', cardStyle: { display: 'flex', flexDirection: 'column', height: '100%' } };
|
|
182
|
+
}
|
|
183
|
+
if (imagePosition === 'inline-start') {
|
|
184
|
+
return { imageWidth: '30%', cardStyle: { display: 'flex', flexDirection: 'row', alignItems: this.readOnly ? 'center' : '' } };
|
|
185
|
+
}
|
|
186
|
+
if (imagePosition === 'inline-end') {
|
|
187
|
+
return {
|
|
188
|
+
imageWidth: '30%',
|
|
189
|
+
cardStyle: {
|
|
190
|
+
display: 'flex',
|
|
191
|
+
flexDirection: 'row-reverse',
|
|
192
|
+
justifyContent: this.readOnly ? 'space-between' : '',
|
|
193
|
+
alignItems: this.readOnly ? 'center' : ''
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
return { imageWidth: '30%', cardStyle: { display: 'flex', flexDirection: 'column', height: '100%' } };
|
|
198
|
+
}
|
|
199
|
+
|
|
185
200
|
fieldOnChange(value: any) {
|
|
186
201
|
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
187
202
|
}
|
|
@@ -146,7 +146,6 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
146
146
|
|
|
147
147
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ViewProps;
|
|
148
148
|
this.inheritedProps$ = this.pConn$.getInheritedProps();
|
|
149
|
-
|
|
150
149
|
// NOTE: this.configProps$.visibility'] is used in view.component.ts such that
|
|
151
150
|
// the View will only be rendered when this.configProps$.visibility'] is false.
|
|
152
151
|
// It WILL render if true or undefined.
|
|
@@ -155,7 +154,10 @@ export class ViewComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
155
154
|
this.title$ = this.configProps$.title || '';
|
|
156
155
|
// label & showLabel within inheritedProps takes precedence over configProps
|
|
157
156
|
this.label$ = this.inheritedProps$.label || this.configProps$.label || '';
|
|
158
|
-
this.showLabel$ =
|
|
157
|
+
this.showLabel$ =
|
|
158
|
+
this.inheritedProps$.showLabel !== undefined
|
|
159
|
+
? this.inheritedProps$.showLabel
|
|
160
|
+
: this.configProps$.showLabel || isDetailsTemplate(this.templateName$);
|
|
159
161
|
this.arChildren$ = this.pConn$.getChildren();
|
|
160
162
|
this.visibility$ = this.configProps$.visibility ?? this.visibility$;
|
|
161
163
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Directive, OnInit, OnDestroy, Injector, Input } from '@angular/core';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
2
3
|
import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
|
|
3
4
|
|
|
4
5
|
@Directive()
|
|
5
6
|
export class DetailsTemplateBase implements OnInit, OnDestroy {
|
|
6
7
|
@Input() pConn$: typeof PConnect;
|
|
8
|
+
@Input() formGroup$: FormGroup;
|
|
7
9
|
|
|
8
10
|
// For interaction with AngularPConnect
|
|
9
11
|
protected angularPConnectData: AngularPConnectData = {};
|
|
@@ -64,4 +66,47 @@ export class DetailsTemplateBase implements OnInit, OnDestroy {
|
|
|
64
66
|
return pConnect.resolveConfigProps(pConnect.getRawMetadata());
|
|
65
67
|
});
|
|
66
68
|
}
|
|
69
|
+
|
|
70
|
+
processDetailFields(kid: any): any[] {
|
|
71
|
+
const pKid = kid.getPConnect();
|
|
72
|
+
const fields = pKid.getChildren();
|
|
73
|
+
const processedFields: any[] = [];
|
|
74
|
+
|
|
75
|
+
fields?.forEach(field => {
|
|
76
|
+
const thePConn = field.getPConnect();
|
|
77
|
+
const theCompType = thePConn.getComponentName().toLowerCase();
|
|
78
|
+
if (theCompType === 'reference' || theCompType === 'group') {
|
|
79
|
+
const configProps = thePConn.getConfigProps();
|
|
80
|
+
configProps.readOnly = true;
|
|
81
|
+
configProps.displayMode = 'DISPLAY_ONLY';
|
|
82
|
+
const propToUse = { ...thePConn.getInheritedProps() };
|
|
83
|
+
configProps.label = propToUse?.label;
|
|
84
|
+
const options = {
|
|
85
|
+
context: thePConn.getContextName(),
|
|
86
|
+
pageReference: thePConn.getPageReference(),
|
|
87
|
+
referenceList: thePConn.getReferenceList()
|
|
88
|
+
};
|
|
89
|
+
const viewContConfig = {
|
|
90
|
+
meta: {
|
|
91
|
+
...thePConn.getMetadata(),
|
|
92
|
+
type: theCompType,
|
|
93
|
+
config: configProps
|
|
94
|
+
},
|
|
95
|
+
options
|
|
96
|
+
};
|
|
97
|
+
const theViewCont = PCore.createPConnect(viewContConfig);
|
|
98
|
+
processedFields.push({
|
|
99
|
+
type: theCompType,
|
|
100
|
+
pConn: theViewCont?.getPConnect()
|
|
101
|
+
});
|
|
102
|
+
} else {
|
|
103
|
+
processedFields.push({
|
|
104
|
+
type: theCompType,
|
|
105
|
+
config: thePConn.getConfigProps()
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
return processedFields;
|
|
111
|
+
}
|
|
67
112
|
}
|
|
@@ -37,6 +37,7 @@ export class SearchFormComponent implements OnInit, OnChanges {
|
|
|
37
37
|
@Input() pConn$: typeof PConnect;
|
|
38
38
|
@Input() formGroup$: FormGroup;
|
|
39
39
|
@Input() searchSelectCacheKey;
|
|
40
|
+
@Input() type: string;
|
|
40
41
|
|
|
41
42
|
configProps$: any;
|
|
42
43
|
isInitialized = false;
|
|
@@ -58,7 +59,12 @@ export class SearchFormComponent implements OnInit, OnChanges {
|
|
|
58
59
|
this.isInitialized = true;
|
|
59
60
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
|
|
60
61
|
this.propsToUse = { ...this.pConn$.getInheritedProps() };
|
|
61
|
-
|
|
62
|
+
// When called from ObjectReference, pConn$ itself acts as deferLoadedTabs (no children[2])
|
|
63
|
+
if (this.type === 'ObjectReference') {
|
|
64
|
+
this.deferLoadedTabs = { getPConnect: () => this.pConn$ };
|
|
65
|
+
} else {
|
|
66
|
+
this.deferLoadedTabs = this.pConn$.getChildren()[2];
|
|
67
|
+
}
|
|
62
68
|
const cache: any = PCore.getNavigationUtils().getComponentCache(this.searchSelectCacheKey) ?? {};
|
|
63
69
|
const { selectedCategory } = cache;
|
|
64
70
|
const firstTabId = getFirstVisibleTabId(this.deferLoadedTabs, selectedCategory);
|
|
@@ -35,45 +35,7 @@ export class DetailsComponent extends DetailsTemplateBase {
|
|
|
35
35
|
|
|
36
36
|
const kids = this.pConn$.getChildren() as any[];
|
|
37
37
|
for (const kid of kids) {
|
|
38
|
-
this.arFields$ =
|
|
39
|
-
const pKid = kid.getPConnect();
|
|
40
|
-
const fields = pKid.getChildren();
|
|
41
|
-
fields?.forEach(field => {
|
|
42
|
-
const thePConn = field.getPConnect();
|
|
43
|
-
const theCompType = thePConn.getComponentName().toLowerCase();
|
|
44
|
-
if (theCompType === 'reference' || theCompType === 'group') {
|
|
45
|
-
const configProps = thePConn.getConfigProps();
|
|
46
|
-
configProps.readOnly = true;
|
|
47
|
-
configProps.displayMode = 'DISPLAY_ONLY';
|
|
48
|
-
const propToUse = { ...thePConn.getInheritedProps() };
|
|
49
|
-
configProps.label = propToUse?.label;
|
|
50
|
-
const options = {
|
|
51
|
-
context: thePConn.getContextName(),
|
|
52
|
-
pageReference: thePConn.getPageReference(),
|
|
53
|
-
referenceList: thePConn.getReferenceList()
|
|
54
|
-
};
|
|
55
|
-
const viewContConfig = {
|
|
56
|
-
meta: {
|
|
57
|
-
...thePConn.getMetadata(),
|
|
58
|
-
type: theCompType,
|
|
59
|
-
config: configProps
|
|
60
|
-
},
|
|
61
|
-
options
|
|
62
|
-
};
|
|
63
|
-
const theViewCont = PCore.createPConnect(viewContConfig);
|
|
64
|
-
const data = {
|
|
65
|
-
type: theCompType,
|
|
66
|
-
pConn: theViewCont?.getPConnect()
|
|
67
|
-
};
|
|
68
|
-
this.arFields$.push(data);
|
|
69
|
-
} else {
|
|
70
|
-
const data = {
|
|
71
|
-
type: theCompType,
|
|
72
|
-
config: thePConn.getConfigProps()
|
|
73
|
-
};
|
|
74
|
-
this.arFields$.push(data);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
38
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
77
39
|
}
|
|
78
40
|
}
|
|
79
41
|
}
|
|
@@ -36,12 +36,10 @@ export class DetailsNarrowWideComponent extends DetailsTemplateBase {
|
|
|
36
36
|
|
|
37
37
|
const kids = this.pConn$.getChildren() as any[];
|
|
38
38
|
for (const kid of kids) {
|
|
39
|
-
const pKid = kid.getPConnect();
|
|
40
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
41
39
|
if (kids.indexOf(kid) == 0) {
|
|
42
|
-
this.arFields$ =
|
|
40
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
43
41
|
} else {
|
|
44
|
-
this.arFields2$ =
|
|
42
|
+
this.arFields2$ = this.processDetailFields(kid);
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
}
|
|
@@ -39,10 +39,8 @@ export class DetailsOneColumnComponent extends DetailsTemplateBase {
|
|
|
39
39
|
|
|
40
40
|
const kids = this.pConn$.getChildren() as any[];
|
|
41
41
|
for (const kid of kids) {
|
|
42
|
-
const pKid = kid.getPConnect();
|
|
43
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
44
42
|
if (kids.indexOf(kid) == 0) {
|
|
45
|
-
this.arFields$ =
|
|
43
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
}
|
|
@@ -43,14 +43,12 @@ export class DetailsThreeColumnComponent extends DetailsTemplateBase {
|
|
|
43
43
|
|
|
44
44
|
const kids = this.pConn$.getChildren() as any[];
|
|
45
45
|
for (const kid of kids) {
|
|
46
|
-
const pKid = kid.getPConnect();
|
|
47
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
48
46
|
if (kids.indexOf(kid) == 0) {
|
|
49
|
-
this.arFields$ =
|
|
47
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
50
48
|
} else if (kids.indexOf(kid) == 1) {
|
|
51
|
-
this.arFields2$ =
|
|
49
|
+
this.arFields2$ = this.processDetailFields(kid);
|
|
52
50
|
} else {
|
|
53
|
-
this.arFields3$ =
|
|
51
|
+
this.arFields3$ = this.processDetailFields(kid);
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
}
|
|
@@ -43,12 +43,10 @@ export class DetailsTwoColumnComponent extends DetailsTemplateBase {
|
|
|
43
43
|
|
|
44
44
|
const kids = this.pConn$.getChildren() as any[];
|
|
45
45
|
for (const kid of kids) {
|
|
46
|
-
const pKid = kid.getPConnect();
|
|
47
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
48
46
|
if (kids.indexOf(kid) == 0) {
|
|
49
|
-
this.arFields$ =
|
|
47
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
50
48
|
} else {
|
|
51
|
-
this.arFields2$ =
|
|
49
|
+
this.arFields2$ = this.processDetailFields(kid);
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
}
|
|
@@ -40,12 +40,10 @@ export class DetailsWideNarrowComponent extends DetailsTemplateBase {
|
|
|
40
40
|
|
|
41
41
|
const kids = this.pConn$.getChildren() as any[];
|
|
42
42
|
for (const kid of kids) {
|
|
43
|
-
const pKid = kid.getPConnect();
|
|
44
|
-
const pKidData = pKid.resolveConfigProps(pKid.getRawMetadata());
|
|
45
43
|
if (kids.indexOf(kid) == 0) {
|
|
46
|
-
this.arFields$ =
|
|
44
|
+
this.arFields$ = this.processDetailFields(kid);
|
|
47
45
|
} else {
|
|
48
|
-
this.arFields2$ =
|
|
46
|
+
this.arFields2$ = this.processDetailFields(kid);
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
}
|
|
@@ -43,6 +43,7 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
43
43
|
readonlyMode: boolean;
|
|
44
44
|
contextClass: any;
|
|
45
45
|
heading: any;
|
|
46
|
+
headingPath: string[] = [];
|
|
46
47
|
children: any;
|
|
47
48
|
menuIconOverride$: any;
|
|
48
49
|
referenceListLength = signal<number | null>(null);
|
|
@@ -150,11 +151,24 @@ export class FieldGroupTemplateComponent implements OnInit, OnDestroy, OnChanges
|
|
|
150
151
|
return `${heading} ${index + 1}`;
|
|
151
152
|
};
|
|
152
153
|
|
|
153
|
-
getDynamicHeader = (item, index) => {
|
|
154
|
-
if (this.heading
|
|
155
|
-
|
|
154
|
+
getDynamicHeader = (item: Record<string, unknown>, index: number): string => {
|
|
155
|
+
if (this.heading) {
|
|
156
|
+
let value: any = item;
|
|
157
|
+
this.headingPath = this.heading.substring(1).split('.');
|
|
158
|
+
|
|
159
|
+
for (const key of this.headingPath) {
|
|
160
|
+
if (value === null || typeof value !== 'object' || !(key in value)) {
|
|
161
|
+
value = undefined;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
value = Reflect.get(value, key);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
168
|
+
return value.toString();
|
|
169
|
+
}
|
|
156
170
|
}
|
|
157
|
-
return
|
|
171
|
+
return `${PCore.getLocaleUtils().getLocaleValue('Row', 'SimpleTable')} ${index + 1}`;
|
|
158
172
|
};
|
|
159
173
|
|
|
160
174
|
addFieldGroupItem() {
|
|
@@ -82,6 +82,11 @@ export class SimpleTableComponent implements OnInit, OnDestroy {
|
|
|
82
82
|
// moved this from ngOnInit() and call this from there instead...
|
|
83
83
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as SimpleTableProps;
|
|
84
84
|
|
|
85
|
+
// Reset rendering state on every update
|
|
86
|
+
this.fieldGroupProps = null;
|
|
87
|
+
this.listViewProps = null;
|
|
88
|
+
this.refToPConnect = null;
|
|
89
|
+
|
|
85
90
|
if (this.configProps$.visibility != null) {
|
|
86
91
|
this.bVisible$ = this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
|
|
87
92
|
}
|
|
@@ -95,6 +100,7 @@ export class SimpleTableComponent implements OnInit, OnDestroy {
|
|
|
95
100
|
}
|
|
96
101
|
if (multiRecordDisplayAs === 'fieldGroup') {
|
|
97
102
|
this.fieldGroupProps = { ...this.configProps$, contextClass };
|
|
103
|
+
return;
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
const {
|
|
@@ -354,8 +354,8 @@ export const filterDataByDate = (item, filterObj) => {
|
|
|
354
354
|
|
|
355
355
|
export const filterDataByCommonFields = (item, filterObj) => {
|
|
356
356
|
let bKeep = true;
|
|
357
|
-
const value = item[filterObj.ref].toLowerCase();
|
|
358
|
-
const filterValue = filterObj.containsFilterValue.toLowerCase();
|
|
357
|
+
const value = String(item?.[filterObj.ref] ?? '').toLowerCase();
|
|
358
|
+
const filterValue = String(filterObj.containsFilterValue ?? '').toLowerCase();
|
|
359
359
|
|
|
360
360
|
switch (filterObj.containsFilter) {
|
|
361
361
|
case 'contains':
|
|
@@ -130,6 +130,7 @@ td.mat-mdc-cell:last-child {
|
|
|
130
130
|
align-items: center;
|
|
131
131
|
height: 100%;
|
|
132
132
|
width: 100%;
|
|
133
|
+
background-color: var(--app-dialog-background-color);
|
|
133
134
|
position: fixed;
|
|
134
135
|
z-index: 999;
|
|
135
136
|
top: 0px;
|
|
@@ -140,10 +141,11 @@ td.mat-mdc-cell:last-child {
|
|
|
140
141
|
display: table;
|
|
141
142
|
margin: auto;
|
|
142
143
|
min-width: 150px;
|
|
143
|
-
|
|
144
|
+
background-color: var(--mat-sys-surface-container);
|
|
145
|
+
border: 1px solid var(--mat-sys-outline-variant);
|
|
144
146
|
border-radius: 10px;
|
|
145
147
|
padding: 20px;
|
|
146
|
-
box-shadow: 0 0 10px 3px var(--
|
|
148
|
+
box-shadow: 0 0 10px 3px var(--mat-sys-level3);
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
tr.mat-mdc-row {
|
|
@@ -92,7 +92,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
92
92
|
|
|
93
93
|
bVisible$ = true;
|
|
94
94
|
displayedColumns: string[] = [];
|
|
95
|
-
rowData
|
|
95
|
+
rowData = new MatTableDataSource<any>([]);
|
|
96
96
|
originalData: any[] = [];
|
|
97
97
|
processedFields: any[] = [];
|
|
98
98
|
fieldDefs: any[] = [];
|
|
@@ -159,6 +159,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
159
159
|
referenceListStr: any;
|
|
160
160
|
bUseSeparateViewForEdit: any;
|
|
161
161
|
editView: any;
|
|
162
|
+
editType: any;
|
|
162
163
|
defaultActionId: any;
|
|
163
164
|
editActionId: any;
|
|
164
165
|
settingsSvgIcon$: string;
|
|
@@ -167,7 +168,6 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
167
168
|
targetClassLabel: string;
|
|
168
169
|
localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
169
170
|
localeCategory = 'SimpleTable';
|
|
170
|
-
editType: any;
|
|
171
171
|
constructor(
|
|
172
172
|
private angularPConnect: AngularPConnectService,
|
|
173
173
|
public utils: Utils,
|
|
@@ -391,17 +391,15 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
initializeDefaultPageInstructions() {
|
|
394
|
-
if (this.
|
|
394
|
+
if (this.allowEditingInModal) {
|
|
395
|
+
this.pConn$.getListActions().initDefaultPageInstructions(
|
|
396
|
+
this.pConn$.getReferenceList(),
|
|
397
|
+
this.fieldDefs.filter(item => item.name).map(item => item.name)
|
|
398
|
+
);
|
|
399
|
+
} else if (this.isInitialized) {
|
|
395
400
|
this.isInitialized = false;
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
this.pConn$.getReferenceList(),
|
|
399
|
-
this.fieldDefs.filter(item => item.name).map(item => item.name)
|
|
400
|
-
);
|
|
401
|
-
} else {
|
|
402
|
-
// @ts-ignore - An argument for 'propertyNames' was not provided.
|
|
403
|
-
this.pConn$.getListActions().initDefaultPageInstructions(this.pConn$.getReferenceList());
|
|
404
|
-
}
|
|
401
|
+
// @ts-ignore - An argument for 'propertyNames' was not provided.
|
|
402
|
+
this.pConn$.getListActions().initDefaultPageInstructions(this.pConn$.getReferenceList());
|
|
405
403
|
}
|
|
406
404
|
}
|
|
407
405
|
|
|
@@ -930,7 +928,7 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
930
928
|
const refKeys: string[] = inColKey.split('.');
|
|
931
929
|
let valBuilder = inRowData;
|
|
932
930
|
for (const key of refKeys) {
|
|
933
|
-
valBuilder = valBuilder[key];
|
|
931
|
+
valBuilder = valBuilder[key] ? valBuilder[key] : valBuilder;
|
|
934
932
|
}
|
|
935
933
|
return valBuilder;
|
|
936
934
|
}
|
|
@@ -989,16 +987,18 @@ export class SimpleTableManualComponent implements OnInit, OnDestroy {
|
|
|
989
987
|
|
|
990
988
|
editRecord(data, index) {
|
|
991
989
|
if (data) {
|
|
990
|
+
const viewForEdit = this.bUseSeparateViewForEdit ? this.editView : this.defaultView;
|
|
992
991
|
this.pConn$
|
|
993
992
|
.getActionsApi()
|
|
994
|
-
// @ts-expect-error
|
|
995
993
|
.openEmbeddedDataModal(
|
|
996
|
-
|
|
994
|
+
viewForEdit,
|
|
997
995
|
this.pConn$ as any,
|
|
998
996
|
this.referenceListStr,
|
|
999
997
|
index,
|
|
1000
998
|
PCore.getConstants().RESOURCE_STATUS.UPDATE,
|
|
1001
|
-
this.targetClassLabel
|
|
999
|
+
this.targetClassLabel,
|
|
1000
|
+
this.editType,
|
|
1001
|
+
this.editActionId
|
|
1002
1002
|
);
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|