@pega/custom-dx-components 0.242.16 → 0.242.17

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.
Files changed (90) hide show
  1. package/package.json +1 -1
  2. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +2 -3
  3. package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +0 -1
  4. package/src/tasks/create/templates/Constellation/Field/Boolean/mock.ts.mustache +0 -1
  5. package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +3 -5
  6. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +1 -2
  7. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +1 -2
  8. package/src/tasks/create/templates/Constellation/Field/Decimal/event-utils.ts.mustache +1 -1
  9. package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +1 -4
  10. package/src/tasks/create/templates/Constellation/Field/Decimal/mock.ts.mustache +0 -1
  11. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +1 -2
  12. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/event-utils.ts.mustache +1 -1
  13. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +0 -2
  14. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.ts.mustache +0 -2
  15. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +1 -2
  16. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/event-utils.ts.mustache +1 -1
  17. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +1 -4
  18. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.ts.mustache +2 -3
  19. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +4 -5
  20. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +0 -2
  21. package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/mock.ts.mustache +0 -1
  22. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +1 -2
  23. package/src/tasks/create/templates/Constellation/Field/Integer/event-utils.ts.mustache +1 -1
  24. package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +2 -9
  25. package/src/tasks/create/templates/Constellation/Field/Integer/mock.ts.mustache +3 -2
  26. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +4 -6
  27. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +7 -14
  28. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +4 -6
  29. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/embed-utils.ts.mustache +26 -23
  30. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +10 -52
  31. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/mock.ts.mustache +0 -1
  32. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +4 -6
  33. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +1 -6
  34. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/mock.ts.mustache +0 -2
  35. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +2 -3
  36. package/src/tasks/create/templates/Constellation/Field/Text/mock.ts.mustache +0 -1
  37. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +1 -2
  38. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +0 -2
  39. package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.ts.mustache +2 -2
  40. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +1 -2
  41. package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.ts.mustache +0 -1
  42. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +1 -2
  43. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +0 -2
  44. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.ts.mustache +0 -2
  45. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +1 -3
  46. package/src/tasks/create/templates/Constellation/Field/Text-Phone/event-utils.ts.mustache +1 -1
  47. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +2 -6
  48. package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.ts.mustache +0 -2
  49. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +1 -3
  50. package/src/tasks/create/templates/Constellation/Field/Text-URL/index.tsx.mustache +0 -2
  51. package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.ts.mustache +0 -2
  52. package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.tsx.mustache +13 -8
  53. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +1 -2
  54. package/src/tasks/create/templates/Constellation/Field/TimeofDay/mock.ts.mustache +0 -2
  55. package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +3 -5
  56. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +8 -7
  57. package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +0 -2
  58. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +1 -3
  59. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +15 -14
  60. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +2 -5
  61. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +1 -3
  62. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.ts.mustache +4 -8
  63. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +67 -7
  64. package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +3 -3
  65. package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +1 -1
  66. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +4 -5
  67. package/src/tasks/create/templates/Constellation/Template/PAGE/index.tsx.mustache +0 -1
  68. package/src/tasks/create/templates/Constellation/Template/PAGE/mock.ts.mustache +0 -2
  69. package/src/tasks/create/templates/Constellation/Template/PAGE/utils.ts.mustache +6 -19
  70. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +4 -6
  71. package/src/tasks/create/templates/Constellation/Widget/CASE/index.tsx.mustache +1 -4
  72. package/src/tasks/create/templates/Constellation/Widget/CASE/mock.ts.mustache +0 -1
  73. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +3 -4
  74. package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +2 -6
  75. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +2 -5
  76. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +2 -3
  77. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.ts.mustache +0 -1
  78. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +4 -5
  79. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +0 -2
  80. package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/mock.ts.mustache +0 -1
  81. package/src/tasks/create/templates/Launchpad/Widget/CASE/demo.stories.tsx.mustache +4 -6
  82. package/src/tasks/create/templates/Launchpad/Widget/CASE/index.tsx.mustache +1 -4
  83. package/src/tasks/create/templates/Launchpad/Widget/CASE/mock.ts.mustache +1 -1
  84. package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +3 -5
  85. package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +2 -6
  86. package/src/tasks/create/templates/Launchpad/Widget/PAGE/mock.ts.mustache +0 -1
  87. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Avatar.tsx.mustache +1 -3
  88. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/demo.stories.tsx.mustache +2 -3
  89. package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/mock.ts.mustache +0 -1
  90. package/src/tasks/init/template/package.json.mustache +1 -1
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  import { isEmbeddedField, isPageListInPath, PAGE, PAGELIST, buildAggOrCalcId } from './repeat-utils';
3
2
 
