@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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, forwardRef } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
3
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
import { FieldBase } from '@pega/angular-sdk-components';
|
|
6
6
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
7
7
|
import { handleEvent } from '@pega/angular-sdk-components';
|
|
8
8
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
@@ -15,105 +15,42 @@ interface RichTextProps extends PConnFieldProps {
|
|
|
15
15
|
selector: 'app-rich-text',
|
|
16
16
|
templateUrl: './rich-text.component.html',
|
|
17
17
|
styleUrls: ['./rich-text.component.scss'],
|
|
18
|
-
standalone: true,
|
|
19
18
|
imports: [CommonModule, ReactiveFormsModule, forwardRef(() => ComponentMapperComponent)]
|
|
20
19
|
})
|
|
21
|
-
export class RichTextComponent
|
|
22
|
-
@Input() pConn$: typeof PConnect;
|
|
23
|
-
@Input() formGroup$: FormGroup;
|
|
24
|
-
|
|
25
|
-
// Used with AngularPConnect
|
|
26
|
-
angularPConnectData: AngularPConnectData = {};
|
|
20
|
+
export class RichTextComponent extends FieldBase {
|
|
27
21
|
configProps$: RichTextProps;
|
|
28
22
|
|
|
29
|
-
label$ = '';
|
|
30
|
-
value$ = '';
|
|
31
|
-
bRequired$ = false;
|
|
32
|
-
bReadonly$ = false;
|
|
33
|
-
bDisabled$ = false;
|
|
34
|
-
bVisible$ = true;
|
|
35
|
-
displayMode$?: string = '';
|
|
36
|
-
controlName$: string;
|
|
37
|
-
testId: string;
|
|
38
|
-
helperText: string;
|
|
39
|
-
placeholder: any;
|
|
40
23
|
info: any;
|
|
41
24
|
error: boolean;
|
|
42
25
|
status: any;
|
|
43
26
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
) {
|
|
48
|
-
|
|
49
|
-
ngOnInit(): void {
|
|
50
|
-
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
51
|
-
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
52
|
-
|
|
53
|
-
// call updateSelf when initializing
|
|
54
|
-
this.checkAndUpdate();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
ngOnDestroy(): void {
|
|
58
|
-
if (this.angularPConnectData.unsubscribeFn) {
|
|
59
|
-
this.angularPConnectData.unsubscribeFn();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Callback passed when subscribing to store change
|
|
64
|
-
onStateChange() {
|
|
65
|
-
this.checkAndUpdate();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
checkAndUpdate() {
|
|
69
|
-
// Should always check the bridge to see if the component should
|
|
70
|
-
// update itself (re-render)
|
|
71
|
-
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
72
|
-
|
|
73
|
-
// ONLY call updateSelf when the component should update
|
|
74
|
-
if (bUpdateSelf) {
|
|
75
|
-
this.updateSelf();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// updateSelf
|
|
80
|
-
updateSelf(): void {
|
|
81
|
-
// moved this from ngOnInit() and call this from there instead...
|
|
27
|
+
/**
|
|
28
|
+
* Updates the component when there are changes in the state.
|
|
29
|
+
*/
|
|
30
|
+
override updateSelf(): void {
|
|
31
|
+
// Resolve config properties
|
|
82
32
|
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as RichTextProps;
|
|
83
|
-
const stateProps: any = this.pConn$.getStateProps();
|
|
84
|
-
this.status = stateProps?.status;
|
|
85
|
-
|
|
86
|
-
if (this.configProps$.value != undefined) {
|
|
87
|
-
this.value$ = this.configProps$.value;
|
|
88
|
-
}
|
|
89
33
|
|
|
90
|
-
|
|
91
|
-
this.
|
|
92
|
-
this.label$ = this.configProps$.label;
|
|
93
|
-
this.placeholder = this.configProps$.placeholder;
|
|
94
|
-
this.info = stateProps?.validatemessage || this.configProps$.helperText;
|
|
95
|
-
this.error = stateProps?.status === 'error';
|
|
34
|
+
// Update component common properties
|
|
35
|
+
this.updateComponentCommonProperties(this.configProps$);
|
|
96
36
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (this.configProps$.visibility != null) {
|
|
102
|
-
this.bVisible$ = this.utils.getBooleanValue(this.configProps$.visibility);
|
|
103
|
-
}
|
|
37
|
+
// Extract and normalize the value property
|
|
38
|
+
const { value, helperText } = this.configProps$;
|
|
39
|
+
this.value$ = value;
|
|
104
40
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (this.configProps$.readOnly != null) {
|
|
110
|
-
this.bReadonly$ = this.utils.getBooleanValue(this.configProps$.readOnly);
|
|
111
|
-
}
|
|
41
|
+
const { status, validatemessage } = this.pConn$.getStateProps();
|
|
42
|
+
this.status = status;
|
|
43
|
+
this.info = validatemessage || helperText;
|
|
44
|
+
this.error = status === 'error';
|
|
112
45
|
}
|
|
113
46
|
|
|
114
|
-
fieldOnChange() {
|
|
115
|
-
|
|
116
|
-
|
|
47
|
+
fieldOnChange(editorValue: any) {
|
|
48
|
+
const oldVal = this.value$ ?? '';
|
|
49
|
+
const newVal = editorValue?.editor?.getBody()?.innerHTML ?? '';
|
|
50
|
+
const isValueChanged = newVal.toString() !== oldVal.toString();
|
|
51
|
+
|
|
52
|
+
if (isValueChanged || this.status === 'error') {
|
|
53
|
+
const property = this.propName;
|
|
117
54
|
this.pConn$.clearErrorMessages({
|
|
118
55
|
property,
|
|
119
56
|
category: '',
|
|
@@ -123,9 +60,11 @@ export class RichTextComponent implements OnInit, OnDestroy {
|
|
|
123
60
|
}
|
|
124
61
|
|
|
125
62
|
fieldOnBlur(editorValue: any) {
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
63
|
+
const oldVal = this.value$ ?? '';
|
|
64
|
+
const isValueChanged = editorValue.toString() !== oldVal.toString();
|
|
65
|
+
|
|
66
|
+
if (isValueChanged) {
|
|
67
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, editorValue);
|
|
68
|
+
}
|
|
130
69
|
}
|
|
131
70
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, forwardRef
|
|
3
|
-
|
|
4
|
-
import {
|
|
2
|
+
import { Component, forwardRef } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
import { FieldBase } from '@pega/angular-sdk-components';
|
|
5
5
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
6
6
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
7
7
|
|
|
@@ -17,104 +17,47 @@ interface ScalarListProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
17
17
|
selector: 'app-scalar-list',
|
|
18
18
|
templateUrl: './scalar-list.component.html',
|
|
19
19
|
styleUrls: ['./scalar-list.component.scss'],
|
|
20
|
-
standalone: true,
|
|
21
20
|
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
|
|
22
21
|
})
|
|
23
|
-
export class ScalarListComponent
|
|
24
|
-
@Input() pConn$: typeof PConnect;
|
|
25
|
-
@Input() formGroup$: FormGroup;
|
|
26
|
-
|
|
27
|
-
angularPConnectData: AngularPConnectData = {};
|
|
22
|
+
export class ScalarListComponent extends FieldBase {
|
|
28
23
|
configProps$: ScalarListProps;
|
|
29
24
|
|
|
30
|
-
label$ = '';
|
|
31
|
-
value$: any;
|
|
32
|
-
displayMode$?: string = '';
|
|
33
25
|
items: any[];
|
|
34
26
|
isDisplayModeEnabled = false;
|
|
35
|
-
controlName$: string;
|
|
36
|
-
fieldControl = new FormControl('', null);
|
|
37
|
-
bHasForm$ = true;
|
|
38
|
-
bReadonly$ = false;
|
|
39
|
-
|
|
40
|
-
constructor(private angularPConnect: AngularPConnectService) {}
|
|
41
|
-
|
|
42
|
-
ngOnInit(): void {
|
|
43
|
-
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
44
|
-
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
45
|
-
this.controlName$ = this.angularPConnect.getComponentID(this);
|
|
46
|
-
// Then, continue on with other initialization
|
|
47
|
-
|
|
48
|
-
// call updateSelf when initializing
|
|
49
|
-
// this.updateSelf();
|
|
50
|
-
this.checkAndUpdate();
|
|
51
|
-
|
|
52
|
-
if (this.formGroup$) {
|
|
53
|
-
// add control to formGroup
|
|
54
|
-
this.formGroup$.addControl(this.controlName$, this.fieldControl);
|
|
55
|
-
this.fieldControl.setValue(this.value$);
|
|
56
|
-
this.bHasForm$ = true;
|
|
57
|
-
} else {
|
|
58
|
-
this.bReadonly$ = true;
|
|
59
|
-
this.bHasForm$ = false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
ngOnDestroy(): void {
|
|
64
|
-
if (this.formGroup$) {
|
|
65
|
-
this.formGroup$.removeControl(this.controlName$);
|
|
66
|
-
}
|
|
67
27
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onStateChange() {
|
|
75
|
-
this.checkAndUpdate();
|
|
76
|
-
}
|
|
28
|
+
/**
|
|
29
|
+
* Updates the component when there are changes in the state.
|
|
30
|
+
*/
|
|
31
|
+
override updateSelf(): void {
|
|
32
|
+
// Resolve config properties
|
|
33
|
+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ScalarListProps;
|
|
77
34
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
// update itself (re-render)
|
|
81
|
-
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
35
|
+
// Extract properties from config props
|
|
36
|
+
const { componentType, displayMode = '', label, value, restProps } = this.configProps$;
|
|
82
37
|
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
}
|
|
38
|
+
// Update component properties
|
|
39
|
+
this.label$ = label;
|
|
40
|
+
this.displayMode$ = displayMode;
|
|
88
41
|
|
|
89
|
-
|
|
90
|
-
updateSelf(): void {
|
|
91
|
-
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as ScalarListProps;
|
|
92
|
-
this.label$ = this.configProps$.label;
|
|
93
|
-
const componentType = this.configProps$.componentType;
|
|
94
|
-
const scalarValues = this.configProps$.value;
|
|
95
|
-
this.displayMode$ = this.configProps$.displayMode;
|
|
96
|
-
const restProps = this.configProps$.restProps;
|
|
97
|
-
console.log('scalar values: ', scalarValues);
|
|
98
|
-
this.items = scalarValues?.map(scalarValue => {
|
|
99
|
-
console.log('scalar value: ', scalarValue);
|
|
42
|
+
this.items = value?.map(scalarValue => {
|
|
100
43
|
return this.pConn$.createComponent(
|
|
101
44
|
{
|
|
102
45
|
type: componentType,
|
|
103
46
|
config: {
|
|
104
|
-
// @ts-ignore - Object literal may only specify known properties, and 'value' does not exist in type 'ComponentMetadataConfig'.
|
|
105
47
|
value: scalarValue,
|
|
106
|
-
displayMode: '
|
|
48
|
+
displayMode: 'DISPLAY_ONLY',
|
|
107
49
|
label: this.label$,
|
|
108
50
|
...restProps,
|
|
109
51
|
readOnly: true
|
|
110
52
|
}
|
|
111
53
|
},
|
|
112
54
|
'',
|
|
113
|
-
|
|
55
|
+
0,
|
|
114
56
|
{}
|
|
115
57
|
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
|
|
116
58
|
});
|
|
117
|
-
|
|
59
|
+
|
|
60
|
+
this.isDisplayModeEnabled = ['STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(this.displayMode$ as string);
|
|
118
61
|
this.value$ = this.items;
|
|
119
62
|
}
|
|
120
63
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<div
|
|
2
|
+
*ngIf="type === 'checkbox'"
|
|
3
|
+
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); grid-auto-rows: 1fr; gap: 0.5rem"
|
|
4
|
+
>
|
|
5
|
+
<div *ngFor="let cardContent of contentList">
|
|
6
|
+
<mat-card [ngStyle]="cardStyle" appearance="outlined" (click)="cardSelect($event, cardContent.commonCardProps)">
|
|
7
|
+
<img
|
|
8
|
+
*ngIf="cardContent.cardImage"
|
|
9
|
+
mat-card-image
|
|
10
|
+
src="{{ cardContent.cardImage.src }}"
|
|
11
|
+
alt="{{ cardContent.cardImage.alt }}"
|
|
12
|
+
[ngStyle]="cardContent.cardImage.style"
|
|
13
|
+
/>
|
|
14
|
+
<mat-card-content>
|
|
15
|
+
<mat-checkbox
|
|
16
|
+
[labelPosition]="'after'"
|
|
17
|
+
[checked]="cardContent.commonCardProps.selected"
|
|
18
|
+
[disabled]="disabled || readOnly"
|
|
19
|
+
[attr.data-test-id]="testId + ':' + cardContent.commonCardProps.label"
|
|
20
|
+
(change)="handleChangeMultiMode($event, cardContent.commonCardProps)"
|
|
21
|
+
(blur)="fieldOnBlur()"
|
|
22
|
+
>{{ cardContent.commonCardProps.label }}</mat-checkbox
|
|
23
|
+
>
|
|
24
|
+
<div
|
|
25
|
+
*ngFor="let field of cardContent.commonCardProps.fields"
|
|
26
|
+
[ngStyle]="field.type !== 'TextArea' ? (field.name ? defaultStyle : noLabelStyle) : specialStyle"
|
|
27
|
+
>
|
|
28
|
+
<div>{{ field.name }}</div>
|
|
29
|
+
<div>{{ field?.value?.getPConnect().getConfigProps().value ?? '--' }}</div>
|
|
30
|
+
</div>
|
|
31
|
+
</mat-card-content>
|
|
32
|
+
</mat-card>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<mat-radio-group
|
|
37
|
+
*ngIf="type === 'radio'"
|
|
38
|
+
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); grid-auto-rows: 1fr; gap: 0.5rem"
|
|
39
|
+
[name]="propName"
|
|
40
|
+
[value]="radioBtnValue"
|
|
41
|
+
(change)="fieldOnChange($event.value)"
|
|
42
|
+
>
|
|
43
|
+
<div *ngFor="let cardContent of contentList">
|
|
44
|
+
<mat-card [ngStyle]="cardStyle" appearance="outlined" (click)="cardSelect($event, cardContent.commonCardProps)">
|
|
45
|
+
<img
|
|
46
|
+
*ngIf="cardContent.cardImage"
|
|
47
|
+
mat-card-image
|
|
48
|
+
src="{{ cardContent.cardImage.src }}"
|
|
49
|
+
alt="{{ cardContent.cardImage.alt }}"
|
|
50
|
+
[ngStyle]="cardContent.cardImage.style"
|
|
51
|
+
/>
|
|
52
|
+
<mat-card-content>
|
|
53
|
+
<mat-radio-button
|
|
54
|
+
[checked]="radioBtnValue === cardContent?.commonCardProps?.key"
|
|
55
|
+
[disabled]="disabled"
|
|
56
|
+
[value]="cardContent.commonCardProps.key"
|
|
57
|
+
>
|
|
58
|
+
{{ cardContent.commonCardProps.label }}
|
|
59
|
+
</mat-radio-button>
|
|
60
|
+
<div
|
|
61
|
+
*ngFor="let field of cardContent.commonCardProps.fields"
|
|
62
|
+
[ngStyle]="field.type !== 'TextArea' ? (field.name ? defaultStyle : noLabelStyle) : specialStyle"
|
|
63
|
+
>
|
|
64
|
+
<div>{{ field.name }}</div>
|
|
65
|
+
<div>{{ field?.value?.getPConnect().getConfigProps().value ?? '--' }}</div>
|
|
66
|
+
</div>
|
|
67
|
+
</mat-card-content>
|
|
68
|
+
</mat-card>
|
|
69
|
+
</div>
|
|
70
|
+
</mat-radio-group>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SelectableCardComponent } from './selectable-card.component';
|
|
4
|
+
|
|
5
|
+
describe('SelectableCardComponent', () => {
|
|
6
|
+
let component: SelectableCardComponent;
|
|
7
|
+
let fixture: ComponentFixture<SelectableCardComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [SelectableCardComponent]
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
|
|
14
|
+
fixture = TestBed.createComponent(SelectableCardComponent);
|
|
15
|
+
component = fixture.componentInstance;
|
|
16
|
+
fixture.detectChanges();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should create', () => {
|
|
20
|
+
expect(component).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { Component, Input, OnInit, EventEmitter, Output } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { MatCardModule } from '@angular/material/card';
|
|
4
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
5
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
6
|
+
import { deleteInstruction, insertInstruction } from '@pega/angular-sdk-components';
|
|
7
|
+
import { handleEvent } from '@pega/angular-sdk-components';
|
|
8
|
+
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
9
|
+
import { FieldBase } from '@pega/angular-sdk-components';
|
|
10
|
+
|
|
11
|
+
interface SelectableCardProps extends PConnFieldProps {
|
|
12
|
+
selectionList: any;
|
|
13
|
+
readonlyContextList: any;
|
|
14
|
+
image: string;
|
|
15
|
+
primaryField: string;
|
|
16
|
+
selectionKey: string;
|
|
17
|
+
renderMode: string;
|
|
18
|
+
hideFieldLabels?: boolean;
|
|
19
|
+
additionalProps?: any;
|
|
20
|
+
imagePosition?: string;
|
|
21
|
+
imageSize?: string;
|
|
22
|
+
showImageDescription?: boolean;
|
|
23
|
+
datasource?: any;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@Component({
|
|
27
|
+
selector: 'lib-selectable-card',
|
|
28
|
+
imports: [MatCardModule, CommonModule, MatRadioModule, MatCheckboxModule],
|
|
29
|
+
templateUrl: './selectable-card.component.html',
|
|
30
|
+
styleUrl: './selectable-card.component.scss'
|
|
31
|
+
})
|
|
32
|
+
export class SelectableCardComponent extends FieldBase implements OnInit {
|
|
33
|
+
@Input() type: string;
|
|
34
|
+
@Output() valueChange: EventEmitter<any> = new EventEmitter();
|
|
35
|
+
|
|
36
|
+
configProps$: SelectableCardProps;
|
|
37
|
+
readOnly = false;
|
|
38
|
+
disabled = false;
|
|
39
|
+
radioBtnValue;
|
|
40
|
+
additionalProps;
|
|
41
|
+
showNoValue = false;
|
|
42
|
+
selectionKey?: string;
|
|
43
|
+
defaultStyle = {};
|
|
44
|
+
specialStyle = {};
|
|
45
|
+
cardStyle = {};
|
|
46
|
+
noLabelStyle: {};
|
|
47
|
+
selectedvalues: any;
|
|
48
|
+
selectionList: any;
|
|
49
|
+
primaryField: string;
|
|
50
|
+
commonProps: any = {};
|
|
51
|
+
contentList: [
|
|
52
|
+
{
|
|
53
|
+
commonCardProps: { id: string; key: string; fields: any; label: string; selected: boolean };
|
|
54
|
+
cardImage: { src: string; alt: string; style: any };
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
override ngOnInit(): void {
|
|
59
|
+
super.ngOnInit();
|
|
60
|
+
|
|
61
|
+
// styles used in displaying common field props
|
|
62
|
+
this.defaultStyle = {
|
|
63
|
+
display: 'grid',
|
|
64
|
+
gridTemplateColumns: '1fr 1fr',
|
|
65
|
+
margin: '0.5rem',
|
|
66
|
+
wordBreak: 'break-word',
|
|
67
|
+
fontSize: '0.875rem'
|
|
68
|
+
};
|
|
69
|
+
this.specialStyle = {
|
|
70
|
+
margin: '0.5rem',
|
|
71
|
+
fontSize: '0.875rem'
|
|
72
|
+
};
|
|
73
|
+
this.noLabelStyle = {
|
|
74
|
+
alignItems: 'start',
|
|
75
|
+
marginLeft: '0.5rem'
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
override updateSelf(): void {
|
|
80
|
+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps()) as SelectableCardProps;
|
|
81
|
+
|
|
82
|
+
const hideFieldLabels = this.configProps$.hideFieldLabels;
|
|
83
|
+
const datasource: any = this.configProps$.datasource;
|
|
84
|
+
const additionalProps: any = this.configProps$.additionalProps;
|
|
85
|
+
const imageSize: string = this.configProps$.imageSize ?? ''; // not using
|
|
86
|
+
const showImageDescription: boolean = this.configProps$.showImageDescription ?? false;
|
|
87
|
+
let recordKey = '';
|
|
88
|
+
let cardLabel = '';
|
|
89
|
+
let image: any;
|
|
90
|
+
|
|
91
|
+
this.disabled = this.configProps$.disabled;
|
|
92
|
+
this.readOnly = this.configProps$.renderMode === 'ReadOnly' || this.displayMode$ === 'DISPLAY_ONLY' || this.configProps$.readOnly;
|
|
93
|
+
const imagePosition = this.configProps$.imagePosition;
|
|
94
|
+
|
|
95
|
+
// dynamic styling based on image position and readOnly option
|
|
96
|
+
let imageWidth = '100%';
|
|
97
|
+
this.cardStyle = { display: 'flex', flexDirection: 'column', height: '100%' };
|
|
98
|
+
if (imagePosition && imagePosition !== 'block-start') {
|
|
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
|
+
}
|
|
111
|
+
if (this.type === 'radio') {
|
|
112
|
+
const stateProps = this.pConn$.getStateProps();
|
|
113
|
+
image = {
|
|
114
|
+
imagePosition,
|
|
115
|
+
imageSize,
|
|
116
|
+
showImageDescription,
|
|
117
|
+
imageField: stateProps.image?.split('.').pop(),
|
|
118
|
+
imageDescription: stateProps.imageDescription?.split('.').pop()
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
recordKey = stateProps.value?.split('.').pop() ?? '';
|
|
122
|
+
cardLabel = stateProps.primaryField?.split('.').pop() ?? '';
|
|
123
|
+
|
|
124
|
+
this.value$ = this.configProps$.value;
|
|
125
|
+
this.radioBtnValue = this.value$;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (this.type === 'checkbox') {
|
|
129
|
+
this.testId = this.configProps$.testId;
|
|
130
|
+
this.displayMode$ = this.configProps$.displayMode ?? '';
|
|
131
|
+
|
|
132
|
+
this.selectionKey = this.configProps$.selectionKey;
|
|
133
|
+
recordKey = this.selectionKey?.split('.').pop() ?? '';
|
|
134
|
+
cardLabel = this.configProps$.primaryField.split('.').pop() ?? '';
|
|
135
|
+
|
|
136
|
+
image = {
|
|
137
|
+
imagePosition,
|
|
138
|
+
imageSize,
|
|
139
|
+
showImageDescription,
|
|
140
|
+
imageField: this.configProps$.image?.split('.').pop(),
|
|
141
|
+
imageDescription: (this.pConn$?.getRawMetadata()?.config as any).imageDescription?.split('.').pop()
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
this.selectionList = this.configProps$.selectionList;
|
|
145
|
+
this.selectedvalues = this.configProps$.readonlyContextList;
|
|
146
|
+
this.showNoValue = this.readOnly && this.selectedvalues?.length === 0; // not used
|
|
147
|
+
this.primaryField = this.configProps$.primaryField;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
this.commonProps = { hideFieldLabels, datasource, additionalProps, image, recordKey, cardLabel, radioBtnValue: this.radioBtnValue ?? '' };
|
|
151
|
+
const imageDescriptionKey = this.commonProps?.image?.showImageDescription ? this.commonProps?.image?.imageDescription : undefined;
|
|
152
|
+
const cardDataSource = this.readOnly || this.displayMode$ == 'DISPLAY_ONLY' ? this.selectedvalues || [] : this.commonProps?.datasource?.source;
|
|
153
|
+
|
|
154
|
+
this.contentList = cardDataSource.map(item => {
|
|
155
|
+
const resolvedFields = this.utils.resolveReferenceFields(item, this.commonProps.hideFieldLabels, this.commonProps.recordKey, this.pConn$);
|
|
156
|
+
const commonCardProps = {
|
|
157
|
+
id: item[this.commonProps.recordKey],
|
|
158
|
+
key: item[this.commonProps.recordKey],
|
|
159
|
+
fields: resolvedFields,
|
|
160
|
+
label: item[this.commonProps.cardLabel],
|
|
161
|
+
selected: this.selectedvalues
|
|
162
|
+
? this.selectedvalues?.some?.(data => data[this.commonProps.recordKey] === item[this.commonProps.recordKey])
|
|
163
|
+
: false
|
|
164
|
+
};
|
|
165
|
+
const cardImage = item[this.commonProps.image.imageField]
|
|
166
|
+
? {
|
|
167
|
+
src: item[this.commonProps.image.imageField],
|
|
168
|
+
alt: this.commonProps.image.showImageDescription && imageDescriptionKey ? item[imageDescriptionKey] : '',
|
|
169
|
+
style: {
|
|
170
|
+
width: imageWidth,
|
|
171
|
+
backgroundColor: 'transparent',
|
|
172
|
+
aspectRatio: '16/9',
|
|
173
|
+
maxHeight: '100%',
|
|
174
|
+
objectFit: 'contain',
|
|
175
|
+
maxWidth: '100%',
|
|
176
|
+
height: this.readOnly && imagePosition !== 'block-start' ? '5rem' : ''
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
: undefined;
|
|
180
|
+
|
|
181
|
+
return { cardImage, commonCardProps };
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
fieldOnChange(value: any) {
|
|
186
|
+
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
fieldOnBlur() {
|
|
190
|
+
this.pConn$.getValidationApi().validate(this.selectedvalues, this.selectionList);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
handleChangeMultiMode(event, element) {
|
|
194
|
+
if (!element.selected) {
|
|
195
|
+
insertInstruction(this.pConn$, this.selectionList, this.selectionKey, this.primaryField, {
|
|
196
|
+
id: element.id,
|
|
197
|
+
primary: element.label
|
|
198
|
+
});
|
|
199
|
+
} else {
|
|
200
|
+
deleteInstruction(this.pConn$, this.selectionList, this.selectionKey, {
|
|
201
|
+
id: element.key,
|
|
202
|
+
primary: element.label
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
this.pConn$.clearErrorMessages({
|
|
206
|
+
property: this.selectionList,
|
|
207
|
+
category: '',
|
|
208
|
+
context: ''
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
cardSelect(event, element) {
|
|
213
|
+
if (this.type === 'radio') {
|
|
214
|
+
this.fieldOnChange(element.key);
|
|
215
|
+
} else if (this.type === 'checkbox') {
|
|
216
|
+
this.handleChangeMultiMode(event, element);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
<div *ngIf="
|
|
2
|
-
<
|
|
1
|
+
<div *ngIf="bVisible$ !== false">
|
|
2
|
+
<a *ngIf="!isLinkTextEmpty; else noLink" class="psdk-value" href="#" (click)="openLinkClick($event)">{{ value$ || '---' }}</a>
|
|
3
3
|
</div>
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
<div *ngIf="label$ !== undefined && bVisible$ !== false" class="psdk-grid-filter">
|
|
7
|
-
<div class="psdk-grid-label">{{ label$ }}</div>
|
|
8
|
-
<div class="psdk-value">{{ value$ || '---' }}</div>
|
|
9
|
-
</div>
|
|
4
|
+
<ng-template #noLink>
|
|
5
|
+
<div class="psdk-value">{{ value$ || '---' }}</div>
|
|
10
6
|
</ng-template>
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
.psdk-grid-filter {
|
|
2
|
-
display: grid;
|
|
3
|
-
grid-template-columns: repeat(2, 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-label {
|
|
10
|
-
color: var(--app-label-color);
|
|
11
|
-
margin: 8px 0px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
1
|
.psdk-value {
|
|
15
2
|
margin: 8px 0px;
|
|
16
3
|
}
|