@pega/dx-component-builder-sdk 0.242.11 → 0.242.12
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/package.json +1 -1
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.html.mustache +3 -3
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +16 -13
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.html.mustache +3 -3
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.ts.mustache +14 -11
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.html.mustache +2 -3
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +15 -9
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/demo.stories.tsx.mustache +1 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.ts.mustache +82 -67
- package/tests/assets/sdk-a/components/create/override-sdk/field/currency/currency.component.html +3 -3
- package/tests/assets/sdk-a/components/create/override-sdk/field/currency/currency.component.ts +14 -11
- package/tests/assets/sdk-a/components/create/override-sdk/field/decimal/decimal.component.html +3 -3
- package/tests/assets/sdk-a/components/create/override-sdk/field/decimal/decimal.component.ts +16 -13
- package/tests/assets/sdk-a/components/create/override-sdk/field/percentage/percentage.component.html +2 -3
- package/tests/assets/sdk-a/components/create/override-sdk/field/percentage/percentage.component.ts +15 -9
- package/tests/assets/sdk-a/components/create/override-sdk/template/list-view/list-view.component.html +3 -0
- package/tests/assets/sdk-a/components/create/override-sdk/template/list-view/list-view.component.scss +11 -0
- package/tests/assets/sdk-a/components/create/override-sdk/template/list-view/list-view.component.ts +21 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-currency/pega-dxil-my-currency.component.html +3 -3
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-currency/pega-dxil-my-currency.component.ts +14 -11
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-decimal/pega-dxil-my-decimal.component.html +3 -3
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-decimal/pega-dxil-my-decimal.component.ts +16 -13
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-percentage/pega-dxil-my-percentage.component.html +2 -3
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-percentage/pega-dxil-my-percentage.component.ts +15 -9
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-picklist/demo.stories.tsx +1 -0
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-picklist/pega-dxil-my-picklist.component.ts +82 -67
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/currency/currency.component.html +3 -3
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/currency/currency.component.ts +14 -11
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/decimal/decimal.component.html +3 -3
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/decimal/decimal.component.ts +16 -13
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/percentage/percentage.component.html +2 -3
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/percentage/percentage.component.ts +15 -9
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/list-view/list-view.component.html +3 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/list-view/list-view.component.scss +11 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/list-view/list-view.component.ts +21 -1
- package/tests/functional/sdk-a/localCreatePublishDeleteOverride.test.js +1 -1
|
@@ -48,8 +48,8 @@ export class PercentageComponent implements OnInit, OnDestroy {
|
|
|
48
48
|
testId: string;
|
|
49
49
|
helperText: string;
|
|
50
50
|
placeholder: string;
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
decimalSeparator: string;
|
|
52
|
+
thousandSeparator: string;
|
|
53
53
|
inputMode: any;
|
|
54
54
|
decimalPrecision: number | undefined;
|
|
55
55
|
fieldControl = new FormControl<number | null>(null, null);
|
|
@@ -121,14 +121,15 @@ export class PercentageComponent implements OnInit, OnDestroy {
|
|
|
121
121
|
const nValue: any = this.configProps$.value;
|
|
122
122
|
if (nValue) {
|
|
123
123
|
this.value$ = nValue;
|
|
124
|
+
this.fieldControl.setValue(nValue);
|
|
124
125
|
}
|
|
125
126
|
this.helperText = this.configProps$.helperText;
|
|
126
127
|
this.placeholder = this.configProps$.placeholder || '';
|
|
127
128
|
const showGroupSeparators = this.configProps$.showGroupSeparators;
|
|
128
129
|
|
|
129
130
|
const theSymbols = getCurrencyCharacters('');
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
131
|
+
this.decimalSeparator = theSymbols.theDecimalIndicator;
|
|
132
|
+
this.thousandSeparator = showGroupSeparators ? theSymbols.theDigitGroupSeparator : '';
|
|
132
133
|
|
|
133
134
|
this.actionsApi = this.pConn$.getActionsApi();
|
|
134
135
|
this.propName = this.pConn$.getStateProps().value;
|
|
@@ -187,11 +188,16 @@ export class PercentageComponent implements OnInit, OnDestroy {
|
|
|
187
188
|
fieldOnBlur(event: any) {
|
|
188
189
|
let value = event?.target?.value;
|
|
189
190
|
value = value ? value.replace(/%/g, '') : '';
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
value = value
|
|
191
|
+
// replacing thousand separator with empty string as not required in api call
|
|
192
|
+
if (this.configProps$.showGroupSeparators) {
|
|
193
|
+
const thousandSep = this.thousandSeparator === '.' ? '\\.' : this.thousandSeparator;
|
|
194
|
+
const regExp = new RegExp(String.raw`${thousandSep}`, 'g');
|
|
195
|
+
value = value?.replace(regExp, '');
|
|
196
|
+
}
|
|
197
|
+
// replacing decimal separator with '.'
|
|
198
|
+
if (this.decimalSeparator !== '.') {
|
|
199
|
+
const regExp = new RegExp(String.raw`${this.decimalSeparator}`, 'g');
|
|
200
|
+
value = value.replace(regExp, '.');
|
|
195
201
|
}
|
|
196
202
|
handleEvent(this.actionsApi, 'changeNblur', this.propName, value);
|
|
197
203
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
<div class="psdk-list-header">
|
|
2
2
|
<div>
|
|
3
|
+
<h3 *ngIf="label" class="label" style="font-weight: bold">
|
|
4
|
+
{{ label }} <span class="results-count">{{ getResultsText() }}</span>
|
|
5
|
+
</h3>
|
|
3
6
|
<mat-form-field class="psdk-search" *ngIf="bShowSearch$">
|
|
4
7
|
<mat-label><img class="psdk-icon-search" src="{{ searchIcon$ }}" /> <span class="psdk-search-label">Search</span> </mat-label>
|
|
5
8
|
<input matInput id="search" (keyup)="applySearch($event)" placeholder="" />
|
|
@@ -165,3 +165,14 @@ tr.mat-mdc-row {
|
|
|
165
165
|
background-color: transparent;
|
|
166
166
|
align-items: center;
|
|
167
167
|
}
|
|
168
|
+
|
|
169
|
+
.results-count {
|
|
170
|
+
opacity: 0.7;
|
|
171
|
+
font-size: 0.8rem;
|
|
172
|
+
font-weight: bold;
|
|
173
|
+
margin-inline-start: 0.625rem;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.label {
|
|
177
|
+
margin: 8px;
|
|
178
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
1
|
import { Component, OnInit, Input, ViewChild, forwardRef, OnDestroy } from '@angular/core';
|
|
3
2
|
import { CommonModule } from '@angular/common';
|
|
4
3
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
@@ -29,6 +28,8 @@ declare const window: any;
|
|
|
29
28
|
const SELECTION_MODE = { SINGLE: 'single', MULTI: 'multi' };
|
|
30
29
|
|
|
31
30
|
interface ListViewProps {
|
|
31
|
+
inheritedProps: any;
|
|
32
|
+
title: string | undefined;
|
|
32
33
|
// If any, enter additional props that only exist on this component
|
|
33
34
|
globalSearch?: boolean;
|
|
34
35
|
referenceList?: any;
|
|
@@ -42,6 +43,7 @@ interface ListViewProps {
|
|
|
42
43
|
grouping: string | boolean;
|
|
43
44
|
value: any;
|
|
44
45
|
readonlyContextList: any;
|
|
46
|
+
label?: string;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
export class Group {
|
|
@@ -159,6 +161,7 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
159
161
|
xRayApis = PCore.getDebugger().getXRayRuntime();
|
|
160
162
|
xRayUid = this.xRayApis.startXRay();
|
|
161
163
|
checkBoxValue: string;
|
|
164
|
+
label?: string = '';
|
|
162
165
|
|
|
163
166
|
constructor(
|
|
164
167
|
private psService: ProgressSpinnerService,
|
|
@@ -192,6 +195,18 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
192
195
|
this.arFilterMainButtons$.push({ actionID: 'submit', jsAction: 'submit', name: 'Submit' });
|
|
193
196
|
this.arFilterSecondaryButtons$.push({ actionID: 'cancel', jsAction: 'cancel', name: 'Cancel' });
|
|
194
197
|
|
|
198
|
+
let title = this.configProps$?.title || this.configProps$?.label || 'List';
|
|
199
|
+
const inheritedProps = this.configProps$?.inheritedProps;
|
|
200
|
+
if (title === 'List' && inheritedProps) {
|
|
201
|
+
for (const inheritedProp of inheritedProps) {
|
|
202
|
+
if (inheritedProp?.prop === 'label') {
|
|
203
|
+
title = inheritedProp?.value;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
this.label = title;
|
|
209
|
+
|
|
195
210
|
this.searchIcon$ = this.utils.getImageSrc('search', this.utils.getSDKStaticContentUrl());
|
|
196
211
|
setTimeout(() => {
|
|
197
212
|
PCore.getPubSubUtils().subscribe(
|
|
@@ -1380,6 +1395,11 @@ export class ListViewComponent implements OnInit, OnDestroy {
|
|
|
1380
1395
|
return listFields;
|
|
1381
1396
|
}
|
|
1382
1397
|
|
|
1398
|
+
getResultsText() {
|
|
1399
|
+
const recordsCount = this.repeatList$?.paginator?.length || 0;
|
|
1400
|
+
return `${recordsCount || 0} result${recordsCount > 1 ? 's' : ''}`;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1383
1403
|
getField(fieldDefs, columnId) {
|
|
1384
1404
|
const fieldsMap = this.getFieldsMap(fieldDefs);
|
|
1385
1405
|
return fieldsMap.get(columnId);
|