4
3
  export const AT_FILTEREDLIST = '@FILTERED_LIST';
@@ -15,7 +14,7 @@ export const AT_PROPERTY = '@P';
15
14
  * getFieldNameFromEmbeddedFieldName('!P!Organisation:Name') return 'Organisation.Name'
16
15
  * getFieldNameFromEmbeddedFieldName('!PL!Employees:Name') return 'Employees.Name'
17
16
  */
18
- export function getFieldNameFromEmbeddedFieldName(propertyName) {
17
+ export function getFieldNameFromEmbeddedFieldName(propertyName: string) {
19
18
  let value = propertyName;
20
19
  if (value.startsWith(PAGE) || value.startsWith(PAGELIST)) {
21
20
  value = value.substring(value.lastIndexOf('!') + 1);
@@ -36,7 +35,7 @@ export function getFieldNameFromEmbeddedFieldName(propertyName) {
36
35
  * For pageList property, getEmbeddedFieldName('Employees.Name') return '!PL!Employees:Name'
37
36
  */
38
37
 
39
- export function getEmbeddedFieldName(propertyName, classID) {
38
+ export function getEmbeddedFieldName(propertyName: string, classID: string) {
40
39
  let value = propertyName;
41
40
  if (isPageListInPath(value, classID)) {
42
41
  value = `!PL!${value.replace(/\./g, ':')}`;
@@ -52,7 +51,7 @@ export function getEmbeddedFieldName(propertyName, classID) {
52
51
  * @ignore
53
52
  * @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
54
53
  */
55
- export function updateMetaEmbeddedFieldID(metaFields) {
54
+ export function updateMetaEmbeddedFieldID(metaFields: any[]) {
56
55
  return metaFields.forEach((metaField) => {
57
56
  if (metaField.fieldID?.startsWith(PAGE) || metaField.fieldID?.startsWith(PAGELIST)) {
58
57
  metaField.fieldID = getFieldNameFromEmbeddedFieldName(metaField.fieldID);
@@ -68,16 +67,16 @@ export function updateMetaEmbeddedFieldID(metaFields) {
68
67
  * @param {string} classID clasID of datapage
69
68
  * @returns {Array} Metadata of configured embedded fields
70
69
  */
71
- export function getConfigEmbeddedFieldsMeta(configFields, classID) {
72
- const configEmbeddedFieldsMeta = [];
73
- configFields.forEach((field) => {
70
+ export function getConfigEmbeddedFieldsMeta(configFields: any, classID: string) {
71
+ const configEmbeddedFieldsMeta: (object | null)[] = [];
72
+ configFields.forEach((field: any) => {
74
73
  let value = field;
75
74
  if (isEmbeddedField(value)) {
76
75
  // conversion Page.PageList[].property => Page.PageList.property
77
76
  if (value.includes('[')) {
78
77
  value = value.substring(0, value.indexOf('[')) + value.substring(value.indexOf(']') + 1);
79
78
  }
80
- const meta = PCore.getMetadataUtils().getEmbeddedPropertyMetadata(value, classID);
79
+ const meta: any = PCore.getMetadataUtils().getEmbeddedPropertyMetadata(value, classID);
81
80
  meta.fieldID = field;
82
81
  configEmbeddedFieldsMeta.push(meta);
83
82
  }
@@ -92,7 +91,7 @@ export function getConfigEmbeddedFieldsMeta(configFields, classID) {
92
91
  * @param {Array} configEmbeddedFieldsMeta config fields metadata.
93
92
  * @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields
94
93
  */
95
- export function mergeConfigEmbeddedFieldsMeta(configEmbeddedFieldsMeta, metaFields) {
94
+ export function mergeConfigEmbeddedFieldsMeta(configEmbeddedFieldsMeta: any[], metaFields: any[]) {
96
95
  const mergedMetaFields = [...metaFields];
97
96
  configEmbeddedFieldsMeta.forEach((configFieldMeta) => {
98
97
  const fieldMeta = metaFields.find((metaField) => metaField.fieldID === configFieldMeta.fieldID);
@@ -113,7 +112,7 @@ export function mergeConfigEmbeddedFieldsMeta(configEmbeddedFieldsMeta, metaFiel
113
112
  */
114
113
  // FIXME #EmbeddedPropertyPatch
115
114
  // TODO: Remove this utility when we have nested response for queryable pageList and supports @FILTERED_LIST annotation
116
- export function preparePropertyValue(value) {
115
+ export function preparePropertyValue(value: any) {
117
116
  if (value.startsWith(AT_FILTEREDLIST)) {
118
117
  value = value.substring(value.indexOf(' ') + 1);
119
118
  value = value.substring(0, value.indexOf('[')) + value.substring(value.indexOf(']') + 1);
@@ -152,7 +151,7 @@ export function preparePropertyValue(value) {
152
151
  */
153
152
  // FIXME #EmbeddedPropertyPatch
154
153
  // TODO: Remove this utility when we have nested response for queryable pageList and supports scalarList component
155
- export function updatePageListFieldsConfig(configFields) {
154
+ export function updatePageListFieldsConfig(configFields: any[]) {
156
155
  return configFields.forEach((item) => {
157
156
  if (item.type === 'ScalarList') {
158
157
  if (!item.config.originalValue) {
@@ -166,7 +165,7 @@ export function updatePageListFieldsConfig(configFields) {
166
165
  /**
167
166
  * Update the renderer type for the properties of type Page.
168
167
  */
169
- export function updatePageFieldsConfig(configFields, parentClassID) {
168
+ export function updatePageFieldsConfig(configFields: any[], parentClassID: string) {
170
169
  return configFields.forEach((item) => {
171
170
  const {
172
171
  type,
@@ -180,8 +179,8 @@ export function updatePageFieldsConfig(configFields, parentClassID) {
180
179
  });
181
180
  }
182
181
 
183
- export function updateChangeSetValueKeys(changeSetObj, getOriginalProperty) {
184
- const newChangeSetObject = {};
182
+ export function updateChangeSetValueKeys(changeSetObj: any, getOriginalProperty: any) {
183
+ const newChangeSetObject: any = {};
185
184
  for (const [key, value] of Object.entries(changeSetObj)) {
186
185
  let newKey = key;
187
186
  if (newKey.startsWith(PAGE)) {
@@ -204,7 +203,7 @@ export function updateChangeSetValueKeys(changeSetObj, getOriginalProperty) {
204
203
  * isPageListProperty('!P!Employees.Name') return false
205
204
  * isPageListProperty('Name') return false
206
205
  */
207
- export function isPageListProperty(propertyName) {
206
+ export function isPageListProperty(propertyName: string) {
208
207
  return propertyName.startsWith(PAGELIST);
209
208
  }
210
209
 
@@ -217,8 +216,8 @@ export function isPageListProperty(propertyName) {
217
216
  * @param {string} context dataApi context
218
217
  * @returns {boolean} true if pageListProperty is present
219
218
  */
220
- export function preparePropertyMaps(fields, classID, context) {
221
- const { setPropertyMaps } = context;
219
+ export function preparePropertyMaps(fields: any[], classID: string, context: string) {
220
+ const { setPropertyMaps } : any = context;
222
221
  const maps = fields.reduce(
223
222
  (acc, field) => {
224
223
  let { value } = field.config;
@@ -254,9 +253,9 @@ export function preparePropertyMaps(fields, classID, context) {
254
253
  */
255
254
  // FIXME #EmbeddedPropertyPatch
256
255
  // TODO: Remove this utility when we have nested response for queryable pageList property
257
- export function getPageListFields(fields) {
256
+ export function getPageListFields(fields: any[]) {
258
257
  const parentPaths = new Set();
259
- const pageListFields = [];
258
+ const pageListFields: any = [];
260
259
  fields.forEach((field) => {
261
260
  const { name } = field;
262
261
  if (isPageListProperty(name)) {
@@ -270,7 +269,11 @@ export function getPageListFields(fields) {
270
269
  return pageListFields;
271
270
  }
272
271
 
273
- export function mergePageListFieldAggregation(pageListName, select, existingAggregations, existingAggregationsName) {
272
+ export function mergePageListFieldAggregation(
273
+ pageListName :string,
274
+ select: { aggregation: string; }[],
275
+ existingAggregations: { [x: string]: { field: string; summaryFunction: string; }; },
276
+ existingAggregationsName: string | string[]) {
274
277
  // Build a dummy genericAggregationId to check if any type of aggregation for that pagelist is included in existing aggregations.
275
278
  const genericAggregationId = buildAggOrCalcId(pageListName, '');
276
279
  if (existingAggregationsName.includes(genericAggregationId)) {
@@ -281,10 +284,10 @@ export function mergePageListFieldAggregation(pageListName, select, existingAggr
281
284
  existingAggregations[countAggregationId] = { field: pageListName, summaryFunction: 'COUNT' };
282
285
  }
283
286
 
284
- export function mergePageListFieldsAggregation(fields, select, existingAggregations) {
287
+ export function mergePageListFieldsAggregation(fields: any[], select: { aggregation: string; }[], existingAggregations: { [x: string]: { field: string; summaryFunction: string; }; }) {
285
288
  const parentPaths = new Set();
286
289
  const existingAggregationsName = Object.keys(existingAggregations).toString();
287
- const pageListFields = [];
290
+ const pageListFields: any[] = [];
288
291
  fields.forEach((field) => {
289
292
  const { name } = field;
290
293
  if (isPageListProperty(name)) {
@@ -306,6 +309,6 @@ export function mergePageListFieldsAggregation(fields, select, existingAggregati
306
309
  * @param {Array} fieldDefs fields array
307
310
  * @returns {object | undefined} value of first pageListProperty found
308
311
  */
309
- export function hasPageListProperty(fieldDefs) {
312
+ export function hasPageListProperty(fieldDefs: any[]) {
310
313
  return fieldDefs?.find((field) => isPageListProperty(field.name));
311
314
  }
@@ -496,14 +496,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
496
496
  const pConn = getPConnect();
497
497
  const contextName = getPConnect().getContextName();
498
498
  const actions = pConn.getActionsApi();
499
- const [dataApiObj, setDataApiObj] = useState(() => ({}));
499
+ const [dataApiObj, setDataApiObj] = useState(() => ({} as any));
500
500
  const [filterValue, setFilterValue] = useState('');
501
501
  const [loading, setLoading] = useState(listType !== 'associated');
502
502
  // const selected = useMemo(() => menuHelpers.getSelected(items)[0], [items]);
503
503
  const [selected, setSelected] = useState();
504
504
  const hasMoreResults = useRef(true);
505
505
  const inputValueRef = useRef('');
506
- const displayFieldMeta = useRef(null);
506
+ const displayFieldMeta: any = useRef(null);
507
507
  const [actualValue, setActualValue] = useState();
508
508
  const [newRecordCreated, setNewRecordCreated] = useState();
509
509
 
@@ -644,15 +644,13 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
644
644
  }
645
645
  PCore.getDataApi()
646
646
  .init(dataConfig, contextName)
647
- .then(dataObj => {
648
- // @ts-ignore
647
+ .then((dataObj: any) => {
649
648
  setDataApiObj(dataObj);
650
649
  // To avoid calling doSearch if someone types/pastes value before the API call is made
651
650
  if (!filterValue)
652
651
  doSearch(
653
652
  '',
654
653
  getDisplayFieldsMetaData(dataConfig.columns),
655
- // @ts-ignore
656
654
  dataObj,
657
655
  setItems as any,
658
656
  setLoading,
@@ -678,12 +676,10 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
678
676
  if (!dataRefMount && !displayMode && listType === 'datapage') {
679
677
  PCore.getDataApi()
680
678
  .init(dataConfig, contextName)
681
- .then(dataObj => {
682
- // @ts-ignore
679
+ .then((dataObj: any) => {
683
680
  setDataApiObj(dataObj);
684
681
  // To avoid calling doSearch if someone types/pastes value before the API call is made
685
682
  if (!filterValue) {
686
- // @ts-ignore
687
683
  if (displayFieldMeta?.current?.key === displayFieldMeta?.current?.primary) {
688
684
  const displayItem = {
689
685
  id: value,
@@ -695,7 +691,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
695
691
  doSearch(
696
692
  '',
697
693
  getDisplayFieldsMetaData(dataConfig.columns),
698
- // @ts-ignore
699
694
  dataObj,
700
695
  setItems as any,
701
696
  setLoading,
@@ -715,7 +710,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
715
710
  doSearch(
716
711
  '',
717
712
  getDisplayFieldsMetaData(dataConfig.columns),
718
- // @ts-ignore
719
713
  dataObj,
720
714
  setItems as any,
721
715
  setLoading,
@@ -774,22 +768,16 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
774
768
  ) {
775
769
  PCore.getDataApi()
776
770
  .init(dataConfig, contextName)
777
- .then(dataObj => {
778
- // @ts-ignore
771
+ .then((dataObj: any) => {
779
772
  setDataApiObj(dataObj);
780
- // @ts-ignore
781
773
  buildColumnForDisplayValue(dataObj);
782
774
  // SET matchPosition to EQUALS to return exact matching record
783
- // @ts-ignore
784
775
  dataObj.matchPosition = 'equals';
785
- // @ts-ignore
786
776
  dataObj
787
777
  .fetchData(value)
788
778
  .then((displayResponse: { data: Array<never> }) => {
789
779
  let columnsWithSetProperty: string | Array<any> = [];
790
- // @ts-ignore
791
780
  if (dataApiObj.columns) {
792
- // @ts-ignore
793
781
  columnsWithSetProperty = dataApiObj.columns
794
782
  .filter(
795
783
  (col: { setProperty: string }) =>
@@ -804,12 +792,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
804
792
  const searchedItem = displayResponseData.map((entry: { [x: string]: any }) => {
805
793
  const secondaryArr: Array<any> = [];
806
794
  const secondaryFieldValues: Array<any> = [];
807
- // @ts-ignore
808
795
  displayFieldMeta.current.secondary.forEach((col: string) => {
809
- // @ts-ignore
810
796
  if (!displayFieldMeta.hidden.includes(col)) secondaryArr.push(entry[col]);
811
797
  if (columnsWithSetProperty.includes(col)) {
812
- // @ts-ignore
813
798
  if (dataApiObj.isQueryable) {
814
799
  secondaryFieldValues.push(entry[col]);
815
800
  } else {
@@ -818,9 +803,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
818
803
  }
819
804
  });
820
805
  return {
821
- // @ts-ignore
822
806
  id: entry[displayFieldMeta.current.key],
823
- // @ts-ignore
824
807
  primary: entry[displayFieldMeta.current.primary],
825
808
  secondary: secondaryArr,
826
809
  secondaryFieldValues
@@ -831,13 +814,11 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
831
814
  setSelected(searchedItem[0]);
832
815
  setActualValue(value);
833
816
  // RESET matchPosition
834
- // @ts-ignore
835
817
  dataObj.matchPosition = dataConfig.matchPosition;
836
818
  })
837
819
  .catch(() => {
838
820
  setActualValue(value);
839
821
  // RESET matchPosition
840
- // @ts-ignore
841
822
  dataObj.matchPosition = dataConfig.matchPosition;
842
823
  });
843
824
  });
@@ -855,21 +836,17 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
855
836
  };
856
837
  })
857
838
  );
858
- // @ts-ignore
859
- setSelected(null);
839
+ setSelected(undefined);
860
840
  inputValueRef.current = '';
861
841
  };
862
842
 
863
843
  const onChangeHandler = (ev: { target: { value: any } }) => {
864
844
  if (hasSuggestions) {
865
- // @ts-ignore
866
- pConn.ignoreSuggestion();
845
+ pConn.ignoreSuggestion('');
867
846
  setStatus(undefined);
868
847
  }
869
848
 
870
- // @ts-ignore
871
849
  dataApiObj.columns = dataConfig.columns;
872
- // @ts-ignore
873
850
  dataApiObj.matchPosition = dataConfig.matchPosition;
874
851
  const searchText = ev.target.value;
875
852
  inputValueRef.current = searchText;
@@ -878,15 +855,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
878
855
  clearSelections();
879
856
  }
880
857
  setFilterValue(searchText);
881
- // @ts-ignore
882
858
  if (listType === 'datapage' && dataApiObj.isQueryable) {
883
859
  hasMoreResults.current = true;
884
860
  if (searchText.length < 5) {
885
861
  searchHandlerThrottled(
886
862
  searchText,
887
- // @ts-ignore
888
863
  displayFieldMeta.current,
889
864
  dataApiObj,
865
+ // @ts-ignore
890
866
  setItems,
891
867
  setLoading,
892
868
  hasMoreResults
@@ -894,9 +870,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
894
870
  } else {
895
871
  searchHandlerDebounced(
896
872
  searchText,
897
- // @ts-ignore
898
873
  displayFieldMeta.current,
899
874
  dataApiObj,
875
+ // @ts-ignore
900
876
  setItems,
901
877
  setLoading,
902
878
  hasMoreResults
@@ -904,14 +880,12 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
904
880
  }
905
881
  } else if (
906
882
  listType === 'associated' ||
907
- // @ts-ignore
908
883
  (listType === 'datapage' && dataApiObj?.isQueryable === false)
909
884
  ) {
910
885
  paginateHelperApis.resetIndexes();
911
886
  const progressivePaginatedRecords = paginateHelperApis.fetchData(
912
887
  inputValueRef.current,
913
888
  false,
914
- // @ts-ignore
915
889
  dataApiObj.columns
916
890
  );
917
891
  setItems(progressivePaginatedRecords);
@@ -938,21 +912,19 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
938
912
 
939
913
  setFilterValue('');
940
914
  if (!selected && inputValueRef.current !== '') {
941
- // @ts-ignore
942
915
  if (listType === 'datapage' && dataApiObj.isQueryable) {
943
916
  hasMoreResults.current = true;
944
917
  searchHandlerThrottled(
945
918
  '',
946
- // @ts-ignore
947
919
  displayFieldMeta.current,
948
920
  dataApiObj,
921
+ // @ts-ignore
949
922
  setItems,
950
923
  setLoading,
951
924
  hasMoreResults
952
925
  );
953
926
  } else if (
954
927
  listType === 'associated' ||
955
- // @ts-ignore
956
928
  (listType === 'datapage' && dataApiObj?.isQueryable === false)
957
929
  ) {
958
930
  paginateHelperApis.resetIndexes();
@@ -975,7 +947,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
975
947
  // @ts-ignore
976
948
  setSelected(menuHelpers.getSelected(updatedItems)[0]);
977
949
  // const { id: itemId } = menuHelpers.getSelected(updatedItems)[0];
978
- // @ts-ignore
979
950
  const assocProp = pConn.getStateProps().value;
980
951
  const propValue = setValueToAssocProp(
981
952
  assocProp,
@@ -1008,7 +979,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1008
979
  const loadMore = () => {
1009
980
  if (
1010
981
  (listType === 'associated' ||
1011
- // @ts-ignore
1012
982
  (listType === 'datapage' && dataApiObj?.isQueryable === false)) &&
1013
983
  paginateHelperApis.hasMoreResults(inputValueRef.current)
1014
984
  ) {
@@ -1018,23 +988,18 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1018
988
  progressivePaginatedRecords = removeDuplicates(previousItems, progressivePaginatedRecords);
1019
989
  return [...previousItems, ...progressivePaginatedRecords];
1020
990
  });
1021
- // @ts-ignore
1022
991
  } else if (listType === 'datapage' && dataApiObj.isQueryable && hasMoreResults.current) {
1023
992
  setLoading(true);
1024
993
  dataApiObj
1025
- // @ts-ignore
1026
994
  .fetchPaginatedData(inputValueRef.current)
1027
995
  .then((response: { pageSize: number; data: Array<never> }) => {
1028
996
  setLoading(false);
1029
- // @ts-ignore
1030
997
  if (response.pageSize === 0 || response.pageSize < dataApiObj.pageSize) {
1031
998
  hasMoreResults.current = false;
1032
999
  }
1033
1000
  const listObjData = response.data || [];
1034
1001
  let columnsWithSetProperty: string | Array<any> = [];
1035
- // @ts-ignore
1036
1002
  if (dataApiObj.columns) {
1037
- // @ts-ignore
1038
1003
  columnsWithSetProperty = dataApiObj.columns
1039
1004
  .filter(
1040
1005
  (col: { setProperty: string }) =>
@@ -1048,12 +1013,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1048
1013
  const searchedItems = listObjData.map((entry: { [x: string]: any }) => {
1049
1014
  const secondaryArr: Array<any> = [];
1050
1015
  const secondaryFieldValues: Array<any> = [];
1051
- // @ts-ignore
1052
1016
  displayFieldMeta.current.secondary.forEach((col: string) => {
1053
- // @ts-ignore
1054
1017
  if (!displayFieldMeta.current.hidden.includes(col)) secondaryArr.push(entry[col]);
1055
1018
  if (columnsWithSetProperty.includes(col)) {
1056
- // @ts-ignore
1057
1019
  if (dataApiObj.isQueryable) {
1058
1020
  secondaryFieldValues.push(entry[col]);
1059
1021
  } else {
@@ -1062,9 +1024,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1062
1024
  }
1063
1025
  });
1064
1026
  return {
1065
- // @ts-ignore
1066
1027
  id: entry[displayFieldMeta.current.key],
1067
- // @ts-ignore
1068
1028
  primary: entry[displayFieldMeta.current.primary],
1069
1029
  secondary: secondaryArr,
1070
1030
  secondaryFieldValues
@@ -1075,7 +1035,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1075
1035
  })
1076
1036
  .catch(() => {
1077
1037
  setLoading(false);
1078
- // @ts-ignore
1079
1038
  dataApiObj.pageSize -= 1;
1080
1039
  });
1081
1040
  }
@@ -1161,7 +1120,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
1161
1120
  selected: item.items ? undefined : !!item.selected || item.id === selected?.id
1162
1121
  })),
1163
1122
  onItemClick: selectItem,
1164
- // @ts-ignore
1165
1123
  emptyText: pConn.getLocalizedValue('No items'),
1166
1124
  loading,
1167
1125
  loadMore,
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  export const configProps = {
3
2
  value: '',
4
3
  label: 'Picklist Sample',
@@ -1,6 +1,4 @@
1
-
2
1
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
2
  import { useState } from 'react';
5
3
  import type { Meta, StoryObj } from '@storybook/react';
6
4
 
@@ -17,7 +15,7 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
17
15
  export default meta;
18
16
  type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
19
17
 
20
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
18
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
21
19
 
22
20
  const [value, setValue] = useState(configProps.value);
23
21
 
@@ -36,10 +34,10 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
36
34
  getPageReference: () => {
37
35
  return 'caseInfo.content';
38
36
  },
39
- getLocalizedValue: val => {
37
+ getLocalizedValue: (val: any) => {
40
38
  return val;
41
39
  },
42
- getLocaleRuleNameFromKeys: (localeClass, localeContext, localeName) => {
40
+ getLocaleRuleNameFromKeys: (localeClass: string, localeContext: string, localeName: string) => {
43
41
  return `${localeClass}!${localeContext}!${localeName}`;
44
42
  },
45
43
  getCaseInfo: () => {
@@ -54,7 +52,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
54
52
  },
55
53
  getActionsApi: () => {
56
54
  return {
57
- updateFieldValue: (propName, theValue) => {
55
+ updateFieldValue: (propName: string, theValue: any) => {
58
56
  setValue(theValue);
59
57
  },
60
58
  triggerFieldChange: () => {/* nothing */}
@@ -76,7 +76,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
76
76
  const propName: string = stateProps.value;
77
77
  const configProps = pConn.getConfigProps();
78
78
  const className = pConn.getCaseInfo().getClassName();
79
- // @ts-ignore
80
79
  const { getLocaleRuleNameFromKeys, getLocalizedValue } = pConn;
81
80
 
82
81
  // @ts-ignore
@@ -107,7 +106,6 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
107
106
 
108
107
  const items: Array<any> = [];
109
108
  const isDatapage = listType === 'datapage';
110
- // @ts-ignore
111
109
  const listSource = isDatapage ? configProps.listOutput : datasource;
112
110
  let autoFocusProp = additionalProps?.autoFocus
113
111
  ? {
@@ -175,12 +173,9 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
175
173
  required={required}
176
174
  readOnly={readOnly}
177
175
  onChange={(event) => {
178
- // @ts-ignore
179
176
  handleEvent(actions, 'changeNblur', propName, event.target.value);
180
177
  }}
181
- // @ts-ignore
182
- onBlur={(event) => {
183
- // @ts-ignore
178
+ onBlur={(event: any) => {
184
179
  pConn.getValidationApi().validate(event.target.value);
185
180
  }}
186
181
  disabled={disabled}
@@ -1,5 +1,3 @@
1
-
2
- // @ts-nocheck
3
1
  export const configProps = {
4
2
  value: '',
5
3
  label: 'Picklist Sample',
@@ -1,6 +1,5 @@
1
1
 
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
3
  import { useState } from 'react';
5
4
  import type { Meta, StoryObj } from '@storybook/react';
6
5
 
@@ -17,7 +16,7 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
17
16
  export default meta;
18
17
  type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
19
18
 
20
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
19
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
21
20
 
22
21
  const [value, setValue] = useState(configProps.value);
23
22
 
@@ -32,7 +31,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
32
31
  },
33
32
  getActionsApi: () => {
34
33
  return {
35
- updateFieldValue: (propName, theValue) => {
34
+ updateFieldValue: (propName: string, theValue: any) => {
36
35
  setValue(theValue);
37
36
  },
38
37
  triggerFieldChange: () => {/* nothing */}
@@ -1,5 +1,4 @@
1
1
 
2
- // @ts-nocheck
3
2
  export const configProps = {
4
3
  value: '',
5
4
  label: 'Text Sample',
@@ -1,6 +1,5 @@
1
1
 
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
3
  import type { Meta, StoryObj } from '@storybook/react';
5
4
 
6
5
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -16,7 +15,7 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
16
15
  export default meta;
17
16
  type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
18
17
 
19
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
18
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
20
19
 
21
20
  const props = {
22
21
  value: configProps.value,
@@ -188,14 +188,12 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
188
188
  }
189
189
  setInputValue(event.target.value);
190
190
  if (value !== event.target.value) {
191
- // @ts-ignore
192
191
  handleEvent(actions, 'change', propName, event.target.value);
193
192
  hasValueChange.current = true;
194
193
  }
195
194
  }}
196
195
  onBlur={(event: any) => {
197
196
  if (!value || hasValueChange.current) {
198
- // @ts-ignore
199
197
  handleEvent(actions, 'blur', propName, event.target.value);
200
198
  if (hasSuggestions) {
201
199
  pConn.ignoreSuggestion('');
@@ -1,5 +1,4 @@
1
1
 
2
- // @ts-nocheck
3
2
  export const configProps = {
4
3
  value: '',
5
4
  label: 'Email Sample',
@@ -13,7 +12,8 @@ export const configProps = {
13
12
  required: false,
14
13
  disabled: false,
15
14
  status: '',
16
- validatemessage: ''
15
+ validatemessage: '',
16
+ variant: ''
17
17
  };
18
18
 
19
19
  export const stateProps = {
@@ -1,6 +1,5 @@
1
1
 
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
3
  import type { Meta, StoryObj } from '@storybook/react';
5
4
 
6
5
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -16,7 +15,7 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
16
15
  export default meta;
17
16
  type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
18
17
 
19
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
18
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
20
19
 
21
20
  const props = {
22
21
  value: configProps.value,
@@ -1,5 +1,4 @@
1
1
 
2
- // @ts-nocheck
3
2
  export const configProps = {
4
3
  value: '',
5
4
  label: 'TextInput Sample',
@@ -1,6 +1,5 @@
1
1
 
2
2
  /* eslint-disable react/jsx-no-useless-fragment */
3
- // @ts-nocheck
4
3
  import type { Meta, StoryObj } from '@storybook/react';
5
4
 
6
5
  import {{COMPONENT_CLASS_NAME}} from './index';
@@ -16,7 +15,7 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
16
15
  export default meta;
17
16
  type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
18
17
 
19
- export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
18
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = (args: any) => {
20
19
 
21
20
  const props = {
22
21
  value: configProps.value,
@@ -186,14 +186,12 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
186
186
  }
187
187
  setInputValue(event.target.value);
188
188
  if (value !== event.target.value) {
189
- // @ts-ignore
190
189
  handleEvent(actions, 'change', propName, event.target.value);
191
190
  hasValueChange.current = true;
192
191
  }
193
192
  }}
194
193
  onBlur={(event: any) => {
195
194
  if (!value || hasValueChange.current) {
196
- // @ts-ignore
197
195
  handleEvent(actions, 'blur', propName, event.target.value);
198
196
  if (hasSuggestions) {
199
197
  pConn.ignoreSuggestion('');