@pega/dx-component-builder-sdk 0.242.8 → 0.242.9
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/Constellation/field/Decimal/index.tsx.mustache +3 -6
- package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.tsx.mustache +1 -3
- package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.tsx.mustache +2 -5
- package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/index.tsx.mustache +10 -52
- package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache +1 -1
- package/src/tasks/create/templates/Constellation/template/DETAILS/Avatar.tsx.mustache +5 -7
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/Avatar.tsx.mustache +5 -7
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Avatar.tsx.mustache +5 -7
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +21 -19
- package/src/tasks/map/map.js +2 -1
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
- package/tests/assets/sdk-r/components/create/override-sdk/field/Phone/Phone.tsx +5 -5
- package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.css +0 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +28 -29
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyCurrency/index.tsx +1 -3
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyDecimal/index.tsx +3 -6
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPercentage/index.tsx +2 -5
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +10 -52
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Avatar.tsx +5 -7
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +5 -7
- package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +5 -7
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +5 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +8 -21
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldValueList/FieldValueList.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Phone/Phone.tsx +5 -5
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.css +0 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +28 -29
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +5 -10
package/package.json
CHANGED
|
@@ -88,9 +88,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
88
88
|
}, [validatemessage, hasSuggestions, status]);
|
|
89
89
|
|
|
90
90
|
const { decimalPrecision, currencyDecimalPrecision } = props;
|
|
91
|
-
let numberOfDecimals = parseInt(decimalPrecision, 10);
|
|
91
|
+
let numberOfDecimals: number | undefined = parseInt(decimalPrecision, 10);
|
|
92
92
|
if (Number.isNaN(numberOfDecimals)) {
|
|
93
|
-
// @ts-ignore
|
|
94
93
|
numberOfDecimals = decimalPrecision === '' ? undefined : 2;
|
|
95
94
|
}
|
|
96
95
|
let noOfFractionDigits = currencyDecimalPrecision === 'auto' ? undefined : parseInt(currencyDecimalPrecision, 10);
|
|
@@ -226,15 +225,13 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
226
225
|
}
|
|
227
226
|
setDecimalValue(enteredValue);
|
|
228
227
|
if (value !== (enteredValue !== '' ? Number(enteredValue) : '')) {
|
|
229
|
-
|
|
230
|
-
handleEvent(actions, 'change', propName, enteredValue !== '' ? Number(enteredValue) : '');
|
|
228
|
+
handleEvent(actions, 'change', propName, enteredValue !== '' ? Number(enteredValue).toString() : '');
|
|
231
229
|
hasValueChange.current = true;
|
|
232
230
|
}
|
|
233
231
|
}}
|
|
234
232
|
onBlur={() => {
|
|
235
233
|
if (!value || hasValueChange.current) {
|
|
236
|
-
|
|
237
|
-
handleEvent(actions, 'blur', propName, decimalValue !== '' ? Number(decimalValue) : '');
|
|
234
|
+
handleEvent(actions, 'blur', propName, decimalValue !== '' ? Number(decimalValue).toString() : '');
|
|
238
235
|
if (hasSuggestions) {
|
|
239
236
|
pConn.ignoreSuggestion("");
|
|
240
237
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { useState, useEffect } from 'react';
|
|
3
2
|
import {
|
|
4
3
|
CurrencyInput as CosmosCurrency,
|
|
@@ -265,9 +264,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
265
264
|
});
|
|
266
265
|
}}
|
|
267
266
|
onBlur={(enteredValue) => {
|
|
268
|
-
const parsedValue = enteredValue !== '' ? Number(enteredValue) : enteredValue;
|
|
267
|
+
const parsedValue = enteredValue !== '' ? Number(enteredValue).toString() : enteredValue;
|
|
269
268
|
if (!readOnly && (!value || value !== parsedValue)) {
|
|
270
|
-
// @ts-ignore
|
|
271
269
|
handleEvent(actions, 'changeNblur', propName, parsedValue);
|
|
272
270
|
if (hasSuggestions) {
|
|
273
271
|
pConn.ignoreSuggestion('');
|
package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.tsx.mustache
CHANGED
|
@@ -94,9 +94,8 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
94
94
|
}
|
|
95
95
|
}, [validatemessage, hasSuggestions, status]);
|
|
96
96
|
|
|
97
|
-
let numberOfDecimals = parseInt(decimalPrecision, 10);
|
|
97
|
+
let numberOfDecimals : number | undefined = parseInt(decimalPrecision, 10);
|
|
98
98
|
if (Number.isNaN(numberOfDecimals)) {
|
|
99
|
-
// @ts-ignore
|
|
100
99
|
numberOfDecimals = decimalPrecision === '' ? undefined : 2;
|
|
101
100
|
}
|
|
102
101
|
|
|
@@ -247,15 +246,13 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
247
246
|
}
|
|
248
247
|
setPercentageValue(enteredValue);
|
|
249
248
|
if (value !== enteredValue) {
|
|
250
|
-
// @ts-ignore
|
|
251
249
|
handleEvent(actions, 'change', propName, enteredValue);
|
|
252
250
|
hasValueChange.current = true;
|
|
253
251
|
}
|
|
254
252
|
}}
|
|
255
253
|
onBlur={() => {
|
|
256
|
-
const parsedValue = percentageValue !== '' ? Number(percentageValue) : '';
|
|
254
|
+
const parsedValue = percentageValue !== '' ? Number(percentageValue).toString() : '';
|
|
257
255
|
if (!value || hasValueChange.current) {
|
|
258
|
-
// @ts-ignore
|
|
259
256
|
handleEvent(actions, 'blur', propName, parsedValue);
|
|
260
257
|
if (hasSuggestions) {
|
|
261
258
|
pConn.ignoreSuggestion("");
|
package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/index.tsx.mustache
CHANGED
|
@@ -497,14 +497,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
497
497
|
const pConn = getPConnect();
|
|
498
498
|
const contextName = getPConnect().getContextName();
|
|
499
499
|
const actions = pConn.getActionsApi();
|
|
500
|
-
const [dataApiObj, setDataApiObj] = useState(() => ({}));
|
|
500
|
+
const [dataApiObj, setDataApiObj] = useState(() => ({} as any));
|
|
501
501
|
const [filterValue, setFilterValue] = useState('');
|
|
502
502
|
const [loading, setLoading] = useState(listType !== 'associated');
|
|
503
503
|
// const selected = useMemo(() => menuHelpers.getSelected(items)[0], [items]);
|
|
504
504
|
const [selected, setSelected] = useState();
|
|
505
505
|
const hasMoreResults = useRef(true);
|
|
506
506
|
const inputValueRef = useRef('');
|
|
507
|
-
const displayFieldMeta = useRef(null);
|
|
507
|
+
const displayFieldMeta: any = useRef(null);
|
|
508
508
|
const [actualValue, setActualValue] = useState();
|
|
509
509
|
const [newRecordCreated, setNewRecordCreated] = useState();
|
|
510
510
|
|
|
@@ -645,15 +645,13 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
645
645
|
}
|
|
646
646
|
PCore.getDataApi()
|
|
647
647
|
.init(dataConfig, contextName)
|
|
648
|
-
.then(dataObj => {
|
|
649
|
-
// @ts-ignore
|
|
648
|
+
.then((dataObj: any) => {
|
|
650
649
|
setDataApiObj(dataObj);
|
|
651
650
|
// To avoid calling doSearch if someone types/pastes value before the API call is made
|
|
652
651
|
if (!filterValue)
|
|
653
652
|
doSearch(
|
|
654
653
|
'',
|
|
655
654
|
getDisplayFieldsMetaData(dataConfig.columns),
|
|
656
|
-
// @ts-ignore
|
|
657
655
|
dataObj,
|
|
658
656
|
setItems as any,
|
|
659
657
|
setLoading,
|
|
@@ -679,12 +677,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
679
677
|
if (!dataRefMount && !displayMode && listType === 'datapage') {
|
|
680
678
|
PCore.getDataApi()
|
|
681
679
|
.init(dataConfig, contextName)
|
|
682
|
-
.then(dataObj => {
|
|
683
|
-
// @ts-ignore
|
|
680
|
+
.then((dataObj: any) => {
|
|
684
681
|
setDataApiObj(dataObj);
|
|
685
682
|
// To avoid calling doSearch if someone types/pastes value before the API call is made
|
|
686
683
|
if (!filterValue) {
|
|
687
|
-
// @ts-ignore
|
|
688
684
|
if (displayFieldMeta?.current?.key === displayFieldMeta?.current?.primary) {
|
|
689
685
|
const displayItem = {
|
|
690
686
|
id: value,
|
|
@@ -696,7 +692,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
696
692
|
doSearch(
|
|
697
693
|
'',
|
|
698
694
|
getDisplayFieldsMetaData(dataConfig.columns),
|
|
699
|
-
// @ts-ignore
|
|
700
695
|
dataObj,
|
|
701
696
|
setItems as any,
|
|
702
697
|
setLoading,
|
|
@@ -716,7 +711,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
716
711
|
doSearch(
|
|
717
712
|
'',
|
|
718
713
|
getDisplayFieldsMetaData(dataConfig.columns),
|
|
719
|
-
// @ts-ignore
|
|
720
714
|
dataObj,
|
|
721
715
|
setItems as any,
|
|
722
716
|
setLoading,
|
|
@@ -775,22 +769,16 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
775
769
|
) {
|
|
776
770
|
PCore.getDataApi()
|
|
777
771
|
.init(dataConfig, contextName)
|
|
778
|
-
.then(dataObj => {
|
|
779
|
-
// @ts-ignore
|
|
772
|
+
.then((dataObj: any) => {
|
|
780
773
|
setDataApiObj(dataObj);
|
|
781
|
-
// @ts-ignore
|
|
782
774
|
buildColumnForDisplayValue(dataObj);
|
|
783
775
|
// SET matchPosition to EQUALS to return exact matching record
|
|
784
|
-
// @ts-ignore
|
|
785
776
|
dataObj.matchPosition = 'equals';
|
|
786
|
-
// @ts-ignore
|
|
787
777
|
dataObj
|
|
788
778
|
.fetchData(value)
|
|
789
779
|
.then((displayResponse: { data: Array<never> }) => {
|
|
790
780
|
let columnsWithSetProperty: string | Array<any> = [];
|
|
791
|
-
// @ts-ignore
|
|
792
781
|
if (dataApiObj.columns) {
|
|
793
|
-
// @ts-ignore
|
|
794
782
|
columnsWithSetProperty = dataApiObj.columns
|
|
795
783
|
.filter(
|
|
796
784
|
(col: { setProperty: string }) =>
|
|
@@ -805,12 +793,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
805
793
|
const searchedItem = displayResponseData.map((entry: { [x: string]: any }) => {
|
|
806
794
|
const secondaryArr: Array<any> = [];
|
|
807
795
|
const secondaryFieldValues: Array<any> = [];
|
|
808
|
-
// @ts-ignore
|
|
809
796
|
displayFieldMeta.current.secondary.forEach((col: string) => {
|
|
810
|
-
// @ts-ignore
|
|
811
797
|
if (!displayFieldMeta.hidden.includes(col)) secondaryArr.push(entry[col]);
|
|
812
798
|
if (columnsWithSetProperty.includes(col)) {
|
|
813
|
-
// @ts-ignore
|
|
814
799
|
if (dataApiObj.isQueryable) {
|
|
815
800
|
secondaryFieldValues.push(entry[col]);
|
|
816
801
|
} else {
|
|
@@ -819,9 +804,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
819
804
|
}
|
|
820
805
|
});
|
|
821
806
|
return {
|
|
822
|
-
// @ts-ignore
|
|
823
807
|
id: entry[displayFieldMeta.current.key],
|
|
824
|
-
// @ts-ignore
|
|
825
808
|
primary: entry[displayFieldMeta.current.primary],
|
|
826
809
|
secondary: secondaryArr,
|
|
827
810
|
secondaryFieldValues
|
|
@@ -832,13 +815,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
832
815
|
setSelected(searchedItem[0]);
|
|
833
816
|
setActualValue(value);
|
|
834
817
|
// RESET matchPosition
|
|
835
|
-
// @ts-ignore
|
|
836
818
|
dataObj.matchPosition = dataConfig.matchPosition;
|
|
837
819
|
})
|
|
838
820
|
.catch(() => {
|
|
839
821
|
setActualValue(value);
|
|
840
822
|
// RESET matchPosition
|
|
841
|
-
// @ts-ignore
|
|
842
823
|
dataObj.matchPosition = dataConfig.matchPosition;
|
|
843
824
|
});
|
|
844
825
|
});
|
|
@@ -856,21 +837,17 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
856
837
|
};
|
|
857
838
|
})
|
|
858
839
|
);
|
|
859
|
-
|
|
860
|
-
setSelected(null);
|
|
840
|
+
setSelected(undefined);
|
|
861
841
|
inputValueRef.current = '';
|
|
862
842
|
};
|
|
863
843
|
|
|
864
844
|
const onChangeHandler = (ev: { target: { value: any } }) => {
|
|
865
845
|
if (hasSuggestions) {
|
|
866
|
-
|
|
867
|
-
pConn.ignoreSuggestion();
|
|
846
|
+
pConn.ignoreSuggestion('');
|
|
868
847
|
setStatus(undefined);
|
|
869
848
|
}
|
|
870
849
|
|
|
871
|
-
// @ts-ignore
|
|
872
850
|
dataApiObj.columns = dataConfig.columns;
|
|
873
|
-
// @ts-ignore
|
|
874
851
|
dataApiObj.matchPosition = dataConfig.matchPosition;
|
|
875
852
|
const searchText = ev.target.value;
|
|
876
853
|
inputValueRef.current = searchText;
|
|
@@ -879,15 +856,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
879
856
|
clearSelections();
|
|
880
857
|
}
|
|
881
858
|
setFilterValue(searchText);
|
|
882
|
-
// @ts-ignore
|
|
883
859
|
if (listType === 'datapage' && dataApiObj.isQueryable) {
|
|
884
860
|
hasMoreResults.current = true;
|
|
885
861
|
if (searchText.length < 5) {
|
|
886
862
|
searchHandlerThrottled(
|
|
887
863
|
searchText,
|
|
888
|
-
// @ts-ignore
|
|
889
864
|
displayFieldMeta.current,
|
|
890
865
|
dataApiObj,
|
|
866
|
+
// @ts-ignore
|
|
891
867
|
setItems,
|
|
892
868
|
setLoading,
|
|
893
869
|
hasMoreResults
|
|
@@ -895,9 +871,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
895
871
|
} else {
|
|
896
872
|
searchHandlerDebounced(
|
|
897
873
|
searchText,
|
|
898
|
-
// @ts-ignore
|
|
899
874
|
displayFieldMeta.current,
|
|
900
875
|
dataApiObj,
|
|
876
|
+
// @ts-ignore
|
|
901
877
|
setItems,
|
|
902
878
|
setLoading,
|
|
903
879
|
hasMoreResults
|
|
@@ -905,14 +881,12 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
905
881
|
}
|
|
906
882
|
} else if (
|
|
907
883
|
listType === 'associated' ||
|
|
908
|
-
// @ts-ignore
|
|
909
884
|
(listType === 'datapage' && dataApiObj?.isQueryable === false)
|
|
910
885
|
) {
|
|
911
886
|
paginateHelperApis.resetIndexes();
|
|
912
887
|
const progressivePaginatedRecords = paginateHelperApis.fetchData(
|
|
913
888
|
inputValueRef.current,
|
|
914
889
|
false,
|
|
915
|
-
// @ts-ignore
|
|
916
890
|
dataApiObj.columns
|
|
917
891
|
);
|
|
918
892
|
setItems(progressivePaginatedRecords);
|
|
@@ -939,21 +913,19 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
939
913
|
|
|
940
914
|
setFilterValue('');
|
|
941
915
|
if (!selected && inputValueRef.current !== '') {
|
|
942
|
-
// @ts-ignore
|
|
943
916
|
if (listType === 'datapage' && dataApiObj.isQueryable) {
|
|
944
917
|
hasMoreResults.current = true;
|
|
945
918
|
searchHandlerThrottled(
|
|
946
919
|
'',
|
|
947
|
-
// @ts-ignore
|
|
948
920
|
displayFieldMeta.current,
|
|
949
921
|
dataApiObj,
|
|
922
|
+
// @ts-ignore
|
|
950
923
|
setItems,
|
|
951
924
|
setLoading,
|
|
952
925
|
hasMoreResults
|
|
953
926
|
);
|
|
954
927
|
} else if (
|
|
955
928
|
listType === 'associated' ||
|
|
956
|
-
// @ts-ignore
|
|
957
929
|
(listType === 'datapage' && dataApiObj?.isQueryable === false)
|
|
958
930
|
) {
|
|
959
931
|
paginateHelperApis.resetIndexes();
|
|
@@ -976,7 +948,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
976
948
|
// @ts-ignore
|
|
977
949
|
setSelected(menuHelpers.getSelected(updatedItems)[0]);
|
|
978
950
|
// const { id: itemId } = menuHelpers.getSelected(updatedItems)[0];
|
|
979
|
-
// @ts-ignore
|
|
980
951
|
const assocProp = pConn.getStateProps().value;
|
|
981
952
|
const propValue = setValueToAssocProp(
|
|
982
953
|
assocProp,
|
|
@@ -1009,7 +980,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
1009
980
|
const loadMore = () => {
|
|
1010
981
|
if (
|
|
1011
982
|
(listType === 'associated' ||
|
|
1012
|
-
// @ts-ignore
|
|
1013
983
|
(listType === 'datapage' && dataApiObj?.isQueryable === false)) &&
|
|
1014
984
|
paginateHelperApis.hasMoreResults(inputValueRef.current)
|
|
1015
985
|
) {
|
|
@@ -1019,23 +989,18 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
1019
989
|
progressivePaginatedRecords = removeDuplicates(previousItems, progressivePaginatedRecords);
|
|
1020
990
|
return [...previousItems, ...progressivePaginatedRecords];
|
|
1021
991
|
});
|
|
1022
|
-
// @ts-ignore
|
|
1023
992
|
} else if (listType === 'datapage' && dataApiObj.isQueryable && hasMoreResults.current) {
|
|
1024
993
|
setLoading(true);
|
|
1025
994
|
dataApiObj
|
|
1026
|
-
// @ts-ignore
|
|
1027
995
|
.fetchPaginatedData(inputValueRef.current)
|
|
1028
996
|
.then((response: { pageSize: number; data: Array<never> }) => {
|
|
1029
997
|
setLoading(false);
|
|
1030
|
-
// @ts-ignore
|
|
1031
998
|
if (response.pageSize === 0 || response.pageSize < dataApiObj.pageSize) {
|
|
1032
999
|
hasMoreResults.current = false;
|
|
1033
1000
|
}
|
|
1034
1001
|
const listObjData = response.data || [];
|
|
1035
1002
|
let columnsWithSetProperty: string | Array<any> = [];
|
|
1036
|
-
// @ts-ignore
|
|
1037
1003
|
if (dataApiObj.columns) {
|
|
1038
|
-
// @ts-ignore
|
|
1039
1004
|
columnsWithSetProperty = dataApiObj.columns
|
|
1040
1005
|
.filter(
|
|
1041
1006
|
(col: { setProperty: string }) =>
|
|
@@ -1049,12 +1014,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
1049
1014
|
const searchedItems = listObjData.map((entry: { [x: string]: any }) => {
|
|
1050
1015
|
const secondaryArr: Array<any> = [];
|
|
1051
1016
|
const secondaryFieldValues: Array<any> = [];
|
|
1052
|
-
// @ts-ignore
|
|
1053
1017
|
displayFieldMeta.current.secondary.forEach((col: string) => {
|
|
1054
|
-
// @ts-ignore
|
|
1055
1018
|
if (!displayFieldMeta.current.hidden.includes(col)) secondaryArr.push(entry[col]);
|
|
1056
1019
|
if (columnsWithSetProperty.includes(col)) {
|
|
1057
|
-
// @ts-ignore
|
|
1058
1020
|
if (dataApiObj.isQueryable) {
|
|
1059
1021
|
secondaryFieldValues.push(entry[col]);
|
|
1060
1022
|
} else {
|
|
@@ -1063,9 +1025,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
1063
1025
|
}
|
|
1064
1026
|
});
|
|
1065
1027
|
return {
|
|
1066
|
-
// @ts-ignore
|
|
1067
1028
|
id: entry[displayFieldMeta.current.key],
|
|
1068
|
-
// @ts-ignore
|
|
1069
1029
|
primary: entry[displayFieldMeta.current.primary],
|
|
1070
1030
|
secondary: secondaryArr,
|
|
1071
1031
|
secondaryFieldValues
|
|
@@ -1076,7 +1036,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
1076
1036
|
})
|
|
1077
1037
|
.catch(() => {
|
|
1078
1038
|
setLoading(false);
|
|
1079
|
-
// @ts-ignore
|
|
1080
1039
|
dataApiObj.pageSize -= 1;
|
|
1081
1040
|
});
|
|
1082
1041
|
}
|
|
@@ -1162,7 +1121,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
1162
1121
|
selected: item.items ? undefined : !!item.selected || item.id === selected?.id
|
|
1163
1122
|
})),
|
|
1164
1123
|
onItemClick: selectItem,
|
|
1165
|
-
// @ts-ignore
|
|
1166
1124
|
emptyText: pConn.getLocalizedValue('No items'),
|
|
1167
1125
|
loading,
|
|
1168
1126
|
loadMore,
|
package/src/tasks/create/templates/Constellation/field/Picklist-Autocomplete/utils.ts.mustache
CHANGED
|
@@ -187,7 +187,7 @@ export const updatePropertiesForNewRecord = (
|
|
|
187
187
|
dataObj
|
|
188
188
|
.fetchData(newCaseId)
|
|
189
189
|
// @ts-ignore
|
|
190
|
-
.then(displayResponse => {
|
|
190
|
+
.then((displayResponse: any) => {
|
|
191
191
|
let columnsWithSetProperty = [];
|
|
192
192
|
if (dataApiObj.columns) {
|
|
193
193
|
columnsWithSetProperty = dataApiObj.columns
|
|
@@ -22,8 +22,8 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
22
22
|
// TODO Below if conditions can be removed once we have apis to get worklist/mywork info
|
|
23
23
|
// This is non CaseView case (Dashboard, MyWork etc)
|
|
24
24
|
if (!metaObj) {
|
|
25
|
-
userName = PCore.getEnvironmentInfo().getOperatorName();
|
|
26
|
-
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
25
|
+
userName = PCore.getEnvironmentInfo().getOperatorName() ?? "";
|
|
26
|
+
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier() ?? "";
|
|
27
27
|
} else {
|
|
28
28
|
userName = metaObj.name;
|
|
29
29
|
userIdentifier = metaObj.ID;
|
|
@@ -46,22 +46,20 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
46
46
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
47
|
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
const handleUserStateChange = ({ state }) => {
|
|
49
|
+
const handleUserStateChange = ({ state }: any) => {
|
|
51
50
|
setUserState(state === 'online' ? 'active' : 'inactive');
|
|
52
51
|
};
|
|
53
52
|
|
|
54
53
|
useEffect(() => {
|
|
55
54
|
const subId = PCore.getMessagingServiceManager()
|
|
56
55
|
.getUserPresence()
|
|
57
|
-
|
|
58
|
-
.subscribe(userIdentifier, handleUserStateChange);
|
|
56
|
+
.subscribe(userIdentifier, handleUserStateChange, '');
|
|
59
57
|
|
|
60
58
|
return function cleanup() {
|
|
61
59
|
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
62
60
|
};
|
|
63
61
|
}, [userIdentifier, handleUserStateChange]);
|
|
64
|
-
|
|
62
|
+
|
|
65
63
|
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
|
|
66
64
|
}
|
|
67
65
|
|
package/src/tasks/create/templates/Constellation/template/DETAILS-region/Avatar.tsx.mustache
CHANGED
|
@@ -22,8 +22,8 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
22
22
|
// TODO Below if conditions can be removed once we have apis to get worklist/mywork info
|
|
23
23
|
// This is non CaseView case (Dashboard, MyWork etc)
|
|
24
24
|
if (!metaObj) {
|
|
25
|
-
userName = PCore.getEnvironmentInfo().getOperatorName();
|
|
26
|
-
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
25
|
+
userName = PCore.getEnvironmentInfo().getOperatorName() ?? "";
|
|
26
|
+
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier() ?? "";
|
|
27
27
|
} else {
|
|
28
28
|
userName = metaObj.name;
|
|
29
29
|
userIdentifier = metaObj.ID;
|
|
@@ -46,22 +46,20 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
46
46
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
47
|
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
const handleUserStateChange = ({ state }) => {
|
|
49
|
+
const handleUserStateChange = ({ state }: any) => {
|
|
51
50
|
setUserState(state === 'online' ? 'active' : 'inactive');
|
|
52
51
|
};
|
|
53
52
|
|
|
54
53
|
useEffect(() => {
|
|
55
54
|
const subId = PCore.getMessagingServiceManager()
|
|
56
55
|
.getUserPresence()
|
|
57
|
-
|
|
58
|
-
.subscribe(userIdentifier, handleUserStateChange);
|
|
56
|
+
.subscribe(userIdentifier, handleUserStateChange, '');
|
|
59
57
|
|
|
60
58
|
return function cleanup() {
|
|
61
59
|
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
62
60
|
};
|
|
63
61
|
}, [userIdentifier, handleUserStateChange]);
|
|
64
|
-
|
|
62
|
+
|
|
65
63
|
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
|
|
66
64
|
}
|
|
67
65
|
|
|
@@ -22,8 +22,8 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
22
22
|
// TODO Below if conditions can be removed once we have apis to get worklist/mywork info
|
|
23
23
|
// This is non CaseView case (Dashboard, MyWork etc)
|
|
24
24
|
if (!metaObj) {
|
|
25
|
-
userName = PCore.getEnvironmentInfo().getOperatorName();
|
|
26
|
-
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
25
|
+
userName = PCore.getEnvironmentInfo().getOperatorName() ?? "";
|
|
26
|
+
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier() ?? "";
|
|
27
27
|
} else {
|
|
28
28
|
userName = metaObj.name;
|
|
29
29
|
userIdentifier = metaObj.ID;
|
|
@@ -46,22 +46,20 @@ function Avatar(props: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
|
46
46
|
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
47
47
|
const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
const handleUserStateChange = ({ state }) => {
|
|
49
|
+
const handleUserStateChange = ({ state }: any) => {
|
|
51
50
|
setUserState(state === 'online' ? 'active' : 'inactive');
|
|
52
51
|
};
|
|
53
52
|
|
|
54
53
|
useEffect(() => {
|
|
55
54
|
const subId = PCore.getMessagingServiceManager()
|
|
56
55
|
.getUserPresence()
|
|
57
|
-
|
|
58
|
-
.subscribe(userIdentifier, handleUserStateChange);
|
|
56
|
+
.subscribe(userIdentifier, handleUserStateChange, '');
|
|
59
57
|
|
|
60
58
|
return function cleanup() {
|
|
61
59
|
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
62
60
|
};
|
|
63
61
|
}, [userIdentifier, handleUserStateChange]);
|
|
64
|
-
|
|
62
|
+
|
|
65
63
|
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
|
|
66
64
|
}
|
|
67
65
|
|
|
@@ -152,7 +152,7 @@ export class {{COMPONENT_CLASS_NAME}}Component implements OnInit, OnDestroy {
|
|
|
152
152
|
if (this.formatter === 'Currency') {
|
|
153
153
|
this.formattedValue = format(this.value$, this.formatter.toLowerCase(), theCurrencyOptions);
|
|
154
154
|
} else {
|
|
155
|
-
this.formattedValue = format(this.value$, this.pConn$.getComponentName()
|
|
155
|
+
this.formattedValue = format(this.value$, this.pConn$.getComponentName()?.toLowerCase(), theCurrencyOptions);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
@@ -73,7 +73,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
73
73
|
if (formatter === 'Currency') {
|
|
74
74
|
formattedValue = format(value, formatter.toLowerCase(), theCurrencyOptions);
|
|
75
75
|
} else {
|
|
76
|
-
formattedValue = format(value, pConn.getComponentName()
|
|
76
|
+
formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
@@ -62,7 +62,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
62
62
|
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
63
63
|
|
|
64
64
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
65
|
-
const formattedValue = format(value, pConn.getComponentName()
|
|
65
|
+
const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
|
|
66
66
|
|
|
67
67
|
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
68
68
|
|
|
@@ -54,7 +54,7 @@ export default function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}
|
|
|
54
54
|
const helperTextToDisplay = validatemessage || helperText;
|
|
55
55
|
|
|
56
56
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
57
|
-
const formattedValue = format(value, pConn.getComponentName()
|
|
57
|
+
const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
|
|
58
58
|
|
|
59
59
|
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
60
60
|
|
|
@@ -23,7 +23,7 @@ export default meta;
|
|
|
23
23
|
type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
|
|
24
24
|
|
|
25
25
|
const renderField = resolvedProps => {
|
|
26
|
-
const { displayMode, value = '', label = '',
|
|
26
|
+
const { displayMode, value = '', label = '', onChange, required, disabled, helperText, placeholder, validatemessage, status, testId } = resolvedProps;
|
|
27
27
|
|
|
28
28
|
const helperTextToDisplay = validatemessage || helperText;
|
|
29
29
|
let testProp = {};
|
|
@@ -33,7 +33,7 @@ const renderField = resolvedProps => {
|
|
|
33
33
|
};
|
|
34
34
|
const variant = displayMode === 'DISPLAY_ONLY' ? 'inline' : 'stacked';
|
|
35
35
|
let val: any = '';
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
{{! pick new delimiters for mustache }}
|
|
38
38
|
{{=<% %>=}}
|
|
39
39
|
if (label === 'Service Date')
|
|
@@ -72,24 +72,27 @@ const renderField = resolvedProps => {
|
|
|
72
72
|
if (label === 'First Name' || label === 'Last Name' || label === 'Middle Name')
|
|
73
73
|
val = <TextField value={value} fullWidth size='small' variant='outlined' style={{ fontSize: '14px' }} label={label} onChange={onChange} />;
|
|
74
74
|
|
|
75
|
+
const disableDropdown = true;
|
|
75
76
|
if (label === 'Phone Number')
|
|
76
77
|
val = (
|
|
77
78
|
<MuiTelInput
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
79
|
+
fullWidth
|
|
80
|
+
helperText={helperTextToDisplay}
|
|
81
|
+
placeholder={placeholder ?? ''}
|
|
82
|
+
size='small'
|
|
83
|
+
defaultCountry='US'
|
|
84
|
+
required={required}
|
|
85
|
+
disabled={disabled}
|
|
86
|
+
onChange={onChange}
|
|
87
|
+
error={status === 'error'}
|
|
88
|
+
label={label}
|
|
89
|
+
value={value}
|
|
90
|
+
InputProps={{
|
|
91
|
+
readOnly: true,
|
|
92
|
+
inputProps: { ...testProp }
|
|
93
|
+
}}
|
|
94
|
+
disableDropdown={disableDropdown}
|
|
95
|
+
/>
|
|
93
96
|
);
|
|
94
97
|
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
95
98
|
|
|
@@ -170,8 +173,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
170
173
|
hasSuggestions: false,
|
|
171
174
|
onChange: val => {
|
|
172
175
|
setPhone(val);
|
|
173
|
-
}
|
|
174
|
-
onBlur: () => {}
|
|
176
|
+
}
|
|
175
177
|
},
|
|
176
178
|
{
|
|
177
179
|
readOnly: undefined,
|
package/src/tasks/map/map.js
CHANGED
|
@@ -43,7 +43,8 @@ export const getPrettierFormattedString = async (content) => {
|
|
|
43
43
|
|
|
44
44
|
// format the contents
|
|
45
45
|
if (options) {
|
|
46
|
-
|
|
46
|
+
options.parser = 'babel';
|
|
47
|
+
return prettier.format(content, options);
|
|
47
48
|
}
|
|
48
49
|
else {
|
|
49
50
|
return content;
|
|
@@ -51,7 +51,7 @@ export default function FieldValueList(props: FieldValueListProps) {
|
|
|
51
51
|
|
|
52
52
|
function getGridItemLabel() {
|
|
53
53
|
return (
|
|
54
|
-
<Grid item xs={variant === 'stacked' ? 12 :
|
|
54
|
+
<Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingBottom : ''}>
|
|
55
55
|
<Typography variant='body2' component='span' className={`${classes.fieldLabel}`}>
|
|
56
56
|
{name}
|
|
57
57
|
</Typography>
|
|
@@ -63,7 +63,7 @@ export default function FieldValueList(props: FieldValueListProps) {
|
|
|
63
63
|
const formattedValue = formatItemValue(value);
|
|
64
64
|
|
|
65
65
|
return (
|
|
66
|
-
<Grid item xs={variant === 'stacked' ? 12 :
|
|
66
|
+
<Grid item xs={variant === 'stacked' ? 12 : 6} className={variant === 'stacked' ? classes.noPaddingTop : ''}>
|
|
67
67
|
{isHtml ? (
|
|
68
68
|
// eslint-disable-next-line react/no-danger
|
|
69
69
|
<div dangerouslySetInnerHTML={{ __html: formattedValue }} />
|