@pega/lists-react 10.0.0-build.14.0 → 10.0.0-build.15.0
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/README.md +6 -0
- package/lib/Core/Context/GlobalContext.d.ts +1 -0
- package/lib/Core/Context/GlobalContext.d.ts.map +1 -1
- package/lib/Core/Context/GlobalContext.js.map +1 -1
- package/lib/Core/Hooks/useResolvedImage.d.ts +5 -0
- package/lib/Core/Hooks/useResolvedImage.d.ts.map +1 -0
- package/lib/Core/Hooks/useResolvedImage.js +31 -0
- package/lib/Core/Hooks/useResolvedImage.js.map +1 -0
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.js +3 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.js.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js +3 -1
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js.map +1 -1
- package/lib/Core/index.d.ts.map +1 -1
- package/lib/Core/index.js +3 -2
- package/lib/Core/index.js.map +1 -1
- package/lib/types/RepeatingStructuresBoot.types.d.ts +2 -0
- package/lib/types/RepeatingStructuresBoot.types.d.ts.map +1 -1
- package/lib/types/RepeatingStructuresBoot.types.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -20,10 +20,16 @@ import { RepeatingStructures } from '@pega/lists-react';
|
|
|
20
20
|
renderFactory={renderFactory}
|
|
21
21
|
formatters={repeatFormatters}
|
|
22
22
|
additionalInfo={additionalInfo}
|
|
23
|
+
resolveImageSource={resolveImageSource}
|
|
23
24
|
...
|
|
24
25
|
/>
|
|
25
26
|
```
|
|
26
27
|
|
|
28
|
+
`resolveImageSource` is optional and receives a gallery image source, returning a promise for a
|
|
29
|
+
renderable URL. Platform hosts can use it for authenticated assets. Without it, image sources are
|
|
30
|
+
rendered unchanged. This callback is a component prop, not part of `meta`, and applies to all
|
|
31
|
+
gallery presets.
|
|
32
|
+
|
|
27
33
|
## Meta Properties
|
|
28
34
|
|
|
29
35
|
| Property | Value type | Mandatory | Default value | Notes |
|
|
@@ -2,6 +2,7 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
interface GlobalContextValue {
|
|
3
3
|
resolveCellComponent: (type: string, renderFactory: any, props: any) => ReactNode | void;
|
|
4
4
|
resolveViewComponent: (type: string, renderFactory: any, props: any) => ReactNode | void;
|
|
5
|
+
resolveImageSource?: (source: string) => Promise<string>;
|
|
5
6
|
}
|
|
6
7
|
declare const GlobalContext: import("react").Context<GlobalContextValue>;
|
|
7
8
|
export default GlobalContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalContext.d.ts","sourceRoot":"","sources":["../../../Core/Context/GlobalContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,kBAAkB;IAC1B,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,SAAS,GAAG,IAAI,CAAC;IACzF,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,SAAS,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"GlobalContext.d.ts","sourceRoot":"","sources":["../../../Core/Context/GlobalContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,kBAAkB;IAC1B,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,SAAS,GAAG,IAAI,CAAC;IACzF,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,SAAS,GAAG,IAAI,CAAC;IACzF,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1D;AAED,QAAA,MAAM,aAAa,6CAGjB,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalContext.js","sourceRoot":"","sources":["../../../Core/Context/GlobalContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GlobalContext.js","sourceRoot":"","sources":["../../../Core/Context/GlobalContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAStC,MAAM,aAAa,GAAG,aAAa,CAAqB;IACtD,oBAAoB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC9B,oBAAoB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC/B,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC","sourcesContent":["import { createContext } from 'react';\nimport type { ReactNode } from 'react';\n\ninterface GlobalContextValue {\n resolveCellComponent: (type: string, renderFactory: any, props: any) => ReactNode | void;\n resolveViewComponent: (type: string, renderFactory: any, props: any) => ReactNode | void;\n resolveImageSource?: (source: string) => Promise<string>;\n}\n\nconst GlobalContext = createContext<GlobalContextValue>({\n resolveCellComponent: () => {},\n resolveViewComponent: () => {}\n});\n\nexport default GlobalContext;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SelectionCardDisplayProps } from '@pega/cosmos-react-core';
|
|
2
|
+
type CardImage = SelectionCardDisplayProps['image'];
|
|
3
|
+
declare const useResolvedImage: (image: CardImage) => CardImage;
|
|
4
|
+
export default useResolvedImage;
|
|
5
|
+
//# sourceMappingURL=useResolvedImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResolvedImage.d.ts","sourceRoot":"","sources":["../../../Core/Hooks/useResolvedImage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAIzE,KAAK,SAAS,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAOpD,QAAA,MAAM,gBAAgB,GAAI,OAAO,SAAS,KAAG,SAgC5C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useContext, useEffect, useState } from 'react';
|
|
2
|
+
import GlobalContext from '../Context/GlobalContext';
|
|
3
|
+
const useResolvedImage = (image) => {
|
|
4
|
+
const { resolveImageSource } = useContext(GlobalContext);
|
|
5
|
+
const source = image && 'src' in image ? image.src : undefined;
|
|
6
|
+
const [resolved, setResolved] = useState();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!source || !resolveImageSource)
|
|
9
|
+
return undefined;
|
|
10
|
+
let isActive = true;
|
|
11
|
+
Promise.resolve()
|
|
12
|
+
.then(() => resolveImageSource(source))
|
|
13
|
+
.then(resolvedSource => {
|
|
14
|
+
if (isActive)
|
|
15
|
+
setResolved({ source, resolvedSource: resolvedSource || '' });
|
|
16
|
+
}, () => {
|
|
17
|
+
if (isActive) {
|
|
18
|
+
setResolved({ source, resolvedSource: '' });
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return () => {
|
|
22
|
+
isActive = false;
|
|
23
|
+
};
|
|
24
|
+
}, [resolveImageSource, source]);
|
|
25
|
+
if (!image || !('src' in image) || !resolveImageSource || !source)
|
|
26
|
+
return image;
|
|
27
|
+
const resolvedSource = resolved?.source === source ? resolved.resolvedSource : '';
|
|
28
|
+
return resolvedSource ? { ...image, src: resolvedSource } : undefined;
|
|
29
|
+
};
|
|
30
|
+
export default useResolvedImage;
|
|
31
|
+
//# sourceMappingURL=useResolvedImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|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,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAEhF,MAAM,cAAc,GAAG,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAClF,OAAO,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACxE,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { useContext, useEffect, useState } from 'react';\n\nimport type { SelectionCardDisplayProps } from '@pega/cosmos-react-core';\n\nimport GlobalContext from '../Context/GlobalContext';\n\ntype CardImage = SelectionCardDisplayProps['image'];\n\ninterface ResolvedImageSource {\n source: string;\n resolvedSource: string;\n}\n\nconst useResolvedImage = (image: CardImage): CardImage => {\n const { resolveImageSource } = useContext(GlobalContext);\n const source = image && 'src' in image ? image.src : undefined;\n const [resolved, setResolved] = useState<ResolvedImageSource>();\n\n useEffect(() => {\n if (!source || !resolveImageSource) return undefined;\n\n let isActive = true;\n\n Promise.resolve()\n .then(() => resolveImageSource(source))\n .then(\n resolvedSource => {\n if (isActive) setResolved({ source, resolvedSource: resolvedSource || '' });\n },\n () => {\n if (isActive) {\n setResolved({ source, resolvedSource: '' });\n }\n }\n );\n\n return () => {\n isActive = false;\n };\n }, [resolveImageSource, source]);\n\n if (!image || !('src' in image) || !resolveImageSource || !source) return image;\n\n const resolvedSource = resolved?.source === source ? resolved.resolvedSource : '';\n return resolvedSource ? { ...image, src: resolvedSource } : undefined;\n};\n\nexport default useResolvedImage;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryCard.d.ts","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryCard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"GalleryCard.d.ts","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryCard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAMzD,QAAA,MAAM,WAAW,wGACmD,gBAAgB,6CAqDnF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo, useCallback } from 'react';
|
|
3
3
|
import { SelectionCardDisplay } from '@pega/cosmos-react-core';
|
|
4
4
|
import { getCardData, getCardUIProps } from '../../../Components/Card';
|
|
5
|
+
import useResolvedImage from '../../../Hooks/useResolvedImage';
|
|
5
6
|
import useTranslate from '../../../Hooks/useTranslate';
|
|
6
7
|
import fetchRowActions from '../../../Utils/fetchRowActions';
|
|
7
8
|
const GalleryCard = memo(({ headerColumn, subHeadingsColumns, row, meta, visibleColumns }) => {
|
|
@@ -13,12 +14,13 @@ const GalleryCard = memo(({ headerColumn, subHeadingsColumns, row, meta, visible
|
|
|
13
14
|
headerColumn,
|
|
14
15
|
subHeadingsColumns
|
|
15
16
|
});
|
|
17
|
+
const resolvedImage = useResolvedImage(image);
|
|
16
18
|
const uiProps = getCardUIProps({ row });
|
|
17
19
|
const [translate] = useTranslate();
|
|
18
20
|
const fetchActions = useCallback(() => fetchRowActions({ getExecutionContext: row.getContext, meta, translate }), [meta, row, translate]);
|
|
19
21
|
const { onCardClick } = meta.galleryConfig ?? {};
|
|
20
22
|
const rowData = onCardClick ? row.getContext().getValue() : undefined;
|
|
21
|
-
return (_jsx(SelectionCardDisplay, { "aria-label": ariaLabel, label: label, subheading: subheading, headingTag: 'h3', image:
|
|
23
|
+
return (_jsx(SelectionCardDisplay, { "aria-label": ariaLabel, label: label, subheading: subheading, headingTag: 'h3', image: resolvedImage, fields: fields, "data-gallery-card": true, actions: meta.editing || meta.deleting ? fetchActions : undefined, ...uiProps, footer: footer, ...(onCardClick &&
|
|
22
24
|
rowData && {
|
|
23
25
|
onClick: () => onCardClick(rowData),
|
|
24
26
|
onKeyDown: (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryCard.js","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAE7D,MAAM,WAAW,GAAG,IAAI,CACtB,CAAC,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAoB,EAAE,EAAE;IACpF,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IACjE,MAAM,EACJ,KAAK,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,YAAY,EAAE,SAAS,EACxB,GAAG,WAAW,CAAC;QACd,GAAG;QACH,cAAc;QACd,UAAU;QACV,YAAY;QACZ,kBAAkB;KACnB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"GalleryCard.js","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,gBAAgB,MAAM,iCAAiC,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,6BAEd,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,KAC7D,OAAO,EACX,MAAM,EAAE,MAAM,KACV,CAAC,WAAW;YACd,OAAO,IAAI;YACT,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;YACnC,SAAS,EAAE,CAAC,CAAgB,EAAE,EAAE;gBAC9B,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;oBACvC,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,WAAW,CAAC,OAAO,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;SACF,CAAC,GACJ,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { memo, useCallback } from 'react';\nimport type { KeyboardEvent } from 'react';\n\nimport { SelectionCardDisplay } from '@pega/cosmos-react-core';\n\nimport type { GalleryCardProps } from '../Gallery.types';\nimport { getCardData, getCardUIProps } from '../../../Components/Card';\nimport useResolvedImage from '../../../Hooks/useResolvedImage';\nimport useTranslate from '../../../Hooks/useTranslate';\nimport fetchRowActions from '../../../Utils/fetchRowActions';\n\nconst GalleryCard = memo(\n ({ headerColumn, subHeadingsColumns, row, meta, visibleColumns }: GalleryCardProps) => {\n const cardConfig = { ...meta.galleryConfig, ...meta.cardConfig };\n const {\n label,\n subheading,\n image,\n footer,\n fields,\n 'aria-label': ariaLabel\n } = getCardData({\n row,\n visibleColumns,\n cardConfig,\n headerColumn,\n subHeadingsColumns\n });\n const resolvedImage = useResolvedImage(image);\n\n const uiProps = getCardUIProps({ row });\n const [translate] = useTranslate();\n const fetchActions = useCallback(\n () => fetchRowActions({ getExecutionContext: row.getContext, meta, translate }),\n [meta, row, translate]\n );\n const { onCardClick } = meta.galleryConfig ?? {};\n\n const rowData = onCardClick ? row.getContext().getValue() : undefined;\n\n return (\n <SelectionCardDisplay\n aria-label={ariaLabel}\n label={label}\n subheading={subheading}\n headingTag='h3'\n image={resolvedImage}\n fields={fields}\n data-gallery-card\n actions={meta.editing || meta.deleting ? fetchActions : undefined}\n {...uiProps}\n footer={footer}\n {...(onCardClick &&\n rowData && {\n onClick: () => onCardClick(rowData),\n onKeyDown: (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onCardClick(rowData);\n }\n }\n })}\n />\n );\n }\n);\n\nexport default GalleryCard;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryCheckboxCard.d.ts","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryCheckboxCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"GalleryCheckboxCard.d.ts","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryCheckboxCard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAMzD,UAAU,wBAAyB,SAAQ,gBAAgB;IACzD,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC;CACrC;AAED,QAAA,MAAM,mBAAmB,qGACwC,wBAAwB,6CAmDxF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo, useCallback } from 'react';
|
|
3
3
|
import { CheckboxCard } from '@pega/cosmos-react-core';
|
|
4
4
|
import { getCardData, getCardUIProps } from '../../../Components/Card';
|
|
5
|
+
import useResolvedImage from '../../../Hooks/useResolvedImage';
|
|
5
6
|
import useTranslate from '../../../Hooks/useTranslate';
|
|
6
7
|
import fetchRowActions from '../../../Utils/fetchRowActions';
|
|
7
8
|
const GalleryCheckboxCard = memo(({ headerColumn, selectionColumn, row, meta, visibleColumns }) => {
|
|
@@ -12,6 +13,7 @@ const GalleryCheckboxCard = memo(({ headerColumn, selectionColumn, row, meta, vi
|
|
|
12
13
|
cardConfig,
|
|
13
14
|
headerColumn
|
|
14
15
|
});
|
|
16
|
+
const resolvedImage = useResolvedImage(image);
|
|
15
17
|
const uiProps = getCardUIProps({ row });
|
|
16
18
|
const { selectRow, getContext } = row;
|
|
17
19
|
const disableSelectionOnLoad = selectionColumn
|
|
@@ -22,7 +24,7 @@ const GalleryCheckboxCard = memo(({ headerColumn, selectionColumn, row, meta, vi
|
|
|
22
24
|
const handleChange = useCallback((event) => selectRow(event.target.checked), [row, selectRow]);
|
|
23
25
|
const [translate] = useTranslate();
|
|
24
26
|
const fetchActions = useCallback(() => fetchRowActions({ getExecutionContext: row.getContext, meta, translate }), [meta, row, translate]);
|
|
25
|
-
return (_jsx(CheckboxCard, { "aria-label": ariaLabel, label: label, headingTag: 'h3', image:
|
|
27
|
+
return (_jsx(CheckboxCard, { "aria-label": ariaLabel, label: label, headingTag: 'h3', image: resolvedImage, fields: fields, "data-gallery-card": true, onChange: handleChange, checked: getContext()?.$selected, readOnly: disableSelection, ...uiProps, actions: meta.editing || meta.deleting ? fetchActions : undefined }));
|
|
26
28
|
});
|
|
27
29
|
export default GalleryCheckboxCard;
|
|
28
30
|
//# sourceMappingURL=GalleryCheckboxCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryCheckboxCard.js","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryCheckboxCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAoB,MAAM,OAAO,CAAC;AAG5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAM7D,MAAM,mBAAmB,GAAG,IAAI,CAC9B,CAAC,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAA4B,EAAE,EAAE;IACzF,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IACjE,MAAM,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,YAAY,EAAE,SAAS,EACxB,GAAG,WAAW,CAAC;QACd,GAAG;QACH,cAAc;QACd,UAAU;QACV,YAAY;KACb,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"GalleryCheckboxCard.js","sourceRoot":"","sources":["../../../../../Core/Views/Gallery/Components/GalleryCheckboxCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAoB,MAAM,OAAO,CAAC;AAG5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,YAAY,MAAM,6BAA6B,CAAC;AACvD,OAAO,eAAe,MAAM,gCAAgC,CAAC;AAM7D,MAAM,mBAAmB,GAAG,IAAI,CAC9B,CAAC,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAA4B,EAAE,EAAE;IACzF,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IACjE,MAAM,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,YAAY,EAAE,SAAS,EACxB,GAAG,WAAW,C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ACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { memo, useCallback, type ChangeEvent } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport { CheckboxCard } from '@pega/cosmos-react-core';\n\nimport type { GalleryCardProps } from '../Gallery.types';\nimport { getCardData, getCardUIProps } from '../../../Components/Card';\nimport useResolvedImage from '../../../Hooks/useResolvedImage';\nimport useTranslate from '../../../Hooks/useTranslate';\nimport fetchRowActions from '../../../Utils/fetchRowActions';\n\ninterface GalleryCheckboxCardProps extends GalleryCardProps {\n selectionColumn: RsCoreTypes.Column;\n}\n\nconst GalleryCheckboxCard = memo(\n ({ headerColumn, selectionColumn, row, meta, visibleColumns }: GalleryCheckboxCardProps) => {\n const cardConfig = { ...meta.galleryConfig, ...meta.cardConfig };\n const {\n label,\n image,\n fields,\n 'aria-label': ariaLabel\n } = getCardData({\n row,\n visibleColumns,\n cardConfig,\n headerColumn\n });\n const resolvedImage = useResolvedImage(image);\n\n const uiProps = getCardUIProps({ row });\n\n const { selectRow, getContext } = row;\n const disableSelectionOnLoad = selectionColumn\n .getContext()\n ?.getRsMeta()?.disableSelectionOnLoad;\n // TODO: identify the usecase for column.disableSelection. Keeping it for now to keep the behavior in sync with RowSelectionColumn in table.\n const disableSelection = selectionColumn.disableSelection ?? disableSelectionOnLoad;\n\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => selectRow(event.target.checked),\n [row, selectRow]\n );\n\n const [translate] = useTranslate();\n const fetchActions = useCallback(\n () => fetchRowActions({ getExecutionContext: row.getContext, meta, translate }),\n [meta, row, translate]\n );\n\n return (\n <CheckboxCard\n aria-label={ariaLabel}\n label={label}\n headingTag='h3'\n image={resolvedImage}\n fields={fields}\n data-gallery-card\n onChange={handleChange}\n checked={getContext()?.$selected}\n readOnly={disableSelection}\n {...uiProps}\n actions={meta.editing || meta.deleting ? fetchActions : undefined}\n />\n );\n }\n);\n\nexport default GalleryCheckboxCard;\n"]}
|
package/lib/Core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Core/index.jsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,yDAFa,OAAO,OAAO,EAAE,wBAAwB,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,UAAU,EAAE,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Core/index.jsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,yDAFa,OAAO,OAAO,EAAE,wBAAwB,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,KAAK,EAAE,OAAO,UAAU,EAAE,wBAAwB,CAAC,CA0DvI"}
|
package/lib/Core/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { ToolbarProvider } from './Context/ToolbarContext';
|
|
|
10
10
|
*/
|
|
11
11
|
export default function repeatComponent(Component) {
|
|
12
12
|
return function RepeatInnerComponent(props, ref) {
|
|
13
|
-
const { meta, apiContext, persistedInfo, renderFactory, renderFormatterTypeMap, onViewReady, formatters, mode, toolBarOptions, presets, errors, additionalInfo, styleFormats } = props;
|
|
13
|
+
const { meta, apiContext, persistedInfo, renderFactory, renderFormatterTypeMap, onViewReady, formatters, mode, toolBarOptions, presets, errors, additionalInfo, styleFormats, resolveImageSource } = props;
|
|
14
14
|
const instance = useRepeat({
|
|
15
15
|
meta,
|
|
16
16
|
apiContext,
|
|
@@ -28,7 +28,8 @@ export default function repeatComponent(Component) {
|
|
|
28
28
|
useReactToProps(errors, instance);
|
|
29
29
|
const globalContext = useMemo(() => ({
|
|
30
30
|
resolveCellComponent,
|
|
31
|
-
resolveViewComponent
|
|
31
|
+
resolveViewComponent,
|
|
32
|
+
resolveImageSource
|
|
32
33
|
}), []);
|
|
33
34
|
const toolbarContextValue = useMemo(() => ({ additionalInfo }), [additionalInfo]);
|
|
34
35
|
// TODO : Freeze view object before passing it down to component except columns.
|
package/lib/Core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Core/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS;IAC/C,OAAO,SAAS,oBAAoB,CAAC,KAAK,EAAE,GAAG;QAC7C,MAAM,EACJ,IAAI,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,UAAU,EACV,IAAI,EACJ,cAAc,EACd,OAAO,EACP,MAAM,EACN,cAAc,EACd,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Core/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS;IAC/C,OAAO,SAAS,oBAAoB,CAAC,KAAK,EAAE,GAAG;QAC7C,MAAM,EACJ,IAAI,EACJ,UAAU,EACV,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,WAAW,EACX,UAAU,EACV,IAAI,EACJ,cAAc,EACd,OAAO,EACP,MAAM,EACN,cAAc,EACd,YAAY,EACZ,kBAAkB,EACnB,GAAG,KAAK,CAAC;QAEV,MAAM,QAAQ,GAAG,SAAS,CAAC;YACzB,IAAI;YACJ,UAAU;YACV,aAAa;YACb,aAAa;YACb,sBAAsB;YACtB,WAAW;YACX,UAAU;YACV,IAAI;YACJ,cAAc;YACd,OAAO;YACP,YAAY;YACZ,uBAAuB,EAAE,GAAG;SAC7B,CAAC,CAAC;QAEH,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAClC,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,CAAC;YACL,oBAAoB;YACpB,oBAAoB;YACpB,kBAAkB;SACnB,CAAC,EACF,EAAE,CACH,CAAC;QAEF,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;QAElF,gFAAgF;QAEhF,OAAO,CACL,KAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,YAC1C,KAAC,eAAe,IAAC,KAAK,EAAE,mBAAmB,YACzC,KAAC,SAAS,IAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,EAAE,GAAI,GACvB,GACK,CAC1B,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { useMemo } from 'react';\n\nimport {\n resolveCellComponent,\n resolveViewComponent\n} from './Components/RenderingEngine/ComponentResolverFactory';\nimport GlobalContext from './Context/GlobalContext';\nimport useRepeat from './Hooks/useRepeat';\nimport useReactToProps from './Hooks/useReactToProps';\nimport { ToolbarProvider } from './Context/ToolbarContext';\n\n/**\n * @returns {import('react').ForwardRefRenderFunction<import('../types').RsCoreTypes.RsApi, import('../types').RepeatingStructuresProps>}\n */\nexport default function repeatComponent(Component) {\n return function RepeatInnerComponent(props, ref) {\n const {\n meta,\n apiContext,\n persistedInfo,\n renderFactory,\n renderFormatterTypeMap,\n onViewReady,\n formatters,\n mode,\n toolBarOptions,\n presets,\n errors,\n additionalInfo,\n styleFormats,\n resolveImageSource\n } = props;\n\n const instance = useRepeat({\n meta,\n apiContext,\n persistedInfo,\n renderFactory,\n renderFormatterTypeMap,\n onViewReady,\n formatters,\n mode,\n toolBarOptions,\n presets,\n styleFormats,\n repeatComponentInstance: ref\n });\n\n useReactToProps(errors, instance);\n const globalContext = useMemo(\n () => ({\n resolveCellComponent,\n resolveViewComponent,\n resolveImageSource\n }),\n []\n );\n\n const toolbarContextValue = useMemo(() => ({ additionalInfo }), [additionalInfo]);\n\n // TODO : Freeze view object before passing it down to component except columns.\n\n return (\n <GlobalContext.Provider value={globalContext}>\n <ToolbarProvider value={toolbarContextValue}>\n <Component view={instance.getView()} />\n </ToolbarProvider>\n </GlobalContext.Provider>\n );\n };\n}\n"]}
|
|
@@ -92,6 +92,8 @@ export type RepeatingStructuresProps = {
|
|
|
92
92
|
persistedInfo?: RsCoreTypes.PersonalizedState;
|
|
93
93
|
/** A meta data object to provide definition of repeating structure */
|
|
94
94
|
meta: RsCoreTypes.Meta;
|
|
95
|
+
/** Resolves gallery image sources for rendering, including authenticated assets when needed. */
|
|
96
|
+
resolveImageSource?: (source: string) => Promise<string>;
|
|
95
97
|
/** A set of api's provided to repeating structure to establish communication b/w repeating structure and its consumer (e.g. providing data to repeating structure) */
|
|
96
98
|
apiContext: RsCoreTypes.ApiContext;
|
|
97
99
|
/** To provide multiple variants of metadata of repeating structures. If multiple variations is provided make sure the first variation should be part of {@link RepeatingStructuresProps.meta meta} key and rest all should be fed to presets. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatingStructuresBoot.types.d.ts","sourceRoot":"","sources":["../../types/RepeatingStructuresBoot.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAA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cAAc,CAAC,SAAS,CAAC,CAAC;IAEhD,iIAAiI;IACjI,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAEnC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAE5B;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,CACd,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,WAAW,CAAC,QAAQ,KACzB,IAAI,CAAC,yBAAyB,EAAE,WAAW,CAAC,GAAG,yBAAyB,CAAC;IAE9E,yGAAyG;IACzG,sBAAsB,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;IAE9E;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,gBAAgB,EAAE,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE3F,oEAAoE;IACpE,UAAU,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAEtD;;;OAGG;IACH,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;IAE/B,4FAA4F;IAC5F,cAAc,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAE9D,+EAA+E;IAC/E,cAAc,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAGpD,YAAY,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RepeatingStructuresBoot.types.js","sourceRoot":"","sources":["../../types/RepeatingStructuresBoot.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode, Ref } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { FormControlProps, IconName, OmitStrict } from '@pega/cosmos-react-core';\nimport type { RsApi } from 'pega-repeating-structures-core/lib/types/ApiContext.types';\nimport type RsCoreBootArgs from 'pega-repeating-structures-core/lib/types/RsCoreBootArgs.types';\n\ntype PropsFromRenderFactory = Pick<RsCoreTypes.RenderFactoryWithProps, 'props'>;\ntype ColumnContext = ReturnType<RsCoreTypes.Column['getContext']>;\ntype ViewContext = ReturnType<RsCoreTypes.View['getContext']>;\n\n// Contract for Cell renderer props.\n/**\n * A set of props that will be exposed to Cell renderers.\n *\n */\ntype CellRendererProps = {\n /** Reference to the cell body element */\n getElement: () => HTMLElement;\n /** Styles applicable to current cell. This should be applied to cell renderers.\n * This is method is only available for data cells.\n */\n getStyles?: () => {\n /**\n * Foreground color applicable to the cell content, otherwise undefined.\n *\n * Note: This will be applied by default to `cell container`(having class `cell-content`) of repeating structures.\n *\n * Supports standard CSS color formats like below:\n * - Named colors: `'red'`, `'blue'`, `'green'`, `'yellow'`, `'black'`, `'white'`, etc.\n * - Hex codes: `'#RRGGBB'`, `'#RGB'`, `'#RRGGBBAA'`, `'#RGBA'`\n * - RGB: `'rgb(255, 0, 0)'`\n * - RGBA: `'rgba(255, 0, 0, 0.5)'`\n *\n * Optional\n */\n foregroundColor?: string;\n };\n /** Formatted value of the cell. */\n value: ReturnType<ColumnContext['getFormattedValue']>;\n /** Tooltip value of the cell. */\n title: ReturnType<ColumnContext['getToolTipValue']>;\n} & ColumnContext &\n PropsFromRenderFactory;\n\n// Contract for View renderer props.\ntype ExternalStateInfo = {\n /** External state key and its persisted value in the RS state. Supported external state keys are:\n * - Value of {@link RsCoreTypes.Meta.externalFilters externalFilters}\n */\n [externalStateKey: string]: NonNullable<RsCoreTypes.State['externalState']>[''];\n};\n\n/**\n * A set of props that will be exposed to View renderer. Supported view renderers are:\n * - Renderer for {@link RsCoreTypes.Meta.externalFilters externalFilters}\n */\ntype ViewRendererProps = ViewContext & {\n /** A unique id to identify the current repeating structure. */\n rsID: RsCoreTypes.View['rsID'];\n} & ExternalStateInfo &\n PropsFromRenderFactory;\n\ntype FormatSettingsRendererProps = {\n ref: Ref<{ validate: () => boolean }>;\n formatting: { type: string; config: unknown };\n onChange: (config: unknown) => void;\n};\n\ntype RendererProps = CellRendererProps | ViewRendererProps | FormatSettingsRendererProps;\n\n// RsCore exposes generic function types for `component`.\n// For RepeatingStructures, these types are overridden to include additional renderer props, and the return type is specified as ReactNode.\nexport interface RsRenderFactoryReturnType\n extends OmitStrict<RsCoreTypes.RenderFactoryWithProps, 'component'> {\n /**\n * A function that accepts component props and returns a React node to be rendered as a cell within repeating structures.\n * @param props - The props passed by repeating structures and {@link PropsFromRenderFactory static props } from the render factory.\n * @returns The component function or null or undefined. If component definition is null/undefined then cell will be rendered directly with value derived for the cell or the formatted value(if {@link RsCoreTypes.RsCoreInitArgs.formatters formatters} are provided for that column)\n */\n component: ((props: RendererProps) => ReactNode) | null | undefined;\n}\n\ntype RsCoreStyleFormat = NonNullable<RsCoreTypes.RsCoreInitArgs['styleFormats']>[number];\ninterface RsStyleFormatConfig extends OmitStrict<RsCoreStyleFormat['config'], 'icon'> {\n /**\n * An icon used as a visual indicator of the applied format.\n * Optional.\n */\n icon?: {\n /** Icon from 'budicon' set of cosmos. */\n name: IconName;\n /** The color of icon. */\n color: string;\n };\n}\n\n// RS can only accept icons that are supported in cosmos, while RsCore accepts icon generically, therefore overriding the interface.\nexport interface RsStyleFormat extends OmitStrict<RsCoreStyleFormat, 'config'> {\n config: RsStyleFormatConfig;\n}\n\nexport type RepeatingStructuresProps = {\n /** An initial state that can be provided to repeating structure to load repeating structure instance with that state.\\\n * **Note**: If {@link RSTypes.Meta.personalization personalization} in meta is set to true then persistedInfo will be ignored. */\n persistedInfo?: RsCoreTypes.PersonalizedState;\n\n /** A meta data object to provide definition of repeating structure */\n meta: RsCoreTypes.Meta;\n\n /** A set of api's provided to repeating structure to establish communication b/w repeating structure and its consumer (e.g. providing data to repeating structure) */\n apiContext: RsCoreTypes.ApiContext;\n\n /** To provide multiple variants of metadata of repeating structures. If multiple variations is provided make sure the first variation should be part of {@link RepeatingStructuresProps.meta meta} key and rest all should be fed to presets. */\n presets?: RsCoreTypes.RsCoreInitArgs['presets'];\n\n /** A debug mode will print logs in console for the action dispatched by RsCore and the state derived after consumption of it. */\n mode?: 'info' | 'debug' | 'normal';\n\n errors?: RsCoreTypes.Errors;\n\n /** This should be a factory function that returns component or component definition for specified type.\n * @param type -\n * - For cell renderer - Value of {@link RsCoreTypes.FieldDef.cellRenderer cellRenderer}(if added in fieldDefs of that column).\n * - For view renderer - Value of supported external view renderers in `Meta`. Supported view renderer is {@link RsCoreTypes.Meta.externalFilters externalFilters}.\n *\n * @param field - Metadata which contains info configured for that column. Applicable only in case of `cell renderer`.\n * @returns It should return a component definition (or an object that contains component definition).\n * This component definition will be used by RepeatingStructures to render a cell with the component provided by renderFactory.\n * If component definition is not provided from render factory or renderFactory is not provided to Repeating structures then cell will be rendered directly with value derived for the cell or the formatted value(if {@link RsCoreTypes.RsCoreInitArgs.formatters formatters} are provided for that column)\n */\n renderFactory?: (\n type: string,\n field?: RsCoreTypes.FieldDef\n ) => Pick<RsRenderFactoryReturnType, 'component'> | RsRenderFactoryReturnType;\n\n /** A map of formatters that will be displayed to consumer to format a fieldDef in repeating structure */\n renderFormatterTypeMap?: RsCoreTypes.RsCoreInitArgs['renderFormatterTypeMap'];\n\n /**\n * This function acts as a callback that is invoked when the view is ready\n * @param utilityCallbacks - Few utility callbacks to interact with Repeating structures.\n * @returns {void} void\n */\n onViewReady?: (utilityCallbacks: Pick<RsApi, 'setRecordCount' | 'dispatchAction'>) => void;\n\n /** An object of formatter functions which formats the raw value. */\n formatters?: RsCoreTypes.RsCoreInitArgs['formatters'];\n\n /** A set of style formatters to be applied on FieldDef. E.g. background, icon.\n *\n * **Note**: Style formats are only supported for `Table` template.\n */\n styleFormats?: RsStyleFormat[];\n\n /** A list of all the toolbar actions to be displayed at the top of a repeating structure */\n toolBarOptions?: RsCoreTypes.RsCoreInitArgs['toolBarOptions'];\n\n /** Pass a heading and content to show additional information in the toolbar */\n additionalInfo?: FormControlProps['additionalInfo'];\n\n /* Used to provide localized strings, typically overriding default translations */\n translations?: RsCoreBootArgs['translations'];\n};\n"]}
|
|
1
|
+
{"version":3,"file":"RepeatingStructuresBoot.types.js","sourceRoot":"","sources":["../../types/RepeatingStructuresBoot.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode, Ref } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { FormControlProps, IconName, OmitStrict } from '@pega/cosmos-react-core';\nimport type { RsApi } from 'pega-repeating-structures-core/lib/types/ApiContext.types';\nimport type RsCoreBootArgs from 'pega-repeating-structures-core/lib/types/RsCoreBootArgs.types';\n\ntype PropsFromRenderFactory = Pick<RsCoreTypes.RenderFactoryWithProps, 'props'>;\ntype ColumnContext = ReturnType<RsCoreTypes.Column['getContext']>;\ntype ViewContext = ReturnType<RsCoreTypes.View['getContext']>;\n\n// Contract for Cell renderer props.\n/**\n * A set of props that will be exposed to Cell renderers.\n *\n */\ntype CellRendererProps = {\n /** Reference to the cell body element */\n getElement: () => HTMLElement;\n /** Styles applicable to current cell. This should be applied to cell renderers.\n * This is method is only available for data cells.\n */\n getStyles?: () => {\n /**\n * Foreground color applicable to the cell content, otherwise undefined.\n *\n * Note: This will be applied by default to `cell container`(having class `cell-content`) of repeating structures.\n *\n * Supports standard CSS color formats like below:\n * - Named colors: `'red'`, `'blue'`, `'green'`, `'yellow'`, `'black'`, `'white'`, etc.\n * - Hex codes: `'#RRGGBB'`, `'#RGB'`, `'#RRGGBBAA'`, `'#RGBA'`\n * - RGB: `'rgb(255, 0, 0)'`\n * - RGBA: `'rgba(255, 0, 0, 0.5)'`\n *\n * Optional\n */\n foregroundColor?: string;\n };\n /** Formatted value of the cell. */\n value: ReturnType<ColumnContext['getFormattedValue']>;\n /** Tooltip value of the cell. */\n title: ReturnType<ColumnContext['getToolTipValue']>;\n} & ColumnContext &\n PropsFromRenderFactory;\n\n// Contract for View renderer props.\ntype ExternalStateInfo = {\n /** External state key and its persisted value in the RS state. Supported external state keys are:\n * - Value of {@link RsCoreTypes.Meta.externalFilters externalFilters}\n */\n [externalStateKey: string]: NonNullable<RsCoreTypes.State['externalState']>[''];\n};\n\n/**\n * A set of props that will be exposed to View renderer. Supported view renderers are:\n * - Renderer for {@link RsCoreTypes.Meta.externalFilters externalFilters}\n */\ntype ViewRendererProps = ViewContext & {\n /** A unique id to identify the current repeating structure. */\n rsID: RsCoreTypes.View['rsID'];\n} & ExternalStateInfo &\n PropsFromRenderFactory;\n\ntype FormatSettingsRendererProps = {\n ref: Ref<{ validate: () => boolean }>;\n formatting: { type: string; config: unknown };\n onChange: (config: unknown) => void;\n};\n\ntype RendererProps = CellRendererProps | ViewRendererProps | FormatSettingsRendererProps;\n\n// RsCore exposes generic function types for `component`.\n// For RepeatingStructures, these types are overridden to include additional renderer props, and the return type is specified as ReactNode.\nexport interface RsRenderFactoryReturnType\n extends OmitStrict<RsCoreTypes.RenderFactoryWithProps, 'component'> {\n /**\n * A function that accepts component props and returns a React node to be rendered as a cell within repeating structures.\n * @param props - The props passed by repeating structures and {@link PropsFromRenderFactory static props } from the render factory.\n * @returns The component function or null or undefined. If component definition is null/undefined then cell will be rendered directly with value derived for the cell or the formatted value(if {@link RsCoreTypes.RsCoreInitArgs.formatters formatters} are provided for that column)\n */\n component: ((props: RendererProps) => ReactNode) | null | undefined;\n}\n\ntype RsCoreStyleFormat = NonNullable<RsCoreTypes.RsCoreInitArgs['styleFormats']>[number];\ninterface RsStyleFormatConfig extends OmitStrict<RsCoreStyleFormat['config'], 'icon'> {\n /**\n * An icon used as a visual indicator of the applied format.\n * Optional.\n */\n icon?: {\n /** Icon from 'budicon' set of cosmos. */\n name: IconName;\n /** The color of icon. */\n color: string;\n };\n}\n\n// RS can only accept icons that are supported in cosmos, while RsCore accepts icon generically, therefore overriding the interface.\nexport interface RsStyleFormat extends OmitStrict<RsCoreStyleFormat, 'config'> {\n config: RsStyleFormatConfig;\n}\n\nexport type RepeatingStructuresProps = {\n /** An initial state that can be provided to repeating structure to load repeating structure instance with that state.\\\n * **Note**: If {@link RSTypes.Meta.personalization personalization} in meta is set to true then persistedInfo will be ignored. */\n persistedInfo?: RsCoreTypes.PersonalizedState;\n\n /** A meta data object to provide definition of repeating structure */\n meta: RsCoreTypes.Meta;\n\n /** Resolves gallery image sources for rendering, including authenticated assets when needed. */\n resolveImageSource?: (source: string) => Promise<string>;\n\n /** A set of api's provided to repeating structure to establish communication b/w repeating structure and its consumer (e.g. providing data to repeating structure) */\n apiContext: RsCoreTypes.ApiContext;\n\n /** To provide multiple variants of metadata of repeating structures. If multiple variations is provided make sure the first variation should be part of {@link RepeatingStructuresProps.meta meta} key and rest all should be fed to presets. */\n presets?: RsCoreTypes.RsCoreInitArgs['presets'];\n\n /** A debug mode will print logs in console for the action dispatched by RsCore and the state derived after consumption of it. */\n mode?: 'info' | 'debug' | 'normal';\n\n errors?: RsCoreTypes.Errors;\n\n /** This should be a factory function that returns component or component definition for specified type.\n * @param type -\n * - For cell renderer - Value of {@link RsCoreTypes.FieldDef.cellRenderer cellRenderer}(if added in fieldDefs of that column).\n * - For view renderer - Value of supported external view renderers in `Meta`. Supported view renderer is {@link RsCoreTypes.Meta.externalFilters externalFilters}.\n *\n * @param field - Metadata which contains info configured for that column. Applicable only in case of `cell renderer`.\n * @returns It should return a component definition (or an object that contains component definition).\n * This component definition will be used by RepeatingStructures to render a cell with the component provided by renderFactory.\n * If component definition is not provided from render factory or renderFactory is not provided to Repeating structures then cell will be rendered directly with value derived for the cell or the formatted value(if {@link RsCoreTypes.RsCoreInitArgs.formatters formatters} are provided for that column)\n */\n renderFactory?: (\n type: string,\n field?: RsCoreTypes.FieldDef\n ) => Pick<RsRenderFactoryReturnType, 'component'> | RsRenderFactoryReturnType;\n\n /** A map of formatters that will be displayed to consumer to format a fieldDef in repeating structure */\n renderFormatterTypeMap?: RsCoreTypes.RsCoreInitArgs['renderFormatterTypeMap'];\n\n /**\n * This function acts as a callback that is invoked when the view is ready\n * @param utilityCallbacks - Few utility callbacks to interact with Repeating structures.\n * @returns {void} void\n */\n onViewReady?: (utilityCallbacks: Pick<RsApi, 'setRecordCount' | 'dispatchAction'>) => void;\n\n /** An object of formatter functions which formats the raw value. */\n formatters?: RsCoreTypes.RsCoreInitArgs['formatters'];\n\n /** A set of style formatters to be applied on FieldDef. E.g. background, icon.\n *\n * **Note**: Style formats are only supported for `Table` template.\n */\n styleFormats?: RsStyleFormat[];\n\n /** A list of all the toolbar actions to be displayed at the top of a repeating structure */\n toolBarOptions?: RsCoreTypes.RsCoreInitArgs['toolBarOptions'];\n\n /** Pass a heading and content to show additional information in the toolbar */\n additionalInfo?: FormControlProps['additionalInfo'];\n\n /* Used to provide localized strings, typically overriding default translations */\n translations?: RsCoreBootArgs['translations'];\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-react",
|
|
3
|
-
"version": "10.0.0-build.
|
|
3
|
+
"version": "10.0.0-build.15.0",
|
|
4
4
|
"description": "Repeating view structures such as Table, Gallery(Repeating layouts), Kanban etc.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|
|
@@ -14,18 +14,18 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-condition-builder": "10.0.0-build.
|
|
18
|
-
"@pega/cosmos-react-core": "10.0.0-build.
|
|
19
|
-
"@pega/cosmos-react-rte": "10.0.0-build.
|
|
20
|
-
"@pega/cosmos-react-work": "10.0.0-build.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "10.0.0-build.15.0",
|
|
18
|
+
"@pega/cosmos-react-core": "10.0.0-build.15.0",
|
|
19
|
+
"@pega/cosmos-react-rte": "10.0.0-build.15.0",
|
|
20
|
+
"@pega/cosmos-react-work": "10.0.0-build.15.0",
|
|
21
21
|
"@types/lodash-es": "^4.17.12",
|
|
22
22
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
23
23
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
24
24
|
"dayjs": "^1.11.13",
|
|
25
25
|
"fast-deep-equal": "^3.1.3",
|
|
26
26
|
"lodash-es": "^4.18.1",
|
|
27
|
-
"pega-repeating-structures-core": "npm:@pega/lists-core@10.0.0-build.
|
|
28
|
-
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@10.0.0-build.
|
|
27
|
+
"pega-repeating-structures-core": "npm:@pega/lists-core@10.0.0-build.15.0",
|
|
28
|
+
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@10.0.0-build.15.0",
|
|
29
29
|
"polished": "^4.1.0",
|
|
30
30
|
"prop-types": "^15.8.1",
|
|
31
31
|
"react": "^17.0.0 || ^18.0.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@testing-library/react": "^16.0.0",
|
|
44
44
|
"@testing-library/user-event": "^14.6.1",
|
|
45
45
|
"jest-axe": "^8.0.0",
|
|
46
|
-
"srs-utils": "10.0.0-build.
|
|
46
|
+
"srs-utils": "10.0.0-build.15.0",
|
|
47
47
|
"typescript": "~6.0.3"
|
|
48
48
|
}
|
|
49
49
|
}
|